--- imach/src/imach.c 2014/12/23 13:26:59 1.171 +++ imach/src/imach.c 2014/12/27 12:07:47 1.172 @@ -1,6 +1,9 @@ -/* $Id: imach.c,v 1.171 2014/12/23 13:26:59 brouard Exp $ +/* $Id: imach.c,v 1.172 2014/12/27 12:07:47 brouard Exp $ $State: Exp $ $Log: imach.c,v $ + Revision 1.172 2014/12/27 12:07:47 brouard + Summary: Back from Visual Studio and Intel, options for compiling for Windows XP + Revision 1.171 2014/12/23 13:26:59 brouard Summary: Back from Visual C @@ -537,6 +540,8 @@ #ifdef _WIN32 #include +#include +#include #else #include #endif @@ -609,11 +614,11 @@ typedef struct { #define ODIRSEPARATOR '\\' #endif -/* $Id: imach.c,v 1.171 2014/12/23 13:26:59 brouard Exp $ */ +/* $Id: imach.c,v 1.172 2014/12/27 12:07:47 brouard Exp $ */ /* $State: Exp $ */ char version[]="Imach version 0.98p, December 2014,INED-EUROREVES-Institut de longevite-Japan Society for the Promotion of Science (Grant-in-Aid for Scientific Research 25293121), Intel Software 2015"; -char fullversion[]="$Revision: 1.171 $ $Date: 2014/12/23 13:26:59 $"; +char fullversion[]="$Revision: 1.172 $ $Date: 2014/12/27 12:07:47 $"; char strstart[80]; char optionfilext[10], optionfilefiname[FILENAMELENGTH]; int erreur=0, nberr=0, nbwarn=0; /* Error number, number of errors number of warnings */ @@ -5451,6 +5456,42 @@ int calandcheckages(int imx, int maxwav, 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"*/ @@ -5533,9 +5574,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()); */