[PATCH] Preprocessor fixes

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[PATCH] Preprocessor fixes

Daniel Richard G.
Hello,

I am using pthreads-win32 for a project in conjunction with MSVC. It is
working well, but there were a few minor preprocessor issues that I'd like to
see fixed in the upstream. A patch against CVS is attached, and here is a
summary of the changes:

* Renamed HAVE_CONFIG_H to PTW32_HAVE_CONFIG_H. The problem is that our
project uses HAVE_CONFIG_H/config.h, and the #include in pthread.h leads to a
double-inclusion of the config header. (The real issue is that pthread.h
shouldn't be #including config.h in the first place---that should be happening
at the top of each .c file that needs it---but I'm punting.)

* HAVE_SIGNAL_H and/or __GNUC__ might not be #defined, so either use #ifdef or
defined() to guard against preprocessor warnings

* In sched.h, renamed PTW32_LEVEL to PTW32_SCHED_LEVEL, and PTW32_LEVEL_MAX to
PTW32_SCHED_LEVEL_MAX, to avoid any potential conflict with the same symbols
#defined in pthread.h


I look forward to the forthcoming 2.9.0 release :-)


--Daniel


--
Daniel Richard G. || [hidden email] || Software Developer
Teragram Linguistic Technologies (a division of SAS)
http://www.teragram.com/


begin 666 ptw32-tweaks.patch
M26YD97@Z($)M86ME9FEL90H]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]
M/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]"E)#4R!F
M:6QE.B O8W9S+W!T:')E861S+7=I;C,R+W!T:')E861S+T)M86ME9FEL92QV
M"G)E=')I979I;F<@<F5V:7-I;VX@,2XW"F1I9F8@+74@+6(@+7(Q+C<@0FUA
M:V5F:6QE"BTM+2!";6%K969I;&4),R!*=6X@,C P-2 P.#HS-CHR-B M,# P
M, DQ+C<**RLK($)M86ME9FEL90DR,B!*=6P@,C P.2 Q.3HP.#HR,B M,# P
M, I 0" M,C$L-R K,C$L-R! 0 H@4D,)/2!B<F-C,S(*(%)#1DQ!1U,)/2 M
M:2X*( HM0T9,04=3"3T@+W$@+TDN("]$7U=)3C,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9&4@
M/'1I;64N:#X*0$ @+3(R,"PW("LR,C L-R! 0 H@+RH@=7-E(&YA=&EV92!7
M24XS,B!T:6UE($%022 J+PH@(V5N9&EF("\J($Y%141?1E1)344@*B\*( HM
M(VEF($A!5D5?4TE'3D%,7T@**R-I9F1E9B!(059%7U-)1TY!3%]("B C:6YC
M;'5D92 \<VEG;F%L+F@^"B C96YD:68@+RH@2$%615]324=.04Q?2" J+PH@
M"D! ("TU,C,L-R K-3(S+#<@0$ *("-D969I;F4@4T5-7U9!3%5%7TU!6" @
M(" @(" @(" @(" @(" @(" @(" @(" @($E.5%]-05@*( H@"BTC:68@7U]'
M3E5#7U\@)B8@(2!D969I;F5D("A?7V1E8VQS<&5C*0HK(VEF(&1E9FEN960@
M*%]?1TY50U]?*2 F)B A(&1E9FEN960@*%]?9&5C;'-P96,I"B C(&5R<F]R
M(%!L96%S92!U<&=R861E('EO=7(@1TY5(&-O;7!I;&5R('1O(&]N92!T:&%T
M('-U<'!O<G1S(%]?9&5C;'-P96,N"B C96YD:68*( I);F1E>#H@<V-H960N
M: H]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]
M/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]"E)#4R!F:6QE.B O8W9S+W!T:')E
M861S+7=I;C,R+W!T:')E861S+W-C:&5D+F@L=@IR971R:65V:6YG(')E=FES
M:6]N(#$N,3@*9&EF9B M=2 M8B M<C$N,3@@<V-H960N: HM+2T@<V-H960N
M: DS($UA<B R,# Y(#(Q.C0S.C0W("TP,# P"3$N,3@**RLK('-C:&5D+F@)
M,C(@2G5L(#(P,#D@,3DZ,#@Z,C,@+3 P,# *0$ @+3,Y+#,T("LS.2PS,B!
M0 H@(VEF;F1E9B!?4T-(141?2 H@(V1E9FEN92!?4T-(141?2 H@"BTC=6YD
M968@4%17,S)?3$5614P*+0H@(VEF(&1E9FEN960H7U!/4TE87U-/55)#12D*
M+2-D969I;F4@4%17,S)?3$5614P@, HK(V1E9FEN92!05%<S,E]30TA%1%],
M159%3" P"B O*B!%87)L>2!03U-)6" J+PH@(V5N9&EF"B *("-I9B!D969I
M;F5D*%]03U-)6%]#7U-/55)#12D@)B8@7U!/4TE87T-?4T]54D-%(#X](#$Y
M.3,P.0HM(W5N9&5F(%!45S,R7TQ%5D5,"BTC9&5F:6YE(%!45S,R7TQ%5D5,
M(#$**R-U;F1E9B!05%<S,E]30TA%1%],159%3 HK(V1E9FEN92!05%<S,E]3
M0TA%1%],159%3" Q"B O*B!);F-L=61E(#%B+" Q8R!A;F0@,60@*B\*("-E
M;F1I9@H@"B C:68@9&5F:6YE9"A)3D-,541%7TY0*0HM(W5N9&5F(%!45S,R
M7TQ%5D5,"BTC9&5F:6YE(%!45S,R7TQ%5D5,(#(**R-U;F1E9B!05%<S,E]3
M0TA%1%],159%3 HK(V1E9FEN92!05%<S,E]30TA%1%],159%3" R"B O*B!)
M;F-L=61E($YO;BU0;W)T86)L92!E>'1E;G-I;VYS("HO"B C96YD:68*( HM
M(V1E9FEN92!05%<S,E],159%3%]-05@@,PHK(V1E9FEN92!05%<S,E]30TA%
M1%],159%3%]-05@@,PH@"BTC:68@*"!D969I;F5D*%]03U-)6%]#7U-/55)#
M12D@)B8@7U!/4TE87T-?4T]54D-%(#X](#(P,#$Q,B I("!\?" A9&5F:6YE
M9"A05%<S,E],159%3"D*+2-D969I;F4@4%17,S)?3$5614P@4%17,S)?3$56
M14Q?34%8"BLC:68@*"!D969I;F5D*%]03U-)6%]#7U-/55)#12D@)B8@7U!/
M4TE87T-?4T]54D-%(#X](#(P,#$Q,B I("!\?" A9&5F:6YE9"A05%<S,E]3
M0TA%1%],159%3"D**R-D969I;F4@4%17,S)?4T-(141?3$5614P@4%17,S)?
M4T-(141?3$5614Q?34%8"B O*B!);F-L=61E(&5V97)Y=&AI;F<@*B\*("-E
M;F1I9@H@"B *+2-I9B!?7T=.54-?7R F)B A(&1E9FEN960@*%]?9&5C;'-P
M96,I"BLC:68@9&5F:6YE9" H7U]'3E5#7U\I("8F("$@9&5F:6YE9" H7U]D
M96-L<W!E8RD*(",@97)R;W(@4&QE87-E('5P9W)A9&4@>6]U<B!'3E4@8V]M
M<&EL97(@=&\@;VYE('1H870@<W5P<&]R=',@7U]D96-L<W!E8RX*("-E;F1I
M9@H@"D! ("TQ,#4L,38@*S$P,RPQ-B! 0 H@("H*(" J+PH@"BTC:68@4%17
M,S)?3$5614P@/CT@4%17,S)?3$5614Q?34%8"BLC:68@4%17,S)?4T-(141?
M3$5614P@/CT@4%17,S)?4T-(141?3$5614Q?34%8"B C:69D968@3D5%1%]%
M4E).3PH@(VEN8VQU9&4@(FYE961?97)R;F\N:"(*("-E;'-E"B C:6YC;'5D
M92 \97)R;F\N:#X*("-E;F1I9@HM(V5N9&EF("\J(%!45S,R7TQ%5D5,(#X]
M(%!45S,R7TQ%5D5,7TU!6" J+PHK(V5N9&EF("\J(%!45S,R7U-#2$5$7TQ%
M5D5,(#X](%!45S,R7U-#2$5$7TQ%5D5,7TU!6" J+PH@"B C:68@9&5F:6YE
M9"A?7TU)3D=7,S)?7RD@?'P@9&5F:6YE9"A?55=)3BD*+2,@:68@4%17,S)?
M3$5614P@/CT@4%17,S)?3$5614Q?34%8"BLC(&EF(%!45S,R7U-#2$5$7TQ%
M5D5,(#X](%!45S,R7U-#2$5$7TQ%5D5,7TU!6 H@+RH@1F]R('!I9%]T("HO
M"B C("!I;F-L=61E(#QS>7,O='EP97,N:#X*("\J(%)E<75I<F5D(&)Y(%5N
M:7@@.3@@*B\*0$ @+3$W,RPX("LQ-S$L-2! 0 H@?2 @(" @(" @(" @(" @
M(" @(" @(" @(" @(" @(" O*B!%;F0@;V8@97AT97)N(")#(B J+PH@(V5N
M9&EF(" @(" @(" @(" @(" @(" @(" @(" @(" O*B!?7V-P;'5S<&QU<R J
M+PH@"BTC=6YD968@4%17,S)?3$5614P*+2-U;F1E9B!05%<S,E],159%3%]-
M05@*+0H@(V5N9&EF(" @(" @(" @(" @(" @(" @(" @(" @(" O*B A7U-#
+2$5$7T@@*B\*( H`
`
end