Hello!
I'm honestly writing this more for informational purposes, in case someone else wants to compile on Linux and wants a few pointers. Getting it compiling on Linux requires a few code changes, and I don't know the best way to make something like this more crossplatform (my C/C++ is extraordinarily rusty). I also wouldn't expect you to support an extra OS or anything, of course. :)
Anyway, this compiles and runs just fine on Linux with a few minor changes:
- Case-sensitivity:
#include "ReVorb.h" at the top of revorb.cpp needs to be #include "revorb.h" instead (that, or the header file renamed to have the capital letters)
- Lack of "safe" C11 Annex K functions (the
*_s functions) in glibc/gcc. There's more than one Linux implementation of these out there, but the one I used was https://github.com/rurban/safeclib - this won't be found by default on most Linux machines. After installing/compiling that, add #include <libsafec/safe_lib.h> and #include <libsafec/safe_str_lib.h> to revorb.h
- Other header changes: In
revorb.h, remove the include for io.h and substitute unistd.h
_unlink doesn't exit -- just change those instances to unlink instead, in revorb.cpp. There's two instances. (This is what unistd.h provides)
- Linux doesn't distinguish between text/binary while reading from STDIN, and doesn't have
_setmode (or _fileno). Just comment out those lines in revorb.cpp entirely. There's two instances of that. I did verify that reading in the file via stdin produces the same output as from a file.
So, do all that, and it compiles/runs just fine with:
g++ -o revorb -logg -lvorbis -lsafec-3.6.0 revorb.cpp
I'm attaching a patch with all the changes that I mentioned. As I say, not expecting any of this to get merged in or whatever. If I ever get enthusiastic enough to draft up a "proper" PR for this, I'll submit it that way.
revorb_linux.patch.gz
Hello!
I'm honestly writing this more for informational purposes, in case someone else wants to compile on Linux and wants a few pointers. Getting it compiling on Linux requires a few code changes, and I don't know the best way to make something like this more crossplatform (my C/C++ is extraordinarily rusty). I also wouldn't expect you to support an extra OS or anything, of course. :)
Anyway, this compiles and runs just fine on Linux with a few minor changes:
#include "ReVorb.h"at the top ofrevorb.cppneeds to be#include "revorb.h"instead (that, or the header file renamed to have the capital letters)*_sfunctions) in glibc/gcc. There's more than one Linux implementation of these out there, but the one I used was https://github.com/rurban/safeclib - this won't be found by default on most Linux machines. After installing/compiling that, add#include <libsafec/safe_lib.h>and#include <libsafec/safe_str_lib.h>torevorb.hrevorb.h, remove the include forio.hand substituteunistd.h_unlinkdoesn't exit -- just change those instances tounlinkinstead, inrevorb.cpp. There's two instances. (This is whatunistd.hprovides)_setmode(or_fileno). Just comment out those lines inrevorb.cppentirely. There's two instances of that. I did verify that reading in the file via stdin produces the same output as from a file.So, do all that, and it compiles/runs just fine with:
I'm attaching a patch with all the changes that I mentioned. As I say, not expecting any of this to get merged in or whatever. If I ever get enthusiastic enough to draft up a "proper" PR for this, I'll submit it that way.
revorb_linux.patch.gz