diff options
| author | grischka <grischka> | 2012-09-01 11:33:34 +0200 |
|---|---|---|
| committer | grischka <grischka> | 2012-09-01 11:33:34 +0200 |
| commit | ca38792df17fc5c8d2bb6757c512101610420f1e (patch) | |
| tree | 2c9c6f33dee69bfadeafe0613c048f2f6cde2dd3 /libtcc.h | |
| parent | 56e23984b9cd3b58e1766748524e63f8301ccd68 (diff) | |
| download | tinycc-ca38792df17fc5c8d2bb6757c512101610420f1e.tar.gz tinycc-ca38792df17fc5c8d2bb6757c512101610420f1e.tar.bz2 | |
tccrun: another incompatible change to the tcc_relocate API
We are now compatible with the 0.9,25 version though. A special
value for the second (ptr) argument is used to get the simple
behavior as with the 0.9.24 version.
Diffstat (limited to 'libtcc.h')
| -rw-r--r-- | libtcc.h | 11 |
1 files changed, 8 insertions, 3 deletions
@@ -91,9 +91,14 @@ LIBTCCAPI int tcc_output_file(TCCState *s, const char *filename); tcc_relocate() before. */ LIBTCCAPI int tcc_run(TCCState *s, int argc, char **argv); -/* Do all relocations (needed before using tcc_get_symbol()) - Returns -1 on error. */ -LIBTCCAPI int tcc_relocate(TCCState *s1); +/* do all relocations (needed before using tcc_get_symbol()) + possible values for 'ptr': + - TCC_RELOCATE_AUTO : Allocate and manage memory internally + - NULL : return required memory size for the step below + - memory address : copy code to memory passed by the caller + returns -1 on error. */ +LIBTCCAPI int tcc_relocate(TCCState *s1, void *ptr); +#define TCC_RELOCATE_AUTO (void*)1 /* return symbol value or NULL if not found */ LIBTCCAPI void *tcc_get_symbol(TCCState *s, const char *name); |
