tests/common/127: Fix test on MinGW 64-bit

Instead of hard-coding whether the symbol should be underscored,
detect it.
pull/1346/head
Nirbheek Chauhan 8 years ago
parent 52e1b0a3c9
commit ebadef0fdf
  1. 5
      test cases/common/127 cpp and asm/meson.build
  2. 2
      test cases/common/127 cpp and asm/symbol-underscore.h

@ -1,5 +1,6 @@
project('c++ and assembly test', 'cpp')
cpp = meson.get_compiler('cpp')
cpu = host_machine.cpu_family()
supported_cpus = ['arm', 'x86', 'x86_64']
@ -8,6 +9,10 @@ if not supported_cpus.contains(cpu)
error('MESON_SKIP_TEST unsupported cpu:' + cpu)
endif
if cpp.symbols_have_underscore_prefix()
add_project_arguments('-DMESON_TEST__UNDERSCORE_SYMBOL', language : 'cpp')
endif
sources = ['trivial.cc']
# If the compiler cannot compile assembly, don't use it
if meson.get_compiler('cpp').get_id() != 'msvc'

@ -1,4 +1,4 @@
#if defined(__WIN32__) || defined(__APPLE__)
#if defined(MESON_TEST__UNDERSCORE_SYMBOL)
# define SYMBOL_NAME(name) _##name
#else
# define SYMBOL_NAME(name) name

Loading…
Cancel
Save