libfdt: Rename redefined macros 71/295271/1 accepted/tizen_8.0_unified accepted/tizen_9.0_unified accepted/tizen_unified accepted/tizen_unified_dev tizen tizen_8.0 tizen_9.0 accepted/tizen/8.0/unified/20231005.092432 accepted/tizen/9.0/unified/20241030.233545 accepted/tizen/unified/20230705.063750 accepted/tizen/unified/dev/20230726.115558 tizen_8.0_m2_release tizen_9.0_m2_release
authorSeung-Woo Kim <sw0312.kim@samsung.com>
Tue, 4 Jul 2023 08:24:50 +0000 (17:24 +0900)
committerSeung-Woo Kim <sw0312.kim@samsung.com>
Tue, 4 Jul 2023 08:52:09 +0000 (17:52 +0900)
To resolve gcc-13 build issue about redefined macros, rename
redefine macros for fdt.

Partly picked from raspberrypiupstream commit:
  https://github.com/raspberrypi/userland/commit/3d5c43768ce23095da745897372f70238d07a7fd

Change-Id: I30a27da98900d52c60fd4a6207251476ae9dba98
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
opensrc/helpers/libfdt/libfdt_env.h

index 1c966b8..f80d1a8 100755 (executable)
 #include <string.h>
 
 #ifdef __CHECKER__
-#define __force __attribute__((force))
-#define __bitwise __attribute__((bitwise))
+#define FDT_FORCE __attribute__((force))
+#define FDT_BITWISE __attribute__((bitwise))
 #else
-#define __force
-#define __bitwise
+#define FDT_FORCE
+#define FDT_BITWISE
 #endif
 
-typedef uint16_t __bitwise fdt16_t;
-typedef uint32_t __bitwise fdt32_t;
-typedef uint64_t __bitwise fdt64_t;
+typedef uint16_t FDT_BITWISE fdt16_t;
+typedef uint32_t FDT_BITWISE fdt32_t;
+typedef uint64_t FDT_BITWISE fdt64_t;
 
 //#define EXTRACT_BYTE(x, n)   ((unsigned long long)((uint8_t *)&x)[n])
 // xxx work around a compiler bug...
@@ -86,29 +86,29 @@ static inline unsigned long long EXTRACT_BYTE_f(void *x, int n)
 
 static inline uint16_t fdt16_to_cpu(fdt16_t x)
 {
-       return (__force uint16_t)CPU_TO_FDT16(x);
+       return (FDT_FORCE uint16_t)CPU_TO_FDT16(x);
 }
 static inline fdt16_t cpu_to_fdt16(uint16_t x)
 {
-       return (__force fdt16_t)CPU_TO_FDT16(x);
+       return (FDT_FORCE fdt16_t)CPU_TO_FDT16(x);
 }
 
 static inline uint32_t fdt32_to_cpu(fdt32_t x)
 {
-       return (__force uint32_t)CPU_TO_FDT32(x);
+       return (FDT_FORCE uint32_t)CPU_TO_FDT32(x);
 }
 static inline fdt32_t cpu_to_fdt32(uint32_t x)
 {
-       return (__force fdt32_t)CPU_TO_FDT32(x);
+       return (FDT_FORCE fdt32_t)CPU_TO_FDT32(x);
 }
 
 static inline uint64_t fdt64_to_cpu(fdt64_t x)
 {
-       return (__force uint64_t)CPU_TO_FDT64(x);
+       return (FDT_FORCE uint64_t)CPU_TO_FDT64(x);
 }
 static inline fdt64_t cpu_to_fdt64(uint64_t x)
 {
-       return (__force fdt64_t)CPU_TO_FDT64(x);
+       return (FDT_FORCE fdt64_t)CPU_TO_FDT64(x);
 }
 #undef CPU_TO_FDT64
 #undef CPU_TO_FDT32