Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
K
KWSys
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Sylvain Joubert
KWSys
Commits
1b4dc3aa
Commit
1b4dc3aa
authored
18 years ago
by
Brad King
Browse files
Options
Downloads
Patches
Plain Diff
ENH: Switching KWSYS_CHAR_IS_SIGNED test to use KWSYS_PLATFORM_CXX_TEST_RUN macro.
parent
0175ab45
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
CMakeLists.txt
+2
-18
2 additions, 18 deletions
CMakeLists.txt
kwsysPlatformCxxTests.cxx
+2
-2
2 additions, 2 deletions
kwsysPlatformCxxTests.cxx
with
4 additions
and
20 deletions
CMakeLists.txt
+
2
−
18
View file @
1b4dc3aa
...
...
@@ -437,24 +437,8 @@ IF(KWSYS_USE_FundamentalType)
ENDIF
(
KWSYS_USE___INT64
)
# Check signedness of "char" type.
IF
(
"KWSYS_CHAR_IS_SIGNED"
MATCHES
"^KWSYS_CHAR_IS_SIGNED$"
)
MESSAGE
(
STATUS
"Checking signedness of char"
)
TRY_RUN
(
KWSYS_CHAR_IS_SIGNED KWSYS_CHAR_IS_SIGNED_COMPILED
${
CMAKE_CURRENT_BINARY_DIR
}
${
CMAKE_CURRENT_SOURCE_DIR
}
/kwsysPlatformCxxTests.cxx
COMPILE_DEFINITIONS -DTEST_KWSYS_CHAR_IS_SIGNED
)
IF
(
KWSYS_CHAR_IS_SIGNED_COMPILED
)
IF
(
KWSYS_CHAR_IS_SIGNED
)
MESSAGE
(
STATUS
"Checking signedness of char -- signed"
)
SET
(
KWSYS_CHAR_IS_SIGNED 1 CACHE INTERNAL
"Whether char is signed."
)
ELSE
(
KWSYS_CHAR_IS_SIGNED
)
MESSAGE
(
STATUS
"Checking signedness of char -- unsigned"
)
SET
(
KWSYS_CHAR_IS_SIGNED 0 CACHE INTERNAL
"Whether char is signed."
)
ENDIF
(
KWSYS_CHAR_IS_SIGNED
)
ELSE
(
KWSYS_CHAR_IS_SIGNED_COMPILED
)
MESSAGE
(
FATAL_ERROR
"Checking signedness of char -- failed"
)
ENDIF
(
KWSYS_CHAR_IS_SIGNED_COMPILED
)
ENDIF
(
"KWSYS_CHAR_IS_SIGNED"
MATCHES
"^KWSYS_CHAR_IS_SIGNED$"
)
KWSYS_PLATFORM_CXX_TEST_RUN
(
KWSYS_CHAR_IS_SIGNED
"Checking whether char is signed"
DIRECT
)
ENDIF
(
KWSYS_USE_FundamentalType
)
IF
(
KWSYS_NAMESPACE MATCHES
"^kwsys$"
)
...
...
This diff is collapsed.
Click to expand it.
kwsysPlatformCxxTests.cxx
+
2
−
2
View file @
1b4dc3aa
...
...
@@ -267,11 +267,11 @@ int main()
#endif
#ifdef TEST_KWSYS_CHAR_IS_SIGNED
/* Return
1
for char signed and
0
for char unsigned. */
/* Return
0
for char signed and
1
for char unsigned. */
int
main
()
{
unsigned
char
uc
=
255
;
return
(
*
reinterpret_cast
<
char
*>
(
&
uc
)
<
0
)
?
1
:
0
;
return
(
*
reinterpret_cast
<
char
*>
(
&
uc
)
<
0
)
?
0
:
1
;
}
#endif
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment