From: Erwin Janssen Date: Mon, 26 Sep 2016 11:35:33 +0000 (+0200) Subject: No _BEGIN/END_EXTERNS_ in headers with extern "C" X-Git-Tag: untagged-5fc0363bc76319758ff6~1^2^2~4 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e33b3f116d075697fd387f179496c57b6b6720be;p=graphviz No _BEGIN/END_EXTERNS_ in headers with extern "C" 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. --- diff --git a/lib/cgraph/cgraph.h b/lib/cgraph/cgraph.h index 8bbcad68c..23376229f 100644 --- a/lib/cgraph/cgraph.h +++ b/lib/cgraph/cgraph.h @@ -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 diff --git a/lib/dotgen/dotprocs.h b/lib/dotgen/dotprocs.h index 8c2aa86e1..4bef78594 100644 --- a/lib/dotgen/dotprocs.h +++ b/lib/dotgen/dotprocs.h @@ -14,10 +14,6 @@ #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 diff --git a/lib/dotgen2/dot2procs.h b/lib/dotgen2/dot2procs.h index b1f5b0526..622fe6dc6 100644 --- a/lib/dotgen2/dot2procs.h +++ b/lib/dotgen2/dot2procs.h @@ -14,10 +14,6 @@ #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 diff --git a/lib/sfio/Sfio_dc/sfdisc.h b/lib/sfio/Sfio_dc/sfdisc.h index 7b49741b0..9e12e872b 100644 --- a/lib/sfio/Sfio_dc/sfdisc.h +++ b/lib/sfio/Sfio_dc/sfdisc.h @@ -20,7 +20,6 @@ extern "C" { #include - _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 } diff --git a/lib/sfio/sfhdr.h b/lib/sfio/sfhdr.h index 1d95ed157..bc644fe56 100644 --- a/lib/sfio/sfhdr.h +++ b/lib/sfio/sfhdr.h @@ -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 } diff --git a/lib/sfio/sfio.h b/lib/sfio/sfio.h index c15e0ff76..ddd766656 100644 --- a/lib/sfio/sfio.h +++ b/lib/sfio/sfio.h @@ -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 diff --git a/lib/sfio/vthread.h b/lib/sfio/vthread.h index 06c11955d..a186943ce 100644 --- a/lib/sfio/vthread.h +++ b/lib/sfio/vthread.h @@ -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 { diff --git a/lib/vmalloc/vmalloc.h b/lib/vmalloc/vmalloc.h index c546f2d0a..e66a230c8 100644 --- a/lib/vmalloc/vmalloc.h +++ b/lib/vmalloc/vmalloc.h @@ -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 */ diff --git a/lib/vmalloc/vmhdr.h b/lib/vmalloc/vmhdr.h index b8e8b97db..551c53f16 100644 --- a/lib/vmalloc/vmhdr.h +++ b/lib/vmalloc/vmhdr.h @@ -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 }