Opened 10 years ago

Closed 10 years ago

Last modified 8 years ago

#2313 closed defect (fixed)

pthreads on windows includes config.h

Reported by: Sebastian Owned by:
Priority: Medium Milestone:
Component: Core Tor/Tor Version:
Severity: Keywords:
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:


Attempting to compile Tor fails for me, because we use AM_CONFIG_HEADER(orconfig.h). This means that autofoo defines HAVE_CONFIG_H, and pthread.h attempts to include config.h when HAVE_CONFIG_H is defined.

There are a two solutions that I can see: We can just manually undefine HAVE_CONFIG_H (we don't use it anywhere), so that pthread won't include it. This doesn't seem to have negative side effects (orconfig.h is already included by our source anyways, so the definitions are available).

We could rename our config.[ch] files to something else and use config.h for the file generated during configure. This is a lot of work and doesn't mean a functional improvement that I can think of, so this is probably not what we want to do.

A third possible solution that I don't know how to make work is to stop configure from defining HAVE_CONFIG_H. Maybe that is easily possible and could be an alternative to the first idea.

Child Tickets

Change History (7)

comment:1 Changed 10 years ago by Sebastian

Component: - Select a componentTor Client

comment:2 Changed 10 years ago by Sebastian

Status: newneeds_review

Suggested fix (implementation idea 1 from above) is in branch bug2313 in my repository. Bugfix is on branch maint-0.2.1, but merges cleanly into maint-0.2.2 and master.

comment:3 Changed 10 years ago by nickm

Hang on; why is windows trying to include pthread.h? We don't use pthreads on windows. I think we should also (at least) make our pthreads checks have a "&& !defined(MS_WINDOWS)" at the end.

comment:4 Changed 10 years ago by nickm

See branch bug2313_nm_021 in my public repository. How do you like that one?

comment:5 Changed 10 years ago by Sebastian

That fixes the issue for me; thanks.

comment:6 Changed 10 years ago by nickm

Resolution: fixed
Status: needs_reviewclosed

Great; merged into 0.2.1.x and later.

comment:7 Changed 8 years ago by nickm

Component: Tor ClientTor
Note: See TracTickets for help on using tickets.