Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

geotag: fix compilation with MSYS #2577

Merged
merged 1 commit into from
Apr 4, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 4 additions & 7 deletions samples/geotag.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,10 @@ namespace fs = std::filesystem;
namespace fs = std::experimental::filesystem;
#endif

using namespace std;

#ifdef _WIN32
#include <windows.h>
char* realpath(const char* file, char* path);
#define lstat _stat
#define stat _stat
#define lstat stat
#if _MSC_VER < 1400
#define strcpy_s(d, l, s) strcpy(d, s)
#define strcat_s(d, l, s) strcat(d, s)
Expand All @@ -47,7 +44,7 @@ class Options;
int getFileType(const char* path, Options& options);
int getFileType(std::string& path, Options& options);

string getExifTime(time_t t);
std::string getExifTime(time_t t);
time_t parseTime(const char*, bool bAdjust = false);
int timeZoneAdjust();

Expand Down Expand Up @@ -412,7 +409,7 @@ int timeZoneAdjust() {
return offset;
}

string getExifTime(const time_t t) {
std::string getExifTime(const time_t t) {
static char result[100];
strftime(result, sizeof(result), "%Y-%m-%d %H:%M:%S", localtime(&t));
return result;
Expand Down Expand Up @@ -727,7 +724,7 @@ int main(int argc, const char* argv[]) {
keywords[kwTZ] = "tz";
keywords[kwDELTA] = "delta";

map<std::string, string> shorts;
std::map<std::string, std::string> shorts;
shorts["-?"] = "-help";
shorts["-h"] = "-help";
shorts["-v"] = "-verbose";
Expand Down