src/platform_windows.h
author Volker Birk <vb@pep-project.org>
Thu, 26 Mar 2015 16:46:11 +0100
changeset 139 6f11196a9c45
parent 132 dabdd17a3e78
child 219 3b698a1336a0
permissions -rw-r--r--
remove mkstemp macro because we have a function
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@125
     9
vb@0
    10
#ifdef __cplusplus
vb@0
    11
extern "C" {
vb@0
    12
#endif
vb@0
    13
vb@86
    14
#define RTLD_LAZY 1
vb@130
    15
#define mode_t int
vb@86
    16
vb@0
    17
void *dlopen(const char *filename, int flag);
vb@0
    18
int dlclose(void *handle);
vb@0
    19
void *dlsym(void *handle, const char *symbol);
vb@132
    20
int mkstemp(char *templ);
vb@0
    21
vb@86
    22
#ifndef strdup
vb@113
    23
#define strdup(A) _strdup((A))
vb@86
    24
#endif
vb@86
    25
#ifndef snprintf
vb@89
    26
#define snprintf(...) _snprintf(__VA_ARGS__)
vb@86
    27
#endif
vb@82
    28
#ifndef strtok_r
vb@82
    29
#define strtok_r(A, B, C) strtok_s((A), (B), (C))
vb@82
    30
#endif
vb@85
    31
#ifndef strncasecmp
vb@85
    32
#define strncasecmp(A, B, C) _strnicmp((A), (B), (C))
vb@85
    33
#endif
vb@113
    34
#ifndef gmtime_r
vb@113
    35
#define gmtime_r(A, B) gmtime_s((B), (A))
vb@132
    36
#endif
vb@132
    37
#ifndef ftruncate
vb@132
    38
#define ftruncate(A, B) _chsize((A), (B))
vb@130
    39
#endif
vb@130
    40
#ifndef ftello
vb@130
    41
#define ftello(A) ((off_t) _ftelli64(A))
vb@113
    42
#endif
vb@113
    43
vb@82
    44
char *strndup(const char *s1, size_t n);
vb@80
    45
vb@0
    46
const char *windoze_local_db(void);
vb@0
    47
const char *windoze_system_db(void);
vb@0
    48
const char *gpg_conf(void);
vb@0
    49
vb@54
    50
long random(void);
vb@54
    51
vb@125
    52
#ifndef inline
vb@130
    53
#define inline __inline
vb@125
    54
#endif
vb@125
    55
vb@0
    56
#ifdef __cplusplus
vb@0
    57
}
vb@0
    58
#endif