diff options
author | Philipp Janda <siffiejoe@gmx.net> | 2015-09-07 17:28:28 +0200 |
---|---|---|
committer | Philipp Janda <siffiejoe@gmx.net> | 2015-09-07 17:28:28 +0200 |
commit | 59a1fd7d73909540f090a45f18d7ea12198511b2 (patch) | |
tree | 204c2de58bcd5b494db6f6cd5f09e9edcdf338fd /c-api/compat-5.3.h | |
parent | e7b17a6e784df665b7645ae6f8cfd631f49118d2 (diff) | |
download | lua-compat-5.3-59a1fd7d73909540f090a45f18d7ea12198511b2.tar.gz lua-compat-5.3-59a1fd7d73909540f090a45f18d7ea12198511b2.tar.bz2 lua-compat-5.3-59a1fd7d73909540f090a45f18d7ea12198511b2.zip |
Fix linker problems when compiling as C++.
When compiling compat-5.3.c as C++, the Lua symbols may still have
C-linkage. Reference those symbols as `extern "C"` by default and add an
option for normal (C++) linkage.
Diffstat (limited to 'c-api/compat-5.3.h')
-rw-r--r-- | c-api/compat-5.3.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/c-api/compat-5.3.h b/c-api/compat-5.3.h index e3bbb11..3f1cacc 100644 --- a/c-api/compat-5.3.h +++ b/c-api/compat-5.3.h | |||
@@ -4,8 +4,14 @@ | |||
4 | #include <stddef.h> | 4 | #include <stddef.h> |
5 | #include <limits.h> | 5 | #include <limits.h> |
6 | #include <string.h> | 6 | #include <string.h> |
7 | #if defined( __cplusplus ) && !defined( COMPAT53_LUA_CPP ) | ||
8 | extern "C" { | ||
9 | #endif | ||
7 | #include <lua.h> | 10 | #include <lua.h> |
8 | #include <lauxlib.h> | 11 | #include <lauxlib.h> |
12 | #if defined( __cplusplus ) && !defined( COMPAT53_LUA_CPP ) | ||
13 | } | ||
14 | #endif | ||
9 | 15 | ||
10 | 16 | ||
11 | #if defined(COMPAT53_PREFIX) | 17 | #if defined(COMPAT53_PREFIX) |