src/platform_windows.h
author Volker Birk <vb@pep-project.org>
Mon, 25 May 2015 23:55:55 +0200
changeset 282 e7d04b49f8ab
parent 219 3b698a1336a0
child 784 cb01ae9682b0
permissions -rw-r--r--
stpcpy() added to platform 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@282
    47
char *stpcpy(char *dst, const char *src);
vb@80
    48
vb@0
    49
const char *windoze_local_db(void);
vb@0
    50
const char *windoze_system_db(void);
vb@0
    51
const char *gpg_conf(void);
vb@0
    52
vb@54
    53
long random(void);
vb@54
    54
vb@125
    55
#ifndef inline
vb@130
    56
#define inline __inline
vb@125
    57
#endif
vb@125
    58
vb@0
    59
#ifdef __cplusplus
vb@0
    60
}
vb@0
    61
#endif