Skip to content

Commit

Permalink
Use C++17 [[fallthrough]] in 1 file inc ../xplat/hermes/external/dtoa…
Browse files Browse the repository at this point in the history
…/dtoa.c

Reviewed By: dmm-fb

Differential Revision: D58818995

fbshipit-source-id: a8ee9833fd47f5b72f8f02387fe8ee64c4aebeac
  • Loading branch information
r-barnes authored and facebook-github-bot committed Jun 24, 2024
1 parent 29502eb commit 7f8e512
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions external/dtoa/dtoa.c
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,17 @@
* used for input more than STRTOD_DIGLIM digits long (default 40).
*/

#if defined __has_attribute
#if __has_attribute(fallthrough)
#define FALLTHROUGH __attribute__ ((fallthrough))
#else
#define FALLTHROUGH (void)0
#endif
#else
#define FALLTHROUGH (void)0
#endif


#ifndef Long
#define Long long
#endif
Expand Down Expand Up @@ -2575,11 +2586,11 @@ _hermes_g_strtod
for(s = s00;;s++) switch(*s) {
case '-':
sign = 1;
/* no break */
FALLTHROUGH;
case '+':
if (*++s)
goto break2;
/* no break */
FALLTHROUGH;
case 0:
goto ret0;
case '\t':
Expand Down Expand Up @@ -2687,6 +2698,7 @@ _hermes_g_strtod
switch(c = *++s) {
case '-':
esign = 1;
FALLTHROUGH;
case '+':
c = *++s;
}
Expand Down

0 comments on commit 7f8e512

Please sign in to comment.