From 4417987ec0c3ff5af4140e5efe1435322feaf359 Mon Sep 17 00:00:00 2001 From: "N. Brouard" Date: Sat, 27 Dec 2014 12:07:47 +0000 Subject: [PATCH] Summary: Back from Visual Studio and Intel, options for compiling for Windows XP --- src/imach.c | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 55 insertions(+), 2 deletions(-) diff --git a/src/imach.c b/src/imach.c index 6be7e79..6f4276c 100644 --- a/src/imach.c +++ b/src/imach.c @@ -1,6 +1,11 @@ /* $Id$ $State$ $Log$ + Revision 1.171 2014/12/23 13:26:59 brouard + Summary: Back from Visual C + + Still problem with utsname.h on Windows + Revision 1.170 2014/12/23 11:17:12 brouard Summary: Cleaning some \%% back to %% @@ -532,6 +537,8 @@ #ifdef _WIN32 #include +#include +#include #else #include #endif @@ -5446,6 +5453,42 @@ int calandcheckages(int imx, int maxwav, double *agemin, double *agemax, int *nb return (1); } +#if defined(_MSC_VER) +/*printf("Visual C++ compiler: %s \n;", _MSC_FULL_VER);*/ +/*fprintf(ficlog, "Visual C++ compiler: %s \n;", _MSC_FULL_VER);*/ +//#include "stdafx.h" +//#include +//#include +//#include +//#include +typedef BOOL(WINAPI *LPFN_ISWOW64PROCESS) (HANDLE, PBOOL); + +LPFN_ISWOW64PROCESS fnIsWow64Process; + +BOOL IsWow64() +{ + BOOL bIsWow64 = FALSE; + + //typedef BOOL (APIENTRY *LPFN_ISWOW64PROCESS) + // (HANDLE, PBOOL); + + //LPFN_ISWOW64PROCESS fnIsWow64Process; + + HMODULE module = GetModuleHandle(_T("kernel32")); + const char funcName[] = "IsWow64Process"; + fnIsWow64Process = (LPFN_ISWOW64PROCESS) + GetProcAddress(module, funcName); + + if (NULL != fnIsWow64Process) + { + if (!fnIsWow64Process(GetCurrentProcess(), + &bIsWow64)) + //throw std::exception("Unknown error"); + printf("Unknown error\n"); + } + return bIsWow64 != FALSE; +} +#endif void syscompilerinfo() { /* #include "syscompilerinfo.h"*/ @@ -5528,9 +5571,19 @@ void syscompilerinfo() printf("GNU C version %d.\n", __GNUC_VERSION__); fprintf(ficlog, "GNU C version %d.\n", __GNUC_VERSION__); #endif + + // void main() + // { #if defined(_MSC_VER) - /*printf("Visual C++ compiler: %s \n;", _MSC_FULL_VER);*/ - /*fprintf(ficlog, "Visual C++ compiler: %s \n;", _MSC_FULL_VER);*/ + if (IsWow64()) + printf("The process is running under WOW64.\n"); + else + printf("The process is not running under WOW64.\n"); + + // printf("\nPress Enter to continue..."); + // getchar(); + // } + #endif /* printf("GNU libc version: %s\n", gnu_get_libc_version()); */ -- 2.43.0