First commit.

This commit is contained in:
Arron David Nelson 2024-02-07 23:15:44 -08:00
parent 352720a999
commit 404c9c052a
7 changed files with 86 additions and 0 deletions

5
.idea/.gitignore vendored Normal file
View File

@ -0,0 +1,5 @@
# Default ignored files
/shelf/
/workspace.xml
# Editor-based HTTP Client requests
/httpRequests/

View File

@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<module classpath="CMake" type="CPP_MODULE" version="4" />

4
.idea/misc.xml Normal file
View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CMakeWorkspace" PROJECT_DIR="$PROJECT_DIR$" />
</project>

8
.idea/modules.xml Normal file
View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/CustomHeapManager.iml" filepath="$PROJECT_DIR$/.idea/CustomHeapManager.iml" />
</modules>
</component>
</project>

6
.idea/vcs.xml Normal file
View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
</component>
</project>

46
CMakeLists.txt Normal file
View File

@ -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 ()

15
main.c Normal file
View File

@ -0,0 +1,15 @@
#include <stddef.h>
void* malloc(unsigned long size)
{
return NULL;
}
void free(void* ptr)
{
}
int main(void)
{
return 0;
}