libg722_1 0.1.0
lt_system.h
1/* lt_system.h -- system portability abstraction layer
2
3 Copyright (C) 2004, 2007, 2010-2019, 2021-2024 Free Software
4 Foundation, Inc.
5 Written by Gary V. Vaughan, 2004
6
7 NOTE: The canonical source of this file is maintained with the
8 GNU Libtool package. Report bugs to bug-libtool@gnu.org.
9
10GNU Libltdl is free software; you can redistribute it and/or
11modify it under the terms of the GNU Lesser General Public
12License as published by the Free Software Foundation; either
13version 2 of the License, or (at your option) any later version.
14
15As a special exception to the GNU Lesser General Public License,
16if you distribute this file as part of a program or library that
17is built using GNU Libtool, you may include this file under the
18same distribution terms that you use for the rest of that program.
19
20GNU Libltdl is distributed in the hope that it will be useful,
21but WITHOUT ANY WARRANTY; without even the implied warranty of
22MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23GNU Lesser General Public License for more details.
24
25You should have received a copy of the GNU Lesser General Public
26License along with GNU Libltdl. If not, see <https://www.gnu.org/licenses/>.
27*/
28
29#if !defined LT_SYSTEM_H
30#define LT_SYSTEM_H 1
31
32#include <stddef.h>
33#include <stdlib.h>
34#include <sys/types.h>
35
36/* Some systems do not define EXIT_*, even with STDC_HEADERS. */
37#if !defined EXIT_SUCCESS
38# define EXIT_SUCCESS 0
39#endif
40#if !defined EXIT_FAILURE
41# define EXIT_FAILURE 1
42#endif
43
44/* Just pick a big number... */
45#define LT_FILENAME_MAX 2048
46
47
48/* Saves on those hard to debug '\0' typos.... */
49#define LT_EOS_CHAR '\0'
50
51/* LTDL_BEGIN_C_DECLS should be used at the beginning of your declarations,
52 so that C++ compilers don't mangle their names. Use LTDL_END_C_DECLS at
53 the end of C declarations. */
54#if defined __cplusplus
55# define LT_BEGIN_C_DECLS extern "C" {
56# define LT_END_C_DECLS }
57#else
58# define LT_BEGIN_C_DECLS /* empty */
59# define LT_END_C_DECLS /* empty */
60#endif
61
62/* LT_STMT_START/END are used to create macros that expand to a
63 a single compound statement in a portable way. */
64#if defined __GNUC__ && !defined __STRICT_ANSI__ && !defined __cplusplus
65# define LT_STMT_START (void)(
66# define LT_STMT_END )
67#else
68# if (defined sun || defined __sun__)
69# define LT_STMT_START if (1)
70# define LT_STMT_END else (void)0
71# else
72# define LT_STMT_START do
73# define LT_STMT_END while (0)
74# endif
75#endif
76
77/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */
78#if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE
79/* DATA imports from DLLs on WIN32 can't be const, because runtime
80 relocations are performed -- see ld's documentation on pseudo-relocs. */
81# define LT_DLSYM_CONST
82#elif defined __osf__
83/* This system does not cope well with relocations in const data. */
84# define LT_DLSYM_CONST
85#else
86# define LT_DLSYM_CONST const
87#endif
88
89/* Canonicalise Windows and Cygwin recognition macros.
90 To match the values set by recent Cygwin compilers, make sure that if
91 __CYGWIN__ is defined (after canonicalisation), __WINDOWS__ is NOT! */
92#if defined __CYGWIN32__ && !defined __CYGWIN__
93# define __CYGWIN__ __CYGWIN32__
94#endif
95#if defined __CYGWIN__
96# if defined __WINDOWS__
97# undef __WINDOWS__
98# endif
99#elif defined _WIN32
100# define __WINDOWS__ _WIN32
101#elif defined WIN32
102# define __WINDOWS__ WIN32
103#endif
104#if defined __CYGWIN__ && defined __WINDOWS__
105# undef __WINDOWS__
106#endif
107
108
109/* DLL building support on win32 hosts; mostly to workaround their
110 ridiculous implementation of data symbol exporting. */
111#if !defined LT_SCOPE
112# if defined __WINDOWS__ || defined __CYGWIN__
113# if defined DLL_EXPORT /* defined by libtool (if required) */
114# define LT_SCOPE extern __declspec(dllexport)
115# endif
116# if defined LIBLTDL_DLL_IMPORT /* define if linking with this dll */
117 /* note: cygwin/mingw compilers can rely instead on auto-import */
118# define LT_SCOPE extern __declspec(dllimport)
119# endif
120# endif
121# if !defined LT_SCOPE /* static linking or !__WINDOWS__ */
122# define LT_SCOPE extern
123# endif
124#endif
125
126#if defined __WINDOWS__
127/* LT_DIRSEP_CHAR is accepted *in addition* to '/' as a directory
128 separator when it is set. */
129# define LT_DIRSEP_CHAR '\\'
130# define LT_PATHSEP_CHAR ';'
131#else
132# define LT_PATHSEP_CHAR ':'
133#endif
134
135#if defined _MSC_VER /* Visual Studio */
136# define R_OK 4
137#endif
138
139/* fopen() mode flags for reading a text file */
140#undef LT_READTEXT_MODE
141#if defined __WINDOWS__ || defined __CYGWIN__
142# define LT_READTEXT_MODE "rt"
143#else
144# define LT_READTEXT_MODE "r"
145#endif
146
147/* The extra indirection to the LT__STR and LT__CONC macros is required so
148 that if the arguments to LT_STR() (or LT_CONC()) are themselves macros,
149 they will be expanded before being quoted. */
150#ifndef LT_STR
151# define LT__STR(arg) #arg
152# define LT_STR(arg) LT__STR(arg)
153#endif
154
155#ifndef LT_CONC
156# define LT__CONC(a, b) a##b
157# define LT_CONC(a, b) LT__CONC(a, b)
158#endif
159#ifndef LT_CONC3
160# define LT__CONC3(a, b, c) a##b##c
161# define LT_CONC3(a, b, c) LT__CONC3(a, b, c)
162#endif
163
164#endif /*!defined LT_SYSTEM_H*/