Stop using the patched microlib

pull/17/head
Emilio Monti 2013-07-08 17:31:04 +01:00
parent 170b1f8f49
commit 5020b9ad3b
2 changed files with 10 additions and 2 deletions

View File

@ -120,6 +120,13 @@ static inline int openmode_to_posix(int openmode) {
}
extern "C" FILEHANDLE PREFIX(_open)(const char* name, int openmode) {
#if defined(__MICROLIB) && (__ARMCC_VERSION>5030000)
// Before version 5.03, we were using a patched version of microlib with proper names
// This is the workaround that the microlib author suggested us
static int n = 0;
if (!std::strcmp(name, ":tt")) return n++;
#else
/* Use the posix convention that stdin,out,err are filehandles 0,1,2.
*/
if (std::strcmp(name, __stdin_name) == 0) {
@ -132,7 +139,8 @@ extern "C" FILEHANDLE PREFIX(_open)(const char* name, int openmode) {
init_serial();
return 2;
}
#endif
// find the first empty slot in filehandles
unsigned int fh_i;
for (fh_i = 0; fh_i < sizeof(filehandles)/sizeof(*filehandles); fh_i++) {

View File

@ -98,7 +98,7 @@ class ARM_STD(ARM):
class ARM_MICRO(ARM):
PATCHED_LIBRARY = True
PATCHED_LIBRARY = False
def __init__(self, target, options=None, notify=None):
ARM.__init__(self, target, notify)