Skip to content

Conversation

@ryegleason
Copy link

A port for C++ allowing users to copy and paste the files into their C++ project and use them instead of having to compile the library separately or deal with compiling C from C++.

@JaciBrunning
Copy link
Owner

C++ is based upon C, under what premise would Pathfinder not be able to be compiled from C++? It should compile with no issues, since the syntax is the same. If there are issues, this should be addressed in both versions.

@ryegleason
Copy link
Author

Not ruling out that I suck at C++, when I try to compile the source using

extern "C" {
#include "pathfinder.h"
}

it fails because there are uncast memory allocations, which are, afaik, allowed in C but not in C++. I added casts mostly, but also changed the header files to only compile as-needed instead of doing everything with pathfinder.h.

@JaciBrunning
Copy link
Owner

The casting issues sound like something that should be fixed in the C version of the library.

There is nothing necessary about requiring pathfinder.h in the core library, you can include your files as needed. Keep in mind that pathfinder.h already provides an extern "C" {} declaration for all further imports, which is part of the reason it exists.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants