Sierra Toolkit Version of the Day
rdestl_common.h
00001 #ifndef RDESTL_COMMON_H
00002 #define RDESTL_COMMON_H
00003 
00004 #ifndef RDESTL_STANDALONE
00005 # define RDESTL_STANDALONE  1
00006 #endif
00007 
00008 #if RDESTL_STANDALONE
00009 #  ifdef _MSC_VER
00010 # include <cassert>
00011 # include <cstring>
00012 # define RDE_FORCEINLINE  __forceinline
00013 #  else
00014 #   include <assert.h>
00015 #   include <cstdlib>
00016 #   include <cstring>
00017 # define RDE_FORCEINLINE  inline
00018 #  endif
00019 
00020 # ifdef _DEBUG
00021 #   undef RDE_DEBUG
00022 #   define RDE_DEBUG  1
00023 # endif
00024 
00025 # define RDE_ASSERT assert
00026 
00027   namespace rde
00028   {
00029     // # Meh. MSVC doesnt seem to have <stdint.h>
00030     // @todo  Fixes to make this portable.
00031     typedef unsigned char   uint8;
00032     typedef unsigned short    uint16;
00033     typedef signed long     int32;
00034     typedef unsigned long   uint32;
00035         #ifdef _MSC_VER
00036     typedef unsigned __int64  uint64;
00037         #else
00038         typedef unsigned long long  uint64;
00039         #endif
00040     namespace Sys
00041     {
00042       RDE_FORCEINLINE void MemCpy(void* to, const void* from, size_t bytes)
00043       {
00044         memcpy(to, from, bytes);
00045       }
00046       RDE_FORCEINLINE void MemMove(void* to, const void* from, size_t bytes)
00047       {
00048         memmove(to, from, bytes);
00049       }
00050       RDE_FORCEINLINE void MemSet(void* buf, unsigned char value, size_t bytes)
00051       {
00052         memset(buf, value, bytes);
00053       }
00054     } // sys
00055   }
00056 #else
00057 # include "core/RdeAssert.h"
00058 # include "core/System.h"
00059 #endif
00060 
00061 namespace rde
00062 {
00063 enum e_noinitialize
00064 {
00065   noinitialize
00066 };
00067 }
00068 
00069 #endif // #ifndef RDESTL_H
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends