From 90c4dae08fea47797b3ae574e5dfe35dc66f5631 Mon Sep 17 00:00:00 2001 From: matz Date: Mon, 2 Dec 2002 07:57:17 +0000 Subject: WinCE patch merged git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3106 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- dln.c | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) (limited to 'dln.c') diff --git a/dln.c b/dln.c index 2fb73be4ff..a4034c6854 100644 --- a/dln.c +++ b/dln.c @@ -48,7 +48,7 @@ void *xrealloc(); #endif #include -#if defined(NT) || defined(__VMS) +#if defined(NT) || defined(__VMS) || defined(_WIN32_WCE) #include "missing/file.h" #endif #include @@ -69,7 +69,7 @@ void *xrealloc(); # include #endif -#ifndef NT +#if !defined(NT) && !defined(_WIN32_WCE) char *getenv(); #endif @@ -1149,6 +1149,15 @@ dln_sym(name) #include #endif +#ifdef _WIN32_WCE +#undef FormatMessage +#define FormatMessage FormatMessageA +#undef LoadLibrary +#define LoadLibrary LoadLibraryA +#undef GetProcAddress +#define GetProcAddress GetProcAddressA +#endif + static const char * dln_strerror() { @@ -1589,7 +1598,7 @@ dln_find_exe(fname, path) } if (!path) { -#if defined(MSDOS) || defined(NT) || defined(__human68k__) || defined(__MACOS__) +#if defined(MSDOS) || defined(NT) || defined(__human68k__) || defined(__MACOS__) || defined(_WIN32_WCE) path = "/usr/local/bin;/usr/ucb;/usr/bin;/bin;."; #else path = "/usr/local/bin:/usr/ucb:/usr/bin:/bin:."; @@ -1660,7 +1669,7 @@ dln_find_1(fname, path, exe_flag) if (strncmp("./", fname, 2) == 0 || strncmp("../", fname, 3) == 0) return fname; if (exe_flag && strchr(fname, '/')) return fname; -#if defined(MSDOS) || defined(NT) || defined(__human68k__) || defined(__EMX__) +#if defined(MSDOS) || defined(NT) || defined(__human68k__) || defined(__EMX__) || defined(_WIN32_WCE) if (fname[0] == '\\') return fname; if (strlen(fname) > 2 && fname[1] == ':') return fname; if (strncmp(".\\", fname, 2) == 0 || strncmp("..\\", fname, 3) == 0) @@ -1692,7 +1701,7 @@ dln_find_1(fname, path, exe_flag) */ if (*dp == '~' && (l == 1 || -#if defined(MSDOS) || defined(NT) || defined(__human68k__) || defined(__EMX__) +#if defined(MSDOS) || defined(NT) || defined(__human68k__) || defined(__EMX__) || defined(_WIN32_WCE) dp[1] == '\\' || #endif dp[1] == '/')) { @@ -1750,7 +1759,7 @@ dln_find_1(fname, path, exe_flag) } } #endif -#if defined(MSDOS) || defined(NT) || defined(__human68k__) || defined(__EMX__) +#if defined(MSDOS) || defined(NT) || defined(__human68k__) || defined(__EMX__) || defined(_WIN32_WCE) if (exe_flag) { static const char *extension[] = { #if defined(MSDOS) @@ -1758,9 +1767,9 @@ dln_find_1(fname, path, exe_flag) #if defined(DJGPP) ".btm", ".sh", ".ksh", ".pl", ".sed", #endif -#elif defined(__EMX__) || defined(NT) +#elif defined(__EMX__) || defined(NT) || defined(_WIN32_WCE) ".exe", ".com", ".cmd", ".bat", -/* end of __EMX__ or NT*/ +/* end of __EMX__ or NT or WINCE */ #else ".r", ".R", ".x", ".X", ".bat", ".BAT", /* __human68k__ */ -- cgit v1.2.3