before-compile += $(bits-errno)
nacl-irt.h = $(common-objpfx)nacl-irt.h
-$(nacl-irt.h): $(nacl)/irt.sed $(naclsrc)/untrusted/irt/irt.h
+$(nacl-irt.h): $(nacl)/irt.sed \
+ $(naclsrc)/untrusted/irt/irt.h \
+ $(naclsrc)/untrusted/irt/irt_dev.h
sed -f $^ > $@.new
mv -f $@.new $@
common-generated += nacl-irt.h
# It doesn't perturb any struct CamelCaps cases, since such names will
# be used only in NaCl-specific interfaces.
/^struct \([a-z][a-z]*\);$/d
+/^#include "irt\.h"$/d
/(/!b
s/\([a-z0-9_][a-z0-9_]*\)_t\>/nacl_abi_\1_t/g
s/struct \([a-z0-9_][a-z0-9_]*\)/nacl_abi_\1_t/g
s/nacl_abi_\(u*int[3264]*_t\)/\1/g
+s/nacl_abi_\(nacl_irt_\)/\1/g
/* These are the same in the IRT ABI as in the libc ABI. */
typedef blksize_t nacl_abi_blksize_t;
-typedef clockid_t nacl_abi_clockid_t;
typedef dev_t nacl_abi_dev_t;
typedef gid_t nacl_abi_gid_t;
typedef ino_t nacl_abi_ino_t;
typedef mode_t nacl_abi_mode_t;
typedef nlink_t nacl_abi_nlink_t;
-typedef off_t nacl_abi_off_t;
typedef size_t nacl_abi_size_t;
typedef time_t nacl_abi_time_t;
typedef uid_t nacl_abi_uid_t;
struct stat;
+/* stat.h uses nacl_abi_off_t, but irt.h defines only nacl_irt_off_t. */
+typedef nacl_irt_off_t nacl_abi_off_t;
+
/* We use this header to define struct nacl_abi_stat. But we must avoid
its excess declarations, and defining these names away is (marginally)
cleaner than #undef'ing __native_client__. */