Re: Linking C-API functions, when using pjsua2

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 18-09-16 13:54, Piewald Georg wrote:
So I guess that’s a bug? The fix would be simple:

extern "C" {
#include <pjsua-lib/pjsua.h>
}

That construct looks odd. Generally I'd expect the .h header to include the extern part not the caller of the include. See any header in /usr/include (nowadays perhaps using a __BEGIN_DECLS macro).


And that's what I find inside a sample pjsip/sip_auth.h on my system:

It starts with PJ_BEGIN_DECL, and that in turn is defined as:

/**
 * @def PJ_END_DECL
 * Mark end of declaration section in a header file.
 */
#ifdef __cplusplus
#  define PJ_DECL_NO_RETURN(type)   PJ_DECL(type) PJ_NORETURN
#  define PJ_IDECL_NO_RETURN(type)  PJ_INLINE(type) PJ_NORETURN
#  define PJ_BEGIN_DECL             extern "C" {
#  define PJ_END_DECL               }
#else
#  define PJ_DECL_NO_RETURN(type)   PJ_NORETURN PJ_DECL(type)
#  define PJ_IDECL_NO_RETURN(type)  PJ_NORETURN PJ_INLINE(type)
#  define PJ_BEGIN_DECL
#  define PJ_END_DECL
#endif


Greetings,
Walter



_______________________________________________
Visit our blog: http://blog.pjsip.org

pjsip mailing list
pjsip@xxxxxxxxxxxxxxx
http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org




[Index of Archives]     [Asterisk Users]     [Asterisk App Development]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [Linux API]
  Powered by Linux