comparison mercurial/cffi/osutilbuild.py @ 43668:53607fd3ec6c stable

cffi: fix build on Python 3 CFFI expects the arguments to be of type str, which means that the string literals should not have the `b` prefix.
author Manuel Jacob <me@manueljacob.de>
date Sun, 17 Nov 2019 19:55:01 +0100
parents 687b865b95ad
children 6000f5b25c9b
comparison
equal deleted inserted replaced
43667:4cd911040ba5 43668:53607fd3ec6c
2 2
3 import cffi 3 import cffi
4 4
5 ffi = cffi.FFI() 5 ffi = cffi.FFI()
6 ffi.set_source( 6 ffi.set_source(
7 b"mercurial.cffi._osutil", 7 "mercurial.cffi._osutil",
8 """ 8 """
9 #include <sys/attr.h> 9 #include <sys/attr.h>
10 #include <sys/vnode.h> 10 #include <sys/vnode.h>
11 #include <unistd.h> 11 #include <unistd.h>
12 #include <fcntl.h> 12 #include <fcntl.h>
20 struct timespec mtime; 20 struct timespec mtime;
21 uint32_t accessmask; 21 uint32_t accessmask;
22 off_t datalength; 22 off_t datalength;
23 } __attribute__((aligned(4), packed)) val_attrs_t; 23 } __attribute__((aligned(4), packed)) val_attrs_t;
24 """, 24 """,
25 include_dirs=[b'mercurial'], 25 include_dirs=['mercurial'],
26 ) 26 )
27 ffi.cdef( 27 ffi.cdef(
28 ''' 28 '''
29 29
30 typedef uint32_t attrgroup_t; 30 typedef uint32_t attrgroup_t;