ifdef __AVR__ in my library

pert:
You have your logic backwards. #ifndef is the same as #if ! defined() but that's not what you want. Use #ifdef instead.

Thank you, I have just realized there is #ifndef there, not a #ifdef. Will check again.
Is "AVR" defined for ESP?

In general - how to findout which board you compile for, using #ifdef?
Are there any list of boards and matching variables?