ENH: Added try-compile KWSYS_STAT_HAS_ST_MTIM. This tests whether struct stat has the extra st_mtim member that has high resolution times.
This commit is contained in:
parent
590ca03884
commit
0fd1c5d809
@ -175,6 +175,11 @@ ELSE(KWSYS_IOS_USE_SSTREAM)
|
|||||||
ENDIF(KWSYS_IOS_USE_STRSTREAM_H)
|
ENDIF(KWSYS_IOS_USE_STRSTREAM_H)
|
||||||
ENDIF(KWSYS_IOS_USE_SSTREAM)
|
ENDIF(KWSYS_IOS_USE_SSTREAM)
|
||||||
|
|
||||||
|
IF(UNIX)
|
||||||
|
KWSYS_PLATFORM_CXX_TEST(KWSYS_STAT_HAS_ST_MTIM
|
||||||
|
"Checking whether struct stat has st_mtim member" DIRECT)
|
||||||
|
ENDIF(UNIX)
|
||||||
|
|
||||||
IF(KWSYS_NAMESPACE MATCHES "^kwsys$")
|
IF(KWSYS_NAMESPACE MATCHES "^kwsys$")
|
||||||
SET(KWSYS_NAME_IS_KWSYS 1)
|
SET(KWSYS_NAME_IS_KWSYS 1)
|
||||||
ELSE(KWSYS_NAMESPACE MATCHES "^kwsys$")
|
ELSE(KWSYS_NAMESPACE MATCHES "^kwsys$")
|
||||||
|
@ -54,6 +54,9 @@
|
|||||||
# define @KWSYS_NAMESPACE@_ios @KWSYS_NAMESPACE@_ios
|
# define @KWSYS_NAMESPACE@_ios @KWSYS_NAMESPACE@_ios
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* Whether struct stat has the st_mtim member for high resolution times. */
|
||||||
|
#define @KWSYS_NAMESPACE@_STAT_HAS_ST_MTIM @KWSYS_STAT_HAS_ST_MTIM@
|
||||||
|
|
||||||
/* If building a C++ file in kwsys itself, give the source file
|
/* If building a C++ file in kwsys itself, give the source file
|
||||||
access to the macros without a configured namespace. */
|
access to the macros without a configured namespace. */
|
||||||
#if defined(KWSYS_NAMESPACE)
|
#if defined(KWSYS_NAMESPACE)
|
||||||
@ -68,6 +71,7 @@
|
|||||||
# define KWSYS_IOS_USE_SSTREAM @KWSYS_NAMESPACE@_IOS_USE_SSTREAM
|
# define KWSYS_IOS_USE_SSTREAM @KWSYS_NAMESPACE@_IOS_USE_SSTREAM
|
||||||
# define KWSYS_IOS_USE_STRSTREAM_H @KWSYS_NAMESPACE@_IOS_USE_STRSTREAM_H
|
# define KWSYS_IOS_USE_STRSTREAM_H @KWSYS_NAMESPACE@_IOS_USE_STRSTREAM_H
|
||||||
# define KWSYS_IOS_USE_STRSTREA_H @KWSYS_NAMESPACE@_IOS_USE_STRSTREA_H
|
# define KWSYS_IOS_USE_STRSTREA_H @KWSYS_NAMESPACE@_IOS_USE_STRSTREA_H
|
||||||
|
# define KWSYS_STAT_HAS_ST_MTIM @KWSYS_NAMESPACE@_STAT_HAS_ST_MTIM
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -29,3 +29,16 @@ int main() { return 0; }
|
|||||||
#include <strstrea.h>
|
#include <strstrea.h>
|
||||||
int main() { return 0; }
|
int main() { return 0; }
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef TEST_KWSYS_STAT_HAS_ST_MTIM
|
||||||
|
#include <sys/types.h>
|
||||||
|
#include <sys/stat.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
struct stat stat1;
|
||||||
|
(void)stat1.st_mtim.tv_sec;
|
||||||
|
(void)stat1.st_mtim.tv_nsec;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user