From: <ped...@us...> - 2006-11-11 23:04:28
|
Revision: 784 http://svn.sourceforge.net/cegcc/?rev=784&view=rev Author: pedroalves Date: 2006-11-11 15:03:29 -0800 (Sat, 11 Nov 2006) Log Message: ----------- * mingwex/Makefile.in (WINCE_DISTFILES): Add fdopen.c, read.c, write.c, open.c and lseek.c. (WINCE_OBJS): Add fdopen.o, read.o, write.o, open.o and lseek.o. * mingwex/wince/open.c: New file. * mingwex/wince/lseek.c: New file. * mingwex/wince/fdopen.c: New file. * mingwex/wince/read.c: New file. * mingwex/wince/write.c: New file. Modified Paths: -------------- trunk/cegcc/src/mingw/ChangeLog.mingw32ce trunk/cegcc/src/mingw/mingwex/Makefile.in Added Paths: ----------- trunk/cegcc/src/mingw/mingwex/wince/fdopen.c trunk/cegcc/src/mingw/mingwex/wince/lseek.c trunk/cegcc/src/mingw/mingwex/wince/open.c trunk/cegcc/src/mingw/mingwex/wince/read.c trunk/cegcc/src/mingw/mingwex/wince/write.c Modified: trunk/cegcc/src/mingw/ChangeLog.mingw32ce =================================================================== --- trunk/cegcc/src/mingw/ChangeLog.mingw32ce 2006-11-11 15:28:54 UTC (rev 783) +++ trunk/cegcc/src/mingw/ChangeLog.mingw32ce 2006-11-11 23:03:29 UTC (rev 784) @@ -1,3 +1,14 @@ +2006-11-11 Pedro Alves <ped...@po...> + + * mingwex/Makefile.in (WINCE_DISTFILES): Add fdopen.c, read.c, write.c, + open.c and lseek.c. + (WINCE_OBJS): Add fdopen.o, read.o, write.o, open.o and lseek.o. + * mingwex/wince/open.c: New file. + * mingwex/wince/lseek.c: New file. + * mingwex/wince/fdopen.c: New file. + * mingwex/wince/read.c: New file. + * mingwex/wince/write.c: New file. + 2006-11-03 Danny Backx <dan...@us...> * profile/gmon.c : Use the executable file name under CE to cook up Modified: trunk/cegcc/src/mingw/mingwex/Makefile.in =================================================================== --- trunk/cegcc/src/mingw/mingwex/Makefile.in 2006-11-11 15:28:54 UTC (rev 783) +++ trunk/cegcc/src/mingw/mingwex/Makefile.in 2006-11-11 23:03:29 UTC (rev 784) @@ -85,7 +85,7 @@ WINCE_DISTFILES = \ asctime.c freopen.c gmtime.c localtime.c mktime.c strftime.c time.c \ - tempnam.c unlink.c wcsftime.c + tempnam.c unlink.c wcsftime.c fdopen.c read.c write.c open.c lseek.c CC = @CC@ # FIXME: Which is it, CC or CC_FOR_TARGET? @@ -185,7 +185,7 @@ ctan.o ctanf.o ctanl.o ctanh.o ctanhf.o ctanhl.o WINCE_OBJS = \ asctime.o freopen.o gmtime.o localtime.o mktime.o strftime.o time.o \ - tempnam.o unlink.o wcsftime.o + tempnam.o unlink.o wcsftime.o fdopen.o read.o write.o open.o lseek.o ifneq (,$(findstring wince,$(target_alias))) LIB_OBJS = $(WINCE_OBJS) Added: trunk/cegcc/src/mingw/mingwex/wince/fdopen.c =================================================================== --- trunk/cegcc/src/mingw/mingwex/wince/fdopen.c (rev 0) +++ trunk/cegcc/src/mingw/mingwex/wince/fdopen.c 2006-11-11 23:03:29 UTC (rev 784) @@ -0,0 +1,17 @@ +#include <stdio.h> +#include <string.h> + +#define MAX_MODE 64 + +FILE * +fdopen (int fildes, const char *mode) +{ + FILE *f; + wchar_t wmode[MAX_MODE]; + size_t sizem = strlen (mode) + 1; + if (sizem > MAX_MODE) + return NULL; + mbstowcs (wmode, mode, sizem); + f = _wfdopen (fildes, wmode); + return f; +} Property changes on: trunk/cegcc/src/mingw/mingwex/wince/fdopen.c ___________________________________________________________________ Name: svn:eol-style + native Added: trunk/cegcc/src/mingw/mingwex/wince/lseek.c =================================================================== --- trunk/cegcc/src/mingw/mingwex/wince/lseek.c (rev 0) +++ trunk/cegcc/src/mingw/mingwex/wince/lseek.c 2006-11-11 23:03:29 UTC (rev 784) @@ -0,0 +1,21 @@ +#include <windows.h> +#include <unistd.h> + +long +lseek (int fildes, long offset, int whence) +{ + DWORD mode = 0; + switch (whence) + { + case SEEK_SET: + mode = FILE_BEGIN; + break; + case SEEK_CUR: + mode = FILE_CURRENT; + break; + case SEEK_END: + mode = FILE_END; + break; + } + return (long) SetFilePointer ((HANDLE) fildes, offset, NULL, mode); +} Property changes on: trunk/cegcc/src/mingw/mingwex/wince/lseek.c ___________________________________________________________________ Name: svn:eol-style + native Added: trunk/cegcc/src/mingw/mingwex/wince/open.c =================================================================== --- trunk/cegcc/src/mingw/mingwex/wince/open.c (rev 0) +++ trunk/cegcc/src/mingw/mingwex/wince/open.c 2006-11-11 23:03:29 UTC (rev 784) @@ -0,0 +1,74 @@ +#include <windows.h> +#include <unistd.h> +#include <fcntl.h> + +int +open (const char *path, int oflag, ...) +{ + wchar_t wpath[MAX_PATH]; + DWORD fileaccess; + DWORD fileshare; + DWORD filecreate; + DWORD fileattrib; + HANDLE hnd; + + size_t path_len = strlen (path); + if (path_len >= MAX_PATH) + return -1; + + switch (oflag & (O_RDONLY | O_WRONLY | O_RDWR)) + { + case O_RDONLY: + fileaccess = GENERIC_READ; + break; + case O_WRONLY: + fileaccess = GENERIC_WRITE; + break; + case O_RDWR: + fileaccess = GENERIC_READ | GENERIC_WRITE; + break; + default: + return -1; + } + + switch (oflag & (O_CREAT | O_EXCL | O_TRUNC)) + { + case 0: + case O_EXCL: /* ignore EXCL w/o CREAT */ + filecreate = OPEN_EXISTING; + break; + case O_CREAT: + filecreate = OPEN_ALWAYS; + break; + case O_CREAT | O_EXCL: + case O_CREAT | O_TRUNC | O_EXCL: + filecreate = CREATE_NEW; + break; + + case O_TRUNC: + case O_TRUNC | O_EXCL: /* ignore EXCL w/o CREAT */ + filecreate = TRUNCATE_EXISTING; + break; + case O_CREAT | O_TRUNC: + filecreate = CREATE_ALWAYS; + break; + default: + /* this can't happen ... all cases are covered */ + return -1; + } + + mbstowcs (wpath, path, path_len + 1); + + fileshare = FILE_SHARE_READ | FILE_SHARE_WRITE; + fileattrib = FILE_ATTRIBUTE_NORMAL; + + hnd = CreateFileW (wpath, fileaccess, fileshare, NULL, filecreate, + fileattrib, NULL); + if (hnd == INVALID_HANDLE_VALUE) + return -1; + + if (oflag & O_APPEND) + SetFilePointer (hnd, 0, NULL, FILE_END); + + return (int) hnd; +} Added: trunk/cegcc/src/mingw/mingwex/wince/read.c =================================================================== --- trunk/cegcc/src/mingw/mingwex/wince/read.c (rev 0) +++ trunk/cegcc/src/mingw/mingwex/wince/read.c 2006-11-11 23:03:29 UTC (rev 784) @@ -0,0 +1,13 @@ +#include <windows.h> +#include <unistd.h> + +int +read (int fildes, void *buf, unsigned int bufsize) +{ + DWORD NumberOfBytesRead; + if (bufsize > 0x7fffffff) + bufsize = 0x7fffffff; + if (!ReadFile ((HANDLE) fildes, buf, bufsize, &NumberOfBytesRead, NULL)) + return -1; + return (int) NumberOfBytesRead; +} Property changes on: trunk/cegcc/src/mingw/mingwex/wince/read.c ___________________________________________________________________ Name: svn:eol-style + native Added: trunk/cegcc/src/mingw/mingwex/wince/write.c =================================================================== --- trunk/cegcc/src/mingw/mingwex/wince/write.c (rev 0) +++ trunk/cegcc/src/mingw/mingwex/wince/write.c 2006-11-11 23:03:29 UTC (rev 784) @@ -0,0 +1,13 @@ +#include <windows.h> +#include <unistd.h> + +int +write (int fildes, const void *buf, unsigned int bufsize) +{ + DWORD NumberOfBytesWritten; + if (bufsize > 0x7fffffff) + bufsize = 0x7fffffff; + if (!WriteFile ((HANDLE) fildes, buf, bufsize, &NumberOfBytesWritten, NULL)) + return -1; + return (int) NumberOfBytesWritten; +} Property changes on: trunk/cegcc/src/mingw/mingwex/wince/write.c ___________________________________________________________________ Name: svn:eol-style + native This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ped...@us...> - 2006-11-12 12:48:12
|
Revision: 786 http://svn.sourceforge.net/cegcc/?rev=786&view=rev Author: pedroalves Date: 2006-11-12 04:47:32 -0800 (Sun, 12 Nov 2006) Log Message: ----------- * mingwex/wince/open.c (open): Rename to _open. * mingwex/wince/lseek.c (lseek): Rename to _lseek. * mingwex/wince/fdopen.c (fdopen): Rename to _fdopen. * mingwex/wince/read.c (read): Rename to _read. * mingwex/wince/write.c (write): Rename to _write. * include/fcntl.h: Enable file. * include/io.h (_open, open, lseek, _lseek, read, _read, write, _write): Unhide. * include/stdio.h (fdopen, _fdopen): Unhide. * include/unistd.h: Enable file. * moldname.def.in (open, lseek, read, write): Unhide. Modified Paths: -------------- trunk/cegcc/src/mingw/ChangeLog.mingw32ce trunk/cegcc/src/mingw/include/fcntl.h trunk/cegcc/src/mingw/include/io.h trunk/cegcc/src/mingw/include/stdio.h trunk/cegcc/src/mingw/include/unistd.h trunk/cegcc/src/mingw/mingwex/wince/fdopen.c trunk/cegcc/src/mingw/mingwex/wince/lseek.c trunk/cegcc/src/mingw/mingwex/wince/open.c trunk/cegcc/src/mingw/mingwex/wince/read.c trunk/cegcc/src/mingw/mingwex/wince/write.c trunk/cegcc/src/mingw/moldname.def.in Modified: trunk/cegcc/src/mingw/ChangeLog.mingw32ce =================================================================== --- trunk/cegcc/src/mingw/ChangeLog.mingw32ce 2006-11-12 08:57:39 UTC (rev 785) +++ trunk/cegcc/src/mingw/ChangeLog.mingw32ce 2006-11-12 12:47:32 UTC (rev 786) @@ -1,5 +1,19 @@ 2006-11-11 Pedro Alves <ped...@po...> + * mingwex/wince/open.c (open): Rename to _open. + * mingwex/wince/lseek.c (lseek): Rename to _lseek. + * mingwex/wince/fdopen.c (fdopen): Rename to _fdopen. + * mingwex/wince/read.c (read): Rename to _read. + * mingwex/wince/write.c (write): Rename to _write. + * include/fcntl.h: Enable file. + * include/io.h (_open, open, lseek, _lseek, + read, _read, write, _write): Unhide. + * include/stdio.h (fdopen, _fdopen): Unhide. + * include/unistd.h: Enable file. + * moldname.def.in (open, lseek, read, write): Unhide. + +2006-11-11 Pedro Alves <ped...@po...> + * mingwex/Makefile.in (WINCE_DISTFILES): Add fdopen.c, read.c, write.c, open.c and lseek.c. (WINCE_OBJS): Add fdopen.o, read.o, write.o, open.o and lseek.o. Modified: trunk/cegcc/src/mingw/include/fcntl.h =================================================================== --- trunk/cegcc/src/mingw/include/fcntl.h 2006-11-12 08:57:39 UTC (rev 785) +++ trunk/cegcc/src/mingw/include/fcntl.h 2006-11-12 12:47:32 UTC (rev 786) @@ -8,10 +8,6 @@ * in sys/stat.h (ick). * */ -#ifdef __COREDLL__ -# include_next <fcntl.h> -#else /* __COREDLL__ */ - #ifndef _FCNTL_H_ #define _FCNTL_H_ @@ -71,5 +67,3 @@ #endif /* Not _NO_OLDNAMES */ #endif /* Not _FCNTL_H_ */ - -#endif /* Not __COREDLL__ */ Modified: trunk/cegcc/src/mingw/include/io.h =================================================================== --- trunk/cegcc/src/mingw/include/io.h 2006-11-12 08:57:39 UTC (rev 785) +++ trunk/cegcc/src/mingw/include/io.h 2006-11-12 12:47:32 UTC (rev 786) @@ -200,10 +200,11 @@ #endif #ifndef __COREDLL__ - _CRTIMP int __cdecl _access (const char*, int); _CRTIMP int __cdecl _chsize (int, long); +#endif /* __COREDLL__ */ _CRTIMP int __cdecl _close (int); +#ifndef __COREDLL__ _CRTIMP int __cdecl _commit(int); /* NOTE: The only significant bit in unPermissions appears to be bit 7 (0x80), @@ -227,15 +228,19 @@ /* LK_... locking commands defined in sys/locking.h. */ _CRTIMP int __cdecl _locking (int, int, long); +#endif /* __COREDLL__ */ _CRTIMP long __cdecl _lseek (int, long, int); /* Optional third argument is unsigned unPermissions. */ _CRTIMP int __cdecl _open (const char*, int, ...); +#ifndef __COREDLL__ _CRTIMP int __cdecl _open_osfhandle (long, int); _CRTIMP int __cdecl _pipe (int *, unsigned int, int); +#endif /* __COREDLL__ */ _CRTIMP int __cdecl _read (int, void*, unsigned int); +#ifndef __COREDLL__ _CRTIMP int __cdecl _setmode (int, int); /* SH_... flags for nShFlags defined in share.h @@ -247,9 +252,7 @@ _CRTIMP int __cdecl _umask (int); #endif /* __COREDLL__ */ _CRTIMP int __cdecl _unlink (const char*); -#ifndef __COREDLL__ _CRTIMP int __cdecl _write (int, const void*, unsigned int); -#endif /* __COREDLL__ */ /* Wide character versions. Also declared in wchar.h. */ /* Not in crtdll.dll */ @@ -284,25 +287,27 @@ #ifndef __COREDLL__ _CRTIMP int __cdecl access (const char*, int); _CRTIMP int __cdecl chsize (int, long ); +#endif /* __COREDLL__ */ _CRTIMP int __cdecl close (int); +#ifndef __COREDLL__ _CRTIMP int __cdecl creat (const char*, int); _CRTIMP int __cdecl dup (int); _CRTIMP int __cdecl dup2 (int, int); _CRTIMP int __cdecl eof (int); _CRTIMP long __cdecl filelength (int); _CRTIMP int __cdecl isatty (int); +#endif /* __COREDLL__ */ _CRTIMP long __cdecl lseek (int, long, int); _CRTIMP int __cdecl open (const char*, int, ...); _CRTIMP int __cdecl read (int, void*, unsigned int); +#ifndef __COREDLL__ _CRTIMP int __cdecl setmode (int, int); _CRTIMP int __cdecl sopen (const char*, int, int, ...); _CRTIMP long __cdecl tell (int); _CRTIMP int __cdecl umask (int); #endif /* __COREDLL__ */ _CRTIMP int __cdecl unlink (const char*); -#ifndef __COREDLL__ _CRTIMP int __cdecl write (int, const void*, unsigned int); -#endif /* __COREDLL__ */ #endif /* _UWIN */ /* Wide character versions. Also declared in wchar.h. */ Modified: trunk/cegcc/src/mingw/include/stdio.h =================================================================== --- trunk/cegcc/src/mingw/include/stdio.h 2006-11-12 08:57:39 UTC (rev 785) +++ trunk/cegcc/src/mingw/include/stdio.h 2006-11-12 12:47:32 UTC (rev 786) @@ -419,7 +419,9 @@ #ifndef __COREDLL__ _CRTIMP int __cdecl _fgetchar (void); _CRTIMP int __cdecl _fputchar (int); +#endif _CRTIMP FILE* __cdecl _fdopen (int, const char*); +#ifndef __COREDLL__ _CRTIMP FILE* __cdecl _fsopen(const char*, const char*, int); _CRTIMP int __cdecl _fileno (FILE*); #else @@ -432,10 +434,10 @@ #endif #ifndef _NO_OLDNAMES +_CRTIMP FILE* __cdecl fdopen (int, const char*); #ifndef __COREDLL__ _CRTIMP int __cdecl fgetchar (void); _CRTIMP int __cdecl fputchar (int); -_CRTIMP FILE* __cdecl fdopen (int, const char*); _CRTIMP int __cdecl fileno (FILE*); #else _CRTIMP void* __cdecl fileno (FILE*); Modified: trunk/cegcc/src/mingw/include/unistd.h =================================================================== --- trunk/cegcc/src/mingw/include/unistd.h 2006-11-12 08:57:39 UTC (rev 785) +++ trunk/cegcc/src/mingw/include/unistd.h 2006-11-12 12:47:32 UTC (rev 786) @@ -4,11 +4,6 @@ * unistd.h maps (roughly) to io.h */ -#ifdef __COREDLL__ -/* No such file on Windows CE. */ -# include_next <unistd.h> -#else /* __COREDLL__ */ - #ifndef _UNISTD_H #define _UNISTD_H @@ -36,5 +31,3 @@ #endif #endif /* _UNISTD_H */ - -#endif /* __COREDLL__ */ Modified: trunk/cegcc/src/mingw/mingwex/wince/fdopen.c =================================================================== --- trunk/cegcc/src/mingw/mingwex/wince/fdopen.c 2006-11-12 08:57:39 UTC (rev 785) +++ trunk/cegcc/src/mingw/mingwex/wince/fdopen.c 2006-11-12 12:47:32 UTC (rev 786) @@ -4,7 +4,7 @@ #define MAX_MODE 64 FILE * -fdopen (int fildes, const char *mode) +_fdopen (int fildes, const char *mode) { FILE *f; wchar_t wmode[MAX_MODE]; Modified: trunk/cegcc/src/mingw/mingwex/wince/lseek.c =================================================================== --- trunk/cegcc/src/mingw/mingwex/wince/lseek.c 2006-11-12 08:57:39 UTC (rev 785) +++ trunk/cegcc/src/mingw/mingwex/wince/lseek.c 2006-11-12 12:47:32 UTC (rev 786) @@ -2,7 +2,7 @@ #include <unistd.h> long -lseek (int fildes, long offset, int whence) +_lseek (int fildes, long offset, int whence) { DWORD mode = 0; switch (whence) Modified: trunk/cegcc/src/mingw/mingwex/wince/open.c =================================================================== --- trunk/cegcc/src/mingw/mingwex/wince/open.c 2006-11-12 08:57:39 UTC (rev 785) +++ trunk/cegcc/src/mingw/mingwex/wince/open.c 2006-11-12 12:47:32 UTC (rev 786) @@ -3,7 +3,7 @@ #include <fcntl.h> int -open (const char *path, int oflag, ...) +_open (const char *path, int oflag, ...) { wchar_t wpath[MAX_PATH]; DWORD fileaccess; Modified: trunk/cegcc/src/mingw/mingwex/wince/read.c =================================================================== --- trunk/cegcc/src/mingw/mingwex/wince/read.c 2006-11-12 08:57:39 UTC (rev 785) +++ trunk/cegcc/src/mingw/mingwex/wince/read.c 2006-11-12 12:47:32 UTC (rev 786) @@ -2,7 +2,7 @@ #include <unistd.h> int -read (int fildes, void *buf, unsigned int bufsize) +_read (int fildes, void *buf, unsigned int bufsize) { DWORD NumberOfBytesRead; if (bufsize > 0x7fffffff) Modified: trunk/cegcc/src/mingw/mingwex/wince/write.c =================================================================== --- trunk/cegcc/src/mingw/mingwex/wince/write.c 2006-11-12 08:57:39 UTC (rev 785) +++ trunk/cegcc/src/mingw/mingwex/wince/write.c 2006-11-12 12:47:32 UTC (rev 786) @@ -2,7 +2,7 @@ #include <unistd.h> int -write (int fildes, const void *buf, unsigned int bufsize) +_write (int fildes, const void *buf, unsigned int bufsize) { DWORD NumberOfBytesWritten; if (bufsize > 0x7fffffff) Modified: trunk/cegcc/src/mingw/moldname.def.in =================================================================== --- trunk/cegcc/src/mingw/moldname.def.in 2006-11-12 08:57:39 UTC (rev 785) +++ trunk/cegcc/src/mingw/moldname.def.in 2006-11-12 12:47:32 UTC (rev 786) @@ -29,7 +29,9 @@ chdir chmod chsize +#endif /* __COREDLL__ */ close +#ifndef __COREDLL__ creat cwait #endif /* __COREDLL__ */ @@ -83,21 +85,25 @@ kbhit lfind lsearch +#endif /* __COREDLL__ */ lseek -#endif /* __COREDLL__ */ ltoa memccpy memicmp #ifndef __COREDLL__ mkdir mktemp +#endif /* __COREDLL__ */ open +#ifndef __COREDLL__ pclose popen putch putenv putw +#endif /* __COREDLL__ */ read +#ifndef __COREDLL__ rmdir rmtmp searchenv @@ -160,9 +166,7 @@ #if (__MSVCRT__) wpopen #endif -#ifndef __COREDLL__ write -#endif /* __COREDLL__ */ ; non-ANSI functions declared in math.h j0 j1 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ped...@us...> - 2006-11-12 16:03:54
|
Revision: 787 http://svn.sourceforge.net/cegcc/?rev=787&view=rev Author: pedroalves Date: 2006-11-12 08:03:30 -0800 (Sun, 12 Nov 2006) Log Message: ----------- * mingwex/wince/close.c: New file. * mingwex/Makefile.in (WINCE_DISTFILES): Add close.c. (WINCE_OBJS): Add close.o. Modified Paths: -------------- trunk/cegcc/src/mingw/ChangeLog.mingw32ce Added Paths: ----------- trunk/cegcc/src/mingw/mingwex/wince/close.c Modified: trunk/cegcc/src/mingw/ChangeLog.mingw32ce =================================================================== --- trunk/cegcc/src/mingw/ChangeLog.mingw32ce 2006-11-12 12:47:32 UTC (rev 786) +++ trunk/cegcc/src/mingw/ChangeLog.mingw32ce 2006-11-12 16:03:30 UTC (rev 787) @@ -1,3 +1,9 @@ +2006-11-12 Pedro Alves <ped...@po...> + + * mingwex/wince/close.c: New file. + * mingwex/Makefile.in (WINCE_DISTFILES): Add close.c. + (WINCE_OBJS): Add close.o. + 2006-11-11 Pedro Alves <ped...@po...> * mingwex/wince/open.c (open): Rename to _open. Added: trunk/cegcc/src/mingw/mingwex/wince/close.c =================================================================== --- trunk/cegcc/src/mingw/mingwex/wince/close.c (rev 0) +++ trunk/cegcc/src/mingw/mingwex/wince/close.c 2006-11-12 16:03:30 UTC (rev 787) @@ -0,0 +1,10 @@ +#include <windows.h> +#include <unistd.h> + +int +_close (int fildes) +{ + if (CloseHandle ((HANDLE) fildes)) + return 0; + return -1; +} Property changes on: trunk/cegcc/src/mingw/mingwex/wince/close.c ___________________________________________________________________ Name: svn:eol-style + native This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ped...@us...> - 2006-11-12 16:12:05
|
Revision: 789 http://svn.sourceforge.net/cegcc/?rev=789&view=rev Author: pedroalves Date: 2006-11-12 08:11:47 -0800 (Sun, 12 Nov 2006) Log Message: ----------- * mingwex/wince/lseek.c: Handle invalid whence. Modified Paths: -------------- trunk/cegcc/src/mingw/ChangeLog.mingw32ce trunk/cegcc/src/mingw/mingwex/wince/lseek.c Modified: trunk/cegcc/src/mingw/ChangeLog.mingw32ce =================================================================== --- trunk/cegcc/src/mingw/ChangeLog.mingw32ce 2006-11-12 16:04:51 UTC (rev 788) +++ trunk/cegcc/src/mingw/ChangeLog.mingw32ce 2006-11-12 16:11:47 UTC (rev 789) @@ -1,5 +1,9 @@ 2006-11-12 Pedro Alves <ped...@po...> + * mingwex/wince/lseek.c: Handle invalid whence. + +2006-11-12 Pedro Alves <ped...@po...> + * mingwex/wince/close.c: New file. * mingwex/Makefile.in (WINCE_DISTFILES): Add close.c. (WINCE_OBJS): Add close.o. Modified: trunk/cegcc/src/mingw/mingwex/wince/lseek.c =================================================================== --- trunk/cegcc/src/mingw/mingwex/wince/lseek.c 2006-11-12 16:04:51 UTC (rev 788) +++ trunk/cegcc/src/mingw/mingwex/wince/lseek.c 2006-11-12 16:11:47 UTC (rev 789) @@ -4,7 +4,7 @@ long _lseek (int fildes, long offset, int whence) { - DWORD mode = 0; + DWORD mode; switch (whence) { case SEEK_SET: @@ -16,6 +16,9 @@ case SEEK_END: mode = FILE_END; break; + default: + /* Specify an invalid mode so SetFilePointer catches it. */ + mode = (DWORD)-1; } return (long) SetFilePointer ((HANDLE) fildes, offset, NULL, mode); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ped...@us...> - 2006-11-12 17:41:55
|
Revision: 790 http://svn.sourceforge.net/cegcc/?rev=790&view=rev Author: pedroalves Date: 2006-11-12 09:41:27 -0800 (Sun, 12 Nov 2006) Log Message: ----------- * include/unistd.h: Hide ftruncate. Modified Paths: -------------- trunk/cegcc/src/mingw/ChangeLog.mingw32ce trunk/cegcc/src/mingw/include/unistd.h Modified: trunk/cegcc/src/mingw/ChangeLog.mingw32ce =================================================================== --- trunk/cegcc/src/mingw/ChangeLog.mingw32ce 2006-11-12 16:11:47 UTC (rev 789) +++ trunk/cegcc/src/mingw/ChangeLog.mingw32ce 2006-11-12 17:41:27 UTC (rev 790) @@ -1,5 +1,9 @@ 2006-11-12 Pedro Alves <ped...@po...> + * include/unistd.h: Hide ftruncate. + +2006-11-12 Pedro Alves <ped...@po...> + * mingwex/wince/lseek.c: Handle invalid whence. 2006-11-12 Pedro Alves <ped...@po...> Modified: trunk/cegcc/src/mingw/include/unistd.h =================================================================== --- trunk/cegcc/src/mingw/include/unistd.h 2006-11-12 16:11:47 UTC (rev 789) +++ trunk/cegcc/src/mingw/include/unistd.h 2006-11-12 17:41:27 UTC (rev 790) @@ -18,6 +18,7 @@ extern "C" { #endif +#ifndef __COREDLL__ /* This is defined as a real library function to allow autoconf to verify its existence. */ int ftruncate(int, off_t); @@ -25,6 +26,7 @@ { return _chsize (__fd, __length); } +#endif #ifdef __cplusplus } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ped...@us...> - 2006-11-13 15:35:46
|
Revision: 806 http://svn.sourceforge.net/cegcc/?rev=806&view=rev Author: pedroalves Date: 2006-11-13 07:35:20 -0800 (Mon, 13 Nov 2006) Log Message: ----------- * profile/profile.h: Use __arm__ instead of ARM. * profile/profil.c: Likewise. Modified Paths: -------------- trunk/cegcc/src/mingw/ChangeLog.mingw32ce trunk/cegcc/src/mingw/profile/profil.c trunk/cegcc/src/mingw/profile/profile.h Modified: trunk/cegcc/src/mingw/ChangeLog.mingw32ce =================================================================== --- trunk/cegcc/src/mingw/ChangeLog.mingw32ce 2006-11-12 22:47:54 UTC (rev 805) +++ trunk/cegcc/src/mingw/ChangeLog.mingw32ce 2006-11-13 15:35:20 UTC (rev 806) @@ -1,3 +1,8 @@ +2006-11-13 Pedro Alves <ped...@po...> + + * profile/profile.h: Use __arm__ instead of ARM. + * profile/profil.c: Likewise. + 2006-11-12 Pedro Alves <ped...@po...> * include/unistd.h: Hide ftruncate. Modified: trunk/cegcc/src/mingw/profile/profil.c =================================================================== --- trunk/cegcc/src/mingw/profile/profil.c 2006-11-12 22:47:54 UTC (rev 805) +++ trunk/cegcc/src/mingw/profile/profil.c 2006-11-13 15:35:20 UTC (rev 806) @@ -42,7 +42,7 @@ return (u_long) - 1; ctx.ContextFlags = CONTEXT_CONTROL | CONTEXT_INTEGER; pc = (u_long) - 1; -#ifdef ARM +#ifdef __arm__ if (GetThreadContext (thr, &ctx)) pc = ctx.Pc; #else @@ -117,7 +117,7 @@ GetCurrentProcess (), &p->targthr, 0, FALSE, DUPLICATE_SAME_ACCESS)) { -#ifndef ARM +#ifndef __arm__ errno = ESRCH; #endif return -1; @@ -135,7 +135,7 @@ { CloseHandle (p->targthr); p->targthr = 0; -#ifndef ARM +#ifndef __arm__ errno = EAGAIN; #endif return -1; @@ -163,7 +163,7 @@ if (scale > 65536) { -#ifndef ARM +#ifndef __arm__ errno = EINVAL; #endif return -1; Modified: trunk/cegcc/src/mingw/profile/profile.h =================================================================== --- trunk/cegcc/src/mingw/profile/profile.h 2006-11-12 22:47:54 UTC (rev 805) +++ trunk/cegcc/src/mingw/profile/profile.h 2006-11-13 15:35:20 UTC (rev 806) @@ -35,7 +35,7 @@ * @(#)profile.h 8.1 (Berkeley) 6/11/93 */ -#ifdef ARM +#ifdef __arm__ /* Machine-dependent definitions for profiling support. ARM version. * Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc. * This file is part of the GNU C Library. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ped...@us...> - 2006-11-16 14:27:53
|
Revision: 808 http://svn.sourceforge.net/cegcc/?rev=808&view=rev Author: pedroalves Date: 2006-11-16 06:25:37 -0800 (Thu, 16 Nov 2006) Log Message: ----------- * moldname.def.in (open, lseek, read, write): Don't export on coredll.dll. * mingwex/wince/open.c (vopen): Rename from _open, and made static. * mingwex/wince/open.c (open, _open): New functions. * mingwex/wince/lseek.c (lseek): New function, implementing an alias for the underscored version. * mingwex/wince/fdopen.c (fdopen): Likewise. * mingwex/wince/read.c (read): Likewise. * mingwex/wince/write.c (write): Likewise. Modified Paths: -------------- trunk/cegcc/src/mingw/ChangeLog.mingw32ce trunk/cegcc/src/mingw/mingwex/wince/close.c trunk/cegcc/src/mingw/mingwex/wince/fdopen.c trunk/cegcc/src/mingw/mingwex/wince/lseek.c trunk/cegcc/src/mingw/mingwex/wince/open.c trunk/cegcc/src/mingw/moldname.def.in Modified: trunk/cegcc/src/mingw/ChangeLog.mingw32ce =================================================================== --- trunk/cegcc/src/mingw/ChangeLog.mingw32ce 2006-11-14 17:48:31 UTC (rev 807) +++ trunk/cegcc/src/mingw/ChangeLog.mingw32ce 2006-11-16 14:25:37 UTC (rev 808) @@ -1,3 +1,16 @@ +2006-11-16 Pedro Alves <ped...@po...> + + * moldname.def.in (open, lseek, read, write): Don't export on + coredll.dll. + * mingwex/wince/open.c (vopen): Rename from _open, and made + static. + * mingwex/wince/open.c (open, _open): New functions. + * mingwex/wince/lseek.c (lseek): New function, implementing an + alias for the underscored version. + * mingwex/wince/fdopen.c (fdopen): Likewise. + * mingwex/wince/read.c (read): Likewise. + * mingwex/wince/write.c (write): Likewise. + 2006-11-13 Pedro Alves <ped...@po...> * profile/profile.h: Use __arm__ instead of ARM. Modified: trunk/cegcc/src/mingw/mingwex/wince/close.c =================================================================== --- trunk/cegcc/src/mingw/mingwex/wince/close.c 2006-11-14 17:48:31 UTC (rev 807) +++ trunk/cegcc/src/mingw/mingwex/wince/close.c 2006-11-16 14:25:37 UTC (rev 808) @@ -8,3 +8,9 @@ return 0; return -1; } + +int +close (int fildes) +{ + return _close (fildes); +} Modified: trunk/cegcc/src/mingw/mingwex/wince/fdopen.c =================================================================== --- trunk/cegcc/src/mingw/mingwex/wince/fdopen.c 2006-11-14 17:48:31 UTC (rev 807) +++ trunk/cegcc/src/mingw/mingwex/wince/fdopen.c 2006-11-16 14:25:37 UTC (rev 808) @@ -15,3 +15,9 @@ f = _wfdopen (fildes, wmode); return f; } + +FILE * +fdopen (int fildes, const char *mode) +{ + return _fdopen (fildes, mode); +} Modified: trunk/cegcc/src/mingw/mingwex/wince/lseek.c =================================================================== --- trunk/cegcc/src/mingw/mingwex/wince/lseek.c 2006-11-14 17:48:31 UTC (rev 807) +++ trunk/cegcc/src/mingw/mingwex/wince/lseek.c 2006-11-16 14:25:37 UTC (rev 808) @@ -17,8 +17,14 @@ mode = FILE_END; break; default: - /* Specify an invalid mode so SetFilePointer catches it. */ + /* Specify an invalid mode so SetFilePointer catches it. */ mode = (DWORD)-1; } return (long) SetFilePointer ((HANDLE) fildes, offset, NULL, mode); } + +long +lseek (int fildes, long offset, int whence) +{ + return _lseek (fildes, offset, whence); +} Modified: trunk/cegcc/src/mingw/mingwex/wince/open.c =================================================================== --- trunk/cegcc/src/mingw/mingwex/wince/open.c 2006-11-14 17:48:31 UTC (rev 807) +++ trunk/cegcc/src/mingw/mingwex/wince/open.c 2006-11-16 14:25:37 UTC (rev 808) @@ -2,8 +2,8 @@ #include <unistd.h> #include <fcntl.h> -int -_open (const char *path, int oflag, ...) +static int +vopen (const char *path, int oflag, va_list ap) { wchar_t wpath[MAX_PATH]; DWORD fileaccess; @@ -72,3 +72,25 @@ return (int) hnd; } + +int +_open (const char *path, int oflag, ...) +{ + va_list ap; + int ret; + va_start (ap, oflag); + ret = vopen (path, oflag, ap); + va_end (ap); + return ret; +} + +int +open (const char *path, int oflag, ...) +{ + va_list ap; + int ret; + va_start (ap, oflag); + ret = vopen (path, oflag, ap); + va_end (ap); + return ret; +} Modified: trunk/cegcc/src/mingw/moldname.def.in =================================================================== --- trunk/cegcc/src/mingw/moldname.def.in 2006-11-14 17:48:31 UTC (rev 807) +++ trunk/cegcc/src/mingw/moldname.def.in 2006-11-16 14:25:37 UTC (rev 808) @@ -29,9 +29,7 @@ chdir chmod chsize -#endif /* __COREDLL__ */ close -#ifndef __COREDLL__ creat cwait #endif /* __COREDLL__ */ @@ -85,25 +83,21 @@ kbhit lfind lsearch -#endif /* __COREDLL__ */ lseek +#endif /* __COREDLL__ */ ltoa memccpy memicmp #ifndef __COREDLL__ mkdir mktemp -#endif /* __COREDLL__ */ open -#ifndef __COREDLL__ pclose popen putch putenv putw -#endif /* __COREDLL__ */ read -#ifndef __COREDLL__ rmdir rmtmp searchenv @@ -166,7 +160,9 @@ #if (__MSVCRT__) wpopen #endif +#ifndef __COREDLL__ write +#endif ; non-ANSI functions declared in math.h j0 j1 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ped...@us...> - 2006-11-19 04:30:46
|
Revision: 813 http://svn.sourceforge.net/cegcc/?rev=813&view=rev Author: pedroalves Date: 2006-11-18 20:30:44 -0800 (Sat, 18 Nov 2006) Log Message: ----------- * mingwex/wince/unlink.c (unlink): New function, implementing an alias for the underscored version. * mingwex/wince/read.c (read): Likewise. * mingwex/wince/write.c (write): Likewise. Modified Paths: -------------- trunk/cegcc/src/mingw/ChangeLog.mingw32ce trunk/cegcc/src/mingw/mingwex/wince/read.c trunk/cegcc/src/mingw/mingwex/wince/unlink.c trunk/cegcc/src/mingw/mingwex/wince/write.c Modified: trunk/cegcc/src/mingw/ChangeLog.mingw32ce =================================================================== --- trunk/cegcc/src/mingw/ChangeLog.mingw32ce 2006-11-18 15:01:40 UTC (rev 812) +++ trunk/cegcc/src/mingw/ChangeLog.mingw32ce 2006-11-19 04:30:44 UTC (rev 813) @@ -1,3 +1,10 @@ +2006-11-19 Pedro Alves <ped...@po...> + + * mingwex/wince/unlink.c (unlink): New function, implementing an + alias for the underscored version. + * mingwex/wince/read.c (read): Likewise. + * mingwex/wince/write.c (write): Likewise. + 2006-11-16 Pedro Alves <ped...@po...> * moldname.def.in (open, lseek, read, write): Don't export on @@ -8,8 +15,6 @@ * mingwex/wince/lseek.c (lseek): New function, implementing an alias for the underscored version. * mingwex/wince/fdopen.c (fdopen): Likewise. - * mingwex/wince/read.c (read): Likewise. - * mingwex/wince/write.c (write): Likewise. 2006-11-13 Pedro Alves <ped...@po...> Modified: trunk/cegcc/src/mingw/mingwex/wince/read.c =================================================================== --- trunk/cegcc/src/mingw/mingwex/wince/read.c 2006-11-18 15:01:40 UTC (rev 812) +++ trunk/cegcc/src/mingw/mingwex/wince/read.c 2006-11-19 04:30:44 UTC (rev 813) @@ -11,3 +11,9 @@ return -1; return (int) NumberOfBytesRead; } + +int +read (int fildes, void *buf, unsigned int bufsize) +{ + return _read (fildes, buf, bufsize); +} Modified: trunk/cegcc/src/mingw/mingwex/wince/unlink.c =================================================================== --- trunk/cegcc/src/mingw/mingwex/wince/unlink.c 2006-11-18 15:01:40 UTC (rev 812) +++ trunk/cegcc/src/mingw/mingwex/wince/unlink.c 2006-11-19 04:30:44 UTC (rev 813) @@ -10,3 +10,9 @@ return 0; return -1; } + +int +unlink (const char *file) +{ + return _unlink (file); +} Modified: trunk/cegcc/src/mingw/mingwex/wince/write.c =================================================================== --- trunk/cegcc/src/mingw/mingwex/wince/write.c 2006-11-18 15:01:40 UTC (rev 812) +++ trunk/cegcc/src/mingw/mingwex/wince/write.c 2006-11-19 04:30:44 UTC (rev 813) @@ -11,3 +11,9 @@ return -1; return (int) NumberOfBytesWritten; } + +int +write (int fildes, const void *buf, unsigned int bufsize) +{ + return _write (fildes, buf, bufsize); +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ped...@us...> - 2006-11-19 04:34:23
|
Revision: 814 http://svn.sourceforge.net/cegcc/?rev=814&view=rev Author: pedroalves Date: 2006-11-18 20:34:22 -0800 (Sat, 18 Nov 2006) Log Message: ----------- * include/stdio.h (rmtmp): Fix typo. Modified Paths: -------------- trunk/cegcc/src/mingw/ChangeLog.mingw32ce trunk/cegcc/src/mingw/include/stdio.h Modified: trunk/cegcc/src/mingw/ChangeLog.mingw32ce =================================================================== --- trunk/cegcc/src/mingw/ChangeLog.mingw32ce 2006-11-19 04:30:44 UTC (rev 813) +++ trunk/cegcc/src/mingw/ChangeLog.mingw32ce 2006-11-19 04:34:22 UTC (rev 814) @@ -1,5 +1,9 @@ 2006-11-19 Pedro Alves <ped...@po...> + * include/stdio.h (rmtmp): Fix typo. + +2006-11-19 Pedro Alves <ped...@po...> + * mingwex/wince/unlink.c (unlink): New function, implementing an alias for the underscored version. * mingwex/wince/read.c (read): Likewise. Modified: trunk/cegcc/src/mingw/include/stdio.h =================================================================== --- trunk/cegcc/src/mingw/include/stdio.h 2006-11-19 04:30:44 UTC (rev 813) +++ trunk/cegcc/src/mingw/include/stdio.h 2006-11-19 04:34:22 UTC (rev 814) @@ -215,7 +215,7 @@ #ifndef NO_OLDNAMES _CRTIMP char* __cdecl tempnam (const char*, const char*); #ifndef __COREDLL__ -CRTIMP int __cdecl rmtmp(void); +_CRTIMP int __cdecl rmtmp(void); #endif /* __COREDLL__ */ #endif /* NO_OLDNAMES */ #endif /* __STRICT_ANSI__ */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ped...@us...> - 2006-11-27 21:35:35
|
Revision: 828 http://svn.sourceforge.net/cegcc/?rev=828&view=rev Author: pedroalves Date: 2006-11-27 13:35:32 -0800 (Mon, 27 Nov 2006) Log Message: ----------- * Makefile.in: Adjust so mingw32ce uses crt3.o and dllcrt3.o. * dllcrt1.c: Remove extra space in comment. * crt3.c: Rename from crt1_ce.c. Modified Paths: -------------- trunk/cegcc/src/mingw/ChangeLog.mingw32ce trunk/cegcc/src/mingw/Makefile.in trunk/cegcc/src/mingw/dllcrt1.c Added Paths: ----------- trunk/cegcc/src/mingw/crt3.c Removed Paths: ------------- trunk/cegcc/src/mingw/crt1_ce.c Modified: trunk/cegcc/src/mingw/ChangeLog.mingw32ce =================================================================== --- trunk/cegcc/src/mingw/ChangeLog.mingw32ce 2006-11-27 21:05:00 UTC (rev 827) +++ trunk/cegcc/src/mingw/ChangeLog.mingw32ce 2006-11-27 21:35:32 UTC (rev 828) @@ -1,5 +1,11 @@ -2006-11-25 Kevin O'Connor <ke...@ko...> +2006-11-27 Pedro Alves <ped...@po...> + * Makefile.in: Adjust so mingw32ce uses crt3.o and dllcrt3.o. + * dllcrt1.c: Remove extra space in comment. + * crt3.c: Rename from crt1_ce.c. + +2006-11-27 Kevin O'Connor <ke...@ko...> + * crt1_ce.c: New file. Implement WinMainCRTStartup for CE programs in its own CE specific file. * winmain_ce.c: New file. Implement a WinMain function that calls Modified: trunk/cegcc/src/mingw/Makefile.in =================================================================== --- trunk/cegcc/src/mingw/Makefile.in 2006-11-27 21:05:00 UTC (rev 827) +++ trunk/cegcc/src/mingw/Makefile.in 2006-11-27 21:35:32 UTC (rev 828) @@ -93,7 +93,7 @@ libdir= endif -# Either crtdll (CRT_ID 1) or msvcrt (CRT_ID 2). +# Either crtdll (CRT_ID 1) or msvcrt (CRT_ID 2) or coredll (CRT_ID 3). RUNTIME = @RUNTIME@ CRT_ID = @CRT_ID@ @@ -159,11 +159,11 @@ TARFLAGS="$(TARFLAGS)" \ TARFILEEXT="$(TARFILEEXT)" -CRT0S = crt2.o dllcrt2.o CRT_noglob.o crtmt.o crtst.o +CRT0S = CRT_noglob.o crtmt.o crtst.o ifneq (,$(findstring wince,$(target_alias))) -CRT0S += +CRT0S += crt3.o dllcrt3.o else -CRT0S += crt1.o dllcrt1.o CRT_fp8.o CRT_fp10.o txtmode.o binmode.o +CRT0S += crt1.o dllcrt1.o crt2.o dllcrt2.o CRT_fp8.o CRT_fp10.o txtmode.o binmode.o endif MINGW_OBJS = CRTglob.o CRTfmode.o CRTinit.o dllmain.o gccmain.o \ @@ -336,24 +336,16 @@ $(AR) rc $@ $(MOLD_OBJS) $(RANLIB) $@ -ifneq (,$(findstring wince,$(target_alias))) # The special rules are necessary. crt1.o dllcrt1.o: - $(CC) -c -D__COREDLL__ -U__CRTDLL__ -U__MSVCRT__ $(ALL_CFLAGS) $< -o $@ - -crt2.o dllcrt2.o: - $(CC) -c -D__COREDLL__ -U__CRTDLL__ -U__MSVCRT__ $(ALL_CFLAGS) $< -o $@ - -else - -# The special rules are necessary. -crt1.o dllcrt1.o: $(CC) -c -D__CRTDLL__ -U__MSVCRT__ $(ALL_CFLAGS) $< -o $@ crt2.o dllcrt2.o: $(CC) -c -D__MSVCRT__ -U__CRTDLL__ $(ALL_CFLAGS) $< -o $@ -endif +crt3.o dllcrt3.o: + $(CC) -c -D__COREDLL__ -U__CRTDLL__ -U__MSVCRT__ $(ALL_CFLAGS) $< -o $@ + TEST_H_OPTIONS = $(ALL_CFLAGS) -Wall -W -Wsystem-headers -c \ $(srcdir)/test_headers.c -o test_headers.o @@ -498,18 +490,15 @@ CRTfmode.o: CRTfmode.c CRTglob.o: CRTglob.c CRTinit.o: CRTinit.c -ifneq (,$(findstring wince,$(target_alias))) -crt1.o: crt1_ce.c -crt2.o: crt1_ce.c -else crt1.o: crt1.c init.c crt2.o: crt1.c init.c -endif +crt3.o: crt3.c crtmt.o: crtmt.c crtst.o: crtst.c ctype_old.o: ctype_old.c dllcrt1.o: dllcrt1.c dllcrt2.o: dllcrt1.c +dllcrt3.o: dllcrt1.c dllmain.o: dllmain.c main.o: main.c winmain_ce.o: winmain_ce.c Deleted: trunk/cegcc/src/mingw/crt1_ce.c =================================================================== --- trunk/cegcc/src/mingw/crt1_ce.c 2006-11-27 21:05:00 UTC (rev 827) +++ trunk/cegcc/src/mingw/crt1_ce.c 2006-11-27 21:35:32 UTC (rev 828) @@ -1,71 +0,0 @@ -/* - * crt1_ce.c - * This file has no copyright assigned and is placed in the Public Domain. - * This file is a part of the mingw-runtime package. - * No warranty is given; refer to the file DISCLAIMER within the package. - * - * Source code for the startup proceedures used by all programs on a - * wince system. This code is compiled to make crt1.o, which should be - * located in the library path. - * - */ - -/* Hide the declaration of _fmode with dllimport attribute in stdlib.h to - avoid problems with older GCC. */ -#define __IN_MINGW_RUNTIME -#include <stdlib.h> -#include <stdio.h> -#include <process.h> -#include <float.h> -#define WIN32_LEAN_AND_MEAN -#include <windows.h> - -extern void __gccmain (); -extern void _pei386_runtime_relocator (void); - -/* No atexit on coredll, we must initialize our private version. */ -BOOL __atexit_init(void); - -/* - * This function is called from the entry point for all programs. - */ -void -WinMainCRTStartup (HINSTANCE hInst, HINSTANCE hPrevInst, - LPWSTR lpCmdLine, int nCmdShow) -{ - int nRet; - - /* - * Initialize floating point unit. - */ - _fpreset (); /* Supplied by the runtime library. */ - - /* Adust references to dllimported data that have non-zero offsets. */ - _pei386_runtime_relocator (); - - /* - * Initialize the atexit table. - */ - __atexit_init(); - - /* From libgcc.a, __main calls global class constructors, - __do_global_ctors, which registers __do_global_dtors as the first - entry of the private atexit table we have just initialised */ - __gccmain(); - - /* - * Call the main function. If the user does not supply one the one - * in the 'libmingw32.a' library will be linked in, and that one - * calls main. See winmain_ce.c in the 'lib' dir for more details. - */ - - nRet = WinMain(hInst, hPrevInst, lpCmdLine, nCmdShow); - - /* - * Perform exit processing for the C library. This means - * flushing output and calling 'atexit' registered functions. - */ - _cexit (); - - ExitProcess (nRet); -} Copied: trunk/cegcc/src/mingw/crt3.c (from rev 827, trunk/cegcc/src/mingw/crt1_ce.c) =================================================================== --- trunk/cegcc/src/mingw/crt3.c (rev 0) +++ trunk/cegcc/src/mingw/crt3.c 2006-11-27 21:35:32 UTC (rev 828) @@ -0,0 +1,71 @@ +/* + * crt1_ce.c + * This file has no copyright assigned and is placed in the Public Domain. + * This file is a part of the mingw-runtime package. + * No warranty is given; refer to the file DISCLAIMER within the package. + * + * Source code for the startup proceedures used by all programs on a + * wince system. This code is compiled to make crt1.o, which should be + * located in the library path. + * + */ + +/* Hide the declaration of _fmode with dllimport attribute in stdlib.h to + avoid problems with older GCC. */ +#define __IN_MINGW_RUNTIME +#include <stdlib.h> +#include <stdio.h> +#include <process.h> +#include <float.h> +#define WIN32_LEAN_AND_MEAN +#include <windows.h> + +extern void __gccmain (); +extern void _pei386_runtime_relocator (void); + +/* No atexit on coredll, we must initialize our private version. */ +BOOL __atexit_init(void); + +/* + * This function is called from the entry point for all programs. + */ +void +WinMainCRTStartup (HINSTANCE hInst, HINSTANCE hPrevInst, + LPWSTR lpCmdLine, int nCmdShow) +{ + int nRet; + + /* + * Initialize floating point unit. + */ + _fpreset (); /* Supplied by the runtime library. */ + + /* Adust references to dllimported data that have non-zero offsets. */ + _pei386_runtime_relocator (); + + /* + * Initialize the atexit table. + */ + __atexit_init(); + + /* From libgcc.a, __main calls global class constructors, + __do_global_ctors, which registers __do_global_dtors as the first + entry of the private atexit table we have just initialised */ + __gccmain(); + + /* + * Call the main function. If the user does not supply one the one + * in the 'libmingw32.a' library will be linked in, and that one + * calls main. See winmain_ce.c in the 'lib' dir for more details. + */ + + nRet = WinMain(hInst, hPrevInst, lpCmdLine, nCmdShow); + + /* + * Perform exit processing for the C library. This means + * flushing output and calling 'atexit' registered functions. + */ + _cexit (); + + ExitProcess (nRet); +} Modified: trunk/cegcc/src/mingw/dllcrt1.c =================================================================== --- trunk/cegcc/src/mingw/dllcrt1.c 2006-11-27 21:05:00 UTC (rev 827) +++ trunk/cegcc/src/mingw/dllcrt1.c 2006-11-27 21:35:32 UTC (rev 828) @@ -40,7 +40,7 @@ static p_atexit_fn* next_atexit; static void __dll_exit (void); -/* This is based on the function in the Wine project's exit.c */ +/* This is based on the function in the Wine project's exit.c */ p_atexit_fn __dllonexit (p_atexit_fn, p_atexit_fn**, p_atexit_fn**); #else /* __COREDLL__ */ void __dll_exit (void); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ped...@us...> - 2006-11-27 21:46:40
|
Revision: 827 http://svn.sourceforge.net/cegcc/?rev=827&view=rev Author: pedroalves Date: 2006-11-27 13:05:00 -0800 (Mon, 27 Nov 2006) Log Message: ----------- * crt1_ce.c: New file. Implement WinMainCRTStartup for CE programs in its own CE specific file. * winmain_ce.c: New file. Implement a WinMain function that calls main, for those CE programs that define main instead of WinMain. * Makefile.in: Modify so that these two new CE specific files are only built for mingw32ce. * crt1.c, init.c, main.c: Revert them back to their x86 MinGW originals. Modified Paths: -------------- trunk/cegcc/src/mingw/ChangeLog.mingw32ce trunk/cegcc/src/mingw/Makefile.in trunk/cegcc/src/mingw/crt1.c trunk/cegcc/src/mingw/init.c trunk/cegcc/src/mingw/main.c Added Paths: ----------- trunk/cegcc/src/mingw/crt1_ce.c trunk/cegcc/src/mingw/winmain_ce.c Modified: trunk/cegcc/src/mingw/ChangeLog.mingw32ce =================================================================== --- trunk/cegcc/src/mingw/ChangeLog.mingw32ce 2006-11-27 16:38:00 UTC (rev 826) +++ trunk/cegcc/src/mingw/ChangeLog.mingw32ce 2006-11-27 21:05:00 UTC (rev 827) @@ -1,3 +1,14 @@ +2006-11-25 Kevin O'Connor <ke...@ko...> + + * crt1_ce.c: New file. Implement WinMainCRTStartup for CE + programs in its own CE specific file. + * winmain_ce.c: New file. Implement a WinMain function that calls + main, for those CE programs that define main instead of WinMain. + * Makefile.in: Modify so that these two new CE specific files are + only built for mingw32ce. + * crt1.c, init.c, main.c: Revert them back to their x86 MinGW + originals. + 2006-11-19 Pedro Alves <ped...@po...> * include/stdio.h (rmtmp): Fix typo. Modified: trunk/cegcc/src/mingw/Makefile.in =================================================================== --- trunk/cegcc/src/mingw/Makefile.in 2006-11-27 16:38:00 UTC (rev 826) +++ trunk/cegcc/src/mingw/Makefile.in 2006-11-27 21:05:00 UTC (rev 827) @@ -167,13 +167,13 @@ endif MINGW_OBJS = CRTglob.o CRTfmode.o CRTinit.o dllmain.o gccmain.o \ - main.o crtst.o mthr_stub.o \ + crtst.o mthr_stub.o \ pseudo-reloc.o pseudo-reloc-list.o cpu_features.o ifneq (,$(findstring wince,$(target_alias))) -MINGW_OBJS += abort.o atexit.o assert.o +MINGW_OBJS += winmain_ce.o abort.o atexit.o assert.o else -MINGW_OBJS += CRT_fp10.o txtmode.o +MINGW_OBJS += main.o CRT_fp10.o txtmode.o endif MOLD_OBJS = isascii.o iscsym.o iscsymf.o toascii.o \ @@ -498,8 +498,13 @@ CRTfmode.o: CRTfmode.c CRTglob.o: CRTglob.c CRTinit.o: CRTinit.c +ifneq (,$(findstring wince,$(target_alias))) +crt1.o: crt1_ce.c +crt2.o: crt1_ce.c +else crt1.o: crt1.c init.c crt2.o: crt1.c init.c +endif crtmt.o: crtmt.c crtst.o: crtst.c ctype_old.o: ctype_old.c @@ -507,6 +512,7 @@ dllcrt2.o: dllcrt1.c dllmain.o: dllmain.c main.o: main.c +winmain_ce.o: winmain_ce.c oldnames.o: oldnames.c string_old.o: string_old.c CRT_fp8.o: CRT_fp8.c Modified: trunk/cegcc/src/mingw/crt1.c =================================================================== --- trunk/cegcc/src/mingw/crt1.c 2006-11-27 16:38:00 UTC (rev 826) +++ trunk/cegcc/src/mingw/crt1.c 2006-11-27 21:05:00 UTC (rev 827) @@ -14,17 +14,12 @@ #define __IN_MINGW_RUNTIME #include <stdlib.h> #include <stdio.h> -#ifndef __COREDLL__ #include <io.h> -#endif #include <process.h> #include <float.h> #define WIN32_LEAN_AND_MEAN #include <windows.h> - -#ifndef __COREDLL__ #include <signal.h> -#endif /* NOTE: The code for initializing the _argv, _argc, and environ variables * has been moved to a separate .c file which is included in both @@ -36,14 +31,7 @@ extern void _pei386_runtime_relocator (void); -#ifndef UNDER_CE extern int main (int, char **, char **); -#else -/* No environ. */ -extern int main (int, char **); -/* No atexit on coredll, we must initialize our private version. */ -BOOL __atexit_init(void); -#endif /* * Must have the correct app type for MSVCRT. @@ -56,8 +44,6 @@ __MINGW_IMPORT void __set_app_type(int); #endif /* __MSVCRT__ */ -#ifndef __COREDLL__ - /* Global _fmode for this .exe, not the one in msvcrt.dll, The default is set in txtmode.o in libmingw32.a */ /* Override the dllimport'd declarations in stdlib.h */ @@ -66,6 +52,7 @@ #ifdef __MSVCRT__ extern int* __p__fmode(void); /* To access the dll _fmode */ #endif + /* * Setup the default file handles to have the _CRT_fmode mode, as well as * any new files created by the user. @@ -102,16 +89,13 @@ } /* Now sync the dll _fmode to the one for this .exe. */ -#if defined (__MSVCRT__) +#ifdef __MSVCRT__ *__p__fmode() = _fmode; -#elif defined (__CRTDLL__) - *__IMP(_fmode_dll) = _fmode; +#else + *_imp___fmode_dll = _fmode; #endif } -#endif -#ifndef UNDER_CE - /* This function will be called when a trap occurs. Thanks to Jacob Navia for his contribution. */ static CALLBACK long @@ -193,17 +177,14 @@ return action; } -#endif - /* - * The function __mingw_CRTStartup is called from the entry point for all programs. + * The function mainCRTStartup is the entry point for all console programs. */ static void __attribute__((noreturn)) __mingw_CRTStartup (void) { int nRet; -#ifdef __i386__ /* * Set up the top-level exception handler so that signal handling * works as expected. The mapping between ANSI/POSIX signals and @@ -211,10 +192,6 @@ * */ SetUnhandledExceptionFilter (_gnu_exception_handler); -#elif defined (__arm__) - /* Windows CE on RISC architectures uses table based seh. - We could install a top-level handler using the same technique as cegcc. */ -#endif /* * Initialize floating point unit. @@ -227,7 +204,6 @@ */ _mingw32_init_mainargs (); -#ifndef __COREDLL__ /* * Sets the default file mode. * If _CRT_fmode is set, also set mode for stdin, stdout @@ -235,36 +211,21 @@ * NOTE: DLLs don't do this because that would be rude! */ _mingw32_init_fmode (); -#endif /* Adust references to dllimported data that have non-zero offsets. */ _pei386_runtime_relocator (); -#ifdef __i386__ /* Align the stack to 16 bytes for the sake of SSE ops in main or in functions inlined into main. */ asm __volatile__ ("andl $-16, %%esp" : : : "%esp"); -#endif -#ifdef __COREDLL__ /* - * Initialize the atexit table. - */ - __atexit_init(); -#endif - - /* * Call the main function. If the user does not supply one * the one in the 'libmingw32.a' library will be linked in, and * that one calls WinMain. See main.c in the 'lib' dir * for more details. */ -#ifndef UNDER_CE nRet = main (_argc, _argv, environ); -#else - /* Windows CE has no environ. */ - nRet = main (_argc, _argv); -#endif /* * Perform exit processing for the C library. This means @@ -275,7 +236,6 @@ ExitProcess (nRet); } -#ifndef UNDER_CE /* * The function mainCRTStartup is the entry point for all console programs. */ @@ -288,8 +248,6 @@ __mingw_CRTStartup (); } -#endif - /* * For now the GUI startup function is the same as the console one. * This simply gets rid of the annoying warning about not being able @@ -304,24 +262,20 @@ __mingw_CRTStartup (); } -#ifndef UNDER_CE - /* * We force use of library version of atexit, which is only - * visible in import lib as __IMP(atexit) + * visible in import lib as _imp__atexit */ -extern int (*__IMP(atexit))(void (*)(void)); +extern int (*_imp__atexit)(void (*)(void)); int atexit (void (* pfn )(void) ) { - return ( (*__IMP(atexit))(pfn)); + return ( (*_imp__atexit)(pfn)); } /* Likewise for non-ANSI _onexit */ -extern _onexit_t (*__IMP(_onexit))(_onexit_t); +extern _onexit_t (*_imp___onexit)(_onexit_t); _onexit_t _onexit (_onexit_t pfn ) { - return (*__IMP(_onexit))(pfn); + return (*_imp___onexit)(pfn); } - -#endif Added: trunk/cegcc/src/mingw/crt1_ce.c =================================================================== --- trunk/cegcc/src/mingw/crt1_ce.c (rev 0) +++ trunk/cegcc/src/mingw/crt1_ce.c 2006-11-27 21:05:00 UTC (rev 827) @@ -0,0 +1,71 @@ +/* + * crt1_ce.c + * This file has no copyright assigned and is placed in the Public Domain. + * This file is a part of the mingw-runtime package. + * No warranty is given; refer to the file DISCLAIMER within the package. + * + * Source code for the startup proceedures used by all programs on a + * wince system. This code is compiled to make crt1.o, which should be + * located in the library path. + * + */ + +/* Hide the declaration of _fmode with dllimport attribute in stdlib.h to + avoid problems with older GCC. */ +#define __IN_MINGW_RUNTIME +#include <stdlib.h> +#include <stdio.h> +#include <process.h> +#include <float.h> +#define WIN32_LEAN_AND_MEAN +#include <windows.h> + +extern void __gccmain (); +extern void _pei386_runtime_relocator (void); + +/* No atexit on coredll, we must initialize our private version. */ +BOOL __atexit_init(void); + +/* + * This function is called from the entry point for all programs. + */ +void +WinMainCRTStartup (HINSTANCE hInst, HINSTANCE hPrevInst, + LPWSTR lpCmdLine, int nCmdShow) +{ + int nRet; + + /* + * Initialize floating point unit. + */ + _fpreset (); /* Supplied by the runtime library. */ + + /* Adust references to dllimported data that have non-zero offsets. */ + _pei386_runtime_relocator (); + + /* + * Initialize the atexit table. + */ + __atexit_init(); + + /* From libgcc.a, __main calls global class constructors, + __do_global_ctors, which registers __do_global_dtors as the first + entry of the private atexit table we have just initialised */ + __gccmain(); + + /* + * Call the main function. If the user does not supply one the one + * in the 'libmingw32.a' library will be linked in, and that one + * calls main. See winmain_ce.c in the 'lib' dir for more details. + */ + + nRet = WinMain(hInst, hPrevInst, lpCmdLine, nCmdShow); + + /* + * Perform exit processing for the C library. This means + * flushing output and calling 'atexit' registered functions. + */ + _cexit (); + + ExitProcess (nRet); +} Property changes on: trunk/cegcc/src/mingw/crt1_ce.c ___________________________________________________________________ Name: svn:eol-style + native Modified: trunk/cegcc/src/mingw/init.c =================================================================== --- trunk/cegcc/src/mingw/init.c 2006-11-27 16:38:00 UTC (rev 826) +++ trunk/cegcc/src/mingw/init.c 2006-11-27 21:05:00 UTC (rev 827) @@ -35,10 +35,8 @@ int newmode; } _startupinfo; extern void __getmainargs (int *, char ***, char ***, int, _startupinfo *); -#elif defined (__CRTDLL__) +#else extern void __GetMainArgs (int *, char ***, char ***, int); -#elif defined (__COREDLL__) -static void __GetMainArgs (int *, char ***, char ***, int); #endif /* @@ -58,127 +56,12 @@ /* * Microsoft's runtime provides a function for doing just that. */ -#if defined (__MSVCRT__) +#ifdef __MSVCRT__ (void) __getmainargs (&_argc, &_argv, &dummy_environ, _CRT_glob, &start_info); #else - /* CRTDLL/COREDLL version */ + /* CRTDLL version */ (void) __GetMainArgs (&_argc, &_argv, &dummy_environ, _CRT_glob); #endif } -#ifdef __COREDLL__ - -static int -_parse_tokens(char* string, char*** tokens, int length) -{ - /* Extract whitespace- and quotes- delimited tokens from the given string - and put them into the tokens array. Returns number of tokens - extracted. Length specifies the current size of tokens[]. - THIS METHOD MODIFIES string. */ - - const char* whitespace = " \t\r\n"; - char* tokenEnd; - const char* quoteCharacters = "\"\'"; - char* end = string + strlen (string); - - if (string == NULL) - return length; - - while (1) - { - const char* q; - /* Skip over initial whitespace. */ - string += strspn(string, whitespace); - if (*string == '\0') - break; - - for (q = quoteCharacters; *q; ++q) - { - if (*string == *q) - break; - } - if (*q) - { - /* Token is quoted. */ - char quote = *string++; - tokenEnd = strchr(string, quote); - /* If there is no endquote, the token is the rest of the string. */ - if (!tokenEnd) - tokenEnd = end; - } - else - { - tokenEnd = string + strcspn(string, whitespace); - } - - *tokenEnd = '\0'; - - { - char** new_tokens; - int newlen = length + 1; - new_tokens = realloc (*tokens, sizeof (char**) * newlen); - if (!new_tokens) - { - /* Out of memory. */ - return -1; - } - - *tokens = new_tokens; - (*tokens)[length] = string; - length = newlen; - } - if (tokenEnd == end) - break; - string = tokenEnd + 1; - } -exit: - return length; -} - -static void -__GetMainArgs (int *argc, char ***argv, char *** env, int glob) -{ - wchar_t cmdnameBufW[512]; - char buf[MAX_PATH]; - int cmdlineLen = 0; - wchar_t* cmdlinePtrW; - int modlen; - char* __cmdlinebuf; - - /* argv[0] is the path of invoked program - get this from CE. */ - cmdnameBufW[0] = 0; - modlen = GetModuleFileNameW(NULL, cmdnameBufW, sizeof (cmdnameBufW)/sizeof (cmdnameBufW[0])); - cmdlinePtrW = GetCommandLineW(); - - if (!cmdlinePtrW) - cmdlineLen = 0; - else - cmdlineLen = wcslen(cmdlinePtrW); - - __cmdlinebuf = malloc (modlen + 1 + cmdlineLen + 1); - if (!__cmdlinebuf) - ExitProcess(-1); - - *argv = malloc (sizeof (char**) * 1); - if (!*argv) - ExitProcess(-1); - - (*argv)[0] = __cmdlinebuf; - wcstombs((*argv)[0], cmdnameBufW, wcslen(cmdnameBufW) + 1); - /* Add one to account for argv[0] */ - (*argc)++; - - if (cmdlineLen > 0) - { - char* argv1 = (*argv)[0] + strlen((*argv)[0]) + 1; - wcstombs(argv1, cmdlinePtrW, cmdlineLen + 1); - *argc = _parse_tokens(argv1, argv, 1); - if (*argc < 0) - ExitProcess(-1); - } - (*argv)[*argc] = 0; - return; -} - -#endif Modified: trunk/cegcc/src/mingw/main.c =================================================================== --- trunk/cegcc/src/mingw/main.c 2006-11-27 16:38:00 UTC (rev 826) +++ trunk/cegcc/src/mingw/main.c 2006-11-27 21:05:00 UTC (rev 827) @@ -16,30 +16,19 @@ #define ISSPACE(a) (a == ' ' || a == '\t') -#ifndef UNDER_CE extern int PASCAL WinMain (HINSTANCE hInst, HINSTANCE hPrevInst, LPSTR szCmdLine, int nShow); -#else -extern int __cdecl WinMain (HINSTANCE hInst, HINSTANCE hPrevInst, - LPWSTR szCmdLine, int nShow); -#endif - int main (int argc, char *argv[], char *environ[]) { + char *szCmd; + STARTUPINFO startinfo; int nRet; /* Get the command line passed to the process. */ -#ifndef UNDER_CE - char *szCmd; - STARTUPINFOA startinfo; szCmd = GetCommandLineA (); GetStartupInfoA (&startinfo); -#else - wchar_t *szCmd; - szCmd = GetCommandLineW (); -#endif /* Strip off the name of the application and any leading * whitespace. */ @@ -81,13 +70,9 @@ } } -#ifndef UNDER_CE nRet = WinMain (GetModuleHandle (NULL), NULL, szCmd, (startinfo.dwFlags & STARTF_USESHOWWINDOW) ? startinfo.wShowWindow : SW_SHOWDEFAULT); -#else - nRet = WinMain (GetModuleHandle (NULL), NULL, szCmd, SW_SHOW); -#endif return nRet; } Added: trunk/cegcc/src/mingw/winmain_ce.c =================================================================== --- trunk/cegcc/src/mingw/winmain_ce.c (rev 0) +++ trunk/cegcc/src/mingw/winmain_ce.c 2006-11-27 21:05:00 UTC (rev 827) @@ -0,0 +1,147 @@ +/* + * winmain_ce.c + * This file has no copyright assigned and is placed in the Public Domain. + * This file is a part of the mingw-runtime package. + * No warranty is given; refer to the file DISCLAIMER within the package. + * + * Extra startup code for applications which do not have a WinMain + * function of their own (but do have a main). Generally these are + * non-GUI applications, but they don't *have* to be. + * + */ + +#include <stdlib.h> +#include <process.h> +#include <windows.h> + +/* + * Access to a standard 'main'-like argument count and list. Also included + * is a table of environment variables. + */ +int _argc = 0; +char **_argv = 0; + +static int +_parse_tokens(char* string, char*** tokens, int length) +{ + /* Extract whitespace- and quotes- delimited tokens from the given string + and put them into the tokens array. Returns number of tokens + extracted. Length specifies the current size of tokens[]. + THIS METHOD MODIFIES string. */ + + const char* whitespace = " \t\r\n"; + char* tokenEnd; + const char* quoteCharacters = "\"\'"; + char* end = string + strlen (string); + + if (string == NULL) + return length; + + while (1) + { + const char* q; + /* Skip over initial whitespace. */ + string += strspn(string, whitespace); + if (*string == '\0') + break; + + for (q = quoteCharacters; *q; ++q) + { + if (*string == *q) + break; + } + if (*q) + { + /* Token is quoted. */ + char quote = *string++; + tokenEnd = strchr(string, quote); + /* If there is no endquote, the token is the rest of the string. */ + if (!tokenEnd) + tokenEnd = end; + } + else + { + tokenEnd = string + strcspn(string, whitespace); + } + + *tokenEnd = '\0'; + + { + char** new_tokens; + int newlen = length + 1; + new_tokens = realloc (*tokens, sizeof (char**) * newlen); + if (!new_tokens) + { + /* Out of memory. */ + return -1; + } + + *tokens = new_tokens; + (*tokens)[length] = string; + length = newlen; + } + if (tokenEnd == end) + break; + string = tokenEnd + 1; + } +exit: + return length; +} + +static void +__mainArgs(int *argc, char ***argv, wchar_t *cmdlinePtrW) +{ + wchar_t cmdnameBufW[512]; + char buf[MAX_PATH]; + int cmdlineLen = 0; + int modlen; + char* __cmdlinebuf; + + /* argv[0] is the path of invoked program - get this from CE. */ + cmdnameBufW[0] = 0; + modlen = GetModuleFileNameW(NULL, cmdnameBufW, sizeof (cmdnameBufW)/sizeof (cmdnameBufW[0])); + + if (!cmdlinePtrW) + cmdlineLen = 0; + else + cmdlineLen = wcslen(cmdlinePtrW); + + __cmdlinebuf = malloc (modlen + 1 + cmdlineLen + 1); + if (!__cmdlinebuf) + ExitProcess(-1); + + *argv = malloc (sizeof (char**) * 1); + if (!*argv) + ExitProcess(-1); + + (*argv)[0] = __cmdlinebuf; + wcstombs((*argv)[0], cmdnameBufW, wcslen(cmdnameBufW) + 1); + /* Add one to account for argv[0] */ + (*argc)++; + + if (cmdlineLen > 0) + { + char* argv1 = (*argv)[0] + strlen((*argv)[0]) + 1; + wcstombs(argv1, cmdlinePtrW, cmdlineLen + 1); + *argc = _parse_tokens(argv1, argv, 1); + if (*argc < 0) + ExitProcess(-1); + } + (*argv)[*argc] = 0; + return; +} + +// Normally, the application will define a WinMain function. However, +// if the main application does not, this dummy WinMain will call a +// main() function instead. +extern int __cdecl +WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, + LPWSTR szCmdLine, int nShow) +{ + /* + * Set up __argc, __argv. + */ + __mainArgs(&_argc, &_argv, szCmdLine); + + return main(_argc, _argv); +} Property changes on: trunk/cegcc/src/mingw/winmain_ce.c ___________________________________________________________________ Name: svn:eol-style + native This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ped...@us...> - 2006-12-19 00:07:52
|
Revision: 846 http://svn.sourceforge.net/cegcc/?rev=846&view=rev Author: pedroalves Date: 2006-12-18 16:07:47 -0800 (Mon, 18 Dec 2006) Log Message: ----------- * dllmain.c: Call DisableThreadLibraryCalls on DLL_PROCESS_ATTACH. Modified Paths: -------------- trunk/cegcc/src/mingw/ChangeLog.mingw32ce trunk/cegcc/src/mingw/dllmain.c Modified: trunk/cegcc/src/mingw/ChangeLog.mingw32ce =================================================================== --- trunk/cegcc/src/mingw/ChangeLog.mingw32ce 2006-12-19 00:03:51 UTC (rev 845) +++ trunk/cegcc/src/mingw/ChangeLog.mingw32ce 2006-12-19 00:07:47 UTC (rev 846) @@ -1,3 +1,7 @@ +2006-12-19 Pedro Alves <ped...@po...> + + * dllmain.c: Call DisableThreadLibraryCalls on DLL_PROCESS_ATTACH. + 2006-11-27 Pedro Alves <ped...@po...> * Makefile.in: Adjust so mingw32ce uses crt3.o and dllcrt3.o. Modified: trunk/cegcc/src/mingw/dllmain.c =================================================================== --- trunk/cegcc/src/mingw/dllmain.c 2006-12-19 00:03:51 UTC (rev 845) +++ trunk/cegcc/src/mingw/dllmain.c 2006-12-19 00:07:47 UTC (rev 846) @@ -14,6 +14,14 @@ BOOL WINAPI DllMain (HANDLE hDll, DWORD dwReason, LPVOID lpReserved) { + if (dwReason == DLL_PROCESS_ATTACH) + { + /* Since the user didn't supply a DllMain, we might as well + suppress calls to it on thread creation and destruction + (DLL_THREAD_ATTACH and DLL_THREAD_DETACH notifications). + Besides the speed optimization, this avoids paging + in DllMain, thus reducing it's working code set. */ + DisableThreadLibraryCalls (hDll); + } return TRUE; } - This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ped...@us...> - 2007-02-03 22:44:35
|
Revision: 873 http://svn.sourceforge.net/cegcc/?rev=873&view=rev Author: pedroalves Date: 2007-02-03 14:42:55 -0800 (Sat, 03 Feb 2007) Log Message: ----------- * dllmain.c: Fix typo. Modified Paths: -------------- trunk/cegcc/src/mingw/ChangeLog.mingw32ce trunk/cegcc/src/mingw/dllmain.c Modified: trunk/cegcc/src/mingw/ChangeLog.mingw32ce =================================================================== --- trunk/cegcc/src/mingw/ChangeLog.mingw32ce 2007-02-01 20:46:29 UTC (rev 872) +++ trunk/cegcc/src/mingw/ChangeLog.mingw32ce 2007-02-03 22:42:55 UTC (rev 873) @@ -1,3 +1,7 @@ +2007-02-03 Pedro Alves <ped...@po...> + + * dllmain.c: Fix typo. + 2006-12-30 Danny Backx <dan...@us...> * profile : Create a profile/profile tree as a copy of the Modified: trunk/cegcc/src/mingw/dllmain.c =================================================================== --- trunk/cegcc/src/mingw/dllmain.c 2007-02-01 20:46:29 UTC (rev 872) +++ trunk/cegcc/src/mingw/dllmain.c 2007-02-03 22:42:55 UTC (rev 873) @@ -20,7 +20,7 @@ suppress calls to it on thread creation and destruction (DLL_THREAD_ATTACH and DLL_THREAD_DETACH notifications). Besides the speed optimization, this avoids paging - in DllMain, thus reducing it's working code set. */ + in DllMain, thus reducing its working code set. */ DisableThreadLibraryCalls (hDll); } return TRUE; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ped...@us...> - 2007-02-03 23:44:50
|
Revision: 874 http://svn.sourceforge.net/cegcc/?rev=874&view=rev Author: pedroalves Date: 2007-02-03 15:44:45 -0800 (Sat, 03 Feb 2007) Log Message: ----------- * dllmain.c: Fix typo. * mingwex/Makefile.in (WINCE_DISTFILES): Add isalnum.c, * isalpha.c, iscntrl.c, isgraph.c, islower.c, isprint.c, ispunct.c, * isspace.c, isupper.c, isxdigit.c, _tolower.c and _toupper.c. (WINCE_OBJS): Add isalnum.o, isalpha.o, iscntrl.o, isgraph.o, islower.o, isprint.o, ispunct.o, isspace.o, isupper.o, * isxdigit.o, _tolower.o and _toupper.o. (dist): Fix typo. * include/stdlib.h (itoa, ltoa, ecvt, fcvt, gcvt): Expose on __COREDLL__. * mingwex/wince/isalnum.c: New file. * mingwex/wince/isalpha.c: New file. * mingwex/wince/iscntrl.c: New file. * mingwex/wince/isgraph.c: New file. * mingwex/wince/islower.c: New file. * mingwex/wince/isprint.c: New file. * mingwex/wince/ispunct.c: New file. * mingwex/wince/isspace.c: New file. * mingwex/wince/isupper.c: New file. * mingwex/wince/isxdigit.c: New file. * mingwex/wince/_tolower.c: New file. * mingwex/wince/_toupper.c: New file. Modified Paths: -------------- trunk/cegcc/src/mingw/ChangeLog.mingw32ce trunk/cegcc/src/mingw/include/stdlib.h trunk/cegcc/src/mingw/mingwex/Makefile.in Added Paths: ----------- trunk/cegcc/src/mingw/mingwex/wince/_tolower.c trunk/cegcc/src/mingw/mingwex/wince/_toupper.c trunk/cegcc/src/mingw/mingwex/wince/isalnum.c trunk/cegcc/src/mingw/mingwex/wince/isalpha.c trunk/cegcc/src/mingw/mingwex/wince/iscntrl.c trunk/cegcc/src/mingw/mingwex/wince/isgraph.c trunk/cegcc/src/mingw/mingwex/wince/islower.c trunk/cegcc/src/mingw/mingwex/wince/isprint.c trunk/cegcc/src/mingw/mingwex/wince/ispunct.c trunk/cegcc/src/mingw/mingwex/wince/isspace.c trunk/cegcc/src/mingw/mingwex/wince/isupper.c trunk/cegcc/src/mingw/mingwex/wince/isxdigit.c Modified: trunk/cegcc/src/mingw/ChangeLog.mingw32ce =================================================================== --- trunk/cegcc/src/mingw/ChangeLog.mingw32ce 2007-02-03 22:42:55 UTC (rev 873) +++ trunk/cegcc/src/mingw/ChangeLog.mingw32ce 2007-02-03 23:44:45 UTC (rev 874) @@ -1,7 +1,28 @@ 2007-02-03 Pedro Alves <ped...@po...> * dllmain.c: Fix typo. - + * mingwex/Makefile.in (WINCE_DISTFILES): Add isalnum.c, isalpha.c, + iscntrl.c, isgraph.c, islower.c, isprint.c, ispunct.c, isspace.c, + isupper.c, isxdigit.c, _tolower.c and _toupper.c. + (WINCE_OBJS): Add isalnum.o, isalpha.o, iscntrl.o, isgraph.o, + islower.o, isprint.o, ispunct.o, isspace.o, isupper.o, isxdigit.o, + _tolower.o and _toupper.o. + (dist): Fix typo. + * include/stdlib.h (itoa, ltoa, ecvt, fcvt, gcvt): Expose on + __COREDLL__. + * mingwex/wince/isalnum.c: New file. + * mingwex/wince/isalpha.c: New file. + * mingwex/wince/iscntrl.c: New file. + * mingwex/wince/isgraph.c: New file. + * mingwex/wince/islower.c: New file. + * mingwex/wince/isprint.c: New file. + * mingwex/wince/ispunct.c: New file. + * mingwex/wince/isspace.c: New file. + * mingwex/wince/isupper.c: New file. + * mingwex/wince/isxdigit.c: New file. + * mingwex/wince/_tolower.c: New file. + * mingwex/wince/_toupper.c: New file. + 2006-12-30 Danny Backx <dan...@us...> * profile : Create a profile/profile tree as a copy of the Modified: trunk/cegcc/src/mingw/include/stdlib.h =================================================================== --- trunk/cegcc/src/mingw/include/stdlib.h 2007-02-03 22:42:55 UTC (rev 873) +++ trunk/cegcc/src/mingw/include/stdlib.h 2007-02-03 23:44:45 UTC (rev 874) @@ -473,9 +473,9 @@ #ifndef _NO_OLDNAMES #ifndef __COREDLL__ - _CRTIMP int __cdecl putenv (const char*); _CRTIMP void __cdecl searchenv (const char*, const char*, char*); +#endif /* Not __COREDLL__ */ _CRTIMP char* __cdecl itoa (int, char*, int); _CRTIMP char* __cdecl ltoa (long, char*, int); @@ -485,7 +485,6 @@ _CRTIMP char* __cdecl fcvt (double, int, int*, int*); _CRTIMP char* __cdecl gcvt (double, int, char*); #endif /* _UWIN */ -#endif /* Not __COREDLL__ */ #endif /* Not _NO_OLDNAMES */ #endif /* Not __STRICT_ANSI__ */ Modified: trunk/cegcc/src/mingw/mingwex/Makefile.in =================================================================== --- trunk/cegcc/src/mingw/mingwex/Makefile.in 2007-02-03 22:42:55 UTC (rev 873) +++ trunk/cegcc/src/mingw/mingwex/Makefile.in 2007-02-03 23:44:45 UTC (rev 874) @@ -85,7 +85,9 @@ WINCE_DISTFILES = \ asctime.c freopen.c gmtime.c localtime.c mktime.c strftime.c time.c \ - tempnam.c unlink.c wcsftime.c fdopen.c read.c write.c open.c lseek.c close.c + tempnam.c unlink.c wcsftime.c fdopen.c read.c write.c open.c lseek.c \ + close.c isalnum.c isalpha.c iscntrl.c isgraph.c islower.c isprint.c \ + ispunct.c isspace.c isupper.c isxdigit.c _tolower.c _toupper.c CC = @CC@ # FIXME: Which is it, CC or CC_FOR_TARGET? @@ -186,8 +188,10 @@ WINCE_OBJS = \ asctime.o freopen.o gmtime.o localtime.o mktime.o strftime.o time.o \ tempnam.o unlink.o wcsftime.o fdopen.o read.o write.o open.o lseek.o \ - close.o + close.o isalnum.o isalpha.o iscntrl.o isgraph.o islower.o isprint.o \ + ispunct.o isspace.o isupper.o isxdigit.o _tolower.o _toupper.o + ifneq (,$(findstring wince,$(target_alias))) LIB_OBJS = $(WINCE_OBJS) else @@ -276,6 +280,6 @@ mkdir $(distdir)/mingwex/wince chmod 755 $(distdir)/mingwex/wince @for i in $(WINCE_DISTFILES); do\ - cp -p $(srcdir)/complex/$$i $(distdir)/mingwex/wince/$$i ; \ + cp -p $(srcdir)/wince/$$i $(distdir)/mingwex/wince/$$i ; \ done Added: trunk/cegcc/src/mingw/mingwex/wince/_tolower.c =================================================================== --- trunk/cegcc/src/mingw/mingwex/wince/_tolower.c (rev 0) +++ trunk/cegcc/src/mingw/mingwex/wince/_tolower.c 2007-02-03 23:44:45 UTC (rev 874) @@ -0,0 +1,7 @@ +#include <ctype.h> + +int +_tolower(int c) +{ + return (c -'A'+'a'); +} Property changes on: trunk/cegcc/src/mingw/mingwex/wince/_tolower.c ___________________________________________________________________ Name: svn:eol-style + native Added: trunk/cegcc/src/mingw/mingwex/wince/_toupper.c =================================================================== --- trunk/cegcc/src/mingw/mingwex/wince/_toupper.c (rev 0) +++ trunk/cegcc/src/mingw/mingwex/wince/_toupper.c 2007-02-03 23:44:45 UTC (rev 874) @@ -0,0 +1,7 @@ +#include <ctype.h> + +int +_toupper(int c) +{ + return (c -'a'+'A'); +} Property changes on: trunk/cegcc/src/mingw/mingwex/wince/_toupper.c ___________________________________________________________________ Name: svn:eol-style + native Added: trunk/cegcc/src/mingw/mingwex/wince/isalnum.c =================================================================== --- trunk/cegcc/src/mingw/mingwex/wince/isalnum.c (rev 0) +++ trunk/cegcc/src/mingw/mingwex/wince/isalnum.c 2007-02-03 23:44:45 UTC (rev 874) @@ -0,0 +1,7 @@ +#include <ctype.h> + +int +isalnum(int c) +{ + return __ISCTYPE (c, (_ALPHA|_DIGIT)); +} Property changes on: trunk/cegcc/src/mingw/mingwex/wince/isalnum.c ___________________________________________________________________ Name: svn:eol-style + native Added: trunk/cegcc/src/mingw/mingwex/wince/isalpha.c =================================================================== --- trunk/cegcc/src/mingw/mingwex/wince/isalpha.c (rev 0) +++ trunk/cegcc/src/mingw/mingwex/wince/isalpha.c 2007-02-03 23:44:45 UTC (rev 874) @@ -0,0 +1,7 @@ +#include <ctype.h> + +int +isalpha(int c) +{ + return __ISCTYPE (c, _ALPHA); +} Property changes on: trunk/cegcc/src/mingw/mingwex/wince/isalpha.c ___________________________________________________________________ Name: svn:eol-style + native Added: trunk/cegcc/src/mingw/mingwex/wince/iscntrl.c =================================================================== --- trunk/cegcc/src/mingw/mingwex/wince/iscntrl.c (rev 0) +++ trunk/cegcc/src/mingw/mingwex/wince/iscntrl.c 2007-02-03 23:44:45 UTC (rev 874) @@ -0,0 +1,7 @@ +#include <ctype.h> + + int +iscntrl(int c) +{ + return __ISCTYPE (c, _CONTROL); +} Property changes on: trunk/cegcc/src/mingw/mingwex/wince/iscntrl.c ___________________________________________________________________ Name: svn:eol-style + native Added: trunk/cegcc/src/mingw/mingwex/wince/isgraph.c =================================================================== --- trunk/cegcc/src/mingw/mingwex/wince/isgraph.c (rev 0) +++ trunk/cegcc/src/mingw/mingwex/wince/isgraph.c 2007-02-03 23:44:45 UTC (rev 874) @@ -0,0 +1,7 @@ +#include <ctype.h> + +int +isgraph(int c) +{ + return __ISCTYPE (c, (_PUNCT|_ALPHA|_DIGIT)); +} Property changes on: trunk/cegcc/src/mingw/mingwex/wince/isgraph.c ___________________________________________________________________ Name: svn:eol-style + native Added: trunk/cegcc/src/mingw/mingwex/wince/islower.c =================================================================== --- trunk/cegcc/src/mingw/mingwex/wince/islower.c (rev 0) +++ trunk/cegcc/src/mingw/mingwex/wince/islower.c 2007-02-03 23:44:45 UTC (rev 874) @@ -0,0 +1,7 @@ +#include <ctype.h> + +int +islower(int c) +{ + return __ISCTYPE (c, _LOWER); +} Property changes on: trunk/cegcc/src/mingw/mingwex/wince/islower.c ___________________________________________________________________ Name: svn:eol-style + native Added: trunk/cegcc/src/mingw/mingwex/wince/isprint.c =================================================================== --- trunk/cegcc/src/mingw/mingwex/wince/isprint.c (rev 0) +++ trunk/cegcc/src/mingw/mingwex/wince/isprint.c 2007-02-03 23:44:45 UTC (rev 874) @@ -0,0 +1,7 @@ +#include <ctype.h> + +int +isprint(int c) +{ + return __ISCTYPE (c, (_BLANK|_PUNCT|_ALPHA|_DIGIT)); +} Property changes on: trunk/cegcc/src/mingw/mingwex/wince/isprint.c ___________________________________________________________________ Name: svn:eol-style + native Added: trunk/cegcc/src/mingw/mingwex/wince/ispunct.c =================================================================== --- trunk/cegcc/src/mingw/mingwex/wince/ispunct.c (rev 0) +++ trunk/cegcc/src/mingw/mingwex/wince/ispunct.c 2007-02-03 23:44:45 UTC (rev 874) @@ -0,0 +1,7 @@ +#include <ctype.h> + +int +ispunct(int c) +{ + return __ISCTYPE (c, _PUNCT); +} Property changes on: trunk/cegcc/src/mingw/mingwex/wince/ispunct.c ___________________________________________________________________ Name: svn:eol-style + native Added: trunk/cegcc/src/mingw/mingwex/wince/isspace.c =================================================================== --- trunk/cegcc/src/mingw/mingwex/wince/isspace.c (rev 0) +++ trunk/cegcc/src/mingw/mingwex/wince/isspace.c 2007-02-03 23:44:45 UTC (rev 874) @@ -0,0 +1,7 @@ +#include <ctype.h> + +int +isspace(int c) +{ + return __ISCTYPE (c, _SPACE); +} Property changes on: trunk/cegcc/src/mingw/mingwex/wince/isspace.c ___________________________________________________________________ Name: svn:eol-style + native Added: trunk/cegcc/src/mingw/mingwex/wince/isupper.c =================================================================== --- trunk/cegcc/src/mingw/mingwex/wince/isupper.c (rev 0) +++ trunk/cegcc/src/mingw/mingwex/wince/isupper.c 2007-02-03 23:44:45 UTC (rev 874) @@ -0,0 +1,7 @@ +#include <ctype.h> + +int +isupper(int c) +{ + return __ISCTYPE (c, _UPPER); +} Property changes on: trunk/cegcc/src/mingw/mingwex/wince/isupper.c ___________________________________________________________________ Name: svn:eol-style + native Added: trunk/cegcc/src/mingw/mingwex/wince/isxdigit.c =================================================================== --- trunk/cegcc/src/mingw/mingwex/wince/isxdigit.c (rev 0) +++ trunk/cegcc/src/mingw/mingwex/wince/isxdigit.c 2007-02-03 23:44:45 UTC (rev 874) @@ -0,0 +1,7 @@ +#include <ctype.h> + +int +isxdigit(int c) +{ + return __ISCTYPE (c, _HEX); +} Property changes on: trunk/cegcc/src/mingw/mingwex/wince/isxdigit.c ___________________________________________________________________ Name: svn:eol-style + native This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ped...@us...> - 2007-02-04 00:35:45
|
Revision: 876 http://svn.sourceforge.net/cegcc/?rev=876&view=rev Author: pedroalves Date: 2007-02-03 16:35:41 -0800 (Sat, 03 Feb 2007) Log Message: ----------- * include/_mingw.h (__CRT_INLINE): Expand the comment. Modified Paths: -------------- trunk/cegcc/src/mingw/ChangeLog.mingw32ce trunk/cegcc/src/mingw/include/_mingw.h Modified: trunk/cegcc/src/mingw/ChangeLog.mingw32ce =================================================================== --- trunk/cegcc/src/mingw/ChangeLog.mingw32ce 2007-02-04 00:29:15 UTC (rev 875) +++ trunk/cegcc/src/mingw/ChangeLog.mingw32ce 2007-02-04 00:35:41 UTC (rev 876) @@ -1,5 +1,9 @@ 2007-02-04 Pedro Alves <ped...@po...> + * include/_mingw.h (__CRT_INLINE): Expand the comment. + +2007-02-04 Pedro Alves <ped...@po...> + * mingwex/Makefile.in (MATHCE_DISTFILES): New variable. (MATHCE_OBJS): New variable. (MATHCE_FLAGS): New variable. Modified: trunk/cegcc/src/mingw/include/_mingw.h =================================================================== --- trunk/cegcc/src/mingw/include/_mingw.h 2007-02-04 00:29:15 UTC (rev 875) +++ trunk/cegcc/src/mingw/include/_mingw.h 2007-02-04 00:35:41 UTC (rev 876) @@ -110,7 +110,12 @@ #ifdef __COREDLL__ /* There isn't any out-of-line version of most of these functions in coredll.dll, so we need this for -O0, - or for -fno-inline. */ + or for -fno-inline. This is still problematic if the user + tries to take the address of these functions. We will slowly + add out-of-line copies as those cases are found. + Note: We can't use static inline here, as most of there functions + will be declared elsewhere with external linkage, and gcc will + barf on that. */ #define __CRT_INLINE extern __inline__ __attribute__((__always_inline__)) #else #define __CRT_INLINE extern __inline__ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ped...@us...> - 2007-02-04 03:03:55
|
Revision: 878 http://svn.sourceforge.net/cegcc/?rev=878&view=rev Author: pedroalves Date: 2007-02-03 19:03:53 -0800 (Sat, 03 Feb 2007) Log Message: ----------- * include/complex.h (carg, cargf, cargl): Wrap in #ifdef __i386__. Modified Paths: -------------- trunk/cegcc/src/mingw/ChangeLog.mingw32ce trunk/cegcc/src/mingw/include/complex.h Modified: trunk/cegcc/src/mingw/ChangeLog.mingw32ce =================================================================== --- trunk/cegcc/src/mingw/ChangeLog.mingw32ce 2007-02-04 00:41:48 UTC (rev 877) +++ trunk/cegcc/src/mingw/ChangeLog.mingw32ce 2007-02-04 03:03:53 UTC (rev 878) @@ -1,5 +1,9 @@ 2007-02-04 Pedro Alves <ped...@po...> + * include/complex.h (carg, cargf, cargl): Wrap in #ifdef __i386__. + +2007-02-04 Pedro Alves <ped...@po...> + * include/_mingw.h (__CRT_INLINE): Expand the comment. 2007-02-04 Pedro Alves <ped...@po...> Modified: trunk/cegcc/src/mingw/include/complex.h =================================================================== --- trunk/cegcc/src/mingw/include/complex.h 2007-02-04 00:41:48 UTC (rev 877) +++ trunk/cegcc/src/mingw/include/complex.h 2007-02-04 03:03:53 UTC (rev 878) @@ -133,6 +133,7 @@ return __extension__ ~_Z; } +#ifdef __i386__ __CRT_INLINE double __MINGW_ATTRIB_CONST carg (double _Complex _Z) { double res; @@ -140,8 +141,8 @@ : "=t" (res) : "0" (__real__ _Z), "u" (__imag__ _Z) : "st(1)"); return res; } +#endif - /* float */ __CRT_INLINE float __MINGW_ATTRIB_CONST crealf (float _Complex _Z) { @@ -158,6 +159,7 @@ return __extension__ ~_Z; } +#ifdef __i386__ __CRT_INLINE float __MINGW_ATTRIB_CONST cargf (float _Complex _Z) { float res; @@ -165,6 +167,7 @@ : "=t" (res) : "0" (__real__ _Z), "u" (__imag__ _Z) : "st(1)"); return res; } +#endif /* long double */ __CRT_INLINE long double __MINGW_ATTRIB_CONST creall (long double _Complex _Z) @@ -182,6 +185,7 @@ return __extension__ ~_Z; } +#ifdef __i386__ __CRT_INLINE long double __MINGW_ATTRIB_CONST cargl (long double _Complex _Z) { long double res; @@ -189,6 +193,7 @@ : "=t" (res) : "0" (__real__ _Z), "u" (__imag__ _Z) : "st(1)"); return res; } +#endif #endif /* __GNUC__ */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ped...@us...> - 2007-02-04 17:41:01
|
Revision: 880 http://svn.sourceforge.net/cegcc/?rev=880&view=rev Author: pedroalves Date: 2007-02-04 09:41:00 -0800 (Sun, 04 Feb 2007) Log Message: ----------- * include/ctype.h (MB_CUR_MAX): Hardcode as 2. * include/stdlib.h (MB_CUR_MAX): Likewise. * mingwex/Makefile.in (LIB_OBJS): Add $(Q8_OBJS). * mingwex/mb_wc_common.h: Don't include locale.h on * __COREDLL__. (get_cp_from_locale): Always return 0 on __COREDLL__. * mingwex/mbrtowc.c: Don't include errno.h on __COREDLL__. Don't set errno on __COREDLL__ throughout. * mingwex/strtoimax.c: Likewise. * mingwex/strtoumax.c: Likewise. * mingwex/wcrtomb.c: Likewise. * mingwex/wcstoimax.c: Likewise. * mingwex/wcstoumax.c: Likewise. * mingwex/wctob.c: Don't include errno.h * mingwex/wmemmove.c: Likewise. Modified Paths: -------------- trunk/cegcc/src/mingw/ChangeLog.mingw32ce trunk/cegcc/src/mingw/include/ctype.h trunk/cegcc/src/mingw/include/stdlib.h trunk/cegcc/src/mingw/mingwex/Makefile.in trunk/cegcc/src/mingw/mingwex/mb_wc_common.h trunk/cegcc/src/mingw/mingwex/mbrtowc.c trunk/cegcc/src/mingw/mingwex/strtoimax.c trunk/cegcc/src/mingw/mingwex/strtoumax.c trunk/cegcc/src/mingw/mingwex/wcrtomb.c trunk/cegcc/src/mingw/mingwex/wcstoimax.c trunk/cegcc/src/mingw/mingwex/wcstoumax.c trunk/cegcc/src/mingw/mingwex/wctob.c trunk/cegcc/src/mingw/mingwex/wmemmove.c Modified: trunk/cegcc/src/mingw/ChangeLog.mingw32ce =================================================================== --- trunk/cegcc/src/mingw/ChangeLog.mingw32ce 2007-02-04 14:28:12 UTC (rev 879) +++ trunk/cegcc/src/mingw/ChangeLog.mingw32ce 2007-02-04 17:41:00 UTC (rev 880) @@ -1,5 +1,22 @@ 2007-02-04 Pedro Alves <ped...@po...> + * include/ctype.h (MB_CUR_MAX): Hardcode as 2. + * include/stdlib.h (MB_CUR_MAX): Likewise. + * mingwex/Makefile.in (LIB_OBJS): Add $(Q8_OBJS). + * mingwex/mb_wc_common.h: Don't include locale.h on __COREDLL__. + (get_cp_from_locale): Always return 0 on __COREDLL__. + * mingwex/mbrtowc.c: Don't include errno.h on __COREDLL__. + Don't set errno on __COREDLL__ throughout. + * mingwex/strtoimax.c: Likewise. + * mingwex/strtoumax.c: Likewise. + * mingwex/wcrtomb.c: Likewise. + * mingwex/wcstoimax.c: Likewise. + * mingwex/wcstoumax.c: Likewise. + * mingwex/wctob.c: Don't include errno.h + * mingwex/wmemmove.c: Likewise. + +2007-02-04 Pedro Alves <ped...@po...> + * include/complex.h (carg, cargf, cargl): Wrap in #ifdef __i386__. 2007-02-04 Pedro Alves <ped...@po...> Modified: trunk/cegcc/src/mingw/include/ctype.h =================================================================== --- trunk/cegcc/src/mingw/include/ctype.h 2007-02-04 14:28:12 UTC (rev 879) +++ trunk/cegcc/src/mingw/include/ctype.h 2007-02-04 17:41:00 UTC (rev 880) @@ -99,6 +99,11 @@ # elif defined (__CRTDLL__) # define MB_CUR_MAX __mb_cur_max_dll __MINGW_IMPORT int __mb_cur_max_dll; +# elif defined (__COREDLL__) + /* No locale support, so we set it to maximum. */ + /* From limits.h. */ + /* #define MB_CUR_MAX MB_LEN_MAX 2 */ +# define MB_CUR_MAX 2 # endif /* __CRTDLL__ */ #else /* ! __DECLSPEC_SUPPORTED */ Modified: trunk/cegcc/src/mingw/include/stdlib.h =================================================================== --- trunk/cegcc/src/mingw/include/stdlib.h 2007-02-04 14:28:12 UTC (rev 879) +++ trunk/cegcc/src/mingw/include/stdlib.h 2007-02-04 17:41:00 UTC (rev 880) @@ -114,6 +114,11 @@ # elif defined (__CRTDLL__) # define MB_CUR_MAX __mb_cur_max_dll __MINGW_IMPORT int __mb_cur_max_dll; +# elif defined (__COREDLL__) + /* No locale support, so we set it to maximum. */ + /* From limits.h. */ + /* #define MB_CUR_MAX MB_LEN_MAX 2 */ +# define MB_CUR_MAX 2 # endif /* __CRTDLL__ */ #else /* ! __DECLSPEC_SUPPORTED */ Modified: trunk/cegcc/src/mingw/mingwex/Makefile.in =================================================================== --- trunk/cegcc/src/mingw/mingwex/Makefile.in 2007-02-04 14:28:12 UTC (rev 879) +++ trunk/cegcc/src/mingw/mingwex/Makefile.in 2007-02-04 17:41:00 UTC (rev 880) @@ -225,7 +225,7 @@ MATHCE_FLAGS= ifneq (,$(findstring wince,$(target_alias))) -LIB_OBJS = $(WINCE_OBJS) $(MATHCE_OBJS) +LIB_OBJS = $(WINCE_OBJS) $(MATHCE_OBJS) $(Q8_OBJS) MATHCE_FLAGS=-D_IEEE_LIBM MATHDIR=mathce else Modified: trunk/cegcc/src/mingw/mingwex/mb_wc_common.h =================================================================== --- trunk/cegcc/src/mingw/mingwex/mb_wc_common.h 2007-02-04 14:28:12 UTC (rev 879) +++ trunk/cegcc/src/mingw/mingwex/mb_wc_common.h 2007-02-04 17:41:00 UTC (rev 880) @@ -1,4 +1,6 @@ +#ifndef __COREDLL__ #include <locale.h> +#endif #include <string.h> #include <stdlib.h> @@ -12,7 +14,9 @@ */ +#ifndef __COREDLL__ if ((cp_string = strchr(setlocale(LC_CTYPE, NULL), '.'))) return ((unsigned) atoi (cp_string + 1)); +#endif return 0; } Modified: trunk/cegcc/src/mingw/mingwex/mbrtowc.c =================================================================== --- trunk/cegcc/src/mingw/mingwex/mbrtowc.c 2007-02-04 14:28:12 UTC (rev 879) +++ trunk/cegcc/src/mingw/mingwex/mbrtowc.c 2007-02-04 17:41:00 UTC (rev 880) @@ -1,7 +1,9 @@ #include "mb_wc_common.h" #include <wchar.h> #include <stdlib.h> +#ifndef __COREDLL__ #include <errno.h> +#endif #define WIN32_LEAN_AND_MEAN #include <windows.h> @@ -46,7 +48,9 @@ == 0) { /* An invalid trailing byte */ +#ifndef __COREDLL__ errno = EILSEQ; +#endif return -1; } return 2; @@ -65,7 +69,9 @@ s, 2, pwc, 1) == 0) { +#ifndef __COREDLL__ errno = EILSEQ; +#endif return -1; } return 2; @@ -79,7 +85,9 @@ else if (MultiByteToWideChar (cp, MB_ERR_INVALID_CHARS, s, 1, pwc, 1) == 0) { +#ifndef __COREDLL__ errno = EILSEQ; +#endif return -1; } return 1; Modified: trunk/cegcc/src/mingw/mingwex/strtoimax.c =================================================================== --- trunk/cegcc/src/mingw/mingwex/strtoimax.c 2007-02-04 14:28:12 UTC (rev 879) +++ trunk/cegcc/src/mingw/mingwex/strtoimax.c 2007-02-04 17:41:00 UTC (rev 880) @@ -10,7 +10,9 @@ contiguous ascending order; this is true for ASCII but not EBCDIC. */ #include <stdlib.h> +#ifndef __COREDLL__ #include <errno.h> +#endif #include <ctype.h> #include <inttypes.h> @@ -41,7 +43,9 @@ if ( base < 0 || base == 1 || base > 36 ) { +#ifndef __COREDLL__ errno = EDOM; +#endif return 0; /* unspecified behavior */ } @@ -101,7 +105,9 @@ if ( toobig ) { +#ifndef __COREDLL__ errno = ERANGE; +#endif return minus ? INTMAX_MIN : INTMAX_MAX; } else Modified: trunk/cegcc/src/mingw/mingwex/strtoumax.c =================================================================== --- trunk/cegcc/src/mingw/mingwex/strtoumax.c 2007-02-04 14:28:12 UTC (rev 879) +++ trunk/cegcc/src/mingw/mingwex/strtoumax.c 2007-02-04 17:41:00 UTC (rev 880) @@ -10,7 +10,9 @@ contiguous ascending order; this is true for ASCII but not EBCDIC. */ #include <stdlib.h> +#ifndef __COREDLL__ #include <errno.h> +#endif #include <ctype.h> #include <inttypes.h> @@ -42,7 +44,9 @@ if ( base < 0 || base == 1 || base > 36 ) { +#ifndef __COREDLL__ errno = EDOM; +#endif return 0; /* unspecified behavior */ } @@ -99,7 +103,9 @@ if ( toobig ) { +#ifndef __COREDLL__ errno = ERANGE; +#endif return UINTMAX_MAX; } else Modified: trunk/cegcc/src/mingw/mingwex/wcrtomb.c =================================================================== --- trunk/cegcc/src/mingw/mingwex/wcrtomb.c 2007-02-04 14:28:12 UTC (rev 879) +++ trunk/cegcc/src/mingw/mingwex/wcrtomb.c 2007-02-04 17:41:00 UTC (rev 880) @@ -1,7 +1,9 @@ #include "mb_wc_common.h" #include <wchar.h> #include <stdlib.h> +#ifndef __COREDLL__ #include <errno.h> +#endif #include <limits.h> #define WIN32_LEAN_AND_MEAN #include <windows.h> @@ -15,7 +17,9 @@ { if (wc > 255) { +#ifndef __COREDLL__ errno = EILSEQ; +#endif return -1; } *dst = (char) wc; @@ -30,7 +34,9 @@ NULL, &invalid_char); if (size == 0 || invalid_char) { +#ifndef __COREDLL__ errno = EILSEQ; +#endif return -1; } return size; Modified: trunk/cegcc/src/mingw/mingwex/wcstoimax.c =================================================================== --- trunk/cegcc/src/mingw/mingwex/wcstoimax.c 2007-02-04 14:28:12 UTC (rev 879) +++ trunk/cegcc/src/mingw/mingwex/wcstoimax.c 2007-02-04 17:41:00 UTC (rev 880) @@ -12,7 +12,9 @@ */ #include <wchar.h> +#ifndef __COREDLL__ #include <errno.h> +#endif #include <ctype.h> #include <inttypes.h> @@ -43,7 +45,9 @@ if ( base < 0 || base == 1 || base > 36 ) { +#ifndef __COREDLL__ errno = EDOM; +#endif return 0; /* unspecified behavior */ } @@ -108,7 +112,9 @@ if ( toobig ) { +#ifndef __COREDLL__ errno = ERANGE; +#endif return minus ? INTMAX_MIN : INTMAX_MAX; } else Modified: trunk/cegcc/src/mingw/mingwex/wcstoumax.c =================================================================== --- trunk/cegcc/src/mingw/mingwex/wcstoumax.c 2007-02-04 14:28:12 UTC (rev 879) +++ trunk/cegcc/src/mingw/mingwex/wcstoumax.c 2007-02-04 17:41:00 UTC (rev 880) @@ -12,7 +12,9 @@ */ #include <wchar.h> +#ifndef __COREDLL__ #include <errno.h> +#endif #include <ctype.h> #include <inttypes.h> @@ -44,7 +46,9 @@ if ( base < 0 || base == 1 || base > 36 ) { +#ifndef __COREDLL__ errno = EDOM; +#endif return 0; /* unspecified behavior */ } @@ -102,7 +106,9 @@ if ( toobig ) { +#ifndef __COREDLL__ errno = ERANGE; +#endif return UINTMAX_MAX; } else Modified: trunk/cegcc/src/mingw/mingwex/wctob.c =================================================================== --- trunk/cegcc/src/mingw/mingwex/wctob.c 2007-02-04 14:28:12 UTC (rev 879) +++ trunk/cegcc/src/mingw/mingwex/wctob.c 2007-02-04 17:41:00 UTC (rev 880) @@ -2,7 +2,6 @@ #include <wchar.h> #include <stdio.h> #include <stdlib.h> -#include <errno.h> #define WIN32_LEAN_AND_MEAN #include <windows.h> Modified: trunk/cegcc/src/mingw/mingwex/wmemmove.c =================================================================== --- trunk/cegcc/src/mingw/mingwex/wmemmove.c 2007-02-04 14:28:12 UTC (rev 879) +++ trunk/cegcc/src/mingw/mingwex/wmemmove.c 2007-02-04 17:41:00 UTC (rev 880) @@ -10,7 +10,6 @@ */ -#include <errno.h> #include <stdio.h> #include <stdlib.h> #include <wchar.h> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ped...@us...> - 2007-02-04 20:08:28
|
Revision: 882 http://svn.sourceforge.net/cegcc/?rev=882&view=rev Author: pedroalves Date: 2007-02-04 12:08:25 -0800 (Sun, 04 Feb 2007) Log Message: ----------- * Makefile.in (LIBS): Add $(LIBM_A). Modified Paths: -------------- trunk/cegcc/src/mingw/ChangeLog.mingw32ce trunk/cegcc/src/mingw/Makefile.in Modified: trunk/cegcc/src/mingw/ChangeLog.mingw32ce =================================================================== --- trunk/cegcc/src/mingw/ChangeLog.mingw32ce 2007-02-04 18:05:16 UTC (rev 881) +++ trunk/cegcc/src/mingw/ChangeLog.mingw32ce 2007-02-04 20:08:25 UTC (rev 882) @@ -1,5 +1,9 @@ 2007-02-04 Pedro Alves <ped...@po...> + * Makefile.in (LIBS): Add $(LIBM_A). + +2007-02-04 Pedro Alves <ped...@po...> + * include/ctype.h (MB_CUR_MAX): Hardcode as 2. * include/stdlib.h (MB_CUR_MAX): Likewise. * mingwex/Makefile.in (LIB_OBJS): Add $(Q8_OBJS). Modified: trunk/cegcc/src/mingw/Makefile.in =================================================================== --- trunk/cegcc/src/mingw/Makefile.in 2007-02-04 18:05:16 UTC (rev 881) +++ trunk/cegcc/src/mingw/Makefile.in 2007-02-04 20:08:25 UTC (rev 882) @@ -182,6 +182,7 @@ ifneq (,$(findstring wince,$(target_alias))) LIBS = libmingw32.a \ libceoldname.a \ + $(LIBM_A) \ libmingwthrd.a else LIBS = libcrtdll.a \ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ped...@us...> - 2007-02-07 00:49:28
|
Revision: 890 http://svn.sourceforge.net/cegcc/?rev=890&view=rev Author: pedroalves Date: 2007-02-06 16:49:27 -0800 (Tue, 06 Feb 2007) Log Message: ----------- * mingwex/wcstold.c: Update from upstream. (_mbslen): New function. Modified Paths: -------------- trunk/cegcc/src/mingw/ChangeLog.mingw32ce trunk/cegcc/src/mingw/mingwex/wcstold.c Modified: trunk/cegcc/src/mingw/ChangeLog.mingw32ce =================================================================== --- trunk/cegcc/src/mingw/ChangeLog.mingw32ce 2007-02-07 00:43:21 UTC (rev 889) +++ trunk/cegcc/src/mingw/ChangeLog.mingw32ce 2007-02-07 00:49:27 UTC (rev 890) @@ -1,3 +1,8 @@ +2007-02-07 Pedro Alves <ped...@po...> + + * mingwex/wcstold.c: Update from upstream. + (_mbslen): New function. + 2007-02-05 Pedro Alves <ped...@po...> Update from upstream. Note: Upstream version is now 3.11. Modified: trunk/cegcc/src/mingw/mingwex/wcstold.c =================================================================== --- trunk/cegcc/src/mingw/mingwex/wcstold.c 2007-02-07 00:43:21 UTC (rev 889) +++ trunk/cegcc/src/mingw/mingwex/wcstold.c 2007-02-07 00:49:27 UTC (rev 890) @@ -1,6 +1,7 @@ /* Wide char wrapper for strtold * Revision history: * 6 Nov 2002 Initial version. + * 25 Aug 2006 Don't use strtold internal functions. * * Contributor: Danny Smith <dan...@us...> */ @@ -15,39 +16,42 @@ #include <wchar.h> #include <stdlib.h> #include <string.h> +#include <mbstring.h> -extern int __asctoe64(const char * __restrict__ ss, - short unsigned int * __restrict__ y); +#include "mb_wc_common.h" +#include <mbstring.h> -static __inline__ unsigned int get_codepage (void) +#ifdef __COREDLL__ +static size_t +_mbslen(const unsigned char *str) { -#ifndef __COREDLL__ - char* cp; + size_t len; - /* - locale :: "lang[_country[.code_page]]" - | ".code_page" - */ - if ((cp = strchr(setlocale(LC_CTYPE, NULL), '.'))) - return atoi( cp + 1); - else -#endif + if(!str) return 0; + + if(MB_CUR_MAX == 1) + return strlen((const char*)str); + + len = 0; + for(; *str; str++) + { + if (IsDBCSLeadByte(*str)) + str++; + len++; + } + return len; } +#endif long double wcstold (const wchar_t * __restrict__ wcs, wchar_t ** __restrict__ wcse) { char * cs; - int i; - int lenldstr; - union - { - unsigned short int us[6]; - long double ld; - } xx; - - unsigned int cp = get_codepage (); + char * cse; + unsigned int i; + long double ret; + const unsigned int cp = get_codepage (); /* Allocate enough room for (possibly) mb chars */ cs = (char *) malloc ((wcslen(wcs)+1) * MB_CUR_MAX); @@ -72,9 +76,17 @@ } cs[mb_len] = '\0'; } - lenldstr = __asctoe64( cs, xx.us); + + ret = strtold (cs, &cse); + + if (wcse) + { + /* Make sure temp mbstring has 0 at cse. */ + *cse = '\0'; + i = _mbslen ((unsigned char*) cs); /* Number of chars, not bytes */ + *wcse = (wchar_t *) wcs + i; + } free (cs); - if (wcse) - *wcse = (wchar_t*) wcs + lenldstr; - return xx.ld; + + return ret; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ped...@us...> - 2007-02-07 00:55:48
|
Revision: 891 http://svn.sourceforge.net/cegcc/?rev=891&view=rev Author: pedroalves Date: 2007-02-06 16:55:47 -0800 (Tue, 06 Feb 2007) Log Message: ----------- * mingwex/btowc.c (btowc): get_cp_from_locale was renamed to get_codepage upstream. Update call. Modified Paths: -------------- trunk/cegcc/src/mingw/ChangeLog.mingw32ce trunk/cegcc/src/mingw/mingwex/btowc.c Modified: trunk/cegcc/src/mingw/ChangeLog.mingw32ce =================================================================== --- trunk/cegcc/src/mingw/ChangeLog.mingw32ce 2007-02-07 00:49:27 UTC (rev 890) +++ trunk/cegcc/src/mingw/ChangeLog.mingw32ce 2007-02-07 00:55:47 UTC (rev 891) @@ -1,5 +1,10 @@ 2007-02-07 Pedro Alves <ped...@po...> + * mingwex/btowc.c (btowc): get_cp_from_locale was renamed to + get_codepage upstream. Update call. + +2007-02-07 Pedro Alves <ped...@po...> + * mingwex/wcstold.c: Update from upstream. (_mbslen): New function. Modified: trunk/cegcc/src/mingw/mingwex/btowc.c =================================================================== --- trunk/cegcc/src/mingw/mingwex/btowc.c 2007-02-07 00:49:27 UTC (rev 890) +++ trunk/cegcc/src/mingw/mingwex/btowc.c 2007-02-07 00:55:47 UTC (rev 891) @@ -12,7 +12,7 @@ { unsigned char ch = c; wchar_t wc = WEOF; - MultiByteToWideChar (get_cp_from_locale(), MB_ERR_INVALID_CHARS, + MultiByteToWideChar (get_codepage(), MB_ERR_INVALID_CHARS, (char*)&ch, 1, &wc, 1); return wc; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ped...@us...> - 2007-02-07 01:03:10
|
Revision: 893 http://svn.sourceforge.net/cegcc/?rev=893&view=rev Author: pedroalves Date: 2007-02-06 17:03:09 -0800 (Tue, 06 Feb 2007) Log Message: ----------- * mingwex/wince/fdopen.c (fdopen): Include stdlib.h. Modified Paths: -------------- trunk/cegcc/src/mingw/ChangeLog.mingw32ce trunk/cegcc/src/mingw/mingwex/wince/fdopen.c Modified: trunk/cegcc/src/mingw/ChangeLog.mingw32ce =================================================================== --- trunk/cegcc/src/mingw/ChangeLog.mingw32ce 2007-02-07 00:59:10 UTC (rev 892) +++ trunk/cegcc/src/mingw/ChangeLog.mingw32ce 2007-02-07 01:03:09 UTC (rev 893) @@ -1,5 +1,9 @@ 2007-02-07 Pedro Alves <ped...@po...> + * mingwex/wince/fdopen.c (fdopen): Include stdlib.h. + +2007-02-07 Pedro Alves <ped...@po...> + * mingwex/btowc.c (btowc): get_cp_from_locale was renamed to get_codepage upstream. Update call. Modified: trunk/cegcc/src/mingw/mingwex/wince/fdopen.c =================================================================== --- trunk/cegcc/src/mingw/mingwex/wince/fdopen.c 2007-02-07 00:59:10 UTC (rev 892) +++ trunk/cegcc/src/mingw/mingwex/wince/fdopen.c 2007-02-07 01:03:09 UTC (rev 893) @@ -1,5 +1,6 @@ #include <stdio.h> #include <string.h> +#include <stdlib.h> #define MAX_MODE 64 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ped...@us...> - 2007-02-07 01:08:13
|
Revision: 894 http://svn.sourceforge.net/cegcc/?rev=894&view=rev Author: pedroalves Date: 2007-02-06 17:08:12 -0800 (Tue, 06 Feb 2007) Log Message: ----------- * mingwex/gdtoa/gdtoaimp.h: Wrap errno.h inclusion in NO_ERRNO. Modified Paths: -------------- trunk/cegcc/src/mingw/ChangeLog.mingw32ce trunk/cegcc/src/mingw/mingwex/gdtoa/gdtoaimp.h Modified: trunk/cegcc/src/mingw/ChangeLog.mingw32ce =================================================================== --- trunk/cegcc/src/mingw/ChangeLog.mingw32ce 2007-02-07 01:03:09 UTC (rev 893) +++ trunk/cegcc/src/mingw/ChangeLog.mingw32ce 2007-02-07 01:08:12 UTC (rev 894) @@ -1,5 +1,9 @@ 2007-02-07 Pedro Alves <ped...@po...> + * mingwex/gdtoa/gdtoaimp.h: Wrap errno.h inclusion in NO_ERRNO. + +2007-02-07 Pedro Alves <ped...@po...> + * mingwex/wince/fdopen.c (fdopen): Include stdlib.h. 2007-02-07 Pedro Alves <ped...@po...> Modified: trunk/cegcc/src/mingw/mingwex/gdtoa/gdtoaimp.h =================================================================== --- trunk/cegcc/src/mingw/mingwex/gdtoa/gdtoaimp.h 2007-02-07 01:03:09 UTC (rev 893) +++ trunk/cegcc/src/mingw/mingwex/gdtoa/gdtoaimp.h 2007-02-07 01:08:12 UTC (rev 894) @@ -202,7 +202,9 @@ #define IEEE_Arith #endif +#ifndef NO_ERRNO #include <errno.h> +#endif #ifdef Bad_float_h #ifdef IEEE_Arith This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ped...@us...> - 2007-02-07 01:37:16
|
Revision: 895 http://svn.sourceforge.net/cegcc/?rev=895&view=rev Author: pedroalves Date: 2007-02-06 17:37:11 -0800 (Tue, 06 Feb 2007) Log Message: ----------- * mingwex/wince/mb_cur_max.c: New file. * mingwex/Makefile.in (WINCE_OBJS): Add mb_cur_max.o * include/stdlib.h (MB_CUR_MAX): Implement in terms of __mb_cur_max. * include/ctype.h (MB_CUR_MAX): Likewise. Modified Paths: -------------- trunk/cegcc/src/mingw/include/ctype.h trunk/cegcc/src/mingw/include/stdlib.h trunk/cegcc/src/mingw/mingwex/Makefile.in Added Paths: ----------- trunk/cegcc/src/mingw/mingwex/wince/mb_cur_max.c Modified: trunk/cegcc/src/mingw/include/ctype.h =================================================================== --- trunk/cegcc/src/mingw/include/ctype.h 2007-02-07 01:08:12 UTC (rev 894) +++ trunk/cegcc/src/mingw/include/ctype.h 2007-02-07 01:37:11 UTC (rev 895) @@ -100,10 +100,8 @@ # define MB_CUR_MAX __mb_cur_max_dll __MINGW_IMPORT int __mb_cur_max_dll; # elif defined (__COREDLL__) - /* No locale support, so we set it to maximum. */ - /* From limits.h. */ - /* #define MB_CUR_MAX MB_LEN_MAX 2 */ -# define MB_CUR_MAX 2 +# define MB_CUR_MAX __mb_cur_max() + _CRTIMP int __mb_cur_max (void); # endif /* __CRTDLL__ */ #else /* ! __DECLSPEC_SUPPORTED */ Modified: trunk/cegcc/src/mingw/include/stdlib.h =================================================================== --- trunk/cegcc/src/mingw/include/stdlib.h 2007-02-07 01:08:12 UTC (rev 894) +++ trunk/cegcc/src/mingw/include/stdlib.h 2007-02-07 01:37:11 UTC (rev 895) @@ -116,10 +116,8 @@ # define MB_CUR_MAX __mb_cur_max_dll __MINGW_IMPORT int __mb_cur_max_dll; # elif defined (__COREDLL__) - /* No locale support, so we set it to maximum. */ - /* From limits.h. */ - /* #define MB_CUR_MAX MB_LEN_MAX 2 */ -# define MB_CUR_MAX 2 +# define MB_CUR_MAX __mb_cur_max() + _CRTIMP int __mb_cur_max (void); # endif /* __CRTDLL__ */ #else /* ! __DECLSPEC_SUPPORTED */ Modified: trunk/cegcc/src/mingw/mingwex/Makefile.in =================================================================== --- trunk/cegcc/src/mingw/mingwex/Makefile.in 2007-02-07 01:08:12 UTC (rev 894) +++ trunk/cegcc/src/mingw/mingwex/Makefile.in 2007-02-07 01:37:11 UTC (rev 895) @@ -213,7 +213,8 @@ asctime.o freopen.o gmtime.o localtime.o mktime.o strftime.o time.o \ tempnam.o unlink.o wcsftime.o fdopen.o read.o write.o open.o lseek.o \ close.o isalnum.o isalpha.o iscntrl.o isgraph.o islower.o isprint.o \ - ispunct.o isspace.o isupper.o isxdigit.o _tolower.o _toupper.o + ispunct.o isspace.o isupper.o isxdigit.o _tolower.o _toupper.o mb_cur_max.o + MATHCE_OBJS = \ e_acosf.o e_acosh.o e_acoshf.o e_asinf.o e_atan2f.o e_atanh.o e_coshf.o \ e_expf.o e_gamma_r.o e_gammaf_r.o e_lgamma_r.o e_lgammaf_r.o e_log10f.o \ Added: trunk/cegcc/src/mingw/mingwex/wince/mb_cur_max.c =================================================================== --- trunk/cegcc/src/mingw/mingwex/wince/mb_cur_max.c (rev 0) +++ trunk/cegcc/src/mingw/mingwex/wince/mb_cur_max.c 2007-02-07 01:37:11 UTC (rev 895) @@ -0,0 +1,18 @@ +/* MB_CUR_MAX implementation for Windows CE. + * Revision history: + * 6 Feb 2007 Initial version. + * + * Contributor: Pedro Alves <ped...@po...> + */ + + /* This routine has been placed in the public domain. */ + +#include <windows.h> + +int +__mb_cur_max (void) +{ + CPINFO cpinfo; + GetCPInfo (CP_ACP, &cpinfo); + return cpinfo.MaxCharSize; +} Property changes on: trunk/cegcc/src/mingw/mingwex/wince/mb_cur_max.c ___________________________________________________________________ Name: svn:eol-style + native This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ped...@us...> - 2007-02-07 01:50:52
|
Revision: 897 http://svn.sourceforge.net/cegcc/?rev=897&view=rev Author: pedroalves Date: 2007-02-06 17:50:50 -0800 (Tue, 06 Feb 2007) Log Message: ----------- * include/math.h: Expose __fpclassifyf, __fpclassify, __fpclassifyl, and fpclassify. (_isnanl): Implement on terms of fpclassify. (isnan): New version for __COREDLL__. Expose functions that depend on fpclassify. * mingwex/mathce/_fpmath.h: New. * mingwex/mathce/fpmath.h: New. * mingwex/mathce/fpclassify.c: New. * mingwex/mathce/s_isinf.c: Undefine isinf before definition. * mingwex/Makefile.in (MATHCE_OBJS): Add fpclassify.o. Modified Paths: -------------- trunk/cegcc/src/mingw/include/math.h trunk/cegcc/src/mingw/mingwex/Makefile.in trunk/cegcc/src/mingw/mingwex/mathce/s_isinf.c Added Paths: ----------- trunk/cegcc/src/mingw/mingwex/mathce/_fpmath.h trunk/cegcc/src/mingw/mingwex/mathce/fpclassify.c trunk/cegcc/src/mingw/mingwex/mathce/fpmath.h Modified: trunk/cegcc/src/mingw/include/math.h =================================================================== --- trunk/cegcc/src/mingw/include/math.h 2007-02-07 01:38:30 UTC (rev 896) +++ trunk/cegcc/src/mingw/include/math.h 2007-02-07 01:50:50 UTC (rev 897) @@ -308,8 +308,6 @@ /* 7.12.3.1 */ -#ifdef __i386__ - /* Return values for fpclassify. These are based on Intel x87 fpu condition codes @@ -333,12 +331,15 @@ extern int __cdecl __fpclassifyf (float); extern int __cdecl __fpclassify (double); +extern int __cdecl __fpclassifyl (long double); +#ifdef __i386__ __CRT_INLINE int __cdecl __fpclassifyl (long double x){ unsigned short sw; __asm__ ("fxam; fstsw %%ax;" : "=a" (sw): "t" (x)); return sw & (FP_NAN | FP_NORMAL | FP_ZERO ); } +#endif #define fpclassify(x) (sizeof (x) == sizeof (float) ? __fpclassifyf (x) \ : sizeof (x) == sizeof (double) ? __fpclassify (x) \ @@ -350,18 +351,13 @@ /* 7.12.3.3 */ #define isinf(x) (fpclassify(x) == FP_INFINITE) -#else - -extern int isfinite (double x); -extern int isinf (double x); - -#endif - /* 7.12.3.4 */ /* We don't need to worry about truncation here: A NaN stays a NaN. */ #ifdef __i386__ +/* The isnan define could be implemented in terms + of fpclassify. It would compile to the same thing. */ __CRT_INLINE int __cdecl __isnan (double _x) { unsigned short sw; @@ -389,16 +385,26 @@ == FP_NAN; } - #define isnan(x) (sizeof (x) == sizeof (float) ? __isnanf (x) \ : sizeof (x) == sizeof (double) ? __isnan (x) \ : __isnanl (x)) -#else -extern int isnan (double x); -extern int isnanf (float x); -#endif +#endif /* __i386__ */ +#ifdef __COREDLL__ +__CRT_INLINE int __cdecl _isnanl (long double _x) +{ + int sw = fpclassify (_x); + return (sw & (FP_NAN | FP_NORMAL | FP_INFINITE | FP_ZERO | FP_SUBNORMAL)) + == FP_NAN; +} + +#define isnan(x) (sizeof (x) == sizeof (float) ? _isnanf (x) \ + : sizeof (x) == sizeof (double) ? _isnan (x) \ + : _isnanl (x)) + +#endif /* __COREDLL__ */ + /* 7.12.3.5 */ #define isnormal(x) (fpclassify(x) == FP_NORMAL) Modified: trunk/cegcc/src/mingw/mingwex/Makefile.in =================================================================== --- trunk/cegcc/src/mingw/mingwex/Makefile.in 2007-02-07 01:38:30 UTC (rev 896) +++ trunk/cegcc/src/mingw/mingwex/Makefile.in 2007-02-07 01:50:50 UTC (rev 897) @@ -230,7 +230,8 @@ s_trunc.o s_truncf.o w_acosf.o w_acosh.o w_acoshf.o w_asinf.o w_atan2f.o \ w_atanh.o w_coshf.o w_expf.o w_hypotf.o w_lgamma.o w_lgammaf.o w_log2.o w_log2f.o \ w_log10f.o w_logf.o w_powf.o w_remainder.o w_remainderf.o w_sinhf.o \ - w_tgamma.o w_tgammaf.o + w_tgamma.o w_tgammaf.o fpclassify.o + GDTOA_OBJS = \ dmisc.o dtoa.o g__fmt.o g_dfmt.o g_ffmt.o g_xfmt.o gdtoa.o \ gethex.o gmisc.o hd_init.o hexnan.o misc.o smisc.o \ Added: trunk/cegcc/src/mingw/mingwex/mathce/_fpmath.h =================================================================== --- trunk/cegcc/src/mingw/mingwex/mathce/_fpmath.h (rev 0) +++ trunk/cegcc/src/mingw/mingwex/mathce/_fpmath.h 2007-02-07 01:50:50 UTC (rev 897) @@ -0,0 +1,55 @@ +/*- + * Copyright (c) 2002, 2003 David Schultz <da...@Fr...> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD: src/lib/libc/arm/_fpmath.h,v 1.4 2005/03/20 00:53:52 cognet Exp $ + */ + +union IEEEl2bits { + long double e; + struct { +#ifndef __ARMEB__ + unsigned int manl :32; + unsigned int manh :20; + unsigned int exp :11; + unsigned int sign :1; +#else + unsigned int sign :1; + unsigned int exp :11; + unsigned int manh :20; + unsigned int manl :32; +#endif + } bits; +}; + +#define LDBL_NBIT 0 +#define mask_nbit_l(u) ((void)0) + +#define LDBL_MANH_SIZE 32 +#define LDBL_MANL_SIZE 32 + +#define LDBL_TO_ARRAY32(u, a) do { \ + (a)[0] = (uint32_t)(u).bits.manl; \ + (a)[1] = (uint32_t)(u).bits.manh; \ +} while(0) Property changes on: trunk/cegcc/src/mingw/mingwex/mathce/_fpmath.h ___________________________________________________________________ Name: svn:eol-style + native Added: trunk/cegcc/src/mingw/mingwex/mathce/fpclassify.c =================================================================== --- trunk/cegcc/src/mingw/mingwex/mathce/fpclassify.c (rev 0) +++ trunk/cegcc/src/mingw/mingwex/mathce/fpclassify.c 2007-02-07 01:50:50 UTC (rev 897) @@ -0,0 +1,101 @@ +/*- + * Copyright (c) 2003 Mike Barcroft <mi...@Fr...> + * Copyright (c) 2002, 2003 David Schultz <da...@Fr...> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD: src/lib/libc/gen/fpclassify.c,v 1.2 2005/02/06 03:23:31 das Exp $ + */ + +#ifndef __MINGW32CE__ +#include <sys/endian.h> +#else +#include "math_private.h" +#endif + +#include <math.h> +#include <stdint.h> + +#include "fpmath.h" + +int +__fpclassifyf(float f) +{ + union IEEEf2bits u; + + u.f = f; + if (u.bits.exp == 0) { + if (u.bits.man == 0) + return (FP_ZERO); + return (FP_SUBNORMAL); + } + if (u.bits.exp == 255) { + if (u.bits.man == 0) + return (FP_INFINITE); + return (FP_NAN); + } + return (FP_NORMAL); +} + +int +#ifndef __MINGW32CE__ +__fpclassifyd(double d) +#else +__fpclassify(double d) +#endif +{ + union IEEEd2bits u; + + u.d = d; + if (u.bits.exp == 0) { + if ((u.bits.manl | u.bits.manh) == 0) + return (FP_ZERO); + return (FP_SUBNORMAL); + } + if (u.bits.exp == 2047) { + if ((u.bits.manl | u.bits.manh) == 0) + return (FP_INFINITE); + return (FP_NAN); + } + return (FP_NORMAL); +} + +int +__fpclassifyl(long double e) +{ + union IEEEl2bits u; + + u.e = e; + if (u.bits.exp == 0) { + if ((u.bits.manl | u.bits.manh) == 0) + return (FP_ZERO); + return (FP_SUBNORMAL); + } + mask_nbit_l(u); /* Mask normalization bit if applicable. */ + if (u.bits.exp == 32767) { + if ((u.bits.manl | u.bits.manh) == 0) + return (FP_INFINITE); + return (FP_NAN); + } + return (FP_NORMAL); +} Property changes on: trunk/cegcc/src/mingw/mingwex/mathce/fpclassify.c ___________________________________________________________________ Name: svn:eol-style + native Added: trunk/cegcc/src/mingw/mingwex/mathce/fpmath.h =================================================================== --- trunk/cegcc/src/mingw/mingwex/mathce/fpmath.h (rev 0) +++ trunk/cegcc/src/mingw/mingwex/mathce/fpmath.h 2007-02-07 01:50:50 UTC (rev 897) @@ -0,0 +1,71 @@ +/*- + * Copyright (c) 2003 Mike Barcroft <mi...@Fr...> + * Copyright (c) 2002 David Schultz <da...@Fr...> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD: src/lib/libc/include/fpmath.h,v 1.3 2005/02/06 03:23:31 das Exp $ + */ + +#ifndef __MINGW32CE__ +#include <sys/endian.h> +#else +#include "math_private.h" +#endif + +#include "_fpmath.h" + +union IEEEf2bits { + float f; + struct { +#if _BYTE_ORDER == _LITTLE_ENDIAN + unsigned int man :23; + unsigned int exp :8; + unsigned int sign :1; +#else /* _BIG_ENDIAN */ + unsigned int sign :1; + unsigned int exp :8; + unsigned int man :23; +#endif + } bits; +}; + +#define DBL_MANH_SIZE 20 +#define DBL_MANL_SIZE 32 + +union IEEEd2bits { + double d; + struct { +#if _BYTE_ORDER == _LITTLE_ENDIAN + unsigned int manl :32; + unsigned int manh :20; + unsigned int exp :11; + unsigned int sign :1; +#else /* _BIG_ENDIAN */ + unsigned int sign :1; + unsigned int exp :11; + unsigned int manh :20; + unsigned int manl :32; +#endif + } bits; +}; Property changes on: trunk/cegcc/src/mingw/mingwex/mathce/fpmath.h ___________________________________________________________________ Name: svn:eol-style + native Modified: trunk/cegcc/src/mingw/mingwex/mathce/s_isinf.c =================================================================== --- trunk/cegcc/src/mingw/mingwex/mathce/s_isinf.c 2007-02-07 01:38:30 UTC (rev 896) +++ trunk/cegcc/src/mingw/mingwex/mathce/s_isinf.c 2007-02-07 01:50:50 UTC (rev 897) @@ -15,6 +15,8 @@ #include "math.h" #include "math_private.h" +#undef isinf + int isinf(double x) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ped...@us...> - 2007-02-07 01:56:22
|
Revision: 898 http://svn.sourceforge.net/cegcc/?rev=898&view=rev Author: pedroalves Date: 2007-02-06 17:56:19 -0800 (Tue, 06 Feb 2007) Log Message: ----------- Committing missing changelog entry for my previous commit, and this missing change too: * mingwex/mathce/math_private.h (_BIG_ENDIAN, _LITTLE_ENDIAN, _BYTE_ORDER): New defines. Modified Paths: -------------- trunk/cegcc/src/mingw/ChangeLog.mingw32ce trunk/cegcc/src/mingw/mingwex/mathce/math_private.h Modified: trunk/cegcc/src/mingw/ChangeLog.mingw32ce =================================================================== --- trunk/cegcc/src/mingw/ChangeLog.mingw32ce 2007-02-07 01:50:50 UTC (rev 897) +++ trunk/cegcc/src/mingw/ChangeLog.mingw32ce 2007-02-07 01:56:19 UTC (rev 898) @@ -1,5 +1,21 @@ 2007-02-07 Pedro Alves <ped...@po...> + + * include/math.h: Expose __fpclassifyf, __fpclassify, + __fpclassifyl, and fpclassify. + (_isnanl): Implement on terms of fpclassify. + (isnan): New version for __COREDLL__. + Expose functions that depend on fpclassify. + * mingwex/mathce/_fpmath.h: New. + * mingwex/mathce/fpmath.h: New. + * mingwex/mathce/fpclassify.c: New. + * mingwex/mathce/s_isinf.c: Undefine isinf before + definition. + * mingwex/mathce/math_private.h (_BIG_ENDIAN, _LITTLE_ENDIAN, + _BYTE_ORDER): New defines. + * mingwex/Makefile.in (MATHCE_OBJS): Add fpclassify.o. +2007-02-07 Pedro Alves <ped...@po...> + * mingwex/wince/mb_cur_max.c: New file. * mingwex/Makefile.in (WINCE_OBJS): Add mb_cur_max.o * include/stdlib.h (MB_CUR_MAX): Implement in terms of Modified: trunk/cegcc/src/mingw/mingwex/mathce/math_private.h =================================================================== --- trunk/cegcc/src/mingw/mingwex/mathce/math_private.h 2007-02-07 01:50:50 UTC (rev 897) +++ trunk/cegcc/src/mingw/mingwex/mathce/math_private.h 2007-02-07 01:56:19 UTC (rev 898) @@ -38,9 +38,12 @@ #define BIG_ENDIAN 0 #define LITTLE_ENDIAN 1 - #define BYTE_ORDER LITTLE_ENDIAN +#define _BIG_ENDIAN BIG_ENDIAN +#define _LITTLE_ENDIAN LITTLE_ENDIAN +#define _BYTE_ORDER BYTE_ORDER + #endif /* __MINGW32CE__ */ /* The original fdlibm code used statements like: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |