From: <ped...@us...> - 2006-08-24 00:09:09
|
Revision: 346 Author: pedroalves Date: 2006-08-23 17:08:42 -0700 (Wed, 23 Aug 2006) ViewCVS: http://svn.sourceforge.net/cegcc/?rev=346&view=rev Log Message: ----------- Commit work on arm-wince-mingw32 runtime. Modified Paths: -------------- trunk/cegcc/src/mingw/CRT_fp10.c trunk/cegcc/src/mingw/CRT_fp8.c trunk/cegcc/src/mingw/Makefile.in trunk/cegcc/src/mingw/configure trunk/cegcc/src/mingw/configure.in trunk/cegcc/src/mingw/cpu_features.c trunk/cegcc/src/mingw/crt1.c trunk/cegcc/src/mingw/dllcrt1.c trunk/cegcc/src/mingw/include/_mingw.h trunk/cegcc/src/mingw/include/stdlib.h trunk/cegcc/src/mingw/init.c trunk/cegcc/src/mingw/main.c trunk/cegcc/src/mingw/pseudo-reloc.c This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ped...@us...> - 2006-08-28 00:38:06
|
Revision: 459 Author: pedroalves Date: 2006-08-27 17:37:55 -0700 (Sun, 27 Aug 2006) ViewCVS: http://svn.sourceforge.net/cegcc/?rev=459&view=rev Log Message: ----------- Implement atexit and _onexit. They are on corelibc, not in coredll in Windows CE SDK, so we have to reimplement them. Modified Paths: -------------- trunk/cegcc/src/mingw/Makefile.in trunk/cegcc/src/mingw/dllcrt1.c Added Paths: ----------- trunk/cegcc/src/mingw/__dllonexit.c This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ped...@us...> - 2006-08-28 18:49:20
|
Revision: 468 Author: pedroalves Date: 2006-08-28 11:49:04 -0700 (Mon, 28 Aug 2006) ViewCVS: http://svn.sourceforge.net/cegcc/?rev=468&view=rev Log Message: ----------- Forgot adding these in a previous commit, so here they go. Implement atexit and _onexit. They are on corelibc, not in coredll in Windows CE SDK, so we have to reimplement them. Added Paths: ----------- trunk/cegcc/src/mingw/abort.c trunk/cegcc/src/mingw/atexit.c This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ped...@us...> - 2006-08-29 21:42:41
|
Revision: 484 Author: pedroalves Date: 2006-08-29 14:42:25 -0700 (Tue, 29 Aug 2006) ViewCVS: http://svn.sourceforge.net/cegcc/?rev=484&view=rev Log Message: ----------- Don't export __dllonexit. Modified Paths: -------------- trunk/cegcc/src/mingw/__dllonexit.c trunk/cegcc/src/mingw/atexit.c trunk/cegcc/src/mingw/dllcrt1.c This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ped...@us...> - 2006-09-06 22:47:24
|
Revision: 574 http://svn.sourceforge.net/cegcc/?rev=574&view=rev Author: pedroalves Date: 2006-09-06 15:47:03 -0700 (Wed, 06 Sep 2006) Log Message: ----------- Remove dependencies on errno.h and signal.h for coredll.dll case. Modified Paths: -------------- trunk/cegcc/src/mingw/atexit.c trunk/cegcc/src/mingw/crt1.c trunk/cegcc/src/mingw/dllcrt1.c This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ped...@us...> - 2006-09-25 21:01:17
|
Revision: 623 http://svn.sourceforge.net/cegcc/?rev=623&view=rev Author: pedroalves Date: 2006-09-25 14:01:05 -0700 (Mon, 25 Sep 2006) Log Message: ----------- Add assert implementation. Modified Paths: -------------- trunk/cegcc/src/mingw/Makefile.in Added Paths: ----------- trunk/cegcc/src/mingw/assert.c This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ped...@us...> - 2006-09-26 03:06:24
|
Revision: 634 http://svn.sourceforge.net/cegcc/?rev=634&view=rev Author: pedroalves Date: 2006-09-25 20:06:08 -0700 (Mon, 25 Sep 2006) Log Message: ----------- We have __gccmain, not __main. Modified Paths: -------------- trunk/cegcc/src/mingw/dllcrt1.c trunk/cegcc/src/mingw/gccmain.c This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ped...@us...> - 2006-09-27 13:29:17
|
Revision: 640 http://svn.sourceforge.net/cegcc/?rev=640&view=rev Author: pedroalves Date: 2006-09-27 06:28:43 -0700 (Wed, 27 Sep 2006) Log Message: ----------- Fix __dllonexit to accept the case where *start and *end are both NULL. atexit now works, which means c++ global destructors run. Hurray\! Modified Paths: -------------- trunk/cegcc/src/mingw/__dllonexit.c trunk/cegcc/src/mingw/atexit.c This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ped...@us...> - 2006-10-04 00:53:20
|
Revision: 659 http://svn.sourceforge.net/cegcc/?rev=659&view=rev Author: pedroalves Date: 2006-10-03 17:53:10 -0700 (Tue, 03 Oct 2006) Log Message: ----------- Adapt libmoldname to coredll. Name the importlib as libceoldname (coredll/wince) to distinguish from libmoldname (msvcrt) and libcoldname (crtdll). Adjust Makefile.in to only build libceoldname for Windows CE. Modified Paths: -------------- trunk/cegcc/src/mingw/Makefile.in trunk/cegcc/src/mingw/moldname.def.in This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ped...@us...> - 2006-10-05 13:12:37
|
Revision: 666 http://svn.sourceforge.net/cegcc/?rev=666&view=rev Author: pedroalves Date: 2006-10-05 06:12:26 -0700 (Thu, 05 Oct 2006) Log Message: ----------- * include/ctype.h: Always use the inline versions of is* on Windows CE. Modified Paths: -------------- trunk/cegcc/src/mingw/include/ctype.h Added Paths: ----------- trunk/cegcc/src/mingw/ChangeLog.mingwce32 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ped...@us...> - 2006-10-05 13:13:55
|
Revision: 667 http://svn.sourceforge.net/cegcc/?rev=667&view=rev Author: pedroalves Date: 2006-10-05 06:13:47 -0700 (Thu, 05 Oct 2006) Log Message: ----------- Upps, rename to the correct target name: mingw32ce. Added Paths: ----------- trunk/cegcc/src/mingw/ChangeLog.mingw32ce Removed Paths: ------------- trunk/cegcc/src/mingw/ChangeLog.mingwce32 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ped...@us...> - 2006-10-05 13:18:27
|
Revision: 668 http://svn.sourceforge.net/cegcc/?rev=668&view=rev Author: pedroalves Date: 2006-10-05 06:18:15 -0700 (Thu, 05 Oct 2006) Log Message: ----------- * include/_mingw.h (__CRT_INLINE): Use __attribute__ ((__always_inline__)) on Windows CE. Modified Paths: -------------- trunk/cegcc/src/mingw/ChangeLog.mingw32ce trunk/cegcc/src/mingw/include/_mingw.h This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ped...@us...> - 2006-10-06 12:46:12
|
Revision: 675 http://svn.sourceforge.net/cegcc/?rev=675&view=rev Author: pedroalves Date: 2006-10-06 05:45:53 -0700 (Fri, 06 Oct 2006) Log Message: ----------- * configure.in (DLL_ENTRY, MINGWEX_DIR) : Remove, not needed anymore. * Makefile.in (MINGWEX_DIR) : Revert to using -lmingwex. * configure : Regenerate. Modified Paths: -------------- trunk/cegcc/src/mingw/ChangeLog.mingw32ce trunk/cegcc/src/mingw/Makefile.in trunk/cegcc/src/mingw/configure trunk/cegcc/src/mingw/configure.in This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dan...@us...> - 2006-10-16 18:47:03
|
Revision: 725 http://svn.sourceforge.net/cegcc/?rev=725&view=rev Author: dannybackx Date: 2006-10-16 11:46:53 -0700 (Mon, 16 Oct 2006) Log Message: ----------- Get the profiling support subdirectory to compile in both target environments. Beware: don't install this yet in arm-wince-cegcc. 2006-10-15 Danny Backx <dan...@so...> * configure.in: always configure profile subdirectory. * configure: regenerated due to configure.in changes. * profile/gcrt0.c profile/gmon.c profile/profil.h profile/gmon.h profile/profil.c : changes to get this to compile in our environments. Use only the existing macros UNDER_CE, ARM. Don't use __COREDLL__ except in one place where we needed to undefine it. Modified Paths: -------------- trunk/cegcc/src/mingw/ChangeLog.mingw32ce trunk/cegcc/src/mingw/configure trunk/cegcc/src/mingw/configure.in trunk/cegcc/src/mingw/profile/gcrt0.c trunk/cegcc/src/mingw/profile/gmon.c trunk/cegcc/src/mingw/profile/gmon.h trunk/cegcc/src/mingw/profile/profil.c trunk/cegcc/src/mingw/profile/profil.h This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ped...@us...> - 2006-10-16 20:49:42
|
Revision: 729 http://svn.sourceforge.net/cegcc/?rev=729&view=rev Author: pedroalves Date: 2006-10-16 13:49:14 -0700 (Mon, 16 Oct 2006) Log Message: ----------- * include/io.h : Hide the file. * include/signal.h : Hide the file better. * include/errno.h : Likewise. * include/stdio.h (_fileno) : Return void* instead of int, as reported by MSVC warning logs, and as hinted here (mind the line break): http://msdn.microsoft.com/library/default.asp?url=/library/en-us/\ dv_wcecrt4/html/erlrfusfileno.asp : (Return Values _fileno returns the file handle.) Notice the wording: file *handle*, not file descriptor. * atexit.c : Don't include io.h. * __dllonexit.c : Likewise. * dllcrt1.c : Don't include io.h on __COREDLL__. * crt1.c : Likewise. Modified Paths: -------------- trunk/cegcc/src/mingw/ChangeLog.mingw32ce trunk/cegcc/src/mingw/__dllonexit.c trunk/cegcc/src/mingw/atexit.c trunk/cegcc/src/mingw/crt1.c trunk/cegcc/src/mingw/dllcrt1.c trunk/cegcc/src/mingw/include/errno.h trunk/cegcc/src/mingw/include/io.h trunk/cegcc/src/mingw/include/signal.h trunk/cegcc/src/mingw/include/stdio.h This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ped...@us...> - 2006-10-16 23:36:11
|
Revision: 733 http://svn.sourceforge.net/cegcc/?rev=733&view=rev Author: pedroalves Date: 2006-10-16 16:35:57 -0700 (Mon, 16 Oct 2006) Log Message: ----------- * profile/gcrt0.c : Remove __COREDLL__ hack. * profile/gmon.c : Don't include fcnctl.h on mingw32ce. * profile/Makefile.in : Add comment about coredll being CRT_ID 3. (ALL_CRT0S) : Add gcrt3.o. (gcrt3.o) : Add build rule. * profile/configure.in : Handle mingw32ce. * profile/configure : Regenerate. Modified Paths: -------------- trunk/cegcc/src/mingw/ChangeLog.mingw32ce trunk/cegcc/src/mingw/profile/Makefile.in trunk/cegcc/src/mingw/profile/configure trunk/cegcc/src/mingw/profile/configure.in trunk/cegcc/src/mingw/profile/gcrt0.c trunk/cegcc/src/mingw/profile/gmon.c This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ped...@us...> - 2006-10-17 00:06:39
|
Revision: 735 http://svn.sourceforge.net/cegcc/?rev=735&view=rev Author: pedroalves Date: 2006-10-16 17:06:28 -0700 (Mon, 16 Oct 2006) Log Message: ----------- * include/fcntl.h : Hide the file. * include/direct.h : Hide the file. Modified Paths: -------------- trunk/cegcc/src/mingw/ChangeLog.mingw32ce trunk/cegcc/src/mingw/include/direct.h trunk/cegcc/src/mingw/include/fcntl.h Modified: trunk/cegcc/src/mingw/ChangeLog.mingw32ce =================================================================== --- trunk/cegcc/src/mingw/ChangeLog.mingw32ce 2006-10-16 23:38:17 UTC (rev 734) +++ trunk/cegcc/src/mingw/ChangeLog.mingw32ce 2006-10-17 00:06:28 UTC (rev 735) @@ -1,5 +1,10 @@ 2006-10-17 Pedro Alves <ped...@po...> + * include/fcntl.h : Hide the file. + * include/direct.h : Hide the file. + +2006-10-17 Pedro Alves <ped...@po...> + * profile/gcrt0.c : Remove __COREDLL__ hack. * profile/gmon.c : Don't include fcnctl.h on mingw32ce. * profile/Makefile.in : Add comment about coredll being CRT_ID 3. Modified: trunk/cegcc/src/mingw/include/direct.h =================================================================== --- trunk/cegcc/src/mingw/include/direct.h 2006-10-16 23:38:17 UTC (rev 734) +++ trunk/cegcc/src/mingw/include/direct.h 2006-10-17 00:06:28 UTC (rev 735) @@ -8,6 +8,11 @@ * plus functions for setting the current drive. * */ + +#ifdef __COREDLL__ +# include_next <direct.h> +#else /* __COREDLL__ */ + #ifndef _DIRECT_H_ #define _DIRECT_H_ @@ -75,3 +80,5 @@ #endif /* Not RC_INVOKED */ #endif /* Not _DIRECT_H_ */ + +#endif /* Not __COREDLL__ */ Modified: trunk/cegcc/src/mingw/include/fcntl.h =================================================================== --- trunk/cegcc/src/mingw/include/fcntl.h 2006-10-16 23:38:17 UTC (rev 734) +++ trunk/cegcc/src/mingw/include/fcntl.h 2006-10-17 00:06:28 UTC (rev 735) @@ -8,6 +8,10 @@ * in sys/stat.h (ick). * */ +#ifdef __COREDLL__ +# include_next <fcntl.h> +#else /* __COREDLL__ */ + #ifndef _FCNTL_H_ #define _FCNTL_H_ @@ -67,3 +71,5 @@ #endif /* Not _NO_OLDNAMES */ #endif /* Not _FCNTL_H_ */ + +#endif /* Not __COREDLL__ */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ped...@us...> - 2006-10-17 18:48:05
|
Revision: 739 http://svn.sourceforge.net/cegcc/?rev=739&view=rev Author: pedroalves Date: 2006-10-17 11:47:31 -0700 (Tue, 17 Oct 2006) Log Message: ----------- * __dllonexit : Delete. Code merged into ... * atexit.c : ... this. Fix filename comment. Don't include __dllonexit.c. (__atexit_first) : New function. (__atexit_init): New function. (proc_exit_chain) : Delete. (__dllexit) : New function, copied from crt1.c. (__dllonexit) : New function. (_cexit) : Call __dllexit. * Makefile.in (dllcrt1.o, dllcrt2.o, atexit.o) : Remove dependency on __dllonexit.c. * dllcrt1.c : Don't implement a private atexit list on __COREDLL__, since the atexit implementation there is already image private. (DllMainCRTStartup) : Call __atexit_init. Use __atexit_first to get to the private first_atexit. (__dll_exit) : Hide on __COREDLL__. Don't include __dllonexit.c. * crt1.c (MainCRTStartup) : Call __atexit_init. Modified Paths: -------------- trunk/cegcc/src/mingw/ChangeLog.mingw32ce trunk/cegcc/src/mingw/Makefile.in trunk/cegcc/src/mingw/atexit.c trunk/cegcc/src/mingw/crt1.c trunk/cegcc/src/mingw/dllcrt1.c Removed Paths: ------------- trunk/cegcc/src/mingw/__dllonexit.c Modified: trunk/cegcc/src/mingw/ChangeLog.mingw32ce =================================================================== --- trunk/cegcc/src/mingw/ChangeLog.mingw32ce 2006-10-17 17:53:38 UTC (rev 738) +++ trunk/cegcc/src/mingw/ChangeLog.mingw32ce 2006-10-17 18:47:31 UTC (rev 739) @@ -1,5 +1,28 @@ 2006-10-17 Pedro Alves <ped...@po...> + * __dllonexit : Delete. Code merged into ... + * atexit.c : ... this. + Fix filename comment. + Don't include __dllonexit.c. + (__atexit_first) : New function. + (__atexit_init): New function. + (proc_exit_chain) : Delete. + (__dllexit) : New function, copied from crt1.c. + (__dllonexit) : New function. + (_cexit) : Call __dllexit. + * Makefile.in (dllcrt1.o, dllcrt2.o, atexit.o) : Remove + dependency on __dllonexit.c. + * dllcrt1.c : Don't implement a private atexit list on + __COREDLL__, since the atexit implementation there is already + image private. + (DllMainCRTStartup) : Call __atexit_init. Use __atexit_first to + get to the private first_atexit. + (__dll_exit) : Hide on __COREDLL__. + Don't include __dllonexit.c. + * crt1.c (MainCRTStartup) : Call __atexit_init. + +2006-10-17 Pedro Alves <ped...@po...> + * include/fcntl.h : Hide the file. * include/direct.h : Hide the file. Modified: trunk/cegcc/src/mingw/Makefile.in =================================================================== --- trunk/cegcc/src/mingw/Makefile.in 2006-10-17 17:53:38 UTC (rev 738) +++ trunk/cegcc/src/mingw/Makefile.in 2006-10-17 18:47:31 UTC (rev 739) @@ -503,8 +503,8 @@ crtmt.o: crtmt.c crtst.o: crtst.c ctype_old.o: ctype_old.c -dllcrt1.o: dllcrt1.c __dllonexit.c -dllcrt2.o: dllcrt1.c __dllonexit.c +dllcrt1.o: dllcrt1.c +dllcrt2.o: dllcrt1.c dllmain.o: dllmain.c main.o: main.c oldnames.o: oldnames.c @@ -512,7 +512,7 @@ CRT_fp8.o: CRT_fp8.c CRT_fp10.o: CRT_fp10.c abort.o: abort.c -atexit.o: atexit.c __dllonexit.c +atexit.o: atexit.c assert.o: assert.c Makefile: Makefile.in config.status configure Deleted: trunk/cegcc/src/mingw/__dllonexit.c =================================================================== --- trunk/cegcc/src/mingw/__dllonexit.c 2006-10-17 17:53:38 UTC (rev 738) +++ trunk/cegcc/src/mingw/__dllonexit.c 2006-10-17 18:47:31 UTC (rev 739) @@ -1,53 +0,0 @@ -/* - * __dllonexit.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. - * - * - */ -#include <stdlib.h> -#include <stdio.h> -#include <windows.h> - -#ifdef DEBUG -# define TRACE(FMT, ...) \ - printf ("trace: %s:%d : " FMT, __FILE__, __LINE__, ##__VA_ARGS__) - -# define FIXME(FMT, ...) \ - printf ("fixme: %s:%d : " FMT, __FILE__, __LINE__, ##__VA_ARGS__) -#else -# define TRACE(FMT, ...) do; while (0) -# define FIXME(FMT, ...) do; while (0) -#endif - -p_atexit_fn -__dllonexit(p_atexit_fn func, p_atexit_fn **start, p_atexit_fn **end) -{ - p_atexit_fn *tmp; - int len; - - TRACE("(%p,%p,%p)\n", func, start, end); - - if (!start || !end) - { - FIXME("bad table\n"); - return NULL; - } - - len = (*end - *start); - - TRACE("table start %p-%p, %d entries\n", *start, *end, len); - - if (++len <= 0) - return NULL; - - tmp = (p_atexit_fn *)realloc(*start, len * sizeof(tmp)); - if (!tmp) - return NULL; - *start = tmp; - *end = tmp + len; - tmp[len - 1] = func; - TRACE("new table start %p-%p, %d entries\n", *start, *end, len); - return func; -} Modified: trunk/cegcc/src/mingw/atexit.c =================================================================== --- trunk/cegcc/src/mingw/atexit.c 2006-10-17 17:53:38 UTC (rev 738) +++ trunk/cegcc/src/mingw/atexit.c 2006-10-17 18:47:31 UTC (rev 739) @@ -1,5 +1,5 @@ /* - * dllcrt1.c + * atexit.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. @@ -12,15 +12,26 @@ #include <process.h> #include <windows.h> +//#define DEBUG + +#ifdef DEBUG +# define TRACE(FMT, ...) \ + printf ("trace: %s:%d : " FMT, __FILE__, __LINE__, ##__VA_ARGS__) + +# define FIXME(FMT, ...) \ + printf ("fixme: %s:%d : " FMT, __FILE__, __LINE__, ##__VA_ARGS__) +#else +# define TRACE(FMT, ...) do; while (0) +# define FIXME(FMT, ...) do; while (0) +#endif + typedef void (* p_atexit_fn )(void); static p_atexit_fn* first_atexit; static p_atexit_fn* next_atexit; /* This is based on the function in the Wine project's exit.c */ -static p_atexit_fn __dllonexit (p_atexit_fn, p_atexit_fn**, p_atexit_fn**); +p_atexit_fn __dllonexit (p_atexit_fn, p_atexit_fn**, p_atexit_fn**); -//#define DEBUG - int atexit (p_atexit_fn pfn) { @@ -42,23 +53,88 @@ return ((_onexit_t) __dllonexit ((p_atexit_fn)pfn, &first_atexit, &next_atexit)); } -static void -proc_atexit_chain (void) +p_atexit_fn* __atexit_first(void) { - size_t len = next_atexit - first_atexit; + return first_atexit; +} - p_atexit_fn* pfn = next_atexit; - if (len != 0) +BOOL __atexit_init(void) +{ + /* Initialize atexit table. + 32 is min size required by ANSI */ + first_atexit = (p_atexit_fn*) malloc (32 * sizeof (p_atexit_fn)); + if (first_atexit == NULL ) /* can't allocate memory */ + { +#ifndef __COREDLL__ + errno=ENOMEM; +#endif + return FALSE; + } + *first_atexit = NULL; + next_atexit = first_atexit; + return TRUE; +} + +void __dll_exit(void) +/* Run LIFO terminators registered in private atexit table */ +{ + if ( first_atexit ) { - do - { - --pfn; - (*pfn)(); - } - while (pfn != first_atexit); + p_atexit_fn* __last = next_atexit - 1; + while ( __last >= first_atexit ) + { + if ( *__last != NULL ) + { +#ifdef DEBUG + printf ("%s: Calling exit function 0x%x from 0x%x\n", + __FUNCTION__, (unsigned)(*__last),(unsigned)__last); +#endif + (**__last) (); + } + __last--; + } + free ( first_atexit ) ; + first_atexit = NULL ; } + /* + Make sure output buffers opened by DllMain or + atexit-registered functions are flushed before detaching, + otherwise we can have problems with redirected output. + */ + fflush (NULL); } +p_atexit_fn +__dllonexit(p_atexit_fn func, p_atexit_fn **start, p_atexit_fn **end) +{ + p_atexit_fn *tmp; + int len; + + TRACE("(%p,%p,%p)\n", func, start, end); + + if (!start || !*start || !end || !*end) + { + FIXME("bad table\n"); + return NULL; + } + + len = (*end - *start); + + TRACE("table start %p-%p, %d entries\n", *start, *end, len); + + if (++len <= 0) + return NULL; + + tmp = (p_atexit_fn *)realloc(*start, len * sizeof(tmp)); + if (!tmp) + return NULL; + *start = tmp; + *end = tmp + len; + tmp[len - 1] = func; + TRACE("new table start %p-%p, %d entries\n", *start, *end, len); + return func; +} + static void closeall_streams (void) { @@ -74,7 +150,7 @@ void _cexit (void) { - proc_atexit_chain (); + __dll_exit (); closeall_streams (); } @@ -97,5 +173,3 @@ closeall_streams (); ExitProcess (code); } - -#include "__dllonexit.c" Modified: trunk/cegcc/src/mingw/crt1.c =================================================================== --- trunk/cegcc/src/mingw/crt1.c 2006-10-17 17:53:38 UTC (rev 738) +++ trunk/cegcc/src/mingw/crt1.c 2006-10-17 18:47:31 UTC (rev 739) @@ -41,6 +41,8 @@ #else /* No environ. */ extern int main (int, char **); +/* No atexit on coredll, we must initialize our private version. */ +BOOL __atexit_init(void); #endif /* @@ -244,7 +246,14 @@ 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 Modified: trunk/cegcc/src/mingw/dllcrt1.c =================================================================== --- trunk/cegcc/src/mingw/dllcrt1.c 2006-10-17 17:53:38 UTC (rev 738) +++ trunk/cegcc/src/mingw/dllcrt1.c 2006-10-17 18:47:31 UTC (rev 739) @@ -34,20 +34,20 @@ #endif typedef void (* p_atexit_fn )(void); + +#ifndef __COREDLL__ static p_atexit_fn* first_atexit; static p_atexit_fn* next_atexit; -static void -__dll_exit (void); - +static void __dll_exit (void); /* This is based on the function in the Wine project's exit.c */ -#ifdef UNDER_CE -static p_atexit_fn __dllonexit (p_atexit_fn, p_atexit_fn**, p_atexit_fn**); -#else p_atexit_fn __dllonexit (p_atexit_fn, p_atexit_fn**, p_atexit_fn**); -#endif +#else /* __COREDLL__ */ +void __dll_exit (void); +BOOL __atexit_init(void); +p_atexit_fn* __atexit_first(void); +#endif /* __COREDLL__ */ - extern BOOL WINAPI DllMain (HANDLE, DWORD, LPVOID); extern void _pei386_runtime_relocator (void); @@ -64,19 +64,22 @@ printf ("%s: DLL_PROCESS_ATTACH (%d)\n", __FUNCTION__); #endif +#ifdef __COREDLL__ + if (!__atexit_init()) + return FALSE; +#else /* Initialize private atexit table for this dll. 32 is min size required by ANSI */ first_atexit = (p_atexit_fn*) malloc (32 * sizeof (p_atexit_fn)); if (first_atexit == NULL ) /* can't allocate memory */ { -#ifndef UNDER_CE errno=ENOMEM; -#endif return FALSE; } *first_atexit = NULL; next_atexit = first_atexit; +#endif /* Adust references to dllimported data (from other DLL's) that have non-zero offsets. */ @@ -121,6 +124,9 @@ #ifdef DEBUG printf ("%s: DLL_PROCESS_DETACH (%d)\n", __FUNCTION__); #endif +#ifdef __COREDLL__ + p_atexit_fn* first_atexit = __atexit_first(); +#endif /* If not attached, return FALSE. Cleanup already done above if failed attachment attempt. */ if (! first_atexit ) @@ -136,6 +142,7 @@ return bRet; } +#ifndef __COREDLL__ static void __dll_exit(void) @@ -201,6 +208,4 @@ return ((_onexit_t) __dllonexit ((p_atexit_fn)pfn, &first_atexit, &next_atexit)); } -#ifdef UNDER_CE -#include "__dllonexit.c" #endif This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ped...@us...> - 2006-10-18 14:32:50
|
Revision: 742 http://svn.sourceforge.net/cegcc/?rev=742&view=rev Author: pedroalves Date: 2006-10-18 07:32:36 -0700 (Wed, 18 Oct 2006) Log Message: ----------- * include/stdio.h : Expose fileno. We have it on libceoldname. 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-10-18 14:11:42 UTC (rev 741) +++ trunk/cegcc/src/mingw/ChangeLog.mingw32ce 2006-10-18 14:32:36 UTC (rev 742) @@ -1,3 +1,7 @@ +2006-10-18 Pedro Alves <ped...@po...> + + * include/stdio.h : Expose fileno. We have it on libceoldname. + 2006-10-17 Pedro Alves <ped...@po...> * __dllonexit : Delete. Code merged into ... Modified: trunk/cegcc/src/mingw/include/stdio.h =================================================================== --- trunk/cegcc/src/mingw/include/stdio.h 2006-10-18 14:11:42 UTC (rev 741) +++ trunk/cegcc/src/mingw/include/stdio.h 2006-10-18 14:32:36 UTC (rev 742) @@ -436,6 +436,8 @@ _CRTIMP int __cdecl fputchar (int); _CRTIMP FILE* __cdecl fdopen (int, const char*); _CRTIMP int __cdecl fileno (FILE*); +#else +_CRTIMP void* __cdecl fileno (FILE*); #endif #endif /* Not _NO_OLDNAMES */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ped...@us...> - 2006-10-18 19:01:40
|
Revision: 744 http://svn.sourceforge.net/cegcc/?rev=744&view=rev Author: pedroalves Date: 2006-10-18 12:00:31 -0700 (Wed, 18 Oct 2006) Log Message: ----------- * include/setjmp.h (setjmp) : Coredll.dll has setjmp not _setjmp. (Leftover from previous commit.) * include/stdio.h : Minor cleanup. Modified Paths: -------------- trunk/cegcc/src/mingw/ChangeLog.mingw32ce trunk/cegcc/src/mingw/include/setjmp.h Modified: trunk/cegcc/src/mingw/ChangeLog.mingw32ce =================================================================== --- trunk/cegcc/src/mingw/ChangeLog.mingw32ce 2006-10-18 18:56:22 UTC (rev 743) +++ trunk/cegcc/src/mingw/ChangeLog.mingw32ce 2006-10-18 19:00:31 UTC (rev 744) @@ -1,5 +1,10 @@ 2006-10-18 Pedro Alves <ped...@po...> + * include/setjmp.h (setjmp) : Coredll.dll has setjmp not _setjmp. + * include/stdio.h : Minor cleanup. + +2006-10-18 Pedro Alves <ped...@po...> + * include/stdio.h : Expose fileno. We have it on libceoldname. 2006-10-17 Pedro Alves <ped...@po...> Modified: trunk/cegcc/src/mingw/include/setjmp.h =================================================================== --- trunk/cegcc/src/mingw/include/setjmp.h 2006-10-18 18:56:22 UTC (rev 743) +++ trunk/cegcc/src/mingw/include/setjmp.h 2006-10-18 19:00:31 UTC (rev 744) @@ -38,6 +38,9 @@ #define _JBTYPE int typedef _JBTYPE jmp_buf[_JBLEN]; +#ifdef __COREDLL__ +_CRTIMP int __cdecl setjmp (jmp_buf); +#else /* * The function provided by CRTDLL which appears to do the actual work * of setjmp. @@ -45,6 +48,7 @@ _CRTIMP int __cdecl _setjmp (jmp_buf); #define setjmp(x) _setjmp(x) +#endif /* * Return to the last setjmp call and act as if setjmp had returned This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ped...@us...> - 2006-10-19 01:12:51
|
Revision: 745 http://svn.sourceforge.net/cegcc/?rev=745&view=rev Author: pedroalves Date: 2006-10-18 18:12:37 -0700 (Wed, 18 Oct 2006) Log Message: ----------- * include/setjmp.h (_JBLEN) : Set to 11 on ARM. Modified Paths: -------------- trunk/cegcc/src/mingw/ChangeLog.mingw32ce trunk/cegcc/src/mingw/include/setjmp.h Modified: trunk/cegcc/src/mingw/ChangeLog.mingw32ce =================================================================== --- trunk/cegcc/src/mingw/ChangeLog.mingw32ce 2006-10-18 19:00:31 UTC (rev 744) +++ trunk/cegcc/src/mingw/ChangeLog.mingw32ce 2006-10-19 01:12:37 UTC (rev 745) @@ -1,3 +1,7 @@ +2006-10-19 Pedro Alves <ped...@po...> + + * include/setjmp.h (_JBLEN) : Set to 11 on ARM. + 2006-10-18 Pedro Alves <ped...@po...> * include/setjmp.h (setjmp) : Coredll.dll has setjmp not _setjmp. Modified: trunk/cegcc/src/mingw/include/setjmp.h =================================================================== --- trunk/cegcc/src/mingw/include/setjmp.h 2006-10-18 19:00:31 UTC (rev 744) +++ trunk/cegcc/src/mingw/include/setjmp.h 2006-10-19 01:12:37 UTC (rev 745) @@ -31,8 +31,7 @@ #if defined (__i386__) # define _JBLEN 16 #elif defined (__arm__) -# define _JBLEN 32 /* Safe value for now. */ -# warning "_JBLEN: test value with performing several setjmps/logjmp, and checking for clobber." +# define _JBLEN 11 #endif #define _JBTYPE int This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ped...@us...> - 2006-10-22 14:16:06
|
Revision: 747 http://svn.sourceforge.net/cegcc/?rev=747&view=rev Author: pedroalves Date: 2006-10-22 07:14:21 -0700 (Sun, 22 Oct 2006) Log Message: ----------- * include/stdio.h (puts) [__COREDLL__]: Add missing return. 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-10-20 21:45:13 UTC (rev 746) +++ trunk/cegcc/src/mingw/ChangeLog.mingw32ce 2006-10-22 14:14:21 UTC (rev 747) @@ -1,3 +1,7 @@ +2006-10-22 Pedro Alves <ped...@po...> + + * include/stdio.h (puts) [__COREDLL__]: Add missing return. + 2006-10-19 Pedro Alves <ped...@po...> * include/setjmp.h (_JBLEN) : Set to 11 on ARM. Modified: trunk/cegcc/src/mingw/include/stdio.h =================================================================== --- trunk/cegcc/src/mingw/include/stdio.h 2006-10-20 21:45:13 UTC (rev 746) +++ trunk/cegcc/src/mingw/include/stdio.h 2006-10-22 14:14:21 UTC (rev 747) @@ -322,7 +322,7 @@ #else /* __COREDLL__ */ __CRT_INLINE int __cdecl getc (FILE* __F) { return fgetc(__F); } -__CRT_INLINE int __cdecl putc (int __c, FILE* __F) { fputc (__c, __F); } +__CRT_INLINE int __cdecl putc (int __c, FILE* __F) { return fputc (__c, __F); } _CRTIMP int __cdecl getchar (void); _CRTIMP int __cdecl putchar(int __c); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ped...@us...> - 2006-10-22 17:46:52
|
Revision: 748 http://svn.sourceforge.net/cegcc/?rev=748&view=rev Author: pedroalves Date: 2006-10-22 10:46:45 -0700 (Sun, 22 Oct 2006) Log Message: ----------- * test_headers.c: Adapt to __COREDLL__. Modified Paths: -------------- trunk/cegcc/src/mingw/ChangeLog.mingw32ce trunk/cegcc/src/mingw/test_headers.c Modified: trunk/cegcc/src/mingw/ChangeLog.mingw32ce =================================================================== --- trunk/cegcc/src/mingw/ChangeLog.mingw32ce 2006-10-22 14:14:21 UTC (rev 747) +++ trunk/cegcc/src/mingw/ChangeLog.mingw32ce 2006-10-22 17:46:45 UTC (rev 748) @@ -1,5 +1,9 @@ 2006-10-22 Pedro Alves <ped...@po...> + * test_headers.c: Adapt to __COREDLL__. + +2006-10-22 Pedro Alves <ped...@po...> + * include/stdio.h (puts) [__COREDLL__]: Add missing return. 2006-10-19 Pedro Alves <ped...@po...> Modified: trunk/cegcc/src/mingw/test_headers.c =================================================================== --- trunk/cegcc/src/mingw/test_headers.c 2006-10-22 14:14:21 UTC (rev 747) +++ trunk/cegcc/src/mingw/test_headers.c 2006-10-22 17:46:45 UTC (rev 748) @@ -1,20 +1,28 @@ #include <_mingw.h> #include <assert.h> +#ifndef __COREDLL__ #include <conio.h> +#endif #include <ctype.h> +#ifndef __COREDLL__ #include <dir.h> #include <direct.h> #include <dirent.h> #include <dos.h> #include <errno.h> +#endif #include <excpt.h> +#ifndef __COREDLL__ #include <fcntl.h> +#endif #include <fenv.h> #include <float.h> #include <inttypes.h> #include <io.h> #include <limits.h> +#ifndef __COREDLL__ #include <locale.h> +#endif #include <malloc.h> #include <math.h> #include <mbctype.h> @@ -25,7 +33,9 @@ #include <search.h> #include <setjmp.h> #include <share.h> +#ifndef __COREDLL__ #include <signal.h> +#endif #include <stdarg.h> #include <stddef.h> #include <stdint.h> @@ -35,12 +45,16 @@ #include <strings.h> #include <tchar.h> #include <time.h> +#ifndef __COREDLL__ #include <unistd.h> +#endif #include <values.h> #include <wchar.h> #include <wctype.h> +#ifndef __COREDLL__ #include <sys/fcntl.h> #include <sys/file.h> +#endif #include <sys/locking.h> #include <sys/param.h> #include <sys/stat.h> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ped...@us...> - 2006-10-22 18:00:08
|
Revision: 749 http://svn.sourceforge.net/cegcc/?rev=749&view=rev Author: pedroalves Date: 2006-10-22 10:59:25 -0700 (Sun, 22 Oct 2006) Log Message: ----------- * configure.in [AC_CONFIG_SUBDIRS]: Add mingwex. * configure : Regenerate. * mingwex/Makefile.in (VPATH): Add wince subdir. (WINCE_DISTFILES): New. (WINCE_OBJS): New. (LIB_OBJS): Special case for wince. Build WINCE_OBJS. (dist): Install WINCE_DISTFILES. * mingwex/wince: New subdir. * mingwex/wince/time.c: New file. * mingwex/wince/freopen.c: New file. * mingwex/wince/unlink.c: New file. * mingwex/wince/tempnam.c: New file. * mingwex/wince/wcsftime.c: New file. * mingwex/wince/gmtime.c: New file. * mingwex/wince/asctime.c: New file. * mingwex/wince/mktime.c: New file. * mingwex/wince/localtime.c: New file. * mingwex/wince/strftime.c: New file. * include/time.h (time, mktime, asctime, ctime, gmtime, localtime, strftime, wcsftime): Expose on __COREDLL__. * include/stdio.h (freopen, _tempnam, tempnam, _wtempnam): Likewise. * include/io.h: Expose the header. Needed for unlink. (_unlink, unlink): Expose functions on __COREDLL__. Modified Paths: -------------- trunk/cegcc/src/mingw/ChangeLog.mingw32ce trunk/cegcc/src/mingw/configure trunk/cegcc/src/mingw/configure.in trunk/cegcc/src/mingw/include/io.h trunk/cegcc/src/mingw/include/stdio.h trunk/cegcc/src/mingw/include/time.h trunk/cegcc/src/mingw/mingwex/Makefile.in trunk/cegcc/src/mingw/moldname.def.in Added Paths: ----------- trunk/cegcc/src/mingw/mingwex/wince/ trunk/cegcc/src/mingw/mingwex/wince/asctime.c trunk/cegcc/src/mingw/mingwex/wince/freopen.c trunk/cegcc/src/mingw/mingwex/wince/gmtime.c trunk/cegcc/src/mingw/mingwex/wince/localtime.c trunk/cegcc/src/mingw/mingwex/wince/mktime.c trunk/cegcc/src/mingw/mingwex/wince/strftime.c trunk/cegcc/src/mingw/mingwex/wince/tempnam.c trunk/cegcc/src/mingw/mingwex/wince/time.c trunk/cegcc/src/mingw/mingwex/wince/unlink.c trunk/cegcc/src/mingw/mingwex/wince/wcsftime.c Modified: trunk/cegcc/src/mingw/ChangeLog.mingw32ce =================================================================== --- trunk/cegcc/src/mingw/ChangeLog.mingw32ce 2006-10-22 17:46:45 UTC (rev 748) +++ trunk/cegcc/src/mingw/ChangeLog.mingw32ce 2006-10-22 17:59:25 UTC (rev 749) @@ -1,5 +1,32 @@ 2006-10-22 Pedro Alves <ped...@po...> + * configure.in [AC_CONFIG_SUBDIRS]: Add mingwex. + * configure : Regenerate. + * mingwex/Makefile.in (VPATH): Add wince subdir. + (WINCE_DISTFILES): New. + (WINCE_OBJS): New. + (LIB_OBJS): Special case for wince. Build WINCE_OBJS. + (dist): Install WINCE_DISTFILES. + * mingwex/wince: New subdir. + * mingwex/wince/time.c: New file. + * mingwex/wince/freopen.c: New file. + * mingwex/wince/unlink.c: New file. + * mingwex/wince/tempnam.c: New file. + * mingwex/wince/wcsftime.c: New file. + * mingwex/wince/gmtime.c: New file. + * mingwex/wince/asctime.c: New file. + * mingwex/wince/mktime.c: New file. + * mingwex/wince/localtime.c: New file. + * mingwex/wince/strftime.c: New file. + * include/time.h (time, mktime, asctime, + ctime, gmtime, localtime, strftime, wcsftime): Expose on __COREDLL__. + * include/stdio.h (freopen, _tempnam, + tempnam, _wtempnam): Likewise. + * include/io.h: Expose the header. Needed for unlink. + (_unlink, unlink): Expose functions on __COREDLL__. + +2006-10-22 Pedro Alves <ped...@po...> + * test_headers.c: Adapt to __COREDLL__. 2006-10-22 Pedro Alves <ped...@po...> Modified: trunk/cegcc/src/mingw/configure =================================================================== --- trunk/cegcc/src/mingw/configure 2006-10-22 17:46:45 UTC (rev 748) +++ trunk/cegcc/src/mingw/configure 2006-10-22 17:59:25 UTC (rev 749) @@ -272,7 +272,7 @@ PACKAGE_BUGREPORT= ac_unique_file="dllmain.c" -ac_subdirs_all="$ac_subdirs_all profile" +ac_subdirs_all="$ac_subdirs_all profile mingwex" ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS CC ac_ct_CC CFLAGS LDFLAGS CPPFLAGS EXEEXT OBJEXT all_dlls_host install_dlls_host AR ac_ct_AR AS ac_ct_AS RANLIB ac_ct_RANLIB LD ac_ct_LD DLLTOOL ac_ct_DLLTOOL DLLWRAP ac_ct_DLLWRAP WINDRES ac_ct_WINDRES ALLOCA CPP EGREP build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os subdirs MKINSTALLDIRS MNO_CYGWIN THREAD_DLL LIBM_A LIBGMON_A HEADER_SUBDIR W32API_INCLUDE DLL_ENTRY MINGWEX_DIR INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA LIBOBJS LTLIBOBJS' ac_subst_files='' @@ -906,7 +906,7 @@ else echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi - cd $ac_popdir + cd "$ac_popdir" done fi @@ -1903,8 +1903,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -1962,8 +1961,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -2079,8 +2077,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -2134,8 +2131,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -2180,8 +2176,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -2225,8 +2220,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -3128,8 +3122,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -3210,8 +3203,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -3352,8 +3344,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -3573,10 +3564,9 @@ -subdirs="$subdirs profile" +subdirs="$subdirs profile mingwex" - case "$target_os" in *cygwin*) MNO_CYGWIN=-mno-cygwin @@ -4543,11 +4533,6 @@ *) ac_INSTALL=$ac_top_builddir$INSTALL ;; esac - if test x"$ac_file" != x-; then - { echo "$as_me:$LINENO: creating $ac_file" >&5 -echo "$as_me: creating $ac_file" >&6;} - rm -f "$ac_file" - fi # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ @@ -4586,6 +4571,12 @@ fi;; esac done` || { (exit 1); exit 1; } + + if test x"$ac_file" != x-; then + { echo "$as_me:$LINENO: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} + rm -f "$ac_file" + fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF sed "$ac_vpsub @@ -4818,7 +4809,7 @@ { (exit 1); exit 1; }; } fi - cd $ac_popdir + cd "$ac_popdir" done fi Modified: trunk/cegcc/src/mingw/configure.in =================================================================== --- trunk/cegcc/src/mingw/configure.in 2006-10-22 17:46:45 UTC (rev 748) +++ trunk/cegcc/src/mingw/configure.in 2006-10-22 17:59:25 UTC (rev 749) @@ -54,18 +54,8 @@ W32API_INCLUDE='-I $(srcdir)/../w32api/include' -AC_CONFIG_SUBDIRS(profile) +AC_CONFIG_SUBDIRS(profile mingwex) -dnl case "$target_os" in -dnl *cegcc* | *mingw32ce*) -dnl #subdirs not ported yet. -dnl AC_CONFIG_SUBDIRS(profile) -dnl ;; -dnl *) -dnl AC_CONFIG_SUBDIRS(profile mingwex) -dnl ;; -dnl esac - case "$target_os" in *cygwin*) MNO_CYGWIN=-mno-cygwin Modified: trunk/cegcc/src/mingw/include/io.h =================================================================== --- trunk/cegcc/src/mingw/include/io.h 2006-10-22 17:46:45 UTC (rev 748) +++ trunk/cegcc/src/mingw/include/io.h 2006-10-22 17:59:25 UTC (rev 749) @@ -8,15 +8,9 @@ * */ -#ifdef __COREDLL__ -# include_next <io.h> -#else /* __COREDLL__ */ - #ifndef _IO_H_ #define _IO_H_ -#ifndef __COREDLL__ - /* All the headers include this file. */ #include <_mingw.h> @@ -27,6 +21,8 @@ #include <sys/types.h> /* To get time_t. */ #include <stdint.h> /* For intptr_t. */ +#ifndef __COREDLL__ + /* * Attributes of files as returned by _findfirst et al. */ @@ -38,7 +34,6 @@ #define _A_SUBDIR 0x00000010 #define _A_ARCH 0x00000020 - #ifndef RC_INVOKED #ifndef _FSIZE_T_DEFINED @@ -118,6 +113,8 @@ #define _WFINDDATA_T_DEFINED #endif +#endif /* __COREDLL__ */ + #ifdef __cplusplus extern "C" { #endif @@ -129,6 +126,9 @@ * and 0 if a match was found. Call _findclose when you are finished. */ /* FIXME: Should these all use intptr_t, as per recent MSDN docs? */ + +#ifndef __COREDLL__ + _CRTIMP long __cdecl _findfirst (const char*, struct _finddata_t*); _CRTIMP int __cdecl _findnext (long, struct _finddata_t*); _CRTIMP int __cdecl _findclose (long); @@ -140,6 +140,8 @@ _CRTIMP int __cdecl _rmdir (const char*); _CRTIMP int __cdecl _chmod (const char*, int); +#endif /* __COREDLL__ */ + #ifdef __MSVCRT__ _CRTIMP __int64 __cdecl _filelengthi64(int); _CRTIMP long __cdecl _findfirsti64(const char*, struct _finddatai64_t*); @@ -163,14 +165,14 @@ #ifndef _NO_OLDNAMES -#ifndef _UWIN +#if !defined (_UWIN) && !defined (__COREDLL__) _CRTIMP int __cdecl chdir (const char*); _CRTIMP char* __cdecl getcwd (char*, int); _CRTIMP int __cdecl mkdir (const char*); _CRTIMP char* __cdecl mktemp (char*); _CRTIMP int __cdecl rmdir (const char*); _CRTIMP int __cdecl chmod (const char*, int); -#endif /* _UWIN */ +#endif /* _UWIN && __COREDLL__ */ #endif /* Not _NO_OLDNAMES */ @@ -197,6 +199,8 @@ extern "C" { #endif +#ifndef __COREDLL__ + _CRTIMP int __cdecl _access (const char*, int); _CRTIMP int __cdecl _chsize (int, long); _CRTIMP int __cdecl _close (int); @@ -241,8 +245,11 @@ _CRTIMP long __cdecl _tell (int); /* Should umask be in sys/stat.h and/or sys/types.h instead? */ _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 */ @@ -274,6 +281,7 @@ */ #ifndef _UWIN +#ifndef __COREDLL__ _CRTIMP int __cdecl access (const char*, int); _CRTIMP int __cdecl chsize (int, long ); _CRTIMP int __cdecl close (int); @@ -290,8 +298,11 @@ _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. */ @@ -317,8 +328,4 @@ #endif /* Not RC_INVOKED */ -#endif /* __COREDLL__ */ - #endif /* _IO_H_ not defined */ - -#endif /* Not __COREDLL__ */ Modified: trunk/cegcc/src/mingw/include/stdio.h =================================================================== --- trunk/cegcc/src/mingw/include/stdio.h 2006-10-22 17:46:45 UTC (rev 748) +++ trunk/cegcc/src/mingw/include/stdio.h 2006-10-22 17:59:25 UTC (rev 749) @@ -196,9 +196,7 @@ * File Operations */ _CRTIMP FILE* __cdecl fopen (const char*, const char*); -#ifndef __COREDLL__ _CRTIMP FILE* __cdecl freopen (const char*, const char*, FILE*); -#endif _CRTIMP int __cdecl fflush (FILE*); _CRTIMP int __cdecl fclose (FILE*); @@ -208,17 +206,19 @@ _CRTIMP int __cdecl rename (const char*, const char*); _CRTIMP FILE* __cdecl tmpfile (void); _CRTIMP char* __cdecl tmpnam (char*); - +#endif /* __COREDLL__ */ #ifndef __STRICT_ANSI__ _CRTIMP char* __cdecl _tempnam (const char*, const char*); +#ifndef __COREDLL__ _CRTIMP int __cdecl _rmtmp(void); - +#endif /* __COREDLL__ */ #ifndef NO_OLDNAMES _CRTIMP char* __cdecl tempnam (const char*, const char*); -_CRTIMP int __cdecl rmtmp(void); -#endif +#ifndef __COREDLL__ +CRTIMP int __cdecl rmtmp(void); +#endif /* __COREDLL__ */ +#endif /* NO_OLDNAMES */ #endif /* __STRICT_ANSI__ */ -#endif /* Not __COREDLL__ */ _CRTIMP int __cdecl setvbuf (FILE*, char*, int, size_t); @@ -522,6 +522,7 @@ #endif /* __MSVCRT__ */ #ifdef __COREDLL__ +_CRTIMP wchar_t* __cdecl _wtempnam (const wchar_t*, const wchar_t*); __CRT_INLINE wint_t __cdecl getwc(FILE* f) { return fgetwc(f); } __CRT_INLINE wint_t __cdecl putwc(wint_t c, FILE* f) { return fputwc(c, f); } #endif Modified: trunk/cegcc/src/mingw/include/time.h =================================================================== --- trunk/cegcc/src/mingw/include/time.h 2006-10-22 17:46:45 UTC (rev 748) +++ trunk/cegcc/src/mingw/include/time.h 2006-10-22 17:59:25 UTC (rev 749) @@ -83,9 +83,9 @@ #ifndef __COREDLL__ _CRTIMP clock_t __cdecl clock (void); +#endif _CRTIMP time_t __cdecl time (time_t*); _CRTIMP time_t __cdecl mktime (struct tm*); -#endif _CRTIMP double __cdecl difftime (time_t, time_t); /* @@ -98,14 +98,12 @@ * Fault and crap out your program. Guess how I know. Hint: stat called on * a directory gives 'invalid' times in st_atime etc... */ -#ifndef __COREDLL__ _CRTIMP char* __cdecl asctime (const struct tm*); _CRTIMP char* __cdecl ctime (const time_t*); _CRTIMP struct tm* __cdecl gmtime (const time_t*); _CRTIMP struct tm* __cdecl localtime (const time_t*); _CRTIMP size_t __cdecl strftime (char*, size_t, const char*, const struct tm*); -#endif #ifndef __STRICT_ANSI__ @@ -210,9 +208,7 @@ #endif #endif /* __MSVCRT__ */ #endif /* __STRICT_ANSI__ */ -#ifndef __COREDLL__ _CRTIMP size_t __cdecl wcsftime (wchar_t*, size_t, const wchar_t*, const struct tm*); -#endif #define _WTIME_DEFINED #endif /* _WTIME_DEFINED */ Modified: trunk/cegcc/src/mingw/mingwex/Makefile.in =================================================================== --- trunk/cegcc/src/mingw/mingwex/Makefile.in 2006-10-22 17:46:45 UTC (rev 748) +++ trunk/cegcc/src/mingw/mingwex/Makefile.in 2006-10-22 17:59:25 UTC (rev 749) @@ -4,7 +4,7 @@ # This makefile requires GNU make. srcdir = @srcdir@ -VPATH = $(srcdir):$(srcdir)/math:$(srcdir)/stdio:$(srcdir)/complex +VPATH = $(srcdir):$(srcdir)/math:$(srcdir)/stdio:$(srcdir)/complex:$(srcdir)/wince objdir = . target_alias = @target_alias@ @@ -83,6 +83,10 @@ csinl.c csinh.c csinhf.c csinhl.c csqrt.c csqrtf.c csqrtl.c \ ctan.c ctanf.c ctanl.c ctanh.c ctanhf.c ctanhl.c +WINCE_DISTFILES = \ + asctime.c freopen.c gmtime.c localtime.c mktime.c strftime.c time.c \ + tempnam.c unlink.c wcsftime.c + CC = @CC@ # FIXME: Which is it, CC or CC_FOR_TARGET? CC_FOR_TARGET = $(CC) @@ -179,10 +183,17 @@ cprojf.o cprojl.o creal.o crealf.o creall.o csin.o csinf.o \ csinl.o csinh.o csinhf.o csinhl.o csqrt.o csqrtf.o csqrtl.o \ 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 +ifneq (,$(findstring wince,$(target_alias))) +LIB_OBJS = $(WINCE_OBJS) +else LIB_OBJS = $(Q8_OBJS) $(CTYPE_OBJS) $(STDLIB_OBJS) $(STDLIB_STUB_OBJS) \ $(STDIO_OBJS) $(MATH_OBJS) $(FENV_OBJS) \ $(POSIX_OBJS) $(REPLACE_OBJS) $(COMPLEX_OBJS) +endif LIBS = $(LIBMINGWEX_A) DLLS = @@ -261,4 +272,9 @@ @for i in $(COMPLEX_DISTFILES); do\ cp -p $(srcdir)/complex/$$i $(distdir)/mingwex/complex/$$i ; \ done + mkdir $(distdir)/mingwex/wince + chmod 755 $(distdir)/mingwex/wince + @for i in $(WINCE_DISTFILES); do\ + cp -p $(srcdir)/complex/$$i $(distdir)/mingwex/wince/$$i ; \ + done Added: trunk/cegcc/src/mingw/mingwex/wince/asctime.c =================================================================== --- trunk/cegcc/src/mingw/mingwex/wince/asctime.c (rev 0) +++ trunk/cegcc/src/mingw/mingwex/wince/asctime.c 2006-10-22 17:59:25 UTC (rev 749) @@ -0,0 +1,22 @@ +#include <windows.h> +#include <stdio.h> +#include <time.h> + +static const char const wday_name[7][3] = + { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" }; + +static const char const mon_name[12][3] = { + "Jan", "Feb", "Mar", "Apr", "May", "Jun", + "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" +}; + +char * +asctime (const struct tm *timeptr) +{ + static char result[26]; + sprintf (result, "%.3s %.3s%3d %.2d:%.2d:%.2d %d\n", + wday_name[timeptr->tm_wday], mon_name[timeptr->tm_mon], + timeptr->tm_mday, timeptr->tm_hour, timeptr->tm_min, + timeptr->tm_sec, 1900 + timeptr->tm_year); + return result; +} Property changes on: trunk/cegcc/src/mingw/mingwex/wince/asctime.c ___________________________________________________________________ Name: svn:eol-style + native Added: trunk/cegcc/src/mingw/mingwex/wince/freopen.c =================================================================== --- trunk/cegcc/src/mingw/mingwex/wince/freopen.c (rev 0) +++ trunk/cegcc/src/mingw/mingwex/wince/freopen.c 2006-10-22 17:59:25 UTC (rev 749) @@ -0,0 +1,24 @@ +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +#define MAX_MODE 64 + +FILE * +freopen (const char *__restrict__ filename, + const char *__restrict__ mode, FILE * __restrict__ stream) +{ + size_t sizef = strlen (filename) + 1; + size_t sizem = strlen (mode) + 1; + + wchar_t wfilename[MAX_PATH]; + wchar_t wmode[MAX_MODE]; + + if (sizem > MAX_MODE || sizef > MAX_PATH) + return NULL; + + mbstowcs (wfilename, filename, sizef); + mbstowcs (wmode, mode, sizem); + + return _wfreopen (wfilename, wmode, stream); +} Property changes on: trunk/cegcc/src/mingw/mingwex/wince/freopen.c ___________________________________________________________________ Name: svn:eol-style + native Added: trunk/cegcc/src/mingw/mingwex/wince/gmtime.c =================================================================== --- trunk/cegcc/src/mingw/mingwex/wince/gmtime.c (rev 0) +++ trunk/cegcc/src/mingw/mingwex/wince/gmtime.c 2006-10-22 17:59:25 UTC (rev 749) @@ -0,0 +1,78 @@ +#include <windows.h> +#include <stdio.h> +#include <time.h> + +static struct tm mytm; + +static const int DMonth[13] = + { 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365 }; + +static const int monthCodes[12] = { 6, 2, 2, 5, 0, 3, 5, 1, 4, 6, 2, 4 }; + +static int +calc_day_of_week (const struct tm *nTM) +{ + int day; + + day = (nTM->tm_year % 100); + day += day / 4; + day += monthCodes[nTM->tm_mon]; + day += nTM->tm_mday; + while (day >= 7) + day -= 7; + + return day; +} + +struct tm * +gmtime (const time_t * timer) +{ + unsigned long x = *timer; + int imin, ihrs, iday, iyrs; + int sec, min, hrs, day, mon, yrs; + int lday, qday, jday, mday; + + imin = x / 60; // whole minutes since 1/1/70 + sec = x - (60 * imin); // leftover seconds + ihrs = imin / 60; // whole hours since 1/1/70 + min = imin - 60 * ihrs; // leftover minutes + iday = ihrs / 24; // whole days since 1/1/70 + hrs = ihrs - 24 * iday; // leftover hours + iday = iday + 365 + 366; // whole days since 1/1/68 + lday = iday / ((4 * 365) + 1); // quadyr = 4 yr period = 1461 days + qday = iday % ((4 * 365) + 1); // days since current quadyr began + if (qday >= (31 + 29)) // if past feb 29 then + lday = lday + 1; // add this quadyr\x92s leap day to the + // # of quadyrs (leap days) since 68 + iyrs = (iday - lday) / 365; // whole years since 1968 + jday = iday - (iyrs * 365) - lday; // days since 1 /1 of current year. + if (qday <= 365 && qday >= 60) // if past 2/29 and a leap year then + jday = jday + 1; // add a leap day to the # of whole + // days since 1/1 of current year + yrs = iyrs + 1968; // compute year + mon = 13; // estimate month ( +1) + mday = 366; // max days since 1/1 is 365 + while (jday < mday) // mday = # of days passed from 1/1 + { // until first day of current month + mon = mon - 1; // mon = month (estimated) + mday = DMonth[mon]; // # elapsed days at first of mon + if ((mon > 2) && (yrs % 4) == 0) // if past 2/29 and leap year then + mday = mday + 1; // add leap day + // compute month by decrementing + } // month until found + + day = jday - mday + 1; // compute day of month + + mytm.tm_sec = sec; + mytm.tm_min = min; + mytm.tm_hour = hrs; + mytm.tm_mday = day; + mytm.tm_mon = mon; + mytm.tm_year = yrs - 1900; + + mytm.tm_wday = calc_day_of_week (&mytm); + mytm.tm_yday = jday; + mytm.tm_isdst = 0; + + return &mytm; +} Property changes on: trunk/cegcc/src/mingw/mingwex/wince/gmtime.c ___________________________________________________________________ Name: svn:eol-style + native Added: trunk/cegcc/src/mingw/mingwex/wince/localtime.c =================================================================== --- trunk/cegcc/src/mingw/mingwex/wince/localtime.c (rev 0) +++ trunk/cegcc/src/mingw/mingwex/wince/localtime.c 2006-10-22 17:59:25 UTC (rev 749) @@ -0,0 +1,7 @@ +#include <time.h> + +struct tm * +localtime (const time_t * timer) +{ + return gmtime (timer); +} Property changes on: trunk/cegcc/src/mingw/mingwex/wince/localtime.c ___________________________________________________________________ Name: svn:eol-style + native Added: trunk/cegcc/src/mingw/mingwex/wince/mktime.c =================================================================== --- trunk/cegcc/src/mingw/mingwex/wince/mktime.c (rev 0) +++ trunk/cegcc/src/mingw/mingwex/wince/mktime.c 2006-10-22 17:59:25 UTC (rev 749) @@ -0,0 +1,38 @@ +#include <windows.h> +#include <stdio.h> +#include <time.h> + +static const int month_to_day[12] = + { 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334 }; + +time_t +mktime (struct tm *t) +{ + short month, year; + time_t result; + + month = t->tm_mon; + year = t->tm_year + month / 12 + 1900; + month %= 12; + if (month < 0) + { + year -= 1; + month += 12; + } + result = (year - 1970) * 365 + (year - 1969) / 4 + month_to_day[month]; + result = (year - 1970) * 365 + month_to_day[month]; + if (month <= 1) + year -= 1; + result += (year - 1968) / 4; + result -= (year - 1900) / 100; + result += (year - 1600) / 400; + result += t->tm_mday; + result -= 1; + result *= 24; + result += t->tm_hour; + result *= 60; + result += t->tm_min; + result *= 60; + result += t->tm_sec; + return (result); +} Property changes on: trunk/cegcc/src/mingw/mingwex/wince/mktime.c ___________________________________________________________________ Name: svn:eol-style + native Added: trunk/cegcc/src/mingw/mingwex/wince/strftime.c =================================================================== --- trunk/cegcc/src/mingw/mingwex/wince/strftime.c (rev 0) +++ trunk/cegcc/src/mingw/mingwex/wince/strftime.c 2006-10-22 17:59:25 UTC (rev 749) @@ -0,0 +1,457 @@ +#include <windows.h> +#include <stdio.h> +#include <time.h> + +/* strftime() - taken from OpenBSD. */ + +#define IN_NONE 0 +#define IN_SOME 1 +#define IN_THIS 2 +#define IN_ALL 3 +#define CHAR_BIT 8 + +#define TYPE_BIT(type) (sizeof (type) * CHAR_BIT) +#define TYPE_SIGNED(type) (((type) -1) < 0) + +#define INT_STRLEN_MAXIMUM(type) \ + ((TYPE_BIT(type) - TYPE_SIGNED(type)) * 302 / 1000 + 1 + TYPE_SIGNED(type)) + +#define isleap(y) (((y) % 4) == 0 && (((y) % 100) != 0 || ((y) % 400) == 0)) + +#define MONSPERYEAR 12 +#define DAYSPERWEEK 7 +#define TM_YEAR_BASE 1900 +#define HOURSPERDAY 24 +#define DAYSPERNYEAR 365 +#define DAYSPERLYEAR 366 + +static char wildabbr[] = "WILDABBR"; + +static char *tzname[2] = +{ + wildabbr, + wildabbr +}; + + +#define Locale (&C_time_locale) + +struct lc_time_T +{ + const char *mon[MONSPERYEAR]; + const char *month[MONSPERYEAR]; + const char *wday[DAYSPERWEEK]; + const char *weekday[DAYSPERWEEK]; + const char *X_fmt; + const char *x_fmt; + const char *c_fmt; + const char *am; + const char *pm; + const char *date_fmt; +}; + +static const struct lc_time_T C_time_locale = { + { + "Jan", "Feb", "Mar", "Apr", "May", "Jun", + "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" + }, { + "January", "February", "March", "April", "May", "June", + "July", "August", "September", "October", "November", "December" + }, { + "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" + }, { + "Sunday", "Monday", "Tuesday", "Wednesday", + "Thursday", "Friday", "Saturday" + }, + + /* X_fmt */ + "%H:%M:%S", + + /* + ** x_fmt + ** C99 requires this format. + ** Using just numbers (as here) makes Quakers happier; + ** it's also compatible with SVR4. + */ + "%m/%d/%y", + + /* + ** c_fmt + ** C99 requires this format. + ** Previously this code used "%D %X", but we now conform to C99. + ** Note that + ** "%a %b %d %H:%M:%S %Y" + ** is used by Solaris 2.3. + */ + "%a %b %e %T %Y", + + /* am */ + "AM", + + /* pm */ + "PM", + + /* date_fmt */ + "%a %b %e %H:%M:%S %Z %Y" +}; + + +static char * +_add (const char *str, char *pt, const char *const ptlim) +{ + while (pt < ptlim && (*pt = *str++) != '\0') + ++pt; + return pt; +} + + +static char * +_conv (const int n, const char *const format, char *const pt, + const char *const ptlim) +{ + char buf[INT_STRLEN_MAXIMUM (int) + 1]; + + (void) _snprintf (buf, sizeof (buf), format, n); + return _add (buf, pt, ptlim); +} + + +static char * +_fmt (const char *format, const struct tm *const t, char *pt, + const char *const ptlim, int *warnp) +{ + for (; *format; ++format) + { + if (*format == '%') + { + label: + switch (*++format) + { + case '\0': + --format; + break; + case 'A': + pt = _add ((t->tm_wday < 0 || + t->tm_wday >= DAYSPERWEEK) ? + "?" : Locale->weekday[t->tm_wday], pt, ptlim); + continue; + case 'a': + pt = _add ((t->tm_wday < 0 || + t->tm_wday >= DAYSPERWEEK) ? + "?" : Locale->wday[t->tm_wday], pt, ptlim); + continue; + case 'B': + pt = _add ((t->tm_mon < 0 || + t->tm_mon >= MONSPERYEAR) ? + "?" : Locale->month[t->tm_mon], pt, ptlim); + continue; + case 'b': + case 'h': + pt = _add ((t->tm_mon < 0 || + t->tm_mon >= MONSPERYEAR) ? + "?" : Locale->mon[t->tm_mon], pt, ptlim); + continue; + case 'C': + /* + ** %C used to do a... + ** _fmt("%a %b %e %X %Y", t); + ** ...whereas now POSIX 1003.2 calls for + ** something completely different. + ** (ado, 1993-05-24) + */ + pt = _conv ((t->tm_year + TM_YEAR_BASE) / 100, + "%02d", pt, ptlim); + continue; + case 'c': + { + int warn2 = IN_SOME; + + pt = _fmt (Locale->c_fmt, t, pt, ptlim, warnp); + if (warn2 == IN_ALL) + warn2 = IN_THIS; + if (warn2 > *warnp) + *warnp = warn2; + } + continue; + case 'D': + pt = _fmt ("%m/%d/%y", t, pt, ptlim, warnp); + continue; + case 'd': + pt = _conv (t->tm_mday, "%02d", pt, ptlim); + continue; + case 'E': + case 'O': + /* + ** C99 locale modifiers. + ** The sequences + ** %Ec %EC %Ex %EX %Ey %EY + ** %Od %oe %OH %OI %Om %OM + ** %OS %Ou %OU %OV %Ow %OW %Oy + ** are supposed to provide alternate + ** representations. + */ + goto label; + case 'e': + pt = _conv (t->tm_mday, "%2d", pt, ptlim); + continue; + case 'F': + pt = _fmt ("%Y-%m-%d", t, pt, ptlim, warnp); + continue; + case 'H': + pt = _conv (t->tm_hour, "%02d", pt, ptlim); + continue; + case 'I': + pt = _conv ((t->tm_hour % 12) ? + (t->tm_hour % 12) : 12, "%02d", pt, ptlim); + continue; + case 'j': + pt = _conv (t->tm_yday + 1, "%03d", pt, ptlim); + continue; + case 'k': + /* + ** This used to be... + ** _conv(t->tm_hour % 12 ? + ** t->tm_hour % 12 : 12, 2, ' '); + ** ...and has been changed to the below to + ** match SunOS 4.1.1 and Arnold Robbins' + ** strftime version 3.0. That is, "%k" and + ** "%l" have been swapped. + ** (ado, 1993-05-24) + */ + pt = _conv (t->tm_hour, "%2d", pt, ptlim); + continue; +#ifdef KITCHEN_SINK + case 'K': + /* + ** After all this time, still unclaimed! + */ + pt = _add ("kitchen sink", pt, ptlim); + continue; +#endif /* defined KITCHEN_SINK */ + case 'l': + /* + ** This used to be... + ** _conv(t->tm_hour, 2, ' '); + ** ...and has been changed to the below to + ** match SunOS 4.1.1 and Arnold Robbin's + ** strftime version 3.0. That is, "%k" and + ** "%l" have been swapped. + ** (ado, 1993-05-24) + */ + pt = _conv ((t->tm_hour % 12) ? + (t->tm_hour % 12) : 12, "%2d", pt, ptlim); + continue; + case 'M': + pt = _conv (t->tm_min, "%02d", pt, ptlim); + continue; + case 'm': + pt = _conv (t->tm_mon + 1, "%02d", pt, ptlim); + continue; + case 'n': + pt = _add ("\n", pt, ptlim); + continue; + case 'p': + pt = _add ((t->tm_hour >= (HOURSPERDAY / 2)) ? + Locale->pm : Locale->am, pt, ptlim); + continue; + case 'R': + pt = _fmt ("%H:%M", t, pt, ptlim, warnp); + continue; + case 'r': + pt = _fmt ("%I:%M:%S %p", t, pt, ptlim, warnp); + continue; + case 'S': + pt = _conv (t->tm_sec, "%02d", pt, ptlim); + continue; + case 's': + { + struct tm tm; + char buf[INT_STRLEN_MAXIMUM (time_t) + 1]; + time_t mkt; + + tm = *t; + mkt = mktime (&tm); + if (TYPE_SIGNED (time_t)) + (void) _snprintf (buf, sizeof buf, "%ld", (long) mkt); + else + (void) _snprintf (buf, sizeof buf, + "%lu", (unsigned long) mkt); + pt = _add (buf, pt, ptlim); + } + continue; + case 'T': + pt = _fmt ("%H:%M:%S", t, pt, ptlim, warnp); + continue; + case 't': + pt = _add ("\t", pt, ptlim); + continue; + case 'U': + pt = _conv ((t->tm_yday + DAYSPERWEEK - + t->tm_wday) / DAYSPERWEEK, "%02d", pt, ptlim); + continue; + case 'u': + /* + ** From Arnold Robbins' strftime version 3.0: + ** "ISO 8601: Weekday as a decimal number + ** [1 (Monday) - 7]" + ** (ado, 1993-05-24) + */ + pt = _conv ((t->tm_wday == 0) ? + DAYSPERWEEK : t->tm_wday, "%d", pt, ptlim); + continue; + case 'V': /* ISO 8601 week number */ + case 'G': /* ISO 8601 year (four digits) */ + case 'g': /* ISO 8601 year (two digits) */ + { + int year; + int yday; + int wday; + int w; + + year = t->tm_year + TM_YEAR_BASE; + yday = t->tm_yday; + wday = t->tm_wday; + for (;;) + { + int len; + int bot; + int top; + + len = isleap (year) ? DAYSPERLYEAR : DAYSPERNYEAR; + /* + ** What yday (-3 ... 3) does + ** the ISO year begin on? + */ + bot = ((yday + 11 - wday) % DAYSPERWEEK) - 3; + /* + ** What yday does the NEXT + ** ISO year begin on? + */ + top = bot - (len % DAYSPERWEEK); + if (top < -3) + top += DAYSPERWEEK; + top += len; + if (yday >= top) + { + ++year; + w = 1; + break; + } + if (yday >= bot) + { + w = 1 + ((yday - bot) / DAYSPERWEEK); + break; + } + --year; + yday += isleap (year) ? DAYSPERLYEAR : DAYSPERNYEAR; + } + if (*format == 'V') + pt = _conv (w, "%02d", pt, ptlim); + else if (*format == 'g') + { + *warnp = IN_ALL; + pt = _conv (year % 100, "%02d", pt, ptlim); + } + else + pt = _conv (year, "%04d", pt, ptlim); + } + continue; + case 'v': + pt = _fmt ("%e-%b-%Y", t, pt, ptlim, warnp); + continue; + case 'W': + pt = _conv ((t->tm_yday + DAYSPERWEEK - + (t->tm_wday ? + (t->tm_wday - 1) : + (DAYSPERWEEK - 1))) / DAYSPERWEEK, + "%02d", pt, ptlim); + continue; + case 'w': + pt = _conv (t->tm_wday, "%d", pt, ptlim); + continue; + case 'X': + pt = _fmt (Locale->X_fmt, t, pt, ptlim, warnp); + continue; + case 'x': + { + int warn2 = IN_SOME; + + pt = _fmt (Locale->x_fmt, t, pt, ptlim, &warn2); + if (warn2 == IN_ALL) + warn2 = IN_THIS; + if (warn2 > *warnp) + *warnp = warn2; + } + continue; + case 'y': + *warnp = IN_ALL; + pt = _conv ((t->tm_year + TM_YEAR_BASE) % 100, + "%02d", pt, ptlim); + continue; + case 'Y': + pt = _conv (t->tm_year + TM_YEAR_BASE, "%04d", pt, ptlim); + continue; + case 'Z': + if (t->tm_isdst >= 0) + pt = _add (tzname[t->tm_isdst != 0], pt, ptlim); + /* + ** C99 says that %Z must be replaced by the + ** empty string if the time zone is not + ** determinable. + */ + continue; + case 'z': + { + int diff; + char const *sign; + + if (t->tm_isdst < 0) + continue; + continue; + if (diff < 0) + { + sign = "-"; + diff = -diff; + } + else + sign = "+"; + pt = _add (sign, pt, ptlim); + diff /= 60; + pt = _conv ((diff / 60) * 100 + diff % 60, "%04d", pt, ptlim); + } + continue; + case '+': + pt = _fmt (Locale->date_fmt, t, pt, ptlim, warnp); + continue; + case '%': + default: + break; + } + } + if (pt == ptlim) + break; + *pt++ = *format; + } + return pt; +} + + +size_t +strftime (char *const s, const size_t maxsize, + const char *const format, const struct tm * const t) +{ + char *p; + int warn; + + warn = IN_NONE; + p = _fmt (((format == NULL) ? "%c" : format), t, s, s + maxsize, &warn); + + if (p == s + maxsize) + { + if (maxsize > 0) + s[maxsize - 1] = '\0'; + return 0; + } + *p = '\0'; + return p - s; +} Property changes on: trunk/cegcc/src/mingw/mingwex/wince/strftime.c ___________________________________________________________________ Name: svn:eol-style + native Added: trunk/cegcc/src/mingw/mingwex/wince/tempnam.c =================================================================== --- trunk/cegcc/src/mingw/mingwex/wince/tempnam.c (rev 0) +++ trunk/cegcc/src/mingw/mingwex/wince/tempnam.c 2006-10-22 17:59:25 UTC (rev 749) @@ -0,0 +1,54 @@ +#include <stdio.h> +#include <windows.h> + +typedef void *(*dupfun_t) (wchar_t *); + +static void * +tempnam_imp (const wchar_t * dir, const wchar_t * prefix, dupfun_t dupfun) +{ + wchar_t tmpbuf[MAX_PATH]; + wchar_t tmp_dir[MAX_PATH]; + + DWORD ret = GetTempPathW (MAX_PATH, tmp_dir); + if (ret > 0 && ret <= MAX_PATH) + { + dir = tmp_dir; + } + + if (!dir || !*dir || !(GetFileAttributes (dir) & FILE_ATTRIBUTE_DIRECTORY)) + { + dir = _wP_tmpdir; + } + + if (GetTempFileNameW (dir, prefix, 0, tmpbuf)) + { + DeleteFileW (tmpbuf); + return dupfun (tmpbuf); + } + return NULL; +} + +static void * +wcstombs_dup (wchar_t * str) +{ + size_t len = wcslen (str) + 1; + char *s = malloc (len); + wcstombs (s, str, len); + return s; +} + +wchar_t * +_wtempnam (const wchar_t * dir, const wchar_t * prefix) +{ + return tempnam_imp (dir, prefix, (dupfun_t) wcsdup); +} + +char * +_tempnam (const char *dir, const char *prefix) +{ + wchar_t wdir[MAX_PATH]; + wchar_t wprefix[MAX_PATH]; + mbstowcs (wdir, dir, MAX_PATH); + mbstowcs (wprefix, prefix, MAX_PATH); + return tempnam_imp (wdir, wprefix, wcstombs_dup); +} Property changes on: trunk/cegcc/src/mingw/mingwex/wince/tempnam.c ___________________________________________________________________ Name: svn:eol-style + native Added: trunk/cegcc/src/mingw/mingwex/wince/time.c =================================================================== --- trunk/cegcc/src/mingw/mingwex/wince/time.c (rev 0) +++ trunk/cegcc/src/mingw/mingwex/wince/time.c 2006-10-22 17:59:25 UTC (rev 749) @@ -0,0 +1,27 @@ +#include <time.h> +#include <windows.h> + +time_t +time (time_t * timer) +{ + SYSTEMTIME systime; + struct tm tmtime; + time_t tt; + + GetLocalTime (&systime); + + tmtime.tm_year = systime.wYear - 1900; + tmtime.tm_mon = systime.wMonth - 1; + tmtime.tm_mday = systime.wDay; + tmtime.tm_wday = systime.wDayOfWeek; + tmtime.tm_hour = systime.wHour; + tmtime.tm_min = systime.wMinute; + tmtime.tm_sec = systime.wSecond; + + tt = mktime (&tmtime); + + if (timer) + *timer = tt; + + return tt; +} Property changes on: trunk/cegcc/src/mingw/mingwex/wince/time.c ___________________________________________________________________ Name: svn:eol-style + native Added: trunk/cegcc/src/mingw/mingwex/wince/unlink.c =================================================================== --- trunk/cegcc/src/mingw/mingwex/wince/unlink.c (rev 0) +++ trunk/cegcc/src/mingw/mingwex/wince/unlink.c 2006-10-22 17:59:25 UTC (rev 749) @@ -0,0 +1,12 @@ +#include <stdio.h> +#include <windows.h> + +int +_unlink (const char *file) +{ + wchar_t wfile[MAX_PATH]; + size_t conv = mbstowcs (wfile, file, MAX_PATH); + if (conv > 0 && conv < MAX_PATH && DeleteFileW (wfile)) + return 0; + return -1; +} Property changes on: trunk/cegcc/src/mingw/mingwex/wince/unlink.c ___________________________________________________________________ Name: svn:eol-style + native Added: trunk/cegcc/src/mingw/mingwex/wince/wcsftime.c =================================================================== --- trunk/cegcc/src/mingw/mingwex/wince/wcsftime.c (rev 0) +++ trunk/cegcc/src/mingw/mingwex/wince/wcsftime.c 2006-10-22 17:59:25 UTC (rev 749) @@ -0,0 +1,21 @@ +#include <string.h> +#include <stdlib.h> +#include <time.h> + +size_t +wcsftime (wchar_t *const ws, const size_t maxsize, + const wchar_t *const wformat, const struct tm * const t) +{ + size_t format_size = wcslen (wformat) + 1; + char *format = malloc (format_size); + char *s = malloc (maxsize); + size_t ret; + + wcstombs (format, wformat, format_size); + ret = strftime (s, maxsize, format, t); + if (ret >= 0) + ret = mbstowcs (ws, s, ret); + free (format); + free (s); + return ret; +} Property changes on: trunk/cegcc/src/mingw/mingwex/wince/wcsftime.c ___________________________________________________________________ Name: svn:eol-style + native Modified: trunk/cegcc/src/mingw/moldname.def.in =================================================================== --- trunk/cegcc/src/mingw/moldname.def.in 2006-10-22 17:46:45 UTC (rev 748) +++ trunk/cegcc/src/mingw/moldname.def.in 2006-10-22 17:59:25 UTC (rev 749) @@ -130,16 +130,20 @@ swab #ifndef __COREDLL__ tell +#endif /* __COREDLL__ */ tempnam #if (__MSVCRT__) timezone DATA #endif +#ifndef __COREDLL__ ; export tzname for both. See <time.h> tzname DATA tzset umask ungetch +#endif /* __COREDLL__ */ unlink +#ifndef __COREDLL__ utime #endif /* __COREDLL__ */ wcsdup This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dan...@us...> - 2006-11-03 11:44:38
|
Revision: 772 http://svn.sourceforge.net/cegcc/?rev=772&view=rev Author: dannybackx Date: 2006-11-03 03:44:21 -0800 (Fri, 03 Nov 2006) Log Message: ----------- Port all this to both arm-wince-mingw32ce and arm-wince-cegcc . profile/gmon.c : Use the executable file name under CE to cook up the file name that we put monitoring information in. This used to be just "gmon.out", now if you run /apps/m1.exe it'll be /apps/m1.gmo Modified Paths: -------------- trunk/cegcc/src/mingw/ChangeLog.mingw32ce trunk/cegcc/src/mingw/atexit.c trunk/cegcc/src/mingw/include/ctype.h trunk/cegcc/src/mingw/include/stdio.h trunk/cegcc/src/mingw/include/wctype.h trunk/cegcc/src/mingw/profile/configure trunk/cegcc/src/mingw/profile/configure.in trunk/cegcc/src/mingw/profile/gmon.c trunk/cegcc/src/mingw/profile/profile.h Modified: trunk/cegcc/src/mingw/ChangeLog.mingw32ce =================================================================== --- trunk/cegcc/src/mingw/ChangeLog.mingw32ce 2006-11-03 11:40:54 UTC (rev 771) +++ trunk/cegcc/src/mingw/ChangeLog.mingw32ce 2006-11-03 11:44:21 UTC (rev 772) @@ -1,3 +1,14 @@ +2006-11-03 Danny Backx <dan...@us...> + + * profile/gmon.c : Use the executable file name under CE to cook up + the file name that we put monitoring information in. This used to + be just "gmon.out", now if you run /apps/m1.exe it'll be /apps/m1.gmo + + * atexit.c, include/wctype.h, include/stdio.h, include/ctype.h, + profile/configure, profile/gmon.c, profile/configure.in, + profile/profile.h : Port this code to both arm-wince-mingw32ce and + arm-wince-cegcc . + 2006-10-22 Pedro Alves <ped...@po...> * configure.in [AC_CONFIG_SUBDIRS]: Add mingwex. Modified: trunk/cegcc/src/mingw/atexit.c =================================================================== --- trunk/cegcc/src/mingw/atexit.c 2006-11-03 11:40:54 UTC (rev 771) +++ trunk/cegcc/src/mingw/atexit.c 2006-11-03 11:44:21 UTC (rev 772) @@ -65,7 +65,7 @@ first_atexit = (p_atexit_fn*) malloc (32 * sizeof (p_atexit_fn)); if (first_atexit == NULL ) /* can't allocate memory */ { -#ifndef __COREDLL__ +#if defined(__MINGW32CE__) && !defined(__COREDLL__) errno=ENOMEM; #endif return FALSE; Modified: trunk/cegcc/src/mingw/include/ctype.h =================================================================== --- trunk/cegcc/src/mingw/include/ctype.h 2006-11-03 11:40:54 UTC (rev 771) +++ trunk/cegcc/src/mingw/include/ctype.h 2006-11-03 11:44:21 UTC (rev 772) @@ -158,10 +158,12 @@ #ifdef __COREDLL__ # define __ISCTYPE(c, mask) _isctype(c, mask) -#else +#elif !defined(__CEGCC__) /* use simple lookup if SB locale, else _isctype() */ # define __ISCTYPE(c, mask) (MB_CUR_MAX == 1 ? (_pctype[c] & mask) : _isctype(c, mask)) #endif + +#ifdef __ISCTYPE __CRT_INLINE int __cdecl isalnum(int c) {return __ISCTYPE(c, (_ALPHA|_DIGIT));} __CRT_INLINE int __cdecl isalpha(int c) {return __ISCTYPE(c, _ALPHA);} __CRT_INLINE int __cdecl iscntrl(int c) {return __ISCTYPE(c, _CONTROL);} @@ -179,6 +181,7 @@ __CRT_INLINE int __cdecl isblank (int c) {return (__ISCTYPE(c, _BLANK) || c == '\t');} #endif +#endif /* __ISCTYPE */ /* these reproduce behaviour of lib underscored versions */ __CRT_INLINE int __cdecl _tolower(int c) {return ( c -'A'+'a');} @@ -252,7 +255,7 @@ __CRT_INLINE int __cdecl iswxdigit(wint_t wc) {return (iswctype(wc,_HEX));} #ifdef __COREDLL__ __CRT_INLINE int __cdecl isleadbyte(int c) {return IsDBCSLeadByte(c); } -#else +#elif !defined(__CEGCC__) __CRT_INLINE int __cdecl isleadbyte(int c) {return (_pctype[(unsigned char)(c)] & _LEADBYTE);} #endif #if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) \ Modified: trunk/cegcc/src/mingw/include/stdio.h =================================================================== --- trunk/cegcc/src/mingw/include/stdio.h 2006-11-03 11:40:54 UTC (rev 771) +++ trunk/cegcc/src/mingw/include/stdio.h 2006-11-03 11:44:21 UTC (rev 772) @@ -422,8 +422,9 @@ _CRTIMP FILE* __cdecl _fdopen (int, const char*); _CRTIMP FILE* __cdecl _fsopen(const char*, const char*, int); _CRTIMP int __cdecl _fileno (FILE*); +#else +_CRTIMP void* __cdecl _fileno (FILE*); #endif -_CRTIMP void* __cdecl _fileno (FILE*); _CRTIMP int __cdecl _fcloseall(void); #ifdef __MSVCRT__ _CRTIMP int __cdecl _getmaxstdio(void); Modified: trunk/cegcc/src/mingw/include/wctype.h =================================================================== --- trunk/cegcc/src/mingw/include/wctype.h 2006-11-03 11:40:54 UTC (rev 771) +++ trunk/cegcc/src/mingw/include/wctype.h 2006-11-03 11:44:21 UTC (rev 772) @@ -140,7 +140,7 @@ __CRT_INLINE int __cdecl iswxdigit(wint_t wc) {return (iswctype(wc,_HEX));} #ifdef __COREDLL__ __CRT_INLINE int __cdecl isleadbyte(int c) {return IsDBCSLeadByte(c); } -#else +#elif !defined(__CEGCC__) __CRT_INLINE int __cdecl isleadbyte(int c) {return (_pctype[(unsigned char)(c)] & _LEADBYTE);} #endif Modified: trunk/cegcc/src/mingw/profile/configure =================================================================== --- trunk/cegcc/src/mingw/profile/configure 2006-11-03 11:40:54 UTC (rev 771) +++ trunk/cegcc/src/mingw/profile/configure 2006-11-03 11:44:21 UTC (rev 772) @@ -1360,7 +1360,7 @@ # Do not build libm.a when building under Cygwin winsup. Otherwise, it'll # overwrite Cygwin's one. Likewise for libgmon.a. ;; -*mingw32ce*) +*cegcc* | *mingw32ce*) CRT_ID=3 MNO_CYGWIN= RUNTIME=coredll @@ -1577,10 +1577,9 @@ # 1. Remove the extension, and $U if already installed. ac_i=`echo "$ac_i" | sed 's/\$U\././;s/\.o$//;s/\.obj$//'` - # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR - # will be set to the directory where LIBOBJS objects are built. - ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" - ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' + # 2. Add them. + ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext" + ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo' done LIBOBJS=$ac_libobjs Modified: trunk/cegcc/src/mingw/profile/configure.in =================================================================== --- trunk/cegcc/src/mingw/profile/configure.in 2006-11-03 11:40:54 UTC (rev 771) +++ trunk/cegcc/src/mingw/profile/configure.in 2006-11-03 11:44:21 UTC (rev 772) @@ -52,7 +52,7 @@ # Do not build libm.a when building under Cygwin winsup. Otherwise, it'll # overwrite Cygwin's one. Likewise for libgmon.a. ;; -*mingw32ce*) +*cegcc* | *mingw32ce*) CRT_ID=3 MNO_CYGWIN= RUNTIME=coredll Modified: trunk/cegcc/src/mingw/profile/gmon.c =================================================================== --- trunk/cegcc/src/mingw/profile/gmon.c 2006-11-03 11:40:54 UTC (rev 771) +++ trunk/cegcc/src/mingw/profile/gmon.c 2006-11-03 11:44:21 UTC (rev 772) @@ -41,13 +41,13 @@ */ #ifndef __MINGW32CE__ -#include <fcntl.h> +// #include <fcntl.h> #endif #include <stdlib.h> #include <stdio.h> #ifndef __MINGW32__ -#include <unistd.h> +// #include <unistd.h> #include <sys/param.h> #endif #include <sys/types.h> @@ -92,6 +92,10 @@ char *cp; struct gmonparam *p = &_gmonparam; +#if 0 + MessageBoxW(0, L"monstartup", L"Hello", 0); +#endif + /* * round lowpc and highpc to multiples of the density we're using * so the rest of the scaling (here and in gprof) stays in ints. @@ -176,6 +180,10 @@ char dbuf[200]; #endif +#if 0 + MessageBoxW(0, L"_mcleanup", L"Hello", 0); +#endif + if (p->state == GMON_PROF_ERROR) { #ifdef UNDER_CE #else @@ -232,8 +240,35 @@ proffile = "gmon.out"; } #else +#ifdef UNDER_CE + /* + * Provide for different file names than just "gmon.out". + */ + { +#define NAME_LEN 128 + wchar_t nlw[NAME_LEN]; + char nl[NAME_LEN]; + int len; + + len = GetModuleFileNameW(NULL, nlw, NAME_LEN); + if (len == 0) { + proffile = "gmon.out"; + } else { + if (wcstombs(nl, nlw, len) < 0) { + proffile = "gmon.out"; + } else { + nl[len-3] = 'g'; + nl[len-2] = 'm'; + nl[len-1] = 'o'; + + proffile = &nl[0]; + } + } + } +#else proffile = "gmon.out"; #endif +#endif #ifdef UNDER_CE fp = fopen(proffile, "wb"); Modified: trunk/cegcc/src/mingw/profile/profile.h =================================================================== --- trunk/cegcc/src/mingw/profile/profile.h 2006-11-03 11:40:54 UTC (rev 771) +++ trunk/cegcc/src/mingw/profile/profile.h 2006-11-03 11:44:21 UTC (rev 772) @@ -64,16 +64,14 @@ * The canonical name for the counter function is `mcount', no _. */ void _mcount (void) asm ("mcount"); #else -/* The canonical name for the function is `_mcount' in both C and asm, - * but some old asm code might assume it's `mcount'. */ +/* The canonical name for the function is `_mcount' in both C and asm. */ void _mcount (void); -weak_alias (_mcount, mcount) #endif -static void mcount_internal (unsigned long frompc, unsigned long selfpc); +void mcount_internal (unsigned long frompc, unsigned long selfpc); #define _MCOUNT_DECL(frompc, selfpc) \ - static void mcount_internal (unsigned long frompc, unsigned long selfpc) + void mcount_internal (unsigned long frompc, unsigned long selfpc) /* This macro/func MUST save r0, r1 because the compiler inserts * blind calls to _mount(), ignoring the fact that _mcount may @@ -103,6 +101,13 @@ "ldmia sp!, {r0, r1, r2, r3}"); \ } #else +/*************************************************************************** + *************************************************************************** + * + * The stuff below doesn't mention a processor, but it's Cygwin so x86 + * + *************************************************************************** + ***************************************************************************/ /* * This file is taken from Cygwin distribution. Please keep it in sync. * The differences should be within __MINGW32__ guard. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |