Skip to content

Fix a couple of minor things needed to compile TeX #1100

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

Merged
merged 1 commit into from
Feb 5, 2024
Merged

Conversation

dfyz
Copy link
Contributor

@dfyz dfyz commented Feb 5, 2024

We're currently trying to make busytex Actually Portable. Overall it's going pretty smooth, but there are a couple of changes we had to made that I believe should preferably be upstreamed. Amusingly, they were needed to compile not the TeX project proper but the Lua modules they bundle with TeX-Live (so this might be useful even for those who don't care about TeX).

The detailed description of what was changed is in the commit message.

1. `libc/isystem/complex.h` (included when you do `#include <complex.h>`)
   defines `_COMPLEX_H`, and then proceeds to include `libc/complex.h`,
   which contains the actual complex-related declarations. However, they
   are *also* guarded by `_COMPLEX_H` and hence effectively ignored.
   Fix this by changing `_COMPLEX_H` to `COSMOPOLITAN_LIBC_COMPLEX_H_`,
   which is consistent with what the other headers (such as `math.h`) do.
2. Cosmopolitan could only support IPv4 multicast requests for sockets,
   since a declaration for `struct ipv6_mreq` was missing. Add support
   for IPv6, too, by adding the missing declaration.
Copy link
Collaborator

@G4Vi G4Vi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! At some point we should add ip multicast tests, but I don't see any involving struct ip_mreq either so this is okay for now.

Before we can merge, we need you to assign copyright to Justine. Can you please send an email to [email protected] saying "I intend to assign Justine Tunney the copyright to the changes I contribute to Cosmopolitan"? It only applies to the changes you choose to contribute. It only needs to happen once. If your employer owns everything you do, then you'll need to clear it with them first. Please do that if you need to and get it on the record. Please link to this PR inside your email and note here once you have done so. Thanks!

@dfyz
Copy link
Contributor Author

dfyz commented Feb 5, 2024

If you have an idea how what IPv4/IPv6 multicast tests should look like, I can totally take a stab at implementing those (in a different PR or in this one, it's up to you). I see that you have a pretty comprehensive test suite already, but the current tests appear to use local addresses (127.0.0.1 or ::1), so I'm not sure this will play nice with multicasting.

Regarding the copyright assignment, I sent a letter to Justine simultaneously with opening this PR, but still haven't received any response. Should I try sending it again?

@G4Vi
Copy link
Collaborator

G4Vi commented Feb 5, 2024

No need to send the assignment email again. Once I have confirmation from her, I'll merge.

I don't have anything specific in mind for multicast tests, but any could be helpful. The key thing is just to keep in mind that they should run on all platforms cosmopolitan supports, skipping/bailing out so they pass if the current platform doesn't have the needed functionality. I'm guessing the potential difficulty of implementing them may be related to why they don't exist. A separate PR sounds best.

@jart
Copy link
Owner

jart commented Feb 5, 2024

Confirmed. Please proceed @G4Vi.

@G4Vi G4Vi merged commit d5225a6 into jart:master Feb 5, 2024
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.

3 participants