Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

engine: pass tbl parameter explicitly instead of using default parame… #447

Merged
merged 1 commit into from
Nov 12, 2019
Merged

engine: pass tbl parameter explicitly instead of using default parame… #447

merged 1 commit into from
Nov 12, 2019

Conversation

mewmew
Copy link
Contributor

@mewmew mewmew commented Nov 12, 2019

…ter values

This helps make the header files in Source/*.h parsable from both
C and C++.

Any headers in SourceX can easily be C++ only, but keeping
the core Devilution code parsable as both C and C++ is
useful for integration into mods.

…ter values

This helps make the header files in `Source/*.h` parsable from both
C and C++.

Any headers in SourceX can easily be C++ only, but keeping
the core Devilution code parsable as both C and C++ is
useful for integration into mods.
@glebm
Copy link
Collaborator

glebm commented Nov 12, 2019

The original Diablo is compiled with a C++ compiler and there might be other C++ things in the Source headers. Is there a particular mod that you had issues compiling?

@mewmew
Copy link
Contributor Author

mewmew commented Nov 12, 2019

The original Diablo is compiled with a C++ compiler and there might be other C++ things in the Source headers. Is there a particular mod that you had issues compiling?

Hi @glebm!

Thanks for the quick response :)

I know there are a few C++ things in the source files, but at least historically Devilution was compilable as C. We did this to try and get the Rich headers correct (diasurgical/devilution#111 (comment)).

It is true that Diablo also contained C++ code, but this was mostly due to linking against Storm. From the looks of it, most if not all Diablo code was written in C but used the .cpp extension. (We've hypothesized that the reason for this may be that Blizzard gave Condor the directive that Diablo had to be coded in C++, but Brevik and the others at Condor were more familiar with Assembly and C.)

Looking at the diablo.h header, there is a commented out section with extern "C" so every header has at one point in the past been compilable as C.

As for the mod I'm playing with, it's not much to look at yet, but it's located at https://github.com/sanctuary/djavul

Cheers,
Robin

@glebm
Copy link
Collaborator

glebm commented Nov 12, 2019

Thanks Robin. Making headers C-compatible seems reasonable then, and can also open up writing mods in other languages (e.g. Rust).

@mewmew
Copy link
Contributor Author

mewmew commented Nov 12, 2019

Thanks Robin. Making headers C-compatible seems reasonable then, and can also open up writing mods in other languages (e.g. Rust).

Indeed. That's the main idea. Djavul is written in Go, so at least we have a Proof of Concept mod in another language than C++.

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.

3 participants