Torque3D Documentation / _generateds / types.visualc.h

types.visualc.h

Engine/source/platform/types.visualc.h

More...

Public Defines

define
FN_CDECL() __cdecl

Calling convention.

define
for() (false) {} else for

Hack to work around Microsoft VC's non-C++ compliance on variable scoping.

define
define
TORQUE_UNUSED(var) (()0)

Public Typedefs

signed _int64
S64 
unsigned _int64
U64 

Detailed Description

Public Defines

FN_CDECL() __cdecl

Calling convention.

for() (false) {} else for

Hack to work around Microsoft VC's non-C++ compliance on variable scoping.

TORQUE_COMPILER_VISUALC() _MSC_VER
TORQUE_UNUSED(var) (()0)

Public Typedefs

typedef signed _int64 S64 
typedef unsigned _int64 U64 
  1
  2//-----------------------------------------------------------------------------
  3// Copyright (c) 2012 GarageGames, LLC
  4//
  5// Permission is hereby granted, free of charge, to any person obtaining a copy
  6// of this software and associated documentation files (the "Software"), to
  7// deal in the Software without restriction, including without limitation the
  8// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
  9// sell copies of the Software, and to permit persons to whom the Software is
 10// furnished to do so, subject to the following conditions:
 11//
 12// The above copyright notice and this permission notice shall be included in
 13// all copies or substantial portions of the Software.
 14//
 15// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 16// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 17// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 18// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 19// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 20// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
 21// IN THE SOFTWARE.
 22//-----------------------------------------------------------------------------
 23
 24#ifndef INCLUDED_TYPES_VISUALC_H
 25#define INCLUDED_TYPES_VISUALC_H
 26
 27
 28// For more information on VisualC++ predefined macros
 29// http://support.microsoft.com/default.aspx?scid=kb;EN-US;q65472
 30
 31//--------------------------------------
 32// Types
 33typedef signed _int64   S64;
 34typedef unsigned _int64 U64;
 35
 36// The types.h version of TORQUE_UNUSED no longer works for recent versions of MSVC.
 37// Since it appears that MS has made this impossible to do in a zero-overhead way,
 38// just turn the warning off in release builds.
 39#undef TORQUE_UNUSED
 40#ifdef TORQUE_DEBUG
 41#define TORQUE_UNUSED(var) ((0,0) ? (void)(var) : (void)0)
 42#else
 43#pragma warning(disable: 4189) // local variable is initialized but not referenced
 44#define TORQUE_UNUSED(var) ((void)0)
 45#endif
 46
 47//--------------------------------------
 48// Compiler Version
 49#define TORQUE_COMPILER_VISUALC _MSC_VER
 50
 51//--------------------------------------
 52// Identify the compiler string
 53#if _MSC_VER < 1200
 54   // No support for old compilers
 55#  error "VC: Minimum VisualC++ 6.0 or newer required"
 56#else // _MSC_VER >= 1200
 57#  define TORQUE_COMPILER_STRING "VisualC++"
 58#endif
 59
 60
 61//--------------------------------------
 62// Identify the Operating System
 63#if defined( _WIN32 ) && !defined ( _WIN64 )
 64#  define TORQUE_OS_STRING "Win32"
 65#  define TORQUE_OS_WIN
 66#  define TORQUE_OS_WIN32
 67#  include "platform/types.win.h"
 68#elif defined( _WIN64 )
 69#  define TORQUE_OS_STRING "Win64"
 70#  define TORQUE_OS_WIN
 71#  define TORQUE_OS_WIN64
 72#  include "platform/types.win.h"
 73#else 
 74#  error "VC: Unsupported Operating System"
 75#endif
 76
 77
 78//--------------------------------------
 79// Identify the CPU
 80#if defined( _M_X64 )
 81#  define TORQUE_CPU_STRING "x64"
 82#  define TORQUE_CPU_X64
 83#  define TORQUE_LITTLE_ENDIAN
 84#elif defined( _M_IX86 )
 85#  define TORQUE_CPU_STRING "x86"
 86#  define TORQUE_CPU_X86
 87#  define TORQUE_LITTLE_ENDIAN
 88#ifndef __clang__ // asm not yet supported with clang
 89#  define TORQUE_SUPPORTS_NASM
 90#  define TORQUE_SUPPORTS_VC_INLINE_X86_ASM
 91#endif
 92#else
 93#  error "VC: Unsupported Target CPU"
 94#endif
 95
 96#ifndef FN_CDECL
 97#  define FN_CDECL __cdecl            ///< Calling convention
 98#endif
 99
100#if _MSC_VER < 1700
101#define for if(false) {} else for   ///< Hack to work around Microsoft VC's non-C++ compliance on variable scoping
102#endif
103
104// disable warning caused by memory layer
105// see msdn.microsoft.com "Compiler Warning (level 1) C4291" for more details
106#pragma warning(disable: 4291) 
107
108
109#endif // INCLUDED_TYPES_VISUALC_H
110
111