[
https://issues.apache.org/jira/browse/PROTON-1936?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16773298#comment-16773298
]
ASF GitHub Bot commented on PROTON-1936:
----------------------------------------
marcelmeulemans commented on issue #156: PROTON-1936: lower case include and
updated ifdefs
URL: https://github.com/apache/qpid-proton/pull/156#issuecomment-465714280
Sorry, you are right, I could have been a bit more verbose in explaining the
issue being tackled here (also in the Jira issue) and how I solve them.
What this pull request is trying to achieve is to allow proton to be cross
compiled for windows from a linux host using mingw. There are basically two
main things in the current code base preventing this (both of which you are
asking questions about):
1. **File name casing**. The windows API is not really very consistent when
is comes to the casing of file names (can differ per VS version, or platform),
so as windows file systems are not case sensitive and linux file systems are,
inconsistent casing causes a problem on linux (i.e. `fatal error: Windows.h: No
such file or directory # include <BaseTsd.h>`). Mingw "overcomes" this by lower
casing all include and library files. So one part of this pull request lower
cases all includes and libraries. As windows is case insensitive, this changes
nothing on windows but allows compilation to succeed on linux.
2. **Preprocessor based platform detection** In several places in the proton
code base platform detection is being done using preprocessor definitions. In a
few of these cases it is doing so by using a define that identifies the
compiler, not the platform. In these places I have added a check for a define
that identifies the _platform_ (which as you mention should be the correct way
of doing so). I did not feel confident enough to remove the existing compiler
identification check, but I would be happy to do so.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
> Support cross compiling to Windows from Linux
> ---------------------------------------------
>
> Key: PROTON-1936
> URL: https://issues.apache.org/jira/browse/PROTON-1936
> Project: Qpid Proton
> Issue Type: Improvement
> Components: proton-c
> Affects Versions: proton-c-0.25.0
> Reporter: Marcel Meulemans
> Priority: Minor
>
> I am cross compiling proton for Windows via docker (multiarch/crossbuild) and
> running into a few minor issues that make it not work out of the box (mainly
> include file casing). Pull request will follow, more details there ... it
> would be nice if this made it upstream.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]