configure.ac: disable C++ exceptions

We don't use exceptions currently.  Since allowing exceptions means a
lot of overhead, this commit disables the feature.
This commit is contained in:
Max Kellermann 2013-01-02 19:12:27 +01:00
parent 7768baa4d1
commit a6371e2e66
3 changed files with 6 additions and 10 deletions

View File

@ -1541,6 +1541,7 @@ if test "x$enable_debug" = xno; then
AX_APPEND_COMPILE_FLAGS([-fvisibility=hidden])
AX_APPEND_COMPILE_FLAGS([-fno-threadsafe-statics])
AX_APPEND_COMPILE_FLAGS([-fmerge-all-constants])
AX_APPEND_COMPILE_FLAGS([-fno-exceptions])
AC_LANG_POP
AX_APPEND_LINK_FLAGS([-Wl,--gc-sections])

View File

@ -13,11 +13,9 @@ class dxd
{
dsd2pcm_ctx *handle;
public:
dxd() : handle(dsd2pcm_init())
{ if (!handle) throw std::runtime_error("wtf?!"); }
dxd() : handle(dsd2pcm_init()) {}
dxd(dxd const& x) : handle(dsd2pcm_clone(x.handle))
{ if (!handle) throw std::runtime_error("wtf?!"); }
dxd(dxd const& x) : handle(dsd2pcm_clone(x.handle)) {}
~dxd() { dsd2pcm_destroy(handle); }

View File

@ -14,14 +14,12 @@ class noise_shaper
public:
noise_shaper(int sos_count, const float *bbaa)
{
if (noise_shape_init(&ctx,sos_count,bbaa))
throw std::runtime_error("noise shaper initialization failed");
noise_shape_init(&ctx, sos_count, bbaa);
}
noise_shaper(noise_shaper const& x)
{
if (noise_shape_clone(&x.ctx,&ctx))
throw std::runtime_error("noise shaper initialization failed");
noise_shape_clone(&x.ctx,&ctx);
}
~noise_shaper()
@ -31,8 +29,7 @@ public:
{
if (this != &x) {
noise_shape_destroy(&ctx);
if (noise_shape_clone(&x.ctx,&ctx))
throw std::runtime_error("noise shaper initialization failed");
noise_shape_clone(&x.ctx,&ctx);
}
return *this;
}