]> henry.ined.fr Git - .git/commitdiff
Summary: Back from Visual Studio and Intel, options for compiling for Windows XP
authorN. Brouard <brouard@ined.fr>
Sat, 27 Dec 2014 12:07:47 +0000 (12:07 +0000)
committerN. Brouard <brouard@ined.fr>
Sat, 27 Dec 2014 12:07:47 +0000 (12:07 +0000)
src/imach.c

index 6be7e7903d7ec75b0dbbc27404acbae26ef26a9b..6f4276cc1e78817e53ebcdc02f1395dd78718bf3 100644 (file)
@@ -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 %%
 
 
 #ifdef _WIN32
 #include <io.h>
+#include <windows.h>
+#include <tchar.h>
 #else
 #include <unistd.h>
 #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 <stdio.h>
+//#include <tchar.h>
+//#include <windows.h>
+//#include <iostream>
+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()); */