Эх сурвалжийг харах

qcacmn: Add a qdf macro for flexible length array

Define a qdf macro QDF_FLEX_ARRAY for declaring flexible length arrays.

Change-Id: I9be0d699fc85264e37b9e399ca239cada74eba5a
CRs-Fixed: 3690235
Aditya Kodukula 1 жил өмнө
parent
commit
5cbfd2c051
1 өөрчлөгдсөн 10 нэмэгдсэн , 0 устгасан
  1. 10 0
      qdf/inc/qdf_types.h

+ 10 - 0
qdf/inc/qdf_types.h

@@ -37,6 +37,16 @@
 /* Preprocessor definitions and constants */
 #define QDF_MAX_SGLIST 4
 
+/* Define a QDF macro for declaring flexible arrays */
+#define QDF_FLEX_ARRAY(type, name) \
+	union { \
+		type name ## _first_element; \
+		struct { \
+			struct {} dummy_struct; \
+			type name[]; \
+		}; \
+	}
+
 /*
  * Add more levels here based on the number of perf clusters in SoC
  * Also modify hif_get_perf_cluster_bitmap