Skip to content

Commit 90c4dae

Browse files
author
matz
committed
WinCE patch merged
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3106 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
1 parent e193fd8 commit 90c4dae

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+5461
-68
lines changed

configure.in

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -808,6 +808,8 @@ if test "$with_dln_a_out" != yes; then
808808
DLDFLAGS="${DLDFLAGS} "'$(DEFFILE)'
809809
rb_cv_dlopen=yes ;;
810810
hiuxmpp) LDSHARED='ld -r' ;;
811+
atheos*) LDSHARED="$CC -shared"
812+
rb_cv_dlopen=yes ;;
811813
*) LDSHARED='ld' ;;
812814
esac
813815
AC_MSG_RESULT($rb_cv_dlopen)
@@ -955,9 +957,6 @@ rb_cv_missing_fconvert=yes, rb_cv_missing_fconvert=no, rb_cv_missing_fconvert=no
955957
*djgpp*)
956958
setup=Setup.dj
957959
;;
958-
atheos*)
959-
setup=Setup.atheos
960-
;;
961960
*)
962961
setup=Setup
963962
;;
@@ -1085,6 +1084,10 @@ if test "$enable_shared" = 'yes'; then
10851084
LIBRUBY_DLDFLAGS='-install_name $(libdir)/lib$(RUBY_SO_NAME).dylib -current_version $(MAJOR).$(MINOR).$(TEENY) -compatibility_version $(MAJOR).$(MINOR)'
10861085
LIBRUBY_ALIASES='lib$(RUBY_SO_NAME).$(MAJOR).$(MINOR).dylib lib$(RUBY_SO_NAME).dylib'
10871086
;;
1087+
atheos*)
1088+
LIBRUBY_DLDFLAGS='-Wl,-soname,lib$(RUBY_SO_NAME).so.$(MAJOR).$(MINOR)'
1089+
LIBRUBY_ALIASES='lib$(RUBY_SO_NAME).so.$(MAJOR).$(MINOR) lib$(RUBY_SO_NAME).so'
1090+
;;
10881091
*)
10891092
;;
10901093
esac

defines.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ void xfree _((void*));
8888

8989
/* define RUBY_USE_EUC/SJIS for default kanji-code */
9090
#ifndef DEFAULT_KCODE
91-
#if defined(MSDOS) || defined(__CYGWIN__) || defined(__human68k__) || defined(__MACOS__) || defined(__EMX__) || defined(OS2) || defined(NT)
91+
#if defined(MSDOS) || defined(__CYGWIN__) || defined(__human68k__) || defined(__MACOS__) || defined(__EMX__) || defined(OS2) || defined(NT) || defined(_WIN32_WCE)
9292
#define DEFAULT_KCODE KCODE_SJIS
9393
#else
9494
#define DEFAULT_KCODE KCODE_EUC
@@ -106,7 +106,7 @@ void xfree _((void*));
106106
#define HAVE_SYS_WAIT_H /* configure fails to find this */
107107
#endif /* NeXT */
108108

109-
#ifdef NT
109+
#if defined(NT) || defined(_WIN32_WCE)
110110
#include "win32/win32.h"
111111
#endif
112112

@@ -141,7 +141,7 @@ void xfree _((void*));
141141
#define DOSISH 1
142142
#endif
143143

144-
#if defined(MSDOS) || defined(NT) || defined(__human68k__) || defined(OS2)
144+
#if defined(MSDOS) || defined(NT) || defined(__human68k__) || defined(OS2) || defined(_WIN32_WCE)
145145
#define PATH_SEP ";"
146146
#elif defined(riscos)
147147
#define PATH_SEP ","

dir.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@
2121
#include <unistd.h>
2222
#endif
2323

24-
#if defined HAVE_DIRENT_H && !defined NT
24+
#if defined HAVE_DIRENT_H && !defined NT && !defined _WIN32_WCE
2525
# include <dirent.h>
2626
# define NAMLEN(dirent) strlen((dirent)->d_name)
27-
#elif defined HAVE_DIRECT_H && !defined NT
27+
#elif defined HAVE_DIRECT_H && !defined NT && !defined _WIN32_WCE
2828
# include <direct.h>
2929
# define NAMLEN(dirent) strlen((dirent)->d_name)
3030
#else
@@ -39,7 +39,7 @@
3939
# if HAVE_NDIR_H
4040
# include <ndir.h>
4141
# endif
42-
# if defined(NT)
42+
# if defined(NT) || defined(_WIN32_WCE)
4343
# include "win32/dir.h"
4444
# endif
4545
#endif
@@ -79,6 +79,10 @@ char *strchr _((char*,char));
7979
# define CharNext(p) ((p) + 1)
8080
# endif
8181
#endif
82+
#ifdef _WIN32_WCE
83+
#undef CharNext
84+
#define CharNext CharNextA
85+
#endif
8286
#if defined DOSISH
8387
#define isdirsep(c) ((c) == '/' || (c) == '\\')
8488
static char *
@@ -534,7 +538,7 @@ dir_s_mkdir(argc, argv, obj)
534538

535539
SafeStringValue(path);
536540
rb_secure(2);
537-
#if !defined(NT)
541+
#if !defined(NT) && !defined(_WIN32_WCE)
538542
if (mkdir(RSTRING(path)->ptr, mode) == -1)
539543
rb_sys_fail(RSTRING(path)->ptr);
540544
#else

dln.c

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ void *xrealloc();
4848
#endif
4949

5050
#include <stdio.h>
51-
#if defined(NT) || defined(__VMS)
51+
#if defined(NT) || defined(__VMS) || defined(_WIN32_WCE)
5252
#include "missing/file.h"
5353
#endif
5454
#include <sys/types.h>
@@ -69,7 +69,7 @@ void *xrealloc();
6969
# include <unistd.h>
7070
#endif
7171

72-
#ifndef NT
72+
#if !defined(NT) && !defined(_WIN32_WCE)
7373
char *getenv();
7474
#endif
7575

@@ -1149,6 +1149,15 @@ dln_sym(name)
11491149
#include <windows.h>
11501150
#endif
11511151

1152+
#ifdef _WIN32_WCE
1153+
#undef FormatMessage
1154+
#define FormatMessage FormatMessageA
1155+
#undef LoadLibrary
1156+
#define LoadLibrary LoadLibraryA
1157+
#undef GetProcAddress
1158+
#define GetProcAddress GetProcAddressA
1159+
#endif
1160+
11521161
static const char *
11531162
dln_strerror()
11541163
{
@@ -1589,7 +1598,7 @@ dln_find_exe(fname, path)
15891598
}
15901599

15911600
if (!path) {
1592-
#if defined(MSDOS) || defined(NT) || defined(__human68k__) || defined(__MACOS__)
1601+
#if defined(MSDOS) || defined(NT) || defined(__human68k__) || defined(__MACOS__) || defined(_WIN32_WCE)
15931602
path = "/usr/local/bin;/usr/ucb;/usr/bin;/bin;.";
15941603
#else
15951604
path = "/usr/local/bin:/usr/ucb:/usr/bin:/bin:.";
@@ -1660,7 +1669,7 @@ dln_find_1(fname, path, exe_flag)
16601669
if (strncmp("./", fname, 2) == 0 || strncmp("../", fname, 3) == 0)
16611670
return fname;
16621671
if (exe_flag && strchr(fname, '/')) return fname;
1663-
#if defined(MSDOS) || defined(NT) || defined(__human68k__) || defined(__EMX__)
1672+
#if defined(MSDOS) || defined(NT) || defined(__human68k__) || defined(__EMX__) || defined(_WIN32_WCE)
16641673
if (fname[0] == '\\') return fname;
16651674
if (strlen(fname) > 2 && fname[1] == ':') return fname;
16661675
if (strncmp(".\\", fname, 2) == 0 || strncmp("..\\", fname, 3) == 0)
@@ -1692,7 +1701,7 @@ dln_find_1(fname, path, exe_flag)
16921701
*/
16931702

16941703
if (*dp == '~' && (l == 1 ||
1695-
#if defined(MSDOS) || defined(NT) || defined(__human68k__) || defined(__EMX__)
1704+
#if defined(MSDOS) || defined(NT) || defined(__human68k__) || defined(__EMX__) || defined(_WIN32_WCE)
16961705
dp[1] == '\\' ||
16971706
#endif
16981707
dp[1] == '/')) {
@@ -1750,17 +1759,17 @@ dln_find_1(fname, path, exe_flag)
17501759
}
17511760
}
17521761
#endif
1753-
#if defined(MSDOS) || defined(NT) || defined(__human68k__) || defined(__EMX__)
1762+
#if defined(MSDOS) || defined(NT) || defined(__human68k__) || defined(__EMX__) || defined(_WIN32_WCE)
17541763
if (exe_flag) {
17551764
static const char *extension[] = {
17561765
#if defined(MSDOS)
17571766
".com", ".exe", ".bat",
17581767
#if defined(DJGPP)
17591768
".btm", ".sh", ".ksh", ".pl", ".sed",
17601769
#endif
1761-
#elif defined(__EMX__) || defined(NT)
1770+
#elif defined(__EMX__) || defined(NT) || defined(_WIN32_WCE)
17621771
".exe", ".com", ".cmd", ".bat",
1763-
/* end of __EMX__ or NT*/
1772+
/* end of __EMX__ or NT or WINCE */
17641773
#else
17651774
".r", ".R", ".x", ".X", ".bat", ".BAT",
17661775
/* __human68k__ */

error.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -645,7 +645,7 @@ void
645645
rb_sys_fail(mesg)
646646
const char *mesg;
647647
{
648-
#if !defined(NT) && !defined(__VMS)
648+
#if !defined(NT) && !defined(__VMS) && !defined(_WIN32_WCE)
649649
char *strerror();
650650
#endif
651651
char *err;

eval.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7328,7 +7328,7 @@ win32_set_exception_list(p)
73287328
# endif
73297329
}
73307330

7331-
#ifndef SAVE_WIN32_EXCEPTION_LIST
7331+
#if !defined SAVE_WIN32_EXCEPTION_LIST && !defined _WIN32_WCE
73327332
# error unsupported platform
73337333
#endif
73347334
#endif

file.c

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
1313
**********************************************************************/
1414

15-
#ifdef NT
15+
#if defined NT || defined _WIN32_WCE
1616
#include "missing/file.h"
1717
#endif
1818

@@ -43,12 +43,12 @@ int flock _((int, int));
4343
#ifdef HAVE_SYS_TIME_H
4444
# include <sys/time.h>
4545
#else
46-
#ifndef NT
46+
#if !defined(NT) && !defined(_WIN32_WCE)
4747
struct timeval {
4848
long tv_sec; /* seconds */
4949
long tv_usec; /* and microseconds */
5050
};
51-
#endif /* NT */
51+
#endif /* NT, WINCE */
5252
#endif
5353

5454
VALUE rb_time_new _((time_t, time_t));
@@ -76,6 +76,11 @@ char *strrchr _((const char*,const char));
7676
#define lstat(path,st) stat(path,st)
7777
#endif
7878

79+
#ifdef _WIN32_WCE
80+
#undef CharNext
81+
#define CharNext CharNextA
82+
#endif
83+
7984
VALUE rb_cFile;
8085
VALUE rb_mFileTest;
8186
static VALUE rb_cStat;
@@ -110,7 +115,7 @@ rb_file_path(obj)
110115
return rb_str_new2(fptr->path);
111116
}
112117

113-
#ifdef NT
118+
#if defined NT || defined _WIN32_WCE
114119
#include "missing/file.h"
115120
#endif
116121

@@ -440,7 +445,7 @@ static int
440445
group_member(gid)
441446
GETGROUPS_T gid;
442447
{
443-
#if !defined(NT)
448+
#if !defined(NT) && !defined(_WIN32_WCE)
444449
if (getgid() == gid)
445450
return Qtrue;
446451

@@ -780,7 +785,7 @@ static VALUE
780785
test_grpowned(obj, fname)
781786
VALUE obj, fname;
782787
{
783-
#ifndef NT
788+
#if !defined(NT) && !defined(_WIN32_WCE)
784789
struct stat st;
785790

786791
if (rb_stat(fname, &st) < 0) return Qfalse;
@@ -1115,7 +1120,7 @@ rb_file_chown(obj, owner, group)
11151120

11161121
rb_secure(2);
11171122
GetOpenFile(obj, fptr);
1118-
#if defined(DJGPP) || defined(__CYGWIN32__) || defined(NT) || defined(__EMX__)
1123+
#if defined(DJGPP) || defined(__CYGWIN32__) || defined(NT) || defined(__EMX__) || defined(_WIN32_WCE)
11191124
if (!fptr->path) return Qnil;
11201125
if (chown(fptr->path, NUM2INT(owner), NUM2INT(group)) == -1)
11211126
rb_sys_fail(fptr->path);
@@ -1208,7 +1213,7 @@ rb_file_s_utime(argc, argv)
12081213
#else
12091214

12101215
#ifndef HAVE_UTIME_H
1211-
# ifdef NT
1216+
# if defined NT || defined _WIN32_WCE
12121217
# if defined(__BORLANDC__)
12131218
# include <utime.h>
12141219
# else
@@ -1711,7 +1716,7 @@ rb_file_s_truncate(klass, path, len)
17111716
{
17121717
int tmpfd;
17131718

1714-
# if defined(NT)
1719+
# if defined(NT) || defined(_WIN32_WCE)
17151720
if ((tmpfd = open(RSTRING(path)->ptr, O_RDWR)) < 0) {
17161721
rb_sys_fail(RSTRING(path)->ptr);
17171722
}
@@ -2136,7 +2141,7 @@ static VALUE
21362141
rb_stat_grpowned(obj)
21372142
VALUE obj;
21382143
{
2139-
#ifndef NT
2144+
#if !defined(NT) && !defined(_WIN32_WCE)
21402145
if (get_stat(obj)->st_gid == getegid()) return Qtrue;
21412146
#endif
21422147
return Qfalse;

hash.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -942,7 +942,7 @@ rb_hash_update(hash1, hash2)
942942
static int path_tainted = -1;
943943

944944
static char **origenviron;
945-
#ifdef NT
945+
#if defined(NT) || defined(_WIN32_WCE)
946946
#define GET_ENVIRON(e) (e = rb_w32_get_environ())
947947
#define FREE_ENVIRON(e) rb_w32_free_environ(e)
948948
static char **my_environ;

io.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
#include <ctype.h>
2525
#include <errno.h>
2626

27-
#if defined(MSDOS) || defined(__BOW__) || defined(__CYGWIN__) || defined(NT) || defined(__human68k__) || defined(__EMX__) || defined(__BEOS__)
27+
#if defined(MSDOS) || defined(__BOW__) || defined(__CYGWIN__) || defined(NT) || defined(__human68k__) || defined(__EMX__) || defined(__BEOS__) || defined(_WIN32_WCE)
2828
# define NO_SAFE_RENAME
2929
#endif
3030

@@ -41,10 +41,10 @@
4141
#endif
4242

4343
#include <sys/types.h>
44-
#if !defined(DJGPP) && !defined(NT) && !defined(__human68k__)
44+
#if !defined(DJGPP) && !defined(NT) && !defined(__human68k__) && !defined(_WIN32_WCE)
4545
#include <sys/ioctl.h>
4646
#endif
47-
#if defined(HAVE_FCNTL_H) || defined(NT)
47+
#if defined(HAVE_FCNTL_H) || defined(NT) || defined(_WIN32_WCE)
4848
#include <fcntl.h>
4949
#elif defined(HAVE_SYS_FCNTL_H)
5050
#include <sys/fcntl.h>
@@ -1536,7 +1536,7 @@ VALUE
15361536
rb_io_binmode(io)
15371537
VALUE io;
15381538
{
1539-
#if defined(NT) || defined(DJGPP) || defined(__CYGWIN__) || defined(__human68k__) || defined(__EMX__)
1539+
#if defined(NT) || defined(DJGPP) || defined(__CYGWIN__) || defined(__human68k__) || defined(__EMX__) || defined(_WIN32_WCE)
15401540
OpenFile *fptr;
15411541

15421542
GetOpenFile(io, fptr);
@@ -1825,7 +1825,7 @@ rb_file_sysopen(fname, flags, mode)
18251825
return rb_file_sysopen_internal(io, fname, flags, mode);
18261826
}
18271827

1828-
#if defined (NT) || defined(DJGPP) || defined(__CYGWIN__) || defined(__human68k__) || defined(__VMS)
1828+
#if defined (NT) || defined(DJGPP) || defined(__CYGWIN__) || defined(__human68k__) || defined(__VMS) || defined(_WIN32_WCE)
18291829
static struct pipe_list {
18301830
OpenFile *fptr;
18311831
struct pipe_list *next;
@@ -1867,7 +1867,7 @@ pipe_del_fptr(fptr)
18671867
}
18681868
}
18691869

1870-
#if defined (NT) || defined(DJGPP) || defined(__CYGWIN__) || defined(__human68k__) || defined(__VMS)
1870+
#if defined (NT) || defined(DJGPP) || defined(__CYGWIN__) || defined(__human68k__) || defined(__VMS) || defined(_WIN32_WCE)
18711871
static void
18721872
pipe_atexit _((void))
18731873
{
@@ -1888,7 +1888,7 @@ static void
18881888
pipe_finalize(fptr)
18891889
OpenFile *fptr;
18901890
{
1891-
#if !defined (__CYGWIN__) && !defined(NT)
1891+
#if !defined (__CYGWIN__) && !defined(NT) && !defined(_WIN32_WCE)
18921892
extern VALUE rb_last_status;
18931893
int status;
18941894
if (fptr->f) {
@@ -1951,7 +1951,7 @@ pipe_open(pname, mode)
19511951
return (VALUE)port;
19521952
}
19531953
#else
1954-
#if defined(NT)
1954+
#if defined(NT) || defined(_WIN32_WCE)
19551955
int pid;
19561956
FILE *fpr, *fpw;
19571957

@@ -3469,7 +3469,7 @@ rb_io_s_pipe()
34693469
int pipes[2];
34703470
VALUE r, w;
34713471

3472-
#ifdef NT
3472+
#if defined(NT) || defined(_WIN32_WCE)
34733473
if (_pipe(pipes, 1024, O_BINARY) == -1)
34743474
#else
34753475
if (pipe(pipes) == -1)

main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ main(argc, argv, envp)
3838
int argc;
3939
char **argv, **envp;
4040
{
41-
#if defined(NT)
41+
#if defined(NT) || defined(_WIN32_WCE)
4242
NtInitialize(&argc, &argv);
4343
#endif
4444
#if defined(__MACOS__) && defined(__MWERKS__)

0 commit comments

Comments
 (0)