py: Move to guarded includes, everywhere in py/ core.

Addresses issue #1022.
This commit is contained in:
Damien George
2015-01-01 20:27:54 +00:00
parent db1ac360c3
commit 51dfcb4bb7
128 changed files with 528 additions and 817 deletions

View File

@@ -28,21 +28,18 @@
#include <stdio.h>
#include <assert.h>
#include "mpconfig.h"
#include "nlr.h"
#include "misc.h"
#include "qstr.h"
#include "obj.h"
#include "parsenum.h"
#include "runtime0.h"
#include "runtime.h"
#include "py/nlr.h"
#include "py/obj.h"
#include "py/parsenum.h"
#include "py/runtime0.h"
#include "py/runtime.h"
#if MICROPY_PY_BUILTINS_COMPLEX
#include <math.h>
#if MICROPY_FLOAT_IMPL == MICROPY_FLOAT_IMPL_FLOAT
#include "formatfloat.h"
#include "py/formatfloat.h"
#endif
typedef struct _mp_obj_complex_t {
@@ -58,12 +55,12 @@ STATIC void complex_print(void (*print)(void *env, const char *fmt, ...), void *
#if MICROPY_FLOAT_IMPL == MICROPY_FLOAT_IMPL_FLOAT
char buf[16];
if (o->real == 0) {
format_float(o->imag, buf, sizeof(buf), 'g', 7, '\0');
mp_format_float(o->imag, buf, sizeof(buf), 'g', 7, '\0');
print(env, "%sj", buf);
} else {
format_float(o->real, buf, sizeof(buf), 'g', 7, '\0');
mp_format_float(o->real, buf, sizeof(buf), 'g', 7, '\0');
print(env, "(%s+", buf);
format_float(o->imag, buf, sizeof(buf), 'g', 7, '\0');
mp_format_float(o->imag, buf, sizeof(buf), 'g', 7, '\0');
print(env, "%sj)", buf);
}
#else