diff options
author | Elliott Hughes <enh@google.com> | 2013-11-20 16:09:06 -0800 |
---|---|---|
committer | Elliott Hughes <enh@google.com> | 2013-11-20 16:24:16 -0800 |
commit | ab61eb366ac48addf2bca6093a34455193f5c8df (patch) | |
tree | 335fe463aa773ac8484c40e955fec90f126c9e4f /libm | |
parent | 39bc7ecd45700e9edac0b29d33cc211383ebb107 (diff) | |
download | android_bionic-ab61eb366ac48addf2bca6093a34455193f5c8df.tar.gz android_bionic-ab61eb366ac48addf2bca6093a34455193f5c8df.tar.bz2 android_bionic-ab61eb366ac48addf2bca6093a34455193f5c8df.zip |
Switch to upstream sleep(3) and usleep(3).
Also fix the signature of usleep, and the definition of useconds_t which
should be unsigned, as the 'u' in its name implies.
This patch also cleans up the existing FreeBSD hacks by moving the libm
stuff from <sys/cdefs.h> to a libm-private header, and adding comments
about the hacks we use to build FreeBSD source.
Change-Id: Ibe5067a380502df94a0a3a7901969b35411085b6
Diffstat (limited to 'libm')
-rw-r--r-- | libm/Android.mk | 6 | ||||
-rw-r--r-- | libm/freebsd-compat.h | 27 |
2 files changed, 32 insertions, 1 deletions
diff --git a/libm/Android.mk b/libm/Android.mk index 1d87dc23e..39e556343 100644 --- a/libm/Android.mk +++ b/libm/Android.mk @@ -217,7 +217,11 @@ libm_common_src_files += fake_long_double.c # TODO: re-enable i387/e_sqrtf.S for x86, and maybe others. -libm_common_cflags := -DFLT_EVAL_METHOD=0 -std=c99 +libm_common_cflags := \ + -DFLT_EVAL_METHOD=0 \ + -std=c99 \ + -include $(LOCAL_PATH)/freebsd-compat.h \ + libm_common_includes := $(LOCAL_PATH)/upstream-freebsd/lib/msun/src/ libm_arm_includes := $(LOCAL_PATH)/arm diff --git a/libm/freebsd-compat.h b/libm/freebsd-compat.h new file mode 100644 index 000000000..ca5b42cfe --- /dev/null +++ b/libm/freebsd-compat.h @@ -0,0 +1,27 @@ +/* + * 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_LIBM_FREEBSD_COMPAT_H_included +#define _BIONIC_LIBM_FREEBSD_COMPAT_H_included + +#define __weak_reference(sym,alias) \ + __asm__(".weak " #alias); \ + __asm__(".equ " #alias ", " #sym) + +#define __strong_reference(sym,aliassym) \ + extern __typeof (sym) aliassym __attribute__ ((__alias__ (#sym))) + +#endif |