From: Wolfgang Bumiller Date: Sat, 11 Feb 2017 10:57:48 +0000 (+0100) Subject: Add GMQCC_FUNCTION X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=242604b3ef51a62f7ee166f7ecdae64ca0e6e9eb;p=xonotic%2Fgmqcc.git Add GMQCC_FUNCTION Fixes #160 --- diff --git a/exec.c b/exec.c index 43d1980..d1bef7e 100644 --- a/exec.c +++ b/exec.c @@ -621,7 +621,7 @@ static qcvm_parameter *main_params = NULL; if (prog->argc != (num)) { \ prog->vmerror++; \ fprintf(stderr, "ERROR: invalid number of arguments for %s: %i, expected %i\n", \ - __FUNCTION__, prog->argc, (num)); \ + GMQCC_FUNCTION, prog->argc, (num)); \ return -1; \ } \ } while (0) diff --git a/gmqcc.h b/gmqcc.h index bc65ec0..c853623 100644 --- a/gmqcc.h +++ b/gmqcc.h @@ -103,6 +103,7 @@ GMQCC_IND_STRING(GMQCC_VERSION_PATCH) \ #if defined(__GNUC__) || defined(__CLANG__) # define GMQCC_WARN __attribute__((warn_unused_result)) # define GMQCC_USED __attribute__((used)) +# define GMQCC_FUNCTION __func__ #else # define GMQCC_WARN # define GMQCC_USED @@ -134,10 +135,15 @@ GMQCC_IND_STRING(GMQCC_VERSION_PATCH) \ */ #elif defined(_MSC_VER) # define GMQCC_INLINE __forceinline +# define GMQCC_FUNCTION __FUNCTION__ #else # define GMQCC_INLINE #endif /*! __STDC_VERSION__ */ +#ifndef GMQCC_FUNCTION +# define GMQCC_FUNCTION "" +#endif + /* * noreturn is present in GCC and clang * it's required for _ast_node_destory otherwise -Wmissing-noreturn