Skip to content

Commit

Permalink
Windows build fix!
Browse files Browse the repository at this point in the history
  • Loading branch information
aassif committed Jun 12, 2019
1 parent 3abf48d commit 7c53002
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ include_directories(${kodiplatform_INCLUDE_DIRS}

set(DEPLIBS ${p8-platform_LIBRARIES} ${OPENSSL_LIBRARIES} ${ZLIB_LIBRARIES})

if(WIN32)
list(APPEND DEPLIBS ws2_32)
endif()

set(FREEBOX_SOURCES src/client.cpp
src/Freebox.cpp)

Expand Down
8 changes: 6 additions & 2 deletions src/Freebox.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -272,8 +272,12 @@ bool Freebox::StartSession ()
string file = m_path + "app_token.txt";
if (! XBMC->FileExists (file.c_str (), false))
{
#ifndef HOST_NAME_MAX
#define HOST_NAME_MAX _POSIX_HOST_NAME_MAX
#ifdef _WIN32
#define HOST_NAME_MAX 256
#else
#ifdef __APPLE__
#define HOST_NAME_MAX _POSIX_HOST_NAME_MAX
#endif
#endif
char hostname [HOST_NAME_MAX + 1];
gethostname (hostname, HOST_NAME_MAX);
Expand Down

2 comments on commit 7c53002

@ksooo
Copy link
Collaborator

@ksooo ksooo commented on 7c53002 Jun 12, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would not work with platform names. Why not just ifndef?

@aassif
Copy link
Owner Author

@aassif aassif commented on 7c53002 Jun 12, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.