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

Fix Linux compilation issue of ProfilingATNSimulator #4601

Merged
merged 1 commit into from May 14, 2024

Conversation

WillDignazio
Copy link
Contributor

  • NSEC_PER_SEC is available via CDispatch bindings, which are not currently imported
  • Importing them would be heavy handed compared to replacing with the constant (and leaving a comment)

Compiling on Linux currently produces:

         [239/269] Compiling Antlr4 SetTransition.swift
         /workspace/.build/checkouts/antlr4/runtime/Swift/Sources/Antlr4/atn/ProfilingATNSimulator.swift:63:85: error: cannot find 'NSEC_PER_SEC' in scope
         decisions[decision].timeInPrediction += Int64((stop - start) * TimeInterval(NSEC_PER_SEC))

After fixing this, it compiles (and behaves) as expected.

* NSEC_PER_SEC is available via CDispatch bindings, which are not currently imported
* Importing them would be heavy handed compared to replacing with the constant (and leaving a comment)

Signed-off-by: Will Ziener-Dignazio <wzienerdignazio@apple.com>
@WillDignazio
Copy link
Contributor Author

@ewanmellor or @hanjoes

Gentle nudge :)

@ewanmellor
Copy link
Contributor

@WillDignazio I haven't done any work on Antlr for years, sorry.

@WillDignazio
Copy link
Contributor Author

No worries, thanks for responding. I think I found your name in the README list

@WillDignazio
Copy link
Contributor Author

@parrt Sorry to ping directly, I'm struggling a bit to find someone to review/merge.

@parrt
Copy link
Member

parrt commented May 14, 2024

Thanks!

@parrt parrt merged commit c0b7dd0 into antlr:dev May 14, 2024
42 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants