posix: struct timespec: Move definition to sys/_timespec.h
POSIX subsys defines struct timespec in <time.h> (as POSIX public API requires), but newlib defines in in sys/_timespec.h, which inevitably leads to inclusion order and redifinition conflicts. Follow newlib way and define it in single place, sys/_timespec.h, which belongs to libc namespace. Thus, we move current definition to minimal libc, and will use either minlibc's or newlib's definition, instead of trying to redefine it. This is similar to the introduction of sys/_timeval.h done earlier. Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
This commit is contained in:
parent
3693f85805
commit
3a4553913e
2 changed files with 18 additions and 8 deletions
|
@ -10,14 +10,7 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef __timespec_defined
|
||||
#define __timespec_defined
|
||||
struct timespec {
|
||||
signed int tv_sec;
|
||||
signed int tv_nsec;
|
||||
};
|
||||
#endif
|
||||
#include <sys/_timespec.h>
|
||||
|
||||
/* Older newlib's like 2.{0-2}.0 don't define any newlib version defines, only
|
||||
* __NEWLIB_H__ so we use that to decide if itimerspec was defined in
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue