Graphiteng
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros
Types.h
Go to the documentation of this file.
1 /* GRAPHITE2 LICENSING
2 
3  Copyright 2010, SIL International
4  All rights reserved.
5 
6  This library is free software; you can redistribute it and/or modify
7  it under the terms of the GNU Lesser General Public License as published
8  by the Free Software Foundation; either version 2.1 of License, or
9  (at your option) any later version.
10 
11  This program is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  Lesser General Public License for more details.
15 
16  You should also have received a copy of the GNU Lesser General Public
17  License along with this library in the file named "LICENSE".
18  If not, write to the Free Software Foundation, 51 Franklin Street,
19  Suite 500, Boston, MA 02110-1335, USA or visit their web page on the
20  internet at http://www.fsf.org/licenses/lgpl.html.
21 
22  Alternatively, the contents of this file may be used under the terms
23  of the Mozilla Public License (http://mozilla.org/MPL) or the GNU
24  General Public License, as published by the Free Software Foundation,
25  either version 2 of the License or (at your option) any later version.
26 */
27 #pragma once
28 
29 #include <stddef.h>
30 
31 typedef unsigned char gr_uint8;
32 typedef gr_uint8 gr_byte;
33 typedef signed char gr_int8;
34 typedef unsigned short gr_uint16;
35 typedef short gr_int16;
36 typedef unsigned int gr_uint32;
37 typedef int gr_int32;
38 
39 enum gr_encform {
40  gr_utf8 = 1/*sizeof(uint8)*/, gr_utf16 = 2/*sizeof(uint16)*/, gr_utf32 = 4/*sizeof(uint32)*/
41 };
42 
43 // Definitions for library publicly exported symbols
44 #if defined _WIN32 || defined __CYGWIN__
45  #if defined GRAPHITE2_STATIC
46  #define GR2_API
47  #elif defined GRAPHITE2_EXPORTING
48  #if defined __GNUC__
49  #define GR2_API __attribute__((dllexport))
50  #else
51  #define GR2_API __declspec(dllexport)
52  #endif
53  #else
54  #if defined __GNUC__
55  #define GR2_API __attribute__((dllimport))
56  #else
57  #define GR2_API __declspec(dllimport)
58  #endif
59  #endif
60  #define GR2_LOCAL
61 #elif __GNUC__ >= 4
62  #if defined GRAPHITE2_STATIC
63  #define GR2_API __attribute__ ((visibility("hidden")))
64  #else
65  #define GR2_API __attribute__ ((visibility("default")))
66  #endif
67  #define GR2_LOCAL __attribute__ ((visibility("hidden")))
68 #else
69  #define GR2_API
70  #define GR2_LOCAL
71 #endif
72