dtoolbase: Change export macros to EXP*_DTOOL_DTOOLBASE

This is for consistency with `panda`, which follows this format.
This commit is contained in:
Sam Edwards 2018-02-25 18:19:02 -07:00
parent 29318992d9
commit 9852ada792
25 changed files with 56 additions and 51 deletions

View File

@ -23,7 +23,7 @@
* of static functions, which are used to wrap calls to Bob Jenkins' public- * of static functions, which are used to wrap calls to Bob Jenkins' public-
* domain hash generation function (defined in lookup3.c). * domain hash generation function (defined in lookup3.c).
*/ */
class EXPCL_DTOOL AddHash { class EXPCL_DTOOL_DTOOLBASE AddHash {
public: public:
INLINE static size_t add_hash(size_t start, const uint32_t *words, size_t num_words); INLINE static size_t add_hash(size_t start, const uint32_t *words, size_t num_words);
static size_t add_hash(size_t start, const uint8_t *bytes, size_t num_bytes); static size_t add_hash(size_t start, const uint8_t *bytes, size_t num_bytes);

View File

@ -24,7 +24,7 @@
* require multiprogramming, and therefore don't require special atomic * require multiprogramming, and therefore don't require special atomic
* operations. * operations.
*/ */
class EXPCL_DTOOL AtomicAdjustDummyImpl { class EXPCL_DTOOL_DTOOLBASE AtomicAdjustDummyImpl {
public: public:
typedef long Integer; typedef long Integer;
typedef void *Pointer; typedef void *Pointer;

View File

@ -22,7 +22,7 @@
/** /**
* Uses GCC built-ins to implement atomic adjustments. * Uses GCC built-ins to implement atomic adjustments.
*/ */
class EXPCL_DTOOL AtomicAdjustGccImpl { class EXPCL_DTOOL_DTOOLBASE AtomicAdjustGccImpl {
public: public:
#if __GCC_ATOMIC_LONG_LOCK_FREE >= __GCC_ATOMIC_INT_LOCK_FREE #if __GCC_ATOMIC_LONG_LOCK_FREE >= __GCC_ATOMIC_INT_LOCK_FREE
// If the long can be more lock-free than int, use it instead. // If the long can be more lock-free than int, use it instead.

View File

@ -26,7 +26,7 @@
* Although this class is named i386, it actually uses instructions that are * Although this class is named i386, it actually uses instructions that are
* specific to 486 and higher. * specific to 486 and higher.
*/ */
class EXPCL_DTOOL AtomicAdjustI386Impl { class EXPCL_DTOOL_DTOOLBASE AtomicAdjustI386Impl {
public: public:
typedef ALIGN_4BYTE int32_t Integer; typedef ALIGN_4BYTE int32_t Integer;
typedef void *UnalignedPointer; typedef void *UnalignedPointer;

View File

@ -26,7 +26,7 @@
/** /**
* Uses POSIX to implement atomic adjustments. * Uses POSIX to implement atomic adjustments.
*/ */
class EXPCL_DTOOL AtomicAdjustPosixImpl { class EXPCL_DTOOL_DTOOLBASE AtomicAdjustPosixImpl {
public: public:
// In Posix, "long" is generally the native word size (32- or 64-bit), which // In Posix, "long" is generally the native word size (32- or 64-bit), which
// is what we'd prefer. // is what we'd prefer.

View File

@ -29,7 +29,7 @@
/** /**
* Uses Windows native calls to implement atomic adjustments. * Uses Windows native calls to implement atomic adjustments.
*/ */
class EXPCL_DTOOL AtomicAdjustWin32Impl { class EXPCL_DTOOL_DTOOLBASE AtomicAdjustWin32Impl {
public: public:
#ifdef _WIN64 #ifdef _WIN64
// For 64-bit builds, we'd prefer to use a 64-bit integer. // For 64-bit builds, we'd prefer to use a 64-bit integer.

View File

@ -55,7 +55,7 @@ enum DeletedChainFlag {
* *
* Use MemoryHook to get a new DeletedBufferChain of a particular size. * Use MemoryHook to get a new DeletedBufferChain of a particular size.
*/ */
class EXPCL_DTOOL DeletedBufferChain { class EXPCL_DTOOL_DTOOLBASE DeletedBufferChain {
protected: protected:
DeletedBufferChain(size_t buffer_size); DeletedBufferChain(size_t buffer_size);

View File

@ -282,8 +282,8 @@ class ReferenceCount;
// We need a pointer to a global MemoryHook object, to manage all malloc and // We need a pointer to a global MemoryHook object, to manage all malloc and
// free requests from Panda. See the comments in MemoryHook itself. // free requests from Panda. See the comments in MemoryHook itself.
class MemoryHook; class MemoryHook;
EXPCL_DTOOL extern MemoryHook *memory_hook; EXPCL_DTOOL_DTOOLBASE extern MemoryHook *memory_hook;
EXPCL_DTOOL void init_memory_hook(); EXPCL_DTOOL_DTOOLBASE void init_memory_hook();
// Now redefine some handy macros to hook into the above MemoryHook object. // Now redefine some handy macros to hook into the above MemoryHook object.
#ifndef USE_MEMORY_NOWRAPPERS #ifndef USE_MEMORY_NOWRAPPERS
@ -303,8 +303,8 @@ EXPCL_DTOOL void init_memory_hook();
#if defined(HAVE_THREADS) && defined(SIMPLE_THREADS) #if defined(HAVE_THREADS) && defined(SIMPLE_THREADS)
// We need another forward-reference function to allow low-level code to // We need another forward-reference function to allow low-level code to
// cooperatively yield the timeslice, in SIMPLE_THREADS mode. // cooperatively yield the timeslice, in SIMPLE_THREADS mode.
extern EXPCL_DTOOL void (*global_thread_yield)(); extern EXPCL_DTOOL_DTOOLBASE void (*global_thread_yield)();
extern EXPCL_DTOOL void (*global_thread_consider_yield)(); extern EXPCL_DTOOL_DTOOLBASE void (*global_thread_consider_yield)();
INLINE void thread_yield() { INLINE void thread_yield() {
(*global_thread_yield)(); (*global_thread_yield)();
@ -324,8 +324,8 @@ INLINE void thread_consider_yield() {
#if defined(USE_TAU) && defined(WIN32) #if defined(USE_TAU) && defined(WIN32)
// Hack around tau's lack of DLL export declarations for Profiler class. // Hack around tau's lack of DLL export declarations for Profiler class.
extern EXPCL_DTOOL bool __tau_shutdown; extern EXPCL_DTOOL_DTOOLBASE bool __tau_shutdown;
class EXPCL_DTOOL TauProfile { class EXPCL_DTOOL_DTOOLBASE TauProfile {
public: public:
TauProfile(void *&tautimer, char *name, char *type, int group, char *group_name) { TauProfile(void *&tautimer, char *name, char *type, int group, char *group_name) {
Tau_profile_c_timer(&tautimer, name, type, group, group_name); Tau_profile_c_timer(&tautimer, name, type, group, group_name);

View File

@ -99,6 +99,11 @@
#define EXPTP_MISC IMPORT_TEMPL #define EXPTP_MISC IMPORT_TEMPL
#endif /* BUILDING_MISC */ #endif /* BUILDING_MISC */
#define EXPCL_DTOOL_DTOOLBASE EXPCL_DTOOL
#define EXPTP_DTOOL_DTOOLBASE EXPTP_DTOOL
/* These two are always defined empty, because pystub is statically /* These two are always defined empty, because pystub is statically
built. But we leave the symbol around in case we change our minds built. But we leave the symbol around in case we change our minds
to make pystub once again be a dynamic library. */ to make pystub once again be a dynamic library. */

View File

@ -22,7 +22,7 @@
* stream itself. Useful for indenting a series of lines of text by a given * stream itself. Useful for indenting a series of lines of text by a given
* amount. * amount.
*/ */
EXPCL_DTOOL ostream & EXPCL_DTOOL_DTOOLBASE ostream &
indent(ostream &out, int indent_level); indent(ostream &out, int indent_level);
/** /**

View File

@ -21,7 +21,7 @@
extern "C" { extern "C" {
#endif #endif
EXPCL_DTOOL uint32_t hashword(const uint32_t *k, /* the key, an array of uint32_t values */ EXPCL_DTOOL_DTOOLBASE uint32_t hashword(const uint32_t *k, /* the key, an array of uint32_t values */
size_t length, /* the length of the key, in uint32_ts */ size_t length, /* the length of the key, in uint32_ts */
uint32_t initval); uint32_t initval);

View File

@ -66,7 +66,7 @@
* that seems to cause problems when including header files for C++-based * that seems to cause problems when including header files for C++-based
* system libraries (such as are found on OSX). * system libraries (such as are found on OSX).
*/ */
class EXPCL_DTOOL MemoryBase { class EXPCL_DTOOL_DTOOLBASE MemoryBase {
public: public:
ALLOC_MEMORY_BASE; ALLOC_MEMORY_BASE;
}; };

View File

@ -34,7 +34,7 @@ class DeletedBufferChain;
* employed for classes which inherit from MemoryBase; otherwise, use the * employed for classes which inherit from MemoryBase; otherwise, use the
* PANDA_MALLOC macros.) * PANDA_MALLOC macros.)
*/ */
class EXPCL_DTOOL MemoryHook { class EXPCL_DTOOL_DTOOLBASE MemoryHook {
public: public:
MemoryHook(); MemoryHook();
MemoryHook(const MemoryHook &copy); MemoryHook(const MemoryHook &copy);

View File

@ -21,7 +21,7 @@
* A fake mutex implementation for single-threaded applications that don't * A fake mutex implementation for single-threaded applications that don't
* need any synchronization control. This does nothing at all. * need any synchronization control. This does nothing at all.
*/ */
class EXPCL_DTOOL MutexDummyImpl { class EXPCL_DTOOL_DTOOLBASE MutexDummyImpl {
public: public:
CONSTEXPR MutexDummyImpl() DEFAULT_CTOR; CONSTEXPR MutexDummyImpl() DEFAULT_CTOR;

View File

@ -26,7 +26,7 @@
/** /**
* Uses Posix threads to implement a mutex. * Uses Posix threads to implement a mutex.
*/ */
class EXPCL_DTOOL MutexPosixImpl { class EXPCL_DTOOL_DTOOLBASE MutexPosixImpl {
public: public:
CONSTEXPR MutexPosixImpl() NOEXCEPT; CONSTEXPR MutexPosixImpl() NOEXCEPT;
INLINE ~MutexPosixImpl(); INLINE ~MutexPosixImpl();
@ -50,7 +50,7 @@ private:
/** /**
* Uses Posix threads to implement a reentrant mutex. * Uses Posix threads to implement a reentrant mutex.
*/ */
class EXPCL_DTOOL ReMutexPosixImpl { class EXPCL_DTOOL_DTOOLBASE ReMutexPosixImpl {
public: public:
#ifdef PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP #ifdef PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP
CONSTEXPR ReMutexPosixImpl() NOEXCEPT; CONSTEXPR ReMutexPosixImpl() NOEXCEPT;

View File

@ -27,7 +27,7 @@
* specific application on a specific SMP machine, and you are confident that * specific application on a specific SMP machine, and you are confident that
* you have at least as many CPU's as you have threads. * you have at least as many CPU's as you have threads.
*/ */
class EXPCL_DTOOL MutexSpinlockImpl { class EXPCL_DTOOL_DTOOLBASE MutexSpinlockImpl {
public: public:
CONSTEXPR MutexSpinlockImpl(); CONSTEXPR MutexSpinlockImpl();

View File

@ -26,7 +26,7 @@
/** /**
* Uses Windows native calls to implement a mutex. * Uses Windows native calls to implement a mutex.
*/ */
class EXPCL_DTOOL MutexWin32Impl { class EXPCL_DTOOL_DTOOLBASE MutexWin32Impl {
public: public:
MutexWin32Impl(); MutexWin32Impl();
INLINE ~MutexWin32Impl(); INLINE ~MutexWin32Impl();

View File

@ -29,7 +29,7 @@
* since this will help reduce fragmentation problems in the dynamic heap. * since this will help reduce fragmentation problems in the dynamic heap.
* Also, memory allocated from here will exhibit less wasted space. * Also, memory allocated from here will exhibit less wasted space.
*/ */
class EXPCL_DTOOL NeverFreeMemory { class EXPCL_DTOOL_DTOOLBASE NeverFreeMemory {
private: private:
NeverFreeMemory(); NeverFreeMemory();

View File

@ -15,7 +15,7 @@
extern "C" { extern "C" {
#endif #endif
EXPCL_DTOOL void pdtoa(double value, char *buffer); EXPCL_DTOOL_DTOOLBASE void pdtoa(double value, char *buffer);
#ifdef __cplusplus #ifdef __cplusplus
}; /* end of extern "C" */ }; /* end of extern "C" */

View File

@ -20,10 +20,10 @@
extern "C" { extern "C" {
#endif #endif
EXPCL_DTOOL double EXPCL_DTOOL_DTOOLBASE double
pstrtod(const char *nptr, char **endptr); pstrtod(const char *nptr, char **endptr);
EXPCL_DTOOL double EXPCL_DTOOL_DTOOLBASE double
patof(const char *str); patof(const char *str);
#ifdef __cplusplus #ifdef __cplusplus

View File

@ -76,18 +76,18 @@ register_dynamic_type(const string &name,
// A few system-wide TypeHandles are defined for some basic types. // A few system-wide TypeHandles are defined for some basic types.
extern TypeHandle EXPCL_DTOOL long_type_handle; extern TypeHandle EXPCL_DTOOL_DTOOLBASE long_type_handle;
extern TypeHandle EXPCL_DTOOL int_type_handle; extern TypeHandle EXPCL_DTOOL_DTOOLBASE int_type_handle;
extern TypeHandle EXPCL_DTOOL uint_type_handle; extern TypeHandle EXPCL_DTOOL_DTOOLBASE uint_type_handle;
extern TypeHandle EXPCL_DTOOL short_type_handle; extern TypeHandle EXPCL_DTOOL_DTOOLBASE short_type_handle;
extern TypeHandle EXPCL_DTOOL ushort_type_handle; extern TypeHandle EXPCL_DTOOL_DTOOLBASE ushort_type_handle;
extern TypeHandle EXPCL_DTOOL char_type_handle; extern TypeHandle EXPCL_DTOOL_DTOOLBASE char_type_handle;
extern TypeHandle EXPCL_DTOOL uchar_type_handle; extern TypeHandle EXPCL_DTOOL_DTOOLBASE uchar_type_handle;
extern TypeHandle EXPCL_DTOOL bool_type_handle; extern TypeHandle EXPCL_DTOOL_DTOOLBASE bool_type_handle;
extern TypeHandle EXPCL_DTOOL double_type_handle; extern TypeHandle EXPCL_DTOOL_DTOOLBASE double_type_handle;
extern TypeHandle EXPCL_DTOOL float_type_handle; extern TypeHandle EXPCL_DTOOL_DTOOLBASE float_type_handle;
extern TypeHandle EXPCL_DTOOL string_type_handle; extern TypeHandle EXPCL_DTOOL_DTOOLBASE string_type_handle;
extern TypeHandle EXPCL_DTOOL wstring_type_handle; extern TypeHandle EXPCL_DTOOL_DTOOLBASE wstring_type_handle;
extern TypeHandle long_p_type_handle; extern TypeHandle long_p_type_handle;
extern TypeHandle int_p_type_handle; extern TypeHandle int_p_type_handle;
@ -98,14 +98,14 @@ extern TypeHandle double_p_type_handle;
extern TypeHandle float_p_type_handle; extern TypeHandle float_p_type_handle;
extern TypeHandle void_p_type_handle; extern TypeHandle void_p_type_handle;
extern TypeHandle EXPCL_DTOOL pvector_type_handle; extern TypeHandle EXPCL_DTOOL_DTOOLBASE pvector_type_handle;
extern TypeHandle EXPCL_DTOOL ov_set_type_handle; extern TypeHandle EXPCL_DTOOL_DTOOLBASE ov_set_type_handle;
extern TypeHandle EXPCL_DTOOL pdeque_type_handle; extern TypeHandle EXPCL_DTOOL_DTOOLBASE pdeque_type_handle;
extern TypeHandle EXPCL_DTOOL plist_type_handle; extern TypeHandle EXPCL_DTOOL_DTOOLBASE plist_type_handle;
extern TypeHandle EXPCL_DTOOL pmap_type_handle; extern TypeHandle EXPCL_DTOOL_DTOOLBASE pmap_type_handle;
extern TypeHandle EXPCL_DTOOL pset_type_handle; extern TypeHandle EXPCL_DTOOL_DTOOLBASE pset_type_handle;
void EXPCL_DTOOL init_system_type_handles(); void EXPCL_DTOOL_DTOOLBASE init_system_type_handles();
// The following template function and its specializations will return a // The following template function and its specializations will return a
// TypeHandle for any type in the world, from a pointer to that type. // TypeHandle for any type in the world, from a pointer to that type.

View File

@ -78,7 +78,7 @@ class TypedObject;
* that ancestry of a particular type may be queried, and the type name may be * that ancestry of a particular type may be queried, and the type name may be
* retrieved for run-time display. * retrieved for run-time display.
*/ */
class EXPCL_DTOOL TypeHandle FINAL { class EXPCL_DTOOL_DTOOLBASE TypeHandle FINAL {
PUBLISHED: PUBLISHED:
TypeHandle() NOEXCEPT DEFAULT_CTOR; TypeHandle() NOEXCEPT DEFAULT_CTOR;
@ -162,7 +162,7 @@ INLINE ostream &operator << (ostream &out, TypeHandle type) {
return out; return out;
} }
EXPCL_DTOOL ostream &operator << (ostream &out, TypeHandle::MemoryClass mem_class); EXPCL_DTOOL_DTOOLBASE ostream &operator << (ostream &out, TypeHandle::MemoryClass mem_class);
// We must include typeRegistry at this point so we can call it from our // We must include typeRegistry at this point so we can call it from our
// inline functions. This is a circular include that is strategically placed // inline functions. This is a circular include that is strategically placed

View File

@ -33,7 +33,7 @@ class TypedObject;
* should be migrated to shared memory as soon as shared memory becomes * should be migrated to shared memory as soon as shared memory becomes
* available. * available.
*/ */
class EXPCL_DTOOL TypeRegistry : public MemoryBase { class EXPCL_DTOOL_DTOOLBASE TypeRegistry : public MemoryBase {
public: public:
// User code shouldn't generally need to call TypeRegistry::register_type() // User code shouldn't generally need to call TypeRegistry::register_type()
// or record_derivation() directly; instead, use the register_type // or record_derivation() directly; instead, use the register_type
@ -118,7 +118,7 @@ private:
}; };
// Helper function to allow for "C" interaction into the type system // Helper function to allow for "C" interaction into the type system
extern "C" EXPCL_DTOOL int get_best_parent_from_Set(int id, const std::set<int> &this_set); extern "C" EXPCL_DTOOL_DTOOLBASE int get_best_parent_from_Set(int id, const std::set<int> &this_set);
#include "typeHandle.h" #include "typeHandle.h"

View File

@ -27,7 +27,7 @@
* directly access this class; this class is hidden within the TypeRegistry * directly access this class; this class is hidden within the TypeRegistry
* accessors. * accessors.
*/ */
class EXPCL_DTOOL TypeRegistryNode { class EXPCL_DTOOL_DTOOLBASE TypeRegistryNode {
public: public:
TypeRegistryNode(TypeHandle handle, const string &name, TypeHandle &ref); TypeRegistryNode(TypeHandle handle, const string &name, TypeHandle &ref);

View File

@ -85,7 +85,7 @@
* } * }
* @endcode * @endcode
*/ */
class EXPCL_DTOOL TypedObject : public MemoryBase { class EXPCL_DTOOL_DTOOLBASE TypedObject : public MemoryBase {
public: public:
INLINE TypedObject() DEFAULT_CTOR; INLINE TypedObject() DEFAULT_CTOR;
INLINE TypedObject(const TypedObject &copy) DEFAULT_CTOR; INLINE TypedObject(const TypedObject &copy) DEFAULT_CTOR;