Spinning Topp Logo BlackTopp Studios
inc
Macros
crossplatformexport.h File Reference

This file is used on some platforms to determine what data should be read and written to and from a shared/dynamic library. More...

+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define _MEZZ_PLATFORM_DEFINED_
 
#define _MEZZ_THREAD_POSIX_
 Defined if this is running on Linux, Mac OS X, Android, or any other sane platform. More...
 
#define MEZZ_DEPRECATED
 Used to mark old functionality that should not be used as such. In supported compilers using such functionality should produce warnings.
 
#define MEZZ_FRAMESTOTRACK   10
 Used to control how long frames track length and other similar values. This is controlled by the CMake (or other build system) option Mezz_FramesToTrack.
 
#define MEZZ_LIB
 Some platforms require special decorations to denote what is exported/imported in a share library. This is that decoration if when it is needed.
 
#define MEZZ_USEATOMICSTODECACHECOMPLETEWORK
 This is used to configure whether to atomically store a shortcut to skip checking all workunits. More...
 
#define PRAGMA(x)   _Pragma(#x)
 
#define RESTORE_WARNING_STATE   PRAGMA(GCC diagnostic pop)
 Restores the last warning state saved with SAVE_WARNING_STATE. This cleans up after SAVE_WARNING_STATE. More...
 
#define SAVE_WARNING_STATE   PRAGMA(GCC diagnostic push)
 Saves thes State in the compiler which detemines what warnings will be captured. Must be used with RESTORE_WARNING_STATE to prevent compilation issues. More...
 
#define SUPPRESS_GCC_WARNING(X)   PRAGMA(GCC diagnostic ignored X)
 If in or a compatible compiler this resolves to a pragma that supresses a warning, if not it resolves to nothing.
 
#define SUPPRESS_VC_WARNING(X)
 If in visual studio this resolves to a pragma that supresses a warning, if not it resolves to nothing.
 
#define WINAPI   ErrorThisOnlyGoesInwin32Code
 Calling some win32 api functions require special calling conventions, this is their configuration.
 

Detailed Description

This file is used on some platforms to determine what data should be read and written to and from a shared/dynamic library.

Sets up some compiler variables that allow the Mezzanine to know what platform it is on.

Currently this file uses __declspec(dllexport) and __declspec(dllimport) on the windows platform to control what is imported from or exported to the Mezzanine DLL. If MEZZ_WINDOWS if defined then MEZZ_LIB will be set to either "__declspec(dllexport)" or "__declspec(dllimport)". Every Class, function variable, and other item intended to be in Mezzanine is tagged with MEZZ_LIB.



During compilation of the Mezzanine engine __declspec(dllexport) tells the compiler that a given item (a function, class, etc...), should be included in the dll and made available for use in games (or whatever kind of applicaitons use Mezzanine). This header sets MEZZ_LIB to __declspec(dllexport) if EXPORTINGMEZZANINEDLL is set. If Mezzanine is compiled using the cmake build provided then this is handle automatically. If the cmake build is not used, then this file will attempt to detect if the platform t is running on is windows or not. It is preferable that you configure your build environment to define MEZZ_WINDOWS and EXPORTINGMEZZANINEDLL if you are compiling this on windows without the provided cmake build.

Compilation of applications using Mezzanine __declspec(dllimport), tells the compiler what to expect from the dll and may make optimizations available with some compilers. This is automatically set if you use the cmake build, if you aren't this file will attempt to determine if you are running windows. It is best to set the build envirnoment of your game or applciation to define MEZZ_WINDOWS, if possible copy of our cmake builds for Catch! or the EngineDemo.



The Macro MEZZ_LIB is declared as empty if MEZZ_WINDOWS is not defined, as should be the case if MEZZ_LINUX or MEZZ_MACOSX is defined.

Definition in file crossplatformexport.h.

Macro Definition Documentation

#define _MEZZ_THREAD_POSIX_

Defined if this is running on Linux, Mac OS X, Android, or any other sane platform.

if this is not defined, then most likely MEZZ_THREAD_WIN32 is.

Definition at line 144 of file crossplatformexport.h.

#define MEZZ_USEATOMICSTODECACHECOMPLETEWORK

This is used to configure whether to atomically store a shortcut to skip checking all workunits.

When this is enabled Atomic CAS operations are used to maintain a count of the number of complete workunits at the beginning of the work unit listings. Normally these listings are read-only during frame execution, and the work units store whether or not they are complete. The default algorithm forces iteration over a large number of work units to simply check for completion in some situations. If memory bandwidth is slow or limited this can be a large source of of contention. Enable this option when there are many work units trades atomic operations for memory bandwidth. This must be tested on a per system basis to determine full preformance ramifications. This is controlled by the CMake (or other build system) option Mezz_DecacheWorkUnits.

Definition at line 182 of file crossplatformexport.h.

#define RESTORE_WARNING_STATE   PRAGMA(GCC diagnostic pop)

Restores the last warning state saved with SAVE_WARNING_STATE. This cleans up after SAVE_WARNING_STATE.

Note
Part of the C++ API only.
See also
SAVE_WARNING_STATE

Definition at line 239 of file crossplatformexport.h.

#define SAVE_WARNING_STATE   PRAGMA(GCC diagnostic push)

Saves thes State in the compiler which detemines what warnings will be captured. Must be used with RESTORE_WARNING_STATE to prevent compilation issues.

See also
RESTORE_WARNING_STATE

Definition at line 236 of file crossplatformexport.h.