From aa5956bd28297c3059b73985b54d0cb5a82921c6 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Fri, 23 Jan 2015 06:05:54 +0100 Subject: [PATCH] (LibretroDB) Build fixes --- libretrodb/libretrodb.c | 4 ++-- libretrodb/libretrodb.h | 8 ++++++++ libretrodb/rmsgpack_dom.h | 15 +++++++++++---- net_http.c | 29 +---------------------------- netplay_compat.h | 4 ++++ 5 files changed, 26 insertions(+), 34 deletions(-) diff --git a/libretrodb/libretrodb.c b/libretrodb/libretrodb.c index c510d634ec..91166cb393 100644 --- a/libretrodb/libretrodb.c +++ b/libretrodb/libretrodb.c @@ -82,9 +82,9 @@ int libretrodb_create( void * ctx ){ int rv; - off_t root; - uint64_t item_count = 0; + off_t root; libretrodb_metadata_t md; + uint64_t item_count = 0; struct rmsgpack_dom_value item = {}; libretrodb_header_t header = {}; diff --git a/libretrodb/libretrodb.h b/libretrodb/libretrodb.h index 5998ff9df8..024b840e7a 100644 --- a/libretrodb/libretrodb.h +++ b/libretrodb/libretrodb.h @@ -11,6 +11,10 @@ #define MAGIC_NUMBER "RARCHDB" +#ifdef __cplusplus +extern "C" { +#endif + typedef struct libretrodb_query libretrodb_query_t; typedef struct libretrodb @@ -126,4 +130,8 @@ int libretrodb_cursor_read_item( struct rmsgpack_dom_value * out ); +#ifdef __cplusplus +} +#endif + #endif diff --git a/libretrodb/rmsgpack_dom.h b/libretrodb/rmsgpack_dom.h index c9cfdbf595..5f71f9818b 100644 --- a/libretrodb/rmsgpack_dom.h +++ b/libretrodb/rmsgpack_dom.h @@ -3,6 +3,10 @@ #include +#ifdef __cplusplus +extern "C" { +#endif + enum rmsgpack_dom_type { RDT_NULL = 0, RDT_BOOL, @@ -64,8 +68,11 @@ int rmsgpack_dom_write( int fd, const struct rmsgpack_dom_value * obj ); -int rmsgpack_dom_read_into( - int fd, - ... -); + +int rmsgpack_dom_read_into(int fd, ...); + +#ifdef __cplusplus +} +#endif + #endif diff --git a/net_http.c b/net_http.c index 5041520d3f..470ae7e293 100644 --- a/net_http.c +++ b/net_http.c @@ -18,34 +18,7 @@ #include #include #include - -#if defined(_WIN32) - /* Much of this is copypasta from elsewhere, I don't know if it works. */ - #define _WIN32_WINNT 0x501 - #include - #include - #define isagain(bytes) (false) - #define MSG_NOSIGNAL 0 - #define close closesocket - #ifdef _MSC_VER - #pragma comment(lib, "ws2_32.lib") - #endif -#else - //#include - #include - #include - //#include - //#include - //#include - //#include - //#include - #include - #include - //#include - #include - #include - #define isagain(bytes) (bytes<0 && (errno==EAGAIN || errno==EWOULDBLOCK)) -#endif +#include "netplay_compat.h" enum { diff --git a/netplay_compat.h b/netplay_compat.h index 054f26934a..50ab01d87c 100644 --- a/netplay_compat.h +++ b/netplay_compat.h @@ -29,6 +29,10 @@ #include #include #include +#ifndef MSG_NOSIGNAL +#define MSG_NOSIGNAL 0 +#endif +#define isagain(bytes) (false) #elif defined(_XBOX) #define NOD3D #include