diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2024-03-11 18:43:53 -0700 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2024-03-11 18:48:41 -0700 |
commit | b66441a27fa85e2a3b63f10a0a5a846344327042 (patch) | |
tree | 10918ae720f2dee247757db18921d76107a93853 | |
parent | 006126987bd85cff4d17eca28cbed65fa27d0661 (diff) |
Fix builds with C23 compilers
Relies on C99 & later stdbool.h header to avoid making our own
definitions of bool, true, & false that C23 already defines for us.
./VBoxVideoIPRT.h:35:5: error: expected identifier before ‘false’
35 | false = 0,
| ^~~~~
./VBoxVideoIPRT.h:37:3: error: expected ‘;’, identifier or ‘(’ before ‘bool’
37 | } bool;
| ^~~~
./VBoxVideoIPRT.h:37:3: warning: useless type name in empty declaration
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r-- | src/VBoxVideoIPRT.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/VBoxVideoIPRT.h b/src/VBoxVideoIPRT.h index 7f64a94..cea9fe0 100644 --- a/src/VBoxVideoIPRT.h +++ b/src/VBoxVideoIPRT.h @@ -1,6 +1,6 @@ /* $Id: VBoxVideoIPRT.h 118373 2017-10-13 17:01:46Z michael $ */ /* - * Copyright (C) 2017, 2024 Oracle and/or its affiliates. + * Copyright (C) 2017, 2024, Oracle and/or its affiliates. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -30,11 +30,15 @@ # include "VBoxVideoErr.h" #ifndef __cplusplus +#if __STDC_VERSION__ >= 199901L +#include <stdbool.h> +#else typedef enum { false = 0, true } bool; +#endif # define RT_C_DECLS_BEGIN # define RT_C_DECLS_END #else |