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
     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 char *stpcpy(char *dst, const char *src);
    48 
    49 const char *windoze_local_db(void);
    50 const char *windoze_system_db(void);
    51 const char *gpg_conf(void);
    52 
    53 long random(void);
    54 
    55 #ifndef inline
    56 #define inline __inline
    57 #endif
    58 
    59 #ifdef __cplusplus
    60 }
    61 #endif