28
28
/* We can get the following standard types from sys/types for gcc, but we
29
29
* need to define the types ourselves for the other compilers that normally
30
30
* target embedded systems */
31
- #if defined(__ARMCC_VERSION) || defined(__ICCARM__)
32
31
typedef signed int ssize_t ; // /< Signed size type, usually encodes negative errors
33
32
typedef signed long off_t ; // /< Offset in a data stream
33
+ #if defined(__ARMCC_VERSION) || !defined(__GNUC__)
34
34
typedef unsigned int mode_t ; // /< Mode for opening files
35
35
typedef unsigned int dev_t ; // /< Device ID type
36
36
typedef unsigned long ino_t ; // /< File serial number
37
37
typedef unsigned int nlink_t ; // /< Number of links to a file
38
38
typedef unsigned int uid_t ; // /< User ID
39
39
typedef unsigned int gid_t ; // /< Group ID
40
+ #endif
40
41
41
42
#define O_RDONLY 0 // /< Open for reading
42
43
#define O_WRONLY 1 // /< Open for writing
@@ -45,19 +46,12 @@ typedef unsigned int gid_t; ///< Group ID
45
46
#define O_TRUNC 0x0400 // /< Truncate file to zero length
46
47
#define O_EXCL 0x0800 // /< Fail if file exists
47
48
#define O_APPEND 0x0008 // /< Set file offset to end of file prior to each write
49
+ #define O_BINARY 0x8000 // /< Open file in binary mode
48
50
49
51
#define NAME_MAX 255 // /< Maximum size of a name in a file path
50
52
51
53
#include < time.h>
52
54
53
- #else
54
-
55
- #include < sys/fcntl.h>
56
- #include < sys/types.h>
57
- #include < sys/syslimits.h>
58
-
59
- #endif
60
-
61
55
/* * \addtogroup platform */
62
56
/* * @{*/
63
57
/* *
@@ -94,7 +88,6 @@ extern "C" {
94
88
#endif
95
89
96
90
97
- #if defined(__ARMCC_VERSION) || defined(__ICCARM__)
98
91
/* The intent of this section is to unify the errno error values to match
99
92
* the POSIX definitions for the GCC_ARM, ARMCC and IAR compilers. This is
100
93
* necessary because the ARMCC/IAR errno.h, or sys/stat.h are missing some
@@ -365,9 +358,7 @@ extern "C" {
365
358
#define EOWNERDEAD 130 /* Owner died */
366
359
#undef ENOTRECOVERABLE
367
360
#define ENOTRECOVERABLE 131 /* State not recoverable */
368
- #endif
369
361
370
- #if defined(__ARMCC_VERSION) || defined(__ICCARM__)
371
362
/* Missing stat.h defines.
372
363
* The following are sys/stat.h definitions not currently present in the ARMCC
373
364
* errno.h. Note, ARMCC errno.h defines some symbol values differing from
@@ -424,8 +415,6 @@ struct stat {
424
415
time_t st_ctime; // /< Time of last status change
425
416
};
426
417
427
- #endif /* defined(__ARMCC_VERSION) || defined(__ICCARM__) */
428
-
429
418
430
419
/* The following are dirent.h definitions are declared here to garuntee
431
420
* consistency where structure may be different with different toolchains
0 commit comments