fuzz/{client,server}.c: omit _time64 "overload method".
authorAndy Polyakov <appro@openssl.org>
Wed, 26 Apr 2017 13:52:57 +0000 (15:52 +0200)
committerAndy Polyakov <appro@openssl.org>
Thu, 27 Apr 2017 11:01:08 +0000 (13:01 +0200)
Approach was opportunistic in Windows context from its inception
and on top of that it was proven to be error-prone at link stage.
Correct answer is to introduce library-specific time function that
we can control in platform-neutral manner.  Meanwhile we just let
be attempts to override time on Windows.

Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/3320)

fuzz/client.c
fuzz/server.c

index 92ec6c004d2b62a01c66d813dfe4fea3fb350054..104938f42dd8ea552b0cf70f45a3be799e59f049 100644 (file)
@@ -31,15 +31,13 @@ static int idx;
 #define TIME_IMPL(t) { if (t != NULL) *t = FUZZTIME; return FUZZTIME; }
 
 /*
 #define TIME_IMPL(t) { if (t != NULL) *t = FUZZTIME; return FUZZTIME; }
 
 /*
- * This might not in all cases and still get the current time
- * instead of the fixed time. This will just result in things
- * not being fully reproducible and have a slightly different
- * coverage.
+ * This might not work in all cases (and definitely not on Windows
+ * because of the way linkers are) and callees can still get the
+ * current time instead of the fixed time. This will just result
+ * in things not being fully reproducible and have a slightly
+ * different coverage.
  */
  */
-#if defined(_WIN32) && defined(_TIME64_T_DEFINED)
-__time64_t _time64(__time64_t *t) TIME_IMPL(t)
-#endif
-#if !defined(_WIN32) || !defined(_MSC_VER)
+#if !defined(_WIN32)
 time_t time(time_t *t) TIME_IMPL(t)
 #endif
 
 time_t time(time_t *t) TIME_IMPL(t)
 #endif
 
index 93cdc68d3fa45ff7c0db716a476ec370b51d2d52..397867f0658dd95d87ffd2a745ab578562b1c82f 100644 (file)
@@ -478,15 +478,13 @@ static int idx;
 #define TIME_IMPL(t) { if (t != NULL) *t = FUZZTIME; return FUZZTIME; }
 
 /*
 #define TIME_IMPL(t) { if (t != NULL) *t = FUZZTIME; return FUZZTIME; }
 
 /*
- * This might not in all cases and still get the current time
- * instead of the fixed time. This will just result in things
- * not being fully reproducible and have a slightly different
- * coverage.
+ * This might not work in all cases (and definitely not on Windows
+ * because of the way linkers are) and callees can still get the
+ * current time instead of the fixed time. This will just result
+ * in things not being fully reproducible and have a slightly
+ * different coverage.
  */
  */
-#if defined(_WIN32) && defined(_TIME64_T_DEFINED)
-__time64_t _time64(__time64_t *t) TIME_IMPL(t)
-#endif
-#if !defined(_WIN32) || !defined(_MSC_VER)
+#if !defined(_WIN32)
 time_t time(time_t *t) TIME_IMPL(t)
 #endif
 
 time_t time(time_t *t) TIME_IMPL(t)
 #endif