From 890937100d21284ea610dd8c77880a916eb58ada Mon Sep 17 00:00:00 2001 From: Stas Degteff Date: Sun, 9 Oct 2005 21:09:37 +0000 Subject: [PATCH] fix MS Visual C build after 64-bit support patch --- goldlib/gall/gdefs.h | 14 ++++++++++++++ goldlib/gall/gutlvers.cpp | 20 ++++++++++---------- goldlib/msgidlib/typedefs.h | 12 ++++++++++++ goldlib/smblib/Makefile | 3 ++- goldlib/smblib/smbdefs.h | 31 +++++++++++++++++++++++++++++-- 5 files changed, 67 insertions(+), 13 deletions(-) diff --git a/goldlib/gall/gdefs.h b/goldlib/gall/gdefs.h index 5abf5bf..6efd088 100644 --- a/goldlib/gall/gdefs.h +++ b/goldlib/gall/gdefs.h @@ -32,7 +32,11 @@ #include #include +#ifdef _MSC_VER +#include +#else #include +#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; diff --git a/goldlib/gall/gutlvers.cpp b/goldlib/gall/gutlvers.cpp index 4fbe588..2d793f9 100644 --- a/goldlib/gall/gutlvers.cpp +++ b/goldlib/gall/gutlvers.cpp @@ -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; diff --git a/goldlib/msgidlib/typedefs.h b/goldlib/msgidlib/typedefs.h index 9714b38..f2349ef 100755 --- a/goldlib/msgidlib/typedefs.h +++ b/goldlib/msgidlib/typedefs.h @@ -3,7 +3,19 @@ #ifndef __TYPEDEFS_H__ #define __TYPEDEFS_H__ +#ifdef _MSC_VER +#include + +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 +#endif typedef unsigned bit; diff --git a/goldlib/smblib/Makefile b/goldlib/smblib/Makefile index 54cd26a9..52c7fde 100644 --- a/goldlib/smblib/Makefile +++ b/goldlib/smblib/Makefile @@ -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 diff --git a/goldlib/smblib/smbdefs.h b/goldlib/smblib/smbdefs.h index c72f0a6..770853d 100644 --- a/goldlib/smblib/smbdefs.h +++ b/goldlib/smblib/smbdefs.h @@ -39,7 +39,34 @@ #define _SMBDEFS_H #include -#include + +#ifndef __goldall_h +#ifdef _MSC_VER +#include + +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 +#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;