The new global -DHEADLESS should be "namespaced" surely?

Tor Lillqvist tml at
Tue Feb 21 00:27:08 PST 2012

Do we really want to use a generic and potentially clash-prone word
like HEADLESS? Isn't the normal software engineering practise to use
some package-specific prefix for global C-level identifiers like this?
We already have -DLIBO_WERROR to indicate when --enable-werror is in
force, and -DLIBO_MERGELIBS for --enable-mergelibs. Thus I suggest
using -DLIBO_HEADLESS for this instead.

Sure, I know perfectly well that we have since forever a set of short
non-namespaced identifiers defined for each compilation. Like -DUNX,
-DLINUX, -DWNT, -DPRODUCT etc. But those are mistakes from long back
in history, we don't need to repeat it in new development.

Ideally we should prefix those old ones too, or get rid of them to the
extent possible; for instance many of the OS- or architecture-specific
defines presumably can be replaced by compiler-defined predefined
macros instead. Like _WIN32 instead of WNT, as both MinGW and MSVC
define _WIN32 when compiling for 32- and 64-bit Windows.


More information about the LibreOffice mailing list