Changeset c891a7e in git


Ignore:
Timestamp:
14/01/14 21:18:10 (6 years ago)
Author:
Olly Betts <olly@…>
Branches:
line_contents, master, stereo, travis-osx
Children:
5440c295
Parents:
db095f9
Message:

configure.ac,src/img.c: Only use _putenv_s() under MSVC - mingw
doesn't provide it.

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • ChangeLog

    rdb095f9 rc891a7e  
     1Tue Jan 14 21:17:38 GMT 2014  Olly Betts <olly@survex.com>
     2
     3        * configure.ac,src/img.c: Only use _putenv_s() under MSVC - mingw
     4          doesn't provide it.
     5
    16Tue Jan 14 21:14:51 GMT 2014  Olly Betts <olly@survex.com>
    27
  • configure.ac

    rdb095f9 rc891a7e  
    258258AC_CHECK_FUNCS([getc_unlocked putc_unlocked])
    259259
     260AC_CHECK_FUNCS([setenv unsetenv])
     261
    260262dnl try to find a case-insensitive compare
    261263
  • src/img.c

    rdb095f9 rc891a7e  
    161161    time_t r;
    162162    char * old_tz = getenv("TZ");
    163 #ifdef _WIN32
     163#ifdef _MSC_VER
    164164    if (old_tz) {
    165165        old_tz = my_strdup(old_tz);
     
    204204        return (time_t)-1;
    205205    }
     206#define CLEANUP() osfree(p)
    206207#endif
    207208    tzset();
    208209    r = mktime(tm);
    209210    if (old_tz) {
    210 #ifdef _WIN32
     211#ifdef _MSC_VER
    211212        _putenv_s("TZ", old_tz);
    212213#elif !defined HAVE_SETENV
    213214        putenv(old_tz);
    214         osfree(p);
    215215#else
    216216        setenv("TZ", old_tz, 1);
     
    218218        osfree(old_tz);
    219219    } else {
    220 #ifdef _WIN32
     220#ifdef _MSC_VER
    221221        _putenv_s("TZ", "");
    222222#elif !defined HAVE_UNSETENV
    223223        putenv((char*)"TZ");
    224         osfree(p);
    225224#else
    226225        unsetenv("TZ");
    227226#endif
    228227    }
     228#ifdef CLEANUP
     229    CLEANUP();
     230#undef CLEANUP
     231#endif
    229232    return r;
    230233}
Note: See TracChangeset for help on using the changeset viewer.