'libs/ardour' - Compiler specific includes and includes

This commit is contained in:
John Emmas
2013-08-04 17:01:37 +01:00
parent 490311bc08
commit d176cbc804
11 changed files with 86 additions and 4 deletions

View File

@@ -216,7 +216,10 @@ static inline cycles_t get_cycles (void)
/* debian: sparc, arm, m68k */
#ifndef COMPILER_MSVC
/* GRRR... Annoyingly, #warning aborts the compilation for MSVC !! */
#warning You are compiling libardour on a platform for which ardour/cycles.h needs work
#endif
#include <sys/time.h>

View File

@@ -17,11 +17,15 @@
*/
#include <sys/stat.h>
#ifdef COMPILER_MSVC
#include <sys/utime.h>
#else
#include <unistd.h>
#include <utime.h>
#endif
#include <sys/stat.h>
#include <fcntl.h>
#include <float.h>
#include <utime.h>
#include <cerrno>
#include <ctime>
#include <cmath>

View File

@@ -21,6 +21,10 @@
#include "ardour/session.h"
#include "ardour/types.h"
#ifdef COMPILER_MSVC
#pragma warning(disable:4305)
#endif
using namespace ARDOUR;
const Sample Session::default_click_emphasis[] = {

View File

@@ -29,7 +29,9 @@
#include <cstdlib>
#include <cstdio> // so libraptor doesn't complain
#include <cmath>
#ifndef COMPILER_MSVC
#include <dirent.h>
#endif
#include <sys/stat.h>
#include <cerrno>

View File

@@ -17,8 +17,10 @@
*/
#ifdef COMPILER_MSVC
#include <ardourext/float_cast.h>
#endif
#include "ardour/pcm_utils.h"
#include <cmath>
using namespace std;

View File

@@ -27,7 +27,9 @@
#include <cstdlib>
#include <cstdio> // so libraptor doesn't complain
#include <cmath>
#ifndef COMPILER_MSVC
#include <dirent.h>
#endif
#include <sys/stat.h>
#include <cerrno>
#include <utility>

View File

@@ -2114,6 +2114,54 @@ Session::refresh_disk_space ()
_total_free_4k_blocks_uncertain = true;
}
}
#elif defined (COMPILER_MSVC)
vector<string> scanned_volumes;
vector<string>::iterator j;
vector<space_and_path>::iterator i;
DWORD nSectorsPerCluster, nBytesPerSector,
nFreeClusters, nTotalClusters;
char disk_drive[4];
bool volume_found;
_total_free_4k_blocks = 0;
for (i = session_dirs.begin(); i != session_dirs.end(); i++) {
strncpy (disk_drive, (*i).path.c_str(), 3);
disk_drive[3] = 0;
strupr(disk_drive);
volume_found = false;
if (0 != (GetDiskFreeSpace(disk_drive, &nSectorsPerCluster, &nBytesPerSector, &nFreeClusters, &nTotalClusters)))
{
int64_t nBytesPerCluster = nBytesPerSector * nSectorsPerCluster;
int64_t nFreeBytes = nBytesPerCluster * (int64_t)nFreeClusters;
i->blocks = (uint32_t)(nFreeBytes / 4096);
for (j = scanned_volumes.begin(); j != scanned_volumes.end(); j++) {
if (0 == j->compare(disk_drive)) {
volume_found = true;
break;
}
}
if (!volume_found) {
scanned_volumes.push_back(disk_drive);
_total_free_4k_blocks += i->blocks;
}
}
}
if (0 == _total_free_4k_blocks) {
strncpy (disk_drive, path().c_str(), 3);
disk_drive[3] = 0;
if (0 != (GetDiskFreeSpace(disk_drive, &nSectorsPerCluster, &nBytesPerSector, &nFreeClusters, &nTotalClusters)))
{
int64_t nBytesPerCluster = nBytesPerSector * nSectorsPerCluster;
int64_t nFreeBytes = nBytesPerCluster * (int64_t)nFreeClusters;
_total_free_4k_blocks = (uint32_t)(nFreeBytes / 4096);
}
}
#endif
}

View File

@@ -17,7 +17,9 @@
*/
#ifndef COMPILER_MSVC
#include <stdbool.h>
#endif
#include <cstdio>
#include "ardour/session.h"
@@ -59,11 +61,19 @@ intptr_t Session::vst_callback (
if (effect && effect->user) {
plug = (VSTPlugin *) (effect->user);
session = &plug->session();
#ifdef COMPILER_MSVC
SHOW_CALLBACK ("am callback 0x%x, opcode = %d, plugin = \"%s\" ", (int) pthread_self().p, opcode, plug->name());
#else
SHOW_CALLBACK ("am callback 0x%x, opcode = %d, plugin = \"%s\" ", (int) pthread_self(), opcode, plug->name());
#endif
} else {
plug = 0;
session = 0;
#ifdef COMPILER_MSVC
SHOW_CALLBACK ("am callback 0x%x, opcode = %d", (int) pthread_self().p, opcode);
#else
SHOW_CALLBACK ("am callback 0x%x, opcode = %d", (int) pthread_self(), opcode);
#endif
}
switch(opcode){

View File

@@ -17,7 +17,9 @@
*/
#ifndef COMPILER_MSVC
#include <strings.h>
#endif
#include <map>
#include <sndfile.h>

View File

@@ -45,8 +45,11 @@ x86_sse_find_peaks(const ARDOUR::Sample* buf, ARDOUR::pframes_t nframes, float *
// use 64 byte prefetch for quadruple quads
while (nframes >= 16) {
#ifdef COMPILER_MSVC
_mm_prefetch(((char*)buf+64), 0); // A total guess! Assumed to be eqivalent to
#else // the line below but waiting to be tested !!
__builtin_prefetch(buf+64,0,0);
#endif
work = _mm_load_ps(buf);
current_min = _mm_min_ps(current_min, work);
current_max = _mm_max_ps(current_max, work);

View File

@@ -36,7 +36,9 @@
#include <sys/stat.h>
#include <sys/time.h>
#include <fcntl.h>
#ifndef COMPILER_MSVC
#include <dirent.h>
#endif
#include <errno.h>
#include <regex.h>