Skip to content

Commit

Permalink
- change UNASSIGNED_SYSTEM_ADDRESS and UNASSIGNED_RAKNET_GUID to be d…
Browse files Browse the repository at this point in the history
…eclared external so to remove the need for including/dependent compile units to also include types.h (which is quite a burden due to the windows.h inclusion, f.e.) - facebookarchive#130

- add required OpenSSL dependency to CMake (#222)
  • Loading branch information
Luke1410 committed Sep 3, 2019
1 parent 843e626 commit 21d775d
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 4 deletions.
8 changes: 6 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,14 @@ IF (WIN32 AND NOT UNIX)
string(REPLACE "\\" "/" PROGRAMFILESX86 "${PROGRAMFILESX86}")
ENDIF(WIN32 AND NOT UNIX)

# add package dependencies
find_package(OpenSSL 1.0.0 REQUIRED)
set(SLIKENET_LIBRARY_LIBS OpenSSL::Crypto OpenSSL::SSL)

IF (WIN32 AND NOT UNIX)
set(SLIKENET_LIBRARY_LIBS ws2_32.lib)
set(SLIKENET_LIBRARY_LIBS ${SLIKENET_LIBRARY_LIBS} ws2_32.lib)
ELSE(WIN32 AND NOT UNIX)
set(SLIKENET_LIBRARY_LIBS pthread)
set(SLIKENET_LIBRARY_LIBS ${SLIKENET_LIBRARY_LIBS} pthread)
ENDIF(WIN32 AND NOT UNIX)

# enable C++11 language support for GCC
Expand Down
4 changes: 2 additions & 2 deletions Source/include/slikenet/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -338,8 +338,8 @@ struct RAK_DLL_EXPORT RakNetGUID
// 0xFFFFFFFF, 0xFFFF
//};
#ifndef SWIG
const SystemAddress UNASSIGNED_SYSTEM_ADDRESS;
const RakNetGUID UNASSIGNED_RAKNET_GUID((uint64_t)-1);
extern const SystemAddress UNASSIGNED_SYSTEM_ADDRESS;
extern const RakNetGUID UNASSIGNED_RAKNET_GUID;
#endif
//{
// {0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF}
Expand Down
9 changes: 9 additions & 0 deletions Source/src/RakNetTypes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -779,3 +779,12 @@ unsigned long RakNetGUID::ToUint32( const RakNetGUID &g )
{
return ((unsigned long) (g.g >> 32)) ^ ((unsigned long) (g.g & 0xFFFFFFFF));
}

namespace SLNet
{
// initialization list
#ifndef SWIG
const SystemAddress UNASSIGNED_SYSTEM_ADDRESS;
const RakNetGUID UNASSIGNED_RAKNET_GUID((uint64_t)-1);
#endif
}

0 comments on commit 21d775d

Please sign in to comment.