]> git.donarmstrong.com Git - bamtools.git/blob - src/shared/bamtools_global.h
Major update to BamTools version 1.0
[bamtools.git] / src / shared / bamtools_global.h
1 // ***************************************************************************
2 // bamtools_global.h (c) 2010 Derek Barnett
3 // Marth Lab, Department of Biology, Boston College
4 // All rights reserved.
5 // ---------------------------------------------------------------------------
6 // Last modified: 3 March 2011 (DB)
7 // ---------------------------------------------------------------------------
8 // Provides the basic definitions for exporting & importing library symbols.
9 // Also provides some platform-specific rules for definitions.
10 // ***************************************************************************
11
12 #ifndef BAMTOOLS_GLOBAL_H
13 #define BAMTOOLS_GLOBAL_H
14
15 /*! \brief Library export macro
16     \internal
17 */
18 #ifndef BAMTOOLS_LIBRARY_EXPORT
19 #  if defined(WIN32)
20 #    define BAMTOOLS_LIBRARY_EXPORT __declspec(dllexport)
21 #  else
22 #    define BAMTOOLS_LIBRARY_EXPORT __attribute__((visibility("default")))
23 #  endif
24 #endif // BAMTOOLS_LIBRARY_EXPORT
25
26 /*! \brief Library import macro
27     \internal
28 */
29 #ifndef BAMTOOLS_LIBRARY_IMPORT
30 #  if defined(WIN32)
31 #    define BAMTOOLS_LIBRARY_IMPORT __declspec(dllimport)
32 #  else
33 #    define BAMTOOLS_LIBRARY_IMPORT
34 #  endif
35 #endif // BAMTOOLS_LIBRARY_IMPORT
36
37 /*! \brief Platform-specific type definitions
38     \internal
39 */
40 #ifndef BAMTOOLS_LFS
41 #define BAMTOOLS_LFS
42     #ifdef WIN32
43         #define ftell64(a)     _ftelli64(a)
44         #define fseek64(a,b,c) _fseeki64(a,b,c)
45     #else
46         #define ftell64(a)     ftello(a)
47         #define fseek64(a,b,c) fseeko(a,b,c)
48     #endif
49 #endif // BAMTOOLS_LFS
50
51 /*! \def ftell64(a)
52     \brief Platform-independent tell() operation.
53     \internal
54 */
55 /*! \def fseek64(a,b,c)
56     \brief Platform-independent seek() operation.
57     \internal
58 */
59
60 /*! \brief Platform-specific type definitions
61     \internal
62 */
63 #ifndef BAMTOOLS_TYPES
64 #define BAMTOOLS_TYPES
65     #ifdef _MSC_VER
66         typedef char                 int8_t;
67         typedef unsigned char       uint8_t;
68         typedef short               int16_t;
69         typedef unsigned short     uint16_t;
70         typedef int                 int32_t;
71         typedef unsigned int       uint32_t;
72         typedef long long           int64_t;
73         typedef unsigned long long uint64_t;
74     #else
75         #include <stdint.h>
76     #endif
77 #endif // BAMTOOLS_TYPES
78
79 #endif // BAMTOOLS_GLOBAL_H