Clean up and document our hacks for building BSD source.
Change-Id: Ic591e22fa5b363bb68376b9f25814c0e5bd83fbf
This commit is contained in:
22
libc/upstream-netbsd/android/include/env.h
Normal file
22
libc/upstream-netbsd/android/include/env.h
Normal file
@@ -0,0 +1,22 @@
|
||||
/*
|
||||
* Copyright (C) 2013 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.
|
||||
*/
|
||||
|
||||
#ifndef _BIONIC_NETBSD_ENV_H_included
|
||||
#define _BIONIC_NETBSD_ENV_H_included
|
||||
|
||||
/* Placeholder. */
|
||||
|
||||
#endif
|
28
libc/upstream-netbsd/android/include/extern.h
Normal file
28
libc/upstream-netbsd/android/include/extern.h
Normal file
@@ -0,0 +1,28 @@
|
||||
/*
|
||||
* Copyright (C) 2012 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.
|
||||
*/
|
||||
|
||||
#ifndef _BIONIC_NETBSD_EXTERN_H_included
|
||||
#define _BIONIC_NETBSD_EXTERN_H_included
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
const char* __strsignal(int, char*, size_t);
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif
|
0
libc/upstream-netbsd/android/include/fd_setsize.h
Normal file
0
libc/upstream-netbsd/android/include/fd_setsize.h
Normal file
25
libc/upstream-netbsd/android/include/namespace.h
Normal file
25
libc/upstream-netbsd/android/include/namespace.h
Normal file
@@ -0,0 +1,25 @@
|
||||
/*
|
||||
* Copyright (C) 2012 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.
|
||||
*/
|
||||
|
||||
#ifndef _BIONIC_NETBSD_NAMESPACE_H_included
|
||||
#define _BIONIC_NETBSD_NAMESPACE_H_included
|
||||
|
||||
// NetBSD uses __weak_alias on a lot of functions. We don't want that.
|
||||
#if defined(__weak_alias)
|
||||
#undef __weak_alias
|
||||
#endif
|
||||
|
||||
#endif
|
34
libc/upstream-netbsd/android/include/netbsd-compat.h
Normal file
34
libc/upstream-netbsd/android/include/netbsd-compat.h
Normal file
@@ -0,0 +1,34 @@
|
||||
/*
|
||||
* Copyright (C) 2012 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.
|
||||
*/
|
||||
|
||||
#ifndef _BIONIC_NETBSD_COMPAT_H_included
|
||||
#define _BIONIC_NETBSD_COMPAT_H_included
|
||||
|
||||
// NetBSD uses _DIAGASSERT to null-check arguments and the like.
|
||||
#include <assert.h>
|
||||
#define _DIAGASSERT(e) ((e) ? (void) 0 : __assert2(__FILE__, __LINE__, __func__, #e))
|
||||
|
||||
// TODO: update our <sys/cdefs.h> to support this properly.
|
||||
#define __type_fit(t, a) (0 == 0)
|
||||
|
||||
#define _GNU_SOURCE
|
||||
#define __USE_BSD
|
||||
|
||||
// TODO: we don't yet have thread-safe environment variables.
|
||||
#define __readlockenv() 0
|
||||
#define __unlockenv() 0
|
||||
|
||||
#endif
|
20
libc/upstream-netbsd/android/include/port_after.h
Normal file
20
libc/upstream-netbsd/android/include/port_after.h
Normal file
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
* Copyright (C) 2012 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.
|
||||
*/
|
||||
|
||||
#ifndef _BIONIC_NETBSD_PORT_BEFORE_H_included
|
||||
#define _BIONIC_NETBSD_PORT_BEFORE_H_included
|
||||
|
||||
#endif
|
28
libc/upstream-netbsd/android/include/port_before.h
Normal file
28
libc/upstream-netbsd/android/include/port_before.h
Normal file
@@ -0,0 +1,28 @@
|
||||
/*
|
||||
* Copyright (C) 2012 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.
|
||||
*/
|
||||
|
||||
#ifndef _BIONIC_NETBSD_PORT_BEFORE_H_included
|
||||
#define _BIONIC_NETBSD_PORT_BEFORE_H_included
|
||||
|
||||
#include "namespace.h"
|
||||
#include <sys/cdefs.h>
|
||||
#include <time.h>
|
||||
#include <arpa/nameser.h>
|
||||
|
||||
#define ISC_FORMAT_PRINTF(a,b) __printflike(a,b)
|
||||
#define ISC_SOCKLEN_T socklen_t
|
||||
|
||||
#endif
|
34
libc/upstream-netbsd/android/include/rand48.h
Normal file
34
libc/upstream-netbsd/android/include/rand48.h
Normal file
@@ -0,0 +1,34 @@
|
||||
/* $NetBSD: rand48.h,v 1.6 2011/05/18 19:36:36 dsl Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1993 Martin Birgmeier
|
||||
* All rights reserved.
|
||||
*
|
||||
* You may redistribute unmodified or modified versions of this source
|
||||
* code provided that the above copyright notice and this and the
|
||||
* following conditions are retained.
|
||||
*
|
||||
* This software is provided ``as is'', and comes with no warranties
|
||||
* of any kind. I shall in no event be liable for anything that happens
|
||||
* to anyone/anything when using this software.
|
||||
*/
|
||||
|
||||
#ifndef _RAND48_H_
|
||||
#define _RAND48_H_
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
extern void __dorand48(unsigned short[3]);
|
||||
extern unsigned short __rand48_seed[3];
|
||||
extern unsigned short __rand48_mult[3];
|
||||
extern unsigned short __rand48_add;
|
||||
|
||||
#define RAND48_SEED_0 (0x330e)
|
||||
#define RAND48_SEED_1 (0xabcd)
|
||||
#define RAND48_SEED_2 (0x1234)
|
||||
#define RAND48_MULT_0 (0xe66d)
|
||||
#define RAND48_MULT_1 (0xdeec)
|
||||
#define RAND48_MULT_2 (0x0005)
|
||||
#define RAND48_ADD (0x000b)
|
||||
|
||||
#endif /* _RAND48_H_ */
|
40
libc/upstream-netbsd/android/include/reentrant.h
Normal file
40
libc/upstream-netbsd/android/include/reentrant.h
Normal file
@@ -0,0 +1,40 @@
|
||||
/*
|
||||
* Copyright (C) 2012 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.
|
||||
*/
|
||||
|
||||
#ifndef _BIONIC_NETBSD_REENTRANT_H_included
|
||||
#define _BIONIC_NETBSD_REENTRANT_H_included
|
||||
|
||||
#define _REENTRANT
|
||||
|
||||
#include <pthread.h>
|
||||
#include <signal.h>
|
||||
|
||||
//
|
||||
// Map NetBSD libc internal locking to pthread locking.
|
||||
//
|
||||
|
||||
#define MUTEX_INITIALIZER PTHREAD_MUTEX_INITIALIZER
|
||||
#define mutex_t pthread_mutex_t
|
||||
#define mutex_lock(x) pthread_mutex_lock(x)
|
||||
#define mutex_unlock(x) pthread_mutex_unlock(x)
|
||||
|
||||
#define RWLOCK_INITIALIZER PTHREAD_RWLOCK_INITIALIZER
|
||||
#define rwlock_t pthread_rwlock_t
|
||||
#define rwlock_rdlock pthread_rwlock_rdlock
|
||||
#define rwlock_unlock pthread_rwlock_unlock
|
||||
#define rwlock_wrlock pthread_rwlock_wrlock
|
||||
|
||||
#endif
|
Reference in New Issue
Block a user