]> git.donarmstrong.com Git - bamtools.git/blobdiff - src/shared/bamtools_global.h
Major update to BamTools version 1.0
[bamtools.git] / src / shared / bamtools_global.h
index be7e03424f1e455ea6c8a6c68ab24a3d8ded2e18..6e3cb39e5a69fca28ef2196cdb0407671e8805c0 100644 (file)
@@ -3,15 +3,18 @@
 // Marth Lab, Department of Biology, Boston College
 // All rights reserved.
 // ---------------------------------------------------------------------------
-// Last modified: 19 November 2010 (DB)
+// Last modified: 3 March 2011 (DB)
 // ---------------------------------------------------------------------------
-// Provides the basic definitions for exporting & importing library symbols
+// Provides the basic definitions for exporting & importing library symbols.
+// Also provides some platform-specific rules for definitions.
 // ***************************************************************************
 
 #ifndef BAMTOOLS_GLOBAL_H
 #define BAMTOOLS_GLOBAL_H
 
-// BAMTOOLS_LIBRARY_EXPORT
+/*! \brief Library export macro
+    \internal
+*/
 #ifndef BAMTOOLS_LIBRARY_EXPORT
 #  if defined(WIN32)
 #    define BAMTOOLS_LIBRARY_EXPORT __declspec(dllexport)
@@ -20,7 +23,9 @@
 #  endif
 #endif // BAMTOOLS_LIBRARY_EXPORT
 
-// BAMTOOLS_LIBRARY_IMPORT
+/*! \brief Library import macro
+    \internal
+*/
 #ifndef BAMTOOLS_LIBRARY_IMPORT
 #  if defined(WIN32)
 #    define BAMTOOLS_LIBRARY_IMPORT __declspec(dllimport)
 #  endif
 #endif // BAMTOOLS_LIBRARY_IMPORT
 
+/*! \brief Platform-specific type definitions
+    \internal
+*/
+#ifndef BAMTOOLS_LFS
+#define BAMTOOLS_LFS
+    #ifdef WIN32
+        #define ftell64(a)     _ftelli64(a)
+        #define fseek64(a,b,c) _fseeki64(a,b,c)
+    #else
+        #define ftell64(a)     ftello(a)
+        #define fseek64(a,b,c) fseeko(a,b,c)
+    #endif
+#endif // BAMTOOLS_LFS
+
+/*! \def ftell64(a)
+    \brief Platform-independent tell() operation.
+    \internal
+*/
+/*! \def fseek64(a,b,c)
+    \brief Platform-independent seek() operation.
+    \internal
+*/
+
+/*! \brief Platform-specific type definitions
+    \internal
+*/
+#ifndef BAMTOOLS_TYPES
+#define BAMTOOLS_TYPES
+    #ifdef _MSC_VER
+        typedef char                 int8_t;
+        typedef unsigned char       uint8_t;
+        typedef short               int16_t;
+        typedef unsigned short     uint16_t;
+        typedef int                 int32_t;
+        typedef unsigned int       uint32_t;
+        typedef long long           int64_t;
+        typedef unsigned long long uint64_t;
+    #else
+        #include <stdint.h>
+    #endif
+#endif // BAMTOOLS_TYPES
+
 #endif // BAMTOOLS_GLOBAL_H