diff options
author | Christopher Faylor <me@cgf.cx> | 2010-08-30 01:57:37 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2010-08-30 01:57:37 +0000 |
commit | 92117cb21f54115367528220dbb85bed8d7b72b4 (patch) | |
tree | 33bc5aea3bb9bd4f638268ad272406a3401bf43e /winsup/cygwin | |
parent | 552bc28f4650ccd83757ebee28e24ca8237829e5 (diff) | |
download | newlib-92117cb21f54115367528220dbb85bed8d7b72b4.zip newlib-92117cb21f54115367528220dbb85bed8d7b72b4.tar.gz newlib-92117cb21f54115367528220dbb85bed8d7b72b4.tar.bz2 |
* winlean.h: New file.
* automode.c: Use "winlean.h".
* binmode.c: Ditto.
* gmon.c: Ditto.
* textmode.c: Ditto.
* textreadmode.c: Ditto.
* winsup.h: Ditto.
* lib/cygwin_attach_dll.c: Ditto.
* lib/dll_main.cc: Ditto.
* profile.c: Ditto.
* crt0.c: Ditto. Cleanup ancient cruft. Add dummy calls to cygwin_premain*.
* include/sys/cygwin.h: Remove old stuff. Move premain declarations nearer to
other cygwin-specific function declarations.
* globals.cc: Add comment.
Diffstat (limited to 'winsup/cygwin')
-rw-r--r-- | winsup/cygwin/ChangeLog | 18 | ||||
-rw-r--r-- | winsup/cygwin/automode.c | 2 | ||||
-rw-r--r-- | winsup/cygwin/binmode.c | 4 | ||||
-rw-r--r-- | winsup/cygwin/crt0.c | 23 | ||||
-rw-r--r-- | winsup/cygwin/globals.cc | 2 | ||||
-rw-r--r-- | winsup/cygwin/gmon.c | 3 | ||||
-rw-r--r-- | winsup/cygwin/include/sys/cygwin.h | 25 | ||||
-rw-r--r-- | winsup/cygwin/lib/cygwin_attach_dll.c | 2 | ||||
-rw-r--r-- | winsup/cygwin/lib/dll_main.cc | 5 | ||||
-rw-r--r-- | winsup/cygwin/profil.c | 2 | ||||
-rw-r--r-- | winsup/cygwin/textmode.c | 4 | ||||
-rw-r--r-- | winsup/cygwin/textreadmode.c | 4 | ||||
-rw-r--r-- | winsup/cygwin/winsup.h | 19 |
13 files changed, 52 insertions, 61 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index df9e1fb..bcbe77b 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,21 @@ +2010-08-29 Christopher Faylor <me+cygwin@cgf.cx> + + * winlean.h: New file. + * automode.c: Use "winlean.h". + * binmode.c: Ditto. + * gmon.c: Ditto. + * textmode.c: Ditto. + * textreadmode.c: Ditto. + * winsup.h: Ditto. + * lib/cygwin_attach_dll.c: Ditto. + * lib/dll_main.cc: Ditto. + * profile.c: Ditto. + * crt0.c: Ditto. Cleanup ancient cruft. Add dummy calls to + cygwin_premain*. + * include/sys/cygwin.h: Remove old stuff. Move premain declarations + nearer to other cygwin-specific function declarations. + * globals.cc: Add comment. + 2010-08-28 Corinna Vinschen <corinna@vinschen.de> * autoload.cc (LoadDLLprime): Change dllname storage to string16. diff --git a/winsup/cygwin/automode.c b/winsup/cygwin/automode.c index f7cddfe..64961fe 100644 --- a/winsup/cygwin/automode.c +++ b/winsup/cygwin/automode.c @@ -8,7 +8,7 @@ This software is a copyrighted work licensed under the terms of the Cygwin license. Please consult the file "CYGWIN_LICENSE" for details. */ -#include <windows.h> +#include "winlean.h" #include <sys/fcntl.h> #include <sys/cygwin.h> diff --git a/winsup/cygwin/binmode.c b/winsup/cygwin/binmode.c index 50efff4..757ead2 100644 --- a/winsup/cygwin/binmode.c +++ b/winsup/cygwin/binmode.c @@ -1,6 +1,6 @@ /* binmode.c - Copyright 2000 Red Hat, Inc. + Copyright 2000, 2010 Red Hat, Inc. This file is part of Cygwin. @@ -8,7 +8,7 @@ This software is a copyrighted work licensed under the terms of the Cygwin license. Please consult the file "CYGWIN_LICENSE" for details. */ -#include <windows.h> +#include "winlean.h" #include <sys/fcntl.h> #include <sys/cygwin.h> diff --git a/winsup/cygwin/crt0.c b/winsup/cygwin/crt0.c index 1421f65..d716d9b 100644 --- a/winsup/cygwin/crt0.c +++ b/winsup/cygwin/crt0.c @@ -1,6 +1,6 @@ -/* crt0.c. +/* crt0.c - Copyright 2001, 2005 Red Hat, Inc. + Copyright 2001, 2005, 2010 Red Hat, Inc. This software is a copyrighted work licensed under the terms of the Cygwin license. Please consult the file "CYGWIN_LICENSE" for @@ -9,15 +9,14 @@ details. */ /* In the following ifdef'd i386 code, the FPU precision is set to 80 bits and all FPU exceptions are masked. The former is needed to make long doubles work correctly. The latter causes the FPU to generate NaNs and - Infinities instead of signals for certain operations. -*/ + Infinities instead of signals for certain operations. */ +#include "winlean.h" +#include <sys/cygwin.h> #ifdef __i386__ #define FPU_RESERVED 0xF0C0 #define FPU_DEFAULT 0x033f -/* For debugging on *#!$@ windbg. bp for breakpoint. */ -int __cygwin_crt0_bp = 0; #endif extern int main (int argc, char **argv); @@ -30,9 +29,6 @@ mainCRTStartup () #ifdef __i386__ (void)__builtin_return_address(1); asm volatile ("andl $-16,%%esp" ::: "%esp"); - if (__cygwin_crt0_bp) - asm volatile ("int3"); - { volatile unsigned short cw; @@ -49,7 +45,14 @@ mainCRTStartup () #endif cygwin_crt0 (main); + + /* These are never actually called. They are just here to force the inclusion + of things like -lbinmode. */ + + cygwin_premain0 (0, NULL, NULL); + cygwin_premain1 (0, NULL, NULL); + cygwin_premain2 (0, NULL, NULL); + cygwin_premain3 (0, NULL, NULL); } void WinMainCRTStartup(void) __attribute__ ((alias("mainCRTStartup"))); - diff --git a/winsup/cygwin/globals.cc b/winsup/cygwin/globals.cc index b6d03e1..811192d 100644 --- a/winsup/cygwin/globals.cc +++ b/winsup/cygwin/globals.cc @@ -53,9 +53,11 @@ SYSTEM_INFO system_info; /* Set in init.cc. Used to check if Cygwin DLL is dynamically loaded. */ int NO_COPY dynamically_loaded; +/* Some CYGWIN environment variable variables. */ bool display_title; bool strip_title_path; bool allow_glob = true; + bool NO_COPY in_forkee; int __argc_safe; diff --git a/winsup/cygwin/gmon.c b/winsup/cygwin/gmon.c index 981b410..13342eb 100644 --- a/winsup/cygwin/gmon.c +++ b/winsup/cygwin/gmon.c @@ -35,13 +35,14 @@ static char rcsid[] = "$OpenBSD: gmon.c,v 1.8 1997/07/23 21:11:27 kstailey Exp $"; #endif +#include "winlean.h" #include <fcntl.h> #include <stdio.h> #include <unistd.h> #include <gmon.h> +#include <stdlib.h> #include <profil.h> -#include <windows.h> /* XXX needed? */ //extern char *minbrk __asm ("minbrk"); diff --git a/winsup/cygwin/include/sys/cygwin.h b/winsup/cygwin/include/sys/cygwin.h index d6df27d..37700a6 100644 --- a/winsup/cygwin/include/sys/cygwin.h +++ b/winsup/cygwin/include/sys/cygwin.h @@ -21,21 +21,6 @@ extern "C" { #define _CYGWIN_SIGNAL_STRING "cYgSiGw00f" -#if 0 /* ENTIRELY DEPRECATED INTERFACES. */ -extern pid_t cygwin32_winpid_to_pid (int); -extern void cygwin32_win32_to_posix_path_list (const char *, char *); -extern int cygwin32_win32_to_posix_path_list_buf_size (const char *); -extern void cygwin32_posix_to_win32_path_list (const char *, char *); -extern int cygwin32_posix_to_win32_path_list_buf_size (const char *); -extern int cygwin32_conv_to_win32_path (const char *, char *); -extern int cygwin32_conv_to_full_win32_path (const char *, char *); -extern void cygwin32_conv_to_posix_path (const char *, char *); -extern void cygwin32_conv_to_full_posix_path (const char *, char *); -extern int cygwin32_posix_path_list_p (const char *); -extern void cygwin32_split_path (const char *, char *, char *); -extern int cygwin32_attach_handle_to_fd (char *, int, HANDLE, mode_t, DWORD); -#endif - /* DEPRECATED INTERFACES. These are restricted to MAX_PATH length. Don't use in modern applications. */ extern int cygwin_win32_to_posix_path_list (const char *, char *) @@ -273,11 +258,6 @@ struct per_process }; #define per_process_overwrite ((unsigned) &(((struct per_process *) NULL)->threadinterface)) -extern void cygwin_premain0 (int argc, char **argv, struct per_process *); -extern void cygwin_premain1 (int argc, char **argv, struct per_process *); -extern void cygwin_premain2 (int argc, char **argv, struct per_process *); -extern void cygwin_premain3 (int argc, char **argv, struct per_process *); - #ifdef _PATH_PASSWD extern HANDLE cygwin_logon_user (const struct passwd *, const char *); #endif @@ -286,6 +266,11 @@ extern void cygwin_set_impersonation_token (const HANDLE); /* included if <windows.h> is included */ extern int cygwin_attach_handle_to_fd (char *, int, HANDLE, mode_t, DWORD); +extern void cygwin_premain0 (int, char **, struct per_process *); +extern void cygwin_premain1 (int, char **, struct per_process *); +extern void cygwin_premain2 (int, char **, struct per_process *); +extern void cygwin_premain3 (int, char **, struct per_process *); + #ifdef __CYGWIN__ #include <sys/resource.h> diff --git a/winsup/cygwin/lib/cygwin_attach_dll.c b/winsup/cygwin/lib/cygwin_attach_dll.c index 49bb925..81493a4 100644 --- a/winsup/cygwin/lib/cygwin_attach_dll.c +++ b/winsup/cygwin/lib/cygwin_attach_dll.c @@ -9,7 +9,7 @@ Cygwin license. Please consult the file "CYGWIN_LICENSE" for details. */ #undef __INSIDE_CYGWIN__ -#include <windows.h> +#include "winlean.h" #include <time.h> /* Needed since call to sys/time.h via sys/cygwin.h complains otherwise */ #include <sys/cygwin.h> diff --git a/winsup/cygwin/lib/dll_main.cc b/winsup/cygwin/lib/dll_main.cc index 7f977f6..558c348 100644 --- a/winsup/cygwin/lib/dll_main.cc +++ b/winsup/cygwin/lib/dll_main.cc @@ -1,14 +1,13 @@ /* dll_main.cc: Provide the DllMain stub that the user can override. - Copyright 1998, 2000, 2001, 2009 Red Hat, Inc. + Copyright 1998, 2000, 2001, 2009, 2010 Red Hat, Inc. This software is a copyrighted work licensed under the terms of the Cygwin license. Please consult the file "CYGWIN_LICENSE" for details. */ -#define WIN32_LEAN_AND_MEAN -#include <windows.h> +#include "winlean.h" extern "C" BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, diff --git a/winsup/cygwin/profil.c b/winsup/cygwin/profil.c index a4f64ae..e6954aa 100644 --- a/winsup/cygwin/profil.c +++ b/winsup/cygwin/profil.c @@ -8,7 +8,7 @@ Cygwin license. Please consult the file "CYGWIN_LICENSE" for details. */ -#include <windows.h> +#include "winlean.h" #include <sys/types.h> #include <errno.h> diff --git a/winsup/cygwin/textmode.c b/winsup/cygwin/textmode.c index 6d52d50..e951a4a 100644 --- a/winsup/cygwin/textmode.c +++ b/winsup/cygwin/textmode.c @@ -1,6 +1,6 @@ /* binmode.c - Copyright 2000 Red Hat, Inc. + Copyright 2000, 2010 Red Hat, Inc. This file is part of Cygwin. @@ -8,7 +8,7 @@ This software is a copyrighted work licensed under the terms of the Cygwin license. Please consult the file "CYGWIN_LICENSE" for details. */ -#include <windows.h> +#include "winlean.h" #include <sys/fcntl.h> #include <sys/cygwin.h> diff --git a/winsup/cygwin/textreadmode.c b/winsup/cygwin/textreadmode.c index a94106d..ab6d2cb 100644 --- a/winsup/cygwin/textreadmode.c +++ b/winsup/cygwin/textreadmode.c @@ -1,6 +1,6 @@ /* textreadmode.c - Copyright 2004 Red Hat, Inc. + Copyright 2004, 2010 Red Hat, Inc. This file is part of Cygwin. @@ -8,7 +8,7 @@ This software is a copyrighted work licensed under the terms of the Cygwin license. Please consult the file "CYGWIN_LICENSE" for details. */ -#include <windows.h> +#include "winlean.h" #include <sys/fcntl.h> #include <sys/cygwin.h> diff --git a/winsup/cygwin/winsup.h b/winsup/cygwin/winsup.h index efcdf6d..3ffd3b7 100644 --- a/winsup/cygwin/winsup.h +++ b/winsup/cygwin/winsup.h @@ -81,24 +81,7 @@ extern const char case_folded_upper[]; #define cfree newlib_cfree_dont_use #endif -#define WIN32_LEAN_AND_MEAN 1 -#define _WINGDI_H -#define _WINUSER_H -#define _WINNLS_H -#define _WINVER_H -#define _WINNETWK_H -#define _WINSVC_H -#include <windows.h> -#include <wincrypt.h> -#include <lmcons.h> -#include <ntdef.h> -#undef _WINGDI_H -#undef _WINUSER_H -#undef _WINNLS_H -#undef _WINVER_H -#undef _WINNETWK_H -#undef _WINSVC_H - +#include "winlean.h" #include "wincap.h" /* The one function we use from winuser.h most of the time */ |