aboutsummaryrefslogtreecommitdiff
path: root/tcc.h
diff options
context:
space:
mode:
authorgrischka <grischka>2016-11-20 14:52:56 +0100
committergrischka <grischka>2016-11-20 14:52:56 +0100
commita52a39179a47ee125e88ae0938f06d08cf5723ce (patch)
treef5d6cba453fe5d7e15bd3de0b83350a0f7345cfb /tcc.h
parent4a3741bf02eb51c377312bdabc979e5ccbf5bf89 (diff)
downloadtinycc-a52a39179a47ee125e88ae0938f06d08cf5723ce.tar.gz
tinycc-a52a39179a47ee125e88ae0938f06d08cf5723ce.tar.bz2
tccelf: introduce add32/64le()
Diffstat (limited to 'tcc.h')
-rw-r--r--tcc.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/tcc.h b/tcc.h
index ed134d7..180838d 100644
--- a/tcc.h
+++ b/tcc.h
@@ -1423,12 +1423,18 @@ static inline uint32_t read32le(unsigned char *p) {
static inline void write32le(unsigned char *p, uint32_t x) {
write16le(p, x), write16le(p + 2, x >> 16);
}
+static inline void add32le(unsigned char *p, int32_t x) {
+ write32le(p, read32le(p) + x);
+}
static inline uint64_t read64le(unsigned char *p) {
return read32le(p) | (uint64_t)read32le(p + 4) << 32;
}
static inline void write64le(unsigned char *p, uint64_t x) {
write32le(p, x), write32le(p + 4, x >> 32);
}
+static inline void add64le(unsigned char *p, int64_t x) {
+ write64le(p, read64le(p) + x);
+}
/* ------------ i386-gen.c ------------ */
#if defined TCC_TARGET_I386 || defined TCC_TARGET_X86_64