}
int
-objc_write_unsigned_short (struct objc_typed_stream* stream, unsigned short value)
+objc_write_unsigned_short (struct objc_typed_stream* stream,
+ unsigned short value)
{
unsigned char buf[sizeof (unsigned short)+1];
int len = __objc_code_unsigned_short (buf, value);
}
int
-objc_write_unsigned_long (struct objc_typed_stream* stream, unsigned long value)
+objc_write_unsigned_long (struct objc_typed_stream* stream,
+ unsigned long value)
{
unsigned char buf[sizeof(unsigned long)+1];
int len = __objc_code_unsigned_long (buf, value);
}
static int
-objc_write_register_common (struct objc_typed_stream* stream, unsigned long key)
+objc_write_register_common (struct objc_typed_stream* stream,
+ unsigned long key)
{
unsigned char buf[sizeof (unsigned long)+2];
int len = __objc_code_unsigned_long (buf+1, key);
else
{
int length;
- hash_add (&stream->stream_table, LONG2PTR(key=PTR2LONG(sel_name)), (char*)sel_name);
+ hash_add (&stream->stream_table,
+ LONG2PTR(key=PTR2LONG(sel_name)), (char*)sel_name);
if ((length = objc_write_register_common (stream, key)))
return __objc_write_selector (stream, selector);
return length;
{
struct objc_list* other;
len = objc_read_unsigned_long (stream, &key);
- other = (struct objc_list*)hash_value_for_key (stream->object_refs, LONG2PTR(key));
- hash_add (&stream->object_refs, LONG2PTR(key), (void*)list_cons(object, other));
+ other = (struct objc_list*)hash_value_for_key (stream->object_refs,
+ LONG2PTR(key));
+ hash_add (&stream->object_refs, LONG2PTR(key),
+ (void*)list_cons(object, other));
}
else if (buf[0] == (_B_EXT | _BX_OBJROOT)) /* a root object */
if (key)
__objc_fatal("cannot register use upcode...");
len = __objc_read_nbyte_ulong(stream, (buf[0] & _B_VALUE), &key);
- (*selector) = hash_value_for_key (stream->stream_table, LONG2PTR(key));
+ (*selector) = hash_value_for_key (stream->stream_table,
+ LONG2PTR(key));
}
else
break;
case _C_ATOM:
- return objc_write_string_atomic (stream, *(char**)data, strlen(*(char**)data));
+ return objc_write_string_atomic (stream, *(char**)data,
+ strlen(*(char**)data));
break;
case _C_ARY_B:
if (CLS_ISCLASS (sub))
{
/* meta classes */
- CLASSOF (sub)->sibling_class = CLASSOF (impostor)->subclass_list;
+ CLASSOF (sub)->sibling_class =
+ CLASSOF (impostor)->subclass_list;
CLASSOF (sub)->super_class = CLASSOF (impostor);
CLASSOF (impostor)->subclass_list = CLASSOF (sub);
}
/* Basic data types for Objective C.
- Copyright (C) 1993, 1995 Free Software Foundation, Inc.
+ Copyright (C) 1993, 1995, 1996 Free Software Foundation, Inc.
This file is part of GNU CC.
unsigned long info; /* Bit mask. See class masks
defined above. */
long instance_size; /* Size in bytes of the class.
- The sum of the class definition
- and all super class
- definitions. */
+ The sum of the class
+ definition and all super
+ class definitions. */
struct objc_ivar_list* ivars; /* Pointer to a structure that
describes the instance
variables in the class
/* The bucket was previously empty (or something like that), */
/* allocate a new. This is the effect of `lazy' allocation */
new_bucket = (struct sbucket*)__objc_xmalloc(sizeof(struct sbucket));
- memcpy((void *) new_bucket, (const void*)array->empty_bucket, sizeof(struct sbucket));
+ memcpy((void *) new_bucket, (const void*)array->empty_bucket,
+ sizeof(struct sbucket));
new_bucket->version.version = array->version.version;
*the_bucket = new_bucket; /* Prepared for install. */
if (pthread_create(&new_thread_handle, pthread_attr_default,
(void *)func, arg) == 0) {
- thread_id = *(_objc_thread_t *)&new_thread_handle; /* ??? May not work! (64bit)*/
+ /* ??? May not work! (64bit)*/
+ thread_id = *(_objc_thread_t *)&new_thread_handle;
pthread_detach(&new_thread_handle); /* Fully detach thread. */
__objc_runtime_threads_alive++;
}
new_thread_handle = cthread_fork((cthread_fn_t)func, arg);
if(new_thread_handle) {
- thread_id = *(_objc_thread_t *)&new_thread_handle; /* this is not terribly portable */
+ /* this is not terribly portable */
+ thread_id = *(_objc_thread_t *)&new_thread_handle;
cthread_detach(new_thread_handle); /* fully detach thread */
__objc_runtime_threads_alive++; /* increment thread count */
}
int
objc_thread_set_priority(int priority)
{
- _objc_thread_t *t = objc_thread_id();
- cthread_t cT = (cthread_t) t; /* see objc_thread_id() */
- int maxPriority = __mach_get_max_thread_priority(cT, NULL);
- int sys_priority = 0;
+ _objc_thread_t *t = objc_thread_id();
+ cthread_t cT = (cthread_t) t;
+ int maxPriority = __mach_get_max_thread_priority(cT, NULL);
+ int sys_priority = 0;
if (maxPriority == -1)
return -1;
however invalidate any other reasons why the executable file might be
covered by the GNU General Public License. */
-#include <windows.h>
#include <objc/thr.h>
#include "runtime.h"
+#ifndef __OBJC__
+#define __OBJC__
+#endif
+#include <windows.h>
+
/********
* This structure represents a single mutual exclusion lock. Lock semantics
* are detailed with the subsequent functions. We use whatever lock is
#include <stdlib.h>
#include "runtime.h"
-/*****************************************************************************
+/*************************************************************************
* Universal static variables:
*/
-int __objc_thread_exit_status = 0; /* Global exit status. */
+int __objc_thread_exit_status = 0; /* Global exit status. */
/* Flag which lets us know if we ever became multi threaded */
int __objc_is_multi_threaded = 0;