Libraries updates and cleanup
* Updating common/lib * Updating lib/csu * Updating lib/libc * Updating libexec/ld.elf_so * Corrected test on __minix in featuretest to actually follow the meaning of the comment. * Cleaned up _REENTRANT-related defintions. * Disabled -D_REENTRANT for libfetch * Removing some unneeded __NBSD_LIBC defines and tests Change-Id: Ic1394baef74d11b9f86b312f5ff4bbc3cbf72ce2
This commit is contained in:
@@ -1,46 +1,5 @@
|
||||
# $NetBSD: Makefile,v 1.40 2009/12/13 05:01:33 nakayama Exp $
|
||||
|
||||
# For now, we install the machine and arch includes, and symlink 'machine'
|
||||
# to the location of the machine includes (usually).
|
||||
#
|
||||
# Eventually, we should install everything.
|
||||
|
||||
.include <bsd.own.mk>
|
||||
|
||||
SUBDIR= ${MACHINE}
|
||||
ARCHSUBDIR= ${MACHINE_CPU}
|
||||
|
||||
.if ${ARCHSUBDIR} == "mips64"
|
||||
ARCHSUBDIR= mips
|
||||
.endif
|
||||
.if ${ARCHSUBDIR} == "powerpc64"
|
||||
ARCHSUBDIR= powerpc
|
||||
.endif
|
||||
|
||||
.if ${MACHINE} != ${ARCHSUBDIR}
|
||||
.if exists(${ARCHSUBDIR})
|
||||
SUBDIR+= ${ARCHSUBDIR}
|
||||
.endif
|
||||
.endif
|
||||
.if ${MACHINE} == sparc
|
||||
SUBDIR+= sparc64
|
||||
.endif
|
||||
.if (${MACHINE} == hpcmips || ${MACHINE} == hpcsh)
|
||||
SUBDIR+= hpc
|
||||
.endif
|
||||
.if (${MACHINE} == sun2 || ${MACHINE} == sun3)
|
||||
SUBDIR+= sun68k
|
||||
.endif
|
||||
.if defined(XEN_BUILD)
|
||||
SUBDIR+= xen
|
||||
.endif
|
||||
|
||||
|
||||
INCSYMLINKS= ${MACHINE_ARCH} /usr/include/machine
|
||||
|
||||
INCSYMLINKS+= machine/float.h /usr/include/float.h \
|
||||
machine/stdarg.h /usr/include/stdarg.h
|
||||
|
||||
|
||||
.include <bsd.inc.mk>
|
||||
.include <bsd.subdir.mk>
|
||||
|
||||
@@ -1,86 +0,0 @@
|
||||
/* $NetBSD: stdarg.h,v 1.10 2008/06/21 00:56:39 gmcgarry Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1991, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: @(#)stdarg.h 8.1 (Berkeley) 6/10/93
|
||||
*/
|
||||
|
||||
#ifndef _ARM32_STDARG_H_
|
||||
#define _ARM32_STDARG_H_
|
||||
|
||||
#include <machine/ansi.h>
|
||||
#include <sys/featuretest.h>
|
||||
|
||||
typedef _BSD_VA_LIST_ va_list;
|
||||
#ifdef __lint__
|
||||
#define __builtin_next_arg(t) ((t) ? 0 : 0)
|
||||
#define __builtin_stdarg_start(a, l) ((a) = ((l) ? 0 : 0))
|
||||
#define __builtin_va_arg(a, t) ((t)((a) ? 0 : 0))
|
||||
#define __builtin_va_end /* nothing */
|
||||
#define __builtin_va_copy(d, s) ((d) = (s))
|
||||
#endif
|
||||
|
||||
#if __GNUC_PREREQ__(4, 1)
|
||||
#define va_start(ap, last) __builtin_va_start((ap), (last))
|
||||
#define va_arg __builtin_va_arg
|
||||
#define va_end __builtin_va_end
|
||||
#define __va_copy(dest, src) __builtin_va_copy((dest), (src))
|
||||
#elif __GNUC_PREREQ__(2, 96)
|
||||
#define va_start(ap, last) __builtin_stdarg_start((ap), (last))
|
||||
#define va_arg __builtin_va_arg
|
||||
#define va_end __builtin_va_end
|
||||
#define __va_copy(dest, src) __builtin_va_copy((dest), (src))
|
||||
#elif defined(__PCC__)
|
||||
#define va_start(ap, last) __builtin_stdarg_start((ap), (last))
|
||||
#define va_arg __builtin_va_arg
|
||||
#define va_end __builtin_va_end
|
||||
#define __va_copy(dest, src) __builtin_va_copy((dest), (src))
|
||||
#else
|
||||
#define __va_size(type) \
|
||||
(((sizeof(type) + sizeof(long) - 1) / sizeof(long)) * sizeof(long))
|
||||
|
||||
#define va_start(ap, last) \
|
||||
((ap) = (va_list)__builtin_next_arg(last))
|
||||
|
||||
#define va_arg(ap, type) \
|
||||
((type *)(ap += sizeof(type)))[-1]
|
||||
|
||||
#define va_end(ap)
|
||||
|
||||
#define __va_copy(dest, src) ((dest) = (src))
|
||||
|
||||
#endif /* __GNUC_PREREQ__(2, 96) */
|
||||
|
||||
#if !defined(_ANSI_SOURCE) && \
|
||||
(defined(_ISOC99_SOURCE) || (__STDC_VERSION__ - 0) >= 199901L || \
|
||||
defined(_NETBSD_SOURCE))
|
||||
#define va_copy(dest, src) __va_copy((dest), (src))
|
||||
#endif
|
||||
|
||||
#endif /* !_ARM32_STDARG_H_ */
|
||||
@@ -1,5 +1,3 @@
|
||||
# $NetBSD: Makefile,v 1.38 2009/08/30 02:00:56 dyoung Exp $
|
||||
|
||||
|
||||
SUBDIR= include
|
||||
|
||||
|
||||
@@ -3,6 +3,6 @@ INCSDIR= /usr/include/arm
|
||||
|
||||
INCS= archconst.h archtypes.h diskparm.h elf.h interrupt.h \
|
||||
ipcconst.h memory.h multiboot.h partition.h \
|
||||
stackframe.h stdarg.h vm.h
|
||||
stackframe.h vm.h
|
||||
|
||||
.include <bsd.kinc.mk>
|
||||
|
||||
@@ -1,6 +1,213 @@
|
||||
/* $NetBSD: multiboot.h,v 1.8 2009/02/22 18:05:42 ahoka Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2005, 2006 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This code is derived from software contributed to The NetBSD Foundation
|
||||
* by Julio M. Merino Vidal.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
|
||||
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
|
||||
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
#ifndef __MULTIBOOT_H__
|
||||
#define __MULTIBOOT_H__
|
||||
|
||||
#if !defined(_KERNEL) && defined(_STANDALONE)
|
||||
|
||||
/* --------------------------------------------------------------------- */
|
||||
|
||||
/*
|
||||
* Multiboot header structure.
|
||||
*/
|
||||
#define MULTIBOOT_HEADER_MAGIC 0x1BADB002
|
||||
#define MULTIBOOT_HEADER_MODS_ALIGNED 0x00000001
|
||||
#define MULTIBOOT_HEADER_WANT_MEMORY 0x00000002
|
||||
#define MULTIBOOT_HEADER_HAS_VBE 0x00000004
|
||||
#define MULTIBOOT_HEADER_HAS_ADDR 0x00010000
|
||||
|
||||
#if !defined(_LOCORE)
|
||||
struct multiboot_header {
|
||||
uint32_t mh_magic;
|
||||
uint32_t mh_flags;
|
||||
uint32_t mh_checksum;
|
||||
|
||||
/* Valid if mh_flags sets MULTIBOOT_HEADER_HAS_ADDR. */
|
||||
paddr_t mh_header_addr;
|
||||
paddr_t mh_load_addr;
|
||||
paddr_t mh_load_end_addr;
|
||||
paddr_t mh_bss_end_addr;
|
||||
paddr_t mh_entry_addr;
|
||||
|
||||
/* Valid if mh_flags sets MULTIBOOT_HEADER_HAS_VBE. */
|
||||
uint32_t mh_mode_type;
|
||||
uint32_t mh_width;
|
||||
uint32_t mh_height;
|
||||
uint32_t mh_depth;
|
||||
};
|
||||
#endif /* !defined(_LOCORE) */
|
||||
|
||||
/*
|
||||
* Symbols defined in locore.S.
|
||||
*/
|
||||
#if !defined(_LOCORE) && defined(_KERNEL)
|
||||
extern struct multiboot_header *Multiboot_Header;
|
||||
#endif /* !defined(_LOCORE) && defined(_KERNEL) */
|
||||
|
||||
/* --------------------------------------------------------------------- */
|
||||
|
||||
/*
|
||||
* Multiboot information structure.
|
||||
*/
|
||||
#define MULTIBOOT_INFO_MAGIC 0x2BADB002
|
||||
#define MULTIBOOT_INFO_HAS_MEMORY 0x00000001
|
||||
#define MULTIBOOT_INFO_HAS_BOOT_DEVICE 0x00000002
|
||||
#define MULTIBOOT_INFO_HAS_CMDLINE 0x00000004
|
||||
#define MULTIBOOT_INFO_HAS_MODS 0x00000008
|
||||
#define MULTIBOOT_INFO_HAS_AOUT_SYMS 0x00000010
|
||||
#define MULTIBOOT_INFO_HAS_ELF_SYMS 0x00000020
|
||||
#define MULTIBOOT_INFO_HAS_MMAP 0x00000040
|
||||
#define MULTIBOOT_INFO_HAS_DRIVES 0x00000080
|
||||
#define MULTIBOOT_INFO_HAS_CONFIG_TABLE 0x00000100
|
||||
#define MULTIBOOT_INFO_HAS_LOADER_NAME 0x00000200
|
||||
#define MULTIBOOT_INFO_HAS_APM_TABLE 0x00000400
|
||||
#define MULTIBOOT_INFO_HAS_VBE 0x00000800
|
||||
|
||||
#if !defined(_LOCORE)
|
||||
struct multiboot_info {
|
||||
uint32_t mi_flags;
|
||||
|
||||
/* Valid if mi_flags sets MULTIBOOT_INFO_HAS_MEMORY. */
|
||||
uint32_t mi_mem_lower;
|
||||
uint32_t mi_mem_upper;
|
||||
|
||||
/* Valid if mi_flags sets MULTIBOOT_INFO_HAS_BOOT_DEVICE. */
|
||||
uint8_t mi_boot_device_part3;
|
||||
uint8_t mi_boot_device_part2;
|
||||
uint8_t mi_boot_device_part1;
|
||||
uint8_t mi_boot_device_drive;
|
||||
|
||||
/* Valid if mi_flags sets MULTIBOOT_INFO_HAS_CMDLINE. */
|
||||
char * mi_cmdline;
|
||||
|
||||
/* Valid if mi_flags sets MULTIBOOT_INFO_HAS_MODS. */
|
||||
uint32_t mi_mods_count;
|
||||
vaddr_t mi_mods_addr;
|
||||
|
||||
/* Valid if mi_flags sets MULTIBOOT_INFO_HAS_{AOUT,ELF}_SYMS. */
|
||||
uint32_t mi_elfshdr_num;
|
||||
uint32_t mi_elfshdr_size;
|
||||
vaddr_t mi_elfshdr_addr;
|
||||
uint32_t mi_elfshdr_shndx;
|
||||
|
||||
/* Valid if mi_flags sets MULTIBOOT_INFO_HAS_MMAP. */
|
||||
uint32_t mi_mmap_length;
|
||||
vaddr_t mi_mmap_addr;
|
||||
|
||||
/* Valid if mi_flags sets MULTIBOOT_INFO_HAS_DRIVES. */
|
||||
uint32_t mi_drives_length;
|
||||
vaddr_t mi_drives_addr;
|
||||
|
||||
/* Valid if mi_flags sets MULTIBOOT_INFO_HAS_CONFIG_TABLE. */
|
||||
void * unused_mi_config_table;
|
||||
|
||||
/* Valid if mi_flags sets MULTIBOOT_INFO_HAS_LOADER_NAME. */
|
||||
char * mi_loader_name;
|
||||
|
||||
/* Valid if mi_flags sets MULTIBOOT_INFO_HAS_APM. */
|
||||
void * unused_mi_apm_table;
|
||||
|
||||
/* Valid if mi_flags sets MULTIBOOT_INFO_HAS_VBE. */
|
||||
void * unused_mi_vbe_control_info;
|
||||
void * unused_mi_vbe_mode_info;
|
||||
paddr_t unused_mi_vbe_interface_seg;
|
||||
paddr_t unused_mi_vbe_interface_off;
|
||||
uint32_t unused_mi_vbe_interface_len;
|
||||
};
|
||||
|
||||
/* --------------------------------------------------------------------- */
|
||||
|
||||
/*
|
||||
* Drive information. This describes an entry in the drives table as
|
||||
* pointed to by mi_drives_addr.
|
||||
*/
|
||||
struct multiboot_drive {
|
||||
uint32_t md_length;
|
||||
uint8_t md_number;
|
||||
uint8_t md_mode;
|
||||
uint16_t md_cylinders;
|
||||
uint8_t md_heads;
|
||||
uint8_t md_sectors;
|
||||
|
||||
/* The variable-sized 'ports' field comes here, so this structure
|
||||
* can be longer. */
|
||||
};
|
||||
|
||||
/* --------------------------------------------------------------------- */
|
||||
|
||||
/*
|
||||
* Memory mapping. This describes an entry in the memory mappings table
|
||||
* as pointed to by mi_mmap_addr.
|
||||
*
|
||||
* Be aware that mm_size specifies the size of all other fields *except*
|
||||
* for mm_size. In order to jump between two different entries, you
|
||||
* have to count mm_size + 4 bytes.
|
||||
*/
|
||||
struct multiboot_mmap {
|
||||
uint32_t mm_size;
|
||||
uint64_t mm_base_addr;
|
||||
uint64_t mm_length;
|
||||
uint32_t mm_type;
|
||||
};
|
||||
|
||||
/*
|
||||
* Modules. This describes an entry in the modules table as pointed
|
||||
* to by mi_mods_addr.
|
||||
*/
|
||||
|
||||
struct multiboot_module {
|
||||
uint32_t mmo_start;
|
||||
uint32_t mmo_end;
|
||||
char * mmo_string;
|
||||
uint32_t mmo_reserved;
|
||||
};
|
||||
|
||||
#endif /* !defined(_LOCORE) */
|
||||
|
||||
/* --------------------------------------------------------------------- */
|
||||
|
||||
/*
|
||||
* Prototypes for public functions defined in multiboot.c.
|
||||
*/
|
||||
#if !defined(_LOCORE) && defined(_KERNEL)
|
||||
void multiboot_pre_reloc(struct multiboot_info *);
|
||||
void multiboot_post_reloc(void);
|
||||
void multiboot_print_info(void);
|
||||
bool multiboot_ksyms_addsyms_elf(void);
|
||||
#endif /* !defined(_LOCORE) */
|
||||
|
||||
/* --------------------------------------------------------------------- */
|
||||
#else /* !defined(_KERNEL) && defined(_STANDALONE) */
|
||||
/* LSC FIXME: OLD MINIX DEFINITION: should be removed and replace with
|
||||
definition above... */
|
||||
#define MULTIBOOT_HEADER_MAGIC 0x1BADB002
|
||||
|
||||
#define MULTIBOOT_BOOTLOADER_MAGIC 0x2BADB002
|
||||
@@ -140,4 +347,5 @@ struct multiboot_mmap_entry
|
||||
typedef struct multiboot_mmap_entry multiboot_memory_map_t;
|
||||
|
||||
#endif /* __ASSEMBLY__ */
|
||||
#endif /* !defined(_KERNEL) && defined(_STANDALONE) */
|
||||
#endif /* __MULTIBOOT_H__ */
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
# $NetBSD: Makefile,v 1.38 2009/08/30 02:00:56 dyoung Exp $
|
||||
|
||||
|
||||
SUBDIR= include
|
||||
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
|
||||
INCSDIR= /usr/include/i386
|
||||
|
||||
INCS= archconst.h archtypes.h bios.h cmos.h cpu.h \
|
||||
INCS= archconst.h archtypes.h bios.h cmos.h \
|
||||
diskparm.h elf.h fpu.h int86.h interrupt.h \
|
||||
ipcconst.h memory.h partition.h \
|
||||
pci_amd.h pci.h pci_intel.h pci_sis.h \
|
||||
pci_via.h ports.h stackframe.h stdarg.h vm.h
|
||||
pci_via.h ports.h stackframe.h vm.h
|
||||
|
||||
.include <bsd.kinc.mk>
|
||||
|
||||
|
||||
@@ -1,86 +0,0 @@
|
||||
/* $NetBSD: stdarg.h,v 1.23 2009/08/18 17:40:39 drochner Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1991, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)stdarg.h 8.1 (Berkeley) 6/10/93
|
||||
*/
|
||||
|
||||
#ifndef _I386_STDARG_H_
|
||||
#define _I386_STDARG_H_
|
||||
|
||||
#include <machine/ansi.h>
|
||||
#include <sys/featuretest.h>
|
||||
|
||||
typedef _BSD_VA_LIST_ va_list;
|
||||
|
||||
#ifdef __lint__
|
||||
#define __builtin_next_arg(t) ((t) ? 0 : 0)
|
||||
#define __builtin_stdarg_start(a, l) ((a) = ((l) ? 0 : 0))
|
||||
#define __builtin_va_arg(a, t) ((a) ? 0 : 0)
|
||||
#define __builtin_va_end /* nothing */
|
||||
#define __builtin_va_copy(d, s) ((d) = (s))
|
||||
#endif
|
||||
|
||||
#if __GNUC_PREREQ__(4, 1)
|
||||
#define va_start(ap, last) __builtin_va_start((ap), (last))
|
||||
#define va_arg __builtin_va_arg
|
||||
#define va_end __builtin_va_end
|
||||
#define __va_copy(dest, src) __builtin_va_copy((dest), (src))
|
||||
#elif __GNUC_PREREQ__(2, 96)
|
||||
#define va_start(ap, last) __builtin_stdarg_start((ap), (last))
|
||||
#define va_arg __builtin_va_arg
|
||||
#define va_end __builtin_va_end
|
||||
#define __va_copy(dest, src) __builtin_va_copy((dest), (src))
|
||||
#elif defined(__PCC__)
|
||||
#define va_start(ap, last) __builtin_stdarg_start((ap), (last))
|
||||
#define va_arg __builtin_va_arg
|
||||
#define va_end __builtin_va_end
|
||||
#define __va_copy(dest, src) __builtin_va_copy((dest), (src))
|
||||
#else
|
||||
#define __va_size(type) \
|
||||
(((sizeof(type) + sizeof(long) - 1) / sizeof(long)) * sizeof(long))
|
||||
|
||||
#define va_start(ap, last) \
|
||||
((ap) = (va_list)__builtin_next_arg(last))
|
||||
|
||||
#define va_arg(ap, type) \
|
||||
(*(type *)(void *)((ap) += __va_size(type), (ap) - __va_size(type)))
|
||||
|
||||
#define va_end(ap)
|
||||
|
||||
#define __va_copy(dest, src) ((dest) = (src))
|
||||
#endif
|
||||
|
||||
#if !defined(_ANSI_SOURCE) && \
|
||||
(defined(_ISOC99_SOURCE) || (__STDC_VERSION__ - 0) >= 199901L || \
|
||||
defined(_NETBSD_SOURCE))
|
||||
#define va_copy(dest, src) __va_copy((dest), (src))
|
||||
#endif
|
||||
|
||||
#endif /* !_I386_STDARG_H_ */
|
||||
Reference in New Issue
Block a user