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

accept input files with DOS line endings #5

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open

accept input files with DOS line endings #5

wants to merge 7 commits into from

Conversation

rofl0r
Copy link
Member

@rofl0r rofl0r commented Aug 12, 2022

fixes #4

otherwise windows will turn every \n into a \r\n tuple, which when
output later gives mixed line endings in the output file.
several fixes are needed for PellesC:
- before including stdio.h we need a magic define to get fmemopen()
  prototype

to produce include file PellesC can then actually use we need to
- add size for unsigned char[] member, otherwise PellesC throws error
  #2139 - too many initializers.
- turn string literal data into { 0, 1, 2...} style numeric array for
  unsigned char[] member.

theoretically, form2hdr could have been compiled with a different
compiler, but we simply assume that when it is used it's used for
both form2hdr compilation and for files generated by it.
this makes sure our \n's come out as \n, not \r\n, so output of lex
is identical whether it was compiled for windos or a proper OS, i.e.
using proper unix line endings.
and WEOF is actually the right to use in combination with getwc().
we should actually also use wint_t rather than int to pick widechars
off the input stream, but this remains on the TODO list for now.
- let user specify config.mak to override defaults
- add a couple variables so config.mak can contain the following
  setup for my pellescc[0] project:

    ifeq ($(WIN),1)
    CC = pellescc
    AR = pellesar
    RANLIB = true
    HOSTRUN = wine
    EXE_EXT = .exe
    endif

and make WIN=1 then does the right thing.

[0]: https://github.com/rofl0r/pellescc
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.

EOF error about windows line endings.
1 participant