If any code is relying on this, please let me know and I will add it back. It appears to be redundant, though, since one can access DtoolClassDict directly.
Symbol kept around temporarily in order to keep ABI compatibility for a short while as people may not update their interrogate and Panda in sync, but it can soon be removed.
I don't know if this is the right solution, but it does fix an issue accessing std::ios::openmode caused by the ios typedef being defined before ios_base is fully specified.
Rationale:
1. Per standard, fstream::open takes 2 arguments.
If platforms add a third, they're out of spec.
2. The only platform I could find that takes a file
mask specifically as the third argument is IRIX,
which Panda hasn't targeted in forever.
3. The mask being requested isn't even particularly
interesting - falling back to a platform default
is best.
4. When USE_PANDAFILESTREAM is defined, pfstream
is implemented as PandaFileStream, which doesn't
have a three-argument open() and breaks immediately.
5. makepanda doesn't ever define HAVE_OPEN_MASK
6. It's been broken for so long that, if it were
important to anybody, it would have been fixed by now.
There is a bug in clang versions before 3.2 (including the one shipped with Xcode) that makes it give a "conflicting types" compile error when there is a static constexpr function defined outside the class. The way to work around this is either to remove one of the "static" or "constexpr" keywords, or to simply put the definition inline.
See: https://stackoverflow.com/a/17494592/2135754
I would try and upgrade Xcode to version 5 to see if the problem is fixed, but the buildbot still runs OS X Lion (10.7) and the last version of Xcode that works on Lion is 4.6.3, so it seems easier to just apply these workarounds for now.
This renames acquire/release to lock/unlock in order to be compatible with std::lock_guard and std::unique_lock (which will eventually replace the *MutexHolder classes). It will also allow us to typedef MutexImpl to std::mutex later on.
To access a WeakPointerTo in a thread-safe way, use something like this:
if (auto ptr = weak_ptr.lock()) {
..use ptr as regular PointerTo
}
The new implementation no longer needs a reference to be stored to all weak pointers on the WeakReferenceList; a mere count of weak pointers is sufficient. Therefore, callbacks theoretically no longer require a WeakPointerTo to be constructed.
The WeakPointerTo class is not actually atomic; it could be made so, but I don't believe it's worth it at this time.
I have no idea why this error happens, but it does not seem worth the effort to investigate further, so I'm just reverting the previous change to this file.
I am not sure why the definition of NULL was removed; it might have been by mistake, but in any case it broke code like this:
img = PNMImage(w, h, color_space=CS_srgb)
since it would not understand the default value (NULL) for the argument preceding color_space.
This distinction allows us to better support Python 3, since it will raise exceptions when trying to put arbitrary binary data in a str object.
This also adds some convenience functions for efficiently initializing a Datagram or PTA_uchar from a vector_uchar.