diff --git a/ChangeLog b/ChangeLog index a835a67..c2bb7bd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2008-11-07 Roland Schwingel + + * sendmsg.c: + * thr-win32.c: + * thr.c: + * Object.m: + * archive.c: + * objc/objc.h: + * objc/objc-decls.h: + Cleanups for 64bit mswindows support. + 2008-09-01 17:06-EDT Gregory John Casamento * config/x86_64/linux-gnu/tconfig.h: Add x86_64 config file. diff --git a/Object.m b/Object.m index 3d7d208..689af62 100644 --- a/Object.m +++ b/Object.m @@ -29,7 +29,11 @@ Boston, MA 02110-1301, USA. */ #include "objc/Protocol.h" #include "objc/objc-api.h" -extern int errno; +extern +#ifdef _WIN32 +__declspec(dllimport) +#endif +int errno; #define MAX_CLASS_NAME_LEN 256 @@ -115,13 +119,13 @@ extern int errno; return self==anObject; } -- (int)compare:anotherObject; +- (int)compare:(id)anotherObject; { if ([self isEqual:anotherObject]) return 0; // Ordering objects by their address is pretty useless, // so subclasses should override this is some useful way. - else if (self > anotherObject) + else if ((id)self > anotherObject) return 1; else return -1; diff --git a/archive.c b/archive.c index 992a696..889e215 100644 --- a/archive.c +++ b/archive.c @@ -908,7 +908,7 @@ objc_read_class (struct objc_typed_stream *stream, Class *class) objc_read_unsigned_long (stream, &version); objc_hash_add (&stream->class_table, - (*class)->name, (void *)version); + (*class)->name, (void *)(size_t) version); } else if ((buf[0]&_B_CODE) == _B_UCOMM) diff --git a/objc/objc-decls.h b/objc/objc-decls.h index 2eff1c1..8ed0854 100644 --- a/objc/objc-decls.h +++ b/objc/objc-decls.h @@ -27,7 +27,7 @@ Boston, MA 02110-1301, USA. */ #ifndef __objc_decls_INCLUDE_GNU #define __objc_decls_INCLUDE_GNU -#if !defined(__MINGW32__) && (defined (_WIN32) || defined (__WIN32__) || defined (WIN32)) +#if (defined (_WIN32) || defined (__WIN32__) || defined (WIN32)) #ifdef DLL_EXPORT /* defined by libtool (if required) */ # define objc_EXPORT __declspec(dllexport) diff --git a/objc/objc.h b/objc/objc.h index ee7612c..f54910a 100644 --- a/objc/objc.h +++ b/objc/objc.h @@ -39,8 +39,10 @@ extern "C" { #ifdef __vxworks typedef int BOOL; #else +#ifndef BOOL typedef unsigned char BOOL; #endif +#endif #define YES (BOOL)1 #define NO (BOOL)0 diff --git a/sendmsg.c b/sendmsg.c index a037cba..5df8e19 100644 --- a/sendmsg.c +++ b/sendmsg.c @@ -685,14 +685,14 @@ __objc_print_dtable_stats () #endif printf ("arrays: %d = %ld bytes\n", narrays, - (long) narrays * sizeof (struct sarray)); + (long) ((size_t) narrays * sizeof (struct sarray))); total += narrays * sizeof (struct sarray); printf ("buckets: %d = %ld bytes\n", nbuckets, - (long) nbuckets * sizeof (struct sbucket)); + (long) ((size_t) nbuckets * sizeof (struct sbucket))); total += nbuckets * sizeof (struct sbucket); printf ("idxtables: %d = %ld bytes\n", - idxsize, (long) idxsize * sizeof (void *)); + idxsize, (long) ((size_t) idxsize * sizeof (void *))); total += idxsize * sizeof (void *); printf ("-----------------------------------\n"); printf ("total: %d bytes\n", total); diff --git a/thr-win32.c b/thr-win32.c index eaa3b83..9a5eb80 100644 --- a/thr-win32.c +++ b/thr-win32.c @@ -72,12 +72,12 @@ __objc_thread_detach(void (*func)(void *arg), void *arg) arg, 0, &thread_id))) #else // According to MSDN documentation threads which use libc functions should call _beginthreadex not CreateThread - if ((HANDLE)-1 == (win32_handle = (HANDLE)_beginthreadex(NULL, 0, (void*)func, arg, 0, (int*)&thread_id))) + if ((HANDLE)-1 == (win32_handle = (HANDLE)_beginthreadex(NULL, 0, (void*)func, arg, 0, (unsigned*)&thread_id))) #endif thread_id = 0; CloseHandle((HANDLE)win32_handle); - return (objc_thread_t)thread_id; + return (objc_thread_t)(size_t) thread_id; } /* Set the current thread's priority. */ @@ -162,7 +162,7 @@ __objc_thread_exit(void) objc_thread_t __objc_thread_id(void) { - return (objc_thread_t)GetCurrentThreadId(); + return (objc_thread_t)(size_t) GetCurrentThreadId(); } /* Sets the thread's local storage pointer. */ diff --git a/thr.c b/thr.c index 17f6f7e..663d38f 100644 --- a/thr.c +++ b/thr.c @@ -114,6 +114,9 @@ __objc_thread_detach_function (struct __objc_thread_start_state *istate) /* Exit the thread */ objc_thread_exit (); + + /* never reached. */ + abort (); } /*