Fix llabs() ambiguity
authorRobin Gareus <robin@gareus.org>
Sat, 9 Feb 2019 02:33:32 +0000 (03:33 +0100)
committerRobin Gareus <robin@gareus.org>
Sat, 9 Feb 2019 02:33:32 +0000 (03:33 +0100)
some older systems (e.g. OSX/PPC) fail to compile with
  error: call of overloaded 'llabs(long long int)' is ambiguous
  candidates are:
      long long int llabs(long long int)
      long long int __gnu_cxx::llabs(long long int)

libs/ardour/disk_reader.cc

index 80e7126f7639a7ed20cd8d18261f3e6f8ce141c4..1d09fe0353b068c2a69b033006b31dff592db17d 100644 (file)
@@ -645,7 +645,7 @@ DiskReader::internal_playback_seek (sampleoffset_t distance)
        boost::shared_ptr<ChannelList> c = channels.reader();
        for (chan = c->begin(); chan != c->end(); ++chan) {
                if (distance < 0) {
-                       off = 0 - (sampleoffset_t) (*chan)->rbuf->decrement_read_ptr (llabs (distance));
+                       off = 0 - (sampleoffset_t) (*chan)->rbuf->decrement_read_ptr (::llabs (distance));
                } else {
                        off = (*chan)->rbuf->increment_read_ptr (distance);
                }
@@ -1109,7 +1109,7 @@ void
 DiskReader::get_midi_playback (MidiBuffer& dst, samplepos_t start_sample, samplepos_t end_sample, MonitorState ms, BufferSet& scratch_bufs, double speed, samplecnt_t disk_samples_to_consume)
 {
        MidiBuffer* target;
-       samplepos_t nframes = llabs (end_sample - start_sample);
+       samplepos_t nframes = ::llabs (end_sample - start_sample);
 
        assert (_midi_buf);