gstconfig.h: Detect unaligned access support at compile-time
[platform/upstream/gstreamer.git] / gst / gstconfig.h.in
index 8a951fb..0ec1509 100644 (file)
 #if 0
 #define GST_DISABLE_GST_DEBUG 1
 #define GST_DISABLE_PARSE 1
-#define GST_DISABLE_TRACE 1
-#define GST_DISABLE_ALLOC_TRACE 1
 #define GST_DISABLE_REGISTRY 1
 #define GST_DISABLE_PLUGIN 1
-#define GST_HAVE_GLIB_2_8 1
 #endif
 
 /***** default padding of structures *****/
 @GST_DISABLE_PARSE_DEFINE@
 
 /**
- * GST_DISABLE_TRACE:
- *
- * Configures the inclusion of a resource tracing facility
- * (seems to be unused)
- */
-@GST_DISABLE_TRACE_DEFINE@
-
-/**
- * GST_DISABLE_ALLOC_TRACE:
- *
- * Configures the use of a memory tracer based on the resource tracer
- * if TRACE is disabled, ALLOC_TRACE is disabled as well
- */
-@GST_DISABLE_ALLOC_TRACE_DEFINE@
-
-/**
  * GST_DISABLE_REGISTRY:
  *
  * Configures the use of the plugin registry.
 /* Configures the use of external plugins */
 @GST_DISABLE_PLUGIN_DEFINE@
 
-/* whether or not the CPU supports unaligned access */
-@GST_HAVE_UNALIGNED_ACCESS_DEFINE@
+/* Whether or not the CPU supports unaligned access
+ * The macros used are defined consistently by GCC, Clang, MSVC, Sun, and ICC
+ *
+ * References:
+ * https://sourceforge.net/p/predef/wiki/Architectures/
+ * https://msdn.microsoft.com/en-us/library/b0084kay.aspx
+ * http://docs.oracle.com/cd/E19205-01/820-4155/c++_faq.html#Vers6
+ * https://software.intel.com/en-us/node/583402
+ */
+#if defined(__alpha__) || defined(__arm__) || defined(__aarch64__) || defined(__bfin) || defined(__hppa__) || defined(__mips__) || defined(__sh__) || defined(__sparc__) || defined(__sparc) || defined(__ia64__) || defined(_M_ALPHA) || defined(_M_ARM) || defined(_M_IA64)
+#  define GST_HAVE_UNALIGNED_ACCESS 0
+#elif defined(__i386__) || defined(__i386) || defined(__amd64__) || defined(__amd64) || defined(__x86_64__) || defined(__ppc__) || defined(__ppc64__) || defined(__m68k__) || defined(_M_IX86) || defined(_M_AMD64) || defined(_M_X64)
+#  define GST_HAVE_UNALIGNED_ACCESS 1
+#else
+#  error "Could not detect architecture; don't know whether it supports unaligned access! Please file a bug."
+#endif
 
 /**
  * GST_EXPORT:
  * for the symbol inside a DLL
  */
 #if defined(_WIN32) && !defined(GST_STATIC_COMPILATION)
-# define GST_PLUGIN_EXPORT __declspec(dllexport) extern
+# define GST_PLUGIN_EXPORT __declspec(dllexport)
 # ifdef GST_EXPORTS
-#  define GST_EXPORT __declspec(dllexport) extern
+#  define GST_EXPORT __declspec(dllexport)
 # else
 #  define GST_EXPORT __declspec(dllimport) extern
 # endif