Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions Athena/src/core.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,17 @@
#ifndef CORE
#define CORE
#ifdef AT_CPP_API
#ifdef AT_BUILD_DLL
#define AT_API __declspec(dllexport)
#if defined(_WIN32) || defined(_WIN64)
#ifdef AT_BUILD_DLL
#define AT_API __declspec(dllexport)
#else
#define AT_API __declspec(dllimport)
#endif // AT_BUILD_DLL
#else
#define AT_API __declspec(dllimport)
#endif // AT_BUILD_DLL
#ifdef AT_BUILD_DLL
#define AT_API __attribute__((visibility("default")))
#endif
#endif
#else
#define AT_API
#endif // AT_CPP_API
Expand Down
6 changes: 3 additions & 3 deletions Athena/src/exceptions/badStreamException.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
#ifndef BAD_STREAM_EXCEPTION
#define BAD_STREAM_EXCEPTION

#include <exception>
#include <stdexcept>
#include <iostream>
namespace athena
{
namespace exceptions
{
class badStreamException : public std::exception
class badStreamException : public std::runtime_error
{
public:
badStreamException(const char* error) : std::exception("[athena] a badStream error occured")
badStreamException(const char* error) : std::runtime_error("[athena] a badStream error occured")
{
std::cerr << "[Athena] badStream error: " << error << std::endl;
};
Expand Down
6 changes: 3 additions & 3 deletions Athena/src/exceptions/compressionException.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@
#define COMPRESSION_ERROR
#include <core.h>

#include <exception>
#include <stdexcept>
#include <iostream>

namespace athena
{
namespace exceptions
{
class compressionException : public std::exception
class compressionException : public std::runtime_error
{
public:
compressionException(const char* error) : std::exception("[athena] a compression error occured")
compressionException(const char* error) : std::runtime_error("[athena] a compression error occured")
{
std::cerr << "[Athena] compression error: " << error << std::endl;
};
Expand Down
6 changes: 3 additions & 3 deletions Athena/src/exceptions/indexBoundsException.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@

#include <core.h>

#include <exception>
#include <stdexcept>
#include <iostream>

namespace athena
{
namespace exceptions
{
class AT_API indexOutOfBoundsException : public std::exception
class AT_API indexOutOfBoundsException : public std::runtime_error
{
public:
indexOutOfBoundsException(const char* msg) : std::exception("[athena] index was out of bounds!")
indexOutOfBoundsException(const char* msg) : std::runtime_error("[athena] index was out of bounds!")
{
std::cerr << "[Athena] indexOutOfBoundsException: " << msg << std::endl;
}
Expand Down
14 changes: 11 additions & 3 deletions Athena/src/util/buffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
#define BUFFER
#include <vector>
#include <type_traits>
#include <cstdint>
#include <cstring>
#include <malloc.h>

#ifdef __linux__
#include <safe_str_lib.h>
#include <safe_mem_lib.h>
#endif

namespace athena
{
Expand Down Expand Up @@ -40,7 +48,7 @@ namespace athena
static constexpr bool value = type::value;
};

class buffer
class buffer
{
public:
#pragma region write
Expand Down Expand Up @@ -117,10 +125,10 @@ namespace athena
else
memcpy_s(reinterpret_cast<char*>(p_struct), structSize, p_src, structSize);


delete[] p_src;
return *p_struct;

}

template<typename T>
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ Athena is ideal for developers who need a high-performance, flexible solution fo
```
to build run BUILD.bat or BUILD.sh.
this just runs the python build.py script for convenience.

on Linux, ensure libsafec is installed:
sudo apt install libsafec-dev
```
[more info](build.md)
## 2) example:
Expand Down
18 changes: 17 additions & 1 deletion premake5.lua
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,14 @@ project "Athena"
optimize "On"

filter "system:linux"
links
{
"safec"
}
includedirs
{
"/usr/include/safeclib"
}
filter "configurations:debug"
symbols "On"
filter "configurations:release"
Expand Down Expand Up @@ -179,6 +187,14 @@ project "sandbox"
optimize "On"

filter "system:linux"
links
{
"safec"
}
includedirs
{
"/usr/include/safeclib"
}
filter "configurations:debug"
symbols "On"
filter "configurations:release"
Expand All @@ -190,4 +206,4 @@ project "sandbox"
if _OPTIONS["enable-WSL"] then
toolchainversion "wsl2"
end
end
end