Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added support for Visual Studio 2013 #139

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ include_directories(deps/noise)
include_directories(deps/sqlite)
include_directories(deps/tinycthread)

if(MINGW)
if(MINGW OR MSVC)
set(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH}
"C:/Program Files/CURL/lib" "C:/Program Files (x86)/CURL/lib")
set(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH}
Expand All @@ -43,7 +43,7 @@ if(UNIX)
${GLFW_LIBRARIES} ${CURL_LIBRARIES})
endif()

if(MINGW)
if(MINGW OR MSVC)
target_link_libraries(craft ws2_32.lib glfw
${GLFW_LIBRARIES} ${CURL_LIBRARIES})
endif()
4 changes: 4 additions & 0 deletions src/auth.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
#ifndef _auth_h_
#define _auth_h_

#ifdef _MSC_VER
#define snprintf _snprintf
#endif

int get_access_token(
char *result, int length, char *username, char *identity_token);

Expand Down
4 changes: 4 additions & 0 deletions src/client.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
#ifndef _client_h_
#define _client_h_

#ifdef _MSC_VER
#define snprintf _snprintf
#endif

Choose a reason for hiding this comment

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

Do we want to define this in the headers, or in the C files?

Copy link
Author

Choose a reason for hiding this comment

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

Either one. I chose the header files because it makes for fewer overall edits. auth.c, client.c, and main.c all use this function.


#define DEFAULT_PORT 4080

void client_enable();
Expand Down