Skip to content

fix(Environment): define _USE_32BIT_TIME_T on 32-bit Windows#4405

Closed
matejk wants to merge 1 commit intodevelfrom
4392-environment-windows-32-bit
Closed

fix(Environment): define _USE_32BIT_TIME_T on 32-bit Windows#4405
matejk wants to merge 1 commit intodevelfrom
4392-environment-windows-32-bit

Conversation

@matejk
Copy link
Copy Markdown
Contributor

@matejk matejk commented Jan 19, 2024

When compiling Environment_WIN32U.cpp on 32-bit Windows it is required to set the compiler definition -D_USE_32BIT_TIME_T to be able to properly use system call GetAdaptersInfo.

Unfortunately it must be set on the compiler command line. It does not work if it is set inside the cpp file. Foundation CMake file was therefore modified to set the define for a single file.

Is it necessary to have this for VS project files also? Is Poco still compiled with VS projects on 32-bit Windows?

PR also includes an improvement to pre-allocate larger buffer for network adapters to avoid scanning for available adapters for mist common situations.

@matejk matejk linked an issue Jan 19, 2024 that may be closed by this pull request
@obiltschnig
Copy link
Copy Markdown
Member

Very probably it should also be set in the .vcxproj files. This will require adding the setup to the .progen file and then re-generating the project files.

@matejk matejk added this to the Release 1.13.1 milestone Jan 22, 2024
@matejk matejk force-pushed the 4392-environment-windows-32-bit branch from 87293b5 to bca43d0 Compare January 22, 2024 19:58
@aleks-f
Copy link
Copy Markdown
Member

aleks-f commented Jan 23, 2024

@matejk
Copy link
Copy Markdown
Contributor Author

matejk commented Jan 23, 2024

The define is set only when compiling a single file, not complete project. Alternative is to use different function as written in the related issue.

@aleks-f
Copy link
Copy Markdown
Member

aleks-f commented Jan 25, 2024

I'm not sure if progen is currently capable of doing this. I'd say, never mind the VS solutions; they are not officially supported, and if someone needs it, they can do it and send a pull. Everyone else has cmake-generated projects.

@matejk
Copy link
Copy Markdown
Contributor Author

matejk commented Jan 25, 2024

This PR does not contain optimal solution. GetAdaptersAddresses shall be used.

@matejk matejk closed this Jan 28, 2024
@matejk matejk deleted the 4392-environment-windows-32-bit branch January 29, 2024 08:27
@matejk matejk removed this from the Release 1.13.1 milestone Feb 5, 2024
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.

Environment_WIN32U nodeIdImpl access violation in 1.13.0

3 participants