RobLoach / RobLoach/raylib-cpp
Rescope raylib.h into raylib::impl namespace
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- C++
- Sterne
- 960
- Forks
- 120
- Ø Merge
- 10 Min.
- Gemergte PRs (30 T.)
- 1
Beschreibung
Currently, the following code is included outside of namespace raylib, which pollutes the global namespace with raylib functions and types which can occasionally cause collisions. Is it possible to move this include into the raylib namespace? Many of the scope operators will have to be adjusted but I think this might result in some cleaner code. Also, I believe that the __cplusplus guards are not necessary when directly including a c header. I think this is typically used around C code that can be compiled by both a c & c++ compiler. The extern "C" is definitely still necessary though. Apologies if I am missing something.
https://isocpp.org/wiki/faq/mixing-c-and-cpp#include-c-hdrs-system
#ifdef __cplusplus
extern "C" {
#endif
#include "raylib.h"
#ifdef __cplusplus
}
#endif
Edit: extern "C" guards are in raylib.h already. It does not appear that it is necessary to include it in raylib-cpp
Beitragsleitfaden
Für dieses Repository ist kein Beitragsleitfaden indexiert
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Start in the raylib-cpp include wrapper and inspect how raylib.h is included, along with the scope operators that refer to its declarations. Check whether the existing extern "C" guards in raylib.h cover the include, then verify that the header can be moved into raylib::impl without global namespace pollution or broken references.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- c, cpp
- Bereich
- api
- Issue-Typ
- Refactoring
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Ruhig
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 45/100