flutter_flutter/fml/posix_wrappers.h
stuartmorgan 9ad81dae16
Wrap strdup to use compliant name on Windows (#16372)
A number of POSIX methods were renamed on Windows to match standards
requirements, giving deprecation warnings when calling strdup on Windows.
This adds a wrapper, to allow calling _strdup on Windows instead.

Part of #16256
2020-02-05 22:32:56 -08:00

21 lines
630 B
C++

// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef FLUTTER_FML_POSIX_WRAPPERS_H_
#define FLUTTER_FML_POSIX_WRAPPERS_H_
#include "flutter/fml/build_config.h"
// Provides wrappers for POSIX functions that have been renamed on Windows.
// See
// https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-3-c4996?view=vs-2019#posix-function-names
// for context.
namespace fml {
char* strdup(const char* str1);
} // namespace fml
#endif // FLUTTER_FML_POSIX_WRAPPERS_H_