summaryrefslogtreecommitdiffstats
path: root/winsup/mingw/include/stdlib.h
diff options
context:
space:
mode:
Diffstat (limited to 'winsup/mingw/include/stdlib.h')
-rw-r--r--winsup/mingw/include/stdlib.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/winsup/mingw/include/stdlib.h b/winsup/mingw/include/stdlib.h
index 71593de42..64d8867d7 100644
--- a/winsup/mingw/include/stdlib.h
+++ b/winsup/mingw/include/stdlib.h
@@ -252,6 +252,27 @@ __MINGW_IMPORT unsigned int _winminor_dll;
#endif
+#if defined __MSVCRT__
+/* although the _pgmptr is exported as DATA,
+ * be safe and use the access function __p__pgmptr() to get it. */
+char** __p__pgmptr(void);
+#define _pgmptr (*__p__pgmptr())
+wchar_t** __p__wpgmptr(void);
+#define _wpgmptr (*__p__wpgmptr())
+#else /* ! __MSVCRT__ */
+# ifndef __DECLSPEC_SUPPORTED
+ extern char** __imp__pgmptr_dll;
+# define _pgmptr (*__imp__pgmptr_dll)
+ extern wchar_t** __imp_wpgmptr_dll;
+# define _wpgmptr (*__imp__wpgmptr_dll)
+# else /* __DECLSPEC_SUPPORTED */
+ __MINGW_IMPORT char* _pgmptr_dll;
+# define _pgmptr _pgmptr_dll
+ __MINGW_IMPORT wchar_t* _wpgmptr_dll;
+# define _wpgmptr _wpgmptr_dll
+# endif /* __DECLSPEC_SUPPORTED */
+#endif /* __MSVCRT__ */
+
#endif /* Not __STRICT_ANSI__ */
#ifdef __GNUC__