On Mon, Oct 27, 2014 at 5:51 PM, John Van Ostrand <j...@vanostrand.com> wrote:
> +/* waiting for libdivecomputer patch
>                 case 0xC2:      // Low battery warning
>                         add_event(dc, seconds, SAMPLE_EVENT_BATTERY,
>                                         SAMPLE_FLAGS_NONE, 0,
>                                         QT_TRANSLATE_NOOP("gettextFromC", 
> "battery"));
>                         break;
> +*/

Please change your libdivecomputer patch to do what I did with some
EON Steel infrastructure: add a

    #define SAMPLE_EVENT_BATTERY SAMPLE_EVENT_BATTERY

define in the header file that declares that thing, and then users can just do

  #ifdef SAMPLE_EVENT_BATTERY
             ...
   #endif

and it will automatically pick up on whether the libdivecomputer you
are building against supports this or not.

Anything else is broken. Checking versions is insane (and doesn't work
in between releases). The whole "check if it's defined" is the sane
and clean way to do these things, and the self-define is the way to
handle things that are actually declared other ways (ie as enum's as
in this case, or just function declarations etc for new support
functions).

               Linus
_______________________________________________
subsurface mailing list
subsurface@subsurface-divelog.org
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface

Reply via email to