[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Lilypond-auto] [LilyIssues-auto] [testlilyissues:issues] #5799 Fixes fo

From: Auto mailings of changes to Lily Issues via Testlilyissues-auto
Subject: [Lilypond-auto] [LilyIssues-auto] [testlilyissues:issues] #5799 Fixes for cross-compilation to x86_64-w64-mingw32
Date: Mon, 02 Mar 2020 09:52:02 -0000

Use config.hh

[issues:#5799] Fixes for cross-compilation to x86_64-w64-mingw32

Status: Started
Created: Thu Feb 27, 2020 04:14 PM UTC by Jonas Hahnfeld
Last Updated: Mon Mar 02, 2020 09:51 AM UTC
Owner: Jonas Hahnfeld

Fixes for cross-compilation to x86_64-w64-mingw32

1) Define _POSIX_SOURCE for M_PI on mingw

Recently commit 7396a28bde ("Add enabling extension definitions for
-std=c++11 option") added a few #defines to config.hh to make POSIX
extensions available. This doesn't seem to work in all cases and I
found this change to fix cross-compilation to x86_64-w64-mingw32.

In general I think this method of explicitly spelling out what each
file needs is superior to gathering all of this in config.hh. It serves
as documentation directly in the code and makes sure that the feature
macro is defined before any other header file is included.

2) Improve cast from pointer to integer

When cross-compiling to x86_64-w64-mingw32, 'long' (32 bit) is smaller
than 'void *' (64 bit). This leads to compiler errors because the cast
truncates. After analysis I think that truncation is actually ok here,
so make this explicit by first casting to a suitable integer and then
truncate to long.
Note that 'suitable integer' is quite a mess: Ideally we would use
intptr_t, but it's optional per the C++ standard. So instead rely on
intmax_t and hope that it works.

3) Use host triple when looking for windres

the type of system on which the package runs. [...]

The previously used $target variable is meant for compilers.

Please refer to section 14.1 Specifying target triplets in the Autoconf
documentation for more details.


The header objidl.h from mingw has an enum called DATADIR. This
conflicts with our definition and results in compilation errors
because the preprocessor replaces the enum name with the configured
string. This is apparently dealt with in mingw-compatibility.hh,
but not in the configure checks. As a result, they return the wrong
answer which leads to further compilation errors down the road.

Sent from because address@hidden is subscribed to

To unsubscribe from further messages, a project admin can change settings at Or, if this is a mailing list, you can unsubscribe from the mailing list.

Testlilyissues-auto mailing list

reply via email to

[Prev in Thread] Current Thread [Next in Thread]