|Subject:||Re: [fluid-dev] About Supporting 2GiB+ Soundfonts on Windows|
|Date:||Tue, 17 Mar 2020 17:04:44 +0100 (CET)|
>Based on Reinhold's thought, the idea would be to use something like
#if defined(_MSVC_VER < VisualStudio2015)
typedef __int64 fluid_long_long_t; // even on 32bit windows
typedef long long fluid_long_long_t;
>Should it really be that simple or am I missing smth.?
You are not missing something, and this should be really that simple.
Verified using VS2010 on Windows XP, __int64 is really an integer value on 64 bit, (even on 32bits CPU).
__int64 v2_pos_max = 0x7FFFFFFFFFFFFFFF; // +-9223372036854775807
__int64 v2_neg_min = 0x8000000000000000; // -9223372036854775808
> Message du 17/03/20 09:45
> De : "Tom M. via fluid-dev" <address@hidden>
> A : "FluidSynth mailing list" <address@hidden>
> Copie à : "Tom M." <address@hidden>
> Objet : Re: [fluid-dev] About Supporting 2GiB+ Soundfonts on Windows
> > If you decided to require C99, I would think you would want to use int64_t and its relatives for portability. I actually had "long long" in mind, because int64_t would require fluidsynth's header to include stdint.h, and whenever possible I would like to avoid polluting our header with any C system header (for the sake of portability to C++). Also note that int64_t is an optional type and may only be provided if the implementation supports it. (The latter doesn't really make sense in practice, because long long is an intrinsic type guaranteed to be at least 64 bits wide. And because long long must be available, int64_t will also be available.) Based on Reinhold's thought, the idea would be to use something like #if defined(_MSVC_VER < VisualStudio2015) typedef __int64 fluid_long_long_t; // even on 32bit windows #else typedef long long fluid_long_long_t; #endif in our public header. Which basically means: Fluidsynth's source code stays C89. The public header will be compatible with C99 (or C++11) UNLESS it's being compiled with an old VS in which case we provide a fallback. This should provide enough portability while still retaining ABI compatibility between and MSVC and MinGW compiled fluidsynth. Should it really be that simple or am I missing smth.? Tom _______________________________________________ fluid-dev mailing list address@hidden https://lists.nongnu.org/mailman/listinfo/fluid-dev
|[Prev in Thread]||Current Thread||[Next in Thread]|