3c790afd3b
Changes in 8.5.16 Changed Tcl behavior - Unicode 7.0 charset (within BMP) - [scan %E%G%X]. Updated packages - http 2.7.13 - tcltest 2.3.8 - platform 1.0.13 Changes in 8.5.17 Changed Tcl behavior - Fixed several I/O bugs introduced in 8.5.16. Changes in 8.5.18 (none) Changes in 8.5.19 New global variables - tcl_platform(engine) TIP440 Changed Tcl behavior - Update to Unicode 8.0 support.
65 lines
1.8 KiB
C
65 lines
1.8 KiB
C
$NetBSD: patch-unix_tclUnixInit.c,v 1.2 2016/03/03 21:16:46 bsiegert Exp $
|
|
|
|
Carried over from TCL 8.4
|
|
|
|
--- unix/tclUnixInit.c.orig 2015-10-23 11:50:57.000000000 +0000
|
|
+++ unix/tclUnixInit.c
|
|
@@ -22,7 +22,7 @@
|
|
# endif
|
|
#endif
|
|
#include <sys/resource.h>
|
|
-#if defined(__FreeBSD__) && defined(__GNUC__)
|
|
+#if (defined(__FreeBSD__) || defined(__DragonFly__)) && defined(__GNUC__)
|
|
# include <floatingpoint.h>
|
|
#endif
|
|
#if defined(__bsdi__)
|
|
@@ -31,6 +31,12 @@
|
|
# include <dlfcn.h>
|
|
# endif
|
|
#endif
|
|
+#if defined(__NetBSD__)
|
|
+#include <sys/param.h>
|
|
+#include <sys/sysctl.h>
|
|
+#include <sys/utsname.h>
|
|
+#endif
|
|
+
|
|
|
|
#ifdef __CYGWIN__
|
|
DLLIMPORT extern __stdcall unsigned char GetVersionExW(void *);
|
|
@@ -451,7 +457,7 @@ TclpInitPlatform(void)
|
|
(void) signal(SIGPIPE, SIG_IGN);
|
|
#endif /* SIGPIPE */
|
|
|
|
-#if defined(__FreeBSD__) && defined(__GNUC__)
|
|
+#if (defined(__FreeBSD__) || defined(__DragonFly__)) && defined(__GNUC__)
|
|
/*
|
|
* Adjust the rounding mode to be more conventional. Note that FreeBSD
|
|
* only provides the __fpsetreg() used by the following two for the GNU
|
|
@@ -822,6 +828,11 @@ TclpSetVariables(
|
|
#endif
|
|
int unameOK;
|
|
Tcl_DString ds;
|
|
+#if defined(__NetBSD__)
|
|
+ char machine_arch[SYS_NMLN];
|
|
+ int mib[2] = { CTL_HW, HW_MACHINE_ARCH };
|
|
+ size_t len = sizeof(machine_arch);
|
|
+#endif
|
|
|
|
#ifdef HAVE_COREFOUNDATION
|
|
char tclLibPath[MAXPATHLEN + 1];
|
|
@@ -1002,8 +1013,15 @@ TclpSetVariables(
|
|
|
|
#endif /* DJGPP */
|
|
}
|
|
+#if defined(__NetBSD__)
|
|
+ if (sysctl(mib, sizeof(mib) / sizeof(int), machine_arch, &len, NULL, 0) < 0)
|
|
+ unameOK = 0;
|
|
+ else
|
|
+ Tcl_SetVar2(interp, "tcl_platform", "machine", machine_arch, TCL_GLOBAL_ONLY);
|
|
+#else
|
|
Tcl_SetVar2(interp, "tcl_platform", "machine", name.machine,
|
|
TCL_GLOBAL_ONLY);
|
|
+#endif /* __NetBSD__ */
|
|
}
|
|
#endif /* !NO_UNAME */
|
|
if (!unameOK) {
|