From 635cfedb4bbe270f114f7a4e5ab58b7d8e054f7d Mon Sep 17 00:00:00 2001 From: Scott Wood Date: Sat, 14 Jul 2007 12:20:51 -0500 Subject: [PATCH] Fix GCC 4.1.3 issues --- Makefile.target | 1 + idlcomp/idlparse.y | 2 +- idlcomp/languages/c++/c++.h | 6 +++--- idlcomp/types.cc | 3 ++- include/c/lowlevel/arch-x86/types.h | 23 +++++++++++++++++++++++ kernel/arch/x86/misc.cc | 6 +++--- 6 files changed, 33 insertions(+), 8 deletions(-) diff --git a/Makefile.target b/Makefile.target index f759208..32102e4 100644 --- a/Makefile.target +++ b/Makefile.target @@ -6,6 +6,7 @@ $(error Please define $$(ARCH).) endif VALIDARCH := no +DEFS := $(EXTRADEFS) ifeq ($(ARCH),x86) CROSS := i686-polintos- diff --git a/idlcomp/idlparse.y b/idlcomp/idlparse.y index 079d077..e15c7dd 100644 --- a/idlcomp/idlparse.y +++ b/idlcomp/idlparse.y @@ -498,7 +498,7 @@ iface: } '{' iface_body '}' { pop_nspace(); pop_nspace(); - $$ = $3; + $$ = $4; } ; diff --git a/idlcomp/languages/c++/c++.h b/idlcomp/languages/c++/c++.h index 4717233..51ea707 100644 --- a/idlcomp/languages/c++/c++.h +++ b/idlcomp/languages/c++/c++.h @@ -78,9 +78,9 @@ class CPPFile : public LangCallback { void output_methods(Interface *iface, Interface *super, bool prototype); void output_method_defs(Interface *iface); - void CPPFile::output_one_method(Interface *iface, Method *m, - bool prototype, bool retval); - void CPPFile::output_one_method_ptr(Method *m, Interface *iface); + void output_one_method(Interface *iface, Method *m, + bool prototype, bool retval); + void output_one_method_ptr(Method *m, Interface *iface); static void output_iface_ns(CPPFile *file, NameSpace *sym); diff --git a/idlcomp/types.cc b/idlcomp/types.cc index c885f3f..c22d0be 100644 --- a/idlcomp/types.cc +++ b/idlcomp/types.cc @@ -320,7 +320,8 @@ void Datum::final_analysis() yyerrorfl(name->file, name->line, "Explicit size %llu on \"%s\" is too small for " "type \"%s\", which has a minimum size of %u", - def.ucon, get_fq_name()->flatten()->c_str(), + (unsigned long long)def.ucon, + get_fq_name()->flatten()->c_str(), type->get_fq_name()->flatten()->c_str(), defsize); } } diff --git a/include/c/lowlevel/arch-x86/types.h b/include/c/lowlevel/arch-x86/types.h index db959fa..2aba0b4 100644 --- a/include/c/lowlevel/arch-x86/types.h +++ b/include/c/lowlevel/arch-x86/types.h @@ -3,6 +3,8 @@ #ifndef _LL_ARCH_TYPES_H #define _LL_ARCH_TYPES_H +#include + typedef unsigned char uint8_t; typedef unsigned short uint16_t; typedef unsigned int uint32_t; @@ -12,11 +14,32 @@ typedef short int16_t; typedef int int32_t; typedef long long int64_t; +#if 0 +#ifndef _SIZE_T +#define _SIZE_T typedef unsigned long size_t; +#endif +#endif + +#ifndef _SSIZE_T +#define _SSIZE_T typedef long ssize_t; +#endif + +#ifndef _INTPTR_T +#define _INTPTR_T typedef long intptr_t; +#endif + +#ifndef _UINTPTR_T +#define _UINTPTR_T typedef unsigned long uintptr_t; +#endif + +#ifndef _PTRDIFF_T +#define _PTRDIFF_T typedef long ptrdiff_t; +#endif #define _LL_LONG_BYTES 4 #define _LL_LONG_LOGBYTES 2 diff --git a/kernel/arch/x86/misc.cc b/kernel/arch/x86/misc.cc index 664549a..3e0091a 100644 --- a/kernel/arch/x86/misc.cc +++ b/kernel/arch/x86/misc.cc @@ -252,12 +252,12 @@ namespace Priv { union { System::RunTime::ParamInfoBlock *pib; - ulong exptr; + uintptr_t exptr; }; union { - ulong caller; - ulong exlen; + uintptr_t caller; + size_t exlen; }; ulong eip, cs, eflags, user_esp, user_ss; -- 2.39.2