media/libdav1d/config.h
author Alex Chronopoulos <achronop@gmail.com>
Wed, 20 Mar 2019 14:24:23 +0000
changeset 465217 29cd1266e85e48a17bd027b13d87817fc9c1c849
parent 463983 d55401632cea92b6b2775ba278274b5490275876
child 465545 2b9f4f5a278652fcae03bfad21e415a5a934a5d1
permissions -rw-r--r--
Bug 1536538 - Improve a check in config file and correct typos. r=TD-Linux Differential Revision: https://phabricator.services.mozilla.com/D24071

#pragma once

// Set platform
#if defined(__aarch64__) || defined(_M_ARM64)
#  define ARCH_AARCH64 1
#else
#  define ARCH_AARCH64 0
#endif

#if defined(__arm__) || defined(_M_ARM)
#  define ARCH_ARM 1
#else
#  define ARCH_ARM 0
#endif

#if defined(__i386__) || defined(_M_IX86)
#  define ARCH_X86_32 1
#else
#  define ARCH_X86_32 0
#endif

#if defined(__x86_64__) || defined(_M_X64)
#  define ARCH_X86_64 1
#else
#  define ARCH_X86_64 0
#endif

#if ARCH_X86_32 == 1 || ARCH_X86_64 == 1
#  define ARCH_X86 1
#else
#  define ARCH_X86 0
#endif

// Set both bitdepeth in every case
#define CONFIG_16BPC 1
#define CONFIG_8BPC 1

// Enable asm
#if defined(MOZ_DAV1D_ASM)
#  define HAVE_ASM 1
#else
#  define HAVE_ASM 0
#endif

// The following macros are defined from autoconf
// according to the system configuration.
// (HAVE_MEMALIGN | HAVE_ALIGNED_MALLOC | HAVE_POSIX_MEMALIGN)
// HAVE_UNISTD_H

// Important when asm is enabled
#if defined(__APPLE__) || (ARCH_x86_32 == 1 && defined(_WIN32))
#  define PREFIX 1
#endif

#if ARCH_x86_32 == 1 || \
    (ARCH_X86_64 == 1 && defined(__linux__) && !defined(__ANDROID__))
#  define STACK_ALIGNMENT 16
#else
#  define STACK_ALIGNMENT 32
#endif

#if defined(_WIN32) || defined(__CYGWIN__)
// _WIN32_WINNT 0x0601 is set in global macros
#  define UNICODE 1
#  define _UNICODE 1
#  define __USE_MINGW_ANSI_STDIO 1
#endif