From 4620d0fcb9fefe7f48075778a5a02bfaf4221c22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?VIS=CE=9BGE?= Date: Sat, 30 Aug 2025 00:07:58 +0300 Subject: [PATCH 1/7] Wrote compilation note for libaaio --- libaaio/README.md | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 libaaio/README.md 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. From 5697ec08e67b40e9eab8b8556d5ed07312d55eb4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?VIS=CE=9BGE?= Date: Sat, 30 Aug 2025 00:11:20 +0300 Subject: [PATCH 2/7] Changed incorrect definition of POS64 for Linux systems that don't use GLIBC --- dev/externals/mctools/chxformat.c | 2 +- dev/externals/portsf/portsf.c | 2 +- dev/newsfsys/sfsys.c | 2 +- dev/sfsys/sfsys.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) 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/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/sfsys.c b/dev/newsfsys/sfsys.c index 9b679c92..2cfd284e 100644 --- a/dev/newsfsys/sfsys.c +++ b/dev/newsfsys/sfsys.c @@ -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/sfsys/sfsys.c b/dev/sfsys/sfsys.c index 2cc78032..5d90bb50 100644 --- a/dev/sfsys/sfsys.c +++ b/dev/sfsys/sfsys.c @@ -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) From a6d722e497b6d2e7fa4cbd024da73a98de915eca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?VIS=CE=9BGE?= Date: Sat, 30 Aug 2025 00:14:32 +0300 Subject: [PATCH 3/7] Changed S_IWRITE and S_IREAD to their POSIX-supported counterparts --- dev/newsfsys/pvfileio.c | 4 ++-- dev/newsfsys/sfsys.c | 4 ++-- dev/pvxio2/pvfileio.c | 4 ++-- dev/sfsys/sfsys.c | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) 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 2cfd284e..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 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 5d90bb50..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 From 4a3fe72f7a8209fdddd78a9152c617adaba131ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?VIS=CE=9BGE?= Date: Sun, 31 Aug 2025 02:32:56 +0300 Subject: [PATCH 4/7] Rewrote function timer inside fastconv to use clock_gettime (IT NOW USES NANOSECONDS INSTEAD OF MILLISECONDS) --- dev/externals/fastconv/fconv-fftw.cpp | 16 +++++++++------- dev/externals/fastconv/fconv.cpp | 16 +++++++++------- 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/dev/externals/fastconv/fconv-fftw.cpp b/dev/externals/fastconv/fconv-fftw.cpp index 91aefc3b..8f87b74a 100755 --- a/dev/externals/fastconv/fconv-fftw.cpp +++ b/dev/externals/fastconv/fconv-fftw.cpp @@ -114,18 +114,20 @@ void usage(const char *progname) double -timer() +timer() //TODO: Refactor duplicated code { - struct timeb now; + struct timespec ts; double secs, ticks; - ftime(&now); - ticks = (double)now.millitm/(1000.0); - secs = (double) now.time; - + clock_gettime(CLOCK_REALTIME, &ts); //TODO: Handle this erroring + ticks = (double) ts.tv_nsec*1e-9; /* I hope the + added resolution won't break anything in the rest of the + program... Please don't break anything in the rest of the + program. pls? :> */ + secs = (double) ts.tv_sec; + return secs + ticks; } - void stopwatch(int flag) { diff --git a/dev/externals/fastconv/fconv.cpp b/dev/externals/fastconv/fconv.cpp index 4c7e04d2..df134152 100755 --- a/dev/externals/fastconv/fconv.cpp +++ b/dev/externals/fastconv/fconv.cpp @@ -41,7 +41,6 @@ extern "C" #include #include #include -#include #ifdef _DEBUG @@ -108,14 +107,17 @@ void usage(const char *progname) double -timer() +timer() //TODO: Refactor duplicated code { - struct timeb now; + struct timespec ts; double secs, ticks; - ftime(&now); - ticks = (double)now.millitm/(1000.0); - secs = (double) now.time; - + clock_gettime(CLOCK_REALTIME, &ts); //TODO: Handle this erroring + ticks = (double) ts.tv_nsec*1e-9; /* I hope the + added resolution won't break anything in the rest of the + program... Please don't break anything in the rest of the + program. pls? :> */ + secs = (double) ts.tv_sec; + return secs + ticks; } From ee8ce3d54d4b5a9d4534345606cd2091a721b430 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?VIS=CE=9BGE?= Date: Sun, 31 Aug 2025 04:29:30 +0300 Subject: [PATCH 5/7] Removed inclusion in fconv-fftw.cpp --- dev/externals/fastconv/fconv-fftw.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/dev/externals/fastconv/fconv-fftw.cpp b/dev/externals/fastconv/fconv-fftw.cpp index 8f87b74a..5f9cd977 100755 --- a/dev/externals/fastconv/fconv-fftw.cpp +++ b/dev/externals/fastconv/fconv-fftw.cpp @@ -41,7 +41,6 @@ extern "C" #include #include #include -#include #ifdef _DEBUG From cee0e5bdb2bb50adceda55d5a841a24144385c29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?VIS=CE=9BGE?= Date: Sun, 31 Aug 2025 04:56:31 +0300 Subject: [PATCH 6/7] Removed possibly unused inclusion of --- dev/externals/mctools/copysf.c | 1 - dev/externals/mctools/fmdcode.c | 1 - dev/externals/mctools/nmix.c | 1 - dev/externals/paprogs/paplay/paplay.c | 1 - dev/externals/paprogs/pvplay/pvplay.h | 1 - dev/externals/paprogs/recsf/recsf.c | 1 - 6 files changed, 6 deletions(-) diff --git a/dev/externals/mctools/copysf.c b/dev/externals/mctools/copysf.c index 0415b581..c0a6e3cd 100755 --- a/dev/externals/mctools/copysf.c +++ b/dev/externals/mctools/copysf.c @@ -36,7 +36,6 @@ #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..5e13afba 100755 --- a/dev/externals/mctools/fmdcode.c +++ b/dev/externals/mctools/fmdcode.c @@ -25,7 +25,6 @@ #include #include #include -#include #include #include "fmdcode.h" diff --git a/dev/externals/mctools/nmix.c b/dev/externals/mctools/nmix.c index d6c30b96..a5b15214 100755 --- a/dev/externals/mctools/nmix.c +++ b/dev/externals/mctools/nmix.c @@ -25,7 +25,6 @@ #include #include #include -#include #include "portsf.h" #ifdef unix 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 From 9d22554549181329412320813cf0976805568aab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?VIS=CE=9BGE?= Date: Mon, 1 Sep 2025 03:38:54 +0300 Subject: [PATCH 7/7] Re-introduced for Windows --- dev/externals/fastconv/fconv-fftw.cpp | 22 ++++++++++++++++------ dev/externals/fastconv/fconv.cpp | 21 +++++++++++++++------ dev/externals/mctools/copysf.c | 1 + dev/externals/mctools/fmdcode.c | 4 ++++ dev/externals/mctools/nmix.c | 4 ++++ 5 files changed, 40 insertions(+), 12 deletions(-) diff --git a/dev/externals/fastconv/fconv-fftw.cpp b/dev/externals/fastconv/fconv-fftw.cpp index 5f9cd977..a62962d2 100755 --- a/dev/externals/fastconv/fconv-fftw.cpp +++ b/dev/externals/fastconv/fconv-fftw.cpp @@ -43,6 +43,10 @@ extern "C" #include +#ifdef _WIN32 +#define +#endif + #ifdef _DEBUG #include #endif @@ -115,18 +119,24 @@ void usage(const char *progname) double timer() //TODO: Refactor duplicated code { - struct timespec ts; double secs, ticks; + +#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; /* I hope the - added resolution won't break anything in the rest of the - program... Please don't break anything in the rest of the - program. pls? :> */ + ticks = (double) ts.tv_nsec*1e-9; secs = (double) ts.tv_sec; - +#endif + return secs + ticks; } + void stopwatch(int flag) { diff --git a/dev/externals/fastconv/fconv.cpp b/dev/externals/fastconv/fconv.cpp index df134152..24f312c4 100755 --- a/dev/externals/fastconv/fconv.cpp +++ b/dev/externals/fastconv/fconv.cpp @@ -47,6 +47,10 @@ extern "C" #include #endif +#ifdef _WIN32 +#include +#endif + #ifdef unix #include int stricmp(const char *a, const char *b); @@ -109,15 +113,20 @@ void usage(const char *progname) double timer() //TODO: Refactor duplicated code { - struct timespec ts; double secs, ticks; + +#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; /* I hope the - added resolution won't break anything in the rest of the - program... Please don't break anything in the rest of the - program. pls? :> */ + ticks = (double) ts.tv_nsec*1e-9; secs = (double) ts.tv_sec; - +#endif + return secs + ticks; } diff --git a/dev/externals/mctools/copysf.c b/dev/externals/mctools/copysf.c index c0a6e3cd..81a694d2 100755 --- a/dev/externals/mctools/copysf.c +++ b/dev/externals/mctools/copysf.c @@ -31,6 +31,7 @@ #include #ifdef _WIN32 #include //RWD.6.5.99 +#include #endif #include #include diff --git a/dev/externals/mctools/fmdcode.c b/dev/externals/mctools/fmdcode.c index 5e13afba..785c8dd0 100755 --- a/dev/externals/mctools/fmdcode.c +++ b/dev/externals/mctools/fmdcode.c @@ -28,6 +28,10 @@ #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 a5b15214..b6d1f2b6 100755 --- a/dev/externals/mctools/nmix.c +++ b/dev/externals/mctools/nmix.c @@ -27,6 +27,10 @@ #include #include "portsf.h" +#ifdef _WIN32 +#include +#endif + #ifdef unix /* in portsf.lib */ extern int stricmp(const char *a, const char *b);