tinycc-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Tinycc-devel] tcc_add_symbol with macros


From: Joel Bodenmann
Subject: [Tinycc-devel] tcc_add_symbol with macros
Date: Thu, 14 Jul 2016 19:38:15 +0200

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


reply via email to

[Prev in Thread] Current Thread [Next in Thread]