Skip to content

Implement code changes required to compile Hercules as C++ - #3487

Merged
hemagx merged 105 commits into
masterfrom
compile_cpp
Sep 21, 2026
Merged

hemagx merged 105 commits into
masterfrom
compile_cpp

Conversation

@hemagx

@hemagx hemagx commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

Pull Request Prelude

Changes Proposed

Implementing bare-minimum changes to compile hercules code as C++, the changes proposed are mostly fixes to warnings produced by C++ rules, type fixes and type casts and replacement of C features/compile features with their C++ counterpart.

Issues addressed:

@hemagx
hemagx requested review from MishimaHaruna and guilherme-gm and removed request for guilherme-gm September 17, 2026 12:17

@MrKeiKun MrKeiKun left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nicesu @MishimaHaruna @hemagx

cap_value() vs std::clamp() isn't equivalent. The old macro coped with a backwards min/max; std::clamp treats it as undefined behavior.

Comment thread src/map/script.cpp
Comment thread src/map/status.cpp
Comment thread src/map/status.cpp
Comment thread src/map/skill.c Outdated
Comment thread src/map/skill.cpp
Signed-off-by: Haru <haru@dotalux.com>
Signed-off-by: Ibrahim Zidan <brahem@aotsw.com>
Signed-off-by: Haru <haru@dotalux.com>
Signed-off-by: Ibrahim Zidan <brahem@aotsw.com>
Signed-off-by: Ibrahim Zidan <brahem@aotsw.com>
enum look was a leftover from a previous implementation that was outside hercules. The enum represent fake item ids so it has been renamed to avoid the conflict

Signed-off-by: Haru <haru@dotalux.com>
Signed-off-by: Haru <haru@dotalux.com>
Signed-off-by: Haru <haru@dotalux.com>
…d automatically cast to that type

This prepares the code to the c++ conversion, removing implicit casts from void* to other pointer types

Signed-off-by: Haru <haru@dotalux.com>
…d automatically cast to that type

This prepares the code to the c++ conversion, removing implicit casts from void* to other pointer types

Signed-off-by: Haru <haru@dotalux.com>
…tically cast to that type

This prepares the code to the c++ conversion, removing implicit casts from void* to other pointer types

Signed-off-by: Haru <haru@dotalux.com>
…tically cast to that type

This prepares the code to the c++ conversion, removing implicit casts from void* to other pointer types

Signed-off-by: Haru <haru@dotalux.com>
…atically cast to that type

This prepares the code to the c++ conversion, removing implicit casts from void* to other pointer types

Signed-off-by: Haru <haru@dotalux.com>
…atically cast to that type

This prepares the code to the c++ conversion, removing implicit casts from void* to other pointer types

Signed-off-by: Haru <haru@dotalux.com>
Signed-off-by: Haru <haru@dotalux.com>
Signed-off-by: Haru <haru@dotalux.com>
@MishimaHaruna
MishimaHaruna force-pushed the compile_cpp branch 2 times, most recently from 07237c1 to b06831e Compare September 17, 2026 21:38
…ropriate expected type

This prepares the code to the c++ conversion, removing implicit casts from void* to other pointer types

Signed-off-by: Haru <haru@dotalux.com>
Signed-off-by: Ibrahim Zidan <brahem@aotsw.com>
… functions to the appropriate expected type

This prepares the code to the c++ conversion, removing implicit casts from void* to other pointer types

Signed-off-by: Haru <haru@dotalux.com>
Signed-off-by: Ibrahim Zidan <brahem@aotsw.com>
… of functions to the appropriate expected type

This prepares the code to the c++ conversion, removing implicit casts from void* to other pointer types

Signed-off-by: Haru <haru@dotalux.com>
Signed-off-by: Ibrahim Zidan <brahem@aotsw.com>
…prev}() functions to the appropriate expected type

This prepares the code to the c++ conversion, removing implicit casts from void* to other pointer types

Signed-off-by: Haru <haru@dotalux.com>
Signed-off-by: Ibrahim Zidan <brahem@aotsw.com>
…loc family of functions functions to the appropriate expected type

This prepares the code to the c++ conversion, removing implicit casts from void* to other pointer types

Signed-off-by: Haru <haru@dotalux.com>
Signed-off-by: Ibrahim Zidan <brahem@aotsw.com>
… the appropriate expected type

This prepares the code to the c++ conversion, removing implicit casts from void* to other pointer types

Signed-off-by: Haru <haru@dotalux.com>
Signed-off-by: Ibrahim Zidan <brahem@aotsw.com>
…sion

Signed-off-by: Ibrahim Zidan <brahem@aotsw.com>
…s for handling script errors

Signed-off-by: Ibrahim Zidan <brahem@aotsw.com>
Signed-off-by: Ibrahim Zidan <brahem@aotsw.com>
* Changed storage class and visibility of several symbols to ensure they
  are correctly exported and imported, and that they don't cause ODR
  violations

Signed-off-by: Ibrahim Zidan <brahem@aotsw.com>

Co-authored by: Haru <haru@dotalux.com>

Signed-off-by: Ibrahim Zidan <brahem@aotsw.com>
…remove the macros

Signed-off-by: Haru <haru@dotalux.com>
… macro

Signed-off-by: Haru <haru@dotalux.com>
…ith its c++ expansion

Signed-off-by: Haru <haru@dotalux.com>
Signed-off-by: Haru <haru@dotalux.com>
Signed-off-by: Haru <haru@dotalux.com>
…native annotation [[fallthrough]]

Signed-off-by: Haru <haru@dotalux.com>
Signed-off-by: Haru <haru@dotalux.com>
Signed-off-by: Haru <haru@dotalux.com>
Signed-off-by: Ibrahim Zidan <brahem@aotsw.com>
Signed-off-by: Ibrahim Zidan <brahem@aotsw.com>
…ows it

Signed-off-by: Haru <haru@dotalux.com>
The standard C++ [[noreturn]] supersedes it

Signed-off-by: Haru <haru@dotalux.com>
Signed-off-by: Haru <haru@dotalux.com>
Comment thread src/map/clif.c
@hemagx hemagx added this to the Release v2026.09 milestone Sep 20, 2026
@hemagx
hemagx merged commit 9d30487 into master Sep 21, 2026
236 of 237 checks passed
@hemagx
hemagx deleted the compile_cpp branch September 21, 2026 21:49
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.

4 participants