Compare commits

..

8 commits

Author SHA1 Message Date
4f316ff7b3
Documentation generator doesn't support C99 comments.
All checks were successful
Compile Cytoplasm / Compile Cytoplasm (aarch64, alpine) (push) Successful in 9s
2024-09-21 16:31:31 -04:00
6827d4fc39
Documentation is enforced.
Some checks failed
Compile Cytoplasm / Compile Cytoplasm (aarch64, alpine) (push) Failing after 7s
2024-09-21 16:26:46 -04:00
63bd879101
Run CI on pull requests.
Some checks failed
Compile Cytoplasm / Compile Cytoplasm (aarch64, alpine) (push) Failing after 7s
2024-09-21 16:23:06 -04:00
f7c51ee019 Basic work toward compiling on Darwin
Some checks failed
Compile Cytoplasm / Compile Cytoplasm (aarch64, alpine) (push) Failing after 7s
2024-09-21 15:47:01 -04:00
af4a142261 Whoops, typo
All checks were successful
Compile Cytoplasm / Compile Cytoplasm (aarch64, alpine) (push) Successful in 9s
2024-09-21 15:00:08 -04:00
10c8784f25 . 2024-09-21 14:59:13 -04:00
4a21567bc5 2nd CI attempt
Some checks failed
Compile Cytoplasm / Compile Cytoplasm (aarch64, alpine) (push) Failing after 0s
2024-09-21 14:52:41 -04:00
ff094b50f2 First attempt to use new CI runner. (#55)
Some checks failed
Compile Cytoplasm / Compile Cytoplasm (aarch64, alpine) (push) Failing after 0s
Reviewed-on: Telodendria/Cytoplasm#55
Co-authored-by: Jordan Bancino <jordan@bancino.net>
Co-committed-by: Jordan Bancino <jordan@bancino.net>
2024-09-21 18:46:43 +00:00
4 changed files with 81 additions and 3 deletions

View file

@ -1,6 +1,6 @@
name: Compile Cytoplasm name: Compile Cytoplasm
run-name: Compile Cytoplasm on ${{ forgejo.actor }} run-name: Compile Cytoplasm on ${{ forgejo.actor }}
on: [push] on: [push, pull_request]
jobs: jobs:
"Compile Cytoplasm": "Compile Cytoplasm":
@ -11,7 +11,7 @@ jobs:
runs-on: ["${{ matrix.os }}", "${{ matrix.arch }}"] runs-on: ["${{ matrix.os }}", "${{ matrix.arch }}"]
steps: steps:
- name: Check out repository - name: Check out repository
uses: actions/checkout@v3 uses: actions/checkout@v4
- name: Configure Cytoplasm - name: Configure Cytoplasm
run: ./configure run: ./configure
- name: Build Cytoplasm - name: Build Cytoplasm

2
configure vendored
View file

@ -37,7 +37,7 @@ case "$(uname)" in
# These systems typically use GCC. # These systems typically use GCC.
SCRIPT_ARGS="${SCRIPT_ARGS} --cc=gcc" SCRIPT_ARGS="${SCRIPT_ARGS} --cc=gcc"
;; ;;
OpenBSD|FreeBSD) OpenBSD|FreeBSD|Darwin)
# These systems typically use Clang. # These systems typically use Clang.
SCRIPT_ARGS="${SCRIPT_ARGS} --cc=clang" SCRIPT_ARGS="${SCRIPT_ARGS} --cc=clang"
;; ;;

View file

@ -0,0 +1,69 @@
/*
* Copyright (C) 2022-2024 Jordan Bancino <@jordan:bancino.net>
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation files
* (the "Software"), to deal in the Software without restriction,
* including without limitation the rights to use, copy, modify, merge,
* publish, distribute, sublicense, and/or sell copies of the Software,
* and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
#ifndef CYTOPLASM_PLATFORM_H
#define CYTOPLASM_PLATFORM_H
/***
* @Nm Platform
* @Nd A simple macro header that determines what platform the application
* is being built for.
* @Dd September 21, 2024
*/
#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__)
#define PLATFORM_WINDOWS
#ifdef _WIN64
#define PLATFORM_WIN64
#else
#define PLATFORM_WIN32
#endif
#elif __APPLE__
#define PLATFORM_DARWIN
#include <TargetConditionals.h>
#if TARGET_IPHONE_SIMULATOR
#define PLATFORM_IPHONE
#elif TARGET_OS_MACCATALYST
#define PLATFORM_CATALYST
#elif TARGET_OS_IPHONE
#define PLATFORM_IPHONE
#elif TARGET_OS_MAC
#define PLATFORM_MAC
#else
# error "Unknown Apple platform"
#endif
#elif __ANDROID__
#define PLATFORM_ANDROID
#elif __linux__
#define PLATFORM_LINUX
#elif __unix__
#define PLATFORM_UNIX
#elif defined(_POSIX_VERSION)
#define PLATFORM_POSIX
#else
# error "Unknown compiler"
#endif
#endif /* CYTOPLASM_PLATFORM_H */

View file

@ -24,6 +24,7 @@
#include <Util.h> #include <Util.h>
#include <Memory.h> #include <Memory.h>
#include <Platform.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
@ -89,6 +90,10 @@ UtilTsMillis(void)
return ts; return ts;
} }
#ifdef PLATFORM_DARWIN
#define st_mtim st_mtimespec
#endif
uint64_t uint64_t
UtilLastModified(char *path) UtilLastModified(char *path)
{ {
@ -105,6 +110,10 @@ UtilLastModified(char *path)
return ts; return ts;
} }
#ifdef PLATFORM_DARWIN
#undef st_mtim
#endif
int int
UtilMkdir(const char *dir, const mode_t mode) UtilMkdir(const char *dir, const mode_t mode)
{ {