Changeset 34695


Ignore:
Timestamp:
Dec 3, 2008, 5:41:50 PM (16 years ago)
Author:
glynn
Message:

Various MinGW bugfixes from Rosen Matev

Location:
grass/trunk/lib/gis
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • grass/trunk/lib/gis/locale.c

    r34662 r34695  
    3131
    3232    setlocale(LC_CTYPE, "");
    33     setlocale(LC_MESSAGES, "");
    3433
    3534#if defined(HAVE_LIBINTL_H) && defined(USE_NLS)
     35#ifdef LC_MESSAGES
     36    setlocale(LC_MESSAGES, "");
     37#endif
     38
    3639    gisbase = getenv("GISBASE");
    3740    if (gisbase && *gisbase) {
  • grass/trunk/lib/gis/mach_name.c

    r34539 r34695  
    3232        strcpy(name, attname.nodename);
    3333    }
    34 #elif
     34#else
    3535    strcpy(name, "unknown");
    3636#endif
  • grass/trunk/lib/gis/spawn.c

    r34445 r34695  
    6262{
    6363    va_list va;
    64     char *args[MAX_ARGS];
     64    const char *args[MAX_ARGS];
    6565    int num_args = 0;
    6666
     
    6868
    6969    for (num_args = 0; num_args < MAX_ARGS;) {
    70         char *arg = va_arg(va, char *);
     70        const char *arg = va_arg(va, const char *);
    7171
    7272        args[num_args++] = arg;
     
    8282    }
    8383
    84     return _spawnv(_P_WAIT, (char *)command, args);
     84    return _spawnv(_P_WAIT, command, args);
    8585}
    8686
     
    208208#ifdef __MINGW32__
    209209
    210 static int do_redirects(struct redirect *redirects, int num_redirects)
     210static void do_redirects(struct redirect *redirects, int num_redirects)
    211211{
    212212    if (num_redirects > 0)
     
    225225}
    226226
    227 static int do_spawn(const char *command)
     227static int do_spawn(struct spawn *sp, const char *command)
    228228{
    229229    char **env;
    230230    int status;
    231231
    232     do_redirects(redirects, num_redirects);
    233     env = do_bindings(_environ, bindings, num_bindings);
     232    do_redirects(sp->redirects, sp->num_redirects);
     233    env = do_bindings(_environ, sp->bindings, sp->num_bindings);
    234234
    235235    status =
    236         spawnvpe(background ? _P_NOWAIT : _P_WAIT, command, (char **)args,
    237                  env);
    238 
    239     if (!background && status < 0)
     236        spawnvpe(sp->background ? _P_NOWAIT : _P_WAIT, command, sp->args, env);
     237
     238    if (!sp->background && status < 0)
    240239        G_warning(_("Unable to execute command"));
    241240
Note: See TracChangeset for help on using the changeset viewer.