libcue-1.4.0-__unused-fix.patch 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. [PATCH] fix build on uClibc
  2. Use cue_unused / cue_dead2 for the unused/non-returning annotation macros,
  3. as uClibc defines a struct member called __unused in stdio.h when built
  4. with locale support, breaking the build.
  5. According to ANSI C 4.1.2.1, defines beginning with '__' are reserved
  6. for the implementation, so shouldn't be used in user code.
  7. Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
  8. ---
  9. src/libcue/cue_scanner.c | 10 ++++++----
  10. 1 file changed, 6 insertions(+), 4 deletions(-)
  11. Index: libcue-1.4.0/src/libcue/cue_scanner.c
  12. ===================================================================
  13. --- libcue-1.4.0.orig/src/libcue/cue_scanner.c
  14. +++ libcue-1.4.0/src/libcue/cue_scanner.c
  15. @@ -7,9 +7,11 @@
  16. #if defined(__FreeBSD__)
  17. #include <sys/cdefs.h>
  18. +#define cue_unused __unused
  19. +#define cue_dead2 __dead2
  20. #else
  21. -#define __unused
  22. -#define __dead2
  23. +#define cue_unused
  24. +#define cue_dead2
  25. #endif
  26. #define FLEX_SCANNER
  27. @@ -248,7 +250,7 @@
  28. YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len ));
  29. static void *yy_flex_alloc YY_PROTO(( yy_size_t ));
  30. -static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t )) __unused;
  31. +static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t )) cue_unused;
  32. static void yy_flex_free YY_PROTO(( void * ));
  33. #define yy_new_buffer yy_create_buffer
  34. @@ -285,7 +287,7 @@
  35. static yy_state_type yy_get_previous_state YY_PROTO(( void ));
  36. static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));
  37. static int yy_get_next_buffer YY_PROTO(( void ));
  38. -static void yy_fatal_error YY_PROTO(( yyconst char msg[] )) __dead2;
  39. +static void yy_fatal_error YY_PROTO(( yyconst char msg[] )) cue_dead2;
  40. /* Done after the current pattern has been matched and before the
  41. * corresponding action - sets up yytext.