b_stacktrace icon indicating copy to clipboard operation
b_stacktrace copied to clipboard

Reduce Window.h footprint

Open Manquia opened this issue 3 months ago • 1 comments

Hey, super cool library you've made! I am hoping to use it with a raylib project!

In the windows version you're using window.h with WIN32_LEAN_AND_MEAN. This can further be reduced with more defines listed below.

Note: You may want to do something more complex than what is below to preserve existing define state for future includes. I ran into this problem because I am attempting to support a unity/one build for this project and found collisions between raylib.h and window.h as included in b_stacktrace.h.


#define WIN32_LEAN_AND_MEAN

//
// Parts of Win32 API that we don't use and have name collisions with raylib
//    - M. Rust 2025.09.09
//
#define NOATOM
#define NOGDI
#define NOGDICAPMASKS
#define NOMETAFILE
#define NOMINMAX
#define NOMSG
#define NOOPENFILE
#define NORASTEROPS
#define NOSCROLL
#define NOSOUND
#define NOSYSMETRICS
#define NOTEXTMETRIC
#define NOWH
#define NOCOMM
#define NOKANJI
#define NOCRYPT
#define NOMCX
#define NOSERVICE
#define NOIME
#define NOUSER

Manquia avatar Sep 09 '25 22:09 Manquia

Defining these (even the fact that WIN32_LEAN_AND_MEAN is defined) will potentially lead to problems for people who do need some of these features.

If your goal is a unity build, why don't you define them before including the implementation. In fact, if raylib.h already defines them, isn't the easiest solution just to make sure b_stacktrace.h comes after raylib.h?

iboB avatar Sep 10 '25 06:09 iboB