Merge "libbase: a slightly cleaner solution to libbase's off64_t problem."

This commit is contained in:
Treehugger Robot 2018-10-26 15:38:14 +00:00 committed by Gerrit Code Review
commit 52db49b68f
3 changed files with 25 additions and 10 deletions

View file

@ -20,6 +20,8 @@
#include <sys/types.h>
#include <string>
#include "android-base/off64_t.h"
#if !defined(_WIN32) && !defined(O_BINARY)
/** Windows needs O_BINARY, but Unix never mangles line endings. */
#define O_BINARY 0
@ -30,11 +32,6 @@
#define O_CLOEXEC O_NOINHERIT
#endif
#if defined(__APPLE__)
/** Mac OS has always had a 64-bit off_t, so it doesn't have off64_t. */
typedef off_t off64_t;
#endif
namespace android {
namespace base {

View file

@ -16,12 +16,8 @@
#pragma once
#if __APPLE__
/* Temporary Mac build fix for off64_t. TODO: refactor into `portability.h`. */
#include "android-base/file.h"
#endif
#include "android-base/macros.h"
#include "android-base/off64_t.h"
#include <sys/types.h>

View file

@ -0,0 +1,22 @@
/*
* Copyright (C) 2018 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
#if defined(__APPLE__)
/** Mac OS has always had a 64-bit off_t, so it doesn't have off64_t. */
typedef off_t off64_t;
#endif