replace #ifdef/#ifndef with #if defined() in storage (#1203)

This commit is contained in:
JinmingHu 2020-12-17 18:51:01 +08:00 committed by GitHub
parent e1a9ba9b4d
commit d9c05e3d06
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 10 additions and 10 deletions

View File

@ -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

View File

@ -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 {

View File

@ -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(

View File

@ -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);

View File

@ -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);