Skip to content
Merged
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
2 changes: 2 additions & 0 deletions include/chunkio/chunkio_compat.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,10 @@
#define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
#define strerror_r(errno,buf,len) strerror_s(buf,len,errno)

#ifndef __MINGW32__
typedef SSIZE_T ssize_t;
typedef unsigned mode_t;
#endif

static inline char* dirname(const char *path)
{
Expand Down
3 changes: 2 additions & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
)
set(libs
${libs}
Shell32.lib)
shell32
ws2_32)
else()
set(src
${src}
Expand Down
2 changes: 1 addition & 1 deletion src/cio_os.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#include <chunkio/chunkio_compat.h>

#ifdef _WIN32
#include <Shlobj.h>
#include <shlobj.h>
#endif

/* Check if a path is a directory */
Expand Down
4 changes: 2 additions & 2 deletions src/cio_utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#include <chunkio/cio_info.h>
#if defined(CIO_HAVE_BACKEND_FILESYSTEM) && defined(__EMSCRIPTEN__)
#include <ftw.h>
#elif defined(CIO_HAVE_BACKEND_FILESYSTEM) && !defined(_MSC_VER)
#elif defined(CIO_HAVE_BACKEND_FILESYSTEM) && !defined(_WIN32)
#include <fts.h>
#endif

Expand Down Expand Up @@ -64,7 +64,7 @@ int cio_utils_recursive_delete(const char *dir)
*/
return nftw(dir, cio_utils_remove_entry, 32, FTW_DEPTH | FTW_PHYS | FTW_MOUNT);
}
#elif !defined(_MSC_VER)
#elif !defined(_WIN32)
/*
* Taken from StackOverflow:
*
Expand Down
2 changes: 1 addition & 1 deletion src/win32/dirent.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* Win32's FIndFirstFile/FindNextFile API.
*/

#include <Windows.h>
#include <windows.h>

#include "dirent.h"

Expand Down
12 changes: 6 additions & 6 deletions tools/cio.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#include <limits.h>
#include <signal.h>
#include <time.h>
#ifndef _MSC_VER
#ifndef _WIN32
#include <pwd.h>
#endif
#ifdef __MACH__
Expand All @@ -35,7 +35,7 @@
#include <monkey/mk_core/mk_getopt.h>
#include <chunkio/chunkio_compat.h>

#ifndef _MSC_VER
#ifndef _WIN32
#define ANSI_RESET "\033[0m"
#define ANSI_BOLD "\033[1m"
#define ANSI_CYAN "\033[96m"
Expand Down Expand Up @@ -121,7 +121,7 @@ static void cio_signal_handler(int signal)
write(STDERR_FILENO, s, sizeof(s) - 1);
switch (signal) {
cio_print_signal(SIGINT);
#ifndef _MSC_VER
#ifndef _WIN32
cio_print_signal(SIGQUIT);
cio_print_signal(SIGHUP);
#endif
Expand All @@ -132,7 +132,7 @@ static void cio_signal_handler(int signal)
/* Signal handlers */
switch (signal) {
case SIGINT:
#ifndef _MSC_VER
#ifndef _WIN32
case SIGQUIT:
case SIGHUP:
#endif
Expand Down Expand Up @@ -173,7 +173,7 @@ void cio_bytes_to_human_readable_size(size_t bytes,
static void cio_signal_init()
{
signal(SIGINT, &cio_signal_handler);
#ifndef _MSC_VER
#ifndef _WIN32
signal(SIGQUIT, &cio_signal_handler);
signal(SIGHUP, &cio_signal_handler);
#endif
Expand Down Expand Up @@ -206,7 +206,7 @@ static int log_cb(struct cio_ctx *ctx, int level, const char *file, int line,
return 0;
}

#ifndef _MSC_VER
#ifndef _WIN32
static int cio_default_root_path(char *path, int size)
{
int len;
Expand Down
Loading