diff options
| author | dgp <dgp@users.sourceforge.net> | 2017-05-08 16:14:10 (GMT) |
|---|---|---|
| committer | dgp <dgp@users.sourceforge.net> | 2017-05-08 16:14:10 (GMT) |
| commit | 43e76a45e9898ae95f9bcd31bde84e224a92f4b4 (patch) | |
| tree | c726fd889dd910320aa42ffefd5165ad7542926b /unix | |
| parent | e78b0c89457f00810603c8d4c21a67663327d88f (diff) | |
| parent | ca65694482559e483a5684779f8cb6ee6a850d31 (diff) | |
| download | tcl-43e76a45e9898ae95f9bcd31bde84e224a92f4b4.zip tcl-43e76a45e9898ae95f9bcd31bde84e224a92f4b4.tar.gz tcl-43e76a45e9898ae95f9bcd31bde84e224a92f4b4.tar.bz2 | |
merge trunk
Diffstat (limited to 'unix')
| -rw-r--r-- | unix/tclUnixInit.c | 18 | ||||
| -rw-r--r-- | unix/tclUnixSock.c | 2 |
2 files changed, 8 insertions, 12 deletions
diff --git a/unix/tclUnixInit.c b/unix/tclUnixInit.c index 80d315e..feeffa6 100644 --- a/unix/tclUnixInit.c +++ b/unix/tclUnixInit.c @@ -14,11 +14,11 @@ #ifdef HAVE_LANGINFO # include <langinfo.h> # ifdef __APPLE__ -# if defined(HAVE_WEAK_IMPORT) && MAC_OS_X_VERSION_MIN_REQUIRED < 1030 +# if defined(HAVE_WEAK_IMPORT) && MAC_OS_X_VERSION_MIN_REQUIRED < 1030 /* Support for weakly importing nl_langinfo on Darwin. */ # define WEAK_IMPORT_NL_LANGINFO extern char *nl_langinfo(nl_item) WEAK_IMPORT_ATTRIBUTE; -# endif +# endif # endif #endif #include <sys/resource.h> @@ -34,7 +34,7 @@ #ifdef __CYGWIN__ DLLIMPORT extern __stdcall unsigned char GetVersionExW(void *); -DLLIMPORT extern __stdcall void *LoadLibraryW(const void *); +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 *); @@ -45,12 +45,12 @@ static const char *const platforms[NUMPLATFORMS] = { }; #define NUMPROCESSORS 11 -static const char *const processors[NUMPROCESSORS] = { +static const char *const processors[NUMPROCESSORS] = { "intel", "mips", "alpha", "ppc", "shx", "arm", "ia64", "alpha64", "msil", "amd64", "ia32_on_win64" }; -typedef struct _SYSTEM_INFO { +typedef struct { union { DWORD dwOemId; struct { @@ -69,7 +69,7 @@ typedef struct _SYSTEM_INFO { int wProcessorRevision; } SYSTEM_INFO; -typedef struct _OSVERSIONINFOW { +typedef struct { DWORD dwOSVersionInfoSize; DWORD dwMajorVersion; DWORD dwMinorVersion; @@ -878,16 +878,13 @@ TclpSetVariables( #ifdef __CYGWIN__ unameOK = 1; if (!osInfoInitialized) { - HANDLE handle = LoadLibraryW(L"NTDLL"); + HANDLE handle = GetModuleHandleW(L"NTDLL"); int(__stdcall *getversion)(void *) = (int(__stdcall *)(void *))GetProcAddress(handle, "RtlGetVersion"); osInfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFOW); if (!getversion || getversion(&osInfo)) { GetVersionExW(&osInfo); } - if (handle) { - FreeLibrary(handle); - } osInfoInitialized = 1; } @@ -1045,7 +1042,6 @@ TclpFindVariable( return result; } - /* *---------------------------------------------------------------------- * diff --git a/unix/tclUnixSock.c b/unix/tclUnixSock.c index 6b2990b..b21deae 100644 --- a/unix/tclUnixSock.c +++ b/unix/tclUnixSock.c @@ -746,7 +746,7 @@ IPv6AddressNeedsNumericRendering( * at least some versions of OSX. */ -#pragma GCC diagnostic push +#pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wstrict-aliasing" if (!IN6_IS_ADDR_V4MAPPED(&addr)) { #pragma GCC diagnostic pop |
