src/platform_windows.h
author krista
Fri, 02 Sep 2016 13:30:36 +0200
branchkrista_local_windows
changeset 1126 129b561095a6
parent 1125 89e75396c69a
parent 971 158b15e9d626
permissions -rw-r--r--
merged with default.
vb@0
     1
#pragma once
vb@0
     2
vb@0
     3
// Windows platform specifica
vb@0
     4
vb@24
     5
#pragma warning(disable : 4996)
vb@0
     6
vb@125
     7
#include <string.h>
vb@130
     8
#include <io.h>
vb@219
     9
#include <basetsd.h>
vb@125
    10
vb@0
    11
#ifdef __cplusplus
vb@0
    12
extern "C" {
vb@0
    13
#endif
vb@0
    14
vb@219
    15
#define ssize_t SSIZE_T
vb@86
    16
#define RTLD_LAZY 1
vb@130
    17
#define mode_t int
vb@86
    18
vb@0
    19
void *dlopen(const char *filename, int flag);
vb@0
    20
int dlclose(void *handle);
vb@0
    21
void *dlsym(void *handle, const char *symbol);
vb@132
    22
int mkstemp(char *templ);
vb@0
    23
vb@86
    24
#ifndef strdup
vb@113
    25
#define strdup(A) _strdup((A))
vb@86
    26
#endif
vb@86
    27
#ifndef snprintf
Dean@971
    28
#if _MSC_VER<1900 // Includes undefined case. This is a check for VS 2015, which throws an error.
vb@89
    29
#define snprintf(...) _snprintf(__VA_ARGS__)
vb@86
    30
#endif
Dean@971
    31
#endif
vb@82
    32
#ifndef strtok_r
vb@82
    33
#define strtok_r(A, B, C) strtok_s((A), (B), (C))
vb@82
    34
#endif
vb@85
    35
#ifndef strncasecmp
vb@85
    36
#define strncasecmp(A, B, C) _strnicmp((A), (B), (C))
vb@85
    37
#endif
vb@784
    38
#ifndef strcasecmp
vb@785
    39
#define strcasecmp(A, B) _stricmp((A), (B))
vb@784
    40
#endif
vb@113
    41
#ifndef gmtime_r
vb@113
    42
#define gmtime_r(A, B) gmtime_s((B), (A))
vb@132
    43
#endif
vb@132
    44
#ifndef ftruncate
vb@132
    45
#define ftruncate(A, B) _chsize((A), (B))
vb@130
    46
#endif
vb@130
    47
#ifndef ftello
vb@130
    48
#define ftello(A) ((off_t) _ftelli64(A))
vb@113
    49
#endif
vb@113
    50
vb@82
    51
char *strndup(const char *s1, size_t n);
vb@282
    52
char *stpcpy(char *dst, const char *src);
vb@80
    53
krista@918
    54
size_t strlcpy(char* dst, const	char* src, size_t size);
krista@918
    55
size_t strlcat(char* dst, const	char* src, size_t size);
krista@918
    56
vb@0
    57
const char *windoze_local_db(void);
vb@0
    58
const char *windoze_system_db(void);
vb@0
    59
const char *gpg_conf(void);
vb@0
    60
vb@54
    61
long random(void);
vb@54
    62
vb@125
    63
#ifndef inline
vb@130
    64
#define inline __inline
vb@125
    65
#endif
vb@125
    66
vb@0
    67
#ifdef __cplusplus
vb@0
    68
}
vb@0
    69
#endif