Byte Order
[Functions and Macros by Category]


Detailed Description

The endian-ness issues (that is the difference between big-endian and little-endian architectures) are important for the portable programs working with the external binary data (for example, data files or data coming from network) which is usually in some fixed, platform-independent format.

The macros are helpful for transforming the data to the correct format.

#define wxINT32_SWAP_ALWAYS(wxInt32 value)
#define wxUINT32_SWAP_ALWAYS(wxUint32 value)
#define wxINT16_SWAP_ALWAYS(wxInt16 value)
#define wxUINT16_SWAP_ALWAYS(wxUint16 value)
#define wxINT32_SWAP_ON_BE(wxInt32 value)
#define wxUINT32_SWAP_ON_BE(wxUint32 value)
#define wxINT16_SWAP_ON_BE(wxInt16 value)
#define wxUINT16_SWAP_ON_BE(wxUint16 value)
#define wxINT32_SWAP_ON_LE(wxInt32 value)
#define wxUINT32_SWAP_ON_LE(wxUint32 value)
#define wxINT16_SWAP_ON_LE(wxInt16 value)
#define wxUINT16_SWAP_ON_LE(wxUint16 value)
#define wxFORCE_LINK_THIS_MODULE(moduleName)
#define wxFORCE_LINK_MODULE(moduleName)

Define Documentation

#define wxFORCE_LINK_MODULE ( moduleName   ) 

This macro can be used in conjunction with the wxFORCE_LINK_THIS_MODULE() macro to force the linker to include in its output a specific object file.

In particular, you should use this macro in a source file which you know for sure is linked in the output (e.g. the source file containing the main() of your app). The moduleName is the name of the module you want to forcefully link (i.e. the name you used in the relative wxFORCE_LINK_THIS_MODULE() macro.

Include file:

#include <wx/link.h> 

#define wxFORCE_LINK_THIS_MODULE ( moduleName   ) 

This macro can be used in conjunction with the wxFORCE_LINK_MODULE() macro to force the linker to include in its output a specific object file.

In particular, you should use this macro in the source file which you want to force for inclusion. The moduleName needs to be a name not already in use in other wxFORCE_LINK_THIS_MODULE() macros, but is not required to be e.g. the same name of the source file (even if it's a good choice).

Include file:

#include <wx/link.h> 

#define wxINT16_SWAP_ALWAYS ( wxInt16 value   ) 

This macro will swap the bytes of the value variable from little endian to big endian or vice versa unconditionally, i.e. independently of the current platform.

Include file:

#include <wx/defs.h> 

#define wxINT16_SWAP_ON_BE ( wxInt16 value   ) 

This macro will swap the bytes of the value variable from little endian to big endian or vice versa if the program is compiled on a big-endian architecture (such as Sun work stations). If the program has been compiled on a little-endian architecture, the value will be unchanged.

Use these macros to read data from and write data to a file that stores data in little-endian (for example Intel i386) format.

Include file:

#include <wx/defs.h> 

#define wxINT16_SWAP_ON_LE ( wxInt16 value   ) 

This macro will swap the bytes of the value variable from little endian to big endian or vice versa if the program is compiled on a little-endian architecture (such as Intel PCs). If the program has been compiled on a big-endian architecture, the value will be unchanged.

Use these macros to read data from and write data to a file that stores data in big-endian format.

Include file:

#include <wx/defs.h> 

#define wxINT32_SWAP_ALWAYS ( wxInt32 value   ) 

This macro will swap the bytes of the value variable from little endian to big endian or vice versa unconditionally, i.e. independently of the current platform.

Include file:

#include <wx/defs.h> 

#define wxINT32_SWAP_ON_BE ( wxInt32 value   ) 

This macro will swap the bytes of the value variable from little endian to big endian or vice versa if the program is compiled on a big-endian architecture (such as Sun work stations). If the program has been compiled on a little-endian architecture, the value will be unchanged.

Use these macros to read data from and write data to a file that stores data in little-endian (for example Intel i386) format.

Include file:

#include <wx/defs.h> 

#define wxINT32_SWAP_ON_LE ( wxInt32 value   ) 

This macro will swap the bytes of the value variable from little endian to big endian or vice versa if the program is compiled on a little-endian architecture (such as Intel PCs). If the program has been compiled on a big-endian architecture, the value will be unchanged.

Use these macros to read data from and write data to a file that stores data in big-endian format.

Include file:

#include <wx/defs.h> 

#define wxUINT16_SWAP_ALWAYS ( wxUint16 value   ) 

This macro will swap the bytes of the value variable from little endian to big endian or vice versa unconditionally, i.e. independently of the current platform.

Include file:

#include <wx/defs.h> 

#define wxUINT16_SWAP_ON_BE ( wxUint16 value   ) 

This macro will swap the bytes of the value variable from little endian to big endian or vice versa if the program is compiled on a big-endian architecture (such as Sun work stations). If the program has been compiled on a little-endian architecture, the value will be unchanged.

Use these macros to read data from and write data to a file that stores data in little-endian (for example Intel i386) format.

Include file:

#include <wx/defs.h> 

#define wxUINT16_SWAP_ON_LE ( wxUint16 value   ) 

This macro will swap the bytes of the value variable from little endian to big endian or vice versa if the program is compiled on a little-endian architecture (such as Intel PCs). If the program has been compiled on a big-endian architecture, the value will be unchanged.

Use these macros to read data from and write data to a file that stores data in big-endian format.

Include file:

#include <wx/defs.h> 

#define wxUINT32_SWAP_ALWAYS ( wxUint32 value   ) 

This macro will swap the bytes of the value variable from little endian to big endian or vice versa unconditionally, i.e. independently of the current platform.

Include file:

#include <wx/defs.h> 

#define wxUINT32_SWAP_ON_BE ( wxUint32 value   ) 

This macro will swap the bytes of the value variable from little endian to big endian or vice versa if the program is compiled on a big-endian architecture (such as Sun work stations). If the program has been compiled on a little-endian architecture, the value will be unchanged.

Use these macros to read data from and write data to a file that stores data in little-endian (for example Intel i386) format.

Include file:

#include <wx/defs.h> 

#define wxUINT32_SWAP_ON_LE ( wxUint32 value   ) 

This macro will swap the bytes of the value variable from little endian to big endian or vice versa if the program is compiled on a little-endian architecture (such as Intel PCs). If the program has been compiled on a big-endian architecture, the value will be unchanged.

Use these macros to read data from and write data to a file that stores data in big-endian format.

Include file:

#include <wx/defs.h> 



wxWidgets logo

[ top ]