Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compilation failure in ypaint.cc due to missing include #329

Closed
hannob opened this issue Jan 9, 2019 · 3 comments
Closed

compilation failure in ypaint.cc due to missing include #329

hannob opened this issue Jan 9, 2019 · 3 comments

Comments

@hannob
Copy link

hannob commented Jan 9, 2019

ypaint.cc uses the mblen feature, however it doesn't include the right headers for it.

This can lead to compilation errors:

ypaint.cc: In member function ‘void Graphics::drawStringEllipsis(int, int, const char*, int)’:
ypaint.cc:269:24: error: ‘mblen’ was not declared in this scope
         if (multiByte) mblen(NULL, 0);
                        ^~~~~

This only appears if freetype support is disabled, because otherwise the include will indirectly happen through Xft.h. However relying on indirect includes is bad.

Adding an

#include <cstdlib>

fixes this. I'd do a pull request, but I'm unsure which is the right branch for current development (latest versions are 1.5.x, yet the main branch seems to be an 1.4-one.)

@gijsbers
Copy link
Collaborator

gijsbers commented Jan 9, 2019

@hannob Thanks! Could you let me know which operating system (+ version number) you are compiling on as I could not reproduce this problem.

@hannob
Copy link
Author

hannob commented Jan 9, 2019

Gentoo, icewm 1.5.1. (It may be that this only shows up with a recent glibc, sometimes they make the header include things more strict, I have glibc 2.28.)

Reproduce with

./configure --disable-xfreetype
make

@hannob
Copy link
Author

hannob commented Jun 17, 2019

fix should be fine, 1.5.5 no longer has this issue

@hannob hannob closed this as completed Jun 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants