Skip to content
Merged
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
12 changes: 6 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,8 @@ project(reminecraftpe)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}")

if (WIN32 OR LINUX)
set(CMAKE_CXX_STANDARD 11)
else()
set(CMAKE_CXX_STANDARD 98)
endif()
set(CXX_EXTENSIONS OFF)
set(CMAKE_C_STANDARD 99)
set(CMAKE_CXX_EXTENSIONS OFF)

# Warnings
add_compile_options(-Wall)
Expand Down Expand Up @@ -47,6 +43,10 @@ if(REMCPE_WIN32)
-static-libgcc
-static-libstdc++
)
# Modern MinGW doesn't support C++98 and will error if you try to use it
set(CMAKE_CXX_STANDARD 11)
else()
set(CMAKE_CXX_STANDARD 98)
endif()

# HaikuOS Network Library
Expand Down
6 changes: 6 additions & 0 deletions compat/vsnprintf.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#include <stdio.h>

int remcpe_vsnprintf(char *buf, size_t size, const char *format, va_list ap)
{
return vsnprintf(buf, size, format, ap);
}
10 changes: 10 additions & 0 deletions compat/vsnprintf.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#pragma once

#include <stdio.h>
#ifndef vsnprintf
#include <stdarg.h>
extern "C" {
extern int remcpe_vsnprintf(char *, size_t, const char *, va_list ap);
}
#define vsnprintf remcpe_vsnprintf
#endif
Original file line number Diff line number Diff line change
Expand Up @@ -1292,6 +1292,8 @@
84FFBF002ACA3416005A8CCF /* VariadicSQLParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 840DD83F2AC810630006A435 /* VariadicSQLParser.cpp */; };
84FFBF012ACA3416005A8CCF /* VitaIncludes.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 840DD8412AC810630006A435 /* VitaIncludes.cpp */; };
84FFBF022ACA3416005A8CCF /* WSAStartupSingleton.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 840DD8442AC810630006A435 /* WSAStartupSingleton.cpp */; };
9D36D2F72F0B3C160031ADFD /* vsnprintf.c in Sources */ = {isa = PBXBuildFile; fileRef = 9D36D2F62F0B3C160031ADFD /* vsnprintf.c */; };
9D36D2F92F0B3C1F0031ADFD /* vsnprintf.h in Headers */ = {isa = PBXBuildFile; fileRef = 9D36D2F82F0B3C1F0031ADFD /* vsnprintf.h */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
Expand Down Expand Up @@ -2764,6 +2766,8 @@
84F77A6C2EA1C27B0045C907 /* LocalPlayer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LocalPlayer.cpp; sourceTree = "<group>"; };
84F77A6D2EA1C27B0045C907 /* LocalPlayer.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = LocalPlayer.hpp; sourceTree = "<group>"; };
84FFBD7E2ACA2876005A8CCF /* libRakNet.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libRakNet.a; sourceTree = BUILT_PRODUCTS_DIR; };
9D36D2F62F0B3C160031ADFD /* vsnprintf.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = vsnprintf.c; sourceTree = "<group>"; };
9D36D2F82F0B3C1F0031ADFD /* vsnprintf.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = vsnprintf.h; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand Down Expand Up @@ -2896,6 +2900,8 @@
84C0D8022B15A1D0007E1E76 /* PlatformDefinitions.h */,
840DD57A2AC810620006A435 /* SDLKeyCodes.h */,
8466BD092E774DCD00DDDFC4 /* EndianDefinitions.h */,
9D36D2F62F0B3C160031ADFD /* vsnprintf.c */,
9D36D2F82F0B3C1F0031ADFD /* vsnprintf.h */,
);
name = compat;
path = ../../../../compat;
Expand Down Expand Up @@ -5401,6 +5407,7 @@
8406FD392AF1823700B09C1D /* Timer.hpp in Headers */,
84EB0E132EE2D4D4008FB007 /* Singleton.hpp in Headers */,
84CCBC402E6183F300E251AF /* DataIO.hpp in Headers */,
9D36D2F92F0B3C1F0031ADFD /* vsnprintf.h in Headers */,
8406FD3A2AF1823700B09C1D /* Util.hpp in Headers */,
8406FD3B2AF1823700B09C1D /* Utils.hpp in Headers */,
84E001B92AF3A3CB009B9555 /* SmoothFloat.hpp in Headers */,
Expand Down Expand Up @@ -6441,6 +6448,7 @@
files = (
84EB0E122EE2D4D4008FB007 /* Singleton.cpp in Sources */,
84E4BFB52AE9869A0023E16A /* CThread.cpp in Sources */,
9D36D2F72F0B3C160031ADFD /* vsnprintf.c in Sources */,
84CCBC3F2E6183F300E251AF /* DataIO.cpp in Sources */,
84EB0E102EE2D4D4008FB007 /* JsonParser.cpp in Sources */,
84E4BFB62AE9869A0023E16A /* Logger.cpp in Sources */,
Expand Down
4 changes: 3 additions & 1 deletion platforms/windows/projects/Common/Common.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
</ClCompile>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="$(MC_ROOT)\compat\vsnprintf.c" />
<ClCompile Include="$(MC_ROOT)\source\common\CThread.cpp" />
<ClCompile Include="$(MC_ROOT)\source\common\Logger.cpp" />
<ClCompile Include="$(MC_ROOT)\source\common\Mth.cpp" />
Expand All @@ -97,6 +98,7 @@
<ClInclude Include="$(MC_ROOT)\source\common\Utils.hpp" />
<ClInclude Include="$(MC_ROOT)\source\common\SmoothFloat.hpp" />
<ClInclude Include="$(MC_ROOT)\source\common\DataIO.hpp" />
<ClInclude Include="$(MC_ROOT)\compat\vsnprintf.h" />
<ClInclude Include="$(MC_ROOT)\compat\LegacyCPP.hpp" />
<ClInclude Include="$(MC_ROOT)\compat\LegacyCPP_Compat.hpp" />
<ClInclude Include="$(MC_ROOT)\compat\LegacyCPP_Info.hpp" />
Expand All @@ -109,4 +111,4 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
</Project>
8 changes: 7 additions & 1 deletion platforms/windows/projects/Common/Common.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="$(MC_ROOT)\compat\vsnprintf.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="$(MC_ROOT)\source\common\CThread.cpp">
<Filter>Source Files</Filter>
</ClCompile>
Expand Down Expand Up @@ -91,6 +94,9 @@
<ClInclude Include="$(MC_ROOT)\source\common\DataIO.hpp">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="$(MC_ROOT)\compat\vsnprintf.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="$(MC_ROOT)\compat\LegacyCPP.hpp">
<Filter>Header Files</Filter>
</ClInclude>
Expand All @@ -116,4 +122,4 @@
<Filter>Header Files\Utility</Filter>
</ClInclude>
</ItemGroup>
</Project>
</Project>
1 change: 1 addition & 0 deletions source/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ project(reminecraftpe-core)

# Build
add_library(reminecraftpe-core STATIC
../compat/vsnprintf.c
common/CThread.cpp
common/DataIO.cpp
common/Logger.cpp
Expand Down
1 change: 1 addition & 0 deletions source/common/Util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
********************************************************************/

#include "Util.hpp"
#include "compat/vsnprintf.h"

const std::string Util::EMPTY_STRING = "";

Expand Down