Fix time_t <> long int ambiguity (OSX gcc builds)
authorRobin Gareus <robin@gareus.org>
Thu, 25 Jul 2019 23:58:01 +0000 (01:58 +0200)
committerRobin Gareus <robin@gareus.org>
Thu, 25 Jul 2019 23:58:18 +0000 (01:58 +0200)
This fixes an issue with
* XMLNode::get_property(const char*, T&)
* XMLNode::set_property(const char*, const T&)
resulting in
 string_convert.h:77: error: 'long int' is not a class,
 struct, or union type

libs/ardour/ardour/location.h
libs/ardour/location.cc

index f55f931731da4d1eb66ca839f0e61081e7212868..45125e14f10b77eb57fe9b7a5bbec42abf217f6b 100644 (file)
@@ -23,7 +23,6 @@
 #include <list>
 #include <iostream>
 #include <map>
-#include <ctime>
 
 #include <sys/types.h>
 
@@ -70,7 +69,7 @@ public:
        void lock ();
        void unlock ();
 
-       time_t timestamp() { return _timestamp; };
+       int64_t timestamp() const { return _timestamp; };
        samplepos_t start() const { return _start; }
        samplepos_t end() const { return _end; }
        samplecnt_t length() const { return _end - _start; }
@@ -162,7 +161,7 @@ private:
        bool               _locked;
        PositionLockStyle  _position_lock_style;
        boost::shared_ptr<SceneChange> _scene_change;
-       time_t             _timestamp;
+       int64_t            _timestamp;
 
        void set_mark (bool yn);
        bool set_flag_internal (bool yn, Flags flag);
index 1b4b5a87c109ce712d050fdf0bd1bd6f480053ed..0ff707a80d642b24e0430b4507f373fe5400b386 100644 (file)
@@ -65,7 +65,7 @@ Location::Location (Session& s)
        , _flags (Flags (0))
        , _locked (false)
        , _position_lock_style (AudioTime)
-       , _timestamp(time(0))
+       , _timestamp (time (0))
 {
        assert (_start >= 0);
        assert (_end >= 0);
@@ -80,7 +80,7 @@ Location::Location (Session& s, samplepos_t sample_start, samplepos_t sample_end
        , _flags (bits)
        , _locked (false)
        , _position_lock_style (s.config.get_glue_new_markers_to_bars_and_beats() ? MusicTime : AudioTime)
-       , _timestamp(time(0))
+       , _timestamp (time (0))
 {
        recompute_beat_from_samples (sub_num);
 
@@ -98,7 +98,7 @@ Location::Location (const Location& other)
        , _end_beat (other._end_beat)
        , _flags (other._flags)
        , _position_lock_style (other._position_lock_style)
-       , _timestamp(time(0))
+       , _timestamp (time (0))
 {
        /* copy is not locked even if original was */
 
@@ -114,7 +114,7 @@ Location::Location (Session& s, const XMLNode& node)
        : SessionHandleRef (s)
        , _flags (Flags (0))
        , _position_lock_style (AudioTime)
-       , _timestamp(time(0))
+       , _timestamp (time (0))
 {
        /* Note: _position_lock_style is initialised above in case set_state doesn't set it
           (for 2.X session file compatibility).