libepubgen_utils.h
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /*
3  * This file is part of the libepubgen project.
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  */
9 
10 #ifndef INCLUDED_LIBEPUBGEN_UTILS_H
11 #define INCLUDED_LIBEPUBGEN_UTILS_H
12 
13 #ifdef DEBUG
14 #include <cstdio>
15 #endif
16 
17 #include <boost/shared_ptr.hpp>
18 
19 #include <librevenge-stream/librevenge-stream.h>
20 
21 #ifdef _MSC_VER
22 
23 typedef unsigned char uint8_t;
24 typedef unsigned short uint16_t;
25 typedef short int16_t;
26 typedef unsigned uint32_t;
27 typedef int int32_t;
28 typedef unsigned __int64 uint64_t;
29 typedef __int64 int64_t;
30 
31 #else
32 
33 #ifdef HAVE_CONFIG_H
34 
35 #include "config.h"
36 
37 #ifdef HAVE_STDINT_H
38 #include <stdint.h>
39 #endif
40 
41 #ifdef HAVE_INTTYPES_H
42 #include <inttypes.h>
43 #endif
44 
45 #else
46 
47 // assume that the headers are there inside LibreOffice build when no HAVE_CONFIG_H is defined
48 #include <stdint.h>
49 #include <inttypes.h>
50 
51 #endif
52 
53 #endif
54 
55 // debug message includes source file and line number
56 //#define VERBOSE_DEBUG 1
57 
58 // do nothing with debug messages in a release compile
59 #ifdef DEBUG
60 #ifdef VERBOSE_DEBUG
61 #define EPUBGEN_DEBUG_MSG(M) std::printf("%15s:%5d: ", __FILE__, __LINE__); std::printf M
62 #define EPUBGEN_DEBUG(M) M
63 #else
64 #define EPUBGEN_DEBUG_MSG(M) std::printf M
65 #define EPUBGEN_DEBUG(M) M
66 #endif
67 #else
68 #define EPUBGEN_DEBUG_MSG(M)
69 #define EPUBGEN_DEBUG(M)
70 #endif
71 
72 #define EPUBGEN_NUM_ELEMENTS(array) (sizeof(array) / sizeof(array[0]))
73 
74 namespace libepubgen
75 {
76 
77 typedef boost::shared_ptr<librevenge::RVNGInputStream> RVNGInputStreamPtr_t;
78 
80 {
81  void operator()(void *) {}
82 };
83 
85 {
86 };
87 
88 } // namespace libepubgen
89 
90 #endif // INCLUDED_LIBEPUBGEN_UTILS_H
91 
92 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */
boost::shared_ptr< librevenge::RVNGInputStream > RVNGInputStreamPtr_t
Definition: libepubgen_utils.h:77
Definition: EPUBBinarySink.cpp:12
Definition: libepubgen_utils.h:79
void operator()(void *)
Definition: libepubgen_utils.h:81
Definition: libepubgen_utils.h:84

Generated for libepubgen by doxygen 1.8.8