src/platform_windows.h
author Volker Birk <vb@pep-project.org>
Wed, 22 Apr 2015 12:13:22 +0200
changeset 219 3b698a1336a0
parent 139 6f11196a9c45
child 282 e7d04b49f8ab
permissions -rw-r--r--
ssize_t for Windoze
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
vb@89
    28
#define snprintf(...) _snprintf(__VA_ARGS__)
vb@86
    29
#endif
vb@82
    30
#ifndef strtok_r
vb@82
    31
#define strtok_r(A, B, C) strtok_s((A), (B), (C))
vb@82
    32
#endif
vb@85
    33
#ifndef strncasecmp
vb@85
    34
#define strncasecmp(A, B, C) _strnicmp((A), (B), (C))
vb@85
    35
#endif
vb@113
    36
#ifndef gmtime_r
vb@113
    37
#define gmtime_r(A, B) gmtime_s((B), (A))
vb@132
    38
#endif
vb@132
    39
#ifndef ftruncate
vb@132
    40
#define ftruncate(A, B) _chsize((A), (B))
vb@130
    41
#endif
vb@130
    42
#ifndef ftello
vb@130
    43
#define ftello(A) ((off_t) _ftelli64(A))
vb@113
    44
#endif
vb@113
    45
vb@82
    46
char *strndup(const char *s1, size_t n);
vb@80
    47
vb@0
    48
const char *windoze_local_db(void);
vb@0
    49
const char *windoze_system_db(void);
vb@0
    50
const char *gpg_conf(void);
vb@0
    51
vb@54
    52
long random(void);
vb@54
    53
vb@125
    54
#ifndef inline
vb@130
    55
#define inline __inline
vb@125
    56
#endif
vb@125
    57
vb@0
    58
#ifdef __cplusplus
vb@0
    59
}
vb@0
    60
#endif