Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
86 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# This file is part of RawTherapee. | ||
# | ||
# Copyright (C) 2018 Flössie <floessie.mail@gmail.com> | ||
# | ||
# RawTherapee is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation, either version 3 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# RawTherapee is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with RawTherapee. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
include(CheckCXXSourceCompiles) | ||
|
||
set(CMAKE_REQUIRED_QUIET_COPY "${CMAKE_REQUIRED_QUIET}") | ||
set(CMAKE_REQUIRED_QUIET ON) | ||
|
||
set(TEST_SOURCE | ||
" | ||
#include <cstddef> | ||
#include <type_traits> | ||
int main() | ||
{ | ||
#if defined(__SSE2__) && (defined(__i386) || defined(_M_IX86)) && defined(__linux) | ||
static_assert(std::alignment_of<std::max_align_t>::value >= 16, \"Unaligned heap objects possible\"); | ||
#endif | ||
return 0; | ||
} | ||
") | ||
|
||
CHECK_CXX_SOURCE_COMPILES("${TEST_SOURCE}" HAVE_ALIGNED_MALLOC) | ||
|
||
if(NOT HAVE_ALIGNED_MALLOC) | ||
set(HAVE_UNALIGNED_MALLOC 1) | ||
else() | ||
unset(HAVE_ALIGNED_MALLOC) | ||
endif() | ||
|
||
unset(TEST_SOURCE) | ||
|
||
set(CMAKE_REQUIRED_QUIET "${CMAKE_REQUIRED_QUIET_COPY}") | ||
unset(CMAKE_REQUIRED_QUIET_COPY) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/* | ||
* This file is part of RawTherapee. | ||
* | ||
* Copyright (C) 2018 Flössie <floessie.mail@gmail.com> | ||
* | ||
* RawTherapee is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* RawTherapee is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with RawTherapee. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
#include "config.h" | ||
|
||
#ifdef HAVE_UNALIGNED_MALLOC | ||
|
||
#include <malloc.h> | ||
|
||
void* malloc(size_t size) | ||
{ | ||
return memalign(16, size); | ||
} | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters