Skip to content

Commit

Permalink
Merge pull request #161 from zrax/vc2013_compat
Browse files Browse the repository at this point in the history
Restore compatibility with MSVC 2013.
  • Loading branch information
zrax authored Oct 20, 2019
2 parents f6619b7 + d92c628 commit c143371
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 11 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ endif()

if(MSVC)
add_definitions("-D_CRT_SECURE_NO_WARNINGS")
set(CMAKE_CXX_FLAGS "/wd4996 /wd4244 /wd4251 ${CMAKE_CXX_FLAGS}")
set(CMAKE_C_FLAGS "/wd4996 /wd4244 /wd4251 ${CMAKE_C_FLAGS}")
set(CMAKE_CXX_FLAGS "/wd4996 /wd4244 /wd4251 /wd4351 ${CMAKE_CXX_FLAGS}")
set(CMAKE_C_FLAGS "/wd4996 /wd4244 /wd4251 /wd4351 ${CMAKE_C_FLAGS}")
endif()

# Turn everything on by default
Expand Down
8 changes: 4 additions & 4 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ environment:
PREFIX_VERSION: 20180708

matrix:
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
VisualStudioVersion: 14.0
CMAKE_GENERATOR: Visual Studio 14 2015
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013
VisualStudioVersion: 12.0
CMAKE_GENERATOR: Visual Studio 12 2013
PYTHON_PREFIX: C:\Python27
CMAKE_PARAMS: -DPYTHON_INCLUDE_DIR=C:/Python27/include
-DPYTHON_LIBRARY=C:/Python27/libs/python27.lib
-DPYTHON_EXECUTABLE=C:/Python27/python.exe
PREFIX_TARGET: vc2015-x86-static
PREFIX_TARGET: vc2013-x86-static
DIST_SUFFIX: '%PREFIX_TARGET%-py27'

- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
Expand Down
4 changes: 2 additions & 2 deletions core/PRP/KeyedObject/plKey.h
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ class PLASMA_DLL plKey HS_FINAL
plKey(const plKey& init);

/** Move constructor */
plKey(plKey&& move) noexcept : fKeyData(move.fKeyData)
plKey(plKey&& move) HS_NOEXCEPT : fKeyData(move.fKeyData)
{
move.fKeyData = nullptr;
}
Expand Down Expand Up @@ -307,7 +307,7 @@ class PLASMA_DLL plKey HS_FINAL
plKey& operator=(const plKey& other);

/** Moves the key ref into this key */
plKey& operator=(plKey&& other) noexcept
plKey& operator=(plKey&& other) HS_NOEXCEPT
{
fKeyData = other.fKeyData;
other.fKeyData = nullptr;
Expand Down
2 changes: 1 addition & 1 deletion core/PRP/Surface/plFont.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class PLASMA_DLL plFont : public hsKeyedObject
float fLeftKern, fRightKern;

public:
plCharacter() noexcept
plCharacter() HS_NOEXCEPT
: fBitmapOffset(), fHeight(), fBaseline(),
fLeftKern(), fRightKern() { }

Expand Down
10 changes: 8 additions & 2 deletions core/PlasmaDefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,13 @@
#define HS_OVERRIDE override
#define HS_FINAL final
#define HS_FINAL_OVERRIDE override final // Prefer both to satisfy -Wsuggest-override
#define HS_NOEXCEPT noexcept
#if defined(_MSC_VER) && (_MSC_VER < 1900)
# define HS_NOEXCEPT throw()
# define HS_CONSTEXPR const
#else
# define HS_NOEXCEPT noexcept
# define HS_CONSTEXPR constexpr
#endif

enum CallbackEvent
{
Expand Down Expand Up @@ -85,7 +91,7 @@ enum ControlEventCode
};

template <typename T, size_t Size>
constexpr size_t hsArraySize(T (&)[Size])
HS_CONSTEXPR size_t hsArraySize(T(&)[Size])
{
return Size;
}
Expand Down

0 comments on commit c143371

Please sign in to comment.