MezzanineEngine 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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 MEZZ_USEBARRIERSEACHFRAME
 This is used to configure whether to re-create threads each frame of or synchronize. More...
 
#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 WINDOWS if defined then MEZZ_LIB will be set to either "__declspec(dllexport)" or "__declspec(dllimport)". Every Class, template, 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, template, 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 EXPORTINGPHYSGAMEDLL 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 it is running on is windows or not. It is preferable that you configure your build environment to define 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 WINDOWS, if possible copy of our cmake builds for Catch! or the EngineDemo.

The Macro MEZZ_LIB is declared as empty if WINDOWS is not defined, as should be the case if LINUX or 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 128 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 173 of file crossplatformexport.h.

#define MEZZ_USEBARRIERSEACHFRAME

This is used to configure whether to re-create threads each frame of or synchronize.

Any synchronization will be done with atomic Barrier. This is controlled by the CMake (or other build system) option Mezz_MinimizeThreadsEachFrame.

Definition at line 156 of file crossplatformexport.h.