Commit e2c4a0b1 authored by Pekka Pessi's avatar Pekka Pessi

m4/sac-su2.m4: added configure option --disable-tag-cast.

Added SU_INLINE_TAG_CAST into sofia-sip/su_configure.h{,.in}.
Using SU_INLINE_TAG_CAST in
  sofia-sip/sip_tag.h{,.in}
  sofia-sip/http_tag.h{,.in}
  sofia-sip/su_tag.h
  sofia-sip/su_tag_io.h
  sofia-sip/auth_module.h
  sofia-sip/nth_tag.h
  sofia-sip/nua_tag.h

darcs-hash:20070530143753-65a35-b0d848420ee956bc422a44a67de1d91c515a500d.gz
parent f3157c1e
......@@ -102,7 +102,7 @@ SOFIAPUBVAR tag_typedef_t httptag_http;
#define HTTPTAG_HTTP_REF(x) httptag_http_ref, httptag_http_vr(&(x))
SOFIAPUBVAR tag_typedef_t httptag_http_ref;
#if SU_HAVE_INLINE
#if SU_INLINE_TAG_CAST
su_inline
tag_value_t httptag_http_v(http_t const *v) { return (tag_value_t)v; }
su_inline
......@@ -150,7 +150,7 @@ SOFIAPUBVAR tag_typedef_t httptag_header;
#define HTTPTAG_HEADER_REF(x) httptag_header_ref, httptag_header_vr(&(x))
SOFIAPUBVAR tag_typedef_t httptag_header_ref;
#if SU_HAVE_INLINE
#if SU_INLINE_TAG_CAST
su_inline tag_value_t
httptag_header_v(http_header_t const *v)
{ return (tag_value_t)v; }
......@@ -220,7 +220,7 @@ SOFIAPUBVAR tag_typedef_t httptag_#xxxxxx#_ref;
#define HTTPTAG_#XXXXXX#_STR_REF(x) HTTPTAG_STR_REF(#xxxxxx#, x)
SOFIAPUBVAR tag_typedef_t httptag_#xxxxxx#_str_ref;
#if SU_HAVE_INLINE
#if SU_INLINE_TAG_CAST
su_inline tag_value_t
httptag_#xxxxxx#_v(http_#xxxxxx#_t const *v)
{ return (tag_value_t)v; }
......
......@@ -253,7 +253,7 @@ SOFIAPUBVAR tag_typedef_t authtag_module;
#define AUTHTAG_MODULE_REF(x) authtag_module_ref, authtag_module_vr((&x))
SOFIAPUBVAR tag_typedef_t authtag_module_ref;
#if SU_HAVE_INLINE
#if SU_INLINE_TAG_CAST
su_inline tag_value_t authtag_module_v(auth_mod_t *v) {
return (tag_value_t)v;
}
......
......@@ -101,7 +101,7 @@ NTH_DLL extern tag_typedef_t nthtag_error_msg;
NTH_DLL extern tag_typedef_t nthtag_error_msg_ref;
#define NTHTAG_ERROR_MSG_REF(x) nthtag_error_msg_ref, tag_bool_vr(&(x))
#if SU_HAVE_INLINE
#if SU_INLINE_TAG_CAST
struct nth_client_s;
su_inline tag_value_t nthtag_template_v(struct nth_client_s const *v)
{ return (tag_value_t)v; }
......@@ -119,7 +119,7 @@ NTH_DLL extern tag_typedef_t nthtag_template;
NTH_DLL extern tag_typedef_t nthtag_template_ref;
#define NTHTAG_TEMPLATE_REF(x) nthtag_template_ref, nthtag_template_vr(&(x))
#if SU_HAVE_INLINE
#if SU_INLINE_TAG_CAST
su_inline tag_value_t nthtag_message_v(struct msg_s *v)
{ return (tag_value_t)v; }
su_inline tag_value_t nthtag_message_vr(struct msg_s **vp)
......
......@@ -2270,7 +2270,7 @@ SOFIAPUBVAR tag_typedef_t nutag_detect_network_updates;
SOFIAPUBVAR tag_typedef_t nutag_detect_network_updates_ref;
/* Pass nua handle as tagged argument */
#if SU_HAVE_INLINE
#if SU_INLINE_TAG_CAST
su_inline tag_value_t nutag_handle_v(nua_handle_t *v) { return (tag_value_t)v; }
su_inline tag_value_t nutag_handle_vr(nua_handle_t **vp) {return(tag_value_t)vp;}
#else
......
......@@ -104,7 +104,7 @@ SOFIAPUBVAR tag_typedef_t siptag_sip;
#define SIPTAG_SIP_REF(x) siptag_sip_ref, siptag_sip_vr(&(x))
SOFIAPUBVAR tag_typedef_t siptag_sip_ref;
#if SU_HAVE_INLINE
#if SU_INLINE_TAG_CAST
su_inline
tag_value_t siptag_sip_v(sip_t const *v) { return (tag_value_t)v; }
su_inline
......@@ -136,7 +136,7 @@ SOFIAPUBVAR tag_typedef_t siptag_header;
#define SIPTAG_HEADER_REF(x) siptag_header_ref, siptag_header_vr(&(x))
SOFIAPUBVAR tag_typedef_t siptag_header_ref;
#if SU_HAVE_INLINE
#if SU_INLINE_TAG_CAST
su_inline tag_value_t
siptag_header_v(sip_header_t const *v)
{ return (tag_value_t)v; }
......@@ -240,7 +240,7 @@ SOFIAPUBVAR tag_typedef_t siptag_#xxxxxx#_str;
#define SIPTAG_#XXXXXX#_STR_REF(x) siptag_#xxxxxx#_str_ref, tag_str_vr(&(x))
SOFIAPUBVAR tag_typedef_t siptag_#xxxxxx#_str_ref;
#if SU_HAVE_INLINE
#if SU_INLINE_TAG_CAST
su_inline tag_value_t
siptag_#xxxxxx#_v(sip_#xxxxxx#_t const *v)
{ return (tag_value_t)v; }
......
......@@ -88,6 +88,9 @@
/** Define as suitable declarator static inline functions */
#undef su_inline
/** Define as 1 the tag value casts use inlined functions */
#undef SU_INLINE_TAG_CAST
/** Define this as 1 if we can use tags directly from stack. */
#undef SU_HAVE_TAGSTACK
......
......@@ -171,7 +171,7 @@ SOFIAPUBFUN void tl_vfree(tagi_t *t);
#define SU_ALIGN(x) \
((sizeof(void *) - ((intptr_t)(x) & (sizeof(void *) - 1))) & (sizeof(void *) - 1))
#if SU_HAVE_INLINE
#if SU_INLINE_TAG_CAST
su_inline tag_value_t tag_int_v(int v) { return (tag_value_t)v; }
su_inline tag_value_t tag_int_vr(int *vp) { return (tag_value_t)vp; }
su_inline tag_value_t tag_uint_v(unsigned v) { return (tag_value_t)v; }
......
......@@ -48,7 +48,7 @@ SOFIA_BEGIN_DECLS
SOFIAPUBFUN void tl_print(FILE *f, char const *title, tagi_t const lst[]);
#if SU_HAVE_INLINE
#if SU_INLINE_TAG_CAST
su_inline tag_value_t tag_socket_v(su_socket_t v) {
return (tag_value_t)v;
}
......
......@@ -66,6 +66,16 @@ AC_REQUIRE([AC_C_MACRO_FUNCTION])
AC_REQUIRE([AC_C_INLINE])
AC_ARG_ENABLE(tag-cast,
[ --disable-tag-cast cast tag values with inlined functions [[enabled]]],
, enable_tag_cast=yes)
if test "$enable_tag_cast" = "yes"; then
tag_cast=1
else
tag_cast=0
fi
case "$ac_cv_c_inline" in
yes) SAC_SU_DEFINE(su_inline, static inline, [
Define to declarator for static inline functions.
......@@ -76,15 +86,20 @@ case "$ac_cv_c_inline" in
SAC_SU_DEFINE(SU_HAVE_INLINE, 1, [
Define to 1 if you have inline functions.
])dnl
SAC_SU_DEFINE_UNQUOTED(SU_INLINE_TAG_CAST, $tag_cast, [
Define to 1 if you use inline function to cast tag values.
])dnl
;;
no | "" )
SAC_SU_DEFINE(su_inline, static)dnl
SAC_SU_DEFINE(SU_INLINE, /*inline*/)dnl
SAC_SU_DEFINE(SU_HAVE_INLINE, 0)dnl
SAC_SU_DEFINE(SU_INLINE_TAG_CAST, 0)dnl
;;
*) SAC_SU_DEFINE_UNQUOTED(su_inline, static $ac_cv_c_inline)dnl
SAC_SU_DEFINE_UNQUOTED(SU_INLINE, $ac_cv_c_inline)dnl
SAC_SU_DEFINE(SU_HAVE_INLINE, 1)dnl
SAC_SU_DEFINE_UNQUOTED(SU_INLINE_TAG_CAST, $tag_cast)dnl
;;
esac
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment