diff --git a/dev/externals/fastconv/fconv-fftw.cpp b/dev/externals/fastconv/fconv-fftw.cpp index 91aefc3b..a62962d2 100755 --- a/dev/externals/fastconv/fconv-fftw.cpp +++ b/dev/externals/fastconv/fconv-fftw.cpp @@ -41,9 +41,12 @@ extern "C" #include #include #include -#include +#ifdef _WIN32 +#define +#endif + #ifdef _DEBUG #include #endif @@ -114,13 +117,21 @@ void usage(const char *progname) double -timer() +timer() //TODO: Refactor duplicated code { - struct timeb now; double secs, ticks; - ftime(&now); - ticks = (double)now.millitm/(1000.0); - secs = (double) now.time; + +#ifdef _WIN32 + struct timeb now; + ftime(&now); + ticks = (double) now.millitm*1e-4; + secs = (double) now.time; +#else + struct timespec ts; + clock_gettime(CLOCK_REALTIME, &ts); //TODO: Handle this erroring + ticks = (double) ts.tv_nsec*1e-9; + secs = (double) ts.tv_sec; +#endif return secs + ticks; } diff --git a/dev/externals/fastconv/fconv.cpp b/dev/externals/fastconv/fconv.cpp index 4c7e04d2..24f312c4 100755 --- a/dev/externals/fastconv/fconv.cpp +++ b/dev/externals/fastconv/fconv.cpp @@ -41,13 +41,16 @@ extern "C" #include #include #include -#include #ifdef _DEBUG #include #endif +#ifdef _WIN32 +#include +#endif + #ifdef unix #include int stricmp(const char *a, const char *b); @@ -108,13 +111,21 @@ void usage(const char *progname) double -timer() +timer() //TODO: Refactor duplicated code { - struct timeb now; double secs, ticks; - ftime(&now); - ticks = (double)now.millitm/(1000.0); - secs = (double) now.time; + +#ifdef _WIN32 + struct timeb now; + ftime(&now); + ticks = (double) now.millitm*1e-4; + secs = (double) now.time; +#else + struct timespec ts; + clock_gettime(CLOCK_REALTIME, &ts); //TODO: Handle this erroring + ticks = (double) ts.tv_nsec*1e-9; + secs = (double) ts.tv_sec; +#endif return secs + ticks; } diff --git a/dev/externals/mctools/chxformat.c b/dev/externals/mctools/chxformat.c index 2a405128..a90fd796 100755 --- a/dev/externals/mctools/chxformat.c +++ b/dev/externals/mctools/chxformat.c @@ -41,7 +41,7 @@ char* guidnames[] = {"PCM","PCM FLOAT","AMB PCM","AMB FLOAT"}; #define REVWBYTES(t) ( (((t)&0xff) << 8) | (((t)>>8) &0xff) ) #define TAG(a,b,c,d) ( ((a)<<24) | ((b)<<16) | ((c)<<8) | (d) ) -#ifdef linux +#ifdef __GLIBC__ #define POS64(x) (x.__pos) #else #define POS64(x) (x) diff --git a/dev/externals/mctools/copysf.c b/dev/externals/mctools/copysf.c index 0415b581..81a694d2 100755 --- a/dev/externals/mctools/copysf.c +++ b/dev/externals/mctools/copysf.c @@ -31,12 +31,12 @@ #include #ifdef _WIN32 #include //RWD.6.5.99 +#include #endif #include #include #include #include -#include #include #define VERSION "Revision: 2.1.1 2020 " diff --git a/dev/externals/mctools/fmdcode.c b/dev/externals/mctools/fmdcode.c index e3a94ec1..785c8dd0 100755 --- a/dev/externals/mctools/fmdcode.c +++ b/dev/externals/mctools/fmdcode.c @@ -25,10 +25,13 @@ #include #include #include -#include #include #include "fmdcode.h" +#ifdef _WIM32 +#include +#endif + #ifdef unix /* in portsf.lib */ extern int stricmp(const char *a, const char *b); diff --git a/dev/externals/mctools/nmix.c b/dev/externals/mctools/nmix.c index d6c30b96..b6d1f2b6 100755 --- a/dev/externals/mctools/nmix.c +++ b/dev/externals/mctools/nmix.c @@ -25,9 +25,12 @@ #include #include #include -#include #include "portsf.h" +#ifdef _WIN32 +#include +#endif + #ifdef unix /* in portsf.lib */ extern int stricmp(const char *a, const char *b); diff --git a/dev/externals/paprogs/paplay/paplay.c b/dev/externals/paprogs/paplay/paplay.c index c01899f9..a04b3b4a 100755 --- a/dev/externals/paprogs/paplay/paplay.c +++ b/dev/externals/paprogs/paplay/paplay.c @@ -51,7 +51,6 @@ #ifdef unix #include -#include #endif #include diff --git a/dev/externals/paprogs/pvplay/pvplay.h b/dev/externals/paprogs/pvplay/pvplay.h index 65f30aa1..eaec131f 100644 --- a/dev/externals/paprogs/pvplay/pvplay.h +++ b/dev/externals/paprogs/pvplay/pvplay.h @@ -53,7 +53,6 @@ #ifdef unix #include -#include #include #include #include diff --git a/dev/externals/paprogs/recsf/recsf.c b/dev/externals/paprogs/recsf/recsf.c index 7a1e3567..266d4da0 100755 --- a/dev/externals/paprogs/recsf/recsf.c +++ b/dev/externals/paprogs/recsf/recsf.c @@ -43,7 +43,6 @@ #ifdef unix #include -#include #endif #include diff --git a/dev/externals/portsf/portsf.c b/dev/externals/portsf/portsf.c index 15592e1b..0db34e2a 100755 --- a/dev/externals/portsf/portsf.c +++ b/dev/externals/portsf/portsf.c @@ -90,7 +90,7 @@ int stricmp(const char *a, const char *b); int strnicmp(const char *a, const char *b, const int length); #endif -#ifdef linux +#ifdef __GLIBC__ #define POS64(x) (x.__pos) #else #define POS64(x) (x) diff --git a/dev/newsfsys/pvfileio.c b/dev/newsfsys/pvfileio.c index bd462a7c..39987c1a 100755 --- a/dev/newsfsys/pvfileio.c +++ b/dev/newsfsys/pvfileio.c @@ -41,8 +41,8 @@ #ifdef unix #include #define O_BINARY (0) -#define _S_IWRITE S_IWRITE -#define _S_IREAD S_IREAD +#define _S_IWRITE S_IWUSR +#define _S_IREAD S_IRUSR #endif #ifdef _DEBUG diff --git a/dev/newsfsys/sfsys.c b/dev/newsfsys/sfsys.c index 9b679c92..86bdad7b 100644 --- a/dev/newsfsys/sfsys.c +++ b/dev/newsfsys/sfsys.c @@ -188,8 +188,8 @@ int CDP_COM_READY = 0; /*global flag, ah well...(define in alias.h will access #define _O_CREAT O_CREAT #define _O_TRUNC O_TRUNC #define _O_EXCL O_EXCL -#define _S_IWRITE S_IWRITE -#define _S_IREAD S_IREAD +#define _S_IWRITE S_IWUSR +#define _S_IREAD S_IRUSR #define chsize ftruncate #endif @@ -280,7 +280,7 @@ extern int sampsize[]; #define sizeof_WFMTEX (40) -#ifdef linux +#ifdef __GLIBC__ #define POS64(x) (x.__pos) #else #define POS64(x) (x) diff --git a/dev/pvxio2/pvfileio.c b/dev/pvxio2/pvfileio.c index 7cb940a6..e036fb91 100644 --- a/dev/pvxio2/pvfileio.c +++ b/dev/pvxio2/pvfileio.c @@ -41,8 +41,8 @@ #ifdef unix #include #define O_BINARY (0) -#define _S_IWRITE S_IWRITE -#define _S_IREAD S_IREAD +#define _S_IWRITE S_IWUSR +#define _S_IREAD S_IRUSR #endif #ifdef _DEBUG diff --git a/dev/sfsys/sfsys.c b/dev/sfsys/sfsys.c index 2cc78032..630f030a 100644 --- a/dev/sfsys/sfsys.c +++ b/dev/sfsys/sfsys.c @@ -180,8 +180,8 @@ int CDP_COM_READY = 0; /*global flag, ah well...(define in alias.h will access #define _O_CREAT O_CREAT #define _O_TRUNC O_TRUNC #define _O_EXCL O_EXCL -#define _S_IWRITE S_IWRITE -#define _S_IREAD S_IREAD +#define _S_IWRITE S_IWUSR +#define _S_IREAD S_IRUSR #define chsize ftruncate #endif @@ -274,7 +274,7 @@ extern int sampsize[]; #define sizeof_WFMTEX (40) -#ifdef linux +#ifdef __GLIBC__ #define POS64(x) (x.__pos) #else #define POS64(x) (x) diff --git a/libaaio/README.md b/libaaio/README.md new file mode 100644 index 00000000..65f6dc77 --- /dev/null +++ b/libaaio/README.md @@ -0,0 +1,11 @@ +# Notes on `./configure`: +If `./configure` ever fails at checking your compiler, it's probably because your compiler doesn't support implicit `int` declarations. To fix it, run: +```sh +sed -i "1083s/^/int /" configure +``` +. +P.S.: Also look at updating the `config.guess` and `config.sub` files as those are obsolete and could fail you. Run: +```sh +rm config.guess && rm config.sub && wget https://git.savannah.gnu.org/cgit/config.git/plain/config.guess && wget https://git.savannah.gnu.org/cgit/config.git/plain/config.sub +``` +to fix the issue.