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

Define WIN32_LEAN_AND_MEAN to build the zip library on Windows #401

Merged
merged 1 commit into from
Sep 25, 2023
Merged

Define WIN32_LEAN_AND_MEAN to build the zip library on Windows #401

merged 1 commit into from
Sep 25, 2023

Conversation

scribam
Copy link
Contributor

@scribam scribam commented Aug 23, 2023

There are other files where windows.h is included but WIN32_LEAN_AND_MEAN is not defined. With this PR, WIN32_LEAN_AND_MEAN is defined consistently across the project

@dillof
Copy link
Member

dillof commented Aug 23, 2023

Why did you remove NOCRYPT? Are you sure that does not influence <windows.h> or <bcrypt.h>?

@scribam
Copy link
Contributor Author

scribam commented Aug 23, 2023

From C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\um\Windows.h:

#ifndef WIN32_LEAN_AND_MEAN
#include <cderr.h>
#include <dde.h>
#include <ddeml.h>
#include <dlgs.h>
#ifndef _MAC
#include <lzexpand.h>
#include <mmsystem.h>
#include <nb30.h>
#include <rpc.h>
#endif
#include <shellapi.h>
#ifndef _MAC
#include <winperf.h>
#include <winsock.h>
#endif
#ifndef NOCRYPT
#include <wincrypt.h>
#include <winefs.h>
#include <winscard.h>
#endif

#ifndef NOGDI
#ifndef _MAC
#include <winspool.h>
#ifdef INC_OLE1
#include <ole.h>
#else
#include <ole2.h>
#endif /* !INC_OLE1 */
#endif /* !MAC */
#include <commdlg.h>
#endif /* !NOGDI */
#endif /* WIN32_LEAN_AND_MEAN */

We do not need to define NOCRYPT because it is inside the #ifndef WIN32_LEAN_AND_MEAN block.

Also from https://github.com/v8/v8/blob/main/src/base/win32-headers.h#L15:

// WIN32_LEAN_AND_MEAN implies NOCRYPT and NOGDI.

@dillof
Copy link
Member

dillof commented Aug 23, 2023

Thanks for the explanation, makes sense.

@0-wiz-0 0-wiz-0 merged commit e1b35ee into nih-at:main Sep 25, 2023
1 check passed
@0-wiz-0
Copy link
Member

0-wiz-0 commented Sep 25, 2023

Thanks, merged.

@scribam scribam deleted the win32_lean_and_mean branch September 25, 2023 12:52
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