Quellcode durchsuchen

HPCC-23478 Function ctime_r not available on Windows

- Use ctime_s for Windows instead

Signed-off-by: Yanrui Ma <yanrui.ma@lexisnexisrisk.com>
Yanrui Ma vor 5 Jahren
Ursprung
Commit
b9c482b65e
1 geänderte Dateien mit 4 neuen und 0 gelöschten Zeilen
  1. 4 0
      esp/bindings/http/platform/httpservice.cpp

+ 4 - 0
esp/bindings/http/platform/httpservice.cpp

@@ -455,7 +455,11 @@ int CEspHttpServer::onGetApplicationFrame(CHttpRequest* request, CHttpResponse*
         response->setStatus(HTTP_STATUS_OK);
 
         char timestr[128];
+#ifdef _WIN32
+        ctime_s(timestr, 128, &modtime);
+#else
         ctime_r(&modtime, timestr);
+#endif
         int timelen = strlen(timestr);
         if (timelen > 0 && timestr[timelen -1] == '\n')
             timestr[timelen - 1] = '\0';