|
From: | David Mertens |
Subject: | Re: [Tinycc-devel] tcc_add_symbol with macros |
Date: | Fri, 15 Jul 2016 13:27:41 -0400 |
Hi folks,
I am using libtcc. So far everything is going smoothly. Now I’d like to make some “built-in” functions available to the program that is being compiled as shown with the add() function in the libtcc_test.c example. It works well with pure C functions, however, in my library that I would like to use I have functions and macros like this:
void gdispGClear(GDisplay* g, color_t color);
#define gdispClear(c) gdispGClear(GDISP, c)
void gdispGDrawPixel(GDisplay* g, coord_t x, coord_t y, color_t color);
#define gdispDrawPixel(x,y,c) gdispGDrawPixel(GDISP,x,y,c)
And so on… GDISP is a global variable in the file that declares those functions, something like a “default value”.
Using tcc_add_symbol() on the functions themselves (eg. gdispGClear()) works well, however, I’d like to use tcc_add_symbol() with gdispClear() instead. Sadly that doesn’t compile. I get the following error:
‘gdispClear’ undeclared (first use in this function)
I think that I understand why that doesn’t work. However, is there still a workaround to get this working?
Thank you for your help & best regards,
~ Joel
_______________________________________________
Tinycc-devel mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/tinycc-devel
[Prev in Thread] | Current Thread | [Next in Thread] |