Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions ext/bigdecimal/missing/dtoa.c
Original file line number Diff line number Diff line change
Expand Up @@ -210,10 +210,14 @@
#include <locale.h>
#endif

#if defined(HAVE_STDCKDINT_H) || !defined(__has_include)
#elif __has_include(<stdckdint.h>)
#if !defined(HAVE_STDCKDINT_H)
#if defined(__has_include)
#if __has_include(<stdckdint.h>)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The original empty-if plus elif is not so readable, and there's a room improvement. But triple-nested-if is also not so good.

It's worth merging this as a refactoring even if there's no compilation problem in the original code.
#if cod1 && cond2 && cond3 may be better than tripple-nested-if and also better than empty-if plus elif. What do you think?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, this file dtoa.c is a copy of https://github.com/ruby/ruby/blob/master/missing/dtoa.c. It was recently updated to the latest one.
I don't want to add a difference because updating the file might be difficult in the future.

# define HAVE_STDCKDINT_H 1
#endif
#endif
#endif

#ifdef HAVE_STDCKDINT_H
# include <stdckdint.h>
#endif
Expand Down