Skip to content
Merged
Show file tree
Hide file tree
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
6 changes: 3 additions & 3 deletions app/actions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#include <unistd.h> // for stat()
#endif

#if defined(_WIN32)
#ifdef _WIN32
#include <fcntl.h>
#include <io.h>
#include <sys/utime.h>
Expand Down Expand Up @@ -1659,7 +1659,7 @@ std::string temporaryPath() {
static int count = 0;
auto guard = std::scoped_lock(cs);

#if defined(_WIN32)
#ifdef _WIN32
DWORD pid = ::GetCurrentProcessId();
#else
pid_t pid = ::getpid();
Expand Down Expand Up @@ -1843,7 +1843,7 @@ int renameFile(std::string& newPath, const tm* tm, Exiv2::ExifData& exifData) {
// is done after calling setting date/time: the value retrieved from tag might include something like %Y, which then
// should not be replaced by year
std::regex format_regex(":{1}?(Exif\\..*?):{1}?");
#if defined(_WIN32)
#ifdef _WIN32
std::string illegalChars = "\\/:*?\"<>|";
#else
std::string illegalChars = "/:";
Expand Down
4 changes: 2 additions & 2 deletions app/exiv2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#include <filesystem>
namespace fs = std::filesystem;

#if defined(_WIN32)
#ifdef _WIN32
#include <fcntl.h>
#include <io.h>
#include <windows.h>
Expand Down Expand Up @@ -960,7 +960,7 @@ static size_t readFileToBuf(FILE* f, Exiv2::DataBuf& buf) {
void Params::getStdin(Exiv2::DataBuf& buf) {
// copy stdin to stdinBuf
if (stdinBuf.empty()) {
#if defined(_WIN32)
#ifdef _WIN32
DWORD fdwMode;
_setmode(_fileno(stdin), O_BINARY);
Sleep(300);
Expand Down
2 changes: 1 addition & 1 deletion include/exiv2/basicio.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -655,7 +655,7 @@ class EXIV2API MemIo : public BasicIo {
/*!
@brief Provides binary IO for the data from stdin and data uri path.
*/
#if defined(EXV_ENABLE_FILESYSTEM)
#ifdef EXV_ENABLE_FILESYSTEM
class EXIV2API XPathIo : public FileIo {
public:
/*!
Expand Down
6 changes: 3 additions & 3 deletions src/basicio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ class FileIo::Impl {
FILE* fp_{}; //!< File stream pointer
OpMode opMode_{opSeek}; //!< File open mode

#if defined _WIN32
#ifdef _WIN32
HANDLE hFile_{}; //!< Duplicated fd
HANDLE hMap_{}; //!< Handle from CreateFileMapping
#endif
Expand Down Expand Up @@ -218,7 +218,7 @@ FileIo::~FileIo() {
int FileIo::munmap() {
int rc = 0;
if (p_->pMappedArea_) {
#if defined _WIN32
#ifdef _WIN32
UnmapViewOfFile(p_->pMappedArea_);
CloseHandle(p_->hMap_);
p_->hMap_ = nullptr;
Expand Down Expand Up @@ -878,7 +878,7 @@ const std::string& MemIo::path() const noexcept {
void MemIo::populateFakeData() {
}

#if defined(EXV_ENABLE_FILESYSTEM)
#ifdef EXV_ENABLE_FILESYSTEM
XPathIo::XPathIo(const std::string& orgPath) : FileIo(XPathIo::writeDataToFile(orgPath)), tempFilePath_(path()) {
}

Expand Down
6 changes: 3 additions & 3 deletions src/convert.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
// *****************************************************************************
// local declarations
namespace {
#if defined EXV_HAVE_ICONV
#ifdef EXV_HAVE_ICONV
// Convert string charset with iconv.
bool convertStringCharsetIconv(std::string& str, std::string_view from, std::string_view to);
#elif defined _WIN32
Expand Down Expand Up @@ -1377,7 +1377,7 @@ void moveXmpToIptc(XmpData& xmpData, IptcData& iptcData) {
bool convertStringCharset([[maybe_unused]] std::string& str, const char* from, const char* to) {
if (0 == strcmp(from, to))
return true; // nothing to do
#if defined EXV_HAVE_ICONV
#ifdef EXV_HAVE_ICONV
return convertStringCharsetIconv(str, from, to);
#elif defined _WIN32
return convertStringCharsetWindows(str, from, to);
Expand All @@ -1395,7 +1395,7 @@ bool convertStringCharset([[maybe_unused]] std::string& str, const char* from, c
namespace {
using namespace Exiv2;

#if defined EXV_HAVE_ICONV
#ifdef EXV_HAVE_ICONV
bool convertStringCharsetIconv(std::string& str, std::string_view from, std::string_view to) {
if (from == to)
return true; // nothing to do
Expand Down
8 changes: 4 additions & 4 deletions src/futils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#include <filesystem>
namespace fs = std::filesystem;

#if defined(_WIN32)
#ifdef _WIN32
// clang-format off
#include <windows.h>
#include <psapi.h> // For access to GetModuleFileName
Expand All @@ -39,7 +39,7 @@ namespace fs = std::filesystem;
#include <mach-o/dyld.h> // for _NSGetExecutablePath()
#endif

#if defined(__FreeBSD__)
#ifdef __FreeBSD__
// clang-format off
#include <sys/mount.h>
#include <sys/param.h>
Expand Down Expand Up @@ -355,7 +355,7 @@ Uri Uri::Parse(const std::string& uri) {

std::string getProcessPath() {
#ifdef EXV_ENABLE_FILESYSTEM
#if defined(__FreeBSD__)
#ifdef __FreeBSD__
std::string ret("unknown");
unsigned int n;
char buffer[PATH_MAX] = {};
Expand All @@ -375,7 +375,7 @@ std::string getProcessPath() {
return ret.substr(0, idxLastSeparator);
#else
try {
#if defined(_WIN32)
#ifdef _WIN32
TCHAR pathbuf[MAX_PATH];
GetModuleFileName(nullptr, pathbuf, MAX_PATH);
auto path = fs::path(pathbuf);
Expand Down
2 changes: 1 addition & 1 deletion src/http.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ int Exiv2::http(Exiv2::Dictionary& request, Exiv2::Dictionary& response, std::st

////////////////////////////////////
// Windows specific code
#if defined(_WIN32)
#ifdef _WIN32
WSADATA wsaData;
if (WSAStartup(MAKEWORD(2, 2), &wsaData) != 0)
return error(errors, "could not start WinSock");
Expand Down
2 changes: 1 addition & 1 deletion src/makernote_int.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#include <filesystem>
namespace fs = std::filesystem;

#if !defined(_WIN32)
#ifndef _WIN32
#include <pwd.h>
#include <unistd.h>
#else
Expand Down
4 changes: 2 additions & 2 deletions src/version.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ void Exiv2::dumpLibraryInfo(std::ostream& os, const std::vector<std::regex>& key
#endif

const char* compiler =
#if defined(_MSC_VER)
#ifdef _MSC_VER
"MSVC";

#ifndef __VERSION__
Expand Down Expand Up @@ -266,7 +266,7 @@ void Exiv2::dumpLibraryInfo(std::ostream& os, const std::vector<std::regex>& key
#endif

const char* platform =
#if defined(__MSYS__)
#ifdef __MSYS__
"msys";
#elif defined(__CYGWIN__)
"cygwin";
Expand Down
Loading