summaryrefslogtreecommitdiffstats
path: root/source/slang-rt/slang-rt.h
blob: 76b87091689545fb5d9969eba785b3e65a64af78 (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
// slang-rt.h
#ifndef SLANG_RT_H
#define SLANG_RT_H

#include "../core/slang-com-object.h"
#include "../core/slang-smart-pointer.h"
#include "../core/slang-string.h"

#ifdef SLANG_RT_DYNAMIC_EXPORT
#define SLANG_RT_API SLANG_DLL_EXPORT
#else
#define SLANG_RT_API
#endif

#if defined(_MSC_VER)
#define SLANG_PRELUDE_SHARED_LIB_EXPORT __declspec(dllexport)
#else
#define SLANG_PRELUDE_SHARED_LIB_EXPORT __attribute__((__visibility__("default")))
// #   define SLANG_PRELUDE_SHARED_LIB_EXPORT __attribute__ ((dllexport))
// __attribute__((__visibility__("default")))
#endif

#define SLANG_PRELUDE_EXPORT extern "C" SLANG_PRELUDE_SHARED_LIB_EXPORT

extern "C"
{
    SLANG_RT_API void SLANG_MCALL _slang_rt_abort(Slang::String errorMessage);
    SLANG_RT_API void* SLANG_MCALL _slang_rt_load_dll(Slang::String modulePath);
    SLANG_RT_API void* SLANG_MCALL
    _slang_rt_load_dll_func(void* moduleHandle, Slang::String modulePath, uint32_t argSize);
}

#endif