Function _get_pgmptr() is available in msvcr80+, UCRT and also in i386 and
x64 msvcrt.dll since Windows Vista. It is not available in arm msvcrt.dll.
---
 mingw-w64-crt/Makefile.am              |  2 ++
 mingw-w64-crt/lib-common/msvcrt.def.in |  2 +-
 mingw-w64-crt/misc/_get_pgmptr.c       | 20 ++++++++++++++++++++
 3 files changed, 23 insertions(+), 1 deletion(-)
 create mode 100644 mingw-w64-crt/misc/_get_pgmptr.c

diff --git a/mingw-w64-crt/Makefile.am b/mingw-w64-crt/Makefile.am
index 66d02c47bbd5..5f5b40cc0041 100644
--- a/mingw-w64-crt/Makefile.am
+++ b/mingw-w64-crt/Makefile.am
@@ -334,6 +334,7 @@ src_msvcrt=\
   misc/_configthreadlocale.c \
   misc/_get_daylight.c \
   misc/_get_dstbias.c \
+  misc/_get_pgmptr.c \
   misc/_get_timezone.c \
   misc/_get_tzname.c \
   misc/_recalloc.c \
@@ -884,6 +885,7 @@ src_pre_msvcr80=\
   misc/_get_daylight.c \
   misc/_get_dstbias.c \
   misc/_get_errno.c \
+  misc/_get_pgmptr.c \
   misc/_get_timezone.c \
   misc/_get_tzname.c \
   misc/_initterm_e.c \
diff --git a/mingw-w64-crt/lib-common/msvcrt.def.in 
b/mingw-w64-crt/lib-common/msvcrt.def.in
index 3f1b1a8dabac..270dfd399910 100644
--- a/mingw-w64-crt/lib-common/msvcrt.def.in
+++ b/mingw-w64-crt/lib-common/msvcrt.def.in
@@ -1433,7 +1433,7 @@ _get_fmode
 F_X86_ANY(_get_osplatform)
 F_X86_ANY(_get_osver)
 F_ARM_ANY(_get_output_format) ; i386 and x64 _get_output_format replaced by emu
-F_X86_ANY(_get_pgmptr)
+; F_X86_ANY(_get_pgmptr) ; i386 and x64 _get_pgmptr replaced by emu, arm32 and 
arm64 provided by emu
 _get_wenviron
 F_X86_ANY(_get_winmajor)
 F_X86_ANY(_get_winminor)
diff --git a/mingw-w64-crt/misc/_get_pgmptr.c b/mingw-w64-crt/misc/_get_pgmptr.c
new file mode 100644
index 000000000000..b13e21acfa70
--- /dev/null
+++ b/mingw-w64-crt/misc/_get_pgmptr.c
@@ -0,0 +1,20 @@
+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the mingw-w64 runtime package.
+ * No warranty is given; refer to the file DISCLAIMER.PD within this package.
+ */
+#include <stdlib.h>
+#include <errno.h>
+
+errno_t __cdecl _get_pgmptr(char **value)
+{
+  if (!value)
+  {
+    errno = EINVAL;
+    return EINVAL;
+  }
+
+  *value = _pgmptr;
+  return 0;
+}
+errno_t (__cdecl *__MINGW_IMP_SYMBOL(_get_pgmptr))(char **) = _get_pgmptr;
-- 
2.20.1



_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to