AmigaLabs / clib4

Clib4 for AmigaOS4
Other
14 stars 7 forks source link

165 dont include sdk include in the public include fields of clib4 #166

Closed migthymax closed 7 months ago

migthymax commented 7 months ago

Removed SDK includes from public header files:

Restructure implementation, to include none public structures, includes, etc

afxgroup commented 7 months ago

Did you try to compile some pthreads tests that use the functions that use those structs?

migthymax commented 7 months ago

@afxgroup No (no time yet), but as long my google search are right these structure should be implementation dependent, so no one using pthread can assume who the structures are build up.

afxgroup commented 7 months ago

Yes, i know, but all implementation are using pointers as implementation and they are opaque. So internally you can make all changes you want in the internal structures without changing the public header and the pointer size. Not only sometimes i've noticed that compilers needs the struct definition otherwise you will incurr in errors. That's why it is better to test it deeply along some c and c++ tests

migthymax commented 7 months ago

Do you have a good test case? Here for re google search https://github.com/openbsd/src/blob/master/include/pthread.h from bsd makes the same concept, defining the structs opaque, same for the https://github.com/openbsd/src/blob/master/include/semaphore.h.

The only one which seems not to be opaque is the pthread_barrier, but I'm unsure.

Probably this will give the best test case for the implementation https://www.opengroup.org/testing/testsuites/vsthover.htm have to dig into it.

afxgroup commented 7 months ago

I'll commit it. Please test it so we can sure that everything is working correctly

afxgroup commented 7 months ago

check https://github.com/AmigaLabs/clib4/issues/165#issuecomment-2010211204

I think the only way to fix this problem correctly is to use pointers like in newlib and use an internal struct to take care of everything