Enable putchar for all arm platforms
Instead of having to #undef putchar in every file where we want to use it, we undef it across the board. See the comment in arm-def.h as to why this needs done.
This commit is contained in:
parent
87dfa61fd6
commit
b2438b4563
@ -60,6 +60,25 @@ typedef uint32_t uip_stats_t;
|
|||||||
typedef uint32_t rtimer_clock_t;
|
typedef uint32_t rtimer_clock_t;
|
||||||
#define RTIMER_CLOCK_DIFF(a, b) ((int32_t)((a) - (b)))
|
#define RTIMER_CLOCK_DIFF(a, b) ((int32_t)((a) - (b)))
|
||||||
/** @} */
|
/** @} */
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The stdio.h that ships with the arm-gcc toolchain does this:
|
||||||
|
*
|
||||||
|
* int _EXFUN(putchar, (int));
|
||||||
|
* [...]
|
||||||
|
* #define putchar(x) putc(x, stdout)
|
||||||
|
*
|
||||||
|
* This causes us a lot of trouble: For platforms using this toolchain, every
|
||||||
|
* time we use putchar we need to first #undef putchar. What we do here is to
|
||||||
|
* #undef putchar across the board. The resulting code will cause the linker
|
||||||
|
* to search for a symbol named putchar and this allows us to use the
|
||||||
|
* implementation under os/lib/dbg-io.
|
||||||
|
*
|
||||||
|
* This will fail if stdio.h is included before contiki.h, but it is common
|
||||||
|
* practice to include contiki.h first
|
||||||
|
*/
|
||||||
|
#include <stdio.h>
|
||||||
|
#undef putchar
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
#endif /* ARM_DEF_ */
|
#endif /* ARM_DEF_ */
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
|
@ -48,9 +48,6 @@
|
|||||||
#define flush()
|
#define flush()
|
||||||
#endif
|
#endif
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
#undef putchar
|
|
||||||
#undef puts
|
|
||||||
|
|
||||||
#define SLIP_END 0300
|
#define SLIP_END 0300
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
int
|
int
|
||||||
|
@ -35,7 +35,6 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
#undef putchar
|
|
||||||
#undef putc
|
#undef putc
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
int
|
int
|
||||||
|
Loading…
Reference in New Issue
Block a user