summaryrefslogtreecommitdiff
path: root/Objective-C/PyObjC/pyobjc.h
blob: f762f7073ece22eb850d1156094c47124bc28e55 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/* Copyright 2007, Matthias Andreas Benkard. */

#ifndef __pyobjc_H
#define __pyobjc_H

#include <stdlib.h>
#include <stdio.h>

#ifdef __NEXT_RUNTIME__
#include "pyobjc-compat.h"
#endif

#ifndef __OBJC2__
#define NO_OBJC2_RUNTIME
#endif

/* #define MAC_OS_X_VERSION_MIN_REQUIRED MAC_OS_X_VERSION_10_4 */

#ifdef __NEXT_RUNTIME__

#ifndef APPLE_RUNTIME
#define APPLE_RUNTIME
#endif

#import <objc/objc-class.h>

#else /* !__NEXT_RUNTIME__ */

#ifndef GNU_RUNTIME
#define GNU_RUNTIME
#endif

#import <objc/objc-api.h>
#ifndef __CXX__
#define bool BOOL
#endif

#endif /* __NEXT_RUNTIME__ */


#define PyMem_Free free
#define PyMem_Malloc malloc
#define Py_ssize_t ssize_t

#ifdef OOM_KILL
#define PyErr_NoMemory() [objcl_oom_exception raise]
#else
#define PyErr_NoMemory() NSLog (@"ERROR: Memory exhausted.");
#endif

#include "objc_support.h"
#include "libffi_support.h"
#import "libobjcl.h"

#endif /* __pyobjc_H */