13
0

Initial changes needed for building libtemporal with MSVC

Later I'll need to push some extra changes (to support 'tempo_map_p' and 'boost::intrusive::list' etc) but these initial ones (hopefully!) won't cause any issues for the other builds.
This commit is contained in:
John Emmas 2021-08-29 11:03:58 +01:00
parent 19d99b0a4b
commit d3cd621f7a
7 changed files with 28 additions and 14 deletions

View File

@ -18,7 +18,9 @@
#include "temporal/superclock.h"
#ifndef COMPILER_MSVC
Temporal::superclock_t Temporal::superclock_ticks_per_second = 508032000; // 2^10 * 3^4 * 5^3 * 7^2
#endif
int (*Temporal::sample_rate_callback)() = 0;

View File

@ -298,10 +298,10 @@ BBT_Time::operator!= (const BBT_Offset& other) const
namespace std {
std::ostream& operator<< (std::ostream& o, Temporal::BBT_Time const & bbt);
std::ostream& operator<< (std::ostream& o, Temporal::BBT_Offset const & bbt);
std::istream& operator>> (std::istream& i, Temporal::BBT_Time& bbt);
std::istream& operator>> (std::istream& i, Temporal::BBT_Offset& bbt);
LIBTEMPORAL_API std::ostream& operator<< (std::ostream& o, Temporal::BBT_Time const & bbt);
LIBTEMPORAL_API std::ostream& operator<< (std::ostream& o, Temporal::BBT_Offset const & bbt);
LIBTEMPORAL_API std::istream& operator>> (std::istream& i, Temporal::BBT_Time& bbt);
LIBTEMPORAL_API std::istream& operator>> (std::istream& i, Temporal::BBT_Offset& bbt);
template<>
struct numeric_limits<Temporal::BBT_Time> {

View File

@ -313,8 +313,8 @@ class DoubleableBeats : public Beats
virtual-method-in-a-template will bite you.
*/
std::ostream& operator<<(std::ostream& ostream, const Temporal::Beats& t);
std::istream& operator>>(std::istream& istream, Temporal::Beats& b);
LIBTEMPORAL_API std::ostream& operator<<(std::ostream& ostream, const Temporal::Beats& t);
LIBTEMPORAL_API std::istream& operator>>(std::istream& istream, Temporal::Beats& b);
} // namespace Temporal

View File

@ -130,7 +130,7 @@ template<typename T>
return coverage_inclusive_ends (sa, eaE.decrement(), sb, ebE.decrement());
}
template<> /*LIBTEMPORAL_API*/ OverlapType coverage_exclusive_ends<int64_t> (int64_t sa, int64_t eaE, int64_t sb, int64_t ebE);
template<> LIBTEMPORAL_TEMPLATE_API OverlapType coverage_exclusive_ends<int64_t> (int64_t sa, int64_t eaE, int64_t sb, int64_t ebE);
class RangeList;

View File

@ -23,18 +23,24 @@
#include "pbd/integer_division.h"
#include "temporal/visibility.h"
namespace Temporal {
typedef int64_t superclock_t;
extern superclock_t superclock_ticks_per_second;
#ifndef COMPILER_MSVC
extern superclock_t superclock_ticks_per_second;
#else
static superclock_t superclock_ticks_per_second = 508032000; // 2^10 * 3^4 * 5^3 * 7^2
#endif
static inline superclock_t superclock_to_samples (superclock_t s, int sr) { return int_div_round (s * sr, superclock_ticks_per_second); }
static inline superclock_t samples_to_superclock (int64_t samples, int sr) { return int_div_round (samples * superclock_ticks_per_second, superclock_t (sr)); }
extern int (*sample_rate_callback)();
void set_sample_rate_callback (int (*function)());
LIBTEMPORAL_API void set_sample_rate_callback (int (*function)());
}

View File

@ -434,10 +434,10 @@ class LIBTEMPORAL_API timecnt_t {
} /* end namespace Temporal */
namespace std {
std::ostream& operator<< (std::ostream & o, Temporal::timecnt_t const & tc);
std::istream& operator>> (std::istream & o, Temporal::timecnt_t & tc);
std::ostream& operator<< (std::ostream & o, Temporal::timepos_t const & tp);
std::istream& operator>> (std::istream & o, Temporal::timepos_t & tp);
LIBTEMPORAL_API std::ostream& operator<< (std::ostream & o, Temporal::timecnt_t const & tc);
LIBTEMPORAL_API std::istream& operator>> (std::istream & o, Temporal::timecnt_t & tc);
LIBTEMPORAL_API std::ostream& operator<< (std::ostream & o, Temporal::timepos_t const & tp);
LIBTEMPORAL_API std::istream& operator>> (std::istream & o, Temporal::timepos_t & tp);
}
#if 0

View File

@ -26,9 +26,15 @@
#include "pbd/integer_division.h"
#include "temporal/visibility.h"
namespace Temporal {
extern void init ();
#ifdef COMPILER_MSVC
LIBTEMPORAL_API void init ();
#else
extern void init ();
#endif
/* Any position measured in audio samples.
Assumed to be non-negative but not enforced.