Audacity 3.2.0
|
Guidelines for making the code compile and work on all supported platforms.
The following is not supported under gcc 2.x:
Instead use the traditional:
Audacity code is translated, and it may be built in Unicode versions.
For this reason all strings should be wrapped like this:
In some cases you need to give hints to a translator about how a string should be translated. Do so as follows:
Very long strings can be wrapped across multiple lines, as follows:
Notice that in the translated example, all bar the first substring are contained within a wxT()
.
Don't write code like this:
Whilst it is fine under MSVC it will cause a problem under gcc as the constructor is a temporary object which will be optimised away.
Instead use:
Windows systems are not case sensitive, whilst Linux systems are. You therefore need to take care in capitalisation, e.g:
Microsoft Visual C++ allows you to write code like this in a header file:
For portability, the 'MyClass:
:' prefix should be left out.
Don't write code like this:
Although MSVC won't complain even in Unicode mode, it generates a warning under gcc. Instead you need:
Microsoft Visual C++ allows you to write code like this in a header file:
That is, you can forward declare an enum just as you can forward declare a class. This is not portable. The alternative is to include a header file containing the full enum definition.