Commit Graph

1752 Commits

Author SHA1 Message Date
Sam Edwards b3f1b7d40b Merge branch 'cmake' of https://github.com/treamology/panda3d into cmake
# Conflicts:
#	.travis.yml
#	direct/src/showbase/CMakeLists.txt
#	dtool/dtool_config.h.in
#	dtool/src/prc/CMakeLists.txt
#	panda/src/cocoadisplay/CMakeLists.txt
#	panda/src/express/CMakeLists.txt
#	panda/src/osxdisplay/CMakeLists.txt
2018-10-14 02:26:56 -06:00
Sam Edwards c26109e8cc CMake: Add textEncoder_ext.{cxx,h} to build 2018-10-13 16:15:40 -06:00
Sam Edwards ea1b50a522 Merge branch 'master' into cmake 2018-10-13 16:15:35 -06:00
Sam Edwards 602ea6ebf4 general: Fix a couple more compiler warnings
- express: Fix a warning when compiling for debug

- dtoolutil: Give TextEncoder a virtual destructor
2018-10-13 16:14:34 -06:00
rdb 29b577971f dtoolutil: improve Unicode encoding/decoding, support non-BMP chars
- Support encoding and decoding four-byte UTF-8 sequences
- E_unicode supports surrogate pairs, renamed to E_utf16be for clarity
- char32_t should be used for storing a Unicode code point
2018-10-08 22:33:54 +02:00
rdb 9061fd9416 dtoolutil: fix TextEncoder methods for Python 3
The no-arguments get_text() and set_text() will now return Unicode strings in Python 3, but passing in an encoding will make them return/take bytes objects.

In Python 2, they all take regular strings, but Unicode is also accepted by the no-argument get_text() and set_text().

In the future we probably want to remove most of this interface for Python users, to whom all this is unnecessary since it duplicates functionality already in the standard library.
2018-10-08 22:14:51 +02:00
Sam Edwards 086663ef4a CMake: Use $<BUILD_INTERFACE:...> when referencing paths in build directory
This prevents CMake from including them in exported targets, which
allows the exported targets to be installed.
2018-10-08 12:57:02 -06:00
rdb 8375340582 py_panda: fix TypeError being raised instead of AttributeError
This prevented doing something like hasattr(vec3, "stuff")
2018-10-07 20:24:19 +02:00
Sam Edwards 02412d0e7d Merge branch 'master' into cmake 2018-10-07 01:58:41 -06:00
Sam Edwards 8d14705689 interrogate: Fix typo 2018-10-07 01:36:44 -06:00
rdb 5ae38a8a92 Fix crash loading from search path
Possible fix for #395
2018-09-27 22:16:56 +02:00
rdb a3a7c0cf9d parser-inc: add more POSIX system header stubs 2018-09-23 14:21:19 +02:00
rdb 77724f49dc dtoolbase: remove TypeHandle::_none symbol, no longer needed 2018-09-23 13:50:06 +02:00
rdb d6b7abedfe prc: fix some race conditions querying bool and searchpath vars
This is not perfect, and we need to more thoroughly address thread safety in the PRC system, but it will nonetheless address a lot of the race condition issues when querying these variables from two threads at the same time.
2018-09-23 13:44:38 +02:00
rdb aacafe7be3 dtoolutil: give DSearchPath a defaulted move constructor 2018-09-23 13:03:47 +02:00
Sam Edwards e917c54433 Merge branch 'master' into cmake 2018-09-22 15:55:59 -06:00
Sam Edwards 1520d712d4 CMake: Remove target_use_packages
Instead, let's use a PKG::PKGNAME interface library, which simplifies
the linking and also allows us to use imported libraries from
find_package in the future.
2018-09-21 10:17:05 -06:00
Sam Edwards cf26888672 CMake: Stop using include_directories()
Setting this directly on the target is cleaner,
and in most cases, the INTERFACE_INCLUDE_DIRECTORIES
mechanism takes care of it for us.
2018-09-18 18:17:43 -06:00
rdb 8b3cc74cad interrogate: write out OS-generic filenames in #include directives
Fixes #386
2018-09-13 21:14:04 +02:00
rdb cb9e65720a interrogate: do not use MOVE in generated code, but use std::move 2018-09-09 13:48:50 +02:00
Sam Edwards e501d20927 CMake: Don't compile Interrogate runtime code into interrogatedb
This should obviate the need for pystub as well.

Note that it's currently a little bit hacky; the source will
have to be moved to make the CMake dependencies work better.
2018-09-06 23:57:53 -06:00
Sam Edwards 0c889db928 CMake: Don't conflict with find_package internal variables 2018-09-05 19:19:36 -06:00
rdb 809f9b04f6 Fix problems with spinlock mutex/cvar implementation
This reimplements the spinlock on top of std::atomic_flag, which is guaranteed to be lockless.  It also inserts the PAUSE (REP NOP) instruction which is strongly recommended to be placed in busy-wait loops by Intel.

This also includes a recursive spinlock implementation.

The spinlock implementation is disabled by default, but can be enabled by adding the --override MUTEX_SPINLOCK=1 flag to makepanda.
2018-09-04 12:58:48 +02:00
rdb 670047b4b0 dtoolbase: enable use of std::atomic_flag, also on macOS 2018-09-04 12:02:13 +02:00
Sam Edwards 77018c5383 CMake: Name Python targets more distinctively
Python targets are now prefixed with "panda3d." in
e.g. "panda3d.core"
2018-09-03 21:01:54 -06:00
Sam Edwards 208ecd6708 Merge branch 'master' into cmake 2018-09-02 16:06:41 -06:00
Sam Edwards fa1e1a2e63 CMake: Tidy up installation directory
Don't install "object-Configuration/" directories when
using metalibs, and also put .dll files in bin/ on Windows.
2018-09-01 11:07:55 -06:00
Sam Edwards 4695557a5d general: Don't require BUILDING_* for static builds 2018-08-31 23:54:32 -06:00
rdb b1fc88027a dtoolbase: add missing DTOOL_PLATFORM for linux_aarch64 2018-08-26 14:04:48 +02:00
rdb c9372c3699 Fix a few GCC compile warnings 2018-08-26 14:02:33 +02:00
Sam Edwards ab2ad99278 CMake: Don't use GREATER_EQUAL
It's not compatible with CMake 3.0.
2018-08-23 00:42:54 -06:00
Sam Edwards 76378c8990 CMake: Ask Python for preferred binary extension suffix 2018-08-19 23:10:20 -06:00
Mitchell Stokes f663d215d5 Remove some unused variables 2018-08-19 16:55:07 +02:00
rdb c4b657b5b2 interrogate: support implicit typecast operators in some cases
For example, this will let us pass a ConfigVariableFilename to anything that accepts a Filename, just like in C++.

Does not work if the return value if the typecast operator requires management.
2018-08-19 16:06:16 +02:00
rdb 21f5e77467 dtoolbase: prefer GCC AtomicAdjust implementation over i386 asm one 2018-08-19 16:05:39 +02:00
rdb 5da8b63a66 cppparser: fix formatting of typecast operator 2018-08-19 16:04:56 +02:00
Sam Edwards 2ab77d9a27 Merge branch 'master' into cmake 2018-08-14 21:59:45 -06:00
Sam Edwards 0feadd9775 CMake: Use OPENSSL package correctly in p3prc 2018-08-14 21:59:32 -06:00
rdb 4ff619b75f pystub: fix some definitions that should be variables, not funcs
This is needed to compile Panda3D with -flto.
2018-08-09 14:56:40 +02:00
rdb 2a2b48134b parser-inc: fix bad socklen_t definition in ws2tcpip.h 2018-08-02 21:24:37 +02:00
rdb 30721ba33b cppparser: fix issues when parsing templated constructor definition 2018-07-31 14:05:08 +02:00
rdb 079a7495f2 Fix macOS build by providing missing std::copysign 2018-07-31 10:47:16 +02:00
rdb ad3ab3ad21 Define stable ordering for WeakPointerTo for use as map/set key
Currently, the WeakPointerTo comparison operators compare the raw pointers, but this is not useful as it may cause a false equality if one weak pointer in the comparison is expired and points to memory that has since been reused.

Instead, we can define a comparison based on the control block pointer, which exists since the new weak pointer implementation in 0bb81a43c9.  This is implemented in the owner_before method, matching C++11 std::weak_ptr semantics.

I would now recommend deprecating most comparison operators of WeakPointerTo or redefining them to make more sense, ie. comparing equal if they (once) referred to the same object and not if they simply point to the same memory address.  This has not yet been done, though code that uses the comparison operators has been fixed in this commit.

Overloads of std::owner_less have been provided for creating a map or set with Weak(Const)PointerTo keys.
2018-07-30 17:27:09 +02:00
rdb 684a58e7e9 parser-inc: add timespec 2018-07-17 22:21:44 +02:00
rdb e673937384 parser-inc: add <memory> include to unordered_map/set for allocator 2018-07-09 16:02:06 +02:00
rdb e9e18c2277 dtoolutil: fix PandaSystem TypeHandle static init issue 2018-07-04 20:29:31 +02:00
rdb 68e7f681f4 interrogate: support enum class to limited extent in Python 2
Only the basics are supported; the __members__ or iter interface is not supported at this time.

See also #351 for discussion on pulling in enum34 module.
2018-07-02 12:16:35 +02:00
rdb 9441c28f61 interrogate: do not wrap methods with rvalue arguments
This could in theory be supported, but this is not really intuitive from a Python user's point of view.
2018-06-30 21:38:45 +02:00
rdb e191ee84f4 cppparser: class is not implicitly copyable if it has a move ctor 2018-06-30 21:38:45 +02:00
rdb b2c04a8c7a interrogate: support scoped enum args and return values 2018-06-30 21:38:40 +02:00