]> Savannah Git Hosting - gnulib.git/commitdiff
stdlib: Cast putenv() on OS/2 kLIBC
authorKO Myung-Hun <komh78@gmail.com>
Mon, 25 Sep 2023 15:20:12 +0000 (00:20 +0900)
committerBruno Haible <bruno@clisp.org>
Fri, 29 Sep 2023 08:54:33 +0000 (10:54 +0200)
On OS/2 kLIBC, the first parameter of putenv () is 'const char *string'
not 'char *string'.

* lib/stdlib.in.h (putenv) [kLIBC]: Cast with _GL_CXXALIAS_SYS_CAST().

ChangeLog
lib/stdlib.in.h

index 29e704fc9d55e6770f0e46c5d53729e64ec6350a..f536914fb878e78fbb246ba684f6286ccc5931a6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2023-09-29  KO Myung-Hun  <komh78@gmail.com>
+
+       stdlib: Cast putenv() on OS/2 kLIBC
+       * lib/stdlib.in.h (putenv) [kLIBC]: Cast with _GL_CXXALIAS_SYS_CAST().
+
 2023-09-29  Bruno Haible  <bruno@clisp.org>
 
        fchdir: Override properly on OS/2 kLIBC.
index b9838c7d5ee9c8754e979d5f4711bd5481f1513d..b27d2c08c67abffca78bcea94ff52263d8ce0947 100644 (file)
@@ -1047,6 +1047,10 @@ _GL_CXXALIAS_RPL (putenv, int, (char *string));
 #   define putenv _putenv
 #  endif
 _GL_CXXALIAS_MDA (putenv, int, (char *string));
+# elif defined __KLIBC__
+/* Need to cast, because on OS/2 kLIBC, the first parameter is
+                                     const char *string.  */
+_GL_CXXALIAS_SYS_CAST (putenv, int, (char *string));
 # else
 _GL_CXXALIAS_SYS (putenv, int, (char *string));
 # endif
@@ -1063,6 +1067,10 @@ _GL_CXXALIASWARN (putenv);
 /* Need to cast, because on mingw, the parameter is either
    'const char *string' or 'char *string'.  */
 _GL_CXXALIAS_MDA_CAST (putenv, int, (char *string));
+# elif defined __KLIBC__
+/* Need to cast, because on OS/2 kLIBC, the first parameter is
+                                     const char *string.  */
+_GL_CXXALIAS_SYS_CAST (putenv, int, (char *string));
 # else
 _GL_CXXALIAS_SYS (putenv, int, (char *string));
 # endif