drivers epprom_simulator: Set standard source macro appropriately
This file uses several functions which are extensions to the the std C library. Let's explicity select one of the extensions which includes it instead of relaying on somebody having set it for this file somewhere else. Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
This commit is contained in:
parent
318f824d76
commit
1b94864a87
|
@ -7,6 +7,20 @@
|
|||
|
||||
#define DT_DRV_COMPAT zephyr_sim_eeprom
|
||||
|
||||
#ifdef CONFIG_ARCH_POSIX
|
||||
#undef _POSIX_C_SOURCE
|
||||
/* Note: This is used only for interaction with the host C library, and is therefore exempt of
|
||||
* coding guidelines rule A.4&5 which applies to the embedded code using embedded libraries
|
||||
*/
|
||||
#define _POSIX_C_SOURCE 200809L
|
||||
#include <unistd.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/mman.h>
|
||||
#include <fcntl.h>
|
||||
#include "cmdline.h"
|
||||
#include "soc.h"
|
||||
#endif
|
||||
|
||||
#include <zephyr/device.h>
|
||||
#include <zephyr/drivers/eeprom.h>
|
||||
|
||||
|
@ -17,15 +31,6 @@
|
|||
#include <string.h>
|
||||
#include <errno.h>
|
||||
|
||||
#ifdef CONFIG_ARCH_POSIX
|
||||
#include <unistd.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/mman.h>
|
||||
#include <fcntl.h>
|
||||
#include "cmdline.h"
|
||||
#include "soc.h"
|
||||
#endif
|
||||
|
||||
#define LOG_LEVEL CONFIG_EEPROM_LOG_LEVEL
|
||||
#include <zephyr/logging/log.h>
|
||||
LOG_MODULE_REGISTER(eeprom_simulator);
|
||||
|
|
Loading…
Reference in a new issue