Bug 90013 - libnice overly generic <agent.h>
Summary: libnice overly generic <agent.h>
Alias: None
Product: nice
Classification: Unclassified
Component: General (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: Olivier Crête
QA Contact:
Depends on:
Reported: 2015-04-13 10:45 UTC by Ilya Konstantinov
Modified: 2015-06-26 14:09 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Description Ilya Konstantinov 2015-04-13 10:45:36 UTC
libnice stores its headers in e.g. /usr/include/nice/ but 'pkg-config --cflags nice'
gives '-D_REENTRANT -I/usr/include/nice' meaning a generic-named header should as agent.h, debug.h or interfaces.h is includable as:

  #include <agent.h>
  #include <debug.h>
  #include <interfaces.h>

Moreover, the include-guard used in e.g. agent.h:

  #ifndef _AGENT_H
  #define _AGENT_H

is overly generic as well, and risks collision with other packages.
Comment 1 Olivier Crête 2015-04-13 21:51:38 UTC
I couldn't agree more, but changing this would break existing apps. So it will have to wait until we do an API break of some kind.
Comment 2 Ilya Konstantinov 2015-04-16 17:17:37 UTC
The include-guards can be changed already.
Comment 3 Olivier Crête 2015-04-20 19:45:15 UTC
Possibly, we should encourage people to use #include <nice/agent.h> instead of just <agent.h>.

I improved the guards a little.

commit 52534c43be1fdc74cd15f64ba28b8e753c212b62
Author: Olivier Crête <olivier.crete@collabora.com>
Date:   Mon Apr 20 15:44:16 2015 -0400

    Prefix include guards
    The include file names are very generic, at least make
    the guards a bit less generic.
Comment 4 Philip Withnall 2015-06-26 14:09:07 UTC
Migrated to Phabricator: http://phabricator.freedesktop.org/T113

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.