SimpleArchiver/src/platforms.h

43 lines
1.6 KiB
C
Raw Normal View History

2024-08-30 02:35:17 +00:00
// ISC License
//
// Copyright (c) 2024 Stephen Seo
//
// Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
// copyright notice and this permission notice appear in all copies.
//
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
// AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
// OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
// PERFORMANCE OF THIS SOFTWARE.
//
// `platforms.h` is the header that determines what platform this program is
// compiled for.
#ifndef SEODISPARATE_COM_SIMPLE_ARCHIVER_PLATFORMS_H_
#define SEODISPARATE_COM_SIMPLE_ARCHIVER_PLATFORMS_H_
// Determine platform macros
#define SIMPLE_ARCHIVER_PLATFORM_WINDOWS 1
#define SIMPLE_ARCHIVER_PLATFORM_MAC 2
#define SIMPLE_ARCHIVER_PLATFORM_LINUX 3
#define SIMPLE_ARCHIVER_PLATFORM_COSMOPOLITAN 4
#define SIMPLE_ARCHIVER_PLATFORM_UNKNOWN 0
#if defined __COSMOPOLITAN__
#define SIMPLE_ARCHIVER_PLATFORM SIMPLE_ARCHIVER_PLATFORM_COSMOPOLITAN
#elif defined _WIN32
#define SIMPLE_ARCHIVER_PLATFORM SIMPLE_ARCHIVER_PLATFORM_WINDOWS
#elif defined __APPLE__
#define SIMPLE_ARCHIVER_PLATFORM SIMPLE_ARCHIVER_PLATFORM_MAC
#elif defined __linux__
#define SIMPLE_ARCHIVER_PLATFORM SIMPLE_ARCHIVER_PLATFORM_LINUX
#else
#define SIMPLE_ARCHIVER_PLATFORM SIMPLE_ARCHIVER_PLATFORM_UNKNOWN
#endif
#endif