Home

Resume

Blog

Teikitu


/* =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= */
/*  »Project«   Teikitu Gaming System (TgS) (∂)
    »File«      TgS (CLANG-X86) Common - Base - Define - Compiler.h
    »Author«    Andrew Aye (EMail: mailto:andrew.aye@gmail.com, Web: http://www.andrewaye.com)
    »Version«   4.51 / »GUID« A9981407-3EC9-42AF-8B6F-8BE6DD919615                                                                                                        */
/* ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
/*  Copyright: © 2002-2017, Andrew Aye.  All Rights Reserved.
    This software is free for non-commercial use.  Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
    following conditions are met:
    Redistribution of source code must retain this copyright notice, this list of conditions and the following disclaimers.
    Redistribution in binary form must reproduce this copyright notice, this list of conditions and the following disclaimers in the documentation and other materials
    provided with the distribution.
    The name of the author may not be used to endorse or promote products derived from this software without specific prior written permission.
    The intellectual property rights of the algorithms used reside with Andrew Aye.
    You may not use this software, in whole or in part, in support of any commercial product without the express written consent of the author.
    There is no warranty or other guarantee of fitness of this software for any purpose. It is provided solely "as is".                                                   */
/* =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= */
#if !defined(TGS_COMMON_BASE_DEFINE_COMPILER_H) /* Override the ANSI version of the file */
#define TGS_COMMON_BASE_DEFINE_COMPILER_H
#pragma once


/* == Common ============================================================================================================================================================ */

/* -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-. */
/*  Configuration                                                                                                                                                         */
/* -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-. */

#if defined(__clang__)
#pragma clang system_header
#endif

#if defined(_M_X64) || defined(TgCOMPILE_HARDWARE_X64)
#define __AMD64_
#define __X64__
#else
#error Unknown platform
#endif

#define TgCOMPILE_LITTLE_ENDIAN             1
#define TgCOMPILE_THREAD_LOCAL              1
#define TgCOMPILE_THREAD                    1
#define TgCOMPILE_FLOAT64                   0
#define TgCOMPILE_SYSTEM_INFORMATION        1
#define TgCOMPILE_BASE_API_PLATFORM         0

#if defined(__X64__)
    #define TgCOMPILE_64BIT_POINTER             1
    #define TgCOMPILE_32BIT_POINTER             0
    #define TgCOMPILE_64BIT_ATOMIC              1
    #define TgCOMPILE_16BIT_ATOMIC              0
    #define TgCOMPILE_CACHE_LINE_SIZE           64 /* Can not be smaller than 16 because of atomics and vectors*/
    #define TgCOMPILE_POINTER_SIZE              8
#else
    #error Unsupported pointer size
#endif

#define TgATOMIC_SINT16                     int16_t
#define TgATOMIC_SINT32                     int32_t
#define TgATOMIC_SINT64                     int64_t
#define TgATOMIC_PVOID                      P_TgVOID
#define TgATOMIC_SIZE                       TgSIZE
#define TgATOMIC_UINTXX                     uint64_t

#if defined(__X64__)
    #define TgVEC_PRM                           V(C_TgVEC_M)
    #define TgVEC_VAR(A)                        V(C_TgVEC_M) A
    #define TgVECTOR_LOCAL_COPY(A)              
#else
    #define TgVEC_PRM                           V(CPCU_TgVEC_M)
    #define TgVEC_VAR(A)                        V(CPCU_TgVEC_M) _##A
    #define TgVECTOR_LOCAL_COPY(A)              V(C_TgVEC_M) A = *_##A
#endif


/* ====================================================================================================================================================================== */
#endif