I am sorry, but this cannot be done. CRYPTO_ONCE, CRYPTO_THREAD_LOCAL, CRYPTO_THREAD_ID are existing public typedefs of pthread.h types. We cannot change their definition. Also basically what you are asking is to hide any such things inside opaque structs and not do typedefs of any such public types. Although that might be a noble goal, it would complicate the library code and make it more obfuscated. Anyway this is moot as we cannot change these types as otherwise we would break the API. Tomas On Mon, 2025-01-20 at 22:30 +0000, Jay K wrote: > > I am just a bystander, but I can almost imagine. > Codebases do all kind of wierd things for wierd reasons. > Declaring other people's stuff, defining them away, "poison" them to > prevent direct usage, etc. > What would probably help people in their various mechanisms/hacks, is > for OpenSSL public .h files to not include pthread .h files. > To avoid "namespace pollution". > > > Now, if that is the case, what folks can also do, is not include > OpenSSL public .h files in "much" of their code, to avoid the > intersection > of their wierd stuff with your normal stuff. > > > Hopefully they can still allow your source/object code to use > pthread_t directly, even if not mentioned in your .h files. > > > And I understand, you might really need pthread types in your public- > ish interface, i.e. if you embed them in your public (even if opaque) > structs. > * > Jay > > > From: Tomas Mraz <tomas@xxxxxxxxxxx> > Sent: Monday, January 20, 2025 2:49 AM > To: Taralekar, SankalpSuhas <SankalpSuhas.Taralek@xxxxxxxx>; > openssl-users@xxxxxxxxxxx <openssl-users@xxxxxxxxxxx> > Subject: Re: CRYPTO_TDEBUG in openssl 3.x code > It is not clear to me why any "wrapper on top of pthread_once_t" > should > collide with what we have in openssl headers. > > What are the exact compilation errors that you see and on what code? > > Tomas Mraz, OpenSSL > > > On Fri, 2025-01-17 at 20:39 +0000, Taralekar, SankalpSuhas wrote: > > We do have a wrapper in our codebase on top of pthread_once_t, > > pthread_t. Could you please let me know if there is any way to > > avoid > > direct pthread declaration in openssl code? > > > > Thanks, > > Sankalp > > > > > > Internal Use - Confidential > > -----Original Message----- > > From: Taralekar, SankalpSuhas > > Sent: Friday, January 17, 2025 11:33 AM > > To: Tomas Mraz <tomas@xxxxxxxxxxx>; openssl-users@xxxxxxxxxxx > > Subject: RE: CRYPTO_TDEBUG in openssl 3.x code > > > > Thank you for checking! > > > > I am getting the error from the following: > > > 497 typedef pthread_once_t CRYPTO_ONCE; > > > 498 typedef pthread_key_t CRYPTO_THREAD_LOCAL; > > > 499 typedef pthread_t CRYPTO_THREAD_ID; > > > > > > > We have our own wrappers for the above pthread_once_t, pthread_t. > > So, > > we are getting an error in compilation of our code. Could you > > please > > let me know how do I avoid this issue with reference to the above > > openssl variables or any other workaround that is available? In > > openssl 1.0.2 version these pthread variables were not present. We > > were using openssl 1.0.2 before. We do not want to declare the > > above > > pthread variables of openssl 3.0.15 as we have our own wrappers. > > > > Thanks! > > Sankalp > > > > -----Original Message----- > > From: Tomas Mraz <tomas@xxxxxxxxxxx> > > Sent: Thursday, January 16, 2025 11:54 PM > > To: Taralekar, SankalpSuhas <SankalpSuhas.Taralek@xxxxxxxx>; > > openssl-users@xxxxxxxxxxx > > Subject: Re: CRYPTO_TDEBUG in openssl 3.x code > > > > > > [EXTERNAL EMAIL] > > > > I do not think the CRYPTO_TDEBUG macro is really useful, it pre- > > dates > > 3.x releases and basically switches off multithreading support. But > > it is not tested and I would be very much surprised if the OpenSSL > > code builds with it being defined. > > > > It is not clear to me, why are you seeing any compilation errors. > > Unless you try to typedef CRYPTO_ONCE or the other typedefs we have > > in the crypto.h header yourself. Could you please share a snippet > > of > > your code where you see the compilation error? > > > > Tomas Mraz, OpenSSL > > > > On Thu, 2025-01-16 at 22:46 +0000, 'Taralekar, SankalpSuhas' via > > openssl-users wrote: > > > > > > > > > > > > Hello, > > > In crypto.h.in file I see the following: > > > # if defined(OPENSSL_THREADS) && !defined(CRYPTO_TDEBUG) > > > 480 # if defined(_WIN32) > > > 481 # if defined(BASETYPES) || defined(_WINDEF_H) > > > 482 /* application has to include <windows.h> in order to use > > > this > > > */ > > > 483 typedef DWORD CRYPTO_THREAD_LOCAL; > > > 484 typedef DWORD CRYPTO_THREAD_ID; > > > 485 > > > 486 typedef LONG CRYPTO_ONCE; > > > 487 # define CRYPTO_ONCE_STATIC_INIT 0 > > > 488 # endif > > > 489 # else > > > 490 # if defined(__TANDEM) && defined(_SPT_MODEL_) > > > 491 # define SPT_THREAD_SIGNAL 1 > > > 492 # define SPT_THREAD_AWARE 1 > > > 493 # include <spthread.h> > > > 494 # else > > > 495 # include <pthread.h> > > > 496 # endif > > > 497 typedef pthread_once_t CRYPTO_ONCE; > > > 498 typedef pthread_key_t CRYPTO_THREAD_LOCAL; > > > 499 typedef pthread_t CRYPTO_THREAD_ID; > > > > > > We have our own wrappers for the above pthread_once_t, pthread_t. > > > So, > > > we are getting an error in compilation of our code. Could you > > > please > > > let me know how do I avoid this issue with reference to the above > > > openssl variables or any other workaround that is available? In > > > openssl 1.0.2 version these pthread variables were not present. > > > We > > > were using openssl 1.0.2 before. We do not want to declare the > > > above > > > pthread variables of openssl 3.0.15 as we have our own wrappers. > > > Thanks! > > > > > > > > > > > > > > > > > > Internal Use - Confidential > > > > > > > > > From: Taralekar, SankalpSuhas > > > Sent: Wednesday, January 15, 2025 1:59 PM > > > To: openssl-users@xxxxxxxxxxx > > > Subject: CRYPTO_TDEBUG in openssl 3.x code > > > > > > Hello, > > > Could not find much information about what exactly CRYPTO_TDEBUG > > > does > > > after going through the code. Can someone please share any > > > information > > > on its purpose if you are aware of it? What is the use case of > > > defining CRYPTO_TDEBUG and not defining it? > > > > > > Thanks, > > > Sankalp > > > -- > > > You received this message because you are subscribed to the > > > Google > > > Groups "openssl-users" group. > > > To unsubscribe from this group and stop receiving emails from it, > > > send > > > an email to openssl-users+unsubscribe@xxxxxxxxxxx. > > > To view this discussion visit > > > https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Furldefense.com%2Fv3%2F__https%3A%2F%2Fgroups.google.com%2Fa%2Fopenssl.org%2Fd%2F&data=05%7C02%7C%7C37230c871e4c4ca315c508dd394022e6%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C638729669804923899%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=XdfoklB0nClO851qqAp1luANPKywZyLP9li8Bn9JV%2BE%3D&reserved=0 > > > msgid/openssl- > > > users/BY3PR19MB50737F1F73E788BD6009AB6DE81A2*40BY3PR19MB5073.namp > > > rd > > > 19.prod.outlook.com__;JQ!!LpKI!kcEM8EoWBKwJ0qGxjhNJauL6JcxpFxSWBB > > > me > > > UEtojepEwG54BdelejKazPNgO8JfwwFavSZuxTwsNwhkRA5A$ > > > [groups[.]google[.]com] . > > > > -- > > Tomáš Mráz, OpenSSL > > > > -- > Tomáš Mráz, OpenSSL > > -- > You received this message because you are subscribed to the Google > Groups "openssl-users" group. > To unsubscribe from this group and stop receiving emails from it, > send an email to openssl-users+unsubscribe@xxxxxxxxxxx. > To view this discussion visit > https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgroups.google.com%2Fa%2Fopenssl.org%2Fd%2Fmsgid%2Fopenssl-users%2F547ab05cc71a1a38e8bf652120f372715d7b2058.camel%2540openssl.org&data=05%7C02%7C%7C37230c871e4c4ca315c508dd394022e6%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C638729669804944835%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=a2XYvpYNCb9ORAP%2F24Hv8AOd9lVKU7gpJtd5C8SjkGo%3D&reserved=0 > . -- Tomáš Mráz, OpenSSL -- You received this message because you are subscribed to the Google Groups "openssl-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to openssl-users+unsubscribe@xxxxxxxxxxx. To view this discussion visit https://groups.google.com/a/openssl.org/d/msgid/openssl-users/b0550ef156a57504ff3fd062b6350d3d8f815413.camel%40openssl.org.