Hi all,

Following up on the recent changes to WinMain/main, this patch cleans up
our crt id numbering. coredll is the third runtime supported by MinGW (on our
version), so using crt2 (crt id ==  2 is for msvcrt.dll) was confusing.
This patch makes Windows CE / Coredll use crt3.o and dllcrt3.o.
We where already using gcrt3.o, so this was a missing cleanup, with precedents.

Cheers,
Pedro Alves

src/mingw/ChangeLog.mingw32ce:

2006-11-27  Pedro Alves  <[EMAIL PROTECTED]>

   * 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.

Index: Makefile.in
===================================================================
--- Makefile.in (revision 827)
+++ Makefile.in (working copy)
@@ -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
Index: dllcrt1.c
===================================================================
--- dllcrt1.c   (revision 827)
+++ dllcrt1.c   (working copy)
@@ -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);
Index: crt1_ce.c
===================================================================
--- crt1_ce.c   (revision 827)
+++ crt1_ce.c   (working copy)
@@ -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);
-}

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Cegcc-devel mailing list
Cegcc-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cegcc-devel

Reply via email to