Double inclusion of C++ wrappers
Closed / Fixed218184ffffffffffffffffffffffffffffffffffCreated 26 years agoUpdated 26 years ago
Descriptionplain2000-10-26 00:54:15
OriginalBugID: 2341 Bug
Version: 8.1.1
SubmitDate: '1999-07-07'
LastModified: '2000-01-25'
Severity: LOW
Status: Closed
Submitter: techsupp
ChangedBy: hobbs
OS: Other
Machine: NA
FixedDate: '2000-10-25'
ClosedDate: '2000-01-25'
Name:
Jan Nijtmans
Comments:
The header file patches are included to demonstrate the effect of the
tool modification. "make genstubs" has the same effect.
ReproducibleScript:
When using "make genstubs", the generated header files contain something
like:
#ifdef __cplusplus
extern "C" {
#endif
extern TclStubs *tclStubsPtr;
#ifdef __cplusplus
}
#endif
This wrapper doesn't serve any function, because
tcl.h contains it already. Further on, the
USE_TCL_STUB_PROCS macro doesn't serve any
function as well, so could as well be removed.
Patch:
*** tools/genStubs.tcl.origTue Jul 6 21:53:47 1999
--- tools/genStubs.tclTue Jul 6 21:58:22 1999
***************
*** 679,690 ****
upvar $textVar text
set upName [string toupper $libraryName]
! append text "\n#if defined(USE_${upName}_STUBS) && !defined(USE_${upName}_STUB_PROCS)\n"
append text "\n/*\n * Inline function declarations:\n */\n\n"
forAllStubs $name makeMacro 0 text
! append text "\n#endif /* defined(USE_${upName}_STUBS) && !defined(USE_${upName}_STUB_PROCS) */\n"
return
}
--- 679,690 ----
upvar $textVar text
set upName [string toupper $libraryName]
! append text "\n#if defined(USE_${upName}_STUBS)\n"
append text "\n/*\n * Inline function declarations:\n */\n\n"
forAllStubs $name makeMacro 0 text
! append text "\n#endif /* defined(USE_${upName}_STUBS) */\n"
return
}
***************
*** 725,733 ****
append text "} ${capName}Stubs;\n"
! append text "\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n"
! append text "extern ${capName}Stubs *${name}StubsPtr;\n"
! append text "#ifdef __cplusplus\n}\n#endif\n"
emitMacros $name text
--- 725,731 ----
append text "} ${capName}Stubs;\n"
! append text "\nextern ${capName}Stubs *${name}StubsPtr;\n"
emitMacros $name text
*** generic/tclDecls.h.origTue Jul 6 21:53:04 1999
--- generic/tclDecls.hTue Jul 6 21:58:53 1999
***************
*** 1653,1667 ****
int (*tcl_RegExpMatchObj) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Obj * stringObj, Tcl_Obj * patternObj)); /* 385 */
} TclStubs;
- #ifdef __cplusplus
- extern "C" {
- #endif
extern TclStubs *tclStubsPtr;
- #ifdef __cplusplus
- }
- #endif
! #if defined(USE_TCL_STUBS) && !defined(USE_TCL_STUB_PROCS)
/*
* Inline function declarations:
--- 1653,1661 ----
int (*tcl_RegExpMatchObj) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Obj * stringObj, Tcl_Obj * patternObj)); /* 385 */
} TclStubs;
extern TclStubs *tclStubsPtr;
! #if defined(USE_TCL_STUBS)
/*
* Inline function declarations:
***************
*** 3232,3238 ****
(tclStubsPtr->tcl_RegExpMatchObj) /* 385 */
#endif
! #endif /* defined(USE_TCL_STUBS) && !defined(USE_TCL_STUB_PROCS) */
/* !END!: Do not edit above this line. */
--- 3226,3232 ----
(tclStubsPtr->tcl_RegExpMatchObj) /* 385 */
#endif
! #endif /* defined(USE_TCL_STUBS) */
/* !END!: Do not edit above this line. */
*** tclIntDecls.h.origTue Jul 6 21:52:55 1999
--- tclIntDecls.hTue Jul 6 21:58:56 1999
***************
*** 673,687 ****
struct AuxDataType * (*tclGetAuxDataType) _ANSI_ARGS_((char * typeName)); /* 145 */
} TclIntStubs;
- #ifdef __cplusplus
- extern "C" {
- #endif
extern TclIntStubs *tclIntStubsPtr;
- #ifdef __cplusplus
- }
- #endif
! #if defined(USE_TCL_STUBS) && !defined(USE_TCL_STUB_PROCS)
/*
* Inline function declarations:
--- 673,681 ----
struct AuxDataType * (*tclGetAuxDataType) _ANSI_ARGS_((char * typeName)); /* 145 */
} TclIntStubs;
extern TclIntStubs *tclIntStubsPtr;
! #if defined(USE_TCL_STUBS)
/*
* Inline function declarations:
***************
*** 1265,1271 ****
(tclIntStubsPtr->tclGetAuxDataType) /* 145 */
#endif
! #endif /* defined(USE_TCL_STUBS) && !defined(USE_TCL_STUB_PROCS) */
/* !END!: Do not edit above this line. */
--- 1259,1265 ----
(tclIntStubsPtr->tclGetAuxDataType) /* 145 */
#endif
! #endif /* defined(USE_TCL_STUBS) */
/* !END!: Do not edit above this line. */
*** tclIntPlatDecls.h.origTue Jul 6 21:53:28 1999
--- tclIntPlatDecls.hTue Jul 6 21:58:57 1999
***************
*** 268,282 ****
#endif /* MAC_TCL */
} TclIntPlatStubs;
- #ifdef __cplusplus
- extern "C" {
- #endif
extern TclIntPlatStubs *tclIntPlatStubsPtr;
- #ifdef __cplusplus
- }
- #endif
! #if defined(USE_TCL_STUBS) && !defined(USE_TCL_STUB_PROCS)
/*
* Inline function declarations:
--- 268,276 ----
#endif /* MAC_TCL */
} TclIntPlatStubs;
extern TclIntPlatStubs *tclIntPlatStubsPtr;
! #if defined(USE_TCL_STUBS)
/*
* Inline function declarations:
***************
*** 518,524 ****
#endif
#endif /* MAC_TCL */
! #endif /* defined(USE_TCL_STUBS) && !defined(USE_TCL_STUB_PROCS) */
/* !END!: Do not edit above this line. */
--- 512,518 ----
#endif
#endif /* MAC_TCL */
! #endif /* defined(USE_TCL_STUBS) */
/* !END!: Do not edit above this line. */
*** tclPlatDecls.h.origTue Jul 6 21:53:15 1999
--- tclPlatDecls.hTue Jul 6 21:58:57 1999
***************
*** 80,94 ****
#endif /* MAC_TCL */
} TclPlatStubs;
- #ifdef __cplusplus
- extern "C" {
- #endif
extern TclPlatStubs *tclPlatStubsPtr;
- #ifdef __cplusplus
- }
- #endif
! #if defined(USE_TCL_STUBS) && !defined(USE_TCL_STUB_PROCS)
/*
* Inline function declarations:
--- 80,88 ----
#endif /* MAC_TCL */
} TclPlatStubs;
extern TclPlatStubs *tclPlatStubsPtr;
! #if defined(USE_TCL_STUBS)
/*
* Inline function declarations:
***************
*** 143,149 ****
#endif
#endif /* MAC_TCL */
! #endif /* defined(USE_TCL_STUBS) && !defined(USE_TCL_STUB_PROCS) */
/* !END!: Do not edit above this line. */
--- 137,143 ----
#endif
#endif /* MAC_TCL */
! #endif /* defined(USE_TCL_STUBS) */
/* !END!: Do not edit above this line. */
PatchFiles:
genStubs.tcl tclDecls.h tclIntDecls.h tclPlatDecls.h tclIntPlatDecls.h
This is not quite correct because headers like tclUnixPort.h that
includes tclPlatDecls.h doesn't do any extern "C" on its own. This
doesn't cause any harm, so its best not to potentially break anything.
-- 01/25/2000 hobbs
welch Closed ticket [218184ffff].
[History diff]2000-10-26 08:16:55
dgp Ticket [218184ffff]: 3 changes
[History diff]2001-04-05 06:54:28
Log in (anonymous is fine) to add a comment.