PDF Toolbox
Loading...
Searching...
No Matches
PdfToolbox_Platform.h
Go to the documentation of this file.
1/******************************************************************************
2 *
3 * File: PdfToolbox_Platform.h
4 *
5 * Description: Header with platform specific defines.
6 *
7 * Author: PDF Tools AG
8 *
9 * Copyright: Copyright (C) 2015 - 2024 PDF Tools AG, Switzerland
10 * All rights reserved.
11 *
12 * Classification: CONFIDENTIAL
13 *
14 *****************************************************************************/
15
16#ifndef PDFTOOLBOX_PLATFORM_H__
17#define PDFTOOLBOX_PLATFORM_H__
18
19#include <stdarg.h>
20#include <stdio.h>
21
22#ifndef PDFTOOLBOX_CALL
23#if defined(WIN32)
24#define PDFTOOLBOX_CALL __stdcall
25#else
26#define PDFTOOLBOX_CALL
27#endif
28#endif
29
30#if defined(UNICODE) && !defined(_UNICODE)
31#define _UNICODE
32#endif
33/* Character strings on Windows can be either WinAnsi (CP1252) or Unicode (UTF16). */
34/* On Unix only char strings (8-bit, ISO encoded) are used for OS interfaces. */
35/* WCHAR strings are always UTF16 and may be different to wchar_t. */
36/* This simplifies interoperability with Java. */
37#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__)
38#include <tchar.h>
39#ifndef WCHAR
40#define WCHAR wchar_t
41#endif
42#ifndef CDECL
43#define CDECL __cdecl
44#endif
45#ifndef STDCALL
46#define STDCALL __stdcall
47#endif
48typedef __int64 pos_t;
49
50#ifdef PDFTOOLBOX_STATIC_DEFINE
51#define PDFTOOLBOX_EXPORT
52#define PDFTOOLBOX_NO_EXPORT
53#else
54#ifndef PDFTOOLBOX_EXPORT
55#ifdef PdfToolbox_EXPORTS
56/* We are building this library */
57#define PDFTOOLBOX_EXPORT __declspec(dllexport)
58#else
59/* We are using this library */
60#define PDFTOOLBOX_EXPORT __declspec(dllimport)
61#endif
62#endif
63
64#ifndef PDFTOOLBOX_NO_EXPORT
65#define PDFTOOLBOX_NO_EXPORT
66#endif
67#endif
68
69#ifndef PDFTOOLBOX_DEPRECATED
70#define PDFTOOLBOX_DEPRECATED __declspec(deprecated)
71#endif
72
73#ifndef PDFTOOLBOX_DEPRECATED_EXPORT
74#define PDFTOOLBOX_DEPRECATED_EXPORT PDFTOOLBOX_EXPORT PDFTOOLBOX_DEPRECATED
75#endif
76
77#ifndef PDFTOOLBOX_DEPRECATED_NO_EXPORT
78#define PDFTOOLBOX_DEPRECATED_NO_EXPORT PDFTOOLBOX_NO_EXPORT PDFTOOLBOX_DEPRECATED
79#endif
80
81#if 0 /* DEFINE_NO_DEPRECATED */
82#ifndef PDFTOOLBOX_NO_DEPRECATED
83#define PDFTOOLBOX_NO_DEPRECATED
84#endif
85#endif
86
87#else
88#include <stdlib.h>
89#ifndef WCHAR
90typedef unsigned short WCHAR;
91#endif
92#ifndef CDECL
93#define CDECL
94#endif
95#ifndef STDCALL
96#define STDCALL
97#endif
98typedef long long pos_t;
99
100#if defined(__APPLE__) || defined(__linux__)
101#ifdef PDFTOOLBOX_STATIC_DEFINE
102#define PDFTOOLBOX_EXPORT
103#define PDFTOOLBOX_NO_EXPORT
104#else
105#ifndef PDFTOOLBOX_EXPORT
106#ifdef PdfToolbox_EXPORTS
107/* We are building this library */
108#define PDFTOOLBOX_EXPORT __attribute__((visibility("default")))
109#else
110/* We are using this library */
111#define PDFTOOLBOX_EXPORT __attribute__((visibility("default")))
112#endif
113#endif
114
115#ifndef PDFTOOLBOX_NO_EXPORT
116#define PDFTOOLBOX_NO_EXPORT __attribute__((visibility("hidden")))
117#endif
118#endif
119
120#ifndef PDFTOOLBOX_DEPRECATED
121#define PDFTOOLBOX_DEPRECATED __attribute__((__deprecated__))
122#endif
123
124#ifndef PDFTOOLBOX_DEPRECATED_EXPORT
125#define PDFTOOLBOX_DEPRECATED_EXPORT PDFTOOLBOX_EXPORT PDFTOOLBOX_DEPRECATED
126#endif
127
128#ifndef PDFTOOLBOX_DEPRECATED_NO_EXPORT
129#define PDFTOOLBOX_DEPRECATED_NO_EXPORT PDFTOOLBOX_NO_EXPORT PDFTOOLBOX_DEPRECATED
130#endif
131
132#if 0 /* DEFINE_NO_DEPRECATED */
133#ifndef PDFTOOLBOX_NO_DEPRECATED
134#define PDFTOOLBOX_NO_DEPRECATED
135#endif
136#endif
137#else
138#define PDFTOOLBOX_EXPORT
139#endif
140
141#endif
142
143#endif
unsigned short WCHAR
Definition PdfToolbox_Platform.h:90
long long pos_t
Definition PdfToolbox_Platform.h:98