summaryrefslogtreecommitdiffstats
path: root/config/cmake/HDF5Tests.c
diff options
context:
space:
mode:
Diffstat (limited to 'config/cmake/HDF5Tests.c')
-rw-r--r--config/cmake/HDF5Tests.c133
1 files changed, 94 insertions, 39 deletions
diff --git a/config/cmake/HDF5Tests.c b/config/cmake/HDF5Tests.c
index 9c21415..2f69ec8 100644
--- a/config/cmake/HDF5Tests.c
+++ b/config/cmake/HDF5Tests.c
@@ -1,38 +1,5 @@
#define SIMPLE_TEST(x) int main(){ x; return 0; }
-#ifdef CXX_HAVE_OFFSETOF
- #include <stdio.h>
-#include <stddef.h>
-
-#ifdef FC_DUMMY_MAIN
-#ifndef FC_DUMMY_MAIN_EQ_F77
-# ifdef __cplusplus
-extern "C"
-# endif
-int FC_DUMMY_MAIN()
-{ return 1;}
-#endif
-#endif
-int
-main ()
-{
-
- struct index_st
- {
- unsigned char type;
- unsigned char num;
- unsigned int len;
- };
- typedef struct index_st index_t;
- int x,y;
- x = offsetof(struct index_st, len);
- y = offsetof(index_t, num)
-
- ;
- return 0;
-}
-#endif
-
#ifdef HAVE_C99_DESIGNATED_INITIALIZER
#ifdef FC_DUMMY_MAIN
@@ -106,7 +73,7 @@ int test_vsnprintf(const char *fmt,...)
int main(void)
{
- exit(test_vsnprintf("%s","A string that is longer than 16 characters"));
+ return(test_vsnprintf("%s","A string that is longer than 16 characters"));
}
#endif
@@ -215,6 +182,16 @@ SIMPLE_TEST(struct tm tm; tm.tm_gmtoff=0);
#endif /* HAVE_TM_GMTOFF */
+#ifdef HAVE___TM_GMTOFF
+
+#ifdef HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+#include <time.h>
+SIMPLE_TEST(struct tm tm; tm.__tm_gmtoff=0);
+
+#endif /* HAVE_TM_GMTOFF */
+
#ifdef HAVE_TIMEZONE
#ifdef HAVE_SYS_TIME_H
@@ -269,10 +246,10 @@ int main(void)
if (strcmp(s, "1099511627776") == 0)
{
printf("PRINTF_LL_WIDTH=[%s]\n", *currentArg);
- exit(0);
+ return 0;
}
}
- exit(1);
+ return 1;
}
#endif /* PRINTF_LL_WIDTH */
@@ -288,7 +265,9 @@ int main(void)
pthread_attr_init(&attribute);
ret=pthread_attr_setscope(&attribute, PTHREAD_SCOPE_SYSTEM);
- exit(ret==0 ? 0 : 1);
+ if (ret==0)
+ return 0;
+ return 1;
}
#endif /* SYSTEM_SCOPE_THREADS */
@@ -336,6 +315,35 @@ int main()
}
#endif
+#ifdef HAVE_STAT64_STRUCT
+#include <sys/types.h>
+#include <sys/stat.h>],
+struct stat64 sb;
+int main()
+{
+ return 0;
+}
+#endif
+
+#ifdef TEST_DIRECT_VFD_WORKS
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+int main(void)
+{
+ int fid;
+ if((fid=open("tst_file", O_CREAT | O_TRUNC | O_DIRECT, 0755))<0)
+ return 1;
+ close(fid);
+ remove("tst_file");
+ return 0;
+}
+#endif
+
+#ifdef HAVE_DIRECT
+ SIMPLE_TEST(posix_memalign());
+#endif
+
#ifdef TEST_LFS_WORKS
/* Return 0 when LFS is available and 1 otherwise. */
#define _LARGEFILE_SOURCE
@@ -382,8 +390,8 @@ int main(void)
gettimeofday(&tv, &tz);
/* Check whether the function returned any value at all */
if(tz.tz_minuteswest == 7777 && tz.tz_dsttime == 7)
- exit(1);
- else exit (0);
+ return 1;
+ else return 0;
}
#endif
@@ -394,6 +402,41 @@ int main(int argc, char * argv)
}
#endif
+#ifdef CXX_HAVE_OFFSETOF
+
+#include <stdio.h>
+#include <stddef.h>
+
+#ifdef FC_DUMMY_MAIN
+#ifndef FC_DUMMY_MAIN_EQ_F77
+# ifdef __cplusplus
+extern "C"
+# endif
+int FC_DUMMY_MAIN()
+{ return 1;}
+#endif
+#endif
+int
+main ()
+{
+
+ struct index_st
+ {
+ unsigned char type;
+ unsigned char num;
+ unsigned int len;
+ };
+ typedef struct index_st index_t;
+ int x,y;
+ x = offsetof(struct index_st, len);
+ y = offsetof(index_t, num)
+
+ ;
+ return 0;
+}
+
+#endif
+
#ifdef HAVE_GPFS
#include <gpfs.h>
@@ -423,6 +466,18 @@ int main ()
#endif /* HAVE_IOEO */
+#ifdef HAVE_STRUCT_VIDEOCONFIG
+
+SIMPLE_TEST(struct videoconfig w; w.numtextcols=0);
+
+#endif /* HAVE_TM_GMTOFF */
+
+#ifdef HAVE_STRUCT_TEXT_INFO
+
+SIMPLE_TEST(struct text_info w; w.screenwidth=0);
+
+#endif /* HAVE_TM_GMTOFF */
+
#if defined( INLINE_TEST_inline ) || defined( INLINE_TEST___inline__ ) || defined( INLINE_TEST___inline )
#ifndef __cplusplus