]> granicus.if.org Git - graphviz/commitdiff
No _BEGIN/END_EXTERNS_ in headers with extern "C"
authorErwin Janssen <erwinjanssen@outlook.com>
Mon, 26 Sep 2016 11:35:33 +0000 (13:35 +0200)
committerErwin Janssen <erwinjanssen@outlook.com>
Tue, 4 Oct 2016 14:06:47 +0000 (16:06 +0200)
The defines _BEGIN_EXTERNS_ and _END_EXTERNS_ define `extern "C"` based on compilation with C++. However, the header files containing this define already have this check in a more conventional way. This additional define is therefore not needed in these files.

lib/cgraph/cgraph.h
lib/dotgen/dotprocs.h
lib/dotgen2/dot2procs.h
lib/sfio/Sfio_dc/sfdisc.h
lib/sfio/sfhdr.h
lib/sfio/sfio.h
lib/sfio/vthread.h
lib/vmalloc/vmalloc.h
lib/vmalloc/vmhdr.h

index 8bbcad68c523fb8a36ee965b1417b0c8ed72bc17..23376229f7a51d4bcf2b912737e935b904b60800 100644 (file)
@@ -461,9 +461,7 @@ and edges are embedded in main graph objects but allocated separately in subgrap
 #define EDGEOF(sn,rep)         (AGSNMAIN(sn)?((Agedge_t*)((unsigned char*)(rep) - offsetof(Agedge_t,seq_link))) : ((Dthold_t*)(rep))->obj)
 
 #undef extern
-#if defined(_PACKAGE_ast)
-_END_EXTERNS_
-#endif
+
 #ifdef __cplusplus
 }
 #endif
index 8c2aa86e14c300279514c16fda1e3d7ca5bd0d87..4bef78594e53fb367940c0c680fb2e2022290206 100644 (file)
 #ifndef DOTPROCS_H
 #define DOTPROCS_H
 
-#ifdef _BEGIN_EXTERNS_
-_BEGIN_EXTERNS_                        /* public data */
-#endif
-/* tabs at 8, or you're a sorry loser */
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -88,9 +84,6 @@ extern "C" {
     extern void dot_splines(Agraph_t *);
 #undef extern
 
-#ifdef _END_EXTERNS_
-     _END_EXTERNS_
-#endif
 #ifdef __cplusplus
 }
 #endif
index b1f5b05263551790a199ac419227aad5fc774d9e..622fe6dc6afc75b9c28808e704870d9c00d4bf5b 100644 (file)
 #ifndef DOT2PROCS_H
 #define DOT2PROCS_H
 
-#ifdef _BEGIN_EXTERNS_
-_BEGIN_EXTERNS_                 /* public data */
-#endif
-/* tabs at 8, or you're a sorry loser */
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -34,9 +30,6 @@ extern int is_nonconstraint(edge_t * e);
     /* extern void dot_splines(Agraph_t *); */
 #undef extern
 
-#ifdef _END_EXTERNS_
-     _END_EXTERNS_
-#endif
 #ifdef __cplusplus
 }
 #endif
index 7b49741b00f9b8cd898ddd01be3dd42238ec2261..9e12e872b19128ffaacb391819abd48aaa109695 100644 (file)
@@ -20,7 +20,6 @@ extern "C" {
 
 #include       <sfio.h>
 
-    _BEGIN_EXTERNS_
 /* functions to create disciplines */
     extern int sfdcdos(Sfio_t *);
     extern int sfdcfilter(Sfio_t *, const char *);
@@ -30,7 +29,6 @@ extern "C" {
     extern int sfdcsubstream(Sfio_t *, Sfio_t *, Sfoff_t, Sfoff_t);
     extern int sfdctee(Sfio_t *, Sfio_t *);
     extern int sfdcunion(Sfio_t *, Sfio_t **, int);
-     _END_EXTERNS_
 #endif
 #ifdef __cplusplus
 }
index 1d95ed157c9a97d62830ab8ef63df619e4899d46..bc644fe5691c019e4063dcbe5e603b05af9f3408 100644 (file)
@@ -890,7 +890,7 @@ extern "C" {
          case  1 : *s++ = c; \
        }
 
-     _BEGIN_EXTERNS_ extern Sfextern_t _Sfextern;
+    extern Sfextern_t _Sfextern;
     extern Sftab_t _Sftable;
 
     extern int _sfpopen(Sfio_t *, int, int, int);
@@ -992,7 +992,6 @@ extern "C" {
 
 #endif                         /* defined(_PACKAGE_ast) */
 
-     _END_EXTERNS_
 #endif /*_SFHDR_H*/
 #ifdef __cplusplus
 }
index c15e0ff7624bcda73a27d69f3ff81bb9aff045d1..ddd7666561a9052e6822f091d98b60c97882d0e8 100644 (file)
@@ -274,7 +274,7 @@ extern "C" {
 #define SF_BUFSIZE     8192    /* default buffer size                  */
 #define SF_UNBOUND     (-1)    /* unbounded buffer size                */
 
-     _BEGIN_EXTERNS_ extern ssize_t _Sfi;
+     extern ssize_t _Sfi;
 
 #if defined(_BLD_sfio) && defined(GVDLL)
 #define extern __declspec(dllexport)
@@ -389,7 +389,7 @@ extern "C" {
     extern ssize_t sfslen(void);
 
 #undef extern
-     _END_EXTERNS_
+
 /* coding long integers in a portable and compact fashion */
 #define SF_SBITS       6
 #define SF_UBITS       7
index 06c11955d72f61f91bd7df3542bc4767caef2f5f..a186943ce9cfa2270a3e96f90595067e4b849786 100644 (file)
@@ -101,7 +101,7 @@ extern "C" {
 #define EPERM                  1
 #endif
 
-     _BEGIN_EXTERNS_ extern Vthread_t *vtopen(Vthread_t *, int);
+    extern Vthread_t *vtopen(Vthread_t *, int);
     extern int vtclose(Vthread_t *);
     extern int vtset(Vthread_t *, int, void *);
     extern int vtrun(Vthread_t *, void *(*)(void *), void *);
@@ -122,7 +122,6 @@ extern "C" {
     extern int vtmtxerror(Vtmutex_t *);
     extern int vtonceerror(Vtonce_t *);
 
-     _END_EXTERNS_
 #if defined(vt_threaded) && vt_threaded
 /* mutex structure */
        struct _vtmutex_s {
index c546f2d0ad5cd860af398ce23fa2b073cfe80199..e66a230c8de68ad97fa739d897f72c72364a977e 100644 (file)
@@ -101,7 +101,7 @@ extern "C" {
 #define VM_BADADDR     3       /* bad addr in vmfree/vmresize  */
 #define VM_DISC                4       /* discipline being changed     */
 
-     _BEGIN_EXTERNS_           /* public data */
+/* public data */
 #if _BLD_vmalloc && defined(__EXPORT__)
 #define extern __EXPORT__
 #endif
@@ -131,7 +131,7 @@ extern "C" {
     extern Vmalloc_t *Vmheap;  /* heap region                  */
     extern Vmalloc_t *Vmregion;        /* malloc region                */
 
-     _END_EXTERNS_ _BEGIN_EXTERNS_     /* public functions */
+/* public functions */
 #if _BLD_vmalloc && defined(__EXPORT__)
 #define extern __EXPORT__
 #endif
@@ -171,7 +171,7 @@ extern "C" {
 
 
 #undef extern
-     _END_EXTERNS_
+
 /* to coerce any value to a Vmalloc_t*, make ANSI happy */
 #define _VM_(vm)       ((Vmalloc_t*)(vm))
 /* enable recording of where a call originates from */
index b8e8b97db32aa8b579e7eb54302ba3134668e960..551c53f16817752c4d12a02604df62d06d69aa12 100644 (file)
@@ -430,7 +430,7 @@ extern "C" {
 #define _Vmtrace       (_Vmextern.vm_trace)
 #define _Vmpfclose     (_Vmextern.vm_pfclose)
 
-     _BEGIN_EXTERNS_ extern Vmextern_t _Vmextern;
+     extern Vmextern_t _Vmextern;
 
 
 #if !defined(_PACKAGE_ast)
@@ -473,7 +473,6 @@ extern "C" {
     extern Vmuchar_t *sbrk(ssize_t);
 #endif
 
-     _END_EXTERNS_
 #endif                         /* _VMHDR_H */
 #ifdef __cplusplus
 }