[x265] FreeBSD OS detection (cosmetic only I assume)

Michael Lackner michael.lackner at unileoben.ac.at
Fri Jul 22 08:53:50 CEST 2016


Hello!

I don't know how to properly supply a patch or anything, but currently, x265 shows Unk-OS
on FreeBSD UNIX ("unknown OS" I guess). This can easily be fixed by adding two lines to
common/version.cpp at line #66 for instance, right after the OpenBSD part?

So maybe this...

#ifdef _WIN32
#define ONOS    "[Windows]"
#elif  __linux
#define ONOS    "[Linux]"
#elif __OpenBSD__
#define ONOS    "[OpenBSD]"
#elif  __CYGWIN__
#define ONOS    "[Cygwin]"
#elif __APPLE__
#define ONOS    "[Mac OS X]"
#else
#define ONOS    "[Unk-OS]"
#endif

should become this...

#ifdef _WIN32
#define ONOS    "[Windows]"
#elif  __linux
#define ONOS    "[Linux]"
#elif __OpenBSD__
#define ONOS    "[OpenBSD]"
#elif __FreeBSD__
#define ONOS    "[FreeBSD]"
#elif  __CYGWIN__
#define ONOS    "[Cygwin]"
#elif __APPLE__
#define ONOS    "[Mac OS X]"
#else
#define ONOS    "[Unk-OS]"
#endif

With that, my current multilib build identifies as such:

x265 [info]: HEVC encoder version 2.0+9-2737c6ff5f80
x265 [info]: build info [FreeBSD][clang 3.4.1][64 bit] 8bit+10bit+12bit

instead of:

x265 [info]: HEVC encoder version 2.0+9-2737c6ff5f80
x265 [info]: build info [Unk-OS][clang 3.4.1][64 bit] 8bit+10bit+12bit

Of course, x265 is likely able to run on other systems as well, so maybe others could be
added, such as __NetBSD__, __DragonFly__ (for DragonFly BSD), __Haiku__, __GNU__, sun &
sun__, etc.?

I could even test some of those for compatibility if necessary..

-- 
Michael Lackner
Lehrstuhl für Informationstechnologie (CiT)
Montanuniversität Leoben
Tel.: +43 (0)3842/402-1505 | Mail: michael.lackner at unileoben.ac.at
Fax.: +43 (0)3842/402-1502 | Web: http://institute.unileoben.ac.at/infotech


More information about the x265-devel mailing list