From: ivmai Date: Thu, 15 Oct 2009 12:49:40 +0000 (+0000) Subject: 2009-10-15 Ivan Maidanski X-Git-Tag: gc7_2alpha4~51 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=45fa5861e89be4094d9c9224cdec2eb9c5caa47d;p=gc 2009-10-15 Ivan Maidanski * include/private/gcconfig.h: Recognize __i386__ if WinCE (for x86mingw32ce toolchain). * include/private/gcconfig.h (NO_GETENV): Don't define for CeGCC toolchain (or if already defined). * include/private/gcconfig.h (NO_GETENV_WIN32): New macro (always defined for WinCE or if NO_GETENV is defined). * misc.c (GC_CreateLogFile): Use NO_GETENV_WIN32 macro instead of NO_GETENV one. --- diff --git a/ChangeLog b/ChangeLog index fa961496..433dcf4a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2009-10-15 Ivan Maidanski + + * include/private/gcconfig.h: Recognize __i386__ if WinCE (for + x86mingw32ce toolchain). + * include/private/gcconfig.h (NO_GETENV): Don't define for CeGCC + toolchain (or if already defined). + * include/private/gcconfig.h (NO_GETENV_WIN32): New macro (always + defined for WinCE or if NO_GETENV is defined). + * misc.c (GC_CreateLogFile): Use NO_GETENV_WIN32 macro instead of + NO_GETENV one. + 2009-10-15 Ivan Maidanski (really Petter Urkedal) * configure.ac: Add AC_CONFIG_MACRO_DIR([m4]). diff --git a/include/private/gcconfig.h b/include/private/gcconfig.h index 86106636..9eac27bb 100644 --- a/include/private/gcconfig.h +++ b/include/private/gcconfig.h @@ -372,7 +372,7 @@ # if defined(SH3) || defined(SH4) # define SH # endif -# if defined(x86) +# if defined(x86) || defined(__i386__) # define I386 # endif # if defined(_M_ARM) || defined(ARM) || defined(_ARM_) @@ -2257,10 +2257,14 @@ # endif # endif -# if defined(MSWINCE) +# if defined(MSWINCE) && !defined(__CEGCC__) && !defined(NO_GETENV) # define NO_GETENV # endif +# if (defined(NO_GETENV) || defined(MSWINCE)) && !defined(NO_GETENV_WIN32) +# define NO_GETENV_WIN32 +# endif + # ifndef STRTOULL # if defined(_WIN64) && !defined(__GNUC__) # define STRTOULL _strtoui64 diff --git a/misc.c b/misc.c index f1aa0378..5074cd98 100644 --- a/misc.c +++ b/misc.c @@ -950,13 +950,13 @@ out: STATIC HANDLE GC_CreateLogFile(void) { -# if !defined(NO_GETENV) || !defined(OLD_WIN32_LOG_FILE) +# if !defined(NO_GETENV_WIN32) || !defined(OLD_WIN32_LOG_FILE) TCHAR logPath[_MAX_PATH + 0x10]; /* buffer for path + ext */ # endif /* Use GetEnvironmentVariable instead of GETENV() for unicode support. */ -# ifndef NO_GETENV +# ifndef NO_GETENV_WIN32 if (GetEnvironmentVariable(TEXT("GC_LOG_FILE"), logPath, - _MAX_PATH + 1) - 1U >= (DWORD)_MAX_PATH) + _MAX_PATH + 1) - 1U >= (DWORD)_MAX_PATH) # endif { /* Env var not found or its value too long. */ @@ -975,7 +975,7 @@ out: memcpy(&logPath[len], TEXT(".gc.log"), sizeof(TEXT(".gc.log"))); # endif } -# if !defined(NO_GETENV) || !defined(OLD_WIN32_LOG_FILE) +# if !defined(NO_GETENV_WIN32) || !defined(OLD_WIN32_LOG_FILE) return CreateFile(logPath, GENERIC_WRITE, FILE_SHARE_READ, NULL /* lpSecurityAttributes */, CREATE_ALWAYS, GC_print_stats == VERBOSE ? FILE_ATTRIBUTE_NORMAL :