mbed library sources. Supersedes mbed-src.

Dependents:   Nucleo_Hello_Encoder BLE_iBeaconScan AM1805_DEMO DISCO-F429ZI_ExportTemplate1 ... more

Revision:
189:f392fc9709a3
Parent:
187:0387e8f68319
--- a/platform/Stream.cpp	Thu Nov 08 11:46:34 2018 +0000
+++ b/platform/Stream.cpp	Wed Feb 20 22:31:08 2019 +0000
@@ -1,5 +1,6 @@
 /* mbed Microcontroller Library
  * Copyright (c) 2006-2013 ARM Limited
+ * SPDX-License-Identifier: Apache-2.0
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -43,7 +44,7 @@
 int Stream::putc(int c)
 {
     lock();
-    fflush(_file);
+    std::fseek(_file, 0, SEEK_CUR);
     int ret = std::fputc(c, _file);
     unlock();
     return ret;
@@ -51,7 +52,7 @@
 int Stream::puts(const char *s)
 {
     lock();
-    fflush(_file);
+    std::fseek(_file, 0, SEEK_CUR);
     int ret = std::fputs(s, _file);
     unlock();
     return ret;
@@ -60,7 +61,7 @@
 {
     lock();
     fflush(_file);
-    int ret = mbed_getc(_file);
+    int ret = std::fgetc(_file);
     unlock();
     return ret;
 }
@@ -68,7 +69,7 @@
 {
     lock();
     fflush(_file);
-    char *ret = mbed_gets(s, size, _file);
+    char *ret = std::fgets(s, size, _file);
     unlock();
     return ret;
 }
@@ -146,7 +147,7 @@
     lock();
     std::va_list arg;
     va_start(arg, format);
-    fflush(_file);
+    std::fseek(_file, 0, SEEK_CUR);
     int r = vfprintf(_file, format, arg);
     va_end(arg);
     unlock();
@@ -168,7 +169,7 @@
 int Stream::vprintf(const char *format, std::va_list args)
 {
     lock();
-    fflush(_file);
+    std::fseek(_file, 0, SEEK_CUR);
     int r = vfprintf(_file, format, args);
     unlock();
     return r;