summarylogtreecommitdiffstats
path: root/1137.patch
blob: dbe969e6df753f767187af04faa827eb656c5480 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
From 703d60c68011f34e32eeb881b3d14ca180aeef8d Mon Sep 17 00:00:00 2001
From: Kamal Heib <kheib@redhat.com>
Date: Wed, 12 Feb 2025 20:14:15 -0500
Subject: [PATCH] Fix build failure with Fedora 43

../common/bit_slice.h:64:5: error: cannot use keyword 'false' as enumeration constant
   64 |     false = 0,
      |     ^~~~~
../common/bit_slice.h:64:5: note: 'false' is a keyword with '-std=c23' onwards
../common/bit_slice.h:67:23: error: 'bool' cannot be defined via 'typedef'
   67 | typedef unsigned char bool;
      |                       ^~~~
../common/bit_slice.h:67:23: note: 'bool' is a keyword with '-std=c23' onwards
../common/bit_slice.h:67:1: warning: useless type name in empty declaration
   67 | typedef unsigned char bool;
      | ^~~~~~~

Signed-off-by: Kamal Heib <kheib@redhat.com>
---
 common/bit_slice.h         | 10 ----------
 mstdump/crd_main/mstdump.c |  3 ++-
 mtcr_ul/mtcr_gpu.c         |  2 +-
 mtcr_ul/mtcr_gpu.h         |  5 +++++
 mtcr_ul/mtcr_ul_icmd_cif.c |  4 ++--
 mvpd/mvpd.c                | 18 ++++++------------
 reg_access/reg_access.h    |  5 ++++-
 7 files changed, 20 insertions(+), 27 deletions(-)

diff --git a/common/bit_slice.h b/common/bit_slice.h
index 9f1764339..96f0bad4b 100644
--- a/common/bit_slice.h
+++ b/common/bit_slice.h
@@ -33,7 +33,6 @@
 #ifndef BIT_SLICE_H
 #define BIT_SLICE_H
 
-// BIT Slicing macros
 #define ONES32(size) ((size) ? (0xffffffff >> (32 - (size))) : 0)
 #define MASK32(offset, size) (ONES32(size) << (offset))
 
@@ -58,13 +57,4 @@
 #define INSERTF64(src1, start1, src2, start2, len) MERGE64((src1), EXTRACT64((src2), (start2), (len)), (start1), (len))
 #define EXT64(src, end, start) EXTRACT64(src, start, end - start + 1)
 
-#ifndef __cplusplus
-enum cpp_bool
-{
-    false = 0,
-    true
-};
-typedef unsigned char bool;
-#endif
-
 #endif
diff --git a/mstdump/crd_main/mstdump.c b/mstdump/crd_main/mstdump.c
index 8bcfdd0c1..aa3f447b2 100644
--- a/mstdump/crd_main/mstdump.c
+++ b/mstdump/crd_main/mstdump.c
@@ -30,7 +30,8 @@
  * SOFTWARE.
  *
  */
-//#include <stdbool.h>
+#include <stdbool.h>
+
 #include <crdump.h>
 #include <dev_mgt/tools_dev_types.h>
 #include <common/tools_version.h>
diff --git a/mtcr_ul/mtcr_gpu.c b/mtcr_ul/mtcr_gpu.c
index 2635f4300..db52cf09e 100644
--- a/mtcr_ul/mtcr_gpu.c
+++ b/mtcr_ul/mtcr_gpu.c
@@ -31,8 +31,8 @@
  *
  *
  */
+#include "mtcr_gpu.h"
 
-#include "common/compatibility.h"
 #include "dev_mgt/tools_dev_types.h"
 
 typedef struct pci_id_range_st {
diff --git a/mtcr_ul/mtcr_gpu.h b/mtcr_ul/mtcr_gpu.h
index 465f5e94c..aff0271d2 100644
--- a/mtcr_ul/mtcr_gpu.h
+++ b/mtcr_ul/mtcr_gpu.h
@@ -34,6 +34,11 @@
 #ifndef _MTCR_GPU /* guard */
 #define _MTCR_GPU
 
+#include <stdint.h>
+#include <stdbool.h>
+
+#include "common/compatibility.h"
+
 int is_gpu_pci_device(u_int16_t pci_device_id);
 bool is_gpu_device(u_int16_t hw_dev_id);
 
diff --git a/mtcr_ul/mtcr_ul_icmd_cif.c b/mtcr_ul/mtcr_ul_icmd_cif.c
index e0ac0c8c5..89b9ebe52 100644
--- a/mtcr_ul/mtcr_ul_icmd_cif.c
+++ b/mtcr_ul/mtcr_ul_icmd_cif.c
@@ -31,13 +31,13 @@
  *
  */
 
+#include <stdbool.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 #include <sys/types.h>
-#if !defined(_MSC_VER)
 #include <unistd.h>
-#endif
+
 #include "common/bit_slice.h"
 #include "common/tools_time.h"
 #include "mtcr_icmd_cif.h"
diff --git a/mvpd/mvpd.c b/mvpd/mvpd.c
index 8282d3f2b..f91f3f76e 100644
--- a/mvpd/mvpd.c
+++ b/mvpd/mvpd.c
@@ -30,23 +30,17 @@
  * SOFTWARE.
  */
 
+#include "mvpd.h"
+
+#include <ctype.h>
+#include <errno.h>
+#include <stdbool.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include <errno.h>
-#include <ctype.h>
-#include <tools_dev_types.h>
-
-#ifdef MST_UL
 #include <syslog.h>
-#endif
-#include "mvpd.h"
 
-#if defined(__MINGW32__) || defined(__MINGW64__) || defined(_MSC_VER) /* Windows */
-#define syslog(lvl, format, ...)
-#else
-#include <syslog.h>
-#endif
+#include "tools_dev_types.h"
 
 enum
 {
diff --git a/reg_access/reg_access.h b/reg_access/reg_access.h
index 8cb9d7521..f2b217ffd 100644
--- a/reg_access/reg_access.h
+++ b/reg_access/reg_access.h
@@ -32,17 +32,20 @@
 
 #ifndef REG_ACCESS_H
 #define REG_ACCESS_H
+
 #ifdef __cplusplus
 extern "C"
 {
 #endif
 
+#include <stdbool.h>
+
 /* #include <tools_layouts/reg_access_hca_layouts.h> */
 /* #include <tools_layouts/reg_access_switch_layouts.h> */
 #include "reg_access_common.h"
 #include "common/bit_slice.h"
-#define MCAM_REG_GROUPS_AMOUNT 4
 
+#define MCAM_REG_GROUPS_AMOUNT 4
 
 enum { /* header lengths in bytes */
     REG_ACCESS_MFBA_HEADER_LEN = 12,