Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Arduino Compatible types are ambiguous and possibly conflicting #27

Open
dsyleixa opened this issue Jun 1, 2021 · 0 comments
Open

Arduino Compatible types are ambiguous and possibly conflicting #27

dsyleixa opened this issue Jun 1, 2021 · 0 comments

Comments

@dsyleixa
Copy link

dsyleixa commented Jun 1, 2021

in ArduiPi_OLED_lib.h there are some defines which perhaps conflict with general or arbitrary programs:

        // Arduino Compatible type
        typedef uint8_t boolean;           
        typedef uint8_t byte;      
        //... 
        // GCC Missing            
        #define max(a,b) (a>b?a:b)
        #define min(a,b) (a<b?a:b)     
    

especially the max/min #defines are ambiguous and possibly conflicting because this ArduiPi_OLED lib is used by gcc on the Pi, and for gcc both max and min are perhaps already defined in other libs (e.g., max / min (namespace std) or in different optional/proprietary libs)

solutions:
(a) drop all completely, they make no sense in a OLED lib for the Pi
(b) enable them only when a global MAKRO is not defined, like e.g. (how it's done fo millis() etc):
#ifndef ARDUIPIOLED_NO_ARDUINISH_COMPATIBILITY

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant