fix MS Visual C build after 64-bit support patch

This commit is contained in:
Stas Degteff 2005-10-09 21:09:37 +00:00
parent 4415374ddb
commit 890937100d
5 changed files with 67 additions and 13 deletions

View File

@ -32,7 +32,11 @@
#include <cstddef> #include <cstddef>
#include <gcmpall.h> #include <gcmpall.h>
#ifdef _MSC_VER
#include <windows.h>
#else
#include <stdint.h> #include <stdint.h>
#endif
// ------------------------------------------------------------------ // ------------------------------------------------------------------
// Disable some MS Visual C warnings // Disable some MS Visual C warnings
@ -109,6 +113,16 @@ typedef unsigned int uint;
typedef unsigned long ulong; typedef unsigned long ulong;
typedef unsigned char bit; 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 uint8_t byte;
typedef int8_t sbyte; typedef int8_t sbyte;
typedef uint16_t word; typedef uint16_t word;

View File

@ -254,9 +254,9 @@ void gcpuid(gcpu_info *pinfo)
// get the vendor string // get the vendor string
xor eax, eax xor eax, eax
cpuid cpuid
mov vendor.dw0, ebx mov vendor.dw.dw0, ebx
mov vendor.dw1, edx mov vendor.dw.dw1, edx
mov vendor.dw2, ecx mov vendor.dw.dw2, ecx
// get the standard bits // get the standard bits
mov eax, 1 mov eax, 1
@ -352,8 +352,8 @@ char* ggetosstring(void) {
break; break;
case PROCESSOR_INTEL_PENTIUM: case PROCESSOR_INTEL_PENTIUM:
cpu = 5; cpu = 5;
case PROCESSOR_INTEL_IA64: case 15: /* Pentium 4 */
cpu = 64; cpu = 7;
default: default:
cpu = 6; cpu = 6;
break; break;
@ -363,9 +363,6 @@ char* ggetosstring(void) {
case 15: case 15:
sprintf(processor, "i786"); sprintf(processor, "i786");
break; break;
case 64:
sprintf(processor, "IA64");
break;
default: default:
if( cpu>9 ) cpu= cpu%10+int(cpu/10)+1; if( cpu>9 ) cpu= cpu%10+int(cpu/10)+1;
sprintf(processor, "i%d86", cpu); sprintf(processor, "i%d86", cpu);
@ -373,6 +370,9 @@ char* ggetosstring(void) {
} }
} }
break; break;
case PROCESSOR_ARCHITECTURE_IA64:
sprintf(processor, "IA64-%d", si.wProcessorLevel);
break;
case PROCESSOR_ARCHITECTURE_MIPS: case PROCESSOR_ARCHITECTURE_MIPS:
sprintf(processor, "mips%d000", si.wProcessorLevel); sprintf(processor, "mips%d000", si.wProcessorLevel);
break; break;

View File

@ -3,7 +3,19 @@
#ifndef __TYPEDEFS_H__ #ifndef __TYPEDEFS_H__
#define __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> #include <stdint.h>
#endif
typedef unsigned bit; typedef unsigned bit;

View File

@ -2,7 +2,8 @@
TOP=../.. TOP=../..
TARGET=smblib TARGET=smblib
INCS=-I$(TOP)/goldlib/smblib -I$(TOP)/goldlib/gall INCS=-I$(TOP)/goldlib/smblib
#-I$(TOP)/goldlib/gall
CFLAGS=-x c++ CFLAGS=-x c++
include $(TOP)/GNUmakef.inc include $(TOP)/GNUmakef.inc

View File

@ -39,7 +39,34 @@
#define _SMBDEFS_H #define _SMBDEFS_H
#include <stdio.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 */ /* Macros */