Skip to content

Commit

Permalink
INTERNAL: Revert "util: Drop the ENUM_PACKED macro"
Browse files Browse the repository at this point in the history
This reverts commit 13f7ef5.

Build Error-:
src/gallium/auxiliary/util/u_prim.c:33:4: error: static assertion failed
due to requirement.

size of packed enum was coming 4 instead of 1 due to this change.

Tracked-On: OAM-106853
Signed-off-by: Ankit Agrawal <ankit.agarwal@intel.com>
  • Loading branch information
ankithbti52509 authored and yhe39 committed Jul 12, 2023
1 parent 2763ff1 commit bf05d95
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/gallium/include/pipe/p_defines.h
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,7 @@ enum pipe_resource_usage {
/**
* Primitive types:
*/
enum PACKED pipe_prim_type {
enum pipe_prim_type {
PIPE_PRIM_POINTS,
PIPE_PRIM_LINES,
PIPE_PRIM_LINE_LOOP,
Expand All @@ -578,7 +578,7 @@ enum PACKED pipe_prim_type {
PIPE_PRIM_TRIANGLE_STRIP_ADJACENCY,
PIPE_PRIM_PATCHES,
PIPE_PRIM_MAX,
};
} ENUM_PACKED;

/**
* Tessellator spacing types
Expand Down
8 changes: 8 additions & 0 deletions src/util/macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,14 @@ do { \
#define ATTRIBUTE_NOINLINE
#endif

/* Use as: enum name { X, Y } ENUM_PACKED; */
#if defined(__GNUC__)
#define ENUM_PACKED __attribute__((packed))
#else
#define ENUM_PACKED
#endif


/**
* Check that STRUCT::FIELD can hold MAXVAL. We use a lot of bitfields
* in Mesa/gallium. We have to be sure they're of sufficient size to
Expand Down

0 comments on commit bf05d95

Please sign in to comment.