mirror of
https://github.com/ZDoom/fluidsynth.git
synced 2025-03-01 23:20:44 +00:00
Test for SUPPORTS_VLA in CMake
This commit is contained in:
parent
38dab1e383
commit
3ec7ec22c7
4 changed files with 14 additions and 1 deletions
|
@ -98,6 +98,7 @@ check_include_file ( limits.h HAVE_LIMITS_H )
|
||||||
check_include_file ( pthread.h HAVE_PTHREAD_H )
|
check_include_file ( pthread.h HAVE_PTHREAD_H )
|
||||||
check_include_file ( signal.h HAVE_SIGNAL_H )
|
check_include_file ( signal.h HAVE_SIGNAL_H )
|
||||||
include ( TestInline )
|
include ( TestInline )
|
||||||
|
include ( TestVLA )
|
||||||
include ( TestBigEndian )
|
include ( TestBigEndian )
|
||||||
test_big_endian ( WORDS_BIGENDIAN )
|
test_big_endian ( WORDS_BIGENDIAN )
|
||||||
|
|
||||||
|
|
9
fluidsynth/cmake_admin/TestVLA.cmake
Normal file
9
fluidsynth/cmake_admin/TestVLA.cmake
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
include ( CheckCSourceCompiles )
|
||||||
|
if ( NOT SUPPORTS_VLA )
|
||||||
|
check_c_source_compiles (
|
||||||
|
"int main(int argc, char *argv[]){int arr[argc]; return 0;}"
|
||||||
|
_have_vla )
|
||||||
|
if ( _have_vla )
|
||||||
|
set ( SUPPORTS_VLA 1 )
|
||||||
|
endif ( _have_vla )
|
||||||
|
endif ( NOT SUPPORTS_VLA )
|
|
@ -193,6 +193,9 @@
|
||||||
/* Define to use the readline library for line editing */
|
/* Define to use the readline library for line editing */
|
||||||
#cmakedefine WITH_READLINE @WITH_READLINE@
|
#cmakedefine WITH_READLINE @WITH_READLINE@
|
||||||
|
|
||||||
|
/* Define if the compiler supports VLA */
|
||||||
|
#cmakedefine SUPPORTS_VLA @SUPPORTS_VLA@
|
||||||
|
|
||||||
/* Define to 1 if your processor stores words with the most significant byte
|
/* Define to 1 if your processor stores words with the most significant byte
|
||||||
first (like Motorola and SPARC, unlike Intel and VAX). */
|
first (like Motorola and SPARC, unlike Intel and VAX). */
|
||||||
#cmakedefine WORDS_BIGENDIAN @WORDS_BIGENDIAN@
|
#cmakedefine WORDS_BIGENDIAN @WORDS_BIGENDIAN@
|
||||||
|
|
|
@ -163,7 +163,7 @@ typedef int fluid_socket_t;
|
||||||
#define INVALID_SOCKET -1
|
#define INVALID_SOCKET -1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if SUPPORTS_VLA
|
#if defined(SUPPORTS_VLA)
|
||||||
# define FLUID_DECLARE_VLA(_type, _name, _len) \
|
# define FLUID_DECLARE_VLA(_type, _name, _len) \
|
||||||
_type _name[_len]
|
_type _name[_len]
|
||||||
#else
|
#else
|
||||||
|
|
Loading…
Reference in a new issue