Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 691d84d

Browse filesBrowse files
authored
Merge pull request #176 from arduino/patch_isascii
isAscii: avoid dependency on _GNU_SOURCE
2 parents 9821ad0 + 981a9f6 commit 691d84d
Copy full SHA for 691d84d

File tree

5 files changed

+18074
-3
lines changed
Filter options

5 files changed

+18074
-3
lines changed

‎api/WCharacter.h

Copy file name to clipboardExpand all lines: api/WCharacter.h
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ inline bool isAlpha(int c)
6363
// that fits into the ASCII character set.
6464
inline bool isAscii(int c)
6565
{
66-
return ( isascii (c) == 0 ? false : true);
66+
return ((c & ~0x7f) != 0 ? false : true );
6767
}
6868

6969

@@ -145,7 +145,7 @@ inline bool isHexadecimalDigit(int c)
145145
// ASCII character set, by clearing the high-order bits.
146146
inline int toAscii(int c)
147147
{
148-
return toascii (c);
148+
return (c & 0x7f);
149149
}
150150

151151

‎test/CMakeLists.txt

Copy file name to clipboardExpand all lines: test/CMakeLists.txt
+3-1Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ project(test-ArduinoCore-API)
1010

1111
include_directories(../api)
1212
include_directories(include)
13-
include_directories(external/catch/v2.13.1/include)
13+
include_directories(external/catch/v2.13.9/include)
1414

1515
##########################################################################
1616

@@ -81,6 +81,7 @@ set(TEST_SRCS
8181
src/String/test_toLowerCase.cpp
8282
src/String/test_toUpperCase.cpp
8383
src/String/test_trim.cpp
84+
src/WCharacter/test_isAscii.cpp
8485
src/WCharacter/test_isControl.cpp
8586
src/WCharacter/test_isDigit.cpp
8687
src/WCharacter/test_isHexadecimalDigit.cpp
@@ -89,6 +90,7 @@ set(TEST_SRCS
8990
src/WCharacter/test_isSpace.cpp
9091
src/WCharacter/test_isUpperCase.cpp
9192
src/WCharacter/test_isWhitespace.cpp
93+
src/WCharacter/test_toAscii.cpp
9294
)
9395

9496
set(TEST_DUT_SRCS

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.