#if !defined(LD_CORE_PLATFORM_H_)
#define LD_CORE_PLATFORM_H_

#if !defined(LD_RELEASE)
	#define LD_RELEASE 0
#endif

// -- Operating system

#define OS_WINDOWS 0
#define OS_LINUX   0

#if defined(_WIN32)
	#undef  OS_WINDOWS
	#define OS_WINDOWS 1
#elif defined(__linux__)
	#undef  OS_LINUX
	#define OS_LINUX 1
#else
	#error "unsupported operating system"
#endif

// -- Architecture

#define ARCH_AMD64 0

#if defined(__amd64__) || defined(_M_AMD64)
	#undef  ARCH_AMD64
	#define ARCH_AMD64 1
#else
	#error "unsupported architecture"
#endif

// -- Compiler

#define COMPILER_CLANG 0
#define COMPILER_CL    0
#define COMPILER_GCC   0

#if defined(__clang__)
	#undef  COMPILER_CLANG
	#define COMPILER_CLANG 1
#elif defined(_MSC_VER)
	#undef  COMPILER_CL
	#define COMPILER_CL 1
#elif defined(__GNUC__)
	#undef  COMPILER_GCC
	#define COMPILER_GCC 1
#else
	#error "unsupported compiler"
#endif

// -- Language

#define LANG_C   0
#define LANG_CPP 0

#if defined(__OBJC__)
	#error "unuspported language"
#elif defined(__cplusplus)
	#undef  LANG_CPP
	#define LANG_CPP 1
#else
	#undef  LANG_C
	#define LANG_C 1
#endif

#if OS_WINDOWS
	#define WIN32_LEAN_AND_MEAN 1
	#include <windows.h>
	#include <shlobj_core.h>
	#pragma warning(disable : 4201)
#elif OS_LINUX
	#include <sys/types.h>
	#include <dlfcn.h>
	#include <sys/mman.h>
	#include <unistd.h>
	#include <fcntl.h>
	#include <sys/stat.h>
	#include <errno.h>
	#include <dirent.h>
#endif

#endif  // LD_CORE_PLATFORM_H_
