cmake: remove unused macros from config.h template#231
Open
chrisdebian wants to merge 1 commit intolibsndfile:masterfrom
Open
cmake: remove unused macros from config.h template#231chrisdebian wants to merge 1 commit intolibsndfile:masterfrom
chrisdebian wants to merge 1 commit intolibsndfile:masterfrom
Conversation
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.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Six macros defined in
config.h.cmakeare never referenced in any C or header file in the library:CPU_IS_LITTLE_ENDIANHAVE_LRINTHAVE_LRINTFHAVE_STDINT_HSIZEOF_INTSIZEOF_LONGThese appear to be remnants from when libsamplerate provided its own
lrint/lrintffallbacks and portability shims for older compilers. That code was removed, but the correspondingconfig.hentries were not.The
if(CPU_IS_BIG_ENDIAN)/set(CPU_IS_LITTLE_ENDIAN)block inCMakeLists.txtis also removed, as it existed solely to populate the now-removedCPU_IS_LITTLE_ENDIANentry.Verification
Grepped all
.cand.hfiles undersrc/andinclude/— none of the six symbols appear anywhere.Spotted while using libsamplerate as a vendored CMake submodule in an Android project; the Android Studio C/C++ unused-macro inspection flagged these in the generated
config.h.