feat(esp_common): update esp_wps.h path and add esp_compiler.h for wpa_supplciant sync with idf

This commit is contained in:
Li Jingyi
2020-06-12 17:19:09 +08:00
parent 6526cec950
commit 744f2cfec8
2 changed files with 20 additions and 2 deletions

View File

@ -30,4 +30,22 @@
#define unlikely(x) (x)
#endif
/*
* Utility macros used for designated initializers, which work differently
* in C99 and C++ standards mainly for aggregate types.
* The member separator, comma, is already part of the macro, please omit the trailing comma.
* Usage example:
* struct config_t { char* pchr; char arr[SIZE]; } config = {
* ESP_COMPILER_DESIGNATED_INIT_AGGREGATE_TYPE_EMPTY(pchr)
* ESP_COMPILER_DESIGNATED_INIT_AGGREGATE_TYPE_STR(arr, "Value")
* };
*/
#ifdef __cplusplus
#define ESP_COMPILER_DESIGNATED_INIT_AGGREGATE_TYPE_STR(member, value) { .member = value },
#define ESP_COMPILER_DESIGNATED_INIT_AGGREGATE_TYPE_EMPTY(member) .member = { },
#else
#define ESP_COMPILER_DESIGNATED_INIT_AGGREGATE_TYPE_STR(member, value) .member = value,
#define ESP_COMPILER_DESIGNATED_INIT_AGGREGATE_TYPE_EMPTY(member)
#endif
#endif

View File

@ -26,7 +26,7 @@
#include "esp_wifi.h"
#endif
#if __has_include("esp_wps.h")
#include "esp_wps.h"
#include "esp_supplicant/esp_wps.h"
#endif
#if __has_include("nvs.h")
#include "nvs.h"
@ -234,7 +234,7 @@ static const esp_err_msg_t esp_err_msg_table[] = {
# ifdef ESP_ERR_WIFI_FPM_MODE
ERR_TBL_IT(ESP_ERR_WIFI_FPM_MODE), /* 12307 0x3013 Have not enable fpm mode */
# endif
// components/esp8266/include/esp_wps.h
// components/wpa_supplicant/include/esp_supplicant/esp_wps.h
# ifdef ESP_ERR_WIFI_REGISTRAR
ERR_TBL_IT(ESP_ERR_WIFI_REGISTRAR), /* 12339 0x3033 WPS registrar is not supported */
# endif