From: Ivan Maidanski Date: Tue, 6 Mar 2012 16:10:11 +0000 (+0400) Subject: Fix GC_READ_ENV_FILE code for Cygwin X-Git-Tag: gc7_2~39 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1a4dd0e75fd177ddf7eadf8654057ed243fc0c2d;p=gc Fix GC_READ_ENV_FILE code for Cygwin * misc.c: Include windows.h for Cygwin if GC_READ_ENV_FILE (required for GC_envfile_init). * misc.c (_MAX_PATH): Move definition to the place before the first use (only Win32). --- diff --git a/misc.c b/misc.c index 8db60851..63b9d477 100644 --- a/misc.c +++ b/misc.c @@ -26,7 +26,8 @@ #ifdef GC_SOLARIS_THREADS # include #endif -#if defined(MSWIN32) || defined(MSWINCE) +#if defined(MSWIN32) || defined(MSWINCE) \ + || (defined(CYGWIN32) && defined(GC_READ_ENV_FILE)) # ifndef WIN32_LEAN_AND_MEAN # define WIN32_LEAN_AND_MEAN 1 # endif @@ -466,6 +467,11 @@ GC_API void GC_CALL GC_get_heap_usage_safe(GC_word *pheap_size, } #endif /* THREADS */ +#if !defined(_MAX_PATH) && (defined(MSWIN32) || defined(MSWINCE) \ + || defined(CYGWIN32)) +# define _MAX_PATH MAX_PATH +#endif + #ifdef GC_READ_ENV_FILE /* This works for Win32/WinCE for now. Really useful only for WinCE. */ STATIC char *GC_envfile_content = NULL; @@ -1108,10 +1114,6 @@ GC_API void GC_CALL GC_enable_incremental(void) # define IF_NEED_TO_LOCK(x) # endif /* !THREADS */ -# ifndef _MAX_PATH -# define _MAX_PATH MAX_PATH -# endif - STATIC HANDLE GC_CreateLogFile(void) { # if !defined(NO_GETENV_WIN32) || !defined(OLD_WIN32_LOG_FILE)