summaryrefslogtreecommitdiff
path: root/need_errno.h
diff options
context:
space:
mode:
Diffstat (limited to 'need_errno.h')
-rw-r--r--need_errno.h15
1 files changed, 13 insertions, 2 deletions
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;