Browse Source

fix SIGTRAP not existing on windows

remove_deprecated_ffmpeg_api v0.2.1
Alexandros Theodotou 3 years ago
parent
commit
6ea38ecc2c
Signed by: alex
GPG Key ID: 022EAE42313D70F3
  1. 8
      meson.build
  2. 11
      tests/helper.h
  3. 1
      tests/meson.build
  4. 5
      tests/test.c

8
meson.build

@ -57,12 +57,15 @@ cdata.set_quoted ( @@ -57,12 +57,15 @@ cdata.set_quoted (
os_darwin = false
os_linux = false
os_freebsd = false
os_windows = false
if host_machine.system() == 'darwin'
os_darwin = true
elif host_machine.system() == 'linux'
os_linux = true
elif host_machine.system() == 'freebsd'
os_freebsd = true
elif host_machine.system() == 'windows'
os_windows = true
endif
inc = [
@ -130,6 +133,11 @@ audec_cflags = [ @@ -130,6 +133,11 @@ audec_cflags = [
'-Werror=type-limits',
'-Werror=deprecated-declarations',
]
if os_windows
audec_cflags += [
'-D_WOE32=1',
]
endif
audec_cflags = cc.get_supported_arguments (
audec_cflags)

11
tests/helper.h

@ -29,6 +29,14 @@ @@ -29,6 +29,14 @@
#define ad_printf(a,...) \
fprintf (stderr , a "\n", ##__VA_ARGS__)
#ifdef _WOE32
#define ad_assert(x) \
if (!(x)) \
{ \
ad_printf("Assertion failed: %s", #x); \
exit(1); \
}
#else
#define ad_assert(x) \
if (!(x)) \
{ \
@ -36,8 +44,9 @@ @@ -36,8 +44,9 @@
raise (SIGTRAP); \
exit(1); \
}
#endif
int
static inline int
str_endswith (
const char *s, const char *t)
{

1
tests/meson.build

@ -19,6 +19,7 @@ e = executable ( @@ -19,6 +19,7 @@ e = executable (
'test_exe', 'test.c',
include_directories: inc,
link_with: audec,
c_args: audec_cflags,
)
test (
'wav_test', e,

5
tests/test.c

@ -47,9 +47,10 @@ int main ( @@ -47,9 +47,10 @@ int main (
expected_channels_before = 2;
}
size_t expected_frames_after =
(double) expected_frames_before *
(size_t)
((double) expected_frames_before *
((double) sample_rate /
expected_sample_rate_before);
expected_sample_rate_before));
audec_init ();

Loading…
Cancel
Save