The official Mbed 2 C/C++ SDK provides the software platform and libraries to build your applications.

Dependents:   hello SerialTestv11 SerialTestv12 Sierpinski ... more

mbed 2

This is the mbed 2 library. If you'd like to learn about Mbed OS please see the mbed-os docs.

Revision:
145:64910690c574
Parent:
139:856d2700e60b
Child:
152:235179ab3f27
--- a/platform/mbed_retarget.h	Thu Jun 08 14:53:05 2017 +0100
+++ b/platform/mbed_retarget.h	Wed Jun 21 17:31:38 2017 +0100
@@ -19,6 +19,9 @@
 #ifndef RETARGET_H
 #define RETARGET_H
 
+#if __cplusplus
+#include <cstdio>
+#endif //__cplusplus
 #include <stdint.h>
 #include <stddef.h>
 
@@ -48,8 +51,12 @@
 
 /* DIR declarations must also be here */
 #if __cplusplus
-namespace mbed { class Dir; }
-typedef mbed::Dir DIR;
+namespace mbed {
+class FileHandle;
+class DirHandle;
+std::FILE *mbed_fdopen(FileHandle *fh, const char *mode);
+}
+typedef mbed::DirHandle DIR;
 #else
 typedef struct Dir DIR;
 #endif
@@ -77,71 +84,60 @@
  * Note also that ARMCC errno.h defines some symbol values differently from
  * the GCC_ARM/IAR/standard POSIX definitions. The definitions guard against
  * this and future changes by changing the symbol definition as shown below. */
-#ifdef ENOENT
 #undef ENOENT
-#endif
 #define ENOENT      2       /* No such file or directory. */
 
-#ifdef EIO
 #undef EIO
-#endif
 #define EIO         5       /* I/O error */
 
-#ifdef ENXIO
 #undef ENXIO
-#endif
 #define ENXIO       6       /* No such device or address */
 
-#ifdef ENOEXEC
 #undef ENOEXEC
-#endif
 #define ENOEXEC     8       /* Exec format error */
 
-#ifdef EBADF
 #undef EBADF
-#endif
 #define EBADF       9       /* Bad file number */
 
-#ifdef ENOMEM
+#undef EAGAIN
+#define EAGAIN      11      /* Resource unavailable, try again */
+
+#undef EWOULDBLOCK
+#define EWOULDBLOCK EAGAIN  /* Operation would block */
+
 #undef ENOMEM
-#endif
 #define ENOMEM      12      /* Not enough space */
 
-#ifdef EACCES
 #undef EACCES
-#endif
 #define EACCES      13      /* Permission denied */
 
-#ifdef EFAULT
 #undef EFAULT
-#endif
 #define EFAULT      14      /* Bad address */
 
-#ifdef EEXIST
 #undef EEXIST
-#endif
 #define EEXIST      17      /* File exists */
 
-#ifdef EINVAL
+#undef EXDEV
+#define EXDEV       18      /* Cross-device link */
+
 #undef EINVAL
-#endif
 #define EINVAL      22      /* Invalid argument */
 
-#ifdef ENFILE
 #undef ENFILE
-#endif
 #define ENFILE      23      /* Too many open files in system */
 
-#ifdef EMFILE
 #undef EMFILE
-#endif
 #define EMFILE      24      /* File descriptor value too large */
 
-#ifdef ENOSYS
+#undef ESPIPE
+#define ESPIPE      29      /* Invalid seek */
+
 #undef ENOSYS
-#endif
 #define ENOSYS      38      /* Function not implemented */
 
+#undef EOVERFLOW
+#define EOVERFLOW   75      /* Value too large to be stored in data type */
+
 /* Missing stat.h defines.
  * The following are sys/stat.h definitions not currently present in the ARMCC
  * errno.h. Note, ARMCC errno.h defines some symbol values differing from
@@ -187,5 +183,4 @@
     DT_SOCK,    // This is a UNIX domain socket.
 };
 
-
 #endif /* RETARGET_H */