From 404c9c052ad0cc321582593d065cca8b85f001e2 Mon Sep 17 00:00:00 2001 From: karutoh Date: Wed, 7 Feb 2024 23:15:44 -0800 Subject: [PATCH] First commit. --- .idea/.gitignore | 5 ++++ .idea/CustomHeapManager.iml | 2 ++ .idea/misc.xml | 4 ++++ .idea/modules.xml | 8 +++++++ .idea/vcs.xml | 6 +++++ CMakeLists.txt | 46 +++++++++++++++++++++++++++++++++++++ main.c | 15 ++++++++++++ 7 files changed, 86 insertions(+) create mode 100644 .idea/.gitignore create mode 100644 .idea/CustomHeapManager.iml create mode 100644 .idea/misc.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/vcs.xml create mode 100644 CMakeLists.txt create mode 100644 main.c diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..b58b603 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,5 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ diff --git a/.idea/CustomHeapManager.iml b/.idea/CustomHeapManager.iml new file mode 100644 index 0000000..f08604b --- /dev/null +++ b/.idea/CustomHeapManager.iml @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..79b3c94 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..61a2f5f --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..35eb1dd --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..151442d --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,46 @@ +cmake_minimum_required(VERSION 3.25.1) + +set(IS_OS_WINDOWS FALSE) +set(IS_OS_LINUX FALSE) +set(IS_OS_MAC FALSE) + +set(IS_ARCH_AMD64 FALSE) +set(IS_ARCH_X86 FALSE) +set(IS_ARCH_ARM64 FALSE) +set(IS_ARCH_ARM FALSE) + +project(CustomHeapManager C) + +if (${CMAKE_HOST_SYSTEM_NAME} STREQUAL "Windows") + set(IS_OS_WINDOWS TRUE) + set(USER_HOME_DIRECTORY $ENV{USERPROFILE}) + message("Building for the Windows operating system.") +elseif (${CMAKE_HOST_SYSTEM_NAME} STREQUAL "Linux") + set(IS_OS_LINUX TRUE) + set(USER_HOME_DIRECTORY $ENV{HOME}) + add_compile_options(-Wno-stringop-overflow) + message("Building for the Linux operating system.") +elseif (${CMAKE_HOST_SYSTEM_NAME} STREQUAL "Darwin") + set(IS_OS_MAC TRUE) + set(USER_HOME_DIRECTORY $ENV{HOME}) + message("Building for the Mac operating system.") +endif () + +if ("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "AMD64" OR "${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "x86_64") + set(IS_ARCH_AMD64 TRUE) + enable_language(ASM_NASM) + message("Building for the AMD64 architecture.") +elseif ("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "arm64" OR "${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "aarch64") + set(IS_ARCH_ARM64 TRUE) + enable_language(ASM) + message("Building for the ARM64 architecture.") +endif () + +set(CMAKE_C_STANDARD 23) + +add_executable(CustomHeapManager main.c) + +if (IS_OS_LINUX) + target_link_options(CustomHeapManager PUBLIC) +elseif (IS_OS_WINDOWS) +endif () \ No newline at end of file diff --git a/main.c b/main.c new file mode 100644 index 0000000..eaddc08 --- /dev/null +++ b/main.c @@ -0,0 +1,15 @@ +#include + +void* malloc(unsigned long size) +{ + return NULL; +} + +void free(void* ptr) +{ +} + +int main(void) +{ + return 0; +} \ No newline at end of file