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 * Notice: By downloading and using this artifact, you accept PDF Tools AG's
13 * [license agreement](https://www.pdf-tools.com/license-agreement/),
14 * [privacy policy](https://www.pdf-tools.com/privacy-policy/),
15 * and allow PDF Tools AG to track your usage data.
16 *
17 * Classification: CONFIDENTIAL
18 *
19 *****************************************************************************/
20
21#ifndef PDFTOOLS_PLATFORM_H__
22#define PDFTOOLS_PLATFORM_H__
23
24#include <stdarg.h>
25#include <stdio.h>
26
27#ifndef PDFTOOLS_CALL
28#if defined(WIN32)
29#define PDFTOOLS_CALL __stdcall
30#else
31#define PDFTOOLS_CALL
32#endif
33#endif
34
35#if defined(UNICODE) && !defined(_UNICODE)
36#define _UNICODE
37#endif
38/* Character strings on Windows can be either WinAnsi (CP1252) or Unicode (UTF16). */
39/* On Unix only char strings (8-bit, ISO encoded) are used for OS interfaces. */
40/* WCHAR strings are always UTF16 and may be different to wchar_t. */
41/* This simplifies interoperability with Java. */
42#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__)
43#include <tchar.h>
44#ifndef WCHAR
45#define WCHAR wchar_t
46#endif
47#ifndef CDECL
48#define CDECL __cdecl
49#endif
50#ifndef STDCALL
51#define STDCALL __stdcall
52#endif
53typedef __int64 pos_t;
54
55#ifdef PDFTOOLS_STATIC_DEFINE
56#define PDFTOOLS_EXPORT
57#define PDFTOOLS_NO_EXPORT
58#else
59#ifndef PDFTOOLS_EXPORT
60#ifdef PdfToolsSdk_EXPORTS
61/* We are building this library */
62#define PDFTOOLS_EXPORT __declspec(dllexport)
63#else
64/* We are using this library */
65#define PDFTOOLS_EXPORT __declspec(dllimport)
66#endif
67#endif
68
69#ifndef PDFTOOLS_NO_EXPORT
70#define PDFTOOLS_NO_EXPORT
71#endif
72#endif
73
74#ifndef PDFTOOLS_DEPRECATED
75#define PDFTOOLS_DEPRECATED __declspec(deprecated)
76#endif
77
78#ifndef PDFTOOLS_DEPRECATED_EXPORT
79#define PDFTOOLS_DEPRECATED_EXPORT PDFTOOLS_EXPORT PDFTOOLS_DEPRECATED
80#endif
81
82#ifndef PDFTOOLS_DEPRECATED_NO_EXPORT
83#define PDFTOOLS_DEPRECATED_NO_EXPORT PDFTOOLS_NO_EXPORT PDFTOOLS_DEPRECATED
84#endif
85
86#if 0 /* DEFINE_NO_DEPRECATED */
87#ifndef PDFTOOLS_NO_DEPRECATED
88#define PDFTOOLS_NO_DEPRECATED
89#endif
90#endif
91
92#else
93#include <stdlib.h>
94#ifndef WCHAR
95typedef unsigned short WCHAR;
96#endif
97#ifndef CDECL
98#define CDECL
99#endif
100#ifndef STDCALL
101#define STDCALL
102#endif
103typedef long long pos_t;
104
105#if defined(__APPLE__) || defined(__linux__)
106#ifdef PDFTOOLS_STATIC_DEFINE
107#define PDFTOOLS_EXPORT
108#define PDFTOOLS_NO_EXPORT
109#else
110#ifndef PDFTOOLS_EXPORT
111#ifdef PdfTools_EXPORTS
112/* We are building this library */
113#define PDFTOOLS_EXPORT __attribute__((visibility("default")))
114#else
115/* We are using this library */
116#define PDFTOOLS_EXPORT __attribute__((visibility("default")))
117#endif
118#endif
119
120#ifndef PDFTOOLS_NO_EXPORT
121#define PDFTOOLS_NO_EXPORT __attribute__((visibility("hidden")))
122#endif
123#endif
124
125#ifndef PDFTOOLS_DEPRECATED
126#define PDFTOOLS_DEPRECATED __attribute__((__deprecated__))
127#endif
128
129#ifndef PDFTOOLS_DEPRECATED_EXPORT
130#define PDFTOOLS_DEPRECATED_EXPORT PDFTOOLS_EXPORT PDFTOOLS_DEPRECATED
131#endif
132
133#ifndef PDFTOOLS_DEPRECATED_NO_EXPORT
134#define PDFTOOLS_DEPRECATED_NO_EXPORT PDFTOOLS_NO_EXPORT PDFTOOLS_DEPRECATED
135#endif
136
137#if 0 /* DEFINE_NO_DEPRECATED */
138#ifndef PDFTOOLS_NO_DEPRECATED
139#define PDFTOOLS_NO_DEPRECATED
140#endif
141#endif
142#else
143#define PDFTOOLS_EXPORT
144#endif
145
146#endif
147
148#endif
unsigned short WCHAR
Definition PdfTools_Platform.h:95
long long pos_t
Definition PdfTools_Platform.h:103