Import feature test function from libobjc2 into ObjectiveC2 framework. Returns 0 for all of the new features. May return the wrong value for exception support, if the runtime is really ancient and does not support exceptions. Returns 1 for features that the framework adds.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@31252 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
David Chisnall 2010-09-08 14:10:01 +00:00
parent 3564932935
commit daecca9270
3 changed files with 92 additions and 0 deletions

19
Source/ObjectiveC2/caps.c Normal file
View file

@ -0,0 +1,19 @@
#include "capabilities.h"
#include <stdint.h>
/**
* Bitmask of all of the capabilities compiled into this version of the
* runtime.
*/
static const int32_t caps =
(1<<OBJC_CAP_EXCEPTIONS) |
(1<<OBJC_CAP_SYNCRONIZE) |
(1<<OBJC_CAP_PROPERTIES) |
0;
int objc_test_capability(int x)
{
if (x >= 32) { return 0; }
if (caps & (1<<x)) { return 1; }
return 0;
}