C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Selectively pluck from header files

From: Jonathan Wakely <cxx_at_[hidden]>
Date: Wed, 3 Jul 2024 11:26:32 +0100
On Wed, 3 Jul 2024 at 10:57, Frederick Virchanza Gotham via Std-Proposals <
std-proposals_at_[hidden]> wrote:

> This is very much a half-baked idea but I'll just throw it out there
> to float. . .
>
>
Well at least you warned us this time.



> When I need to use the Win32 API, I create a separate source file and
> call it "windows_bomb_chamber.cpp", and it's the only file in my
> project that includes <Windows.h>. Then I create little wrapper
> functions so that other source files can call Win32 API functions.
>
> I have to do this because <Windows.h> includes the kitchen sink along
> with massive use of preprocessor macroes. But what if we could include
> a header file, and only keep the macroes we need? Something like:
>
> #include <Windows.h> keep MAXPATH, APIENTRY#
>

See https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1614.pdf
which was rejected years ago.

Received on 2024-07-03 10:27:51