]> git.wh0rd.org - fontconfig.git/commitdiff
Don't use varargs CPP macros in fccache.c. (bug 8733)
authorKean Johnston <kean@armory.com>
Sat, 2 Dec 2006 21:36:56 +0000 (13:36 -0800)
committerKeith Packard <keithp@neko.keithp.com>
Sat, 2 Dec 2006 21:36:56 +0000 (13:36 -0800)
src/fccache.c uses a trick to try and use a function name that is also a
macro name. It does this using the varargs args() macro. Replace that
with separate macros for each number of formals.

src/fccache.c

index ba6af72ea880f751f6968968f2b77f08e95dff65..3185059c4f229246d5bb38652606f6417e7205a9 100644 (file)
@@ -826,16 +826,17 @@ FcDirCacheWrite (FcCache *cache, FcConfig *config)
  * Hokey little macro trick to permit the definitions of C functions
  * with the same name as CPP macros
  */
-#define args(x...)         (x)
+#define args1(x)           (x)
+#define args2(x,y)         (x,y)
 
 const FcChar8 *
-FcCacheDir args(const FcCache *c)
+FcCacheDir args1(const FcCache *c)
 {
     return FcCacheDir (c);
 }
 
 FcFontSet *
-FcCacheCopySet args(const FcCache *c)
+FcCacheCopySet args1(const FcCache *c)
 {
     FcFontSet  *old = FcCacheSet (c);
     FcFontSet  *new = FcFontSetCreate ();
@@ -858,19 +859,19 @@ FcCacheCopySet args(const FcCache *c)
 }
 
 const FcChar8 *
-FcCacheSubdir args(const FcCache *c, int i)
+FcCacheSubdir args2(const FcCache *c, int i)
 {
     return FcCacheSubdir (c, i);
 }
 
 int
-FcCacheNumSubdir args(const FcCache *c)
+FcCacheNumSubdir args1(const FcCache *c)
 {
     return c->dirs_count;
 }
 
 int
-FcCacheNumFont args(const FcCache *c)
+FcCacheNumFont args1(const FcCache *c)
 {
     return FcCacheSet(c)->nfont;
 }