aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDanny Smith <dannysmith@users.sourceforge.net>2002-04-26 01:32:09 +0000
committerDanny Smith <dannysmith@users.sourceforge.net>2002-04-26 01:32:09 +0000
commit5042c1ed661c8bbe3b68822e4a79823650e84098 (patch)
treee490e6acbab16fc05652dc3fad39e07a2a734ebe
parent411c6d1da3535c56e9fc2df5864020e0b0bdfd83 (diff)
downloadnewlib-5042c1ed661c8bbe3b68822e4a79823650e84098.zip
newlib-5042c1ed661c8bbe3b68822e4a79823650e84098.tar.gz
newlib-5042c1ed661c8bbe3b68822e4a79823650e84098.tar.bz2
* include/dos.h: Change prefix "__imp_" to "_imp__" for
__GNUC__ without __DECLSPEC_SUPPORTED. * include/fnctl.h: Likewise. * include/math.h: Likewise. * include/stdio.h: Likewise. * include/stdlib.h: Likewise. * include/time.h: Likewise. * include/wctype.h: Likewise. * include/ctype.h: Likewise.
-rw-r--r--winsup/mingw/ChangeLog12
-rw-r--r--winsup/mingw/include/ctype.h41
-rw-r--r--winsup/mingw/include/dos.h26
-rw-r--r--winsup/mingw/include/fcntl.h8
-rw-r--r--winsup/mingw/include/math.h8
-rw-r--r--winsup/mingw/include/stdio.h4
-rw-r--r--winsup/mingw/include/stdlib.h43
-rw-r--r--winsup/mingw/include/time.h12
-rw-r--r--winsup/mingw/include/wctype.h26
9 files changed, 121 insertions, 59 deletions
diff --git a/winsup/mingw/ChangeLog b/winsup/mingw/ChangeLog
index f82b2b0..3e8410e 100644
--- a/winsup/mingw/ChangeLog
+++ b/winsup/mingw/ChangeLog
@@ -1,5 +1,17 @@
2002-04-26 Danny Smith <dannysmith@users.sourceforge.net>
+ * include/dos.h: Change prefix "__imp_" to "_imp__" for
+ __GNUC__ without __DECLSPEC_SUPPORTED.
+ * include/fnctl.h: Likewise.
+ * include/math.h: Likewise.
+ * include/stdio.h: Likewise.
+ * include/stdlib.h: Likewise.
+ * include/time.h: Likewise.
+ * include/wctype.h: Likewise.
+ * include/ctype.h: Likewise.
+
+2002-04-26 Danny Smith <dannysmith@users.sourceforge.net>
+
Add atexit support for dlls.
* crt1.c (atexit): Force thunk to _imp__atexit.
(_onexit): Force thunk to _imp___onexit.
diff --git a/winsup/mingw/include/ctype.h b/winsup/mingw/include/ctype.h
index bc7c60d..35a577b 100644
--- a/winsup/mingw/include/ctype.h
+++ b/winsup/mingw/include/ctype.h
@@ -95,22 +95,47 @@ int _toupper(int);
/* Also defined in stdlib.h */
#ifndef MB_CUR_MAX
+#ifdef __DECLSPEC_SUPPORTED
# ifdef __MSVCRT__
# define MB_CUR_MAX __mb_cur_max
__MINGW_IMPORT int __mb_cur_max;
-# else /* not __MSVCRT */
+# else /* not __MSVCRT */
# define MB_CUR_MAX __mb_cur_max_dll
__MINGW_IMPORT int __mb_cur_max_dll;
-# endif /* not __MSVCRT */
+# endif /* not __MSVCRT */
+
+#else /* ! __DECLSPEC_SUPPORTED */
+# ifdef __MSVCRT__
+ extern int* _imp____mbcur_max
+# define MB_CUR_MAX (*_imp____mb_cur_max)
+# else /* not __MSVCRT */
+ extern int* _imp____mbcur_max_dll
+# define MB_CUR_MAX (*_imp____mb_cur_max_dll)
+# endif /* not __MSVCRT */
+#endif /* __DECLSPEC_SUPPORTED */
#endif /* MB_CUR_MAX */
+
+#ifdef __DECLSPEC_SUPPORTED
__MINGW_IMPORT unsigned short _ctype[];
-#ifdef __MSVCRT__
-__MINGW_IMPORT unsigned short* _pctype;
-#else /* CRTDLL */
-__MINGW_IMPORT unsigned short* _pctype_dll;
-#define _pctype _pctype_dll
-#endif
+# ifdef __MSVCRT__
+ __MINGW_IMPORT unsigned short* _pctype;
+# else /* CRTDLL */
+ __MINGW_IMPORT unsigned short* _pctype_dll;
+# define _pctype _pctype_dll
+# endif
+
+#else /* __DECLSPEC_SUPPORTED */
+extern unsigned short** _imp___ctype;
+#define _ctype (*_imp___ctype)
+# ifdef __MSVCRT__
+ extern unsigned short** _imp___pctype;
+# define _pctype (*_imp___pctype)
+# else /* CRTDLL */
+ extern unsigned short** _imp___pctype_dll;
+# define _pctype (*_imp___pctype_dll)
+# endif /* CRTDLL */
+#endif /* __DECLSPEC_SUPPORTED */
/*
* Use inlines here rather than macros, because macros will upset
diff --git a/winsup/mingw/include/dos.h b/winsup/mingw/include/dos.h
index d0d7892..5374a7a 100644
--- a/winsup/mingw/include/dos.h
+++ b/winsup/mingw/include/dos.h
@@ -48,19 +48,19 @@ extern "C" {
#ifndef __MSVCRT__ /* these are in CRTDLL, but not MSVCRT */
#ifndef __DECLSPEC_SUPPORTED
-extern unsigned int *__imp__basemajor_dll;
-extern unsigned int *__imp__baseminor_dll;
-extern unsigned int *__imp__baseversion_dll;
-extern unsigned int *__imp__osmajor_dll;
-extern unsigned int *__imp__osminor_dll;
-extern unsigned int *__imp__osmode_dll;
-
-#define _basemajor (*__imp__basemajor_dll)
-#define _baseminor (*__imp__baseminor_dll)
-#define _baseversion (*__imp__baseversion_dll)
-#define _osmajor (*__imp__osmajor_dll)
-#define _osminor (*__imp__osminor_dll)
-#define _osmode (*__imp__osmode_dll)
+extern unsigned int *_imp___basemajor_dll;
+extern unsigned int *_imp___baseminor_dll;
+extern unsigned int *_imp___baseversion_dll;
+extern unsigned int *_imp___osmajor_dll;
+extern unsigned int *_imp___osminor_dll;
+extern unsigned int *_imp___osmode_dll;
+
+#define _basemajor (*_imp___basemajor_dll)
+#define _baseminor (*_imp___baseminor_dll)
+#define _baseversion (*_imp___baseversion_dll)
+#define _osmajor (*_imp___osmajor_dll)
+#define _osminor (*_imp___osminor_dll)
+#define _osmode (*_imp___osmode_dll)
#else /* __DECLSPEC_SUPPORTED */
diff --git a/winsup/mingw/include/fcntl.h b/winsup/mingw/include/fcntl.h
index 61ed946..bcc7bca 100644
--- a/winsup/mingw/include/fcntl.h
+++ b/winsup/mingw/include/fcntl.h
@@ -93,12 +93,12 @@
#ifndef __DECLSPEC_SUPPORTED
#ifdef __MSVCRT__
-extern unsigned int* __imp__fmode;
-#define _fmode (*__imp__fmode)
+extern unsigned int* _imp___fmode;
+#define _fmode (*_imp___fmode)
#else
/* CRTDLL */
-extern unsigned int* __imp__fmode_dll;
-#define _fmode (*__imp__fmode_dll)
+extern unsigned int* _imp___fmode_dll;
+#define _fmode (*_imp___fmode_dll)
#endif
#else /* __DECLSPEC_SUPPORTED */
diff --git a/winsup/mingw/include/math.h b/winsup/mingw/include/math.h
index 82bf21b..2de3248 100644
--- a/winsup/mingw/include/math.h
+++ b/winsup/mingw/include/math.h
@@ -98,12 +98,12 @@ extern "C" {
#ifndef __DECLSPEC_SUPPORTED
#ifdef __MSVCRT__
-extern double* __imp__HUGE;
-#define HUGE_VAL (*__imp__HUGE)
+extern double* _imp___HUGE;
+#define HUGE_VAL (*_imp___HUGE)
#else
/* CRTDLL */
-extern double* __imp__HUGE_dll;
-#define HUGE_VAL (*__imp__HUGE_dll)
+extern double* _imp___HUGE_dll;
+#define HUGE_VAL (*_imp___HUGE_dll)
#endif
#else /* __DECLSPEC_SUPPORTED */
diff --git a/winsup/mingw/include/stdio.h b/winsup/mingw/include/stdio.h
index 88433d3..427b29f 100644
--- a/winsup/mingw/include/stdio.h
+++ b/winsup/mingw/include/stdio.h
@@ -158,9 +158,9 @@ typedef struct _iobuf
*/
#ifndef __DECLSPEC_SUPPORTED
-extern FILE (*__imp__iob)[]; /* A pointer to an array of FILE */
+extern FILE (*_imp___iob)[]; /* A pointer to an array of FILE */
-#define _iob (*__imp__iob) /* An array of FILE */
+#define _iob (*_imp___iob) /* An array of FILE */
#else /* __DECLSPEC_SUPPORTED */
diff --git a/winsup/mingw/include/stdlib.h b/winsup/mingw/include/stdlib.h
index c7c5c92..bc58842 100644
--- a/winsup/mingw/include/stdlib.h
+++ b/winsup/mingw/include/stdlib.h
@@ -101,10 +101,10 @@ extern wchar_t*** __p___wargv(void);
#ifndef __DECLSPEC_SUPPORTED
-extern int* __imp___argc_dll;
-extern char*** __imp___argv_dll;
-#define __argc (*__imp___argc_dll)
-#define __argv (*__imp___argv_dll)
+extern int* _imp____argc_dll;
+extern char*** _imp____argv_dll;
+#define __argc (*_imp____argc_dll)
+#define __argv (*_imp____argv_dll)
#else /* __DECLSPEC_SUPPORTED */
@@ -121,16 +121,27 @@ __MINGW_IMPORT char** __argv_dll;
* Also defined in ctype.h.
*/
+/* Also defined in stdlib.h */
#ifndef MB_CUR_MAX
+#ifdef __DECLSPEC_SUPPORTED
# ifdef __MSVCRT__
# define MB_CUR_MAX __mb_cur_max
__MINGW_IMPORT int __mb_cur_max;
-# else /* not __MSVCRT */
+# else /* not __MSVCRT */
# define MB_CUR_MAX __mb_cur_max_dll
__MINGW_IMPORT int __mb_cur_max_dll;
-# endif /* not __MSVCRT */
-#endif /* MB_CUR_MAX */
+# endif /* not __MSVCRT */
+#else /* ! __DECLSPEC_SUPPORTED */
+# ifdef __MSVCRT__
+ extern int* _imp____mbcur_max
+# define MB_CUR_MAX (*_imp____mb_cur_max)
+# else /* not __MSVCRT */
+ extern int* _imp____mbcur_max_dll
+# define MB_CUR_MAX (*_imp____mb_cur_max_dll)
+# endif /* not __MSVCRT */
+#endif /* __DECLSPEC_SUPPORTED */
+#endif /* MB_CUR_MAX */
/*
* MS likes to declare errno in stdlib.h as well.
*/
@@ -156,8 +167,8 @@ int* __doserrno(void);
# define _wenviron (*__p__wenviron())
#else /* ! __MSVCRT__ */
# ifndef __DECLSPEC_SUPPORTED
- extern char *** __imp__environ_dll;
-# define _environ (*__imp__environ_dll)
+ extern char *** _imp___environ_dll;
+# define _environ (*_imp___environ_dll)
# else /* __DECLSPEC_SUPPORTED */
__MINGW_IMPORT char ** _environ_dll;
# define _environ _environ_dll
@@ -170,8 +181,8 @@ int* __doserrno(void);
/* One of the MSVCRTxx libraries */
#ifndef __DECLSPEC_SUPPORTED
- extern int* __imp__sys_nerr;
-# define sys_nerr (*__imp__sys_nerr)
+ extern int* _imp___sys_nerr;
+# define sys_nerr (*_imp___sys_nerr)
#else /* __DECLSPEC_SUPPORTED */
__MINGW_IMPORT int _sys_nerr;
# ifndef _UWIN
@@ -184,8 +195,8 @@ int* __doserrno(void);
/* CRTDLL run time library */
#ifndef __DECLSPEC_SUPPORTED
- extern int* __imp__sys_nerr_dll;
-# define sys_nerr (*__imp__sys_nerr_dll)
+ extern int* _imp___sys_nerr_dll;
+# define sys_nerr (*_imp___sys_nerr_dll)
#else /* __DECLSPEC_SUPPORTED */
__MINGW_IMPORT int _sys_nerr_dll;
# define sys_nerr _sys_nerr_dll
@@ -194,8 +205,8 @@ int* __doserrno(void);
#endif /* ! __MSVCRT__ */
#ifndef __DECLSPEC_SUPPORTED
-extern char*** __imp__sys_errlist;
-#define sys_errlist (*__imp__sys_errlist)
+extern char*** _imp__sys_errlist;
+#define sys_errlist (*_imp___sys_errlist)
#else /* __DECLSPEC_SUPPORTED */
__MINGW_IMPORT char* _sys_errlist[];
#ifndef _UWIN
@@ -262,7 +273,7 @@ wchar_t** __p__wpgmptr(void);
#else /* ! __MSVCRT__ */
# ifndef __DECLSPEC_SUPPORTED
extern char** __imp__pgmptr_dll;
-# define _pgmptr (*__imp__pgmptr_dll)
+# define _pgmptr (*_imp___pgmptr_dll)
# else /* __DECLSPEC_SUPPORTED */
__MINGW_IMPORT char* _pgmptr_dll;
# define _pgmptr _pgmptr_dll
diff --git a/winsup/mingw/include/time.h b/winsup/mingw/include/time.h
index 6e9d1e4..f2f7b50 100644
--- a/winsup/mingw/include/time.h
+++ b/winsup/mingw/include/time.h
@@ -151,13 +151,13 @@ __MINGW_IMPORT char *_tzname[2];
#ifndef __DECLSPEC_SUPPORTED
-extern int* __imp__daylight_dll;
-extern long* __imp__timezone_dll;
-extern char** __imp__tzname;
+extern int* _imp___daylight_dll;
+extern long* _imp___timezone_dll;
+extern char** _imp___tzname;
-#define _daylight (*__imp__daylight_dll)
-#define _timezone (*__imp__timezone_dll)
-#define _tzname (__imp__tzname)
+#define _daylight (*_imp___daylight_dll)
+#define _timezone (*_imp___timezone_dll)
+#define _tzname (*_imp___tzname)
#else /* __DECLSPEC_SUPPORTED */
diff --git a/winsup/mingw/include/wctype.h b/winsup/mingw/include/wctype.h
index 1fb00fb..8e0c68a 100644
--- a/winsup/mingw/include/wctype.h
+++ b/winsup/mingw/include/wctype.h
@@ -86,13 +86,27 @@ int isleadbyte (int);
/* Also in ctype.h */
+#ifdef __DECLSPEC_SUPPORTED
__MINGW_IMPORT unsigned short _ctype[];
-#ifdef __MSVCRT__
-__MINGW_IMPORT unsigned short* _pctype;
-#else
-__MINGW_IMPORT unsigned short* _pctype_dll;
-#define _pctype _pctype_dll
-#endif
+# ifdef __MSVCRT__
+ __MINGW_IMPORT unsigned short* _pctype;
+# else /* CRTDLL */
+ __MINGW_IMPORT unsigned short* _pctype_dll;
+# define _pctype _pctype_dll
+# endif
+
+#else /* ! __DECLSPEC_SUPPORTED */
+extern unsigned short** _imp___ctype;
+#define _ctype (*_imp___ctype)
+# ifdef __MSVCRT__
+ extern unsigned short** _imp___pctype;
+# define _pctype (*_imp___pctype)
+# else /* CRTDLL */
+ extern unsigned short** _imp___pctype_dll;
+# define _pctype (*_imp___pctype_dll)
+# endif /* CRTDLL */
+#endif /* __DECLSPEC_SUPPORTED */
+
#if !(defined(__NO_CTYPE_INLINES) || defined(__WCTYPE_INLINES_DEFINED))
#define __WCTYPE_INLINES_DEFINED