This is the mail archive of the
newlib@sources.redhat.com
mailing list for the newlib project.
[patch] tagging cygwin imports
- To: newlib at sources dot redhat dot com
- Subject: [patch] tagging cygwin imports
- From: DJ Delorie <dj at delorie dot com>
- Date: Tue, 1 Aug 2000 12:55:50 -0400
- CC: dj at delorie dot com
This is my first pass at cleaning up the import tags that cygwin
requires of newlib. OK to commit (with a suitable ChangeLog entry, of
course)?
---------- libc/include/sys/dlltags.h
#ifndef _SYS_DLLTAGS_H
#define _SYS_DLLTAGS_H
#if defined(__CYGWIN32__) || defined(__CYGWIN__)
#if defined(__INSIDE_CYGWIN__) || defined(_COMPILING_NEWLIB)
#define __IMPORT
#else
#define __IMPORT __declspec(dllimport)
#endif
#endif
/* ---------- defaults ---------- */
#ifndef __IMPORT
#define __IMPORT
#endif
#endif
Index: libc/include/ctype.h
===================================================================
RCS file: /cvs/src/src/newlib/libc/include/ctype.h,v
retrieving revision 1.3
diff -p -2 -r1.3 ctype.h
*** ctype.h 2000/05/30 17:18:05 1.3
--- ctype.h 2000/08/01 16:48:40
*************** extern "C" {
*** 5,8 ****
--- 5,9 ----
#define _CTYPE_H_
+ #include <sys/dlltags.h>
#include "_ansi.h"
*************** int _EXFUN(_toupper, (int __c));
*** 37,45 ****
#define _B 0200
! #if !defined(__CYGWIN__) || defined(__INSIDE_CYGWIN__) || defined(_COMPILING_NEWLIB)
! extern _CONST char _ctype_[];
! #else
! extern _CONST char _ctype_[] __declspec(dllimport);
! #endif
#define isalpha(c) ((_ctype_+1)[(unsigned)(c)]&(_U|_L))
--- 38,42 ----
#define _B 0200
! extern __IMPORT _CONST char _ctype_[];
#define isalpha(c) ((_ctype_+1)[(unsigned)(c)]&(_U|_L))
Index: libc/include/math.h
===================================================================
RCS file: /cvs/src/src/newlib/libc/include/math.h,v
retrieving revision 1.3
diff -p -2 -r1.3 math.h
*** math.h 2000/07/28 16:27:54 1.3
--- math.h 2000/08/01 16:48:40
*************** extern "C" {
*** 9,12 ****
--- 9,13 ----
#include <sys/reent.h>
#include <machine/ieeefp.h>
+ #include <sys/dlltags.h>
#include "_ansi.h"
*************** union __dmath
*** 24,41 ****
/* Declare this as an array without bounds so that no matter what small data
support a port and/or library has, this reference will be via the general
! method for accessing globals.
- Also under Cygwin, the library exports a pointer to the real value, so we
- need to properly dereference it. */
- #ifndef __INFINITY_DECL__
- #if !defined(__CYGWIN__) || defined(__INSIDE_CYGWIN__) || defined(_COMPILING_NEWLIB)
- #define __INFINITY_DECL__
- #else
- #define __INFINITY_DECL__ __declspec(dllimport)
- #endif
- #endif
-
- extern __INFINITY_DECL__ const union __dmath __infinity[];
-
#define HUGE_VAL (__infinity[0].d)
--- 25,31 ----
/* Declare this as an array without bounds so that no matter what small data
support a port and/or library has, this reference will be via the general
! method for accessing globals. */
! extern __IMPORT const union __dmath __infinity[];
#define HUGE_VAL (__infinity[0].d)
*************** extern float dremf _PARAMS((float, float
*** 198,202 ****
/* The gamma functions use a global variable, signgam. */
! extern int signgam;
/* The exception structure passed to the matherr routine. */
--- 188,192 ----
/* The gamma functions use a global variable, signgam. */
! extern __IMPORT int signgam;
/* The exception structure passed to the matherr routine. */
*************** enum __fdlibm_version
*** 269,273 ****
#define _LIB_VERSION __fdlib_version
! extern _CONST _LIB_VERSION_TYPE _LIB_VERSION;
#define _IEEE_ __fdlibm_ieee
--- 259,263 ----
#define _LIB_VERSION __fdlib_version
! extern __IMPORT _CONST _LIB_VERSION_TYPE _LIB_VERSION;
#define _IEEE_ __fdlibm_ieee
Index: libc/include/stdlib.h
===================================================================
RCS file: /cvs/src/src/newlib/libc/include/stdlib.h,v
retrieving revision 1.3
diff -p -2 -r1.3 stdlib.h
*** stdlib.h 2000/06/09 01:13:36 1.3
--- stdlib.h 2000/08/01 16:48:40
*************** extern "C" {
*** 16,19 ****
--- 16,20 ----
#define __need_wchar_t
#include <stddef.h>
+ #include <sys/dlltags.h>
#include <sys/reent.h>
*************** typedef struct
*** 40,48 ****
#define RAND_MAX __RAND_MAX
! #if (defined(__CYGWIN__) || defined(__CYGWIN__)) && ! defined(_COMPILING_NEWLIB)
! extern __declspec(dllimport) int __mb_cur_max;
! #else
! extern int __mb_cur_max;
! #endif
#define MB_CUR_MAX __mb_cur_max
--- 41,45 ----
#define RAND_MAX __RAND_MAX
! extern __IMPORT int __mb_cur_max;
#define MB_CUR_MAX __mb_cur_max
Index: libc/include/time.h
===================================================================
RCS file: /cvs/src/src/newlib/libc/include/time.h,v
retrieving revision 1.2
diff -p -2 -r1.2 time.h
*** time.h 2000/05/30 17:18:05 1.2
--- time.h 2000/08/01 16:48:40
***************
*** 8,11 ****
--- 8,12 ----
#define _TIME_H_
+ #include <sys/dlltags.h>
#include "_ansi.h"
*************** struct tm *_EXFUN(localtime_r, (const ti
*** 75,81 ****
#ifdef __CYGWIN__
#ifndef __STRICT_ANSI__
! extern time_t _timezone __declspec(dllimport);
! extern int _daylight __declspec(dllimport);
! extern char *_tzname[2] __declspec(dllimport);
char *_EXFUN(timezone, (void));
--- 76,82 ----
#ifdef __CYGWIN__
#ifndef __STRICT_ANSI__
! extern __IMPORT time_t _timezone;
! extern __IMPORT int _daylight;
! extern __IMPORT char *_tzname[2];
char *_EXFUN(timezone, (void));
Index: libc/include/unctrl.h
===================================================================
RCS file: /cvs/src/src/newlib/libc/include/unctrl.h,v
retrieving revision 1.1.1.1
diff -p -2 -r1.1.1.1 unctrl.h
*** unctrl.h 2000/02/17 19:39:46 1.1.1.1
--- unctrl.h 2000/08/01 16:49:00
***************
*** 36,39 ****
--- 36,40 ----
#define _UNCTRL_H_
+ #include <sys/dlltags.h>
#include <_ansi.h>
***************
*** 41,46 ****
#define unctrllen(ch) __unctrllen[(ch) & 0xff]
! extern _CONST char * _CONST __unctrl[256]; /* Control strings. */
! extern _CONST char __unctrllen[256]; /* Control strings length. */
#endif /* _UNCTRL_H_ */
--- 42,47 ----
#define unctrllen(ch) __unctrllen[(ch) & 0xff]
! extern __IMPORT _CONST char * _CONST __unctrl[256]; /* Control strings. */
! extern __IMPORT _CONST char __unctrllen[256]; /* Control strings length. */
#endif /* _UNCTRL_H_ */
Index: libc/include/sys/errno.h
===================================================================
RCS file: /cvs/src/src/newlib/libc/include/sys/errno.h,v
retrieving revision 1.3
diff -p -2 -r1.3 errno.h
*** errno.h 2000/05/30 17:18:05 1.3
--- errno.h 2000/08/01 16:49:00
*************** extern "C" {
*** 9,12 ****
--- 9,13 ----
#define _SYS_ERRNO_H_
+ #include <sys/dlltags.h>
#include <sys/reent.h>
*************** extern int *__errno _PARAMS ((void));
*** 16,26 ****
#endif
! #if !defined(__CYGWIN__) || defined(__INSIDE_CYGWIN__)
! extern _CONST char * _CONST _sys_errlist[];
! extern int _sys_nerr;
! #else
! extern _CONST char * _CONST _sys_errlist[] __declspec(dllimport);
! extern int _sys_nerr __declspec(dllimport);
! #endif
#define __errno_r(ptr) ((ptr)->_errno)
--- 17,22 ----
#endif
! extern __IMPORT _CONST char * _CONST _sys_errlist[];
! extern __IMPORT int _sys_nerr;
#define __errno_r(ptr) ((ptr)->_errno)
Index: libc/include/sys/unistd.h
===================================================================
RCS file: /cvs/src/src/newlib/libc/include/sys/unistd.h,v
retrieving revision 1.4
diff -p -2 -r1.4 unistd.h
*** unistd.h 2000/06/16 21:04:37 1.4
--- unistd.h 2000/08/01 16:49:00
*************** extern "C" {
*** 6,9 ****
--- 6,10 ----
#endif
+ #include <sys/dlltags.h>
#include <_ansi.h>
#include <sys/types.h>
*************** extern "C" {
*** 11,15 ****
#include <stddef.h>
! extern char **environ;
void _EXFUN(_exit, (int __status ) _ATTRIBUTE ((noreturn)));
--- 12,16 ----
#include <stddef.h>
! extern __IMPORT char **environ;
void _EXFUN(_exit, (int __status ) _ATTRIBUTE ((noreturn)));