Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to using bitset2. #549

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,6 @@
[submodule "lib/cpp-httplib"]
path = lib/cpp-httplib
url = [email protected]:ksenonadv/cpp-httplib.git
[submodule "SDK/lib/bitset2"]
path = SDK/lib/bitset2
url = https://github.com/openmultiplayer/bitset2.git
1 change: 1 addition & 0 deletions SDK/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ if(CMAKE_SYSTEM_PROCESSOR MATCHES "(x86)|(X86)|(amd64)|(AMD64)")
endif()

target_include_directories(OMP-SDK INTERFACE include/)
target_include_directories(OMP-SDK INTERFACE lib/)

file(GLOB_RECURSE omp_sdk_source_list "*.hpp")

Expand Down
11 changes: 7 additions & 4 deletions SDK/include/types.hpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
#pragma once

#include <array>
#include <bitset>
#if !defined OMP_NO_EXCEPTIONS
#include <stdexcept>
#include <bitset2/bitset2.hpp>
#endif
#include <chrono>
#include <cstdint>
#include <glm/vec2.hpp>
Expand Down Expand Up @@ -68,12 +71,12 @@ using std::chrono::duration_cast;
/// Don't pass these around the SDK
namespace Impl
{

using String = std::string;

#if !defined OMP_NO_EXCEPTIONS
template <size_t Size>
using StaticBitset = std::bitset<Size>;

using StaticBitset = Bitset2::bitset2<Size, unsigned long long>;
#endif
}

template <typename T>
Expand Down
1 change: 1 addition & 0 deletions SDK/lib/bitset2
Submodule bitset2 added at d61e4b
5 changes: 5 additions & 0 deletions Server/Components/Unicode/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ add_server_component(${ProjectId})
if (STATIC_STDCXX)
# Remove any possible symbols from ICU, lower GLIBCXX version to 3.4.11
target_compile_options(${ProjectId} PRIVATE -fno-exceptions -fno-rtti)

target_compile_definitions(${ProjectId} PRIVATE
OMP_NO_EXCEPTIONS=1
OMP_NO_RTTI=1
)
endif()

target_link_libraries(${ProjectId} PRIVATE
Expand Down