Re: bug in sanei_debug.h

From: Jochen Eisinger (jochen.eisinger@gno.de)
Date: Sun Oct 15 2000 - 16:35:33 PDT

  • Next message: Jochen Eisinger: "Re: bug in sanei_debug.h"

    Hi!

    [Henning Meier-Geinitz]
    > > However, it doesn't seem to be an easy fix. The variable for the current
    > > debug level and the backend name is stored in the object code of the
    > > backend. It has to be transmitted to sanei_init_debug in some way. With
    > > vararg macros that's no problem because these two values can be transmitted
    > > as function parameters to sanei_debug_max. Without varargs we can't touch
    > > the parameters of DBG / sanei_debug so I don't have an idea how to tell
    > > sanei_debug_msg the debug level and backend name without moving all these
    > > functions to sanei_debug.h. Any ideas (maybe I didn't understand the code
    > > fully ...).

    I've patch sanei_debug.h... now it creates one additional function for
    each backend that #includes sanei_debug.h (if there is no support for
    vararg macros). The output is the same as if it was compiled with vararg
    macros.

    I've also modified the test for vararg macros: I added the test #if
    defined __GNUC__ && (...)

    What do you think about it? There are severall drawbacks:

    * debug_msg is no more static (maybe it should be renamed
    sanei_debug_msg to avoid conflicts)
    * the new per backend function needs to #include stdlib, string & stdarg
    * it allocates memory

    -- jochen

    --
    Source code, list archive, and docs: http://www.mostang.com/sane/
    To unsubscribe: echo unsubscribe sane-devel | mail majordomo@mostang.com
    



    This archive was generated by hypermail 2b29 : Sun Oct 15 2000 - 16:28:36 PDT