version 1.170, 2014/12/23 11:17:12
|
version 1.172, 2014/12/27 12:07:47
|
Line 1
|
Line 1
|
/* $Id$ |
/* $Id$ |
$State$ |
$State$ |
$Log$ |
$Log$ |
|
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 |
|
|
|
Still problem with utsname.h on Windows |
|
|
Revision 1.170 2014/12/23 11:17:12 brouard |
Revision 1.170 2014/12/23 11:17:12 brouard |
Summary: Cleaning some \%% back to %% |
Summary: Cleaning some \%% back to %% |
|
|
Line 532
|
Line 540
|
|
|
#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 |
|
|
#include <limits.h> |
#include <limits.h> |
#include <sys/types.h> |
#include <sys/types.h> |
#include <sys/utsname.h> |
|
|
#if defined(__GNUC__) |
|
#include <sys/utsname.h> /* Doesn't work on Windows */ |
|
#endif |
|
|
#include <sys/stat.h> |
#include <sys/stat.h> |
#include <errno.h> |
#include <errno.h> |
/* extern int errno; */ |
/* extern int errno; */ |
Line 5442 int calandcheckages(int imx, int maxwav,
|
Line 5456 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"*/ |
/* #include <gnu/libc-version.h> */ /* Only on gnu */ |
/* #include <gnu/libc-version.h> */ /* Only on gnu */ |
|
#include <stdint.h> |
printf("Compiled with:");fprintf(ficlog,"Compiled with:"); |
printf("Compiled with:");fprintf(ficlog,"Compiled with:"); |
#if defined(__clang__) |
#if defined(__clang__) |
printf(" Clang/LLVM");fprintf(ficlog," Clang/LLVM"); /* Clang/LLVM. ---------------------------------------------- */ |
printf(" Clang/LLVM");fprintf(ficlog," Clang/LLVM"); /* Clang/LLVM. ---------------------------------------------- */ |
Line 5494 void syscompilerinfo()
|
Line 5544 void syscompilerinfo()
|
/* _WIN64 // Defined for applications for Win64. */ |
/* _WIN64 // Defined for applications for Win64. */ |
/* _M_X64 // Defined for compilations that target x64 processors. */ |
/* _M_X64 // Defined for compilations that target x64 processors. */ |
/* _DEBUG // Defined when you compile with /LDd, /MDd, and /MTd. */ |
/* _DEBUG // Defined when you compile with /LDd, /MDd, and /MTd. */ |
#include <stdint.h> |
|
#if UINTPTR_MAX == 0xffffffff |
#if UINTPTR_MAX == 0xffffffff |
printf(" 32-bit."); /* 32-bit */ |
printf(" 32-bit.\n"); fprintf(ficlog," 32-bit.\n");/* 32-bit */ |
#elif UINTPTR_MAX == 0xffffffffffffffff |
#elif UINTPTR_MAX == 0xffffffffffffffff |
printf(" 64-bit.");/* 64-bit */ |
printf(" 64-bit.\n"); fprintf(ficlog," 64-bit.\n");/* 64-bit */ |
#else |
#else |
printf(" wtf-bit."); /* wtf */ |
printf(" wtf-bit.\n"); fprintf(ficlog," wtf-bit.\n");/* wtf */ |
#endif |
#endif |
|
|
struct utsname sysInfo; |
/* struct utsname sysInfo; |
|
|
if (uname(&sysInfo) != -1) { |
if (uname(&sysInfo) != -1) { |
printf(" %s %s %s %s %s\n",sysInfo.sysname, sysInfo.nodename, sysInfo.release, sysInfo.version, sysInfo.machine); |
printf(" %s %s %s %s %s\n",sysInfo.sysname, sysInfo.nodename, sysInfo.release, sysInfo.version, sysInfo.machine); |
Line 5511 struct utsname sysInfo;
|
Line 5561 struct utsname sysInfo;
|
} |
} |
else |
else |
perror("uname() error"); |
perror("uname() error"); |
|
*/ |
#if defined(__GNUC__) |
#if defined(__GNUC__) |
# if defined(__GNUC_PATCHLEVEL__) |
# if defined(__GNUC_PATCHLEVEL__) |
# define __GNUC_VERSION__ (__GNUC__ * 10000 \ |
# define __GNUC_VERSION__ (__GNUC__ * 10000 \ |
Line 5523 struct utsname sysInfo;
|
Line 5574 struct utsname sysInfo;
|
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()); */ |