summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--need_errno.h15
2 files changed, 18 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index aa4bae3..c1bf7a8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2007-01-07 Sinan Kaya <sinan.kaya at siemens dot com>
+
+ * need_errno.h: Fix declaration of _errno - the local version of
+ _errno() is used, e.g. by WinCE.
+
2007-01-06 Ross Johnson <ross.johnson at homemail dot com dot au>
* ptw32_semwait.c: Add check for invalid sem_t after acquiring the
diff --git a/need_errno.h b/need_errno.h
index 2609f8d..f930d6e 100644
--- a/need_errno.h
+++ b/need_errno.h
@@ -59,11 +59,22 @@ extern "C" {
#endif
#endif
+/* declare reference to errno */
+#ifndef PTW32_STATIC_LIB
+# ifdef PTW32_BUILD
+# define PTW32_DLLPORT __declspec (dllexport)
+# else
+# define PTW32_DLLPORT __declspec (dllimport)
+# endif
+#else
+# define PTW32_DLLPORT
+#endif
/* declare reference to errno */
-#if (defined(_MT) || defined(_MD) || defined(_DLL)) && !defined(_MAC)
-_CRTIMP extern int * __cdecl _errno(void);
+#if (defined(_MT) || defined(_MD) || defined(_DLL)) &&
+!defined(_MAC)
+PTW32_DLLPORT int * __cdecl _errno(void);
#define errno (*_errno())
#else /* ndef _MT && ndef _MD && ndef _DLL */
_CRTIMP extern int errno;