From patchwork Tue Dec 21 11:50:23 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: =?UTF-8?Q?libobjc:=20header=20cleanup=20for=20new=20API=20(15)?= Date: Tue, 21 Dec 2010 01:50:23 -0000 From: Nicola Pero X-Patchwork-Id: 76280 Message-Id: <1292932223.796531175@192.168.2.228> To: "GCC Patches" This patch moves DEBUG_PRINTF to objc-private/common.h, so that hash.c no longer includes a mass of Objective-C runtime function declarations that it doesn't use. Committed to trunk. Thanks Index: objc-private/runtime.h =================================================================== --- objc-private/runtime.h (revision 168108) +++ objc-private/runtime.h (working copy) @@ -77,12 +77,6 @@ /* Number of threads which are alive. */ extern int __objc_runtime_threads_alive; -#ifdef DEBUG -#define DEBUG_PRINTF(format, args...) printf (format, ## args) -#else -#define DEBUG_PRINTF(format, args...) -#endif - BOOL __objc_responds_to (id object, SEL sel); /* for internal use only! */ extern void __objc_generate_gc_type_description (Class); Index: objc-private/common.h =================================================================== --- objc-private/common.h (revision 168108) +++ objc-private/common.h (working copy) @@ -26,13 +26,17 @@ #define __objc_private_common_INCLUDE_GNU /* This file contains definitions that should be included by all .c - and .m files in libobjc. -*/ + and .m files in libobjc. */ /* This variable allows the public headers to determine when they are being included by a file inside libobjc itself, or when they are - being included by an external file. -*/ + being included by an external file. */ #define GNU_LIBOBJC_COMPILING_LIBOBJC_ITSELF 1 +#ifdef DEBUG +#define DEBUG_PRINTF(format, args...) printf (format, ## args) +#else +#define DEBUG_PRINTF(format, args...) +#endif + #endif /* __objc_private_common_INCLUDE_GNU */ Index: hash.c =================================================================== --- hash.c (revision 168110) +++ hash.c (working copy) @@ -26,9 +26,7 @@ #include /* For assert. */ #include "objc/runtime.h" /* For objc_calloc. */ -#include "objc/thr.h" /* Required by objc-private/runtime.h. */ #include "objc-private/hash.h" -#include "objc-private/runtime.h" /* for DEBUG_PRINTF. */ /* These two macros determine when a hash table is full and by how much it should be expanded respectively. Index: ChangeLog =================================================================== --- ChangeLog (revision 168110) +++ ChangeLog (working copy) @@ -1,4 +1,10 @@ 2010-12-21 Nicola Pero + + * objc-private/runtime.h (DEBUG_PRINTF): Moved from here ... + * objc-private/common.h (DEBUG_PRINTF): To here. + * hash.c: Do not include objc-private/runtime.h and objc/thr.h. + +2010-12-21 Nicola Pero * hash.c: Tidied up comments and indentation. No code changes.