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

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

Conversation

migthymax
Copy link
Member

Removed SDK includes from public header files:

  • pthread.h
  • malloc.h

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

@afxgroup
Copy link
Collaborator

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

@migthymax
Copy link
Member Author

@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
Copy link
Collaborator

afxgroup commented Mar 3, 2024

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
Copy link
Member Author

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 afxgroup merged commit 38fd8d6 into AmigaLabs:beta10 Mar 6, 2024
1 of 2 checks passed
@afxgroup
Copy link
Collaborator

afxgroup commented Mar 6, 2024

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

@afxgroup
Copy link
Collaborator

check #165 (comment)

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants