forked from devsisters/libquic
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'vlovich-fix-android-build'
- Loading branch information
Showing
5 changed files
with
80 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// Copyright (c) 2011 The Chromium 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 BASE_OS_COMPAT_ANDROID_H_ | ||
#define BASE_OS_COMPAT_ANDROID_H_ | ||
#pragma once | ||
|
||
#include <fcntl.h> | ||
#include <sys/types.h> | ||
#include <utime.h> | ||
|
||
// Not implemented in Bionic. | ||
extern "C" int futimes(int fd, const struct timeval tv[2]); | ||
|
||
// The prototype of mkdtemp is missing. | ||
extern "C" char* mkdtemp(char* path); | ||
|
||
// Android has no timegm(). | ||
extern "C" time_t timegm(struct tm* const t); | ||
|
||
// The lockf() function is not available on Android; we translate to flock(). | ||
#define F_LOCK LOCK_EX | ||
#define F_ULOCK LOCK_UN | ||
inline int lockf(int fd, int cmd, off_t ignored_len) { | ||
return flock(fd, cmd); | ||
} | ||
|
||
#endif // BASE_OS_COMPAT_ANDROID_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// Copyright 2014 The Chromium Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#include "base/threading/thread_local.h" | ||
|
||
namespace base { | ||
namespace internal { | ||
|
||
// static | ||
void ThreadLocalPlatform::AllocateSlot(SlotType* slot) { | ||
slot->Initialize(nullptr); | ||
} | ||
|
||
// static | ||
void ThreadLocalPlatform::FreeSlot(SlotType slot) { | ||
slot.Free(); | ||
} | ||
|
||
// static | ||
void* ThreadLocalPlatform::GetValueFromSlot(SlotType slot) { | ||
return slot.Get(); | ||
} | ||
|
||
// static | ||
void ThreadLocalPlatform::SetValueInSlot(SlotType slot, void* value) { | ||
slot.Set(value); | ||
} | ||
|
||
} // namespace internal | ||
} // namespace base |