diff options
Diffstat (limited to 'newlib/libc/include/sys')
-rw-r--r-- | newlib/libc/include/sys/config.h | 14 | ||||
-rw-r--r-- | newlib/libc/include/sys/errno.h | 9 | ||||
-rw-r--r-- | newlib/libc/include/sys/unistd.h | 2 |
3 files changed, 17 insertions, 8 deletions
diff --git a/newlib/libc/include/sys/config.h b/newlib/libc/include/sys/config.h index b0957ea33..f8bd8cdb9 100644 --- a/newlib/libc/include/sys/config.h +++ b/newlib/libc/include/sys/config.h @@ -125,4 +125,18 @@ typedef unsigned int __uint32_t; #define __RAND_MAX 0x7fffffff #endif + +#if defined(__CYGWIN32__) || defined(__CYGWIN__) +#if defined(__INSIDE_CYGWIN__) || defined(_COMPILING_NEWLIB) +#define __IMPORT +#else +#define __IMPORT __declspec(dllimport) +#endif +#endif + +#ifndef __IMPORT +#define __IMPORT +#endif + + #endif /* __SYS_CONFIG_H__ */ diff --git a/newlib/libc/include/sys/errno.h b/newlib/libc/include/sys/errno.h index cc791fcb2..6709a1ca2 100644 --- a/newlib/libc/include/sys/errno.h +++ b/newlib/libc/include/sys/errno.h @@ -15,13 +15,8 @@ extern "C" { extern int *__errno _PARAMS ((void)); #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 +extern __IMPORT _CONST char * _CONST _sys_errlist[]; +extern __IMPORT int _sys_nerr; #define __errno_r(ptr) ((ptr)->_errno) diff --git a/newlib/libc/include/sys/unistd.h b/newlib/libc/include/sys/unistd.h index d681c5c86..609a64df5 100644 --- a/newlib/libc/include/sys/unistd.h +++ b/newlib/libc/include/sys/unistd.h @@ -10,7 +10,7 @@ extern "C" { #define __need_size_t #include <stddef.h> -extern char **environ; +extern __IMPORT char **environ; void _EXFUN(_exit, (int __status ) _ATTRIBUTE ((noreturn))); |