From 639bb7dc5d61054615fee8e4da272ad5ce9140ee Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Fri, 2 Dec 2011 20:38:31 +0000 Subject: [PATCH] use compiler-generated _LP64 macro to detect x86_64 rather than USE_X86_64_ASM git-svn-id: svn://localhost/ardour2/branches/3.0@10871 d708f5d6-7413-0410-9779-e7cbd77b26cf --- libs/pbd/fpu.cc | 7 ++++--- wscript | 6 ++---- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/libs/pbd/fpu.cc b/libs/pbd/fpu.cc index a004d8a839..1018414d9b 100644 --- a/libs/pbd/fpu.cc +++ b/libs/pbd/fpu.cc @@ -19,12 +19,12 @@ FPU::FPU () _flags = Flags (0); -#ifndef ARCH_X86 +#if !( (defined __x86_64__) || (defined __i386__) ) // !ARCH_X86 return; -#endif +#else -#ifndef USE_X86_64_ASM +#ifndef _LP64 //USE_X86_64_ASM asm volatile ( "mov $1, %%eax\n" "pushl %%ebx\n" @@ -102,6 +102,7 @@ FPU::FPU () free (fxbuf); } } +#endif } FPU::~FPU () diff --git a/wscript b/wscript index 6ec0fd7258..f7fc6a882c 100644 --- a/wscript +++ b/wscript @@ -182,7 +182,8 @@ def set_compiler_flags (conf,opt): # # ARCH_X86 means anything in the x86 family from i386 to x86_64 - # USE_X86_64_ASM is used to distingush 32 and 64 bit assembler + # the compile-time presence of the macro _LP64 is used to + # distingush 32 and 64 bit assembler # if (re.search ("(i[0-9]86|x86_64)", config[config_cpu]) != None): @@ -227,9 +228,6 @@ def set_compiler_flags (conf,opt): elif conf.env['build_target'] == 'i686' or conf.env['build_target'] == 'x86_64': optimization_flags.append ("-DBUILD_SSE_OPTIMIZATIONS") debug_flags.append ("-DBUILD_SSE_OPTIMIZATIONS") - elif conf.env['build_target'] == 'x86_64': - optimization_flags.append ("-DUSE_X86_64_ASM") - debug_flags.append ("-DUSE_X86_64_ASM") if not build_host_supports_sse: print("\nWarning: you are building Ardour with SSE support even though your system does not support these instructions. (This may not be an error, especially if you are a package maintainer)")