File tree Expand file tree Collapse file tree 4 files changed +15
-0
lines changed
Expand file tree Collapse file tree 4 files changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -224,6 +224,7 @@ check_include_file("altivec.h" HAVE_ALTIVEC_H)
224224check_include_file("spe.h" HAVE_SPE_H)
225225check_include_file("mbarrier.h" HAVE_MBARRIER_H)
226226check_include_file("stdbool.h" HAVE_STDBOOL_H)
227+ check_include_file("valgrind/valgrind.h" HAVE_VALGRIND_VALGRIND_H)
227228
228229# Check types
229230set (CMAKE_EXTRA_INCLUDE_FILES "stddef.h" )
Original file line number Diff line number Diff line change 9191/* Define to 1 if you have the <stdbool.h> header file. */
9292#cmakedefine HAVE_STDBOOL_H 1
9393
94+ /* Define to 1 if you have the <valgrind/valgrind.h> header file. */
95+ #cmakedefine HAVE_VALGRIND_VALGRIND_H 1
96+
9497/* Define to 1 if the compiler supports C99 */
9598#cmakedefine SAFECLIB_HAVE_C99 1
9699
Original file line number Diff line number Diff line change @@ -833,6 +833,7 @@ AC_CHECK_HEADERS([stdlib.h \
833833 altivec.h \
834834 spe.h \
835835 mbarrier.h \
836+ valgrind/valgrind.h \
836837 ] )
837838
838839INSERT_SYS_TYPES_H=""
Original file line number Diff line number Diff line change 1212#ifdef HAVE_SYS_STAT_H
1313#include <sys/stat.h>
1414#endif
15+ #ifdef HAVE_VALGRIND_VALGRIND_H
16+ #include <valgrind/valgrind.h>
17+ #endif
1518
1619#include "test_msvcrt.h"
1720
@@ -222,6 +225,13 @@ int test_vfprintf_s(void) {
222225
223226 fclose (out );
224227
228+ #ifdef HAVE_VALGRIND_VALGRIND_H
229+ if (RUNNING_ON_VALGRIND ) {
230+ unlink (TMP );
231+ return errs ;
232+ }
233+ #endif
234+
225235 /* print to closed stream: across libc's unportable, and not valgrind-safe */
226236 rc = vtfprintf_s (out , "%s" , str1 );
227237 ANYERR (); // Windows may produce EOF, most others EBADF
You can’t perform that action at this time.
0 commit comments