Commit 7a7e4e16 authored by Pekka Pessi's avatar Pekka Pessi

Solaris/SUNWspro patches.

- Autoconf now checks for support of %zu and %llu
- Autoconf disables the E_BAD_PTR_INT_COMBINATION warning on SUNWspro
- Fixed inline support:
  - SU_INLINE and SU_HAVE_INLINE macros defined correctly if compiler does
    not support inline
  - Using su_inline in public headers
  - Added normally inlined functions to library
  - Added some inlined functions as macros
- Using explicit signedness with bit fields
  - (The bitfields in soa_session.h should go away, but...)
- Fixed warnings in nta.c
- Defining missing SOL_SCTP in tport_type_sctp.c

Michael Jerris sent patch for some of the changes mentioned above.

darcs-hash:20070222203018-88462-ec89b84a178f699bcd1e2195cfa75e2bbe10c9ae.gz
parent 914a3f7f
......@@ -118,13 +118,92 @@ AC_HEADER_STDC
### ----------------
AC_TYPE_SIGNAL
AC_TYPE_LONGLONG([
AC_DEFINE([LLU], ["%llu"], [Define to format (%llu) for unsigned long long])dnl
AC_DEFINE([LLI], ["%lli"], [Define to format (%lli) for long long])dnl
AC_DEFINE([LLX], ["%llx"], [Define to format (%llx) for long long hex])dnl
AC_TYPE_LONGLONG
dnl
dnl Define HAVE_C99_FORMAT to 1 if the formatted IO functions (printf/scanf
dnl et.al.) support the C99 'size specifiers', namely ll, hh, j, z, t
dnl (representing long long int, char, intmax_t, size_t, ptrdiff_t). Some C
dnl compilers supported these specifiers prior to C99 as an extension.
dnl
AC_CACHE_CHECK([whether IO functions support C99 size specifiers],
[ac_cv_c_c99_format],[
ac_cv_c_c99_format=yes
AC_RUN_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT],
[[char buf[64];
if (sprintf(buf, "%lld%hhd%jd%zd%td", (long long int)1, (char)2, (intmax_t)3, (size_t)4, (ptrdiff_t)5) != 5)
exit(1);
else if (strcmp(buf, "12345"))
exit(2);]])],
[ac_cv_c_c99_format=yes],
[ac_cv_c_c99_format=no],
[ac_cv_c_c99_format=yes])
])
if test $ac_cv_c_c99_format = yes; then
AC_DEFINE([HAVE_C99_FORMAT], [1], [Define to 1 if printf supports C99 size specifiers])dnl
AC_DEFINE([LLU], ["%llu"], [Format (%llu) for unsigned long long])dnl
AC_DEFINE([LLI], ["%lli"], [Format (%lli) for long long])dnl
AC_DEFINE([LLX], ["%llx"], [Format (%llx) for long long hex])dnl
AC_DEFINE([MOD_ZD], ["%zd"], [Define printf() modifier for ssize_t])dnl
AC_DEFINE([MOD_ZU], ["%zu"], [Define printf() modifier for size_t])dnl
else
AC_CACHE_CHECK([whether IO functions support size specifier for long long],
[ac_cv_c_ll_format],[
ac_cv_c_ll_format=yes
AC_RUN_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT],
[[char buf[64];
if (sprintf(buf, "%lld", (long long int)1) != 1)
exit(1);
else if (strcmp(buf, "1"))
exit(2);]])],
[ac_cv_c_ll_format=yes],
[ac_cv_c_ll_format=no],
[ac_cv_c_ll_format=yes])
])
AC_DEFINE([MOD_ZD], ["%zd"], [Define printf() modifier for ssize_t])
AC_DEFINE([MOD_ZU], ["%zu"], [Define printf() modifier for size_t])
if test $ac_cv_c_ll_format = yes; then
AC_DEFINE([LLU], ["%llu"], [Format (%llu) for unsigned long long])dnl
AC_DEFINE([LLI], ["%lli"], [Format (%lli) for long long])dnl
AC_DEFINE([LLX], ["%llx"], [Format (%llx) for long long hex])dnl
else
AC_MSG_ERROR("printf cannot handle 64-bit integers")
fi
AC_CACHE_CHECK([whether IO functions support size specifier for size_t],
[ac_cv_c_z_format],[
ac_cv_c_z_format=yes
AC_RUN_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT],
[[char buf[64];
if (sprintf(buf, "%zd", (size_t)1) != 1)
exit(1);
else if (strcmp(buf, "1"))
exit(2);]])],
[ac_cv_c_z_format=yes],
[ac_cv_c_z_format=no],
[ac_cv_c_z_format=yes])
])
if test $ac_cv_c_z_format = yes; then
AC_DEFINE([MOD_ZD], ["%ld"], [Define printf() modifier for ssize_t])dnl
AC_DEFINE([MOD_ZU], ["%lu"], [Define printf() modifier for size_t])dnl
else
dnl Cross fingers
AC_MSG_WARN("printf cannot handle size_t, using long instead")
AC_DEFINE([MOD_ZD], ["%ld"], [Define printf() modifier for ssize_t])dnl
AC_DEFINE([MOD_ZU], ["%lu"], [Define printf() modifier for size_t])dnl
fi
fi
### checks for structures
### ---------------------
......
......@@ -38,7 +38,7 @@ nobase_include_sofia_HEADERS = $(BUILT_H) $(PUBLIC_H)
libhttp_la_SOURCES = $(INTERNAL_H) \
http_parser.c http_header.c \
http_basic.c http_extra.c \
http_basic.c http_extra.c http_inlined.c \
http_status.c http_tag_class.c \
$(BUILT_C)
......@@ -48,6 +48,7 @@ LDADD = libhttp.la \
../bnf/libbnf.la \
../msg/libmsg.la \
../url/liburl.la \
../ipt/libipt.la \
../su/libsu.la
test_http_LDFLAGS = -static
......
......@@ -55,6 +55,7 @@
#include <string.h>
#include <assert.h>
#include <stdio.h>
#include <limits.h>
/* ====================================================================== */
......@@ -1196,7 +1197,7 @@ char *http_range_dup_one(msg_header_t *dst, msg_header_t const *src,
http_range_t const *o = (http_range_t const *)src;
char *end = b + xtra;
b = msg_params_dup((char const * const **)&rng->rng_specs,
b = msg_params_dup((msg_param_t const **)&rng->rng_specs,
o->rng_specs, b, xtra);
MSG_STRING_DUP(b, rng->rng_unit, o->rng_unit);
......
/*
* This file is part of the Sofia-SIP package
*
* Copyright (C) 2005 Nokia Corporation.
*
* Contact: Pekka Pessi <pekka.pessi@nokia.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA
*
*/
/**@CFILE http_inlined.c
*
* Expand inlined http functions non-inline.
*
*/
#include "config.h"
#include <sofia-sip/su_config.h>
#include "sofia-sip/msg_header.h"
#include "sofia-sip/su_tag.h"
#if !SU_HAVE_INLINE
#undef SU_HAVE_INLINE
#undef su_inline
#define SU_HAVE_INLINE 1
#define su_inline
#include "sofia-sip/http_header.h"
#endif
......@@ -43,56 +43,39 @@
SOFIA_BEGIN_DECLS
#if SU_HAVE_INLINE
su_inline
#else
SOFIAPUBFUN
#endif
int
str0cmp(char const *a, char const *b),
str0ncmp(char const *a, char const *b, size_t n),
str0casecmp(char const *a, char const *b),
str0ncasecmp(char const *a, char const *b, size_t n);
#if SU_HAVE_INLINE
su_inline
#else
SOFIAPUBFUN
#endif
size_t
strnspn(char const *s, size_t size, char const *term),
strncspn(char const *s, size_t ssize, char const *reject);
#if SU_HAVE_INLINE
int str0cmp(char const *a, char const *b)
su_inline int str0cmp(char const *a, char const *b)
{
if (a == NULL) a = "";
if (b == NULL) b = "";
return strcmp(a, b);
}
int str0ncmp(char const *a, char const *b, size_t n)
su_inline int str0ncmp(char const *a, char const *b, size_t n)
{
if (a == NULL) a = "";
if (b == NULL) b = "";
return strncmp(a, b, n);
}
int str0casecmp(char const *a, char const *b)
su_inline int str0casecmp(char const *a, char const *b)
{
if (a == NULL) a = "";
if (b == NULL) b = "";
return strcasecmp(a, b);
}
int str0ncasecmp(char const *a, char const *b, size_t n)
su_inline int str0ncasecmp(char const *a, char const *b, size_t n)
{
if (a == NULL) a = "";
if (b == NULL) b = "";
return strncasecmp(a, b, n);
}
size_t strnspn(char const *s, size_t ssize, char const *term)
#if !SU_HAVE_INLINE
SOFIAPUBFUN size_t strnspn(char const *s, size_t size, char const *term);
SOFIAPUBFUN size_t strncspn(char const *s, size_t ssize, char const *reject);
#else
su_inline size_t strnspn(char const *s, size_t ssize, char const *term)
{
size_t n;
size_t tsize = strlen(term);
......@@ -123,7 +106,7 @@ size_t strnspn(char const *s, size_t ssize, char const *term)
return n;
}
size_t strncspn(char const *s, size_t ssize, char const *reject)
su_inline size_t strncspn(char const *s, size_t ssize, char const *reject)
{
size_t n;
size_t rsize = strlen(reject);
......
......@@ -38,7 +38,7 @@ nobase_include_sofia_HEADERS = \
BUILT_SOURCES = $(GENERATED_H) msg_mime_table.c test_table.c test_protos.h
libmsg_la_SOURCES = $(INTERNAL_H) \
msg.c msg_tag.c \
msg.c msg_tag.c msg_inlined.c \
msg_mime.c msg_mime_table.c \
msg_header_copy.c msg_header_make.c \
msg_parser.c msg_mclass.c msg_parser_util.c \
......@@ -46,11 +46,12 @@ libmsg_la_SOURCES = $(INTERNAL_H) \
COVERAGE_INPUT = $(libmsg_la_SOURCES) $(include_sofia_HEADERS)
libtest_msg_a_SOURCES = test_class.c test_table.c test_protos.h
libtest_msg_a_SOURCES = test_class.c test_table.c test_inlined.c test_protos.h
LDADD = libtest_msg.a libmsg.la \
../bnf/libbnf.la \
../url/liburl.la \
../ipt/libipt.la \
../su/libsu.la
test_msg_LDFLAGS = -static
......
/*
* This file is part of the Sofia-SIP package
*
* Copyright (C) 2007 Nokia Corporation.
*
* Contact: Pekka Pessi <pekka.pessi@nokia.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA
*
*/
/**@CFILE msg_inlined.c
*
* Expand inlined msg functions non-inline.
*
*/
#include "config.h"
#include <sofia-sip/su_config.h>
#if !SU_HAVE_INLINE
#undef SU_HAVE_INLINE
#undef su_inline
#define SU_HAVE_INLINE 1
#define su_inline
#include "sofia-sip/msg_header.h"
#include "sofia-sip/msg_mime_protos.h"
#endif
/*
* This file is part of the Sofia-SIP package
*
* Copyright (C) 2007 Nokia Corporation.
*
* Contact: Pekka Pessi <pekka.pessi@nokia.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA
*
*/
/**@CFILE test_inlined.c
*
* Expand inlined test functions non-inline.
*
*/
#include "config.h"
#include <sofia-sip/su_config.h>
#if !SU_HAVE_INLINE
#undef SU_HAVE_INLINE
#undef su_inline
#define SU_HAVE_INLINE 1
#define su_inline
#include "test_protos.h"
#endif
......@@ -145,7 +145,7 @@ static msg_t *nta_msg_create_for_transport(nta_agent_t *agent, int flags,
static int complete_response(msg_t *response,
int status, char const *phrase,
msg_t const *request);
msg_t *request);
#define IF_SIGCOMP_TPTAG_COMPARTMENT(cc) TAG_IF(cc, TPTAG_COMPARTMENT(cc)),
#define IF_SIGCOMP_TPTAG_COMPARTMENT_REF(cc) TPTAG_COMPARTMENT_REF(cc),
......@@ -778,7 +778,10 @@ su_duration_t set_timeout(nta_agent_t *agent, su_duration_t offset)
static
su_time_t agent_now(nta_agent_t const *agent)
{
return agent->sa_millisec ? agent->sa_now : su_now();
if (agent && agent->sa_millisec != 0)
return agent->sa_now;
else
return su_now();
}
......@@ -986,7 +989,7 @@ int agent_set_params(nta_agent_t *agent, tagi_t *tags)
agent->sa_algorithm = su_strdup(home, algorithm);
if (str0cmp(sigcomp, agent->sa_sigcomp_options)) {
char const * const *l = NULL;
msg_param_t const *l = NULL;
char *s = su_strdup(home, sigcomp);
char *s1 = su_strdup(home, s), *s2 = s1;
......@@ -2858,7 +2861,7 @@ int nta_msg_mreply(nta_agent_t *agent,
static
int complete_response(msg_t *response,
int status, char const *phrase,
msg_t const *request)
msg_t *request)
{
su_home_t *home = msg_home(response);
sip_t *response_sip = sip_object(response);
......
......@@ -109,7 +109,7 @@ su_inline tag_value_t nthtag_template_vr(struct nth_client_s const **vp)
{return(tag_value_t)vp;}
#else
#define nthtag_template_v(v) ((tag_value_t)(v))
#define nthtag_template_vr(vp) ((tag_value_t)&(vp))
#define nthtag_template_vr(vp) ((tag_value_t)(vp))
#endif
NTH_DLL extern tag_typedef_t nthtag_template;
......@@ -126,7 +126,7 @@ su_inline tag_value_t nthtag_message_vr(struct msg_s **vp)
{ return(tag_value_t)vp; }
#else
#define nthtag_message_v(v) ((tag_value_t)(v))
#define nthtag_message_vr(vp) ((tag_value_t)&(vp))
#define nthtag_message_vr(vp) ((tag_value_t)(vp))
#endif
NTH_DLL extern tag_typedef_t nthtag_message;
......@@ -142,7 +142,7 @@ su_inline tag_value_t nthtag_authentication_v(struct auth_client_s **v) { return
su_inline tag_value_t nthtag_authentication_vr(struct auth_client_s ***vp) {return(tag_value_t)vp;}
#else
#define nthtag_authentication_v(v) ((tag_value_t)(v))
#define nthtag_authentication_vr(vp) ((tag_value_t)&(vp))
#define nthtag_authentication_vr(vp) ((tag_value_t)(vp))
#endif
NTH_DLL extern tag_typedef_t nthtag_authentication;
......
......@@ -46,7 +46,7 @@ libsip_la_SOURCES = $(INTERNAL_H) \
sip_refer.c sip_session.c \
sip_caller_prefs.c sip_reason.c \
sip_status.c sip_time.c \
sip_tag_class.c \
sip_tag_class.c sip_inlined.c \
$(GENERATED_C)
COVERAGE_INPUT = $(libsip_la_SOURCES) $(include_sofia_HEADERS)
......@@ -55,6 +55,7 @@ LDADD = libsip.la \
../msg/libmsg.la \
../bnf/libbnf.la \
../url/liburl.la \
../ipt/libipt.la \
../su/libsu.la
torture_sip_LDFLAGS = -static
......
......@@ -44,6 +44,8 @@
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include <limits.h>
#include <assert.h>
/* ====================================================================== */
......
......@@ -46,6 +46,7 @@
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include <limits.h>
#include <assert.h>
......
/*
* This file is part of the Sofia-SIP package
*
* Copyright (C) 2007 Nokia Corporation.
*
* Contact: Pekka Pessi <pekka.pessi@nokia.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA
*
*/
/**@CFILE sip_inlined.c
*
* Expand inlined sip functions non-inline.
*
*/
#include "config.h"
#include <sofia-sip/su_config.h>
#if !SU_HAVE_INLINE
#include "sofia-sip/msg_header.h"
#include "sofia-sip/su_tag.h"
#undef SU_HAVE_INLINE
#undef su_inline
#define SU_HAVE_INLINE 1
#define su_inline
#include "sofia-sip/sip_protos.h"
#include "sofia-sip/sip_extra.h"
#endif
......@@ -43,6 +43,7 @@
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include <limits.h>
#include <assert.h>
/* ====================================================================== */
......
......@@ -46,6 +46,7 @@
#include <string.h>
#include <stdio.h>
#include <assert.h>
#include <limits.h>
/* ====================================================================== */
......
......@@ -42,6 +42,8 @@
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include <limits.h>
#include <assert.h>
/**@SIP_HEADER sip_reason Reason Header
......
......@@ -45,6 +45,8 @@
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include <limits.h>
#include <assert.h>
/* ====================================================================== */
......
......@@ -46,6 +46,7 @@
#include <assert.h>
#include <stddef.h>
#include <string.h>
#include <limits.h>
/** Tag class for SIP header tags. @HIDE */
tag_class_t siphdrtag_class[1] =
......
......@@ -192,10 +192,6 @@ SOFIAPUBFUN issize_t sip_name_addr_e(char b[], isize_t bsiz,
#define sip_params_copy_xtra msg_params_copy_xtra
#define sip_params_copy msg_params_copy
#define sip_params_add msg_params_add
#define sip_params_cmp msg_params_cmp
#define sip_params_replace msg_params_replace
SOFIAPUBFUN int sip_generic_xtra(sip_generic_t const *g);
SOFIAPUBFUN sip_generic_t *sip_generic_dup(su_home_t *home,
......
......@@ -42,21 +42,11 @@
#include <sofia-sip/string0.h>
#endif
SOFIA_BEGIN_DECLS
#ifndef MSG_HEADER_H
#include <sofia-sip/msg_header.h>
#endif
/* @deprecated
* These are just wrappers around msg_params_*() functions.
*
* Use msg_header_*_param() functions instead.
*/
SOFIAPUBFUN char const *sip_params_find(sip_param_t const pp[],
char const *token);
SOFIAPUBFUN int sip_params_add(su_home_t *sh,
sip_param_t **pparams,
char const *param);
SOFIAPUBFUN int sip_params_cmp(sip_param_t const a[], sip_param_t const b[]);
SOFIAPUBFUN int sip_params_replace(su_home_t *,
sip_param_t **pparams, char const *param);
SOFIA_BEGIN_DECLS
SOFIAPUBFUN
sip_contact_t *
......@@ -210,6 +200,13 @@ sip_security_client_t const *
sip_security_client_select(sip_security_client_t const *client,
sip_security_server_t const *server);
/* Compatibility stuff */
#define sip_params_add msg_params_add
#define sip_params_cmp msg_params_cmp
#define sip_params_replace msg_params_replace
#define sip_params_find msg_params_find
SOFIA_END_DECLS
#endif /** !defined(SIP_UTIL_H) */
......@@ -163,10 +163,10 @@ struct soa_session
struct soa_media_activity
{
int ma_audio:4; /**< Audio activity (send/recv) */
int ma_video:4; /**< Video activity (send/recv) */
int ma_image:4; /**< Image activity (send/recv) for JPIP */
int ma_chat:4; /**< Chat activity (send/recv) */
signed ma_audio:4; /**< Audio activity (send/recv) */
signed ma_video:4; /**< Video activity (send/recv) */
signed ma_image:4; /**< Image activity (send/recv) for JPIP */
signed ma_chat:4; /**< Chat activity (send/recv) */
} ss_local_activity[1], ss_remote_activity[1];
/** Capabilities as specified by application */
......
......@@ -353,7 +353,9 @@ int test_static_offer_answer(struct context *ctx)
soa_session_t *a, *b;
char const *caps = NONE, *offer = NONE, *answer = NONE;
isize_t capslen = -1, offerlen = -1, answerlen = -1;
isize_t capslen = (isize_t)-1;
isize_t offerlen = (isize_t)-1;
isize_t answerlen = (isize_t)-1;
su_home_t home[1] = { SU_HOME_INIT(home) };
......@@ -611,7 +613,7 @@ int test_codec_selection(struct context *ctx)
soa_session_t *a, *b;
char const *offer = NONE, *answer = NONE;
isize_t offerlen = -1, answerlen = -1;
isize_t offerlen = (isize_t)-1, answerlen = (isize_t)-1;
sdp_session_t const *a_sdp, *b_sdp;
sdp_media_t const *m;
......
......@@ -74,9 +74,9 @@ SOFIAPUBVAR su_log_t SU_LOG[];
#endif
#define SU_DEBUG_DEF(level) \
static SU_INLINE void su_debug_##level(char const *fmt, ...) \
su_inline void su_debug_##level(char const *fmt, ...) \
__attribute__ ((__format__ (printf, 1, 2))); \
void su_debug_##level(char const *fmt, ...) \
su_inline void su_debug_##level(char const *fmt, ...) \
{ va_list ap; va_start(ap, fmt); su_vllog(SU_LOG, level, fmt, ap); va_end(ap); }
SU_DEBUG_DEF(0)
......
......@@ -197,9 +197,9 @@ extern "C++" {
static inline tag_value_t tag_ptr_v(void const *v)
{ return (tag_value_t)v; }
static inline tag_value_t tag_ptr_vr(void *vp, void const *p)
{ return(tag_value_t)vp; }
{ return (tag_value_t)vp; }
static inline tag_value_t tag_str_v(char *v) { return (tag_value_t)v; }
static inline tag_value_t tag_str_vr(char **vp) {return(tag_value_t)vp;}
static inline tag_value_t tag_str_vr(char **vp) {return (tag_value_t)vp;}
}
#endif
su_inline tag_value_t tag_filter_v(tag_filter_f *v) {return(tag_value_t)v;}
......@@ -208,10 +208,14 @@ su_inline tag_value_t tag_filter_v(tag_filter_f *v) {return(tag_value_t)v;}
#define tag_int_vr(v) (tag_value_t)(v)
#define tag_uint_v(v) (tag_value_t)(v)
#define tag_uint_vr(v) (tag_value_t)(v)
#define tag_usize_v(v) (tag_value_t)(v)
#define tag_usize_vr(v) (tag_value_t)(v)
#define tag_bool_v(v) (tag_value_t)(v != 0)
#define tag_bool_vr(v) (tag_value_t)(v)
#define tag_ptr_v(v) (tag_value_t)(v)
#define tag_ptr_vr(v,x) (tag_value_t)(v)
#define tag_cptr_v(v) (tag_value_t)(v)
#define tag_cptr_vr(v,x) (tag_value_t)(v)
#define tag_cstr_v(v) (tag_value_t)(v)
#define tag_cstr_vr(v) (tag_value_t)(v)
#define tag_str_v(v) (tag_value_t)(v)
......
......@@ -104,9 +104,8 @@ SOFIAPUBFUN uint32_t su_ntp_mw(su_ntp_t ntp);
SOFIAPUBFUN uint32_t su_ntp_fraq(su_time_t t);
SOFIAPUBFUN uint32_t su_time_ms(su_time_t t);
#else
static SU_INLINE
/** Middle 32 bit of NTP timestamp. */
uint32_t su_ntp_fraq(su_time_t t)
su_inline uint32_t su_ntp_fraq(su_time_t t)
{
/*
* Multiply usec by 0.065536 (ie. 2**16 / 1E6)
......@@ -116,9 +115,8 @@ uint32_t su_ntp_fraq(su_time_t t)
return (t.tv_sec << 16) + (1024 * t.tv_usec + 7812) / 15625;
}
static SU_INLINE
/** Time as milliseconds. */
uint32_t su_time_ms(su_time_t t)
su_inline uint32_t su_time_ms(su_time_t t)
{
return t.tv_sec * 1000 + (t.tv_usec + 500) / 1000;
}
......
......@@ -42,9 +42,16 @@
#include <time.h>
#include "sofia-sip/su_types.h"
#include "sofia-sip/su_time.h"
#include "su_module_debug.h"
/* Include bodies of inlined functions */
#undef su_inline
#define su_inline
#undef SU_HAVE_INLINE
#define SU_HAVE_INLINE 1
#include "sofia-sip/su_time.h"
#if HAVE_SYS_TIME_H
#include <sys/time.h> /* Get struct timeval */
#endif
......
......@@ -57,6 +57,12 @@
#undef MAX_STREAMS