1/* GStreamer
2 * Copyright (C) 1999,2000 Erik Walthinsen <omega@cse.ogi.edu>
3 * 2004,2005 Wim Taymans <wim@fluendo.com>
4 *
5 * gstconfig.h: GST_DISABLE_* macros for build configuration
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version.
11 *
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Library General Public License for more details.
16 *
17 * You should have received a copy of the GNU Library General Public
18 * License along with this library; if not, write to the
19 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
20 * Boston, MA 02110-1301, USA.
21 */
22
23/**
24 * SECTION:gstconfig
25 * @short_description: Build configuration options
26 *
27 * This describes the configuration options for GStreamer. When building
28 * GStreamer there are a lot of parts (known internally as "subsystems" ) that
29 * can be disabled for various reasons. The most common reasons are speed and
30 * size, which is important because GStreamer is designed to run on embedded
31 * systems.
32 *
33 * If a subsystem is disabled, most of this changes are done in an API
34 * compatible way, so you don't need to adapt your code in most cases. It is
35 * never done in an ABI compatible way though. So if you want to disable a
36 * subsystem, you have to rebuild all programs depending on GStreamer, too.
37 *
38 * If a subsystem is disabled in GStreamer, a value is defined in
39 * &lt;gst/gst.h&gt;. You can check this if you do subsystem-specific stuff.
40 *
41 * ``` C
42 * #ifndef GST_DISABLE_GST_DEBUG
43 * // do stuff specific to the debugging subsystem
44 * #endif // GST_DISABLE_GST_DEBUG
45 * ```
46 */
47
48#ifndef __GST_CONFIG_H__
49#define __GST_CONFIG_H__
50
51/* trick gtk-doc into believing these symbols are defined (yes, it's ugly) */
52
53#if 0
54#define GST_DISABLE_GST_DEBUG 1
55#define GST_DISABLE_PARSE 1
56#define GST_DISABLE_REGISTRY 1
57#define GST_DISABLE_PLUGIN 1
58#endif
59
60/***** default padding of structures *****/
61#define GST_PADDING 4
62#define GST_PADDING_INIT { NULL }
63
64/***** padding for very extensible base classes *****/
65#define GST_PADDING_LARGE 20
66
67/***** disabling of subsystems *****/
68
69/**
70 * GST_DISABLE_GST_DEBUG:
71 *
72 * Configures the inclusion of the debugging subsystem
73 */
74#undef GST_DISABLE_GST_DEBUG
75
76/**
77 * GST_DISABLE_PARSE:
78 *
79 * Configures the inclusion of the gst-launch parser
80 */
81#undef GST_DISABLE_PARSE
82
83/**
84 * GST_DISABLE_REGISTRY:
85 *
86 * Configures the use of the plugin registry.
87 * If one disables this, required plugins need to be loaded and registered
88 * manually
89 */
90#undef GST_DISABLE_REGISTRY
91
92/**
93 * GST_DISABLE_CAST_CHECKS:
94 *
95 * Disable run-time GObject cast checks
96 */
97#define GST_DISABLE_CAST_CHECKS 0
98
99/**
100 * GST_DISABLE_GLIB_ASSERTS:
101 *
102 * Disable GLib assertion
103 */
104#define GST_DISABLE_GLIB_ASSERTS 0
105
106/**
107 * GST_DISABLE_GLIB_CHECKS:
108 *
109 * Disable GLib checks such as API guards
110 */
111#define GST_DISABLE_GLIB_CHECKS 0
112
113
114/* FIXME: test and document these! */
115/* Configures the use of external plugins */
116#undef GST_DISABLE_PLUGIN
117
118/* Whether or not the CPU supports unaligned access
119 * The macros used are defined consistently by GCC, Clang, MSVC, Sun, and ICC
120 *
121 * References:
122 * https://sourceforge.net/p/predef/wiki/Architectures/
123 * https://msdn.microsoft.com/en-us/library/b0084kay.aspx
124 * http://docs.oracle.com/cd/E19205-01/820-4155/c++_faq.html#Vers6
125 * https://software.intel.com/en-us/node/583402
126 */
127#if defined(__alpha__) || defined(__arc__) || defined(__arm__) || defined(__aarch64__) || defined(__bfin) || defined(__hppa__) || defined(__nios2__) || defined(__MICROBLAZE__) || defined(__mips__) || defined(__or1k__) || defined(__sh__) || defined(__SH4__) || defined(__sparc__) || defined(__sparc) || defined(__ia64__) || defined(_M_ALPHA) || defined(_M_ARM) || defined(_M_ARM64) || defined(_M_IA64) || defined(__xtensa__) || defined(__e2k__) || defined(__riscv) || defined(__ARC64__) || defined(__loongarch__)
128# define GST_HAVE_UNALIGNED_ACCESS 0
129#elif defined(__i386__) || defined(__i386) || defined(__amd64__) || defined(__amd64) || defined(__x86_64__) || defined(__ppc__) || defined(__ppc64__) || defined(__powerpc__) || defined(__powerpc64__) || defined(__m68k__) || defined(_M_IX86) || defined(_M_AMD64) || defined(_M_X64) || defined(__s390__) || defined(__s390x__) || defined(__zarch__)
130# define GST_HAVE_UNALIGNED_ACCESS 1
131#else
132# error "Could not detect architecture; don't know whether it supports unaligned access! Please file a bug."
133#endif
134
135#if (defined(_WIN32) || defined(__CYGWIN__)) && !defined(GST_STATIC_COMPILATION)
136# define _GST_EXPORT __declspec(dllexport)
137# define _GST_IMPORT __declspec(dllimport)
138#elif __GNUC__ >= 4
139# define _GST_EXPORT __attribute__((visibility("default")))
140# define _GST_IMPORT
141#else
142# define _GST_EXPORT
143# define _GST_IMPORT
144#endif
145
146#define GST_API_EXPORT _GST_EXPORT extern
147#define GST_API_IMPORT _GST_IMPORT extern
148
149#ifdef BUILDING_GST
150# define GST_API GST_API_EXPORT
151#else
152# define GST_API GST_API_IMPORT
153#endif
154
155/**
156 * GST_PLUGIN_EXPORT:
157 *
158 * Export the plugin's definition.
159 *
160 * On Windows, this exports the plugin definition from the DLL.
161 * On other platforms, this gets defined as a no-op.
162 */
163#define GST_PLUGIN_EXPORT _GST_EXPORT
164
165/**
166 * GST_EXPORT:
167 *
168 * Export the given variable from the built shared object.
169 *
170 * On Windows, this exports the variable from the DLL.
171 * On other platforms, this gets defined to "extern".
172 * Deprecated: 1.22: Applications should define their own export macros.
173 */
174#ifdef GST_EXPORTS
175# define GST_EXPORT GST_API_EXPORT
176#else
177# define GST_EXPORT GST_API_IMPORT
178#endif
179
180/* These macros are used to mark deprecated functions in GStreamer headers,
181 * and thus have to be exposed in installed headers. But please
182 * do *not* use them in other projects. Instead, use G_DEPRECATED
183 * or define your own wrappers around it. */
184#ifndef GST_DISABLE_DEPRECATED
185#define GST_DEPRECATED GST_API
186#define GST_DEPRECATED_FOR(f) GST_API
187#else
188#define GST_DEPRECATED G_DEPRECATED GST_API
189#define GST_DEPRECATED_FOR(f) G_DEPRECATED_FOR(f) GST_API
190#endif
191
192#endif /* __GST_CONFIG_H__ */
193

source code of include/gstreamer-1.0/gst/gstconfig.h