Commit 861afa5f authored by Érico Nogueira's avatar Érico Nogueira Committed by Harald Sitter
Browse files

Check for sincos() availability properly.

Instead of hardcoding knowledege about glibc versions, check for the
presence of sincos with CMake.

Commit 93577e2a wrongly added a
SINCOS_H_IMPLEMENTATION macro instead of making it a static inline
function or similar, so remove that as well.
parent 5d25ca04
Pipeline #191964 passed with stage
in 1 minute and 41 seconds
......@@ -9,6 +9,12 @@ ecm_setup_version(${PROJECT_VERSION}
VARIABLE_PREFIX FILELIGHT
VERSION_HEADER version.h)
include(CheckCXXSymbolExists)
check_cxx_symbol_exists(sincos "math.h" HAVE_SINCOS)
if (HAVE_SINCOS)
add_definitions(-DHAVE_SINCOS)
endif()
add_library(filelightInternal STATIC fileTree.cpp directoryIterator.cpp)
if (WIN32)
target_sources(filelightInternal PRIVATE windowsWalker.cpp)
......
......@@ -26,7 +26,6 @@
#include <KColorScheme>
#include <KLocalizedString>
#define SINCOS_H_IMPLEMENTATION (1)
#include "Config.h"
#include "map.h"
#include "radialMap.h" // defines
......
......@@ -9,18 +9,14 @@
#include <math.h>
#if !defined(__GLIBC__) || (__GLIBC__ < 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 1)
#ifndef HAVE_SINCOS
#include <qmath.h>
void sincos(double angleRadians, double *Sin, double *Cos);
#ifdef SINCOS_H_IMPLEMENTATION
void sincos(double angleRadians, double *Sin, double *Cos)
static inline void sincos(double angleRadians, double *Sin, double *Cos)
{
*Sin = qSin(angleRadians);
*Cos = qCos(angleRadians);
}
#endif
#endif
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment