Skip to content

Conversation

@seragh
Copy link
Contributor

@seragh seragh commented Jan 5, 2026

On Windows cpp-httplib defines ssize_t, therefore applications needing to define ssize_t for their own needs or are using libraries that do require a means to avoid a possible incompatible redefinition.

httplib.h Outdated

#pragma comment(lib, "ws2_32.lib")

#ifndef HAVE_SSIZE_T
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please change it to _SSIZE_T_DEFINED, as this area is Windows- specific?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

HAVE_SSIZE_T is used by other libs for this very purpose, see wx/types.h for example. Tho for my purpose _SSIZE_T_DEFINED would work as well if you have a strong preference.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I would like to use _SSIZE_T_DEFINED instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed to _SSIZE_T_DEFINED

On Windows cpp-httplib defines ssize_t, therefore applications needing
to define ssize_t for their own needs or are using libraries that do
require a means to avoid a possible incompatible redefinition.

Signed-off-by: Ralph Sennhauser <[email protected]>
@seragh seragh force-pushed the prevent-ssize_t-redefiniton branch from 88ba116 to b30e861 Compare January 5, 2026 17:43
@yhirose yhirose merged commit 59905c7 into yhirose:master Jan 6, 2026
@yhirose
Copy link
Owner

yhirose commented Jan 6, 2026

@seragh thanks for your contribution!

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.

2 participants