Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
kicad-source-mirror
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Elphel
kicad-source-mirror
Commits
c11f3407
Commit
c11f3407
authored
Oct 09, 2012
by
Wayne Stambaugh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Check for getc_unlocked() and fall back to getc() in richio if it's not available.
parent
bb383e22
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
0 deletions
+14
-0
PerformFeatureChecks.cmake
CMakeModules/PerformFeatureChecks.cmake
+4
-0
config.h.cmake
CMakeModules/config.h.cmake
+3
-0
richio.cpp
common/richio.cpp
+7
-0
No files found.
CMakeModules/PerformFeatureChecks.cmake
View file @
c11f3407
...
...
@@ -78,6 +78,10 @@ macro(perform_feature_checks)
# HAVE_GETTIMEOFDAY is already in use within 2.9 wxWidgets, so use HAVE_GETTIMEOFDAY_FUNC
check_symbol_exists
(
gettimeofday
"sys/time.h"
HAVE_GETTIMEOFDAY_FUNC
)
# Check for Posix getc_unlocked() for improved performance over getc(). Fall back to
# getc() on platforms where getc_unlocked() doesn't exist.
check_symbol_exists
(
getc_unlocked
"stdio.h"
HAVE_GETC_UNLOCKED
)
# Generate config.h.
configure_file
(
${
PROJECT_SOURCE_DIR
}
/CMakeModules/config.h.cmake
${
CMAKE_BINARY_DIR
}
/config.h
)
...
...
CMakeModules/config.h.cmake
View file @
c11f3407
...
...
@@ -50,6 +50,9 @@
#define strnicmp _strnicmp
#endif
/* Use Posix
getc_unlocked
()
instead of
getc
()
when it's available. */
#cmakedefine HAVE_GETC_UNLOCKED
/* Warning!!! Using wxGraphicContext for rendering is experimental. */
#cmakedefine USE_WX_GRAPHICS_CONTEXT 1
...
...
common/richio.cpp
View file @
c11f3407
...
...
@@ -28,6 +28,13 @@
#include <richio.h>
// Fall back to getc() when getc_unlocked() is not available on the target platform.
#if !defined( HAVE_GETC_UNLOCKED )
#define getc_unlocked getc
#endif
// This file defines 3 classes useful for working with DSN text files and is named
// "richio" after its author, Richard Hollenbeck, aka Dick Hollenbeck.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment