From ab59ce1d33d562f004646207cc92b9655795e67e Mon Sep 17 00:00:00 2001 From: theraven Date: Wed, 8 Sep 2010 14:02:03 +0000 Subject: [PATCH] Add feature test APIs to libobjc2. --- GNUmakefile | 2 ++ caps.c | 28 ++++++++++++++++++ objc/capabilities.h | 71 +++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 101 insertions(+) create mode 100644 caps.c create mode 100644 objc/capabilities.h diff --git a/GNUmakefile b/GNUmakefile index 2e5ccce..9441040 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -17,6 +17,7 @@ libobjc_OBJC_FILES = \ libobjc_C_FILES = \ abi_version.c\ + caps.c\ category_loader.c\ class_table.c\ dtable.c\ @@ -43,6 +44,7 @@ ifneq ($(install_headers), no) libobjc_HEADER_FILES = \ Availability.h\ blocks_runtime.h\ + capabilities.h\ hooks.h\ runtime.h\ slot.h\ diff --git a/caps.c b/caps.c new file mode 100644 index 0000000..2832e38 --- /dev/null +++ b/caps.c @@ -0,0 +1,28 @@ +#include "objc/capabilities.h" +#include + +/** + * Bitmask of all of the capabilities compiled into this version of the + * runtime. + */ +static const int32_t caps = + (1<= 32) { return 0; } + if (caps & (1<