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 // ***************************************************************************
12 #ifndef BAMTOOLS_GLOBAL_H
13 #define BAMTOOLS_GLOBAL_H
15 /*! \brief Library export macro
18 #ifndef BAMTOOLS_LIBRARY_EXPORT
20 # define BAMTOOLS_LIBRARY_EXPORT __declspec(dllexport)
22 # define BAMTOOLS_LIBRARY_EXPORT __attribute__((visibility("default")))
24 #endif // BAMTOOLS_LIBRARY_EXPORT
26 /*! \brief Library import macro
29 #ifndef BAMTOOLS_LIBRARY_IMPORT
31 # define BAMTOOLS_LIBRARY_IMPORT __declspec(dllimport)
33 # define BAMTOOLS_LIBRARY_IMPORT
35 #endif // BAMTOOLS_LIBRARY_IMPORT
37 /*! \brief Platform-specific type definitions
43 #define ftell64(a) _ftelli64(a)
44 #define fseek64(a,b,c) _fseeki64(a,b,c)
46 #define ftell64(a) ftello(a)
47 #define fseek64(a,b,c) fseeko(a,b,c)
49 #endif // BAMTOOLS_LFS
52 \brief Platform-independent tell() operation.
55 /*! \def fseek64(a,b,c)
56 \brief Platform-independent seek() operation.
60 /*! \brief Platform-specific type definitions
63 #ifndef BAMTOOLS_TYPES
64 #define BAMTOOLS_TYPES
67 typedef unsigned char uint8_t;
68 typedef short int16_t;
69 typedef unsigned short uint16_t;
71 typedef unsigned int uint32_t;
72 typedef long long int64_t;
73 typedef unsigned long long uint64_t;
77 #endif // BAMTOOLS_TYPES
81 #ifndef BAMTOOLS_ASSERTS
82 #define BT_ASSERT_UNREACHABLE assert( false )
83 #define BT_ASSERT_X( condition, message ) if (!( condition )) throw std::runtime_error( message );
84 #endif // BAMTOOLS_ASSERTS
86 #endif // BAMTOOLS_GLOBAL_H