Use __FUNCTION__, which works on gcc and MSVC 7/8, instead of

__func__, which while standardized works only with gcc.  I'll wait for
bug reports from VC6 before bothering with fallback code...
This commit is contained in:
andy
2007-04-02 16:14:54 +00:00
parent a5f9262adb
commit 7a680fb9f2
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -16,9 +16,9 @@
#define NEWCSTR(c, s) NEWSTR(c, s, strlen(s)) #define NEWCSTR(c, s) NEWSTR(c, s, strlen(s))
// Generic argument error, assumes that the symbol "c" is a naContext, // Generic argument error, assumes that the symbol "c" is a naContext,
// and that the __func__ string is of the form "f_NASALSYMBOL". // and that the __FUNCTION__ string is of the form "f_NASALSYMBOL".
#define ARGERR() \ #define ARGERR() \
naRuntimeError(c, "bad/missing argument to %s()", (__func__ + 2)) naRuntimeError(c, "bad/missing argument to %s()", (__FUNCTION__ + 2))
static naRef f_size(naContext c, naRef me, int argc, naRef* args) static naRef f_size(naContext c, naRef me, int argc, naRef* args)
{ {
+1 -1
View File
@@ -5,7 +5,7 @@
// Toss a runtime error for any NaN or Inf values produced. Note that // Toss a runtime error for any NaN or Inf values produced. Note that
// this assumes an IEEE 754 format. // this assumes an IEEE 754 format.
#define VALIDATE(r) (valid(r.num) ? (r) : die(c, __func__+2)) #define VALIDATE(r) (valid(r.num) ? (r) : die(c, __FUNCTION__+2))
static int valid(double d) static int valid(double d)
{ {