This fixes the following warnings:

    ../src/getenv_s.c:11:17: warning: 'getenv_s' redeclared
          without 'dllimport' attribute: previous 'dllimport' ignored
          [-Winconsistent-dllimport]
       11 | errno_t __cdecl getenv_s(size_t *pReturnValue, char *dstBuf, 
rsize_t dst...
          |                 ^
    x86_64-w64-mingw32/include/sec_api/stdlib_s.h:25:27: note:
          previous declaration is here
       25 |   _CRTIMP errno_t __cdecl getenv_s(size_t *_ReturnSize,char 
*_DstBuf,rsi...
          |                           ^
    x86_64-w64-mingw32/include/sec_api/stdlib_s.h:25:3: note:
          previous attribute is here
       25 |   _CRTIMP errno_t __cdecl getenv_s(size_t *_ReturnSize,char 
*_DstBuf,rsi...
          |   ^
    x86_64-w64-mingw32/include/_mingw.h:52:40: note:
          expanded from macro '_CRTIMP'
       52 | #      define _CRTIMP  __attribute__ ((__dllimport__))
          |                                        ^

Such a construct is used for many other similar functions here.

Signed-off-by: Martin Storsjö <[email protected]>
---
 mingw-w64-libraries/winstorecompat/src/getenv_s.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/mingw-w64-libraries/winstorecompat/src/getenv_s.c 
b/mingw-w64-libraries/winstorecompat/src/getenv_s.c
index d520ce303..ed7c52523 100644
--- a/mingw-w64-libraries/winstorecompat/src/getenv_s.c
+++ b/mingw-w64-libraries/winstorecompat/src/getenv_s.c
@@ -4,9 +4,11 @@
  * No warranty is given; refer to the file DISCLAIMER.PD within this package.
  */
 
+#define getenv_s __getenv_s
 #include <stdlib.h>
 #include <errno.h>
 #include <windows.h>
+#undef getenv_s
 
 errno_t __cdecl getenv_s(size_t *pReturnValue, char *dstBuf, rsize_t dstSize, 
const char *varName)
 {
-- 
2.43.0



_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to