src/platform_windows.h
author Volker Birk <vb@pep-project.org>
Wed, 29 Apr 2015 14:51:33 +0200
changeset 229 313d152239bf
parent 219 3b698a1336a0
child 282 e7d04b49f8ab
permissions -rw-r--r--
fixing preprocessor
     1 #pragma once
     2 
     3 // Windows platform specifica
     4 
     5 #pragma warning(disable : 4996)
     6 
     7 #include <string.h>
     8 #include <io.h>
     9 #include <basetsd.h>
    10 
    11 #ifdef __cplusplus
    12 extern "C" {
    13 #endif
    14 
    15 #define ssize_t SSIZE_T
    16 #define RTLD_LAZY 1
    17 #define mode_t int
    18 
    19 void *dlopen(const char *filename, int flag);
    20 int dlclose(void *handle);
    21 void *dlsym(void *handle, const char *symbol);
    22 int mkstemp(char *templ);
    23 
    24 #ifndef strdup
    25 #define strdup(A) _strdup((A))
    26 #endif
    27 #ifndef snprintf
    28 #define snprintf(...) _snprintf(__VA_ARGS__)
    29 #endif
    30 #ifndef strtok_r
    31 #define strtok_r(A, B, C) strtok_s((A), (B), (C))
    32 #endif
    33 #ifndef strncasecmp
    34 #define strncasecmp(A, B, C) _strnicmp((A), (B), (C))
    35 #endif
    36 #ifndef gmtime_r
    37 #define gmtime_r(A, B) gmtime_s((B), (A))
    38 #endif
    39 #ifndef ftruncate
    40 #define ftruncate(A, B) _chsize((A), (B))
    41 #endif
    42 #ifndef ftello
    43 #define ftello(A) ((off_t) _ftelli64(A))
    44 #endif
    45 
    46 char *strndup(const char *s1, size_t n);
    47 
    48 const char *windoze_local_db(void);
    49 const char *windoze_system_db(void);
    50 const char *gpg_conf(void);
    51 
    52 long random(void);
    53 
    54 #ifndef inline
    55 #define inline __inline
    56 #endif
    57 
    58 #ifdef __cplusplus
    59 }
    60 #endif