Fix build failure on Windows.
Fix build failure on Windows.
 - Apply cast statement
 - Do not use snprintf directly
 - Use ARCHIVE_LITERALL_LL macro for portability
Fix build failure on Windows.
 - MSC does not allow this statement, char buf[static 10U].
 - Use archive_string utility instead of snprintf.
 - Use gmtime_r or _gmtime64_s if available for thread safe.
Fix build failure on Windows.
 - Visual Studio does not provide unistd.h
 - Visual Studio does not provide getopt
 - Increase portability
Include stdlib.h to avoid build failure on Windows.
Fix typo.
Fix style.
Plug memory leak made by my recent changes.