diff options
| author | grischka <grischka> | 2016-11-20 14:52:56 +0100 |
|---|---|---|
| committer | grischka <grischka> | 2016-11-20 14:52:56 +0100 |
| commit | a52a39179a47ee125e88ae0938f06d08cf5723ce (patch) | |
| tree | f5d6cba453fe5d7e15bd3de0b83350a0f7345cfb /tcc.h | |
| parent | 4a3741bf02eb51c377312bdabc979e5ccbf5bf89 (diff) | |
| download | tinycc-a52a39179a47ee125e88ae0938f06d08cf5723ce.tar.gz tinycc-a52a39179a47ee125e88ae0938f06d08cf5723ce.tar.bz2 | |
tccelf: introduce add32/64le()
Diffstat (limited to 'tcc.h')
| -rw-r--r-- | tcc.h | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -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 |
