define PRE_PROCESSOR - best location?



  • Is there a prefered place where to define a new preproc constant?
    Is the header of the component/class in question a good place to put it as we can see sometimes?
    Does it depend on the scope?

    I want it to be consistent in order to contribute to Hise properly...

    Also, it would be great to have all the preproc listed in the doc



  • If you add them at the .h file of the module (so hi_tools.h in /hi_tools) and prepend a

    /** Config: HISE_MY_PREPROCESSOR
    
    Describes what the preprocessor does
    */
    #ifndef HISE_MY_PREPROCESSOR
    #define HISE_MY_PREPROCESSOR 0
    #endif
    

    it can be selected in the Projucer, which is quite handy (take a look at how the other preprocessors are defined there). I would also prepend HISE_, so that it won't clash with other preprocessors.



  • @Christoph-Hart Cool thanks 🙂
    In this case it's for a value -> HISE_PANEL_MOUSE_DRAG_THRESHOLD or something like this... Currently set to 4px, but I always use 0.
    Or, a bool, like HISE_DISABLE_PANEL_MOUSE_DRAG_THRESHOLD might be good enough, I can't imagine one wants to set it at 50px 🙄


Log in to reply
 

9
Online

1.5k
Users

4.6k
Topics

42.1k
Posts