X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Fprogreloc.c;h=dcfe3099364d1f2bdc57471cbba41258aed17c80;hb=7ef6c64e210ac0979d7e8ac69bc5b5208c2405ab;hp=4a3fa48be48e25f7891745617369e223af03ac8e;hpb=10d90c830f45ec144359c5ddfee57fc8724b7fb9;p=gnulib.git diff --git a/lib/progreloc.c b/lib/progreloc.c index 4a3fa48be..dcfe30993 100644 --- a/lib/progreloc.c +++ b/lib/progreloc.c @@ -1,5 +1,5 @@ /* Provide relocatable programs. - Copyright (C) 2003-2011 Free Software Foundation, Inc. + Copyright (C) 2003-2014 Free Software Foundation, Inc. Written by Bruno Haible , 2003. This program is free software: you can redistribute it and/or modify @@ -30,16 +30,16 @@ #include #include -/* Get declaration of _NSGetExecutablePath on MacOS X 10.2 or newer. */ +/* Get declaration of _NSGetExecutablePath on Mac OS X 10.2 or newer. */ #if HAVE_MACH_O_DYLD_H # include #endif #if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ -# define WIN32_NATIVE +# define WINDOWS_NATIVE #endif -#ifdef WIN32_NATIVE +#ifdef WINDOWS_NATIVE # define WIN32_LEAN_AND_MEAN # include #endif @@ -74,7 +74,7 @@ extern char * canonicalize_file_name (const char *name); IS_PATH_WITH_DIR(P) tests whether P contains a directory specification. */ #if ((defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__) || defined __EMX__ || defined __DJGPP__ - /* Win32, OS/2, DOS */ + /* Native Windows, OS/2, DOS */ # define ISSLASH(C) ((C) == '/' || (C) == '\\') # define HAS_DEVICE(P) \ ((((P)[0] >= 'A' && (P)[0] <= 'Z') || ((P)[0] >= 'a' && (P)[0] <= 'z')) \ @@ -112,8 +112,8 @@ static int executable_fd = -1; static bool maybe_executable (const char *filename) { - /* Woe32 lacks the access() function. */ -#if !defined WIN32_NATIVE + /* The native Windows API lacks the access() function. */ +#if !defined WINDOWS_NATIVE if (access (filename, X_OK) < 0) return false; #endif @@ -143,16 +143,16 @@ maybe_executable (const char *filename) /* Determine the full pathname of the current executable, freshly allocated. Return NULL if unknown. - Guaranteed to work on Linux and Woe32. Likely to work on the other - Unixes (maybe except BeOS), under most conditions. */ + Guaranteed to work on Linux and native Windows. Likely to work on the + other Unixes (maybe except BeOS), under most conditions. */ static char * find_executable (const char *argv0) { -#if defined WIN32_NATIVE - /* Native Win32 only. +#if defined WINDOWS_NATIVE + /* Native Windows only. On Cygwin, it is better to use the Cygwin provided /proc interface, than - to use native Win32 API and cygwin_conv_to_posix_path, because it supports - longer file names + to use native Windows API and cygwin_conv_to_posix_path, because it + supports longer file names (see ). */ char location[MAX_PATH]; int length = GetModuleFileName (NULL, location, sizeof (location)); @@ -202,7 +202,7 @@ find_executable (const char *argv0) } # endif # if HAVE_MACH_O_DYLD_H && HAVE__NSGETEXECUTABLEPATH - /* On MacOS X 10.2 or newer, the function + /* On Mac OS X 10.2 or newer, the function int _NSGetExecutablePath (char *buf, uint32_t *bufsize); can be used to retrieve the executable's full path. */ char location[4096];