GithubHelp home page GithubHelp logo

assyrianic / harbol Goto Github PK

View Code? Open in Web Editor NEW
26.0 4.0 4.0 365 KB

Harbol is a collection of data structure and miscellaneous libraries, similar in nature to C++'s Boost, STL, and GNOME's GLib but for C99+

License: Apache License 2.0

Makefile 3.20% C 86.43% Shell 0.55% C++ 9.82%
miscellaneous-libraries vector memory-pool libraries plugin-manager allocators bytebuffer configuration-file hashtable hashmap

harbol's Issues

Compile Errors with MSVC - Erroneous Macros

Architecture: Tested on both x86 & x64
OS: Windows
IDE: Visual Studio 2022
C++ Standard: 14

A number of compile errors are thrown when attempting to compile a C++ source file that includes both harbol_common_defines.h and a standard STL header.

I have located the erroneous macros:

# define restrict __restrict

# define inline __inline

The interfering _CRTRESTRICT macro of corecrt.h:

#define _CRTRESTRICT __declspec(restrict)

By defining _CRT_SUPPRESS_RESTRICT the macro will be excluded from the build, a possible solution. However, I am unsure if it would break compatibility with other libraries.

In regards to inlining, the C++ standard library forbids macroizing the keyword "inline," according to xkeycheck.h:

#if defined(inline) #define inline EMIT WARNING C4005 #error The C++ Standard Library forbids macroizing the keyword "inline". \ Enable warning C4005 to find the forbidden define. #endif // inline

Pointer scope?

When pointers go out of scope the vector/any other data structure don't work...
Example:

#include "harbol.h"

void whee(struct HarbolVector vec)
{
	harbol_vector_insert(&vec, &(float32_t){2.f});
	harbol_vector_insert(&vec, &(float32_t){3.f});
	harbol_vector_insert(&vec, &(float32_t){4.f});
}

int main(void)
{
	struct HarbolVector vec = harbol_vector_create(sizeof(float32_t),1);
	whee(vec);
	printf("%f %f %f\n", harbol_vector_get(&vec,0), harbol_vector_get(&vec,1), harbol_vector_get(&vec,2));
}
$ make static
 ...[compiling]
$ ls libharbol.a
libharbol.a
$ gcc -o harbol_vector_func_test harbol_vector_func_test.c libharbol.a
$ ./harbol_vector_func_test
0.000000 0.000000 0.000000

Upgrade `HarbolCfg`

  • Add String Interpolation.
  • Use MsgSpan as error system.
  • Add way to insert/add blob of data.
  • Add Math parsing [create HarbolMath].

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.