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

gherkin: (C) Fix Windows related issues #193

Merged
merged 4 commits into from
May 1, 2017

Commits on Apr 29, 2017

  1. gherkin: (C) Use UTF-16 when wchar_t is of 2 bytes size.

    On Windows wchar_t is 2 bytes large, and use UTF-16. This means that
    for the case of code points > 0xFFFF (and wchar_t is only 2 bytes
    large), the code point read from the UTF-8 source need to be converted
    to two UTF-16 surrogates (wchar_t wide characters).
    brasmusson committed Apr 29, 2017
    Configuration menu
    Copy the full SHA
    c5bc07b View commit details
    Browse the repository at this point in the history
  2. gherkin: (C) Always print feature file data using UTF-8.

    Windows does not use UTF-8 by default. To make sure that UTF-8 is used
    in the output, do manual conversion from unicode/UTF-16 to an UTF-8
    byte sequence for output. It seems safer that to try to add Windows
    specific code to set UTF-8 output on that platform.
    brasmusson committed Apr 29, 2017
    Configuration menu
    Copy the full SHA
    c1528c6 View commit details
    Browse the repository at this point in the history
  3. gherkin: (C) Conform to C90 (mostly)

    To support a wider range of compilers, remove the C90 breaches so that
    the code compiles also with -ansi and/or -std=c90 (using gcc).
    Another reason to not use swprintf is that on many Windows compilers
    swprintf has a different signature than the ISO standard specification.
    When cleaning up commented out code in gherkin_generate_tokens.c (to
    remove the usage of // for comments), settle to use the
    FileTokenScanner to get coverage of it in the acceptance tests.
    
    The code does not compile with -std=c90 -pedantic (using gcc), the
    conformance to C90 is not taken that far.
    brasmusson committed Apr 29, 2017
    Configuration menu
    Copy the full SHA
    1183c96 View commit details
    Browse the repository at this point in the history
  4. gherkin: (C) Avoid using repeated typedefs (support gcc <v4.6)

    Technically C does not support repeated typedefs until C11, however
    modern compilers do allow it (gcc also using -std=c90). But since
    gcc <v4.6 does not support that, remove the usage of them.
    brasmusson committed Apr 29, 2017
    Configuration menu
    Copy the full SHA
    6cdd13e View commit details
    Browse the repository at this point in the history