Closed Yehouda closed 1 year ago
A compiler that does that isn't buggy, it's allowed but not guaranteed by the standard.
Anyway, the winmm backend is broken even besides this so it doesn't really matter.
It does matter, because when you just type (ql:quickload "harmony") you get an error, and not all users find it easy to figure out what is wrong.
If the winmm is too broken to be fixed, then it is probably better to take it out of the system.
https://github.com/Shirakumo/cl-mixed/blob/4aaff134d3902d93a2a8605c10de4bcfc62d7afa/extensions/winmm-cffi.lisp#L50
WAVE-FORMAT-PCM and WAVE-FORMAT-IEEE-FLOAT are used in #. (i.e. at read time) in winmm-dffi.lisp, and are defined using defconstant earlier in the file. That shouldn't work when compiling the file, because defconstant make the compiler recognize, but not the reader. It can work if you load the source file first or evaluate this form first, or in a buggy compiler that make the definitions of defconstant visible to the reader too at compile-time.
The right way to fix that is to add eval-when (compile load eval) around the constants: