replace #ifdef/#ifndef with #if defined() in storage (#1203)
This commit is contained in:
parent
e1a9ba9b4d
commit
d9c05e3d06
@ -1,7 +1,7 @@
|
||||
// Copyright(c) Microsoft Corporation.All rights reserved.
|
||||
// SPDX - License - Identifier : MIT
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#if defined(_MSC_VER)
|
||||
#define _CRT_SECURE_NO_WARNINGS
|
||||
#endif
|
||||
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
#include <azure/core/platform.hpp>
|
||||
#include "azure/storage/common/crypt.hpp"
|
||||
|
||||
#ifdef AZ_PLATFORM_WINDOWS
|
||||
#if defined(AZ_PLATFORM_WINDOWS)
|
||||
#ifndef NOMINMAX
|
||||
#define NOMINMAX
|
||||
#endif
|
||||
@ -75,7 +75,7 @@ namespace Azure { namespace Storage {
|
||||
}
|
||||
} // namespace Details
|
||||
|
||||
#ifdef AZ_PLATFORM_WINDOWS
|
||||
#if defined(AZ_PLATFORM_WINDOWS)
|
||||
|
||||
namespace Details {
|
||||
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
#include <azure/core/platform.hpp>
|
||||
#include "azure/storage/common/file_io.hpp"
|
||||
|
||||
#ifdef AZ_PLATFORM_POSIX
|
||||
#if defined(AZ_PLATFORM_POSIX)
|
||||
#include <fcntl.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
@ -16,7 +16,7 @@
|
||||
|
||||
namespace Azure { namespace Storage { namespace Details {
|
||||
|
||||
#ifdef AZ_PLATFORM_WINDOWS
|
||||
#if defined(AZ_PLATFORM_WINDOWS)
|
||||
FileReader::FileReader(const std::string& filename)
|
||||
{
|
||||
m_handle = CreateFile(
|
||||
|
||||
@ -23,7 +23,7 @@ namespace Azure { namespace Storage { namespace Details {
|
||||
// TODO: call helper function provided by Azure Core when they provide one.
|
||||
time_t t = std::time(nullptr);
|
||||
struct tm ct;
|
||||
#ifdef AZ_PLATFORM_WINDOWS
|
||||
#if defined(AZ_PLATFORM_WINDOWS)
|
||||
gmtime_s(&ct, &t);
|
||||
#elif defined(AZ_PLATFORM_POSIX)
|
||||
gmtime_r(&t, &ct);
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
|
||||
#include <azure/core/platform.hpp>
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#if defined(_MSC_VER)
|
||||
#define _CRT_SECURE_NO_WARNINGS
|
||||
#endif
|
||||
|
||||
@ -242,7 +242,7 @@ namespace Azure { namespace Storage { namespace Test {
|
||||
{
|
||||
std::time_t epoch_seconds = std::chrono::system_clock::to_time_t(timePoint);
|
||||
struct tm ct;
|
||||
#ifdef AZ_PLATFORM_WINDOWS
|
||||
#if defined(AZ_PLATFORM_WINDOWS)
|
||||
gmtime_s(&ct, &epoch_seconds);
|
||||
#elif defined(AZ_PLATFORM_POSIX)
|
||||
gmtime_r(&epoch_seconds, &ct);
|
||||
@ -271,7 +271,7 @@ namespace Azure { namespace Storage { namespace Test {
|
||||
{
|
||||
std::time_t epoch_seconds = std::chrono::system_clock::to_time_t(timePoint);
|
||||
struct tm ct;
|
||||
#ifdef AZ_PLATFORM_WINDOWS
|
||||
#if defined(AZ_PLATFORM_WINDOWS)
|
||||
gmtime_s(&ct, &epoch_seconds);
|
||||
#elif defined(AZ_PLATFORM_POSIX)
|
||||
gmtime_r(&epoch_seconds, &ct);
|
||||
@ -288,7 +288,7 @@ namespace Azure { namespace Storage { namespace Test {
|
||||
std::stringstream ss(timeStr);
|
||||
ss.imbue(std::locale("C"));
|
||||
ss >> std::get_time(&t, "%a, %d %b %Y %H:%M:%S GMT");
|
||||
#ifdef AZ_PLATFORM_WINDOWS
|
||||
#if defined(AZ_PLATFORM_WINDOWS)
|
||||
time_t tt = _mkgmtime(&t);
|
||||
#elif defined(AZ_PLATFORM_POSIX)
|
||||
time_t tt = timegm(&t);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user