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 socklen_t int" in pyconfig.h #47507

Closed
fgoujeon mannequin opened this issue Jul 2, 2008 · 3 comments
Closed

"#define socklen_t int" in pyconfig.h #47507

fgoujeon mannequin opened this issue Jul 2, 2008 · 3 comments
Labels
build The build process and cross-build stdlib Python modules in the Lib dir

Comments

@fgoujeon
Copy link
Mannequin

fgoujeon mannequin commented Jul 2, 2008

BPO 3257
Nosy @amauryfa

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = <Date 2008-07-02.15:09:35.143>
created_at = <Date 2008-07-02.14:42:42.305>
labels = ['build', 'library']
title = '"#define socklen_t int" in pyconfig.h'
updated_at = <Date 2008-07-02.15:09:35.126>
user = 'https://bugs.python.org/fgoujeon'

bugs.python.org fields:

activity = <Date 2008-07-02.15:09:35.126>
actor = 'amaury.forgeotdarc'
assignee = 'none'
closed = True
closed_date = <Date 2008-07-02.15:09:35.143>
closer = 'amaury.forgeotdarc'
components = ['Library (Lib)']
creation = <Date 2008-07-02.14:42:42.305>
creator = 'fgoujeon'
dependencies = []
files = []
hgrepos = []
issue_num = 3257
keywords = []
message_count = 3.0
messages = ['69097', '69098', '69100']
nosy_count = 2.0
nosy_names = ['amaury.forgeotdarc', 'fgoujeon']
pr_nums = []
priority = 'normal'
resolution = 'out of date'
stage = None
status = 'closed'
superseder = None
type = 'compile error'
url = 'https://bugs.python.org/issue3257'
versions = ['Python 2.5']

@fgoujeon
Copy link
Mannequin Author

fgoujeon mannequin commented Jul 2, 2008

Hello all,

I'm using MinGW 4.2.1 and was unable to compile my code when including
pyconfig.h.

The culpables are these lines (from line 428):

/* Define to `int' if <sys/types.h> doesn't define.  */
#if 1 //_MSC_VER + 0 >= 1300
/* VC.NET typedefs socklen_t in ws2tcpip.h. */
#else
#define socklen_t int
#endif

MinGW (at least the version I use) typedefs socklen_t too, in ws2tcpip.h
(at line 272):
typedef int socklen_t;

When the #define takes effect, code becomes:
typedef socklen_t socklen_t;

...which leads to a compile error (really hard to understand):
C:/MinGW/include/ws2tcpip.h:272: error: multiple types in one declaration

I hope these details will be useful for you. I'm available for another
questions.

Thanks!

@fgoujeon fgoujeon mannequin added stdlib Python modules in the Lib dir build The build process and cross-build labels Jul 2, 2008
@fgoujeon
Copy link
Mannequin Author

fgoujeon mannequin commented Jul 2, 2008

Erratum:

The culpables are these lines (from line 428):
/* Define to `int' if <sys/types.h> doesn't define.  */
#if _MSC_VER + 0 >= 1300
/* VC.NET typedefs socklen_t in ws2tcpip.h. */
#else
#define socklen_t int
#endif

Sorry.

@amauryfa
Copy link
Member

amauryfa commented Jul 2, 2008

This block is only to support the older VC6 compiler. Since your
installation was most certainly compiled with VS7, your change is correct.

(or better, something like:
   #if !defined(_MSC_VER) || _MSC_VER + 0 >= 1300
)

The trunk version (future 2.6) was already fixed with r64214: the
"#define socklen_t int" was moved to socketmodule.h, which is not
included in python.h.

@amauryfa amauryfa closed this as completed Jul 2, 2008
@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build The build process and cross-build stdlib Python modules in the Lib dir
Projects
None yet
Development

No branches or pull requests

1 participant