diff options
author | Mathieu Arnold <mat@FreeBSD.org> | 2016-07-26 16:51:15 +0000 |
---|---|---|
committer | Mathieu Arnold <mat@FreeBSD.org> | 2016-07-26 16:51:15 +0000 |
commit | 9fa9eb9ac7bf1d3de825ee25a8f0ae81b7b77896 (patch) | |
tree | 9b071a8105704e992946dcd6b801e9fcb7635142 /audio/csound6/files/patch-Top_csound.c | |
parent | 5a20e7990eb544509174d617d359bf0d4ac64737 (diff) | |
download | ports-9fa9eb9ac7bf1d3de825ee25a8f0ae81b7b77896.tar.gz ports-9fa9eb9ac7bf1d3de825ee25a8f0ae81b7b77896.zip |
Cleanup patches, a* categories.
Rename them to follow the make makepatch naming, and regenerate them.
With hat: portmgr
Sponsored by: Absolight
Notes
Notes:
svn path=/head/; revision=419133
Diffstat (limited to 'audio/csound6/files/patch-Top_csound.c')
-rw-r--r-- | audio/csound6/files/patch-Top_csound.c | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/audio/csound6/files/patch-Top_csound.c b/audio/csound6/files/patch-Top_csound.c new file mode 100644 index 000000000000..3d417d6ace46 --- /dev/null +++ b/audio/csound6/files/patch-Top_csound.c @@ -0,0 +1,55 @@ +--- Top/csound.c.orig 2015-09-29 11:13:27 UTC ++++ Top/csound.c +@@ -60,10 +60,13 @@ + #include "cs_par_dispatch.h" + #include "csound_orc_semantics.h" + +-#if defined(linux) || defined(__HAIKU__) || defined(__EMSCRIPTEN__) ++#if defined(linux) || defined(__HAIKU__) || defined(__FreeBSD__) || defined(__EMSCRIPTEN__) + #define PTHREAD_SPINLOCK_INITIALIZER 0 + #endif + ++#if defined(__FreeBSD__) ++#include <sys/sysctl.h> ++#endif + #if defined(USE_OPENMP) + #include <omp.h> + #endif /* USE_OPENMP */ +@@ -3510,7 +3513,7 @@ void csoundNotifyFileOpened(CSOUND* csou + /* ------------------------------------ */ + + #if defined(HAVE_RDTSC) +-#if !(defined(LINUX) && defined(__GNUC__) && defined(__i386__)) ++#if !(defined(LINUX) && defined(__GNUC__) && defined(__i386__)) || !(defined(__FreeBSD__) && defined(__i386__)) + #undef HAVE_RDTSC + #endif + #endif +@@ -3523,6 +3526,13 @@ static double timeResolutionSeconds = -1 + static int getTimeResolution(void) + { + #if defined(HAVE_RDTSC) ++#if defined(__FreeBSD__) ++ size_t size; ++ int timeResolutionSeconds; ++ size = sizeof timeResolutionSeconds; ++ sysctlbyname("hw.clockrate", &timeResolutionSeconds, &size, NULL, 0); ++ ++#else + FILE *f; + char buf[256]; + +@@ -3558,9 +3568,14 @@ static int getTimeResolution(void) + } + } + fclose(f); ++#endif /* __FreeBSD__ */ + if (UNLIKELY(timeResolutionSeconds <= 0.0)) { + fprintf(stderr, Str("No valid CPU frequency entry " ++#if defined(__FreeBSD__) ++ "was found.\n")); ++#else + "was found in /proc/cpuinfo.\n")); ++#endif /* __FreeBSD__ */ + return -1; + } + /* MHz -> seconds */ |