Bug 46475 - Windows portability problems in libXpm
Summary: Windows portability problems in libXpm
Status: RESOLVED FIXED
Alias: None
Product: xorg
Classification: Unclassified
Component: Lib/Xpm (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: Xorg Project Team
QA Contact: Xorg Project Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-02-22 12:04 UTC by Dave Bodenstab
Modified: 2018-09-22 19:49 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
Patch to libXpm-3.5.9 for 64-bit build (and misc. windows ifdef's) (1.85 KB, text/plain)
2012-02-22 12:04 UTC, Dave Bodenstab
no flags Details
Nmakefile and DLL export defs (1.76 KB, patch)
2012-02-22 19:36 UTC, Dave Bodenstab
no flags Details | Splinter Review

Description Dave Bodenstab 2012-02-22 12:04:54 UTC
Created attachment 57479 [details]
Patch to libXpm-3.5.9 for 64-bit build (and misc. windows ifdef's)

I've been building Vim (which uses libXPM) on Win7x64. The XPM library assumed that sizeof(long) == sizeof(void*). In addition, I found I had to make a few other ifdef'ed changes to compile with microsoft's 'cl' compiler on windows.

The patch is quick & dirty. I do not have the time to properly understand what the code is doing... it should probably use a union rather than making the assumption it does. 

Please pass this on to whomever maintains the XPM library. At a minimum, the patch to src/XpmI.h is required for 64-bit builds otherwise the library crashes.

Thank you.
Comment 1 Dave Bodenstab 2012-02-22 19:36:33 UTC
Created attachment 57498 [details] [review]
Nmakefile and DLL export defs

For completeness, add Nmakefile & DLL export defs
Comment 2 Alan Coopersmith 2012-03-13 22:10:42 UTC
sizeof(long) == sizeof(void*) on Unix platforms in 64-bit mode, it's
just Windows that decided to be different.
Comment 3 Dave Bodenstab 2012-03-14 21:45:48 UTC
(In reply to comment #2)
> sizeof(long) == sizeof(void*) on Unix platforms in 64-bit mode, it's
> just Windows that decided to be different.

Didn't realize that, thanks for the info.

However, since there are already windows specific ifdef's, and future windows users will need the fix (for instance, if they want to compile a 64-bit VIM), would you consider at least patching Xpmi.h with my previously submitted patch
or something similar?

Thank you.
Comment 4 Alan Coopersmith 2012-03-15 18:00:16 UTC
Don't worry, it's still in the queue for consideration when time allows,
which is why this bug was just corrected and not yet closed.   (libXpm
has no active maintainer, so it gets dealt with by community members in
their spare time, and may take a bit longer for patches to go through.)
Comment 5 Adam Jackson 2018-06-12 19:08:36 UTC
Mass closure: This bug has been untouched for more than six years, and is not
obviously still valid. Please reopen this bug or file a new report if you continue to experience issues with current releases.
Comment 6 Alan Coopersmith 2018-09-22 19:49:15 UTC
Thanks for the patch, sorry for the delay.  Pushed to git master:

To ssh://gitlab.freedesktop.org/xorg/lib/libXpm
   e42ca7b..bc1b496  master -> master


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.