Merge branch 'master' into cairocanvas
[ardour.git] / libs / pbd / fpu.cc
index 479c422c379c4c2ffc5d570828498f9556a7d9c1..b12d341366fe8c4ae701ebb845f613535d2be7bf 100644 (file)
@@ -1,3 +1,22 @@
+/*
+    Copyright (C) 2012 Paul Davis 
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+*/
+#ifndef  COMPILER_MSVC
 #include "libpbd-config.h"
 
 #define _XOPEN_SOURCE 600
@@ -20,11 +39,14 @@ FPU::FPU ()
 
        _flags = Flags (0);
 
+#if defined(__MINGW64__) // Vkamyshniy: under __MINGW64__ the assembler code below is not compiled
+       return;
+#endif
+
 #if !( (defined __x86_64__) || (defined __i386__) ) // !ARCH_X86
        return;
 #else
 
-       
 #ifndef _LP64 //USE_X86_64_ASM
        asm volatile (
                "mov $1, %%eax\n"
@@ -80,15 +102,15 @@ FPU::FPU ()
                   supported, otherwise, it isn't.
                */
                
-#ifdef NO_POSIX_MEMALIGN
+#ifndef HAVE_POSIX_MEMALIGN
                fxbuf = (char **) malloc (sizeof (char *));
                assert (fxbuf);
                *fxbuf = (char *) malloc (512);
                assert (*fxbuf);
 #else
-               posix_memalign ((void **) &fxbuf, 16, sizeof (char *));
+               (void) posix_memalign ((void **) &fxbuf, 16, sizeof (char *));
                assert (fxbuf);
-               posix_memalign ((void **) fxbuf, 16, 512);
+               (void) posix_memalign ((void **) fxbuf, 16, 512);
                assert (*fxbuf);
 #endif                 
                
@@ -122,3 +144,7 @@ FPU::FPU ()
 FPU::~FPU ()
 {
 }
+
+#else  // COMPILER_MSVC
+       const char* pbd_fpu = "pbd/msvc/fpu.cc takes precedence over this file";
+#endif // COMPILER_MSVC