Skip to content

Commit

Permalink
[toup] zephyr: Fix build error and warning of zephyr
Browse files Browse the repository at this point in the history
Fix build error that IFNAMSIZ redefined in zephyr and unknown type
name 'sa_family_t', and fix the build warning of 'struct in_addr'
declared inside parameter list will not be visible outside of this
definition or declaration.

Signed-off-by: Maochen Wang <[email protected]>
  • Loading branch information
MaochenWang1 authored and jukkar committed Jun 6, 2024
1 parent 2052b75 commit 0cdc083
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/utils/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -335,9 +335,11 @@ static inline void WPA_PUT_LE64(u8 *a, u64 val)
#ifndef ETH_HLEN
#define ETH_HLEN 14
#endif
#ifndef __ZEPHYR__
#ifndef IFNAMSIZ
#define IFNAMSIZ 16
#endif
#endif
#ifndef ETH_P_ALL
#define ETH_P_ALL 0x0003
#endif
Expand Down Expand Up @@ -579,11 +581,6 @@ void int_array_concat(int **res, const int *a);
void int_array_sort_unique(int *a);
void int_array_add_unique(int **res, int a);

#ifdef __ZEPHYR__
char *inet_ntoa(struct in_addr in);
int inet_pton(sa_family_t family, const char *src, void *dst);
#endif

#if !defined(ARRAY_SIZE)
#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))
#endif
Expand Down

0 comments on commit 0cdc083

Please sign in to comment.