From b89608c6240b8e271e4f62a865449c947105a327 Mon Sep 17 00:00:00 2001 From: Jude Melton-Houghton Date: Tue, 16 Aug 2022 11:27:11 -0400 Subject: [PATCH] Compile bitop library as C++ --- lib/bitop/CMakeLists.txt | 2 +- lib/bitop/{bit.c => bit.cpp} | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) rename lib/bitop/{bit.c => bit.cpp} (99%) diff --git a/lib/bitop/CMakeLists.txt b/lib/bitop/CMakeLists.txt index 02e8a421d..80b627446 100644 --- a/lib/bitop/CMakeLists.txt +++ b/lib/bitop/CMakeLists.txt @@ -1,4 +1,4 @@ -add_library(bitop STATIC bit.c) +add_library(bitop STATIC bit.cpp) target_link_libraries(bitop) include_directories(${LUA_INCLUDE_DIR}) diff --git a/lib/bitop/bit.c b/lib/bitop/bit.cpp similarity index 99% rename from lib/bitop/bit.c rename to lib/bitop/bit.cpp index f23c31a4c..39b53838f 100644 --- a/lib/bitop/bit.c +++ b/lib/bitop/bit.cpp @@ -26,12 +26,16 @@ ** [ MIT license: http://www.opensource.org/licenses/mit-license.php ] */ +extern "C" { #include "bit.h" +} #define LUA_BITOP_VERSION "1.0.2" #define LUA_LIB +extern "C" { #include "lauxlib.h" +} #ifdef _MSC_VER /* MSVC is stuck in the last century and doesn't have C99's stdint.h. */