[WIN32] Fix error on missing time functions.
commitd999717501ca8c724a995314cec2a4f4bd80b1cd
authorCarlo Bramini <30959007+carlo-bramini@users.noreply.github.com>
Sat, 11 Jul 2020 11:10:13 +0000 (11 13:10 +0200)
committerMark McCurry <mark.d.mccurry@gmail.com>
Sun, 12 Jul 2020 17:41:25 +0000 (12 13:41 -0400)
tree7d52bab0f196982222392898d4b0702c0cd357b5
parentc21bac34a99a0032d6d430d1e7749a74fac04a5d
[WIN32] Fix error on missing time functions.

When building with mingw-w64, I suddently got this error:

[ 52%] Building CXX object src/CMakeFiles/zynaddsubfx_core.dir/Misc/Part.cpp.obj
src/Misc/Part.cpp: In lambda function:
src/Misc/Part.cpp:174:17: error: 'time' was not declared in this scope; did you mean 'ftime'?
  174 |                 time (&rawtime);
      |                 ^~~~
      |                 ftime
src/Misc/Part.cpp:175:45: error: 'localtime' was not declared in this scope
  175 |                 const struct tm* timeinfo = localtime (&rawtime);
      |                                             ^~~~~~~~~
src/Misc/Part.cpp:176:17: error: 'strftime' was not declared in this scope; did you mean 'ftime'?
  176 |                 strftime (p->loaded_file,23,"%F_%R.xiz",timeinfo);
      |                 ^~~~~~~~
      |                 ftime
make[2]: *** [src/CMakeFiles/zynaddsubfx_core.dir/build.make:447: src/CMakeFiles/zynaddsubfx_core.dir/Misc/Part.cpp.obj] Error 1
make[1]: *** [CMakeFiles/Makefile2:1659: src/CMakeFiles/zynaddsubfx_core.dir/all] Error 2

The solution is to include ctime near the other include files.
I tested it also with Debian and CYGWIN so it should be fine
src/Misc/Part.cpp