[pypy-svn] r48872 - in pypy/dist/pypy/rpython: module tool

arigo at codespeak.net arigo at codespeak.net
Tue Nov 20 20:30:50 CET 2007


Author: arigo
Date: Tue Nov 20 20:30:49 2007
New Revision: 48872

Modified:
   pypy/dist/pypy/rpython/module/ll_os_stat.py
   pypy/dist/pypy/rpython/tool/rffi_platform.py
Log:
Fix translator/c/test/test_extfunc:test_largefile.


Modified: pypy/dist/pypy/rpython/module/ll_os_stat.py
==============================================================================
--- pypy/dist/pypy/rpython/module/ll_os_stat.py	(original)
+++ pypy/dist/pypy/rpython/module/ll_os_stat.py	Tue Nov 20 20:30:49 2007
@@ -145,6 +145,8 @@
 
 from pypy.rpython.tool import rffi_platform as platform
 class CConfig:
+    # This must be set to 64 on some systems to enable large file support.
+    _header_ = '#define _FILE_OFFSET_BITS 64'
     _includes_ = INCLUDES
     STAT_STRUCT = platform.Struct('struct %s' % _name_struct_stat, LL_STAT_FIELDS)
 config = platform.configure(CConfig)

Modified: pypy/dist/pypy/rpython/tool/rffi_platform.py
==============================================================================
--- pypy/dist/pypy/rpython/tool/rffi_platform.py	(original)
+++ pypy/dist/pypy/rpython/tool/rffi_platform.py	Tue Nov 20 20:30:49 2007
@@ -85,11 +85,13 @@
     def write_header(self):
         f = self.f
         CConfig = self.config
-        print >> f, C_HEADER
-        print >> f
+        # NB: the _header_ must be printed before everything else,
+        # because it might contain #defines that need to appear before
+        # any system #include.
         print >> f, getattr(CConfig, '_header_', '')      # optional
         for path in getattr(CConfig, '_includes_', ()):   # optional
             print >> f, '#include <%s>' % (path,)
+        print >> f, C_HEADER
         print >> f
 
     def write_entry(self, key, entry):



More information about the Pypy-commit mailing list