fix MS Visual C build after 64-bit support patch
This commit is contained in:
parent
4415374ddb
commit
890937100d
@ -32,7 +32,11 @@
|
||||
|
||||
#include <cstddef>
|
||||
#include <gcmpall.h>
|
||||
#ifdef _MSC_VER
|
||||
#include <windows.h>
|
||||
#else
|
||||
#include <stdint.h>
|
||||
#endif
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
// Disable some MS Visual C warnings
|
||||
@ -109,6 +113,16 @@ typedef unsigned int uint;
|
||||
typedef unsigned long ulong;
|
||||
|
||||
typedef unsigned char bit;
|
||||
|
||||
#ifdef _MSC_VER
|
||||
typedef uchar uint8_t;
|
||||
typedef schar int8_t;
|
||||
typedef ushort uint16_t;
|
||||
typedef short int16_t;
|
||||
typedef INT int32_t;
|
||||
typedef UINT uint32_t;
|
||||
#endif
|
||||
|
||||
typedef uint8_t byte;
|
||||
typedef int8_t sbyte;
|
||||
typedef uint16_t word;
|
||||
|
@ -77,7 +77,7 @@ static bool HaveCPUID()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
#else
|
||||
return false;
|
||||
@ -254,9 +254,9 @@ void gcpuid(gcpu_info *pinfo)
|
||||
// get the vendor string
|
||||
xor eax, eax
|
||||
cpuid
|
||||
mov vendor.dw0, ebx
|
||||
mov vendor.dw1, edx
|
||||
mov vendor.dw2, ecx
|
||||
mov vendor.dw.dw0, ebx
|
||||
mov vendor.dw.dw1, edx
|
||||
mov vendor.dw.dw2, ecx
|
||||
|
||||
// get the standard bits
|
||||
mov eax, 1
|
||||
@ -296,7 +296,7 @@ char* ggetosstring(void) {
|
||||
#elif defined(__BEOS__)
|
||||
BAppFileInfo appFileInfo;
|
||||
version_info sys_ver = {0};
|
||||
BFile file("/boot/beos/system/lib/libbe.so", B_READ_ONLY);
|
||||
BFile file("/boot/beos/system/lib/libbe.so", B_READ_ONLY);
|
||||
appFileInfo.SetTo(&file);
|
||||
appFileInfo.GetVersionInfo(&sys_ver, B_APP_VERSION_KIND);
|
||||
sprintf(osstring, "%s %s %s", info.sysname, sys_ver.short_info, info.machine);
|
||||
@ -352,8 +352,8 @@ char* ggetosstring(void) {
|
||||
break;
|
||||
case PROCESSOR_INTEL_PENTIUM:
|
||||
cpu = 5;
|
||||
case PROCESSOR_INTEL_IA64:
|
||||
cpu = 64;
|
||||
case 15: /* Pentium 4 */
|
||||
cpu = 7;
|
||||
default:
|
||||
cpu = 6;
|
||||
break;
|
||||
@ -363,9 +363,6 @@ char* ggetosstring(void) {
|
||||
case 15:
|
||||
sprintf(processor, "i786");
|
||||
break;
|
||||
case 64:
|
||||
sprintf(processor, "IA64");
|
||||
break;
|
||||
default:
|
||||
if( cpu>9 ) cpu= cpu%10+int(cpu/10)+1;
|
||||
sprintf(processor, "i%d86", cpu);
|
||||
@ -373,6 +370,9 @@ char* ggetosstring(void) {
|
||||
}
|
||||
}
|
||||
break;
|
||||
case PROCESSOR_ARCHITECTURE_IA64:
|
||||
sprintf(processor, "IA64-%d", si.wProcessorLevel);
|
||||
break;
|
||||
case PROCESSOR_ARCHITECTURE_MIPS:
|
||||
sprintf(processor, "mips%d000", si.wProcessorLevel);
|
||||
break;
|
||||
|
@ -3,7 +3,19 @@
|
||||
#ifndef __TYPEDEFS_H__
|
||||
#define __TYPEDEFS_H__
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#include <windows.h>
|
||||
|
||||
typedef UCHAR uint8_t;
|
||||
typedef signed char int8_t;
|
||||
typedef WORD uint16_t;
|
||||
typedef short int16_t;
|
||||
typedef INT int32_t;
|
||||
typedef UINT uint32_t;
|
||||
|
||||
#else
|
||||
#include <stdint.h>
|
||||
#endif
|
||||
|
||||
typedef unsigned bit;
|
||||
|
||||
|
@ -2,7 +2,8 @@
|
||||
|
||||
TOP=../..
|
||||
TARGET=smblib
|
||||
INCS=-I$(TOP)/goldlib/smblib -I$(TOP)/goldlib/gall
|
||||
INCS=-I$(TOP)/goldlib/smblib
|
||||
#-I$(TOP)/goldlib/gall
|
||||
CFLAGS=-x c++
|
||||
|
||||
include $(TOP)/GNUmakef.inc
|
||||
|
@ -39,7 +39,34 @@
|
||||
#define _SMBDEFS_H
|
||||
|
||||
#include <stdio.h>
|
||||
#include <gdefs.h>
|
||||
|
||||
#ifndef __goldall_h
|
||||
#ifdef _MSC_VER
|
||||
#include <windows.h>
|
||||
|
||||
typedef UCHAR uint8_t;
|
||||
typedef signed char int8_t;
|
||||
typedef WORD uint16_t;
|
||||
typedef short int16_t;
|
||||
typedef INT int32_t;
|
||||
typedef UINT uint32_t;
|
||||
|
||||
#else
|
||||
#include <stdint.h>
|
||||
#endif
|
||||
|
||||
typedef unsigned int uint;
|
||||
typedef signed int sint;
|
||||
typedef unsigned bit;
|
||||
typedef uint8_t byte;
|
||||
typedef int8_t sbyte;
|
||||
typedef uint16_t word;
|
||||
typedef int16_t sword;
|
||||
typedef uint32_t dword;
|
||||
typedef int32_t sdword;
|
||||
typedef uint16_t ushort;
|
||||
typedef int16_t sshort;
|
||||
#endif
|
||||
|
||||
/**********/
|
||||
/* Macros */
|
||||
@ -447,7 +474,7 @@ typedef struct _PACK { // Message header
|
||||
typedef struct _PACK { // Data field
|
||||
|
||||
ushort type; // Type of data field
|
||||
uint32_t offset; // Offset into buffer
|
||||
uint32_t offset; // Offset into buffer
|
||||
uint32_t length; // Length of data field
|
||||
|
||||
} dfield_t;
|
||||
|
Reference in New Issue
Block a user