Pdftools SDK
Loading...
Searching...
No Matches
PdfTools_Platform.h
Go to the documentation of this file.
1/******************************************************************************
2 *
3 * File: PdfTools_Platform.h
4 *
5 * Description: Header with platform specific defines.
6 *
7 * Author: PDF Tools AG
8 *
9 * Copyright: Copyright (C) 2023 - 2024 PDF Tools AG, Switzerland
10 * All rights reserved.
11 *
12 * Classification: CONFIDENTIAL
13 *
14 *****************************************************************************/
15
16#ifndef PDFTOOLS_PLATFORM_H__
17#define PDFTOOLS_PLATFORM_H__
18
19#include <stdarg.h>
20#include <stdio.h>
21
22#ifndef PDFTOOLS_CALL
23#if defined(WIN32)
24#define PDFTOOLS_CALL __stdcall
25#else
26#define PDFTOOLS_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 PDFTOOLS_STATIC_DEFINE
51#define PDFTOOLS_EXPORT
52#define PDFTOOLS_NO_EXPORT
53#else
54#ifndef PDFTOOLS_EXPORT
55#ifdef PdfToolsSdk_EXPORTS
56/* We are building this library */
57#define PDFTOOLS_EXPORT __declspec(dllexport)
58#else
59/* We are using this library */
60#define PDFTOOLS_EXPORT __declspec(dllimport)
61#endif
62#endif
63
64#ifndef PDFTOOLS_NO_EXPORT
65#define PDFTOOLS_NO_EXPORT
66#endif
67#endif
68
69#ifndef PDFTOOLS_DEPRECATED
70#define PDFTOOLS_DEPRECATED __declspec(deprecated)
71#endif
72
73#ifndef PDFTOOLS_DEPRECATED_EXPORT
74#define PDFTOOLS_DEPRECATED_EXPORT PDFTOOLS_EXPORT PDFTOOLS_DEPRECATED
75#endif
76
77#ifndef PDFTOOLS_DEPRECATED_NO_EXPORT
78#define PDFTOOLS_DEPRECATED_NO_EXPORT PDFTOOLS_NO_EXPORT PDFTOOLS_DEPRECATED
79#endif
80
81#if 0 /* DEFINE_NO_DEPRECATED */
82#ifndef PDFTOOLS_NO_DEPRECATED
83#define PDFTOOLS_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 PDFTOOLS_STATIC_DEFINE
102#define PDFTOOLS_EXPORT
103#define PDFTOOLS_NO_EXPORT
104#else
105#ifndef PDFTOOLS_EXPORT
106#ifdef PdfTools_EXPORTS
107/* We are building this library */
108#define PDFTOOLS_EXPORT __attribute__((visibility("default")))
109#else
110/* We are using this library */
111#define PDFTOOLS_EXPORT __attribute__((visibility("default")))
112#endif
113#endif
114
115#ifndef PDFTOOLS_NO_EXPORT
116#define PDFTOOLS_NO_EXPORT __attribute__((visibility("hidden")))
117#endif
118#endif
119
120#ifndef PDFTOOLS_DEPRECATED
121#define PDFTOOLS_DEPRECATED __attribute__((__deprecated__))
122#endif
123
124#ifndef PDFTOOLS_DEPRECATED_EXPORT
125#define PDFTOOLS_DEPRECATED_EXPORT PDFTOOLS_EXPORT PDFTOOLS_DEPRECATED
126#endif
127
128#ifndef PDFTOOLS_DEPRECATED_NO_EXPORT
129#define PDFTOOLS_DEPRECATED_NO_EXPORT PDFTOOLS_NO_EXPORT PDFTOOLS_DEPRECATED
130#endif
131
132#if 0 /* DEFINE_NO_DEPRECATED */
133#ifndef PDFTOOLS_NO_DEPRECATED
134#define PDFTOOLS_NO_DEPRECATED
135#endif
136#endif
137#else
138#define PDFTOOLS_EXPORT
139#endif
140
141#endif
142
143#endif
unsigned short WCHAR
Definition PdfTools_Platform.h:90
long long pos_t
Definition PdfTools_Platform.h:98