Skip to content

Fix to compile with mingw-w64#396

Merged
nmoinvaz merged 2 commits into
zlib-ng:devfrom
zedxxx:master
May 16, 2019
Merged

Fix to compile with mingw-w64#396
nmoinvaz merged 2 commits into
zlib-ng:devfrom
zedxxx:master

Conversation

@zedxxx

@zedxxx zedxxx commented May 15, 2019

Copy link
Copy Markdown
Contributor

No description provided.

@nmoinvaz nmoinvaz changed the base branch from master to dev May 15, 2019 22:03
@Coeur

Coeur commented May 16, 2019

Copy link
Copy Markdown
Collaborator

Just curious, if _MSC_VER is not defined, then if (_MSC_VER < 1900) two lines below will be a problem, isn't it?

@zedxxx

zedxxx commented May 16, 2019 via email

Copy link
Copy Markdown
Contributor Author

@zedxxx

zedxxx commented May 16, 2019

Copy link
Copy Markdown
Contributor Author

Will this way be more correct?

#if defined(_MSC_VER) || defined(__MINGW32__)
#  define localtime_r(t1,t2) (localtime_s(t2,t1) == 0 ? t1 : NULL)
#  if defined(_MSC_VER) && (_MSC_VER < 1900)
#    define snprintf _snprintf
#  endif 
#endif

@nmoinvaz

Copy link
Copy Markdown
Member

@zedxxx does this compile for you?

#if defined(_MSC_VER) || defined(__MINGW32__)
#  define localtime_r(t1,t2) (localtime_s(t2,t1) == 0 ? t1 : NULL)
#endif
#if defined(_MSC_VER) && (_MSC_VER < 1900)
#  define snprintf _snprintf
#endif

@zedxxx

zedxxx commented May 16, 2019

Copy link
Copy Markdown
Contributor Author

Yes.

@nmoinvaz

Copy link
Copy Markdown
Member

Ok, if you update the pull request I can merge it in.

@nmoinvaz nmoinvaz merged commit 27687ef into zlib-ng:dev May 16, 2019
@nmoinvaz

Copy link
Copy Markdown
Member

Thanks!

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.

3 participants