summaryrefslogtreecommitdiffstats
path: root/generic/ttk
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2013-10-31 09:27:11 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2013-10-31 09:27:11 (GMT)
commitfaf078a2709835cbdb9c68f697d7d376e83e2e1c (patch)
treeb0c5ab37fa9ac435be51a5019b478964c876194b /generic/ttk
parent89b73ce8de124a5e7713eaf13e089ce848f5d7b3 (diff)
parent89b2c07cd610dcb6022a73c10c7880ec9822551b (diff)
downloadtk-faf078a2709835cbdb9c68f697d7d376e83e2e1c.zip
tk-faf078a2709835cbdb9c68f697d7d376e83e2e1c.tar.gz
tk-faf078a2709835cbdb9c68f697d7d376e83e2e1c.tar.bz2
Put extern "C" guards around all stub table struct definitions,
so it is usable to be used for C++ compilers as well without the danger of modifying the calling convention. For tkDecls.h, ttkDecls.h tkIntXlibDecls.h is was no problem, because tk.h, tkTheme.h and Xlib.h already contain those guards. But not for the other *Decls.h files.
Diffstat (limited to 'generic/ttk')
-rw-r--r--generic/ttk/ttkDecls.h8
-rw-r--r--generic/ttk/ttkGenStubs.tcl8
2 files changed, 10 insertions, 6 deletions
diff --git a/generic/ttk/ttkDecls.h b/generic/ttk/ttkDecls.h
index 5f7cb0c..6701724 100644
--- a/generic/ttk/ttkDecls.h
+++ b/generic/ttk/ttkDecls.h
@@ -23,6 +23,10 @@ extern const char *TtkInitializeStubs(
#define TTK_STUBS_EPOCH 0
#define TTK_STUBS_REVISION 31
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/*
* Exported function declarations:
*/
@@ -178,10 +182,8 @@ typedef struct TtkStubs {
int (*ttk_GetOrientFromObj) (Tcl_Interp *interp, Tcl_Obj *objPtr, int *orient); /* 40 */
} TtkStubs;
-#ifdef __cplusplus
-extern "C" {
-#endif
extern const TtkStubs *ttkStubsPtr;
+
#ifdef __cplusplus
}
#endif
diff --git a/generic/ttk/ttkGenStubs.tcl b/generic/ttk/ttkGenStubs.tcl
index d8e9a8a..5e56951 100644
--- a/generic/ttk/ttkGenStubs.tcl
+++ b/generic/ttk/ttkGenStubs.tcl
@@ -769,6 +769,8 @@ proc genStubs::emitHeader {name} {
append text "#define ${CAPName}_STUBS_REVISION $revision\n"
}
+ append text "\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n"
+
emitDeclarations $name text
if {[info exists hooks($name)]} {
@@ -796,8 +798,7 @@ proc genStubs::emitHeader {name} {
append text "} ${capName}Stubs;\n\n"
- append text "#ifdef __cplusplus\nextern \"C\" {\n#endif\n"
- append text "extern const ${capName}Stubs *${name}StubsPtr;\n"
+ append text "extern const ${capName}Stubs *${name}StubsPtr;\n\n"
append text "#ifdef __cplusplus\n}\n#endif\n"
emitMacros $name text
@@ -821,9 +822,10 @@ proc genStubs::emitInit {name textVar} {
variable hooks
variable interfaces
variable epoch
+ variable revision
upvar $textVar text
- set root 1
+ set root 1
set capName [string toupper [string index $name 0]]
append capName [string range $name 1 end]