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 * <example id="example-gstconfig">
41 * <title>Doing subsystem specific things</title>
42 * <programlisting>
43 * &hash;ifndef GST_DISABLE_GST_DEBUG
44 * // do stuff specific to the debugging subsystem
45 * &hash;endif // GST_DISABLE_GST_DEBUG
46 * </programlisting>
47 * </example>
48 */
49
50#ifndef __GST_CONFIG_H__
51#define __GST_CONFIG_H__
52
53/* trick gtk-doc into believing these symbols are defined (yes, it's ugly) */
54
55#if 0
56#define GST_DISABLE_GST_DEBUG 1
57#define GST_DISABLE_PARSE 1
58#define GST_DISABLE_REGISTRY 1
59#define GST_DISABLE_PLUGIN 1
60#endif
61
62/***** default padding of structures *****/
63#define GST_PADDING		4
64#define GST_PADDING_INIT	{ NULL }
65
66/***** padding for very extensible base classes *****/
67#define GST_PADDING_LARGE	20
68
69/***** disabling of subsystems *****/
70
71/**
72 * GST_DISABLE_GST_DEBUG:
73 *
74 * Configures the inclusion of the debugging subsystem
75 */
76@GST_DISABLE_GST_DEBUG_DEFINE@
77
78/**
79 * GST_DISABLE_PARSE:
80 *
81 * Configures the inclusion of the gst-launch parser
82 */
83@GST_DISABLE_PARSE_DEFINE@
84
85/**
86 * GST_DISABLE_REGISTRY:
87 *
88 * Configures the use of the plugin registry.
89 * If one disables this, required plugins need to be loaded and registered
90 * manually
91 */
92@GST_DISABLE_REGISTRY_DEFINE@
93
94/**
95 * GST_DISABLE_CAST_CHECKS:
96 *
97 * Disable run-time GObject cast checks
98 */
99#define GST_DISABLE_CAST_CHECKS @GST_DISABLE_CAST_CHECKS_DEFINE@
100
101/**
102 * GST_DISABLE_GLIB_ASSERTS:
103 *
104 * Disable GLib assertion
105 */
106#define GST_DISABLE_GLIB_ASSERTS @GST_DISABLE_GLIB_ASSERTS_DEFINE@
107
108/**
109 * GST_DISABLE_GLIB_CHECKS:
110 *
111 * Disable GLib checks such as API guards
112 */
113#define GST_DISABLE_GLIB_CHECKS @GST_DISABLE_GLIB_CHECKS_DEFINE@
114
115
116/* FIXME: test and document these! */
117/* Configures the use of external plugins */
118@GST_DISABLE_PLUGIN_DEFINE@
119
120/* Whether or not the CPU supports unaligned access
121 * The macros used are defined consistently by GCC, Clang, MSVC, Sun, and ICC
122 *
123 * References:
124 * https://sourceforge.net/p/predef/wiki/Architectures/
125 * https://msdn.microsoft.com/en-us/library/b0084kay.aspx
126 * http://docs.oracle.com/cd/E19205-01/820-4155/c++_faq.html#Vers6
127 * https://software.intel.com/en-us/node/583402
128 */
129#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_IA64) || defined(__xtensa__) || defined(__e2k__) || defined(__riscv)
130#  define GST_HAVE_UNALIGNED_ACCESS 0
131#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__)
132#  define GST_HAVE_UNALIGNED_ACCESS 1
133#else
134#  error "Could not detect architecture; don't know whether it supports unaligned access! Please file a bug."
135#endif
136
137/**
138 * GST_EXPORT:
139 *
140 * Export the given variable from the built shared object.
141 *
142 * On Windows, this exports the variable from the DLL.
143 * On other platforms, this gets defined to "extern".
144 */
145/**
146 * GST_PLUGIN_EXPORT:
147 *
148 * Export the plugin's definition.
149 *
150 * On Windows, this exports the plugin definition from the DLL.
151 * On other platforms, this gets defined as a no-op.
152 */
153/* Only use __declspec(dllexport/import) when we have been built with MSVC or
154 * the user is linking to us with MSVC. The only remaining case is when we were
155 * built with MinGW and are linking with MinGW in which case we rely on the
156 * linker to auto-export/import symbols. Of course all this is only used when
157 * not linking statically.
158 *
159 * NOTE: To link to GStreamer statically on Windows, you must define
160 * GST_STATIC_COMPILATION or the prototypes will cause the compiler to search
161 * for the symbol inside a DLL.
162 */
163#if (@GSTCONFIG_BUILT_WITH_MSVC@ || defined(_MSC_VER)) && !defined(GST_STATIC_COMPILATION)
164# define GST_PLUGIN_EXPORT __declspec(dllexport)
165# ifdef GST_EXPORTS
166#  define GST_EXPORT __declspec(dllexport)
167# else
168#  define GST_EXPORT __declspec(dllimport) extern
169# endif
170#else
171# if defined(__GNUC__) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590))
172#  define GST_PLUGIN_EXPORT __attribute__ ((visibility ("default")))
173#  define GST_EXPORT extern __attribute__ ((visibility ("default")))
174# else
175#  define GST_PLUGIN_EXPORT
176#  define GST_EXPORT extern
177# endif
178#endif
179
180#if defined(_MSC_VER) && !defined(GST_STATIC_COMPILATION)
181# define GST_API_IMPORT __declspec(dllimport) extern
182#else
183# define GST_API_IMPORT extern
184#endif
185
186#ifndef GST_API
187# ifdef BUILDING_GST
188#  define GST_API GST_API_EXPORT        /* from config.h */
189# else
190#  define GST_API GST_API_IMPORT
191# endif
192#endif
193
194/* These macros are used to mark deprecated functions in GStreamer headers,
195 * and thus have to be exposed in installed headers. But please
196 * do *not* use them in other projects. Instead, use G_DEPRECATED
197 * or define your own wrappers around it. */
198#ifndef GST_DISABLE_DEPRECATED
199#define GST_DEPRECATED GST_API
200#define GST_DEPRECATED_FOR(f) GST_API
201#else
202#define GST_DEPRECATED G_DEPRECATED GST_API
203#define GST_DEPRECATED_FOR(f) G_DEPRECATED_FOR(f) GST_API
204#endif
205
206#endif /* __GST_CONFIG_H__ */
207