Skip to content

Commit

Permalink
xdp/xsk.h: Fix undefined XDP_ALWAYS_INLINE with sparse
Browse files Browse the repository at this point in the history
Sparse checker doesn't have __GNUC_GNU_INLINE__ or __GNUC_STDC_INLINE__
defined, the same will be true for any non-GNU compiler.

This is causing build failures due to XDP_ALWAYS_INLINE being undefined.

This is potentially not the best way of fixing the problem, but
it solves the current issue.

Closes: #279
Fixes: 83549d3 ("xdp/xsk.h: Fix compilation with -std=gnu89")
Reported-by: David Marchand <[email protected]>
Signed-off-by: Ilya Maximets <[email protected]>
  • Loading branch information
igsilya authored and tohojo committed Feb 3, 2023
1 parent 11ed296 commit 9118de0
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions headers/xdp/xsk.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ extern "C" {
#define XDP_ALWAYS_INLINE inline __attribute__((__always_inline__))
#elif __GNUC_GNU_INLINE__
#define XDP_ALWAYS_INLINE static inline __attribute__((__always_inline__))
#else
#define XDP_ALWAYS_INLINE static inline
#endif

/* Do not access these members directly. Use the functions below. */
Expand Down

0 comments on commit 9118de0

Please sign in to comment.