X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=build-aux%2Fwarn-on-use.h;h=37b6d2986a367deaefc1fcd77d71d3d255b659ff;hb=eae8e44ccfca3e367df3be11c3f5de48c4302093;hp=3d93a9e9716143fa69b1cffc16ec46d885e4af97;hpb=039dc49e7e584131dc304bfb99b6e52812092827;p=gnulib.git diff --git a/build-aux/warn-on-use.h b/build-aux/warn-on-use.h index 3d93a9e97..37b6d2986 100644 --- a/build-aux/warn-on-use.h +++ b/build-aux/warn-on-use.h @@ -14,7 +14,7 @@ You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ -/* _GL_WARN_ON_USE(function, "literal string") issues a declaration +/* _GL_WARN_ON_USE (function, "literal string") issues a declaration for FUNCTION which will then trigger a compiler warning containing the text of "literal string" anywhere that function is called, if supported by the compiler. If the compiler does not support this @@ -70,6 +70,33 @@ extern __typeof__ (function) function __attribute__ ((__warning__ (message))) # else /* Unsupported. */ # define _GL_WARN_ON_USE(function, message) \ -extern int _gl_warn_on_use +_GL_WARN_EXTERN_C int _gl_warn_on_use +# endif +#endif + +/* _GL_WARN_ON_USE_CXX (function, rettype, parameters_and_attributes, "string") + is like _GL_WARN_ON_USE (function, "string"), except that the function is + declared with the given prototype, consisting of return type, parameters, + and attributes. + This variant is useful for overloaded functions in C++. _GL_WARN_ON_USE does + not work in this case. */ +#ifndef _GL_WARN_ON_USE_CXX +# if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__) +# define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \ +extern rettype function parameters_and_attributes \ + __attribute__ ((__warning__ (msg))) +# else /* Unsupported. */ +# define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \ +_GL_WARN_EXTERN_C int _gl_warn_on_use +# endif +#endif + +/* _GL_WARN_EXTERN_C declaration; + performs the declaration with C linkage. */ +#ifndef _GL_WARN_EXTERN_C +# if defined __cplusplus +# define _GL_WARN_EXTERN_C extern "C" +# else +# define _GL_WARN_EXTERN_C extern # endif #endif