]> granicus.if.org Git - graphviz/commitdiff
Remove remaining defines and usage of `__STD_C`
authorErwin Janssen <erwinjanssen@outlook.com>
Mon, 19 Sep 2016 12:56:43 +0000 (14:56 +0200)
committerErwin Janssen <erwinjanssen@outlook.com>
Mon, 19 Sep 2016 12:56:43 +0000 (14:56 +0200)
We are compiling with standard C99, so there is no need to define and
check for `__STD_C`, it is always true.

12 files changed:
ast_common.h.in
features/common
lib/cdt/features/common
lib/sfio/features/common
lib/sfio/sfhdr.h
lib/sfio/sfprintf.c
lib/sfio/sfprints.c
lib/sfio/sfscanf.c
lib/vmalloc/features/common
lib/vmalloc/vmalloc.h
lib/vmalloc/vmhdr.h
windows/include/ast_common.h

index ab1b67133c68babe0302ebf0c4fc88197801db35..1e71ad661860b051f534b17c7c50d466affcad05 100644 (file)
 #define _proto_stdc 1          /* Standard-C prototypes ok  */
 /* */
 
-/* __STD_C indicates that the language is ANSI-C or C++ */
-#if !defined(__STD_C) && defined(__STDC__)
-#define __STD_C         1
-#endif
-#if !defined(__STD_C) && (defined(__cplusplus) || defined(c_plusplus))
-#define __STD_C         1
-#endif
-#if !defined(__STD_C) && _proto_stdc
-#define __STD_C         1
-#endif
-#if !defined(__STD_C)
-#define __STD_C         0
-#endif
-
 /* extern symbols must be protected against C++ name mangling */
 #ifndef _BEGIN_EXTERNS_
 #  if defined(__cplusplus) || defined(c_plusplus)
 
 /* _ARG_ simplifies function prototyping among flavors of C */
 #ifndef _ARG_
-#if __STD_C
 #define _ARG_(x)        x
-#else
-#define _ARG_(x)        ()
-#endif
 #endif /*_ARG_*/
 
 /* __INLINE__ is the inline keyword */
 
 /* Void_t is defined so that Void_t* can address any type */
 #ifndef Void_t
-#if __STD_C
 #define Void_t          void
-#else
-#define Void_t          char
-#endif
 #endif                         /*Void_t */
 
 /* dynamic linked library external scope handling */
index e382b53785f187816ede0ad3e5042f028d5e99d4..12d98d11ed9c7602eb5f47b9c37d878281a90349 100644 (file)
@@ -66,20 +66,6 @@ xopen        stdio note{ Stdio fseek/fflush are X/Open-compliant }end execute{
 }end
 
 cat{
-       
-       /* __STD_C indicates that the language is ANSI-C or C++ */
-       #if !defined(__STD_C) && __STDC__
-       #define __STD_C         1
-       #endif
-       #if !defined(__STD_C) && (__cplusplus || c_plusplus)
-       #define __STD_C         1
-       #endif
-       #if !defined(__STD_C) && _proto_stdc
-       #define __STD_C         1
-       #endif
-       #if !defined(__STD_C)
-       #define __STD_C         0
-       #endif
 
        /* extern symbols must be protected against C++ name mangling */
        #ifndef _BEGIN_EXTERNS_
@@ -94,11 +80,7 @@ cat{
 
        /* _ARG_ simplifies function prototyping among flavors of C */
        #ifndef _ARG_
-       #if __STD_C
        #define _ARG_(x)        x
-       #else
-       #define _ARG_(x)        ()
-       #endif
        #endif /*_ARG_*/
 
        /* __INLINE__ is the inline keyword */
@@ -111,11 +93,7 @@ cat{
 
        /* Void_t is defined so that Void_t* can address any type */
        #ifndef Void_t
-       #if __STD_C
        #define Void_t          void
-       #else
-       #define Void_t          char
-       #endif
        #endif /*Void_t*/
 
        /* dynamic linked library external scope handling */
index aaa2ea223ce7ab466723f5df9ce6526a72274d9e..8b59049f06bd7ded2274594893f0ab83605a89d3 100644 (file)
@@ -68,20 +68,6 @@ xopen        stdio note{ Stdio fseek/fflush are X/Open-compliant }end execute{
 }end
 
 cat{
-       
-       /* __STD_C indicates that the language is ANSI-C or C++ */
-       #if !defined(__STD_C) && __STDC__
-       #define __STD_C         1
-       #endif
-       #if !defined(__STD_C) && (__cplusplus || c_plusplus)
-       #define __STD_C         1
-       #endif
-       #if !defined(__STD_C) && _proto_stdc
-       #define __STD_C         1
-       #endif
-       #if !defined(__STD_C)
-       #define __STD_C         0
-       #endif
 
        /* extern symbols must be protected against C++ name mangling */
        #ifndef _BEGIN_EXTERNS_
@@ -96,11 +82,7 @@ cat{
 
        /* _ARG_ simplifies function prototyping among flavors of C */
        #ifndef _ARG_
-       #if __STD_C
        #define _ARG_(x)        x
-       #else
-       #define _ARG_(x)        ()
-       #endif
        #endif /*_ARG_*/
 
        /* __INLINE__ is the inline keyword */
@@ -113,11 +95,7 @@ cat{
 
        /* Void_t is defined so that Void_t* can address any type */
        #ifndef Void_t
-       #if __STD_C
        #define Void_t          void
-       #else
-       #define Void_t          char
-       #endif
        #endif /*Void_t*/
 
        /* dynamic linked library external scope handling */
index 97bade2d05ecd12043180ce6b69b00c3f9324072..8f649c96a82f8ca358005b9a033cd41786cb4996 100644 (file)
@@ -66,20 +66,6 @@ xopen        stdio note{ Stdio fseek/fflush are X/Open-compliant }end execute{
 }end
 
 cat{
-       
-       /* __STD_C indicates that the language is ANSI-C or C++ */
-       #if !defined(__STD_C) && __STDC__
-       #define __STD_C         1
-       #endif
-       #if !defined(__STD_C) && (__cplusplus || c_plusplus)
-       #define __STD_C         1
-       #endif
-       #if !defined(__STD_C) && _proto_stdc
-       #define __STD_C         1
-       #endif
-       #if !defined(__STD_C)
-       #define __STD_C         0
-       #endif
 
        /* extern symbols must be protected against C++ name mangling */
        #ifndef _BEGIN_EXTERNS_
@@ -94,11 +80,7 @@ cat{
 
        /* _ARG_ simplifies function prototyping among flavors of C */
        #ifndef _ARG_
-       #if __STD_C
        #define _ARG_(x)        x
-       #else
-       #define _ARG_(x)        ()
-       #endif
        #endif /*_ARG_*/
 
        /* __INLINE__ is the inline keyword */
@@ -111,11 +93,7 @@ cat{
 
        /* Void_t is defined so that Void_t* can address any type */
        #ifndef Void_t
-       #if __STD_C
        #define Void_t          void
-       #else
-       #define Void_t          char
-       #endif
        #endif /*Void_t*/
 
        /* dynamic linked library external scope handling */
index 2658f1f801be9b699614bec4db5ed1632baee361..c08493647c1e578a7d4297af3b5ecb4f2c6355b9 100644 (file)
@@ -258,11 +258,7 @@ extern "C" {
 #endif
 
 /* to get rid of pesky compiler warnings */
-#if __STD_C
 #define NOTUSED(x)     (void)(x)
-#else
-#define NOTUSED(x)     (&x,1)
-#endif
 
 /* Private flags in the "bits" field */
 #define SF_MMAP                00000001        /* in memory mapping mode               */
index d04211fea5368c975f019c1e310feeee1f570b92..62521eeeb1c8d524b61e324c338e99f3f1f07de5 100644 (file)
@@ -23,15 +23,7 @@ int sfprintf(Sfio_t * f, const char *form, ...)
     va_list args;
     reg int rv;
 
-#if __STD_C
     va_start(args, form);
-#else
-    reg Sfio_t *f;
-    reg char *form;
-    va_start(args);
-    f = va_arg(args, Sfio_t *);
-    form = va_arg(args, char *);
-#endif
     rv = sfvprintf(f, form, args);
 
     va_end(args);
@@ -66,19 +58,7 @@ int sfsprintf(char *s, int n, const char *form, ...)
 {
     va_list args;
     reg int rv;
-
-#if __STD_C
     va_start(args, form);
-#else
-    reg char *s;
-    reg int n;
-    reg char *form;
-    va_start(args);
-    s = va_arg(args, char *);
-    n = va_arg(args, int);
-    form = va_arg(args, char *);
-#endif
-
     rv = sfvsprintf(s, n, form, args);
     va_end(args);
 
index 8bbac855d1a0ccb4d6fc25ce433d022138b8a3d0..1d933dfddf80703b42d9dd7885f9cd54bcee984b 100644 (file)
@@ -25,14 +25,7 @@ char *sfprints(const char *form, ...)
     va_list args;
     reg int rv;
     static Sfio_t *f;
-
-#if __STD_C
     va_start(args, form);
-#else
-    reg char *form;
-    va_start(args);
-    form = va_arg(args, char *);
-#endif
 
     /* make a fake stream */
     if (!f &&
index 0a2f4b3fa57179ba9053264d283b3de75964d436..cf4e5ca1758c70aa624150f91f4d139f63028560 100644 (file)
@@ -22,17 +22,7 @@ int sfscanf(Sfio_t * f, const char *form, ...)
 {
     va_list args;
     reg int rv;
-
-#if __STD_C
     va_start(args, form);
-#else
-    reg Sfio_t *f;
-    reg char *form;
-    va_start(args);
-    f = va_arg(args, Sfio_t *);
-    form = va_arg(args, char *);
-#endif
-
     rv = (f && form) ? sfvscanf(f, form, args) : -1;
     va_end(args);
     return rv;
@@ -61,16 +51,7 @@ int sfsscanf(const char *s, const char *form, ...)
 {
     va_list args;
     reg int rv;
-#if __STD_C
     va_start(args, form);
-#else
-    reg char *s;
-    reg char *form;
-    va_start(args);
-    s = va_arg(args, char *);
-    form = va_arg(args, char *);
-#endif
-
     rv = (s && form) ? sfvsscanf(s, form, args) : -1;
     va_end(args);
     return rv;
index 97bade2d05ecd12043180ce6b69b00c3f9324072..8f649c96a82f8ca358005b9a033cd41786cb4996 100644 (file)
@@ -66,20 +66,6 @@ xopen        stdio note{ Stdio fseek/fflush are X/Open-compliant }end execute{
 }end
 
 cat{
-       
-       /* __STD_C indicates that the language is ANSI-C or C++ */
-       #if !defined(__STD_C) && __STDC__
-       #define __STD_C         1
-       #endif
-       #if !defined(__STD_C) && (__cplusplus || c_plusplus)
-       #define __STD_C         1
-       #endif
-       #if !defined(__STD_C) && _proto_stdc
-       #define __STD_C         1
-       #endif
-       #if !defined(__STD_C)
-       #define __STD_C         0
-       #endif
 
        /* extern symbols must be protected against C++ name mangling */
        #ifndef _BEGIN_EXTERNS_
@@ -94,11 +80,7 @@ cat{
 
        /* _ARG_ simplifies function prototyping among flavors of C */
        #ifndef _ARG_
-       #if __STD_C
        #define _ARG_(x)        x
-       #else
-       #define _ARG_(x)        ()
-       #endif
        #endif /*_ARG_*/
 
        /* __INLINE__ is the inline keyword */
@@ -111,11 +93,7 @@ cat{
 
        /* Void_t is defined so that Void_t* can address any type */
        #ifndef Void_t
-       #if __STD_C
        #define Void_t          void
-       #else
-       #define Void_t          char
-       #endif
        #endif /*Void_t*/
 
        /* dynamic linked library external scope handling */
index b996ed987fdd67d71e22b77ded7218e09041608f..14a5f39023250e1b98248679686f6f914aee699f 100644 (file)
@@ -186,27 +186,12 @@ extern "C" {
                                 (*(_VM_(vm)->meth.freef))((vm),(Void_t*)(d)) )
 #define vmalign(vm,sz,align)   (_VMFL_(vm), \
                                 (*(_VM_(vm)->meth.alignf))((vm),(sz),(align)) )
-#if __STD_C || defined(__STDPP__) || defined(__GNUC__)
 #define malloc(s)              (_VMFL_(Vmregion), malloc((size_t)(s)) )
 #define realloc(d,s)           (_VMFL_(Vmregion), realloc((Void_t*)(d),(size_t)(s)) )
 #define calloc(n,s)            (_VMFL_(Vmregion), calloc((size_t)n, (size_t)(s)) )
 #define free(d)                        (_VMFL_(Vmregion), free((Void_t*)(d)) )
 #define memalign(a,s)          (_VMFL_(Vmregion), memalign((size_t)(a),(size_t)(s)) )
 #define valloc(s)              (_VMFL_(Vmregion), valloc((size_t)(s) )
-#else
-#define _VMNM_(a,b,c,d,e,f)    a/**/b/**/c/**/d/**/e/**/f
-#define malloc(s)              (_VMFL_(Vmregion), _VMNM_(mallo,/,*,*,/,c)\
-                                               ((size_t)(s)) )
-#define realloc(d,s)           (_VMFL_(Vmregion), _VMNM_(reallo,/,*,*,/,c)\
-                                               ((Void_t*)(d),(size_t)(s)) )
-#define calloc(n,s)            (_VMFL_(Vmregion), _VMNM_(callo,/,*,*,/,c)\
-                                               ((size_t)n, (size_t)(s)) )
-#define free(d)                        (_VMFL_(Vmregion), _VMNM_(fre,/,*,*,/,e)((Void_t*)(d)) )
-#define memalign(a,s)          (_VMFL_(Vmregion), _VMNM_(memalig,/,*,*,/,n)\
-                                               ((size_t)(a),(size_t)(s)) )
-#define valloc(s)              (_VMFL_(Vmregion), _VMNM_(vallo,/,*,*,/,c)\
-                                               ((size_t)(s) )
-#endif /*__STD_C || defined(__STDPP__) || defined(__GNUC__)*/
 #define cfree(d)               free(d)
 #endif                         /*defined(VMFL) && defined(__FILE__) && defined(__LINE__) */
 /* non-debugging/profiling allocation calls */
index bdb7154397c82e8bc2edec579ed8a94ce19b3adf..509a9ad5c806fd1d2388caaff4b2b3e303e1273f 100644 (file)
@@ -71,11 +71,7 @@ extern "C" {
 
 #define NIL(t)         ((t)0)
 #define reg            register
-#if __STD_C
 #define NOTUSED(x)     (void)(x)
-#else
-#define NOTUSED(x)     (&x,1)
-#endif
 
 /* convert an address to an integral value */
 #define VLONG(addr)    ((Vmulong_t)((char*)(addr) - (char*)0) )
index d1c7e58d0cb9ff5ee5c6909a467498e8c3d6bc44..2ca6cf2fac5e6d5184852d2ff2cc6337d9890e26 100644 (file)
 #undef _proto_stdc
 #define _proto_stdc    1       /* Standard-C prototypes ok */
 
-/* __STD_C indicates that the language is ANSI-C or C++ */
-#if !defined(__STD_C) && defined(__STDC__)
-#define        __STD_C         1
-#endif
-#if !defined(__STD_C) && (defined(__cplusplus) || defined(c_plusplus))
-#define __STD_C                1
-#endif
-#if !defined(__STD_C) && defined(_proto_stdc)
-#define __STD_C                1
-#endif
-#if !defined(__STD_C)
-#define __STD_C                0
-#endif
-
 /* extern symbols must be protected against C++ name mangling */
 #ifndef _BEGIN_EXTERNS_
 #if defined(__cplusplus) || defined(c_plusplus)
 
 /* _ARG_ simplifies function prototyping among flavors of C */
 #ifndef _ARG_
-#if __STD_C
 #define _ARG_(x)       x
-#else
-#define _ARG_(x)       ()
-#endif
 #endif /*_ARG_*/
 
 /* __INLINE__ is the inline keyword */
 
 /* Void_t is defined so that Void_t* can address any type */
 #ifndef Void_t
-#if __STD_C
 #define Void_t         void
-#else
-#define Void_t         char
-#endif
 #endif                         /*Void_t */
 
 /* dynamic linked library external scope handling */