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

Fix and improve debugging. #10

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

Ionic
Copy link

@Ionic Ionic commented Sep 8, 2020

Fixes and improves debugging features a tiny bit.

The original code tried to map belle_sip_deb(...) (i.e., a variadic
macro) to bctbx_debug(...) (i.e., another variadic macro as the
replacement).

This didn't work for multiple reasons:
  - no code used belle_sip_deb(), but actually belle_sip_debug().
  - the target function has to be called with either a named variadic
    argument (e.g., "nameargs..." -> "nameargs") or, if it's
    unnamed/anonymous via the portable __VA_ARGS__ name/macro.

Rename it to belle_sip_debug and make it a non-variadic substitution to
bctbx_debug, since the usage is 1:1 currently.

If it stops being a 1:1 replacement in the future, it's easy to just
make it variadic again such as via:

  belle_sip_debug(args...) some_func(NULL, args)
(Still) disabled by default, of course.
Instead, let's just use the proper format specifier.

Since belle-sip already requires C99, it should always be available.
@Ionic Ionic mentioned this pull request Sep 8, 2020
@Ionic Ionic changed the title Bugfix/debug Fix and improve debugging. Sep 8, 2020
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

Successfully merging this pull request may close these issues.

1 participant