Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit dabb11b

Browse files
committed
add test for volatile
1 parent 6b111b0 commit dabb11b

4 files changed

Lines changed: 38 additions & 3 deletions

File tree

acconfig.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,5 +63,8 @@
6363
/* Define if you want to use the GNU readline library */
6464
#undef WITH_READLINE
6565

66+
/* Define to empty if the keyword does not work. */
67+
#undef volatile
68+
6669

6770
/* Leave that blank line there-- autoheader needs it! */

config.h.in

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,9 @@
138138
/* Define if you want to use the GNU readline library */
139139
#undef WITH_READLINE
140140

141+
/* Define to empty if the keyword does not work. */
142+
#undef volatile
143+
141144
/* Define if you have chown. */
142145
#undef HAVE_CHOWN
143146

configure

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/sh
2-
# From configure.in Revision: 1.6
2+
# From configure.in Revision: 1.8
33
#!/bin/sh
44
# Guess values for system-dependent variables and create Makefiles.
55
# Generated automatically using autoconf version 1.11
@@ -1916,7 +1916,34 @@ fi
19161916
rm -f conftest*
19171917

19181918

1919-
test -n "$silent" || echo "checking for signed char"
1919+
test -n "$silent" || echo "checking for lack of working volatile"
1920+
cat > conftest.${ac_ext} <<EOF
1921+
#include "confdefs.h"
1922+
1923+
int main() { return 0; }
1924+
int t() { volatile int x; x = 0;; return 0; }
1925+
EOF
1926+
if eval $ac_compile; then
1927+
:
1928+
else
1929+
rm -rf conftest*
1930+
1931+
{
1932+
test -n "$verbose" && \
1933+
echo " defining" volatile to be empty
1934+
echo "#define" volatile "" >> confdefs.h
1935+
DEFS="$DEFS -Dvolatile="
1936+
ac_sed_defs="${ac_sed_defs}\${ac_dA}volatile\${ac_dB}volatile\${ac_dC}\${ac_dD}
1937+
\${ac_uA}volatile\${ac_uB}volatile\${ac_uC}\${ac_uD}
1938+
\${ac_eA}volatile\${ac_eB}volatile\${ac_eC}\${ac_eD}
1939+
"
1940+
}
1941+
1942+
fi
1943+
rm -f conftest*
1944+
1945+
1946+
test -n "$silent" || echo "checking for lack of working signed char"
19201947
cat > conftest.${ac_ext} <<EOF
19211948
#include "confdefs.h"
19221949

configure.in

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,9 @@ AC_CHAR_UNSIGNED
214214

215215
AC_CONST
216216

217-
AC_COMPILE_CHECK([signed char], [], [signed char c;], [], AC_DEFINE(signed, []))
217+
AC_COMPILE_CHECK([lack of working volatile],[],[volatile int x; x = 0;],,AC_DEFINE(volatile,))
218+
219+
AC_COMPILE_CHECK([lack of working signed char], [], [signed char c;],,AC_DEFINE(signed, []))
218220

219221
AC_CHECKING(for prototypes)
220222
AC_TEST_PROGRAM([

0 commit comments

Comments
 (0)