I've developed several of my own libraries and love the ability to click a box and have the library functions available everywhere, but that isn't my question.
Are #define statements filtered out or ignored in librarys? Seems like all of my #define statements that I compile into a package don't retain those definitions. Is this correct or am I messing something up?
Preprocessor Statements
Re: Preprocessor Statements
Hi,
Please, can you attach here an example of your library so I could understand your question better ?
Regards,
Filip .
Please, can you attach here an example of your library so I could understand your question better ?
Regards,
Filip .
Re: Preprocessor Statements
Code: Select all
#ifndef __TFP_PRINTF__
#define __TFP_PRINTF__
#include <stdarg.h>
void init_printf(void* putp,void (*putf) (void*,char));
void tfp_printf(char *fmt, ...);
void tfp_sprintf(char* s,char *fmt, ...);
void tfp_format(void* putp,void (*putf) (void*,char),char *fmt, va_list va);
#define printf tfp_printf
#define sprintf tfp_sprintf
#endif
Re: Preprocessor Statements
Hi,
The scope of #DEFINE is limited to single source file where it is defined, so when you try to use it outside of this source (in your case library) you will get errors.
Regards,
Filip.
The scope of #DEFINE is limited to single source file where it is defined, so when you try to use it outside of this source (in your case library) you will get errors.
Regards,
Filip.
Re: Preprocessor Statements
That is what I kind of figured, but I was hoping that the library would be treated like a header file and when included it would act as a #include statement behind the scenes.
I re-compiled the library to rename the functions to what I needed them to be.
Thanks.
I re-compiled the library to rename the functions to what I needed them to be.
Thanks.