Commits

Amaury Forgeot d'Arc committed 8144ea8

Some #ifdef and documentation.

  • Participants
  • Parent commits 3387ffe
  • Branches remove-PYPY_NOT_MAIN_FILE

Comments (0)

Files changed (3)

File pypy/translator/c/genc.py

 def add_extra_files(eci):
     srcdir = py.path.local(autopath.pypydir).join('translator', 'c', 'src')
     files = [
-        srcdir / 'main.c',
-        srcdir / 'allocator.c',
+        srcdir / 'main.c',             # ifdef PYPY_STANDALONE
+        srcdir / 'allocator.c',        # ifdef PYPY_STANDALONE
         srcdir / 'mem.c',
         srcdir / 'exception.c',
-        srcdir / 'rtyper.c',
+        srcdir / 'rtyper.c',           # ifdef HAVE_RTYPER
         srcdir / 'support.c',
         srcdir / 'pyobj.c',
         srcdir / 'profiling.c',
         srcdir / 'debug_print.c',
-        srcdir / 'debug_traceback.c',
+        srcdir / 'debug_traceback.c',  # ifdef HAVE_RTYPER
         srcdir / 'stack.c',
         srcdir / 'thread.c',
         srcdir / 'asm.c',
         srcdir / 'instrument.c',
-        srcdir / 'll_strtod.c',
+        srcdir / 'll_strtod.c',        # ifdef HAVE_RTYPER
         srcdir / 'int.c',
     ]
     if _CYGWIN:

File pypy/translator/c/src/allocator.c

 /* allocation functions */
 #include "common_header.h"
+#ifdef PYPY_STANDALONE
 #include <malloc.h>
 #include <stdlib.h>
 
 #  include "src/obmalloc.c"
 
 #endif
+
+#endif  /* PYPY_STANDALONE */

File pypy/translator/c/src/allocator.h

+#ifdef PYPY_STANDALONE 
 /* allocation functions prototypes */
 void *PyObject_Malloc(size_t n);
 void *PyObject_Realloc(void *p, size_t n);
 void PyObject_Free(void *p);
 
+#endif  /* PYPY_STANDALONE */