libsndfile / libsamplerate

An audio Sample Rate Conversion library
http://libsndfile.github.io/libsamplerate/
BSD 2-Clause "Simplified" License
616 stars 169 forks source link

Add missing includes of stdbool.h #166

Closed yairchu closed 3 years ago

yairchu commented 3 years ago

Since 4ff9f4afdaa258 compilation failed due to "true" and "false" being undeclared:

% cmake .
...

% make
Consolidate compiler generated dependencies of target samplerate
[  1%] Building C object src/CMakeFiles/samplerate.dir/src_linear.c.o
/Users/yairchu/dev/soundradix/AutoAlignPost/SoundRadixLib/External/libsamplerate/src/src_linear.c:35:2: error: unknown type name 'bool'
        bool    dirty ;
        ^
/Users/yairchu/dev/soundradix/AutoAlignPost/SoundRadixLib/External/libsamplerate/src/src_linear.c:71:17: error: use of undeclared identifier 'true'
                priv->dirty = true ;
                              ^
/Users/yairchu/dev/soundradix/AutoAlignPost/SoundRadixLib/External/libsamplerate/src/src_linear.c:240:16: error: use of undeclared identifier 'false'
        priv->dirty = false ;
                      ^
3 errors generated.
make[2]: *** [src/CMakeFiles/samplerate.dir/src_linear.c.o] Error 1
make[1]: *** [src/CMakeFiles/samplerate.dir/all] Error 2
make: *** [all] Error 2

(on macOS 11.4 on an M1 Macbook Pro)

sezero commented 3 years ago

Both src_linear.c and src_zoh.c include config.h, and config.h includes stdbool.h if it is detected by cmake or configure: does your configure or cmake not detect presence of stdbool.h?

yairchu commented 3 years ago

Hmm, after a git clean -fdx it does work with either configure and cmake, so I'll close this.

evpobr commented 3 years ago

Hi @yairchu , thanks for report anyway :smile:

@sezero , thanks for help.