Skip to content

CDRIVER-4521 Remove C89 compatibility macros #1181

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

Merged
merged 3 commits into from
Jan 17, 2023

Conversation

eramongodb
Copy link
Contributor

Resolves CDRIVER-4521. Followup to #1138. Verified by this patch.

This is part of a continued effort to establish C99 as the minimum supported C standard:

  • __STDC_VERSION__ is required by implementations as of C95, but may not be present on MSVC without specifying C11 conformance, so defined(__STDC_VERSION__) must still be used.
  • defined(__STDC_VERSION__) was added prior to use of __STDC_VERSION__ in bson-memory.c for consistency.
  • __STDC_VERSION__ >= 199901L as of C99 (if present), so tests for __STDC_VERSION__ < 199901L have been removed.
  • Use of __FUNCTION__ in bson-macros.h was preconditioned on pre-C99 compiler extensions, so it is therefore removed in favor of __func__ unless using MSVC.
  • *_MIN and *_MAX macros for integral types were added in C99 in <stdint.h>, so their substitutions in bson-compat.h are now removed.

@eramongodb eramongodb self-assigned this Jan 13, 2023
@eramongodb eramongodb removed the request for review from jmikola January 13, 2023 21:34
@eramongodb eramongodb merged commit 9e18dd1 into mongodb:master Jan 17, 2023
@eramongodb eramongodb deleted the cdriver-4521 branch January 17, 2023 15:14
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.

3 participants