Commit e99bcfd0 authored by Tristan Matthews's avatar Tristan Matthews
Browse files

Merge branch 'master' into presence_sip_dev

Conflicts:
	daemon/src/managerimpl.cpp
	daemon/src/sip/sipaccount.h
parents 0ba34215 0bde5fde
......@@ -55,6 +55,7 @@ doc/*.html
*x86_64-unknown-*
sip_autoconf.h
os-auto.mak
cc-auto.mak
build.mak
config.log
config.status
......@@ -69,6 +70,13 @@ config_auto.h
# Cscope/Ctags files
cscope.*
tags
TAGS.LST
ID
# IDE stuffs
nbproject
# JNI generated files
*_wrap.cpp
*_wrap.h
*_loader.c
......@@ -13,6 +13,7 @@ break-blocks # Pad empty lines around header blocks (e.g. 'if', 'while'..
brackets=linux
unpad-paren # Remove unwanted space around parentheses
pad-header # Insert space padding after paren headers only (e.g. 'if', 'for', 'while'...)
pad-oper # Insert space padding around operator
formatted # only display files that have changed
recursive # recursively enter subdirs
suffix=none # don't create backup files (that's what version control is for)
This diff is collapsed.
aclocal.m4
build-aux
configure
src/dbus/org.sflphone.SFLphone.service
src/client/dbus/org.sflphone.SFLphone.service
src/sflphoned
# Ignore sub-modules stuff
......
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>daemon</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
<triggers>clean,full,incremental,</triggers>
<arguments>
<dictionary>
<key>?name?</key>
<value></value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.append_environment</key>
<value>true</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.autoBuildTarget</key>
<value>all</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.buildArguments</key>
<value>-j</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.buildCommand</key>
<value>make</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.buildLocation</key>
<value>${workspace_loc:/daemon}</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.cleanBuildTarget</key>
<value>clean</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.contents</key>
<value>org.eclipse.cdt.make.core.activeConfigSettings</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.enableAutoBuild</key>
<value>false</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.enableCleanBuild</key>
<value>true</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.enableFullBuild</key>
<value>true</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.fullBuildTarget</key>
<value>all</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.stopOnError</key>
<value>true</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key>
<value>true</value>
</dictionary>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.cdt.core.cnature</nature>
<nature>org.eclipse.cdt.core.ccnature</nature>
<nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
</natures>
</projectDescription>
./configure --without-dbus --without-alsa --without-pulse --without-tls --without-iax2 --without-zrtp --without-sdes --without-speexdsp --without-speex
......@@ -35,6 +35,9 @@ LT_INIT
dnl Define C++ as default language
AC_LANG(C++)
dnl Check for C++11 support
AX_CXX_COMPILE_STDCXX_11
dnl Check for header files
AC_FUNC_ALLOCA
AC_HEADER_STDC
......@@ -74,7 +77,16 @@ PKG_CHECK_MODULES(LIBCRYPTO, libcrypto >= ${LIBCRYPTO_MIN_VERSION}, HAVE_LIBCRYP
dnl Check for alsa development package - name: libasound2-dev
ALSA_MIN_VERSION=1.0
PKG_CHECK_MODULES(ALSA, alsa >= ${ALSA_MIN_VERSION},, AC_MSG_ERROR([Missing alsa development package: libasound2-dev or alsa-lib-devel]))
AC_ARG_WITH([alsa],
[ AS_HELP_STRING([--without-alsa], [disable support for alsa]) ],
[],
[with_alsa=yes])
AS_IF([test "x$with_alsa" = "xyes"], [
PKG_CHECK_MODULES(ALSA, alsa >= ${ALSA_MIN_VERSION},, AC_MSG_ERROR([Missing alsa development files]))
]);
AC_DEFINE_UNQUOTED([HAVE_ALSA], `if test "x$with_alsa" = "xyes"; then echo 1; else echo 0; fi`, [Define if you have alsa])
AM_CONDITIONAL(BUILD_ALSA, test "x$with_alsa" = "xyes")
dnl Check for pulseaudio development package - name: libpulse-dev
......@@ -85,15 +97,18 @@ AC_ARG_WITH([pulse],
[with_pulse=yes])
AS_IF([test "x$with_pulse" = "xyes"], [
PKG_CHECK_MODULES(PULSEAUDIO, libpulse >= ${LIBPULSE_MIN_VERSION},, AC_MSG_ERROR([Missing pulseaudio development package: libpulse-dev]))
PKG_CHECK_MODULES(PULSEAUDIO, libpulse >= ${LIBPULSE_MIN_VERSION},, AC_MSG_ERROR([Missing pulseaudio development files]))
]);
AC_DEFINE_UNQUOTED([HAVE_PULSE], `if test "x$with_pulse" = "xyes"; then echo 1; else echo 0; fi`, [Define if you have pulseaudio])
AM_CONDITIONAL(BUILD_PULSE, test "x$with_pulse" = "xyes" )
AM_CONDITIONAL(BUILD_PULSE, test "x$with_pulse" = "xyes")
dnl Check for the samplerate development package - name: libsamplerate0-dev
LIBSAMPLERATE_MIN_VERSION=0.1.2
PKG_CHECK_MODULES(SAMPLERATE, samplerate >= ${LIBSAMPLERATE_MIN_VERSION},, AC_MSG_ERROR([Missing libsamplerate development package: libsamplerate0-dev]))
PKG_CHECK_MODULES(SAMPLERATE, samplerate >= ${LIBSAMPLERATE_MIN_VERSION},, AC_MSG_ERROR([Missing libsamplerate development files]))
dnl Check for the sndfile development package - name: libsndfile-dev
PKG_CHECK_MODULES(SNDFILE, sndfile,, AC_MSG_ERROR([Missing sndfile development files]))
dnl Coverage is default-disabled
AC_ARG_ENABLE([coverage], AS_HELP_STRING([--enable-coverage], [Enable coverage]))
......@@ -112,22 +127,22 @@ AS_IF([test "x$enable_video" = "xyes"],
dnl The libav versions correspond to the last libav release: 0.7
dnl Check for libavcodec development package - name: libavcodec-dev
PKG_CHECK_MODULES(LIBAVCODEC, libavcodec >= 53.5.0,, AC_MSG_ERROR([Missing libavcodec package: libavcodec-dev]))
PKG_CHECK_MODULES(LIBAVCODEC, libavcodec >= 53.5.0,, AC_MSG_ERROR([Missing libavcodec development files]))
LIBAVCODEC_CFLAGS="${LIBAVCODEC_CFLAGS} -D__STDC_CONSTANT_MACROS"
dnl Check for libavformat development package - name: libavformat-dev
PKG_CHECK_MODULES(LIBAVFORMAT, libavformat >= 53.2.0,, AC_MSG_ERROR([Missing libavformat package: libavformat-dev]))
PKG_CHECK_MODULES(LIBAVFORMAT, libavformat >= 53.2.0,, AC_MSG_ERROR([Missing libavformat development files]))
dnl Check for libswscale development package - name: libswcale-dev
PKG_CHECK_MODULES(LIBSWSCALE, libswscale >= 1.1.0,, AC_MSG_ERROR([Missing libswscale package: libswscale-dev]))
PKG_CHECK_MODULES(LIBSWSCALE, libswscale >= 1.1.0,, AC_MSG_ERROR([Missing libswscale development files]))
dnl Check for libavdevice development package - name: libavdevice-dev
PKG_CHECK_MODULES(LIBAVDEVICE, libavdevice >= 53.0.0,, AC_MSG_ERROR([Missing libavdevice package: libavdevice-dev]))
PKG_CHECK_MODULES(LIBAVDEVICE, libavdevice >= 53.0.0,, AC_MSG_ERROR([Missing libavdevice development files]))
dnl Check for libavutil development package - name: libavutil-dev
PKG_CHECK_MODULES(LIBAVUTIL, libavutil >= 51.7.0,, AC_MSG_ERROR([Missing libavutil package: libavutil-dev]))
PKG_CHECK_MODULES(LIBAVUTIL, libavutil >= 51.7.0,, AC_MSG_ERROR([Missing libavutil development files]))
PKG_CHECK_MODULES(UDEV, libudev,, AC_MSG_ERROR([Missing libudev package: libudev-dev]))
PKG_CHECK_MODULES(UDEV, libudev,, AC_MSG_ERROR([Missing libudev development files]))
],
[AM_CONDITIONAL(SFL_VIDEO, false)]);
......@@ -135,12 +150,12 @@ AS_IF([test "x$enable_video" = "xyes"],
LIBCCGNU2_MIN_VERSION=1.3.1
PKG_CHECK_MODULES([CCGNU2], [commoncpp] >= ${LIBCCGNU2_MIN_VERSION}, AC_DEFINE_UNQUOTED([COMMONCPP_PREFIX], [1], [Use commoncpp include prefix]), [
PKG_CHECK_MODULES([CCGNU2], [libccgnu2] >= ${LIBCCGNU2_MIN_VERSION}, AC_DEFINE_UNQUOTED([CCPP_PREFIX], [1], [Use cc++ include prefix]),
AC_MSG_ERROR([Missing common cpp development package: libcommoncpp2-dev]))
AC_MSG_ERROR([Missing commoncpp development files]))
])
LIBCCRTP_MIN_VERSION=1.3.0
PKG_CHECK_MODULES([CCRTP], [libccrtp] >= ${LIBCCRTP_MIN_VERSION},, [
PKG_CHECK_MODULES([CCRTP], [libccrtp1] >= ${LIBCCRTP_MIN_VERSION},, AC_MSG_ERROR([Missing ccrtp development package: libccrtp-dev]))
PKG_CHECK_MODULES([CCRTP], [libccrtp1] >= ${LIBCCRTP_MIN_VERSION},, AC_MSG_ERROR([Missing ccrtp development files]))
])
......@@ -152,7 +167,7 @@ AC_ARG_WITH([tls],
[],
[with_tls=yes])
AS_IF([test "x$with_tls" = "xyes"], [
PKG_CHECK_MODULES([libssl], libssl,, AC_MSG_ERROR([Missing ssl development package: libssl-dev]))
PKG_CHECK_MODULES([libssl], libssl,, AC_MSG_ERROR([Missing ssl development files]))
]);
AC_DEFINE_UNQUOTED([HAVE_TLS], `if test "x$with_tls" = "xyes"; then echo 1; else echo 0; fi`, [Define if you have tls support])
......@@ -168,22 +183,23 @@ AC_ARG_WITH([zrtp],
[],
[with_zrtp=yes])
AS_IF([test "x$with_zrtp" = "xyes"], [
PKG_CHECK_MODULES([ZRTPCPP], libzrtpcpp >= ${LIBZRTPCPP_MIN_VERSION},, AC_MSG_ERROR([Missing zrtp development package: libzrtpcpp-dev]))
PKG_CHECK_MODULES([ZRTPCPP], libzrtpcpp >= ${LIBZRTPCPP_MIN_VERSION},, AC_MSG_ERROR([Missing zrtp development files]))
]);
AC_DEFINE_UNQUOTED([HAVE_ZRTP], `if test "x$with_zrtp" = "xyes"; then echo 1; else echo 0; fi`, [Define if you have zrtp support])
AM_CONDITIONAL(BUILD_ZRTP, test "x$with_zrtp" = "xyes" )
# DBUSCPP
dnl Check for dbuscpp, the C++ bindings for D-Bus
AC_ARG_WITH([dbus],
[AS_HELP_STRING([--without-dbus], [disable support for dbus])],
[],
[with_dbus=yes])
AS_IF([test "x$with_dbus" = "xyes"], [
PKG_CHECK_MODULES(DBUSCPP, dbus-c++-1,, AC_MSG_WARN([Missing dbus development files]))
]);
# DBUS
# required dependency(ies): libdbus-c++
dnl DBus-C++ detection
dnl pkg-config doesn't like 0.6.0-pre1 version number, it assumes that it is
dnl more recent than (unreleased) 0.6.0
DBUS_CPP_REQUIRED_VERSION=0.6.0-pre1
PKG_CHECK_MODULES(DBUSCPP, dbus-c++-1,,
AC_MSG_ERROR([You need the DBus-c++ libraries (version $DBUS_CPP_REQUIRED_VERSION or better)]))
AC_DEFINE_UNQUOTED([HAVE_DBUS], `if test "x$with_dbus" = "xyes"; then echo 1; else echo 0; fi`, [Define if you have dbus support])
# Instant Messaging
# required dependency(ies): libxpat
......@@ -193,7 +209,7 @@ AC_ARG_WITH([instant_messaging],
[with_instant_messaging=yes])
AS_IF([test "x$with_instant_messaging" = "xyes"], [
AX_LIB_EXPAT([1.95.0])
AS_IF([test "$HAVE_EXPAT" != "yes"], [AC_MSG_ERROR([libexpat could not be found, which is required to build this package.])], [])
AS_IF([test "$HAVE_EXPAT" != "yes"], [AC_MSG_ERROR([Missing libexpat development files])], [])
]);
AC_DEFINE_UNQUOTED([HAVE_INSTANT_MESSAGING], `if test "x$with_instant_messaging" = "xyes"; then echo 1; else echo 0; fi`, [Define if you have instant messaging support])
......@@ -253,7 +269,7 @@ AC_ARG_WITH([speex],
[with_speex=yes])
AS_IF([test "x$with_speex" != xno],
[AC_CHECK_HEADER([speex/speex.h], , AC_MSG_FAILURE([Unable to find the libspeex headers (you may need to install the dev package). You may use --without-speex to compile without speex codec support.]))]
[AC_CHECK_HEADER([speex/speex.h], , AC_MSG_FAILURE([Missing speex development files. You may use --without-speex to compile without speex codec support.]))]
[AC_CHECK_LIB([speex], [speex_decode_int],
[],
[AC_MSG_FAILURE([libspeex link test failed. You may use --without-speex to compile without speex codec support.])])
......@@ -273,7 +289,7 @@ AC_ARG_WITH([speexdsp],
[with_speexdsp=yes])
AS_IF([test "x$with_speexdsp" != xno],
AC_CHECK_HEADER([speex/speex_preprocess.h], , AC_MSG_FAILURE([Unable to find the libspeexdsp headers (you may need to install the libspeexdsp-dev package) used for Noise Suppression and Automatic Gain Control.]))
AC_CHECK_HEADER([speex/speex_preprocess.h], , AC_MSG_FAILURE([Missing libspeexdsp development files used for Noise Suppression and Automatic Gain Control.]))
AC_SEARCH_LIBS([speex_preprocess_run], [speexdsp], [], [AC_MSG_ERROR([Unable to find speexdsp development files])])
)
......@@ -365,7 +381,8 @@ AC_CONFIG_FILES([Makefile \
src/audio/sound/Makefile \
src/audio/codecs/Makefile \
src/config/Makefile \
src/dbus/Makefile \
src/client/Makefile \
src/client/dbus/Makefile \
src/hooks/Makefile \
src/history/Makefile \
src/video/Makefile \
......
......@@ -25,6 +25,12 @@ else
SPEEXCODEC=
endif
if BUILD_OPUS
OPUSCODEC=-DHAVE_OPUS
else
OPUSCODEC=
endif
if BUILD_GSM
GSMCODEC=-DHAVE_GSM_CODEC
else
......@@ -46,8 +52,9 @@ AM_CPPFLAGS = \
-DCODECS_DIR=\""$(sflcodecdir)"\" \
-DPLUGINS_DIR=\""$(sflplugindir)"\" \
-DENABLE_TRACE \
$(SPEEXCODEC) \
$(GSMCODEC)
$(SPEEXCODEC) \
$(GSMCODEC) \
$(OPUSCODEC)
indent:
......
......@@ -564,7 +564,7 @@ static int calc_timestamp(struct iax_session *session, unsigned int ts, struct a
special cases. */
if (ts)
{
if ( f && session )
if ( f )
session->lastsent = ts;
return ts;
}
......@@ -842,12 +842,14 @@ static int iax_reliable_xmit(struct iax_frame *f)
if (!fc->data || !fc->datalen) {
IAXERROR "No frame data?");
DEBU(G "No frame data?\n");
free(fc);
return -1;
} else {
fc->data = (char *)malloc(fc->datalen);
if (!fc->data) {
DEBU(G "Out of memory\n");
IAXERROR "Out of memory\n");
free(fc);
return -1;
}
memcpy(fc->data, f->data, f->datalen);
......@@ -876,7 +878,7 @@ int iax_init(int preferredportno)
if (iax_recvfrom == (iax_recvfrom_t)recvfrom)
{
struct sockaddr_in sin;
struct sockaddr_in sin = {};
socklen_t sinlen;
int flags;
int bufsize = 256 * 1024;
......@@ -1198,7 +1200,7 @@ static int iax_send(struct iax_session *pvt, struct ast_frame *f, unsigned int t
res = iax_xmit_frame(fr);
}
}
if( !now && fr!=NULL )
if( !now )
iax_frame_free( fr );
return res;
}
......@@ -1989,6 +1991,7 @@ void iax_pref_codec_del(struct iax_session *session, unsigned int format)
char remove = which_bit(format) + diff;
strncpy(old, session->codec_order, sizeof(old));
old[sizeof(old) - 1] = '\0';
session->codec_order_len = 0;
for (x = 0; x < (int) strlen(old); x++) {
......@@ -2644,6 +2647,7 @@ static struct iax_event *iax_header_to_event(struct iax_session *session, struct
strncpy(session->codec_order,
e->ies.codec_prefs,
sizeof(session->codec_order));
session->codec_order[sizeof(session->codec_order) - 1] = '\0';
session->codec_order_len =
(int)strlen(session->codec_order);
}
......@@ -3128,7 +3132,7 @@ struct iax_event *iax_net_process(unsigned char *buf, int len, struct sockaddr_i
static struct iax_sched *iax_get_sched(struct timeval tv)
{
struct iax_sched *cur, *prev=NULL;
struct iax_sched *cur;
cur = schedq;
/* Check the event schedule first. */
while(cur) {
......@@ -3136,11 +3140,7 @@ static struct iax_sched *iax_get_sched(struct timeval tv)
((tv.tv_sec == cur->when.tv_sec) &&
(tv.tv_usec >= cur->when.tv_usec))) {
/* Take it out of the event queue */
if (prev) {
prev->next = cur->next;
} else {
schedq = cur->next;
}
schedq = cur->next;
return cur;
}
cur = cur->next;
......
......@@ -369,7 +369,7 @@ void iax_showframe(struct iax_frame *f, struct ast_iax2_full_hdr *fhi, int rx, s
/* Don't mess with mini-frames */
return;
}
if (fh->type > (int)sizeof(frames)/(int)sizeof(char *)) {
if (fh->type >= (int)sizeof(frames)/(int)sizeof(char *)) {
snprintf(class2, (int)sizeof(class2), "(%d?)", fh->type);
clas = class2;
} else {
......@@ -386,7 +386,7 @@ void iax_showframe(struct iax_frame *f, struct ast_iax2_full_hdr *fhi, int rx, s
subclass = iaxs[(int)fh->csub];
}
} else if (fh->type == AST_FRAME_CONTROL) {
if (fh->csub > (int)sizeof(cmds)/(int)sizeof(char *)) {
if (fh->csub >= (int)sizeof(cmds)/(int)sizeof(char *)) {
snprintf(subclass2, (int)sizeof(subclass2), "(%d?)", fh->csub);
subclass = subclass2;
} else {
......
......@@ -237,8 +237,10 @@ static void history_calc_maxbuf(jitterbuf *jb)
for (j=0;j<JB_HISTORY_MAXBUF_SZ;j++) {
/* found where it fits */
if (toins > jb->hist_maxbuf[j]) {
/* move over */
memmove(jb->hist_maxbuf + j + 1, jb->hist_maxbuf + j, (JB_HISTORY_MAXBUF_SZ - (j + 1)) * sizeof(jb->hist_maxbuf[0]));
/* move over if there's space */
const size_t slide = (JB_HISTORY_MAXBUF_SZ - (j + 1)) * sizeof(jb->hist_maxbuf[0]);
if (j < (JB_HISTORY_MAXBUF_SZ - 1))
memmove(jb->hist_maxbuf + j + 1, jb->hist_maxbuf + j, slide);
/* insert */
jb->hist_maxbuf[j] = toins;
......@@ -254,8 +256,10 @@ static void history_calc_maxbuf(jitterbuf *jb)
for (j=0;j<JB_HISTORY_MAXBUF_SZ;j++) {
/* found where it fits */
if (toins < jb->hist_minbuf[j]) {
/* move over */
memmove(jb->hist_minbuf + j + 1, jb->hist_minbuf + j, (JB_HISTORY_MAXBUF_SZ - (j + 1)) * sizeof(jb->hist_minbuf[0]));
/* move over if there's space */
const size_t slide = (JB_HISTORY_MAXBUF_SZ - (j + 1)) * sizeof(jb->hist_minbuf[0]);
if (j < (JB_HISTORY_MAXBUF_SZ - 1))
memmove(jb->hist_minbuf + j + 1, jb->hist_minbuf + j, slide);
/* insert */
jb->hist_minbuf[j] = toins;
......@@ -263,18 +267,6 @@ static void history_calc_maxbuf(jitterbuf *jb)
}
}
}
if (0) {
int k;
fprintf(stderr, "toins = %ld\n", toins);
fprintf(stderr, "maxbuf =");
for (k=0;k<JB_HISTORY_MAXBUF_SZ;k++)
fprintf(stderr, "%ld ", jb->hist_maxbuf[k]);
fprintf(stderr, "\nminbuf =");
for (k=0;k<JB_HISTORY_MAXBUF_SZ;k++)
fprintf(stderr, "%ld ", jb->hist_minbuf[k]);
fprintf(stderr, "\n");
}
}
jb->hist_maxbuf_valid = 1;
......
......@@ -116,7 +116,7 @@ void IAX_MD5Update(struct IAX_MD5Context *ctx, uint8_t const *buf, unsigned int
}
memcpy(p, buf, t);
IAX_byteReverse(ctx->in, 16);
IAX_MD5Transform(ctx->buf, (uint32_t *) ctx->in);
IAX_MD5Transform(ctx->buf, ctx->in_32);
buf += t;
len -= t;
}
......@@ -171,13 +171,13 @@ void IAX_MD5Final(uint8_t digest[16], struct IAX_MD5Context *ctx)
IAX_byteReverse(ctx->in, 14);
/* Append length in bits and transform */
((uint32_t *) ctx->in)[14] = ctx->bits[0];
((uint32_t *) ctx->in)[15] = ctx->bits[1];
ctx->in_32[14] = ctx->bits[0];
ctx->in_32[15] = ctx->bits[1];
IAX_MD5Transform(ctx->buf, (uint32_t *) ctx->in);
IAX_MD5Transform(ctx->buf, ctx->in_32);
IAX_byteReverse((uint8_t *) ctx->buf, 4);
memcpy(digest, ctx->buf, 16);
memset(ctx, 0, sizeof(ctx)); /* In case it's sensitive */
memset(ctx, 0, sizeof(*ctx)); /* In case it's sensitive */
}
#ifndef ASM_MD5
......
......@@ -11,7 +11,10 @@ typedef unsigned char uint8_t;
struct IAX_MD5Context {
uint32_t buf[4];
uint32_t bits[2];
uint8_t in[64];
union {
uint8_t in[64];
uint32_t in_32[16];
};
};
void IAX_MD5Init(struct IAX_MD5Context *context);
......
# ============================================================================
# http://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx_11.html
# ============================================================================
#
# SYNOPSIS
#
# AX_CXX_COMPILE_STDCXX_11([ext|noext],[mandatory|optional])
#
# DESCRIPTION
#
# Check for baseline language coverage in the compiler for the C++11
# standard; if necessary, add switches to CXXFLAGS to enable support.
#
# The first argument, if specified, indicates whether you insist on an
# extended mode (e.g. -std=gnu++11) or a strict conformance mode (e.g.
# -std=c++11). If neither is specified, you get whatever works, with
# preference for an extended mode.
#
# The second argument, if specified 'mandatory' or if left unspecified,
# indicates that baseline C++11 support is required and that the macro
# should error out if no mode with that support is found. If specified
# 'optional', then configuration proceeds regardless, after defining
# HAVE_CXX11 if and only if a supporting mode is found.
#
# LICENSE
#
# Copyright (c) 2008 Benjamin Kosnik <bkoz@redhat.com>
# Copyright (c) 2012 Zack Weinberg <zackw@panix.com>
# Copyright (c) 2013 Roy Stogner <roystgnr@ices.utexas.edu>
#
# Copying and distribution of this file, with or without modification, are
# permitted in any medium without royalty provided the copyright notice
# and this notice are preserved. This file is offered as-is, without any
# warranty.
#serial 3
m4_define([_AX_CXX_COMPILE_STDCXX_11_testbody], [
template <typename T>
struct check
{
static_assert(sizeof(int) <= sizeof(T), "not big enough");
};
typedef check<check<bool>> right_angle_brackets;
int a;
decltype(a) b;
typedef check<int> check_type;
check_type c;
check_type&& cr = static_cast<check_type&&>(c);
auto d = a;
])
AC_DEFUN([AX_CXX_COMPILE_STDCXX_11], [dnl
m4_if([$1], [], [],
[$1], [ext], [],
[$1], [noext], [],
[m4_fatal([invalid argument `$1' to AX_CXX_COMPILE_STDCXX_11])])dnl
m4_if([$2], [], [ax_cxx_compile_cxx11_required=true],
[$2], [mandatory], [ax_cxx_compile_cxx11_required=true],
[$2], [optional], [ax_cxx_compile_cxx11_required=false],
[m4_fatal([invalid second argument `$2' to AX_CXX_COMPILE_STDCXX_11])])dnl
AC_LANG_PUSH([C++])dnl
ac_success=no
AC_CACHE_CHECK(whether $CXX supports C++11 features by default,
ax_cv_cxx_compile_cxx11,
[AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_11_testbody])],
[ax_cv_cxx_compile_cxx11=yes],
[ax_cv_cxx_compile_cxx11=no])])
if test x$ax_cv_cxx_compile_cxx11 = xyes; then
ac_success=yes
fi
m4_if([$1], [noext], [], [dnl
if test x$ac_success = xno; then
for switch in -std=gnu++11 -std=gnu++0x; do
cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx11_$switch])
AC_CACHE_CHECK(whether $CXX supports C++11 features with $switch,
$cachevar,
[ac_save_CXXFLAGS="$CXXFLAGS"
CXXFLAGS="$CXXFLAGS $switch"
AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_11_testbody])],
[eval $cachevar=yes],
[eval $cachevar=no])
CXXFLAGS="$ac_save_CXXFLAGS"])
if eval test x\$$cachevar = xyes; then
CXXFLAGS="$CXXFLAGS $switch"
ac_success=yes
break
fi
done
fi])
m4_if([$1], [ext], [], [dnl
if test x$ac_success = xno; then
for switch in -std=c++11 -std=c++0x; do
cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx11_$switch])
AC_CACHE_CHECK(whether $CXX supports C++11 features with $switch,
$cachevar,
[ac_save_CXXFLAGS="$CXXFLAGS"
CXXFLAGS="$CXXFLAGS $switch"
AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_11_testbody])],
[eval $cachevar=yes],
[eval $cachevar=no])
CXXFLAGS="$ac_save_CXXFLAGS"])
if eval test x\$$cachevar = xyes; then
CXXFLAGS="$CXXFLAGS $switch"
ac_success=yes
break
fi
done
fi])
AC_LANG_POP([C++])
if test x$ax_cxx_compile_cxx11_required = xtrue; then
if test x$ac_success = xno; then
AC_MSG_ERROR([*** A compiler with support for C++11 language features is required.])
fi
else
if test x$ac_success = xno; then
HAVE_CXX11=0
AC_MSG_NOTICE([No compiler with C++11 support was found])
else
HAVE_CXX11=1
AC_DEFINE(HAVE_CXX11,1,
[define if the compiler supports basic C++11 syntax])
fi