Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
numba
GitHub Repository: numba/llvmlite
Path: blob/main/ffi/core.h
1154 views
1
#ifndef LLVMPY_CORE_H_
2
#define LLVMPY_CORE_H_
3
4
#include "llvm-c/Core.h"
5
6
// Needed for macros that control version-specific behaviour - included here so
7
// that they are available in all ffi translation units
8
#include "llvm/Config/llvm-config.h"
9
10
#include <cstdlib>
11
#include <cstring>
12
13
#if defined(_MSC_VER)
14
#define HAVE_DECLSPEC_DLL
15
#endif
16
17
#if defined(HAVE_DECLSPEC_DLL)
18
#define API_EXPORT(RTYPE) __declspec(dllexport) RTYPE
19
#else
20
// Non-windows: use visibility attributes.
21
#define API_EXPORT(RTYPE) __attribute__((visibility("default"))) RTYPE
22
#endif
23
24
extern "C" {
25
26
API_EXPORT(const char *)
27
LLVMPY_CreateString(const char *msg);
28
29
API_EXPORT(const char *)
30
LLVMPY_CreateByteString(const char *buf, size_t len);
31
32
API_EXPORT(void)
33
LLVMPY_DisposeString(const char *msg);
34
35
API_EXPORT(LLVMContextRef)
36
LLVMPY_GetGlobalContext();
37
38
API_EXPORT(LLVMContextRef)
39
LLVMPY_ContextCreate();
40
41
} /* end extern "C" */
42
43
#endif /* LLVMPY_CORE_H_ */
44
45