[dpdk-dev] [PATCH 4/6] build: MinGW-w64 support for Meson

Dmitry Kozlyuk dmitry.kozliuk at gmail.com
Wed Feb 5 21:41:05 CET 2020


> > > > > +if is_windows
> > > > > +	# Require platform SDK for Windows 7 and above.
> > > > > +	add_project_arguments('-D_WIN32_WINNT=0x0601', language: 'c')    
> > > > 
> > > > Please explain. Why Windows 7 is needed? What this define is doing?  
> > > 
> > > Yes, Windows 7 and above is need for already existing code in eal_lcore.c,
> > > specifically for GetLogicalProcessorInformation() call.
> > > 
> > > When including <windows.h>, one must define minimum API version the
> > > application is compiled against [0]. MSVC and Clang default to the version of
> > > platform SDK (that is, maximum supported). MinGW defaults to Windows XP, so
> > > this definition must be either in <rte_os.h> before #include <windows.h> or
> > > here. Because other files may include <windows.h>, I'd prefer to have a
> > > global definition via compiler command-line.
> > > 
> > > [0]:
> > > https://docs.microsoft.com/en-us/windows/win32/WinProg/using-the-windows-headers  
> > 
> > OK, thanks.
> > Please reword the comment with something like
> > 	"Minimum supported API is Windows 7."
> >   
> For this, as an alternative to putting it as a project argument, you can just
> add it to dpdk_conf which means it will end up as a define in the global
> rte_build_config.h and so be directly included in each compilation unit
> ahead of any other headers. (rte_config.h includes rte_build_config.h)

Can you please explain why using dpdk_conf is a better alternative? In
lib/meson.build I can see add_project_arguments('_D_GNU_SOURCE', ...), which
serves a similar purpose on POSIX systems. Compiler option also makes it
impossible to forget or redefine this constant in code by mistake.

-- 
Dmitry Kozlyuk


More information about the dev mailing list