aports/main/freeswitch/gcc15.patch
mio 4decf8f1be main/freeswitch: fix build with gcc 15
Fix bool typedef error.

```
[...]/freeswitch-1.10.12.-release/libs/xmlrpc-c/lib/util/include/bool.h:13:5: error: cannot use keyword 'false' as enumeration constant
   13 |     false = 0,
      |     ^~~~~
[...]/freeswitch-1.10.12.-release/libs/xmlrpc-c/lib/util/include/bool.h:13:5: note: 'false' is a keyword with '-std=c23' onwards
[...]/freeswitch-1.10.12.-release/libs/xmlrpc-c/lib/util/include/bool.h:15:3: error: expected ';',identifier or '(' before 'bool'
   15 | } bool;
      |   ^~~~
```
2025-07-31 00:39:23 +00:00

54 lines
1.5 KiB
Diff

diff -ruN a/libs/xmlrpc-c/lib/util/include/bool.h b/libs/xmlrpc-c/lib/util/include/bool.h
--- a/libs/xmlrpc-c/lib/util/include/bool.h 2024-08-03 15:14:24.000000000 +0000
+++ b/libs/xmlrpc-c/lib/util/include/bool.h 2025-07-30 14:52:29.330000000 +0000
@@ -5,6 +5,7 @@
collision.
*/
+#if __STDC_VERSION__ < 202311L
#ifndef __cplusplus
/* At least the GNU compiler defines __bool_true_false_are_defined */
#ifndef __bool_true_false_are_defined
@@ -15,4 +16,5 @@
} bool;
#endif
#endif
+#endif
diff -ruN a/src/mod/codecs/mod_opus/opus_parse.h b/src/mod/codecs/mod_opus/opus_parse.h
--- a/src/mod/codecs/mod_opus/opus_parse.h 2024-08-03 15:14:25.000000000 +0000
+++ b/src/mod/codecs/mod_opus/opus_parse.h 2025-07-30 13:24:28.390000000 +0000
@@ -30,21 +30,31 @@
#ifndef SWITCH_OPUS_PARSE_H
#define SWITCH_OPUS_PARSE_H
-typedef enum { false, true } bool_t;
+#if __STDC_VERSION__ < 202311L
+ typedef enum { false, true } bool_t;
+#endif
typedef struct opus_packet_info {
int16_t vad;
int16_t vad_ms;
int16_t fec;
int16_t fec_ms;
+#if __STDC_VERSION__ < 202311L
bool_t stereo;
+#else
+ bool stereo;
+#endif
/* number of opus frames in the packet */
int16_t frames;
int16_t config;
int16_t channels;
int16_t ms_per_frame;
int32_t ptime_ts;
+#if __STDC_VERSION__ < 202311L
bool_t valid;
+#else
+ bool valid;
+#endif
/* number of silk_frames in an opus frame */
int16_t frames_silk;
/* VAD flag of all 20 ms silk-frames of the packet; LSB the first frame, MSB: the last */