WOrk on fixing windows

This commit is contained in:
Ryan Pavlik
2010-07-27 17:07:19 -05:00
parent dde5bb965a
commit bf4b9e9d10
4 changed files with 272 additions and 13 deletions

View File

@@ -19,18 +19,24 @@ set(SOURCES
os.h
wiiuse_internal.h
wiiboard.h)
set(API
wiiuse.h)
if(WIN32)
list(APPEND SOURCES io_win.c)
list(APPEND API ../msvc-stdint/stdint.h)
else()
list(APPEND SOURCES io_nix.c)
endif()
set(API
wiiuse.h)
add_library(wiiuse SHARED ${SOURCES} ${API})
target_link_libraries(wiiuse m bluetooth)
if(WIN32)
target_link_libraries(Ws2_32.lib hid.lib
else()
target_link_libraries(wiiuse m bluetooth)
endif()
set_property(TARGET
wiiuse

View File

@@ -50,16 +50,16 @@
/* Information output macros */
#define WIIUSE_INFO(fmt, ...) fprintf(stderr, "[INFO] " fmt "\n", ##__VA_ARGS__)
#ifdef WITH_WIIUSE_DEBUG
#ifdef WIN32
#define WIIUSE_DEBUG(fmt, ...) do { \
char* file = __FILE__; \
int i = strlen(file) - 1; \
for (; i && (file[i] != '\\'); --i); \
fprintf(stderr, "[DEBUG] %s:%i: " fmt "\n", file+i+1, __LINE__, ##__VA_ARGS__); \
} while (0)
#ifdef WITH_WIIUSE_DEBUG
#ifdef WIN32
#define WIIUSE_DEBUG(fmt, ...) do { \
char* file = __FILE__; \
int i = strlen(file) - 1; \
for (; i && (file[i] != '\\'); --i); \
fprintf(stderr, "[DEBUG] %s:%i: " fmt "\n", file+i+1, __LINE__, ##__VA_ARGS__); \
} while (0)
#else
#define WIIUSE_DEBUG(fmt, ...) fprintf(stderr, "[DEBUG] " __FILE__ ":%i: " fmt "\n", __LINE__, ##__VA_ARGS__)
#define WIIUSE_DEBUG(fmt, ...) fprintf(stderr, "[DEBUG] " __FILE__ ":%i: " fmt "\n", __LINE__, ##__VA_ARGS__)
#endif
#else
#define WIIUSE_DEBUG(fmt, ...)