Diff for /imach/src/imach.c between versions 1.171 and 1.173

version 1.171, 2014/12/23 13:26:59 version 1.173, 2015/01/03 12:06:26
Line 1 Line 1
 /* $Id$  /* $Id$
   $State$    $State$
   $Log$    $Log$
     Revision 1.173  2015/01/03 12:06:26  brouard
     Summary: trying to detect cross-compilation
   
     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    Revision 1.171  2014/12/23 13:26:59  brouard
   Summary: Back from Visual C    Summary: Back from Visual C
   
Line 537 Line 543
   
 #ifdef _WIN32  #ifdef _WIN32
 #include <io.h>  #include <io.h>
   #include <windows.h>
   #include <tchar.h>
 #else  #else
 #include <unistd.h>  #include <unistd.h>
 #endif  #endif
Line 5451  int calandcheckages(int imx, int maxwav, Line 5459  int calandcheckages(int imx, int maxwav,
     return (1);      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()  void syscompilerinfo()
  {   {
    /* #include "syscompilerinfo.h"*/     /* #include "syscompilerinfo.h"*/
Line 5486  void syscompilerinfo() Line 5530  void syscompilerinfo()
 // http://stackoverflow.com/questions/4605842/how-to-identify-platform-compiler-from-preprocessor-macros  // http://stackoverflow.com/questions/4605842/how-to-identify-platform-compiler-from-preprocessor-macros
 #ifdef _WIN32 // note the underscore: without it, it's not msdn official!  #ifdef _WIN32 // note the underscore: without it, it's not msdn official!
     // Windows (x64 and x86)      // Windows (x64 and x86)
      printf("Windows (x64 and x86). ");fprintf(ficlog,"Windows (x64 and x86). ");
 #elif __unix__ // all unices, not all compilers  #elif __unix__ // all unices, not all compilers
     // Unix      // Unix
      printf("Unix. ");fprintf(ficlog,"Unix. ");
 #elif __linux__  #elif __linux__
     // linux      // linux
      printf("linux. ");fprintf(ficlog,"linux. ");
 #elif __APPLE__  #elif __APPLE__
     // Mac OS, not sure if this is covered by __posix__ and/or __unix__ though...      // Mac OS, not sure if this is covered by __posix__ and/or __unix__ though...
      printf("Mac OS. ");fprintf(ficlog,"Mac OS. ");
 #endif  #endif
   
 /*  __MINGW32__   */  /*  __MINGW32__   */
Line 5533  void syscompilerinfo() Line 5581  void syscompilerinfo()
    printf("GNU C version %d.\n", __GNUC_VERSION__);     printf("GNU C version %d.\n", __GNUC_VERSION__);
    fprintf(ficlog, "GNU C version %d.\n", __GNUC_VERSION__);     fprintf(ficlog, "GNU C version %d.\n", __GNUC_VERSION__);
 #endif  #endif
   
      //   void main()
      //   {
 #if defined(_MSC_VER)  #if defined(_MSC_VER)
    /*printf("Visual C++ compiler: %s \n;", _MSC_FULL_VER);*/     if (IsWow64())
    /*fprintf(ficlog, "Visual C++ compiler: %s \n;", _MSC_FULL_VER);*/             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  #endif
         
   /* printf("GNU libc version: %s\n", gnu_get_libc_version()); */    /* printf("GNU libc version: %s\n", gnu_get_libc_version()); */

Removed from v.1.171  
changed lines
  Added in v.1.173


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>