tinyvm/include/tvm/tvm_preprocessor.h
Joseph Kogut 488b88f867 tvm_preprocess: update *src after (re)allocating memory
During preprocessing, we find directives, and if they specify including
other source files, we remove the directive, allocate a new block of
memory, copy the first block, append the new source file, and append the
second block.

Previously, the value of the source pointer was passed into the
preprocessing function. When the memory would be (re)allocated, the
pointer value could change, but the original pointer would not be
updated.

Now, the pointer is passed by address, and updated when the memory it
points to changes.
2017-02-12 11:51:06 -08:00

8 lines
164 B
C

#ifndef TVM_PREPROCESSOR_H_
#define TVM_PREPROCESSOR_H_
#include "tvm_htab.h"
int tvm_preprocess(char **src, int *src_len, struct tvm_htab_ctx *defines);
#endif