Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
executable file 51 lines (41 sloc) 1002 Bytes
#ifndef LIBWBFS_OS_H
#define LIBWBFS_OS_H
// this file abstract the os integration
// libwbfs_glue.h for segher tools env.
// standard u8, u32 and co types, + fatal
#ifdef WIN32
#include <tools.h>
#else
#include "tools.h"
#endif
#include <stdio.h>
#ifdef WIN32
#define wbfs_fatal fatal
#define wbfs_error fatal
#define wbfs_warning non_fatal
#else
#define wbfs_fatal fatal
#define wbfs_error non_fatal
#define wbfs_warning non_fatal
#endif
#include <stdlib.h>
#define wbfs_malloc(x) malloc(x)
#define wbfs_free(x) free(x)
// alloc memory space suitable for disk io
#define wbfs_ioalloc(x) malloc(x)
#define wbfs_iofree(x) free(x)
#ifdef WIN32
#include <winsock.h>
#else
#include <arpa/inet.h>
#endif
// endianess tools
#define wbfs_ntohl(x) ntohl(x)
#define wbfs_ntohs(x) ntohs(x)
#define wbfs_htonl(x) htonl(x)
#define wbfs_htons(x) htons(x)
#include <string.h>
#define wbfs_memcmp(x,y,z) memcmp(x,y,z)
#define wbfs_memcpy(x,y,z) memcpy(x,y,z)
#define wbfs_memset(x,y,z) memset(x,y,z)
#endif
Something went wrong with that request. Please try again.