byteworksinc / ORCA-C

Other
80 stars 7 forks source link

Cannot #include <math.h> without error on 2.2.0 B5 under GoldenGate/Linux #74

Closed xandark closed 3 years ago

xandark commented 3 years ago

With this simple code:

#include <math.h>

void main( void )
    {
    int i = 0;
    i = 1;
    }

I'm getting this compile error:

$ iix compile main.c
ORCA/C 2.2.0 B5

Including :home:michael:orca:Libraries:ORCACDefs:math.h
  77    float: __fpclassifyf, \
             ^ identifier expected
             ^ ';' expected
Compiling main

2 errors found.

I'm running Golden Gate on Linux, and haven't had any issues with 2.2.0 B4. I get that this is the cool new generics stuff, but can I be the only one seeing this?

sheumann commented 3 years ago

It looks like your copy of math.h must have CRLF line endings. This causes a problem, because ORCA/C will interpret the CR and LF as two successive newline characters, which breaks the line continuation with \ on the preceding line.

The copies of the headers in the released disk image or SHK archive have CR line endings in keeping with the usual Apple II convention, but whatever process you used to get them onto Linux may have done a conversion. ORCA/C can also accept LF line endings (the usual *nix convention), but using CRLF can cause this problem.

xandark commented 3 years ago

Yes, that was it, thank you :) I used CiderPress and didn't think to check the line endings. I'll close this issue.