summaryrefslogtreecommitdiffstats
path: root/gl/c++defs.h
diff options
context:
space:
mode:
Diffstat (limited to 'gl/c++defs.h')
-rw-r--r--gl/c++defs.h18
1 files changed, 14 insertions, 4 deletions
diff --git a/gl/c++defs.h b/gl/c++defs.h
index df98a5ae..cfe68cb1 100644
--- a/gl/c++defs.h
+++ b/gl/c++defs.h
@@ -1,5 +1,5 @@
1/* C++ compatible function declaration macros. 1/* C++ compatible function declaration macros.
2 Copyright (C) 2010-2025 Free Software Foundation, Inc. 2 Copyright (C) 2010-2026 Free Software Foundation, Inc.
3 3
4 This program is free software: you can redistribute it and/or modify it 4 This program is free software: you can redistribute it and/or modify it
5 under the terms of the GNU Lesser General Public License as published 5 under the terms of the GNU Lesser General Public License as published
@@ -127,6 +127,16 @@
127#define _GL_FUNCDECL_RPL_1(rpl_func,rettype,parameters,...) \ 127#define _GL_FUNCDECL_RPL_1(rpl_func,rettype,parameters,...) \
128 _GL_EXTERN_C_FUNC __VA_ARGS__ rettype rpl_func parameters 128 _GL_EXTERN_C_FUNC __VA_ARGS__ rettype rpl_func parameters
129 129
130/* _GL_FUNCDECL_SYS_NAME (func) expands to plain func if C++, and to
131 parenthesized func otherwise. Parenthesization is needed in C23 if
132 the function is like strchr and so is a qualifier-generic macro
133 that expands to something more complicated. */
134#ifdef __cplusplus
135# define _GL_FUNCDECL_SYS_NAME(func) func
136#else
137# define _GL_FUNCDECL_SYS_NAME(func) (func)
138#endif
139
130/* _GL_FUNCDECL_SYS (func, rettype, parameters, [attributes]); 140/* _GL_FUNCDECL_SYS (func, rettype, parameters, [attributes]);
131 declares the system function, named func, with the given prototype, 141 declares the system function, named func, with the given prototype,
132 consisting of return type, parameters, and attributes. 142 consisting of return type, parameters, and attributes.
@@ -139,7 +149,7 @@
139 _GL_FUNCDECL_SYS (posix_openpt, int, (int flags), _GL_ATTRIBUTE_NODISCARD); 149 _GL_FUNCDECL_SYS (posix_openpt, int, (int flags), _GL_ATTRIBUTE_NODISCARD);
140 */ 150 */
141#define _GL_FUNCDECL_SYS(func,rettype,parameters,...) \ 151#define _GL_FUNCDECL_SYS(func,rettype,parameters,...) \
142 _GL_EXTERN_C_FUNC __VA_ARGS__ rettype func parameters 152 _GL_EXTERN_C_FUNC __VA_ARGS__ rettype _GL_FUNCDECL_SYS_NAME (func) parameters
143 153
144/* _GL_CXXALIAS_RPL (func, rettype, parameters); 154/* _GL_CXXALIAS_RPL (func, rettype, parameters);
145 declares a C++ alias called GNULIB_NAMESPACE::func 155 declares a C++ alias called GNULIB_NAMESPACE::func
@@ -310,7 +320,7 @@
310 _GL_CXXALIASWARN_1 (func, GNULIB_NAMESPACE) 320 _GL_CXXALIASWARN_1 (func, GNULIB_NAMESPACE)
311# define _GL_CXXALIASWARN_1(func,namespace) \ 321# define _GL_CXXALIASWARN_1(func,namespace) \
312 _GL_CXXALIASWARN_2 (func, namespace) 322 _GL_CXXALIASWARN_2 (func, namespace)
313/* To work around GCC bug <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=43881>, 323/* To work around GCC bug <https://gcc.gnu.org/PR43881>,
314 we enable the warning only when not optimizing. */ 324 we enable the warning only when not optimizing. */
315# if !(defined __GNUC__ && !defined __clang__ && __OPTIMIZE__) 325# if !(defined __GNUC__ && !defined __clang__ && __OPTIMIZE__)
316# define _GL_CXXALIASWARN_2(func,namespace) \ 326# define _GL_CXXALIASWARN_2(func,namespace) \
@@ -338,7 +348,7 @@
338 GNULIB_NAMESPACE) 348 GNULIB_NAMESPACE)
339# define _GL_CXXALIASWARN1_1(func,rettype,parameters_and_attributes,namespace) \ 349# define _GL_CXXALIASWARN1_1(func,rettype,parameters_and_attributes,namespace) \
340 _GL_CXXALIASWARN1_2 (func, rettype, parameters_and_attributes, namespace) 350 _GL_CXXALIASWARN1_2 (func, rettype, parameters_and_attributes, namespace)
341/* To work around GCC bug <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=43881>, 351/* To work around GCC bug <https://gcc.gnu.org/PR43881>,
342 we enable the warning only when not optimizing. */ 352 we enable the warning only when not optimizing. */
343# if !(defined __GNUC__ && !defined __clang__ && __OPTIMIZE__) 353# if !(defined __GNUC__ && !defined __clang__ && __OPTIMIZE__)
344# define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \ 354# define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \