mercurial/cffi/mpatchbuild.py
changeset 36948 0585337ea787
parent 32506 2dcb3d52ef41
child 43076 2372284d9457
equal deleted inserted replaced
36947:3d0178bf1039 36948:0585337ea787
     4 import os
     4 import os
     5 
     5 
     6 ffi = cffi.FFI()
     6 ffi = cffi.FFI()
     7 mpatch_c = os.path.join(os.path.join(os.path.dirname(__file__), '..',
     7 mpatch_c = os.path.join(os.path.join(os.path.dirname(__file__), '..',
     8                                      'mpatch.c'))
     8                                      'mpatch.c'))
     9 ffi.set_source("mercurial.cffi._mpatch", open(mpatch_c).read(),
     9 with open(mpatch_c) as f:
    10                include_dirs=["mercurial"])
    10     ffi.set_source("mercurial.cffi._mpatch", f.read(),
       
    11                    include_dirs=["mercurial"])
    11 ffi.cdef("""
    12 ffi.cdef("""
    12 
    13 
    13 struct mpatch_frag {
    14 struct mpatch_frag {
    14        int start, end, len;
    15        int start, end, len;
    15        const char *data;
    16        const char *data;