utf8proc

changeset 12:82d33620bb8a

Compatibility with Microsoft Visual Studio; Make utf8proc usable in C++ programs

- Patches for compatibility with Microsoft Visual Studio
- Fixes to make utf8proc usable in C++ programs
author Jan Nijtmans
date Thu Oct 08 12:00:00 2009 +0200 (2009-10-08)
parents d79da2302625
children 2c7384f1fac1
files utf8proc.h
line diff
     1.1 --- a/utf8proc.h	Thu Aug 20 12:00:00 2009 +0200
     1.2 +++ b/utf8proc.h	Thu Oct 08 12:00:00 2009 +0200
     1.3 @@ -53,11 +53,30 @@
     1.4  
     1.5  
     1.6  #include <stdlib.h>
     1.7 +#include <sys/types.h>
     1.8 +#ifdef _MSC_VER
     1.9 +typedef signed char int8_t;
    1.10 +typedef unsigned char uint8_t;
    1.11 +typedef short int16_t;
    1.12 +typedef unsigned short uint16_t;
    1.13 +typedef int int32_t;
    1.14 +#ifdef _WIN64
    1.15 +#define ssize_t __int64
    1.16 +#else
    1.17 +#define ssize_t int
    1.18 +#endif
    1.19 +typedef unsigned char bool;
    1.20 +enum {false, true};
    1.21 +#else
    1.22  #include <stdbool.h>
    1.23 -#include <sys/types.h>
    1.24  #include <inttypes.h>
    1.25 +#endif
    1.26  #include <limits.h>
    1.27  
    1.28 +#ifdef __cplusplus
    1.29 +extern "C" {
    1.30 +#endif
    1.31 +
    1.32  #ifndef SSIZE_MAX
    1.33  #define SSIZE_MAX ((size_t)SIZE_MAX/2)
    1.34  #endif
    1.35 @@ -358,6 +377,9 @@
    1.36   *  normalized version of the null-terminated string 'str'.
    1.37   */
    1.38  
    1.39 +#ifdef __cplusplus
    1.40 +}
    1.41 +#endif
    1.42  
    1.43  #endif
    1.44  

Impressum / About Us