Skip to content

Clean up preprocessor cruft for Windows - #652

Merged
aclark4life merged 2 commits into
python-pillow:masterfrom
CounterPillow:windowshfix
May 14, 2014
Merged

aclark4life merged 2 commits into
python-pillow:masterfrom
CounterPillow:windowshfix

Conversation

@CounterPillow

Copy link
Copy Markdown
Contributor
  1. Renamed USE_INLINE to PIL_USE_INLINE to avoid conflicts with
    other headers/libraries.
  2. Replace __WIN32__ and WIN32 with _WIN32
  3. Don't define WIN32 when the compiler is MSVC but not on Windows
    Why would you even...
  4. Don't define strcasecmp if you're not even going to use it.
  5. Don't include Windows.h with undefs for compilers newer than 1998 everywhere.
  6. Don't surpress warnings for MSVC++ 4.0. People still using MSVC++ 4.0 deserve it.
  7. Don't include things that are already included in Windows.h
  8. Don't ignore USE_INLINE with MSVC

Addresses issue #642 and together with PR #643 fixes building on mingw-w64, and thus, issue #642

I have tested this with mingw-w64.

Anyone willing to test this with MSVC is more than welcome to.

1)  Renamed USE_INLINE to PIL_USE_INLINE to avoid conflicts with
    other headers/libraries.

2)  Replace __WIN32__ and WIN32 with _WIN32

3)  Don't define WIN32 when the compiler is MSVC but not on Windows
    Why would you even...

4)  Don't define strcasecmp if you're not even going to use it.

5)  Don't include Windows.h with undefs for compilers newer than
    1998 everywhere.

6)  Don't surpress warnings for MSVC++ 4.0. People still using
    MSVC++ 4.0 deserve it.

7)  Don't include things that are already included in Windows.h
@wiredfool

Copy link
Copy Markdown
Member

Thanks for going through this. I'll take a look, and ping @cgohlke as well.

FWIW, officially, we don't care (anymore) about anything that predates Python 2.6, which would be MSVC 2008.

@cgohlke

cgohlke commented May 9, 2014

Copy link
Copy Markdown
Contributor

Using msvc10, I needed to replace unsigned INT16 with UINT16 in Lzw.h and Gif.h.

@hugovk

hugovk commented May 10, 2014

Copy link
Copy Markdown
Member

@cgohlke See PR #643 for unsigned INT16 -> UINT16.

@cgohlke

cgohlke commented May 10, 2014

Copy link
Copy Markdown
Contributor

#643 LGTM. Same as CounterPillow#1

@CounterPillow

Copy link
Copy Markdown
Contributor Author

Any news on this?

aclark4life added a commit that referenced this pull request May 14, 2014
Clean up preprocessor cruft for Windows
@aclark4life
aclark4life merged commit 4adc589 into python-pillow:master May 14, 2014
@aclark4life

Copy link
Copy Markdown
Member

Thanks

@CounterPillow
CounterPillow deleted the windowshfix branch May 14, 2014 15:04
@CounterPillow

Copy link
Copy Markdown
Contributor Author

You'll also need to merge #643 for this to work.

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

Successfully merging this pull request may close these issues.

5 participants