I'm using a library that has only one difference between platforms/versions. One version calls the class btCollisionObject and other versions call it btCollisionObjectWrapper. If I could make this class have two names that still reference that class then all my problems would be solved. I tried: #define btCollisionObject btCollisionObjectWrapper;
but it is not working. What is the correct way to give a class two names after the class has been defined?
To assign multiple classes to a single HTML element, you need to specify each class name inside the class attribute separated with a blank space. A class name that has more than one word is commonly joined with a dash ( - ) this is also known as the kebab-case.
To specify multiple classes, separate the class names with a space, e.g. <span class="left important">.
HTML elements can be assigned multiple classes by listing the classes in the class attribute, with a blank space to separate them. If the same property is declared in both rules, the conflict is resolved first through specificity, then according to the order of the CSS declarations.
If you want to add multiple class names, you can add it to the className attribute by separating with spaces.
Maybe
typedef btCollisionObjectWrapper btCollisionObject;
Better to do it using language tools instead of the preprocessor.
If I understand your problem correctly you will have to find a way of determining which platform you are compiling for, because I don't know which platforms you are using I can't give any advice on this however it is probably possible to do so via macros.
The solution to your problem will probably look a bit like this.
In C++98 using a type declaration
#ifdef __PLATFORM_SPECIFIC_DEFINE
typedef btCollisionObjectWrapper btCollisionObject;
#endif
In C++11 using an alias declaration, this has the added advantage that they may be used with templates however in your case you could get away with a simple typedef.
#ifdef __PLATFORM_SPECIFIC_DEFINE
using btCollisionObject = btCollisionObjectWrapper;
#endif
This will allow you to use btCollisionObject
as the class name for the platform that uses btCollisionObjectWrapper
You will of course have to replace the __PLATFORM_SPECIFIC_DEFINE
with a macro that is defined by the platform that uses btCollisionObjectWrapper
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With