mirror of
https://github.com/xmrig/xmrig.git
synced 2025-12-08 00:15:04 -05:00
Better fix for MSVC.
This commit is contained in:
18
src/3rdparty/jansson/dump.c
vendored
18
src/3rdparty/jansson/dump.c
vendored
@@ -20,13 +20,10 @@
|
||||
#include <string.h>
|
||||
#include <assert.h>
|
||||
|
||||
#if defined(HAVE_UNISTD_H) && !defined(_MSC_VER)
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
#include <BaseTsd.h>
|
||||
typedef SSIZE_T ssize_t;
|
||||
#if defined(HAVE_UNISTD_H)
|
||||
# include <unistd.h>
|
||||
#elif defined(_MSC_VER)
|
||||
# include <io.h>
|
||||
#endif
|
||||
|
||||
#include "jansson.h"
|
||||
@@ -72,10 +69,13 @@ static int dump_to_file(const char *buffer, size_t size, void *data)
|
||||
static int dump_to_fd(const char *buffer, size_t size, void *data)
|
||||
{
|
||||
int *dest = (int *)data;
|
||||
#ifdef HAVE_UNISTD_H
|
||||
# if defined(HAVE_UNISTD_H)
|
||||
if(write(*dest, buffer, size) == (ssize_t)size)
|
||||
return 0;
|
||||
#endif
|
||||
# elif (defined(_MSC_VER))
|
||||
if (write(*dest, buffer, (unsigned int) size) == (int) size)
|
||||
return 0;
|
||||
# endif
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
2
src/3rdparty/jansson/hashtable_seed.c
vendored
2
src/3rdparty/jansson/hashtable_seed.c
vendored
@@ -21,7 +21,7 @@
|
||||
#include <sched.h>
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_UNISTD_H) && !defined(_MSC_VER)
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
|
||||
@@ -92,7 +92,9 @@
|
||||
#define HAVE_SYS_TYPES_H 1
|
||||
|
||||
/* Define to 1 if you have the <unistd.h> header file. */
|
||||
#define HAVE_UNISTD_H 1
|
||||
#ifndef _MSC_VER
|
||||
# define HAVE_UNISTD_H 1
|
||||
#endif
|
||||
|
||||
/* Define to 1 if the system has the type 'unsigned long long int'. */
|
||||
#define HAVE_UNSIGNED_LONG_LONG_INT 1
|
||||
|
||||
12
src/3rdparty/jansson/load.c
vendored
12
src/3rdparty/jansson/load.c
vendored
@@ -18,12 +18,12 @@
|
||||
#include <string.h>
|
||||
#include <assert.h>
|
||||
|
||||
#if defined(HAVE_UNISTD_H) && !defined(_MSC_VER)
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#define STDIN_FILENO 0
|
||||
#if defined(HAVE_UNISTD_H)
|
||||
# include <unistd.h>
|
||||
#elif defined(_MSC_VER)
|
||||
# include <io.h>
|
||||
# define HAVE_UNISTD_H
|
||||
# define STDIN_FILENO 0
|
||||
#endif
|
||||
|
||||
#include "jansson.h"
|
||||
|
||||
Reference in New Issue
Block a user