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 _XBOX_VER >= 200 
 64#  define TORQUE_OS_STRING "Xenon"
 65#  ifndef TORQUE_OS_XENON
 66#     define TORQUE_OS_XENON
 67#  endif
 68#  include "platform/types.xenon.h"
 69#elif defined( _XBOX_VER )
 70#  define TORQUE_OS_STRING "Xbox"
 71#  define TORQUE_OS_XBOX
 72#  include "platform/types.win.h"
 73#elif defined( _WIN32 ) && !defined ( _WIN64 )
 74#  define TORQUE_OS_STRING "Win32"
 75#  define TORQUE_OS_WIN
 76#  define TORQUE_OS_WIN32
 77#  include "platform/types.win.h"
 78#elif defined( _WIN64 )
 79#  define TORQUE_OS_STRING "Win64"
 80#  define TORQUE_OS_WIN
 81#  define TORQUE_OS_WIN64
 82#  include "platform/types.win.h"
 83#else 
 84#  error "VC: Unsupported Operating System"
 85#endif
 86
 87
 88//--------------------------------------
 89// Identify the CPU
 90#if defined( _M_X64 )
 91#  define TORQUE_CPU_STRING "x64"
 92#  define TORQUE_CPU_X64
 93#  define TORQUE_LITTLE_ENDIAN
 94#elif defined( _M_IX86 )
 95#  define TORQUE_CPU_STRING "x86"
 96#  define TORQUE_CPU_X86
 97#  define TORQUE_LITTLE_ENDIAN
 98#ifndef __clang__ // asm not yet supported with clang
 99#  define TORQUE_SUPPORTS_NASM
100#  define TORQUE_SUPPORTS_VC_INLINE_X86_ASM
101#endif
102#elif defined( TORQUE_OS_XENON )
103#  define TORQUE_CPU_STRING "ppc"
104#  define TORQUE_CPU_PPC
105#  define TORQUE_BIG_ENDIAN
106#else
107#  error "VC: Unsupported Target CPU"
108#endif
109
110#ifndef FN_CDECL
111#  define FN_CDECL __cdecl            ///< Calling convention
112#endif
113
114#if _MSC_VER < 1700
115#define for if(false) {} else for   ///< Hack to work around Microsoft VC's non-C++ compliance on variable scoping
116#endif
117
118// disable warning caused by memory layer
119// see msdn.microsoft.com "Compiler Warning (level 1) C4291" for more details
120#pragma warning(disable: 4291) 
121
122
123#endif // INCLUDED_TYPES_VISUALC_H
124
125