PoDoFo 1.2.0
Loading...
Searching...
No Matches
basecompat.h
1// SPDX-FileCopyrightText: 2007 Dominik Seichter <domseichter@web.de>
2// SPDX-FileCopyrightText: 2020 Francesco Pretto <ceztko@gmail.com>
3// SPDX-License-Identifier: LGPL-2.0-or-later OR MPL-2.0
4
5#ifndef PODOFO_BASE_COMPAT_H
6#define PODOFO_BASE_COMPAT_H
7
9
10 // Declare ssize_t as a signed alternative to size_t,
11 // useful for example to provide optional size argument
12#if defined(_MSC_VER)
13 // Fix missing posix "ssize_t" typedef in MSVC
14#include <BaseTsd.h>
15typedef SSIZE_T ssize_t;
16#else
17// Posix has ssize_t
18#include <sys/types.h>
19#endif
20
21// Make sure that DEBUG is defined
22// for debug builds on Windows
23// as Visual Studio defines only _DEBUG
24#ifdef _DEBUG
25#ifndef DEBUG
26#define DEBUG 1
27#endif // DEBUG
28#endif // _DEBUG
29
30// Silence some annoying warnings from Visual Studio
31#ifdef _MSC_VER
32#pragma warning(disable: 4251)
33#pragma warning(disable: 4275)
34#endif // _MSC_VER
35
36#endif // PODOFO_BASE_COMPAT_H