PATCH: objc-improvements-branch merge -- Part 2
Andrew Pinski
pinskia@physics.uc.edu
Fri Aug 13 03:52:00 GMT 2004
Mostly okay but a few problems I saw:
On Aug 12, 2004, at 6:50 PM, Ziemowit Laski wrote:
> retrieving revision 1.3
> diff -u -3 -p -r1.3 Object.h
> --- libobjc/objc/Object.h 23 May 2003 20:04:58 -0000 1.3
> +++ libobjc/objc/Object.h 13 Aug 2004 01:49:46 -0000
> @@ -27,6 +27,10 @@ Boston, MA 02111-1307, USA. */
> #ifndef __object_INCLUDE_GNU
> #define __object_INCLUDE_GNU
>
> +#ifdef __cplusplus
> +extern "C" {
> +#endif
> +
> #include <objc/objc.h>
> #include <objc/typedstream.h>
Never ever wrap extern "C" around other headers.
> Index: libobjc/objc/encoding.h
> ===================================================================
> RCS file: /cvs/gcc/gcc/libobjc/objc/encoding.h,v
> retrieving revision 1.5
> diff -u -3 -p -r1.5 encoding.h
> --- libobjc/objc/encoding.h 25 Jun 2004 04:31:51 -0000 1.5
> +++ libobjc/objc/encoding.h 13 Aug 2004 01:49:46 -0000
> @@ -29,13 +29,14 @@ Boston, MA 02111-1307, USA. */
> #ifndef __encoding_INCLUDE_GNU
> #define __encoding_INCLUDE_GNU
>
> -#include <ctype.h>
> -#include "objc/objc-api.h"
> +#include <objc/objc-api.h>
>
> #ifdef __cplusplus
> extern "C" {
> #endif /* __cplusplus */
>
> +#include <ctype.h>
> +
> #define _C_CONST 'r'
> #define _C_IN 'n'
> #define _C_INOUT 'N'
Likewise.
> Index: libobjc/objc/hash.h
> ===================================================================
> RCS file: /cvs/gcc/gcc/libobjc/objc/hash.h,v
> retrieving revision 1.9
> diff -u -3 -p -r1.9 hash.h
> --- libobjc/objc/hash.h 25 Jun 2004 04:31:51 -0000 1.9
> +++ libobjc/objc/hash.h 13 Aug 2004 01:49:46 -0000
> @@ -28,14 +28,14 @@ Boston, MA 02111-1307, USA. */
> #ifndef __hash_INCLUDE_GNU
> #define __hash_INCLUDE_GNU
>
> -#include <stddef.h>
> -#include <string.h>
> #include <objc/objc.h>
>
> #ifdef __cplusplus
> extern "C" {
> #endif /* __cplusplus */
>
> +#include <stddef.h>
> +#include <string.h>
>
> /*
> * This data structure is used to hold items
Likewise.
> Index: libobjc/objc/objc-api.h
> ===================================================================
> RCS file: /cvs/gcc/gcc/libobjc/objc/objc-api.h,v
> retrieving revision 1.10
> diff -u -3 -p -r1.10 objc-api.h
> --- libobjc/objc/objc-api.h 25 Jun 2004 04:31:51 -0000 1.10
> +++ libobjc/objc/objc-api.h 13 Aug 2004 01:49:46 -0000
> @@ -27,17 +27,17 @@ Boston, MA 02111-1307, USA. */
> #ifndef __objc_api_INCLUDE_GNU
> #define __objc_api_INCLUDE_GNU
>
> -#include "objc/objc.h"
> -#include "objc/hash.h"
> -#include "objc/thr.h"
> -#include "objc/objc-decls.h"
> -#include <stdio.h>
> -#include <stdarg.h>
> +#include <objc/objc.h>
> +#include <objc/hash.h>
> +#include <objc/thr.h>
> +#include <objc/objc-decls.h>
>
> #ifdef __cplusplus
> extern "C" {
> #endif /* __cplusplus */
>
> +#include <stdio.h>
> +#include <stdarg.h>
>
> /* For functions which return Method_t */
> #define METHOD_NULL (Method_t)0
Likewise.
> Index: libobjc/objc/runtime.h
> ===================================================================
> RCS file: /cvs/gcc/gcc/libobjc/objc/runtime.h,v
> retrieving revision 1.6
> diff -u -3 -p -r1.6 runtime.h
> --- libobjc/objc/runtime.h 25 Jun 2004 04:31:51 -0000 1.6
> +++ libobjc/objc/runtime.h 13 Aug 2004 01:49:46 -0000
> @@ -26,26 +26,25 @@ Foundation, 59 Temple Place - Suite 330,
> #ifndef __objc_runtime_INCLUDE_GNU
> #define __objc_runtime_INCLUDE_GNU
>
> -#include <stdarg.h> /* for varargs and va_list's */
> -
> -#include <stdio.h>
> -#include <ctype.h>
> +#include <objc/objc.h> /* core data types */
> +#include <objc/objc-api.h> /* runtime api functions */
>
> -#include <stddef.h> /* so noone else will get system
> versions */
> -#include "assert.h"
> -
> -#include "objc/objc.h" /* core data types */
> -#include "objc/objc-api.h" /* runtime api functions */
> +#include <objc/thr.h> /* thread and mutex support */
>
> -#include "objc/thr.h" /* thread and mutex support */
> -
> -#include "objc/hash.h" /* hash structures */
> -#include "objc/objc-list.h" /* linear lists */
> +#include <objc/hash.h> /* hash structures */
> +#include <objc/objc-list.h> /* linear lists */
>
> #ifdef __cplusplus
> extern "C" {
> #endif /* __cplusplus */
>
> +#include <stdarg.h> /* for varargs and va_list's */
> +
> +#include <stdio.h>
> +#include <ctype.h>
> +
> +#include <stddef.h> /* so noone else will get system
> versions */
> +#include <assert.h>
>
> extern void __objc_add_class_to_hash(Class); /* (objc-class.c) */
> extern void __objc_init_selector_tables(void); /* (objc-sel.c) */
Likewise.
> ===================================================================
> RCS file: /cvs/gcc/gcc/libobjc/objc/sarray.h,v
> retrieving revision 1.5
> diff -u -3 -p -r1.5 sarray.h
> --- libobjc/objc/sarray.h 25 Jun 2004 04:31:51 -0000 1.5
> +++ libobjc/objc/sarray.h 13 Aug 2004 01:49:46 -0000
> @@ -1,5 +1,5 @@
> /* Sparse Arrays for Objective C dispatch tables
> - Copyright (C) 1993, 1995, 1996 Free Software Foundation, Inc.
> + Copyright (C) 1993, 1995, 1996, 2004 Free Software Foundation, Inc.
> Contributed by Kresten Krab Thorup.
>
> This file is part of GCC.
> @@ -28,6 +28,12 @@ Boston, MA 02111-1307, USA. */
> #ifndef __sarray_INCLUDE_GNU
> #define __sarray_INCLUDE_GNU
>
> +#include <objc/thr.h>
> +
> +#ifdef __cplusplus
> +extern "C" {
> +#endif /* __cplusplus */
> +
> #define OBJC_SPARSE2 /* 2-level sparse array */
> /* #define OBJC_SPARSE3 */ /* 3-level sparse array */
>
> @@ -41,22 +47,11 @@ extern const char* __objc_sparse3_id;
>
> #include <stddef.h>
>
> -#include "objc/thr.h"
> -
> -#ifdef __cplusplus
> -extern "C" {
> -#endif /* __cplusplus */
> -
> extern int nbuckets; /* for stats */
> extern int nindices;
> extern int narrays;
> extern int idxsize;
>
> -#ifdef __cplusplus
> -}
> -#endif /* __cplusplus */
> -
> -
> #include <assert.h>
>
> /* An unsigned integer of same size as a pointer */
> @@ -151,10 +146,6 @@ struct sarray {
> size_t capacity;
> };
>
> -#ifdef __cplusplus
> -extern "C" {
> -#endif /* __cplusplus */
> -
> struct sarray* sarray_new(int, void* default_element);
> void sarray_free(struct sarray*);
> struct sarray* sarray_lazy_copy(struct sarray*);
> @@ -251,5 +242,4 @@ static inline void* sarray_get_safe(stru
> }
> #endif /* __cplusplus */
>
> -
> #endif /* __sarray_INCLUDE_GNU */
Likewise.
> Index: libobjc/objc/typedstream.h
> ===================================================================
> RCS file: /cvs/gcc/gcc/libobjc/objc/typedstream.h,v
> retrieving revision 1.5
> diff -u -3 -p -r1.5 typedstream.h
> --- libobjc/objc/typedstream.h 25 Jun 2004 04:31:51 -0000 1.5
> +++ libobjc/objc/typedstream.h 13 Aug 2004 01:49:46 -0000
> @@ -27,14 +27,14 @@ Boston, MA 02111-1307, USA. */
> #ifndef __typedstream_INCLUDE_GNU
> #define __typedstream_INCLUDE_GNU
>
> -#include "objc/objc.h"
> -#include "objc/hash.h"
> -#include <stdio.h>
> +#include <objc/objc.h>
> +#include <objc/hash.h>
>
> #ifdef __cplusplus
> extern "C" {
> #endif /* __cplusplus */
>
> +#include <stdio.h>
>
> typedef int (*objc_typed_read_func)(void*, char*, int);
> typedef int (*objc_typed_write_func)(void*, const char*, int);
> @@ -138,5 +138,4 @@ void objc_flush_typed_stream (TypedStrea
> }
> #endif /* __cplusplus */
>
> -
> #endif /* not __typedstream_INCLUDE_GNU */
>
>
Likewise.
After fixing those problems this is okay to commit.
-- Andrew Pinski
More information about the Gcc-patches
mailing list