From c73b7a2f0b9315ceb90a2d1ab0f6f343478d191c Mon Sep 17 00:00:00 2001 From: theraven Date: Thu, 31 Jan 2013 17:40:53 +0000 Subject: [PATCH] Mark all libobjc2 headers as system headers when not compiling the runtime itself. This makes clang hide warnings. --- objc/Availability.h | 4 ++++ objc/Object.h | 4 ++++ objc/Protocol.h | 4 ++++ objc/blocks_private.h | 4 ++++ objc/blocks_runtime.h | 4 ++++ objc/capabilities.h | 4 ++++ objc/developer.h | 4 ++++ objc/encoding.h | 4 ++++ objc/hooks.h | 4 ++++ objc/message.h | 14 ++++---------- objc/objc-api.h | 4 ++++ objc/objc-arc.h | 4 ++++ objc/objc-auto.h | 4 ++++ objc/runtime-deprecated.h | 4 ++++ objc/runtime.h | 4 ++++ objc/slot.h | 4 ++++ 16 files changed, 64 insertions(+), 10 deletions(-) diff --git a/objc/Availability.h b/objc/Availability.h index 408b998..0bdc7cd 100644 --- a/objc/Availability.h +++ b/objc/Availability.h @@ -1,3 +1,7 @@ +#if defined(__clang__) && !defined(__OBJC_RUNTIME_INTERNAL__) +#pragma clang system_header +#endif + #ifdef STRICT_MACOS_X # define OBJC_NONPORTABLE __attribute__((error("Function not supported by the Apple runtime"))) diff --git a/objc/Object.h b/objc/Object.h index e5c9c46..b37647d 100644 --- a/objc/Object.h +++ b/objc/Object.h @@ -1,3 +1,7 @@ +#if defined(__clang__) && !defined(__OBJC_RUNTIME_INTERNAL__) +#pragma clang system_header +#endif + #include @interface Object diff --git a/objc/Protocol.h b/objc/Protocol.h index d38c1f5..b67085d 100644 --- a/objc/Protocol.h +++ b/objc/Protocol.h @@ -1,3 +1,7 @@ +#if defined(__clang__) && !defined(__OBJC_RUNTIME_INTERNAL__) +#pragma clang system_header +#endif + #import "Object.h" @interface Protocol : Object @end diff --git a/objc/blocks_private.h b/objc/blocks_private.h index 5f1fca1..60a1d59 100644 --- a/objc/blocks_private.h +++ b/objc/blocks_private.h @@ -1,5 +1,9 @@ #ifndef __LIBOBJC_BLOCKS_PRIVATE_H_INCLUDED__ #define __LIBOBJC_BLOCKS_PRIVATE_H_INCLUDED__ +#if defined(__clang__) && !defined(__OBJC_RUNTIME_INTERNAL__) +#pragma clang system_header +#endif + /* * This header file exposes some implementation details of the blocks runtime diff --git a/objc/blocks_runtime.h b/objc/blocks_runtime.h index 8a64bf2..e5dbdea 100644 --- a/objc/blocks_runtime.h +++ b/objc/blocks_runtime.h @@ -1,3 +1,7 @@ +#if defined(__clang__) && !defined(__OBJC_RUNTIME_INTERNAL__) +#pragma clang system_header +#endif + /* * Blocks Runtime */ diff --git a/objc/capabilities.h b/objc/capabilities.h index 950749c..dc4e046 100644 --- a/objc/capabilities.h +++ b/objc/capabilities.h @@ -1,3 +1,7 @@ +#if defined(__clang__) && !defined(__OBJC_RUNTIME_INTERNAL__) +#pragma clang system_header +#endif + /** * capabilities.h - This file defines the list of capabilities. Runtime * capabilities can be checked. You may use #ifdef to test at compile time diff --git a/objc/developer.h b/objc/developer.h index 2752cf1..321ea8d 100644 --- a/objc/developer.h +++ b/objc/developer.h @@ -1,3 +1,7 @@ +#if defined(__clang__) && !defined(__OBJC_RUNTIME_INTERNAL__) +#pragma clang system_header +#endif + enum objc_developer_mode_np { /** User mode - the default. */ diff --git a/objc/encoding.h b/objc/encoding.h index bb58c0b..4c4ff53 100644 --- a/objc/encoding.h +++ b/objc/encoding.h @@ -1,3 +1,7 @@ +#if defined(__clang__) && !defined(__OBJC_RUNTIME_INTERNAL__) +#pragma clang system_header +#endif + #ifndef __LIBOBJC_ENCODING_H_INCLUDED__ #define __LIBOBJC_ENCODING_H_INCLUDED__ diff --git a/objc/hooks.h b/objc/hooks.h index 7fdcf88..8ec6b70 100644 --- a/objc/hooks.h +++ b/objc/hooks.h @@ -1,3 +1,7 @@ +#if defined(__clang__) && !defined(__OBJC_RUNTIME_INTERNAL__) +#pragma clang system_header +#endif + /** * This file includes all of the hooks that can be used to alter the behaviour * of the runtime. diff --git a/objc/message.h b/objc/message.h index c2bef7c..2c3a956 100644 --- a/objc/message.h +++ b/objc/message.h @@ -1,3 +1,7 @@ +#if defined(__clang__) && !defined(__OBJC_RUNTIME_INTERNAL__) +#pragma clang system_header +#endif + #ifndef _OBJC_MESSAGE_H_ #define _OBJC_MESSAGE_H_ @@ -37,17 +41,7 @@ id objc_msgSend(id self, SEL _cmd, ...); #ifdef __cplusplus id objc_msgSend_stret(id self, SEL _cmd, ...); #else -// There is a bug in older versions of clang that incorrectly declares the -// signature of this function as a builtin. -# ifdef __clang__ -# if (__clang_major__ > 3) || ((__clang_major__ == 3) && __clang_minor__ >= 3) -void objc_msgSend_stret(id self, SEL _cmd, ...); -# else -id objc_msgSend_stret(id self, SEL _cmd, ...); -# endif -# else void objc_msgSend_stret(id self, SEL _cmd, ...); -# endif #endif /** * Standard message sending function. This function must be cast to the diff --git a/objc/objc-api.h b/objc/objc-api.h index 9786447..9cf4aaf 100644 --- a/objc/objc-api.h +++ b/objc/objc-api.h @@ -1 +1,5 @@ +#if defined(__clang__) && !defined(__OBJC_RUNTIME_INTERNAL__) +#pragma clang system_header +#endif + #include diff --git a/objc/objc-arc.h b/objc/objc-arc.h index c7a4200..0da4030 100644 --- a/objc/objc-arc.h +++ b/objc/objc-arc.h @@ -1,3 +1,7 @@ +#if defined(__clang__) && !defined(__OBJC_RUNTIME_INTERNAL__) +#pragma clang system_header +#endif + #ifndef __OBJC_ARC_INCLUDED__ #define __OBJC_ARC_INCLUDED__ /** diff --git a/objc/objc-auto.h b/objc/objc-auto.h index 2ec4939..1dfe132 100644 --- a/objc/objc-auto.h +++ b/objc/objc-auto.h @@ -1,3 +1,7 @@ +#if defined(__clang__) && !defined(__OBJC_RUNTIME_INTERNAL__) +#pragma clang system_header +#endif + /** * objc-auto.h - This file provides the interface for Objective-C garbage * collection diff --git a/objc/runtime-deprecated.h b/objc/runtime-deprecated.h index f85d3df..2f6c78a 100644 --- a/objc/runtime-deprecated.h +++ b/objc/runtime-deprecated.h @@ -1,3 +1,7 @@ +#if defined(__clang__) && !defined(__OBJC_RUNTIME_INTERNAL__) +#pragma clang system_header +#endif + #if !defined(__GNUSTEP_LIBOBJC_RUNTIME_DEPRECATED_INCLUDED__) && !defined(GNUSTEP_LIBOBJC_NO_LEGACY) # define __GNUSTEP_LIBOBJC_RUNTIME_DEPRECATED_INCLUDED__ diff --git a/objc/runtime.h b/objc/runtime.h index 863a89f..3092f72 100644 --- a/objc/runtime.h +++ b/objc/runtime.h @@ -1,3 +1,7 @@ +#if defined(__clang__) && !defined(__OBJC_RUNTIME_INTERNAL__) +#pragma clang system_header +#endif + #ifndef __LIBOBJC_RUNTIME_H_INCLUDED__ #define __LIBOBJC_RUNTIME_H_INCLUDED__ diff --git a/objc/slot.h b/objc/slot.h index 0afd754..cae2ee3 100644 --- a/objc/slot.h +++ b/objc/slot.h @@ -1,3 +1,7 @@ +#if defined(__clang__) && !defined(__OBJC_RUNTIME_INTERNAL__) +#pragma clang system_header +#endif + #ifndef __OBJC_SLOT_H_INCLUDED__ #define __OBJC_SLOT_H_INCLUDED__ /**