|
| 1 | +/* ---------------------------------------------------------------------------- |
| 2 | + * This file was automatically generated by SWIG (https://www.swig.org). |
| 3 | + * Version 4.4.0 |
| 4 | + * |
| 5 | + * Do not make changes to this file unless you know what you are doing - modify |
| 6 | + * the SWIG interface file instead. |
| 7 | + * ----------------------------------------------------------------------------- */ |
| 8 | +/* ----------------------------------------------------------------------------- |
| 9 | + * This section contains generic SWIG labels for method/variable |
| 10 | + * declarations/attributes, and other compiler dependent labels. |
| 11 | + * ----------------------------------------------------------------------------- */ |
| 12 | + |
| 13 | +/* template workaround for compilers that cannot correctly implement the C++ standard */ |
| 14 | +#ifndef SWIGTEMPLATEDISAMBIGUATOR |
| 15 | +# if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560) |
| 16 | +# define SWIGTEMPLATEDISAMBIGUATOR template |
| 17 | +# elif defined(__HP_aCC) |
| 18 | +/* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */ |
| 19 | +/* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */ |
| 20 | +# define SWIGTEMPLATEDISAMBIGUATOR template |
| 21 | +# else |
| 22 | +# define SWIGTEMPLATEDISAMBIGUATOR |
| 23 | +# endif |
| 24 | +#endif |
| 25 | + |
| 26 | +/* inline attribute */ |
| 27 | +#ifndef SWIGINLINE |
| 28 | +# if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__)) |
| 29 | +# define SWIGINLINE inline |
| 30 | +# else |
| 31 | +# define SWIGINLINE |
| 32 | +# endif |
| 33 | +#endif |
| 34 | + |
| 35 | +/* attribute recognised by some compilers to avoid 'unused' warnings */ |
| 36 | +#ifndef SWIGUNUSED |
| 37 | +# if defined(__GNUC__) |
| 38 | +# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) |
| 39 | +# define SWIGUNUSED __attribute__ ((__unused__)) |
| 40 | +# else |
| 41 | +# define SWIGUNUSED |
| 42 | +# endif |
| 43 | +# elif defined(__ICC) |
| 44 | +# define SWIGUNUSED __attribute__ ((__unused__)) |
| 45 | +# else |
| 46 | +# define SWIGUNUSED |
| 47 | +# endif |
| 48 | +#endif |
| 49 | + |
| 50 | +#ifndef SWIG_MSC_UNSUPPRESS_4505 |
| 51 | +# if defined(_MSC_VER) |
| 52 | +# pragma warning(disable : 4505) /* unreferenced local function has been removed */ |
| 53 | +# endif |
| 54 | +#endif |
| 55 | + |
| 56 | +#ifndef SWIGUNUSEDPARM |
| 57 | +# ifdef __cplusplus |
| 58 | +# define SWIGUNUSEDPARM(p) |
| 59 | +# else |
| 60 | +# define SWIGUNUSEDPARM(p) p SWIGUNUSED |
| 61 | +# endif |
| 62 | +#endif |
| 63 | + |
| 64 | +/* internal SWIG method */ |
| 65 | +#ifndef SWIGINTERN |
| 66 | +# define SWIGINTERN static SWIGUNUSED |
| 67 | +#endif |
| 68 | + |
| 69 | +/* internal inline SWIG method */ |
| 70 | +#ifndef SWIGINTERNINLINE |
| 71 | +# define SWIGINTERNINLINE SWIGINTERN SWIGINLINE |
| 72 | +#endif |
| 73 | + |
| 74 | +/* exporting methods */ |
| 75 | +#if defined(__GNUC__) |
| 76 | +# if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) |
| 77 | +# ifndef GCC_HASCLASSVISIBILITY |
| 78 | +# define GCC_HASCLASSVISIBILITY |
| 79 | +# endif |
| 80 | +# endif |
| 81 | +#endif |
| 82 | + |
| 83 | +#ifndef SWIGEXPORT |
| 84 | +# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) |
| 85 | +# if defined(STATIC_LINKED) |
| 86 | +# define SWIGEXPORT |
| 87 | +# else |
| 88 | +# define SWIGEXPORT __declspec(dllexport) |
| 89 | +# endif |
| 90 | +# else |
| 91 | +# if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY) |
| 92 | +# define SWIGEXPORT __attribute__ ((visibility("default"))) |
| 93 | +# else |
| 94 | +# define SWIGEXPORT |
| 95 | +# endif |
| 96 | +# endif |
| 97 | +#endif |
| 98 | + |
| 99 | +/* calling conventions for Windows */ |
| 100 | +#ifndef SWIGSTDCALL |
| 101 | +# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) |
| 102 | +# define SWIGSTDCALL __stdcall |
| 103 | +# else |
| 104 | +# define SWIGSTDCALL |
| 105 | +# endif |
| 106 | +#endif |
| 107 | + |
| 108 | +/* Deal with Microsoft's attempt at deprecating C standard runtime functions */ |
| 109 | +#if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE) |
| 110 | +# define _CRT_SECURE_NO_DEPRECATE |
| 111 | +#endif |
| 112 | + |
| 113 | +/* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */ |
| 114 | +#if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE) |
| 115 | +# define _SCL_SECURE_NO_DEPRECATE |
| 116 | +#endif |
| 117 | + |
| 118 | +/* Deal with Apple's deprecated 'AssertMacros.h' from Carbon-framework */ |
| 119 | +#if defined(__APPLE__) && !defined(__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES) |
| 120 | +# define __ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES 0 |
| 121 | +#endif |
| 122 | + |
| 123 | +/* Intel's compiler complains if a variable which was never initialised is |
| 124 | + * cast to void, which is a common idiom which we use to indicate that we |
| 125 | + * are aware a variable isn't used. So we just silence that warning. |
| 126 | + * See: https://github.com/swig/swig/issues/192 for more discussion. |
| 127 | + */ |
| 128 | +#ifdef __INTEL_COMPILER |
| 129 | +# pragma warning disable 592 |
| 130 | +#endif |
| 131 | + |
| 132 | +#if defined(__cplusplus) && __cplusplus >=201103L |
| 133 | +# define SWIG_NOEXCEPT noexcept |
| 134 | +#else |
| 135 | +# define SWIG_NOEXCEPT throw() |
| 136 | +#endif |
| 137 | + |
| 138 | +/* ----------------------------------------------------------------------------- |
| 139 | + * swigcompat.swg |
| 140 | + * |
| 141 | + * Macros to provide support compatibility with older C and C++ standards. |
| 142 | + * |
| 143 | + * Note that SWIG expects __cplusplus to be defined to the appropriate C++ standard. |
| 144 | + * MSVC users are urged to check and examine the /Zc:__cplusplus compiler option. |
| 145 | + * See https://learn.microsoft.com/en-us/cpp/build/reference/zc-cplusplus. |
| 146 | + * ----------------------------------------------------------------------------- */ |
| 147 | + |
| 148 | +/* C99 and C++11 should provide snprintf, but define SWIG_NO_SNPRINTF |
| 149 | + * if you're missing it. |
| 150 | + */ |
| 151 | +#if ((defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L) || \ |
| 152 | + (defined __cplusplus && __cplusplus >= 201103L) || \ |
| 153 | + defined SWIG_HAVE_SNPRINTF) && \ |
| 154 | + !defined SWIG_NO_SNPRINTF |
| 155 | +# define SWIG_snprintf(O,S,F,A) snprintf(O,S,F,A) |
| 156 | +# define SWIG_snprintf2(O,S,F,A,B) snprintf(O,S,F,A,B) |
| 157 | +#else |
| 158 | +/* Fallback versions ignore the buffer size, but most of our uses either have a |
| 159 | + * fixed maximum possible size or dynamically allocate a buffer that's large |
| 160 | + * enough. |
| 161 | + */ |
| 162 | +# define SWIG_snprintf(O,S,F,A) sprintf(O,F,A) |
| 163 | +# define SWIG_snprintf2(O,S,F,A,B) sprintf(O,F,A,B) |
| 164 | +#endif |
| 165 | + |
| 166 | +#include <emscripten/bind.h> |
| 167 | + |
| 168 | +#ifdef __cplusplus |
| 169 | +#include <utility> |
| 170 | +/* SwigValueWrapper is described in swig.swg */ |
| 171 | +template<typename T> class SwigValueWrapper { |
| 172 | + struct SwigSmartPointer { |
| 173 | + T *ptr; |
| 174 | + SwigSmartPointer(T *p) : ptr(p) { } |
| 175 | + ~SwigSmartPointer() { delete ptr; } |
| 176 | + SwigSmartPointer& operator=(SwigSmartPointer& rhs) { T* oldptr = ptr; ptr = 0; delete oldptr; ptr = rhs.ptr; rhs.ptr = 0; return *this; } |
| 177 | + void reset(T *p) { T* oldptr = ptr; ptr = 0; delete oldptr; ptr = p; } |
| 178 | + } pointer; |
| 179 | + SwigValueWrapper& operator=(const SwigValueWrapper<T>& rhs); |
| 180 | + SwigValueWrapper(const SwigValueWrapper<T>& rhs); |
| 181 | +public: |
| 182 | + SwigValueWrapper() : pointer(0) { } |
| 183 | + SwigValueWrapper& operator=(const T& t) { SwigSmartPointer tmp(new T(t)); pointer = tmp; return *this; } |
| 184 | +#if __cplusplus >=201103L |
| 185 | + SwigValueWrapper& operator=(T&& t) { SwigSmartPointer tmp(new T(std::move(t))); pointer = tmp; return *this; } |
| 186 | + operator T&&() const { return std::move(*pointer.ptr); } |
| 187 | +#else |
| 188 | + operator T&() const { return *pointer.ptr; } |
| 189 | +#endif |
| 190 | + T *operator&() const { return pointer.ptr; } |
| 191 | + static void reset(SwigValueWrapper& t, T *p) { t.pointer.reset(p); } |
| 192 | +}; |
| 193 | + |
| 194 | +/* |
| 195 | + * SwigValueInit() is a generic initialisation solution as the following approach: |
| 196 | + * |
| 197 | + * T c_result = T(); |
| 198 | + * |
| 199 | + * doesn't compile for all types for example: |
| 200 | + * |
| 201 | + * unsigned int c_result = unsigned int(); |
| 202 | + */ |
| 203 | +template <typename T> T SwigValueInit() { |
| 204 | + return T(); |
| 205 | +} |
| 206 | + |
| 207 | +#if __cplusplus >=201103L |
| 208 | +# define SWIG_STD_MOVE(OBJ) std::move(OBJ) |
| 209 | +#else |
| 210 | +# define SWIG_STD_MOVE(OBJ) OBJ |
| 211 | +#endif |
| 212 | + |
| 213 | +#endif |
| 214 | + |
| 215 | + |
| 216 | +#include "native.h" |
| 217 | + |
| 218 | +EMSCRIPTEN_BINDINGS(Native) { |
| 219 | + emscripten::class_<Native>("Native") |
| 220 | + .smart_ptr<std::shared_ptr<Native>>("Native") |
| 221 | + .class_function("sample", &Native::sample) |
| 222 | + .smart_ptr_constructor("Native", &std::make_shared<Native>) |
| 223 | + ; |
| 224 | +} |
| 225 | + |
| 226 | +EMSCRIPTEN_BINDINGS(Functions_NATIVE) { |
| 227 | + emscripten::register_vector<std::shared_ptr<Native>>("VectorNative"); |
| 228 | +} |
0 commit comments