From 4a83a56ba3b9e6bb081f0cd573ad878cfb230375 Mon Sep 17 00:00:00 2001 From: chrisdebian Date: Wed, 8 Apr 2026 09:56:16 +0100 Subject: [PATCH] cmake: remove unused macros from config.h template Six macros defined in config.h.cmake are never referenced in any C or header file in the library: CPU_IS_LITTLE_ENDIAN, HAVE_LRINT, HAVE_LRINTF, HAVE_STDINT_H, SIZEOF_INT, SIZEOF_LONG These appear to be remnants from a time when libsamplerate provided its own lrint/lrintf fallbacks and portability shims for older compilers. That code was removed, but the corresponding config.h entries were not. Also remove the if(CPU_IS_BIG_ENDIAN)/set(CPU_IS_LITTLE_ENDIAN) block from CMakeLists.txt, which existed solely to populate the now-removed CPU_IS_LITTLE_ENDIAN entry. Verified by grepping all .c and .h files under src/ and include/: none of the six symbols appear. --- CMakeLists.txt | 5 ----- config.h.cmake | 17 ----------------- 2 files changed, 22 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 06f39a0b..fc6db85b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -72,11 +72,6 @@ if(CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_C_COMPILER_ID MATCHES "Clang") endif() test_big_endian(CPU_IS_BIG_ENDIAN) -if(CPU_IS_BIG_ENDIAN) - set(CPU_IS_LITTLE_ENDIAN 0) -else() - set(CPU_IS_LITTLE_ENDIAN 1) -endif() check_include_file(stdbool.h HAVE_STDBOOL_H) check_include_file(unistd.h HAVE_UNISTD_H) diff --git a/config.h.cmake b/config.h.cmake index ec3229fb..92e91cd1 100644 --- a/config.h.cmake +++ b/config.h.cmake @@ -15,9 +15,6 @@ /* Target processor is big endian. */ #cmakedefine01 CPU_IS_BIG_ENDIAN -/* Target processor is little endian. */ -#cmakedefine01 CPU_IS_LITTLE_ENDIAN - /* Define to 1 if you have the `alarm' function. */ #cmakedefine01 HAVE_ALARM @@ -27,12 +24,6 @@ /* Set to 1 if you have libfftw3. */ #cmakedefine01 HAVE_FFTW3 -/* Define if you have C99's lrint function. */ -#cmakedefine01 HAVE_LRINT - -/* Define if you have C99's lrintf function. */ -#cmakedefine01 HAVE_LRINTF - /* Define to 1 if you have the header file. */ #cmakedefine HAVE_IMMINTRIN_H @@ -48,9 +39,6 @@ /* Define to 1 if you have the header file. */ #cmakedefine HAVE_STDBOOL_H -/* Define to 1 if you have the header file. */ -#cmakedefine01 HAVE_STDINT_H - /* Define to 1 if you have the header file. */ #cmakedefine01 HAVE_SYS_TIMES_H @@ -69,8 +57,3 @@ /* define best samplerate convertor */ #cmakedefine ENABLE_SINC_BEST_CONVERTER -/* The size of `int', as computed by sizeof. */ -#define SIZEOF_INT ${SIZEOF_INT} - -/* The size of `long', as computed by sizeof. */ -#define SIZEOF_LONG ${SIZEOF_LONG}