annexi-strayline / AURA

The AURA Reference Implementation
BSD 3-Clause "New" or "Revised" License
22 stars 0 forks source link

Fix build on OpenBSD #9

Closed mndrix closed 2 years ago

mndrix commented 3 years ago

On OpenBSD (and maybe elsewhere?), stdio.h has the following macros:

#define stdin   (&__sF[0])
#define stdout  (&__sF[1])
#define stderr  (&__sF[2])

which causes the following compilation errors on child_processes-platform-binding.c:

In file included from child_processes-platform-binding.c:49:
child_processes-platform-binding.c:82:23: error: expected ')' before
'&' token
   82 |  pid_t * pid,  int  * stdin, int  * stdout, int * stderr)
      |                       ^~~~~
child_processes-platform-binding.c:82:30: error: expected ';', ',' or
')' before 'int'
   82 |  pid_t * pid,  int  * stdin, int  * stdout, int * stderr)
      |                              ^~~

This commit renames {stdin,stdout,stderr} to {stdinput,stdoutput,stderror} to avoid colliding with the macros. The names I chose aren't great, but they work and I don't have a better idea.

Richard-Wai commented 3 years ago

Thank you very much for putting in the time to get this working on OpenBSD!

I've had a few minor comments in the commit, mostly about finagling the comments a bit.

mndrix commented 2 years ago

I've had a few minor comments in the commit, mostly about finagling the comments a bit.

For some reason I don't see your comments on the commit. If you can let me know how you'd like me to fix the comments, I'll gladly update the pull request.

Richard-Wai commented 2 years ago

I've had a few minor comments in the commit, mostly about finagling the comments a bit.

For some reason I don't see your comments on the commit. If you can let me know how you'd like me to fix the comments, I'll gladly update the pull request.

My bad! I forgot to close the review.

bokssssss commented 2 years ago

mndrix:openbsd #9

mndrix commented 2 years ago

Thanks for suggestions. I now see what you mean about the comments mirroring the Ada API. I've pushed a commit to restore the original comment and describe the new C names. Let me know if you want further touchups.

Richard-Wai commented 2 years ago

Looks great. Thank you for your contributions, and bringing AURA to OpenBSD!