mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 00:11:26 +00:00
Merge in changes from NET-Community.
Add DLL support on Windows platforms. Numerous minor bug fixes related to Windows platforms. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@2420 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
e149f41c85
commit
4a99922d47
48 changed files with 2409 additions and 697 deletions
|
@ -51,8 +51,16 @@ int lstat(char *path, struct stat *buf) { return (-1); }
|
|||
|
||||
#define DEFAULT_PATH ".:~/bin::/usr/local/bin:/usr/new:/usr/ucb:/usr/bin:/bin:/usr/hosts"
|
||||
|
||||
#if defined(__WIN32__) || defined(_WIN32)
|
||||
#define PATH_SEPARATOR ';'
|
||||
#define PATH_COMPONENT "\\"
|
||||
#else
|
||||
#define PATH_SEPARATOR ':'
|
||||
#define PATH_COMPONENT "/"
|
||||
#endif
|
||||
|
||||
/* ABSOLUTE_FILENAME_P (fname): True if fname is an absolute filename */
|
||||
#ifdef atarist
|
||||
#if defined(atarist) || defined(__WIN32__) || defined(_WIN32)
|
||||
#define ABSOLUTE_FILENAME_P(fname) ((fname[0] == '/') || \
|
||||
(fname[0] && (fname[1] == ':')))
|
||||
#else
|
||||
|
@ -131,7 +139,7 @@ objc_find_executable (const char *file)
|
|||
next = name;
|
||||
|
||||
/* copy directory name into [name] */
|
||||
while (*p && *p != ':') *next++ = *p++;
|
||||
while (*p && *p != PATH_SEPARATOR) *next++ = *p++;
|
||||
*next = 0;
|
||||
if (*p) p++;
|
||||
|
||||
|
@ -144,7 +152,7 @@ objc_find_executable (const char *file)
|
|||
cwd_in_path = 1;
|
||||
}
|
||||
|
||||
strcat (name, "/");
|
||||
strcat (name, PATH_COMPONENT);
|
||||
strcat (name, file);
|
||||
|
||||
/*
|
||||
|
@ -152,6 +160,33 @@ objc_find_executable (const char *file)
|
|||
*/
|
||||
if (find_full_path (name) == 0)
|
||||
return copy_of (name);
|
||||
|
||||
/* Also add common executable extensions on windows */
|
||||
#if defined(__WIN32__) || defined(_WIN32)
|
||||
{
|
||||
int fl = strlen(name);
|
||||
|
||||
strcat (name, ".com");
|
||||
if (find_full_path (name) == 0)
|
||||
return copy_of (name);
|
||||
name[fl] = '\0';
|
||||
|
||||
strcat (name, ".exe");
|
||||
if (find_full_path (name) == 0)
|
||||
return copy_of (name);
|
||||
name[fl] = '\0';
|
||||
|
||||
strcat (name, ".bat");
|
||||
if (find_full_path (name) == 0)
|
||||
return copy_of (name);
|
||||
name[fl] = '\0';
|
||||
|
||||
strcat (name, ".cmd");
|
||||
if (find_full_path (name) == 0)
|
||||
return copy_of (name);
|
||||
name[fl] = '\0';
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -165,7 +200,7 @@ objc_find_executable (const char *file)
|
|||
#else
|
||||
getwd (name);
|
||||
#endif
|
||||
strcat (name, "/");
|
||||
strcat (name, PATH_COMPONENT);
|
||||
strcat (name, file);
|
||||
|
||||
/*
|
||||
|
@ -173,6 +208,33 @@ objc_find_executable (const char *file)
|
|||
*/
|
||||
if (find_full_path (name) == 0)
|
||||
return copy_of (name);
|
||||
|
||||
/* Also add common executable extensions on windows */
|
||||
#if defined(__WIN32__) || defined(_WIN32)
|
||||
{
|
||||
int fl = strlen(name);
|
||||
|
||||
strcat (name, ".com");
|
||||
if (find_full_path (name) == 0)
|
||||
return copy_of (name);
|
||||
name[fl] = '\0';
|
||||
|
||||
strcat (name, ".exe");
|
||||
if (find_full_path (name) == 0)
|
||||
return copy_of (name);
|
||||
name[fl] = '\0';
|
||||
|
||||
strcat (name, ".bat");
|
||||
if (find_full_path (name) == 0)
|
||||
return copy_of (name);
|
||||
name[fl] = '\0';
|
||||
|
||||
strcat (name, ".cmd");
|
||||
if (find_full_path (name) == 0)
|
||||
return copy_of (name);
|
||||
name[fl] = '\0';
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue