zynaddsubfx

ZynAddSubFX open source synthesizer
Log | Files | Refs | Submodules | LICENSE

commit 0ef9e954fe36e62538c73b028922087223a25fdd
parent bf976de4a8cc660dfe9316fc3454800122987de9
Author: Hans Petter Selasky <[email protected]>
Date:   Sat,  8 Oct 2016 11:49:15 +0200

FreeBSD build fix.

Avoid declaring major() and minor() functions, because
FreeBSD #defines major() and minor() in sys/types.h
related to handling major and minor character device
numbers.

Signed-off-by: Hans Petter Selasky <[email protected]>

Diffstat:
Msrc/Misc/XMLwrapper.cpp | 6+++---
Msrc/Plugin/ZynAddSubFX/ZynAddSubFX.cpp | 2+-
Msrc/version.cpp | 6+++---
Msrc/zyn-version.h.in | 14+++-----------
4 files changed, 10 insertions(+), 18 deletions(-)

diff --git a/src/Misc/XMLwrapper.cpp b/src/Misc/XMLwrapper.cpp @@ -102,11 +102,11 @@ XMLwrapper::XMLwrapper() node = root = addparams("ZynAddSubFX-data", 4, "version-major", stringFrom<int>( - version.major()).c_str(), + version.get_major()).c_str(), "version-minor", stringFrom<int>( - version.minor()).c_str(), + version.get_minor()).c_str(), "version-revision", - stringFrom<int>(version.revision()).c_str(), + stringFrom<int>(version.get_revision()).c_str(), "ZynAddSubFX-author", "Nasca Octavian Paul"); //make the empty branch that will contain the information parameters diff --git a/src/Plugin/ZynAddSubFX/ZynAddSubFX.cpp b/src/Plugin/ZynAddSubFX/ZynAddSubFX.cpp @@ -191,7 +191,7 @@ protected: */ uint32_t getVersion() const noexcept override { - return d_version(version.major(), version.minor(), version.revision()); + return d_version(version.get_major(), version.get_minor(), version.get_revision()); } /** diff --git a/src/version.cpp b/src/version.cpp @@ -18,9 +18,9 @@ std::ostream& operator<< (std::ostream& os, const version_type& v) { - return os << v.major() << '.' - << v.minor() << '.' - << v.revision(); + return os << v.get_major() << '.' + << v.get_minor() << '.' + << v.get_revision(); } static_assert(!(version_type(3,1,1) < version_type(1,3,3)), diff --git a/src/zyn-version.h.in b/src/zyn-version.h.in @@ -17,14 +17,6 @@ #include <iosfwd> -#ifdef major -#undef major -#endif - -#ifdef minor -#undef minor -#endif - //! class containing a zynaddsubfx version class version_type { @@ -58,9 +50,9 @@ public: void set_minor(int min) { version[1] = min; } void set_revision(int rev) { version[2] = rev; } - int major() const { return version[0]; } - int minor() const { return version[1]; } - int revision() const { return version[2]; } + int get_major() const { return version[0]; } + int get_minor() const { return version[1]; } + int get_revision() const { return version[2]; } constexpr bool operator<(const version_type& other) const {