From 9eca8c199ac97670b530cc18d604f6cb6ba98ab5 Mon Sep 17 00:00:00 2001 From: KO Myung-Hun Date: Tue, 26 Sep 2023 00:20:12 +0900 Subject: [PATCH] stdlib: Cast putenv() on OS/2 kLIBC 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 | 5 +++++ lib/stdlib.in.h | 8 ++++++++ 2 files changed, 13 insertions(+) diff --git a/ChangeLog b/ChangeLog index 29e704fc9d..f536914fb8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2023-09-29 KO Myung-Hun + + stdlib: Cast putenv() on OS/2 kLIBC + * lib/stdlib.in.h (putenv) [kLIBC]: Cast with _GL_CXXALIAS_SYS_CAST(). + 2023-09-29 Bruno Haible fchdir: Override properly on OS/2 kLIBC. diff --git a/lib/stdlib.in.h b/lib/stdlib.in.h index b9838c7d5e..b27d2c08c6 100644 --- a/lib/stdlib.in.h +++ b/lib/stdlib.in.h @@ -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 -- 2.39.5