d-a-v / esp82xx-nonos-linklayer

esp8266 link layer API for new ip stack - applied to lwIP-v2
31 stars 22 forks source link

How I can use #if define for checking major version of lwip? #10

Open TridentTD opened 6 years ago

TridentTD commented 6 years ago

Is there any #define for seperating lwip v1.4 and lwip2?

Thank you.

d-a-v commented 6 years ago

yes

#include <lwip/init.h>
#if LWIP_VERSION_MAJOR == 2

#warning v2
const int v = 2;

#elif LWIP_VERSION_MAJOR == 1

#warning v1
const int v = 1;

#else
#error LWIP_VERSION_MAJOR not defined
#endif
TridentTD commented 6 years ago

Thank you @d-a-v