improved platform definitions and definition checks
This commit is contained in:
@@ -105,7 +105,7 @@ int classic_ctrl_handshake(struct wiimote_t* wm, struct classic_ctrl_t* cc, byte
|
|||||||
/* handshake done */
|
/* handshake done */
|
||||||
wm->exp.type = EXP_CLASSIC;
|
wm->exp.type = EXP_CLASSIC;
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIIUSE_WIN32
|
||||||
wm->timeout = WIIMOTE_DEFAULT_TIMEOUT;
|
wm->timeout = WIIMOTE_DEFAULT_TIMEOUT;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ extern FILE* logtarget[];
|
|||||||
#define WIIUSE_INFO(fmt, ...) do { if (OUTF_INFO) fprintf(OUTF_INFO, "[INFO] " fmt "\n", ##__VA_ARGS__); } while(0)
|
#define WIIUSE_INFO(fmt, ...) do { if (OUTF_INFO) fprintf(OUTF_INFO, "[INFO] " fmt "\n", ##__VA_ARGS__); } while(0)
|
||||||
|
|
||||||
#ifdef WITH_WIIUSE_DEBUG
|
#ifdef WITH_WIIUSE_DEBUG
|
||||||
#ifdef WIN32
|
#ifdef WIIUSE_WIN32
|
||||||
#define WIIUSE_DEBUG(fmt, ...) do { \
|
#define WIIUSE_DEBUG(fmt, ...) do { \
|
||||||
if (OUTF_DEBUG) { \
|
if (OUTF_DEBUG) { \
|
||||||
char* file = __FILE__; \
|
char* file = __FILE__; \
|
||||||
|
|||||||
@@ -40,10 +40,7 @@
|
|||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
#include <float.h>
|
||||||
#ifdef WIN32
|
|
||||||
#include <float.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -44,7 +44,7 @@
|
|||||||
#include "guitar_hero_3.h"
|
#include "guitar_hero_3.h"
|
||||||
#include "wiiboard.h"
|
#include "wiiboard.h"
|
||||||
|
|
||||||
#ifndef WIN32
|
#ifndef WIIUSE_WIN32
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
@@ -79,7 +79,7 @@ static int state_changed(struct wiimote_t* wm);
|
|||||||
int wiiuse_poll(struct wiimote_t** wm, int wiimotes) {
|
int wiiuse_poll(struct wiimote_t** wm, int wiimotes) {
|
||||||
int evnt = 0;
|
int evnt = 0;
|
||||||
|
|
||||||
#ifndef WIN32
|
#ifdef WIIUSE_BLUEZ
|
||||||
/*
|
/*
|
||||||
* *nix
|
* *nix
|
||||||
*/
|
*/
|
||||||
@@ -566,7 +566,7 @@ static void event_status(struct wiimote_t* wm, byte* msg) {
|
|||||||
exp_changed = 1;
|
exp_changed = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIIUSE_WIN32
|
||||||
if (!attachment) {
|
if (!attachment) {
|
||||||
WIIUSE_DEBUG("Setting timeout to normal %i ms.", wm->normal_timeout);
|
WIIUSE_DEBUG("Setting timeout to normal %i ms.", wm->normal_timeout);
|
||||||
wm->timeout = wm->normal_timeout;
|
wm->timeout = wm->normal_timeout;
|
||||||
@@ -640,7 +640,7 @@ void handshake_expansion(struct wiimote_t* wm, byte* data, uint16_t len) {
|
|||||||
disable_expansion(wm);
|
disable_expansion(wm);
|
||||||
|
|
||||||
/* increase the timeout until the handshake completes */
|
/* increase the timeout until the handshake completes */
|
||||||
#ifdef WIN32
|
#ifdef WIIUSE_WIN32
|
||||||
WIIUSE_DEBUG("Setting timeout to expansion %i ms.", wm->exp_timeout);
|
WIIUSE_DEBUG("Setting timeout to expansion %i ms.", wm->exp_timeout);
|
||||||
wm->timeout = wm->exp_timeout;
|
wm->timeout = wm->exp_timeout;
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -103,7 +103,7 @@ int guitar_hero_3_handshake(struct wiimote_t* wm, struct guitar_hero_3_t* gh3, b
|
|||||||
/* handshake done */
|
/* handshake done */
|
||||||
wm->exp.type = EXP_GUITAR_HERO_3;
|
wm->exp.type = EXP_GUITAR_HERO_3;
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIIUSE_WIN32
|
||||||
wm->timeout = WIIMOTE_DEFAULT_TIMEOUT;
|
wm->timeout = WIIMOTE_DEFAULT_TIMEOUT;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
2
src/io.h
2
src/io.h
@@ -34,7 +34,7 @@
|
|||||||
#ifndef CONNECT_H_INCLUDED
|
#ifndef CONNECT_H_INCLUDED
|
||||||
#define CONNECT_H_INCLUDED
|
#define CONNECT_H_INCLUDED
|
||||||
|
|
||||||
#ifndef WIN32
|
#ifdef WIIUSE_BLUEZ
|
||||||
#include <bluetooth/bluetooth.h>
|
#include <bluetooth/bluetooth.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -31,10 +31,10 @@
|
|||||||
* @brief Handles device I/O for *nix.
|
* @brief Handles device I/O for *nix.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef WIN32
|
|
||||||
|
|
||||||
#include "io.h"
|
#include "io.h"
|
||||||
|
|
||||||
|
#ifdef WIIUSE_BLUEZ
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
@@ -265,4 +265,4 @@ int wiiuse_io_write(struct wiimote_t* wm, byte* buf, int len) {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif /* ifndef WIN32 */
|
#endif /* ifdef WIIUSE_BLUEZ */
|
||||||
|
|||||||
@@ -31,10 +31,10 @@
|
|||||||
* @brief Handles device I/O for Windows.
|
* @brief Handles device I/O for Windows.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef WIN32
|
|
||||||
|
|
||||||
#include "io.h"
|
#include "io.h"
|
||||||
|
|
||||||
|
#ifdef WIIUSE_WIN32
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#include <hidsdi.h>
|
#include <hidsdi.h>
|
||||||
@@ -241,4 +241,4 @@ int wiiuse_io_write(struct wiimote_t* wm, byte* buf, int len) {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* ifdef WIN32 */
|
#endif /* ifdef WIIUSE_WIN32 */
|
||||||
|
|||||||
14
src/ir.c
14
src/ir.c
@@ -35,7 +35,7 @@
|
|||||||
|
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
#ifndef WIN32
|
#ifndef WIIUSE_WIN32
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -115,10 +115,10 @@ void wiiuse_set_ir(struct wiimote_t* wm, int status) {
|
|||||||
wiiuse_write_data(wm, WM_REG_IR, &buf, 1);
|
wiiuse_write_data(wm, WM_REG_IR, &buf, 1);
|
||||||
|
|
||||||
/* wait for the wiimote to catch up */
|
/* wait for the wiimote to catch up */
|
||||||
#ifndef WIN32
|
#ifdef WIIUSE_WIN32
|
||||||
usleep(50000);
|
|
||||||
#else
|
|
||||||
Sleep(50);
|
Sleep(50);
|
||||||
|
#else
|
||||||
|
usleep(50000);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* write sensitivity blocks */
|
/* write sensitivity blocks */
|
||||||
@@ -132,10 +132,10 @@ void wiiuse_set_ir(struct wiimote_t* wm, int status) {
|
|||||||
buf = WM_IR_TYPE_EXTENDED;
|
buf = WM_IR_TYPE_EXTENDED;
|
||||||
wiiuse_write_data(wm, WM_REG_IR_MODENUM, &buf, 1);
|
wiiuse_write_data(wm, WM_REG_IR_MODENUM, &buf, 1);
|
||||||
|
|
||||||
#ifndef WIN32
|
#ifdef WIIUSE_WIN32
|
||||||
usleep(50000);
|
|
||||||
#else
|
|
||||||
Sleep(50);
|
Sleep(50);
|
||||||
|
#else
|
||||||
|
usleep(50000);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* set the wiimote report type */
|
/* set the wiimote report type */
|
||||||
|
|||||||
@@ -110,7 +110,7 @@ int nunchuk_handshake(struct wiimote_t* wm, struct nunchuk_t* nc, byte* data, un
|
|||||||
/* handshake done */
|
/* handshake done */
|
||||||
wm->exp.type = EXP_NUNCHUK;
|
wm->exp.type = EXP_NUNCHUK;
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIIUSE_WIN32
|
||||||
wm->timeout = WIIMOTE_DEFAULT_TIMEOUT;
|
wm->timeout = WIIMOTE_DEFAULT_TIMEOUT;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
8
src/os.h
8
src/os.h
@@ -39,18 +39,14 @@
|
|||||||
#ifndef OS_H_INCLUDED
|
#ifndef OS_H_INCLUDED
|
||||||
#define OS_H_INCLUDED
|
#define OS_H_INCLUDED
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef _MSC_VER
|
||||||
/* windows */
|
/* windows with visual c */
|
||||||
#define isnan(x) _isnan(x)
|
#define isnan(x) _isnan(x)
|
||||||
#define isinf(x) !_finite(x)
|
#define isinf(x) !_finite(x)
|
||||||
|
|
||||||
/* disable warnings I don't care about */
|
/* disable warnings I don't care about */
|
||||||
#pragma warning(disable:4244) /* possible loss of data conversion */
|
#pragma warning(disable:4244) /* possible loss of data conversion */
|
||||||
#pragma warning(disable:4273) /* inconsistent dll linkage */
|
#pragma warning(disable:4273) /* inconsistent dll linkage */
|
||||||
#pragma warning(disable:4217)
|
#pragma warning(disable:4217)
|
||||||
#else
|
|
||||||
/* nix */
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#endif // OS_H_INCLUDED
|
#endif // OS_H_INCLUDED
|
||||||
|
|||||||
@@ -101,7 +101,7 @@ int wii_board_handshake(struct wiimote_t* wm, struct wii_board_t* wb, byte* data
|
|||||||
wm->event = WIIUSE_WII_BOARD_CTRL_INSERTED;
|
wm->event = WIIUSE_WII_BOARD_CTRL_INSERTED;
|
||||||
wm->exp.type = EXP_WII_BOARD;
|
wm->exp.type = EXP_WII_BOARD;
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIIUSE_WIN32
|
||||||
wm->timeout = WIIMOTE_DEFAULT_TIMEOUT;
|
wm->timeout = WIIMOTE_DEFAULT_TIMEOUT;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
28
src/wiiuse.c
28
src/wiiuse.c
@@ -41,7 +41,7 @@
|
|||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#ifndef WIN32
|
#ifndef WIIUSE_WIN32
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -142,11 +142,12 @@ struct wiimote_t** wiiuse_init(int wiimotes) {
|
|||||||
|
|
||||||
wm[i]->unid = i+1;
|
wm[i]->unid = i+1;
|
||||||
|
|
||||||
#ifndef WIN32
|
#ifdef WIIUSE_BLUEZ
|
||||||
wm[i]->bdaddr = *BDADDR_ANY;
|
wm[i]->bdaddr = *BDADDR_ANY;
|
||||||
wm[i]->out_sock = -1;
|
wm[i]->out_sock = -1;
|
||||||
wm[i]->in_sock = -1;
|
wm[i]->in_sock = -1;
|
||||||
#else
|
#endif
|
||||||
|
#ifdef WIIUSE_WIN32
|
||||||
wm[i]->dev_handle = 0;
|
wm[i]->dev_handle = 0;
|
||||||
wm[i]->stack = WIIUSE_STACK_UNKNOWN;
|
wm[i]->stack = WIIUSE_STACK_UNKNOWN;
|
||||||
wm[i]->normal_timeout = WIIMOTE_DEFAULT_TIMEOUT;
|
wm[i]->normal_timeout = WIIMOTE_DEFAULT_TIMEOUT;
|
||||||
@@ -188,10 +189,11 @@ void wiiuse_disconnected(struct wiimote_t* wm) {
|
|||||||
WIIMOTE_DISABLE_STATE(wm, WIIMOTE_STATE_CONNECTED);
|
WIIMOTE_DISABLE_STATE(wm, WIIMOTE_STATE_CONNECTED);
|
||||||
|
|
||||||
/* reset a bunch of stuff */
|
/* reset a bunch of stuff */
|
||||||
#ifndef WIN32
|
#ifdef WIIUSE_BLUEZ
|
||||||
wm->out_sock = -1;
|
wm->out_sock = -1;
|
||||||
wm->in_sock = -1;
|
wm->in_sock = -1;
|
||||||
#else
|
#endif
|
||||||
|
#ifdef WIIUSE_WIN32
|
||||||
wm->dev_handle = 0;
|
wm->dev_handle = 0;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -594,11 +596,11 @@ int wiiuse_send(struct wiimote_t* wm, byte report_type, byte* msg, int len) {
|
|||||||
byte buf[32]; /* no payload is better than this */
|
byte buf[32]; /* no payload is better than this */
|
||||||
int rumble = 0;
|
int rumble = 0;
|
||||||
|
|
||||||
#ifndef WIN32
|
#ifdef WIIUSE_WIN32
|
||||||
|
buf[0] = report_type;
|
||||||
|
#else
|
||||||
buf[0] = WM_SET_REPORT | WM_BT_OUTPUT;
|
buf[0] = WM_SET_REPORT | WM_BT_OUTPUT;
|
||||||
buf[1] = report_type;
|
buf[1] = report_type;
|
||||||
#else
|
|
||||||
buf[0] = report_type;
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
switch (report_type) {
|
switch (report_type) {
|
||||||
@@ -615,7 +617,7 @@ int wiiuse_send(struct wiimote_t* wm, byte report_type, byte* msg, int len) {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef WIN32
|
#ifndef WIIUSE_WIN32
|
||||||
memcpy(buf+2, msg, len);
|
memcpy(buf+2, msg, len);
|
||||||
if (rumble)
|
if (rumble)
|
||||||
buf[2] |= 0x01;
|
buf[2] |= 0x01;
|
||||||
@@ -629,7 +631,7 @@ int wiiuse_send(struct wiimote_t* wm, byte report_type, byte* msg, int len) {
|
|||||||
{
|
{
|
||||||
int x = 2;
|
int x = 2;
|
||||||
printf("[DEBUG] (id %i) SEND: (%x) %.2x ", wm->unid, buf[0], buf[1]);
|
printf("[DEBUG] (id %i) SEND: (%x) %.2x ", wm->unid, buf[0], buf[1]);
|
||||||
#ifndef WIN32
|
#ifndef WIIUSE_WIN32
|
||||||
for (; x < len+2; ++x)
|
for (; x < len+2; ++x)
|
||||||
#else
|
#else
|
||||||
for (; x < len+1; ++x)
|
for (; x < len+1; ++x)
|
||||||
@@ -639,7 +641,7 @@ int wiiuse_send(struct wiimote_t* wm, byte report_type, byte* msg, int len) {
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef WIN32
|
#ifndef WIIUSE_WIN32
|
||||||
return wiiuse_io_write(wm, buf, len+2);
|
return wiiuse_io_write(wm, buf, len+2);
|
||||||
#else
|
#else
|
||||||
return wiiuse_io_write(wm, buf, len+1);
|
return wiiuse_io_write(wm, buf, len+1);
|
||||||
@@ -711,7 +713,7 @@ float wiiuse_set_smooth_alpha(struct wiimote_t* wm, float alpha) {
|
|||||||
* @param type The type of bluetooth stack to use.
|
* @param type The type of bluetooth stack to use.
|
||||||
*/
|
*/
|
||||||
void wiiuse_set_bluetooth_stack(struct wiimote_t** wm, int wiimotes, enum win_bt_stack_t type) {
|
void wiiuse_set_bluetooth_stack(struct wiimote_t** wm, int wiimotes, enum win_bt_stack_t type) {
|
||||||
#ifdef WIN32
|
#ifdef WIIUSE_WIN32
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if (!wm) return;
|
if (!wm) return;
|
||||||
@@ -774,7 +776,7 @@ void wiiuse_resync(struct wiimote_t* wm) {
|
|||||||
* @param exp_timeout The timeout in millisecondsd to wait for an expansion handshake.
|
* @param exp_timeout The timeout in millisecondsd to wait for an expansion handshake.
|
||||||
*/
|
*/
|
||||||
void wiiuse_set_timeout(struct wiimote_t** wm, int wiimotes, byte normal_timeout, byte exp_timeout) {
|
void wiiuse_set_timeout(struct wiimote_t** wm, int wiimotes, byte normal_timeout, byte exp_timeout) {
|
||||||
#ifdef WIN32
|
#ifdef WIIUSE_WIN32
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if (!wm) return;
|
if (!wm) return;
|
||||||
|
|||||||
33
src/wiiuse.h
33
src/wiiuse.h
@@ -69,10 +69,23 @@
|
|||||||
#define WIIUSE_MINOR 13
|
#define WIIUSE_MINOR 13
|
||||||
#define WIIUSE_MICRO 1
|
#define WIIUSE_MICRO 1
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifndef WIIUSE_PLATFORM
|
||||||
|
#if defined(_WIN32)
|
||||||
|
#define WIIUSE_PLATFORM
|
||||||
|
#define WIIUSE_WIN32
|
||||||
|
#elif defined(__linux)
|
||||||
|
#define WIIUSE_PLATFORM
|
||||||
|
#define WIIUSE_BLUEZ
|
||||||
|
#else
|
||||||
|
#error "Platform not yet supported!"
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef WIIUSE_WIN32
|
||||||
/* windows */
|
/* windows */
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#else
|
#endif
|
||||||
|
#ifdef WIIUSE_BLUEZ
|
||||||
/* nix */
|
/* nix */
|
||||||
#include <bluetooth/bluetooth.h>
|
#include <bluetooth/bluetooth.h>
|
||||||
#endif
|
#endif
|
||||||
@@ -262,7 +275,7 @@ typedef enum ir_position_t {
|
|||||||
* This is left over from an old hack, but it may actually
|
* This is left over from an old hack, but it may actually
|
||||||
* be a useful feature to keep so it wasn't removed.
|
* be a useful feature to keep so it wasn't removed.
|
||||||
*/
|
*/
|
||||||
#ifdef WIN32
|
#ifdef WIIUSE_WIN32
|
||||||
#define WIIMOTE_DEFAULT_TIMEOUT 10
|
#define WIIMOTE_DEFAULT_TIMEOUT 10
|
||||||
#define WIIMOTE_EXP_TIMEOUT 10
|
#define WIIMOTE_EXP_TIMEOUT 10
|
||||||
#endif
|
#endif
|
||||||
@@ -605,18 +618,26 @@ typedef enum WIIUSE_EVENT_TYPE {
|
|||||||
typedef struct wiimote_t {
|
typedef struct wiimote_t {
|
||||||
WCONST int unid; /**< user specified id */
|
WCONST int unid; /**< user specified id */
|
||||||
|
|
||||||
#ifndef WIN32
|
#ifdef WIIUSE_BLUEZ
|
||||||
|
/** @name Linux-specific (BlueZ) members */
|
||||||
|
/** @{ */
|
||||||
WCONST bdaddr_t bdaddr; /**< bt address */
|
WCONST bdaddr_t bdaddr; /**< bt address */
|
||||||
WCONST char bdaddr_str[18]; /**< readable bt address */
|
WCONST char bdaddr_str[18]; /**< readable bt address */
|
||||||
WCONST int out_sock; /**< output socket */
|
WCONST int out_sock; /**< output socket */
|
||||||
WCONST int in_sock; /**< input socket */
|
WCONST int in_sock; /**< input socket */
|
||||||
#else
|
/** @} */
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef WIIUSE_WIN32
|
||||||
|
/** @name Windows-specific members */
|
||||||
|
/** @{ */
|
||||||
WCONST HANDLE dev_handle; /**< HID handle */
|
WCONST HANDLE dev_handle; /**< HID handle */
|
||||||
WCONST OVERLAPPED hid_overlap; /**< overlap handle */
|
WCONST OVERLAPPED hid_overlap; /**< overlap handle */
|
||||||
WCONST enum win_bt_stack_t stack; /**< type of bluetooth stack to use */
|
WCONST enum win_bt_stack_t stack; /**< type of bluetooth stack to use */
|
||||||
WCONST int timeout; /**< read timeout */
|
WCONST int timeout; /**< read timeout */
|
||||||
WCONST byte normal_timeout; /**< normal timeout */
|
WCONST byte normal_timeout; /**< normal timeout */
|
||||||
WCONST byte exp_timeout; /**< timeout for expansion handshake */
|
WCONST byte exp_timeout; /**< timeout for expansion handshake */
|
||||||
|
/** @} */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
WCONST int state; /**< various state flags */
|
WCONST int state; /**< various state flags */
|
||||||
@@ -666,7 +687,7 @@ typedef enum wiiuse_loglevel {
|
|||||||
*
|
*
|
||||||
*****************************************/
|
*****************************************/
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef WIIUSE_WIN32
|
||||||
#define WIIUSE_EXPORT_DECL __declspec(dllexport)
|
#define WIIUSE_EXPORT_DECL __declspec(dllexport)
|
||||||
#define WIIUSE_IMPORT_DECL __declspec(dllimport)
|
#define WIIUSE_IMPORT_DECL __declspec(dllimport)
|
||||||
#else
|
#else
|
||||||
|
|||||||
@@ -44,9 +44,22 @@
|
|||||||
#ifndef WIIUSE_INTERNAL_H_INCLUDED
|
#ifndef WIIUSE_INTERNAL_H_INCLUDED
|
||||||
#define WIIUSE_INTERNAL_H_INCLUDED
|
#define WIIUSE_INTERNAL_H_INCLUDED
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifndef WIIUSE_PLATFORM
|
||||||
|
#if defined(_WIN32)
|
||||||
|
#define WIIUSE_PLATFORM
|
||||||
|
#define WIIUSE_WIN32
|
||||||
|
#elif defined(__linux)
|
||||||
|
#define WIIUSE_PLATFORM
|
||||||
|
#define WIIUSE_BLUEZ
|
||||||
|
#else
|
||||||
|
#error "Platform not yet supported!"
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef WIIUSE_WIN32
|
||||||
#include <Winsock2.h>
|
#include <Winsock2.h>
|
||||||
#else
|
#endif
|
||||||
|
#ifdef WIIUSE_BLUEZ
|
||||||
#include <arpa/inet.h> /* htons() */
|
#include <arpa/inet.h> /* htons() */
|
||||||
#include <bluetooth/bluetooth.h>
|
#include <bluetooth/bluetooth.h>
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user