Go Down

Topic: knowing from where .h was included (Read 377 times) previous topic - next topic

Hi,
I try to figure out how I could declare thinks in a library .h only if included from .ino (or scketch file) and not from .cpp inside of the library.
Does anyone know a pre defined think that I could check.

Thank you
MGTH
Mgth : ArduixPL http://www.mgth.fr

majenko

Code: [Select]
[code]I doubt there's anything predefined, but there's nothing to stop you putting a #define immediately before the #include in your sketch and checking for that.

sketch:
[code]
#define USE_EXTRA_STUFF
#include <myLibrary.h>


myLibrary.h:
[/code]
#ifdef USE_EXTRA_STUFF
...
#endif
[/code]

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy