Skip to content

Commit c77bf91

Browse files
committed
cleanup: Drop compat bits for not-quite-C++14 compilers
1 parent 5bcb734 commit c77bf91

File tree

7 files changed

+7
-86
lines changed

7 files changed

+7
-86
lines changed

BUILD.bazel

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,6 @@ cc_binary(
5252
":lib/src/jvmMain/cpp/jni.h",
5353
":lib/src/jvmMain/cpp/jni_md.h",
5454
],
55-
copts = [
56-
"-DHAVE_TO_STRING",
57-
],
5855
includes = [
5956
"lib/src/jvmMain/cpp",
6057
"lib/src/jvmMain/proto",

lib/src/jvmMain/cpp/CMakeLists.txt

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -17,48 +17,6 @@ find_package(JNI)
1717

1818
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17")
1919

20-
#
21-
# C++ standard library features
22-
#
23-
24-
include(CheckCXXSourceCompiles)
25-
26-
# ::gets
27-
check_cxx_source_compiles(
28-
"
29-
#include <cstdio>
30-
using ::gets;
31-
int main() {}
32-
"
33-
HAVE_GETS)
34-
if(HAVE_GETS)
35-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DHAVE_GETS=1")
36-
endif()
37-
38-
# std::make_unique
39-
check_cxx_source_compiles(
40-
"
41-
#include <memory>
42-
using std::make_unique;
43-
int main() {}
44-
"
45-
HAVE_MAKE_UNIQUE)
46-
if(HAVE_MAKE_UNIQUE)
47-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DHAVE_MAKE_UNIQUE=1")
48-
endif()
49-
50-
# std::to_string
51-
check_cxx_source_compiles(
52-
"
53-
#include <string>
54-
using std::to_string;
55-
int main() {}
56-
"
57-
HAVE_TO_STRING)
58-
if(HAVE_TO_STRING)
59-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DHAVE_TO_STRING=1")
60-
endif()
61-
6220
#
6321
# Build
6422
#
@@ -101,7 +59,6 @@ add_library(
10159
ToxCrypto/ToxCrypto.cpp
10260
ToxCrypto/ToxCrypto.h
10361
Tox4j.cpp
104-
cpp14compat.h
10562
tox4j/ToxInstances.h
10663
tox4j/Tox4j.h
10764
tox/av.cpp

lib/src/jvmMain/cpp/ToxAv/lifecycle.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#include <memory>
2+
13
#include "ToxAv.h"
24
#include "../ToxCore/ToxCore.h"
35

@@ -122,7 +124,7 @@ TOX_METHOD (jint, New,
122124
tox4j_assert (toxav != nullptr);
123125

124126
// Create the master events object and set up our callbacks.
125-
auto events = tox::callbacks<ToxAV> (make_unique<Events> ())
127+
auto events = tox::callbacks<ToxAV> (std::make_unique<Events> ())
126128
#define CALLBACK(NAME) .set<tox::callback_##NAME, tox4j_##NAME##_cb> ()
127129
#include "tox/generated/av.h"
128130
#undef CALLBACK

lib/src/jvmMain/cpp/ToxCore/lifecycle.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#include <memory>
2+
13
#include "ToxCore.h"
24

35
using namespace core;
@@ -269,7 +271,7 @@ TOX_METHOD (jint, New,
269271
tox4j_assert (tox != nullptr);
270272

271273
// Create the master events object and set up our callbacks.
272-
auto events = tox::callbacks<Tox> (make_unique<Events> ())
274+
auto events = tox::callbacks<Tox> (std::make_unique<Events> ())
273275
#define CALLBACK(NAME) .set<tox::callback_##NAME, tox4j_##NAME##_cb> ()
274276
#include "tox/generated/core.h"
275277
#undef CALLBACK

lib/src/jvmMain/cpp/cpp14compat.h

Lines changed: 0 additions & 34 deletions
This file was deleted.

lib/src/jvmMain/cpp/tox4j/Tox4j.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
#pragma once
22

3-
#include "cpp14compat.h"
4-
53
#include "ToxInstances.h"
64
#include "util/jni/ArrayFromJava.h"
75
#include "util/jni/ArrayToJava.h"

lib/src/jvmMain/cpp/util/wrap_void.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
#pragma once
22

3+
#include <type_traits>
34
#include <utility>
45

5-
#include "cpp14compat.h"
6-
76
/**
87
* Helper template to capture the return value of a function call so that
98
* functions returning void can be treated the same way as non-void ones.

0 commit comments

Comments
 (0)