Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
is_supported_platform.h
Go to the documentation of this file.
1/*
2 This file is part of darktable,
3 Copyright (C) 2016-2020 darktable developers.
4
5 darktable is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation, either version 3 of the License, or
8 (at your option) any later version.
9
10 darktable is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with darktable. If not, see <http://www.gnu.org/licenses/>.
17*/
18
19#pragma once
20
21// WARNING: do not #include anything in here!
22
23#if !defined(__BYTE_ORDER__) || __BYTE_ORDER__ != __ORDER_LITTLE_ENDIAN__
24#error "Unfortunately we only work on litte-endian systems."
25#endif
26
27#if (defined(__amd64__) || defined(__amd64) || defined(__x86_64__) || defined(__x86_64))
28#define DT_SUPPORTED_X86 1
29#else
30#define DT_SUPPORTED_X86 0
31#endif
32
33#if defined(__aarch64__) && (defined(__ARM_64BIT_STATE) && defined(__ARM_ARCH) && defined(__ARM_ARCH_8A) || defined(__APPLE__))
34#define DT_SUPPORTED_ARMv8A 1
35#else
36#define DT_SUPPORTED_ARMv8A 0
37#endif
38
39#if defined(__PPC64__)
40#define DT_SUPPORTED_PPC64 1
41#else
42#define DT_SUPPORTED_PPC64 0
43#endif
44
45#if DT_SUPPORTED_X86 && DT_SUPPORTED_ARMv8A
46#error "Looks like hardware platform detection macros are broken?"
47#endif
48
49#if !DT_SUPPORTED_X86 && !DT_SUPPORTED_ARMv8A && !DT_SUPPORTED_PPC64
50#error "Unfortunately we only work on amd64, ARMv8-A and PPC64 (64-bit little-endian only)."
51#endif
52
53#undef DT_SUPPORTED_PPC64
54#undef DT_SUPPORTED_ARMv8A
55#undef DT_SUPPORTED_X86
56
57#if !defined(__SSE2__) || !defined(__SSE__)
58#pragma message "Building without SSE2 is highly experimental."
59#pragma message "Expect a LOT of functionality to be broken. You have been warned."
60#endif
61
62// double check for 32-bit architecture
63#if defined(__SIZEOF_POINTER__) && __SIZEOF_POINTER__ < 8
64#error "Unfortunately we only work on the 64-bit architectures amd64, ARMv8-A and PPC64."
65#endif
66
67// clang-format off
68// modelines: These editor modelines have been set for all relevant files by tools/update_modelines.py
69// vim: shiftwidth=2 expandtab tabstop=2 cindent
70// kate: tab-indents: off; indent-width 2; replace-tabs on; indent-mode cstyle; remove-trailing-spaces modified;
71// clang-format on
72