summaryrefslogtreecommitdiffstats
path: root/unix/tclUnixInit.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2020-02-28 12:06:07 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2020-02-28 12:06:07 (GMT)
commit52e543c5691a60c3ef802fecf1ae08e7efcf19b7 (patch)
tree1f02ba454f2725719d80901eef77168723e980f7 /unix/tclUnixInit.c
parentf9ddbba3d621449f2cb1b2a4d0a94927b48391eb (diff)
parent24a416ad3867b536dd613454c6f07df349f797f2 (diff)
downloadtcl-52e543c5691a60c3ef802fecf1ae08e7efcf19b7.zip
tcl-52e543c5691a60c3ef802fecf1ae08e7efcf19b7.tar.gz
tcl-52e543c5691a60c3ef802fecf1ae08e7efcf19b7.tar.bz2
Implement TIP #557: C++ support for Tcl
Diffstat (limited to 'unix/tclUnixInit.c')
-rw-r--r--unix/tclUnixInit.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/unix/tclUnixInit.c b/unix/tclUnixInit.c
index 218813f..0e61e85 100644
--- a/unix/tclUnixInit.c
+++ b/unix/tclUnixInit.c
@@ -31,6 +31,9 @@
#endif
#ifdef __CYGWIN__
+#ifdef __cplusplus
+extern "C" {
+#endif
#ifdef __clang__
#pragma clang diagnostic ignored "-Wignored-attributes"
#endif
@@ -39,6 +42,9 @@ DLLIMPORT extern __stdcall void *GetModuleHandleW(const void *);
DLLIMPORT extern __stdcall void FreeLibrary(void *);
DLLIMPORT extern __stdcall void *GetProcAddress(void *, const char *);
DLLIMPORT extern __stdcall void GetSystemInfo(void *);
+#ifdef __cplusplus
+}
+#endif
#define NUMPROCESSORS 11
static const char *const processors[NUMPROCESSORS] = {
@@ -540,7 +546,7 @@ TclpInitLibraryPath(
*encodingPtr = Tcl_GetEncoding(NULL, NULL);
str = TclGetString(pathPtr);
*lengthPtr = pathPtr->length;
- *valuePtr = ckalloc(*lengthPtr + 1);
+ *valuePtr = (char *)ckalloc(*lengthPtr + 1);
memcpy(*valuePtr, str, *lengthPtr + 1);
Tcl_DecrRefCount(pathPtr);
}
@@ -1059,6 +1065,10 @@ MacOSXGetLibraryPath(
foundInFramework = Tcl_MacOSXOpenVersionedBundleResources(interp,
"com.tcltk.tcllibrary", TCL_FRAMEWORK_VERSION, 0, maxPathLen,
tclLibPath);
+#else
+ (void)interp;
+ (void)maxPathLen;
+ (void)tclLibPath;
#endif
return foundInFramework;