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)
#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
*/
#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 "<unknown-function>"
+#endif
+
/*
* noreturn is present in GCC and clang
* it's required for _ast_node_destory otherwise -Wmissing-noreturn