diff options
author | cvs2svn <> | 2008-12-22 22:45:57 +0300 |
---|---|---|
committer | cvs2svn <> | 2008-12-22 22:45:57 +0300 |
commit | 0f285615efa16c783821cd87a1fdabe4913da9a7 (patch) | |
tree | 0108a4b20fb3c5414c4e221ff251a92050bd104d /winsup/mingw | |
parent | 272fac20e743611550c6fad64f054934da6fd4bc (diff) |
This commit was manufactured by cvs2svn to create branch 'newlib-newlib-1_17_0
1_17_0-arc'.
Sprout from master 2008-12-22 19:45:56 UTC Jeff Johnston <jjohnstn@redhat.com> ''
Cherrypick from cygnus 1999-05-03 07:29:06 UTC Richard Henderson <rth@redhat.com> '19990502 sourceware import':
README
config/mt-d30v
config/mt-netware
config/mt-ospace
etc/add-log.el
etc/add-log.vi
etc/configbuild.ein
etc/configbuild.fig
etc/configbuild.jin
etc/configbuild.tin
etc/configdev.ein
etc/configdev.fig
etc/configdev.jin
etc/configdev.tin
makefile.vms
Delete:
djunpack.bat
include/COPYING
include/COPYING3
include/ChangeLog
include/ChangeLog-9103
include/MAINTAINERS
include/alloca-conf.h
include/ansidecl.h
include/aout/ChangeLog
include/aout/adobe.h
include/aout/aout64.h
include/aout/ar.h
include/aout/dynix3.h
include/aout/encap.h
include/aout/host.h
include/aout/hp.h
include/aout/hp300hpux.h
include/aout/hppa.h
include/aout/ranlib.h
include/aout/reloc.h
include/aout/stab.def
include/aout/stab_gnu.h
include/aout/sun4.h
include/bfdlink.h
include/binary-io.h
include/bout.h
include/coff/ChangeLog
include/coff/ChangeLog-9103
include/coff/alpha.h
include/coff/apollo.h
include/coff/arm.h
include/coff/aux-coff.h
include/coff/ecoff.h
include/coff/external.h
include/coff/go32exe.h
include/coff/h8300.h
include/coff/h8500.h
include/coff/i386.h
include/coff/i860.h
include/coff/i960.h
include/coff/ia64.h
include/coff/internal.h
include/coff/m68k.h
include/coff/m88k.h
include/coff/maxq.h
include/coff/mcore.h
include/coff/mips.h
include/coff/mipspe.h
include/coff/or32.h
include/coff/pe.h
include/coff/powerpc.h
include/coff/rs6000.h
include/coff/rs6k64.h
include/coff/sh.h
include/coff/sparc.h
include/coff/sym.h
include/coff/symconst.h
include/coff/ti.h
include/coff/tic30.h
include/coff/tic4x.h
include/coff/tic54x.h
include/coff/tic80.h
include/coff/w65.h
include/coff/we32k.h
include/coff/x86_64.h
include/coff/xcoff.h
include/coff/z80.h
include/coff/z8k.h
include/demangle.h
include/dis-asm.h
include/dyn-string.h
include/elf/ChangeLog
include/elf/ChangeLog-9103
include/elf/alpha.h
include/elf/arc.h
include/elf/arm.h
include/elf/avr.h
include/elf/bfin.h
include/elf/common.h
include/elf/cr16.h
include/elf/cr16c.h
include/elf/cris.h
include/elf/crx.h
include/elf/d10v.h
include/elf/d30v.h
include/elf/dlx.h
include/elf/dwarf.h
include/elf/dwarf2.h
include/elf/external.h
include/elf/fr30.h
include/elf/frv.h
include/elf/h8.h
include/elf/hppa.h
include/elf/i370.h
include/elf/i386.h
include/elf/i860.h
include/elf/i960.h
include/elf/ia64.h
include/elf/internal.h
include/elf/ip2k.h
include/elf/iq2000.h
include/elf/m32c.h
include/elf/m32r.h
include/elf/m68hc11.h
include/elf/m68k.h
include/elf/mcore.h
include/elf/mep.h
include/elf/mips.h
include/elf/mmix.h
include/elf/mn10200.h
include/elf/mn10300.h
include/elf/msp430.h
include/elf/mt.h
include/elf/openrisc.h
include/elf/or32.h
include/elf/pj.h
include/elf/ppc.h
include/elf/ppc64.h
include/elf/reloc-macros.h
include/elf/s390.h
include/elf/score.h
include/elf/sh.h
include/elf/sparc.h
include/elf/spu.h
include/elf/v850.h
include/elf/vax.h
include/elf/vxworks.h
include/elf/x86-64.h
include/elf/xc16x.h
include/elf/xstormy16.h
include/elf/xtensa.h
include/fibheap.h
include/filenames.h
include/floatformat.h
include/fnmatch.h
include/fopen-bin.h
include/fopen-same.h
include/fopen-vms.h
include/gdb/ChangeLog
include/gdb/callback.h
include/gdb/fileio.h
include/gdb/remote-sim.h
include/gdb/signals.h
include/gdb/sim-arm.h
include/gdb/sim-cr16.h
include/gdb/sim-d10v.h
include/gdb/sim-frv.h
include/gdb/sim-h8300.h
include/gdb/sim-m32c.h
include/gdb/sim-ppc.h
include/gdb/sim-sh.h
include/gdbm.h
include/getopt.h
include/hashtab.h
include/hp-symtab.h
include/ieee.h
include/libiberty.h
include/md5.h
include/nlm/ChangeLog
include/nlm/alpha-ext.h
include/nlm/common.h
include/nlm/external.h
include/nlm/i386-ext.h
include/nlm/internal.h
include/nlm/ppc-ext.h
include/nlm/sparc32-ext.h
include/oasys.h
include/objalloc.h
include/obstack.h
include/opcode/ChangeLog
include/opcode/ChangeLog-9103
include/opcode/alpha.h
include/opcode/arc.h
include/opcode/arm.h
include/opcode/avr.h
include/opcode/bfin.h
include/opcode/cgen-bitset.h
include/opcode/cgen.h
include/opcode/convex.h
include/opcode/cr16.h
include/opcode/cris.h
include/opcode/crx.h
include/opcode/d10v.h
include/opcode/d30v.h
include/opcode/dlx.h
include/opcode/h8300.h
include/opcode/hppa.h
include/opcode/i370.h
include/opcode/i386.h
include/opcode/i860.h
include/opcode/i960.h
include/opcode/ia64.h
include/opcode/m68hc11.h
include/opcode/m68k.h
include/opcode/m88k.h
include/opcode/maxq.h
include/opcode/mips.h
include/opcode/mmix.h
include/opcode/mn10200.h
include/opcode/mn10300.h
include/opcode/msp430.h
include/opcode/np1.h
include/opcode/ns32k.h
include/opcode/or32.h
include/opcode/pdp11.h
include/opcode/pj.h
include/opcode/pn.h
include/opcode/ppc.h
include/opcode/pyr.h
include/opcode/s390.h
include/opcode/score-datadep.h
include/opcode/score-inst.h
include/opcode/sparc.h
include/opcode/spu-insns.h
include/opcode/spu.h
include/opcode/tahoe.h
include/opcode/tic30.h
include/opcode/tic4x.h
include/opcode/tic54x.h
include/opcode/tic80.h
include/opcode/v850.h
include/opcode/vax.h
include/os9k.h
include/partition.h
include/plugin-api.h
include/progress.h
include/safe-ctype.h
include/sha1.h
include/sort.h
include/splay-tree.h
include/symcat.h
include/xregex.h
include/xregex2.h
include/xtensa-config.h
include/xtensa-isa-internal.h
include/xtensa-isa.h
winsup/COPYING
winsup/CYGWIN_LICENSE
winsup/ChangeLog
winsup/Makefile.common
winsup/Makefile.in
winsup/README
winsup/acinclude.m4
winsup/aclocal.m4
winsup/configure
winsup/configure.in
winsup/cygserver/ChangeLog
winsup/cygserver/Makefile.in
winsup/cygserver/README
winsup/cygserver/aclocal.m4
winsup/cygserver/bsd_helper.cc
winsup/cygserver/bsd_helper.h
winsup/cygserver/bsd_log.cc
winsup/cygserver/bsd_log.h
winsup/cygserver/bsd_mutex.cc
winsup/cygserver/bsd_mutex.h
winsup/cygserver/client.cc
winsup/cygserver/configure
winsup/cygserver/configure.in
winsup/cygserver/cygserver-config
winsup/cygserver/cygserver.cc
winsup/cygserver/cygserver.conf
winsup/cygserver/msg.cc
winsup/cygserver/process.cc
winsup/cygserver/process.h
winsup/cygserver/sem.cc
winsup/cygserver/setpwd.cc
winsup/cygserver/shm.cc
winsup/cygserver/sysv_msg.cc
winsup/cygserver/sysv_sem.cc
winsup/cygserver/sysv_shm.cc
winsup/cygserver/threaded_queue.cc
winsup/cygserver/threaded_queue.h
winsup/cygserver/transport.cc
winsup/cygserver/transport.h
winsup/cygserver/transport_pipes.cc
winsup/cygserver/transport_pipes.h
winsup/cygserver/woutsup.h
winsup/cygwin/ChangeLog
winsup/cygwin/ChangeLog-1995
winsup/cygwin/ChangeLog-1996
winsup/cygwin/ChangeLog-1997
winsup/cygwin/ChangeLog-1998
winsup/cygwin/ChangeLog-1999
winsup/cygwin/ChangeLog-2000
winsup/cygwin/ChangeLog-2001
winsup/cygwin/ChangeLog-2002
winsup/cygwin/ChangeLog-2003
winsup/cygwin/ChangeLog-2004
winsup/cygwin/ChangeLog-2005
winsup/cygwin/ChangeLog-2006
winsup/cygwin/ChangeLog-2007
winsup/cygwin/Makefile.in
winsup/cygwin/ROADMAP
winsup/cygwin/acconfig.h
winsup/cygwin/aclocal.m4
winsup/cygwin/analyze_sigfe
winsup/cygwin/assert.cc
winsup/cygwin/autoload.cc
winsup/cygwin/automode.c
winsup/cygwin/binmode.c
winsup/cygwin/child_info.h
winsup/cygwin/config.h.in
winsup/cygwin/config/i386/profile.h
winsup/cygwin/configure
winsup/cygwin/configure.in
winsup/cygwin/cpuid.h
winsup/cygwin/crt0.c
winsup/cygwin/ctype.cc
winsup/cygwin/cxx.cc
winsup/cygwin/cygerrno.h
winsup/cygwin/cygheap.cc
winsup/cygwin/cygheap.h
winsup/cygwin/cyglsa.h
winsup/cygwin/cygmagic
winsup/cygwin/cygmalloc.h
winsup/cygwin/cygserver.h
winsup/cygwin/cygserver_ipc.h
winsup/cygwin/cygserver_msg.h
winsup/cygwin/cygserver_sem.h
winsup/cygwin/cygserver_setpwd.h
winsup/cygwin/cygserver_shm.h
winsup/cygwin/cygthread.cc
winsup/cygwin/cygthread.h
winsup/cygwin/cygtls.cc
winsup/cygwin/cygtls.h
winsup/cygwin/cygwin-shilka
winsup/cygwin/cygwin.din
winsup/cygwin/cygwin.sc
winsup/cygwin/cygwin_version.h
winsup/cygwin/dcrt0.cc
winsup/cygwin/debug.cc
winsup/cygwin/debug.h
winsup/cygwin/devices.cc
winsup/cygwin/devices.h
winsup/cygwin/devices.in
winsup/cygwin/dir.cc
winsup/cygwin/dlfcn.cc
winsup/cygwin/dll_init.cc
winsup/cygwin/dll_init.h
winsup/cygwin/dll_init.sgml
winsup/cygwin/dllfixdbg
winsup/cygwin/dlmalloc.c
winsup/cygwin/dlmalloc.h
winsup/cygwin/dtable.cc
winsup/cygwin/dtable.h
winsup/cygwin/dtable.sgml
winsup/cygwin/environ.cc
winsup/cygwin/environ.h
winsup/cygwin/errno.cc
winsup/cygwin/exceptions.cc
winsup/cygwin/exec.cc
winsup/cygwin/external.cc
winsup/cygwin/external.sgml
winsup/cygwin/fcntl.cc
winsup/cygwin/fhandler.cc
winsup/cygwin/fhandler.h
winsup/cygwin/fhandler_clipboard.cc
winsup/cygwin/fhandler_console.cc
winsup/cygwin/fhandler_disk_file.cc
winsup/cygwin/fhandler_dsp.cc
winsup/cygwin/fhandler_fifo.cc
winsup/cygwin/fhandler_floppy.cc
winsup/cygwin/fhandler_mailslot.cc
winsup/cygwin/fhandler_mem.cc
winsup/cygwin/fhandler_netdrive.cc
winsup/cygwin/fhandler_nodevice.cc
winsup/cygwin/fhandler_proc.cc
winsup/cygwin/fhandler_process.cc
winsup/cygwin/fhandler_procnet.cc
winsup/cygwin/fhandler_random.cc
winsup/cygwin/fhandler_raw.cc
winsup/cygwin/fhandler_registry.cc
winsup/cygwin/fhandler_serial.cc
winsup/cygwin/fhandler_socket.cc
winsup/cygwin/fhandler_tape.cc
winsup/cygwin/fhandler_termios.cc
winsup/cygwin/fhandler_tty.cc
winsup/cygwin/fhandler_virtual.cc
winsup/cygwin/fhandler_windows.cc
winsup/cygwin/fhandler_zero.cc
winsup/cygwin/flock.cc
winsup/cygwin/fork.cc
winsup/cygwin/gcrt0.c
winsup/cygwin/gendef
winsup/cygwin/gendevices
winsup/cygwin/gentls_offsets
winsup/cygwin/glob.cc
winsup/cygwin/gmon.c
winsup/cygwin/gmon.h
winsup/cygwin/grp.cc
winsup/cygwin/heap.cc
winsup/cygwin/heap.h
winsup/cygwin/hires.h
winsup/cygwin/hookapi.cc
winsup/cygwin/how-autoload-works.txt
winsup/cygwin/how-cygheap-works.txt
winsup/cygwin/how-cygtls-works.txt
winsup/cygwin/how-fhandlers-work.txt
winsup/cygwin/how-signals-work.txt
winsup/cygwin/how-spawn-works.txt
winsup/cygwin/how-to-debug-cygwin.txt
winsup/cygwin/how-vfork-works.txt
winsup/cygwin/include/a.out.h
winsup/cygwin/include/arpa/ftp.h
winsup/cygwin/include/arpa/inet.h
winsup/cygwin/include/arpa/nameser.h
winsup/cygwin/include/arpa/nameser_compat.h
winsup/cygwin/include/arpa/telnet.h
winsup/cygwin/include/asm/byteorder.h
winsup/cygwin/include/asm/socket.h
winsup/cygwin/include/asm/types.h
winsup/cygwin/include/attr/xattr.h
winsup/cygwin/include/byteswap.h
winsup/cygwin/include/ctype.h
winsup/cygwin/include/cygwin/_types.h
winsup/cygwin/include/cygwin/acl.h
winsup/cygwin/include/cygwin/config.h
winsup/cygwin/include/cygwin/core_dump.h
winsup/cygwin/include/cygwin/cygwin_dll.h
winsup/cygwin/include/cygwin/fs.h
winsup/cygwin/include/cygwin/grp.h
winsup/cygwin/include/cygwin/hdreg.h
winsup/cygwin/include/cygwin/icmp.h
winsup/cygwin/include/cygwin/if.h
winsup/cygwin/include/cygwin/in.h
winsup/cygwin/include/cygwin/in6.h
winsup/cygwin/include/cygwin/in_systm.h
winsup/cygwin/include/cygwin/ipc.h
winsup/cygwin/include/cygwin/kd.h
winsup/cygwin/include/cygwin/msg.h
winsup/cygwin/include/cygwin/mtio.h
winsup/cygwin/include/cygwin/rdevio.h
winsup/cygwin/include/cygwin/sem.h
winsup/cygwin/include/cygwin/shm.h
winsup/cygwin/include/cygwin/signal.h
winsup/cygwin/include/cygwin/socket.h
winsup/cygwin/include/cygwin/sockios.h
winsup/cygwin/include/cygwin/stat.h
winsup/cygwin/include/cygwin/stdlib.h
winsup/cygwin/include/cygwin/sys_time.h
winsup/cygwin/include/cygwin/sysproto.h
winsup/cygwin/include/cygwin/time.h
winsup/cygwin/include/cygwin/types.h
winsup/cygwin/include/cygwin/utmp.h
winsup/cygwin/include/cygwin/version.h
winsup/cygwin/include/cygwin/wait.h
winsup/cygwin/include/dlfcn.h
winsup/cygwin/include/elf.h
winsup/cygwin/include/endian.h
winsup/cygwin/include/err.h
winsup/cygwin/include/exceptions.h
winsup/cygwin/include/fcntl.h
winsup/cygwin/include/features.h
winsup/cygwin/include/fnmatch.h
winsup/cygwin/include/fts.h
winsup/cygwin/include/ftw.h
winsup/cygwin/include/getopt.h
winsup/cygwin/include/glob.h
winsup/cygwin/include/icmp.h
winsup/cygwin/include/ifaddrs.h
winsup/cygwin/include/inttypes.h
winsup/cygwin/include/io.h
winsup/cygwin/include/lastlog.h
winsup/cygwin/include/libgen.h
winsup/cygwin/include/limits.h
winsup/cygwin/include/machine/stdlib.h
winsup/cygwin/include/mapi.h
winsup/cygwin/include/memory.h
winsup/cygwin/include/mntent.h
winsup/cygwin/include/mqueue.h
winsup/cygwin/include/net/if.h
winsup/cygwin/include/netdb.h
winsup/cygwin/include/netinet/in.h
winsup/cygwin/include/netinet/in_systm.h
winsup/cygwin/include/netinet/ip.h
winsup/cygwin/include/netinet/ip_icmp.h
winsup/cygwin/include/netinet/tcp.h
winsup/cygwin/include/netinet/udp.h
winsup/cygwin/include/paths.h
winsup/cygwin/include/poll.h
winsup/cygwin/include/pthread.h
winsup/cygwin/include/pty.h
winsup/cygwin/include/resolv.h
winsup/cygwin/include/sched.h
winsup/cygwin/include/search.h
winsup/cygwin/include/semaphore.h
winsup/cygwin/include/stdint.h
winsup/cygwin/include/strings.h
winsup/cygwin/include/sys/acl.h
winsup/cygwin/include/sys/copying.dj
winsup/cygwin/include/sys/cygwin.h
winsup/cygwin/include/sys/dirent.h
winsup/cygwin/include/sys/elf32.h
winsup/cygwin/include/sys/elf64.h
winsup/cygwin/include/sys/elf_common.h
winsup/cygwin/include/sys/elf_generic.h
winsup/cygwin/include/sys/file.h
winsup/cygwin/include/sys/ioctl.h
winsup/cygwin/include/sys/ipc.h
winsup/cygwin/include/sys/kd.h
winsup/cygwin/include/sys/lock.h
winsup/cygwin/include/sys/mman.h
winsup/cygwin/include/sys/mount.h
winsup/cygwin/include/sys/msg.h
winsup/cygwin/include/sys/mtio.h
winsup/cygwin/include/sys/param.h
winsup/cygwin/include/sys/poll.h
winsup/cygwin/include/sys/procfs.h
winsup/cygwin/include/sys/queue.h
winsup/cygwin/include/sys/resource.h
winsup/cygwin/include/sys/select.h
winsup/cygwin/include/sys/sem.h
winsup/cygwin/include/sys/shm.h
winsup/cygwin/include/sys/smallprint.h
winsup/cygwin/include/sys/socket.h
winsup/cygwin/include/sys/soundcard.h
winsup/cygwin/include/sys/statfs.h
winsup/cygwin/include/sys/statvfs.h
winsup/cygwin/include/sys/stdio.h
winsup/cygwin/include/sys/strace.h
winsup/cygwin/include/sys/syslimits.h
winsup/cygwin/include/sys/syslog.h
winsup/cygwin/include/sys/sysmacros.h
winsup/cygwin/include/sys/sysproto.h
winsup/cygwin/include/sys/termio.h
winsup/cygwin/include/sys/termios.h
winsup/cygwin/include/sys/ttychars.h
winsup/cygwin/include/sys/uio.h
winsup/cygwin/include/sys/un.h
winsup/cygwin/include/sys/utime.h
winsup/cygwin/include/sys/utmp.h
winsup/cygwin/include/sys/utsname.h
winsup/cygwin/include/sys/vfs.h
winsup/cygwin/include/sys/wait.h
winsup/cygwin/include/sysexits.h
winsup/cygwin/include/syslog.h
winsup/cygwin/include/termio.h
winsup/cygwin/include/tzfile.h
winsup/cygwin/include/utmpx.h
winsup/cygwin/include/wait.h
winsup/cygwin/init.cc
winsup/cygwin/ioctl.cc
winsup/cygwin/ipc.cc
winsup/cygwin/kernel32.cc
winsup/cygwin/lib/_cygwin_crt0_common.cc
winsup/cygwin/lib/crt0.h
winsup/cygwin/lib/cygwin_attach_dll.c
winsup/cygwin/lib/cygwin_crt0.c
winsup/cygwin/lib/dll_entry.c
winsup/cygwin/lib/dll_main.cc
winsup/cygwin/lib/libcmain.c
winsup/cygwin/lib/premain0.c
winsup/cygwin/lib/premain1.c
winsup/cygwin/lib/premain2.c
winsup/cygwin/lib/premain3.c
winsup/cygwin/lib/pseudo-reloc.c
winsup/cygwin/libc/bsdlib.cc
winsup/cygwin/libc/fnmatch.c
winsup/cygwin/libc/fts.c
winsup/cygwin/libc/ftw.c
winsup/cygwin/libc/getopt.c
winsup/cygwin/libc/inet_addr.c
winsup/cygwin/libc/inet_network.c
winsup/cygwin/libc/minires-os-if.c
winsup/cygwin/libc/minires.c
winsup/cygwin/libc/minires.h
winsup/cygwin/libc/nftw.c
winsup/cygwin/libc/rcmd.cc
winsup/cygwin/libc/rexec.cc
winsup/cygwin/libc/strptime.cc
winsup/cygwin/libc/xsique.cc
winsup/cygwin/localtime.cc
winsup/cygwin/lsearch.cc
winsup/cygwin/malloc.cc
winsup/cygwin/malloc_wrapper.cc
winsup/cygwin/mcount.c
winsup/cygwin/miscfuncs.cc
winsup/cygwin/miscfuncs.h
winsup/cygwin/mktemp.cc
winsup/cygwin/mkvers.sh
winsup/cygwin/mmap.cc
winsup/cygwin/mmap_helper.h
winsup/cygwin/mount.cc
winsup/cygwin/msg.cc
winsup/cygwin/mtinfo.h
winsup/cygwin/net.cc
winsup/cygwin/netdb.cc
winsup/cygwin/newsym
winsup/cygwin/nfs.cc
winsup/cygwin/nfs.h
winsup/cygwin/ntdll.h
winsup/cygwin/ntea.cc
winsup/cygwin/passwd.cc
winsup/cygwin/path.cc
winsup/cygwin/path.h
winsup/cygwin/path.sgml
winsup/cygwin/perprocess.h
winsup/cygwin/pinfo.cc
winsup/cygwin/pinfo.h
winsup/cygwin/pipe.cc
winsup/cygwin/poll.cc
winsup/cygwin/posix.sgml
winsup/cygwin/posix_ipc.cc
winsup/cygwin/profil.c
winsup/cygwin/profil.h
winsup/cygwin/pseudo-reloc.cc
winsup/cygwin/pthread.cc
winsup/cygwin/pwdgrp.h
winsup/cygwin/random.cc
winsup/cygwin/regex/COPYRIGHT
winsup/cygwin/regex/cclass.h
winsup/cygwin/regex/cname.h
winsup/cygwin/regex/engine.c
winsup/cygwin/regex/engine.ih
winsup/cygwin/regex/mkh
winsup/cygwin/regex/regcomp.c
winsup/cygwin/regex/regcomp.ih
winsup/cygwin/regex/regerror.c
winsup/cygwin/regex/regerror.ih
winsup/cygwin/regex/regex.3
winsup/cygwin/regex/regex.7
winsup/cygwin/regex/regex.h
winsup/cygwin/regex/regex2.h
winsup/cygwin/regex/regexec.c
winsup/cygwin/regex/regfree.c
winsup/cygwin/regex/tests
winsup/cygwin/regex/utils.h
winsup/cygwin/registry.cc
winsup/cygwin/registry.h
winsup/cygwin/resource.cc
winsup/cygwin/rmsym
winsup/cygwin/scandir.cc
winsup/cygwin/sched.cc
winsup/cygwin/sec_acl.cc
winsup/cygwin/sec_auth.cc
winsup/cygwin/sec_helper.cc
winsup/cygwin/security.cc
winsup/cygwin/security.h
winsup/cygwin/security.sgml
winsup/cygwin/select.cc
winsup/cygwin/sem.cc
winsup/cygwin/setlsapwd.cc
winsup/cygwin/shared.cc
winsup/cygwin/shared_info.h
winsup/cygwin/shm.cc
winsup/cygwin/signal.cc
winsup/cygwin/sigproc.cc
winsup/cygwin/sigproc.h
winsup/cygwin/smallprint.cc
winsup/cygwin/sortdin
winsup/cygwin/spawn.cc
winsup/cygwin/speclib
winsup/cygwin/stackdump.sgml
winsup/cygwin/strace.cc
winsup/cygwin/strfuncs.cc
winsup/cygwin/string.h
winsup/cygwin/strsep.cc
winsup/cygwin/strsig.cc
winsup/cygwin/sync.cc
winsup/cygwin/sync.h
winsup/cygwin/syscalls.cc
winsup/cygwin/sysconf.cc
winsup/cygwin/syslog.cc
winsup/cygwin/termios.cc
winsup/cygwin/textmode.c
winsup/cygwin/textreadmode.c
winsup/cygwin/thread.cc
winsup/cygwin/thread.h
winsup/cygwin/timer.cc
winsup/cygwin/times.cc
winsup/cygwin/tls_pbuf.cc
winsup/cygwin/tls_pbuf.h
winsup/cygwin/tlsoffsets.h
winsup/cygwin/tty.cc
winsup/cygwin/tty.h
winsup/cygwin/tz_posixrules.h
winsup/cygwin/uinfo.cc
winsup/cygwin/uname.cc
winsup/cygwin/wait.cc
winsup/cygwin/wchar.h
winsup/cygwin/winbase.h
winsup/cygwin/wincap.cc
winsup/cygwin/wincap.h
winsup/cygwin/window.cc
winsup/cygwin/winf.cc
winsup/cygwin/winf.h
winsup/cygwin/wininfo.h
winsup/cygwin/winsup.h
winsup/cygwin/winver.rc
winsup/doc/ChangeLog
winsup/doc/Makefile.in
winsup/doc/README
winsup/doc/aclocal.m4
winsup/doc/configure
winsup/doc/configure.in
winsup/doc/cygserver.sgml
winsup/doc/cygwin-api.in.sgml
winsup/doc/cygwin-ug-net.in.sgml
winsup/doc/cygwin-ug.in.sgml
winsup/doc/cygwin.dsl
winsup/doc/cygwinenv.sgml
winsup/doc/dll.sgml
winsup/doc/doctool.c
winsup/doc/doctool.txt
winsup/doc/effectively.sgml
winsup/doc/faq-api.xml
winsup/doc/faq-problems.xml
winsup/doc/faq-programming.xml
winsup/doc/faq-resources.xml
winsup/doc/faq-sections.xml
winsup/doc/faq-setup.xml
winsup/doc/faq-using.xml
winsup/doc/faq-what.xml
winsup/doc/faq.xml
winsup/doc/fhandler-tut.txt
winsup/doc/filemodes.sgml
winsup/doc/gcc.sgml
winsup/doc/gdb.sgml
winsup/doc/legal.sgml
winsup/doc/ntsec.sgml
winsup/doc/overview.sgml
winsup/doc/overview2.sgml
winsup/doc/pathnames.sgml
winsup/doc/programming.sgml
winsup/doc/setup-net.sgml
winsup/doc/setup.sgml
winsup/doc/setup2.sgml
winsup/doc/textbinary.sgml
winsup/doc/using.sgml
winsup/doc/windres.sgml
winsup/lsaauth/ChangeLog
winsup/lsaauth/Makefile.in
winsup/lsaauth/aclocal.m4
winsup/lsaauth/configure
winsup/lsaauth/configure.in
winsup/lsaauth/cyglsa-config
winsup/lsaauth/cyglsa.c
winsup/lsaauth/cyglsa.din
winsup/lsaauth/cyglsa64.dll
winsup/lsaauth/make-64bit-version-with-visual-c.bat
winsup/lsaauth/mslsa.def
winsup/mingw/CONTRIBUTORS
winsup/mingw/CRT_fp10.c
winsup/mingw/CRT_fp8.c
winsup/mingw/CRT_noglob.c
winsup/mingw/CRTfmode.c
winsup/mingw/CRTglob.c
winsup/mingw/CRTinit.c
winsup/mingw/ChangeLog
winsup/mingw/DISCLAIMER
winsup/mingw/Makefile.in
winsup/mingw/README
winsup/mingw/TODO
winsup/mingw/aclocal.m4
winsup/mingw/binmode.c
winsup/mingw/config.guess
winsup/mingw/config.sub
winsup/mingw/configure
winsup/mingw/configure.in
winsup/mingw/cpu_features.c
winsup/mingw/cpu_features.h
winsup/mingw/crt1.c
winsup/mingw/crtdll.def
winsup/mingw/crtmt.c
winsup/mingw/crtst.c
winsup/mingw/dllcrt1.c
winsup/mingw/dllmain.c
winsup/mingw/gccmain.c
winsup/mingw/include/_mingw.h
winsup/mingw/include/assert.h
winsup/mingw/include/complex.h
winsup/mingw/include/conio.h
winsup/mingw/include/ctype.h
winsup/mingw/include/dir.h
winsup/mingw/include/direct.h
winsup/mingw/include/dirent.h
winsup/mingw/include/dos.h
winsup/mingw/include/errno.h
winsup/mingw/include/excpt.h
winsup/mingw/include/fcntl.h
winsup/mingw/include/fenv.h
winsup/mingw/include/float.h
winsup/mingw/include/getopt.h
winsup/mingw/include/inttypes.h
winsup/mingw/include/io.h
winsup/mingw/include/libgen.h
winsup/mingw/include/limits.h
winsup/mingw/include/locale.h
winsup/mingw/include/malloc.h
winsup/mingw/include/math.h
winsup/mingw/include/mbctype.h
winsup/mingw/include/mbstring.h
winsup/mingw/include/mem.h
winsup/mingw/include/memory.h
winsup/mingw/include/process.h
winsup/mingw/include/search.h
winsup/mingw/include/setjmp.h
winsup/mingw/include/share.h
winsup/mingw/include/signal.h
winsup/mingw/include/stdint.h
winsup/mingw/include/stdio.h
winsup/mingw/include/stdlib.h
winsup/mingw/include/string.h
winsup/mingw/include/strings.h
winsup/mingw/include/sys/fcntl.h
winsup/mingw/include/sys/file.h
winsup/mingw/include/sys/locking.h
winsup/mingw/include/sys/param.h
winsup/mingw/include/sys/stat.h
winsup/mingw/include/sys/time.h
winsup/mingw/include/sys/timeb.h
winsup/mingw/include/sys/types.h
winsup/mingw/include/sys/unistd.h
winsup/mingw/include/sys/utime.h
winsup/mingw/include/tchar.h
winsup/mingw/include/time.h
winsup/mingw/include/unistd.h
winsup/mingw/include/utime.h
winsup/mingw/include/values.h
winsup/mingw/include/varargs.h
winsup/mingw/include/wchar.h
winsup/mingw/include/wctype.h
winsup/mingw/init.c
winsup/mingw/install-sh
winsup/mingw/isascii.c
winsup/mingw/iscsym.c
winsup/mingw/iscsymf.c
winsup/mingw/jamfile
winsup/mingw/main.c
winsup/mingw/man/dirname.man
winsup/mingw/mingwex/Makefile.in
winsup/mingw/mingwex/_Exit.c
winsup/mingw/mingwex/aclocal.m4
winsup/mingw/mingwex/atoll.c
winsup/mingw/mingwex/basename.c
winsup/mingw/mingwex/btowc.c
winsup/mingw/mingwex/complex/cabs.c
winsup/mingw/mingwex/complex/cabsf.c
winsup/mingw/mingwex/complex/cabsl.c
winsup/mingw/mingwex/complex/cacos.c
winsup/mingw/mingwex/complex/cacosf.c
winsup/mingw/mingwex/complex/cacosh.c
winsup/mingw/mingwex/complex/cacoshf.c
winsup/mingw/mingwex/complex/cacoshl.c
winsup/mingw/mingwex/complex/cacosl.c
winsup/mingw/mingwex/complex/carg.c
winsup/mingw/mingwex/complex/cargf.c
winsup/mingw/mingwex/complex/cargl.c
winsup/mingw/mingwex/complex/casin.c
winsup/mingw/mingwex/complex/casinf.c
winsup/mingw/mingwex/complex/casinh.c
winsup/mingw/mingwex/complex/casinhf.c
winsup/mingw/mingwex/complex/casinhl.c
winsup/mingw/mingwex/complex/casinl.c
winsup/mingw/mingwex/complex/catan.c
winsup/mingw/mingwex/complex/catanf.c
winsup/mingw/mingwex/complex/catanh.c
winsup/mingw/mingwex/complex/catanhf.c
winsup/mingw/mingwex/complex/catanhl.c
winsup/mingw/mingwex/complex/catanl.c
winsup/mingw/mingwex/complex/ccos.c
winsup/mingw/mingwex/complex/ccosf.c
winsup/mingw/mingwex/complex/ccosh.c
winsup/mingw/mingwex/complex/ccoshf.c
winsup/mingw/mingwex/complex/ccoshl.c
winsup/mingw/mingwex/complex/ccosl.c
winsup/mingw/mingwex/complex/cexp.c
winsup/mingw/mingwex/complex/cexpf.c
winsup/mingw/mingwex/complex/cexpl.c
winsup/mingw/mingwex/complex/cimag.c
winsup/mingw/mingwex/complex/cimagf.c
winsup/mingw/mingwex/complex/cimagl.c
winsup/mingw/mingwex/complex/clog.c
winsup/mingw/mingwex/complex/clogf.c
winsup/mingw/mingwex/complex/clogl.c
winsup/mingw/mingwex/complex/cpow.c
winsup/mingw/mingwex/complex/cpowf.c
winsup/mingw/mingwex/complex/cpowl.c
winsup/mingw/mingwex/complex/cproj.c
winsup/mingw/mingwex/complex/cprojf.c
winsup/mingw/mingwex/complex/cprojl.c
winsup/mingw/mingwex/complex/creal.c
winsup/mingw/mingwex/complex/crealf.c
winsup/mingw/mingwex/complex/creall.c
winsup/mingw/mingwex/complex/csin.c
winsup/mingw/mingwex/complex/csinf.c
winsup/mingw/mingwex/complex/csinh.c
winsup/mingw/mingwex/complex/csinhf.c
winsup/mingw/mingwex/complex/csinhl.c
winsup/mingw/mingwex/complex/csinl.c
winsup/mingw/mingwex/complex/csqrt.c
winsup/mingw/mingwex/complex/csqrtf.c
winsup/mingw/mingwex/complex/csqrtl.c
winsup/mingw/mingwex/complex/ctan.c
winsup/mingw/mingwex/complex/ctanf.c
winsup/mingw/mingwex/complex/ctanh.c
winsup/mingw/mingwex/complex/ctanhf.c
winsup/mingw/mingwex/complex/ctanhl.c
winsup/mingw/mingwex/complex/ctanl.c
winsup/mingw/mingwex/configure
winsup/mingw/mingwex/configure.in
winsup/mingw/mingwex/dirent.c
winsup/mingw/mingwex/dirname.c
winsup/mingw/mingwex/feclearexcept.c
winsup/mingw/mingwex/fegetenv.c
winsup/mingw/mingwex/fegetexceptflag.c
winsup/mingw/mingwex/fegetround.c
winsup/mingw/mingwex/feholdexcept.c
winsup/mingw/mingwex/feraiseexcept.c
winsup/mingw/mingwex/fesetenv.c
winsup/mingw/mingwex/fesetexceptflag.c
winsup/mingw/mingwex/fesetround.c
winsup/mingw/mingwex/fetestexcept.c
winsup/mingw/mingwex/feupdateenv.c
winsup/mingw/mingwex/ftruncate.c
winsup/mingw/mingwex/fwide.c
winsup/mingw/mingwex/gdtoa/README
winsup/mingw/mingwex/gdtoa/arithchk.c
winsup/mingw/mingwex/gdtoa/dmisc.c
winsup/mingw/mingwex/gdtoa/dtoa.c
winsup/mingw/mingwex/gdtoa/g__fmt.c
winsup/mingw/mingwex/gdtoa/g_dfmt.c
winsup/mingw/mingwex/gdtoa/g_ffmt.c
winsup/mingw/mingwex/gdtoa/g_xfmt.c
winsup/mingw/mingwex/gdtoa/gd_arith.h
winsup/mingw/mingwex/gdtoa/gd_qnan.h
winsup/mingw/mingwex/gdtoa/gdtoa.c
winsup/mingw/mingwex/gdtoa/gdtoa.h
winsup/mingw/mingwex/gdtoa/gdtoaimp.h
winsup/mingw/mingwex/gdtoa/gethex.c
winsup/mingw/mingwex/gdtoa/gmisc.c
winsup/mingw/mingwex/gdtoa/hd_init.c
winsup/mingw/mingwex/gdtoa/hexnan.c
winsup/mingw/mingwex/gdtoa/misc.c
winsup/mingw/mingwex/gdtoa/qnan.c
winsup/mingw/mingwex/gdtoa/smisc.c
winsup/mingw/mingwex/gdtoa/strtodg.c
winsup/mingw/mingwex/gdtoa/strtodnrp.c
winsup/mingw/mingwex/gdtoa/strtof.c
winsup/mingw/mingwex/gdtoa/strtopx.c
winsup/mingw/mingwex/gdtoa/sum.c
winsup/mingw/mingwex/gdtoa/ulp.c
winsup/mingw/mingwex/getopt.c
winsup/mingw/mingwex/gettimeofday.c
winsup/mingw/mingwex/imaxabs.c
winsup/mingw/mingwex/imaxdiv.c
winsup/mingw/mingwex/isblank.c
winsup/mingw/mingwex/iswblank.c
winsup/mingw/mingwex/lltoa.c
winsup/mingw/mingwex/lltow.c
winsup/mingw/mingwex/math/acosf.c
winsup/mingw/mingwex/math/acosh.c
winsup/mingw/mingwex/math/acoshf.c
winsup/mingw/mingwex/math/acoshl.c
winsup/mingw/mingwex/math/acosl.c
winsup/mingw/mingwex/math/asinf.c
winsup/mingw/mingwex/math/asinh.c
winsup/mingw/mingwex/math/asinhf.c
winsup/mingw/mingwex/math/asinhl.c
winsup/mingw/mingwex/math/asinl.c
winsup/mingw/mingwex/math/atan2f.c
winsup/mingw/mingwex/math/atan2l.c
winsup/mingw/mingwex/math/atanf.c
winsup/mingw/mingwex/math/atanh.c
winsup/mingw/mingwex/math/atanhf.c
winsup/mingw/mingwex/math/atanhl.c
winsup/mingw/mingwex/math/atanl.c
winsup/mingw/mingwex/math/cbrt.c
winsup/mingw/mingwex/math/cbrtf.c
winsup/mingw/mingwex/math/cbrtl.c
winsup/mingw/mingwex/math/ceilf.S
winsup/mingw/mingwex/math/ceill.S
winsup/mingw/mingwex/math/cephes_mconf.h
winsup/mingw/mingwex/math/copysign.S
winsup/mingw/mingwex/math/copysignf.S
winsup/mingw/mingwex/math/copysignl.S
winsup/mingw/mingwex/math/cosf.S
winsup/mingw/mingwex/math/coshf.c
winsup/mingw/mingwex/math/coshl.c
winsup/mingw/mingwex/math/cosl.S
winsup/mingw/mingwex/math/erfl.c
winsup/mingw/mingwex/math/exp2.S
winsup/mingw/mingwex/math/exp2f.S
winsup/mingw/mingwex/math/exp2l.S
winsup/mingw/mingwex/math/expf.c
winsup/mingw/mingwex/math/expl.c
winsup/mingw/mingwex/math/expm1.c
winsup/mingw/mingwex/math/expm1f.c
winsup/mingw/mingwex/math/expm1l.c
winsup/mingw/mingwex/math/fabs.c
winsup/mingw/mingwex/math/fabsf.c
winsup/mingw/mingwex/math/fabsl.c
winsup/mingw/mingwex/math/fastmath.h
winsup/mingw/mingwex/math/fdim.c
winsup/mingw/mingwex/math/fdimf.c
winsup/mingw/mingwex/math/fdiml.c
winsup/mingw/mingwex/math/floorf.S
winsup/mingw/mingwex/math/floorl.S
winsup/mingw/mingwex/math/fma.S
winsup/mingw/mingwex/math/fmaf.S
winsup/mingw/mingwex/math/fmal.c
winsup/mingw/mingwex/math/fmax.c
winsup/mingw/mingwex/math/fmaxf.c
winsup/mingw/mingwex/math/fmaxl.c
winsup/mingw/mingwex/math/fmin.c
winsup/mingw/mingwex/math/fminf.c
winsup/mingw/mingwex/math/fminl.c
winsup/mingw/mingwex/math/fmodf.c
winsup/mingw/mingwex/math/fmodl.c
winsup/mingw/mingwex/math/fp_consts.c
winsup/mingw/mingwex/math/fp_consts.h
winsup/mingw/mingwex/math/fp_constsf.c
winsup/mingw/mingwex/math/fp_constsl.c
winsup/mingw/mingwex/math/fpclassify.c
winsup/mingw/mingwex/math/fpclassifyf.c
winsup/mingw/mingwex/math/fpclassifyl.c
winsup/mingw/mingwex/math/frexpf.c
winsup/mingw/mingwex/math/frexpl.S
winsup/mingw/mingwex/math/fucom.c
winsup/mingw/mingwex/math/hypotf.c
winsup/mingw/mingwex/math/hypotl.c
winsup/mingw/mingwex/math/ilogb.S
winsup/mingw/mingwex/math/ilogbf.S
winsup/mingw/mingwex/math/ilogbl.S
winsup/mingw/mingwex/math/isnan.c
winsup/mingw/mingwex/math/isnanf.c
winsup/mingw/mingwex/math/isnanl.c
winsup/mingw/mingwex/math/ldexpf.c
winsup/mingw/mingwex/math/ldexpl.c
winsup/mingw/mingwex/math/lgamma.c
winsup/mingw/mingwex/math/lgammaf.c
winsup/mingw/mingwex/math/lgammal.c
winsup/mingw/mingwex/math/llrint.c
winsup/mingw/mingwex/math/llrintf.c
winsup/mingw/mingwex/math/llrintl.c
winsup/mingw/mingwex/math/log10f.S
winsup/mingw/mingwex/math/log10l.S
winsup/mingw/mingwex/math/log1p.S
winsup/mingw/mingwex/math/log1pf.S
winsup/mingw/mingwex/math/log1pl.S
winsup/mingw/mingwex/math/log2.S
winsup/mingw/mingwex/math/log2f.S
winsup/mingw/mingwex/math/log2l.S
winsup/mingw/mingwex/math/logb.c
winsup/mingw/mingwex/math/logbf.c
winsup/mingw/mingwex/math/logbl.c
winsup/mingw/mingwex/math/logf.S
winsup/mingw/mingwex/math/logl.S
winsup/mingw/mingwex/math/lrint.c
winsup/mingw/mingwex/math/lrintf.c
winsup/mingw/mingwex/math/lrintl.c
winsup/mingw/mingwex/math/lround_generic.c
winsup/mingw/mingwex/math/modff.c
winsup/mingw/mingwex/math/modfl.c
winsup/mingw/mingwex/math/nearbyint.S
winsup/mingw/mingwex/math/nearbyintf.S
winsup/mingw/mingwex/math/nearbyintl.S
winsup/mingw/mingwex/math/nextafterf.c
winsup/mingw/mingwex/math/nextafterl.c
winsup/mingw/mingwex/math/nexttoward.c
winsup/mingw/mingwex/math/nexttowardf.c
winsup/mingw/mingwex/math/pow.c
winsup/mingw/mingwex/math/powf.c
winsup/mingw/mingwex/math/powi.c
winsup/mingw/mingwex/math/powif.c
winsup/mingw/mingwex/math/powil.c
winsup/mingw/mingwex/math/powl.c
winsup/mingw/mingwex/math/remainder.S
winsup/mingw/mingwex/math/remainderf.S
winsup/mingw/mingwex/math/remainderl.S
winsup/mingw/mingwex/math/remquo.S
winsup/mingw/mingwex/math/remquof.S
winsup/mingw/mingwex/math/remquol.S
winsup/mingw/mingwex/math/rint.c
winsup/mingw/mingwex/math/rintf.c
winsup/mingw/mingwex/math/rintl.c
winsup/mingw/mingwex/math/round_generic.c
winsup/mingw/mingwex/math/round_internal.h
winsup/mingw/mingwex/math/s_erf.c
winsup/mingw/mingwex/math/scalbn.S
winsup/mingw/mingwex/math/scalbnf.S
winsup/mingw/mingwex/math/scalbnl.S
winsup/mingw/mingwex/math/sf_erf.c
winsup/mingw/mingwex/math/signbit.c
winsup/mingw/mingwex/math/signbitf.c
winsup/mingw/mingwex/math/signbitl.c
winsup/mingw/mingwex/math/sinf.S
winsup/mingw/mingwex/math/sinhf.c
winsup/mingw/mingwex/math/sinhl.c
winsup/mingw/mingwex/math/sinl.S
winsup/mingw/mingwex/math/sqrtf.c
winsup/mingw/mingwex/math/sqrtl.c
winsup/mingw/mingwex/math/tanf.S
winsup/mingw/mingwex/math/tanhf.c
winsup/mingw/mingwex/math/tanhl.c
winsup/mingw/mingwex/math/tanl.S
winsup/mingw/mingwex/math/tgamma.c
winsup/mingw/mingwex/math/tgammaf.c
winsup/mingw/mingwex/math/tgammal.c
winsup/mingw/mingwex/math/trunc.c
winsup/mingw/mingwex/math/truncf.c
winsup/mingw/mingwex/math/truncl.c
winsup/mingw/mingwex/mb_wc_common.h
winsup/mingw/mingwex/mbrtowc.c
winsup/mingw/mingwex/mbsinit.c
winsup/mingw/mingwex/mingw-aligned-malloc.c
winsup/mingw/mingwex/mingw-fseek.c
winsup/mingw/mingwex/sitest.c
winsup/mingw/mingwex/stdio/fopen64.c
winsup/mingw/mingwex/stdio/fprintf.c
winsup/mingw/mingwex/stdio/fseeko64.c
winsup/mingw/mingwex/stdio/ftello64.c
winsup/mingw/mingwex/stdio/lseek64.c
winsup/mingw/mingwex/stdio/pformat.c
winsup/mingw/mingwex/stdio/pformat.h
winsup/mingw/mingwex/stdio/printf.c
winsup/mingw/mingwex/stdio/snprintf.c
winsup/mingw/mingwex/stdio/snwprintf.c
winsup/mingw/mingwex/stdio/sprintf.c
winsup/mingw/mingwex/stdio/vfprintf.c
winsup/mingw/mingwex/stdio/vfscanf.c
winsup/mingw/mingwex/stdio/vfwscanf.c
winsup/mingw/mingwex/stdio/vprintf.c
winsup/mingw/mingwex/stdio/vscanf.c
winsup/mingw/mingwex/stdio/vsnprintf.c
winsup/mingw/mingwex/stdio/vsnwprintf.c
winsup/mingw/mingwex/stdio/vsprintf.c
winsup/mingw/mingwex/stdio/vsscanf.c
winsup/mingw/mingwex/stdio/vswscanf.c
winsup/mingw/mingwex/stdio/vwscanf.c
winsup/mingw/mingwex/strtoimax.c
winsup/mingw/mingwex/strtoumax.c
winsup/mingw/mingwex/tdelete.c
winsup/mingw/mingwex/testwmem.c
winsup/mingw/mingwex/tfind.c
winsup/mingw/mingwex/tsearch.c
winsup/mingw/mingwex/tst-aligned-malloc.c
winsup/mingw/mingwex/twalk.c
winsup/mingw/mingwex/ulltoa.c
winsup/mingw/mingwex/ulltow.c
winsup/mingw/mingwex/usleep.c
winsup/mingw/mingwex/wcrtomb.c
winsup/mingw/mingwex/wcstof.c
winsup/mingw/mingwex/wcstoimax.c
winsup/mingw/mingwex/wcstold.c
winsup/mingw/mingwex/wcstoumax.c
winsup/mingw/mingwex/wctob.c
winsup/mingw/mingwex/wctrans.c
winsup/mingw/mingwex/wctype.c
winsup/mingw/mingwex/wdirent.c
winsup/mingw/mingwex/wmemchr.c
winsup/mingw/mingwex/wmemcmp.c
winsup/mingw/mingwex/wmemcpy.c
winsup/mingw/mingwex/wmemmove.c
winsup/mingw/mingwex/wmemset.c
winsup/mingw/mingwex/wtoll.c
winsup/mingw/mkinstalldirs
winsup/mingw/moldname.def.in
winsup/mingw/msvcrt.def.in
winsup/mingw/mthr.c
winsup/mingw/mthr_init.c
winsup/mingw/mthr_stub.c
winsup/mingw/ofmt_stub.s
winsup/mingw/profile/COPYING
winsup/mingw/profile/CYGWIN_LICENSE
winsup/mingw/profile/Makefile.in
winsup/mingw/profile/aclocal.m4
winsup/mingw/profile/configure
winsup/mingw/profile/configure.in
winsup/mingw/profile/gcrt0.c
winsup/mingw/profile/gmon.c
winsup/mingw/profile/gmon.h
winsup/mingw/profile/mcount.c
winsup/mingw/profile/profil.c
winsup/mingw/profile/profil.h
winsup/mingw/profile/profile.h
winsup/mingw/pseudo-reloc-list.c
winsup/mingw/pseudo-reloc.c
winsup/mingw/readme.txt
winsup/mingw/samples/dirent/jamfile
winsup/mingw/samples/dirent/test.c
winsup/mingw/samples/dirent/wtest.c
winsup/mingw/samples/dlltest/dll.c
winsup/mingw/samples/dlltest/dll.def
winsup/mingw/samples/dlltest/dll.h
winsup/mingw/samples/dlltest/exe.c
winsup/mingw/samples/dlltest/exe.exp
winsup/mingw/samples/dlltest/expexe.c
winsup/mingw/samples/dlltest/expexe.def
winsup/mingw/samples/dlltest/jamfile
winsup/mingw/samples/dlltest/loaddll.c
winsup/mingw/samples/dlltest/loadexe.c
winsup/mingw/samples/dlltest/readme.txt
winsup/mingw/samples/dlltest/silly.cpp
winsup/mingw/samples/dlltest/silly.def
winsup/mingw/samples/dlltest/silly.exp
winsup/mingw/samples/dlltest/silly.h
winsup/mingw/samples/dlltest/sillydll.cpp
winsup/mingw/samples/filehand/filehand.c
winsup/mingw/samples/filehand/jamfile
winsup/mingw/samples/filehand/junk.txt
winsup/mingw/samples/fixargv/fixargv.c
winsup/mingw/samples/fixargv/fixargv.h
winsup/mingw/samples/fixargv/readme.txt
winsup/mingw/samples/fmode/all.c
winsup/mingw/samples/fmode/jamfile
winsup/mingw/samples/fmode/readme.txt
winsup/mingw/samples/fmode/test.c
winsup/mingw/samples/fmode/test2.c
winsup/mingw/samples/globbing/glob.c
winsup/mingw/samples/globbing/jamfile
winsup/mingw/samples/globbing/noglob.c
winsup/mingw/samples/globbing/readme.txt
winsup/mingw/samples/print/jamfile
winsup/mingw/samples/print/prntest.c
winsup/mingw/samples/seh/eh3.c
winsup/mingw/samples/seh/exutil.c
winsup/mingw/samples/seh/exutil.def
winsup/mingw/samples/seh/exutil.h
winsup/mingw/samples/seh/jamfile
winsup/mingw/samples/seh/sehfix.c
winsup/mingw/samples/seh/sehsub.c
winsup/mingw/samples/seh/sehtest.c
winsup/mingw/samples/simpledll/dll.c
winsup/mingw/samples/simpledll/dll.cpp
winsup/mingw/samples/simpledll/dll.def
winsup/mingw/samples/simpledll/exe.c
winsup/mingw/samples/simpledll/jamfile
winsup/mingw/samples/simpledll/makedll.bat
winsup/mingw/samples/test/jamfile
winsup/mingw/samples/test/test.c
winsup/mingw/samples/wintest/jamfile
winsup/mingw/samples/wintest/test.c
winsup/mingw/strcasecmp.c
winsup/mingw/strncasecmp.c
winsup/mingw/test_headers.c
winsup/mingw/toascii.c
winsup/mingw/txtmode.c
winsup/mingw/wcscmpi.c
winsup/testsuite/ChangeLog
winsup/testsuite/Makefile.in
winsup/testsuite/README
winsup/testsuite/aclocal.m4
winsup/testsuite/config/default.exp
winsup/testsuite/configure
winsup/testsuite/configure.in
winsup/testsuite/cygrun.c
winsup/testsuite/libltp/include/dataascii.h
winsup/testsuite/libltp/include/databin.h
winsup/testsuite/libltp/include/file_lock.h
winsup/testsuite/libltp/include/forker.h
winsup/testsuite/libltp/include/open_flags.h
winsup/testsuite/libltp/include/pattern.h
winsup/testsuite/libltp/include/random_range.h
winsup/testsuite/libltp/include/rmobj.h
winsup/testsuite/libltp/include/search_path.h
winsup/testsuite/libltp/include/str_to_bytes.h
winsup/testsuite/libltp/include/string_to_tokens.h
winsup/testsuite/libltp/include/test.h
winsup/testsuite/libltp/include/tlibio.h
winsup/testsuite/libltp/include/usctest.h
winsup/testsuite/libltp/include/write_log.h
winsup/testsuite/libltp/lib/dataascii.c
winsup/testsuite/libltp/lib/databin.c
winsup/testsuite/libltp/lib/datapid.c
winsup/testsuite/libltp/lib/forker.c
winsup/testsuite/libltp/lib/get_high_address.c
winsup/testsuite/libltp/lib/libtestsuite.c
winsup/testsuite/libltp/lib/open_flags.c
winsup/testsuite/libltp/lib/parse_opts.c
winsup/testsuite/libltp/lib/pattern.c
winsup/testsuite/libltp/lib/rmobj.c
winsup/testsuite/libltp/lib/search_path.c
winsup/testsuite/libltp/lib/str_to_bytes.c
winsup/testsuite/libltp/lib/string_to_tokens.c
winsup/testsuite/libltp/lib/tst_res.c
winsup/testsuite/libltp/lib/tst_sig.c
winsup/testsuite/libltp/lib/tst_tmpdir.c
winsup/testsuite/libltp/lib/write_log.c
winsup/testsuite/winsup.api/checksignal.c
winsup/testsuite/winsup.api/crlf.c
winsup/testsuite/winsup.api/cygload.cc
winsup/testsuite/winsup.api/cygload.exp
winsup/testsuite/winsup.api/cygload.h
winsup/testsuite/winsup.api/devdsp.c
winsup/testsuite/winsup.api/devdsp_okay.h
winsup/testsuite/winsup.api/devzero.c
winsup/testsuite/winsup.api/iospeed.c
winsup/testsuite/winsup.api/known_bugs.tcl
winsup/testsuite/winsup.api/ltp/access01.c
winsup/testsuite/winsup.api/ltp/access03.c
winsup/testsuite/winsup.api/ltp/access04.c
winsup/testsuite/winsup.api/ltp/access05.c
winsup/testsuite/winsup.api/ltp/alarm01.c
winsup/testsuite/winsup.api/ltp/alarm02.c
winsup/testsuite/winsup.api/ltp/alarm03.c
winsup/testsuite/winsup.api/ltp/alarm07.c
winsup/testsuite/winsup.api/ltp/asyncio02.c
winsup/testsuite/winsup.api/ltp/chdir02.c
winsup/testsuite/winsup.api/ltp/chdir04.c
winsup/testsuite/winsup.api/ltp/chmod01.c
winsup/testsuite/winsup.api/ltp/chmod02.c
winsup/testsuite/winsup.api/ltp/chown01.c
winsup/testsuite/winsup.api/ltp/close01.c
winsup/testsuite/winsup.api/ltp/close02.c
winsup/testsuite/winsup.api/ltp/close08.c
winsup/testsuite/winsup.api/ltp/creat01.c
winsup/testsuite/winsup.api/ltp/creat03.c
winsup/testsuite/winsup.api/ltp/creat09.c
winsup/testsuite/winsup.api/ltp/dup01.c
winsup/testsuite/winsup.api/ltp/dup02.c
winsup/testsuite/winsup.api/ltp/dup03.c
winsup/testsuite/winsup.api/ltp/dup04.c
winsup/testsuite/winsup.api/ltp/dup05.c
winsup/testsuite/winsup.api/ltp/execl01.c
winsup/testsuite/winsup.api/ltp/execle01.c
winsup/testsuite/winsup.api/ltp/execlp01.c
winsup/testsuite/winsup.api/ltp/execv01.c
winsup/testsuite/winsup.api/ltp/execve01.c
winsup/testsuite/winsup.api/ltp/execvp01.c
winsup/testsuite/winsup.api/ltp/exit01.c
winsup/testsuite/winsup.api/ltp/exit02.c
winsup/testsuite/winsup.api/ltp/fchdir01.c
winsup/testsuite/winsup.api/ltp/fchdir02.c
winsup/testsuite/winsup.api/ltp/fchmod01.c
winsup/testsuite/winsup.api/ltp/fchown01.c
winsup/testsuite/winsup.api/ltp/fcntl02.c
winsup/testsuite/winsup.api/ltp/fcntl03.c
winsup/testsuite/winsup.api/ltp/fcntl04.c
winsup/testsuite/winsup.api/ltp/fcntl05.c
winsup/testsuite/winsup.api/ltp/fcntl07.c
winsup/testsuite/winsup.api/ltp/fcntl07B.c
winsup/testsuite/winsup.api/ltp/fcntl08.c
winsup/testsuite/winsup.api/ltp/fcntl09.c
winsup/testsuite/winsup.api/ltp/fcntl10.c
winsup/testsuite/winsup.api/ltp/fork01.c
winsup/testsuite/winsup.api/ltp/fork02.c
winsup/testsuite/winsup.api/ltp/fork03.c
winsup/testsuite/winsup.api/ltp/fork04.c
winsup/testsuite/winsup.api/ltp/fork06.c
winsup/testsuite/winsup.api/ltp/fork07.c
winsup/testsuite/winsup.api/ltp/fork09.c
winsup/testsuite/winsup.api/ltp/fork10.c
winsup/testsuite/winsup.api/ltp/fork11.c
winsup/testsuite/winsup.api/ltp/fpathconf01.c
winsup/testsuite/winsup.api/ltp/fstat01.c
winsup/testsuite/winsup.api/ltp/fstat02.c
winsup/testsuite/winsup.api/ltp/fstat03.c
winsup/testsuite/winsup.api/ltp/fstat04.c
winsup/testsuite/winsup.api/ltp/fsync01.c
winsup/testsuite/winsup.api/ltp/ftruncate01.c
winsup/testsuite/winsup.api/ltp/ftruncate02.c
winsup/testsuite/winsup.api/ltp/ftruncate03.c
winsup/testsuite/winsup.api/ltp/getegid01.c
winsup/testsuite/winsup.api/ltp/geteuid01.c
winsup/testsuite/winsup.api/ltp/getgid01.c
winsup/testsuite/winsup.api/ltp/getgid02.c
winsup/testsuite/winsup.api/ltp/getgid03.c
winsup/testsuite/winsup.api/ltp/getgroups01.c
winsup/testsuite/winsup.api/ltp/getgroups02.c
winsup/testsuite/winsup.api/ltp/gethostid01.c
winsup/testsuite/winsup.api/ltp/gethostname01.c
winsup/testsuite/winsup.api/ltp/getpgid01.c
winsup/testsuite/winsup.api/ltp/getpgid02.c
winsup/testsuite/winsup.api/ltp/getpgrp01.c
winsup/testsuite/winsup.api/ltp/getpid01.c
winsup/testsuite/winsup.api/ltp/getpid02.c
winsup/testsuite/winsup.api/ltp/getppid01.c
winsup/testsuite/winsup.api/ltp/getppid02.c
winsup/testsuite/winsup.api/ltp/getuid01.c
winsup/testsuite/winsup.api/ltp/getuid02.c
winsup/testsuite/winsup.api/ltp/getuid03.c
winsup/testsuite/winsup.api/ltp/kill01.c
winsup/testsuite/winsup.api/ltp/kill02.c
winsup/testsuite/winsup.api/ltp/kill03.c
winsup/testsuite/winsup.api/ltp/kill04.c
winsup/testsuite/winsup.api/ltp/kill09.c
winsup/testsuite/winsup.api/ltp/link02.c
winsup/testsuite/winsup.api/ltp/link03.c
winsup/testsuite/winsup.api/ltp/link04.c
winsup/testsuite/winsup.api/ltp/link05.c
winsup/testsuite/winsup.api/ltp/lseek01.c
winsup/testsuite/winsup.api/ltp/lseek02.c
winsup/testsuite/winsup.api/ltp/lseek03.c
winsup/testsuite/winsup.api/ltp/lseek04.c
winsup/testsuite/winsup.api/ltp/lseek05.c
winsup/testsuite/winsup.api/ltp/lseek06.c
winsup/testsuite/winsup.api/ltp/lseek07.c
winsup/testsuite/winsup.api/ltp/lseek08.c
winsup/testsuite/winsup.api/ltp/lseek09.c
winsup/testsuite/winsup.api/ltp/lseek10.c
winsup/testsuite/winsup.api/ltp/lstat02.c
winsup/testsuite/winsup.api/ltp/mkdir01.c
winsup/testsuite/winsup.api/ltp/mkdir08.c
winsup/testsuite/winsup.api/ltp/mknod01.c
winsup/testsuite/winsup.api/ltp/mmap001.c
winsup/testsuite/winsup.api/ltp/mmap02.c
winsup/testsuite/winsup.api/ltp/mmap03.c
winsup/testsuite/winsup.api/ltp/mmap04.c
winsup/testsuite/winsup.api/ltp/mmap05.c
winsup/testsuite/winsup.api/ltp/mmap06.c
winsup/testsuite/winsup.api/ltp/mmap07.c
winsup/testsuite/winsup.api/ltp/mmap08.c
winsup/testsuite/winsup.api/ltp/munmap01.c
winsup/testsuite/winsup.api/ltp/munmap02.c
winsup/testsuite/winsup.api/ltp/nice05.c
winsup/testsuite/winsup.api/ltp/open02.c
winsup/testsuite/winsup.api/ltp/open03.c
winsup/testsuite/winsup.api/ltp/pathconf01.c
winsup/testsuite/winsup.api/ltp/pause01.c
winsup/testsuite/winsup.api/ltp/pipe01.c
winsup/testsuite/winsup.api/ltp/pipe08.c
winsup/testsuite/winsup.api/ltp/pipe09.c
winsup/testsuite/winsup.api/ltp/pipe10.c
winsup/testsuite/winsup.api/ltp/pipe11.c
winsup/testsuite/winsup.api/ltp/poll01.c
winsup/testsuite/winsup.api/ltp/read01.c
winsup/testsuite/winsup.api/ltp/read04.c
winsup/testsuite/winsup.api/ltp/readdir01.c
winsup/testsuite/winsup.api/ltp/readlink01.c
winsup/testsuite/winsup.api/ltp/readlink02.c
winsup/testsuite/winsup.api/ltp/readlink03.c
winsup/testsuite/winsup.api/ltp/rename01.c
winsup/testsuite/winsup.api/ltp/rename02.c
winsup/testsuite/winsup.api/ltp/rename08.c
winsup/testsuite/winsup.api/ltp/rename10.c
winsup/testsuite/winsup.api/ltp/rmdir01.c
winsup/testsuite/winsup.api/ltp/rmdir04.c
winsup/testsuite/winsup.api/ltp/rmdir05.c
winsup/testsuite/winsup.api/ltp/sbrk01.c
winsup/testsuite/winsup.api/ltp/select01.c
winsup/testsuite/winsup.api/ltp/select02.c
winsup/testsuite/winsup.api/ltp/select03.c
winsup/testsuite/winsup.api/ltp/setgid01.c
winsup/testsuite/winsup.api/ltp/setgroups01.c
winsup/testsuite/winsup.api/ltp/setpgid01.c
winsup/testsuite/winsup.api/ltp/setregid01.c
winsup/testsuite/winsup.api/ltp/setreuid01.c
winsup/testsuite/winsup.api/ltp/setuid01.c
winsup/testsuite/winsup.api/ltp/setuid02.c
winsup/testsuite/winsup.api/ltp/signal03.c
winsup/testsuite/winsup.api/ltp/stat01.c
winsup/testsuite/winsup.api/ltp/stat02.c
winsup/testsuite/winsup.api/ltp/stat03.c
winsup/testsuite/winsup.api/ltp/stat05.c
winsup/testsuite/winsup.api/ltp/stat06.c
winsup/testsuite/winsup.api/ltp/symlink01.c
winsup/testsuite/winsup.api/ltp/symlink02.c
winsup/testsuite/winsup.api/ltp/symlink03.c
winsup/testsuite/winsup.api/ltp/symlink04.c
winsup/testsuite/winsup.api/ltp/symlink05.c
winsup/testsuite/winsup.api/ltp/sync01.c
winsup/testsuite/winsup.api/ltp/sync02.c
winsup/testsuite/winsup.api/ltp/time01.c
winsup/testsuite/winsup.api/ltp/time02.c
winsup/testsuite/winsup.api/ltp/times01.c
winsup/testsuite/winsup.api/ltp/times02.c
winsup/testsuite/winsup.api/ltp/times03.c
winsup/testsuite/winsup.api/ltp/truncate01.c
winsup/testsuite/winsup.api/ltp/truncate02.c
winsup/testsuite/winsup.api/ltp/ulimit01.c
winsup/testsuite/winsup.api/ltp/umask01.c
winsup/testsuite/winsup.api/ltp/umask02.c
winsup/testsuite/winsup.api/ltp/umask03.c
winsup/testsuite/winsup.api/ltp/uname01.c
winsup/testsuite/winsup.api/ltp/unlink05.c
winsup/testsuite/winsup.api/ltp/unlink06.c
winsup/testsuite/winsup.api/ltp/unlink07.c
winsup/testsuite/winsup.api/ltp/unlink08.c
winsup/testsuite/winsup.api/ltp/vfork01.c
winsup/testsuite/winsup.api/ltp/wait02.c
winsup/testsuite/winsup.api/ltp/wait401.c
winsup/testsuite/winsup.api/ltp/wait402.c
winsup/testsuite/winsup.api/ltp/write01.c
winsup/testsuite/winsup.api/ltp/write02.c
winsup/testsuite/winsup.api/ltp/write03.c
winsup/testsuite/winsup.api/mmaptest01.c
winsup/testsuite/winsup.api/mmaptest02.c
winsup/testsuite/winsup.api/mmaptest03.c
winsup/testsuite/winsup.api/mmaptest04.c
winsup/testsuite/winsup.api/msgtest.c
winsup/testsuite/winsup.api/nullgetcwd.c
winsup/testsuite/winsup.api/pthread/cancel1.c
winsup/testsuite/winsup.api/pthread/cancel10.c
winsup/testsuite/winsup.api/pthread/cancel11.c
winsup/testsuite/winsup.api/pthread/cancel12.c
winsup/testsuite/winsup.api/pthread/cancel2.c
winsup/testsuite/winsup.api/pthread/cancel3.c
winsup/testsuite/winsup.api/pthread/cancel4.c
winsup/testsuite/winsup.api/pthread/cancel5.c
winsup/testsuite/winsup.api/pthread/cancel6.c
winsup/testsuite/winsup.api/pthread/cancel7.c
winsup/testsuite/winsup.api/pthread/cancel8.c
winsup/testsuite/winsup.api/pthread/cancel9.c
winsup/testsuite/winsup.api/pthread/cleanup2.c
winsup/testsuite/winsup.api/pthread/cleanup3.c
winsup/testsuite/winsup.api/pthread/condvar1.c
winsup/testsuite/winsup.api/pthread/condvar2.c
winsup/testsuite/winsup.api/pthread/condvar2_1.c
winsup/testsuite/winsup.api/pthread/condvar3.c
winsup/testsuite/winsup.api/pthread/condvar3_1.c
winsup/testsuite/winsup.api/pthread/condvar3_2.c
winsup/testsuite/winsup.api/pthread/condvar3_3.c
winsup/testsuite/winsup.api/pthread/condvar4.c
winsup/testsuite/winsup.api/pthread/condvar5.c
winsup/testsuite/winsup.api/pthread/condvar6.c
winsup/testsuite/winsup.api/pthread/condvar7.c
winsup/testsuite/winsup.api/pthread/condvar8.c
winsup/testsuite/winsup.api/pthread/condvar9.c
winsup/testsuite/winsup.api/pthread/count1.c
winsup/testsuite/winsup.api/pthread/create1.c
winsup/testsuite/winsup.api/pthread/create2.c
winsup/testsuite/winsup.api/pthread/equal1.c
winsup/testsuite/winsup.api/pthread/exit1.c
winsup/testsuite/winsup.api/pthread/exit2.c
winsup/testsuite/winsup.api/pthread/exit3.c
winsup/testsuite/winsup.api/pthread/inherit1.c
winsup/testsuite/winsup.api/pthread/join0.c
winsup/testsuite/winsup.api/pthread/join1.c
winsup/testsuite/winsup.api/pthread/join2.c
winsup/testsuite/winsup.api/pthread/mainthreadexits.c
winsup/testsuite/winsup.api/pthread/mutex1.c
winsup/testsuite/winsup.api/pthread/mutex1d.c
winsup/testsuite/winsup.api/pthread/mutex1e.c
winsup/testsuite/winsup.api/pthread/mutex1n.c
winsup/testsuite/winsup.api/pthread/mutex1r.c
winsup/testsuite/winsup.api/pthread/mutex2.c
winsup/testsuite/winsup.api/pthread/mutex3.c
winsup/testsuite/winsup.api/pthread/mutex4.c
winsup/testsuite/winsup.api/pthread/mutex5.c
winsup/testsuite/winsup.api/pthread/mutex6d.c
winsup/testsuite/winsup.api/pthread/mutex6e.c
winsup/testsuite/winsup.api/pthread/mutex6n.c
winsup/testsuite/winsup.api/pthread/mutex6r.c
winsup/testsuite/winsup.api/pthread/mutex7.c
winsup/testsuite/winsup.api/pthread/mutex7d.c
winsup/testsuite/winsup.api/pthread/mutex7e.c
winsup/testsuite/winsup.api/pthread/mutex7n.c
winsup/testsuite/winsup.api/pthread/mutex7r.c
winsup/testsuite/winsup.api/pthread/mutex8e.c
winsup/testsuite/winsup.api/pthread/mutex8n.c
winsup/testsuite/winsup.api/pthread/mutex8r.c
winsup/testsuite/winsup.api/pthread/once1.c
winsup/testsuite/winsup.api/pthread/priority1.c
winsup/testsuite/winsup.api/pthread/priority2.c
winsup/testsuite/winsup.api/pthread/rwlock1.c
winsup/testsuite/winsup.api/pthread/rwlock2.c
winsup/testsuite/winsup.api/pthread/rwlock3.c
winsup/testsuite/winsup.api/pthread/rwlock4.c
winsup/testsuite/winsup.api/pthread/rwlock5.c
winsup/testsuite/winsup.api/pthread/rwlock6.c
winsup/testsuite/winsup.api/pthread/rwlock7.c
winsup/testsuite/winsup.api/pthread/self1.c
winsup/testsuite/winsup.api/pthread/self2.c
winsup/testsuite/winsup.api/pthread/test.h
winsup/testsuite/winsup.api/pthread/threadidafterfork.c
winsup/testsuite/winsup.api/pthread/tsd1.c
winsup/testsuite/winsup.api/resethand.c
winsup/testsuite/winsup.api/samples/sample-fail.c
winsup/testsuite/winsup.api/samples/sample-miscompile.c
winsup/testsuite/winsup.api/samples/sample-pass.c
winsup/testsuite/winsup.api/semtest.c
winsup/testsuite/winsup.api/shmtest.c
winsup/testsuite/winsup.api/sigchld.c
winsup/testsuite/winsup.api/signal-into-win32-api.c
winsup/testsuite/winsup.api/systemcall.c
winsup/testsuite/winsup.api/user_malloc.c
winsup/testsuite/winsup.api/waitpid.c
winsup/testsuite/winsup.api/winsup.exp
winsup/utils/COPYING.dumper
winsup/utils/ChangeLog
winsup/utils/ChangeLog-2000
winsup/utils/Makefile.in
winsup/utils/aclocal.m4
winsup/utils/bloda.cc
winsup/utils/configure
winsup/utils/configure.in
winsup/utils/cygcheck.cc
winsup/utils/cygpath.cc
winsup/utils/dump_setup.cc
winsup/utils/dumper.cc
winsup/utils/dumper.h
winsup/utils/getfacl.c
winsup/utils/kill.cc
winsup/utils/mingw
winsup/utils/mkgroup.c
winsup/utils/mkpasswd.c
winsup/utils/module_info.cc
winsup/utils/mount.cc
winsup/utils/parse_pe.cc
winsup/utils/passwd.c
winsup/utils/path.cc
winsup/utils/path.h
winsup/utils/ps.cc
winsup/utils/regtool.cc
winsup/utils/setfacl.c
winsup/utils/setmetamode.c
winsup/utils/ssp.c
winsup/utils/ssp.txt
winsup/utils/strace.cc
winsup/utils/testsuite.cc
winsup/utils/testsuite.h
winsup/utils/umount.cc
winsup/utils/utils.sgml
winsup/w32api/CONTRIBUTIONS
winsup/w32api/ChangeLog
winsup/w32api/Makefile.in
winsup/w32api/README.w32api
winsup/w32api/TODO
winsup/w32api/aclocal.m4
winsup/w32api/config.guess
winsup/w32api/config.sub
winsup/w32api/configure
winsup/w32api/configure.in
winsup/w32api/include/GL/gl.h
winsup/w32api/include/GL/glext.h
winsup/w32api/include/GL/glu.h
winsup/w32api/include/accctrl.h
winsup/w32api/include/aclapi.h
winsup/w32api/include/aclui.h
winsup/w32api/include/adsprop.h
winsup/w32api/include/afxres.h
winsup/w32api/include/amaudio.h
winsup/w32api/include/amvideo.h
winsup/w32api/include/audevcod.h
winsup/w32api/include/aviriff.h
winsup/w32api/include/aygshell.h
winsup/w32api/include/basetsd.h
winsup/w32api/include/basetyps.h
winsup/w32api/include/bdatypes.h
winsup/w32api/include/cderr.h
winsup/w32api/include/cguid.h
winsup/w32api/include/cmnquery.h
winsup/w32api/include/comcat.h
winsup/w32api/include/commctrl.h
winsup/w32api/include/commdlg.h
winsup/w32api/include/control.h
winsup/w32api/include/cpl.h
winsup/w32api/include/cplext.h
winsup/w32api/include/custcntl.h
winsup/w32api/include/dbt.h
winsup/w32api/include/dde.h
winsup/w32api/include/ddeml.h
winsup/w32api/include/ddk/atm.h
winsup/w32api/include/ddk/batclass.h
winsup/w32api/include/ddk/cfg.h
winsup/w32api/include/ddk/cfgmgr32.h
winsup/w32api/include/ddk/d4drvif.h
winsup/w32api/include/ddk/d4iface.h
winsup/w32api/include/ddk/ddkmapi.h
winsup/w32api/include/ddk/hidclass.h
winsup/w32api/include/ddk/hidpi.h
winsup/w32api/include/ddk/hidsdi.h
winsup/w32api/include/ddk/hidusage.h
winsup/w32api/include/ddk/kbdmou.h
winsup/w32api/include/ddk/mcd.h
winsup/w32api/include/ddk/miniport.h
winsup/w32api/include/ddk/minitape.h
winsup/w32api/include/ddk/mountdev.h
winsup/w32api/include/ddk/mountmgr.h
winsup/w32api/include/ddk/ndis.h
winsup/w32api/include/ddk/ndisguid.h
winsup/w32api/include/ddk/ndistapi.h
winsup/w32api/include/ddk/ndiswan.h
winsup/w32api/include/ddk/netevent.h
winsup/w32api/include/ddk/netpnp.h
winsup/w32api/include/ddk/newdev.h
winsup/w32api/include/ddk/ntapi.h
winsup/w32api/include/ddk/ntdd8042.h
winsup/w32api/include/ddk/ntddbeep.h
winsup/w32api/include/ddk/ntddcdrm.h
winsup/w32api/include/ddk/ntddcdvd.h
winsup/w32api/include/ddk/ntddchgr.h
winsup/w32api/include/ddk/ntdddisk.h
winsup/w32api/include/ddk/ntddk.h
winsup/w32api/include/ddk/ntddkbd.h
winsup/w32api/include/ddk/ntddmou.h
winsup/w32api/include/ddk/ntddndis.h
winsup/w32api/include/ddk/ntddpar.h
winsup/w32api/include/ddk/ntddpcm.h
winsup/w32api/include/ddk/ntddscsi.h
winsup/w32api/include/ddk/ntddser.h
winsup/w32api/include/ddk/ntddstor.h
winsup/w32api/include/ddk/ntddtape.h
winsup/w32api/include/ddk/ntddtdi.h
winsup/w32api/include/ddk/ntddvdeo.h
winsup/w32api/include/ddk/ntddvol.h
winsup/w32api/include/ddk/ntifs.h
winsup/w32api/include/ddk/ntpoapi.h
winsup/w32api/include/ddk/ntstatus.h
winsup/w32api/include/ddk/parallel.h
winsup/w32api/include/ddk/pfhook.h
winsup/w32api/include/ddk/poclass.h
winsup/w32api/include/ddk/scsi.h
winsup/w32api/include/ddk/scsiscan.h
winsup/w32api/include/ddk/scsiwmi.h
winsup/w32api/include/ddk/smbus.h
winsup/w32api/include/ddk/srb.h
winsup/w32api/include/ddk/storport.h
winsup/w32api/include/ddk/tdi.h
winsup/w32api/include/ddk/tdiinfo.h
winsup/w32api/include/ddk/tdikrnl.h
winsup/w32api/include/ddk/tdistat.h
winsup/w32api/include/ddk/tvout.h
winsup/w32api/include/ddk/upssvc.h
winsup/w32api/include/ddk/usb.h
winsup/w32api/include/ddk/usb100.h
winsup/w32api/include/ddk/usbcamdi.h
winsup/w32api/include/ddk/usbdi.h
winsup/w32api/include/ddk/usbioctl.h
winsup/w32api/include/ddk/usbiodef.h
winsup/w32api/include/ddk/usbscan.h
winsup/w32api/include/ddk/usbuser.h
winsup/w32api/include/ddk/video.h
winsup/w32api/include/ddk/videoagp.h
winsup/w32api/include/ddk/win2k.h
winsup/w32api/include/ddk/winddi.h
winsup/w32api/include/ddk/winddk.h
winsup/w32api/include/ddk/winnt4.h
winsup/w32api/include/ddk/winxp.h
winsup/w32api/include/ddk/ws2san.h
winsup/w32api/include/ddk/xfilter.h
winsup/w32api/include/devguid.h
winsup/w32api/include/dhcpcsdk.h
winsup/w32api/include/directx/d3d9.h
winsup/w32api/include/directx/d3d9caps.h
winsup/w32api/include/directx/d3d9types.h
winsup/w32api/include/directx/dxerr8.h
winsup/w32api/include/directx/dxerr9.h
winsup/w32api/include/dlgs.h
winsup/w32api/include/docobj.h
winsup/w32api/include/dsadmin.h
winsup/w32api/include/dsclient.h
winsup/w32api/include/dsgetdc.h
winsup/w32api/include/dshow.h
winsup/w32api/include/dsquery.h
winsup/w32api/include/dsrole.h
winsup/w32api/include/dvdevcod.h
winsup/w32api/include/dvdmedia.h
winsup/w32api/include/edevdefs.h
winsup/w32api/include/errorrep.h
winsup/w32api/include/errors.h
winsup/w32api/include/evcode.h
winsup/w32api/include/exdisp.h
winsup/w32api/include/exdispid.h
winsup/w32api/include/fltdefs.h
winsup/w32api/include/httpext.h
winsup/w32api/include/icm.h
winsup/w32api/include/idispids.h
winsup/w32api/include/il21dec.h
winsup/w32api/include/imagehlp.h
winsup/w32api/include/imm.h
winsup/w32api/include/initguid.h
winsup/w32api/include/intshcut.h
winsup/w32api/include/ipexport.h
winsup/w32api/include/iphlpapi.h
winsup/w32api/include/ipifcons.h
winsup/w32api/include/ipinfoid.h
winsup/w32api/include/iprtrmib.h
winsup/w32api/include/iptypes.h
winsup/w32api/include/ipxconst.h
winsup/w32api/include/ipxrtdef.h
winsup/w32api/include/ipxtfflt.h
winsup/w32api/include/isguids.h
winsup/w32api/include/ks.h
winsup/w32api/include/ksmedia.h
winsup/w32api/include/largeint.h
winsup/w32api/include/lm.h
winsup/w32api/include/lmaccess.h
winsup/w32api/include/lmalert.h
winsup/w32api/include/lmapibuf.h
winsup/w32api/include/lmat.h
winsup/w32api/include/lmaudit.h
winsup/w32api/include/lmbrowsr.h
winsup/w32api/include/lmchdev.h
winsup/w32api/include/lmconfig.h
winsup/w32api/include/lmcons.h
winsup/w32api/include/lmerr.h
winsup/w32api/include/lmerrlog.h
winsup/w32api/include/lmmsg.h
winsup/w32api/include/lmremutl.h
winsup/w32api/include/lmrepl.h
winsup/w32api/include/lmserver.h
winsup/w32api/include/lmshare.h
winsup/w32api/include/lmsname.h
winsup/w32api/include/lmstats.h
winsup/w32api/include/lmsvc.h
winsup/w32api/include/lmuse.h
winsup/w32api/include/lmuseflg.h
winsup/w32api/include/lmwksta.h
winsup/w32api/include/lzexpand.h
winsup/w32api/include/mapi.h
winsup/w32api/include/mciavi.h
winsup/w32api/include/mcx.h
winsup/w32api/include/mgm.h
winsup/w32api/include/mgmtapi.h
winsup/w32api/include/mlang.h
winsup/w32api/include/mmreg.h
winsup/w32api/include/mmsystem.h
winsup/w32api/include/mpegtype.h
winsup/w32api/include/mprapi.h
winsup/w32api/include/mq.h
winsup/w32api/include/msacm.h
winsup/w32api/include/mshtml.h
winsup/w32api/include/mswsock.h
winsup/w32api/include/nb30.h
winsup/w32api/include/nddeapi.h
winsup/w32api/include/nspapi.h
winsup/w32api/include/ntdef.h
winsup/w32api/include/ntdll.h
winsup/w32api/include/ntdsapi.h
winsup/w32api/include/ntdsbcli.h
winsup/w32api/include/ntldap.h
winsup/w32api/include/ntsecapi.h
winsup/w32api/include/ntsecpkg.h
winsup/w32api/include/oaidl.h
winsup/w32api/include/objbase.h
winsup/w32api/include/objfwd.h
winsup/w32api/include/objidl.h
winsup/w32api/include/objsafe.h
winsup/w32api/include/objsel.h
winsup/w32api/include/ocidl.h
winsup/w32api/include/odbcinst.h
winsup/w32api/include/ole.h
winsup/w32api/include/ole2.h
winsup/w32api/include/ole2ver.h
winsup/w32api/include/oleacc.h
winsup/w32api/include/oleauto.h
winsup/w32api/include/olectl.h
winsup/w32api/include/olectlid.h
winsup/w32api/include/oledlg.h
winsup/w32api/include/oleidl.h
winsup/w32api/include/pbt.h
winsup/w32api/include/poppack.h
winsup/w32api/include/powrprof.h
winsup/w32api/include/prsht.h
winsup/w32api/include/psapi.h
winsup/w32api/include/pshpack1.h
winsup/w32api/include/pshpack2.h
winsup/w32api/include/pshpack4.h
winsup/w32api/include/pshpack8.h
winsup/w32api/include/qedit.h
winsup/w32api/include/rapi.h
winsup/w32api/include/ras.h
winsup/w32api/include/rasdlg.h
winsup/w32api/include/raserror.h
winsup/w32api/include/rassapi.h
winsup/w32api/include/reason.h
winsup/w32api/include/regstr.h
winsup/w32api/include/richedit.h
winsup/w32api/include/richole.h
winsup/w32api/include/routprot.h
winsup/w32api/include/rpc.h
winsup/w32api/include/rpcdce.h
winsup/w32api/include/rpcdce2.h
winsup/w32api/include/rpcdcep.h
winsup/w32api/include/rpcndr.h
winsup/w32api/include/rpcnsi.h
winsup/w32api/include/rpcnsip.h
winsup/w32api/include/rpcnterr.h
winsup/w32api/include/rpcproxy.h
winsup/w32api/include/rtutils.h
winsup/w32api/include/schannel.h
winsup/w32api/include/schnlsp.h
winsup/w32api/include/scrnsave.h
winsup/w32api/include/sddl.h
winsup/w32api/include/secext.h
winsup/w32api/include/security.h
winsup/w32api/include/servprov.h
winsup/w32api/include/setupapi.h
winsup/w32api/include/shellapi.h
winsup/w32api/include/shldisp.h
winsup/w32api/include/shlguid.h
winsup/w32api/include/shlobj.h
winsup/w32api/include/shlwapi.h
winsup/w32api/include/snmp.h
winsup/w32api/include/specstrings.h
winsup/w32api/include/sql.h
winsup/w32api/include/sqlext.h
winsup/w32api/include/sqltypes.h
winsup/w32api/include/sqlucode.h
winsup/w32api/include/sspi.h
winsup/w32api/include/stm.h
winsup/w32api/include/strmif.h
winsup/w32api/include/subauth.h
winsup/w32api/include/svcguid.h
winsup/w32api/include/tlhelp32.h
winsup/w32api/include/tmschema.h
winsup/w32api/include/unknwn.h
winsup/w32api/include/userenv.h
winsup/w32api/include/usp10.h
winsup/w32api/include/uxtheme.h
winsup/w32api/include/vfw.h
winsup/w32api/include/vidcap.h
winsup/w32api/include/vmr9.h
winsup/w32api/include/vptype.h
winsup/w32api/include/w32api.h
winsup/w32api/include/winable.h
winsup/w32api/include/winbase.h
winsup/w32api/include/winber.h
winsup/w32api/include/wincon.h
winsup/w32api/include/wincrypt.h
winsup/w32api/include/windef.h
winsup/w32api/include/windns.h
winsup/w32api/include/windows.h
winsup/w32api/include/windowsx.h
winsup/w32api/include/winerror.h
winsup/w32api/include/wingdi.h
winsup/w32api/include/wininet.h
winsup/w32api/include/winioctl.h
winsup/w32api/include/winldap.h
winsup/w32api/include/winnetwk.h
winsup/w32api/include/winnls.h
winsup/w32api/include/winnt.h
winsup/w32api/include/winperf.h
winsup/w32api/include/winreg.h
winsup/w32api/include/winresrc.h
winsup/w32api/include/winsnmp.h
winsup/w32api/include/winsock.h
winsup/w32api/include/winsock2.h
winsup/w32api/include/winspool.h
winsup/w32api/include/winsvc.h
winsup/w32api/include/winuser.h
winsup/w32api/include/winver.h
winsup/w32api/include/ws2spi.h
winsup/w32api/include/ws2tcpip.h
winsup/w32api/include/wsahelp.h
winsup/w32api/include/wsipx.h
winsup/w32api/include/wsnetbs.h
winsup/w32api/include/wtsapi32.h
winsup/w32api/include/wtypes.h
winsup/w32api/include/xprtdefs.h
winsup/w32api/include/zmouse.h
winsup/w32api/install-sh
winsup/w32api/lib/Makefile.in
winsup/w32api/lib/aclui.def
winsup/w32api/lib/advapi32.def
winsup/w32api/lib/ativscp-uuid.c
winsup/w32api/lib/avicap32.def
winsup/w32api/lib/avifil32.def
winsup/w32api/lib/bthprops.def
winsup/w32api/lib/cap.def
winsup/w32api/lib/cguid-uuid.c
winsup/w32api/lib/comcat-uuid.c
winsup/w32api/lib/comctl32.def
winsup/w32api/lib/comdlg32.def
winsup/w32api/lib/crypt32.def
winsup/w32api/lib/ctl3d32.def
winsup/w32api/lib/ddk/Makefile.in
winsup/w32api/lib/ddk/apcups.def
winsup/w32api/lib/ddk/cfgmgr32.def
winsup/w32api/lib/ddk/dxapi.def
winsup/w32api/lib/ddk/hal.def
winsup/w32api/lib/ddk/hid.def
winsup/w32api/lib/ddk/hidparse.def
winsup/w32api/lib/ddk/mcd.def
winsup/w32api/lib/ddk/ndis.def
winsup/w32api/lib/ddk/newdev.def
winsup/w32api/lib/ddk/ntoskrnl.def
winsup/w32api/lib/ddk/scsiport.def
winsup/w32api/lib/ddk/tdi.def
winsup/w32api/lib/ddk/usbcamd.def
winsup/w32api/lib/ddk/usbcamd2.def
winsup/w32api/lib/ddk/videoprt.def
winsup/w32api/lib/ddk/win32k.def
winsup/w32api/lib/devguid.c
winsup/w32api/lib/dhcpcsvc.def
winsup/w32api/lib/directx/Makefile.in
winsup/w32api/lib/directx/d3d8.def
winsup/w32api/lib/directx/d3d9.def
winsup/w32api/lib/directx/d3dim.def
winsup/w32api/lib/directx/d3drm.def
winsup/w32api/lib/directx/d3dx8d.def
winsup/w32api/lib/directx/d3dx9d.def
winsup/w32api/lib/directx/d3dxof.def
winsup/w32api/lib/directx/ddraw.def
winsup/w32api/lib/directx/dinput.def
winsup/w32api/lib/directx/dinput8.def
winsup/w32api/lib/directx/dinput_joy.c
winsup/w32api/lib/directx/dinput_joy2.c
winsup/w32api/lib/directx/dinput_kbd.c
winsup/w32api/lib/directx/dinput_mouse.c
winsup/w32api/lib/directx/dinput_mouse2.c
winsup/w32api/lib/directx/dinput_private.h
winsup/w32api/lib/directx/dmoguids.c
winsup/w32api/lib/directx/dplayx.def
winsup/w32api/lib/directx/dpnaddr.def
winsup/w32api/lib/directx/dpnet.def
winsup/w32api/lib/directx/dpnlobby.def
winsup/w32api/lib/directx/dpvoice.def
winsup/w32api/lib/directx/dsetup.def
winsup/w32api/lib/directx/dsound.def
winsup/w32api/lib/directx/dxerr.c
winsup/w32api/lib/directx/dxerr8.c
winsup/w32api/lib/directx/dxerr8w.c
winsup/w32api/lib/directx/dxerr9.c
winsup/w32api/lib/directx/dxerr9w.c
winsup/w32api/lib/directx/dxguid.c
winsup/w32api/lib/directx/ksproxy.def
winsup/w32api/lib/directx/ksuser.c
winsup/w32api/lib/directx/ksuser.def
winsup/w32api/lib/directx/msdmo.def
winsup/w32api/lib/directx/strmiids.c
winsup/w32api/lib/directx/test.c
winsup/w32api/lib/dlcapi.def
winsup/w32api/lib/dnsapi.def
winsup/w32api/lib/docobj-uuid.c
winsup/w32api/lib/exdisp-uuid.c
winsup/w32api/lib/extras-uuid.c
winsup/w32api/lib/faultrep.def
winsup/w32api/lib/gdi32.def
winsup/w32api/lib/glaux.def
winsup/w32api/lib/glu32.def
winsup/w32api/lib/hlguids-uuid.c
winsup/w32api/lib/hlink-uuid.c
winsup/w32api/lib/icmui.def
winsup/w32api/lib/igmpagnt.def
winsup/w32api/lib/imagehlp.def
winsup/w32api/lib/imm32.def
winsup/w32api/lib/iphlpapi.def
winsup/w32api/lib/kernel32.def
winsup/w32api/lib/largeint.c
winsup/w32api/lib/lz32.def
winsup/w32api/lib/mapi32.def
winsup/w32api/lib/mfcuia32.def
winsup/w32api/lib/mgmtapi.def
winsup/w32api/lib/mlang-uuid.c
winsup/w32api/lib/mpr.def
winsup/w32api/lib/mprapi.def
winsup/w32api/lib/mqrt.def
winsup/w32api/lib/msacm32.def
winsup/w32api/lib/mscms.def
winsup/w32api/lib/mshtml-uuid.c
winsup/w32api/lib/msimg32.def
winsup/w32api/lib/msvcp60.def
winsup/w32api/lib/msvfw32.def
winsup/w32api/lib/mswsock.def
winsup/w32api/lib/msxml-uuid.c
winsup/w32api/lib/nddeapi.def
winsup/w32api/lib/netapi32.def
winsup/w32api/lib/ntdll.def
winsup/w32api/lib/oaidl-uuid.c
winsup/w32api/lib/objidl-uuid.c
winsup/w32api/lib/objsafe-uuid.c
winsup/w32api/lib/ocidl-uuid.c
winsup/w32api/lib/odbc32.def
winsup/w32api/lib/odbccp32.def
winsup/w32api/lib/ole32.def
winsup/w32api/lib/oleacc-uuid.c
winsup/w32api/lib/oleacc.def
winsup/w32api/lib/oleaut32.def
winsup/w32api/lib/olecli32.def
winsup/w32api/lib/olectlid-uuid.c
winsup/w32api/lib/oledlg.def
winsup/w32api/lib/oleidl-uuid.c
winsup/w32api/lib/olepro32.def
winsup/w32api/lib/olesvr32.def
winsup/w32api/lib/opengl32.def
winsup/w32api/lib/penwin32.def
winsup/w32api/lib/pkpd32.def
winsup/w32api/lib/power-uuid.c
winsup/w32api/lib/powrprof.def
winsup/w32api/lib/psapi.def
winsup/w32api/lib/quartz.def
winsup/w32api/lib/rapi.def
winsup/w32api/lib/rasapi32.def
winsup/w32api/lib/rasdlg.def
winsup/w32api/lib/res.rc
winsup/w32api/lib/rpcdce4.def
winsup/w32api/lib/rpcns4.def
winsup/w32api/lib/rpcrt4.def
winsup/w32api/lib/rtm.def
winsup/w32api/lib/rtutils.def
winsup/w32api/lib/scrnsave.c
winsup/w32api/lib/secur32.def
winsup/w32api/lib/servprov-uuid.c
winsup/w32api/lib/setupapi.def
winsup/w32api/lib/shell32.c
winsup/w32api/lib/shell32.def
winsup/w32api/lib/shfolder.def
winsup/w32api/lib/shlwapi.def
winsup/w32api/lib/snmpapi.def
winsup/w32api/lib/svrapi.def
winsup/w32api/lib/tapi32.def
winsup/w32api/lib/test.c
winsup/w32api/lib/th32.def
winsup/w32api/lib/thunk32.def
winsup/w32api/lib/unknwn-uuid.c
winsup/w32api/lib/url.def
winsup/w32api/lib/urlmon-uuid.c
winsup/w32api/lib/user32.def
winsup/w32api/lib/userenv.def
winsup/w32api/lib/usp10.def
winsup/w32api/lib/uxtheme.def
winsup/w32api/lib/vdmdbg.def
winsup/w32api/lib/version.def
winsup/w32api/lib/vfw32.mri
winsup/w32api/lib/win32spl.def
winsup/w32api/lib/wininet.def
winsup/w32api/lib/winmm.def
winsup/w32api/lib/winspool.def
winsup/w32api/lib/winstrm.def
winsup/w32api/lib/wldap32.def
winsup/w32api/lib/wow32.def
winsup/w32api/lib/ws2_32.c
winsup/w32api/lib/ws2_32.def
winsup/w32api/lib/wsnmp32.def
winsup/w32api/lib/wsock32.def
winsup/w32api/lib/wst.def
winsup/w32api/lib/wtsapi32.def
Diffstat (limited to 'winsup/mingw')
498 files changed, 0 insertions, 64802 deletions
diff --git a/winsup/mingw/CONTRIBUTORS b/winsup/mingw/CONTRIBUTORS deleted file mode 100644 index f696f500e..000000000 --- a/winsup/mingw/CONTRIBUTORS +++ /dev/null @@ -1,28 +0,0 @@ -/* - * CONTRIBUTORS - * This file has no copyright assigned and is placed in the Public Domain. - * This file is a part of the mingw-runtime package. - * No warranty is given; refer to the file DISCLAIMER within the package. - * - * HISTORICAL: - * Colin Peters <colin@fu.is.saga-u.ac.jp> - Original author of the - * mingw-runtime package. - * Mumit Khan <khan@xraylith.wisc.EDU> - Original maintainer of the - * mingw-runtime package. - * Gunther Ebert <gunther.ebert@ixos-leipzig.de> - Adaptations of his DLL - * support. - * Stan Cox <scox@cygnus.com> - Provided gccmain.c. - * J.J. van der Heijden <J.J.vanderHeijden@student.utwente.nl> - Provided - * dos.h. - * Mikey <jeffdb@netzone.com> - Adaptated excpt.h from his code. - * Pedro A. Aranda <paag@tid.es> - Provided lots of types for types.h. - * - * CURRENT: - * Danny Smith <dannysmith@users.sourceforge.net> - * Earnie Boyd <earnie@users.sourceforge.net> - * Luke Dunstan <coder_infidel@users.sourceforge.net> - * - * Many others in the MinGW user community. They are listed in the ChangeLog. - * Please review that file for the names of those contributors. - * - */ diff --git a/winsup/mingw/CRT_fp10.c b/winsup/mingw/CRT_fp10.c deleted file mode 100644 index a13fb0096..000000000 --- a/winsup/mingw/CRT_fp10.c +++ /dev/null @@ -1,16 +0,0 @@ -/* - * CRT_FP10.c - * - * This defines _fpreset as asm ("fnint"). Calls to _fpreset - * will set default floating point precesion to 64-bit mantissa - * at app startup. - * - * Linking in CRT_FP10.o before libmingw.a will override the definition - * set in CRT_FP8.o. - */ - -/* Override library _fpreset() with asm fninit */ -void _fpreset (void) - { __asm__ ( "fninit" ) ;} - -void __attribute__ ((alias ("_fpreset"))) fpreset(void); diff --git a/winsup/mingw/CRT_fp8.c b/winsup/mingw/CRT_fp8.c deleted file mode 100644 index d772d759a..000000000 --- a/winsup/mingw/CRT_fp8.c +++ /dev/null @@ -1,18 +0,0 @@ -/* - * CRT_FP8.c - * - * This forces calls of _fpreset to the MSVCRT function - * exported from dll. Effectively it make default - * precison same as apps built with MSVC (53-bit mantissa). - - * - * To change to 64-bit mantissa, link in CRT_FP10.o before libmingw.a. - */ - -/* Link against the _fpreset visible in import lib */ - -extern void (*_imp___fpreset)(void) ; -void _fpreset (void) -{ (*_imp___fpreset)(); } - -void __attribute__ ((alias ("_fpreset"))) fpreset(void); diff --git a/winsup/mingw/CRT_noglob.c b/winsup/mingw/CRT_noglob.c deleted file mode 100644 index 2e122fbd7..000000000 --- a/winsup/mingw/CRT_noglob.c +++ /dev/null @@ -1,15 +0,0 @@ -/* - * CRT_noglob.c - * This file has no copyright is assigned and is placed in the Public Domain. - * This file is a part of the mingw-runtime package. - * No warranty is given; refer to the file DISCLAIMER within the package. - * - * Include this object file to set _CRT_glob to a state that will turn off - * command line globbing by default. NOTE: _CRT_glob has a default state of on. - * - * To use this object include the object file in your link command: - * gcc -o foo.exe foo.o CRT_noglob.o - * - */ - -int _CRT_glob = 0; diff --git a/winsup/mingw/CRTfmode.c b/winsup/mingw/CRTfmode.c deleted file mode 100644 index cc1653add..000000000 --- a/winsup/mingw/CRTfmode.c +++ /dev/null @@ -1,19 +0,0 @@ -/* - * CRTfmode.c - * This file has no copyright assigned and is placed in the Public Domain. - * This file is a part of the mingw-runtime package. - * No warranty is given; refer to the file DISCLAIMER within the package. - * - * This libmingw.a object sets _CRT_fmode to a state that will cause - * _mingw32_init_fmode to leave all file modes in their default state - * (basically text mode). - * - * To override the default, add, eg: - * - * #include <fcntl.h> - * int _CRT_fmode = _O_BINARY; - * - * to your app. - */ - -int _CRT_fmode = 0; diff --git a/winsup/mingw/CRTglob.c b/winsup/mingw/CRTglob.c deleted file mode 100644 index a4f5fe051..000000000 --- a/winsup/mingw/CRTglob.c +++ /dev/null @@ -1,16 +0,0 @@ -/* - * CRTglob.c - * This file has no copyright assigned and is placed in the Public Domain. - * This file is a part of the mingw-runtime package. - * No warranty is given; refer to the file DISCLAIMER within the package. - * - * Include this object file to set _CRT_glob to a state that will - * turn on command line globbing by default. NOTE: _CRT_glob has a default - * state of on. Specify CRT_noglob.o to turn off globbing by default. - * - * To use this object include the object file in your link command: - * gcc -o foo.exe foo.o CRTglob.o - * - */ - -int _CRT_glob = -1; diff --git a/winsup/mingw/CRTinit.c b/winsup/mingw/CRTinit.c deleted file mode 100644 index bb2304d1d..000000000 --- a/winsup/mingw/CRTinit.c +++ /dev/null @@ -1,24 +0,0 @@ -/* - * CRTinit.c - * This file has no copyright assigned and is placed in the Public Domain. - * This file is a part of the mingw-runtime package. - * No warranty is given; refer to the file DISCLAIMER within the package. - * - * A dummy version of _CRT_INIT for MS compatibility. Programs, or more often - * dlls, which use the static version of the MSVC run time are supposed to - * call _CRT_INIT to initialize the run time library in DllMain. This does - * not appear to be necessary when using crtdll or the dll versions of the - * MSVC runtime, so the dummy call simply does nothing. - * - * This object file is included as a standard in the link process as provided - * by the appropriate GCC frontend. - * - * To use this object include the object file in your link command: - * gcc -o foo.exe foo.o CRTinit.o - * - */ - -void -_CRT_INIT () -{ -} diff --git a/winsup/mingw/ChangeLog b/winsup/mingw/ChangeLog deleted file mode 100644 index da6a5891f..000000000 --- a/winsup/mingw/ChangeLog +++ /dev/null @@ -1,4136 +0,0 @@ -2008-12-16 Danny Smith <dannysmith@users.sourceforge.net> - - * msvcrt.def.in (___lc_codepage_func, ___lc_collate_cp_func, - ___lc_handle_func, ___mb_cur_max_func, ___setlc_active_func, - ___unguarded_readlc_active_add_func, __crtCompareStringW, - __crtGetStringTypeW, __crtLCMapStringW, __pctype_func, - __pwctype_func, __iob_func, __uncaught_exception, __wcserror, - __CxxDetectRethrow, __CxxExceptionFilter, __CxxQueryExceptionSize, - __CxxRegisterExceptionObject, __CxxUnregisterExceptionObject, - __CxxCallUnwindDtor, __DestructExceptionObject, _aligned_free, - _aligned_malloc, _aligned_offset_malloc, _aligned_offset_realloc, - _aligned_realloc, _cgetws, _cputws, _cwprintf, _cwscanf, _getwch, - _getwche, _putwch, _resetstkoflw, _scprintf, _scwprintf, - _set_SSE2_enable, _snscanf, _snwscanf, _strtoi64, _strtoui64, - _ungetwch, _vscprintf, _vscwprintf, _wcserror, _wcstoi64, - _wcstoui64, _wctype, _wtof, _get_heap_handle): Always export. - -2008-12-08 Dmitry G. Gorbachev <d.g.gorbachev@gmail.com> - - * cpu_features.c (__cpu_features_init): Remove erroneous ';'. - -2008-10-28 Keith Marshall <keithmarshall@users.sourceforge.net> - - Correct some binary distribution packaging defects. - - * Makefile.in (bindist): Remove `make' conditionals; segregate into... - (bindist-common, bindist-mingwrt, bindist-mingw-runtime): ...these new - intermediate goals; they make packages of files, as specified by... - (BINDIST_FILES, DEVDIST_FILES, DLLDIST_FILES): ...these new macros. - (dist_prefix) [target_alias !~ cygwin]: Leave it undefined. - -2008-10-18 Keith Marshall <keithmarshall@users.sourceforge.net> - - Fix MinGW-Bug [2136252]: (Reported by Roumen Petrov). - Remove extraneous radix point in printf( "%.0f", v ) for v < 0.5 - - * mingwex/stdio/pformat.c (__pformat_emit_float): Always make output - of radix point conditional on precision != 0 or `#' flag specified. - -2008-10-13 Keith Marshall <keithmarshall@users.sourceforge.net> - - Fix MinGW-Bug [2160227] - Eliminate conflicting declarations and implementations of scalb(). - - * moldname.def.in (scalb): Comment out of EXPORTS list. - * include/math.h (scalb): Comment out OLDNAMES prototype; it conflicts - with GCC's built-in declaration. - -2008-10-12 Christopher Faylor <me+cygwin@cgf.cx> - - * Makefile.in: Use a different method to invoke gcc in a cygwin-hosted - environment. - * mingwex/Makefile.in: Ditto. - * profile/Makefile.in: Ditto. - * configure.in: Record mingw front-end for building under Cygwin. - * mingwex/configure.in: Ditto. - * profile/configure.in: Ditto. - * configure: Regenerate. - * mingwex/configure: Ditto. - * profile/configure: Ditto. - -2008-10-11 Keith Marshall <keithmarshall@users.sourceforge.net> - - Use de-facto standard Makefile goals to invoke test suite. - - * Makefile.in: Some minor formatting adjustments. - (test_headers): Unconventionally named goal renamed to... - (check-headers): ...this; make it a prerequisite of... - (check): ...this new conventionally named goal. - -2008-10-11 Keith Marshall <keithmarshall@users.sourceforge.net> - - Make strtod() inline definition C89 compliant. - (Issue reported by Ilya Shestopalov and Ian Puleston) - (Correction identified by Danny Smith) - - * include/stdlib.h (strtod): Declare as `__inline__', not `inline'; - reformat inline function definition. - ->>>>>>> 1.423 -2008-10-04 Chris Sutcliffe <ir0nh34d@users.sourceforge.net> - - * include/_mingw.h: Increment version to 3.15.1 and introduce - __MINGW32_PATCHLEVEL variable. - -2008-10-03 Keith Marshall <keithmarshall@users.sourceforge.net> - - Fix MinGW-Bug [2144266]: getopt() sets `optind' incorrectly. - (Reported by Christian Franke) - - * mingwex/getopt.c (optind): Make global variable value conform to - behaviour specified by POSIX; do not use it for internal state in... - (getopt_parse): ...this static function; use... - (optbase): ...this new static local variable instead. - (getopt_resolved): Update `optind' as required. - -2008-10-03 Keith Marshall <keithmarshall@users.sourceforge.net> - - Improve package identification in configure script. - - * configure.ac (AC_INIT): Redefine parameters... - (PACKAGE_NAME): Set to `MinGW Runtime'. - (PACKAGE_BUGREPORT): Set to `http://mingw.org/reporting_bugs' - (PACKAGE_TARNAME): Set to `mingwrt'. - (PACKAGE_VERSION): Set generically to `v3.x'; reassigned by... - (MINGW_AC_CONFIG_SRCDIR): ...this macro, which extracts... - (__MINGW32_VERSION): ...this, from file `include/_mingw.h'. - - * aclocal.m4 (MINGW_AC_CONFIG_SRCDIR): Do not redefine... - (PACKAGE_TARNAME): ...this. - - * configure: Regenerated. - -2008-09-25 Keith Marshall <keithmarshall@users.sourceforge.net> - - Fix MinGW-Bug [2125708]. - (Reported by Alexandr Zamaraev). - - * include/stdlib.h (intptr_t) [!_INTPTR_T_DEFINED]: Unused typedef; - not wanted here; remove it; replace it by... - (uintptr_t) [!_UINTPTR_T_DEFINED]: ...this typedef; needed by... - (_invalid_parameter_handler): ...this function typedef. - -2008-09-23 Chris Sutcliffe <ir0nh34d@users.sf.net> - - * Makefile.in: Don't include host_os as part of snapshot filename. - -2008-09-19 Keith Marshall <keithmarshall@users.sourceforge.net> - - Fix MinGW-Bug [2119504]. - (Reported by Peiyuan Song). - - * mingwex/getopt.c (getopt_resolved): Do not overwrite... - (*retindex): ...this already correctly assigned return variable... - (opt[index].val): ...with this; this should have been assigned to... - (*opt[index].flag) [opt[index].flag != NULL]: ...this instead. - -2008-09-19 Keith Marshall <keithmarshall@users.sourceforge.net> - - Fix MinGW-Bug [2117379]. - (Reported by Peiyuan Song). - - * include/stdio.h (__argv): Replace all references in function - prototype argument lists and inline function local variables, with ... - (__local_argv): ...this, to avoid potential conflict with ... - * include/stdlib (__argv): ...this #defined macro. - -2008-09-07 Chris Sutcliffe <ir0nh34d@users.sourceforge.net> - - * include/_mingw.h: Increment version to 3.15. - -2008-09-06 Chris Sutcliffe <ir0nh34d@users.sourceforge.net> - - * Makefile.in: Adjust to new naming standard for MinGW while maintaining old - naming standard for Cygwin. - -2008-08-31 Keith Marshall <keithmarshall@users.sourceforge.net> - - Reimplement getopt.c to add getopt_long_only() function. - - (N.B. this reimplementation removes support for BSD/Mac-OS-X - `optreset' nonsense; user code should set `optind = 0' instead, - to reinitialise option scanning). - - * mingwex/getopt.c: Delete all content; reimplement it. - * include/getopt.h: Likewise. - - * include/unistd.h (__UNISTD_H_SOURCED__): New macro; define it. - (__UNISTD_GETOPT__): This macro is no longer required; remove it. - -2008-08-30 Keith Marshall <keithmarshall@users.sourceforge.net> - - Implement conditional replacement for printf() family functions. - - * include/_mingw.h (__USE_MINGW_ANSI_STDIO): New macro; define it. - (__MINGW_ANSI_STDIO__): New manifest constant; define as bitmapped - flag for use in user specified __MINGW_FEATURES__ attribute. - (__MINGW_LC_MESSAGES__, __MINGW_LC_ENVVARS__): New manifest constants; - currently unused: reserved as components of... - (__MINGW_LC_EXTENSIONS__): ...this new manifest constant; earmarked as - a __MINGW_FEATURES__ enhancement to setlocale(). - - * include/stdio.h (__mingw_printf, __mingw_vprintf): Prototype them. - (__mingw_fprintf, __mingw_vfprintf): Likewise. - (__mingw_sprintf, __mingw_vsprintf): Likewise. - (__msvcrt_printf, __msvcrt_vprintf): Likewise. - (__msvcrt_fprintf, __msvcrt_vfprintf): Likewise. - (__msvcrt_sprintf, __msvcrt_vsprintf): Likewise. - (printf, vprintf) [!__USE_MINGW_ANSI_STDIO]: Prototype for default - usage; link to DLL import stub, importing from MSVCRT. - (fprintf, vfprintf) [!__USE_MINGW_ANSI_STDIO]: Likewise. - (sprintf, vsprintf) [!__USE_MINGW_ANSI_STDIO]: Likewise. - (printf) [__USE_MINGW_ANSI_STDIO]: Redirect to __mingw_printf; use - locally defined static stub implementation. - (fprintf, sprintf) [__USE_MINGW_ANSI_STDIO]: Likewise; redirect to - __mingw_fprintf and __mingw_sprintf respectively. - (vprintf) [__USE_MINGW_ANSI_STDIO]: Redirect to __mingw_vprintf; use - static inline implementation for C++ and GNU C, or locally defined - static stub otherwise. - (vfprintf, vsprintf) [__USE_MINGW_ANSI_STDIO]: Likewise; redirect to - __mingw_vfprintf and __mingw_vsprintf respectively. - -2008-08-27 Keith Marshall <keithmarshall@users.sourceforge.net> - - Avoid access violations, passing NULL to printf( "...%s..." ); - (inconsistencency with MSVCRT and glibc, reported by Colin Harrison). - - * mingwex/stdio/pformat.c (__pformat_puts): Substitute "(null)" - for argument value, if caller passes a NULL pointer. - (__pformat_wcputs): Likewise, substitute L"(null)". - -2008-08-14 Keith Marshall <keithmarshall@users.sourceforge.net> - - Add missing dependencies for building libmingwex.a. - - * mingwex/Makefile.in (printf.o, fprintf.o, sprintf.o): Make them... - (vprintf.o, vfprintf.o, vsprintf.o): ...and also these, depend on... - (pformat.h): ...this. - -2008-08-11 Keith Marshall <keithmarshall@users.sourceforge.net> - - Add replacements for remaining members of printf() family. - - * mingwex/stdio/printf.c: New file. - * mingwex/stdio/fprintf.c: New file. - * mingwex/stdio/sprintf.c: New file. - * mingwex/stdio/vprintf.c: New file. - * mingwex/stdio/vfprintf.c: New file. - * mingwex/stdio/vsprintf.c: New file. - - * mingwex/Makefile.in (STDIO_DISTFILES): Add them. - (STDIO_OBJS): Add their corresponding object files. - -2008-07-29 Keith Marshall <keithmarshall@users.sourceforge.net> - - Replace __mingw_snprintf() with new generic family implementation; - likewise, replace __mingw_vsnprintf(). - - * mingwex/stdio/pformat.c mingwex/stdio/pformat.h: New files. - * mingwex/stdio/snprintf.c mingwex/stdio/vsnprintf.c: New files. - * mingwex/Makefile.in (STDIO_DISTFILES): Add them. - (GDTOA_DISTFILES): Remove mingw_snprintf.c - (STDIO_OBJS): Add pformat.o, snprintf.o and vsnprintf.o - (GDTOA_OBJS): Remove mingw_snprintf.o - (PFORMAT_CFLAGS): New macro; define it, as required by... - (pformat.o): ...this new explicit build target. - (snprintf.o, vsnprintf.o): Declare prerequisites. - - * mingwex/gdtoa/mingw_snprintf.c: Redundant file; delete it. - -2008-07-28 Keith Marshall <keithmarshall@users.sourceforge.net> - - Lay foundations for new printf() function family implementation. - - * ofmt_stub.s: New file; implement forward compatibility stub for... - (_get_output_format): ...this MSVCR80.DLL and later function. - - * Makefile.in (SRCDIST_FILES): Add ofmt_stub.s. - (NM, OBJCOPY): New macros; define them with AC_SUBSTed values. - (sym_prefix, NM_LOOKUP, MINGW_REPL_FUNCS): New macros; define them. - (lib%.a): Include ofmt_stub.o when import library does not already - advertise availability of the _get_output_format() function; - Add alias stubs for MINGW_REPL_FUNCS, such that... - (__msvcrt_printf): ...is an alias for Microsoft's printf(). - (__msvcrt_fprintf): ...is an alias for Microsoft's fprintf(). - (__msvcrt_sprintf): ...is an alias for Microsoft's sprintf(). - (__msvcrt_vprintf): ...is an alias for Microsoft's vprintf(). - (__msvcrt_vfprintf): ...is an alias for Microsoft's vfprintf(). - (__msvcrt_vsprintf): ...is an alias for Microsoft's vsprintf(). - (clean): Add msvcr*.def. - - * configure.in (NM, OBJCOPY): Use AC_CHECK_TOOL to specify them. - * configure: Regenerated. - -2008-07-06 Gregory McGarry <gregorymcgarry@users.sourceforge.net> - - * include/ctype.h (_imp____mb_cur_max): Correct spelling. - (_imp____mb_cur_max_dll): Likewise. - -2008-07-04 Danny Smith <dannysmith@users,sourceforge.net> - - * include/stdio.h (swprintf, vswprintf): Guard with #ifndef __STRICT_ANSI__ - * include/wchar.h (swprintf, vswprintf): Likewise. - -2008-07-01 Keith Marshall <keithmarshall@users.sourceforge.net> - - * msvcrt.def.in [__msvcr80__, __msvcr80d__, __msvcr90__, __msvcr90d__] - (_get_output_format, _set_output_format): Add references. - - * include/stdio.h [__MSVCRT_VERSION__ >= 0x800] - (_get_output_format, _set_output_format): Declare prototypes. - (_TWO_DIGIT_EXPONENT): Define. - Some other minor formatting adjustments. - -2008-06-14 Danny Smith <dannysmith@users.sourceforge.net> - - [mingw-Bugs-1801641] - * include/wchar.h (_wfdopen): Const-ify second arg. - * include/stdio.h (_wfdopen): Likewise. - Thanks to <tdragon at users dot sourceforge net> - -2008-06-02 Keith Marshall <keithmarshall@users.sourceforge.net> - - Avoid precision errors in round(), lround() and llround() functions. - - * mingwex/math/round_generic.c: New file; it replaces... - * mingwex/math/round.c: ...this; delete it. - * mingwex/math/roundf.c: ...and this; ditto. - * mingwex/math/roundl.c: ...and this; ditto. - - * mingwex/math/lround_generic.c: New file; it replaces... - * mingwex/math/lround.c: ...this; delete it. - * mingwex/math/lroundf.c: ...and this; ditto. - * mingwex/math/lroundl.c: ...and this; ditto. - * mingwex/math/llround.c: ...and this; ditto. - * mingwex/math/llroundf.c: ...and this; ditto. - * mingwex/math/llroundl.c: ...and this; ditto. - - * mingwex/math/round_internal.h: New file; it provides generic common - code, which is shared by `round_generic.c' and `lround_generic.c'; the - implementation is based on techniques suggested by Danny Smith and - Greg Chicares. - - * mingwex/Makefile.in (MATH_DISTFILES): Remove `round.c', `roundf.c', - `roundl.c', `lround.c', `lroundf.c', `lroundl.c', `llround.c', - `llroundf.c' and `llroundl.c'; replace by `round_internal.h', - `round_generic.c' and `lround_generic.c'. - (MATH_OBJS): Factor out files listed in... - (MATH_ROUND_OBJS, MATH_LROUND_OBJS, MATH_LLROUND_OBJS): ...these new - macros; define them; specify dependencies and build rules; add to... - (LIB_OBJS): ...this list. - -2008-05-22 Danny Smith <dannysmith@users.sourceforge.net> - - [ mingw-Bugs-1961893 ] - * mingwex/gdtoa/mingw_snprint.c (x_sprintf): Always set __ldtoa - mode to 2 for E format. - -2008-05-15 Ramiro Polla <ramiro@lisha.ufsc.br> - - * include/stdlib.h: Fix strtod under C++. - -2008-05-06 Ramiro Polla <ramiro@lisha.ufsc.br> - - * mingwex/gdtoa/strtodnrp.c: Remove alias from strtod to __strtod. - * include/stdlib.h: Define strtod to __strtod when __NO_ISOCEXT is not set. - -2008-05-04 Ramiro Polla <ramiro@lisha.ufsc.br> - - * include/sys/types.h (useconds_t): typedef. - * include/unistd.h (usleep): Add prototype. - * mingwex/usleep.c: New file. - * mingwex/makefile.in: Add usleep source and object. - -2008-05-02 Ramiro Polla <ramiro@lisha.ufsc.br> - - Make strtod() conform to C99. - - * include/stdlib.h (strtod): Declare this mingwex function, and... - (_strtod): rename this MSVCRT counterpart. - - * mingwex/gdtoa/strtodnrp.c (strtod): Alias to __strtod. - -2008-04-26 Chuck Wilson <cwilso11@users.sourceforge.net> - - * Makefile.in: correct issues with mingw10.dll having multiple relocs. - -2008-04-25 Danny Smith <dannysmith@users.sourceforge.net> - - * include/process.h: Include stdint.h for intptr_t definition. - (_execl, _execle, _execlp, _execlpe, _execv, _execve, _execvp, _execvpe, - _spawnl, _spawnle, _spawnlp, _spawnlpe, _spawnv, _spawnve, _spawnvp, - _spawnvpe): Return intptr_t. - (execl, execle, execlp, execlpe, execv, execve, execvp, execvpe, spawnl, - spawnle, spawnlp, spawnlpe, spawnv, spawnve, spawnvp, spawnvpe): Return - intptr_t. - * include/wchar.h: Guard wide process.h functions with !__STRICT_ANSI__. - - [!_WPROCESS_DEFINED]: Include stdint.h for intptr_t definition. - (_wexecl, _wexecle, _wexeclp, _wexeclpe, _wexecv, _wexecve, _wexecvp, - _wexecvpe, _wspawnl, _wspawnle, _wspawnlp, _wspawnlpe, _wspawnv, _wspawnve, - _wspawnvp, _wspawnvpe): Return intptr_t. - -2008-04-25 Danny Smith <dannysmith@users.sourceforge.net> - - * include/wchar.h (fwide): Return success code rather than failure in inline - definition. - * mingwex/fwide.c (fwide): ANSI-fy. Get rid of Q8 comments. Return success - code rather than failure. - -2008-03-21 Danny Smith - - * include/math.h (float_t, double_t): Define. - -2008-02-08 Danny Smith <dannysmith@users.sourceforge.net> - - * mingwex/gdtoa/gdtoaimp.h (USE_LOCALE): Define. - * mingwex/gdtoa/mingw_snprintf.c: [USE_LOCALE] Include locale.h. - (x_sprintf): [USE_LOCALE] Use *localeconv()->decimal_point. - -2008-02-28 Joseph Myers <joseph@codesourcery.com> - - * include/complex.h: Don't condition contents on C99 or not - __STRICT_ANSI__. - -2008-02-01 Brian Dessent <brian@dessent.net> - - * Makefile.in: Add rules to generate multiple versions of libmoldname.a for - the different runtime versions. - -2008-01-19 Danny Smith <dannysmithusers.sourceforge.net - - * inclue/wchar.h (fwide): Add prototype and guard inline definition. - (mbsinit): Likewise. - -2007-12-27 Chris Sutcliffe <ir0nh34d@users.sourceforge.net> - - * include/_mingw.h: Increment version to 3.14. - -2007-11-26 Chris Sutcliffe <ir0nh34d@users.sourceforge.net> - - * Makefile.in: Add libmsvcr90.a and libmsvcr90d.a targets. - * msvcrt.def.in: Add support for __msvcr90__ and __msvcr90d__ defines. - * mingwex/math/log10f.S: Correct issue with comments. - * mingwex/math/log10l.S: Ditto. - * mingwex/math/log1p.S: Ditto. - * mingwex/math/log1pf.S: Ditto. - * mingwex/math/log1pl.S: Ditto. - * mingwex/math/log2.S: Ditto. - * mingwex/math/log2f.S: Ditto. - * mingwex/math/log2l.S: Ditto. - * mingwex/math/logf.S: Ditto. - * mingwex/math/logl.S: Ditto. - -2007-10-03 Danny Smith <dannysmith@users.sourceforge.net> - - * mingwex/gdtoa/mingw_snprintf.c: fixed warning during compile. - -2007-10-03 Bernd Becker <hugin@users.sourceforge.net> - - * include/io.h (__finddata64_t, __wfinddata64_t): changed member 'size' - from '_fsize_t' to '__int64' to be consistent with the other ...64 - structures and the value set there is 8 bytes not 4. Add guard for both - as the are only used by functions available from 6.1 on. - - * include/malloc.h (_HEAP_MAXREQ): Define. - (_aligned_offset_recalloc): Define. - (_aligned_recalloc()): Define. - - * include/math.h: fixed a typo in a comment. - (atanhf): Fixed declaration. - - * include/wchar.h (__wfinddata64_t): changed member 'size' from '_fsize_t' - to '__int64' to be consistent with the other ...64 structures and the value - set there is 8 bytes not 4. Added guard as this function is only used by - functions available from 6.1 on. - - * include/sys/stat.h: some members of 'stat' were declared with types with - a prefixed underscore, while the ones without the underscore should have - been used. Added guard to '__stat64' as it is only used by functions - available from 6.1 on. Added the wide character versions of the - exec()/spawn() family for completion - (_stati64): changed the type of the 'st_mode' member from 'unsigned int' to - '_mode_t' - - * include/sys/timeb.h (timeb, _timb): changed the type of the 'time' member - from 'long' to 'time_t' - (__timeb64): moved declaration of structure directly before the declaration - of the function '_ftime64()', so it is guarded as well - - * include/sys/utime.h (__utimbuf64): moved declaration of structure directly - before the declaration of the functions using it, so it is guarded as well - -2007-09-24 David C. Daeschler <daveregs@rsaisp.com> - - * mingwex/gdtoa/mingw_snprintf.c (x_sprintf): Correct LEN_L typo in 'l' - case. Add missing break in 's'/LEN_S case. - -2007-08-25 Keith Marshall <keithmarshall@users.sourceforge.net> - - Make snprintf() and vsnprintf() conform to C99. - - * include/stdio.h: Add note about incompatibility between... - (snprintf, vsnprintf): These two mingwex functions, and... - (_snprintf, _vsnprintf): these MSVCRT counterparts. - - * mingwex/Makefile.in (STDIO_OBJS): Remove snprintf.o and vsnprintf.o - (STDIO_DISTFILES): Remove snprintf.c and vsnprintf.c - - * mingwex/stdio/snprintf.c: Delete. - * mingwex/stdio/vsnprintf.c: Delete. - - * mingwex/gdtoa/mingw_snprintf.c (snprintf): Alias to __mingw_snprintf - (vsnprintf): Alias to __mingw_vsnprintf. - -2007-07-25 Chris Sutcliffe <ir0nh34d@users.sourceforge.net> - - * include/_mingw.h: Increment version to 3.13. - * Makefile.in: Reset CYGRELEASE to 1 - -2007-07-23 Keith Marshall <keithmarshall@users.sourceforge.net> - - * Makefile.in (SUBDIRS): Delete stray line continuation artifact, - resulting from incomplete removal of enclosing `for ...; do ...; done' - loop from compound command; (reported by Greg Chicares). - -2007-07-19 Danny Smith <dannysmith@users.sourceforge.net> - - * include/fcntl.h (_O_WTEXT, _O_U16TEXT, _O_U8TEXT) Define for - Vista. - -2007-07-12 Danny Smith <dannysmith@users.sourceforge.net> - - [mingw-Bugs-1734142] - * include/wchar.h (_wsystem) Declare. - (_wputenv) Declare. - (_wgetenv): Declare. - (_wsearchenv): Declare. - (_wmakepath): Declare. - (_wsplitpath): Declare. - (_wfullpath): Declare. - * include/stdlib.h (_wsystem) Declare. - (_wputenv, _wgetenv, _wsearchenv, _wmakepath, _wsplitpath, - _wfullpath): Move into _WSTDLIB_DEFINED guard. - * include/tchar.h (_tsystem): New UNICODE mapping define. - -2007-06-29 Danny Smith <dannysmith@users.sourceforge.net> - - * mingwex/gdtoa/mingw_snprintf.c: New file. - * mingwex/Makefile.in (GDTOA_DISTFILES): Add mingw_snprintf.c. - (GDTOA_OBJS): Add mingw_snprintf.o. - -2007-06-28 Danny Smith <dannysmith@users.sourceforge.net> - - * msvcrt.def.in: Update comment. - Exclude _ctype stub if using msvcr71.dll or newer. - * include/ctype.h: Don't declare _ctype if using msvcr71.dll or newer. - * include/wctype.h: Likewise. - -2007-06-23 Danny Smith <dannysmith@users.sourceforge.net> - - *include/wctype.h: Qualify all functions with __MINGW_NOTHROW. - *include/dirent.h: Likewise. - -2007-06-23 Danny Smith <dannysmith@users.sourceforge.net> - - * include/assert.h: Qualify all functions with __MINGW_NOTHROW. - * include/conio.h: Likewise. - * include/ctype.h: Likewise. - * include/direct.h: Likewise. - * include/dos.h: Likewise. - * include/errno.h: Likewise. - * include/fenv.h: Likewise. - * include/float.h: Likewise. - * include/inttypes.h: Likewise. - * include/io.h: Likewise. - * include/libgen.h: Likewise. - * include/locale.h: Likewise. - * include/malloc.h: Likewise. - * include/mbctype.h: Likewise. - * include/mbstring.h: Likewise. - * include/process.h: Likewise. - * include/search.h: Likewise. - * include/setjmp.h: Likewise. - * include/signal.h: Likewise. - * include/stdio.h: Likewise. - * include/stdlib.h: Likewise. - * include/string.h: Likewise. - * include/time.h: Likewise. - * include/wchar.h: Likewise. - * include/sys/stat.h: Likewise. - * include/sys/time.h: Likewise. - * include/sys/timeb.h: Likewise. - * include/sys/utime.h: Likewise. - -2007-06-22 Danny Smith <dannysmith@users.sourceforge.net> - - * mingwex/Makefile.in (LIB_OBJS): Revert accidental removal. - -2007-06-22 Danny Smith <dannysmith@users.sourceforge.net> - - Add POSIX binary tree search API. - - * mingwex/tfind.c: New file. - * mingwex/tdelete.c: New file. - * mingwex/tsearch.c: New file. - * mingwex/twalk.c: New file. - * mingwex/Makefile.in (DISTFILES): Add tsearch.c twalk.c tdelete.c tfind.c. - * mingwex/Makefile.in (POSIX_OBJS): Add tsearch.o twalk.o tdelete.o tfind.o. - * include/search.h (tfind): Declare. - (tdelete): Declare. - (tsearch): Declare. - (twalk): Declare. - (ENTRY): Define. - (ACTION): Define. - (VISIT): Define. - (node_t): Define, on condition of _SEARCH_PRIVATE. - -2007-06-22 Danny Smith <dannysmith@users.sourceforge.net> - - * include/_mingw.h (__MINGW_NOTHROW): Define. - -2007-06-18 Danny Smith <dannysmith@users.sourceforge.net> - - * include/stdio.h (vsnprintf): Remove inline definition. - Add prototype. - -2007-06-16 Danny Smith <dannysmith@users.sourceforge.net> - - * CRTfmode.c: Nit-pick comment fix. - -2007-06-16 Christopher Faylor <me+cygwin@cgf.cx> - - * CRTfmode.c: Fix nested comment. - -2007-06-16 Christopher Faylor <me+cygwin@cgf.cx> - - * include/string.h (strcasecmp): Fix typo in declaration prototype. - -2007-06-14 Danny Smith <dannysmith@users.sourceforge.net> - - * include/io.h (lseek64) : Add prototype. - -2007-06-14 Danny Smith <dannysmith@users.sourceforge.net> - - * include/string.h (strcasecmp): Add prototype. - (strncasecmp): Add prototype. - -2007-06-13 Danny Smith <dannysmith@users.sourceforge.net> - - * Makefile.in (CRT0S): Revert last change. - * CRTfmode.c. Correct comment. - -2007-06-13 Danny Smith <dannysmith@users.sourceforge.net> - - * Makefile.in (CRT0S): Add back CRTfmode.o. - -2007-06-13 Danny Smith <dannysmith@users.sourceforge.net> - - * include/stdlib.h: Don't include stdint.h. Conditionally define intptr_t. - * include/io.h: Likewise. - -2007-06-11 Danny Smith <dannysmith@users.sourceforge.net> - - * crt1.c (__mingw_CRTStartup): Add explicit call to gcc's __main. - -2007-05-08 Danny Smith <dannysmith@users.sourceforge.net> - - * include/stdint.h (intptr_t): Fix typo. - Thanks to Charles Wilson for report. - -2007-05-07 Danny Smith <dannysmith@users.sourceforge.net> - - * include/stdint.h (intptr_t): Protect with _INTPTR_T_DEFINED. - Condition on _WIN64. - (uintptr_t): Protect with _UINTPTR_T_DEFINED. Condition on _WIN64. - (INTPTR_MIN, INTPTR_MAX, UINTPTR_MAX): Condition on _WIN64. - (PTRDIFF_MIN): Define as INTPTR_MIN. - (PTRDIFF_MAX): Define as INTPTR_MAX. - (SIG_ATOMIC_MIN): Define as INTPTR_MIN. - (SIG_ATOMIC_MAX): Define as INTPTR_MAX. - -2007-04-07 Chris Sutcliffe <ir0nh34d@users.sourceforge.net> - - * Makefile.in: Removed mansuffix variable. Changed mansection to support - Cygwin man page location. - -2007-04-05 Chris Sutcliffe <ir0nh34d@users.sourceforge.net> - - * Makefile.in: Added mansection and mansuffix variables. Changed mandir to - support Cygwin man page location. - -2007-03-25 Chris Sutcliffe <ir0nh34d@users.sourceforge.net> - - * Include/_mingw.h: Increment version to 3.12. - -2007-03-22 Brian Ripley <ripleybd@users.sourceforge.net> - - * include/_mingw.h (__CRT_INLINE): Make conditional on __GNUC_STDC_INLINE__. - -2007-03-20 Chris Sutcliffe <ir0nh34d@users.sourceforge.net> - - * Makefile.in: Tweak srcdist to fix build issue. - -2007-03-20 Keith Marshall <keithmarshall@users.sourceforge.net> - - Add --enable-mingw-manpage-transform configure option. - - * aclocal.m4 (MINGW_AC_MANPAGE_TRANSFORM): New macro. - * configure.in, Makefile.in: Use it. - * configure: Regenerated. - -2007-03-18 Danny Smith <dannysmith@users.sourceforge.net> - - * include/_mingw.h (__CRT_INLINE): Use __gnu_inline__ for gcc 4.2.x too. - -2007-03-10 Keith Marshall <keithmarshall@users.sourceforge.net> - - Add manpages for dirname and basename functions. - - * man: New directory. - * man/dirname.man: New file; it sources both manpages. - * Makefile.in: Add provisional rules to distribute them. - -2007-03-08 Keith Marshall <keithmarshall@users.sourceforge.net> - - * mingwex/basename.c: Make it work with path names containing - multibyte character strings. - * mingwex/dirname.c: Likewise. - -2007-03-05 Danny Smith <dannysmith@users.sourceforge.net> - - * include/io.h (__mingw_access): New static inline wrapper to restore - pre-Vista 'access (fname, X_OK)' behaviour. - (__USE_MINGW_ACCESS): Use to map access() to __mingw_access(). - -2007-03-05 Danny Smith <dannysmith@users.sourceforge.net> - - * mingwex/fesetround.c (fesetround): Use unsigned int as operand - to stmxcsr. - Thanks to Alexey Kuznetsov <ring0_mipt at users dot sf dot net> - -2007-02-27 Thorsten Dahlheimer <tdahlheim@gmx.net> - - * include/stdio.h (_unlink, unlink): Add prototypes. - -2007-02-18 Aurimas Cernius <aurisc4@gmail.com> - - * include/excpt.h: Replace "_try1" in comments with "__try1". - -2007-02-15 Danny Smith <dannysmith@users.sourceforge.net> - - * Makefile.in (ALL_CFLAGS): Put W32API_INCLUDE after INCLUDES. - (ALL_CXXFLAGS): Likewise. - * mingwex/Makefile.in (ALL_CFLAGS): Put W32API_INCLUDE after INCLUDES. - (ALL_CXXFLAGS): Likewise. - * profile/Makefile.in (ALL_CFLAGS): Put W32API_INCLUDE after INCLUDES. - (ALL_CXXFLAGS): Likewise. - -2007-02-08 Danny Smith <dannysmith@users.sourceforge.net> - - * include/io.h (X_OK): Revert 2007-01-24 change, but leave comment. - -2007-01-27 Danny Smith <dannysmith@users.sourceforge.net> - - Expose some more msvcr80.dll functions. - * include/stdio.h (_fseek_nolock. _ftell_nolock, _fseeki64, - _ftelli64, _fseeki64_nolock, _ftelli64_nolock) Add prototypes - * msvcrt.def.in (_fseek_nolock. _ftell_nolock, _fseeki64, - _ftelli64, _fseeki64_nolock, _ftelli64_nolock) Add stubs. - -2007-01-26 Danny Smith <dannysmith@users.sourceforge.net> - - Expose some msvcr80.dll functions. - * include/stdlib.h (_set_abort_behavior): Add prototype. - (_WRITE_ABORT_MSG, _CALL_REPORTFAULT): Add defines for - _set_abort_behavior mask argument. - (_invalid_parameter_handler): Add typedef. - (_set_invalid_parameter_handler): Add prototype. - * include/stdio.h (_get_printf_count_output): Add prototype. - (_set_printf_count_output): Add prototype. - * msvcrt.def.in (_get_printf_count_output,_set_printf_count_output, - _set_abort_behavior, _set_invalid_parameter_handler): Add stubs. - -2007-01-26 Danny Smith <dannysmith@users.sourceforge.net> - - * include/_mingw.h (CRT_INLINE): Correct typo. - -2007-01-24 Danny Smith <dannysmith@users.sourceforge.net> - - * include/io.h (X_OK): Define to F_OK. - -2007-01-19 Danny Smith <dannysmith@users.sourceforge.net> - - * include/stdio.h (SEEK_SET, SEEK_CUR, SEEK_END): Define - unconditionally. Change comment. - * include/unistd.h (SEEK_SET, SEEK_CUR, SEEK_END): Define - here too. - * include/io.h (rename): Declare. - (remove): Declare. - -2006-12-31 Keith Marshall <keithmarshall@users.sourceforge.net> - - * include/libgen.h: New file; required by... - * mingwex/basename.c, mingwex/dirname.c: New files. - * mingwex/Makefile.in (DISTFILES): Add them... - (POSIX_OBJS): ...with corresponding basename.o, dirname.o - (Dependencies): Typo; s/Dependancies/Dependencies/ - -2006-11-25 Keith Marshall <keithmarshall@users.sourceforge.net> - - * Makefile.in (VERSION): Let configure define it. - - * aclocal.m4 (MINGW_AC_CONFIG_SRCDIR): New macro. - * configure.in: Use it. - Correct quoting of autoconf macro arguments throughout. - (AC_INIT, AC_OUTPUT): Update to autoconf 2.5x preferred syntax. - (AR, AS, RANLIB, LD, DLLTOOL, DLLWRAP): Don't need AC_SUBST. - (AC_ALLOCA): Invalid after GCC_NO_EXECUTABLES; removed. - (AC_CONFIG_FILES): Add, to generate Makefile. - - * configure: Regenerated. - -2006-11-21 Danny Smith <dannysmith@users.sourceforge.net> - - * Makefile.in: Add aclocal.m4 to source release. - * mingwex/Makefile.in: Ditto. - * profile/Makefile.in: Ditto. - -2006-11-18 Chris Sutcliffe <ir0nh34d@users.sourceforge.net> - - * Include/_mingw.h: Increment version to 3.11. - * Makefile.in: Ditto. - -2006-11-09 Danny Smith <dannysmith@users.sourceforge.net> - - [ mingw-Bugs-1590623 ] - * include/_mingw.h (__CRT_INLINE): Use __gnu_inline__ attribute - in C99 mode. - -2006-10-04 Corinna Vinschen <corinna@vinschen.de> - - * Makefile.in: Semi-revert semi-reversion of 2006-08-30 change, now - correctly parenthesized. - -2006-09-19 Danny Smith <dannysmith@users.sourceforge.net> - - * mingwex/mb_wc_common.h (get_codepage): Get it - from __lc_codepage. - -2006-09-18 Danny Smith <dannysmith@users.sourceforge.net> - - * mingwex/gdtoa/g_xfmt.c (g_xfmt): Fix representation of infinity. - Use fpclassify. - * mingwex/gdtoa/strtopx (__strtopx): Avoid cast of long double* to - void*. - * mingwex/gdtoa/gdtoa.h (__g_fmt): Make declaration consistent with - others. - -2006-09-16 Danny Smith <dannysmith@users.sourceforge.net> - - * mingwex/gdtoa/strtopx.c (strtopx): Fix long double representation - of infinity. - -2006-09-11 Christopher Faylor <cgf@timesys.com> - - * Makefile.in: Semi-revert 2006-08-30 change. - -2006-09-10 Danny Smith <dannysmith@users.sourceforge.net> - - * include/_mingw.h (__MINGW_ATTRIB_DEPRECATED): Define. - (__MINGW_IMPORT): Ansify. - * include/stdlib.h (_sleep, _beep, _seterrormode): Add - __MINGW_ATTRIB_DEPRECATED. - -2006-09-10 Keith Marshall <keithmarshall@users.sourceforge.net> - - * aclocal.m4 (LIB_AC_PROG_CC, LIB_AC_PROG_CC_GNU, LIB_AC_PROG_CXX): - Redundant macros; deleted. - - * configure.in (LIB_AC_PROG_CC): Replaced by... - (AC_PROG_CC): ...this. - - * configure: Regenerated. - -2006-09-06 Danny Smith <dannysmith@users.sourceforge.net> - - * mingwex/gdtoa/misc.c (pow5mult): Restore original code. - * mingwex/gdtoa/gdtoa.h. Add comment that files have been modified. - * mingwex/gdtoa/gdtoaimp.h: Include system headers with <> brackets. - -2006-09-01 Danny Smith <dannysmith@users.sourceforge.net> - - * mingwex/gdtoa/(arithchk.c, dmisc.c, dtoa.c, g__fmt.c, g_dfmt.c, - g_ffmt.c, g_xfmt.c, gd_arith.h, gd_qnan.h, gdtoa.c, gdtoa.h, - gdtoaimp.h, gethex.c, gmisc.c, hd_init.c, hexnan.c, misc.c, qnan.c, - README, smisc.c, strtodg.c, strtodnrp.c, strtof.c, strtopx.c, sum.c, - ulp.c): New files. - * mingwex/(strtof.c, strtold.c, ldtoa.c): Remove files. - * mingwex/math/(cephes-emath.c, cephes-emath.h): Remove files. - * mingwex/mb_wc_common.h (get_cp_from_locale); Rename to get_codepage(). - * mingwex/(btowc.c, wctob.c, mbrtowc.c, wcrtomb.c): Adjust call to get_codepage(). - * mingwex/wcstold.c: Avoid using strtold internals. - * mingwex/wcstof.c: Rewrite. - * mingwex/Makefile.in (GDTOA_DISTFILES): Add to distribution. - (GDTOA_OBJS): Add to library. - (DISTFILES): Remove strtof.c strtold.c ldtoa.c cephes-emath.c cephes-emath.h. - (STDLIB_OBJS): Remove. - (STDLIB_STUB_OBJS): Remove strtof.o wcstof,o. - (Q8_OBJS): Add wcstof.o wcstold.o. - * include/stdlib.h (strtof): Remove inline definition. - (wcstof): Likewise. - * include/wchar.h (wcstof): Remove inline definition. - -2006-08-30 Corinna Vinschen <corinna@vinschen.de> - - * Makefile.in: Add with_cross_host to allow more granular checks. - Set installation directories accordingly. Override CC setting only - if building a Cygwin target. - * aclocal.m4: Regenerate. - * configure.in: Move AC_CANONICAL_SYSTEM check up. Add - GCC_NO_EXECUTABLES. Substitute with_cross_host in depending files. - Test AC_ALLOCA only if building on a native system. - * configure: Regenerate. - -2006-08-27 Chris Sutcliffe <ir0nh34d@users.sourceforge.net> - - * include/ctype.h: Fix typo. - -2006-08-25 Danny Smith <dannysmith@users.sourceforge.net> - - * include/ctype.h: Expose iswblank if __cplusplus. - * include/wctype.h: Expose iswblank if __cplusplus. - -2006-08-03 Danny Smith <dannysmith@users.sourceforge.net> - - * include/ctype.h: Remove stray ')'; - -2006-08-03 Danny Smith <dannysmith@users.sourceforge.net> - - * include/ctype.h (_BLANK): Expand comment. - (isblank): Add prototype and inline definition. - (iswblank): Add prototype and inline definition. - * include/wctype.h (iswblank): Add prototype and inline definition. - * mingwex/isblank.c: New file. - * mingwex/iswblank.c: New file. - * mingwex/Makefile.in: Add isblank, iswblank to libmingwex.a - -2006-07-06 Danny Smith <dannysmith@users.sourceforge.net> - - * include/math.h (__INFF,__INFL): Remove '#'. - -2006-07-04 Danny Smith <dannysmith@users.sourceforge.net> - - * mingwex/Makefile.in: Add -I$(srcdir)/.. to INCLUDES. - -2006-07-03 Danny Smith <dannysmith@users.sourceforge.net> - - Support SSE float environment in fenv.h functions. - * cpu_features.c: New file. - * cpu_features.h: New file. - * crt1.c: Include "cpu_features.h". - (__mingw_CRTStartup): Call cpu_features_init(). - * Makefile.in (MING_OBJS): Add cpu_features.c. - (SRCDIST_FILES): Add cpu_features.c, cpu_features.h. - * include/fenv,h ( fenv_t;): Append __mxcsr field. - (__MXCSR_EXCEPT_FLAG_SHIFT): New define. - (__MXCSR_EXCEPT_MASK_SHIFT): New define. - (__MXCSR_ROUND_FLAG_SHIFT): New define. - * mingwex/feclearexcept.c: Include "cpu_features.h". - Handle SSE environment. - * mingwex/fegetenv.c: Likewise. - * mingwex/feholdexcept.c: Likewise. - * mingwex/fesetenv.c: Likewise. - * mingwex/fesetexceptflag.c: Likewise. - * mingwex/fesetround.c: Likewise. - * mingwex/fetestexcept.c: Likewise. - * mingwex/feupdateenv.c: Likewise. - * mingwex/fegetround.c: Add comment. - -2006-06-25 Chris Sutcliffe <ir0nh34d@users.sourceforge.net> - - * Include/_mingw.h: Increment version to 3.10. - * Makefile.in: Ditto. - -2006-06-26 Danny Smith <dannysmith@users.sourceforge.net> - - * mingwex/math/tgamma.c (SQTPI): Add braces. - -2006-06-26 Danny Smith <dannysmith@users.sourceforge.net> - - * mingwex/wcrtomb.c (wcsrtombs): Fix src end-pointer thinko. - * mingwex/math/lgamma.c: (LOGPI) Avoid type punning. - (LS2PI): Likewise. - * mingwex/math/sf_erf.c (erff): Initialize z. - (erfcf): Likewise. - * mingwex/math/tgamma.c (SQTPI): Avoid type punning. - -2006-06-25 Chris Sutcliffe <ir0nh34d@users.sourceforge.net> - - * Include/_mingw.h: Increment version to 3.10. - * Makefile.in: Ditto. - -2006-06-23 Danny Smith <dannysmith@users.sourceforge.net> - - * include/sys/time.h (struct timezone): Define. - * include/time.h: Correct comment about timezone. - -2006-06-18 Danny Smith <dannysmith@users.sourceforge.net> - - * configure.in (AC_CONFIG_AUX_DIR): Remove. - * configure: Regenerate. - -2006-06-18 Chris Sutcliffe <ir0n3h4d@users.sourceforge.net> - - * configure: add srcdir as a possible location for install-sh. - -2006-06-18 Danny Smith <dannysmith@users.sourceforge.net> - - * mingwex/dirent.c (_tGetFileAttributes): New helper function. - (_topendir): Use it. - -2006-06-18 Danny Smith <dannysmith@users.sourceforge.net> - - * include/sys/time.h: Add header guard. Add extern "C" bracketing - for __cplusplus. - (gettimeofday): Add prototype. - * mingwex/gettimeofday.c: New file. - * mingwex/makefile.in: Add gettimeofday source and object. - -2006-06-13 Danny Smith <dannysmith@users.sourceforge.net> - - * include/math.h (HUGE_VAL): Define as builtin if __GNUC__ >= 3.3, - else global library variable. - (HUGEVALF): Likewise. - (HUGEVALL): Likewise. - (INFINITY): Likewise. - (NAN): LiKewise. - -2006-06-13 Danny Smith <dannysmith@users.sourceforge.net> - - * mingwex/wcrtomb.c (wcrtomb_cp): Correct typo. - -2006-06-13 Danny Smith <dannysmith@users.sourceforge.net> - - * Makefile.in (SUBDIRS): Change to lowercase for autoconf 2.59. - -2006-05-24 Christopher Faylor <cgf@timesys.com> - - * configure.in: Update to newer autoconf. - (thanks to Steve Ellcey) - * mingwex/configure.in: Ditto. - * profile/configure.in: Ditto. - * configure: Regenerate. - * mingwex/configure: Ditto. - * profile/configure: Ditto. - * aclocal.m4: New file. - * mingwex/aclocal.m4: Ditto. - * profile/aclocal.m4: Ditto. - -2006-05-17 Danny Smith <dannysmith@users.sourceforge.net> - - * mingwex/wcrtomb.c (wcrtomb_cp): Test (wc > 255) only if C locale. - Use supplied codepage as arg to WideCharToMultiByte. - -2006-02-13 Earnie Boyd <earnie@users.sf.net> - - * Makefile.in (libmsvcr80.a): Add import lib. - (libmsvcr80d.a): Ditto. - -2006-01-18 Chris Sutcliffe <ir0nh34d@users.sourceforge.net> - - * Makefile.in: Bump cygwin build number. - -2005-10-27 Chris Sutcliffe <ir0nh34d@users.sourceforge.net> - - * Include/_mingw.h: Increment version to 3.9. - * Makefile.in: Ditto. - -2005-10-14 Danny Smith <dannysmith@users.sourceforge.net> - - * include/limits.h (SSIZE_MAX): Define. - (LLONG_MAX, LLONG_MIN, ULLONG_MAX): Separate from non-ISO names. - -2005-10-13 Wu Yongwei <adah@users.sourceforge.net> - - * include/tchar.h: Include <wchar.h> when _UNICODE is defined. - (_TEOF): New macro definition for _UNICODE and non_UNICODE cases. - -2005-10-12 Danny Smith <dannysmith@users.sourceforge.net> - - * include/stddef.h: Remove. - * include/stdarg.h: Remove. - -2005-10-12 Danny Smith <dannysmith@users.sourceforge.net> - - * mingwex/complex/csqrt.c (csqrt): The sign of real part - of result is positive when real part of arg == 0; - * mingwex/complex/csqrtf.c (csqrtf): Ditto. - * mingwex/complex/csqrtl.c (csqrtl): Ditto. - -2005-10-12 Danny Smith <dannysmith@users.sourceforge.net> - - * include/time.h (_time64): Correct prototype. - -2005-10-08 Danny Smith <dannysmith@users.sourceforge.net> - - * mingwex/fegetenv.c (fegetenv): Restore exception masks. - * mingwex/feholdexcept.c (feholdexcept): Don't set exceptions - to non-stop. Use "fnclex" to clear exception flags. - -2005-09-24 Danny Smith <dannysmith@users.sourceforge.net> - - * include/math.h (HUGE_VALF, HUGE_VALL, INFINITY, NAN) - Avoid raising FP exceptions. - -2005-09-19 Danny Smith <dannysmith@users.sourceforge.net> - - * include/stdlib.h (strtof): Add prototype. Uglify - parameter names in inline definition. - (wcstof): Likewise. - (_Exit): Uglify parameter names in inline definition. - (llabs): Add prototype. - (_set_error_mode): Add prototype and input defines. - -2005-08-25 Danny Smith <dannysmith@users.sourceforge.net> - - * mingwex/fe*.c: Revert previous changes. - * include/fenv.h: Revert previous changes. - -2005-08-25 Danny Smith <dannysmith@users.sourceforge.net> - - * mingwex/feclearexcept.c (feclearexcept): Change declaration. - Do not return a value. - * mingwex/fegetexceptflag.c (fegetexceptflag): Likewise. - * mingwex/feraiseexcept.c (feraiseexcept): Likewise. - * mingwex/fesetexceptflag.c (fesetexceptflag): Likewise. - * mingwex/fegetenv.c (fegetenv): Likewise. - * mingwex/fesetenv.c (fesetenv): Likewise. - * mingwex/feupdateenv.c (feupdateenv): Likewise. - * include/fenv.h (feclearexcept, fegetexceptflag, feraiseexcept, - fesetexceptflag, fegetenv, fesetenv, feupdateenv): Correct - prototypes. - -2005-08-25 Danny Smith <dannysmith@users.sourceforge.net> - - * mingwex/stdio/fseeko64.c (fseeko64): Flush stream before - getting filelength for SEEK_END. - -2005-08-13 Chris Sutcliffe <ir0nh34d@users.sourceforge.net> - - * Include/_mingw.h: Increment version to 3.8. - * Makefile.in: Ditto. - -2005-08-10 Danny Smith <dannysmith@users.sourceforge.net> - - * include/wctype.h (towupper, towlower): Change arg and return value - types to wint_t. - * include/ctype.h (towupper, towlower): Likewise. - -2005-08-10 Danny Smith <dannysmith@users.sourceforge.net> - - * mthr_stub.c (__mingwthr_key_dtor): Replace assert(0) with - a diagnostic, guarded by #ifdef DEBUG. - (__mingwthr_remove_key_dtor): Likewise. - -2005-08-08 Danny Smith <dannysmith@users.sourceforge.net> - - * moldname.def.in (sleep, beep, seterrormode): Remove. - -2005-06-16 Danny Smith <dannysmith@users.sourceforge.net> - - * profile/profile.h (_MCOUNT_CALL): Define as regparm(2) - (_MCOUNT_DECL): Use it. - (MCOUNT): Save and restore eax, ecx, edx registers. - * profile/mcount.c (_mcount): ANSI-fy. - -2005-06-16 Danny Smith <dannysmith@users.sourceforge.net> - - * include/_mingw.h (__MINGW_GNUC_PREREQ): Define. Use to - guard __MINGW_ATTRIB macro definitions. - * include/math.h (logb[fl]): Don't define inlines for - GCC-4.0+ && __FAST_MATH__. - (rint[fl], lrint[fl], llrint[fl]); Likewise. Clean up - line-continuation backslashes. - -2005-06-06 Danny Smith <dannysmith@users.sourceforge.net> - - * include/_mingw.h (__MINGW_ATTRIBUTE_NONNULL): Fix typo - in GNUC version guard. - -2005-05-20 Danny Smith <dannysmith@users.sourceforge.net> - - * crt1.c (_gnu_exception_handler): Handle illegal instruction - OS exception as a signal if user has defined a SIGILL handler. - -2005-05-10 Danny Smith <dannysmith@users.sourceforge.net> - - * mingwex/math/nexttoward.c: New file. - * mingwex/math/nexttowardf.c: New file. - * mingwex/math/nextafterl.c: Add nexttowardl alias. - * mingwex/Makefile.in (MATH_DISTFILES): Add nexttoward.c, - mexttowardf.c, - (MATH_OBJS): Add nexttoward.o, nexttowardf.o, - * include/math.h (nexttoward, nextowardf, nexttowardl): Add - prototypes. - -2005-05-09 Danny Smith <dannysmith@users.sourceforge.net> - - * mingwex/math/nextafterf.c (nextafterf): Correct - handling of -0.0. - * mingwex/math/nextafterl.c: New file. - * mingwex/Makefile.in (MATH_DISTFILES): Add nextafterl.c. - (MATH_OBJS): Add nextafterl.o. - * include/math.h (nextafterl): Uncomment prototype. - -2005-05-08 Danny Smith <dannysmith@users.sourceforge.net> - - * mingwex/math/erfl.c: New file. - * mingwex/Makefile.in (MATH_DISTFILES): Add erfl.c. - (MATH_OBJS): Add erfl.o. - * include/math.h (erfl, erfcl): Uncomment prototypes. - -2005-05-04 Danny Smith <dannysmith@users.sourceforge.net> - - * include/wchar.h (WCHAR_MAX): Define as 0xffff, so preprocessor - #if (WCHAR_MAX <= WCHAR_MIN) is false. - * include/stdint.h (WCHAR_MAX): Likwise. - (WINT_MAX): Likewise. - -2005-05-03 Danny Smith <dannysmith@users.sourceforge.net> - - * mingwex/math/signbit.c (__signbit): Make return value - consistent with GCC's __builtin_signbit. - * mingwex/math/signbitf.c (__signbitf): Likewise. - * mingwex/math/signbitf.c (__signbitl): Likewise. - * include/math.h (__signbit, __signbitf, __signbitl): Likewise - for inlines. - -2005-05-02 Danny Smith <dannysmith@users.sourceforge.net> - - * include/_mingw.h (__MINGW_ATTRIB_NONNULL): Don't define as - variadic macro. - * mingwex/mbrtowc.c (__mbrtowc_cp): Use __MINGW_ATTRIB_NONNULL. - Remove unused MBTOWC_FLAGS define. - -2005-04-23 Danny Smith <dannysmith@users.sourceforge.net> - - * mingwex/mbrtowc.c: New file. - * mingwex/wcrtomb.c: New file. - * mingwex/btowc.c: New file. - * mingwex/wctob.c: New file. - * mingwex/mb_wc_common.h: New file. - * mingwex/Makefile.in (DISTFILES): Add new files. - (Q8_OBJS): Add new objects. - * include/wchar.h: Adjust comment about mbrtowc() and related - funcions. Add __restrict__ to pointer params in prototypes. - (wmemset. wmemchr, wmemcpy, wmemmove, wcstoll, wcstoull): Remove - arg names from protototypes. - -2005-04-23 Wu Yongwei <adah@sh163.net> - - * mingwex/dirent.c: Formatting changes. - * mingwex/dirent.c (_topendir): Make the end-of-path slash check - MBCS-safe. - -2005-03-31 Danny Smith <dannysmith@users.sourceforge.net> - - * include/_mingw.h (__MINGW_ATTRIB_NONNULL): Define. - -2005-03-24 Danny Smith <dannysmith@users.sourceforge.net> - - * include/stdio.h (__mingw_fwrite): Change return value to - size_t. - * mingwex/mingw-fseek.c (__mingw_fwrite): Likewise. - -2005-03-15 Hans Leidekker <hans@it.vu.nl> - - * include/malloc.h (_FREEENTRY, _USEDENTRY): Correct defines. - -2005-02-25 Danny Smith <dannysmith@users.sourceforge.net> - - * include/wctype.h (wctrans): Remove _CRTIMP. - (towctrans): Likewise. - (wctype): Likewise, - -2005-02-25 Danny Smith <dannysmith@users.sourceforge.net> - - * include/wctype.h: Add comment on wctrans, towctrans, wctype. - -2005-02-25 Danny Smith <dannysmith@users.sourceforge.net> - - * mingwex/wctype.c: New file. - * mingwex/wctrans.c: New file. - * mingwex/Makefile.in (DISTFILES): Add wctype.c, wctrans.c. - * mingwex/Makefile.in (Q8_OBJS): Add wctype.o, wctrans.o. - -2005-02-11 Danny Smith <dannysmith@users.sourceforge.net> - - * include/tchar.h (_tstat64, _tstati64): Add Unicode/ANSI mappings. - -2005-02-11 Danny Smith <dannysmith@users.sourceforge.net> - - * include/assert.h: Remove header guard. #undef assert macro. - (_assert): Use __MINGW_ATTRIB_NORETURN define. - -2005-02-11 Gregory W. Chicares <chicares@cox.net> - Danny Smith <dannysmith@users.sourceforge.net> - - * include/math.h (expm1, expm1f, expmll): Add prototypes. - * mingwex/Makefile.in (MATH_DISTFILES): Add expm1.c, - expm1f.c, expm1l.c. - (MATH_OBJS): Add expm1.o, expm1f.o, expm1l.o. - * mingwex/math/expm1.c: New file. - * mingwex/math/expm1f.c: New file. - * mingwex/math/expm1l.c: New file. - -2005-02-07 Danny Smith <dannysmith@users.sourceforge.net> - - * include/sys/stat.h (struct stat): Guard with _NO_OLDNAMES. - * include/wchar.h (struct stat): Likwwise. - Bug reported to Debian by Anand Kumria <wildfire@progsoc.org> - - * include/sys/stat.h: Remove empty __STRICT_ANSI__ guard. - -2005-02-01 Danny Smith <dannysmith@users.sourceforge.net> - - * mingwex/strtold.c (__asctoe64): Set endptr to 'e' if exponent - string is not valid. - -2005-01-26 Oliver Stoeneberg <oliverst@online.de> - - * include/malloc.h: Add missing return code defines for - _heapwalk() - -2005-01-17 Danny Smith <dannysmith@users.sourceforge.net> - - * include/sys/stat.h (struct __stat64): Change st_size type to - __int64. - * include/wchar.h (struct __stat64): Change st_size type to __int64. - -2005-01-13 Earnie Boyd <earnie@users.sf.net> - - * include/sys/stat.h (_S_IFLNK, S_IFLNK, _S_ISLNK, S_ISLNK, _lstat, - lstat): Remove. - * include/errno.h (ELOOP): Ditto. - * include/_mingw.h: Increment version to 3.7. - * Makefile.in: Ditto. - -2005-01-11 Danny Smith <dannysmith@users.sourceforge.net> - - * include/tchar.h (_tfreopen): Add UNICODE mappings. - -2005-01-11 Earnie Boyd <earnie@users.sf.net> - - * include/sys/stat.h (_S_IFLNK, S_IFLNK, _S_ISLNK, S_ISLNK, _lstat, - lstat): Conditionalize defines for __STRICT_ANSI__. - -2005-01-10 Earnie Boyd <earnie@users.sf.net> - - * include/errno.h (ELOOP): Add definition. - -2005-01-10 Danny Smith <dannysmith@users.sourceforge.net> - - * mingwex/complex/(cabsl.c cacosl.c cacoshl.c cargl.c casinl.c - casinhl.c catanl.c catanhl.c ccosl.c ccoshl.c cexpl.c cimagl.c - clogl.c cpowl.c cprojl.c creall.c csinl.c csinhl.c csqrtl.c - ctanl.c ctanhl.c): New files. - * mingwex/Makefile.in (COMPLEX_DISTFILES): Adjust. - (COMPLEX_OBJS): Adjust. - * include/complex.h (cabsl, cacosl, cacoshl, cargl, casinf. - casinhl, catanl, catanhl, ccosl, ccoshl, cexpl, cimagl, clogl, - cpowl, cprojl, creall, csinl, csinhl, csqrtl, ctanl, ctanhl): - Declare. - -2005-01-06 Danny Smith <dannysmith@users.sourceforge.net> - - * include/_mingw.h (__int16): Define as short. - Thanks to: Leo Yuriev <leoyuriev at users dot sf dot net> - -2005-01-06 Danny Smith <dannysmith@users.sourceforge.net> - - * include/stdio.h (P_tmpdir): Add define. - -2005-01-03 Earnie Boyd <earnie@users.sf.net> - - * Makefile.in (inst_docdir): For Cygwin target set to share/doc/. - -2005-01-02 Earnie Boyd <earnie@users.sf.net> - - * include/_mingw.h: Increment version to 3.6 - * Makefile.in: Ditto - -2004-12-26 Danny Smith <dannysmith@users.sourceforge.net> - - * mingwex/complex/(cabsf.c cacosf.c cacoshf.c cargf.c casinf.c - casinhf.c catanf.c catanhf.c ccosf.c ccoshf.c cexpf.c cimagf.c - clogf.c cpowf.c cprojf.c crealf.c csinf.c csinhf.c csqrtf.c - ctanf.c ctanhf.c): New files. - * mingwex/Makefile.in (COMPLEX_DISTFILES): Adjust. - (COMPLEX_OBJS): Adjust. - * include/complex.h (cabsf, cacosf, cacoshf, cargf, casinf. - casinhf, catanf, catanhf, ccosf, ccoshf, cexpf, cimagf, clogf, - cpowf, cprojf, crealf, csinf, csinhf, csqrtf, ctanf, ctanhf): - Declare. - -2004-12-20 Danny Smith <dannysmith@users.sourceforge.net> - - * include/wchar.h (wcsdup): Correct prototype. - * include/string.h (wcsdup): Correct prototype. - -2004-10-14 Danny Smith <dannysmith@users.sourceforge.net> - - * include/sys/stat.h: Make S_ISLNK comment comply with ISO C90. - -2004-10-07 Danny Smith <dannysmith@users.sourceforge.net> - - * mingwex/math/fastmath.h: New file. - * mingwex/math/asinh.c: New file. - * mingwex/math/asinhf.c: New file. - * mingwex/math/asinhl.c: New file. - * mingwex/math/acosh.c: New file. - * mingwex/math/acoshf.c: New file. - * mingwex/math/acoshl.c: New file. - * mingwex/math/atanh.c: New file. - * mingwex/math/atanhf.c: New file. - * include/math.h (asinh, asinhf, asinhl, acosh, acoshf, acoshl, - atanh, atanhf, atanhl): Add prototypes. - * mingwex/Makefile.in (MATH_OBJS): Add objects for above to list. - (MATH_DISTFILES): Add sources for above and fastmath.h to list. - Specify dependency on fastmath.h for new objects. - -2004-09-08 Earnie Boyd <earnie@users.sf.net> - - * include/sys/stat.h (_S_IFLNK): Add definition. - (S_IFLNK) Ditto. - (_lstat) Ditto. - (lstat) Ditto. - (_S_ISLNK) Recode. - (S_ISLNK) Ditto. - -2004-09-08 Earnie Boyd <earnie@users.sf.net> - - * include/sys/stat.h (_S_ISLNK): Add definition. - (S_ISLNK): Ditto. - -2004-09-05 Earnie Boyd <earnie@users.sf.net> - - * include/_mingw.h: Increment minor version for 3.5 release. - * Makefile.in: Ditto. - * mingwex/Makefile.in: Correct typo in list of DISTFILES. - -2004-08-24 Danny Smith <dannysmith@users.sourceforge.net> - - * include/malloc.h (__mingw_aligned_offset_malloc, - __mingw_aligned_offset_realloc, __mingw_aligned_malloc, - __mingw_aligned_realloc, __mingw_aligned_free): Add - prototypes. - * mingwex/Makefile.in (DISTFILES): Add mingw-aligned-malloc.c, - tst-aligned-malloc.c. - (REPLACE_OBJS): Add mingw-aligned-malloc.o. - -2004-08-24 Steven G. Johnson <stevenj@alum.mit.edu> - - * mingwex/mingw-aligned-malloc.c: New file. - * mingwex/tst-aligned-malloc.c: New file. - -2004-08-24 Danny Smith <dannysmith@users.sourceforge.net> - - * crt1.c: (__mingw_CRTStartup): Change return to void. Add - noreturn attribute. Align stack to 16 bytes before passing args - to main. - (mainCRTStartup): Change return to void. - (WinMainCRTStartup): Likewise. - -2004-08-15 Danny Smith <dannysmith@users.sourceforge.net> - - * profile/COPYING: New file. - * profile/CYGWIN_LICENSE: New file. - * profile/Makefile.in (DISTFILES): Add COPYING, CYGWIN_LICENSE. - -2004-08-15 Danny Smith <dannysmith@users.sourceforge.net> - - * mingwex/fopen64.c: Move. - * mingwex/fseeko64.c: Move. - * mingwex/ftello64.c: Move. - * mingwex/lseek64.c: Move. - * mingwex/stdio/fopen64.c: To here. - * mingwex/stdio/fseeko64.c: To here. - * mingwex/stdio/ftello64.c: To here. - * mingwex/stdio/lseek64.c: To here. - -2004-08-15 Danny Smith <dannysmith@users.sourceforge.net> - - * profile/gmon.c [__MINGW32__]: Include string.h for - memset prototype. - -2004-08-08 Christopher Faylor <cgf@timesys.com> - - * mingwex/stdio/vwscanf.c: Add stdio.h needed after 2004-08-07 change. - -2004-08-07 Danny Smith <dannysmith@users.sourceforge.net> - - * include/complex.h: Remove __attribute__ ((const)) from - transcendantal and trig functions. Replace __attribute__ ((const)) - with __MINGW_ATTRIB_CONST on other declarations. - -2004-08-07 Danny Smith <dannysmith@users.sourceforge.net> - - * include/wchar.h: Reorganize, avoid including other headers. - -2004-08-07 Danny Smith <dannysmith@users.sourceforge.net> - - * include/string.h (memchr, memcmp, strchr, strcmp, strcspn) - (strlen, strncmp, strpbrk, strrchr, strspn, strstr): Add pure - attribute. - -2004-07-30 Danny Smith <dannysmith@users.sourceforge.net> - - * include/dirent.h (struct _wdirent): Remove obsolete comment. - -2004-07-30 Danny Smith <dannysmith@users.sourceforge.net> - - * include/string.h: Revert 2004-07-26 additions of - __ATTRIBUTE_PURE. - -2004-07-28 Danny Smith <dannysmith@users.sourceforge.net> - - * mingwex/math/powl.c (powl): Revert change of 2004-02-01. - (__convert_inf_to_maxnum): New.static inline. - (reducl): Use it to protect against Inf - Inf. - (__fast_ldexpl): New function. Use in lieu of ldexpl. - -2004-07-27 Danny Smith <dannysmith@users.sourceforge.net> - - * mingwex/math/expl.c (expl): Move body of code to new static - function __expl, removing tests for +/-Inf. Extern function - expl calls __expl after testing for max, min log thresholds. - -2004-07-26 Danny Smith <dannysmith@users.sourceforge.net> - - * mingwex/stdio/vsscanf.c: Add "edi" to registers-modified field - * mingwex/stdio/vfscanf.c: Likewise. - * mingwex/stdio/vswscanf.c: Likewise. - * mingwex/stdio/vfwscanf.c: Likewise. - -2004-07-26 Danny Smith <dannysmith@users.sourceforge.net> - - * include/_mingw.h: Use only two underscores to uglify - __MINGW_ATTRIB_* macros. - * include/stdlib.h: Adjust __MINGW_ATTRIB_* tokens. - * include/setjmp.h: Likewise. - - * include/sting.h: Add __MINGW_ATTRIB_PURE to locale-independent - string functions. - (_strdup, strdup): Add __MINGW_ATTRIB_MALLOC. - -2004-07-25 Danny Smith <dannysmith@users.sourceforge.net> - - * include/string.h: Group wide string functions together, - and protect with _WSTRING_DEFINED. - -2004-07-25 Danny Smith <dannysmith@users.sourceforge.net> - - * include/_mingw.h (__MINGW_ATTR_*): Replace with - __MINGW_ATTRIB_*. - * include/stdlib.h (_ATTRIB_NORETURN): Replace with - __MINGW_ATTRIB_NORETURN, throughout. - (malloc): Declare with __MINGW_ATTRIB_MALLOC. - (calloc): Likewise. - (abs): Declare with __MINGW_ATTRIB_CONST. - (labs): Likewise. - (div): Likewise. - (ldiv): Likewise. - (lldiv): Likewise. - (_rotl): Likewise. - (_rotr): Likewise. - (_lrotl): Likewise. - (_lrotr): Likewise. - * include/setjmp.h (longjmp): Add __MINGW_ATTRIB_NORETURN. - -2004-07-21 Danny Smith <dannysmith@users.sourceforge.net> - - * include/_mingw.h: Undefine __attribute__. - (__MINGW_ATTR_NORETURN): New define. - (__MINGW_ATTR_CONST): New define. - (__MINGW_ATTR_MALLOC): New define. - (__MINGW_ATTR_PURE): New define. - (_CRTIMP, __cdecl, __stdcall, __UNUSED_PARAM): Ansi-fy - expansions. - -2004-07-19 Danny Smith <dannysmith@users.sourceforge.net> - - * include/time.h (__time64_t): Add missing ';'. - -2004-07-17 Danny Smith <dannysmith@users.sourceforge.net> - - * include/time.h (wcsftime): Move out of !__STRICT_ANSI - block. - (struct tm): Protect with _TM_DEFINED. - -2004-07-17 Christopher Faylor <cgf@timesys.com> - - * Makefile.in (CC): Strip inappropriate include file settings from any - passed-in CC. - -2004-07-15 "dgun" <dgun@umpire.com> - - * include/complex.h (conj): Correct typo in prototype. - -2004-07-15 Danny Smith <dannysmith@users.sourceforge.net> - - * include/math.h: Add pragma GCC system_header. - -2004-07-15 Danny Smith <dannysmith@users.sourceforge.net> - - * mingwex/complex/carg.c: New file. - * mingwex/Makefile.in: Really add carg.o to libmingwex.a. - -2004-07-15 Corinna Vinschen <corinna@vinschen.de> - - * Makefile.in (INCLUDES): Temporarily revert previous change. - * mingwex/Makefile,in (INCLUDES): Ditto. - * profile/Makefile,in (INCLUDES): Ditto. - * mingwex/Makefile,in: Drop carg.o dependency. - -2004-07-14 Christopher Faylor <cgf@timesys.com> - - * mingwex/fwide.c: Include <stdio.h> to resolve FILE usage. - -2004-07-14 Danny Smith <dannysmith@users.sourceforge.net> - - * Makefile.in (INCLUDES): Designate $(srcdir)/../include as a - system dir. - * mingwex/Makefile,in (INCLUDES): Ditto. - * profile/Makefile,in (INCLUDES): Ditto. - - * mingwex/Makefile,in: Add carg.o to libmingwex.a. - -2004-07-13 Earnie Boyd <earnie@users.sourcefourge.net> - - * Makefile.in: Move use of --nostdinc++ as GCC3.4 warns to use it - for C modules. - * mingwex/Makefile.in: Ditto. - * profile/Makefile.in: Ditto. - * include/limits.h: Change to new file header preamble. - * include/_mingw.h: Increment minor version for 3.4 release. - * Makefile.in: Ditto. - -2004-07-12 Danny Smith <dannysmith@users.sourceforge.net> - - * mingwex/math/cephes_emath.h (__etens): Remove declaration. - -2004-07-11 Danny Smith <dannysmith@users.sourceforge.net> - - * include/unistd.h (ftruncate): Add inline definition. - * mingwex/ftruncate.c: New file. - * mingwex/Makefile.in: Add ftruncate.o to libmingwex.a. - -2004-07-10 Danny Smith <dannysmith@users.sourceforge.net> - - * include/time.h: Do not include sys/types.h. - -2004-07-02 Danny Smith <dannysmith@users.sourceforge.net> - - * mingwex/Makefile.in (MATH_DISTFILES): Remove pow.c, - (MATH_OBJS): Remove pow,o. - * include/math.h (pow): Declare with _CRTIMP. - Add comment on how to avoid excess precision problems. - -2004-06-30 Danny Smith <dannysmith@users.sourceforge.net> - - * include/stdio.h (__mingw_fseeko64): Add prototype. - * mingwex/mingw-fseek.c (__mingw_fseeko64): Add definition. - (__mingw_fwrite): Handle huge files. - -2004-06-30 Kees Zeelenberg <kzlg@users.sourceforge.net> - Danny Smith <dannysmith@users.sourceforge.net> - - * include/stdio.h (fopen64): Add inline function. - (fseeko64): Add prototype. - (ftello64): Add inline function. - * include/io.h (lseek64): Add inline function. - * include/sys/types (off64_t): Add typedef. - (fpos64_t): Add typedef. - * mingwex/fopen64.c: New file. - * mingwex/fseeko64.c: New file. - * mingwex/ftello64.c: New file. - * mingwex/lseek64.c: New file. - * mingwex/Makefile.in (STDIO_DISTFILES): Add fopen64.c, - fseeko.64.c, ftello64.c, lseek64.c. - (STDIO_OBJS): Add fopen64.o, fseeko.64.o, ftello64.o, lseek64.o. - -2004-04-24 Luke Dunstan <infidel@users.sourceforge.net> - - * include/limits.h (_I64_MIN, _I64_MAX, _UI64_MAX): Add defines. - -2004-04-22 Earnie Boyd <earnie@users.sf.net> - - * DISCLAIMER: Add words about "free to use". - * README: Modify "Win32 runtime" to "Microsoft C Runtime". - * Makefile.in (SRCDIST_FILES): Add DISCLAIMER and CONTRIBUTORS. - (inst_docdir): New variable. - (INSTDOCS): Ditto. - (FLAGS_TO_PASS): Include inst_docdir. - (install-dirs): Add inst_docdir. - (install): Add loop for INSTDOCS. - * strncasecmp.c: Reword copyright and disclaimer. Move Contributors - section to CONTRIBUTORS file. Remove RCS tags. - -2004-04-22 Danny Smith <dannysmith@users.sourceforge.net> - - * mingwex/math/lround.c: Rewrite. - * mingwex/math/lroundf.c: Rewrite. - * mingwex/math/lroundl.c: Rewrite. - * mingwex/math/llround.c: Rewrite. - * mingwex/math/llroundf.c: Rewrite. - * mingwex/math/llroundl.c: Rewrite. - -2004-04-20 Earnie Boyd <earnie@users.sf.net> - - * CONTRIBUTORS: New file. - * DISCLAIMER: Ditto. - * CRT_noglob.c: Reword copyright and disclaimer. Move Contributors - section to CONTRIBUTORS file. Remove RCS tags. - * CRTFmode.c: Ditto. - * CRTglob.c: Ditto. - * CRTinit.c: Ditto. - * crt1.c: Ditto. - * crtdll.dev: Ditto. - * dllcrt1.c: Ditto. - * dllmain.c: Ditto. - * gccmain.c: Ditto. - * init.c: Ditto. - * isascii.c: Ditto. - * iscsym.c: Ditto. - * iscsymf.c: Ditto. - * jamfile: Ditto. - * main.c: Ditto. - * msvcrt.def.in: Ditto. - * strcasecmp.c: Ditto. - * toascii.c: Ditto. - * wcscmpi.c: Ditto. - * include/assert.h: Ditto. - * include/conio.h: Ditto. - * include/ctype.h: Ditto. - * include/direct.h: Ditto. - * include/dirent.h: Ditto. - * include/dos.h: Ditto. - * include/errno.h: Ditto. - * include/excpt.h: Ditto. - * include/fcntl.h: Ditto. - * include/float.h: Ditto. - * include/io.h: Ditto. - * include/locale.h: Ditto. - * include/malloc.h: Ditto. - * include/math.h: Ditto. - * include/process.h: Ditto. - * include/setjmp.h: Ditto. - * include/share.h: Ditto. - * include/signal.h: Ditto. - * include/stdio.h: Ditto. - * include/stdlib.h: Ditto. - * include/string.h: Ditto. - * include/tchar.h: Ditto. - * include/time.h: Ditto. - * include/wchar.h: Ditto. - * include/sys/locking.h: Ditto. - * include/sys/param.h: Ditto. - * include/sys/stat.h: Ditto. - * include/sys/timeb.h: Ditto. - * include/sys/types.h: Ditto. - * include/sys/utime.h: Ditto. - * mingwex/dirent.c: Ditto. - -2004-04-19 Earnie Boyd <earnie@users.sf.net> - - * include/_mingw.h: Revert to primary release 3 and increment minor - release to 3. - * Makefile.in (VERSION): Ditto. - -2004-04-01 Danny Smith <dannysmith@users.sourceforge.net> - - * crt1.c (_mingw32_init_fmode): Set *_imp___fmode_dll to - _fmode if not __MSVCRT__. - -2004-03-30 Danny Smith <dannysmith@users.sourceforge.net> - - * include/io.h: (_findfirst): Correct prototype. - -2004-03-30 Hans Leidekker <hans@it.vu.nl> - - * include/io.h: (_findnext, _findclose): Correct prototype. - -2004-03-28 Hans Leidekker <hans@it.vu.nl> - - * include/math.h (FP_*): Add defines. - -2004-03-29 Danny Smith <dannysmith@users.sourceforge.net> - - * mingwex/math/round.c: Rewrite. - * mingwex/math/roundf.c: Rewrite. - * mingwex/math/roundl.c: Rewrite. - -2004-03-25 Danny Smith <dannysmith@users.sourceforge.net> - - * include/_mingw.h (__MSVCRT_VERSION__): Define default as 0x0600. - * include/time.h (__time64_t): Add typedef. - (_mktime64): Add prototype for __MSVCRT_VERSION__ >= 0x0601. - (_ctime64): Likewise. - (_wctime64): Likewise. - (_gmtime64): Likewise. - (_localtime64): Likewise. - (wcsftime): Move into _WTIME_DEFINED block. - Regroup non-ANSI prototypes. - * include/io.h: Include <stdint.h>. - (__finddata64_t): Add struct definition. - (__wfinddata64_t): Likewise. - (_findfirst64): Add prototype for __MSVCRT_VERSION__ >= 0x0601. - (_findnext64): Likewise. - (_wfindfirst64): Likewise. - (_wfindnext64): Likewise. - * include/sys/timeb.h (__timeb64): Add struct definition. - (_ftime64): Add prototype for __MSVCRT_VERSION__ >= 0x0601. - * include/sys/utime.h (__utimbuf64): Add struct definition. - (_utime64): Add prototype for __MSVCRT_VERSION__ >= 0x0601. - (_futime64): Likewise. - (_wutime64): Likewise. - * include/sys/stat.h (__stat64): Add struct definition. - (_fstat64): Add prototype for __MSVCRT_VERSION__ >= 0x0601. - (_stat64): Likewise. - (_wstat64): Likwise. - * include/sys/types.h (__time64_t): Add typedef. - * include/wchar.h (__wfinddata64_t): Add structure definition. - (__stat64): Likewise. - (_wctime64): Add prototype for __MSVCRT_VERSION__ >= 0x0601. - (_wfindfirst64): Likewise. - (_wfindnext64): Likewise. - (_wutime64): Likewise. - (_wstat64): Likwise. - * include/malloc.h (_aligned_free): Add prototype for - __MSVCRT_VERSION__ >= 0x0700. - (_aligned_malloc): Likewise. - (_aligned_offset_malloc): Likewise. - (_aligned_offset_realloc): Likewise. - (_aligned_realloc): Likewise. - * include/string.h (_wcserror): Add prototype for - __MSVCRT_VERSION__ >= 0x0700. - (__wcserror): Likewise. - * include/math.h (_set_SSE2_enable): Add prototype for - __MSVCRT_VERSION__ >= 0x0701. - -2004-03-25 Danny Smith <dannysmith@users.sourceforge.net> - - * include/stdio.h (_fsopen): Add prototype. - * include/tchar.h (_tfsopen): Add defines. - Thanks to "Gerik" <gerikr at users dot sourceforge dot net> - -2004-03-19 Danny Smith <dannysmith@users.sourceforge.net> - - * msvcrt.def.in: Add stubs for msvcrt.dll (version 6.10), - msvcr70.dll, and msvcr71.dll. - * Makefile.in (msvcr*.def): Define preprocessor __msvcr*__ constant - using basename of output def file. - -2004-03-13 Danny Smith <dannysmith@users.sourceforge.net> - - * include/malloc.h: Remove __STRICT_ANSI__ guard. - -2004-03-11 Brian Keener <bkeener@thesoftwaresource.com> - - * include/process.h: Remove the #endif associated with removal of - __STRICT_ANSI__ guard from non-ANSI header. - -2004-03-10 Danny Smith <dannysmith@users.sourceforge.net> - - * include/conio.h: Remove __STRICT_ANSI__ guard from non-ANSI header. - * include/direct.h: Ditto. - * include/dirent.h: Ditto. - * include/dos.h: Ditto. - * include/excpt.h: Ditto. - * inlude/fcntl,h - * include/io.h: Ditto. - * inlude/mem.h: Ditto. - * include/memory.h: Ditto. - * include/process.h: Ditto. - * inlude/search.h: Ditto. - * include/share.h: Ditto. - * include/unistd.h: Ditto. - * include/sys/fcntl.h: Ditto. - * include/file.h: Ditto. - * include/sys/locking.h: Ditto. - * include/sys/param.h: Ditto. - * include/sys/stat,h - * include/sys/time.h: Ditto. - * include/sys/timeb.h: Ditto. - * include/sys/types.h: Ditto. - * include/sys/unistd.h: Ditto. - * include/sys/utime.h: Ditto. - -2004-02-21 Danny Smith <dannysmith@users.sourceforge.net> - - * include/_mingw.h (__UNUSED_PARAM): Define macro. - * include/wchar.h (fwide): Use it. - (mbsinit): Ditto. - -2004-02-05 Danny Smith <dannysmith@users.sourceforge.net> - - * mingwex/getopt.c: Define IS_POSIXLY_CORRECT as per - NetBSD getopt_long.c. - -2004-02-05 Danny Smith <dannysmith@users.sourceforge.net> - - * mingwex/strtold.c (__asctoe64) Reorganise. Fix setting error - codes and handling of special chars. - -2004-02-02 Danny Smith <dannysmith@users.sourceforge.net> - - * include/stdio.h (feof): Add inlined definition. - (ferror): Ditto. - -2004-02-01 Danny Smith <dannysmith@users.sourceforge.net> - - * mingwex/math/ldexpl.c (ldexpl): Call __asm__("fscale") - directly, rather than via scabnl. - -2004-02-01 Danny Smith <dannysmith@users.sourceforge.net> - - * mingwex/math/powl.c (powl): Return infinity if - extended precision multiplication of x by log2(y) - overflows. - -2004-01-31 Danny Smith <dannysmith@users.sourceforge.net> - - * mingwex/math/cephes_emath.h (__enan_64): Fix thinko. - (__enan_NI16): Fix another one. - (__enan_NBITS): Tidy. - -2004-01-16 Danny Smith <dannysmith@users.sourceforge.net> - - * include/stdint.h Fix __STDC_CONSTANT_MACROS for 8 and 16 bit - types. (Thanks to John Maddock for report.) - -2004-01-14 Greg Chicares <chicares@users.sourceforge.net> - - * include/tchar.h (_puttchar): Define. - -2003-12-13 Danny Smith <dannysmith@users.sourceforge.net> - - * include/stdio.h:(_fileno): Define macro version after both - fileno and _fileno functions declared. - - * include/stdio.h (_rmtmp, rmtmp): Add prototypes. - * moldnames.def.in (rmtmp) Add stub. - -2003-11-27 Dimitry Sibiryakov <aafemt@users.sourceforge.net> - - * include/signal.h (SIG_SGE, SIG_ACK): Add defines. - -2003-10-27 Danny Smith <dannysmith@users.sourceforge.net> - - * include/math.h: Guard ISO C99 additions with __cplusplus - not __GLIBCPP__. - -2003-10-21 Danny Smith <dannysmith@users.sourceforge.net> - - * include/_mingw.h: Define __attribute__((x)) to nothing - if not __GNUC__. - -2003-10-21 Danny Smith <dannysmith@users.sourceforge.net> - - * include/complex.h: New file. - * mingwex/complex: New directory. - * mingwex/complex/cabs.c: New file. - * mingwex/complex/cacos.c: New file. - * mingwex/complex/cacosh.c: New file. - * mingwex/complex/casin.c: New file. - * mingwex/complex/casinh.c: New file. - * mingwex/complex/catan.c: New file. - * mingwex/complex/catanh.c: New file. - * mingwex/complex/ccos.c: New file. - * mingwex/complex/ccosh.c: New file. - * mingwex/complex/cexp.c: New file. - * mingwex/complex/cimag.c: New file. - * mingwex/complex/clog.c: New file. - * mingwex/complex/cpow.c: New file. - * mingwex/complex/cproj.c: New file. - * mingwex/complex/creal.c: New file. - * mingwex/complex/csin.c: New file. - * mingwex/complex/csinh.c: New file. - * mingwex/complex/csqrt.c: New file. - * mingwex/complex/ctan.c: New file. - * mingwex/complex/ctanh.c: New file. - * mingwex/Makefile.in (COMPLEX_DISTFILES): New list of - files. - (dist): Use it. - (COMPLEX_OBJS): New list of objects. - (LIB_OBJS): Include it in the library. - -2003-10-21 Danny Smith <dannysmith@users.sourceforge.net> - - * include/math.h (cabs): Remove non-ISO prototype. - -2003-10-21 Danny Smith <dannysmith@users.sourceforge.net> - - * mingwex/math/cephes_mconf.h (NAN, NANF, NANL): - Use GCC __builtin's if available. - (INFINITY, INFINITYF, INFINITYL): Likewise. - -2003-10-21 Danny Smith <dannysmith@users.sourceforge.net> - - * mingwex/math/s_erf.c (erf): Set errno to ERANGE if - beyond approximation limit. - * mingwex/math/sf_erf.c (erff): Likewise. - -2003-10-17 Danny Smith <dannysmith@users.sourceforge.net> - - * include/stdio.h (getc): Cast result to unsigned char before - return. - (putc): Likewise - (getchar): Likewise. - (putchar): Likewise. - Thanks to M.Fujii <boochang@m4.kcn.ne.jp> - -2003-10-10 Earnie Boyd <earnie@users.sf.net> - - * include/_mingw.h: Increment version to 3.2. - * Makefile.in: Ditto. - -2003-10-10 Earnie Boyd <earnie@users.sourceforge.net> - - * include/sys/types.h: Revert last change. - -2003-10-10 Earnie Boyd <earnie@users.sourceforge.net> - - * include/sys/types.h (ssize_t): Correct the definition. - -2003-10-03 Danny Smith <dannysmith@users.sourceforge.net> - - * include/stdio.h (_filbuf): Add prototype. - (_flsbuf): Add prototype. - (getc): Add inline version. - (putc): Likewise. - (getchar): Likewise. - (putchar): Likewise. - -2003-10-03 Danny Smith <dannysmith@users.sourceforge.net> - - * mingwex/dirent.c (_treaddir): Reset errno to 0 if end - of directory. - -2003-09-29 Danny Smith <dannysmith@users.sourceforge.net> - - * include/stdlib.h: Guard non-ISO functions with - !__STRICT_ANSI__, throughout. - -2003-09-24 Danny Smith <dannysmith@users.sourceforge.net> - - * include/io.h (_fileno): Remove prototype. - (fileno): Likewise. - (FILENAME_MAX): Define, if needed. - Don't include <stdio.h>. - * include/stdio.h (FILENAME_MAX): Protect against - prior definition. - (_fileno): Define macro implementation. - (fileno): Likewise. - -2003-09-24 Danny Smith <dannysmith@users.sourceforge.net> - - * include/inttypes.h: Include _mingw.h. - -2003-09-24 Danny Smith <dannysmith@users.sourceforge.net> - - * include/_mingw.h (__CRT_INLINE): Define. - * include/ctype.h: Replace 'extern inline' with __CRT_INLINE, - throughout - * include/inttypes.h: Likewise. - * include/math.h: Likewise. - * include/stdio.h: Likewise. - * include/stdlib.h: Likewise. - * include/string.h: Likewise. - * include/wchar.h: Likewise. - * include/wctype.h: Likewise. - -2003-09-22 Roland Schwingel <rolandschwingel@users.sourceforge.net> - - * mingwex/dirent.c (_topendir): Allocate enough memory for - DIR struct in UNICODE case too. - -2003-09-15 Earnie Boyd <earnie@users.sf.net> - - * include/_mingw.h: Increment version to 3.2. - * Makefile.in: Ditto. - -2003-07-03 Earnie Boyd <earnie@users.sf.net> - - * config.guess, config.sub: Update with versions from ftp.gnu.org. - -2003-07-03 Danny Smith <dannysmith@users.sourceforge.net> - - * mingwex/math/trunc.c (trunc): Provide lvalue for memory input constraint. - * mingwex/math/truncf.c (truncf): Likewise. - * mingwex/math/truncl.c (truncl): Likewise. - * mingwex/math/modff.c (modff): Likewise. - * mingwex/math/modfl.c (modfl): Likewise. - -2003-07-03 Danny Smith <dannysmith@users.sourceforge.net> - - * include/search.h: New file. - * include/stdlib.h: Add comment about qsort, bsearch in - search.h. - * test_headers.c: Include search.h. - * moldname.def.in (lfind, lsearch): Add. - -2003-07-03 Danny Smith <dannysmith@users.sourceforge.net> - - * include/process.h (_execv, _execvp, _spawnv, _spawnvp, _execve, - _execvpe, _spawnve, _spawnvpe, execv, execvp, spawnv, spawnvp, - execve, execvpe, spawnve, spawnvpe): Const-ify all the char params. - -2003-07-01 Earnie Boyd <earnie@users.sf.net> - - * include/_mingw.h (small, hyper): Change to __small and __hyper to - avoid user space name conflicts. - -2003-07-01 Earnie Boyd <earnie@users.sf.net> - - * include/_mingw.h (__int32, __int16, __int8, small, hyper): Define. - Note: Also added to w32api/include/basetyps.h. - * mingwex/math/tgamma.c, tgammaf.c, tgammal.c (small): - Rename to Small (case difference). - -2003-06-18 Earnie Boyd <earnie@users.sf.net> - - * include/dirent.h (dirent): Make d_name and array instead of a pointer. - * mingwex/dirent.c: Modifications througout to fill d_name array. - * Makefile.in (LIBS): Add new MSVCRT libraries libmsvcr70 and - libmsvcr71, including debug versions. - (msvcr70.def, msvcr70d.def, msvcr71.def, msvcr71.def): New targets. - -2003-06-17 Danny Smith <dannysmith@users.sourceforge.net> - - * msvcrt.def.in (__badioinfo, __lc_codepage, __lc_handle, - __pioinfo, __setlc_active, _unguarded_readlc_active, _dstbias): - Mark as DATA. - Thanks to: Aaron W LaFramboise <AWLaFramboise@aol.com> - -2003-05-30 Sascha Sommer <saschasommer@freenet.de> - - * include/sys/types.h (_ssize_t, ssize_t): Add typedefs. - -2003-05-15 Danny Smith <dannysmith@users.sourceforge.net> - - * include/stdlib.h (_Exit): Move out of __STRICT_ANSI__ block, - but still protect inline definition with __STRICT_ANSI__. - -2003-05-14 Danny Smith <dannysmith@users.sourceforge.net> - - * string_old.c: Remove, splitting into... - * strcasecmp.c: New file. - * strncasecmp.c: New file. - * wscmpi.c : New file. - * ctype_old.c: Remove, splitting into... - * isascii.c: New file. - * iscsym.c: New file. - * iscsymf.c: New file. - * toascii.c: New file. - * Makefile.in (MOLD_OBJS): Adjust. - (SRCDIST_FILES): Adjust. - -2003-05-13 Danny Smith <dannysmith@users.sourceforge.net> - - * include/math.h (fabs) : Remove inline definition. - (fabsf): Likewise. - (fabsl): Likewise. - -2003-05-06 Earnie Boyd <earnie@users.sf.net> - - * include/_mingw.h: Change version to 3.0 - * Makefile.in: Ditto. - -2003-05-06 Earnie Boyd <earnie@users.sf.net> - - * configure.in (W32API_INCLUDE): Need the -I switch in the value. - * mingwex/configure.in (W32API_INCLUDE): Ditto. - * profile/configure.in (W32API_INCLUDE): Ditto. - -2003-05-06 Earnie Boyd <earnie@users.sf.net> - - * configure.in (CFLAGS): Remove -D__USE_CRTIMP=1 due to possibilites - of multiply defined symbols if the symbols is defined locally. E.G.: - A local definition of malloc causes this problem. - * configure: Regenerate. - * profile/Makefile.in (W32API_INCLUDE): New variable. - (ALL_CFLAGS): Use W32API_INCLUDE value. - (ALL_CXXFLAGS): Ditto. - (gcrt0.o gcrt1.o gcrt2.o): Use ALL_CFLAGS instead of CFLAGS. - Thanks to Jeff Bonggren <jbon@users.sf.net>. - * profile/configure.in (W32API_INCLUDE): Set default value. - * profile/configure: Regenerate. - * mingwex/Makefile.in (W32API_INCLUDE): New variable. - (ALL_CFLAGS): Use W32API-INCLUDE value. - (ALL_CXXFLAGS): Ditto. - * mingwex/configure.in (W32API_INCLUDE): Set default value. - * mingwex/configure: Regenerate. - -2003-05-05 Earnie Boyd <earnie@users.sf.net> - - * Makefile.in (W32API_INCLUDE): New variable. - (ALL_CFLAGS): Use W32API_INCLUDE value. - (ALL_CXXFLAGS): Ditto. - * configure.in (CFLAGS): Add -D__USE_CRTIMP=1 to default values. - (W32API_INCLUDE): Set default value. - * configure: Regenerate. - -2003-04-11 Earnie Boyd <earnie@users.sf.net> - - * configure.in (LIBM_A): Define for cygwin target. - * configure (LIBM_A): Ditto. - -2003-04-07 Danny Smith <dannysmith@users.sourceforge.net> - - * include/time.h (strftime): Remove duplicate declaration. - -2003-04-01 Danny Smith <dannysmith@users.sourceforge.net> - - * include/_mingw.h (_CRTIMP): Make conditional on __USE_CRTIMP. - -2003-03-16 Danny Smith <dannysmith@users.sourceforge.net> - - * mingwex/dirent.c (_topendir): Eliminate signed/unsigned warning. - * mingwex/strtoimax.c (strtoimax): Likewise. - * mingwex/wcstoimax.c (wcstoimax): Likewise. - * mingwex/wtoll.c (wtoll): Remove unnecessary ';' - * mingwex/fesentenv.c: Include float.h. - * mingwex/math/powl.c: Eliminate type punning/strict aliasing - warning. - * mingwex/math/tanhl.c: Eliminate signed/unsigned warning in - constants. - * mingwex/math/tgammal.c: Likewise. - -2003-03-16 Danny Smith <dannysmith@users.sourceforge.net> - - * include/utime.h: New file, forwarding to sys/utime.h. - -2003-03-16 Danny Smith <dannysmith@users.sourceforge.net> - - * include/sys/param.h (MAXPATHLEN): Define. - -2003-03-16 Danny Smith <dannysmith@users.sourceforge.net> - - * include/tchar.h: Ansi-fy a comment. - -2003-03-16 Danny Smith <dannysmith@users.sourceforge.net> - - * profile/profile.h (mcount): Use __builtin_return_address - rather than inline __asm statements. - * profile/Makefile.in: Remove special rule for mcount.o - Specify dependencies for mcount.o profil.o gmon.o. - -2003-03-10 Danny Smith <dannysmith@users.sourceforge.net> - - * include/stdlib.h (qsort): Remove const from first parm. - Thanks to: Tien-Ren Chen <trchen@sourceforge.users.net> - -2003-03-03 Christopher Faylor <cgf@redhat.com> - - * mingwex/getopt.c: Refresh from NetBSD sources. - -2003-03-03 Danny Smith <dannysmith@users.sourceforge.net> - - * mingwex/getopt.c: New file, copied from cygwin srcs. - * include/getopt.h: New file, copied from cygwin srcs. - * include/unistd.h: Include getopt.h. - * mingwex/Makefile.in (DISTFILES): Add getopt.c. - (POSIX_OBJS): Add getopt.o. - -2003-03-02 Danny Smith <dannysmith@users.sourceforge.net> - - * include/stdio.h (vscanf): Add prototype. - (vfscanf): Ditto. - (vsscanf): Ditto. - (vwscanf): Ditto. - (vfwscanf): Ditto. - (vswscanf): Ditto. - * include/wchar.h (vwscanf): Add prototype. - (vfwscanf): Ditto. - (vswscanf): Ditto. - * mingwex/snprintf.c: Move to mingwex/stdio. - * mingwex/vsnprintf.c: Ditto. - * mingwex/snwprintf.c: Ditto. - * mingwex/vsnwprintf.c: Ditto. - * mingwex/Makefile.in (VPATH): Add $(srcdir)/stdio - (STDIO_DISTFILES): Add. - (DISTFILES): Adjust. - (STDIO_STUB_OBJS): Rename to STDIO_OBJS and add v*scanf objects. - (LIB_OBJS): Adjust. - (dist): Adjust. - -2003-03-02 Aaron W LaFramboise <AWLaFramboise@aol.com> - - * mingwex/stdio: New directory - * mingwex/stdio/vfscanf.c: New file. - * mingwex/stdio/vfwscanf.c: New file. - * mingwex/stdio/vscanf.c: New file. - * mingwex/stdio/vsscanf.c: New file. - * mingwex/stdio/vswscanf.c: New file. - * mingwex/stdio/vwscanf.c: New file. - -2003-02-25 Earnie Boyd <earnie@users.sf.net> - - * Makefile.in (libmsvcrt20.a): Remove target and dependencies. - (libmsvcrt40.a): Ditto. - -2003-02-21 Earnie Boyd <earnie@users.sf.net> - - Thanks to David Frasier <davidf@sjsoft.com> who inspired portions of - this patch. - * Makefile.in (libmsvcrtd.a): Add target library. - (libmoldnamed.a): Ditto. - (msvcrt.def, msvcrtd.def, msvcrt20.def, msvcrt40.def): Use msvcrt.def.in - template to create. - ($(srcdir)): Remove explicit reference for depencies of object targets. - * moldname.def, moldname-msvcrt.def, moldname-crtdll.def, msvcrt.def, - msvcrt20.def, msvcrt40.def: Remove. - * msvcrt.def.in: New file (Copy of previous msvcrt.def). - -2003-02-20 Corinna Vinschen <corinna@vinschen.de> - - * Makefile.in: Make sure libmingwex.a from current build tree is used. - -2003-02-14 Christopher Faylor <cgf@redhat.com> - - * profile/Makefile.in (mcount.o): Use ALL_CFLAGS for compilation to - ensure -mno-cygwin where appropriate. Filter out -O2. - -2003-02-13 Danny Smith <dannysmith@users.sourceforge.net> - - * profile/Makefile.in (mcount.o): Use -O1 optimization - switch to compile. - -2003-02-10 Danny Smith <dannysmith@users.sourceforge.net> - - * include/math.h: Remove _CRTIMP from pow() prototype, - unless __NO_ISOCEXT. - -2003-02-10 Danny Smith <dannysmith@users.sourceforge.net> - - * mingwex/math/cephes_emath.h: Don't redefine INFINITY. - -2003-02-10 Danny Smith <dannysmith@users.sourceforge.net> - - * include/_mingw.h (_CRTIMP): Define for __GNUC__ if - __declspec(dllimport) supported. - (__cdecl): Define if not already defined. - (__stdcall): Likewise. - * include/dirent.h: Qualify fuctions with __cdecl. - * include/fenv.h: Likewise. - * include/inttypes.h: Likewise. - * include/assert.h: Qualify fuctions with __cdecl. Qualify - CRT dll imports with _CRTIMP. - * include/conio.h: Likewise. - * include/ctype.h: Likewise. - * include/direct.h: Likewise. - * include/dos.h: Likewise. - * include/errno.h: Likewise. - * include/float.h: Likewise. - * include/io.h: Likewise. - * include/locale.h: Likewise. - * include/malloc.h: Likewise. - * include/math.h: Likewise. - * include/mbctype.h: Likewise. - * include/mbstring.h: Likewise. - * include/process.h: Likewise. - * include/setjmp.h: Likewise. - * include/signal.h: Likewise. - * include/stdio.h: Likewise. - * include/stdlib.h: Likewise. - * include/string.h: Likewise. - * include/time.h: Likewise. - * include/wchar.h: Likewise. - * include/wctype.h: Likewise. - * include/sys/stat.h: Likewise. - * include/sys/timeb.h: Likewise. - * include/sys/utime.h: Likewise. - - * include/ctype.h: Guard ctype inlines with __NO_INLINE__. - * include/wctype.h: Guard wctype inlines with __NO_INLINE__. - - * include/stdio.h (__VALIST): Guard against prior definition. - -2003-02-08 Earnie Boyd <earnie@users.sf.net> - - * include/_mingw.h: Change version to 3.0 - * Makefile.in: Ditto. - -2003-02-08 Earnie Boyd <earnie@users.sf.net> - - * include/stdlib.h: Make words after #endif a comment. - -2003-02-07 Danny Smith <dannysmith@users.sourceforge.net> - - * include/locale.h: Include stddef.h for definition of NULL. - -2003-01-26 Danny Smith <dannysmith@users.sourceforge.net> - - * include/math.h (tgamma): Correct typo in comment. - -2003-01-26 Danny Smith <dannysmith@users.sourceforge.net> - - * mingwex/mingw-fseek.c (INLINE): Remove define. - (__mingw_is_win9x): Remove static inline function. - (_mingw_fwrite): Use _osver instead of __mingw_is_win9x. - -2003-01-11 Danny Smith <dannysmith@users.sourceforge.net> - - * mingwex/math/llround.c: Correct function name and - change return value to long long. - -2003-01-07 Danny Smith <dannysmith@users.sourceforge.net> - - * include/ctype.h (__isascii): Don't cast arg to unsigned. - (iswascii): Likewise. Correct mask. - * include/wctype.h (iswascii): Don't cast arg to unsigned. - Correct mask - -2003-01-03 Danny Smith <dannysmith@users.sourceforge.net> - - * include/stdlib.h (_osver, _winver, _winmajor, - _winminor): Declare as direct imports from dll if - __DECLSPEC_SUPPORTED. - -2003-01-01 Danny Smith <dannysmith@users.sourceforge.net> - - * pseudo-reloc.c (do_pseudo_reloc): Make static. - * pseudo-reloc-list.c: New file. - * crt1.c (_pei386_runtime_relocator): Declare. - (__mingw_CRTStartup): Call it. - * dllcrt1.c (_pei386_runtime_relocator): Declare. - (DllMainCRTStartup): Call it. - * Makefile.in: Add pseudo-reloc.o pseude-reloc-list.o to - libmingw32.a. - -2003-01-01 Egor Duda <deo@logos-m.ru> - - * pseudo-reloc.c: New file. - -2002-12-20 Earnie Boyd <earnie@users.sf.net> - - * include/_mingw.h: Increment version to 2.4. - Makefile.in: Ditto. - -2002-12-12 Earnie Boyd <earnie@users.sf.net> - - * include/malloc.h (_alloca): Add definition. - (alloca): Ditto. - -2002-12-08 Danny Smith <dannysmith@users.sourceforge.net> - - * mingwex/math/s_erf.c: New file. - * mingwex/math/sf_erf.c: New file. - * mingwex/Makefile.in (MATH_DISTFILES): Add new files. - (MATH_OBJS): Add new objects. - * include/math.h (erf[f]): Add prototypes. - (erfc[f]): Add prototypes. - -2002-12-07 Danny Smith <dannysmith@users.sourceforge.net> - - * include/math.h: Add traditional/XOPEN math constants. - -2002-11-27 Danny Smith <dannysmith@users.sourceforge.net> - - * mingwex/math/lgamma.c: New file. - * mingwex/math/lgammaf.c: New file. - * mingwex/math/lgammal.c: New file. - * mingwex/math/tgamma.c: New file. - * mingwex/math/tgammaf.c: New file. - * mingwex/math/tgammal.c: New file. - * mingwex/math/cephes_mconf (polevlf): Add float version. - (p1evlf): Likewise. - Define _CEPHES_USE_ERRNO. - * mingwex/Makefile.in (MATH_DISTFILES): Add new files. - (MATH_OBJS): Add new objects. - * include/math.h (lgamma[fl]): Add prototypes. - (tgamma[fl]): Add prototypes. - -2002-11-26 Danny Smith <dannysmith@users.sourceforge.net> - - * mingwex/strtold.c: New file. - * mingwex/wcstold.c: New file. - * mingwex/ldtoa.c: New file. - * mingwex/math/cephes_emath.h: New file. - * mingwex/math/cephes_emath.c: New file. - * mingwex/Makefile.in (DISTFILES): Add new files. - (MATH_DISTFILES): Ditto. - (STDLIB_OBJS): New. Define as strtold.c wcstold.c. - (MATH_OBJS): Add cephes_emath.o. - (LIB_OBJS): Add $(STDLIB_OBJS). - * include/stdlib.h (strtold, wcstold): Add prototypes. - * include/wchar.h (wcstold): Add prototype. - -2002-11-09 Danny Smith <dannysmith@users.sourceforge.net> - - * include/math.h (sqrt): Remove inline definition. - (sqrtf): Replace inline definition with prototype. - (sqrtl): Likewise. - * mingwex/math/sqrtf.c (sqrtf): Set domain error if - argument less than zero. - * mingwex/math/sqrtf.c (sqrtl): Likewise. - -2002-10-30 Guido Serassio <serassio@libero.it> - - * include/stdio.h (_getmaxstdio): Add prototype. - (_setmaxstdio): Likewise. - -2002-10-19 Kang Li <rubylith@users.sourceforge.net> - - * include/fcntl.h (O_SEQUENTIAL): Correct typo. - -2002-10-19 Danny Smith <dannysmith@users.sourceforge.net> - - * crt1.c: Define new macro __IN_MINGW_RUNTIME before including - stdlib.h. - Define WIN32_MEAN_AND_LEAN before including windows.h - * include/stdlib.h (_fmode): Protect declaration as dllimported - variable with __IN_MINGW_RUNTIME. - -2002-10-19 Igor Pechtchanski <pechtcha@cs.nyu.edu> - - * crt1.c: Include stdlib.h. - -2002-10-19 Danny Smith <dannysmith@users.sourceforge.net> - - * Makefile.in (CRT0S): Add txtmode.o binmode.o. - (MINGW_OBJS): Add txtmode.o. - (SRCDIST_FILES): Add txtmode.c binmode.c. - crt1.c: Don't include fcntrl.h, stdlib.h. - (_fmode): Declare, without dllimport attribute. - (__p__fmode): Declare access function for dll's _fmode. - (_mingw32_init_fmode): Sync dll _fmode with staticly linked - _fmode for app. - * txtmode.c: New file. - * binmode.c: New file. - * samples/fmode/test2.c: New file. - * samples/fmode/jamfile: Add test2.exe target. - -2002-10-11 Danny Smith <dannysmith@users.sourceforge.net> - - * include/stdint.h (INT64_C, UINT64_C ): Append suffix to let - macros work with C89. - (INTMAX_C, UINTMAX_C): Likewise. - -2002-10-11 Danny Smith <dannysmith@users.sourceforge.net> - - * include/string.h (strcasecmp): Make extern __inline__. - (strncasecmp): Likewise. - (wcscmpi): Likewise. - -2002-10-08 Heiko Gerdau <hg@technosis.de> - - * include/tchar.h (_tchdir. _tgetcwd, _tgetdcwd. - _tmkdir, _trmdir, _tstat): Add ASCII and UNICODE - mappings. - -2002-10-07 Danny Smith <dannysmith@users.sourceforge.net> - - * mingwex/math/powil.c: Rename powil to __powil. - * mingwex/math/powl.c: Adjust declaration and call - to __powil. Remove comment on powil. - * mingwex/math/powi.c: New file. - * mingwex/math/powif.c: New file. - * mingwex/math/pow.c: New file. - * mingwex/math/cephes_mconf.h. Add double and float - versions of constants. - (polevl): Add double precision function. - (p1evl): Likewise. - * mingwex/Makefile.in (MATH_DISTFILES): Add pow.c, - powi.c, powif.c. - (MATH_OBJS): Add pow.o, powi.o, powif.o. - -2002-10-03 Danny Smith <dannysmith@users.sourceforge.net> - - * include/cytpe.h (_imp____mbcur_max): Add missing ';'. - (_imp____mbcur_max_dll): Likewise. - -2002-10-03 Danny Smith <dannysmith@users.sourceforge.net> - - * include/fcntl.h (_fmode): Remove declarations and - compatibility defines. - (_setmode, setmode): Remove prototypes. - * include/stdlib (_fmode): Add declarations and - compatibility defines. Change type to int. - * include/io.h (_setmode, setmode): Add prototypes. - * samples/fmode/all.c: Adjust includes. - * samples/fmode/test.c: Likewise. - * crt1.c (_CRT_fmode): Declare as int. - * CRTfmode.c (_CRT_fmode): Likewise. - - * include/stdlib: Remove comment about MB_CUR_MAX. - -2002-10-02 Danny Smith <dannysmith@users.sourceforge.net> - - * include/stdlib.h (_imp____mbcur_max): Add missing ';'. - (_imp____mbcur_max_dll): Likewise. - -2002-09-18 Danny Smith <dannysmith@users.sourceforge.net> - - * mingwex/math/files.txt: Remove inadvertantly added file. - -2002-09-18 Danny Smith <dannysmith@users.sourceforge.net> - - * include/string.h (_strerror): Move into #ifndef - __STRICT_ANSI__ block. - -2002-09-17 Danny Smith <dannysmith@users.sourceforge.net> - - * include/time.h (__need_NULL): Define before including - stddef.h. Thanks to: Rüdiger Dehmel <de@lmnet.de>. - -2002-09-16 Ranjit Matthew <rmathew@hotmail.com> - - * include/stdio.h: Correct comment about directory separator. - -2002-09-12 Danny Smith <dannysmith@users.sourceforge.net> - - * include/sys/time.h (timeval): Add struct definition and - associated macros (copied from w32api/include/winsock.h). - -2002-09-05 Earnie Boyd <earnie@users.sf.net> - - * include/_mingw.h: Increment version to 2.3. - Makefile.in: Ditto. - -2002-09-05 Earnie Boyd <earnie@users.sf.net> - - * mingwex/fegetenv.c: Change to \n line endings. - * mingwex/vsnprintf.c: Ditto. - * mingwex/vsnwprintf.c: Ditto. - -2002-09-02 Danny Smith <dannysmith@users.sourceforge.net> - - * mingwex/math/hypotl.c: Replace with version based on cephes - library. - -2002-08-28 Danny Smith <dannysmith@users.sourceforge.net> - - * include/sys/param.h: Add ENDIAN defines. - * test_headers.c: Include sys/param.h. - -2002-08-28 Danny Smith <dannysmith@users.sourceforge.net> - - * test_headers.c: Don't include varargs.h. - * Makefile.in (test_headers): Don't use -std=xx - with -xc++. - -2002-08-21 Earnie Boyd <earnie@users.sf.net> - - * include/sys/param.h: New File. - -2002-08-21 Danny Smith <dannysmith@users.sourceforge.net> - - * include/math.h (asm): Change to __asm__ throughout. - Expose ISO C99 functions if __GLIPCPP__. - (hypotf): Use hypot, not _hypot in stub. - -2002-08-20 Danny Smith <dannysmith@users.sourceforge.net> - - * include/tchar.h: Ansi-fy another comment. - -2002-08-20 Danny Smith <dannysmith@users.sourceforge.net> - - * include/tchar.h: Ansi-fy comment. - -2002-08-20 Danny Smith <dannysmith@users.sourceforge.net> - - * test_headers.c : New file. - * Makefile.in (test_headers): New target, using it, - (SRCDIST_FILES): Distribute it. - -2002-08-20 Earnie Boyd <earnie@users.sf.net> - - * include/_mingw.h: Increment version to 2.2. - Makefile.in: Ditto. - -2002-08-14 Earnie Boyd <earnie@users.sf.net> - - * include/unistd.h: Add include of process.h. - -2002-08-03 Danny Smith <dannysmith@users.sourceforge.net> - - * include/stdio.h (_fcloseall): Add prototype. - -2002-07-29 Danny Smith <dannysmith@users.sourceforge.net> - - * include/tchar.h (_tfdopen): Correct typo. - -2002-07-29 Danny Smith <dannysmith@users.sourceforge.net> - - * moldname.def.in (chgsign,scalb,finite,fpclass,logb, - nextafter): Add non-underscored stubs. - * moldname-msvcrt.def: Regenerate. - * moldname-crtdll.def: Regenerate. - * mingwex/math: New directory. - * mingwex/rint.c: Move to mingwex/math. - * mingwex/rintf.c: Ditto. - * mingwex/rintl.c: Ditto. - * mingwex/round.c: Ditto. - * mingwex/roundf.c: Ditto. - * mingwex/roundl.c: Ditto. - * mingwex/rint.c: Ditto. - * mingwex/rintf.c: Ditto. - * mingwex/rintl.c: Ditto. - * mingwex/trunc.c: Ditto. - * mingwex/truncf.c: Ditto. - * mingwex/truncl.c: Ditto. - * mingwex/signbit.c: Ditto. - * mingwex/signbitf.c: Ditto. - * mingwex/signbitl.c: Ditto. - * mingwex/copysignl.S: Ditto. - * mingwex/fdim.c: Ditto. - * mingwex/fdimf.c: Ditto. - * mingwex/fdiml.c: Ditto. - * mingwex/fmin.c: Ditto. - * mingwex/fminf.c: Ditto. - * mingwex/fminl.c: Ditto. - * mingwex/fmax.c: Ditto. - * mingwex/fmaxf.c: Ditto. - * mingwex/fmaxl.c: Ditto. - * mingwex/fma.c: Ditto. - * mingwex/fmaf.c: Ditto. - * mingwex/fmal.c: Ditto. - * mingwex/fpclassify.c: Ditto. - * mingwex/fpclassifyl.c: Ditto. - * mingwex/fpclassifyl.c: Ditto. - * mingwex/isnan.c: Ditto. - * mingwex/isnanf.c: Ditto. - * mingwex/isnanl.c: Ditto. - * mingwex/fucom.c: Ditto. - * mingwex/fp_consts.c: Ditto. Split out float and long double - definitions. - * mingwex/math_stubs.c: Remove. - * mingwex/log2.c: Remove. Replaced by math/log2.S - * mingwex/log2f.c: Remove. Replaced by math/log2f.S - * mingwex/log2l.c: Remove. Replaced by math/log2l.S - * mingwex/math/acosf.c : New file. - * mingwex/math/acosl.c: New file. - * mingwex/math/asinf.c: New file. - * mingwex/math/asinl.c: New file. - * mingwex/math/atan2f.c: New file. - * mingwex/math/atan2l.c: New file. - * mingwex/math/atanf.c: New file. - * mingwex/math/atanl.c: New file. - * mingwex/math/cbrt.c: New file. - * mingwex/math/cbrtf.c: New file. - * mingwex/math/cbrtl.c: New file. - * mingwex/math/ceilf.S: New file. - * mingwex/math/ceill.S: New file. - * mingwex/math/cephes_ld.h: New file. - * mingwex/math/copysign.S: New file. - * mingwex/math/copysignf.S: New file. - * mingwex/math/cosf.S: New file. - * mingwex/math/coshf.c: New file. - * mingwex/math/coshl.c: New file. - * mingwex/math/cosl.S: New file. - * mingwex/math/exp2.S: New file. - * mingwex/math/exp2f.S: New file. - * mingwex/math/exp2l.S: New file. - * mingwex/math/expf.c: New file. - * mingwex/math/expl.c: New file. - * mingwex/math/fabs.c: New file. - * mingwex/math/fabsf.c: New file. - * mingwex/math/fabsl.c: New file. - * mingwex/math/floorf.S: New file. - * mingwex/math/floorl.S: New file. - * mingwex/math/fmodf.c: New file. - * mingwex/math/fmodl.c: New file. - * mingwex/math/fp_consts.h: Ditto. - * mingwex/math/fp_constsf.c: Ditto. - * mingwex/math/fp_constsl.c: Ditto. - * mingwex/math/frexpf.c: New file. - * mingwex/math/frexpl.S: New file. - * mingwex/math/hypotf.c: New file. - * mingwex/math/hypotl.c: New file. - * mingwex/math/ilogb.S: New file. - * mingwex/math/ilogbf.S: New file. - * mingwex/math/ilogbl.S: New file. - * mingwex/math/ldexpf.c: New file. - * mingwex/math/ldexpl.c: New file. - * mingwex/math/llrint.c: New file. - * mingwex/math/llrintf.c: New file. - * mingwex/math/llrintl.c: New file. - * mingwex/math/llround.c: New file. - * mingwex/math/llroundf.c: New file. - * mingwex/math/llroundl.c: New file. - * mingwex/math/log10f.S: New file. - * mingwex/math/log10l.S: New file. - * mingwex/math/log1p.S: New file. - * mingwex/math/log1pf.S: New file. - * mingwex/math/log1pl.S: New file. - * mingwex/math/log2.S: New file. - * mingwex/math/log2f.S: New file. - * mingwex/math/log2l.S: New file. - * mingwex/math/logb.c: New file. - * mingwex/math/logbf.c: New file. - * mingwex/math/logbl.c: New file. - * mingwex/math/logf.S: New file. - * mingwex/math/logl.S: New file. - * mingwex/math/lrint.c: New file. - * mingwex/math/lrintf.c: New file. - * mingwex/math/lrintl.c: New file. - * mingwex/math/lround.c: New file. - * mingwex/math/lroundf.c: New file. - * mingwex/math/lroundl.c: New file. - * mingwex/math/modff.c: New file. - * mingwex/math/modfl.c: New file. - * mingwex/math/nearbyint.S: New file. - * mingwex/math/nearbyintf.S: New file. - * mingwex/math/nearbyintl.S: New file. - * mingwex/math/nextafterf.c: New file. - * mingwex/math/powf.c: New file. - * mingwex/math/powl.c: New file. - * mingwex/math/powil.c: New file. - * mingwex/math/remainder.S: New file. - * mingwex/math/remainderf.S: New file. - * mingwex/math/remainderl.S: New file. - * mingwex/math/remquo.S: New file. - * mingwex/math/remquof.S: New file. - * mingwex/math/remquol.S: New file. - * mingwex/math/scalbn.S: New file. - * mingwex/math/scalbnf.S: New file. - * mingwex/math/scalbnl.S: New file. - * mingwex/math/sinf.S: New file. - * mingwex/math/sinhf.c: New file. - * mingwex/math/sinhl.c: New file. - * mingwex/math/sinl.S: New file. - * mingwex/math/sqrt.c: New file. - * mingwex/math/sqrtf.c: New file. - * mingwex/math/sqrtl.c: New file. - * mingwex/math/tanf.S: New file. - * mingwex/math/tanhf.c: New file. - * mingwex/math/tanhl.c: New file. - * mingwex/math/tanl.S: New file. - * mingwex/Makefile.in: Adjust VPATH for source files in - mingwex/math. - Adjust MATH_OBJS. - Add MATH_DISTFILES and use it to build source distro. - * include/ math.h: Add protypes for new functions and - reorganise to reflect ANSI,C99 status. - -2002-06-19 Danny Smith <dannysmith@users.sourceforge.net> - - * include/tchar.h (_getts): Define as _getws for _UNICODE. - (_putts): Define as _putws for _UNICODE. - Thanks to: Tomasz Pona <cochisek@poczta.onet.pl> for report. - -2002-06-18 Danny Smith <dannysmith@users.sourceforge.net> - - * include/float.h: #include_next<float.h> before header guard. - -2002-06-18 Casper S. Hornstrup <chorns@users.sourceforge.net> - - * include/_mingw.h (__MINGW_IMPORT): Check for prior definition before - defining. - * include/excpt.h (): Include windef.h not windows.h. - * include/fcntl.h (_O_SHORT_LIVED): Add define. - (_chmod): Add prototype. - (_creat): Correct prototype. - (SH_DENY*): Rename defines to _SH_DENY*. - (SH_DENY*): Add Non-ANSI names for _SH_DENY*. - include/stdio.h (_IOMYBUF, _IOEOF, _IOERR, _IOSTRG, - _IOAPPEND): Add defines. - (_wfindfirst): Correct prototype. - (_wfdopen): Add prototype. - * include/stdlib.h (_rotl, _rotr, _lrotl, _lrotr): Add - prototypes. - * include/string.h (_mbschr, _mbstok, _mbsncat): Remove - prototypes. - (_wcsdup): Correct prototype. - * include/mbstring.h: Remove comments about _mbschr, _mbstok, - _mbsncat being in string.h. - * include/wchar.h (_wfindfirst): Correct prototype. - * include/tchar.h (_tfdopen): Add _UNICODE mappings. - -2002-06-15 Earnie Boyd <earnie@users.sf.net> - - * include/_mingw.h: Increment to version 2.1. - * Makefile.in: Ditto. - -2002-06-15 Earnie Boyd <earnie@users.sf.net> - - * Makefile.in (conf_prefix): New variable. - (dist_prefix): Ditto. Conditionally set to $(conf_prefix). - (bindist): Use dist_prefix. - -2002-06-13 Danny Smith <dannysmith@users.sourceforge.net> - - * include/_mingw.h: Increment version to 2.0. - * Makefile.in: Ditto. - - Merge in mingwex branch. - - 2002-06-11 Danny Smith <dannysmith@users.sourceforge.net> - * include/math.h (fdim, fdimf, fdiml): Add prototypes. - * mingwex/fdim.c: New file. - * mingwex/fdimf.c: New file. - * mingwex/fdiml.c: New file. - * mingwex/Makefile.in (DISTFILES): Add fdim.c, fdimf.c, - fdiml.c. - (MATHOBJS):Add fdim.o, fdimf.o. fdiml.o. - - 2002-05-23 Danny Smith <dannysmith@users.sourceforge.net> - * mingwex/Makefile.in (DISTFILES): Add truncf.c, truncl.c. - - 2002-05-22 Danny Smith <dannysmith@users.sourceforge.net> - * mingwex/isnanl.c: New file. - - 2002-05-21 Danny Smith <dannysmith@users.sourceforge.net> - * include/stdint.h: Include stddef.h to get - wchar_t and wint_t. - (WINT_MAX): Define to ((wint_t)-1). - - 2002-05-21 Danny Smith <dannysmith@users.sourceforge.net> - * include/wctype.h: Replace 'inline' with '__inline__'. - * include/inttypes.h: Likewise. - - 2002-05-16 Danny Smith <dannysmith@users.sourceforge.net> - * include/_mingw.h (__MINGW_IMPORT): Put extern at start - to avoid warnings. Thanks to: Oscar Fuentes <ofv@wanadoo.es>. - - 2002-05-16 Danny Smith <dannysmith@users.sourceforge.net> - * mingwex/snprintf.c: Split out vsnprintf to.... - * mingwex/vsnprintf.c: New file. - * mingwex/snwprintf.c: Split out vsnwprintf to... - * mingwex/vsnwprintf.c: New file. - * mingwex/Makefile.in: Adjust DISTFILES and STDIO_STUB_OBJS. - - 2002-05-15 Pascal Obry <obry@gnat.com> - * include/dirent.h (DIR): Change dd_stat type to int. - (_WDIR): Likewise. - - 2002-05-07 Danny Smith <dannysmith@users.sourceforge.net> - * include/stdio.h (vsnprintf): Change inline to __inline__; - (vsnwprintf): Likewise. - * include/wchar.h (vsnwprintf): Likewise. - (wcstof): Likewise. - (fwide): Likewise. - (mbsinit): Likewise. - - 2002-04-29 Danny Smith <dannysmith@users.sourceforge.net> - Change FP default precison from 53 to 64-bit mantissa. - * Makefile.in (CRT0S): Add CRT_fp8.o. - (MINGW_OBJS): Replace CRT_fp8.o with CRT_fp10.o. - * include/float.h: Replace standard float.h defines with - #include_next<float.h> to use GCC's defines. Adjust comments - to reflect change. - - 2002-04-26 Danny Smith <dannysmith@users.sourceforge.net> - * include/dos.h: Change prefix "__imp_" to "_imp__" for - __GNUC__ without __DECLSPEC_SUPPORTED. - * include/fnctl.h: Likewise. - * include/math.h: Likewise. - * include/stdio.h: Likewise. - * include/stdlib.h: Likewise. - * include/time.h: Likewise. - * include/wctype.h: Likewise. - * include/ctype.h: Likewise. - - 2002-04-26 Danny Smith <dannysmith@users.sourceforge.net> - Add atexit support for dlls. - * crt1.c (atexit): Force thunk to _imp__atexit. - (_onexit): Force thunk to _imp___onexit. - * dllcrt1.c (DllMainCRTStartup): Initialise private atexit - table on DLL_PROCESS_ATTACH, clean it up on DLL_PROCESS_DETACH. - (__dll_exit): New function to run atexit-registered functions - and flush output buffers on DLL_PROCESS_DETACH or failed - DLL_PROCESS_ATTACH. - (atexit): Force use of private atexit table via _dllonexit, - (_onexit): New function. Force use of private atexit table via - _dllonexit, - * msvcrt.def (atexit, _onexit): Add DATA keyword so that only - _imp_<_symbol> is visible in import lib. - * msvcrt20.def: Likewise. - * msvcrt40.def: Likewise. - * crtdll.def: Likewise. - - 2002-04-26 Danny Smith <dannysmith@users.sourceforge.net> - * include/fenv.h: Change header guard macro to _FENV_H_. - (fenv_t, fexcept_t): Move into block protected by - #ifndef RC_INVOKED. - Cleanup some whitespace. - * include/inttypes.h: Change header guard macro to - _INTTYPES_H_. - - 2002-04-26 Danny Smith <dannysmith@users.sourceforge.net> - * include/math.h (copysignl): Declare. - * mingwex/Makefile.in (DISTFILES): Add copysignl.S. - (MATHOBJS):Add copysignl.o. - - 2002-04-24 Danny Smith <dannysmith@users.sourceforge.net> - * include/math.h (__signbitl, __isnanl): Declare. - - 2002-04-24 Danny Smith <dannysmith@users.sourceforge.net> - * include/math.h (nanl, __fpcassifyl, fminl, fmaxl, rintl, - roundl, truncl, fmal, log2l): Declare. - Protect C99 declarations with _STDC_VERSION__ >= 199901L) - || !defined __STRICT_ANSI__. - * mingwex/fmax.c (fmax): Call __isnan, not _isnan. - * mingwex/fmin.c (fmin): Likewise. - * mingwex/fmaxf.c (fmaxf): Call __isnanf, not _isnan. - * mingwex/fminf.c (fminf): Likewise. - * mingwex/fmaxl.c: New file. - * mingwex/fminl.c: New file. - * mingwex/fpclassify.c (__fpclassifyf): Split out to ... - * mingwex/fpclassifyf.c: New file. - * mingwex/fpclassifyl.c: New file. - * mingwex/rint.c (rintf): Split out to... - * mingwex/rintf.c: New file. - * mingwex/rintl.c: New file. - * mingwex/round.c (roundf): Split out to... - * mingwex/roundf.c: New file. - * mingwex/roundl.c: New file. - * mingwex/trunc.c (truncf): Split out to... - * mingwex/truncf.c: New file. - * mingwex/truncl.c: New file. - * mingwex/signbit.c (signbitf): Split out to... - * mingwex/signbitf.c: New file. - * mingwex/signbitl.c: New file. - * mingwex/fmal.c: New file. - * mingwex/copysignl.S: New file. - * mingwex/log2l.c: New file. - * mingwex/fp_consts.c: Add nanl definition. - Comment out unused constants. - * mingwex/Makefile.in (DISTFILES): Add fmaxl.c, fminl.c, - fpclassifyf.c, fpclassifyl.c, rintf.c, rintl.c, roundf.c, - roundl.c, truncf.c truncl.c, signbitf.c signbitl.c, - fmal.c, log2l.c - (MATHOBJS): Add fmaxl.o, fminl.o, fpclassifyf.o, - fpclassifyl.o, rintf.o, rintl.o, roundf.o, roundl.o, - truncf.o truncl.o, signbitf.o signbitl.o, fmal.o, - log2l.o. - * mingwex/snwprintf.c (snwprintf, vsnwprintf): Correct typo. - - 2002-04-23 Danny Smith <dannysmith@users.sourceforge.net> - Make wide char versions of opendir and friends. - * include/dirent.h (_wdirent, _WDIR): Define wide versions of - struct dirent, DIR. - (_wopendir,_wreaddir,_wclosedir,_wrewinddir,_wtelldir, - _wseekdir): Add prototypes for wide versions of corresponding - standard functions. - * include/tchar.h; Add _UNICODE mappings for dirent.h - structures and functions. - * mingwex/dirent.c: Make _UNICODE neutral. - * mingwex/wdirent.c: New file to define _UNICODE before - including dirent.c. - * mingwex/Makefile.in (DISTFILES): Add wdirent.c. - (POSIX_OBJS): Add wdirent.o. - (wdirent.o): Specify dependency on dirent.c as well as - wdirent.c. - * samples/dirent/wtest.c: New file, wide version of test.c. - - 2002-04-17 Danny Smith <dannysmith@users.sourceforge.net> - * Makefile.in (INCLUDES): Add "-iwithprefixbefore include" to - ensure gcc include dir is searched despite -nostdinc. - * profile/Makefile.in (INCLUDES): Likewise. - * mingwex/Makefile.in (INCLUDES): Likewise. - * include/stdarg.h: Replace with stub that just guards the - real gcc system header with #ifndef RC_INVOKED - * include/varargs.h: Likewise. - * include/stddef.h: Likewise. - * include/stdio.h: Include stdarg.h after defining - __need___va_list. - (__VALIST): Define as __gnuc_va_list if __GNUC__, else char*. - Replace va_list with __VALIST throughout. - - 2002-04-17 Danny Smith <dannysmith@users.sourceforge.net> - * crt1.c: Revert changes of 2002-04-16. Use _fpreset again. - * msvcrt.def (_fpreset): Mark as DATA so that only - _imp___fpreset is exported. - * msvcrt20.def (_fpreset): Likewise. - * msvcrt40.def (_fpreset): Likewise. - * crtdll.def (_fpreset): Likewise. - * CRT_fp10.c (_fpreset): Overide library _fpreset with one - that calls fninit. - (fpreset): Add alias. - (__CRT_PC): Delete definition. _fpreset does it now. - * CRT_fp8.c (_fpreset): Force use of library _imp___fpreset. - (fpreset): Add alias. - (__CRT_PC): Delete definition. - * moldname.def.in: Comment out fpreset. - * moldname-msvcrt.def: Regenerate. - * moldname-crtdll.def: Regenerate. - * include/fenv.h (FE_DFL_ENV): Define as (fenv_t*)0. - * mingwex/fesetenv.c (FE_DFL_ENV): Use it to set environment - with the _fpreset determined by startup CRT_fp object. - - 2002-04-16 Danny Smith <dannysmith@users.sourceforge.net> - * CRT_fp8.c: New file. - * CRT_fp10.c: New file. - * crt1.c (__CRT_PC) Declare. - (__CRT_fesetenv): New static function, using _CRT_PC. - (__mingw_CRTStartup):Use __CRT_fesetenv instead of _fpreset. - (_gnu_exception_handler): Likewise. - * Makefile.in (CRT0S): Add CRT_fp10.o. - (MINGW_OBJS): Add CRT_fp8.o. - (SRCDIST_FILES): Add CRT_fp8.c, CRT_fp10.c. - Add CRT_fp8.o, CRT_fp10.o dependancies. - * include/float.h (_fpreset): Expand comment. - * include/fenv.h (FE_PC64_ENV): New define for Intel x87 - (extended precison) environmemt. - (FE_PC53_ENV): New define for MSVCRT default environmemt. - (FE_DFL_ENV): Define as FE_PC53_ENV. - * mingwex/fesetenv.c: Use FE_PC53_ENV, FE_PC64_ENV to determine - precision control for default environment. - - * include/math.h: Fix long comment line. - * profile/configure.in (CRT0S): Set to both gcrt1.o and gcrt2.o - for mingw. - * profile/configure: Regenerate. - - 2002-04-12 Danny Smith <dannysmith@users.sourceforge.net> - * mingwex/Makefile.in (DISTFILES): Add suffix to wcstof.c. - - 2002-04-10 Danny Smith <dannysmith@users.sourceforge.net> - * mingwex/mingw-fseek.c: New file, based on Mumit Khan - mingw-local patch to binutils. - Sun Nov 7 04:27:07 1999 Mumit Khan <khan@xraylith.wisc.edu> - (__mingw_fseek): New function to work around Win9x f/lseek bug. - (__mingw_fwrite): Likewise. - (__mingw_is_win9x): New helper function. - * include/stdio.h (__USE_MINGW_FSEEK): New define,guarding... - (__mingw_fseek): New prototype and define to replace fseek. - (__mingw_fwrite): New prototype and define to replace fwrite. - * mingwex/Makefile.in: Add mingw-fseek.o to libmingwex.a. - * moldname-crtdll.def: Remove CR from end of line. - * moldname-msvcrt.def: Ditto. - - 2002-04-09 Danny Smith <dannysmith@users.sourceforge.net> - * profile/configure.in (CRT0S): Configure name of gcrt?.o - based on target, building gcrt0.o for cygwin -mno-cygwin. - * profile/configure: Regenerate. - * profile/Makefile.in (CRT0S): Use name from configure. - (gcrt0.o): New rule. - (ALL_CRT0S): New define, used to cleanup all gcrt?.o's. - - 2002-04-04 Danny Smith <dannysmith@users.sourceforge.net> - * include/math.h (_controlfp, _control87, _clearfp, _statusfp, _fpreset, - _fpecode): Remove prototypes copied from float.h. - (nan, nanf): Move into block protected against RC_INVOKED - and __cplusplus. - * include/stdlib.h (_Exit): Change from static inline to - extern inline. - * mingwex/_Exit.c : New file. - * mingwex/Makefile.in: Add _Exit.o to libmingwex.a. - - 2002-04-04 Danny Smith <dannysmith@users.sourceforge.net> - Add libgmon.a and libmingwex.a for cygwin -mno-cygwin. - * configure.in (SUBDIRS): Add profile and mingwex to cygwin target. - (configdirs): Likewise. - (LIBGMON_A): Define for cygwin target as well. - * configure: Regenerate. - * profile/configure.in (THREAD_DLL): Remove define. - (LIBM_A): Remove define. - (LIBGMON_A): Define for cygwin target as well. - * profile/configure: Regenerate. - * profile/makefile.in (install): Install to inst_libdir and - inst_includedir. - * mingwex/makefile.in (CFLAGS): Move -fomit-frame-pointer to... - (OPTFLAGS): New define. - (ALL_CFLAGS): Add $(OPTFLAGS). - (ALL_CXXFLAGS): Same. - (.c.o:): Remove ALL_CXXFLAGS. - - 2002-03-29 Danny Smith <dannysmith@users.sourceforge.net> - * include/stdint.h: Add missing newline at eof. - * include/stdio.h (snprintf): Add prototype. - (vsnprintf): Add prototype and inline definition. - (snwprintf): Add prototype. - (vsnwprintf): Add prototype and inline definition. - * include/wchar.h (snwprintf): Add prototype. - (vsnwprintf): Add prototype and inline definition. - * mingwex/Makefile.in: Add snprintf.o, snwprintf.o - to libmingwex.a. - * mingwex/snprintf.c: New file. - * mingwex/snwprintf.c: New file. - - 2002-03-22 Danny Smith <dannysmith@users.sourceforge.net> - * configure.in: Add mingwex as SUBDIRS and configdirs. - * configure: Regenerate. - * Makefile.in (MINGW_OBJS): Remove dirent.o. - (SRC_DIST_FILES): Remove dirent.c. - * dirent.c: Remove. - * include/stdlib.h (_Exit): Add static inline - function. - (struct lldiv_t): Define. - (lldiv): Add prototype. - (llabs): Add extern inline function. - (strtoll,strtoull): Add prototypes. - (wcstol, wcstoul, wcstod): Group together. - (strtof, wcstof): Add extern inline definitions. - (atoll,lltoa,ulltoa, wtoll, lltow ulltow): Add prototypes - and extern inline definitions. - * include/wchar.h (fwide, wcstoll,wcstoull, wmemchr - wmemcmp, wmemcpy, wmemmove, wmemset. mbsinit): Add - prototypes. - (wcstol, wcstoul,wcstod): Copy prototypes from stdlib.h. - (wcstof): Add extern inline definition. - * include/math.h (nan, nanf): Add prototypes. - (NAN, INFINITE): Define constants. - (fpclassify, isnan ,signbit): Add macros and supporting float - and double functions. - (isfinite, isinf, isnormal): Add macros. - (isgreater, isless, isgreaterequal, islessequal,islessgreater): - Add macros. - (rint, rintf, round, roundf, trunc. truncf, fmax, fmaxf, - fmin, fminf, fma, fmaf, log2, log2f): Add prototypes. - (copysign, logb, nextafter, scalb): Add prototypes and - inline stubs for underscored versions in msvcrt.dll. - * include/inttypes.h: New file. - * include/fenv.h: New file - - Add new mingwex subdir and files. - * mingwex: New directory. - * mingwex/Makefile.in: New file. - * mingwex/configure.in: New file. - * mingwex/configure: Generate. - * mingwex/dirent.c: Moved here from parent dir. - * mingwex/atoll.c: New file. - * mingwex/feclearexcept.c: New file. - * mingwex/fegetenv.c: New file. - * mingwex/fegetexceptflag.c: New file. - * mingwex/fegetround.c: New file. - * mingwex/feholdexcept.c: New file. - * mingwex/feraiseexcept.c: New file. - * mingwex/fesetenv.c: New file. - * mingwex/fesetexceptflag.c: New file. - * mingwex/fesetround.o: New file. - * mingwex/fetestexcept.c: New file. - * mingwex/feupdateenv.c: New file. - * mingwex/fma.S: New file. - * mingwex/fmaf.S: New file. - * mingwex/fmax.c: New file. - * mingwex/fmaxf.c: New file. - * mingwex/fmin.c: New file. - * mingwex/fminf.c: New file. - * mingwex/fp_consts.c: New file. - * mingwex/fpclassify.c: New file. - * mingwex/fucom.c: New file. - * mingwex/fwide.c: New file. - * mingwex/imaxabs.c: New file. - * mingwex/imaxdiv.c: New file. - * mingwex/isnan.c: New file. - * mingwex/isnanf.c: New file. - * mingwex/lltoa.c: New file. - * mingwex/lltow.c: New file. - * mingwex/log2.c: New file. - * mingwex/log2f.c: New file. - * mingwex/math_stubs.c: New file. - * mingwex/mbsinit.c: New file. - * mingwex/rint.c: New file. - * mingwex/round.c: New file. - * mingwex/signbit.c: New file. - * mingwex/sitest.c: New file. - * mingwex/strtof.c: New file. - * mingwex/strtoimax.c: New file. - * mingwex/strtoumax.c: New file. - * mingwex/testwmem.c: New file. - * mingwex/trunc.c: New file. - * mingwex/ulltoa.c: New file. - * mingwex/ulltow.c: New file. - * mingwex/wcstof.c: New file. - * mingwex/wcstoimax.c: New file. - * mingwex/wcstoumax.c: New file. - * mingwex/wmemchr.c: New file. - * mingwex/wmemcmp.c: New file. - * mingwex/wmemcpy.c: New file. - * mingwex/wmemmove.c: New file. - * mingwex/wmemset.c: New file. - * mingwex/wtoll.c: New file. - -2002-04-20 Danny Smith <dannysmith@users.sourceforge.net> - - * include/mbstring.h: New file. - * include/mbctype.h: New file. - -2002-04-20 Danny Smith <dannysmith@users.sourceforge.net> - - * include/tchar.h (__TEXT): Make same as define in - w32api/include/winnt.h. - -2002-04-20 Danny Smith <dannysmith@users.sourceforge.net> - - * include/tchar.h (_tputenv): Add UNICODE mappings. - (_tsearchenv): Likewise. - (_tmakepath): Likewise. - (_tsplitpath): Likewise. - (_tfullpath): Likewise. - -2002-04-18 Pascal Obry <obry@gnat.com> - - * dirent.c (opendir): Convert given pathname to - absolute pathname. - -2002-04-09 Earnie Boyd <earnie@users.sf.net> - - * include/_mingw.h: Increment version. - * Makefile.in: Ditto. - -2002-04-09 Earnie Boyd <earnie@users.sf.net> - - * moldname-crtdll.def: Remove CR from end of line. - * moldname-msvcrt.def: Ditto. - * Makefile.in: Use bzip2 compression for Cygwin target. - -2002-04-04 Danny Smith <dannysmith@sourceforge.users.net> - - * include/math.h (DOMAIN, SING, OVERFLOW, UNDERFLOW, - TLOSS, PLOSS): Move oldname defines back, following - the underscored names. - -2002-03-29 Danny Smith <dannysmith@sourceforge.users.net> - - * include/stdio.h (_snwprintf): Correct spelling. - (_vsnwprintf): Likewise. - * include/wchar.h (_snwprintf): Correct spelling. - (_vsnwprintf): Likewise. - -2002-03-26 Danny Smith <dannysmith@users.sourceforge.net> - - * moldname.def.in (__MSVCRT__): Replace with !(__CRTDLL__). - (wpopen): Add if !(__CRTDLL__). - * Makefile.in (moldname-msvcrt.def rule): Use -C, not -c to - preserve comments. - (moldname-crtdll.def rule): Likewise. - * moldname-msvcrt.def: Regenerate. - * moldname-crtdll.def: Regenerate. - * include/stdio.h (wpopen):Use prototype, not a define. - (_swnprintf): Add prototype. - (_vswnprintf): Likewise. - Tidy up whitespace. - * include/wchar.h (_swnprintf): Add prototype. - (_vswnprintf): Likewise. - Tidy up whitespace. - -2002-01-28 Danny Smith <dannysmith@users.sourceforge.net> - - * include/malloc.h (_heapinfo): Correct structure definition. - (_USEDENTRY,_FREEENTRY): Add defines. - Add comment on platform support for _heap* functions. - (_get_sbh_threshold): Add prototype. - (_set_sbh_threshold): Likewise. - (_expand): Likewise. - -2002-01-25 Danny Smith <dannysmith@users.sourceforge.net> - - * profile/profil.c: Update copyright info. - * profile/profil.h: Likewise. - * profile/gcrt0.c: Likewise. - -2002-01-25 Pascal Obry <obry@gnat.com> - - * profile/profil.h (PROFADDR): Cast idx to unsigned long long to - avoid overflow. - * profile/gmon.c: Define bzero as memset if mingw32. - (monstartup): Use it. - -2002-01-25 Danny Smith <dannysmith@users.sourceforge.net> - - * include/tchar.h (_TCHAR): Add missing ;. - -2002-01-25 Danny Smith <dannysmith@users.sourceforge.net> - - * include/tchar.h (_TCHAR): Add typedefs. - -2002-01-16 Danny Smith <dannysmith@users.sourceforge.net> - - * include/stdlib.h (_onexit_t): Add typedef. - (_onexit): Add prototype. - -2002-01-12 Danny Smith <dannysmith@users.sourceforge.net> - - * msvcrt.def: Revert accidental change. - * include/stdlib.h: Ditto. - -2001-12-07 Earnie Boyd <earnie@users.sf.net> - - * Makefile.in: Increment VERSION. - * include/_mingw.h: Ditto. - -2001-12-05 Earnie Boyd <earnie@users.sf.net> - - * include/strings.h: New File. - -2001-12-02 Danny Smith <dannysmith@users.sourceforge.net> - - Apply patches from: - 2001-06-21 Mumit Khan <khan@nanotech.wisc.edu> - - * include/math.h (_FPCLASS* ): Add defines from float.h. - (IEEE recommended functions): Add declarations from float.h. - * include/float.h (_FPCLASS* ): Protect against redefinition. - -2001-11-29 Wu Yongwei <adah@netstd.com> - - * include/_mingw.h,assert.h,conio.h,ctype.h,dir.h,direct.h - dirent.h,dos.h,errno.h,excpt.h,fcntl.h,float.h,io.h, - limits.h,locale.h,malloc.h,math.h,process.h,setjmp.h, - share.h,signal.h,stdarg.h,stddef.h,stdint.h,stdio.h, - stdlib.h,string.h,tchar.h,time.h,varargs.h,wchar.h, - wctype.h,sys/stat.h,sys/timeb.h,sys/types.h,sys/utime.h: - Correct spelling of "disclaimed" in comments. - * include/excpt.h: Another spelling correction. - -2001-11-08 Robert Collins <rbtcollins@hotmail.com> - - * include/errno.h: Fix "errno is not a prototype" warning. - -2001-11-07 Danny Smith <dannysmith@users.sourceforge.net> - - * include/ctype.h (tolower, toupper,_tolower,_toupper): Comment - differences between ANSI and non-ANSI versions. - (_ctype[],_pctype): Declare vars. - (__ISCTYPE): New helper macro using _pctype. - (is* ctype functions): Use __ISCTYPE to define inline versions. - (_toupper, _tolower, __isascii, __toascii, __iscsym, __iscsymf): - Inline definitions. - (isw* ctype functions): Inline definitions. - * include/wctype.h (_ctype[],_pctype): Declare vars. - (isw* ctype functions): Inline definitions. - - -2001-11-06 Danny Smith <dannysmith@users.sourceforge.net> - - * include/float.h (_clearfp, _statusfp, _fpreset, fpreset, - __fpecode): Use __STDC__ prototypes. - - -2001-11-06 Thomas Pfaff <tpfaff@gmx.net> - - * mthr_stub.c (__mingwthr_remove_key_dtor) New. - * mthr_init.c (DllMain) Run dtors if a process terminates. - * mthr.c (__mingwthr_add_key_dtor) Removed. - (___mingwthr_add_key_dtor) New. - (___mingwthr_remove_key_dtor) New. - (__mingwthr_run_key_dtors) Complete rewrite. - (__mingwthr_remove_key_dtor) New. - -2001-11-05 Egor Duda <deo@logos-m.ru> - - * Makefile.in: Delete unused executable after creating base-files. - -2001-11-06 Danny Smith <dannysmith@users.sourceforge.net> - - * include/errno.h (_errno): Use __STDC__ prototype. - Thanks to: Jim Barton. - -2001-11-04 "stefan" <stefan@lkcc.org> - - * include/sys/locking.h (_LK_UNLCK, LK_UNLCK): Correct names. - -2001-10-30 Danny Smith <dannysmith@users.sourceforge.net> - - * include/io.h (_commit): Add declaration. - Thanks to: "stefan" <stefan@lkcc.org> - -2001-10-30 Danny Smith <dannysmith@users.sourceforge.net> - - * include/sys/stat.h: Make S_IS* macros safer. - -2001-10-27 Danny Smith <dannysmith@users.sourceforge.net> - - * include/stdlib.h (EXIT_FAILURE): Change value to 1. - -2001-10-12 Danny Smith <dannysmith@users.sourceforge.net> - - * include/stdlib.h (__p__environ, __p__wenviron): Use - __STDC__ prototypes. - -2001-09-19 Earnie Boyd <earnie@SF.net> - - * Makefile.in: Remove the /usr from the install target. - (VERSION): Increment. - include/_mingw.h: Ditto. - -2001-09-17 Earnie Boyd <earnie@SF.net> - - * Makefile.in: Increment version. - * include/_mingw.h: Ditto. - -2001-09-10 Earnie Boyd <earnie@SF.net> - - * dossh: Remove inadvertantly imported file. - -2001-09-10 Danny Smith <dannysmith@users.sourceforge.net> - - * dirent.c (opendir): Use GetFileAttributes rather than stat - to determine if input arg is dir. - -2001-08-29 Danny Smith <dannysmith@users.sourceforge.net> - - * include/stdarg.h (va_list): Typedef as __builtin_va_list if - __GNUC__ >= 3. - * include/varargs.h (va_list): Ditto. - * include/stdio.h (va_list): Ditto. - -2001-08-01 Danny Smith <dannysmith@users.sourceforge.net> - - * include/stdlib.h (_wpgmptr): Don't declare ifndef __MSVCRT__. - * include/stdio.h (_IORW): Change constant to 0x0080. - (TMP_MAX): Add new define. - (_P_tmpdir): Ditto. - (_wP_tmpdir): Ditto. - (L_tmpnam): Change constant to 16. - -2001-06-28 Danny Smith <dannysmith@users.sourceforge.net> - - * include/malloc.h: Fix non-ANSI comment after #endif. - -2001-06-11 Danny Smith <danny_r_smith_2001@yahoo.co.nz> - - * profile/configure.in: Make msvcrt.dll version default. - * profile/makefile.in: Build both gcrt1.o and gcrt2.o. - * provile/configure: Regenerate. - -2001-06-11 Mattia Barbon <mbarbon@dsi.unive.it> - - * include/stdio.h (swscanf): Make first arugument const. - * include/wchar.h (swscanf): Ditto. - * include/tchar.h (_tfopen): New _UNICODE define. - (_tgetenv): Ditto. - (_tsetlocale): Ditto. - -2001-06-04 Earnie Boyd <earnie@users.sourceforge.net> - - * profile/Makefile.in (mkinstalldirs): Correct relative path. - -2001-06-04 Earnie Boyd <earnie@users.sourceforge.net> - - * include/_mingw.h: Change version to 1.0. - Makefile.in: Ditto. - -2000-02-21 Earnie Boyd <earnie@users.sourceforge.net> - - * include/tchar.h: (__TEXT): Remove undef. - (_TEXT): Ditto. - (_T): Ditto. - -Fri Feb 2 10:34:07 2001 Earnie Boyd <earnie@users.sourceforge.net> - - * include/tchar.h: (__TEXT): Add private macro. - (_TEXT): Modify definition to use __TEXT. - (_T): Ditto. - This change allows the passing of a MACRO as an argument and have that - MACRO resolved first. - Thanks to: Eric PAIRE <eric.paire@ri.silicomp.com> - -Wed Jan 31 17:12:51 2001 Earnie Boyd <earnie@users.sourceforge.net> - - * Makefile.in: Increment version to 0.5 - * include/_mingw.h: Increment minor version - -Tue Jan 30 13:01:01 2001 Earnie Boyd <earnie@users.sourceforge.net> - - * include/assert.h: (assert): Remove ; from end of definition - Thanks to: AJ Reins <tbisp@qwest.net> - -Tue Jan 30 07:31:22 2001 Earnie Boyd <earnie@users.sourceforge.net> - - * include/time.h: (CLOCKS_PER_SEC): Type cast the constant. - Thanks to: Cosmin Truta <cosmin@cs.toronto.edu> - -Mon Jan 29 14:03:07 2001 Earnie Boyd <earnie@users.sourceforge.net> - - * time.h: (CLOCKS_PER_SEC) Change from FP to integer constant. - -Sun Jan 28 13:01:08 2001 Earnie Boyd <earnie@users.sourceforge.net> - - * include/wchar.h: The 2001.01.18 Change was incorrect. The functions - are actually C functions. These functions are resolved via the - -lmsvcp60 library and comments were placed in the header. - -2001-01-28 Danny Smith <danny_r_smith_2001@yahoo.co.nz> - - * include/stdlib.h (__p__pgmptr): add prototype. - (__p__wpgmptr): likewise. - (_pgmptr_dll): move declaration from dos.h. - (_wpgmptr_dll): likewise. - (_pgmptr): conditional define (MSVCT/CRTDLL). - (_wpgmptr): likewise. - * include/dos.h (_base*_dll variables): declare only for CRTDLL. - (_os*_dll variables): likewise. - (_pgmptr_dll): remove declaration and associated defines to stdlib.h. - (_wpgmptr_dll): likewise. - -2001-01-22 Danny Smith <danny_r_smith_2001@yahoo.co.nz> - - * include/stdint.h: New file. - -Thu Jan 18 10:33:01 2001 Earnie Boyd <earnie@users.sourceforge.net> - - * include/wchar.h: Protect prototypes only declared in the C++ STL - from being declared unless __cplusplus is defined. - -Tue Jan 16 11:37:31 2001 Earnie Boyd <earnie@users.sourceforge.net> - - * include/stdlib.h: Apply Danny Smith patch 102730 - 2000-12-09 Danny Smith <danny_r_smith_2001@yahoo.co.nz> - (_wgetenv) Correction to return type. - -Tue Jan 16 09:41:41 2001 Earnie Boyd <earnie@users.sourceforge.net> - - * include/locale.h: Apply Danny Smith patch 101834 - 2000-11-23 Danny Smith <danny_r_smith_2001@yahoo.co.nz> - (LC_MIN) Add definition. - (LC_MAX) ditto. - (_wsetlocale) Add prototype. - -2000-11-29 Earnie Boyd <earnie_boyd@yahoo.com> - - * Makefile.in: eliminate the need for RUNTIME and CRT_ID. - Always build crt1.o, dllcrt1.o, crt2.o and dllcrt2.o. - Create a libcoldname.a for the oldname library for CRTDLL. - Restrict libmoldname.a for the oldname library for MSVCRT. - * configure.in: eliminate setting RUNTIME and CRT_ID variables. - Restructure the $target_os case logic. - Always name the MinGW thread dll helper mingwm. - Change Cygwin's HEADER_SUBDIR value from mingw32 to mingw. - * configure: regenerate. - -2000-11-22 Earnie Boyd <earnie_boyd@yahoo.com> - - * Makefile.in: Fix bindist target to distribute the correct files. - Remove the use of SNAPSHOT variable and test SNAPDATE instead. - Set SNAPDATE within the snapshot target on recursive call to $(MAKE). - -2000-11-21 Earnie Boyd <earnie_boyd@yahoo.com> - - * Makefile.in: Add missing line continuation `\' for $(SUBDIRS) target. - Add variables and targets to control binary and source distributions. - Add variables and targets to control snapshot distribution. - * profile/gmon.h: Add missing #endif for #ifndef. - * profile/ChangeLog: Merge entries here and remove. - * profile/Makefile.in: Add variables and targets to control - distribution. - * README: Add. - * TODO: ditto. - * config.guess: ditto. - * config.sub: ditto. - * mkinstalldirs: ditto. - * install-sh: ditto. - * configure: regenerate. - * profile/configure: ditto. - -2000-11-20 Earnie Boyd <earnie_boyd@yahoo.com> - - * Merge in changes from - 2000-10-23 Danny Smith <danny_r_smith_2001@yahoo.co.nz> - * include/direct.h: add guard around MSVCRT-only prototytpes - * include/io.h: add __int64 struct definitions and function prototypes; - add guard for MSVCRT-only prototypes - * include/limits.h: add ISO C9x macros LLONG_MIN, LLONG_MAX, ULLONG_MAX - * include/stdio.h: add wchar function prototypes (__MSVCRT__); - put wchar functions together to make sync with wchar.h easier - * include/stdlib.h: add wide char functions (__MSVCRT__) - * include/string.h: add string collation functions ( __MSVCRT__) - * include/sys/stat.h: add __int64 struct and function ( __MSVCRT__) - * include/tchar.h: add macros and macro function definitions - * include/wchar.h: add wide char function prototypes ( __MSVCRT__ ); - enclose more functions in __MSVCRT__ guard; - some oldname wide char function prototypes #if (0)'d - * profile/gmon.h: add guard around BSD-ish typedefs - -Mon Nov 20 18:58:12 2000 Christopher Faylor <cgf@cygnus.com> - - * Makefile.in: Use a different variable name for subdirectory since the - previous one was used by the top level make. - -Sun Nov 19 20:50:51 2000 Christopher Faylor <cgf@cygnus.com> - - * Makefile.in: Install mingw stuff in a subdirectory if building under - cygwin. - -Sat Jun 17 21:48:23 2000 Christopher Faylor <cgf@cygnus.com> - - * Makefile.in (subdirs): Eliminate for loop. - -Sat Jun 17 18:27:59 2000 Christopher Faylor <cgf@cygnus.com> - - * Makefile.in (subdirs): Previous change did not fix problem in - broken shells. - -Sat Jun 17 13:49:12 2000 Christopher Faylor <cgf@cygnus.com> - - * Makefile.in: Avoid installing dll if we're cross building and the - cross-host system isn't a Windows system. - * configure.in: Detect cross-hosting situation and set appropriate - variables in Makefile.in. - * configure: Regenerate. - -Wed Apr 19 13:10:54 2000 Christopher Faylor <cgf@cygnus.com> - - * configure.in: Change HEADER_SUBDIR to mingw32. - * configure: Regenerate. - -Mon Apr 10 17:24:28 2000 Christopher Faylor <cgf@cygnus.com> - - * include/string.h: Use proper prototype for _strerror. - -2000-03-30 Mumit Khan <khan@xraylith.wisc.edu> - - * Makefile.in (subdirs): Workaround for broken shells. - -2000-02-03 Mumit Khan <khan@xraylith.wisc.edu> - - * Snapshot 2000-02-03. - - * include/{assert.h, conio.h, ctype.h, direct.h, dirent.h, fcntl.h, - float.h, io.h, locale.h, malloc.h, math.h, process.h, signal.h, - stdio.h, stdlib.h, string.h, time.h, wctype.h, sys/stat.h, - sys/timeb.h, sys/utime.h}: Remove parameter names to avoid namespace - pollution. - - * Makefile.in (all): Build CRT0S first. - (libmingwthrd.a): Remove thread support DLL from dependency. - -2000-01-21 Mumit Khan <khan@xraylith.wisc.edu> - - * Snapshot 2000-01-21. - -2000-01-20 Mumit Khan <khan@xraylith.wisc.edu> - - Merge in changes from Cygwin: - * configure.in (HEADER_SUBDIRS): New variable. Substitute. - (SUBDIRS): Likewise. - * Makefile.in (HEADER_SUBDIRS): New variable. - (install): Use to install Mingw headers to a subdirectory if building - under Cygwin. - (DLL_CC_STUFF): Add DLL entry point. - * configure: Regenerate. - -2000-01-19 Mumit Khan <khan@xraylith.wisc.edu> - - * include/stdio.h (fsetpos): Fix prototype. - (fpos_t): Fix for MSVCRT. - * include/float.h (fpreset): Add prototype. - * include/limits.h: Define UINT_MAX, USHRT_MAX and ULONG_MAX with - constant values. - * include/time.h: Don't define tzname as a macro for CRTDLL, and - export using libmoldname.a. - * crtdll.def: Add DATA tags. - * msvcrt.def: Likewise. - * moldname.def.in: Likewise. Add fpreset. Export tzname for - both MSVCRT and CRTDLL. - * moldname-crtdll.def: Regenerate. - * moldname-msvcrt.def: Regenerate. - -Tue Dec 21 02:22:14 1999 Mumit Khan <khan@xraylith.wisc.edu> - - * Snapshot 1999-12-21. - - * include/wctype.h: New file. - * include/ctype.h (MB_CUR_MAX): Define. - (wctype_t): Guard. - * include/stdlib.h (MB_CUR_MAX): Define. - * include/wchar.h: Define stat, _stat structures here as well. - * include/float.h: Add invalid subconditions (_SW) and floating - point error (_FPE) macros. - * include/time.h (_CLOCK_T): Rename macro to _CLOCK_T_DEFINED. - (_TIME_T): Rename macro to _TIME_T_DEFINED. - * include/sys/types.h: Likewise. - -Thu Nov 18 00:22:26 1999 Mumit Khan <khan@xraylith.wisc.edu> - - * profile/profil.c (profile_on): Set the profiler thread priority to - be time critical. Thanks to Pascal Obry <pascal_obry@csi.com>. - * Snapshot 1999-11-18. - -Sun Nov 7 02:50:09 1999 Mumit Khan <khan@xraylith.wisc.edu> - - Released 1999-11-07. - - * Makefile.in (CRT0S): Add crtst.o. - (install): Install in subdirs as well. - * dirent.h (struct _stat): Rename from struct stat. - * include/tchar.h: Add some new macros. Thanks to - Eric Kohl <ekohl@abo.rhein-zeitung.de>. - * profile/Makefile.in (install): Fix target. - -Thu Nov 4 14:32:58 1999 Mumit Khan <khan@xraylith.wisc.edu> - - * Makefile.in: Add support for profile directory. - * configure.in: Likewise. - * configure: Regenerate. - - * profile: Imported profiling sources from winsup-19991026 snapshot. - * profile/Makefile.in: New file. - * profile/configure.in: New file. - * profile/configure: Generate. - * profile/gcrt0.c (u_char, u_short, u_int, u_long): typedef for Mingw. - * profile/gmon.h (u_char, u_short, u_int, u_long): Likewise. - * profile/gmon.c (unistd.h): Include conditionally. - (sys/param.h): Likewise. - * profile/mcount.c (sys/param.h): Likewise. - * profile/profil.c (profile_on): thread id is DWORD, not int. - - -Wed Nov 3 16:26:44 1999 Mumit Khan <khan@xraylith.wisc.edu> - - * include/stdlib.h: Add wide character version of argv/environ. - Formatting changes. - * include/wchar.h: More wide character prototypes. - * include/sys/stat.h: Likewise. Add struct stat as well as _stat. - - * dllcrt1.c (init.c): Don't include. - (DllMainCRTStartup): Don't call _mingw32_init_mainargs(). - * Makefile.in: Remove init.c from dllcrt{1,2}.c dependency lists. - -Sat Oct 30 03:06:26 1999 Mumit Khan <khan@xraylith.wisc.edu> - - * moldname.def: Remove file. - * moldname.def.in: And add this. - * moldname-msvcrt.def: Generate from moldname.def.in. - * moldname-crtdll.def: Likewise. - - * mthr.c: New file for -mthread (thread-safe C++ EH) support. - * mthr_init.c: New file for -mthread (thread-safe C++ EH) support. - * mthr_stub.c: New file for -mthread (thread-safe C++ EH) support. - - * Makefile.in: Update. - * configure.in: Likewise. Also add *cygwin* target for building - under Cygwin winsup. - * configure: Regenerate. - -Fri Oct 1 11:10:30 1999 Mumit Khan <khan@xraylith.wisc.edu> - - * include/_mingw.h: Add version macros. - * include/direct.h (_diskfree_t, getdiskfree, getdrives): Add. - Also add wide character versions shared with wchar.h. - * include/dos.h (_diskfree_t, getdiskfree, getdrives): Add. - * include/io.h (sopen, _sopen): Fix prototype. - Add wide character prototypes. - * include/wchar.h: Likewise. - * include/stdlib.h (beep, seterrormode, sleep): Remove non- - underscored versions. Potential incompatibility. - * include/time.h (daylight, timezone, tzname): Fix MSVCRT cases. - Add wide character prototypes. - * include/sys/timeb.h (struct _timeb): Don't use macro, but real - definition. - -Wed Aug 18 18:38:39 1999 Mumit Khan <khan@xraylith.wisc.edu> - - * configure.in (RUNTIME, CRT_ID): Add to differentiate between - crtdll and msvcrt runtimes. Remove DLL_ENTRY and DEF_DLL_ENTRY - macros. - * configure: Rengerate. - * Makefile.in (RUNTIME, CRT_ID): Use to generate the correct - dll name and crt's. CRTDLL and MSVCRT are meant to created - separately, so remove all the *-msvcrt* targets. - (libmingwthr.a): New target. Dummy thread support archive. - (LIBS): Add libmingwthr.a. - (CRT0S): Use CRT_ID. Add crtmt.o. - (MINGW_OBJS): Add crtst.o. - * main.c (WinMain): Fix prototype. - * crtmt.c: New file. - * crtst.c: New file. - - * include/process.h (_beginthreadex): Fix prototype. - * include/_mingw.h (__int64): Define for __GNUC__. - * include/tchar.h (_ttol): Add macro. - * include/stdlib.h (_wtoi, _wtol, _i64toa, _ui64toa, _atoi64, - _i64tow, _ui64tow, _wtoi64): Add prototypes. - - Reported by Emanuele Aliberti <ea@iol.it>: - * include/tchar.h (_ttoi): Add macro. - - Reported by Ulf Moeller <3umoelle@informatik.uni-hamburg.de>: - * include/stdio.h (_snprintf): Add prototype. - (_vsnprintf): Likewise. - -Sat Aug 7 18:00:00 1999 Mumit Khan <khan@xraylith.wisc.edu> - - Reported by Tor Lillqvist <tml@iki.fi>: - * include/stdlib.h (__p___argv): Fix return type. - -Fri Jul 30 22:07:06 1999 Mumit Khan <khan@xraylith.wisc.edu> - - Add UWIN support. - * include/errno.h (errno): It's linked in from startup, not imported. - * include/stdlib.h (errno): Likewise. - * include/io.h: Guard against conflicting macros and prototypes in - system headers. - * include/stdlib.h: Likewise. - * include/string.h: Likewise. - * include/time.h: Likewise. - -Fri Jul 30 13:47:34 1999 Mumit Khan <khan@xraylith.wisc.edu> - - * include/io.h (X_OK): Fix definition. Thanks to Jan Nijtmans. - * include/dos.h: Fix typo __MINGW_EXPORT->__MINGW_IMPORT. - * Makefile.in (INCLUDES): Remove old windows32 include directory. - - * crt1.c (_gnu_exception_handler): Fix prototype. - (__mingw_CRTStartup): New function based on mainCRTStartup. - (mainCRTStartup): Set the app type for MSVCRT and call - __mingw_CRTStartup. - (WinMainCRTStartup): Likewise. - * init.c (_startupinfo): Define. - (_getmainargs): Add 5th parameter. - (_mingw32_init_mainargs): Use. - - * ALL *.c files: Reformat according to GNU coding style. - -Fri Jul 16 00:46:04 1999 Mumit Khan <khan@xraylith.wisc.edu> - - * Makefile.in (INCLUDES): Add w32api include directory. - - * include/_mingw.h: New file. - * include/{assert.h,conio.h,ctype.h,direct.h,dirent.h,dos.h, - errno.h,excpt.h,fcntl.h,float.h,io.h,limits.h,locale.h,malloc.h, - math.h,process.h,setjmp.h,share.h,signal.h,stdarg.h,stdio.h, - stdlib.h,string.h,tchar.h,time.h,varargs.h,sys/locking.h, - sys/stat.h,sys/timeb.h,sys/types.h,sys/utime.h}: Include and - use the macros __DECLSPEC_SUPPORTED and __MINGW_IMPORT. - - * include/stdlib.h (atexit): Fix prototype. - -Mon Jun 14 18:38:49 1999 Mumit Khan <khan@xraylith.wisc.edu> - - * include/stdio.h (_tempnam): Fix prototype. - (tempnam): Likewise. - * include/stdlib.h: Replace with GCC's version, and guard - with RC_INVOKED. - - From Anders Norlander <anorland@hem2.passagen.se>: - * include/stdlib.h (__argc): Declare. - (__argv): Likewise. - -Mon Apr 5 13:49:17 1999 Mumit Khan <khan@xraylith.wisc.edu> - - * crt1.c (_gnu_exception_handler): Acknowledge Jacob Navia's - contribution. - * Makefile.in (_libm_dummy.o): New target. - (libm.a): Use. - -Tue Mar 16 18:15:26 1999 Mumit Khan <khan@xraylith.wisc.edu> - - * Released 1999-03-16 along with egcs-1.1.2. - -Wed Feb 17 17:15:56 1999 Mumit Khan <khan@xraylith.wisc.edu> - - * Makefile.in (LIBS): Add libm.a. - (libm.a): Dummy libm.a. - - * Makefile.in: Update from winsup 1999-02-08 snapshot. - Preserve local changes. - (mkinstalldirs): In ../, not ../../. - (INCLUDES): Point to local windows32api headers and use -nostdinc. - (LIBGCC): Delete. - (LIBS): Add libmoldname-msvc.a. - (libmoldname-msvc.a): Add target. - (distclean): Add target. - -Tue Feb 9 00:26:05 1999 Mumit Khan <khan@xraylith.wisc.edu> - - * include/dir.h: Reintroduce as an obsolescent header. - * crt1.c (signal.h): Include. - (_gnu_exception_handler): New function to properly handle win32 - asynchronous signals. - (mainCRTStartup): Use. - -Sun Jan 3 23:52:25 1999 Mumit Khan <khan@xraylith.wisc.edu> - - * include/direct.h: Include io.h instead of dir.h - * include/dirent.h: Likewise. - * include/dos.h: Likewise. - * include/stdio.h: Replace reference to dir.h with io.h. - -Thu Dec 31 16:04:55 1998 Mumit Khan <khan@xraylith.wisc.edu> - - * 1999-01-01 release bundled with egcs-1.1.1. - - * include/io.h: Incorporate dir.h. - * include/dir.h: Remove. - * include/signal.h: Move RC_INVOKED up a bit. - -Tue Dec 29 15:04:38 1998 Mumit Khan <khan@xraylith.wisc.edu> - - * include/signal.h (sig_atomic_t): Define. - (NSIG): Define. - * include/malloc.h: Import defs from deprecated alloc.h. - * include/alloc.h: Remove. - - From "Daniel J. Rodriksson" <djr@dit.upm.es>: - * include/sys/types.h (_dev_t): Should be unsigned int for MSVCRT. - * include/sys/stat.h (struct stat): st_uid is of type short. Use - _off_t instead of long for st_size. - -Thu Sep 10 22:28:49 1998 Mumit Khan <khan@xraylith.wisc.edu> - - * include/errno.h (sys_errlist, sys_nerr): Move from here ... - * include/stdlib.h: Here. - - * include/netdb.h: Remove. - * include/arpa/inet.h: Remove. - * include/netinet/in.h: Remove. - * include/sys/socket.h: Remove. - -Fri Sep 4 15:09:11 1998 Mumit Khan <khan@xraylith.wisc.edu> - - * Release egcs-1.1. - - * include/{ctype.h,dos.h,io.h,string.h,time.h,sys/types.h, - sys/utime.h}: Protect stddef.h in RC_INVOKED macro. - -Thu Sep 3 10:43:29 1998 Mumit Khan <khan@xraylith.wisc.edu> - - * setjmp.h (_JBTYPE, _JBLEN): Define correctly. - (jmpbuf): typedef using above. - (setjmp, longjmp): Prototype using jmpbuf. - - Merge with Colin Peters' 980701 snapshot. I've ignored changes to - obsolescent imported names, ie., from __imp__ to _imp___. - - Also ignored empty include/sys/param.h and incorrect - include/sys/times.h. - - * CRTinit.c: New file. - * include/{errno.h,fcntl.h,math.h,process.h} (__MSVCRT__): Use #ifdef - instead of #if. - * include/io.h (umask): Fix prototype. - * include/stdlib.h (OS constants): Replace with Colin's. - * include/time.h (tzset, daylight, timezone): Replace with Colin's. - * include/sys/state.h: Merge. - -Thu Sep 3 09:49:07 1998 Mumit Khan <khan@xraylith.wisc.edu> - - * include/assert.h (assert): Lose the trailing semicolon. - -Thu Jul 30 21:18:49 1998 Mumit Khan <khan@xraylith.wisc.edu> - - * include/math.h (matherr): Declare. - * include/stdio.h (fileno, _fileno): Declare. - * include/stdlib.h (environ, _environ): Fix to use runtime DLL. - - From Earnie Boyd: - * include/stdio.h (fdopen, _fdopen): Add const. - (getw, putw): Declare. - * include/stdlib.h (MAX_{DRIVE,DIR,FNAME,EXT}): Fix. - -Sat Jun 13 18:19:41 1998 Mumit Khan <khan@xraylith.wisc.edu> - - * include/time.h (_timezone): Undefine. - * include/sys/timeb.h (struct timeb): Rename _timezone to timezone. - - * include/time.h (_daylight, _timezone, _tzname, _tzset): Remove - __cdecl for MSVCRT. - * include/stdlib.h (environ): Use DLL version. - * init.c (environ): Undefine it before use. - -Sun Mar 22 19:59:30 1998 Mumit Khan <khan@xraylith.wisc.edu> - - * Update to 980309 snapshot from Colin Peters. - - * include/utime.h: remove - * include/stdlib.h (__imp__osver_dll, __imp__winver_dll, - __imp__winmajor_dll, __imp__winminor_dll): Apply Jan-Jaap's - patches to define these. - * include/time.h (CLK_TCK): Renamed from CLK_TICK. - (_daylight, _timezone, _tzname, _tzset): Define. - - * include/netdb.h: Add from Colin's windows32api changes. - * include/sys/socket.h: Likewise. - * include/arpa/inet.h: Likewise. - * include/netinet/in.h: Likewise. - -Wed Feb 4 14:16:44 1998 Mumit Khan <khan@xraylith.wisc.edu> - - * Update to 980128 snapshot from Colin Peters. - -Sat Dec 6 21:30:35 1997 Mumit Khan <khan@xraylith.wisc.edu> - - * configure.in (AC_INIT): Use dllmain.c instead of defunct - oldnames.c - * configure: Regenerate. - -Fri Dec 5 15:57:36 1997 Mumit Khan <khan@xraylith.wisc.edu> - - * Update to 971205 snapshot from Colin Peters. Lots of changes. - Files renamed and include hierarchy loses directories named - nonansi. - - * include/dos.h: from Jan-Jaap. - -Thu Dec 4 21:48:13 1997 Mumit Khan <khan@xraylith.wisc.edu> - - Changes to conform to FSF tree. - - * crt1.c: Renamed from mcrt0.c. - * dllcrt1.c: Renamed from dllcrt0.c. - * Makefile.in: Update above. Also renamed libmoldnames.a to - libmoldname.a. - -Mon Dec 1 16:51:30 1997 Mumit Khan <khan@xraylith.wisc.edu> - - * crtdll.def: Export all functions but the ones with funny names. - * moldnames.def: Add fdopen since fileno is already there. - * include/nonansi/dos.h: New file from Jan-Jaap. - * include/errno.h: Add extern decl + various additions from JJ. - * include/stdio.h: Likewise. - * include/stdlib.h: Likewise. - * include/nonansi/io.h: Likewise. - * include/nonansi/process.h: Likewise. - * include/sys/types.h: Likewise. - -Tue Nov 4 14:51:01 1997 Mumit Khan <khan@xraylith.wisc.edu> - - * include/time.h (CLK_TCK): Renamed from CLK_TICK. - (CLK_TICK): Delete. - * include/stdlib.h (free): Fix prototype to return void, not void*. - * include/nonansi/process.h: Add P_* and WAIT_* defs. - - * dllcrt0.c: Delete now-unneeded '.section .idata$3' asm hack. - * mcrt0.c: Likewise. - - * Makefile.in (LIBS): Delete moldnames.dll from target libs. - (libmoldnames.a): Add explicit rule to create it. - -Fri Aug 15 18:23:43 1997 Rob Savoye <rob@cygnus.com> - - New directory for the minimalist cygwin environment. - - * crtglob.c: New file. Turn on file globbing support. - * crt_noglob.c: New file. Turn off file globbing support. - * ctype_old.c: New file. Wrappers for functions that don't - have an underscore. - * dirent.c: New file. Directory routines readdir, opendir, closedir. - * dllcrt0.c: New file. Initialization code to use crtdll.dll. - * dllmain.c: New file. A stub DllMain function. - * hugeval.c: New file. A gross hack to define HUGE_VAL. - * init.c: New file. Common code to initialize standard file - handles and command line arguments. - * main.c: New file. A main for programs that only call WinMain. - * mcrt0.c: New file. Default crt0 for mingw32. - * oldnames.c: New File. Wrappers for functions that don't - have an underscore. - * string_old.c: New File. - * include/{assert.h,ctype.h,errno.h,float.h,limits.h,locale.h - math.h,nonansi,setjmp.h,signal.h,stdarg.h,stddef.h,stdio.h,stdlib.h - string.h,tchar.h,time.h,wchar.h}: New header files for mingw. - * include/sys/types.h: New header file for mingw. - * include/nonansi/{alloc.h,conio.h,dir.h,direct.h,dirent.h - fcntl.h,io.h,malloc.h,mem.h,memory.h,process.h,share.h,unistd.h - utime.h,values.h,varargs.h}: New header files for mingw. - * include/nonansi/sys/{fcntl.h,locking.h,stat.h,time.h - timeb.h,unistd.h}: New header files for mingw. - * Makefile.in,configure.in: Build and configure support. - * configure: Generated from autoconf 2.12 with Cygnus patches. diff --git a/winsup/mingw/DISCLAIMER b/winsup/mingw/DISCLAIMER deleted file mode 100644 index be3469cbb..000000000 --- a/winsup/mingw/DISCLAIMER +++ /dev/null @@ -1,12 +0,0 @@ -/* - * DISCLAIMER - * This file has no copyright assigned and is placed in the Public Domain. - * This file is a part of the mingw-runtime package. - * - * The mingw-runtime package and its code is distributed in the hope that it - * will be useful but WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESSED OR - * IMPLIED ARE HEREBY DISCLAIMED. This includes but is not limited to - * warranties of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You are free to use this package and its code without limitation. - */ diff --git a/winsup/mingw/Makefile.in b/winsup/mingw/Makefile.in deleted file mode 100644 index 9f0fa96bd..000000000 --- a/winsup/mingw/Makefile.in +++ /dev/null @@ -1,569 +0,0 @@ -# Makefile.in for the winsup/mingw directory. -# Copyright (c) 1995-2008, 1996, 1997, 1998 Cygnus Solutions - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -# This makefile requires GNU make. - -VERSION = @PACKAGE_VERSION@ -CYGRELEASE = 1 - -VPATH = @srcdir@ -srcdir = @srcdir@ -objdir = . - -host_alias = @host_alias@ -build_alias = @build_alias@ -target_alias = @target_alias@ -with_cross_host = @with_cross_host@ -prefix = @prefix@ -conf_prefix = @prefix@ -# FIXME: this needs an appropriate AC_SUBST -host_os = mingw32 - -ifneq (,$(findstring cygwin, $(target_alias))) -PACKAGE = mingw-runtime -else -PACKAGE = mingwrt -endif - -program_transform_name = @program_transform_name@ -exec_prefix = @exec_prefix@ -bindir = @bindir@ -libdir = @libdir@ -ifneq (,$(findstring cygwin,$(target_alias))) -mandir = $(prefix)/share/man -mansection = mingw -else -mandir = @mandir@ -mansection = 3 -endif -manpage_transform = @mingw_manpage_transform@ -ifeq ($(target_alias),$(host_alias)) -ifeq ($(build_alias),$(host_alias)) -tooldir:=$(exec_prefix) -else -tooldir:=$(exec_prefix)/$(target_alias) -endif -else -tooldir:=$(exec_prefix)/$(target_alias) -endif -datadir = @datadir@ -infodir = @infodir@ -includedir = @includedir@ -ifneq (,$(findstring cygwin,$(target_alias))) -inst_bindir:=$(tooldir)/bin -inst_includedir:=$(tooldir)/include/mingw -inst_libdir:=$(tooldir)/lib/mingw -inst_docdir:=$(tooldir)/share/doc/mingw-runtime -else -ifneq (,$(with_cross_host)) -inst_bindir:=$(tooldir)/bin -inst_includedir:=$(tooldir)/include -inst_libdir:=$(tooldir)/lib -inst_docdir:=$(tooldir)/share/doc/mingw-runtime -else -inst_bindir:=$(bindir) -inst_includedir:=$(includedir) -inst_libdir:=$(libdir) -inst_docdir:=$(prefix)/doc/runtime -endif -endif - -# The Mingw headers are installed under a subdirectory of -# $(tooldir)/include when configuring in Cygwin. -HEADER_SUBDIR = @HEADER_SUBDIR@ - -SHELL = /bin/sh - -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -mkinstalldirs = $(SHELL) @MKINSTALLDIRS@ - -CC := @CC@ -ifneq (,$(findstring cygwin,$(target_alias))) -override CC := ${filter-out -L% -B%,${shell echo $(CC) | sed -e 's%\(-isystem\|-iwithprefixbefore\) *[^ ]*\( \|$$\)% %g'}} -endif -# FIXME: Which is it, CC or CC_FOR_TARGET? -CC_FOR_TARGET = $(CC) -AS_FOR_TARGET = $(AS) -CFLAGS = @CFLAGS@ -CXXFLAGS = @CXXFLAGS@ - -# compiling with Cygwin? -NO_CYGWIN := @NO_CYGWIN@ -ifdef NO_CYGWIN -override CC := ${NO_CYGWIN} $(firstword ${CC}) -endif - -# Either crtdll (CRT_ID 1) or msvcrt (CRT_ID 2). -RUNTIME = @RUNTIME@ -CRT_ID = @CRT_ID@ - -# Needed for threading dll. -THREAD_DLL = @THREAD_DLL@ -THREAD_DLL_VERSION = 10 -THREAD_DLL_NAME = $(THREAD_DLL)$(THREAD_DLL_VERSION).dll - -# Various libraries. -LIBM_A=@LIBM_A@ - -W32API_INCLUDE = @W32API_INCLUDE@ -INCLUDES = -I$(srcdir)/include \ - -I$(srcdir)/../include \ - -nostdinc \ - -iwithprefixbefore include -ALL_CFLAGS = $(CFLAGS) $(INCLUDES) $(W32API_INCLUDE) -ALL_CXXFLAGS = $(CXXFLAGS) $(INCLUDES) -nostdinc++ $(W32API_INCLUDE) - -AS = @AS@ -AR = @AR@ -LD = @LD@ -AR_FLAGS = rcv -RANLIB = @RANLIB@ -DLLTOOL = @DLLTOOL@ -DLLTOOLFLAGS = -DLLTOOL_FOR_TARGET = $(DLLTOOL) -DLLTOOL_FLAGS = --as $(AS_FOR_TARGET) -DLLWRAP = @DLLWRAP@ -DLLWRAP_FOR_TARGET = $(DLLWRAP) -DLLWRAP_FLAGS = --dlltool $(DLLTOOL) --as $(AS) --driver-name $(CC) -OBJCOPY = @OBJCOPY@ -NM = @NM@ - -TAR = tar -TARFLAGS = z -TARFILEEXT = .tar.gz - -SUBDIRS := @subdirs@ - -FLAGS_TO_PASS:=\ - AS="$(AS)" \ - CC="$(CC)" \ - CFLAGS="$(CFLAGS) $(CFLAGS_COMMON) $(CFLAGS_CONFIG)" \ - CXXFLAGS="$(CXXFLAGS) $(CFLAGS_COMMON) $(CFLAGS_CONFIG)" \ - EXE_LDFLAGS="$(EXE_LDFLAGS)" \ - AR="$(AR)" \ - RANLIB="$(RANLIB)" \ - LD="$(LD)" \ - DLLTOOL="$(DLLTOOL)" \ - exec_prefix="$(exec_prefix)" \ - bindir="$(bindir)" \ - libdir="$(libdir)" \ - tooldir="$(tooldir)" \ - datadir="$(datadir)" \ - infodir="$(infodir)" \ - includedir="$(includedir)" \ - inst_bindir="$(inst_bindir)" \ - inst_includedir="$(inst_includedir)" \ - inst_libdir="$(inst_libdir)" \ - inst_docdir="$(inst_docdir)" \ - prefix="$(prefix)" \ - target_alias="$(target_alias)" \ - TAR="$(TAR)" \ - TARFLAGS="$(TARFLAGS)" \ - TARFILEEXT="$(TARFILEEXT)" - -CRT0S = crt1.o dllcrt1.o crt2.o dllcrt2.o CRT_noglob.o crtmt.o crtst.o \ - CRT_fp8.o CRT_fp10.o txtmode.o binmode.o -MINGW_OBJS = CRTglob.o CRTfmode.o CRTinit.o dllmain.o gccmain.o \ - main.o crtst.o mthr_stub.o CRT_fp10.o txtmode.o \ - pseudo-reloc.o pseudo-reloc-list.o cpu_features.o - -MOLD_OBJS = isascii.o iscsym.o iscsymf.o toascii.o \ - strcasecmp.o strncasecmp.o wcscmpi.o - -LIBS = libcrtdll.a \ - libmsvcrt.a libmsvcrtd.a \ - libmsvcr70.a libmsvcr70d.a \ - libmsvcr71.a libmsvcr71d.a \ - libmsvcr80.a libmsvcr80d.a \ - libmsvcr90.a libmsvcr90d.a \ - libmingw32.a \ - libcoldname.a \ - libmoldname.a libmoldnamed.a \ - libmoldname70.a libmoldname70d.a \ - libmoldname71.a libmoldname71d.a \ - libmoldname80.a libmoldname80d.a \ - libmoldname90.a libmoldname90d.a \ - $(LIBM_A) \ - libmingwthrd.a - -DLLS = $(THREAD_DLL_NAME) - -INSTDOCS = CONTRIBUTORS \ - DISCLAIMER \ - README - -SRCDIST_FILES = CRT_noglob.c CRTfmode.c CRTglob.c CRTinit.c ChangeLog \ -Makefile.in README TODO config.guess config.sub configure configure.in \ -aclocal.m4 crt1.c crtdll.def crtmt.c crtst.c dllcrt1.c dllmain.c \ -gccmain.c init.c install-sh jamfile main.c mkinstalldirs \ -moldname.def.in msvcrt.def.in ofmt_stub.s \ -mthr.c mthr_init.c mthr_stub.c readme.txt \ -isascii.c iscsym.c iscsymf.c toascii.c \ -strcasecmp.c strncasecmp.c wcscmpi.c \ -CRT_fp8.c CRT_fp10.c test_headers.c txtmode.c binmode.c pseudo-reloc.c \ -pseudo-reloc-list.c cpu_features.c cpu_features.h \ -DISCLAIMER CONTRIBUTORS - - -all_dlls_host = @all_dlls_host@ -install_dlls_host = @install_dlls_host@ - -all: $(CRT0S) $(LIBS) $(all_dlls_host) - @$(MAKE) subdirs DO=$@ $(FLAGS_TO_PASS) - -all_dlls_host: $(DLLS) - -install_dlls_host: - for i in $(DLLS); do \ - $(INSTALL_PROGRAM) $$i $(inst_bindir)/$$i ; \ - done - -_libm_dummy.o: - rm -f _libm_dummy.c - echo "static int __mingw_libm_dummy;" > _libm_dummy.c - $(CC) -c $(ALL_CFLAGS) _libm_dummy.c - rm -f _libm_dummy.c - -libm.a: _libm_dummy.o - $(AR) rc $@ _libm_dummy.o - $(RANLIB) $@ - -libmingwthrd.a: crtmt.o mingwthrd.def - $(DLLTOOL) $(DLLTOOL_FLAGS) --dllname $(THREAD_DLL_NAME) \ - --def mingwthrd.def --output-lib $@ - $(AR) $(ARFLAGS) $@ crtmt.o - $(RANLIB) $@ - -DLL_OFILES = mthr.o mthr_init.o -DLL_CC_STUFF = -B./ -shared $(MNO_CYGWIN) -Wl,--image-base,0x6FBC0000 \ - -Wl,--entry,_DllMainCRTStartup@12 \ - $(DLL_OFILES) mingwthrd.def \ - -Lmingwex - -$(THREAD_DLL_NAME) mingwthrd.def: $(DLL_OFILES) Makefile $(SUBDIRS) - $(DLLTOOL) --as $(AS) --output-def mingwthrd.def $(DLL_OFILES) - $(CC) $(DLL_CC_STUFF) -o $(THREAD_DLL_NAME) - -libmingw32.a: $(MINGW_OBJS) - $(AR) rc $@ $(MINGW_OBJS) - $(RANLIB) $@ - -msvcrt.def msvcrtd.def \ -msvcr70.def msvcr70d.def \ -msvcr71.def msvcr71d.def \ -msvcr80.def msvcr80d.def \ -msvcr90.def msvcr90d.def \ -: msvcrt.def.in - $(CC) -DRUNTIME=$(basename $(notdir $@)) \ - -D__$(basename $(notdir $@))__=1 \ - -D__MSVCRT__ -C -E -P \ - -xc-header $? > $@ - -moldname-crtdll.def: moldname.def.in - $(CC) -DRUNTIME=crtdll \ - -D__FILENAME__=moldname-crtdll.def \ - -D__CRTDLL__ -C -E -P \ - -xc-header $? > $@ - -moldname-msvcrt.def: moldname.def.in - $(CC) -DRUNTIME=msvcrt \ - -D__FILENAME__=moldname-msvcrt.def \ - -D__MSVCRT__ -C -E -P \ - -xc-header $? > $@ - -libcoldname.a: moldname-crtdll.def $(MOLD_OBJS) - $(DLLTOOL) --as $(AS) -k -U \ - --dllname crtdll.dll \ - --def moldname-crtdll.def \ - --output-lib $@ - $(AR) rc $@ $(MOLD_OBJS) - $(RANLIB) $@ - -libmoldname.a libmoldnamed.a: moldname-msvcrt.def $(MOLD_OBJS) - $(DLLTOOL) --as $(AS) -k -U \ - --dllname msvcrt$(@:libmoldname%a=%)dll \ - --def moldname-msvcrt.def \ - --output-lib $@ - $(AR) rc $@ $(MOLD_OBJS) - $(RANLIB) $@ - -libmoldname70.a libmoldname70d.a \ -libmoldname71.a libmoldname71d.a \ -libmoldname80.a libmoldname80d.a \ -libmoldname90.a libmoldname90d.a: moldname-msvcrt.def $(MOLD_OBJS) - $(DLLTOOL) --as $(AS) -k -U \ - --dllname msvcr$(@:libmoldname%a=%)dll \ - --def moldname-msvcrt.def \ - --output-lib $@ - $(AR) rc $@ $(MOLD_OBJS) - $(RANLIB) $@ - -# The special rules are necessary. -crt1.o dllcrt1.o: - $(CC) -c -D__CRTDLL__ -U__MSVCRT__ $(ALL_CFLAGS) $< -o $@ - -crt2.o dllcrt2.o: - $(CC) -c -D__MSVCRT__ -U__CRTDLL__ $(ALL_CFLAGS) $< -o $@ - -check: check-headers - -TEST_H_OPTIONS = $(ALL_CFLAGS) -Wall -W -Wsystem-headers -c \ - $(srcdir)/test_headers.c -o test_headers.o - -.PHONY: check-headers -check-headers: force - @echo "Testing runtime headers..." - @for lang in c c++ objective-c ; do \ - echo "$$lang ..."; \ - $(CC) -x$$lang $(TEST_H_OPTIONS) ; \ - echo "$$lang -ansi"; \ - $(CC) -x$$lang -ansi $(TEST_H_OPTIONS) ; \ - done -# specify -std=xx only for C - @for std in gnu89 gnu99 c89 c99 ; do \ - echo "std = $$std"; \ - $(CC) -std=$$std $(TEST_H_OPTIONS) ; \ - done - - @rm -f test_headers.o - -clean: - -rm -f *.o *.a *~ core a.out mingwthrd.def mingwthrd.base mingwthrd.exp - -rm -f $(THREAD_DLL_NAME) mingwthrd_dummy.exe - -rm -f msvcr*.def moldname-*.def - @$(MAKE) subdirs DO=$@ $(FLAGS_TO_PASS) - -distclean: clean - @$(MAKE) subdirs DO=$@ $(FLAGS_TO_PASS) - -rm -f config.cache config.status config.log - -rm -f Makefile - -ifdef SNAPDATE - distdir=$(PACKAGE)-$(VERSION)-$(SNAPDATE) -else - ifneq (,$(findstring cygwin, $(target_alias))) - distdir=$(PACKAGE)-$(VERSION)-$(CYGRELEASE) - else - distdir=$(PACKAGE)-$(VERSION)-$(host_os) - endif -endif - -ifneq (,$(findstring cygwin, $(target_alias))) - TARFLAGS = j - TARFILEEXT = .tar.bz2 - dist_prefix = $(conf_prefix) -endif - -dist: srcdist bindist - -srcdist: - rm -rf $(distdir) - mkdir $(distdir) - chmod 755 $(distdir) - for i in $(SRCDIST_FILES); do \ - cp -p $(srcdir)/$$i $(distdir)/$$i ; \ - done - for i in $(SUBDIRS); do \ - (cd $$i; $(MAKE) distdir=../$(distdir) dist); \ - done -#FIXME this needs to be done with SUBDIRS and Makefiles. -# -# Maybe, but this is simpler, and adequate for now! -# However, as more manpages are added, spanning multiple sections, -# we'll probably need a separate Makefile to organise them. -# - mkdir $(distdir)/include - mkdir $(distdir)/include/sys - cp $(srcdir)/include/*.h $(distdir)/include/ - cp $(srcdir)/include/sys/*.h $(distdir)/include/sys/ - mkdir $(distdir)/man - cp $(srcdir)/man/*.man $(distdir)/man/ -# -#end FIXME - rm -f $(distdir)-src.tar.gz - $(TAR) $(TARFLAGS)cf $(distdir)-src$(TARFILEEXT) $(distdir) - -# Binary package structure is determined according to the -# preferred package name assigned at configure time... -# -bindist: bindist-$(PACKAGE) - -# The directory structure is common to both package styles... -# -bindist-common: - rm -rf $(distdir) - mkdir $(distdir) - chmod 755 $(distdir) - $(MAKE) install prefix=$(shell pwd)/$(distdir)$(dist_prefix) - rm -f $(distdir).tar.gz - -# Current MinGW distributions prefer separate `dev' and `dll' bundles, -# and use the abbreviated `mingwrt' form for the package name... -# -DEVDIST_FILES = * --exclude=bin -DLLDIST_FILES = bin/*.dll doc/* -# -bindist-mingwrt: bindist-common - cd $(distdir); \ - $(TAR) $(TARFLAGS)cf ../$(distdir)-dev$(TARFILEEXT) $(DEVDIST_FILES); \ - $(TAR) $(TARFLAGS)cf ../$(distdir)-dll$(TARFILEEXT) $(DLLDIST_FILES) - rm -rf $(distdir) - -# However, Cygwin maintainers continue to prefer a composite package, -# retaining the older `mingw-runtime' naming convention... -# -BINDIST_FILES = * -# -bindist-mingw-runtime: bindist-common - cd $(distdir); \ - $(TAR) $(TARFLAGS)cf ../$(distdir)$(TARFILEEXT) $(BINDIST_FILES) - rm -rf $(distdir) - -snapshot: - make dist SNAPDATE=$(shell date '+%Y%m%d') - -info: - -info-html: - -install-info: info - -install-dirs: - $(mkinstalldirs) $(inst_bindir) - $(mkinstalldirs) $(inst_includedir) - $(mkinstalldirs) $(inst_libdir) - $(mkinstalldirs) $(inst_docdir) - $(mkinstalldirs) $(mandir)/man$(mansection) - -install: all install-dirs $(install_dlls_host) - for i in $(LIBS); do \ - $(INSTALL_DATA) $$i $(inst_libdir)/$$i ; \ - done - for i in $(CRT0S); do \ - $(INSTALL_DATA) $$i $(inst_libdir)/$$i ; \ - done - for i in $(INSTDOCS); do \ - $(INSTALL_DATA) $(srcdir)/$$i $(inst_docdir)/$$i ; \ - done - for sub in . sys ; do \ - dstdir=$(inst_includedir)/$$sub ; \ - $(mkinstalldirs) $$dstdir ; \ - for i in $(srcdir)/include/$$sub/*.h ; do \ - $(INSTALL_DATA) $$i $$dstdir/`basename $$i` ; \ - done ; \ - done -# -# This provisional hack installs the only manpage we have at present... -# It simply CANNOT suffice, when we have more manpages to ship. -# - $(mkinstalldirs) $(mandir)/man$(mansection) - $(INSTALL_DATA) $(srcdir)/man/dirname.man $(mandir)/man$(mansection)/`\ - echo dirname.man|sed '$(manpage_transform);s,man$$,$(mansection),'` - $(INSTALL_DATA) $(srcdir)/man/dirname.man $(mandir)/man$(mansection)/`\ - echo basename.man|sed '$(manpage_transform);s,man$$,$(mansection),'` -# -# End provisional hack. -# - @$(MAKE) subdirs DO=$@ $(FLAGS_TO_PASS) - -subdirs: $(SUBDIRS) - @true - -# The . is here because SUBDIRS may be empty - -. $(SUBDIRS): force - @if [ -d ./$@ ]; then \ - echo "Making $(DO) in $@..." ; \ - if (rootme=`pwd`/ ; export rootme ; \ - rootsrc=`cd $(srcdir); pwd`/ ; export rootsrc ; \ - cd ./$@; \ - $(MAKE) $(FLAGS_TO_PASS) $(DO)) ; then true ; \ - else exit 1 ; \ - fi ; \ - else true ; \ - fi - -force: - -# -# Dependencies -# -libcrtdll.a: crtdll.def -libmsvcrt.a: msvcrt.def -libmsvcrtd.a: msvcrtd.def -CRT_noglob.o: CRT_noglob.c -CRTfmode.o: CRTfmode.c -CRTglob.o: CRTglob.c -CRTinit.o: CRTinit.c -crt1.o: crt1.c init.c -crt2.o: crt1.c init.c -crtmt.o: crtmt.c -crtst.o: crtst.c -ctype_old.o: ctype_old.c -dllcrt1.o: dllcrt1.c -dllcrt2.o: dllcrt1.c -dllmain.o: dllmain.c -main.o: main.c -oldnames.o: oldnames.c -string_old.o: string_old.c -CRT_fp8.o: CRT_fp8.c -CRT_fp10.o: CRT_fp10.c - - -Makefile: Makefile.in config.status configure - $(SHELL) config.status - -config.status: configure - $(SHELL) config.status --recheck - -.SUFFIXES: .y $(SUFFIXES) .cc .def .a - -sym_prefix = __msvcrt - -NM_LOOKUP = $(NM) $@ | sed -n \ - -e '/:$$/h;/^[0-7][0-7]* *T */{s///;H;g;s/\n//p' \ - -e '}' | sed -n 's/:_'"$$key"'$$//p' - -MINGW_REPL_FUNCS = printf fprintf sprintf vprintf vfprintf vsprintf - -lib%.a: %.def - $(DLLTOOL) --as=$(AS) -k --dllname $*.dll --output-lib $@ --def $< - for key in $(MINGW_REPL_FUNCS); do \ - src=`$(NM_LOOKUP)`; \ - if test -n "$$src"; then \ - dst=`echo "$$src" | sed 's/0/4/'`; repl="$$repl $$dst"; \ - tmpfiles="$$tmpfiles $$src $$dst"; \ - $(AR) x $@ $$src; \ - $(OBJCOPY) --redefine-sym _$$key=_$(sym_prefix)_$$key \ - --redefine-sym __imp__$$key=__imp__$(sym_prefix)_$$key \ - $$src $$dst; \ - fi; done; \ - test `key=_get_output_format; $(NM_LOOKUP)` || \ - repl="$$repl ofmt_stub.o"; \ - test -n "$$repl" && $(AR) rcs $@ $$repl; \ - $(RM) $$tmpfiles - -libmsvcrt.a libmsvcrtd.a: ofmt_stub.o -libmsvcr70.a libmsvcr70d.a: ofmt_stub.o -libmsvcr71.a libmsvcr71d.a: ofmt_stub.o -libcrtdll.a libcrtdlld.a: ofmt_stub.o - -.c.o: - $(CC) -c $(ALL_CFLAGS) $< -o $@ - diff --git a/winsup/mingw/README b/winsup/mingw/README deleted file mode 100644 index bcde14423..000000000 --- a/winsup/mingw/README +++ /dev/null @@ -1,10 +0,0 @@ - Free Microsoft C Runtime and import library definitions - - Maintained by MinGW Developers - Send bug reports and questions to MinGW-users@lists.sourceforge.net - URL: http://www.mingw.org - -A historical readme.txt exists and is distributed for your edification. The -references within may or may not be correct. Please do not rely on them. See -http://www.mingw.org for a list of valid references. - diff --git a/winsup/mingw/TODO b/winsup/mingw/TODO deleted file mode 100644 index 60f6bc2af..000000000 --- a/winsup/mingw/TODO +++ /dev/null @@ -1 +0,0 @@ -Finish the README. diff --git a/winsup/mingw/aclocal.m4 b/winsup/mingw/aclocal.m4 deleted file mode 100644 index 77786d631..000000000 --- a/winsup/mingw/aclocal.m4 +++ /dev/null @@ -1,121 +0,0 @@ -# aclocal.m4 for MinGW Runtime package. -*- Autoconf -*- -# -# This provides configure definitions used by all the winsup -# configure.in files. - -# MINGW_AC_CONFIG_SRCDIR( VERSION_TAG, UNIQUE_FILE ) -# -------------------------------------------------- -# Wrapper for AC_CONFIG_SRCDIR; in addition to checking for a -# unique file reference within the source tree, it resolves the -# definition for PACKAGE_VERSION, based on a tagged definition -# within that file. -# -AC_DEFUN([MINGW_AC_CONFIG_SRCDIR], -[AC_CONFIG_SRCDIR([$2]) - AC_MSG_CHECKING([package version]) - PACKAGE_VERSION=`awk '$[2] == "'"$1"'" { print $[3] }' ${srcdir}/$2` - AC_MSG_RESULT([$PACKAGE_VERSION])dnl -]) #MINGW_AC_CONFIG_SRCDIR - -# The following is copied from `no-executables.m4', in the top -# `src/config' directory. -# -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, -# 2005 Free Software Foundation, Inc. -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -# GCC_NO_EXECUTABLES -# ------------------ -# FIXME: The GCC team has specific needs which the current Autoconf -# framework cannot solve elegantly. This macro implements a dirty -# hack until Autoconf is able to provide the services its users -# need. -# -# Several of the support libraries that are often built with GCC can't -# assume the tool-chain is already capable of linking a program: the -# compiler often expects to be able to link with some of such -# libraries. -# -# In several of these libraries, workarounds have been introduced to -# avoid the AC_PROG_CC_WORKS test, that would just abort their -# configuration. The introduction of AC_EXEEXT, enabled either by -# libtool or by CVS autoconf, have just made matters worse. -# -# Unlike the previous AC_NO_EXECUTABLES, this test does not -# disable link tests at autoconf time, but at configure time. -# This allows AC_NO_EXECUTABLES to be invoked conditionally. -AC_DEFUN_ONCE([GCC_NO_EXECUTABLES], -[m4_divert_push([KILL]) - -AC_BEFORE([$0], [_AC_COMPILER_EXEEXT]) -AC_BEFORE([$0], [AC_LINK_IFELSE]) - -m4_define([_AC_COMPILER_EXEEXT], -AC_LANG_CONFTEST([AC_LANG_PROGRAM()]) -# FIXME: Cleanup? -AS_IF([AC_TRY_EVAL(ac_link)], [gcc_no_link=no], [gcc_no_link=yes]) -if test x$gcc_no_link = xyes; then - # Setting cross_compile will disable run tests; it will - # also disable AC_CHECK_FILE but that's generally - # correct if we can't link. - cross_compiling=yes - EXEEXT= -else - m4_defn([_AC_COMPILER_EXEEXT])dnl -fi -) - -m4_define([AC_LINK_IFELSE], -if test x$gcc_no_link = xyes; then - AC_MSG_ERROR([Link tests are not allowed after [[$0]].]) -fi -m4_defn([AC_LINK_IFELSE])) - -dnl This is a shame. We have to provide a default for some link tests, -dnl similar to the default for run tests. -m4_define([AC_FUNC_MMAP], -if test x$gcc_no_link = xyes; then - if test "x${ac_cv_func_mmap_fixed_mapped+set}" != xset; then - ac_cv_func_mmap_fixed_mapped=no - fi -fi -if test "x${ac_cv_func_mmap_fixed_mapped}" != xno; then - m4_defn([AC_FUNC_MMAP]) -fi) - -m4_divert_pop()dnl -])# GCC_NO_EXECUTABLES - - -# MINGW_AC_MANPAGE_TRANSFORM -# -------------------------- -# Provide support for specifying a manpage name transform. -# This allows e.g. Cygwin to add a `mingw-' prefix to MinGW specific -# manpages, when installing as a Cygwin subsystem. -# -# Activated by `--enable-mingw-manpage-transform[=SED-SCRIPT]', the -# default is disabled, (i.e. no transform). If enabled, without any -# SED-SCRIPT specification, the default `mingw-' prefix is added. -# -AC_DEFUN([MINGW_AC_MANPAGE_TRANSFORM], -[AC_ARG_ENABLE([mingw-manpage-transform], -[AS_HELP_STRING([--enable-mingw-manpage-transform@<:@=SED-SCRIPT@:>@], - [apply SED-SCRIPT @<:@s/^/mingw-/@:>@ to installed manpage names])] -[AS_HELP_STRING([--disable-mingw-manpage-transform], - [@<:@DEFAULT@:>@ don't transform installed manpage names])], - [case ${enableval} in - yes) mingw_manpage_transform='s,^,mingw-,' ;; - no) mingw_manpage_transform='s,x,x,' ;; - *) mingw_manpage_transform=${enableval} ;; - esac]) - AC_SUBST([mingw_manpage_transform],[${mingw_manpage_transform-'s,x,x,'}])dnl -])# MINGW_AC_MANPAGE_TRANSFORM - -# $RCSfile$: end of file: vim: ft=config diff --git a/winsup/mingw/binmode.c b/winsup/mingw/binmode.c deleted file mode 100644 index 1cc3dedbf..000000000 --- a/winsup/mingw/binmode.c +++ /dev/null @@ -1,5 +0,0 @@ -#include <fcntl.h> - -/* Set default file mode to binary */ - -int _fmode = _O_BINARY; diff --git a/winsup/mingw/config.guess b/winsup/mingw/config.guess deleted file mode 100755 index 0e30d56e9..000000000 --- a/winsup/mingw/config.guess +++ /dev/null @@ -1,1407 +0,0 @@ -#! /bin/sh -# Attempt to guess a canonical system name. -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003 Free Software Foundation, Inc. - -timestamp='2003-07-02' - -# This file is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -# Originally written by Per Bothner <per@bothner.com>. -# Please send patches to <config-patches@gnu.org>. Submit a context -# diff and a properly formatted ChangeLog entry. -# -# This script attempts to guess a canonical system name similar to -# config.sub. If it succeeds, it prints the system name on stdout, and -# exits with 0. Otherwise, it exits with 1. -# -# The plan is that this can be called by configure scripts if you -# don't specify an explicit build system type. - -me=`echo "$0" | sed -e 's,.*/,,'` - -usage="\ -Usage: $0 [OPTION] - -Output the configuration name of the system \`$me' is run on. - -Operation modes: - -h, --help print this help, then exit - -t, --time-stamp print date of last modification, then exit - -v, --version print version number, then exit - -Report bugs and patches to <config-patches@gnu.org>." - -version="\ -GNU config.guess ($timestamp) - -Originally written by Per Bothner. -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 -Free Software Foundation, Inc. - -This is free software; see the source for copying conditions. There is NO -warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." - -help=" -Try \`$me --help' for more information." - -# Parse command line -while test $# -gt 0 ; do - case $1 in - --time-stamp | --time* | -t ) - echo "$timestamp" ; exit 0 ;; - --version | -v ) - echo "$version" ; exit 0 ;; - --help | --h* | -h ) - echo "$usage"; exit 0 ;; - -- ) # Stop option processing - shift; break ;; - - ) # Use stdin as input. - break ;; - -* ) - echo "$me: invalid option $1$help" >&2 - exit 1 ;; - * ) - break ;; - esac -done - -if test $# != 0; then - echo "$me: too many arguments$help" >&2 - exit 1 -fi - -trap 'exit 1' 1 2 15 - -# CC_FOR_BUILD -- compiler used by this script. Note that the use of a -# compiler to aid in system detection is discouraged as it requires -# temporary files to be created and, as you can see below, it is a -# headache to deal with in a portable fashion. - -# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still -# use `HOST_CC' if defined, but it is deprecated. - -# Portable tmp directory creation inspired by the Autoconf team. - -set_cc_for_build=' -trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; -trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; -: ${TMPDIR=/tmp} ; - { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || - { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || - { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || - { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; -dummy=$tmp/dummy ; -tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; -case $CC_FOR_BUILD,$HOST_CC,$CC in - ,,) echo "int x;" > $dummy.c ; - for c in cc gcc c89 c99 ; do - if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then - CC_FOR_BUILD="$c"; break ; - fi ; - done ; - if test x"$CC_FOR_BUILD" = x ; then - CC_FOR_BUILD=no_compiler_found ; - fi - ;; - ,,*) CC_FOR_BUILD=$CC ;; - ,*,*) CC_FOR_BUILD=$HOST_CC ;; -esac ;' - -# This is needed to find uname on a Pyramid OSx when run in the BSD universe. -# (ghazi@noc.rutgers.edu 1994-08-24) -if (test -f /.attbin/uname) >/dev/null 2>&1 ; then - PATH=$PATH:/.attbin ; export PATH -fi - -UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown -UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown -UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown -UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown - -# Note: order is significant - the case branches are not exclusive. - -case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in - *:NetBSD:*:*) - # NetBSD (nbsd) targets should (where applicable) match one or - # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, - # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently - # switched to ELF, *-*-netbsd* would select the old - # object file format. This provides both forward - # compatibility and a consistent mechanism for selecting the - # object file format. - # - # Note: NetBSD doesn't particularly care about the vendor - # portion of the name. We always set it to "unknown". - sysctl="sysctl -n hw.machine_arch" - UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ - /usr/sbin/$sysctl 2>/dev/null || echo unknown)` - case "${UNAME_MACHINE_ARCH}" in - armeb) machine=armeb-unknown ;; - arm*) machine=arm-unknown ;; - sh3el) machine=shl-unknown ;; - sh3eb) machine=sh-unknown ;; - *) machine=${UNAME_MACHINE_ARCH}-unknown ;; - esac - # The Operating System including object format, if it has switched - # to ELF recently, or will in the future. - case "${UNAME_MACHINE_ARCH}" in - arm*|i386|m68k|ns32k|sh3*|sparc|vax) - eval $set_cc_for_build - if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ - | grep __ELF__ >/dev/null - then - # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). - # Return netbsd for either. FIX? - os=netbsd - else - os=netbsdelf - fi - ;; - *) - os=netbsd - ;; - esac - # The OS release - # Debian GNU/NetBSD machines have a different userland, and - # thus, need a distinct triplet. However, they do not need - # kernel version information, so it can be replaced with a - # suitable tag, in the style of linux-gnu. - case "${UNAME_VERSION}" in - Debian*) - release='-gnu' - ;; - *) - release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` - ;; - esac - # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: - # contains redundant information, the shorter form: - # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. - echo "${machine}-${os}${release}" - exit 0 ;; - amiga:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - arc:OpenBSD:*:*) - echo mipsel-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - hp300:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - mac68k:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - macppc:OpenBSD:*:*) - echo powerpc-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - mvme68k:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - mvme88k:OpenBSD:*:*) - echo m88k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - mvmeppc:OpenBSD:*:*) - echo powerpc-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - pmax:OpenBSD:*:*) - echo mipsel-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - sgi:OpenBSD:*:*) - echo mipseb-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - sun3:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - wgrisc:OpenBSD:*:*) - echo mipsel-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - *:OpenBSD:*:*) - echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - alpha:OSF1:*:*) - if test $UNAME_RELEASE = "V4.0"; then - UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` - fi - # According to Compaq, /usr/sbin/psrinfo has been available on - # OSF/1 and Tru64 systems produced since 1995. I hope that - # covers most systems running today. This code pipes the CPU - # types through head -n 1, so we only detect the type of CPU 0. - ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` - case "$ALPHA_CPU_TYPE" in - "EV4 (21064)") - UNAME_MACHINE="alpha" ;; - "EV4.5 (21064)") - UNAME_MACHINE="alpha" ;; - "LCA4 (21066/21068)") - UNAME_MACHINE="alpha" ;; - "EV5 (21164)") - UNAME_MACHINE="alphaev5" ;; - "EV5.6 (21164A)") - UNAME_MACHINE="alphaev56" ;; - "EV5.6 (21164PC)") - UNAME_MACHINE="alphapca56" ;; - "EV5.7 (21164PC)") - UNAME_MACHINE="alphapca57" ;; - "EV6 (21264)") - UNAME_MACHINE="alphaev6" ;; - "EV6.7 (21264A)") - UNAME_MACHINE="alphaev67" ;; - "EV6.8CB (21264C)") - UNAME_MACHINE="alphaev68" ;; - "EV6.8AL (21264B)") - UNAME_MACHINE="alphaev68" ;; - "EV6.8CX (21264D)") - UNAME_MACHINE="alphaev68" ;; - "EV6.9A (21264/EV69A)") - UNAME_MACHINE="alphaev69" ;; - "EV7 (21364)") - UNAME_MACHINE="alphaev7" ;; - "EV7.9 (21364A)") - UNAME_MACHINE="alphaev79" ;; - esac - # A Vn.n version is a released version. - # A Tn.n version is a released field test version. - # A Xn.n version is an unreleased experimental baselevel. - # 1.2 uses "1.2" for uname -r. - echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - exit 0 ;; - Alpha*:OpenVMS:*:*) - echo alpha-hp-vms - exit 0 ;; - Alpha\ *:Windows_NT*:*) - # How do we know it's Interix rather than the generic POSIX subsystem? - # Should we change UNAME_MACHINE based on the output of uname instead - # of the specific Alpha model? - echo alpha-pc-interix - exit 0 ;; - 21064:Windows_NT:50:3) - echo alpha-dec-winnt3.5 - exit 0 ;; - Amiga*:UNIX_System_V:4.0:*) - echo m68k-unknown-sysv4 - exit 0;; - *:[Aa]miga[Oo][Ss]:*:*) - echo ${UNAME_MACHINE}-unknown-amigaos - exit 0 ;; - *:[Mm]orph[Oo][Ss]:*:*) - echo ${UNAME_MACHINE}-unknown-morphos - exit 0 ;; - *:OS/390:*:*) - echo i370-ibm-openedition - exit 0 ;; - arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) - echo arm-acorn-riscix${UNAME_RELEASE} - exit 0;; - SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) - echo hppa1.1-hitachi-hiuxmpp - exit 0;; - Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) - # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. - if test "`(/bin/universe) 2>/dev/null`" = att ; then - echo pyramid-pyramid-sysv3 - else - echo pyramid-pyramid-bsd - fi - exit 0 ;; - NILE*:*:*:dcosx) - echo pyramid-pyramid-svr4 - exit 0 ;; - DRS?6000:unix:4.0:6*) - echo sparc-icl-nx6 - exit 0 ;; - DRS?6000:UNIX_SV:4.2*:7*) - case `/usr/bin/uname -p` in - sparc) echo sparc-icl-nx7 && exit 0 ;; - esac ;; - sun4H:SunOS:5.*:*) - echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit 0 ;; - sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) - echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit 0 ;; - i86pc:SunOS:5.*:*) - echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit 0 ;; - sun4*:SunOS:6*:*) - # According to config.sub, this is the proper way to canonicalize - # SunOS6. Hard to guess exactly what SunOS6 will be like, but - # it's likely to be more like Solaris than SunOS4. - echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit 0 ;; - sun4*:SunOS:*:*) - case "`/usr/bin/arch -k`" in - Series*|S4*) - UNAME_RELEASE=`uname -v` - ;; - esac - # Japanese Language versions have a version number like `4.1.3-JL'. - echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` - exit 0 ;; - sun3*:SunOS:*:*) - echo m68k-sun-sunos${UNAME_RELEASE} - exit 0 ;; - sun*:*:4.2BSD:*) - UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` - test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 - case "`/bin/arch`" in - sun3) - echo m68k-sun-sunos${UNAME_RELEASE} - ;; - sun4) - echo sparc-sun-sunos${UNAME_RELEASE} - ;; - esac - exit 0 ;; - aushp:SunOS:*:*) - echo sparc-auspex-sunos${UNAME_RELEASE} - exit 0 ;; - # The situation for MiNT is a little confusing. The machine name - # can be virtually everything (everything which is not - # "atarist" or "atariste" at least should have a processor - # > m68000). The system name ranges from "MiNT" over "FreeMiNT" - # to the lowercase version "mint" (or "freemint"). Finally - # the system name "TOS" denotes a system which is actually not - # MiNT. But MiNT is downward compatible to TOS, so this should - # be no problem. - atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} - exit 0 ;; - atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} - exit 0 ;; - *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} - exit 0 ;; - milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) - echo m68k-milan-mint${UNAME_RELEASE} - exit 0 ;; - hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) - echo m68k-hades-mint${UNAME_RELEASE} - exit 0 ;; - *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) - echo m68k-unknown-mint${UNAME_RELEASE} - exit 0 ;; - powerpc:machten:*:*) - echo powerpc-apple-machten${UNAME_RELEASE} - exit 0 ;; - RISC*:Mach:*:*) - echo mips-dec-mach_bsd4.3 - exit 0 ;; - RISC*:ULTRIX:*:*) - echo mips-dec-ultrix${UNAME_RELEASE} - exit 0 ;; - VAX*:ULTRIX*:*:*) - echo vax-dec-ultrix${UNAME_RELEASE} - exit 0 ;; - 2020:CLIX:*:* | 2430:CLIX:*:*) - echo clipper-intergraph-clix${UNAME_RELEASE} - exit 0 ;; - mips:*:*:UMIPS | mips:*:*:RISCos) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c -#ifdef __cplusplus -#include <stdio.h> /* for printf() prototype */ - int main (int argc, char *argv[]) { -#else - int main (argc, argv) int argc; char *argv[]; { -#endif - #if defined (host_mips) && defined (MIPSEB) - #if defined (SYSTYPE_SYSV) - printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); - #endif - #if defined (SYSTYPE_SVR4) - printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); - #endif - #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) - printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); - #endif - #endif - exit (-1); - } -EOF - $CC_FOR_BUILD -o $dummy $dummy.c \ - && $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \ - && exit 0 - echo mips-mips-riscos${UNAME_RELEASE} - exit 0 ;; - Motorola:PowerMAX_OS:*:*) - echo powerpc-motorola-powermax - exit 0 ;; - Motorola:*:4.3:PL8-*) - echo powerpc-harris-powermax - exit 0 ;; - Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) - echo powerpc-harris-powermax - exit 0 ;; - Night_Hawk:Power_UNIX:*:*) - echo powerpc-harris-powerunix - exit 0 ;; - m88k:CX/UX:7*:*) - echo m88k-harris-cxux7 - exit 0 ;; - m88k:*:4*:R4*) - echo m88k-motorola-sysv4 - exit 0 ;; - m88k:*:3*:R3*) - echo m88k-motorola-sysv3 - exit 0 ;; - AViiON:dgux:*:*) - # DG/UX returns AViiON for all architectures - UNAME_PROCESSOR=`/usr/bin/uname -p` - if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] - then - if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ - [ ${TARGET_BINARY_INTERFACE}x = x ] - then - echo m88k-dg-dgux${UNAME_RELEASE} - else - echo m88k-dg-dguxbcs${UNAME_RELEASE} - fi - else - echo i586-dg-dgux${UNAME_RELEASE} - fi - exit 0 ;; - M88*:DolphinOS:*:*) # DolphinOS (SVR3) - echo m88k-dolphin-sysv3 - exit 0 ;; - M88*:*:R3*:*) - # Delta 88k system running SVR3 - echo m88k-motorola-sysv3 - exit 0 ;; - XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) - echo m88k-tektronix-sysv3 - exit 0 ;; - Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) - echo m68k-tektronix-bsd - exit 0 ;; - *:IRIX*:*:*) - echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` - exit 0 ;; - ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. - echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id - exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX ' - i*86:AIX:*:*) - echo i386-ibm-aix - exit 0 ;; - ia64:AIX:*:*) - if [ -x /usr/bin/oslevel ] ; then - IBM_REV=`/usr/bin/oslevel` - else - IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} - fi - echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} - exit 0 ;; - *:AIX:2:3) - if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #include <sys/systemcfg.h> - - main() - { - if (!__power_pc()) - exit(1); - puts("powerpc-ibm-aix3.2.5"); - exit(0); - } -EOF - $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0 - echo rs6000-ibm-aix3.2.5 - elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then - echo rs6000-ibm-aix3.2.4 - else - echo rs6000-ibm-aix3.2 - fi - exit 0 ;; - *:AIX:*:[45]) - IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` - if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then - IBM_ARCH=rs6000 - else - IBM_ARCH=powerpc - fi - if [ -x /usr/bin/oslevel ] ; then - IBM_REV=`/usr/bin/oslevel` - else - IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} - fi - echo ${IBM_ARCH}-ibm-aix${IBM_REV} - exit 0 ;; - *:AIX:*:*) - echo rs6000-ibm-aix - exit 0 ;; - ibmrt:4.4BSD:*|romp-ibm:BSD:*) - echo romp-ibm-bsd4.4 - exit 0 ;; - ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and - echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to - exit 0 ;; # report: romp-ibm BSD 4.3 - *:BOSX:*:*) - echo rs6000-bull-bosx - exit 0 ;; - DPX/2?00:B.O.S.:*:*) - echo m68k-bull-sysv3 - exit 0 ;; - 9000/[34]??:4.3bsd:1.*:*) - echo m68k-hp-bsd - exit 0 ;; - hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) - echo m68k-hp-bsd4.4 - exit 0 ;; - 9000/[34678]??:HP-UX:*:*) - HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` - case "${UNAME_MACHINE}" in - 9000/31? ) HP_ARCH=m68000 ;; - 9000/[34]?? ) HP_ARCH=m68k ;; - 9000/[678][0-9][0-9]) - if [ -x /usr/bin/getconf ]; then - sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` - sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` - case "${sc_cpu_version}" in - 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 - 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 - 532) # CPU_PA_RISC2_0 - case "${sc_kernel_bits}" in - 32) HP_ARCH="hppa2.0n" ;; - 64) HP_ARCH="hppa2.0w" ;; - '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 - esac ;; - esac - fi - if [ "${HP_ARCH}" = "" ]; then - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - - #define _HPUX_SOURCE - #include <stdlib.h> - #include <unistd.h> - - int main () - { - #if defined(_SC_KERNEL_BITS) - long bits = sysconf(_SC_KERNEL_BITS); - #endif - long cpu = sysconf (_SC_CPU_VERSION); - - switch (cpu) - { - case CPU_PA_RISC1_0: puts ("hppa1.0"); break; - case CPU_PA_RISC1_1: puts ("hppa1.1"); break; - case CPU_PA_RISC2_0: - #if defined(_SC_KERNEL_BITS) - switch (bits) - { - case 64: puts ("hppa2.0w"); break; - case 32: puts ("hppa2.0n"); break; - default: puts ("hppa2.0"); break; - } break; - #else /* !defined(_SC_KERNEL_BITS) */ - puts ("hppa2.0"); break; - #endif - default: puts ("hppa1.0"); break; - } - exit (0); - } -EOF - (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` - test -z "$HP_ARCH" && HP_ARCH=hppa - fi ;; - esac - if [ ${HP_ARCH} = "hppa2.0w" ] - then - # avoid double evaluation of $set_cc_for_build - test -n "$CC_FOR_BUILD" || eval $set_cc_for_build - if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E -) | grep __LP64__ >/dev/null - then - HP_ARCH="hppa2.0w" - else - HP_ARCH="hppa64" - fi - fi - echo ${HP_ARCH}-hp-hpux${HPUX_REV} - exit 0 ;; - ia64:HP-UX:*:*) - HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` - echo ia64-hp-hpux${HPUX_REV} - exit 0 ;; - 3050*:HI-UX:*:*) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #include <unistd.h> - int - main () - { - long cpu = sysconf (_SC_CPU_VERSION); - /* The order matters, because CPU_IS_HP_MC68K erroneously returns - true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct - results, however. */ - if (CPU_IS_PA_RISC (cpu)) - { - switch (cpu) - { - case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; - case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; - case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; - default: puts ("hppa-hitachi-hiuxwe2"); break; - } - } - else if (CPU_IS_HP_MC68K (cpu)) - puts ("m68k-hitachi-hiuxwe2"); - else puts ("unknown-hitachi-hiuxwe2"); - exit (0); - } -EOF - $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0 - echo unknown-hitachi-hiuxwe2 - exit 0 ;; - 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) - echo hppa1.1-hp-bsd - exit 0 ;; - 9000/8??:4.3bsd:*:*) - echo hppa1.0-hp-bsd - exit 0 ;; - *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) - echo hppa1.0-hp-mpeix - exit 0 ;; - hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) - echo hppa1.1-hp-osf - exit 0 ;; - hp8??:OSF1:*:*) - echo hppa1.0-hp-osf - exit 0 ;; - i*86:OSF1:*:*) - if [ -x /usr/sbin/sysversion ] ; then - echo ${UNAME_MACHINE}-unknown-osf1mk - else - echo ${UNAME_MACHINE}-unknown-osf1 - fi - exit 0 ;; - parisc*:Lites*:*:*) - echo hppa1.1-hp-lites - exit 0 ;; - C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) - echo c1-convex-bsd - exit 0 ;; - C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) - if getsysinfo -f scalar_acc - then echo c32-convex-bsd - else echo c2-convex-bsd - fi - exit 0 ;; - C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) - echo c34-convex-bsd - exit 0 ;; - C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) - echo c38-convex-bsd - exit 0 ;; - C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) - echo c4-convex-bsd - exit 0 ;; - CRAY*Y-MP:*:*:*) - echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit 0 ;; - CRAY*[A-Z]90:*:*:*) - echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ - | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ - -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ - -e 's/\.[^.]*$/.X/' - exit 0 ;; - CRAY*TS:*:*:*) - echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit 0 ;; - CRAY*T3E:*:*:*) - echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit 0 ;; - CRAY*SV1:*:*:*) - echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit 0 ;; - *:UNICOS/mp:*:*) - echo nv1-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit 0 ;; - F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) - FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` - FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` - echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" - exit 0 ;; - i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) - echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} - exit 0 ;; - sparc*:BSD/OS:*:*) - echo sparc-unknown-bsdi${UNAME_RELEASE} - exit 0 ;; - *:BSD/OS:*:*) - echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} - exit 0 ;; - *:FreeBSD:*:*|*:GNU/FreeBSD:*:*) - # Determine whether the default compiler uses glibc. - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #include <features.h> - #if __GLIBC__ >= 2 - LIBC=gnu - #else - LIBC= - #endif -EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` - # GNU/FreeBSD systems have a "k" prefix to indicate we are using - # FreeBSD's kernel, but not the complete OS. - case ${LIBC} in gnu) kernel_only='k' ;; esac - echo ${UNAME_MACHINE}-unknown-${kernel_only}freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`${LIBC:+-$LIBC} - exit 0 ;; - i*:CYGWIN*:*) - echo ${UNAME_MACHINE}-pc-cygwin - exit 0 ;; - i*:MINGW*:*) - echo ${UNAME_MACHINE}-pc-mingw32 - exit 0 ;; - i*:PW*:*) - echo ${UNAME_MACHINE}-pc-pw32 - exit 0 ;; - x86:Interix*:[34]*) - echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//' - exit 0 ;; - [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) - echo i${UNAME_MACHINE}-pc-mks - exit 0 ;; - i*:Windows_NT*:* | Pentium*:Windows_NT*:*) - # How do we know it's Interix rather than the generic POSIX subsystem? - # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we - # UNAME_MACHINE based on the output of uname instead of i386? - echo i586-pc-interix - exit 0 ;; - i*:UWIN*:*) - echo ${UNAME_MACHINE}-pc-uwin - exit 0 ;; - p*:CYGWIN*:*) - echo powerpcle-unknown-cygwin - exit 0 ;; - prep*:SunOS:5.*:*) - echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit 0 ;; - *:GNU:*:*) - echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` - exit 0 ;; - i*86:Minix:*:*) - echo ${UNAME_MACHINE}-pc-minix - exit 0 ;; - arm*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit 0 ;; - cris:Linux:*:*) - echo cris-axis-linux-gnu - exit 0 ;; - ia64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit 0 ;; - m68*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit 0 ;; - mips:Linux:*:*) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #undef CPU - #undef mips - #undef mipsel - #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) - CPU=mipsel - #else - #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) - CPU=mips - #else - CPU= - #endif - #endif -EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` - test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0 - ;; - mips64:Linux:*:*) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #undef CPU - #undef mips64 - #undef mips64el - #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) - CPU=mips64el - #else - #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) - CPU=mips64 - #else - CPU= - #endif - #endif -EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` - test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0 - ;; - ppc:Linux:*:*) - echo powerpc-unknown-linux-gnu - exit 0 ;; - ppc64:Linux:*:*) - echo powerpc64-unknown-linux-gnu - exit 0 ;; - alpha:Linux:*:*) - case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in - EV5) UNAME_MACHINE=alphaev5 ;; - EV56) UNAME_MACHINE=alphaev56 ;; - PCA56) UNAME_MACHINE=alphapca56 ;; - PCA57) UNAME_MACHINE=alphapca56 ;; - EV6) UNAME_MACHINE=alphaev6 ;; - EV67) UNAME_MACHINE=alphaev67 ;; - EV68*) UNAME_MACHINE=alphaev68 ;; - esac - objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null - if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi - echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} - exit 0 ;; - parisc:Linux:*:* | hppa:Linux:*:*) - # Look for CPU level - case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in - PA7*) echo hppa1.1-unknown-linux-gnu ;; - PA8*) echo hppa2.0-unknown-linux-gnu ;; - *) echo hppa-unknown-linux-gnu ;; - esac - exit 0 ;; - parisc64:Linux:*:* | hppa64:Linux:*:*) - echo hppa64-unknown-linux-gnu - exit 0 ;; - s390:Linux:*:* | s390x:Linux:*:*) - echo ${UNAME_MACHINE}-ibm-linux - exit 0 ;; - sh64*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit 0 ;; - sh*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit 0 ;; - sparc:Linux:*:* | sparc64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit 0 ;; - x86_64:Linux:*:*) - echo x86_64-unknown-linux-gnu - exit 0 ;; - i*86:Linux:*:*) - # The BFD linker knows what the default object file format is, so - # first see if it will tell us. cd to the root directory to prevent - # problems with other programs or directories called `ld' in the path. - # Set LC_ALL=C to ensure ld outputs messages in English. - ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ - | sed -ne '/supported targets:/!d - s/[ ][ ]*/ /g - s/.*supported targets: *// - s/ .*// - p'` - case "$ld_supported_targets" in - elf32-i386) - TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" - ;; - a.out-i386-linux) - echo "${UNAME_MACHINE}-pc-linux-gnuaout" - exit 0 ;; - coff-i386) - echo "${UNAME_MACHINE}-pc-linux-gnucoff" - exit 0 ;; - "") - # Either a pre-BFD a.out linker (linux-gnuoldld) or - # one that does not give us useful --help. - echo "${UNAME_MACHINE}-pc-linux-gnuoldld" - exit 0 ;; - esac - # Determine whether the default compiler is a.out or elf - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #include <features.h> - #ifdef __ELF__ - # ifdef __GLIBC__ - # if __GLIBC__ >= 2 - LIBC=gnu - # else - LIBC=gnulibc1 - # endif - # else - LIBC=gnulibc1 - # endif - #else - #ifdef __INTEL_COMPILER - LIBC=gnu - #else - LIBC=gnuaout - #endif - #endif -EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` - test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0 - test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0 - ;; - i*86:DYNIX/ptx:4*:*) - # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. - # earlier versions are messed up and put the nodename in both - # sysname and nodename. - echo i386-sequent-sysv4 - exit 0 ;; - i*86:UNIX_SV:4.2MP:2.*) - # Unixware is an offshoot of SVR4, but it has its own version - # number series starting with 2... - # I am not positive that other SVR4 systems won't match this, - # I just have to hope. -- rms. - # Use sysv4.2uw... so that sysv4* matches it. - echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} - exit 0 ;; - i*86:OS/2:*:*) - # If we were able to find `uname', then EMX Unix compatibility - # is probably installed. - echo ${UNAME_MACHINE}-pc-os2-emx - exit 0 ;; - i*86:XTS-300:*:STOP) - echo ${UNAME_MACHINE}-unknown-stop - exit 0 ;; - i*86:atheos:*:*) - echo ${UNAME_MACHINE}-unknown-atheos - exit 0 ;; - i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) - echo i386-unknown-lynxos${UNAME_RELEASE} - exit 0 ;; - i*86:*DOS:*:*) - echo ${UNAME_MACHINE}-pc-msdosdjgpp - exit 0 ;; - i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) - UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` - if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then - echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} - else - echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} - fi - exit 0 ;; - i*86:*:5:[78]*) - case `/bin/uname -X | grep "^Machine"` in - *486*) UNAME_MACHINE=i486 ;; - *Pentium) UNAME_MACHINE=i586 ;; - *Pent*|*Celeron) UNAME_MACHINE=i686 ;; - esac - echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} - exit 0 ;; - i*86:*:3.2:*) - if test -f /usr/options/cb.name; then - UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name` - echo ${UNAME_MACHINE}-pc-isc$UNAME_REL - elif /bin/uname -X 2>/dev/null >/dev/null ; then - UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` - (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 - (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ - && UNAME_MACHINE=i586 - (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ - && UNAME_MACHINE=i686 - (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ - && UNAME_MACHINE=i686 - echo ${UNAME_MACHINE}-pc-sco$UNAME_REL - else - echo ${UNAME_MACHINE}-pc-sysv32 - fi - exit 0 ;; - pc:*:*:*) - # Left here for compatibility: - # uname -m prints for DJGPP always 'pc', but it prints nothing about - # the processor, so we play safe by assuming i386. - echo i386-pc-msdosdjgpp - exit 0 ;; - Intel:Mach:3*:*) - echo i386-pc-mach3 - exit 0 ;; - paragon:*:*:*) - echo i860-intel-osf1 - exit 0 ;; - i860:*:4.*:*) # i860-SVR4 - if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then - echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 - else # Add other i860-SVR4 vendors below as they are discovered. - echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 - fi - exit 0 ;; - mini*:CTIX:SYS*5:*) - # "miniframe" - echo m68010-convergent-sysv - exit 0 ;; - mc68k:UNIX:SYSTEM5:3.51m) - echo m68k-convergent-sysv - exit 0 ;; - M680?0:D-NIX:5.3:*) - echo m68k-diab-dnix - exit 0 ;; - M68*:*:R3V[567]*:*) - test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; - 3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0) - OS_REL='' - test -r /etc/.relid \ - && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` - /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && echo i486-ncr-sysv4.3${OS_REL} && exit 0 - /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ - && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;; - 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) - /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && echo i486-ncr-sysv4 && exit 0 ;; - m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) - echo m68k-unknown-lynxos${UNAME_RELEASE} - exit 0 ;; - mc68030:UNIX_System_V:4.*:*) - echo m68k-atari-sysv4 - exit 0 ;; - TSUNAMI:LynxOS:2.*:*) - echo sparc-unknown-lynxos${UNAME_RELEASE} - exit 0 ;; - rs6000:LynxOS:2.*:*) - echo rs6000-unknown-lynxos${UNAME_RELEASE} - exit 0 ;; - PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) - echo powerpc-unknown-lynxos${UNAME_RELEASE} - exit 0 ;; - SM[BE]S:UNIX_SV:*:*) - echo mips-dde-sysv${UNAME_RELEASE} - exit 0 ;; - RM*:ReliantUNIX-*:*:*) - echo mips-sni-sysv4 - exit 0 ;; - RM*:SINIX-*:*:*) - echo mips-sni-sysv4 - exit 0 ;; - *:SINIX-*:*:*) - if uname -p 2>/dev/null >/dev/null ; then - UNAME_MACHINE=`(uname -p) 2>/dev/null` - echo ${UNAME_MACHINE}-sni-sysv4 - else - echo ns32k-sni-sysv - fi - exit 0 ;; - PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort - # says <Richard.M.Bartel@ccMail.Census.GOV> - echo i586-unisys-sysv4 - exit 0 ;; - *:UNIX_System_V:4*:FTX*) - # From Gerald Hewes <hewes@openmarket.com>. - # How about differentiating between stratus architectures? -djm - echo hppa1.1-stratus-sysv4 - exit 0 ;; - *:*:*:FTX*) - # From seanf@swdc.stratus.com. - echo i860-stratus-sysv4 - exit 0 ;; - *:VOS:*:*) - # From Paul.Green@stratus.com. - echo hppa1.1-stratus-vos - exit 0 ;; - mc68*:A/UX:*:*) - echo m68k-apple-aux${UNAME_RELEASE} - exit 0 ;; - news*:NEWS-OS:6*:*) - echo mips-sony-newsos6 - exit 0 ;; - R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) - if [ -d /usr/nec ]; then - echo mips-nec-sysv${UNAME_RELEASE} - else - echo mips-unknown-sysv${UNAME_RELEASE} - fi - exit 0 ;; - BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. - echo powerpc-be-beos - exit 0 ;; - BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. - echo powerpc-apple-beos - exit 0 ;; - BePC:BeOS:*:*) # BeOS running on Intel PC compatible. - echo i586-pc-beos - exit 0 ;; - SX-4:SUPER-UX:*:*) - echo sx4-nec-superux${UNAME_RELEASE} - exit 0 ;; - SX-5:SUPER-UX:*:*) - echo sx5-nec-superux${UNAME_RELEASE} - exit 0 ;; - SX-6:SUPER-UX:*:*) - echo sx6-nec-superux${UNAME_RELEASE} - exit 0 ;; - Power*:Rhapsody:*:*) - echo powerpc-apple-rhapsody${UNAME_RELEASE} - exit 0 ;; - *:Rhapsody:*:*) - echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} - exit 0 ;; - *:Darwin:*:*) - case `uname -p` in - *86) UNAME_PROCESSOR=i686 ;; - powerpc) UNAME_PROCESSOR=powerpc ;; - esac - echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} - exit 0 ;; - *:procnto*:*:* | *:QNX:[0123456789]*:*) - UNAME_PROCESSOR=`uname -p` - if test "$UNAME_PROCESSOR" = "x86"; then - UNAME_PROCESSOR=i386 - UNAME_MACHINE=pc - fi - echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} - exit 0 ;; - *:QNX:*:4*) - echo i386-pc-qnx - exit 0 ;; - NSR-[DGKLNPTVW]:NONSTOP_KERNEL:*:*) - echo nsr-tandem-nsk${UNAME_RELEASE} - exit 0 ;; - *:NonStop-UX:*:*) - echo mips-compaq-nonstopux - exit 0 ;; - BS2000:POSIX*:*:*) - echo bs2000-siemens-sysv - exit 0 ;; - DS/*:UNIX_System_V:*:*) - echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} - exit 0 ;; - *:Plan9:*:*) - # "uname -m" is not consistent, so use $cputype instead. 386 - # is converted to i386 for consistency with other x86 - # operating systems. - if test "$cputype" = "386"; then - UNAME_MACHINE=i386 - else - UNAME_MACHINE="$cputype" - fi - echo ${UNAME_MACHINE}-unknown-plan9 - exit 0 ;; - *:TOPS-10:*:*) - echo pdp10-unknown-tops10 - exit 0 ;; - *:TENEX:*:*) - echo pdp10-unknown-tenex - exit 0 ;; - KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) - echo pdp10-dec-tops20 - exit 0 ;; - XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) - echo pdp10-xkl-tops20 - exit 0 ;; - *:TOPS-20:*:*) - echo pdp10-unknown-tops20 - exit 0 ;; - *:ITS:*:*) - echo pdp10-unknown-its - exit 0 ;; - SEI:*:*:SEIUX) - echo mips-sei-seiux${UNAME_RELEASE} - exit 0 ;; -esac - -#echo '(No uname command or uname output not recognized.)' 1>&2 -#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 - -eval $set_cc_for_build -cat >$dummy.c <<EOF -#ifdef _SEQUENT_ -# include <sys/types.h> -# include <sys/utsname.h> -#endif -main () -{ -#if defined (sony) -#if defined (MIPSEB) - /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, - I don't know.... */ - printf ("mips-sony-bsd\n"); exit (0); -#else -#include <sys/param.h> - printf ("m68k-sony-newsos%s\n", -#ifdef NEWSOS4 - "4" -#else - "" -#endif - ); exit (0); -#endif -#endif - -#if defined (__arm) && defined (__acorn) && defined (__unix) - printf ("arm-acorn-riscix"); exit (0); -#endif - -#if defined (hp300) && !defined (hpux) - printf ("m68k-hp-bsd\n"); exit (0); -#endif - -#if defined (NeXT) -#if !defined (__ARCHITECTURE__) -#define __ARCHITECTURE__ "m68k" -#endif - int version; - version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; - if (version < 4) - printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); - else - printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); - exit (0); -#endif - -#if defined (MULTIMAX) || defined (n16) -#if defined (UMAXV) - printf ("ns32k-encore-sysv\n"); exit (0); -#else -#if defined (CMU) - printf ("ns32k-encore-mach\n"); exit (0); -#else - printf ("ns32k-encore-bsd\n"); exit (0); -#endif -#endif -#endif - -#if defined (__386BSD__) - printf ("i386-pc-bsd\n"); exit (0); -#endif - -#if defined (sequent) -#if defined (i386) - printf ("i386-sequent-dynix\n"); exit (0); -#endif -#if defined (ns32000) - printf ("ns32k-sequent-dynix\n"); exit (0); -#endif -#endif - -#if defined (_SEQUENT_) - struct utsname un; - - uname(&un); - - if (strncmp(un.version, "V2", 2) == 0) { - printf ("i386-sequent-ptx2\n"); exit (0); - } - if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ - printf ("i386-sequent-ptx1\n"); exit (0); - } - printf ("i386-sequent-ptx\n"); exit (0); - -#endif - -#if defined (vax) -# if !defined (ultrix) -# include <sys/param.h> -# if defined (BSD) -# if BSD == 43 - printf ("vax-dec-bsd4.3\n"); exit (0); -# else -# if BSD == 199006 - printf ("vax-dec-bsd4.3reno\n"); exit (0); -# else - printf ("vax-dec-bsd\n"); exit (0); -# endif -# endif -# else - printf ("vax-dec-bsd\n"); exit (0); -# endif -# else - printf ("vax-dec-ultrix\n"); exit (0); -# endif -#endif - -#if defined (alliant) && defined (i860) - printf ("i860-alliant-bsd\n"); exit (0); -#endif - - exit (1); -} -EOF - -$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && $dummy && exit 0 - -# Apollos put the system type in the environment. - -test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; } - -# Convex versions that predate uname can use getsysinfo(1) - -if [ -x /usr/convex/getsysinfo ] -then - case `getsysinfo -f cpu_type` in - c1*) - echo c1-convex-bsd - exit 0 ;; - c2*) - if getsysinfo -f scalar_acc - then echo c32-convex-bsd - else echo c2-convex-bsd - fi - exit 0 ;; - c34*) - echo c34-convex-bsd - exit 0 ;; - c38*) - echo c38-convex-bsd - exit 0 ;; - c4*) - echo c4-convex-bsd - exit 0 ;; - esac -fi - -cat >&2 <<EOF -$0: unable to guess system type - -This script, last modified $timestamp, has failed to recognize -the operating system you are using. It is advised that you -download the most up to date version of the config scripts from - - ftp://ftp.gnu.org/pub/gnu/config/ - -If the version you run ($0) is already up to date, please -send the following data and any information you think might be -pertinent to <config-patches@gnu.org> in order to provide the needed -information to handle your system. - -config.guess timestamp = $timestamp - -uname -m = `(uname -m) 2>/dev/null || echo unknown` -uname -r = `(uname -r) 2>/dev/null || echo unknown` -uname -s = `(uname -s) 2>/dev/null || echo unknown` -uname -v = `(uname -v) 2>/dev/null || echo unknown` - -/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` -/bin/uname -X = `(/bin/uname -X) 2>/dev/null` - -hostinfo = `(hostinfo) 2>/dev/null` -/bin/universe = `(/bin/universe) 2>/dev/null` -/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` -/bin/arch = `(/bin/arch) 2>/dev/null` -/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` -/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` - -UNAME_MACHINE = ${UNAME_MACHINE} -UNAME_RELEASE = ${UNAME_RELEASE} -UNAME_SYSTEM = ${UNAME_SYSTEM} -UNAME_VERSION = ${UNAME_VERSION} -EOF - -exit 1 - -# Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "timestamp='" -# time-stamp-format: "%:y-%02m-%02d" -# time-stamp-end: "'" -# End: diff --git a/winsup/mingw/config.sub b/winsup/mingw/config.sub deleted file mode 100755 index 0bdc33431..000000000 --- a/winsup/mingw/config.sub +++ /dev/null @@ -1,1504 +0,0 @@ -#! /bin/sh -# Configuration validation subroutine script. -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003 Free Software Foundation, Inc. - -timestamp='2003-06-17' - -# This file is (in principle) common to ALL GNU software. -# The presence of a machine in this file suggests that SOME GNU software -# can handle that machine. It does not imply ALL GNU software can. -# -# This file is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, -# Boston, MA 02111-1307, USA. - -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -# Please send patches to <config-patches@gnu.org>. Submit a context -# diff and a properly formatted ChangeLog entry. -# -# Configuration subroutine to validate and canonicalize a configuration type. -# Supply the specified configuration type as an argument. -# If it is invalid, we print an error message on stderr and exit with code 1. -# Otherwise, we print the canonical config type on stdout and succeed. - -# This file is supposed to be the same for all GNU packages -# and recognize all the CPU types, system types and aliases -# that are meaningful with *any* GNU software. -# Each package is responsible for reporting which valid configurations -# it does not support. The user should be able to distinguish -# a failure to support a valid configuration from a meaningless -# configuration. - -# The goal of this file is to map all the various variations of a given -# machine specification into a single specification in the form: -# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM -# or in some cases, the newer four-part form: -# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM -# It is wrong to echo any other type of specification. - -me=`echo "$0" | sed -e 's,.*/,,'` - -usage="\ -Usage: $0 [OPTION] CPU-MFR-OPSYS - $0 [OPTION] ALIAS - -Canonicalize a configuration name. - -Operation modes: - -h, --help print this help, then exit - -t, --time-stamp print date of last modification, then exit - -v, --version print version number, then exit - -Report bugs and patches to <config-patches@gnu.org>." - -version="\ -GNU config.sub ($timestamp) - -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 -Free Software Foundation, Inc. - -This is free software; see the source for copying conditions. There is NO -warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." - -help=" -Try \`$me --help' for more information." - -# Parse command line -while test $# -gt 0 ; do - case $1 in - --time-stamp | --time* | -t ) - echo "$timestamp" ; exit 0 ;; - --version | -v ) - echo "$version" ; exit 0 ;; - --help | --h* | -h ) - echo "$usage"; exit 0 ;; - -- ) # Stop option processing - shift; break ;; - - ) # Use stdin as input. - break ;; - -* ) - echo "$me: invalid option $1$help" - exit 1 ;; - - *local*) - # First pass through any local machine types. - echo $1 - exit 0;; - - * ) - break ;; - esac -done - -case $# in - 0) echo "$me: missing argument$help" >&2 - exit 1;; - 1) ;; - *) echo "$me: too many arguments$help" >&2 - exit 1;; -esac - -# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). -# Here we must recognize all the valid KERNEL-OS combinations. -maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` -case $maybe_os in - nto-qnx* | linux-gnu* | freebsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*) - os=-$maybe_os - basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` - ;; - *) - basic_machine=`echo $1 | sed 's/-[^-]*$//'` - if [ $basic_machine != $1 ] - then os=`echo $1 | sed 's/.*-/-/'` - else os=; fi - ;; -esac - -### Let's recognize common machines as not being operating systems so -### that things like config.sub decstation-3100 work. We also -### recognize some manufacturers as not being operating systems, so we -### can provide default operating systems below. -case $os in - -sun*os*) - # Prevent following clause from handling this invalid input. - ;; - -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ - -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ - -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ - -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ - -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ - -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ - -apple | -axis) - os= - basic_machine=$1 - ;; - -sim | -cisco | -oki | -wec | -winbond) - os= - basic_machine=$1 - ;; - -scout) - ;; - -wrs) - os=-vxworks - basic_machine=$1 - ;; - -chorusos*) - os=-chorusos - basic_machine=$1 - ;; - -chorusrdb) - os=-chorusrdb - basic_machine=$1 - ;; - -hiux*) - os=-hiuxwe2 - ;; - -sco5) - os=-sco3.2v5 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco4) - os=-sco3.2v4 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco3.2.[4-9]*) - os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco3.2v[4-9]*) - # Don't forget version if it is 3.2v4 or newer. - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco*) - os=-sco3.2v2 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -udk*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -isc) - os=-isc2.2 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -clix*) - basic_machine=clipper-intergraph - ;; - -isc*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -lynx*) - os=-lynxos - ;; - -ptx*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` - ;; - -windowsnt*) - os=`echo $os | sed -e 's/windowsnt/winnt/'` - ;; - -psos*) - os=-psos - ;; - -mint | -mint[0-9]*) - basic_machine=m68k-atari - os=-mint - ;; -esac - -# Decode aliases for certain CPU-COMPANY combinations. -case $basic_machine in - # Recognize the basic CPU types without company name. - # Some are omitted here because they have special meanings below. - 1750a | 580 \ - | a29k \ - | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ - | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ - | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \ - | c4x | clipper \ - | d10v | d30v | dlx | dsp16xx \ - | fr30 | frv \ - | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ - | i370 | i860 | i960 | ia64 \ - | ip2k \ - | m32r | m68000 | m68k | m88k | mcore \ - | mips | mipsbe | mipseb | mipsel | mipsle \ - | mips16 \ - | mips64 | mips64el \ - | mips64vr | mips64vrel \ - | mips64orion | mips64orionel \ - | mips64vr4100 | mips64vr4100el \ - | mips64vr4300 | mips64vr4300el \ - | mips64vr5000 | mips64vr5000el \ - | mipsisa32 | mipsisa32el \ - | mipsisa32r2 | mipsisa32r2el \ - | mipsisa64 | mipsisa64el \ - | mipsisa64sb1 | mipsisa64sb1el \ - | mipsisa64sr71k | mipsisa64sr71kel \ - | mipstx39 | mipstx39el \ - | mn10200 | mn10300 \ - | msp430 \ - | ns16k | ns32k \ - | openrisc | or32 \ - | pdp10 | pdp11 | pj | pjl \ - | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ - | pyramid \ - | sh | sh[1234] | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \ - | sh64 | sh64le \ - | sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv9 | sparcv9b \ - | strongarm \ - | tahoe | thumb | tic4x | tic80 | tron \ - | v850 | v850e \ - | we32k \ - | x86 | xscale | xstormy16 | xtensa \ - | z8k) - basic_machine=$basic_machine-unknown - ;; - m6811 | m68hc11 | m6812 | m68hc12) - # Motorola 68HC11/12. - basic_machine=$basic_machine-unknown - os=-none - ;; - m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) - ;; - - # We use `pc' rather than `unknown' - # because (1) that's what they normally are, and - # (2) the word "unknown" tends to confuse beginning users. - i*86 | x86_64) - basic_machine=$basic_machine-pc - ;; - # Object if more than one company name word. - *-*-*) - echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 - exit 1 - ;; - # Recognize the basic CPU types with company name. - 580-* \ - | a29k-* \ - | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ - | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ - | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ - | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ - | avr-* \ - | bs2000-* \ - | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ - | clipper-* | cydra-* \ - | d10v-* | d30v-* | dlx-* \ - | elxsi-* \ - | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \ - | h8300-* | h8500-* \ - | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ - | i*86-* | i860-* | i960-* | ia64-* \ - | ip2k-* \ - | m32r-* \ - | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ - | m88110-* | m88k-* | mcore-* \ - | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ - | mips16-* \ - | mips64-* | mips64el-* \ - | mips64vr-* | mips64vrel-* \ - | mips64orion-* | mips64orionel-* \ - | mips64vr4100-* | mips64vr4100el-* \ - | mips64vr4300-* | mips64vr4300el-* \ - | mips64vr5000-* | mips64vr5000el-* \ - | mipsisa32-* | mipsisa32el-* \ - | mipsisa32r2-* | mipsisa32r2el-* \ - | mipsisa64-* | mipsisa64el-* \ - | mipsisa64sb1-* | mipsisa64sb1el-* \ - | mipsisa64sr71k-* | mipsisa64sr71kel-* \ - | mipstx39-* | mipstx39el-* \ - | msp430-* \ - | none-* | np1-* | nv1-* | ns16k-* | ns32k-* \ - | orion-* \ - | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ - | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ - | pyramid-* \ - | romp-* | rs6000-* \ - | sh-* | sh[1234]-* | sh[23]e-* | sh[34]eb-* | shbe-* \ - | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ - | sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \ - | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \ - | tahoe-* | thumb-* \ - | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ - | tron-* \ - | v850-* | v850e-* | vax-* \ - | we32k-* \ - | x86-* | x86_64-* | xps100-* | xscale-* | xstormy16-* \ - | xtensa-* \ - | ymp-* \ - | z8k-*) - ;; - # Recognize the various machine names and aliases which stand - # for a CPU type and a company and sometimes even an OS. - 386bsd) - basic_machine=i386-unknown - os=-bsd - ;; - 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) - basic_machine=m68000-att - ;; - 3b*) - basic_machine=we32k-att - ;; - a29khif) - basic_machine=a29k-amd - os=-udi - ;; - adobe68k) - basic_machine=m68010-adobe - os=-scout - ;; - alliant | fx80) - basic_machine=fx80-alliant - ;; - altos | altos3068) - basic_machine=m68k-altos - ;; - am29k) - basic_machine=a29k-none - os=-bsd - ;; - amd64) - basic_machine=x86_64-pc - ;; - amdahl) - basic_machine=580-amdahl - os=-sysv - ;; - amiga | amiga-*) - basic_machine=m68k-unknown - ;; - amigaos | amigados) - basic_machine=m68k-unknown - os=-amigaos - ;; - amigaunix | amix) - basic_machine=m68k-unknown - os=-sysv4 - ;; - apollo68) - basic_machine=m68k-apollo - os=-sysv - ;; - apollo68bsd) - basic_machine=m68k-apollo - os=-bsd - ;; - aux) - basic_machine=m68k-apple - os=-aux - ;; - balance) - basic_machine=ns32k-sequent - os=-dynix - ;; - c90) - basic_machine=c90-cray - os=-unicos - ;; - convex-c1) - basic_machine=c1-convex - os=-bsd - ;; - convex-c2) - basic_machine=c2-convex - os=-bsd - ;; - convex-c32) - basic_machine=c32-convex - os=-bsd - ;; - convex-c34) - basic_machine=c34-convex - os=-bsd - ;; - convex-c38) - basic_machine=c38-convex - os=-bsd - ;; - cray | j90) - basic_machine=j90-cray - os=-unicos - ;; - crds | unos) - basic_machine=m68k-crds - ;; - cris | cris-* | etrax*) - basic_machine=cris-axis - ;; - da30 | da30-*) - basic_machine=m68k-da30 - ;; - decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) - basic_machine=mips-dec - ;; - decsystem10* | dec10*) - basic_machine=pdp10-dec - os=-tops10 - ;; - decsystem20* | dec20*) - basic_machine=pdp10-dec - os=-tops20 - ;; - delta | 3300 | motorola-3300 | motorola-delta \ - | 3300-motorola | delta-motorola) - basic_machine=m68k-motorola - ;; - delta88) - basic_machine=m88k-motorola - os=-sysv3 - ;; - dpx20 | dpx20-*) - basic_machine=rs6000-bull - os=-bosx - ;; - dpx2* | dpx2*-bull) - basic_machine=m68k-bull - os=-sysv3 - ;; - ebmon29k) - basic_machine=a29k-amd - os=-ebmon - ;; - elxsi) - basic_machine=elxsi-elxsi - os=-bsd - ;; - encore | umax | mmax) - basic_machine=ns32k-encore - ;; - es1800 | OSE68k | ose68k | ose | OSE) - basic_machine=m68k-ericsson - os=-ose - ;; - fx2800) - basic_machine=i860-alliant - ;; - genix) - basic_machine=ns32k-ns - ;; - gmicro) - basic_machine=tron-gmicro - os=-sysv - ;; - go32) - basic_machine=i386-pc - os=-go32 - ;; - h3050r* | hiux*) - basic_machine=hppa1.1-hitachi - os=-hiuxwe2 - ;; - h8300hms) - basic_machine=h8300-hitachi - os=-hms - ;; - h8300xray) - basic_machine=h8300-hitachi - os=-xray - ;; - h8500hms) - basic_machine=h8500-hitachi - os=-hms - ;; - harris) - basic_machine=m88k-harris - os=-sysv3 - ;; - hp300-*) - basic_machine=m68k-hp - ;; - hp300bsd) - basic_machine=m68k-hp - os=-bsd - ;; - hp300hpux) - basic_machine=m68k-hp - os=-hpux - ;; - hp3k9[0-9][0-9] | hp9[0-9][0-9]) - basic_machine=hppa1.0-hp - ;; - hp9k2[0-9][0-9] | hp9k31[0-9]) - basic_machine=m68000-hp - ;; - hp9k3[2-9][0-9]) - basic_machine=m68k-hp - ;; - hp9k6[0-9][0-9] | hp6[0-9][0-9]) - basic_machine=hppa1.0-hp - ;; - hp9k7[0-79][0-9] | hp7[0-79][0-9]) - basic_machine=hppa1.1-hp - ;; - hp9k78[0-9] | hp78[0-9]) - # FIXME: really hppa2.0-hp - basic_machine=hppa1.1-hp - ;; - hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) - # FIXME: really hppa2.0-hp - basic_machine=hppa1.1-hp - ;; - hp9k8[0-9][13679] | hp8[0-9][13679]) - basic_machine=hppa1.1-hp - ;; - hp9k8[0-9][0-9] | hp8[0-9][0-9]) - basic_machine=hppa1.0-hp - ;; - hppa-next) - os=-nextstep3 - ;; - hppaosf) - basic_machine=hppa1.1-hp - os=-osf - ;; - hppro) - basic_machine=hppa1.1-hp - os=-proelf - ;; - i370-ibm* | ibm*) - basic_machine=i370-ibm - ;; -# I'm not sure what "Sysv32" means. Should this be sysv3.2? - i*86v32) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv32 - ;; - i*86v4*) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv4 - ;; - i*86v) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv - ;; - i*86sol2) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-solaris2 - ;; - i386mach) - basic_machine=i386-mach - os=-mach - ;; - i386-vsta | vsta) - basic_machine=i386-unknown - os=-vsta - ;; - iris | iris4d) - basic_machine=mips-sgi - case $os in - -irix*) - ;; - *) - os=-irix4 - ;; - esac - ;; - isi68 | isi) - basic_machine=m68k-isi - os=-sysv - ;; - m88k-omron*) - basic_machine=m88k-omron - ;; - magnum | m3230) - basic_machine=mips-mips - os=-sysv - ;; - merlin) - basic_machine=ns32k-utek - os=-sysv - ;; - mingw32) - basic_machine=i386-pc - os=-mingw32 - ;; - miniframe) - basic_machine=m68000-convergent - ;; - *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) - basic_machine=m68k-atari - os=-mint - ;; - mips3*-*) - basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` - ;; - mips3*) - basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown - ;; - mmix*) - basic_machine=mmix-knuth - os=-mmixware - ;; - monitor) - basic_machine=m68k-rom68k - os=-coff - ;; - morphos) - basic_machine=powerpc-unknown - os=-morphos - ;; - msdos) - basic_machine=i386-pc - os=-msdos - ;; - mvs) - basic_machine=i370-ibm - os=-mvs - ;; - ncr3000) - basic_machine=i486-ncr - os=-sysv4 - ;; - netbsd386) - basic_machine=i386-unknown - os=-netbsd - ;; - netwinder) - basic_machine=armv4l-rebel - os=-linux - ;; - news | news700 | news800 | news900) - basic_machine=m68k-sony - os=-newsos - ;; - news1000) - basic_machine=m68030-sony - os=-newsos - ;; - news-3600 | risc-news) - basic_machine=mips-sony - os=-newsos - ;; - necv70) - basic_machine=v70-nec - os=-sysv - ;; - next | m*-next ) - basic_machine=m68k-next - case $os in - -nextstep* ) - ;; - -ns2*) - os=-nextstep2 - ;; - *) - os=-nextstep3 - ;; - esac - ;; - nh3000) - basic_machine=m68k-harris - os=-cxux - ;; - nh[45]000) - basic_machine=m88k-harris - os=-cxux - ;; - nindy960) - basic_machine=i960-intel - os=-nindy - ;; - mon960) - basic_machine=i960-intel - os=-mon960 - ;; - nonstopux) - basic_machine=mips-compaq - os=-nonstopux - ;; - np1) - basic_machine=np1-gould - ;; - nv1) - basic_machine=nv1-cray - os=-unicosmp - ;; - nsr-tandem) - basic_machine=nsr-tandem - ;; - op50n-* | op60c-*) - basic_machine=hppa1.1-oki - os=-proelf - ;; - or32 | or32-*) - basic_machine=or32-unknown - os=-coff - ;; - OSE68000 | ose68000) - basic_machine=m68000-ericsson - os=-ose - ;; - os68k) - basic_machine=m68k-none - os=-os68k - ;; - pa-hitachi) - basic_machine=hppa1.1-hitachi - os=-hiuxwe2 - ;; - paragon) - basic_machine=i860-intel - os=-osf - ;; - pbd) - basic_machine=sparc-tti - ;; - pbb) - basic_machine=m68k-tti - ;; - pc532 | pc532-*) - basic_machine=ns32k-pc532 - ;; - pentium | p5 | k5 | k6 | nexgen | viac3) - basic_machine=i586-pc - ;; - pentiumpro | p6 | 6x86 | athlon | athlon_*) - basic_machine=i686-pc - ;; - pentiumii | pentium2 | pentiumiii | pentium3) - basic_machine=i686-pc - ;; - pentium4) - basic_machine=i786-pc - ;; - pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) - basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pentiumpro-* | p6-* | 6x86-* | athlon-*) - basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) - basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pentium4-*) - basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pn) - basic_machine=pn-gould - ;; - power) basic_machine=power-ibm - ;; - ppc) basic_machine=powerpc-unknown - ;; - ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ppcle | powerpclittle | ppc-le | powerpc-little) - basic_machine=powerpcle-unknown - ;; - ppcle-* | powerpclittle-*) - basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ppc64) basic_machine=powerpc64-unknown - ;; - ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ppc64le | powerpc64little | ppc64-le | powerpc64-little) - basic_machine=powerpc64le-unknown - ;; - ppc64le-* | powerpc64little-*) - basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ps2) - basic_machine=i386-ibm - ;; - pw32) - basic_machine=i586-unknown - os=-pw32 - ;; - rom68k) - basic_machine=m68k-rom68k - os=-coff - ;; - rm[46]00) - basic_machine=mips-siemens - ;; - rtpc | rtpc-*) - basic_machine=romp-ibm - ;; - s390 | s390-*) - basic_machine=s390-ibm - ;; - s390x | s390x-*) - basic_machine=s390x-ibm - ;; - sa29200) - basic_machine=a29k-amd - os=-udi - ;; - sb1) - basic_machine=mipsisa64sb1-unknown - ;; - sb1el) - basic_machine=mipsisa64sb1el-unknown - ;; - sei) - basic_machine=mips-sei - os=-seiux - ;; - sequent) - basic_machine=i386-sequent - ;; - sh) - basic_machine=sh-hitachi - os=-hms - ;; - sh64) - basic_machine=sh64-unknown - ;; - sparclite-wrs | simso-wrs) - basic_machine=sparclite-wrs - os=-vxworks - ;; - sps7) - basic_machine=m68k-bull - os=-sysv2 - ;; - spur) - basic_machine=spur-unknown - ;; - st2000) - basic_machine=m68k-tandem - ;; - stratus) - basic_machine=i860-stratus - os=-sysv4 - ;; - sun2) - basic_machine=m68000-sun - ;; - sun2os3) - basic_machine=m68000-sun - os=-sunos3 - ;; - sun2os4) - basic_machine=m68000-sun - os=-sunos4 - ;; - sun3os3) - basic_machine=m68k-sun - os=-sunos3 - ;; - sun3os4) - basic_machine=m68k-sun - os=-sunos4 - ;; - sun4os3) - basic_machine=sparc-sun - os=-sunos3 - ;; - sun4os4) - basic_machine=sparc-sun - os=-sunos4 - ;; - sun4sol2) - basic_machine=sparc-sun - os=-solaris2 - ;; - sun3 | sun3-*) - basic_machine=m68k-sun - ;; - sun4) - basic_machine=sparc-sun - ;; - sun386 | sun386i | roadrunner) - basic_machine=i386-sun - ;; - sv1) - basic_machine=sv1-cray - os=-unicos - ;; - symmetry) - basic_machine=i386-sequent - os=-dynix - ;; - t3e) - basic_machine=alphaev5-cray - os=-unicos - ;; - t90) - basic_machine=t90-cray - os=-unicos - ;; - tic54x | c54x*) - basic_machine=tic54x-unknown - os=-coff - ;; - tic55x | c55x*) - basic_machine=tic55x-unknown - os=-coff - ;; - tic6x | c6x*) - basic_machine=tic6x-unknown - os=-coff - ;; - tx39) - basic_machine=mipstx39-unknown - ;; - tx39el) - basic_machine=mipstx39el-unknown - ;; - toad1) - basic_machine=pdp10-xkl - os=-tops20 - ;; - tower | tower-32) - basic_machine=m68k-ncr - ;; - udi29k) - basic_machine=a29k-amd - os=-udi - ;; - ultra3) - basic_machine=a29k-nyu - os=-sym1 - ;; - v810 | necv810) - basic_machine=v810-nec - os=-none - ;; - vaxv) - basic_machine=vax-dec - os=-sysv - ;; - vms) - basic_machine=vax-dec - os=-vms - ;; - vpp*|vx|vx-*) - basic_machine=f301-fujitsu - ;; - vxworks960) - basic_machine=i960-wrs - os=-vxworks - ;; - vxworks68) - basic_machine=m68k-wrs - os=-vxworks - ;; - vxworks29k) - basic_machine=a29k-wrs - os=-vxworks - ;; - w65*) - basic_machine=w65-wdc - os=-none - ;; - w89k-*) - basic_machine=hppa1.1-winbond - os=-proelf - ;; - xps | xps100) - basic_machine=xps100-honeywell - ;; - ymp) - basic_machine=ymp-cray - os=-unicos - ;; - z8k-*-coff) - basic_machine=z8k-unknown - os=-sim - ;; - none) - basic_machine=none-none - os=-none - ;; - -# Here we handle the default manufacturer of certain CPU types. It is in -# some cases the only manufacturer, in others, it is the most popular. - w89k) - basic_machine=hppa1.1-winbond - ;; - op50n) - basic_machine=hppa1.1-oki - ;; - op60c) - basic_machine=hppa1.1-oki - ;; - romp) - basic_machine=romp-ibm - ;; - rs6000) - basic_machine=rs6000-ibm - ;; - vax) - basic_machine=vax-dec - ;; - pdp10) - # there are many clones, so DEC is not a safe bet - basic_machine=pdp10-unknown - ;; - pdp11) - basic_machine=pdp11-dec - ;; - we32k) - basic_machine=we32k-att - ;; - sh3 | sh4 | sh[34]eb | sh[1234]le | sh[23]ele) - basic_machine=sh-unknown - ;; - sh64) - basic_machine=sh64-unknown - ;; - sparc | sparcv9 | sparcv9b) - basic_machine=sparc-sun - ;; - cydra) - basic_machine=cydra-cydrome - ;; - orion) - basic_machine=orion-highlevel - ;; - orion105) - basic_machine=clipper-highlevel - ;; - mac | mpw | mac-mpw) - basic_machine=m68k-apple - ;; - pmac | pmac-mpw) - basic_machine=powerpc-apple - ;; - *-unknown) - # Make sure to match an already-canonicalized machine name. - ;; - *) - echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 - exit 1 - ;; -esac - -# Here we canonicalize certain aliases for manufacturers. -case $basic_machine in - *-digital*) - basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` - ;; - *-commodore*) - basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` - ;; - *) - ;; -esac - -# Decode manufacturer-specific aliases for certain operating systems. - -if [ x"$os" != x"" ] -then -case $os in - # First match some system type aliases - # that might get confused with valid system types. - # -solaris* is a basic system type, with this one exception. - -solaris1 | -solaris1.*) - os=`echo $os | sed -e 's|solaris1|sunos4|'` - ;; - -solaris) - os=-solaris2 - ;; - -svr4*) - os=-sysv4 - ;; - -unixware*) - os=-sysv4.2uw - ;; - -gnu/linux*) - os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` - ;; - # First accept the basic system types. - # The portable systems comes first. - # Each alternative MUST END IN A *, to match a version number. - # -sysv* is not here because it comes later, after sysvr4. - -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ - | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ - | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ - | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ - | -aos* \ - | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ - | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ - | -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \ - | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ - | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ - | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ - | -chorusos* | -chorusrdb* \ - | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ - | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \ - | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ - | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ - | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ - | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ - | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ - | -powermax* | -dnix* | -nx6 | -nx7 | -sei*) - # Remember, each alternative MUST END IN *, to match a version number. - ;; - -qnx*) - case $basic_machine in - x86-* | i*86-*) - ;; - *) - os=-nto$os - ;; - esac - ;; - -nto-qnx*) - ;; - -nto*) - os=`echo $os | sed -e 's|nto|nto-qnx|'` - ;; - -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ - | -windows* | -osx | -abug | -netware* | -os9* | -beos* \ - | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) - ;; - -mac*) - os=`echo $os | sed -e 's|mac|macos|'` - ;; - -linux*) - os=`echo $os | sed -e 's|linux|linux-gnu|'` - ;; - -sunos5*) - os=`echo $os | sed -e 's|sunos5|solaris2|'` - ;; - -sunos6*) - os=`echo $os | sed -e 's|sunos6|solaris3|'` - ;; - -opened*) - os=-openedition - ;; - -wince*) - os=-wince - ;; - -osfrose*) - os=-osfrose - ;; - -osf*) - os=-osf - ;; - -utek*) - os=-bsd - ;; - -dynix*) - os=-bsd - ;; - -acis*) - os=-aos - ;; - -atheos*) - os=-atheos - ;; - -386bsd) - os=-bsd - ;; - -ctix* | -uts*) - os=-sysv - ;; - -nova*) - os=-rtmk-nova - ;; - -ns2 ) - os=-nextstep2 - ;; - -nsk*) - os=-nsk - ;; - # Preserve the version number of sinix5. - -sinix5.*) - os=`echo $os | sed -e 's|sinix|sysv|'` - ;; - -sinix*) - os=-sysv4 - ;; - -triton*) - os=-sysv3 - ;; - -oss*) - os=-sysv3 - ;; - -svr4) - os=-sysv4 - ;; - -svr3) - os=-sysv3 - ;; - -sysvr4) - os=-sysv4 - ;; - # This must come after -sysvr4. - -sysv*) - ;; - -ose*) - os=-ose - ;; - -es1800*) - os=-ose - ;; - -xenix) - os=-xenix - ;; - -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) - os=-mint - ;; - -aros*) - os=-aros - ;; - -kaos*) - os=-kaos - ;; - -none) - ;; - *) - # Get rid of the `-' at the beginning of $os. - os=`echo $os | sed 's/[^-]*-//'` - echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 - exit 1 - ;; -esac -else - -# Here we handle the default operating systems that come with various machines. -# The value should be what the vendor currently ships out the door with their -# machine or put another way, the most popular os provided with the machine. - -# Note that if you're going to try to match "-MANUFACTURER" here (say, -# "-sun"), then you have to tell the case statement up towards the top -# that MANUFACTURER isn't an operating system. Otherwise, code above -# will signal an error saying that MANUFACTURER isn't an operating -# system, and we'll never get to this point. - -case $basic_machine in - *-acorn) - os=-riscix1.2 - ;; - arm*-rebel) - os=-linux - ;; - arm*-semi) - os=-aout - ;; - c4x-* | tic4x-*) - os=-coff - ;; - # This must come before the *-dec entry. - pdp10-*) - os=-tops20 - ;; - pdp11-*) - os=-none - ;; - *-dec | vax-*) - os=-ultrix4.2 - ;; - m68*-apollo) - os=-domain - ;; - i386-sun) - os=-sunos4.0.2 - ;; - m68000-sun) - os=-sunos3 - # This also exists in the configure program, but was not the - # default. - # os=-sunos4 - ;; - m68*-cisco) - os=-aout - ;; - mips*-cisco) - os=-elf - ;; - mips*-*) - os=-elf - ;; - or32-*) - os=-coff - ;; - *-tti) # must be before sparc entry or we get the wrong os. - os=-sysv3 - ;; - sparc-* | *-sun) - os=-sunos4.1.1 - ;; - *-be) - os=-beos - ;; - *-ibm) - os=-aix - ;; - *-wec) - os=-proelf - ;; - *-winbond) - os=-proelf - ;; - *-oki) - os=-proelf - ;; - *-hp) - os=-hpux - ;; - *-hitachi) - os=-hiux - ;; - i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) - os=-sysv - ;; - *-cbm) - os=-amigaos - ;; - *-dg) - os=-dgux - ;; - *-dolphin) - os=-sysv3 - ;; - m68k-ccur) - os=-rtu - ;; - m88k-omron*) - os=-luna - ;; - *-next ) - os=-nextstep - ;; - *-sequent) - os=-ptx - ;; - *-crds) - os=-unos - ;; - *-ns) - os=-genix - ;; - i370-*) - os=-mvs - ;; - *-next) - os=-nextstep3 - ;; - *-gould) - os=-sysv - ;; - *-highlevel) - os=-bsd - ;; - *-encore) - os=-bsd - ;; - *-sgi) - os=-irix - ;; - *-siemens) - os=-sysv4 - ;; - *-masscomp) - os=-rtu - ;; - f30[01]-fujitsu | f700-fujitsu) - os=-uxpv - ;; - *-rom68k) - os=-coff - ;; - *-*bug) - os=-coff - ;; - *-apple) - os=-macos - ;; - *-atari*) - os=-mint - ;; - *) - os=-none - ;; -esac -fi - -# Here we handle the case where we know the os, and the CPU type, but not the -# manufacturer. We pick the logical manufacturer. -vendor=unknown -case $basic_machine in - *-unknown) - case $os in - -riscix*) - vendor=acorn - ;; - -sunos*) - vendor=sun - ;; - -aix*) - vendor=ibm - ;; - -beos*) - vendor=be - ;; - -hpux*) - vendor=hp - ;; - -mpeix*) - vendor=hp - ;; - -hiux*) - vendor=hitachi - ;; - -unos*) - vendor=crds - ;; - -dgux*) - vendor=dg - ;; - -luna*) - vendor=omron - ;; - -genix*) - vendor=ns - ;; - -mvs* | -opened*) - vendor=ibm - ;; - -ptx*) - vendor=sequent - ;; - -vxsim* | -vxworks* | -windiss*) - vendor=wrs - ;; - -aux*) - vendor=apple - ;; - -hms*) - vendor=hitachi - ;; - -mpw* | -macos*) - vendor=apple - ;; - -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) - vendor=atari - ;; - -vos*) - vendor=stratus - ;; - esac - basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` - ;; -esac - -echo $basic_machine$os -exit 0 - -# Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "timestamp='" -# time-stamp-format: "%:y-%02m-%02d" -# time-stamp-end: "'" -# End: diff --git a/winsup/mingw/configure b/winsup/mingw/configure deleted file mode 100755 index f0668c586..000000000 --- a/winsup/mingw/configure +++ /dev/null @@ -1,5210 +0,0 @@ -#! /bin/sh -# Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.63 for MinGW Runtime v3.x. -# -# Report bugs to <http://mingw.org/reporting_bugs>. -# -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -# 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. -# This configure script is free software; the Free Software Foundation -# gives unlimited permission to copy, distribute and modify it. -## --------------------- ## -## M4sh Initialization. ## -## --------------------- ## - -# Be more Bourne compatible -DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in - *posix*) set -o posix ;; -esac - -fi - - - - -# PATH needs CR -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits - -as_nl=' -' -export as_nl -# Printing a long string crashes Solaris 7 /usr/bin/printf. -as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo -if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='printf %s\n' - as_echo_n='printf %s' -else - if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then - as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' - as_echo_n='/usr/ucb/echo -n' - else - as_echo_body='eval expr "X$1" : "X\\(.*\\)"' - as_echo_n_body='eval - arg=$1; - case $arg in - *"$as_nl"*) - expr "X$arg" : "X\\(.*\\)$as_nl"; - arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; - esac; - expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" - ' - export as_echo_n_body - as_echo_n='sh -c $as_echo_n_body as_echo' - fi - export as_echo_body - as_echo='sh -c $as_echo_body as_echo' -fi - -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - PATH_SEPARATOR=: - (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { - (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || - PATH_SEPARATOR=';' - } -fi - -# Support unset when possible. -if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then - as_unset=unset -else - as_unset=false -fi - - -# IFS -# We need space, tab and new line, in precisely that order. Quoting is -# there to prevent editors from complaining about space-tab. -# (If _AS_PATH_WALK were called with IFS unset, it would disable word -# splitting by setting IFS to empty value.) -IFS=" "" $as_nl" - -# Find who we are. Look in the path if we contain no directory separator. -case $0 in - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break -done -IFS=$as_save_IFS - - ;; -esac -# We did not find ourselves, most probably we were run as `sh COMMAND' -# in which case we are not to be found in the path. -if test "x$as_myself" = x; then - as_myself=$0 -fi -if test ! -f "$as_myself"; then - $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 - { (exit 1); exit 1; } -fi - -# Work around bugs in pre-3.0 UWIN ksh. -for as_var in ENV MAIL MAILPATH -do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var -done -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -LC_ALL=C -export LC_ALL -LANGUAGE=C -export LANGUAGE - -# Required to use basename. -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi - -if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then - as_basename=basename -else - as_basename=false -fi - - -# Name of the executable. -as_me=`$as_basename -- "$0" || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ - s//\1/ - q - } - /^X\/\(\/\/\)$/{ - s//\1/ - q - } - /^X\/\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - -# CDPATH. -$as_unset CDPATH - - -if test "x$CONFIG_SHELL" = x; then - if (eval ":") 2>/dev/null; then - as_have_required=yes -else - as_have_required=no -fi - - if test $as_have_required = yes && (eval ": -(as_func_return () { - (exit \$1) -} -as_func_success () { - as_func_return 0 -} -as_func_failure () { - as_func_return 1 -} -as_func_ret_success () { - return 0 -} -as_func_ret_failure () { - return 1 -} - -exitcode=0 -if as_func_success; then - : -else - exitcode=1 - echo as_func_success failed. -fi - -if as_func_failure; then - exitcode=1 - echo as_func_failure succeeded. -fi - -if as_func_ret_success; then - : -else - exitcode=1 - echo as_func_ret_success failed. -fi - -if as_func_ret_failure; then - exitcode=1 - echo as_func_ret_failure succeeded. -fi - -if ( set x; as_func_ret_success y && test x = \"\$1\" ); then - : -else - exitcode=1 - echo positional parameters were not saved. -fi - -test \$exitcode = 0) || { (exit 1); exit 1; } - -( - as_lineno_1=\$LINENO - as_lineno_2=\$LINENO - test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && - test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } -") 2> /dev/null; then - : -else - as_candidate_shells= - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - case $as_dir in - /*) - for as_base in sh bash ksh sh5; do - as_candidate_shells="$as_candidate_shells $as_dir/$as_base" - done;; - esac -done -IFS=$as_save_IFS - - - for as_shell in $as_candidate_shells $SHELL; do - # Try only shells that exist, to save several forks. - if { test -f "$as_shell" || test -f "$as_shell.exe"; } && - { ("$as_shell") 2> /dev/null <<\_ASEOF -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in - *posix*) set -o posix ;; -esac - -fi - - -: -_ASEOF -}; then - CONFIG_SHELL=$as_shell - as_have_required=yes - if { "$as_shell" 2> /dev/null <<\_ASEOF -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in - *posix*) set -o posix ;; -esac - -fi - - -: -(as_func_return () { - (exit $1) -} -as_func_success () { - as_func_return 0 -} -as_func_failure () { - as_func_return 1 -} -as_func_ret_success () { - return 0 -} -as_func_ret_failure () { - return 1 -} - -exitcode=0 -if as_func_success; then - : -else - exitcode=1 - echo as_func_success failed. -fi - -if as_func_failure; then - exitcode=1 - echo as_func_failure succeeded. -fi - -if as_func_ret_success; then - : -else - exitcode=1 - echo as_func_ret_success failed. -fi - -if as_func_ret_failure; then - exitcode=1 - echo as_func_ret_failure succeeded. -fi - -if ( set x; as_func_ret_success y && test x = "$1" ); then - : -else - exitcode=1 - echo positional parameters were not saved. -fi - -test $exitcode = 0) || { (exit 1); exit 1; } - -( - as_lineno_1=$LINENO - as_lineno_2=$LINENO - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } - -_ASEOF -}; then - break -fi - -fi - - done - - if test "x$CONFIG_SHELL" != x; then - for as_var in BASH_ENV ENV - do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var - done - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} -fi - - - if test $as_have_required = no; then - echo This script requires a shell more modern than all the - echo shells that I found on your system. Please install a - echo modern shell, or manually run the script under such a - echo shell if you do have one. - { (exit 1); exit 1; } -fi - - -fi - -fi - - - -(eval "as_func_return () { - (exit \$1) -} -as_func_success () { - as_func_return 0 -} -as_func_failure () { - as_func_return 1 -} -as_func_ret_success () { - return 0 -} -as_func_ret_failure () { - return 1 -} - -exitcode=0 -if as_func_success; then - : -else - exitcode=1 - echo as_func_success failed. -fi - -if as_func_failure; then - exitcode=1 - echo as_func_failure succeeded. -fi - -if as_func_ret_success; then - : -else - exitcode=1 - echo as_func_ret_success failed. -fi - -if as_func_ret_failure; then - exitcode=1 - echo as_func_ret_failure succeeded. -fi - -if ( set x; as_func_ret_success y && test x = \"\$1\" ); then - : -else - exitcode=1 - echo positional parameters were not saved. -fi - -test \$exitcode = 0") || { - echo No shell found that supports shell functions. - echo Please tell bug-autoconf@gnu.org about your system, - echo including any error possibly output before this message. - echo This can help us improve future autoconf versions. - echo Configuration will now proceed without shell functions. -} - - - - as_lineno_1=$LINENO - as_lineno_2=$LINENO - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { - - # Create $as_me.lineno as a copy of $as_myself, but with $LINENO - # uniformly replaced by the line number. The first 'sed' inserts a - # line-number line after each line using $LINENO; the second 'sed' - # does the real work. The second script uses 'N' to pair each - # line-number line with the line containing $LINENO, and appends - # trailing '-' during substitution so that $LINENO is not a special - # case at line end. - # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the - # scripts with optimization help from Paolo Bonzini. Blame Lee - # E. McMahon (1931-1989) for sed's syntax. :-) - sed -n ' - p - /[$]LINENO/= - ' <$as_myself | - sed ' - s/[$]LINENO.*/&-/ - t lineno - b - :lineno - N - :loop - s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ - t loop - s/-\n.*// - ' >$as_me.lineno && - chmod +x "$as_me.lineno" || - { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 - { (exit 1); exit 1; }; } - - # Don't try to exec as it changes $[0], causing all sort of problems - # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensitive to this). - . "./$as_me.lineno" - # Exit status is that of the last command. - exit -} - - -if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then - as_dirname=dirname -else - as_dirname=false -fi - -ECHO_C= ECHO_N= ECHO_T= -case `echo -n x` in --n*) - case `echo 'x\c'` in - *c*) ECHO_T=' ';; # ECHO_T is single tab character. - *) ECHO_C='\c';; - esac;; -*) - ECHO_N='-n';; -esac -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi - -rm -f conf$$ conf$$.exe conf$$.file -if test -d conf$$.dir; then - rm -f conf$$.dir/conf$$.file -else - rm -f conf$$.dir - mkdir conf$$.dir 2>/dev/null -fi -if (echo >conf$$.file) 2>/dev/null; then - if ln -s conf$$.file conf$$ 2>/dev/null; then - as_ln_s='ln -s' - # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -p'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -p' - elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln - else - as_ln_s='cp -p' - fi -else - as_ln_s='cp -p' -fi -rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file -rmdir conf$$.dir 2>/dev/null - -if mkdir -p . 2>/dev/null; then - as_mkdir_p=: -else - test -d ./-p && rmdir ./-p - as_mkdir_p=false -fi - -if test -x / >/dev/null 2>&1; then - as_test_x='test -x' -else - if ls -dL / >/dev/null 2>&1; then - as_ls_L_option=L - else - as_ls_L_option= - fi - as_test_x=' - eval sh -c '\'' - if test -d "$1"; then - test -d "$1/."; - else - case $1 in - -*)set "./$1";; - esac; - case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in - ???[sx]*):;;*)false;;esac;fi - '\'' sh - ' -fi -as_executable_p=$as_test_x - -# Sed expression to map a string onto a valid CPP name. -as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" - -# Sed expression to map a string onto a valid variable name. -as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" - - - -exec 7<&0 </dev/null 6>&1 - -# Name of the host. -# hostname on some systems (SVR3.2, Linux) returns a bogus exit status, -# so uname gets run too. -ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` - -# -# Initializations. -# -ac_default_prefix=/usr/local -ac_clean_files= -ac_config_libobj_dir=. -LIBOBJS= -cross_compiling=no -subdirs= -MFLAGS= -MAKEFLAGS= -SHELL=${CONFIG_SHELL-/bin/sh} - -# Identity of this package. -PACKAGE_NAME='MinGW Runtime' -PACKAGE_TARNAME='mingwrt' -PACKAGE_VERSION='v3.x' -PACKAGE_STRING='MinGW Runtime v3.x' -PACKAGE_BUGREPORT='http://mingw.org/reporting_bugs' - -ac_unique_file="include/_mingw.h" -enable_option_checking=no -ac_subst_vars='LTLIBOBJS -LIBOBJS -mingw_manpage_transform -INSTALL_DATA -INSTALL_SCRIPT -INSTALL_PROGRAM -W32API_INCLUDE -HEADER_SUBDIR -LIBGMON_A -LIBM_A -NO_CYGWIN -MKINSTALLDIRS -THREAD_DLL -subdirs -WINDRES -DLLWRAP -DLLTOOL -OBJCOPY -NM -LD -RANLIB -AS -AR -install_dlls_host -all_dlls_host -with_cross_host -OBJEXT -EXEEXT -ac_ct_CC -CPPFLAGS -LDFLAGS -CFLAGS -CC -target_os -target_vendor -target_cpu -target -host_os -host_vendor -host_cpu -host -build_os -build_vendor -build_cpu -build -target_alias -host_alias -build_alias -LIBS -ECHO_T -ECHO_N -ECHO_C -DEFS -mandir -localedir -libdir -psdir -pdfdir -dvidir -htmldir -infodir -docdir -oldincludedir -includedir -localstatedir -sharedstatedir -sysconfdir -datadir -datarootdir -libexecdir -sbindir -bindir -program_transform_name -prefix -exec_prefix -PACKAGE_BUGREPORT -PACKAGE_STRING -PACKAGE_VERSION -PACKAGE_TARNAME -PACKAGE_NAME -PATH_SEPARATOR -SHELL' -ac_subst_files='' -ac_user_opts=' -enable_option_checking -enable_mingw_manpage_transform -' - ac_precious_vars='build_alias -host_alias -target_alias -CC -CFLAGS -LDFLAGS -LIBS -CPPFLAGS' -ac_subdirs_all='profile mingwex' - -# Initialize some variables set by options. -ac_init_help= -ac_init_version=false -ac_unrecognized_opts= -ac_unrecognized_sep= -# The variables have the same names as the options, with -# dashes changed to underlines. -cache_file=/dev/null -exec_prefix=NONE -no_create= -no_recursion= -prefix=NONE -program_prefix=NONE -program_suffix=NONE -program_transform_name=s,x,x, -silent= -site= -srcdir= -verbose= -x_includes=NONE -x_libraries=NONE - -# Installation directory options. -# These are left unexpanded so users can "make install exec_prefix=/foo" -# and all the variables that are supposed to be based on exec_prefix -# by default will actually change. -# Use braces instead of parens because sh, perl, etc. also accept them. -# (The list follows the same order as the GNU Coding Standards.) -bindir='${exec_prefix}/bin' -sbindir='${exec_prefix}/sbin' -libexecdir='${exec_prefix}/libexec' -datarootdir='${prefix}/share' -datadir='${datarootdir}' -sysconfdir='${prefix}/etc' -sharedstatedir='${prefix}/com' -localstatedir='${prefix}/var' -includedir='${prefix}/include' -oldincludedir='/usr/include' -docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' -infodir='${datarootdir}/info' -htmldir='${docdir}' -dvidir='${docdir}' -pdfdir='${docdir}' -psdir='${docdir}' -libdir='${exec_prefix}/lib' -localedir='${datarootdir}/locale' -mandir='${datarootdir}/man' - -ac_prev= -ac_dashdash= -for ac_option -do - # If the previous option needs an argument, assign it. - if test -n "$ac_prev"; then - eval $ac_prev=\$ac_option - ac_prev= - continue - fi - - case $ac_option in - *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; - *) ac_optarg=yes ;; - esac - - # Accept the important Cygnus configure options, so we can diagnose typos. - - case $ac_dashdash$ac_option in - --) - ac_dashdash=yes ;; - - -bindir | --bindir | --bindi | --bind | --bin | --bi) - ac_prev=bindir ;; - -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) - bindir=$ac_optarg ;; - - -build | --build | --buil | --bui | --bu) - ac_prev=build_alias ;; - -build=* | --build=* | --buil=* | --bui=* | --bu=*) - build_alias=$ac_optarg ;; - - -cache-file | --cache-file | --cache-fil | --cache-fi \ - | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) - ac_prev=cache_file ;; - -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ - | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) - cache_file=$ac_optarg ;; - - --config-cache | -C) - cache_file=config.cache ;; - - -datadir | --datadir | --datadi | --datad) - ac_prev=datadir ;; - -datadir=* | --datadir=* | --datadi=* | --datad=*) - datadir=$ac_optarg ;; - - -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ - | --dataroo | --dataro | --datar) - ac_prev=datarootdir ;; - -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ - | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) - datarootdir=$ac_optarg ;; - - -disable-* | --disable-*) - ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2 - { (exit 1); exit 1; }; } - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"enable_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval enable_$ac_useropt=no ;; - - -docdir | --docdir | --docdi | --doc | --do) - ac_prev=docdir ;; - -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) - docdir=$ac_optarg ;; - - -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) - ac_prev=dvidir ;; - -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) - dvidir=$ac_optarg ;; - - -enable-* | --enable-*) - ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2 - { (exit 1); exit 1; }; } - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"enable_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval enable_$ac_useropt=\$ac_optarg ;; - - -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ - | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ - | --exec | --exe | --ex) - ac_prev=exec_prefix ;; - -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ - | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ - | --exec=* | --exe=* | --ex=*) - exec_prefix=$ac_optarg ;; - - -gas | --gas | --ga | --g) - # Obsolete; use --with-gas. - with_gas=yes ;; - - -help | --help | --hel | --he | -h) - ac_init_help=long ;; - -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) - ac_init_help=recursive ;; - -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) - ac_init_help=short ;; - - -host | --host | --hos | --ho) - ac_prev=host_alias ;; - -host=* | --host=* | --hos=* | --ho=*) - host_alias=$ac_optarg ;; - - -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) - ac_prev=htmldir ;; - -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ - | --ht=*) - htmldir=$ac_optarg ;; - - -includedir | --includedir | --includedi | --included | --include \ - | --includ | --inclu | --incl | --inc) - ac_prev=includedir ;; - -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ - | --includ=* | --inclu=* | --incl=* | --inc=*) - includedir=$ac_optarg ;; - - -infodir | --infodir | --infodi | --infod | --info | --inf) - ac_prev=infodir ;; - -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) - infodir=$ac_optarg ;; - - -libdir | --libdir | --libdi | --libd) - ac_prev=libdir ;; - -libdir=* | --libdir=* | --libdi=* | --libd=*) - libdir=$ac_optarg ;; - - -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ - | --libexe | --libex | --libe) - ac_prev=libexecdir ;; - -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ - | --libexe=* | --libex=* | --libe=*) - libexecdir=$ac_optarg ;; - - -localedir | --localedir | --localedi | --localed | --locale) - ac_prev=localedir ;; - -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) - localedir=$ac_optarg ;; - - -localstatedir | --localstatedir | --localstatedi | --localstated \ - | --localstate | --localstat | --localsta | --localst | --locals) - ac_prev=localstatedir ;; - -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ - | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) - localstatedir=$ac_optarg ;; - - -mandir | --mandir | --mandi | --mand | --man | --ma | --m) - ac_prev=mandir ;; - -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) - mandir=$ac_optarg ;; - - -nfp | --nfp | --nf) - # Obsolete; use --without-fp. - with_fp=no ;; - - -no-create | --no-create | --no-creat | --no-crea | --no-cre \ - | --no-cr | --no-c | -n) - no_create=yes ;; - - -no-recursion | --no-recursion | --no-recursio | --no-recursi \ - | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) - no_recursion=yes ;; - - -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ - | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ - | --oldin | --oldi | --old | --ol | --o) - ac_prev=oldincludedir ;; - -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ - | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ - | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) - oldincludedir=$ac_optarg ;; - - -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) - ac_prev=prefix ;; - -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) - prefix=$ac_optarg ;; - - -program-prefix | --program-prefix | --program-prefi | --program-pref \ - | --program-pre | --program-pr | --program-p) - ac_prev=program_prefix ;; - -program-prefix=* | --program-prefix=* | --program-prefi=* \ - | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) - program_prefix=$ac_optarg ;; - - -program-suffix | --program-suffix | --program-suffi | --program-suff \ - | --program-suf | --program-su | --program-s) - ac_prev=program_suffix ;; - -program-suffix=* | --program-suffix=* | --program-suffi=* \ - | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) - program_suffix=$ac_optarg ;; - - -program-transform-name | --program-transform-name \ - | --program-transform-nam | --program-transform-na \ - | --program-transform-n | --program-transform- \ - | --program-transform | --program-transfor \ - | --program-transfo | --program-transf \ - | --program-trans | --program-tran \ - | --progr-tra | --program-tr | --program-t) - ac_prev=program_transform_name ;; - -program-transform-name=* | --program-transform-name=* \ - | --program-transform-nam=* | --program-transform-na=* \ - | --program-transform-n=* | --program-transform-=* \ - | --program-transform=* | --program-transfor=* \ - | --program-transfo=* | --program-transf=* \ - | --program-trans=* | --program-tran=* \ - | --progr-tra=* | --program-tr=* | --program-t=*) - program_transform_name=$ac_optarg ;; - - -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) - ac_prev=pdfdir ;; - -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) - pdfdir=$ac_optarg ;; - - -psdir | --psdir | --psdi | --psd | --ps) - ac_prev=psdir ;; - -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) - psdir=$ac_optarg ;; - - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil) - silent=yes ;; - - -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) - ac_prev=sbindir ;; - -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ - | --sbi=* | --sb=*) - sbindir=$ac_optarg ;; - - -sharedstatedir | --sharedstatedir | --sharedstatedi \ - | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ - | --sharedst | --shareds | --shared | --share | --shar \ - | --sha | --sh) - ac_prev=sharedstatedir ;; - -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ - | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ - | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ - | --sha=* | --sh=*) - sharedstatedir=$ac_optarg ;; - - -site | --site | --sit) - ac_prev=site ;; - -site=* | --site=* | --sit=*) - site=$ac_optarg ;; - - -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) - ac_prev=srcdir ;; - -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) - srcdir=$ac_optarg ;; - - -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ - | --syscon | --sysco | --sysc | --sys | --sy) - ac_prev=sysconfdir ;; - -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ - | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) - sysconfdir=$ac_optarg ;; - - -target | --target | --targe | --targ | --tar | --ta | --t) - ac_prev=target_alias ;; - -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) - target_alias=$ac_optarg ;; - - -v | -verbose | --verbose | --verbos | --verbo | --verb) - verbose=yes ;; - - -version | --version | --versio | --versi | --vers | -V) - ac_init_version=: ;; - - -with-* | --with-*) - ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2 - { (exit 1); exit 1; }; } - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"with_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval with_$ac_useropt=\$ac_optarg ;; - - -without-* | --without-*) - ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2 - { (exit 1); exit 1; }; } - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"with_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval with_$ac_useropt=no ;; - - --x) - # Obsolete; use --with-x. - with_x=yes ;; - - -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ - | --x-incl | --x-inc | --x-in | --x-i) - ac_prev=x_includes ;; - -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ - | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) - x_includes=$ac_optarg ;; - - -x-libraries | --x-libraries | --x-librarie | --x-librari \ - | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) - ac_prev=x_libraries ;; - -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ - | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) - x_libraries=$ac_optarg ;; - - -*) { $as_echo "$as_me: error: unrecognized option: $ac_option -Try \`$0 --help' for more information." >&2 - { (exit 1); exit 1; }; } - ;; - - *=*) - ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` - # Reject names that are not valid shell variable names. - expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && - { $as_echo "$as_me: error: invalid variable name: $ac_envvar" >&2 - { (exit 1); exit 1; }; } - eval $ac_envvar=\$ac_optarg - export $ac_envvar ;; - - *) - # FIXME: should be removed in autoconf 3.0. - $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 - expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && - $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 - : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} - ;; - - esac -done - -if test -n "$ac_prev"; then - ac_option=--`echo $ac_prev | sed 's/_/-/g'` - { $as_echo "$as_me: error: missing argument to $ac_option" >&2 - { (exit 1); exit 1; }; } -fi - -if test -n "$ac_unrecognized_opts"; then - case $enable_option_checking in - no) ;; - fatal) { $as_echo "$as_me: error: unrecognized options: $ac_unrecognized_opts" >&2 - { (exit 1); exit 1; }; } ;; - *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; - esac -fi - -# Check all directory arguments for consistency. -for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ - datadir sysconfdir sharedstatedir localstatedir includedir \ - oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ - libdir localedir mandir -do - eval ac_val=\$$ac_var - # Remove trailing slashes. - case $ac_val in - */ ) - ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` - eval $ac_var=\$ac_val;; - esac - # Be sure to have absolute directory names. - case $ac_val in - [\\/$]* | ?:[\\/]* ) continue;; - NONE | '' ) case $ac_var in *prefix ) continue;; esac;; - esac - { $as_echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 - { (exit 1); exit 1; }; } -done - -# There might be people who depend on the old broken behavior: `$host' -# used to hold the argument of --host etc. -# FIXME: To remove some day. -build=$build_alias -host=$host_alias -target=$target_alias - -# FIXME: To remove some day. -if test "x$host_alias" != x; then - if test "x$build_alias" = x; then - cross_compiling=maybe - $as_echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. - If a cross compiler is detected then cross compile mode will be used." >&2 - elif test "x$build_alias" != "x$host_alias"; then - cross_compiling=yes - fi -fi - -ac_tool_prefix= -test -n "$host_alias" && ac_tool_prefix=$host_alias- - -test "$silent" = yes && exec 6>/dev/null - - -ac_pwd=`pwd` && test -n "$ac_pwd" && -ac_ls_di=`ls -di .` && -ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || - { $as_echo "$as_me: error: working directory cannot be determined" >&2 - { (exit 1); exit 1; }; } -test "X$ac_ls_di" = "X$ac_pwd_ls_di" || - { $as_echo "$as_me: error: pwd does not report name of working directory" >&2 - { (exit 1); exit 1; }; } - - -# Find the source files, if location was not specified. -if test -z "$srcdir"; then - ac_srcdir_defaulted=yes - # Try the directory containing this script, then the parent directory. - ac_confdir=`$as_dirname -- "$as_myself" || -$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_myself" : 'X\(//\)[^/]' \| \ - X"$as_myself" : 'X\(//\)$' \| \ - X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_myself" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - srcdir=$ac_confdir - if test ! -r "$srcdir/$ac_unique_file"; then - srcdir=.. - fi -else - ac_srcdir_defaulted=no -fi -if test ! -r "$srcdir/$ac_unique_file"; then - test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." - { $as_echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 - { (exit 1); exit 1; }; } -fi -ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" -ac_abs_confdir=`( - cd "$srcdir" && test -r "./$ac_unique_file" || { $as_echo "$as_me: error: $ac_msg" >&2 - { (exit 1); exit 1; }; } - pwd)` -# When building in place, set srcdir=. -if test "$ac_abs_confdir" = "$ac_pwd"; then - srcdir=. -fi -# Remove unnecessary trailing slashes from srcdir. -# Double slashes in file names in object file debugging info -# mess up M-x gdb in Emacs. -case $srcdir in -*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; -esac -for ac_var in $ac_precious_vars; do - eval ac_env_${ac_var}_set=\${${ac_var}+set} - eval ac_env_${ac_var}_value=\$${ac_var} - eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} - eval ac_cv_env_${ac_var}_value=\$${ac_var} -done - -# -# Report the --help message. -# -if test "$ac_init_help" = "long"; then - # Omit some internal or obsolete options to make the list less imposing. - # This message is too long to be a string in the A/UX 3.1 sh. - cat <<_ACEOF -\`configure' configures MinGW Runtime v3.x to adapt to many kinds of systems. - -Usage: $0 [OPTION]... [VAR=VALUE]... - -To assign environment variables (e.g., CC, CFLAGS...), specify them as -VAR=VALUE. See below for descriptions of some of the useful variables. - -Defaults for the options are specified in brackets. - -Configuration: - -h, --help display this help and exit - --help=short display options specific to this package - --help=recursive display the short help of all the included packages - -V, --version display version information and exit - -q, --quiet, --silent do not print \`checking...' messages - --cache-file=FILE cache test results in FILE [disabled] - -C, --config-cache alias for \`--cache-file=config.cache' - -n, --no-create do not create output files - --srcdir=DIR find the sources in DIR [configure dir or \`..'] - -Installation directories: - --prefix=PREFIX install architecture-independent files in PREFIX - [$ac_default_prefix] - --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX - [PREFIX] - -By default, \`make install' will install all the files in -\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify -an installation prefix other than \`$ac_default_prefix' using \`--prefix', -for instance \`--prefix=\$HOME'. - -For better control, use the options below. - -Fine tuning of the installation directories: - --bindir=DIR user executables [EPREFIX/bin] - --sbindir=DIR system admin executables [EPREFIX/sbin] - --libexecdir=DIR program executables [EPREFIX/libexec] - --sysconfdir=DIR read-only single-machine data [PREFIX/etc] - --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] - --localstatedir=DIR modifiable single-machine data [PREFIX/var] - --libdir=DIR object code libraries [EPREFIX/lib] - --includedir=DIR C header files [PREFIX/include] - --oldincludedir=DIR C header files for non-gcc [/usr/include] - --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] - --datadir=DIR read-only architecture-independent data [DATAROOTDIR] - --infodir=DIR info documentation [DATAROOTDIR/info] - --localedir=DIR locale-dependent data [DATAROOTDIR/locale] - --mandir=DIR man documentation [DATAROOTDIR/man] - --docdir=DIR documentation root [DATAROOTDIR/doc/mingwrt] - --htmldir=DIR html documentation [DOCDIR] - --dvidir=DIR dvi documentation [DOCDIR] - --pdfdir=DIR pdf documentation [DOCDIR] - --psdir=DIR ps documentation [DOCDIR] -_ACEOF - - cat <<\_ACEOF - -System types: - --build=BUILD configure for building on BUILD [guessed] - --host=HOST cross-compile to build programs to run on HOST [BUILD] - --target=TARGET configure for building compilers for TARGET [HOST] -_ACEOF -fi - -if test -n "$ac_init_help"; then - case $ac_init_help in - short | recursive ) echo "Configuration of MinGW Runtime v3.x:";; - esac - cat <<\_ACEOF - -Optional Features: - --disable-option-checking ignore unrecognized --enable/--with options - --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) - --enable-FEATURE[=ARG] include FEATURE [ARG=yes] - --enable-mingw-manpage-transform[=SED-SCRIPT] - apply SED-SCRIPT [s/^/mingw-/] to installed manpage - names - --disable-mingw-manpage-transform - [DEFAULT] don't transform installed manpage names - -Some influential environment variables: - CC C compiler command - CFLAGS C compiler flags - LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a - nonstandard directory <lib dir> - LIBS libraries to pass to the linker, e.g. -l<library> - CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I<include dir> if - you have headers in a nonstandard directory <include dir> - -Use these variables to override the choices made by `configure' or to help -it to find libraries and programs with nonstandard names/locations. - -Report bugs to <http://mingw.org/reporting_bugs>. -_ACEOF -ac_status=$? -fi - -if test "$ac_init_help" = "recursive"; then - # If there are subdirs, report their specific --help. - for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue - test -d "$ac_dir" || - { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || - continue - ac_builddir=. - -case "$ac_dir" in -.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; -*) - ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` - # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` - case $ac_top_builddir_sub in - "") ac_top_builddir_sub=. ac_top_build_prefix= ;; - *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; - esac ;; -esac -ac_abs_top_builddir=$ac_pwd -ac_abs_builddir=$ac_pwd$ac_dir_suffix -# for backward compatibility: -ac_top_builddir=$ac_top_build_prefix - -case $srcdir in - .) # We are building in place. - ac_srcdir=. - ac_top_srcdir=$ac_top_builddir_sub - ac_abs_top_srcdir=$ac_pwd ;; - [\\/]* | ?:[\\/]* ) # Absolute name. - ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir - ac_abs_top_srcdir=$srcdir ;; - *) # Relative name. - ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_build_prefix$srcdir - ac_abs_top_srcdir=$ac_pwd/$srcdir ;; -esac -ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix - - cd "$ac_dir" || { ac_status=$?; continue; } - # Check for guested configure. - if test -f "$ac_srcdir/configure.gnu"; then - echo && - $SHELL "$ac_srcdir/configure.gnu" --help=recursive - elif test -f "$ac_srcdir/configure"; then - echo && - $SHELL "$ac_srcdir/configure" --help=recursive - else - $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 - fi || ac_status=$? - cd "$ac_pwd" || { ac_status=$?; break; } - done -fi - -test -n "$ac_init_help" && exit $ac_status -if $ac_init_version; then - cat <<\_ACEOF -MinGW Runtime configure v3.x -generated by GNU Autoconf 2.63 - -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. -This configure script is free software; the Free Software Foundation -gives unlimited permission to copy, distribute and modify it. -_ACEOF - exit -fi -cat >config.log <<_ACEOF -This file contains any messages produced by compilers while -running configure, to aid debugging if configure makes a mistake. - -It was created by MinGW Runtime $as_me v3.x, which was -generated by GNU Autoconf 2.63. Invocation command line was - - $ $0 $@ - -_ACEOF -exec 5>>config.log -{ -cat <<_ASUNAME -## --------- ## -## Platform. ## -## --------- ## - -hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` -uname -m = `(uname -m) 2>/dev/null || echo unknown` -uname -r = `(uname -r) 2>/dev/null || echo unknown` -uname -s = `(uname -s) 2>/dev/null || echo unknown` -uname -v = `(uname -v) 2>/dev/null || echo unknown` - -/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` -/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` - -/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` -/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` -/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` -/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` -/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` -/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` -/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` - -_ASUNAME - -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - $as_echo "PATH: $as_dir" -done -IFS=$as_save_IFS - -} >&5 - -cat >&5 <<_ACEOF - - -## ----------- ## -## Core tests. ## -## ----------- ## - -_ACEOF - - -# Keep a trace of the command line. -# Strip out --no-create and --no-recursion so they do not pile up. -# Strip out --silent because we don't want to record it for future runs. -# Also quote any args containing shell meta-characters. -# Make two passes to allow for proper duplicate-argument suppression. -ac_configure_args= -ac_configure_args0= -ac_configure_args1= -ac_must_keep_next=false -for ac_pass in 1 2 -do - for ac_arg - do - case $ac_arg in - -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil) - continue ;; - *\'*) - ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; - esac - case $ac_pass in - 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; - 2) - ac_configure_args1="$ac_configure_args1 '$ac_arg'" - if test $ac_must_keep_next = true; then - ac_must_keep_next=false # Got value, back to normal. - else - case $ac_arg in - *=* | --config-cache | -C | -disable-* | --disable-* \ - | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ - | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ - | -with-* | --with-* | -without-* | --without-* | --x) - case "$ac_configure_args0 " in - "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; - esac - ;; - -* ) ac_must_keep_next=true ;; - esac - fi - ac_configure_args="$ac_configure_args '$ac_arg'" - ;; - esac - done -done -$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } -$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } - -# When interrupted or exit'd, cleanup temporary files, and complete -# config.log. We remove comments because anyway the quotes in there -# would cause problems or look ugly. -# WARNING: Use '\'' to represent an apostrophe within the trap. -# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. -trap 'exit_status=$? - # Save into config.log some information that might help in debugging. - { - echo - - cat <<\_ASBOX -## ---------------- ## -## Cache variables. ## -## ---------------- ## -_ASBOX - echo - # The following way of writing the cache mishandles newlines in values, -( - for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do - eval ac_val=\$$ac_var - case $ac_val in #( - *${as_nl}*) - case $ac_var in #( - *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5 -$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; - esac - case $ac_var in #( - _ | IFS | as_nl) ;; #( - BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( - *) $as_unset $ac_var ;; - esac ;; - esac - done - (set) 2>&1 | - case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( - *${as_nl}ac_space=\ *) - sed -n \ - "s/'\''/'\''\\\\'\'''\''/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" - ;; #( - *) - sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" - ;; - esac | - sort -) - echo - - cat <<\_ASBOX -## ----------------- ## -## Output variables. ## -## ----------------- ## -_ASBOX - echo - for ac_var in $ac_subst_vars - do - eval ac_val=\$$ac_var - case $ac_val in - *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; - esac - $as_echo "$ac_var='\''$ac_val'\''" - done | sort - echo - - if test -n "$ac_subst_files"; then - cat <<\_ASBOX -## ------------------- ## -## File substitutions. ## -## ------------------- ## -_ASBOX - echo - for ac_var in $ac_subst_files - do - eval ac_val=\$$ac_var - case $ac_val in - *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; - esac - $as_echo "$ac_var='\''$ac_val'\''" - done | sort - echo - fi - - if test -s confdefs.h; then - cat <<\_ASBOX -## ----------- ## -## confdefs.h. ## -## ----------- ## -_ASBOX - echo - cat confdefs.h - echo - fi - test "$ac_signal" != 0 && - $as_echo "$as_me: caught signal $ac_signal" - $as_echo "$as_me: exit $exit_status" - } >&5 - rm -f core *.core core.conftest.* && - rm -f -r conftest* confdefs* conf$$* $ac_clean_files && - exit $exit_status -' 0 -for ac_signal in 1 2 13 15; do - trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal -done -ac_signal=0 - -# confdefs.h avoids OS command line length limits that DEFS can exceed. -rm -f -r conftest* confdefs.h - -# Predefined preprocessor variables. - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_NAME "$PACKAGE_NAME" -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_TARNAME "$PACKAGE_TARNAME" -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_VERSION "$PACKAGE_VERSION" -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_STRING "$PACKAGE_STRING" -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" -_ACEOF - - -# Let the site file select an alternate cache file if it wants to. -# Prefer an explicitly selected file to automatically selected ones. -ac_site_file1=NONE -ac_site_file2=NONE -if test -n "$CONFIG_SITE"; then - ac_site_file1=$CONFIG_SITE -elif test "x$prefix" != xNONE; then - ac_site_file1=$prefix/share/config.site - ac_site_file2=$prefix/etc/config.site -else - ac_site_file1=$ac_default_prefix/share/config.site - ac_site_file2=$ac_default_prefix/etc/config.site -fi -for ac_site_file in "$ac_site_file1" "$ac_site_file2" -do - test "x$ac_site_file" = xNONE && continue - if test -r "$ac_site_file"; then - { $as_echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 -$as_echo "$as_me: loading site script $ac_site_file" >&6;} - sed 's/^/| /' "$ac_site_file" >&5 - . "$ac_site_file" - fi -done - -if test -r "$cache_file"; then - # Some versions of bash will fail to source /dev/null (special - # files actually), so we avoid doing that. - if test -f "$cache_file"; then - { $as_echo "$as_me:$LINENO: loading cache $cache_file" >&5 -$as_echo "$as_me: loading cache $cache_file" >&6;} - case $cache_file in - [\\/]* | ?:[\\/]* ) . "$cache_file";; - *) . "./$cache_file";; - esac - fi -else - { $as_echo "$as_me:$LINENO: creating cache $cache_file" >&5 -$as_echo "$as_me: creating cache $cache_file" >&6;} - >$cache_file -fi - -# Check that the precious variables saved in the cache have kept the same -# value. -ac_cache_corrupted=false -for ac_var in $ac_precious_vars; do - eval ac_old_set=\$ac_cv_env_${ac_var}_set - eval ac_new_set=\$ac_env_${ac_var}_set - eval ac_old_val=\$ac_cv_env_${ac_var}_value - eval ac_new_val=\$ac_env_${ac_var}_value - case $ac_old_set,$ac_new_set in - set,) - { $as_echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 -$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,set) - { $as_echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 -$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,);; - *) - if test "x$ac_old_val" != "x$ac_new_val"; then - # differences in whitespace do not lead to failure. - ac_old_val_w=`echo x $ac_old_val` - ac_new_val_w=`echo x $ac_new_val` - if test "$ac_old_val_w" != "$ac_new_val_w"; then - { $as_echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 -$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} - ac_cache_corrupted=: - else - { $as_echo "$as_me:$LINENO: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 -$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} - eval $ac_var=\$ac_old_val - fi - { $as_echo "$as_me:$LINENO: former value: \`$ac_old_val'" >&5 -$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} - { $as_echo "$as_me:$LINENO: current value: \`$ac_new_val'" >&5 -$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} - fi;; - esac - # Pass precious variables to config.status. - if test "$ac_new_set" = set; then - case $ac_new_val in - *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; - *) ac_arg=$ac_var=$ac_new_val ;; - esac - case " $ac_configure_args " in - *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. - *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; - esac - fi -done -if $ac_cache_corrupted; then - { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} - { $as_echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 -$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} - { { $as_echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 -$as_echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} - { (exit 1); exit 1; }; } -fi - - - - - - - - - - - - - - - - - - - - - - - - - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - - - { $as_echo "$as_me:$LINENO: checking package version" >&5 -$as_echo_n "checking package version... " >&6; } - PACKAGE_VERSION=`awk '$2 == "'"__MINGW32_VERSION"'" { print $3 }' ${srcdir}/include/_mingw.h` - { $as_echo "$as_me:$LINENO: result: $PACKAGE_VERSION" >&5 -$as_echo "$PACKAGE_VERSION" >&6; } - -ac_aux_dir= -for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do - if test -f "$ac_dir/install-sh"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install-sh -c" - break - elif test -f "$ac_dir/install.sh"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install.sh -c" - break - elif test -f "$ac_dir/shtool"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/shtool install -c" - break - fi -done -if test -z "$ac_aux_dir"; then - { { $as_echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5 -$as_echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;} - { (exit 1); exit 1; }; } -fi - -# These three variables are undocumented and unsupported, -# and are intended to be withdrawn in a future Autoconf release. -# They can cause serious problems if a builder's source tree is in a directory -# whose full name contains unusual characters. -ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. -ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. -ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. - - -# Make sure we can run config.sub. -$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || - { { $as_echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5 -$as_echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;} - { (exit 1); exit 1; }; } - -{ $as_echo "$as_me:$LINENO: checking build system type" >&5 -$as_echo_n "checking build system type... " >&6; } -if test "${ac_cv_build+set}" = set; then - $as_echo_n "(cached) " >&6 -else - ac_build_alias=$build_alias -test "x$ac_build_alias" = x && - ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` -test "x$ac_build_alias" = x && - { { $as_echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 -$as_echo "$as_me: error: cannot guess build type; you must specify one" >&2;} - { (exit 1); exit 1; }; } -ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || - { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5 -$as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;} - { (exit 1); exit 1; }; } - -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_build" >&5 -$as_echo "$ac_cv_build" >&6; } -case $ac_cv_build in -*-*-*) ;; -*) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical build" >&5 -$as_echo "$as_me: error: invalid value of canonical build" >&2;} - { (exit 1); exit 1; }; };; -esac -build=$ac_cv_build -ac_save_IFS=$IFS; IFS='-' -set x $ac_cv_build -shift -build_cpu=$1 -build_vendor=$2 -shift; shift -# Remember, the first character of IFS is used to create $*, -# except with old shells: -build_os=$* -IFS=$ac_save_IFS -case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac - - -{ $as_echo "$as_me:$LINENO: checking host system type" >&5 -$as_echo_n "checking host system type... " >&6; } -if test "${ac_cv_host+set}" = set; then - $as_echo_n "(cached) " >&6 -else - if test "x$host_alias" = x; then - ac_cv_host=$ac_cv_build -else - ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || - { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5 -$as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;} - { (exit 1); exit 1; }; } -fi - -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_host" >&5 -$as_echo "$ac_cv_host" >&6; } -case $ac_cv_host in -*-*-*) ;; -*) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical host" >&5 -$as_echo "$as_me: error: invalid value of canonical host" >&2;} - { (exit 1); exit 1; }; };; -esac -host=$ac_cv_host -ac_save_IFS=$IFS; IFS='-' -set x $ac_cv_host -shift -host_cpu=$1 -host_vendor=$2 -shift; shift -# Remember, the first character of IFS is used to create $*, -# except with old shells: -host_os=$* -IFS=$ac_save_IFS -case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac - - -{ $as_echo "$as_me:$LINENO: checking target system type" >&5 -$as_echo_n "checking target system type... " >&6; } -if test "${ac_cv_target+set}" = set; then - $as_echo_n "(cached) " >&6 -else - if test "x$target_alias" = x; then - ac_cv_target=$ac_cv_host -else - ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` || - { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $target_alias failed" >&5 -$as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $target_alias failed" >&2;} - { (exit 1); exit 1; }; } -fi - -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_target" >&5 -$as_echo "$ac_cv_target" >&6; } -case $ac_cv_target in -*-*-*) ;; -*) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical target" >&5 -$as_echo "$as_me: error: invalid value of canonical target" >&2;} - { (exit 1); exit 1; }; };; -esac -target=$ac_cv_target -ac_save_IFS=$IFS; IFS='-' -set x $ac_cv_target -shift -target_cpu=$1 -target_vendor=$2 -shift; shift -# Remember, the first character of IFS is used to create $*, -# except with old shells: -target_os=$* -IFS=$ac_save_IFS -case $target_os in *\ *) target_os=`echo "$target_os" | sed 's/ /-/g'`;; esac - - -# The aliases save the names the user supplied, while $host etc. -# will get canonicalized. -test -n "$target_alias" && - test "$program_prefix$program_suffix$program_transform_name" = \ - NONENONEs,x,x, && - program_prefix=${target_alias}- - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. -set dummy ${ac_tool_prefix}gcc; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC+set}" = set; then - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_CC="${ac_tool_prefix}gcc" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:$LINENO: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_CC"; then - ac_ct_CC=$CC - # Extract the first word of "gcc", so it can be a program name with args. -set dummy gcc; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_CC="gcc" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -$as_echo "$ac_ct_CC" >&6; } -else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_CC" = x; then - CC="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - CC=$ac_ct_CC - fi -else - CC="$ac_cv_prog_CC" -fi - -if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. -set dummy ${ac_tool_prefix}cc; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC+set}" = set; then - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_CC="${ac_tool_prefix}cc" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:$LINENO: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } -fi - - - fi -fi -if test -z "$CC"; then - # Extract the first word of "cc", so it can be a program name with args. -set dummy cc; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC+set}" = set; then - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else - ac_prog_rejected=no -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then - ac_prog_rejected=yes - continue - fi - ac_cv_prog_CC="cc" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -if test $ac_prog_rejected = yes; then - # We found a bogon in the path, so make sure we never use it. - set dummy $ac_cv_prog_CC - shift - if test $# != 0; then - # We chose a different compiler from the bogus one. - # However, it has the same basename, so the bogon will be chosen - # first if we set CC to just the basename; use the full file name. - shift - ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" - fi -fi -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:$LINENO: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - for ac_prog in cl.exe - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC+set}" = set; then - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_CC="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:$LINENO: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$CC" && break - done -fi -if test -z "$CC"; then - ac_ct_CC=$CC - for ac_prog in cl.exe -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_CC="$ac_prog" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -$as_echo "$ac_ct_CC" >&6; } -else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$ac_ct_CC" && break -done - - if test "x$ac_ct_CC" = x; then - CC="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - CC=$ac_ct_CC - fi -fi - -fi - - -test -z "$CC" && { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH -See \`config.log' for more details." >&5 -$as_echo "$as_me: error: no acceptable C compiler found in \$PATH -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; }; } - -# Provide some information about the compiler. -$as_echo "$as_me:$LINENO: checking for C compiler version" >&5 -set X $ac_compile -ac_compiler=$2 -{ (ac_try="$ac_compiler --version >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compiler --version >&5") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -{ (ac_try="$ac_compiler -v >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compiler -v >&5") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -{ (ac_try="$ac_compiler -V >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compiler -V >&5") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } - -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -# FIXME: Cleanup? -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - gcc_no_link=no -else - gcc_no_link=yes -fi - -if test x$gcc_no_link = xyes; then - # Setting cross_compile will disable run tests; it will - # also disable AC_CHECK_FILE but that's generally - # correct if we can't link. - cross_compiling=yes - EXEEXT= -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" -# Try to create an executable without -o first, disregard a.out. -# It will help us diagnose broken compilers, and finding out an intuition -# of exeext. -{ $as_echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 -$as_echo_n "checking for C compiler default output file name... " >&6; } -ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` - -# The possible output files: -ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" - -ac_rmfiles= -for ac_file in $ac_files -do - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; - * ) ac_rmfiles="$ac_rmfiles $ac_file";; - esac -done -rm -f $ac_rmfiles - -if { (ac_try="$ac_link_default" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link_default") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. -# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' -# in a Makefile. We should not override ac_cv_exeext if it was cached, -# so that the user can short-circuit this test for compilers unknown to -# Autoconf. -for ac_file in $ac_files '' -do - test -f "$ac_file" || continue - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) - ;; - [ab].out ) - # We found the default executable, but exeext='' is most - # certainly right. - break;; - *.* ) - if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; - then :; else - ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - fi - # We set ac_cv_exeext here because the later test for it is not - # safe: cross compilers may not add the suffix if given an `-o' - # argument, so we may need to know it at that point already. - # Even if this section looks crufty: it has the advantage of - # actually working. - break;; - * ) - break;; - esac -done -test "$ac_cv_exeext" = no && ac_cv_exeext= - -else - ac_file='' -fi - -{ $as_echo "$as_me:$LINENO: result: $ac_file" >&5 -$as_echo "$ac_file" >&6; } -if test -z "$ac_file"; then - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: C compiler cannot create executables -See \`config.log' for more details." >&5 -$as_echo "$as_me: error: C compiler cannot create executables -See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; }; } -fi - -ac_exeext=$ac_cv_exeext - -# Check that the compiler produces executables we can run. If not, either -# the compiler is broken, or we cross compile. -{ $as_echo "$as_me:$LINENO: checking whether the C compiler works" >&5 -$as_echo_n "checking whether the C compiler works... " >&6; } -# FIXME: These cross compiler hacks should be removed for Autoconf 3.0 -# If not cross compiling, check that we can run a simple program. -if test "$cross_compiling" != yes; then - if { ac_try='./$ac_file' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - cross_compiling=no - else - if test "$cross_compiling" = maybe; then - cross_compiling=yes - else - { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: cannot run C compiled programs. -If you meant to cross compile, use \`--host'. -See \`config.log' for more details." >&5 -$as_echo "$as_me: error: cannot run C compiled programs. -If you meant to cross compile, use \`--host'. -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; }; } - fi - fi -fi -{ $as_echo "$as_me:$LINENO: result: yes" >&5 -$as_echo "yes" >&6; } - -rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out -ac_clean_files=$ac_clean_files_save -# Check that the compiler produces executables we can run. If not, either -# the compiler is broken, or we cross compile. -{ $as_echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 -$as_echo_n "checking whether we are cross compiling... " >&6; } -{ $as_echo "$as_me:$LINENO: result: $cross_compiling" >&5 -$as_echo "$cross_compiling" >&6; } - -{ $as_echo "$as_me:$LINENO: checking for suffix of executables" >&5 -$as_echo_n "checking for suffix of executables... " >&6; } -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - # If both `conftest.exe' and `conftest' are `present' (well, observable) -# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will -# work properly (i.e., refer to `conftest.exe'), while it won't with -# `rm'. -for ac_file in conftest.exe conftest conftest.*; do - test -f "$ac_file" || continue - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; - *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - break;; - * ) break;; - esac -done -else - { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details." >&5 -$as_echo "$as_me: error: cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; }; } -fi - -rm -f conftest$ac_cv_exeext -{ $as_echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 -$as_echo "$ac_cv_exeext" >&6; } - -rm -f conftest.$ac_ext -EXEEXT=$ac_cv_exeext -ac_exeext=$EXEEXT -fi -{ $as_echo "$as_me:$LINENO: checking for suffix of object files" >&5 -$as_echo_n "checking for suffix of object files... " >&6; } -if test "${ac_cv_objext+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.o conftest.obj -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - for ac_file in conftest.o conftest.obj conftest.*; do - test -f "$ac_file" || continue; - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; - *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` - break;; - esac -done -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile -See \`config.log' for more details." >&5 -$as_echo "$as_me: error: cannot compute suffix of object files: cannot compile -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; }; } -fi - -rm -f conftest.$ac_cv_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 -$as_echo "$ac_cv_objext" >&6; } -OBJEXT=$ac_cv_objext -ac_objext=$OBJEXT -{ $as_echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 -$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } -if test "${ac_cv_c_compiler_gnu+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ -#ifndef __GNUC__ - choke me -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_compiler_gnu=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_compiler_gnu=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -ac_cv_c_compiler_gnu=$ac_compiler_gnu - -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 -$as_echo "$ac_cv_c_compiler_gnu" >&6; } -if test $ac_compiler_gnu = yes; then - GCC=yes -else - GCC= -fi -ac_test_CFLAGS=${CFLAGS+set} -ac_save_CFLAGS=$CFLAGS -{ $as_echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 -$as_echo_n "checking whether $CC accepts -g... " >&6; } -if test "${ac_cv_prog_cc_g+set}" = set; then - $as_echo_n "(cached) " >&6 -else - ac_save_c_werror_flag=$ac_c_werror_flag - ac_c_werror_flag=yes - ac_cv_prog_cc_g=no - CFLAGS="-g" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_prog_cc_g=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - CFLAGS="" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - : -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_c_werror_flag=$ac_save_c_werror_flag - CFLAGS="-g" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_prog_cc_g=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_c_werror_flag=$ac_save_c_werror_flag -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 -$as_echo "$ac_cv_prog_cc_g" >&6; } -if test "$ac_test_CFLAGS" = set; then - CFLAGS=$ac_save_CFLAGS -elif test $ac_cv_prog_cc_g = yes; then - if test "$GCC" = yes; then - CFLAGS="-g -O2" - else - CFLAGS="-g" - fi -else - if test "$GCC" = yes; then - CFLAGS="-O2" - else - CFLAGS= - fi -fi -{ $as_echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 -$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } -if test "${ac_cv_prog_cc_c89+set}" = set; then - $as_echo_n "(cached) " >&6 -else - ac_cv_prog_cc_c89=no -ac_save_CC=$CC -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <stdarg.h> -#include <stdio.h> -#include <sys/types.h> -#include <sys/stat.h> -/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ -struct buf { int x; }; -FILE * (*rcsopen) (struct buf *, struct stat *, int); -static char *e (p, i) - char **p; - int i; -{ - return p[i]; -} -static char *f (char * (*g) (char **, int), char **p, ...) -{ - char *s; - va_list v; - va_start (v,p); - s = g (p, va_arg (v,int)); - va_end (v); - return s; -} - -/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has - function prototypes and stuff, but not '\xHH' hex character constants. - These don't provoke an error unfortunately, instead are silently treated - as 'x'. The following induces an error, until -std is added to get - proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an - array size at least. It's necessary to write '\x00'==0 to get something - that's true only with -std. */ -int osf4_cc_array ['\x00' == 0 ? 1 : -1]; - -/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters - inside strings and character constants. */ -#define FOO(x) 'x' -int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; - -int test (int i, double x); -struct s1 {int (*f) (int a);}; -struct s2 {int (*f) (double a);}; -int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); -int argc; -char **argv; -int -main () -{ -return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; - ; - return 0; -} -_ACEOF -for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ - -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" -do - CC="$ac_save_CC $ac_arg" - rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_prog_cc_c89=$ac_arg -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext - test "x$ac_cv_prog_cc_c89" != "xno" && break -done -rm -f conftest.$ac_ext -CC=$ac_save_CC - -fi -# AC_CACHE_VAL -case "x$ac_cv_prog_cc_c89" in - x) - { $as_echo "$as_me:$LINENO: result: none needed" >&5 -$as_echo "none needed" >&6; } ;; - xno) - { $as_echo "$as_me:$LINENO: result: unsupported" >&5 -$as_echo "unsupported" >&6; } ;; - *) - CC="$CC $ac_cv_prog_cc_c89" - { $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 -$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; -esac - - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - -case "$with_cross_host" in - ""|*cygwin*) all_dlls_host='all_dlls_host' - install_dlls_host='install_dlls_host';; -esac - - - - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. -set dummy ${ac_tool_prefix}ar; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_AR+set}" = set; then - $as_echo_n "(cached) " >&6 -else - if test -n "$AR"; then - ac_cv_prog_AR="$AR" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_AR="${ac_tool_prefix}ar" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -AR=$ac_cv_prog_AR -if test -n "$AR"; then - { $as_echo "$as_me:$LINENO: result: $AR" >&5 -$as_echo "$AR" >&6; } -else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_AR"; then - ac_ct_AR=$AR - # Extract the first word of "ar", so it can be a program name with args. -set dummy ar; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_AR+set}" = set; then - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_AR"; then - ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_AR="ar" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -ac_ct_AR=$ac_cv_prog_ac_ct_AR -if test -n "$ac_ct_AR"; then - { $as_echo "$as_me:$LINENO: result: $ac_ct_AR" >&5 -$as_echo "$ac_ct_AR" >&6; } -else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_AR" = x; then - AR="ar" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - AR=$ac_ct_AR - fi -else - AR="$ac_cv_prog_AR" -fi - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args. -set dummy ${ac_tool_prefix}as; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_AS+set}" = set; then - $as_echo_n "(cached) " >&6 -else - if test -n "$AS"; then - ac_cv_prog_AS="$AS" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_AS="${ac_tool_prefix}as" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -AS=$ac_cv_prog_AS -if test -n "$AS"; then - { $as_echo "$as_me:$LINENO: result: $AS" >&5 -$as_echo "$AS" >&6; } -else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_AS"; then - ac_ct_AS=$AS - # Extract the first word of "as", so it can be a program name with args. -set dummy as; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_AS+set}" = set; then - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_AS"; then - ac_cv_prog_ac_ct_AS="$ac_ct_AS" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_AS="as" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -ac_ct_AS=$ac_cv_prog_ac_ct_AS -if test -n "$ac_ct_AS"; then - { $as_echo "$as_me:$LINENO: result: $ac_ct_AS" >&5 -$as_echo "$ac_ct_AS" >&6; } -else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_AS" = x; then - AS="as" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - AS=$ac_ct_AS - fi -else - AS="$ac_cv_prog_AS" -fi - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. -set dummy ${ac_tool_prefix}ranlib; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_RANLIB+set}" = set; then - $as_echo_n "(cached) " >&6 -else - if test -n "$RANLIB"; then - ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -RANLIB=$ac_cv_prog_RANLIB -if test -n "$RANLIB"; then - { $as_echo "$as_me:$LINENO: result: $RANLIB" >&5 -$as_echo "$RANLIB" >&6; } -else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_RANLIB"; then - ac_ct_RANLIB=$RANLIB - # Extract the first word of "ranlib", so it can be a program name with args. -set dummy ranlib; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_RANLIB"; then - ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_RANLIB="ranlib" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB -if test -n "$ac_ct_RANLIB"; then - { $as_echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 -$as_echo "$ac_ct_RANLIB" >&6; } -else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_RANLIB" = x; then - RANLIB="ranlib" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - RANLIB=$ac_ct_RANLIB - fi -else - RANLIB="$ac_cv_prog_RANLIB" -fi - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}ld", so it can be a program name with args. -set dummy ${ac_tool_prefix}ld; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_LD+set}" = set; then - $as_echo_n "(cached) " >&6 -else - if test -n "$LD"; then - ac_cv_prog_LD="$LD" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_LD="${ac_tool_prefix}ld" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -LD=$ac_cv_prog_LD -if test -n "$LD"; then - { $as_echo "$as_me:$LINENO: result: $LD" >&5 -$as_echo "$LD" >&6; } -else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_LD"; then - ac_ct_LD=$LD - # Extract the first word of "ld", so it can be a program name with args. -set dummy ld; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_LD+set}" = set; then - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_LD"; then - ac_cv_prog_ac_ct_LD="$ac_ct_LD" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_LD="ld" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -ac_ct_LD=$ac_cv_prog_ac_ct_LD -if test -n "$ac_ct_LD"; then - { $as_echo "$as_me:$LINENO: result: $ac_ct_LD" >&5 -$as_echo "$ac_ct_LD" >&6; } -else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_LD" = x; then - LD="ld" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - LD=$ac_ct_LD - fi -else - LD="$ac_cv_prog_LD" -fi - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}nm", so it can be a program name with args. -set dummy ${ac_tool_prefix}nm; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_NM+set}" = set; then - $as_echo_n "(cached) " >&6 -else - if test -n "$NM"; then - ac_cv_prog_NM="$NM" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_NM="${ac_tool_prefix}nm" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -NM=$ac_cv_prog_NM -if test -n "$NM"; then - { $as_echo "$as_me:$LINENO: result: $NM" >&5 -$as_echo "$NM" >&6; } -else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_NM"; then - ac_ct_NM=$NM - # Extract the first word of "nm", so it can be a program name with args. -set dummy nm; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_NM+set}" = set; then - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_NM"; then - ac_cv_prog_ac_ct_NM="$ac_ct_NM" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_NM="nm" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -ac_ct_NM=$ac_cv_prog_ac_ct_NM -if test -n "$ac_ct_NM"; then - { $as_echo "$as_me:$LINENO: result: $ac_ct_NM" >&5 -$as_echo "$ac_ct_NM" >&6; } -else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_NM" = x; then - NM="nm" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - NM=$ac_ct_NM - fi -else - NM="$ac_cv_prog_NM" -fi - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}objcopy", so it can be a program name with args. -set dummy ${ac_tool_prefix}objcopy; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_OBJCOPY+set}" = set; then - $as_echo_n "(cached) " >&6 -else - if test -n "$OBJCOPY"; then - ac_cv_prog_OBJCOPY="$OBJCOPY" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_OBJCOPY="${ac_tool_prefix}objcopy" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -OBJCOPY=$ac_cv_prog_OBJCOPY -if test -n "$OBJCOPY"; then - { $as_echo "$as_me:$LINENO: result: $OBJCOPY" >&5 -$as_echo "$OBJCOPY" >&6; } -else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_OBJCOPY"; then - ac_ct_OBJCOPY=$OBJCOPY - # Extract the first word of "objcopy", so it can be a program name with args. -set dummy objcopy; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_OBJCOPY+set}" = set; then - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_OBJCOPY"; then - ac_cv_prog_ac_ct_OBJCOPY="$ac_ct_OBJCOPY" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_OBJCOPY="objcopy" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -ac_ct_OBJCOPY=$ac_cv_prog_ac_ct_OBJCOPY -if test -n "$ac_ct_OBJCOPY"; then - { $as_echo "$as_me:$LINENO: result: $ac_ct_OBJCOPY" >&5 -$as_echo "$ac_ct_OBJCOPY" >&6; } -else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_OBJCOPY" = x; then - OBJCOPY="objcopy" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - OBJCOPY=$ac_ct_OBJCOPY - fi -else - OBJCOPY="$ac_cv_prog_OBJCOPY" -fi - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. -set dummy ${ac_tool_prefix}dlltool; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_DLLTOOL+set}" = set; then - $as_echo_n "(cached) " >&6 -else - if test -n "$DLLTOOL"; then - ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -DLLTOOL=$ac_cv_prog_DLLTOOL -if test -n "$DLLTOOL"; then - { $as_echo "$as_me:$LINENO: result: $DLLTOOL" >&5 -$as_echo "$DLLTOOL" >&6; } -else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_DLLTOOL"; then - ac_ct_DLLTOOL=$DLLTOOL - # Extract the first word of "dlltool", so it can be a program name with args. -set dummy dlltool; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_DLLTOOL+set}" = set; then - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_DLLTOOL"; then - ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_DLLTOOL="dlltool" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL -if test -n "$ac_ct_DLLTOOL"; then - { $as_echo "$as_me:$LINENO: result: $ac_ct_DLLTOOL" >&5 -$as_echo "$ac_ct_DLLTOOL" >&6; } -else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_DLLTOOL" = x; then - DLLTOOL="dlltool" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - DLLTOOL=$ac_ct_DLLTOOL - fi -else - DLLTOOL="$ac_cv_prog_DLLTOOL" -fi - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. -set dummy ${ac_tool_prefix}dlltool; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_DLLWRAP+set}" = set; then - $as_echo_n "(cached) " >&6 -else - if test -n "$DLLWRAP"; then - ac_cv_prog_DLLWRAP="$DLLWRAP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_DLLWRAP="${ac_tool_prefix}dlltool" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -DLLWRAP=$ac_cv_prog_DLLWRAP -if test -n "$DLLWRAP"; then - { $as_echo "$as_me:$LINENO: result: $DLLWRAP" >&5 -$as_echo "$DLLWRAP" >&6; } -else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_DLLWRAP"; then - ac_ct_DLLWRAP=$DLLWRAP - # Extract the first word of "dlltool", so it can be a program name with args. -set dummy dlltool; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_DLLWRAP+set}" = set; then - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_DLLWRAP"; then - ac_cv_prog_ac_ct_DLLWRAP="$ac_ct_DLLWRAP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_DLLWRAP="dlltool" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -ac_ct_DLLWRAP=$ac_cv_prog_ac_ct_DLLWRAP -if test -n "$ac_ct_DLLWRAP"; then - { $as_echo "$as_me:$LINENO: result: $ac_ct_DLLWRAP" >&5 -$as_echo "$ac_ct_DLLWRAP" >&6; } -else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_DLLWRAP" = x; then - DLLWRAP="dlltool" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - DLLWRAP=$ac_ct_DLLWRAP - fi -else - DLLWRAP="$ac_cv_prog_DLLWRAP" -fi - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}windres", so it can be a program name with args. -set dummy ${ac_tool_prefix}windres; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_WINDRES+set}" = set; then - $as_echo_n "(cached) " >&6 -else - if test -n "$WINDRES"; then - ac_cv_prog_WINDRES="$WINDRES" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_WINDRES="${ac_tool_prefix}windres" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -WINDRES=$ac_cv_prog_WINDRES -if test -n "$WINDRES"; then - { $as_echo "$as_me:$LINENO: result: $WINDRES" >&5 -$as_echo "$WINDRES" >&6; } -else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_WINDRES"; then - ac_ct_WINDRES=$WINDRES - # Extract the first word of "windres", so it can be a program name with args. -set dummy windres; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_WINDRES+set}" = set; then - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_WINDRES"; then - ac_cv_prog_ac_ct_WINDRES="$ac_ct_WINDRES" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_WINDRES="windres" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -ac_ct_WINDRES=$ac_cv_prog_ac_ct_WINDRES -if test -n "$ac_ct_WINDRES"; then - { $as_echo "$as_me:$LINENO: result: $ac_ct_WINDRES" >&5 -$as_echo "$ac_ct_WINDRES" >&6; } -else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_WINDRES" = x; then - WINDRES="windres" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - WINDRES=$ac_ct_WINDRES - fi -else - WINDRES="$ac_cv_prog_WINDRES" -fi - - - - -subdirs="$subdirs profile mingwex" - -HEADER_SUBDIR="" - -LIBGMON_A=libgmon.a - -W32API_INCLUDE='-I $(srcdir)/../w32api/include' - -case "$target_os" in -*cygwin*) - NO_CYGWIN="$(cd ${srcdir}/../utils; pwd)/mingw" - LIBM_A=libm.a - # Install mingw headers in mingw subdirectory. - HEADER_SUBDIR="mingw" - ;; -*) - # Build it for MSVCRT by default. - NO_CYGWIN= - LIBM_A=libm.a - ;; -esac - -# THREAD_DLL used to be set within the above case and was mingwc for CRTDLL. -# I can find no reason to do this. -# -# FIXME: In the future I would like to change the dll name to mingwthrd to -# to match the libmingwthrd.a name. -THREAD_DLL=mingwm - - -MKINSTALLDIRS=$ac_aux_dir/mkinstalldirs - - - - - - - -# Find a good install program. We prefer a C program (faster), -# so one script is as good as another. But avoid the broken or -# incompatible versions: -# SysV /etc/install, /usr/sbin/install -# SunOS /usr/etc/install -# IRIX /sbin/install -# AIX /bin/install -# AmigaOS /C/install, which installs bootblocks on floppy discs -# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag -# AFS /usr/afsws/bin/install, which mishandles nonexistent args -# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" -# OS/2's system install, which has a completely different semantic -# ./install, which can be erroneously created by make from ./install.sh. -# Reject install programs that cannot install multiple files. -{ $as_echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 -$as_echo_n "checking for a BSD-compatible install... " >&6; } -if test -z "$INSTALL"; then -if test "${ac_cv_path_install+set}" = set; then - $as_echo_n "(cached) " >&6 -else - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - # Account for people who put trailing slashes in PATH elements. -case $as_dir/ in - ./ | .// | /cC/* | \ - /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ - ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ - /usr/ucb/* ) ;; - *) - # OSF1 and SCO ODT 3.0 have their own names for install. - # Don't use installbsd from OSF since it installs stuff as root - # by default. - for ac_prog in ginstall scoinst install; do - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then - if test $ac_prog = install && - grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then - # AIX install. It has an incompatible calling convention. - : - elif test $ac_prog = install && - grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then - # program-specific install script used by HP pwplus--don't use. - : - else - rm -rf conftest.one conftest.two conftest.dir - echo one > conftest.one - echo two > conftest.two - mkdir conftest.dir - if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && - test -s conftest.one && test -s conftest.two && - test -s conftest.dir/conftest.one && - test -s conftest.dir/conftest.two - then - ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" - break 3 - fi - fi - fi - done - done - ;; -esac - -done -IFS=$as_save_IFS - -rm -rf conftest.one conftest.two conftest.dir - -fi - if test "${ac_cv_path_install+set}" = set; then - INSTALL=$ac_cv_path_install - else - # As a last resort, use the slow shell script. Don't cache a - # value for INSTALL within a source directory, because that will - # break other packages using the cache if that directory is - # removed, or if the value is a relative name. - INSTALL=$ac_install_sh - fi -fi -{ $as_echo "$as_me:$LINENO: result: $INSTALL" >&5 -$as_echo "$INSTALL" >&6; } - -# Use test -z because SunOS4 sh mishandles braces in ${var-val}. -# It thinks the first close brace ends the variable substitution. -test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' - -test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' - -test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' - -# Check whether --enable-mingw-manpage-transform was given. -if test "${enable_mingw_manpage_transform+set}" = set; then - enableval=$enable_mingw_manpage_transform; case ${enableval} in - yes) mingw_manpage_transform='s,^,mingw-,' ;; - no) mingw_manpage_transform='s,x,x,' ;; - *) mingw_manpage_transform=${enableval} ;; - esac -fi - - mingw_manpage_transform=${mingw_manpage_transform-'s,x,x,'} - - -ac_config_files="$ac_config_files Makefile" - -cat >confcache <<\_ACEOF -# This file is a shell script that caches the results of configure -# tests run on this system so they can be shared between configure -# scripts and configure runs, see configure's option --config-cache. -# It is not useful on other systems. If it contains results you don't -# want to keep, you may remove or edit it. -# -# config.status only pays attention to the cache file if you give it -# the --recheck option to rerun configure. -# -# `ac_cv_env_foo' variables (set or unset) will be overridden when -# loading this file, other *unset* `ac_cv_foo' will be assigned the -# following values. - -_ACEOF - -# The following way of writing the cache mishandles newlines in values, -# but we know of no workaround that is simple, portable, and efficient. -# So, we kill variables containing newlines. -# Ultrix sh set writes to stderr and can't be redirected directly, -# and sets the high bit in the cache file unless we assign to the vars. -( - for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do - eval ac_val=\$$ac_var - case $ac_val in #( - *${as_nl}*) - case $ac_var in #( - *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5 -$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; - esac - case $ac_var in #( - _ | IFS | as_nl) ;; #( - BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( - *) $as_unset $ac_var ;; - esac ;; - esac - done - - (set) 2>&1 | - case $as_nl`(ac_space=' '; set) 2>&1` in #( - *${as_nl}ac_space=\ *) - # `set' does not quote correctly, so add quotes (double-quote - # substitution turns \\\\ into \\, and sed turns \\ into \). - sed -n \ - "s/'/'\\\\''/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" - ;; #( - *) - # `set' quotes correctly as required by POSIX, so do not add quotes. - sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" - ;; - esac | - sort -) | - sed ' - /^ac_cv_env_/b end - t clear - :clear - s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ - t end - s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ - :end' >>confcache -if diff "$cache_file" confcache >/dev/null 2>&1; then :; else - if test -w "$cache_file"; then - test "x$cache_file" != "x/dev/null" && - { $as_echo "$as_me:$LINENO: updating cache $cache_file" >&5 -$as_echo "$as_me: updating cache $cache_file" >&6;} - cat confcache >$cache_file - else - { $as_echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 -$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} - fi -fi -rm -f confcache - -test "x$prefix" = xNONE && prefix=$ac_default_prefix -# Let make expand exec_prefix. -test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' - -# Transform confdefs.h into DEFS. -# Protect against shell expansion while executing Makefile rules. -# Protect against Makefile macro expansion. -# -# If the first sed substitution is executed (which looks for macros that -# take arguments), then branch to the quote section. Otherwise, -# look for a macro that doesn't take arguments. -ac_script=' -:mline -/\\$/{ - N - s,\\\n,, - b mline -} -t clear -:clear -s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g -t quote -s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g -t quote -b any -:quote -s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g -s/\[/\\&/g -s/\]/\\&/g -s/\$/$$/g -H -:any -${ - g - s/^\n// - s/\n/ /g - p -} -' -DEFS=`sed -n "$ac_script" confdefs.h` - - -ac_libobjs= -ac_ltlibobjs= -for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue - # 1. Remove the extension, and $U if already installed. - ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' - ac_i=`$as_echo "$ac_i" | sed "$ac_script"` - # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR - # will be set to the directory where LIBOBJS objects are built. - ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" - ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' -done -LIBOBJS=$ac_libobjs - -LTLIBOBJS=$ac_ltlibobjs - - - -: ${CONFIG_STATUS=./config.status} -ac_write_fail=0 -ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files $CONFIG_STATUS" -{ $as_echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 -$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} -cat >$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -#! $SHELL -# Generated by $as_me. -# Run this file to recreate the current configuration. -# Compiler output produced by configure, useful for debugging -# configure, is in config.log if it exists. - -debug=false -ac_cs_recheck=false -ac_cs_silent=false -SHELL=\${CONFIG_SHELL-$SHELL} -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -## --------------------- ## -## M4sh Initialization. ## -## --------------------- ## - -# Be more Bourne compatible -DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in - *posix*) set -o posix ;; -esac - -fi - - - - -# PATH needs CR -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits - -as_nl=' -' -export as_nl -# Printing a long string crashes Solaris 7 /usr/bin/printf. -as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo -if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='printf %s\n' - as_echo_n='printf %s' -else - if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then - as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' - as_echo_n='/usr/ucb/echo -n' - else - as_echo_body='eval expr "X$1" : "X\\(.*\\)"' - as_echo_n_body='eval - arg=$1; - case $arg in - *"$as_nl"*) - expr "X$arg" : "X\\(.*\\)$as_nl"; - arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; - esac; - expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" - ' - export as_echo_n_body - as_echo_n='sh -c $as_echo_n_body as_echo' - fi - export as_echo_body - as_echo='sh -c $as_echo_body as_echo' -fi - -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - PATH_SEPARATOR=: - (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { - (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || - PATH_SEPARATOR=';' - } -fi - -# Support unset when possible. -if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then - as_unset=unset -else - as_unset=false -fi - - -# IFS -# We need space, tab and new line, in precisely that order. Quoting is -# there to prevent editors from complaining about space-tab. -# (If _AS_PATH_WALK were called with IFS unset, it would disable word -# splitting by setting IFS to empty value.) -IFS=" "" $as_nl" - -# Find who we are. Look in the path if we contain no directory separator. -case $0 in - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break -done -IFS=$as_save_IFS - - ;; -esac -# We did not find ourselves, most probably we were run as `sh COMMAND' -# in which case we are not to be found in the path. -if test "x$as_myself" = x; then - as_myself=$0 -fi -if test ! -f "$as_myself"; then - $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 - { (exit 1); exit 1; } -fi - -# Work around bugs in pre-3.0 UWIN ksh. -for as_var in ENV MAIL MAILPATH -do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var -done -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -LC_ALL=C -export LC_ALL -LANGUAGE=C -export LANGUAGE - -# Required to use basename. -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi - -if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then - as_basename=basename -else - as_basename=false -fi - - -# Name of the executable. -as_me=`$as_basename -- "$0" || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ - s//\1/ - q - } - /^X\/\(\/\/\)$/{ - s//\1/ - q - } - /^X\/\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - -# CDPATH. -$as_unset CDPATH - - - - as_lineno_1=$LINENO - as_lineno_2=$LINENO - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { - - # Create $as_me.lineno as a copy of $as_myself, but with $LINENO - # uniformly replaced by the line number. The first 'sed' inserts a - # line-number line after each line using $LINENO; the second 'sed' - # does the real work. The second script uses 'N' to pair each - # line-number line with the line containing $LINENO, and appends - # trailing '-' during substitution so that $LINENO is not a special - # case at line end. - # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the - # scripts with optimization help from Paolo Bonzini. Blame Lee - # E. McMahon (1931-1989) for sed's syntax. :-) - sed -n ' - p - /[$]LINENO/= - ' <$as_myself | - sed ' - s/[$]LINENO.*/&-/ - t lineno - b - :lineno - N - :loop - s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ - t loop - s/-\n.*// - ' >$as_me.lineno && - chmod +x "$as_me.lineno" || - { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 - { (exit 1); exit 1; }; } - - # Don't try to exec as it changes $[0], causing all sort of problems - # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensitive to this). - . "./$as_me.lineno" - # Exit status is that of the last command. - exit -} - - -if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then - as_dirname=dirname -else - as_dirname=false -fi - -ECHO_C= ECHO_N= ECHO_T= -case `echo -n x` in --n*) - case `echo 'x\c'` in - *c*) ECHO_T=' ';; # ECHO_T is single tab character. - *) ECHO_C='\c';; - esac;; -*) - ECHO_N='-n';; -esac -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi - -rm -f conf$$ conf$$.exe conf$$.file -if test -d conf$$.dir; then - rm -f conf$$.dir/conf$$.file -else - rm -f conf$$.dir - mkdir conf$$.dir 2>/dev/null -fi -if (echo >conf$$.file) 2>/dev/null; then - if ln -s conf$$.file conf$$ 2>/dev/null; then - as_ln_s='ln -s' - # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -p'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -p' - elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln - else - as_ln_s='cp -p' - fi -else - as_ln_s='cp -p' -fi -rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file -rmdir conf$$.dir 2>/dev/null - -if mkdir -p . 2>/dev/null; then - as_mkdir_p=: -else - test -d ./-p && rmdir ./-p - as_mkdir_p=false -fi - -if test -x / >/dev/null 2>&1; then - as_test_x='test -x' -else - if ls -dL / >/dev/null 2>&1; then - as_ls_L_option=L - else - as_ls_L_option= - fi - as_test_x=' - eval sh -c '\'' - if test -d "$1"; then - test -d "$1/."; - else - case $1 in - -*)set "./$1";; - esac; - case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in - ???[sx]*):;;*)false;;esac;fi - '\'' sh - ' -fi -as_executable_p=$as_test_x - -# Sed expression to map a string onto a valid CPP name. -as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" - -# Sed expression to map a string onto a valid variable name. -as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" - - -exec 6>&1 - -# Save the log message, to keep $[0] and so on meaningful, and to -# report actual input values of CONFIG_FILES etc. instead of their -# values after options handling. -ac_log=" -This file was extended by MinGW Runtime $as_me v3.x, which was -generated by GNU Autoconf 2.63. Invocation command line was - - CONFIG_FILES = $CONFIG_FILES - CONFIG_HEADERS = $CONFIG_HEADERS - CONFIG_LINKS = $CONFIG_LINKS - CONFIG_COMMANDS = $CONFIG_COMMANDS - $ $0 $@ - -on `(hostname || uname -n) 2>/dev/null | sed 1q` -" - -_ACEOF - -case $ac_config_files in *" -"*) set x $ac_config_files; shift; ac_config_files=$*;; -esac - - - -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -# Files that config.status was made for. -config_files="$ac_config_files" - -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -ac_cs_usage="\ -\`$as_me' instantiates files from templates according to the -current configuration. - -Usage: $0 [OPTION]... [FILE]... - - -h, --help print this help, then exit - -V, --version print version number and configuration settings, then exit - -q, --quiet, --silent - do not print progress messages - -d, --debug don't remove temporary files - --recheck update $as_me by reconfiguring in the same conditions - --file=FILE[:TEMPLATE] - instantiate the configuration file FILE - -Configuration files: -$config_files - -Report bugs to <bug-autoconf@gnu.org>." - -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -ac_cs_version="\\ -MinGW Runtime config.status v3.x -configured by $0, generated by GNU Autoconf 2.63, - with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" - -Copyright (C) 2008 Free Software Foundation, Inc. -This config.status script is free software; the Free Software Foundation -gives unlimited permission to copy, distribute and modify it." - -ac_pwd='$ac_pwd' -srcdir='$srcdir' -INSTALL='$INSTALL' -test -n "\$AWK" || AWK=awk -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -# The default lists apply if the user does not specify any file. -ac_need_defaults=: -while test $# != 0 -do - case $1 in - --*=*) - ac_option=`expr "X$1" : 'X\([^=]*\)='` - ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` - ac_shift=: - ;; - *) - ac_option=$1 - ac_optarg=$2 - ac_shift=shift - ;; - esac - - case $ac_option in - # Handling of the options. - -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) - ac_cs_recheck=: ;; - --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) - $as_echo "$ac_cs_version"; exit ;; - --debug | --debu | --deb | --de | --d | -d ) - debug=: ;; - --file | --fil | --fi | --f ) - $ac_shift - case $ac_optarg in - *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; - esac - CONFIG_FILES="$CONFIG_FILES '$ac_optarg'" - ac_need_defaults=false;; - --he | --h | --help | --hel | -h ) - $as_echo "$ac_cs_usage"; exit ;; - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil | --si | --s) - ac_cs_silent=: ;; - - # This is an error. - -*) { $as_echo "$as_me: error: unrecognized option: $1 -Try \`$0 --help' for more information." >&2 - { (exit 1); exit 1; }; } ;; - - *) ac_config_targets="$ac_config_targets $1" - ac_need_defaults=false ;; - - esac - shift -done - -ac_configure_extra_args= - -if $ac_cs_silent; then - exec 6>/dev/null - ac_configure_extra_args="$ac_configure_extra_args --silent" -fi - -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -if \$ac_cs_recheck; then - set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion - shift - \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 - CONFIG_SHELL='$SHELL' - export CONFIG_SHELL - exec "\$@" -fi - -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -exec 5>>config.log -{ - echo - sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX -## Running $as_me. ## -_ASBOX - $as_echo "$ac_log" -} >&5 - -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 - -# Handling of arguments. -for ac_config_target in $ac_config_targets -do - case $ac_config_target in - "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; - - *) { { $as_echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 -$as_echo "$as_me: error: invalid argument: $ac_config_target" >&2;} - { (exit 1); exit 1; }; };; - esac -done - - -# If the user did not use the arguments to specify the items to instantiate, -# then the envvar interface is used. Set only those that are not. -# We use the long form for the default assignment because of an extremely -# bizarre bug on SunOS 4.1.3. -if $ac_need_defaults; then - test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files -fi - -# Have a temporary directory for convenience. Make it in the build tree -# simply because there is no reason against having it here, and in addition, -# creating and moving files from /tmp can sometimes cause problems. -# Hook for its removal unless debugging. -# Note that there is a small window in which the directory will not be cleaned: -# after its creation but before its name has been assigned to `$tmp'. -$debug || -{ - tmp= - trap 'exit_status=$? - { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status -' 0 - trap '{ (exit 1); exit 1; }' 1 2 13 15 -} -# Create a (secure) tmp directory for tmp files. - -{ - tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && - test -n "$tmp" && test -d "$tmp" -} || -{ - tmp=./conf$$-$RANDOM - (umask 077 && mkdir "$tmp") -} || -{ - $as_echo "$as_me: cannot create a temporary directory in ." >&2 - { (exit 1); exit 1; } -} - -# Set up the scripts for CONFIG_FILES section. -# No need to generate them if there are no CONFIG_FILES. -# This happens for instance with `./config.status config.h'. -if test -n "$CONFIG_FILES"; then - - -ac_cr='
' -ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null` -if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then - ac_cs_awk_cr='\\r' -else - ac_cs_awk_cr=$ac_cr -fi - -echo 'BEGIN {' >"$tmp/subs1.awk" && -_ACEOF - - -{ - echo "cat >conf$$subs.awk <<_ACEOF" && - echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && - echo "_ACEOF" -} >conf$$subs.sh || - { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 -$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} - { (exit 1); exit 1; }; } -ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'` -ac_delim='%!_!# ' -for ac_last_try in false false false false false :; do - . ./conf$$subs.sh || - { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 -$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} - { (exit 1); exit 1; }; } - - ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` - if test $ac_delim_n = $ac_delim_num; then - break - elif $ac_last_try; then - { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 -$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} - { (exit 1); exit 1; }; } - else - ac_delim="$ac_delim!$ac_delim _$ac_delim!! " - fi -done -rm -f conf$$subs.sh - -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -cat >>"\$tmp/subs1.awk" <<\\_ACAWK && -_ACEOF -sed -n ' -h -s/^/S["/; s/!.*/"]=/ -p -g -s/^[^!]*!// -:repl -t repl -s/'"$ac_delim"'$// -t delim -:nl -h -s/\(.\{148\}\).*/\1/ -t more1 -s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ -p -n -b repl -:more1 -s/["\\]/\\&/g; s/^/"/; s/$/"\\/ -p -g -s/.\{148\}// -t nl -:delim -h -s/\(.\{148\}\).*/\1/ -t more2 -s/["\\]/\\&/g; s/^/"/; s/$/"/ -p -b -:more2 -s/["\\]/\\&/g; s/^/"/; s/$/"\\/ -p -g -s/.\{148\}// -t delim -' <conf$$subs.awk | sed ' -/^[^""]/{ - N - s/\n// -} -' >>$CONFIG_STATUS || ac_write_fail=1 -rm -f conf$$subs.awk -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -_ACAWK -cat >>"\$tmp/subs1.awk" <<_ACAWK && - for (key in S) S_is_set[key] = 1 - FS = "" - -} -{ - line = $ 0 - nfields = split(line, field, "@") - substed = 0 - len = length(field[1]) - for (i = 2; i < nfields; i++) { - key = field[i] - keylen = length(key) - if (S_is_set[key]) { - value = S[key] - line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) - len += length(value) + length(field[++i]) - substed = 1 - } else - len += 1 + keylen - } - - print line -} - -_ACAWK -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then - sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" -else - cat -fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \ - || { { $as_echo "$as_me:$LINENO: error: could not setup config files machinery" >&5 -$as_echo "$as_me: error: could not setup config files machinery" >&2;} - { (exit 1); exit 1; }; } -_ACEOF - -# VPATH may cause trouble with some makes, so we remove $(srcdir), -# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and -# trailing colons and then remove the whole line if VPATH becomes empty -# (actually we leave an empty line to preserve line numbers). -if test "x$srcdir" = x.; then - ac_vpsub='/^[ ]*VPATH[ ]*=/{ -s/:*\$(srcdir):*/:/ -s/:*\${srcdir}:*/:/ -s/:*@srcdir@:*/:/ -s/^\([^=]*=[ ]*\):*/\1/ -s/:*$// -s/^[^=]*=[ ]*$// -}' -fi - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -fi # test -n "$CONFIG_FILES" - - -eval set X " :F $CONFIG_FILES " -shift -for ac_tag -do - case $ac_tag in - :[FHLC]) ac_mode=$ac_tag; continue;; - esac - case $ac_mode$ac_tag in - :[FHL]*:*);; - :L* | :C*:*) { { $as_echo "$as_me:$LINENO: error: invalid tag $ac_tag" >&5 -$as_echo "$as_me: error: invalid tag $ac_tag" >&2;} - { (exit 1); exit 1; }; };; - :[FH]-) ac_tag=-:-;; - :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; - esac - ac_save_IFS=$IFS - IFS=: - set x $ac_tag - IFS=$ac_save_IFS - shift - ac_file=$1 - shift - - case $ac_mode in - :L) ac_source=$1;; - :[FH]) - ac_file_inputs= - for ac_f - do - case $ac_f in - -) ac_f="$tmp/stdin";; - *) # Look for the file first in the build tree, then in the source tree - # (if the path is not absolute). The absolute path cannot be DOS-style, - # because $ac_f cannot contain `:'. - test -f "$ac_f" || - case $ac_f in - [\\/$]*) false;; - *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; - esac || - { { $as_echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 -$as_echo "$as_me: error: cannot find input file: $ac_f" >&2;} - { (exit 1); exit 1; }; };; - esac - case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac - ac_file_inputs="$ac_file_inputs '$ac_f'" - done - - # Let's still pretend it is `configure' which instantiates (i.e., don't - # use $as_me), people would be surprised to read: - # /* config.h. Generated by config.status. */ - configure_input='Generated from '` - $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' - `' by configure.' - if test x"$ac_file" != x-; then - configure_input="$ac_file. $configure_input" - { $as_echo "$as_me:$LINENO: creating $ac_file" >&5 -$as_echo "$as_me: creating $ac_file" >&6;} - fi - # Neutralize special characters interpreted by sed in replacement strings. - case $configure_input in #( - *\&* | *\|* | *\\* ) - ac_sed_conf_input=`$as_echo "$configure_input" | - sed 's/[\\\\&|]/\\\\&/g'`;; #( - *) ac_sed_conf_input=$configure_input;; - esac - - case $ac_tag in - *:-:* | *:-) cat >"$tmp/stdin" \ - || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 -$as_echo "$as_me: error: could not create $ac_file" >&2;} - { (exit 1); exit 1; }; } ;; - esac - ;; - esac - - ac_dir=`$as_dirname -- "$ac_file" || -$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$ac_file" : 'X\(//\)[^/]' \| \ - X"$ac_file" : 'X\(//\)$' \| \ - X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$ac_file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - { as_dir="$ac_dir" - case $as_dir in #( - -*) as_dir=./$as_dir;; - esac - test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { - as_dirs= - while :; do - case $as_dir in #( - *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( - *) as_qdir=$as_dir;; - esac - as_dirs="'$as_qdir' $as_dirs" - as_dir=`$as_dirname -- "$as_dir" || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - test -d "$as_dir" && break - done - test -z "$as_dirs" || eval "mkdir $as_dirs" - } || test -d "$as_dir" || { { $as_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 -$as_echo "$as_me: error: cannot create directory $as_dir" >&2;} - { (exit 1); exit 1; }; }; } - ac_builddir=. - -case "$ac_dir" in -.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; -*) - ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` - # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` - case $ac_top_builddir_sub in - "") ac_top_builddir_sub=. ac_top_build_prefix= ;; - *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; - esac ;; -esac -ac_abs_top_builddir=$ac_pwd -ac_abs_builddir=$ac_pwd$ac_dir_suffix -# for backward compatibility: -ac_top_builddir=$ac_top_build_prefix - -case $srcdir in - .) # We are building in place. - ac_srcdir=. - ac_top_srcdir=$ac_top_builddir_sub - ac_abs_top_srcdir=$ac_pwd ;; - [\\/]* | ?:[\\/]* ) # Absolute name. - ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir - ac_abs_top_srcdir=$srcdir ;; - *) # Relative name. - ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_build_prefix$srcdir - ac_abs_top_srcdir=$ac_pwd/$srcdir ;; -esac -ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix - - - case $ac_mode in - :F) - # - # CONFIG_FILE - # - - case $INSTALL in - [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; - *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; - esac -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -# If the template does not know about datarootdir, expand it. -# FIXME: This hack should be removed a few years after 2.60. -ac_datarootdir_hack=; ac_datarootdir_seen= - -ac_sed_dataroot=' -/datarootdir/ { - p - q -} -/@datadir@/p -/@docdir@/p -/@infodir@/p -/@localedir@/p -/@mandir@/p -' -case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in -*datarootdir*) ac_datarootdir_seen=yes;; -*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) - { $as_echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 -$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 - ac_datarootdir_hack=' - s&@datadir@&$datadir&g - s&@docdir@&$docdir&g - s&@infodir@&$infodir&g - s&@localedir@&$localedir&g - s&@mandir@&$mandir&g - s&\\\${datarootdir}&$datarootdir&g' ;; -esac -_ACEOF - -# Neutralize VPATH when `$srcdir' = `.'. -# Shell code in configure.ac might set extrasub. -# FIXME: do we really want to maintain this feature? -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -ac_sed_extra="$ac_vpsub -$extrasub -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -:t -/@[a-zA-Z_][a-zA-Z_0-9]*@/!b -s|@configure_input@|$ac_sed_conf_input|;t t -s&@top_builddir@&$ac_top_builddir_sub&;t t -s&@top_build_prefix@&$ac_top_build_prefix&;t t -s&@srcdir@&$ac_srcdir&;t t -s&@abs_srcdir@&$ac_abs_srcdir&;t t -s&@top_srcdir@&$ac_top_srcdir&;t t -s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t -s&@builddir@&$ac_builddir&;t t -s&@abs_builddir@&$ac_abs_builddir&;t t -s&@abs_top_builddir@&$ac_abs_top_builddir&;t t -s&@INSTALL@&$ac_INSTALL&;t t -$ac_datarootdir_hack -" -eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \ - || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 -$as_echo "$as_me: error: could not create $ac_file" >&2;} - { (exit 1); exit 1; }; } - -test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && - { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && - { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && - { $as_echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' -which seems to be undefined. Please make sure it is defined." >&5 -$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' -which seems to be undefined. Please make sure it is defined." >&2;} - - rm -f "$tmp/stdin" - case $ac_file in - -) cat "$tmp/out" && rm -f "$tmp/out";; - *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";; - esac \ - || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 -$as_echo "$as_me: error: could not create $ac_file" >&2;} - { (exit 1); exit 1; }; } - ;; - - - - esac - -done # for ac_tag - - -{ (exit 0); exit 0; } -_ACEOF -chmod +x $CONFIG_STATUS -ac_clean_files=$ac_clean_files_save - -test $ac_write_fail = 0 || - { { $as_echo "$as_me:$LINENO: error: write failure creating $CONFIG_STATUS" >&5 -$as_echo "$as_me: error: write failure creating $CONFIG_STATUS" >&2;} - { (exit 1); exit 1; }; } - - -# configure is writing to config.log, and then calls config.status. -# config.status does its own redirection, appending to config.log. -# Unfortunately, on DOS this fails, as config.log is still kept open -# by configure, so config.status won't be able to write to it; its -# output is simply discarded. So we exec the FD to /dev/null, -# effectively closing config.log, so it can be properly (re)opened and -# appended to by config.status. When coming back to configure, we -# need to make the FD available again. -if test "$no_create" != yes; then - ac_cs_success=: - ac_config_status_args= - test "$silent" = yes && - ac_config_status_args="$ac_config_status_args --quiet" - exec 5>/dev/null - $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false - exec 5>>config.log - # Use ||, not &&, to avoid exiting from the if with $? = 1, which - # would make configure fail if this is the last instruction. - $ac_cs_success || { (exit 1); exit 1; } -fi - -# -# CONFIG_SUBDIRS section. -# -if test "$no_recursion" != yes; then - - # Remove --cache-file, --srcdir, and --disable-option-checking arguments - # so they do not pile up. - ac_sub_configure_args= - ac_prev= - eval "set x $ac_configure_args" - shift - for ac_arg - do - if test -n "$ac_prev"; then - ac_prev= - continue - fi - case $ac_arg in - -cache-file | --cache-file | --cache-fil | --cache-fi \ - | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) - ac_prev=cache_file ;; - -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ - | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* \ - | --c=*) - ;; - --config-cache | -C) - ;; - -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) - ac_prev=srcdir ;; - -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) - ;; - -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) - ac_prev=prefix ;; - -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) - ;; - --disable-option-checking) - ;; - *) - case $ac_arg in - *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; - esac - ac_sub_configure_args="$ac_sub_configure_args '$ac_arg'" ;; - esac - done - - # Always prepend --prefix to ensure using the same prefix - # in subdir configurations. - ac_arg="--prefix=$prefix" - case $ac_arg in - *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; - esac - ac_sub_configure_args="'$ac_arg' $ac_sub_configure_args" - - # Pass --silent - if test "$silent" = yes; then - ac_sub_configure_args="--silent $ac_sub_configure_args" - fi - - # Always prepend --disable-option-checking to silence warnings, since - # different subdirs can have different --enable and --with options. - ac_sub_configure_args="--disable-option-checking $ac_sub_configure_args" - - ac_popdir=`pwd` - for ac_dir in : $subdirs; do test "x$ac_dir" = x: && continue - - # Do not complain, so a configure script can configure whichever - # parts of a large source tree are present. - test -d "$srcdir/$ac_dir" || continue - - ac_msg="=== configuring in $ac_dir (`pwd`/$ac_dir)" - $as_echo "$as_me:$LINENO: $ac_msg" >&5 - $as_echo "$ac_msg" >&6 - { as_dir="$ac_dir" - case $as_dir in #( - -*) as_dir=./$as_dir;; - esac - test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { - as_dirs= - while :; do - case $as_dir in #( - *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( - *) as_qdir=$as_dir;; - esac - as_dirs="'$as_qdir' $as_dirs" - as_dir=`$as_dirname -- "$as_dir" || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - test -d "$as_dir" && break - done - test -z "$as_dirs" || eval "mkdir $as_dirs" - } || test -d "$as_dir" || { { $as_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 -$as_echo "$as_me: error: cannot create directory $as_dir" >&2;} - { (exit 1); exit 1; }; }; } - ac_builddir=. - -case "$ac_dir" in -.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; -*) - ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` - # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` - case $ac_top_builddir_sub in - "") ac_top_builddir_sub=. ac_top_build_prefix= ;; - *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; - esac ;; -esac -ac_abs_top_builddir=$ac_pwd -ac_abs_builddir=$ac_pwd$ac_dir_suffix -# for backward compatibility: -ac_top_builddir=$ac_top_build_prefix - -case $srcdir in - .) # We are building in place. - ac_srcdir=. - ac_top_srcdir=$ac_top_builddir_sub - ac_abs_top_srcdir=$ac_pwd ;; - [\\/]* | ?:[\\/]* ) # Absolute name. - ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir - ac_abs_top_srcdir=$srcdir ;; - *) # Relative name. - ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_build_prefix$srcdir - ac_abs_top_srcdir=$ac_pwd/$srcdir ;; -esac -ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix - - - cd "$ac_dir" - - # Check for guested configure; otherwise get Cygnus style configure. - if test -f "$ac_srcdir/configure.gnu"; then - ac_sub_configure=$ac_srcdir/configure.gnu - elif test -f "$ac_srcdir/configure"; then - ac_sub_configure=$ac_srcdir/configure - elif test -f "$ac_srcdir/configure.in"; then - # This should be Cygnus configure. - ac_sub_configure=$ac_aux_dir/configure - else - { $as_echo "$as_me:$LINENO: WARNING: no configuration information is in $ac_dir" >&5 -$as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2;} - ac_sub_configure= - fi - - # The recursion is here. - if test -n "$ac_sub_configure"; then - # Make the cache file name correct relative to the subdirectory. - case $cache_file in - [\\/]* | ?:[\\/]* ) ac_sub_cache_file=$cache_file ;; - *) # Relative name. - ac_sub_cache_file=$ac_top_build_prefix$cache_file ;; - esac - - { $as_echo "$as_me:$LINENO: running $SHELL $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir" >&5 -$as_echo "$as_me: running $SHELL $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir" >&6;} - # The eval makes quoting arguments work. - eval "\$SHELL \"\$ac_sub_configure\" $ac_sub_configure_args \ - --cache-file=\"\$ac_sub_cache_file\" --srcdir=\"\$ac_srcdir\"" || - { { $as_echo "$as_me:$LINENO: error: $ac_sub_configure failed for $ac_dir" >&5 -$as_echo "$as_me: error: $ac_sub_configure failed for $ac_dir" >&2;} - { (exit 1); exit 1; }; } - fi - - cd "$ac_popdir" - done -fi -if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then - { $as_echo "$as_me:$LINENO: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 -$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} -fi - - -# $RCSfile$: end of file diff --git a/winsup/mingw/configure.in b/winsup/mingw/configure.in deleted file mode 100644 index cfe58ca41..000000000 --- a/winsup/mingw/configure.in +++ /dev/null @@ -1,86 +0,0 @@ -dnl Process this file with autoconf to produce a configure script. - -dnl This file is part of winsup/mingw -dnl -dnl This program is free software; you can redistribute it and/or modify -dnl it under the terms of the GNU General Public License as published by -dnl the Free Software Foundation; either version 2 of the License, or -dnl (at your option) any later version. -dnl -dnl This program is distributed in the hope that it will be useful, -dnl but WITHOUT ANY WARRANTY; without even the implied warranty of -dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -dnl GNU General Public License for more details. -dnl -dnl You should have received a copy of the GNU General Public License -dnl along with this program; if not, write to the Free Software -dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -AC_PREREQ([2.59]) -AC_INIT([MinGW Runtime], [v3.x], [http://mingw.org/reporting_bugs], [mingwrt]) -MINGW_AC_CONFIG_SRCDIR([__MINGW32_VERSION], [include/_mingw.h]) - -AC_CANONICAL_SYSTEM -GCC_NO_EXECUTABLES -AC_PROG_CC - -case "$with_cross_host" in - ""|*cygwin*) all_dlls_host='all_dlls_host' - install_dlls_host='install_dlls_host';; -esac -AC_SUBST([with_cross_host]) -AC_SUBST([all_dlls_host]) -AC_SUBST([install_dlls_host]) - -AC_CHECK_TOOL([AR], [ar], [ar]) -AC_CHECK_TOOL([AS], [as], [as]) -AC_CHECK_TOOL([RANLIB], [ranlib], [ranlib]) -AC_CHECK_TOOL([LD], [ld], [ld]) -AC_CHECK_TOOL([NM], [nm], [nm]) -AC_CHECK_TOOL([OBJCOPY], [objcopy], [objcopy]) -AC_CHECK_TOOL([DLLTOOL], [dlltool], [dlltool]) -AC_CHECK_TOOL([DLLWRAP], [dlltool], [dlltool]) -AC_CHECK_TOOL([WINDRES], [windres], [windres]) - -AC_CONFIG_SUBDIRS([profile mingwex]) -HEADER_SUBDIR="" - -LIBGMON_A=libgmon.a - -W32API_INCLUDE='-I $(srcdir)/../w32api/include' - -case "$target_os" in -*cygwin*) - NO_CYGWIN="$(cd ${srcdir}/../utils; pwd)/mingw" - LIBM_A=libm.a - # Install mingw headers in mingw subdirectory. - HEADER_SUBDIR="mingw" - ;; -*) - # Build it for MSVCRT by default. - NO_CYGWIN= - LIBM_A=libm.a - ;; -esac - -# THREAD_DLL used to be set within the above case and was mingwc for CRTDLL. -# I can find no reason to do this. -# -# FIXME: In the future I would like to change the dll name to mingwthrd to -# to match the libmingwthrd.a name. -AC_SUBST([THREAD_DLL], [mingwm]) - -AC_SUBST([MKINSTALLDIRS], [$ac_aux_dir/mkinstalldirs]) -AC_SUBST([NO_CYGWIN]) -AC_SUBST([LIBM_A]) -AC_SUBST([LIBGMON_A]) -AC_SUBST([HEADER_SUBDIR]) -AC_SUBST([W32API_INCLUDE]) - -AC_PROG_INSTALL -MINGW_AC_MANPAGE_TRANSFORM - -AC_CONFIG_FILES([Makefile]) -AC_OUTPUT - -# $RCSfile$: end of file diff --git a/winsup/mingw/cpu_features.c b/winsup/mingw/cpu_features.c deleted file mode 100755 index 5e2c26557..000000000 --- a/winsup/mingw/cpu_features.c +++ /dev/null @@ -1,105 +0,0 @@ -#include <stdbool.h> -#include "cpu_features.h" - -/* level 1 edx bits */ -#define EDX_CX8 (1 << 8) /* CMPXCHG8B */ -#define EDX_CMOV (1 << 15) -#define EDX_MMX (1 << 23) -#define EDX_FXSR (1 << 24) /* FXSAVE and FXRSTOR */ -#define EDX_SSE (1 << 25) -#define EDX_SSE2 (1 << 26) - -/* level 1 ecx bits */ -#define ECX_SSE3 (1 << 0) -#define ECX_CX16 (1 << 13) /* CMPXCHG16B */ - -/* extended level 0x80000001 edx bits */ -#define EDX_3DNOW (1 << 31) -#define EDX_3DNOWP (1 << 30) -#define EDX_LM (1 << 29) /*LONG MODE */ - -#define __cpuid(level,a,b,c,d) \ - __asm__ __volatile__ ("cpuid;" \ - : "=a" (a), "=b" (b), "=c" (c), "=d" (d)\ - : "0" (level)) - -/* Combine the different cpuid flags into a single bitmap. */ - -unsigned int __cpu_features = 0; - -void __cpu_features_init (void) -{ - unsigned int eax, ebx, ecx, edx; - /* Try to change the value of CPUID bit (bit 21) in EFLAGS. - If the bit can be toggled, CPUID is supported. */ - asm volatile ("pushfl; pushfl; popl %0;" - "movl %0,%1; xorl %2,%0;" - "pushl %0; popfl; pushfl; popl %0; popfl" - : "=&r" (eax), "=&r" (ebx) - : "i" (0x00200000)); - - if (((eax ^ ebx) & 0x00200000) == 0) - return; - - __cpuid (0, eax, ebx, ecx, edx); - if (eax == 0) - return; - - __cpuid (1, eax, ebx, ecx, edx); - - if (edx & EDX_CX8) - __cpu_features |= _CRT_CMPXCHG8B; - if (edx & EDX_CMOV) - __cpu_features |= _CRT_CMOV; - - if (edx & EDX_MMX) - __cpu_features |= _CRT_MMX; - if (edx & EDX_FXSR) - __cpu_features |= _CRT_FXSR; - if (edx & EDX_SSE) - __cpu_features |= _CRT_SSE; - if (edx & EDX_SSE2) - __cpu_features |= _CRT_SSE2; - - - if (ecx & ECX_SSE3) - __cpu_features |= _CRT_SSE3; - if (ecx & ECX_CX16) - __cpu_features |= _CRT_CMPXCHG16B; - - __cpuid (0x80000000, eax, ebx, ecx, edx); - if (eax < 0x80000001) - return; - __cpuid (0x80000001, eax, ebx, ecx, edx); - if (edx & EDX_3DNOW) - __cpu_features |= _CRT_3DNOW; - if (edx & EDX_3DNOWP) - __cpu_features |= _CRT_3DNOWP; - - return; -} - -#ifdef TEST - -#include <stdio.h> -#define report(feature) \ - if ((feature) & __cpu_features) printf( #feature " found\n") - -int main() -{ - __cpu_features_init(); - - report(_CRT_CMPXCHG8B); - report(_CRT_CMOV); - report(_CRT_MMX); - report(_CRT_FXSR); - report(_CRT_SSE); - report(_CRT_SSE2); - report(_CRT_SSE3); - report(_CRT_CMPXCHG16B); - report(_CRT_3DNOW); - report(_CRT_3DNOWP); - return 0; -} - -#endif diff --git a/winsup/mingw/cpu_features.h b/winsup/mingw/cpu_features.h deleted file mode 100755 index a19f875c8..000000000 --- a/winsup/mingw/cpu_features.h +++ /dev/null @@ -1,23 +0,0 @@ -#ifndef _CPU_FEATURES_H -#define _CPU_FEATURES_H - -#include <stdbool.h> - -#define _CRT_CMPXCHG8B 0x0001 -#define _CRT_CMOV 0x0002 -#define _CRT_MMX 0x0004 -#define _CRT_FXSR 0x0008 -#define _CRT_SSE 0x0010 -#define _CRT_SSE2 0x0020 -#define _CRT_SSE3 0x0040 -#define _CRT_CMPXCHG16B 0x0080 -#define _CRT_3DNOW 0x0100 -#define _CRT_3DNOWP 0x0200 - -extern unsigned int __cpu_features; - -/* Currently we use this in fpenv functions */ -#define __HAS_SSE __cpu_features & _CRT_SSE - - -#endif diff --git a/winsup/mingw/crt1.c b/winsup/mingw/crt1.c deleted file mode 100644 index 6ab7c1d56..000000000 --- a/winsup/mingw/crt1.c +++ /dev/null @@ -1,290 +0,0 @@ -/* - * crt1.c - * This file has no copyright assigned and is placed in the Public Domain. - * This file is a part of the mingw-runtime package. - * No warranty is given; refer to the file DISCLAIMER within the package. - * - * Source code for the startup proceedures used by all programs. This code - * is compiled to make crt1.o, which should be located in the library path. - * - */ - -/* Hide the declaration of _fmode with dllimport attribute in stdlib.h to - avoid problems with older GCC. */ -#define __IN_MINGW_RUNTIME -#include <stdlib.h> -#include <stdio.h> -#include <io.h> -#include <process.h> -#include <float.h> -#define WIN32_LEAN_AND_MEAN -#include <windows.h> -#include <signal.h> - -/* NOTE: The code for initializing the _argv, _argc, and environ variables - * has been moved to a separate .c file which is included in both - * crt1.c and dllcrt1.c. This means changes in the code don't have to - * be manually synchronized, but it does lead to this not-generally- - * a-good-idea use of include. */ -#include "init.c" -#include "cpu_features.h" - -extern void __main (); -extern void _pei386_runtime_relocator (void); - -extern int main (int, char **, char **); - -/* - * Must have the correct app type for MSVCRT. - */ - -#ifdef __MSVCRT__ -#define __UNKNOWN_APP 0 -#define __CONSOLE_APP 1 -#define __GUI_APP 2 -__MINGW_IMPORT void __set_app_type(int); -#endif /* __MSVCRT__ */ - -/* Global _fmode for this .exe, not the one in msvcrt.dll, - The default is set in txtmode.o in libmingw32.a */ -/* Override the dllimport'd declarations in stdlib.h */ -#undef _fmode -extern int _fmode; -#ifdef __MSVCRT__ -extern int* __p__fmode(void); /* To access the dll _fmode */ -#endif - -/* - * Setup the default file handles to have the _CRT_fmode mode, as well as - * any new files created by the user. - */ -extern int _CRT_fmode; - -static void -_mingw32_init_fmode (void) -{ - /* Don't set the std file mode if the user hasn't set any value for it. */ - if (_CRT_fmode) - { - _fmode = _CRT_fmode; - - /* - * This overrides the default file mode settings for stdin, - * stdout and stderr. At first I thought you would have to - * test with isatty, but it seems that the DOS console at - * least is smart enough to handle _O_BINARY stdout and - * still display correctly. - */ - if (stdin) - { - _setmode (_fileno (stdin), _CRT_fmode); - } - if (stdout) - { - _setmode (_fileno (stdout), _CRT_fmode); - } - if (stderr) - { - _setmode (_fileno (stderr), _CRT_fmode); - } - } - - /* Now sync the dll _fmode to the one for this .exe. */ -#ifdef __MSVCRT__ - *__p__fmode() = _fmode; -#else - *_imp___fmode_dll = _fmode; -#endif -} - -/* This function will be called when a trap occurs. Thanks to Jacob - Navia for his contribution. */ -static CALLBACK long -_gnu_exception_handler (EXCEPTION_POINTERS * exception_data) -{ - void (*old_handler) (int); - long action = EXCEPTION_CONTINUE_SEARCH; - int reset_fpu = 0; - - switch (exception_data->ExceptionRecord->ExceptionCode) - { - case EXCEPTION_ACCESS_VIOLATION: - /* test if the user has set SIGSEGV */ - old_handler = signal (SIGSEGV, SIG_DFL); - if (old_handler == SIG_IGN) - { - /* this is undefined if the signal was raised by anything other - than raise (). */ - signal (SIGSEGV, SIG_IGN); - action = EXCEPTION_CONTINUE_EXECUTION; - } - else if (old_handler != SIG_DFL) - { - /* This means 'old' is a user defined function. Call it */ - (*old_handler) (SIGSEGV); - action = EXCEPTION_CONTINUE_EXECUTION; - } - break; - - case EXCEPTION_ILLEGAL_INSTRUCTION: - case EXCEPTION_PRIV_INSTRUCTION: - /* test if the user has set SIGILL */ - old_handler = signal (SIGILL, SIG_DFL); - if (old_handler == SIG_IGN) - { - /* this is undefined if the signal was raised by anything other - than raise (). */ - signal (SIGILL, SIG_IGN); - action = EXCEPTION_CONTINUE_EXECUTION; - } - else if (old_handler != SIG_DFL) - { - /* This means 'old' is a user defined function. Call it */ - (*old_handler) (SIGILL); - action = EXCEPTION_CONTINUE_EXECUTION; - } - break; - - case EXCEPTION_FLT_INVALID_OPERATION: - case EXCEPTION_FLT_DIVIDE_BY_ZERO: - case EXCEPTION_FLT_DENORMAL_OPERAND: - case EXCEPTION_FLT_OVERFLOW: - case EXCEPTION_FLT_UNDERFLOW: - case EXCEPTION_FLT_INEXACT_RESULT: - reset_fpu = 1; - /* fall through. */ - - case EXCEPTION_INT_DIVIDE_BY_ZERO: - /* test if the user has set SIGFPE */ - old_handler = signal (SIGFPE, SIG_DFL); - if (old_handler == SIG_IGN) - { - signal (SIGFPE, SIG_IGN); - if (reset_fpu) - _fpreset (); - action = EXCEPTION_CONTINUE_EXECUTION; - } - else if (old_handler != SIG_DFL) - { - /* This means 'old' is a user defined function. Call it */ - (*old_handler) (SIGFPE); - action = EXCEPTION_CONTINUE_EXECUTION; - } - break; - - default: - break; - } - return action; -} - -/* - * The function mainCRTStartup is the entry point for all console programs. - */ -static void __attribute__((noreturn)) -__mingw_CRTStartup (void) -{ - int nRet; - - /* - * Set up the top-level exception handler so that signal handling - * works as expected. The mapping between ANSI/POSIX signals and - * Win32 SE is not 1-to-1, so caveat emptore. - * - */ - SetUnhandledExceptionFilter (_gnu_exception_handler); - - /* - * Initialize floating point unit. - */ - __cpu_features_init (); /* Do we have SSE, etc.*/ - _fpreset (); /* Supplied by the runtime library. */ - - /* - * Set up __argc, __argv and _environ. - */ - _mingw32_init_mainargs (); - - /* - * Sets the default file mode. - * If _CRT_fmode is set, also set mode for stdin, stdout - * and stderr, as well - * NOTE: DLLs don't do this because that would be rude! - */ - _mingw32_init_fmode (); - - /* Adust references to dllimported data that have non-zero offsets. */ - _pei386_runtime_relocator (); - - /* Align the stack to 16 bytes for the sake of SSE ops in main - or in functions inlined into main. */ - asm __volatile__ ("andl $-16, %%esp" : : : "%esp"); - - /* From libgcc.a, __main calls global class constructors via - __do_global_ctors, This in turn registers __do_global_dtors - as the first entry of the app's atexit table. We do this - explicitly at app startup rather than rely on gcc to generate - the call in main's prologue, since main may be imported from a dll - which has its own __do_global_ctors. */ - __main (); - - /* - * Call the main function. If the user does not supply one - * the one in the 'libmingw32.a' library will be linked in, and - * that one calls WinMain. See main.c in the 'lib' dir - * for more details. - */ - nRet = main (_argc, _argv, environ); - - /* - * Perform exit processing for the C library. This means - * flushing output and calling 'atexit' registered functions. - */ - _cexit (); - - ExitProcess (nRet); -} - -/* - * The function mainCRTStartup is the entry point for all console programs. - */ -void -mainCRTStartup (void) -{ -#ifdef __MSVCRT__ - __set_app_type (__CONSOLE_APP); -#endif - __mingw_CRTStartup (); -} - -/* - * For now the GUI startup function is the same as the console one. - * This simply gets rid of the annoying warning about not being able - * to find WinMainCRTStartup when linking GUI applications. - */ -void -WinMainCRTStartup (void) -{ -#ifdef __MSVCRT__ - __set_app_type (__GUI_APP); -#endif - __mingw_CRTStartup (); -} - -/* - * We force use of library version of atexit, which is only - * visible in import lib as _imp__atexit - */ -extern int (*_imp__atexit)(void (*)(void)); -int atexit (void (* pfn )(void) ) -{ - return ( (*_imp__atexit)(pfn)); -} - -/* Likewise for non-ANSI _onexit */ -extern _onexit_t (*_imp___onexit)(_onexit_t); -_onexit_t -_onexit (_onexit_t pfn ) -{ - return (*_imp___onexit)(pfn); -} diff --git a/winsup/mingw/crtdll.def b/winsup/mingw/crtdll.def deleted file mode 100644 index dbd18ec14..000000000 --- a/winsup/mingw/crtdll.def +++ /dev/null @@ -1,695 +0,0 @@ -; -;* crtdll.def -;* This file has no copyright assigned and is placed in the Public Domain. -;* This file is a part of the mingw-runtime package. -;* No warranty is given; refer to the file DISCLAIMER within the package. -; -; Exports from crtdll.dll from Windows 95 SYSTEM directory. Hopefully this -; should also work with the crtdll provided with Windows NT. -; -; NOTE: The crtdll is OBSOLETE and msvcrt should be used instead. The msvcrt -; is available for free download from Microsoft Corporation and will work on -; Windows 95. Support for the crtdll is deprecated and this file may be -; deleted in future versions. -; -; These three functions appear to be name mangled in some way, so GCC is -; probably not going to be able to use them in any case. -; -; ??2@YAPAXI@Z -; ??3@YAXPAX@Z -; ?_set_new_handler@@YAP6AHI@ZP6AHI@Z@Z -; -; These are functions for which I have not yet written prototypes or -; otherwise set up (they are still included below though unlike those -; first three). -; -; _CIacos -; _CIasin -; _CIatan -; _CIatan2 -; _CIcos -; _CIcosh -; _CIexp -; _CIfmod -; _CIlog -; _CIlog10 -; _CIpow -; _CIsin -; _CIsinh -; _CIsqrt -; _CItan -; _CItanh -; __dllonexit -; __mb_cur_max_dll -; __threadhandle -; __threadid -; _abnormal_termination -; _acmdln_dll -; _aexit_rtn_dll -; _amsg_exit -; _commit -; _commode_dll -; _cpumode_dll -; _ctype -; _expand -; _fcloseall -; _filbuf -; _fileinfo_dll -; _flsbuf -; _flushall -; _fmode_dll -; _fpieee_flt -; _fsopen -; _ftol -; _getdiskfree -; _getdllprocaddr -; _getdrive -; _getdrives -; _getsystime -; _initterm -; _ismbbalnum -; _ismbbalpha -; _ismbbgraph -; _ismbbkalnum -; _ismbbkana -; _ismbbkpunct -; _ismbblead -; _ismbbprint -; _ismbbpunct -; _ismbbtrail -; _ismbcalpha -; _ismbcdigit -; _ismbchira -; _ismbckata -; _ismbcl0 -; _ismbcl1 -; _ismbcl2 -; _ismbclegal -; _ismbclower -; _ismbcprint -; _ismbcspace -; _ismbcsymbol -; _ismbcupper -; _ismbslead -; _ismbstrail -; _lfind -; _loaddll -; _lrotl -; _lrotr -; _lsearch -; _makepath -; _matherr -; _mbbtombc -; _mbbtype -; _mbccpy -; _mbcjistojms -; _mbcjmstojis -; _mbclen -; _mbctohira -; _mbctokata -; _mbctolower -; _mbctombb -; _mbctoupper -; _mbctype -; _mbsbtype -; _mbscat -; _mbscmp -; _mbscpy -; _mbscspn -; _mbsdec -; _mbsdup -; _mbsicmp -; _mbsinc -; _mbslen -; _mbslwr -; _mbsnbcat -; _mbsnbcmp -; _mbsnbcnt -; _mbsnbcpy -; _mbsnbicmp -; _mbsnbset -; _mbsnccnt -; _mbsncmp -; _mbsncpy -; _mbsnextc -; _mbsnicmp -; _mbsninc -; _mbsnset -; _mbspbrk -; _mbsrchr -; _mbsrev -; _mbsset -; _mbsspn -; _mbsspnp -; _mbsstr -; _mbstrlen -; _mbsupr -; _onexit -; _osversion_dll -; _pctype_dll -; _purecall -; _pwctype_dll -; _rmtmp -; _rotl -; _rotr -; _setsystime -; _snprintf -; _snwprintf -; _splitpath -; _strdate -; _strdec -; _strinc -; _strncnt -; _strnextc -; _strninc -; _strspnp -; _strtime -; _tempnam -; _ultoa -; _unloaddll -; _vsnprintf -; _vsnwprintf -; _wtoi -; _wtol -; -EXPORTS -_CIacos -_CIasin -_CIatan -_CIatan2 -_CIcos -_CIcosh -_CIexp -_CIfmod -_CIlog -_CIlog10 -_CIpow -_CIsin -_CIsinh -_CIsqrt -_CItan -_CItanh -_HUGE_dll DATA -_XcptFilter -__GetMainArgs -__argc_dll DATA -__argv_dll DATA -__dllonexit -__doserrno -__fpecode -__isascii -__iscsym -__iscsymf -__mb_cur_max_dll DATA -__pxcptinfoptrs -__threadhandle -__threadid -__toascii -_abnormal_termination -_access -_acmdln_dll DATA -_aexit_rtn_dll DATA -_amsg_exit -_assert -_basemajor_dll DATA -_baseminor_dll DATA -_baseversion_dll DATA -_beep -_beginthread -_c_exit -_cabs -_cexit -_cgets -_chdir -_chdrive -_chgsign -_chmod -_chsize -_clearfp -_close -_commit -_commode_dll DATA -_control87 -_controlfp -_copysign -_cprintf -_cpumode_dll DATA -_cputs -_creat -_cscanf -_ctype -_cwait -_daylight_dll DATA -_dup -_dup2 -_ecvt -_endthread -_environ_dll DATA -_eof -_errno -_except_handler2 -_execl -_execle -_execlp -_execlpe -_execv -_execve -_execvp -_execvpe -_exit -_expand -_fcloseall -_fcvt -_fdopen -_fgetchar -_fgetwchar -_filbuf -_fileinfo_dll DATA -_filelength -_fileno -_findclose -_findfirst -_findnext -_finite -_flsbuf -_flushall -_fmode_dll DATA -_fpclass -_fpieee_flt -_fpreset DATA -_fputchar -_fputwchar -_fsopen -_fstat -_ftime -_ftol -_fullpath -_futime -_gcvt -_get_osfhandle -_getch -_getche -_getcwd -_getdcwd -_getdiskfree -_getdllprocaddr -_getdrive -_getdrives -_getpid -_getsystime -_getw -_global_unwind2 -_heapchk -_heapmin -_heapset -_heapwalk -_hypot -_initterm -_iob DATA -_isatty -_isctype -_ismbbalnum -_ismbbalpha -_ismbbgraph -_ismbbkalnum -_ismbbkana -_ismbbkpunct -_ismbblead -_ismbbprint -_ismbbpunct -_ismbbtrail -_ismbcalpha -_ismbcdigit -_ismbchira -_ismbckata -_ismbcl0 -_ismbcl1 -_ismbcl2 -_ismbclegal -_ismbclower -_ismbcprint -_ismbcspace -_ismbcsymbol -_ismbcupper -_ismbslead -_ismbstrail -_isnan -_itoa -_j0 -_j1 -_jn -_kbhit -_lfind -_loaddll -_local_unwind2 -_locking -_logb -_lrotl -_lrotr -_lsearch -_lseek -_ltoa -_makepath -_matherr -_mbbtombc -_mbbtype -_mbccpy -_mbcjistojms -_mbcjmstojis -_mbclen -_mbctohira -_mbctokata -_mbctolower -_mbctombb -_mbctoupper -_mbctype -_mbsbtype -_mbscat -_mbschr -_mbscmp -_mbscpy -_mbscspn -_mbsdec -_mbsdup -_mbsicmp -_mbsinc -_mbslen -_mbslwr -_mbsnbcat -_mbsnbcmp -_mbsnbcnt -_mbsnbcpy -_mbsnbicmp -_mbsnbset -_mbsncat -_mbsnccnt -_mbsncmp -_mbsncpy -_mbsnextc -_mbsnicmp -_mbsninc -_mbsnset -_mbspbrk -_mbsrchr -_mbsrev -_mbsset -_mbsspn -_mbsspnp -_mbsstr -_mbstok -_mbstrlen -_mbsupr -_memccpy -_memicmp -_mkdir -_mktemp -_msize -_nextafter -_onexit DATA -_open -_open_osfhandle -_osmajor_dll DATA -_osminor_dll DATA -_osmode_dll DATA -_osver_dll DATA -_osversion_dll DATA -_pclose -_pctype_dll DATA -_pgmptr_dll DATA -_pipe -_popen -_purecall -_putch -_putenv -_putw -_pwctype_dll DATA -_read -_rmdir -_rmtmp -_rotl -_rotr -_scalb -_searchenv -_seterrormode -_setjmp -_setmode -_setsystime -_sleep -_snprintf -_snwprintf -_sopen -_spawnl -_spawnle -_spawnlp -_spawnlpe -_spawnv -_spawnve -_spawnvp -_spawnvpe -_splitpath -_stat -_statusfp -_strcmpi -_strdate -_strdec -_strdup -_strerror -_stricmp -_stricoll -_strinc -_strlwr -_strncnt -_strnextc -_strnicmp -_strninc -_strnset -_strrev -_strset -_strspnp -_strtime -_strupr -_swab -_sys_errlist DATA -_sys_nerr_dll DATA -_tell -_tempnam -_timezone_dll DATA -_tolower -_toupper -_tzname DATA -_tzset -_ultoa -_umask -_ungetch -_unlink -_unloaddll -_utime -_vsnprintf -_vsnwprintf -_wcsdup -_wcsicmp -_wcsicoll -_wcslwr -_wcsnicmp -_wcsnset -_wcsrev -_wcsset -_wcsupr -_winmajor_dll DATA -_winminor_dll DATA -_winver_dll DATA -_write -_wtoi -_wtol -_y0 -_y1 -_yn -abort -abs -acos -asctime -asin -atan -atan2 -atexit DATA -atof -atoi -atol -bsearch -calloc -ceil -clearerr -clock -cos -cosh -ctime -difftime -div -exit -exp -fabs -fclose -feof -ferror -fflush -fgetc -fgetpos -fgets -fgetwc -floor -fmod -fopen -fprintf -fputc -fputs -fputwc -fread -free -freopen -frexp -fscanf -fseek -fsetpos -ftell -fwprintf -fwrite -fwscanf -getc -getchar -getenv -gets -gmtime -is_wctype -isalnum -isalpha -iscntrl -isdigit -isgraph -isleadbyte -islower -isprint -ispunct -isspace -isupper -iswalnum -iswalpha -iswascii -iswcntrl -iswctype -iswdigit -iswgraph -iswlower -iswprint -iswpunct -iswspace -iswupper -iswxdigit -isxdigit -labs -ldexp -ldiv -localeconv -localtime -log -log10 -longjmp -malloc -mblen -mbstowcs -mbtowc -memchr -memcmp -memcpy -memmove -memset -mktime -modf -perror -pow -printf -putc -putchar -puts -qsort -raise -rand -realloc -remove -rename -rewind -scanf -setbuf -setlocale -setvbuf -signal -sin -sinh -sprintf -sqrt -srand -sscanf -strcat -strchr -strcmp -strcoll -strcpy -strcspn -strerror -strftime -strlen -strncat -strncmp -strncpy -strpbrk -strrchr -strspn -strstr -strtod -strtok -strtol -strtoul -strxfrm -swprintf -swscanf -system -tan -tanh -time -tmpfile -tmpnam -tolower -toupper -towlower -towupper -ungetc -ungetwc -vfprintf -vfwprintf -vprintf -vsprintf -vswprintf -vwprintf -wcscat -wcschr -wcscmp -wcscoll -wcscpy -wcscspn -wcsftime -wcslen -wcsncat -wcsncmp -wcsncpy -wcspbrk -wcsrchr -wcsspn -wcsstr -wcstod -wcstok -wcstol -wcstombs -wcstoul -wcsxfrm -wctomb -wprintf -wscanf diff --git a/winsup/mingw/crtmt.c b/winsup/mingw/crtmt.c deleted file mode 100644 index 116d850f0..000000000 --- a/winsup/mingw/crtmt.c +++ /dev/null @@ -1,14 +0,0 @@ -/* - * crtmt.c - * - * This object file defines _CRT_MT to have a value of 1, which will - * turn on MT support in GCC runtime. This is only linked in when - * you specify -mthreads when linking with gcc. The Mingw support - * library, libmingw32.a, contains the complement, crtst.o, which - * sets this variable to 0. - * - * Mumit Khan <khan@nanotech.wisc.edu> - * - */ - -int _CRT_MT = 1; diff --git a/winsup/mingw/crtst.c b/winsup/mingw/crtst.c deleted file mode 100644 index 4835b0963..000000000 --- a/winsup/mingw/crtst.c +++ /dev/null @@ -1,12 +0,0 @@ -/* - * crtst.c - * - * This object file defines _CRT_MT to have a value of 0, which will - * turn off MT support in GCC runtime. This is linked by default unless - * you specify -mthreads when linking with gcc. - * - * Mumit Khan <khan@nanotech.wisc.edu> - * - */ - -int _CRT_MT = 0; diff --git a/winsup/mingw/dllcrt1.c b/winsup/mingw/dllcrt1.c deleted file mode 100644 index dda8a24c7..000000000 --- a/winsup/mingw/dllcrt1.c +++ /dev/null @@ -1,183 +0,0 @@ -/* - * dllcrt1.c - * This file has no copyright assigned and is placed in the Public Domain. - * This file is a part of the mingw-runtime package. - * No warranty is given; refer to the file DISCLAIMER within the package. - * - * Initialization code for DLLs. - * - */ -#include <stdlib.h> -#include <stdio.h> -#include <io.h> -#include <process.h> -#include <errno.h> -#include <windows.h> - -/* Unlike normal crt1, I don't initialize the FPU, because the process - * should have done that already. I also don't set the file handle modes, - * because that would be rude. */ - -#ifdef __GNUC__ -extern void __main (); -extern void __do_global_dtors (); -#endif - -typedef void (* p_atexit_fn )(void); -static p_atexit_fn* first_atexit; -static p_atexit_fn* next_atexit; - -static void -__dll_exit (void); - -/* This is based on the function in the Wine project's exit.c */ -p_atexit_fn __dllonexit (p_atexit_fn, p_atexit_fn**, p_atexit_fn**); - - -extern BOOL WINAPI DllMain (HANDLE, DWORD, LPVOID); - -extern void _pei386_runtime_relocator (void); - -BOOL WINAPI -DllMainCRTStartup (HANDLE hDll, DWORD dwReason, LPVOID lpReserved) -{ - BOOL bRet; - - if (dwReason == DLL_PROCESS_ATTACH) - { - -#ifdef DEBUG - printf ("%s: DLL_PROCESS_ATTACH (%d)\n", __FUNCTION__); -#endif - - /* Initialize private atexit table for this dll. - 32 is min size required by ANSI */ - - first_atexit = (p_atexit_fn*) malloc (32 * sizeof (p_atexit_fn)); - if (first_atexit == NULL ) /* can't allocate memory */ - { - errno=ENOMEM; - return FALSE; - } - *first_atexit = NULL; - next_atexit = first_atexit; - - /* Adust references to dllimported data (from other DLL's) - that have non-zero offsets. */ - _pei386_runtime_relocator (); - -#ifdef __GNUC__ - /* From libgcc.a, __main calls global class constructors, - __do_global_ctors, which registers __do_global_dtors - as the first entry of the private atexit table we - have just initialised */ - __main (); - -#endif - } - - /* - * Call the user-supplied DllMain subroutine. - * This has to come after initialization of atexit table and - * registration of global constructors. - * NOTE: DllMain is optional, so libmingw32.a includes a stub - * which will be used if the user does not supply one. - */ - - bRet = DllMain (hDll, dwReason, lpReserved); - /* Handle case where DllMain returns FALSE on attachment attempt. */ - - if ( (dwReason == DLL_PROCESS_ATTACH) && !bRet) - { -#ifdef DEBUG - printf ("%s: DLL_PROCESS_ATTACH failed, cleaning up\n", __FUNCTION__); -#endif - - __dll_exit (); /* Cleanup now. This will set first_atexit to NULL so we - know we've cleaned up */ - } - - if (dwReason == DLL_PROCESS_DETACH) - { -#ifdef DEBUG - printf ("%s: DLL_PROCESS_DETACH (%d)\n", __FUNCTION__); -#endif - /* If not attached, return FALSE. Cleanup already done above - if failed attachment attempt. */ - if (! first_atexit ) - bRet = FALSE; - else - /* - * We used to call __do_global_dtors () here. This is - * no longer necessary since __do_global_dtors is now - * registered at start (last out) of private atexit table. - */ - __dll_exit (); - } - return bRet; -} - -static -void -__dll_exit(void) -/* Run LIFO terminators registered in private atexit table */ -{ - if ( first_atexit ) - { - p_atexit_fn* __last = next_atexit - 1; - while ( __last >= first_atexit ) - { - if ( *__last != NULL ) - { -#ifdef DEBUG - printf ("%s: Calling exit function 0x%x from 0x%x\n", - __FUNCTION__, (unsigned)(*__last),(unsigned)__last); -#endif - (**__last) (); - } - __last--; - } - free ( first_atexit ) ; - first_atexit = NULL ; - } - /* - Make sure output buffers opened by DllMain or - atexit-registered functions are flushed before detaching, - otherwise we can have problems with redirected output. - */ - fflush (NULL); -} - -/* - * The atexit exported from msvcrt.dll causes problems in DLLs. - * Here, we override the exported version of atexit with one that passes the - * private table initialised in DllMainCRTStartup to __dllonexit. - * That means we have to hide the mscvrt.dll atexit because the - * atexit defined here gets __dllonexit from the same lib. - */ - -int -atexit (p_atexit_fn pfn ) -{ -#ifdef DEBUG - printf ("%s: registering exit function 0x%x at 0x%x\n", - __FUNCTION__, (unsigned)pfn, (unsigned)next_atexit); -#endif - return (__dllonexit (pfn, &first_atexit, &next_atexit) - == NULL ? -1 : 0 ); -} - -/* - * Likewise for non-ANSI function _onexit that may be called by - * code in the dll. - */ - -_onexit_t -_onexit (_onexit_t pfn ) -{ -#ifdef DEBUG - printf ("%s: registering exit function 0x%x at 0x%x\n", - __FUNCTION__, (unsigned)pfn, (unsigned)next_atexit); -#endif - return ((_onexit_t) __dllonexit ((p_atexit_fn)pfn, &first_atexit, &next_atexit)); -} diff --git a/winsup/mingw/dllmain.c b/winsup/mingw/dllmain.c deleted file mode 100644 index 303682307..000000000 --- a/winsup/mingw/dllmain.c +++ /dev/null @@ -1,19 +0,0 @@ -/* - * dllmain.c - * This file has no copyright assigned and is placed in the Public Domain. - * This file is a part of the mingw-runtime package. - * No warranty is given; refer to the file DISCLAIMER within the package. - * - * A stub DllMain function which will be called by DLLs which do not - * have a user supplied DllMain. - * - */ - -#include <windows.h> - -BOOL WINAPI -DllMain (HANDLE hDll, DWORD dwReason, LPVOID lpReserved) -{ - return TRUE; -} - diff --git a/winsup/mingw/gccmain.c b/winsup/mingw/gccmain.c deleted file mode 100644 index 601d15a1f..000000000 --- a/winsup/mingw/gccmain.c +++ /dev/null @@ -1,79 +0,0 @@ -/* - * gccmain.c - * This file has no copyright assigned and is placed in the Public Domain. - * This file is a part of the mingw-runtime package. - * No warranty is given; refer to the file DISCLAIMER within the package. - * - * A separate version of __main, __do_global_ctors and __do_global_dtors for - * Mingw32 for use with Cygwin32 b19. Hopefully this object file will only - * be linked if the libgcc.a doesn't include __main, __do_global_dtors and - * __do_global_ctors. - * - */ - -/* Needed for the atexit prototype. */ -#include <stdlib.h> - -typedef void (*func_ptr) (void); -extern func_ptr __CTOR_LIST__[]; -extern func_ptr __DTOR_LIST__[]; - -void -__do_global_dtors (void) -{ - static func_ptr *p = __DTOR_LIST__ + 1; - - /* - * Call each destructor in the destructor list until a null pointer - * is encountered. - */ - while (*p) - { - (*(p)) (); - p++; - } -} - -void -__do_global_ctors (void) -{ - unsigned long nptrs = (unsigned long) __CTOR_LIST__[0]; - unsigned i; - - /* - * If the first entry in the constructor list is -1 then the list - * is terminated with a null entry. Otherwise the first entry was - * the number of pointers in the list. - */ - if (nptrs == -1) - { - for (nptrs = 0; __CTOR_LIST__[nptrs + 1] != 0; nptrs++) - ; - } - - /* - * Go through the list backwards calling constructors. - */ - for (i = nptrs; i >= 1; i--) - { - __CTOR_LIST__[i] (); - } - - /* - * Register the destructors for processing on exit. - */ - atexit (__do_global_dtors); -} - -static int initialized = 0; - -void -__main (void) -{ - if (!initialized) - { - initialized = 1; - __do_global_ctors (); - } -} - diff --git a/winsup/mingw/include/_mingw.h b/winsup/mingw/include/_mingw.h deleted file mode 100644 index ec91c6c52..000000000 --- a/winsup/mingw/include/_mingw.h +++ /dev/null @@ -1,240 +0,0 @@ -#ifndef __MINGW_H -/* - * _mingw.h - * - * Mingw specific macros included by ALL include files. - * - * This file is part of the Mingw32 package. - * - * Contributors: - * Created by Mumit Khan <khan@xraylith.wisc.edu> - * - * THIS SOFTWARE IS NOT COPYRIGHTED - * - * This source code is offered for use in the public domain. You may - * use, modify or distribute it freely. - * - * This code is distributed in the hope that it will be useful but - * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY - * DISCLAIMED. This includes but is not limited to warranties of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - */ -#define __MINGW_H - -#define __MINGW32_VERSION 3.15.1 -#define __MINGW32_MAJOR_VERSION 3 -#define __MINGW32_MINOR_VERSION 15 -#define __MINGW32_PATCHLEVEL 1 - -#if __GNUC__ >= 3 -#pragma GCC system_header -#endif - -/* These are defined by the user (or the compiler) - to specify how identifiers are imported from a DLL. - - __DECLSPEC_SUPPORTED Defined if dllimport attribute is supported. - __MINGW_IMPORT The attribute definition to specify imported - variables/functions. - _CRTIMP As above. For MS compatibility. - __MINGW32_VERSION Runtime version. - __MINGW32_MAJOR_VERSION Runtime major version. - __MINGW32_MINOR_VERSION Runtime minor version. - __MINGW32_BUILD_DATE Runtime build date. - - Macros to enable MinGW features which deviate from standard MSVC - compatible behaviour; these may be specified directly in user code, - activated implicitly, (e.g. by specifying _POSIX_C_SOURCE or such), - or by inclusion in __MINGW_FEATURES__: - - __USE_MINGW_ANSI_STDIO Select a more ANSI C99 compatible - implementation of printf() and friends. - - Other macros: - - __int64 define to be long long. Using a typedef - doesn't work for "unsigned __int64" - - All headers should include this first, and then use __DECLSPEC_SUPPORTED - to choose between the old ``__imp__name'' style or __MINGW_IMPORT - style declarations. */ - - -/* Manifest definitions identifying the flag bits, controlling activation - * of MinGW features, as specified by the user in __MINGW_FEATURES__. - */ -#define __MINGW_ANSI_STDIO__ 0x0000000000000001ULL -/* - * The following three are not yet formally supported; they are - * included here, to document anticipated future usage. - */ -#define __MINGW_LC_EXTENSIONS__ 0x0000000000000050ULL -#define __MINGW_LC_MESSAGES__ 0x0000000000000010ULL -#define __MINGW_LC_ENVVARS__ 0x0000000000000040ULL - -/* Try to avoid problems with outdated checks for GCC __attribute__ support. */ -#undef __attribute__ - -#ifndef __GNUC__ -# ifndef __MINGW_IMPORT -# define __MINGW_IMPORT __declspec(dllimport) -# endif -# ifndef _CRTIMP -# define _CRTIMP __declspec(dllimport) -# endif -# define __DECLSPEC_SUPPORTED -# define __attribute__(x) /* nothing */ -#else /* __GNUC__ */ -# ifdef __declspec -# ifndef __MINGW_IMPORT - /* Note the extern. This is needed to work around GCC's - limitations in handling dllimport attribute. */ -# define __MINGW_IMPORT extern __attribute__ ((__dllimport__)) -# endif -# ifndef _CRTIMP -# ifdef __USE_CRTIMP -# define _CRTIMP __attribute__ ((dllimport)) -# else -# define _CRTIMP -# endif -# endif -# define __DECLSPEC_SUPPORTED -# else /* __declspec */ -# undef __DECLSPEC_SUPPORTED -# undef __MINGW_IMPORT -# ifndef _CRTIMP -# define _CRTIMP -# endif -# endif /* __declspec */ - -/* - The next two defines can cause problems if user code adds the __cdecl attribute - like so: - void __attribute__ ((__cdecl)) foo(void); -*/ -# ifndef __cdecl -# define __cdecl __attribute__ ((__cdecl__)) -# endif -# ifndef __stdcall -# define __stdcall __attribute__ ((__stdcall__)) -# endif -# ifndef __int64 -# define __int64 long long -# endif -# ifndef __int32 -# define __int32 long -# endif -# ifndef __int16 -# define __int16 short -# endif -# ifndef __int8 -# define __int8 char -# endif -# ifndef __small -# define __small char -# endif -# ifndef __hyper -# define __hyper long long -# endif -#endif /* __GNUC__ */ - -#if defined (__GNUC__) && defined (__GNUC_MINOR__) -#define __MINGW_GNUC_PREREQ(major, minor) \ - (__GNUC__ > (major) \ - || (__GNUC__ == (major) && __GNUC_MINOR__ >= (minor))) -#else -#define __MINGW_GNUC_PREREQ(major, minor) 0 -#endif - -#ifdef __cplusplus -# define __CRT_INLINE inline -#else -# if __GNUC_STDC_INLINE__ -# define __CRT_INLINE extern inline __attribute__((__gnu_inline__)) -# else -# define __CRT_INLINE extern __inline__ -# endif -#endif - -#ifdef __cplusplus -# define __UNUSED_PARAM(x) -#else -# ifdef __GNUC__ -# define __UNUSED_PARAM(x) x __attribute__ ((__unused__)) -# else -# define __UNUSED_PARAM(x) x -# endif -#endif - -#ifdef __GNUC__ -#define __MINGW_ATTRIB_NORETURN __attribute__ ((__noreturn__)) -#define __MINGW_ATTRIB_CONST __attribute__ ((__const__)) -#else -#define __MINGW_ATTRIB_NORETURN -#define __MINGW_ATTRIB_CONST -#endif - -#if __MINGW_GNUC_PREREQ (3, 0) -#define __MINGW_ATTRIB_MALLOC __attribute__ ((__malloc__)) -#define __MINGW_ATTRIB_PURE __attribute__ ((__pure__)) -#else -#define __MINGW_ATTRIB_MALLOC -#define __MINGW_ATTRIB_PURE -#endif - -/* Attribute `nonnull' was valid as of gcc 3.3. We don't use GCC's - variadiac macro facility, because variadic macros cause syntax - errors with --traditional-cpp. */ -#if __MINGW_GNUC_PREREQ (3, 3) -#define __MINGW_ATTRIB_NONNULL(arg) __attribute__ ((__nonnull__ (arg))) -#else -#define __MINGW_ATTRIB_NONNULL(arg) -#endif /* GNUC >= 3.3 */ - -#if __MINGW_GNUC_PREREQ (3, 1) -#define __MINGW_ATTRIB_DEPRECATED __attribute__ ((__deprecated__)) -#else -#define __MINGW_ATTRIB_DEPRECATED -#endif /* GNUC >= 3.1 */ - -#if __MINGW_GNUC_PREREQ (3, 3) -#define __MINGW_NOTHROW __attribute__ ((__nothrow__)) -#else -#define __MINGW_NOTHROW -#endif /* GNUC >= 3.3 */ - - -/* TODO: Mark (almost) all CRT functions as __MINGW_NOTHROW. This will -allow GCC to optimize away some EH unwind code, at least in DW2 case. */ - -#ifndef __MSVCRT_VERSION__ -/* High byte is the major version, low byte is the minor. */ -# define __MSVCRT_VERSION__ 0x0600 -#endif - -/* Activation of MinGW specific extended features: - */ -#ifndef __USE_MINGW_ANSI_STDIO -/* - * If user didn't specify it explicitly... - */ -# if defined __STRICT_ANSI__ || defined _ISOC99_SOURCE \ - || defined _POSIX_SOURCE || defined _POSIX_C_SOURCE \ - || defined _XOPEN_SOURCE || defined _XOPEN_SOURCE_EXTENDED \ - || defined _GNU_SOURCE || defined _BSD_SOURCE \ - || defined _SVID_SOURCE - /* - * but where any of these source code qualifiers are specified, - * then assume ANSI I/O standards are preferred over Microsoft's... - */ -# define __USE_MINGW_ANSI_STDIO 1 -# else - /* - * otherwise use whatever __MINGW_FEATURES__ specifies... - */ -# define __USE_MINGW_ANSI_STDIO (__MINGW_FEATURES__ & __MINGW_ANSI_STDIO__) -# endif -#endif - -#endif /* __MINGW_H */ diff --git a/winsup/mingw/include/assert.h b/winsup/mingw/include/assert.h deleted file mode 100644 index 0cf09fe09..000000000 --- a/winsup/mingw/include/assert.h +++ /dev/null @@ -1,51 +0,0 @@ -/* - * assert.h - * This file has no copyright assigned and is placed in the Public Domain. - * This file is a part of the mingw-runtime package. - * No warranty is given; refer to the file DISCLAIMER within the package. - * - * Define the assert macro for debug output. - * - */ - -/* We should be able to include this file multiple times to allow the assert - macro to be enabled/disabled for different parts of code. So don't add a - header guard. */ - -#ifndef RC_INVOKED - -/* All the headers include this file. */ -#include <_mingw.h> - -#undef assert - -#ifdef __cplusplus -extern "C" { -#endif - -#ifdef NDEBUG -/* - * If not debugging, assert does nothing. - */ -#define assert(x) ((void)0) - -#else /* debugging enabled */ - -/* - * CRTDLL nicely supplies a function which does the actual output and - * call to abort. - */ -_CRTIMP void __cdecl __MINGW_NOTHROW _assert (const char*, const char*, int) __MINGW_ATTRIB_NORETURN; - -/* - * Definition of the assert macro. - */ -#define assert(e) ((e) ? (void)0 : _assert(#e, __FILE__, __LINE__)) - -#endif /* NDEBUG */ - -#ifdef __cplusplus -} -#endif - -#endif /* Not RC_INVOKED */ diff --git a/winsup/mingw/include/complex.h b/winsup/mingw/include/complex.h deleted file mode 100644 index 93f2a80c5..000000000 --- a/winsup/mingw/include/complex.h +++ /dev/null @@ -1,200 +0,0 @@ -/* - * complex.h - * - * This file is part of the Mingw32 package. - * - * Contributors: - * Created by Danny Smith <dannysmith@users.sourceforge.net> - * - * THIS SOFTWARE IS NOT COPYRIGHTED - * - * This source code is offered for use in the public domain. You may - * use, modify or distribute it freely. - * - * This code is distributed in the hope that it will be useful but - * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY - * DISCLAIMED. This includes but is not limited to warranties of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - */ - -#ifndef _COMPLEX_H_ -#define _COMPLEX_H_ - -/* All the headers include this file. */ -#include <_mingw.h> - -/* These macros are specified by C99 standard */ - -#ifndef __cplusplus -#define complex _Complex -#endif - -#define _Complex_I (0.0F + 1.0iF) - -/* GCC doesn't support _Imaginary type yet, so we don't - define _Imaginary_I */ - -#define I _Complex_I - -#ifdef __cplusplus -extern "C" { -#endif - -#ifndef RC_INVOKED - -double __MINGW_ATTRIB_CONST creal (double _Complex); -double __MINGW_ATTRIB_CONST cimag (double _Complex); -double __MINGW_ATTRIB_CONST carg (double _Complex); -double __MINGW_ATTRIB_CONST cabs (double _Complex); -double _Complex __MINGW_ATTRIB_CONST conj (double _Complex); -double _Complex cacos (double _Complex); -double _Complex casin (double _Complex); -double _Complex catan (double _Complex); -double _Complex ccos (double _Complex); -double _Complex csin (double _Complex); -double _Complex ctan (double _Complex); -double _Complex cacosh (double _Complex); -double _Complex casinh (double _Complex); -double _Complex catanh (double _Complex); -double _Complex ccosh (double _Complex); -double _Complex csinh (double _Complex); -double _Complex ctanh (double _Complex); -double _Complex cexp (double _Complex); -double _Complex clog (double _Complex); -double _Complex cpow (double _Complex, double _Complex); -double _Complex csqrt (double _Complex); -double _Complex __MINGW_ATTRIB_CONST cproj (double _Complex); - -float __MINGW_ATTRIB_CONST crealf (float _Complex); -float __MINGW_ATTRIB_CONST cimagf (float _Complex); -float __MINGW_ATTRIB_CONST cargf (float _Complex); -float __MINGW_ATTRIB_CONST cabsf (float _Complex); -float _Complex __MINGW_ATTRIB_CONST conjf (float _Complex); -float _Complex cacosf (float _Complex); -float _Complex casinf (float _Complex); -float _Complex catanf (float _Complex); -float _Complex ccosf (float _Complex); -float _Complex csinf (float _Complex); -float _Complex ctanf (float _Complex); -float _Complex cacoshf (float _Complex); -float _Complex casinhf (float _Complex); -float _Complex catanhf (float _Complex); -float _Complex ccoshf (float _Complex); -float _Complex csinhf (float _Complex); -float _Complex ctanhf (float _Complex); -float _Complex cexpf (float _Complex); -float _Complex clogf (float _Complex); -float _Complex cpowf (float _Complex, float _Complex); -float _Complex csqrtf (float _Complex); -float _Complex __MINGW_ATTRIB_CONST cprojf (float _Complex); - -long double __MINGW_ATTRIB_CONST creall (long double _Complex); -long double __MINGW_ATTRIB_CONST cimagl (long double _Complex); -long double __MINGW_ATTRIB_CONST cargl (long double _Complex); -long double __MINGW_ATTRIB_CONST cabsl (long double _Complex); -long double _Complex __MINGW_ATTRIB_CONST conjl (long double _Complex); -long double _Complex cacosl (long double _Complex); -long double _Complex casinl (long double _Complex); -long double _Complex catanl (long double _Complex); -long double _Complex ccosl (long double _Complex); -long double _Complex csinl (long double _Complex); -long double _Complex ctanl (long double _Complex); -long double _Complex cacoshl (long double _Complex); -long double _Complex casinhl (long double _Complex); -long double _Complex catanhl (long double _Complex); -long double _Complex ccoshl (long double _Complex); -long double _Complex csinhl (long double _Complex); -long double _Complex ctanhl (long double _Complex); -long double _Complex cexpl (long double _Complex); -long double _Complex clogl (long double _Complex); -long double _Complex cpowl (long double _Complex, long double _Complex); -long double _Complex csqrtl (long double _Complex); -long double _Complex __MINGW_ATTRIB_CONST cprojl (long double _Complex); - -#ifdef __GNUC__ - -/* double */ -__CRT_INLINE double __MINGW_ATTRIB_CONST creal (double _Complex _Z) -{ - return __real__ _Z; -} - -__CRT_INLINE double __MINGW_ATTRIB_CONST cimag (double _Complex _Z) -{ - return __imag__ _Z; -} - -__CRT_INLINE double _Complex __MINGW_ATTRIB_CONST conj (double _Complex _Z) -{ - return __extension__ ~_Z; -} - -__CRT_INLINE double __MINGW_ATTRIB_CONST carg (double _Complex _Z) -{ - double res; - __asm__ ("fpatan;" - : "=t" (res) : "0" (__real__ _Z), "u" (__imag__ _Z) : "st(1)"); - return res; -} - - -/* float */ -__CRT_INLINE float __MINGW_ATTRIB_CONST crealf (float _Complex _Z) -{ - return __real__ _Z; -} - -__CRT_INLINE float __MINGW_ATTRIB_CONST cimagf (float _Complex _Z) -{ - return __imag__ _Z; -} - -__CRT_INLINE float _Complex __MINGW_ATTRIB_CONST conjf (float _Complex _Z) -{ - return __extension__ ~_Z; -} - -__CRT_INLINE float __MINGW_ATTRIB_CONST cargf (float _Complex _Z) -{ - float res; - __asm__ ("fpatan;" - : "=t" (res) : "0" (__real__ _Z), "u" (__imag__ _Z) : "st(1)"); - return res; -} - -/* long double */ -__CRT_INLINE long double __MINGW_ATTRIB_CONST creall (long double _Complex _Z) -{ - return __real__ _Z; -} - -__CRT_INLINE long double __MINGW_ATTRIB_CONST cimagl (long double _Complex _Z) -{ - return __imag__ _Z; -} - -__CRT_INLINE long double _Complex __MINGW_ATTRIB_CONST conjl (long double _Complex _Z) -{ - return __extension__ ~_Z; -} - -__CRT_INLINE long double __MINGW_ATTRIB_CONST cargl (long double _Complex _Z) -{ - long double res; - __asm__ ("fpatan;" - : "=t" (res) : "0" (__real__ _Z), "u" (__imag__ _Z) : "st(1)"); - return res; -} - -#endif /* __GNUC__ */ - - -#endif /* RC_INVOKED */ - -#ifdef __cplusplus -} -#endif - - -#endif /* _COMPLEX_H */ diff --git a/winsup/mingw/include/conio.h b/winsup/mingw/include/conio.h deleted file mode 100644 index 8a821cbdb..000000000 --- a/winsup/mingw/include/conio.h +++ /dev/null @@ -1,53 +0,0 @@ -/* - * conio.h - * This file has no copyright assigned and is placed in the Public Domain. - * This file is a part of the mingw-runtime package. - * No warranty is given; refer to the file DISCLAIMER within the package. - * - * Low level console I/O functions. Pretty please try to use the ANSI - * standard ones if you are writing new code. - * - */ - -#ifndef _CONIO_H_ -#define _CONIO_H_ - -/* All the headers include this file. */ -#include <_mingw.h> - -#ifndef RC_INVOKED - -#ifdef __cplusplus -extern "C" { -#endif - -_CRTIMP char* __cdecl __MINGW_NOTHROW _cgets (char*); -_CRTIMP int __cdecl __MINGW_NOTHROW _cprintf (const char*, ...); -_CRTIMP int __cdecl __MINGW_NOTHROW _cputs (const char*); -_CRTIMP int __cdecl __MINGW_NOTHROW _cscanf (char*, ...); - -_CRTIMP int __cdecl __MINGW_NOTHROW _getch (void); -_CRTIMP int __cdecl __MINGW_NOTHROW _getche (void); -_CRTIMP int __cdecl __MINGW_NOTHROW _kbhit (void); -_CRTIMP int __cdecl __MINGW_NOTHROW _putch (int); -_CRTIMP int __cdecl __MINGW_NOTHROW _ungetch (int); - - -#ifndef _NO_OLDNAMES - -_CRTIMP int __cdecl __MINGW_NOTHROW getch (void); -_CRTIMP int __cdecl __MINGW_NOTHROW getche (void); -_CRTIMP int __cdecl __MINGW_NOTHROW kbhit (void); -_CRTIMP int __cdecl __MINGW_NOTHROW putch (int); -_CRTIMP int __cdecl __MINGW_NOTHROW ungetch (int); - -#endif /* Not _NO_OLDNAMES */ - - -#ifdef __cplusplus -} -#endif - -#endif /* Not RC_INVOKED */ - -#endif /* Not _CONIO_H_ */ diff --git a/winsup/mingw/include/ctype.h b/winsup/mingw/include/ctype.h deleted file mode 100644 index 551566bc4..000000000 --- a/winsup/mingw/include/ctype.h +++ /dev/null @@ -1,275 +0,0 @@ -/* - * ctype.h - * This file has no copyright assigned and is placed in the Public Domain. - * This file is a part of the mingw-runtime package. - * No warranty is given; refer to the file DISCLAIMER within the package. - * - * Functions for testing character types and converting characters. - * - */ - -#ifndef _CTYPE_H_ -#define _CTYPE_H_ - -/* All the headers include this file. */ -#include <_mingw.h> - -#define __need_wchar_t -#define __need_wint_t -#ifndef RC_INVOKED -#include <stddef.h> -#endif /* Not RC_INVOKED */ - - -/* - * The following flags are used to tell iswctype and _isctype what character - * types you are looking for. - */ -#define _UPPER 0x0001 -#define _LOWER 0x0002 -#define _DIGIT 0x0004 -#define _SPACE 0x0008 /* HT LF VT FF CR SP */ -#define _PUNCT 0x0010 -#define _CONTROL 0x0020 -/* _BLANK is set for SP and non-ASCII horizontal space chars (eg, - "no-break space", 0xA0, in CP1250) but not for HT. */ -#define _BLANK 0x0040 -#define _HEX 0x0080 -#define _LEADBYTE 0x8000 - -#define _ALPHA 0x0103 - -#ifndef RC_INVOKED - -#ifdef __cplusplus -extern "C" { -#endif - -_CRTIMP int __cdecl __MINGW_NOTHROW isalnum(int); -_CRTIMP int __cdecl __MINGW_NOTHROW isalpha(int); -_CRTIMP int __cdecl __MINGW_NOTHROW iscntrl(int); -_CRTIMP int __cdecl __MINGW_NOTHROW isdigit(int); -_CRTIMP int __cdecl __MINGW_NOTHROW isgraph(int); -_CRTIMP int __cdecl __MINGW_NOTHROW islower(int); -_CRTIMP int __cdecl __MINGW_NOTHROW isprint(int); -_CRTIMP int __cdecl __MINGW_NOTHROW ispunct(int); -_CRTIMP int __cdecl __MINGW_NOTHROW isspace(int); -_CRTIMP int __cdecl __MINGW_NOTHROW isupper(int); -_CRTIMP int __cdecl __MINGW_NOTHROW isxdigit(int); - -#if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) \ - || !defined __STRICT_ANSI__ -int __cdecl __MINGW_NOTHROW isblank (int); -#endif - -#ifndef __STRICT_ANSI__ -_CRTIMP int __cdecl __MINGW_NOTHROW _isctype (int, int); -#endif - -/* These are the ANSI versions, with correct checking of argument */ -_CRTIMP int __cdecl __MINGW_NOTHROW tolower(int); -_CRTIMP int __cdecl __MINGW_NOTHROW toupper(int); - -/* - * NOTE: The above are not old name type wrappers, but functions exported - * explicitly by MSVCRT/CRTDLL. However, underscored versions are also - * exported. - */ -#ifndef __STRICT_ANSI__ -/* - * These are the cheap non-std versions: The return values are undefined - * if the argument is not ASCII char or is not of appropriate case - */ -_CRTIMP int __cdecl __MINGW_NOTHROW _tolower(int); -_CRTIMP int __cdecl __MINGW_NOTHROW _toupper(int); -#endif - -/* Also defined in stdlib.h */ -#ifndef MB_CUR_MAX -#ifdef __DECLSPEC_SUPPORTED -# ifdef __MSVCRT__ -# define MB_CUR_MAX __mb_cur_max - __MINGW_IMPORT int __mb_cur_max; -# else /* not __MSVCRT */ -# define MB_CUR_MAX __mb_cur_max_dll - __MINGW_IMPORT int __mb_cur_max_dll; -# endif /* not __MSVCRT */ - -#else /* ! __DECLSPEC_SUPPORTED */ -# ifdef __MSVCRT__ - extern int* _imp____mb_cur_max; -# define MB_CUR_MAX (*_imp____mb_cur_max) -# else /* not __MSVCRT */ - extern int* _imp____mb_cur_max_dll; -# define MB_CUR_MAX (*_imp____mb_cur_max_dll) -# endif /* not __MSVCRT */ -#endif /* __DECLSPEC_SUPPORTED */ -#endif /* MB_CUR_MAX */ - - -#ifdef __DECLSPEC_SUPPORTED -# if __MSVCRT_VERSION__ <= 0x0700 - __MINGW_IMPORT unsigned short _ctype[]; -# endif -# ifdef __MSVCRT__ - __MINGW_IMPORT unsigned short* _pctype; -# else /* CRTDLL */ - __MINGW_IMPORT unsigned short* _pctype_dll; -# define _pctype _pctype_dll -# endif - -#else /* __DECLSPEC_SUPPORTED */ -# if __MSVCRT_VERSION__ <= 0x0700 - extern unsigned short** _imp___ctype; -# define _ctype (*_imp___ctype) -# endif -# ifdef __MSVCRT__ - extern unsigned short** _imp___pctype; -# define _pctype (*_imp___pctype) -# else /* CRTDLL */ - extern unsigned short** _imp___pctype_dll; -# define _pctype (*_imp___pctype_dll) -# endif /* CRTDLL */ -#endif /* __DECLSPEC_SUPPORTED */ - -/* - * Use inlines here rather than macros, because macros will upset - * C++ usage (eg, ::isalnum), and so usually get undefined - * - * According to standard for SB chars, these function are defined only - * for input values representable by unsigned char or EOF. - * Thus, there is no range test. - * This reproduces behaviour of MSVCRT.dll lib implemention for SB chars. - * - * If no MB char support is needed, these can be simplified even - * more by command line define -DMB_CUR_MAX=1. The compiler will then - * optimise away the constant condition. - */ - -#if !(defined (__NO_INLINE__) || defined (__NO_CTYPE_INLINES) \ - || defined (__STRICT_ANSI__)) - -/* use simple lookup if SB locale, else _isctype() */ -#define __ISCTYPE(c, mask) (MB_CUR_MAX == 1 ? (_pctype[c] & mask) : _isctype(c, mask)) -__CRT_INLINE int __cdecl __MINGW_NOTHROW isalnum(int c) {return __ISCTYPE(c, (_ALPHA|_DIGIT));} -__CRT_INLINE int __cdecl __MINGW_NOTHROW isalpha(int c) {return __ISCTYPE(c, _ALPHA);} -__CRT_INLINE int __cdecl __MINGW_NOTHROW iscntrl(int c) {return __ISCTYPE(c, _CONTROL);} -__CRT_INLINE int __cdecl __MINGW_NOTHROW isdigit(int c) {return __ISCTYPE(c, _DIGIT);} -__CRT_INLINE int __cdecl __MINGW_NOTHROW isgraph(int c) {return __ISCTYPE(c, (_PUNCT|_ALPHA|_DIGIT));} -__CRT_INLINE int __cdecl __MINGW_NOTHROW islower(int c) {return __ISCTYPE(c, _LOWER);} -__CRT_INLINE int __cdecl __MINGW_NOTHROW isprint(int c) {return __ISCTYPE(c, (_BLANK|_PUNCT|_ALPHA|_DIGIT));} -__CRT_INLINE int __cdecl __MINGW_NOTHROW ispunct(int c) {return __ISCTYPE(c, _PUNCT);} -__CRT_INLINE int __cdecl __MINGW_NOTHROW isspace(int c) {return __ISCTYPE(c, _SPACE);} -__CRT_INLINE int __cdecl __MINGW_NOTHROW isupper(int c) {return __ISCTYPE(c, _UPPER);} -__CRT_INLINE int __cdecl __MINGW_NOTHROW isxdigit(int c) {return __ISCTYPE(c, _HEX);} - -#if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) \ - || !defined __STRICT_ANSI__ -__CRT_INLINE int __cdecl __MINGW_NOTHROW isblank (int c) - {return (__ISCTYPE(c, _BLANK) || c == '\t');} -#endif - -/* these reproduce behaviour of lib underscored versions */ -__CRT_INLINE int __cdecl __MINGW_NOTHROW _tolower(int c) {return ( c -'A'+'a');} -__CRT_INLINE int __cdecl __MINGW_NOTHROW _toupper(int c) {return ( c -'a'+'A');} - -/* TODO? Is it worth inlining ANSI tolower, toupper? Probably only - if we only want C-locale. */ - -#endif /* _NO_CTYPE_INLINES */ - -/* Wide character equivalents */ - -#ifndef WEOF -#define WEOF (wchar_t)(0xFFFF) -#endif - -#ifndef _WCTYPE_T_DEFINED -typedef wchar_t wctype_t; -#define _WCTYPE_T_DEFINED -#endif - -_CRTIMP int __cdecl __MINGW_NOTHROW iswalnum(wint_t); -_CRTIMP int __cdecl __MINGW_NOTHROW iswalpha(wint_t); -_CRTIMP int __cdecl __MINGW_NOTHROW iswascii(wint_t); -_CRTIMP int __cdecl __MINGW_NOTHROW iswcntrl(wint_t); -_CRTIMP int __cdecl __MINGW_NOTHROW iswctype(wint_t, wctype_t); -_CRTIMP int __cdecl __MINGW_NOTHROW is_wctype(wint_t, wctype_t); /* Obsolete! */ -_CRTIMP int __cdecl __MINGW_NOTHROW iswdigit(wint_t); -_CRTIMP int __cdecl __MINGW_NOTHROW iswgraph(wint_t); -_CRTIMP int __cdecl __MINGW_NOTHROW iswlower(wint_t); -_CRTIMP int __cdecl __MINGW_NOTHROW iswprint(wint_t); -_CRTIMP int __cdecl __MINGW_NOTHROW iswpunct(wint_t); -_CRTIMP int __cdecl __MINGW_NOTHROW iswspace(wint_t); -_CRTIMP int __cdecl __MINGW_NOTHROW iswupper(wint_t); -_CRTIMP int __cdecl __MINGW_NOTHROW iswxdigit(wint_t); - -#if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) \ - || !defined __STRICT_ANSI__ || defined __cplusplus -int __cdecl __MINGW_NOTHROW iswblank (wint_t); -#endif - -/* Older MS docs uses wchar_t for arg and return type, while newer - online MS docs say arg is wint_t and return is int. - ISO C uses wint_t for both. */ -_CRTIMP wint_t __cdecl __MINGW_NOTHROW towlower (wint_t); -_CRTIMP wint_t __cdecl __MINGW_NOTHROW towupper (wint_t); - -_CRTIMP int __cdecl __MINGW_NOTHROW isleadbyte (int); - -/* Also in wctype.h */ -#if ! (defined (__NO_INLINE__) || defined(__NO_CTYPE_INLINES) \ - || defined(__WCTYPE_INLINES_DEFINED)) -#define __WCTYPE_INLINES_DEFINED -__CRT_INLINE int __cdecl __MINGW_NOTHROW iswalnum(wint_t wc) {return (iswctype(wc,_ALPHA|_DIGIT));} -__CRT_INLINE int __cdecl __MINGW_NOTHROW iswalpha(wint_t wc) {return (iswctype(wc,_ALPHA));} -__CRT_INLINE int __cdecl __MINGW_NOTHROW iswascii(wint_t wc) {return ((wc & ~0x7F) ==0);} -__CRT_INLINE int __cdecl __MINGW_NOTHROW iswcntrl(wint_t wc) {return (iswctype(wc,_CONTROL));} -__CRT_INLINE int __cdecl __MINGW_NOTHROW iswdigit(wint_t wc) {return (iswctype(wc,_DIGIT));} -__CRT_INLINE int __cdecl __MINGW_NOTHROW iswgraph(wint_t wc) {return (iswctype(wc,_PUNCT|_ALPHA|_DIGIT));} -__CRT_INLINE int __cdecl __MINGW_NOTHROW iswlower(wint_t wc) {return (iswctype(wc,_LOWER));} -__CRT_INLINE int __cdecl __MINGW_NOTHROW iswprint(wint_t wc) {return (iswctype(wc,_BLANK|_PUNCT|_ALPHA|_DIGIT));} -__CRT_INLINE int __cdecl __MINGW_NOTHROW iswpunct(wint_t wc) {return (iswctype(wc,_PUNCT));} -__CRT_INLINE int __cdecl __MINGW_NOTHROW iswspace(wint_t wc) {return (iswctype(wc,_SPACE));} -__CRT_INLINE int __cdecl __MINGW_NOTHROW iswupper(wint_t wc) {return (iswctype(wc,_UPPER));} -__CRT_INLINE int __cdecl __MINGW_NOTHROW iswxdigit(wint_t wc) {return (iswctype(wc,_HEX));} -__CRT_INLINE int __cdecl __MINGW_NOTHROW isleadbyte(int c) {return (_pctype[(unsigned char)(c)] & _LEADBYTE);} -#if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) \ - || !defined __STRICT_ANSI__ || defined __cplusplus -__CRT_INLINE int __cdecl __MINGW_NOTHROW iswblank (wint_t wc) - {return (iswctype(wc,_BLANK) || wc == L'\t');} -#endif - -#endif /* !(defined(__NO_CTYPE_INLINES) || defined(__WCTYPE_INLINES_DEFINED)) */ - -#ifndef __STRICT_ANSI__ -int __cdecl __MINGW_NOTHROW __isascii (int); -int __cdecl __MINGW_NOTHROW __toascii (int); -int __cdecl __MINGW_NOTHROW __iscsymf (int); /* Valid first character in C symbol */ -int __cdecl __MINGW_NOTHROW __iscsym (int); /* Valid character in C symbol (after first) */ - -#if !(defined (__NO_INLINE__) || defined (__NO_CTYPE_INLINES)) -__CRT_INLINE int __cdecl __MINGW_NOTHROW __isascii(int c) {return ((c & ~0x7F) == 0);} -__CRT_INLINE int __cdecl __MINGW_NOTHROW __toascii(int c) {return (c & 0x7F);} -__CRT_INLINE int __cdecl __MINGW_NOTHROW __iscsymf(int c) {return (isalpha(c) || (c == '_'));} -__CRT_INLINE int __cdecl __MINGW_NOTHROW __iscsym(int c) {return (isalnum(c) || (c == '_'));} -#endif /* __NO_CTYPE_INLINES */ - -#ifndef _NO_OLDNAMES -/* Not _CRTIMP */ -int __cdecl __MINGW_NOTHROW isascii (int); -int __cdecl __MINGW_NOTHROW toascii (int); -int __cdecl __MINGW_NOTHROW iscsymf (int); -int __cdecl __MINGW_NOTHROW iscsym (int); -#endif /* Not _NO_OLDNAMES */ - -#endif /* Not __STRICT_ANSI__ */ - -#ifdef __cplusplus -} -#endif - -#endif /* Not RC_INVOKED */ - -#endif /* Not _CTYPE_H_ */ - diff --git a/winsup/mingw/include/dir.h b/winsup/mingw/include/dir.h deleted file mode 100644 index d759a0a61..000000000 --- a/winsup/mingw/include/dir.h +++ /dev/null @@ -1,26 +0,0 @@ -/* - * dir.h - * - * This file OBSOLESCENT and only provided for backward compatibility. - * Please use io.h instead. - * - * This file is part of the Mingw32 package. - * - * Contributors: - * Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp> - * Mumit Khan <khan@xraylith.wisc.edu> - * - * THIS SOFTWARE IS NOT COPYRIGHTED - * - * This source code is offered for use in the public domain. You may - * use, modify or distribute it freely. - * - * This code is distributed in the hope that it will be useful but - * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY - * DISCLAIMED. This includes but is not limited to warranties of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - */ - -#include <io.h> - diff --git a/winsup/mingw/include/direct.h b/winsup/mingw/include/direct.h deleted file mode 100644 index 8e39c4ccf..000000000 --- a/winsup/mingw/include/direct.h +++ /dev/null @@ -1,73 +0,0 @@ -/* - * direct.h - * This file has no copyright assigned and is placed in the Public Domain. - * This file is a part of the mingw-runtime package. - * No warranty is given; refer to the file DISCLAIMER within the package. - * - * Functions for manipulating paths and directories (included from io.h) - * plus functions for setting the current drive. - * - */ -#ifndef _DIRECT_H_ -#define _DIRECT_H_ - -/* All the headers include this file. */ -#include <_mingw.h> - -#define __need_wchar_t -#ifndef RC_INVOKED -#include <stddef.h> -#endif /* Not RC_INVOKED */ - -#include <io.h> - -#ifndef RC_INVOKED - -#ifdef __cplusplus -extern "C" { -#endif - -#ifndef _DISKFREE_T_DEFINED -/* needed by _getdiskfree (also in dos.h) */ -struct _diskfree_t { - unsigned total_clusters; - unsigned avail_clusters; - unsigned sectors_per_cluster; - unsigned bytes_per_sector; -}; -#define _DISKFREE_T_DEFINED -#endif - -/* - * You really shouldn't be using these. Use the Win32 API functions instead. - * However, it does make it easier to port older code. - */ -_CRTIMP int __cdecl __MINGW_NOTHROW _getdrive (void); -_CRTIMP unsigned long __cdecl __MINGW_NOTHROW _getdrives(void); -_CRTIMP int __cdecl __MINGW_NOTHROW _chdrive (int); -_CRTIMP char* __cdecl __MINGW_NOTHROW _getdcwd (int, char*, int); -_CRTIMP unsigned __cdecl __MINGW_NOTHROW _getdiskfree (unsigned, struct _diskfree_t *); - -#ifndef _NO_OLDNAMES -# define diskfree_t _diskfree_t -#endif - -#ifndef _WDIRECT_DEFINED -/* wide character versions. Also in wchar.h */ -#ifdef __MSVCRT__ -_CRTIMP int __cdecl __MINGW_NOTHROW _wchdir(const wchar_t*); -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wgetcwd(wchar_t*, int); -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wgetdcwd(int, wchar_t*, int); -_CRTIMP int __cdecl __MINGW_NOTHROW _wmkdir(const wchar_t*); -_CRTIMP int __cdecl __MINGW_NOTHROW _wrmdir(const wchar_t*); -#endif /* __MSVCRT__ */ -#define _WDIRECT_DEFINED -#endif - -#ifdef __cplusplus -} -#endif - -#endif /* Not RC_INVOKED */ - -#endif /* Not _DIRECT_H_ */ diff --git a/winsup/mingw/include/dirent.h b/winsup/mingw/include/dirent.h deleted file mode 100644 index e2a668924..000000000 --- a/winsup/mingw/include/dirent.h +++ /dev/null @@ -1,123 +0,0 @@ -/* - * DIRENT.H (formerly DIRLIB.H) - * This file has no copyright assigned and is placed in the Public Domain. - * This file is a part of the mingw-runtime package. - * No warranty is given; refer to the file DISCLAIMER within the package. - * - */ -#ifndef _DIRENT_H_ -#define _DIRENT_H_ - -/* All the headers include this file. */ -#include <_mingw.h> - -#include <io.h> - -#ifndef RC_INVOKED - -#ifdef __cplusplus -extern "C" { -#endif - -struct dirent -{ - long d_ino; /* Always zero. */ - unsigned short d_reclen; /* Always zero. */ - unsigned short d_namlen; /* Length of name in d_name. */ - char d_name[FILENAME_MAX]; /* File name. */ -}; - -/* - * This is an internal data structure. Good programmers will not use it - * except as an argument to one of the functions below. - * dd_stat field is now int (was short in older versions). - */ -typedef struct -{ - /* disk transfer area for this dir */ - struct _finddata_t dd_dta; - - /* dirent struct to return from dir (NOTE: this makes this thread - * safe as long as only one thread uses a particular DIR struct at - * a time) */ - struct dirent dd_dir; - - /* _findnext handle */ - long dd_handle; - - /* - * Status of search: - * 0 = not started yet (next entry to read is first entry) - * -1 = off the end - * positive = 0 based index of next entry - */ - int dd_stat; - - /* given path for dir with search pattern (struct is extended) */ - char dd_name[1]; -} DIR; - -DIR* __cdecl __MINGW_NOTHROW opendir (const char*); -struct dirent* __cdecl __MINGW_NOTHROW readdir (DIR*); -int __cdecl __MINGW_NOTHROW closedir (DIR*); -void __cdecl __MINGW_NOTHROW rewinddir (DIR*); -long __cdecl __MINGW_NOTHROW telldir (DIR*); -void __cdecl __MINGW_NOTHROW seekdir (DIR*, long); - - -/* wide char versions */ - -struct _wdirent -{ - long d_ino; /* Always zero. */ - unsigned short d_reclen; /* Always zero. */ - unsigned short d_namlen; /* Length of name in d_name. */ - wchar_t d_name[FILENAME_MAX]; /* File name. */ -}; - -/* - * This is an internal data structure. Good programmers will not use it - * except as an argument to one of the functions below. - */ -typedef struct -{ - /* disk transfer area for this dir */ - struct _wfinddata_t dd_dta; - - /* dirent struct to return from dir (NOTE: this makes this thread - * safe as long as only one thread uses a particular DIR struct at - * a time) */ - struct _wdirent dd_dir; - - /* _findnext handle */ - long dd_handle; - - /* - * Status of search: - * 0 = not started yet (next entry to read is first entry) - * -1 = off the end - * positive = 0 based index of next entry - */ - int dd_stat; - - /* given path for dir with search pattern (struct is extended) */ - wchar_t dd_name[1]; -} _WDIR; - - - -_WDIR* __cdecl __MINGW_NOTHROW _wopendir (const wchar_t*); -struct _wdirent* __cdecl __MINGW_NOTHROW _wreaddir (_WDIR*); -int __cdecl __MINGW_NOTHROW _wclosedir (_WDIR*); -void __cdecl __MINGW_NOTHROW _wrewinddir (_WDIR*); -long __cdecl __MINGW_NOTHROW _wtelldir (_WDIR*); -void __cdecl __MINGW_NOTHROW _wseekdir (_WDIR*, long); - - -#ifdef __cplusplus -} -#endif - -#endif /* Not RC_INVOKED */ - -#endif /* Not _DIRENT_H_ */ diff --git a/winsup/mingw/include/dos.h b/winsup/mingw/include/dos.h deleted file mode 100644 index 80ba89e14..000000000 --- a/winsup/mingw/include/dos.h +++ /dev/null @@ -1,89 +0,0 @@ -/* - * dos.h - * This file has no copyright assigned and is placed in the Public Domain. - * This file is a part of the mingw-runtime package. - * No warranty is given; refer to the file DISCLAIMER within the package. - * - * DOS-specific functions and structures. - * - */ - -#ifndef _DOS_H_ -#define _DOS_H_ - -/* All the headers include this file. */ -#include <_mingw.h> - -#define __need_wchar_t -#ifndef RC_INVOKED -#include <stddef.h> -#endif /* Not RC_INVOKED */ - -/* For DOS file attributes */ -#include <io.h> - -#ifndef RC_INVOKED - -#ifdef __cplusplus -extern "C" { -#endif - -#ifndef __MSVCRT__ /* these are in CRTDLL, but not MSVCRT */ -#ifndef __DECLSPEC_SUPPORTED -extern unsigned int *_imp___basemajor_dll; -extern unsigned int *_imp___baseminor_dll; -extern unsigned int *_imp___baseversion_dll; -extern unsigned int *_imp___osmajor_dll; -extern unsigned int *_imp___osminor_dll; -extern unsigned int *_imp___osmode_dll; - -#define _basemajor (*_imp___basemajor_dll) -#define _baseminor (*_imp___baseminor_dll) -#define _baseversion (*_imp___baseversion_dll) -#define _osmajor (*_imp___osmajor_dll) -#define _osminor (*_imp___osminor_dll) -#define _osmode (*_imp___osmode_dll) - -#else /* __DECLSPEC_SUPPORTED */ - -__MINGW_IMPORT unsigned int _basemajor_dll; -__MINGW_IMPORT unsigned int _baseminor_dll; -__MINGW_IMPORT unsigned int _baseversion_dll; -__MINGW_IMPORT unsigned int _osmajor_dll; -__MINGW_IMPORT unsigned int _osminor_dll; -__MINGW_IMPORT unsigned int _osmode_dll; - -#define _basemajor _basemajor_dll -#define _baseminor _baseminor_dll -#define _baseversion _baseversion_dll -#define _osmajor _osmajor_dll -#define _osminor _osminor_dll -#define _osmode _osmode_dll - -#endif /* __DECLSPEC_SUPPORTED */ -#endif /* ! __MSVCRT__ */ - -#ifndef _DISKFREE_T_DEFINED -/* needed by _getdiskfree (also in direct.h) */ -struct _diskfree_t { - unsigned total_clusters; - unsigned avail_clusters; - unsigned sectors_per_cluster; - unsigned bytes_per_sector; -}; -#define _DISKFREE_T_DEFINED -#endif - -_CRTIMP unsigned __cdecl __MINGW_NOTHROW _getdiskfree (unsigned, struct _diskfree_t *); - -#ifndef _NO_OLDNAMES -# define diskfree_t _diskfree_t -#endif - -#ifdef __cplusplus -} -#endif - -#endif /* Not RC_INVOKED */ - -#endif /* Not _DOS_H_ */ diff --git a/winsup/mingw/include/errno.h b/winsup/mingw/include/errno.h deleted file mode 100644 index 675b50674..000000000 --- a/winsup/mingw/include/errno.h +++ /dev/null @@ -1,101 +0,0 @@ -/* - * errno.h - * This file has no copyright assigned and is placed in the Public Domain. - * This file is a part of the mingw-runtime package. - * No warranty is given; refer to the file DISCLAIMER within the package. - * - * Error numbers and access to error reporting. - * - */ - -#ifndef _ERRNO_H_ -#define _ERRNO_H_ - -/* All the headers include this file. */ -#include <_mingw.h> - -/* - * Error numbers. - * TODO: Can't be sure of some of these assignments, I guessed from the - * names given by strerror and the defines in the Cygnus errno.h. A lot - * of the names from the Cygnus errno.h are not represented, and a few - * of the descriptions returned by strerror do not obviously match - * their error naming. - */ -#define EPERM 1 /* Operation not permitted */ -#define ENOFILE 2 /* No such file or directory */ -#define ENOENT 2 -#define ESRCH 3 /* No such process */ -#define EINTR 4 /* Interrupted function call */ -#define EIO 5 /* Input/output error */ -#define ENXIO 6 /* No such device or address */ -#define E2BIG 7 /* Arg list too long */ -#define ENOEXEC 8 /* Exec format error */ -#define EBADF 9 /* Bad file descriptor */ -#define ECHILD 10 /* No child processes */ -#define EAGAIN 11 /* Resource temporarily unavailable */ -#define ENOMEM 12 /* Not enough space */ -#define EACCES 13 /* Permission denied */ -#define EFAULT 14 /* Bad address */ -/* 15 - Unknown Error */ -#define EBUSY 16 /* strerror reports "Resource device" */ -#define EEXIST 17 /* File exists */ -#define EXDEV 18 /* Improper link (cross-device link?) */ -#define ENODEV 19 /* No such device */ -#define ENOTDIR 20 /* Not a directory */ -#define EISDIR 21 /* Is a directory */ -#define EINVAL 22 /* Invalid argument */ -#define ENFILE 23 /* Too many open files in system */ -#define EMFILE 24 /* Too many open files */ -#define ENOTTY 25 /* Inappropriate I/O control operation */ -/* 26 - Unknown Error */ -#define EFBIG 27 /* File too large */ -#define ENOSPC 28 /* No space left on device */ -#define ESPIPE 29 /* Invalid seek (seek on a pipe?) */ -#define EROFS 30 /* Read-only file system */ -#define EMLINK 31 /* Too many links */ -#define EPIPE 32 /* Broken pipe */ -#define EDOM 33 /* Domain error (math functions) */ -#define ERANGE 34 /* Result too large (possibly too small) */ -/* 35 - Unknown Error */ -#define EDEADLOCK 36 /* Resource deadlock avoided (non-Cyg) */ -#define EDEADLK 36 -/* 37 - Unknown Error */ -#define ENAMETOOLONG 38 /* Filename too long (91 in Cyg?) */ -#define ENOLCK 39 /* No locks available (46 in Cyg?) */ -#define ENOSYS 40 /* Function not implemented (88 in Cyg?) */ -#define ENOTEMPTY 41 /* Directory not empty (90 in Cyg?) */ -#define EILSEQ 42 /* Illegal byte sequence */ - -/* - * NOTE: ENAMETOOLONG and ENOTEMPTY conflict with definitions in the - * sockets.h header provided with windows32api-0.1.2. - * You should go and put an #if 0 ... #endif around the whole block - * of errors (look at the comment above them). - */ - -#ifndef RC_INVOKED - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * Definitions of errno. For _doserrno, sys_nerr and * sys_errlist, see - * stdlib.h. - */ -#ifdef _UWIN -#undef errno -extern int errno; -#else -_CRTIMP int* __cdecl __MINGW_NOTHROW _errno(void); -#define errno (*_errno()) -#endif - -#ifdef __cplusplus -} -#endif - -#endif /* Not RC_INVOKED */ - -#endif /* Not _ERRNO_H_ */ diff --git a/winsup/mingw/include/excpt.h b/winsup/mingw/include/excpt.h deleted file mode 100644 index e75ceb78f..000000000 --- a/winsup/mingw/include/excpt.h +++ /dev/null @@ -1,102 +0,0 @@ -/* - * excpt.h - * This file has no copyright assigned and is placed in the Public Domain. - * This file is a part of the mingw-runtime package. - * No warranty is given; refer to the file DISCLAIMER within the package. - * - * Support for operating system level structured exception handling. - * - * NOTE: This is very preliminary stuff. I am also pretty sure it is - * completely Intel specific. - * - */ - -#ifndef _EXCPT_H_ -#define _EXCPT_H_ - -/* All the headers include this file. */ -#include <_mingw.h> - -#include <windef.h> - -/* - * NOTE: The constants structs and typedefs below should be defined in the - * Win32 API headers. - */ -#define EH_NONCONTINUABLE 0x01 -#define EH_UNWINDING 0x02 -#define EH_EXIT_UNWIND 0x04 -#define EH_STACK_INVALID 0x08 -#define EH_NESTED_CALL 0x10 - -#ifndef RC_INVOKED - -typedef enum { - ExceptionContinueExecution, - ExceptionContinueSearch, - ExceptionNestedException, - ExceptionCollidedUnwind -} EXCEPTION_DISPOSITION; - - -/* - * End of stuff that should be in the Win32 API files. - */ - - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * The type of function that is expected as an exception handler to be - * installed with __try1. - */ -typedef EXCEPTION_DISPOSITION (*PEXCEPTION_HANDLER) - (struct _EXCEPTION_RECORD*, void*, struct _CONTEXT*, void*); - -/* - * This is not entirely necessary, but it is the structure installed by - * the __try1 primitive below. - */ -typedef struct _EXCEPTION_REGISTRATION -{ - struct _EXCEPTION_REGISTRATION* prev; - PEXCEPTION_HANDLER handler; -} EXCEPTION_REGISTRATION, *PEXCEPTION_REGISTRATION; - -typedef EXCEPTION_REGISTRATION EXCEPTION_REGISTRATION_RECORD; -typedef PEXCEPTION_REGISTRATION PEXCEPTION_REGISTRATION_RECORD; - -/* - * A macro which installs the supplied exception handler. - * Push the pointer to the new handler onto the stack, - * then push the pointer to the old registration structure (at fs:0) - * onto the stack, then put a pointer to the new registration - * structure (i.e. the current stack pointer) at fs:0. - */ -#define __try1(pHandler) \ - __asm__ ("pushl %0;pushl %%fs:0;movl %%esp,%%fs:0;" : : "g" (pHandler)); - -/* - * A macro which (despite its name) *removes* an installed - * exception handler. Should be used only in conjunction with the above - * install routine __try1. - * Move the pointer to the old reg. struct (at the current stack - * position) to fs:0, replacing the pointer we installed above, - * then add 8 to the stack pointer to get rid of the space we - * used when we pushed on our new reg. struct above. Notice that - * the stack must be in the exact state at this point that it was - * after we did __try1 or this will smash things. - */ -#define __except1 \ - __asm__ ("movl (%%esp),%%eax;movl %%eax,%%fs:0;addl $8,%%esp;" \ - : : : "%eax"); - -#ifdef __cplusplus -} -#endif - -#endif /* Not RC_INVOKED */ - -#endif /* _EXCPT_H_ not defined */ diff --git a/winsup/mingw/include/fcntl.h b/winsup/mingw/include/fcntl.h deleted file mode 100644 index 9bff9352a..000000000 --- a/winsup/mingw/include/fcntl.h +++ /dev/null @@ -1,75 +0,0 @@ -/* - * fcntl.h - * This file has no copyright assigned and is placed in the Public Domain. - * This file is a part of the mingw-runtime package. - * No warranty is given; refer to the file DISCLAIMER within the package. - * - * Access constants for _open. Note that the permissions constants are - * in sys/stat.h (ick). - * - */ -#ifndef _FCNTL_H_ -#define _FCNTL_H_ - -/* All the headers include this file. */ -#include <_mingw.h> - -/* - * It appears that fcntl.h should include io.h for compatibility... - */ -#include <io.h> - -/* Specifiy one of these flags to define the access mode. */ -#define _O_RDONLY 0 -#define _O_WRONLY 1 -#define _O_RDWR 2 - -/* Mask for access mode bits in the _open flags. */ -#define _O_ACCMODE (_O_RDONLY|_O_WRONLY|_O_RDWR) - -#define _O_APPEND 0x0008 /* Writes will add to the end of the file. */ - -#define _O_RANDOM 0x0010 -#define _O_SEQUENTIAL 0x0020 -#define _O_TEMPORARY 0x0040 /* Make the file dissappear after closing. - * WARNING: Even if not created by _open! */ -#define _O_NOINHERIT 0x0080 - -#define _O_CREAT 0x0100 /* Create the file if it does not exist. */ -#define _O_TRUNC 0x0200 /* Truncate the file if it does exist. */ -#define _O_EXCL 0x0400 /* Open only if the file does not exist. */ - -#define _O_SHORT_LIVED 0x1000 - -/* NOTE: Text is the default even if the given _O_TEXT bit is not on. */ -#define _O_TEXT 0x4000 /* CR-LF in file becomes LF in memory. */ -#define _O_BINARY 0x8000 /* Input and output is not translated. */ -#define _O_RAW _O_BINARY - -#if (__MSVCRT_VERSION__ >= 0x0800) -#define _O_WTEXT 0x10000 -#define _O_U16TEXT 0x20000 -#define _O_U8TEXT 0x40000 -#endif - -#ifndef _NO_OLDNAMES - -/* POSIX/Non-ANSI names for increased portability */ -#define O_RDONLY _O_RDONLY -#define O_WRONLY _O_WRONLY -#define O_RDWR _O_RDWR -#define O_ACCMODE _O_ACCMODE -#define O_APPEND _O_APPEND -#define O_CREAT _O_CREAT -#define O_TRUNC _O_TRUNC -#define O_EXCL _O_EXCL -#define O_TEXT _O_TEXT -#define O_BINARY _O_BINARY -#define O_TEMPORARY _O_TEMPORARY -#define O_NOINHERIT _O_NOINHERIT -#define O_SEQUENTIAL _O_SEQUENTIAL -#define O_RANDOM _O_RANDOM - -#endif /* Not _NO_OLDNAMES */ - -#endif /* Not _FCNTL_H_ */ diff --git a/winsup/mingw/include/fenv.h b/winsup/mingw/include/fenv.h deleted file mode 100644 index ddae8921e..000000000 --- a/winsup/mingw/include/fenv.h +++ /dev/null @@ -1,107 +0,0 @@ -#ifndef _FENV_H_ -#define _FENV_H_ - -#include <_mingw.h> - -/* FPU status word exception flags */ -#define FE_INVALID 0x01 -#define FE_DENORMAL 0x02 -#define FE_DIVBYZERO 0x04 -#define FE_OVERFLOW 0x08 -#define FE_UNDERFLOW 0x10 -#define FE_INEXACT 0x20 -#define FE_ALL_EXCEPT (FE_INVALID | FE_DENORMAL | FE_DIVBYZERO \ - | FE_OVERFLOW | FE_UNDERFLOW | FE_INEXACT) - -/* FPU control word rounding flags */ -#define FE_TONEAREST 0x0000 -#define FE_DOWNWARD 0x0400 -#define FE_UPWARD 0x0800 -#define FE_TOWARDZERO 0x0c00 - -/* The MXCSR exception flags are the same as the - FE flags. */ -#define __MXCSR_EXCEPT_FLAG_SHIFT 0 - -/* How much to shift FE status word exception flags - to get the MXCSR exeptions masks, */ -#define __MXCSR_EXCEPT_MASK_SHIFT 7 - -/* How much to shift FE control word rounding flags - to get MXCSR rounding flags, */ -#define __MXCSR_ROUND_FLAG_SHIFT 3 - -#ifndef RC_INVOKED -/* - For now, support only for the basic abstraction of flags that are - either set or clear. fexcept_t could be structure that holds more - info about the fp environment. -*/ -typedef unsigned short fexcept_t; - -/* This 32-byte struct represents the entire floating point - environment as stored by fnstenv or fstenv, augmented by - the contents of the MXCSR register, as stored by stmxcsr - (if CPU supports it). */ -typedef struct -{ - unsigned short __control_word; - unsigned short __unused0; - unsigned short __status_word; - unsigned short __unused1; - unsigned short __tag_word; - unsigned short __unused2; - unsigned int __ip_offset; /* instruction pointer offset */ - unsigned short __ip_selector; - unsigned short __opcode; - unsigned int __data_offset; - unsigned short __data_selector; - unsigned short __unused3; - unsigned int __mxcsr; /* contents of the MXCSR register */ -} fenv_t; - - -/*The C99 standard (7.6.9) allows us to define implementation-specific macros for - different fp environments */ - -/* The default Intel x87 floating point environment (64-bit mantissa) */ -#define FE_PC64_ENV ((const fenv_t *)-1) - -/* The floating point environment set by MSVCRT _fpreset (53-bit mantissa) */ -#define FE_PC53_ENV ((const fenv_t *)-2) - -/* The FE_DFL_ENV macro is required by standard. - fesetenv will use the environment set at app startup.*/ -#define FE_DFL_ENV ((const fenv_t *) 0) - -#ifdef __cplusplus -extern "C" { -#endif - -/*TODO: Some of these could be inlined */ -/* 7.6.2 Exception */ - -extern int __cdecl __MINGW_NOTHROW feclearexcept (int); -extern int __cdecl __MINGW_NOTHROW fegetexceptflag (fexcept_t * flagp, int excepts); -extern int __cdecl __MINGW_NOTHROW feraiseexcept (int excepts ); -extern int __cdecl __MINGW_NOTHROW fesetexceptflag (const fexcept_t *, int); -extern int __cdecl __MINGW_NOTHROW fetestexcept (int excepts); - -/* 7.6.3 Rounding */ - -extern int __cdecl __MINGW_NOTHROW fegetround (void); -extern int __cdecl __MINGW_NOTHROW fesetround (int mode); - -/* 7.6.4 Environment */ - -extern int __cdecl __MINGW_NOTHROW fegetenv (fenv_t * envp); -extern int __cdecl __MINGW_NOTHROW fesetenv (const fenv_t * ); -extern int __cdecl __MINGW_NOTHROW feupdateenv (const fenv_t *); -extern int __cdecl __MINGW_NOTHROW feholdexcept (fenv_t *); - -#ifdef __cplusplus -} -#endif -#endif /* Not RC_INVOKED */ - -#endif /* ndef _FENV_H */ diff --git a/winsup/mingw/include/float.h b/winsup/mingw/include/float.h deleted file mode 100644 index 97a2c1cd4..000000000 --- a/winsup/mingw/include/float.h +++ /dev/null @@ -1,152 +0,0 @@ -/* - * float.h - * This file has no copyright assigned and is placed in the Public Domain. - * This file is a part of the mingw-runtime package. - * No warranty is given; refer to the file DISCLAIMER within the package. - * - * Constants related to floating point arithmetic. - * - * Also included here are some non-ANSI bits for accessing the floating - * point controller. - * - * NOTE: GCC provides float.h, but it doesn't include the non-standard - * stuff for accessing the fp controller. We include_next the - * GCC-supplied header and just define the MS-specific extensions - * here. - * - */ - -#include_next<float.h> - -#ifndef _MINGW_FLOAT_H_ -#define _MINGW_FLOAT_H_ - -/* All the headers include this file. */ -#include <_mingw.h> - -/* - * Functions and definitions for controlling the FPU. - */ -#ifndef __STRICT_ANSI__ - -/* TODO: These constants are only valid for x86 machines */ - -/* Control word masks for unMask */ -#define _MCW_EM 0x0008001F /* Error masks */ -#define _MCW_IC 0x00040000 /* Infinity */ -#define _MCW_RC 0x00000300 /* Rounding */ -#define _MCW_PC 0x00030000 /* Precision */ - -/* Control word values for unNew (use with related unMask above) */ -#define _EM_INVALID 0x00000010 -#define _EM_DENORMAL 0x00080000 -#define _EM_ZERODIVIDE 0x00000008 -#define _EM_OVERFLOW 0x00000004 -#define _EM_UNDERFLOW 0x00000002 -#define _EM_INEXACT 0x00000001 -#define _IC_AFFINE 0x00040000 -#define _IC_PROJECTIVE 0x00000000 -#define _RC_CHOP 0x00000300 -#define _RC_UP 0x00000200 -#define _RC_DOWN 0x00000100 -#define _RC_NEAR 0x00000000 -#define _PC_24 0x00020000 -#define _PC_53 0x00010000 -#define _PC_64 0x00000000 - -/* These are also defined in Mingw math.h, needed to work around - GCC build issues. */ -/* Return values for fpclass. */ -#ifndef __MINGW_FPCLASS_DEFINED -#define __MINGW_FPCLASS_DEFINED 1 -#define _FPCLASS_SNAN 0x0001 /* Signaling "Not a Number" */ -#define _FPCLASS_QNAN 0x0002 /* Quiet "Not a Number" */ -#define _FPCLASS_NINF 0x0004 /* Negative Infinity */ -#define _FPCLASS_NN 0x0008 /* Negative Normal */ -#define _FPCLASS_ND 0x0010 /* Negative Denormal */ -#define _FPCLASS_NZ 0x0020 /* Negative Zero */ -#define _FPCLASS_PZ 0x0040 /* Positive Zero */ -#define _FPCLASS_PD 0x0080 /* Positive Denormal */ -#define _FPCLASS_PN 0x0100 /* Positive Normal */ -#define _FPCLASS_PINF 0x0200 /* Positive Infinity */ -#endif /* __MINGW_FPCLASS_DEFINED */ - -/* invalid subconditions (_SW_INVALID also set) */ -#define _SW_UNEMULATED 0x0040 /* unemulated instruction */ -#define _SW_SQRTNEG 0x0080 /* square root of a neg number */ -#define _SW_STACKOVERFLOW 0x0200 /* FP stack overflow */ -#define _SW_STACKUNDERFLOW 0x0400 /* FP stack underflow */ - -/* Floating point error signals and return codes */ -#define _FPE_INVALID 0x81 -#define _FPE_DENORMAL 0x82 -#define _FPE_ZERODIVIDE 0x83 -#define _FPE_OVERFLOW 0x84 -#define _FPE_UNDERFLOW 0x85 -#define _FPE_INEXACT 0x86 -#define _FPE_UNEMULATED 0x87 -#define _FPE_SQRTNEG 0x88 -#define _FPE_STACKOVERFLOW 0x8a -#define _FPE_STACKUNDERFLOW 0x8b -#define _FPE_EXPLICITGEN 0x8c /* raise( SIGFPE ); */ - -#ifndef RC_INVOKED - -#ifdef __cplusplus -extern "C" { -#endif - -/* Set the FPU control word as cw = (cw & ~unMask) | (unNew & unMask), - * i.e. change the bits in unMask to have the values they have in unNew, - * leaving other bits unchanged. */ -_CRTIMP unsigned int __cdecl __MINGW_NOTHROW _controlfp (unsigned int unNew, unsigned int unMask); -_CRTIMP unsigned int __cdecl __MINGW_NOTHROW _control87 (unsigned int unNew, unsigned int unMask); - - -_CRTIMP unsigned int __cdecl __MINGW_NOTHROW _clearfp (void); /* Clear the FPU status word */ -_CRTIMP unsigned int __cdecl __MINGW_NOTHROW _statusfp (void); /* Report the FPU status word */ -#define _clear87 _clearfp -#define _status87 _statusfp - - -/* - MSVCRT.dll _fpreset initializes the control register to 0x27f, - the status register to zero and the tag word to 0FFFFh. - This differs from asm instruction finit/fninit which set control - word to 0x37f (64 bit mantissa precison rather than 53 bit). - By default, the mingw version of _fpreset sets fp control as - per fninit. To use the MSVCRT.dll _fpreset, include CRT_fp8.o when - building your application. -*/ -void __cdecl __MINGW_NOTHROW _fpreset (void); -void __cdecl __MINGW_NOTHROW fpreset (void); - -/* Global 'variable' for the current floating point error code. */ -_CRTIMP int * __cdecl __MINGW_NOTHROW __fpecode(void); -#define _fpecode (*(__fpecode())) - -/* - * IEEE recommended functions. MS puts them in float.h - * but they really belong in math.h. - */ - -_CRTIMP double __cdecl __MINGW_NOTHROW _chgsign (double); -_CRTIMP double __cdecl __MINGW_NOTHROW _copysign (double, double); -_CRTIMP double __cdecl __MINGW_NOTHROW _logb (double); -_CRTIMP double __cdecl __MINGW_NOTHROW _nextafter (double, double); -_CRTIMP double __cdecl __MINGW_NOTHROW _scalb (double, long); - -_CRTIMP int __cdecl __MINGW_NOTHROW _finite (double); -_CRTIMP int __cdecl __MINGW_NOTHROW _fpclass (double); -_CRTIMP int __cdecl __MINGW_NOTHROW _isnan (double); - -#ifdef __cplusplus -} -#endif - -#endif /* Not RC_INVOKED */ - -#endif /* Not __STRICT_ANSI__ */ - -#endif /* _FLOAT_H_ */ - diff --git a/winsup/mingw/include/getopt.h b/winsup/mingw/include/getopt.h deleted file mode 100644 index 00cd5473f..000000000 --- a/winsup/mingw/include/getopt.h +++ /dev/null @@ -1,100 +0,0 @@ -#ifndef __GETOPT_H__ -/* - * getopt.h - * - * $Id$ - * - * Defines constants and function prototypes required to implement - * the `getopt', `getopt_long' and `getopt_long_only' APIs. - * - * This file is part of the MinGW32 package set. - * - * Contributed by Keith Marshall <keithmarshall@users.sourceforge.net> - * - * - * THIS SOFTWARE IS NOT COPYRIGHTED - * - * This source code is offered for use in the public domain. You may - * use, modify or distribute it freely. - * - * This code is distributed in the hope that it will be useful but - * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY - * DISCLAIMED. This includes but is not limited to warranties of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * $Revision$ - * $Author$ - * $Date$ - * - */ -#define __GETOPT_H__ - -/* All the headers include this file. */ -#include <_mingw.h> - -#ifdef __cplusplus -extern "C" { -#endif - -extern int optind; /* index of first non-option in argv */ -extern int optopt; /* single option character, as parsed */ -extern int opterr; /* flag to enable built-in diagnostics... */ - /* (user may set to zero, to suppress) */ - -extern char *optarg; /* pointer to argument of current option */ - -extern int getopt( int, char * const [], const char * ); - -#ifdef __cplusplus -} -#endif -/* - * POSIX requires the `getopt' API to be specified in `unistd.h'; - * thus, `unistd.h' includes this header. However, we do not want - * to expose the `getopt_long' or `getopt_long_only' APIs, when - * included in this manner. Thus, close the standard __GETOPT_H__ - * declarations block, and open an additional __GETOPT_LONG_H__ - * specific block, only when *not* __UNISTD_H_SOURCED__, in which - * to declare the extended API. - */ -#endif /* !defined(__GETOPT_H__) */ -#if !defined(__UNISTD_H_SOURCED__) && !defined(__GETOPT_LONG_H__) -#define __GETOPT_LONG_H__ - -#ifdef __cplusplus -extern "C" { -#endif - -struct option /* specification for a long form option... */ -{ - const char *name; /* option name, without leading hyphens */ - int has_arg; /* does it take an argument? */ - int *flag; /* where to save its status, or NULL */ - int val; /* its associated status value */ -}; - -enum /* permitted values for its `has_arg' field... */ -{ - no_argument = 0, /* option never takes an argument */ - required_argument, /* option always requires an argument */ - optional_argument /* option may take an argument */ -}; - -extern int getopt_long( int, char * const [], const char *, const struct option *, int * ); -extern int getopt_long_only( int, char * const [], const char *, const struct option *, int * ); -/* - * Previous MinGW implementation had... - */ -#ifndef HAVE_DECL_GETOPT -/* - * ...for the long form API only; keep this for compatibility. - */ -# define HAVE_DECL_GETOPT 1 -#endif - -#ifdef __cplusplus -} -#endif - -#endif /* !defined(__UNISTD_H_SOURCED__) && !defined(__GETOPT_LONG_H__) */ -/* $RCSfile$Revision$: end of file */ diff --git a/winsup/mingw/include/inttypes.h b/winsup/mingw/include/inttypes.h deleted file mode 100644 index aff072585..000000000 --- a/winsup/mingw/include/inttypes.h +++ /dev/null @@ -1,278 +0,0 @@ -/* 7.8 Format conversion of integer types <inttypes.h> */ - -#ifndef _INTTYPES_H_ -#define _INTTYPES_H_ - -#include <_mingw.h> -#include <stdint.h> -#define __need_wchar_t -#include <stddef.h> - -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct { - intmax_t quot; - intmax_t rem; - } imaxdiv_t; - -#if !defined(__cplusplus) || defined(__STDC_FORMAT_MACROS) - -/* 7.8.1 Macros for format specifiers - * - * MS runtime does not yet understand C9x standard "ll" - * length specifier. It appears to treat "ll" as "l". - * The non-standard I64 length specifier causes warning in GCC, - * but understood by MS runtime functions. - */ - -/* fprintf macros for signed types */ -#define PRId8 "d" -#define PRId16 "d" -#define PRId32 "d" -#define PRId64 "I64d" - -#define PRIdLEAST8 "d" -#define PRIdLEAST16 "d" -#define PRIdLEAST32 "d" -#define PRIdLEAST64 "I64d" - -#define PRIdFAST8 "d" -#define PRIdFAST16 "d" -#define PRIdFAST32 "d" -#define PRIdFAST64 "I64d" - -#define PRIdMAX "I64d" -#define PRIdPTR "d" - -#define PRIi8 "i" -#define PRIi16 "i" -#define PRIi32 "i" -#define PRIi64 "I64i" - -#define PRIiLEAST8 "i" -#define PRIiLEAST16 "i" -#define PRIiLEAST32 "i" -#define PRIiLEAST64 "I64i" - -#define PRIiFAST8 "i" -#define PRIiFAST16 "i" -#define PRIiFAST32 "i" -#define PRIiFAST64 "I64i" - -#define PRIiMAX "I64i" -#define PRIiPTR "i" - -#define PRIo8 "o" -#define PRIo16 "o" -#define PRIo32 "o" -#define PRIo64 "I64o" - -#define PRIoLEAST8 "o" -#define PRIoLEAST16 "o" -#define PRIoLEAST32 "o" -#define PRIoLEAST64 "I64o" - -#define PRIoFAST8 "o" -#define PRIoFAST16 "o" -#define PRIoFAST32 "o" -#define PRIoFAST64 "I64o" - -#define PRIoMAX "I64o" - -#define PRIoPTR "o" - -/* fprintf macros for unsigned types */ -#define PRIu8 "u" -#define PRIu16 "u" -#define PRIu32 "u" -#define PRIu64 "I64u" - - -#define PRIuLEAST8 "u" -#define PRIuLEAST16 "u" -#define PRIuLEAST32 "u" -#define PRIuLEAST64 "I64u" - -#define PRIuFAST8 "u" -#define PRIuFAST16 "u" -#define PRIuFAST32 "u" -#define PRIuFAST64 "I64u" - -#define PRIuMAX "I64u" -#define PRIuPTR "u" - -#define PRIx8 "x" -#define PRIx16 "x" -#define PRIx32 "x" -#define PRIx64 "I64x" - -#define PRIxLEAST8 "x" -#define PRIxLEAST16 "x" -#define PRIxLEAST32 "x" -#define PRIxLEAST64 "I64x" - -#define PRIxFAST8 "x" -#define PRIxFAST16 "x" -#define PRIxFAST32 "x" -#define PRIxFAST64 "I64x" - -#define PRIxMAX "I64x" -#define PRIxPTR "x" - -#define PRIX8 "X" -#define PRIX16 "X" -#define PRIX32 "X" -#define PRIX64 "I64X" - -#define PRIXLEAST8 "X" -#define PRIXLEAST16 "X" -#define PRIXLEAST32 "X" -#define PRIXLEAST64 "I64X" - -#define PRIXFAST8 "X" -#define PRIXFAST16 "X" -#define PRIXFAST32 "X" -#define PRIXFAST64 "I64X" - -#define PRIXMAX "I64X" -#define PRIXPTR "X" - -/* - * fscanf macros for signed int types - * NOTE: if 32-bit int is used for int_fast8_t and int_fast16_t - * (see stdint.h, 7.18.1.3), FAST8 and FAST16 should have - * no length identifiers - */ - -#define SCNd16 "hd" -#define SCNd32 "d" -#define SCNd64 "I64d" - -#define SCNdLEAST16 "hd" -#define SCNdLEAST32 "d" -#define SCNdLEAST64 "I64d" - -#define SCNdFAST16 "hd" -#define SCNdFAST32 "d" -#define SCNdFAST64 "I64d" - -#define SCNdMAX "I64d" -#define SCNdPTR "d" - -#define SCNi16 "hi" -#define SCNi32 "i" -#define SCNi64 "I64i" - -#define SCNiLEAST16 "hi" -#define SCNiLEAST32 "i" -#define SCNiLEAST64 "I64i" - -#define SCNiFAST16 "hi" -#define SCNiFAST32 "i" -#define SCNiFAST64 "I64i" - -#define SCNiMAX "I64i" -#define SCNiPTR "i" - -#define SCNo16 "ho" -#define SCNo32 "o" -#define SCNo64 "I64o" - -#define SCNoLEAST16 "ho" -#define SCNoLEAST32 "o" -#define SCNoLEAST64 "I64o" - -#define SCNoFAST16 "ho" -#define SCNoFAST32 "o" -#define SCNoFAST64 "I64o" - -#define SCNoMAX "I64o" -#define SCNoPTR "o" - -#define SCNx16 "hx" -#define SCNx32 "x" -#define SCNx64 "I64x" - -#define SCNxLEAST16 "hx" -#define SCNxLEAST32 "x" -#define SCNxLEAST64 "I64x" - -#define SCNxFAST16 "hx" -#define SCNxFAST32 "x" -#define SCNxFAST64 "I64x" - -#define SCNxMAX "I64x" -#define SCNxPTR "x" - - -/* fscanf macros for unsigned int types */ - -#define SCNu16 "hu" -#define SCNu32 "u" -#define SCNu64 "I64u" - -#define SCNuLEAST16 "hu" -#define SCNuLEAST32 "u" -#define SCNuLEAST64 "I64u" - -#define SCNuFAST16 "hu" -#define SCNuFAST32 "u" -#define SCNuFAST64 "I64u" - -#define SCNuMAX "I64u" -#define SCNuPTR "u" - -#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L -/* - * no length modifier for char types prior to C9x - * MS runtime scanf appears to treat "hh" as "h" - */ - -/* signed char */ -#define SCNd8 "hhd" -#define SCNdLEAST8 "hhd" -#define SCNdFAST8 "hhd" - -#define SCNi8 "hhi" -#define SCNiLEAST8 "hhi" -#define SCNiFAST8 "hhi" - -#define SCNo8 "hho" -#define SCNoLEAST8 "hho" -#define SCNoFAST8 "hho" - -#define SCNx8 "hhx" -#define SCNxLEAST8 "hhx" -#define SCNxFAST8 "hhx" - -/* unsigned char */ -#define SCNu8 "hhu" -#define SCNuLEAST8 "hhu" -#define SCNuFAST8 "hhu" -#endif /* __STDC_VERSION__ >= 199901 */ - -#endif /* !defined(__cplusplus) || defined(__STDC_FORMAT_MACROS) */ - -__CRT_INLINE intmax_t __cdecl __MINGW_NOTHROW imaxabs (intmax_t j) - {return (j >= 0 ? j : -j);} -imaxdiv_t __cdecl __MINGW_NOTHROW imaxdiv (intmax_t numer, intmax_t denom); - -/* 7.8.2 Conversion functions for greatest-width integer types */ - -intmax_t __cdecl __MINGW_NOTHROW strtoimax (const char* __restrict__ nptr, - char** __restrict__ endptr, int base); -uintmax_t __cdecl __MINGW_NOTHROW strtoumax (const char* __restrict__ nptr, - char** __restrict__ endptr, int base); - -intmax_t __cdecl __MINGW_NOTHROW wcstoimax (const wchar_t* __restrict__ nptr, - wchar_t** __restrict__ endptr, int base); -uintmax_t __cdecl __MINGW_NOTHROW wcstoumax (const wchar_t* __restrict__ nptr, - wchar_t** __restrict__ endptr, int base); - -#ifdef __cplusplus -} -#endif - -#endif /* ndef _INTTYPES_H */ diff --git a/winsup/mingw/include/io.h b/winsup/mingw/include/io.h deleted file mode 100644 index 0d3c11045..000000000 --- a/winsup/mingw/include/io.h +++ /dev/null @@ -1,342 +0,0 @@ -/* - * io.h - * This file has no copyright assigned and is placed in the Public Domain. - * This file is a part of the mingw-runtime package. - * No warranty is given; refer to the file DISCLAIMER within the package. - * - * System level I/O functions and types. - * - */ -#ifndef _IO_H_ -#define _IO_H_ - -/* All the headers include this file. */ -#include <_mingw.h> - -/* MSVC's io.h contains the stuff from dir.h, so I will too. - * NOTE: This also defines off_t, the file offset type, through - * an inclusion of sys/types.h */ - -#include <sys/types.h> /* To get time_t. */ - -/* - * Attributes of files as returned by _findfirst et al. - */ -#define _A_NORMAL 0x00000000 -#define _A_RDONLY 0x00000001 -#define _A_HIDDEN 0x00000002 -#define _A_SYSTEM 0x00000004 -#define _A_VOLID 0x00000008 -#define _A_SUBDIR 0x00000010 -#define _A_ARCH 0x00000020 - - -#ifndef RC_INVOKED - -#ifndef _INTPTR_T_DEFINED -#define _INTPTR_T_DEFINED -#ifdef _WIN64 - typedef __int64 intptr_t; -#else - typedef int intptr_t; -#endif -#endif - -#ifndef _FSIZE_T_DEFINED -typedef unsigned long _fsize_t; -#define _FSIZE_T_DEFINED -#endif - -/* - * The maximum length of a file name. You should use GetVolumeInformation - * instead of this constant. But hey, this works. - * Also defined in stdio.h. - */ -#ifndef FILENAME_MAX -#define FILENAME_MAX (260) -#endif - -/* - * The following structure is filled in by _findfirst or _findnext when - * they succeed in finding a match. - */ -struct _finddata_t -{ - unsigned attrib; /* Attributes, see constants above. */ - time_t time_create; - time_t time_access; /* always midnight local time */ - time_t time_write; - _fsize_t size; - char name[FILENAME_MAX]; /* may include spaces. */ -}; - -struct _finddatai64_t { - unsigned attrib; - time_t time_create; - time_t time_access; - time_t time_write; - __int64 size; - char name[FILENAME_MAX]; -}; - -#if __MSVCRT_VERSION__ >= 0x0601 -struct __finddata64_t { - unsigned attrib; - __time64_t time_create; - __time64_t time_access; - __time64_t time_write; -/* 8 bytes are returned so it can't be _fsize_t */ - __int64 size; - char name[FILENAME_MAX]; -}; -#endif - -#ifndef _WFINDDATA_T_DEFINED -struct _wfinddata_t { - unsigned attrib; - time_t time_create; /* -1 for FAT file systems */ - time_t time_access; /* -1 for FAT file systems */ - time_t time_write; - _fsize_t size; - wchar_t name[FILENAME_MAX]; /* may include spaces. */ -}; - -struct _wfinddatai64_t { - unsigned attrib; - time_t time_create; - time_t time_access; - time_t time_write; - __int64 size; - wchar_t name[FILENAME_MAX]; -}; - -#if __MSVCRT_VERSION__ >= 0x0601 -struct __wfinddata64_t { - unsigned attrib; - __time64_t time_create; - __time64_t time_access; - __time64_t time_write; -/* 8 bytes are returned so it can't be _fsize_t */ - __int64 size; - wchar_t name[FILENAME_MAX]; -}; -#endif - -#define _WFINDDATA_T_DEFINED -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * Functions for searching for files. _findfirst returns -1 if no match - * is found. Otherwise it returns a handle to be used in _findnext and - * _findclose calls. _findnext also returns -1 if no match could be found, - * and 0 if a match was found. Call _findclose when you are finished. - */ -/* FIXME: Should these all use intptr_t, as per recent MSDN docs? */ -_CRTIMP long __cdecl __MINGW_NOTHROW _findfirst (const char*, struct _finddata_t*); -_CRTIMP int __cdecl __MINGW_NOTHROW _findnext (long, struct _finddata_t*); -_CRTIMP int __cdecl __MINGW_NOTHROW _findclose (long); - -_CRTIMP int __cdecl __MINGW_NOTHROW _chdir (const char*); -_CRTIMP char* __cdecl __MINGW_NOTHROW _getcwd (char*, int); -_CRTIMP int __cdecl __MINGW_NOTHROW _mkdir (const char*); -_CRTIMP char* __cdecl __MINGW_NOTHROW _mktemp (char*); -_CRTIMP int __cdecl __MINGW_NOTHROW _rmdir (const char*); -_CRTIMP int __cdecl __MINGW_NOTHROW _chmod (const char*, int); - -#ifdef __MSVCRT__ -_CRTIMP __int64 __cdecl __MINGW_NOTHROW _filelengthi64(int); -_CRTIMP long __cdecl __MINGW_NOTHROW _findfirsti64(const char*, struct _finddatai64_t*); -_CRTIMP int __cdecl __MINGW_NOTHROW _findnexti64(long, struct _finddatai64_t*); -_CRTIMP __int64 __cdecl __MINGW_NOTHROW _lseeki64(int, __int64, int); -_CRTIMP __int64 __cdecl __MINGW_NOTHROW _telli64(int); -/* These require newer versions of msvcrt.dll (6.1 or higher). */ -#if __MSVCRT_VERSION__ >= 0x0601 -_CRTIMP intptr_t __cdecl __MINGW_NOTHROW _findfirst64(const char*, struct __finddata64_t*); -_CRTIMP intptr_t __cdecl __MINGW_NOTHROW _findnext64(intptr_t, struct __finddata64_t*); -#endif /* __MSVCRT_VERSION__ >= 0x0601 */ -#ifndef __NO_MINGW_LFS -__CRT_INLINE off64_t lseek64 (int, off64_t, int); -__CRT_INLINE off64_t lseek64 (int fd, off64_t offset, int whence) -{ - return _lseeki64(fd, (__int64) offset, whence); -} -#endif - -#endif /* __MSVCRT__ */ - -#ifndef _NO_OLDNAMES - -#ifndef _UWIN -_CRTIMP int __cdecl __MINGW_NOTHROW chdir (const char*); -_CRTIMP char* __cdecl __MINGW_NOTHROW getcwd (char*, int); -_CRTIMP int __cdecl __MINGW_NOTHROW mkdir (const char*); -_CRTIMP char* __cdecl __MINGW_NOTHROW mktemp (char*); -_CRTIMP int __cdecl __MINGW_NOTHROW rmdir (const char*); -_CRTIMP int __cdecl __MINGW_NOTHROW chmod (const char*, int); -#endif /* _UWIN */ - -#endif /* Not _NO_OLDNAMES */ - -#ifdef __cplusplus -} -#endif - -#endif /* Not RC_INVOKED */ - -/* TODO: Maximum number of open handles has not been tested, I just set - * it the same as FOPEN_MAX. */ -#define HANDLE_MAX FOPEN_MAX - -/* Some defines for _access nAccessMode (MS doesn't define them, but - * it doesn't seem to hurt to add them). */ -#define F_OK 0 /* Check for file existence */ -/* Well maybe it does hurt. On newer versions of MSVCRT, an access mode - of 1 causes invalid parameter error. */ -#define X_OK 1 /* MS access() doesn't check for execute permission. */ -#define W_OK 2 /* Check for write permission */ -#define R_OK 4 /* Check for read permission */ - -#ifndef RC_INVOKED - -#ifdef __cplusplus -extern "C" { -#endif - -_CRTIMP int __cdecl __MINGW_NOTHROW _access (const char*, int); -_CRTIMP int __cdecl __MINGW_NOTHROW _chsize (int, long); -_CRTIMP int __cdecl __MINGW_NOTHROW _close (int); -_CRTIMP int __cdecl __MINGW_NOTHROW _commit(int); - -/* NOTE: The only significant bit in unPermissions appears to be bit 7 (0x80), - * the "owner write permission" bit (on FAT). */ -_CRTIMP int __cdecl __MINGW_NOTHROW _creat (const char*, int); - -_CRTIMP int __cdecl __MINGW_NOTHROW _dup (int); -_CRTIMP int __cdecl __MINGW_NOTHROW _dup2 (int, int); -_CRTIMP long __cdecl __MINGW_NOTHROW _filelength (int); -_CRTIMP long __cdecl __MINGW_NOTHROW _get_osfhandle (int); -_CRTIMP int __cdecl __MINGW_NOTHROW _isatty (int); - -/* In a very odd turn of events this function is excluded from those - * files which define _STREAM_COMPAT. This is required in order to - * build GNU libio because of a conflict with _eof in streambuf.h - * line 107. Actually I might just be able to change the name of - * the enum member in streambuf.h... we'll see. TODO */ -#ifndef _STREAM_COMPAT -_CRTIMP int __cdecl __MINGW_NOTHROW _eof (int); -#endif - -/* LK_... locking commands defined in sys/locking.h. */ -_CRTIMP int __cdecl __MINGW_NOTHROW _locking (int, int, long); - -_CRTIMP long __cdecl __MINGW_NOTHROW _lseek (int, long, int); - -/* Optional third argument is unsigned unPermissions. */ -_CRTIMP int __cdecl __MINGW_NOTHROW _open (const char*, int, ...); - -_CRTIMP int __cdecl __MINGW_NOTHROW _open_osfhandle (long, int); -_CRTIMP int __cdecl __MINGW_NOTHROW _pipe (int *, unsigned int, int); -_CRTIMP int __cdecl __MINGW_NOTHROW _read (int, void*, unsigned int); -_CRTIMP int __cdecl __MINGW_NOTHROW _setmode (int, int); -/* MS puts remove & rename (but not wide versions) in io.h as well - as in stdio.h. */ -_CRTIMP int __cdecl __MINGW_NOTHROW remove (const char*); -_CRTIMP int __cdecl __MINGW_NOTHROW rename (const char*, const char*); - -/* SH_... flags for nShFlags defined in share.h - * Optional fourth argument is unsigned unPermissions */ -_CRTIMP int __cdecl __MINGW_NOTHROW _sopen (const char*, int, int, ...); - -_CRTIMP long __cdecl __MINGW_NOTHROW _tell (int); -/* Should umask be in sys/stat.h and/or sys/types.h instead? */ -_CRTIMP int __cdecl __MINGW_NOTHROW _umask (int); -_CRTIMP int __cdecl __MINGW_NOTHROW _unlink (const char*); -_CRTIMP int __cdecl __MINGW_NOTHROW _write (int, const void*, unsigned int); - -/* Wide character versions. Also declared in wchar.h. */ -/* Not in crtdll.dll */ -#if !defined (_WIO_DEFINED) -#if defined (__MSVCRT__) -_CRTIMP int __cdecl __MINGW_NOTHROW _waccess(const wchar_t*, int); -_CRTIMP int __cdecl __MINGW_NOTHROW _wchmod(const wchar_t*, int); -_CRTIMP int __cdecl __MINGW_NOTHROW _wcreat(const wchar_t*, int); -_CRTIMP long __cdecl __MINGW_NOTHROW _wfindfirst(const wchar_t*, struct _wfinddata_t*); -_CRTIMP int __cdecl __MINGW_NOTHROW _wfindnext(long, struct _wfinddata_t *); -_CRTIMP int __cdecl __MINGW_NOTHROW _wunlink(const wchar_t*); -_CRTIMP int __cdecl __MINGW_NOTHROW _wopen(const wchar_t*, int, ...); -_CRTIMP int __cdecl __MINGW_NOTHROW _wsopen(const wchar_t*, int, int, ...); -_CRTIMP wchar_t * __cdecl __MINGW_NOTHROW _wmktemp(wchar_t*); -_CRTIMP long __cdecl __MINGW_NOTHROW _wfindfirsti64(const wchar_t*, struct _wfinddatai64_t*); -_CRTIMP int __cdecl __MINGW_NOTHROW _wfindnexti64(long, struct _wfinddatai64_t*); -#if __MSVCRT_VERSION__ >= 0x0601 -_CRTIMP intptr_t __cdecl __MINGW_NOTHROW _wfindfirst64(const wchar_t*, struct __wfinddata64_t*); -_CRTIMP intptr_t __cdecl __MINGW_NOTHROW _wfindnext64(intptr_t, struct __wfinddata64_t*); -#endif -#endif /* defined (__MSVCRT__) */ -#define _WIO_DEFINED -#endif /* _WIO_DEFINED */ - -#ifndef _NO_OLDNAMES -/* - * Non-underscored versions of non-ANSI functions to improve portability. - * These functions live in libmoldname.a. - */ - -#ifndef _UWIN -_CRTIMP int __cdecl __MINGW_NOTHROW access (const char*, int); -_CRTIMP int __cdecl __MINGW_NOTHROW chsize (int, long ); -_CRTIMP int __cdecl __MINGW_NOTHROW close (int); -_CRTIMP int __cdecl __MINGW_NOTHROW creat (const char*, int); -_CRTIMP int __cdecl __MINGW_NOTHROW dup (int); -_CRTIMP int __cdecl __MINGW_NOTHROW dup2 (int, int); -_CRTIMP int __cdecl __MINGW_NOTHROW eof (int); -_CRTIMP long __cdecl __MINGW_NOTHROW filelength (int); -_CRTIMP int __cdecl __MINGW_NOTHROW isatty (int); -_CRTIMP long __cdecl __MINGW_NOTHROW lseek (int, long, int); -_CRTIMP int __cdecl __MINGW_NOTHROW open (const char*, int, ...); -_CRTIMP int __cdecl __MINGW_NOTHROW read (int, void*, unsigned int); -_CRTIMP int __cdecl __MINGW_NOTHROW setmode (int, int); -_CRTIMP int __cdecl __MINGW_NOTHROW sopen (const char*, int, int, ...); -_CRTIMP long __cdecl __MINGW_NOTHROW tell (int); -_CRTIMP int __cdecl __MINGW_NOTHROW umask (int); -_CRTIMP int __cdecl __MINGW_NOTHROW unlink (const char*); -_CRTIMP int __cdecl __MINGW_NOTHROW write (int, const void*, unsigned int); -#endif /* _UWIN */ - -#ifdef __USE_MINGW_ACCESS -/* Old versions of MSVCRT access() just ignored X_OK, while the version - shipped with Vista, returns an error code. This will restore the - old behaviour */ -static inline int __mingw_access (const char* __fname, int __mode) - { return _access (__fname, __mode & ~X_OK); } -#define access(__f,__m) __mingw_access (__f, __m) -#endif - -/* Wide character versions. Also declared in wchar.h. */ -/* Where do these live? Not in libmoldname.a nor in libmsvcrt.a */ -#if 0 -int waccess(const wchar_t *, int); -int wchmod(const wchar_t *, int); -int wcreat(const wchar_t *, int); -long wfindfirst(wchar_t *, struct _wfinddata_t *); -int wfindnext(long, struct _wfinddata_t *); -int wunlink(const wchar_t *); -int wrename(const wchar_t *, const wchar_t *); -int wopen(const wchar_t *, int, ...); -int wsopen(const wchar_t *, int, int, ...); -wchar_t * wmktemp(wchar_t *); -#endif - -#endif /* Not _NO_OLDNAMES */ - -#ifdef __cplusplus -} -#endif - -#endif /* Not RC_INVOKED */ - -#endif /* _IO_H_ not defined */ diff --git a/winsup/mingw/include/libgen.h b/winsup/mingw/include/libgen.h deleted file mode 100755 index ff661a619..000000000 --- a/winsup/mingw/include/libgen.h +++ /dev/null @@ -1,31 +0,0 @@ -#ifndef _LIBGEN_H_ -/* - * libgen.h - * - * $Id$ - * - * This file has no copyright assigned and is placed in the Public Domain. - * This file is a part of the mingw-runtime package. - * No warranty is given; refer to the file DISCLAIMER within the package. - * - * Functions for splitting pathnames into dirname and basename components. - * - */ -#define _LIBGEN_H_ - -/* All the headers include this file. */ -#include <_mingw.h> - -#ifdef __cplusplus -extern "C" { -#endif - -extern __cdecl __MINGW_NOTHROW char *basename (char *); -extern __cdecl __MINGW_NOTHROW char *dirname (char *); - -#ifdef __cplusplus -} -#endif - -#endif /* _LIBGEN_H_: end of file */ - diff --git a/winsup/mingw/include/limits.h b/winsup/mingw/include/limits.h deleted file mode 100644 index 04f79f58c..000000000 --- a/winsup/mingw/include/limits.h +++ /dev/null @@ -1,112 +0,0 @@ -/* - * limits.h - * This file has no copyright assigned and is placed in the Public Domain. - * This file is a part of the mingw-runtime package. - * No warranty is given; refer to the file DISCLAIMER within the package. - * - * Functions for manipulating paths and directories (included from io.h) - * plus functions for setting the current drive. - * - * Defines constants for the sizes of integral types. - * - * NOTE: GCC should supply a version of this header and it should be safe to - * use that version instead of this one (maybe safer). - * - */ - -#ifndef _LIMITS_H_ -#define _LIMITS_H_ - -/* All the headers include this file. */ -#include <_mingw.h> - -/* - * File system limits - * - * TODO: NAME_MAX and OPEN_MAX are file system limits or not? Are they the - * same as FILENAME_MAX and FOPEN_MAX from stdio.h? - * NOTE: Apparently the actual size of PATH_MAX is 260, but a space is - * required for the NUL. TODO: Test? - */ -#define PATH_MAX 259 - -/* - * Characteristics of the char data type. - * - * TODO: Is MB_LEN_MAX correct? - */ -#define CHAR_BIT 8 -#define MB_LEN_MAX 2 - -#define SCHAR_MIN (-128) -#define SCHAR_MAX 127 - -#define UCHAR_MAX 255 - -/* TODO: Is this safe? I think it might just be testing the preprocessor, - * not the compiler itself... */ -#if ('\x80' < 0) -#define CHAR_MIN SCHAR_MIN -#define CHAR_MAX SCHAR_MAX -#else -#define CHAR_MIN 0 -#define CHAR_MAX UCHAR_MAX -#endif - -/* - * Maximum and minimum values for ints. - */ -#define INT_MAX 2147483647 -#define INT_MIN (-INT_MAX-1) - -#define UINT_MAX 0xffffffff - -/* - * Maximum and minimum values for shorts. - */ -#define SHRT_MAX 32767 -#define SHRT_MIN (-SHRT_MAX-1) - -#define USHRT_MAX 0xffff - -/* - * Maximum and minimum values for longs and unsigned longs. - * - * TODO: This is not correct for Alphas, which have 64 bit longs. - */ -#define LONG_MAX 2147483647L -#define LONG_MIN (-LONG_MAX-1) - -#define ULONG_MAX 0xffffffffUL - -#ifndef __STRICT_ANSI__ -/* POSIX wants this. */ -#define SSIZE_MAX LONG_MAX -#endif - -#if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) \ - || !defined(__STRICT_ANSI__) -/* ISO C9x macro names */ -#define LLONG_MAX 9223372036854775807LL -#define LLONG_MIN (-LLONG_MAX - 1) -#define ULLONG_MAX (2ULL * LLONG_MAX + 1) -#endif - -/* - * The GNU C compiler also allows 'long long int' - */ -#if !defined(__STRICT_ANSI__) && defined(__GNUC__) - -#define LONG_LONG_MAX 9223372036854775807LL -#define LONG_LONG_MIN (-LONG_LONG_MAX-1) -#define ULONG_LONG_MAX (2ULL * LONG_LONG_MAX + 1) - -/* MSVC compatibility */ -#define _I64_MIN LONG_LONG_MIN -#define _I64_MAX LONG_LONG_MAX -#define _UI64_MAX ULONG_LONG_MAX - -#endif /* Not Strict ANSI and GNU C compiler */ - - -#endif /* not _LIMITS_H_ */ diff --git a/winsup/mingw/include/locale.h b/winsup/mingw/include/locale.h deleted file mode 100644 index ee26db326..000000000 --- a/winsup/mingw/include/locale.h +++ /dev/null @@ -1,88 +0,0 @@ -/* - * locale.h - * This file has no copyright assigned and is placed in the Public Domain. - * This file is a part of the mingw-runtime package. - * No warranty is given; refer to the file DISCLAIMER within the package. - * - * Functions and types for localization (ie. changing the appearance of - * output based on the standards of a certain country). - * - */ - -#ifndef _LOCALE_H_ -#define _LOCALE_H_ - -/* All the headers include this file. */ -#include <_mingw.h> - -/* - * NOTE: I have tried to test this, but I am limited by my knowledge of - * locale issues. The structure does not bomb if you look at the - * values, and 'decimal_point' even seems to be correct. But the - * rest of the values are, by default, not particularly useful - * (read meaningless and not related to the international settings - * of the system). - */ - -#define LC_ALL 0 -#define LC_COLLATE 1 -#define LC_CTYPE 2 -#define LC_MONETARY 3 -#define LC_NUMERIC 4 -#define LC_TIME 5 -#define LC_MIN LC_ALL -#define LC_MAX LC_TIME - -#ifndef RC_INVOKED - -/* According to C89 std, NULL is defined in locale.h too. */ -#define __need_NULL -#include <stddef.h> - -/* - * The structure returned by 'localeconv'. - */ -struct lconv -{ - char* decimal_point; - char* thousands_sep; - char* grouping; - char* int_curr_symbol; - char* currency_symbol; - char* mon_decimal_point; - char* mon_thousands_sep; - char* mon_grouping; - char* positive_sign; - char* negative_sign; - char int_frac_digits; - char frac_digits; - char p_cs_precedes; - char p_sep_by_space; - char n_cs_precedes; - char n_sep_by_space; - char p_sign_posn; - char n_sign_posn; -}; - -#ifdef __cplusplus -extern "C" { -#endif - -_CRTIMP char* __cdecl __MINGW_NOTHROW setlocale (int, const char*); -_CRTIMP struct lconv* __cdecl __MINGW_NOTHROW localeconv (void); - -#ifndef _WLOCALE_DEFINED /* also declared in wchar.h */ -# define __need_wchar_t -# include <stddef.h> - _CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wsetlocale(int, const wchar_t*); -# define _WLOCALE_DEFINED -#endif /* ndef _WLOCALE_DEFINED */ - -#ifdef __cplusplus -} -#endif - -#endif /* Not RC_INVOKED */ - -#endif /* Not _LOCALE_H_ */ - diff --git a/winsup/mingw/include/malloc.h b/winsup/mingw/include/malloc.h deleted file mode 100644 index 5931b5e42..000000000 --- a/winsup/mingw/include/malloc.h +++ /dev/null @@ -1,103 +0,0 @@ -/* - * malloc.h - * This file has no copyright assigned and is placed in the Public Domain. - * This file is a part of the mingw-runtime package. - * No warranty is given; refer to the file DISCLAIMER within the package. - * - * Support for programs which want to use malloc.h to get memory management - * functions. Unless you absolutely need some of these functions and they are - * not in the ANSI headers you should use the ANSI standard header files - * instead. - * - */ - -#ifndef _MALLOC_H_ -#define _MALLOC_H_ - -/* All the headers include this file. */ -#include <_mingw.h> - -#include <stdlib.h> - -#ifndef RC_INVOKED - -/* - * The structure used to walk through the heap with _heapwalk. - */ -typedef struct _heapinfo -{ - int* _pentry; - size_t _size; - int _useflag; -} _HEAPINFO; - -/* Values for _heapinfo.useflag */ -#define _FREEENTRY 0 -#define _USEDENTRY 1 - -/* Return codes for _heapwalk() */ -#define _HEAPEMPTY (-1) -#define _HEAPOK (-2) -#define _HEAPBADBEGIN (-3) -#define _HEAPBADNODE (-4) -#define _HEAPEND (-5) -#define _HEAPBADPTR (-6) - -/* maximum size of a user request for memory */ -#define _HEAP_MAXREQ 0xFFFFFFE0 - -#ifdef __cplusplus -extern "C" { -#endif -/* - The _heap* memory allocation functions are supported on NT - but not W9x. On latter, they always set errno to ENOSYS. -*/ -_CRTIMP int __cdecl __MINGW_NOTHROW _heapwalk (_HEAPINFO*); -#ifdef __GNUC__ -#define _alloca(x) __builtin_alloca((x)) -#endif - -#ifndef _NO_OLDNAMES -_CRTIMP int __cdecl __MINGW_NOTHROW heapwalk (_HEAPINFO*); -#ifdef __GNUC__ -#define alloca(x) __builtin_alloca((x)) -#endif -#endif /* Not _NO_OLDNAMES */ - -_CRTIMP int __cdecl __MINGW_NOTHROW _heapchk (void); /* Verify heap integrety. */ -_CRTIMP int __cdecl __MINGW_NOTHROW _heapmin (void); /* Return unused heap to the OS. */ -_CRTIMP int __cdecl __MINGW_NOTHROW _heapset (unsigned int); - -_CRTIMP size_t __cdecl __MINGW_NOTHROW _msize (void*); -_CRTIMP size_t __cdecl __MINGW_NOTHROW _get_sbh_threshold (void); -_CRTIMP int __cdecl __MINGW_NOTHROW _set_sbh_threshold (size_t); -_CRTIMP void* __cdecl __MINGW_NOTHROW _expand (void*, size_t); - -/* These require msvcr70.dll or higher. */ -#if __MSVCRT_VERSION__ >= 0x0700 -_CRTIMP void * __cdecl __MINGW_NOTHROW _aligned_offset_malloc(size_t, size_t, size_t); -_CRTIMP void * __cdecl __MINGW_NOTHROW _aligned_offset_realloc(void*, size_t, size_t, size_t); -_CRTIMP void * __cdecl __MINGW_NOTHROW _aligned_offset_recalloc(void*, size_t, size_t, size_t, size_t); - -_CRTIMP void * __cdecl __MINGW_NOTHROW _aligned_malloc (size_t, size_t); -_CRTIMP void * __cdecl __MINGW_NOTHROW _aligned_realloc (void*, size_t, size_t); -_CRTIMP void* __cdecl __MINGW_NOTHROW _aligned_recalloc(void*, size_t, size_t, size_t); -_CRTIMP void __cdecl __MINGW_NOTHROW _aligned_free (void*); -#endif /* __MSVCRT_VERSION__ >= 0x0700 */ - -/* These require libmingwex.a. */ -void * __cdecl __MINGW_NOTHROW __mingw_aligned_offset_malloc (size_t, size_t, size_t); -void * __cdecl __MINGW_NOTHROW __mingw_aligned_offset_realloc (void*, size_t, size_t, size_t); - -void * __cdecl __MINGW_NOTHROW __mingw_aligned_malloc (size_t, size_t); -void * __cdecl __MINGW_NOTHROW __mingw_aligned_realloc (void*, size_t, size_t); -void __cdecl __MINGW_NOTHROW __mingw_aligned_free (void*); - -#ifdef __cplusplus -} -#endif - -#endif /* RC_INVOKED */ - -#endif /* Not _MALLOC_H_ */ diff --git a/winsup/mingw/include/math.h b/winsup/mingw/include/math.h deleted file mode 100644 index 0577d0cc2..000000000 --- a/winsup/mingw/include/math.h +++ /dev/null @@ -1,873 +0,0 @@ -/* - * math.h - * This file has no copyright assigned and is placed in the Public Domain. - * This file is a part of the mingw-runtime package. - * No warranty is given; refer to the file DISCLAIMER within the package. - * - * Mathematical functions. - * - */ - - -#ifndef _MATH_H_ -#define _MATH_H_ - -#if __GNUC__ >= 3 -#pragma GCC system_header -#endif - -/* All the headers include this file. */ -#include <_mingw.h> - -/* - * Types for the _exception structure. - */ - -#define _DOMAIN 1 /* domain error in argument */ -#define _SING 2 /* singularity */ -#define _OVERFLOW 3 /* range overflow */ -#define _UNDERFLOW 4 /* range underflow */ -#define _TLOSS 5 /* total loss of precision */ -#define _PLOSS 6 /* partial loss of precision */ - -/* - * Exception types with non-ANSI names for compatibility. - */ - -#ifndef __STRICT_ANSI__ -#ifndef _NO_OLDNAMES - -#define DOMAIN _DOMAIN -#define SING _SING -#define OVERFLOW _OVERFLOW -#define UNDERFLOW _UNDERFLOW -#define TLOSS _TLOSS -#define PLOSS _PLOSS - -#endif /* Not _NO_OLDNAMES */ -#endif /* Not __STRICT_ANSI__ */ - - -/* Traditional/XOPEN math constants (double precison) */ -#ifndef __STRICT_ANSI__ -#define M_E 2.7182818284590452354 -#define M_LOG2E 1.4426950408889634074 -#define M_LOG10E 0.43429448190325182765 -#define M_LN2 0.69314718055994530942 -#define M_LN10 2.30258509299404568402 -#define M_PI 3.14159265358979323846 -#define M_PI_2 1.57079632679489661923 -#define M_PI_4 0.78539816339744830962 -#define M_1_PI 0.31830988618379067154 -#define M_2_PI 0.63661977236758134308 -#define M_2_SQRTPI 1.12837916709551257390 -#define M_SQRT2 1.41421356237309504880 -#define M_SQRT1_2 0.70710678118654752440 -#endif - -/* These are also defined in Mingw float.h; needed here as well to work - around GCC build issues. */ -#ifndef __STRICT_ANSI__ -#ifndef __MINGW_FPCLASS_DEFINED -#define __MINGW_FPCLASS_DEFINED 1 -/* IEEE 754 classication */ -#define _FPCLASS_SNAN 0x0001 /* Signaling "Not a Number" */ -#define _FPCLASS_QNAN 0x0002 /* Quiet "Not a Number" */ -#define _FPCLASS_NINF 0x0004 /* Negative Infinity */ -#define _FPCLASS_NN 0x0008 /* Negative Normal */ -#define _FPCLASS_ND 0x0010 /* Negative Denormal */ -#define _FPCLASS_NZ 0x0020 /* Negative Zero */ -#define _FPCLASS_PZ 0x0040 /* Positive Zero */ -#define _FPCLASS_PD 0x0080 /* Positive Denormal */ -#define _FPCLASS_PN 0x0100 /* Positive Normal */ -#define _FPCLASS_PINF 0x0200 /* Positive Infinity */ -#endif /* __MINGW_FPCLASS_DEFINED */ -#endif /* Not __STRICT_ANSI__ */ - -#ifndef RC_INVOKED - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * HUGE_VAL is returned by strtod when the value would overflow the - * representation of 'double'. There are other uses as well. - * - * __imp__HUGE is a pointer to the actual variable _HUGE in - * MSVCRT.DLL. If we used _HUGE directly we would get a pointer - * to a thunk function. - * - * NOTE: The CRTDLL version uses _HUGE_dll instead. - */ - -#if __MINGW_GNUC_PREREQ(3, 3) -#define HUGE_VAL __builtin_huge_val() -#else - -#ifndef __DECLSPEC_SUPPORTED - -#ifdef __MSVCRT__ -extern double* _imp___HUGE; -#define HUGE_VAL (*_imp___HUGE) -#else -/* CRTDLL */ -extern double* _imp___HUGE_dll; -#define HUGE_VAL (*_imp___HUGE_dll) -#endif - -#else /* __DECLSPEC_SUPPORTED */ - -#ifdef __MSVCRT__ -__MINGW_IMPORT double _HUGE; -#define HUGE_VAL _HUGE -#else -/* CRTDLL */ -__MINGW_IMPORT double _HUGE_dll; -#define HUGE_VAL _HUGE_dll -#endif - -#endif /* __DECLSPEC_SUPPORTED */ -#endif /* __MINGW_GNUC_PREREQ(3, 3) */ - - -struct _exception -{ - int type; - char *name; - double arg1; - double arg2; - double retval; -}; - -_CRTIMP double __cdecl sin (double); -_CRTIMP double __cdecl cos (double); -_CRTIMP double __cdecl tan (double); -_CRTIMP double __cdecl sinh (double); -_CRTIMP double __cdecl cosh (double); -_CRTIMP double __cdecl tanh (double); -_CRTIMP double __cdecl asin (double); -_CRTIMP double __cdecl acos (double); -_CRTIMP double __cdecl atan (double); -_CRTIMP double __cdecl atan2 (double, double); -_CRTIMP double __cdecl exp (double); -_CRTIMP double __cdecl log (double); -_CRTIMP double __cdecl log10 (double); -_CRTIMP double __cdecl pow (double, double); -_CRTIMP double __cdecl sqrt (double); -_CRTIMP double __cdecl ceil (double); -_CRTIMP double __cdecl floor (double); -_CRTIMP double __cdecl fabs (double); -_CRTIMP double __cdecl ldexp (double, int); -_CRTIMP double __cdecl frexp (double, int*); -_CRTIMP double __cdecl modf (double, double*); -_CRTIMP double __cdecl fmod (double, double); - -/* Excess precision when using a 64-bit mantissa for FPU math ops can - cause unexpected results with some of the MSVCRT math functions. For - example, unless the function return value is stored (truncating to - 53-bit mantissa), calls to pow with both x and y as integral values - sometimes produce a non-integral result. - One workaround is to reset the FPU env to 53-bit mantissa - by a call to fesetenv (FE_PC53_ENV). Amother is to force storage - of the return value of individual math functions using wrappers. - NB, using these wrappers will disable builtin math functions and - hence disable the folding of function results at compile time when - arguments are constant. */ - -#if 0 -#define __DEFINE_FLOAT_STORE_MATHFN_D1(fn1) \ -static __inline__ double \ -__float_store_ ## fn1 (double x) \ -{ \ - __volatile__ double res = (fn1) (x); \ - return res; \ -} - -#define __DEFINE_FLOAT_STORE_MATHFN_D2(fn2) \ -static __inline__ double \ -__float_store_ ## fn2 (double x, double y) \ -{ \ - __volatile__ double res = (fn2) (x, y); \ - return res; \ -} -#endif - -/* For example, here is how to force the result of the pow function - to be stored: */ -#if 0 -#undef pow -/* Define the ___float_store_pow function and use it instead of pow(). */ -__DEFINE_FLOAT_STORE_MATHFN_D2 (pow) -#define pow __float_store_pow -#endif - -#ifndef __STRICT_ANSI__ - -/* Complex number (for _cabs). This is the MS version. The ISO - C99 counterpart _Complex is an intrinsic type in GCC and - 'complex' is defined as a macro. See complex.h */ -struct _complex -{ - double x; /* Real part */ - double y; /* Imaginary part */ -}; - -_CRTIMP double __cdecl _cabs (struct _complex); - -_CRTIMP double __cdecl _hypot (double, double); -_CRTIMP double __cdecl _j0 (double); -_CRTIMP double __cdecl _j1 (double); -_CRTIMP double __cdecl _jn (int, double); -_CRTIMP double __cdecl _y0 (double); -_CRTIMP double __cdecl _y1 (double); -_CRTIMP double __cdecl _yn (int, double); -_CRTIMP int __cdecl _matherr (struct _exception *); - -/* These are also declared in Mingw float.h; needed here as well to work - around GCC build issues. */ -/* BEGIN FLOAT.H COPY */ -/* - * IEEE recommended functions - */ - -_CRTIMP double __cdecl _chgsign (double); -_CRTIMP double __cdecl _copysign (double, double); -_CRTIMP double __cdecl _logb (double); -_CRTIMP double __cdecl _nextafter (double, double); -_CRTIMP double __cdecl _scalb (double, long); - -_CRTIMP int __cdecl _finite (double); -_CRTIMP int __cdecl _fpclass (double); -_CRTIMP int __cdecl _isnan (double); - -/* END FLOAT.H COPY */ - - -/* - * Non-underscored versions of non-ANSI functions. - * These reside in liboldnames.a. - */ - -#if !defined (_NO_OLDNAMES) - -_CRTIMP double __cdecl j0 (double); -_CRTIMP double __cdecl j1 (double); -_CRTIMP double __cdecl jn (int, double); -_CRTIMP double __cdecl y0 (double); -_CRTIMP double __cdecl y1 (double); -_CRTIMP double __cdecl yn (int, double); - -_CRTIMP double __cdecl chgsign (double); -/* - * scalb() is a GCC built-in. - * Exclude this _scalb() stub; the semantics are incompatible - * with the built-in implementation. - * -_CRTIMP double __cdecl scalb (double, long); - * - */ -_CRTIMP int __cdecl finite (double); -_CRTIMP int __cdecl fpclass (double); - -#define FP_SNAN _FPCLASS_SNAN -#define FP_QNAN _FPCLASS_QNAN -#define FP_NINF _FPCLASS_NINF -#define FP_PINF _FPCLASS_PINF -#define FP_NDENORM _FPCLASS_ND -#define FP_PDENORM _FPCLASS_PD -#define FP_NZERO _FPCLASS_NZ -#define FP_PZERO _FPCLASS_PZ -#define FP_NNORM _FPCLASS_NN -#define FP_PNORM _FPCLASS_PN - -#endif /* Not _NO_OLDNAMES */ - -/* This require msvcr70.dll or higher. */ -#if __MSVCRT_VERSION__ >= 0x0700 -_CRTIMP int __cdecl _set_SSE2_enable (int); -#endif /* __MSVCRT_VERSION__ >= 0x0700 */ - - -#endif /* __STRICT_ANSI__ */ - - -#ifndef __NO_ISOCEXT -#if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) \ - || !defined __STRICT_ANSI__ || defined __cplusplus - -#if __MINGW_GNUC_PREREQ(3, 3) -#define HUGE_VALF __builtin_huge_valf() -#define HUGE_VALL __builtin_huge_vall() -#define INFINITY __builtin_inf() -#define NAN __builtin_nan("") -#else -extern const float __INFF; -#define HUGE_VALF __INFF -extern const long double __INFL; -#define HUGE_VALL __INFL -#define INFINITY HUGE_VALF -extern const double __QNAN; -#define NAN __QNAN -#endif /* __MINGW_GNUC_PREREQ(3, 3) */ - -/* Use the compiler's builtin define for FLT_EVAL_METHOD to - set float_t and double_t. */ -#if defined(__FLT_EVAL_METHOD__) -# if ( __FLT_EVAL_METHOD__== 0) -typedef float float_t; -typedef double double_t; -# elif (__FLT_EVAL_METHOD__ == 1) -typedef double float_t; -typedef double double_t; -# elif (__FLT_EVAL_METHOD__ == 2) -typedef long double float_t; -typedef long double double_t; -#endif -#else /* ix87 FPU default */ -typedef long double float_t; -typedef long double double_t; -#endif - -/* 7.12.3.1 */ -/* - Return values for fpclassify. - These are based on Intel x87 fpu condition codes - in the high byte of status word and differ from - the return values for MS IEEE 754 extension _fpclass() -*/ -#define FP_NAN 0x0100 -#define FP_NORMAL 0x0400 -#define FP_INFINITE (FP_NAN | FP_NORMAL) -#define FP_ZERO 0x4000 -#define FP_SUBNORMAL (FP_NORMAL | FP_ZERO) -/* 0x0200 is signbit mask */ - - -/* - We can't inline float or double, because we want to ensure truncation - to semantic type before classification. - (A normal long double value might become subnormal when - converted to double, and zero when converted to float.) -*/ - -extern int __cdecl __fpclassifyf (float); -extern int __cdecl __fpclassify (double); - -__CRT_INLINE int __cdecl __fpclassifyl (long double x){ - unsigned short sw; - __asm__ ("fxam; fstsw %%ax;" : "=a" (sw): "t" (x)); - return sw & (FP_NAN | FP_NORMAL | FP_ZERO ); -} - -#define fpclassify(x) (sizeof (x) == sizeof (float) ? __fpclassifyf (x) \ - : sizeof (x) == sizeof (double) ? __fpclassify (x) \ - : __fpclassifyl (x)) - -/* 7.12.3.2 */ -#define isfinite(x) ((fpclassify(x) & FP_NAN) == 0) - -/* 7.12.3.3 */ -#define isinf(x) (fpclassify(x) == FP_INFINITE) - -/* 7.12.3.4 */ -/* We don't need to worry about truncation here: - A NaN stays a NaN. */ - -__CRT_INLINE int __cdecl __isnan (double _x) -{ - unsigned short sw; - __asm__ ("fxam;" - "fstsw %%ax": "=a" (sw) : "t" (_x)); - return (sw & (FP_NAN | FP_NORMAL | FP_INFINITE | FP_ZERO | FP_SUBNORMAL)) - == FP_NAN; -} - -__CRT_INLINE int __cdecl __isnanf (float _x) -{ - unsigned short sw; - __asm__ ("fxam;" - "fstsw %%ax": "=a" (sw) : "t" (_x)); - return (sw & (FP_NAN | FP_NORMAL | FP_INFINITE | FP_ZERO | FP_SUBNORMAL)) - == FP_NAN; -} - -__CRT_INLINE int __cdecl __isnanl (long double _x) -{ - unsigned short sw; - __asm__ ("fxam;" - "fstsw %%ax": "=a" (sw) : "t" (_x)); - return (sw & (FP_NAN | FP_NORMAL | FP_INFINITE | FP_ZERO | FP_SUBNORMAL)) - == FP_NAN; -} - - -#define isnan(x) (sizeof (x) == sizeof (float) ? __isnanf (x) \ - : sizeof (x) == sizeof (double) ? __isnan (x) \ - : __isnanl (x)) - -/* 7.12.3.5 */ -#define isnormal(x) (fpclassify(x) == FP_NORMAL) - -/* 7.12.3.6 The signbit macro */ -__CRT_INLINE int __cdecl __signbit (double x) { - unsigned short stw; - __asm__ ( "fxam; fstsw %%ax;": "=a" (stw) : "t" (x)); - return (stw & 0x0200) != 0; -} - -__CRT_INLINE int __cdecl __signbitf (float x) { - unsigned short stw; - __asm__ ("fxam; fstsw %%ax;": "=a" (stw) : "t" (x)); - return (stw & 0x0200) != 0; -} - -__CRT_INLINE int __cdecl __signbitl (long double x) { - unsigned short stw; - __asm__ ("fxam; fstsw %%ax;": "=a" (stw) : "t" (x)); - return (stw & 0x0200) != 0; -} - -#define signbit(x) (sizeof (x) == sizeof (float) ? __signbitf (x) \ - : sizeof (x) == sizeof (double) ? __signbit (x) \ - : __signbitl (x)) - -/* 7.12.4 Trigonometric functions: Double in C89 */ -extern float __cdecl sinf (float); -extern long double __cdecl sinl (long double); - -extern float __cdecl cosf (float); -extern long double __cdecl cosl (long double); - -extern float __cdecl tanf (float); -extern long double __cdecl tanl (long double); - -extern float __cdecl asinf (float); -extern long double __cdecl asinl (long double); - -extern float __cdecl acosf (float); -extern long double __cdecl acosl (long double); - -extern float __cdecl atanf (float); -extern long double __cdecl atanl (long double); - -extern float __cdecl atan2f (float, float); -extern long double __cdecl atan2l (long double, long double); - -/* 7.12.5 Hyperbolic functions: Double in C89 */ -__CRT_INLINE float __cdecl sinhf (float x) - {return (float) sinh (x);} -extern long double __cdecl sinhl (long double); - -__CRT_INLINE float __cdecl coshf (float x) - {return (float) cosh (x);} -extern long double __cdecl coshl (long double); - -__CRT_INLINE float __cdecl tanhf (float x) - {return (float) tanh (x);} -extern long double __cdecl tanhl (long double); - -/* Inverse hyperbolic trig functions */ -/* 7.12.5.1 */ -extern double __cdecl acosh (double); -extern float __cdecl acoshf (float); -extern long double __cdecl acoshl (long double); - -/* 7.12.5.2 */ -extern double __cdecl asinh (double); -extern float __cdecl asinhf (float); -extern long double __cdecl asinhl (long double); - -/* 7.12.5.3 */ -extern double __cdecl atanh (double); -extern float __cdecl atanhf (float); -extern long double __cdecl atanhl (long double); - -/* Exponentials and logarithms */ -/* 7.12.6.1 Double in C89 */ -__CRT_INLINE float __cdecl expf (float x) - {return (float) exp (x);} -extern long double __cdecl expl (long double); - -/* 7.12.6.2 */ -extern double __cdecl exp2(double); -extern float __cdecl exp2f(float); -extern long double __cdecl exp2l(long double); - -/* 7.12.6.3 The expm1 functions */ -/* TODO: These could be inlined */ -extern double __cdecl expm1(double); -extern float __cdecl expm1f(float); -extern long double __cdecl expm1l(long double); - -/* 7.12.6.4 Double in C89 */ -__CRT_INLINE float __cdecl frexpf (float x, int* expn) - {return (float) frexp (x, expn);} -extern long double __cdecl frexpl (long double, int*); - -/* 7.12.6.5 */ -#define FP_ILOGB0 ((int)0x80000000) -#define FP_ILOGBNAN ((int)0x80000000) -extern int __cdecl ilogb (double); -extern int __cdecl ilogbf (float); -extern int __cdecl ilogbl (long double); - -/* 7.12.6.6 Double in C89 */ -__CRT_INLINE float __cdecl ldexpf (float x, int expn) - {return (float) ldexp (x, expn);} -extern long double __cdecl ldexpl (long double, int); - -/* 7.12.6.7 Double in C89 */ -extern float __cdecl logf (float); -extern long double __cdecl logl (long double); - -/* 7.12.6.8 Double in C89 */ -extern float __cdecl log10f (float); -extern long double __cdecl log10l (long double); - -/* 7.12.6.9 */ -extern double __cdecl log1p(double); -extern float __cdecl log1pf(float); -extern long double __cdecl log1pl(long double); - -/* 7.12.6.10 */ -extern double __cdecl log2 (double); -extern float __cdecl log2f (float); -extern long double __cdecl log2l (long double); - -/* 7.12.6.11 */ -extern double __cdecl logb (double); -extern float __cdecl logbf (float); -extern long double __cdecl logbl (long double); - -/* Inline versions. GCC-4.0+ can do a better fast-math optimization - with __builtins. */ -#if !(__MINGW_GNUC_PREREQ (4, 0) && defined __FAST_MATH__ ) -__CRT_INLINE double __cdecl logb (double x) -{ - double res; - __asm__ ("fxtract\n\t" - "fstp %%st" : "=t" (res) : "0" (x)); - return res; -} - -__CRT_INLINE float __cdecl logbf (float x) -{ - float res; - __asm__ ("fxtract\n\t" - "fstp %%st" : "=t" (res) : "0" (x)); - return res; -} - -__CRT_INLINE long double __cdecl logbl (long double x) -{ - long double res; - __asm__ ("fxtract\n\t" - "fstp %%st" : "=t" (res) : "0" (x)); - return res; -} -#endif /* !defined __FAST_MATH__ || !__MINGW_GNUC_PREREQ (4, 0) */ - -/* 7.12.6.12 Double in C89 */ -extern float __cdecl modff (float, float*); -extern long double __cdecl modfl (long double, long double*); - -/* 7.12.6.13 */ -extern double __cdecl scalbn (double, int); -extern float __cdecl scalbnf (float, int); -extern long double __cdecl scalbnl (long double, int); - -extern double __cdecl scalbln (double, long); -extern float __cdecl scalblnf (float, long); -extern long double __cdecl scalblnl (long double, long); - -/* 7.12.7.1 */ -/* Implementations adapted from Cephes versions */ -extern double __cdecl cbrt (double); -extern float __cdecl cbrtf (float); -extern long double __cdecl cbrtl (long double); - -/* 7.12.7.2 The fabs functions: Double in C89 */ -extern float __cdecl fabsf (float x); -extern long double __cdecl fabsl (long double x); - -/* 7.12.7.3 */ -extern double __cdecl hypot (double, double); /* in libmoldname.a */ -__CRT_INLINE float __cdecl hypotf (float x, float y) - { return (float) hypot (x, y);} -extern long double __cdecl hypotl (long double, long double); - -/* 7.12.7.4 The pow functions. Double in C89 */ -__CRT_INLINE float __cdecl powf (float x, float y) - {return (float) pow (x, y);} -extern long double __cdecl powl (long double, long double); - -/* 7.12.7.5 The sqrt functions. Double in C89. */ -extern float __cdecl sqrtf (float); -extern long double __cdecl sqrtl (long double); - -/* 7.12.8.1 The erf functions */ -extern double __cdecl erf (double); -extern float __cdecl erff (float); -extern long double __cdecl erfl (long double); - -/* 7.12.8.2 The erfc functions */ -extern double __cdecl erfc (double); -extern float __cdecl erfcf (float); -extern long double __cdecl erfcl (long double); - -/* 7.12.8.3 The lgamma functions */ -extern double __cdecl lgamma (double); -extern float __cdecl lgammaf (float); -extern long double __cdecl lgammal (long double); - -/* 7.12.8.4 The tgamma functions */ -extern double __cdecl tgamma (double); -extern float __cdecl tgammaf (float); -extern long double __cdecl tgammal (long double); - -/* 7.12.9.1 Double in C89 */ -extern float __cdecl ceilf (float); -extern long double __cdecl ceill (long double); - -/* 7.12.9.2 Double in C89 */ -extern float __cdecl floorf (float); -extern long double __cdecl floorl (long double); - -/* 7.12.9.3 */ -extern double __cdecl nearbyint ( double); -extern float __cdecl nearbyintf (float); -extern long double __cdecl nearbyintl (long double); - -/* 7.12.9.4 */ -/* round, using fpu control word settings */ -extern double __cdecl rint (double); -extern float __cdecl rintf (float); -extern long double __cdecl rintl (long double); - -/* 7.12.9.5 */ -extern long __cdecl lrint (double); -extern long __cdecl lrintf (float); -extern long __cdecl lrintl (long double); - -extern long long __cdecl llrint (double); -extern long long __cdecl llrintf (float); -extern long long __cdecl llrintl (long double); - -/* Inline versions of above. - GCC 4.0+ can do a better fast-math job with __builtins. */ -#if !(__MINGW_GNUC_PREREQ (4, 0) && defined __FAST_MATH__ ) -__CRT_INLINE double __cdecl rint (double x) -{ - double retval; - __asm__ ("frndint;": "=t" (retval) : "0" (x)); - return retval; -} - -__CRT_INLINE float __cdecl rintf (float x) -{ - float retval; - __asm__ ("frndint;" : "=t" (retval) : "0" (x) ); - return retval; -} - -__CRT_INLINE long double __cdecl rintl (long double x) -{ - long double retval; - __asm__ ("frndint;" : "=t" (retval) : "0" (x) ); - return retval; -} - -__CRT_INLINE long __cdecl lrint (double x) -{ - long retval; - __asm__ __volatile__ - ("fistpl %0" : "=m" (retval) : "t" (x) : "st"); - return retval; -} - -__CRT_INLINE long __cdecl lrintf (float x) -{ - long retval; - __asm__ __volatile__ - ("fistpl %0" : "=m" (retval) : "t" (x) : "st"); - return retval; -} - -__CRT_INLINE long __cdecl lrintl (long double x) -{ - long retval; - __asm__ __volatile__ - ("fistpl %0" : "=m" (retval) : "t" (x) : "st"); - return retval; -} - -__CRT_INLINE long long __cdecl llrint (double x) -{ - long long retval; - __asm__ __volatile__ - ("fistpll %0" : "=m" (retval) : "t" (x) : "st"); - return retval; -} - -__CRT_INLINE long long __cdecl llrintf (float x) -{ - long long retval; - __asm__ __volatile__ - ("fistpll %0" : "=m" (retval) : "t" (x) : "st"); - return retval; -} - -__CRT_INLINE long long __cdecl llrintl (long double x) -{ - long long retval; - __asm__ __volatile__ - ("fistpll %0" : "=m" (retval) : "t" (x) : "st"); - return retval; -} -#endif /* !__FAST_MATH__ || !__MINGW_GNUC_PREREQ (4,0) */ - -/* 7.12.9.6 */ -/* round away from zero, regardless of fpu control word settings */ -extern double __cdecl round (double); -extern float __cdecl roundf (float); -extern long double __cdecl roundl (long double); - -/* 7.12.9.7 */ -extern long __cdecl lround (double); -extern long __cdecl lroundf (float); -extern long __cdecl lroundl (long double); - -extern long long __cdecl llround (double); -extern long long __cdecl llroundf (float); -extern long long __cdecl llroundl (long double); - -/* 7.12.9.8 */ -/* round towards zero, regardless of fpu control word settings */ -extern double __cdecl trunc (double); -extern float __cdecl truncf (float); -extern long double __cdecl truncl (long double); - -/* 7.12.10.1 Double in C89 */ -extern float __cdecl fmodf (float, float); -extern long double __cdecl fmodl (long double, long double); - -/* 7.12.10.2 */ -extern double __cdecl remainder (double, double); -extern float __cdecl remainderf (float, float); -extern long double __cdecl remainderl (long double, long double); - -/* 7.12.10.3 */ -extern double __cdecl remquo(double, double, int *); -extern float __cdecl remquof(float, float, int *); -extern long double __cdecl remquol(long double, long double, int *); - -/* 7.12.11.1 */ -extern double __cdecl copysign (double, double); /* in libmoldname.a */ -extern float __cdecl copysignf (float, float); -extern long double __cdecl copysignl (long double, long double); - -/* 7.12.11.2 Return a NaN */ -extern double __cdecl nan(const char *tagp); -extern float __cdecl nanf(const char *tagp); -extern long double __cdecl nanl(const char *tagp); - -#ifndef __STRICT_ANSI__ -#define _nan() nan("") -#define _nanf() nanf("") -#define _nanl() nanl("") -#endif - -/* 7.12.11.3 */ -extern double __cdecl nextafter (double, double); /* in libmoldname.a */ -extern float __cdecl nextafterf (float, float); -extern long double __cdecl nextafterl (long double, long double); - -/* 7.12.11.4 The nexttoward functions */ -extern double __cdecl nexttoward (double, long double); -extern float __cdecl nexttowardf (float, long double); -extern long double __cdecl nexttowardl (long double, long double); - -/* 7.12.12.1 */ -/* x > y ? (x - y) : 0.0 */ -extern double __cdecl fdim (double x, double y); -extern float __cdecl fdimf (float x, float y); -extern long double __cdecl fdiml (long double x, long double y); - -/* fmax and fmin. - NaN arguments are treated as missing data: if one argument is a NaN - and the other numeric, then these functions choose the numeric - value. */ - -/* 7.12.12.2 */ -extern double __cdecl fmax (double, double); -extern float __cdecl fmaxf (float, float); -extern long double __cdecl fmaxl (long double, long double); - -/* 7.12.12.3 */ -extern double __cdecl fmin (double, double); -extern float __cdecl fminf (float, float); -extern long double __cdecl fminl (long double, long double); - -/* 7.12.13.1 */ -/* return x * y + z as a ternary op */ -extern double __cdecl fma (double, double, double); -extern float __cdecl fmaf (float, float, float); -extern long double __cdecl fmal (long double, long double, long double); - - -/* 7.12.14 */ -/* - * With these functions, comparisons involving quiet NaNs set the FP - * condition code to "unordered". The IEEE floating-point spec - * dictates that the result of floating-point comparisons should be - * false whenever a NaN is involved, with the exception of the != op, - * which always returns true: yes, (NaN != NaN) is true). - */ - -#if __GNUC__ >= 3 - -#define isgreater(x, y) __builtin_isgreater(x, y) -#define isgreaterequal(x, y) __builtin_isgreaterequal(x, y) -#define isless(x, y) __builtin_isless(x, y) -#define islessequal(x, y) __builtin_islessequal(x, y) -#define islessgreater(x, y) __builtin_islessgreater(x, y) -#define isunordered(x, y) __builtin_isunordered(x, y) - -#else -/* helper */ -__CRT_INLINE int __cdecl -__fp_unordered_compare (long double x, long double y){ - unsigned short retval; - __asm__ ("fucom %%st(1);" - "fnstsw;": "=a" (retval) : "t" (x), "u" (y)); - return retval; -} - -#define isgreater(x, y) ((__fp_unordered_compare(x, y) \ - & 0x4500) == 0) -#define isless(x, y) ((__fp_unordered_compare (y, x) \ - & 0x4500) == 0) -#define isgreaterequal(x, y) ((__fp_unordered_compare (x, y) \ - & FP_INFINITE) == 0) -#define islessequal(x, y) ((__fp_unordered_compare(y, x) \ - & FP_INFINITE) == 0) -#define islessgreater(x, y) ((__fp_unordered_compare(x, y) \ - & FP_SUBNORMAL) == 0) -#define isunordered(x, y) ((__fp_unordered_compare(x, y) \ - & 0x4500) == 0x4500) - -#endif - - -#endif /* __STDC_VERSION__ >= 199901L */ -#endif /* __NO_ISOCEXT */ - - -#ifdef __cplusplus -} -#endif -#endif /* Not RC_INVOKED */ - - -#endif /* Not _MATH_H_ */ diff --git a/winsup/mingw/include/mbctype.h b/winsup/mingw/include/mbctype.h deleted file mode 100644 index 012143700..000000000 --- a/winsup/mingw/include/mbctype.h +++ /dev/null @@ -1,97 +0,0 @@ -/* - * mbctype.h - * - * Functions for testing multibyte character types and converting characters. - * - * This file is part of the Mingw32 package. - * - * - * THIS SOFTWARE IS NOT COPYRIGHTED - * - * This source code is offered for use in the public domain. You may - * use, modify or distribute it freely. - * - * This code is distributed in the hope that it will be useful but - * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY - * DISCLAIMED. This includes but is not limited to warranties of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - */ - -#ifndef _MBCTYPE_H_ -#define _MBCTYPE_H_ - -/* All the headers include this file. */ -#include <_mingw.h> - -/* return values for _mbsbtype and _mbbtype in mbstring.h */ -#define _MBC_SINGLE 0 -#define _MBC_LEAD 1 -#define _MBC_TRAIL 2 -#define _MBC_ILLEGAL (-1) - -/* args for setmbcp (in lieu of actual codepage) */ -#define _MB_CP_SBCS 0 -#define _MB_CP_OEM (-2) -#define _MB_CP_ANSI (-3) -#define _MB_CP_LOCALE (-4) - -/* TODO: bit masks */ -/* -#define _MS -#define _MP -#define _M1 -#define _M2 -#define _SBUP -#define _SBLOW -*/ - -#ifndef RC_INVOKED - -#ifdef __cplusplus -extern "C" { -#endif - -#ifndef __STRICT_ANSI__ - -_CRTIMP int __cdecl __MINGW_NOTHROW _setmbcp (int); -_CRTIMP int __cdecl __MINGW_NOTHROW _getmbcp (void); - -/* byte classification */ -/* NB: Corresponding _ismbc* functions are in mbstring.h */ - -_CRTIMP int __cdecl __MINGW_NOTHROW _ismbbalpha (unsigned int); -_CRTIMP int __cdecl __MINGW_NOTHROW _ismbbalnum (unsigned int); -_CRTIMP int __cdecl __MINGW_NOTHROW _ismbbgraph (unsigned int); -_CRTIMP int __cdecl __MINGW_NOTHROW _ismbbprint (unsigned int); -_CRTIMP int __cdecl __MINGW_NOTHROW _ismbbpunct (unsigned int); - -_CRTIMP int __cdecl __MINGW_NOTHROW _ismbbkana (unsigned int); -_CRTIMP int __cdecl __MINGW_NOTHROW _ismbbkalnum (unsigned int); -_CRTIMP int __cdecl __MINGW_NOTHROW _ismbbkprint (unsigned int); -_CRTIMP int __cdecl __MINGW_NOTHROW _ismbbkpunct (unsigned int); - - -/* these are also in mbstring.h */ -_CRTIMP int __cdecl __MINGW_NOTHROW _ismbblead (unsigned int); -_CRTIMP int __cdecl __MINGW_NOTHROW _ismbbtrail (unsigned int); -_CRTIMP int __cdecl __MINGW_NOTHROW _ismbslead (const unsigned char*, const unsigned char*); -_CRTIMP int __cdecl __MINGW_NOTHROW _ismbstrail (const unsigned char*, const unsigned char*); - -#ifdef __DECLSPEC_SUPPORTED -__MINGW_IMPORT unsigned char _mbctype[]; -__MINGW_IMPORT unsigned char _mbcasemap[]; -#endif - -/* TODO : _MBCS_ mappings go in tchar.h */ - -#endif /* Not strict ANSI */ - -#ifdef __cplusplus -} -#endif - -#endif /* Not RC_INVOKED */ - -#endif /* Not _MCTYPE_H_ */ - diff --git a/winsup/mingw/include/mbstring.h b/winsup/mingw/include/mbstring.h deleted file mode 100644 index 19261feda..000000000 --- a/winsup/mingw/include/mbstring.h +++ /dev/null @@ -1,132 +0,0 @@ -/* - * mbstring.h - * - * Protototypes for string functions supporting multibyte characters. - * - * This file is part of the Mingw32 package. - * - * - * THIS SOFTWARE IS NOT COPYRIGHTED - * - * This source code is offered for use in the public domain. You may - * use, modify or distribute it freely. - * - * This code is distributed in the hope that it will be useful but - * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY - * DISCLAIMED. This includes but is not limited to warranties of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - */ - -#ifndef _MBSTRING_H_ -#define _MBSTRING_H_ - -/* All the headers include this file. */ -#include <_mingw.h> - -#ifndef RC_INVOKED - -#define __need_size_t -#include <stddef.h> - -#ifdef __cplusplus -extern "C" { -#endif - -#ifndef __STRICT_ANSI__ - -/* character classification */ -_CRTIMP int __cdecl __MINGW_NOTHROW _ismbcalnum (unsigned int); -_CRTIMP int __cdecl __MINGW_NOTHROW _ismbcalpha (unsigned int); -_CRTIMP int __cdecl __MINGW_NOTHROW _ismbcdigit (unsigned int); -_CRTIMP int __cdecl __MINGW_NOTHROW _ismbcgraph (unsigned int); -_CRTIMP int __cdecl __MINGW_NOTHROW _ismbcprint (unsigned int); -_CRTIMP int __cdecl __MINGW_NOTHROW _ismbcpunct (unsigned int); -_CRTIMP int __cdecl __MINGW_NOTHROW _ismbcspace (unsigned int); -_CRTIMP int __cdecl __MINGW_NOTHROW _ismbclower (unsigned int); -_CRTIMP int __cdecl __MINGW_NOTHROW _ismbcupper (unsigned int); -_CRTIMP int __cdecl __MINGW_NOTHROW _ismbclegal (unsigned int); -_CRTIMP int __cdecl __MINGW_NOTHROW _ismbcsymbol (unsigned int); - - -/* also in mbctype.h */ -_CRTIMP int __cdecl __MINGW_NOTHROW _ismbblead (unsigned int ); -_CRTIMP int __cdecl __MINGW_NOTHROW _ismbbtrail (unsigned int ); -_CRTIMP int __cdecl __MINGW_NOTHROW _ismbslead ( const unsigned char*, const unsigned char*); -_CRTIMP int __cdecl __MINGW_NOTHROW _ismbstrail ( const unsigned char*, const unsigned char*); - -_CRTIMP unsigned int __cdecl __MINGW_NOTHROW _mbctolower (unsigned int); -_CRTIMP unsigned int __cdecl __MINGW_NOTHROW _mbctoupper (unsigned int); - -_CRTIMP void __cdecl __MINGW_NOTHROW _mbccpy (unsigned char*, const unsigned char*); -_CRTIMP size_t __cdecl __MINGW_NOTHROW _mbclen (const unsigned char*); - -_CRTIMP unsigned int __cdecl __MINGW_NOTHROW _mbbtombc (unsigned int); -_CRTIMP unsigned int __cdecl __MINGW_NOTHROW _mbctombb (unsigned int); - -/* Return value constants for these are defined in mbctype.h. */ -_CRTIMP int __cdecl __MINGW_NOTHROW _mbbtype (unsigned char, int); -_CRTIMP int __cdecl __MINGW_NOTHROW _mbsbtype (const unsigned char*, size_t); - -_CRTIMP unsigned char* __cdecl __MINGW_NOTHROW _mbscpy (unsigned char*, const unsigned char*); -_CRTIMP unsigned char* __cdecl __MINGW_NOTHROW _mbsncpy (unsigned char*, const unsigned char*, size_t); -_CRTIMP unsigned char* __cdecl __MINGW_NOTHROW _mbsnbcpy (unsigned char*, const unsigned char*, size_t); -_CRTIMP unsigned char* __cdecl __MINGW_NOTHROW _mbsset (unsigned char*, unsigned int); -_CRTIMP unsigned char* __cdecl __MINGW_NOTHROW _mbsnset (unsigned char*, unsigned int, size_t); -_CRTIMP unsigned char* __cdecl __MINGW_NOTHROW _mbsnbset (unsigned char*, unsigned int, size_t); -_CRTIMP unsigned char* __cdecl __MINGW_NOTHROW _mbsdup (const unsigned char*); -_CRTIMP unsigned char* __cdecl __MINGW_NOTHROW _mbsrev (unsigned char*); -_CRTIMP unsigned char* __cdecl __MINGW_NOTHROW _mbscat (unsigned char*, const unsigned char*); -_CRTIMP unsigned char* __cdecl __MINGW_NOTHROW _mbsncat (unsigned char*, const unsigned char*, size_t); -_CRTIMP unsigned char* __cdecl __MINGW_NOTHROW _mbsnbcat (unsigned char*, const unsigned char*, size_t); -_CRTIMP size_t __cdecl __MINGW_NOTHROW _mbslen (const unsigned char*); -_CRTIMP size_t __cdecl __MINGW_NOTHROW _mbsnbcnt (const unsigned char*, size_t); -_CRTIMP size_t __cdecl __MINGW_NOTHROW _mbsnccnt (const unsigned char*, size_t); -_CRTIMP unsigned char* __cdecl __MINGW_NOTHROW _mbschr (const unsigned char*, unsigned int); -_CRTIMP unsigned char* __cdecl __MINGW_NOTHROW _mbsrchr (const unsigned char*, unsigned int); -_CRTIMP size_t __cdecl __MINGW_NOTHROW _mbsspn (const unsigned char*, const unsigned char*); -_CRTIMP size_t __cdecl __MINGW_NOTHROW _mbscspn (const unsigned char*, const unsigned char*); -_CRTIMP unsigned char* __cdecl __MINGW_NOTHROW _mbsspnp (const unsigned char*, const unsigned char*); -_CRTIMP unsigned char* __cdecl __MINGW_NOTHROW _mbspbrk (const unsigned char*, const unsigned char*); -_CRTIMP int __cdecl __MINGW_NOTHROW _mbscmp (const unsigned char*, const unsigned char*); -_CRTIMP int __cdecl __MINGW_NOTHROW _mbsicmp (const unsigned char*, const unsigned char*); -_CRTIMP int __cdecl __MINGW_NOTHROW _mbsncmp (const unsigned char*, const unsigned char*, size_t); -_CRTIMP int __cdecl __MINGW_NOTHROW _mbsnicmp (const unsigned char*, const unsigned char*, size_t); -_CRTIMP int __cdecl __MINGW_NOTHROW _mbsnbcmp (const unsigned char*, const unsigned char*, size_t); -_CRTIMP int __cdecl __MINGW_NOTHROW _mbsnbicmp (const unsigned char*, const unsigned char*, size_t); -_CRTIMP int __cdecl __MINGW_NOTHROW _mbscoll (const unsigned char*, const unsigned char*); -_CRTIMP int __cdecl __MINGW_NOTHROW _mbsicoll (const unsigned char*, const unsigned char*); -_CRTIMP int __cdecl __MINGW_NOTHROW _mbsncoll (const unsigned char*, const unsigned char*, size_t); -_CRTIMP int __cdecl __MINGW_NOTHROW _mbsnicoll (const unsigned char*, const unsigned char*, size_t); -_CRTIMP int __cdecl __MINGW_NOTHROW _mbsnbcoll (const unsigned char*, const unsigned char*, size_t); -_CRTIMP int __cdecl __MINGW_NOTHROW _mbsnbicoll (const unsigned char*, const unsigned char*, size_t); - -_CRTIMP unsigned char* __cdecl __MINGW_NOTHROW _mbsinc (const unsigned char*); -_CRTIMP unsigned char* __cdecl __MINGW_NOTHROW _mbsninc (const unsigned char*, size_t); -_CRTIMP unsigned char* __cdecl __MINGW_NOTHROW _mbsdec (const unsigned char*, const unsigned char*); -_CRTIMP unsigned int __cdecl __MINGW_NOTHROW _mbsnextc (const unsigned char*); -_CRTIMP unsigned char* __cdecl __MINGW_NOTHROW _mbslwr (unsigned char*); -_CRTIMP unsigned char* __cdecl __MINGW_NOTHROW _mbsupr (unsigned char*); -_CRTIMP unsigned char* __cdecl __MINGW_NOTHROW _mbstok (unsigned char*, const unsigned char*); - -/* Kanji */ -_CRTIMP int __cdecl __MINGW_NOTHROW _ismbchira (unsigned int); -_CRTIMP int __cdecl __MINGW_NOTHROW _ismbckata (unsigned int); -_CRTIMP int __cdecl __MINGW_NOTHROW _ismbcl0 (unsigned int); -_CRTIMP int __cdecl __MINGW_NOTHROW _ismbcl1 (unsigned int); -_CRTIMP int __cdecl __MINGW_NOTHROW _ismbcl2 (unsigned int); -_CRTIMP unsigned int __cdecl __MINGW_NOTHROW _mbcjistojms (unsigned int); -_CRTIMP unsigned int __cdecl __MINGW_NOTHROW _mbcjmstojis (unsigned int); -_CRTIMP unsigned int __cdecl __MINGW_NOTHROW _mbctohira (unsigned int); -_CRTIMP unsigned int __cdecl __MINGW_NOTHROW _mbctokata (unsigned int); - -#endif /* Not strict ANSI */ - -#ifdef __cplusplus -} -#endif - -#endif /* Not RC_INVOKED */ -#endif /* Not _MBSTRING_H_ */ - - diff --git a/winsup/mingw/include/mem.h b/winsup/mingw/include/mem.h deleted file mode 100644 index 451de0cd4..000000000 --- a/winsup/mingw/include/mem.h +++ /dev/null @@ -1,6 +0,0 @@ -/* - * This file is part of the Mingw32 package. - * - * mem.h maps to string.h - */ -#include <string.h> diff --git a/winsup/mingw/include/memory.h b/winsup/mingw/include/memory.h deleted file mode 100644 index 9ba65cf69..000000000 --- a/winsup/mingw/include/memory.h +++ /dev/null @@ -1,7 +0,0 @@ -/* - * This file is part of the Mingw32 package. - * - * memory.h maps to the standard string.h header. - */ - -#include <string.h> diff --git a/winsup/mingw/include/process.h b/winsup/mingw/include/process.h deleted file mode 100644 index c0c380fbd..000000000 --- a/winsup/mingw/include/process.h +++ /dev/null @@ -1,139 +0,0 @@ -/* - * process.h - * This file has no copyright assigned and is placed in the Public Domain. - * This file is a part of the mingw-runtime package. - * No warranty is given; refer to the file DISCLAIMER within the package. - * - * Function calls for spawning child processes. - * - */ - -#ifndef _PROCESS_H_ -#define _PROCESS_H_ - -/* All the headers include this file. */ -#include <_mingw.h> - -#include <sys/types.h> /* For _pid_t and pid_t. */ -#include <stdint.h> /* For intptr_t. */ -/* - * Constants for cwait actions. - * Obsolete for Win32. - */ -#define _WAIT_CHILD 0 -#define _WAIT_GRANDCHILD 1 - -#ifndef _NO_OLDNAMES -#define WAIT_CHILD _WAIT_CHILD -#define WAIT_GRANDCHILD _WAIT_GRANDCHILD -#endif /* Not _NO_OLDNAMES */ - -/* - * Mode constants for spawn functions. - */ -#define _P_WAIT 0 -#define _P_NOWAIT 1 -#define _P_OVERLAY 2 -#define _OLD_P_OVERLAY _P_OVERLAY -#define _P_NOWAITO 3 -#define _P_DETACH 4 - -#ifndef _NO_OLDNAMES -#define P_WAIT _P_WAIT -#define P_NOWAIT _P_NOWAIT -#define P_OVERLAY _P_OVERLAY -#define OLD_P_OVERLAY _OLD_P_OVERLAY -#define P_NOWAITO _P_NOWAITO -#define P_DETACH _P_DETACH -#endif /* Not _NO_OLDNAMES */ - - -#ifndef RC_INVOKED - -#ifdef __cplusplus -extern "C" { -#endif - -_CRTIMP void __cdecl __MINGW_NOTHROW _cexit(void); -_CRTIMP void __cdecl __MINGW_NOTHROW _c_exit(void); - -_CRTIMP int __cdecl __MINGW_NOTHROW _cwait (int*, _pid_t, int); - -_CRTIMP _pid_t __cdecl __MINGW_NOTHROW _getpid(void); - -_CRTIMP intptr_t __cdecl __MINGW_NOTHROW _execl (const char*, const char*, ...); -_CRTIMP intptr_t __cdecl __MINGW_NOTHROW _execle (const char*, const char*, ...); -_CRTIMP intptr_t __cdecl __MINGW_NOTHROW _execlp (const char*, const char*, ...); -_CRTIMP intptr_t __cdecl __MINGW_NOTHROW _execlpe (const char*, const char*, ...); -_CRTIMP intptr_t __cdecl __MINGW_NOTHROW _execv (const char*, const char* const*); -_CRTIMP intptr_t __cdecl __MINGW_NOTHROW _execve (const char*, const char* const*, const char* const*); -_CRTIMP intptr_t __cdecl __MINGW_NOTHROW _execvp (const char*, const char* const*); -_CRTIMP intptr_t __cdecl __MINGW_NOTHROW _execvpe (const char*, const char* const*, const char* const*); - -_CRTIMP intptr_t __cdecl __MINGW_NOTHROW _spawnl (int, const char*, const char*, ...); -_CRTIMP intptr_t __cdecl __MINGW_NOTHROW _spawnle (int, const char*, const char*, ...); -_CRTIMP intptr_t __cdecl __MINGW_NOTHROW _spawnlp (int, const char*, const char*, ...); -_CRTIMP intptr_t __cdecl __MINGW_NOTHROW _spawnlpe (int, const char*, const char*, ...); -_CRTIMP intptr_t __cdecl __MINGW_NOTHROW _spawnv (int, const char*, const char* const*); -_CRTIMP intptr_t __cdecl __MINGW_NOTHROW _spawnve (int, const char*, const char* const*, const char* const*); -_CRTIMP intptr_t __cdecl __MINGW_NOTHROW _spawnvp (int, const char*, const char* const*); -_CRTIMP intptr_t __cdecl __MINGW_NOTHROW _spawnvpe (int, const char*, const char* const*, const char* const*); - - -/* - * The functions _beginthreadex and _endthreadex are not provided by CRTDLL. - * They are provided by MSVCRT. - * - * NOTE: Apparently _endthread calls CloseHandle on the handle of the thread, - * making for race conditions if you are not careful. Basically you have to - * make sure that no-one is going to do *anything* with the thread handle - * after the thread calls _endthread or returns from the thread function. - * - * NOTE: No old names for these functions. Use the underscore. - */ -_CRTIMP unsigned long __cdecl __MINGW_NOTHROW - _beginthread (void (*)(void *), unsigned, void*); -_CRTIMP void __cdecl __MINGW_NOTHROW _endthread (void); - -#ifdef __MSVCRT__ -_CRTIMP unsigned long __cdecl __MINGW_NOTHROW - _beginthreadex (void *, unsigned, unsigned (__stdcall *) (void *), - void*, unsigned, unsigned*); -_CRTIMP void __cdecl __MINGW_NOTHROW _endthreadex (unsigned); -#endif - - -#ifndef _NO_OLDNAMES -/* - * Functions without the leading underscore, for portability. These functions - * live in liboldnames.a. - */ -_CRTIMP int __cdecl __MINGW_NOTHROW cwait (int*, pid_t, int); -_CRTIMP pid_t __cdecl __MINGW_NOTHROW getpid (void); - -_CRTIMP intptr_t __cdecl __MINGW_NOTHROW execl (const char*, const char*, ...); -_CRTIMP intptr_t __cdecl __MINGW_NOTHROW execle (const char*, const char*, ...); -_CRTIMP intptr_t __cdecl __MINGW_NOTHROW execlp (const char*, const char*, ...); -_CRTIMP intptr_t __cdecl __MINGW_NOTHROW execlpe (const char*, const char*,...); -_CRTIMP intptr_t __cdecl __MINGW_NOTHROW execv (const char*, const char* const*); -_CRTIMP intptr_t __cdecl __MINGW_NOTHROW execve (const char*, const char* const*, const char* const*); -_CRTIMP intptr_t __cdecl __MINGW_NOTHROW execvp (const char*, const char* const*); -_CRTIMP intptr_t __cdecl __MINGW_NOTHROW execvpe (const char*, const char* const*, const char* const*); - -_CRTIMP intptr_t __cdecl __MINGW_NOTHROW spawnl (int, const char*, const char*, ...); -_CRTIMP intptr_t __cdecl __MINGW_NOTHROW spawnle (int, const char*, const char*, ...); -_CRTIMP intptr_t __cdecl __MINGW_NOTHROW spawnlp (int, const char*, const char*, ...); -_CRTIMP intptr_t __cdecl __MINGW_NOTHROW spawnlpe (int, const char*, const char*, ...); -_CRTIMP intptr_t __cdecl __MINGW_NOTHROW spawnv (int, const char*, const char* const*); -_CRTIMP intptr_t __cdecl __MINGW_NOTHROW spawnve (int, const char*, const char* const*, const char* const*); -_CRTIMP intptr_t __cdecl __MINGW_NOTHROW spawnvp (int, const char*, const char* const*); -_CRTIMP intptr_t __cdecl __MINGW_NOTHROW spawnvpe (int, const char*, const char* const*, const char* const*); -#endif /* Not _NO_OLDNAMES */ - -#ifdef __cplusplus -} -#endif - -#endif /* Not RC_INVOKED */ - -#endif /* _PROCESS_H_ not defined */ diff --git a/winsup/mingw/include/search.h b/winsup/mingw/include/search.h deleted file mode 100644 index af71a32cc..000000000 --- a/winsup/mingw/include/search.h +++ /dev/null @@ -1,106 +0,0 @@ -/* - * search.h - * - * Functions for searching and sorting. - * - * This file is part of the Mingw32 package. - * - * Contributors: - * Created by Danny Smith <dannysmith@users.sourceforge.net> - * - * THIS SOFTWARE IS NOT COPYRIGHTED - * - * This source code is offered for use in the public domain. You may - * use, modify or distribute it freely. - * - * This code is distributed in the hope that it will be useful but - * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY - * DISCLAIMED. This includes but is not limited to warranties of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - */ - -#ifndef _SEARCH_H_ -#define _SEARCH_H_ - -/* All the headers include this file. */ -#include <_mingw.h> - -#ifndef RC_INVOKED - -#ifdef __cplusplus -extern "C" { -#endif - -#ifndef _SIZE_T_DEFINED -typedef unsigned int size_t; -#define _SIZE_T_DEFINED -#endif - -/* bsearch and qsort are also declared in stdlib.h */ -_CRTIMP void* __cdecl bsearch (const void*, const void*, size_t, size_t, - int (*)(const void*, const void*)); -_CRTIMP void __cdecl qsort (void*, size_t, size_t, - int (*)(const void*, const void*)); - -_CRTIMP void* __cdecl _lfind (const void*, const void*, unsigned int*, - unsigned int, int (*)(const void*, const void*)); -_CRTIMP void* __cdecl _lsearch (const void*, void*, unsigned int*, unsigned int, - int (*)(const void*, const void*)); -/* -Documentation for these POSIX definitions and prototypes can be found in -The Open Group Base Specifications Issue 6 -IEEE Std 1003.1, 2004 Edition. -eg: http://www.opengroup.org/onlinepubs/009695399/functions/twalk.html -*/ - - -typedef struct entry { - char *key; - void *data; -} ENTRY; - -typedef enum { - FIND, - ENTER -} ACTION; - -typedef enum { - preorder, - postorder, - endorder, - leaf -} VISIT; - -#ifdef _SEARCH_PRIVATE -typedef struct node { - char *key; - struct node *llink, *rlink; -} node_t; -#endif - -void * __cdecl tdelete (const void * __restrict__, void ** __restrict__, - int (*)(const void *, const void *)) - __MINGW_ATTRIB_NONNULL (1) __MINGW_ATTRIB_NONNULL (3); -void * __cdecl tfind (const void *, void * const *, - int (*)(const void *, const void *)) - __MINGW_ATTRIB_NONNULL (1) __MINGW_ATTRIB_NONNULL (3); -void * __cdecl tsearch (const void *, void **, - int (*)(const void *, const void *)) - __MINGW_ATTRIB_NONNULL (1) __MINGW_ATTRIB_NONNULL (3); -void __cdecl twalk (const void *, void (*)(const void *, VISIT, int)); - -#ifndef _NO_OLDNAMES -_CRTIMP void* __cdecl lfind (const void*, const void*, unsigned int*, - unsigned int, int (*)(const void*, const void*)); -_CRTIMP void* __cdecl lsearch (const void*, void*, unsigned int*, unsigned int, - int (*)(const void*, const void*)); -#endif - -#ifdef __cplusplus -} -#endif - -#endif /* RC_INVOKED */ - -#endif /* _SEARCH_H_ */ diff --git a/winsup/mingw/include/setjmp.h b/winsup/mingw/include/setjmp.h deleted file mode 100644 index 96eb5bd65..000000000 --- a/winsup/mingw/include/setjmp.h +++ /dev/null @@ -1,56 +0,0 @@ -/* - * setjmp.h - * This file has no copyright assigned and is placed in the Public Domain. - * This file is a part of the mingw-runtime package. - * No warranty is given; refer to the file DISCLAIMER within the package. - * - * Declarations supporting setjmp and longjump, a method for avoiding - * the normal function call return sequence. (Bleah!) - * - */ - -#ifndef _SETJMP_H_ -#define _SETJMP_H_ - -/* All the headers include this file. */ -#include <_mingw.h> - -#ifndef RC_INVOKED - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * The buffer used by setjmp to store the information used by longjmp - * to perform it's evil goto-like work. The size of this buffer was - * determined through experimentation; it's contents are a mystery. - * NOTE: This was determined on an i386 (actually a Pentium). The - * contents could be different on an Alpha or something else. - */ -#define _JBLEN 16 -#define _JBTYPE int -typedef _JBTYPE jmp_buf[_JBLEN]; - -/* - * The function provided by CRTDLL which appears to do the actual work - * of setjmp. - */ -_CRTIMP int __cdecl __MINGW_NOTHROW _setjmp (jmp_buf); - -#define setjmp(x) _setjmp(x) - -/* - * Return to the last setjmp call and act as if setjmp had returned - * nVal (which had better be non-zero!). - */ -_CRTIMP void __cdecl __MINGW_NOTHROW longjmp (jmp_buf, int) __MINGW_ATTRIB_NORETURN; - -#ifdef __cplusplus -} -#endif - -#endif /* Not RC_INVOKED */ - -#endif /* Not _SETJMP_H_ */ - diff --git a/winsup/mingw/include/share.h b/winsup/mingw/include/share.h deleted file mode 100644 index 09a54ad28..000000000 --- a/winsup/mingw/include/share.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - * share.h - * This file has no copyright assigned and is placed in the Public Domain. - * This file is a part of the mingw-runtime package. - * No warranty is given; refer to the file DISCLAIMER within the package. - * - * Constants for file sharing functions. - * - */ - -#ifndef _SHARE_H_ -#define _SHARE_H_ - -/* All the headers include this file. */ -#include <_mingw.h> - -#define _SH_COMPAT 0x00 /* Compatibility */ -#define _SH_DENYRW 0x10 /* Deny read/write */ -#define _SH_DENYWR 0x20 /* Deny write */ -#define _SH_DENYRD 0x30 /* Deny read */ -#define _SH_DENYNO 0x40 /* Deny nothing */ - -#ifndef _NO_OLDNAMES - -/* Non ANSI names */ -#define SH_DENYRW _SH_DENYRW -#define SH_DENYWR _SH_DENYWR -#define SH_DENYRD _SH_DENYRD -#define SH_DENYNO _SH_DENYNO - -#endif /* Not _NO_OLDNAMES */ - -#endif /* Not _SHARE_H_ */ diff --git a/winsup/mingw/include/signal.h b/winsup/mingw/include/signal.h deleted file mode 100644 index 6fe336d88..000000000 --- a/winsup/mingw/include/signal.h +++ /dev/null @@ -1,98 +0,0 @@ -/* - * signal.h - * This file has no copyright assigned and is placed in the Public Domain. - * This file is a part of the mingw-runtime package. - * No warranty is given; refer to the file DISCLAIMER within the package. - * - * A way to set handlers for exceptional conditions (also known as signals). - * - */ - -#ifndef _SIGNAL_H_ -#define _SIGNAL_H_ - -/* All the headers include this file. */ -#include <_mingw.h> - -/* - * The actual signal values. Using other values with signal - * produces a SIG_ERR return value. - * - * NOTE: SIGINT is produced when the user presses Ctrl-C. - * SIGILL has not been tested. - * SIGFPE doesn't seem to work? - * SIGSEGV does not catch writing to a NULL pointer (that shuts down - * your app; can you say "segmentation violation core dump"?). - * SIGTERM comes from what kind of termination request exactly? - * SIGBREAK is indeed produced by pressing Ctrl-Break. - * SIGABRT is produced by calling abort. - * TODO: The above results may be related to not installing an appropriate - * structured exception handling frame. Results may be better if I ever - * manage to get the SEH stuff down. - */ -#define SIGINT 2 /* Interactive attention */ -#define SIGILL 4 /* Illegal instruction */ -#define SIGFPE 8 /* Floating point error */ -#define SIGSEGV 11 /* Segmentation violation */ -#define SIGTERM 15 /* Termination request */ -#define SIGBREAK 21 /* Control-break */ -#define SIGABRT 22 /* Abnormal termination (abort) */ - -#define NSIG 23 /* maximum signal number + 1 */ - -#ifndef RC_INVOKED - -#ifndef _SIG_ATOMIC_T_DEFINED -typedef int sig_atomic_t; -#define _SIG_ATOMIC_T_DEFINED -#endif - -/* - * The prototypes (below) are the easy part. The hard part is figuring - * out what signals are available and what numbers they are assigned - * along with appropriate values of SIG_DFL and SIG_IGN. - */ - -/* - * A pointer to a signal handler function. A signal handler takes a - * single int, which is the signal it handles. - */ -typedef void (*__p_sig_fn_t)(int); - -/* - * These are special values of signal handler pointers which are - * used to send a signal to the default handler (SIG_DFL), ignore - * the signal (SIG_IGN), indicate an error return (SIG_ERR), - * get an error (SIG_SGE), or acknowledge (SIG_ACK). - */ -#define SIG_DFL ((__p_sig_fn_t) 0) -#define SIG_IGN ((__p_sig_fn_t) 1) -#define SIG_ERR ((__p_sig_fn_t) -1) -#define SIG_SGE ((__p_sig_fn_t) 3) -#define SIG_ACK ((__p_sig_fn_t) 4) - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * Call signal to set the signal handler for signal sig to the - * function pointed to by handler. Returns a pointer to the - * previous handler, or SIG_ERR if an error occurs. Initially - * unhandled signals defined above will return SIG_DFL. - */ -_CRTIMP __p_sig_fn_t __cdecl __MINGW_NOTHROW signal(int, __p_sig_fn_t); - -/* - * Raise the signal indicated by sig. Returns non-zero on success. - */ -_CRTIMP int __cdecl __MINGW_NOTHROW raise (int); - -#ifdef __cplusplus -} -#endif - -#endif /* Not RC_INVOKED */ - -#endif /* Not _SIGNAL_H_ */ - diff --git a/winsup/mingw/include/stdint.h b/winsup/mingw/include/stdint.h deleted file mode 100644 index 57db989cd..000000000 --- a/winsup/mingw/include/stdint.h +++ /dev/null @@ -1,206 +0,0 @@ -/* ISO C9x 7.18 Integer types <stdint.h> - * Based on ISO/IEC SC22/WG14 9899 Committee draft (SC22 N2794) - * - * THIS SOFTWARE IS NOT COPYRIGHTED - * - * Contributor: Danny Smith <danny_r_smith_2001@yahoo.co.nz> - * - * This source code is offered for use in the public domain. You may - * use, modify or distribute it freely. - * - * This code is distributed in the hope that it will be useful but - * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY - * DISCLAIMED. This includes but is not limited to warranties of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * Date: 2000-12-02 - */ - - -#ifndef _STDINT_H -#define _STDINT_H -#define __need_wint_t -#define __need_wchar_t -#include <stddef.h> - -/* 7.18.1.1 Exact-width integer types */ -typedef signed char int8_t; -typedef unsigned char uint8_t; -typedef short int16_t; -typedef unsigned short uint16_t; -typedef int int32_t; -typedef unsigned uint32_t; -typedef long long int64_t; -typedef unsigned long long uint64_t; - -/* 7.18.1.2 Minimum-width integer types */ -typedef signed char int_least8_t; -typedef unsigned char uint_least8_t; -typedef short int_least16_t; -typedef unsigned short uint_least16_t; -typedef int int_least32_t; -typedef unsigned uint_least32_t; -typedef long long int_least64_t; -typedef unsigned long long uint_least64_t; - -/* 7.18.1.3 Fastest minimum-width integer types - * Not actually guaranteed to be fastest for all purposes - * Here we use the exact-width types for 8 and 16-bit ints. - */ -typedef char int_fast8_t; -typedef unsigned char uint_fast8_t; -typedef short int_fast16_t; -typedef unsigned short uint_fast16_t; -typedef int int_fast32_t; -typedef unsigned int uint_fast32_t; -typedef long long int_fast64_t; -typedef unsigned long long uint_fast64_t; - -/* 7.18.1.4 Integer types capable of holding object pointers */ - -#ifndef _INTPTR_T_DEFINED -#define _INTPTR_T_DEFINED -#ifdef _WIN64 - typedef __int64 intptr_t; -#else - typedef int intptr_t; -#endif -#endif - -#ifndef _UINTPTR_T_DEFINED -#define _UINTPTR_T_DEFINED -#ifdef _WIN64 - typedef unsigned __int64 uintptr_t; -#else - typedef unsigned int uintptr_t; -#endif -#endif - -/* 7.18.1.5 Greatest-width integer types */ -typedef long long intmax_t; -typedef unsigned long long uintmax_t; - -/* 7.18.2 Limits of specified-width integer types */ -#if !defined ( __cplusplus) || defined (__STDC_LIMIT_MACROS) - -/* 7.18.2.1 Limits of exact-width integer types */ -#define INT8_MIN (-128) -#define INT16_MIN (-32768) -#define INT32_MIN (-2147483647 - 1) -#define INT64_MIN (-9223372036854775807LL - 1) - -#define INT8_MAX 127 -#define INT16_MAX 32767 -#define INT32_MAX 2147483647 -#define INT64_MAX 9223372036854775807LL - -#define UINT8_MAX 0xff /* 255U */ -#define UINT16_MAX 0xffff /* 65535U */ -#define UINT32_MAX 0xffffffff /* 4294967295U */ -#define UINT64_MAX 0xffffffffffffffffULL /* 18446744073709551615ULL */ - -/* 7.18.2.2 Limits of minimum-width integer types */ -#define INT_LEAST8_MIN INT8_MIN -#define INT_LEAST16_MIN INT16_MIN -#define INT_LEAST32_MIN INT32_MIN -#define INT_LEAST64_MIN INT64_MIN - -#define INT_LEAST8_MAX INT8_MAX -#define INT_LEAST16_MAX INT16_MAX -#define INT_LEAST32_MAX INT32_MAX -#define INT_LEAST64_MAX INT64_MAX - -#define UINT_LEAST8_MAX UINT8_MAX -#define UINT_LEAST16_MAX UINT16_MAX -#define UINT_LEAST32_MAX UINT32_MAX -#define UINT_LEAST64_MAX UINT64_MAX - -/* 7.18.2.3 Limits of fastest minimum-width integer types */ -#define INT_FAST8_MIN INT8_MIN -#define INT_FAST16_MIN INT16_MIN -#define INT_FAST32_MIN INT32_MIN -#define INT_FAST64_MIN INT64_MIN - -#define INT_FAST8_MAX INT8_MAX -#define INT_FAST16_MAX INT16_MAX -#define INT_FAST32_MAX INT32_MAX -#define INT_FAST64_MAX INT64_MAX - -#define UINT_FAST8_MAX UINT8_MAX -#define UINT_FAST16_MAX UINT16_MAX -#define UINT_FAST32_MAX UINT32_MAX -#define UINT_FAST64_MAX UINT64_MAX - -/* 7.18.2.4 Limits of integer types capable of holding - object pointers */ -#ifdef _WIN64 -#define INTPTR_MIN INT64_MIN -#define INTPTR_MAX INT64_MAX -#define UINTPTR_MAX UINT64_MAX -#else -#define INTPTR_MIN INT32_MIN -#define INTPTR_MAX INT32_MAX -#define UINTPTR_MAX UINT32_MAX -#endif - -/* 7.18.2.5 Limits of greatest-width integer types */ -#define INTMAX_MIN INT64_MIN -#define INTMAX_MAX INT64_MAX -#define UINTMAX_MAX UINT64_MAX - -/* 7.18.3 Limits of other integer types */ -#define PTRDIFF_MIN INTPTR_MIN -#define PTRDIFF_MAX INTPTR_MAX - -#define SIG_ATOMIC_MIN INTPTR_MIN -#define SIG_ATOMIC_MAX INTPTR_MAX - -#define SIZE_MAX UINTPTR_MAX - -#ifndef WCHAR_MIN /* also in wchar.h */ -#define WCHAR_MIN 0 -#define WCHAR_MAX 0xffff /* UINT16_MAX */ -#endif - -/* - * wint_t is unsigned short for compatibility with MS runtime - */ -#define WINT_MIN 0 -#define WINT_MAX 0xffff /* UINT16_MAX */ - -#endif /* !defined ( __cplusplus) || defined __STDC_LIMIT_MACROS */ - - -/* 7.18.4 Macros for integer constants */ -#if !defined ( __cplusplus) || defined (__STDC_CONSTANT_MACROS) - -/* 7.18.4.1 Macros for minimum-width integer constants - - Accoding to Douglas Gwyn <gwyn@arl.mil>: - "This spec was changed in ISO/IEC 9899:1999 TC1; in ISO/IEC - 9899:1999 as initially published, the expansion was required - to be an integer constant of precisely matching type, which - is impossible to accomplish for the shorter types on most - platforms, because C99 provides no standard way to designate - an integer constant with width less than that of type int. - TC1 changed this to require just an integer constant - *expression* with *promoted* type." -*/ - -#define INT8_C(val) ((int8_t) + (val)) -#define UINT8_C(val) ((uint8_t) + (val##U)) -#define INT16_C(val) ((int16_t) + (val)) -#define UINT16_C(val) ((uint16_t) + (val##U)) - -#define INT32_C(val) val##L -#define UINT32_C(val) val##UL -#define INT64_C(val) val##LL -#define UINT64_C(val) val##ULL - -/* 7.18.4.2 Macros for greatest-width integer constants */ -#define INTMAX_C(val) INT64_C(val) -#define UINTMAX_C(val) UINT64_C(val) - -#endif /* !defined ( __cplusplus) || defined __STDC_CONSTANT_MACROS */ - -#endif diff --git a/winsup/mingw/include/stdio.h b/winsup/mingw/include/stdio.h deleted file mode 100644 index 1765bed9d..000000000 --- a/winsup/mingw/include/stdio.h +++ /dev/null @@ -1,647 +0,0 @@ -/* - * stdio.h - * This file has no copyright assigned and is placed in the Public Domain. - * This file is a part of the mingw-runtime package. - * No warranty is given; refer to the file DISCLAIMER within the package. - * - * Definitions of types and prototypes of functions for standard input and - * output. - * - * NOTE: The file manipulation functions provided by Microsoft seem to - * work with either slash (/) or backslash (\) as the directory separator. - * - */ - -#ifndef _STDIO_H_ -#define _STDIO_H_ - -/* All the headers include this file. */ -#include <_mingw.h> - -#ifndef RC_INVOKED -#define __need_size_t -#define __need_NULL -#define __need_wchar_t -#define __need_wint_t -#include <stddef.h> -#define __need___va_list -#include <stdarg.h> -#endif /* Not RC_INVOKED */ - - -/* Flags for the iobuf structure */ -#define _IOREAD 1 /* currently reading */ -#define _IOWRT 2 /* currently writing */ -#define _IORW 0x0080 /* opened as "r+w" */ - - -/* - * The three standard file pointers provided by the run time library. - * NOTE: These will go to the bit-bucket silently in GUI applications! - */ -#define STDIN_FILENO 0 -#define STDOUT_FILENO 1 -#define STDERR_FILENO 2 - -/* Returned by various functions on end of file condition or error. */ -#define EOF (-1) - -/* - * The maximum length of a file name. You should use GetVolumeInformation - * instead of this constant. But hey, this works. - * Also defined in io.h. - */ -#ifndef FILENAME_MAX -#define FILENAME_MAX (260) -#endif - -/* - * The maximum number of files that may be open at once. I have set this to - * a conservative number. The actual value may be higher. - */ -#define FOPEN_MAX (20) - -/* After creating this many names, tmpnam and tmpfile return NULL */ -#define TMP_MAX 32767 -/* - * Tmpnam, tmpfile and, sometimes, _tempnam try to create - * temp files in the root directory of the current drive - * (not in pwd, as suggested by some older MS doc's). - * Redefining these macros does not effect the CRT functions. - */ -#define _P_tmpdir "\\" -#ifndef __STRICT_ANSI__ -#define P_tmpdir _P_tmpdir -#endif -#define _wP_tmpdir L"\\" - -/* - * The maximum size of name (including NUL) that will be put in the user - * supplied buffer caName for tmpnam. - * Inferred from the size of the static buffer returned by tmpnam - * when passed a NULL argument. May actually be smaller. - */ -#define L_tmpnam (16) - -#define _IOFBF 0x0000 /* full buffered */ -#define _IOLBF 0x0040 /* line buffered */ -#define _IONBF 0x0004 /* not buffered */ - -#define _IOMYBUF 0x0008 /* stdio malloc()'d buffer */ -#define _IOEOF 0x0010 /* EOF reached on read */ -#define _IOERR 0x0020 /* I/O error from system */ -#define _IOSTRG 0x0040 /* Strange or no file descriptor */ -#ifdef _POSIX_SOURCE -# define _IOAPPEND 0x0200 -#endif -/* - * The buffer size as used by setbuf such that it is equivalent to - * (void) setvbuf(fileSetBuffer, caBuffer, _IOFBF, BUFSIZ). - */ -#define BUFSIZ 512 - -/* Constants for nOrigin indicating the position relative to which fseek - * sets the file position. Defined unconditionally since ISO and POSIX - * say they are defined here. */ -#define SEEK_SET 0 -#define SEEK_CUR 1 -#define SEEK_END 2 - -#ifndef RC_INVOKED - -#ifndef __VALIST -#ifdef __GNUC__ -#define __VALIST __gnuc_va_list -#else -#define __VALIST char* -#endif -#endif /* defined __VALIST */ - -/* - * The structure underlying the FILE type. - * - * Some believe that nobody in their right mind should make use of the - * internals of this structure. Provided by Pedro A. Aranda Gutiirrez - * <paag@tid.es>. - */ -#ifndef _FILE_DEFINED -#define _FILE_DEFINED -typedef struct _iobuf -{ - char* _ptr; - int _cnt; - char* _base; - int _flag; - int _file; - int _charbuf; - int _bufsiz; - char* _tmpfname; -} FILE; -#endif /* Not _FILE_DEFINED */ - - -/* - * The standard file handles - */ -#ifndef __DECLSPEC_SUPPORTED - -extern FILE (*_imp___iob)[]; /* A pointer to an array of FILE */ - -#define _iob (*_imp___iob) /* An array of FILE */ - -#else /* __DECLSPEC_SUPPORTED */ - -__MINGW_IMPORT FILE _iob[]; /* An array of FILE imported from DLL. */ - -#endif /* __DECLSPEC_SUPPORTED */ - -#define stdin (&_iob[STDIN_FILENO]) -#define stdout (&_iob[STDOUT_FILENO]) -#define stderr (&_iob[STDERR_FILENO]) - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * File Operations - */ -_CRTIMP FILE* __cdecl __MINGW_NOTHROW fopen (const char*, const char*); -_CRTIMP FILE* __cdecl __MINGW_NOTHROW freopen (const char*, const char*, FILE*); -_CRTIMP int __cdecl __MINGW_NOTHROW fflush (FILE*); -_CRTIMP int __cdecl __MINGW_NOTHROW fclose (FILE*); -/* MS puts remove & rename (but not wide versions) in io.h also */ -_CRTIMP int __cdecl __MINGW_NOTHROW remove (const char*); -_CRTIMP int __cdecl __MINGW_NOTHROW rename (const char*, const char*); -_CRTIMP FILE* __cdecl __MINGW_NOTHROW tmpfile (void); -_CRTIMP char* __cdecl __MINGW_NOTHROW tmpnam (char*); - -#ifndef __STRICT_ANSI__ -_CRTIMP char* __cdecl __MINGW_NOTHROW _tempnam (const char*, const char*); -_CRTIMP int __cdecl __MINGW_NOTHROW _rmtmp(void); -_CRTIMP int __cdecl __MINGW_NOTHROW _unlink (const char*); - -#ifndef NO_OLDNAMES -_CRTIMP char* __cdecl __MINGW_NOTHROW tempnam (const char*, const char*); -_CRTIMP int __cdecl __MINGW_NOTHROW rmtmp(void); -_CRTIMP int __cdecl __MINGW_NOTHROW unlink (const char*); -#endif -#endif /* __STRICT_ANSI__ */ - -_CRTIMP int __cdecl __MINGW_NOTHROW setvbuf (FILE*, char*, int, size_t); - -_CRTIMP void __cdecl __MINGW_NOTHROW setbuf (FILE*, char*); - -/* - * Formatted Output - * - * MSVCRT implementations are not ANSI C99 conformant... - * we offer these conforming alternatives from libmingwex.a - */ -#undef __mingw_stdio_redirect__ -#define __mingw_stdio_redirect__(F) __cdecl __MINGW_NOTHROW __mingw_##F - -extern int __mingw_stdio_redirect__(fprintf)(FILE*, const char*, ...); -extern int __mingw_stdio_redirect__(printf)(const char*, ...); -extern int __mingw_stdio_redirect__(sprintf)(char*, const char*, ...); -extern int __mingw_stdio_redirect__(snprintf)(char*, size_t, const char*, ...); -extern int __mingw_stdio_redirect__(vfprintf)(FILE*, const char*, __VALIST); -extern int __mingw_stdio_redirect__(vprintf)(const char*, __VALIST); -extern int __mingw_stdio_redirect__(vsprintf)(char*, const char*, __VALIST); -extern int __mingw_stdio_redirect__(vsnprintf)(char*, size_t, const char*, __VALIST); - -#if __USE_MINGW_ANSI_STDIO -/* - * User has expressed a preference for C99 conformance... - */ -# undef __mingw_stdio_redirect__ -# ifdef __cplusplus -/* - * For C++ we use inline implementations, to avoid interference - * with namespace qualification, which may result from using #defines. - */ -# define __mingw_stdio_redirect__ static inline __cdecl __MINGW_NOTHROW - -# elif defined __GNUC__ -/* - * FIXME: Is there any GCC version prerequisite here? - * - * We also prefer inline implementations for C, when we can be confident - * that the GNU specific __inline__ mechanism is supported. - */ -# define __mingw_stdio_redirect__ static __inline__ __cdecl __MINGW_NOTHROW - -# else -/* - * Can't use inlines; fall back on module local static stubs. - */ -# define __mingw_stdio_redirect__ static __cdecl __MINGW_NOTHROW -# endif - -__mingw_stdio_redirect__ -int fprintf (FILE *__stream, const char *__format, ...) -{ - register int __retval; - __builtin_va_list __local_argv; __builtin_va_start( __local_argv, __format ); - __retval = __mingw_vfprintf( __stream, __format, __local_argv ); - __builtin_va_end( __local_argv ); - return __retval; -} - -__mingw_stdio_redirect__ -int printf (const char *__format, ...) -{ - register int __retval; - __builtin_va_list __local_argv; __builtin_va_start( __local_argv, __format ); - __retval = __mingw_vprintf( __format, __local_argv ); - __builtin_va_end( __local_argv ); - return __retval; -} - -__mingw_stdio_redirect__ -int sprintf (char *__stream, const char *__format, ...) -{ - register int __retval; - __builtin_va_list __local_argv; __builtin_va_start( __local_argv, __format ); - __retval = __mingw_vsprintf( __stream, __format, __local_argv ); - __builtin_va_end( __local_argv ); - return __retval; -} - -__mingw_stdio_redirect__ -int vfprintf (FILE *__stream, const char *__format, __VALIST __local_argv) -{ - return __mingw_vfprintf( __stream, __format, __local_argv ); -} - -__mingw_stdio_redirect__ -int vprintf (const char *__format, __VALIST __local_argv) -{ - return __mingw_vprintf( __format, __local_argv ); -} - -__mingw_stdio_redirect__ -int vsprintf (char *__stream, const char *__format, __VALIST __local_argv) -{ - return __mingw_vsprintf( __stream, __format, __local_argv ); -} - -#else -/* - * Default configuration: simply direct all calls to MSVCRT... - */ -_CRTIMP int __cdecl __MINGW_NOTHROW fprintf (FILE*, const char*, ...); -_CRTIMP int __cdecl __MINGW_NOTHROW printf (const char*, ...); -_CRTIMP int __cdecl __MINGW_NOTHROW sprintf (char*, const char*, ...); -_CRTIMP int __cdecl __MINGW_NOTHROW vfprintf (FILE*, const char*, __VALIST); -_CRTIMP int __cdecl __MINGW_NOTHROW vprintf (const char*, __VALIST); -_CRTIMP int __cdecl __MINGW_NOTHROW vsprintf (char*, const char*, __VALIST); - -#endif -/* - * Regardless of user preference, always offer these alternative - * entry points, for direct access to the MSVCRT implementations. - */ -#undef __mingw_stdio_redirect__ -#define __mingw_stdio_redirect__(F) __cdecl __MINGW_NOTHROW __msvcrt_##F - -_CRTIMP int __mingw_stdio_redirect__(fprintf)(FILE*, const char*, ...); -_CRTIMP int __mingw_stdio_redirect__(printf)(const char*, ...); -_CRTIMP int __mingw_stdio_redirect__(sprintf)(char*, const char*, ...); -_CRTIMP int __mingw_stdio_redirect__(vfprintf)(FILE*, const char*, __VALIST); -_CRTIMP int __mingw_stdio_redirect__(vprintf)(const char*, __VALIST); -_CRTIMP int __mingw_stdio_redirect__(vsprintf)(char*, const char*, __VALIST); - -#undef __mingw_stdio_redirect__ - -/* The following pair ALWAYS refer to the MSVCRT implementations... - */ -_CRTIMP int __cdecl __MINGW_NOTHROW _snprintf (char*, size_t, const char*, ...); -_CRTIMP int __cdecl __MINGW_NOTHROW _vsnprintf (char*, size_t, const char*, __VALIST); - -#ifndef __NO_ISOCEXT /* externs in libmingwex.a */ -/* - * Microsoft does not provide implementations for the following, - * which are required by C99. Note in particular that the corresponding - * Microsoft implementations of _snprintf() and _vsnprintf() are *not* - * compatible with C99, but the following are; if you want the MSVCRT - * behaviour, you *must* use the Microsoft uglified names. - */ -int __cdecl __MINGW_NOTHROW snprintf (char *, size_t, const char *, ...); -int __cdecl __MINGW_NOTHROW vsnprintf (char *, size_t, const char *, __VALIST); - -int __cdecl __MINGW_NOTHROW vscanf (const char * __restrict__, __VALIST); -int __cdecl __MINGW_NOTHROW vfscanf (FILE * __restrict__, const char * __restrict__, - __VALIST); -int __cdecl __MINGW_NOTHROW vsscanf (const char * __restrict__, - const char * __restrict__, __VALIST); - -#endif /* !__NO_ISOCEXT */ - -/* - * Formatted Input - */ - -_CRTIMP int __cdecl __MINGW_NOTHROW fscanf (FILE*, const char*, ...); -_CRTIMP int __cdecl __MINGW_NOTHROW scanf (const char*, ...); -_CRTIMP int __cdecl __MINGW_NOTHROW sscanf (const char*, const char*, ...); -/* - * Character Input and Output Functions - */ - -_CRTIMP int __cdecl __MINGW_NOTHROW fgetc (FILE*); -_CRTIMP char* __cdecl __MINGW_NOTHROW fgets (char*, int, FILE*); -_CRTIMP int __cdecl __MINGW_NOTHROW fputc (int, FILE*); -_CRTIMP int __cdecl __MINGW_NOTHROW fputs (const char*, FILE*); -_CRTIMP char* __cdecl __MINGW_NOTHROW gets (char*); -_CRTIMP int __cdecl __MINGW_NOTHROW puts (const char*); -_CRTIMP int __cdecl __MINGW_NOTHROW ungetc (int, FILE*); - -/* Traditionally, getc and putc are defined as macros. but the - standard doesn't say that they must be macros. - We use inline functions here to allow the fast versions - to be used in C++ with namespace qualification, eg., ::getc. - - _filbuf and _flsbuf are not thread-safe. */ -_CRTIMP int __cdecl __MINGW_NOTHROW _filbuf (FILE*); -_CRTIMP int __cdecl __MINGW_NOTHROW _flsbuf (int, FILE*); - -#if !defined _MT - -__CRT_INLINE int __cdecl __MINGW_NOTHROW getc (FILE* __F) -{ - return (--__F->_cnt >= 0) - ? (int) (unsigned char) *__F->_ptr++ - : _filbuf (__F); -} - -__CRT_INLINE int __cdecl __MINGW_NOTHROW putc (int __c, FILE* __F) -{ - return (--__F->_cnt >= 0) - ? (int) (unsigned char) (*__F->_ptr++ = (char)__c) - : _flsbuf (__c, __F); -} - -__CRT_INLINE int __cdecl __MINGW_NOTHROW getchar (void) -{ - return (--stdin->_cnt >= 0) - ? (int) (unsigned char) *stdin->_ptr++ - : _filbuf (stdin); -} - -__CRT_INLINE int __cdecl __MINGW_NOTHROW putchar(int __c) -{ - return (--stdout->_cnt >= 0) - ? (int) (unsigned char) (*stdout->_ptr++ = (char)__c) - : _flsbuf (__c, stdout);} - -#else /* Use library functions. */ - -_CRTIMP int __cdecl __MINGW_NOTHROW getc (FILE*); -_CRTIMP int __cdecl __MINGW_NOTHROW putc (int, FILE*); -_CRTIMP int __cdecl __MINGW_NOTHROW getchar (void); -_CRTIMP int __cdecl __MINGW_NOTHROW putchar (int); - -#endif - -/* - * Direct Input and Output Functions - */ - -_CRTIMP size_t __cdecl __MINGW_NOTHROW fread (void*, size_t, size_t, FILE*); -_CRTIMP size_t __cdecl __MINGW_NOTHROW fwrite (const void*, size_t, size_t, FILE*); - -/* - * File Positioning Functions - */ - -_CRTIMP int __cdecl __MINGW_NOTHROW fseek (FILE*, long, int); -_CRTIMP long __cdecl __MINGW_NOTHROW ftell (FILE*); -_CRTIMP void __cdecl __MINGW_NOTHROW rewind (FILE*); - -#if __MSVCRT_VERSION__ >= 0x800 -_CRTIMP int __cdecl __MINGW_NOTHROW _fseek_nolock (FILE*, long, int); -_CRTIMP long __cdecl __MINGW_NOTHROW _ftell_nolock (FILE*); - -_CRTIMP int __cdecl __MINGW_NOTHROW _fseeki64 (FILE*, __int64, int); -_CRTIMP __int64 __cdecl __MINGW_NOTHROW _ftelli64 (FILE*); -_CRTIMP int __cdecl __MINGW_NOTHROW _fseeki64_nolock (FILE*, __int64, int); -_CRTIMP __int64 __cdecl __MINGW_NOTHROW _ftelli64_nolock (FILE*); -#endif - -#ifdef __USE_MINGW_FSEEK /* These are in libmingwex.a */ -/* - * Workaround for limitations on win9x where a file contents are - * not zero'd out if you seek past the end and then write. - */ - -int __cdecl __MINGW_NOTHROW __mingw_fseek (FILE *, long, int); -size_t __cdecl __MINGW_NOTHROW __mingw_fwrite (const void*, size_t, size_t, FILE*); -#define fseek(fp, offset, whence) __mingw_fseek(fp, offset, whence) -#define fwrite(buffer, size, count, fp) __mingw_fwrite(buffer, size, count, fp) -#endif /* __USE_MINGW_FSEEK */ - -/* - * An opaque data type used for storing file positions... The contents of - * this type are unknown, but we (the compiler) need to know the size - * because the programmer using fgetpos and fsetpos will be setting aside - * storage for fpos_t structres. Actually I tested using a byte array and - * it is fairly evident that the fpos_t type is a long (in CRTDLL.DLL). - * Perhaps an unsigned long? TODO? It's definitely a 64-bit number in - * MSVCRT however, and for now `long long' will do. - */ -#ifdef __MSVCRT__ -typedef long long fpos_t; -#else -typedef long fpos_t; -#endif - -_CRTIMP int __cdecl __MINGW_NOTHROW fgetpos (FILE*, fpos_t*); -_CRTIMP int __cdecl __MINGW_NOTHROW fsetpos (FILE*, const fpos_t*); - -/* - * Error Functions - */ - -_CRTIMP int __cdecl __MINGW_NOTHROW feof (FILE*); -_CRTIMP int __cdecl __MINGW_NOTHROW ferror (FILE*); - -#ifdef __cplusplus -inline int __cdecl __MINGW_NOTHROW feof (FILE* __F) - { return __F->_flag & _IOEOF; } -inline int __cdecl __MINGW_NOTHROW ferror (FILE* __F) - { return __F->_flag & _IOERR; } -#else -#define feof(__F) ((__F)->_flag & _IOEOF) -#define ferror(__F) ((__F)->_flag & _IOERR) -#endif - -_CRTIMP void __cdecl __MINGW_NOTHROW clearerr (FILE*); -_CRTIMP void __cdecl __MINGW_NOTHROW perror (const char*); - - -#ifndef __STRICT_ANSI__ -/* - * Pipes - */ -_CRTIMP FILE* __cdecl __MINGW_NOTHROW _popen (const char*, const char*); -_CRTIMP int __cdecl __MINGW_NOTHROW _pclose (FILE*); - -#ifndef NO_OLDNAMES -_CRTIMP FILE* __cdecl __MINGW_NOTHROW popen (const char*, const char*); -_CRTIMP int __cdecl __MINGW_NOTHROW pclose (FILE*); -#endif - -/* - * Other Non ANSI functions - */ -_CRTIMP int __cdecl __MINGW_NOTHROW _flushall (void); -_CRTIMP int __cdecl __MINGW_NOTHROW _fgetchar (void); -_CRTIMP int __cdecl __MINGW_NOTHROW _fputchar (int); -_CRTIMP FILE* __cdecl __MINGW_NOTHROW _fdopen (int, const char*); -_CRTIMP int __cdecl __MINGW_NOTHROW _fileno (FILE*); -_CRTIMP int __cdecl __MINGW_NOTHROW _fcloseall (void); -_CRTIMP FILE* __cdecl __MINGW_NOTHROW _fsopen (const char*, const char*, int); -#ifdef __MSVCRT__ -_CRTIMP int __cdecl __MINGW_NOTHROW _getmaxstdio (void); -_CRTIMP int __cdecl __MINGW_NOTHROW _setmaxstdio (int); -#endif - -#if __MSVCRT_VERSION__ >= 0x800 -_CRTIMP unsigned int __cdecl __MINGW_NOTHROW _get_output_format (void); -_CRTIMP unsigned int __cdecl __MINGW_NOTHROW _set_output_format (unsigned int); - -#define _TWO_DIGIT_EXPONENT 1 - -_CRTIMP int __cdecl __MINGW_NOTHROW _get_printf_count_output (void); -_CRTIMP int __cdecl __MINGW_NOTHROW _set_printf_count_output (int); -#endif - -#ifndef _NO_OLDNAMES -_CRTIMP int __cdecl __MINGW_NOTHROW fgetchar (void); -_CRTIMP int __cdecl __MINGW_NOTHROW fputchar (int); -_CRTIMP FILE* __cdecl __MINGW_NOTHROW fdopen (int, const char*); -_CRTIMP int __cdecl __MINGW_NOTHROW fileno (FILE*); -#endif /* Not _NO_OLDNAMES */ - -#define _fileno(__F) ((__F)->_file) -#ifndef _NO_OLDNAMES -#define fileno(__F) ((__F)->_file) -#endif - -#if defined (__MSVCRT__) && !defined (__NO_MINGW_LFS) -#include <sys/types.h> -__CRT_INLINE FILE* __cdecl __MINGW_NOTHROW fopen64 (const char* filename, const char* mode) -{ - return fopen (filename, mode); -} - -int __cdecl __MINGW_NOTHROW fseeko64 (FILE*, off64_t, int); - -#ifdef __USE_MINGW_FSEEK -int __cdecl __MINGW_NOTHROW __mingw_fseeko64 (FILE *, off64_t, int); -#define fseeko64(fp, offset, whence) __mingw_fseeko64(fp, offset, whence) -#endif - -__CRT_INLINE off64_t __cdecl __MINGW_NOTHROW ftello64 (FILE * stream) -{ - fpos_t pos; - if (fgetpos(stream, &pos)) - return -1LL; - else - return ((off64_t) pos); -} -#endif /* __NO_MINGW_LFS */ - -#endif /* Not __STRICT_ANSI__ */ - -/* Wide versions */ - -#ifndef _WSTDIO_DEFINED -/* also in wchar.h - keep in sync */ -_CRTIMP int __cdecl __MINGW_NOTHROW fwprintf (FILE*, const wchar_t*, ...); -_CRTIMP int __cdecl __MINGW_NOTHROW wprintf (const wchar_t*, ...); -_CRTIMP int __cdecl __MINGW_NOTHROW _snwprintf (wchar_t*, size_t, const wchar_t*, ...); -_CRTIMP int __cdecl __MINGW_NOTHROW vfwprintf (FILE*, const wchar_t*, __VALIST); -_CRTIMP int __cdecl __MINGW_NOTHROW vwprintf (const wchar_t*, __VALIST); -_CRTIMP int __cdecl __MINGW_NOTHROW _vsnwprintf (wchar_t*, size_t, const wchar_t*, __VALIST); -_CRTIMP int __cdecl __MINGW_NOTHROW fwscanf (FILE*, const wchar_t*, ...); -_CRTIMP int __cdecl __MINGW_NOTHROW wscanf (const wchar_t*, ...); -_CRTIMP int __cdecl __MINGW_NOTHROW swscanf (const wchar_t*, const wchar_t*, ...); -_CRTIMP wint_t __cdecl __MINGW_NOTHROW fgetwc (FILE*); -_CRTIMP wint_t __cdecl __MINGW_NOTHROW fputwc (wchar_t, FILE*); -_CRTIMP wint_t __cdecl __MINGW_NOTHROW ungetwc (wchar_t, FILE*); - -/* These differ from the ISO C prototypes, which have a maxlen parameter (like snprintf). */ -#ifndef __STRICT_ANSI__ -_CRTIMP int __cdecl __MINGW_NOTHROW swprintf (wchar_t*, const wchar_t*, ...); -_CRTIMP int __cdecl __MINGW_NOTHROW vswprintf (wchar_t*, const wchar_t*, __VALIST); -#endif - -#ifdef __MSVCRT__ -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW fgetws (wchar_t*, int, FILE*); -_CRTIMP int __cdecl __MINGW_NOTHROW fputws (const wchar_t*, FILE*); -_CRTIMP wint_t __cdecl __MINGW_NOTHROW getwc (FILE*); -_CRTIMP wint_t __cdecl __MINGW_NOTHROW getwchar (void); -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _getws (wchar_t*); -_CRTIMP wint_t __cdecl __MINGW_NOTHROW putwc (wint_t, FILE*); -_CRTIMP int __cdecl __MINGW_NOTHROW _putws (const wchar_t*); -_CRTIMP wint_t __cdecl __MINGW_NOTHROW putwchar (wint_t); -_CRTIMP FILE* __cdecl __MINGW_NOTHROW _wfdopen(int, const wchar_t *); -_CRTIMP FILE* __cdecl __MINGW_NOTHROW _wfopen (const wchar_t*, const wchar_t*); -_CRTIMP FILE* __cdecl __MINGW_NOTHROW _wfreopen (const wchar_t*, const wchar_t*, FILE*); -_CRTIMP FILE* __cdecl __MINGW_NOTHROW _wfsopen (const wchar_t*, const wchar_t*, int); -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wtmpnam (wchar_t*); -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wtempnam (const wchar_t*, const wchar_t*); -_CRTIMP int __cdecl __MINGW_NOTHROW _wrename (const wchar_t*, const wchar_t*); -_CRTIMP int __cdecl __MINGW_NOTHROW _wremove (const wchar_t*); -_CRTIMP void __cdecl __MINGW_NOTHROW _wperror (const wchar_t*); -_CRTIMP FILE* __cdecl __MINGW_NOTHROW _wpopen (const wchar_t*, const wchar_t*); -#endif /* __MSVCRT__ */ - -#ifndef __NO_ISOCEXT /* externs in libmingwex.a */ -int __cdecl __MINGW_NOTHROW snwprintf (wchar_t* s, size_t n, const wchar_t* format, ...); -__CRT_INLINE int __cdecl __MINGW_NOTHROW -vsnwprintf (wchar_t* s, size_t n, const wchar_t* format, __VALIST arg) - { return _vsnwprintf ( s, n, format, arg);} -int __cdecl __MINGW_NOTHROW vwscanf (const wchar_t * __restrict__, __VALIST); -int __cdecl __MINGW_NOTHROW vfwscanf (FILE * __restrict__, - const wchar_t * __restrict__, __VALIST); -int __cdecl __MINGW_NOTHROW vswscanf (const wchar_t * __restrict__, - const wchar_t * __restrict__, __VALIST); -#endif - -#define _WSTDIO_DEFINED -#endif /* _WSTDIO_DEFINED */ - -#ifndef __STRICT_ANSI__ -#ifdef __MSVCRT__ -#ifndef NO_OLDNAMES -_CRTIMP FILE* __cdecl __MINGW_NOTHROW wpopen (const wchar_t*, const wchar_t*); -#endif /* not NO_OLDNAMES */ -#endif /* MSVCRT runtime */ - -/* - * Other Non ANSI wide functions - */ -_CRTIMP wint_t __cdecl __MINGW_NOTHROW _fgetwchar (void); -_CRTIMP wint_t __cdecl __MINGW_NOTHROW _fputwchar (wint_t); -_CRTIMP int __cdecl __MINGW_NOTHROW _getw (FILE*); -_CRTIMP int __cdecl __MINGW_NOTHROW _putw (int, FILE*); - -#ifndef _NO_OLDNAMES -_CRTIMP wint_t __cdecl __MINGW_NOTHROW fgetwchar (void); -_CRTIMP wint_t __cdecl __MINGW_NOTHROW fputwchar (wint_t); -_CRTIMP int __cdecl __MINGW_NOTHROW getw (FILE*); -_CRTIMP int __cdecl __MINGW_NOTHROW putw (int, FILE*); -#endif /* Not _NO_OLDNAMES */ - -#endif /* __STRICT_ANSI */ - -#ifdef __cplusplus -} -#endif - -#endif /* Not RC_INVOKED */ - -#endif /* _STDIO_H_ */ diff --git a/winsup/mingw/include/stdlib.h b/winsup/mingw/include/stdlib.h deleted file mode 100644 index b58643059..000000000 --- a/winsup/mingw/include/stdlib.h +++ /dev/null @@ -1,558 +0,0 @@ -/* - * stdlib.h - * This file has no copyright assigned and is placed in the Public Domain. - * This file is a part of the mingw-runtime package. - * No warranty is given; refer to the file DISCLAIMER within the package. - * - * Definitions for common types, variables, and functions. - * - */ - -#ifndef _STDLIB_H_ -#define _STDLIB_H_ - -/* All the headers include this file. */ -#include <_mingw.h> - -#define __need_size_t -#define __need_wchar_t -#define __need_NULL -#ifndef RC_INVOKED -#include <stddef.h> -#endif /* RC_INVOKED */ - -/* - * RAND_MAX is the maximum value that may be returned by rand. - * The minimum is zero. - */ -#define RAND_MAX 0x7FFF - -/* - * These values may be used as exit status codes. - */ -#define EXIT_SUCCESS 0 -#define EXIT_FAILURE 1 - -/* - * Definitions for path name functions. - * NOTE: All of these values have simply been chosen to be conservatively high. - * Remember that with long file names we can no longer depend on - * extensions being short. - */ -#ifndef __STRICT_ANSI__ - -#ifndef MAX_PATH -#define MAX_PATH (260) -#endif - -#define _MAX_PATH MAX_PATH -#define _MAX_DRIVE (3) -#define _MAX_DIR 256 -#define _MAX_FNAME 256 -#define _MAX_EXT 256 - -#endif /* Not __STRICT_ANSI__ */ - - -#ifndef RC_INVOKED - -#ifdef __cplusplus -extern "C" { -#endif - -#if !defined (__STRICT_ANSI__) - -/* - * This seems like a convenient place to declare these variables, which - * give programs using WinMain (or main for that matter) access to main-ish - * argc and argv. environ is a pointer to a table of environment variables. - * NOTE: Strings in _argv and environ are ANSI strings. - */ -extern int _argc; -extern char** _argv; - -/* imports from runtime dll of the above variables */ -#ifdef __MSVCRT__ - -extern int* __cdecl __MINGW_NOTHROW __p___argc(void); -extern char*** __cdecl __MINGW_NOTHROW __p___argv(void); -extern wchar_t*** __cdecl __MINGW_NOTHROW __p___wargv(void); - -#define __argc (*__p___argc()) -#define __argv (*__p___argv()) -#define __wargv (*__p___wargv()) - -#else /* !MSVCRT */ - -#ifndef __DECLSPEC_SUPPORTED - -extern int* _imp____argc_dll; -extern char*** _imp____argv_dll; -#define __argc (*_imp____argc_dll) -#define __argv (*_imp____argv_dll) - -#else /* __DECLSPEC_SUPPORTED */ - -__MINGW_IMPORT int __argc_dll; -__MINGW_IMPORT char** __argv_dll; -#define __argc __argc_dll -#define __argv __argv_dll - -#endif /* __DECLSPEC_SUPPORTED */ - -#endif /* __MSVCRT */ -#endif /* __STRICT_ANSI__ */ -/* - * Also defined in ctype.h. - */ -#ifndef MB_CUR_MAX -#ifdef __DECLSPEC_SUPPORTED -# ifdef __MSVCRT__ -# define MB_CUR_MAX __mb_cur_max - __MINGW_IMPORT int __mb_cur_max; -# else /* not __MSVCRT */ -# define MB_CUR_MAX __mb_cur_max_dll - __MINGW_IMPORT int __mb_cur_max_dll; -# endif /* not __MSVCRT */ - -#else /* ! __DECLSPEC_SUPPORTED */ -# ifdef __MSVCRT__ - extern int* _imp____mbcur_max; -# define MB_CUR_MAX (*_imp____mb_cur_max) -# else /* not __MSVCRT */ - extern int* _imp____mbcur_max_dll; -# define MB_CUR_MAX (*_imp____mb_cur_max_dll) -# endif /* not __MSVCRT */ -#endif /* __DECLSPEC_SUPPORTED */ -#endif /* MB_CUR_MAX */ - -/* - * MS likes to declare errno in stdlib.h as well. - */ - -#ifdef _UWIN -#undef errno -extern int errno; -#else - _CRTIMP int* __cdecl __MINGW_NOTHROW _errno(void); -#define errno (*_errno()) -#endif - _CRTIMP int* __cdecl __MINGW_NOTHROW __doserrno(void); -#define _doserrno (*__doserrno()) - -#if !defined (__STRICT_ANSI__) -/* - * Use environ from the DLL, not as a global. - */ - -#ifdef __MSVCRT__ - extern _CRTIMP char *** __cdecl __MINGW_NOTHROW __p__environ(void); - extern _CRTIMP wchar_t *** __cdecl __MINGW_NOTHROW __p__wenviron(void); -# define _environ (*__p__environ()) -# define _wenviron (*__p__wenviron()) -#else /* ! __MSVCRT__ */ -# ifndef __DECLSPEC_SUPPORTED - extern char *** _imp___environ_dll; -# define _environ (*_imp___environ_dll) -# else /* __DECLSPEC_SUPPORTED */ - __MINGW_IMPORT char ** _environ_dll; -# define _environ _environ_dll -# endif /* __DECLSPEC_SUPPORTED */ -#endif /* ! __MSVCRT__ */ - -#define environ _environ - -#ifdef __MSVCRT__ -/* One of the MSVCRTxx libraries */ - -#ifndef __DECLSPEC_SUPPORTED - extern int* _imp___sys_nerr; -# define sys_nerr (*_imp___sys_nerr) -#else /* __DECLSPEC_SUPPORTED */ - __MINGW_IMPORT int _sys_nerr; -# ifndef _UWIN -# define sys_nerr _sys_nerr -# endif /* _UWIN */ -#endif /* __DECLSPEC_SUPPORTED */ - -#else /* ! __MSVCRT__ */ - -/* CRTDLL run time library */ - -#ifndef __DECLSPEC_SUPPORTED - extern int* _imp___sys_nerr_dll; -# define sys_nerr (*_imp___sys_nerr_dll) -#else /* __DECLSPEC_SUPPORTED */ - __MINGW_IMPORT int _sys_nerr_dll; -# define sys_nerr _sys_nerr_dll -#endif /* __DECLSPEC_SUPPORTED */ - -#endif /* ! __MSVCRT__ */ - -#ifndef __DECLSPEC_SUPPORTED -extern char*** _imp__sys_errlist; -#define sys_errlist (*_imp___sys_errlist) -#else /* __DECLSPEC_SUPPORTED */ -__MINGW_IMPORT char* _sys_errlist[]; -#ifndef _UWIN -#define sys_errlist _sys_errlist -#endif /* _UWIN */ -#endif /* __DECLSPEC_SUPPORTED */ - -/* - * OS version and such constants. - */ - -#ifdef __MSVCRT__ -/* msvcrtxx.dll */ - -extern _CRTIMP unsigned __cdecl __MINGW_NOTHROW int* __p__osver(void); -extern _CRTIMP unsigned __cdecl __MINGW_NOTHROW int* __p__winver(void); -extern _CRTIMP unsigned __cdecl __MINGW_NOTHROW int* __p__winmajor(void); -extern _CRTIMP unsigned __cdecl __MINGW_NOTHROW int* __p__winminor(void); - -#ifndef __DECLSPEC_SUPPORTED -# define _osver (*__p__osver()) -# define _winver (*__p__winver()) -# define _winmajor (*__p__winmajor()) -# define _winminor (*__p__winminor()) -#else -__MINGW_IMPORT unsigned int _osver; -__MINGW_IMPORT unsigned int _winver; -__MINGW_IMPORT unsigned int _winmajor; -__MINGW_IMPORT unsigned int _winminor; -#endif /* __DECLSPEC_SUPPORTED */ - -#else -/* Not msvcrtxx.dll, thus crtdll.dll */ - -#ifndef __DECLSPEC_SUPPORTED - -extern unsigned int* _imp___osver_dll; -extern unsigned int* _imp___winver_dll; -extern unsigned int* _imp___winmajor_dll; -extern unsigned int* _imp___winminor_dll; - -#define _osver (*_imp___osver_dll) -#define _winver (*_imp___winver_dll) -#define _winmajor (*_imp___winmajor_dll) -#define _winminor (*_imp___winminor_dll) - -#else /* __DECLSPEC_SUPPORTED */ - -__MINGW_IMPORT unsigned int _osver_dll; -__MINGW_IMPORT unsigned int _winver_dll; -__MINGW_IMPORT unsigned int _winmajor_dll; -__MINGW_IMPORT unsigned int _winminor_dll; - -#define _osver _osver_dll -#define _winver _winver_dll -#define _winmajor _winmajor_dll -#define _winminor _winminor_dll - -#endif /* __DECLSPEC_SUPPORTED */ - -#endif - -#if defined __MSVCRT__ -/* although the _pgmptr is exported as DATA, - * be safe and use the access function __p__pgmptr() to get it. */ -_CRTIMP char** __cdecl __MINGW_NOTHROW __p__pgmptr(void); -#define _pgmptr (*__p__pgmptr()) -_CRTIMP wchar_t** __cdecl __MINGW_NOTHROW __p__wpgmptr(void); -#define _wpgmptr (*__p__wpgmptr()) -#else /* ! __MSVCRT__ */ -# ifndef __DECLSPEC_SUPPORTED - extern char** __imp__pgmptr_dll; -# define _pgmptr (*_imp___pgmptr_dll) -# else /* __DECLSPEC_SUPPORTED */ - __MINGW_IMPORT char* _pgmptr_dll; -# define _pgmptr _pgmptr_dll -# endif /* __DECLSPEC_SUPPORTED */ -/* no wide version in CRTDLL */ -#endif /* __MSVCRT__ */ - -/* - * This variable determines the default file mode. - * TODO: Which flags work? - */ -#if !defined (__DECLSPEC_SUPPORTED) || defined (__IN_MINGW_RUNTIME) - -#ifdef __MSVCRT__ -extern int* _imp___fmode; -#define _fmode (*_imp___fmode) -#else -/* CRTDLL */ -extern int* _imp___fmode_dll; -#define _fmode (*_imp___fmode_dll) -#endif - -#else /* __DECLSPEC_SUPPORTED */ - -#ifdef __MSVCRT__ -__MINGW_IMPORT int _fmode; -#else /* ! __MSVCRT__ */ -__MINGW_IMPORT int _fmode_dll; -#define _fmode _fmode_dll -#endif /* ! __MSVCRT__ */ - -#endif /* __DECLSPEC_SUPPORTED */ - -#endif /* Not __STRICT_ANSI__ */ - -_CRTIMP double __cdecl __MINGW_NOTHROW atof (const char*); -_CRTIMP int __cdecl __MINGW_NOTHROW atoi (const char*); -_CRTIMP long __cdecl __MINGW_NOTHROW atol (const char*); -#if !defined (__STRICT_ANSI__) -_CRTIMP int __cdecl __MINGW_NOTHROW _wtoi (const wchar_t *); -_CRTIMP long __cdecl __MINGW_NOTHROW _wtol (const wchar_t *); -#endif -#if !defined __NO_ISOCEXT /* in libmingwex.a */ -double __cdecl __MINGW_NOTHROW __strtod (const char*, char**); -#ifdef __cplusplus -/* We require a function with external linkage. */ -#else -static -#endif /* Not __cplusplus */ -__inline__ double __cdecl __MINGW_NOTHROW -strtod (const char* __restrict__ __nptr, char** __restrict__ __endptr) -{ - return __strtod(__nptr, __endptr); -} -float __cdecl __MINGW_NOTHROW strtof (const char * __restrict__, char ** __restrict__); -long double __cdecl __MINGW_NOTHROW strtold (const char * __restrict__, char ** __restrict__); -#else -_CRTIMP double __cdecl __MINGW_NOTHROW strtod (const char*, char**); -#endif /* __NO_ISOCEXT */ - -_CRTIMP long __cdecl __MINGW_NOTHROW strtol (const char*, char**, int); -_CRTIMP unsigned long __cdecl __MINGW_NOTHROW strtoul (const char*, char**, int); - -#ifndef _WSTDLIB_DEFINED -/* also declared in wchar.h */ -_CRTIMP long __cdecl __MINGW_NOTHROW wcstol (const wchar_t*, wchar_t**, int); -_CRTIMP unsigned long __cdecl __MINGW_NOTHROW wcstoul (const wchar_t*, wchar_t**, int); -_CRTIMP double __cdecl __MINGW_NOTHROW wcstod (const wchar_t*, wchar_t**); -#if !defined __NO_ISOCEXT /* in libmingwex.a */ -float __cdecl __MINGW_NOTHROW wcstof( const wchar_t * __restrict__, wchar_t ** __restrict__); -long double __cdecl __MINGW_NOTHROW wcstold (const wchar_t * __restrict__, wchar_t ** __restrict__); -#endif /* __NO_ISOCEXT */ -#ifdef __MSVCRT__ -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wgetenv(const wchar_t*); -_CRTIMP int __cdecl __MINGW_NOTHROW _wputenv(const wchar_t*); -_CRTIMP void __cdecl __MINGW_NOTHROW _wsearchenv(const wchar_t*, const wchar_t*, wchar_t*); -_CRTIMP int __cdecl __MINGW_NOTHROW _wsystem(const wchar_t*); -_CRTIMP void __cdecl __MINGW_NOTHROW _wmakepath(wchar_t*, const wchar_t*, const wchar_t*, const wchar_t*, const wchar_t*); -_CRTIMP void __cdecl __MINGW_NOTHROW _wsplitpath (const wchar_t*, wchar_t*, wchar_t*, wchar_t*, wchar_t*); -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wfullpath (wchar_t*, const wchar_t*, size_t); -#endif -#define _WSTDLIB_DEFINED -#endif - -_CRTIMP size_t __cdecl __MINGW_NOTHROW wcstombs (char*, const wchar_t*, size_t); -_CRTIMP int __cdecl __MINGW_NOTHROW wctomb (char*, wchar_t); - -_CRTIMP int __cdecl __MINGW_NOTHROW mblen (const char*, size_t); -_CRTIMP size_t __cdecl __MINGW_NOTHROW mbstowcs (wchar_t*, const char*, size_t); -_CRTIMP int __cdecl __MINGW_NOTHROW mbtowc (wchar_t*, const char*, size_t); - -_CRTIMP int __cdecl __MINGW_NOTHROW rand (void); -_CRTIMP void __cdecl __MINGW_NOTHROW srand (unsigned int); - -_CRTIMP void* __cdecl __MINGW_NOTHROW calloc (size_t, size_t) __MINGW_ATTRIB_MALLOC; -_CRTIMP void* __cdecl __MINGW_NOTHROW malloc (size_t) __MINGW_ATTRIB_MALLOC; -_CRTIMP void* __cdecl __MINGW_NOTHROW realloc (void*, size_t); -_CRTIMP void __cdecl __MINGW_NOTHROW free (void*); -_CRTIMP void __cdecl __MINGW_NOTHROW abort (void) __MINGW_ATTRIB_NORETURN; -_CRTIMP void __cdecl __MINGW_NOTHROW exit (int) __MINGW_ATTRIB_NORETURN; - -/* Note: This is in startup code, not imported directly from dll */ -int __cdecl __MINGW_NOTHROW atexit (void (*)(void)); - -_CRTIMP int __cdecl __MINGW_NOTHROW system (const char*); -_CRTIMP char* __cdecl __MINGW_NOTHROW getenv (const char*); - -/* bsearch and qsort are also in non-ANSI header search.h */ -_CRTIMP void* __cdecl bsearch (const void*, const void*, size_t, size_t, - int (*)(const void*, const void*)); -_CRTIMP void __cdecl qsort(void*, size_t, size_t, - int (*)(const void*, const void*)); - -_CRTIMP int __cdecl __MINGW_NOTHROW abs (int) __MINGW_ATTRIB_CONST; -_CRTIMP long __cdecl __MINGW_NOTHROW labs (long) __MINGW_ATTRIB_CONST; - -/* - * div_t and ldiv_t are structures used to return the results of div and - * ldiv. - * - * NOTE: div and ldiv appear not to work correctly unless - * -fno-pcc-struct-return is specified. This is included in the - * mingw32 specs file. - */ -typedef struct { int quot, rem; } div_t; -typedef struct { long quot, rem; } ldiv_t; - -_CRTIMP div_t __cdecl __MINGW_NOTHROW div (int, int) __MINGW_ATTRIB_CONST; -_CRTIMP ldiv_t __cdecl __MINGW_NOTHROW ldiv (long, long) __MINGW_ATTRIB_CONST; - -#if !defined (__STRICT_ANSI__) - -/* - * NOTE: Officially the three following functions are obsolete. The Win32 API - * functions SetErrorMode, Beep and Sleep are their replacements. - */ -_CRTIMP void __cdecl __MINGW_NOTHROW _beep (unsigned int, unsigned int) __MINGW_ATTRIB_DEPRECATED; -/* Not to be confused with _set_error_mode (int). */ -_CRTIMP void __cdecl __MINGW_NOTHROW _seterrormode (int) __MINGW_ATTRIB_DEPRECATED; -_CRTIMP void __cdecl __MINGW_NOTHROW _sleep (unsigned long) __MINGW_ATTRIB_DEPRECATED; - -_CRTIMP void __cdecl __MINGW_NOTHROW _exit (int) __MINGW_ATTRIB_NORETURN; - -/* _onexit is MS extension. Use atexit for portability. */ -/* Note: This is in startup code, not imported directly from dll */ -typedef int (* _onexit_t)(void); -_onexit_t __cdecl __MINGW_NOTHROW _onexit( _onexit_t ); - -_CRTIMP int __cdecl __MINGW_NOTHROW _putenv (const char*); -_CRTIMP void __cdecl __MINGW_NOTHROW _searchenv (const char*, const char*, char*); - -_CRTIMP char* __cdecl __MINGW_NOTHROW _ecvt (double, int, int*, int*); -_CRTIMP char* __cdecl __MINGW_NOTHROW _fcvt (double, int, int*, int*); -_CRTIMP char* __cdecl __MINGW_NOTHROW _gcvt (double, int, char*); - -_CRTIMP void __cdecl __MINGW_NOTHROW _makepath (char*, const char*, const char*, const char*, const char*); -_CRTIMP void __cdecl __MINGW_NOTHROW _splitpath (const char*, char*, char*, char*, char*); -_CRTIMP char* __cdecl __MINGW_NOTHROW _fullpath (char*, const char*, size_t); - -_CRTIMP char* __cdecl __MINGW_NOTHROW _itoa (int, char*, int); -_CRTIMP char* __cdecl __MINGW_NOTHROW _ltoa (long, char*, int); -_CRTIMP char* __cdecl __MINGW_NOTHROW _ultoa(unsigned long, char*, int); -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _itow (int, wchar_t*, int); -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _ltow (long, wchar_t*, int); -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _ultow (unsigned long, wchar_t*, int); - -#ifdef __MSVCRT__ -_CRTIMP __int64 __cdecl __MINGW_NOTHROW _atoi64(const char *); -_CRTIMP char* __cdecl __MINGW_NOTHROW _i64toa(__int64, char *, int); -_CRTIMP char* __cdecl __MINGW_NOTHROW _ui64toa(unsigned __int64, char *, int); -_CRTIMP __int64 __cdecl __MINGW_NOTHROW _wtoi64(const wchar_t *); -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _i64tow(__int64, wchar_t *, int); -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _ui64tow(unsigned __int64, wchar_t *, int); - -_CRTIMP unsigned int __cdecl __MINGW_NOTHROW _rotl(unsigned int, int) __MINGW_ATTRIB_CONST; -_CRTIMP unsigned int __cdecl __MINGW_NOTHROW _rotr(unsigned int, int) __MINGW_ATTRIB_CONST; -_CRTIMP unsigned long __cdecl __MINGW_NOTHROW _lrotl(unsigned long, int) __MINGW_ATTRIB_CONST; -_CRTIMP unsigned long __cdecl __MINGW_NOTHROW _lrotr(unsigned long, int) __MINGW_ATTRIB_CONST; - -_CRTIMP int __cdecl __MINGW_NOTHROW _set_error_mode (int); - -# define _OUT_TO_DEFAULT 0 -# define _OUT_TO_STDERR 1 -# define _OUT_TO_MSGBOX 2 -# define _REPORT_ERRMODE 3 - -# if __MSVCRT_VERSION__ >= 0x800 -# ifndef _UINTPTR_T_DEFINED -# define _UINTPTR_T_DEFINED -# ifdef _WIN64 - typedef unsigned __int64 uintptr_t; -# else - typedef unsigned int uintptr_t; -# endif -# endif - -_CRTIMP unsigned int __cdecl __MINGW_NOTHROW _set_abort_behavior (unsigned int, unsigned int); - -/* These masks work with msvcr80.dll version 8.0.50215.44 (a beta release). */ -# define _WRITE_ABORT_MSG 1 -# define _CALL_REPORTFAULT 2 - -typedef void -(* _invalid_parameter_handler) ( - const wchar_t *, - const wchar_t *, - const wchar_t *, - unsigned int, - uintptr_t); -_invalid_parameter_handler _set_invalid_parameter_handler (_invalid_parameter_handler); - -# endif /* __MSVCRT_VERSION__ >= 0x800 */ -#endif /* __MSVCRT__ */ - -#ifndef _NO_OLDNAMES - -_CRTIMP int __cdecl __MINGW_NOTHROW putenv (const char*); -_CRTIMP void __cdecl __MINGW_NOTHROW searchenv (const char*, const char*, char*); - -_CRTIMP char* __cdecl __MINGW_NOTHROW itoa (int, char*, int); -_CRTIMP char* __cdecl __MINGW_NOTHROW ltoa (long, char*, int); - -#ifndef _UWIN -_CRTIMP char* __cdecl __MINGW_NOTHROW ecvt (double, int, int*, int*); -_CRTIMP char* __cdecl __MINGW_NOTHROW fcvt (double, int, int*, int*); -_CRTIMP char* __cdecl __MINGW_NOTHROW gcvt (double, int, char*); -#endif /* _UWIN */ -#endif /* Not _NO_OLDNAMES */ - -#endif /* Not __STRICT_ANSI__ */ - -/* C99 names */ - -#if !defined __NO_ISOCEXT /* externs in static libmingwex.a */ - -/* C99 name for _exit */ -void __cdecl __MINGW_NOTHROW _Exit(int) __MINGW_ATTRIB_NORETURN; -#ifndef __STRICT_ANSI__ /* inline using non-ansi functions */ -__CRT_INLINE void __cdecl __MINGW_NOTHROW _Exit(int __status) - { _exit (__status); } -#endif - -typedef struct { long long quot, rem; } lldiv_t; - -lldiv_t __cdecl __MINGW_NOTHROW lldiv (long long, long long) __MINGW_ATTRIB_CONST; - -long long __cdecl __MINGW_NOTHROW llabs(long long); -__CRT_INLINE long long __cdecl __MINGW_NOTHROW llabs(long long _j) - {return (_j >= 0 ? _j : -_j);} - -long long __cdecl __MINGW_NOTHROW strtoll (const char* __restrict__, char** __restrict, int); -unsigned long long __cdecl __MINGW_NOTHROW strtoull (const char* __restrict__, char** __restrict__, int); - -#if defined (__MSVCRT__) /* these are stubs for MS _i64 versions */ -long long __cdecl __MINGW_NOTHROW atoll (const char *); - -#if !defined (__STRICT_ANSI__) -long long __cdecl __MINGW_NOTHROW wtoll (const wchar_t *); -char* __cdecl __MINGW_NOTHROW lltoa (long long, char *, int); -char* __cdecl __MINGW_NOTHROW ulltoa (unsigned long long , char *, int); -wchar_t* __cdecl __MINGW_NOTHROW lltow (long long, wchar_t *, int); -wchar_t* __cdecl __MINGW_NOTHROW ulltow (unsigned long long, wchar_t *, int); - - /* inline using non-ansi functions */ -__CRT_INLINE long long __cdecl __MINGW_NOTHROW atoll (const char * _c) - { return _atoi64 (_c); } -__CRT_INLINE char* __cdecl __MINGW_NOTHROW lltoa (long long _n, char * _c, int _i) - { return _i64toa (_n, _c, _i); } -__CRT_INLINE char* __cdecl __MINGW_NOTHROW ulltoa (unsigned long long _n, char * _c, int _i) - { return _ui64toa (_n, _c, _i); } -__CRT_INLINE long long __cdecl __MINGW_NOTHROW wtoll (const wchar_t * _w) - { return _wtoi64 (_w); } -__CRT_INLINE wchar_t* __cdecl __MINGW_NOTHROW lltow (long long _n, wchar_t * _w, int _i) - { return _i64tow (_n, _w, _i); } -__CRT_INLINE wchar_t* __cdecl __MINGW_NOTHROW ulltow (unsigned long long _n, wchar_t * _w, int _i) - { return _ui64tow (_n, _w, _i); } -#endif /* (__STRICT_ANSI__) */ - -#endif /* __MSVCRT__ */ - -#endif /* !__NO_ISOCEXT */ - - -#ifdef __cplusplus -} -#endif - -#endif /* Not RC_INVOKED */ - -#endif /* Not _STDLIB_H_ */ - diff --git a/winsup/mingw/include/string.h b/winsup/mingw/include/string.h deleted file mode 100644 index 62bdb3f10..000000000 --- a/winsup/mingw/include/string.h +++ /dev/null @@ -1,195 +0,0 @@ -/* - * string.h - * This file has no copyright assigned and is placed in the Public Domain. - * This file is a part of the mingw-runtime package. - * No warranty is given; refer to the file DISCLAIMER within the package. - * - * Definitions for memory and string functions. - * - */ - -#ifndef _STRING_H_ -#define _STRING_H_ - -/* All the headers include this file. */ -#include <_mingw.h> - -/* - * Define size_t, wchar_t and NULL - */ -#define __need_size_t -#define __need_wchar_t -#define __need_NULL -#ifndef RC_INVOKED -#include <stddef.h> -#endif /* Not RC_INVOKED */ - -#ifndef RC_INVOKED - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * Prototypes of the ANSI Standard C library string functions. - */ -_CRTIMP void* __cdecl __MINGW_NOTHROW memchr (const void*, int, size_t) __MINGW_ATTRIB_PURE; -_CRTIMP int __cdecl __MINGW_NOTHROW memcmp (const void*, const void*, size_t) __MINGW_ATTRIB_PURE; -_CRTIMP void* __cdecl __MINGW_NOTHROW memcpy (void*, const void*, size_t); -_CRTIMP void* __cdecl __MINGW_NOTHROW memmove (void*, const void*, size_t); -_CRTIMP void* __cdecl __MINGW_NOTHROW memset (void*, int, size_t); -_CRTIMP char* __cdecl __MINGW_NOTHROW strcat (char*, const char*); -_CRTIMP char* __cdecl __MINGW_NOTHROW strchr (const char*, int) __MINGW_ATTRIB_PURE; -_CRTIMP int __cdecl __MINGW_NOTHROW strcmp (const char*, const char*) __MINGW_ATTRIB_PURE; -_CRTIMP int __cdecl __MINGW_NOTHROW strcoll (const char*, const char*); /* Compare using locale */ -_CRTIMP char* __cdecl __MINGW_NOTHROW strcpy (char*, const char*); -_CRTIMP size_t __cdecl __MINGW_NOTHROW strcspn (const char*, const char*) __MINGW_ATTRIB_PURE; -_CRTIMP char* __cdecl __MINGW_NOTHROW strerror (int); /* NOTE: NOT an old name wrapper. */ - -_CRTIMP size_t __cdecl __MINGW_NOTHROW strlen (const char*) __MINGW_ATTRIB_PURE; -_CRTIMP char* __cdecl __MINGW_NOTHROW strncat (char*, const char*, size_t); -_CRTIMP int __cdecl __MINGW_NOTHROW strncmp (const char*, const char*, size_t) __MINGW_ATTRIB_PURE; -_CRTIMP char* __cdecl __MINGW_NOTHROW strncpy (char*, const char*, size_t); -_CRTIMP char* __cdecl __MINGW_NOTHROW strpbrk (const char*, const char*) __MINGW_ATTRIB_PURE; -_CRTIMP char* __cdecl __MINGW_NOTHROW strrchr (const char*, int) __MINGW_ATTRIB_PURE; -_CRTIMP size_t __cdecl __MINGW_NOTHROW strspn (const char*, const char*) __MINGW_ATTRIB_PURE; -_CRTIMP char* __cdecl __MINGW_NOTHROW strstr (const char*, const char*) __MINGW_ATTRIB_PURE; -_CRTIMP char* __cdecl __MINGW_NOTHROW strtok (char*, const char*); -_CRTIMP size_t __cdecl __MINGW_NOTHROW strxfrm (char*, const char*, size_t); - -#ifndef __STRICT_ANSI__ -/* - * Extra non-ANSI functions provided by the CRTDLL library - */ -_CRTIMP char* __cdecl __MINGW_NOTHROW _strerror (const char *); -_CRTIMP void* __cdecl __MINGW_NOTHROW _memccpy (void*, const void*, int, size_t); -_CRTIMP int __cdecl __MINGW_NOTHROW _memicmp (const void*, const void*, size_t); -_CRTIMP char* __cdecl __MINGW_NOTHROW _strdup (const char*) __MINGW_ATTRIB_MALLOC; -_CRTIMP int __cdecl __MINGW_NOTHROW _strcmpi (const char*, const char*); -_CRTIMP int __cdecl __MINGW_NOTHROW _stricmp (const char*, const char*); -_CRTIMP int __cdecl __MINGW_NOTHROW _stricoll (const char*, const char*); -_CRTIMP char* __cdecl __MINGW_NOTHROW _strlwr (char*); -_CRTIMP int __cdecl __MINGW_NOTHROW _strnicmp (const char*, const char*, size_t); -_CRTIMP char* __cdecl __MINGW_NOTHROW _strnset (char*, int, size_t); -_CRTIMP char* __cdecl __MINGW_NOTHROW _strrev (char*); -_CRTIMP char* __cdecl __MINGW_NOTHROW _strset (char*, int); -_CRTIMP char* __cdecl __MINGW_NOTHROW _strupr (char*); -_CRTIMP void __cdecl __MINGW_NOTHROW _swab (const char*, char*, size_t); - -#ifdef __MSVCRT__ -_CRTIMP int __cdecl __MINGW_NOTHROW _strncoll(const char*, const char*, size_t); -_CRTIMP int __cdecl __MINGW_NOTHROW _strnicoll(const char*, const char*, size_t); -#endif - -#ifndef _NO_OLDNAMES -/* - * Non-underscored versions of non-ANSI functions. They live in liboldnames.a - * and provide a little extra portability. Also a few extra UNIX-isms like - * strcasecmp. - */ -_CRTIMP void* __cdecl __MINGW_NOTHROW memccpy (void*, const void*, int, size_t); -_CRTIMP int __cdecl __MINGW_NOTHROW memicmp (const void*, const void*, size_t); -_CRTIMP char* __cdecl __MINGW_NOTHROW strdup (const char*) __MINGW_ATTRIB_MALLOC; -_CRTIMP int __cdecl __MINGW_NOTHROW strcmpi (const char*, const char*); -_CRTIMP int __cdecl __MINGW_NOTHROW stricmp (const char*, const char*); -__CRT_INLINE int __cdecl __MINGW_NOTHROW strcasecmp (const char*, const char *); -__CRT_INLINE int __cdecl __MINGW_NOTHROW -strcasecmp (const char * __sz1, const char * __sz2) - {return _stricmp (__sz1, __sz2);} -_CRTIMP int __cdecl __MINGW_NOTHROW stricoll (const char*, const char*); -_CRTIMP char* __cdecl __MINGW_NOTHROW strlwr (char*); -_CRTIMP int __cdecl __MINGW_NOTHROW strnicmp (const char*, const char*, size_t); -__CRT_INLINE int __cdecl __MINGW_NOTHROW strncasecmp (const char *, const char *, size_t); -__CRT_INLINE int __cdecl __MINGW_NOTHROW -strncasecmp (const char * __sz1, const char * __sz2, size_t __sizeMaxCompare) - {return _strnicmp (__sz1, __sz2, __sizeMaxCompare);} -_CRTIMP char* __cdecl __MINGW_NOTHROW strnset (char*, int, size_t); -_CRTIMP char* __cdecl __MINGW_NOTHROW strrev (char*); -_CRTIMP char* __cdecl __MINGW_NOTHROW strset (char*, int); -_CRTIMP char* __cdecl __MINGW_NOTHROW strupr (char*); -#ifndef _UWIN -_CRTIMP void __cdecl __MINGW_NOTHROW swab (const char*, char*, size_t); -#endif /* _UWIN */ -#endif /* _NO_OLDNAMES */ - -#endif /* Not __STRICT_ANSI__ */ - -#ifndef _WSTRING_DEFINED -/* - * Unicode versions of the standard calls. - * Also in wchar.h, where they belong according to ISO standard. - */ -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW wcscat (wchar_t*, const wchar_t*); -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW wcschr (const wchar_t*, wchar_t); -_CRTIMP int __cdecl __MINGW_NOTHROW wcscmp (const wchar_t*, const wchar_t*); -_CRTIMP int __cdecl __MINGW_NOTHROW wcscoll (const wchar_t*, const wchar_t*); -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW wcscpy (wchar_t*, const wchar_t*); -_CRTIMP size_t __cdecl __MINGW_NOTHROW wcscspn (const wchar_t*, const wchar_t*); -/* Note: _wcserror requires __MSVCRT_VERSION__ >= 0x0700. */ -_CRTIMP size_t __cdecl __MINGW_NOTHROW wcslen (const wchar_t*); -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW wcsncat (wchar_t*, const wchar_t*, size_t); -_CRTIMP int __cdecl __MINGW_NOTHROW wcsncmp(const wchar_t*, const wchar_t*, size_t); -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW wcsncpy(wchar_t*, const wchar_t*, size_t); -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW wcspbrk(const wchar_t*, const wchar_t*); -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW wcsrchr(const wchar_t*, wchar_t); -_CRTIMP size_t __cdecl __MINGW_NOTHROW wcsspn(const wchar_t*, const wchar_t*); -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW wcsstr(const wchar_t*, const wchar_t*); -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW wcstok(wchar_t*, const wchar_t*); -_CRTIMP size_t __cdecl __MINGW_NOTHROW wcsxfrm(wchar_t*, const wchar_t*, size_t); - -#ifndef __STRICT_ANSI__ -/* - * Unicode versions of non-ANSI string functions provided by CRTDLL. - */ - -/* NOTE: _wcscmpi not provided by CRTDLL, this define is for portability */ -#define _wcscmpi _wcsicmp - -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wcsdup (const wchar_t*); -_CRTIMP int __cdecl __MINGW_NOTHROW _wcsicmp (const wchar_t*, const wchar_t*); -_CRTIMP int __cdecl __MINGW_NOTHROW _wcsicoll (const wchar_t*, const wchar_t*); -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wcslwr (wchar_t*); -_CRTIMP int __cdecl __MINGW_NOTHROW _wcsnicmp (const wchar_t*, const wchar_t*, size_t); -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wcsnset (wchar_t*, wchar_t, size_t); -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wcsrev (wchar_t*); -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wcsset (wchar_t*, wchar_t); -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wcsupr (wchar_t*); - -#ifdef __MSVCRT__ -_CRTIMP int __cdecl __MINGW_NOTHROW _wcsncoll(const wchar_t*, const wchar_t*, size_t); -_CRTIMP int __cdecl __MINGW_NOTHROW _wcsnicoll(const wchar_t*, const wchar_t*, size_t); -#if __MSVCRT_VERSION__ >= 0x0700 -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wcserror(int); -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW __wcserror(const wchar_t*); -#endif -#endif - -#ifndef _NO_OLDNAMES -/* NOTE: There is no _wcscmpi, but this is for compatibility. */ -int __cdecl __MINGW_NOTHROW wcscmpi (const wchar_t * __ws1, const wchar_t * __ws2); -__CRT_INLINE int __cdecl __MINGW_NOTHROW -wcscmpi (const wchar_t * __ws1, const wchar_t * __ws2) - {return _wcsicmp (__ws1, __ws2);} -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW wcsdup (const wchar_t*); -_CRTIMP int __cdecl __MINGW_NOTHROW wcsicmp (const wchar_t*, const wchar_t*); -_CRTIMP int __cdecl __MINGW_NOTHROW wcsicoll (const wchar_t*, const wchar_t*); -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW wcslwr (wchar_t*); -_CRTIMP int __cdecl __MINGW_NOTHROW wcsnicmp (const wchar_t*, const wchar_t*, size_t); -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW wcsnset (wchar_t*, wchar_t, size_t); -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW wcsrev (wchar_t*); -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW wcsset (wchar_t*, wchar_t); -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW wcsupr (wchar_t*); -#endif /* Not _NO_OLDNAMES */ - -#endif /* Not strict ANSI */ - -#define _WSTRING_DEFINED -#endif /* _WSTRING_DEFINED */ - -#ifdef __cplusplus -} -#endif - -#endif /* Not RC_INVOKED */ - -#endif /* Not _STRING_H_ */ diff --git a/winsup/mingw/include/strings.h b/winsup/mingw/include/strings.h deleted file mode 100644 index 2a777c2d7..000000000 --- a/winsup/mingw/include/strings.h +++ /dev/null @@ -1,12 +0,0 @@ -/* - File: strings.h - Copyright: Public Domain - - This file is provided because non ANSI fuctions are described in string.h - that belong in strings.h. These functions are provided for in the OLDNAME - libraries. -*/ -#if !defined(_STRINGS_H_) -# define _STRINGS_H_ 1 -# include <string.h> -#endif diff --git a/winsup/mingw/include/sys/fcntl.h b/winsup/mingw/include/sys/fcntl.h deleted file mode 100644 index a2090bc82..000000000 --- a/winsup/mingw/include/sys/fcntl.h +++ /dev/null @@ -1,7 +0,0 @@ -/* - * This file is part of the Mingw32 package. - * - * This fcntl.h maps to the root fcntl.h - */ - -#include <fcntl.h> diff --git a/winsup/mingw/include/sys/file.h b/winsup/mingw/include/sys/file.h deleted file mode 100644 index e95654c09..000000000 --- a/winsup/mingw/include/sys/file.h +++ /dev/null @@ -1,7 +0,0 @@ -/* - * This file is part of the Mingw32 package. - * - * This file.h maps to the root fcntl.h - * TODO? - */ -#include <fcntl.h> diff --git a/winsup/mingw/include/sys/locking.h b/winsup/mingw/include/sys/locking.h deleted file mode 100644 index eee5e3c54..000000000 --- a/winsup/mingw/include/sys/locking.h +++ /dev/null @@ -1,31 +0,0 @@ -/* - * locking.h - * This file has no copyright assigned and is placed in the Public Domain. - * This file is a part of the mingw-runtime package. - * No warranty is given; refer to the file DISCLAIMER within the package. - * - * Constants for the mode parameter of the locking function. - * - */ - -#ifndef _LOCKING_H_ -#define _LOCKING_H_ - -/* All the headers include this file. */ -#include <_mingw.h> - -#define _LK_UNLCK 0 /* Unlock */ -#define _LK_LOCK 1 /* Lock */ -#define _LK_NBLCK 2 /* Non-blocking lock */ -#define _LK_RLCK 3 /* Lock for read only */ -#define _LK_NBRLCK 4 /* Non-blocking lock for read only */ - -#ifndef NO_OLDNAMES -#define LK_UNLCK _LK_UNLCK -#define LK_LOCK _LK_LOCK -#define LK_NBLCK _LK_NBLCK -#define LK_RLCK _LK_RLCK -#define LK_NBRLCK _LK_NBRLCK -#endif /* Not NO_OLDNAMES */ - -#endif /* Not _LOCKING_H_ */ diff --git a/winsup/mingw/include/sys/param.h b/winsup/mingw/include/sys/param.h deleted file mode 100644 index 74966bd78..000000000 --- a/winsup/mingw/include/sys/param.h +++ /dev/null @@ -1,22 +0,0 @@ -/* - * param.h - * This file has no copyright assigned and is placed in the Public Domain. - * This file is a part of the mingw-runtime package. - * No warranty is given; refer to the file DISCLAIMER within the package. - * - */ - -#ifndef _SYS_PARAM_H -#define _SYS_PARAM_H - -#include <sys/types.h> -#include <limits.h> - -/* These are useful for cross-compiling */ -#define BIG_ENDIAN 4321 -#define LITTLE_ENDIAN 1234 -#define BYTE_ORDER LITTLE_ENDIAN - -#define MAXPATHLEN PATH_MAX - -#endif diff --git a/winsup/mingw/include/sys/stat.h b/winsup/mingw/include/sys/stat.h deleted file mode 100644 index 3bd462714..000000000 --- a/winsup/mingw/include/sys/stat.h +++ /dev/null @@ -1,196 +0,0 @@ -/* - * stat.h - * This file has no copyright assigned and is placed in the Public Domain. - * This file is a part of the mingw-runtime package. - * No warranty is given; refer to the file DISCLAIMER within the package. - * - * Symbolic constants for opening and creating files, also stat, fstat and - * chmod functions. - * - */ - -#ifndef _STAT_H_ -#define _STAT_H_ - -/* All the headers include this file. */ -#include <_mingw.h> - -#define __need_size_t -#define __need_wchar_t -#ifndef RC_INVOKED -#include <stddef.h> -#endif /* Not RC_INVOKED */ - -#include <sys/types.h> - -/* - * Constants for the stat st_mode member. - */ -#define _S_IFIFO 0x1000 /* FIFO */ -#define _S_IFCHR 0x2000 /* Character */ -#define _S_IFBLK 0x3000 /* Block: Is this ever set under w32? */ -#define _S_IFDIR 0x4000 /* Directory */ -#define _S_IFREG 0x8000 /* Regular */ - -#define _S_IFMT 0xF000 /* File type mask */ - -#define _S_IEXEC 0x0040 -#define _S_IWRITE 0x0080 -#define _S_IREAD 0x0100 - -#define _S_IRWXU (_S_IREAD | _S_IWRITE | _S_IEXEC) -#define _S_IXUSR _S_IEXEC -#define _S_IWUSR _S_IWRITE -#define _S_IRUSR _S_IREAD - -#define _S_ISDIR(m) (((m) & _S_IFMT) == _S_IFDIR) -#define _S_ISFIFO(m) (((m) & _S_IFMT) == _S_IFIFO) -#define _S_ISCHR(m) (((m) & _S_IFMT) == _S_IFCHR) -#define _S_ISBLK(m) (((m) & _S_IFMT) == _S_IFBLK) -#define _S_ISREG(m) (((m) & _S_IFMT) == _S_IFREG) - -#ifndef _NO_OLDNAMES - -#define S_IFIFO _S_IFIFO -#define S_IFCHR _S_IFCHR -#define S_IFBLK _S_IFBLK -#define S_IFDIR _S_IFDIR -#define S_IFREG _S_IFREG -#define S_IFMT _S_IFMT -#define S_IEXEC _S_IEXEC -#define S_IWRITE _S_IWRITE -#define S_IREAD _S_IREAD -#define S_IRWXU _S_IRWXU -#define S_IXUSR _S_IXUSR -#define S_IWUSR _S_IWUSR -#define S_IRUSR _S_IRUSR - -#define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR) -#define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO) -#define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR) -#define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK) -#define S_ISREG(m) (((m) & S_IFMT) == S_IFREG) - -#endif /* Not _NO_OLDNAMES */ - -#ifndef RC_INVOKED - -#ifndef _STAT_DEFINED -/* - * The structure manipulated and returned by stat and fstat. - * - * NOTE: If called on a directory the values in the time fields are not only - * invalid, they will cause localtime et. al. to return NULL. And calling - * asctime with a NULL pointer causes an Invalid Page Fault. So watch it! - */ -struct _stat -{ - _dev_t st_dev; /* Equivalent to drive number 0=A 1=B ... */ - _ino_t st_ino; /* Always zero ? */ - _mode_t st_mode; /* See above constants */ - short st_nlink; /* Number of links. */ - short st_uid; /* User: Maybe significant on NT ? */ - short st_gid; /* Group: Ditto */ - _dev_t st_rdev; /* Seems useless (not even filled in) */ - _off_t st_size; /* File size in bytes */ - time_t st_atime; /* Accessed date (always 00:00 hrs local - * on FAT) */ - time_t st_mtime; /* Modified time */ - time_t st_ctime; /* Creation time */ -}; - -#ifndef _NO_OLDNAMES -/* NOTE: Must be the same as _stat above. */ -struct stat -{ - dev_t st_dev; /* Equivalent to drive number 0=A 1=B ... */ - ino_t st_ino; /* Always zero ? */ - mode_t st_mode; /* See above constants */ - short st_nlink; /* Number of links. */ - short st_uid; /* User: Maybe significant on NT ? */ - short st_gid; /* Group: Ditto */ - dev_t st_rdev; /* Seems useless (not even filled in) */ - off_t st_size; /* File size in bytes */ - time_t st_atime; /* Accessed date (always 00:00 hrs local - * on FAT) */ - time_t st_mtime; /* Modified time */ - time_t st_ctime; /* Creation time */ -}; -#endif /* _NO_OLDNAMES */ - -#if defined (__MSVCRT__) -struct _stati64 { - _dev_t st_dev; - _ino_t st_ino; - _mode_t st_mode; - short st_nlink; - short st_uid; - short st_gid; - _dev_t st_rdev; - __int64 st_size; - time_t st_atime; - time_t st_mtime; - time_t st_ctime; -}; -#if __MSVCRT_VERSION__ >= 0x0601 -struct __stat64 -{ - _dev_t st_dev; - _ino_t st_ino; - _mode_t st_mode; - short st_nlink; - short st_uid; - short st_gid; - _dev_t st_rdev; - __int64 st_size; - __time64_t st_atime; - __time64_t st_mtime; - __time64_t st_ctime; -}; -#endif /* __MSVCRT_VERSION__ */ -#endif /* __MSVCRT__ */ -#define _STAT_DEFINED -#endif /* _STAT_DEFINED */ - -#ifdef __cplusplus -extern "C" { -#endif - -_CRTIMP int __cdecl __MINGW_NOTHROW _fstat (int, struct _stat*); -_CRTIMP int __cdecl __MINGW_NOTHROW _chmod (const char*, int); -_CRTIMP int __cdecl __MINGW_NOTHROW _stat (const char*, struct _stat*); - -#ifndef _NO_OLDNAMES - -/* These functions live in liboldnames.a. */ -_CRTIMP int __cdecl __MINGW_NOTHROW fstat (int, struct stat*); -_CRTIMP int __cdecl __MINGW_NOTHROW chmod (const char*, int); -_CRTIMP int __cdecl __MINGW_NOTHROW stat (const char*, struct stat*); - -#endif /* Not _NO_OLDNAMES */ - -#if defined (__MSVCRT__) -_CRTIMP int __cdecl __MINGW_NOTHROW _fstati64(int, struct _stati64 *); -_CRTIMP int __cdecl __MINGW_NOTHROW _stati64(const char *, struct _stati64 *); -/* These require newer versions of msvcrt.dll (6.10 or higher). */ -#if __MSVCRT_VERSION__ >= 0x0601 -_CRTIMP int __cdecl __MINGW_NOTHROW _fstat64 (int, struct __stat64*); -_CRTIMP int __cdecl __MINGW_NOTHROW _stat64 (const char*, struct __stat64*); -#endif /* __MSVCRT_VERSION__ >= 0x0601 */ -#if !defined ( _WSTAT_DEFINED) /* also declared in wchar.h */ -_CRTIMP int __cdecl __MINGW_NOTHROW _wstat(const wchar_t*, struct _stat*); -_CRTIMP int __cdecl __MINGW_NOTHROW _wstati64 (const wchar_t*, struct _stati64*); -#if __MSVCRT_VERSION__ >= 0x0601 -_CRTIMP int __cdecl __MINGW_NOTHROW _wstat64 (const wchar_t*, struct __stat64*); -#endif /* __MSVCRT_VERSION__ >= 0x0601 */ -#define _WSTAT_DEFINED -#endif /* _WSTAT_DEFIND */ -#endif /* __MSVCRT__ */ - -#ifdef __cplusplus -} -#endif - -#endif /* Not RC_INVOKED */ - -#endif /* Not _STAT_H_ */ diff --git a/winsup/mingw/include/sys/time.h b/winsup/mingw/include/sys/time.h deleted file mode 100644 index b689d736b..000000000 --- a/winsup/mingw/include/sys/time.h +++ /dev/null @@ -1,47 +0,0 @@ -#ifndef _SYS_TIME_H_ -#define _SYS_TIME_H_ -#include <time.h> - -#ifdef __cplusplus -extern "C" { -#endif - -#ifndef _TIMEVAL_DEFINED /* also in winsock[2].h */ -#define _TIMEVAL_DEFINED -struct timeval { - long tv_sec; - long tv_usec; -}; -#define timerisset(tvp) ((tvp)->tv_sec || (tvp)->tv_usec) -#define timercmp(tvp, uvp, cmp) \ - (((tvp)->tv_sec != (uvp)->tv_sec) ? \ - ((tvp)->tv_sec cmp (uvp)->tv_sec) : \ - ((tvp)->tv_usec cmp (uvp)->tv_usec)) -#define timerclear(tvp) (tvp)->tv_sec = (tvp)->tv_usec = 0 -#endif /* _TIMEVAL_DEFINED */ - -/* Provided for compatibility with code that assumes that - the presence of gettimeofday function implies a definition - of struct timezone. */ -struct timezone -{ - int tz_minuteswest; /* of Greenwich */ - int tz_dsttime; /* type of dst correction to apply */ -}; - -/* - Implementation as per: - The Open Group Base Specifications, Issue 6 - IEEE Std 1003.1, 2004 Edition - - The timezone pointer arg is ignored. Errors are ignored. -*/ -int __cdecl __MINGW_NOTHROW gettimeofday(struct timeval *__restrict__, - void *__restrict__ /* tzp (unused) */); - -#ifdef __cplusplus -} -#endif - - -#endif /* _SYS_TIME_H_ */ diff --git a/winsup/mingw/include/sys/timeb.h b/winsup/mingw/include/sys/timeb.h deleted file mode 100644 index 24af3673f..000000000 --- a/winsup/mingw/include/sys/timeb.h +++ /dev/null @@ -1,74 +0,0 @@ -/* - * timeb.h - * This file has no copyright assigned and is placed in the Public Domain. - * This file is a part of the mingw-runtime package. - * No warranty is given; refer to the file DISCLAIMER within the package. - * - * Support for the UNIX System V ftime system call. - * - */ - -#ifndef _TIMEB_H_ -#define _TIMEB_H_ - -/* All the headers include this file. */ -#include <_mingw.h> -#include <sys/types.h> - -#ifndef RC_INVOKED - -/* - * TODO: Structure not tested. - */ -struct _timeb -{ - time_t time; - short millitm; - short timezone; - short dstflag; -}; - -#ifndef _NO_OLDNAMES -/* - * TODO: Structure not tested. - */ -struct timeb -{ - time_t time; - short millitm; - short timezone; - short dstflag; -}; -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -/* TODO: Not tested. */ -_CRTIMP void __cdecl __MINGW_NOTHROW _ftime (struct _timeb*); - -#ifndef _NO_OLDNAMES -_CRTIMP void __cdecl __MINGW_NOTHROW ftime (struct timeb*); -#endif /* Not _NO_OLDNAMES */ - -/* This requires newer versions of msvcrt.dll (6.10 or higher). */ -#if __MSVCRT_VERSION__ >= 0x0601 -struct __timeb64 -{ - __time64_t time; - short millitm; - short timezone; - short dstflag; -}; - -_CRTIMP void __cdecl __MINGW_NOTHROW _ftime64 (struct __timeb64*); -#endif /* __MSVCRT_VERSION__ >= 0x0601 */ - -#ifdef __cplusplus -} -#endif - -#endif /* Not RC_INVOKED */ - -#endif /* Not _TIMEB_H_ */ diff --git a/winsup/mingw/include/sys/types.h b/winsup/mingw/include/sys/types.h deleted file mode 100644 index ed25e5270..000000000 --- a/winsup/mingw/include/sys/types.h +++ /dev/null @@ -1,124 +0,0 @@ -/* - * types.h - * This file has no copyright assigned and is placed in the Public Domain. - * This file is a part of the mingw-runtime package. - * No warranty is given; refer to the file DISCLAIMER within the package. - * - * The definition of constants, data types and global variables. - * - */ - -#ifndef _TYPES_H_ -#define _TYPES_H_ - -/* All the headers include this file. */ -#include <_mingw.h> - -#define __need_wchar_t -#define __need_size_t -#define __need_ptrdiff_t -#ifndef RC_INVOKED -#include <stddef.h> -#endif /* Not RC_INVOKED */ - -#ifndef RC_INVOKED - -#ifndef _TIME_T_DEFINED -typedef long time_t; -#define _TIME_T_DEFINED -#endif - -#ifndef _TIME64_T_DEFINED -typedef __int64 __time64_t; -#define _TIME64_T_DEFINED -#endif - -#ifndef _OFF_T_ -#define _OFF_T_ -typedef long _off_t; - -#ifndef _NO_OLDNAMES -typedef _off_t off_t; -#endif -#endif /* Not _OFF_T_ */ - - -#ifndef _DEV_T_ -#define _DEV_T_ -#ifdef __MSVCRT__ -typedef unsigned int _dev_t; -#else -typedef short _dev_t; -#endif - -#ifndef _NO_OLDNAMES -typedef _dev_t dev_t; -#endif -#endif /* Not _DEV_T_ */ - - -#ifndef _INO_T_ -#define _INO_T_ -typedef short _ino_t; - -#ifndef _NO_OLDNAMES -typedef _ino_t ino_t; -#endif -#endif /* Not _INO_T_ */ - - -#ifndef _PID_T_ -#define _PID_T_ -typedef int _pid_t; - -#ifndef _NO_OLDNAMES -typedef _pid_t pid_t; -#endif -#endif /* Not _PID_T_ */ - - -#ifndef _MODE_T_ -#define _MODE_T_ -typedef unsigned short _mode_t; - -#ifndef _NO_OLDNAMES -typedef _mode_t mode_t; -#endif -#endif /* Not _MODE_T_ */ - - -#ifndef _SIGSET_T_ -#define _SIGSET_T_ -typedef int _sigset_t; - -#ifndef _NO_OLDNAMES -typedef _sigset_t sigset_t; -#endif -#endif /* Not _SIGSET_T_ */ - -#ifndef _SSIZE_T_ -#define _SSIZE_T_ -typedef long _ssize_t; - -#ifndef _NO_OLDNAMES -typedef _ssize_t ssize_t; -#endif -#endif /* Not _SSIZE_T_ */ - -#ifndef _FPOS64_T_ -#define _FPOS64_T_ -typedef long long fpos64_t; -#endif - -#ifndef _OFF64_T_ -#define _OFF64_T_ -typedef long long off64_t; -#endif - -#if !defined __NO_ISOCEXT -typedef unsigned int useconds_t; -#endif /* Not __NO_ISOCEXT */ - -#endif /* Not RC_INVOKED */ - -#endif /* Not _TYPES_H_ */ diff --git a/winsup/mingw/include/sys/unistd.h b/winsup/mingw/include/sys/unistd.h deleted file mode 100644 index 39eac4a90..000000000 --- a/winsup/mingw/include/sys/unistd.h +++ /dev/null @@ -1,6 +0,0 @@ -/* - * This file is part of the Mingw32 package. - * - * unistd.h maps (roughly) to io.h - */ -#include <io.h> diff --git a/winsup/mingw/include/sys/utime.h b/winsup/mingw/include/sys/utime.h deleted file mode 100644 index b44479256..000000000 --- a/winsup/mingw/include/sys/utime.h +++ /dev/null @@ -1,81 +0,0 @@ -/* - * utime.h - * This file has no copyright assigned and is placed in the Public Domain. - * This file is a part of the mingw-runtime package. - * No warranty is given; refer to the file DISCLAIMER within the package. - * - * Support for the utime function. - * - */ -#ifndef _UTIME_H_ -#define _UTIME_H_ - -/* All the headers include this file. */ -#include <_mingw.h> - -#define __need_wchar_t -#define __need_size_t -#ifndef RC_INVOKED -#include <stddef.h> -#endif /* Not RC_INVOKED */ -#include <sys/types.h> - -#ifndef RC_INVOKED - -/* - * Structure used by _utime function. - */ -struct _utimbuf -{ - time_t actime; /* Access time */ - time_t modtime; /* Modification time */ -}; - - -#ifndef _NO_OLDNAMES -/* NOTE: Must be the same as _utimbuf above. */ -struct utimbuf -{ - time_t actime; - time_t modtime; -}; -#endif /* Not _NO_OLDNAMES */ - -#ifdef __cplusplus -extern "C" { -#endif - -_CRTIMP int __cdecl __MINGW_NOTHROW _utime (const char*, struct _utimbuf*); - -#ifndef _NO_OLDNAMES -_CRTIMP int __cdecl __MINGW_NOTHROW utime (const char*, struct utimbuf*); -#endif /* Not _NO_OLDNAMES */ - -_CRTIMP int __cdecl __MINGW_NOTHROW _futime (int, struct _utimbuf*); - -/* The wide character version, only available for MSVCRT versions of the - * C runtime library. */ -#ifdef __MSVCRT__ -_CRTIMP int __cdecl __MINGW_NOTHROW _wutime (const wchar_t*, struct _utimbuf*); -#endif /* MSVCRT runtime */ - -/* These require newer versions of msvcrt.dll (6.10 or higher). */ -#if __MSVCRT_VERSION__ >= 0x0601 -struct __utimbuf64 -{ - __time64_t actime; - __time64_t modtime; -}; - -_CRTIMP int __cdecl __MINGW_NOTHROW _utime64 (const char*, struct __utimbuf64*); -_CRTIMP int __cdecl __MINGW_NOTHROW _wutime64 (const wchar_t*, struct __utimbuf64*); -_CRTIMP int __cdecl __MINGW_NOTHROW _futime64 (int, struct __utimbuf64*); -#endif /* __MSVCRT_VERSION__ >= 0x0601 */ - -#ifdef __cplusplus -} -#endif - -#endif /* Not RC_INVOKED */ - -#endif /* Not _UTIME_H_ */ diff --git a/winsup/mingw/include/tchar.h b/winsup/mingw/include/tchar.h deleted file mode 100644 index f68056263..000000000 --- a/winsup/mingw/include/tchar.h +++ /dev/null @@ -1,420 +0,0 @@ -/* - * tchar.h - * This file has no copyright assigned and is placed in the Public Domain. - * This file is a part of the mingw-runtime package. - * No warranty is given; refer to the file DISCLAIMER within the package. - * - * Unicode mapping layer for the standard C library. By including this - * file and using the 't' names for string functions - * (eg. _tprintf) you can make code which can be easily adapted to both - * Unicode and non-unicode environments. In a unicode enabled compile define - * _UNICODE before including tchar.h, otherwise the standard non-unicode - * library functions will be used. - * - * Note that you still need to include string.h or stdlib.h etc. to define - * the appropriate functions. Also note that there are several defines - * included for non-ANSI functions which are commonly available (but using - * the convention of prepending an underscore to non-ANSI library function - * names). - * - */ - -#ifndef _TCHAR_H_ -#define _TCHAR_H_ - -/* All the headers include this file. */ -#include <_mingw.h> - -/* - * NOTE: This tests _UNICODE, which is different from the UNICODE define - * used to differentiate Win32 API calls. - */ -#ifdef _UNICODE - -/* - * Include <wchar.h> for wchar_t and WEOF if _UNICODE. - */ -#include <wchar.h> - -/* - * Use TCHAR instead of char or wchar_t. It will be appropriately translated - * if _UNICODE is correctly defined (or not). - */ -#ifndef _TCHAR_DEFINED -#ifndef RC_INVOKED -typedef wchar_t TCHAR; -typedef wchar_t _TCHAR; -#endif /* Not RC_INVOKED */ -#define _TCHAR_DEFINED -#endif - -/* - * Use _TEOF instead of EOF or WEOF. It will be appropriately translated if - * _UNICODE is correctly defined (or not). - */ -#define _TEOF WEOF - -/* - * __TEXT is a private macro whose specific use is to force the expansion of a - * macro passed as an argument to the macros _T or _TEXT. DO NOT use this - * macro within your programs. It's name and function could change without - * notice. - */ -#define __TEXT(q) L##q - -/* for porting from other Windows compilers */ -#if 0 /* no wide startup module */ -#define _tmain wmain -#define _tWinMain wWinMain -#define _tenviron _wenviron -#define __targv __wargv -#endif - -/* - * Unicode functions - */ -#define _tprintf wprintf -#define _ftprintf fwprintf -#define _stprintf swprintf -#define _sntprintf _snwprintf -#define _vtprintf vwprintf -#define _vftprintf vfwprintf -#define _vstprintf vswprintf -#define _vsntprintf _vsnwprintf -#define _tscanf wscanf -#define _ftscanf fwscanf -#define _stscanf swscanf -#define _fgettc fgetwc -#define _fgettchar _fgetwchar -#define _fgetts fgetws -#define _fputtc fputwc -#define _fputtchar _fputwchar -#define _fputts fputws -#define _gettc getwc -#define _getts _getws -#define _puttc putwc -#define _puttchar putwchar -#define _putts _putws -#define _ungettc ungetwc -#define _tcstod wcstod -#define _tcstol wcstol -#define _tcstoul wcstoul -#define _itot _itow -#define _ltot _ltow -#define _ultot _ultow -#define _ttoi _wtoi -#define _ttol _wtol -#define _tcscat wcscat -#define _tcschr wcschr -#define _tcscmp wcscmp -#define _tcscpy wcscpy -#define _tcscspn wcscspn -#define _tcslen wcslen -#define _tcsncat wcsncat -#define _tcsncmp wcsncmp -#define _tcsncpy wcsncpy -#define _tcspbrk wcspbrk -#define _tcsrchr wcsrchr -#define _tcsspn wcsspn -#define _tcsstr wcsstr -#define _tcstok wcstok -#define _tcsdup _wcsdup -#define _tcsicmp _wcsicmp -#define _tcsnicmp _wcsnicmp -#define _tcsnset _wcsnset -#define _tcsrev _wcsrev -#define _tcsset _wcsset -#define _tcslwr _wcslwr -#define _tcsupr _wcsupr -#define _tcsxfrm wcsxfrm -#define _tcscoll wcscoll -#define _tcsicoll _wcsicoll -#define _istalpha iswalpha -#define _istupper iswupper -#define _istlower iswlower -#define _istdigit iswdigit -#define _istxdigit iswxdigit -#define _istspace iswspace -#define _istpunct iswpunct -#define _istalnum iswalnum -#define _istprint iswprint -#define _istgraph iswgraph -#define _istcntrl iswcntrl -#define _istascii iswascii -#define _totupper towupper -#define _totlower towlower -#define _tcsftime wcsftime -/* Macro functions */ -#define _tcsdec _wcsdec -#define _tcsinc _wcsinc -#define _tcsnbcnt _wcsncnt -#define _tcsnccnt _wcsncnt -#define _tcsnextc _wcsnextc -#define _tcsninc _wcsninc -#define _tcsspnp _wcsspnp -#define _wcsdec(_wcs1, _wcs2) ((_wcs1)>=(_wcs2) ? NULL : (_wcs2)-1) -#define _wcsinc(_wcs) ((_wcs)+1) -#define _wcsnextc(_wcs) ((unsigned int) *(_wcs)) -#define _wcsninc(_wcs, _inc) (((_wcs)+(_inc))) -#define _wcsncnt(_wcs, _cnt) ((wcslen(_wcs)>_cnt) ? _count : wcslen(_wcs)) -#define _wcsspnp(_wcs1, _wcs2) ((*((_wcs1)+wcsspn(_wcs1,_wcs2))) ? ((_wcs1)+wcsspn(_wcs1,_wcs2)) : NULL) - -#if 1 /* defined __MSVCRT__ */ -/* - * These wide functions not in crtdll.dll. - * Define macros anyway so that _wfoo rather than _tfoo is undefined - */ -#define _ttoi64 _wtoi64 -#define _i64tot _i64tow -#define _ui64tot _ui64tow -#define _tasctime _wasctime -#define _tctime _wctime -#define _tstrdate _wstrdate -#define _tstrtime _wstrtime -#define _tutime _wutime -#define _tcsnccoll _wcsncoll -#define _tcsncoll _wcsncoll -#define _tcsncicoll _wcsnicoll -#define _tcsnicoll _wcsnicoll -#define _taccess _waccess -#define _tchmod _wchmod -#define _tcreat _wcreat -#define _tfindfirst _wfindfirst -#define _tfindnext _wfindnext -#define _tfdopen _wfdopen -#define _tfopen _wfopen -#define _tfreopen _wfreopen -#define _tfsopen _wfsopen -#define _tgetenv _wgetenv -#define _tputenv _wputenv -#define _tsearchenv _wsearchenv -#define _tsystem _wsystem -#define _tmakepath _wmakepath -#define _tsplitpath _wsplitpath -#define _tfullpath _wfullpath -#define _tmktemp _wmktemp -#define _topen _wopen -#define _tremove _wremove -#define _trename _wrename -#define _tsopen _wsopen -#define _tsetlocale _wsetlocale -#define _tunlink _wunlink -#define _tfinddata_t _wfinddata_t -#define _tfindfirsti64 _wfindfirsti64 -#define _tfindnexti64 _wfindnexti64 -#define _tfinddatai64_t _wfinddatai64_t -#define _tchdir _wchdir -#define _tgetcwd _wgetcwd -#define _tgetdcwd _wgetdcwd -#define _tmkdir _wmkdir -#define _trmdir _wrmdir -#define _tstat _wstat -#define _tstati64 _wstati64 -#define _tstat64 _wstat64 -#endif /* __MSVCRT__ */ - -/* dirent structures and functions */ -#define _tdirent _wdirent -#define _TDIR _WDIR -#define _topendir _wopendir -#define _tclosedir _wclosedir -#define _treaddir _wreaddir -#define _trewinddir _wrewinddir -#define _ttelldir _wtelldir -#define _tseekdir _wseekdir - -#else /* Not _UNICODE */ - -/* - * TCHAR, the type you should use instead of char. - */ -#ifndef _TCHAR_DEFINED -#ifndef RC_INVOKED -typedef char TCHAR; -typedef char _TCHAR; -#endif -#define _TCHAR_DEFINED -#endif - -/* - * _TEOF, the constant you should use instead of EOF. - */ -#define _TEOF EOF - -/* - * __TEXT is a private macro whose specific use is to force the expansion of a - * macro passed as an argument to the macros _T or _TEXT. DO NOT use this - * macro within your programs. It's name and function could change without - * notice. - */ -#define __TEXT(q) q - -/* for porting from other Windows compilers */ -#define _tmain main -#define _tWinMain WinMain -#define _tenviron _environ -#define __targv __argv - -/* - * Non-unicode (standard) functions - */ - -#define _tprintf printf -#define _ftprintf fprintf -#define _stprintf sprintf -#define _sntprintf _snprintf -#define _vtprintf vprintf -#define _vftprintf vfprintf -#define _vstprintf vsprintf -#define _vsntprintf _vsnprintf -#define _tscanf scanf -#define _ftscanf fscanf -#define _stscanf sscanf -#define _fgettc fgetc -#define _fgettchar _fgetchar -#define _fgetts fgets -#define _fputtc fputc -#define _fputtchar _fputchar -#define _fputts fputs -#define _tfdopen _fdopen -#define _tfopen fopen -#define _tfreopen freopen -#define _tfsopen _fsopen -#define _tgetenv getenv -#define _tputenv _putenv -#define _tsearchenv _searchenv -#define _tsystem system -#define _tmakepath _makepath -#define _tsplitpath _splitpath -#define _tfullpath _fullpath -#define _gettc getc -#define _getts gets -#define _puttc putc -#define _puttchar putchar -#define _putts puts -#define _ungettc ungetc -#define _tcstod strtod -#define _tcstol strtol -#define _tcstoul strtoul -#define _itot _itoa -#define _ltot _ltoa -#define _ultot _ultoa -#define _ttoi atoi -#define _ttol atol -#define _tcscat strcat -#define _tcschr strchr -#define _tcscmp strcmp -#define _tcscpy strcpy -#define _tcscspn strcspn -#define _tcslen strlen -#define _tcsncat strncat -#define _tcsncmp strncmp -#define _tcsncpy strncpy -#define _tcspbrk strpbrk -#define _tcsrchr strrchr -#define _tcsspn strspn -#define _tcsstr strstr -#define _tcstok strtok -#define _tcsdup _strdup -#define _tcsicmp _stricmp -#define _tcsnicmp _strnicmp -#define _tcsnset _strnset -#define _tcsrev _strrev -#define _tcsset _strset -#define _tcslwr _strlwr -#define _tcsupr _strupr -#define _tcsxfrm strxfrm -#define _tcscoll strcoll -#define _tcsicoll _stricoll -#define _istalpha isalpha -#define _istupper isupper -#define _istlower islower -#define _istdigit isdigit -#define _istxdigit isxdigit -#define _istspace isspace -#define _istpunct ispunct -#define _istalnum isalnum -#define _istprint isprint -#define _istgraph isgraph -#define _istcntrl iscntrl -#define _istascii isascii -#define _totupper toupper -#define _totlower tolower -#define _tasctime asctime -#define _tctime ctime -#define _tstrdate _strdate -#define _tstrtime _strtime -#define _tutime _utime -#define _tcsftime strftime -/* Macro functions */ -#define _tcsdec _strdec -#define _tcsinc _strinc -#define _tcsnbcnt _strncnt -#define _tcsnccnt _strncnt -#define _tcsnextc _strnextc -#define _tcsninc _strninc -#define _tcsspnp _strspnp -#define _strdec(_str1, _str2) ((_str1)>=(_str2) ? NULL : (_str2)-1) -#define _strinc(_str) ((_str)+1) -#define _strnextc(_str) ((unsigned int) *(_str)) -#define _strninc(_str, _inc) (((_str)+(_inc))) -#define _strncnt(_str, _cnt) ((strlen(_str)>_cnt) ? _count : strlen(_str)) -#define _strspnp(_str1, _str2) ((*((_str1)+strspn(_str1,_str2))) ? ((_str1)+strspn(_str1,_str2)) : NULL) - -#define _tchmod _chmod -#define _tcreat _creat -#define _tfindfirst _findfirst -#define _tfindnext _findnext -#define _tmktemp _mktemp -#define _topen _open -#define _taccess _access -#define _tremove remove -#define _trename rename -#define _tsopen _sopen -#define _tsetlocale setlocale -#define _tunlink _unlink -#define _tfinddata_t _finddata_t -#define _tchdir _chdir -#define _tgetcwd _getcwd -#define _tgetdcwd _getdcwd -#define _tmkdir _mkdir -#define _trmdir _rmdir -#define _tstat _stat - -#if 1 /* defined __MSVCRT__ */ -/* Not in crtdll.dll. Define macros anyway? */ -#define _ttoi64 _atoi64 -#define _i64tot _i64toa -#define _ui64tot _ui64toa -#define _tcsnccoll _strncoll -#define _tcsncoll _strncoll -#define _tcsncicoll _strnicoll -#define _tcsnicoll _strnicoll -#define _tfindfirsti64 _findfirsti64 -#define _tfindnexti64 _findnexti64 -#define _tfinddatai64_t _finddatai64_t -#define _tstati64 _stati64 -#define _tstat64 _stat64 -#endif /* __MSVCRT__ */ - -/* dirent structures and functions */ -#define _tdirent dirent -#define _TDIR DIR -#define _topendir opendir -#define _tclosedir closedir -#define _treaddir readdir -#define _trewinddir rewinddir -#define _ttelldir telldir -#define _tseekdir seekdir - -#endif /* Not _UNICODE */ - -/* - * UNICODE a constant string when _UNICODE is defined else returns the string - * unmodified. Also defined in w32api/winnt.h. - */ -#define _TEXT(x) __TEXT(x) -#define _T(x) __TEXT(x) - -#endif /* Not _TCHAR_H_ */ - diff --git a/winsup/mingw/include/time.h b/winsup/mingw/include/time.h deleted file mode 100644 index 804778f43..000000000 --- a/winsup/mingw/include/time.h +++ /dev/null @@ -1,218 +0,0 @@ -/* - * time.h - * This file has no copyright assigned and is placed in the Public Domain. - * This file is a part of the mingw-runtime package. - * No warranty is given; refer to the file DISCLAIMER within the package. - * - * Date and time functions and types. - * - */ - -#ifndef _TIME_H_ -#define _TIME_H_ - -/* All the headers include this file. */ -#include <_mingw.h> - -#define __need_wchar_t -#define __need_size_t -#define __need_NULL -#ifndef RC_INVOKED -#include <stddef.h> -#endif /* Not RC_INVOKED */ - -/* - * Number of clock ticks per second. A clock tick is the unit by which - * processor time is measured and is returned by 'clock'. - */ -#define CLOCKS_PER_SEC ((clock_t)1000) -#define CLK_TCK CLOCKS_PER_SEC - - -#ifndef RC_INVOKED - -/* - * A type for storing the current time and date. This is the number of - * seconds since midnight Jan 1, 1970. - * NOTE: This is also defined in non-ISO sys/types.h. - */ -#ifndef _TIME_T_DEFINED -typedef long time_t; -#define _TIME_T_DEFINED -#endif - -#ifndef __STRICT_ANSI__ -/* A 64-bit time_t to get to Y3K */ -#ifndef _TIME64_T_DEFINED -typedef __int64 __time64_t; -#define _TIME64_T_DEFINED -#endif -#endif -/* - * A type for measuring processor time (in clock ticks). - */ -#ifndef _CLOCK_T_DEFINED -typedef long clock_t; -#define _CLOCK_T_DEFINED -#endif - -#ifndef _TM_DEFINED -/* - * A structure for storing all kinds of useful information about the - * current (or another) time. - */ -struct tm -{ - int tm_sec; /* Seconds: 0-59 (K&R says 0-61?) */ - int tm_min; /* Minutes: 0-59 */ - int tm_hour; /* Hours since midnight: 0-23 */ - int tm_mday; /* Day of the month: 1-31 */ - int tm_mon; /* Months *since* january: 0-11 */ - int tm_year; /* Years since 1900 */ - int tm_wday; /* Days since Sunday (0-6) */ - int tm_yday; /* Days since Jan. 1: 0-365 */ - int tm_isdst; /* +1 Daylight Savings Time, 0 No DST, - * -1 don't know */ -}; -#define _TM_DEFINED -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -_CRTIMP clock_t __cdecl __MINGW_NOTHROW clock (void); -_CRTIMP time_t __cdecl __MINGW_NOTHROW time (time_t*); -_CRTIMP double __cdecl __MINGW_NOTHROW difftime (time_t, time_t); -_CRTIMP time_t __cdecl __MINGW_NOTHROW mktime (struct tm*); - -/* - * These functions write to and return pointers to static buffers that may - * be overwritten by other function calls. Yikes! - * - * NOTE: localtime, and perhaps the others of the four functions grouped - * below may return NULL if their argument is not 'acceptable'. Also note - * that calling asctime with a NULL pointer will produce an Invalid Page - * Fault and crap out your program. Guess how I know. Hint: stat called on - * a directory gives 'invalid' times in st_atime etc... - */ -_CRTIMP char* __cdecl __MINGW_NOTHROW asctime (const struct tm*); -_CRTIMP char* __cdecl __MINGW_NOTHROW ctime (const time_t*); -_CRTIMP struct tm* __cdecl __MINGW_NOTHROW gmtime (const time_t*); -_CRTIMP struct tm* __cdecl __MINGW_NOTHROW localtime (const time_t*); - -_CRTIMP size_t __cdecl __MINGW_NOTHROW strftime (char*, size_t, const char*, const struct tm*); - -#ifndef __STRICT_ANSI__ - -extern _CRTIMP void __cdecl __MINGW_NOTHROW _tzset (void); - -#ifndef _NO_OLDNAMES -extern _CRTIMP void __cdecl __MINGW_NOTHROW tzset (void); -#endif - -_CRTIMP char* __cdecl __MINGW_NOTHROW _strdate(char*); -_CRTIMP char* __cdecl __MINGW_NOTHROW _strtime(char*); - -/* These require newer versions of msvcrt.dll (6.10 or higher). */ -#if __MSVCRT_VERSION__ >= 0x0601 -_CRTIMP __time64_t __cdecl __MINGW_NOTHROW _time64( __time64_t*); -_CRTIMP __time64_t __cdecl __MINGW_NOTHROW _mktime64 (struct tm*); -_CRTIMP char* __cdecl __MINGW_NOTHROW _ctime64 (const __time64_t*); -_CRTIMP struct tm* __cdecl __MINGW_NOTHROW _gmtime64 (const __time64_t*); -_CRTIMP struct tm* __cdecl __MINGW_NOTHROW _localtime64 (const __time64_t*); -#endif /* __MSVCRT_VERSION__ >= 0x0601 */ - -/* - * _daylight: non zero if daylight savings time is used. - * _timezone: difference in seconds between GMT and local time. - * _tzname: standard/daylight savings time zone names (an array with two - * elements). - */ -#ifdef __MSVCRT__ - -/* These are for compatibility with pre-VC 5.0 suppied MSVCRT. */ -extern _CRTIMP int* __cdecl __MINGW_NOTHROW __p__daylight (void); -extern _CRTIMP long* __cdecl __MINGW_NOTHROW __p__timezone (void); -extern _CRTIMP char** __cdecl __MINGW_NOTHROW __p__tzname (void); - -__MINGW_IMPORT int _daylight; -__MINGW_IMPORT long _timezone; -__MINGW_IMPORT char *_tzname[2]; - -#else /* not __MSVCRT (ie. crtdll) */ - -#ifndef __DECLSPEC_SUPPORTED - -extern int* _imp___daylight_dll; -extern long* _imp___timezone_dll; -extern char** _imp___tzname; - -#define _daylight (*_imp___daylight_dll) -#define _timezone (*_imp___timezone_dll) -#define _tzname (*_imp___tzname) - -#else /* __DECLSPEC_SUPPORTED */ - -__MINGW_IMPORT int _daylight_dll; -__MINGW_IMPORT long _timezone_dll; -__MINGW_IMPORT char* _tzname[2]; - -#define _daylight _daylight_dll -#define _timezone _timezone_dll - -#endif /* __DECLSPEC_SUPPORTED */ - -#endif /* not __MSVCRT__ */ - -#ifndef _NO_OLDNAMES - -#ifdef __MSVCRT__ - -/* These go in the oldnames import library for MSVCRT. */ -__MINGW_IMPORT int daylight; -__MINGW_IMPORT long timezone; -__MINGW_IMPORT char *tzname[2]; - -#else /* not __MSVCRT__ */ - -/* CRTDLL is royally messed up when it comes to these macros. - TODO: import and alias these via oldnames import library instead - of macros. */ - -#define daylight _daylight -/* NOTE: timezone not defined as macro because it would conflict with - struct timezone in sys/time.h. - Also, tzname used to a be macro, but now it's in moldname. */ -__MINGW_IMPORT char *tzname[2]; - -#endif /* not __MSVCRT__ */ - -#endif /* Not _NO_OLDNAMES */ -#endif /* Not __STRICT_ANSI__ */ - -#ifndef _WTIME_DEFINED -/* wide function prototypes, also declared in wchar.h */ -#ifndef __STRICT_ANSI__ -#ifdef __MSVCRT__ -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wasctime(const struct tm*); -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wctime(const time_t*); -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wstrdate(wchar_t*); -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wstrtime(wchar_t*); -#if __MSVCRT_VERSION__ >= 0x0601 -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wctime64 (const __time64_t*); -#endif -#endif /* __MSVCRT__ */ -#endif /* __STRICT_ANSI__ */ -_CRTIMP size_t __cdecl __MINGW_NOTHROW wcsftime (wchar_t*, size_t, const wchar_t*, const struct tm*); -#define _WTIME_DEFINED -#endif /* _WTIME_DEFINED */ - -#ifdef __cplusplus -} -#endif - -#endif /* Not RC_INVOKED */ - -#endif /* Not _TIME_H_ */ - diff --git a/winsup/mingw/include/unistd.h b/winsup/mingw/include/unistd.h deleted file mode 100644 index 3e7f2364a..000000000 --- a/winsup/mingw/include/unistd.h +++ /dev/null @@ -1,52 +0,0 @@ -#ifndef _UNISTD_H -/* - * This file is part of the Mingw32 package. - * - * unistd.h maps (roughly) to io.h - * Other headers included by unistd.h may be selectively processed; - * __UNISTD_H_SOURCED__ enables such selective processing. - */ -#define _UNISTD_H -#define __UNISTD_H_SOURCED__ 1 - -#include <io.h> -#include <process.h> -#include <getopt.h> - -/* These are also defined in stdio.h. */ -#ifndef SEEK_SET -#define SEEK_SET 0 -#endif - -#ifndef SEEK_CUR -#define SEEK_CUR 1 -#endif - -#ifndef SEEK_END -#define SEEK_END 2 -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -#if !defined __NO_ISOCEXT -#include <sys/types.h> /* For useconds_t. */ - -int __cdecl __MINGW_NOTHROW usleep(useconds_t useconds); -#endif /* Not __NO_ISOCEXT */ - -/* This is defined as a real library function to allow autoconf - to verify its existence. */ -int ftruncate(int, off_t); -__CRT_INLINE int ftruncate(int __fd, off_t __length) -{ - return _chsize (__fd, __length); -} - -#ifdef __cplusplus -} -#endif - -#undef __UNISTD_H_SOURCED__ -#endif /* _UNISTD_H */ diff --git a/winsup/mingw/include/utime.h b/winsup/mingw/include/utime.h deleted file mode 100644 index 8285f38fd..000000000 --- a/winsup/mingw/include/utime.h +++ /dev/null @@ -1 +0,0 @@ -#include <sys/utime.h> diff --git a/winsup/mingw/include/values.h b/winsup/mingw/include/values.h deleted file mode 100644 index 10e16a281..000000000 --- a/winsup/mingw/include/values.h +++ /dev/null @@ -1,4 +0,0 @@ -/* - * TODO: Nothing here yet. Should provide UNIX compatibility constants - * comparible to those in limits.h and float.h. - */ diff --git a/winsup/mingw/include/varargs.h b/winsup/mingw/include/varargs.h deleted file mode 100644 index c1197e97e..000000000 --- a/winsup/mingw/include/varargs.h +++ /dev/null @@ -1,7 +0,0 @@ -/* - * This is just an RC_INVOKED guard for the real varargs.h - * fixincluded in gcc system dir. One day we will delete this file. - */ -#ifndef RC_INVOKED -#include_next<varargs.h> -#endif diff --git a/winsup/mingw/include/wchar.h b/winsup/mingw/include/wchar.h deleted file mode 100644 index be769527b..000000000 --- a/winsup/mingw/include/wchar.h +++ /dev/null @@ -1,518 +0,0 @@ -/* - * wchar.h - * This file has no copyright assigned and is placed in the Public Domain. - * This file is a part of the mingw-runtime package. - * No warranty is given; refer to the file DISCLAIMER within the package. - * - * Defines of all functions for supporting wide characters. Actually it - * just includes all those headers, which is not a good thing to do from a - * processing time point of view, but it does mean that everything will be - * in sync. - * - */ - -#ifndef _WCHAR_H_ -#define _WCHAR_H_ - -/* All the headers include this file. */ -#include <_mingw.h> - -#ifndef RC_INVOKED - -#define __need_size_t -#define __need_wint_t -#define __need_wchar_t -#define __need_NULL -#include <stddef.h> - -#ifndef __VALIST -#if defined __GNUC__ && __GNUC__ >= 3 -#define __need___va_list -#include <stdarg.h> -#define __VALIST __builtin_va_list -#else -#define __VALIST char* -#endif -#endif - -#endif /* Not RC_INVOKED */ - -/* - * MSDN says that isw* char classifications are in wchar.h and wctype.h. - * Although the wctype names are ANSI, their exposure in this header is - * not. - */ -#include <wctype.h> - -#ifndef __STRICT_ANSI__ -/* This is necessary to support the the non-ANSI wchar declarations - here. */ -#include <sys/types.h> -#endif /* __STRICT_ANSI__ */ - -#define WCHAR_MIN 0 -#define WCHAR_MAX 0xffff - -#ifndef WEOF -#define WEOF (wchar_t)(0xFFFF) -#endif - -#ifndef RC_INVOKED - -#ifdef __cplusplus -extern "C" { -#endif - -#ifndef _FILE_DEFINED /* Also in stdio.h */ -#define _FILE_DEFINED -typedef struct _iobuf -{ - char* _ptr; - int _cnt; - char* _base; - int _flag; - int _file; - int _charbuf; - int _bufsiz; - char* _tmpfname; -} FILE; -#endif /* Not _FILE_DEFINED */ - -#ifndef _TIME_T_DEFINED /* Also in time.h */ -typedef long time_t; -#define _TIME_T_DEFINED -#endif - -#ifndef _TM_DEFINED /* Also in time.h */ -struct tm { - int tm_sec; /* seconds after the minute - [0,59] */ - int tm_min; /* minutes after the hour - [0,59] */ - int tm_hour; /* hours since midnight - [0,23] */ - int tm_mday; /* day of the month - [1,31] */ - int tm_mon; /* months since January - [0,11] */ - int tm_year; /* years since 1900 */ - int tm_wday; /* days since Sunday - [0,6] */ - int tm_yday; /* days since January 1 - [0,365] */ - int tm_isdst; /* daylight savings time flag */ - }; -#define _TM_DEFINED -#endif - -#ifndef _WSTDIO_DEFINED -/* Also in stdio.h - keep in sync */ -_CRTIMP int __cdecl __MINGW_NOTHROW fwprintf (FILE*, const wchar_t*, ...); -_CRTIMP int __cdecl __MINGW_NOTHROW wprintf (const wchar_t*, ...); -_CRTIMP int __cdecl __MINGW_NOTHROW _snwprintf (wchar_t*, size_t, const wchar_t*, ...); -_CRTIMP int __cdecl __MINGW_NOTHROW vfwprintf (FILE*, const wchar_t*, __VALIST); -_CRTIMP int __cdecl __MINGW_NOTHROW vwprintf (const wchar_t*, __VALIST); -_CRTIMP int __cdecl __MINGW_NOTHROW _vsnwprintf (wchar_t*, size_t, const wchar_t*, __VALIST); -_CRTIMP int __cdecl __MINGW_NOTHROW fwscanf (FILE*, const wchar_t*, ...); -_CRTIMP int __cdecl __MINGW_NOTHROW wscanf (const wchar_t*, ...); -_CRTIMP int __cdecl __MINGW_NOTHROW swscanf (const wchar_t*, const wchar_t*, ...); -_CRTIMP wint_t __cdecl __MINGW_NOTHROW fgetwc (FILE*); -_CRTIMP wint_t __cdecl __MINGW_NOTHROW fputwc (wchar_t, FILE*); -_CRTIMP wint_t __cdecl __MINGW_NOTHROW ungetwc (wchar_t, FILE*); - -/* These differ from the ISO C prototypes, which have a maxlen parameter like snprintf. */ -#ifndef __STRICT_ANSI__ -_CRTIMP int __cdecl __MINGW_NOTHROW swprintf (wchar_t*, const wchar_t*, ...); -_CRTIMP int __cdecl __MINGW_NOTHROW vswprintf (wchar_t*, const wchar_t*, __VALIST); -#endif - -#ifdef __MSVCRT__ -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW fgetws (wchar_t*, int, FILE*); -_CRTIMP int __cdecl __MINGW_NOTHROW fputws (const wchar_t*, FILE*); -_CRTIMP wint_t __cdecl __MINGW_NOTHROW getwc (FILE*); -_CRTIMP wint_t __cdecl __MINGW_NOTHROW getwchar (void); -_CRTIMP wint_t __cdecl __MINGW_NOTHROW putwc (wint_t, FILE*); -_CRTIMP wint_t __cdecl __MINGW_NOTHROW putwchar (wint_t); -#ifndef __STRICT_ANSI__ -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _getws (wchar_t*); -_CRTIMP int __cdecl __MINGW_NOTHROW _putws (const wchar_t*); -_CRTIMP FILE* __cdecl __MINGW_NOTHROW _wfdopen(int, const wchar_t *); -_CRTIMP FILE* __cdecl __MINGW_NOTHROW _wfopen (const wchar_t*, const wchar_t*); -_CRTIMP FILE* __cdecl __MINGW_NOTHROW _wfreopen (const wchar_t*, const wchar_t*, FILE*); -_CRTIMP FILE* __cdecl __MINGW_NOTHROW _wfsopen (const wchar_t*, const wchar_t*, int); -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wtmpnam (wchar_t*); -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wtempnam (const wchar_t*, const wchar_t*); -_CRTIMP int __cdecl __MINGW_NOTHROW _wrename (const wchar_t*, const wchar_t*); -_CRTIMP int __cdecl __MINGW_NOTHROW _wremove (const wchar_t*); -_CRTIMP void __cdecl __MINGW_NOTHROW _wperror (const wchar_t*); -_CRTIMP FILE* __cdecl __MINGW_NOTHROW _wpopen (const wchar_t*, const wchar_t*); -#endif /* __STRICT_ANSI__ */ -#endif /* __MSVCRT__ */ - -#ifndef __NO_ISOCEXT /* externs in libmingwex.a */ -int __cdecl __MINGW_NOTHROW snwprintf (wchar_t* s, size_t n, const wchar_t* format, ...); -__CRT_INLINE int __cdecl __MINGW_NOTHROW -vsnwprintf (wchar_t* s, size_t n, const wchar_t* format, __VALIST arg) - { return _vsnwprintf ( s, n, format, arg);} -int __cdecl __MINGW_NOTHROW vwscanf (const wchar_t * __restrict__, __VALIST); -int __cdecl __MINGW_NOTHROW vfwscanf (FILE * __restrict__, - const wchar_t * __restrict__, __VALIST); -int __cdecl __MINGW_NOTHROW vswscanf (const wchar_t * __restrict__, - const wchar_t * __restrict__, __VALIST); -#endif - -#define _WSTDIO_DEFINED -#endif /* _WSTDIO_DEFINED */ - -#ifndef _WSTDLIB_DEFINED /* also declared in stdlib.h */ -_CRTIMP long __cdecl __MINGW_NOTHROW wcstol (const wchar_t*, wchar_t**, int); -_CRTIMP unsigned long __cdecl __MINGW_NOTHROW wcstoul (const wchar_t*, wchar_t**, int); -_CRTIMP double __cdecl __MINGW_NOTHROW wcstod (const wchar_t*, wchar_t**); -#if !defined __NO_ISOCEXT /* in libmingwex.a */ -float __cdecl __MINGW_NOTHROW wcstof (const wchar_t * __restrict__, wchar_t ** __restrict__); -long double __cdecl __MINGW_NOTHROW wcstold (const wchar_t * __restrict__, wchar_t ** __restrict__); -#endif /* __NO_ISOCEXT */ -#ifdef __MSVCRT__ -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wgetenv(const wchar_t*); -_CRTIMP int __cdecl __MINGW_NOTHROW _wputenv(const wchar_t*); -_CRTIMP void __cdecl __MINGW_NOTHROW _wsearchenv(const wchar_t*, const wchar_t*, wchar_t*); -_CRTIMP int __cdecl __MINGW_NOTHROW _wsystem(const wchar_t*); -_CRTIMP void __cdecl __MINGW_NOTHROW _wmakepath(wchar_t*, const wchar_t*, const wchar_t*, const wchar_t*, const wchar_t*); -_CRTIMP void __cdecl __MINGW_NOTHROW _wsplitpath (const wchar_t*, wchar_t*, wchar_t*, wchar_t*, wchar_t*); -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wfullpath (wchar_t*, const wchar_t*, size_t); -#endif -#define _WSTDLIB_DEFINED -#endif /* _WSTDLIB_DEFINED */ - -#ifndef _WTIME_DEFINED -#ifndef __STRICT_ANSI__ -#ifdef __MSVCRT__ -/* wide function prototypes, also declared in time.h */ -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wasctime (const struct tm*); -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wctime (const time_t*); -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wstrdate (wchar_t*); -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wstrtime (wchar_t*); -#if __MSVCRT_VERSION__ >= 0x601 -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wctime64 (const __time64_t*); -#endif -#endif /* __MSVCRT__ */ -#endif /* __STRICT_ANSI__ */ -_CRTIMP size_t __cdecl __MINGW_NOTHROW wcsftime (wchar_t*, size_t, const wchar_t*, const struct tm*); -#define _WTIME_DEFINED -#endif /* _WTIME_DEFINED */ - - -#ifndef _WSTRING_DEFINED -/* - * Unicode versions of the standard string calls. - * Also in string.h. - */ -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW wcscat (wchar_t*, const wchar_t*); -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW wcschr (const wchar_t*, wchar_t); -_CRTIMP int __cdecl __MINGW_NOTHROW wcscmp (const wchar_t*, const wchar_t*); -_CRTIMP int __cdecl __MINGW_NOTHROW wcscoll (const wchar_t*, const wchar_t*); -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW wcscpy (wchar_t*, const wchar_t*); -_CRTIMP size_t __cdecl __MINGW_NOTHROW wcscspn (const wchar_t*, const wchar_t*); -/* Note: _wcserror requires __MSVCRT_VERSION__ >= 0x0700. */ -_CRTIMP size_t __cdecl __MINGW_NOTHROW wcslen (const wchar_t*); -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW wcsncat (wchar_t*, const wchar_t*, size_t); -_CRTIMP int __cdecl __MINGW_NOTHROW wcsncmp(const wchar_t*, const wchar_t*, size_t); -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW wcsncpy(wchar_t*, const wchar_t*, size_t); -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW wcspbrk(const wchar_t*, const wchar_t*); -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW wcsrchr(const wchar_t*, wchar_t); -_CRTIMP size_t __cdecl __MINGW_NOTHROW wcsspn(const wchar_t*, const wchar_t*); -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW wcsstr(const wchar_t*, const wchar_t*); -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW wcstok(wchar_t*, const wchar_t*); -_CRTIMP size_t __cdecl __MINGW_NOTHROW wcsxfrm(wchar_t*, const wchar_t*, size_t); - -#ifndef __STRICT_ANSI__ -/* - * Unicode versions of non-ANSI functions provided by CRTDLL. - */ - -/* NOTE: _wcscmpi not provided by CRTDLL, this define is for portability */ -#define _wcscmpi _wcsicmp - -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wcsdup (const wchar_t*); -_CRTIMP int __cdecl __MINGW_NOTHROW _wcsicmp (const wchar_t*, const wchar_t*); -_CRTIMP int __cdecl __MINGW_NOTHROW _wcsicoll (const wchar_t*, const wchar_t*); -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wcslwr (wchar_t*); -_CRTIMP int __cdecl __MINGW_NOTHROW _wcsnicmp (const wchar_t*, const wchar_t*, size_t); -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wcsnset (wchar_t*, wchar_t, size_t); -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wcsrev (wchar_t*); -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wcsset (wchar_t*, wchar_t); -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wcsupr (wchar_t*); - -#ifdef __MSVCRT__ -_CRTIMP int __cdecl __MINGW_NOTHROW _wcsncoll(const wchar_t*, const wchar_t*, size_t); -_CRTIMP int __cdecl __MINGW_NOTHROW _wcsnicoll(const wchar_t*, const wchar_t*, size_t); -#if __MSVCRT_VERSION__ >= 0x0700 -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wcserror(int); -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW __wcserror(const wchar_t*); -#endif -#endif - -#ifndef _NO_OLDNAMES -/* NOTE: There is no _wcscmpi, but this is for compatibility. */ -__CRT_INLINE int __cdecl __MINGW_NOTHROW -wcscmpi (const wchar_t * __ws1, const wchar_t * __ws2) - {return _wcsicmp (__ws1, __ws2);} -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW wcsdup (const wchar_t*); -_CRTIMP int __cdecl __MINGW_NOTHROW wcsicmp (const wchar_t*, const wchar_t*); -_CRTIMP int __cdecl __MINGW_NOTHROW wcsicoll (const wchar_t*, const wchar_t*); -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW wcslwr (wchar_t*); -_CRTIMP int __cdecl __MINGW_NOTHROW wcsnicmp (const wchar_t*, const wchar_t*, size_t); -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW wcsnset (wchar_t*, wchar_t, size_t); -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW wcsrev (wchar_t*); -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW wcsset (wchar_t*, wchar_t); -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW wcsupr (wchar_t*); -#endif /* Not _NO_OLDNAMES */ - -#endif /* Not strict ANSI */ - -#define _WSTRING_DEFINED -#endif /* _WSTRING_DEFINED */ - -/* These are resolved by -lmingwex. Alternatively, they can be resolved by - adding -lmsvcp60 to your command line, which will give you the VC++ - versions of these functions. If you want the latter and don't have - msvcp60.dll in your windows system directory, you can easily obtain - it with a search from your favorite search engine. */ -#ifndef __STRICT_ANSI__ -typedef wchar_t _Wint_t; -#endif - -typedef int mbstate_t; - -wint_t __cdecl __MINGW_NOTHROW btowc(int); -size_t __cdecl __MINGW_NOTHROW mbrlen(const char * __restrict__, size_t, - mbstate_t * __restrict__); -size_t __cdecl __MINGW_NOTHROW mbrtowc(wchar_t * __restrict__, const char * __restrict__, - size_t, mbstate_t * __restrict__); -size_t __cdecl __MINGW_NOTHROW mbsrtowcs(wchar_t * __restrict__, const char ** __restrict__, - size_t, mbstate_t * __restrict__); -size_t __cdecl __MINGW_NOTHROW wcrtomb(char * __restrict__, wchar_t, - mbstate_t * __restrict__); -size_t __cdecl __MINGW_NOTHROW wcsrtombs(char * __restrict__, const wchar_t ** __restrict__, - size_t, mbstate_t * __restrict__); -int __cdecl __MINGW_NOTHROW wctob(wint_t); - -#ifndef __NO_ISOCEXT /* these need static lib libmingwex.a */ -int __cdecl __MINGW_NOTHROW fwide(FILE*, int); -int __cdecl __MINGW_NOTHROW mbsinit(const mbstate_t*); -#ifndef __NO_INLINE__ -__CRT_INLINE int __cdecl __MINGW_NOTHROW fwide(FILE* __UNUSED_PARAM(stream), - int mode) - {return mode;} /* Nothing to do */ -__CRT_INLINE int __cdecl __MINGW_NOTHROW mbsinit(const mbstate_t* __UNUSED_PARAM(ps)) - {return 1;} -#endif -wchar_t* __cdecl __MINGW_NOTHROW wmemset(wchar_t *, wchar_t, size_t); -wchar_t* __cdecl __MINGW_NOTHROW wmemchr(const wchar_t*, wchar_t, size_t); -int wmemcmp(const wchar_t*, const wchar_t *, size_t); -wchar_t* __cdecl __MINGW_NOTHROW wmemcpy(wchar_t* __restrict__, - const wchar_t* __restrict__, - size_t); -wchar_t* __cdecl __MINGW_NOTHROW wmemmove(wchar_t* s1, const wchar_t *, size_t); -long long __cdecl __MINGW_NOTHROW wcstoll(const wchar_t * __restrict__, - wchar_t** __restrict__, int); -unsigned long long __cdecl __MINGW_NOTHROW wcstoull(const wchar_t * __restrict__, - wchar_t ** __restrict__, int); -#endif /* __NO_ISOCEXT */ - -#ifndef __STRICT_ANSI__ -/* non-ANSI wide char functions from io.h, direct.h, sys/stat.h and locale.h. */ - -#ifndef _FSIZE_T_DEFINED -typedef unsigned long _fsize_t; -#define _FSIZE_T_DEFINED -#endif - -#ifndef _WFINDDATA_T_DEFINED -struct _wfinddata_t { - unsigned attrib; - time_t time_create; /* -1 for FAT file systems */ - time_t time_access; /* -1 for FAT file systems */ - time_t time_write; - _fsize_t size; - wchar_t name[260]; /* may include spaces. */ -}; -struct _wfinddatai64_t { - unsigned attrib; - time_t time_create; - time_t time_access; - time_t time_write; - __int64 size; - wchar_t name[260]; -}; -#if __MSVCRT_VERSION__ >= 0x0601 -struct __wfinddata64_t { - unsigned attrib; - __time64_t time_create; - __time64_t time_access; - __time64_t time_write; -/* 8 bytes are returned so it can't be _fsize_t */ - __int64 size; - wchar_t name[260]; -}; -#endif -#define _WFINDDATA_T_DEFINED -#endif - -/* Wide character versions. Also defined in io.h. */ -/* CHECK: I believe these only exist in MSVCRT, and not in CRTDLL. Also - applies to other wide character versions? */ -#if !defined (_WIO_DEFINED) -#if defined (__MSVCRT__) -#include <stdint.h> /* For intptr_t. */ -_CRTIMP int __cdecl __MINGW_NOTHROW _waccess (const wchar_t*, int); -_CRTIMP int __cdecl __MINGW_NOTHROW _wchmod (const wchar_t*, int); -_CRTIMP int __cdecl __MINGW_NOTHROW _wcreat (const wchar_t*, int); -_CRTIMP long __cdecl __MINGW_NOTHROW _wfindfirst (const wchar_t*, struct _wfinddata_t *); -_CRTIMP int __cdecl __MINGW_NOTHROW _wfindnext (long, struct _wfinddata_t *); -_CRTIMP int __cdecl __MINGW_NOTHROW _wunlink (const wchar_t*); -_CRTIMP int __cdecl __MINGW_NOTHROW _wopen (const wchar_t*, int, ...); -_CRTIMP int __cdecl __MINGW_NOTHROW _wsopen (const wchar_t*, int, int, ...); -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wmktemp (wchar_t*); -_CRTIMP long __cdecl __MINGW_NOTHROW _wfindfirsti64 (const wchar_t*, struct _wfinddatai64_t*); -_CRTIMP int __cdecl __MINGW_NOTHROW _wfindnexti64 (long, struct _wfinddatai64_t*); -#if __MSVCRT_VERSION__ >= 0x0601 -_CRTIMP intptr_t __cdecl __MINGW_NOTHROW _wfindfirst64(const wchar_t*, struct __wfinddata64_t*); -_CRTIMP intptr_t __cdecl __MINGW_NOTHROW _wfindnext64(intptr_t, struct __wfinddata64_t*); -#endif /* __MSVCRT_VERSION__ >= 0x0601 */ -#endif /* defined (__MSVCRT__) */ -#define _WIO_DEFINED -#endif /* _WIO_DEFINED */ - -#ifndef _WDIRECT_DEFINED -/* Also in direct.h */ -#ifdef __MSVCRT__ -_CRTIMP int __cdecl __MINGW_NOTHROW _wchdir (const wchar_t*); -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wgetcwd (wchar_t*, int); -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wgetdcwd (int, wchar_t*, int); -_CRTIMP int __cdecl __MINGW_NOTHROW _wmkdir (const wchar_t*); -_CRTIMP int __cdecl __MINGW_NOTHROW _wrmdir (const wchar_t*); -#endif /* __MSVCRT__ */ -#define _WDIRECT_DEFINED -#endif /* _WDIRECT_DEFINED */ - -#ifndef _STAT_DEFINED -/* - * The structure manipulated and returned by stat and fstat. - * - * NOTE: If called on a directory the values in the time fields are not only - * invalid, they will cause localtime et. al. to return NULL. And calling - * asctime with a NULL pointer causes an Invalid Page Fault. So watch it! - */ -struct _stat -{ - _dev_t st_dev; /* Equivalent to drive number 0=A 1=B ... */ - _ino_t st_ino; /* Always zero ? */ - _mode_t st_mode; /* See above constants */ - short st_nlink; /* Number of links. */ - short st_uid; /* User: Maybe significant on NT ? */ - short st_gid; /* Group: Ditto */ - _dev_t st_rdev; /* Seems useless (not even filled in) */ - _off_t st_size; /* File size in bytes */ - time_t st_atime; /* Accessed date (always 00:00 hrs local - * on FAT) */ - time_t st_mtime; /* Modified time */ - time_t st_ctime; /* Creation time */ -}; - -#ifndef _NO_OLDNAMES -/* NOTE: Must be the same as _stat above. */ -struct stat -{ - dev_t st_dev; /* Equivalent to drive number 0=A 1=B ... */ - ino_t st_ino; /* Always zero ? */ - mode_t st_mode; /* See above constants */ - short st_nlink; /* Number of links. */ - short st_uid; /* User: Maybe significant on NT ? */ - short st_gid; /* Group: Ditto */ - dev_t st_rdev; /* Seems useless (not even filled in) */ - off_t st_size; /* File size in bytes */ - time_t st_atime; /* Accessed date (always 00:00 hrs local - * on FAT) */ - time_t st_mtime; /* Modified time */ - time_t st_ctime; /* Creation time */ -}; -#endif /* _NO_OLDNAMES */ - -#if defined (__MSVCRT__) -struct _stati64 { - _dev_t st_dev; - _ino_t st_ino; - unsigned short st_mode; - short st_nlink; - short st_uid; - short st_gid; - _dev_t st_rdev; - __int64 st_size; - time_t st_atime; - time_t st_mtime; - time_t st_ctime; -}; - -#if __MSVCRT_VERSION__ >= 0x0601 -struct __stat64 -{ - _dev_t st_dev; - _ino_t st_ino; - _mode_t st_mode; - short st_nlink; - short st_uid; - short st_gid; - _dev_t st_rdev; - __int64 st_size; - __time64_t st_atime; - __time64_t st_mtime; - __time64_t st_ctime; -}; -#endif /* __MSVCRT_VERSION__ */ -#endif /* __MSVCRT__ */ -#define _STAT_DEFINED -#endif /* _STAT_DEFINED */ - -#if !defined ( _WSTAT_DEFINED) -/* also declared in sys/stat.h */ -#if defined __MSVCRT__ -_CRTIMP int __cdecl __MINGW_NOTHROW _wstat (const wchar_t*, struct _stat*); -_CRTIMP int __cdecl __MINGW_NOTHROW _wstati64 (const wchar_t*, struct _stati64*); -#if __MSVCRT_VERSION__ >= 0x0601 -_CRTIMP int __cdecl __MINGW_NOTHROW _wstat64 (const wchar_t*, struct __stat64*); -#endif /* __MSVCRT_VERSION__ >= 0x0601 */ -#endif /* __MSVCRT__ */ -#define _WSTAT_DEFINED -#endif /* ! _WSTAT_DEFIND */ - -#ifndef _WLOCALE_DEFINED /* also declared in locale.h */ -_CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wsetlocale (int, const wchar_t*); -#define _WLOCALE_DEFINED -#endif - -#ifndef _WPROCESS_DEFINED /* also declared in process.h */ -#include <stdint.h> /* For intptr_t. */ -_CRTIMP intptr_t __cdecl __MINGW_NOTHROW _wexecl (const wchar_t*, const wchar_t*, ...); -_CRTIMP intptr_t __cdecl __MINGW_NOTHROW _wexecle (const wchar_t*, const wchar_t*, ...); -_CRTIMP intptr_t __cdecl __MINGW_NOTHROW _wexeclp (const wchar_t*, const wchar_t*, ...); -_CRTIMP intptr_t __cdecl __MINGW_NOTHROW _wexeclpe (const wchar_t*, const wchar_t*, ...); -_CRTIMP intptr_t __cdecl __MINGW_NOTHROW _wexecv (const wchar_t*, const wchar_t* const*); -_CRTIMP intptr_t __cdecl __MINGW_NOTHROW _wexecve (const wchar_t*, const wchar_t* const*, const wchar_t* const*); -_CRTIMP intptr_t __cdecl __MINGW_NOTHROW _wexecvp (const wchar_t*, const wchar_t* const*); -_CRTIMP intptr_t __cdecl __MINGW_NOTHROW _wexecvpe (const wchar_t*, const wchar_t* const*, const wchar_t* const*); - -_CRTIMP intptr_t __cdecl __MINGW_NOTHROW _wspawnl (int, const wchar_t*, const wchar_t*, ...); -_CRTIMP intptr_t __cdecl __MINGW_NOTHROW _wspawnle (int, const wchar_t*, const wchar_t*, ...); -_CRTIMP intptr_t __cdecl __MINGW_NOTHROW _wspawnlp (int, const wchar_t*, const wchar_t*, ...); -_CRTIMP intptr_t __cdecl __MINGW_NOTHROW _wspawnlpe (int, const wchar_t*, const wchar_t*, ...); -_CRTIMP intptr_t __cdecl __MINGW_NOTHROW _wspawnv (int, const wchar_t*, const wchar_t* const*); -_CRTIMP intptr_t __cdecl __MINGW_NOTHROW _wspawnve (int, const wchar_t*, const wchar_t* const*, const wchar_t* const*); -_CRTIMP intptr_t __cdecl __MINGW_NOTHROW _wspawnvp (int, const wchar_t*, const wchar_t* const*); -_CRTIMP intptr_t __cdecl __MINGW_NOTHROW _wspawnvpe (int, const wchar_t*, const wchar_t* const*, const wchar_t* const*); - -#define _WPROCESS_DEFINED -#endif -#endif /* not __STRICT_ANSI__ */ - -#ifdef __cplusplus -} /* end of extern "C" */ -#endif - -#endif /* Not RC_INVOKED */ - -#endif /* not _WCHAR_H_ */ - diff --git a/winsup/mingw/include/wctype.h b/winsup/mingw/include/wctype.h deleted file mode 100644 index 126603454..000000000 --- a/winsup/mingw/include/wctype.h +++ /dev/null @@ -1,168 +0,0 @@ -/* - * wctype.h - * - * Functions for testing wide character types and converting characters. - * - * This file is part of the Mingw32 package. - * - * Contributors: - * Created by Mumit Khan <khan@xraylith.wisc.edu> - * - * THIS SOFTWARE IS NOT COPYRIGHTED - * - * This source code is offered for use in the public domain. You may - * use, modify or distribute it freely. - * - * This code is distributed in the hope that it will be useful but - * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY - * DISCLAIMED. This includes but is not limited to warranties of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - */ - -#ifndef _WCTYPE_H_ -#define _WCTYPE_H_ - -/* All the headers include this file. */ -#include <_mingw.h> - -#define __need_wchar_t -#define __need_wint_t -#ifndef RC_INVOKED -#include <stddef.h> -#endif /* Not RC_INVOKED */ - -/* - * The following flags are used to tell iswctype and _isctype what character - * types you are looking for. - */ -#define _UPPER 0x0001 -#define _LOWER 0x0002 -#define _DIGIT 0x0004 -#define _SPACE 0x0008 -#define _PUNCT 0x0010 -#define _CONTROL 0x0020 -#define _BLANK 0x0040 -#define _HEX 0x0080 -#define _LEADBYTE 0x8000 - -#define _ALPHA 0x0103 - -#ifndef RC_INVOKED - -#ifdef __cplusplus -extern "C" { -#endif - -#ifndef WEOF -#define WEOF (wchar_t)(0xFFFF) -#endif - -#ifndef _WCTYPE_T_DEFINED -typedef wchar_t wctype_t; -#define _WCTYPE_T_DEFINED -#endif - -/* Wide character equivalents - also in ctype.h */ -_CRTIMP int __cdecl __MINGW_NOTHROW iswalnum(wint_t); -_CRTIMP int __cdecl __MINGW_NOTHROW iswalpha(wint_t); -_CRTIMP int __cdecl __MINGW_NOTHROW iswascii(wint_t); -_CRTIMP int __cdecl __MINGW_NOTHROW iswcntrl(wint_t); -_CRTIMP int __cdecl __MINGW_NOTHROW iswctype(wint_t, wctype_t); -_CRTIMP int __cdecl __MINGW_NOTHROW is_wctype(wint_t, wctype_t); /* Obsolete! */ -_CRTIMP int __cdecl __MINGW_NOTHROW iswdigit(wint_t); -_CRTIMP int __cdecl __MINGW_NOTHROW iswgraph(wint_t); -_CRTIMP int __cdecl __MINGW_NOTHROW iswlower(wint_t); -_CRTIMP int __cdecl __MINGW_NOTHROW iswprint(wint_t); -_CRTIMP int __cdecl __MINGW_NOTHROW iswpunct(wint_t); -_CRTIMP int __cdecl __MINGW_NOTHROW iswspace(wint_t); -_CRTIMP int __cdecl __MINGW_NOTHROW iswupper(wint_t); -_CRTIMP int __cdecl __MINGW_NOTHROW iswxdigit(wint_t); - -#if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) \ - || !defined __STRICT_ANSI__ || defined __cplusplus -int __cdecl __MINGW_NOTHROW iswblank (wint_t); -#endif - -/* Older MS docs uses wchar_t for arg and return type, while newer - online MS docs say arg is wint_t and return is int. - ISO C uses wint_t for both. */ -_CRTIMP wint_t __cdecl __MINGW_NOTHROW towlower (wint_t); -_CRTIMP wint_t __cdecl __MINGW_NOTHROW towupper (wint_t); - -_CRTIMP int __cdecl __MINGW_NOTHROW isleadbyte (int); - -/* Also in ctype.h */ - -#ifdef __DECLSPEC_SUPPORTED -# if __MSVCRT_VERSION__ <= 0x0700 - __MINGW_IMPORT unsigned short _ctype[]; -# endif -# ifdef __MSVCRT__ - __MINGW_IMPORT unsigned short* _pctype; -# else /* CRTDLL */ - __MINGW_IMPORT unsigned short* _pctype_dll; -# define _pctype _pctype_dll -# endif - -#else /* ! __DECLSPEC_SUPPORTED */ -# if __MSVCRT_VERSION__ <= 0x0700 - extern unsigned short** _imp___ctype; -# define _ctype (*_imp___ctype) -# endif -# ifdef __MSVCRT__ - extern unsigned short** _imp___pctype; -# define _pctype (*_imp___pctype) -# else /* CRTDLL */ - extern unsigned short** _imp___pctype_dll; -# define _pctype (*_imp___pctype_dll) -# endif /* CRTDLL */ -#endif /* __DECLSPEC_SUPPORTED */ - - -#if !(defined (__NO_INLINE__) || defined(__NO_CTYPE_INLINES) \ - || defined(__WCTYPE_INLINES_DEFINED)) -#define __WCTYPE_INLINES_DEFINED -__CRT_INLINE int __cdecl __MINGW_NOTHROW iswalnum(wint_t wc) {return (iswctype(wc,_ALPHA|_DIGIT));} -__CRT_INLINE int __cdecl __MINGW_NOTHROW iswalpha(wint_t wc) {return (iswctype(wc,_ALPHA));} -__CRT_INLINE int __cdecl __MINGW_NOTHROW iswascii(wint_t wc) {return ((wc & ~0x7F) ==0);} -__CRT_INLINE int __cdecl __MINGW_NOTHROW iswcntrl(wint_t wc) {return (iswctype(wc,_CONTROL));} -__CRT_INLINE int __cdecl __MINGW_NOTHROW iswdigit(wint_t wc) {return (iswctype(wc,_DIGIT));} -__CRT_INLINE int __cdecl __MINGW_NOTHROW iswgraph(wint_t wc) {return (iswctype(wc,_PUNCT|_ALPHA|_DIGIT));} -__CRT_INLINE int __cdecl __MINGW_NOTHROW iswlower(wint_t wc) {return (iswctype(wc,_LOWER));} -__CRT_INLINE int __cdecl __MINGW_NOTHROW iswprint(wint_t wc) {return (iswctype(wc,_BLANK|_PUNCT|_ALPHA|_DIGIT));} -__CRT_INLINE int __cdecl __MINGW_NOTHROW iswpunct(wint_t wc) {return (iswctype(wc,_PUNCT));} -__CRT_INLINE int __cdecl __MINGW_NOTHROW iswspace(wint_t wc) {return (iswctype(wc,_SPACE));} -__CRT_INLINE int __cdecl __MINGW_NOTHROW iswupper(wint_t wc) {return (iswctype(wc,_UPPER));} -__CRT_INLINE int __cdecl __MINGW_NOTHROW iswxdigit(wint_t wc) {return (iswctype(wc,_HEX));} -__CRT_INLINE int __cdecl __MINGW_NOTHROW isleadbyte(int c) {return (_pctype[(unsigned char)(c)] & _LEADBYTE);} - -#if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) \ - || !defined __STRICT_ANSI__ || defined __cplusplus -__CRT_INLINE int __cdecl __MINGW_NOTHROW iswblank (wint_t wc) - {return (iswctype(wc, _BLANK) || wc == L'\t');} -#endif - -#endif /* !(defined(__NO_CTYPE_INLINES) || defined(__WCTYPE_INLINES_DEFINED)) */ - -typedef wchar_t wctrans_t; - -/* These are resolved by libmingwex.a. Note, that they are also exported - by the MS C++ runtime lib (msvcp60.dll). The msvcp60.dll implementations - of wctrans and towctrans are not C99 compliant in that wctrans("tolower") - returns 0, while std specifies that a non-zero value should be returned - for a valid string descriptor. If you want the MS behaviour (and you have - msvcp60.dll in your path) add -lmsvcp60 to your command line. */ - -wint_t __cdecl __MINGW_NOTHROW towctrans(wint_t, wctrans_t); -wctrans_t __cdecl __MINGW_NOTHROW wctrans(const char*); -wctype_t __cdecl __MINGW_NOTHROW wctype(const char*); - -#ifdef __cplusplus -} -#endif - -#endif /* Not RC_INVOKED */ - -#endif /* Not _WCTYPE_H_ */ - diff --git a/winsup/mingw/init.c b/winsup/mingw/init.c deleted file mode 100644 index a30c035f2..000000000 --- a/winsup/mingw/init.c +++ /dev/null @@ -1,67 +0,0 @@ -/* - * init.c - * This file has no copyright assigned and is placed in the Public Domain. - * This file is a part of the mingw-runtime package. - * No warranty is given; refer to the file DISCLAIMER within the package. - * - * Code to initialize standard file handles and command line arguments. - * This file is #included in both crt1.c and dllcrt1.c. - * - */ - -/* - * Access to a standard 'main'-like argument count and list. Also included - * is a table of environment variables. - */ -int _argc = 0; -char **_argv = 0; - -/* NOTE: Thanks to Pedro A. Aranda Gutiirrez <paag@tid.es> for pointing - * this out to me. GetMainArgs (used below) takes a fourth argument - * which is an int that controls the globbing of the command line. If - * _CRT_glob is non-zero the command line will be globbed (e.g. *.* - * expanded to be all files in the startup directory). In the mingw32 - * library a _CRT_glob variable is defined as being -1, enabling - * this command line globbing by default. To turn it off and do all - * command line processing yourself (and possibly escape bogons in - * MS's globbing code) include a line in one of your source modules - * defining _CRT_glob and setting it to zero, like this: - * int _CRT_glob = 0; - */ -extern int _CRT_glob; - -#ifdef __MSVCRT__ -typedef struct { - int newmode; -} _startupinfo; -extern void __getmainargs (int *, char ***, char ***, int, _startupinfo *); -#else -extern void __GetMainArgs (int *, char ***, char ***, int); -#endif - -/* - * Initialize the _argc, _argv and environ variables. - */ -static void -_mingw32_init_mainargs () -{ - /* The environ variable is provided directly in stdlib.h through - * a dll function call. */ - char **dummy_environ; -#ifdef __MSVCRT__ - _startupinfo start_info; - start_info.newmode = 0; -#endif - - /* - * Microsoft's runtime provides a function for doing just that. - */ -#ifdef __MSVCRT__ - (void) __getmainargs (&_argc, &_argv, &dummy_environ, _CRT_glob, - &start_info); -#else - /* CRTDLL version */ - (void) __GetMainArgs (&_argc, &_argv, &dummy_environ, _CRT_glob); -#endif -} - diff --git a/winsup/mingw/install-sh b/winsup/mingw/install-sh deleted file mode 100755 index 9344e52bc..000000000 --- a/winsup/mingw/install-sh +++ /dev/null @@ -1,253 +0,0 @@ -#!/bin/sh -# -# install - install a program, script, or datafile -# This comes from X11R5 (mit/util/scripts/install.sh). -# -# Copyright 1991 by the Massachusetts Institute of Technology -# -# Permission to use, copy, modify, distribute, and sell this software and its -# documentation for any purpose is hereby granted without fee, provided that -# the above copyright notice appear in all copies and that both that -# copyright notice and this permission notice appear in supporting -# documentation, and that the name of M.I.T. not be used in advertising or -# publicity pertaining to distribution of the software without specific, -# written prior permission. M.I.T. makes no representations about the -# suitability of this software for any purpose. It is provided "as is" -# without express or implied warranty. -# -# Calling this script install-sh is preferred over install.sh, to prevent -# `make' implicit rules from creating a file called install from it -# when there is no Makefile. -# -# This script is compatible with the BSD install script, but was written -# from scratch. It can only install one file at a time, a restriction -# shared with many OS's install programs. - - -# set DOITPROG to echo to test this script - -# Don't use :- since 4.3BSD and earlier shells don't like it. -doit="${DOITPROG-}" - - -# put in absolute paths if you don't have them in your path; or use env. vars. - -mvprog="${MVPROG-mv}" -cpprog="${CPPROG-cp}" -chmodprog="${CHMODPROG-chmod}" -chownprog="${CHOWNPROG-chown}" -chgrpprog="${CHGRPPROG-chgrp}" -stripprog="${STRIPPROG-strip}" -rmprog="${RMPROG-rm}" -mkdirprog="${MKDIRPROG-mkdir}" - -transformbasename="" -transform_arg="" -instcmd="$mvprog" -chmodcmd="$chmodprog 0755" -chowncmd="" -chgrpcmd="" -stripcmd="" -rmcmd="$rmprog -f" -mvcmd="$mvprog" -src="" -dst="" -dir_arg="" - -while [ x"$1" != x ]; do - case $1 in - -c) instcmd="$cpprog" - shift - continue;; - - -d) dir_arg=true - shift - continue;; - - -m) chmodcmd="$chmodprog $2" - shift - shift - continue;; - - -o) chowncmd="$chownprog $2" - shift - shift - continue;; - - -g) chgrpcmd="$chgrpprog $2" - shift - shift - continue;; - - -s) stripcmd="$stripprog" - shift - continue;; - - -t=*) transformarg=`echo $1 | sed 's/-t=//'` - shift - continue;; - - -b=*) transformbasename=`echo $1 | sed 's/-b=//'` - shift - continue;; - - *) if [ x"$src" = x ] - then - src=$1 - else - # this colon is to work around a 386BSD /bin/sh bug - : - dst=$1 - fi - shift - continue;; - esac -done - -if [ x"$src" = x ] -then - echo "install: no input file specified" - exit 1 -else - true -fi - -if [ x"$dir_arg" != x ]; then - dst=$src - src="" - - if [ -d $dst ]; then - instcmd=: - chmodcmd="" - else - instcmd=mkdir - fi -else - -# Waiting for this to be detected by the "$instcmd $src $dsttmp" command -# might cause directories to be created, which would be especially bad -# if $src (and thus $dsttmp) contains '*'. - - if [ -f $src -o -d $src ] - then - true - else - echo "install: $src does not exist" - exit 1 - fi - - if [ x"$dst" = x ] - then - echo "install: no destination specified" - exit 1 - else - true - fi - -# If destination is a directory, append the input filename; if your system -# does not like double slashes in filenames, you may need to add some logic - - if [ -d $dst ] - then - dst="$dst"/`basename $src` - else - true - fi -fi - -## this sed command emulates the dirname command -dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` - -# Make sure that the destination directory exists. -# this part is taken from Noah Friedman's mkinstalldirs script - -# Skip lots of stat calls in the usual case. -if [ ! -d "$dstdir" ]; then -defaultIFS=' -' -IFS="${IFS-${defaultIFS}}" - -oIFS="${IFS}" -# Some sh's can't handle IFS=/ for some reason. -IFS='%' -set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` -IFS="${oIFS}" - -pathcomp='' - -while [ $# -ne 0 ] ; do - pathcomp="${pathcomp}${1}" - shift - - if [ ! -d "${pathcomp}" ] ; - then - $mkdirprog "${pathcomp}" - else - true - fi - - pathcomp="${pathcomp}/" -done -fi - -if [ x"$dir_arg" != x ] -then - $doit $instcmd $dst && - - if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi && - if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi && - if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi && - if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi -else - -# If we're going to rename the final executable, determine the name now. - - if [ x"$transformarg" = x ] - then - dstfile=`basename $dst` - else - dstfile=`basename $dst $transformbasename | - sed $transformarg`$transformbasename - fi - -# don't allow the sed command to completely eliminate the filename - - if [ x"$dstfile" = x ] - then - dstfile=`basename $dst` - else - true - fi - -# Make a temp file name in the proper directory. - - dsttmp=$dstdir/#inst.$$# - -# Move or copy the file name to the temp name - - $doit $instcmd $src $dsttmp && - - trap "rm -f ${dsttmp}" 0 && - -# and set any options; do chmod last to preserve setuid bits - -# If any of these fail, we abort the whole thing. If we want to -# ignore errors from any of these, just make sure not to ignore -# errors from the above "$doit $instcmd $src $dsttmp" command. - - if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi && - if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi && - if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi && - if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi && - -# Now rename the file to the real destination. - - $doit $rmcmd -f $dstdir/$dstfile - ([ -f $dstdir/$dstfile ] && - $doit $mvcmd $dstdir/$dstfile $dstdir/$dstfile.$$ ); - exec $doit $mvcmd $dsttmp $dstdir/$dstfile - -fi && - - -exit 0 diff --git a/winsup/mingw/isascii.c b/winsup/mingw/isascii.c deleted file mode 100644 index 9d3385c3f..000000000 --- a/winsup/mingw/isascii.c +++ /dev/null @@ -1,21 +0,0 @@ -/* - * isascii.c - * This file has no copyright assigned and is placed in the Public Domain. - * This file is a part of the mingw-runtime package. - * No warranty is given; refer to the file DISCLAIMER within the package. - * - * Oldnames from ANSI header ctype.h - * - * Some wrapper functions for those old name functions whose appropriate - * equivalents are not simply underscore prefixed. - * - */ - -#include <ctype.h> - -int -isascii (int c) -{ - return __isascii(c); -} - diff --git a/winsup/mingw/iscsym.c b/winsup/mingw/iscsym.c deleted file mode 100644 index ea9a571ac..000000000 --- a/winsup/mingw/iscsym.c +++ /dev/null @@ -1,20 +0,0 @@ -/* - * iscsym.c - * This file has no copyright assigned and is placed in the Public Domain. - * This file is a part of the mingw-runtime package. - * No warranty is given; refer to the file DISCLAIMER within the package. - * - * Oldnames from ANSI header ctype.h - * - * Some wrapper functions for those old name functions whose appropriate - * equivalents are not simply underscore prefixed. - * - */ - -#include <ctype.h> - -int -iscsym (int c) -{ - return __iscsym(c); -} diff --git a/winsup/mingw/iscsymf.c b/winsup/mingw/iscsymf.c deleted file mode 100644 index 6afde993e..000000000 --- a/winsup/mingw/iscsymf.c +++ /dev/null @@ -1,21 +0,0 @@ -/* - * iscsymf.c - * This file has no copyright assigned and is placed in the Public Domain. - * This file is a part of the mingw-runtime package. - * No warranty is given; refer to the file DISCLAIMER within the package. - * - * Oldnames from ANSI header ctype.h - * - * Some wrapper functions for those old name functions whose appropriate - * equivalents are not simply underscore prefixed. - * - */ - -#include <ctype.h> - -int -iscsymf (int c) -{ - return __iscsymf(c); -} - diff --git a/winsup/mingw/jamfile b/winsup/mingw/jamfile deleted file mode 100644 index 85f0b2b2a..000000000 --- a/winsup/mingw/jamfile +++ /dev/null @@ -1,71 +0,0 @@ -# -# Jamfile for building various libraries and object files for the -# Minimalist GNU-Win32 package. -#* This file has no copyright assigned and is placed in the Public Domain. -#* This file is a part of the mingw-runtime package. -#* No warranty is given; refer to the file DISCLAIMER within the package. -# - -# Change this line if you have installed Mingw32 in another directory. -# -LOCATE_TARGET = /mingw32/lib ; - -RUNTIME default = crtdll ; - -# Build the mingw32 library which contains startup code and extra support -# routines. -# -Library libmingw32.a : - CRTglob.c - CRTfmode.c - CRTinit.c - dirent.c - dllmain.c - gccmain.c - main.c - ; - - -# Build the startup object files for normal applications and for DLLs. -# The crt2 and dllcrt2 versions are for MSVCRTxx.DLL runtimes. crt1 and -# dllcrt1 are for the CRTDLL.DLL runtime. -# -Object crt1.o : crt1.c ; -Object crt2.o : crt1.c ; - -CCFLAGS on crt2.o += -D__MSVCRT__ ; - -Object dllcrt1.o : dllcrt1.c ; -Object dllcrt2.o : dllcrt1.c ; - -CCFLAGS on dllcrt2.o += -D__MSVCRT__ ; - -DEPENDS all : crt1.o dllcrt1.o crt2.o dllcrt2.o ; - - -# Build an object file which contains a single global variable initialized -# so that globbing will not be performed on the command line. -# -Object CRT_noglob.o : CRT_noglob.c ; -LOCATE on CRT_noglob.o = $(LOCATE_TARGET) ; - -DEPENDS all : CRT_noglob.o ; - - -# Build a special import library which contains mostly the imports defined -# in moldname.def, but with their leading underscores stripped off, plus the -# extra code in the C modules included. -# -ImportLib libmoldname.a : moldname.def ctype_old.c string_old.c ; - -DLLNAME on libmoldname.a = $(RUNTIME).dll ; -DLLTOOLFLAGS on libmoldname.a += -U ; - - -# Build import libraries for the various runtimes. -# -ImportLib libcrtdll.a : crtdll.def ; -ImportLib libmsvcrt.a : msvcrt.def ; -ImportLib libmsvcrt20.a : msvcrt20.def ; -ImportLib libmsvcrt40.a : msvcrt40.def ; - diff --git a/winsup/mingw/main.c b/winsup/mingw/main.c deleted file mode 100644 index 2eec16bd1..000000000 --- a/winsup/mingw/main.c +++ /dev/null @@ -1,79 +0,0 @@ -/* - * main.c - * This file has no copyright assigned and is placed in the Public Domain. - * This file is a part of the mingw-runtime package. - * No warranty is given; refer to the file DISCLAIMER within the package. - * - * Extra startup code for applications which do not have a main function - * of their own (but do have a WinMain). Generally these are GUI - * applications, but they don't *have* to be. - * - */ - -#include <stdlib.h> -#include <process.h> -#include <windows.h> - -#define ISSPACE(a) (a == ' ' || a == '\t') - -extern int PASCAL WinMain (HINSTANCE hInst, HINSTANCE hPrevInst, - LPSTR szCmdLine, int nShow); - -int -main (int argc, char *argv[], char *environ[]) -{ - char *szCmd; - STARTUPINFO startinfo; - int nRet; - - /* Get the command line passed to the process. */ - szCmd = GetCommandLineA (); - GetStartupInfoA (&startinfo); - - /* Strip off the name of the application and any leading - * whitespace. */ - if (szCmd) - { - while (ISSPACE (*szCmd)) - { - szCmd++; - } - - /* On my system I always get the app name enclosed - * in quotes... */ - if (*szCmd == '\"') - { - do - { - szCmd++; - } - while (*szCmd != '\"' && *szCmd != '\0'); - - if (*szCmd == '\"') - { - szCmd++; - } - } - else - { - /* If no quotes then assume first token is program - * name. */ - while (!ISSPACE (*szCmd) && *szCmd != '\0') - { - szCmd++; - } - } - - while (ISSPACE (*szCmd)) - { - szCmd++; - } - } - - nRet = WinMain (GetModuleHandle (NULL), NULL, szCmd, - (startinfo.dwFlags & STARTF_USESHOWWINDOW) ? - startinfo.wShowWindow : SW_SHOWDEFAULT); - - return nRet; -} - diff --git a/winsup/mingw/man/dirname.man b/winsup/mingw/man/dirname.man deleted file mode 100755 index 82e1a9acc..000000000 --- a/winsup/mingw/man/dirname.man +++ /dev/null @@ -1,474 +0,0 @@ -.\" t -.TH DIRNAME 3 04-Jan-2007 MinGW "Programmer's Reference Manual" -. -.SH NAME -. -.BR dirname ,\0 basename -\- parse path name components -. -. -.SH SYNOPSIS -. -.B #include -.RB < libgen.h > -.PP -.B char *dirname( char -.BI * path -.B ); -.br -.B char *basename( char -.BI * path -.B ); -. -. -.SH DESCRIPTION -. -The -.B dirname -and -.B basename -functions parse a null\-terminated path name string, -and split it into its -.B directory name -and -.B file name -components. -Splitting is performed on the basis of the location of the -.B directory separator -characters, -which, -for this MS\-Windows(\(tm) implementation, -are the characters -.RB \(dq / \(dq -and -.RB \(dq \e \(dq, -each of which is interpreted as being equivalent. -Additionally, -if the -.I second -character of -.I path -is a colon -.RB (\(dq : \(dq), -the first two characters of -.I path -are interpreted as an MS\-Windows(\(tm) drive designator, -which will be included in the -.B directory name -component of -.IR path , -but is never considered to form part of the -.B file name -component. -. -.PP -In normal usage, -.B dirname -returns a pointer to a string representing the path name component of -.IR path , -up to but not including the rightmost directory separator, -while -.B basename -returns a pointer to the component following this separator. -Any trailing directory separators present in -.I path -are disregarded, -when determining the rightmost separator, -and, in the case of the return value from -.BR dirname , -any internal sequences of recurring separator characters -are each reduced to a single such character. -. -.PP -If -.I path -contains no MS\-Windows(\(tm) drive designator, -and no directory separator character, -then -.B dirname -returns the string -.RB \(dq . \(dq, -and -.B basename -returns a copy of -.IR path. -If -.I path -does commence with an MS\-Windows(\(tm) drive designator, -but contains no directory separators, -then -.B dirname -returns the string -.RB \(dq d:. \(dq, -where -.RB \(dq d: \(dq -represents the drive designator, -while -.B basename -returns a copy of -.IR path , -with its initial two characters, -(i.e.\ the drive designator), -deleted. -. -.PP -If -.I path -is a NULL pointer, -or is a pointer to an empty string, -then both -.B dirname -and -.B basename -return the string -.RB \(dq . \(dq. -. -.PP -If -.I path -is the string -.RB \(dq / \(dq, -or the string -.RB \(dq \e \(dq, -both -.B dirname -and -.B basename -return the string -.RB \(dq / \(dq, -or the string -.RB \(dq \e \(dq, -respectively. -. -.PP -If -.I path -commences with -.I exactly -two directory separator characters, -which must be similar, -then -.B dirname -will preserve these two characters in the returned path name. -This construct does not affect the string returned by -.BR basename , -neither is this behaviour replicated by -.BR dirname , -if -.I path -includes an MS\-Windows(\(tm) drive designator. -. -.PP -In the special case, -where -.I path -is specified as -.I exactly -two identical directory separator characters, -with no MS\-Windows(\(tm) drive designator, -and no following path name, -.B dirname -returns -.I path -unchanged; -.B basename -normalises the return string to only a single character, -either -.RB \(dq / \(dq -or -.RB \(dq \e \(dq, -matching the characters used to specify -.IR path . -. -.PP -Concatenating the string returned by -.BR dirname , -a -.RB \(dq / \(dq -or a -.RB \(dq \e \(dq, -and the string returned by -.B basename -yields a complete path name. -. -.PP -The -.B dirname -and -.B basename -functions conform generally to SUSv3, -extended to accommodate the handling of -.RB \(dq / \(dq -and -.RB \(dq \e \(dq -as alternative directory separator characters, -and also to accommodate the likelihood of MS\-Windows(\(tm) -drive designators appearing in any path name specification. -The example, -which follows, -illustrates the conformance to SUSv3, -and also the effects of the extended behaviour. -. -. -.SH EXAMPLE -. -To verify the behaviour of the -.B dirname -and -.B basename -functions, -the test program defines the following function:\(em -. -.PP -.RS -.nf -#include <stdio.h> -#include <string.h> -#include <libgen.h> - -void result( char *path ) -{ - char *dir = strdup( path ); - char *file = strdup( path ); - - printf( " %-15s%-15s%-12s", path, dirname( dir ), - basename( file ) ); - - free( dir ); - free( file ); -} -.fi -.RE -.PP -This illustrates the correct use of the -.B dirname -and the -.B basename -functions, -with copies of the original -.I path -string being passed in the function calls. -Note that the return values from each function are used immediately, -in the -.B printf -call, -and the temporary copies of -.I path -are discarded, -and the associated memory is freed, -before these go out of scope. -. -.PP -Calling this example function illustrates the effect of each of the -.B dirname -and -.B basename -functions, -for various values of -.IR path . -The following, -taken from SUSv3, -illustrate general conformance with the standard:\(em -.RS -.TS -tab(!); -lB lB lB -lw(15n) lw(10n) lw(10n). -\0path!\0dirname!\0basename -\_!\_!\_ -\0/usr/lib!\0/usr!\0lib -\0//usr//lib//!\0//usr!\0lib -\0///usr//lib//!\0/usr!\0lib -\0/usr/!\0/!\0usr -\0usr!\0.!\0usr -\0//!\0//!\0/ -\0/!\0/!\0/ -\0.!\0.!\0. -\0..!\0.!\0.. -.TE -.RE -. -.PP -Similarly, -for the case where path names are expressed using the MS\-Windows(\(tm) -.RB \(dq \e \(dq -directory separator notation, -calling the example function displays:\(em -.RS -.TS -tab(!); -lB lB lB -lw(15n) lw(10n) lw(10n). -\0path!\0dirname!\0basename -\_!\_!\_ -\0\eusr\elib!\0\eusr!\0lib -\0\e\eusr\e\elib\e\e!\0\e\eusr!\0lib -\0\e\e\eusr\e\elib\e\e!\0\eusr!\0lib -\0\eusr\e!\0\e!\0usr -\0usr!\0.!\0usr -\0\e\e!\0\e\e!\0\e -\0\e!\0\e!\0\e -\0.!\0.!\0. -\0..!\0.!\0.. -.TE -.RE -. -.PP -and, -when an MS\-Windows(\(tm) drive designator is also specified, -this becomes:\(em -.RS -.TS -tab(!); -lB lB lB -lw(15n) lw(10n) lw(10n). -\0path!\0dirname!\0basename -\_!\_!\_ -\0d:\eusr\elib!\0d:\eusr!\0lib -\0d:\e\eusr\e\elib\e\e!\0d:\eusr!\0lib -\0d:\e\e\eusr\e\elib\e\e!\0d:\eusr!\0lib -\0d:\eusr\e!\0d:\e!\0usr -\0d:usr!\0d:.!\0usr -\0d:\e\e!\0d:\e!\0\e -\0d:\e!\0d:\e!\0\e -\0d:.!\0d:.!\0. -\0d:..!\0d:.!\0.. -.TE -.RE -. -.PP -Please note, -in particular, -the special handling of path names which begin with -.I exactly -two directory separator characters, -and also that this special handling is suppressed -when these two characters are dissimilar, -or when an MS\-Windows(\(tm) drive designator is specified:\(em -.RS -.TS -tab(!); -lB lB lB -lw(15n) lw(10n) lw(10n). -\0path!\0dirname!\0basename -\_!\_!\_ -\0//usr//lib//!\0//usr!\0lib -\0\e\eusr\e\elib\e\e!\0\e\eusr!\0lib -\0/\eusr\e\elib\e\e!\0/usr!\0lib -\0\e/usr\e\elib\e\e!\0\eusr!\0lib -\0d:\e\eusr\e\elib\e\e!\0d:\eusr!\0lib -\0//!\0//!\0/ -\0\e\e!\0\e\e!\0\e -\0/\e!\0/!\0/ -\0\e/!\0\e!\0\e -\0d:\e\e!\0d:\e!\0\e -.TE -.RE -. -. -.SH RETURN VALUE -. -The -.B dirname -function returns a pointer to a null terminated string, -which represents the directory path component of the passed -.I path -string, -without any trailing directory separator character, -and with all internal sequences of directory separator characters -normalised to a single separator at each level of directory nesting. -. -.PP -The -.B basename -function -returns a pointer to a null terminated string, -which represents the rightmost element of the passed -.I path -string, -with all trailing directory separator characters removed. -. -.PP -If any MS\-Windows(\(tm) drive designator is specified in the input -.I path -string, -it is included in the return value of the -.B dirname -function, -but not in that of the -.B basename -function. -. -. -.SH ERROR RETURNS -. -None. -. -. -.SH CAVEATS AND BUGS -. -The -.B dirname -and -.B basename -functions may modify the -.I path -string passed to them. -Therefore, it is an error to pass a character constant as the -.I path -parameter; -to do so may result in memory violation errors, -(segmentation faults), -and consequent abnormal program termination. -.PP -Also note that, -since the -.I path -argument may be modified by the -.B dirname -or the -.B basename -function call, -if you wish to preserve the original content of -.IR path , -you should pass a copy to the function. -Furthermore, -either function may return its result in a statically allocated buffer, -which may be overwritten on a subsequent function call. -.PP -Although the -.B dirname -and -.B basename -functions parse path name strings, -they are basically just -.I string -functions. -The presence of an MS\-Windows(\(tm) drive designator is determined -by the appearance of a colon -.RB (\(dq : \(dq) -as the second character of the -.I path -string, -but neither function performs any check -to ensure that the first character represents a valid file system device; -neither is any form of validation performed, -to ensure that the remainder of the string -represents a valid path name. -. -. -.SH AUTHOR -. -This manpage was written for the MinGW implementation of the -.B dirname -and -.B basename -functions by Keith\ Marshall, -<keithmarshall@users.sourceforge.net>. -It may copied, modified and redistributed, -without restriction of copyright, -provided this acknowledgement of contribution by -the original author remains unchanged. -. -. -.\" EOF diff --git a/winsup/mingw/mingwex/Makefile.in b/winsup/mingw/mingwex/Makefile.in deleted file mode 100644 index bf11bc688..000000000 --- a/winsup/mingw/mingwex/Makefile.in +++ /dev/null @@ -1,318 +0,0 @@ -# -# mingw/mingwex/Makefile.in: This file is part of Mingw runtime. -# -# This makefile requires GNU make. - -srcdir = @srcdir@ -VPATH = $(srcdir):$(srcdir)/math:$(srcdir)/stdio:$(srcdir)/complex $(srcdir)/gdtoa -objdir = . - -target_alias = @target_alias@ -prefix = @prefix@ - -program_transform_name = @program_transform_name@ -exec_prefix = @exec_prefix@ -bindir = @bindir@ -libdir = @libdir@ -tooldir = $(exec_prefix)/$(target_alias) -datadir = @datadir@ -infodir = @infodir@ -includedir = @includedir@ - -SHELL = /bin/sh - -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -mkinstalldirs = $(SHELL) $(srcdir)/../mkinstalldirs - -DISTFILES = \ - Makefile.in configure configure.in aclocal.m4 \ - _Exit.c atoll.c dirent.c feclearexcept.c fegetenv.c \ - fegetexceptflag.c fegetround.c feholdexcept.c feraiseexcept.c \ - fesetenv.c fesetexceptflag.c fesetround.c fetestexcept.c \ - feupdateenv.c ftruncate.c fwide.c getopt.c imaxabs.c imaxdiv.c \ - lltoa.c lltow.c mbsinit.c mingw-aligned-malloc.c \ - mingw-fseek.c sitest.c strtoimax.c strtoumax.c \ - testwmem.c tst-aligned-malloc.c ulltoa.c ulltow.c wcstof.c \ - wcstoimax.c wcstold.c wcstoumax.c wctrans.c wctype.c \ - wdirent.c wmemchr.c wmemcmp.c wmemcpy.c wmemmove.c wmemset.c wtoll.c \ - wcrtomb.c wctob.c mbrtowc.c btowc.c mb_wc_common.h \ - gettimeofday.c isblank.c iswblank.c \ - basename.c dirname.c usleep.c \ - tsearch.c twalk.c tdelete.c tfind.c - -MATH_DISTFILES = \ - acosf.c acosl.c asinf.c asinl.c atan2f.c atan2l.c \ - atanf.c atanl.c cbrt.c cbrtf.c cbrtl.c ceilf.S ceill.S \ - cephes_mconf.h \ - copysign.S copysignf.S copysignl.S cosf.S coshf.c coshl.c cosl.S \ - erfl.c exp2.S exp2f.S exp2l.S expf.c expl.c expm1.c expm1l.c expm1f.c \ - fabs.c fabsf.c fabsl.c \ - fdim.c fdimf.c fdiml.c floorf.S floorl.S fma.S fmaf.S fmal.c \ - fmax.c fmaxf.c fmaxl.c fmin.c fminf.c fminl.c fmodf.c \ - fmodl.c fp_consts.c fp_consts.h fp_constsf.c fp_constsl.c \ - fpclassify.c fpclassifyf.c fpclassifyl.c \ - frexpf.c frexpl.S fucom.c hypotf.c hypotl.c ilogb.S ilogbf.S \ - ilogbl.S isnan.c isnanf.c isnanl.c ldexpf.c ldexpl.c \ - lgamma.c lgammaf.c lgammal.c llrint.c llrintf.c llrintl.c \ - log10f.S log10l.S log1p.S log1pf.S log1pl.S log2.S log2f.S \ - log2l.S logb.c logbf.c logbl.c logf.S logl.S lrint.c lrintf.c \ - lrintl.c lround_generic.c modff.c modfl.c \ - nearbyint.S nearbyintf.S nearbyintl.S \ - nextafterf.c nextafterl.c nexttowardf.c nexttoward.c \ - powf.c powi.c powif.c powil.c powl.c \ - remainder.S remainderf.S remainderl.S remquo.S \ - remquof.S remquol.S rint.c rintf.c rintl.c round_internal.h \ - round_generic.c scalbn.S scalbnf.S scalbnl.S s_erf.c sf_erf.c \ - signbit.c signbitf.c signbitl.c sinf.S sinhf.c sinhl.c sinl.S \ - sqrtf.c sqrtl.c tanf.S tanhf.c tanhl.c tanl.S tgamma.c \ - tgammaf.c tgammal.c trunc.c truncf.c truncl.c \ - acosh.c acoshf.c acoshl.c asinh.c asinhf.c asinhl.c \ - atanh.c atanhf.c atanhl.c fastmath.h - -STDIO_DISTFILES = \ - fopen64.c fseeko64.c ftello64.c lseek64.c \ - vfscanf.c vfwscanf.c vscanf.c vsscanf.c vswscanf.c vwscanf.c \ - pformat.c pformat.h printf.c fprintf.c sprintf.c snprintf.c \ - vprintf.c vfprintf.c vsprintf.c vsnprintf.c \ - snwprintf.c vsnwprintf.c - -COMPLEX_DISTFILES = \ - cabs.c cabsf.c cabsl.c cacos.c cacosf.c cacosl.c cacosh.c \ - cacoshf.c cacoshl.c carg.c cargf.c cargl.c casin.c casinf.c \ - casinl.c casinh.c casinhf.c casinhl.c catan.c catanf.c catanl.c \ - catanh.c catanhf.c catanhl.c ccos.c ccosf.c ccosl.c ccosh.c \ - ccoshf.c ccoshl.c cexp.c cexpf.c cexpl.c cimag.c cimagf.c \ - cimagl.c clog.c clogf.c clogl.c cpow.c cpowf.c cpowl.c cproj.c \ - cprojf.c cprojl.c creal.c crealf.c creall.c csin.c csinf.c \ - csinl.c csinh.c csinhf.c csinhl.c csqrt.c csqrtf.c csqrtl.c \ - ctan.c ctanf.c ctanl.c ctanh.c ctanhf.c ctanhl.c - -GDTOA_DISTFILES = \ - arithchk.c dmisc.c dtoa.c g__fmt.c g_dfmt.c g_ffmt.c g_xfmt.c \ - gd_arith.h gd_qnan.h gdtoa.c gdtoa.h gdtoaimp.h gethex.c gmisc.c \ - hd_init.c hexnan.c misc.c qnan.c README smisc.c strtodg.c strtodnrp.c \ - strtof.c strtopx.c sum.c ulp.c - -CC = @CC@ -# FIXME: Which is it, CC or CC_FOR_TARGET? -CC_FOR_TARGET = $(CC) -AS_FOR_TARGET = $(AS) -CFLAGS = @CFLAGS@ -CXXFLAGS = @CXXFLAGS@ -OPTFLAGS = -fomit-frame-pointer -WARNFLAGS = -Wall - - -# compiling with Cygwin? -NO_CYGWIN := @NO_CYGWIN@ -ifdef NO_CYGWIN -override CC := ${NO_CYGWIN} $(firstword $(filter-out ${NO_CYGWIN},${CC})) -endif - -W32API_INCLUDE = @W32API_INCLUDE@ -INCLUDES = -I$(srcdir) -I$(srcdir)/.. -I$(srcdir)/../include \ - -nostdinc \ - -iwithprefixbefore include -ALL_CFLAGS = $(CFLAGS) $(WARNFLAGS) $(OPTFLAGS) $(INCLUDES) $(W32API_INCLUDE) -ALL_CXXFLAGS = $(CXXFLAGS) $(WARNFLAGS) $(OPTFLAGS) $(INCLUDES) -nostdinc++ $(W32API_INCLUDE) - -AS = @AS@ -AR = @AR@ -LD = @LD@ -AR_FLAGS = rcv -RANLIB = @RANLIB@ -DLLTOOL = @DLLTOOL@ -DLLTOOLFLAGS = -DLLTOOL_FOR_TARGET = $(DLLTOOL) -DLLTOOL_FLAGS = --as $(AS_FOR_TARGET) - -LIBMINGWEX_A = libmingwex.a - -Q8_OBJS = \ - fwide.o imaxabs.o imaxdiv.o mbsinit.o \ - strtoimax.o strtoumax.o wcstoimax.o wcstoumax.o \ - wmemchr.o wmemcmp.o wmemcpy.o wmemmove.o wmemset.o \ - wctrans.o wctype.o wcrtomb.o wctob.o mbrtowc.o btowc.o \ - wcstof.o wcstold.o -CTYPE_OBJS = \ - isblank.o iswblank.o -STDLIB_STUB_OBJS = \ - lltoa.o ulltoa.o \ - lltow.o ulltow.o \ - atoll.o wtoll.o \ - _Exit.o -STDIO_OBJS = \ - fopen64.o fseeko64.o ftello64.o lseek64.o \ - vfscanf.o vfwscanf.o vscanf.o vsscanf.o vswscanf.o vwscanf.o \ - pformat.o snprintf.o vsnprintf.o snwprintf.o vsnwprintf.o \ - printf.o fprintf.o sprintf.o vprintf.o vfprintf.o vsprintf.o -MATH_OBJS = \ - acosf.o acosl.o asinf.o asinl.o atan2f.o atan2l.o \ - atanf.o atanl.o cbrt.o cbrtf.o cbrtl.o ceilf.o ceill.o \ - copysign.o copysignf.o copysignl.o cosf.o coshf.o coshl.o cosl.o \ - erfl.o exp2.o exp2f.o exp2l.o expf.o expl.o expm1.o expm1l.o expm1f.o \ - fabs.o fabsf.o fabsl.o \ - fdim.o fdimf.o fdiml.o floorf.o floorl.o fma.o fmaf.o fmal.o \ - fmax.o fmaxf.o fmaxl.o fmin.o fminf.o fminl.o fmodf.o \ - fmodl.o fp_consts.o fp_constsf.o fp_constsl.o \ - fpclassify.o fpclassifyf.o fpclassifyl.o \ - frexpf.o frexpl.o fucom.o hypotf.o hypotl.o ilogb.o ilogbf.o \ - ilogbl.o isnan.o isnanf.o isnanl.o ldexpf.o ldexpl.o \ - lgamma.o lgammaf.o lgammal.o llrint.o llrintf.o llrintl.o \ - log10f.o log10l.o log1p.o log1pf.o log1pl.o log2.o log2f.o \ - log2l.o logb.o logbf.o logbl.o logf.o logl.o \ - lrint.o lrintf.o lrintl.o modff.o modfl.o \ - nearbyint.o nearbyintf.o nearbyintl.o \ - nextafterf.o nextafterl.o nexttowardf.o nexttoward.o \ - powf.o powi.o powif.o powil.o powl.o \ - remainder.o remainderf.o remainderl.o remquo.o \ - remquof.o remquol.o rint.o rintf.o rintl.o \ - scalbn.o scalbnf.o scalbnl.o s_erf.o sf_erf.o \ - signbit.o signbitf.o signbitl.o sinf.o sinhf.o sinhl.o sinl.o \ - sqrtf.o sqrtl.o tanf.o tanhf.o tanhl.o tanl.o tgamma.o \ - tgammaf.o tgammal.o trunc.o truncf.o truncl.o \ - acosh.o acoshf.o acoshl.o asinh.o asinhf.o asinhl.o \ - atanh.o atanhf.o atanhl.o -MATH_ROUND_OBJS = round.o roundf.o roundl.o -MATH_LROUND_OBJS = lround.o lroundf.o lroundl.o -MATH_LLROUND_OBJS = llround.o llroundf.o llroundl.o -FENV_OBJS = fesetround.o fegetround.o \ - fegetenv.o fesetenv.o feupdateenv.o \ - feclearexcept.o feholdexcept.o fegetexceptflag.o \ - feraiseexcept.o fetestexcept.o fesetexceptflag.o -POSIX_OBJS = \ - dirent.o wdirent.o getopt.o ftruncate.o gettimeofday.o usleep.o \ - basename.o dirname.o tsearch.o twalk.o tdelete.o tfind.o -REPLACE_OBJS = \ - mingw-aligned-malloc.o mingw-fseek.o -COMPLEX_OBJS = \ - cabs.o cabsf.o cabsl.o cacos.o cacosf.o cacosl.o cacosh.o \ - cacoshf.o cacoshl.o carg.o cargf.o cargl.o casin.o casinf.o \ - casinl.o casinh.o casinhf.o casinhl.o catan.o catanf.o catanl.o \ - catanh.o catanhf.o catanhl.o ccos.o ccosf.o ccosl.o ccosh.o \ - ccoshf.o ccoshl.o cexp.o cexpf.o cexpl.o cimag.o cimagf.o \ - cimagl.o clog.o clogf.o clogl.o cpow.o cpowf.o cpowl.o cproj.o \ - cprojf.o cprojl.o creal.o crealf.o creall.o csin.o csinf.o \ - csinl.o csinh.o csinhf.o csinhl.o csqrt.o csqrtf.o csqrtl.o \ - ctan.o ctanf.o ctanl.o ctanh.o ctanhf.o ctanhl.o -GDTOA_OBJS = \ - dmisc.o dtoa.o g__fmt.o g_dfmt.o g_ffmt.o g_xfmt.o gdtoa.o \ - gethex.o gmisc.o hd_init.o hexnan.o misc.o smisc.o \ - strtodg.o strtodnrp.o strtof.o strtopx.o sum.o ulp.o - -LIB_OBJS = $(Q8_OBJS) $(CTYPE_OBJS) $(STDLIB_STUB_OBJS) \ - $(STDIO_OBJS) $(MATH_OBJS) $(MATH_ROUND_OBJS) \ - $(MATH_LROUND_OBJS) $(MATH_LLROUND_OBJS) $(FENV_OBJS) \ - $(POSIX_OBJS) $(REPLACE_OBJS) $(COMPLEX_OBJS) \ - $(GDTOA_OBJS) - -LIBS = $(LIBMINGWEX_A) -DLLS = - -all: $(LIBMINGWEX_A) - -$(LIBMINGWEX_A): $(LIB_OBJS) - rm -f $(LIBMINGWEX_A) - $(AR) $(ARFLAGS) $@ $(LIB_OBJS) - $(RANLIB) $@ - -$(MATH_ROUND_OBJS): round_generic.c - $(CC) $(ALL_CFLAGS) -I$(srcdir)/math -c -o $@ \ - -D FUNCTION=$* $(srcdir)/math/round_generic.c - -$(MATH_LROUND_OBJS) $(MATH_LLROUND_OBJS): lround_generic.c - $(CC) $(ALL_CFLAGS) -I$(srcdir)/math -c -o $@ \ - -D FUNCTION=$* $(srcdir)/math/lround_generic.c - -Makefile: Makefile.in config.status configure - $(SHELL) config.status - -config.status: configure - $(SHELL) config.status --recheck - -info: - -info-html: - -install-info: info - -install: all - $(mkinstalldirs) $(inst_libdir) - for i in $(LIBS); do \ - $(INSTALL_DATA) $$i $(inst_libdir)/$$i ; \ - done - -clean: - -rm -f $(LIB_OBJS) $(LIBMINGWEX_A) - -distclean: - -rm -f *.o *.a *~ core a.out - -rm -f config.cache config.status config.log - -rm -f Makefile -.c.o: - $(CC) -c $(ALL_CFLAGS) $< -o $@ -.S.o: - $(CC) -c $< -o $@ -.s.o: - $(CC) -c $< -o $@ - -# pformat.o needs an explicit build rule; we always build it -# assuming __MSVCRT_VERSION__ >= 0x0800, relying on ofmt_stub.s -# (in the parent directory) to maintain forward compatibility -# for earlier versions of MSVCRT.DLL -# -PFORMAT_CFLAGS = $(ALL_CFLAGS) -I $(srcdir)/gdtoa -D__MSVCRT_VERSION__=0x0800 -pformat.o: pformat.c pformat.h - $(CC) -c $(PFORMAT_CFLAGS) $(srcdir)/stdio/$*.c -o $@ - -# -# Dependencies -# -wdirent.o: $(srcdir)/dirent.c $(srcdir)/wdirent.c - -acosh.o acoshf.o acoshl.o \ -asinh.o asinhf.o asinhl.o \ -atanh.o atanhf.o atanhl.o: fastmath.h -mbrtowc.o wcrtomb.o wcstof.o wcstold.o: mb_wc_common.h - -$(GDTOA_OBJS): gd_arith.h gdtoa.h gdtoaimp.h gd_qnan.h - -$(MATH_ROUND_OBJS) $(MATH_LROUND_OBJS) $(MATH_LLROUND_OBJS): round_internal.h - -printf.o: printf.c pformat.h -fprintf.o: fprintf.c pformat.h -sprintf.o: sprintf.c pformat.h -snprintf.o: snprintf.c pformat.h -vprintf.o: vprintf.c pformat.h -vfprintf.o: vfprintf.c pformat.h -vsprintf.o: vsprintf.c pformat.h -vsnprintf.o: vsnprintf.c pformat.h - -dist: - mkdir $(distdir)/mingwex - chmod 755 $(distdir)/mingwex - @for i in $(DISTFILES); do\ - cp -p $(srcdir)/$$i $(distdir)/mingwex/$$i ; \ - done - mkdir $(distdir)/mingwex/math - chmod 755 $(distdir)/mingwex/math - @for i in $(MATH_DISTFILES); do\ - cp -p $(srcdir)/math/$$i $(distdir)/mingwex/math/$$i ; \ - done - mkdir $(distdir)/mingwex/stdio - chmod 755 $(distdir)/mingwex/stdio - @for i in $(STDIO_DISTFILES); do\ - cp -p $(srcdir)/stdio/$$i $(distdir)/mingwex/stdio/$$i ; \ - done - mkdir $(distdir)/mingwex/complex - chmod 755 $(distdir)/mingwex/complex - @for i in $(COMPLEX_DISTFILES); do\ - cp -p $(srcdir)/complex/$$i $(distdir)/mingwex/complex/$$i ; \ - done - mkdir $(distdir)/mingwex/gdtoa - chmod 755 $(distdir)/mingwex/gdtoa - @for i in $(GDTOA_DISTFILES); do\ - cp -p $(srcdir)/gdtoa/$$i $(distdir)/mingwex/gdtoa/$$i ; \ - done diff --git a/winsup/mingw/mingwex/_Exit.c b/winsup/mingw/mingwex/_Exit.c deleted file mode 100644 index 38f7e182e..000000000 --- a/winsup/mingw/mingwex/_Exit.c +++ /dev/null @@ -1,3 +0,0 @@ -#include <stdlib.h> -void _Exit(int status) - { _exit(status); } diff --git a/winsup/mingw/mingwex/aclocal.m4 b/winsup/mingw/mingwex/aclocal.m4 deleted file mode 100644 index 177c0134b..000000000 --- a/winsup/mingw/mingwex/aclocal.m4 +++ /dev/null @@ -1,831 +0,0 @@ -dnl aclocal.m4 generated automatically by aclocal 1.4-p6 - -dnl Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc. -dnl This file is free software; the Free Software Foundation -dnl gives unlimited permission to copy and/or distribute it, -dnl with or without modifications, as long as this notice is preserved. - -dnl This program is distributed in the hope that it will be useful, -dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without -dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A -dnl PARTICULAR PURPOSE. - -# lib-prefix.m4 serial 4 (gettext-0.14.2) -dnl Copyright (C) 2001-2005 Free Software Foundation, Inc. -dnl This file is free software; the Free Software Foundation -dnl gives unlimited permission to copy and/or distribute it, -dnl with or without modifications, as long as this notice is preserved. - -dnl From Bruno Haible. - -dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and -dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't -dnl require excessive bracketing. -ifdef([AC_HELP_STRING], -[AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])], -[AC_DEFUN([AC_][LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])]) - -dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed -dnl to access previously installed libraries. The basic assumption is that -dnl a user will want packages to use other packages he previously installed -dnl with the same --prefix option. -dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate -dnl libraries, but is otherwise very convenient. -AC_DEFUN([AC_LIB_PREFIX], -[ - AC_BEFORE([$0], [AC_LIB_LINKFLAGS]) - AC_REQUIRE([AC_PROG_CC]) - AC_REQUIRE([AC_CANONICAL_HOST]) - AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) - dnl By default, look in $includedir and $libdir. - use_additional=yes - AC_LIB_WITH_FINAL_PREFIX([ - eval additional_includedir=\"$includedir\" - eval additional_libdir=\"$libdir\" - ]) - AC_LIB_ARG_WITH([lib-prefix], -[ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib - --without-lib-prefix don't search for libraries in includedir and libdir], -[ - if test "X$withval" = "Xno"; then - use_additional=no - else - if test "X$withval" = "X"; then - AC_LIB_WITH_FINAL_PREFIX([ - eval additional_includedir=\"$includedir\" - eval additional_libdir=\"$libdir\" - ]) - else - additional_includedir="$withval/include" - additional_libdir="$withval/lib" - fi - fi -]) - if test $use_additional = yes; then - dnl Potentially add $additional_includedir to $CPPFLAGS. - dnl But don't add it - dnl 1. if it's the standard /usr/include, - dnl 2. if it's already present in $CPPFLAGS, - dnl 3. if it's /usr/local/include and we are using GCC on Linux, - dnl 4. if it doesn't exist as a directory. - if test "X$additional_includedir" != "X/usr/include"; then - haveit= - for x in $CPPFLAGS; do - AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) - if test "X$x" = "X-I$additional_includedir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - if test "X$additional_includedir" = "X/usr/local/include"; then - if test -n "$GCC"; then - case $host_os in - linux* | gnu* | k*bsd*-gnu) haveit=yes;; - esac - fi - fi - if test -z "$haveit"; then - if test -d "$additional_includedir"; then - dnl Really add $additional_includedir to $CPPFLAGS. - CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir" - fi - fi - fi - fi - dnl Potentially add $additional_libdir to $LDFLAGS. - dnl But don't add it - dnl 1. if it's the standard /usr/lib, - dnl 2. if it's already present in $LDFLAGS, - dnl 3. if it's /usr/local/lib and we are using GCC on Linux, - dnl 4. if it doesn't exist as a directory. - if test "X$additional_libdir" != "X/usr/lib"; then - haveit= - for x in $LDFLAGS; do - AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) - if test "X$x" = "X-L$additional_libdir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - if test "X$additional_libdir" = "X/usr/local/lib"; then - if test -n "$GCC"; then - case $host_os in - linux*) haveit=yes;; - esac - fi - fi - if test -z "$haveit"; then - if test -d "$additional_libdir"; then - dnl Really add $additional_libdir to $LDFLAGS. - LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir" - fi - fi - fi - fi - fi -]) - -dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix, -dnl acl_final_exec_prefix, containing the values to which $prefix and -dnl $exec_prefix will expand at the end of the configure script. -AC_DEFUN([AC_LIB_PREPARE_PREFIX], -[ - dnl Unfortunately, prefix and exec_prefix get only finally determined - dnl at the end of configure. - if test "X$prefix" = "XNONE"; then - acl_final_prefix="$ac_default_prefix" - else - acl_final_prefix="$prefix" - fi - if test "X$exec_prefix" = "XNONE"; then - acl_final_exec_prefix='${prefix}' - else - acl_final_exec_prefix="$exec_prefix" - fi - acl_save_prefix="$prefix" - prefix="$acl_final_prefix" - eval acl_final_exec_prefix=\"$acl_final_exec_prefix\" - prefix="$acl_save_prefix" -]) - -dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the -dnl variables prefix and exec_prefix bound to the values they will have -dnl at the end of the configure script. -AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX], -[ - acl_save_prefix="$prefix" - prefix="$acl_final_prefix" - acl_save_exec_prefix="$exec_prefix" - exec_prefix="$acl_final_exec_prefix" - $1 - exec_prefix="$acl_save_exec_prefix" - prefix="$acl_save_prefix" -]) - -# lib-link.m4 serial 6 (gettext-0.14.3) -dnl Copyright (C) 2001-2005 Free Software Foundation, Inc. -dnl This file is free software; the Free Software Foundation -dnl gives unlimited permission to copy and/or distribute it, -dnl with or without modifications, as long as this notice is preserved. - -dnl From Bruno Haible. - -AC_PREREQ(2.50) - -dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and -dnl the libraries corresponding to explicit and implicit dependencies. -dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and -dnl augments the CPPFLAGS variable. -AC_DEFUN([AC_LIB_LINKFLAGS], -[ - AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) - AC_REQUIRE([AC_LIB_RPATH]) - define([Name],[translit([$1],[./-], [___])]) - define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], - [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) - AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [ - AC_LIB_LINKFLAGS_BODY([$1], [$2]) - ac_cv_lib[]Name[]_libs="$LIB[]NAME" - ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME" - ac_cv_lib[]Name[]_cppflags="$INC[]NAME" - ]) - LIB[]NAME="$ac_cv_lib[]Name[]_libs" - LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs" - INC[]NAME="$ac_cv_lib[]Name[]_cppflags" - AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME) - AC_SUBST([LIB]NAME) - AC_SUBST([LTLIB]NAME) - dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the - dnl results of this search when this library appears as a dependency. - HAVE_LIB[]NAME=yes - undefine([Name]) - undefine([NAME]) -]) - -dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode) -dnl searches for libname and the libraries corresponding to explicit and -dnl implicit dependencies, together with the specified include files and -dnl the ability to compile and link the specified testcode. If found, it -dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and -dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and -dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs -dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty. -AC_DEFUN([AC_LIB_HAVE_LINKFLAGS], -[ - AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) - AC_REQUIRE([AC_LIB_RPATH]) - define([Name],[translit([$1],[./-], [___])]) - define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], - [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) - - dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME - dnl accordingly. - AC_LIB_LINKFLAGS_BODY([$1], [$2]) - - dnl Add $INC[]NAME to CPPFLAGS before performing the following checks, - dnl because if the user has installed lib[]Name and not disabled its use - dnl via --without-lib[]Name-prefix, he wants to use it. - ac_save_CPPFLAGS="$CPPFLAGS" - AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME) - - AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [ - ac_save_LIBS="$LIBS" - LIBS="$LIBS $LIB[]NAME" - AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no]) - LIBS="$ac_save_LIBS" - ]) - if test "$ac_cv_lib[]Name" = yes; then - HAVE_LIB[]NAME=yes - AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.]) - AC_MSG_CHECKING([how to link with lib[]$1]) - AC_MSG_RESULT([$LIB[]NAME]) - else - HAVE_LIB[]NAME=no - dnl If $LIB[]NAME didn't lead to a usable library, we don't need - dnl $INC[]NAME either. - CPPFLAGS="$ac_save_CPPFLAGS" - LIB[]NAME= - LTLIB[]NAME= - fi - AC_SUBST([HAVE_LIB]NAME) - AC_SUBST([LIB]NAME) - AC_SUBST([LTLIB]NAME) - undefine([Name]) - undefine([NAME]) -]) - -dnl Determine the platform dependent parameters needed to use rpath: -dnl libext, shlibext, hardcode_libdir_flag_spec, hardcode_libdir_separator, -dnl hardcode_direct, hardcode_minus_L. -AC_DEFUN([AC_LIB_RPATH], -[ - dnl Tell automake >= 1.10 to complain if config.rpath is missing. - m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([config.rpath])]) - AC_REQUIRE([AC_PROG_CC]) dnl we use $CC, $GCC, $LDFLAGS - AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld - AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host - AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir - AC_CACHE_CHECK([for shared library run path origin], acl_cv_rpath, [ - CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \ - ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh - . ./conftest.sh - rm -f ./conftest.sh - acl_cv_rpath=done - ]) - wl="$acl_cv_wl" - libext="$acl_cv_libext" - shlibext="$acl_cv_shlibext" - hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec" - hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator" - hardcode_direct="$acl_cv_hardcode_direct" - hardcode_minus_L="$acl_cv_hardcode_minus_L" - dnl Determine whether the user wants rpath handling at all. - AC_ARG_ENABLE(rpath, - [ --disable-rpath do not hardcode runtime library paths], - :, enable_rpath=yes) -]) - -dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and -dnl the libraries corresponding to explicit and implicit dependencies. -dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables. -AC_DEFUN([AC_LIB_LINKFLAGS_BODY], -[ - define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], - [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) - dnl By default, look in $includedir and $libdir. - use_additional=yes - AC_LIB_WITH_FINAL_PREFIX([ - eval additional_includedir=\"$includedir\" - eval additional_libdir=\"$libdir\" - ]) - AC_LIB_ARG_WITH([lib$1-prefix], -[ --with-lib$1-prefix[=DIR] search for lib$1 in DIR/include and DIR/lib - --without-lib$1-prefix don't search for lib$1 in includedir and libdir], -[ - if test "X$withval" = "Xno"; then - use_additional=no - else - if test "X$withval" = "X"; then - AC_LIB_WITH_FINAL_PREFIX([ - eval additional_includedir=\"$includedir\" - eval additional_libdir=\"$libdir\" - ]) - else - additional_includedir="$withval/include" - additional_libdir="$withval/lib" - fi - fi -]) - dnl Search the library and its dependencies in $additional_libdir and - dnl $LDFLAGS. Using breadth-first-seach. - LIB[]NAME= - LTLIB[]NAME= - INC[]NAME= - rpathdirs= - ltrpathdirs= - names_already_handled= - names_next_round='$1 $2' - while test -n "$names_next_round"; do - names_this_round="$names_next_round" - names_next_round= - for name in $names_this_round; do - already_handled= - for n in $names_already_handled; do - if test "$n" = "$name"; then - already_handled=yes - break - fi - done - if test -z "$already_handled"; then - names_already_handled="$names_already_handled $name" - dnl See if it was already located by an earlier AC_LIB_LINKFLAGS - dnl or AC_LIB_HAVE_LINKFLAGS call. - uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'` - eval value=\"\$HAVE_LIB$uppername\" - if test -n "$value"; then - if test "$value" = yes; then - eval value=\"\$LIB$uppername\" - test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value" - eval value=\"\$LTLIB$uppername\" - test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value" - else - dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined - dnl that this library doesn't exist. So just drop it. - : - fi - else - dnl Search the library lib$name in $additional_libdir and $LDFLAGS - dnl and the already constructed $LIBNAME/$LTLIBNAME. - found_dir= - found_la= - found_so= - found_a= - if test $use_additional = yes; then - if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then - found_dir="$additional_libdir" - found_so="$additional_libdir/lib$name.$shlibext" - if test -f "$additional_libdir/lib$name.la"; then - found_la="$additional_libdir/lib$name.la" - fi - else - if test -f "$additional_libdir/lib$name.$libext"; then - found_dir="$additional_libdir" - found_a="$additional_libdir/lib$name.$libext" - if test -f "$additional_libdir/lib$name.la"; then - found_la="$additional_libdir/lib$name.la" - fi - fi - fi - fi - if test "X$found_dir" = "X"; then - for x in $LDFLAGS $LTLIB[]NAME; do - AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) - case "$x" in - -L*) - dir=`echo "X$x" | sed -e 's/^X-L//'` - if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then - found_dir="$dir" - found_so="$dir/lib$name.$shlibext" - if test -f "$dir/lib$name.la"; then - found_la="$dir/lib$name.la" - fi - else - if test -f "$dir/lib$name.$libext"; then - found_dir="$dir" - found_a="$dir/lib$name.$libext" - if test -f "$dir/lib$name.la"; then - found_la="$dir/lib$name.la" - fi - fi - fi - ;; - esac - if test "X$found_dir" != "X"; then - break - fi - done - fi - if test "X$found_dir" != "X"; then - dnl Found the library. - LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name" - if test "X$found_so" != "X"; then - dnl Linking with a shared library. We attempt to hardcode its - dnl directory into the executable's runpath, unless it's the - dnl standard /usr/lib. - if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then - dnl No hardcoding is needed. - LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" - else - dnl Use an explicit option to hardcode DIR into the resulting - dnl binary. - dnl Potentially add DIR to ltrpathdirs. - dnl The ltrpathdirs will be appended to $LTLIBNAME at the end. - haveit= - for x in $ltrpathdirs; do - if test "X$x" = "X$found_dir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - ltrpathdirs="$ltrpathdirs $found_dir" - fi - dnl The hardcoding into $LIBNAME is system dependent. - if test "$hardcode_direct" = yes; then - dnl Using DIR/libNAME.so during linking hardcodes DIR into the - dnl resulting binary. - LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" - else - if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then - dnl Use an explicit option to hardcode DIR into the resulting - dnl binary. - LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" - dnl Potentially add DIR to rpathdirs. - dnl The rpathdirs will be appended to $LIBNAME at the end. - haveit= - for x in $rpathdirs; do - if test "X$x" = "X$found_dir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - rpathdirs="$rpathdirs $found_dir" - fi - else - dnl Rely on "-L$found_dir". - dnl But don't add it if it's already contained in the LDFLAGS - dnl or the already constructed $LIBNAME - haveit= - for x in $LDFLAGS $LIB[]NAME; do - AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) - if test "X$x" = "X-L$found_dir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir" - fi - if test "$hardcode_minus_L" != no; then - dnl FIXME: Not sure whether we should use - dnl "-L$found_dir -l$name" or "-L$found_dir $found_so" - dnl here. - LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" - else - dnl We cannot use $hardcode_runpath_var and LD_RUN_PATH - dnl here, because this doesn't fit in flags passed to the - dnl compiler. So give up. No hardcoding. This affects only - dnl very old systems. - dnl FIXME: Not sure whether we should use - dnl "-L$found_dir -l$name" or "-L$found_dir $found_so" - dnl here. - LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name" - fi - fi - fi - fi - else - if test "X$found_a" != "X"; then - dnl Linking with a static library. - LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a" - else - dnl We shouldn't come here, but anyway it's good to have a - dnl fallback. - LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name" - fi - fi - dnl Assume the include files are nearby. - additional_includedir= - case "$found_dir" in - */lib | */lib/) - basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'` - additional_includedir="$basedir/include" - ;; - esac - if test "X$additional_includedir" != "X"; then - dnl Potentially add $additional_includedir to $INCNAME. - dnl But don't add it - dnl 1. if it's the standard /usr/include, - dnl 2. if it's /usr/local/include and we are using GCC on Linux, - dnl 3. if it's already present in $CPPFLAGS or the already - dnl constructed $INCNAME, - dnl 4. if it doesn't exist as a directory. - if test "X$additional_includedir" != "X/usr/include"; then - haveit= - if test "X$additional_includedir" = "X/usr/local/include"; then - if test -n "$GCC"; then - case $host_os in - linux* | gnu* | k*bsd*-gnu) haveit=yes;; - esac - fi - fi - if test -z "$haveit"; then - for x in $CPPFLAGS $INC[]NAME; do - AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) - if test "X$x" = "X-I$additional_includedir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - if test -d "$additional_includedir"; then - dnl Really add $additional_includedir to $INCNAME. - INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir" - fi - fi - fi - fi - fi - dnl Look for dependencies. - if test -n "$found_la"; then - dnl Read the .la file. It defines the variables - dnl dlname, library_names, old_library, dependency_libs, current, - dnl age, revision, installed, dlopen, dlpreopen, libdir. - save_libdir="$libdir" - case "$found_la" in - */* | *\\*) . "$found_la" ;; - *) . "./$found_la" ;; - esac - libdir="$save_libdir" - dnl We use only dependency_libs. - for dep in $dependency_libs; do - case "$dep" in - -L*) - additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` - dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME. - dnl But don't add it - dnl 1. if it's the standard /usr/lib, - dnl 2. if it's /usr/local/lib and we are using GCC on Linux, - dnl 3. if it's already present in $LDFLAGS or the already - dnl constructed $LIBNAME, - dnl 4. if it doesn't exist as a directory. - if test "X$additional_libdir" != "X/usr/lib"; then - haveit= - if test "X$additional_libdir" = "X/usr/local/lib"; then - if test -n "$GCC"; then - case $host_os in - linux* | gnu* | k*bsd*-gnu) haveit=yes;; - esac - fi - fi - if test -z "$haveit"; then - haveit= - for x in $LDFLAGS $LIB[]NAME; do - AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) - if test "X$x" = "X-L$additional_libdir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - if test -d "$additional_libdir"; then - dnl Really add $additional_libdir to $LIBNAME. - LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir" - fi - fi - haveit= - for x in $LDFLAGS $LTLIB[]NAME; do - AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) - if test "X$x" = "X-L$additional_libdir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - if test -d "$additional_libdir"; then - dnl Really add $additional_libdir to $LTLIBNAME. - LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir" - fi - fi - fi - fi - ;; - -R*) - dir=`echo "X$dep" | sed -e 's/^X-R//'` - if test "$enable_rpath" != no; then - dnl Potentially add DIR to rpathdirs. - dnl The rpathdirs will be appended to $LIBNAME at the end. - haveit= - for x in $rpathdirs; do - if test "X$x" = "X$dir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - rpathdirs="$rpathdirs $dir" - fi - dnl Potentially add DIR to ltrpathdirs. - dnl The ltrpathdirs will be appended to $LTLIBNAME at the end. - haveit= - for x in $ltrpathdirs; do - if test "X$x" = "X$dir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - ltrpathdirs="$ltrpathdirs $dir" - fi - fi - ;; - -l*) - dnl Handle this in the next round. - names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` - ;; - *.la) - dnl Handle this in the next round. Throw away the .la's - dnl directory; it is already contained in a preceding -L - dnl option. - names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` - ;; - *) - dnl Most likely an immediate library name. - LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep" - LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep" - ;; - esac - done - fi - else - dnl Didn't find the library; assume it is in the system directories - dnl known to the linker and runtime loader. (All the system - dnl directories known to the linker should also be known to the - dnl runtime loader, otherwise the system is severely misconfigured.) - LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name" - LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name" - fi - fi - fi - done - done - if test "X$rpathdirs" != "X"; then - if test -n "$hardcode_libdir_separator"; then - dnl Weird platform: only the last -rpath option counts, the user must - dnl pass all path elements in one option. We can arrange that for a - dnl single library, but not when more than one $LIBNAMEs are used. - alldirs= - for found_dir in $rpathdirs; do - alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir" - done - dnl Note: hardcode_libdir_flag_spec uses $libdir and $wl. - acl_save_libdir="$libdir" - libdir="$alldirs" - eval flag=\"$hardcode_libdir_flag_spec\" - libdir="$acl_save_libdir" - LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag" - else - dnl The -rpath options are cumulative. - for found_dir in $rpathdirs; do - acl_save_libdir="$libdir" - libdir="$found_dir" - eval flag=\"$hardcode_libdir_flag_spec\" - libdir="$acl_save_libdir" - LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag" - done - fi - fi - if test "X$ltrpathdirs" != "X"; then - dnl When using libtool, the option that works for both libraries and - dnl executables is -R. The -R options are cumulative. - for found_dir in $ltrpathdirs; do - LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir" - done - fi -]) - -dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR, -dnl unless already present in VAR. -dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes -dnl contains two or three consecutive elements that belong together. -AC_DEFUN([AC_LIB_APPENDTOVAR], -[ - for element in [$2]; do - haveit= - for x in $[$1]; do - AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) - if test "X$x" = "X$element"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - [$1]="${[$1]}${[$1]:+ }$element" - fi - done -]) - -# lib-ld.m4 serial 3 (gettext-0.13) -dnl Copyright (C) 1996-2003 Free Software Foundation, Inc. -dnl This file is free software; the Free Software Foundation -dnl gives unlimited permission to copy and/or distribute it, -dnl with or without modifications, as long as this notice is preserved. - -dnl Subroutines of libtool.m4, -dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision -dnl with libtool.m4. - -dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no. -AC_DEFUN([AC_LIB_PROG_LD_GNU], -[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld, -[# I'd rather use --version here, but apparently some GNU ld's only accept -v. -case `$LD -v 2>&1 </dev/null` in -*GNU* | *'with BFD'*) - acl_cv_prog_gnu_ld=yes ;; -*) - acl_cv_prog_gnu_ld=no ;; -esac]) -with_gnu_ld=$acl_cv_prog_gnu_ld -]) - -dnl From libtool-1.4. Sets the variable LD. -AC_DEFUN([AC_LIB_PROG_LD], -[AC_ARG_WITH(gnu-ld, -[ --with-gnu-ld assume the C compiler uses GNU ld [default=no]], -test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no) -AC_REQUIRE([AC_PROG_CC])dnl -AC_REQUIRE([AC_CANONICAL_HOST])dnl -# Prepare PATH_SEPARATOR. -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' - else - PATH_SEPARATOR=: - fi - rm -f conf$$.sh -fi -ac_prog=ld -if test "$GCC" = yes; then - # Check if gcc -print-prog-name=ld gives a path. - AC_MSG_CHECKING([for ld used by GCC]) - case $host in - *-*-mingw*) - # gcc leaves a trailing carriage return which upsets mingw - ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; - *) - ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; - esac - case $ac_prog in - # Accept absolute paths. - [[\\/]* | [A-Za-z]:[\\/]*)] - [re_direlt='/[^/][^/]*/\.\./'] - # Canonicalize the path of ld - ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` - while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do - ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` - done - test -z "$LD" && LD="$ac_prog" - ;; - "") - # If it fails, then pretend we aren't using GCC. - ac_prog=ld - ;; - *) - # If it is relative, then search for the first ld in PATH. - with_gnu_ld=unknown - ;; - esac -elif test "$with_gnu_ld" = yes; then - AC_MSG_CHECKING([for GNU ld]) -else - AC_MSG_CHECKING([for non-GNU ld]) -fi -AC_CACHE_VAL(acl_cv_path_LD, -[if test -z "$LD"; then - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" - for ac_dir in $PATH; do - test -z "$ac_dir" && ac_dir=. - if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then - acl_cv_path_LD="$ac_dir/$ac_prog" - # Check to see if the program is GNU ld. I'd rather use --version, - # but apparently some GNU ld's only accept -v. - # Break only if it was the GNU/non-GNU ld that we prefer. - case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in - *GNU* | *'with BFD'*) - test "$with_gnu_ld" != no && break ;; - *) - test "$with_gnu_ld" != yes && break ;; - esac - fi - done - IFS="$ac_save_ifs" -else - acl_cv_path_LD="$LD" # Let the user override the test with a path. -fi]) -LD="$acl_cv_path_LD" -if test -n "$LD"; then - AC_MSG_RESULT($LD) -else - AC_MSG_RESULT(no) -fi -test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH]) -AC_LIB_PROG_LD_GNU -]) - diff --git a/winsup/mingw/mingwex/atoll.c b/winsup/mingw/mingwex/atoll.c deleted file mode 100644 index 97920b4ee..000000000 --- a/winsup/mingw/mingwex/atoll.c +++ /dev/null @@ -1,3 +0,0 @@ -#include <stdlib.h> -long long atoll (const char * _c) - { return _atoi64 (_c); } diff --git a/winsup/mingw/mingwex/basename.c b/winsup/mingw/mingwex/basename.c deleted file mode 100755 index c531cab58..000000000 --- a/winsup/mingw/mingwex/basename.c +++ /dev/null @@ -1,167 +0,0 @@ -/* basename.c - * - * $Id$ - * - * Provides an implementation of the "basename" function, conforming - * to SUSv3, with extensions to accommodate Win32 drive designators, - * and suitable for use on native Microsoft(R) Win32 platforms. - * - * Written by Keith Marshall <keithmarshall@users.sourceforge.net> - * - * This is free software. You may redistribute and/or modify it as you - * see fit, without restriction of copyright. - * - * This software is provided "as is", in the hope that it may be useful, - * but WITHOUT WARRANTY OF ANY KIND, not even any implied warranty of - * MERCHANTABILITY, nor of FITNESS FOR ANY PARTICULAR PURPOSE. At no - * time will the author accept any form of liability for any damages, - * however caused, resulting from the use of this software. - * - */ - -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <libgen.h> -#include <locale.h> - -#ifndef __cdecl /* If compiling on any non-Win32 platform ... */ -#define __cdecl /* this may not be defined. */ -#endif - -__cdecl char *basename( char *path ) -{ - size_t len; - static char *retfail = NULL; - - /* to handle path names for files in multibyte character locales, - * we need to set up LC_CTYPE to match the host file system locale - */ - - char *locale = setlocale( LC_CTYPE, NULL ); - if( locale != NULL ) locale = strdup( locale ); - setlocale( LC_CTYPE, "" ); - - if( path && *path ) - { - /* allocate sufficient local storage space, - * in which to create a wide character reference copy of path - */ - - wchar_t refcopy[1 + (len = mbstowcs( NULL, path, 0 ))]; - - /* create the wide character reference copy of path, - * and step over the drive designator, if present ... - */ - - wchar_t *refpath = refcopy; - if( ((len = mbstowcs( refpath, path, len )) > 1) && (refpath[1] == L':') ) - { - /* FIXME: maybe should confirm *refpath is a valid drive designator */ - - refpath += 2; - } - - /* ensure that our wide character reference path is NUL terminated */ - - refcopy[ len ] = L'\0'; - - /* check again, just to ensure we still have a non-empty path name ... */ - - if( *refpath ) - { - /* and, when we do, process it in the wide character domain ... - * scanning from left to right, to the char after the final dir separator - */ - - wchar_t *refname; - for( refname = refpath ; *refpath ; ++refpath ) - { - if( (*refpath == L'/') || (*refpath == L'\\') ) - { - /* we found a dir separator ... - * step over it, and any others which immediately follow it - */ - - while( (*refpath == L'/') || (*refpath == L'\\') ) - ++refpath; - - /* if we didn't reach the end of the path string ... */ - - if( *refpath ) - - /* then we have a new candidate for the base name */ - - refname = refpath; - - /* otherwise ... - * strip off any trailing dir separators which we found - */ - - else while( (refpath > refname) - && ((*--refpath == L'/') || (*refpath == L'\\')) ) - *refpath = L'\0'; - } - } - - /* in the wide character domain ... - * refname now points at the resolved base name ... - */ - - if( *refname ) - { - /* if it's not empty, - * then we transform the full normalised path back into - * the multibyte character domain, and skip over the dirname, - * to return the resolved basename. - */ - - if( (len = wcstombs( path, refcopy, len )) != (size_t)(-1) ) - path[ len ] = '\0'; - *refname = L'\0'; - if( (len = wcstombs( NULL, refcopy, 0 )) != (size_t)(-1) ) - path += len; - } - - else - { - /* the basename is empty, so return the default value of "/", - * transforming from wide char to multibyte char domain, and - * returning it in our own buffer. - */ - - retfail = realloc( retfail, len = 1 + wcstombs( NULL, L"/", 0 )); - wcstombs( path = retfail, L"/", len ); - } - - /* restore the caller's locale, clean up, and return the result */ - - setlocale( LC_CTYPE, locale ); - free( locale ); - return( path ); - } - - /* or we had an empty residual path name, after the drive designator, - * in which case we simply fall through ... - */ - } - - /* and, if we get to here ... - * the path name is either NULL, or it decomposes to an empty string; - * in either case, we return the default value of "." in our own buffer, - * reloading it with the correct value, transformed from the wide char - * to the multibyte char domain, just in case the caller trashed it - * after a previous call. - */ - - retfail = realloc( retfail, len = 1 + wcstombs( NULL, L".", 0 )); - wcstombs( retfail, L".", len ); - - /* restore the caller's locale, clean up, and return the result */ - - setlocale( LC_CTYPE, locale ); - free( locale ); - return( retfail ); -} - -/* $RCSfile$$Revision$: end of file */ diff --git a/winsup/mingw/mingwex/btowc.c b/winsup/mingw/mingwex/btowc.c deleted file mode 100755 index 26b887026..000000000 --- a/winsup/mingw/mingwex/btowc.c +++ /dev/null @@ -1,19 +0,0 @@ -#include "mb_wc_common.h" -#include <wchar.h> -#include <stdio.h> -#define WIN32_LEAN_AND_MEAN -#include <windows.h> - -wint_t btowc (int c) -{ - if (c == EOF) - return (WEOF); - else - { - unsigned char ch = c; - wchar_t wc = WEOF; - MultiByteToWideChar (get_codepage(), MB_ERR_INVALID_CHARS, - (char*)&ch, 1, &wc, 1); - return wc; - } -} diff --git a/winsup/mingw/mingwex/complex/cabs.c b/winsup/mingw/mingwex/complex/cabs.c deleted file mode 100644 index ff547dd6e..000000000 --- a/winsup/mingw/mingwex/complex/cabs.c +++ /dev/null @@ -1,7 +0,0 @@ -#include <math.h> -#include <complex.h> - -double cabs (double complex Z) -{ - return _hypot ( __real__ Z, __imag__ Z); -} diff --git a/winsup/mingw/mingwex/complex/cabsf.c b/winsup/mingw/mingwex/complex/cabsf.c deleted file mode 100755 index 452e88f1c..000000000 --- a/winsup/mingw/mingwex/complex/cabsf.c +++ /dev/null @@ -1,7 +0,0 @@ -#include <math.h> -#include <complex.h> - -float cabsf (float complex Z) -{ - return (float) _hypot ( __real__ Z, __imag__ Z); -} diff --git a/winsup/mingw/mingwex/complex/cabsl.c b/winsup/mingw/mingwex/complex/cabsl.c deleted file mode 100755 index 33124653b..000000000 --- a/winsup/mingw/mingwex/complex/cabsl.c +++ /dev/null @@ -1,7 +0,0 @@ -#include <math.h> -#include <complex.h> - -long double cabsl (long double complex Z) -{ - return hypotl ( __real__ Z, __imag__ Z); -} diff --git a/winsup/mingw/mingwex/complex/cacos.c b/winsup/mingw/mingwex/complex/cacos.c deleted file mode 100644 index 265cba0d7..000000000 --- a/winsup/mingw/mingwex/complex/cacos.c +++ /dev/null @@ -1,82 +0,0 @@ -/* - cacos.c - Contributed by Danny Smith - 2003-10-20 -*/ - -#include <math.h> -#include <complex.h> - -#if 0 -/* cacos (Z) = -I * clog(Z + I * csqrt(1 - Z * Z)) */ - -double complex cacos (double complex Z) -{ - double complex Res; - double x, y; - - x = __real__ Z; - y = __imag__ Z; - - if (y == 0.0) - { - __real__ Res = acos (x); - __imag__ Res = 0.0; - } - - else - { - double complex ZZ; - /* Z * Z = ((x - y) * (x + y)) + (2.0 * x * y) * I */ - /* caculate 1 - Z * Z */ - __real__ ZZ = 1.0 - (x - y) * (x + y); - __imag__ ZZ = -2.0 * x * y; - - - Res = csqrt(ZZ); - - /* calculate ZZ + I * sqrt (ZZ) */ - - __real__ ZZ = x - __imag__ Res; - __imag__ ZZ = y + __real__ Res; - - ZZ = clog(ZZ); - - /* mult by -I */ - - __real__ Res = __imag__ ZZ; - __imag__ Res = - __real__ ZZ; - } - return Res; -} - -#else - -/* cacos ( Z ) = pi/2 - casin ( Z ) */ - -double complex cacos (double complex Z) -{ - double complex Res = casin (Z); - __real__ Res = M_PI_2 - __real__ Res; - __imag__ Res = - __imag__ Res; - return Res; -} -#endif - -#if 0 -#include <stdio.h> -int main() -{ - double z; - double complex bar = 0.7 + 1.2 * I; - double complex foo = cacos (bar); - - printf ("%.16e\t%.16e\n", __real__ foo, __imag__ foo); - - foo = cacos (bar); - printf ("%.16e\t%.16e\n", __real__ foo, __imag__ foo); - - return 1; -} -#endif - diff --git a/winsup/mingw/mingwex/complex/cacosf.c b/winsup/mingw/mingwex/complex/cacosf.c deleted file mode 100755 index f2fbbd9b3..000000000 --- a/winsup/mingw/mingwex/complex/cacosf.c +++ /dev/null @@ -1,64 +0,0 @@ -/* - cacosf.c - Contributed by Danny Smith - 2004-12-24 -*/ - -#include <math.h> -#include <complex.h> - -#if 0 -/* cacos (Z) = -I * clog(Z + I * csqrt(1 - Z * Z)) */ - -float complex cacos (float complex Z) -{ - float complex Res; - float x, y; - - x = __real__ Z; - y = __imag__ Z; - - if (y == 0.0f) - { - __real__ Res = acosf (x); - __imag__ Res = 0.0f; - } - - else - { - float complex ZZ; - /* Z * Z = ((x - y) * (x + y)) + (2.0 * x * y) * I */ - /* caculate 1 - Z * Z */ - __real__ ZZ = 1.0f - (x - y) * (x + y); - __imag__ ZZ = -2.0f * x * y; - - - Res = csqrtf(ZZ); - - /* calculate ZZ + I * sqrt (ZZ) */ - - __real__ ZZ = x - __imag__ Res; - __imag__ ZZ = y + __real__ Res; - - ZZ = clog(ZZ); - - /* mult by -I */ - - __real__ Res = __imag__ ZZ; - __imag__ Res = - __real__ ZZ; - } - return Res; -} - -#else - -/* cacos ( Z ) = pi/2 - casin ( Z ) */ - -float complex cacosf (float complex Z) -{ - float complex Res = casinf (Z); - __real__ Res = M_PI_2 - __real__ Res; - __imag__ Res = - __imag__ Res; - return Res; -} -#endif diff --git a/winsup/mingw/mingwex/complex/cacosh.c b/winsup/mingw/mingwex/complex/cacosh.c deleted file mode 100644 index 34469cb56..000000000 --- a/winsup/mingw/mingwex/complex/cacosh.c +++ /dev/null @@ -1,37 +0,0 @@ -/* - cacosh.c - Contributed by Danny Smith - 2003-10-20 -*/ - -#include <math.h> -#include <complex.h> - -#if 0 -/* cacosh (z) = I * cacos (z) */ -double complex cacosh (double complex Z) -{ - double complex Tmp; - double complex Res; - - Tmp = cacos (Z); - __real__ Res = -__imag__ Tmp; - __imag__ Res = __real__ Tmp; - return Res; -} - -#else - -/* cacosh (z) = I * cacos (z) = I * (pi/2 - casin (z)) */ - -double complex cacosh (double complex Z) -{ - double complex Tmp; - double complex Res; - - Tmp = casin (Z); - __real__ Res = __imag__ Tmp; - __imag__ Res = M_PI_2 - __real__ Tmp; - return Res; -} -#endif diff --git a/winsup/mingw/mingwex/complex/cacoshf.c b/winsup/mingw/mingwex/complex/cacoshf.c deleted file mode 100755 index 411afb3c5..000000000 --- a/winsup/mingw/mingwex/complex/cacoshf.c +++ /dev/null @@ -1,37 +0,0 @@ -/* - cacoshf.c - Contributed by Danny Smith - 2004-12-24 -*/ - -#include <math.h> -#include <complex.h> - -#if 0 -/* cacoshf (z) = I * cacos (z) */ -float complex cacosh (float complex Z) -{ - float complex Tmp; - float complex Res; - - Tmp = cacosf (Z); - __real__ Res = -__imag__ Tmp; - __imag__ Res = __real__ Tmp; - return Res; -} - -#else - -/* cacosh (z) = I * cacos (z) = I * (pi/2 - casin (z)) */ - -float complex cacoshf (float complex Z) -{ - float complex Tmp; - float complex Res; - - Tmp = casinf (Z); - __real__ Res = __imag__ Tmp; - __imag__ Res = M_PI_2 - __real__ Tmp; - return Res; -} -#endif diff --git a/winsup/mingw/mingwex/complex/cacoshl.c b/winsup/mingw/mingwex/complex/cacoshl.c deleted file mode 100755 index 7f482c409..000000000 --- a/winsup/mingw/mingwex/complex/cacoshl.c +++ /dev/null @@ -1,39 +0,0 @@ -/* - cacoshl.c - Contributed by Danny Smith - 2005-01-04 -*/ - -#include <math.h> -#include <complex.h> - -#if 0 -/* cacosh (z) = I * cacos (z) */ -long double complex cacoshl (long double complex Z) -{ - long double complex Tmp; - long double complex Res; - - Tmp = cacosl (Z); - __real__ Res = -__imag__ Tmp; - __imag__ Res = __real__ Tmp; - return Res; -} - -#else - -/* cacosh (z) = I * cacos (z) = I * (pi/2 - casin (z)) */ -#ifndef _M_PI_2L -#define _M_PI_2L 1.5707963267948966192313L -#endif -long double complex cacoshl (long double complex Z) -{ - long double complex Tmp; - long double complex Res; - - Tmp = casinl (Z); - __real__ Res = __imag__ Tmp; - __imag__ Res = _M_PI_2L - __real__ Tmp; - return Res; -} -#endif diff --git a/winsup/mingw/mingwex/complex/cacosl.c b/winsup/mingw/mingwex/complex/cacosl.c deleted file mode 100755 index c8e0b6eda..000000000 --- a/winsup/mingw/mingwex/complex/cacosl.c +++ /dev/null @@ -1,66 +0,0 @@ -/* - cacosl.c - Contributed by Danny Smith - 2004-01-04 -*/ - -#include <math.h> -#include <complex.h> - -#if 0 -/* cacos (Z) = -I * clog(Z + I * csqrt(1 - Z * Z)) */ - -long double complex cacosl (long double complex Z) -{ - long double complex Res; - long double x, y; - - x = __real__ Z; - y = __imag__ Z; - - if (y == 0.0L) - { - __real__ Res = acosl (x); - __imag__ Res = 0.0L; - } - - else - { - long double complex ZZ; - /* Z * Z = ((x - y) * (x + y)) + (2.0 * x * y) * I */ - /* caculate 1 - Z * Z */ - __real__ ZZ = 1.0L - (x - y) * (x + y); - __imag__ ZZ = -2.0L * x * y; - - - Res = csqrtl(ZZ); - - /* calculate ZZ + I * sqrt (ZZ) */ - - __real__ ZZ = x - __imag__ Res; - __imag__ ZZ = y + __real__ Res; - - ZZ = clogl(ZZ); - - /* mult by -I */ - - __real__ Res = __imag__ ZZ; - __imag__ Res = - __real__ ZZ; - } - return Res; -} - -#else - -/* cacos ( Z ) = pi/2 - casin ( Z ) */ -#ifndef _M_PI_2L -#define _M_PI_2L 1.5707963267948966192313L -#endif -long double complex cacosl (long double complex Z) -{ - long double complex Res = casinl (Z); - __real__ Res = _M_PI_2L - __real__ Res; - __imag__ Res = - __imag__ Res; - return Res; -} -#endif diff --git a/winsup/mingw/mingwex/complex/carg.c b/winsup/mingw/mingwex/complex/carg.c deleted file mode 100755 index cb47accb6..000000000 --- a/winsup/mingw/mingwex/complex/carg.c +++ /dev/null @@ -1,9 +0,0 @@ -#include <complex.h> -double __attribute__ ((const)) carg (double _Complex _Z) -{ - double res; - __asm__ ("fpatan;" - : "=t" (res) : "0" (__real__ _Z), "u" (__imag__ _Z) : "st(1)"); - return res; -} - diff --git a/winsup/mingw/mingwex/complex/cargf.c b/winsup/mingw/mingwex/complex/cargf.c deleted file mode 100755 index 360beefe4..000000000 --- a/winsup/mingw/mingwex/complex/cargf.c +++ /dev/null @@ -1,9 +0,0 @@ -#include <complex.h> -float __attribute__ ((const)) cargf (float _Complex _Z) -{ - float res; - __asm__ ("fpatan;" - : "=t" (res) : "0" (__real__ _Z), "u" (__imag__ _Z) : "st(1)"); - return res; -} - diff --git a/winsup/mingw/mingwex/complex/cargl.c b/winsup/mingw/mingwex/complex/cargl.c deleted file mode 100755 index 179dae704..000000000 --- a/winsup/mingw/mingwex/complex/cargl.c +++ /dev/null @@ -1,8 +0,0 @@ -#include <complex.h> -long double __attribute__ ((const)) cargl (long double _Complex _Z) -{ - long double res; - __asm__ ("fpatan;" - : "=t" (res) : "0" (__real__ _Z), "u" (__imag__ _Z) : "st(1)"); - return res; -} diff --git a/winsup/mingw/mingwex/complex/casin.c b/winsup/mingw/mingwex/complex/casin.c deleted file mode 100644 index cd79767b5..000000000 --- a/winsup/mingw/mingwex/complex/casin.c +++ /dev/null @@ -1,48 +0,0 @@ -/* - casin.c - Contributed by Danny Smith - 2003-10-20 -*/ - -#include <math.h> -#include <complex.h> - -/* casin (Z ) = -I * clog(I * Z + csqrt (1.0 - Z * Z))) */ - -double complex casin (double complex Z) -{ - double complex Res; - double x, y; - - x = __real__ Z; - y = __imag__ Z; - - if (y == 0.0) - { - __real__ Res = asin (x); - __imag__ Res = 0.0; - } - else /* -I * clog(I * Z + csqrt(1.0 - Z * Z))) */ - { - double complex ZZ; - - /* Z * Z = ((x - y) * (x + y)) + (2.0 * x * y) * I */ - /* calculate 1 - Z * Z */ - __real__ ZZ = 1.0 - (x - y) * (x + y); - __imag__ ZZ = -2.0 * x * y; - ZZ = csqrt (ZZ); - - - /* add I * Z to ZZ */ - - __real__ ZZ -= y; - __imag__ ZZ += x; - - ZZ = clog (ZZ); - - /* mult by -I */ - __real__ Res = __imag__ ZZ; - __imag__ Res = - __real__ ZZ; - } - return (Res); -} diff --git a/winsup/mingw/mingwex/complex/casinf.c b/winsup/mingw/mingwex/complex/casinf.c deleted file mode 100755 index a70058b0c..000000000 --- a/winsup/mingw/mingwex/complex/casinf.c +++ /dev/null @@ -1,48 +0,0 @@ -/* - casinf.c - Contributed by Danny Smith - 2004-12-24 -*/ - -#include <math.h> -#include <complex.h> - -/* casin (Z ) = -I * clog(I * Z + csqrt (1.0 - Z * Z))) */ - -float complex casinf (float complex Z) -{ - float complex Res; - float x, y; - - x = __real__ Z; - y = __imag__ Z; - - if (y == 0.0f) - { - __real__ Res = asinf (x); - __imag__ Res = 0.0f; - } - else /* -I * clog(I * Z + csqrt(1.0 - Z * Z))) */ - { - float complex ZZ; - - /* Z * Z = ((x - y) * (x + y)) + (2.0 * x * y) * I */ - /* calculate 1 - Z * Z */ - __real__ ZZ = 1.0f - (x - y) * (x + y); - __imag__ ZZ = -2.0f * x * y; - ZZ = csqrtf (ZZ); - - - /* add I * Z to ZZ */ - - __real__ ZZ -= y; - __imag__ ZZ += x; - - ZZ = clogf (ZZ); - - /* mult by -I */ - __real__ Res = __imag__ ZZ; - __imag__ Res = - __real__ ZZ; - } - return (Res); -} diff --git a/winsup/mingw/mingwex/complex/casinh.c b/winsup/mingw/mingwex/complex/casinh.c deleted file mode 100644 index a86c1d625..000000000 --- a/winsup/mingw/mingwex/complex/casinh.c +++ /dev/null @@ -1,23 +0,0 @@ -/* - casinh.c - Contributed by Danny Smith - 2003-10-20 -*/ - -#include <math.h> -#include <complex.h> - -/* casinh (z) = -I casin (I * z) */ - -double complex casinh (double complex Z) -{ - double complex Tmp; - double complex Res; - - __real__ Tmp = - __imag__ Z; - __imag__ Tmp = __real__ Z; - Tmp = casin (Tmp); - __real__ Res = __imag__ Tmp; - __imag__ Res = - __real__ Tmp; - return Res; -} diff --git a/winsup/mingw/mingwex/complex/casinhf.c b/winsup/mingw/mingwex/complex/casinhf.c deleted file mode 100755 index 421cd3a96..000000000 --- a/winsup/mingw/mingwex/complex/casinhf.c +++ /dev/null @@ -1,23 +0,0 @@ -/* - casinhf.c - Contributed by Danny Smith - 2004-12-24 -*/ - -#include <math.h> -#include <complex.h> - -/* casinh (z) = -I casin (I * z) */ - -float complex casinhf (float complex Z) -{ - float complex Tmp; - float complex Res; - - __real__ Tmp = - __imag__ Z; - __imag__ Tmp = __real__ Z; - Tmp = casinf (Tmp); - __real__ Res = __imag__ Tmp; - __imag__ Res = - __real__ Tmp; - return Res; -} diff --git a/winsup/mingw/mingwex/complex/casinhl.c b/winsup/mingw/mingwex/complex/casinhl.c deleted file mode 100755 index 348bf8084..000000000 --- a/winsup/mingw/mingwex/complex/casinhl.c +++ /dev/null @@ -1,23 +0,0 @@ -/* - casinhl.c - Contributed by Danny Smith - 2005-01-04 -*/ - -#include <math.h> -#include <complex.h> - -/* casinh (z) = -I casin (I * z) */ - -long double complex casinhl (long double complex Z) -{ - long double complex Tmp; - long double complex Res; - - __real__ Tmp = - __imag__ Z; - __imag__ Tmp = __real__ Z; - Tmp = casinl (Tmp); - __real__ Res = __imag__ Tmp; - __imag__ Res = - __real__ Tmp; - return Res; -} diff --git a/winsup/mingw/mingwex/complex/casinl.c b/winsup/mingw/mingwex/complex/casinl.c deleted file mode 100755 index 3093fa542..000000000 --- a/winsup/mingw/mingwex/complex/casinl.c +++ /dev/null @@ -1,48 +0,0 @@ -/* - casinl.c - Contributed by Danny Smith - 2005-01-04 -*/ - -#include <math.h> -#include <complex.h> - -/* casin (Z ) = -I * clog(I * Z + csqrt (1.0 - Z * Z))) */ - -long double complex casinl (long double complex Z) -{ - long double complex Res; - long double x, y; - - x = __real__ Z; - y = __imag__ Z; - - if (y == 0.0L) - { - __real__ Res = asinl (x); - __imag__ Res = 0.0L; - } - else /* -I * clog(I * Z + csqrt(1.0 - Z * Z))) */ - { - long double complex ZZ; - - /* Z * Z = ((x - y) * (x + y)) + (2.0 * x * y) * I */ - /* calculate 1 - Z * Z */ - __real__ ZZ = 1.0L - (x - y) * (x + y); - __imag__ ZZ = -2.0L * x * y; - ZZ = csqrtl (ZZ); - - - /* add I * Z to ZZ */ - - __real__ ZZ -= y; - __imag__ ZZ += x; - - ZZ = clogl (ZZ); - - /* mult by -I */ - __real__ Res = __imag__ ZZ; - __imag__ Res = - __real__ ZZ; - } - return (Res); -} diff --git a/winsup/mingw/mingwex/complex/catan.c b/winsup/mingw/mingwex/complex/catan.c deleted file mode 100644 index eee1e8fa7..000000000 --- a/winsup/mingw/mingwex/complex/catan.c +++ /dev/null @@ -1,49 +0,0 @@ -/* catan.c */ - -/* - Contributed by Danny Smith - 2003-10-17 - - FIXME: This needs some serious numerical analysis. -*/ - -#include <math.h> -#include <complex.h> -#include <errno.h> - -/* catan (z) = -I/2 * clog ((I + z) / (I - z)) */ - -double complex -catan (double complex Z) -{ - double complex Res; - double complex Tmp; - double x = __real__ Z; - double y = __imag__ Z; - - if ( x == 0.0 && (1.0 - fabs (y)) == 0.0) - { - errno = ERANGE; - __real__ Res = HUGE_VAL; - __imag__ Res = HUGE_VAL; - } - else if (isinf (_hypot (x, y))) - { - __real__ Res = (x > 0 ? M_PI_2 : -M_PI_2); - __imag__ Res = 0.0; - } - else - { - __real__ Tmp = - x; - __imag__ Tmp = 1.0 - y; - - __real__ Res = x; - __imag__ Res = y + 1.0; - - Tmp = clog (Res/Tmp); - __real__ Res = - 0.5 * __imag__ Tmp; - __imag__ Res = 0.5 * __real__ Tmp; - } - - return Res; -} diff --git a/winsup/mingw/mingwex/complex/catanf.c b/winsup/mingw/mingwex/complex/catanf.c deleted file mode 100755 index adddde885..000000000 --- a/winsup/mingw/mingwex/complex/catanf.c +++ /dev/null @@ -1,49 +0,0 @@ -/* catanf.c */ - -/* - Contributed by Danny Smith - 2004-12-24 - - FIXME: This needs some serious numerical analysis. -*/ - -#include <math.h> -#include <complex.h> -#include <errno.h> - -/* catan (z) = -I/2 * clog ((I + z) / (I - z)) */ - -float complex -catanf (float complex Z) -{ - float complex Res; - float complex Tmp; - float x = __real__ Z; - float y = __imag__ Z; - - if ( x == 0.0f && (1.0f - fabsf (y)) == 0.0f) - { - errno = ERANGE; - __real__ Res = HUGE_VALF; - __imag__ Res = HUGE_VALF; - } - else if (isinf (hypotf (x, y))) - { - __real__ Res = (x > 0 ? M_PI_2 : -M_PI_2); - __imag__ Res = 0.0f; - } - else - { - __real__ Tmp = - x; - __imag__ Tmp = 1.0f - y; - - __real__ Res = x; - __imag__ Res = y + 1.0f; - - Tmp = clogf (Res/Tmp); - __real__ Res = - 0.5f * __imag__ Tmp; - __imag__ Res = 0.5f * __real__ Tmp; - } - - return Res; -} diff --git a/winsup/mingw/mingwex/complex/catanh.c b/winsup/mingw/mingwex/complex/catanh.c deleted file mode 100644 index 78f028014..000000000 --- a/winsup/mingw/mingwex/complex/catanh.c +++ /dev/null @@ -1,23 +0,0 @@ -/* catanh.c */ -/* - Contributed by Danny Smith - 2003-10-20 -*/ - -#include <math.h> -#include <complex.h> - -/* catanh (z) = -I * catan (I * z) */ - -double complex catanh (double complex Z) -{ - double complex Tmp; - double complex Res; - - __real__ Tmp = - __imag__ Z; - __imag__ Tmp = __real__ Z; - Tmp = catan (Tmp); - __real__ Res = __imag__ Tmp; - __imag__ Res = - __real__ Tmp; - return Res; -} diff --git a/winsup/mingw/mingwex/complex/catanhf.c b/winsup/mingw/mingwex/complex/catanhf.c deleted file mode 100755 index 7a792e88b..000000000 --- a/winsup/mingw/mingwex/complex/catanhf.c +++ /dev/null @@ -1,23 +0,0 @@ -/* catanhf.c */ -/* - Contributed by Danny Smith - 2004-12-24 -*/ - -#include <math.h> -#include <complex.h> - -/* catanh (z) = -I * catan (I * z) */ - -float complex catanhf (float complex Z) -{ - float complex Tmp; - float complex Res; - - __real__ Tmp = - __imag__ Z; - __imag__ Tmp = __real__ Z; - Tmp = catanf (Tmp); - __real__ Res = __imag__ Tmp; - __imag__ Res = - __real__ Tmp; - return Res; -} diff --git a/winsup/mingw/mingwex/complex/catanhl.c b/winsup/mingw/mingwex/complex/catanhl.c deleted file mode 100755 index 50a3be950..000000000 --- a/winsup/mingw/mingwex/complex/catanhl.c +++ /dev/null @@ -1,23 +0,0 @@ -/* catanhl.c */ -/* - Contributed by Danny Smith - 2005-01-04 -*/ - -#include <math.h> -#include <complex.h> - -/* catanh (z) = -I * catan (I * z) */ - -long double complex catanhl (long double complex Z) -{ - long double complex Tmp; - long double complex Res; - - __real__ Tmp = - __imag__ Z; - __imag__ Tmp = __real__ Z; - Tmp = catanl (Tmp); - __real__ Res = __imag__ Tmp; - __imag__ Res = - __real__ Tmp; - return Res; -} diff --git a/winsup/mingw/mingwex/complex/catanl.c b/winsup/mingw/mingwex/complex/catanl.c deleted file mode 100755 index 1fd62685a..000000000 --- a/winsup/mingw/mingwex/complex/catanl.c +++ /dev/null @@ -1,53 +0,0 @@ -/* catanl.c */ - -/* - Contributed by Danny Smith - 2005-01-04 - - FIXME: This needs some serious numerical analysis. -*/ - -#include <math.h> -#include <complex.h> -#include <errno.h> - -/* catan (z) = -I/2 * clog ((I + z) / (I - z)) */ - -#ifndef _M_PI_2L -#define _M_PI_2L 1.5707963267948966192313L -#endif - -long double complex -catanl (long double complex Z) -{ - long double complex Res; - long double complex Tmp; - long double x = __real__ Z; - long double y = __imag__ Z; - - if ( x == 0.0L && (1.0L - fabsl (y)) == 0.0L) - { - errno = ERANGE; - __real__ Res = HUGE_VALL; - __imag__ Res = HUGE_VALL; - } - else if (isinf (hypotl (x, y))) - { - __real__ Res = (x > 0 ? _M_PI_2L : -_M_PI_2L); - __imag__ Res = 0.0L; - } - else - { - __real__ Tmp = - x; - __imag__ Tmp = 1.0L - y; - - __real__ Res = x; - __imag__ Res = y + 1.0L; - - Tmp = clogl (Res/Tmp); - __real__ Res = - 0.5L * __imag__ Tmp; - __imag__ Res = 0.5L * __real__ Tmp; - } - - return Res; -} diff --git a/winsup/mingw/mingwex/complex/ccos.c b/winsup/mingw/mingwex/complex/ccos.c deleted file mode 100644 index ef5b5a70e..000000000 --- a/winsup/mingw/mingwex/complex/ccos.c +++ /dev/null @@ -1,20 +0,0 @@ -/* - ccos.c - Contributed by Danny Smith - 2003-10-20 -*/ - -#include <math.h> -#include <complex.h> - -/* ccos (x + I * y) = cos (x) * cosh (y) - + I * (sin (x) * sinh (y)) */ - - -double complex ccos (double complex Z) -{ - double complex Res; - __real__ Res = cos (__real__ Z) * cosh ( __imag__ Z); - __imag__ Res = -sin (__real__ Z) * sinh ( __imag__ Z); - return Res; -} diff --git a/winsup/mingw/mingwex/complex/ccosf.c b/winsup/mingw/mingwex/complex/ccosf.c deleted file mode 100755 index 64a676455..000000000 --- a/winsup/mingw/mingwex/complex/ccosf.c +++ /dev/null @@ -1,20 +0,0 @@ -/* - ccosf.c - Contributed by Danny Smith - 2003-12-24 -*/ - -#include <math.h> -#include <complex.h> - -/* ccos (x + I * y) = cos (x) * cosh (y) - + I * (sin (x) * sinh (y)) */ - - -float complex ccosf (float complex Z) -{ - float complex Res; - __real__ Res = cosf (__real__ Z) * coshf ( __imag__ Z); - __imag__ Res = -sinf (__real__ Z) * sinhf ( __imag__ Z); - return Res; -} diff --git a/winsup/mingw/mingwex/complex/ccosh.c b/winsup/mingw/mingwex/complex/ccosh.c deleted file mode 100644 index 8d304fd0e..000000000 --- a/winsup/mingw/mingwex/complex/ccosh.c +++ /dev/null @@ -1,19 +0,0 @@ -/* - ccosh.c - Contributed by Danny Smith - 2003-10-20 -*/ - -#include <math.h> -#include <complex.h> - -/* ccosh (x + I * y) = cosh (x) * cos (y) - + I * (sinh (x) * sin (y)) */ - -double complex ccosh (double complex Z) -{ - double complex Res; - __real__ Res = cosh (__real__ Z) * cos (__imag__ Z); - __imag__ Res = sinh (__real__ Z) * sin (__imag__ Z); - return Res; -} diff --git a/winsup/mingw/mingwex/complex/ccoshf.c b/winsup/mingw/mingwex/complex/ccoshf.c deleted file mode 100755 index ce78cd62d..000000000 --- a/winsup/mingw/mingwex/complex/ccoshf.c +++ /dev/null @@ -1,19 +0,0 @@ -/* - ccoshf.c - Contributed by Danny Smith - 2004-12-24 -*/ - -#include <math.h> -#include <complex.h> - -/* ccosh (x + I * y) = cosh (x) * cos (y) - + I * (sinh (x) * sin (y)) */ - -float complex ccoshf (float complex Z) -{ - float complex Res; - __real__ Res = coshf (__real__ Z) * cosf (__imag__ Z); - __imag__ Res = sinhf (__real__ Z) * sinf (__imag__ Z); - return Res; -} diff --git a/winsup/mingw/mingwex/complex/ccoshl.c b/winsup/mingw/mingwex/complex/ccoshl.c deleted file mode 100755 index 0fb2526c7..000000000 --- a/winsup/mingw/mingwex/complex/ccoshl.c +++ /dev/null @@ -1,19 +0,0 @@ -/* - ccoshl.c - Contributed by Danny Smith - 2005-01-04 -*/ - -#include <math.h> -#include <complex.h> - -/* ccosh (x + I * y) = cosh (x) * cos (y) - + I * (sinh (x) * sin (y)) */ - -long double complex ccoshl (long double complex Z) -{ - long double complex Res; - __real__ Res = coshl (__real__ Z) * cosl (__imag__ Z); - __imag__ Res = sinhl (__real__ Z) * sinl (__imag__ Z); - return Res; -} diff --git a/winsup/mingw/mingwex/complex/ccosl.c b/winsup/mingw/mingwex/complex/ccosl.c deleted file mode 100755 index 981fdf0ea..000000000 --- a/winsup/mingw/mingwex/complex/ccosl.c +++ /dev/null @@ -1,20 +0,0 @@ -/* - ccosl.c - Contributed by Danny Smith - 2005-01-04 -*/ - -#include <math.h> -#include <complex.h> - -/* ccos (x + I * y) = cos (x) * cosh (y) - + I * (sin (x) * sinh (y)) */ - - -long double complex ccosl (long double complex Z) -{ - long double complex Res; - __real__ Res = cosl (__real__ Z) * coshl ( __imag__ Z); - __imag__ Res = -sinl (__real__ Z) * sinhl ( __imag__ Z); - return Res; -} diff --git a/winsup/mingw/mingwex/complex/cexp.c b/winsup/mingw/mingwex/complex/cexp.c deleted file mode 100644 index 43ac9ab9e..000000000 --- a/winsup/mingw/mingwex/complex/cexp.c +++ /dev/null @@ -1,19 +0,0 @@ -/* - cexp.c - Contributed by Danny Smith - 2003-10-20 -*/ - -#include <math.h> -#include <complex.h> - -/* cexp (x + I * y) = exp (x) * cos (y) + I * exp (x) * sin (y) */ - -double complex cexp (double complex Z) -{ - double complex Res; - long double rho = exp (__real__ Z); - __real__ Res = rho * cos(__imag__ Z); - __imag__ Res = rho * sin(__imag__ Z); - return Res; -} diff --git a/winsup/mingw/mingwex/complex/cexpf.c b/winsup/mingw/mingwex/complex/cexpf.c deleted file mode 100755 index fabb1a0cb..000000000 --- a/winsup/mingw/mingwex/complex/cexpf.c +++ /dev/null @@ -1,19 +0,0 @@ -/* - cexpf.c - Contributed by Danny Smith - 2004-12-24 -*/ - -#include <math.h> -#include <complex.h> - -/* cexp (x + I * y) = exp (x) * cos (y) + I * exp (x) * sin (y) */ - -float complex cexpf (float complex Z) -{ - float complex Res; - double rho = exp (__real__ Z); - __real__ Res = rho * cosf(__imag__ Z); - __imag__ Res = rho * sinf(__imag__ Z); - return Res; -} diff --git a/winsup/mingw/mingwex/complex/cexpl.c b/winsup/mingw/mingwex/complex/cexpl.c deleted file mode 100755 index 9f2ed2676..000000000 --- a/winsup/mingw/mingwex/complex/cexpl.c +++ /dev/null @@ -1,19 +0,0 @@ -/* - cexpl.c - Contributed by Danny Smith - 2005-01-04 -*/ - -#include <math.h> -#include <complex.h> - -/* cexp (x + I * y) = exp (x) * cos (y) + I * exp (x) * sin (y) */ - -long double complex cexpl (long double complex Z) -{ - long double complex Res; - long double rho = expl (__real__ Z); - __real__ Res = rho * cosl(__imag__ Z); - __imag__ Res = rho * sinl(__imag__ Z); - return Res; -} diff --git a/winsup/mingw/mingwex/complex/cimag.c b/winsup/mingw/mingwex/complex/cimag.c deleted file mode 100644 index b6b32561c..000000000 --- a/winsup/mingw/mingwex/complex/cimag.c +++ /dev/null @@ -1,6 +0,0 @@ -#include <complex.h> -double __attribute__ ((const)) cimag (double complex _Z) -{ - return __imag__ _Z; -} - diff --git a/winsup/mingw/mingwex/complex/cimagf.c b/winsup/mingw/mingwex/complex/cimagf.c deleted file mode 100755 index f77b9ec54..000000000 --- a/winsup/mingw/mingwex/complex/cimagf.c +++ /dev/null @@ -1,6 +0,0 @@ -#include <complex.h> -float __attribute__ ((const)) cimagf (float complex _Z) -{ - return __imag__ _Z; -} - diff --git a/winsup/mingw/mingwex/complex/cimagl.c b/winsup/mingw/mingwex/complex/cimagl.c deleted file mode 100755 index 9b023b49b..000000000 --- a/winsup/mingw/mingwex/complex/cimagl.c +++ /dev/null @@ -1,5 +0,0 @@ -#include <complex.h> -long double __attribute__ ((const)) cimagl (long double complex _Z) -{ - return __imag__ _Z; -} diff --git a/winsup/mingw/mingwex/complex/clog.c b/winsup/mingw/mingwex/complex/clog.c deleted file mode 100644 index 57c51ebb0..000000000 --- a/winsup/mingw/mingwex/complex/clog.c +++ /dev/null @@ -1,19 +0,0 @@ -/* - clog.c - Contributed by Danny Smith - 2003-10-20 -*/ - -/* clog (x + I * y) = log (hypot (x, y)) + I * atan2 (y, x) */ - -#include <math.h> -#include <complex.h> - -double complex clog (double complex Z) -{ - double complex Res; - __real__ Res = log (_hypot (__real__ Z, __imag__ Z)); - __imag__ Res = carg (Z); - return Res; -} - diff --git a/winsup/mingw/mingwex/complex/clogf.c b/winsup/mingw/mingwex/complex/clogf.c deleted file mode 100755 index ead76025f..000000000 --- a/winsup/mingw/mingwex/complex/clogf.c +++ /dev/null @@ -1,19 +0,0 @@ -/* - clogf.c - Contributed by Danny Smith - 2004-12-24 -*/ - -/* clog (x + I * y) = log (hypot (x, y)) + I * atan2 (y, x) */ - -#include <math.h> -#include <complex.h> - -float complex clogf (float complex Z) -{ - float complex Res; - __real__ Res = logf (_hypot (__real__ Z, __imag__ Z)); - __imag__ Res = cargf (Z); - return Res; -} - diff --git a/winsup/mingw/mingwex/complex/clogl.c b/winsup/mingw/mingwex/complex/clogl.c deleted file mode 100755 index 0114c91f6..000000000 --- a/winsup/mingw/mingwex/complex/clogl.c +++ /dev/null @@ -1,19 +0,0 @@ -/* - clogl.c - Contributed by Danny Smith - 2005-01-04 -*/ - -/* clog (x + I * y) = log (hypot (x, y)) + I * atan2 (y, x) */ - -#include <math.h> -#include <complex.h> - -long double complex clogl (long double complex Z) -{ - long double complex Res; - __real__ Res = logl (hypotl (__real__ Z, __imag__ Z)); - __imag__ Res = cargl (Z); - return Res; -} - diff --git a/winsup/mingw/mingwex/complex/cpow.c b/winsup/mingw/mingwex/complex/cpow.c deleted file mode 100644 index c12b12fc0..000000000 --- a/winsup/mingw/mingwex/complex/cpow.c +++ /dev/null @@ -1,48 +0,0 @@ -/* cpow.c */ -/* - Contributed by Danny Smith - 2003-10-20 -*/ - -/* cpow(X, Y) = cexp(X * clog(Y)) */ - -#include <math.h> -#include <complex.h> - -/* Use dll version of pow */ -extern double (*_imp__pow) (double, double); -#define pow (*_imp__pow) - -double complex cpow (double complex X, double complex Y) -{ - double complex Res; - double i; - double r = hypot (__real__ X, __imag__ X); - if (r == 0.0) - { - __real__ Res = __imag__ Res = 0.0; - } - else - { - double rho; - double theta; - i = carg (X); - theta = i * __real__ Y; - - if (__imag__ Y == 0.0) - /* This gives slightly more accurate results in these cases. */ - rho = pow (r, __real__ Y); - else - { - r = log (r); - /* rearrangement of cexp(X * clog(Y)) */ - theta += r * __imag__ Y; - rho = exp (r * __real__ Y - i * __imag__ Y); - } - - __real__ Res = rho * cos (theta); - __imag__ Res = rho * sin (theta); - } - return Res; -} - diff --git a/winsup/mingw/mingwex/complex/cpowf.c b/winsup/mingw/mingwex/complex/cpowf.c deleted file mode 100755 index eeeed1b7f..000000000 --- a/winsup/mingw/mingwex/complex/cpowf.c +++ /dev/null @@ -1,43 +0,0 @@ -/* cpowf.c */ -/* - Contributed by Danny Smith - 2004-12-24 -*/ - -/* cpow(X, Y) = cexp(X * clog(Y)) */ - -#include <math.h> -#include <complex.h> - -float complex cpowf (float complex X, float complex Y) -{ - float complex Res; - float i; - float r = _hypot (__real__ X, __imag__ X); - if (r == 0.0f) - { - __real__ Res = __imag__ Res = 0.0; - } - else - { - float rho; - float theta; - i = cargf (X); - theta = i * __real__ Y; - - if (__imag__ Y == 0.0f) - /* This gives slightly more accurate results in these cases. */ - rho = powf (r, __real__ Y); - else - { - r = logf (r); - /* rearrangement of cexp(X * clog(Y)) */ - theta += r * __imag__ Y; - rho = expf (r * __real__ Y - i * __imag__ Y); - } - - __real__ Res = rho * cosf (theta); - __imag__ Res = rho * sinf (theta); - } - return Res; -} diff --git a/winsup/mingw/mingwex/complex/cpowl.c b/winsup/mingw/mingwex/complex/cpowl.c deleted file mode 100755 index c614a6d59..000000000 --- a/winsup/mingw/mingwex/complex/cpowl.c +++ /dev/null @@ -1,43 +0,0 @@ -/* cpowl.c */ -/* - Contributed by Danny Smith - 2005-01-04 -*/ - -/* cpow(X, Y) = cexp(X * clog(Y)) */ - -#include <math.h> -#include <complex.h> - -long double complex cpowl (long double complex X, long double complex Y) -{ - long double complex Res; - long double i; - long double r = hypotl (__real__ X, __imag__ X); - if (r == 0.0L) - { - __real__ Res = __imag__ Res = 0.0L; - } - else - { - long double rho; - long double theta; - i = cargl (X); - theta = i * __real__ Y; - - if (__imag__ Y == 0.0L) - /* This gives slightly more accurate results in these cases. */ - rho = powl (r, __real__ Y); - else - { - r = logl (r); - /* rearrangement of cexp(X * clog(Y)) */ - theta += r * __imag__ Y; - rho = expl (r * __real__ Y - i * __imag__ Y); - } - - __real__ Res = rho * cosl (theta); - __imag__ Res = rho * sinl (theta); - } - return Res; -} diff --git a/winsup/mingw/mingwex/complex/cproj.c b/winsup/mingw/mingwex/complex/cproj.c deleted file mode 100644 index cc7c48d0f..000000000 --- a/winsup/mingw/mingwex/complex/cproj.c +++ /dev/null @@ -1,22 +0,0 @@ -/* - cproj.c - Contributed by Danny Smith - 2003-10-20 -*/ - -#include <math.h> -#include <complex.h> - -/* Return the value of the projection onto the Riemann sphere.*/ - -double complex cproj (double complex Z) -{ - complex double Res = Z; - if (isinf (__real__ Z) || isinf (__imag__ Z)) - { - __real__ Res = HUGE_VAL; - __imag__ Res = copysign (0.0, __imag__ Z); - } - return Res; -} - diff --git a/winsup/mingw/mingwex/complex/cprojf.c b/winsup/mingw/mingwex/complex/cprojf.c deleted file mode 100755 index f1d2d730a..000000000 --- a/winsup/mingw/mingwex/complex/cprojf.c +++ /dev/null @@ -1,22 +0,0 @@ -/* - cprojf.c - Contributed by Danny Smith - 2004-12-24 -*/ - -#include <math.h> -#include <complex.h> - -/* Return the value of the projection onto the Riemann sphere.*/ - -float complex cprojf (float complex Z) -{ - complex float Res = Z; - if (isinf (__real__ Z) || isinf (__imag__ Z)) - { - __real__ Res = HUGE_VALF; - __imag__ Res = copysignf (0.0f, __imag__ Z); - } - return Res; -} - diff --git a/winsup/mingw/mingwex/complex/cprojl.c b/winsup/mingw/mingwex/complex/cprojl.c deleted file mode 100755 index 224d26fd6..000000000 --- a/winsup/mingw/mingwex/complex/cprojl.c +++ /dev/null @@ -1,22 +0,0 @@ -/* - cprojl.c - Contributed by Danny Smith - 2005-01-04 -*/ - -#include <math.h> -#include <complex.h> - -/* Return the value of the projection onto the Riemann sphere.*/ - -long double complex cprojl (long double complex Z) -{ - complex long double Res = Z; - if (isinf (__real__ Z) || isinf (__imag__ Z)) - { - __real__ Res = HUGE_VALL; - __imag__ Res = copysignl (0.0L, __imag__ Z); - } - return Res; -} - diff --git a/winsup/mingw/mingwex/complex/creal.c b/winsup/mingw/mingwex/complex/creal.c deleted file mode 100644 index 6905b7e2a..000000000 --- a/winsup/mingw/mingwex/complex/creal.c +++ /dev/null @@ -1,6 +0,0 @@ -#include <complex.h> -double __attribute__ ((const)) creal (double complex _Z) -{ - return __real__ _Z; -} - diff --git a/winsup/mingw/mingwex/complex/crealf.c b/winsup/mingw/mingwex/complex/crealf.c deleted file mode 100755 index 16dc7ec46..000000000 --- a/winsup/mingw/mingwex/complex/crealf.c +++ /dev/null @@ -1,6 +0,0 @@ -#include <complex.h> -float __attribute__ ((const)) crealf (float complex _Z) -{ - return __real__ _Z; -} - diff --git a/winsup/mingw/mingwex/complex/creall.c b/winsup/mingw/mingwex/complex/creall.c deleted file mode 100755 index 62470d961..000000000 --- a/winsup/mingw/mingwex/complex/creall.c +++ /dev/null @@ -1,5 +0,0 @@ -#include <complex.h> -long double __attribute__ ((const)) creall (long double complex _Z) -{ - return __real__ _Z; -} diff --git a/winsup/mingw/mingwex/complex/csin.c b/winsup/mingw/mingwex/complex/csin.c deleted file mode 100644 index 37df8057e..000000000 --- a/winsup/mingw/mingwex/complex/csin.c +++ /dev/null @@ -1,21 +0,0 @@ -/* csin.c */ - -/* - Contributed by Danny Smith - 2003-10-20 -*/ - -#include <math.h> -#include <complex.h> - -/* csin (x + I * y) = sin (x) * cosh (y) - + I * (cos (x) * sinh (y)) */ - -double complex csin (double complex Z) -{ - double complex Res; - __real__ Res = sin (__real__ Z) * cosh ( __imag__ Z); - __imag__ Res = cos (__real__ Z) * sinh ( __imag__ Z); - return Res; -} - diff --git a/winsup/mingw/mingwex/complex/csinf.c b/winsup/mingw/mingwex/complex/csinf.c deleted file mode 100755 index def23f27e..000000000 --- a/winsup/mingw/mingwex/complex/csinf.c +++ /dev/null @@ -1,21 +0,0 @@ -/* csinf.c */ - -/* - Contributed by Danny Smith - 2004-12-24 -*/ - -#include <math.h> -#include <complex.h> - -/* csin (x + I * y) = sin (x) * cosh (y) - + I * (cos (x) * sinh (y)) */ - -float complex csinf (float complex Z) -{ - float complex Res; - __real__ Res = sinf (__real__ Z) * coshf ( __imag__ Z); - __imag__ Res = cosf (__real__ Z) * sinhf ( __imag__ Z); - return Res; -} - diff --git a/winsup/mingw/mingwex/complex/csinh.c b/winsup/mingw/mingwex/complex/csinh.c deleted file mode 100644 index 4ee6cbe86..000000000 --- a/winsup/mingw/mingwex/complex/csinh.c +++ /dev/null @@ -1,21 +0,0 @@ -/* csinh.c */ -/* - Contributed by Danny Smith - 2003-10-20 -*/ - - -#include <math.h> -#include <complex.h> - -/* csinh (x + I * y) = sinh (x) * cos (y) - + I * (cosh (x) * sin (y)) */ - - -double complex csinh (double complex Z) -{ - double complex Res; - __real__ Res = sinh (__real__ Z) * cos (__imag__ Z); - __imag__ Res = cosh (__real__ Z) * sin (__imag__ Z); - return Res; -} diff --git a/winsup/mingw/mingwex/complex/csinhf.c b/winsup/mingw/mingwex/complex/csinhf.c deleted file mode 100755 index b0d008ed7..000000000 --- a/winsup/mingw/mingwex/complex/csinhf.c +++ /dev/null @@ -1,21 +0,0 @@ -/* csinhf.c */ -/* - Contributed by Danny Smith - 2004-12-24 -*/ - - -#include <math.h> -#include <complex.h> - -/* csinh (x + I * y) = sinh (x) * cos (y) - + I * (cosh (x) * sin (y)) */ - - -float complex csinhf (float complex Z) -{ - float complex Res; - __real__ Res = sinhf (__real__ Z) * cosf (__imag__ Z); - __imag__ Res = coshf (__real__ Z) * sinf (__imag__ Z); - return Res; -} diff --git a/winsup/mingw/mingwex/complex/csinhl.c b/winsup/mingw/mingwex/complex/csinhl.c deleted file mode 100755 index 187ccf0f6..000000000 --- a/winsup/mingw/mingwex/complex/csinhl.c +++ /dev/null @@ -1,20 +0,0 @@ -/* csinhl.c */ -/* - Contributed by Danny Smith - 2005-01-04 -*/ - -#include <math.h> -#include <complex.h> - -/* csinh (x + I * y) = sinh (x) * cos (y) - + I * (cosh (x) * sin (y)) */ - - -long double complex csinhl (long double complex Z) -{ - long double complex Res; - __real__ Res = sinhl (__real__ Z) * cosl (__imag__ Z); - __imag__ Res = coshl (__real__ Z) * sinl (__imag__ Z); - return Res; -} diff --git a/winsup/mingw/mingwex/complex/csinl.c b/winsup/mingw/mingwex/complex/csinl.c deleted file mode 100755 index 2a98c7c0f..000000000 --- a/winsup/mingw/mingwex/complex/csinl.c +++ /dev/null @@ -1,21 +0,0 @@ -/* csinl.c */ - -/* - Contributed by Danny Smith - 2005-01-04 -*/ - -#include <math.h> -#include <complex.h> - -/* csin (x + I * y) = sin (x) * cosh (y) - + I * (cos (x) * sinh (y)) */ - -long double complex csinl (long double complex Z) -{ - long double complex Res; - __real__ Res = sinl (__real__ Z) * coshl ( __imag__ Z); - __imag__ Res = cosl (__real__ Z) * sinhl ( __imag__ Z); - return Res; -} - diff --git a/winsup/mingw/mingwex/complex/csqrt.c b/winsup/mingw/mingwex/complex/csqrt.c deleted file mode 100644 index b5f8868e9..000000000 --- a/winsup/mingw/mingwex/complex/csqrt.c +++ /dev/null @@ -1,56 +0,0 @@ -/* - csqrt.c - Contributed by Danny Smith - 2003-10-20 -*/ - -#include <math.h> -#include <complex.h> - -double complex csqrt (double complex Z) -{ - double complex Res; - double t; - double x = __real__ Z; - double y = __imag__ Z; - - if (y == 0.0) - { - if (x < 0.0) - { - __real__ Res = 0.0; - __imag__ Res = sqrt (-x); - } - else - { - __real__ Res = sqrt (x); - __imag__ Res = 0.0; - } - } - - else if (x == 0.0) - { - t = sqrt(0.5 * fabs (y)); - __real__ Res = t; - __imag__ Res = y > 0 ? t : -t; - } - - else - { - t = sqrt (2.0 * (_hypot (x, y) + fabs (x))); - double u = t / 2.0; - if ( x > 0.0) - { - __real__ Res = u; - __imag__ Res = y / t; - } - else - { - __real__ Res = fabs ( y / t); - __imag__ Res = y < 0.0 ? -u : u; - } - } - - return Res; -} - diff --git a/winsup/mingw/mingwex/complex/csqrtf.c b/winsup/mingw/mingwex/complex/csqrtf.c deleted file mode 100755 index 7c37e99ce..000000000 --- a/winsup/mingw/mingwex/complex/csqrtf.c +++ /dev/null @@ -1,49 +0,0 @@ -#include <math.h> -#include <complex.h> - -float complex csqrtf (float complex Z) -{ - float complex Res; - float r; - float x = __real__ Z; - float y = __imag__ Z; - - if (y == 0.0f) - { - if (x < 0.0f) - { - __real__ Res = 0.0f; - __imag__ Res = sqrtf (-x); - } - else - { - __real__ Res = sqrtf (x); - __imag__ Res = 0.0f; - } - } - - else if (x == 0.0f) - { - r = sqrtf(0.5f * fabsf (y)); - __real__ Res = r; - __imag__ Res = y > 0 ? r : -r; - } - - else - { - float t = sqrtf (2 * (_hypot (__real__ Z, __imag__ Z) + fabsf (x))); - float u = t / 2.0f; - if ( x > 0.0f) - { - __real__ Res = u; - __imag__ Res = y / t; - } - else - { - __real__ Res = fabsf (y / t); - __imag__ Res = y < 0 ? -u : u; - } - } - - return Res; -} diff --git a/winsup/mingw/mingwex/complex/csqrtl.c b/winsup/mingw/mingwex/complex/csqrtl.c deleted file mode 100755 index 1b2ebbe5b..000000000 --- a/winsup/mingw/mingwex/complex/csqrtl.c +++ /dev/null @@ -1,55 +0,0 @@ -/* csqrtl.c */ -/* - Contributed by Danny Smith - 2005-01-04 -*/ - -#include <math.h> -#include <complex.h> - -long double complex csqrtl (long double complex Z) -{ - long double complex Res; - long double r; - long double x = __real__ Z; - long double y = __imag__ Z; - - if (y == 0.0L) - { - if (x < 0.0L) - { - __real__ Res = 0.0L; - __imag__ Res = sqrtl (-x); - } - else - { - __real__ Res = sqrtl (x); - __imag__ Res = 0.0L; - } - } - - else if (x == 0.0L) - { - r = sqrtl(0.5L * fabsl (y)); - __real__ Res = r; - __imag__ Res = y > 0 ? r : -r; - } - - else - { - long double t = sqrtl (2.0L * (hypotl (__real__ Z, __imag__ Z) + fabsl (x))); - long double u = t / 2.0L; - if ( x > 0.0L) - { - __real__ Res = u; - __imag__ Res = y / t; - } - else - { - __real__ Res = fabsl (y / t); - __imag__ Res = y < 0 ? -u : u; - } - } - - return Res; -} diff --git a/winsup/mingw/mingwex/complex/ctan.c b/winsup/mingw/mingwex/complex/ctan.c deleted file mode 100644 index a479772a9..000000000 --- a/winsup/mingw/mingwex/complex/ctan.c +++ /dev/null @@ -1,41 +0,0 @@ -/* ctan.c */ - -/* - Contributed by Danny Smith - 2003-10-20 -*/ - -#include <math.h> -#include <complex.h> -#include <errno.h> - - -/* ctan (x + I * y) = (sin (2 * x) + I * sinh(2 * y)) - / (cos (2 * x) + cosh (2 * y)) */ - -double complex ctan (double complex Z) -{ - double complex Res; - double two_I = 2.0 * __imag__ Z; - double two_R = 2.0 * __real__ Z; - double denom = cos (two_R) + cosh (two_I); - if (denom == 0.0) - { - errno = ERANGE; - __real__ Res = HUGE_VAL; - __imag__ Res = HUGE_VAL; - } - else if (isinf (denom)) - { - errno = ERANGE; - __real__ Res = 0.0; - __imag__ Res = two_I > 0 ? 1.0 : -1.0; - } - else - { - __real__ Res = sin (two_R) / denom; - __imag__ Res = sinh (two_I) / denom; - } - return Res; -} - diff --git a/winsup/mingw/mingwex/complex/ctanf.c b/winsup/mingw/mingwex/complex/ctanf.c deleted file mode 100755 index 99699e427..000000000 --- a/winsup/mingw/mingwex/complex/ctanf.c +++ /dev/null @@ -1,41 +0,0 @@ -/* ctanf.c */ - -/* - Contributed by Danny Smith - 2004-12-24 -*/ - -#include <math.h> -#include <complex.h> -#include <errno.h> - - -/* ctan (x + I * y) = (sin (2 * x) + I * sinh(2 * y)) - / (cos (2 * x) + cosh (2 * y)) */ - -float complex ctanf (float complex Z) -{ - float complex Res; - float two_I = 2.0f * __imag__ Z; - float two_R = 2.0f * __real__ Z; - float denom = cosf (two_R) + coshf (two_I); - if (denom == 0.0f) - { - errno = ERANGE; - __real__ Res = HUGE_VALF; - __imag__ Res = HUGE_VALF; - } - else if (isinf (denom)) - { - errno = ERANGE; - __real__ Res = 0.0; - __imag__ Res = two_I > 0 ? 1.0f : -1.0f; - } - else - { - __real__ Res = sinf (two_R) / denom; - __imag__ Res = sinhf (two_I) / denom; - } - return Res; -} - diff --git a/winsup/mingw/mingwex/complex/ctanh.c b/winsup/mingw/mingwex/complex/ctanh.c deleted file mode 100644 index 6d3e615da..000000000 --- a/winsup/mingw/mingwex/complex/ctanh.c +++ /dev/null @@ -1,44 +0,0 @@ -/* ctanh.c */ - -/* - Contributed by Danny Smith - 2003-10-20 -*/ - - -#include <math.h> -#include <complex.h> -#include <errno.h> - -/* - ctanh (x + I * y) = (sinh (2 * x) + sin (2 * y) * I ) - / (cosh (2 * x) + cos (2 * y)) . -*/ - -double complex -ctanh (double complex Z) -{ - double complex Res; - double two_R = 2.0 * __real__ Z; - double two_I = 2.0 * __imag__ Z; - double denom = cosh (two_R) + cos (two_I); - - if (denom == 0.0) - { - errno = ERANGE; - __real__ Res = HUGE_VAL; - __imag__ Res = HUGE_VAL; - } - else if ( isinf (denom)) - { - errno = ERANGE; - __real__ Res = two_R > 0 ? 1.0 : -1.0; - __imag__ Res = 0.0; - } - else - { - __real__ Res = sinh (two_R) / denom; - __imag__ Res = sin (two_I) / denom; - } - return Res; -} diff --git a/winsup/mingw/mingwex/complex/ctanhf.c b/winsup/mingw/mingwex/complex/ctanhf.c deleted file mode 100755 index 82a9c9a43..000000000 --- a/winsup/mingw/mingwex/complex/ctanhf.c +++ /dev/null @@ -1,44 +0,0 @@ -/* ctanhf.c */ - -/* - Contributed by Danny Smith - 2004-12-24 -*/ - - -#include <math.h> -#include <complex.h> -#include <errno.h> - -/* - ctanh (x + I * y) = (sinh (2 * x) + sin (2 * y) * I ) - / (cosh (2 * x) + cos (2 * y)) . -*/ - -float complex -ctanhf (float complex Z) -{ - float complex Res; - float two_R = 2.0f * __real__ Z; - float two_I = 2.0f * __imag__ Z; - float denom = coshf (two_R) + cosf (two_I); - - if (denom == 0.0f) - { - errno = ERANGE; - __real__ Res = HUGE_VALF; - __imag__ Res = HUGE_VALF; - } - else if (isinf (denom)) - { - errno = ERANGE; - __real__ Res = two_R > 0 ? 1.0f : -1.0f; - __imag__ Res = 0.0f; - } - else - { - __real__ Res = sinhf (two_R) / denom; - __imag__ Res = sinf (two_I) / denom; - } - return Res; -} diff --git a/winsup/mingw/mingwex/complex/ctanhl.c b/winsup/mingw/mingwex/complex/ctanhl.c deleted file mode 100755 index 050b636a1..000000000 --- a/winsup/mingw/mingwex/complex/ctanhl.c +++ /dev/null @@ -1,44 +0,0 @@ -/* ctanhl.c */ - -/* - Contributed by Danny Smith - 2005-01-04 -*/ - - -#include <math.h> -#include <complex.h> -#include <errno.h> - -/* - ctanh (x + I * y) = (sinh (2 * x) + sin (2 * y) * I ) - / (cosh (2 * x) + cos (2 * y)) . -*/ - -long double complex -ctanhl (long double complex Z) -{ - long double complex Res; - long double two_R = 2.0L * __real__ Z; - long double two_I = 2.0L * __imag__ Z; - long double denom = coshl (two_R) + cosl (two_I); - - if (denom == 0.0L) - { - errno = ERANGE; - __real__ Res = HUGE_VALL; - __imag__ Res = HUGE_VALL; - } - else if (isinf (denom)) - { - errno = ERANGE; - __real__ Res = two_R > 0 ? 1.0L : -1.0L; - __imag__ Res = 0.0L; - } - else - { - __real__ Res = sinhl (two_R) / denom; - __imag__ Res = sinl (two_I) / denom; - } - return Res; -} diff --git a/winsup/mingw/mingwex/complex/ctanl.c b/winsup/mingw/mingwex/complex/ctanl.c deleted file mode 100755 index 7d3076159..000000000 --- a/winsup/mingw/mingwex/complex/ctanl.c +++ /dev/null @@ -1,41 +0,0 @@ -/* ctanl.c */ - -/* - Contributed by Danny Smith - 2005-01-04 -*/ - -#include <math.h> -#include <complex.h> -#include <errno.h> - - -/* ctan (x + I * y) = (sin (2 * x) + I * sinh(2 * y)) - / (cos (2 * x) + cosh (2 * y)) */ - -long double complex ctanl (long double complex Z) -{ - long double complex Res; - long double two_I = 2.0L * __imag__ Z; - long double two_R = 2.0L * __real__ Z; - long double denom = cosl (two_R) + coshl (two_I); - if (denom == 0.0L) - { - errno = ERANGE; - __real__ Res = HUGE_VALL; - __imag__ Res = HUGE_VALL; - } - else if (isinf (denom)) - { - errno = ERANGE; - __real__ Res = 0.0; - __imag__ Res = two_I > 0 ? 1.0L : -1.0L; - } - else - { - __real__ Res = sinl (two_R) / denom; - __imag__ Res = sinhl (two_I) / denom; - } - return Res; -} - diff --git a/winsup/mingw/mingwex/configure b/winsup/mingw/mingwex/configure deleted file mode 100755 index 0e2195ee9..000000000 --- a/winsup/mingw/mingwex/configure +++ /dev/null @@ -1,3127 +0,0 @@ -#! /bin/sh -# Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.63. -# -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -# 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. -# This configure script is free software; the Free Software Foundation -# gives unlimited permission to copy, distribute and modify it. -## --------------------- ## -## M4sh Initialization. ## -## --------------------- ## - -# Be more Bourne compatible -DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in - *posix*) set -o posix ;; -esac - -fi - - - - -# PATH needs CR -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits - -as_nl=' -' -export as_nl -# Printing a long string crashes Solaris 7 /usr/bin/printf. -as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo -if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='printf %s\n' - as_echo_n='printf %s' -else - if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then - as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' - as_echo_n='/usr/ucb/echo -n' - else - as_echo_body='eval expr "X$1" : "X\\(.*\\)"' - as_echo_n_body='eval - arg=$1; - case $arg in - *"$as_nl"*) - expr "X$arg" : "X\\(.*\\)$as_nl"; - arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; - esac; - expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" - ' - export as_echo_n_body - as_echo_n='sh -c $as_echo_n_body as_echo' - fi - export as_echo_body - as_echo='sh -c $as_echo_body as_echo' -fi - -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - PATH_SEPARATOR=: - (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { - (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || - PATH_SEPARATOR=';' - } -fi - -# Support unset when possible. -if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then - as_unset=unset -else - as_unset=false -fi - - -# IFS -# We need space, tab and new line, in precisely that order. Quoting is -# there to prevent editors from complaining about space-tab. -# (If _AS_PATH_WALK were called with IFS unset, it would disable word -# splitting by setting IFS to empty value.) -IFS=" "" $as_nl" - -# Find who we are. Look in the path if we contain no directory separator. -case $0 in - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break -done -IFS=$as_save_IFS - - ;; -esac -# We did not find ourselves, most probably we were run as `sh COMMAND' -# in which case we are not to be found in the path. -if test "x$as_myself" = x; then - as_myself=$0 -fi -if test ! -f "$as_myself"; then - $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 - { (exit 1); exit 1; } -fi - -# Work around bugs in pre-3.0 UWIN ksh. -for as_var in ENV MAIL MAILPATH -do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var -done -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -LC_ALL=C -export LC_ALL -LANGUAGE=C -export LANGUAGE - -# Required to use basename. -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi - -if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then - as_basename=basename -else - as_basename=false -fi - - -# Name of the executable. -as_me=`$as_basename -- "$0" || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ - s//\1/ - q - } - /^X\/\(\/\/\)$/{ - s//\1/ - q - } - /^X\/\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - -# CDPATH. -$as_unset CDPATH - - -if test "x$CONFIG_SHELL" = x; then - if (eval ":") 2>/dev/null; then - as_have_required=yes -else - as_have_required=no -fi - - if test $as_have_required = yes && (eval ": -(as_func_return () { - (exit \$1) -} -as_func_success () { - as_func_return 0 -} -as_func_failure () { - as_func_return 1 -} -as_func_ret_success () { - return 0 -} -as_func_ret_failure () { - return 1 -} - -exitcode=0 -if as_func_success; then - : -else - exitcode=1 - echo as_func_success failed. -fi - -if as_func_failure; then - exitcode=1 - echo as_func_failure succeeded. -fi - -if as_func_ret_success; then - : -else - exitcode=1 - echo as_func_ret_success failed. -fi - -if as_func_ret_failure; then - exitcode=1 - echo as_func_ret_failure succeeded. -fi - -if ( set x; as_func_ret_success y && test x = \"\$1\" ); then - : -else - exitcode=1 - echo positional parameters were not saved. -fi - -test \$exitcode = 0) || { (exit 1); exit 1; } - -( - as_lineno_1=\$LINENO - as_lineno_2=\$LINENO - test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && - test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } -") 2> /dev/null; then - : -else - as_candidate_shells= - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - case $as_dir in - /*) - for as_base in sh bash ksh sh5; do - as_candidate_shells="$as_candidate_shells $as_dir/$as_base" - done;; - esac -done -IFS=$as_save_IFS - - - for as_shell in $as_candidate_shells $SHELL; do - # Try only shells that exist, to save several forks. - if { test -f "$as_shell" || test -f "$as_shell.exe"; } && - { ("$as_shell") 2> /dev/null <<\_ASEOF -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in - *posix*) set -o posix ;; -esac - -fi - - -: -_ASEOF -}; then - CONFIG_SHELL=$as_shell - as_have_required=yes - if { "$as_shell" 2> /dev/null <<\_ASEOF -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in - *posix*) set -o posix ;; -esac - -fi - - -: -(as_func_return () { - (exit $1) -} -as_func_success () { - as_func_return 0 -} -as_func_failure () { - as_func_return 1 -} -as_func_ret_success () { - return 0 -} -as_func_ret_failure () { - return 1 -} - -exitcode=0 -if as_func_success; then - : -else - exitcode=1 - echo as_func_success failed. -fi - -if as_func_failure; then - exitcode=1 - echo as_func_failure succeeded. -fi - -if as_func_ret_success; then - : -else - exitcode=1 - echo as_func_ret_success failed. -fi - -if as_func_ret_failure; then - exitcode=1 - echo as_func_ret_failure succeeded. -fi - -if ( set x; as_func_ret_success y && test x = "$1" ); then - : -else - exitcode=1 - echo positional parameters were not saved. -fi - -test $exitcode = 0) || { (exit 1); exit 1; } - -( - as_lineno_1=$LINENO - as_lineno_2=$LINENO - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } - -_ASEOF -}; then - break -fi - -fi - - done - - if test "x$CONFIG_SHELL" != x; then - for as_var in BASH_ENV ENV - do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var - done - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} -fi - - - if test $as_have_required = no; then - echo This script requires a shell more modern than all the - echo shells that I found on your system. Please install a - echo modern shell, or manually run the script under such a - echo shell if you do have one. - { (exit 1); exit 1; } -fi - - -fi - -fi - - - -(eval "as_func_return () { - (exit \$1) -} -as_func_success () { - as_func_return 0 -} -as_func_failure () { - as_func_return 1 -} -as_func_ret_success () { - return 0 -} -as_func_ret_failure () { - return 1 -} - -exitcode=0 -if as_func_success; then - : -else - exitcode=1 - echo as_func_success failed. -fi - -if as_func_failure; then - exitcode=1 - echo as_func_failure succeeded. -fi - -if as_func_ret_success; then - : -else - exitcode=1 - echo as_func_ret_success failed. -fi - -if as_func_ret_failure; then - exitcode=1 - echo as_func_ret_failure succeeded. -fi - -if ( set x; as_func_ret_success y && test x = \"\$1\" ); then - : -else - exitcode=1 - echo positional parameters were not saved. -fi - -test \$exitcode = 0") || { - echo No shell found that supports shell functions. - echo Please tell bug-autoconf@gnu.org about your system, - echo including any error possibly output before this message. - echo This can help us improve future autoconf versions. - echo Configuration will now proceed without shell functions. -} - - - - as_lineno_1=$LINENO - as_lineno_2=$LINENO - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { - - # Create $as_me.lineno as a copy of $as_myself, but with $LINENO - # uniformly replaced by the line number. The first 'sed' inserts a - # line-number line after each line using $LINENO; the second 'sed' - # does the real work. The second script uses 'N' to pair each - # line-number line with the line containing $LINENO, and appends - # trailing '-' during substitution so that $LINENO is not a special - # case at line end. - # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the - # scripts with optimization help from Paolo Bonzini. Blame Lee - # E. McMahon (1931-1989) for sed's syntax. :-) - sed -n ' - p - /[$]LINENO/= - ' <$as_myself | - sed ' - s/[$]LINENO.*/&-/ - t lineno - b - :lineno - N - :loop - s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ - t loop - s/-\n.*// - ' >$as_me.lineno && - chmod +x "$as_me.lineno" || - { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 - { (exit 1); exit 1; }; } - - # Don't try to exec as it changes $[0], causing all sort of problems - # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensitive to this). - . "./$as_me.lineno" - # Exit status is that of the last command. - exit -} - - -if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then - as_dirname=dirname -else - as_dirname=false -fi - -ECHO_C= ECHO_N= ECHO_T= -case `echo -n x` in --n*) - case `echo 'x\c'` in - *c*) ECHO_T=' ';; # ECHO_T is single tab character. - *) ECHO_C='\c';; - esac;; -*) - ECHO_N='-n';; -esac -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi - -rm -f conf$$ conf$$.exe conf$$.file -if test -d conf$$.dir; then - rm -f conf$$.dir/conf$$.file -else - rm -f conf$$.dir - mkdir conf$$.dir 2>/dev/null -fi -if (echo >conf$$.file) 2>/dev/null; then - if ln -s conf$$.file conf$$ 2>/dev/null; then - as_ln_s='ln -s' - # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -p'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -p' - elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln - else - as_ln_s='cp -p' - fi -else - as_ln_s='cp -p' -fi -rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file -rmdir conf$$.dir 2>/dev/null - -if mkdir -p . 2>/dev/null; then - as_mkdir_p=: -else - test -d ./-p && rmdir ./-p - as_mkdir_p=false -fi - -if test -x / >/dev/null 2>&1; then - as_test_x='test -x' -else - if ls -dL / >/dev/null 2>&1; then - as_ls_L_option=L - else - as_ls_L_option= - fi - as_test_x=' - eval sh -c '\'' - if test -d "$1"; then - test -d "$1/."; - else - case $1 in - -*)set "./$1";; - esac; - case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in - ???[sx]*):;;*)false;;esac;fi - '\'' sh - ' -fi -as_executable_p=$as_test_x - -# Sed expression to map a string onto a valid CPP name. -as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" - -# Sed expression to map a string onto a valid variable name. -as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" - - - -exec 7<&0 </dev/null 6>&1 - -# Name of the host. -# hostname on some systems (SVR3.2, Linux) returns a bogus exit status, -# so uname gets run too. -ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` - -# -# Initializations. -# -ac_default_prefix=/usr/local -ac_clean_files= -ac_config_libobj_dir=. -LIBOBJS= -cross_compiling=no -subdirs= -MFLAGS= -MAKEFLAGS= -SHELL=${CONFIG_SHELL-/bin/sh} - -# Identity of this package. -PACKAGE_NAME= -PACKAGE_TARNAME= -PACKAGE_VERSION= -PACKAGE_STRING= -PACKAGE_BUGREPORT= - -ac_unique_file="imaxabs.c" -ac_subst_vars='LTLIBOBJS -LIBOBJS -INSTALL_DATA -INSTALL_SCRIPT -INSTALL_PROGRAM -W32API_INCLUDE -NO_CYGWIN -target_os -target_vendor -target_cpu -target -host_os -host_vendor -host_cpu -host -build_os -build_vendor -build_cpu -build -DLLWRAP -DLLTOOL -RANLIB -LD -AR -AS -CC -target_alias -host_alias -build_alias -LIBS -ECHO_T -ECHO_N -ECHO_C -DEFS -mandir -localedir -libdir -psdir -pdfdir -dvidir -htmldir -infodir -docdir -oldincludedir -includedir -localstatedir -sharedstatedir -sysconfdir -datadir -datarootdir -libexecdir -sbindir -bindir -program_transform_name -prefix -exec_prefix -PACKAGE_BUGREPORT -PACKAGE_STRING -PACKAGE_VERSION -PACKAGE_TARNAME -PACKAGE_NAME -PATH_SEPARATOR -SHELL' -ac_subst_files='' -ac_user_opts=' -enable_option_checking -' - ac_precious_vars='build_alias -host_alias -target_alias' - - -# Initialize some variables set by options. -ac_init_help= -ac_init_version=false -ac_unrecognized_opts= -ac_unrecognized_sep= -# The variables have the same names as the options, with -# dashes changed to underlines. -cache_file=/dev/null -exec_prefix=NONE -no_create= -no_recursion= -prefix=NONE -program_prefix=NONE -program_suffix=NONE -program_transform_name=s,x,x, -silent= -site= -srcdir= -verbose= -x_includes=NONE -x_libraries=NONE - -# Installation directory options. -# These are left unexpanded so users can "make install exec_prefix=/foo" -# and all the variables that are supposed to be based on exec_prefix -# by default will actually change. -# Use braces instead of parens because sh, perl, etc. also accept them. -# (The list follows the same order as the GNU Coding Standards.) -bindir='${exec_prefix}/bin' -sbindir='${exec_prefix}/sbin' -libexecdir='${exec_prefix}/libexec' -datarootdir='${prefix}/share' -datadir='${datarootdir}' -sysconfdir='${prefix}/etc' -sharedstatedir='${prefix}/com' -localstatedir='${prefix}/var' -includedir='${prefix}/include' -oldincludedir='/usr/include' -docdir='${datarootdir}/doc/${PACKAGE}' -infodir='${datarootdir}/info' -htmldir='${docdir}' -dvidir='${docdir}' -pdfdir='${docdir}' -psdir='${docdir}' -libdir='${exec_prefix}/lib' -localedir='${datarootdir}/locale' -mandir='${datarootdir}/man' - -ac_prev= -ac_dashdash= -for ac_option -do - # If the previous option needs an argument, assign it. - if test -n "$ac_prev"; then - eval $ac_prev=\$ac_option - ac_prev= - continue - fi - - case $ac_option in - *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; - *) ac_optarg=yes ;; - esac - - # Accept the important Cygnus configure options, so we can diagnose typos. - - case $ac_dashdash$ac_option in - --) - ac_dashdash=yes ;; - - -bindir | --bindir | --bindi | --bind | --bin | --bi) - ac_prev=bindir ;; - -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) - bindir=$ac_optarg ;; - - -build | --build | --buil | --bui | --bu) - ac_prev=build_alias ;; - -build=* | --build=* | --buil=* | --bui=* | --bu=*) - build_alias=$ac_optarg ;; - - -cache-file | --cache-file | --cache-fil | --cache-fi \ - | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) - ac_prev=cache_file ;; - -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ - | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) - cache_file=$ac_optarg ;; - - --config-cache | -C) - cache_file=config.cache ;; - - -datadir | --datadir | --datadi | --datad) - ac_prev=datadir ;; - -datadir=* | --datadir=* | --datadi=* | --datad=*) - datadir=$ac_optarg ;; - - -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ - | --dataroo | --dataro | --datar) - ac_prev=datarootdir ;; - -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ - | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) - datarootdir=$ac_optarg ;; - - -disable-* | --disable-*) - ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2 - { (exit 1); exit 1; }; } - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"enable_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval enable_$ac_useropt=no ;; - - -docdir | --docdir | --docdi | --doc | --do) - ac_prev=docdir ;; - -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) - docdir=$ac_optarg ;; - - -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) - ac_prev=dvidir ;; - -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) - dvidir=$ac_optarg ;; - - -enable-* | --enable-*) - ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2 - { (exit 1); exit 1; }; } - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"enable_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval enable_$ac_useropt=\$ac_optarg ;; - - -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ - | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ - | --exec | --exe | --ex) - ac_prev=exec_prefix ;; - -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ - | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ - | --exec=* | --exe=* | --ex=*) - exec_prefix=$ac_optarg ;; - - -gas | --gas | --ga | --g) - # Obsolete; use --with-gas. - with_gas=yes ;; - - -help | --help | --hel | --he | -h) - ac_init_help=long ;; - -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) - ac_init_help=recursive ;; - -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) - ac_init_help=short ;; - - -host | --host | --hos | --ho) - ac_prev=host_alias ;; - -host=* | --host=* | --hos=* | --ho=*) - host_alias=$ac_optarg ;; - - -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) - ac_prev=htmldir ;; - -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ - | --ht=*) - htmldir=$ac_optarg ;; - - -includedir | --includedir | --includedi | --included | --include \ - | --includ | --inclu | --incl | --inc) - ac_prev=includedir ;; - -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ - | --includ=* | --inclu=* | --incl=* | --inc=*) - includedir=$ac_optarg ;; - - -infodir | --infodir | --infodi | --infod | --info | --inf) - ac_prev=infodir ;; - -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) - infodir=$ac_optarg ;; - - -libdir | --libdir | --libdi | --libd) - ac_prev=libdir ;; - -libdir=* | --libdir=* | --libdi=* | --libd=*) - libdir=$ac_optarg ;; - - -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ - | --libexe | --libex | --libe) - ac_prev=libexecdir ;; - -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ - | --libexe=* | --libex=* | --libe=*) - libexecdir=$ac_optarg ;; - - -localedir | --localedir | --localedi | --localed | --locale) - ac_prev=localedir ;; - -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) - localedir=$ac_optarg ;; - - -localstatedir | --localstatedir | --localstatedi | --localstated \ - | --localstate | --localstat | --localsta | --localst | --locals) - ac_prev=localstatedir ;; - -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ - | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) - localstatedir=$ac_optarg ;; - - -mandir | --mandir | --mandi | --mand | --man | --ma | --m) - ac_prev=mandir ;; - -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) - mandir=$ac_optarg ;; - - -nfp | --nfp | --nf) - # Obsolete; use --without-fp. - with_fp=no ;; - - -no-create | --no-create | --no-creat | --no-crea | --no-cre \ - | --no-cr | --no-c | -n) - no_create=yes ;; - - -no-recursion | --no-recursion | --no-recursio | --no-recursi \ - | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) - no_recursion=yes ;; - - -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ - | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ - | --oldin | --oldi | --old | --ol | --o) - ac_prev=oldincludedir ;; - -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ - | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ - | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) - oldincludedir=$ac_optarg ;; - - -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) - ac_prev=prefix ;; - -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) - prefix=$ac_optarg ;; - - -program-prefix | --program-prefix | --program-prefi | --program-pref \ - | --program-pre | --program-pr | --program-p) - ac_prev=program_prefix ;; - -program-prefix=* | --program-prefix=* | --program-prefi=* \ - | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) - program_prefix=$ac_optarg ;; - - -program-suffix | --program-suffix | --program-suffi | --program-suff \ - | --program-suf | --program-su | --program-s) - ac_prev=program_suffix ;; - -program-suffix=* | --program-suffix=* | --program-suffi=* \ - | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) - program_suffix=$ac_optarg ;; - - -program-transform-name | --program-transform-name \ - | --program-transform-nam | --program-transform-na \ - | --program-transform-n | --program-transform- \ - | --program-transform | --program-transfor \ - | --program-transfo | --program-transf \ - | --program-trans | --program-tran \ - | --progr-tra | --program-tr | --program-t) - ac_prev=program_transform_name ;; - -program-transform-name=* | --program-transform-name=* \ - | --program-transform-nam=* | --program-transform-na=* \ - | --program-transform-n=* | --program-transform-=* \ - | --program-transform=* | --program-transfor=* \ - | --program-transfo=* | --program-transf=* \ - | --program-trans=* | --program-tran=* \ - | --progr-tra=* | --program-tr=* | --program-t=*) - program_transform_name=$ac_optarg ;; - - -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) - ac_prev=pdfdir ;; - -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) - pdfdir=$ac_optarg ;; - - -psdir | --psdir | --psdi | --psd | --ps) - ac_prev=psdir ;; - -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) - psdir=$ac_optarg ;; - - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil) - silent=yes ;; - - -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) - ac_prev=sbindir ;; - -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ - | --sbi=* | --sb=*) - sbindir=$ac_optarg ;; - - -sharedstatedir | --sharedstatedir | --sharedstatedi \ - | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ - | --sharedst | --shareds | --shared | --share | --shar \ - | --sha | --sh) - ac_prev=sharedstatedir ;; - -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ - | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ - | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ - | --sha=* | --sh=*) - sharedstatedir=$ac_optarg ;; - - -site | --site | --sit) - ac_prev=site ;; - -site=* | --site=* | --sit=*) - site=$ac_optarg ;; - - -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) - ac_prev=srcdir ;; - -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) - srcdir=$ac_optarg ;; - - -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ - | --syscon | --sysco | --sysc | --sys | --sy) - ac_prev=sysconfdir ;; - -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ - | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) - sysconfdir=$ac_optarg ;; - - -target | --target | --targe | --targ | --tar | --ta | --t) - ac_prev=target_alias ;; - -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) - target_alias=$ac_optarg ;; - - -v | -verbose | --verbose | --verbos | --verbo | --verb) - verbose=yes ;; - - -version | --version | --versio | --versi | --vers | -V) - ac_init_version=: ;; - - -with-* | --with-*) - ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2 - { (exit 1); exit 1; }; } - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"with_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval with_$ac_useropt=\$ac_optarg ;; - - -without-* | --without-*) - ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2 - { (exit 1); exit 1; }; } - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"with_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval with_$ac_useropt=no ;; - - --x) - # Obsolete; use --with-x. - with_x=yes ;; - - -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ - | --x-incl | --x-inc | --x-in | --x-i) - ac_prev=x_includes ;; - -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ - | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) - x_includes=$ac_optarg ;; - - -x-libraries | --x-libraries | --x-librarie | --x-librari \ - | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) - ac_prev=x_libraries ;; - -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ - | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) - x_libraries=$ac_optarg ;; - - -*) { $as_echo "$as_me: error: unrecognized option: $ac_option -Try \`$0 --help' for more information." >&2 - { (exit 1); exit 1; }; } - ;; - - *=*) - ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` - # Reject names that are not valid shell variable names. - expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && - { $as_echo "$as_me: error: invalid variable name: $ac_envvar" >&2 - { (exit 1); exit 1; }; } - eval $ac_envvar=\$ac_optarg - export $ac_envvar ;; - - *) - # FIXME: should be removed in autoconf 3.0. - $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 - expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && - $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 - : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} - ;; - - esac -done - -if test -n "$ac_prev"; then - ac_option=--`echo $ac_prev | sed 's/_/-/g'` - { $as_echo "$as_me: error: missing argument to $ac_option" >&2 - { (exit 1); exit 1; }; } -fi - -if test -n "$ac_unrecognized_opts"; then - case $enable_option_checking in - no) ;; - fatal) { $as_echo "$as_me: error: unrecognized options: $ac_unrecognized_opts" >&2 - { (exit 1); exit 1; }; } ;; - *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; - esac -fi - -# Check all directory arguments for consistency. -for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ - datadir sysconfdir sharedstatedir localstatedir includedir \ - oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ - libdir localedir mandir -do - eval ac_val=\$$ac_var - # Remove trailing slashes. - case $ac_val in - */ ) - ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` - eval $ac_var=\$ac_val;; - esac - # Be sure to have absolute directory names. - case $ac_val in - [\\/$]* | ?:[\\/]* ) continue;; - NONE | '' ) case $ac_var in *prefix ) continue;; esac;; - esac - { $as_echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 - { (exit 1); exit 1; }; } -done - -# There might be people who depend on the old broken behavior: `$host' -# used to hold the argument of --host etc. -# FIXME: To remove some day. -build=$build_alias -host=$host_alias -target=$target_alias - -# FIXME: To remove some day. -if test "x$host_alias" != x; then - if test "x$build_alias" = x; then - cross_compiling=maybe - $as_echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. - If a cross compiler is detected then cross compile mode will be used." >&2 - elif test "x$build_alias" != "x$host_alias"; then - cross_compiling=yes - fi -fi - -ac_tool_prefix= -test -n "$host_alias" && ac_tool_prefix=$host_alias- - -test "$silent" = yes && exec 6>/dev/null - - -ac_pwd=`pwd` && test -n "$ac_pwd" && -ac_ls_di=`ls -di .` && -ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || - { $as_echo "$as_me: error: working directory cannot be determined" >&2 - { (exit 1); exit 1; }; } -test "X$ac_ls_di" = "X$ac_pwd_ls_di" || - { $as_echo "$as_me: error: pwd does not report name of working directory" >&2 - { (exit 1); exit 1; }; } - - -# Find the source files, if location was not specified. -if test -z "$srcdir"; then - ac_srcdir_defaulted=yes - # Try the directory containing this script, then the parent directory. - ac_confdir=`$as_dirname -- "$as_myself" || -$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_myself" : 'X\(//\)[^/]' \| \ - X"$as_myself" : 'X\(//\)$' \| \ - X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_myself" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - srcdir=$ac_confdir - if test ! -r "$srcdir/$ac_unique_file"; then - srcdir=.. - fi -else - ac_srcdir_defaulted=no -fi -if test ! -r "$srcdir/$ac_unique_file"; then - test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." - { $as_echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 - { (exit 1); exit 1; }; } -fi -ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" -ac_abs_confdir=`( - cd "$srcdir" && test -r "./$ac_unique_file" || { $as_echo "$as_me: error: $ac_msg" >&2 - { (exit 1); exit 1; }; } - pwd)` -# When building in place, set srcdir=. -if test "$ac_abs_confdir" = "$ac_pwd"; then - srcdir=. -fi -# Remove unnecessary trailing slashes from srcdir. -# Double slashes in file names in object file debugging info -# mess up M-x gdb in Emacs. -case $srcdir in -*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; -esac -for ac_var in $ac_precious_vars; do - eval ac_env_${ac_var}_set=\${${ac_var}+set} - eval ac_env_${ac_var}_value=\$${ac_var} - eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} - eval ac_cv_env_${ac_var}_value=\$${ac_var} -done - -# -# Report the --help message. -# -if test "$ac_init_help" = "long"; then - # Omit some internal or obsolete options to make the list less imposing. - # This message is too long to be a string in the A/UX 3.1 sh. - cat <<_ACEOF -\`configure' configures this package to adapt to many kinds of systems. - -Usage: $0 [OPTION]... [VAR=VALUE]... - -To assign environment variables (e.g., CC, CFLAGS...), specify them as -VAR=VALUE. See below for descriptions of some of the useful variables. - -Defaults for the options are specified in brackets. - -Configuration: - -h, --help display this help and exit - --help=short display options specific to this package - --help=recursive display the short help of all the included packages - -V, --version display version information and exit - -q, --quiet, --silent do not print \`checking...' messages - --cache-file=FILE cache test results in FILE [disabled] - -C, --config-cache alias for \`--cache-file=config.cache' - -n, --no-create do not create output files - --srcdir=DIR find the sources in DIR [configure dir or \`..'] - -Installation directories: - --prefix=PREFIX install architecture-independent files in PREFIX - [$ac_default_prefix] - --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX - [PREFIX] - -By default, \`make install' will install all the files in -\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify -an installation prefix other than \`$ac_default_prefix' using \`--prefix', -for instance \`--prefix=\$HOME'. - -For better control, use the options below. - -Fine tuning of the installation directories: - --bindir=DIR user executables [EPREFIX/bin] - --sbindir=DIR system admin executables [EPREFIX/sbin] - --libexecdir=DIR program executables [EPREFIX/libexec] - --sysconfdir=DIR read-only single-machine data [PREFIX/etc] - --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] - --localstatedir=DIR modifiable single-machine data [PREFIX/var] - --libdir=DIR object code libraries [EPREFIX/lib] - --includedir=DIR C header files [PREFIX/include] - --oldincludedir=DIR C header files for non-gcc [/usr/include] - --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] - --datadir=DIR read-only architecture-independent data [DATAROOTDIR] - --infodir=DIR info documentation [DATAROOTDIR/info] - --localedir=DIR locale-dependent data [DATAROOTDIR/locale] - --mandir=DIR man documentation [DATAROOTDIR/man] - --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE] - --htmldir=DIR html documentation [DOCDIR] - --dvidir=DIR dvi documentation [DOCDIR] - --pdfdir=DIR pdf documentation [DOCDIR] - --psdir=DIR ps documentation [DOCDIR] -_ACEOF - - cat <<\_ACEOF - -System types: - --build=BUILD configure for building on BUILD [guessed] - --host=HOST cross-compile to build programs to run on HOST [BUILD] - --target=TARGET configure for building compilers for TARGET [HOST] -_ACEOF -fi - -if test -n "$ac_init_help"; then - - cat <<\_ACEOF - -_ACEOF -ac_status=$? -fi - -if test "$ac_init_help" = "recursive"; then - # If there are subdirs, report their specific --help. - for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue - test -d "$ac_dir" || - { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || - continue - ac_builddir=. - -case "$ac_dir" in -.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; -*) - ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` - # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` - case $ac_top_builddir_sub in - "") ac_top_builddir_sub=. ac_top_build_prefix= ;; - *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; - esac ;; -esac -ac_abs_top_builddir=$ac_pwd -ac_abs_builddir=$ac_pwd$ac_dir_suffix -# for backward compatibility: -ac_top_builddir=$ac_top_build_prefix - -case $srcdir in - .) # We are building in place. - ac_srcdir=. - ac_top_srcdir=$ac_top_builddir_sub - ac_abs_top_srcdir=$ac_pwd ;; - [\\/]* | ?:[\\/]* ) # Absolute name. - ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir - ac_abs_top_srcdir=$srcdir ;; - *) # Relative name. - ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_build_prefix$srcdir - ac_abs_top_srcdir=$ac_pwd/$srcdir ;; -esac -ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix - - cd "$ac_dir" || { ac_status=$?; continue; } - # Check for guested configure. - if test -f "$ac_srcdir/configure.gnu"; then - echo && - $SHELL "$ac_srcdir/configure.gnu" --help=recursive - elif test -f "$ac_srcdir/configure"; then - echo && - $SHELL "$ac_srcdir/configure" --help=recursive - else - $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 - fi || ac_status=$? - cd "$ac_pwd" || { ac_status=$?; break; } - done -fi - -test -n "$ac_init_help" && exit $ac_status -if $ac_init_version; then - cat <<\_ACEOF -configure -generated by GNU Autoconf 2.63 - -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. -This configure script is free software; the Free Software Foundation -gives unlimited permission to copy, distribute and modify it. -_ACEOF - exit -fi -cat >config.log <<_ACEOF -This file contains any messages produced by compilers while -running configure, to aid debugging if configure makes a mistake. - -It was created by $as_me, which was -generated by GNU Autoconf 2.63. Invocation command line was - - $ $0 $@ - -_ACEOF -exec 5>>config.log -{ -cat <<_ASUNAME -## --------- ## -## Platform. ## -## --------- ## - -hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` -uname -m = `(uname -m) 2>/dev/null || echo unknown` -uname -r = `(uname -r) 2>/dev/null || echo unknown` -uname -s = `(uname -s) 2>/dev/null || echo unknown` -uname -v = `(uname -v) 2>/dev/null || echo unknown` - -/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` -/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` - -/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` -/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` -/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` -/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` -/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` -/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` -/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` - -_ASUNAME - -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - $as_echo "PATH: $as_dir" -done -IFS=$as_save_IFS - -} >&5 - -cat >&5 <<_ACEOF - - -## ----------- ## -## Core tests. ## -## ----------- ## - -_ACEOF - - -# Keep a trace of the command line. -# Strip out --no-create and --no-recursion so they do not pile up. -# Strip out --silent because we don't want to record it for future runs. -# Also quote any args containing shell meta-characters. -# Make two passes to allow for proper duplicate-argument suppression. -ac_configure_args= -ac_configure_args0= -ac_configure_args1= -ac_must_keep_next=false -for ac_pass in 1 2 -do - for ac_arg - do - case $ac_arg in - -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil) - continue ;; - *\'*) - ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; - esac - case $ac_pass in - 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; - 2) - ac_configure_args1="$ac_configure_args1 '$ac_arg'" - if test $ac_must_keep_next = true; then - ac_must_keep_next=false # Got value, back to normal. - else - case $ac_arg in - *=* | --config-cache | -C | -disable-* | --disable-* \ - | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ - | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ - | -with-* | --with-* | -without-* | --without-* | --x) - case "$ac_configure_args0 " in - "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; - esac - ;; - -* ) ac_must_keep_next=true ;; - esac - fi - ac_configure_args="$ac_configure_args '$ac_arg'" - ;; - esac - done -done -$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } -$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } - -# When interrupted or exit'd, cleanup temporary files, and complete -# config.log. We remove comments because anyway the quotes in there -# would cause problems or look ugly. -# WARNING: Use '\'' to represent an apostrophe within the trap. -# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. -trap 'exit_status=$? - # Save into config.log some information that might help in debugging. - { - echo - - cat <<\_ASBOX -## ---------------- ## -## Cache variables. ## -## ---------------- ## -_ASBOX - echo - # The following way of writing the cache mishandles newlines in values, -( - for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do - eval ac_val=\$$ac_var - case $ac_val in #( - *${as_nl}*) - case $ac_var in #( - *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5 -$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; - esac - case $ac_var in #( - _ | IFS | as_nl) ;; #( - BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( - *) $as_unset $ac_var ;; - esac ;; - esac - done - (set) 2>&1 | - case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( - *${as_nl}ac_space=\ *) - sed -n \ - "s/'\''/'\''\\\\'\'''\''/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" - ;; #( - *) - sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" - ;; - esac | - sort -) - echo - - cat <<\_ASBOX -## ----------------- ## -## Output variables. ## -## ----------------- ## -_ASBOX - echo - for ac_var in $ac_subst_vars - do - eval ac_val=\$$ac_var - case $ac_val in - *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; - esac - $as_echo "$ac_var='\''$ac_val'\''" - done | sort - echo - - if test -n "$ac_subst_files"; then - cat <<\_ASBOX -## ------------------- ## -## File substitutions. ## -## ------------------- ## -_ASBOX - echo - for ac_var in $ac_subst_files - do - eval ac_val=\$$ac_var - case $ac_val in - *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; - esac - $as_echo "$ac_var='\''$ac_val'\''" - done | sort - echo - fi - - if test -s confdefs.h; then - cat <<\_ASBOX -## ----------- ## -## confdefs.h. ## -## ----------- ## -_ASBOX - echo - cat confdefs.h - echo - fi - test "$ac_signal" != 0 && - $as_echo "$as_me: caught signal $ac_signal" - $as_echo "$as_me: exit $exit_status" - } >&5 - rm -f core *.core core.conftest.* && - rm -f -r conftest* confdefs* conf$$* $ac_clean_files && - exit $exit_status -' 0 -for ac_signal in 1 2 13 15; do - trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal -done -ac_signal=0 - -# confdefs.h avoids OS command line length limits that DEFS can exceed. -rm -f -r conftest* confdefs.h - -# Predefined preprocessor variables. - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_NAME "$PACKAGE_NAME" -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_TARNAME "$PACKAGE_TARNAME" -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_VERSION "$PACKAGE_VERSION" -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_STRING "$PACKAGE_STRING" -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" -_ACEOF - - -# Let the site file select an alternate cache file if it wants to. -# Prefer an explicitly selected file to automatically selected ones. -ac_site_file1=NONE -ac_site_file2=NONE -if test -n "$CONFIG_SITE"; then - ac_site_file1=$CONFIG_SITE -elif test "x$prefix" != xNONE; then - ac_site_file1=$prefix/share/config.site - ac_site_file2=$prefix/etc/config.site -else - ac_site_file1=$ac_default_prefix/share/config.site - ac_site_file2=$ac_default_prefix/etc/config.site -fi -for ac_site_file in "$ac_site_file1" "$ac_site_file2" -do - test "x$ac_site_file" = xNONE && continue - if test -r "$ac_site_file"; then - { $as_echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 -$as_echo "$as_me: loading site script $ac_site_file" >&6;} - sed 's/^/| /' "$ac_site_file" >&5 - . "$ac_site_file" - fi -done - -if test -r "$cache_file"; then - # Some versions of bash will fail to source /dev/null (special - # files actually), so we avoid doing that. - if test -f "$cache_file"; then - { $as_echo "$as_me:$LINENO: loading cache $cache_file" >&5 -$as_echo "$as_me: loading cache $cache_file" >&6;} - case $cache_file in - [\\/]* | ?:[\\/]* ) . "$cache_file";; - *) . "./$cache_file";; - esac - fi -else - { $as_echo "$as_me:$LINENO: creating cache $cache_file" >&5 -$as_echo "$as_me: creating cache $cache_file" >&6;} - >$cache_file -fi - -# Check that the precious variables saved in the cache have kept the same -# value. -ac_cache_corrupted=false -for ac_var in $ac_precious_vars; do - eval ac_old_set=\$ac_cv_env_${ac_var}_set - eval ac_new_set=\$ac_env_${ac_var}_set - eval ac_old_val=\$ac_cv_env_${ac_var}_value - eval ac_new_val=\$ac_env_${ac_var}_value - case $ac_old_set,$ac_new_set in - set,) - { $as_echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 -$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,set) - { $as_echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 -$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,);; - *) - if test "x$ac_old_val" != "x$ac_new_val"; then - # differences in whitespace do not lead to failure. - ac_old_val_w=`echo x $ac_old_val` - ac_new_val_w=`echo x $ac_new_val` - if test "$ac_old_val_w" != "$ac_new_val_w"; then - { $as_echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 -$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} - ac_cache_corrupted=: - else - { $as_echo "$as_me:$LINENO: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 -$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} - eval $ac_var=\$ac_old_val - fi - { $as_echo "$as_me:$LINENO: former value: \`$ac_old_val'" >&5 -$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} - { $as_echo "$as_me:$LINENO: current value: \`$ac_new_val'" >&5 -$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} - fi;; - esac - # Pass precious variables to config.status. - if test "$ac_new_set" = set; then - case $ac_new_val in - *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; - *) ac_arg=$ac_var=$ac_new_val ;; - esac - case " $ac_configure_args " in - *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. - *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; - esac - fi -done -if $ac_cache_corrupted; then - { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} - { $as_echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 -$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} - { { $as_echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 -$as_echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} - { (exit 1); exit 1; }; } -fi - - - - - - - - - - - - - - - - - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - - -CC=${CC-cc} - -AS=${AS-as} - -AR=${AR-ar} - -LD=${LD-ld} - -RANLIB=${RANLIB-ranlib} - -DLLTOOL=${DLLTOOL-dlltool} - -DLLWRAP=${DLLWRAP-dllwrap} - -ac_aux_dir= -for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do - if test -f "$ac_dir/install-sh"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install-sh -c" - break - elif test -f "$ac_dir/install.sh"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install.sh -c" - break - elif test -f "$ac_dir/shtool"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/shtool install -c" - break - fi -done -if test -z "$ac_aux_dir"; then - { { $as_echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5 -$as_echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;} - { (exit 1); exit 1; }; } -fi - -# These three variables are undocumented and unsupported, -# and are intended to be withdrawn in a future Autoconf release. -# They can cause serious problems if a builder's source tree is in a directory -# whose full name contains unusual characters. -ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. -ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. -ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. - - -# Make sure we can run config.sub. -$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || - { { $as_echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5 -$as_echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;} - { (exit 1); exit 1; }; } - -{ $as_echo "$as_me:$LINENO: checking build system type" >&5 -$as_echo_n "checking build system type... " >&6; } -if test "${ac_cv_build+set}" = set; then - $as_echo_n "(cached) " >&6 -else - ac_build_alias=$build_alias -test "x$ac_build_alias" = x && - ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` -test "x$ac_build_alias" = x && - { { $as_echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 -$as_echo "$as_me: error: cannot guess build type; you must specify one" >&2;} - { (exit 1); exit 1; }; } -ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || - { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5 -$as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;} - { (exit 1); exit 1; }; } - -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_build" >&5 -$as_echo "$ac_cv_build" >&6; } -case $ac_cv_build in -*-*-*) ;; -*) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical build" >&5 -$as_echo "$as_me: error: invalid value of canonical build" >&2;} - { (exit 1); exit 1; }; };; -esac -build=$ac_cv_build -ac_save_IFS=$IFS; IFS='-' -set x $ac_cv_build -shift -build_cpu=$1 -build_vendor=$2 -shift; shift -# Remember, the first character of IFS is used to create $*, -# except with old shells: -build_os=$* -IFS=$ac_save_IFS -case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac - - -{ $as_echo "$as_me:$LINENO: checking host system type" >&5 -$as_echo_n "checking host system type... " >&6; } -if test "${ac_cv_host+set}" = set; then - $as_echo_n "(cached) " >&6 -else - if test "x$host_alias" = x; then - ac_cv_host=$ac_cv_build -else - ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || - { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5 -$as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;} - { (exit 1); exit 1; }; } -fi - -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_host" >&5 -$as_echo "$ac_cv_host" >&6; } -case $ac_cv_host in -*-*-*) ;; -*) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical host" >&5 -$as_echo "$as_me: error: invalid value of canonical host" >&2;} - { (exit 1); exit 1; }; };; -esac -host=$ac_cv_host -ac_save_IFS=$IFS; IFS='-' -set x $ac_cv_host -shift -host_cpu=$1 -host_vendor=$2 -shift; shift -# Remember, the first character of IFS is used to create $*, -# except with old shells: -host_os=$* -IFS=$ac_save_IFS -case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac - - -{ $as_echo "$as_me:$LINENO: checking target system type" >&5 -$as_echo_n "checking target system type... " >&6; } -if test "${ac_cv_target+set}" = set; then - $as_echo_n "(cached) " >&6 -else - if test "x$target_alias" = x; then - ac_cv_target=$ac_cv_host -else - ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` || - { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $target_alias failed" >&5 -$as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $target_alias failed" >&2;} - { (exit 1); exit 1; }; } -fi - -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_target" >&5 -$as_echo "$ac_cv_target" >&6; } -case $ac_cv_target in -*-*-*) ;; -*) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical target" >&5 -$as_echo "$as_me: error: invalid value of canonical target" >&2;} - { (exit 1); exit 1; }; };; -esac -target=$ac_cv_target -ac_save_IFS=$IFS; IFS='-' -set x $ac_cv_target -shift -target_cpu=$1 -target_vendor=$2 -shift; shift -# Remember, the first character of IFS is used to create $*, -# except with old shells: -target_os=$* -IFS=$ac_save_IFS -case $target_os in *\ *) target_os=`echo "$target_os" | sed 's/ /-/g'`;; esac - - -# The aliases save the names the user supplied, while $host etc. -# will get canonicalized. -test -n "$target_alias" && - test "$program_prefix$program_suffix$program_transform_name" = \ - NONENONEs,x,x, && - program_prefix=${target_alias}- - -case "$target_os" in -*cygwin*) - NO_CYGWIN="$(cd ${srcdir}/../../utils; pwd)/mingw" - ;; -*) - # Build it for MSVCRT by default. - NO_CYGWIN= - ;; -esac - - - -W32API_INCLUDE='-I $(srcdir)/../../w32api/include' - - -# Find a good install program. We prefer a C program (faster), -# so one script is as good as another. But avoid the broken or -# incompatible versions: -# SysV /etc/install, /usr/sbin/install -# SunOS /usr/etc/install -# IRIX /sbin/install -# AIX /bin/install -# AmigaOS /C/install, which installs bootblocks on floppy discs -# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag -# AFS /usr/afsws/bin/install, which mishandles nonexistent args -# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" -# OS/2's system install, which has a completely different semantic -# ./install, which can be erroneously created by make from ./install.sh. -# Reject install programs that cannot install multiple files. -{ $as_echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 -$as_echo_n "checking for a BSD-compatible install... " >&6; } -if test -z "$INSTALL"; then -if test "${ac_cv_path_install+set}" = set; then - $as_echo_n "(cached) " >&6 -else - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - # Account for people who put trailing slashes in PATH elements. -case $as_dir/ in - ./ | .// | /cC/* | \ - /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ - ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ - /usr/ucb/* ) ;; - *) - # OSF1 and SCO ODT 3.0 have their own names for install. - # Don't use installbsd from OSF since it installs stuff as root - # by default. - for ac_prog in ginstall scoinst install; do - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then - if test $ac_prog = install && - grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then - # AIX install. It has an incompatible calling convention. - : - elif test $ac_prog = install && - grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then - # program-specific install script used by HP pwplus--don't use. - : - else - rm -rf conftest.one conftest.two conftest.dir - echo one > conftest.one - echo two > conftest.two - mkdir conftest.dir - if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && - test -s conftest.one && test -s conftest.two && - test -s conftest.dir/conftest.one && - test -s conftest.dir/conftest.two - then - ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" - break 3 - fi - fi - fi - done - done - ;; -esac - -done -IFS=$as_save_IFS - -rm -rf conftest.one conftest.two conftest.dir - -fi - if test "${ac_cv_path_install+set}" = set; then - INSTALL=$ac_cv_path_install - else - # As a last resort, use the slow shell script. Don't cache a - # value for INSTALL within a source directory, because that will - # break other packages using the cache if that directory is - # removed, or if the value is a relative name. - INSTALL=$ac_install_sh - fi -fi -{ $as_echo "$as_me:$LINENO: result: $INSTALL" >&5 -$as_echo "$INSTALL" >&6; } - -# Use test -z because SunOS4 sh mishandles braces in ${var-val}. -# It thinks the first close brace ends the variable substitution. -test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' - -test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' - -test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' - -ac_config_files="$ac_config_files Makefile" - -cat >confcache <<\_ACEOF -# This file is a shell script that caches the results of configure -# tests run on this system so they can be shared between configure -# scripts and configure runs, see configure's option --config-cache. -# It is not useful on other systems. If it contains results you don't -# want to keep, you may remove or edit it. -# -# config.status only pays attention to the cache file if you give it -# the --recheck option to rerun configure. -# -# `ac_cv_env_foo' variables (set or unset) will be overridden when -# loading this file, other *unset* `ac_cv_foo' will be assigned the -# following values. - -_ACEOF - -# The following way of writing the cache mishandles newlines in values, -# but we know of no workaround that is simple, portable, and efficient. -# So, we kill variables containing newlines. -# Ultrix sh set writes to stderr and can't be redirected directly, -# and sets the high bit in the cache file unless we assign to the vars. -( - for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do - eval ac_val=\$$ac_var - case $ac_val in #( - *${as_nl}*) - case $ac_var in #( - *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5 -$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; - esac - case $ac_var in #( - _ | IFS | as_nl) ;; #( - BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( - *) $as_unset $ac_var ;; - esac ;; - esac - done - - (set) 2>&1 | - case $as_nl`(ac_space=' '; set) 2>&1` in #( - *${as_nl}ac_space=\ *) - # `set' does not quote correctly, so add quotes (double-quote - # substitution turns \\\\ into \\, and sed turns \\ into \). - sed -n \ - "s/'/'\\\\''/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" - ;; #( - *) - # `set' quotes correctly as required by POSIX, so do not add quotes. - sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" - ;; - esac | - sort -) | - sed ' - /^ac_cv_env_/b end - t clear - :clear - s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ - t end - s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ - :end' >>confcache -if diff "$cache_file" confcache >/dev/null 2>&1; then :; else - if test -w "$cache_file"; then - test "x$cache_file" != "x/dev/null" && - { $as_echo "$as_me:$LINENO: updating cache $cache_file" >&5 -$as_echo "$as_me: updating cache $cache_file" >&6;} - cat confcache >$cache_file - else - { $as_echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 -$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} - fi -fi -rm -f confcache - -test "x$prefix" = xNONE && prefix=$ac_default_prefix -# Let make expand exec_prefix. -test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' - -# Transform confdefs.h into DEFS. -# Protect against shell expansion while executing Makefile rules. -# Protect against Makefile macro expansion. -# -# If the first sed substitution is executed (which looks for macros that -# take arguments), then branch to the quote section. Otherwise, -# look for a macro that doesn't take arguments. -ac_script=' -:mline -/\\$/{ - N - s,\\\n,, - b mline -} -t clear -:clear -s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g -t quote -s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g -t quote -b any -:quote -s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g -s/\[/\\&/g -s/\]/\\&/g -s/\$/$$/g -H -:any -${ - g - s/^\n// - s/\n/ /g - p -} -' -DEFS=`sed -n "$ac_script" confdefs.h` - - -ac_libobjs= -ac_ltlibobjs= -for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue - # 1. Remove the extension, and $U if already installed. - ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' - ac_i=`$as_echo "$ac_i" | sed "$ac_script"` - # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR - # will be set to the directory where LIBOBJS objects are built. - ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" - ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' -done -LIBOBJS=$ac_libobjs - -LTLIBOBJS=$ac_ltlibobjs - - - -: ${CONFIG_STATUS=./config.status} -ac_write_fail=0 -ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files $CONFIG_STATUS" -{ $as_echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 -$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} -cat >$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -#! $SHELL -# Generated by $as_me. -# Run this file to recreate the current configuration. -# Compiler output produced by configure, useful for debugging -# configure, is in config.log if it exists. - -debug=false -ac_cs_recheck=false -ac_cs_silent=false -SHELL=\${CONFIG_SHELL-$SHELL} -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -## --------------------- ## -## M4sh Initialization. ## -## --------------------- ## - -# Be more Bourne compatible -DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in - *posix*) set -o posix ;; -esac - -fi - - - - -# PATH needs CR -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits - -as_nl=' -' -export as_nl -# Printing a long string crashes Solaris 7 /usr/bin/printf. -as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo -if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='printf %s\n' - as_echo_n='printf %s' -else - if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then - as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' - as_echo_n='/usr/ucb/echo -n' - else - as_echo_body='eval expr "X$1" : "X\\(.*\\)"' - as_echo_n_body='eval - arg=$1; - case $arg in - *"$as_nl"*) - expr "X$arg" : "X\\(.*\\)$as_nl"; - arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; - esac; - expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" - ' - export as_echo_n_body - as_echo_n='sh -c $as_echo_n_body as_echo' - fi - export as_echo_body - as_echo='sh -c $as_echo_body as_echo' -fi - -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - PATH_SEPARATOR=: - (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { - (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || - PATH_SEPARATOR=';' - } -fi - -# Support unset when possible. -if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then - as_unset=unset -else - as_unset=false -fi - - -# IFS -# We need space, tab and new line, in precisely that order. Quoting is -# there to prevent editors from complaining about space-tab. -# (If _AS_PATH_WALK were called with IFS unset, it would disable word -# splitting by setting IFS to empty value.) -IFS=" "" $as_nl" - -# Find who we are. Look in the path if we contain no directory separator. -case $0 in - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break -done -IFS=$as_save_IFS - - ;; -esac -# We did not find ourselves, most probably we were run as `sh COMMAND' -# in which case we are not to be found in the path. -if test "x$as_myself" = x; then - as_myself=$0 -fi -if test ! -f "$as_myself"; then - $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 - { (exit 1); exit 1; } -fi - -# Work around bugs in pre-3.0 UWIN ksh. -for as_var in ENV MAIL MAILPATH -do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var -done -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -LC_ALL=C -export LC_ALL -LANGUAGE=C -export LANGUAGE - -# Required to use basename. -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi - -if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then - as_basename=basename -else - as_basename=false -fi - - -# Name of the executable. -as_me=`$as_basename -- "$0" || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ - s//\1/ - q - } - /^X\/\(\/\/\)$/{ - s//\1/ - q - } - /^X\/\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - -# CDPATH. -$as_unset CDPATH - - - - as_lineno_1=$LINENO - as_lineno_2=$LINENO - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { - - # Create $as_me.lineno as a copy of $as_myself, but with $LINENO - # uniformly replaced by the line number. The first 'sed' inserts a - # line-number line after each line using $LINENO; the second 'sed' - # does the real work. The second script uses 'N' to pair each - # line-number line with the line containing $LINENO, and appends - # trailing '-' during substitution so that $LINENO is not a special - # case at line end. - # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the - # scripts with optimization help from Paolo Bonzini. Blame Lee - # E. McMahon (1931-1989) for sed's syntax. :-) - sed -n ' - p - /[$]LINENO/= - ' <$as_myself | - sed ' - s/[$]LINENO.*/&-/ - t lineno - b - :lineno - N - :loop - s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ - t loop - s/-\n.*// - ' >$as_me.lineno && - chmod +x "$as_me.lineno" || - { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 - { (exit 1); exit 1; }; } - - # Don't try to exec as it changes $[0], causing all sort of problems - # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensitive to this). - . "./$as_me.lineno" - # Exit status is that of the last command. - exit -} - - -if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then - as_dirname=dirname -else - as_dirname=false -fi - -ECHO_C= ECHO_N= ECHO_T= -case `echo -n x` in --n*) - case `echo 'x\c'` in - *c*) ECHO_T=' ';; # ECHO_T is single tab character. - *) ECHO_C='\c';; - esac;; -*) - ECHO_N='-n';; -esac -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi - -rm -f conf$$ conf$$.exe conf$$.file -if test -d conf$$.dir; then - rm -f conf$$.dir/conf$$.file -else - rm -f conf$$.dir - mkdir conf$$.dir 2>/dev/null -fi -if (echo >conf$$.file) 2>/dev/null; then - if ln -s conf$$.file conf$$ 2>/dev/null; then - as_ln_s='ln -s' - # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -p'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -p' - elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln - else - as_ln_s='cp -p' - fi -else - as_ln_s='cp -p' -fi -rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file -rmdir conf$$.dir 2>/dev/null - -if mkdir -p . 2>/dev/null; then - as_mkdir_p=: -else - test -d ./-p && rmdir ./-p - as_mkdir_p=false -fi - -if test -x / >/dev/null 2>&1; then - as_test_x='test -x' -else - if ls -dL / >/dev/null 2>&1; then - as_ls_L_option=L - else - as_ls_L_option= - fi - as_test_x=' - eval sh -c '\'' - if test -d "$1"; then - test -d "$1/."; - else - case $1 in - -*)set "./$1";; - esac; - case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in - ???[sx]*):;;*)false;;esac;fi - '\'' sh - ' -fi -as_executable_p=$as_test_x - -# Sed expression to map a string onto a valid CPP name. -as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" - -# Sed expression to map a string onto a valid variable name. -as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" - - -exec 6>&1 - -# Save the log message, to keep $[0] and so on meaningful, and to -# report actual input values of CONFIG_FILES etc. instead of their -# values after options handling. -ac_log=" -This file was extended by $as_me, which was -generated by GNU Autoconf 2.63. Invocation command line was - - CONFIG_FILES = $CONFIG_FILES - CONFIG_HEADERS = $CONFIG_HEADERS - CONFIG_LINKS = $CONFIG_LINKS - CONFIG_COMMANDS = $CONFIG_COMMANDS - $ $0 $@ - -on `(hostname || uname -n) 2>/dev/null | sed 1q` -" - -_ACEOF - -case $ac_config_files in *" -"*) set x $ac_config_files; shift; ac_config_files=$*;; -esac - - - -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -# Files that config.status was made for. -config_files="$ac_config_files" - -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -ac_cs_usage="\ -\`$as_me' instantiates files from templates according to the -current configuration. - -Usage: $0 [OPTION]... [FILE]... - - -h, --help print this help, then exit - -V, --version print version number and configuration settings, then exit - -q, --quiet, --silent - do not print progress messages - -d, --debug don't remove temporary files - --recheck update $as_me by reconfiguring in the same conditions - --file=FILE[:TEMPLATE] - instantiate the configuration file FILE - -Configuration files: -$config_files - -Report bugs to <bug-autoconf@gnu.org>." - -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -ac_cs_version="\\ -config.status -configured by $0, generated by GNU Autoconf 2.63, - with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" - -Copyright (C) 2008 Free Software Foundation, Inc. -This config.status script is free software; the Free Software Foundation -gives unlimited permission to copy, distribute and modify it." - -ac_pwd='$ac_pwd' -srcdir='$srcdir' -INSTALL='$INSTALL' -test -n "\$AWK" || AWK=awk -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -# The default lists apply if the user does not specify any file. -ac_need_defaults=: -while test $# != 0 -do - case $1 in - --*=*) - ac_option=`expr "X$1" : 'X\([^=]*\)='` - ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` - ac_shift=: - ;; - *) - ac_option=$1 - ac_optarg=$2 - ac_shift=shift - ;; - esac - - case $ac_option in - # Handling of the options. - -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) - ac_cs_recheck=: ;; - --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) - $as_echo "$ac_cs_version"; exit ;; - --debug | --debu | --deb | --de | --d | -d ) - debug=: ;; - --file | --fil | --fi | --f ) - $ac_shift - case $ac_optarg in - *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; - esac - CONFIG_FILES="$CONFIG_FILES '$ac_optarg'" - ac_need_defaults=false;; - --he | --h | --help | --hel | -h ) - $as_echo "$ac_cs_usage"; exit ;; - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil | --si | --s) - ac_cs_silent=: ;; - - # This is an error. - -*) { $as_echo "$as_me: error: unrecognized option: $1 -Try \`$0 --help' for more information." >&2 - { (exit 1); exit 1; }; } ;; - - *) ac_config_targets="$ac_config_targets $1" - ac_need_defaults=false ;; - - esac - shift -done - -ac_configure_extra_args= - -if $ac_cs_silent; then - exec 6>/dev/null - ac_configure_extra_args="$ac_configure_extra_args --silent" -fi - -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -if \$ac_cs_recheck; then - set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion - shift - \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 - CONFIG_SHELL='$SHELL' - export CONFIG_SHELL - exec "\$@" -fi - -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -exec 5>>config.log -{ - echo - sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX -## Running $as_me. ## -_ASBOX - $as_echo "$ac_log" -} >&5 - -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 - -# Handling of arguments. -for ac_config_target in $ac_config_targets -do - case $ac_config_target in - "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; - - *) { { $as_echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 -$as_echo "$as_me: error: invalid argument: $ac_config_target" >&2;} - { (exit 1); exit 1; }; };; - esac -done - - -# If the user did not use the arguments to specify the items to instantiate, -# then the envvar interface is used. Set only those that are not. -# We use the long form for the default assignment because of an extremely -# bizarre bug on SunOS 4.1.3. -if $ac_need_defaults; then - test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files -fi - -# Have a temporary directory for convenience. Make it in the build tree -# simply because there is no reason against having it here, and in addition, -# creating and moving files from /tmp can sometimes cause problems. -# Hook for its removal unless debugging. -# Note that there is a small window in which the directory will not be cleaned: -# after its creation but before its name has been assigned to `$tmp'. -$debug || -{ - tmp= - trap 'exit_status=$? - { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status -' 0 - trap '{ (exit 1); exit 1; }' 1 2 13 15 -} -# Create a (secure) tmp directory for tmp files. - -{ - tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && - test -n "$tmp" && test -d "$tmp" -} || -{ - tmp=./conf$$-$RANDOM - (umask 077 && mkdir "$tmp") -} || -{ - $as_echo "$as_me: cannot create a temporary directory in ." >&2 - { (exit 1); exit 1; } -} - -# Set up the scripts for CONFIG_FILES section. -# No need to generate them if there are no CONFIG_FILES. -# This happens for instance with `./config.status config.h'. -if test -n "$CONFIG_FILES"; then - - -ac_cr='
' -ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null` -if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then - ac_cs_awk_cr='\\r' -else - ac_cs_awk_cr=$ac_cr -fi - -echo 'BEGIN {' >"$tmp/subs1.awk" && -_ACEOF - - -{ - echo "cat >conf$$subs.awk <<_ACEOF" && - echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && - echo "_ACEOF" -} >conf$$subs.sh || - { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 -$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} - { (exit 1); exit 1; }; } -ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'` -ac_delim='%!_!# ' -for ac_last_try in false false false false false :; do - . ./conf$$subs.sh || - { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 -$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} - { (exit 1); exit 1; }; } - - ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` - if test $ac_delim_n = $ac_delim_num; then - break - elif $ac_last_try; then - { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 -$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} - { (exit 1); exit 1; }; } - else - ac_delim="$ac_delim!$ac_delim _$ac_delim!! " - fi -done -rm -f conf$$subs.sh - -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -cat >>"\$tmp/subs1.awk" <<\\_ACAWK && -_ACEOF -sed -n ' -h -s/^/S["/; s/!.*/"]=/ -p -g -s/^[^!]*!// -:repl -t repl -s/'"$ac_delim"'$// -t delim -:nl -h -s/\(.\{148\}\).*/\1/ -t more1 -s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ -p -n -b repl -:more1 -s/["\\]/\\&/g; s/^/"/; s/$/"\\/ -p -g -s/.\{148\}// -t nl -:delim -h -s/\(.\{148\}\).*/\1/ -t more2 -s/["\\]/\\&/g; s/^/"/; s/$/"/ -p -b -:more2 -s/["\\]/\\&/g; s/^/"/; s/$/"\\/ -p -g -s/.\{148\}// -t delim -' <conf$$subs.awk | sed ' -/^[^""]/{ - N - s/\n// -} -' >>$CONFIG_STATUS || ac_write_fail=1 -rm -f conf$$subs.awk -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -_ACAWK -cat >>"\$tmp/subs1.awk" <<_ACAWK && - for (key in S) S_is_set[key] = 1 - FS = "" - -} -{ - line = $ 0 - nfields = split(line, field, "@") - substed = 0 - len = length(field[1]) - for (i = 2; i < nfields; i++) { - key = field[i] - keylen = length(key) - if (S_is_set[key]) { - value = S[key] - line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) - len += length(value) + length(field[++i]) - substed = 1 - } else - len += 1 + keylen - } - - print line -} - -_ACAWK -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then - sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" -else - cat -fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \ - || { { $as_echo "$as_me:$LINENO: error: could not setup config files machinery" >&5 -$as_echo "$as_me: error: could not setup config files machinery" >&2;} - { (exit 1); exit 1; }; } -_ACEOF - -# VPATH may cause trouble with some makes, so we remove $(srcdir), -# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and -# trailing colons and then remove the whole line if VPATH becomes empty -# (actually we leave an empty line to preserve line numbers). -if test "x$srcdir" = x.; then - ac_vpsub='/^[ ]*VPATH[ ]*=/{ -s/:*\$(srcdir):*/:/ -s/:*\${srcdir}:*/:/ -s/:*@srcdir@:*/:/ -s/^\([^=]*=[ ]*\):*/\1/ -s/:*$// -s/^[^=]*=[ ]*$// -}' -fi - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -fi # test -n "$CONFIG_FILES" - - -eval set X " :F $CONFIG_FILES " -shift -for ac_tag -do - case $ac_tag in - :[FHLC]) ac_mode=$ac_tag; continue;; - esac - case $ac_mode$ac_tag in - :[FHL]*:*);; - :L* | :C*:*) { { $as_echo "$as_me:$LINENO: error: invalid tag $ac_tag" >&5 -$as_echo "$as_me: error: invalid tag $ac_tag" >&2;} - { (exit 1); exit 1; }; };; - :[FH]-) ac_tag=-:-;; - :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; - esac - ac_save_IFS=$IFS - IFS=: - set x $ac_tag - IFS=$ac_save_IFS - shift - ac_file=$1 - shift - - case $ac_mode in - :L) ac_source=$1;; - :[FH]) - ac_file_inputs= - for ac_f - do - case $ac_f in - -) ac_f="$tmp/stdin";; - *) # Look for the file first in the build tree, then in the source tree - # (if the path is not absolute). The absolute path cannot be DOS-style, - # because $ac_f cannot contain `:'. - test -f "$ac_f" || - case $ac_f in - [\\/$]*) false;; - *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; - esac || - { { $as_echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 -$as_echo "$as_me: error: cannot find input file: $ac_f" >&2;} - { (exit 1); exit 1; }; };; - esac - case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac - ac_file_inputs="$ac_file_inputs '$ac_f'" - done - - # Let's still pretend it is `configure' which instantiates (i.e., don't - # use $as_me), people would be surprised to read: - # /* config.h. Generated by config.status. */ - configure_input='Generated from '` - $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' - `' by configure.' - if test x"$ac_file" != x-; then - configure_input="$ac_file. $configure_input" - { $as_echo "$as_me:$LINENO: creating $ac_file" >&5 -$as_echo "$as_me: creating $ac_file" >&6;} - fi - # Neutralize special characters interpreted by sed in replacement strings. - case $configure_input in #( - *\&* | *\|* | *\\* ) - ac_sed_conf_input=`$as_echo "$configure_input" | - sed 's/[\\\\&|]/\\\\&/g'`;; #( - *) ac_sed_conf_input=$configure_input;; - esac - - case $ac_tag in - *:-:* | *:-) cat >"$tmp/stdin" \ - || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 -$as_echo "$as_me: error: could not create $ac_file" >&2;} - { (exit 1); exit 1; }; } ;; - esac - ;; - esac - - ac_dir=`$as_dirname -- "$ac_file" || -$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$ac_file" : 'X\(//\)[^/]' \| \ - X"$ac_file" : 'X\(//\)$' \| \ - X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$ac_file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - { as_dir="$ac_dir" - case $as_dir in #( - -*) as_dir=./$as_dir;; - esac - test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { - as_dirs= - while :; do - case $as_dir in #( - *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( - *) as_qdir=$as_dir;; - esac - as_dirs="'$as_qdir' $as_dirs" - as_dir=`$as_dirname -- "$as_dir" || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - test -d "$as_dir" && break - done - test -z "$as_dirs" || eval "mkdir $as_dirs" - } || test -d "$as_dir" || { { $as_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 -$as_echo "$as_me: error: cannot create directory $as_dir" >&2;} - { (exit 1); exit 1; }; }; } - ac_builddir=. - -case "$ac_dir" in -.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; -*) - ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` - # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` - case $ac_top_builddir_sub in - "") ac_top_builddir_sub=. ac_top_build_prefix= ;; - *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; - esac ;; -esac -ac_abs_top_builddir=$ac_pwd -ac_abs_builddir=$ac_pwd$ac_dir_suffix -# for backward compatibility: -ac_top_builddir=$ac_top_build_prefix - -case $srcdir in - .) # We are building in place. - ac_srcdir=. - ac_top_srcdir=$ac_top_builddir_sub - ac_abs_top_srcdir=$ac_pwd ;; - [\\/]* | ?:[\\/]* ) # Absolute name. - ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir - ac_abs_top_srcdir=$srcdir ;; - *) # Relative name. - ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_build_prefix$srcdir - ac_abs_top_srcdir=$ac_pwd/$srcdir ;; -esac -ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix - - - case $ac_mode in - :F) - # - # CONFIG_FILE - # - - case $INSTALL in - [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; - *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; - esac -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -# If the template does not know about datarootdir, expand it. -# FIXME: This hack should be removed a few years after 2.60. -ac_datarootdir_hack=; ac_datarootdir_seen= - -ac_sed_dataroot=' -/datarootdir/ { - p - q -} -/@datadir@/p -/@docdir@/p -/@infodir@/p -/@localedir@/p -/@mandir@/p -' -case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in -*datarootdir*) ac_datarootdir_seen=yes;; -*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) - { $as_echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 -$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 - ac_datarootdir_hack=' - s&@datadir@&$datadir&g - s&@docdir@&$docdir&g - s&@infodir@&$infodir&g - s&@localedir@&$localedir&g - s&@mandir@&$mandir&g - s&\\\${datarootdir}&$datarootdir&g' ;; -esac -_ACEOF - -# Neutralize VPATH when `$srcdir' = `.'. -# Shell code in configure.ac might set extrasub. -# FIXME: do we really want to maintain this feature? -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -ac_sed_extra="$ac_vpsub -$extrasub -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -:t -/@[a-zA-Z_][a-zA-Z_0-9]*@/!b -s|@configure_input@|$ac_sed_conf_input|;t t -s&@top_builddir@&$ac_top_builddir_sub&;t t -s&@top_build_prefix@&$ac_top_build_prefix&;t t -s&@srcdir@&$ac_srcdir&;t t -s&@abs_srcdir@&$ac_abs_srcdir&;t t -s&@top_srcdir@&$ac_top_srcdir&;t t -s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t -s&@builddir@&$ac_builddir&;t t -s&@abs_builddir@&$ac_abs_builddir&;t t -s&@abs_top_builddir@&$ac_abs_top_builddir&;t t -s&@INSTALL@&$ac_INSTALL&;t t -$ac_datarootdir_hack -" -eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \ - || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 -$as_echo "$as_me: error: could not create $ac_file" >&2;} - { (exit 1); exit 1; }; } - -test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && - { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && - { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && - { $as_echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' -which seems to be undefined. Please make sure it is defined." >&5 -$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' -which seems to be undefined. Please make sure it is defined." >&2;} - - rm -f "$tmp/stdin" - case $ac_file in - -) cat "$tmp/out" && rm -f "$tmp/out";; - *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";; - esac \ - || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 -$as_echo "$as_me: error: could not create $ac_file" >&2;} - { (exit 1); exit 1; }; } - ;; - - - - esac - -done # for ac_tag - - -{ (exit 0); exit 0; } -_ACEOF -chmod +x $CONFIG_STATUS -ac_clean_files=$ac_clean_files_save - -test $ac_write_fail = 0 || - { { $as_echo "$as_me:$LINENO: error: write failure creating $CONFIG_STATUS" >&5 -$as_echo "$as_me: error: write failure creating $CONFIG_STATUS" >&2;} - { (exit 1); exit 1; }; } - - -# configure is writing to config.log, and then calls config.status. -# config.status does its own redirection, appending to config.log. -# Unfortunately, on DOS this fails, as config.log is still kept open -# by configure, so config.status won't be able to write to it; its -# output is simply discarded. So we exec the FD to /dev/null, -# effectively closing config.log, so it can be properly (re)opened and -# appended to by config.status. When coming back to configure, we -# need to make the FD available again. -if test "$no_create" != yes; then - ac_cs_success=: - ac_config_status_args= - test "$silent" = yes && - ac_config_status_args="$ac_config_status_args --quiet" - exec 5>/dev/null - $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false - exec 5>>config.log - # Use ||, not &&, to avoid exiting from the if with $? = 1, which - # would make configure fail if this is the last instruction. - $ac_cs_success || { (exit 1); exit 1; } -fi -if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then - { $as_echo "$as_me:$LINENO: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 -$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} -fi - - diff --git a/winsup/mingw/mingwex/configure.in b/winsup/mingw/mingwex/configure.in deleted file mode 100644 index cc6f1ad66..000000000 --- a/winsup/mingw/mingwex/configure.in +++ /dev/null @@ -1,55 +0,0 @@ -dnl Process this file with autoconf to produce a configure script. - -dnl This file is part of Mingw runtime. -dnl -dnl This program is free software; you can redistribute it and/or modify -dnl it under the terms of the GNU General Public License as published by -dnl the Free Software Foundation; either version 2 of the License, or -dnl (at your option) any later version. -dnl -dnl This program is distributed in the hope that it will be useful, -dnl but WITHOUT ANY WARRANTY; without even the implied warranty of -dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -dnl GNU General Public License for more details. -dnl -dnl You should have received a copy of the GNU General Public License -dnl along with this program; if not, write to the Free Software -dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -AC_PREREQ(2.59) -AC_INIT(imaxabs.c) - -CC=${CC-cc} -AC_SUBST(CC) -AS=${AS-as} -AC_SUBST(AS) -AR=${AR-ar} -AC_SUBST(AR) -LD=${LD-ld} -AC_SUBST(LD) -RANLIB=${RANLIB-ranlib} -AC_SUBST(RANLIB) -DLLTOOL=${DLLTOOL-dlltool} -AC_SUBST(DLLTOOL) -DLLWRAP=${DLLWRAP-dllwrap} -AC_SUBST(DLLWRAP) -AC_CANONICAL_SYSTEM - -case "$target_os" in -*cygwin*) - NO_CYGWIN="$(cd ${srcdir}/../../utils; pwd)/mingw" - ;; -*) - # Build it for MSVCRT by default. - NO_CYGWIN= - ;; -esac - -AC_SUBST(NO_CYGWIN) - -W32API_INCLUDE='-I $(srcdir)/../../w32api/include' -AC_SUBST(W32API_INCLUDE) - -AC_PROG_INSTALL -AC_OUTPUT(Makefile) - diff --git a/winsup/mingw/mingwex/dirent.c b/winsup/mingw/mingwex/dirent.c deleted file mode 100644 index 399a8d1b3..000000000 --- a/winsup/mingw/mingwex/dirent.c +++ /dev/null @@ -1,341 +0,0 @@ -/* - * dirent.c - * This file has no copyright assigned and is placed in the Public Domain. - * This file is a part of the mingw-runtime package. - * No warranty is given; refer to the file DISCLAIMER within the package. - * - * Derived from DIRLIB.C by Matt J. Weinstein - * This note appears in the DIRLIB.H - * DIRLIB.H by M. J. Weinstein Released to public domain 1-Jan-89 - * - * Updated by Jeremy Bettis <jeremy@hksys.com> - * Significantly revised and rewinddir, seekdir and telldir added by Colin - * Peters <colin@fu.is.saga-u.ac.jp> - * - */ - -#include <stdlib.h> -#include <errno.h> -#include <string.h> -#include <io.h> -#include <direct.h> -#include <dirent.h> - -#define WIN32_LEAN_AND_MEAN -#include <windows.h> /* for GetFileAttributes */ - -#include <tchar.h> -#define SUFFIX _T("*") -#define SLASH _T("\\") - - -/* Helper for opendir(). */ -static inline unsigned _tGetFileAttributes (const _TCHAR * tPath) -{ -#ifdef _UNICODE - /* GetFileAttributesW does not work on W9x, so convert to ANSI */ - if (_osver & 0x8000) - { - char aPath [MAX_PATH]; - WideCharToMultiByte (CP_ACP, 0, tPath, -1, aPath, MAX_PATH, NULL, - NULL); - return GetFileAttributesA (aPath); - } - return GetFileAttributesW (tPath); -#else - return GetFileAttributesA (tPath); -#endif -} - -/* - * opendir - * - * Returns a pointer to a DIR structure appropriately filled in to begin - * searching a directory. - */ -_TDIR * -_topendir (const _TCHAR *szPath) -{ - _TDIR *nd; - unsigned int rc; - _TCHAR szFullPath[MAX_PATH]; - - errno = 0; - - if (!szPath) - { - errno = EFAULT; - return (_TDIR *) 0; - } - - if (szPath[0] == _T('\0')) - { - errno = ENOTDIR; - return (_TDIR *) 0; - } - - /* Attempt to determine if the given path really is a directory. */ - rc = _tGetFileAttributes (szPath); - if (rc == (unsigned int)-1) - { - /* call GetLastError for more error info */ - errno = ENOENT; - return (_TDIR *) 0; - } - if (!(rc & FILE_ATTRIBUTE_DIRECTORY)) - { - /* Error, entry exists but not a directory. */ - errno = ENOTDIR; - return (_TDIR *) 0; - } - - /* Make an absolute pathname. */ - _tfullpath (szFullPath, szPath, MAX_PATH); - - /* Allocate enough space to store DIR structure and the complete - * directory path given. */ - nd = (_TDIR *) malloc (sizeof (_TDIR) + (_tcslen (szFullPath) - + _tcslen (SLASH) - + _tcslen (SUFFIX) + 1) - * sizeof (_TCHAR)); - - if (!nd) - { - /* Error, out of memory. */ - errno = ENOMEM; - return (_TDIR *) 0; - } - - /* Create the search expression. */ - _tcscpy (nd->dd_name, szFullPath); - - /* Add on a slash if the path does not end with one. */ - if (nd->dd_name[0] != _T('\0') - && _tcsrchr (nd->dd_name, _T('/')) != nd->dd_name - + _tcslen (nd->dd_name) - 1 - && _tcsrchr (nd->dd_name, _T('\\')) != nd->dd_name - + _tcslen (nd->dd_name) - 1) - { - _tcscat (nd->dd_name, SLASH); - } - - /* Add on the search pattern */ - _tcscat (nd->dd_name, SUFFIX); - - /* Initialize handle to -1 so that a premature closedir doesn't try - * to call _findclose on it. */ - nd->dd_handle = -1; - - /* Initialize the status. */ - nd->dd_stat = 0; - - /* Initialize the dirent structure. ino and reclen are invalid under - * Win32, and name simply points at the appropriate part of the - * findfirst_t structure. */ - nd->dd_dir.d_ino = 0; - nd->dd_dir.d_reclen = 0; - nd->dd_dir.d_namlen = 0; - memset (nd->dd_dir.d_name, 0, FILENAME_MAX); - - return nd; -} - - -/* - * readdir - * - * Return a pointer to a dirent structure filled with the information on the - * next entry in the directory. - */ -struct _tdirent * -_treaddir (_TDIR * dirp) -{ - errno = 0; - - /* Check for valid DIR struct. */ - if (!dirp) - { - errno = EFAULT; - return (struct _tdirent *) 0; - } - - if (dirp->dd_stat < 0) - { - /* We have already returned all files in the directory - * (or the structure has an invalid dd_stat). */ - return (struct _tdirent *) 0; - } - else if (dirp->dd_stat == 0) - { - /* We haven't started the search yet. */ - /* Start the search */ - dirp->dd_handle = _tfindfirst (dirp->dd_name, &(dirp->dd_dta)); - - if (dirp->dd_handle == -1) - { - /* Whoops! Seems there are no files in that - * directory. */ - dirp->dd_stat = -1; - } - else - { - dirp->dd_stat = 1; - } - } - else - { - /* Get the next search entry. */ - if (_tfindnext (dirp->dd_handle, &(dirp->dd_dta))) - { - /* We are off the end or otherwise error. - _findnext sets errno to ENOENT if no more file - Undo this. */ - DWORD winerr = GetLastError (); - if (winerr == ERROR_NO_MORE_FILES) - errno = 0; - _findclose (dirp->dd_handle); - dirp->dd_handle = -1; - dirp->dd_stat = -1; - } - else - { - /* Update the status to indicate the correct - * number. */ - dirp->dd_stat++; - } - } - - if (dirp->dd_stat > 0) - { - /* Successfully got an entry. Everything about the file is - * already appropriately filled in except the length of the - * file name. */ - dirp->dd_dir.d_namlen = _tcslen (dirp->dd_dta.name); - _tcscpy (dirp->dd_dir.d_name, dirp->dd_dta.name); - return &dirp->dd_dir; - } - - return (struct _tdirent *) 0; -} - - -/* - * closedir - * - * Frees up resources allocated by opendir. - */ -int -_tclosedir (_TDIR * dirp) -{ - int rc; - - errno = 0; - rc = 0; - - if (!dirp) - { - errno = EFAULT; - return -1; - } - - if (dirp->dd_handle != -1) - { - rc = _findclose (dirp->dd_handle); - } - - /* Delete the dir structure. */ - free (dirp); - - return rc; -} - -/* - * rewinddir - * - * Return to the beginning of the directory "stream". We simply call findclose - * and then reset things like an opendir. - */ -void -_trewinddir (_TDIR * dirp) -{ - errno = 0; - - if (!dirp) - { - errno = EFAULT; - return; - } - - if (dirp->dd_handle != -1) - { - _findclose (dirp->dd_handle); - } - - dirp->dd_handle = -1; - dirp->dd_stat = 0; -} - -/* - * telldir - * - * Returns the "position" in the "directory stream" which can be used with - * seekdir to go back to an old entry. We simply return the value in stat. - */ -long -_ttelldir (_TDIR * dirp) -{ - errno = 0; - - if (!dirp) - { - errno = EFAULT; - return -1; - } - return dirp->dd_stat; -} - -/* - * seekdir - * - * Seek to an entry previously returned by telldir. We rewind the directory - * and call readdir repeatedly until either dd_stat is the position number - * or -1 (off the end). This is not perfect, in that the directory may - * have changed while we weren't looking. But that is probably the case with - * any such system. - */ -void -_tseekdir (_TDIR * dirp, long lPos) -{ - errno = 0; - - if (!dirp) - { - errno = EFAULT; - return; - } - - if (lPos < -1) - { - /* Seeking to an invalid position. */ - errno = EINVAL; - return; - } - else if (lPos == -1) - { - /* Seek past end. */ - if (dirp->dd_handle != -1) - { - _findclose (dirp->dd_handle); - } - dirp->dd_handle = -1; - dirp->dd_stat = -1; - } - else - { - /* Rewind and read forward to the appropriate index. */ - _trewinddir (dirp); - - while ((dirp->dd_stat < lPos) && _treaddir (dirp)) - ; - } -} diff --git a/winsup/mingw/mingwex/dirname.c b/winsup/mingw/mingwex/dirname.c deleted file mode 100755 index 20d7a30bb..000000000 --- a/winsup/mingw/mingwex/dirname.c +++ /dev/null @@ -1,235 +0,0 @@ -/* dirname.c - * - * $Id$ - * - * Provides an implementation of the "dirname" function, conforming - * to SUSv3, with extensions to accommodate Win32 drive designators, - * and suitable for use on native Microsoft(R) Win32 platforms. - * - * Written by Keith Marshall <keithmarshall@users.sourceforge.net> - * - * This is free software. You may redistribute and/or modify it as you - * see fit, without restriction of copyright. - * - * This software is provided "as is", in the hope that it may be useful, - * but WITHOUT WARRANTY OF ANY KIND, not even any implied warranty of - * MERCHANTABILITY, nor of FITNESS FOR ANY PARTICULAR PURPOSE. At no - * time will the author accept any form of liability for any damages, - * however caused, resulting from the use of this software. - * - */ - -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <libgen.h> -#include <locale.h> - -#ifndef __cdecl /* If compiling on any non-Win32 platform ... */ -#define __cdecl /* this may not be defined. */ -#endif - -__cdecl char *dirname( char *path ) -{ - size_t len; - static char *retfail = NULL; - - /* to handle path names for files in multibyte character locales, - * we need to set up LC_CTYPE to match the host file system locale. - */ - - char *locale = setlocale( LC_CTYPE, NULL ); - if( locale != NULL ) locale = strdup( locale ); - setlocale( LC_CTYPE, "" ); - - if( path && *path ) - { - /* allocate sufficient local storage space, - * in which to create a wide character reference copy of path - */ - - wchar_t refcopy[1 + (len = mbstowcs( NULL, path, 0 ))]; - - /* create the wide character reference copy of path */ - - wchar_t *refpath = refcopy; - len = mbstowcs( refpath, path, len ); - refcopy[ len ] = L'\0'; - - /* SUSv3 identifies a special case, where path is exactly equal to "//"; - * (we will also accept "\\" in the Win32 context, but not "/\" or "\/", - * and neither will we consider paths with an initial drive designator). - * For this special case, SUSv3 allows the implementation to choose to - * return "/" or "//", (or "\" or "\\", since this is Win32); we will - * simply return the path unchanged, (i.e. "//" or "\\"). - */ - - if( (len > 1) && ((refpath[0] == L'/') || (refpath[0] == L'\\')) ) - { - if( (refpath[1] == refpath[0]) && (refpath[2] == L'\0') ) - { - setlocale( LC_CTYPE, locale ); - free( locale ); - return path; - } - } - - /* For all other cases ... - * step over the drive designator, if present ... - */ - - else if( (len > 1) && (refpath[1] == L':') ) - { - /* FIXME: maybe should confirm *refpath is a valid drive designator */ - - refpath += 2; - } - - /* check again, just to ensure we still have a non-empty path name ... */ - - if( *refpath ) - { - /* reproduce the scanning logic of the "basename" function - * to locate the basename component of the current path string, - * (but also remember where the dirname component starts). - */ - - wchar_t *refname, *basename; - for( refname = basename = refpath ; *refpath ; ++refpath ) - { - if( (*refpath == L'/') || (*refpath == L'\\') ) - { - /* we found a dir separator ... - * step over it, and any others which immediately follow it - */ - - while( (*refpath == L'/') || (*refpath == L'\\') ) - ++refpath; - - /* if we didn't reach the end of the path string ... */ - - if( *refpath ) - - /* then we have a new candidate for the base name */ - - basename = refpath; - - else - - /* we struck an early termination of the path string, - * with trailing dir separators following the base name, - * so break out of the for loop, to avoid overrun. - */ - - break; - } - } - - /* now check, - * to confirm that we have distinct dirname and basename components - */ - - if( basename > refname ) - { - /* and, when we do ... - * backtrack over all trailing separators on the dirname component, - * (but preserve exactly two initial dirname separators, if identical), - * and add a NUL terminator in their place. - */ - - do --basename; - while( (basename > refname) && ((*basename == L'/') || (*basename == L'\\')) ); - if( (basename == refname) && ((refname[0] == L'/') || (refname[0] == L'\\')) - && (refname[1] == refname[0]) && (refname[2] != L'/') && (refname[2] != L'\\') ) - ++basename; - *++basename = L'\0'; - - /* if the resultant dirname begins with EXACTLY two dir separators, - * AND both are identical, then we preserve them. - */ - - refpath = refcopy; - while( ((*refpath == L'/') || (*refpath == L'\\')) ) - ++refpath; - if( ((refpath - refcopy) > 2) || (refcopy[1] != refcopy[0]) ) - refpath = refcopy; - - /* and finally ... - * we remove any residual, redundantly duplicated separators from the dirname, - * reterminate, and return it. - */ - - refname = refpath; - while( *refpath ) - { - if( ((*refname++ = *refpath) == L'/') || (*refpath++ == L'\\') ) - { - while( (*refpath == L'/') || (*refpath == L'\\') ) - ++refpath; - } - } - *refname = L'\0'; - - /* finally ... - * transform the resolved dirname back into the multibyte char domain, - * restore the caller's locale, and return the resultant dirname - */ - - if( (len = wcstombs( path, refcopy, len )) != (size_t)(-1) ) - path[ len ] = '\0'; - } - - else - { - /* either there were no dirname separators in the path name, - * or there was nothing else ... - */ - - if( (*refname == L'/') || (*refname == L'\\') ) - { - /* it was all separators, so return one */ - - ++refname; - } - - else - { - /* there were no separators, so return '.' */ - - *refname++ = L'.'; - } - - /* add a NUL terminator, in either case, - * then transform to the multibyte char domain, - * using our own buffer - */ - - *refname = L'\0'; - retfail = realloc( retfail, len = 1 + wcstombs( NULL, refcopy, 0 )); - wcstombs( path = retfail, refcopy, len ); - } - - /* restore caller's locale, clean up, and return the resolved dirname */ - - setlocale( LC_CTYPE, locale ); - free( locale ); - return path; - } - } - - /* path is NULL, or an empty string; default return value is "." ... - * return this in our own buffer, regenerated by wide char transform, - * in case the caller trashed it after a previous call. - */ - - retfail = realloc( retfail, len = 1 + wcstombs( NULL, L".", 0 )); - wcstombs( retfail, L".", len ); - - /* restore caller's locale, clean up, and return the default dirname */ - - setlocale( LC_CTYPE, locale ); - free( locale ); - return retfail; -} - -/* $RCSfile$$Revision$: end of file */ diff --git a/winsup/mingw/mingwex/feclearexcept.c b/winsup/mingw/mingwex/feclearexcept.c deleted file mode 100644 index a68884f41..000000000 --- a/winsup/mingw/mingwex/feclearexcept.c +++ /dev/null @@ -1,24 +0,0 @@ -#include <fenv.h> -#include "cpu_features.h" - -/* 7.6.2.1 - The feclearexcept function clears the supported exceptions - represented by its argument. */ - -int feclearexcept (int excepts) -{ - fenv_t _env; - excepts &= FE_ALL_EXCEPT; - __asm__ volatile ("fnstenv %0;" : "=m" (_env)); /* get the env */ - _env.__status_word &= ~excepts; /* clear the except */ - __asm__ volatile ("fldenv %0;" :: "m" (_env)); /*set the env */ - - if (__HAS_SSE) - { - unsigned _csr; - __asm__ volatile("stmxcsr %0" : "=m" (_csr)); /* get the register */ - _csr &= ~excepts; /* clear the except */ - __asm__ volatile("ldmxcsr %0" : : "m" (_csr)); /* set the register */ - } - return 0; -} diff --git a/winsup/mingw/mingwex/fegetenv.c b/winsup/mingw/mingwex/fegetenv.c deleted file mode 100644 index 0c5d591e7..000000000 --- a/winsup/mingw/mingwex/fegetenv.c +++ /dev/null @@ -1,20 +0,0 @@ -#include <fenv.h> -#include "cpu_features.h" - -/* 7.6.4.1 - The fegetenv function stores the current floating-point environment - in the object pointed to by envp. */ - -int fegetenv (fenv_t * envp) -{ - __asm__ ("fnstenv %0;": "=m" (*envp)); - /* fnstenv sets control word to non-stop for all exceptions, so we - need to reload our env to restore the original mask. */ - __asm__ ("fldenv %0" : : "m" (*envp)); - - /* And the SSE environment. */ - if (__HAS_SSE) - __asm__ ("stmxcsr %0" : "=m" (envp->__mxcsr)); - - return 0; -} diff --git a/winsup/mingw/mingwex/fegetexceptflag.c b/winsup/mingw/mingwex/fegetexceptflag.c deleted file mode 100644 index 353e90dfa..000000000 --- a/winsup/mingw/mingwex/fegetexceptflag.c +++ /dev/null @@ -1,15 +0,0 @@ -#include <fenv.h> - - -/* 7.6.2.2 - The fegetexceptflag function stores an implementation-defined - representation of the exception flags indicated by the argument - excepts in the object pointed to by the argument flagp. */ - -int fegetexceptflag (fexcept_t * flagp, int excepts) -{ - unsigned short _sw; - __asm__ ("fnstsw %%ax;": "=a" (_sw)); - *flagp = _sw & excepts & FE_ALL_EXCEPT; - return 0; -} diff --git a/winsup/mingw/mingwex/fegetround.c b/winsup/mingw/mingwex/fegetround.c deleted file mode 100644 index 01d42849f..000000000 --- a/winsup/mingw/mingwex/fegetround.c +++ /dev/null @@ -1,19 +0,0 @@ -#include <fenv.h> -#include "cpu_features.h" - -/* 7.6.3.1 - The fegetround function returns the value of the rounding direction - macro representing the current rounding direction. */ - -int -fegetround (void) -{ - unsigned short _cw; - __asm__ ("fnstcw %0;" : "=m" (_cw)); - - /* If the MXCSR flag is different, there is no way to indicate, so just - report the FPU flag. */ - return _cw - & (FE_TONEAREST | FE_DOWNWARD | FE_UPWARD | FE_TOWARDZERO); - -} diff --git a/winsup/mingw/mingwex/feholdexcept.c b/winsup/mingw/mingwex/feholdexcept.c deleted file mode 100644 index 66912d85d..000000000 --- a/winsup/mingw/mingwex/feholdexcept.c +++ /dev/null @@ -1,30 +0,0 @@ -#include <fenv.h> -#include "cpu_features.h" - -/* 7.6.4.2 - The feholdexcept function saves the current floating-point - environment in the object pointed to by envp, clears the exception - flags, and then installs a non-stop (continue on exceptions) mode, - if available, for all exceptions. */ - -int feholdexcept (fenv_t * envp) -{ - __asm__ ("fnstenv %0;" : "=m" (* envp)); /* save current into envp */ - /* fnstenv sets control word to non-stop for all exceptions, so all we - need to do is clear the exception flags. */ - __asm__ ("fnclex"); - - if (__HAS_SSE) - { - unsigned int _csr; - /* Save the SSE MXCSR register. */ - __asm__ ("stmxcsr %0" : "=m" (envp->__mxcsr)); - /* Clear the exception flags. */ - _csr = envp->__mxcsr & ~FE_ALL_EXCEPT; - /* Set exception mask to non-stop */ - _csr |= (FE_ALL_EXCEPT << __MXCSR_EXCEPT_MASK_SHIFT) /*= 0x1f80 */; - __asm__ volatile ("ldmxcsr %0" : : "m" (_csr)); - } - - return 0; -} diff --git a/winsup/mingw/mingwex/feraiseexcept.c b/winsup/mingw/mingwex/feraiseexcept.c deleted file mode 100644 index b1ba87006..000000000 --- a/winsup/mingw/mingwex/feraiseexcept.c +++ /dev/null @@ -1,19 +0,0 @@ -#include <fenv.h> - -/* 7.6.2.3 - The feraiseexcept function raises the supported exceptions - represented by its argument The order in which these exceptions - are raised is unspecified, except as stated in F.7.6. - Whether the feraiseexcept function additionally raises - the inexact exception whenever it raises the overflow - or underflow exception is implementation-defined. */ - -int feraiseexcept (int excepts) -{ - fenv_t _env; - __asm__ volatile ("fnstenv %0;" : "=m" (_env)); - _env.__status_word |= excepts & FE_ALL_EXCEPT; - __asm__ volatile ("fldenv %0;" - "fwait;" : : "m" (_env)); - return 0; -} diff --git a/winsup/mingw/mingwex/fesetenv.c b/winsup/mingw/mingwex/fesetenv.c deleted file mode 100644 index 105a0af10..000000000 --- a/winsup/mingw/mingwex/fesetenv.c +++ /dev/null @@ -1,57 +0,0 @@ -#include <fenv.h> -#include <float.h> -#include "cpu_features.h" - -/* 7.6.4.3 - The fesetenv function establishes the floating-point environment - represented by the object pointed to by envp. The argument envp - points to an object set by a call to fegetenv or feholdexcept, or - equal the macro FE_DFL_ENV or an implementation-defined environment - macro. Note that fesetenv merely installs the state of the exception - flags represented through its argument, and does not raise these - exceptions. - */ - -extern void (*_imp___fpreset)( void ) ; - -int fesetenv (const fenv_t * envp) -{ - /* Default mxcsr status is to mask all exceptions. All other bits - are zero. */ - - unsigned int _csr = FE_ALL_EXCEPT << __MXCSR_EXCEPT_MASK_SHIFT /*= 0x1f80 */; - - if (envp == FE_PC64_ENV) - /* - * fninit initializes the control register to 0x37f, - * the status register to zero and the tag word to 0FFFFh. - * The other registers are unaffected. - */ - __asm__ ("fninit"); - - else if (envp == FE_PC53_ENV) - /* - * MS _fpreset() does same *except* it sets control word - * to 0x27f (53-bit precison). - * We force calling _fpreset in msvcrt.dll - */ - - (*_imp___fpreset)(); - - else if (envp == FE_DFL_ENV) - /* Use the choice made at app startup */ - _fpreset(); - - else - { - __asm__ ("fldenv %0;" : : "m" (*envp)); - /* Setting the reserved high order bits of MXCSR causes a segfault */ - _csr = envp ->__mxcsr & 0xffff; - } - - /* Set MXCSR */ - if (__HAS_SSE) - __asm__ volatile ("ldmxcsr %0" : : "m" (_csr)); - - return 0; -} diff --git a/winsup/mingw/mingwex/fesetexceptflag.c b/winsup/mingw/mingwex/fesetexceptflag.c deleted file mode 100644 index 876174b69..000000000 --- a/winsup/mingw/mingwex/fesetexceptflag.c +++ /dev/null @@ -1,33 +0,0 @@ -#include <fenv.h> -#include "cpu_features.h" - -/* 7.6.2.4 - The fesetexceptflag function sets the complete status for those - exception flags indicated by the argument excepts, according to the - representation in the object pointed to by flagp. The value of - *flagp shall have been set by a previous call to fegetexceptflag - whose second argument represented at least those exceptions - represented by the argument excepts. This function does not raise - exceptions, but only sets the state of the flags. */ - -int fesetexceptflag (const fexcept_t * flagp, int excepts) -{ - fenv_t _env; - - excepts &= FE_ALL_EXCEPT; - __asm__ volatile ("fnstenv %0;" : "=m" (_env)); - _env.__status_word &= ~excepts; - _env.__status_word |= (*flagp & excepts); - __asm__ volatile ("fldenv %0;" : : "m" (_env)); - - if (__HAS_SSE) - { - unsigned int _csr; - __asm__ __volatile__("stmxcsr %0" : "=m" (_csr)); - _csr &= ~excepts; - _csr |= *flagp & excepts; - __asm__ volatile ("ldmxcsr %0" : : "m" (_csr)); - } - - return 0; -} diff --git a/winsup/mingw/mingwex/fesetround.c b/winsup/mingw/mingwex/fesetround.c deleted file mode 100644 index f14e6a631..000000000 --- a/winsup/mingw/mingwex/fesetround.c +++ /dev/null @@ -1,31 +0,0 @@ -#include <fenv.h> -#include "cpu_features.h" - - /* 7.6.3.2 - The fesetround function establishes the rounding direction - represented by its argument round. If the argument is not equal - to the value of a rounding direction macro, the rounding direction - is not changed. */ - -int fesetround (int mode) -{ - unsigned short _cw; - if ((mode & ~(FE_TONEAREST | FE_DOWNWARD | FE_UPWARD | FE_TOWARDZERO)) - != 0) - return -1; - __asm__ volatile ("fnstcw %0;": "=m" (_cw)); - _cw &= ~(FE_TONEAREST | FE_DOWNWARD | FE_UPWARD | FE_TOWARDZERO); - _cw |= mode; - __asm__ volatile ("fldcw %0;" : : "m" (_cw)); - - if (__HAS_SSE) - { - unsigned int _mxcsr; - __asm__ volatile ("stmxcsr %0" : "=m" (_mxcsr)); - _mxcsr &= ~ 0x6000; - _mxcsr |= (mode << __MXCSR_ROUND_FLAG_SHIFT); - __asm__ volatile ("ldmxcsr %0" : : "m" (_mxcsr)); - } - - return 0; -} diff --git a/winsup/mingw/mingwex/fetestexcept.c b/winsup/mingw/mingwex/fetestexcept.c deleted file mode 100644 index 062d585eb..000000000 --- a/winsup/mingw/mingwex/fetestexcept.c +++ /dev/null @@ -1,27 +0,0 @@ -#include <fenv.h> -#include "cpu_features.h" -/* 7.6.2.5 - The fetestexcept function determines which of a specified subset of - the exception flags are currently set. The excepts argument - specifies the exception flags to be queried. - The fetestexcept function returns the value of the bitwise OR of the - exception macros corresponding to the currently set exceptions - included in excepts. */ - -int fetestexcept (int excepts) -{ - - unsigned int _res; - __asm__ ("fnstsw %%ax" : "=a" (_res)); - - - /* If SSE supported, return the union of the FPU and SSE flags. */ - if (__HAS_SSE) - { - unsigned int _csr; - __asm__ volatile("stmxcsr %0" : "=m" (_csr)); - _res |= _csr; - } - - return (_res & excepts & FE_ALL_EXCEPT); -} diff --git a/winsup/mingw/mingwex/feupdateenv.c b/winsup/mingw/mingwex/feupdateenv.c deleted file mode 100644 index e37566b02..000000000 --- a/winsup/mingw/mingwex/feupdateenv.c +++ /dev/null @@ -1,26 +0,0 @@ -#include <fenv.h> -#include "cpu_features.h" - -/* 7.6.4.4 - The feupdateenv function saves the currently raised exceptions in - its automatic storage, installs the floating-point environment - represented by the object pointed to by envp, and then raises the - saved exceptions. The argument envp shall point to an object - set by a call to feholdexcept or fegetenv, or equal the macro - FE_DFL_ENV or an implementation-defined environment macro. */ - - -int feupdateenv (const fenv_t * envp) -{ - unsigned int _fexcept; - __asm__ ("fnstsw %%ax" : "=a" (_fexcept)); /*save excepts */ - if (__HAS_SSE) - { - unsigned int _csr; - __asm__ ("stmxcsr %0" : "=m" (_csr)); - _fexcept |= _csr; - } - fesetenv (envp); /* install the env */ - feraiseexcept (_fexcept & FE_ALL_EXCEPT); /* raise the execeptions */ - return 0; -} diff --git a/winsup/mingw/mingwex/ftruncate.c b/winsup/mingw/mingwex/ftruncate.c deleted file mode 100755 index fdb62951a..000000000 --- a/winsup/mingw/mingwex/ftruncate.c +++ /dev/null @@ -1,5 +0,0 @@ -#include <unistd.h> -int ftruncate(int __fd, off_t __length) -{ - return _chsize (__fd, __length); -} diff --git a/winsup/mingw/mingwex/fwide.c b/winsup/mingw/mingwex/fwide.c deleted file mode 100644 index 79d5848f7..000000000 --- a/winsup/mingw/mingwex/fwide.c +++ /dev/null @@ -1,9 +0,0 @@ -#include <wchar.h> -#include <stdio.h> - -int -fwide(FILE* stream, int mode) -{ - return mode; /* Nothing to do. */ -} - diff --git a/winsup/mingw/mingwex/gdtoa/README b/winsup/mingw/mingwex/gdtoa/README deleted file mode 100755 index cf1947aa2..000000000 --- a/winsup/mingw/mingwex/gdtoa/README +++ /dev/null @@ -1,336 +0,0 @@ -This directory contains source for a library of binary -> decimal -and decimal -> binary conversion routines, for single-, double-, -and extended-precision IEEE binary floating-point arithmetic, and -other IEEE-like binary floating-point, including "double double", -as in - - T. J. Dekker, "A Floating-Point Technique for Extending the - Available Precision", Numer. Math. 18 (1971), pp. 224-242 - -and - - "Inside Macintosh: PowerPC Numerics", Addison-Wesley, 1994 - -The conversion routines use double-precision floating-point arithmetic -and, where necessary, high precision integer arithmetic. The routines -are generalizations of the strtod and dtoa routines described in - - David M. Gay, "Correctly Rounded Binary-Decimal and - Decimal-Binary Conversions", Numerical Analysis Manuscript - No. 90-10, Bell Labs, Murray Hill, 1990; - http://cm.bell-labs.com/cm/cs/what/ampl/REFS/rounding.ps.gz - -(based in part on papers by Clinger and Steele & White: see the -references in the above paper). - -The present conversion routines should be able to use any of IEEE binary, -VAX, or IBM-mainframe double-precision arithmetic internally, but I (dmg) -have so far only had a chance to test them with IEEE double precision -arithmetic. - -The core conversion routines are strtodg for decimal -> binary conversions -and gdtoa for binary -> decimal conversions. These routines operate -on arrays of unsigned 32-bit integers of type ULong, a signed 32-bit -exponent of type Long, and arithmetic characteristics described in -struct FPI; FPI, Long, and ULong are defined in gdtoa.h. File arith.h -is supposed to provide #defines that cause gdtoa.h to define its -types correctly. File arithchk.c is source for a program that -generates a suitable arith.h on all systems where I've been able to -test it. - -The core conversion routines are meant to be called by helper routines -that know details of the particular binary arithmetic of interest and -convert. The present directory provides helper routines for 5 variants -of IEEE binary floating-point arithmetic, each indicated by one or -two letters: - - f IEEE single precision - d IEEE double precision - x IEEE extended precision, as on Intel 80x87 - and software emulations of Motorola 68xxx chips - that do not pad the way the 68xxx does, but - only store 80 bits - xL IEEE extended precision, as on Motorola 68xxx chips - Q quad precision, as on Sun Sparc chips - dd double double, pairs of IEEE double numbers - whose sum is the desired value - -For decimal -> binary conversions, there are three families of -helper routines: one for round-nearest: - - strtof - strtod - strtodd - strtopd - strtopf - strtopx - strtopxL - strtopQ - -one with rounding direction specified: - - strtorf - strtord - strtordd - strtorx - strtorxL - strtorQ - -and one for computing an interval (at most one bit wide) that contains -the decimal number: - - strtoIf - strtoId - strtoIdd - strtoIx - strtoIxL - strtoIQ - -The latter call strtoIg, which makes one call on strtodg and adjusts -the result to provide the desired interval. On systems where native -arithmetic can easily make one-ulp adjustments on values in the -desired floating-point format, it might be more efficient to use the -native arithmetic. Routine strtodI is a variant of strtoId that -illustrates one way to do this for IEEE binary double-precision -arithmetic -- but whether this is more efficient remains to be seen. - -Functions strtod and strtof have "natural" return types, float and -double -- strtod is specified by the C standard, and strtof appears -in the stdlib.h of some systems, such as (at least some) Linux systems. -The other functions write their results to their final argument(s): -to the final two argument for the strtoI... (interval) functions, -and to the final argument for the others (strtop... and strtor...). -Where possible, these arguments have "natural" return types (double* -or float*), to permit at least some type checking. In reality, they -are viewed as arrays of ULong (or, for the "x" functions, UShort) -values. On systems where long double is the appropriate type, one can -pass long double* final argument(s) to these routines. The int value -that these routines return is the return value from the call they make -on strtodg; see the enum of possible return values in gdtoa.h. - -Source files g_ddfmt.c, misc.c, smisc.c, strtod.c, strtodg.c, and ulp.c -should use true IEEE double arithmetic (not, e.g., double extended), -at least for storing (and viewing the bits of) the variables declared -"double" within them. - -One detail indicated in struct FPI is whether the target binary -arithmetic departs from the IEEE standard by flushing denormalized -numbers to 0. On systems that do this, the helper routines for -conversion to double-double format (when compiled with -Sudden_Underflow #defined) penalize the bottom of the exponent -range so that they return a nonzero result only when the least -significant bit of the less significant member of the pair of -double values returned can be expressed as a normalized double -value. An alternative would be to drop to 53-bit precision near -the bottom of the exponent range. To get correct rounding, this -would (in general) require two calls on strtodg (one specifying -126-bit arithmetic, then, if necessary, one specifying 53-bit -arithmetic). - -By default, the core routine strtodg and strtod set errno to ERANGE -if the result overflows to +Infinity or underflows to 0. Compile -these routines with NO_ERRNO #defined to inhibit errno assignments. - -Routine strtod is based on netlib's "dtoa.c from fp", and -(f = strtod(s,se)) is more efficient for some conversions than, say, -strtord(s,se,1,&f). Parts of strtod require true IEEE double -arithmetic with the default rounding mode (round-to-nearest) and, on -systems with IEEE extended-precision registers, double-precision -(53-bit) rounding precision. If the machine uses (the equivalent of) -Intel 80x87 arithmetic, the call - _control87(PC_53, MCW_PC); -does this with many compilers. Whether this or another call is -appropriate depends on the compiler; for this to work, it may be -necessary to #include "float.h" or another system-dependent header -file. - -Source file strtodnrp.c gives a strtod that does not require 53-bit -rounding precision on systems (such as Intel IA32 systems) that may -suffer double rounding due to use of extended-precision registers. -For some conversions this variant of strtod is less efficient than the -one in strtod.c when the latter is run with 53-bit rounding precision. - -The values that the strto* routines return for NaNs are determined by -gd_qnan.h, which the makefile generates by running the program whose -source is qnan.c. Note that the rules for distinguishing signaling -from quiet NaNs are system-dependent. For cross-compilation, you need -to determine arith.h and gd_qnan.h suitably, e.g., using the -arithmetic of the target machine. - -C99's hexadecimal floating-point constants are recognized by the -strto* routines (but this feature has not yet been heavily tested). -Compiling with NO_HEX_FP #defined disables this feature. - -When compiled with -DINFNAN_CHECK, the strto* routines recognize C99's -NaN and Infinity syntax. Moreover, unless No_Hex_NaN is #defined, the -strto* routines also recognize C99's NaN(...) syntax: they accept -(case insensitively) strings of the form NaN(x), where x is a string -of hexadecimal digits and spaces; if there is only one string of -hexadecimal digits, it is taken for the fraction bits of the resulting -NaN; if there are two or more strings of hexadecimal digits, each -string is assigned to the next available sequence of 32-bit words of -fractions bits (starting with the most significant), right-aligned in -each sequence. - -For binary -> decimal conversions, I've provided just one family -of helper routines: - - g_ffmt - g_dfmt - g_ddfmt - g_xfmt - g_xLfmt - g_Qfmt - -which do a "%g" style conversion either to a specified number of decimal -places (if their ndig argument is positive), or to the shortest -decimal string that rounds to the given binary floating-point value -(if ndig <= 0). They write into a buffer supplied as an argument -and return either a pointer to the end of the string (a null character) -in the buffer, if the buffer was long enough, or 0. Other forms of -conversion are easily done with the help of gdtoa(), such as %e or %f -style and conversions with direction of rounding specified (so that, if -desired, the decimal value is either >= or <= the binary value). - -For an example of more general conversions based on dtoa(), see -netlib's "printf.c from ampl/solvers". - -For double-double -> decimal, g_ddfmt() assumes IEEE-like arithmetic -of precision max(126, #bits(input)) bits, where #bits(input) is the -number of mantissa bits needed to represent the sum of the two double -values in the input. - -The makefile creates a library, gdtoa.a. To use the helper -routines, a program only needs to include gdtoa.h. All the -source files for gdtoa.a include a more extensive gdtoaimp.h; -among other things, gdtoaimp.h has #defines that make "internal" -names end in _D2A. To make a "system" library, one could modify -these #defines to make the names start with __. - -Various comments about possible #defines appear in gdtoaimp.h, -but for most purposes, arith.h should set suitable #defines. - -Systems with preemptive scheduling of multiple threads require some -manual intervention. On such systems, it's necessary to compile -dmisc.c, dtoa.c gdota.c, and misc.c with MULTIPLE_THREADS #defined, -and to provide (or suitably #define) two locks, acquired by -ACQUIRE_DTOA_LOCK(n) and freed by FREE_DTOA_LOCK(n) for n = 0 or 1. -(The second lock, accessed in pow5mult, ensures lazy evaluation of -only one copy of high powers of 5; omitting this lock would introduce -a small probability of wasting memory, but would otherwise be harmless.) -Routines that call dtoa or gdtoa directly must also invoke freedtoa(s) -to free the value s returned by dtoa or gdtoa. It's OK to do so whether -or not MULTIPLE_THREADS is #defined, and the helper g_*fmt routines -listed above all do this indirectly (in gfmt_D2A(), which they all call). - -By default, there is a private pool of memory of length 2000 bytes -for intermediate quantities, and MALLOC (see gdtoaimp.h) is called only -if the private pool does not suffice. 2000 is large enough that MALLOC -is called only under very unusual circumstances (decimal -> binary -conversion of very long strings) for conversions to and from double -precision. For systems with preemptively scheduled multiple threads -or for conversions to extended or quad, it may be appropriate to -#define PRIVATE_MEM nnnn, where nnnn is a suitable value > 2000. -For extended and quad precisions, -DPRIVATE_MEM=20000 is probably -plenty even for many digits at the ends of the exponent range. -Use of the private pool avoids some overhead. - -Directory test provides some test routines. See its README. -I've also tested this stuff (except double double conversions) -with Vern Paxson's testbase program: see - - V. Paxson and W. Kahan, "A Program for Testing IEEE Binary-Decimal - Conversion", manuscript, May 1991, - ftp://ftp.ee.lbl.gov/testbase-report.ps.Z . - -(The same ftp directory has source for testbase.) - -Some system-dependent additions to CFLAGS in the makefile: - - HU-UX: -Aa -Ae - OSF (DEC Unix): -ieee_with_no_inexact - SunOS 4.1x: -DKR_headers -DBad_float_h - -If you want to put this stuff into a shared library and your -operating system requires export lists for shared libraries, -the following would be an appropriate export list: - - dtoa - freedtoa - g_Qfmt - g_ddfmt - g_dfmt - g_ffmt - g_xLfmt - g_xfmt - gdtoa - strtoIQ - strtoId - strtoIdd - strtoIf - strtoIx - strtoIxL - strtod - strtodI - strtodg - strtof - strtopQ - strtopd - strtopdd - strtopf - strtopx - strtopxL - strtorQ - strtord - strtordd - strtorf - strtorx - strtorxL - -When time permits, I (dmg) hope to write in more detail about the -present conversion routines; for now, this README file must suffice. -Meanwhile, if you wish to write helper functions for other kinds of -IEEE-like arithmetic, some explanation of struct FPI and the bits -array may be helpful. Both gdtoa and strtodg operate on a bits array -described by FPI *fpi. The bits array is of type ULong, a 32-bit -unsigned integer type. Floating-point numbers have fpi->nbits bits, -with the least significant 32 bits in bits[0], the next 32 bits in -bits[1], etc. These numbers are regarded as integers multiplied by -2^e (i.e., 2 to the power of the exponent e), where e is the second -argument (be) to gdtoa and is stored in *exp by strtodg. The minimum -and maximum exponent values fpi->emin and fpi->emax for normalized -floating-point numbers reflect this arrangement. For example, the -P754 standard for binary IEEE arithmetic specifies doubles as having -53 bits, with normalized values of the form 1.xxxxx... times 2^(b-1023), -with 52 bits (the x's) and the biased exponent b represented explicitly; -b is an unsigned integer in the range 1 <= b <= 2046 for normalized -finite doubles, b = 0 for denormals, and b = 2047 for Infinities and NaNs. -To turn an IEEE double into the representation used by strtodg and gdtoa, -we multiply 1.xxxx... by 2^52 (to make it an integer) and reduce the -exponent e = (b-1023) by 52: - - fpi->emin = 1 - 1023 - 52 - fpi->emax = 1046 - 1023 - 52 - -In various wrappers for IEEE double, we actually write -53 + 1 rather -than -52, to emphasize that there are 53 bits including one implicit bit. -Field fpi->rounding indicates the desired rounding direction, with -possible values - FPI_Round_zero = toward 0, - FPI_Round_near = unbiased rounding -- the IEEE default, - FPI_Round_up = toward +Infinity, and - FPI_Round_down = toward -Infinity -given in gdtoa.h. - -Field fpi->sudden_underflow indicates whether strtodg should return -denormals or flush them to zero. Normal floating-point numbers have -bit fpi->nbits in the bits array on. Denormals have it off, with -exponent = fpi->emin. Strtodg provides distinct return values for normals -and denormals; see gdtoa.h. - -Compiling g__fmt.c, strtod.c, and strtodg.c with -DUSE_LOCALE causes -the decimal-point character to be taken from the current locale; otherwise -it is '.'. - -Please send comments to David M. Gay (dmg at acm dot org, with " at " -changed at "@" and " dot " changed to "."). diff --git a/winsup/mingw/mingwex/gdtoa/arithchk.c b/winsup/mingw/mingwex/gdtoa/arithchk.c deleted file mode 100755 index 3211aeda4..000000000 --- a/winsup/mingw/mingwex/gdtoa/arithchk.c +++ /dev/null @@ -1,183 +0,0 @@ -/**************************************************************** -Copyright (C) 1997, 1998 Lucent Technologies -All Rights Reserved - -Permission to use, copy, modify, and distribute this software and -its documentation for any purpose and without fee is hereby -granted, provided that the above copyright notice appear in all -copies and that both that the copyright notice and this -permission notice and warranty disclaimer appear in supporting -documentation, and that the name of Lucent or any of its entities -not be used in advertising or publicity pertaining to -distribution of the software without specific, written prior -permission. - -LUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. -IN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY -SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER -IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF -THIS SOFTWARE. -****************************************************************/ - -/* Try to deduce arith.h from arithmetic properties. */ - -#include <stdio.h> - - static int dalign; - typedef struct -Akind { - char *name; - int kind; - } Akind; - - static Akind -IEEE_8087 = { "IEEE_8087", 1 }, -IEEE_MC68k = { "IEEE_MC68k", 2 }, -IBM = { "IBM", 3 }, -VAX = { "VAX", 4 }, -CRAY = { "CRAY", 5}; - - static Akind * -Lcheck() -{ - union { - double d; - long L[2]; - } u; - struct { - double d; - long L; - } x[2]; - - if (sizeof(x) > 2*(sizeof(double) + sizeof(long))) - dalign = 1; - u.L[0] = u.L[1] = 0; - u.d = 1e13; - if (u.L[0] == 1117925532 && u.L[1] == -448790528) - return &IEEE_MC68k; - if (u.L[1] == 1117925532 && u.L[0] == -448790528) - return &IEEE_8087; - if (u.L[0] == -2065213935 && u.L[1] == 10752) - return &VAX; - if (u.L[0] == 1267827943 && u.L[1] == 704643072) - return &IBM; - return 0; - } - - static Akind * -icheck() -{ - union { - double d; - int L[2]; - } u; - struct { - double d; - int L; - } x[2]; - - if (sizeof(x) > 2*(sizeof(double) + sizeof(int))) - dalign = 1; - u.L[0] = u.L[1] = 0; - u.d = 1e13; - if (u.L[0] == 1117925532 && u.L[1] == -448790528) - return &IEEE_MC68k; - if (u.L[1] == 1117925532 && u.L[0] == -448790528) - return &IEEE_8087; - if (u.L[0] == -2065213935 && u.L[1] == 10752) - return &VAX; - if (u.L[0] == 1267827943 && u.L[1] == 704643072) - return &IBM; - return 0; - } - -char *emptyfmt = ""; /* avoid possible warning message with printf("") */ - - static Akind * -ccheck() -{ - union { - double d; - long L; - } u; - long Cray1; - - /* Cray1 = 4617762693716115456 -- without overflow on non-Crays */ - Cray1 = printf(emptyfmt) < 0 ? 0 : 4617762; - if (printf(emptyfmt, Cray1) >= 0) - Cray1 = 1000000*Cray1 + 693716; - if (printf(emptyfmt, Cray1) >= 0) - Cray1 = 1000000*Cray1 + 115456; - u.d = 1e13; - if (u.L == Cray1) - return &CRAY; - return 0; - } - - static int -fzcheck() -{ - double a, b; - int i; - - a = 1.; - b = .1; - for(i = 155;; b *= b, i >>= 1) { - if (i & 1) { - a *= b; - if (i == 1) - break; - } - } - b = a * a; - return b == 0.; - } - - int -main() -{ - Akind *a = 0; - int Ldef = 0; - FILE *f; - -#ifdef WRITE_ARITH_H /* for Symantec's buggy "make" */ - f = fopen("arith.h", "w"); - if (!f) { - printf("Cannot open arith.h\n"); - return 1; - } -#else - f = stdout; -#endif - - if (sizeof(double) == 2*sizeof(long)) - a = Lcheck(); - else if (sizeof(double) == 2*sizeof(int)) { - Ldef = 1; - a = icheck(); - } - else if (sizeof(double) == sizeof(long)) - a = ccheck(); - if (a) { - fprintf(f, "#define %s\n#define Arith_Kind_ASL %d\n", - a->name, a->kind); - if (Ldef) - fprintf(f, "#define Long int\n#define Intcast (int)(long)\n"); - if (dalign) - fprintf(f, "#define Double_Align\n"); - if (sizeof(char*) == 8) - fprintf(f, "#define X64_bit_pointers\n"); -#ifndef NO_LONG_LONG - if (sizeof(long long) < 8) -#endif - fprintf(f, "#define NO_LONG_LONG\n"); - if (a->kind <= 2 && fzcheck()) - fprintf(f, "#define Sudden_Underflow\n"); - return 0; - } - fprintf(f, "/* Unknown arithmetic */\n"); - return 1; - } diff --git a/winsup/mingw/mingwex/gdtoa/dmisc.c b/winsup/mingw/mingwex/gdtoa/dmisc.c deleted file mode 100755 index b09b0f5cf..000000000 --- a/winsup/mingw/mingwex/gdtoa/dmisc.c +++ /dev/null @@ -1,212 +0,0 @@ -/**************************************************************** - -The author of this software is David M. Gay. - -Copyright (C) 1998 by Lucent Technologies -All Rights Reserved - -Permission to use, copy, modify, and distribute this software and -its documentation for any purpose and without fee is hereby -granted, provided that the above copyright notice appear in all -copies and that both that the copyright notice and this -permission notice and warranty disclaimer appear in supporting -documentation, and that the name of Lucent or any of its entities -not be used in advertising or publicity pertaining to -distribution of the software without specific, written prior -permission. - -LUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. -IN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY -SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER -IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF -THIS SOFTWARE. - -****************************************************************/ - -/* Please send bug reports to David M. Gay (dmg at acm dot org, - * with " at " changed at "@" and " dot " changed to "."). */ - -#include "gdtoaimp.h" - - char * -#ifdef KR_headers -rv_alloc(i) int i; -#else -rv_alloc(int i) -#endif -{ - int j, k, *r; - - j = sizeof(ULong); - for(k = 0; - sizeof(Bigint) - sizeof(ULong) - sizeof(int) + j <= i; - j <<= 1) - k++; - r = (int*)Balloc(k); - *r = k; - return -#ifndef MULTIPLE_THREADS - dtoa_result = -#endif - (char *)(r+1); - } - - char * -#ifdef KR_headers -nrv_alloc(s, rve, n) char *s, **rve; int n; -#else -nrv_alloc(char *s, char **rve, int n) -#endif -{ - char *rv, *t; - - t = rv = rv_alloc(n); - while((*t = *s++) !=0) - t++; - if (rve) - *rve = t; - return rv; - } - -/* freedtoa(s) must be used to free values s returned by dtoa - * when MULTIPLE_THREADS is #defined. It should be used in all cases, - * but for consistency with earlier versions of dtoa, it is optional - * when MULTIPLE_THREADS is not defined. - */ - - void -#ifdef KR_headers -__freedtoa(s) char *s; -#else -__freedtoa(char *s) -#endif -{ - Bigint *b = (Bigint *)((int *)s - 1); - b->maxwds = 1 << (b->k = *(int*)b); - Bfree(b); -#ifndef MULTIPLE_THREADS - if (s == dtoa_result) - dtoa_result = 0; -#endif - } - - int -quorem -#ifdef KR_headers - (b, S) Bigint *b, *S; -#else - (Bigint *b, Bigint *S) -#endif -{ - int n; - ULong *bx, *bxe, q, *sx, *sxe; -#ifdef ULLong - ULLong borrow, carry, y, ys; -#else - ULong borrow, carry, y, ys; -#ifdef Pack_32 - ULong si, z, zs; -#endif -#endif - - n = S->wds; -#ifdef DEBUG - /*debug*/ if (b->wds > n) - /*debug*/ Bug("oversize b in quorem"); -#endif - if (b->wds < n) - return 0; - sx = S->x; - sxe = sx + --n; - bx = b->x; - bxe = bx + n; - q = *bxe / (*sxe + 1); /* ensure q <= true quotient */ -#ifdef DEBUG - /*debug*/ if (q > 9) - /*debug*/ Bug("oversized quotient in quorem"); -#endif - if (q) { - borrow = 0; - carry = 0; - do { -#ifdef ULLong - ys = *sx++ * (ULLong)q + carry; - carry = ys >> 32; - y = *bx - (ys & 0xffffffffUL) - borrow; - borrow = y >> 32 & 1UL; - *bx++ = y & 0xffffffffUL; -#else -#ifdef Pack_32 - si = *sx++; - ys = (si & 0xffff) * q + carry; - zs = (si >> 16) * q + (ys >> 16); - carry = zs >> 16; - y = (*bx & 0xffff) - (ys & 0xffff) - borrow; - borrow = (y & 0x10000) >> 16; - z = (*bx >> 16) - (zs & 0xffff) - borrow; - borrow = (z & 0x10000) >> 16; - Storeinc(bx, z, y); -#else - ys = *sx++ * q + carry; - carry = ys >> 16; - y = *bx - (ys & 0xffff) - borrow; - borrow = (y & 0x10000) >> 16; - *bx++ = y & 0xffff; -#endif -#endif - } - while(sx <= sxe); - if (!*bxe) { - bx = b->x; - while(--bxe > bx && !*bxe) - --n; - b->wds = n; - } - } - if (cmp(b, S) >= 0) { - q++; - borrow = 0; - carry = 0; - bx = b->x; - sx = S->x; - do { -#ifdef ULLong - ys = *sx++ + carry; - carry = ys >> 32; - y = *bx - (ys & 0xffffffffUL) - borrow; - borrow = y >> 32 & 1UL; - *bx++ = y & 0xffffffffUL; -#else -#ifdef Pack_32 - si = *sx++; - ys = (si & 0xffff) + carry; - zs = (si >> 16) + (ys >> 16); - carry = zs >> 16; - y = (*bx & 0xffff) - (ys & 0xffff) - borrow; - borrow = (y & 0x10000) >> 16; - z = (*bx >> 16) - (zs & 0xffff) - borrow; - borrow = (z & 0x10000) >> 16; - Storeinc(bx, z, y); -#else - ys = *sx++ + carry; - carry = ys >> 16; - y = *bx - (ys & 0xffff) - borrow; - borrow = (y & 0x10000) >> 16; - *bx++ = y & 0xffff; -#endif -#endif - } - while(sx <= sxe); - bx = b->x; - bxe = bx + n; - if (!*bxe) { - while(--bxe > bx && !*bxe) - --n; - b->wds = n; - } - } - return q; - } diff --git a/winsup/mingw/mingwex/gdtoa/dtoa.c b/winsup/mingw/mingwex/gdtoa/dtoa.c deleted file mode 100755 index 9360e80a6..000000000 --- a/winsup/mingw/mingwex/gdtoa/dtoa.c +++ /dev/null @@ -1,753 +0,0 @@ -/**************************************************************** - -The author of this software is David M. Gay. - -Copyright (C) 1998, 1999 by Lucent Technologies -All Rights Reserved - -Permission to use, copy, modify, and distribute this software and -its documentation for any purpose and without fee is hereby -granted, provided that the above copyright notice appear in all -copies and that both that the copyright notice and this -permission notice and warranty disclaimer appear in supporting -documentation, and that the name of Lucent or any of its entities -not be used in advertising or publicity pertaining to -distribution of the software without specific, written prior -permission. - -LUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. -IN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY -SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER -IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF -THIS SOFTWARE. - -****************************************************************/ - -/* Please send bug reports to David M. Gay (dmg at acm dot org, - * with " at " changed at "@" and " dot " changed to "."). */ - -#include "gdtoaimp.h" - -/* dtoa for IEEE arithmetic (dmg): convert double to ASCII string. - * - * Inspired by "How to Print Floating-Point Numbers Accurately" by - * Guy L. Steele, Jr. and Jon L. White [Proc. ACM SIGPLAN '90, pp. 112-126]. - * - * Modifications: - * 1. Rather than iterating, we use a simple numeric overestimate - * to determine k = floor(log10(d)). We scale relevant - * quantities using O(log2(k)) rather than O(k) multiplications. - * 2. For some modes > 2 (corresponding to ecvt and fcvt), we don't - * try to generate digits strictly left to right. Instead, we - * compute with fewer bits and propagate the carry if necessary - * when rounding the final digit up. This is often faster. - * 3. Under the assumption that input will be rounded nearest, - * mode 0 renders 1e23 as 1e23 rather than 9.999999999999999e22. - * That is, we allow equality in stopping tests when the - * round-nearest rule will give the same floating-point value - * as would satisfaction of the stopping test with strict - * inequality. - * 4. We remove common factors of powers of 2 from relevant - * quantities. - * 5. When converting floating-point integers less than 1e16, - * we use floating-point arithmetic rather than resorting - * to multiple-precision integers. - * 6. When asked to produce fewer than 15 digits, we first try - * to get by with floating-point arithmetic; we resort to - * multiple-precision integer arithmetic only if we cannot - * guarantee that the floating-point calculation has given - * the correctly rounded result. For k requested digits and - * "uniformly" distributed input, the probability is - * something like 10^(k-15) that we must resort to the Long - * calculation. - */ - -#ifdef Honor_FLT_ROUNDS -#define Rounding rounding -#undef Check_FLT_ROUNDS -#define Check_FLT_ROUNDS -#else -#define Rounding Flt_Rounds -#endif - - char * -__dtoa -#ifdef KR_headers - (d, mode, ndigits, decpt, sign, rve) - double d; int mode, ndigits, *decpt, *sign; char **rve; -#else - (double d, int mode, int ndigits, int *decpt, int *sign, char **rve) -#endif -{ - /* Arguments ndigits, decpt, sign are similar to those - of ecvt and fcvt; trailing zeros are suppressed from - the returned string. If not null, *rve is set to point - to the end of the return value. If d is +-Infinity or NaN, - then *decpt is set to 9999. - - mode: - 0 ==> shortest string that yields d when read in - and rounded to nearest. - 1 ==> like 0, but with Steele & White stopping rule; - e.g. with IEEE P754 arithmetic , mode 0 gives - 1e23 whereas mode 1 gives 9.999999999999999e22. - 2 ==> max(1,ndigits) significant digits. This gives a - return value similar to that of ecvt, except - that trailing zeros are suppressed. - 3 ==> through ndigits past the decimal point. This - gives a return value similar to that from fcvt, - except that trailing zeros are suppressed, and - ndigits can be negative. - 4,5 ==> similar to 2 and 3, respectively, but (in - round-nearest mode) with the tests of mode 0 to - possibly return a shorter string that rounds to d. - With IEEE arithmetic and compilation with - -DHonor_FLT_ROUNDS, modes 4 and 5 behave the same - as modes 2 and 3 when FLT_ROUNDS != 1. - 6-9 ==> Debugging modes similar to mode - 4: don't try - fast floating-point estimate (if applicable). - - Values of mode other than 0-9 are treated as mode 0. - - Sufficient space is allocated to the return value - to hold the suppressed trailing zeros. - */ - - int bbits, b2, b5, be, dig, i, ieps, ilim = 0, ilim0, ilim1 = 0, - j, j1, k, k0, k_check, leftright, m2, m5, s2, s5, - spec_case, try_quick; - Long L; -#ifndef Sudden_Underflow - int denorm; - ULong x; -#endif - Bigint *b, *b1, *delta, *mlo, *mhi, *S; - double d2, ds, eps; - char *s, *s0; -#ifdef Honor_FLT_ROUNDS - int rounding; -#endif -#ifdef SET_INEXACT - int inexact, oldinexact; -#endif - -#ifndef MULTIPLE_THREADS - if (dtoa_result) { - __freedtoa(dtoa_result); - dtoa_result = 0; - } -#endif - - if (word0(d) & Sign_bit) { - /* set sign for everything, including 0's and NaNs */ - *sign = 1; - word0(d) &= ~Sign_bit; /* clear sign bit */ - } - else - *sign = 0; - -#if defined(IEEE_Arith) + defined(VAX) -#ifdef IEEE_Arith - if ((word0(d) & Exp_mask) == Exp_mask) -#else - if (word0(d) == 0x8000) -#endif - { - /* Infinity or NaN */ - *decpt = 9999; -#ifdef IEEE_Arith - if (!word1(d) && !(word0(d) & 0xfffff)) - return nrv_alloc("Infinity", rve, 8); -#endif - return nrv_alloc("NaN", rve, 3); - } -#endif -#ifdef IBM - dval(d) += 0; /* normalize */ -#endif - if (!dval(d)) { - *decpt = 1; - return nrv_alloc("0", rve, 1); - } - -#ifdef SET_INEXACT - try_quick = oldinexact = get_inexact(); - inexact = 1; -#endif -#ifdef Honor_FLT_ROUNDS - if ((rounding = Flt_Rounds) >= 2) { - if (*sign) - rounding = rounding == 2 ? 0 : 2; - else - if (rounding != 2) - rounding = 0; - } -#endif - - b = d2b(dval(d), &be, &bbits); -#ifdef Sudden_Underflow - i = (int)(word0(d) >> Exp_shift1 & (Exp_mask>>Exp_shift1)); -#else - if (( i = (int)(word0(d) >> Exp_shift1 & (Exp_mask>>Exp_shift1)) )!=0) { -#endif - dval(d2) = dval(d); - word0(d2) &= Frac_mask1; - word0(d2) |= Exp_11; -#ifdef IBM - if (( j = 11 - hi0bits(word0(d2) & Frac_mask) )!=0) - dval(d2) /= 1 << j; -#endif - - /* log(x) ~=~ log(1.5) + (x-1.5)/1.5 - * log10(x) = log(x) / log(10) - * ~=~ log(1.5)/log(10) + (x-1.5)/(1.5*log(10)) - * log10(d) = (i-Bias)*log(2)/log(10) + log10(d2) - * - * This suggests computing an approximation k to log10(d) by - * - * k = (i - Bias)*0.301029995663981 - * + ( (d2-1.5)*0.289529654602168 + 0.176091259055681 ); - * - * We want k to be too large rather than too small. - * The error in the first-order Taylor series approximation - * is in our favor, so we just round up the constant enough - * to compensate for any error in the multiplication of - * (i - Bias) by 0.301029995663981; since |i - Bias| <= 1077, - * and 1077 * 0.30103 * 2^-52 ~=~ 7.2e-14, - * adding 1e-13 to the constant term more than suffices. - * Hence we adjust the constant term to 0.1760912590558. - * (We could get a more accurate k by invoking log10, - * but this is probably not worthwhile.) - */ - - i -= Bias; -#ifdef IBM - i <<= 2; - i += j; -#endif -#ifndef Sudden_Underflow - denorm = 0; - } - else { - /* d is denormalized */ - - i = bbits + be + (Bias + (P-1) - 1); - x = i > 32 ? word0(d) << (64 - i) | word1(d) >> (i - 32) - : word1(d) << (32 - i); - dval(d2) = x; - word0(d2) -= 31*Exp_msk1; /* adjust exponent */ - i -= (Bias + (P-1) - 1) + 1; - denorm = 1; - } -#endif - ds = (dval(d2)-1.5)*0.289529654602168 + 0.1760912590558 + i*0.301029995663981; - k = (int)ds; - if (ds < 0. && ds != k) - k--; /* want k = floor(ds) */ - k_check = 1; - if (k >= 0 && k <= Ten_pmax) { - if (dval(d) < tens[k]) - k--; - k_check = 0; - } - j = bbits - i - 1; - if (j >= 0) { - b2 = 0; - s2 = j; - } - else { - b2 = -j; - s2 = 0; - } - if (k >= 0) { - b5 = 0; - s5 = k; - s2 += k; - } - else { - b2 -= k; - b5 = -k; - s5 = 0; - } - if (mode < 0 || mode > 9) - mode = 0; - -#ifndef SET_INEXACT -#ifdef Check_FLT_ROUNDS - try_quick = Rounding == 1; -#else - try_quick = 1; -#endif -#endif /*SET_INEXACT*/ - - if (mode > 5) { - mode -= 4; - try_quick = 0; - } - leftright = 1; - switch(mode) { - case 0: - case 1: - ilim = ilim1 = -1; - i = 18; - ndigits = 0; - break; - case 2: - leftright = 0; - /* no break */ - case 4: - if (ndigits <= 0) - ndigits = 1; - ilim = ilim1 = i = ndigits; - break; - case 3: - leftright = 0; - /* no break */ - case 5: - i = ndigits + k + 1; - ilim = i; - ilim1 = i - 1; - if (i <= 0) - i = 1; - } - s = s0 = rv_alloc(i); - -#ifdef Honor_FLT_ROUNDS - if (mode > 1 && rounding != 1) - leftright = 0; -#endif - - if (ilim >= 0 && ilim <= Quick_max && try_quick) { - - /* Try to get by with floating-point arithmetic. */ - - i = 0; - dval(d2) = dval(d); - k0 = k; - ilim0 = ilim; - ieps = 2; /* conservative */ - if (k > 0) { - ds = tens[k&0xf]; - j = k >> 4; - if (j & Bletch) { - /* prevent overflows */ - j &= Bletch - 1; - dval(d) /= bigtens[n_bigtens-1]; - ieps++; - } - for(; j; j >>= 1, i++) - if (j & 1) { - ieps++; - ds *= bigtens[i]; - } - dval(d) /= ds; - } - else if (( j1 = -k )!=0) { - dval(d) *= tens[j1 & 0xf]; - for(j = j1 >> 4; j; j >>= 1, i++) - if (j & 1) { - ieps++; - dval(d) *= bigtens[i]; - } - } - if (k_check && dval(d) < 1. && ilim > 0) { - if (ilim1 <= 0) - goto fast_failed; - ilim = ilim1; - k--; - dval(d) *= 10.; - ieps++; - } - dval(eps) = ieps*dval(d) + 7.; - word0(eps) -= (P-1)*Exp_msk1; - if (ilim == 0) { - S = mhi = 0; - dval(d) -= 5.; - if (dval(d) > dval(eps)) - goto one_digit; - if (dval(d) < -dval(eps)) - goto no_digits; - goto fast_failed; - } -#ifndef No_leftright - if (leftright) { - /* Use Steele & White method of only - * generating digits needed. - */ - dval(eps) = 0.5/tens[ilim-1] - dval(eps); - for(i = 0;;) { - L = dval(d); - dval(d) -= L; - *s++ = '0' + (int)L; - if (dval(d) < dval(eps)) - goto ret1; - if (1. - dval(d) < dval(eps)) - goto bump_up; - if (++i >= ilim) - break; - dval(eps) *= 10.; - dval(d) *= 10.; - } - } - else { -#endif - /* Generate ilim digits, then fix them up. */ - dval(eps) *= tens[ilim-1]; - for(i = 1;; i++, dval(d) *= 10.) { - L = (Long)(dval(d)); - if (!(dval(d) -= L)) - ilim = i; - *s++ = '0' + (int)L; - if (i == ilim) { - if (dval(d) > 0.5 + dval(eps)) - goto bump_up; - else if (dval(d) < 0.5 - dval(eps)) { - while(*--s == '0'); - s++; - goto ret1; - } - break; - } - } -#ifndef No_leftright - } -#endif - fast_failed: - s = s0; - dval(d) = dval(d2); - k = k0; - ilim = ilim0; - } - - /* Do we have a "small" integer? */ - - if (be >= 0 && k <= Int_max) { - /* Yes. */ - ds = tens[k]; - if (ndigits < 0 && ilim <= 0) { - S = mhi = 0; - if (ilim < 0 || dval(d) <= 5*ds) - goto no_digits; - goto one_digit; - } - for(i = 1;; i++, dval(d) *= 10.) { - L = (Long)(dval(d) / ds); - dval(d) -= L*ds; -#ifdef Check_FLT_ROUNDS - /* If FLT_ROUNDS == 2, L will usually be high by 1 */ - if (dval(d) < 0) { - L--; - dval(d) += ds; - } -#endif - *s++ = '0' + (int)L; - if (!dval(d)) { -#ifdef SET_INEXACT - inexact = 0; -#endif - break; - } - if (i == ilim) { -#ifdef Honor_FLT_ROUNDS - if (mode > 1) - switch(rounding) { - case 0: goto ret1; - case 2: goto bump_up; - } -#endif - dval(d) += dval(d); - if (dval(d) > ds || (dval(d) == ds && L & 1)) { - bump_up: - while(*--s == '9') - if (s == s0) { - k++; - *s = '0'; - break; - } - ++*s++; - } - break; - } - } - goto ret1; - } - - m2 = b2; - m5 = b5; - mhi = mlo = 0; - if (leftright) { - i = -#ifndef Sudden_Underflow - denorm ? be + (Bias + (P-1) - 1 + 1) : -#endif -#ifdef IBM - 1 + 4*P - 3 - bbits + ((bbits + be - 1) & 3); -#else - 1 + P - bbits; -#endif - b2 += i; - s2 += i; - mhi = i2b(1); - } - if (m2 > 0 && s2 > 0) { - i = m2 < s2 ? m2 : s2; - b2 -= i; - m2 -= i; - s2 -= i; - } - if (b5 > 0) { - if (leftright) { - if (m5 > 0) { - mhi = pow5mult(mhi, m5); - b1 = mult(mhi, b); - Bfree(b); - b = b1; - } - if (( j = b5 - m5 )!=0) - b = pow5mult(b, j); - } - else - b = pow5mult(b, b5); - } - S = i2b(1); - if (s5 > 0) - S = pow5mult(S, s5); - - /* Check for special case that d is a normalized power of 2. */ - - spec_case = 0; - if ((mode < 2 || leftright) -#ifdef Honor_FLT_ROUNDS - && rounding == 1 -#endif - ) { - if (!word1(d) && !(word0(d) & Bndry_mask) -#ifndef Sudden_Underflow - && word0(d) & (Exp_mask & ~Exp_msk1) -#endif - ) { - /* The special case */ - b2 += Log2P; - s2 += Log2P; - spec_case = 1; - } - } - - /* Arrange for convenient computation of quotients: - * shift left if necessary so divisor has 4 leading 0 bits. - * - * Perhaps we should just compute leading 28 bits of S once - * and for all and pass them and a shift to quorem, so it - * can do shifts and ors to compute the numerator for q. - */ -#ifdef Pack_32 - if (( i = ((s5 ? 32 - hi0bits(S->x[S->wds-1]) : 1) + s2) & 0x1f )!=0) - i = 32 - i; -#else - if (( i = ((s5 ? 32 - hi0bits(S->x[S->wds-1]) : 1) + s2) & 0xf )!=0) - i = 16 - i; -#endif - if (i > 4) { - i -= 4; - b2 += i; - m2 += i; - s2 += i; - } - else if (i < 4) { - i += 28; - b2 += i; - m2 += i; - s2 += i; - } - if (b2 > 0) - b = lshift(b, b2); - if (s2 > 0) - S = lshift(S, s2); - if (k_check) { - if (cmp(b,S) < 0) { - k--; - b = multadd(b, 10, 0); /* we botched the k estimate */ - if (leftright) - mhi = multadd(mhi, 10, 0); - ilim = ilim1; - } - } - if (ilim <= 0 && (mode == 3 || mode == 5)) { - if (ilim < 0 || cmp(b,S = multadd(S,5,0)) <= 0) { - /* no digits, fcvt style */ - no_digits: - k = -1 - ndigits; - goto ret; - } - one_digit: - *s++ = '1'; - k++; - goto ret; - } - if (leftright) { - if (m2 > 0) - mhi = lshift(mhi, m2); - - /* Compute mlo -- check for special case - * that d is a normalized power of 2. - */ - - mlo = mhi; - if (spec_case) { - mhi = Balloc(mhi->k); - Bcopy(mhi, mlo); - mhi = lshift(mhi, Log2P); - } - - for(i = 1;;i++) { - dig = quorem(b,S) + '0'; - /* Do we yet have the shortest decimal string - * that will round to d? - */ - j = cmp(b, mlo); - delta = diff(S, mhi); - j1 = delta->sign ? 1 : cmp(b, delta); - Bfree(delta); -#ifndef ROUND_BIASED - if (j1 == 0 && mode != 1 && !(word1(d) & 1) -#ifdef Honor_FLT_ROUNDS - && rounding >= 1 -#endif - ) { - if (dig == '9') - goto round_9_up; - if (j > 0) - dig++; -#ifdef SET_INEXACT - else if (!b->x[0] && b->wds <= 1) - inexact = 0; -#endif - *s++ = dig; - goto ret; - } -#endif - if (j < 0 || (j == 0 && mode != 1 -#ifndef ROUND_BIASED - && !(word1(d) & 1) -#endif - )) { - if (!b->x[0] && b->wds <= 1) { -#ifdef SET_INEXACT - inexact = 0; -#endif - goto accept_dig; - } -#ifdef Honor_FLT_ROUNDS - if (mode > 1) - switch(rounding) { - case 0: goto accept_dig; - case 2: goto keep_dig; - } -#endif /*Honor_FLT_ROUNDS*/ - if (j1 > 0) { - b = lshift(b, 1); - j1 = cmp(b, S); - if ((j1 > 0 || (j1 == 0 && dig & 1)) - && dig++ == '9') - goto round_9_up; - } - accept_dig: - *s++ = dig; - goto ret; - } - if (j1 > 0) { -#ifdef Honor_FLT_ROUNDS - if (!rounding) - goto accept_dig; -#endif - if (dig == '9') { /* possible if i == 1 */ - round_9_up: - *s++ = '9'; - goto roundoff; - } - *s++ = dig + 1; - goto ret; - } -#ifdef Honor_FLT_ROUNDS - keep_dig: -#endif - *s++ = dig; - if (i == ilim) - break; - b = multadd(b, 10, 0); - if (mlo == mhi) - mlo = mhi = multadd(mhi, 10, 0); - else { - mlo = multadd(mlo, 10, 0); - mhi = multadd(mhi, 10, 0); - } - } - } - else - for(i = 1;; i++) { - *s++ = dig = quorem(b,S) + '0'; - if (!b->x[0] && b->wds <= 1) { -#ifdef SET_INEXACT - inexact = 0; -#endif - goto ret; - } - if (i >= ilim) - break; - b = multadd(b, 10, 0); - } - - /* Round off last digit */ - -#ifdef Honor_FLT_ROUNDS - switch(rounding) { - case 0: goto trimzeros; - case 2: goto roundoff; - } -#endif - b = lshift(b, 1); - j = cmp(b, S); - if (j > 0 || (j == 0 && dig & 1)) { - roundoff: - while(*--s == '9') - if (s == s0) { - k++; - *s++ = '1'; - goto ret; - } - ++*s++; - } - else { - // trimzeros: - while(*--s == '0'); - s++; - } - ret: - Bfree(S); - if (mhi) { - if (mlo && mlo != mhi) - Bfree(mlo); - Bfree(mhi); - } - ret1: -#ifdef SET_INEXACT - if (inexact) { - if (!oldinexact) { - word0(d) = Exp_1 + (70 << Exp_shift); - word1(d) = 0; - dval(d) += 1.; - } - } - else if (!oldinexact) - clear_inexact(); -#endif - Bfree(b); - *s = 0; - *decpt = k + 1; - if (rve) - *rve = s; - return s0; - } diff --git a/winsup/mingw/mingwex/gdtoa/g__fmt.c b/winsup/mingw/mingwex/gdtoa/g__fmt.c deleted file mode 100755 index e40d4bb3e..000000000 --- a/winsup/mingw/mingwex/gdtoa/g__fmt.c +++ /dev/null @@ -1,99 +0,0 @@ -/**************************************************************** - -The author of this software is David M. Gay. - -Copyright (C) 1998 by Lucent Technologies -All Rights Reserved - -Permission to use, copy, modify, and distribute this software and -its documentation for any purpose and without fee is hereby -granted, provided that the above copyright notice appear in all -copies and that both that the copyright notice and this -permission notice and warranty disclaimer appear in supporting -documentation, and that the name of Lucent or any of its entities -not be used in advertising or publicity pertaining to -distribution of the software without specific, written prior -permission. - -LUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. -IN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY -SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER -IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF -THIS SOFTWARE. - -****************************************************************/ - -/* Please send bug reports to David M. Gay (dmg at acm dot org, - * with " at " changed at "@" and " dot " changed to "."). */ - -#include "gdtoaimp.h" - -#ifdef USE_LOCALE -#include "locale.h" -#endif - - char * -#ifdef KR_headers -__g__fmt(b, s, se, decpt, sign) char *b; char *s; char *se; int decpt; ULong sign; -#else -__g__fmt(char *b, char *s, char *se, int decpt, ULong sign) -#endif -{ - int i, j, k; - char *s0 = s; -#ifdef USE_LOCALE - char decimalpoint = *localeconv()->decimal_point; -#else -#define decimalpoint '.' -#endif - if (sign) - *b++ = '-'; - if (decpt <= -4 || decpt > se - s + 5) { - *b++ = *s++; - if (*s) { - *b++ = decimalpoint; - while((*b = *s++) !=0) - b++; - } - *b++ = 'e'; - /* sprintf(b, "%+.2d", decpt - 1); */ - if (--decpt < 0) { - *b++ = '-'; - decpt = -decpt; - } - else - *b++ = '+'; - for(j = 2, k = 10; 10*k <= decpt; j++, k *= 10){} - for(;;) { - i = decpt / k; - *b++ = i + '0'; - if (--j <= 0) - break; - decpt -= i*k; - decpt *= 10; - } - *b = 0; - } - else if (decpt <= 0) { - *b++ = decimalpoint; - for(; decpt < 0; decpt++) - *b++ = '0'; - while((*b = *s++) !=0) - b++; - } - else { - while((*b = *s++) !=0) { - b++; - if (--decpt == 0 && *s) - *b++ = decimalpoint; - } - for(; decpt > 0; decpt--) - *b++ = '0'; - *b = 0; - } - __freedtoa(s0); - return b; - } diff --git a/winsup/mingw/mingwex/gdtoa/g_dfmt.c b/winsup/mingw/mingwex/gdtoa/g_dfmt.c deleted file mode 100755 index 2d8f07000..000000000 --- a/winsup/mingw/mingwex/gdtoa/g_dfmt.c +++ /dev/null @@ -1,89 +0,0 @@ -/**************************************************************** - -The author of this software is David M. Gay. - -Copyright (C) 1998 by Lucent Technologies -All Rights Reserved - -Permission to use, copy, modify, and distribute this software and -its documentation for any purpose and without fee is hereby -granted, provided that the above copyright notice appear in all -copies and that both that the copyright notice and this -permission notice and warranty disclaimer appear in supporting -documentation, and that the name of Lucent or any of its entities -not be used in advertising or publicity pertaining to -distribution of the software without specific, written prior -permission. - -LUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. -IN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY -SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER -IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF -THIS SOFTWARE. - -****************************************************************/ - -/* Please send bug reports to David M. Gay (dmg at acm dot org, - * with " at " changed at "@" and " dot " changed to "."). */ - -#include "gdtoaimp.h" - - char* -#ifdef KR_headers -__g_dfmt(buf, d, ndig, bufsize) char *buf; double *d; int ndig; unsigned bufsize; -#else -__g_dfmt(char *buf, double *d, int ndig, unsigned bufsize) -#endif -{ - static FPI fpi = { 53, 1-1023-53+1, 2046-1023-53+1, 1, 0 }; - char *b, *s, *se; - ULong bits[2], *L, sign; - int decpt, ex, i, mode; - - if (ndig < 0) - ndig = 0; - if (bufsize < ndig + 10) - return 0; - - L = (ULong*)d; - sign = L[_0] & 0x80000000L; - if ((L[_0] & 0x7ff00000) == 0x7ff00000) { - /* Infinity or NaN */ - if (L[_0] & 0xfffff || L[_1]) { - return strcp(buf, "NaN"); - } - b = buf; - if (sign) - *b++ = '-'; - return strcp(b, "Infinity"); - } - if (L[_1] == 0 && (L[_0] ^ sign) == 0 /*d == 0.*/) { - b = buf; -#ifndef IGNORE_ZERO_SIGN - if (L[_0] & 0x80000000L) - *b++ = '-'; -#endif - *b++ = '0'; - *b = 0; - return b; - } - bits[0] = L[_1]; - bits[1] = L[_0] & 0xfffff; - if ( (ex = (L[_0] >> 20) & 0x7ff) !=0) - bits[1] |= 0x100000; - else - ex = 1; - ex -= 0x3ff + 52; - mode = 2; - if (ndig <= 0) { - if (bufsize < 25) - return 0; - mode = 0; - } - i = STRTOG_Normal; - s = __gdtoa(&fpi, ex, bits, &i, mode, ndig, &decpt, &se); - return __g__fmt(buf, s, se, decpt, sign); - } diff --git a/winsup/mingw/mingwex/gdtoa/g_ffmt.c b/winsup/mingw/mingwex/gdtoa/g_ffmt.c deleted file mode 100755 index e62259dd6..000000000 --- a/winsup/mingw/mingwex/gdtoa/g_ffmt.c +++ /dev/null @@ -1,88 +0,0 @@ -/**************************************************************** - -The author of this software is David M. Gay. - -Copyright (C) 1998 by Lucent Technologies -All Rights Reserved - -Permission to use, copy, modify, and distribute this software and -its documentation for any purpose and without fee is hereby -granted, provided that the above copyright notice appear in all -copies and that both that the copyright notice and this -permission notice and warranty disclaimer appear in supporting -documentation, and that the name of Lucent or any of its entities -not be used in advertising or publicity pertaining to -distribution of the software without specific, written prior -permission. - -LUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. -IN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY -SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER -IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF -THIS SOFTWARE. - -****************************************************************/ - -/* Please send bug reports to David M. Gay (dmg at acm dot org, - * with " at " changed at "@" and " dot " changed to "."). */ - -#include "gdtoaimp.h" - - char* -#ifdef KR_headers -__g_ffmt(buf, f, ndig, bufsize) char *buf; float *f; int ndig; unsigned bufsize; -#else -__g_ffmt(char *buf, float *f, int ndig, unsigned bufsize) -#endif -{ - static FPI fpi = { 24, 1-127-24+1, 254-127-24+1, 1, 0 }; - char *b, *s, *se; - ULong bits[1], *L, sign; - int decpt, ex, i, mode; - - if (ndig < 0) - ndig = 0; - if (bufsize < ndig + 10) - return 0; - - L = (ULong*)f; - sign = L[0] & 0x80000000L; - if ((L[0] & 0x7f800000) == 0x7f800000) { - /* Infinity or NaN */ - if (L[0] & 0x7fffff) { - return strcp(buf, "NaN"); - } - b = buf; - if (sign) - *b++ = '-'; - return strcp(b, "Infinity"); - } - if (*f == 0.) { - b = buf; -#ifndef IGNORE_ZERO_SIGN - if (L[0] & 0x80000000L) - *b++ = '-'; -#endif - *b++ = '0'; - *b = 0; - return b; - } - bits[0] = L[0] & 0x7fffff; - if ( (ex = (L[0] >> 23) & 0xff) !=0) - bits[0] |= 0x800000; - else - ex = 1; - ex -= 0x7f + 23; - mode = 2; - if (ndig <= 0) { - if (bufsize < 16) - return 0; - mode = 0; - } - i = STRTOG_Normal; - s = __gdtoa(&fpi, ex, bits, &i, mode, ndig, &decpt, &se); - return __g__fmt(buf, s, se, decpt, sign); - } diff --git a/winsup/mingw/mingwex/gdtoa/g_xfmt.c b/winsup/mingw/mingwex/gdtoa/g_xfmt.c deleted file mode 100755 index 8015403e3..000000000 --- a/winsup/mingw/mingwex/gdtoa/g_xfmt.c +++ /dev/null @@ -1,125 +0,0 @@ -/**************************************************************** - -The author of this software is David M. Gay. - -Copyright (C) 1998 by Lucent Technologies -All Rights Reserved - -Permission to use, copy, modify, and distribute this software and -its documentation for any purpose and without fee is hereby -granted, provided that the above copyright notice appear in all -copies and that both that the copyright notice and this -permission notice and warranty disclaimer appear in supporting -documentation, and that the name of Lucent or any of its entities -not be used in advertising or publicity pertaining to -distribution of the software without specific, written prior -permission. - -LUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. -IN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY -SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER -IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF -THIS SOFTWARE. - -****************************************************************/ - -/* Please send bug reports to David M. Gay (dmg at acm dot org, - * with " at " changed at "@" and " dot " changed to "."). */ - -#include "gdtoaimp.h" - -#undef _0 -#undef _1 - -/* one or the other of IEEE_MC68k or IEEE_8087 should be #defined */ - -#ifdef IEEE_MC68k -#define _0 0 -#define _1 1 -#define _2 2 -#define _3 3 -#define _4 4 -#endif -#ifdef IEEE_8087 -#define _0 4 -#define _1 3 -#define _2 2 -#define _3 1 -#define _4 0 -#endif - - char* -#ifdef KR_headers -__g_xfmt(buf, V, ndig, bufsize) char *buf; char *V; int ndig; unsigned bufsize; -#else -__g_xfmt(char *buf, void *V, int ndig, unsigned bufsize) -#endif -{ - static FPI fpi = { 64, 1-16383-64+1, 32766 - 16383 - 64 + 1, 1, 0 }; - char *b, *s, *se; - ULong bits[2], sign; - UShort *L; - int decpt, ex, i, mode; - - int fptype = __fpclassifyl (*(long double*) V); - - if (ndig < 0) - ndig = 0; - if (bufsize < ndig + 10) - return 0; - - L = (UShort *)V; - sign = L[_0] & 0x8000; - ex = L[_0] & 0x7fff; - - bits[1] = (L[_1] << 16) | L[_2]; - bits[0] = (L[_3] << 16) | L[_4]; - - if (fptype & FP_NAN) /* NaN or Inf */ - { - if (fptype & FP_NORMAL) - { - b = buf; - *b++ = sign ? '-': '+'; - strncpy (b, "Infinity", ndig ? ndig : 8); - return (buf + strlen (buf)); - } - strncpy (buf, "NaN", ndig ? ndig : 3); - return (buf + strlen (buf)); - } - - else if (fptype & FP_NORMAL) /* Normal or subnormal */ - { - if (fptype & FP_ZERO) - { - i = STRTOG_Denormal; - ex = 1; - } - else - i = STRTOG_Normal; - } - else { - i = STRTOG_Zero; - b = buf; -#ifndef IGNORE_ZERO_SIGN - if (sign) - *b++ = '-'; -#endif - *b++ = '0'; - *b = 0; - return b; - } - - ex -= 0x3fff + 63; - mode = 2; - if (ndig <= 0) { - if (bufsize < 32) - return 0; - mode = 0; - } - s = __gdtoa(&fpi, ex, bits, &i, mode, ndig, &decpt, &se); - return __g__fmt(buf, s, se, decpt, sign); - } diff --git a/winsup/mingw/mingwex/gdtoa/gd_arith.h b/winsup/mingw/mingwex/gdtoa/gd_arith.h deleted file mode 100644 index 9746f9c1c..000000000 --- a/winsup/mingw/mingwex/gdtoa/gd_arith.h +++ /dev/null @@ -1,3 +0,0 @@ -#define IEEE_8087
-#define Arith_Kind_ASL 1
-#define Double_Align
diff --git a/winsup/mingw/mingwex/gdtoa/gd_qnan.h b/winsup/mingw/mingwex/gdtoa/gd_qnan.h deleted file mode 100644 index de55c3afc..000000000 --- a/winsup/mingw/mingwex/gdtoa/gd_qnan.h +++ /dev/null @@ -1,12 +0,0 @@ -#define f_QNAN 0xffc00000
-#define d_QNAN0 0x0
-#define d_QNAN1 0xfff80000
-#define ld_QNAN0 0x0
-#define ld_QNAN1 0xc0000000
-#define ld_QNAN2 0xffff
-#define ld_QNAN3 0x0
-#define ldus_QNAN0 0x0
-#define ldus_QNAN1 0x0
-#define ldus_QNAN2 0x0
-#define ldus_QNAN3 0xc000
-#define ldus_QNAN4 0xffff
diff --git a/winsup/mingw/mingwex/gdtoa/gdtoa.c b/winsup/mingw/mingwex/gdtoa/gdtoa.c deleted file mode 100755 index cafb80743..000000000 --- a/winsup/mingw/mingwex/gdtoa/gdtoa.c +++ /dev/null @@ -1,758 +0,0 @@ -/**************************************************************** - -The author of this software is David M. Gay. - -Copyright (C) 1998, 1999 by Lucent Technologies -All Rights Reserved - -Permission to use, copy, modify, and distribute this software and -its documentation for any purpose and without fee is hereby -granted, provided that the above copyright notice appear in all -copies and that both that the copyright notice and this -permission notice and warranty disclaimer appear in supporting -documentation, and that the name of Lucent or any of its entities -not be used in advertising or publicity pertaining to -distribution of the software without specific, written prior -permission. - -LUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. -IN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY -SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER -IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF -THIS SOFTWARE. - -****************************************************************/ - -/* Please send bug reports to David M. Gay (dmg at acm dot org, - * with " at " changed at "@" and " dot " changed to "."). */ - -#include "gdtoaimp.h" - - static Bigint * -#ifdef KR_headers -bitstob(bits, nbits, bbits) ULong *bits; int nbits; int *bbits; -#else -bitstob(ULong *bits, int nbits, int *bbits) -#endif -{ - int i, k; - Bigint *b; - ULong *be, *x, *x0; - - i = ULbits; - k = 0; - while(i < nbits) { - i <<= 1; - k++; - } -#ifndef Pack_32 - if (!k) - k = 1; -#endif - b = Balloc(k); - be = bits + ((nbits - 1) >> kshift); - x = x0 = b->x; - do { - *x++ = *bits & ALL_ON; -#ifdef Pack_16 - *x++ = (*bits >> 16) & ALL_ON; -#endif - } while(++bits <= be); - i = x - x0; - while(!x0[--i]) - if (!i) { - b->wds = 0; - *bbits = 0; - goto ret; - } - b->wds = i + 1; - *bbits = i*ULbits + 32 - hi0bits(b->x[i]); - ret: - return b; - } - -/* dtoa for IEEE arithmetic (dmg): convert double to ASCII string. - * - * Inspired by "How to Print Floating-Point Numbers Accurately" by - * Guy L. Steele, Jr. and Jon L. White [Proc. ACM SIGPLAN '90, pp. 112-126]. - * - * Modifications: - * 1. Rather than iterating, we use a simple numeric overestimate - * to determine k = floor(log10(d)). We scale relevant - * quantities using O(log2(k)) rather than O(k) multiplications. - * 2. For some modes > 2 (corresponding to ecvt and fcvt), we don't - * try to generate digits strictly left to right. Instead, we - * compute with fewer bits and propagate the carry if necessary - * when rounding the final digit up. This is often faster. - * 3. Under the assumption that input will be rounded nearest, - * mode 0 renders 1e23 as 1e23 rather than 9.999999999999999e22. - * That is, we allow equality in stopping tests when the - * round-nearest rule will give the same floating-point value - * as would satisfaction of the stopping test with strict - * inequality. - * 4. We remove common factors of powers of 2 from relevant - * quantities. - * 5. When converting floating-point integers less than 1e16, - * we use floating-point arithmetic rather than resorting - * to multiple-precision integers. - * 6. When asked to produce fewer than 15 digits, we first try - * to get by with floating-point arithmetic; we resort to - * multiple-precision integer arithmetic only if we cannot - * guarantee that the floating-point calculation has given - * the correctly rounded result. For k requested digits and - * "uniformly" distributed input, the probability is - * something like 10^(k-15) that we must resort to the Long - * calculation. - */ - - char * -__gdtoa -#ifdef KR_headers - (fpi, be, bits, kindp, mode, ndigits, decpt, rve) - FPI *fpi; int be; ULong *bits; - int *kindp, mode, ndigits, *decpt; char **rve; -#else - (FPI *fpi, int be, ULong *bits, int *kindp, int mode, int ndigits, int *decpt, char **rve) -#endif -{ - /* Arguments ndigits and decpt are similar to the second and third - arguments of ecvt and fcvt; trailing zeros are suppressed from - the returned string. If not null, *rve is set to point - to the end of the return value. If d is +-Infinity or NaN, - then *decpt is set to 9999. - - mode: - 0 ==> shortest string that yields d when read in - and rounded to nearest. - 1 ==> like 0, but with Steele & White stopping rule; - e.g. with IEEE P754 arithmetic , mode 0 gives - 1e23 whereas mode 1 gives 9.999999999999999e22. - 2 ==> max(1,ndigits) significant digits. This gives a - return value similar to that of ecvt, except - that trailing zeros are suppressed. - 3 ==> through ndigits past the decimal point. This - gives a return value similar to that from fcvt, - except that trailing zeros are suppressed, and - ndigits can be negative. - 4-9 should give the same return values as 2-3, i.e., - 4 <= mode <= 9 ==> same return as mode - 2 + (mode & 1). These modes are mainly for - debugging; often they run slower but sometimes - faster than modes 2-3. - 4,5,8,9 ==> left-to-right digit generation. - 6-9 ==> don't try fast floating-point estimate - (if applicable). - - Values of mode other than 0-9 are treated as mode 0. - - Sufficient space is allocated to the return value - to hold the suppressed trailing zeros. - */ - - int bbits, b2, b5, be0, dig, i, ieps, ilim = 0, ilim0, ilim1 = 0, inex; - int j, j1, k, k0, k_check, kind, leftright, m2, m5, nbits; - int rdir, s2, s5, spec_case, try_quick; - Long L; - Bigint *b, *b1, *delta, *mlo, *mhi, *mhi1, *S; - double d, d2, ds, eps; - char *s, *s0; - -#ifndef MULTIPLE_THREADS - if (dtoa_result) { - __freedtoa(dtoa_result); - dtoa_result = 0; - } -#endif - inex = 0; - kind = *kindp &= ~STRTOG_Inexact; - switch(kind & STRTOG_Retmask) { - case STRTOG_Zero: - goto ret_zero; - case STRTOG_Normal: - case STRTOG_Denormal: - break; - case STRTOG_Infinite: - *decpt = -32768; - return nrv_alloc("Infinity", rve, 8); - case STRTOG_NaN: - *decpt = -32768; - return nrv_alloc("NaN", rve, 3); - default: - return 0; - } - b = bitstob(bits, nbits = fpi->nbits, &bbits); - be0 = be; - if ( (i = trailz(b)) !=0) { - rshift(b, i); - be += i; - bbits -= i; - } - if (!b->wds) { - Bfree(b); - ret_zero: - *decpt = 1; - return nrv_alloc("0", rve, 1); - } - - dval(d) = b2d(b, &i); - i = be + bbits - 1; - word0(d) &= Frac_mask1; - word0(d) |= Exp_11; -#ifdef IBM - if ( (j = 11 - hi0bits(word0(d) & Frac_mask)) !=0) - dval(d) /= 1 << j; -#endif - - /* log(x) ~=~ log(1.5) + (x-1.5)/1.5 - * log10(x) = log(x) / log(10) - * ~=~ log(1.5)/log(10) + (x-1.5)/(1.5*log(10)) - * log10(d) = (i-Bias)*log(2)/log(10) + log10(d2) - * - * This suggests computing an approximation k to log10(d) by - * - * k = (i - Bias)*0.301029995663981 - * + ( (d2-1.5)*0.289529654602168 + 0.176091259055681 ); - * - * We want k to be too large rather than too small. - * The error in the first-order Taylor series approximation - * is in our favor, so we just round up the constant enough - * to compensate for any error in the multiplication of - * (i - Bias) by 0.301029995663981; since |i - Bias| <= 1077, - * and 1077 * 0.30103 * 2^-52 ~=~ 7.2e-14, - * adding 1e-13 to the constant term more than suffices. - * Hence we adjust the constant term to 0.1760912590558. - * (We could get a more accurate k by invoking log10, - * but this is probably not worthwhile.) - */ -#ifdef IBM - i <<= 2; - i += j; -#endif - ds = (dval(d)-1.5)*0.289529654602168 + 0.1760912590558 + i*0.301029995663981; - - /* correct assumption about exponent range */ - if ((j = i) < 0) - j = -j; - if ((j -= 1077) > 0) - ds += j * 7e-17; - - k = (int)ds; - if (ds < 0. && ds != k) - k--; /* want k = floor(ds) */ - k_check = 1; -#ifdef IBM - j = be + bbits - 1; - if ( (j1 = j & 3) !=0) - dval(d) *= 1 << j1; - word0(d) += j << Exp_shift - 2 & Exp_mask; -#else - word0(d) += (be + bbits - 1) << Exp_shift; -#endif - if (k >= 0 && k <= Ten_pmax) { - if (dval(d) < tens[k]) - k--; - k_check = 0; - } - j = bbits - i - 1; - if (j >= 0) { - b2 = 0; - s2 = j; - } - else { - b2 = -j; - s2 = 0; - } - if (k >= 0) { - b5 = 0; - s5 = k; - s2 += k; - } - else { - b2 -= k; - b5 = -k; - s5 = 0; - } - if (mode < 0 || mode > 9) - mode = 0; - try_quick = 1; - if (mode > 5) { - mode -= 4; - try_quick = 0; - } - leftright = 1; - switch(mode) { - case 0: - case 1: - ilim = ilim1 = -1; - i = (int)(nbits * .30103) + 3; - ndigits = 0; - break; - case 2: - leftright = 0; - /* no break */ - case 4: - if (ndigits <= 0) - ndigits = 1; - ilim = ilim1 = i = ndigits; - break; - case 3: - leftright = 0; - /* no break */ - case 5: - i = ndigits + k + 1; - ilim = i; - ilim1 = i - 1; - if (i <= 0) - i = 1; - } - s = s0 = rv_alloc(i); - - if ( (rdir = fpi->rounding - 1) !=0) { - if (rdir < 0) - rdir = 2; - if (kind & STRTOG_Neg) - rdir = 3 - rdir; - } - - /* Now rdir = 0 ==> round near, 1 ==> round up, 2 ==> round down. */ - - if (ilim >= 0 && ilim <= Quick_max && try_quick && !rdir -#ifndef IMPRECISE_INEXACT - && k == 0 -#endif - ) { - - /* Try to get by with floating-point arithmetic. */ - - i = 0; - d2 = dval(d); -#ifdef IBM - if ( (j = 11 - hi0bits(word0(d) & Frac_mask)) !=0) - dval(d) /= 1 << j; -#endif - k0 = k; - ilim0 = ilim; - ieps = 2; /* conservative */ - if (k > 0) { - ds = tens[k&0xf]; - j = k >> 4; - if (j & Bletch) { - /* prevent overflows */ - j &= Bletch - 1; - dval(d) /= bigtens[n_bigtens-1]; - ieps++; - } - for(; j; j >>= 1, i++) - if (j & 1) { - ieps++; - ds *= bigtens[i]; - } - } - else { - ds = 1.; - if ( (j1 = -k) !=0) { - dval(d) *= tens[j1 & 0xf]; - for(j = j1 >> 4; j; j >>= 1, i++) - if (j & 1) { - ieps++; - dval(d) *= bigtens[i]; - } - } - } - if (k_check && dval(d) < 1. && ilim > 0) { - if (ilim1 <= 0) - goto fast_failed; - ilim = ilim1; - k--; - dval(d) *= 10.; - ieps++; - } - dval(eps) = ieps*dval(d) + 7.; - word0(eps) -= (P-1)*Exp_msk1; - if (ilim == 0) { - S = mhi = 0; - dval(d) -= 5.; - if (dval(d) > dval(eps)) - goto one_digit; - if (dval(d) < -dval(eps)) - goto no_digits; - goto fast_failed; - } -#ifndef No_leftright - if (leftright) { - /* Use Steele & White method of only - * generating digits needed. - */ - dval(eps) = ds*0.5/tens[ilim-1] - dval(eps); - for(i = 0;;) { - L = (Long)(dval(d)/ds); - dval(d) -= L*ds; - *s++ = '0' + (int)L; - if (dval(d) < dval(eps)) { - if (dval(d)) - inex = STRTOG_Inexlo; - goto ret1; - } - if (ds - dval(d) < dval(eps)) - goto bump_up; - if (++i >= ilim) - break; - dval(eps) *= 10.; - dval(d) *= 10.; - } - } - else { -#endif - /* Generate ilim digits, then fix them up. */ - dval(eps) *= tens[ilim-1]; - for(i = 1;; i++, dval(d) *= 10.) { - if ( (L = (Long)(dval(d)/ds)) !=0) - dval(d) -= L*ds; - *s++ = '0' + (int)L; - if (i == ilim) { - ds *= 0.5; - if (dval(d) > ds + dval(eps)) - goto bump_up; - else if (dval(d) < ds - dval(eps)) { - while(*--s == '0'){} - s++; - if (dval(d)) - inex = STRTOG_Inexlo; - goto ret1; - } - break; - } - } -#ifndef No_leftright - } -#endif - fast_failed: - s = s0; - dval(d) = d2; - k = k0; - ilim = ilim0; - } - - /* Do we have a "small" integer? */ - - if (be >= 0 && k <= Int_max) { - /* Yes. */ - ds = tens[k]; - if (ndigits < 0 && ilim <= 0) { - S = mhi = 0; - if (ilim < 0 || dval(d) <= 5*ds) - goto no_digits; - goto one_digit; - } - for(i = 1;; i++, dval(d) *= 10.) { - L = dval(d) / ds; - dval(d) -= L*ds; -#ifdef Check_FLT_ROUNDS - /* If FLT_ROUNDS == 2, L will usually be high by 1 */ - if (dval(d) < 0) { - L--; - dval(d) += ds; - } -#endif - *s++ = '0' + (int)L; - if (dval(d) == 0.) - break; - if (i == ilim) { - if (rdir) { - if (rdir == 1) - goto bump_up; - inex = STRTOG_Inexlo; - goto ret1; - } - dval(d) += dval(d); - if (dval(d) > ds || (dval(d) == ds && L & 1)) { - bump_up: - inex = STRTOG_Inexhi; - while(*--s == '9') - if (s == s0) { - k++; - *s = '0'; - break; - } - ++*s++; - } - else - inex = STRTOG_Inexlo; - break; - } - } - goto ret1; - } - - m2 = b2; - m5 = b5; - mhi = mlo = 0; - if (leftright) { - if (mode < 2) { - i = nbits - bbits; - if (be - i++ < fpi->emin) - /* denormal */ - i = be - fpi->emin + 1; - } - else { - j = ilim - 1; - if (m5 >= j) - m5 -= j; - else { - s5 += j -= m5; - b5 += j; - m5 = 0; - } - if ((i = ilim) < 0) { - m2 -= i; - i = 0; - } - } - b2 += i; - s2 += i; - mhi = i2b(1); - } - if (m2 > 0 && s2 > 0) { - i = m2 < s2 ? m2 : s2; - b2 -= i; - m2 -= i; - s2 -= i; - } - if (b5 > 0) { - if (leftright) { - if (m5 > 0) { - mhi = pow5mult(mhi, m5); - b1 = mult(mhi, b); - Bfree(b); - b = b1; - } - if ( (j = b5 - m5) !=0) - b = pow5mult(b, j); - } - else - b = pow5mult(b, b5); - } - S = i2b(1); - if (s5 > 0) - S = pow5mult(S, s5); - - /* Check for special case that d is a normalized power of 2. */ - - spec_case = 0; - if (mode < 2) { - if (bbits == 1 && be0 > fpi->emin + 1) { - /* The special case */ - b2++; - s2++; - spec_case = 1; - } - } - - /* Arrange for convenient computation of quotients: - * shift left if necessary so divisor has 4 leading 0 bits. - * - * Perhaps we should just compute leading 28 bits of S once - * and for all and pass them and a shift to quorem, so it - * can do shifts and ors to compute the numerator for q. - */ -#ifdef Pack_32 - if ( (i = ((s5 ? 32 - hi0bits(S->x[S->wds-1]) : 1) + s2) & 0x1f) !=0) - i = 32 - i; -#else - if ( (i = ((s5 ? 32 - hi0bits(S->x[S->wds-1]) : 1) + s2) & 0xf) !=0) - i = 16 - i; -#endif - if (i > 4) { - i -= 4; - b2 += i; - m2 += i; - s2 += i; - } - else if (i < 4) { - i += 28; - b2 += i; - m2 += i; - s2 += i; - } - if (b2 > 0) - b = lshift(b, b2); - if (s2 > 0) - S = lshift(S, s2); - if (k_check) { - if (cmp(b,S) < 0) { - k--; - b = multadd(b, 10, 0); /* we botched the k estimate */ - if (leftright) - mhi = multadd(mhi, 10, 0); - ilim = ilim1; - } - } - if (ilim <= 0 && mode > 2) { - if (ilim < 0 || cmp(b,S = multadd(S,5,0)) <= 0) { - /* no digits, fcvt style */ - no_digits: - k = -1 - ndigits; - inex = STRTOG_Inexlo; - goto ret; - } - one_digit: - inex = STRTOG_Inexhi; - *s++ = '1'; - k++; - goto ret; - } - if (leftright) { - if (m2 > 0) - mhi = lshift(mhi, m2); - - /* Compute mlo -- check for special case - * that d is a normalized power of 2. - */ - - mlo = mhi; - if (spec_case) { - mhi = Balloc(mhi->k); - Bcopy(mhi, mlo); - mhi = lshift(mhi, 1); - } - - for(i = 1;;i++) { - dig = quorem(b,S) + '0'; - /* Do we yet have the shortest decimal string - * that will round to d? - */ - j = cmp(b, mlo); - delta = diff(S, mhi); - j1 = delta->sign ? 1 : cmp(b, delta); - Bfree(delta); -#ifndef ROUND_BIASED - if (j1 == 0 && !mode && !(bits[0] & 1) && !rdir) { - if (dig == '9') - goto round_9_up; - if (j <= 0) { - if (b->wds > 1 || b->x[0]) - inex = STRTOG_Inexlo; - } - else { - dig++; - inex = STRTOG_Inexhi; - } - *s++ = dig; - goto ret; - } -#endif - if (j < 0 || (j == 0 && !mode -#ifndef ROUND_BIASED - && !(bits[0] & 1) -#endif - )) { - if (rdir && (b->wds > 1 || b->x[0])) { - if (rdir == 2) { - inex = STRTOG_Inexlo; - goto accept; - } - while (cmp(S,mhi) > 0) { - *s++ = dig; - mhi1 = multadd(mhi, 10, 0); - if (mlo == mhi) - mlo = mhi1; - mhi = mhi1; - b = multadd(b, 10, 0); - dig = quorem(b,S) + '0'; - } - if (dig++ == '9') - goto round_9_up; - inex = STRTOG_Inexhi; - goto accept; - } - if (j1 > 0) { - b = lshift(b, 1); - j1 = cmp(b, S); - if ((j1 > 0 || (j1 == 0 && dig & 1)) - && dig++ == '9') - goto round_9_up; - inex = STRTOG_Inexhi; - } - if (b->wds > 1 || b->x[0]) - inex = STRTOG_Inexlo; - accept: - *s++ = dig; - goto ret; - } - if (j1 > 0 && rdir != 2) { - if (dig == '9') { /* possible if i == 1 */ - round_9_up: - *s++ = '9'; - inex = STRTOG_Inexhi; - goto roundoff; - } - inex = STRTOG_Inexhi; - *s++ = dig + 1; - goto ret; - } - *s++ = dig; - if (i == ilim) - break; - b = multadd(b, 10, 0); - if (mlo == mhi) - mlo = mhi = multadd(mhi, 10, 0); - else { - mlo = multadd(mlo, 10, 0); - mhi = multadd(mhi, 10, 0); - } - } - } - else - for(i = 1;; i++) { - *s++ = dig = quorem(b,S) + '0'; - if (i >= ilim) - break; - b = multadd(b, 10, 0); - } - - /* Round off last digit */ - - if (rdir) { - if (rdir == 2 || (b->wds <= 1 && !b->x[0])) - goto chopzeros; - goto roundoff; - } - b = lshift(b, 1); - j = cmp(b, S); - if (j > 0 || (j == 0 && dig & 1)) { - roundoff: - inex = STRTOG_Inexhi; - while(*--s == '9') - if (s == s0) { - k++; - *s++ = '1'; - goto ret; - } - ++*s++; - } - else { - chopzeros: - if (b->wds > 1 || b->x[0]) - inex = STRTOG_Inexlo; - while(*--s == '0'){} - s++; - } - ret: - Bfree(S); - if (mhi) { - if (mlo && mlo != mhi) - Bfree(mlo); - Bfree(mhi); - } - ret1: - Bfree(b); - *s = 0; - *decpt = k + 1; - if (rve) - *rve = s; - *kindp |= inex; - return s0; - } diff --git a/winsup/mingw/mingwex/gdtoa/gdtoa.h b/winsup/mingw/mingwex/gdtoa/gdtoa.h deleted file mode 100755 index 88e0e54cd..000000000 --- a/winsup/mingw/mingwex/gdtoa/gdtoa.h +++ /dev/null @@ -1,127 +0,0 @@ -/**************************************************************** - -The author of this software is David M. Gay. - -Copyright (C) 1998 by Lucent Technologies -All Rights Reserved - -Permission to use, copy, modify, and distribute this software and -its documentation for any purpose and without fee is hereby -granted, provided that the above copyright notice appear in all -copies and that both that the copyright notice and this -permission notice and warranty disclaimer appear in supporting -documentation, and that the name of Lucent or any of its entities -not be used in advertising or publicity pertaining to -distribution of the software without specific, written prior -permission. - -LUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. -IN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY -SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER -IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF -THIS SOFTWARE. - -****************************************************************/ - -/* Please send bug reports to David M. Gay (dmg at acm dot org, - * with " at " changed at "@" and " dot " changed to "."). */ - -/* Modified by Danny Smith for inclusion in libmingwex.a - Aug 2006 */ - -#ifndef GDTOA_H_INCLUDED -#define GDTOA_H_INCLUDED - -#include "gd_arith.h" - -#ifndef Long -#define Long long -#endif -#ifndef ULong -typedef unsigned Long ULong; -#endif -#ifndef UShort -typedef unsigned short UShort; -#endif - -#ifndef ANSI -#ifdef KR_headers -#define ANSI(x) () -#define Void /*nothing*/ -#else -#define ANSI(x) x -#define Void void -#endif -#endif /* ANSI */ - -#ifndef CONST -#ifdef KR_headers -#define CONST /* blank */ -#else -#define CONST const -#endif -#endif /* CONST */ - - enum { /* return values from strtodg */ - STRTOG_Zero = 0, - STRTOG_Normal = 1, - STRTOG_Denormal = 2, - STRTOG_Infinite = 3, - STRTOG_NaN = 4, - STRTOG_NaNbits = 5, - STRTOG_NoNumber = 6, - STRTOG_Retmask = 7, - - /* The following may be or-ed into one of the above values. */ - - STRTOG_Neg = 0x08, - STRTOG_Inexlo = 0x10, - STRTOG_Inexhi = 0x20, - STRTOG_Inexact = 0x30, - STRTOG_Underflow= 0x40, - STRTOG_Overflow = 0x80 - }; - - typedef struct -FPI { - int nbits; - int emin; - int emax; - int rounding; - int sudden_underflow; - } FPI; - -enum { /* FPI.rounding values: same as FLT_ROUNDS */ - FPI_Round_zero = 0, - FPI_Round_near = 1, - FPI_Round_up = 2, - FPI_Round_down = 3 - }; - -#ifdef __cplusplus -extern "C" { -#endif - -extern char* __dtoa ANSI((double d, int mode, int ndigits, int *decpt, - int *sign, char **rve)); -extern char* __gdtoa ANSI((FPI *fpi, int be, ULong *bits, int *kindp, - int mode, int ndigits, int *decpt, char **rve)); -extern void __freedtoa ANSI((char*)); - -extern int __strtodg ANSI((CONST char*, char**, FPI*, Long*, ULong*)); -extern float __strtof ANSI((CONST char *, char **)); -extern double __strtod ANSI((CONST char *, char **)); -extern long double strtold ANSI((CONST char *, char **)); - -extern char* __g__fmt ANSI((char *, char *, char *e, int, ULong)); -extern char* __g_dfmt ANSI((char*, double*, int, unsigned)); -extern char* __g_ffmt ANSI((char*, float*, int, unsigned)); -extern char* __g_xfmt ANSI((char*, void*, int, unsigned)); - -#ifdef __cplusplus -} -#endif -#endif /* GDTOA_H_INCLUDED */ diff --git a/winsup/mingw/mingwex/gdtoa/gdtoaimp.h b/winsup/mingw/mingwex/gdtoa/gdtoaimp.h deleted file mode 100755 index 04e625cff..000000000 --- a/winsup/mingw/mingwex/gdtoa/gdtoaimp.h +++ /dev/null @@ -1,632 +0,0 @@ -/**************************************************************** - -The author of this software is David M. Gay. - -Copyright (C) 1998-2008 by Lucent Technologies -All Rights Reserved - -Permission to use, copy, modify, and distribute this software and -its documentation for any purpose and without fee is hereby -granted, provided that the above copyright notice appear in all -copies and that both that the copyright notice and this -permission notice and warranty disclaimer appear in supporting -documentation, and that the name of Lucent or any of its entities -not be used in advertising or publicity pertaining to -distribution of the software without specific, written prior -permission. - -LUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. -IN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY -SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER -IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF -THIS SOFTWARE. - -****************************************************************/ - -/* This is a variation on dtoa.c that converts arbitary binary - floating-point formats to and from decimal notation. It uses - double-precision arithmetic internally, so there are still - various #ifdefs that adapt the calculations to the native - double-precision arithmetic (any of IEEE, VAX D_floating, - or IBM mainframe arithmetic). - - Please send bug reports to David M. Gay (dmg at acm dot org, - with " at " changed at "@" and " dot " changed to "."). - */ - -/* On a machine with IEEE extended-precision registers, it is - * necessary to specify double-precision (53-bit) rounding precision - * before invoking strtod or dtoa. If the machine uses (the equivalent - * of) Intel 80x87 arithmetic, the call - * _control87(PC_53, MCW_PC); - * does this with many compilers. Whether this or another call is - * appropriate depends on the compiler; for this to work, it may be - * necessary to #include "float.h" or another system-dependent header - * file. - */ - -/* strtod for IEEE-, VAX-, and IBM-arithmetic machines. - * - * This strtod returns a nearest machine number to the input decimal - * string (or sets errno to ERANGE). With IEEE arithmetic, ties are - * broken by the IEEE round-even rule. Otherwise ties are broken by - * biased rounding (add half and chop). - * - * Inspired loosely by William D. Clinger's paper "How to Read Floating - * Point Numbers Accurately" [Proc. ACM SIGPLAN '90, pp. 112-126]. - * - * Modifications: - * - * 1. We only require IEEE, IBM, or VAX double-precision - * arithmetic (not IEEE double-extended). - * 2. We get by with floating-point arithmetic in a case that - * Clinger missed -- when we're computing d * 10^n - * for a small integer d and the integer n is not too - * much larger than 22 (the maximum integer k for which - * we can represent 10^k exactly), we may be able to - * compute (d*10^k) * 10^(e-k) with just one roundoff. - * 3. Rather than a bit-at-a-time adjustment of the binary - * result in the hard case, we use floating-point - * arithmetic to determine the adjustment to within - * one bit; only in really hard cases do we need to - * compute a second residual. - * 4. Because of 3., we don't need a large table of powers of 10 - * for ten-to-e (just some small tables, e.g. of 10^k - * for 0 <= k <= 22). - */ - -/* - * #define IEEE_8087 for IEEE-arithmetic machines where the least - * significant byte has the lowest address. - * #define IEEE_MC68k for IEEE-arithmetic machines where the most - * significant byte has the lowest address. - * #define Long int on machines with 32-bit ints and 64-bit longs. - * #define Sudden_Underflow for IEEE-format machines without gradual - * underflow (i.e., that flush to zero on underflow). - * #define IBM for IBM mainframe-style floating-point arithmetic. - * #define VAX for VAX-style floating-point arithmetic (D_floating). - * #define No_leftright to omit left-right logic in fast floating-point - * computation of dtoa. - * #define Check_FLT_ROUNDS if FLT_ROUNDS can assume the values 2 or 3. - * #define RND_PRODQUOT to use rnd_prod and rnd_quot (assembly routines - * that use extended-precision instructions to compute rounded - * products and quotients) with IBM. - * #define ROUND_BIASED for IEEE-format with biased rounding. - * #define Inaccurate_Divide for IEEE-format with correctly rounded - * products but inaccurate quotients, e.g., for Intel i860. - * #define NO_LONG_LONG on machines that do not have a "long long" - * integer type (of >= 64 bits). On such machines, you can - * #define Just_16 to store 16 bits per 32-bit Long when doing - * high-precision integer arithmetic. Whether this speeds things - * up or slows things down depends on the machine and the number - * being converted. If long long is available and the name is - * something other than "long long", #define Llong to be the name, - * and if "unsigned Llong" does not work as an unsigned version of - * Llong, #define #ULLong to be the corresponding unsigned type. - * #define KR_headers for old-style C function headers. - * #define Bad_float_h if your system lacks a float.h or if it does not - * define some or all of DBL_DIG, DBL_MAX_10_EXP, DBL_MAX_EXP, - * FLT_RADIX, FLT_ROUNDS, and DBL_MAX. - * #define MALLOC your_malloc, where your_malloc(n) acts like malloc(n) - * if memory is available and otherwise does something you deem - * appropriate. If MALLOC is undefined, malloc will be invoked - * directly -- and assumed always to succeed. - * #define Omit_Private_Memory to omit logic (added Jan. 1998) for making - * memory allocations from a private pool of memory when possible. - * When used, the private pool is PRIVATE_MEM bytes long: 2304 bytes, - * unless #defined to be a different length. This default length - * suffices to get rid of MALLOC calls except for unusual cases, - * such as decimal-to-binary conversion of a very long string of - * digits. When converting IEEE double precision values, the - * longest string gdtoa can return is about 751 bytes long. For - * conversions by strtod of strings of 800 digits and all gdtoa - * conversions of IEEE doubles in single-threaded executions with - * 8-byte pointers, PRIVATE_MEM >= 7400 appears to suffice; with - * 4-byte pointers, PRIVATE_MEM >= 7112 appears adequate. - * #define INFNAN_CHECK on IEEE systems to cause strtod to check for - * Infinity and NaN (case insensitively). - * When INFNAN_CHECK is #defined and No_Hex_NaN is not #defined, - * strtodg also accepts (case insensitively) strings of the form - * NaN(x), where x is a string of hexadecimal digits and spaces; - * if there is only one string of hexadecimal digits, it is taken - * for the fraction bits of the resulting NaN; if there are two or - * more strings of hexadecimal digits, each string is assigned - * to the next available sequence of 32-bit words of fractions - * bits (starting with the most significant), right-aligned in - * each sequence. - * #define MULTIPLE_THREADS if the system offers preemptively scheduled - * multiple threads. In this case, you must provide (or suitably - * #define) two locks, acquired by ACQUIRE_DTOA_LOCK(n) and freed - * by FREE_DTOA_LOCK(n) for n = 0 or 1. (The second lock, accessed - * in pow5mult, ensures lazy evaluation of only one copy of high - * powers of 5; omitting this lock would introduce a small - * probability of wasting memory, but would otherwise be harmless.) - * You must also invoke freedtoa(s) to free the value s returned by - * dtoa. You may do so whether or not MULTIPLE_THREADS is #defined. - * #define IMPRECISE_INEXACT if you do not care about the setting of - * the STRTOG_Inexact bits in the special case of doing IEEE double - * precision conversions (which could also be done by the strtog in - * dtoa.c). - * #define NO_HEX_FP to disable recognition of C9x's hexadecimal - * floating-point constants. - * #define -DNO_ERRNO to suppress setting errno (in strtod.c and - * strtodg.c). - * #define NO_STRING_H to use private versions of memcpy. - * On some K&R systems, it may also be necessary to - * #define DECLARE_SIZE_T in this case. - * #define YES_ALIAS to permit aliasing certain double values with - * arrays of ULongs. This leads to slightly better code with - * some compilers and was always used prior to 19990916, but it - * is not strictly legal and can cause trouble with aggressively - * optimizing compilers (e.g., gcc 2.95.1 under -O2). - * #define USE_LOCALE to use the current locale's decimal_point value. - */ - -#ifndef GDTOAIMP_H_INCLUDED -#define GDTOAIMP_H_INCLUDED -#include "gdtoa.h" -#include "gd_qnan.h" - -#define INFNAN_CHECK 1 -#define MULTIPLE_THREADS 1 -#define USE_LOCALE 1 - -#ifdef DEBUG -#include <stdio.h> -#define Bug(x) {fprintf(stderr, "%s\n", x); exit(1);} -#endif - -#include <stdlib.h> -#include <string.h> - -#ifdef KR_headers -#define Char char -#else -#define Char void -#endif - -#ifdef MALLOC -extern Char *MALLOC ANSI((size_t)); -#else -#define MALLOC malloc -#endif - -#undef IEEE_Arith -#undef Avoid_Underflow -#ifdef IEEE_MC68k -#define IEEE_Arith -#endif -#ifdef IEEE_8087 -#define IEEE_Arith -#endif - -#include <errno.h> -#ifdef Bad_float_h - -#ifdef IEEE_Arith -#define DBL_DIG 15 -#define DBL_MAX_10_EXP 308 -#define DBL_MAX_EXP 1024 -#define FLT_RADIX 2 -#define DBL_MAX 1.7976931348623157e+308 -#endif - -#ifdef IBM -#define DBL_DIG 16 -#define DBL_MAX_10_EXP 75 -#define DBL_MAX_EXP 63 -#define FLT_RADIX 16 -#define DBL_MAX 7.2370055773322621e+75 -#endif - -#ifdef VAX -#define DBL_DIG 16 -#define DBL_MAX_10_EXP 38 -#define DBL_MAX_EXP 127 -#define FLT_RADIX 2 -#define DBL_MAX 1.7014118346046923e+38 -#define n_bigtens 2 -#endif - -#ifndef LONG_MAX -#define LONG_MAX 2147483647 -#endif - -#else /* ifndef Bad_float_h */ -#include <float.h> -#endif /* Bad_float_h */ - -#ifdef IEEE_Arith -#define Scale_Bit 0x10 -#define n_bigtens 5 -#endif - -#ifdef IBM -#define n_bigtens 3 -#endif - -#ifdef VAX -#define n_bigtens 2 -#endif - -#ifndef __MATH_H__ -#include <math.h> -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -#if defined(IEEE_8087) + defined(IEEE_MC68k) + defined(VAX) + defined(IBM) != 1 -Exactly one of IEEE_8087, IEEE_MC68k, VAX, or IBM should be defined. -#endif - -typedef union { double d; ULong L[2]; } U; - -#ifdef YES_ALIAS -#define dval(x) x -#ifdef IEEE_8087 -#define word0(x) ((ULong *)&x)[1] -#define word1(x) ((ULong *)&x)[0] -#else -#define word0(x) ((ULong *)&x)[0] -#define word1(x) ((ULong *)&x)[1] -#endif -#else /* !YES_ALIAS */ -#ifdef IEEE_8087 -#define word0(x) ((U*)&x)->L[1] -#define word1(x) ((U*)&x)->L[0] -#else -#define word0(x) ((U*)&x)->L[0] -#define word1(x) ((U*)&x)->L[1] -#endif -#define dval(x) ((U*)&x)->d -#endif /* YES_ALIAS */ - -/* The following definition of Storeinc is appropriate for MIPS processors. - * An alternative that might be better on some machines is - * #define Storeinc(a,b,c) (*a++ = b << 16 | c & 0xffff) - */ -#if defined(IEEE_8087) + defined(VAX) -#define Storeinc(a,b,c) (((unsigned short *)a)[1] = (unsigned short)b, \ -((unsigned short *)a)[0] = (unsigned short)c, a++) -#else -#define Storeinc(a,b,c) (((unsigned short *)a)[0] = (unsigned short)b, \ -((unsigned short *)a)[1] = (unsigned short)c, a++) -#endif - -/* #define P DBL_MANT_DIG */ -/* Ten_pmax = floor(P*log(2)/log(5)) */ -/* Bletch = (highest power of 2 < DBL_MAX_10_EXP) / 16 */ -/* Quick_max = floor((P-1)*log(FLT_RADIX)/log(10) - 1) */ -/* Int_max = floor(P*log(FLT_RADIX)/log(10) - 1) */ - -#ifdef IEEE_Arith -#define Exp_shift 20 -#define Exp_shift1 20 -#define Exp_msk1 0x100000 -#define Exp_msk11 0x100000 -#define Exp_mask 0x7ff00000 -#define P 53 -#define Bias 1023 -#define Emin (-1022) -#define Exp_1 0x3ff00000 -#define Exp_11 0x3ff00000 -#define Ebits 11 -#define Frac_mask 0xfffff -#define Frac_mask1 0xfffff -#define Ten_pmax 22 -#define Bletch 0x10 -#define Bndry_mask 0xfffff -#define Bndry_mask1 0xfffff -#define LSB 1 -#define Sign_bit 0x80000000 -#define Log2P 1 -#define Tiny0 0 -#define Tiny1 1 -#define Quick_max 14 -#define Int_max 14 - -#ifndef Flt_Rounds -#ifdef FLT_ROUNDS -#define Flt_Rounds FLT_ROUNDS -#else -#define Flt_Rounds 1 -#endif -#endif /*Flt_Rounds*/ - -#else /* ifndef IEEE_Arith */ -#undef Sudden_Underflow -#define Sudden_Underflow -#ifdef IBM -#undef Flt_Rounds -#define Flt_Rounds 0 -#define Exp_shift 24 -#define Exp_shift1 24 -#define Exp_msk1 0x1000000 -#define Exp_msk11 0x1000000 -#define Exp_mask 0x7f000000 -#define P 14 -#define Bias 65 -#define Exp_1 0x41000000 -#define Exp_11 0x41000000 -#define Ebits 8 /* exponent has 7 bits, but 8 is the right value in b2d */ -#define Frac_mask 0xffffff -#define Frac_mask1 0xffffff -#define Bletch 4 -#define Ten_pmax 22 -#define Bndry_mask 0xefffff -#define Bndry_mask1 0xffffff -#define LSB 1 -#define Sign_bit 0x80000000 -#define Log2P 4 -#define Tiny0 0x100000 -#define Tiny1 0 -#define Quick_max 14 -#define Int_max 15 -#else /* VAX */ -#undef Flt_Rounds -#define Flt_Rounds 1 -#define Exp_shift 23 -#define Exp_shift1 7 -#define Exp_msk1 0x80 -#define Exp_msk11 0x800000 -#define Exp_mask 0x7f80 -#define P 56 -#define Bias 129 -#define Exp_1 0x40800000 -#define Exp_11 0x4080 -#define Ebits 8 -#define Frac_mask 0x7fffff -#define Frac_mask1 0xffff007f -#define Ten_pmax 24 -#define Bletch 2 -#define Bndry_mask 0xffff007f -#define Bndry_mask1 0xffff007f -#define LSB 0x10000 -#define Sign_bit 0x8000 -#define Log2P 1 -#define Tiny0 0x80 -#define Tiny1 0 -#define Quick_max 15 -#define Int_max 15 -#endif /* IBM, VAX */ -#endif /* IEEE_Arith */ - -#ifndef IEEE_Arith -#define ROUND_BIASED -#endif - -#ifdef RND_PRODQUOT -#define rounded_product(a,b) a = rnd_prod(a, b) -#define rounded_quotient(a,b) a = rnd_quot(a, b) -#ifdef KR_headers -extern double rnd_prod(), rnd_quot(); -#else -extern double rnd_prod(double, double), rnd_quot(double, double); -#endif -#else -#define rounded_product(a,b) a *= b -#define rounded_quotient(a,b) a /= b -#endif - -#define Big0 (Frac_mask1 | Exp_msk1*(DBL_MAX_EXP+Bias-1)) -#define Big1 0xffffffff - -#undef Pack_16 -#ifndef Pack_32 -#define Pack_32 -#endif - -#ifdef NO_LONG_LONG -#undef ULLong -#ifdef Just_16 -#undef Pack_32 -#define Pack_16 -/* When Pack_32 is not defined, we store 16 bits per 32-bit Long. - * This makes some inner loops simpler and sometimes saves work - * during multiplications, but it often seems to make things slightly - * slower. Hence the default is now to store 32 bits per Long. - */ -#endif -#else /* long long available */ -#ifndef Llong -#define Llong long long -#endif -#ifndef ULLong -#define ULLong unsigned Llong -#endif -#endif /* NO_LONG_LONG */ - -#ifdef Pack_32 -#define ULbits 32 -#define kshift 5 -#define kmask 31 -#define ALL_ON 0xffffffff -#else -#define ULbits 16 -#define kshift 4 -#define kmask 15 -#define ALL_ON 0xffff -#endif - -#ifndef MULTIPLE_THREADS -#define ACQUIRE_DTOA_LOCK(n) /*nothing*/ -#define FREE_DTOA_LOCK(n) /*nothing*/ -#endif - -#define Kmax 15 - -#define Bigint __Bigint - struct -Bigint { - struct Bigint *next; - int k, maxwds, sign, wds; - ULong x[1]; - }; - - typedef struct Bigint Bigint; - -#ifdef NO_STRING_H -#ifdef DECLARE_SIZE_T -typedef unsigned int size_t; -#endif -extern void memcpy_D2A ANSI((void*, const void*, size_t)); -#define Bcopy(x,y) memcpy_D2A(&x->sign,&y->sign,y->wds*sizeof(ULong) + 2*sizeof(int)) -#else /* !NO_STRING_H */ -#define Bcopy(x,y) memcpy(&x->sign,&y->sign,y->wds*sizeof(ULong) + 2*sizeof(int)) -#endif /* NO_STRING_H */ - -#ifdef __GNUC__ -static inline int -__lo0bits_D2A (ULong *y) -{ - int ret = __builtin_ctz(*y); - *y = *y >> ret; - return ret; -} - -static inline int -__hi0bits_D2A (ULong y) -{ - return __builtin_clz(y); -} -#endif - -#define Balloc __Balloc_D2A -#define Bfree __Bfree_D2A -#define ULtoQ __ULtoQ_D2A -#define ULtof __ULtof_D2A -#define ULtod __ULtod_D2A -#define ULtodd __ULtodd_D2A -#define ULtox __ULtox_D2A -#define ULtoxL __ULtoxL_D2A -#define any_on __any_on_D2A -#define b2d __b2d_D2A -#define bigtens __bigtens_D2A -#define cmp __cmp_D2A -#define copybits __copybits_D2A -#define d2b __d2b_D2A -#define decrement __decrement_D2A -#define diff __diff_D2A -#define dtoa_result __dtoa_result_D2A -#define gethex __gethex_D2A -#define hexdig __hexdig_D2A -#define hexnan __hexnan_D2A -#define hi0bits_D2A __hi0bits_D2A -#define hi0bits(x) __hi0bits_D2A((ULong)(x)) -#define i2b __i2b_D2A -#define increment __increment_D2A -#define lo0bits __lo0bits_D2A -#define lshift __lshift_D2A -#define match __match_D2A -#define mult __mult_D2A -#define multadd __multadd_D2A -#define nrv_alloc __nrv_alloc_D2A -#define pow5mult __pow5mult_D2A -#define quorem __quorem_D2A -#define ratio __ratio_D2A -#define rshift __rshift_D2A -#define rv_alloc __rv_alloc_D2A -#define s2b __s2b_D2A -#define set_ones __set_ones_D2A -#define strcp_D2A __strcp_D2A -#define strcp __strcp_D2A -#define strtoIg __strtoIg_D2A -#define sum __sum_D2A -#define tens __tens_D2A -#define tinytens __tinytens_D2A -#define tinytens __tinytens_D2A -#define trailz __trailz_D2A -#define ulp __ulp_D2A - - extern char *dtoa_result; - extern CONST double bigtens[], tens[], tinytens[]; - extern unsigned char hexdig[]; - - extern Bigint *Balloc ANSI((int)); - extern void Bfree ANSI((Bigint*)); - extern void ULtof ANSI((ULong*, ULong*, Long, int)); - extern void ULtod ANSI((ULong*, ULong*, Long, int)); - extern void ULtodd ANSI((ULong*, ULong*, Long, int)); - extern void ULtoQ ANSI((ULong*, ULong*, Long, int)); - extern void ULtox ANSI((UShort*, ULong*, Long, int)); - extern void ULtoxL ANSI((ULong*, ULong*, Long, int)); - extern ULong any_on ANSI((Bigint*, int)); - extern double b2d ANSI((Bigint*, int*)); - extern int cmp ANSI((Bigint*, Bigint*)); - extern void copybits ANSI((ULong*, int, Bigint*)); - extern Bigint *d2b ANSI((double, int*, int*)); - extern int decrement ANSI((Bigint*)); - extern Bigint *diff ANSI((Bigint*, Bigint*)); - extern int gethex ANSI((CONST char**, FPI*, Long*, Bigint**, int)); - extern void hexdig_init_D2A(Void); - extern int hexnan ANSI((CONST char**, FPI*, ULong*)); - extern int hi0bits_D2A ANSI((ULong)); - extern Bigint *i2b ANSI((int)); - extern Bigint *increment ANSI((Bigint*)); - extern int lo0bits ANSI((ULong*)); - extern Bigint *lshift ANSI((Bigint*, int)); - extern int match ANSI((CONST char**, char*)); - extern Bigint *mult ANSI((Bigint*, Bigint*)); - extern Bigint *multadd ANSI((Bigint*, int, int)); - extern char *nrv_alloc ANSI((char*, char **, int)); - extern Bigint *pow5mult ANSI((Bigint*, int)); - extern int quorem ANSI((Bigint*, Bigint*)); - extern double ratio ANSI((Bigint*, Bigint*)); - extern void rshift ANSI((Bigint*, int)); - extern char *rv_alloc ANSI((int)); - extern Bigint *s2b ANSI((CONST char*, int, int, ULong)); - extern Bigint *set_ones ANSI((Bigint*, int)); - extern char *strcp ANSI((char*, const char*)); - extern Bigint *sum ANSI((Bigint*, Bigint*)); - extern int trailz ANSI((Bigint*)); - extern double ulp ANSI((double)); - -#ifdef __cplusplus -} -#endif -/* - * NAN_WORD0 and NAN_WORD1 are only referenced in strtod.c. Prior to - * 20050115, they used to be hard-wired here (to 0x7ff80000 and 0, - * respectively), but now are determined by compiling and running - * qnan.c to generate gd_qnan.h, which specifies d_QNAN0 and d_QNAN1. - * Formerly gdtoaimp.h recommended supplying suitable -DNAN_WORD0=... - * and -DNAN_WORD1=... values if necessary. This should still work. - * (On HP Series 700/800 machines, -DNAN_WORD0=0x7ff40000 works.) - */ -#ifdef IEEE_Arith -#ifdef IEEE_MC68k -#define _0 0 -#define _1 1 -#ifndef NAN_WORD0 -#define NAN_WORD0 d_QNAN0 -#endif -#ifndef NAN_WORD1 -#define NAN_WORD1 d_QNAN1 -#endif -#else -#define _0 1 -#define _1 0 -#ifndef NAN_WORD0 -#define NAN_WORD0 d_QNAN1 -#endif -#ifndef NAN_WORD1 -#define NAN_WORD1 d_QNAN0 -#endif -#endif -#else -#undef INFNAN_CHECK -#endif - -#undef SI -#ifdef Sudden_Underflow -#define SI 1 -#else -#define SI 0 -#endif - -#endif /* GDTOAIMP_H_INCLUDED */ diff --git a/winsup/mingw/mingwex/gdtoa/gethex.c b/winsup/mingw/mingwex/gdtoa/gethex.c deleted file mode 100755 index b3a8b549d..000000000 --- a/winsup/mingw/mingwex/gdtoa/gethex.c +++ /dev/null @@ -1,247 +0,0 @@ -/**************************************************************** - -The author of this software is David M. Gay. - -Copyright (C) 1998 by Lucent Technologies -All Rights Reserved - -Permission to use, copy, modify, and distribute this software and -its documentation for any purpose and without fee is hereby -granted, provided that the above copyright notice appear in all -copies and that both that the copyright notice and this -permission notice and warranty disclaimer appear in supporting -documentation, and that the name of Lucent or any of its entities -not be used in advertising or publicity pertaining to -distribution of the software without specific, written prior -permission. - -LUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. -IN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY -SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER -IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF -THIS SOFTWARE. - -****************************************************************/ - -/* Please send bug reports to David M. Gay (dmg at acm dot org, - * with " at " changed at "@" and " dot " changed to "."). */ - -#include "gdtoaimp.h" - -#ifdef USE_LOCALE -#include "locale.h" -#endif - - int -#ifdef KR_headers -gethex(sp, fpi, exp, bp, sign) - CONST char **sp; FPI *fpi; Long *exp; Bigint **bp; int sign; -#else -gethex( CONST char **sp, FPI *fpi, Long *exp, Bigint **bp, int sign) -#endif -{ - Bigint *b; - CONST unsigned char *decpt, *s0, *s, *s1; - int esign, havedig, irv, k, n, nbits, up, zret; - ULong L, lostbits, *x; - Long e, e1; -#ifdef USE_LOCALE - unsigned char decimalpoint = *localeconv()->decimal_point; -#else -#define decimalpoint '.' -#endif - - if (!hexdig['0']) - hexdig_init_D2A(); - havedig = 0; - s0 = *(CONST unsigned char **)sp + 2; - while(s0[havedig] == '0') - havedig++; - s0 += havedig; - s = s0; - decpt = 0; - zret = 0; - e = 0; - if (!hexdig[*s]) { - zret = 1; - if (*s != decimalpoint) - goto pcheck; - decpt = ++s; - if (!hexdig[*s]) - goto pcheck; - while(*s == '0') - s++; - if (hexdig[*s]) - zret = 0; - havedig = 1; - s0 = s; - } - while(hexdig[*s]) - s++; - if (*s == decimalpoint && !decpt) { - decpt = ++s; - while(hexdig[*s]) - s++; - } - if (decpt) - e = -(((Long)(s-decpt)) << 2); - pcheck: - s1 = s; - switch(*s) { - case 'p': - case 'P': - esign = 0; - switch(*++s) { - case '-': - esign = 1; - /* no break */ - case '+': - s++; - } - if ((n = hexdig[*s]) == 0 || n > 0x19) { - s = s1; - break; - } - e1 = n - 0x10; - while((n = hexdig[*++s]) !=0 && n <= 0x19) - e1 = 10*e1 + n - 0x10; - if (esign) - e1 = -e1; - e += e1; - } - *sp = (char*)s; - if (zret) - return havedig ? STRTOG_Zero : STRTOG_NoNumber; - n = s1 - s0 - 1; - for(k = 0; n > 7; n >>= 1) - k++; - b = Balloc(k); - x = b->x; - n = 0; - L = 0; - while(s1 > s0) { - if (*--s1 == decimalpoint) - continue; - if (n == 32) { - *x++ = L; - L = 0; - n = 0; - } - L |= (hexdig[*s1] & 0x0f) << n; - n += 4; - } - *x++ = L; - b->wds = n = x - b->x; - n = 32*n - hi0bits(L); - nbits = fpi->nbits; - lostbits = 0; - x = b->x; - if (n > nbits) { - n -= nbits; - if (any_on(b,n)) { - lostbits = 1; - k = n - 1; - if (x[k>>kshift] & 1 << (k & kmask)) { - lostbits = 2; - if (k > 1 && any_on(b,k-1)) - lostbits = 3; - } - } - rshift(b, n); - e += n; - } - else if (n < nbits) { - n = nbits - n; - b = lshift(b, n); - e -= n; - x = b->x; - } - if (e > fpi->emax) { - ovfl: - Bfree(b); - *bp = 0; - return STRTOG_Infinite | STRTOG_Overflow | STRTOG_Inexhi; - } - irv = STRTOG_Normal; - if (e < fpi->emin) { - irv = STRTOG_Denormal; - n = fpi->emin - e; - if (n >= nbits) { - switch (fpi->rounding) { - case FPI_Round_near: - if (n == nbits && (n < 2 || any_on(b,n-1))) - goto one_bit; - break; - case FPI_Round_up: - if (!sign) - goto one_bit; - break; - case FPI_Round_down: - if (sign) { - one_bit: - *exp = fpi->emin; - x[0] = b->wds = 1; - *bp = b; - return STRTOG_Denormal | STRTOG_Inexhi - | STRTOG_Underflow; - } - } - Bfree(b); - *bp = 0; - return STRTOG_Zero | STRTOG_Inexlo | STRTOG_Underflow; - } - k = n - 1; - if (lostbits) - lostbits = 1; - else if (k > 0) - lostbits = any_on(b,k); - if (x[k>>kshift] & 1 << (k & kmask)) - lostbits |= 2; - nbits -= n; - rshift(b,n); - e = fpi->emin; - } - if (lostbits) { - up = 0; - switch(fpi->rounding) { - case FPI_Round_zero: - break; - case FPI_Round_near: - if (lostbits & 2 - && (lostbits & 1) | (x[0] & 1)) - up = 1; - break; - case FPI_Round_up: - up = 1 - sign; - break; - case FPI_Round_down: - up = sign; - } - if (up) { - k = b->wds; - b = increment(b); - x = b->x; - if (irv == STRTOG_Denormal) { - if (nbits == fpi->nbits - 1 - && x[nbits >> kshift] & 1 << (nbits & kmask)) - irv = STRTOG_Normal; - } - else if (b->wds > k - || ((n = nbits & kmask) !=0 - && hi0bits(x[k-1]) < 32-n)) { - rshift(b,1); - if (++e > fpi->emax) - goto ovfl; - } - irv |= STRTOG_Inexhi; - } - else - irv |= STRTOG_Inexlo; - } - *bp = b; - *exp = e; - return irv; - } diff --git a/winsup/mingw/mingwex/gdtoa/gmisc.c b/winsup/mingw/mingwex/gdtoa/gmisc.c deleted file mode 100755 index 8270ef944..000000000 --- a/winsup/mingw/mingwex/gdtoa/gmisc.c +++ /dev/null @@ -1,86 +0,0 @@ -/**************************************************************** - -The author of this software is David M. Gay. - -Copyright (C) 1998 by Lucent Technologies -All Rights Reserved - -Permission to use, copy, modify, and distribute this software and -its documentation for any purpose and without fee is hereby -granted, provided that the above copyright notice appear in all -copies and that both that the copyright notice and this -permission notice and warranty disclaimer appear in supporting -documentation, and that the name of Lucent or any of its entities -not be used in advertising or publicity pertaining to -distribution of the software without specific, written prior -permission. - -LUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. -IN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY -SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER -IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF -THIS SOFTWARE. - -****************************************************************/ - -/* Please send bug reports to David M. Gay (dmg at acm dot org, - * with " at " changed at "@" and " dot " changed to "."). */ - -#include "gdtoaimp.h" - - void -#ifdef KR_headers -rshift(b, k) Bigint *b; int k; -#else -rshift(Bigint *b, int k) -#endif -{ - ULong *x, *x1, *xe, y; - int n; - - x = x1 = b->x; - n = k >> kshift; - if (n < b->wds) { - xe = x + b->wds; - x += n; - if (k &= kmask) { - n = ULbits - k; - y = *x++ >> k; - while(x < xe) { - *x1++ = (y | (*x << n)) & ALL_ON; - y = *x++ >> k; - } - if ((*x1 = y) !=0) - x1++; - } - else - while(x < xe) - *x1++ = *x++; - } - if ((b->wds = x1 - b->x) == 0) - b->x[0] = 0; - } - - int -#ifdef KR_headers -trailz(b) Bigint *b; -#else -trailz(Bigint *b) -#endif -{ - ULong L, *x, *xe; - int n = 0; - - x = b->x; - xe = x + b->wds; - for(n = 0; x < xe && !*x; x++) - n += ULbits; - if (x < xe) { - L = *x; - n += lo0bits(&L); - } - return n; - } diff --git a/winsup/mingw/mingwex/gdtoa/hd_init.c b/winsup/mingw/mingwex/gdtoa/hd_init.c deleted file mode 100755 index fa6e18dee..000000000 --- a/winsup/mingw/mingwex/gdtoa/hd_init.c +++ /dev/null @@ -1,55 +0,0 @@ -/**************************************************************** - -The author of this software is David M. Gay. - -Copyright (C) 2000 by Lucent Technologies -All Rights Reserved - -Permission to use, copy, modify, and distribute this software and -its documentation for any purpose and without fee is hereby -granted, provided that the above copyright notice appear in all -copies and that both that the copyright notice and this -permission notice and warranty disclaimer appear in supporting -documentation, and that the name of Lucent or any of its entities -not be used in advertising or publicity pertaining to -distribution of the software without specific, written prior -permission. - -LUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. -IN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY -SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER -IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF -THIS SOFTWARE. - -****************************************************************/ - -/* Please send bug reports to David M. Gay (dmg at acm dot org, - * with " at " changed at "@" and " dot " changed to "."). */ - -#include "gdtoaimp.h" - - unsigned char hexdig[256]; - - static void -#ifdef KR_headers -htinit(h, s, inc) unsigned char *h; unsigned char *s; int inc; -#else -htinit(unsigned char *h, unsigned char *s, int inc) -#endif -{ - int i, j; - for(i = 0; (j = s[i]) !=0; i++) - h[j] = i + inc; - } - - void -hexdig_init_D2A(Void) -{ -#define USC (unsigned char *) - htinit(hexdig, USC "0123456789", 0x10); - htinit(hexdig, USC "abcdef", 0x10 + 10); - htinit(hexdig, USC "ABCDEF", 0x10 + 10); - } diff --git a/winsup/mingw/mingwex/gdtoa/hexnan.c b/winsup/mingw/mingwex/gdtoa/hexnan.c deleted file mode 100755 index 77d1ea775..000000000 --- a/winsup/mingw/mingwex/gdtoa/hexnan.c +++ /dev/null @@ -1,131 +0,0 @@ -/**************************************************************** - -The author of this software is David M. Gay. - -Copyright (C) 2000 by Lucent Technologies -All Rights Reserved - -Permission to use, copy, modify, and distribute this software and -its documentation for any purpose and without fee is hereby -granted, provided that the above copyright notice appear in all -copies and that both that the copyright notice and this -permission notice and warranty disclaimer appear in supporting -documentation, and that the name of Lucent or any of its entities -not be used in advertising or publicity pertaining to -distribution of the software without specific, written prior -permission. - -LUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. -IN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY -SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER -IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF -THIS SOFTWARE. - -****************************************************************/ - -/* Please send bug reports to David M. Gay (dmg at acm dot org, - * with " at " changed at "@" and " dot " changed to "."). */ - -#include "gdtoaimp.h" - - static void -#ifdef KR_headers -L_shift(x, x1, i) ULong *x; ULong *x1; int i; -#else -L_shift(ULong *x, ULong *x1, int i) -#endif -{ - int j; - - i = 8 - i; - i <<= 2; - j = ULbits - i; - do { - *x |= x[1] << j; - x[1] >>= i; - } while(++x < x1); - } - - int -#ifdef KR_headers -hexnan(sp, fpi, x0) - CONST char **sp; FPI *fpi; ULong *x0; -#else -hexnan( CONST char **sp, FPI *fpi, ULong *x0) -#endif -{ - ULong c, h, *x, *x1, *xe; - CONST char *s; - int havedig, hd0, i, nbits; - - if (!hexdig['0']) - hexdig_init_D2A(); - nbits = fpi->nbits; - x = x0 + (nbits >> kshift); - if (nbits & kmask) - x++; - *--x = 0; - x1 = xe = x; - havedig = hd0 = i = 0; - s = *sp; - while((c = *(CONST unsigned char*)++s)) { - if (!(h = hexdig[c])) { - if (c <= ' ') { - if (hd0 < havedig) { - if (x < x1 && i < 8) - L_shift(x, x1, i); - if (x <= x0) { - i = 8; - continue; - } - hd0 = havedig; - *--x = 0; - x1 = x; - i = 0; - } - continue; - } - if (/*(*/ c == ')' && havedig) { - *sp = s + 1; - break; - } - return STRTOG_NaN; - } - havedig++; - if (++i > 8) { - if (x <= x0) - continue; - i = 1; - *--x = 0; - } - *x = (*x << 4) | (h & 0xf); - } - if (!havedig) - return STRTOG_NaN; - if (x < x1 && i < 8) - L_shift(x, x1, i); - if (x > x0) { - x1 = x0; - do *x1++ = *x++; - while(x <= xe); - do *x1++ = 0; - while(x1 <= xe); - } - else { - /* truncate high-order word if necessary */ - if ( (i = nbits & (ULbits-1)) !=0) - *xe &= ((ULong)0xffffffff) >> (ULbits - i); - } - for(x1 = xe;; --x1) { - if (*x1 != 0) - break; - if (x1 == x0) { - *x1 = 1; - break; - } - } - return STRTOG_NaNbits; - } diff --git a/winsup/mingw/mingwex/gdtoa/misc.c b/winsup/mingw/mingwex/gdtoa/misc.c deleted file mode 100755 index 784f900c2..000000000 --- a/winsup/mingw/mingwex/gdtoa/misc.c +++ /dev/null @@ -1,962 +0,0 @@ -/**************************************************************** - -The author of this software is David M. Gay. - -Copyright (C) 1998, 1999 by Lucent Technologies -All Rights Reserved - -Permission to use, copy, modify, and distribute this software and -its documentation for any purpose and without fee is hereby -granted, provided that the above copyright notice appear in all -copies and that both that the copyright notice and this -permission notice and warranty disclaimer appear in supporting -documentation, and that the name of Lucent or any of its entities -not be used in advertising or publicity pertaining to -distribution of the software without specific, written prior -permission. - -LUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. -IN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY -SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER -IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF -THIS SOFTWARE. - -****************************************************************/ - -/* Please send bug reports to David M. Gay (dmg at acm dot org, - * with " at " changed at "@" and " dot " changed to "."). */ - - -#ifdef __MINGW32__ -/* we have to include windows.h before gdtoa headers, otherwise - defines cause conflicts. */ -#define WIN32_LEAN_AND_MEAN -#include <windows.h> - -#define NLOCKS 2 - -#ifdef USE_WIN32_SL -/* Use spin locks. */ -static long dtoa_sl[NLOCKS]; - -#define ACQUIRE_DTOA_LOCK(n) \ - while (InterlockedCompareExchange (&dtoa_sl[n], 1, 0) != 0) \ - Sleep (0); -#define FREE_DTOA_LOCK(n) InterlockedExchange (&dtoa_sl[n], 0); - -#else -#include <stdlib.h> -static CRITICAL_SECTION dtoa_CritSec[NLOCKS]; -static long dtoa_CS_init = 0; -/* - 1 = initializing - 2 = initialized - 3 = deleted -*/ -static void dtoa_lock_cleanup() -{ - long last_CS_init = InterlockedExchange (&dtoa_CS_init,3); - - if (2 == last_CS_init) - { - int i; - for (i = 0; i < NLOCKS; i++) - DeleteCriticalSection (&dtoa_CritSec[i]); - } -} - -static void dtoa_lock(int n) -{ - if (2 == dtoa_CS_init) - { - EnterCriticalSection (&dtoa_CritSec[n]); - return; - } - - else if (0 == dtoa_CS_init) - { - long last_CS_init = InterlockedExchange (&dtoa_CS_init, 1); - if (0 == last_CS_init) - { - int i; - for (i = 0; i < NLOCKS; i++) - InitializeCriticalSection (&dtoa_CritSec[i]); - atexit (dtoa_lock_cleanup); - dtoa_CS_init = 2; - } - else if (2 == last_CS_init) - dtoa_CS_init = 2; - } - /* Another thread is initializing. Wait. */ - while (1 == dtoa_CS_init) - Sleep (1); - - /* It had better be initialized now. */ - if (2 == dtoa_CS_init) - EnterCriticalSection(&dtoa_CritSec[n]); -} - -static void dtoa_unlock(int n) -{ - if (2 == dtoa_CS_init) - LeaveCriticalSection (&dtoa_CritSec[n]); -} - -#define ACQUIRE_DTOA_LOCK(n) dtoa_lock(n) -#define FREE_DTOA_LOCK(n) dtoa_unlock(n) -#endif - -#endif /* __MINGW32__ */ - -#include "gdtoaimp.h" - -#ifndef MULTIPLE_THREADS - char *dtoa_result; -#endif - - static Bigint *freelist[Kmax+1]; -#ifndef Omit_Private_Memory -#ifndef PRIVATE_MEM -#define PRIVATE_MEM 2304 -#endif -#define PRIVATE_mem ((PRIVATE_MEM+sizeof(double)-1)/sizeof(double)) -static double private_mem[PRIVATE_mem], *pmem_next = private_mem; -#endif - - Bigint * -Balloc -#ifdef KR_headers - (k) int k; -#else - (int k) -#endif -{ - int x; - Bigint *rv; -#ifndef Omit_Private_Memory - unsigned int len; -#endif - - ACQUIRE_DTOA_LOCK(0); - if ( (rv = freelist[k]) !=0) { - freelist[k] = rv->next; - } - else { - x = 1 << k; -#ifdef Omit_Private_Memory - rv = (Bigint *)MALLOC(sizeof(Bigint) + (x-1)*sizeof(ULong)); -#else - len = (sizeof(Bigint) + (x-1)*sizeof(ULong) + sizeof(double) - 1) - /sizeof(double); - if (pmem_next - private_mem + len <= PRIVATE_mem) { - rv = (Bigint*)pmem_next; - pmem_next += len; - } - else - rv = (Bigint*)MALLOC(len*sizeof(double)); -#endif - rv->k = k; - rv->maxwds = x; - } - FREE_DTOA_LOCK(0); - rv->sign = rv->wds = 0; - return rv; - } - - void -Bfree -#ifdef KR_headers - (v) Bigint *v; -#else - (Bigint *v) -#endif -{ - if (v) { - ACQUIRE_DTOA_LOCK(0); - v->next = freelist[v->k]; - freelist[v->k] = v; - FREE_DTOA_LOCK(0); - } - } - -// Shift y so lowest bit is 1 and return the number of bits y was -// shifted. -// With __GNUC__, we use an inline wrapper for __builtin_clz() -#ifndef __GNUC__ - int -lo0bits -#ifdef KR_headers - (y) ULong *y; -#else - (ULong *y) -#endif -{ - register int k; - register ULong x = *y; - - if (x & 7) { - if (x & 1) - return 0; - if (x & 2) { - *y = x >> 1; - return 1; - } - *y = x >> 2; - return 2; - } - k = 0; - if (!(x & 0xffff)) { - k = 16; - x >>= 16; - } - if (!(x & 0xff)) { - k += 8; - x >>= 8; - } - if (!(x & 0xf)) { - k += 4; - x >>= 4; - } - if (!(x & 0x3)) { - k += 2; - x >>= 2; - } - if (!(x & 1)) { - k++; - x >>= 1; - if (!x) - return 32; - } - *y = x; - return k; - } - -#endif /* __GNUC__ */ - - Bigint * -multadd -#ifdef KR_headers - (b, m, a) Bigint *b; int m, a; -#else - (Bigint *b, int m, int a) /* multiply by m and add a */ -#endif -{ - int i, wds; -#ifdef ULLong - ULong *x; - ULLong carry, y; -#else - ULong carry, *x, y; -#ifdef Pack_32 - ULong xi, z; -#endif -#endif - Bigint *b1; - - wds = b->wds; - x = b->x; - i = 0; - carry = a; - do { -#ifdef ULLong - y = *x * (ULLong)m + carry; - carry = y >> 32; - *x++ = y & 0xffffffffUL; -#else -#ifdef Pack_32 - xi = *x; - y = (xi & 0xffff) * m + carry; - z = (xi >> 16) * m + (y >> 16); - carry = z >> 16; - *x++ = (z << 16) + (y & 0xffff); -#else - y = *x * m + carry; - carry = y >> 16; - *x++ = y & 0xffff; -#endif -#endif - } - while(++i < wds); - if (carry) { - if (wds >= b->maxwds) { - b1 = Balloc(b->k+1); - Bcopy(b1, b); - Bfree(b); - b = b1; - } - b->x[wds++] = carry; - b->wds = wds; - } - return b; - } - -// With __GNUC__, we use an inline wrapper for __builtin_clz() -#ifndef __GNUC__ - int -hi0bits_D2A -#ifdef KR_headers - (x) register ULong x; -#else - (register ULong x) -#endif -{ - register int k = 0; - - if (!(x & 0xffff0000)) { - k = 16; - x <<= 16; - } - if (!(x & 0xff000000)) { - k += 8; - x <<= 8; - } - if (!(x & 0xf0000000)) { - k += 4; - x <<= 4; - } - if (!(x & 0xc0000000)) { - k += 2; - x <<= 2; - } - if (!(x & 0x80000000)) { - k++; - if (!(x & 0x40000000)) - return 32; - } - return k; - } - -#endif - - Bigint * -i2b -#ifdef KR_headers - (i) int i; -#else - (int i) -#endif -{ - Bigint *b; - - b = Balloc(1); - b->x[0] = i; - b->wds = 1; - return b; - } - - Bigint * -mult -#ifdef KR_headers - (a, b) Bigint *a, *b; -#else - (Bigint *a, Bigint *b) -#endif -{ - Bigint *c; - int k, wa, wb, wc; - ULong *x, *xa, *xae, *xb, *xbe, *xc, *xc0; - ULong y; -#ifdef ULLong - ULLong carry, z; -#else - ULong carry, z; -#ifdef Pack_32 - ULong z2; -#endif -#endif - - if (a->wds < b->wds) { - c = a; - a = b; - b = c; - } - k = a->k; - wa = a->wds; - wb = b->wds; - wc = wa + wb; - if (wc > a->maxwds) - k++; - c = Balloc(k); - for(x = c->x, xa = x + wc; x < xa; x++) - *x = 0; - xa = a->x; - xae = xa + wa; - xb = b->x; - xbe = xb + wb; - xc0 = c->x; -#ifdef ULLong - for(; xb < xbe; xc0++) { - if ( (y = *xb++) !=0) { - x = xa; - xc = xc0; - carry = 0; - do { - z = *x++ * (ULLong)y + *xc + carry; - carry = z >> 32; - *xc++ = z & 0xffffffffUL; - } - while(x < xae); - *xc = carry; - } - } -#else -#ifdef Pack_32 - for(; xb < xbe; xb++, xc0++) { - if ( (y = *xb & 0xffff) !=0) { - x = xa; - xc = xc0; - carry = 0; - do { - z = (*x & 0xffff) * y + (*xc & 0xffff) + carry; - carry = z >> 16; - z2 = (*x++ >> 16) * y + (*xc >> 16) + carry; - carry = z2 >> 16; - Storeinc(xc, z2, z); - } - while(x < xae); - *xc = carry; - } - if ( (y = *xb >> 16) !=0) { - x = xa; - xc = xc0; - carry = 0; - z2 = *xc; - do { - z = (*x & 0xffff) * y + (*xc >> 16) + carry; - carry = z >> 16; - Storeinc(xc, z, z2); - z2 = (*x++ >> 16) * y + (*xc & 0xffff) + carry; - carry = z2 >> 16; - } - while(x < xae); - *xc = z2; - } - } -#else - for(; xb < xbe; xc0++) { - if ( (y = *xb++) !=0) { - x = xa; - xc = xc0; - carry = 0; - do { - z = *x++ * y + *xc + carry; - carry = z >> 16; - *xc++ = z & 0xffff; - } - while(x < xae); - *xc = carry; - } - } -#endif -#endif - for(xc0 = c->x, xc = xc0 + wc; wc > 0 && !*--xc; --wc) ; - c->wds = wc; - return c; - } - - static Bigint *p5s; - - Bigint * -pow5mult -#ifdef KR_headers - (b, k) Bigint *b; int k; -#else - (Bigint *b, int k) -#endif -{ - Bigint *b1, *p5, *p51; - int i; - static int p05[3] = { 5, 25, 125 }; - - if ( (i = k & 3) !=0) - b = multadd(b, p05[i-1], 0); - - if (!(k >>= 2)) - return b; - if ((p5 = p5s) == 0) { - /* first time */ -#ifdef MULTIPLE_THREADS - ACQUIRE_DTOA_LOCK(1); - if (!(p5 = p5s)) { - p5 = p5s = i2b(625); - p5->next = 0; - } - FREE_DTOA_LOCK(1); -#else - p5 = p5s = i2b(625); - p5->next = 0; -#endif - } - for(;;) { - if (k & 1) { - b1 = mult(b, p5); - Bfree(b); - b = b1; - } - if (!(k >>= 1)) - break; - if ((p51 = p5->next) == 0) { -#ifdef MULTIPLE_THREADS - ACQUIRE_DTOA_LOCK(1); - if (!(p51 = p5->next)) { - p51 = p5->next = mult(p5,p5); - p51->next = 0; - } - FREE_DTOA_LOCK(1); -#else - p51 = p5->next = mult(p5,p5); - p51->next = 0; -#endif - } - p5 = p51; - } - return b; - } - - - Bigint * -lshift -#ifdef KR_headers - (b, k) Bigint *b; int k; -#else - (Bigint *b, int k) -#endif -{ - int i, k1, n, n1; - Bigint *b1; - ULong *x, *x1, *xe, z; - - n = k >> kshift; - k1 = b->k; - n1 = n + b->wds + 1; - for(i = b->maxwds; n1 > i; i <<= 1) - k1++; - b1 = Balloc(k1); - x1 = b1->x; - for(i = 0; i < n; i++) - *x1++ = 0; - x = b->x; - xe = x + b->wds; - if (k &= kmask) { -#ifdef Pack_32 - k1 = 32 - k; - z = 0; - do { - *x1++ = *x << k | z; - z = *x++ >> k1; - } - while(x < xe); - if ((*x1 = z) !=0) - ++n1; -#else - k1 = 16 - k; - z = 0; - do { - *x1++ = *x << k & 0xffff | z; - z = *x++ >> k1; - } - while(x < xe); - if (*x1 = z) - ++n1; -#endif - } - else do - *x1++ = *x++; - while(x < xe); - b1->wds = n1 - 1; - Bfree(b); - return b1; - } - - int -cmp -#ifdef KR_headers - (a, b) Bigint *a, *b; -#else - (Bigint *a, Bigint *b) -#endif -{ - ULong *xa, *xa0, *xb, *xb0; - int i, j; - - i = a->wds; - j = b->wds; -#ifdef DEBUG - if (i > 1 && !a->x[i-1]) - Bug("cmp called with a->x[a->wds-1] == 0"); - if (j > 1 && !b->x[j-1]) - Bug("cmp called with b->x[b->wds-1] == 0"); -#endif - if (i -= j) - return i; - xa0 = a->x; - xa = xa0 + j; - xb0 = b->x; - xb = xb0 + j; - for(;;) { - if (*--xa != *--xb) - return *xa < *xb ? -1 : 1; - if (xa <= xa0) - break; - } - return 0; - } - - Bigint * -diff -#ifdef KR_headers - (a, b) Bigint *a, *b; -#else - (Bigint *a, Bigint *b) -#endif -{ - Bigint *c; - int i, wa, wb; - ULong *xa, *xae, *xb, *xbe, *xc; -#ifdef ULLong - ULLong borrow, y; -#else - ULong borrow, y; -#ifdef Pack_32 - ULong z; -#endif -#endif - - i = cmp(a,b); - if (!i) { - c = Balloc(0); - c->wds = 1; - c->x[0] = 0; - return c; - } - if (i < 0) { - c = a; - a = b; - b = c; - i = 1; - } - else - i = 0; - c = Balloc(a->k); - c->sign = i; - wa = a->wds; - xa = a->x; - xae = xa + wa; - wb = b->wds; - xb = b->x; - xbe = xb + wb; - xc = c->x; - borrow = 0; -#ifdef ULLong - do { - y = (ULLong)*xa++ - *xb++ - borrow; - borrow = y >> 32 & 1UL; - *xc++ = y & 0xffffffffUL; - } - while(xb < xbe); - while(xa < xae) { - y = *xa++ - borrow; - borrow = y >> 32 & 1UL; - *xc++ = y & 0xffffffffUL; - } -#else -#ifdef Pack_32 - do { - y = (*xa & 0xffff) - (*xb & 0xffff) - borrow; - borrow = (y & 0x10000) >> 16; - z = (*xa++ >> 16) - (*xb++ >> 16) - borrow; - borrow = (z & 0x10000) >> 16; - Storeinc(xc, z, y); - } - while(xb < xbe); - while(xa < xae) { - y = (*xa & 0xffff) - borrow; - borrow = (y & 0x10000) >> 16; - z = (*xa++ >> 16) - borrow; - borrow = (z & 0x10000) >> 16; - Storeinc(xc, z, y); - } -#else - do { - y = *xa++ - *xb++ - borrow; - borrow = (y & 0x10000) >> 16; - *xc++ = y & 0xffff; - } - while(xb < xbe); - while(xa < xae) { - y = *xa++ - borrow; - borrow = (y & 0x10000) >> 16; - *xc++ = y & 0xffff; - } -#endif -#endif - while(!*--xc) - wa--; - c->wds = wa; - return c; - } - - double -b2d -#ifdef KR_headers - (a, e) Bigint *a; int *e; -#else - (Bigint *a, int *e) -#endif -{ - ULong *xa, *xa0, w, y, z; - int k; - double d; -#ifdef VAX - ULong d0, d1; -#else -#define d0 word0(d) -#define d1 word1(d) -#endif - - xa0 = a->x; - xa = xa0 + a->wds; - y = *--xa; -#ifdef DEBUG - if (!y) Bug("zero y in b2d"); -#endif - k = hi0bits(y); - *e = 32 - k; -#ifdef Pack_32 - if (k < Ebits) { - d0 = Exp_1 | y >> (Ebits - k); - w = xa > xa0 ? *--xa : 0; - d1 = y << ((32-Ebits) + k) | w >> (Ebits - k); - goto ret_d; - } - z = xa > xa0 ? *--xa : 0; - if (k -= Ebits) { - d0 = Exp_1 | y << k | z >> (32 - k); - y = xa > xa0 ? *--xa : 0; - d1 = z << k | y >> (32 - k); - } - else { - d0 = Exp_1 | y; - d1 = z; - } -#else - if (k < Ebits + 16) { - z = xa > xa0 ? *--xa : 0; - d0 = Exp_1 | y << k - Ebits | z >> Ebits + 16 - k; - w = xa > xa0 ? *--xa : 0; - y = xa > xa0 ? *--xa : 0; - d1 = z << k + 16 - Ebits | w << k - Ebits | y >> 16 + Ebits - k; - goto ret_d; - } - z = xa > xa0 ? *--xa : 0; - w = xa > xa0 ? *--xa : 0; - k -= Ebits + 16; - d0 = Exp_1 | y << k + 16 | z << k | w >> 16 - k; - y = xa > xa0 ? *--xa : 0; - d1 = w << k + 16 | y << k; -#endif - ret_d: -#ifdef VAX - word0(d) = d0 >> 16 | d0 << 16; - word1(d) = d1 >> 16 | d1 << 16; -#endif - return dval(d); - } -#undef d0 -#undef d1 - - Bigint * -d2b -#ifdef KR_headers - (d, e, bits) double d; int *e, *bits; -#else - (double d, int *e, int *bits) -#endif -{ - Bigint *b; -#ifndef Sudden_Underflow - int i; -#endif - int de, k; - ULong *x, y, z; -#ifdef VAX - ULong d0, d1; - d0 = word0(d) >> 16 | word0(d) << 16; - d1 = word1(d) >> 16 | word1(d) << 16; -#else -#define d0 word0(d) -#define d1 word1(d) -#endif - -#ifdef Pack_32 - b = Balloc(1); -#else - b = Balloc(2); -#endif - x = b->x; - - z = d0 & Frac_mask; - d0 &= 0x7fffffff; /* clear sign bit, which we ignore */ -#ifdef Sudden_Underflow - de = (int)(d0 >> Exp_shift); -#ifndef IBM - z |= Exp_msk11; -#endif -#else - if ( (de = (int)(d0 >> Exp_shift)) !=0) - z |= Exp_msk1; -#endif -#ifdef Pack_32 - if ( (y = d1) !=0) { - if ( (k = lo0bits(&y)) !=0) { - x[0] = y | z << (32 - k); - z >>= k; - } - else - x[0] = y; -#ifndef Sudden_Underflow - i = -#endif - b->wds = (x[1] = z) !=0 ? 2 : 1; - } - else { -#ifdef DEBUG - if (!z) - Bug("Zero passed to d2b"); -#endif - k = lo0bits(&z); - x[0] = z; -#ifndef Sudden_Underflow - i = -#endif - b->wds = 1; - k += 32; - } -#else - if ( (y = d1) !=0) { - if ( (k = lo0bits(&y)) !=0) - if (k >= 16) { - x[0] = y | z << 32 - k & 0xffff; - x[1] = z >> k - 16 & 0xffff; - x[2] = z >> k; - i = 2; - } - else { - x[0] = y & 0xffff; - x[1] = y >> 16 | z << 16 - k & 0xffff; - x[2] = z >> k & 0xffff; - x[3] = z >> k+16; - i = 3; - } - else { - x[0] = y & 0xffff; - x[1] = y >> 16; - x[2] = z & 0xffff; - x[3] = z >> 16; - i = 3; - } - } - else { -#ifdef DEBUG - if (!z) - Bug("Zero passed to d2b"); -#endif - k = lo0bits(&z); - if (k >= 16) { - x[0] = z; - i = 0; - } - else { - x[0] = z & 0xffff; - x[1] = z >> 16; - i = 1; - } - k += 32; - } - while(!x[i]) - --i; - b->wds = i + 1; -#endif -#ifndef Sudden_Underflow - if (de) { -#endif -#ifdef IBM - *e = (de - Bias - (P-1) << 2) + k; - *bits = 4*P + 8 - k - hi0bits(word0(d) & Frac_mask); -#else - *e = de - Bias - (P-1) + k; - *bits = P - k; -#endif -#ifndef Sudden_Underflow - } - else { - *e = de - Bias - (P-1) + 1 + k; -#ifdef Pack_32 - *bits = 32*i - hi0bits(x[i-1]); -#else - *bits = (i+2)*16 - hi0bits(x[i]); -#endif - } -#endif - return b; - } -#undef d0 -#undef d1 - - CONST double -#ifdef IEEE_Arith -bigtens[] = { 1e16, 1e32, 1e64, 1e128, 1e256 }; -CONST double tinytens[] = { 1e-16, 1e-32, 1e-64, 1e-128, 1e-256 - }; -#else -#ifdef IBM -bigtens[] = { 1e16, 1e32, 1e64 }; -CONST double tinytens[] = { 1e-16, 1e-32, 1e-64 }; -#else -bigtens[] = { 1e16, 1e32 }; -CONST double tinytens[] = { 1e-16, 1e-32 }; -#endif -#endif - - CONST double -tens[] = { - 1e0, 1e1, 1e2, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9, - 1e10, 1e11, 1e12, 1e13, 1e14, 1e15, 1e16, 1e17, 1e18, 1e19, - 1e20, 1e21, 1e22 -#ifdef VAX - , 1e23, 1e24 -#endif - }; - - char * -#ifdef KR_headers -strcp_D2A(a, b) char *a; char *b; -#else -strcp_D2A(char *a, CONST char *b) -#endif -{ - while((*a = *b++)) - a++; - return a; - } - -#ifdef NO_STRING_H - - Char * -#ifdef KR_headers -memcpy_D2A(a, b, len) Char *a; Char *b; size_t len; -#else -memcpy_D2A(void *a1, void *b1, size_t len) -#endif -{ - register char *a = (char*)a1, *ae = a + len; - register char *b = (char*)b1, *a0 = a; - while(a < ae) - *a++ = *b++; - return a0; - } - -#endif /* NO_STRING_H */ diff --git a/winsup/mingw/mingwex/gdtoa/qnan.c b/winsup/mingw/mingwex/gdtoa/qnan.c deleted file mode 100755 index ca564726a..000000000 --- a/winsup/mingw/mingwex/gdtoa/qnan.c +++ /dev/null @@ -1,110 +0,0 @@ -/**************************************************************** - -The author of this software is David M. Gay. - -Copyright (C) 2005 by David M. Gay -All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -provided that the above copyright notice appear in all copies and that -both that the copyright notice and this permission notice and warranty -disclaimer appear in supporting documentation, and that the name of -the author or any of his current or former employers not be used in -advertising or publicity pertaining to distribution of the software -without specific, written prior permission. - -THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN -NO EVENT SHALL THE AUTHOR OR ANY OF HIS CURRENT OR FORMER EMPLOYERS BE -LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY -DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. - -****************************************************************/ - -/* Please send bug reports to David M. Gay (dmg at acm dot org, - * with " at " changed at "@" and " dot " changed to "."). */ - -/* Program to compute quiet NaNs of various precisions (float, */ -/* double, and perhaps long double) on the current system, */ -/* provided the system uses binary IEEE (P754) arithmetic. */ -/* Note that one system's quiet NaN may be a signaling NaN on */ -/* another system. The IEEE arithmetic standards (P754, P854) */ -/* do not specify how to distinguish signaling NaNs from quiet */ -/* ones, and this detail varies across systems. The computed */ -/* NaN values are encoded in #defines for values for an */ -/* unsigned 32-bit integer type, called Ulong below, and */ -/* (for long double) perhaps as unsigned short values. Once */ -/* upon a time, there were PC compilers for Intel CPUs that */ -/* had sizeof(long double) = 10. Are such compilers still */ -/* distributed? */ - -#include <stdio.h> -#include "gd_arith.h" - -#ifndef Long -#define Long long -#endif - -typedef unsigned Long Ulong; - -#undef HAVE_IEEE -#ifdef IEEE_8087 -#define _0 1 -#define _1 0 -#define HAVE_IEEE -#endif -#ifdef IEEE_MC68k -#define _0 0 -#define _1 1 -#define HAVE_IEEE -#endif - -#define UL (unsigned long) - - int -main(void) -{ -#ifdef HAVE_IEEE - typedef union { - float f; - double d; - Ulong L[4]; -#ifndef NO_LONG_LONG - unsigned short u[5]; - long double D; -#endif - } U; - U a, b, c; - int i; - - a.L[0] = b.L[0] = 0x7f800000; - c.f = a.f - b.f; - printf("#define f_QNAN 0x%lx\n", UL c.L[0]); - a.L[_0] = b.L[_0] = 0x7ff00000; - a.L[_1] = b.L[_1] = 0; - c.d = a.d - b.d; /* quiet NaN */ - printf("#define d_QNAN0 0x%lx\n", UL c.L[0]); - printf("#define d_QNAN1 0x%lx\n", UL c.L[1]); -#ifdef NO_LONG_LONG - for(i = 0; i < 4; i++) - printf("#define ld_QNAN%d 0xffffffff\n", i); - for(i = 0; i < 5; i++) - printf("#define ldus_QNAN%d 0xffff\n", i); -#else - b.D = c.D = a.d; - if (printf("") < 0) - c.D = 37; /* never executed; just defeat optimization */ - a.L[2] = a.L[3] = 0; - a.D = b.D - c.D; - for(i = 0; i < 4; i++) - printf("#define ld_QNAN%d 0x%lx\n", i, UL a.L[i]); - for(i = 0; i < 5; i++) - printf("#define ldus_QNAN%d 0x%x\n", i, a.u[i]); -#endif -#endif /* HAVE_IEEE */ - return 0; - } diff --git a/winsup/mingw/mingwex/gdtoa/smisc.c b/winsup/mingw/mingwex/gdtoa/smisc.c deleted file mode 100755 index 163011e0a..000000000 --- a/winsup/mingw/mingwex/gdtoa/smisc.c +++ /dev/null @@ -1,191 +0,0 @@ -/**************************************************************** - -The author of this software is David M. Gay. - -Copyright (C) 1998, 1999 by Lucent Technologies -All Rights Reserved - -Permission to use, copy, modify, and distribute this software and -its documentation for any purpose and without fee is hereby -granted, provided that the above copyright notice appear in all -copies and that both that the copyright notice and this -permission notice and warranty disclaimer appear in supporting -documentation, and that the name of Lucent or any of its entities -not be used in advertising or publicity pertaining to -distribution of the software without specific, written prior -permission. - -LUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. -IN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY -SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER -IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF -THIS SOFTWARE. - -****************************************************************/ - -/* Please send bug reports to David M. Gay (dmg at acm dot org, - * with " at " changed at "@" and " dot " changed to "."). */ - -#include "gdtoaimp.h" - - Bigint * -s2b -#ifdef KR_headers - (s, nd0, nd, y9) CONST char *s; int nd0, nd; ULong y9; -#else - (CONST char *s, int nd0, int nd, ULong y9) -#endif -{ - Bigint *b; - int i, k; - Long x, y; - - x = (nd + 8) / 9; - for(k = 0, y = 1; x > y; y <<= 1, k++) ; -#ifdef Pack_32 - b = Balloc(k); - b->x[0] = y9; - b->wds = 1; -#else - b = Balloc(k+1); - b->x[0] = y9 & 0xffff; - b->wds = (b->x[1] = y9 >> 16) ? 2 : 1; -#endif - - i = 9; - if (9 < nd0) { - s += 9; - do b = multadd(b, 10, *s++ - '0'); - while(++i < nd0); - s++; - } - else - s += 10; - for(; i < nd; i++) - b = multadd(b, 10, *s++ - '0'); - return b; - } - - double -ratio -#ifdef KR_headers - (a, b) Bigint *a, *b; -#else - (Bigint *a, Bigint *b) -#endif -{ - double da, db; - int k, ka, kb; - - dval(da) = b2d(a, &ka); - dval(db) = b2d(b, &kb); - k = ka - kb + ULbits*(a->wds - b->wds); -#ifdef IBM - if (k > 0) { - word0(da) += (k >> 2)*Exp_msk1; - if (k &= 3) - dval(da) *= 1 << k; - } - else { - k = -k; - word0(db) += (k >> 2)*Exp_msk1; - if (k &= 3) - dval(db) *= 1 << k; - } -#else - if (k > 0) - word0(da) += k*Exp_msk1; - else { - k = -k; - word0(db) += k*Exp_msk1; - } -#endif - return dval(da) / dval(db); - } - -#ifdef INFNAN_CHECK - - int -match -#ifdef KR_headers - (sp, t) char **sp, *t; -#else - (CONST char **sp, char *t) -#endif -{ - int c, d; - CONST char *s = *sp; - - while( (d = *t++) !=0) { - if ((c = *++s) >= 'A' && c <= 'Z') - c += 'a' - 'A'; - if (c != d) - return 0; - } - *sp = s + 1; - return 1; - } -#endif /* INFNAN_CHECK */ - - void -#ifdef KR_headers -copybits(c, n, b) ULong *c; int n; Bigint *b; -#else -copybits(ULong *c, int n, Bigint *b) -#endif -{ - ULong *ce, *x, *xe; -#ifdef Pack_16 - int nw, nw1; -#endif - - ce = c + ((n-1) >> kshift) + 1; - x = b->x; -#ifdef Pack_32 - xe = x + b->wds; - while(x < xe) - *c++ = *x++; -#else - nw = b->wds; - nw1 = nw & 1; - for(xe = x + (nw - nw1); x < xe; x += 2) - Storeinc(c, x[1], x[0]); - if (nw1) - *c++ = *x; -#endif - while(c < ce) - *c++ = 0; - } - - ULong -#ifdef KR_headers -any_on(b, k) Bigint *b; int k; -#else -any_on(Bigint *b, int k) -#endif -{ - int n, nwds; - ULong *x, *x0, x1, x2; - - x = b->x; - nwds = b->wds; - n = k >> kshift; - if (n > nwds) - n = nwds; - else if (n < nwds && (k &= kmask)) { - x1 = x2 = x[n]; - x1 >>= k; - x1 <<= k; - if (x1 != x2) - return 1; - } - x0 = x; - x += n; - while(x > x0) - if (*--x) - return 1; - return 0; - } diff --git a/winsup/mingw/mingwex/gdtoa/strtodg.c b/winsup/mingw/mingwex/gdtoa/strtodg.c deleted file mode 100755 index 1f8de7c05..000000000 --- a/winsup/mingw/mingwex/gdtoa/strtodg.c +++ /dev/null @@ -1,1012 +0,0 @@ -/**************************************************************** - -The author of this software is David M. Gay. - -Copyright (C) 1998-2001 by Lucent Technologies -All Rights Reserved - -Permission to use, copy, modify, and distribute this software and -its documentation for any purpose and without fee is hereby -granted, provided that the above copyright notice appear in all -copies and that both that the copyright notice and this -permission notice and warranty disclaimer appear in supporting -documentation, and that the name of Lucent or any of its entities -not be used in advertising or publicity pertaining to -distribution of the software without specific, written prior -permission. - -LUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. -IN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY -SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER -IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF -THIS SOFTWARE. - -****************************************************************/ - -/* Please send bug reports to David M. Gay (dmg at acm dot org, - * with " at " changed at "@" and " dot " changed to "."). */ - -#include "gdtoaimp.h" - -#ifdef USE_LOCALE -#include "locale.h" -#endif - - static CONST int -fivesbits[] = { 0, 3, 5, 7, 10, 12, 14, 17, 19, 21, - 24, 26, 28, 31, 33, 35, 38, 40, 42, 45, - 47, 49, 52 -#ifdef VAX - , 54, 56 -#endif - }; - - Bigint * -#ifdef KR_headers -increment(b) Bigint *b; -#else -increment(Bigint *b) -#endif -{ - ULong *x, *xe; - Bigint *b1; -#ifdef Pack_16 - ULong carry = 1, y; -#endif - - x = b->x; - xe = x + b->wds; -#ifdef Pack_32 - do { - if (*x < (ULong)0xffffffffL) { - ++*x; - return b; - } - *x++ = 0; - } while(x < xe); -#else - do { - y = *x + carry; - carry = y >> 16; - *x++ = y & 0xffff; - if (!carry) - return b; - } while(x < xe); - if (carry) -#endif - { - if (b->wds >= b->maxwds) { - b1 = Balloc(b->k+1); - Bcopy(b1,b); - Bfree(b); - b = b1; - } - b->x[b->wds++] = 1; - } - return b; - } - - int -#ifdef KR_headers -decrement(b) Bigint *b; -#else -decrement(Bigint *b) -#endif -{ - ULong *x, *xe; -#ifdef Pack_16 - ULong borrow = 1, y; -#endif - - x = b->x; - xe = x + b->wds; -#ifdef Pack_32 - do { - if (*x) { - --*x; - break; - } - *x++ = 0xffffffffL; - } - while(x < xe); -#else - do { - y = *x - borrow; - borrow = (y & 0x10000) >> 16; - *x++ = y & 0xffff; - } while(borrow && x < xe); -#endif - return STRTOG_Inexlo; - } - - static int -#ifdef KR_headers -all_on(b, n) Bigint *b; int n; -#else -all_on(Bigint *b, int n) -#endif -{ - ULong *x, *xe; - - x = b->x; - xe = x + (n >> kshift); - while(x < xe) - if ((*x++ & ALL_ON) != ALL_ON) - return 0; - if (n &= kmask) - return ((*x | (ALL_ON << n)) & ALL_ON) == ALL_ON; - return 1; - } - - Bigint * -#ifdef KR_headers -set_ones(b, n) Bigint *b; int n; -#else -set_ones(Bigint *b, int n) -#endif -{ - int k; - ULong *x, *xe; - - k = (n + ((1 << kshift) - 1)) >> kshift; - if (b->k < k) { - Bfree(b); - b = Balloc(k); - } - k = n >> kshift; - if (n &= kmask) - k++; - b->wds = k; - x = b->x; - xe = x + k; - while(x < xe) - *x++ = ALL_ON; - if (n) - x[-1] >>= ULbits - n; - return b; - } - - static int -rvOK -#ifdef KR_headers - (d, fpi, exp, bits, exact, rd, irv) - double d; FPI *fpi; Long *exp; ULong *bits; int exact, rd, *irv; -#else - (double d, FPI *fpi, Long *exp, ULong *bits, int exact, int rd, int *irv) -#endif -{ - Bigint *b; - ULong carry, inex, lostbits; - int bdif, e, j, k, k1, nb, rv; - - carry = rv = 0; - b = d2b(d, &e, &bdif); - bdif -= nb = fpi->nbits; - e += bdif; - if (bdif <= 0) { - if (exact) - goto trunc; - goto ret; - } - if (P == nb) { - if ( -#ifndef IMPRECISE_INEXACT - exact && -#endif - fpi->rounding == -#ifdef RND_PRODQUOT - FPI_Round_near -#else - Flt_Rounds -#endif - ) goto trunc; - goto ret; - } - switch(rd) { - case 1: - goto trunc; - case 2: - break; - default: /* round near */ - k = bdif - 1; - if (k < 0) - goto trunc; - if (!k) { - if (!exact) - goto ret; - if (b->x[0] & 2) - break; - goto trunc; - } - if (b->x[k>>kshift] & ((ULong)1 << (k & kmask))) - break; - goto trunc; - } - /* "break" cases: round up 1 bit, then truncate; bdif > 0 */ - carry = 1; - trunc: - inex = lostbits = 0; - if (bdif > 0) { - if ( (lostbits = any_on(b, bdif)) !=0) - inex = STRTOG_Inexlo; - rshift(b, bdif); - if (carry) { - inex = STRTOG_Inexhi; - b = increment(b); - if ( (j = nb & kmask) !=0) - j = ULbits - j; - if (hi0bits(b->x[b->wds - 1]) != j) { - if (!lostbits) - lostbits = b->x[0] & 1; - rshift(b, 1); - e++; - } - } - } - else if (bdif < 0) - b = lshift(b, -bdif); - if (e < fpi->emin) { - k = fpi->emin - e; - e = fpi->emin; - if (k > nb || fpi->sudden_underflow) { - b->wds = inex = 0; - *irv = STRTOG_Underflow | STRTOG_Inexlo; - } - else { - k1 = k - 1; - if (k1 > 0 && !lostbits) - lostbits = any_on(b, k1); - if (!lostbits && !exact) - goto ret; - lostbits |= - carry = b->x[k1>>kshift] & (1 << (k1 & kmask)); - rshift(b, k); - *irv = STRTOG_Denormal; - if (carry) { - b = increment(b); - inex = STRTOG_Inexhi | STRTOG_Underflow; - } - else if (lostbits) - inex = STRTOG_Inexlo | STRTOG_Underflow; - } - } - else if (e > fpi->emax) { - e = fpi->emax + 1; - *irv = STRTOG_Infinite | STRTOG_Overflow | STRTOG_Inexhi; -#ifndef NO_ERRNO - errno = ERANGE; -#endif - b->wds = inex = 0; - } - *exp = e; - copybits(bits, nb, b); - *irv |= inex; - rv = 1; - ret: - Bfree(b); - return rv; - } - - static int -#ifdef KR_headers -mantbits(d) double d; -#else -mantbits(double d) -#endif -{ - ULong L; -#ifdef VAX - L = word1(d) << 16 | word1(d) >> 16; - if (L) -#else - if ( (L = word1(d)) !=0) -#endif - return P - lo0bits(&L); -#ifdef VAX - L = word0(d) << 16 | word0(d) >> 16 | Exp_msk11; -#else - L = word0(d) | Exp_msk1; -#endif - return P - 32 - lo0bits(&L); - } - - int -__strtodg -#ifdef KR_headers - (s00, se, fpi, exp, bits) - CONST char *s00; char **se; FPI *fpi; Long *exp; ULong *bits; -#else - (CONST char *s00, char **se, FPI *fpi, Long *exp, ULong *bits) -#endif -{ - int abe, abits, asub; - int bb0, bb2, bb5, bbe, bd2, bd5, bbbits, bs2, c, decpt, denorm; - int dsign, e, e1, e2, emin, esign, finished, i, inex, irv; - int j, k, nbits, nd, nd0, nf, nz, nz0, rd, rvbits, rve, rve1, sign; - int sudden_underflow; - CONST char *s, *s0, *s1; - double adj, adj0, rv, tol; - Long L; - ULong y, z; - Bigint *ab, *bb, *bb1, *bd, *bd0, *bs, *delta, *rvb, *rvb0; - - irv = STRTOG_Zero; - denorm = sign = nz0 = nz = 0; - dval(rv) = 0.; - rvb = 0; - nbits = fpi->nbits; - for(s = s00;;s++) switch(*s) { - case '-': - sign = 1; - /* no break */ - case '+': - if (*++s) - goto break2; - /* no break */ - case 0: - sign = 0; - irv = STRTOG_NoNumber; - s = s00; - goto ret; - case '\t': - case '\n': - case '\v': - case '\f': - case '\r': - case ' ': - continue; - default: - goto break2; - } - break2: - if (*s == '0') { -#ifndef NO_HEX_FP - switch(s[1]) { - case 'x': - case 'X': - irv = gethex(&s, fpi, exp, &rvb, sign); - if (irv == STRTOG_NoNumber) { - s = s00; - sign = 0; - } - goto ret; - } -#endif - nz0 = 1; - while(*++s == '0') ; - if (!*s) - goto ret; - } - sudden_underflow = fpi->sudden_underflow; - s0 = s; - y = z = 0; - for(decpt = nd = nf = 0; (c = *s) >= '0' && c <= '9'; nd++, s++) - if (nd < 9) - y = 10*y + c - '0'; - else if (nd < 16) - z = 10*z + c - '0'; - nd0 = nd; -#ifdef USE_LOCALE - if (c == *localeconv()->decimal_point) -#else - if (c == '.') -#endif - { - decpt = 1; - c = *++s; - if (!nd) { - for(; c == '0'; c = *++s) - nz++; - if (c > '0' && c <= '9') { - s0 = s; - nf += nz; - nz = 0; - goto have_dig; - } - goto dig_done; - } - for(; c >= '0' && c <= '9'; c = *++s) { - have_dig: - nz++; - if (c -= '0') { - nf += nz; - for(i = 1; i < nz; i++) - if (nd++ < 9) - y *= 10; - else if (nd <= DBL_DIG + 1) - z *= 10; - if (nd++ < 9) - y = 10*y + c; - else if (nd <= DBL_DIG + 1) - z = 10*z + c; - nz = 0; - } - } - } - dig_done: - e = 0; - if (c == 'e' || c == 'E') { - if (!nd && !nz && !nz0) { - irv = STRTOG_NoNumber; - s = s00; - goto ret; - } - s00 = s; - esign = 0; - switch(c = *++s) { - case '-': - esign = 1; - case '+': - c = *++s; - } - if (c >= '0' && c <= '9') { - while(c == '0') - c = *++s; - if (c > '0' && c <= '9') { - L = c - '0'; - s1 = s; - while((c = *++s) >= '0' && c <= '9') - L = 10*L + c - '0'; - if (s - s1 > 8 || L > 19999) - /* Avoid confusion from exponents - * so large that e might overflow. - */ - e = 19999; /* safe for 16 bit ints */ - else - e = (int)L; - if (esign) - e = -e; - } - else - e = 0; - } - else - s = s00; - } - if (!nd) { - if (!nz && !nz0) { -#ifdef INFNAN_CHECK - /* Check for Nan and Infinity */ - if (!decpt) - switch(c) { - case 'i': - case 'I': - if (match(&s,"nf")) { - --s; - if (!match(&s,"inity")) - ++s; - irv = STRTOG_Infinite; - goto infnanexp; - } - break; - case 'n': - case 'N': - if (match(&s, "an")) { - irv = STRTOG_NaN; - *exp = fpi->emax + 1; -#ifndef No_Hex_NaN - if (*s == '(') /*)*/ - irv = hexnan(&s, fpi, bits); -#endif - goto infnanexp; - } - } -#endif /* INFNAN_CHECK */ - irv = STRTOG_NoNumber; - s = s00; - } - goto ret; - } - - irv = STRTOG_Normal; - e1 = e -= nf; - rd = 0; - switch(fpi->rounding & 3) { - case FPI_Round_up: - rd = 2 - sign; - break; - case FPI_Round_zero: - rd = 1; - break; - case FPI_Round_down: - rd = 1 + sign; - } - - /* Now we have nd0 digits, starting at s0, followed by a - * decimal point, followed by nd-nd0 digits. The number we're - * after is the integer represented by those digits times - * 10**e */ - - if (!nd0) - nd0 = nd; - k = nd < DBL_DIG + 1 ? nd : DBL_DIG + 1; - dval(rv) = y; - if (k > 9) - dval(rv) = tens[k - 9] * dval(rv) + z; - bd0 = 0; - if (nbits <= P && nd <= DBL_DIG) { - if (!e) { - if (rvOK(dval(rv), fpi, exp, bits, 1, rd, &irv)) - goto ret; - } - else if (e > 0) { - if (e <= Ten_pmax) { -#ifdef VAX - goto vax_ovfl_check; -#else - i = fivesbits[e] + mantbits(dval(rv)) <= P; - /* rv = */ rounded_product(dval(rv), tens[e]); - if (rvOK(dval(rv), fpi, exp, bits, i, rd, &irv)) - goto ret; - e1 -= e; - goto rv_notOK; -#endif - } - i = DBL_DIG - nd; - if (e <= Ten_pmax + i) { - /* A fancier test would sometimes let us do - * this for larger i values. - */ - e2 = e - i; - e1 -= i; - dval(rv) *= tens[i]; -#ifdef VAX - /* VAX exponent range is so narrow we must - * worry about overflow here... - */ - vax_ovfl_check: - dval(adj) = dval(rv); - word0(adj) -= P*Exp_msk1; - /* adj = */ rounded_product(dval(adj), tens[e2]); - if ((word0(adj) & Exp_mask) - > Exp_msk1*(DBL_MAX_EXP+Bias-1-P)) - goto rv_notOK; - word0(adj) += P*Exp_msk1; - dval(rv) = dval(adj); -#else - /* rv = */ rounded_product(dval(rv), tens[e2]); -#endif - if (rvOK(dval(rv), fpi, exp, bits, 0, rd, &irv)) - goto ret; - e1 -= e2; - } - } -#ifndef Inaccurate_Divide - else if (e >= -Ten_pmax) { - /* rv = */ rounded_quotient(dval(rv), tens[-e]); - if (rvOK(dval(rv), fpi, exp, bits, 0, rd, &irv)) - goto ret; - e1 -= e; - } -#endif - } - rv_notOK: - e1 += nd - k; - - /* Get starting approximation = rv * 10**e1 */ - - e2 = 0; - if (e1 > 0) { - if ( (i = e1 & 15) !=0) - dval(rv) *= tens[i]; - if (e1 &= ~15) { - e1 >>= 4; - while(e1 >= (1 << (n_bigtens-1))) { - e2 += ((word0(rv) & Exp_mask) - >> Exp_shift1) - Bias; - word0(rv) &= ~Exp_mask; - word0(rv) |= Bias << Exp_shift1; - dval(rv) *= bigtens[n_bigtens-1]; - e1 -= 1 << (n_bigtens-1); - } - e2 += ((word0(rv) & Exp_mask) >> Exp_shift1) - Bias; - word0(rv) &= ~Exp_mask; - word0(rv) |= Bias << Exp_shift1; - for(j = 0; e1 > 0; j++, e1 >>= 1) - if (e1 & 1) - dval(rv) *= bigtens[j]; - } - } - else if (e1 < 0) { - e1 = -e1; - if ( (i = e1 & 15) !=0) - dval(rv) /= tens[i]; - if (e1 &= ~15) { - e1 >>= 4; - while(e1 >= (1 << (n_bigtens-1))) { - e2 += ((word0(rv) & Exp_mask) - >> Exp_shift1) - Bias; - word0(rv) &= ~Exp_mask; - word0(rv) |= Bias << Exp_shift1; - dval(rv) *= tinytens[n_bigtens-1]; - e1 -= 1 << (n_bigtens-1); - } - e2 += ((word0(rv) & Exp_mask) >> Exp_shift1) - Bias; - word0(rv) &= ~Exp_mask; - word0(rv) |= Bias << Exp_shift1; - for(j = 0; e1 > 0; j++, e1 >>= 1) - if (e1 & 1) - dval(rv) *= tinytens[j]; - } - } -#ifdef IBM - /* e2 is a correction to the (base 2) exponent of the return - * value, reflecting adjustments above to avoid overflow in the - * native arithmetic. For native IBM (base 16) arithmetic, we - * must multiply e2 by 4 to change from base 16 to 2. - */ - e2 <<= 2; -#endif - rvb = d2b(dval(rv), &rve, &rvbits); /* rv = rvb * 2^rve */ - rve += e2; - if ((j = rvbits - nbits) > 0) { - rshift(rvb, j); - rvbits = nbits; - rve += j; - } - bb0 = 0; /* trailing zero bits in rvb */ - e2 = rve + rvbits - nbits; - if (e2 > fpi->emax + 1) - goto huge; - rve1 = rve + rvbits - nbits; - if (e2 < (emin = fpi->emin)) { - denorm = 1; - j = rve - emin; - if (j > 0) { - rvb = lshift(rvb, j); - rvbits += j; - } - else if (j < 0) { - rvbits += j; - if (rvbits <= 0) { - if (rvbits < -1) { - ufl: - rvb->wds = 0; - rvb->x[0] = 0; - *exp = emin; - irv = STRTOG_Underflow | STRTOG_Inexlo; - goto ret; - } - rvb->x[0] = rvb->wds = rvbits = 1; - } - else - rshift(rvb, -j); - } - rve = rve1 = emin; - if (sudden_underflow && e2 + 1 < emin) - goto ufl; - } - - /* Now the hard part -- adjusting rv to the correct value.*/ - - /* Put digits into bd: true value = bd * 10^e */ - - bd0 = s2b(s0, nd0, nd, y); - - for(;;) { - bd = Balloc(bd0->k); - Bcopy(bd, bd0); - bb = Balloc(rvb->k); - Bcopy(bb, rvb); - bbbits = rvbits - bb0; - bbe = rve + bb0; - bs = i2b(1); - - if (e >= 0) { - bb2 = bb5 = 0; - bd2 = bd5 = e; - } - else { - bb2 = bb5 = -e; - bd2 = bd5 = 0; - } - if (bbe >= 0) - bb2 += bbe; - else - bd2 -= bbe; - bs2 = bb2; - j = nbits + 1 - bbbits; - i = bbe + bbbits - nbits; - if (i < emin) /* denormal */ - j += i - emin; - bb2 += j; - bd2 += j; - i = bb2 < bd2 ? bb2 : bd2; - if (i > bs2) - i = bs2; - if (i > 0) { - bb2 -= i; - bd2 -= i; - bs2 -= i; - } - if (bb5 > 0) { - bs = pow5mult(bs, bb5); - bb1 = mult(bs, bb); - Bfree(bb); - bb = bb1; - } - bb2 -= bb0; - if (bb2 > 0) - bb = lshift(bb, bb2); - else if (bb2 < 0) - rshift(bb, -bb2); - if (bd5 > 0) - bd = pow5mult(bd, bd5); - if (bd2 > 0) - bd = lshift(bd, bd2); - if (bs2 > 0) - bs = lshift(bs, bs2); - asub = 1; - inex = STRTOG_Inexhi; - delta = diff(bb, bd); - if (delta->wds <= 1 && !delta->x[0]) - break; - dsign = delta->sign; - delta->sign = finished = 0; - L = 0; - i = cmp(delta, bs); - if (rd && i <= 0) { - irv = STRTOG_Normal; - if ( (finished = dsign ^ (rd&1)) !=0) { - if (dsign != 0) { - irv |= STRTOG_Inexhi; - goto adj1; - } - irv |= STRTOG_Inexlo; - if (rve1 == emin) - goto adj1; - for(i = 0, j = nbits; j >= ULbits; - i++, j -= ULbits) { - if (rvb->x[i] & ALL_ON) - goto adj1; - } - if (j > 1 && lo0bits(rvb->x + i) < j - 1) - goto adj1; - rve = rve1 - 1; - rvb = set_ones(rvb, rvbits = nbits); - break; - } - irv |= dsign ? STRTOG_Inexlo : STRTOG_Inexhi; - break; - } - if (i < 0) { - /* Error is less than half an ulp -- check for - * special case of mantissa a power of two. - */ - irv = dsign - ? STRTOG_Normal | STRTOG_Inexlo - : STRTOG_Normal | STRTOG_Inexhi; - if (dsign || bbbits > 1 || denorm || rve1 == emin) - break; - delta = lshift(delta,1); - if (cmp(delta, bs) > 0) { - irv = STRTOG_Normal | STRTOG_Inexlo; - goto drop_down; - } - break; - } - if (i == 0) { - /* exactly half-way between */ - if (dsign) { - if (denorm && all_on(rvb, rvbits)) { - /*boundary case -- increment exponent*/ - rvb->wds = 1; - rvb->x[0] = 1; - rve = emin + nbits - (rvbits = 1); - irv = STRTOG_Normal | STRTOG_Inexhi; - denorm = 0; - break; - } - irv = STRTOG_Normal | STRTOG_Inexlo; - } - else if (bbbits == 1) { - irv = STRTOG_Normal; - drop_down: - /* boundary case -- decrement exponent */ - if (rve1 == emin) { - irv = STRTOG_Normal | STRTOG_Inexhi; - if (rvb->wds == 1 && rvb->x[0] == 1) - sudden_underflow = 1; - break; - } - rve -= nbits; - rvb = set_ones(rvb, rvbits = nbits); - break; - } - else - irv = STRTOG_Normal | STRTOG_Inexhi; - if ((bbbits < nbits && !denorm) || !(rvb->x[0] & 1)) - break; - if (dsign) { - rvb = increment(rvb); - if ( (j = rvbits & kmask) !=0) - j = ULbits - j; - if (hi0bits(rvb->x[(rvb->wds - 1) >> kshift]) - != j) - rvbits++; - irv = STRTOG_Normal | STRTOG_Inexhi; - } - else { - if (bbbits == 1) - goto undfl; - decrement(rvb); - irv = STRTOG_Normal | STRTOG_Inexlo; - } - break; - } - if ((dval(adj) = ratio(delta, bs)) <= 2.) { - adj1: - inex = STRTOG_Inexlo; - if (dsign) { - asub = 0; - inex = STRTOG_Inexhi; - } - else if (denorm && bbbits <= 1) { - undfl: - rvb->wds = 0; - rve = emin; - irv = STRTOG_Underflow | STRTOG_Inexlo; - break; - } - adj0 = dval(adj) = 1.; - } - else { - adj0 = dval(adj) *= 0.5; - if (dsign) { - asub = 0; - inex = STRTOG_Inexlo; - } - if (dval(adj) < 2147483647.) { - L = adj0; - adj0 -= L; - switch(rd) { - case 0: - if (adj0 >= .5) - goto inc_L; - break; - case 1: - if (asub && adj0 > 0.) - goto inc_L; - break; - case 2: - if (!asub && adj0 > 0.) { - inc_L: - L++; - inex = STRTOG_Inexact - inex; - } - } - dval(adj) = L; - } - } - y = rve + rvbits; - - /* adj *= ulp(dval(rv)); */ - /* if (asub) rv -= adj; else rv += adj; */ - - if (!denorm && rvbits < nbits) { - rvb = lshift(rvb, j = nbits - rvbits); - rve -= j; - rvbits = nbits; - } - ab = d2b(dval(adj), &abe, &abits); - if (abe < 0) - rshift(ab, -abe); - else if (abe > 0) - ab = lshift(ab, abe); - rvb0 = rvb; - if (asub) { - /* rv -= adj; */ - j = hi0bits(rvb->x[rvb->wds-1]); - rvb = diff(rvb, ab); - k = rvb0->wds - 1; - if (denorm) - /* do nothing */; - else if (rvb->wds <= k - || hi0bits( rvb->x[k]) > - hi0bits(rvb0->x[k])) { - /* unlikely; can only have lost 1 high bit */ - if (rve1 == emin) { - --rvbits; - denorm = 1; - } - else { - rvb = lshift(rvb, 1); - --rve; - --rve1; - L = finished = 0; - } - } - } - else { - rvb = sum(rvb, ab); - k = rvb->wds - 1; - if (k >= rvb0->wds - || hi0bits(rvb->x[k]) < hi0bits(rvb0->x[k])) { - if (denorm) { - if (++rvbits == nbits) - denorm = 0; - } - else { - rshift(rvb, 1); - rve++; - rve1++; - L = 0; - } - } - } - Bfree(ab); - Bfree(rvb0); - if (finished) - break; - - z = rve + rvbits; - if (y == z && L) { - /* Can we stop now? */ - tol = dval(adj) * 5e-16; /* > max rel error */ - dval(adj) = adj0 - .5; - if (dval(adj) < -tol) { - if (adj0 > tol) { - irv |= inex; - break; - } - } - else if (dval(adj) > tol && adj0 < 1. - tol) { - irv |= inex; - break; - } - } - bb0 = denorm ? 0 : trailz(rvb); - Bfree(bb); - Bfree(bd); - Bfree(bs); - Bfree(delta); - } - if (!denorm && (j = nbits - rvbits)) { - if (j > 0) - rvb = lshift(rvb, j); - else - rshift(rvb, -j); - rve -= j; - } - *exp = rve; - Bfree(bb); - Bfree(bd); - Bfree(bs); - Bfree(bd0); - Bfree(delta); - if (rve > fpi->emax) { - huge: - rvb->wds = 0; - irv = STRTOG_Infinite | STRTOG_Overflow | STRTOG_Inexhi; -#ifndef NO_ERRNO - errno = ERANGE; -#endif - infnanexp: - *exp = fpi->emax + 1; - } - ret: - if (denorm) { - if (sudden_underflow) { - rvb->wds = 0; - irv = STRTOG_Underflow | STRTOG_Inexlo; - } - else { - irv = (irv & ~STRTOG_Retmask) | - (rvb->wds > 0 ? STRTOG_Denormal : STRTOG_Zero); - if (irv & STRTOG_Inexact) - irv |= STRTOG_Underflow; - } - } - if (se) - *se = (char *)s; - if (sign) - irv |= STRTOG_Neg; - if (rvb) { - copybits(bits, nbits, rvb); - Bfree(rvb); - } - return irv; - } diff --git a/winsup/mingw/mingwex/gdtoa/strtodnrp.c b/winsup/mingw/mingwex/gdtoa/strtodnrp.c deleted file mode 100755 index ac81b2bbd..000000000 --- a/winsup/mingw/mingwex/gdtoa/strtodnrp.c +++ /dev/null @@ -1,87 +0,0 @@ -/**************************************************************** - -The author of this software is David M. Gay. - -Copyright (C) 2004 by David M. Gay. -All Rights Reserved -Based on material in the rest of /netlib/fp/gdota.tar.gz, -which is copyright (C) 1998, 2000 by Lucent Technologies. - -Permission to use, copy, modify, and distribute this software and -its documentation for any purpose and without fee is hereby -granted, provided that the above copyright notice appear in all -copies and that both that the copyright notice and this -permission notice and warranty disclaimer appear in supporting -documentation, and that the name of Lucent or any of its entities -not be used in advertising or publicity pertaining to -distribution of the software without specific, written prior -permission. - -LUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. -IN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY -SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER -IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF -THIS SOFTWARE. - -****************************************************************/ - -/* This is a variant of strtod that works on Intel ia32 systems */ -/* with the default extended-precision arithmetic -- it does not */ -/* require setting the precision control to 53 bits. */ - -/* Please send bug reports to David M. Gay (dmg at acm dot org, - * with " at " changed at "@" and " dot " changed to "."). */ - -#include "gdtoaimp.h" - - double -#ifdef KR_headers -__strtod(s, sp) CONST char *s; char **sp; -#else -__strtod(CONST char *s, char **sp) -#endif -{ - static FPI fpi = { 53, 1-1023-53+1, 2046-1023-53+1, 1, SI }; - ULong bits[2]; - Long exp; - int k; - union { ULong L[2]; double d; } u; - - k = __strtodg(s, sp, &fpi, &exp, bits); - switch(k & STRTOG_Retmask) { - case STRTOG_NoNumber: - case STRTOG_Zero: - u.L[0] = u.L[1] = 0; - break; - - case STRTOG_Normal: - u.L[_1] = bits[0]; - u.L[_0] = (bits[1] & ~0x100000) | ((exp + 0x3ff + 52) << 20); - break; - - case STRTOG_Denormal: - u.L[_1] = bits[0]; - u.L[_0] = bits[1]; - break; - - case STRTOG_Infinite: - u.L[_0] = 0x7ff00000; - u.L[_1] = 0; - break; - - case STRTOG_NaN: - u.L[0] = d_QNAN0; - u.L[1] = d_QNAN1; - break; - - case STRTOG_NaNbits: - u.L[_0] = 0x7ff00000 | bits[1]; - u.L[_1] = bits[0]; - } - if (k & STRTOG_Neg) - u.L[_0] |= 0x80000000L; - return u.d; - } diff --git a/winsup/mingw/mingwex/gdtoa/strtof.c b/winsup/mingw/mingwex/gdtoa/strtof.c deleted file mode 100755 index f5d7f4dde..000000000 --- a/winsup/mingw/mingwex/gdtoa/strtof.c +++ /dev/null @@ -1,77 +0,0 @@ -/**************************************************************** - -The author of this software is David M. Gay. - -Copyright (C) 1998, 2000 by Lucent Technologies -All Rights Reserved - -Permission to use, copy, modify, and distribute this software and -its documentation for any purpose and without fee is hereby -granted, provided that the above copyright notice appear in all -copies and that both that the copyright notice and this -permission notice and warranty disclaimer appear in supporting -documentation, and that the name of Lucent or any of its entities -not be used in advertising or publicity pertaining to -distribution of the software without specific, written prior -permission. - -LUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. -IN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY -SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER -IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF -THIS SOFTWARE. - -****************************************************************/ - -/* Please send bug reports to David M. Gay (dmg at acm dot org, - * with " at " changed at "@" and " dot " changed to "."). */ - -#include "gdtoaimp.h" - - float -#ifdef KR_headers -__strtof(s, sp) CONST char *s; char **sp; -#else -__strtof(CONST char *s, char **sp) -#endif -{ - static FPI fpi = { 24, 1-127-24+1, 254-127-24+1, 1, SI }; - ULong bits[1]; - Long exp; - int k; - union { ULong L[1]; float f; } u; - - k = __strtodg(s, sp, &fpi, &exp, bits); - switch(k & STRTOG_Retmask) { - case STRTOG_NoNumber: - case STRTOG_Zero: - u.L[0] = 0; - break; - - case STRTOG_Normal: - case STRTOG_NaNbits: - u.L[0] = (bits[0] & 0x7fffff) | (exp + 0x7f + 23) << 23; - break; - - case STRTOG_Denormal: - u.L[0] = bits[0]; - break; - - case STRTOG_Infinite: - u.L[0] = 0x7f800000; - break; - - case STRTOG_NaN: - u.L[0] = f_QNAN; - } - if (k & STRTOG_Neg) - u.L[0] |= 0x80000000L; - return u.f; - } - -float __cdecl -strtof (const char * __restrict__ src, char ** __restrict__ endptr) - __attribute__((alias("__strtof"))); diff --git a/winsup/mingw/mingwex/gdtoa/strtopx.c b/winsup/mingw/mingwex/gdtoa/strtopx.c deleted file mode 100755 index 59b7c2289..000000000 --- a/winsup/mingw/mingwex/gdtoa/strtopx.c +++ /dev/null @@ -1,119 +0,0 @@ -/**************************************************************** - -The author of this software is David M. Gay. - -Copyright (C) 1998, 2000 by Lucent Technologies -All Rights Reserved - -Permission to use, copy, modify, and distribute this software and -its documentation for any purpose and without fee is hereby -granted, provided that the above copyright notice appear in all -copies and that both that the copyright notice and this -permission notice and warranty disclaimer appear in supporting -documentation, and that the name of Lucent or any of its entities -not be used in advertising or publicity pertaining to -distribution of the software without specific, written prior -permission. - -LUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. -IN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY -SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER -IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF -THIS SOFTWARE. - -****************************************************************/ - -/* Please send bug reports to David M. Gay (dmg at acm dot org, - * with " at " changed at "@" and " dot " changed to "."). */ - -#include "gdtoaimp.h" - -#undef _0 -#undef _1 - -/* one or the other of IEEE_MC68k or IEEE_8087 should be #defined */ - -#ifdef IEEE_MC68k -#define _0 0 -#define _1 1 -#define _2 2 -#define _3 3 -#define _4 4 -#endif -#ifdef IEEE_8087 -#define _0 4 -#define _1 3 -#define _2 2 -#define _3 1 -#define _4 0 -#endif - -static int -#ifdef KR_headers -__strtopx(s, sp, V) CONST char *s; char **sp; long double *V; -#else -__strtopx(CONST char *s, char **sp, long double *V) -#endif -{ - static FPI fpi = { 64, 1-16383-64+1, 32766 - 16383 - 64 + 1, 1, SI }; - ULong bits[2]; - Long exp; - int k; - UShort *L = (UShort*)V; - - k = __strtodg(s, sp, &fpi, &exp, bits); - switch(k & STRTOG_Retmask) { - case STRTOG_NoNumber: - case STRTOG_Zero: - L[0] = L[1] = L[2] = L[3] = L[4] = 0; - break; - - case STRTOG_Denormal: - L[_0] = 0; - goto normal_bits; - - case STRTOG_Normal: - case STRTOG_NaNbits: - L[_0] = exp + 0x3fff + 63; - normal_bits: - L[_4] = (UShort)bits[0]; - L[_3] = (UShort)(bits[0] >> 16); - L[_2] = (UShort)bits[1]; - L[_1] = (UShort)(bits[1] >> 16); - break; - - case STRTOG_Infinite: - L[_0] = 0x7fff; - L[_1] = 0x8000; - L[_2] = L[_3] = L[_4] = 0; - break; - - case STRTOG_NaN: - L[0] = ldus_QNAN0; - L[1] = ldus_QNAN1; - L[2] = ldus_QNAN2; - L[3] = ldus_QNAN3; - L[4] = ldus_QNAN4; - } - if (k & STRTOG_Neg) - L[_0] |= 0x8000; - return k; - } - -long double -__cdecl -__strtold (const char * __restrict__ src, char ** __restrict__ endptr) -{ - long double ret; - __strtopx(src, endptr, &ret); - return ret; -} - -long double -__cdecl -strtold (const char * __restrict__ src, char ** __restrict__ endptr) - __attribute__((alias("__strtold"))); - diff --git a/winsup/mingw/mingwex/gdtoa/sum.c b/winsup/mingw/mingwex/gdtoa/sum.c deleted file mode 100755 index dc0c88bcf..000000000 --- a/winsup/mingw/mingwex/gdtoa/sum.c +++ /dev/null @@ -1,98 +0,0 @@ -/**************************************************************** - -The author of this software is David M. Gay. - -Copyright (C) 1998 by Lucent Technologies -All Rights Reserved - -Permission to use, copy, modify, and distribute this software and -its documentation for any purpose and without fee is hereby -granted, provided that the above copyright notice appear in all -copies and that both that the copyright notice and this -permission notice and warranty disclaimer appear in supporting -documentation, and that the name of Lucent or any of its entities -not be used in advertising or publicity pertaining to -distribution of the software without specific, written prior -permission. - -LUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. -IN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY -SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER -IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF -THIS SOFTWARE. - -****************************************************************/ - -/* Please send bug reports to David M. Gay (dmg at acm dot org, - * with " at " changed at "@" and " dot " changed to "."). */ - -#include "gdtoaimp.h" - - Bigint * -#ifdef KR_headers -sum(a, b) Bigint *a; Bigint *b; -#else -sum(Bigint *a, Bigint *b) -#endif -{ - Bigint *c; - ULong carry, *xc, *xa, *xb, *xe, y; -#ifdef Pack_32 - ULong z; -#endif - - if (a->wds < b->wds) { - c = b; b = a; a = c; - } - c = Balloc(a->k); - c->wds = a->wds; - carry = 0; - xa = a->x; - xb = b->x; - xc = c->x; - xe = xc + b->wds; -#ifdef Pack_32 - do { - y = (*xa & 0xffff) + (*xb & 0xffff) + carry; - carry = (y & 0x10000) >> 16; - z = (*xa++ >> 16) + (*xb++ >> 16) + carry; - carry = (z & 0x10000) >> 16; - Storeinc(xc, z, y); - } - while(xc < xe); - xe += a->wds - b->wds; - while(xc < xe) { - y = (*xa & 0xffff) + carry; - carry = (y & 0x10000) >> 16; - z = (*xa++ >> 16) + carry; - carry = (z & 0x10000) >> 16; - Storeinc(xc, z, y); - } -#else - do { - y = *xa++ + *xb++ + carry; - carry = (y & 0x10000) >> 16; - *xc++ = y & 0xffff; - } - while(xc < xe); - xe += a->wds - b->wds; - while(xc < xe) { - y = *xa++ + carry; - carry = (y & 0x10000) >> 16; - *xc++ = y & 0xffff; - } -#endif - if (carry) { - if (c->wds == c->maxwds) { - b = Balloc(c->k + 1); - Bcopy(b, c); - Bfree(c); - c = b; - } - c->x[c->wds++] = 1; - } - return c; - } diff --git a/winsup/mingw/mingwex/gdtoa/ulp.c b/winsup/mingw/mingwex/gdtoa/ulp.c deleted file mode 100755 index 8e7b4d83b..000000000 --- a/winsup/mingw/mingwex/gdtoa/ulp.c +++ /dev/null @@ -1,70 +0,0 @@ -/**************************************************************** - -The author of this software is David M. Gay. - -Copyright (C) 1998, 1999 by Lucent Technologies -All Rights Reserved - -Permission to use, copy, modify, and distribute this software and -its documentation for any purpose and without fee is hereby -granted, provided that the above copyright notice appear in all -copies and that both that the copyright notice and this -permission notice and warranty disclaimer appear in supporting -documentation, and that the name of Lucent or any of its entities -not be used in advertising or publicity pertaining to -distribution of the software without specific, written prior -permission. - -LUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. -IN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY -SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER -IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF -THIS SOFTWARE. - -****************************************************************/ - -/* Please send bug reports to David M. Gay (dmg at acm dot org, - * with " at " changed at "@" and " dot " changed to "."). */ - -#include "gdtoaimp.h" - - double -ulp -#ifdef KR_headers - (x) double x; -#else - (double x) -#endif -{ - Long L; - double a; - - L = (word0(x) & Exp_mask) - (P-1)*Exp_msk1; -#ifndef Sudden_Underflow - if (L > 0) { -#endif -#ifdef IBM - L |= Exp_msk1 >> 4; -#endif - word0(a) = L; - word1(a) = 0; -#ifndef Sudden_Underflow - } - else { - L = -L >> Exp_shift; - if (L < Exp_shift) { - word0(a) = 0x80000 >> L; - word1(a) = 0; - } - else { - word0(a) = 0; - L -= Exp_shift; - word1(a) = L >= 31 ? 1 : 1 << (31 - L); - } - } -#endif - return a; - } diff --git a/winsup/mingw/mingwex/getopt.c b/winsup/mingw/mingwex/getopt.c deleted file mode 100644 index 081cc56e1..000000000 --- a/winsup/mingw/mingwex/getopt.c +++ /dev/null @@ -1,667 +0,0 @@ -/* - * getopt.c - * - * $Id$ - * - * Implementation of the `getopt', `getopt_long' and `getopt_long_only' - * APIs, for inclusion in the MinGW runtime library. - * - * This file is part of the MinGW32 package set. - * - * Contributed by Keith Marshall <keithmarshall@users.sourceforge.net> - * - * - * THIS SOFTWARE IS NOT COPYRIGHTED - * - * This source code is offered for use in the public domain. You may - * use, modify or distribute it freely. - * - * This code is distributed in the hope that it will be useful but - * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY - * DISCLAIMED. This includes but is not limited to warranties of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * $Revision$ - * $Author$ - * $Date$ - * - */ - -#include <stdio.h> -#include <stdlib.h> -#include <stdarg.h> -#include <getopt.h> - -/* Identify how to get the calling program name, for use in messages... - */ -#ifdef __CYGWIN__ -/* - * CYGWIN uses this DLL reference... - */ -# define PROGNAME __progname -extern char __declspec(dllimport) *__progname; -#else -/* - * ...while elsewhere, we simply use the first argument passed. - */ -# define PROGNAME *argv -#endif - -/* Initialise the public variables. */ - -int optind = 1; /* index for first non-option arg */ -int opterr = 1; /* enable built-in error messages */ - -char *optarg = NULL; /* pointer to current option argument */ - -#define CHAR char /* argument type selector */ - -#define getopt_switchar '-' /* option prefix character in argv */ -#define getopt_pluschar '+' /* prefix for POSIX mode in optstring */ -#define getopt_takes_argument ':' /* marker for optarg in optstring */ -#define getopt_arg_assign '=' /* longopt argument field separator */ -#define getopt_unknown '?' /* return code for unmatched option */ -#define getopt_ordered 1 /* return code for ordered non-option */ - -#define getopt_all_done -1 /* return code to indicate completion */ - -enum -{ /* All `getopt' API functions are implemented via calls to the - * common static function `getopt_parse()'; these `mode' selectors - * determine the behaviour of `getopt_parse()', to deliver the - * appropriate result in each case. - */ - getopt_mode_standard = 0, /* getopt() */ - getopt_mode_long, /* getopt_long() */ - getopt_mode_long_only /* getopt_long_only() */ -}; - -enum -{ /* When attempting to match a command line argument to a long form option, - * these indicate the status of the match. - */ - getopt_no_match = 0, /* no successful match */ - getopt_abbreviated_match, /* argument is an abbreviation for an option */ - getopt_exact_match /* argument matches the full option name */ -}; - -int optopt = getopt_unknown; /* return value for option being evaluated */ - -static __inline__ -int getopt_missing_arg( const CHAR *optstring ) -{ - /* Helper function to determine the appropriate return value, - * for the case where a required option argument is missing. - */ - if( (*optstring == getopt_pluschar) || (*optstring == getopt_switchar) ) - ++optstring; - return (*optstring == getopt_takes_argument) - ? getopt_takes_argument - : getopt_unknown; -} - -/* `complain' macro facilitates the generation of simple built-in - * error messages, displayed on various fault conditions, provided - * `opterr' is non-zero. - */ -#define complain( MSG, ARG ) if( opterr ) \ - fprintf( stderr, "%s: "MSG"\n", PROGNAME, ARG ) - -static __inline__ -int getopt_argerror( int mode, char *fmt, CHAR *prog, struct option *opt, int retval ) -{ - /* Helper function, to generate more complex built-in error - * messages, for invalid arguments to long form options ... - */ - if( opterr ) - { - /* ... but, displayed only if `opterr' is non-zero. - */ - char flag[] = "--"; - if( mode != getopt_mode_long ) - /* - * only display one hyphen, for implicit long form options, - * improperly resolved by `getopt_long_only()'. - */ - flag[1] = 0; - /* - * always preface the program name ... - */ - fprintf( stderr, "%s: ", prog ); - /* - * to the appropriate, option specific message. - */ - fprintf( stderr, fmt, flag, opt->name ); - } - /* Whether displaying the message, or not, always set `optopt' - * to identify the faulty option ... - */ - optopt = opt->val; - /* - * and return the `invalid option' indicator. - */ - return retval; -} - -/* `getopt_conventions' establish behavioural options, to control - * the operation of `getopt_parse()', e.g. to select between POSIX - * and GNU style argument parsing behaviour. - */ -#define getopt_set_conventions 0x1000 -#define getopt_posixly_correct 0x0010 - -static __inline__ -int getopt_conventions( int flags ) -{ - static int conventions = 0; - - if( (conventions == 0) && ((flags & getopt_set_conventions) == 0) ) - { - /* default conventions have not yet been established; - * initialise them now! - */ - conventions = getopt_set_conventions; - if( (flags == getopt_pluschar) || (getenv( "POSIXLY_CORRECT" ) != NULL) ) - conventions |= getopt_posixly_correct; - } - - else if( flags & getopt_set_conventions ) - /* - * default conventions may have already been established, - * but this is a specific request to augment them. - */ - conventions |= flags; - - /* in any event, return the currently established conventions. - */ - return conventions; -} - -static __inline__ -int is_switchar( CHAR flag ) -{ - /* A simple helper function, used to identify the switch character - * introducing an optional command line argument. - */ - return flag == getopt_switchar; -} - -static __inline__ -const CHAR *getopt_match( CHAR lookup, const CHAR *opt_string ) -{ - /* Helper function, used to identify short form options. - */ - if( (*opt_string == getopt_pluschar) || (*opt_string == getopt_switchar) ) - ++opt_string; - if( *opt_string == getopt_takes_argument ) - ++opt_string; - do if( lookup == *opt_string ) return opt_string; - while( *++opt_string ); - return NULL; -} - -static __inline__ -int getopt_match_long( const CHAR *nextchar, const CHAR *optname ) -{ - /* Helper function, used to identify potential matches for - * long form options. - */ - CHAR matchchar; - while( (matchchar = *nextchar++) && (matchchar == *optname) ) - /* - * skip over initial substring which DOES match. - */ - ++optname; - - if( matchchar ) - { - /* did NOT match the entire argument to an initial substring - * of a defined option name ... - */ - if( matchchar != getopt_arg_assign ) - /* - * ... and didn't stop at an `=' internal field separator, - * so this is NOT a possible match. - */ - return getopt_no_match; - - /* DID stop at an `=' internal field separator, - * so this IS a possible match, and what follows is an - * argument to the possibly matched option. - */ - optarg = (char *)(nextchar); - } - return *optname - /* - * if we DIDN'T match the ENTIRE text of the option name, - * then it's a possible abbreviated match ... - */ - ? getopt_abbreviated_match - /* - * but if we DID match the entire option name, - * then it's a DEFINITE EXACT match. - */ - : getopt_exact_match; -} - -static __inline__ -int getopt_resolved( int mode, int argc, CHAR *const *argv, int *argind, -struct option *opt, int index, int *retindex, const CHAR *optstring ) -{ - /* Helper function to establish appropriate return conditions, - * on resolution of a long form option. - */ - if( retindex != NULL ) - *retindex = index; - - /* On return, `optind' should normally refer to the argument, if any, - * which follows the current one; it is convenient to set this, before - * checking for the presence of any `optarg'. - */ - optind = *argind + 1; - - if( optarg && (opt[index].has_arg == no_argument) ) - /* - * it is an error for the user to specify an option specific argument - * with an option which doesn't expect one! - */ - return getopt_argerror( mode, "option `%s%s' doesn't accept an argument\n", - PROGNAME, opt + index, getopt_unknown ); - - else if( (optarg == NULL) && (opt[index].has_arg == required_argument) ) - { - /* similarly, it is an error if no argument is specified - * with an option which requires one ... - */ - if( optind < argc ) - /* - * ... except that the requirement may be satisfied from - * the following command line argument, if any ... - */ - optarg = argv[*argind = optind++]; - - else - /* so fail this case, only if no such argument exists! - */ - return getopt_argerror( mode, "option `%s%s' requires an argument\n", - PROGNAME, opt + index, getopt_missing_arg( optstring ) ); - } - - /* when the caller has provided a return buffer ... - */ - if( opt[index].flag != NULL ) - { - /* ... then we place the proper return value there, - * and return a status code of zero ... - */ - *(opt[index].flag) = opt[index].val; - return 0; - } - /* ... otherwise, the return value becomes the status code. - */ - return opt[index].val; -} - -static -#define getopt_std_args int argc, CHAR *const argv[], const CHAR *optstring -int getopt_parse( int mode, getopt_std_args, ... ) -{ - /* Common core implementation for ALL `getopt' functions. - */ - static int argind = 0; - static int optbase = 0; - static const CHAR *nextchar = NULL; - static int optmark = 0; - - if( optind < optbase ) - { - /* POSIX does not prescribe any definitive mechanism for restarting - * a `getopt' scan, but some applications may require such capability. - * We will support it, by allowing the caller to adjust the value of - * `optind' downwards, (nominally setting it to zero). Since POSIX - * wants `optind' to have an initial value of one, but we want all - * of our internal placeholders to be initialised to zero, when we - * are called for the first time, we will handle such a reset by - * adjusting all of the internal placeholders to one less than the - * adjusted `optind' value, (but never to less than zero). - */ - optmark = optbase = argind = (optind > 0) ? optind - 1 : 0; - nextchar = NULL; - } - - if( nextchar && *nextchar ) - { - /* we are parsing a standard, or short format, option argument ... - */ - const CHAR *optchar; - if( (optchar = getopt_match( optopt = *nextchar++, optstring )) != NULL ) - { - /* we have identified it as valid ... - */ - if( optchar[1] == getopt_takes_argument ) - { - /* and determined that it requires an associated argument ... - */ - if( ! *(optarg = (char *)(nextchar)) ) - { - /* the argument is NOT attached ... - */ - if( optchar[2] == getopt_takes_argument ) - /* - * but this GNU extension marks it as optional, - * so we don't provide one on this occasion. - */ - optarg = NULL; - - /* otherwise this option takes a mandatory argument, - * so, provided there is one available ... - */ - else if( (argc - argind) > 1 ) - /* - * we take the following command line argument, - * as the appropriate option argument. - */ - optarg = argv[++argind]; - - /* but if no further argument is available, - * then there is nothing we can do, except for - * issuing the requisite diagnostic message. - */ - else - { - complain( "option requires an argument -- %c", optopt ); - return getopt_missing_arg( optstring ); - } - } - optind = argind + 1; - nextchar = NULL; - } - else - optarg = NULL; - optind = (nextchar && *nextchar) ? argind : argind + 1; - return optopt; - } - /* if we didn't find a valid match for the specified option character, - * then we fall through to here, so take appropriate diagnostic action. - */ - if( mode == getopt_mode_long_only ) - { - complain( "unrecognised option `-%s'", --nextchar ); - nextchar = NULL; - optopt = 0; - } - else - complain( "invalid option -- %c", optopt ); - optind = (nextchar && *nextchar) ? argind : argind + 1; - return getopt_unknown; - } - - if( optmark > optbase ) - { - /* This can happen, in GNU parsing mode ONLY, when we have - * skipped over non-option arguments, and found a subsequent - * option argument; in this case we permute the arguments. - */ - int index; - /* - * `optspan' specifies the number of contiguous arguments - * which are spanned by the current option, and so must be - * moved together during permutation. - */ - int optspan = argind - optmark + 1; - /* - * we use `this_arg' to store these temporarily. - */ - CHAR *this_arg[optspan]; - /* - * we cannot manipulate `argv' directly, since the `getopt' - * API prototypes it as `read-only'; this cast to `arglist' - * allows us to work around that restriction. - */ - CHAR **arglist = (char **)(argv); - - /* save temporary copies of the arguments which are associated - * with the current option ... - */ - for( index = 0; index < optspan; ++index ) - this_arg[index] = arglist[optmark + index]; - - /* move all preceding non-option arguments to the right, - * overwriting these saved arguments, while making space - * to replace them in their permuted location. - */ - for( --optmark; optmark >= optbase; --optmark ) - arglist[optmark + optspan] = arglist[optmark]; - - /* restore the temporarily saved option arguments to - * their permuted location. - */ - for( index = 0; index < optspan; ++index ) - arglist[optbase + index] = this_arg[index]; - - /* adjust `optbase', to account for the relocated option. - */ - optbase += optspan; - } - - else - /* no permutation occurred ... - * simply adjust `optbase' for all options parsed so far. - */ - optbase = argind + 1; - - /* enter main parsing loop ... - */ - while( argc > ++argind ) - { - /* inspect each argument in turn, identifying possible options ... - */ - if( is_switchar( *(nextchar = argv[optmark = argind]) ) && *++nextchar ) - { - /* we've found a candidate option argument ... */ - - if( is_switchar( *nextchar ) ) - { - /* it's a double hyphen argument ... */ - - const CHAR *refchar = nextchar; - if( *++refchar ) - { - /* and it looks like a long format option ... - * `getopt_long' mode must be active to accept it as such, - * `getopt_long_only' also qualifies, but we must downgrade - * it to force explicit handling as a long format option. - */ - if( mode >= getopt_mode_long ) - { - nextchar = refchar; - mode = getopt_mode_long; - } - } - else - { - /* this is an explicit `--' end of options marker, so wrap up now! - */ - if( optmark > optbase ) - { - /* permuting the argument list as necessary ... - * (note use of `this_arg' and `arglist', as above). - */ - CHAR *this_arg = argv[optmark]; - CHAR **arglist = (CHAR **)(argv); - - /* move all preceding non-option arguments to the right ... - */ - do arglist[optmark] = arglist[optmark - 1]; - while( optmark-- > optbase ); - - /* reinstate the `--' marker, in its permuted location. - */ - arglist[optbase] = this_arg; - } - /* ... before finally bumping `optbase' past the `--' marker, - * and returning the `all done' completion indicator. - */ - optind = ++optbase; - return getopt_all_done; - } - } - else if( mode < getopt_mode_long_only ) - { - /* it's not an explicit long option, and `getopt_long_only' isn't active, - * so we must explicitly try to match it as a short option. - */ - mode = getopt_mode_standard; - } - - if( mode >= getopt_mode_long ) - { - /* the current argument is a long form option, (either explicitly, - * introduced by a double hyphen, or implicitly because we were called - * by `getopt_long_only'); this is where we parse it. - */ - int lookup; - int matched = -1; - - /* we need to fetch the `extra' function arguments, which are - * specified for the `getopt_long' APIs. - */ - va_list refptr; - va_start( refptr, optstring ); - struct option *longopts = va_arg( refptr, struct option * ); - int *optindex = va_arg( refptr, int * ); - va_end( refptr ); - - /* ensuring that `optarg' does not inherit any junk, from parsing - * preceding arguments ... - */ - optarg = NULL; - for( lookup = 0; longopts && longopts[lookup].name; ++lookup ) - { - /* scan the list of defined long form options ... - */ - switch( getopt_match_long( nextchar, longopts[lookup].name ) ) - { - /* looking for possible matches for the current argument. - */ - case getopt_exact_match: - /* - * when an exact match is found, - * return it immediately, setting `nextchar' to NULL, - * to ensure we don't mistakenly try to match any - * subsequent characters as short form options. - */ - nextchar = NULL; - return getopt_resolved( mode, argc, argv, &argind, - longopts, lookup, optindex, optstring ); - - case getopt_abbreviated_match: - /* - * but, for a partial (initial substring) match ... - */ - if( matched >= 0 ) - { - /* if this is not the first, then we have an ambiguity ... - */ - optopt = 0; - nextchar = NULL; - optind = argind + 1; - complain( "option `%s' is ambiguous", argv[argind] ); - return getopt_unknown; - } - /* otherwise just note that we've found a possible match ... - */ - matched = lookup; - } - } - if( matched >= 0 ) - { - /* if we get to here, then we found exactly one partial match, - * so return it, as for an exact match. - */ - nextchar = NULL; - return getopt_resolved( mode, argc, argv, &argind, - longopts, matched, optindex, optstring ); - } - if( mode < getopt_mode_long_only ) - { - /* if here, then we had what SHOULD have been a long form option, - * but it is unmatched; (perversely, `mode == getopt_mode_long_only' - * allows us to still try to match it as a short form option). - */ - optopt = 0; - nextchar = NULL; - optind = argind + 1; - complain( "unrecognised option `%s'", argv[argind] ); - return getopt_unknown; - } - } - /* fall through to handle standard short form options... - * when the option argument format is neither explictly identified - * as long, nor implicitly matched as such, and the argument isn't - * just a bare hyphen, (which isn't an option), then we make one - * recursive call to explicitly interpret it as short format. - */ - if( *nextchar ) - return getopt_parse( mode, argc, argv, optstring ); - } - /* if we get to here, then we've parsed a non-option argument ... - * in GNU compatibility mode, we step over it, so we can permute - * any subsequent option arguments, but ... - */ - if( *optstring == getopt_switchar ) - { - /* if `optstring' begins with a `-' character, this special - * GNU specific behaviour requires us to return the non-option - * arguments in strict order, as pseudo-arguments to a special - * option, with return value defined as `getopt_ordered'. - */ - nextchar = NULL; - optind = argind + 1; - optarg = argv[argind]; - return getopt_ordered; - } - if( getopt_conventions( *optstring ) & getopt_posixly_correct ) - /* - * otherwise ... - * for POSIXLY_CORRECT behaviour, or if `optstring' begins with - * a `+' character, then we break out of the parsing loop, so that - * the scan ends at the current argument, with no permutation. - */ - break; - } - /* fall through when all arguments have been evaluated, - */ - optind = optbase; - return getopt_all_done; -} - -/* All three public API entry points are trivially defined, - * in terms of the internal `getopt_parse' function. - */ -int getopt( getopt_std_args ) -{ - return getopt_parse( getopt_mode_standard, argc, argv, optstring ); -} - -int getopt_long( getopt_std_args, const struct option *opts, int *index ) -{ - return getopt_parse( getopt_mode_long, argc, argv, optstring, opts, index ); -} - -int getopt_long_only( getopt_std_args, const struct option *opts, int *index ) -{ - return getopt_parse( getopt_mode_long_only, argc, argv, optstring, opts, index ); -} - -#ifdef __weak_alias -/* - * These Microsnot style uglified aliases are provided for compatibility - * with the previous MinGW implementation of the getopt API. - */ -__weak_alias( getopt, _getopt ) -__weak_alias( getopt_long, _getopt_long ) -__weak_alias( getopt_long_only, _getopt_long_only ) -#endif - -/* $RCSfile$Revision$: end of file */ diff --git a/winsup/mingw/mingwex/gettimeofday.c b/winsup/mingw/mingwex/gettimeofday.c deleted file mode 100755 index 194cf0499..000000000 --- a/winsup/mingw/mingwex/gettimeofday.c +++ /dev/null @@ -1,49 +0,0 @@ -/* - * gettimeofday - * Implementation according to: - * The Open Group Base Specifications Issue 6 - * IEEE Std 1003.1, 2004 Edition - */ - -/* - * THIS SOFTWARE IS NOT COPYRIGHTED - * - * This source code is offered for use in the public domain. You may - * use, modify or distribute it freely. - * - * This code is distributed in the hope that it will be useful but - * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY - * DISCLAIMED. This includes but is not limited to warranties of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * Contributed by: - * Danny Smith <dannysmith@users.sourceforge.net> - */ - -#include <sys/time.h> -#define WIN32_LEAN_AND_MEAN -#include <windows.h> - -/* Offset between 1/1/1601 and 1/1/1970 in 100 nanosec units */ -#define _W32_FT_OFFSET (116444736000000000ULL) - - -int __cdecl gettimeofday(struct timeval *__restrict__ tp, - void *__restrict__ tzp __attribute__((unused))) - { - union { - unsigned long long ns100; /*time since 1 Jan 1601 in 100ns units */ - FILETIME ft; - } _now; - - if(tp) - { - GetSystemTimeAsFileTime (&_now.ft); - tp->tv_usec=(long)((_now.ns100 / 10ULL) % 1000000ULL ); - tp->tv_sec= (long)((_now.ns100 - _W32_FT_OFFSET) / 10000000ULL); - } - /* Always return 0 as per Open Group Base Specifications Issue 6. - Do not set errno on error. */ - return 0; -} - diff --git a/winsup/mingw/mingwex/imaxabs.c b/winsup/mingw/mingwex/imaxabs.c deleted file mode 100644 index b643ceab6..000000000 --- a/winsup/mingw/mingwex/imaxabs.c +++ /dev/null @@ -1,17 +0,0 @@ -/* - This source code was extracted from the Q8 package created and - placed in the PUBLIC DOMAIN by Doug Gwyn <gwyn@arl.mil> - last edit: 1999/11/05 gwyn@arl.mil - - Implements subclause 7.8.2 of ISO/IEC 9899:1999 (E). - - This particular implementation requires the matching <inttypes.h>. -*/ - -#include <inttypes.h> - -intmax_t -imaxabs (intmax_t _j) - { return _j >= 0 ? _j : -_j; } - -long long __attribute__ ((alias ("imaxabs"))) llabs (long long); diff --git a/winsup/mingw/mingwex/imaxdiv.c b/winsup/mingw/mingwex/imaxdiv.c deleted file mode 100644 index 6acfcf6cb..000000000 --- a/winsup/mingw/mingwex/imaxdiv.c +++ /dev/null @@ -1,25 +0,0 @@ -/* - This source code was extracted from the Q8 package created and - placed in the PUBLIC DOMAIN by Doug Gwyn <gwyn@arl.mil> - last edit: 1999/11/05 gwyn@arl.mil - - - last edit: 1999/11/05 gwyn@arl.mil - - Implements subclause 7.8.2 of ISO/IEC 9899:1999 (E). - -*/ - -#include <inttypes.h> - -imaxdiv_t -imaxdiv(intmax_t numer, intmax_t denom) -{ - imaxdiv_t result; - result.quot = numer / denom; - result.rem = numer % denom; - return result; -} - -long long __attribute__ ((alias ("imaxdiv"))) -lldiv (long long, long long); diff --git a/winsup/mingw/mingwex/isblank.c b/winsup/mingw/mingwex/isblank.c deleted file mode 100755 index d3ba74d39..000000000 --- a/winsup/mingw/mingwex/isblank.c +++ /dev/null @@ -1,5 +0,0 @@ -#define __NO_CTYPE_LINES -#include <ctype.h> - -int _cdecl isblank (int c) -{return (_isctype(c, _BLANK) || c == '\t');} diff --git a/winsup/mingw/mingwex/iswblank.c b/winsup/mingw/mingwex/iswblank.c deleted file mode 100755 index 316168940..000000000 --- a/winsup/mingw/mingwex/iswblank.c +++ /dev/null @@ -1,5 +0,0 @@ -#define __NO_CTYPE_LINES -#include <wctype.h> - -int __cdecl iswblank (wint_t wc) - {return (iswctype(wc, _BLANK) || wc == L'\t');} diff --git a/winsup/mingw/mingwex/lltoa.c b/winsup/mingw/mingwex/lltoa.c deleted file mode 100644 index 28248a834..000000000 --- a/winsup/mingw/mingwex/lltoa.c +++ /dev/null @@ -1,3 +0,0 @@ -#include <stdlib.h> -char* lltoa(long long _n, char * _c, int _i) - { return _i64toa (_n, _c, _i); } diff --git a/winsup/mingw/mingwex/lltow.c b/winsup/mingw/mingwex/lltow.c deleted file mode 100644 index cdf45b742..000000000 --- a/winsup/mingw/mingwex/lltow.c +++ /dev/null @@ -1,3 +0,0 @@ -#include <stdlib.h> -wchar_t* lltow(long long _n, wchar_t * _w, int _i) - { return _i64tow (_n, _w, _i); } diff --git a/winsup/mingw/mingwex/math/acosf.c b/winsup/mingw/mingwex/math/acosf.c deleted file mode 100644 index 364f6a90c..000000000 --- a/winsup/mingw/mingwex/math/acosf.c +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Written by J.T. Conklin <jtc@netbsd.org>. - * Public domain. - */ - -#include <math.h> - -float -acosf (float x) -{ - float res; - - /* acosl = atanl (sqrtl(1 - x^2) / x) */ - asm ( "fld %%st\n\t" - "fmul %%st(0)\n\t" /* x^2 */ - "fld1\n\t" - "fsubp\n\t" /* 1 - x^2 */ - "fsqrt\n\t" /* sqrtl (1 - x^2) */ - "fxch %%st(1)\n\t" - "fpatan" - : "=t" (res) : "0" (x) : "st(1)"); - return res; -} diff --git a/winsup/mingw/mingwex/math/acosh.c b/winsup/mingw/mingwex/math/acosh.c deleted file mode 100755 index 1497883cf..000000000 --- a/winsup/mingw/mingwex/math/acosh.c +++ /dev/null @@ -1,26 +0,0 @@ -#include <math.h> -#include <errno.h> -#include "fastmath.h" - -/* acosh(x) = log (x + sqrt(x * x - 1)) */ -double acosh (double x) -{ - if (isnan (x)) - return x; - - if (x < 1.0) - { - errno = EDOM; - return nan(""); - } - - if (x > 0x1p32) - /* Avoid overflow (and unnecessary calculation when - sqrt (x * x - 1) == x). GCC optimizes by replacing - the long double M_LN2 const with a fldln2 insn. */ - return __fast_log (x) + 6.9314718055994530941723E-1L; - - /* Since x >= 1, the arg to log will always be greater than - the fyl2xp1 limit (approx 0.29) so just use logl. */ - return __fast_log (x + __fast_sqrt((x + 1.0) * (x - 1.0))); -} diff --git a/winsup/mingw/mingwex/math/acoshf.c b/winsup/mingw/mingwex/math/acoshf.c deleted file mode 100755 index 08f190fcb..000000000 --- a/winsup/mingw/mingwex/math/acoshf.c +++ /dev/null @@ -1,25 +0,0 @@ -#include <math.h> -#include <errno.h> -#include "fastmath.h" - -/* acosh(x) = log (x + sqrt(x * x - 1)) */ -float acoshf (float x) -{ - if (isnan (x)) - return x; - if (x < 1.0f) - { - errno = EDOM; - return nan(""); - } - - if (x > 0x1p32f) - /* Avoid overflow (and unnecessary calculation when - sqrt (x * x - 1) == x). GCC optimizes by replacing - the long double M_LN2 const with a fldln2 insn. */ - return __fast_log (x) + 6.9314718055994530941723E-1L; - - /* Since x >= 1, the arg to log will always be greater than - the fyl2xp1 limit (approx 0.29) so just use logl. */ - return __fast_log (x + __fast_sqrt((x + 1.0) * (x - 1.0))); -} diff --git a/winsup/mingw/mingwex/math/acoshl.c b/winsup/mingw/mingwex/math/acoshl.c deleted file mode 100755 index c461176bb..000000000 --- a/winsup/mingw/mingwex/math/acoshl.c +++ /dev/null @@ -1,27 +0,0 @@ -#include <math.h> -#include <errno.h> -#include "fastmath.h" - -/* acosh(x) = log (x + sqrt(x * x - 1)) */ -long double acoshl (long double x) -{ - if (isnan (x)) - return x; - - if (x < 1.0L) - { - errno = EDOM; - return nanl(""); - } - if (x > 0x1p32L) - /* Avoid overflow (and unnecessary calculation when - sqrt (x * x - 1) == x). - The M_LN2 define doesn't have enough precison for - long double so use this one. GCC optimizes by replacing - the const with a fldln2 insn. */ - return __fast_logl (x) + 6.9314718055994530941723E-1L; - - /* Since x >= 1, the arg to log will always be greater than - the fyl2xp1 limit (approx 0.29) so just use logl. */ - return __fast_logl (x + __fast_sqrtl((x + 1.0L) * (x - 1.0L))); -} diff --git a/winsup/mingw/mingwex/math/acosl.c b/winsup/mingw/mingwex/math/acosl.c deleted file mode 100644 index f98d2cdc1..000000000 --- a/winsup/mingw/mingwex/math/acosl.c +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Written by J.T. Conklin <jtc@netbsd.org>. - * Public domain. - * - * Adapted for `long double' by Ulrich Drepper <drepper@cygnus.com>. - */ - -#include <math.h> - -long double -acosl (long double x) -{ - long double res; - - /* acosl = atanl (sqrtl(1 - x^2) / x) */ - asm ( "fld %%st\n\t" - "fmul %%st(0)\n\t" /* x^2 */ - "fld1\n\t" - "fsubp\n\t" /* 1 - x^2 */ - "fsqrt\n\t" /* sqrtl (1 - x^2) */ - "fxch %%st(1)\n\t" - "fpatan" - : "=t" (res) : "0" (x) : "st(1)"); - return res; -} diff --git a/winsup/mingw/mingwex/math/asinf.c b/winsup/mingw/mingwex/math/asinf.c deleted file mode 100644 index e79429ec8..000000000 --- a/winsup/mingw/mingwex/math/asinf.c +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Written by J.T. Conklin <jtc@netbsd.org>. - * Public domain. - */ - -/* asin = atan (x / sqrt(1 - x^2)) */ - -float asinf (float x) -{ - float res; - - asm ( "fld %%st\n\t" - "fmul %%st(0)\n\t" /* x^2 */ - "fld1\n\t" - "fsubp\n\t" /* 1 - x^2 */ - "fsqrt\n\t" /* sqrt (1 - x^2) */ - "fpatan" - : "=t" (res) : "0" (x) : "st(1)"); - return res; -} diff --git a/winsup/mingw/mingwex/math/asinh.c b/winsup/mingw/mingwex/math/asinh.c deleted file mode 100755 index 30404497d..000000000 --- a/winsup/mingw/mingwex/math/asinh.c +++ /dev/null @@ -1,28 +0,0 @@ -#include <math.h> -#include <errno.h> -#include "fastmath.h" - - /* asinh(x) = copysign(log(fabs(x) + sqrt(x * x + 1.0)), x) */ -double asinh(double x) -{ - double z; - if (!isfinite (x)) - return x; - z = fabs (x); - - /* Avoid setting FPU underflow exception flag in x * x. */ -#if 0 - if ( z < 0x1p-32) - return x; -#endif - - /* Use log1p to avoid cancellation with small x. Put - x * x in denom, so overflow is harmless. - asinh(x) = log1p (x + sqrt (x * x + 1.0) - 1.0) - = log1p (x + x * x / (sqrt (x * x + 1.0) + 1.0)) */ - - z = __fast_log1p (z + z * z / (__fast_sqrt (z * z + 1.0) + 1.0)); - - return ( x > 0.0 ? z : -z); -} - diff --git a/winsup/mingw/mingwex/math/asinhf.c b/winsup/mingw/mingwex/math/asinhf.c deleted file mode 100755 index 080a9278d..000000000 --- a/winsup/mingw/mingwex/math/asinhf.c +++ /dev/null @@ -1,28 +0,0 @@ -#include <math.h> -#include <errno.h> -#include "fastmath.h" - - /* asinh(x) = copysign(log(fabs(x) + sqrt(x * x + 1.0)), x) */ -float asinhf(float x) -{ - float z; - if (!isfinite (x)) - return x; - z = fabsf (x); - - /* Avoid setting FPU underflow exception flag in x * x. */ -#if 0 - if ( z < 0x1p-32) - return x; -#endif - - - /* Use log1p to avoid cancellation with small x. Put - x * x in denom, so overflow is harmless. - asinh(x) = log1p (x + sqrt (x * x + 1.0) - 1.0) - = log1p (x + x * x / (sqrt (x * x + 1.0) + 1.0)) */ - - z = __fast_log1p (z + z * z / (__fast_sqrt (z * z + 1.0) + 1.0)); - - return ( x > 0.0 ? z : -z); -} diff --git a/winsup/mingw/mingwex/math/asinhl.c b/winsup/mingw/mingwex/math/asinhl.c deleted file mode 100755 index 8f027e83d..000000000 --- a/winsup/mingw/mingwex/math/asinhl.c +++ /dev/null @@ -1,28 +0,0 @@ -#include <math.h> -#include <errno.h> -#include "fastmath.h" - - /* asinh(x) = copysign(log(fabs(x) + sqrt(x * x + 1.0)), x) */ -long double asinhl(long double x) -{ - long double z; - if (!isfinite (x)) - return x; - - z = fabsl (x); - - /* Avoid setting FPU underflow exception flag in x * x. */ -#if 0 - if ( z < 0x1p-32) - return x; -#endif - - /* Use log1p to avoid cancellation with small x. Put - x * x in denom, so overflow is harmless. - asinh(x) = log1p (x + sqrt (x * x + 1.0) - 1.0) - = log1p (x + x * x / (sqrt (x * x + 1.0) + 1.0)) */ - - z = __fast_log1pl (z + z * z / (__fast_sqrtl (z * z + 1.0L) + 1.0L)); - - return ( x > 0.0 ? z : -z); -} diff --git a/winsup/mingw/mingwex/math/asinl.c b/winsup/mingw/mingwex/math/asinl.c deleted file mode 100644 index a2ac32b39..000000000 --- a/winsup/mingw/mingwex/math/asinl.c +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Written by J.T. Conklin <jtc@netbsd.org>. - * Public domain. - * Adapted for long double type by Danny Smith <dannysmith@users.sourceforge.net>. - */ - -/* asin = atan (x / sqrt(1 - x^2)) */ - -long double asinl (long double x) -{ - long double res; - - asm ( "fld %%st\n\t" - "fmul %%st(0)\n\t" /* x^2 */ - "fld1\n\t" - "fsubp\n\t" /* 1 - x^2 */ - "fsqrt\n\t" /* sqrt (1 - x^2) */ - "fpatan" - : "=t" (res) : "0" (x) : "st(1)"); - return res; -} diff --git a/winsup/mingw/mingwex/math/atan2f.c b/winsup/mingw/mingwex/math/atan2f.c deleted file mode 100644 index 52ec6f672..000000000 --- a/winsup/mingw/mingwex/math/atan2f.c +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Written by J.T. Conklin <jtc@netbsd.org>. - * Public domain. - * - */ - -#include <math.h> - -float -atan2f (float y, float x) -{ - float res; - asm ("fpatan" : "=t" (res) : "u" (y), "0" (x) : "st(1)"); - return res; -} diff --git a/winsup/mingw/mingwex/math/atan2l.c b/winsup/mingw/mingwex/math/atan2l.c deleted file mode 100644 index efd62c1ec..000000000 --- a/winsup/mingw/mingwex/math/atan2l.c +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Written by J.T. Conklin <jtc@netbsd.org>. - * Public domain. - * - * Adapted for `long double' by Ulrich Drepper <drepper@cygnus.com>. - */ - -#include <math.h> - -long double -atan2l (long double y, long double x) -{ - long double res; - asm ("fpatan" : "=t" (res) : "u" (y), "0" (x) : "st(1)"); - return res; -} diff --git a/winsup/mingw/mingwex/math/atanf.c b/winsup/mingw/mingwex/math/atanf.c deleted file mode 100644 index ae70d5daa..000000000 --- a/winsup/mingw/mingwex/math/atanf.c +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Written by J.T. Conklin <jtc@netbsd.org>. - * Public domain. - * - */ - -#include <math.h> - -float -atanf (float x) -{ - float res; - - asm ("fld1\n\t" - "fpatan" : "=t" (res) : "0" (x)); - return res; -} diff --git a/winsup/mingw/mingwex/math/atanh.c b/winsup/mingw/mingwex/math/atanh.c deleted file mode 100755 index b5d9ce100..000000000 --- a/winsup/mingw/mingwex/math/atanh.c +++ /dev/null @@ -1,31 +0,0 @@ -#include <math.h> -#include <errno.h> -#include "fastmath.h" - -/* atanh (x) = 0.5 * log ((1.0 + x)/(1.0 - x)) */ - -double atanh(double x) -{ - double z; - if isnan (x) - return x; - z = fabs (x); - if (z == 1.0) - { - errno = ERANGE; - return (x > 0 ? INFINITY : -INFINITY); - } - if (z > 1.0) - { - errno = EDOM; - return nan(""); - } - /* Rearrange formula to avoid precision loss for small x. - - atanh(x) = 0.5 * log ((1.0 + x)/(1.0 - x)) - = 0.5 * log1p ((1.0 + x)/(1.0 - x) - 1.0) - = 0.5 * log1p ((1.0 + x - 1.0 + x) /(1.0 - x)) - = 0.5 * log1p ((2.0 * x ) / (1.0 - x)) */ - z = 0.5 * __fast_log1p ((z + z) / (1.0 - z)); - return x >= 0 ? z : -z; -} diff --git a/winsup/mingw/mingwex/math/atanhf.c b/winsup/mingw/mingwex/math/atanhf.c deleted file mode 100755 index b7c30823e..000000000 --- a/winsup/mingw/mingwex/math/atanhf.c +++ /dev/null @@ -1,30 +0,0 @@ -#include <math.h> -#include <errno.h> -#include "fastmath.h" - -/* atanh (x) = 0.5 * log ((1.0 + x)/(1.0 - x)) */ -float atanhf (float x) -{ - float z; - if isnan (x) - return x; - z = fabsf (x); - if (z == 1.0) - { - errno = ERANGE; - return (x > 0 ? INFINITY : -INFINITY); - } - if ( z > 1.0) - { - errno = EDOM; - return nanf(""); - } - /* Rearrange formula to avoid precision loss for small x. - - atanh(x) = 0.5 * log ((1.0 + x)/(1.0 - x)) - = 0.5 * log1p ((1.0 + x)/(1.0 - x) - 1.0) - = 0.5 * log1p ((1.0 + x - 1.0 + x) /(1.0 - x)) - = 0.5 * log1p ((2.0 * x ) / (1.0 - x)) */ - z = 0.5 * __fast_log1p ((z + z) / (1.0 - z)); - return x >= 0 ? z : -z; -} diff --git a/winsup/mingw/mingwex/math/atanhl.c b/winsup/mingw/mingwex/math/atanhl.c deleted file mode 100755 index 2d5fec02a..000000000 --- a/winsup/mingw/mingwex/math/atanhl.c +++ /dev/null @@ -1,29 +0,0 @@ -#include <math.h> -#include <errno.h> -#include "fastmath.h" - -/* atanh (x) = 0.5 * log ((1.0 + x)/(1.0 - x)) */ -long double atanhl (long double x) -{ - long double z; - if isnan (x) - return x; - z = fabsl (x); - if (z == 1.0L) - { - errno = ERANGE; - return (x > 0 ? INFINITY : -INFINITY); - } - if ( z > 1.0L) - { - errno = EDOM; - return nanl(""); - } - /* Rearrange formula to avoid precision loss for small x. - atanh(x) = 0.5 * log ((1.0 + x)/(1.0 - x)) - = 0.5 * log1p ((1.0 + x)/(1.0 - x) - 1.0) - = 0.5 * log1p ((1.0 + x - 1.0 + x) /(1.0 - x)) - = 0.5 * log1p ((2.0 * x ) / (1.0 - x)) */ - z = 0.5L * __fast_log1pl ((z + z) / (1.0L - z)); - return x >= 0 ? z : -z; -} diff --git a/winsup/mingw/mingwex/math/atanl.c b/winsup/mingw/mingwex/math/atanl.c deleted file mode 100644 index 5de06d35b..000000000 --- a/winsup/mingw/mingwex/math/atanl.c +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Written by J.T. Conklin <jtc@netbsd.org>. - * Public domain. - * - * Adapted for `long double' by Ulrich Drepper <drepper@cygnus.com>. - */ - -#include <math.h> - -long double -atanl (long double x) -{ - long double res; - - asm ("fld1\n\t" - "fpatan" - : "=t" (res) : "0" (x)); - return res; -} diff --git a/winsup/mingw/mingwex/math/cbrt.c b/winsup/mingw/mingwex/math/cbrt.c deleted file mode 100644 index 93f5c819c..000000000 --- a/winsup/mingw/mingwex/math/cbrt.c +++ /dev/null @@ -1,162 +0,0 @@ -/* cbrt.c - * - * Cube root - * - * - * - * SYNOPSIS: - * - * double x, y, cbrt(); - * - * y = cbrt( x ); - * - * - * - * DESCRIPTION: - * - * Returns the cube root of the argument, which may be negative. - * - * Range reduction involves determining the power of 2 of - * the argument. A polynomial of degree 2 applied to the - * mantissa, and multiplication by the cube root of 1, 2, or 4 - * approximates the root to within about 0.1%. Then Newton's - * iteration is used three times to converge to an accurate - * result. - * - * - * - * ACCURACY: - * - * Relative error: - * arithmetic domain # trials peak rms - * DEC -10,10 200000 1.8e-17 6.2e-18 - * IEEE 0,1e308 30000 1.5e-16 5.0e-17 - * - */ -/* cbrt.c */ - -/* -Cephes Math Library Release 2.2: January, 1991 -Copyright 1984, 1991 by Stephen L. Moshier -Direct inquiries to 30 Frost Street, Cambridge, MA 02140 -*/ - -/* - Modified for mingwex.a - 2002-07-01 Danny Smith <dannysmith@users.sourceforge.net> - */ -#ifdef __MINGW32__ -#include <math.h> -#include "cephes_mconf.h" -#else -#include "mconf.h" -#endif - - -static const double CBRT2 = 1.2599210498948731647672; -static const double CBRT4 = 1.5874010519681994747517; -static const double CBRT2I = 0.79370052598409973737585; -static const double CBRT4I = 0.62996052494743658238361; - -#ifndef __MINGW32__ -#ifdef ANSIPROT -extern double frexp ( double, int * ); -extern double ldexp ( double, int ); -extern int isnan ( double ); -extern int isfinite ( double ); -#else -double frexp(), ldexp(); -int isnan(), isfinite(); -#endif -#endif - -double cbrt(x) -double x; -{ -int e, rem, sign; -double z; - -#ifdef __MINGW32__ -if (!isfinite (x) || x == 0 ) - return x; -#else - -#ifdef NANS -if( isnan(x) ) - return x; -#endif -#ifdef INFINITIES -if( !isfinite(x) ) - return x; -#endif -if( x == 0 ) - return( x ); - -#endif /* __MINGW32__ */ - -if( x > 0 ) - sign = 1; -else - { - sign = -1; - x = -x; - } - -z = x; -/* extract power of 2, leaving - * mantissa between 0.5 and 1 - */ -x = frexp( x, &e ); - -/* Approximate cube root of number between .5 and 1, - * peak relative error = 9.2e-6 - */ -x = (((-1.3466110473359520655053e-1 * x - + 5.4664601366395524503440e-1) * x - - 9.5438224771509446525043e-1) * x - + 1.1399983354717293273738e0 ) * x - + 4.0238979564544752126924e-1; - -/* exponent divided by 3 */ -if( e >= 0 ) - { - rem = e; - e /= 3; - rem -= 3*e; - if( rem == 1 ) - x *= CBRT2; - else if( rem == 2 ) - x *= CBRT4; - } - - -/* argument less than 1 */ - -else - { - e = -e; - rem = e; - e /= 3; - rem -= 3*e; - if( rem == 1 ) - x *= CBRT2I; - else if( rem == 2 ) - x *= CBRT4I; - e = -e; - } - -/* multiply by power of 2 */ -x = ldexp( x, e ); - -/* Newton iteration */ -x -= ( x - (z/(x*x)) )*0.33333333333333333333; -#ifdef DEC -x -= ( x - (z/(x*x)) )/3.0; -#else -x -= ( x - (z/(x*x)) )*0.33333333333333333333; -#endif - -if( sign < 0 ) - x = -x; -return(x); -} diff --git a/winsup/mingw/mingwex/math/cbrtf.c b/winsup/mingw/mingwex/math/cbrtf.c deleted file mode 100644 index 537cf8d98..000000000 --- a/winsup/mingw/mingwex/math/cbrtf.c +++ /dev/null @@ -1,147 +0,0 @@ -/* cbrtf.c - * - * Cube root - * - * - * - * SYNOPSIS: - * - * float x, y, cbrtf(); - * - * y = cbrtf( x ); - * - * - * - * DESCRIPTION: - * - * Returns the cube root of the argument, which may be negative. - * - * Range reduction involves determining the power of 2 of - * the argument. A polynomial of degree 2 applied to the - * mantissa, and multiplication by the cube root of 1, 2, or 4 - * approximates the root to within about 0.1%. Then Newton's - * iteration is used to converge to an accurate result. - * - * - * - * ACCURACY: - * - * Relative error: - * arithmetic domain # trials peak rms - * IEEE 0,1e38 100000 7.6e-8 2.7e-8 - * - */ -/* cbrt.c */ - -/* -Cephes Math Library Release 2.2: June, 1992 -Copyright 1984, 1987, 1988, 1992 by Stephen L. Moshier -Direct inquiries to 30 Frost Street, Cambridge, MA 02140 -*/ - -/* - Modified for mingwex.a - 2002-07-01 Danny Smith <dannysmith@users.sourceforge.net> - */ -#ifdef __MINGW32__ -#include <math.h> -#include "cephes_mconf.h" -#else -#include "mconf.h" -#endif - -static const float CBRT2 = 1.25992104989487316477; -static const float CBRT4 = 1.58740105196819947475; - -#ifndef __MINGW32__ -#ifdef ANSIC -float frexpf(float, int *), ldexpf(float, int); - -float cbrtf( float xx ) -#else -float frexpf(), ldexpf(); - -float cbrtf(xx) -double xx; -#endif -{ -int e, rem, sign; -float x, z; - -x = xx; - -#else /* __MINGW32__ */ -float cbrtf (float x) -{ -int e, rem, sign; -float z; -#endif /* __MINGW32__ */ - -#ifdef __MINGW32__ -if (!isfinite (x) || x == 0.0F ) - return x; -#else -if( x == 0 ) - return( 0.0 ); -#endif -if( x > 0 ) - sign = 1; -else - { - sign = -1; - x = -x; - } - -z = x; -/* extract power of 2, leaving - * mantissa between 0.5 and 1 - */ -x = frexpf( x, &e ); - -/* Approximate cube root of number between .5 and 1, - * peak relative error = 9.2e-6 - */ -x = (((-0.13466110473359520655053 * x - + 0.54664601366395524503440 ) * x - - 0.95438224771509446525043 ) * x - + 1.1399983354717293273738 ) * x - + 0.40238979564544752126924; - -/* exponent divided by 3 */ -if( e >= 0 ) - { - rem = e; - e /= 3; - rem -= 3*e; - if( rem == 1 ) - x *= CBRT2; - else if( rem == 2 ) - x *= CBRT4; - } - - -/* argument less than 1 */ - -else - { - e = -e; - rem = e; - e /= 3; - rem -= 3*e; - if( rem == 1 ) - x /= CBRT2; - else if( rem == 2 ) - x /= CBRT4; - e = -e; - } - -/* multiply by power of 2 */ -x = ldexpf( x, e ); - -/* Newton iteration */ -x -= ( x - (z/(x*x)) ) * 0.333333333333; - -if( sign < 0 ) - x = -x; -return(x); -} diff --git a/winsup/mingw/mingwex/math/cbrtl.c b/winsup/mingw/mingwex/math/cbrtl.c deleted file mode 100644 index 36bd48f70..000000000 --- a/winsup/mingw/mingwex/math/cbrtl.c +++ /dev/null @@ -1,161 +0,0 @@ -/* cbrtl.c - * - * Cube root, long double precision - * - * - * - * SYNOPSIS: - * - * long double x, y, cbrtl(); - * - * y = cbrtl( x ); - * - * - * - * DESCRIPTION: - * - * Returns the cube root of the argument, which may be negative. - * - * Range reduction involves determining the power of 2 of - * the argument. A polynomial of degree 2 applied to the - * mantissa, and multiplication by the cube root of 1, 2, or 4 - * approximates the root to within about 0.1%. Then Newton's - * iteration is used three times to converge to an accurate - * result. - * - * - * - * ACCURACY: - * - * Relative error: - * arithmetic domain # trials peak rms - * IEEE .125,8 80000 7.0e-20 2.2e-20 - * IEEE exp(+-707) 100000 7.0e-20 2.4e-20 - * - */ - - -/* -Cephes Math Library Release 2.2: January, 1991 -Copyright 1984, 1991 by Stephen L. Moshier -Direct inquiries to 30 Frost Street, Cambridge, MA 02140 -*/ - -/* - Modified for mingwex.a - 2002-07-01 Danny Smith <dannysmith@users.sourceforge.net> - */ -#ifdef __MINGW32__ -#include "cephes_mconf.h" -#else -#include "mconf.h" -#endif - -static const long double CBRT2 = 1.2599210498948731647672L; -static const long double CBRT4 = 1.5874010519681994747517L; -static const long double CBRT2I = 0.79370052598409973737585L; -static const long double CBRT4I = 0.62996052494743658238361L; - -#ifndef __MINGW32__ - -#ifdef ANSIPROT -extern long double frexpl ( long double, int * ); -extern long double ldexpl ( long double, int ); -extern int isnanl ( long double ); -#else -long double frexpl(), ldexpl(); -extern int isnanl(); -#endif - -#ifdef INFINITIES -extern long double INFINITYL; -#endif - -#endif /* __MINGW32__ */ - -long double cbrtl(x) -long double x; -{ -int e, rem, sign; -long double z; - -#ifdef __MINGW32__ -if (!isfinite (x) || x == 0.0L) - return(x); -#else - -#ifdef NANS -if(isnanl(x)) - return(x); -#endif -#ifdef INFINITIES -if( x == INFINITYL) - return(x); -if( x == -INFINITYL) - return(x); -#endif -if( x == 0 ) - return( x ); - -#endif /* __MINGW32__ */ - -if( x > 0 ) - sign = 1; -else - { - sign = -1; - x = -x; - } - -z = x; -/* extract power of 2, leaving - * mantissa between 0.5 and 1 - */ -x = frexpl( x, &e ); - -/* Approximate cube root of number between .5 and 1, - * peak relative error = 1.2e-6 - */ -x = (((( 1.3584464340920900529734e-1L * x - - 6.3986917220457538402318e-1L) * x - + 1.2875551670318751538055e0L) * x - - 1.4897083391357284957891e0L) * x - + 1.3304961236013647092521e0L) * x - + 3.7568280825958912391243e-1L; - -/* exponent divided by 3 */ -if( e >= 0 ) - { - rem = e; - e /= 3; - rem -= 3*e; - if( rem == 1 ) - x *= CBRT2; - else if( rem == 2 ) - x *= CBRT4; - } -else - { /* argument less than 1 */ - e = -e; - rem = e; - e /= 3; - rem -= 3*e; - if( rem == 1 ) - x *= CBRT2I; - else if( rem == 2 ) - x *= CBRT4I; - e = -e; - } - -/* multiply by power of 2 */ -x = ldexpl( x, e ); - -/* Newton iteration */ - -x -= ( x - (z/(x*x)) )*0.3333333333333333333333L; -x -= ( x - (z/(x*x)) )*0.3333333333333333333333L; - -if( sign < 0 ) - x = -x; -return(x); -} diff --git a/winsup/mingw/mingwex/math/ceilf.S b/winsup/mingw/mingwex/math/ceilf.S deleted file mode 100644 index ffcdfc687..000000000 --- a/winsup/mingw/mingwex/math/ceilf.S +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Written by J.T. Conklin <jtc@netbsd.org>. - * Public domain. - */ - - .file "ceilf.S" - .text - .align 4 -.globl _ceilf - .def _ceilf; .scl 2; .type 32; .endef -_ceilf: - flds 4(%esp) - subl $8,%esp - - fstcw 4(%esp) /* store fpu control word */ - - /* We use here %edx although only the low 1 bits are defined. - But none of the operations should care and they are faster - than the 16 bit operations. */ - movl $0x0800,%edx /* round towards +oo */ - orl 4(%esp),%edx - andl $0xfbff,%edx - movl %edx,(%esp) - fldcw (%esp) /* load modified control word */ - - frndint /* round */ - - fldcw 4(%esp) /* restore original control word */ - - addl $8,%esp - ret diff --git a/winsup/mingw/mingwex/math/ceill.S b/winsup/mingw/mingwex/math/ceill.S deleted file mode 100644 index 29cb27a62..000000000 --- a/winsup/mingw/mingwex/math/ceill.S +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Written by J.T. Conklin <jtc@netbsd.org>. - * Public domain. - * Changes for long double by Ulrich Drepper <drepper@cygnus.com> - */ - - - .file "ceill.S" - .text - .align 4 -.globl _ceill - .def _ceill; .scl 2; .type 32; .endef -_ceill: - fldt 4(%esp) - subl $8,%esp - - fstcw 4(%esp) /* store fpu control word */ - - /* We use here %edx although only the low 1 bits are defined. - But none of the operations should care and they are faster - than the 16 bit operations. */ - movl $0x0800,%edx /* round towards +oo */ - orl 4(%esp),%edx - andl $0xfbff,%edx - movl %edx,(%esp) - fldcw (%esp) /* load modified control word */ - - frndint /* round */ - - fldcw 4(%esp) /* restore original control word */ - - addl $8,%esp - ret diff --git a/winsup/mingw/mingwex/math/cephes_mconf.h b/winsup/mingw/mingwex/math/cephes_mconf.h deleted file mode 100644 index 9818c4546..000000000 --- a/winsup/mingw/mingwex/math/cephes_mconf.h +++ /dev/null @@ -1,395 +0,0 @@ -#include <math.h> -#include <errno.h> - - -#define IBMPC 1 -#define ANSIPROT 1 -#define MINUSZERO 1 -#define INFINITIES 1 -#define NANS 1 -#define DENORMAL 1 -#define VOLATILE -#define mtherr(fname, code) -#define XPD 0, - -#define _CEPHES_USE_ERRNO - -#ifdef _CEPHES_USE_ERRNO -#define _SET_ERRNO(x) errno = (x) -#else -#define _SET_ERRNO(x) -#endif - -/* constants used by cephes functions */ - -/* double */ -#define MAXNUM 1.7976931348623158E308 -#define MAXLOG 7.09782712893383996843E2 -#define MINLOG -7.08396418532264106224E2 -#define LOGE2 6.93147180559945309417E-1 -#define LOG2E 1.44269504088896340736 -#define PI 3.14159265358979323846 -#define PIO2 1.57079632679489661923 -#define PIO4 7.85398163397448309616E-1 - -#define NEGZERO (-0.0) -#undef NAN -#undef INFINITY -#if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 2)) -#define INFINITY __builtin_huge_val() -#define NAN __builtin_nan("") -#else -extern double __INF; -#define INFINITY (__INF) -extern double __QNAN; -#define NAN (__QNAN) -#endif - -/*long double*/ -#define MAXNUML 1.189731495357231765021263853E4932L -#define MAXLOGL 1.1356523406294143949492E4L -#define MINLOGL -1.13994985314888605586758E4L -#define LOGE2L 6.9314718055994530941723E-1L -#define LOG2EL 1.4426950408889634073599E0L -#define PIL 3.1415926535897932384626L -#define PIO2L 1.5707963267948966192313L -#define PIO4L 7.8539816339744830961566E-1L - -#define isfinitel isfinite -#define isinfl isinf -#define isnanl isnan -#define signbitl signbit - -#define NEGZEROL (-0.0L) - -#undef NANL -#undef INFINITYL -#if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 2)) -#define INFINITYL __builtin_huge_vall() -#define NANL __builtin_nanl("") -#else -extern long double __INFL; -#define INFINITYL (__INFL) -extern long double __QNANL; -#define NANL (__QNANL) -#endif - -/* float */ - -#define MAXNUMF 3.4028234663852885981170418348451692544e38F -#define MAXLOGF 88.72283905206835F -#define MINLOGF -103.278929903431851103F /* log(2^-149) */ -#define LOG2EF 1.44269504088896341F -#define LOGE2F 0.693147180559945309F -#define PIF 3.141592653589793238F -#define PIO2F 1.5707963267948966192F -#define PIO4F 0.7853981633974483096F - -#define isfinitef isfinite -#define isinff isinf -#define isnanf isnan -#define signbitf signbit - -#define NEGZEROF (-0.0F) - -#undef NANF -#undef INFINITYF -#if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 2)) -#define INFINITYF __builtin_huge_valf() -#define NANF __builtin_nanf("") -#else -extern float __INFF; -#define INFINITYF (__INFF) -extern float __QNANF; -#define NANF (__QNANF) -#endif - - -/* double */ - -/* -Cephes Math Library Release 2.2: July, 1992 -Copyright 1984, 1987, 1988, 1992 by Stephen L. Moshier -Direct inquiries to 30 Frost Street, Cambridge, MA 02140 -*/ - - -/* polevl.c - * p1evl.c - * - * Evaluate polynomial - * - * - * - * SYNOPSIS: - * - * int N; - * double x, y, coef[N+1], polevl[]; - * - * y = polevl( x, coef, N ); - * - * - * - * DESCRIPTION: - * - * Evaluates polynomial of degree N: - * - * 2 N - * y = C + C x + C x +...+ C x - * 0 1 2 N - * - * Coefficients are stored in reverse order: - * - * coef[0] = C , ..., coef[N] = C . - * N 0 - * - * The function p1evl() assumes that coef[N] = 1.0 and is - * omitted from the array. Its calling arguments are - * otherwise the same as polevl(). - * - * - * SPEED: - * - * In the interest of speed, there are no checks for out - * of bounds arithmetic. This routine is used by most of - * the functions in the library. Depending on available - * equipment features, the user may wish to rewrite the - * program in microcode or assembly language. - * - */ - -/* Polynomial evaluator: - * P[0] x^n + P[1] x^(n-1) + ... + P[n] - */ -static __inline__ double polevl( x, p, n ) -double x; -const void *p; -int n; -{ -register double y; -register double *P = (double *)p; - -y = *P++; -do - { - y = y * x + *P++; - } -while( --n ); -return(y); -} - - - -/* Polynomial evaluator: - * x^n + P[0] x^(n-1) + P[1] x^(n-2) + ... + P[n] - */ -static __inline__ double p1evl( x, p, n ) -double x; -const void *p; -int n; -{ -register double y; -register double *P = (double *)p; - -n -= 1; -y = x + *P++; -do - { - y = y * x + *P++; - } -while( --n ); -return( y ); -} - - -/* long double */ -/* -Cephes Math Library Release 2.2: July, 1992 -Copyright 1984, 1987, 1988, 1992 by Stephen L. Moshier -Direct inquiries to 30 Frost Street, Cambridge, MA 02140 -*/ - - -/* polevll.c - * p1evll.c - * - * Evaluate polynomial - * - * - * - * SYNOPSIS: - * - * int N; - * long double x, y, coef[N+1], polevl[]; - * - * y = polevll( x, coef, N ); - * - * - * - * DESCRIPTION: - * - * Evaluates polynomial of degree N: - * - * 2 N - * y = C + C x + C x +...+ C x - * 0 1 2 N - * - * Coefficients are stored in reverse order: - * - * coef[0] = C , ..., coef[N] = C . - * N 0 - * - * The function p1evll() assumes that coef[N] = 1.0 and is - * omitted from the array. Its calling arguments are - * otherwise the same as polevll(). - * - * - * SPEED: - * - * In the interest of speed, there are no checks for out - * of bounds arithmetic. This routine is used by most of - * the functions in the library. Depending on available - * equipment features, the user may wish to rewrite the - * program in microcode or assembly language. - * - */ - -/* Polynomial evaluator: - * P[0] x^n + P[1] x^(n-1) + ... + P[n] - */ -static __inline__ long double polevll( x, p, n ) -long double x; -const void *p; -int n; -{ -register long double y; -register long double *P = (long double *)p; - -y = *P++; -do - { - y = y * x + *P++; - } -while( --n ); -return(y); -} - - - -/* Polynomial evaluator: - * x^n + P[0] x^(n-1) + P[1] x^(n-2) + ... + P[n] - */ -static __inline__ long double p1evll( x, p, n ) -long double x; -const void *p; -int n; -{ -register long double y; -register long double *P = (long double *)p; - -n -= 1; -y = x + *P++; -do - { - y = y * x + *P++; - } -while( --n ); -return( y ); -} - -/* Float version */ - -/* polevlf.c - * p1evlf.c - * - * Evaluate polynomial - * - * - * - * SYNOPSIS: - * - * int N; - * float x, y, coef[N+1], polevlf[]; - * - * y = polevlf( x, coef, N ); - * - * - * - * DESCRIPTION: - * - * Evaluates polynomial of degree N: - * - * 2 N - * y = C + C x + C x +...+ C x - * 0 1 2 N - * - * Coefficients are stored in reverse order: - * - * coef[0] = C , ..., coef[N] = C . - * N 0 - * - * The function p1evl() assumes that coef[N] = 1.0 and is - * omitted from the array. Its calling arguments are - * otherwise the same as polevl(). - * - * - * SPEED: - * - * In the interest of speed, there are no checks for out - * of bounds arithmetic. This routine is used by most of - * the functions in the library. Depending on available - * equipment features, the user may wish to rewrite the - * program in microcode or assembly language. - * - */ - -/* -Cephes Math Library Release 2.1: December, 1988 -Copyright 1984, 1987, 1988 by Stephen L. Moshier -Direct inquiries to 30 Frost Street, Cambridge, MA 02140 -*/ - -static __inline__ float polevlf(float x, const float* coef, int N ) -{ -float ans; -float *p; -int i; - -p = (float*)coef; -ans = *p++; - -/* -for( i=0; i<N; i++ ) - ans = ans * x + *p++; -*/ - -i = N; -do - ans = ans * x + *p++; -while( --i ); - -return( ans ); -} - -/* p1evl() */ -/* N - * Evaluate polynomial when coefficient of x is 1.0. - * Otherwise same as polevl. - */ - -static __inline__ float p1evlf( float x, const float *coef, int N ) -{ -float ans; -float *p; -int i; - -p = (float*)coef; -ans = x + *p++; -i = N-1; - -do - ans = ans * x + *p++; -while( --i ); - -return( ans ); -} diff --git a/winsup/mingw/mingwex/math/copysign.S b/winsup/mingw/mingwex/math/copysign.S deleted file mode 100644 index 60d6c72db..000000000 --- a/winsup/mingw/mingwex/math/copysign.S +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Written by J.T. Conklin <jtc@netbsd.org>. - * Public domain. - */ - - .file "copysign.S" - .text - .align 4 -.globl _copysign - .def _copysign; .scl 2; .type 32; .endef -_copysign: - movl 16(%esp),%edx - movl 8(%esp),%eax - andl $0x80000000,%edx - andl $0x7fffffff,%eax - orl %edx,%eax - movl %eax,8(%esp) - fldl 4(%esp) - ret diff --git a/winsup/mingw/mingwex/math/copysignf.S b/winsup/mingw/mingwex/math/copysignf.S deleted file mode 100644 index 8a60c463c..000000000 --- a/winsup/mingw/mingwex/math/copysignf.S +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Written by J.T. Conklin <jtc@netbsd.org>. - * Public domain. - */ - - .file "copysignf.S" - .text - .align 4 -.globl _copysignf - .def _copysignf; .scl 2; .type 32; .endef -_copysignf: - movl 8(%esp),%edx - movl 4(%esp),%eax - andl $0x80000000,%edx - andl $0x7fffffff,%eax - orl %edx,%eax - movl %eax,4(%esp) - flds 4(%esp) - ret diff --git a/winsup/mingw/mingwex/math/copysignl.S b/winsup/mingw/mingwex/math/copysignl.S deleted file mode 100644 index 4143b37f8..000000000 --- a/winsup/mingw/mingwex/math/copysignl.S +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Written by J.T. Conklin <jtc@netbsd.org>. - * Changes for long double by Ulrich Drepper <drepper@cygnus.com> - * Public domain. - */ - - .file "copysignl.S" - .text - .align 4 -.globl _copysignl - .def _copysignl; .scl 2; .type 32; .endef -_copysignl: - movl 24(%esp),%edx - movl 12(%esp),%eax - andl $0x8000,%edx - andl $0x7fff,%eax - orl %edx,%eax - movl %eax,12(%esp) - fldt 4(%esp) - ret diff --git a/winsup/mingw/mingwex/math/cosf.S b/winsup/mingw/mingwex/math/cosf.S deleted file mode 100644 index 862f6ce6c..000000000 --- a/winsup/mingw/mingwex/math/cosf.S +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Written by J.T. Conklin <jtc@netbsd.org>. - * Public domain. - * - * Removed glibc header dependancy by Danny Smith - * <dannysmith@users.sourceforge.net> - */ - .file "cosf.S" - .text - .align 4 -.globl _cosl - .def _cosf; .scl 2; .type 32; .endef -_cosf: - flds 4(%esp) - fcos - fnstsw %ax - testl $0x400,%eax - jnz 1f - ret -1: fldpi - fadd %st(0) - fxch %st(1) -2: fprem1 - fnstsw %ax - testl $0x400,%eax - jnz 2b - fstp %st(1) - fcos - ret diff --git a/winsup/mingw/mingwex/math/coshf.c b/winsup/mingw/mingwex/math/coshf.c deleted file mode 100644 index 4e44f0811..000000000 --- a/winsup/mingw/mingwex/math/coshf.c +++ /dev/null @@ -1,3 +0,0 @@ -#include <math.h> -float coshf (float x) - {return (float) cosh (x);} diff --git a/winsup/mingw/mingwex/math/coshl.c b/winsup/mingw/mingwex/math/coshl.c deleted file mode 100644 index c698e50c0..000000000 --- a/winsup/mingw/mingwex/math/coshl.c +++ /dev/null @@ -1,110 +0,0 @@ -/* coshl.c - * - * Hyperbolic cosine, long double precision - * - * - * - * SYNOPSIS: - * - * long double x, y, coshl(); - * - * y = coshl( x ); - * - * - * - * DESCRIPTION: - * - * Returns hyperbolic cosine of argument in the range MINLOGL to - * MAXLOGL. - * - * cosh(x) = ( exp(x) + exp(-x) )/2. - * - * - * - * ACCURACY: - * - * Relative error: - * arithmetic domain # trials peak rms - * IEEE +-10000 30000 1.1e-19 2.8e-20 - * - * - * ERROR MESSAGES: - * - * message condition value returned - * cosh overflow |x| > MAXLOGL+LOGE2L INFINITYL - * - * - */ - - -/* -Cephes Math Library Release 2.7: May, 1998 -Copyright 1985, 1991, 1998 by Stephen L. Moshier -*/ - -/* -Modified for mingw -2002-07-22 Danny Smith <dannysmith@users.sourceforge.net> -*/ - -#ifdef __MINGW32__ -#include "cephes_mconf.h" -#else -#include "mconf.h" -#endif - -#ifndef _SET_ERRNO -#define _SET_ERRNO(x) -#endif - - -#ifndef __MINGW32__ -extern long double MAXLOGL, MAXNUML, LOGE2L; -#ifdef ANSIPROT -extern long double expl ( long double ); -extern int isnanl ( long double ); -#else -long double expl(), isnanl(); -#endif -#ifdef INFINITIES -extern long double INFINITYL; -#endif -#ifdef NANS -extern long double NANL; -#endif -#endif /* __MINGW32__ */ - -long double coshl(x) -long double x; -{ -long double y; - -#ifdef NANS -if( isnanl(x) ) - { - _SET_ERRNO(EDOM); - return(x); - } -#endif -if( x < 0 ) - x = -x; -if( x > (MAXLOGL + LOGE2L) ) - { - mtherr( "coshl", OVERFLOW ); - _SET_ERRNO(ERANGE); -#ifdef INFINITIES - return( INFINITYL ); -#else - return( MAXNUML ); -#endif - } -if( x >= (MAXLOGL - LOGE2L) ) - { - y = expl(0.5L * x); - y = (0.5L * y) * y; - return(y); - } -y = expl(x); -y = 0.5L * (y + 1.0L / y); -return( y ); -} diff --git a/winsup/mingw/mingwex/math/cosl.S b/winsup/mingw/mingwex/math/cosl.S deleted file mode 100644 index 59d9858b3..000000000 --- a/winsup/mingw/mingwex/math/cosl.S +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Written by J.T. Conklin <jtc@netbsd.org>. - * Public domain. - * - * Adapted for `long double' by Ulrich Drepper <drepper@cygnus.com>. - * Removed glibc header dependancy by Danny Smith - * <dannysmith@users.sourceforge.net> - */ - .file "cosl.S" - .text - .align 4 -.globl _cosl - .def _cosl; .scl 2; .type 32; .endef -_cosl: - fldt 4(%esp) - fcos - fnstsw %ax - testl $0x400,%eax - jnz 1f - ret -1: fldpi - fadd %st(0) - fxch %st(1) -2: fprem1 - fnstsw %ax - testl $0x400,%eax - jnz 2b - fstp %st(1) - fcos - ret diff --git a/winsup/mingw/mingwex/math/erfl.c b/winsup/mingw/mingwex/math/erfl.c deleted file mode 100755 index ac50d98c2..000000000 --- a/winsup/mingw/mingwex/math/erfl.c +++ /dev/null @@ -1,299 +0,0 @@ -/* erfl.c - * - * Error function - * - * - * - * SYNOPSIS: - * - * long double x, y, erfl(); - * - * y = erfl( x ); - * - * - * - * DESCRIPTION: - * - * The integral is - * - * x - * - - * 2 | | 2 - * erf(x) = -------- | exp( - t ) dt. - * sqrt(pi) | | - * - - * 0 - * - * The magnitude of x is limited to about 106.56 for IEEE - * arithmetic; 1 or -1 is returned outside this range. - * - * For 0 <= |x| < 1, erf(x) = x * P6(x^2)/Q6(x^2); - * Otherwise: erf(x) = 1 - erfc(x). - * - * - * - * ACCURACY: - * - * Relative error: - * arithmetic domain # trials peak rms - * IEEE 0,1 50000 2.0e-19 5.7e-20 - * - */ - -/* erfcl.c - * - * Complementary error function - * - * - * - * SYNOPSIS: - * - * long double x, y, erfcl(); - * - * y = erfcl( x ); - * - * - * - * DESCRIPTION: - * - * - * 1 - erf(x) = - * - * inf. - * - - * 2 | | 2 - * erfc(x) = -------- | exp( - t ) dt - * sqrt(pi) | | - * - - * x - * - * - * For small x, erfc(x) = 1 - erf(x); otherwise rational - * approximations are computed. - * - * A special function expx2l.c is used to suppress error amplification - * in computing exp(-x^2). - * - * - * ACCURACY: - * - * Relative error: - * arithmetic domain # trials peak rms - * IEEE 0,13 50000 8.4e-19 9.7e-20 - * IEEE 6,106.56 20000 2.9e-19 7.1e-20 - * - * - * ERROR MESSAGES: - * - * message condition value returned - * erfcl underflow x^2 > MAXLOGL 0.0 - * - * - */ - - -/* -Modified from file ndtrl.c -Cephes Math Library Release 2.3: January, 1995 -Copyright 1984, 1995 by Stephen L. Moshier -*/ - -#include <math.h> -#include "cephes_mconf.h" - -/* erfc(x) = exp(-x^2) P(1/x)/Q(1/x) - 1/8 <= 1/x <= 1 - Peak relative error 5.8e-21 */ - -static const unsigned short P[] = { -0x4bf0,0x9ad8,0x7a03,0x86c7,0x401d, XPD -0xdf23,0xd843,0x4032,0x8881,0x401e, XPD -0xd025,0xcfd5,0x8494,0x88d3,0x401e, XPD -0xb6d0,0xc92b,0x5417,0xacb1,0x401d, XPD -0xada8,0x356a,0x4982,0x94a6,0x401c, XPD -0x4e13,0xcaee,0x9e31,0xb258,0x401a, XPD -0x5840,0x554d,0x37a3,0x9239,0x4018, XPD -0x3b58,0x3da2,0xaf02,0x9780,0x4015, XPD -0x0144,0x489e,0xbe68,0x9c31,0x4011, XPD -0x333b,0xd9e6,0xd404,0x986f,0xbfee, XPD -}; -static const unsigned short Q[] = { -/* 0x0000,0x0000,0x0000,0x8000,0x3fff, XPD */ -0x0e43,0x302d,0x79ed,0x86c7,0x401d, XPD -0xf817,0x9128,0xc0f8,0xd48b,0x401e, XPD -0x8eae,0x8dad,0x6eb4,0x9aa2,0x401f, XPD -0x00e7,0x7595,0xcd06,0x88bb,0x401f, XPD -0x4991,0xcfda,0x52f1,0xa2a9,0x401e, XPD -0xc39d,0xe415,0xc43d,0x87c0,0x401d, XPD -0xa75d,0x436f,0x30dd,0xa027,0x401b, XPD -0xc4cb,0x305a,0xbf78,0x8220,0x4019, XPD -0x3708,0x33b1,0x07fa,0x8644,0x4016, XPD -0x24fa,0x96f6,0x7153,0x8a6c,0x4012, XPD -}; - -/* erfc(x) = exp(-x^2) 1/x R(1/x^2) / S(1/x^2) - 1/128 <= 1/x < 1/8 - Peak relative error 1.9e-21 */ - -static const unsigned short R[] = { -0x260a,0xab95,0x2fc7,0xe7c4,0x4000, XPD -0x4761,0x613e,0xdf6d,0xe58e,0x4001, XPD -0x0615,0x4b00,0x575f,0xdc7b,0x4000, XPD -0x521d,0x8527,0x3435,0x8dc2,0x3ffe, XPD -0x22cf,0xc711,0x6c5b,0xdcfb,0x3ff9, XPD -}; -static const unsigned short S[] = { -/* 0x0000,0x0000,0x0000,0x8000,0x3fff, XPD */ -0x5de6,0x17d7,0x54d6,0xaba9,0x4002, XPD -0x55d5,0xd300,0xe71e,0xf564,0x4002, XPD -0xb611,0x8f76,0xf020,0xd255,0x4001, XPD -0x3684,0x3798,0xb793,0x80b0,0x3fff, XPD -0xf5af,0x2fb2,0x1e57,0xc3d7,0x3ffa, XPD -}; - -/* erf(x) = x T(x^2)/U(x^2) - 0 <= x <= 1 - Peak relative error 7.6e-23 */ - -static const unsigned short T[] = { -0xfd7a,0x3a1a,0x705b,0xe0c4,0x3ffb, XPD -0x3128,0xc337,0x3716,0xace5,0x4001, XPD -0x9517,0x4e93,0x540e,0x8f97,0x4007, XPD -0x6118,0x6059,0x9093,0xa757,0x400a, XPD -0xb954,0xa987,0xc60c,0xbc83,0x400e, XPD -0x7a56,0xe45a,0xa4bd,0x975b,0x4010, XPD -0xc446,0x6bab,0x0b2a,0x86d0,0x4013, XPD -}; - -static const unsigned short U[] = { -/* 0x0000,0x0000,0x0000,0x8000,0x3fff, XPD */ -0x3453,0x1f8e,0xf688,0xb507,0x4004, XPD -0x71ac,0xb12f,0x21ca,0xf2e2,0x4008, XPD -0xffe8,0x9cac,0x3b84,0xc2ac,0x400c, XPD -0x481d,0x445b,0xc807,0xc232,0x400f, XPD -0x9ad5,0x1aef,0x45b1,0xe25e,0x4011, XPD -0x71a7,0x1cad,0x012e,0xeef3,0x4012, XPD -}; - -/* expx2l.c - * - * Exponential of squared argument - * - * - * - * SYNOPSIS: - * - * long double x, y, expmx2l(); - * int sign; - * - * y = expx2l( x ); - * - * - * - * DESCRIPTION: - * - * Computes y = exp(x*x) while suppressing error amplification - * that would ordinarily arise from the inexactness of the - * exponential argument x*x. - * - * - * - * ACCURACY: - * - * Relative error: - * arithmetic domain # trials peak rms - * IEEE -106.566, 106.566 10^5 1.6e-19 4.4e-20 - * - */ - -#define M 32768.0L -#define MINV 3.0517578125e-5L - -static long double expx2l (long double x) -{ - long double u, u1, m, f; - - x = fabsl (x); - /* Represent x as an exact multiple of M plus a residual. - M is a power of 2 chosen so that exp(m * m) does not overflow - or underflow and so that |x - m| is small. */ - m = MINV * floorl(M * x + 0.5L); - f = x - m; - - /* x^2 = m^2 + 2mf + f^2 */ - u = m * m; - u1 = 2 * m * f + f * f; - - if ((u+u1) > MAXLOGL) - return (INFINITYL); - - /* u is exact, u1 is small. */ - u = expl(u) * expl(u1); - return(u); -} - -long double erfcl(long double a) -{ -long double p,q,x,y,z; - -if (isinf (a)) - return (signbit (a) ? 2.0 : 0.0); - -x = fabsl (a); - -if (x < 1.0L) - return (1.0L - erfl(a)); - -z = a * a; - -if( z > MAXLOGL ) - { -under: - mtherr( "erfcl", UNDERFLOW ); - errno = ERANGE; - return (signbit (a) ? 2.0 : 0.0); - } - -/* Compute z = expl(a * a). */ -z = expx2l (a); -y = 1.0L/x; - -if (x < 8.0L) - { - p = polevll (y, P, 9); - q = p1evll (y, Q, 10); - } -else - { - q = y * y; - p = y * polevll (q, R, 4); - q = p1evll (q, S, 5); - } -y = p/(q * z); - -if (a < 0.0L) - y = 2.0L - y; - -if (y == 0.0L) - goto under; - -return (y); -} - -long double erfl(long double x) -{ -long double y, z; - -if( x == 0.0L ) - return (x); - -if (isinf (x)) - return (signbit (x) ? -1.0L : 1.0L); - -if (fabsl(x) > 1.0L) - return (1.0L - erfcl (x)); - -z = x * x; -y = x * polevll( z, T, 6 ) / p1evll( z, U, 6 ); -return( y ); -} diff --git a/winsup/mingw/mingwex/math/exp2.S b/winsup/mingw/mingwex/math/exp2.S deleted file mode 100644 index 320065726..000000000 --- a/winsup/mingw/mingwex/math/exp2.S +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Written by J.T. Conklin <jtc@netbsd.org>. - * Adapted for exp2 by Ulrich Drepper <drepper@cygnus.com>. - * Public domain. - */ - - .file "exp2.S" - .text - .align 4 -.globl _exp2 - .def _exp2; .scl 2; .type 32; .endef -_exp2: - fldl 4(%esp) -/* I added the following ugly construct because exp(+-Inf) resulted - in NaN. The ugliness results from the bright minds at Intel. - For the i686 the code can be written better. - -- drepper@cygnus.com. */ - fxam /* Is NaN or +-Inf? */ - fstsw %ax - movb $0x45, %dh - andb %ah, %dh - cmpb $0x05, %dh - je 1f /* Is +-Inf, jump. */ - fld %st - frndint /* int(x) */ - fsubr %st,%st(1) /* fract(x) */ - fxch - f2xm1 /* 2^(fract(x)) - 1 */ - fld1 - faddp /* 2^(fract(x)) */ - fscale /* e^x */ - fstp %st(1) - ret - -1: testl $0x200, %eax /* Test sign. */ - jz 2f /* If positive, jump. */ - fstp %st - fldz /* Set result to 0. */ -2: ret diff --git a/winsup/mingw/mingwex/math/exp2f.S b/winsup/mingw/mingwex/math/exp2f.S deleted file mode 100644 index 0707a0cc6..000000000 --- a/winsup/mingw/mingwex/math/exp2f.S +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Written by J.T. Conklin <jtc@netbsd.org>. - * Adapted for exp2 by Ulrich Drepper <drepper@cygnus.com>. - * Public domain. - */ - - .file "exp2f.S" - .text - .align 4 -.globl _exp2f - .def _exp2f; .scl 2; .type 32; .endef -_exp2f: - flds 4(%esp) -/* I added the following ugly construct because exp(+-Inf) resulted - in NaN. The ugliness results from the bright minds at Intel. - For the i686 the code can be written better. - -- drepper@cygnus.com. */ - fxam /* Is NaN or +-Inf? */ - fstsw %ax - movb $0x45, %dh - andb %ah, %dh - cmpb $0x05, %dh - je 1f /* Is +-Inf, jump. */ - fld %st - frndint /* int(x) */ - fsubr %st,%st(1) /* fract(x) */ - fxch - f2xm1 /* 2^(fract(x)) - 1 */ - fld1 - faddp /* 2^(fract(x)) */ - fscale /* e^x */ - fstp %st(1) - ret - -1: testl $0x200, %eax /* Test sign. */ - jz 2f /* If positive, jump. */ - fstp %st - fldz /* Set result to 0. */ -2: ret diff --git a/winsup/mingw/mingwex/math/exp2l.S b/winsup/mingw/mingwex/math/exp2l.S deleted file mode 100644 index 2457c26f4..000000000 --- a/winsup/mingw/mingwex/math/exp2l.S +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Written by J.T. Conklin <jtc@netbsd.org>. - * Adapted for exp2 by Ulrich Drepper <drepper@cygnus.com>. - * Public domain. - */ - - .file "exp2l.S" - .text - .align 4 -.globl _exp2l - .def _exp2l; .scl 2; .type 32; .endef -_exp2l: - fldt 4(%esp) -/* I added the following ugly construct because exp(+-Inf) resulted - in NaN. The ugliness results from the bright minds at Intel. - For the i686 the code can be written better. - -- drepper@cygnus.com. */ - fxam /* Is NaN or +-Inf? */ - fstsw %ax - movb $0x45, %dh - andb %ah, %dh - cmpb $0x05, %dh - je 1f /* Is +-Inf, jump. */ - fld %st - frndint /* int(x) */ - fsubr %st,%st(1) /* fract(x) */ - fxch - f2xm1 /* 2^(fract(x)) - 1 */ - fld1 - faddp /* 2^(fract(x)) */ - fscale /* e^x */ - fstp %st(1) - ret - -1: testl $0x200, %eax /* Test sign. */ - jz 2f /* If positive, jump. */ - fstp %st - fldz /* Set result to 0. */ -2: ret diff --git a/winsup/mingw/mingwex/math/expf.c b/winsup/mingw/mingwex/math/expf.c deleted file mode 100644 index e56e0bc6e..000000000 --- a/winsup/mingw/mingwex/math/expf.c +++ /dev/null @@ -1,3 +0,0 @@ -#include <math.h> -float expf (float x) - {return (float) exp (x);} diff --git a/winsup/mingw/mingwex/math/expl.c b/winsup/mingw/mingwex/math/expl.c deleted file mode 100644 index 9731a902b..000000000 --- a/winsup/mingw/mingwex/math/expl.c +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Written by J.T. Conklin <jtc@netbsd.org>. - * Public domain. - * - * Adapted for `long double' by Ulrich Drepper <drepper@cygnus.com>. - */ - -/* - * The 8087 method for the exponential function is to calculate - * exp(x) = 2^(x log2(e)) - * after separating integer and fractional parts - * x log2(e) = i + f, |f| <= .5 - * 2^i is immediate but f needs to be precise for long double accuracy. - * Suppress range reduction error in computing f by the following. - * Separate x into integer and fractional parts - * x = xi + xf, |xf| <= .5 - * Separate log2(e) into the sum of an exact number c0 and small part c1. - * c0 + c1 = log2(e) to extra precision - * Then - * f = (c0 xi - i) + c0 xf + c1 x - * where c0 xi is exact and so also is (c0 xi - i). - * -- moshier@na-net.ornl.gov - */ - -#include <math.h> -#include "cephes_mconf.h" /* for max and min log thresholds */ - -static long double c0 = 1.44268798828125L; -static long double c1 = 7.05260771340735992468e-6L; - -static long double -__expl (long double x) -{ - long double res; - asm ("fldl2e\n\t" /* 1 log2(e) */ - "fmul %%st(1),%%st\n\t" /* 1 x log2(e) */ - "frndint\n\t" /* 1 i */ - "fld %%st(1)\n\t" /* 2 x */ - "frndint\n\t" /* 2 xi */ - "fld %%st(1)\n\t" /* 3 i */ - "fldt %2\n\t" /* 4 c0 */ - "fld %%st(2)\n\t" /* 5 xi */ - "fmul %%st(1),%%st\n\t" /* 5 c0 xi */ - "fsubp %%st,%%st(2)\n\t" /* 4 f = c0 xi - i */ - "fld %%st(4)\n\t" /* 5 x */ - "fsub %%st(3),%%st\n\t" /* 5 xf = x - xi */ - "fmulp %%st,%%st(1)\n\t" /* 4 c0 xf */ - "faddp %%st,%%st(1)\n\t" /* 3 f = f + c0 xf */ - "fldt %3\n\t" /* 4 */ - "fmul %%st(4),%%st\n\t" /* 4 c1 * x */ - "faddp %%st,%%st(1)\n\t" /* 3 f = f + c1 * x */ - "f2xm1\n\t" /* 3 2^(fract(x * log2(e))) - 1 */ - "fld1\n\t" /* 4 1.0 */ - "faddp\n\t" /* 3 2^(fract(x * log2(e))) */ - "fstp %%st(1)\n\t" /* 2 */ - "fscale\n\t" /* 2 scale factor is st(1); e^x */ - "fstp %%st(1)\n\t" /* 1 */ - "fstp %%st(1)\n\t" /* 0 */ - : "=t" (res) : "0" (x), "m" (c0), "m" (c1) : "ax", "dx"); - return res; -} - -long double expl (long double x) -{ - if (x > MAXLOGL) - return INFINITY; - else if (x < MINLOGL) - return 0.0L; - else - return __expl (x); -} diff --git a/winsup/mingw/mingwex/math/expm1.c b/winsup/mingw/mingwex/math/expm1.c deleted file mode 100755 index 4b2f43939..000000000 --- a/winsup/mingw/mingwex/math/expm1.c +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Written 2005 by Gregory W. Chicares <chicares@cox.net>. - * Adapted to double by Danny Smith <dannysmith@users.sourceforge.net>. - * Public domain. - * - * F2XM1's input is constrained to (-1, +1), so the domain of - * 'x * LOG2EL' is (-LOGE2L, +LOGE2L). Outside that domain, - * delegating to exp() handles C99 7.12.6.3/2 range errors. - * - * Constants from moshier.net, file cephes/ldouble/constl.c, - * are used instead of M_LN2 and M_LOG2E, which would not be - * visible with 'gcc std=c99'. The use of these extended precision - * constants also allows gcc to replace them with x87 opcodes. - */ - -#include <math.h> /* expl() */ -#include "cephes_mconf.h" -double expm1 (double x) -{ - if (fabs(x) < LOGE2L) - { - x *= LOG2EL; - __asm__("f2xm1" : "=t" (x) : "0" (x)); - return x; - } - else - return exp(x) - 1.0; -} diff --git a/winsup/mingw/mingwex/math/expm1f.c b/winsup/mingw/mingwex/math/expm1f.c deleted file mode 100755 index e38665c48..000000000 --- a/winsup/mingw/mingwex/math/expm1f.c +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Written 2005 by Gregory W. Chicares <chicares@cox.net>. - * Adapted to float by Danny Smith <dannysmith@users.sourceforge.net>. - * Public domain. - * - * F2XM1's input is constrained to (-1, +1), so the domain of - * 'x * LOG2EL' is (-LOGE2L, +LOGE2L). Outside that domain, - * delegating to exp() handles C99 7.12.6.3/2 range errors. - * - * Constants from moshier.net, file cephes/ldouble/constl.c, - * are used instead of M_LN2 and M_LOG2E, which would not be - * visible with 'gcc std=c99'. The use of these extended precision - * constants also allows gcc to replace them with x87 opcodes. - */ - -#include <math.h> /* expl() */ -#include "cephes_mconf.h" - -float expm1f (float x) -{ - if (fabsf(x) < LOGE2L) - { - x *= LOG2EL; - __asm__("f2xm1" : "=t" (x) : "0" (x)); - return x; - } - else - return expf(x) - 1.0F; -} diff --git a/winsup/mingw/mingwex/math/expm1l.c b/winsup/mingw/mingwex/math/expm1l.c deleted file mode 100755 index 69fe8e525..000000000 --- a/winsup/mingw/mingwex/math/expm1l.c +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Written 2005 by Gregory W. Chicares <chicares@cox.net> with - * help from Danny Smith. dannysmith@users.sourceforge.net>. - * Public domain. - * - * F2XM1's input is constrained to (-1, +1), so the domain of - * 'x * LOG2EL' is (-LOGE2L, +LOGE2L). Outside that domain, - * delegating to expl() handles C99 7.12.6.3/2 range errors. - * - * Constants from moshier.net, file cephes/ldouble/constl.c, - * are used instead of M_LN2 and M_LOG2E, which would not be - * visible with 'gcc std=c99'. The use of these extended precision - * constants also allows gcc to replace them with x87 opcodes. - */ - -#include <math.h> /* expl() */ -#include "cephes_mconf.h" - -long double expm1l (long double x) -{ - if (fabsl(x) < LOGE2L) - { - x *= LOG2EL; - __asm__("f2xm1" : "=t" (x) : "0" (x)); - return x; - } - else - return expl(x) - 1.0L; -} diff --git a/winsup/mingw/mingwex/math/fabs.c b/winsup/mingw/mingwex/math/fabs.c deleted file mode 100644 index c2074e8cb..000000000 --- a/winsup/mingw/mingwex/math/fabs.c +++ /dev/null @@ -1,10 +0,0 @@ -#include <math.h> - -double -fabs (double x) -{ - double res; - - asm ("fabs;" : "=t" (res) : "0" (x)); - return res; -} diff --git a/winsup/mingw/mingwex/math/fabsf.c b/winsup/mingw/mingwex/math/fabsf.c deleted file mode 100644 index 6580f955c..000000000 --- a/winsup/mingw/mingwex/math/fabsf.c +++ /dev/null @@ -1,9 +0,0 @@ -#include <math.h> - -float -fabsf (float x) -{ - float res; - asm ("fabs;" : "=t" (res) : "0" (x)); - return res; -} diff --git a/winsup/mingw/mingwex/math/fabsl.c b/winsup/mingw/mingwex/math/fabsl.c deleted file mode 100644 index eead724d4..000000000 --- a/winsup/mingw/mingwex/math/fabsl.c +++ /dev/null @@ -1,9 +0,0 @@ -#include <math.h> - -long double -fabsl (long double x) -{ - long double res; - asm ("fabs;" : "=t" (res) : "0" (x)); - return res; -} diff --git a/winsup/mingw/mingwex/math/fastmath.h b/winsup/mingw/mingwex/math/fastmath.h deleted file mode 100755 index 01b06b3eb..000000000 --- a/winsup/mingw/mingwex/math/fastmath.h +++ /dev/null @@ -1,115 +0,0 @@ -#ifndef _MINGWEX_FASTMATH_H_ -#define _MINGWEX_FASTMATH_H_ - -/* Fast math inlines - No range or domain checks. No setting of errno. No tweaks to - protect precision near range limits. */ - -/* For now this is an internal header with just the functions that - are currently used in building libmingwex.a math components */ - -/* FIXME: We really should get rid of the code duplication using euther - C++ templates or tgmath-type macros. */ - -static __inline__ double __fast_sqrt (double x) -{ - double res; - asm __volatile__ ("fsqrt" : "=t" (res) : "0" (x)); - return res; -} - -static __inline__ long double __fast_sqrtl (long double x) -{ - long double res; - asm __volatile__ ("fsqrt" : "=t" (res) : "0" (x)); - return res; -} - -static __inline__ float __fast_sqrtf (float x) -{ - float res; - asm __volatile__ ("fsqrt" : "=t" (res) : "0" (x)); - return res; -} - - -static __inline__ double __fast_log (double x) -{ - double res; - asm __volatile__ - ("fldln2\n\t" - "fxch\n\t" - "fyl2x" - : "=t" (res) : "0" (x) : "st(1)"); - return res; -} - -static __inline__ long double __fast_logl (long double x) -{ - long double res; - asm __volatile__ - ("fldln2\n\t" - "fxch\n\t" - "fyl2x" - : "=t" (res) : "0" (x) : "st(1)"); - return res; -} - - -static __inline__ float __fast_logf (float x) -{ - float res; - asm __volatile__ - ("fldln2\n\t" - "fxch\n\t" - "fyl2x" - : "=t" (res) : "0" (x) : "st(1)"); - return res; -} - -static __inline__ double __fast_log1p (double x) -{ - double res; - /* fyl2xp1 accurate only for |x| <= 1.0 - 0.5 * sqrt (2.0) */ - if (fabs (x) >= 1.0 - 0.5 * 1.41421356237309504880) - res = __fast_log (1.0 + x); - else - asm __volatile__ - ("fldln2\n\t" - "fxch\n\t" - "fyl2xp1" - : "=t" (res) : "0" (x) : "st(1)"); - return res; -} - -static __inline__ long double __fast_log1pl (long double x) -{ - long double res; - /* fyl2xp1 accurate only for |x| <= 1.0 - 0.5 * sqrt (2.0) */ - if (fabsl (x) >= 1.0L - 0.5L * 1.41421356237309504880L) - res = __fast_logl (1.0L + x); - else - asm __volatile__ - ("fldln2\n\t" - "fxch\n\t" - "fyl2xp1" - : "=t" (res) : "0" (x) : "st(1)"); - return res; -} - -static __inline__ float __fast_log1pf (float x) -{ - float res; - /* fyl2xp1 accurate only for |x| <= 1.0 - 0.5 * sqrt (2.0) */ - if (fabsf (x) >= 1.0 - 0.5 * 1.41421356237309504880) - res = __fast_logf (1.0 + x); - else - asm __volatile__ - ("fldln2\n\t" - "fxch\n\t" - "fyl2xp1" - : "=t" (res) : "0" (x) : "st(1)"); - return res; -} - -#endif diff --git a/winsup/mingw/mingwex/math/fdim.c b/winsup/mingw/mingwex/math/fdim.c deleted file mode 100644 index 330b09241..000000000 --- a/winsup/mingw/mingwex/math/fdim.c +++ /dev/null @@ -1,7 +0,0 @@ -#include <math.h> - -double -fdim (double x, double y) -{ - return (isgreater(x, y) ? (x - y) : 0.0); -} diff --git a/winsup/mingw/mingwex/math/fdimf.c b/winsup/mingw/mingwex/math/fdimf.c deleted file mode 100644 index 02bfc6e5e..000000000 --- a/winsup/mingw/mingwex/math/fdimf.c +++ /dev/null @@ -1,7 +0,0 @@ -#include <math.h> - -float -fdimf (float x, float y) -{ - return (isgreater(x, y) ? (x - y) : 0.0F); -} diff --git a/winsup/mingw/mingwex/math/fdiml.c b/winsup/mingw/mingwex/math/fdiml.c deleted file mode 100644 index 1c3d0aaaa..000000000 --- a/winsup/mingw/mingwex/math/fdiml.c +++ /dev/null @@ -1,7 +0,0 @@ -#include <math.h> - -long double -fdiml (long double x, long double y) -{ - return (isgreater(x, y) ? (x - y) : 0.0L); -} diff --git a/winsup/mingw/mingwex/math/floorf.S b/winsup/mingw/mingwex/math/floorf.S deleted file mode 100644 index 8ae8100a7..000000000 --- a/winsup/mingw/mingwex/math/floorf.S +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Written by J.T. Conklin <jtc@netbsd.org>. - * Public domain. - * - * Changes for long double by Ulrich Drepper <drepper@cygnus.com> - * - * Removed header file dependency for use in libmingwex.a by - * Danny Smith <dannysmith@users.sourceforge.net> - */ - .file "floorf.S" - .text - .align 4 -.globl _floorf - .def _floorf; .scl 2; .type 32; .endef -_floorf: - flds 4(%esp) - subl $8,%esp - - fstcw 4(%esp) /* store fpu control word */ - - /* We use here %edx although only the low 1 bits are defined. - But none of the operations should care and they are faster - than the 16 bit operations. */ - movl $0x400,%edx /* round towards -oo */ - orl 4(%esp),%edx - andl $0xf7ff,%edx - movl %edx,(%esp) - fldcw (%esp) /* load modified control word */ - - frndint /* round */ - - fldcw 4(%esp) /* restore original control word */ - - addl $8,%esp - ret diff --git a/winsup/mingw/mingwex/math/floorl.S b/winsup/mingw/mingwex/math/floorl.S deleted file mode 100644 index 5ab9214b5..000000000 --- a/winsup/mingw/mingwex/math/floorl.S +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Written by J.T. Conklin <jtc@netbsd.org>. - * Public domain. - * - * Changes for long double by Ulrich Drepper <drepper@cygnus.com> - * - */ - .file "floorl.S" - .text - .align 4 -.globl _floorl - .def _floorl; .scl 2; .type 32; .endef -_floorl: - fldt 4(%esp) - subl $8,%esp - - fstcw 4(%esp) /* store fpu control word */ - - /* We use here %edx although only the low 1 bits are defined. - But none of the operations should care and they are faster - than the 16 bit operations. */ - movl $0x400,%edx /* round towards -oo */ - orl 4(%esp),%edx - andl $0xf7ff,%edx - movl %edx,(%esp) - fldcw (%esp) /* load modified control word */ - - frndint /* round */ - - fldcw 4(%esp) /* restore original control word */ - - addl $8,%esp - ret diff --git a/winsup/mingw/mingwex/math/fma.S b/winsup/mingw/mingwex/math/fma.S deleted file mode 100644 index d6226653c..000000000 --- a/winsup/mingw/mingwex/math/fma.S +++ /dev/null @@ -1,12 +0,0 @@ - .file "fma.S" - .text - .align 2 - .p2align 4,,15 -.globl _fma - .def _fma; .scl 2; .type 32; .endef -_fma: - fldl 4(%esp) - fmull 12(%esp) - fldl 20(%esp) - faddp - ret diff --git a/winsup/mingw/mingwex/math/fmaf.S b/winsup/mingw/mingwex/math/fmaf.S deleted file mode 100644 index 0d64ac2f1..000000000 --- a/winsup/mingw/mingwex/math/fmaf.S +++ /dev/null @@ -1,12 +0,0 @@ - .file "fmaf.S" - .text - .align 2 - .p2align 4,,15 -.globl _fmaf - .def _fmaf; .scl 2; .type 32; .endef -_fmaf: - flds 4(%esp) - fmuls 8(%esp) - flds 12(%esp) - faddp - ret diff --git a/winsup/mingw/mingwex/math/fmal.c b/winsup/mingw/mingwex/math/fmal.c deleted file mode 100644 index 1fbd41d28..000000000 --- a/winsup/mingw/mingwex/math/fmal.c +++ /dev/null @@ -1,5 +0,0 @@ -long double -fmal ( long double _x, long double _y, long double _z) -{ - return ((_x * _y) + _z); -} diff --git a/winsup/mingw/mingwex/math/fmax.c b/winsup/mingw/mingwex/math/fmax.c deleted file mode 100644 index 35c1f45e5..000000000 --- a/winsup/mingw/mingwex/math/fmax.c +++ /dev/null @@ -1,7 +0,0 @@ -#include <math.h> - -double -fmax (double _x, double _y) -{ - return ( isgreaterequal (_x, _y)|| __isnan (_y) ? _x : _y ); -} diff --git a/winsup/mingw/mingwex/math/fmaxf.c b/winsup/mingw/mingwex/math/fmaxf.c deleted file mode 100644 index 079a7e746..000000000 --- a/winsup/mingw/mingwex/math/fmaxf.c +++ /dev/null @@ -1,7 +0,0 @@ -#include <math.h> - -float -fmaxf (float _x, float _y) -{ - return (( isgreaterequal(_x, _y) || __isnanf (_y)) ? _x : _y ); -} diff --git a/winsup/mingw/mingwex/math/fmaxl.c b/winsup/mingw/mingwex/math/fmaxl.c deleted file mode 100644 index 4e38da476..000000000 --- a/winsup/mingw/mingwex/math/fmaxl.c +++ /dev/null @@ -1,7 +0,0 @@ -#include <math.h> - -long double -fmaxl (long double _x, long double _y) -{ - return (( isgreaterequal(_x, _y) || __isnanl (_y)) ? _x : _y ); -} diff --git a/winsup/mingw/mingwex/math/fmin.c b/winsup/mingw/mingwex/math/fmin.c deleted file mode 100644 index 96a6ed111..000000000 --- a/winsup/mingw/mingwex/math/fmin.c +++ /dev/null @@ -1,7 +0,0 @@ -#include <math.h> - -double -fmin (double _x, double _y) -{ - return ((islessequal(_x, _y) || __isnan (_y)) ? _x : _y ); -} diff --git a/winsup/mingw/mingwex/math/fminf.c b/winsup/mingw/mingwex/math/fminf.c deleted file mode 100644 index f3d71480d..000000000 --- a/winsup/mingw/mingwex/math/fminf.c +++ /dev/null @@ -1,7 +0,0 @@ -#include <math.h> - -float -fminf (float _x, float _y) -{ - return ((islessequal(_x, _y) || _isnan (_y)) ? _x : _y ); -} diff --git a/winsup/mingw/mingwex/math/fminl.c b/winsup/mingw/mingwex/math/fminl.c deleted file mode 100644 index d8a3fea2c..000000000 --- a/winsup/mingw/mingwex/math/fminl.c +++ /dev/null @@ -1,7 +0,0 @@ -#include <math.h> - -long double -fminl (long double _x, long double _y) -{ - return ((islessequal(_x, _y) || __isnanl (_y)) ? _x : _y ); -} diff --git a/winsup/mingw/mingwex/math/fmodf.c b/winsup/mingw/mingwex/math/fmodf.c deleted file mode 100644 index 6405d725f..000000000 --- a/winsup/mingw/mingwex/math/fmodf.c +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Written by J.T. Conklin <jtc@netbsd.org>. - * Public domain. - * - * Adapted for float type by Danny Smith - * <dannysmith@users.sourceforge.net>. - */ - -#include <math.h> - -float -fmodf (float x, float y) -{ - float res; - - asm ("1:\tfprem\n\t" - "fstsw %%ax\n\t" - "sahf\n\t" - "jp 1b\n\t" - "fstp %%st(1)" - : "=t" (res) : "0" (x), "u" (y) : "ax", "st(1)"); - return res; -} diff --git a/winsup/mingw/mingwex/math/fmodl.c b/winsup/mingw/mingwex/math/fmodl.c deleted file mode 100644 index f1c97f10b..000000000 --- a/winsup/mingw/mingwex/math/fmodl.c +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Written by J.T. Conklin <jtc@netbsd.org>. - * Public domain. - * - * Adapted for `long double' by Ulrich Drepper <drepper@cygnus.com>. - */ - -#include <math.h> - -long double -fmodl (long double x, long double y) -{ - long double res; - - asm ("1:\tfprem\n\t" - "fstsw %%ax\n\t" - "sahf\n\t" - "jp 1b\n\t" - "fstp %%st(1)" - : "=t" (res) : "0" (x), "u" (y) : "ax", "st(1)"); - return res; -} diff --git a/winsup/mingw/mingwex/math/fp_consts.c b/winsup/mingw/mingwex/math/fp_consts.c deleted file mode 100644 index 285c9d7dc..000000000 --- a/winsup/mingw/mingwex/math/fp_consts.c +++ /dev/null @@ -1,14 +0,0 @@ - -#include "fp_consts.h" -const union _ieee_rep __QNAN = { __DOUBLE_QNAN_REP }; -const union _ieee_rep __SNAN = { __DOUBLE_SNAN_REP }; -const union _ieee_rep __INF = { __DOUBLE_INF_REP }; -const union _ieee_rep __DENORM = { __DOUBLE_DENORM_REP }; - -/* ISO C99 */ -#undef nan -/* FIXME */ -double nan (const char * tagp __attribute__((unused)) ) - { return __QNAN.double_val; } - - diff --git a/winsup/mingw/mingwex/math/fp_consts.h b/winsup/mingw/mingwex/math/fp_consts.h deleted file mode 100644 index 249339501..000000000 --- a/winsup/mingw/mingwex/math/fp_consts.h +++ /dev/null @@ -1,48 +0,0 @@ -#ifndef _FP_CONSTS_H -#define _FP_CONSTS_H - -/* -According to IEEE 754 a QNaN has exponent bits of all 1 values and -initial significand bit of 1. A SNaN has has an exponent of all 1 -values and initial significand bit of 0 (with one or more other -significand bits of 1). An Inf has significand of 0 and -exponent of all 1 values. A denormal value has all exponent bits of 0. - -The following does _not_ follow those rules, but uses values -equal to those exported from MS C++ runtime lib, msvcprt.dll -for float and double. MSVC however, does not have long doubles. -*/ - - -#define __DOUBLE_INF_REP { 0, 0, 0, 0x7ff0 } -#define __DOUBLE_QNAN_REP { 0, 0, 0, 0xfff8 } /* { 0, 0, 0, 0x7ff8 } */ -#define __DOUBLE_SNAN_REP { 0, 0, 0, 0xfff0 } /* { 1, 0, 0, 0x7ff0 } */ -#define __DOUBLE_DENORM_REP {1, 0, 0, 0} - -#define D_NAN_MASK 0x7ff0000000000000LL /* this will mask NaN's and Inf's */ - -#define __FLOAT_INF_REP { 0, 0x7f80 } -#define __FLOAT_QNAN_REP { 0, 0xffc0 } /* { 0, 0x7fc0 } */ -#define __FLOAT_SNAN_REP { 0, 0xff80 } /* { 1, 0x7f80 } */ -#define __FLOAT_DENORM_REP {1,0} - -#define F_NAN_MASK 0x7f800000 - -/* - This assumes no implicit (hidden) bit in extended mode. - Padded to 96 bits - */ -#define __LONG_DOUBLE_INF_REP { 0, 0, 0, 0x8000, 0x7fff, 0 } -#define __LONG_DOUBLE_QNAN_REP { 0, 0, 0, 0xc000, 0xffff, 0 } -#define __LONG_DOUBLE_SNAN_REP { 0, 0, 0, 0x8000, 0xffff, 0 } -#define __LONG_DOUBLE_DENORM_REP {1, 0, 0, 0, 0, 0} - -union _ieee_rep -{ - unsigned short rep[6]; - float float_val; - double double_val; - long double ldouble_val; -} ; - -#endif diff --git a/winsup/mingw/mingwex/math/fp_constsf.c b/winsup/mingw/mingwex/math/fp_constsf.c deleted file mode 100644 index 5a4afef2b..000000000 --- a/winsup/mingw/mingwex/math/fp_constsf.c +++ /dev/null @@ -1,12 +0,0 @@ -#include "fp_consts.h" - -const union _ieee_rep __QNANF = { __FLOAT_QNAN_REP }; -const union _ieee_rep __SNANF = { __FLOAT_SNAN_REP }; -const union _ieee_rep __INFF = { __FLOAT_INF_REP }; -const union _ieee_rep __DENORMF = { __FLOAT_DENORM_REP }; - -/* ISO C99 */ -#undef nanf -/* FIXME */ -float nanf(const char * tagp __attribute__((unused)) ) - { return __QNANF.float_val;} diff --git a/winsup/mingw/mingwex/math/fp_constsl.c b/winsup/mingw/mingwex/math/fp_constsl.c deleted file mode 100644 index 44fdb7fd3..000000000 --- a/winsup/mingw/mingwex/math/fp_constsl.c +++ /dev/null @@ -1,12 +0,0 @@ -#include "fp_consts.h" - -const union _ieee_rep __QNANL = { __LONG_DOUBLE_QNAN_REP }; -const union _ieee_rep __SNANL = { __LONG_DOUBLE_SNAN_REP }; -const union _ieee_rep __INFL = { __LONG_DOUBLE_INF_REP }; -const union _ieee_rep __DENORML = { __LONG_DOUBLE_DENORM_REP }; - - -#undef nanl -/* FIXME */ -long double nanl (const char * tagp __attribute__((unused)) ) - { return __QNANL.ldouble_val; } diff --git a/winsup/mingw/mingwex/math/fpclassify.c b/winsup/mingw/mingwex/math/fpclassify.c deleted file mode 100644 index f8cd8cb44..000000000 --- a/winsup/mingw/mingwex/math/fpclassify.c +++ /dev/null @@ -1,20 +0,0 @@ -#include <math.h> - -/* 'fxam' sets FPU flags C3,C2,C0 'fstsw' stores: - FP_NAN 001 0x0100 - FP_NORMAL 010 0x0400 - FP_INFINITE 011 0x0500 - FP_ZERO 100 0x4000 - FP_SUBNORMAL 110 0x4400 - -and sets C1 flag (signbit) if neg */ - -int __fpclassify (double _x){ - unsigned short sw; - __asm__ ( - "fxam; fstsw %%ax;" - : "=a" (sw) - : "t" (_x) - ); - return sw & (FP_NAN | FP_NORMAL | FP_ZERO ); -} diff --git a/winsup/mingw/mingwex/math/fpclassifyf.c b/winsup/mingw/mingwex/math/fpclassifyf.c deleted file mode 100644 index aca4e59f1..000000000 --- a/winsup/mingw/mingwex/math/fpclassifyf.c +++ /dev/null @@ -1,10 +0,0 @@ -#include <math.h> -int __fpclassifyf (float _x){ - unsigned short sw; - __asm__ ( - "fxam; fstsw %%ax;" - : "=a" (sw) - : "t" (_x) - ); - return sw & (FP_NAN | FP_NORMAL | FP_ZERO ); -} diff --git a/winsup/mingw/mingwex/math/fpclassifyl.c b/winsup/mingw/mingwex/math/fpclassifyl.c deleted file mode 100644 index 9979d6278..000000000 --- a/winsup/mingw/mingwex/math/fpclassifyl.c +++ /dev/null @@ -1,10 +0,0 @@ -#include <math.h> -int __fpclassifyl (long double _x){ - unsigned short sw; - __asm__ ( - "fxam; fstsw %%ax;" - : "=a" (sw) - : "t" (_x) - ); - return sw & (FP_NAN | FP_NORMAL | FP_ZERO ); -} diff --git a/winsup/mingw/mingwex/math/frexpf.c b/winsup/mingw/mingwex/math/frexpf.c deleted file mode 100644 index df262abc5..000000000 --- a/winsup/mingw/mingwex/math/frexpf.c +++ /dev/null @@ -1,3 +0,0 @@ -#include <math.h> -float frexpf (float x, int* expn) - {return (float)frexp(x, expn);} diff --git a/winsup/mingw/mingwex/math/frexpl.S b/winsup/mingw/mingwex/math/frexpl.S deleted file mode 100644 index 2b691c87f..000000000 --- a/winsup/mingw/mingwex/math/frexpl.S +++ /dev/null @@ -1,71 +0,0 @@ -/* - Cephes Math Library Release 2.7: May, 1998 - Copyright 1984, 1987, 1988, 1992, 1998 by Stephen L. Moshier - - Extracted from floorl.387 for use in libmingwex.a by - Danny Smith <dannysmith@users.sourceforge.net> - 2002-06-20 -*/ - -/* - * frexpl(long double x, int* expnt) extracts the exponent from x. - * It returns an integer power of two to expnt and the significand - * between 0.5 and 1 to y. Thus x = y * 2**expn. - */ - .align 2 -.globl _frexpl -_frexpl: - pushl %ebp - movl %esp,%ebp - subl $24,%esp - pushl %esi - pushl %ebx - fldt 8(%ebp) - movl 20(%ebp),%ebx - fld %st(0) - fstpt -12(%ebp) - leal -4(%ebp),%ecx - movw -4(%ebp),%dx - andl $32767,%edx - jne L25 - fldz - fucompp - fnstsw %ax - andb $68,%ah - xorb $64,%ah - jne L21 - movl $0,(%ebx) - fldz - jmp L24 - .align 2,0x90 - .align 2,0x90 -L21: - fldt -12(%ebp) - fadd %st(0),%st - fstpt -12(%ebp) - decl %edx - movw (%ecx),%si - andl $32767,%esi - jne L22 - cmpl $-66,%edx - jg L21 -L22: - addl %esi,%edx - jmp L19 - .align 2,0x90 -L25: - fstp %st(0) -L19: - addl $-16382,%edx - movl %edx,(%ebx) - movw (%ecx),%ax - andl $-32768,%eax - orl $16382,%eax - movw %ax,(%ecx) - fldt -12(%ebp) -L24: - leal -32(%ebp),%esp - popl %ebx - popl %esi - leave - ret diff --git a/winsup/mingw/mingwex/math/fucom.c b/winsup/mingw/mingwex/math/fucom.c deleted file mode 100644 index 80c937262..000000000 --- a/winsup/mingw/mingwex/math/fucom.c +++ /dev/null @@ -1,11 +0,0 @@ -int -__fp_unordered_compare (long double x, long double y){ - unsigned short retval; - __asm__ ( - "fucom %%st(1);" - "fnstsw;" - : "=a" (retval) - : "t" (x), "u" (y) - ); - return retval; -} diff --git a/winsup/mingw/mingwex/math/hypotf.c b/winsup/mingw/mingwex/math/hypotf.c deleted file mode 100644 index ee67a45dc..000000000 --- a/winsup/mingw/mingwex/math/hypotf.c +++ /dev/null @@ -1,4 +0,0 @@ -#include <math.h> - -float hypotf (float x, float y) - { return (float) _hypot (x, y);} diff --git a/winsup/mingw/mingwex/math/hypotl.c b/winsup/mingw/mingwex/math/hypotl.c deleted file mode 100644 index 2a25b82c3..000000000 --- a/winsup/mingw/mingwex/math/hypotl.c +++ /dev/null @@ -1,73 +0,0 @@ -#include <math.h> -#include <float.h> -#include <errno.h> - -/* -This implementation is based largely on Cephes library -function cabsl (cmplxl.c), which bears the following notice: - -Cephes Math Library Release 2.1: January, 1989 -Copyright 1984, 1987, 1989 by Stephen L. Moshier -Direct inquiries to 30 Frost Street, Cambridge, MA 02140 -*/ - -/* - Modified for use in libmingwex.a - 02 Sept 2002 Danny Smith <dannysmith@users.sourceforege.net> - Calls to ldexpl replaced by logbl and calls to frexpl replaced - by scalbnl to avoid duplicated range checks. -*/ - -extern long double __INFL; -#define PRECL 32 - -long double -hypotl (long double x, long double y) -{ - int exx; - int eyy; - int scale; - long double xx =fabsl(x); - long double yy =fabsl(y); - if (!isfinite(xx) || !isfinite(yy)) - return xx + yy; /* Return INF or NAN. */ - - if (xx == 0.0L) - return yy; - if (yy == 0.0L) - return xx; - - /* Get exponents */ - exx = logbl (xx); - eyy = logbl (yy); - - /* Check if large differences in scale */ - scale = exx - eyy; - if ( scale > PRECL) - return xx; - if ( scale < -PRECL) - return yy; - - /* Exponent of approximate geometric mean (x 2) */ - scale = (exx + eyy) >> 1; - - /* Rescale: Geometric mean is now about 2 */ - x = scalbnl(xx, -scale); - y = scalbnl(yy, -scale); - - xx = sqrtl(x * x + y * y); - - /* Check for overflow and underflow */ - exx = logbl(xx); - exx += scale; - if (exx > LDBL_MAX_EXP) - { - errno = ERANGE; - return __INFL; - } - if (exx < LDBL_MIN_EXP) - return 0.0L; - - /* Undo scaling */ - return (scalbnl (xx, scale)); -} diff --git a/winsup/mingw/mingwex/math/ilogb.S b/winsup/mingw/mingwex/math/ilogb.S deleted file mode 100644 index 2335b5146..000000000 --- a/winsup/mingw/mingwex/math/ilogb.S +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Written by J.T. Conklin <jtc@netbsd.org>. - * Public domain. - */ - - - .file "ilogb.S" - .text - .align 4 -.globl _ilogb - .def _ilogb; .scl 2; .type 32; .endef -_ilogb: - - fldl 4(%esp) -/* I added the following ugly construct because ilogb(+-Inf) is - required to return INT_MAX in ISO C99. - -- jakub@redhat.com. */ - fxam /* Is NaN or +-Inf? */ - fstsw %ax - movb $0x45, %dh - andb %ah, %dh - cmpb $0x05, %dh - je 1f /* Is +-Inf, jump. */ - - fxtract - pushl %eax - fstp %st - - fistpl (%esp) - fwait - popl %eax - - ret - -1: fstp %st - movl $0x7fffffff, %eax - ret diff --git a/winsup/mingw/mingwex/math/ilogbf.S b/winsup/mingw/mingwex/math/ilogbf.S deleted file mode 100644 index fa3e78e84..000000000 --- a/winsup/mingw/mingwex/math/ilogbf.S +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Written by J.T. Conklin <jtc@netbsd.org>. - * Public domain. - */ - - .file "ilogbf.S" - .text - .align 4 -.globl _ilogbf - .def _ilogbf; .scl 2; .type 32; .endef -_ilogbf: - flds 4(%esp) -/* I added the following ugly construct because ilogb(+-Inf) is - required to return INT_MAX in ISO C99. - -- jakub@redhat.com. */ - fxam /* Is NaN or +-Inf? */ - fstsw %ax - movb $0x45, %dh - andb %ah, %dh - cmpb $0x05, %dh - je 1f /* Is +-Inf, jump. */ - - fxtract - pushl %eax - fstp %st - - fistpl (%esp) - fwait - popl %eax - - ret - -1: fstp %st - movl $0x7fffffff, %eax - ret diff --git a/winsup/mingw/mingwex/math/ilogbl.S b/winsup/mingw/mingwex/math/ilogbl.S deleted file mode 100644 index b9dc6ea72..000000000 --- a/winsup/mingw/mingwex/math/ilogbl.S +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Written by J.T. Conklin <jtc@netbsd.org>. - * Changes for long double by Ulrich Drepper <drepper@cygnus.com> - * Public domain. - */ - - .file "ilogbl.S" - .text - .align 4 -.globl _ilogbl - .def _ilogbl; .scl 2; .type 32; .endef -_ilogbl: - fldt 4(%esp) -/* I added the following ugly construct because ilogb(+-Inf) is - required to return INT_MAX in ISO C99. - -- jakub@redhat.com. */ - fxam /* Is NaN or +-Inf? */ - fstsw %ax - movb $0x45, %dh - andb %ah, %dh - cmpb $0x05, %dh - je 1f /* Is +-Inf, jump. */ - - fxtract - pushl %eax - fstp %st - - fistpl (%esp) - fwait - popl %eax - - ret - -1: fstp %st - movl $0x7fffffff, %eax - ret diff --git a/winsup/mingw/mingwex/math/isnan.c b/winsup/mingw/mingwex/math/isnan.c deleted file mode 100644 index b38bc290e..000000000 --- a/winsup/mingw/mingwex/math/isnan.c +++ /dev/null @@ -1,14 +0,0 @@ -#include <math.h> - -int -__isnan (double _x) -{ - unsigned short _sw; - __asm__ ("fxam;" - "fstsw %%ax": "=a" (_sw) : "t" (_x)); - return (_sw & (FP_NAN | FP_NORMAL | FP_INFINITE | FP_ZERO | FP_SUBNORMAL)) - == FP_NAN; -} - -#undef isnan -int __attribute__ ((alias ("__isnan"))) isnan (double); diff --git a/winsup/mingw/mingwex/math/isnanf.c b/winsup/mingw/mingwex/math/isnanf.c deleted file mode 100644 index 73fe0eb02..000000000 --- a/winsup/mingw/mingwex/math/isnanf.c +++ /dev/null @@ -1,12 +0,0 @@ -#include <math.h> -int -__isnanf (float _x) -{ - unsigned short _sw; - __asm__ ("fxam;" - "fstsw %%ax": "=a" (_sw) : "t" (_x) ); - return (_sw & (FP_NAN | FP_NORMAL | FP_INFINITE | FP_ZERO | FP_SUBNORMAL)) - == FP_NAN; -} - -int __attribute__ ((alias ("__isnanf"))) isnanf (float); diff --git a/winsup/mingw/mingwex/math/isnanl.c b/winsup/mingw/mingwex/math/isnanl.c deleted file mode 100644 index 86d0088b4..000000000 --- a/winsup/mingw/mingwex/math/isnanl.c +++ /dev/null @@ -1,13 +0,0 @@ -#include <math.h> - -int -__isnanl (long double _x) -{ - unsigned short _sw; - __asm__ ("fxam;" - "fstsw %%ax": "=a" (_sw) : "t" (_x)); - return (_sw & (FP_NAN | FP_NORMAL | FP_INFINITE | FP_ZERO | FP_SUBNORMAL)) - == FP_NAN; -} - -int __attribute__ ((alias ("__isnanl"))) isnanl (long double); diff --git a/winsup/mingw/mingwex/math/ldexpf.c b/winsup/mingw/mingwex/math/ldexpf.c deleted file mode 100644 index 5d01a0184..000000000 --- a/winsup/mingw/mingwex/math/ldexpf.c +++ /dev/null @@ -1,3 +0,0 @@ -#include <math.h> -float ldexpf (float x, int expn) - {return (float) ldexp (x, expn);} diff --git a/winsup/mingw/mingwex/math/ldexpl.c b/winsup/mingw/mingwex/math/ldexpl.c deleted file mode 100644 index 19a3d56e3..000000000 --- a/winsup/mingw/mingwex/math/ldexpl.c +++ /dev/null @@ -1,19 +0,0 @@ -#include <math.h> -#include <errno.h> - -long double ldexpl(long double x, int expn) -{ - long double res; - if (!isfinite (x) || x == 0.0L) - return x; - - __asm__ ("fscale" - : "=t" (res) - : "0" (x), "u" ((long double) expn)); - - if (!isfinite (res) || res == 0.0L) - errno = ERANGE; - - return res; -} - diff --git a/winsup/mingw/mingwex/math/lgamma.c b/winsup/mingw/mingwex/math/lgamma.c deleted file mode 100644 index b569f9adc..000000000 --- a/winsup/mingw/mingwex/math/lgamma.c +++ /dev/null @@ -1,369 +0,0 @@ -/* lgam() - * - * Natural logarithm of gamma function - * - * - * - * SYNOPSIS: - * - * double x, y, __lgamma_r(); - * int* sgngam; - * y = __lgamma_r( x, sgngam ); - * - * double x, y, lgamma(); - * y = lgamma( x); - * - * - * - * DESCRIPTION: - * - * Returns the base e (2.718...) logarithm of the absolute - * value of the gamma function of the argument. In the reentrant - * version, the sign (+1 or -1) of the gamma function is returned - * in the variable referenced by sgngam. - * - * For arguments greater than 13, the logarithm of the gamma - * function is approximated by the logarithmic version of - * Stirling's formula using a polynomial approximation of - * degree 4. Arguments between -33 and +33 are reduced by - * recurrence to the interval [2,3] of a rational approximation. - * The cosecant reflection formula is employed for arguments - * less than -33. - * - * Arguments greater than MAXLGM return MAXNUM and an error - * message. MAXLGM = 2.035093e36 for DEC - * arithmetic or 2.556348e305 for IEEE arithmetic. - * - * - * - * ACCURACY: - * - * - * arithmetic domain # trials peak rms - * DEC 0, 3 7000 5.2e-17 1.3e-17 - * DEC 2.718, 2.035e36 5000 3.9e-17 9.9e-18 - * IEEE 0, 3 28000 5.4e-16 1.1e-16 - * IEEE 2.718, 2.556e305 40000 3.5e-16 8.3e-17 - * The error criterion was relative when the function magnitude - * was greater than one but absolute when it was less than one. - * - * The following test used the relative error criterion, though - * at certain points the relative error could be much higher than - * indicated. - * IEEE -200, -4 10000 4.8e-16 1.3e-16 - * - */ - -/* - * Cephes Math Library Release 2.8: June, 2000 - * Copyright 1984, 1987, 1989, 1992, 2000 by Stephen L. Moshier - */ - -/* - * 26-11-2002 Modified for mingw. - * Danny Smith <dannysmith@users.sourceforge.net> - */ - - -#ifndef __MINGW32__ -#include "mconf.h" -#ifdef ANSIPROT -extern double pow ( double, double ); -extern double log ( double ); -extern double exp ( double ); -extern double sin ( double ); -extern double polevl ( double, void *, int ); -extern double p1evl ( double, void *, int ); -extern double floor ( double ); -extern double fabs ( double ); -extern int isnan ( double ); -extern int isfinite ( double ); -#else -double pow(), log(), exp(), sin(), polevl(), p1evl(), floor(), fabs(); -int isnan(), isfinite(); -#endif -#ifdef INFINITIES -extern double INFINITY; -#endif -#ifdef NANS -extern double NAN; -#endif -#else /* __MINGW32__ */ -#include "cephes_mconf.h" -#endif /* __MINGW32__ */ - - -/* A[]: Stirling's formula expansion of log gamma - * B[], C[]: log gamma function between 2 and 3 - */ -#ifdef UNK -static double A[] = { - 8.11614167470508450300E-4, --5.95061904284301438324E-4, - 7.93650340457716943945E-4, --2.77777777730099687205E-3, - 8.33333333333331927722E-2 -}; -static double B[] = { --1.37825152569120859100E3, --3.88016315134637840924E4, --3.31612992738871184744E5, --1.16237097492762307383E6, --1.72173700820839662146E6, --8.53555664245765465627E5 -}; -static double C[] = { -/* 1.00000000000000000000E0, */ --3.51815701436523470549E2, --1.70642106651881159223E4, --2.20528590553854454839E5, --1.13933444367982507207E6, --2.53252307177582951285E6, --2.01889141433532773231E6 -}; -/* log( sqrt( 2*pi ) ) */ -static double LS2PI = 0.91893853320467274178; -#define MAXLGM 2.556348e305 -static double LOGPI = 1.14472988584940017414; -#endif - -#ifdef DEC -static const unsigned short A[] = { -0035524,0141201,0034633,0031405, -0135433,0176755,0126007,0045030, -0035520,0006371,0003342,0172730, -0136066,0005540,0132605,0026407, -0037252,0125252,0125252,0125132 -}; -static const unsigned short B[] = { -0142654,0044014,0077633,0035410, -0144027,0110641,0125335,0144760, -0144641,0165637,0142204,0047447, -0145215,0162027,0146246,0155211, -0145322,0026110,0010317,0110130, -0145120,0061472,0120300,0025363 -}; -static const unsigned short C[] = { -/*0040200,0000000,0000000,0000000*/ -0142257,0164150,0163630,0112622, -0143605,0050153,0156116,0135272, -0144527,0056045,0145642,0062332, -0145213,0012063,0106250,0001025, -0145432,0111254,0044577,0115142, -0145366,0071133,0050217,0005122 -}; -/* log( sqrt( 2*pi ) ) */ -static const unsigned short LS2P[] = {040153,037616,041445,0172645,}; -#define LS2PI *(double *)LS2P -#define MAXLGM 2.035093e36 -static const unsigned short LPI[4] = { -0040222,0103202,0043475,0006750, -}; -#define LOGPI *(double *)LPI - -#endif - -#ifdef IBMPC -static const unsigned short A[] = { -0x6661,0x2733,0x9850,0x3f4a, -0xe943,0xb580,0x7fbd,0xbf43, -0x5ebb,0x20dc,0x019f,0x3f4a, -0xa5a1,0x16b0,0xc16c,0xbf66, -0x554b,0x5555,0x5555,0x3fb5 -}; -static const unsigned short B[] = { -0x6761,0x8ff3,0x8901,0xc095, -0xb93e,0x355b,0xf234,0xc0e2, -0x89e5,0xf890,0x3d73,0xc114, -0xdb51,0xf994,0xbc82,0xc131, -0xf20b,0x0219,0x4589,0xc13a, -0x055e,0x5418,0x0c67,0xc12a -}; -static const unsigned short C[] = { -/*0x0000,0x0000,0x0000,0x3ff0,*/ -0x12b2,0x1cf3,0xfd0d,0xc075, -0xd757,0x7b89,0xaa0d,0xc0d0, -0x4c9b,0xb974,0xeb84,0xc10a, -0x0043,0x7195,0x6286,0xc131, -0xf34c,0x892f,0x5255,0xc143, -0xe14a,0x6a11,0xce4b,0xc13e -}; -/* log( sqrt( 2*pi ) ) */ -static const union -{ - unsigned short s[4]; - double d; -} ls2p = {{0xbeb5,0xc864,0x67f1,0x3fed}}; -#define LS2PI (ls2p.d) -#define MAXLGM 2.556348e305 -/* log (pi) */ -static const union -{ - unsigned short s[4]; - double d; -} lpi = {{0xa1bd,0x48e7,0x50d0,0x3ff2}}; -#define LOGPI (lpi.d) -#endif - -#ifdef MIEEE -static const unsigned short A[] = { -0x3f4a,0x9850,0x2733,0x6661, -0xbf43,0x7fbd,0xb580,0xe943, -0x3f4a,0x019f,0x20dc,0x5ebb, -0xbf66,0xc16c,0x16b0,0xa5a1, -0x3fb5,0x5555,0x5555,0x554b -}; -static const unsigned short B[] = { -0xc095,0x8901,0x8ff3,0x6761, -0xc0e2,0xf234,0x355b,0xb93e, -0xc114,0x3d73,0xf890,0x89e5, -0xc131,0xbc82,0xf994,0xdb51, -0xc13a,0x4589,0x0219,0xf20b, -0xc12a,0x0c67,0x5418,0x055e -}; -static const unsigned short C[] = { -0xc075,0xfd0d,0x1cf3,0x12b2, -0xc0d0,0xaa0d,0x7b89,0xd757, -0xc10a,0xeb84,0xb974,0x4c9b, -0xc131,0x6286,0x7195,0x0043, -0xc143,0x5255,0x892f,0xf34c, -0xc13e,0xce4b,0x6a11,0xe14a -}; -/* log( sqrt( 2*pi ) ) */ -static const union -{ - unsigned short s[4]; - double d; -} ls2p = {{0x3fed,0x67f1,0xc864,0xbeb5}}; -#define LS2PI ls2p.d -#define MAXLGM 2.556348e305 -/* log (pi) */ -static const union -{ - unsigned short s[4]; - double d; -} lpi = {{0x3ff2, 0x50d0, 0x48e7, 0xa1bd}}; -#define LOGPI (lpi.d) -#endif - - -/* Logarithm of gamma function */ -/* Reentrant version */ - -double __lgamma_r(double x, int* sgngam) -{ -double p, q, u, w, z; -int i; - -*sgngam = 1; -#ifdef NANS -if( isnan(x) ) - return(x); -#endif - -#ifdef INFINITIES -if( !isfinite(x) ) - return(INFINITY); -#endif - -if( x < -34.0 ) - { - q = -x; - w = __lgamma_r(q, sgngam); /* note this modifies sgngam! */ - p = floor(q); - if( p == q ) - { -lgsing: - _SET_ERRNO(EDOM); - mtherr( "lgam", SING ); -#ifdef INFINITIES - return (INFINITY); -#else - return (MAXNUM); -#endif - } - i = p; - if( (i & 1) == 0 ) - *sgngam = -1; - else - *sgngam = 1; - z = q - p; - if( z > 0.5 ) - { - p += 1.0; - z = p - q; - } - z = q * sin( PI * z ); - if( z == 0.0 ) - goto lgsing; -/* z = log(PI) - log( z ) - w;*/ - z = LOGPI - log( z ) - w; - return( z ); - } - -if( x < 13.0 ) - { - z = 1.0; - p = 0.0; - u = x; - while( u >= 3.0 ) - { - p -= 1.0; - u = x + p; - z *= u; - } - while( u < 2.0 ) - { - if( u == 0.0 ) - goto lgsing; - z /= u; - p += 1.0; - u = x + p; - } - if( z < 0.0 ) - { - *sgngam = -1; - z = -z; - } - else - *sgngam = 1; - if( u == 2.0 ) - return( log(z) ); - p -= 2.0; - x = x + p; - p = x * polevl( x, B, 5 ) / p1evl( x, C, 6); - return( log(z) + p ); - } - -if( x > MAXLGM ) - { - _SET_ERRNO(ERANGE); - mtherr( "lgamma", OVERFLOW ); -#ifdef INFINITIES - return( *sgngam * INFINITY ); -#else - return( *sgngam * MAXNUM ); -#endif - } - -q = ( x - 0.5 ) * log(x) - x + LS2PI; -if( x > 1.0e8 ) - return( q ); - -p = 1.0/(x*x); -if( x >= 1000.0 ) - q += (( 7.9365079365079365079365e-4 * p - - 2.7777777777777777777778e-3) *p - + 0.0833333333333333333333) / x; -else - q += polevl( p, A, 4 ) / x; -return( q ); -} - -/* This is the C99 version */ - -double lgamma(double x) -{ - int local_sgngam=0; - return (__lgamma_r(x, &local_sgngam)); -} diff --git a/winsup/mingw/mingwex/math/lgammaf.c b/winsup/mingw/mingwex/math/lgammaf.c deleted file mode 100644 index 20982f999..000000000 --- a/winsup/mingw/mingwex/math/lgammaf.c +++ /dev/null @@ -1,253 +0,0 @@ -/* lgamf() - * - * Natural logarithm of gamma function - * - * - * - * SYNOPSIS: - * - * float x, y, __lgammaf_r(); - * int* sgngamf; - * y = __lgammaf_r( x, sgngamf ); - * - * float x, y, lgammaf(); - * y = lgammaf( x); - * - * - * - * DESCRIPTION: - * - * Returns the base e (2.718...) logarithm of the absolute - * value of the gamma function of the argument. In the reentrant - * version the sign (+1 or -1) of the gamma function is returned in - * variable referenced by sgngamf. - * - * For arguments greater than 6.5, the logarithm of the gamma - * function is approximated by the logarithmic version of - * Stirling's formula. Arguments between 0 and +6.5 are reduced by - * by recurrence to the interval [.75,1.25] or [1.5,2.5] of a rational - * approximation. The cosecant reflection formula is employed for - * arguments less than zero. - * - * Arguments greater than MAXLGM = 2.035093e36 return MAXNUM and an - * error message. - * - * - * - * ACCURACY: - * - * - * - * arithmetic domain # trials peak rms - * IEEE -100,+100 500,000 7.4e-7 6.8e-8 - * The error criterion was relative when the function magnitude - * was greater than one but absolute when it was less than one. - * The routine has low relative error for positive arguments. - * - * The following test used the relative error criterion. - * IEEE -2, +3 100000 4.0e-7 5.6e-8 - * - */ - - -/* - Cephes Math Library Release 2.7: July, 1998 - Copyright 1984, 1987, 1989, 1992, 1998 by Stephen L. Moshier -*/ - -/* - 26-11-2002 Modified for mingw. - Danny Smith <dannysmith@users.sourceforge.net> -*/ - - -/* log gamma(x+2), -.5 < x < .5 */ -static const float B[] = { - 6.055172732649237E-004, --1.311620815545743E-003, - 2.863437556468661E-003, --7.366775108654962E-003, - 2.058355474821512E-002, --6.735323259371034E-002, - 3.224669577325661E-001, - 4.227843421859038E-001 -}; - -/* log gamma(x+1), -.25 < x < .25 */ -static const float C[] = { - 1.369488127325832E-001, --1.590086327657347E-001, - 1.692415923504637E-001, --2.067882815621965E-001, - 2.705806208275915E-001, --4.006931650563372E-001, - 8.224670749082976E-001, --5.772156501719101E-001 -}; - -/* log( sqrt( 2*pi ) ) */ -static const float LS2PI = 0.91893853320467274178; -#define MAXLGM 2.035093e36 -static const float PIINV = 0.318309886183790671538; - -#ifndef __MINGW32__ -#include "mconf.h" -float floorf(float); -float polevlf( float, float *, int ); -float p1evlf( float, float *, int ); -#else -#include "cephes_mconf.h" -#endif - -/* Reentrant version */ -/* Logarithm of gamma function */ - -float __lgammaf_r( float x, int* sgngamf ) -{ -float p, q, w, z; -float nx, tx; -int i, direction; - -*sgngamf = 1; -#ifdef NANS -if( isnan(x) ) - return(x); -#endif - -#ifdef INFINITIES -if( !isfinite(x) ) - return(x); -#endif - - -if( x < 0.0 ) - { - q = -x; - w = __lgammaf_r(q, sgngamf); /* note this modifies sgngam! */ - p = floorf(q); - if( p == q ) - { -lgsing: - _SET_ERRNO(EDOM); - mtherr( "lgamf", SING ); -#ifdef INFINITIES - return (INFINITYF); -#else - return( *sgngamf * MAXNUMF ); -#endif - } - i = p; - if( (i & 1) == 0 ) - *sgngamf = -1; - else - *sgngamf = 1; - z = q - p; - if( z > 0.5 ) - { - p += 1.0; - z = p - q; - } - z = q * sinf( PIF * z ); - if( z == 0.0 ) - goto lgsing; - z = -logf( PIINV*z ) - w; - return( z ); - } - -if( x < 6.5 ) - { - direction = 0; - z = 1.0; - tx = x; - nx = 0.0; - if( x >= 1.5 ) - { - while( tx > 2.5 ) - { - nx -= 1.0; - tx = x + nx; - z *=tx; - } - x += nx - 2.0; -iv1r5: - p = x * polevlf( x, B, 7 ); - goto cont; - } - if( x >= 1.25 ) - { - z *= x; - x -= 1.0; /* x + 1 - 2 */ - direction = 1; - goto iv1r5; - } - if( x >= 0.75 ) - { - x -= 1.0; - p = x * polevlf( x, C, 7 ); - q = 0.0; - goto contz; - } - while( tx < 1.5 ) - { - if( tx == 0.0 ) - goto lgsing; - z *=tx; - nx += 1.0; - tx = x + nx; - } - direction = 1; - x += nx - 2.0; - p = x * polevlf( x, B, 7 ); - -cont: - if( z < 0.0 ) - { - *sgngamf = -1; - z = -z; - } - else - { - *sgngamf = 1; - } - q = logf(z); - if( direction ) - q = -q; -contz: - return( p + q ); - } - -if( x > MAXLGM ) - { - _SET_ERRNO(ERANGE); - mtherr( "lgamf", OVERFLOW ); -#ifdef INFINITIES - return( *sgngamf * INFINITYF ); -#else - return( *sgngamf * MAXNUMF ); -#endif - - } - -/* Note, though an asymptotic formula could be used for x >= 3, - * there is cancellation error in the following if x < 6.5. */ -q = LS2PI - x; -q += ( x - 0.5 ) * logf(x); - -if( x <= 1.0e4 ) - { - z = 1.0/x; - p = z * z; - q += (( 6.789774945028216E-004 * p - - 2.769887652139868E-003 ) * p - + 8.333316229807355E-002 ) * z; - } -return( q ); -} - -/* This is the C99 version */ - -float lgammaf(float x) -{ - int local_sgngamf=0; - return (__lgammaf_r(x, &local_sgngamf)); -} diff --git a/winsup/mingw/mingwex/math/lgammal.c b/winsup/mingw/mingwex/math/lgammal.c deleted file mode 100644 index d2b306afd..000000000 --- a/winsup/mingw/mingwex/math/lgammal.c +++ /dev/null @@ -1,416 +0,0 @@ -/* lgaml() - * - * Natural logarithm of gamma function - * - * - * - * SYNOPSIS: - * - * long double x, y, __lgammal_r(); - * int* sgngaml; - * y = __lgammal_r( x, sgngaml ); - * - * long double x, y, lgammal(); - * y = lgammal( x); - * - * - * - * DESCRIPTION: - * - * Returns the base e (2.718...) logarithm of the absolute - * value of the gamma function of the argument. In the reentrant - * version, the sign (+1 or -1) of the gamma function is returned - * in the variable referenced by sgngaml. - * - * For arguments greater than 33, the logarithm of the gamma - * function is approximated by the logarithmic version of - * Stirling's formula using a polynomial approximation of - * degree 4. Arguments between -33 and +33 are reduced by - * recurrence to the interval [2,3] of a rational approximation. - * The cosecant reflection formula is employed for arguments - * less than -33. - * - * Arguments greater than MAXLGML (10^4928) return MAXNUML. - * - * - * - * ACCURACY: - * - * - * arithmetic domain # trials peak rms - * IEEE -40, 40 100000 2.2e-19 4.6e-20 - * IEEE 10^-2000,10^+2000 20000 1.6e-19 3.3e-20 - * The error criterion was relative when the function magnitude - * was greater than one but absolute when it was less than one. - * - */ - -/* - * Copyright 1994 by Stephen L. Moshier - */ - -/* - * 26-11-2002 Modified for mingw. - * Danny Smith <dannysmith@users.sourceforge.net> - */ - -#ifndef __MINGW32__ -#include "mconf.h" -#ifdef ANSIPROT -extern long double fabsl ( long double ); -extern long double lgaml ( long double ); -extern long double logl ( long double ); -extern long double expl ( long double ); -extern long double gammal ( long double ); -extern long double sinl ( long double ); -extern long double floorl ( long double ); -extern long double powl ( long double, long double ); -extern long double polevll ( long double, void *, int ); -extern long double p1evll ( long double, void *, int ); -extern int isnanl ( long double ); -extern int isfinitel ( long double ); -#else -long double fabsl(), lgaml(), logl(), expl(), gammal(), sinl(); -long double floorl(), powl(), polevll(), p1evll(), isnanl(), isfinitel(); -#endif -#ifdef INFINITIES -extern long double INFINITYL; -#endif -#ifdef NANS -extern long double NANL; -#endif -#else /* __MINGW32__ */ -#include "cephes_mconf.h" -#endif /* __MINGW32__ */ - -#if UNK -static long double S[9] = { --1.193945051381510095614E-3L, - 7.220599478036909672331E-3L, --9.622023360406271645744E-3L, --4.219773360705915470089E-2L, - 1.665386113720805206758E-1L, --4.200263503403344054473E-2L, --6.558780715202540684668E-1L, - 5.772156649015328608253E-1L, - 1.000000000000000000000E0L, -}; -#endif -#if IBMPC -static const unsigned short S[] = { -0xbaeb,0xd6d3,0x25e5,0x9c7e,0xbff5, XPD -0xfe9a,0xceb4,0xc74e,0xec9a,0x3ff7, XPD -0x9225,0xdfef,0xb0e9,0x9da5,0xbff8, XPD -0x10b0,0xec17,0x87dc,0xacd7,0xbffa, XPD -0x6b8d,0x7515,0x1905,0xaa89,0x3ffc, XPD -0xf183,0x126b,0xf47d,0xac0a,0xbffa, XPD -0x7bf6,0x57d1,0xa013,0xa7e7,0xbffe, XPD -0xc7a9,0x7db0,0x67e3,0x93c4,0x3ffe, XPD -0x0000,0x0000,0x0000,0x8000,0x3fff, XPD -}; -#endif -#if MIEEE -static long S[27] = { -0xbff50000,0x9c7e25e5,0xd6d3baeb, -0x3ff70000,0xec9ac74e,0xceb4fe9a, -0xbff80000,0x9da5b0e9,0xdfef9225, -0xbffa0000,0xacd787dc,0xec1710b0, -0x3ffc0000,0xaa891905,0x75156b8d, -0xbffa0000,0xac0af47d,0x126bf183, -0xbffe0000,0xa7e7a013,0x57d17bf6, -0x3ffe0000,0x93c467e3,0x7db0c7a9, -0x3fff0000,0x80000000,0x00000000, -}; -#endif - -#if UNK -static long double SN[9] = { - 1.133374167243894382010E-3L, - 7.220837261893170325704E-3L, - 9.621911155035976733706E-3L, --4.219773343731191721664E-2L, --1.665386113944413519335E-1L, --4.200263503402112910504E-2L, - 6.558780715202536547116E-1L, - 5.772156649015328608727E-1L, --1.000000000000000000000E0L, -}; -#endif -#if IBMPC -static const unsigned SN[] = { -0x5dd1,0x02de,0xb9f7,0x948d,0x3ff5, XPD -0x989b,0xdd68,0xc5f1,0xec9c,0x3ff7, XPD -0x2ca1,0x18f0,0x386f,0x9da5,0x3ff8, XPD -0x783f,0x41dd,0x87d1,0xacd7,0xbffa, XPD -0x7a5b,0xd76d,0x1905,0xaa89,0xbffc, XPD -0x7f64,0x1234,0xf47d,0xac0a,0xbffa, XPD -0x5e26,0x57d1,0xa013,0xa7e7,0x3ffe, XPD -0xc7aa,0x7db0,0x67e3,0x93c4,0x3ffe, XPD -0x0000,0x0000,0x0000,0x8000,0xbfff, XPD -}; -#endif -#if MIEEE -static long SN[27] = { -0x3ff50000,0x948db9f7,0x02de5dd1, -0x3ff70000,0xec9cc5f1,0xdd68989b, -0x3ff80000,0x9da5386f,0x18f02ca1, -0xbffa0000,0xacd787d1,0x41dd783f, -0xbffc0000,0xaa891905,0xd76d7a5b, -0xbffa0000,0xac0af47d,0x12347f64, -0x3ffe0000,0xa7e7a013,0x57d15e26, -0x3ffe0000,0x93c467e3,0x7db0c7aa, -0xbfff0000,0x80000000,0x00000000, -}; -#endif - - -/* A[]: Stirling's formula expansion of log gamma - * B[], C[]: log gamma function between 2 and 3 - */ - - -/* log gamma(x) = ( x - 0.5 ) * log(x) - x + LS2PI + 1/x A(1/x^2) - * x >= 8 - * Peak relative error 1.51e-21 - * Relative spread of error peaks 5.67e-21 - */ -#if UNK -static long double A[7] = { - 4.885026142432270781165E-3L, --1.880801938119376907179E-3L, - 8.412723297322498080632E-4L, --5.952345851765688514613E-4L, - 7.936507795855070755671E-4L, --2.777777777750349603440E-3L, - 8.333333333333331447505E-2L, -}; -#endif -#if IBMPC -static const unsigned short A[] = { -0xd984,0xcc08,0x91c2,0xa012,0x3ff7, XPD -0x3d91,0x0304,0x3da1,0xf685,0xbff5, XPD -0x3bdc,0xaad1,0xd492,0xdc88,0x3ff4, XPD -0x8b20,0x9fce,0x844e,0x9c09,0xbff4, XPD -0xf8f2,0x30e5,0x0092,0xd00d,0x3ff4, XPD -0x4d88,0x03a8,0x60b6,0xb60b,0xbff6, XPD -0x9fcc,0xaaaa,0xaaaa,0xaaaa,0x3ffb, XPD -}; -#endif -#if MIEEE -static long A[21] = { -0x3ff70000,0xa01291c2,0xcc08d984, -0xbff50000,0xf6853da1,0x03043d91, -0x3ff40000,0xdc88d492,0xaad13bdc, -0xbff40000,0x9c09844e,0x9fce8b20, -0x3ff40000,0xd00d0092,0x30e5f8f2, -0xbff60000,0xb60b60b6,0x03a84d88, -0x3ffb0000,0xaaaaaaaa,0xaaaa9fcc, -}; -#endif - -/* log gamma(x+2) = x B(x)/C(x) - * 0 <= x <= 1 - * Peak relative error 7.16e-22 - * Relative spread of error peaks 4.78e-20 - */ -#if UNK -static long double B[7] = { --2.163690827643812857640E3L, --8.723871522843511459790E4L, --1.104326814691464261197E6L, --6.111225012005214299996E6L, --1.625568062543700591014E7L, --2.003937418103815175475E7L, --8.875666783650703802159E6L, -}; -static long double C[7] = { -/* 1.000000000000000000000E0L,*/ --5.139481484435370143617E2L, --3.403570840534304670537E4L, --6.227441164066219501697E5L, --4.814940379411882186630E6L, --1.785433287045078156959E7L, --3.138646407656182662088E7L, --2.099336717757895876142E7L, -}; -#endif -#if IBMPC -static const unsigned short B[] = { -0x9557,0x4995,0x0da1,0x873b,0xc00a, XPD -0xfe44,0x9af8,0x5b8c,0xaa63,0xc00f, XPD -0x5aa8,0x7cf5,0x3684,0x86ce,0xc013, XPD -0x259a,0x258c,0xf206,0xba7f,0xc015, XPD -0xbe18,0x1ca3,0xc0a0,0xf80a,0xc016, XPD -0x168f,0x2c42,0x6717,0x98e3,0xc017, XPD -0x2051,0x9d55,0x92c8,0x876e,0xc016, XPD -}; -static const unsigned short C[] = { -/*0x0000,0x0000,0x0000,0x8000,0x3fff, XPD*/ -0xaa77,0xcf2f,0xae76,0x807c,0xc008, XPD -0xb280,0x0d74,0xb55a,0x84f3,0xc00e, XPD -0xa505,0xcd30,0x81dc,0x9809,0xc012, XPD -0x3369,0x4246,0xb8c2,0x92f0,0xc015, XPD -0x63cf,0x6aee,0xbe6f,0x8837,0xc017, XPD -0x26bb,0xccc7,0xb009,0xef75,0xc017, XPD -0x462b,0xbae8,0xab96,0xa02a,0xc017, XPD -}; -#endif -#if MIEEE -static long B[21] = { -0xc00a0000,0x873b0da1,0x49959557, -0xc00f0000,0xaa635b8c,0x9af8fe44, -0xc0130000,0x86ce3684,0x7cf55aa8, -0xc0150000,0xba7ff206,0x258c259a, -0xc0160000,0xf80ac0a0,0x1ca3be18, -0xc0170000,0x98e36717,0x2c42168f, -0xc0160000,0x876e92c8,0x9d552051, -}; -static long C[21] = { -/*0x3fff0000,0x80000000,0x00000000,*/ -0xc0080000,0x807cae76,0xcf2faa77, -0xc00e0000,0x84f3b55a,0x0d74b280, -0xc0120000,0x980981dc,0xcd30a505, -0xc0150000,0x92f0b8c2,0x42463369, -0xc0170000,0x8837be6f,0x6aee63cf, -0xc0170000,0xef75b009,0xccc726bb, -0xc0170000,0xa02aab96,0xbae8462b, -}; -#endif - -/* log( sqrt( 2*pi ) ) */ -static const long double LS2PI = 0.91893853320467274178L; -#define MAXLGM 1.04848146839019521116e+4928L - - -/* Logarithm of gamma function */ -/* Reentrant version */ - -long double __lgammal_r(long double x, int* sgngaml) -{ -long double p, q, w, z, f, nx; -int i; - -*sgngaml = 1; -#ifdef NANS -if( isnanl(x) ) - return(NANL); -#endif -#ifdef INFINITIES -if( !isfinitel(x) ) - return(INFINITYL); -#endif -if( x < -34.0L ) - { - q = -x; - w = __lgammal_r(q, sgngaml); /* note this modifies sgngam! */ - p = floorl(q); - if( p == q ) - { -lgsing: - _SET_ERRNO(EDOM); - mtherr( "lgammal", SING ); -#ifdef INFINITIES - return (INFINITYL); -#else - return (MAXNUML); -#endif - } - i = p; - if( (i & 1) == 0 ) - *sgngaml = -1; - else - *sgngaml = 1; - z = q - p; - if( z > 0.5L ) - { - p += 1.0L; - z = p - q; - } - z = q * sinl( PIL * z ); - if( z == 0.0L ) - goto lgsing; -/* z = LOGPI - logl( z ) - w; */ - z = logl( PIL/z ) - w; - return( z ); - } - -if( x < 13.0L ) - { - z = 1.0L; - nx = floorl( x + 0.5L ); - f = x - nx; - while( x >= 3.0L ) - { - nx -= 1.0L; - x = nx + f; - z *= x; - } - while( x < 2.0L ) - { - if( fabsl(x) <= 0.03125 ) - goto lsmall; - z /= nx + f; - nx += 1.0L; - x = nx + f; - } - if( z < 0.0L ) - { - *sgngaml = -1; - z = -z; - } - else - *sgngaml = 1; - if( x == 2.0L ) - return( logl(z) ); - x = (nx - 2.0L) + f; - p = x * polevll( x, B, 6 ) / p1evll( x, C, 7); - return( logl(z) + p ); - } - -if( x > MAXLGM ) - { - _SET_ERRNO(ERANGE); - mtherr( "lgammal", OVERFLOW ); -#ifdef INFINITIES - return( *sgngaml * INFINITYL ); -#else - return( *sgngaml * MAXNUML ); -#endif - } - -q = ( x - 0.5L ) * logl(x) - x + LS2PI; -if( x > 1.0e10L ) - return(q); -p = 1.0L/(x*x); -q += polevll( p, A, 6 ) / x; -return( q ); - - -lsmall: -if( x == 0.0L ) - goto lgsing; -if( x < 0.0L ) - { - x = -x; - q = z / (x * polevll( x, SN, 8 )); - } -else - q = z / (x * polevll( x, S, 8 )); -if( q < 0.0L ) - { - *sgngaml = -1; - q = -q; - } -else - *sgngaml = 1; -q = logl( q ); -return(q); -} - -/* This is the C99 version */ - -long double lgammal(long double x) -{ - int local_sgngaml=0; - return (__lgammal_r(x, &local_sgngaml)); -} diff --git a/winsup/mingw/mingwex/math/llrint.c b/winsup/mingw/mingwex/math/llrint.c deleted file mode 100644 index b6d9f3273..000000000 --- a/winsup/mingw/mingwex/math/llrint.c +++ /dev/null @@ -1,10 +0,0 @@ -#include <math.h> - -long long llrint (double x) -{ - long long retval; - __asm__ __volatile__ \ - ("fistpll %0" : "=m" (retval) : "t" (x) : "st"); \ - return retval; -} - diff --git a/winsup/mingw/mingwex/math/llrintf.c b/winsup/mingw/mingwex/math/llrintf.c deleted file mode 100644 index 7fa67dbdf..000000000 --- a/winsup/mingw/mingwex/math/llrintf.c +++ /dev/null @@ -1,9 +0,0 @@ -#include <math.h> - -long long llrintf (float x) -{ - long long retval; - __asm__ __volatile__ \ - ("fistpll %0" : "=m" (retval) : "t" (x) : "st"); \ - return retval; -} diff --git a/winsup/mingw/mingwex/math/llrintl.c b/winsup/mingw/mingwex/math/llrintl.c deleted file mode 100644 index 948d96265..000000000 --- a/winsup/mingw/mingwex/math/llrintl.c +++ /dev/null @@ -1,10 +0,0 @@ -#include <math.h> - -long long llrintl (long double x) -{ - long long retval; - __asm__ __volatile__ \ - ("fistpll %0" : "=m" (retval) : "t" (x) : "st"); \ - return retval; -} - diff --git a/winsup/mingw/mingwex/math/log10f.S b/winsup/mingw/mingwex/math/log10f.S deleted file mode 100644 index 64838143a..000000000 --- a/winsup/mingw/mingwex/math/log10f.S +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Written by J.T. Conklin <jtc@netbsd.org>. - * Public domain. - * Adapted for float type by Ulrich Drepper <drepper@cygnus.com>. - * - * Changed to use fyl2xp1 for values near 1, <drepper@cygnus.com>. - */ - - .file "log10f.S" - .text - .align 4 -one: .double 1.0 - /* It is not important that this constant is precise. It is only - a value which is known to be on the safe side for using the - fyl2xp1 instruction. */ -limit: .double 0.29 - - .text - .align 4 -.globl _log10f - .def _log10f; .scl 2; .type 32; .endef -_log10f: - fldlg2 /* log10(2) */ - flds 4(%esp) /* x : log10(2) */ - fxam - fnstsw - fld %st /* x : x : log10(2) */ - sahf - jc 3f /* in case x is NaN or ±Inf */ -4: fsubl one /* x-1 : x : log10(2) */ - fld %st /* x-1 : x-1 : x : log10(2) */ - fabs /* |x-1| : x-1 : x : log10(2) */ - fcompl limit /* x-1 : x : log10(2) */ - fnstsw /* x-1 : x : log10(2) */ - andb $0x45, %ah - jz 2f - fstp %st(1) /* x-1 : log10(2) */ - fyl2xp1 /* log10(x) */ - ret - -2: fstp %st(0) /* x : log10(2) */ - fyl2x /* log10(x) */ - ret - -3: jp 4b /* in case x is ±Inf */ - fstp %st(1) - fstp %st(1) - ret diff --git a/winsup/mingw/mingwex/math/log10l.S b/winsup/mingw/mingwex/math/log10l.S deleted file mode 100644 index 46f6b980c..000000000 --- a/winsup/mingw/mingwex/math/log10l.S +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Written by J.T. Conklin <jtc@netbsd.org>. - * Public domain. - * - * Adapted for `long double' by Ulrich Drepper <drepper@cygnus.com>. - * - * Changed to use fyl2xp1 for values near 1, <drepper@cygnus.com>. - * - * Removed header file dependency for use in libmingwex.a by - * Danny Smith <dannysmith@users.sourceforge.net> - */ - - .file "log10l.S" - .text - .align 4 -one: .double 1.0 - /* It is not important that this constant is precise. It is only - a value which is known to be on the safe side for using the - fyl2xp1 instruction. */ -limit: .double 0.29 - - .text - .align 4 -.globl _log10l - .def _log10l; .scl 2; .type 32; .endef -_log10l: - fldlg2 /* log10(2) */ - fldt 4(%esp) /* x : log10(2) */ - fxam - fnstsw - fld %st /* x : x : log10(2) */ - sahf - jc 3f /* in case x is NaN or ±Inf */ -4: fsubl one /* x-1 : x : log10(2) */ - fld %st /* x-1 : x-1 : x : log10(2) */ - fabs /* |x-1| : x-1 : x : log10(2) */ - fcompl limit /* x-1 : x : log10(2) */ - fnstsw /* x-1 : x : log10(2) */ - andb $0x45, %ah - jz 2f - fstp %st(1) /* x-1 : log10(2) */ - fyl2xp1 /* log10(x) */ - ret - -2: fstp %st(0) /* x : log10(2) */ - fyl2x /* log10(x) */ - ret - -3: jp 4b /* in case x is ±Inf */ - fstp %st(1) - fstp %st(1) - ret diff --git a/winsup/mingw/mingwex/math/log1p.S b/winsup/mingw/mingwex/math/log1p.S deleted file mode 100644 index 12e223c8c..000000000 --- a/winsup/mingw/mingwex/math/log1p.S +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Written by J.T. Conklin <jtc@netbsd.org>. - * Public domain. - * Removed header file dependency for use in libmingwex.a by - * Danny Smith <dannysmith@users.sourceforge.net> - */ - - .file "log1p.S" - .text - .align 4 - /* The fyl2xp1 can only be used for values in - -1 + sqrt(2) / 2 <= x <= 1 - sqrt(2) / 2 - 0.29 is a safe value. - */ -limit: .double 0.29 -one: .double 1.0 -/* - * Use the fyl2xp1 function when the argument is in the range -0.29 to 0.29, - * otherwise fyl2x with the needed extra computation. - */ -.globl _log1p; - .def _log1p; .scl 2; .type 32; .endef -_log1p: - fldln2 - fldl 4(%esp) - fxam - fnstsw - fld %st - sahf - jc 3f /* in case x is NaN or ±Inf */ - -4: fabs - fcompl limit - fnstsw - sahf - jc 2f - faddl one - fyl2x - ret - -2: fyl2xp1 - ret - -3: jp 4b /* in case x is ±Inf */ - fstp %st(1) - fstp %st(1) - ret diff --git a/winsup/mingw/mingwex/math/log1pf.S b/winsup/mingw/mingwex/math/log1pf.S deleted file mode 100644 index b5b1acb7e..000000000 --- a/winsup/mingw/mingwex/math/log1pf.S +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Written by J.T. Conklin <jtc@netbsd.org>. - * Public domain. - * Removed header file dependency for use in libmingwex.a by - * Danny Smith <dannysmith@users.sourceforge.net> - */ - - .file "log1pf.S" - .text - .align 4 - /* The fyl2xp1 can only be used for values in - -1 + sqrt(2) / 2 <= x <= 1 - sqrt(2) / 2 - 0.29 is a safe value. - */ -limit: .float 0.29 -one: .float 1.0 -/* - * Use the fyl2xp1 function when the argument is in the range -0.29 to 0.29, - * otherwise fyl2x with the needed extra computation. - */ -.globl _log1pf; - .def _log1pf; .scl 2; .type 32; .endef -_log1pf: - fldln2 - flds 4(%esp) - fxam - fnstsw - fld %st - sahf - jc 3f /* in case x is NaN or ±Inf */ - -4: fabs - fcomps limit - fnstsw - sahf - jc 2f - fadds one - fyl2x - ret - -2: fyl2xp1 - ret - -3: jp 4b /* in case x is ±Inf */ - fstp %st(1) - fstp %st(1) - ret diff --git a/winsup/mingw/mingwex/math/log1pl.S b/winsup/mingw/mingwex/math/log1pl.S deleted file mode 100644 index 158d8ae58..000000000 --- a/winsup/mingw/mingwex/math/log1pl.S +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Written by J.T. Conklin <jtc@netbsd.org>. - * Public domain. - * - * Adapted for `long double' by Ulrich Drepper <drepper@cygnus.com>. -* Removed header file dependency for use in libmingwex.a by - * Danny Smith <dannysmith@users.sourceforge.net> - */ - - .file "log1pl.S" - .text - .align 4 - /* The fyl2xp1 can only be used for values in - -1 + sqrt(2) / 2 <= x <= 1 - sqrt(2) / 2 - 0.29 is a safe value. - */ -limit: .tfloat 0.29 - /* Please note: we use a double value here. Since 1.0 has - an exact representation this does not effect the accuracy - but it helps to optimize the code. */ -one: .double 1.0 - -/* - * Use the fyl2xp1 function when the argument is in the range -0.29 to 0.29, - * otherwise fyl2x with the needed extra computation. - */ -.globl _log1pl; - .def _log1pl; .scl 2; .type 32; .endef -_log1pl: - fldln2 - fldt 4(%esp) - fxam - fnstsw - fld %st - sahf - jc 3f /* in case x is NaN or ±Inf */ -4: - fabs - fldt limit - fcompp - fnstsw - sahf - jnc 2f - faddl one - fyl2x - ret - -2: fyl2xp1 - ret - -3: jp 4b /* in case x is ±Inf */ - fstp %st(1) - fstp %st(1) - ret diff --git a/winsup/mingw/mingwex/math/log2.S b/winsup/mingw/mingwex/math/log2.S deleted file mode 100644 index 68e7fc7f5..000000000 --- a/winsup/mingw/mingwex/math/log2.S +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Written by J.T. Conklin <jtc@netbsd.org>. - * Adapted for use as log2 by Ulrich Drepper <drepper@cygnus.com>. - * Public domain. - * - * Changed to use fyl2xp1 for values near 1, <drepper@cygnus.com>. - * - * Removed header file dependency for use in libmingwex.a by - * Danny Smith <dannysmith@users.sourceforge.net> - */ - - .file "log2.S" - .text - .align 4 -one: .double 1.0 - /* It is not important that this constant is precise. It is only - a value which is known to be on the safe side for using the - fyl2xp1 instruction. */ -limit: .double 0.29 - - .text - .align 4 -.globl _log2 - .def _log2; .scl 2; .type 32; .endef -_log2: - fldl one - fldl 4(%esp) /* x : 1 */ - fxam - fnstsw - fld %st /* x : x : 1 */ - sahf - jc 3f /* in case x is NaN or ±Inf */ -4: fsub %st(2), %st /* x-1 : x : 1 */ - fld %st /* x-1 : x-1 : x : 1 */ - fabs /* |x-1| : x-1 : x : 1 */ - fcompl limit /* x-1 : x : 1 */ - fnstsw /* x-1 : x : 1 */ - andb $0x45, %ah - jz 2f - fstp %st(1) /* x-1 : 1 */ - fyl2xp1 /* log(x) */ - ret - -2: fstp %st(0) /* x : 1 */ - fyl2x /* log(x) */ - ret - -3: jp 4b /* in case x is ±Inf */ - fstp %st(1) - fstp %st(1) - ret diff --git a/winsup/mingw/mingwex/math/log2f.S b/winsup/mingw/mingwex/math/log2f.S deleted file mode 100644 index 900e26ded..000000000 --- a/winsup/mingw/mingwex/math/log2f.S +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Written by J.T. Conklin <jtc@netbsd.org>. - * Adapted for use as log2 by Ulrich Drepper <drepper@cygnus.com>. - * Public domain. - * - * Changed to use fyl2xp1 for values near 1, <drepper@cygnus.com>. - * - * Removed header file dependency for use in libmingwex.a by - * Danny Smith <dannysmith@users.sourceforge.net> - */ - - .file "log2f.S" - .text - .align 4 -one: .double 1.0 - /* It is not important that this constant is precise. It is only - a value which is known to be on the safe side for using the - fyl2xp1 instruction. */ -limit: .double 0.29 - - .text - .align 4 -.globl _log2f - .def _log2f; .scl 2; .type 32; .endef -_log2f: - fldl one - flds 4(%esp) /* x : 1 */ - fxam - fnstsw - fld %st /* x : x : 1 */ - sahf - jc 3f /* in case x is NaN or ±Inf */ -4: fsub %st(2), %st /* x-1 : x : 1 */ - fld %st /* x-1 : x-1 : x : 1 */ - fabs /* |x-1| : x-1 : x : 1 */ - fcompl limit /* x-1 : x : 1 */ - fnstsw /* x-1 : x : 1 */ - andb $0x45, %ah - jz 2f - fstp %st(1) /* x-1 : 1 */ - fyl2xp1 /* log(x) */ - ret - -2: fstp %st(0) /* x : 1 */ - fyl2x /* log(x) */ - ret - -3: jp 4b /* in case x is ±Inf */ - fstp %st(1) - fstp %st(1) - ret diff --git a/winsup/mingw/mingwex/math/log2l.S b/winsup/mingw/mingwex/math/log2l.S deleted file mode 100644 index 0ad56966e..000000000 --- a/winsup/mingw/mingwex/math/log2l.S +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Written by J.T. Conklin <jtc@netbsd.org>. - * Adapted for use as log2 by Ulrich Drepper <drepper@cygnus.com>. - * Public domain. - * - * Changed to use fyl2xp1 for values near 1, <drepper@cygnus.com>. - */ - - .file "log2l.S" - .text - .align 4 -one: .double 1.0 - /* It is not important that this constant is precise. It is only - a value which is known to be on the safe side for using the - fyl2xp1 instruction. */ -limit: .double 0.29 - - .text - .align 4 -.globl _log2l - .def _log2l; .scl 2; .type 32; .endef -_log2l: - fldl one - fldt 4(%esp) /* x : 1 */ - fxam - fnstsw - fld %st /* x : x : 1 */ - sahf - jc 3f /* in case x is NaN or ±Inf */ -4: fsub %st(2), %st /* x-1 : x : 1 */ - fld %st /* x-1 : x-1 : x : 1 */ - fabs /* |x-1| : x-1 : x : 1 */ - fcompl limit /* x-1 : x : 1 */ - fnstsw /* x-1 : x : 1 */ - andb $0x45, %ah - jz 2f - fstp %st(1) /* x-1 : 1 */ - fyl2xp1 /* log(x) */ - ret - -2: fstp %st(0) /* x : 1 */ - fyl2x /* log(x) */ - ret - -3: jp 4b /* in case x is ±Inf */ - fstp %st(1) - fstp %st(1) - ret diff --git a/winsup/mingw/mingwex/math/logb.c b/winsup/mingw/mingwex/math/logb.c deleted file mode 100644 index cdff13647..000000000 --- a/winsup/mingw/mingwex/math/logb.c +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Written by J.T. Conklin <jtc@netbsd.org>. - * Changes for long double by Ulrich Drepper <drepper@cygnus.com> - * Public domain. - */ - -#include <math.h> - -double -logb (double x) -{ - double res; - asm ("fxtract\n\t" - "fstp %%st" : "=t" (res) : "0" (x)); - return res; -} diff --git a/winsup/mingw/mingwex/math/logbf.c b/winsup/mingw/mingwex/math/logbf.c deleted file mode 100644 index b5f57d2e1..000000000 --- a/winsup/mingw/mingwex/math/logbf.c +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Written by J.T. Conklin <jtc@netbsd.org>. - * Changes for long double by Ulrich Drepper <drepper@cygnus.com> - * Public domain. - */ - -#include <math.h> - -float -logbf (float x) -{ - float res; - asm ("fxtract\n\t" - "fstp %%st" : "=t" (res) : "0" (x)); - return res; -} diff --git a/winsup/mingw/mingwex/math/logbl.c b/winsup/mingw/mingwex/math/logbl.c deleted file mode 100644 index f1448eb99..000000000 --- a/winsup/mingw/mingwex/math/logbl.c +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Written by J.T. Conklin <jtc@netbsd.org>. - * Changes for long double by Ulrich Drepper <drepper@cygnus.com> - * Public domain. - */ - -#include <math.h> - -long double -logbl (long double x) -{ - long double res; - - asm ("fxtract\n\t" - "fstp %%st" : "=t" (res) : "0" (x)); - return res; -} diff --git a/winsup/mingw/mingwex/math/logf.S b/winsup/mingw/mingwex/math/logf.S deleted file mode 100644 index d59fe580d..000000000 --- a/winsup/mingw/mingwex/math/logf.S +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Written by J.T. Conklin <jtc@netbsd.org>. - * Public domain. - * Adapted for float by Ulrich Drepper <drepper@cygnus.com>. - * - * Changed to use fyl2xp1 for values near 1, <drepper@cygnus.com>. - */ - - .file "logf.S" - .text - .align 4 -one: .double 1.0 - /* It is not important that this constant is precise. It is only - a value which is known to be on the safe side for using the - fyl2xp1 instruction. */ -limit: .double 0.29 - - .text - .align 4 -.globl _logf - .def _logf; .scl 2; .type 32; .endef -_logf: - fldln2 /* log(2) */ - flds 4(%esp) /* x : log(2) */ - fld %st /* x : x : log(2) */ - fsubl one /* x-1 : x : log(2) */ - fld %st /* x-1 : x-1 : x : log(2) */ - fabs /* |x-1| : x-1 : x : log(2) */ - fcompl limit /* x-1 : x : log(2) */ - fnstsw /* x-1 : x : log(2) */ - andb $0x45, %ah - jz 2f - fstp %st(1) /* x-1 : log(2) */ - fyl2xp1 /* log(x) */ - ret - -2: fstp %st(0) /* x : log(2) */ - fyl2x /* log(x) */ - ret diff --git a/winsup/mingw/mingwex/math/logl.S b/winsup/mingw/mingwex/math/logl.S deleted file mode 100644 index 75a282fea..000000000 --- a/winsup/mingw/mingwex/math/logl.S +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Written by J.T. Conklin <jtc@netbsd.org>. - * Public domain. - * - * Adapted for `long double' by Ulrich Drepper <drepper@cygnus.com>. - * - * Removed header file dependency for use in libmingwex.a by - * Danny Smith <dannysmith@users.sourceforge.net> - */ - .file "logl.S" - .text - .align 4 -one: .double 1.0 - /* It is not important that this constant is precise. It is only - a value which is known to be on the safe side for using the - fyl2xp1 instruction. */ -limit: .double 0.29 - - .text - .align 4 -.globl _logl - .def _logl; .scl 2; .type 32; .endef -_logl: - fldln2 /* log(2) */ - fldt 4(%esp) /* x : log(2) */ - fld %st /* x : x : log(2) */ - fsubl one /* x-1 : x : log(2) */ - fld %st /* x-1 : x-1 : x : log(2) */ - fabs /* |x-1| : x-1 : x : log(2) */ - fcompl limit /* x-1 : x : log(2) */ - fnstsw /* x-1 : x : log(2) */ - andb $0x45, %ah - jz 2f - fstp %st(1) /* x-1 : log(2) */ - fyl2xp1 /* log(x) */ - ret - -2: fstp %st(0) /* x : log(2) */ - fyl2x /* log(x) */ - ret diff --git a/winsup/mingw/mingwex/math/lrint.c b/winsup/mingw/mingwex/math/lrint.c deleted file mode 100644 index 7dfa233a8..000000000 --- a/winsup/mingw/mingwex/math/lrint.c +++ /dev/null @@ -1,9 +0,0 @@ -#include <math.h> - -long lrint (double x) -{ - long retval; - __asm__ __volatile__ \ - ("fistpl %0" : "=m" (retval) : "t" (x) : "st"); \ - return retval; -} diff --git a/winsup/mingw/mingwex/math/lrintf.c b/winsup/mingw/mingwex/math/lrintf.c deleted file mode 100644 index 24b7a7d07..000000000 --- a/winsup/mingw/mingwex/math/lrintf.c +++ /dev/null @@ -1,9 +0,0 @@ -#include <math.h> - -long lrintf (float x) -{ - long retval; - __asm__ __volatile__ \ - ("fistpl %0" : "=m" (retval) : "t" (x) : "st"); \ - return retval; -} diff --git a/winsup/mingw/mingwex/math/lrintl.c b/winsup/mingw/mingwex/math/lrintl.c deleted file mode 100644 index f55599332..000000000 --- a/winsup/mingw/mingwex/math/lrintl.c +++ /dev/null @@ -1,10 +0,0 @@ -#include <math.h> - -long lrintl (long double x) -{ - long retval; - __asm__ __volatile__ \ - ("fistpl %0" : "=m" (retval) : "t" (x) : "st"); \ - return retval; -} - diff --git a/winsup/mingw/mingwex/math/lround_generic.c b/winsup/mingw/mingwex/math/lround_generic.c deleted file mode 100644 index e0056a665..000000000 --- a/winsup/mingw/mingwex/math/lround_generic.c +++ /dev/null @@ -1,64 +0,0 @@ -/* - * lround_generic.c - * - * $Id$ - * - * Provides a generic implementation for the `lround()', `lroundf()', - * `lroundl()', `llround()', `llroundf()' and `llroundl()' functions; - * compile with `-D FUNCTION=name', with `name' set to each of these - * six in turn, to create separate object files for each of the six - * functions. - * - * Written by Keith Marshall <keithmarshall@users.sourceforge.net> - * - * This is free software. You may redistribute and/or modify it as you - * see fit, without restriction of copyright. - * - * This software is provided "as is", in the hope that it may be useful, - * but WITHOUT WARRANTY OF ANY KIND, not even any implied warranty of - * MERCHANTABILITY, nor of FITNESS FOR ANY PARTICULAR PURPOSE. At no - * time will the author accept any form of liability for any damages, - * however caused, resulting from the use of this software. - * - */ -#ifndef FUNCTION -/* - * Normally specified with `-D FUNCTION=name', on the command line. - * Valid FUNCTION names are `lround', `lroundf', `lroundl', `llround' - * `llroundf' and `llroundl'; specifying anything else will most likely - * cause a compilation error. If user did not specify an appropriate - * FUNCTION name, default to `lround'. - */ -#define FUNCTION lround -#endif - -#include "round_internal.h" - -#include <limits.h> -#include <errno.h> - -/* Generic implementation. - * The user is required to specify the FUNCTION name; - * the RETURN_TYPE and INPUT_TYPE macros resolve to appropriate - * type declarations, to match the selected FUNCTION prototype, - * while RETURN_MAX and RETURN_MIN map to the correspondingly - * appropriate limits.h manifest values, to establish the - * valid range for the RETURN_TYPE. - */ -RETURN_TYPE FUNCTION( INPUT_TYPE x ) -{ - if( !isfinite( x ) || !isfinite( x = round_internal( x ) ) - || (x > MAX_RETURN_VALUE) || (x < MIN_RETURN_VALUE) ) - /* - * Undefined behaviour... - * POSIX requires us to report a domain error; ANSI C99 says we - * _may_ report a range error, and previous MinGW implementation - * set `errno = ERANGE' here; we change that, conforming to the - * stricter requiremment of the POSIX standard. - */ - errno = EDOM; - - return (RETURN_TYPE)(x); -} - -/* $RCSfile$$Revision$: end of file */ diff --git a/winsup/mingw/mingwex/math/modff.c b/winsup/mingw/mingwex/math/modff.c deleted file mode 100644 index 072faace0..000000000 --- a/winsup/mingw/mingwex/math/modff.c +++ /dev/null @@ -1,22 +0,0 @@ -#include <fenv.h> -#include <math.h> -#include <errno.h> -#define FE_ROUNDING_MASK \ - (FE_TONEAREST | FE_DOWNWARD | FE_UPWARD | FE_TOWARDZERO) - -float -modff (float value, float* iptr) -{ - float int_part; - unsigned short saved_cw; - unsigned short tmp_cw; - /* truncate */ - asm ("fnstcw %0;" : "=m" (saved_cw)); /* save control word */ - tmp_cw = (saved_cw & ~FE_ROUNDING_MASK) | FE_TOWARDZERO; - asm ("fldcw %0;" : : "m" (tmp_cw)); - asm ("frndint;" : "=t" (int_part) : "0" (value)); /* round */ - asm ("fldcw %0;" : : "m" (saved_cw)); /* restore saved cw */ - if (iptr) - *iptr = int_part; - return (isinf (value) ? 0.0F : value - int_part); -} diff --git a/winsup/mingw/mingwex/math/modfl.c b/winsup/mingw/mingwex/math/modfl.c deleted file mode 100644 index c7ea2cbce..000000000 --- a/winsup/mingw/mingwex/math/modfl.c +++ /dev/null @@ -1,22 +0,0 @@ -#include <fenv.h> -#include <math.h> -#include <errno.h> -#define FE_ROUNDING_MASK \ - (FE_TONEAREST | FE_DOWNWARD | FE_UPWARD | FE_TOWARDZERO) - -long double -modfl (long double value, long double* iptr) -{ - long double int_part; - unsigned short saved_cw; - unsigned short tmp_cw; - /* truncate */ - asm ("fnstcw %0;" : "=m" (saved_cw)); /* save control word */ - tmp_cw = (saved_cw & ~FE_ROUNDING_MASK) | FE_TOWARDZERO; - asm ("fldcw %0;" : : "m" (tmp_cw)); - asm ("frndint;" : "=t" (int_part) : "0" (value)); /* round */ - asm ("fldcw %0;" : : "m" (saved_cw)); /* restore saved cw */ - if (iptr) - *iptr = int_part; - return (isinf (value) ? 0.0L : value - int_part); -} diff --git a/winsup/mingw/mingwex/math/nearbyint.S b/winsup/mingw/mingwex/math/nearbyint.S deleted file mode 100644 index 9730aeebf..000000000 --- a/winsup/mingw/mingwex/math/nearbyint.S +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Written by J.T. Conklin <jtc@netbsd.org>. - * Public domain. - * - * Adapted for use as nearbyint by Ulrich Drepper <drepper@cygnus.com>. - * - * Removed header file dependency for use in libmingwex.a by - * Danny Smith <dannysmith@users.sourceforge.net> - */ - - .file "nearbyint.S" - .text - .align 4 -.globl _nearbyint - .def _nearbyint; .scl 2; .type 32; .endef -_nearbyint: - fldl 4(%esp) - pushl %eax - pushl %ecx - fnstcw (%esp) - movl (%esp), %eax - orl $0x20, %eax - movl %eax, 4(%esp) - fldcw 4(%esp) - frndint - fclex - fldcw (%esp) - popl %ecx - popl %eax - ret diff --git a/winsup/mingw/mingwex/math/nearbyintf.S b/winsup/mingw/mingwex/math/nearbyintf.S deleted file mode 100644 index 1c5734084..000000000 --- a/winsup/mingw/mingwex/math/nearbyintf.S +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Written by J.T. Conklin <jtc@netbsd.org>. - * Public domain. - * Adapted for use as nearbyint by Ulrich Drepper <drepper@cygnus.com>. - * - * Removed header file dependency for use in libmingwex.a by - * Danny Smith <dannysmith@users.sourceforge.net> - */ - - .file "nearbyintf.S" - .text - .align 4 -.globl _nearbyintf - .def _nearbyintf; .scl 2; .type 32; .endef -_nearbyintf: - flds 4(%esp) - pushl %eax - pushl %ecx - fnstcw (%esp) - movl (%esp), %eax - orl $0x20, %eax - movl %eax, 4(%esp) - fldcw 4(%esp) - frndint - fclex - fldcw (%esp) - popl %ecx - popl %eax - ret diff --git a/winsup/mingw/mingwex/math/nearbyintl.S b/winsup/mingw/mingwex/math/nearbyintl.S deleted file mode 100644 index 7dbc2a8b7..000000000 --- a/winsup/mingw/mingwex/math/nearbyintl.S +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Written by J.T. Conklin <jtc@netbsd.org>. - * Public domain. - * - * Adaptedfor use as nearbyint by Ulrich Drepper <drepper@cygnus.com>. - * - * Removed header file dependency for use in libmingwex.a by - * Danny Smith <dannysmith@users.sourceforge.net> - */ - - .file "nearbyintl.S" - .text - .align 4 -.globl _nearbyintl - .def _nearbyintl; .scl 2; .type 32; .endef -_nearbyintl: - fldt 4(%esp) - pushl %eax - pushl %ecx - fnstcw (%esp) - movl (%esp), %eax - orl $0x20, %eax - movl %eax, 4(%esp) - fldcw 4(%esp) - frndint - fclex - fldcw (%esp) - popl %ecx - popl %eax - ret diff --git a/winsup/mingw/mingwex/math/nextafterf.c b/winsup/mingw/mingwex/math/nextafterf.c deleted file mode 100644 index 47309a027..000000000 --- a/winsup/mingw/mingwex/math/nextafterf.c +++ /dev/null @@ -1,27 +0,0 @@ -#include <math.h> - -float -nextafterf (float x, float y) -{ - union - { - float f; - unsigned int i; - } u; - if (isnan (y) || isnan (x)) - return x + y; - if (x == y ) - /* nextafter (0.0, -O.0) should return -0.0. */ - return y; - u.f = x; - if (x == 0.0F) - { - u.i = 1; - return y > 0.0F ? u.f : -u.f; - } - if (((x > 0.0F) ^ (y > x)) == 0) - u.i++; - else - u.i--; - return u.f; -} diff --git a/winsup/mingw/mingwex/math/nextafterl.c b/winsup/mingw/mingwex/math/nextafterl.c deleted file mode 100755 index eaf6a3f03..000000000 --- a/winsup/mingw/mingwex/math/nextafterl.c +++ /dev/null @@ -1,65 +0,0 @@ -/* - nextafterl.c - Contributed by Danny Smith <dannysmith@users.sourceforge.net> - No copyright claimed, absolutely no warranties. - - 2005-05-09 -*/ - -#include <math.h> - -long double -nextafterl (long double x, long double y) -{ - union { - long double ld; - struct { - unsigned long long mantissa; - unsigned short expn; - unsigned short pad; - } __attribute__ ((packed)) parts; - } u; - - /* The normal bit is explicit for long doubles, unlike - float and double. */ - static const unsigned long long normal_bit = 0x8000000000000000ull; - - if (isnan (y) || isnan (x)) - return x + y; - - if (x == y ) - /* nextafter (0.0, -O.0) should return -0.0. */ - return y; - - u.ld = x; - if (x == 0.0L) - { - u.parts.mantissa = 1ull; - return y > 0.0L ? u.ld : -u.ld; - } - - if (((x > 0.0L) ^ (y > x)) == 0) - { - u.parts.mantissa++; - if ((u.parts.mantissa & ~normal_bit) == 0ull) - u.parts.expn++; - } - else - { - if ((u.parts.mantissa & ~normal_bit) == 0ull) - u.parts.expn--; - u.parts.mantissa--; - } - - /* If we have updated the expn of a normal number, - or moved from denormal to normal, [re]set the normal bit. */ - - if (u.parts.expn & 0x7fff) - u.parts.mantissa |= normal_bit; - - return u.ld; -} - -/* nexttowardl is the same function with a different name. */ -long double -nexttowardl (long double, long double) __attribute__ ((alias("nextafterl"))); diff --git a/winsup/mingw/mingwex/math/nexttoward.c b/winsup/mingw/mingwex/math/nexttoward.c deleted file mode 100755 index 6a4c820f2..000000000 --- a/winsup/mingw/mingwex/math/nexttoward.c +++ /dev/null @@ -1,42 +0,0 @@ -/* - nexttoward.c - Contributed by Danny Smith <dannysmith@users.sourceforge.net> - No copyright claimed, absolutely no warranties. - - 2005-05-10 -*/ - -#include <math.h> - -double -nexttoward (double x, long double y) -{ - union - { - double d; - unsigned long long ll; - } u; - - long double xx = x; - - if (isnan (y) || isnan (x)) - return x + y; - - if (xx == y) - /* nextafter (0.0, -O.0) should return -0.0. */ - return y; - u.d = x; - if (x == 0.0) - { - u.ll = 1; - return y > 0.0L ? u.d : -u.d; - } - - /* Non-extended encodings are lexicographically ordered, - with implicit "normal" bit. */ - if (((x > 0.0) ^ (y > xx)) == 0) - u.ll++; - else - u.ll--; - return u.d; -} diff --git a/winsup/mingw/mingwex/math/nexttowardf.c b/winsup/mingw/mingwex/math/nexttowardf.c deleted file mode 100755 index 80ac1a357..000000000 --- a/winsup/mingw/mingwex/math/nexttowardf.c +++ /dev/null @@ -1,38 +0,0 @@ -/* - nexttowardf.c - Contributed by Danny Smith <dannysmith@users.sourceforge.net> - No copyright claimed, absolutely no warranties. - - 2005-05-10 -*/ - -#include <math.h> - -float -nexttowardf (float x, long double y) -{ - union - { - float f; - unsigned int i; - } u; - - long double xx = x; - - if (isnan (y) || isnan (x)) - return x + y; - if (xx == y ) - /* nextafter (0.0, -O.0) should return -0.0. */ - return y; - u.f = x; - if (x == 0.0F) - { - u.i = 1; - return y > 0.0L ? u.f : -u.f; - } - if (((x > 0.0F) ^ (y > xx)) == 0) - u.i++; - else - u.i--; - return u.f; -} diff --git a/winsup/mingw/mingwex/math/pow.c b/winsup/mingw/mingwex/math/pow.c deleted file mode 100644 index 1fa548e5e..000000000 --- a/winsup/mingw/mingwex/math/pow.c +++ /dev/null @@ -1,781 +0,0 @@ -/* pow.c - * - * Power function - * - * - * - * SYNOPSIS: - * - * double x, y, z, pow(); - * - * z = pow( x, y ); - * - * - * - * DESCRIPTION: - * - * Computes x raised to the yth power. Analytically, - * - * x**y = exp( y log(x) ). - * - * Following Cody and Waite, this program uses a lookup table - * of 2**-i/16 and pseudo extended precision arithmetic to - * obtain an extra three bits of accuracy in both the logarithm - * and the exponential. - * - * - * - * ACCURACY: - * - * Relative error: - * arithmetic domain # trials peak rms - * IEEE -26,26 30000 4.2e-16 7.7e-17 - * DEC -26,26 60000 4.8e-17 9.1e-18 - * 1/26 < x < 26, with log(x) uniformly distributed. - * -26 < y < 26, y uniformly distributed. - * IEEE 0,8700 30000 1.5e-14 2.1e-15 - * 0.99 < x < 1.01, 0 < y < 8700, uniformly distributed. - * - * - * ERROR MESSAGES: - * - * message condition value returned - * pow overflow x**y > MAXNUM INFINITY - * pow underflow x**y < 1/MAXNUM 0.0 - * pow domain x<0 and y noninteger 0.0 - * - */ - -/* -Cephes Math Library Release 2.8: June, 2000 -Copyright 1984, 1995, 2000 by Stephen L. Moshier -*/ - -/* -Modified for mingw -2002-09-27 Danny Smith <dannysmith@users.sourceforge.net> -*/ - -#ifdef __MINGW32__ -#include "cephes_mconf.h" -#else -#include "mconf.h" -static char fname[] = {"pow"}; -#endif - -#ifndef _SET_ERRNO -#define _SET_ERRNO(x) -#endif - -#define SQRTH 0.70710678118654752440 - -#ifdef UNK -static double P[] = { - 4.97778295871696322025E-1, - 3.73336776063286838734E0, - 7.69994162726912503298E0, - 4.66651806774358464979E0 -}; -static double Q[] = { -/* 1.00000000000000000000E0, */ - 9.33340916416696166113E0, - 2.79999886606328401649E1, - 3.35994905342304405431E1, - 1.39995542032307539578E1 -}; -/* 2^(-i/16), IEEE precision */ -static double A[] = { - 1.00000000000000000000E0, - 9.57603280698573700036E-1, - 9.17004043204671215328E-1, - 8.78126080186649726755E-1, - 8.40896415253714502036E-1, - 8.05245165974627141736E-1, - 7.71105412703970372057E-1, - 7.38413072969749673113E-1, - 7.07106781186547572737E-1, - 6.77127773468446325644E-1, - 6.48419777325504820276E-1, - 6.20928906036742001007E-1, - 5.94603557501360513449E-1, - 5.69394317378345782288E-1, - 5.45253866332628844837E-1, - 5.22136891213706877402E-1, - 5.00000000000000000000E-1 -}; -static double B[] = { - 0.00000000000000000000E0, - 1.64155361212281360176E-17, - 4.09950501029074826006E-17, - 3.97491740484881042808E-17, --4.83364665672645672553E-17, - 1.26912513974441574796E-17, - 1.99100761573282305549E-17, --1.52339103990623557348E-17, - 0.00000000000000000000E0 -}; -static double R[] = { - 1.49664108433729301083E-5, - 1.54010762792771901396E-4, - 1.33335476964097721140E-3, - 9.61812908476554225149E-3, - 5.55041086645832347466E-2, - 2.40226506959099779976E-1, - 6.93147180559945308821E-1 -}; - -#define douba(k) A[k] -#define doubb(k) B[k] -#define MEXP 16383.0 -#ifdef DENORMAL -#define MNEXP -17183.0 -#else -#define MNEXP -16383.0 -#endif -#endif - -#ifdef DEC -static unsigned short P[] = { -0037776,0156313,0175332,0163602, -0040556,0167577,0052366,0174245, -0040766,0062753,0175707,0055564, -0040625,0052035,0131344,0155636, -}; -static unsigned short Q[] = { -/*0040200,0000000,0000000,0000000,*/ -0041025,0052644,0154404,0105155, -0041337,0177772,0007016,0047646, -0041406,0062740,0154273,0020020, -0041137,0177054,0106127,0044555, -}; -static unsigned short A[] = { -0040200,0000000,0000000,0000000, -0040165,0022575,0012444,0103314, -0040152,0140306,0163735,0022071, -0040140,0146336,0166052,0112341, -0040127,0042374,0145326,0116553, -0040116,0022214,0012437,0102201, -0040105,0063452,0010525,0003333, -0040075,0004243,0117530,0006067, -0040065,0002363,0031771,0157145, -0040055,0054076,0165102,0120513, -0040045,0177326,0124661,0050471, -0040036,0172462,0060221,0120422, -0040030,0033760,0050615,0134251, -0040021,0141723,0071653,0010703, -0040013,0112701,0161752,0105727, -0040005,0125303,0063714,0044173, -0040000,0000000,0000000,0000000 -}; -static unsigned short B[] = { -0000000,0000000,0000000,0000000, -0021473,0040265,0153315,0140671, -0121074,0062627,0042146,0176454, -0121413,0003524,0136332,0066212, -0121767,0046404,0166231,0012553, -0121257,0015024,0002357,0043574, -0021736,0106532,0043060,0056206, -0121310,0020334,0165705,0035326, -0000000,0000000,0000000,0000000 -}; - -static unsigned short R[] = { -0034173,0014076,0137624,0115771, -0035041,0076763,0003744,0111311, -0035656,0141766,0041127,0074351, -0036435,0112533,0073611,0116664, -0037143,0054106,0134040,0152223, -0037565,0176757,0176026,0025551, -0040061,0071027,0173721,0147572 -}; - -/* -static double R[] = { -0.14928852680595608186e-4, -0.15400290440989764601e-3, -0.13333541313585784703e-2, -0.96181290595172416964e-2, -0.55504108664085595326e-1, -0.24022650695909537056e0, -0.69314718055994529629e0 -}; -*/ -#define douba(k) (*(double *)&A[(k)<<2]) -#define doubb(k) (*(double *)&B[(k)<<2]) -#define MEXP 2031.0 -#define MNEXP -2031.0 -#endif - -#ifdef IBMPC -static const unsigned short P[] = { -0x5cf0,0x7f5b,0xdb99,0x3fdf, -0xdf15,0xea9e,0xddef,0x400d, -0xeb6f,0x7f78,0xccbd,0x401e, -0x9b74,0xb65c,0xaa83,0x4012, -}; -static const unsigned short Q[] = { -/*0x0000,0x0000,0x0000,0x3ff0,*/ -0x914e,0x9b20,0xaab4,0x4022, -0xc9f5,0x41c1,0xffff,0x403b, -0x6402,0x1b17,0xccbc,0x4040, -0xe92e,0x918a,0xffc5,0x402b, -}; -static const unsigned short A[] = { -0x0000,0x0000,0x0000,0x3ff0, -0x90da,0xa2a4,0xa4af,0x3fee, -0xa487,0xdcfb,0x5818,0x3fed, -0x529c,0xdd85,0x199b,0x3fec, -0xd3ad,0x995a,0xe89f,0x3fea, -0xf090,0x82a3,0xc491,0x3fe9, -0xa0db,0x422a,0xace5,0x3fe8, -0x0187,0x73eb,0xa114,0x3fe7, -0x3bcd,0x667f,0xa09e,0x3fe6, -0x5429,0xdd48,0xab07,0x3fe5, -0x2a27,0xd536,0xbfda,0x3fe4, -0x3422,0x4c12,0xdea6,0x3fe3, -0xb715,0x0a31,0x06fe,0x3fe3, -0x6238,0x6e75,0x387a,0x3fe2, -0x517b,0x3c7d,0x72b8,0x3fe1, -0x890f,0x6cf9,0xb558,0x3fe0, -0x0000,0x0000,0x0000,0x3fe0 -}; -static const unsigned short B[] = { -0x0000,0x0000,0x0000,0x0000, -0x3707,0xd75b,0xed02,0x3c72, -0xcc81,0x345d,0xa1cd,0x3c87, -0x4b27,0x5686,0xe9f1,0x3c86, -0x6456,0x13b2,0xdd34,0xbc8b, -0x42e2,0xafec,0x4397,0x3c6d, -0x82e4,0xd231,0xf46a,0x3c76, -0x8a76,0xb9d7,0x9041,0xbc71, -0x0000,0x0000,0x0000,0x0000 -}; -static const unsigned short R[] = { -0x937f,0xd7f2,0x6307,0x3eef, -0x9259,0x60fc,0x2fbe,0x3f24, -0xef1d,0xc84a,0xd87e,0x3f55, -0x33b7,0x6ef1,0xb2ab,0x3f83, -0x1a92,0xd704,0x6b08,0x3fac, -0xc56d,0xff82,0xbfbd,0x3fce, -0x39ef,0xfefa,0x2e42,0x3fe6 -}; - -#define douba(k) (*(double *)&A[(k)<<2]) -#define doubb(k) (*(double *)&B[(k)<<2]) -#define MEXP 16383.0 -#ifdef DENORMAL -#define MNEXP -17183.0 -#else -#define MNEXP -16383.0 -#endif -#endif - -#ifdef MIEEE -static unsigned short P[] = { -0x3fdf,0xdb99,0x7f5b,0x5cf0, -0x400d,0xddef,0xea9e,0xdf15, -0x401e,0xccbd,0x7f78,0xeb6f, -0x4012,0xaa83,0xb65c,0x9b74 -}; -static unsigned short Q[] = { -0x4022,0xaab4,0x9b20,0x914e, -0x403b,0xffff,0x41c1,0xc9f5, -0x4040,0xccbc,0x1b17,0x6402, -0x402b,0xffc5,0x918a,0xe92e -}; -static unsigned short A[] = { -0x3ff0,0x0000,0x0000,0x0000, -0x3fee,0xa4af,0xa2a4,0x90da, -0x3fed,0x5818,0xdcfb,0xa487, -0x3fec,0x199b,0xdd85,0x529c, -0x3fea,0xe89f,0x995a,0xd3ad, -0x3fe9,0xc491,0x82a3,0xf090, -0x3fe8,0xace5,0x422a,0xa0db, -0x3fe7,0xa114,0x73eb,0x0187, -0x3fe6,0xa09e,0x667f,0x3bcd, -0x3fe5,0xab07,0xdd48,0x5429, -0x3fe4,0xbfda,0xd536,0x2a27, -0x3fe3,0xdea6,0x4c12,0x3422, -0x3fe3,0x06fe,0x0a31,0xb715, -0x3fe2,0x387a,0x6e75,0x6238, -0x3fe1,0x72b8,0x3c7d,0x517b, -0x3fe0,0xb558,0x6cf9,0x890f, -0x3fe0,0x0000,0x0000,0x0000 -}; -static unsigned short B[] = { -0x0000,0x0000,0x0000,0x0000, -0x3c72,0xed02,0xd75b,0x3707, -0x3c87,0xa1cd,0x345d,0xcc81, -0x3c86,0xe9f1,0x5686,0x4b27, -0xbc8b,0xdd34,0x13b2,0x6456, -0x3c6d,0x4397,0xafec,0x42e2, -0x3c76,0xf46a,0xd231,0x82e4, -0xbc71,0x9041,0xb9d7,0x8a76, -0x0000,0x0000,0x0000,0x0000 -}; -static unsigned short R[] = { -0x3eef,0x6307,0xd7f2,0x937f, -0x3f24,0x2fbe,0x60fc,0x9259, -0x3f55,0xd87e,0xc84a,0xef1d, -0x3f83,0xb2ab,0x6ef1,0x33b7, -0x3fac,0x6b08,0xd704,0x1a92, -0x3fce,0xbfbd,0xff82,0xc56d, -0x3fe6,0x2e42,0xfefa,0x39ef -}; - -#define douba(k) (*(double *)&A[(k)<<2]) -#define doubb(k) (*(double *)&B[(k)<<2]) -#define MEXP 16383.0 -#ifdef DENORMAL -#define MNEXP -17183.0 -#else -#define MNEXP -16383.0 -#endif -#endif - -/* log2(e) - 1 */ -#define LOG2EA 0.44269504088896340736 - -#define F W -#define Fa Wa -#define Fb Wb -#define G W -#define Ga Wa -#define Gb u -#define H W -#define Ha Wb -#define Hb Wb - -#ifdef __MINGW32__ -static __inline__ double reduc( double ); -extern double __powi ( double, int ); -extern double pow ( double x, double y); - -#else /* __MINGW32__ */ - -#ifdef ANSIPROT -extern double floor ( double ); -extern double fabs ( double ); -extern double frexp ( double, int * ); -extern double ldexp ( double, int ); -extern double polevl ( double, void *, int ); -extern double p1evl ( double, void *, int ); -extern double __powi ( double, int ); -extern int signbit ( double ); -extern int isnan ( double ); -extern int isfinite ( double ); -static double reduc ( double ); -#else -double floor(), fabs(), frexp(), ldexp(); -double polevl(), p1evl(), __powi(); -int signbit(), isnan(), isfinite(); -static double reduc(); -#endif -extern double MAXNUM; -#ifdef INFINITIES -extern double INFINITY; -#endif -#ifdef NANS -extern double NAN; -#endif -#ifdef MINUSZERO -extern double NEGZERO; -#endif - -#endif /* __MINGW32__ */ - -double pow( x, y ) -double x, y; -{ -double w, z, W, Wa, Wb, ya, yb, u; -/* double F, Fa, Fb, G, Ga, Gb, H, Ha, Hb */ -double aw, ay, wy; -int e, i, nflg, iyflg, yoddint; - -if( y == 0.0 ) - return( 1.0 ); -#ifdef NANS -if( isnan(x) || isnan(y) ) - { - _SET_ERRNO (EDOM); - return( x + y ); - } -#endif -if( y == 1.0 ) - return( x ); - - -#ifdef INFINITIES -if( !isfinite(y) && (x == 1.0 || x == -1.0) ) - { - mtherr( "pow", DOMAIN ); -#ifdef NANS - return( NAN ); -#else - return( INFINITY ); -#endif - } -#endif - -if( x == 1.0 ) - return( 1.0 ); - -if( y >= MAXNUM ) - { - _SET_ERRNO (ERANGE); -#ifdef INFINITIES - if( x > 1.0 ) - return( INFINITY ); -#else - if( x > 1.0 ) - return( MAXNUM ); -#endif - if( x > 0.0 && x < 1.0 ) - return( 0.0); - if( x < -1.0 ) - { -#ifdef INFINITIES - return( INFINITY ); -#else - return( MAXNUM ); -#endif - } - if( x > -1.0 && x < 0.0 ) - return( 0.0 ); - } -if( y <= -MAXNUM ) - { - _SET_ERRNO (ERANGE); - if( x > 1.0 ) - return( 0.0 ); -#ifdef INFINITIES - if( x > 0.0 && x < 1.0 ) - return( INFINITY ); -#else - if( x > 0.0 && x < 1.0 ) - return( MAXNUM ); -#endif - if( x < -1.0 ) - return( 0.0 ); -#ifdef INFINITIES - if( x > -1.0 && x < 0.0 ) - return( INFINITY ); -#else - if( x > -1.0 && x < 0.0 ) - return( MAXNUM ); -#endif - } -if( x >= MAXNUM ) - { -#if INFINITIES - if( y > 0.0 ) - return( INFINITY ); -#else - if( y > 0.0 ) - return( MAXNUM ); -#endif - return(0.0); - } -/* Set iyflg to 1 if y is an integer. */ -iyflg = 0; -w = floor(y); -if( w == y ) - iyflg = 1; - -/* Test for odd integer y. */ -yoddint = 0; -if( iyflg ) - { - ya = fabs(y); - ya = floor(0.5 * ya); - yb = 0.5 * fabs(w); - if( ya != yb ) - yoddint = 1; - } - -if( x <= -MAXNUM ) - { - if( y > 0.0 ) - { -#ifdef INFINITIES - if( yoddint ) - return( -INFINITY ); - return( INFINITY ); -#else - if( yoddint ) - return( -MAXNUM ); - return( MAXNUM ); -#endif - } - if( y < 0.0 ) - { -#ifdef MINUSZERO - if( yoddint ) - return( NEGZERO ); -#endif - return( 0.0 ); - } - } - -nflg = 0; /* flag = 1 if x<0 raised to integer power */ -if( x <= 0.0 ) - { - if( x == 0.0 ) - { - if( y < 0.0 ) - { -#ifdef MINUSZERO - if( signbit(x) && yoddint ) - return( -INFINITY ); -#endif -#ifdef INFINITIES - return( INFINITY ); -#else - return( MAXNUM ); -#endif - } - if( y > 0.0 ) - { -#ifdef MINUSZERO - if( signbit(x) && yoddint ) - return( NEGZERO ); -#endif - return( 0.0 ); - } - return( 1.0 ); - } - else - { - if( iyflg == 0 ) - { /* noninteger power of negative number */ - mtherr( fname, DOMAIN ); - _SET_ERRNO (EDOM); -#ifdef NANS - return(NAN); -#else - return(0.0L); -#endif - } - nflg = 1; - } - } - -/* Integer power of an integer. */ - -if( iyflg ) - { - i = w; - w = floor(x); - if( (w == x) && (fabs(y) < 32768.0) ) - { - w = __powi( x, (int) y ); - return( w ); - } - } - -if( nflg ) - x = fabs(x); - -/* For results close to 1, use a series expansion. */ -w = x - 1.0; -aw = fabs(w); -ay = fabs(y); -wy = w * y; -ya = fabs(wy); -if((aw <= 1.0e-3 && ay <= 1.0) - || (ya <= 1.0e-3 && ay >= 1.0)) - { - z = (((((w*(y-5.)/720. + 1./120.)*w*(y-4.) + 1./24.)*w*(y-3.) - + 1./6.)*w*(y-2.) + 0.5)*w*(y-1.) )*wy + wy + 1.; - goto done; - } -/* These are probably too much trouble. */ -#if 0 -w = y * log(x); -if (aw > 1.0e-3 && fabs(w) < 1.0e-3) - { - z = (((((( - w/7. + 1.)*w/6. + 1.)*w/5. + 1.)*w/4. + 1.)*w/3. + 1.)*w/2. + 1.)*w + 1.; - goto done; - } - -if(ya <= 1.0e-3 && aw <= 1.0e-4) - { - z = ((((( - wy*1./720. - + (-w*1./48. + 1./120.) )*wy - + ((w*17./144. - 1./12.)*w + 1./24.) )*wy - + (((-w*5./16. + 7./24.)*w - 1./4.)*w + 1./6.) )*wy - + ((((w*137./360. - 5./12.)*w + 11./24.)*w - 1./2.)*w + 1./2.) )*wy - + (((((-w*1./6. + 1./5.)*w - 1./4)*w + 1./3.)*w -1./2.)*w ) )*wy - + wy + 1.0; - goto done; - } -#endif - -/* separate significand from exponent */ -x = frexp( x, &e ); - -#if 0 -/* For debugging, check for gross overflow. */ -if( (e * y) > (MEXP + 1024) ) - goto overflow; -#endif - -/* Find significand of x in antilog table A[]. */ -i = 1; -if( x <= douba(9) ) - i = 9; -if( x <= douba(i+4) ) - i += 4; -if( x <= douba(i+2) ) - i += 2; -if( x >= douba(1) ) - i = -1; -i += 1; - - -/* Find (x - A[i])/A[i] - * in order to compute log(x/A[i]): - * - * log(x) = log( a x/a ) = log(a) + log(x/a) - * - * log(x/a) = log(1+v), v = x/a - 1 = (x-a)/a - */ -x -= douba(i); -x -= doubb(i/2); -x /= douba(i); - - -/* rational approximation for log(1+v): - * - * log(1+v) = v - v**2/2 + v**3 P(v) / Q(v) - */ -z = x*x; -w = x * ( z * polevl( x, P, 3 ) / p1evl( x, Q, 4 ) ); -w = w - ldexp( z, -1 ); /* w - 0.5 * z */ - -/* Convert to base 2 logarithm: - * multiply by log2(e) - */ -w = w + LOG2EA * w; -/* Note x was not yet added in - * to above rational approximation, - * so do it now, while multiplying - * by log2(e). - */ -z = w + LOG2EA * x; -z = z + x; - -/* Compute exponent term of the base 2 logarithm. */ -w = -i; -w = ldexp( w, -4 ); /* divide by 16 */ -w += e; -/* Now base 2 log of x is w + z. */ - -/* Multiply base 2 log by y, in extended precision. */ - -/* separate y into large part ya - * and small part yb less than 1/16 - */ -ya = reduc(y); -yb = y - ya; - - -F = z * y + w * yb; -Fa = reduc(F); -Fb = F - Fa; - -G = Fa + w * ya; -Ga = reduc(G); -Gb = G - Ga; - -H = Fb + Gb; -Ha = reduc(H); -w = ldexp( Ga+Ha, 4 ); - -/* Test the power of 2 for overflow */ -if( w > MEXP ) - { -#ifndef INFINITIES - mtherr( fname, OVERFLOW ); -#endif -#ifdef INFINITIES - if( nflg && yoddint ) - return( -INFINITY ); - return( INFINITY ); -#else - if( nflg && yoddint ) - return( -MAXNUM ); - return( MAXNUM ); -#endif - } - -if( w < (MNEXP - 1) ) - { -#ifndef DENORMAL - mtherr( fname, UNDERFLOW ); -#endif -#ifdef MINUSZERO - if( nflg && yoddint ) - return( NEGZERO ); -#endif - return( 0.0 ); - } - -e = w; -Hb = H - Ha; - -if( Hb > 0.0 ) - { - e += 1; - Hb -= 0.0625; - } - -/* Now the product y * log2(x) = Hb + e/16.0. - * - * Compute base 2 exponential of Hb, - * where -0.0625 <= Hb <= 0. - */ -z = Hb * polevl( Hb, R, 6 ); /* z = 2**Hb - 1 */ - -/* Express e/16 as an integer plus a negative number of 16ths. - * Find lookup table entry for the fractional power of 2. - */ -if( e < 0 ) - i = 0; -else - i = 1; -i = e/16 + i; -e = 16*i - e; -w = douba( e ); -z = w + w * z; /* 2**-e * ( 1 + (2**Hb-1) ) */ -z = ldexp( z, i ); /* multiply by integer power of 2 */ - -done: - -/* Negate if odd integer power of negative number */ -if( nflg && yoddint ) - { -#ifdef MINUSZERO - if( z == 0.0 ) - z = NEGZERO; - else -#endif - z = -z; - } -return( z ); -} - - -/* Find a multiple of 1/16 that is within 1/16 of x. */ -static __inline__ double reduc(x) -double x; -{ -double t; - -t = ldexp( x, 4 ); -t = floor( t ); -t = ldexp( t, -4 ); -return(t); -} diff --git a/winsup/mingw/mingwex/math/powf.c b/winsup/mingw/mingwex/math/powf.c deleted file mode 100644 index 1af4d2d8f..000000000 --- a/winsup/mingw/mingwex/math/powf.c +++ /dev/null @@ -1,3 +0,0 @@ -#include <math.h> -float powf (float x, float y) - {return (float) pow (x, y);} diff --git a/winsup/mingw/mingwex/math/powi.c b/winsup/mingw/mingwex/math/powi.c deleted file mode 100644 index 9dd0c3d82..000000000 --- a/winsup/mingw/mingwex/math/powi.c +++ /dev/null @@ -1,200 +0,0 @@ -/* powi.c - * - * Real raised to integer power - * - * - * - * SYNOPSIS: - * - * double x, y, __powi(); - * int n; - * - * y = __powi( x, n ); - * - * - * - * DESCRIPTION: - * - * Returns argument x raised to the nth power. - * The routine efficiently decomposes n as a sum of powers of - * two. The desired power is a product of two-to-the-kth - * powers of x. Thus to compute the 32767 power of x requires - * 28 multiplications instead of 32767 multiplications. - * - * - * - * ACCURACY: - * - * - * Relative error: - * arithmetic x domain n domain # trials peak rms - * DEC .04,26 -26,26 100000 2.7e-16 4.3e-17 - * IEEE .04,26 -26,26 50000 2.0e-15 3.8e-16 - * IEEE 1,2 -1022,1023 50000 8.6e-14 1.6e-14 - * - * Returns MAXNUM on overflow, zero on underflow. - * - */ - -/* powi.c */ - -/* -Cephes Math Library Release 2.8: June, 2000 -Copyright 1984, 1995, 2000 by Stephen L. Moshier -*/ - -/* -Modified for mingw -2002-07-22 Danny Smith <dannysmith@users.sourceforge.net> -*/ - -#ifdef __MINGW32__ -#include "cephes_mconf.h" -#else -#include "mconf.h" -#ifdef ANSIPROT -extern double log ( double ); -extern double frexp ( double, int * ); -extern int signbit ( double ); -#else -double log(), frexp(); -int signbit(); -#endif -extern double NEGZERO, INFINITY, MAXNUM, MAXLOG, MINLOG, LOGE2; -#endif /* __MINGW32__ */ - -#ifndef _SET_ERRNO -#define _SET_ERRNO(x) -#endif - -double __powi( x, nn ) -double x; -int nn; -{ -int n, e, sign, asign, lx; -double w, y, s; - -/* See pow.c for these tests. */ -if( x == 0.0 ) - { - if( nn == 0 ) - return( 1.0 ); - else if( nn < 0 ) - return( INFINITY ); - else - { - if( nn & 1 ) - return( x ); - else - return( 0.0 ); - } - } - -if( nn == 0 ) - return( 1.0 ); - -if( nn == -1 ) - return( 1.0/x ); - -if( x < 0.0 ) - { - asign = -1; - x = -x; - } -else - asign = 0; - - -if( nn < 0 ) - { - sign = -1; - n = -nn; - } -else - { - sign = 1; - n = nn; - } - -/* Even power will be positive. */ -if( (n & 1) == 0 ) - asign = 0; - -/* Overflow detection */ - -/* Calculate approximate logarithm of answer */ -s = frexp( x, &lx ); -e = (lx - 1)*n; -if( (e == 0) || (e > 64) || (e < -64) ) - { - s = (s - 7.0710678118654752e-1) / (s + 7.0710678118654752e-1); - s = (2.9142135623730950 * s - 0.5 + lx) * nn * LOGE2; - } -else - { - s = LOGE2 * e; - } - -if( s > MAXLOG ) - { - mtherr( "powi", OVERFLOW ); - _SET_ERRNO(ERANGE); - y = INFINITY; - goto done; - } - -#if DENORMAL -if( s < MINLOG ) - { - y = 0.0; - goto done; - } - -/* Handle tiny denormal answer, but with less accuracy - * since roundoff error in 1.0/x will be amplified. - * The precise demarcation should be the gradual underflow threshold. - */ -if( (s < (-MAXLOG+2.0)) && (sign < 0) ) - { - x = 1.0/x; - sign = -sign; - } -#else -/* do not produce denormal answer */ -if( s < -MAXLOG ) - return(0.0); -#endif - - -/* First bit of the power */ -if( n & 1 ) - y = x; - -else - y = 1.0; - -w = x; -n >>= 1; -while( n ) - { - w = w * w; /* arg to the 2-to-the-kth power */ - if( n & 1 ) /* if that bit is set, then include in product */ - y *= w; - n >>= 1; - } - -if( sign < 0 ) - y = 1.0/y; - -done: - -if( asign ) - { - /* odd power of negative number */ - if( y == 0.0 ) - y = NEGZERO; - else - y = -y; - } -return(y); -} diff --git a/winsup/mingw/mingwex/math/powif.c b/winsup/mingw/mingwex/math/powif.c deleted file mode 100644 index 160fb5476..000000000 --- a/winsup/mingw/mingwex/math/powif.c +++ /dev/null @@ -1,198 +0,0 @@ -/* powi.c - * - * Real raised to integer power - * - * - * - * SYNOPSIS: - * - * float x, y, __powif(); - * int n; - * - * y = powi( x, n ); - * - * - * - * DESCRIPTION: - * - * Returns argument x raised to the nth power. - * The routine efficiently decomposes n as a sum of powers of - * two. The desired power is a product of two-to-the-kth - * powers of x. Thus to compute the 32767 power of x requires - * 28 multiplications instead of 32767 multiplications. - * - * - * - * ACCURACY: - * - * - * Relative error: - * arithmetic x domain n domain # trials peak rms - * DEC .04,26 -26,26 100000 2.7e-16 4.3e-17 - * IEEE .04,26 -26,26 50000 2.0e-15 3.8e-16 - * IEEE 1,2 -1022,1023 50000 8.6e-14 1.6e-14 - * - * Returns MAXNUM on overflow, zero on underflow. - * - */ - -/* powi.c */ - -/* -Cephes Math Library Release 2.8: June, 2000 -Copyright 1984, 1995, 2000 by Stephen L. Moshier -*/ - -/* -Modified for float from powi.c and adapted to mingw -2002-10-01 Danny Smith <dannysmith@users.sourceforge.net> -*/ - -#ifdef __MINGW32__ -#include "cephes_mconf.h" -#else -#include "mconf.h" -#ifdef ANSIPROT -extern float logf ( float ); -extern float frexpf ( float, int * ); -extern int signbitf ( float ); -#else -float logf(), frexpf(); -int signbitf(); -#endif -extern float NEGZEROF, INFINITYF, MAXNUMF, MAXLOGF, MINLOGF, LOGE2F; -#endif /* __MINGW32__ */ - -#ifndef _SET_ERRNO -#define _SET_ERRNO(x) -#endif - -float __powif( float x, int nn ) -{ -int n, e, sign, asign, lx; -float w, y, s; - -/* See pow.c for these tests. */ -if( x == 0.0F ) - { - if( nn == 0 ) - return( 1.0F ); - else if( nn < 0 ) - return( INFINITYF ); - else - { - if( nn & 1 ) - return( x ); - else - return( 0.0 ); - } - } - -if( nn == 0 ) - return( 1.0 ); - -if( nn == -1 ) - return( 1.0/x ); - -if( x < 0.0 ) - { - asign = -1; - x = -x; - } -else - asign = 0; - - -if( nn < 0 ) - { - sign = -1; - n = -nn; - } -else - { - sign = 1; - n = nn; - } - -/* Even power will be positive. */ -if( (n & 1) == 0 ) - asign = 0; - -/* Overflow detection */ - -/* Calculate approximate logarithm of answer */ -s = frexpf( x, &lx ); -e = (lx - 1)*n; -if( (e == 0) || (e > 64) || (e < -64) ) - { - s = (s - 7.0710678118654752e-1) / (s + 7.0710678118654752e-1); - s = (2.9142135623730950 * s - 0.5 + lx) * nn * LOGE2F; - } -else - { - s = LOGE2F * e; - } - -if( s > MAXLOGF ) - { - mtherr( "__powif", OVERFLOW ); - _SET_ERRNO(ERANGE); - y = INFINITYF; - goto done; - } - -#if DENORMAL -if( s < MINLOGF ) - { - y = 0.0; - goto done; - } - -/* Handle tiny denormal answer, but with less accuracy - * since roundoff error in 1.0/x will be amplified. - * The precise demarcation should be the gradual underflow threshold. - */ -if( (s < (-MAXLOGF+2.0)) && (sign < 0) ) - { - x = 1.0/x; - sign = -sign; - } -#else -/* do not produce denormal answer */ -if( s < -MAXLOGF ) - return(0.0); -#endif - - -/* First bit of the power */ -if( n & 1 ) - y = x; - -else - y = 1.0; - -w = x; -n >>= 1; -while( n ) - { - w = w * w; /* arg to the 2-to-the-kth power */ - if( n & 1 ) /* if that bit is set, then include in product */ - y *= w; - n >>= 1; - } - -if( sign < 0 ) - y = 1.0/y; - -done: - -if( asign ) - { - /* odd power of negative number */ - if( y == 0.0 ) - y = NEGZEROF; - else - y = -y; - } -return(y); -} diff --git a/winsup/mingw/mingwex/math/powil.c b/winsup/mingw/mingwex/math/powil.c deleted file mode 100644 index ec7a2866b..000000000 --- a/winsup/mingw/mingwex/math/powil.c +++ /dev/null @@ -1,179 +0,0 @@ -/* __powil.c - * - * Real raised to integer power, long double precision - * - * - * - * SYNOPSIS: - * - * long double x, y, __powil(); - * int n; - * - * y = __powil( x, n ); - * - * - * - * DESCRIPTION: - * - * Returns argument x raised to the nth power. - * The routine efficiently decomposes n as a sum of powers of - * two. The desired power is a product of two-to-the-kth - * powers of x. Thus to compute the 32767 power of x requires - * 28 multiplications instead of 32767 multiplications. - * - * - * - * ACCURACY: - * - * - * Relative error: - * arithmetic x domain n domain # trials peak rms - * IEEE .001,1000 -1022,1023 50000 4.3e-17 7.8e-18 - * IEEE 1,2 -1022,1023 20000 3.9e-17 7.6e-18 - * IEEE .99,1.01 0,8700 10000 3.6e-16 7.2e-17 - * - * Returns INFINITY on overflow, zero on underflow. - * - */ - -/* __powil.c */ - -/* -Cephes Math Library Release 2.2: December, 1990 -Copyright 1984, 1990 by Stephen L. Moshier -Direct inquiries to 30 Frost Street, Cambridge, MA 02140 -*/ - -/* -Modified for mingw -2002-07-22 Danny Smith <dannysmith@users.sourceforge.net> -*/ - -#ifdef __MINGW32__ -#include "cephes_mconf.h" -#else -#include "mconf.h" -extern long double MAXNUML, MAXLOGL, MINLOGL; -extern long double LOGE2L; -#ifdef ANSIPROT -extern long double frexpl ( long double, int * ); -#else -long double frexpl(); -#endif -#endif /* __MINGW32__ */ - -#ifndef _SET_ERRNO -#define _SET_ERRNO(x) -#endif - -long double __powil( x, nn ) -long double x; -int nn; -{ -long double w, y; -long double s; -int n, e, sign, asign, lx; - -if( x == 0.0L ) - { - if( nn == 0 ) - return( 1.0L ); - else if( nn < 0 ) - return( INFINITYL ); - else - return( 0.0L ); - } - -if( nn == 0 ) - return( 1.0L ); - - -if( x < 0.0L ) - { - asign = -1; - x = -x; - } -else - asign = 0; - - -if( nn < 0 ) - { - sign = -1; - n = -nn; - } -else - { - sign = 1; - n = nn; - } - -/* Overflow detection */ - -/* Calculate approximate logarithm of answer */ -s = x; -s = frexpl( s, &lx ); -e = (lx - 1)*n; -if( (e == 0) || (e > 64) || (e < -64) ) - { - s = (s - 7.0710678118654752e-1L) / (s + 7.0710678118654752e-1L); - s = (2.9142135623730950L * s - 0.5L + lx) * nn * LOGE2L; - } -else - { - s = LOGE2L * e; - } - -if( s > MAXLOGL ) - { - mtherr( "__powil", OVERFLOW ); - _SET_ERRNO(ERANGE); - y = INFINITYL; - goto done; - } - -if( s < MINLOGL ) - { - mtherr( "__powil", UNDERFLOW ); - _SET_ERRNO(ERANGE); - return(0.0L); - } -/* Handle tiny denormal answer, but with less accuracy - * since roundoff error in 1.0/x will be amplified. - * The precise demarcation should be the gradual underflow threshold. - */ -if( s < (-MAXLOGL+2.0L) ) - { - x = 1.0L/x; - sign = -sign; - } - -/* First bit of the power */ -if( n & 1 ) - y = x; - -else - { - y = 1.0L; - asign = 0; - } - -w = x; -n >>= 1; -while( n ) - { - w = w * w; /* arg to the 2-to-the-kth power */ - if( n & 1 ) /* if that bit is set, then include in product */ - y *= w; - n >>= 1; - } - - -done: - -if( asign ) - y = -y; /* odd power of negative number */ -if( sign < 0 ) - y = 1.0L/y; -return(y); -} diff --git a/winsup/mingw/mingwex/math/powl.c b/winsup/mingw/mingwex/math/powl.c deleted file mode 100644 index f85e55653..000000000 --- a/winsup/mingw/mingwex/math/powl.c +++ /dev/null @@ -1,804 +0,0 @@ -/* powl.c - * - * Power function, long double precision - * - * - * - * SYNOPSIS: - * - * long double x, y, z, powl(); - * - * z = powl( x, y ); - * - * - * - * DESCRIPTION: - * - * Computes x raised to the yth power. Analytically, - * - * x**y = exp( y log(x) ). - * - * Following Cody and Waite, this program uses a lookup table - * of 2**-i/32 and pseudo extended precision arithmetic to - * obtain several extra bits of accuracy in both the logarithm - * and the exponential. - * - * - * - * ACCURACY: - * - * The relative error of pow(x,y) can be estimated - * by y dl ln(2), where dl is the absolute error of - * the internally computed base 2 logarithm. At the ends - * of the approximation interval the logarithm equal 1/32 - * and its relative error is about 1 lsb = 1.1e-19. Hence - * the predicted relative error in the result is 2.3e-21 y . - * - * Relative error: - * arithmetic domain # trials peak rms - * - * IEEE +-1000 40000 2.8e-18 3.7e-19 - * .001 < x < 1000, with log(x) uniformly distributed. - * -1000 < y < 1000, y uniformly distributed. - * - * IEEE 0,8700 60000 6.5e-18 1.0e-18 - * 0.99 < x < 1.01, 0 < y < 8700, uniformly distributed. - * - * - * ERROR MESSAGES: - * - * message condition value returned - * pow overflow x**y > MAXNUM INFINITY - * pow underflow x**y < 1/MAXNUM 0.0 - * pow domain x<0 and y noninteger 0.0 - * - */ - -/* -Cephes Math Library Release 2.7: May, 1998 -Copyright 1984, 1991, 1998 by Stephen L. Moshier -*/ - -/* -Modified for mingw -2002-07-22 Danny Smith <dannysmith@users.sourceforge.net> -*/ - -#ifdef __MINGW32__ -#include "cephes_mconf.h" -#else -#include "mconf.h" - -static char fname[] = {"powl"}; -#endif - -#ifndef _SET_ERRNO -#define _SET_ERRNO(x) -#endif - - -/* Table size */ -#define NXT 32 -/* log2(Table size) */ -#define LNXT 5 - -#ifdef UNK -/* log(1+x) = x - .5x^2 + x^3 * P(z)/Q(z) - * on the domain 2^(-1/32) - 1 <= x <= 2^(1/32) - 1 - */ -static long double P[] = { - 8.3319510773868690346226E-4L, - 4.9000050881978028599627E-1L, - 1.7500123722550302671919E0L, - 1.4000100839971580279335E0L, -}; -static long double Q[] = { -/* 1.0000000000000000000000E0L,*/ - 5.2500282295834889175431E0L, - 8.4000598057587009834666E0L, - 4.2000302519914740834728E0L, -}; -/* A[i] = 2^(-i/32), rounded to IEEE long double precision. - * If i is even, A[i] + B[i/2] gives additional accuracy. - */ -static long double A[33] = { - 1.0000000000000000000000E0L, - 9.7857206208770013448287E-1L, - 9.5760328069857364691013E-1L, - 9.3708381705514995065011E-1L, - 9.1700404320467123175367E-1L, - 8.9735453750155359320742E-1L, - 8.7812608018664974155474E-1L, - 8.5930964906123895780165E-1L, - 8.4089641525371454301892E-1L, - 8.2287773907698242225554E-1L, - 8.0524516597462715409607E-1L, - 7.8799042255394324325455E-1L, - 7.7110541270397041179298E-1L, - 7.5458221379671136985669E-1L, - 7.3841307296974965571198E-1L, - 7.2259040348852331001267E-1L, - 7.0710678118654752438189E-1L, - 6.9195494098191597746178E-1L, - 6.7712777346844636413344E-1L, - 6.6261832157987064729696E-1L, - 6.4841977732550483296079E-1L, - 6.3452547859586661129850E-1L, - 6.2092890603674202431705E-1L, - 6.0762367999023443907803E-1L, - 5.9460355750136053334378E-1L, - 5.8186242938878875689693E-1L, - 5.6939431737834582684856E-1L, - 5.5719337129794626814472E-1L, - 5.4525386633262882960438E-1L, - 5.3357020033841180906486E-1L, - 5.2213689121370692017331E-1L, - 5.1094857432705833910408E-1L, - 5.0000000000000000000000E-1L, -}; -static long double B[17] = { - 0.0000000000000000000000E0L, - 2.6176170809902549338711E-20L, --1.0126791927256478897086E-20L, - 1.3438228172316276937655E-21L, - 1.2207982955417546912101E-20L, --6.3084814358060867200133E-21L, - 1.3164426894366316434230E-20L, --1.8527916071632873716786E-20L, - 1.8950325588932570796551E-20L, - 1.5564775779538780478155E-20L, - 6.0859793637556860974380E-21L, --2.0208749253662532228949E-20L, - 1.4966292219224761844552E-20L, - 3.3540909728056476875639E-21L, --8.6987564101742849540743E-22L, --1.2327176863327626135542E-20L, - 0.0000000000000000000000E0L, -}; - -/* 2^x = 1 + x P(x), - * on the interval -1/32 <= x <= 0 - */ -static long double R[] = { - 1.5089970579127659901157E-5L, - 1.5402715328927013076125E-4L, - 1.3333556028915671091390E-3L, - 9.6181291046036762031786E-3L, - 5.5504108664798463044015E-2L, - 2.4022650695910062854352E-1L, - 6.9314718055994530931447E-1L, -}; - -#define douba(k) A[k] -#define doubb(k) B[k] -#define MEXP (NXT*16384.0L) -/* The following if denormal numbers are supported, else -MEXP: */ -#ifdef DENORMAL -#define MNEXP (-NXT*(16384.0L+64.0L)) -#else -#define MNEXP (-NXT*16384.0L) -#endif -/* log2(e) - 1 */ -#define LOG2EA 0.44269504088896340735992L -#endif - - -#ifdef IBMPC -static const unsigned short P[] = { -0xb804,0xa8b7,0xc6f4,0xda6a,0x3ff4, XPD -0x7de9,0xcf02,0x58c0,0xfae1,0x3ffd, XPD -0x405a,0x3722,0x67c9,0xe000,0x3fff, XPD -0xcd99,0x6b43,0x87ca,0xb333,0x3fff, XPD -}; -static const unsigned short Q[] = { -/* 0x0000,0x0000,0x0000,0x8000,0x3fff, */ -0x6307,0xa469,0x3b33,0xa800,0x4001, XPD -0xfec2,0x62d7,0xa51c,0x8666,0x4002, XPD -0xda32,0xd072,0xa5d7,0x8666,0x4001, XPD -}; -static const unsigned short A[] = { -0x0000,0x0000,0x0000,0x8000,0x3fff, XPD -0x033a,0x722a,0xb2db,0xfa83,0x3ffe, XPD -0xcc2c,0x2486,0x7d15,0xf525,0x3ffe, XPD -0xf5cb,0xdcda,0xb99b,0xefe4,0x3ffe, XPD -0x392f,0xdd24,0xc6e7,0xeac0,0x3ffe, XPD -0x48a8,0x7c83,0x06e7,0xe5b9,0x3ffe, XPD -0xe111,0x2a94,0xdeec,0xe0cc,0x3ffe, XPD -0x3755,0xdaf2,0xb797,0xdbfb,0x3ffe, XPD -0x6af4,0xd69d,0xfcca,0xd744,0x3ffe, XPD -0xe45a,0xf12a,0x1d91,0xd2a8,0x3ffe, XPD -0x80e4,0x1f84,0x8c15,0xce24,0x3ffe, XPD -0x27a3,0x6e2f,0xbd86,0xc9b9,0x3ffe, XPD -0xdadd,0x5506,0x2a11,0xc567,0x3ffe, XPD -0x9456,0x6670,0x4cca,0xc12c,0x3ffe, XPD -0x36bf,0x580c,0xa39f,0xbd08,0x3ffe, XPD -0x9ee9,0x62fb,0xaf47,0xb8fb,0x3ffe, XPD -0x6484,0xf9de,0xf333,0xb504,0x3ffe, XPD -0x2590,0xd2ac,0xf581,0xb123,0x3ffe, XPD -0x4ac6,0x42a1,0x3eea,0xad58,0x3ffe, XPD -0x0ef8,0xea7c,0x5ab4,0xa9a1,0x3ffe, XPD -0x38ea,0xb151,0xd6a9,0xa5fe,0x3ffe, XPD -0x6819,0x0c49,0x4303,0xa270,0x3ffe, XPD -0x11ae,0x91a1,0x3260,0x9ef5,0x3ffe, XPD -0x5539,0xd54e,0x39b9,0x9b8d,0x3ffe, XPD -0xa96f,0x8db8,0xf051,0x9837,0x3ffe, XPD -0x0961,0xfef7,0xefa8,0x94f4,0x3ffe, XPD -0xc336,0xab11,0xd373,0x91c3,0x3ffe, XPD -0x53c0,0x45cd,0x398b,0x8ea4,0x3ffe, XPD -0xd6e7,0xea8b,0xc1e3,0x8b95,0x3ffe, XPD -0x8527,0x92da,0x0e80,0x8898,0x3ffe, XPD -0x7b15,0xcc48,0xc367,0x85aa,0x3ffe, XPD -0xa1d7,0xac2b,0x8698,0x82cd,0x3ffe, XPD -0x0000,0x0000,0x0000,0x8000,0x3ffe, XPD -}; -static const unsigned short B[] = { -0x0000,0x0000,0x0000,0x0000,0x0000, XPD -0x1f87,0xdb30,0x18f5,0xf73a,0x3fbd, XPD -0xac15,0x3e46,0x2932,0xbf4a,0xbfbc, XPD -0x7944,0xba66,0xa091,0xcb12,0x3fb9, XPD -0xff78,0x40b4,0x2ee6,0xe69a,0x3fbc, XPD -0xc895,0x5069,0xe383,0xee53,0xbfbb, XPD -0x7cde,0x9376,0x4325,0xf8ab,0x3fbc, XPD -0xa10c,0x25e0,0xc093,0xaefd,0xbfbd, XPD -0x7d3e,0xea95,0x1366,0xb2fb,0x3fbd, XPD -0x5d89,0xeb34,0x5191,0x9301,0x3fbd, XPD -0x80d9,0xb883,0xfb10,0xe5eb,0x3fbb, XPD -0x045d,0x288c,0xc1ec,0xbedd,0xbfbd, XPD -0xeded,0x5c85,0x4630,0x8d5a,0x3fbd, XPD -0x9d82,0xe5ac,0x8e0a,0xfd6d,0x3fba, XPD -0x6dfd,0xeb58,0xaf14,0x8373,0xbfb9, XPD -0xf938,0x7aac,0x91cf,0xe8da,0xbfbc, XPD -0x0000,0x0000,0x0000,0x0000,0x0000, XPD -}; -static const unsigned short R[] = { -0xa69b,0x530e,0xee1d,0xfd2a,0x3fee, XPD -0xc746,0x8e7e,0x5960,0xa182,0x3ff2, XPD -0x63b6,0xadda,0xfd6a,0xaec3,0x3ff5, XPD -0xc104,0xfd99,0x5b7c,0x9d95,0x3ff8, XPD -0xe05e,0x249d,0x46b8,0xe358,0x3ffa, XPD -0x5d1d,0x162c,0xeffc,0xf5fd,0x3ffc, XPD -0x79aa,0xd1cf,0x17f7,0xb172,0x3ffe, XPD -}; - -/* 10 byte sizes versus 12 byte */ -#define douba(k) (*(long double *)(&A[(sizeof( long double )/2)*(k)])) -#define doubb(k) (*(long double *)(&B[(sizeof( long double )/2)*(k)])) -#define MEXP (NXT*16384.0L) -#ifdef DENORMAL -#define MNEXP (-NXT*(16384.0L+64.0L)) -#else -#define MNEXP (-NXT*16384.0L) -#endif -static const -union -{ - unsigned short L[6]; - long double ld; -} log2ea = {{0xc2ef,0x705f,0xeca5,0xe2a8,0x3ffd, XPD}}; - -#define LOG2EA (log2ea.ld) -/* -#define LOG2EA 0.44269504088896340735992L -*/ -#endif - -#ifdef MIEEE -static long P[] = { -0x3ff40000,0xda6ac6f4,0xa8b7b804, -0x3ffd0000,0xfae158c0,0xcf027de9, -0x3fff0000,0xe00067c9,0x3722405a, -0x3fff0000,0xb33387ca,0x6b43cd99, -}; -static long Q[] = { -/* 0x3fff0000,0x80000000,0x00000000, */ -0x40010000,0xa8003b33,0xa4696307, -0x40020000,0x8666a51c,0x62d7fec2, -0x40010000,0x8666a5d7,0xd072da32, -}; -static long A[] = { -0x3fff0000,0x80000000,0x00000000, -0x3ffe0000,0xfa83b2db,0x722a033a, -0x3ffe0000,0xf5257d15,0x2486cc2c, -0x3ffe0000,0xefe4b99b,0xdcdaf5cb, -0x3ffe0000,0xeac0c6e7,0xdd24392f, -0x3ffe0000,0xe5b906e7,0x7c8348a8, -0x3ffe0000,0xe0ccdeec,0x2a94e111, -0x3ffe0000,0xdbfbb797,0xdaf23755, -0x3ffe0000,0xd744fcca,0xd69d6af4, -0x3ffe0000,0xd2a81d91,0xf12ae45a, -0x3ffe0000,0xce248c15,0x1f8480e4, -0x3ffe0000,0xc9b9bd86,0x6e2f27a3, -0x3ffe0000,0xc5672a11,0x5506dadd, -0x3ffe0000,0xc12c4cca,0x66709456, -0x3ffe0000,0xbd08a39f,0x580c36bf, -0x3ffe0000,0xb8fbaf47,0x62fb9ee9, -0x3ffe0000,0xb504f333,0xf9de6484, -0x3ffe0000,0xb123f581,0xd2ac2590, -0x3ffe0000,0xad583eea,0x42a14ac6, -0x3ffe0000,0xa9a15ab4,0xea7c0ef8, -0x3ffe0000,0xa5fed6a9,0xb15138ea, -0x3ffe0000,0xa2704303,0x0c496819, -0x3ffe0000,0x9ef53260,0x91a111ae, -0x3ffe0000,0x9b8d39b9,0xd54e5539, -0x3ffe0000,0x9837f051,0x8db8a96f, -0x3ffe0000,0x94f4efa8,0xfef70961, -0x3ffe0000,0x91c3d373,0xab11c336, -0x3ffe0000,0x8ea4398b,0x45cd53c0, -0x3ffe0000,0x8b95c1e3,0xea8bd6e7, -0x3ffe0000,0x88980e80,0x92da8527, -0x3ffe0000,0x85aac367,0xcc487b15, -0x3ffe0000,0x82cd8698,0xac2ba1d7, -0x3ffe0000,0x80000000,0x00000000, -}; -static long B[51] = { -0x00000000,0x00000000,0x00000000, -0x3fbd0000,0xf73a18f5,0xdb301f87, -0xbfbc0000,0xbf4a2932,0x3e46ac15, -0x3fb90000,0xcb12a091,0xba667944, -0x3fbc0000,0xe69a2ee6,0x40b4ff78, -0xbfbb0000,0xee53e383,0x5069c895, -0x3fbc0000,0xf8ab4325,0x93767cde, -0xbfbd0000,0xaefdc093,0x25e0a10c, -0x3fbd0000,0xb2fb1366,0xea957d3e, -0x3fbd0000,0x93015191,0xeb345d89, -0x3fbb0000,0xe5ebfb10,0xb88380d9, -0xbfbd0000,0xbeddc1ec,0x288c045d, -0x3fbd0000,0x8d5a4630,0x5c85eded, -0x3fba0000,0xfd6d8e0a,0xe5ac9d82, -0xbfb90000,0x8373af14,0xeb586dfd, -0xbfbc0000,0xe8da91cf,0x7aacf938, -0x00000000,0x00000000,0x00000000, -}; -static long R[] = { -0x3fee0000,0xfd2aee1d,0x530ea69b, -0x3ff20000,0xa1825960,0x8e7ec746, -0x3ff50000,0xaec3fd6a,0xadda63b6, -0x3ff80000,0x9d955b7c,0xfd99c104, -0x3ffa0000,0xe35846b8,0x249de05e, -0x3ffc0000,0xf5fdeffc,0x162c5d1d, -0x3ffe0000,0xb17217f7,0xd1cf79aa, -}; - -#define douba(k) (*(long double *)&A[3*(k)]) -#define doubb(k) (*(long double *)&B[3*(k)]) -#define MEXP (NXT*16384.0L) -#ifdef DENORMAL -#define MNEXP (-NXT*(16384.0L+64.0L)) -#else -#define MNEXP (-NXT*16382.0L) -#endif -static long L[3] = {0x3ffd0000,0xe2a8eca5,0x705fc2ef}; -#define LOG2EA (*(long double *)(&L[0])) -#endif - - -#define F W -#define Fa Wa -#define Fb Wb -#define G W -#define Ga Wa -#define Gb u -#define H W -#define Ha Wb -#define Hb Wb - -#ifndef __MINGW32__ -extern long double MAXNUML; -#endif - -static VOLATILE long double z; -static long double w, W, Wa, Wb, ya, yb, u; - -#ifdef __MINGW32__ -static __inline__ long double reducl( long double ); -extern long double __powil ( long double, int ); -extern long double powl ( long double x, long double y); -#else -#ifdef ANSIPROT -extern long double floorl ( long double ); -extern long double fabsl ( long double ); -extern long double frexpl ( long double, int * ); -extern long double ldexpl ( long double, int ); -extern long double polevll ( long double, void *, int ); -extern long double p1evll ( long double, void *, int ); -extern long double __powil ( long double, int ); -extern int isnanl ( long double ); -extern int isfinitel ( long double ); -static long double reducl( long double ); -extern int signbitl ( long double ); -#else -long double floorl(), fabsl(), frexpl(), ldexpl(); -long double polevll(), p1evll(), __powil(); -static long double reducl(); -int isnanl(), isfinitel(), signbitl(); -#endif /* __MINGW32__ */ - -#ifdef INFINITIES -extern long double INFINITYL; -#else -#define INFINITYL MAXNUML -#endif - -#ifdef NANS -extern long double NANL; -#endif -#ifdef MINUSZERO -extern long double NEGZEROL; -#endif - -#endif /* __MINGW32__ */ - -#ifdef __MINGW32__ - -/* No error checking. We handle Infs and zeros ourselves. */ -static __inline__ long double -__fast_ldexpl (long double x, int expn) -{ - long double res; - __asm__ ("fscale" - : "=t" (res) - : "0" (x), "u" ((long double) expn)); - return res; -} - -#define ldexpl __fast_ldexpl - -#endif - - -long double powl( x, y ) -long double x, y; -{ -/* double F, Fa, Fb, G, Ga, Gb, H, Ha, Hb */ -int i, nflg, iyflg, yoddint; -long e; - -if( y == 0.0L ) - return( 1.0L ); - -#ifdef NANS -if( isnanl(x) ) - { - _SET_ERRNO (EDOM); - return( x ); - } -if( isnanl(y) ) - { - _SET_ERRNO (EDOM); - return( y ); - } -#endif - -if( y == 1.0L ) - return( x ); - -if( isinfl(y) && (x == -1.0L || x == 1.0L) ) - return( y ); - -if( x == 1.0L ) - return( 1.0L ); - -if( y >= MAXNUML ) - { - _SET_ERRNO (ERANGE); -#ifdef INFINITIES - if( x > 1.0L ) - return( INFINITYL ); -#else - if( x > 1.0L ) - return( MAXNUML ); -#endif - if( x > 0.0L && x < 1.0L ) - return( 0.0L ); -#ifdef INFINITIES - if( x < -1.0L ) - return( INFINITYL ); -#else - if( x < -1.0L ) - return( MAXNUML ); -#endif - if( x > -1.0L && x < 0.0L ) - return( 0.0L ); - } -if( y <= -MAXNUML ) - { - _SET_ERRNO (ERANGE); - if( x > 1.0L ) - return( 0.0L ); -#ifdef INFINITIES - if( x > 0.0L && x < 1.0L ) - return( INFINITYL ); -#else - if( x > 0.0L && x < 1.0L ) - return( MAXNUML ); -#endif - if( x < -1.0L ) - return( 0.0L ); -#ifdef INFINITIES - if( x > -1.0L && x < 0.0L ) - return( INFINITYL ); -#else - if( x > -1.0L && x < 0.0L ) - return( MAXNUML ); -#endif - } -if( x >= MAXNUML ) - { -#if INFINITIES - if( y > 0.0L ) - return( INFINITYL ); -#else - if( y > 0.0L ) - return( MAXNUML ); -#endif - return( 0.0L ); - } - -w = floorl(y); -/* Set iyflg to 1 if y is an integer. */ -iyflg = 0; -if( w == y ) - iyflg = 1; - -/* Test for odd integer y. */ -yoddint = 0; -if( iyflg ) - { - ya = fabsl(y); - ya = floorl(0.5L * ya); - yb = 0.5L * fabsl(w); - if( ya != yb ) - yoddint = 1; - } - -if( x <= -MAXNUML ) - { - if( y > 0.0L ) - { -#ifdef INFINITIES - if( yoddint ) - return( -INFINITYL ); - return( INFINITYL ); -#else - if( yoddint ) - return( -MAXNUML ); - return( MAXNUML ); -#endif - } - if( y < 0.0L ) - { -#ifdef MINUSZERO - if( yoddint ) - return( NEGZEROL ); -#endif - return( 0.0 ); - } - } - - -nflg = 0; /* flag = 1 if x<0 raised to integer power */ -if( x <= 0.0L ) - { - if( x == 0.0L ) - { - if( y < 0.0 ) - { -#ifdef MINUSZERO - if( signbitl(x) && yoddint ) - return( -INFINITYL ); -#endif -#ifdef INFINITIES - return( INFINITYL ); -#else - return( MAXNUML ); -#endif - } - if( y > 0.0 ) - { -#ifdef MINUSZERO - if( signbitl(x) && yoddint ) - return( NEGZEROL ); -#endif - return( 0.0 ); - } - if( y == 0.0L ) - return( 1.0L ); /* 0**0 */ - else - return( 0.0L ); /* 0**y */ - } - else - { - if( iyflg == 0 ) - { /* noninteger power of negative number */ - mtherr( fname, DOMAIN ); - _SET_ERRNO (EDOM); -#ifdef NANS - return(NANL); -#else - return(0.0L); -#endif - } - nflg = 1; - } - } - -/* Integer power of an integer. */ - -if( iyflg ) - { - i = w; - w = floorl(x); - if( (w == x) && (fabsl(y) < 32768.0) ) - { - w = __powil( x, (int) y ); - return( w ); - } - } - - -if( nflg ) - x = fabsl(x); - -/* separate significand from exponent */ -x = frexpl( x, &i ); -e = i; - -/* find significand in antilog table A[] */ -i = 1; -if( x <= douba(17) ) - i = 17; -if( x <= douba(i+8) ) - i += 8; -if( x <= douba(i+4) ) - i += 4; -if( x <= douba(i+2) ) - i += 2; -if( x >= douba(1) ) - i = -1; -i += 1; - - -/* Find (x - A[i])/A[i] - * in order to compute log(x/A[i]): - * - * log(x) = log( a x/a ) = log(a) + log(x/a) - * - * log(x/a) = log(1+v), v = x/a - 1 = (x-a)/a - */ -x -= douba(i); -x -= doubb(i/2); -x /= douba(i); - - -/* rational approximation for log(1+v): - * - * log(1+v) = v - v**2/2 + v**3 P(v) / Q(v) - */ -z = x*x; -w = x * ( z * polevll( x, P, 3 ) / p1evll( x, Q, 3 ) ); -w = w - ldexpl( z, -1 ); /* w - 0.5 * z */ - -/* Convert to base 2 logarithm: - * multiply by log2(e) = 1 + LOG2EA - */ -z = LOG2EA * w; -z += w; -z += LOG2EA * x; -z += x; - -/* Compute exponent term of the base 2 logarithm. */ -w = -i; -w = ldexpl( w, -LNXT ); /* divide by NXT */ -w += e; -/* Now base 2 log of x is w + z. */ - -/* Multiply base 2 log by y, in extended precision. */ - -/* separate y into large part ya - * and small part yb less than 1/NXT - */ -ya = reducl(y); -yb = y - ya; - -/* (w+z)(ya+yb) - * = w*ya + w*yb + z*y - */ -F = z * y + w * yb; -Fa = reducl(F); -Fb = F - Fa; - -G = Fa + w * ya; -Ga = reducl(G); -Gb = G - Ga; - -H = Fb + Gb; -Ha = reducl(H); -w = ldexpl( Ga + Ha, LNXT ); - -/* Test the power of 2 for overflow */ -if( w > MEXP ) - { - _SET_ERRNO (ERANGE); - mtherr( fname, OVERFLOW ); - return( MAXNUML ); - } - -if( w < MNEXP ) - { - _SET_ERRNO (ERANGE); - mtherr( fname, UNDERFLOW ); - return( 0.0L ); - } - -e = w; -Hb = H - Ha; - -if( Hb > 0.0L ) - { - e += 1; - Hb -= (1.0L/NXT); /*0.0625L;*/ - } - -/* Now the product y * log2(x) = Hb + e/NXT. - * - * Compute base 2 exponential of Hb, - * where -0.0625 <= Hb <= 0. - */ -z = Hb * polevll( Hb, R, 6 ); /* z = 2**Hb - 1 */ - -/* Express e/NXT as an integer plus a negative number of (1/NXT)ths. - * Find lookup table entry for the fractional power of 2. - */ -if( e < 0 ) - i = 0; -else - i = 1; -i = e/NXT + i; -e = NXT*i - e; -w = douba( e ); -z = w * z; /* 2**-e * ( 1 + (2**Hb-1) ) */ -z = z + w; -z = ldexpl( z, i ); /* multiply by integer power of 2 */ - -if( nflg ) - { -/* For negative x, - * find out if the integer exponent - * is odd or even. - */ - w = ldexpl( y, -1 ); - w = floorl(w); - w = ldexpl( w, 1 ); - if( w != y ) - z = -z; /* odd exponent */ - } - -return( z ); -} - -static __inline__ long double -__convert_inf_to_maxnum(long double x) -{ - if (isinf(x)) - return (x > 0.0L ? MAXNUML : -MAXNUML); - else - return x; -} - - -/* Find a multiple of 1/NXT that is within 1/NXT of x. */ -static __inline__ long double reducl(x) -long double x; -{ -long double t; - -/* If the call to ldexpl overflows, set it to MAXNUML. - This avoids Inf - Inf = Nan result when calculating the 'small' - part of a reduction. Instead, the small part becomes Inf, - causing under/overflow when adding it to the 'large' part. - There must be a cleaner way of doing this. */ -t = __convert_inf_to_maxnum (ldexpl( x, LNXT )); -t = floorl( t ); -t = ldexpl( t, -LNXT ); -return(t); -} diff --git a/winsup/mingw/mingwex/math/remainder.S b/winsup/mingw/mingwex/math/remainder.S deleted file mode 100644 index 01930d3ba..000000000 --- a/winsup/mingw/mingwex/math/remainder.S +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Written by J.T. Conklin <jtc@netbsd.org>. - * Public domain. - */ - - .file "remainder.S" - .text - .align 4 -.globl _remainder - .def _remainder; .scl 2; .type 32; .endef -_remainder: - fldl 12(%esp) - fldl 4(%esp) -1: fprem1 - fstsw %ax - sahf - jp 1b - fstp %st(1) - ret diff --git a/winsup/mingw/mingwex/math/remainderf.S b/winsup/mingw/mingwex/math/remainderf.S deleted file mode 100644 index 81e78415a..000000000 --- a/winsup/mingw/mingwex/math/remainderf.S +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Written by J.T. Conklin <jtc@netbsd.org>. - * Public domain. - */ - - .file "remainderf.S" - .text - .align 4 -.globl _remainder - .def _remainderf; .scl 2; .type 32; .endef -_remainderf: - flds 8(%esp) - flds 4(%esp) -1: fprem1 - fstsw %ax - sahf - jp 1b - fstp %st(1) - ret diff --git a/winsup/mingw/mingwex/math/remainderl.S b/winsup/mingw/mingwex/math/remainderl.S deleted file mode 100644 index b5ce3736d..000000000 --- a/winsup/mingw/mingwex/math/remainderl.S +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Written by J.T. Conklin <jtc@netbsd.org>. - * Public domain. - * Adapted for `long double' by Ulrich Drepper <drepper@cygnus.com>. - * Removed header file dependency for use in libmingwex.a by - * Danny Smith <dannysmith@users.sourceforge.net> - */ - - .file "remainderl.S" - .text - .align 4 -.globl _remainderl - .def _remainderl; .scl 2; .type 32; .endef -_remainderl: - fldt 16(%esp) - fldt 4(%esp) -1: fprem1 - fstsw %ax - sahf - jp 1b - fstp %st(1) - ret diff --git a/winsup/mingw/mingwex/math/remquo.S b/winsup/mingw/mingwex/math/remquo.S deleted file mode 100644 index 987c37ca5..000000000 --- a/winsup/mingw/mingwex/math/remquo.S +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Written by Ulrich Drepper <drepper@cygnus.com>. - * Based on e_remainder by J.T. Conklin <jtc@netbsd.org>. - * Removed header file dependency for use in libmingwex.a by - * Danny Smith <dannysmith@users.sourceforge.ne - * Public domain. - */ - - .file "remquo.S" - .text - .align 4; -.globl _remquo; -_remquo: - fldl 4 +8(%esp) - fldl 4(%esp) -1: fprem1 - fstsw %ax - sahf - jp 1b - fstp %st(1) - movl %eax, %ecx - shrl $8, %eax - shrl $12, %ecx - andl $4, %ecx - andl $3, %eax - orl %eax, %ecx - movl $0xef2960, %eax - shrl %cl, %eax - andl $3, %eax - movl 4 +8 +8(%esp), %ecx - movl 4 +4(%esp), %edx - xorl 4 +8 +4(%esp), %edx - testl $0x80000000, %edx - jz 1f - negl %eax -1: movl %eax, (%ecx) - - ret diff --git a/winsup/mingw/mingwex/math/remquof.S b/winsup/mingw/mingwex/math/remquof.S deleted file mode 100644 index af540ef5b..000000000 --- a/winsup/mingw/mingwex/math/remquof.S +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Written by Ulrich Drepper <drepper@cygnus.com>. - * Based on e_remainder by J.T. Conklin <jtc@netbsd.org>. - * Removed header file dependency for use in libmingwex.a by - * Danny Smith <dannysmith@users.sourceforge.ne - * Public domain. - */ - - .file "remquo.S" - .text - .align 4; -.globl _remquof; -_remquof: - flds 4 +4(%esp) - flds 4(%esp) -1: fprem1 - fstsw %ax - sahf - jp 1b - fstp %st(1) - movl %eax, %ecx - shrl $8, %eax - shrl $12, %ecx - andl $4, %ecx - andl $3, %eax - orl %eax, %ecx - movl $0xef2960, %eax - shrl %cl, %eax - andl $3, %eax - movl 4 +4 +4(%esp), %ecx - movl 4(%esp), %edx - xorl 4 +4(%esp), %edx - testl $0x80000000, %edx - jz 1f - negl %eax -1: movl %eax, (%ecx) - - ret diff --git a/winsup/mingw/mingwex/math/remquol.S b/winsup/mingw/mingwex/math/remquol.S deleted file mode 100644 index e6f1b5420..000000000 --- a/winsup/mingw/mingwex/math/remquol.S +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Written by Ulrich Drepper <drepper@cygnus.com>. - * Based on e_remainder by J.T. Conklin <jtc@netbsd.org>. - * Removed header file dependency for use in libmingwex.a by - * Danny Smith <dannysmith@users.sourceforge.net> - * Public domain. - */ - .text - .align 4; -.globl _remquol; - _remquol: - fldt 4 +12(%esp) - fldt 4(%esp) -1: fprem1 - fstsw %ax - sahf - jp 1b - fstp %st(1) - movl %eax, %ecx - shrl $8, %eax - shrl $12, %ecx - andl $4, %ecx - andl $3, %eax - orl %eax, %ecx - movl $0xef2960, %eax - shrl %cl, %eax - andl $3, %eax - movl 4 +12 +12(%esp), %ecx - movl 4 +8(%esp), %edx - xorl 4 +12 +8(%esp), %edx - testl $0x8000, %edx - jz 1f - negl %eax -1: movl %eax, (%ecx) - - ret diff --git a/winsup/mingw/mingwex/math/rint.c b/winsup/mingw/mingwex/math/rint.c deleted file mode 100644 index 3198f4b26..000000000 --- a/winsup/mingw/mingwex/math/rint.c +++ /dev/null @@ -1,6 +0,0 @@ -#include <math.h> -double rint (double x){ - double retval; - __asm__ ("frndint;" : "=t" (retval) : "0" (x)); - return retval; -} diff --git a/winsup/mingw/mingwex/math/rintf.c b/winsup/mingw/mingwex/math/rintf.c deleted file mode 100644 index 0b05e8f89..000000000 --- a/winsup/mingw/mingwex/math/rintf.c +++ /dev/null @@ -1,7 +0,0 @@ -#include <math.h> - -float rintf (float x){ - float retval; - __asm__ ("frndint;": "=t" (retval) : "0" (x)); - return retval; -} diff --git a/winsup/mingw/mingwex/math/rintl.c b/winsup/mingw/mingwex/math/rintl.c deleted file mode 100644 index ffc9d1107..000000000 --- a/winsup/mingw/mingwex/math/rintl.c +++ /dev/null @@ -1,7 +0,0 @@ -#include <math.h> - -long double rintl (long double x){ - long double retval; - __asm__ ("frndint;": "=t" (retval) : "0" (x)); - return retval; -} diff --git a/winsup/mingw/mingwex/math/round_generic.c b/winsup/mingw/mingwex/math/round_generic.c deleted file mode 100644 index b3e0f2608..000000000 --- a/winsup/mingw/mingwex/math/round_generic.c +++ /dev/null @@ -1,51 +0,0 @@ -/* - * round_generic.c - * - * $Id$ - * - * Provides a generic implementation for the `round()', `roundf()' - * and `roundl()' functions; compile with `-D FUNCTION=name', with - * `name' set to each of these three in turn, to create separate - * object files for each of the three functions. - * - * Written by Keith Marshall <keithmarshall@users.sourceforge.net> - * - * This is free software. You may redistribute and/or modify it as you - * see fit, without restriction of copyright. - * - * This software is provided "as is", in the hope that it may be useful, - * but WITHOUT WARRANTY OF ANY KIND, not even any implied warranty of - * MERCHANTABILITY, nor of FITNESS FOR ANY PARTICULAR PURPOSE. At no - * time will the author accept any form of liability for any damages, - * however caused, resulting from the use of this software. - * - */ -#ifndef FUNCTION -/* - * Normally specified with `-D FUNCTION=name', on the command line. - * Valid FUNCTION names are `round', `roundf' and `roundl'; specifying - * anything else will most likely cause a compilation error. If user - * did not specify any FUNCTION name, default to `round'. - */ -#define FUNCTION round -#endif - -#include "round_internal.h" - -/* Generic implementation. - * The user is required to specify the FUNCTION name; - * the RETURN_TYPE and INPUT_TYPE macros resolve to appropriate - * type declarations, to match the selected FUNCTION prototype. - */ -RETURN_TYPE FUNCTION( INPUT_TYPE x ) -{ - /* Round to nearest integer, away from zero for half-way. - * - * We split it with the `round_internal()' function in - * a private header file, so that it may be shared by this, - * `lround()' and `llround()' implementations. - */ - return isfinite( x ) ? round_internal( x ) : x; -} - -/* $RCSfile$$Revision$: end of file */ diff --git a/winsup/mingw/mingwex/math/round_internal.h b/winsup/mingw/mingwex/math/round_internal.h deleted file mode 100644 index bb3c5ad23..000000000 --- a/winsup/mingw/mingwex/math/round_internal.h +++ /dev/null @@ -1,155 +0,0 @@ -#ifndef _ROUND_INTERNAL_H -/* - * round_internal.h - * - * $Id$ - * - * Provides a generic implementation of the numerical rounding - * algorithm, which is shared by all functions in the `round()', - * `lround()' and `llround()' families. - * - * Written by Keith Marshall <keithmarshall@users.sourceforge.net> - * - * This is free software. You may redistribute and/or modify it as you - * see fit, without restriction of copyright. - * - * This software is provided "as is", in the hope that it may be useful, - * but WITHOUT WARRANTY OF ANY KIND, not even any implied warranty of - * MERCHANTABILITY, nor of FITNESS FOR ANY PARTICULAR PURPOSE. At no - * time will the author accept any form of liability for any damages, - * however caused, resulting from the use of this software. - * - */ -#define _ROUND_INTERNAL_H - -#include <math.h> -#include <fenv.h> - -#define TYPE_PASTE( NAME, TYPE ) NAME##TYPE - -#define INPUT_TYPE INPUT_TYPEDEF( FUNCTION ) -#define INPUT_TYPEDEF( FUNCTION ) TYPE_PASTE( FUNCTION, _input_type ) -/* - * The types for the formal parameter, to each of the derived functions. - */ -#define round_input_type double -#define roundf_input_type float -#define roundl_input_type long double - -#define lround_input_type double -#define lroundf_input_type float -#define lroundl_input_type long double - -#define llround_input_type double -#define llroundf_input_type float -#define llroundl_input_type long double - -#define RETURN_TYPE RETURN_TYPEDEF( FUNCTION ) -#define RETURN_TYPEDEF( FUNCTION ) TYPE_PASTE( FUNCTION, _return_type ) -/* - * The types for the return value, from each of the derived functions. - */ -#define round_return_type double -#define roundf_return_type float -#define roundl_return_type long double - -#define lround_return_type long -#define lroundf_return_type long -#define lroundl_return_type long - -#define llround_return_type long long -#define llroundf_return_type long long -#define llroundl_return_type long long - -#define MAX_RETURN_VALUE RETURN_MAX( FUNCTION ) -#define RETURN_MAX( FUNCTION ) TYPE_PASTE( FUNCTION, _return_max ) -/* - * The maximum values which may be returned by each of the derived functions - * in the `lround' or the `llround' families. - */ -#define lround_return_max LONG_MAX -#define lroundf_return_max LONG_MAX -#define lroundl_return_max LONG_MAX - -#define llround_return_max LLONG_MAX -#define llroundf_return_max LLONG_MAX -#define llroundl_return_max LLONG_MAX - -#define MIN_RETURN_VALUE RETURN_MIN( FUNCTION ) -#define RETURN_MIN( FUNCTION ) TYPE_PASTE( FUNCTION, _return_min ) -/* - * The minimum values which may be returned by each of the derived functions - * in the `lround' or the `llround' families. - */ -#define lround_return_min LONG_MIN -#define lroundf_return_min LONG_MIN -#define lroundl_return_min LONG_MIN - -#define llround_return_min LLONG_MIN -#define llroundf_return_min LLONG_MIN -#define llroundl_return_min LLONG_MIN - -#define REF_VALUE( VALUE ) REF_TYPE( FUNCTION, VALUE ) -#define REF_TYPE( FUNC, VAL ) TYPE_PASTE( FUNC, _ref )( VAL ) -/* - * Macros for expressing constant values of the appropriate data type, - * for use in each of the derived functions. - */ -#define round_ref( VALUE ) VALUE -#define lround_ref( VALUE ) VALUE -#define llround_ref( VALUE ) VALUE - -#define roundl_ref( VALUE ) TYPE_PASTE( VALUE, L ) -#define lroundl_ref( VALUE ) TYPE_PASTE( VALUE, L ) -#define llroundl_ref( VALUE ) TYPE_PASTE( VALUE, L ) - -#define roundf_ref( VALUE ) TYPE_PASTE( VALUE, F ) -#define lroundf_ref( VALUE ) TYPE_PASTE( VALUE, F ) -#define llroundf_ref( VALUE ) TYPE_PASTE( VALUE, F ) - -static __inline__ -INPUT_TYPE __attribute__(( always_inline )) round_internal( INPUT_TYPE x ) -#define ROUND_MODES ( FE_TONEAREST | FE_UPWARD | FE_DOWNWARD | FE_TOWARDZERO ) -{ - /* Generic helper function, for rounding of the input parameter value to - * the nearest integer value. - */ - INPUT_TYPE z; - unsigned short saved_CW, tmp_required_CW; - - /* Rounding method suggested by Danny Smith <dannysmith@users.sf.net> - * - * Save the FPU control word state, set rounding mode TONEAREST, round the - * input value, then restore the original FPU control word state. - */ - __asm__( "fnstcw %0;" : "=m"( saved_CW )); - tmp_required_CW = ( saved_CW & ~ROUND_MODES ) | FE_TONEAREST; - __asm__( "fldcw %0;" :: "m"( tmp_required_CW )); - __asm__( "frndint;" : "=t"( z ) : "0"( x )); - __asm__( "fldcw %0;" :: "m"( saved_CW )); - - /* We now have a possible rounded value; unfortunately the FPU uses the - * `round-to-even' rule for exact mid-way cases, where both C99 and POSIX - * require us to always round away from zero, so we need to adjust those - * mid-way cases which the FPU rounded in the wrong direction. - * - * Correction method suggested by Greg Chicares <gchicares@sbcglobal.net> - */ - return x < REF_VALUE( 0.0 ) - ? /* - * For negative input values, an incorrectly rounded value will be - * exactly 0.5 greater than the original value; when we find such an - * exact rounding offset, we must subtract an additional 1.0 from the - * rounded result, otherwise we return the rounded result unchanged. - */ - z - x == REF_VALUE( 0.5 ) ? z - REF_VALUE( 1.0 ) : z - - : /* For positive input values, an incorrectly rounded value will be - * exactly 0.5 less than the original value; when we find such an exact - * rounding offset, we must add an additional 1.0 to the rounded result, - * otherwise we return the rounded result unchanged. - */ - x - z == REF_VALUE( 0.5 ) ? z + REF_VALUE( 1.0 ) : z; -} - -#endif /* !defined _ROUND_INTERNAL_H: $RCSfile$: end of file */ diff --git a/winsup/mingw/mingwex/math/s_erf.c b/winsup/mingw/mingwex/math/s_erf.c deleted file mode 100644 index 3cba24dd2..000000000 --- a/winsup/mingw/mingwex/math/s_erf.c +++ /dev/null @@ -1,345 +0,0 @@ - -/* @(#)s_erf.c 1.3 95/01/18 */ -/* - * ==================================================== - * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. - * - * Developed at SunSoft, a Sun Microsystems, Inc. business. - * Permission to use, copy, modify, and distribute this - * software is freely granted, provided that this notice - * is preserved. - * ==================================================== - */ - -/* double erf(double x) - * double erfc(double x) - * x - * 2 |\ - * erf(x) = --------- | exp(-t*t)dt - * sqrt(pi) \| - * 0 - * - * erfc(x) = 1-erf(x) - * Note that - * erf(-x) = -erf(x) - * erfc(-x) = 2 - erfc(x) - * - * Method: - * 1. For |x| in [0, 0.84375] - * erf(x) = x + x*R(x^2) - * erfc(x) = 1 - erf(x) if x in [-.84375,0.25] - * = 0.5 + ((0.5-x)-x*R) if x in [0.25,0.84375] - * where R = P/Q where P is an odd poly of degree 8 and - * Q is an odd poly of degree 10. - * -57.90 - * | R - (erf(x)-x)/x | <= 2 - * - * - * Remark. The formula is derived by noting - * erf(x) = (2/sqrt(pi))*(x - x^3/3 + x^5/10 - x^7/42 + ....) - * and that - * 2/sqrt(pi) = 1.128379167095512573896158903121545171688 - * is close to one. The interval is chosen because the fix - * point of erf(x) is near 0.6174 (i.e., erf(x)=x when x is - * near 0.6174), and by some experiment, 0.84375 is chosen to - * guarantee the error is less than one ulp for erf. - * - * 2. For |x| in [0.84375,1.25], let s = |x| - 1, and - * c = 0.84506291151 rounded to single (24 bits) - * erf(x) = sign(x) * (c + P1(s)/Q1(s)) - * erfc(x) = (1-c) - P1(s)/Q1(s) if x > 0 - * 1+(c+P1(s)/Q1(s)) if x < 0 - * |P1/Q1 - (erf(|x|)-c)| <= 2**-59.06 - * Remark: here we use the taylor series expansion at x=1. - * erf(1+s) = erf(1) + s*Poly(s) - * = 0.845.. + P1(s)/Q1(s) - * That is, we use rational approximation to approximate - * erf(1+s) - (c = (single)0.84506291151) - * Note that |P1/Q1|< 0.078 for x in [0.84375,1.25] - * where - * P1(s) = degree 6 poly in s - * Q1(s) = degree 6 poly in s - * - * 3. For x in [1.25,1/0.35(~2.857143)], - * erfc(x) = (1/x)*exp(-x*x-0.5625+R1/S1) - * erf(x) = 1 - erfc(x) - * where - * R1(z) = degree 7 poly in z, (z=1/x^2) - * S1(z) = degree 8 poly in z - * - * 4. For x in [1/0.35,28] - * erfc(x) = (1/x)*exp(-x*x-0.5625+R2/S2) if x > 0 - * = 2.0 - (1/x)*exp(-x*x-0.5625+R2/S2) if -6<x<0 - * = 2.0 - tiny (if x <= -6) - * erf(x) = sign(x)*(1.0 - erfc(x)) if x < 6, else - * erf(x) = sign(x)*(1.0 - tiny) - * where - * R2(z) = degree 6 poly in z, (z=1/x^2) - * S2(z) = degree 7 poly in z - * - * Note1: - * To compute exp(-x*x-0.5625+R/S), let s be a single - * precision number and s := x; then - * -x*x = -s*s + (s-x)*(s+x) - * exp(-x*x-0.5626+R/S) = - * exp(-s*s-0.5625)*exp((s-x)*(s+x)+R/S); - * Note2: - * Here 4 and 5 make use of the asymptotic series - * exp(-x*x) - * erfc(x) ~ ---------- * ( 1 + Poly(1/x^2) ) - * x*sqrt(pi) - * We use rational approximation to approximate - * g(s)=f(1/x^2) = log(erfc(x)*x) - x*x + 0.5625 - * Here is the error bound for R1/S1 and R2/S2 - * |R1/S1 - f(x)| < 2**(-62.57) - * |R2/S2 - f(x)| < 2**(-61.52) - * - * 5. For inf > x >= 28 - * erf(x) = sign(x) *(1 - tiny) (raise inexact) - * erfc(x) = tiny*tiny (raise underflow) if x > 0 - * = 2 - tiny if x<0 - * - * 7. Special case: - * erf(0) = 0, erf(inf) = 1, erf(-inf) = -1, - * erfc(0) = 1, erfc(inf) = 0, erfc(-inf) = 2, - * erfc/erf(NaN) is NaN - */ - - -/* #include "fdlibm.h" */ - -#include <math.h> -#include <stdint.h> -#include <errno.h> - -#define __ieee754_exp exp - -typedef union -{ - double value; - struct - { - uint32_t lsw; - uint32_t msw; - } parts; -} ieee_double_shape_type; - - -static inline int __get_hi_word(const double x) -{ - ieee_double_shape_type u; - u.value = x; - return u.parts.msw; -} - -static inline void __trunc_lo_word(double *x) -{ - ieee_double_shape_type u; - u.value = *x; - u.parts.lsw = 0; - *x = u.value; -} - - -#ifdef __STDC__ -static const double -#else -static double -#endif -tiny = 1e-300, -half= 5.00000000000000000000e-01, /* 0x3FE00000, 0x00000000 */ -one = 1.00000000000000000000e+00, /* 0x3FF00000, 0x00000000 */ -two = 2.00000000000000000000e+00, /* 0x40000000, 0x00000000 */ - /* c = (float)0.84506291151 */ -erx = 8.45062911510467529297e-01, /* 0x3FEB0AC1, 0x60000000 */ -/* - * Coefficients for approximation to erf on [0,0.84375] - */ -efx = 1.28379167095512586316e-01, /* 0x3FC06EBA, 0x8214DB69 */ -efx8= 1.02703333676410069053e+00, /* 0x3FF06EBA, 0x8214DB69 */ -pp0 = 1.28379167095512558561e-01, /* 0x3FC06EBA, 0x8214DB68 */ -pp1 = -3.25042107247001499370e-01, /* 0xBFD4CD7D, 0x691CB913 */ -pp2 = -2.84817495755985104766e-02, /* 0xBF9D2A51, 0xDBD7194F */ -pp3 = -5.77027029648944159157e-03, /* 0xBF77A291, 0x236668E4 */ -pp4 = -2.37630166566501626084e-05, /* 0xBEF8EAD6, 0x120016AC */ -qq1 = 3.97917223959155352819e-01, /* 0x3FD97779, 0xCDDADC09 */ -qq2 = 6.50222499887672944485e-02, /* 0x3FB0A54C, 0x5536CEBA */ -qq3 = 5.08130628187576562776e-03, /* 0x3F74D022, 0xC4D36B0F */ -qq4 = 1.32494738004321644526e-04, /* 0x3F215DC9, 0x221C1A10 */ -qq5 = -3.96022827877536812320e-06, /* 0xBED09C43, 0x42A26120 */ -/* - * Coefficients for approximation to erf in [0.84375,1.25] - */ -pa0 = -2.36211856075265944077e-03, /* 0xBF6359B8, 0xBEF77538 */ -pa1 = 4.14856118683748331666e-01, /* 0x3FDA8D00, 0xAD92B34D */ -pa2 = -3.72207876035701323847e-01, /* 0xBFD7D240, 0xFBB8C3F1 */ -pa3 = 3.18346619901161753674e-01, /* 0x3FD45FCA, 0x805120E4 */ -pa4 = -1.10894694282396677476e-01, /* 0xBFBC6398, 0x3D3E28EC */ -pa5 = 3.54783043256182359371e-02, /* 0x3FA22A36, 0x599795EB */ -pa6 = -2.16637559486879084300e-03, /* 0xBF61BF38, 0x0A96073F */ -qa1 = 1.06420880400844228286e-01, /* 0x3FBB3E66, 0x18EEE323 */ -qa2 = 5.40397917702171048937e-01, /* 0x3FE14AF0, 0x92EB6F33 */ -qa3 = 7.18286544141962662868e-02, /* 0x3FB2635C, 0xD99FE9A7 */ -qa4 = 1.26171219808761642112e-01, /* 0x3FC02660, 0xE763351F */ -qa5 = 1.36370839120290507362e-02, /* 0x3F8BEDC2, 0x6B51DD1C */ -qa6 = 1.19844998467991074170e-02, /* 0x3F888B54, 0x5735151D */ -/* - * Coefficients for approximation to erfc in [1.25,1/0.35] - */ -ra0 = -9.86494403484714822705e-03, /* 0xBF843412, 0x600D6435 */ -ra1 = -6.93858572707181764372e-01, /* 0xBFE63416, 0xE4BA7360 */ -ra2 = -1.05586262253232909814e+01, /* 0xC0251E04, 0x41B0E726 */ -ra3 = -6.23753324503260060396e+01, /* 0xC04F300A, 0xE4CBA38D */ -ra4 = -1.62396669462573470355e+02, /* 0xC0644CB1, 0x84282266 */ -ra5 = -1.84605092906711035994e+02, /* 0xC067135C, 0xEBCCABB2 */ -ra6 = -8.12874355063065934246e+01, /* 0xC0545265, 0x57E4D2F2 */ -ra7 = -9.81432934416914548592e+00, /* 0xC023A0EF, 0xC69AC25C */ -sa1 = 1.96512716674392571292e+01, /* 0x4033A6B9, 0xBD707687 */ -sa2 = 1.37657754143519042600e+02, /* 0x4061350C, 0x526AE721 */ -sa3 = 4.34565877475229228821e+02, /* 0x407B290D, 0xD58A1A71 */ -sa4 = 6.45387271733267880336e+02, /* 0x40842B19, 0x21EC2868 */ -sa5 = 4.29008140027567833386e+02, /* 0x407AD021, 0x57700314 */ -sa6 = 1.08635005541779435134e+02, /* 0x405B28A3, 0xEE48AE2C */ -sa7 = 6.57024977031928170135e+00, /* 0x401A47EF, 0x8E484A93 */ -sa8 = -6.04244152148580987438e-02, /* 0xBFAEEFF2, 0xEE749A62 */ -/* - * Coefficients for approximation to erfc in [1/.35,28] - */ -rb0 = -9.86494292470009928597e-03, /* 0xBF843412, 0x39E86F4A */ -rb1 = -7.99283237680523006574e-01, /* 0xBFE993BA, 0x70C285DE */ -rb2 = -1.77579549177547519889e+01, /* 0xC031C209, 0x555F995A */ -rb3 = -1.60636384855821916062e+02, /* 0xC064145D, 0x43C5ED98 */ -rb4 = -6.37566443368389627722e+02, /* 0xC083EC88, 0x1375F228 */ -rb5 = -1.02509513161107724954e+03, /* 0xC0900461, 0x6A2E5992 */ -rb6 = -4.83519191608651397019e+02, /* 0xC07E384E, 0x9BDC383F */ -sb1 = 3.03380607434824582924e+01, /* 0x403E568B, 0x261D5190 */ -sb2 = 3.25792512996573918826e+02, /* 0x40745CAE, 0x221B9F0A */ -sb3 = 1.53672958608443695994e+03, /* 0x409802EB, 0x189D5118 */ -sb4 = 3.19985821950859553908e+03, /* 0x40A8FFB7, 0x688C246A */ -sb5 = 2.55305040643316442583e+03, /* 0x40A3F219, 0xCEDF3BE6 */ -sb6 = 4.74528541206955367215e+02, /* 0x407DA874, 0xE79FE763 */ -sb7 = -2.24409524465858183362e+01; /* 0xC03670E2, 0x42712D62 */ - -#ifdef __STDC__ - double erf(double x) -#else - double erf(x) - double x; -#endif -{ - int hx,ix,i; - double R,S,P,Q,s,y,z,r; - hx = __get_hi_word(x); - ix = hx&0x7fffffff; - if(ix>=0x7ff00000) { /* erf(nan)=nan */ - i = ((unsigned)hx>>31)<<1; - return (double)(1-i)+one/x; /* erf(+-inf)=+-1 */ - } - - if(ix < 0x3feb0000) { /* |x|<0.84375 */ - if(ix < 0x3e300000) { /* |x|<2**-28 */ - if (ix < 0x00800000) - return 0.125*(8.0*x+efx8*x); /*avoid underflow */ - return x + efx*x; - } - z = x*x; - r = pp0+z*(pp1+z*(pp2+z*(pp3+z*pp4))); - s = one+z*(qq1+z*(qq2+z*(qq3+z*(qq4+z*qq5)))); - y = r/s; - return x + x*y; - } - if(ix < 0x3ff40000) { /* 0.84375 <= |x| < 1.25 */ - s = fabs(x)-one; - P = pa0+s*(pa1+s*(pa2+s*(pa3+s*(pa4+s*(pa5+s*pa6))))); - Q = one+s*(qa1+s*(qa2+s*(qa3+s*(qa4+s*(qa5+s*qa6))))); - if(hx>=0) return erx + P/Q; else return -erx - P/Q; - } - if (ix >= 0x40180000) { /* inf>|x|>=6 */ - if(hx>=0) return one-tiny; else return tiny-one; - } - x = fabs(x); - s = one/(x*x); - if(ix< 0x4006DB6E) { /* |x| < 1/0.35 */ - R=ra0+s*(ra1+s*(ra2+s*(ra3+s*(ra4+s*( - ra5+s*(ra6+s*ra7)))))); - S=one+s*(sa1+s*(sa2+s*(sa3+s*(sa4+s*( - sa5+s*(sa6+s*(sa7+s*sa8))))))); - } else { /* |x| >= 1/0.35 */ - R=rb0+s*(rb1+s*(rb2+s*(rb3+s*(rb4+s*( - rb5+s*rb6))))); - S=one+s*(sb1+s*(sb2+s*(sb3+s*(sb4+s*( - sb5+s*(sb6+s*sb7)))))); - } - z = x; - __trunc_lo_word(&z); - r = __ieee754_exp(-z*z-0.5625)*__ieee754_exp((z-x)*(z+x)+R/S); - if(hx>=0) return one-r/x; else return r/x-one; -} - -#ifdef __STDC__ - double erfc(double x) -#else - double erfc(x) - double x; -#endif -{ - int hx,ix; - double R,S,P,Q,s,y,z,r; - hx = __get_hi_word(x); - ix = hx&0x7fffffff; - if(ix>=0x7ff00000) { /* erfc(nan)=nan */ - /* erfc(+-inf)=0,2 */ - return (double)(((unsigned)hx>>31)<<1)+one/x; - } - - if(ix < 0x3feb0000) { /* |x|<0.84375 */ - if(ix < 0x3c700000) /* |x|<2**-56 */ - return one-x; - z = x*x; - r = pp0+z*(pp1+z*(pp2+z*(pp3+z*pp4))); - s = one+z*(qq1+z*(qq2+z*(qq3+z*(qq4+z*qq5)))); - y = r/s; - if(hx < 0x3fd00000) { /* x<1/4 */ - return one-(x+x*y); - } else { - r = x*y; - r += (x-half); - return half - r ; - } - } - if(ix < 0x3ff40000) { /* 0.84375 <= |x| < 1.25 */ - s = fabs(x)-one; - P = pa0+s*(pa1+s*(pa2+s*(pa3+s*(pa4+s*(pa5+s*pa6))))); - Q = one+s*(qa1+s*(qa2+s*(qa3+s*(qa4+s*(qa5+s*qa6))))); - if(hx>=0) { - z = one-erx; return z - P/Q; - } else { - z = erx+P/Q; return one+z; - } - } - if (ix < 0x403c0000) { /* |x|<28 */ - x = fabs(x); - s = one/(x*x); - if(ix< 0x4006DB6D) { /* |x| < 1/.35 ~ 2.857143*/ - R=ra0+s*(ra1+s*(ra2+s*(ra3+s*(ra4+s*( - ra5+s*(ra6+s*ra7)))))); - S=one+s*(sa1+s*(sa2+s*(sa3+s*(sa4+s*( - sa5+s*(sa6+s*(sa7+s*sa8))))))); - } else { /* |x| >= 1/.35 ~ 2.857143 */ - if(hx<0&&ix>=0x40180000) return two-tiny;/* x < -6 */ - R=rb0+s*(rb1+s*(rb2+s*(rb3+s*(rb4+s*( - rb5+s*rb6))))); - S=one+s*(sb1+s*(sb2+s*(sb3+s*(sb4+s*( - sb5+s*(sb6+s*sb7)))))); - } - z = x; - __trunc_lo_word(&z); - r = __ieee754_exp(-z*z-0.5625)* - __ieee754_exp((z-x)*(z+x)+R/S); - if(hx>0) return r/x; else return two-r/x; - } else { - /* set range error */ - errno = ERANGE; - if(hx>0) return tiny*tiny; else return two-tiny; - } -} diff --git a/winsup/mingw/mingwex/math/scalbn.S b/winsup/mingw/mingwex/math/scalbn.S deleted file mode 100644 index 76e2d396e..000000000 --- a/winsup/mingw/mingwex/math/scalbn.S +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Written by J.T. Conklin <jtc@netbsd.org>. - * Public domain. - */ - - .file "scalbn.S" - .text - .align 4 -.globl _scalbn - .def _scalbn; .scl 2; .type 32; .endef -_scalbn: - fildl 12(%esp) - fldl 4(%esp) - fscale - fstp %st(1) - ret - -.globl _scalbln - .set _scalbln,_scalbn diff --git a/winsup/mingw/mingwex/math/scalbnf.S b/winsup/mingw/mingwex/math/scalbnf.S deleted file mode 100644 index 1fe42a3de..000000000 --- a/winsup/mingw/mingwex/math/scalbnf.S +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Written by J.T. Conklin <jtc@netbsd.org>. - * Public domain. - */ - - .file "scalbnf.S" - .text - .align 4 -.globl _scalbnf - .def _scalbnf; .scl 2; .type 32; .endef -_scalbnf: - fildl 8(%esp) - flds 4(%esp) - fscale - fstp %st(1) - ret - -.globl _scalblnf - .set _scalblnf,_scalbnf diff --git a/winsup/mingw/mingwex/math/scalbnl.S b/winsup/mingw/mingwex/math/scalbnl.S deleted file mode 100644 index 77eaff7be..000000000 --- a/winsup/mingw/mingwex/math/scalbnl.S +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Written by J.T. Conklin <jtc@netbsd.org>. - * Changes for long double by Ulrich Drepper <drepper@cygnus.com> - * Public domain. - */ - - .file "scalbnl.S" - .text - .align 4 -.globl _scalbnl - .def _scalbnl; .scl 2; .type 32; .endef -_scalbnl: - fildl 16(%esp) - fldt 4(%esp) - fscale - fstp %st(1) - ret - -.globl _scalblnl - .set _scalblnl,_scalbnl diff --git a/winsup/mingw/mingwex/math/sf_erf.c b/winsup/mingw/mingwex/math/sf_erf.c deleted file mode 100644 index 2188539a7..000000000 --- a/winsup/mingw/mingwex/math/sf_erf.c +++ /dev/null @@ -1,267 +0,0 @@ -/* sf_erf.c -- float version of s_erf.c. - * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com. - */ - -/* - * ==================================================== - * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. - * - * Developed at SunPro, a Sun Microsystems, Inc. business. - * Permission to use, copy, modify, and distribute this - * software is freely granted, provided that this notice - * is preserved. - * ==================================================== - */ - -/* -#include "fdlibm.h" -*/ -#include <math.h> -#include <stdint.h> -#include <errno.h> - -#define __ieee754_expf expf - - - -typedef union -{ - float value; - uint32_t word; -} ieee_float_shape_type; - -/* Get a 32 bit int from a float. */ - -static inline int -__get_float_word(float d) -{ - ieee_float_shape_type u; - u.value = d; - return u.word; -} - -/* Set a float from a 32 bit int. */ - -#define SET_FLOAT_WORD(d,i) \ -do { \ - ieee_float_shape_type sf_u; \ - sf_u.word = (i); \ - (d) = sf_u.value; \ -} while (0) - -static inline void __trunc_float_word(float * x) -{ - ieee_float_shape_type u; - u.value = * x; - u.word &= 0xfffff000; -} - -#ifdef __v810__ -#define const -#endif - -#ifdef __STDC__ -static const float -#else -static float -#endif -tiny = 1e-30, -half= 5.0000000000e-01, /* 0x3F000000 */ -one = 1.0000000000e+00, /* 0x3F800000 */ -two = 2.0000000000e+00, /* 0x40000000 */ - /* c = (subfloat)0.84506291151 */ -erx = 8.4506291151e-01, /* 0x3f58560b */ -/* - * Coefficients for approximation to erf on [0,0.84375] - */ -efx = 1.2837916613e-01, /* 0x3e0375d4 */ -efx8= 1.0270333290e+00, /* 0x3f8375d4 */ -pp0 = 1.2837916613e-01, /* 0x3e0375d4 */ -pp1 = -3.2504209876e-01, /* 0xbea66beb */ -pp2 = -2.8481749818e-02, /* 0xbce9528f */ -pp3 = -5.7702702470e-03, /* 0xbbbd1489 */ -pp4 = -2.3763017452e-05, /* 0xb7c756b1 */ -qq1 = 3.9791721106e-01, /* 0x3ecbbbce */ -qq2 = 6.5022252500e-02, /* 0x3d852a63 */ -qq3 = 5.0813062117e-03, /* 0x3ba68116 */ -qq4 = 1.3249473704e-04, /* 0x390aee49 */ -qq5 = -3.9602282413e-06, /* 0xb684e21a */ -/* - * Coefficients for approximation to erf in [0.84375,1.25] - */ -pa0 = -2.3621185683e-03, /* 0xbb1acdc6 */ -pa1 = 4.1485610604e-01, /* 0x3ed46805 */ -pa2 = -3.7220788002e-01, /* 0xbebe9208 */ -pa3 = 3.1834661961e-01, /* 0x3ea2fe54 */ -pa4 = -1.1089469492e-01, /* 0xbde31cc2 */ -pa5 = 3.5478305072e-02, /* 0x3d1151b3 */ -pa6 = -2.1663755178e-03, /* 0xbb0df9c0 */ -qa1 = 1.0642088205e-01, /* 0x3dd9f331 */ -qa2 = 5.4039794207e-01, /* 0x3f0a5785 */ -qa3 = 7.1828655899e-02, /* 0x3d931ae7 */ -qa4 = 1.2617121637e-01, /* 0x3e013307 */ -qa5 = 1.3637083583e-02, /* 0x3c5f6e13 */ -qa6 = 1.1984500103e-02, /* 0x3c445aa3 */ -/* - * Coefficients for approximation to erfc in [1.25,1/0.35] - */ -ra0 = -9.8649440333e-03, /* 0xbc21a093 */ -ra1 = -6.9385856390e-01, /* 0xbf31a0b7 */ -ra2 = -1.0558626175e+01, /* 0xc128f022 */ -ra3 = -6.2375331879e+01, /* 0xc2798057 */ -ra4 = -1.6239666748e+02, /* 0xc322658c */ -ra5 = -1.8460508728e+02, /* 0xc3389ae7 */ -ra6 = -8.1287437439e+01, /* 0xc2a2932b */ -ra7 = -9.8143291473e+00, /* 0xc11d077e */ -sa1 = 1.9651271820e+01, /* 0x419d35ce */ -sa2 = 1.3765776062e+02, /* 0x4309a863 */ -sa3 = 4.3456588745e+02, /* 0x43d9486f */ -sa4 = 6.4538726807e+02, /* 0x442158c9 */ -sa5 = 4.2900814819e+02, /* 0x43d6810b */ -sa6 = 1.0863500214e+02, /* 0x42d9451f */ -sa7 = 6.5702495575e+00, /* 0x40d23f7c */ -sa8 = -6.0424413532e-02, /* 0xbd777f97 */ -/* - * Coefficients for approximation to erfc in [1/.35,28] - */ -rb0 = -9.8649431020e-03, /* 0xbc21a092 */ -rb1 = -7.9928326607e-01, /* 0xbf4c9dd4 */ -rb2 = -1.7757955551e+01, /* 0xc18e104b */ -rb3 = -1.6063638306e+02, /* 0xc320a2ea */ -rb4 = -6.3756646729e+02, /* 0xc41f6441 */ -rb5 = -1.0250950928e+03, /* 0xc480230b */ -rb6 = -4.8351919556e+02, /* 0xc3f1c275 */ -sb1 = 3.0338060379e+01, /* 0x41f2b459 */ -sb2 = 3.2579251099e+02, /* 0x43a2e571 */ -sb3 = 1.5367296143e+03, /* 0x44c01759 */ -sb4 = 3.1998581543e+03, /* 0x4547fdbb */ -sb5 = 2.5530502930e+03, /* 0x451f90ce */ -sb6 = 4.7452853394e+02, /* 0x43ed43a7 */ -sb7 = -2.2440952301e+01; /* 0xc1b38712 */ - -#ifdef __STDC__ - float erff(float x) -#else - float erff(x) - float x; -#endif -{ - int32_t hx,ix,i; - float R,S,P,Q,s,y,z,r; - hx = __get_float_word(x); - ix = hx&0x7fffffff; - if(!(ix<0x7f800000L)) { /* erf(nan)=nan */ - i = ((uint32_t)hx>>31)<<1; - return (float)(1-i)+one/x; /* erf(+-inf)=+-1 */ - } - - if(ix < 0x3f580000) { /* |x|<0.84375 */ - if(ix < 0x31800000) { /* |x|<2**-28 */ - if (ix < 0x04000000) - /*avoid underflow */ - return (float)0.125*((float)8.0*x+efx8*x); - return x + efx*x; - } - z = x*x; - r = pp0+z*(pp1+z*(pp2+z*(pp3+z*pp4))); - s = one+z*(qq1+z*(qq2+z*(qq3+z*(qq4+z*qq5)))); - y = r/s; - return x + x*y; - } - if(ix < 0x3fa00000) { /* 0.84375 <= |x| < 1.25 */ - s = fabsf(x)-one; - P = pa0+s*(pa1+s*(pa2+s*(pa3+s*(pa4+s*(pa5+s*pa6))))); - Q = one+s*(qa1+s*(qa2+s*(qa3+s*(qa4+s*(qa5+s*qa6))))); - if(hx>=0) return erx + P/Q; else return -erx - P/Q; - } - if (ix >= 0x40c00000) { /* inf>|x|>=6 */ - if(hx>=0) return one-tiny; else return tiny-one; - } - x = fabsf(x); - s = one/(x*x); - if(ix< 0x4036DB6E) { /* |x| < 1/0.35 */ - R=ra0+s*(ra1+s*(ra2+s*(ra3+s*(ra4+s*( - ra5+s*(ra6+s*ra7)))))); - S=one+s*(sa1+s*(sa2+s*(sa3+s*(sa4+s*( - sa5+s*(sa6+s*(sa7+s*sa8))))))); - } else { /* |x| >= 1/0.35 */ - R=rb0+s*(rb1+s*(rb2+s*(rb3+s*(rb4+s*( - rb5+s*rb6))))); - S=one+s*(sb1+s*(sb2+s*(sb3+s*(sb4+s*( - sb5+s*(sb6+s*sb7)))))); - } - - z = x; - __trunc_float_word (&z); - r = __ieee754_expf(-z*z-(float)0.5625)*__ieee754_expf((z-x)*(z+x)+R/S); - if(hx>=0) return one-r/x; else return r/x-one; -} - -#ifdef __STDC__ - float erfcf(float x) -#else - float erfcf(x) - float x; -#endif -{ - int32_t hx,ix; - float R,S,P,Q,s,y,z,r; - hx = __get_float_word(x); - ix = hx&0x7fffffff; - if(!(ix<0x7f800000L)) { /* erfc(nan)=nan */ - /* erfc(+-inf)=0,2 */ - return (float)(((uint32_t)hx>>31)<<1)+one/x; - } - - if(ix < 0x3f580000) { /* |x|<0.84375 */ - if(ix < 0x23800000) /* |x|<2**-56 */ - return one-x; - z = x*x; - r = pp0+z*(pp1+z*(pp2+z*(pp3+z*pp4))); - s = one+z*(qq1+z*(qq2+z*(qq3+z*(qq4+z*qq5)))); - y = r/s; - if(hx < 0x3e800000) { /* x<1/4 */ - return one-(x+x*y); - } else { - r = x*y; - r += (x-half); - return half - r ; - } - } - if(ix < 0x3fa00000) { /* 0.84375 <= |x| < 1.25 */ - s = fabsf(x)-one; - P = pa0+s*(pa1+s*(pa2+s*(pa3+s*(pa4+s*(pa5+s*pa6))))); - Q = one+s*(qa1+s*(qa2+s*(qa3+s*(qa4+s*(qa5+s*qa6))))); - if(hx>=0) { - z = one-erx; return z - P/Q; - } else { - z = erx+P/Q; return one+z; - } - } - - if (ix < 0x41e00000) { /* |x|<28 */ - x = fabsf(x); - s = one/(x*x); - if(ix< 0x4036DB6D) { /* |x| < 1/.35 ~ 2.857143*/ - R=ra0+s*(ra1+s*(ra2+s*(ra3+s*(ra4+s*( - ra5+s*(ra6+s*ra7)))))); - S=one+s*(sa1+s*(sa2+s*(sa3+s*(sa4+s*( - sa5+s*(sa6+s*(sa7+s*sa8))))))); - } else { /* |x| >= 1/.35 ~ 2.857143 */ - if(hx<0&&ix>=0x40c00000) return two-tiny;/* x < -6 */ - R=rb0+s*(rb1+s*(rb2+s*(rb3+s*(rb4+s*( - rb5+s*rb6))))); - S=one+s*(sb1+s*(sb2+s*(sb3+s*(sb4+s*( - sb5+s*(sb6+s*sb7)))))); - } - z = x; - __trunc_float_word (&z); - r = __ieee754_expf(-z*z-(float)0.5625)* - __ieee754_expf((z-x)*(z+x)+R/S); - if(hx>0) return r/x; else return two-r/x; - } else { - /* set range error */ - errno = ERANGE; - if(hx>0) return tiny*tiny; else return two-tiny; - } -} diff --git a/winsup/mingw/mingwex/math/signbit.c b/winsup/mingw/mingwex/math/signbit.c deleted file mode 100644 index 997ddf86b..000000000 --- a/winsup/mingw/mingwex/math/signbit.c +++ /dev/null @@ -1,13 +0,0 @@ -#define __FP_SIGNBIT 0x0200 - -int __signbit (double x) { - unsigned short sw; - __asm__ ("fxam; fstsw %%ax;" - : "=a" (sw) - : "t" (x) ); - return (sw & __FP_SIGNBIT) != 0; -} - -#undef signbit -int __attribute__ ((alias ("__signbit"))) signbit (double); - diff --git a/winsup/mingw/mingwex/math/signbitf.c b/winsup/mingw/mingwex/math/signbitf.c deleted file mode 100644 index 1c96b9f80..000000000 --- a/winsup/mingw/mingwex/math/signbitf.c +++ /dev/null @@ -1,10 +0,0 @@ -#define __FP_SIGNBIT 0x0200 - -int __signbitf (float x) { - unsigned short sw; - __asm__ ("fxam; fstsw %%ax;" - : "=a" (sw) - : "t" (x) ); - return (sw & __FP_SIGNBIT) != 0; -} -int __attribute__ ((alias ("__signbitf"))) signbitf (float); diff --git a/winsup/mingw/mingwex/math/signbitl.c b/winsup/mingw/mingwex/math/signbitl.c deleted file mode 100644 index 8b7bca5b3..000000000 --- a/winsup/mingw/mingwex/math/signbitl.c +++ /dev/null @@ -1,11 +0,0 @@ -#define __FP_SIGNBIT 0x0200 - -int __signbitl (long double x) { - unsigned short sw; - __asm__ ("fxam; fstsw %%ax;" - : "=a" (sw) - : "t" (x) ); - return (sw & __FP_SIGNBIT) != 0; -} - -int __attribute__ ((alias ("__signbitl"))) signbitl (long double); diff --git a/winsup/mingw/mingwex/math/sinf.S b/winsup/mingw/mingwex/math/sinf.S deleted file mode 100644 index 23e986d11..000000000 --- a/winsup/mingw/mingwex/math/sinf.S +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Written by J.T. Conklin <jtc@netbsd.org>. - * Public domain. - * - * Adapted for `long double' by Ulrich Drepper <drepper@cygnus.com>. - * - * Removed header file dependency for use in libmingwex.a by - * Danny Smith <dannysmith@users.sourceforge.net> - */ - - .file "sinf.S" - .text - .align 4 -.globl _sinf - .def _sinf; .scl 2; .type 32; .endef -_sinf: - flds 4(%esp) - fsin - fnstsw %ax - testl $0x400,%eax - jnz 1f - ret -1: fldpi - fadd %st(0) - fxch %st(1) -2: fprem1 - fnstsw %ax - testl $0x400,%eax - jnz 2b - fstp %st(1) - fsin - ret diff --git a/winsup/mingw/mingwex/math/sinhf.c b/winsup/mingw/mingwex/math/sinhf.c deleted file mode 100644 index 3d6bcff41..000000000 --- a/winsup/mingw/mingwex/math/sinhf.c +++ /dev/null @@ -1,3 +0,0 @@ -#include <math.h> -float sinhf (float x) - {return (float) sinh (x);} diff --git a/winsup/mingw/mingwex/math/sinhl.c b/winsup/mingw/mingwex/math/sinhl.c deleted file mode 100644 index ca6a370b9..000000000 --- a/winsup/mingw/mingwex/math/sinhl.c +++ /dev/null @@ -1,172 +0,0 @@ -/* sinhl.c - * - * Hyperbolic sine, long double precision - * - * - * - * SYNOPSIS: - * - * long double x, y, sinhl(); - * - * y = sinhl( x ); - * - * - * - * DESCRIPTION: - * - * Returns hyperbolic sine of argument in the range MINLOGL to - * MAXLOGL. - * - * The range is partitioned into two segments. If |x| <= 1, a - * rational function of the form x + x**3 P(x)/Q(x) is employed. - * Otherwise the calculation is sinh(x) = ( exp(x) - exp(-x) )/2. - * - * - * - * ACCURACY: - * - * Relative error: - * arithmetic domain # trials peak rms - * IEEE -2,2 10000 1.5e-19 3.9e-20 - * IEEE +-10000 30000 1.1e-19 2.8e-20 - * - */ - -/* -Cephes Math Library Release 2.7: January, 1998 -Copyright 1984, 1991, 1998 by Stephen L. Moshier -*/ - -/* -Modified for mingw -2002-07-22 Danny Smith <dannysmith@users.sourceforge.net> -*/ - -#ifdef __MINGW32__ -#include "cephes_mconf.h" -#else -#include "mconf.h" -#endif - -#ifndef _SET_ERRNO -#define _SET_ERRNO(x) -#endif - -#ifdef UNK -static long double P[] = { - 1.7550769032975377032681E-6L, - 4.1680702175874268714539E-4L, - 3.0993532520425419002409E-2L, - 9.9999999999999999998002E-1L, -}; -static long double Q[] = { - 1.7453965448620151484660E-8L, --5.9116673682651952419571E-6L, - 1.0599252315677389339530E-3L, --1.1403880487744749056675E-1L, - 6.0000000000000000000200E0L, -}; -#endif - -#ifdef IBMPC -static const unsigned short P[] = { -0xec6a,0xd942,0xfbb3,0xeb8f,0x3feb, XPD -0x365e,0xb30a,0xe437,0xda86,0x3ff3, XPD -0x8890,0x01f6,0x2612,0xfde6,0x3ff9, XPD -0x0000,0x0000,0x0000,0x8000,0x3fff, XPD -}; -static const unsigned short Q[] = { -0x4edd,0x4c21,0xad09,0x95ed,0x3fe5, XPD -0x4376,0x9b70,0xd605,0xc65c,0xbfed, XPD -0xc8ad,0x5d21,0x3069,0x8aed,0x3ff5, XPD -0x9c32,0x6374,0x2d4b,0xe98d,0xbffb, XPD -0x0000,0x0000,0x0000,0xc000,0x4001, XPD -}; -#endif - -#ifdef MIEEE -static long P[] = { -0x3feb0000,0xeb8ffbb3,0xd942ec6a, -0x3ff30000,0xda86e437,0xb30a365e, -0x3ff90000,0xfde62612,0x01f68890, -0x3fff0000,0x80000000,0x00000000, -}; -static long Q[] = { -0x3fe50000,0x95edad09,0x4c214edd, -0xbfed0000,0xc65cd605,0x9b704376, -0x3ff50000,0x8aed3069,0x5d21c8ad, -0xbffb0000,0xe98d2d4b,0x63749c32, -0x40010000,0xc0000000,0x00000000, -}; -#endif - -#ifndef __MINGW32__ -extern long double MAXNUML, MAXLOGL, MINLOGL, LOGE2L; -#ifdef ANSIPROT -extern long double fabsl ( long double ); -extern long double expl ( long double ); -extern long double polevll ( long double, void *, int ); -extern long double p1evll ( long double, void *, int ); -#else -long double fabsl(), expl(), polevll(), p1evll(); -#endif -#ifdef INFINITIES -extern long double INFINITYL; -#endif -#ifdef NANS -extern long double NANL; -#endif -#endif /* __MINGW32__ */ - -long double sinhl(x) -long double x; -{ -long double a; - -#ifdef MINUSZERO -if( x == 0.0 ) - return(x); -#endif -#ifdef NANS -if (isnanl(x)) - { - _SET_ERRNO(EDOM); - } -#endif -a = fabsl(x); -if( (x > (MAXLOGL + LOGE2L)) || (x > -(MINLOGL-LOGE2L) ) ) - { - mtherr( "sinhl", DOMAIN ); - _SET_ERRNO(ERANGE); -#ifdef INFINITIES - if( x > 0.0L ) - return( INFINITYL ); - else - return( -INFINITYL ); -#else - if( x > 0.0L ) - return( MAXNUML ); - else - return( -MAXNUML ); -#endif - } -if( a > 1.0L ) - { - if( a >= (MAXLOGL - LOGE2L) ) - { - a = expl(0.5L*a); - a = (0.5L * a) * a; - if( x < 0.0L ) - a = -a; - return(a); - } - a = expl(a); - a = 0.5L*a - (0.5L/a); - if( x < 0.0L ) - a = -a; - return(a); - } - -a *= a; -return( x + x * a * (polevll(a,P,3)/polevll(a,Q,4)) ); -} diff --git a/winsup/mingw/mingwex/math/sinl.S b/winsup/mingw/mingwex/math/sinl.S deleted file mode 100644 index 16b2d9e50..000000000 --- a/winsup/mingw/mingwex/math/sinl.S +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Written by J.T. Conklin <jtc@netbsd.org>. - * Public domain. - * - * Adapted for `long double' by Ulrich Drepper <drepper@cygnus.com>. - * - * Removed header file dependency for use in libmingwex.a by - * Danny Smith <dannysmith@users.sourceforge.net> - */ - - .file "sinl.S" - .text - .align 4 -.globl _sinl - .def _sinl; .scl 2; .type 32; .endef -_sinl: - fldt 4(%esp) - fsin - fnstsw %ax - testl $0x400,%eax - jnz 1f - ret -1: fldpi - fadd %st(0) - fxch %st(1) -2: fprem1 - fnstsw %ax - testl $0x400,%eax - jnz 2b - fstp %st(1) - fsin - ret diff --git a/winsup/mingw/mingwex/math/sqrtf.c b/winsup/mingw/mingwex/math/sqrtf.c deleted file mode 100644 index b1029cad8..000000000 --- a/winsup/mingw/mingwex/math/sqrtf.c +++ /dev/null @@ -1,20 +0,0 @@ -#include <math.h> -#include <errno.h> - -extern float __QNANF; - -float -sqrtf (float x) -{ - if (x < 0.0F ) - { - errno = EDOM; - return __QNANF; - } - else - { - float res; - asm ("fsqrt" : "=t" (res) : "0" (x)); - return res; - } -} diff --git a/winsup/mingw/mingwex/math/sqrtl.c b/winsup/mingw/mingwex/math/sqrtl.c deleted file mode 100644 index dba68d878..000000000 --- a/winsup/mingw/mingwex/math/sqrtl.c +++ /dev/null @@ -1,20 +0,0 @@ -#include <math.h> -#include <errno.h> - -extern long double __QNANL; - -long double -sqrtl (long double x) -{ - if (x < 0.0L ) - { - errno = EDOM; - return __QNANL; - } - else - { - long double res; - asm ("fsqrt" : "=t" (res) : "0" (x)); - return res; - } -} diff --git a/winsup/mingw/mingwex/math/tanf.S b/winsup/mingw/mingwex/math/tanf.S deleted file mode 100644 index 540fc6836..000000000 --- a/winsup/mingw/mingwex/math/tanf.S +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Written by J.T. Conklin <jtc@netbsd.org>. - * Public domain. - * - * Removed header file dependency for use in libmingwex.a by - * Danny Smith <dannysmith@users.sourceforge.net> - */ - .file "tanf.S" - .text - .align 4 -.globl _tanf - .def _tanf; .scl 2; .type 32; .endef -_tanf: - flds 4(%esp) - fptan - fnstsw %ax - testl $0x400,%eax - jnz 1f - fstp %st(0) - ret -1: fldpi - fadd %st(0) - fxch %st(1) -2: fprem1 - fstsw %ax - testl $0x400,%eax - jnz 2b - fstp %st(1) - fptan - fstp %st(0) - ret diff --git a/winsup/mingw/mingwex/math/tanhf.c b/winsup/mingw/mingwex/math/tanhf.c deleted file mode 100644 index b7c56f05c..000000000 --- a/winsup/mingw/mingwex/math/tanhf.c +++ /dev/null @@ -1,3 +0,0 @@ -#include <math.h> -float tanhf (float x) - {return (float) tanh (x);} diff --git a/winsup/mingw/mingwex/math/tanhl.c b/winsup/mingw/mingwex/math/tanhl.c deleted file mode 100644 index d5d86d0ae..000000000 --- a/winsup/mingw/mingwex/math/tanhl.c +++ /dev/null @@ -1,151 +0,0 @@ -/* tanhl.c - * - * Hyperbolic tangent, long double precision - * - * - * - * SYNOPSIS: - * - * long double x, y, tanhl(); - * - * y = tanhl( x ); - * - * - * - * DESCRIPTION: - * - * Returns hyperbolic tangent of argument in the range MINLOGL to - * MAXLOGL. - * - * A rational function is used for |x| < 0.625. The form - * x + x**3 P(x)/Q(x) of Cody _& Waite is employed. - * Otherwise, - * tanh(x) = sinh(x)/cosh(x) = 1 - 2/(exp(2x) + 1). - * - * - * - * ACCURACY: - * - * Relative error: - * arithmetic domain # trials peak rms - * IEEE -2,2 30000 1.3e-19 2.4e-20 - * - */ - -/* -Cephes Math Library Release 2.7: May, 1998 -Copyright 1984, 1987, 1989, 1998 by Stephen L. Moshier -*/ - -/* -Modified for mingw -2002-07-22 Danny Smith <dannysmith@users.sourceforge.net> -*/ - -#ifdef __MINGW32__ -#include "cephes_mconf.h" -#else -#include "mconf.h" -#endif - -#ifndef _SET_ERRNO -#define _SET_ERRNO(x) -#endif - -#ifdef UNK -static long double P[] = { --6.8473739392677100872869E-5L, --9.5658283111794641589011E-1L, --8.4053568599672284488465E1L, --1.3080425704712825945553E3L, -}; -static long double Q[] = { -/* 1.0000000000000000000000E0L,*/ - 9.6259501838840336946872E1L, - 1.8218117903645559060232E3L, - 3.9241277114138477845780E3L, -}; -#endif - -#ifdef IBMPC -static unsigned short P[] = { -0xd2a4,0x1b0c,0x8f15,0x8f99,0xbff1, XPD -0x5959,0x9111,0x9cc7,0xf4e2,0xbffe, XPD -0xb576,0xef5e,0x6d57,0xa81b,0xc005, XPD -0xe3be,0xbfbd,0x5cbc,0xa381,0xc009, XPD -}; -static unsigned short Q[] = { -/*0x0000,0x0000,0x0000,0x8000,0x3fff,*/ -0x687f,0xce24,0xdd6c,0xc084,0x4005, XPD -0x3793,0xc95f,0xfa2f,0xe3b9,0x4009, XPD -0xd5a2,0x1f9c,0x0b1b,0xf542,0x400a, XPD -}; -#endif - -#ifdef MIEEE -static long P[] = { -0xbff10000,0x8f998f15,0x1b0cd2a4, -0xbffe0000,0xf4e29cc7,0x91115959, -0xc0050000,0xa81b6d57,0xef5eb576, -0xc0090000,0xa3815cbc,0xbfbde3be, -}; -static long Q[] = { -/*0x3fff0000,0x80000000,0x00000000,*/ -0x40050000,0xc084dd6c,0xce24687f, -0x40090000,0xe3b9fa2f,0xc95f3793, -0x400a0000,0xf5420b1b,0x1f9cd5a2, -}; -#endif - -#ifndef __MINGW32__ -extern long double MAXLOGL; -#ifdef ANSIPROT -extern long double fabsl ( long double ); -extern long double expl ( long double ); -extern long double polevll ( long double, void *, int ); -extern long double p1evll ( long double, void *, int ); -#else -long double fabsl(), expl(), polevll(), p1evll(); -#endif -#endif /* __MINGW32__ */ - -long double tanhl(x) -long double x; -{ -long double s, z; - -#ifdef MINUSZERO -if( x == 0.0L ) - return(x); -#endif -if (isnanl(x)) - { - _SET_ERRNO (EDOM); - return x; - } - -z = fabsl(x); -if( z > 0.5L * MAXLOGL ) - { - _SET_ERRNO (ERANGE); - if( x > 0 ) - return( 1.0L ); - else - return( -1.0L ); - } -if( z >= 0.625L ) - { - s = expl(2.0*z); - z = 1.0L - 2.0/(s + 1.0L); - if( x < 0 ) - z = -z; - } -else - { - s = x * x; - z = polevll( s, P, 3 )/p1evll(s, Q, 3); - z = x * s * z; - z = x + z; - } -return( z ); -} diff --git a/winsup/mingw/mingwex/math/tanl.S b/winsup/mingw/mingwex/math/tanl.S deleted file mode 100644 index fd30019a8..000000000 --- a/winsup/mingw/mingwex/math/tanl.S +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Written by J.T. Conklin <jtc@netbsd.org>. - * Public domain. - * - * Adapted for `long double' by Ulrich Drepper <drepper@cygnus.com>. - * - * Removed header file dependency for use in libmingwex.a by - * Danny Smith <dannysmith@users.sourceforge.net> - */ - .file "tanl.S" - .text - .align 4 -.globl _tanl - .def _tanl; .scl 2; .type 32; .endef -_tanl: - fldt 4(%esp) - fptan - fnstsw %ax - testl $0x400,%eax - jnz 1f - fstp %st(0) - ret -1: fldpi - fadd %st(0) - fxch %st(1) -2: fprem1 - fstsw %ax - testl $0x400,%eax - jnz 2b - fstp %st(1) - fptan - fstp %st(0) - ret diff --git a/winsup/mingw/mingwex/math/tgamma.c b/winsup/mingw/mingwex/math/tgamma.c deleted file mode 100644 index b48ac5cb2..000000000 --- a/winsup/mingw/mingwex/math/tgamma.c +++ /dev/null @@ -1,388 +0,0 @@ -/* gamma.c - * - * Gamma function - * - * - * - * SYNOPSIS: - * - * double x, y, __tgamma_r(); - * int* sgngam; - * y = __tgamma_r( x, sgngam ); - * - * double x, y, tgamma(); - * y = tgamma( x) - * - * - * - * DESCRIPTION: - * - * Returns gamma function of the argument. The result is - * correctly signed. In the reentrant version the sign (+1 or -1) - * is returned in the variable referenced by sgngam. - * - * Arguments |x| <= 34 are reduced by recurrence and the function - * approximated by a rational function of degree 6/7 in the - * interval (2,3). Large arguments are handled by Stirling's - * formula. Large negative arguments are made positive using - * a reflection formula. - * - * - * ACCURACY: - * - * Relative error: - * arithmetic domain # trials peak rms - * DEC -34, 34 10000 1.3e-16 2.5e-17 - * IEEE -170,-33 20000 2.3e-15 3.3e-16 - * IEEE -33, 33 20000 9.4e-16 2.2e-16 - * IEEE 33, 171.6 20000 2.3e-15 3.2e-16 - * - * Error for arguments outside the test range will be larger - * owing to error amplification by the exponential function. - * - */ - -/* -Cephes Math Library Release 2.8: June, 2000 -Copyright 1984, 1987, 1989, 1992, 2000 by Stephen L. Moshier -*/ - - -/* - * 26-11-2002 Modified for mingw. - * Danny Smith <dannysmith@users.sourceforge.net> - */ - - -#ifndef __MINGW32__ -#include "mconf.h" -#else -#include "cephes_mconf.h" -#endif - -#ifdef UNK -static const double P[] = { - 1.60119522476751861407E-4, - 1.19135147006586384913E-3, - 1.04213797561761569935E-2, - 4.76367800457137231464E-2, - 2.07448227648435975150E-1, - 4.94214826801497100753E-1, - 9.99999999999999996796E-1 -}; -static const double Q[] = { --2.31581873324120129819E-5, - 5.39605580493303397842E-4, --4.45641913851797240494E-3, - 1.18139785222060435552E-2, - 3.58236398605498653373E-2, --2.34591795718243348568E-1, - 7.14304917030273074085E-2, - 1.00000000000000000320E0 -}; -#define MAXGAM 171.624376956302725 -static const double LOGPI = 1.14472988584940017414; -#endif - -#ifdef DEC -static const unsigned short P[] = { -0035047,0162701,0146301,0005234, -0035634,0023437,0032065,0176530, -0036452,0137157,0047330,0122574, -0037103,0017310,0143041,0017232, -0037524,0066516,0162563,0164605, -0037775,0004671,0146237,0014222, -0040200,0000000,0000000,0000000 -}; -static const unsigned short Q[] = { -0134302,0041724,0020006,0116565, -0035415,0072121,0044251,0025634, -0136222,0003447,0035205,0121114, -0036501,0107552,0154335,0104271, -0037022,0135717,0014776,0171471, -0137560,0034324,0165024,0037021, -0037222,0045046,0047151,0161213, -0040200,0000000,0000000,0000000 -}; -#define MAXGAM 34.84425627277176174 -#endif - -#ifdef IBMPC -static const unsigned short P[] = { -0x2153,0x3998,0xfcb8,0x3f24, -0xbfab,0xe686,0x84e3,0x3f53, -0x14b0,0xe9db,0x57cd,0x3f85, -0x23d3,0x18c4,0x63d9,0x3fa8, -0x7d31,0xdcae,0x8da9,0x3fca, -0xe312,0x3993,0xa137,0x3fdf, -0x0000,0x0000,0x0000,0x3ff0 -}; -static const unsigned short Q[] = { -0xd3af,0x8400,0x487a,0xbef8, -0x2573,0x2915,0xae8a,0x3f41, -0xb44a,0xe750,0x40e4,0xbf72, -0xb117,0x5b1b,0x31ed,0x3f88, -0xde67,0xe33f,0x5779,0x3fa2, -0x87c2,0x9d42,0x071a,0xbfce, -0x3c51,0xc9cd,0x4944,0x3fb2, -0x0000,0x0000,0x0000,0x3ff0 -}; -#define MAXGAM 171.624376956302725 -#endif - -#ifdef MIEEE -static const unsigned short P[] = { -0x3f24,0xfcb8,0x3998,0x2153, -0x3f53,0x84e3,0xe686,0xbfab, -0x3f85,0x57cd,0xe9db,0x14b0, -0x3fa8,0x63d9,0x18c4,0x23d3, -0x3fca,0x8da9,0xdcae,0x7d31, -0x3fdf,0xa137,0x3993,0xe312, -0x3ff0,0x0000,0x0000,0x0000 -}; -static const unsigned short Q[] = { -0xbef8,0x487a,0x8400,0xd3af, -0x3f41,0xae8a,0x2915,0x2573, -0xbf72,0x40e4,0xe750,0xb44a, -0x3f88,0x31ed,0x5b1b,0xb117, -0x3fa2,0x5779,0xe33f,0xde67, -0xbfce,0x071a,0x9d42,0x87c2, -0x3fb2,0x4944,0xc9cd,0x3c51, -0x3ff0,0x0000,0x0000,0x0000 -}; -#define MAXGAM 171.624376956302725 -#endif - -/* Stirling's formula for the gamma function */ -#if UNK -static const double STIR[5] = { - 7.87311395793093628397E-4, --2.29549961613378126380E-4, --2.68132617805781232825E-3, - 3.47222221605458667310E-3, - 8.33333333333482257126E-2, -}; -#define MAXSTIR 143.01608 -static const double SQTPI = 2.50662827463100050242E0; -#endif -#if DEC -static const unsigned short STIR[20] = { -0035516,0061622,0144553,0112224, -0135160,0131531,0037460,0165740, -0136057,0134460,0037242,0077270, -0036143,0107070,0156306,0027751, -0037252,0125252,0125252,0146064, -}; -#define MAXSTIR 26.77 -static const unsigned short SQT[4] = { -0040440,0066230,0177661,0034055, -}; -#define SQTPI *(double *)SQT -#endif -#if IBMPC -static const unsigned short STIR[20] = { -0x7293,0x592d,0xcc72,0x3f49, -0x1d7c,0x27e6,0x166b,0xbf2e, -0x4fd7,0x07d4,0xf726,0xbf65, -0xc5fd,0x1b98,0x71c7,0x3f6c, -0x5986,0x5555,0x5555,0x3fb5, -}; -#define MAXSTIR 143.01608 - -static const union -{ - unsigned short s[4]; - double d; -} sqt = {{0x2706,0x1ff6,0x0d93,0x4004}}; -#define SQTPI (sqt.d) -#endif -#if MIEEE -static const unsigned short STIR[20] = { -0x3f49,0xcc72,0x592d,0x7293, -0xbf2e,0x166b,0x27e6,0x1d7c, -0xbf65,0xf726,0x07d4,0x4fd7, -0x3f6c,0x71c7,0x1b98,0xc5fd, -0x3fb5,0x5555,0x5555,0x5986, -}; -#define MAXSTIR 143.01608 -static const unsigned short SQT[4] = { -0x4004,0x0d93,0x1ff6,0x2706, -}; -#define SQTPI *(double *)SQT -#endif - -#ifndef __MINGW32__ -int sgngam = 0; -extern int sgngam; -extern double MAXLOG, MAXNUM, PI; -#ifdef ANSIPROT -extern double pow ( double, double ); -extern double log ( double ); -extern double exp ( double ); -extern double sin ( double ); -extern double polevl ( double, void *, int ); -extern double p1evl ( double, void *, int ); -extern double floor ( double ); -extern double fabs ( double ); -extern int isnan ( double ); -extern int isfinite ( double ); -static double stirf ( double ); -double lgam ( double ); -#else -double pow(), log(), exp(), sin(), polevl(), p1evl(), floor(), fabs(); -int isnan(), isfinite(); -static double stirf(); -double lgam(); -#endif -#ifdef INFINITIES -extern double INFINITY; -#endif -#ifdef NANS -extern double NAN; -#endif -#else /* __MINGW32__ */ -static double stirf ( double ); -#endif - -/* Gamma function computed by Stirling's formula. - * The polynomial STIR is valid for 33 <= x <= 172. - */ -static double stirf(x) -double x; -{ -double y, w, v; - -w = 1.0/x; -w = 1.0 + w * polevl( w, STIR, 4 ); -y = exp(x); -if( x > MAXSTIR ) - { /* Avoid overflow in pow() */ - v = pow( x, 0.5 * x - 0.25 ); - y = v * (v / y); - } -else - { - y = pow( x, x - 0.5 ) / y; - } -y = SQTPI * y * w; -return( y ); -} - - - -double __tgamma_r(double x, int* sgngam) -{ -double p, q, z; -int i; - -*sgngam = 1; -#ifdef NANS -if( isnan(x) ) - return(x); -#endif -#ifdef INFINITIES -#ifdef NANS -if( x == INFINITY ) - return(x); -if( x == -INFINITY ) - return(NAN); -#else -if( !isfinite(x) ) - return(x); -#endif -#endif -q = fabs(x); - -if( q > 33.0 ) - { - if( x < 0.0 ) - { - p = floor(q); - if( p == q ) - { -gsing: - _SET_ERRNO(EDOM); - mtherr( "tgamma", SING ); -#ifdef INFINITIES - return (INFINITY); -#else - return (MAXNUM); -#endif - } - i = p; - if( (i & 1) == 0 ) - *sgngam = -1; - z = q - p; - if( z > 0.5 ) - { - p += 1.0; - z = q - p; - } - z = q * sin( PI * z ); - if( z == 0.0 ) - { - _SET_ERRNO(ERANGE); - mtherr( "tgamma", OVERFLOW ); -#ifdef INFINITIES - return( *sgngam * INFINITY); -#else - return( *sgngam * MAXNUM); -#endif - } - z = fabs(z); - z = PI/(z * stirf(q) ); - } - else - { - z = stirf(x); - } - return( *sgngam * z ); - } - -z = 1.0; -while( x >= 3.0 ) - { - x -= 1.0; - z *= x; - } - -while( x < 0.0 ) - { - if( x > -1.E-9 ) - goto Small; - z /= x; - x += 1.0; - } - -while( x < 2.0 ) - { - if( x < 1.e-9 ) - goto Small; - z /= x; - x += 1.0; - } - -if( x == 2.0 ) - return(z); - -x -= 2.0; -p = polevl( x, P, 6 ); -q = polevl( x, Q, 7 ); -return( z * p / q ); - -Small: -if( x == 0.0 ) - { - goto gsing; - } -else - return( z/((1.0 + 0.5772156649015329 * x) * x) ); -} - -/* This is the C99 version */ - -double tgamma(double x) -{ - int local_sgngam=0; - return (__tgamma_r(x, &local_sgngam)); -} diff --git a/winsup/mingw/mingwex/math/tgammaf.c b/winsup/mingw/mingwex/math/tgammaf.c deleted file mode 100644 index 07d294971..000000000 --- a/winsup/mingw/mingwex/math/tgammaf.c +++ /dev/null @@ -1,265 +0,0 @@ -/* gammaf.c - * - * Gamma function - * - * - * - * SYNOPSIS: - * - * float x, y, __tgammaf_r(); - * int* sgngamf; - * y = __tgammaf_r( x, sgngamf ); - * - * float x, y, tgammaf(); - * y = tgammaf( x); - * - * - * DESCRIPTION: - * - * Returns gamma function of the argument. The result is - * correctly signed. In the reentrant version the sign (+1 or -1) - * is returned in the variable referenced by sgngamf. - * - * Arguments between 0 and 10 are reduced by recurrence and the - * function is approximated by a polynomial function covering - * the interval (2,3). Large arguments are handled by Stirling's - * formula. Negative arguments are made positive using - * a reflection formula. - * - * - * ACCURACY: - * - * Relative error: - * arithmetic domain # trials peak rms - * IEEE 0,-33 100,000 5.7e-7 1.0e-7 - * IEEE -33,0 100,000 6.1e-7 1.2e-7 - * - * - */ - -/* -Cephes Math Library Release 2.7: July, 1998 -Copyright 1984, 1987, 1989, 1992, 1998 by Stephen L. Moshier -*/ - - -/* - * 26-11-2002 Modified for mingw. - * Danny Smith <dannysmith@users.sourceforge.net> - */ - - -#ifndef __MINGW32__ -#include "mconf.h" -#else -#include "cephes_mconf.h" -#endif - -/* define MAXGAM 34.84425627277176174 */ - -/* Stirling's formula for the gamma function - * gamma(x) = sqrt(2 pi) x^(x-.5) exp(-x) ( 1 + 1/x P(1/x) ) - * .028 < 1/x < .1 - * relative error < 1.9e-11 - */ -static const float STIR[] = { --2.705194986674176E-003, - 3.473255786154910E-003, - 8.333331788340907E-002, -}; -static const float MAXSTIR = 26.77; -static const float SQTPIF = 2.50662827463100050242; /* sqrt( 2 pi ) */ - -#ifndef __MINGW32__ - -extern float MAXLOGF, MAXNUMF, PIF; - -#ifdef ANSIC -float expf(float); -float logf(float); -float powf( float, float ); -float sinf(float); -float gammaf(float); -float floorf(float); -static float stirf(float); -float polevlf( float, float *, int ); -float p1evlf( float, float *, int ); -#else -float expf(), logf(), powf(), sinf(), floorf(); -float polevlf(), p1evlf(); -static float stirf(); -#endif - -#else /* __MINGW32__ */ -static float stirf(float); -#endif - -/* Gamma function computed by Stirling's formula, - * sqrt(2 pi) x^(x-.5) exp(-x) (1 + 1/x P(1/x)) - * The polynomial STIR is valid for 33 <= x <= 172. - */ -static float stirf( float x ) -{ -float y, w, v; - -w = 1.0/x; -w = 1.0 + w * polevlf( w, STIR, 2 ); -y = expf( -x ); -if( x > MAXSTIR ) - { /* Avoid overflow in pow() */ - v = powf( x, 0.5 * x - 0.25 ); - y *= v; - y *= v; - } -else - { - y = powf( x, x - 0.5 ) * y; - } -y = SQTPIF * y * w; -return( y ); -} - - -/* gamma(x+2), 0 < x < 1 */ -static const float P[] = { - 1.536830450601906E-003, - 5.397581592950993E-003, - 4.130370201859976E-003, - 7.232307985516519E-002, - 8.203960091619193E-002, - 4.117857447645796E-001, - 4.227867745131584E-001, - 9.999999822945073E-001, -}; - -float __tgammaf_r( float x, int* sgngamf) -{ -float p, q, z, nz; -int i, direction, negative; - -#ifdef NANS -if( isnan(x) ) - return(x); -#endif -#ifdef INFINITIES -#ifdef NANS -if( x == INFINITYF ) - return(x); -if( x == -INFINITYF ) - return(NANF); -#else -if( !isfinite(x) ) - return(x); -#endif -#endif - -*sgngamf = 1; -negative = 0; -nz = 0.0; -if( x < 0.0 ) - { - negative = 1; - q = -x; - p = floorf(q); - if( p == q ) - { -gsing: - _SET_ERRNO(EDOM); - mtherr( "tgammaf", SING ); -#ifdef INFINITIES - return (INFINITYF); -#else - return (MAXNUMF); -#endif - } - i = p; - if( (i & 1) == 0 ) - *sgngamf = -1; - nz = q - p; - if( nz > 0.5 ) - { - p += 1.0; - nz = q - p; - } - nz = q * sinf( PIF * nz ); - if( nz == 0.0 ) - { - _SET_ERRNO(ERANGE); - mtherr( "tgamma", OVERFLOW ); -#ifdef INFINITIES - return( *sgngamf * INFINITYF); -#else - return( *sgngamf * MAXNUMF); -#endif - } - if( nz < 0 ) - nz = -nz; - x = q; - } -if( x >= 10.0 ) - { - z = stirf(x); - } -if( x < 2.0 ) - direction = 1; -else - direction = 0; -z = 1.0; -while( x >= 3.0 ) - { - x -= 1.0; - z *= x; - } -/* -while( x < 0.0 ) - { - if( x > -1.E-4 ) - goto Small; - z *=x; - x += 1.0; - } -*/ -while( x < 2.0 ) - { - if( x < 1.e-4 ) - goto Small; - z *=x; - x += 1.0; - } - -if( direction ) - z = 1.0/z; - -if( x == 2.0 ) - return(z); - -x -= 2.0; -p = z * polevlf( x, P, 7 ); - -gdone: - -if( negative ) - { - p = *sgngamf * PIF/(nz * p ); - } -return(p); - -Small: -if( x == 0.0 ) - { - goto gsing; - } -else - { - p = z / ((1.0 + 0.5772156649015329 * x) * x); - goto gdone; - } -} - -/* This is the C99 version */ - -float tgammaf(float x) -{ - int local_sgngamf=0; - return (__tgammaf_r(x, &local_sgngamf)); -} diff --git a/winsup/mingw/mingwex/math/tgammal.c b/winsup/mingw/mingwex/math/tgammal.c deleted file mode 100644 index 6db4e3af7..000000000 --- a/winsup/mingw/mingwex/math/tgammal.c +++ /dev/null @@ -1,501 +0,0 @@ -/* gammal.c - * - * Gamma function - * - * - * - * SYNOPSIS: - * - * long double x, y, __tgammal_r(); - * int* sgngaml; - * y = __tgammal_r( x, sgngaml ); - * - * long double x, y, tgammal(); - * y = tgammal( x); * - * - * - * DESCRIPTION: - * - * Returns gamma function of the argument. The result is - * correctly signed. In the reentrant version the sign (+1 or -1) - * is returned in the variable referenced by sgngamf. - * - * Arguments |x| <= 13 are reduced by recurrence and the function - * approximated by a rational function of degree 7/8 in the - * interval (2,3). Large arguments are handled by Stirling's - * formula. Large negative arguments are made positive using - * a reflection formula. - * - * - * ACCURACY: - * - * Relative error: - * arithmetic domain # trials peak rms - * IEEE -40,+40 10000 3.6e-19 7.9e-20 - * IEEE -1755,+1755 10000 4.8e-18 6.5e-19 - * - * Accuracy for large arguments is dominated by error in powl(). - * - */ - -/* -Copyright 1994 by Stephen L. Moshier -*/ - - -/* - * 26-11-2002 Modified for mingw. - * Danny Smith <dannysmith@users.sourceforge.net> - */ - - -#ifndef __MINGW32__ -#include "mconf.h" -#else -#include "cephes_mconf.h" -#endif - -/* -gamma(x+2) = gamma(x+2) P(x)/Q(x) -0 <= x <= 1 -Relative error -n=7, d=8 -Peak error = 1.83e-20 -Relative error spread = 8.4e-23 -*/ - -#if UNK -static const long double P[8] = { - 4.212760487471622013093E-5L, - 4.542931960608009155600E-4L, - 4.092666828394035500949E-3L, - 2.385363243461108252554E-2L, - 1.113062816019361559013E-1L, - 3.629515436640239168939E-1L, - 8.378004301573126728826E-1L, - 1.000000000000000000009E0L, -}; -static const long double Q[9] = { --1.397148517476170440917E-5L, - 2.346584059160635244282E-4L, --1.237799246653152231188E-3L, --7.955933682494738320586E-4L, - 2.773706565840072979165E-2L, --4.633887671244534213831E-2L, --2.243510905670329164562E-1L, - 4.150160950588455434583E-1L, - 9.999999999999999999908E-1L, -}; -#endif -#if IBMPC -static const unsigned short P[] = { -0x434a,0x3f22,0x2bda,0xb0b2,0x3ff0, XPD -0xf5aa,0xe82f,0x335b,0xee2e,0x3ff3, XPD -0xbe6c,0x3757,0xc717,0x861b,0x3ff7, XPD -0x7f43,0x5196,0xb166,0xc368,0x3ff9, XPD -0x9549,0x8eb5,0x8c3a,0xe3f4,0x3ffb, XPD -0x8d75,0x23af,0xc8e4,0xb9d4,0x3ffd, XPD -0x29cf,0x19b3,0x16c8,0xd67a,0x3ffe, XPD -0x0000,0x0000,0x0000,0x8000,0x3fff, XPD -}; -static const unsigned short Q[] = { -0x5473,0x2de8,0x1268,0xea67,0xbfee, XPD -0x334b,0xc2f0,0xa2dd,0xf60e,0x3ff2, XPD -0xbeed,0x1853,0xa691,0xa23d,0xbff5, XPD -0x296e,0x7cb1,0x5dfd,0xd08f,0xbff4, XPD -0x0417,0x7989,0xd7bc,0xe338,0x3ff9, XPD -0x3295,0x3698,0xd580,0xbdcd,0xbffa, XPD -0x75ef,0x3ab7,0x4ad3,0xe5bc,0xbffc, XPD -0xe458,0x2ec7,0xfd57,0xd47c,0x3ffd, XPD -0x0000,0x0000,0x0000,0x8000,0x3fff, XPD -}; -#endif -#if MIEEE -static const long P[24] = { -0x3ff00000,0xb0b22bda,0x3f22434a, -0x3ff30000,0xee2e335b,0xe82ff5aa, -0x3ff70000,0x861bc717,0x3757be6c, -0x3ff90000,0xc368b166,0x51967f43, -0x3ffb0000,0xe3f48c3a,0x8eb59549, -0x3ffd0000,0xb9d4c8e4,0x23af8d75, -0x3ffe0000,0xd67a16c8,0x19b329cf, -0x3fff0000,0x80000000,0x00000000, -}; -static const long Q[27] = { -0xbfee0000,0xea671268,0x2de85473, -0x3ff20000,0xf60ea2dd,0xc2f0334b, -0xbff50000,0xa23da691,0x1853beed, -0xbff40000,0xd08f5dfd,0x7cb1296e, -0x3ff90000,0xe338d7bc,0x79890417, -0xbffa0000,0xbdcdd580,0x36983295, -0xbffc0000,0xe5bc4ad3,0x3ab775ef, -0x3ffd0000,0xd47cfd57,0x2ec7e458, -0x3fff0000,0x80000000,0x00000000, -}; -#endif -/* -static const long double P[] = { --3.01525602666895735709e0L, --3.25157411956062339893e1L, --2.92929976820724030353e2L, --1.70730828800510297666e3L, --7.96667499622741999770e3L, --2.59780216007146401957e4L, --5.99650230220855581642e4L, --7.15743521530849602425e4L -}; -static const long double Q[] = { - 1.00000000000000000000e0L, --1.67955233807178858919e1L, - 8.85946791747759881659e1L, - 5.69440799097468430177e1L, --1.98526250512761318471e3L, - 3.31667508019495079814e3L, - 1.60577839621734713377e4L, --2.97045081369399940529e4L, --7.15743521530849602412e4L -}; -*/ -#define MAXGAML 1755.455L -/*static const long double LOGPI = 1.14472988584940017414L;*/ - -/* Stirling's formula for the gamma function -gamma(x) = sqrt(2 pi) x^(x-.5) exp(-x) (1 + 1/x P(1/x)) -z(x) = x -13 <= x <= 1024 -Relative error -n=8, d=0 -Peak error = 9.44e-21 -Relative error spread = 8.8e-4 -*/ -#if UNK -static const long double STIR[9] = { - 7.147391378143610789273E-4L, --2.363848809501759061727E-5L, --5.950237554056330156018E-4L, - 6.989332260623193171870E-5L, - 7.840334842744753003862E-4L, --2.294719747873185405699E-4L, --2.681327161876304418288E-3L, - 3.472222222230075327854E-3L, - 8.333333333333331800504E-2L, -}; -#endif -#if IBMPC -static const unsigned short STIR[] = { -0x6ede,0x69f7,0x54e3,0xbb5d,0x3ff4, XPD -0xc395,0x0295,0x4443,0xc64b,0xbfef, XPD -0xba6f,0x7c59,0x5e47,0x9bfb,0xbff4, XPD -0x5704,0x1a39,0xb11d,0x9293,0x3ff1, XPD -0x30b7,0x1a21,0x98b2,0xcd87,0x3ff4, XPD -0xbef3,0x7023,0x6a08,0xf09e,0xbff2, XPD -0x3a1c,0x5ac8,0x3478,0xafb9,0xbff6, XPD -0xc3c9,0x906e,0x38e3,0xe38e,0x3ff6, XPD -0xa1d5,0xaaaa,0xaaaa,0xaaaa,0x3ffb, XPD -}; -#endif -#if MIEEE -static const long STIR[27] = { -0x3ff40000,0xbb5d54e3,0x69f76ede, -0xbfef0000,0xc64b4443,0x0295c395, -0xbff40000,0x9bfb5e47,0x7c59ba6f, -0x3ff10000,0x9293b11d,0x1a395704, -0x3ff40000,0xcd8798b2,0x1a2130b7, -0xbff20000,0xf09e6a08,0x7023bef3, -0xbff60000,0xafb93478,0x5ac83a1c, -0x3ff60000,0xe38e38e3,0x906ec3c9, -0x3ffb0000,0xaaaaaaaa,0xaaaaa1d5, -}; -#endif -#define MAXSTIR 1024.0L -static const long double SQTPI = 2.50662827463100050242E0L; - -/* 1/gamma(x) = z P(z) - * z(x) = 1/x - * 0 < x < 0.03125 - * Peak relative error 4.2e-23 - */ -#if UNK -static const long double S[9] = { --1.193945051381510095614E-3L, - 7.220599478036909672331E-3L, --9.622023360406271645744E-3L, --4.219773360705915470089E-2L, - 1.665386113720805206758E-1L, --4.200263503403344054473E-2L, --6.558780715202540684668E-1L, - 5.772156649015328608253E-1L, - 1.000000000000000000000E0L, -}; -#endif -#if IBMPC -static const unsigned short S[] = { -0xbaeb,0xd6d3,0x25e5,0x9c7e,0xbff5, XPD -0xfe9a,0xceb4,0xc74e,0xec9a,0x3ff7, XPD -0x9225,0xdfef,0xb0e9,0x9da5,0xbff8, XPD -0x10b0,0xec17,0x87dc,0xacd7,0xbffa, XPD -0x6b8d,0x7515,0x1905,0xaa89,0x3ffc, XPD -0xf183,0x126b,0xf47d,0xac0a,0xbffa, XPD -0x7bf6,0x57d1,0xa013,0xa7e7,0xbffe, XPD -0xc7a9,0x7db0,0x67e3,0x93c4,0x3ffe, XPD -0x0000,0x0000,0x0000,0x8000,0x3fff, XPD -}; -#endif -#if MIEEE -static const long S[27] = { -0xbff50000,0x9c7e25e5,0xd6d3baeb, -0x3ff70000,0xec9ac74e,0xceb4fe9a, -0xbff80000,0x9da5b0e9,0xdfef9225, -0xbffa0000,0xacd787dc,0xec1710b0, -0x3ffc0000,0xaa891905,0x75156b8d, -0xbffa0000,0xac0af47d,0x126bf183, -0xbffe0000,0xa7e7a013,0x57d17bf6, -0x3ffe0000,0x93c467e3,0x7db0c7a9, -0x3fff0000,0x80000000,0x00000000, -}; -#endif -/* 1/gamma(-x) = z P(z) - * z(x) = 1/x - * 0 < x < 0.03125 - * Peak relative error 5.16e-23 - * Relative error spread = 2.5e-24 - */ -#if UNK -static const long double SN[9] = { - 1.133374167243894382010E-3L, - 7.220837261893170325704E-3L, - 9.621911155035976733706E-3L, --4.219773343731191721664E-2L, --1.665386113944413519335E-1L, --4.200263503402112910504E-2L, - 6.558780715202536547116E-1L, - 5.772156649015328608727E-1L, --1.000000000000000000000E0L, -}; -#endif -#if IBMPC -static const unsigned short SN[] = { -0x5dd1,0x02de,0xb9f7,0x948d,0x3ff5, XPD -0x989b,0xdd68,0xc5f1,0xec9c,0x3ff7, XPD -0x2ca1,0x18f0,0x386f,0x9da5,0x3ff8, XPD -0x783f,0x41dd,0x87d1,0xacd7,0xbffa, XPD -0x7a5b,0xd76d,0x1905,0xaa89,0xbffc, XPD -0x7f64,0x1234,0xf47d,0xac0a,0xbffa, XPD -0x5e26,0x57d1,0xa013,0xa7e7,0x3ffe, XPD -0xc7aa,0x7db0,0x67e3,0x93c4,0x3ffe, XPD -0x0000,0x0000,0x0000,0x8000,0xbfff, XPD -}; -#endif -#if MIEEE -static const long SN[27] = { -0x3ff50000,0x948db9f7,0x02de5dd1, -0x3ff70000,0xec9cc5f1,0xdd68989b, -0x3ff80000,0x9da5386f,0x18f02ca1, -0xbffa0000,0xacd787d1,0x41dd783f, -0xbffc0000,0xaa891905,0xd76d7a5b, -0xbffa0000,0xac0af47d,0x12347f64, -0x3ffe0000,0xa7e7a013,0x57d15e26, -0x3ffe0000,0x93c467e3,0x7db0c7aa, -0xbfff0000,0x80000000,0x00000000, -}; -#endif - -#ifndef __MINGW32__ -extern long double MAXLOGL, MAXNUML, PIL; -/* #define PIL 3.14159265358979323846L */ -/* #define MAXNUML 1.189731495357231765021263853E4932L */ - -#ifdef ANSIPROT -extern long double fabsl ( long double ); -extern long double lgaml ( long double ); -extern long double logl ( long double ); -extern long double expl ( long double ); -extern long double gammal ( long double ); -extern long double sinl ( long double ); -extern long double floorl ( long double ); -extern long double powl ( long double, long double ); -extern long double polevll ( long double, void *, int ); -extern long double p1evll ( long double, void *, int ); -extern int isnanl ( long double ); -extern int isfinitel ( long double ); -static long double stirf ( long double ); -#else -long double fabsl(), lgaml(), logl(), expl(), gammal(), sinl(); -long double floorl(), powl(), polevll(), p1evll(), isnanl(), isfinitel(); -static long double stirf(); -#endif -#ifdef INFINITIES -extern long double INFINITYL; -#endif -#ifdef NANS -extern long double NANL; -#endif - -#else /* __MINGW32__ */ -static long double stirf ( long double ); -#endif - - -/* Gamma function computed by Stirling's formula. */ - -static long double stirf(x) -long double x; -{ -long double y, w, v; - -w = 1.0L/x; -/* For large x, use rational coefficients from the analytical expansion. */ -if( x > 1024.0L ) - w = (((((6.97281375836585777429E-5L * w - + 7.84039221720066627474E-4L) * w - - 2.29472093621399176955E-4L) * w - - 2.68132716049382716049E-3L) * w - + 3.47222222222222222222E-3L) * w - + 8.33333333333333333333E-2L) * w - + 1.0L; -else - w = 1.0L + w * polevll( w, STIR, 8 ); -y = expl(x); -if( x > MAXSTIR ) - { /* Avoid overflow in pow() */ - v = powl( x, 0.5L * x - 0.25L ); - y = v * (v / y); - } -else - { - y = powl( x, x - 0.5L ) / y; - } -y = SQTPI * y * w; -return( y ); -} - - -long double __tgammal_r(long double x, int* sgngaml) -{ -long double p, q, z; -int i; - -*sgngaml = 1; -#ifdef NANS -if( isnanl(x) ) - return(NANL); -#endif -#ifdef INFINITIES -#ifdef NANS -if( x == INFINITYL ) - return(x); -if( x == -INFINITYL ) - return(NANL); -#else -if( !isfinite(x) ) - return(x); -#endif -#endif -q = fabsl(x); - -if( q > 13.0L ) - { - if( q > MAXGAML ) - goto goverf; - if( x < 0.0L ) - { - p = floorl(q); - if( p == q ) - { -gsing: - _SET_ERRNO(EDOM); - mtherr( "tgammal", SING ); -#ifdef INFINITIES - return (INFINITYL); -#else - return( *sgngaml * MAXNUML); -#endif - } - i = p; - if( (i & 1) == 0 ) - *sgngaml = -1; - z = q - p; - if( z > 0.5L ) - { - p += 1.0L; - z = q - p; - } - z = q * sinl( PIL * z ); - z = fabsl(z) * stirf(q); - if( z <= PIL/MAXNUML ) - { -goverf: - _SET_ERRNO(ERANGE); - mtherr( "tgammal", OVERFLOW ); -#ifdef INFINITIES - return( *sgngaml * INFINITYL); -#else - return( *sgngaml * MAXNUML); -#endif - } - z = PIL/z; - } - else - { - z = stirf(x); - } - return( *sgngaml * z ); - } - -z = 1.0L; -while( x >= 3.0L ) - { - x -= 1.0L; - z *= x; - } - -while( x < -0.03125L ) - { - z /= x; - x += 1.0L; - } - -if( x <= 0.03125L ) - goto Small; - -while( x < 2.0L ) - { - z /= x; - x += 1.0L; - } - -if( x == 2.0L ) - return(z); - -x -= 2.0L; -p = polevll( x, P, 7 ); -q = polevll( x, Q, 8 ); -return( z * p / q ); - -Small: -if( x == 0.0L ) - { - goto gsing; - } -else - { - if( x < 0.0L ) - { - x = -x; - q = z / (x * polevll( x, SN, 8 )); - } - else - q = z / (x * polevll( x, S, 8 )); - } -return q; -} - - -/* This is the C99 version. */ - -long double tgammal(long double x) -{ - int local_sgngaml=0; - return (__tgammal_r(x, &local_sgngaml)); -} - diff --git a/winsup/mingw/mingwex/math/trunc.c b/winsup/mingw/mingwex/math/trunc.c deleted file mode 100644 index 5c7dc68cb..000000000 --- a/winsup/mingw/mingwex/math/trunc.c +++ /dev/null @@ -1,16 +0,0 @@ -#include <fenv.h> -#include <math.h> - -double -trunc (double _x){ - double retval; - unsigned short saved_cw; - unsigned short tmp_cw; - __asm__ ("fnstcw %0;" : "=m" (saved_cw)); /* save FPU control word */ - tmp_cw = (saved_cw & ~(FE_TONEAREST | FE_DOWNWARD | FE_UPWARD | FE_TOWARDZERO)) - | FE_TOWARDZERO; - __asm__ ("fldcw %0;" : : "m" (tmp_cw)); - __asm__ ("frndint;" : "=t" (retval) : "0" (_x)); /* round towards zero */ - __asm__ ("fldcw %0;" : : "m" (saved_cw) ); /* restore saved control word */ - return retval; -} diff --git a/winsup/mingw/mingwex/math/truncf.c b/winsup/mingw/mingwex/math/truncf.c deleted file mode 100644 index 8869e377f..000000000 --- a/winsup/mingw/mingwex/math/truncf.c +++ /dev/null @@ -1,17 +0,0 @@ -#include <fenv.h> -#include <math.h> - -float -truncf (float _x) -{ - float retval; - unsigned short saved_cw; - unsigned short tmp_cw; - __asm__ ("fnstcw %0;" : "=m" (saved_cw)); /* save FPU control word */ - tmp_cw = (saved_cw & ~(FE_TONEAREST | FE_DOWNWARD | FE_UPWARD | FE_TOWARDZERO)) - | FE_TOWARDZERO; - __asm__ ("fldcw %0;" : : "m" (tmp_cw)); - __asm__ ("frndint;" : "=t" (retval) : "0" (_x)); /* round towards zero */ - __asm__ ("fldcw %0;" : : "m" (saved_cw) ); /* restore saved control word */ - return retval; -} diff --git a/winsup/mingw/mingwex/math/truncl.c b/winsup/mingw/mingwex/math/truncl.c deleted file mode 100644 index e34b21ba9..000000000 --- a/winsup/mingw/mingwex/math/truncl.c +++ /dev/null @@ -1,16 +0,0 @@ -#include <fenv.h> -#include <math.h> - -long double -truncl (long double _x){ - long double retval; - unsigned short saved_cw; - unsigned short tmp_cw; - __asm__ ("fnstcw %0;" : "=m" (saved_cw)); /* save FPU control word */ - tmp_cw = (saved_cw & ~(FE_TONEAREST | FE_DOWNWARD | FE_UPWARD | FE_TOWARDZERO)) - | FE_TOWARDZERO; - __asm__ ("fldcw %0;" : : "m" (tmp_cw)); - __asm__ ("frndint;" : "=t" (retval) : "0" (_x)); /* round towards zero */ - __asm__ ("fldcw %0;" : : "m" (saved_cw) ); /* restore saved control word */ - return retval; -} diff --git a/winsup/mingw/mingwex/mb_wc_common.h b/winsup/mingw/mingwex/mb_wc_common.h deleted file mode 100755 index 40028d682..000000000 --- a/winsup/mingw/mingwex/mb_wc_common.h +++ /dev/null @@ -1,7 +0,0 @@ -__declspec(dllimport) unsigned int __lc_codepage; - -static inline -unsigned int get_codepage (void) -{ - return __lc_codepage; -} diff --git a/winsup/mingw/mingwex/mbrtowc.c b/winsup/mingw/mingwex/mbrtowc.c deleted file mode 100755 index 52fb5ece4..000000000 --- a/winsup/mingw/mingwex/mbrtowc.c +++ /dev/null @@ -1,154 +0,0 @@ -#include "mb_wc_common.h" -#include <wchar.h> -#include <stdlib.h> -#include <errno.h> -#define WIN32_LEAN_AND_MEAN -#include <windows.h> - -static int __MINGW_ATTRIB_NONNULL(1) __MINGW_ATTRIB_NONNULL(4) -__mbrtowc_cp (wchar_t * __restrict__ pwc, const char * __restrict__ s, - size_t n, mbstate_t* __restrict__ ps, - const unsigned int cp, const unsigned int mb_max) -{ - union { - mbstate_t val; - char mbcs[4]; - } shift_state; - - - /* Do the prelim checks */ - if (s == NULL) - return 0; - - if (n == 0) - /* The standard doesn't mention this case explicitly. Tell - caller that the conversion from a non-null s is incomplete. */ - return -2; - - /* Save the current shift state, in case we need it in DBCS case. */ - shift_state.val = *ps; - *ps = 0; - - if (!*s) - { - *pwc = 0; - return 0; - } - - if (mb_max > 1) - { - if (shift_state.mbcs[0] != 0) - { - /* Complete the mb char with the trailing byte. */ - shift_state.mbcs[1] = *s; /* the second byte */ - if (MultiByteToWideChar(cp, MB_ERR_INVALID_CHARS, - shift_state.mbcs, 2, pwc, 1) - == 0) - { - /* An invalid trailing byte */ - errno = EILSEQ; - return -1; - } - return 2; - } - else if (IsDBCSLeadByteEx (cp, *s)) - { - /* If told to translate one byte, just save the leadbyte - in *ps. */ - if (n < 2) - { - ((char*) ps)[0] = *s; - return -2; - } - /* Else translate the first two bytes */ - else if (MultiByteToWideChar (cp, MB_ERR_INVALID_CHARS, - s, 2, pwc, 1) - == 0) - { - errno = EILSEQ; - return -1; - } - return 2; - } - } - - /* Fall through to single byte char */ - if (cp == 0) - *pwc = (wchar_t)(unsigned char)*s; - - else if (MultiByteToWideChar (cp, MB_ERR_INVALID_CHARS, s, 1, pwc, 1) - == 0) - { - errno = EILSEQ; - return -1; - } - return 1; -} - -size_t -mbrtowc (wchar_t * __restrict__ pwc, const char * __restrict__ s, - size_t n, mbstate_t* __restrict__ ps) -{ - static mbstate_t internal_mbstate = 0; - wchar_t byte_bucket = 0; - wchar_t* dst = pwc ? pwc : &byte_bucket; - - return (size_t) __mbrtowc_cp (dst, s, n, ps ? ps : &internal_mbstate, - get_codepage(), MB_CUR_MAX); -} - - -size_t -mbsrtowcs (wchar_t* __restrict__ dst, const char ** __restrict__ src, - size_t len, mbstate_t* __restrict__ ps) -{ - int ret =0 ; - size_t n = 0; - static mbstate_t internal_mbstate = 0; - mbstate_t* internal_ps = ps ? ps : &internal_mbstate; - const unsigned int cp = get_codepage(); - const unsigned int mb_max = MB_CUR_MAX; - - if ( src == NULL || *src == NULL ) /* undefined behavior */ - return 0; - - if (dst != NULL) - { - while (n < len - && (ret = __mbrtowc_cp(dst, *src, len - n, - internal_ps, cp, mb_max)) - > 0) - { - ++dst; - *src += ret; - n += ret; - } - - if (n < len && ret == 0) - *src = (char *)NULL; - } - - else - { - wchar_t byte_bucket = 0; - while (n < len - && (ret = __mbrtowc_cp (&byte_bucket, *src, mb_max, - internal_ps, cp, mb_max)) - > 0) - { - *src += ret; - n += ret; - } - } - return n; -} - -size_t -mbrlen (const char * __restrict__ s, size_t n, - mbstate_t * __restrict__ ps) -{ - static mbstate_t s_mbstate = 0; - wchar_t byte_bucket = 0; - return __mbrtowc_cp (&byte_bucket, s, n, (ps) ? ps : &s_mbstate, - get_codepage(), MB_CUR_MAX); -} diff --git a/winsup/mingw/mingwex/mbsinit.c b/winsup/mingw/mingwex/mbsinit.c deleted file mode 100644 index c130afebd..000000000 --- a/winsup/mingw/mingwex/mbsinit.c +++ /dev/null @@ -1,21 +0,0 @@ -/* This source code was extracted from the Q8 package created and placed - in the PUBLIC DOMAIN by Doug Gwyn <gwyn@arl.mil> - last edit: 1999/11/05 gwyn@arl.mil - - Implements subclause 7.24 of ISO/IEC 9899:1999 (E). - - It supports an encoding where all char codes are mapped - to the *same* code values within a wchar_t or wint_t, - so long as no other wchar_t codes are used by the program. - -*/ - -#include <wchar.h> - -int -mbsinit(ps) - const mbstate_t *ps; - { - return 1; /* don't have shift states */ - } - diff --git a/winsup/mingw/mingwex/mingw-aligned-malloc.c b/winsup/mingw/mingwex/mingw-aligned-malloc.c deleted file mode 100755 index a6d4ac934..000000000 --- a/winsup/mingw/mingwex/mingw-aligned-malloc.c +++ /dev/null @@ -1,120 +0,0 @@ -/* - __mingw_aligned_malloc and friends, implemented using Microsoft's public - interfaces and with the help of the algorithm description provided - by Wu Yongwei: http://sourceforge.net/mailarchive/message.php?msg_id=3847075 - - I hereby place this implementation in the public domain. - -- Steven G. Johnson (stevenj@alum.mit.edu) -*/ - -#include <stdlib.h> -#include <errno.h> -#include <stddef.h> /* ptrdiff_t */ -#include <string.h> /* memmove */ - -#ifdef HAVE_STDINT_H -# include <stdint.h> /* uintptr_t */ -#else -# define uintptr_t size_t -#endif - -#define NOT_POWER_OF_TWO(n) (((n) & ((n) - 1))) -#define UI(p) ((uintptr_t) (p)) -#define CP(p) ((char *) p) - -#define PTR_ALIGN(p0, alignment, offset) \ - ((void *) (((UI(p0) + (alignment + sizeof(void*)) + offset) \ - & (~UI(alignment - 1))) \ - - offset)) - -/* Pointer must sometimes be aligned; assume sizeof(void*) is a power of two. */ -#define ORIG_PTR(p) (*(((void **) (UI(p) & (~UI(sizeof(void*) - 1)))) - 1)) - -void * -__mingw_aligned_offset_malloc (size_t size, size_t alignment, size_t offset) -{ - void *p0, *p; - - if (NOT_POWER_OF_TWO (alignment)) - { - errno = EINVAL; - return ((void *) 0); - } - if (size == 0) - return ((void *) 0); - if (alignment < sizeof (void *)) - alignment = sizeof (void *); - - /* Including the extra sizeof(void*) is overkill on a 32-bit - machine, since malloc is already 8-byte aligned, as long - as we enforce alignment >= 8 ...but oh well. */ - - p0 = malloc (size + (alignment + sizeof (void *))); - if (!p0) - return ((void *) 0); - p = PTR_ALIGN (p0, alignment, offset); - ORIG_PTR (p) = p0; - return p; -} - -void * -__mingw_aligned_malloc (size_t size, size_t alignment) -{ - return __mingw_aligned_offset_malloc (size, alignment, 0); -} - -void -__mingw_aligned_free (void *memblock) -{ - if (memblock) - free (ORIG_PTR (memblock)); -} - -void * -__mingw_aligned_offset_realloc (void *memblock, size_t size, - size_t alignment, size_t offset) -{ - void *p0, *p; - ptrdiff_t shift; - - if (!memblock) - return __mingw_aligned_offset_malloc (size, alignment, offset); - if (NOT_POWER_OF_TWO (alignment)) - goto bad; - if (size == 0) - { - __mingw_aligned_free (memblock); - return ((void *) 0); - } - if (alignment < sizeof (void *)) - alignment = sizeof (void *); - - p0 = ORIG_PTR (memblock); - /* It is an error for the alignment to change. */ - if (memblock != PTR_ALIGN (p0, alignment, offset)) - goto bad; - shift = CP (memblock) - CP (p0); - - p0 = realloc (p0, size + (alignment + sizeof (void *))); - if (!p0) - return ((void *) 0); - p = PTR_ALIGN (p0, alignment, offset); - - /* Relative shift of actual data may be different from before, ugh. */ - if (shift != CP (p) - CP (p0)) - /* ugh, moves more than necessary if size is increased. */ - memmove (CP (p), CP (p0) + shift, size); - - ORIG_PTR (p) = p0; - return p; - -bad: - errno = EINVAL; - return ((void *) 0); -} - -void * -__mingw_aligned_realloc (void *memblock, size_t size, size_t alignment) -{ - return __mingw_aligned_offset_realloc (memblock, size, alignment, 0); -} diff --git a/winsup/mingw/mingwex/mingw-fseek.c b/winsup/mingw/mingwex/mingw-fseek.c deleted file mode 100644 index b4f45cc7e..000000000 --- a/winsup/mingw/mingwex/mingw-fseek.c +++ /dev/null @@ -1,106 +0,0 @@ -/* - * Workaround for limitations on win9x where a file contents are - * not zero'd out if you seek past the end and then write. - * Copied from ming local-patch to binutils/bfd/libbfd.c written by - * Mumit Khan <khan@xraylith.wisc.edu> - */ - -#include <windows.h> -#include <stdio.h> -#include <io.h> -#include <stdlib.h> - -#define ZEROBLOCKSIZE 512 -static int __mingw_fseek_called; - -/* The fseek in Win9x runtime does not zero out the file if seeking past - the end; if you don't want random stuff from your disk included in your - output DLL/executable, use this version instead. On WinNT/Win2k, it - just calls runtime fseek(). - - CHECK/FIXME: Does this work for both text and binary modes?? */ - - -int -__mingw_fseek (FILE *fp, long offset, int whence) -{ -# undef fseek - __mingw_fseek_called = 1; - return fseek (fp, offset, whence); -} - -int -__mingw_fseeko64 (FILE *fp, off64_t offset, int whence) -{ -# undef fseeko64 - __mingw_fseek_called = 1; - return fseeko64 (fp, offset, whence); -} - -size_t -__mingw_fwrite (const void *buffer, size_t size, size_t count, FILE *fp) -{ -# undef fwrite - if ((_osver & 0x8000) && __mingw_fseek_called) - { - ULARGE_INTEGER actual_length; - LARGE_INTEGER current_position = {{0LL}}; - __mingw_fseek_called = 0; - fflush (fp); - actual_length.LowPart = GetFileSize ((HANDLE) _get_osfhandle (fileno (fp)), - &actual_length.HighPart); - if (actual_length.LowPart == 0xFFFFFFFF - && GetLastError() != NO_ERROR ) - return -1; - current_position.LowPart = SetFilePointer ((HANDLE) _get_osfhandle (fileno (fp)), - current_position.LowPart, - ¤t_position.HighPart, - FILE_CURRENT); - if (current_position.LowPart == 0xFFFFFFFF - && GetLastError() != NO_ERROR ) - return -1; - -#ifdef DEBUG - printf ("__mingw_fwrite: current %I64u, actual %I64u\n", - current_position.QuadPart, actual_length.QuadPart); -#endif /* DEBUG */ - if (current_position.QuadPart > actual_length.QuadPart) - { - static char __mingw_zeros[ZEROBLOCKSIZE]; - long long numleft; - - SetFilePointer ((HANDLE) _get_osfhandle (fileno (fp)), - 0, 0, FILE_END); - numleft = current_position.QuadPart - actual_length.QuadPart; - -#ifdef DEBUG - printf ("__mingw_fwrite: Seeking %I64d bytes past end\n", numleft); -#endif /* DEBUG */ - while (numleft > 0LL) - { - DWORD nzeros = (numleft > ZEROBLOCKSIZE) - ? ZEROBLOCKSIZE : numleft; - DWORD written; - if (! WriteFile ((HANDLE) _get_osfhandle (fileno (fp)), - __mingw_zeros, nzeros, &written, NULL)) - { - /* Best we can hope for, or at least DJ says so. */ - SetFilePointer ((HANDLE) _get_osfhandle (fileno (fp)), - 0, 0, FILE_BEGIN); - return -1; - } - if (written < nzeros) - { - /* Likewise. */ - SetFilePointer ((HANDLE) _get_osfhandle (fileno (fp)), - 0, 0, FILE_BEGIN); - return -1; - } - - numleft -= written; - } - FlushFileBuffers ((HANDLE) _get_osfhandle (fileno (fp))); - } - } - return fwrite (buffer, size, count, fp); -} diff --git a/winsup/mingw/mingwex/sitest.c b/winsup/mingw/mingwex/sitest.c deleted file mode 100644 index 9e06bf164..000000000 --- a/winsup/mingw/mingwex/sitest.c +++ /dev/null @@ -1,1527 +0,0 @@ -/* - sitest -- exercise features of C99 <stdint.h> and <inttypes.h> - - This source code has been placed into the PUBLIC DOMAIN by its author. - - last edit: 1999/11/05 gwyn@arl.mil - - Tries to accommodate pre-C99 versions of <inttypes.h>. - - Takes advantage of __Q8_* symbols defined by a particular - implementation of <stdint.h>, but doesn't require them. - - NOTE: This is not a thorough validation test of the facilities. -*/ - -#include <errno.h> -#include <limits.h> /* for CHAR_BIT */ -#include <stdio.h> -#include <stddef.h> /* for ptrdiff_t */ -#include <stdlib.h> -#include <string.h> - -#include <inttypes.h> /* embeds <stdint.h> */ -#include <signal.h> /* for sig_atomic_t */ -#if defined(INTMAX_MAX) /* <inttypes.h> has C99 features */ -#include <wchar.h> -#endif - -#include <inttypes.h> /* test idempotency */ - -#if 1 /* __STDC_VERSION__ >= 199901 */ -#ifndef __Q8_QT -#define __Q8_QT long long -#endif -#endif - -#ifdef PRIdMAX -#define HAVE_PRIdMAX -#ifndef __Q8_MT -#define __Q8_MT intmax_t -#endif -#else -#ifdef PRIdLEAST64 -#ifndef __Q8_MT -#define __Q8_MT int_least64_t -#endif -#define PRIdMAX PRIdLEAST64 -#else -#ifndef __Q8_MT -#define __Q8_MT long -#endif -#define PRIdMAX "ld" -#endif -#endif - -#ifdef PRIuMAX -#define HAVE_PRIuMAX -#define U__Q8_MT uintmax_t -#else -#ifdef PRIuLEAST64 -#define U__Q8_MT uint_least64_t -#define PRIuMAX PRIuLEAST64 -#else -#define U__Q8_MT unsigned long -#define PRIuMAX "lu" -#endif -#endif - -#define STR_SUB(s) #s -#define STRINGIZE(s) STR_SUB(s) /* extra level to expand argument */ - -#if defined(SCNo32) || defined(PRIo32) -static int32_t int32; -#endif -static int_least16_t intl16; -static uint_least16_t uintl16; -static uint_fast16_t uintf16; -static intmax_t intmax; -static uintmax_t uintmax; - -int -main() { - int status = 0; /* exit status to be returned */ - - /* <stdint.h> features: */ - - printf("CHAR_BIT=%u\n", (unsigned)CHAR_BIT ); - printf("sizeof(char)=%u\n", (unsigned)sizeof(char)); /* s.b. 1 */ - printf("sizeof(short)=%u\n", (unsigned)sizeof(short)); - printf("sizeof(int)=%u\n", (unsigned)sizeof(int)); - printf("sizeof(long)=%u\n", (unsigned)sizeof(long)); -#ifdef __Q8_QT - printf("sizeof(long long)=%u\n", (unsigned)sizeof(__Q8_QT)); -#endif - printf("sizeof(intmax_t)=%u\n", (unsigned)sizeof(intmax_t)); - printf("sizeof(ptrdiff_t)=%u\n", (unsigned)sizeof(ptrdiff_t)); - printf("sizeof(size_t)=%u\n", (unsigned)sizeof(size_t)); - printf("sizeof(sig_atomic_t)=%u\n", (unsigned)sizeof(sig_atomic_t)); - printf("sizeof(wchar_t)=%u\n", (unsigned)sizeof(wchar_t)); -#if defined(WINT_MAX) || __STDC_VERSION__ >= 199901 - printf("sizeof(wint_t)=%u\n", (unsigned)sizeof(wint_t)); -#else - printf("*** wint_t isn't defined ***\n"); - status = EXIT_FAILURE; -#endif -#ifdef INT8_MAX - printf("sizeof(int8_t)=%u\n", (unsigned)sizeof(int8_t)); - printf("sizeof(uint8_t)=%u\n", (unsigned)sizeof(uint8_t)); -#endif -#ifdef INT9_MAX - printf("sizeof(int9_t)=%u\n", (unsigned)sizeof(int9_t)); - printf("sizeof(uint9_t)=%u\n", (unsigned)sizeof(uint9_t)); -#endif -#ifdef INT12_MAX - printf("sizeof(int12_t)=%u\n", (unsigned)sizeof(int12_t)); - printf("sizeof(uint12_t)=%u\n", (unsigned)sizeof(uint12_t)); -#endif -#ifdef INT16_MAX - printf("sizeof(int16_t)=%u\n", (unsigned)sizeof(int16_t)); - printf("sizeof(uint16_t)=%u\n", (unsigned)sizeof(uint16_t)); -#endif -#ifdef INT18_MAX - printf("sizeof(int18_t)=%u\n", (unsigned)sizeof(int18_t)); - printf("sizeof(uint18_t)=%u\n", (unsigned)sizeof(uint18_t)); -#endif -#ifdef INT24_MAX - printf("sizeof(int24_t)=%u\n", (unsigned)sizeof(int24_t)); - printf("sizeof(uint24_t)=%u\n", (unsigned)sizeof(uint24_t)); -#endif -#ifdef INT32_MAX - printf("sizeof(int32_t)=%u\n", (unsigned)sizeof(int32_t)); - printf("sizeof(uint32_t)=%u\n", (unsigned)sizeof(uint32_t)); -#endif -#ifdef INT36_MAX - printf("sizeof(int36_t)=%u\n", (unsigned)sizeof(int36_t)); - printf("sizeof(uint36_t)=%u\n", (unsigned)sizeof(uint36_t)); -#endif -#ifdef INT40_MAX - printf("sizeof(int40_t)=%u\n", (unsigned)sizeof(int40_t)); - printf("sizeof(uint40_t)=%u\n", (unsigned)sizeof(uint40_t)); -#endif -#ifdef INT48_MAX - printf("sizeof(int48_t)=%u\n", (unsigned)sizeof(int48_t)); - printf("sizeof(uint48_t)=%u\n", (unsigned)sizeof(uint48_t)); -#endif -#ifdef INT60_MAX - printf("sizeof(int60_t)=%u\n", (unsigned)sizeof(int60_t)); - printf("sizeof(uint60_t)=%u\n", (unsigned)sizeof(uint60_t)); -#endif -#ifdef INT64_MAX - printf("sizeof(int64_t)=%u\n", (unsigned)sizeof(int64_t)); - printf("sizeof(uint64_t)=%u\n", (unsigned)sizeof(uint64_t)); -#endif -#ifdef INT72_MAX - printf("sizeof(int72_t)=%u\n", (unsigned)sizeof(int72_t)); - printf("sizeof(uint72_t)=%u\n", (unsigned)sizeof(uint72_t)); -#endif -#ifdef INT128_MAX - printf("sizeof(int128_t)=%u\n", (unsigned)sizeof(int128_t)); - printf("sizeof(uint128_t)=%u\n", (unsigned)sizeof(uint128_t)); -#endif - printf("sizeof(int_least8_t)=%u\n", (unsigned)sizeof(int_least8_t)); - printf("sizeof(uint_least8_t)=%u\n", (unsigned)sizeof(uint_least8_t)); - printf("sizeof(int_least16_t)=%u\n", (unsigned)sizeof(int_least16_t)); - printf("sizeof(uint_least16_t)=%u\n", (unsigned)sizeof(uint_least16_t)); - printf("sizeof(int_least32_t)=%u\n", (unsigned)sizeof(int_least32_t)); - printf("sizeof(uint_least32_t)=%u\n", (unsigned)sizeof(uint_least32_t)); -#ifdef INT_LEAST64_MAX - printf("sizeof(int_least64_t)=%u\n", (unsigned)sizeof(int_least64_t)); - printf("sizeof(uint_least64_t)=%u\n", (unsigned)sizeof(uint_least64_t)); -#else - printf("*** uint_least64_t isn't defined ***\n"); - status = EXIT_FAILURE; -#endif -#ifdef INT_LEAST128_MAX - printf("sizeof(int_least128_t)=%u\n", (unsigned)sizeof(int_least128_t)); - printf("sizeof(uint_least128_t)=%u\n", - (unsigned)sizeof(uint_least128_t)); -#endif - printf("sizeof(int_fast8_t)=%u\n", (unsigned)sizeof(int_fast8_t)); - printf("sizeof(uint_fast8_t)=%u\n", (unsigned)sizeof(uint_fast8_t)); - printf("sizeof(int_fast16_t)=%u\n", (unsigned)sizeof(int_fast16_t)); - printf("sizeof(uint_fast16_t)=%u\n", (unsigned)sizeof(uint_fast16_t)); - printf("sizeof(int_fast32_t)=%u\n", (unsigned)sizeof(int_fast32_t)); - printf("sizeof(uint_fast32_t)=%u\n", (unsigned)sizeof(uint_fast32_t)); -#ifdef INT_FAST64_MAX - printf("sizeof(int_fast64_t)=%u\n", (unsigned)sizeof(int_fast64_t)); - printf("sizeof(uint_fast64_t)=%u\n", (unsigned)sizeof(uint_fast64_t)); -#else - printf("*** int_fast64_t isn't defined ***\n"); - status = EXIT_FAILURE; -#endif -#ifdef INT_FAST128_MAX - printf("sizeof(int_fast128_t)=%u\n", (unsigned)sizeof(int_fast128_t)); - printf("sizeof(uint_fast128_t)=%u\n", (unsigned)sizeof(uint_fast128_t)); -#endif -#if defined(INTPTR_MAX) - printf("sizeof(intptr_t)=%u\n", (unsigned)sizeof(intptr_t)); -#if defined(UINTPTR_MAX) - printf("sizeof(uintptr_t)=%u\n", (unsigned)sizeof(uintptr_t)); -#else - printf("*** intptr_t is defined but uintptr_t isn't ***\n"); - status = EXIT_FAILURE; -#endif -#elif defined(UINTPTR_MAX) - printf("sizeof(uintptr_t)=%u\n", (unsigned)sizeof(uintptr_t)); - printf("*** uintptr_t is defined but intptr_t isn't ***\n"); - status = EXIT_FAILURE; -#else - printf("*** neither intptr_t nor uintptr_t is defined ***\n"); - status = EXIT_FAILURE; -#endif -#ifdef INTMAX_MAX - printf("sizeof(intmax_t)=%u\n", (unsigned)sizeof(intmax_t)); - printf("sizeof(uintmax_t)=%u\n", (unsigned)sizeof(uintmax_t)); -#else - printf("*** intmax_t isn't defined ***\n"); - status = EXIT_FAILURE; -#endif - -#ifdef INT8_MAX - printf("INT8_MIN=%"PRIdMAX"\n", (__Q8_MT)INT8_MIN); - printf("INT8_MAX=%"PRIdMAX"\n", (__Q8_MT)INT8_MAX); - printf("UINT8_MAX=%"PRIuMAX"\n", (U__Q8_MT)UINT8_MAX); -#endif -#ifdef INT9_MAX - printf("INT9_MIN=%"PRIdMAX"\n", (__Q8_MT)INT9_MIN); - printf("INT9_MAX=%"PRIdMAX"\n", (__Q8_MT)INT9_MAX); - printf("UINT9_MAX=%"PRIuMAX"\n", (U__Q8_MT)UINT9_MAX); -#endif -#ifdef INT12_MAX - printf("INT12_MIN=%"PRIdMAX"\n", (__Q8_MT)INT12_MIN); - printf("INT12_MAX=%"PRIdMAX"\n", (__Q8_MT)INT12_MAX); - printf("UINT12_MAX=%"PRIuMAX"\n", (U__Q8_MT)UINT12_MAX); -#endif -#ifdef INT16_MAX - printf("INT16_MIN=%"PRIdMAX"\n", (__Q8_MT)INT16_MIN); - printf("INT16_MAX=%"PRIdMAX"\n", (__Q8_MT)INT16_MAX); - printf("UINT16_MAX=%"PRIuMAX"\n", (U__Q8_MT)UINT16_MAX); -#endif -#ifdef INT18_MAX - printf("INT18_MIN=%"PRIdMAX"\n", (__Q8_MT)INT18_MIN); - printf("INT18_MAX=%"PRIdMAX"\n", (__Q8_MT)INT18_MAX); - printf("UINT18_MAX=%"PRIuMAX"\n", (U__Q8_MT)UINT18_MAX); -#endif -#ifdef INT24_MAX - printf("INT24_MIN=%"PRIdMAX"\n", (__Q8_MT)INT24_MIN); - printf("INT24_MAX=%"PRIdMAX"\n", (__Q8_MT)INT24_MAX); - printf("UINT24_MAX=%"PRIuMAX"\n", (U__Q8_MT)UINT24_MAX); -#endif -#ifdef INT32_MAX - printf("INT32_MIN=%"PRIdMAX"\n", (__Q8_MT)INT32_MIN); - printf("INT32_MAX=%"PRIdMAX"\n", (__Q8_MT)INT32_MAX); - printf("UINT32_MAX=%"PRIuMAX"\n", (U__Q8_MT)UINT32_MAX); -#endif -#ifdef INT36_MAX - printf("INT36_MIN=%"PRIdMAX"\n", (__Q8_MT)INT36_MIN); - printf("INT36_MAX=%"PRIdMAX"\n", (__Q8_MT)INT36_MAX); - printf("UINT36_MAX=%"PRIuMAX"\n", (U__Q8_MT)UINT36_MAX); -#endif -#ifdef INT40_MAX - printf("INT40_MIN=%"PRIdMAX"\n", (__Q8_MT)INT40_MIN); - printf("INT40_MAX=%"PRIdMAX"\n", (__Q8_MT)INT40_MAX); - printf("UINT40_MAX=%"PRIuMAX"\n", (U__Q8_MT)UINT40_MAX); -#endif -#ifdef INT48_MAX - printf("INT48_MIN=%"PRIdMAX"\n", (__Q8_MT)INT48_MIN); - printf("INT48_MAX=%"PRIdMAX"\n", (__Q8_MT)INT48_MAX); - printf("UINT48_MAX=%"PRIuMAX"\n", (U__Q8_MT)UINT48_MAX); -#endif -#ifdef INT60_MAX - printf("INT60_MIN=%"PRIdMAX"\n", (__Q8_MT)INT60_MIN); - printf("INT60_MAX=%"PRIdMAX"\n", (__Q8_MT)INT60_MAX); - printf("UINT60_MAX=%"PRIuMAX"\n", (U__Q8_MT)UINT60_MAX); -#endif -#ifdef INT64_MAX - printf("INT64_MIN=%"PRIdMAX"\n", (__Q8_MT)INT64_MIN); - printf("INT64_MAX=%"PRIdMAX"\n", (__Q8_MT)INT64_MAX); - printf("UINT64_MAX=%"PRIuMAX"\n", (U__Q8_MT)UINT64_MAX); -#endif -#ifdef INT72_MAX - printf("INT72_MIN=%"PRIdMAX"\n", (__Q8_MT)INT72_MIN); - printf("INT72_MAX=%"PRIdMAX"\n", (__Q8_MT)INT72_MAX); - printf("UINT72_MAX=%"PRIuMAX"\n", (U__Q8_MT)UINT72_MAX); -#endif -#ifdef INT128_MAX - printf("INT128_MIN=%"PRIdMAX"\n", (__Q8_MT)INT128_MIN); - printf("INT128_MAX=%"PRIdMAX"\n", (__Q8_MT)INT128_MAX); - printf("UINT128_MAX=%"PRIuMAX"\n", (U__Q8_MT)UINT128_MAX); -#endif - printf("INT_LEAST8_MIN=%"PRIdMAX"\n", (__Q8_MT)INT_LEAST8_MIN); - printf("INT_LEAST8_MAX=%"PRIdMAX"\n", (__Q8_MT)INT_LEAST8_MAX); - printf("UINT_LEAST8_MAX=%"PRIuMAX"\n", - (U__Q8_MT)UINT_LEAST8_MAX); - printf("INT_LEAST16_MIN=%"PRIdMAX"\n", (__Q8_MT)INT_LEAST16_MIN); - printf("INT_LEAST16_MAX=%"PRIdMAX"\n", (__Q8_MT)INT_LEAST16_MAX); - printf("UINT_LEAST16_MAX=%"PRIuMAX"\n", - (U__Q8_MT)UINT_LEAST16_MAX); - printf("INT_LEAST32_MIN=%"PRIdMAX"\n", (__Q8_MT)INT_LEAST32_MIN); - printf("INT_LEAST32_MAX=%"PRIdMAX"\n", (__Q8_MT)INT_LEAST32_MAX); - printf("UINT_LEAST32_MAX=%"PRIuMAX"\n", - (U__Q8_MT)UINT_LEAST32_MAX); -#ifdef INT_LEAST64_MAX - printf("INT_LEAST64_MIN=%"PRIdMAX"\n", (__Q8_MT)INT_LEAST64_MIN); - printf("INT_LEAST64_MAX=%"PRIdMAX"\n", (__Q8_MT)INT_LEAST64_MAX); - printf("UINT_LEAST64_MAX=%"PRIuMAX"\n", (U__Q8_MT)UINT_LEAST64_MAX); -#endif -#ifdef INT_LEAST128_MAX - printf("INT_LEAST128_MIN=%"PRIdMAX"\n", (__Q8_MT)INT_LEAST128_MIN); - printf("INT_LEAST128_MAX=%"PRIdMAX"\n", (__Q8_MT)INT_LEAST128_MAX); - printf("UINT_LEAST128_MAX=%"PRIuMAX"\n", (U__Q8_MT)UINT_LEAST128_MAX); -#endif - printf("INT_FAST8_MIN=%"PRIdMAX"\n", (__Q8_MT)INT_FAST8_MIN); - printf("INT_FAST8_MAX=%"PRIdMAX"\n", (__Q8_MT)INT_FAST8_MAX); - printf("UINT_FAST8_MAX=%"PRIuMAX"\n", - (U__Q8_MT)UINT_FAST8_MAX); - printf("INT_FAST16_MIN=%"PRIdMAX"\n", (__Q8_MT)INT_FAST16_MIN); - printf("INT_FAST16_MAX=%"PRIdMAX"\n", (__Q8_MT)INT_FAST16_MAX); - printf("UINT_FAST16_MAX=%"PRIuMAX"\n", - (U__Q8_MT)UINT_FAST16_MAX); - printf("INT_FAST32_MIN=%"PRIdMAX"\n", (__Q8_MT)INT_FAST32_MIN); - printf("INT_FAST32_MAX=%"PRIdMAX"\n", (__Q8_MT)INT_FAST32_MAX); - printf("UINT_FAST32_MAX=%"PRIuMAX"\n", - (U__Q8_MT)UINT_FAST32_MAX); -#ifdef INT_FAST64_MAX - printf("INT_FAST64_MIN=%"PRIdMAX"\n", (__Q8_MT)INT_FAST64_MIN); - printf("INT_FAST64_MAX=%"PRIdMAX"\n", (__Q8_MT)INT_FAST64_MAX); - printf("UINT_FAST64_MAX=%"PRIuMAX"\n", (U__Q8_MT)UINT_FAST64_MAX); -#endif -#ifdef INT_FAST128_MAX - printf("INT_FAST128_MIN=%"PRIdMAX"\n", (__Q8_MT)INT_FAST128_MIN); - printf("INT_FAST128_MAX=%"PRIdMAX"\n", (__Q8_MT)INT_FAST128_MAX); - printf("UINT_FAST128_MAX=%"PRIuMAX"\n", (U__Q8_MT)UINT_FAST128_MAX); -#endif -#ifdef INTPTR_MAX - printf("INTPTR_MIN=%"PRIdMAX"\n", (__Q8_MT)INTPTR_MIN); - printf("INTPTR_MAX=%"PRIdMAX"\n", (__Q8_MT)INTPTR_MAX); -#endif -#ifdef UINTPTR_MAX - printf("UINTPTR_MAX=%"PRIuMAX"\n", (U__Q8_MT)UINTPTR_MAX); -#endif -#ifdef INTMAX_MAX - printf("INTMAX_MIN=%"PRIdMAX"\n", (__Q8_MT)INTMAX_MIN); - printf("INTMAX_MAX=%"PRIdMAX"\n", (__Q8_MT)INTMAX_MAX); - printf("UINTMAX_MAX=%"PRIuMAX"\n", (U__Q8_MT)UINTMAX_MAX); -#endif -#ifdef PTRDIFF_MAX - printf("PTRDIFF_MIN=%"PRIdMAX"\n", (__Q8_MT)PTRDIFF_MIN); - printf("PTRDIFF_MAX=%"PRIdMAX"\n", (__Q8_MT)PTRDIFF_MAX); -#endif -#ifdef SIG_ATOMIC_MAX -#if SIG_ATOMIC_MIN < 0 - printf("SIG_ATOMIC_MIN=%"PRIdMAX"\n", (__Q8_MT)SIG_ATOMIC_MIN); - printf("SIG_ATOMIC_MAX=%"PRIdMAX"\n", (__Q8_MT)SIG_ATOMIC_MAX); -#else - printf("SIG_ATOMIC_MIN=%"PRIuMAX"\n", (U__Q8_MT)SIG_ATOMIC_MIN); - printf("SIG_ATOMIC_MAX=%"PRIuMAX"\n", (U__Q8_MT)SIG_ATOMIC_MAX); -#endif -#endif -#ifdef SIZE_MAX - printf("SIZE_MAX=%"PRIuMAX"\n", (U__Q8_MT)SIZE_MAX); -#endif - -#ifdef WCHAR_MAX -#if WCHAR_MIN < 0 - printf("WCHAR_MIN=%"PRIdMAX"\n", (__Q8_MT)WCHAR_MIN); - printf("WCHAR_MAX=%"PRIdMAX"\n", (__Q8_MT)WCHAR_MAX); -#else - printf("WCHAR_MIN=%"PRIuMAX"\n", (U__Q8_MT)WCHAR_MIN); - printf("WCHAR_MAX=%"PRIuMAX"\n", (U__Q8_MT)WCHAR_MAX); -#endif -#endif -#ifdef WINT_MAX -#if WINT_MIN < 0 - printf("WINT_MIN=%"PRIdMAX"\n", (__Q8_MT)WINT_MIN); - printf("WINT_MAX=%"PRIdMAX"\n", (__Q8_MT)WINT_MAX); -#else - printf("WINT_MIN=%"PRIuMAX"\n", (U__Q8_MT)WINT_MIN); - printf("WINT_MAX=%"PRIuMAX"\n", (U__Q8_MT)WINT_MAX); -#endif -#endif - - /* - 7.18.4 Macros for integer constants - */ - - /* INTn_C for n=8 and 16 were at one point unimplementable - on most platforms, so they're treated as "optional": */ -#ifdef INT8_C - if ( INT8_C(-123) != -123 ) - printf("*** INT8_C(-123) produced %"PRIdMAX" ***\n", - (__Q8_MT)INT8_C(-123) - ); - if ( UINT8_C(123) != 123 ) - printf("*** UINT8_C(123) produced %"PRIuMAX" ***\n", - (U__Q8_MT)UINT8_C(123) - ); -#endif -#ifdef INT16_C - if ( INT16_C(-12345) != -12345 ) - printf("*** INT16_C(-12345) produced %"PRIdMAX" ***\n", - (__Q8_MT)INT16_C(-12345) - ); - if ( UINT16_C(12345) != 12345 ) - printf("*** UINT16_C(12345) produced %"PRIuMAX" ***\n", - (U__Q8_MT)UINT16_C(12345) - ); -#endif - if ( INT32_C(-123456789) != -123456789 ) - printf("*** INT32_C(-123456789) produced %"PRIdMAX" ***\n", - (__Q8_MT)INT32_C(-123456789) - ); - if ( UINT32_C(123456789) != 123456789 ) - printf("*** UINT32_C(123456789) produced %"PRIuMAX" ***\n", - (U__Q8_MT)UINT32_C(123456789) - ); -#ifdef INT_LEAST64_MAX - if ( INT64_C(-1234567890123456789) != -1234567890123456789 ) - printf("*** INT64_C(-1234567890123456789) produced %"PRIdMAX - " ***\n", - (__Q8_MT)INT64_C(-1234567890123456789) - ); - if ( UINT64_C(1234567890123456789) != 1234567890123456789 ) - printf("*** UINT64_C(1234567890123456789) produced %"PRIuMAX - " ***\n", - (U__Q8_MT)UINT64_C(1234567890123456789) - ); -#endif -#ifdef INTMAX_MAX - if ( INTMAX_C(-1234567890123456789) != -1234567890123456789 ) - printf("*** INTMAX_C(-1234567890123456789) produced %"PRIdMAX - " ***\n", - (__Q8_MT)INTMAX_C(-1234567890123456789) - ); - if ( UINTMAX_C(1234567890123456789) != 1234567890123456789 ) - printf("*** UINTMAX_C(1234567890123456789) produced %"PRIuMAX - " ***\n", - (U__Q8_MT)UINTMAX_C(1234567890123456789) - ); -#endif - - /* <inttypes.h> features: */ - -#if __STDC_VERSION__ >= 199901 - printf("sizeof(imaxdiv_t)=%u\n", (unsigned)sizeof(imaxdiv_t)); -#endif - - /* - 7.8.1 Macros for format specifiers - */ - - { - /* scanf these strings */ - static const char in_dn[] = "Z119bZ"; - static const char in_dmo[] = "Z-0119bZ"; - static const char in_dspx[] = "Z \t\n +0X119bZ"; - static const char in_dsmx[] = "Z \t\n -0x119bZ"; - static const char in_dsn[] = "Z \t\n 119bZ"; - static const char in_dp[] = "Z+119bZ"; - static const char in_dpx[] = "Z+0X119bz"; - - /* sprintf into this */ - static char buffer[1024]; - -#define SCAN(buf,fs,var,exp) if ( sscanf(buf, "Z%" fs, &var) != 1 ) \ - { \ - printf("*** " #fs "=" STR_SUB(fs) \ - " failed ***\n" \ - ); \ - status = EXIT_FAILURE; \ - } \ - else if ( var != (exp) ) \ - { \ - printf("*** " #fs "=" STR_SUB(fs) \ - " should be: " STR_SUB(exp) \ - ", was: %" fs " ***\n", var \ - ); \ - status = EXIT_FAILURE; \ - } \ - else - -#define PRINT(fs,var,exp) if ( sprintf(buffer, "%" fs, var ) <= 0 ) \ - { \ - printf("*** " #fs "=" STR_SUB(fs) \ - " failed ***\n" \ - ); \ - status = EXIT_FAILURE; \ - } \ - else if ( strcmp(buffer, STR_SUB(exp)) != 0 ) \ - { \ - printf("*** " #fs "=" STR_SUB(fs) \ - " should be: " STR_SUB(exp) \ - ", was: %s ***\n", buffer \ - ); \ - status = EXIT_FAILURE; \ - } \ - else - -#ifdef SCNo32 - SCAN(in_dn, SCNo32, int32, 9); -#endif -#ifdef PRIo32 - PRINT(PRIo32, int32, 11); -#endif - SCAN(in_dmo, SCNiLEAST16, intl16, -9); - SCAN(in_dspx, SCNdLEAST16, intl16, 0); - SCAN(in_dsmx, SCNiLEAST16, intl16, -4507); - PRINT(PRIdLEAST16, intl16, -4507); - PRINT(PRIiLEAST16, intl16, -4507); - SCAN(in_dsn, SCNxLEAST16, uintl16, 4507); - PRINT(PRIoLEAST16, uintl16, 10633); - PRINT(PRIuLEAST16, uintl16, 4507); - PRINT(PRIxLEAST16, uintl16, 119b); - PRINT(PRIXLEAST16, uintl16, 119B); - SCAN(in_dp, SCNxFAST16, uintf16, 4507); - PRINT(PRIxFAST16, uintf16, 119b); -#ifdef SCNdMAX - SCAN(in_dp, SCNdMAX, intmax, 119); -#endif -#ifdef PRIiMAX - PRINT(PRIiMAX, intmax, 119); -#endif -#ifdef SCNoMAX - SCAN(in_dpx, SCNoMAX, uintmax, 0); -#endif -#ifdef PRIxMAX - PRINT(PRIxMAX, uintmax, 0); -#endif - /* Obviously there should be a much larger battery of such tests. */ - } - -#if defined(INTMAX_MAX) /* <inttypes.h> has C99 features */ - /* - 7.8.2 Functions for greatest-width integer types - */ - - { - static struct - { - intmax_t input; - intmax_t expect; - } abs_data[] = - { -#ifdef INT8_MAX - {INT8_MAX, INT8_MAX}, - {-INT8_MAX, INT8_MAX}, - {UINT8_MAX, UINT8_MAX}, -#endif - -#ifdef INT16_MAX - { INT16_MAX, INT16_MAX}, - { -INT16_MAX, INT16_MAX}, - { UINT16_MAX, UINT16_MAX}, -#endif -#ifdef INT32_MAX - { INT32_MAX, INT32_MAX}, - { -INT32_MAX, INT32_MAX}, -#ifdef INT_LEAST64_MAX - { UINT32_MAX, UINT32_MAX}, -#endif -#endif -#ifdef INT64_MAX - { INT64_MAX, INT64_MAX}, - { -INT64_MAX, INT64_MAX}, -#endif - { INT_LEAST8_MAX, INT_LEAST8_MAX}, - { -INT_LEAST8_MAX, INT_LEAST8_MAX}, - { UINT_LEAST8_MAX, UINT_LEAST8_MAX}, - { INT_LEAST16_MAX, INT_LEAST16_MAX}, - { -INT_LEAST16_MAX, INT_LEAST16_MAX}, - { UINT_LEAST16_MAX, UINT_LEAST16_MAX}, - { INT_LEAST32_MAX, INT_LEAST32_MAX}, - { -INT_LEAST32_MAX, INT_LEAST32_MAX}, -#ifdef INT_LEAST64_MAX - { UINT_LEAST32_MAX, UINT_LEAST32_MAX}, - { INT_LEAST64_MAX, INT_LEAST64_MAX}, - { -INT_LEAST64_MAX, INT_LEAST64_MAX}, -#endif - { INT_FAST8_MAX, INT_FAST8_MAX}, - { -INT_FAST8_MAX, INT_FAST8_MAX}, - { UINT_FAST8_MAX, UINT_FAST8_MAX}, - { INT_FAST16_MAX, INT_FAST16_MAX}, - { -INT_FAST16_MAX, INT_FAST16_MAX}, - { UINT_FAST16_MAX, UINT_FAST16_MAX}, - { INT_FAST32_MAX, INT_FAST32_MAX}, - { -INT_FAST32_MAX, INT_FAST32_MAX}, -#ifdef INT_FAST64_MAX - { UINT_FAST32_MAX, UINT_FAST32_MAX}, - { INT_FAST64_MAX, INT_FAST64_MAX}, - { -INT_FAST64_MAX, INT_FAST64_MAX}, -#endif -#ifdef INTPTR_MAX - { INTPTR_MAX, INTPTR_MAX}, - { -INTPTR_MAX, INTPTR_MAX}, -#endif -#ifdef UINTPTR_MAX - { UINTPTR_MAX, UINTPTR_MAX}, -#endif - { INTMAX_MAX, INTMAX_MAX}, -#ifdef PTRDIFF_MAX - { PTRDIFF_MAX, PTRDIFF_MAX}, -#endif -#ifdef SIG_ATOMIC_MAX - { SIG_ATOMIC_MAX, SIG_ATOMIC_MAX}, -#if SIG_ATOMIC_MIN < 0 - { -SIG_ATOMIC_MAX, SIG_ATOMIC_MAX}, -#endif -#endif -#ifdef SIZE_MAX - { SIZE_MAX, SIZE_MAX}, -#endif -#ifdef WCHAR_MAX - { WCHAR_MAX, WCHAR_MAX}, -#if WCHAR_MIN < 0 - { -WCHAR_MAX, WCHAR_MAX}, -#endif -#endif -#ifdef WINT_MAX - { WINT_MAX, WINT_MAX}, -#if WINT_MIN < 0 - { -WINT_MAX, WINT_MAX}, -#endif -#endif - { 127, 127}, - { -127, 127}, - { 128, 128}, - { -127-1, 128}, - { 255, 255}, - { -256+1, 255}, - { 256, 256}, - { -256, 256}, - { 32767, 32767}, - { -32767, 32767}, - { 32768, 32768}, - { -32767-1, 32768}, - { 65535, 65535}, - { -65536+1, 65535}, - { 65536, 65536}, - { -65536, 65536}, - { 2147483647, 2147483647}, - { -2147483647, 2147483647}, - { 2147483648LL, 2147483648LL}, - { -2147483647LL-1, 2147483648LL}, -#ifdef INT_LEAST64_MAX - { 4294967295LL, 4294967295LL}, - { -4294967296LL+1, 4294967295LL}, - { 4294967296LL, 4294967296LL}, - { -4294967296LL, 4294967296LL}, - { 9223372036854775807LL, 9223372036854775807LL}, - { -9223372036854775807LL, 9223372036854775807LL}, - { 1234567890123456789LL, 1234567890123456789LL}, - { -1234567890123456789LL, 1234567890123456789LL}, -#endif - { 1, 1}, - { -1, 1}, - { 2, 2}, - { -2, 2}, - { 10, 10}, - { -10, 10}, - { 16, 16}, - { -16, 16}, - /* Other test cases can be added here. */ - {0, 0} /* terminates the list */ - }, *adp=abs_data; - int count=0; - do{ - intmax = imaxabs(adp->input); - count++; - if (intmax != adp->expect ) - { - - printf("*** imaxabs(%"PRIdMAX") failed; should be: %" - PRIdMAX", was: %"PRIdMAX" ***\n", - adp->input, adp->expect, intmax - ); - status = EXIT_FAILURE; - } - } - while ( adp++->input != 0 ); - } - - { - imaxdiv_t result; - static struct - { - intmax_t numer; - intmax_t denom; - intmax_t exp_quot; - intmax_t exp_rem; - } div_data[] = - { - { 0, 1, 0, 0}, - { 0, -1, 0, 0}, - { 0, 2, 0, 0}, - { 0, -2, 0, 0}, - { 0, 5, 0, 0}, - { 0, -5, 0, 0}, - { 1, 1, 1, 0}, - { 1, -1, -1, 0}, - { 1, 2, 0, 1}, - { 1, -2, 0, 1}, - { 1, 5, 0, 1}, - { 1, -5, 0, 1}, - { -1, 1, -1, 0}, - { -1, -1, 1, 0}, - { -1, 2, 0, -1}, - { -1, -2, 0, -1}, - { -1, 5, 0, -1}, - { -1, -5, 0, -1}, - { 2, 1, 2, 0}, - { 2, -1, -2, 0}, - { 2, 2, 1, 0}, - { 2, -2, -1, 0}, - { 2, 5, 0, 2}, - { 2, -5, 0, 2}, - { -2, 1, -2, 0}, - { -2, -1, 2, 0}, - { -2, 2, -1, 0}, - { -2, -2, 1, 0}, - { -2, 5, 0, -2}, - { -2, -5, 0, -2}, - { 17, 5, 3, 2}, - { -17, -5, 3, -2}, - { 17, -5, -3, 2}, - { -17, 5, -3, -2}, - { 2147483647, 1, 2147483647, 0}, - { -2147483647LL, 1, -2147483647LL, 0}, - { 2147483648LL, 1LL, 2147483648LL, 0LL}, - { -2147483647-1LL, 1LL, -2147483647-1LL, 0LL}, - { 2147483647LL, 2LL, 1073741823LL, 1LL}, - { -2147483647LL, 2LL, -1073741823LL, -1LL}, - { 2147483648LL, 2LL, 1073741824LL, 0LL}, - { -2147483647-1LL, 2LL, -1073741824LL, 0LL}, -#ifdef INT_LEAST64_MAX /* else might support only 32 bits */ - { 4294967295LL, 1LL, 4294967295LL, 0LL}, - { -4294967296LL+1LL, 1LL, -4294967296LL+1, 0}, - { 4294967296LL, 1, 4294967296LL, 0}, - { -4294967296LL, 1LL, -4294967296LL, 0LL}, - { 4294967295LL, -1LL, -4294967296+1LL, 0LL}, - { -4294967296+1LL, -1LL, 4294967295LL, 0LL}, - { 4294967296LL, -1LL, -4294967296LL, 0LL}, - { -4294967296LL, -1LL, 4294967296LL, 0LL}, - { 4294967295LL, 2LL, 2147483647LL, 1LL}, - { -4294967296+1LL, 2LL, -2147483647LL, -1LL}, - { 4294967296LL, 2LL, 2147483648LL, 0LL}, - { -4294967296LL, 2LL, -2147483647-1LL, 0LL}, - { 4294967295LL, 2147483647LL, 2LL, 1LL}, - { -4294967296+1LL, 2147483647LL, -2LL, -1LL}, - { 4294967296LL, 2147483647LL, 2LL, 2LL}, - { -4294967296LL, 2147483647LL, -2LL, -2LL}, - { 4294967295LL, -2147483647LL, -2LL, 1LL}, - { -4294967296+1LL, -2147483647LL, 2LL, -1LL}, - { 4294967296LL, -2147483647LL, -2LL, 2LL}, - { -4294967296LL, -2147483647LL, 2LL, -2LL}, - { 4294967295LL, 2147483648LL, 1LL, 2147483647LL}, - { -4294967296+1LL, 2147483648LL, -1LL, -2147483647LL}, - { 4294967296LL, 2147483648LL, 2LL, 0LL}, - { -4294967296LL, 2147483648LL, -2LL, 0LL}, - { 4294967295LL, -2147483647-1LL, -1LL, 2147483647LL}, - { -4294967296+1LL, -2147483647-1LL, 1LL, -2147483647LL}, - { 4294967296LL, -2147483647-1LL, -2LL, 0LL}, - { -4294967296LL, -2147483647-1LL, 2LL, 0LL}, - { 9223372036854775807LL, 1LL, 9223372036854775807LL, 0LL}, - { -9223372036854775807LL, 1LL, -9223372036854775807LL, 0LL}, - { 9223372036854775807LL, 2LL, 4611686018427387903LL, 1LL}, - { -9223372036854775807LL, 2LL, -4611686018427387903LL, -1LL}, -#endif - /* There should be a much larger battery of such tests. */ - { 0, 0, 0, 0} /* 0 denom terminates the list */ - }, *ddp; - - for ( ddp = div_data; ddp->denom != 0; ++ddp ) - if ( (result = imaxdiv(ddp->numer, ddp->denom)).quot - != ddp->exp_quot || result.rem != ddp->exp_rem - ) { - printf("*** imaxdiv(%"PRIdMAX",%"PRIdMAX - ") failed; should be: (%"PRIdMAX",%"PRIdMAX - "), was: (%"PRIdMAX",%"PRIdMAX") ***\n", - ddp->numer, ddp->denom, ddp->exp_quot, - ddp->exp_rem, result.quot, result.rem - ); - status = EXIT_FAILURE; - } - } - - { - char *endptr; - wchar_t *wendptr; - static char saved[64]; /* holds copy of input string */ - static wchar_t wnptr[64]; /* holds wide copy of test string */ - static int warned; /* "warned for null endptr" flag */ - register int i; - static struct - { - char * nptr; - int base; - intmax_t exp_val; - int exp_len; - } str_data[] = - { - { "", 0, 0, 0}, - { "", 2, 0, 0}, - { "", 8, 0, 0}, - { "", 9, 0, 0}, - { "", 10, 0, 0}, - { "", 16, 0, 0}, - { "", 36, 0, 0}, - { "0", 0, 0, 1}, - { "0", 2, 0, 1}, - { "0", 8, 0, 1}, - { "0", 9, 0, 1}, - { "0", 10, 0, 1}, - { "0", 16, 0, 1}, - { "0", 36, 0, 1}, - { "+0", 0, 0, 2}, - { "+0", 2, 0, 2}, - { "+0", 8, 0, 2}, - { "+0", 9, 0, 2}, - { "+0", 10, 0, 2}, - { "+0", 16, 0, 2}, - { "+0", 36, 0, 2}, - { "-0", 0, 0, 2}, - { "-0", 2, 0, 2}, - { "-0", 8, 0, 2}, - { "-0", 9, 0, 2}, - { "-0", 10, 0, 2}, - { "-0", 16, 0, 2}, - { "-0", 36, 0, 2}, - { "Inf", 0, 0, 0}, - { "Inf", 2, 0, 0}, - { "Inf", 8, 0, 0}, - { "Inf", 9, 0, 0}, - { "Inf", 10, 0, 0}, - { "Inf", 16, 0, 0}, - { "Inf", 36, 24171, 3}, - { "+Inf", 0, 0, 0}, - { "+Inf", 2, 0, 0}, - { "+Inf", 8, 0, 0}, - { "+Inf", 9, 0, 0}, - { "+Inf", 10, 0, 0}, - { "+Inf", 16, 0, 0}, - { "+Inf", 36, 24171, 4}, - { "-Inf", 0, 0, 0}, - { "-Inf", 2, 0, 0}, - { "-Inf", 8, 0, 0}, - { "-Inf", 9, 0, 0}, - { "-Inf", 10, 0, 0}, - { "-Inf", 16, 0, 0}, - { "-Inf", 36, -24171, 4}, - { "inf", 0, 0, 0}, - { "inf", 2, 0, 0}, - { "inf", 8, 0, 0}, - { "inf", 9, 0, 0}, - { "inf", 10, 0, 0}, - { "inf", 16, 0, 0}, - { "inf", 36, 24171, 3}, - { "+inf", 0, 0, 0}, - { "+inf", 2, 0, 0}, - { "+inf", 8, 0, 0}, - { "+inf", 9, 0, 0}, - { "+inf", 10, 0, 0}, - { "+inf", 16, 0, 0}, - { "+inf", 36, 24171, 4}, - { "-inf", 0, 0, 0}, - { "-inf", 2, 0, 0}, - { "-inf", 8, 0, 0}, - { "-inf", 9, 0, 0}, - { "-inf", 10, 0, 0}, - { "-inf", 16, 0, 0}, - { "-inf", 36, -24171, 4}, - { "119b8Z", 0, 119, 3}, - { "119bZ", 0, 119, 3}, - { "-0119bZ", 0, -9, 4}, - { " \t\n 0X119bZ", 0, 4507, 10}, - { " \t\n +0X119bZ", 0, 4507, 11}, - { " \t\n -0x119bZ", 0, -4507, 11}, - { " \t\n 119bZ", 0, 119, 7}, - { "+119bZ", 0, 119, 4}, - { "+0X119bz", 0, 4507, 7}, - { "119b8Z", 2, 3, 2}, - { "119bZ", 2, 3, 2}, - { "-0119bZ", 2, -3, 4}, - { " \t\n 0X119bZ", 2, 0, 5}, - { " \t\n +0X119bZ", 2, 0, 6}, - { " \t\n -0x119bZ", 2, 0, 6}, - { " \t\n 119bZ", 2, 3, 6}, - { "+119bZ", 2, 3, 3}, - { "+0X119bz", 2, 0, 2}, - { "119b8Z", 8, 9, 2}, - { "119bZ", 8, 9, 2}, - { "-0119bZ", 8, -9, 4}, - { " \t\n 0X119bZ", 8, 0, 5}, - { " \t\n +0X119bZ", 8, 0, 6}, - { " \t\n -0x119bZ", 8, 0, 6}, - { " \t\n 119bZ", 8, 9, 6}, - { "+119bZ", 8, 9, 3}, - { "+0X119bz", 8, 0, 2}, - { "119b8Z", 9, 10, 2}, - { "119bZ", 9, 10, 2}, - { "-0119bZ", 9, -10, 4}, - { " \t\n 0X119bZ", 9, 0, 5}, - { " \t\n +0X119bZ", 9, 0, 6}, - { " \t\n -0x119bZ", 9, 0, 6}, - { " \t\n 119bZ", 9, 10, 6}, - { "+119bZ", 9, 10, 3}, - { "+0X119bz", 9, 0, 2}, - { "119b8Z", 10, 119, 3}, - { "119bZ", 10, 119, 3}, - { "-0119bZ", 10, -119, 5}, - { " \t\n 0X119bZ", 10, 0, 5}, - { " \t\n +0X119bZ", 10, 0, 6}, - { " \t\n -0x119bZ", 10, 0, 6}, - { " \t\n 119bZ", 10, 119, 7}, - { "+119bZ", 10, 119, 4}, - { "+0X119bz", 10, 0, 2}, - { "119b8Z", 16, 72120, 5}, - { "119bZ", 16, 4507, 4}, - { "-0119bZ", 16, -4507, 6}, - { " \t\n 0X119bZ", 16, 4507, 10}, - { " \t\n +0X119bZ", 16, 4507, 11}, - { " \t\n -0x119bZ", 16, -4507, 11}, - { " \t\n 119bZ", 16, 4507,8}, - { "+119bZ", 16, 4507, 5}, - { "+0X119bz", 16, 4507, 7}, - { "119b8Z", 36, 62580275, 6}, - { "119bZ", 36, 1738367, 5}, - { "-0119bZ", 36, -1738367, 7}, - { " \t\n 0X119bZ", 36, 1997122175, 11}, - { " \t\n +0X119bZ", 36, 1997122175, 12}, - { " \t\n -0x119bZ", 36, -1997122175, 12}, - { " \t\n 119bZ", 36, 1738367, 9}, - { "+119bZ", 36, 1738367, 6}, - { "+0X119bz", 36, 1997122175, 8}, - /* There should be a much larger battery of such tests. */ - { "127", 0, 127, 3}, - { "-127", 0, -127, 4}, - { "128", 0, 128, 3}, - { "-128", 0, -127-1, 4}, - { "255", 0, 255, 3}, - { "-255", 0, -255, 4}, - { "256", 0, 256, 3}, - { "-256", 0, -255-1, 4}, - { "32767", 0, 32767, 5}, - { "-32767", 0, -32767, 6}, - { "32768", 0, 32768, 5}, - { "-32768", 0, -32767-1, 6}, - { "65535", 0, 65535, 5}, - { "-65535", 0, -65536+1, 6}, - { "65536", 0, 65536, 5}, - { "-65536", 0, -65536, 6}, - { "2147483647", 0, 2147483647, 10}, - { "-2147483647", 0, -2147483647, 11}, - { "2147483648", 0, 2147483648LL, 10}, - { "-2147483648", 0, -2147483647LL-1, 11}, - { "4294967295", 0, 4294967295LL, 10}, - { "-4294967295", 0, -4294967296LL+1, 11}, - { "4294967296", 0, 4294967296LL, 10}, - { "-4294967296", 0, -4294967296L, 11}, - { "9223372036854775807", 0, 9223372036854775807LL, 19}, - { "-9223372036854775807", 0, -9223372036854775807LL, 20}, - { "1234567890123456789", 0, 1234567890123456789LL, 19}, - { "-1234567890123456789", 0, -1234567890123456789LL, 20}, - { "1", 0, 1, 1}, - { "-1", 0, -1, 2}, - { "2", 0, 2, 1}, - { "-2", 0, -2, 2}, - { "10", 0, 10, 2}, - { "-10", 0, -10, 3}, - { "16", 0, 16, 2}, - { "-16", 0, -16, 3}, - /* Other test cases can be added here. */ - { NULL, 0, 0, 0 } /* terminates the list */ - }, *sdp; - - for ( sdp = str_data; sdp->nptr != NULL ; ++sdp ) - { - /* - 7.8.2.3 The strtoimax and strtoumax functions - */ - - strcpy(saved, sdp->nptr); - - errno = 0; /* shouldn't be changed */ - - if ( (intmax = strtoimax(sdp->nptr, &endptr, sdp->base)) - != sdp->exp_val - ) { - int save = errno; - - printf("*** strtoimax(%s,,%d) failed; should be: %" - PRIdMAX", was: %"PRIdMAX" ***\n", sdp->nptr, - sdp->base, sdp->exp_val, intmax - ); - status = EXIT_FAILURE; - errno = save; - } - else if ( endptr != sdp->nptr + sdp->exp_len ) - { - int save = errno; - - printf("*** strtoimax(%s,,%d) returned wrong endptr" - " ***\n", sdp->nptr, sdp->base - ); - status = EXIT_FAILURE; - errno = save; - } - - if ( errno != 0 ) - { - printf("*** strtoimax modified errno ***\n"); - status = EXIT_FAILURE; - } - - if ( strcmp(sdp->nptr, saved) != 0 ) - { - printf("*** strtoimax modified its input ***\n"); - status = EXIT_FAILURE; - strcpy(saved, sdp->nptr); - } - - if ( sdp->exp_val >= 0 ) /* else some sign extension */ - { - errno = 0; /* shouldn't be changed */ - - if ( (uintmax = strtoumax(sdp->nptr, &endptr, sdp->base - ) - ) != sdp->exp_val - ) { - int save = errno; - - printf("*** strtoumax(%s,,%d) failed; " - "should be: %"PRIuMAX", was: %"PRIuMAX - " ***\n", sdp->nptr, sdp->base, - sdp->exp_val, uintmax - ); - status = EXIT_FAILURE; - errno = save; - } - else if ( endptr != sdp->nptr + sdp->exp_len ) - { - int save = errno; - - printf("*** strtoumax(%s,,%d) returned wrong " - "endptr ***\n", sdp->nptr, sdp->base - ); - status = EXIT_FAILURE; - errno = save; - } - - if ( errno != 0 ) - { - printf("*** strtoumax modified errno ***\n"); - status = EXIT_FAILURE; - } - - if ( strcmp(sdp->nptr, saved) != 0 ) - { - printf("*** strtoumax" - " modified its input ***\n" - ); - status = EXIT_FAILURE; - strcpy(saved, sdp->nptr); - } - } - - /* tests for null endptr */ - -#define WARN() if (!warned) warned = 1, printf("*** Using null endptr: ***\n") - - warned = 0; - errno = 0; /* shouldn't be changed */ - - if ( (intmax = strtoimax(sdp->nptr, (char **)NULL, sdp->base)) - != sdp->exp_val - ) { - int save = errno; - - WARN(); - printf("*** strtoimax(%s,NULL,%d) failed; " - "should be: %"PRIdMAX", was: %"PRIdMAX" ***\n", - sdp->nptr, sdp->base, sdp->exp_val, intmax - ); - status = EXIT_FAILURE; - errno = save; - } - - if ( errno != 0 ) - { - WARN(); - printf("*** strtoimax modified errno ***\n"); - status = EXIT_FAILURE; - } - - if ( strcmp(sdp->nptr, saved) != 0 ) - { - WARN(); - printf("*** strtoimax modified its input ***\n"); - status = EXIT_FAILURE; - strcpy(saved, sdp->nptr); - } - - if ( sdp->exp_val >= 0 ) /* else some sign extension */ - { - errno = 0; /* shouldn't be changed */ - - if ( (uintmax = strtoumax(sdp->nptr, (char **)NULL, - sdp->base - ) - ) != sdp->exp_val - ) { - int save = errno; - - WARN(); - printf("*** strtoumax(%s,NULL,%d) failed; " - "should be: %"PRIuMAX", was: %"PRIuMAX - " ***\n", sdp->nptr, sdp->base, - sdp->exp_val, uintmax - ); - status = EXIT_FAILURE; - errno = save; - } - - if ( errno != 0 ) - { - WARN(); - printf("*** strtoumax modified errno ***\n"); - status = EXIT_FAILURE; - } - - if ( strcmp(sdp->nptr, saved) != 0 ) - { - WARN(); - printf("*** strtoumax" - " modified its input ***\n" - ); - status = EXIT_FAILURE; - strcpy(saved, sdp->nptr); - } - } - - /* - 7.8.2.4 The wcstoimax and wcstoumax functions - */ - - for ( i = 0; i < 64; ++i ) - if ( (wnptr[i] = sdp->nptr[i]) == '\0' ) - break; - - errno = 0; /* shouldn't be changed */ - - if ( (intmax = wcstoimax(wnptr, &wendptr, sdp->base)) - != sdp->exp_val - ) { - int save = errno; - - printf("*** wcstoimax(%s,,%d) failed; should be: %" - PRIdMAX", was: %"PRIdMAX" ***\n", sdp->nptr, - sdp->base, sdp->exp_val, intmax - ); - status = EXIT_FAILURE; - errno = save; - } - else if ( wendptr != wnptr + sdp->exp_len ) - { - int save = errno; - - printf("*** wcstoimax(%s,,%d) returned wrong endptr" - " ***\n", sdp->nptr, sdp->base - ); - status = EXIT_FAILURE; - errno = save; - } - - if ( errno != 0 ) - { - printf("*** wcstoimax modified errno ***\n"); - status = EXIT_FAILURE; - } - - for ( i = 0; i < 64; ++i ) - if ( wnptr[i] != sdp->nptr[i] ) - { - printf("*** wcstoimax modified its input ***\n" - ); - status = EXIT_FAILURE; - - for ( ; i < 64; ++i ) - if ( (wnptr[i] = sdp->nptr[i]) == '\0' ) - break; - - break; - } - else if ( wnptr[i] == '\0' ) - break; - - if ( sdp->exp_val >= 0 ) /* else some sign extension */ - { - errno = 0; /* shouldn't be changed */ - - if ( (uintmax = wcstoumax(wnptr, &wendptr, sdp->base) - ) != sdp->exp_val - ) { - int save = errno; - - printf("*** wcstoumax(%s,,%d) failed; " - "should be: %"PRIuMAX", was: %"PRIuMAX - " ***\n", sdp->nptr, sdp->base, - sdp->exp_val, uintmax - ); - status = EXIT_FAILURE; - errno = save; - } - else if ( wendptr != wnptr + sdp->exp_len ) - { - int save = errno; - - printf("*** wcstoumax(%s,,%d) returned wrong " - "endptr ***\n", sdp->nptr, sdp->base - ); - status = EXIT_FAILURE; - errno = save; - } - - if ( errno != 0 ) - { - printf("*** wcstoumax modified errno ***\n"); - status = EXIT_FAILURE; - } - - for ( i = 0; i < 64; ++i ) - if ( wnptr[i] != sdp->nptr[i] ) - { - printf("*** wcstoumax" - " modified its input ***\n" - ); - status = EXIT_FAILURE; - - for ( ; i < 64; ++i ) - if ( (wnptr[i] = sdp->nptr[i]) - == '\0' - ) - break; - - break; - } - else if ( wnptr[i] == '\0' ) - break; - } - - /* tests for null endptr */ - - warned = 0; - errno = 0; /* shouldn't be changed */ - - if ( (intmax = wcstoimax(wnptr, (wchar_t **)NULL, sdp->base)) - != sdp->exp_val - ) { - int save = errno; - - WARN(); - printf("*** wcstoimax(%s,NULL,%d) failed; should be: %" - PRIdMAX", was: %"PRIdMAX" ***\n", sdp->nptr, - sdp->base, sdp->exp_val, intmax - ); - status = EXIT_FAILURE; - errno = save; - } - - if ( errno != 0 ) - { - WARN(); - printf("*** wcstoimax modified errno ***\n"); - status = EXIT_FAILURE; - } - - for ( i = 0; i < 64; ++i ) - if ( wnptr[i] != sdp->nptr[i] ) - { - WARN(); - printf("*** wcstoimax modified its input ***\n" - ); - status = EXIT_FAILURE; - - for ( ; i < 64; ++i ) - if ( (wnptr[i] = sdp->nptr[i]) - == '\0' - ) - break; - - break; - } - else if ( wnptr[i] == '\0' ) - break; - - if ( sdp->exp_val >= 0 ) /* else some sign extension */ - { - errno = 0; /* shouldn't be changed */ - - if ( (uintmax = wcstoumax(wnptr, (wchar_t **)NULL, - sdp->base - ) - ) != sdp->exp_val - ) { - int save = errno; - - WARN(); - printf("*** wcstoumax(%s,NULL,%d) failed; " - "should be: %"PRIuMAX", was: %"PRIuMAX - " ***\n", sdp->nptr, sdp->base, - sdp->exp_val, uintmax - ); - status = EXIT_FAILURE; - errno = save; - } - - if ( errno != 0 ) - { - WARN(); - printf("*** wcstoumax modified errno ***\n"); - status = EXIT_FAILURE; - } - - for ( i = 0; i < 64; ++i ) - if ( wnptr[i] != sdp->nptr[i] ) - { - WARN(); - printf("*** wcstoumax" - " modified its input ***\n" - ); - status = EXIT_FAILURE; - - for ( ; i < 64; ++i ) - if ( (wnptr[i] = sdp->nptr[i]) - == '\0' - ) - break; - - break; - } - else if ( wnptr[i] == '\0' ) - break; - } - } - - /* - 7.8.2.3 The strtoimax and strtoumax functions (continued) - */ - - if ( (intmax = strtoimax("1234567890123456789012345678901234567890" - "1234567890123456789012345678901234567890" - "1234567890123456789012345678901234567890" - "1234567890123456789012345678901234567890" - "1234567890123456789012345678901234567890" - "1234567890123456789012345678901234567890", - &endptr, 0 - ) - ) != INTMAX_MAX || errno != ERANGE - ) { - printf("*** strtoimax failed overflow test ***\n"); - status = EXIT_FAILURE; - } - - if ( (intmax = strtoimax("+1234567890123456789012345678901234567890" - "1234567890123456789012345678901234567890" - "1234567890123456789012345678901234567890" - "1234567890123456789012345678901234567890" - "1234567890123456789012345678901234567890" - "1234567890123456789012345678901234567890", - &endptr, 0 - ) - ) != INTMAX_MAX || errno != ERANGE - ) { - printf("*** strtoimax failed +overflow test ***\n"); - status = EXIT_FAILURE; - } - - if ( (intmax = strtoimax("-1234567890123456789012345678901234567890" - "1234567890123456789012345678901234567890" - "1234567890123456789012345678901234567890" - "1234567890123456789012345678901234567890" - "1234567890123456789012345678901234567890" - "1234567890123456789012345678901234567890", - &endptr, 0 - ) - ) != INTMAX_MIN || errno != ERANGE - ) { - printf("*** strtoimax failed -overflow test ***\n"); - status = EXIT_FAILURE; - } - - if ( (uintmax = strtoumax("1234567890123456789012345678901234567890" - "1234567890123456789012345678901234567890" - "1234567890123456789012345678901234567890" - "1234567890123456789012345678901234567890" - "1234567890123456789012345678901234567890" - "1234567890123456789012345678901234567890", - &endptr, 0 - ) - ) != UINTMAX_MAX || errno != ERANGE - ) { - printf("*** strtoumax failed overflow test ***\n"); - status = EXIT_FAILURE; - } - - if ( (uintmax = strtoumax("+1234567890123456789012345678901234567890" - "1234567890123456789012345678901234567890" - "1234567890123456789012345678901234567890" - "1234567890123456789012345678901234567890" - "1234567890123456789012345678901234567890" - "1234567890123456789012345678901234567890", - &endptr, 0 - ) - ) != UINTMAX_MAX || errno != ERANGE - ) { - printf("*** strtoumax failed +overflow test ***\n"); - status = EXIT_FAILURE; - } - - if ( (uintmax = strtoumax("-1234567890123456789012345678901234567890" - "1234567890123456789012345678901234567890" - "1234567890123456789012345678901234567890" - "1234567890123456789012345678901234567890" - "1234567890123456789012345678901234567890" - "1234567890123456789012345678901234567890", - &endptr, 0 - ) - ) != UINTMAX_MAX || errno != ERANGE - ) { - printf("*** strtoumax failed -overflow test ***\n"); - status = EXIT_FAILURE; - } - - /* - 7.8.2.4 The wcstoimax and wcstoumax functions (continued) - */ - - if ( (intmax = wcstoimax(L"1234567890123456789012345678901234567890" - L"1234567890123456789012345678901234567890" - L"1234567890123456789012345678901234567890" - L"1234567890123456789012345678901234567890" - L"1234567890123456789012345678901234567890" - L"1234567890123456789012345678901234567890", - &wendptr, 0 - ) - ) != INTMAX_MAX || errno != ERANGE - ) { - printf("*** wcstoimax failed overflow test ***\n"); - status = EXIT_FAILURE; - } - - if ( (intmax = wcstoimax(L"+1234567890123456789012345678901234567890" - L"1234567890123456789012345678901234567890" - L"1234567890123456789012345678901234567890" - L"1234567890123456789012345678901234567890" - L"1234567890123456789012345678901234567890" - L"1234567890123456789012345678901234567890", - &wendptr, 0 - ) - ) != INTMAX_MAX || errno != ERANGE - ) { - printf("*** wcstoimax failed +overflow test ***\n"); - status = EXIT_FAILURE; - } - - if ( (intmax = wcstoimax(L"-1234567890123456789012345678901234567890" - L"1234567890123456789012345678901234567890" - L"1234567890123456789012345678901234567890" - L"1234567890123456789012345678901234567890" - L"1234567890123456789012345678901234567890" - L"1234567890123456789012345678901234567890", - &wendptr, 0 - ) - ) != INTMAX_MIN || errno != ERANGE - ) { - printf("*** wcstoimax failed -overflow test ***\n"); - status = EXIT_FAILURE; - } - - if ( (uintmax = wcstoumax(L"1234567890123456789012345678901234567890" - L"1234567890123456789012345678901234567890" - L"1234567890123456789012345678901234567890" - L"1234567890123456789012345678901234567890" - L"1234567890123456789012345678901234567890" - L"1234567890123456789012345678901234567890", - &wendptr, 0 - ) - ) != UINTMAX_MAX || errno != ERANGE - ) { - printf("*** wcstoumax failed overflow test ***\n"); - status = EXIT_FAILURE; - } - - if ( (uintmax = wcstoumax(L"+1234567890123456789012345678901234567890" - L"1234567890123456789012345678901234567890" - L"1234567890123456789012345678901234567890" - L"1234567890123456789012345678901234567890" - L"1234567890123456789012345678901234567890" - L"1234567890123456789012345678901234567890", - &wendptr, 0 - ) - ) != UINTMAX_MAX || errno != ERANGE - ) { - printf("*** wcstoumax failed +overflow test ***\n"); - status = EXIT_FAILURE; - } - - if ( (uintmax = wcstoumax(L"-1234567890123456789012345678901234567890" - L"1234567890123456789012345678901234567890" - L"1234567890123456789012345678901234567890" - L"1234567890123456789012345678901234567890" - L"1234567890123456789012345678901234567890" - L"1234567890123456789012345678901234567890", - &wendptr, 0 - ) - ) != UINTMAX_MAX || errno != ERANGE - ) { - printf("*** wcstoumax failed -overflow test ***\n"); - status = EXIT_FAILURE; - } - } -#endif /* defined(INTMAX_MAX) */ - - if ( status != 0 ) - fprintf(stderr, "sitest failed; see stdout for details\n"); - - return status; - } diff --git a/winsup/mingw/mingwex/stdio/fopen64.c b/winsup/mingw/mingwex/stdio/fopen64.c deleted file mode 100755 index d1dca885b..000000000 --- a/winsup/mingw/mingwex/stdio/fopen64.c +++ /dev/null @@ -1,7 +0,0 @@ -#include <stdio.h> - -FILE* __cdecl -fopen64 (const char* filename, const char* mode) -{ - return fopen (filename, mode); -} diff --git a/winsup/mingw/mingwex/stdio/fprintf.c b/winsup/mingw/mingwex/stdio/fprintf.c deleted file mode 100644 index 8e0582cb8..000000000 --- a/winsup/mingw/mingwex/stdio/fprintf.c +++ /dev/null @@ -1,68 +0,0 @@ -/* fprintf.c - * - * $Id$ - * - * Provides an implementation of the "fprintf" function, conforming - * generally to C99 and SUSv3/POSIX specifications, with extensions - * to support Microsoft's non-standard format specifications. This - * is included in libmingwex.a, whence it may replace the Microsoft - * function of the same name. - * - * Written by Keith Marshall <keithmarshall@users.sourceforge.net> - * - * This implementation of "fprintf" will normally be invoked by calling - * "__mingw_fprintf()" in preference to a direct reference to "fprintf()" - * itself; this leaves the MSVCRT implementation as the default, which - * will be deployed when user code invokes "fprint()". Users who then - * wish to use this implementation may either call "__mingw_fprintf()" - * directly, or may use conditional preprocessor defines, to redirect - * references to "fprintf()" to "__mingw_fprintf()". - * - * Compiling this module with "-D INSTALL_AS_DEFAULT" will change this - * recommended convention, such that references to "fprintf()" in user - * code will ALWAYS be redirected to "__mingw_fprintf()"; if this option - * is adopted, then users wishing to use the MSVCRT implementation of - * "fprintf()" will be forced to use a "back-door" mechanism to do so. - * Such a "back-door" mechanism is provided with MinGW, allowing the - * MSVCRT implementation to be called as "__msvcrt_fprintf()"; however, - * since users may not expect this behaviour, a standard libmingwex.a - * installation does not employ this option. - * - * - * This is free software. You may redistribute and/or modify it as you - * see fit, without restriction of copyright. - * - * This software is provided "as is", in the hope that it may be useful, - * but WITHOUT WARRANTY OF ANY KIND, not even any implied warranty of - * MERCHANTABILITY, nor of FITNESS FOR ANY PARTICULAR PURPOSE. At no - * time will the author accept any form of liability for any damages, - * however caused, resulting from the use of this software. - * - */ -#include <stdio.h> -#include <stdarg.h> - -#include "pformat.h" - -int __cdecl __fprintf (FILE *, const char *, ...) __MINGW_NOTHROW; - -#ifdef INSTALL_AS_DEFAULT -/* - * This implementation is to become the default for calls to fprintf(); - * establish the alias to make this so, forcing users to use the back-door - * __msvcrt_fprintf() reference, to access the original MSVCRT function. - */ -int __cdecl __mingw_alias(fprintf) (FILE *, const char *, ...) __MINGW_NOTHROW; - -#endif - -int __cdecl __fprintf( FILE *stream, const char *fmt, ... ) -{ - register int retval; - va_list argv; va_start( argv, fmt ); - retval = __pformat( PFORMAT_TO_FILE | PFORMAT_NOLIMIT, stream, 0, fmt, argv ); - va_end( argv ); - return retval; -} - -/* $RCSfile$Revision$: end of file */ diff --git a/winsup/mingw/mingwex/stdio/fseeko64.c b/winsup/mingw/mingwex/stdio/fseeko64.c deleted file mode 100755 index d8dcc0c44..000000000 --- a/winsup/mingw/mingwex/stdio/fseeko64.c +++ /dev/null @@ -1,30 +0,0 @@ -#include <stdio.h> -#include <io.h> -#include <errno.h> - -int __cdecl -fseeko64 (FILE* stream, off64_t offset, int whence) -{ - fpos_t pos; - if (whence == SEEK_CUR) - { - /* If stream is invalid, fgetpos sets errno. */ - if (fgetpos (stream, &pos)) - return (-1); - pos += (fpos_t) offset; - } - else if (whence == SEEK_END) - { - /* If writing, we need to flush before getting file length. */ - fflush (stream); - pos = (fpos_t) (_filelengthi64 (_fileno (stream)) + offset); - } - else if (whence == SEEK_SET) - pos = (fpos_t) offset; - else - { - errno = EINVAL; - return (-1); - } - return fsetpos (stream, &pos); -} diff --git a/winsup/mingw/mingwex/stdio/ftello64.c b/winsup/mingw/mingwex/stdio/ftello64.c deleted file mode 100755 index 97a388cd6..000000000 --- a/winsup/mingw/mingwex/stdio/ftello64.c +++ /dev/null @@ -1,11 +0,0 @@ -#include <stdio.h> - -off64_t __cdecl -ftello64 (FILE * stream) -{ - fpos_t pos; - if (fgetpos(stream, &pos)) - return -1LL; - else - return ((off64_t) pos); -} diff --git a/winsup/mingw/mingwex/stdio/lseek64.c b/winsup/mingw/mingwex/stdio/lseek64.c deleted file mode 100755 index 8f8bfa5e4..000000000 --- a/winsup/mingw/mingwex/stdio/lseek64.c +++ /dev/null @@ -1,8 +0,0 @@ -#include <io.h> - -off64_t lseek64 -(int fd, off64_t offset, int whence) -{ - return _lseeki64(fd, (__int64) offset, whence); -} - diff --git a/winsup/mingw/mingwex/stdio/pformat.c b/winsup/mingw/mingwex/stdio/pformat.c deleted file mode 100644 index 8b3e93ed4..000000000 --- a/winsup/mingw/mingwex/stdio/pformat.c +++ /dev/null @@ -1,2516 +0,0 @@ -/* FIXME: to be removed one day; for now we explicitly are not - * prepared to support the POSIX-XSI additions to the C99 standard. - */ -#undef WITH_XSI_FEATURES - -/* pformat.c - * - * $Id$ - * - * Provides a core implementation of the formatting capabilities - * common to the entire `printf()' family of functions; it conforms - * generally to C99 and SUSv3/POSIX specifications, with extensions - * to support Microsoft's non-standard format specifications. - * - * Written by Keith Marshall <keithmarshall@users.sourceforge.net> - * - * This is free software. You may redistribute and/or modify it as you - * see fit, without restriction of copyright. - * - * This software is provided "as is", in the hope that it may be useful, - * but WITHOUT WARRANTY OF ANY KIND, not even any implied warranty of - * MERCHANTABILITY, nor of FITNESS FOR ANY PARTICULAR PURPOSE. At no - * time will the author accept any form of liability for any damages, - * however caused, resulting from the use of this software. - * - * The elements of this implementation which deal with the formatting - * of floating point numbers, (i.e. the `%e', `%E', `%f', `%F', `%g' - * and `%G' format specifiers, but excluding the hexadecimal floating - * point `%a' and `%A' specifiers), make use of the `__gdtoa' function - * written by David M. Gay, and are modelled on his sample code, which - * has been deployed under its accompanying terms of use:-- - * - ****************************************************************** - * Copyright (C) 1997, 1999, 2001 Lucent Technologies - * All Rights Reserved - * - * Permission to use, copy, modify, and distribute this software and - * its documentation for any purpose and without fee is hereby - * granted, provided that the above copyright notice appear in all - * copies and that both that the copyright notice and this - * permission notice and warranty disclaimer appear in supporting - * documentation, and that the name of Lucent or any of its entities - * not be used in advertising or publicity pertaining to - * distribution of the software without specific, written prior - * permission. - * - * LUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. - * IN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY - * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER - * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, - * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF - * THIS SOFTWARE. - ****************************************************************** - * - */ -#include <stdio.h> -#include <stdarg.h> -#include <stddef.h> -#include <stdint.h> -#include <stdlib.h> -#include <string.h> -#include <limits.h> -#include <locale.h> -#include <wchar.h> -#include <math.h> - -/* FIXME: The following belongs in values.h, but current MinGW - * has nothing useful there! OTOH, values.h is not a standard - * header, and it's use may be considered obsolete; perhaps it - * is better to just keep these definitions here. - */ -#ifndef _VALUES_H -/* - * values.h - * - */ -#define _VALUES_H - -#include <limits.h> - -#define _TYPEBITS(type) (sizeof(type) * CHAR_BIT) - -#define LLONGBITS _TYPEBITS(long long) - -#endif /* !defined _VALUES_H -- end of file */ - -#include "pformat.h" - -/* Bit-map constants, defining the internal format control - * states, which propagate through the flags. - */ -#define PFORMAT_HASHED 0x0800 -#define PFORMAT_LJUSTIFY 0x0400 -#define PFORMAT_ZEROFILL 0x0200 - -#define PFORMAT_JUSTIFY (PFORMAT_LJUSTIFY | PFORMAT_ZEROFILL) -#define PFORMAT_IGNORE -1 - -#define PFORMAT_SIGNED 0x01C0 -#define PFORMAT_POSITIVE 0x0100 -#define PFORMAT_NEGATIVE 0x0080 -#define PFORMAT_ADDSPACE 0x0040 - -#define PFORMAT_XCASE 0x0020 - -#define PFORMAT_LDOUBLE 0x0004 - -/* `%o' format digit extraction mask, and shift count... - * (These are constant, and do not propagate through the flags). - */ -#define PFORMAT_OMASK 0x0007 -#define PFORMAT_OSHIFT 0x0003 - -/* `%x' and `%X' format digit extraction mask, and shift count... - * (These are constant, and do not propagate through the flags). - */ -#define PFORMAT_XMASK 0x000F -#define PFORMAT_XSHIFT 0x0004 - -/* The radix point character, used in floating point formats, is - * localised on the basis of the active LC_NUMERIC locale category. - * It is stored locally, as a `wchar_t' entity, which is converted - * to a (possibly multibyte) character on output. Initialisation - * of the stored `wchar_t' entity, together with a record of its - * effective multibyte character length, is required each time - * `__pformat()' is entered, (static storage would not be thread - * safe), but this initialisation is deferred until it is actually - * needed; on entry, the effective character length is first set to - * the following value, (and the `wchar_t' entity is zeroed), to - * indicate that a call of `localeconv()' is needed, to complete - * the initialisation. - */ -#define PFORMAT_RPINIT -3 - -/* The floating point format handlers return the following value - * for the radix point position index, when the argument value is - * infinite, or not a number. - */ -#define PFORMAT_INFNAN -32768 - -#ifdef _WIN32 -/* - * The Microsoft standard for printing `%e' format exponents is - * with a minimum of three digits, unless explicitly set otherwise, - * by a prior invocation of the `_set_output_format()' function. - * - * The following macro allows us to replicate this behaviour. - */ -# define PFORMAT_MINEXP __pformat_exponent_digits() - /* - * However, this feature is unsupported for versions of the - * MSVC runtime library prior to msvcr80.dll, and by default, - * MinGW uses an earlier version, (equivalent to msvcr60.dll), - * for which `_TWO_DIGIT_EXPONENT' will be undefined. - */ -# ifndef _TWO_DIGIT_EXPONENT - /* - * This hack works around the lack of the `_set_output_format()' - * feature, when supporting versions of the MSVC runtime library - * prior to msvcr80.dll; it simply enforces Microsoft's original - * convention, for all cases where the feature is unsupported. - */ -# define _get_output_format() 0 -# define _TWO_DIGIT_EXPONENT 1 -# endif -/* - * Irrespective of the MSVCRT version supported, *we* will add - * an additional capability, through the following inline function, - * which will allow the user to choose his own preferred default - * for `PRINTF_EXPONENT_DIGITS', through the simple expedient - * of defining it as an environment variable. - */ -static __inline__ __attribute__((__always_inline__)) -int __pformat_exponent_digits( void ) -{ - char *exponent_digits = getenv( "PRINTF_EXPONENT_DIGITS" ); - return ((exponent_digits != NULL) && ((unsigned)(*exponent_digits - '0') < 3)) - || (_get_output_format() & _TWO_DIGIT_EXPONENT) - ? 2 - : 3 - ; -} -#else -/* - * When we don't care to mimic Microsoft's standard behaviour, - * we adopt the C99/POSIX standard of two digit exponents. - */ -# define PFORMAT_MINEXP 2 -#endif - -typedef union -{ - /* A data type agnostic representation, - * for printf arguments of any integral data type... - */ - signed long __pformat_long_t; - signed long long __pformat_llong_t; - unsigned long __pformat_ulong_t; - unsigned long long __pformat_ullong_t; - unsigned short __pformat_ushort_t; - unsigned char __pformat_uchar_t; - signed short __pformat_short_t; - signed char __pformat_char_t; - void * __pformat_ptr_t; -} __pformat_intarg_t; - -typedef enum -{ - /* Format interpreter state indices... - * (used to identify the active phase of format string parsing). - */ - PFORMAT_INIT = 0, - PFORMAT_SET_WIDTH, - PFORMAT_GET_PRECISION, - PFORMAT_SET_PRECISION, - PFORMAT_END -} __pformat_state_t; - -typedef enum -{ - /* Argument length classification indices... - * (used for arguments representing integer data types). - */ - PFORMAT_LENGTH_INT = 0, - PFORMAT_LENGTH_SHORT, - PFORMAT_LENGTH_LONG, - PFORMAT_LENGTH_LLONG, - PFORMAT_LENGTH_CHAR -} __pformat_length_t; -/* - * And a macro to map any arbitrary data type to an appropriate - * matching index, selected from those above; the compiler should - * collapse this to a simple assignment. - */ -#define __pformat_arg_length( type ) \ - sizeof( type ) == sizeof( long long ) ? PFORMAT_LENGTH_LLONG : \ - sizeof( type ) == sizeof( long ) ? PFORMAT_LENGTH_LONG : \ - sizeof( type ) == sizeof( short ) ? PFORMAT_LENGTH_SHORT : \ - sizeof( type ) == sizeof( char ) ? PFORMAT_LENGTH_CHAR : \ - /* should never need this default */ PFORMAT_LENGTH_INT - -typedef struct -{ - /* Formatting and output control data... - * An instance of this control block is created, (on the stack), - * for each call to `__pformat()', and is passed by reference to - * each of the output handlers, as required. - */ - void * dest; - int flags; - int width; - int precision; - int rplen; - wchar_t rpchr; - int count; - int quota; - int expmin; -} __pformat_t; - -static -void __pformat_putc( int c, __pformat_t *stream ) -{ - /* Place a single character into the `__pformat()' output queue, - * provided any specified output quota has not been exceeded. - */ - if( (stream->flags & PFORMAT_NOLIMIT) || (stream->quota > stream->count) ) - { - /* Either there was no quota specified, - * or the active quota has not yet been reached. - */ - if( stream->flags & PFORMAT_TO_FILE ) - /* - * This is single character output to a FILE stream... - */ - fputc( c, (FILE *)(stream->dest) ); - - else - /* Whereas, this is to an internal memory buffer... - */ - ((char *)(stream->dest))[stream->count] = c; - } - ++stream->count; -} - -static -void __pformat_putchars( const char *s, int count, __pformat_t *stream ) -{ - /* Handler for `%c' and (indirectly) `%s' conversion specifications. - * - * Transfer characters from the string buffer at `s', character by - * character, up to the number of characters specified by `count', or - * if `precision' has been explicitly set to a value less than `count', - * stopping after the number of characters specified for `precision', - * to the `__pformat()' output stream. - * - * Characters to be emitted are passed through `__pformat_putc()', to - * ensure that any specified output quota is honoured. - */ - if( (stream->precision >= 0) && (count > stream->precision) ) - /* - * Ensure that the maximum number of characters transferred doesn't - * exceed any explicitly set `precision' specification. - */ - count = stream->precision; - - /* Establish the width of any field padding required... - */ - if( stream->width > count ) - /* - * as the number of spaces equivalent to the number of characters - * by which those to be emitted is fewer than the field width... - */ - stream->width -= count; - - else - /* ignoring any width specification which is insufficient. - */ - stream->width = PFORMAT_IGNORE; - - if( (stream->width > 0) && ((stream->flags & PFORMAT_LJUSTIFY) == 0) ) - /* - * When not doing flush left justification, (i.e. the `-' flag - * is not set), any residual unreserved field width must appear - * as blank padding, to the left of the output string. - */ - while( stream->width-- ) - __pformat_putc( '\x20', stream ); - - /* Emit the data... - */ - while( count-- ) - /* - * copying the requisite number of characters from the input. - */ - __pformat_putc( *s++, stream ); - - /* If we still haven't consumed the entire specified field width, - * we must be doing flush left justification; any residual width - * must be filled with blanks, to the right of the output value. - */ - while( stream->width-- > 0 ) - __pformat_putc( '\x20', stream ); -} - -static __inline__ -void __pformat_puts( const char *s, __pformat_t *stream ) -{ - /* Handler for `%s' conversion specifications. - * - * Transfer a NUL terminated character string, character by character, - * stopping when the end of the string is encountered, or if `precision' - * has been explicitly set, when the specified number of characters has - * been emitted, if that is less than the length of the input string, - * to the `__pformat()' output stream. - * - * This is implemented as a trivial call to `__pformat_putchars()', - * passing the length of the input string as the character count, - * (after first verifying that the input pointer is not NULL). - */ - if( s == NULL ) s = "(null)"; - __pformat_putchars( s, strlen( s ), stream ); -} - -static -void __pformat_wputchars( const wchar_t *s, int count, __pformat_t *stream ) -{ - /* Handler for `%C'(`%lc') and `%S'(`%ls') conversion specifications; - * (this is a wide character variant of `__pformat_putchars()'). - * - * Each multibyte character sequence to be emitted is passed, byte - * by byte, through `__pformat_putc()', to ensure that any specified - * output quota is honoured. - */ - char buf[16]; mbstate_t state; int len = wcrtomb( buf, L'\0', &state ); - - if( (stream->precision >= 0) && (count > stream->precision) ) - /* - * Ensure that the maximum number of characters transferred doesn't - * exceed any explicitly set `precision' specification. - */ - count = stream->precision; - - /* Establish the width of any field padding required... - */ - if( stream->width > count ) - /* - * as the number of spaces equivalent to the number of characters - * by which those to be emitted is fewer than the field width... - */ - stream->width -= count; - - else - /* ignoring any width specification which is insufficient. - */ - stream->width = PFORMAT_IGNORE; - - if( (stream->width > 0) && ((stream->flags & PFORMAT_LJUSTIFY) == 0) ) - /* - * When not doing flush left justification, (i.e. the `-' flag - * is not set), any residual unreserved field width must appear - * as blank padding, to the left of the output string. - */ - while( stream->width-- ) - __pformat_putc( '\x20', stream ); - - /* Emit the data, converting each character from the wide - * to the multibyte domain as we go... - */ - while( (count-- > 0) && ((len = wcrtomb( buf, *s++, &state )) > 0) ) - { - char *p = buf; - while( len-- > 0 ) - __pformat_putc( *p++, stream ); - } - - /* If we still haven't consumed the entire specified field width, - * we must be doing flush left justification; any residual width - * must be filled with blanks, to the right of the output value. - */ - while( stream->width-- > 0 ) - __pformat_putc( '\x20', stream ); -} - -static __inline__ __attribute__((__always_inline__)) -void __pformat_wcputs( const wchar_t *s, __pformat_t *stream ) -{ - /* Handler for `%S' (`%ls') conversion specifications. - * - * Transfer a NUL terminated wide character string, character by - * character, converting to its equivalent multibyte representation - * on output, and stopping when the end of the string is encountered, - * or if `precision' has been explicitly set, when the specified number - * of characters has been emitted, if that is less than the length of - * the input string, to the `__pformat()' output stream. - * - * This is implemented as a trivial call to `__pformat_wputchars()', - * passing the length of the input string as the character count, - * (after first verifying that the input pointer is not NULL). - */ - if( s == NULL ) s = L"(null)"; - __pformat_wputchars( s, wcslen( s ), stream ); -} - -static __inline__ -int __pformat_int_bufsiz( int bias, int size, __pformat_t *stream ) -{ - /* Helper to establish the size of the internal buffer, which - * is required to queue the ASCII decomposition of an integral - * data value, prior to transfer to the output stream. - */ - size = ((size - 1 + LLONGBITS) / size) + bias; - size += (stream->precision > 0) ? stream->precision : 0; - return (size > stream->width) ? size : stream->width; -} - -static -void __pformat_int( __pformat_intarg_t value, __pformat_t *stream ) -{ - /* Handler for `%d', `%i' and `%u' conversion specifications. - * - * Transfer the ASCII representation of an integer value parameter, - * formatted as a decimal number, to the `__pformat()' output queue; - * output will be truncated, if any specified quota is exceeded. - */ - char buf[__pformat_int_bufsiz(1, PFORMAT_OSHIFT, stream)]; - char *p = buf; int precision; - - if( stream->flags & PFORMAT_NEGATIVE ) - { - /* The input value might be negative, (i.e. it is a signed value)... - */ - if( value.__pformat_llong_t < 0LL ) - /* - * It IS negative, but we want to encode it as unsigned, - * displayed with a leading minus sign, so convert it... - */ - value.__pformat_llong_t = -value.__pformat_llong_t; - - else - /* It is unequivocally a POSITIVE value, so turn off the - * request to prefix it with a minus sign... - */ - stream->flags &= ~PFORMAT_NEGATIVE; - } - - /* Encode the input value for display... - */ - while( value.__pformat_ullong_t ) - { - /* decomposing it into its constituent decimal digits, - * in order from least significant to most significant, using - * the local buffer as a LIFO queue in which to store them. - */ - *p++ = '0' + (unsigned char)(value.__pformat_ullong_t % 10LL); - value.__pformat_ullong_t /= 10LL; - } - - if( (stream->precision > 0) - && ((precision = stream->precision - (p - buf)) > 0) ) - /* - * We have not yet queued sufficient digits to fill the field width - * specified for minimum `precision'; pad with zeros to achieve this. - */ - while( precision-- > 0 ) - *p++ = '0'; - - if( (p == buf) && (stream->precision != 0) ) - /* - * Input value was zero; make sure we print at least one digit, - * unless the precision is also explicitly zero. - */ - *p++ = '0'; - - if( (stream->width > 0) && ((stream->width -= p - buf) > 0) ) - { - /* We have now queued sufficient characters to display the input value, - * at the desired precision, but this will not fill the output field... - */ - if( stream->flags & PFORMAT_SIGNED ) - /* - * We will fill one additional space with a sign... - */ - stream->width--; - - if( (stream->precision < 0) - && ((stream->flags & PFORMAT_JUSTIFY) == PFORMAT_ZEROFILL) ) - /* - * and the `0' flag is in effect, so we pad the remaining spaces, - * to the left of the displayed value, with zeros. - */ - while( stream->width-- > 0 ) - *p++ = '0'; - - else if( (stream->flags & PFORMAT_LJUSTIFY) == 0 ) - /* - * the `0' flag is not in effect, and neither is the `-' flag, - * so we pad to the left of the displayed value with spaces, so that - * the value appears right justified within the output field. - */ - while( stream->width-- > 0 ) - __pformat_putc( '\x20', stream ); - } - - if( stream->flags & PFORMAT_NEGATIVE ) - /* - * A negative value needs a sign... - */ - *p++ = '-'; - - else if( stream->flags & PFORMAT_POSITIVE ) - /* - * A positive value may have an optionally displayed sign... - */ - *p++ = '+'; - - else if( stream->flags & PFORMAT_ADDSPACE ) - /* - * Space was reserved for displaying a sign, but none was emitted... - */ - *p++ = '\x20'; - - while( p > buf ) - /* - * Emit the accumulated constituent digits, - * in order from most significant to least significant... - */ - __pformat_putc( *--p, stream ); - - while( stream->width-- > 0 ) - /* - * The specified output field has not yet been completely filled; - * the `-' flag must be in effect, resulting in a displayed value which - * appears left justified within the output field; we must pad the field - * to the right of the displayed value, by emitting additional spaces, - * until we reach the rightmost field boundary. - */ - __pformat_putc( '\x20', stream ); -} - -static -void __pformat_xint( int fmt, __pformat_intarg_t value, __pformat_t *stream ) -{ - /* Handler for `%o', `%p', `%x' and `%X' conversions. - * - * These can be implemented using a simple `mask and shift' strategy; - * set up the mask and shift values appropriate to the conversion format, - * and allocate a suitably sized local buffer, in which to queue encoded - * digits of the formatted value, in preparation for output. - */ - int width; - int mask = (fmt == 'o') ? PFORMAT_OMASK : PFORMAT_XMASK; - int shift = (fmt == 'o') ? PFORMAT_OSHIFT : PFORMAT_XSHIFT; - char buf[__pformat_int_bufsiz(2, shift, stream)]; - char *p = buf; - - while( value.__pformat_ullong_t ) - { - /* Encode the specified non-zero input value as a sequence of digits, - * in the appropriate `base' encoding and in reverse digit order, each - * encoded in its printable ASCII form, with no leading zeros, using - * the local buffer as a LIFO queue in which to store them. - */ - char *q; - if( (*(q = p++) = '0' + (value.__pformat_ullong_t & mask)) > '9' ) - *q = (*q + 'A' - '9' - 1) | (fmt & PFORMAT_XCASE); - value.__pformat_ullong_t >>= shift; - } - - if( p == buf ) - /* - * Nothing was queued; input value must be zero, which should never be - * emitted in the `alternative' PFORMAT_HASHED style. - */ - stream->flags &= ~PFORMAT_HASHED; - - if( ((width = stream->precision) > 0) && ((width -= p - buf) > 0) ) - /* - * We have not yet queued sufficient digits to fill the field width - * specified for minimum `precision'; pad with zeros to achieve this. - */ - while( width-- > 0 ) - *p++ = '0'; - - else if( (fmt == 'o') && (stream->flags & PFORMAT_HASHED) ) - /* - * The field width specified for minimum `precision' has already - * been filled, but the `alternative' PFORMAT_HASHED style for octal - * output requires at least one initial zero; that will not have - * been queued, so add it now. - */ - *p++ = '0'; - - if( (p == buf) && (stream->precision != 0) ) - /* - * Still nothing queued for output, but the `precision' has not been - * explicitly specified as zero, (which is necessary if no output for - * an input value of zero is desired); queue exactly one zero digit. - */ - *p++ = '0'; - - if( stream->width > (width = p - buf) ) - /* - * Specified field width exceeds the minimum required... - * Adjust so that we retain only the additional padding width. - */ - stream->width -= width; - - else - /* Ignore any width specification which is insufficient. - */ - stream->width = PFORMAT_IGNORE; - - if( ((width = stream->width) > 0) - && (fmt != 'o') && (stream->flags & PFORMAT_HASHED) ) - /* - * For `%#x' or `%#X' formats, (which have the `#' flag set), - * further reduce the padding width to accommodate the radix - * indicating prefix. - */ - width -= 2; - - if( (width > 0) && (stream->precision < 0) - && ((stream->flags & PFORMAT_JUSTIFY) == PFORMAT_ZEROFILL) ) - /* - * When the `0' flag is set, and not overridden by the `-' flag, - * or by a specified precision, add sufficient leading zeros to - * consume the remaining field width. - */ - while( width-- > 0 ) - *p++ = '0'; - - if( (fmt != 'o') && (stream->flags & PFORMAT_HASHED) ) - { - /* For formats other than octal, the PFORMAT_HASHED output style - * requires the addition of a two character radix indicator, as a - * prefix to the actual encoded numeric value. - */ - *p++ = fmt; - *p++ = '0'; - } - - if( (width > 0) && ((stream->flags & PFORMAT_LJUSTIFY) == 0) ) - /* - * When not doing flush left justification, (i.e. the `-' flag - * is not set), any residual unreserved field width must appear - * as blank padding, to the left of the output value. - */ - while( width-- > 0 ) - __pformat_putc( '\x20', stream ); - - while( p > buf ) - /* - * Move the queued output from the local buffer to the ultimate - * destination, in LIFO order. - */ - __pformat_putc( *--p, stream ); - - /* If we still haven't consumed the entire specified field width, - * we must be doing flush left justification; any residual width - * must be filled with blanks, to the right of the output value. - */ - while( width-- > 0 ) - __pformat_putc( '\x20', stream ); -} - -typedef union -{ - /* A multifaceted representation of an IEEE extended precision, - * (80-bit), floating point number, facilitating access to its - * component parts. - */ - double __pformat_fpreg_double_t; - long double __pformat_fpreg_ldouble_t; - struct - { unsigned long long __pformat_fpreg_mantissa; - signed short __pformat_fpreg_exponent; - }; - unsigned short __pformat_fpreg_bitmap[5]; - unsigned long __pformat_fpreg_bits; -} __pformat_fpreg_t; - -#ifdef _WIN32 -/* TODO: make this unconditional in final release... - * (see note at head of associated `#else' block. - */ -#include "gdtoa.h" - -static -char *__pformat_cvt( int mode, __pformat_fpreg_t x, int nd, int *dp, int *sign ) -{ - /* Helper function, derived from David M. Gay's `g_xfmt()', calling - * his `__gdtoa()' function in a manner to provide extended precision - * replacements for `ecvt()' and `fcvt()'. - */ - unsigned int k, e = 0; char *ep; - static FPI fpi = { 64, 1-16383-64+1, 32766-16383-64+1, FPI_Round_near, 0 }; - - /* Classify the argument into an appropriate `__gdtoa()' category... - */ - if( (k = __fpclassifyl( x.__pformat_fpreg_ldouble_t )) & FP_NAN ) - /* - * identifying infinities or not-a-number... - */ - k = (k & FP_NORMAL) ? STRTOG_Infinite : STRTOG_NaN; - - else if( k & FP_NORMAL ) - { - /* normal and near-zero `denormals'... - */ - if( k & FP_ZERO ) - { - /* with appropriate exponent adjustment for a `denormal'... - */ - k = STRTOG_Denormal; - e = 1 - 0x3FFF - 63; - } - else - { - /* or with `normal' exponent adjustment... - */ - k = STRTOG_Normal; - e = (x.__pformat_fpreg_exponent & 0x7FFF) - 0x3FFF - 63; - } - } - - else - /* or, if none of the above, it's a zero, (positive or negative). - */ - k = STRTOG_Zero; - - /* Check for negative values, always treating NaN as unsigned... - * (return value is zero for positive/unsigned; non-zero for negative). - */ - *sign = (k == STRTOG_NaN) ? 0 : x.__pformat_fpreg_exponent & 0x8000; - - /* Finally, get the raw digit string, and radix point position index. - */ - return __gdtoa( &fpi, e, &x.__pformat_fpreg_bits, &k, mode, nd, dp, &ep ); -} - -static __inline__ __attribute__((__always_inline__)) -char *__pformat_ecvt( long double x, int precision, int *dp, int *sign ) -{ - /* A convenience wrapper for the above... - * it emulates `ecvt()', but takes a `long double' argument. - */ - __pformat_fpreg_t z; z.__pformat_fpreg_ldouble_t = x; - return __pformat_cvt( 2, z, precision, dp, sign ); -} - -static __inline__ __attribute__((__always_inline__)) -char *__pformat_fcvt( long double x, int precision, int *dp, int *sign ) -{ - /* A convenience wrapper for the above... - * it emulates `fcvt()', but takes a `long double' argument. - */ - __pformat_fpreg_t z; z.__pformat_fpreg_ldouble_t = x; - return __pformat_cvt( 3, z, precision, dp, sign ); -} - -/* The following are required, to clean up the `__gdtoa()' memory pool, - * after processing the data returned by the above. - */ -#define __pformat_ecvt_release( value ) __freedtoa( value ) -#define __pformat_fcvt_release( value ) __freedtoa( value ) - -#else -/* - * TODO: remove this before final release; it is included here as a - * convenience for testing, without requiring a working `__gdtoa()'. - */ -static __inline__ -char *__pformat_ecvt( long double x, int precision, int *dp, int *sign ) -{ - /* Define in terms of `ecvt()'... - */ - char *retval = ecvt( (double)(x), precision, dp, sign ); - if( isinf( x ) || isnan( x ) ) - { - /* emulating `__gdtoa()' reporting for infinities and NaN. - */ - *dp = PFORMAT_INFNAN; - if( *retval == '-' ) - { - /* Need to force the `sign' flag, (particularly for NaN). - */ - ++retval; *sign = 1; - } - } - return retval; -} - -static __inline__ -char *__pformat_fcvt( long double x, int precision, int *dp, int *sign ) -{ - /* Define in terms of `fcvt()'... - */ - char *retval = fcvt( (double)(x), precision, dp, sign ); - if( isinf( x ) || isnan( x ) ) - { - /* emulating `__gdtoa()' reporting for infinities and NaN. - */ - *dp = PFORMAT_INFNAN; - if( *retval == '-' ) - { - /* Need to force the `sign' flag, (particularly for NaN). - */ - ++retval; *sign = 1; - } - } - return retval; -} - -/* No memory pool clean up needed, for these emulated cases... - */ -#define __pformat_ecvt_release( value ) /* nothing to be done */ -#define __pformat_fcvt_release( value ) /* nothing to be done */ - -/* TODO: end of conditional to be removed. */ -#endif - -static __inline__ -void __pformat_emit_radix_point( __pformat_t *stream ) -{ - /* Helper to place a localised representation of the radix point - * character at the ultimate destination, when formatting fixed or - * floating point numbers. - */ - if( stream->rplen == PFORMAT_RPINIT ) - { - /* Radix point initialisation not yet completed; - * establish a multibyte to `wchar_t' converter... - */ - int len; wchar_t rpchr; mbstate_t state; - - /* Initialise the conversion state... - */ - memset( &state, 0, sizeof( state ) ); - - /* Fetch and convert the localised radix point representation... - */ - if( (len = mbrtowc( &rpchr, localeconv()->decimal_point, 16, &state )) > 0 ) - /* - * and store it, if valid. - */ - stream->rpchr = rpchr; - - /* In any case, store the reported effective multibyte length, - * (or the error flag), marking initialisation as `done'. - */ - stream->rplen = len; - } - - if( stream->rpchr != (wchar_t)(0) ) - { - /* We have a localised radix point mark; - * establish a converter to make it a multibyte character... - */ - int len; char buf[len = stream->rplen]; mbstate_t state; - - /* Initialise the conversion state... - */ - memset( &state, 0, sizeof( state ) ); - - /* Convert the `wchar_t' representation to multibyte... - */ - if( (len = wcrtomb( buf, stream->rpchr, &state )) > 0 ) - { - /* and copy to the output destination, when valid... - */ - char *p = buf; - while( len-- > 0 ) - __pformat_putc( *p++, stream ); - } - - else - /* otherwise fall back to plain ASCII '.'... - */ - __pformat_putc( '.', stream ); - } - - else - /* No localisation: just use ASCII '.'... - */ - __pformat_putc( '.', stream ); -} - -static __inline__ __attribute__((__always_inline__)) -void __pformat_emit_numeric_value( int c, __pformat_t *stream ) -{ - /* Convenience helper to transfer numeric data from an internal - * formatting buffer to the ultimate destination... - */ - if( c == '.' ) - /* - * converting this internal representation of the the radix - * point to the appropriately localised representation... - */ - __pformat_emit_radix_point( stream ); - - else - /* and passing all other characters through, unmodified. - */ - __pformat_putc( c, stream ); -} - -static -void __pformat_emit_inf_or_nan( int sign, char *value, __pformat_t *stream ) -{ - /* Helper to emit INF or NAN where a floating point value - * resolves to one of these special states. - */ - int i; - char buf[4]; - char *p = buf; - - /* We use the string formatting helper to display INF/NAN, - * but we don't want truncation if the precision set for the - * original floating point output request was insufficient; - * ignore it! - */ - stream->precision = PFORMAT_IGNORE; - - if( sign ) - /* - * Negative infinity: emit the sign... - */ - *p++ = '-'; - - else if( stream->flags & PFORMAT_POSITIVE ) - /* - * Not negative infinity, but '+' flag is in effect; - * thus, we emit a positive sign... - */ - *p++ = '+'; - - else if( stream->flags & PFORMAT_ADDSPACE ) - /* - * No sign required, but space was reserved for it... - */ - *p++ = '\x20'; - - /* Copy the appropriate status indicator, up to a maximum of - * three characters, transforming to the case corresponding to - * the format specification... - */ - for( i = 3; i > 0; --i ) - *p++ = (*value++ & ~PFORMAT_XCASE) | (stream->flags & PFORMAT_XCASE); - - /* and emit the result. - */ - __pformat_putchars( buf, p - buf, stream ); -} - -static -void __pformat_emit_float( int sign, char *value, int len, __pformat_t *stream ) -{ - /* Helper to emit a fixed point representation of numeric data, - * as encoded by a prior call to `ecvt()' or `fcvt()'; (this does - * NOT include the exponent, for floating point format). - */ - if( len > 0 ) - { - /* The magnitude of `x' is greater than or equal to 1.0... - * reserve space in the output field, for the required number of - * decimal digits to be placed before the decimal point... - */ - if( stream->width > len ) - /* - * adjusting as appropriate, when width is sufficient... - */ - stream->width -= len; - - else - /* or simply ignoring the width specification, if not. - */ - stream->width = PFORMAT_IGNORE; - } - - else if( stream->width > 0 ) - /* - * The magnitude of `x' is less than 1.0... - * reserve space for exactly one zero before the decimal point. - */ - stream->width--; - - /* Reserve additional space for the digits which will follow the - * decimal point... - */ - if( (stream->width >= 0) && (stream->width > stream->precision) ) - /* - * adjusting appropriately, when sufficient width remains... - * (note that we must check both of these conditions, because - * precision may be more negative than width, as a result of - * adjustment to provide extra padding when trailing zeros - * are to be discarded from "%g" format conversion with a - * specified field width, but if width itself is negative, - * then there is explicitly to be no padding anyway). - */ - stream->width -= stream->precision; - - else - /* or again, ignoring the width specification, if not. - */ - stream->width = PFORMAT_IGNORE; - - /* Reserve space in the output field, for display of the decimal point, - * unless the precision is explicity zero, with the `#' flag not set. - */ - if( (stream->width > 0) - && ((stream->precision > 0) || (stream->flags & PFORMAT_HASHED)) ) - stream->width--; - - /* Reserve space in the output field, for display of the sign of the - * formatted value, if required; (i.e. if the value is negative, or if - * either the `space' or `+' formatting flags are set). - */ - if( (stream->width > 0) && (sign || (stream->flags & PFORMAT_SIGNED)) ) - stream->width--; - - /* Emit any padding space, as required to correctly right justify - * the output within the alloted field width. - */ - if( (stream->width > 0) && ((stream->flags & PFORMAT_JUSTIFY) == 0) ) - while( stream->width-- > 0 ) - __pformat_putc( '\x20', stream ); - - /* Emit the sign indicator, as appropriate... - */ - if( sign ) - /* - * mandatory, for negative values... - */ - __pformat_putc( '-', stream ); - - else if( stream->flags & PFORMAT_POSITIVE ) - /* - * optional, for positive values... - */ - __pformat_putc( '+', stream ); - - else if( stream->flags & PFORMAT_ADDSPACE ) - /* - * or just fill reserved space, when the space flag is in effect. - */ - __pformat_putc( '\x20', stream ); - - /* If the `0' flag is in effect, and not overridden by the `-' flag, - * then zero padding, to fill out the field, goes here... - */ - if( (stream->width > 0) - && ((stream->flags & PFORMAT_JUSTIFY) == PFORMAT_ZEROFILL) ) - while( stream->width-- > 0 ) - __pformat_putc( '0', stream ); - - /* Emit the digits of the encoded numeric value... - */ - if( len > 0 ) - /* - * ...beginning with those which precede the radix point, - * and appending any necessary significant trailing zeros. - */ - do __pformat_putc( *value ? *value++ : '0', stream ); - while( --len > 0 ); - - else - /* The magnitude of the encoded value is less than 1.0, so no - * digits precede the radix point; we emit a mandatory initial - * zero, followed immediately by the radix point. - */ - __pformat_putc( '0', stream ); - - /* Unless the encoded value is integral, AND the radix point - * is not expressly demanded by the `#' flag, we must insert - * the appropriately localised radix point mark here... - */ - if( (stream->precision > 0) || (stream->flags & PFORMAT_HASHED) ) - __pformat_emit_radix_point( stream ); - - /* When the radix point offset, `len', is negative, this implies - * that additional zeros must appear, following the radix point, - * and preceding the first significant digit... - */ - if( len < 0 ) - { - /* To accommodate these, we adjust the precision, (reducing it - * by adding a negative value), and then we emit as many zeros - * as are required. - */ - stream->precision += len; - do __pformat_putc( '0', stream ); - while( ++len < 0 ); - } - - /* Now we emit any remaining significant digits, or trailing zeros, - * until the required precision has been achieved. - */ - while( stream->precision-- > 0 ) - __pformat_putc( *value ? *value++ : '0', stream ); -} - -static -void __pformat_emit_efloat( int sign, char *value, int e, __pformat_t *stream ) -{ - /* Helper to emit a floating point representation of numeric data, - * as encoded by a prior call to `ecvt()' or `fcvt()'; (this DOES - * include the following exponent). - */ - int exp_width = 1; - __pformat_intarg_t exponent; exponent.__pformat_llong_t = e -= 1; - - /* Determine how many digit positions are required for the exponent. - */ - while( (e /= 10) != 0 ) - exp_width++; - - /* Ensure that this is at least as many as the standard requirement. - */ - if( exp_width < stream->expmin ) - exp_width = stream->expmin; - - /* Adjust the residual field width allocation, to allow for the - * number of exponent digits to be emitted, together with a sign - * and exponent separator... - */ - if( stream->width > (exp_width += 2) ) - stream->width -= exp_width; - - else - /* ignoring the field width specification, if insufficient. - */ - stream->width = PFORMAT_IGNORE; - - /* Emit the significand, as a fixed point value with one digit - * preceding the radix point. - */ - __pformat_emit_float( sign, value, 1, stream ); - - /* Reset precision, to ensure the mandatory minimum number of - * exponent digits will be emitted, and set the flags to ensure - * the sign is displayed. - */ - stream->precision = stream->expmin; - stream->flags |= PFORMAT_SIGNED; - - /* Emit the exponent separator. - */ - __pformat_putc( ('E' | (stream->flags & PFORMAT_XCASE)), stream ); - - /* Readjust the field width setting, such that it again allows - * for the digits of the exponent, (which had been discounted when - * computing any left side padding requirement), so that they are - * correctly included in the computation of any right side padding - * requirement, (but here we exclude the exponent separator, which - * has been emitted, and so counted already). - */ - stream->width += exp_width - 1; - - /* And finally, emit the exponent itself, as a signed integer, - * with any padding required to achieve flush left justification, - * (which will be added automatically, by `__pformat_int()'). - */ - __pformat_int( exponent, stream ); -} - -static -void __pformat_float( long double x, __pformat_t *stream ) -{ - /* Handler for `%f' and `%F' format specifiers. - * - * This wraps calls to `__pformat_cvt()', `__pformat_emit_float()' - * and `__pformat_emit_inf_or_nan()', as appropriate, to achieve - * output in fixed point format. - */ - int sign, intlen; char *value; - - /* Establish the precision for the displayed value, defaulting to six - * digits following the decimal point, if not explicitly specified. - */ - if( stream->precision < 0 ) - stream->precision = 6; - - /* Encode the input value as ASCII, for display... - */ - value = __pformat_fcvt( x, stream->precision, &intlen, &sign ); - - if( intlen == PFORMAT_INFNAN ) - /* - * handle cases of `infinity' or `not-a-number'... - */ - __pformat_emit_inf_or_nan( sign, value, stream ); - - else - { /* or otherwise, emit the formatted result. - */ - __pformat_emit_float( sign, value, intlen, stream ); - - /* and, if there is any residual field width as yet unfilled, - * then we must be doing flush left justification, so pad out to - * the right hand field boundary. - */ - while( stream->width-- > 0 ) - __pformat_putc( '\x20', stream ); - } - - /* Clean up `__pformat_fcvt()' memory allocation for `value'... - */ - __pformat_fcvt_release( value ); -} - -static -void __pformat_efloat( long double x, __pformat_t *stream ) -{ - /* Handler for `%e' and `%E' format specifiers. - * - * This wraps calls to `__pformat_cvt()', `__pformat_emit_efloat()' - * and `__pformat_emit_inf_or_nan()', as appropriate, to achieve - * output in floating point format. - */ - int sign, intlen; char *value; - - /* Establish the precision for the displayed value, defaulting to six - * digits following the decimal point, if not explicitly specified. - */ - if( stream->precision < 0 ) - stream->precision = 6; - - /* Encode the input value as ASCII, for display... - */ - value = __pformat_ecvt( x, stream->precision + 1, &intlen, &sign ); - - if( intlen == PFORMAT_INFNAN ) - /* - * handle cases of `infinity' or `not-a-number'... - */ - __pformat_emit_inf_or_nan( sign, value, stream ); - - else - /* or otherwise, emit the formatted result. - */ - __pformat_emit_efloat( sign, value, intlen, stream ); - - /* Clean up `__pformat_ecvt()' memory allocation for `value'... - */ - __pformat_ecvt_release( value ); -} - -static -void __pformat_gfloat( long double x, __pformat_t *stream ) -{ - /* Handler for `%g' and `%G' format specifiers. - * - * This wraps calls to `__pformat_cvt()', `__pformat_emit_float()', - * `__pformat_emit_efloat()' and `__pformat_emit_inf_or_nan()', as - * appropriate, to achieve output in the more suitable of either - * fixed or floating point format. - */ - int sign, intlen; char *value; - - /* Establish the precision for the displayed value, defaulting to - * six significant digits, if not explicitly specified... - */ - if( stream->precision < 0 ) - stream->precision = 6; - - /* or to a minimum of one digit, otherwise... - */ - else if( stream->precision == 0 ) - stream->precision = 1; - - /* Encode the input value as ASCII, for display. - */ - value = __pformat_ecvt( x, stream->precision, &intlen, &sign ); - - if( intlen == PFORMAT_INFNAN ) - /* - * Handle cases of `infinity' or `not-a-number'. - */ - __pformat_emit_inf_or_nan( sign, value, stream ); - - else if( (-4 < intlen) && (intlen <= stream->precision) ) - { - /* Value lies in the acceptable range for fixed point output, - * (i.e. the exponent is no less than minus four, and the number - * of significant digits which precede the radix point is fewer - * than the least number which would overflow the field width, - * specified or implied by the established precision). - */ - if( (stream->flags & PFORMAT_HASHED) == PFORMAT_HASHED ) - /* - * The `#' flag is in effect... - * Adjust precision to retain the specified number of significant - * digits, with the proper number preceding the radix point, and - * the balance following it... - */ - stream->precision -= intlen; - - else - /* The `#' flag is not in effect... - * Here we adjust the precision to accommodate all digits which - * precede the radix point, but we truncate any balance following - * it, to suppress output of non-significant trailing zeros... - */ - if( ((stream->precision = strlen( value ) - intlen) < 0) - /* - * This may require a compensating adjustment to the field - * width, to accommodate significant trailing zeros, which - * precede the radix point... - */ - && (stream->width > 0) ) - stream->width += stream->precision; - - /* Now, we format the result as any other fixed point value. - */ - __pformat_emit_float( sign, value, intlen, stream ); - - /* If there is any residual field width as yet unfilled, then - * we must be doing flush left justification, so pad out to the - * right hand field boundary. - */ - while( stream->width-- > 0 ) - __pformat_putc( '\x20', stream ); - } - - else - { /* Value lies outside the acceptable range for fixed point; - * one significant digit will precede the radix point, so we - * decrement the precision to retain only the appropriate number - * of additional digits following it, when we emit the result - * in floating point format. - */ - if( (stream->flags & PFORMAT_HASHED) == PFORMAT_HASHED ) - /* - * The `#' flag is in effect... - * Adjust precision to emit the specified number of significant - * digits, with one preceding the radix point, and the balance - * following it, retaining any non-significant trailing zeros - * which are required to exactly match the requested precision... - */ - stream->precision--; - - else - /* The `#' flag is not in effect... - * Adjust precision to emit only significant digits, with one - * preceding the radix point, and any others following it, but - * suppressing non-significant trailing zeros... - */ - stream->precision = strlen( value ) - 1; - - /* Now, we format the result as any other floating point value. - */ - __pformat_emit_efloat( sign, value, intlen, stream ); - } - - /* Clean up `__pformat_ecvt()' memory allocation for `value'. - */ - __pformat_ecvt_release( value ); -} - -static -void __pformat_emit_xfloat( __pformat_fpreg_t value, __pformat_t *stream ) -{ - /* Helper for emitting floating point data, originating as - * either `double' or `long double' type, as a hexadecimal - * representation of the argument value. - */ - char buf[18], *p = buf; - __pformat_intarg_t exponent; short exp_width = 2; - - /* The mantissa field of the argument value representation can - * accommodate at most 16 hexadecimal digits, of which one will - * be placed before the radix point, leaving at most 15 digits - * to satisfy any requested precision; thus... - */ - if( (stream->precision >= 0) && (stream->precision < 15) ) - { - /* When the user specifies a precision within this range, - * we want to adjust the mantissa, to retain just the number - * of digits required, rounding up when the high bit of the - * leftmost discarded digit is set; (mask of 0x08 accounts - * for exactly one digit discarded, shifting 4 bits per - * digit, with up to 14 additional digits, to consume the - * full availability of 15 precision digits). - * - * However, before we perform the rounding operation, we - * normalise the mantissa, shifting it to the left by as many - * bit positions may be necessary, until its highest order bit - * is set, thus preserving the maximum number of bits in the - * rounded result as possible. - */ - while( value.__pformat_fpreg_mantissa < (LLONG_MAX + 1ULL) ) - value.__pformat_fpreg_mantissa <<= 1; - - /* We then shift the mantissa one bit position back to the - * right, to guard against possible overflow when the rounding - * adjustment is added. - */ - value.__pformat_fpreg_mantissa >>= 1; - - /* We now add the rounding adjustment, noting that to keep the - * 0x08 mask aligned with the shifted mantissa, we also need to - * shift it right by one bit initially, changing its starting - * value to 0x04... - */ - value.__pformat_fpreg_mantissa += 0x04LL << (4 * (14 - stream->precision)); - if( (value.__pformat_fpreg_mantissa & (LLONG_MAX + 1ULL)) == 0ULL ) - /* - * When the rounding adjustment would not have overflowed, - * then we shift back to the left again, to fill the vacated - * bit we reserved to accommodate the carry. - */ - value.__pformat_fpreg_mantissa <<= 1; - - else - /* Otherwise the rounding adjustment would have overflowed, - * so the carry has already filled the vacated bit; the effect - * of this is equivalent to an increment of the exponent. - */ - value.__pformat_fpreg_exponent++; - - /* We now complete the rounding to the required precision, by - * shifting the unwanted digits out, from the right hand end of - * the mantissa. - */ - value.__pformat_fpreg_mantissa >>= 4 * (15 - stream->precision); - } - - /* Encode the significant digits of the mantissa in hexadecimal - * ASCII notation, ready for transfer to the output stream... - */ - while( value.__pformat_fpreg_mantissa ) - { - /* taking the rightmost digit in each pass... - */ - int c = value.__pformat_fpreg_mantissa & 0xF; - if( c == value.__pformat_fpreg_mantissa ) - { - /* inserting the radix point, when we reach the last, - * (i.e. the most significant digit), unless we found no - * less significant digits, with no mandatory radix point - * inclusion, and no additional required precision... - */ - if( (p > buf) - || (stream->flags & PFORMAT_HASHED) || (stream->precision > 0) ) - /* - * Internally, we represent the radix point as an ASCII '.'; - * we will replace it with any locale specific alternative, - * at the time of transfer to the ultimate destination. - */ - *p++ = '.'; - - /* If the most significant hexadecimal digit of the encoded - * output value is greater than one, then the indicated value - * will appear too large, by an additional binary exponent - * corresponding to the number of higher order bit positions - * which it occupies... - */ - while( value.__pformat_fpreg_mantissa > 1 ) - { - /* so reduce the exponent value to compensate... - */ - value.__pformat_fpreg_exponent--; - value.__pformat_fpreg_mantissa >>= 1; - } - } - - else if( stream->precision > 0 ) - /* - * we have not yet fulfilled the desired precision, - * and we have not yet found the most significant digit, - * so account for the current digit, within the field - * width required to meet the specified precision. - */ - stream->precision--; - - if( (c > 0) || (p > buf) || (stream->precision >= 0) ) - /* - * Ignoring insignificant trailing zeros, (unless required to - * satisfy specified precision), store the current encoded digit - * into the pending output buffer, in LIFO order, and using the - * appropriate case for digits in the `A'..`F' range. - */ - *p++ = c > 9 ? (c - 10 + 'A') | (stream->flags & PFORMAT_XCASE) : c + '0'; - - /* Shift out the current digit, (4-bit logical shift right), - * to align the next more significant digit to be extracted, - * and encoded in the next pass. - */ - value.__pformat_fpreg_mantissa >>= 4; - } - - if( p == buf ) - { - /* Nothing has been queued for output... - * We need at least one zero, and possibly a radix point. - */ - if( (stream->precision > 0) || (stream->flags & PFORMAT_HASHED) ) - *p++ = '.'; - - *p++ = '0'; - } - - if( stream->width > 0 ) - { - /* Adjust the user specified field width, to account for the - * number of digits minimally required, to display the encoded - * value, at the requested precision. - * - * FIXME: this uses the minimum number of digits possible for - * representation of the binary exponent, in strict conformance - * with C99 and POSIX specifications. Although there appears to - * be no Microsoft precedent for doing otherwise, we may wish to - * relate this to the `_get_output_format()' result, to maintain - * consistency with `%e', `%f' and `%g' styles. - */ - int min_width = p - buf; - int exponent = value.__pformat_fpreg_exponent; - - /* If we have not yet queued sufficient digits to fulfil the - * requested precision, then we must adjust the minimum width - * specification, to accommodate the additional digits which - * are required to do so. - */ - if( stream->precision > 0 ) - min_width += stream->precision; - - /* Adjust the minimum width requirement, to accomodate the - * sign, radix indicator and at least one exponent digit... - */ - min_width += stream->flags & PFORMAT_SIGNED ? 6 : 5; - while( (exponent = exponent / 10) != 0 ) - { - /* and increase as required, if additional exponent digits - * are needed, also saving the exponent field width adjustment, - * for later use when that is emitted. - */ - min_width++; - exp_width++; - } - - if( stream->width > min_width ) - { - /* When specified field width exceeds the minimum required, - * adjust to retain only the excess... - */ - stream->width -= min_width; - - /* and then emit any required left side padding spaces. - */ - if( (stream->flags & PFORMAT_JUSTIFY) == 0 ) - while( stream->width-- > 0 ) - __pformat_putc( '\x20', stream ); - } - - else - /* Specified field width is insufficient; just ignore it! - */ - stream->width = PFORMAT_IGNORE; - } - - /* Emit the sign of the encoded value, as required... - */ - if( stream->flags & PFORMAT_NEGATIVE ) - /* - * this is mandatory, to indicate a negative value... - */ - __pformat_putc( '-', stream ); - - else if( stream->flags & PFORMAT_POSITIVE ) - /* - * but this is optional, for a positive value... - */ - __pformat_putc( '+', stream ); - - else if( stream->flags & PFORMAT_ADDSPACE ) - /* - * with this optional alternative. - */ - __pformat_putc( '\x20', stream ); - - /* Prefix a `0x' or `0X' radix indicator to the encoded value, - * with case appropriate to the format specification. - */ - __pformat_putc( '0', stream ); - __pformat_putc( 'X' | (stream->flags & PFORMAT_XCASE), stream ); - - /* If the `0' flag is in effect... - * Zero padding, to fill out the field, goes here... - */ - if( (stream->width > 0) && (stream->flags & PFORMAT_ZEROFILL) ) - while( stream->width-- > 0 ) - __pformat_putc( '0', stream ); - - /* Next, we emit the encoded value, without its exponent... - */ - while( p > buf ) - __pformat_emit_numeric_value( *--p, stream ); - - /* followed by any additional zeros needed to satisfy the - * precision specification... - */ - while( stream->precision-- > 0 ) - __pformat_putc( '0', stream ); - - /* then the exponent prefix, (C99 and POSIX specify `p'), - * in the case appropriate to the format specification... - */ - __pformat_putc( 'P' | (stream->flags & PFORMAT_XCASE), stream ); - - /* and finally, the decimal representation of the binary exponent, - * as a signed value with mandatory sign displayed, in a field width - * adjusted to accommodate it, LEFT justified, with any additional - * right side padding remaining from the original field width. - */ - stream->width += exp_width; - stream->flags |= PFORMAT_SIGNED; - exponent.__pformat_llong_t = value.__pformat_fpreg_exponent; - __pformat_int( exponent, stream ); -} - -static -void __pformat_xdouble( double x, __pformat_t *stream ) -{ - /* Handler for `%a' and `%A' format specifiers, (with argument - * value specified as `double' type). - */ - unsigned sign_bit = 0; - __pformat_fpreg_t z; z.__pformat_fpreg_double_t = x; - - /* First check for NaN; it is emitted unsigned... - */ - if( isnan( x ) ) - __pformat_emit_inf_or_nan( sign_bit, "NaN", stream ); - - else - { /* Capture the sign bit up-front, so we can show it correctly - * even when the argument value is zero or infinite. - */ - if( (sign_bit = (z.__pformat_fpreg_bitmap[3] & 0x8000)) != 0 ) - stream->flags |= PFORMAT_NEGATIVE; - - /* Check for infinity, (positive or negative)... - */ - if( isinf( x ) ) - /* - * displaying the appropriately signed indicator, - * when appropriate. - */ - __pformat_emit_inf_or_nan( sign_bit, "Inf", stream ); - - else - { /* The argument value is a representable number... - * first move its exponent into the appropriate field... - */ - z.__pformat_fpreg_bitmap[4] = (z.__pformat_fpreg_bitmap[3] >> 4) & 0x7FF; - - /* Realign the mantissa, leaving space for a - * normalised most significant digit... - */ - z.__pformat_fpreg_mantissa <<= 8; - z.__pformat_fpreg_bitmap[3] = (z.__pformat_fpreg_bitmap[3] & 0x0FFF); - - /* Check for zero value... - */ - if( z.__pformat_fpreg_exponent || z.__pformat_fpreg_mantissa ) - { - /* and only when the value is non-zero, - * eliminate the bias from the exponent... - */ - z.__pformat_fpreg_exponent -= 0x3FF; - - /* Check for a possible denormalised value... - */ - if( z.__pformat_fpreg_exponent > -126 ) - /* - * and normalise when it isn't. - */ - z.__pformat_fpreg_bitmap[3] += 0x1000; - } - - /* Finally, hand the adjusted representation off to the generalised - * hexadecimal floating point format handler... - */ - __pformat_emit_xfloat( z, stream ); - } - } -} - -static -void __pformat_xldouble( long double x, __pformat_t *stream ) -{ - /* Handler for `%La' and `%LA' format specifiers, (with argument - * value specified as `long double' type). - */ - unsigned sign_bit = 0; - __pformat_fpreg_t z; z.__pformat_fpreg_ldouble_t = x; - - /* First check for NaN; it is emitted unsigned... - */ - if( isnan( x ) ) - __pformat_emit_inf_or_nan( sign_bit, "NaN", stream ); - - else - { /* Capture the sign bit up-front, so we can show it correctly - * even when the argument value is zero or infinite. - */ - if( (sign_bit = (z.__pformat_fpreg_exponent & 0x8000)) != 0 ) - stream->flags |= PFORMAT_NEGATIVE; - - /* Check for infinity, (positive or negative)... - */ - if( isinf( x ) ) - /* - * displaying the appropriately signed indicator, - * when appropriate. - */ - __pformat_emit_inf_or_nan( sign_bit, "Inf", stream ); - - else - { /* The argument value is a representable number... - * extract the effective value of the biased exponent... - */ - z.__pformat_fpreg_exponent &= 0x7FFF; - if( z.__pformat_fpreg_exponent || z.__pformat_fpreg_mantissa ) - /* - * and if the argument value itself is non-zero, - * eliminate the bias from the exponent... - */ - z.__pformat_fpreg_exponent -= 0x3FFF; - - /* Finally, hand the adjusted representation off to the - * generalised hexadecimal floating point format handler... - */ - __pformat_emit_xfloat( z, stream ); - } - } -} - -int __pformat( int flags, void *dest, int max, const char *fmt, va_list argv ) -{ - int c; - - __pformat_t stream = - { - /* Create and initialise a format control block - * for this output request. - */ - dest, /* output goes to here */ - flags &= PFORMAT_TO_FILE | PFORMAT_NOLIMIT, /* only these valid initially */ - PFORMAT_IGNORE, /* no field width yet */ - PFORMAT_IGNORE, /* nor any precision spec */ - PFORMAT_RPINIT, /* radix point uninitialised */ - (wchar_t)(0), /* leave it unspecified */ - 0, /* zero output char count */ - max, /* establish output limit */ - PFORMAT_MINEXP /* exponent chars preferred */ - }; - - format_scan: while( (c = *fmt++) != 0 ) - { - /* Format string parsing loop... - * The entry point is labelled, so that we can return to the start state - * from within the inner `conversion specification' interpretation loop, - * as soon as a conversion specification has been resolved. - */ - if( c == '%' ) - { - /* Initiate parsing of a `conversion specification'... - */ - __pformat_intarg_t argval; - __pformat_state_t state = PFORMAT_INIT; - __pformat_length_t length = PFORMAT_LENGTH_INT; - - /* Restart capture for dynamic field width and precision specs... - */ - int *width_spec = &stream.width; - - /* Reset initial state for flags, width and precision specs... - */ - stream.flags = flags; - stream.width = stream.precision = PFORMAT_IGNORE; - - while( *fmt ) - { - switch( c = *fmt++ ) - { - /* Data type specifiers... - * All are terminal, so exit the conversion spec parsing loop - * with a `goto format_scan', thus resuming at the outer level - * in the regular format string parser. - */ - case '%': - /* - * Not strictly a data type specifier... - * it simply converts as a literal `%' character. - * - * FIXME: should we require this to IMMEDIATELY follow the - * initial `%' of the "conversion spec"? (glibc `printf()' - * on GNU/Linux does NOT appear to require this, but POSIX - * and SUSv3 do seem to demand it). - */ - __pformat_putc( c, &stream ); - goto format_scan; - - case 'C': - /* - * Equivalent to `%lc'; set `length' accordingly, - * and simply fall through. - */ - length = PFORMAT_LENGTH_LONG; - - case 'c': - /* - * Single, (or single multibyte), character output... - * - * We handle these by copying the argument into our local - * `argval' buffer, and then we pass the address of that to - * either `__pformat_putchars()' or `__pformat_wputchars()', - * as appropriate, effectively formatting it as a string of - * the appropriate type, with a length of one. - * - * A side effect of this method of handling character data - * is that, if the user sets a precision of zero, then no - * character is actually emitted; we don't want that, so we - * forcibly override any user specified precision. - */ - stream.precision = PFORMAT_IGNORE; - - /* Now we invoke the appropriate format handler... - */ - if( (length == PFORMAT_LENGTH_LONG) - || (length == PFORMAT_LENGTH_LLONG) ) - { - /* considering any `long' type modifier as a reference to - * `wchar_t' data, (which is promoted to an `int' argument)... - */ - argval.__pformat_ullong_t = (wchar_t)(va_arg( argv, int )); - __pformat_wputchars( (wchar_t *)(&argval), 1, &stream ); - } - - else - { /* while anything else is simply taken as `char', (which - * is also promoted to an `int' argument)... - */ - argval.__pformat_uchar_t = (unsigned char)(va_arg( argv, int )); - __pformat_putchars( (char *)(&argval), 1, &stream ); - } - goto format_scan; - - case 'S': - /* - * Equivalent to `%ls'; set `length' accordingly, - * and simply fall through. - */ - length = PFORMAT_LENGTH_LONG; - - case 's': - if( (length == PFORMAT_LENGTH_LONG) - || (length == PFORMAT_LENGTH_LLONG) ) - { - /* considering any `long' type modifier as a reference to - * a `wchar_t' string... - */ - __pformat_wcputs( va_arg( argv, wchar_t * ), &stream ); - } - - else - /* This is normal string output; - * we simply invoke the appropriate handler... - */ - __pformat_puts( va_arg( argv, char * ), &stream ); - - goto format_scan; - - case 'o': - case 'u': - case 'x': - case 'X': - /* - * Unsigned integer values; octal, decimal or hexadecimal format... - */ - if( length == PFORMAT_LENGTH_LLONG ) - /* - * with an `unsigned long long' argument, which we - * process `as is'... - */ - argval.__pformat_ullong_t = va_arg( argv, unsigned long long ); - - else if( length == PFORMAT_LENGTH_LONG ) - /* - * or with an `unsigned long', which we promote to - * `unsigned long long'... - */ - argval.__pformat_ullong_t = va_arg( argv, unsigned long ); - - else - { /* or for any other size, which will have been promoted - * to `unsigned int', we select only the appropriately sized - * least significant segment, and again promote to the same - * size as `unsigned long long'... - */ - argval.__pformat_ullong_t = va_arg( argv, unsigned int ); - if( length == PFORMAT_LENGTH_SHORT ) - /* - * from `unsigned short'... - */ - argval.__pformat_ullong_t = argval.__pformat_ushort_t; - - else if( length == PFORMAT_LENGTH_CHAR ) - /* - * or even from `unsigned char'... - */ - argval.__pformat_ullong_t = argval.__pformat_uchar_t; - } - - /* so we can pass any size of argument to either of two - * common format handlers... - */ - if( c == 'u' ) - /* - * depending on whether output is to be encoded in - * decimal format... - */ - __pformat_int( argval, &stream ); - - else - /* or in octal or hexadecimal format... - */ - __pformat_xint( c, argval, &stream ); - - goto format_scan; - - case 'd': - case 'i': - /* - * Signed integer values; decimal format... - * This is similar to `u', but must process `argval' as signed, - * and be prepared to handle negative numbers. - */ - stream.flags |= PFORMAT_NEGATIVE; - - if( length == PFORMAT_LENGTH_LLONG ) - /* - * The argument is a `long long' type... - */ - argval.__pformat_llong_t = va_arg( argv, long long ); - - else if( length == PFORMAT_LENGTH_LONG ) - /* - * or here, a `long' type... - */ - argval.__pformat_llong_t = va_arg( argv, long ); - - else - { /* otherwise, it's an `int' type... - */ - argval.__pformat_llong_t = va_arg( argv, int ); - if( length == PFORMAT_LENGTH_SHORT ) - /* - * but it was promoted from a `short' type... - */ - argval.__pformat_llong_t = argval.__pformat_short_t; - else if( length == PFORMAT_LENGTH_CHAR ) - /* - * or even from a `char' type... - */ - argval.__pformat_llong_t = argval.__pformat_char_t; - } - - /* In any case, all share a common handler... - */ - __pformat_int( argval, &stream ); - goto format_scan; - - case 'p': - /* - * Pointer argument; format as hexadecimal, with `0x' prefix... - */ - stream.flags |= PFORMAT_HASHED; - argval.__pformat_ullong_t = va_arg( argv, uintptr_t ); - __pformat_xint( 'x', argval, &stream ); - goto format_scan; - - case 'e': - /* - * Floating point format, with lower case exponent indicator - * and lower case `inf' or `nan' representation when required; - * select lower case mode, and simply fall through... - */ - stream.flags |= PFORMAT_XCASE; - - case 'E': - /* - * Floating point format, with upper case exponent indicator - * and upper case `INF' or `NAN' representation when required, - * (or lower case for all of these, on fall through from above); - * select lower case mode, and simply fall through... - */ - if( stream.flags & PFORMAT_LDOUBLE ) - /* - * for a `long double' argument... - */ - __pformat_efloat( va_arg( argv, long double ), &stream ); - - else - /* or just a `double', which we promote to `long double', - * so the two may share a common format handler. - */ - __pformat_efloat( (long double)(va_arg( argv, double )), &stream ); - - goto format_scan; - - case 'f': - /* - * Fixed point format, using lower case for `inf' and - * `nan', when appropriate; select lower case mode, and - * simply fall through... - */ - stream.flags |= PFORMAT_XCASE; - - case 'F': - /* - * Fixed case format using upper case, or lower case on - * fall through from above, for `INF' and `NAN'... - */ - if( stream.flags & PFORMAT_LDOUBLE ) - /* - * for a `long double' argument... - */ - __pformat_float( va_arg( argv, long double ), &stream ); - - else - /* or just a `double', which we promote to `long double', - * so the two may share a common format handler. - */ - __pformat_float( (long double)(va_arg( argv, double )), &stream ); - - goto format_scan; - - case 'g': - /* - * Generalised floating point format, with lower case - * exponent indicator when required; select lower case - * mode, and simply fall through... - */ - stream.flags |= PFORMAT_XCASE; - - case 'G': - /* - * Generalised floating point format, with upper case, - * or on fall through from above, with lower case exponent - * indicator when required... - */ - if( stream.flags & PFORMAT_LDOUBLE ) - /* - * for a `long double' argument... - */ - __pformat_gfloat( va_arg( argv, long double ), &stream ); - - else - /* or just a `double', which we promote to `long double', - * so the two may share a common format handler. - */ - __pformat_gfloat( (long double)(va_arg( argv, double )), &stream ); - - goto format_scan; - - case 'a': - /* - * Hexadecimal floating point format, with lower case radix - * and exponent indicators; select the lower case mode, and - * fall through... - */ - stream.flags |= PFORMAT_XCASE; - - case 'A': - /* - * Hexadecimal floating point format; handles radix and - * exponent indicators in either upper or lower case... - */ - if( stream.flags & PFORMAT_LDOUBLE ) - /* - * with a `long double' argument... - */ - __pformat_xldouble( va_arg( argv, long double ), &stream ); - - else - /* or just a `double'. - */ - __pformat_xdouble( va_arg( argv, double ), &stream ); - - goto format_scan; - - case 'n': - /* - * Save current output character count... - */ - if( length == PFORMAT_LENGTH_CHAR ) - /* - * to a signed `char' destination... - */ - *va_arg( argv, char * ) = stream.count; - - else if( length == PFORMAT_LENGTH_SHORT ) - /* - * or to a signed `short'... - */ - *va_arg( argv, short * ) = stream.count; - - else if( length == PFORMAT_LENGTH_LONG ) - /* - * or to a signed `long'... - */ - *va_arg( argv, long * ) = stream.count; - - else if( length == PFORMAT_LENGTH_LLONG ) - /* - * or to a signed `long long'... - */ - *va_arg( argv, long long * ) = stream.count; - - else - /* - * or, by default, to a signed `int'. - */ - *va_arg( argv, int * ) = stream.count; - - goto format_scan; - - /* Argument length modifiers... - * These are non-terminal; each sets the format parser - * into the PFORMAT_END state, and ends with a `break'. - */ - case 'h': - /* - * Interpret the argument as explicitly of a `short' - * or `char' data type, truncated from the standard - * length defined for integer promotion. - */ - if( *fmt == 'h' ) - { - /* Modifier is `hh'; data type is `char' sized... - * Skip the second `h', and set length accordingly. - */ - ++fmt; - length = PFORMAT_LENGTH_CHAR; - } - - else - /* Modifier is `h'; data type is `short' sized... - */ - length = PFORMAT_LENGTH_SHORT; - - state = PFORMAT_END; - break; - - case 'j': - /* - * Interpret the argument as being of the same size as - * a `intmax_t' entity... - */ - length = __pformat_arg_length( intmax_t ); - state = PFORMAT_END; - break; - -# ifdef _WIN32 - - case 'I': - /* - * The MSVCRT implementation of the printf() family of - * functions explicitly uses... - */ - if( (fmt[0] == '6') && (fmt[1] == '4') ) - { - /* I64' instead of `ll', - * when referring to `long long' integer types... - */ - length = PFORMAT_LENGTH_LLONG; - fmt += 2; - } - - else if( (fmt[0] == '3') && (fmt[1] == '2') ) - { - /* and `I32' instead of `l', - * when referring to `long' integer types... - */ - length = PFORMAT_LENGTH_LONG; - fmt += 2; - } - - else - /* or unqualified `I' instead of `t' or `z', - * when referring to `ptrdiff_t' or `size_t' entities; - * (we will choose to map it to `ptrdiff_t'). - */ - length = __pformat_arg_length( ptrdiff_t ); - - state = PFORMAT_END; - break; - -# endif - - case 'l': - /* - * Interpret the argument as explicitly of a - * `long' or `long long' data type. - */ - if( *fmt == 'l' ) - { - /* Modifier is `ll'; data type is `long long' sized... - * Skip the second `l', and set length accordingly. - */ - ++fmt; - length = PFORMAT_LENGTH_LLONG; - } - - else - /* Modifier is `l'; data type is `long' sized... - */ - length = PFORMAT_LENGTH_LONG; - -# ifndef _WIN32 - /* - * Microsoft's MSVCRT implementation also uses `l' - * as a modifier for `long double'; if we don't want - * to support that, we end this case here... - */ - state = PFORMAT_END; - break; - - /* otherwise, we simply fall through... - */ -# endif - - case 'L': - /* - * Identify the appropriate argument as a `long double', - * when associated with `%a', `%A', `%e', `%E', `%f', `%F', - * `%g' or `%G' format specifications. - */ - stream.flags |= PFORMAT_LDOUBLE; - state = PFORMAT_END; - break; - - case 't': - /* - * Interpret the argument as being of the same size as - * a `ptrdiff_t' entity... - */ - length = __pformat_arg_length( ptrdiff_t ); - state = PFORMAT_END; - break; - - case 'z': - /* - * Interpret the argument as being of the same size as - * a `size_t' entity... - */ - length = __pformat_arg_length( size_t ); - state = PFORMAT_END; - break; - - /* Precision indicator... - * May appear once only; it must precede any modifier - * for argument length, or any data type specifier. - */ - case '.': - if( state < PFORMAT_GET_PRECISION ) - { - /* We haven't seen a precision specification yet, - * so initialise it to zero, (in case no digits follow), - * and accept any following digits as the precision. - */ - stream.precision = 0; - width_spec = &stream.precision; - state = PFORMAT_GET_PRECISION; - } - - else - /* We've already seen a precision specification, - * so this is just junk; proceed to end game. - */ - state = PFORMAT_END; - - /* Either way, we must not fall through here. - */ - break; - - /* Variable field width, or precision specification, - * derived from the argument list... - */ - case '*': - /* - * When this appears... - */ - if( width_spec - && ((state == PFORMAT_INIT) || (state == PFORMAT_GET_PRECISION)) ) - { - /* in proper context; assign to field width - * or precision, as appropriate. - */ - if( (*width_spec = va_arg( argv, int )) < 0 ) - { - /* Assigned value was negative... - */ - if( state == PFORMAT_INIT ) - { - /* For field width, this is equivalent to - * a positive value with the `-' flag... - */ - stream.flags |= PFORMAT_LJUSTIFY; - stream.width = -stream.width; - } - - else - /* while as a precision specification, - * it should simply be ignored. - */ - stream.precision = PFORMAT_IGNORE; - } - } - - else - /* out of context; give up on width and precision - * specifications for this conversion. - */ - state = PFORMAT_END; - - /* Mark as processed... - * we must not see `*' again, in this context. - */ - width_spec = NULL; - break; - - /* Formatting flags... - * Must appear while in the PFORMAT_INIT state, - * and are non-terminal, so again, end with `break'. - */ - case '#': - /* - * Select alternate PFORMAT_HASHED output style. - */ - if( state == PFORMAT_INIT ) - stream.flags |= PFORMAT_HASHED; - break; - - case '+': - /* - * Print a leading sign with numeric output, - * for both positive and negative values. - */ - if( state == PFORMAT_INIT ) - stream.flags |= PFORMAT_POSITIVE; - break; - - case '-': - /* - * Select left justification of displayed output - * data, within the output field width, instead of - * the default flush right justification. - */ - if( state == PFORMAT_INIT ) - stream.flags |= PFORMAT_LJUSTIFY; - break; - -# ifdef WITH_XSI_FEATURES - - case '\'': - /* - * This is an XSI extension to the POSIX standard, - * which we do not support, at present. - */ - if( state == PFORMAT_INIT ) - stream.flags |= PFORMAT_GROUPED; - break; - -# endif - - case '\x20': - /* - * Reserve a single space, within the output field, - * for display of the sign of signed data; this will - * be occupied by the minus sign, if the data value - * is negative, or by a plus sign if the data value - * is positive AND the `+' flag is also present, or - * by a space otherwise. (Technically, this flag - * is redundant, if the `+' flag is present). - */ - if( state == PFORMAT_INIT ) - stream.flags |= PFORMAT_ADDSPACE; - break; - - case '0': - /* - * May represent a flag, to activate the `pad with zeros' - * option, or it may simply be a digit in a width or in a - * precision specification... - */ - if( state == PFORMAT_INIT ) - { - /* This is the flag usage... - */ - stream.flags |= PFORMAT_ZEROFILL; - break; - } - - default: - /* - * If we didn't match anything above, then we will check - * for digits, which we may accumulate to generate field - * width or precision specifications... - */ - if( (state < PFORMAT_END) && ('9' >= c) && (c >= '0') ) - { - if( state == PFORMAT_INIT ) - /* - * Initial digits explicitly relate to field width... - */ - state = PFORMAT_SET_WIDTH; - - else if( state == PFORMAT_GET_PRECISION ) - /* - * while those following a precision indicator - * explicitly relate to precision. - */ - state = PFORMAT_SET_PRECISION; - - if( width_spec ) - { - /* We are accepting a width or precision specification... - */ - if( *width_spec < 0 ) - /* - * and accumulation hasn't started yet; we simply - * initialise the accumulator with the current digit - * value, converting from ASCII to decimal. - */ - *width_spec = c - '0'; - - else - /* Accumulation has already started; we perform a - * `leftwise decimal digit shift' on the accumulator, - * (i.e. multiply it by ten), then add the decimal - * equivalent value of the current digit. - */ - *width_spec = *width_spec * 10 + c - '0'; - } - } - - else - /* We found a digit out of context, or some other character - * with no designated meaning; silently reject it, and any - * further characters other than argument length modifiers, - * until this format specification is completely resolved. - */ - state = PFORMAT_END; - } - } - } - - else - /* We just parsed a character which is not included within any format - * specification; we simply emit it as a literal. - */ - __pformat_putc( c, &stream ); - } - - /* When we have fully dispatched the format string, the return value is the - * total number of bytes we transferred to the output destination. - */ - return stream.count; -} - -/* $RCSfile$Revision$: end of file */ diff --git a/winsup/mingw/mingwex/stdio/pformat.h b/winsup/mingw/mingwex/stdio/pformat.h deleted file mode 100644 index a2ace696c..000000000 --- a/winsup/mingw/mingwex/stdio/pformat.h +++ /dev/null @@ -1,90 +0,0 @@ -#ifndef PFORMAT_H -/* - * pformat.h - * - * $Id$ - * - * A private header, defining the `pformat' API; it is to be included - * in each compilation unit implementing any of the `printf' family of - * functions, but serves no useful purpose elsewhere. - * - * Written by Keith Marshall <keithmarshall@users.sourceforge.net> - * - * This is free software. You may redistribute and/or modify it as you - * see fit, without restriction of copyright. - * - * This software is provided "as is", in the hope that it may be useful, - * but WITHOUT WARRANTY OF ANY KIND, not even any implied warranty of - * MERCHANTABILITY, nor of FITNESS FOR ANY PARTICULAR PURPOSE. At no - * time will the author accept any form of liability for any damages, - * however caused, resulting from the use of this software. - */ -#define PFORMAT_H - -/* The following macros reproduce definitions from _mingw.h, - * so that compilation will not choke, if using any compiler - * other than the MinGW implementation of GCC. - */ -#ifndef __cdecl -# ifdef __GNUC__ -# define __cdecl __attribute__((__cdecl__)) -# else -# define __cdecl -# endif -#endif - -#ifndef __MINGW_GNUC_PREREQ -# if defined __GNUC__ && defined __GNUC_MINOR__ -# define __MINGW_GNUC_PREREQ( major, minor )\ - (__GNUC__ > (major) || (__GNUC__ == (major) && __GNUC_MINOR__ >= (minor))) -# else -# define __MINGW_GNUC_PREREQ( major, minor ) -# endif -#endif - -#ifndef __MINGW_NOTHROW -# if __MINGW_GNUC_PREREQ( 3, 3 ) -# define __MINGW_NOTHROW __attribute__((__nothrow__)) -# else -# define __MINGW_NOTHROW -# endif -#endif - -/* This isn't currently defined therein, - * but is a potential candidate for inclusion in _mingw.h - */ -#ifdef __MINGW32__ -# define __stringify__(NAME) #NAME -# define __mingw_quoted(NAME) __stringify__(__mingw_##NAME) -# define __mingw_alias(NAME) __attribute__((alias(__mingw_quoted(NAME)))) NAME -#else -# define __mingw_alias(NAME) NAME -#endif - -/* The following are the declarations specific to the `pformat' API... - */ -#define PFORMAT_TO_FILE 0x1000 -#define PFORMAT_NOLIMIT 0x2000 - -#ifdef __MINGW32__ - /* - * Map MinGW specific function names, for use in place of the generic - * implementation defined equivalent function names. - */ -# define __pformat __mingw_pformat - -# define __printf __mingw_printf -# define __fprintf __mingw_fprintf -# define __sprintf __mingw_sprintf -# define __snprintf __mingw_snprintf - -# define __vprintf __mingw_vprintf -# define __vfprintf __mingw_vfprintf -# define __vsprintf __mingw_vsprintf -# define __vsnprintf __mingw_vsnprintf - -#endif - -int __cdecl __pformat( int, void *, int, const char *, va_list ) __MINGW_NOTHROW; - -#endif /* !defined PFORMAT_H: $RCSfile$Revision$: end of file */ diff --git a/winsup/mingw/mingwex/stdio/printf.c b/winsup/mingw/mingwex/stdio/printf.c deleted file mode 100644 index 98b4e62e3..000000000 --- a/winsup/mingw/mingwex/stdio/printf.c +++ /dev/null @@ -1,68 +0,0 @@ -/* printf.c - * - * $Id$ - * - * Provides an implementation of the "printf" function, conforming - * generally to C99 and SUSv3/POSIX specifications, with extensions - * to support Microsoft's non-standard format specifications. This - * is included in libmingwex.a, whence it may replace the Microsoft - * function of the same name. - * - * Written by Keith Marshall <keithmarshall@users.sourceforge.net> - * - * This implementation of "printf" will normally be invoked by calling - * "__mingw_printf()" in preference to a direct reference to "printf()" - * itself; this leaves the MSVCRT implementation as the default, which - * will be deployed when user code invokes "print()". Users who then - * wish to use this implementation may either call "__mingw_printf()" - * directly, or may use conditional preprocessor defines, to redirect - * references to "printf()" to "__mingw_printf()". - * - * Compiling this module with "-D INSTALL_AS_DEFAULT" will change this - * recommended convention, such that references to "printf()" in user - * code will ALWAYS be redirected to "__mingw_printf()"; if this option - * is adopted, then users wishing to use the MSVCRT implementation of - * "printf()" will be forced to use a "back-door" mechanism to do so. - * Such a "back-door" mechanism is provided with MinGW, allowing the - * MSVCRT implementation to be called as "__msvcrt_printf()"; however, - * since users may not expect this behaviour, a standard libmingwex.a - * installation does not employ this option. - * - * - * This is free software. You may redistribute and/or modify it as you - * see fit, without restriction of copyright. - * - * This software is provided "as is", in the hope that it may be useful, - * but WITHOUT WARRANTY OF ANY KIND, not even any implied warranty of - * MERCHANTABILITY, nor of FITNESS FOR ANY PARTICULAR PURPOSE. At no - * time will the author accept any form of liability for any damages, - * however caused, resulting from the use of this software. - * - */ -#include <stdio.h> -#include <stdarg.h> - -#include "pformat.h" - -int __cdecl __printf( const char *, ... ) __MINGW_NOTHROW; - -#ifdef INSTALL_AS_DEFAULT -/* - * This implementation is to become the default for calls to printf(); - * establish the alias to make this so, forcing users to use the back-door - * __msvcrt_printf() reference, to access the original MSVCRT function. - */ -int __cdecl __mingw_alias(printf) (const char *, ...) __MINGW_NOTHROW; - -#endif - -int __cdecl __printf( const char *fmt, ... ) -{ - register int retval; - va_list argv; va_start( argv, fmt ); - retval = __pformat( PFORMAT_TO_FILE | PFORMAT_NOLIMIT, stdout, 0, fmt, argv ); - va_end( argv ); - return retval; -} - -/* $RCSfile$Revision$: end of file */ diff --git a/winsup/mingw/mingwex/stdio/snprintf.c b/winsup/mingw/mingwex/stdio/snprintf.c deleted file mode 100644 index 4d022e7dc..000000000 --- a/winsup/mingw/mingwex/stdio/snprintf.c +++ /dev/null @@ -1,44 +0,0 @@ -/* snprintf.c - * - * $Id$ - * - * Provides an implementation of the "snprintf" function, conforming - * generally to C99 and SUSv3/POSIX specifications, with extensions - * to support Microsoft's non-standard format specifications. This - * is included in libmingwex.a, replacing the redirection through - * libmoldnames.a, to the MSVCRT standard "_snprintf" function; (the - * standard MSVCRT function remains available, and may be invoked - * directly, using this fully qualified form of its name). - * - * Written by Keith Marshall <keithmarshall@users.sourceforge.net> - * - * This is free software. You may redistribute and/or modify it as you - * see fit, without restriction of copyright. - * - * This software is provided "as is", in the hope that it may be useful, - * but WITHOUT WARRANTY OF ANY KIND, not even any implied warranty of - * MERCHANTABILITY, nor of FITNESS FOR ANY PARTICULAR PURPOSE. At no - * time will the author accept any form of liability for any damages, - * however caused, resulting from the use of this software. - * - */ - -#include <stdio.h> -#include <stdarg.h> - -#include "pformat.h" - -int __cdecl __snprintf (char *, size_t, const char *fmt, ...) __MINGW_NOTHROW; -int __cdecl __mingw_alias(snprintf) (char *, size_t, const char *, ...) __MINGW_NOTHROW; - -int __cdecl __vsnprintf (char *, size_t, const char *fmt, va_list) __MINGW_NOTHROW; - -int __cdecl __snprintf( char *buf, size_t length, const char *fmt, ... ) -{ - va_list argv; va_start( argv, fmt ); - register int retval = __vsnprintf( buf, length, fmt, argv ); - va_end( argv ); - return retval; -} - -/* $RCSfile$Revision$: end of file */ diff --git a/winsup/mingw/mingwex/stdio/snwprintf.c b/winsup/mingw/mingwex/stdio/snwprintf.c deleted file mode 100644 index 42b05b292..000000000 --- a/winsup/mingw/mingwex/stdio/snwprintf.c +++ /dev/null @@ -1,13 +0,0 @@ -#include <stdarg.h> -#include <wchar.h> - -int snwprintf(wchar_t* buffer, size_t n, const wchar_t* format, ...) -{ - int retval; - va_list argptr; - - va_start( argptr, format ); - retval = _vsnwprintf( buffer, n, format, argptr ); - va_end( argptr ); - return retval; -} diff --git a/winsup/mingw/mingwex/stdio/sprintf.c b/winsup/mingw/mingwex/stdio/sprintf.c deleted file mode 100644 index c3381d3ef..000000000 --- a/winsup/mingw/mingwex/stdio/sprintf.c +++ /dev/null @@ -1,68 +0,0 @@ -/* sprintf.c - * - * $Id$ - * - * Provides an implementation of the "sprintf" function, conforming - * generally to C99 and SUSv3/POSIX specifications, with extensions - * to support Microsoft's non-standard format specifications. This - * is included in libmingwex.a, whence it may replace the Microsoft - * function of the same name. - * - * Written by Keith Marshall <keithmarshall@users.sourceforge.net> - * - * This implementation of "sprintf" will normally be invoked by calling - * "__mingw_sprintf()" in preference to a direct reference to "sprintf()" - * itself; this leaves the MSVCRT implementation as the default, which - * will be deployed when user code invokes "sprint()". Users who then - * wish to use this implementation may either call "__mingw_sprintf()" - * directly, or may use conditional preprocessor defines, to redirect - * references to "sprintf()" to "__mingw_sprintf()". - * - * Compiling this module with "-D INSTALL_AS_DEFAULT" will change this - * recommended convention, such that references to "sprintf()" in user - * code will ALWAYS be redirected to "__mingw_sprintf()"; if this option - * is adopted, then users wishing to use the MSVCRT implementation of - * "sprintf()" will be forced to use a "back-door" mechanism to do so. - * Such a "back-door" mechanism is provided with MinGW, allowing the - * MSVCRT implementation to be called as "__msvcrt_sprintf()"; however, - * since users may not expect this behaviour, a standard libmingwex.a - * installation does not employ this option. - * - * - * This is free software. You may redistribute and/or modify it as you - * see fit, without restriction of copyright. - * - * This software is provided "as is", in the hope that it may be useful, - * but WITHOUT WARRANTY OF ANY KIND, not even any implied warranty of - * MERCHANTABILITY, nor of FITNESS FOR ANY PARTICULAR PURPOSE. At no - * time will the author accept any form of liability for any damages, - * however caused, resulting from the use of this software. - * - */ -#include <stdio.h> -#include <stdarg.h> - -#include "pformat.h" - -int __cdecl __sprintf (char *, const char *, ...) __MINGW_NOTHROW; - -#ifdef INSTALL_AS_DEFAULT -/* - * This implementation is to become the default for calls to sprintf(); - * establish the alias to make this so, forcing users to use the back-door - * __msvcrt_sprintf() reference, to access the original MSVCRT function. - */ -int __cdecl __mingw_alias(sprintf) (char *, const char *, ...) __MINGW_NOTHROW; - -#endif - -int __cdecl __sprintf( char *buf, const char *fmt, ... ) -{ - register int retval; - va_list argv; va_start( argv, fmt ); - buf[retval = __pformat( PFORMAT_NOLIMIT, buf, 0, fmt, argv )] = '\0'; - va_end( argv ); - return retval; -} - -/* $RCSfile$Revision$: end of file */ diff --git a/winsup/mingw/mingwex/stdio/vfprintf.c b/winsup/mingw/mingwex/stdio/vfprintf.c deleted file mode 100644 index 19de7ae8c..000000000 --- a/winsup/mingw/mingwex/stdio/vfprintf.c +++ /dev/null @@ -1,64 +0,0 @@ -/* vfprintf.c - * - * $Id$ - * - * Provides an implementation of the "vfprintf" function, conforming - * generally to C99 and SUSv3/POSIX specifications, with extensions - * to support Microsoft's non-standard format specifications. This - * is included in libmingwex.a, whence it may replace the Microsoft - * function of the same name. - * - * Written by Keith Marshall <keithmarshall@users.sourceforge.net> - * - * This implementation of "vfprintf" will normally be invoked by calling - * "__mingw_vfprintf()" in preference to a direct reference to "vfprintf()" - * itself; this leaves the MSVCRT implementation as the default, which - * will be deployed when user code invokes "vfprint()". Users who then - * wish to use this implementation may either call "__mingw_vfprintf()" - * directly, or may use conditional preprocessor defines, to redirect - * references to "vfprintf()" to "__mingw_vfprintf()". - * - * Compiling this module with "-D INSTALL_AS_DEFAULT" will change this - * recommended convention, such that references to "vfprintf()" in user - * code will ALWAYS be redirected to "__mingw_vfprintf()"; if this option - * is adopted, then users wishing to use the MSVCRT implementation of - * "vfprintf()" will be forced to use a "back-door" mechanism to do so. - * Such a "back-door" mechanism is provided with MinGW, allowing the - * MSVCRT implementation to be called as "__msvcrt_vfprintf()"; however, - * since users may not expect this behaviour, a standard libmingwex.a - * installation does not employ this option. - * - * - * This is free software. You may redistribute and/or modify it as you - * see fit, without restriction of copyright. - * - * This software is provided "as is", in the hope that it may be useful, - * but WITHOUT WARRANTY OF ANY KIND, not even any implied warranty of - * MERCHANTABILITY, nor of FITNESS FOR ANY PARTICULAR PURPOSE. At no - * time will the author accept any form of liability for any damages, - * however caused, resulting from the use of this software. - * - */ -#include <stdio.h> -#include <stdarg.h> - -#include "pformat.h" - -int __cdecl __vfprintf (FILE *, const char *, va_list) __MINGW_NOTHROW; - -#ifdef INSTALL_AS_DEFAULT -/* - * This implementation is to become the default for calls to vfprintf(); - * establish the alias to make this so, forcing users to use the back-door - * __msvcrt_vfprintf() reference, to access the original MSVCRT function. - */ -int __cdecl __mingw_alias(vfprintf) (FILE *, const char *, va_list) __MINGW_NOTHROW; - -#endif - -int __cdecl __vfprintf( FILE *stream, const char *fmt, va_list argv ) -{ - return __pformat( PFORMAT_TO_FILE | PFORMAT_NOLIMIT, stream, 0, fmt, argv ); -} - -/* $RCSfile$Revision$: end of file */ diff --git a/winsup/mingw/mingwex/stdio/vfscanf.c b/winsup/mingw/mingwex/stdio/vfscanf.c deleted file mode 100644 index 3c1b137a8..000000000 --- a/winsup/mingw/mingwex/stdio/vfscanf.c +++ /dev/null @@ -1,40 +0,0 @@ -// By aaronwl 2003-01-28 for mingw-msvcrt -// Public domain: all copyrights disclaimed, absolutely no warranties */ - -#include <stdarg.h> -#include <stdio.h> - -int vfscanf(FILE * __restrict__ stream, const char * __restrict__ format, va_list arg) { - int ret; - - __asm__( - - /* allocate stack (esp += frame - arg3 - (8[arg1,2] + 12)) */ - "movl %%esp, %%ebx\n\t" - "lea 0xFFFFFFEC(%%esp, %6), %%esp\n\t" - "subl %5, %%esp\n\t" - - // set up stack - "movl %1, 0xC(%%esp)\n\t" // stream - "movl %2, 0x10(%%esp)\n\t" // format - "lea 0x14(%%esp), %%edi\n\t" - "movl %%edi, (%%esp)\n\t" // memcpy dest - "movl %5, 0x4(%%esp)\n\t" // memcpy src - "movl %5, 0x8(%%esp)\n\t" - "subl %6, 0x8(%%esp)\n\t" // memcpy len - "call _memcpy\n\t" - "addl $12, %%esp\n\t" - - // call fscanf - "call _fscanf\n\t" - - // restore stack - "movl %%ebx, %%esp\n\t" - - : "=a"(ret), "=c"(stream), "=d"(format) - : "1"(stream), "2"(format), "S"(arg), - "a"(&ret) - : "ebx", "edi"); - - return ret; -} diff --git a/winsup/mingw/mingwex/stdio/vfwscanf.c b/winsup/mingw/mingwex/stdio/vfwscanf.c deleted file mode 100644 index 2a1d095bc..000000000 --- a/winsup/mingw/mingwex/stdio/vfwscanf.c +++ /dev/null @@ -1,42 +0,0 @@ -// By aaronwl 2003-01-28 for mingw-msvcrt. -// Public domain: all copyrights disclaimed, absolutely no warranties. - -#include <stdarg.h> -#include <wchar.h> - -int vfwscanf(FILE * __restrict__ stream, const wchar_t * __restrict__ format, - va_list arg) { - - int ret; - - __asm__( - - // allocate stack (esp += frame - arg3 - (8[arg1,2] + 12)) - "movl %%esp, %%ebx\n\t" - "lea 0xFFFFFFEC(%%esp, %6), %%esp\n\t" - "subl %5, %%esp\n\t" - - // set up stack - "movl %1, 0xC(%%esp)\n\t" // stream - "movl %2, 0x10(%%esp)\n\t" // format - "lea 0x14(%%esp), %%edi\n\t" - "movl %%edi, (%%esp)\n\t" // memcpy dest - "movl %5, 0x4(%%esp)\n\t" // memcpy src - "movl %5, 0x8(%%esp)\n\t" - "subl %6, 0x8(%%esp)\n\t" // memcpy len - "call _memcpy\n\t" - "addl $12, %%esp\n\t" - - // call fscanf - "call _fwscanf\n\t" - - // restore stack - "movl %%ebx, %%esp\n\t" - - : "=a"(ret), "=c"(stream), "=d"(format) - : "1"(stream), "2"(format), "S"(arg), - "a"(&ret) - : "ebx", "edi"); - - return ret; -} diff --git a/winsup/mingw/mingwex/stdio/vprintf.c b/winsup/mingw/mingwex/stdio/vprintf.c deleted file mode 100644 index 20d4385ae..000000000 --- a/winsup/mingw/mingwex/stdio/vprintf.c +++ /dev/null @@ -1,64 +0,0 @@ -/* vprintf.c - * - * $Id$ - * - * Provides an implementation of the "vprintf" function, conforming - * generally to C99 and SUSv3/POSIX specifications, with extensions - * to support Microsoft's non-standard format specifications. This - * is included in libmingwex.a, whence it may replace the Microsoft - * function of the same name. - * - * Written by Keith Marshall <keithmarshall@users.sourceforge.net> - * - * This implementation of "vprintf" will normally be invoked by calling - * "__mingw_vprintf()" in preference to a direct reference to "vprintf()" - * itself; this leaves the MSVCRT implementation as the default, which - * will be deployed when user code invokes "vprint()". Users who then - * wish to use this implementation may either call "__mingw_vprintf()" - * directly, or may use conditional preprocessor defines, to redirect - * references to "vprintf()" to "__mingw_vprintf()". - * - * Compiling this module with "-D INSTALL_AS_DEFAULT" will change this - * recommended convention, such that references to "vprintf()" in user - * code will ALWAYS be redirected to "__mingw_vprintf()"; if this option - * is adopted, then users wishing to use the MSVCRT implementation of - * "vprintf()" will be forced to use a "back-door" mechanism to do so. - * Such a "back-door" mechanism is provided with MinGW, allowing the - * MSVCRT implementation to be called as "__msvcrt_vprintf()"; however, - * since users may not expect this behaviour, a standard libmingwex.a - * installation does not employ this option. - * - * - * This is free software. You may redistribute and/or modify it as you - * see fit, without restriction of copyright. - * - * This software is provided "as is", in the hope that it may be useful, - * but WITHOUT WARRANTY OF ANY KIND, not even any implied warranty of - * MERCHANTABILITY, nor of FITNESS FOR ANY PARTICULAR PURPOSE. At no - * time will the author accept any form of liability for any damages, - * however caused, resulting from the use of this software. - * - */ -#include <stdio.h> -#include <stdarg.h> - -#include "pformat.h" - -int __cdecl __vprintf (const char *, va_list) __MINGW_NOTHROW; - -#ifdef INSTALL_AS_DEFAULT -/* - * This implementation is to become the default for calls to vprintf(); - * establish the alias to make this so, forcing users to use the back-door - * __msvcrt_vprintf() reference, to access the original MSVCRT function. - */ -int __cdecl __mingw_alias(vprintf) (const char *, va_list) __MINGW_NOTHROW; - -#endif - -int __cdecl __vprintf( const char *fmt, va_list argv ) -{ - return __pformat( PFORMAT_TO_FILE | PFORMAT_NOLIMIT, stdout, 0, fmt, argv ); -} - -/* $RCSfile$Revision$: end of file */ diff --git a/winsup/mingw/mingwex/stdio/vscanf.c b/winsup/mingw/mingwex/stdio/vscanf.c deleted file mode 100644 index 53f543442..000000000 --- a/winsup/mingw/mingwex/stdio/vscanf.c +++ /dev/null @@ -1,9 +0,0 @@ -// By aaronwl 2003-01-28 for mingw-msvcrt -// Public domain: all copyrights disclaimed, absolutely no warranties - -#include <stdarg.h> -#include <stdio.h> - -int vscanf(const char * __restrict__ format, va_list arg) { - return vfscanf(stdin, format, arg); -} diff --git a/winsup/mingw/mingwex/stdio/vsnprintf.c b/winsup/mingw/mingwex/stdio/vsnprintf.c deleted file mode 100644 index a9722c235..000000000 --- a/winsup/mingw/mingwex/stdio/vsnprintf.c +++ /dev/null @@ -1,55 +0,0 @@ -/* vsnprintf.c - * - * $Id$ - * - * Provides an implementation of the "vsnprintf" function, conforming - * generally to C99 and SUSv3/POSIX specifications, with extensions - * to support Microsoft's non-standard format specifications. This - * is included in libmingwex.a, replacing the redirection through - * libmoldnames.a, to the MSVCRT standard "_vsnprintf" function; (the - * standard MSVCRT function remains available, and may be invoked - * directly, using this fully qualified form of its name). - * - * Written by Keith Marshall <keithmarshall@users.sourceforge.net> - * - * This is free software. You may redistribute and/or modify it as you - * see fit, without restriction of copyright. - * - * This software is provided "as is", in the hope that it may be useful, - * but WITHOUT WARRANTY OF ANY KIND, not even any implied warranty of - * MERCHANTABILITY, nor of FITNESS FOR ANY PARTICULAR PURPOSE. At no - * time will the author accept any form of liability for any damages, - * however caused, resulting from the use of this software. - * - */ - -#include <stdio.h> -#include <stdarg.h> - -#include "pformat.h" - -int __cdecl __vsnprintf (char *, size_t, const char *fmt, va_list) __MINGW_NOTHROW; -int __cdecl __mingw_alias(vsnprintf) (char *, size_t, const char *, va_list) __MINGW_NOTHROW; - -int __cdecl __vsnprintf( char *buf, size_t length, const char *fmt, va_list argv ) -{ - register int retval; - - if( length == (size_t)(0) ) - /* - * No buffer; simply compute and return the size required, - * without actually emitting any data. - */ - return __pformat( 0, buf, 0, fmt, argv ); - - /* If we get to here, then we have a buffer... - * Emit data up to the limit of buffer length less one, - * then add the requisite NUL terminator. - */ - retval = __pformat( 0, buf, --length, fmt, argv ); - buf[retval < length ? retval : length] = '\0'; - - return retval; -} - -/* $RCSfile$Revision$: end of file */ diff --git a/winsup/mingw/mingwex/stdio/vsnwprintf.c b/winsup/mingw/mingwex/stdio/vsnwprintf.c deleted file mode 100644 index 1b59a078b..000000000 --- a/winsup/mingw/mingwex/stdio/vsnwprintf.c +++ /dev/null @@ -1,5 +0,0 @@ -#include <stdarg.h> -#include <wchar.h> - -int vsnwprintf(wchar_t *buffer, size_t n, const wchar_t * format, va_list argptr) - { return _vsnwprintf( buffer, n, format, argptr );} diff --git a/winsup/mingw/mingwex/stdio/vsprintf.c b/winsup/mingw/mingwex/stdio/vsprintf.c deleted file mode 100644 index babfebd4e..000000000 --- a/winsup/mingw/mingwex/stdio/vsprintf.c +++ /dev/null @@ -1,66 +0,0 @@ -/* vsprintf.c - * - * $Id$ - * - * Provides an implementation of the "vsprintf" function, conforming - * generally to C99 and SUSv3/POSIX specifications, with extensions - * to support Microsoft's non-standard format specifications. This - * is included in libmingwex.a, whence it may replace the Microsoft - * function of the same name. - * - * Written by Keith Marshall <keithmarshall@users.sourceforge.net> - * - * This implementation of "vsprintf" will normally be invoked by calling - * "__mingw_vsprintf()" in preference to a direct reference to "vsprintf()" - * itself; this leaves the MSVCRT implementation as the default, which - * will be deployed when user code invokes "vsprint()". Users who then - * wish to use this implementation may either call "__mingw_vsprintf()" - * directly, or may use conditional preprocessor defines, to redirect - * references to "vsprintf()" to "__mingw_vsprintf()". - * - * Compiling this module with "-D INSTALL_AS_DEFAULT" will change this - * recommended convention, such that references to "vsprintf()" in user - * code will ALWAYS be redirected to "__mingw_vsprintf()"; if this option - * is adopted, then users wishing to use the MSVCRT implementation of - * "vsprintf()" will be forced to use a "back-door" mechanism to do so. - * Such a "back-door" mechanism is provided with MinGW, allowing the - * MSVCRT implementation to be called as "__msvcrt_vsprintf()"; however, - * since users may not expect this behaviour, a standard libmingwex.a - * installation does not employ this option. - * - * - * This is free software. You may redistribute and/or modify it as you - * see fit, without restriction of copyright. - * - * This software is provided "as is", in the hope that it may be useful, - * but WITHOUT WARRANTY OF ANY KIND, not even any implied warranty of - * MERCHANTABILITY, nor of FITNESS FOR ANY PARTICULAR PURPOSE. At no - * time will the author accept any form of liability for any damages, - * however caused, resulting from the use of this software. - * - */ -#include <stdio.h> -#include <stdarg.h> - -#include "pformat.h" - -int __cdecl __vsprintf (char *, const char *, va_list) __MINGW_NOTHROW; - -#ifdef INSTALL_AS_DEFAULT -/* - * This implementation is to become the default for calls to vsprintf(); - * establish the alias to make this so, forcing users to use the back-door - * __msvcrt_vsprintf() reference, to access the original MSVCRT function. - */ -int __cdecl __mingw_alias(vsprintf) (char *, const char *, va_list) __MINGW_NOTHROW; - -#endif - -int __cdecl __vsprintf( char *buf, const char *fmt, va_list argv ) -{ - register int retval; - buf[retval = __pformat( PFORMAT_NOLIMIT, buf, 0, fmt, argv )] = '\0'; - return retval; -} - -/* $RCSfile$Revision$: end of file */ diff --git a/winsup/mingw/mingwex/stdio/vsscanf.c b/winsup/mingw/mingwex/stdio/vsscanf.c deleted file mode 100644 index f59490d3b..000000000 --- a/winsup/mingw/mingwex/stdio/vsscanf.c +++ /dev/null @@ -1,41 +0,0 @@ -// By aaronwl 2003-01-28 for mingw-msvcrt. -// Public domain: all copyrights disclaimed, absolutely no warranties. - -#include <stdarg.h> -#include <stdio.h> - - -int vsscanf(const char * __restrict__ s, const char * __restrict__ format, va_list arg) { - int ret; - - __asm__( - - // allocate stack (esp += frame - arg3 - (8[arg1,2] + 12)) - "movl %%esp, %%ebx\n\t" - "lea 0xFFFFFFEC(%%esp, %6), %%esp\n\t" - "subl %5, %%esp\n\t" - - // set up stack - "movl %1, 0xC(%%esp)\n\t" // s - "movl %2, 0x10(%%esp)\n\t" // format - "lea 0x14(%%esp), %%edi\n\t" - "movl %%edi, (%%esp)\n\t" // memcpy dest - "movl %5, 0x4(%%esp)\n\t" // memcpy src - "movl %5, 0x8(%%esp)\n\t" - "subl %6, 0x8(%%esp)\n\t" // memcpy len - "call _memcpy\n\t" - "addl $12, %%esp\n\t" - - // call sscanf - "call _sscanf\n\t" - - // restore stack - "movl %%ebx, %%esp\n\t" - - : "=a"(ret), "=c"(s), "=d"(format) - : "1"(s), "2"(format), "S"(arg), - "a"(&ret) - : "ebx", "edi"); - - return ret; -} diff --git a/winsup/mingw/mingwex/stdio/vswscanf.c b/winsup/mingw/mingwex/stdio/vswscanf.c deleted file mode 100644 index ea359f3e6..000000000 --- a/winsup/mingw/mingwex/stdio/vswscanf.c +++ /dev/null @@ -1,43 +0,0 @@ -// By aaronwl 2003-01-28 for mingw-msvcrt -// Public domain: all copyrights disclaimed, absolutely no warranties */ - -#include <stdarg.h> -#include <wchar.h> - - -int vswscanf(const wchar_t * __restrict__ s, const wchar_t * __restrict__ format, - va_list arg) { - - int ret; - - __asm__( - - // allocate stack (esp += frame - arg3 - (8[arg1,2] + 12)) - "movl %%esp, %%ebx\n\t" - "lea 0xFFFFFFEC(%%esp, %6), %%esp\n\t" - "subl %5, %%esp\n\t" - - // set up stack - "movl %1, 0xC(%%esp)\n\t" // s - "movl %2, 0x10(%%esp)\n\t" // format - "lea 0x14(%%esp), %%edi\n\t" - "movl %%edi, (%%esp)\n\t" // memcpy dest - "movl %5, 0x4(%%esp)\n\t" // memcpy src - "movl %5, 0x8(%%esp)\n\t" - "subl %6, 0x8(%%esp)\n\t" // memcpy len - "call _memcpy\n\t" - "addl $12, %%esp\n\t" - - // call sscanf - "call _swscanf\n\t" - - // restore stack - "movl %%ebx, %%esp\n\t" - - : "=a"(ret), "=c"(s), "=d"(format) - : "1"(s), "2"(format), "S"(arg), - "a"(&ret) - : "ebx", "edi"); - - return ret; -} diff --git a/winsup/mingw/mingwex/stdio/vwscanf.c b/winsup/mingw/mingwex/stdio/vwscanf.c deleted file mode 100644 index 0b20e2ee4..000000000 --- a/winsup/mingw/mingwex/stdio/vwscanf.c +++ /dev/null @@ -1,10 +0,0 @@ -// By aaronwl 2003-01-28 for mingw-msvcrt. -// Public domain: all copyrights disclaimed, absolutely no warranties. - -#include <stdarg.h> -#include <wchar.h> -#include <stdio.h> - -int vwscanf(const wchar_t * __restrict__ format, va_list arg) { - return vfwscanf(stdin, format, arg); -} diff --git a/winsup/mingw/mingwex/strtoimax.c b/winsup/mingw/mingwex/strtoimax.c deleted file mode 100644 index 9072d4bbb..000000000 --- a/winsup/mingw/mingwex/strtoimax.c +++ /dev/null @@ -1,112 +0,0 @@ -/* - This source code was extracted from the Q8 package created and - placed in the PUBLIC DOMAIN by Doug Gwyn <gwyn@arl.mil> - last edit: 1999/11/05 gwyn@arl.mil - - Implements subclause 7.8.2 of ISO/IEC 9899:1999 (E). - - This particular implementation requires the matching <inttypes.h>. - It also assumes that character codes for A..Z and a..z are in - contiguous ascending order; this is true for ASCII but not EBCDIC. -*/ -#include <stdlib.h> -#include <errno.h> -#include <ctype.h> -#include <inttypes.h> - -/* Helper macros */ - -/* convert digit character to number, in any base */ -#define ToNumber(c) (isdigit(c) ? (c) - '0' : \ - isupper(c) ? (c) - 'A' + 10 : \ - islower(c) ? (c) - 'a' + 10 : \ - -1 /* "invalid" flag */ \ - ) -/* validate converted digit character for specific base */ -#define valid(n, b) ((n) >= 0 && (n) < (b)) - -intmax_t -strtoimax(nptr, endptr, base) - register const char * __restrict__ nptr; - char ** __restrict__ endptr; - register int base; - { - register uintmax_t accum; /* accumulates converted value */ - register int n; /* numeral from digit character */ - int minus; /* set iff minus sign seen */ - int toobig; /* set iff value overflows */ - - if ( endptr != NULL ) - *endptr = (char *)nptr; /* in case no conversion's performed */ - - if ( base < 0 || base == 1 || base > 36 ) - { - errno = EDOM; - return 0; /* unspecified behavior */ - } - - /* skip initial, possibly empty sequence of white-space characters */ - - while ( isspace(*nptr) ) - ++nptr; - - /* process subject sequence: */ - - /* optional sign */ - if ( (minus = *nptr == '-') || *nptr == '+' ) - ++nptr; - - if ( base == 0 ) { - if ( *nptr == '0' ) { - if ( nptr[1] == 'X' || nptr[1] == 'x' ) - base = 16; - else - base = 8; - } - else - base = 10; - } - /* optional "0x" or "0X" for base 16 */ - - if ( base == 16 && *nptr == '0' && (nptr[1] == 'X' || nptr[1] == 'x') ) - nptr += 2; /* skip past this prefix */ - - /* check whether there is at least one valid digit */ - - n = ToNumber(*nptr); - ++nptr; - - if ( !valid(n, base) ) - return 0; /* subject seq. not of expected form */ - - accum = n; - - for ( toobig = 0; n = ToNumber(*nptr), valid(n, base); ++nptr ) - if ( accum > (uintmax_t)(INTMAX_MAX / base + 2) ) /* major wrap-around */ - toobig = 1; /* but keep scanning */ - else - accum = base * accum + n; - - if ( endptr != NULL ) - *endptr = (char *)nptr; /* points to first not-valid-digit */ - - if ( minus ) - { - if ( accum > (uintmax_t)INTMAX_MAX + 1 ) - toobig = 1; - } - else - if ( accum > (uintmax_t)INTMAX_MAX ) - toobig = 1; - - if ( toobig ) - { - errno = ERANGE; - return minus ? INTMAX_MIN : INTMAX_MAX; - } - else - return (intmax_t)(minus ? -accum : accum); - } - -long long __attribute__ ((alias ("strtoimax"))) -strtoll (const char* __restrict__ nptr, char ** __restrict__ endptr, int base); diff --git a/winsup/mingw/mingwex/strtoumax.c b/winsup/mingw/mingwex/strtoumax.c deleted file mode 100644 index 2c052ac06..000000000 --- a/winsup/mingw/mingwex/strtoumax.c +++ /dev/null @@ -1,110 +0,0 @@ -/* - This source code was extracted from the Q8 package created and - placed in the PUBLIC DOMAIN by Doug Gwyn <gwyn@arl.mil> - last edit: 1999/11/05 gwyn@arl.mil - - Implements subclause 7.8.2 of ISO/IEC 9899:1999 (E). - - This particular implementation requires the matching <inttypes.h>. - It also assumes that character codes for A..Z and a..z are in - contiguous ascending order; this is true for ASCII but not EBCDIC. -*/ -#include <stdlib.h> -#include <errno.h> -#include <ctype.h> -#include <inttypes.h> - -/* Helper macros */ - -/* convert digit character to number, in any base */ -#define ToNumber(c) (isdigit(c) ? (c) - '0' : \ - isupper(c) ? (c) - 'A' + 10 : \ - islower(c) ? (c) - 'a' + 10 : \ - -1 /* "invalid" flag */ \ - ) -/* validate converted digit character for specific base */ -#define valid(n, b) ((n) >= 0 && (n) < (b)) - -uintmax_t -strtoumax(nptr, endptr, base) - register const char * __restrict__ nptr; - char ** __restrict__ endptr; - register int base; - { - register uintmax_t accum; /* accumulates converted value */ - register uintmax_t next; /* for computing next value of accum */ - register int n; /* numeral from digit character */ - int minus; /* set iff minus sign seen (yes!) */ - int toobig; /* set iff value overflows */ - - if ( endptr != NULL ) - *endptr = (char *)nptr; /* in case no conversion's performed */ - - if ( base < 0 || base == 1 || base > 36 ) - { - errno = EDOM; - return 0; /* unspecified behavior */ - } - - /* skip initial, possibly empty sequence of white-space characters */ - - while ( isspace(*nptr) ) - ++nptr; - - /* process subject sequence: */ - - /* optional sign (yes!) */ - - if ( (minus = *nptr == '-') || *nptr == '+' ) - ++nptr; - - if ( base == 0 ) - { - if ( *nptr == '0' ) - { - if ( nptr[1] == 'X' || nptr[1] == 'x' ) - base = 16; - else - base = 8; - } - else - base = 10; - } - - /* optional "0x" or "0X" for base 16 */ - - if ( base == 16 && *nptr == '0' && (nptr[1] == 'X' || nptr[1] == 'x') ) - nptr += 2; /* skip past this prefix */ - - /* check whether there is at least one valid digit */ - - n = ToNumber(*nptr); - ++nptr; - - if ( !valid(n, base) ) - return 0; /* subject seq. not of expected form */ - - accum = n; - - for ( toobig = 0; n = ToNumber(*nptr), valid(n, base); ++nptr ) - if ( accum > UINTMAX_MAX / base + 1 /* major wrap-around */ - || (next = base * accum + n) < accum /* minor wrap-around */ - ) - toobig = 1; /* but keep scanning */ - else - accum = next; - - if ( endptr != NULL ) - *endptr = (char *)nptr; /* points to first not-valid-digit */ - - if ( toobig ) - { - errno = ERANGE; - return UINTMAX_MAX; - } - else - return minus ? -accum : accum; /* (yes!) */ - } - -unsigned long long __attribute__ ((alias ("strtoumax"))) -strtoull (const char* __restrict__ nptr, char ** __restrict__ endptr, int base); diff --git a/winsup/mingw/mingwex/tdelete.c b/winsup/mingw/mingwex/tdelete.c deleted file mode 100755 index 4de3897db..000000000 --- a/winsup/mingw/mingwex/tdelete.c +++ /dev/null @@ -1,65 +0,0 @@ -/* $NetBSD: tdelete.c,v 1.3 1999/09/20 04:39:43 lukem Exp $ */ - -/* - * Tree search generalized from Knuth (6.2.2) Algorithm T just like - * the AT&T man page says. - * - * The node_t structure is for internal use only, lint doesn't grok it. - * - * Written by reading the System V Interface Definition, not the code. - * - * Totally public domain. - */ - -#include <assert.h> -#define _SEARCH_PRIVATE -#include <search.h> -#include <stdlib.h> - -#define _DIAGASSERT assert - - - -/* delete node with given key */ -void * -tdelete(const void *vkey, /* key to be deleted */ - void **vrootp, /* address of the root of tree */ - int (*compar)(const void *, const void *)) -{ - node_t **rootp = (node_t **)vrootp; - node_t *p, *q, *r; - int cmp; - - _DIAGASSERT(vkey != NULL); - _DIAGASSERT(compar != NULL); - - if (rootp == NULL || (p = *rootp) == NULL) - return NULL; - - while ((cmp = (*compar)(vkey, (*rootp)->key)) != 0) { - p = *rootp; - rootp = (cmp < 0) ? - &(*rootp)->llink : /* follow llink branch */ - &(*rootp)->rlink; /* follow rlink branch */ - if (*rootp == NULL) - return NULL; /* key not found */ - } - r = (*rootp)->rlink; /* D1: */ - if ((q = (*rootp)->llink) == NULL) /* Left NULL? */ - q = r; - else if (r != NULL) { /* Right link is NULL? */ - if (r->llink == NULL) { /* D2: Find successor */ - r->llink = q; - q = r; - } else { /* D3: Find NULL link */ - for (q = r->llink; q->llink != NULL; q = r->llink) - r = q; - r->llink = q->rlink; - q->llink = (*rootp)->llink; - q->rlink = (*rootp)->rlink; - } - } - free(*rootp); /* D4: Free node */ - *rootp = q; /* link parent to new node */ - return p; -} diff --git a/winsup/mingw/mingwex/testwmem.c b/winsup/mingw/mingwex/testwmem.c deleted file mode 100644 index 1310718c9..000000000 --- a/winsup/mingw/mingwex/testwmem.c +++ /dev/null @@ -1,104 +0,0 @@ -#include <memory.h> -#include <wchar.h> -#include <stdio.h> - -wchar_t fmt1[] = L" 1 2 3 4 5"; -wchar_t fmt2[] = L"12345678901234567890123456789012345678901234567890"; - -void test_wmemchr( void ) -{ - wchar_t* dest; - wint_t result; - wint_t ch = L'r'; - wchar_t str[] = L"lazy"; - wchar_t string1[60] = L"The quick brown dog jumps over the lazy fox"; - - wprintf( L"Wmemchr\n" ); - wprintf( L"String to be searched:\n\t\t%s\n", string1 ); - wprintf( L"\t\t%s\n\t\t%s\n\n", fmt1, fmt2 ); - - wprintf( L"Search char:\t%c\n", ch ); - dest = wmemchr( string1, ch, sizeof( string1 ) ); - result = dest - string1 + 1; - if( dest != NULL ) - wprintf( L"Result:\t\t%c found at position %d\n\n", ch, result ); - else - wprintf( L"Result:\t\t%c not found\n\n" ); -return; -} -void test_wmemset( void ) -{/* 1 2 - 0123456789012345678901234567890 */ - wchar_t buffer[] = L"This is a test of the wmemset function"; - wprintf( L"Before: %s\n", buffer ); - wmemset( buffer+22, L'*', 7 ); - wprintf( L"After: %s\n\n", buffer ); -return; -} - -void test_wmemmove( void ) -{ - wchar_t string1[60] = L"The quick brown dog jumps over the lazy fox"; - wchar_t string2[60] = L"The quick brown fox jumps over the lazy dog"; - - wprintf( L"Wmemcpy without overlap\n" ); - wprintf( L"Source:\t\t%s\n", string1 + 40 ); - wprintf( L"Destination:\t%s\n", string1 + 16 ); - wmemcpy( string1 + 16, string1 + 40, 3 ); - wprintf( L"Result:\t\t%s\n", string1 ); - wprintf( L"Length:\t\t%d characters\n\n", wcslen( string1 ) ); - wmemcpy( string1 + 16, string2 + 40, 3 ); - - wprintf( L"Wmemmove with overlap\n" ); - wprintf( L"Source:\t\t%s\n", string2 + 4 ); - wprintf( L"Destination:\t%s\n", string2 + 10 ); - wmemmove( string2 + 10, string2 + 4, 40 ); - wprintf( L"Result:\t\t%s\n", string2 ); - wprintf( L"Length:\t\t%d characters\n\n", wcslen( string2 ) ); - - wprintf( L"Wmemcpy with overlap\n" ); - wprintf( L"Source:\t\t%s\n", string1 + 4 ); - wprintf( L"Destination:\t%s\n", string1 + 10 ); - wmemcpy( string1 + 10, string1 + 4, 40 ); - wprintf( L"Result:\t\t%s\n", string1 ); - wprintf( L"Length:\t\t%d characters\n\n", wcslen( string1 ) ); -} - - -void test_wmemcmp( void ) -{ - wchar_t first[] = L"12345678901234567890"; - wchar_t second[] = L"12345678901234567891"; - wint_t result; - wprintf(L"Wmemcmp\n"); - wprintf( L"Compare '%.19s' to '%.19s':\n", first, second ); - result = wmemcmp( first, second, 19 ); - if( result < 0 ) - wprintf( L"First is less than second.\n" ); - else if( result == 0 ) - wprintf( L"First is equal to second.\n" ); - else if( result > 0 ) - wprintf( L"First is greater than second.\n" ); - wprintf( L"\nCompare '%.20s' to '%.20s':\n", first, second ); - result = wmemcmp( first, second, 20 ); - if( result < 0 ) - wprintf( L"First is less than second.\n\n" ); - else if( result == 0 ) - wprintf( L"First is equal to second.\n\n" ); - else if( result > 0 ) - wprintf( L"First is greater than second.\n\n" ); -} - - - -int main(){ -test_wmemset(); -test_wmemmove(); -test_wmemchr(); -test_wmemcmp(); -return 0; -} - - - - diff --git a/winsup/mingw/mingwex/tfind.c b/winsup/mingw/mingwex/tfind.c deleted file mode 100755 index e8ffe657a..000000000 --- a/winsup/mingw/mingwex/tfind.c +++ /dev/null @@ -1,41 +0,0 @@ -/* $NetBSD: tfind.c,v 1.3.18.2 2005/03/23 11:12:21 tron Exp $ */ - -/* - * Tree search generalized from Knuth (6.2.2) Algorithm T just like - * the AT&T man page says. - * - * The node_t structure is for internal use only, lint doesn't grok it. - * - * Written by reading the System V Interface Definition, not the code. - * - * Totally public domain. - */ - -#include <assert.h> -#define _SEARCH_PRIVATE -#include <stdlib.h> -#include <search.h> - - -/* find a node, or return 0 */ -void * -tfind(const void *vkey, - void * const *vrootp, - int (*compar) (const void *, const void *)) -{ - node_t * const *rootp = (node_t * const*)vrootp; - - if (rootp == NULL) - return NULL; - - while (*rootp != NULL) { /* T1: */ - int r; - - if ((r = (*compar)(vkey, (*rootp)->key)) == 0) /* T2: */ - return *rootp; /* key found */ - rootp = (r < 0) ? - &(*rootp)->llink : /* T3: follow left branch */ - &(*rootp)->rlink; /* T4: follow right branch */ - } - return NULL; -} diff --git a/winsup/mingw/mingwex/tsearch.c b/winsup/mingw/mingwex/tsearch.c deleted file mode 100755 index a0aa0eb36..000000000 --- a/winsup/mingw/mingwex/tsearch.c +++ /dev/null @@ -1,51 +0,0 @@ -/* $NetBSD: tsearch.c,v 1.4 1999/09/20 04:39:43 lukem Exp $ */ - -/* - * Tree search generalized from Knuth (6.2.2) Algorithm T just like - * the AT&T man page says. - * - * The node_t structure is for internal use only, lint doesn't grok it. - * - * Written by reading the System V Interface Definition, not the code. - * - * Totally public domain. - */ - -#include <assert.h> -#define _SEARCH_PRIVATE -#include <search.h> -#include <stdlib.h> - - -/* find or insert datum into search tree */ -void * -tsearch(const void * __restrict__ vkey, /* key to be located */ - void ** __restrict__ vrootp, /* address of tree root */ - int (*compar) (const void *, const void *)) -{ - node_t *q; - node_t **rootp = (node_t **)vrootp; - - if (rootp == NULL) - return NULL; - - while (*rootp != NULL) { /* Knuth's T1: */ - int r; - - if ((r = (*compar)(vkey, (*rootp)->key)) == 0) /* T2: */ - return *rootp; /* we found it! */ - - rootp = (r < 0) ? - &(*rootp)->llink : /* T3: follow left branch */ - &(*rootp)->rlink; /* T4: follow right branch */ - } - - q = malloc(sizeof(node_t)); /* T5: key not found */ - if (q != 0) { /* make new node */ - *rootp = q; /* link new node to old */ - /* LINTED const castaway ok */ - q->key = (void *)vkey; /* initialize new node */ - q->llink = q->rlink = NULL; - } - return q; -} diff --git a/winsup/mingw/mingwex/tst-aligned-malloc.c b/winsup/mingw/mingwex/tst-aligned-malloc.c deleted file mode 100755 index 43ee734bc..000000000 --- a/winsup/mingw/mingwex/tst-aligned-malloc.c +++ /dev/null @@ -1,90 +0,0 @@ -#include <stdio.h> -#include <stdlib.h> -#include <time.h> -#include <string.h> -#include <errno.h> -#include <malloc.h> - -#ifdef HAVE_STDINT_H -# include <stdint.h> /* uintptr_t */ -#else -# define uintptr_t size_t -#endif - -#define NELEM(a) (sizeof(a) / sizeof(a[0])) - -static int -is_aligned (void *p, size_t alignment, size_t offset) -{ - return !((((uintptr_t) p) + offset) & (alignment - 1)); -} - -#define MAX_SIZE (1 << sizeof(unsigned char)) -#define NP 1000 -#define NTST 100000U - -#define ERRMSG fprintf(stderr, "Iteration %u, align = %u, offset = %u, size = %u (oldsize = %u), errno = %d (%s)\n", i, align[j % NELEM(align)], offset[j % NELEM(offset)], size[j], oldsize, errno, strerror(errno)) - -int -main (void) -{ - unsigned char *p[NP]; - size_t size[NP]; - size_t align[] = { 2, 4, 8, 16, 32, 64 }; - size_t offset[20]; - unsigned i; - - srand (time (NULL)); - - for (i = 0; i < NELEM (p); ++i) - { - p[i] = 0; - size[i] = 0; - } - - for (i = 0; i < NELEM (offset); ++i) - offset[i] = rand () % 512; - - for (i = 0; i < NTST; ++i) - { - size_t oldsize; - unsigned j, k; - j = rand () % NELEM (p); - oldsize = size[j]; - p[j] = __mingw_aligned_offset_realloc (p[j], - size[j] = rand () % MAX_SIZE, - align[j % NELEM (align)], - offset[j % NELEM (offset)]); - - if (size[j] && !p[j]) - { - fprintf (stderr, "Returned NULL!\n"); - ERRMSG; - return EXIT_FAILURE; - } - if (size[j] && !is_aligned (p[j], - align[j % NELEM (align)], - offset[j % NELEM (offset)])) - { - fprintf (stderr, "Misaligned block!\n"); - ERRMSG; - return EXIT_FAILURE; - } - if (oldsize > size[j]) - oldsize = size[j]; - for (k = 0; k < oldsize; ++k) - if (p[j][k] != k) - { - fprintf (stderr, "Miscopied block!\n"); - ERRMSG; - return EXIT_FAILURE; - } - for (k = 0; k < size[j]; ++k) - p[j][k] = k; - } - - for (i = 0; i < NELEM (p); ++i) - __mingw_aligned_free (p[i]); - - return EXIT_SUCCESS; -} diff --git a/winsup/mingw/mingwex/twalk.c b/winsup/mingw/mingwex/twalk.c deleted file mode 100755 index aa7909c8a..000000000 --- a/winsup/mingw/mingwex/twalk.c +++ /dev/null @@ -1,48 +0,0 @@ -/* $NetBSD: twalk.c,v 1.2 1999/09/16 11:45:37 lukem Exp $ */ - -/* - * Tree search generalized from Knuth (6.2.2) Algorithm T just like - * the AT&T man page says. - * - * The node_t structure is for internal use only, lint doesn't grok it. - * - * Written by reading the System V Interface Definition, not the code. - * - * Totally public domain. - */ - -#include <assert.h> -#define _SEARCH_PRIVATE -#include <search.h> -#include <stdlib.h> - -static void trecurse (const node_t *, void (*action)(const void *, VISIT, int), - int level) __MINGW_ATTRIB_NONNULL (1) - __MINGW_ATTRIB_NONNULL (2); -/* Walk the nodes of a tree */ -static void -trecurse( const node_t *root, /* Root of the tree to be walked */ - void (*action)(const void *, VISIT, int), - int level) -{ - if (root->llink == NULL && root->rlink == NULL) - (*action)(root, leaf, level); - else { - (*action)(root, preorder, level); - if (root->llink != NULL) - trecurse(root->llink, action, level + 1); - (*action)(root, postorder, level); - if (root->rlink != NULL) - trecurse(root->rlink, action, level + 1); - (*action)(root, endorder, level); - } -} - -/* Walk the nodes of a tree */ -void -twalk( const void *vroot, /* Root of the tree to be walked */ - void (*action) (const void *, VISIT, int)) -{ - if (vroot != NULL && action != NULL) - trecurse(vroot, action, 0); -} diff --git a/winsup/mingw/mingwex/ulltoa.c b/winsup/mingw/mingwex/ulltoa.c deleted file mode 100644 index 8e90de764..000000000 --- a/winsup/mingw/mingwex/ulltoa.c +++ /dev/null @@ -1,3 +0,0 @@ -#include <stdlib.h> -char* ulltoa(unsigned long long _n, char * _c, int _i) - { return _ui64toa (_n, _c, _i); } diff --git a/winsup/mingw/mingwex/ulltow.c b/winsup/mingw/mingwex/ulltow.c deleted file mode 100644 index 8e4f228f1..000000000 --- a/winsup/mingw/mingwex/ulltow.c +++ /dev/null @@ -1,3 +0,0 @@ -#include <stdlib.h> -wchar_t* ulltow(unsigned long long _n, wchar_t * _w, int _i) - { return _ui64tow (_n, _w, _i); } diff --git a/winsup/mingw/mingwex/usleep.c b/winsup/mingw/mingwex/usleep.c deleted file mode 100755 index b322a7703..000000000 --- a/winsup/mingw/mingwex/usleep.c +++ /dev/null @@ -1,40 +0,0 @@ -/* - * usleep - * Implementation according to: - * The Open Group Base Specifications Issue 6 - * IEEE Std 1003.1, 2004 Edition - */ - -/* - * THIS SOFTWARE IS NOT COPYRIGHTED - * - * This source code is offered for use in the public domain. You may - * use, modify or distribute it freely. - * - * This code is distributed in the hope that it will be useful but - * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY - * DISCLAIMED. This includes but is not limited to warranties of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * Contributed by: - * Ramiro Polla <ramiro@lisha.ufsc.br> - */ - -#include <sys/types.h> -#include <errno.h> - -#define WIN32_LEAN_AND_MEAN -#include <windows.h> - -int __cdecl usleep(useconds_t useconds) -{ - if(useconds == 0) - return 0; - - if(useconds >= 1000000) - return EINVAL; - - Sleep(useconds / 1000); - - return 0; -} diff --git a/winsup/mingw/mingwex/wcrtomb.c b/winsup/mingw/mingwex/wcrtomb.c deleted file mode 100755 index 61ae6d677..000000000 --- a/winsup/mingw/mingwex/wcrtomb.c +++ /dev/null @@ -1,94 +0,0 @@ -#include "mb_wc_common.h" -#include <wchar.h> -#include <stdlib.h> -#include <errno.h> -#include <limits.h> -#define WIN32_LEAN_AND_MEAN -#include <windows.h> - - -static int __MINGW_ATTRIB_NONNULL(1) - __wcrtomb_cp (char *dst, wchar_t wc, const unsigned int cp, - const unsigned int mb_max) -{ - if (cp == 0) - { - if (wc > 255) - { - errno = EILSEQ; - return -1; - } - *dst = (char) wc; - return 1; - } - else - { - int invalid_char = 0; - - int size = WideCharToMultiByte (cp, 0 /* Is this correct flag? */, - &wc, 1, dst, mb_max, - NULL, &invalid_char); - if (size == 0 || invalid_char) - { - errno = EILSEQ; - return -1; - } - return size; - } -} - -size_t -wcrtomb (char *dst, wchar_t wc, mbstate_t * __UNUSED_PARAM (ps)) -{ - char byte_bucket [MB_LEN_MAX]; - char* tmp_dst = dst ? dst : byte_bucket; - return (size_t)__wcrtomb_cp (tmp_dst, wc, get_codepage (), - MB_CUR_MAX); -} - -size_t wcsrtombs (char *dst, const wchar_t **src, size_t len, - mbstate_t * __UNUSED_PARAM (ps)) -{ - int ret = 0; - size_t n = 0; - const unsigned int cp = get_codepage(); - const unsigned int mb_max = MB_CUR_MAX; - const wchar_t *pwc = *src; - - if (src == NULL || *src == NULL) /* undefined behavior */ - return 0; - - if (dst != NULL) - { - while (n < len) - { - if ((ret = __wcrtomb_cp (dst, *pwc, cp, mb_max)) <= 0) - return (size_t) -1; - n += ret; - dst += ret; - if (*(dst - 1) == '\0') - { - *src = (wchar_t*) NULL;; - return (n - 1); - } - pwc++; - } - *src = pwc; - } - else - { - char byte_bucket [MB_LEN_MAX]; - while (n < len) - { - if ((ret = __wcrtomb_cp (byte_bucket, *pwc, cp, mb_max)) - <= 0) - return (size_t) -1; - n += ret; - if (byte_bucket [ret - 1] == '\0') - return (n - 1); - pwc++; - } - } - - return n; -} diff --git a/winsup/mingw/mingwex/wcstof.c b/winsup/mingw/mingwex/wcstof.c deleted file mode 100644 index c08e7f128..000000000 --- a/winsup/mingw/mingwex/wcstof.c +++ /dev/null @@ -1,64 +0,0 @@ -/* Wide char wrapper for strtof - * Revision history: - * 25 Aug 2006 Initial version. - * - * Contributor: Danny Smith <dannysmith@users.sourceforege.net> - */ - - /* This routine has been placed in the public domain.*/ - -#define WIN32_LEAN_AND_MEAN -#include <windows.h> -#include <locale.h> -#include <wchar.h> -#include <stdlib.h> -#include <string.h> -#include <mbstring.h> - -#include "mb_wc_common.h" - -float wcstof (const wchar_t * __restrict__ wcs, wchar_t ** __restrict__ wcse) -{ - char * cs; - char * cse; - unsigned int i; - float ret; - const unsigned int cp = get_codepage (); - - /* Allocate enough room for (possibly) mb chars */ - cs = (char *) malloc ((wcslen(wcs)+1) * MB_CUR_MAX); - - if (cp == 0) /* C locale */ - { - for (i = 0; (wcs[i] != 0) && wcs[i] <= 255; i++) - cs[i] = (char) wcs[i]; - cs[i] = '\0'; - } - else - { - int nbytes = -1; - int mb_len = 0; - /* loop through till we hit null or invalid character */ - for (i = 0; (wcs[i] != 0) && (nbytes != 0); i++) - { - nbytes = WideCharToMultiByte(cp, WC_COMPOSITECHECK | WC_SEPCHARS, - wcs + i, 1, cs + mb_len, MB_CUR_MAX, - NULL, NULL); - mb_len += nbytes; - } - cs[mb_len] = '\0'; - } - - ret = strtof (cs, &cse); - - if (wcse) - { - /* Make sure temp mbstring cs has 0 at cse. */ - *cse = '\0'; - i = _mbslen ((unsigned char*) cs); /* Number of chars, not bytes */ - *wcse = (wchar_t *) wcs + i; - } - free (cs); - - return ret; -} diff --git a/winsup/mingw/mingwex/wcstoimax.c b/winsup/mingw/mingwex/wcstoimax.c deleted file mode 100644 index 99bacf463..000000000 --- a/winsup/mingw/mingwex/wcstoimax.c +++ /dev/null @@ -1,119 +0,0 @@ -/* - This source code was extracted from the Q8 package created and - placed in the PUBLIC DOMAIN by Doug Gwyn <gwyn@arl.mil> - - last edit: 1999/11/05 gwyn@arl.mil - - Implements subclause 7.8.2 of ISO/IEC 9899:1999 (E). - - This particular implementation requires the matching <inttypes.h>. - It also assumes that character codes for A..Z and a..z are in - contiguous ascending order; this is true for ASCII but not EBCDIC. -*/ - -#include <wchar.h> -#include <errno.h> -#include <ctype.h> -#include <inttypes.h> - -/* convert digit wide character to number, in any base */ - -#define ToWNumber(c) (iswdigit(c) ? (c) - L'0' : \ - iswupper(c) ? (c) - L'A' + 10 : \ - iswlower(c) ? (c) - L'a' + 10 : \ - -1 /* "invalid" flag */ \ - ) - -/* validate converted digit character for specific base */ -#define valid(n, b) ((n) >= 0 && (n) < (b)) - -intmax_t -wcstoimax(nptr, endptr, base) - register const wchar_t * __restrict__ nptr; - wchar_t ** __restrict__ endptr; - register int base; - { - register uintmax_t accum; /* accumulates converted value */ - register int n; /* numeral from digit character */ - int minus; /* set iff minus sign seen */ - int toobig; /* set iff value overflows */ - - if ( endptr != NULL ) - *endptr = (wchar_t *)nptr; /* in case no conv performed */ - - if ( base < 0 || base == 1 || base > 36 ) - { - errno = EDOM; - return 0; /* unspecified behavior */ - } - - /* skip initial, possibly empty sequence of white-space w.characters */ - - while ( iswspace(*nptr) ) - ++nptr; - - /* process subject sequence: */ - - /* optional sign */ - - if ( (minus = *nptr == L'-') || *nptr == L'+' ) - ++nptr; - - if ( base == 0 ) - { - if ( *nptr == L'0' ) - { - if ( nptr[1] == L'X' || nptr[1] == L'x' ) - base = 16; - else - base = 8; - } - else - base = 10; - } - /* optional "0x" or "0X" for base 16 */ - - if ( base == 16 && *nptr == L'0' - && (nptr[1] == L'X' || nptr[1] == L'x') - ) - nptr += 2; /* skip past this prefix */ - - /* check whether there is at least one valid digit */ - - n = ToWNumber(*nptr); - ++nptr; - - if ( !valid(n, base) ) - return 0; /* subject seq. not of expected form */ - - accum = n; - - for ( toobig = 0; n = ToWNumber(*nptr), valid(n, base); ++nptr ) - if ( accum > (uintmax_t)(INTMAX_MAX / base + 2) ) /* major wrap-around */ - toobig = 1; /* but keep scanning */ - else - accum = base * accum + n; - - if ( endptr != NULL ) - *endptr = (wchar_t *)nptr; /* -> first not-valid-digit */ - - if ( minus ) - { - if ( accum > (uintmax_t)INTMAX_MAX + 1 ) - toobig = 1; - } - else - if ( accum > (uintmax_t)INTMAX_MAX ) - toobig = 1; - - if ( toobig ) - { - errno = ERANGE; - return minus ? INTMAX_MIN : INTMAX_MAX; - } - else - return (intmax_t)(minus ? -accum : accum); - } - -long long __attribute__ ((alias ("wcstoimax"))) -wcstoll (const wchar_t* __restrict__ nptr, wchar_t ** __restrict__ endptr, int base); diff --git a/winsup/mingw/mingwex/wcstold.c b/winsup/mingw/mingwex/wcstold.c deleted file mode 100644 index b2fdd742e..000000000 --- a/winsup/mingw/mingwex/wcstold.c +++ /dev/null @@ -1,65 +0,0 @@ -/* Wide char wrapper for strtold - * Revision history: - * 6 Nov 2002 Initial version. - * 25 Aug 2006 Don't use strtold internal functions. - * - * Contributor: Danny Smith <dannysmith@users.sourceforege.net> - */ - - /* This routine has been placed in the public domain.*/ - -#define WIN32_LEAN_AND_MEAN -#include <windows.h> -#include <locale.h> -#include <wchar.h> -#include <stdlib.h> -#include <string.h> -#include <mbstring.h> - -#include "mb_wc_common.h" - -long double wcstold (const wchar_t * __restrict__ wcs, wchar_t ** __restrict__ wcse) -{ - char * cs; - char * cse; - unsigned int i; - long double ret; - const unsigned int cp = get_codepage (); - - /* Allocate enough room for (possibly) mb chars */ - cs = (char *) malloc ((wcslen(wcs)+1) * MB_CUR_MAX); - - if (cp == 0) /* C locale */ - { - for (i = 0; (wcs[i] != 0) && wcs[i] <= 255; i++) - cs[i] = (char) wcs[i]; - cs[i] = '\0'; - } - else - { - int nbytes = -1; - int mb_len = 0; - /* loop through till we hit null or invalid character */ - for (i = 0; (wcs[i] != 0) && (nbytes != 0); i++) - { - nbytes = WideCharToMultiByte(cp, WC_COMPOSITECHECK | WC_SEPCHARS, - wcs + i, 1, cs + mb_len, MB_CUR_MAX, - NULL, NULL); - mb_len += nbytes; - } - cs[mb_len] = '\0'; - } - - ret = strtold (cs, &cse); - - if (wcse) - { - /* Make sure temp mbstring has 0 at cse. */ - *cse = '\0'; - i = _mbslen ((unsigned char*) cs); /* Number of chars, not bytes */ - *wcse = (wchar_t *) wcs + i; - } - free (cs); - - return ret; -} diff --git a/winsup/mingw/mingwex/wcstoumax.c b/winsup/mingw/mingwex/wcstoumax.c deleted file mode 100644 index 9bd6cd704..000000000 --- a/winsup/mingw/mingwex/wcstoumax.c +++ /dev/null @@ -1,113 +0,0 @@ -/* - This source code was extracted from the Q8 package created and - placed in the PUBLIC DOMAIN by Doug Gwyn <gwyn@arl.mil> - - last edit: 1999/11/05 gwyn@arl.mil - - Implements subclause 7.8.2 of ISO/IEC 9899:1999 (E). - - This particular implementation requires the matching <inttypes.h>. - It also assumes that character codes for A..Z and a..z are in - contiguous ascending order; this is true for ASCII but not EBCDIC. -*/ - -#include <wchar.h> -#include <errno.h> -#include <ctype.h> -#include <inttypes.h> - -/* convert digit wide character to number, in any base */ - -#define ToWNumber(c) (iswdigit(c) ? (c) - L'0' : \ - iswupper(c) ? (c) - L'A' + 10 : \ - iswlower(c) ? (c) - L'a' + 10 : \ - -1 /* "invalid" flag */ \ - ) - -/* validate converted digit character for specific base */ -#define valid(n, b) ((n) >= 0 && (n) < (b)) - -uintmax_t -wcstoumax(nptr, endptr, base) - register const wchar_t * __restrict__ nptr; - wchar_t ** __restrict__ endptr; - register int base; - { - register uintmax_t accum; /* accumulates converted value */ - register uintmax_t next; /* for computing next value of accum */ - register int n; /* numeral from digit character */ - int minus; /* set iff minus sign seen (yes!) */ - int toobig; /* set iff value overflows */ - - if ( endptr != NULL ) - *endptr = (wchar_t *)nptr; /* in case no conv performed */ - - if ( base < 0 || base == 1 || base > 36 ) - { - errno = EDOM; - return 0; /* unspecified behavior */ - } - - /* skip initial, possibly empty sequence of white-space w.characters */ - - while ( iswspace(*nptr) ) - ++nptr; - - /* process subject sequence: */ - - /* optional sign */ - - if ( (minus = *nptr == L'-') || *nptr == L'+' ) - ++nptr; - - if ( base == 0 ) - { - if ( *nptr == L'0' ) - { - if ( nptr[1] == L'X' || nptr[1] == L'x' ) - base = 16; - else - base = 8; - } - else - base = 10; - } - /* optional "0x" or "0X" for base 16 */ - - if ( base == 16 && *nptr == L'0' - && (nptr[1] == L'X' || nptr[1] == L'x') - ) - nptr += 2; /* skip past this prefix */ - - /* check whether there is at least one valid digit */ - - n = ToWNumber(*nptr); - ++nptr; - - if ( !valid(n, base) ) - return 0; /* subject seq. not of expected form */ - - accum = n; - - for ( toobig = 0; n = ToWNumber(*nptr), valid(n, base); ++nptr ) - if ( accum > UINTMAX_MAX / base + 1 /* major wrap-around */ - || (next = base * accum + n) < accum /* minor wrap-around */ - ) - toobig = 1; /* but keep scanning */ - else - accum = next; - - if ( endptr != NULL ) - *endptr = (wchar_t *)nptr; /* -> first not-valid-digit */ - - if ( toobig ) - { - errno = ERANGE; - return UINTMAX_MAX; - } - else - return minus ? -accum : accum; /* (yes!) */ - } - -unsigned long long __attribute__ ((alias ("wcstoumax"))) -wcstoull (const wchar_t* __restrict__ nptr, wchar_t ** __restrict__ endptr, int base); diff --git a/winsup/mingw/mingwex/wctob.c b/winsup/mingw/mingwex/wctob.c deleted file mode 100755 index 01a57bf3a..000000000 --- a/winsup/mingw/mingwex/wctob.c +++ /dev/null @@ -1,21 +0,0 @@ -#include "mb_wc_common.h" -#include <wchar.h> -#include <stdio.h> -#include <stdlib.h> -#include <errno.h> -#define WIN32_LEAN_AND_MEAN -#include <windows.h> - -/* Return just the first byte after translating to multibyte. */ -int wctob (wint_t wc ) -{ - wchar_t w = wc; - char c; - int invalid_char = 0; - if (!WideCharToMultiByte (get_codepage(), - 0 /* Is this correct flag? */, - &w, 1, &c, 1, NULL, &invalid_char) - || invalid_char) - return EOF; - return (int) c; -} diff --git a/winsup/mingw/mingwex/wctrans.c b/winsup/mingw/mingwex/wctrans.c deleted file mode 100755 index e129af471..000000000 --- a/winsup/mingw/mingwex/wctrans.c +++ /dev/null @@ -1,60 +0,0 @@ -/* - wctrans.c - 7.25.3.2 Extensible wide-character case mapping functions - - Contributed by: Danny Smith <dannysmith@usesr.sourcefoge.net> - 2005-02-24 - - This source code is placed in the PUBLIC DOMAIN. It is modified - from the Q8 package created by Doug Gwyn <gwyn@arl.mil> - - */ - -#include <string.h> -#include <wctype.h> - -/* - This differs from the MS implementation of wctrans which - returns 0 for tolower and 1 for toupper. According to - C99, a 0 return value indicates invalid input. - - These two function go in the same translation unit so that we - can ensure that - towctrans(wc, wctrans("tolower")) == towlower(wc) - towctrans(wc, wctrans("toupper")) == towupper(wc) - It also ensures that - towctrans(wc, wctrans("")) == wc - which is not required by standard. -*/ - -static const struct { - const char *name; - wctrans_t val; } tmap[] = { - {"tolower", _LOWER}, - {"toupper", _UPPER} - }; - -#define NTMAP (sizeof tmap / sizeof tmap[0]) - -wctrans_t -wctrans (const char* property) -{ - int i; - for ( i = 0; i < NTMAP; ++i ) - if (strcmp (property, tmap[i].name) == 0) - return tmap[i].val; - return 0; -} - -wint_t towctrans (wint_t wc, wctrans_t desc) -{ - switch (desc) - { - case _LOWER: - return towlower (wc); - case _UPPER: - return towupper (wc); - default: - return wc; - } -} diff --git a/winsup/mingw/mingwex/wctype.c b/winsup/mingw/mingwex/wctype.c deleted file mode 100755 index 197fde5f7..000000000 --- a/winsup/mingw/mingwex/wctype.c +++ /dev/null @@ -1,60 +0,0 @@ -/* - wctype.c - 7.25.2.2.2 The wctype function - - Contributed by: Danny Smith <dannysmith@usesr.sourcefoge.net> - 2005-02-24 - - This source code is placed in the PUBLIC DOMAIN. It is modified - from the Q8 package created by Doug Gwyn <gwyn@arl.mil> - - The wctype function constructs a value with type wctype_t that - describes a class of wide characters identified by the string - argument property. - - In particular, we map the property strings so that: - - iswctype(wc, wctype("alnum")) == iswalnum(wc) - iswctype(wc, wctype("alpha")) == iswalpha(wc) - iswctype(wc, wctype("cntrl")) == iswcntrl(wc) - iswctype(wc, wctype("digit")) == iswdigit(wc) - iswctype(wc, wctype("graph")) == iswgraph(wc) - iswctype(wc, wctype("lower")) == iswlower(wc) - iswctype(wc, wctype("print")) == iswprint(wc) - iswctype(wc, wctype("punct")) == iswpunct(wc) - iswctype(wc, wctype("space")) == iswspace(wc) - iswctype(wc, wctype("upper")) == iswupper(wc) - iswctype(wc, wctype("xdigit")) == iswxdigit(wc) - -*/ - -#include <string.h> -#include <wctype.h> - -/* Using the bit-OR'd ctype character classification flags as return - values achieves compatibility with MS iswctype(). */ -static const struct { - const char *name; - wctype_t flags;} cmap[] = { - {"alnum", _ALPHA|_DIGIT}, - {"alpha", _ALPHA}, - {"cntrl", _CONTROL}, - {"digit", _DIGIT}, - {"graph", _PUNCT|_ALPHA|_DIGIT}, - {"lower", _LOWER}, - {"print", _BLANK|_PUNCT|_ALPHA|_DIGIT}, - {"punct", _PUNCT}, - {"space", _SPACE}, - {"upper", _UPPER}, - {"xdigit", _HEX} - }; - -#define NCMAP (sizeof cmap / sizeof cmap[0]) -wctype_t wctype (const char *property) -{ - int i; - for (i = 0; i < NCMAP; ++i) - if (strcmp (property, cmap[i].name) == 0) - return cmap[i].flags; - return 0; -} diff --git a/winsup/mingw/mingwex/wdirent.c b/winsup/mingw/mingwex/wdirent.c deleted file mode 100644 index 6dcf42bd5..000000000 --- a/winsup/mingw/mingwex/wdirent.c +++ /dev/null @@ -1,5 +0,0 @@ -#define _UNICODE 1 -#define UNICODE 1 - -#include <wchar.h> -#include "dirent.c" diff --git a/winsup/mingw/mingwex/wmemchr.c b/winsup/mingw/mingwex/wmemchr.c deleted file mode 100644 index dc5cedd23..000000000 --- a/winsup/mingw/mingwex/wmemchr.c +++ /dev/null @@ -1,28 +0,0 @@ -/* This source code was extracted from the Q8 package created and placed - in the PUBLIC DOMAIN by Doug Gwyn <gwyn@arl.mil> - last edit: 1999/11/05 gwyn@arl.mil - - Implements subclause 7.24 of ISO/IEC 9899:1999 (E). - - It supports an encoding where all char codes are mapped - to the *same* code values within a wchar_t or wint_t, - so long as no other wchar_t codes are used by the program. - -*/ - -#include <wchar.h> - -wchar_t* -wmemchr(s, c, n) - register const wchar_t *s; - register wchar_t c; - register size_t n; - { - if ( s != NULL ) - for ( ; n > 0; ++s, --n ) - if ( *s == c ) - return (wchar_t *)s; - - return NULL; - } - diff --git a/winsup/mingw/mingwex/wmemcmp.c b/winsup/mingw/mingwex/wmemcmp.c deleted file mode 100644 index e1e034c7b..000000000 --- a/winsup/mingw/mingwex/wmemcmp.c +++ /dev/null @@ -1,32 +0,0 @@ -/* This source code was extracted from the Q8 package created and placed - in the PUBLIC DOMAIN by Doug Gwyn <gwyn@arl.mil> - last edit: 1999/11/05 gwyn@arl.mil - - Implements subclause 7.24 of ISO/IEC 9899:1999 (E). - - It supports an encoding where all char codes are mapped - to the *same* code values within a wchar_t or wint_t, - so long as no other wchar_t codes are used by the program. - -*/ - -#include <wchar.h> - -int -wmemcmp(s1, s2, n) - register const wchar_t *s1; - register const wchar_t *s2; - size_t n; - { - if ( n == 0 || s1 == s2 ) - return 0; /* even for NULL pointers */ - - if ( (s1 != NULL) != (s2 != NULL) ) - return s2 == NULL ? 1 : -1; /* robust */ - - for ( ; n > 0; ++s1, ++s2, --n ) - if ( *s1 != *s2 ) - return *s1 - *s2; - - return 0; - } diff --git a/winsup/mingw/mingwex/wmemcpy.c b/winsup/mingw/mingwex/wmemcpy.c deleted file mode 100644 index d7e7b4cb3..000000000 --- a/winsup/mingw/mingwex/wmemcpy.c +++ /dev/null @@ -1,32 +0,0 @@ -/* This source code was extracted from the Q8 package created and placed - in the PUBLIC DOMAIN by Doug Gwyn <gwyn@arl.mil> - last edit: 1999/11/05 gwyn@arl.mil - - Implements subclause 7.24 of ISO/IEC 9899:1999 (E). - - It supports an encoding where all char codes are mapped - to the *same* code values within a wchar_t or wint_t, - so long as no other wchar_t codes are used by the program. - -*/ - -#include <wchar.h> - - -wchar_t * -wmemcpy(s1, s2, n) - register wchar_t * __restrict__ s1; - register const wchar_t * __restrict__ s2; - register size_t n; - { - wchar_t *orig_s1 = s1; - - if ( s1 == NULL || s2 == NULL || n == 0 ) - return orig_s1; /* robust */ - - for ( ; n > 0; --n ) - *s1++ = *s2++; - - return orig_s1; - } - diff --git a/winsup/mingw/mingwex/wmemmove.c b/winsup/mingw/mingwex/wmemmove.c deleted file mode 100644 index 3c545ac32..000000000 --- a/winsup/mingw/mingwex/wmemmove.c +++ /dev/null @@ -1,43 +0,0 @@ -/* This source code was extracted from the Q8 package created and placed - in the PUBLIC DOMAIN by Doug Gwyn <gwyn@arl.mil> - last edit: 1999/11/05 gwyn@arl.mil - - Implements subclause 7.24 of ISO/IEC 9899:1999 (E). - - It supports an encoding where all char codes are mapped - to the *same* code values within a wchar_t or wint_t, - so long as no other wchar_t codes are used by the program. - -*/ - -#include <errno.h> -#include <stdio.h> -#include <stdlib.h> -#include <wchar.h> - -wchar_t * -wmemmove(s1, s2, n) - register wchar_t *s1; - register const wchar_t *s2; - register size_t n; - { - wchar_t *orig_s1 = s1; - - if ( s1 == NULL || s2 == NULL || n == 0 ) - return orig_s1; /* robust */ - - /* XXX -- The following test works only within a flat address space! */ - if ( s2 >= s1 ) - for ( ; n > 0; --n ) - *s1++ = *s2++; - else { - s1 += n; - s2 += n; - - for ( ; n > 0; --n ) - *--s1 = *--s2; - } - - return orig_s1; - } - diff --git a/winsup/mingw/mingwex/wmemset.c b/winsup/mingw/mingwex/wmemset.c deleted file mode 100644 index dadd9fb07..000000000 --- a/winsup/mingw/mingwex/wmemset.c +++ /dev/null @@ -1,30 +0,0 @@ -/* This source code was extracted from the Q8 package created and placed - in the PUBLIC DOMAIN by Doug Gwyn <gwyn@arl.mil> - last edit: 1999/11/05 gwyn@arl.mil - - Implements subclause 7.24 of ISO/IEC 9899:1999 (E). - - It supports an encoding where all char codes are mapped - to the *same* code values within a wchar_t or wint_t, - so long as no other wchar_t codes are used by the program. - -*/ - -#include <wchar.h> - - -wchar_t * -wmemset(s, c, n) - register wchar_t *s; - register wchar_t c; - register size_t n; - { - wchar_t *orig_s = s; - - if ( s != NULL ) - for ( ; n > 0; --n ) - *s++ = c; - - return orig_s; - } - diff --git a/winsup/mingw/mingwex/wtoll.c b/winsup/mingw/mingwex/wtoll.c deleted file mode 100644 index 0bff278d1..000000000 --- a/winsup/mingw/mingwex/wtoll.c +++ /dev/null @@ -1,3 +0,0 @@ -#include <stdlib.h> -long long wtoll(const wchar_t * _w) - { return _wtoi64 (_w); } diff --git a/winsup/mingw/mkinstalldirs b/winsup/mingw/mkinstalldirs deleted file mode 100755 index cc8783edc..000000000 --- a/winsup/mingw/mkinstalldirs +++ /dev/null @@ -1,36 +0,0 @@ -#! /bin/sh -# mkinstalldirs --- make directory hierarchy -# Author: Noah Friedman <friedman@prep.ai.mit.edu> -# Created: 1993-05-16 -# Last modified: 1994-03-25 -# Public domain - -errstatus=0 - -for file in ${1+"$@"} ; do - set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` - shift - - pathcomp= - for d in ${1+"$@"} ; do - pathcomp="$pathcomp$d" - case "$pathcomp" in - -* ) pathcomp=./$pathcomp ;; - esac - - if test ! -d "$pathcomp"; then - echo "mkdir $pathcomp" 1>&2 - mkdir "$pathcomp" > /dev/null 2>&1 || lasterr=$? - fi - - if test ! -d "$pathcomp"; then - errstatus=$lasterr - fi - - pathcomp="$pathcomp/" - done -done - -exit $errstatus - -# mkinstalldirs ends here diff --git a/winsup/mingw/moldname.def.in b/winsup/mingw/moldname.def.in deleted file mode 100644 index b8bae6bb0..000000000 --- a/winsup/mingw/moldname.def.in +++ /dev/null @@ -1,154 +0,0 @@ -; -; __FILENAME__ -; -; Exports from the runtime except that these exports are actually preceeded -; by a underscore in the actual DLL. These correspond to functions which -; are non-ANSI and were prefixed with an underscore to avoid name space -; clutter. However many, in fact most programs still use a few of these -; functions without the underscore. This .def file is specially processed -; to make those non-underscored name function calls call the equivalent -; underscored functions. -; -; Contributors: -; Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp> -; Maintained by Mumit Khan <khan@xraylith.wisc.edu> -; -; THIS SOFTWARE IS NOT COPYRIGHTED -; -; This source code is offered for use in the public domain. You may -; use, modify or distribute it freely. -; -; This code is distributed in the hope that it will be useful but -; WITHOUT ANY WARRANTY. ALL WARRENTIES, EXPRESS OR IMPLIED ARE HEREBY -; DISCLAMED. This includes but is not limited to warrenties of -; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -; -EXPORTS -access -chdir -chmod -chsize -close -creat -cwait -#if !(__CRTDLL__) -daylight DATA -#endif -dup -dup2 -ecvt -eof -execl -execle -execlp -execlpe -execv -execve -execvp -execvpe -fcvt -fdopen -fgetchar -fgetwchar -filelength -fileno -; Alias fpreset is set in CRT_fp10,c and CRT_fp8.c. -; fpreset -fputchar -fputwchar -fstat -ftime -gcvt -getch -getche -getcwd -getpid -getw -heapwalk -isatty -itoa -kbhit -lfind -lsearch -lseek -ltoa -memccpy -memicmp -mkdir -mktemp -open -pclose -popen -putch -putenv -putw -read -rmdir -rmtmp -searchenv -setmode -sopen -spawnl -spawnle -spawnlp -spawnlpe -spawnv -spawnve -spawnvp -spawnvpe -stat -strcmpi -strdup -stricmp -stricoll -strlwr -strnicmp -strnset -strrev -strset -strupr -swab -tell -tempnam -#if !(__CRTDLL__) -timezone DATA -#endif -; export tzname for both. See <time.h> -tzname DATA -tzset -umask -ungetch -unlink -utime -wcsdup -wcsicmp -wcsicoll -wcslwr -wcsnicmp -wcsnset -wcsrev -wcsset -wcsupr -#if !(__CRTDLL__) -wpopen -#endif -write -; non-ANSI functions declared in math.h -j0 -j1 -jn -y0 -y1 -yn -chgsign -; omit scalb... -; it would conflict with the GCC built-in, which exhibits -; semantics differing from the MSVCRT implementation. -;scalb -finite -fpclass -; C99 functions -cabs -hypot -logb -nextafter diff --git a/winsup/mingw/msvcrt.def.in b/winsup/mingw/msvcrt.def.in deleted file mode 100644 index d9ce11e41..000000000 --- a/winsup/mingw/msvcrt.def.in +++ /dev/null @@ -1,826 +0,0 @@ -; -; __FILENAME__ -; created from msvcrt.def.in -;* This file has no copyright assigned and is placed in the Public Domain. -;* This file is a part of the mingw-runtime package. -;* No warranty is given; refer to the file DISCLAIMER within the package. -; -; Exports from msvcrt.dll, msvcr70.dll, msvcr71.dll, msvcr80.dll and msvcr90.dll -; -; NOTE: All exports, except for what appeared to be C++ mangled names, -; are included. Not all functions have prototypes in the headers -; (and some are not functions at all). -; -EXPORTS -_CIacos -_CIasin -_CIatan -_CIatan2 -_CIcos -_CIcosh -_CIexp -_CIfmod -_CIlog -_CIlog10 -_CIpow -_CIsin -_CIsinh -_CIsqrt -_CItan -_CItanh -_CxxThrowException -_EH_prolog -_Getdays -_Getmonths -_Gettnames -_HUGE DATA -_Strftime -_XcptFilter -__CxxFrameHandler -__CxxLongjmpUnwind -__RTCastToVoid -__RTDynamicCast -__RTtypeid -__STRINGTOLD -__argc DATA -__argv DATA -__badioinfo DATA -__crtCompareStringA -__crtGetLocaleInfoW -__crtLCMapStringA -__dllonexit -__doserrno -__fpecode -__getmainargs -__initenv DATA -__isascii -__iscsym -__iscsymf -__lc_codepage DATA -__lc_handle DATA -__lconv_init -__mb_cur_max DATA -__p___argc -__p___argv -__p___initenv -__p___mb_cur_max -__p___wargv -__p___winitenv -__p__acmdln -__p__amblksiz -__p__commode -__p__daylight -__p__dstbias -__p__environ -__p__fileinfo -__p__fmode -__p__iob -__p__mbctype -__p__osver -__p__pctype -__p__pgmptr -__p__pwctype -__p__timezone -__p__tzname -__p__wcmdln -__p__wenviron -__p__winmajor -__p__winminor -__p__winver -__p__wpgmptr -__pioinfo DATA -__pxcptinfoptrs -__set_app_type -__setlc_active DATA -__setusermatherr -__threadhandle -__threadid -__toascii -__unDName -__unguarded_readlc_active DATA -__wargv DATA -__wgetmainargs -__winitenv DATA -_abnormal_termination -_access -_acmdln DATA -_adj_fdiv_m16i -_adj_fdiv_m32 -_adj_fdiv_m32i -_adj_fdiv_m64 -_adj_fdiv_r -_adj_fdivr_m16i -_adj_fdivr_m32 -_adj_fdivr_m32i -_adj_fdivr_m64 -_adj_fpatan -_adj_fprem -_adj_fprem1 -_adj_fptan -_adjust_fdiv DATA -_aexit_rtn DATA -_amsg_exit -_assert -_atodbl -_atoi64 -_atoldbl -_beep -_beginthread -_beginthreadex -_c_exit -_cabs -_callnewh -_cexit -_cgets -_chdir -_chdrive -_chgsign -_chmod -_chsize -_clearfp -_close -_commit -_commode DATA -_control87 -_controlfp -_copysign -_cprintf -_cputs -_creat -_cscanf -#if !(__msvcr71__ || __msvcr71d__ || __msvcr80__ || __msvcr80d__ || __msvcr90__ || msvcr90d__) -_ctype DATA -#endif -_cwait -_daylight DATA -_dstbias DATA -_dup -_dup2 -_ecvt -_endthread -_endthreadex -_environ DATA -_eof -_errno -_except_handler2 -_except_handler3 -_execl -_execle -_execlp -_execlpe -_execv -_execve -_execvp -_execvpe -_exit -_expand -_fcloseall -_fcvt -_fdopen -_fgetchar -_fgetwchar -_filbuf -_fileinfo DATA -_filelength -_filelengthi64 -_fileno -_findclose -_findfirst -_findfirsti64 -_findnext -_findnexti64 -_finite -_flsbuf -_flushall -_fmode DATA -_fpclass -_fpieee_flt -_fpreset DATA -_fputchar -_fputwchar -_fsopen -_fstat -_fstati64 -_ftime -_ftol -_fullpath -_futime -_gcvt -_get_osfhandle -_get_sbh_threshold -_getch -_getche -_getcwd -_getdcwd -_getdiskfree -_getdllprocaddr -_getdrive -_getdrives -_getmaxstdio -_getmbcp -_getpid -_getsystime -_getw -_getws -_global_unwind2 -_heapadd -_heapchk -_heapmin -_heapset -_heapused -_heapwalk -_hypot -_i64toa -_i64tow -_initterm -_inp -_inpd -_inpw -_iob DATA -_isatty -_isctype -_ismbbalnum -_ismbbalpha -_ismbbgraph -_ismbbkalnum -_ismbbkana -_ismbbkprint -_ismbbkpunct -_ismbblead -_ismbbprint -_ismbbpunct -_ismbbtrail -_ismbcalnum -_ismbcalpha -_ismbcdigit -_ismbcgraph -_ismbchira -_ismbckata -_ismbcl0 -_ismbcl1 -_ismbcl2 -_ismbclegal -_ismbclower -_ismbcprint -_ismbcpunct -_ismbcspace -_ismbcsymbol -_ismbcupper -_ismbslead -_ismbstrail -_isnan -_itoa -_itow -_j0 -_j1 -_jn -_kbhit -_lfind -_loaddll -_local_unwind2 -_lock -_locking -_logb -_longjmpex -_lrotl -_lrotr -_lsearch -_lseek -_lseeki64 -_ltoa -_ltow -_makepath -_mbbtombc -_mbbtype -_mbccpy -_mbcjistojms -_mbcjmstojis -_mbclen -_mbctohira -_mbctokata -_mbctolower -_mbctombb -_mbctoupper -_mbctype DATA -_mbsbtype -_mbscat -_mbschr -_mbscmp -_mbscoll -_mbscpy -_mbscspn -_mbsdec -_mbsdup -_mbsicmp -_mbsicoll -_mbsinc -_mbslen -_mbslwr -_mbsnbcat -_mbsnbcmp -_mbsnbcnt -_mbsnbcoll -_mbsnbcpy -_mbsnbicmp -_mbsnbicoll -_mbsnbset -_mbsncat -_mbsnccnt -_mbsncmp -_mbsncoll -_mbsncpy -_mbsnextc -_mbsnicmp -_mbsnicoll -_mbsninc -_mbsnset -_mbspbrk -_mbsrchr -_mbsrev -_mbsset -_mbsspn -_mbsspnp -_mbsstr -_mbstok -_mbstrlen -_mbsupr -_memccpy -_memicmp -_mkdir -_mktemp -_msize -_nextafter -_onexit DATA -_open -_open_osfhandle -_osver DATA -_outp -_outpd -_outpw -_pclose -_pctype DATA -_pgmptr DATA -_pipe -_popen -_purecall -_putch -_putenv -_putw -_putws -_pwctype DATA -_read -_rmdir -_rmtmp -_rotl -_rotr -_safe_fdiv -_safe_fdivr -_safe_fprem -_safe_fprem1 -_scalb -_searchenv -_seh_longjmp_unwind -_set_error_mode -_set_sbh_threshold -_seterrormode -_setjmp -_setjmp3 -_setmaxstdio -_setmbcp -_setmode -_setsystime -_sleep -_snprintf -_snwprintf -_sopen -_spawnl -_spawnle -_spawnlp -_spawnlpe -_spawnv -_spawnve -_spawnvp -_spawnvpe -_splitpath -_stat -_stati64 -_statusfp -_strcmpi -_strdate -_strdup -_strerror -_stricmp -_stricoll -_strlwr -_strncoll -_strnicmp -_strnicoll -_strnset -_strrev -_strset -_strtime -_strupr -_swab -_sys_errlist DATA -_sys_nerr DATA -_tell -_telli64 -_tempnam -_timezone DATA -_tolower -_toupper -_tzname DATA -_tzset -_ui64toa -_ui64tow -_ultoa -_ultow -_umask -_ungetch -_unlink -_unloaddll -_unlock -_utime -_vsnprintf -_vsnwprintf -_waccess -_wasctime -_wchdir -_wchmod -_wcmdln DATA -_wcreat -_wcsdup -_wcsicmp -_wcsicoll -_wcslwr -_wcsncoll -_wcsnicmp -_wcsnicoll -_wcsnset -_wcsrev -_wcsset -_wcsupr -_wctime -_wenviron DATA -_wexecl -_wexecle -_wexeclp -_wexeclpe -_wexecv -_wexecve -_wexecvp -_wexecvpe -_wfdopen -_wfindfirst -_wfindfirsti64 -_wfindnext -_wfindnexti64 -_wfopen -_wfreopen -_wfsopen -_wfullpath -_wgetcwd -_wgetdcwd -_wgetenv -_winmajor DATA -_winminor DATA -_winver DATA -_wmakepath -_wmkdir -_wmktemp -_wopen -_wperror -_wpgmptr DATA -_wpopen -_wputenv -_wremove -_wrename -_write -_wrmdir -_wsearchenv -_wsetlocale -_wsopen -_wspawnl -_wspawnle -_wspawnlp -_wspawnlpe -_wspawnv -_wspawnve -_wspawnvp -_wspawnvpe -_wsplitpath -_wstat -_wstati64 -_wstrdate -_wstrtime -_wsystem -_wtempnam -_wtmpnam -_wtoi -_wtoi64 -_wtol -_wunlink -_wutime -_y0 -_y1 -_yn -abort -abs -acos -asctime -asin -atan -atan2 -atexit DATA -atof -atoi -atol -bsearch -calloc -ceil -clearerr -clock -cos -cosh -ctime -difftime -div -exit -exp -fabs -fclose -feof -ferror -fflush -fgetc -fgetpos -fgets -fgetwc -fgetws -floor -fmod -fopen -fprintf -fputc -fputs -fputwc -fputws -fread -free -freopen -frexp -fscanf -fseek -fsetpos -ftell -fwprintf -fwrite -fwscanf -getc -getchar -getenv -gets -getwc -getwchar -gmtime -is_wctype -isalnum -isalpha -iscntrl -isdigit -isgraph -isleadbyte -islower -isprint -ispunct -isspace -isupper -iswalnum -iswalpha -iswascii -iswcntrl -iswctype -iswdigit -iswgraph -iswlower -iswprint -iswpunct -iswspace -iswupper -iswxdigit -isxdigit -labs -ldexp -ldiv -localeconv -localtime -log -log10 -longjmp -malloc -mblen -mbstowcs -mbtowc -memchr -memcmp -memcpy -memmove -memset -mktime -modf -perror -pow -printf -putc -putchar -puts -putwc -putwchar -qsort -raise -rand -realloc -remove -rename -rewind -scanf -setbuf -setlocale -setvbuf -signal -sin -sinh -sprintf -sqrt -srand -sscanf -strcat -strchr -strcmp -strcoll -strcpy -strcspn -strerror -strftime -strlen -strncat -strncmp -strncpy -strpbrk -strrchr -strspn -strstr -strtod -strtok -strtol -strtoul -strxfrm -swprintf -swscanf -system -tan -tanh -time -tmpfile -tmpnam -tolower -toupper -towlower -towupper -ungetc -ungetwc -vfprintf -vfwprintf -vprintf -vsprintf -vswprintf -vwprintf -wcscat -wcschr -wcscmp -wcscoll -wcscpy -wcscspn -wcsftime -wcslen -wcsncat -wcsncmp -wcsncpy -wcspbrk -wcsrchr -wcsspn -wcsstr -wcstod -wcstok -wcstol -wcstombs -wcstoul -wcsxfrm -wctomb -wprintf -wscanf -; msvcrt.dll(version 6.10) and later -__lc_collate_cp DATA -__p__mbcasemap -__unDNameEx -_chkesp -_ctime64 -_findfirst64 -_findnext64 -_fstat64 -_ftime64 -_futime64 -_gmtime64 -_localtime64 -_mbcasemap -_mktime64 -_osplatform DATA -_stat64 -_time64 -_utime64 -_wctime64 -_wfindfirst64 -_wfindnext64 -_wstat64 -_wutime64 -; msvcrt.dll (file version 7.0.xxxx, as shipped with XP) -___lc_codepage_func -___lc_collate_cp_func -___lc_handle_func -___mb_cur_max_func -___setlc_active_func -___unguarded_readlc_active_add_func -__crtCompareStringW -__crtGetStringTypeW -__crtLCMapStringW -__pctype_func -__pwctype_func -__iob_func -__uncaught_exception -__wcserror -__CxxDetectRethrow -__CxxExceptionFilter -__CxxQueryExceptionSize -__CxxRegisterExceptionObject -__CxxUnregisterExceptionObject -__CxxCallUnwindDtor -__DestructExceptionObject -_aligned_free -_aligned_malloc -_aligned_offset_malloc -_aligned_offset_realloc -_aligned_realloc -_cgetws -_cputws -_cwprintf -_cwscanf -_getwch -_getwche -_putwch -_resetstkoflw -_scprintf -_scwprintf -_set_SSE2_enable -_snscanf -_snwscanf -_strtoi64 -_strtoui64 -_ungetwch -_vscprintf -_vscwprintf -_wcserror -_wcstoi64 -_wcstoui64 -_wctype -_wtof -_get_heap_handle -#if ( __msvcr70__ || __msvcr70d__ || __msvcr71__ || __msvcr71d__ || __msvcr80__ || __msvcr80d__ || __msvcr90__ || __msvcr90d__) -; msvcr70.dll and later -__buffer_overrun -__lc_clike -__security_error_handler -__set_buffer_overrun_handler -_CRT_RTC_INIT -_set_security_error_handler -#endif /* 7.0 */ -#if (__msvcr71__ || __msvcr71d__ || __msvcr80__ || __msvcr80d__ || __msvcr90__ || __msvcr90d__) -; msvcr71.dll -__CppXcptFilter -__CxxCallUnwindVecDtor -_set_purecall_handler -#endif /* 7.1 */ -#if ( __msvcr80__ || __msvcr80d__ || __msvcr90__ || __msvcr90d__) -; msvcr80.dll -_get_output_format -_set_output_format -_get_printf_count_output -_set_printf_count_output -_set_abort_behavior -_set_invalid_parameter_handler -_fseek_nolock -_ftell_nolock -_fseeki64 -_ftelli64 -_fseeki64_nolock -_ftelli64_nolock -#endif /* 8.0 */ diff --git a/winsup/mingw/mthr.c b/winsup/mingw/mthr.c deleted file mode 100644 index f28236432..000000000 --- a/winsup/mingw/mthr.c +++ /dev/null @@ -1,197 +0,0 @@ -/* - * mthr.c - * - * Implement Mingw thread-support DLL . - * - * This file is used iff the following conditions are met: - * - gcc uses -mthreads option - * - user code uses C++ exceptions - * - * The sole job of the Mingw thread support DLL (MingwThr) is to catch - * all the dying threads and clean up the data allocated in the TLSs - * for exception contexts during C++ EH. Posix threads have key dtors, - * but win32 TLS keys do not, hence the magic. Without this, there's at - * least `6 * sizeof (void*)' bytes leaks for each catch/throw in each - * thread. The only public interface is __mingwthr_key_dtor(). - * - * Created by Mumit Khan <khan@nanotech.wisc.edu> - * - */ - -#define WIN32_LEAN_AND_MEAN -#include <windows.h> -#undef WIN32_LEAN_AND_MEAN -#include <stdlib.h> - -/* To protect the thread/key association data structure modifications. */ -CRITICAL_SECTION __mingwthr_cs; - -typedef struct __mingwthr_key __mingwthr_key_t; - -/* The list of threads active with key/dtor pairs. */ -struct __mingwthr_key { - DWORD key; - void (*dtor) (void *); - __mingwthr_key_t *next; -}; - - -static __mingwthr_key_t *key_dtor_list; - -/* - * __mingwthr_key_add: - * - * Add key/dtor association for this thread. If the thread entry does not - * exist, create a new one and add to the head of the threads list; add - * the new assoc at the head of the keys list. - * - */ - -static int -___mingwthr_add_key_dtor ( DWORD key, void (*dtor) (void *)) -{ - __mingwthr_key_t *new_key; - - new_key = (__mingwthr_key_t *) calloc (1, sizeof (__mingwthr_key_t)); - if (new_key == NULL) - return -1; - - new_key->key = key; - new_key->dtor = dtor; - - EnterCriticalSection (&__mingwthr_cs); - - new_key->next = key_dtor_list; - key_dtor_list = new_key; - - LeaveCriticalSection (&__mingwthr_cs); - -#ifdef DEBUG - printf ("%s: allocating: (%ld, %x)\n", - __FUNCTION__, key, dtor); -#endif - - return 0; -} - -static int -___mingwthr_remove_key_dtor ( DWORD key ) -{ - __mingwthr_key_t *prev_key; - __mingwthr_key_t *cur_key; - - EnterCriticalSection (&__mingwthr_cs); - - prev_key = NULL; - cur_key = key_dtor_list; - - while( cur_key != NULL ) - { - if( cur_key->key == key ) - { -// take key/dtor out of list - if( prev_key == NULL ) - { - key_dtor_list = cur_key->next; - } - else - { - prev_key->next = cur_key->next; - } - -#ifdef DEBUG - printf ("%s: removing: (%ld)\n", - __FUNCTION__, key ); -#endif - - free( cur_key ); - break; - } - - prev_key = cur_key; - cur_key = cur_key->next; - } - - LeaveCriticalSection (&__mingwthr_cs); - - return 0; -} - -/* - * __mingwthr_run_key_dtors (void): - * - * Callback from DllMain when thread detaches to clean up the key - * storage. - * - * Note that this does not delete the key itself, but just runs - * the dtor if the current value are both non-NULL. Note that the - * keys with NULL dtors are not added by __mingwthr_key_dtor, the - * only public interface, so we don't need to check. - * - */ - -void -__mingwthr_run_key_dtors (void) -{ - __mingwthr_key_t *keyp; - -#ifdef DEBUG - printf ("%s: Entering Thread id %ld\n", __FUNCTION__, GetCurrentThreadId() ); -#endif - - EnterCriticalSection (&__mingwthr_cs); - - for (keyp = key_dtor_list; keyp; ) - { - LPVOID value = TlsGetValue (keyp->key); - if (GetLastError () == ERROR_SUCCESS) - { -#ifdef DEBUG - printf (" (%ld, %x)\n", keyp->key, keyp->dtor); -#endif - if (value) - (*keyp->dtor) (value); - } -#ifdef DEBUG - else - { - printf (" TlsGetValue FAILED (%ld, %x)\n", - keyp->key, keyp->dtor); - } -#endif - keyp = keyp->next; - } - - LeaveCriticalSection (&__mingwthr_cs); - -#ifdef DEBUG - printf ("%s: Exiting Thread id %ld\n", __FUNCTION__, GetCurrentThreadId() ); -#endif -} - -/* - * __mingwthr_register_key_dtor (DWORD key, void (*dtor) (void *)) - * - * Public interface called by C++ exception handling mechanism in - * libgcc (cf: __gthread_key_create). - * - */ - -__declspec(dllexport) -int -__mingwthr_key_dtor (DWORD key, void (*dtor) (void *)) -{ - if (dtor) - { - return ___mingwthr_add_key_dtor (key, dtor); - } - - return 0; -} - -__declspec(dllexport) -int -__mingwthr_remove_key_dtor (DWORD key ) -{ - return ___mingwthr_remove_key_dtor ( key ); -} diff --git a/winsup/mingw/mthr_init.c b/winsup/mingw/mthr_init.c deleted file mode 100644 index 5c8c8bbe8..000000000 --- a/winsup/mingw/mthr_init.c +++ /dev/null @@ -1,80 +0,0 @@ -/* - * mthr_init.c - * - * Do the thread-support DLL initialization. - * - * This file is used iff the following conditions are met: - * - gcc uses -mthreads option - * - user code uses C++ exceptions - * - * The sole job of the Mingw thread support DLL (MingwThr) is to catch - * all the dying threads and clean up the data allocated in the TLSs - * for exception contexts during C++ EH. Posix threads have key dtors, - * but win32 TLS keys do not, hence the magic. Without this, there's at - * least `24 * sizeof (void*)' bytes leaks for each catch/throw in each - * thread. - * - * See mthr.c for all the magic. - * - * Created by Mumit Khan <khan@nanotech.wisc.edu> - * - */ - -#define WIN32_LEAN_AND_MEAN -#include <windows.h> -#undef WIN32_LEAN_AND_MEAN -#include <stdio.h> - -BOOL APIENTRY DllMain (HANDLE hDllHandle, DWORD reason, - LPVOID reserved /* Not used. */ ); - -/* - *---------------------------------------------------------------------- - * - * DllMain -- - * - * This routine is called by the Mingw32, Cygwin32 or VC++ C run - * time library init code, or the Borland DllEntryPoint routine. It - * is responsible for initializing various dynamically loaded - * libraries. - * - * Results: - * TRUE on sucess, FALSE on failure. - * - * Side effects: - * - *---------------------------------------------------------------------- - */ -BOOL APIENTRY -DllMain (HANDLE hDllHandle /* Library instance handle. */, - DWORD reason /* Reason this function is being called. */, - LPVOID reserved /* Not used. */) -{ - - extern CRITICAL_SECTION __mingwthr_cs; - extern void __mingwthr_run_key_dtors( void ); - -#ifdef DEBUG - printf ("%s: reason %d\n", __FUNCTION__, reason ); -#endif - - switch (reason) - { - case DLL_PROCESS_ATTACH: - InitializeCriticalSection (&__mingwthr_cs); - break; - - case DLL_PROCESS_DETACH: - __mingwthr_run_key_dtors(); - DeleteCriticalSection (&__mingwthr_cs); - break; - - case DLL_THREAD_ATTACH: - break; - - case DLL_THREAD_DETACH: - __mingwthr_run_key_dtors(); - break; - } - return TRUE; -} diff --git a/winsup/mingw/mthr_stub.c b/winsup/mingw/mthr_stub.c deleted file mode 100644 index e337b9a1c..000000000 --- a/winsup/mingw/mthr_stub.c +++ /dev/null @@ -1,44 +0,0 @@ -/* - * mthr_stub.c - * - * Implement Mingw thread-support stubs for single-threaded C++ apps. - * - * This file is used by if gcc is built with --enable-threads=win32 and - * iff gcc does *NOT* use -mthreads option. - * - * The -mthreads implementation is in mthr.c. - * - * Created by Mumit Khan <khan@nanotech.wisc.edu> - * - */ - -#define WIN32_LEAN_AND_MEAN -#include <windows.h> -#undef WIN32_LEAN_AND_MEAN - -/* - * __mingwthr_register_key_dtor (DWORD key, void (*dtor) (void *)) - * - * Public interface called by C++ exception handling mechanism in - * libgcc (cf: __gthread_key_create). - * No-op versions. - */ - -int -__mingwthr_key_dtor (DWORD key, void (*dtor) (void *)) -{ -#ifdef DEBUG - printf ("%s: ignoring key: (%ld) / dtor: (%x)\n", - __FUNCTION__, key, dtor); -#endif - return 0; -} - -int -__mingwthr_remove_key_dtor (DWORD key ) -{ -#ifdef DEBUG - printf ("%s: ignoring key: (%ld)\n", __FUNCTION__, key ); -#endif - return 0; -} diff --git a/winsup/mingw/ofmt_stub.s b/winsup/mingw/ofmt_stub.s deleted file mode 100644 index 388dcb45d..000000000 --- a/winsup/mingw/ofmt_stub.s +++ /dev/null @@ -1,40 +0,0 @@ -/* ofmt_stub.s - * - * $Id$ - * - * A trivial stub, to replace the _get_output_format() function. - * - * _pformat() requires this function, which is provided by MSVCRT runtimes - * from msvcr80.dll onwards; add this stub to the import libraries for earlier - * versions of MSVCRT, (those which do not already advertise availability of - * any exported _get_output_format() function); this will permit _pformat() - * to transparently interoperate with all supported versions of MSVCRT. - * (Likewise for CRTDLL). - * - * Written by Keith Marshall <keithmarshall@users.sourceforge.net> - * Contributed to the MinGW Project, and hereby assigned to the public domain. - * - * This is free software. It is provided AS IS, in the hope that it may be - * useful. There is NO WARRANTY OF ANY KIND, not even an implied warranty of - * merchantability, nor of fitness for any particular purpose. - * - */ - .text - .p2align 1,,4 - -.globl __get_output_format - .def __get_output_format; .scl 2; .type 32; .endef - -__get_output_format: -/* - * int _get_output_format( void ); - * - * Implementation is trivial: we immediately return zero, thus matching the - * default behaviour of Microsoft's own implementation, in the absence of any - * preceding call to _set_output_format(); (if we are using this stub, then - * that entire API is unsupported, so no such prior call is possible). - */ - xorl %eax, %eax - ret - -/* $RCSfile$Revision$: end of file */ diff --git a/winsup/mingw/profile/COPYING b/winsup/mingw/profile/COPYING deleted file mode 100755 index 60549be51..000000000 --- a/winsup/mingw/profile/COPYING +++ /dev/null @@ -1,340 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc. - 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Library General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - <one line to give the program's name and a brief idea of what it does.> - Copyright (C) 19yy <name of author> - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) 19yy name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - <signature of Ty Coon>, 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Library General -Public License instead of this License. diff --git a/winsup/mingw/profile/CYGWIN_LICENSE b/winsup/mingw/profile/CYGWIN_LICENSE deleted file mode 100755 index 7c6adad80..000000000 --- a/winsup/mingw/profile/CYGWIN_LICENSE +++ /dev/null @@ -1,38 +0,0 @@ --------------------------------------------------------------------------- -This program is free software; you can redistribute it and/or modify it -under the terms of the GNU General Public License (GPL) as published by -the Free Software Foundation; either version 2 of the License, or (at -your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --------------------------------------------------------------------------- - - *** NOTE *** - -In accordance with section 10 of the GPL, Red Hat permits programs whose -sources are distributed under a license that complies with the Open -Source definition to be linked with libcygwin.a without libcygwin.a -itself causing the resulting program to be covered by the GNU GPL. - -This means that you can port an Open Source(tm) application to cygwin, -and distribute that executable as if it didn't include a copy of -libcygwin.a linked into it. Note that this does not apply to the cygwin -DLL itself. If you distribute a (possibly modified) version of the DLL -you must adhere to the terms of the GPL, i.e. you must provide sources -for the cygwin DLL. - -See http://www.opensource.org/docs/definition_plain.html for the precise Open Source -Definition referenced above. - -Red Hat sells a special Cygwin License for customers who are unable to -provide their application in open source code form. For more -information, please see: http://www.redhat.com/software/tools/cygwin/, -or call 866-2REDHAT ext. 3007 - diff --git a/winsup/mingw/profile/Makefile.in b/winsup/mingw/profile/Makefile.in deleted file mode 100644 index f9c71be50..000000000 --- a/winsup/mingw/profile/Makefile.in +++ /dev/null @@ -1,145 +0,0 @@ -# -# mingw/profile/Makefile.in: This file is part of Mingw runtime. -# -# This makefile requires GNU make. - -VPATH = @srcdir@ -srcdir = @srcdir@ -objdir = . - -target_alias = @target_alias@ -prefix = @prefix@ - -program_transform_name = @program_transform_name@ -exec_prefix = @exec_prefix@ -bindir = @bindir@ -libdir = @libdir@ -tooldir = $(exec_prefix)/$(target_alias) -datadir = @datadir@ -infodir = @infodir@ -includedir = @includedir@ - -SHELL = /bin/sh - -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -mkinstalldirs = $(SHELL) $(srcdir)/../mkinstalldirs -DISTFILES = Makefile.in configure configure.in aclocal.m4 gcrt0.c gmon.c gmon.h \ -mcount.c profil.c profil.h profile.h CYGWIN_LICENSE COPYING - -CC = @CC@ -# FIXME: Which is it, CC or CC_FOR_TARGET? -CC_FOR_TARGET = $(CC) -AS_FOR_TARGET = $(AS) -CFLAGS = @CFLAGS@ -CXXFLAGS = @CXXFLAGS@ - -# compiling with Cygwin? -NO_CYGWIN := @NO_CYGWIN@ -ifdef NO_CYGWIN -override CC := ${NO_CYGWIN} $(firstword $(filter-out ${NO_CYGWIN},${CC})) -endif - -# Either crtdll (CRT_ID 1) or msvcrt (CRT_ID 2). -RUNTIME = @RUNTIME@ -CRT_ID = @CRT_ID@ - -# Needed for threading dll. -THREAD_DLL = @THREAD_DLL@ -THREAD_DLL_VERSION = 10 -THREAD_DLL_NAME = $(THREAD_DLL)$(THREAD_DLL_VERSION).dll - -W32API_INCLUDE = @W32API_INCLUDE@ -INCLUDES = -I$(srcdir) -I$(srcdir)/../include \ - -nostdinc \ - -iwithprefixbefore include -ALL_CFLAGS = $(CFLAGS) $(INCLUDES) $(W32API_INCLUDE) -ALL_CXXFLAGS = $(CXXFLAGS) $(INCLUDES) -nostdinc++ $(W32API_INCLUDE) - -AS = @AS@ -AR = @AR@ -LD = @LD@ -AR_FLAGS = rcv -RANLIB = @RANLIB@ -DLLTOOL = @DLLTOOL@ -DLLTOOLFLAGS = -DLLTOOL_FOR_TARGET = $(DLLTOOL) -DLLTOOL_FLAGS = --as $(AS_FOR_TARGET) - -LIBGMON_A = @LIBGMON_A@ -LIBGMON_OBJS = gmon.o mcount.o profil.o -CRT0S = @CRT0S@ -ALL_CRT0S = gcrt0.o gcrt1.o gcrt2.o - -LIBS = $(LIBGMON_A) -DLLS = - -all: $(LIBGMON_A) - -$(LIBGMON_A): $(LIBGMON_OBJS) $(CRT0S) - $(AR) $(ARFLAGS) $@ $(LIBGMON_OBJS) - $(RANLIB) $@ - -# FIXME: These are really the same, but gcc specs want different names. -# The only CRT dependency is atexit. -gcrt0.o: gcrt0.c - $(CC) -c -o $@ $(CPPFLAGS) $(ALL_CFLAGS) $? - -gcrt1.o: gcrt0.c - $(CC) -U__MSVCRT__ -c -o $@ $(CPPFLAGS) $(ALL_CFLAGS) $? - -gcrt2.o: gcrt0.c - $(CC) -D__MSVCRT__ -c -o $@ $(CPPFLAGS) $(ALL_CFLAGS) $? - -# -# Dependancies -# -gmon.o: gmon.c gmon.h profile.h profil.h -mcount.o: mcount.c gmon.h profile.h -profil.o: profil.c profil.h - -Makefile: Makefile.in config.status configure - $(SHELL) config.status - -config.status: configure - $(SHELL) config.status --recheck - -info: - -info-html: - -install-info: info - -install: all - $(mkinstalldirs) $(inst_libdir) - for i in $(LIBS); do \ - $(INSTALL_DATA) $$i $(inst_libdir)/$$i ; \ - done - for i in $(CRT0S); do \ - $(INSTALL_DATA) $$i $(inst_libdir)/$$i ; \ - done - for sub in . ; do \ - $(mkinstalldirs) $(inst_includedir)/$$sub ; \ - for i in $(srcdir)/$$sub/*.h ; do \ - $(INSTALL_DATA) $$i $(inst_includedir)/$$sub/`basename $$i` ; \ - done ; \ - done - -clean: - -rm -f $(LIBGMON_OBJS) $(ALL_CRT0S) $(LIBGMON_A) - -distclean: - -rm -f *.o *.a *~ core a.out - -rm -f config.cache config.status config.log - -rm -f Makefile -.c.o: - $(CC) -c $(ALL_CPPFLAGS) $(ALL_CFLAGS) $< -o $@ - -dist: - mkdir $(distdir)/profile - chmod 755 $(distdir)/profile - @for i in $(DISTFILES); do\ - cp -p $(srcdir)/$$i $(distdir)/profile/$$i ; \ - done - diff --git a/winsup/mingw/profile/aclocal.m4 b/winsup/mingw/profile/aclocal.m4 deleted file mode 100644 index 177c0134b..000000000 --- a/winsup/mingw/profile/aclocal.m4 +++ /dev/null @@ -1,831 +0,0 @@ -dnl aclocal.m4 generated automatically by aclocal 1.4-p6 - -dnl Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc. -dnl This file is free software; the Free Software Foundation -dnl gives unlimited permission to copy and/or distribute it, -dnl with or without modifications, as long as this notice is preserved. - -dnl This program is distributed in the hope that it will be useful, -dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without -dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A -dnl PARTICULAR PURPOSE. - -# lib-prefix.m4 serial 4 (gettext-0.14.2) -dnl Copyright (C) 2001-2005 Free Software Foundation, Inc. -dnl This file is free software; the Free Software Foundation -dnl gives unlimited permission to copy and/or distribute it, -dnl with or without modifications, as long as this notice is preserved. - -dnl From Bruno Haible. - -dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and -dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't -dnl require excessive bracketing. -ifdef([AC_HELP_STRING], -[AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])], -[AC_DEFUN([AC_][LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])]) - -dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed -dnl to access previously installed libraries. The basic assumption is that -dnl a user will want packages to use other packages he previously installed -dnl with the same --prefix option. -dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate -dnl libraries, but is otherwise very convenient. -AC_DEFUN([AC_LIB_PREFIX], -[ - AC_BEFORE([$0], [AC_LIB_LINKFLAGS]) - AC_REQUIRE([AC_PROG_CC]) - AC_REQUIRE([AC_CANONICAL_HOST]) - AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) - dnl By default, look in $includedir and $libdir. - use_additional=yes - AC_LIB_WITH_FINAL_PREFIX([ - eval additional_includedir=\"$includedir\" - eval additional_libdir=\"$libdir\" - ]) - AC_LIB_ARG_WITH([lib-prefix], -[ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib - --without-lib-prefix don't search for libraries in includedir and libdir], -[ - if test "X$withval" = "Xno"; then - use_additional=no - else - if test "X$withval" = "X"; then - AC_LIB_WITH_FINAL_PREFIX([ - eval additional_includedir=\"$includedir\" - eval additional_libdir=\"$libdir\" - ]) - else - additional_includedir="$withval/include" - additional_libdir="$withval/lib" - fi - fi -]) - if test $use_additional = yes; then - dnl Potentially add $additional_includedir to $CPPFLAGS. - dnl But don't add it - dnl 1. if it's the standard /usr/include, - dnl 2. if it's already present in $CPPFLAGS, - dnl 3. if it's /usr/local/include and we are using GCC on Linux, - dnl 4. if it doesn't exist as a directory. - if test "X$additional_includedir" != "X/usr/include"; then - haveit= - for x in $CPPFLAGS; do - AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) - if test "X$x" = "X-I$additional_includedir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - if test "X$additional_includedir" = "X/usr/local/include"; then - if test -n "$GCC"; then - case $host_os in - linux* | gnu* | k*bsd*-gnu) haveit=yes;; - esac - fi - fi - if test -z "$haveit"; then - if test -d "$additional_includedir"; then - dnl Really add $additional_includedir to $CPPFLAGS. - CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir" - fi - fi - fi - fi - dnl Potentially add $additional_libdir to $LDFLAGS. - dnl But don't add it - dnl 1. if it's the standard /usr/lib, - dnl 2. if it's already present in $LDFLAGS, - dnl 3. if it's /usr/local/lib and we are using GCC on Linux, - dnl 4. if it doesn't exist as a directory. - if test "X$additional_libdir" != "X/usr/lib"; then - haveit= - for x in $LDFLAGS; do - AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) - if test "X$x" = "X-L$additional_libdir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - if test "X$additional_libdir" = "X/usr/local/lib"; then - if test -n "$GCC"; then - case $host_os in - linux*) haveit=yes;; - esac - fi - fi - if test -z "$haveit"; then - if test -d "$additional_libdir"; then - dnl Really add $additional_libdir to $LDFLAGS. - LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir" - fi - fi - fi - fi - fi -]) - -dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix, -dnl acl_final_exec_prefix, containing the values to which $prefix and -dnl $exec_prefix will expand at the end of the configure script. -AC_DEFUN([AC_LIB_PREPARE_PREFIX], -[ - dnl Unfortunately, prefix and exec_prefix get only finally determined - dnl at the end of configure. - if test "X$prefix" = "XNONE"; then - acl_final_prefix="$ac_default_prefix" - else - acl_final_prefix="$prefix" - fi - if test "X$exec_prefix" = "XNONE"; then - acl_final_exec_prefix='${prefix}' - else - acl_final_exec_prefix="$exec_prefix" - fi - acl_save_prefix="$prefix" - prefix="$acl_final_prefix" - eval acl_final_exec_prefix=\"$acl_final_exec_prefix\" - prefix="$acl_save_prefix" -]) - -dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the -dnl variables prefix and exec_prefix bound to the values they will have -dnl at the end of the configure script. -AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX], -[ - acl_save_prefix="$prefix" - prefix="$acl_final_prefix" - acl_save_exec_prefix="$exec_prefix" - exec_prefix="$acl_final_exec_prefix" - $1 - exec_prefix="$acl_save_exec_prefix" - prefix="$acl_save_prefix" -]) - -# lib-link.m4 serial 6 (gettext-0.14.3) -dnl Copyright (C) 2001-2005 Free Software Foundation, Inc. -dnl This file is free software; the Free Software Foundation -dnl gives unlimited permission to copy and/or distribute it, -dnl with or without modifications, as long as this notice is preserved. - -dnl From Bruno Haible. - -AC_PREREQ(2.50) - -dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and -dnl the libraries corresponding to explicit and implicit dependencies. -dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and -dnl augments the CPPFLAGS variable. -AC_DEFUN([AC_LIB_LINKFLAGS], -[ - AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) - AC_REQUIRE([AC_LIB_RPATH]) - define([Name],[translit([$1],[./-], [___])]) - define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], - [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) - AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [ - AC_LIB_LINKFLAGS_BODY([$1], [$2]) - ac_cv_lib[]Name[]_libs="$LIB[]NAME" - ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME" - ac_cv_lib[]Name[]_cppflags="$INC[]NAME" - ]) - LIB[]NAME="$ac_cv_lib[]Name[]_libs" - LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs" - INC[]NAME="$ac_cv_lib[]Name[]_cppflags" - AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME) - AC_SUBST([LIB]NAME) - AC_SUBST([LTLIB]NAME) - dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the - dnl results of this search when this library appears as a dependency. - HAVE_LIB[]NAME=yes - undefine([Name]) - undefine([NAME]) -]) - -dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode) -dnl searches for libname and the libraries corresponding to explicit and -dnl implicit dependencies, together with the specified include files and -dnl the ability to compile and link the specified testcode. If found, it -dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and -dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and -dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs -dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty. -AC_DEFUN([AC_LIB_HAVE_LINKFLAGS], -[ - AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) - AC_REQUIRE([AC_LIB_RPATH]) - define([Name],[translit([$1],[./-], [___])]) - define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], - [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) - - dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME - dnl accordingly. - AC_LIB_LINKFLAGS_BODY([$1], [$2]) - - dnl Add $INC[]NAME to CPPFLAGS before performing the following checks, - dnl because if the user has installed lib[]Name and not disabled its use - dnl via --without-lib[]Name-prefix, he wants to use it. - ac_save_CPPFLAGS="$CPPFLAGS" - AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME) - - AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [ - ac_save_LIBS="$LIBS" - LIBS="$LIBS $LIB[]NAME" - AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no]) - LIBS="$ac_save_LIBS" - ]) - if test "$ac_cv_lib[]Name" = yes; then - HAVE_LIB[]NAME=yes - AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.]) - AC_MSG_CHECKING([how to link with lib[]$1]) - AC_MSG_RESULT([$LIB[]NAME]) - else - HAVE_LIB[]NAME=no - dnl If $LIB[]NAME didn't lead to a usable library, we don't need - dnl $INC[]NAME either. - CPPFLAGS="$ac_save_CPPFLAGS" - LIB[]NAME= - LTLIB[]NAME= - fi - AC_SUBST([HAVE_LIB]NAME) - AC_SUBST([LIB]NAME) - AC_SUBST([LTLIB]NAME) - undefine([Name]) - undefine([NAME]) -]) - -dnl Determine the platform dependent parameters needed to use rpath: -dnl libext, shlibext, hardcode_libdir_flag_spec, hardcode_libdir_separator, -dnl hardcode_direct, hardcode_minus_L. -AC_DEFUN([AC_LIB_RPATH], -[ - dnl Tell automake >= 1.10 to complain if config.rpath is missing. - m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([config.rpath])]) - AC_REQUIRE([AC_PROG_CC]) dnl we use $CC, $GCC, $LDFLAGS - AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld - AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host - AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir - AC_CACHE_CHECK([for shared library run path origin], acl_cv_rpath, [ - CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \ - ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh - . ./conftest.sh - rm -f ./conftest.sh - acl_cv_rpath=done - ]) - wl="$acl_cv_wl" - libext="$acl_cv_libext" - shlibext="$acl_cv_shlibext" - hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec" - hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator" - hardcode_direct="$acl_cv_hardcode_direct" - hardcode_minus_L="$acl_cv_hardcode_minus_L" - dnl Determine whether the user wants rpath handling at all. - AC_ARG_ENABLE(rpath, - [ --disable-rpath do not hardcode runtime library paths], - :, enable_rpath=yes) -]) - -dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and -dnl the libraries corresponding to explicit and implicit dependencies. -dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables. -AC_DEFUN([AC_LIB_LINKFLAGS_BODY], -[ - define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], - [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) - dnl By default, look in $includedir and $libdir. - use_additional=yes - AC_LIB_WITH_FINAL_PREFIX([ - eval additional_includedir=\"$includedir\" - eval additional_libdir=\"$libdir\" - ]) - AC_LIB_ARG_WITH([lib$1-prefix], -[ --with-lib$1-prefix[=DIR] search for lib$1 in DIR/include and DIR/lib - --without-lib$1-prefix don't search for lib$1 in includedir and libdir], -[ - if test "X$withval" = "Xno"; then - use_additional=no - else - if test "X$withval" = "X"; then - AC_LIB_WITH_FINAL_PREFIX([ - eval additional_includedir=\"$includedir\" - eval additional_libdir=\"$libdir\" - ]) - else - additional_includedir="$withval/include" - additional_libdir="$withval/lib" - fi - fi -]) - dnl Search the library and its dependencies in $additional_libdir and - dnl $LDFLAGS. Using breadth-first-seach. - LIB[]NAME= - LTLIB[]NAME= - INC[]NAME= - rpathdirs= - ltrpathdirs= - names_already_handled= - names_next_round='$1 $2' - while test -n "$names_next_round"; do - names_this_round="$names_next_round" - names_next_round= - for name in $names_this_round; do - already_handled= - for n in $names_already_handled; do - if test "$n" = "$name"; then - already_handled=yes - break - fi - done - if test -z "$already_handled"; then - names_already_handled="$names_already_handled $name" - dnl See if it was already located by an earlier AC_LIB_LINKFLAGS - dnl or AC_LIB_HAVE_LINKFLAGS call. - uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'` - eval value=\"\$HAVE_LIB$uppername\" - if test -n "$value"; then - if test "$value" = yes; then - eval value=\"\$LIB$uppername\" - test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value" - eval value=\"\$LTLIB$uppername\" - test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value" - else - dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined - dnl that this library doesn't exist. So just drop it. - : - fi - else - dnl Search the library lib$name in $additional_libdir and $LDFLAGS - dnl and the already constructed $LIBNAME/$LTLIBNAME. - found_dir= - found_la= - found_so= - found_a= - if test $use_additional = yes; then - if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then - found_dir="$additional_libdir" - found_so="$additional_libdir/lib$name.$shlibext" - if test -f "$additional_libdir/lib$name.la"; then - found_la="$additional_libdir/lib$name.la" - fi - else - if test -f "$additional_libdir/lib$name.$libext"; then - found_dir="$additional_libdir" - found_a="$additional_libdir/lib$name.$libext" - if test -f "$additional_libdir/lib$name.la"; then - found_la="$additional_libdir/lib$name.la" - fi - fi - fi - fi - if test "X$found_dir" = "X"; then - for x in $LDFLAGS $LTLIB[]NAME; do - AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) - case "$x" in - -L*) - dir=`echo "X$x" | sed -e 's/^X-L//'` - if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then - found_dir="$dir" - found_so="$dir/lib$name.$shlibext" - if test -f "$dir/lib$name.la"; then - found_la="$dir/lib$name.la" - fi - else - if test -f "$dir/lib$name.$libext"; then - found_dir="$dir" - found_a="$dir/lib$name.$libext" - if test -f "$dir/lib$name.la"; then - found_la="$dir/lib$name.la" - fi - fi - fi - ;; - esac - if test "X$found_dir" != "X"; then - break - fi - done - fi - if test "X$found_dir" != "X"; then - dnl Found the library. - LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name" - if test "X$found_so" != "X"; then - dnl Linking with a shared library. We attempt to hardcode its - dnl directory into the executable's runpath, unless it's the - dnl standard /usr/lib. - if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then - dnl No hardcoding is needed. - LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" - else - dnl Use an explicit option to hardcode DIR into the resulting - dnl binary. - dnl Potentially add DIR to ltrpathdirs. - dnl The ltrpathdirs will be appended to $LTLIBNAME at the end. - haveit= - for x in $ltrpathdirs; do - if test "X$x" = "X$found_dir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - ltrpathdirs="$ltrpathdirs $found_dir" - fi - dnl The hardcoding into $LIBNAME is system dependent. - if test "$hardcode_direct" = yes; then - dnl Using DIR/libNAME.so during linking hardcodes DIR into the - dnl resulting binary. - LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" - else - if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then - dnl Use an explicit option to hardcode DIR into the resulting - dnl binary. - LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" - dnl Potentially add DIR to rpathdirs. - dnl The rpathdirs will be appended to $LIBNAME at the end. - haveit= - for x in $rpathdirs; do - if test "X$x" = "X$found_dir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - rpathdirs="$rpathdirs $found_dir" - fi - else - dnl Rely on "-L$found_dir". - dnl But don't add it if it's already contained in the LDFLAGS - dnl or the already constructed $LIBNAME - haveit= - for x in $LDFLAGS $LIB[]NAME; do - AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) - if test "X$x" = "X-L$found_dir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir" - fi - if test "$hardcode_minus_L" != no; then - dnl FIXME: Not sure whether we should use - dnl "-L$found_dir -l$name" or "-L$found_dir $found_so" - dnl here. - LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" - else - dnl We cannot use $hardcode_runpath_var and LD_RUN_PATH - dnl here, because this doesn't fit in flags passed to the - dnl compiler. So give up. No hardcoding. This affects only - dnl very old systems. - dnl FIXME: Not sure whether we should use - dnl "-L$found_dir -l$name" or "-L$found_dir $found_so" - dnl here. - LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name" - fi - fi - fi - fi - else - if test "X$found_a" != "X"; then - dnl Linking with a static library. - LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a" - else - dnl We shouldn't come here, but anyway it's good to have a - dnl fallback. - LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name" - fi - fi - dnl Assume the include files are nearby. - additional_includedir= - case "$found_dir" in - */lib | */lib/) - basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'` - additional_includedir="$basedir/include" - ;; - esac - if test "X$additional_includedir" != "X"; then - dnl Potentially add $additional_includedir to $INCNAME. - dnl But don't add it - dnl 1. if it's the standard /usr/include, - dnl 2. if it's /usr/local/include and we are using GCC on Linux, - dnl 3. if it's already present in $CPPFLAGS or the already - dnl constructed $INCNAME, - dnl 4. if it doesn't exist as a directory. - if test "X$additional_includedir" != "X/usr/include"; then - haveit= - if test "X$additional_includedir" = "X/usr/local/include"; then - if test -n "$GCC"; then - case $host_os in - linux* | gnu* | k*bsd*-gnu) haveit=yes;; - esac - fi - fi - if test -z "$haveit"; then - for x in $CPPFLAGS $INC[]NAME; do - AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) - if test "X$x" = "X-I$additional_includedir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - if test -d "$additional_includedir"; then - dnl Really add $additional_includedir to $INCNAME. - INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir" - fi - fi - fi - fi - fi - dnl Look for dependencies. - if test -n "$found_la"; then - dnl Read the .la file. It defines the variables - dnl dlname, library_names, old_library, dependency_libs, current, - dnl age, revision, installed, dlopen, dlpreopen, libdir. - save_libdir="$libdir" - case "$found_la" in - */* | *\\*) . "$found_la" ;; - *) . "./$found_la" ;; - esac - libdir="$save_libdir" - dnl We use only dependency_libs. - for dep in $dependency_libs; do - case "$dep" in - -L*) - additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` - dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME. - dnl But don't add it - dnl 1. if it's the standard /usr/lib, - dnl 2. if it's /usr/local/lib and we are using GCC on Linux, - dnl 3. if it's already present in $LDFLAGS or the already - dnl constructed $LIBNAME, - dnl 4. if it doesn't exist as a directory. - if test "X$additional_libdir" != "X/usr/lib"; then - haveit= - if test "X$additional_libdir" = "X/usr/local/lib"; then - if test -n "$GCC"; then - case $host_os in - linux* | gnu* | k*bsd*-gnu) haveit=yes;; - esac - fi - fi - if test -z "$haveit"; then - haveit= - for x in $LDFLAGS $LIB[]NAME; do - AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) - if test "X$x" = "X-L$additional_libdir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - if test -d "$additional_libdir"; then - dnl Really add $additional_libdir to $LIBNAME. - LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir" - fi - fi - haveit= - for x in $LDFLAGS $LTLIB[]NAME; do - AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) - if test "X$x" = "X-L$additional_libdir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - if test -d "$additional_libdir"; then - dnl Really add $additional_libdir to $LTLIBNAME. - LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir" - fi - fi - fi - fi - ;; - -R*) - dir=`echo "X$dep" | sed -e 's/^X-R//'` - if test "$enable_rpath" != no; then - dnl Potentially add DIR to rpathdirs. - dnl The rpathdirs will be appended to $LIBNAME at the end. - haveit= - for x in $rpathdirs; do - if test "X$x" = "X$dir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - rpathdirs="$rpathdirs $dir" - fi - dnl Potentially add DIR to ltrpathdirs. - dnl The ltrpathdirs will be appended to $LTLIBNAME at the end. - haveit= - for x in $ltrpathdirs; do - if test "X$x" = "X$dir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - ltrpathdirs="$ltrpathdirs $dir" - fi - fi - ;; - -l*) - dnl Handle this in the next round. - names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` - ;; - *.la) - dnl Handle this in the next round. Throw away the .la's - dnl directory; it is already contained in a preceding -L - dnl option. - names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` - ;; - *) - dnl Most likely an immediate library name. - LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep" - LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep" - ;; - esac - done - fi - else - dnl Didn't find the library; assume it is in the system directories - dnl known to the linker and runtime loader. (All the system - dnl directories known to the linker should also be known to the - dnl runtime loader, otherwise the system is severely misconfigured.) - LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name" - LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name" - fi - fi - fi - done - done - if test "X$rpathdirs" != "X"; then - if test -n "$hardcode_libdir_separator"; then - dnl Weird platform: only the last -rpath option counts, the user must - dnl pass all path elements in one option. We can arrange that for a - dnl single library, but not when more than one $LIBNAMEs are used. - alldirs= - for found_dir in $rpathdirs; do - alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir" - done - dnl Note: hardcode_libdir_flag_spec uses $libdir and $wl. - acl_save_libdir="$libdir" - libdir="$alldirs" - eval flag=\"$hardcode_libdir_flag_spec\" - libdir="$acl_save_libdir" - LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag" - else - dnl The -rpath options are cumulative. - for found_dir in $rpathdirs; do - acl_save_libdir="$libdir" - libdir="$found_dir" - eval flag=\"$hardcode_libdir_flag_spec\" - libdir="$acl_save_libdir" - LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag" - done - fi - fi - if test "X$ltrpathdirs" != "X"; then - dnl When using libtool, the option that works for both libraries and - dnl executables is -R. The -R options are cumulative. - for found_dir in $ltrpathdirs; do - LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir" - done - fi -]) - -dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR, -dnl unless already present in VAR. -dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes -dnl contains two or three consecutive elements that belong together. -AC_DEFUN([AC_LIB_APPENDTOVAR], -[ - for element in [$2]; do - haveit= - for x in $[$1]; do - AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) - if test "X$x" = "X$element"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - [$1]="${[$1]}${[$1]:+ }$element" - fi - done -]) - -# lib-ld.m4 serial 3 (gettext-0.13) -dnl Copyright (C) 1996-2003 Free Software Foundation, Inc. -dnl This file is free software; the Free Software Foundation -dnl gives unlimited permission to copy and/or distribute it, -dnl with or without modifications, as long as this notice is preserved. - -dnl Subroutines of libtool.m4, -dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision -dnl with libtool.m4. - -dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no. -AC_DEFUN([AC_LIB_PROG_LD_GNU], -[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld, -[# I'd rather use --version here, but apparently some GNU ld's only accept -v. -case `$LD -v 2>&1 </dev/null` in -*GNU* | *'with BFD'*) - acl_cv_prog_gnu_ld=yes ;; -*) - acl_cv_prog_gnu_ld=no ;; -esac]) -with_gnu_ld=$acl_cv_prog_gnu_ld -]) - -dnl From libtool-1.4. Sets the variable LD. -AC_DEFUN([AC_LIB_PROG_LD], -[AC_ARG_WITH(gnu-ld, -[ --with-gnu-ld assume the C compiler uses GNU ld [default=no]], -test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no) -AC_REQUIRE([AC_PROG_CC])dnl -AC_REQUIRE([AC_CANONICAL_HOST])dnl -# Prepare PATH_SEPARATOR. -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' - else - PATH_SEPARATOR=: - fi - rm -f conf$$.sh -fi -ac_prog=ld -if test "$GCC" = yes; then - # Check if gcc -print-prog-name=ld gives a path. - AC_MSG_CHECKING([for ld used by GCC]) - case $host in - *-*-mingw*) - # gcc leaves a trailing carriage return which upsets mingw - ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; - *) - ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; - esac - case $ac_prog in - # Accept absolute paths. - [[\\/]* | [A-Za-z]:[\\/]*)] - [re_direlt='/[^/][^/]*/\.\./'] - # Canonicalize the path of ld - ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` - while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do - ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` - done - test -z "$LD" && LD="$ac_prog" - ;; - "") - # If it fails, then pretend we aren't using GCC. - ac_prog=ld - ;; - *) - # If it is relative, then search for the first ld in PATH. - with_gnu_ld=unknown - ;; - esac -elif test "$with_gnu_ld" = yes; then - AC_MSG_CHECKING([for GNU ld]) -else - AC_MSG_CHECKING([for non-GNU ld]) -fi -AC_CACHE_VAL(acl_cv_path_LD, -[if test -z "$LD"; then - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" - for ac_dir in $PATH; do - test -z "$ac_dir" && ac_dir=. - if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then - acl_cv_path_LD="$ac_dir/$ac_prog" - # Check to see if the program is GNU ld. I'd rather use --version, - # but apparently some GNU ld's only accept -v. - # Break only if it was the GNU/non-GNU ld that we prefer. - case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in - *GNU* | *'with BFD'*) - test "$with_gnu_ld" != no && break ;; - *) - test "$with_gnu_ld" != yes && break ;; - esac - fi - done - IFS="$ac_save_ifs" -else - acl_cv_path_LD="$LD" # Let the user override the test with a path. -fi]) -LD="$acl_cv_path_LD" -if test -n "$LD"; then - AC_MSG_RESULT($LD) -else - AC_MSG_RESULT(no) -fi -test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH]) -AC_LIB_PROG_LD_GNU -]) - diff --git a/winsup/mingw/profile/configure b/winsup/mingw/profile/configure deleted file mode 100755 index b1f4278d4..000000000 --- a/winsup/mingw/profile/configure +++ /dev/null @@ -1,3151 +0,0 @@ -#! /bin/sh -# Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.63. -# -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -# 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. -# This configure script is free software; the Free Software Foundation -# gives unlimited permission to copy, distribute and modify it. -## --------------------- ## -## M4sh Initialization. ## -## --------------------- ## - -# Be more Bourne compatible -DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in - *posix*) set -o posix ;; -esac - -fi - - - - -# PATH needs CR -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits - -as_nl=' -' -export as_nl -# Printing a long string crashes Solaris 7 /usr/bin/printf. -as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo -if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='printf %s\n' - as_echo_n='printf %s' -else - if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then - as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' - as_echo_n='/usr/ucb/echo -n' - else - as_echo_body='eval expr "X$1" : "X\\(.*\\)"' - as_echo_n_body='eval - arg=$1; - case $arg in - *"$as_nl"*) - expr "X$arg" : "X\\(.*\\)$as_nl"; - arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; - esac; - expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" - ' - export as_echo_n_body - as_echo_n='sh -c $as_echo_n_body as_echo' - fi - export as_echo_body - as_echo='sh -c $as_echo_body as_echo' -fi - -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - PATH_SEPARATOR=: - (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { - (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || - PATH_SEPARATOR=';' - } -fi - -# Support unset when possible. -if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then - as_unset=unset -else - as_unset=false -fi - - -# IFS -# We need space, tab and new line, in precisely that order. Quoting is -# there to prevent editors from complaining about space-tab. -# (If _AS_PATH_WALK were called with IFS unset, it would disable word -# splitting by setting IFS to empty value.) -IFS=" "" $as_nl" - -# Find who we are. Look in the path if we contain no directory separator. -case $0 in - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break -done -IFS=$as_save_IFS - - ;; -esac -# We did not find ourselves, most probably we were run as `sh COMMAND' -# in which case we are not to be found in the path. -if test "x$as_myself" = x; then - as_myself=$0 -fi -if test ! -f "$as_myself"; then - $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 - { (exit 1); exit 1; } -fi - -# Work around bugs in pre-3.0 UWIN ksh. -for as_var in ENV MAIL MAILPATH -do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var -done -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -LC_ALL=C -export LC_ALL -LANGUAGE=C -export LANGUAGE - -# Required to use basename. -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi - -if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then - as_basename=basename -else - as_basename=false -fi - - -# Name of the executable. -as_me=`$as_basename -- "$0" || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ - s//\1/ - q - } - /^X\/\(\/\/\)$/{ - s//\1/ - q - } - /^X\/\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - -# CDPATH. -$as_unset CDPATH - - -if test "x$CONFIG_SHELL" = x; then - if (eval ":") 2>/dev/null; then - as_have_required=yes -else - as_have_required=no -fi - - if test $as_have_required = yes && (eval ": -(as_func_return () { - (exit \$1) -} -as_func_success () { - as_func_return 0 -} -as_func_failure () { - as_func_return 1 -} -as_func_ret_success () { - return 0 -} -as_func_ret_failure () { - return 1 -} - -exitcode=0 -if as_func_success; then - : -else - exitcode=1 - echo as_func_success failed. -fi - -if as_func_failure; then - exitcode=1 - echo as_func_failure succeeded. -fi - -if as_func_ret_success; then - : -else - exitcode=1 - echo as_func_ret_success failed. -fi - -if as_func_ret_failure; then - exitcode=1 - echo as_func_ret_failure succeeded. -fi - -if ( set x; as_func_ret_success y && test x = \"\$1\" ); then - : -else - exitcode=1 - echo positional parameters were not saved. -fi - -test \$exitcode = 0) || { (exit 1); exit 1; } - -( - as_lineno_1=\$LINENO - as_lineno_2=\$LINENO - test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && - test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } -") 2> /dev/null; then - : -else - as_candidate_shells= - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - case $as_dir in - /*) - for as_base in sh bash ksh sh5; do - as_candidate_shells="$as_candidate_shells $as_dir/$as_base" - done;; - esac -done -IFS=$as_save_IFS - - - for as_shell in $as_candidate_shells $SHELL; do - # Try only shells that exist, to save several forks. - if { test -f "$as_shell" || test -f "$as_shell.exe"; } && - { ("$as_shell") 2> /dev/null <<\_ASEOF -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in - *posix*) set -o posix ;; -esac - -fi - - -: -_ASEOF -}; then - CONFIG_SHELL=$as_shell - as_have_required=yes - if { "$as_shell" 2> /dev/null <<\_ASEOF -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in - *posix*) set -o posix ;; -esac - -fi - - -: -(as_func_return () { - (exit $1) -} -as_func_success () { - as_func_return 0 -} -as_func_failure () { - as_func_return 1 -} -as_func_ret_success () { - return 0 -} -as_func_ret_failure () { - return 1 -} - -exitcode=0 -if as_func_success; then - : -else - exitcode=1 - echo as_func_success failed. -fi - -if as_func_failure; then - exitcode=1 - echo as_func_failure succeeded. -fi - -if as_func_ret_success; then - : -else - exitcode=1 - echo as_func_ret_success failed. -fi - -if as_func_ret_failure; then - exitcode=1 - echo as_func_ret_failure succeeded. -fi - -if ( set x; as_func_ret_success y && test x = "$1" ); then - : -else - exitcode=1 - echo positional parameters were not saved. -fi - -test $exitcode = 0) || { (exit 1); exit 1; } - -( - as_lineno_1=$LINENO - as_lineno_2=$LINENO - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } - -_ASEOF -}; then - break -fi - -fi - - done - - if test "x$CONFIG_SHELL" != x; then - for as_var in BASH_ENV ENV - do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var - done - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} -fi - - - if test $as_have_required = no; then - echo This script requires a shell more modern than all the - echo shells that I found on your system. Please install a - echo modern shell, or manually run the script under such a - echo shell if you do have one. - { (exit 1); exit 1; } -fi - - -fi - -fi - - - -(eval "as_func_return () { - (exit \$1) -} -as_func_success () { - as_func_return 0 -} -as_func_failure () { - as_func_return 1 -} -as_func_ret_success () { - return 0 -} -as_func_ret_failure () { - return 1 -} - -exitcode=0 -if as_func_success; then - : -else - exitcode=1 - echo as_func_success failed. -fi - -if as_func_failure; then - exitcode=1 - echo as_func_failure succeeded. -fi - -if as_func_ret_success; then - : -else - exitcode=1 - echo as_func_ret_success failed. -fi - -if as_func_ret_failure; then - exitcode=1 - echo as_func_ret_failure succeeded. -fi - -if ( set x; as_func_ret_success y && test x = \"\$1\" ); then - : -else - exitcode=1 - echo positional parameters were not saved. -fi - -test \$exitcode = 0") || { - echo No shell found that supports shell functions. - echo Please tell bug-autoconf@gnu.org about your system, - echo including any error possibly output before this message. - echo This can help us improve future autoconf versions. - echo Configuration will now proceed without shell functions. -} - - - - as_lineno_1=$LINENO - as_lineno_2=$LINENO - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { - - # Create $as_me.lineno as a copy of $as_myself, but with $LINENO - # uniformly replaced by the line number. The first 'sed' inserts a - # line-number line after each line using $LINENO; the second 'sed' - # does the real work. The second script uses 'N' to pair each - # line-number line with the line containing $LINENO, and appends - # trailing '-' during substitution so that $LINENO is not a special - # case at line end. - # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the - # scripts with optimization help from Paolo Bonzini. Blame Lee - # E. McMahon (1931-1989) for sed's syntax. :-) - sed -n ' - p - /[$]LINENO/= - ' <$as_myself | - sed ' - s/[$]LINENO.*/&-/ - t lineno - b - :lineno - N - :loop - s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ - t loop - s/-\n.*// - ' >$as_me.lineno && - chmod +x "$as_me.lineno" || - { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 - { (exit 1); exit 1; }; } - - # Don't try to exec as it changes $[0], causing all sort of problems - # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensitive to this). - . "./$as_me.lineno" - # Exit status is that of the last command. - exit -} - - -if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then - as_dirname=dirname -else - as_dirname=false -fi - -ECHO_C= ECHO_N= ECHO_T= -case `echo -n x` in --n*) - case `echo 'x\c'` in - *c*) ECHO_T=' ';; # ECHO_T is single tab character. - *) ECHO_C='\c';; - esac;; -*) - ECHO_N='-n';; -esac -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi - -rm -f conf$$ conf$$.exe conf$$.file -if test -d conf$$.dir; then - rm -f conf$$.dir/conf$$.file -else - rm -f conf$$.dir - mkdir conf$$.dir 2>/dev/null -fi -if (echo >conf$$.file) 2>/dev/null; then - if ln -s conf$$.file conf$$ 2>/dev/null; then - as_ln_s='ln -s' - # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -p'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -p' - elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln - else - as_ln_s='cp -p' - fi -else - as_ln_s='cp -p' -fi -rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file -rmdir conf$$.dir 2>/dev/null - -if mkdir -p . 2>/dev/null; then - as_mkdir_p=: -else - test -d ./-p && rmdir ./-p - as_mkdir_p=false -fi - -if test -x / >/dev/null 2>&1; then - as_test_x='test -x' -else - if ls -dL / >/dev/null 2>&1; then - as_ls_L_option=L - else - as_ls_L_option= - fi - as_test_x=' - eval sh -c '\'' - if test -d "$1"; then - test -d "$1/."; - else - case $1 in - -*)set "./$1";; - esac; - case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in - ???[sx]*):;;*)false;;esac;fi - '\'' sh - ' -fi -as_executable_p=$as_test_x - -# Sed expression to map a string onto a valid CPP name. -as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" - -# Sed expression to map a string onto a valid variable name. -as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" - - - -exec 7<&0 </dev/null 6>&1 - -# Name of the host. -# hostname on some systems (SVR3.2, Linux) returns a bogus exit status, -# so uname gets run too. -ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` - -# -# Initializations. -# -ac_default_prefix=/usr/local -ac_clean_files= -ac_config_libobj_dir=. -LIBOBJS= -cross_compiling=no -subdirs= -MFLAGS= -MAKEFLAGS= -SHELL=${CONFIG_SHELL-/bin/sh} - -# Identity of this package. -PACKAGE_NAME= -PACKAGE_TARNAME= -PACKAGE_VERSION= -PACKAGE_STRING= -PACKAGE_BUGREPORT= - -ac_unique_file="gcrt0.c" -ac_subst_vars='LTLIBOBJS -LIBOBJS -INSTALL_DATA -INSTALL_SCRIPT -INSTALL_PROGRAM -W32API_INCLUDE -CRT0S -LIBGMON_A -NO_CYGWIN -RUNTIME -CRT_ID -target_os -target_vendor -target_cpu -target -host_os -host_vendor -host_cpu -host -build_os -build_vendor -build_cpu -build -DLLWRAP -DLLTOOL -RANLIB -LD -AR -AS -CC -target_alias -host_alias -build_alias -LIBS -ECHO_T -ECHO_N -ECHO_C -DEFS -mandir -localedir -libdir -psdir -pdfdir -dvidir -htmldir -infodir -docdir -oldincludedir -includedir -localstatedir -sharedstatedir -sysconfdir -datadir -datarootdir -libexecdir -sbindir -bindir -program_transform_name -prefix -exec_prefix -PACKAGE_BUGREPORT -PACKAGE_STRING -PACKAGE_VERSION -PACKAGE_TARNAME -PACKAGE_NAME -PATH_SEPARATOR -SHELL' -ac_subst_files='' -ac_user_opts=' -enable_option_checking -' - ac_precious_vars='build_alias -host_alias -target_alias' - - -# Initialize some variables set by options. -ac_init_help= -ac_init_version=false -ac_unrecognized_opts= -ac_unrecognized_sep= -# The variables have the same names as the options, with -# dashes changed to underlines. -cache_file=/dev/null -exec_prefix=NONE -no_create= -no_recursion= -prefix=NONE -program_prefix=NONE -program_suffix=NONE -program_transform_name=s,x,x, -silent= -site= -srcdir= -verbose= -x_includes=NONE -x_libraries=NONE - -# Installation directory options. -# These are left unexpanded so users can "make install exec_prefix=/foo" -# and all the variables that are supposed to be based on exec_prefix -# by default will actually change. -# Use braces instead of parens because sh, perl, etc. also accept them. -# (The list follows the same order as the GNU Coding Standards.) -bindir='${exec_prefix}/bin' -sbindir='${exec_prefix}/sbin' -libexecdir='${exec_prefix}/libexec' -datarootdir='${prefix}/share' -datadir='${datarootdir}' -sysconfdir='${prefix}/etc' -sharedstatedir='${prefix}/com' -localstatedir='${prefix}/var' -includedir='${prefix}/include' -oldincludedir='/usr/include' -docdir='${datarootdir}/doc/${PACKAGE}' -infodir='${datarootdir}/info' -htmldir='${docdir}' -dvidir='${docdir}' -pdfdir='${docdir}' -psdir='${docdir}' -libdir='${exec_prefix}/lib' -localedir='${datarootdir}/locale' -mandir='${datarootdir}/man' - -ac_prev= -ac_dashdash= -for ac_option -do - # If the previous option needs an argument, assign it. - if test -n "$ac_prev"; then - eval $ac_prev=\$ac_option - ac_prev= - continue - fi - - case $ac_option in - *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; - *) ac_optarg=yes ;; - esac - - # Accept the important Cygnus configure options, so we can diagnose typos. - - case $ac_dashdash$ac_option in - --) - ac_dashdash=yes ;; - - -bindir | --bindir | --bindi | --bind | --bin | --bi) - ac_prev=bindir ;; - -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) - bindir=$ac_optarg ;; - - -build | --build | --buil | --bui | --bu) - ac_prev=build_alias ;; - -build=* | --build=* | --buil=* | --bui=* | --bu=*) - build_alias=$ac_optarg ;; - - -cache-file | --cache-file | --cache-fil | --cache-fi \ - | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) - ac_prev=cache_file ;; - -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ - | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) - cache_file=$ac_optarg ;; - - --config-cache | -C) - cache_file=config.cache ;; - - -datadir | --datadir | --datadi | --datad) - ac_prev=datadir ;; - -datadir=* | --datadir=* | --datadi=* | --datad=*) - datadir=$ac_optarg ;; - - -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ - | --dataroo | --dataro | --datar) - ac_prev=datarootdir ;; - -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ - | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) - datarootdir=$ac_optarg ;; - - -disable-* | --disable-*) - ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2 - { (exit 1); exit 1; }; } - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"enable_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval enable_$ac_useropt=no ;; - - -docdir | --docdir | --docdi | --doc | --do) - ac_prev=docdir ;; - -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) - docdir=$ac_optarg ;; - - -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) - ac_prev=dvidir ;; - -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) - dvidir=$ac_optarg ;; - - -enable-* | --enable-*) - ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2 - { (exit 1); exit 1; }; } - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"enable_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval enable_$ac_useropt=\$ac_optarg ;; - - -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ - | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ - | --exec | --exe | --ex) - ac_prev=exec_prefix ;; - -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ - | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ - | --exec=* | --exe=* | --ex=*) - exec_prefix=$ac_optarg ;; - - -gas | --gas | --ga | --g) - # Obsolete; use --with-gas. - with_gas=yes ;; - - -help | --help | --hel | --he | -h) - ac_init_help=long ;; - -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) - ac_init_help=recursive ;; - -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) - ac_init_help=short ;; - - -host | --host | --hos | --ho) - ac_prev=host_alias ;; - -host=* | --host=* | --hos=* | --ho=*) - host_alias=$ac_optarg ;; - - -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) - ac_prev=htmldir ;; - -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ - | --ht=*) - htmldir=$ac_optarg ;; - - -includedir | --includedir | --includedi | --included | --include \ - | --includ | --inclu | --incl | --inc) - ac_prev=includedir ;; - -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ - | --includ=* | --inclu=* | --incl=* | --inc=*) - includedir=$ac_optarg ;; - - -infodir | --infodir | --infodi | --infod | --info | --inf) - ac_prev=infodir ;; - -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) - infodir=$ac_optarg ;; - - -libdir | --libdir | --libdi | --libd) - ac_prev=libdir ;; - -libdir=* | --libdir=* | --libdi=* | --libd=*) - libdir=$ac_optarg ;; - - -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ - | --libexe | --libex | --libe) - ac_prev=libexecdir ;; - -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ - | --libexe=* | --libex=* | --libe=*) - libexecdir=$ac_optarg ;; - - -localedir | --localedir | --localedi | --localed | --locale) - ac_prev=localedir ;; - -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) - localedir=$ac_optarg ;; - - -localstatedir | --localstatedir | --localstatedi | --localstated \ - | --localstate | --localstat | --localsta | --localst | --locals) - ac_prev=localstatedir ;; - -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ - | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) - localstatedir=$ac_optarg ;; - - -mandir | --mandir | --mandi | --mand | --man | --ma | --m) - ac_prev=mandir ;; - -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) - mandir=$ac_optarg ;; - - -nfp | --nfp | --nf) - # Obsolete; use --without-fp. - with_fp=no ;; - - -no-create | --no-create | --no-creat | --no-crea | --no-cre \ - | --no-cr | --no-c | -n) - no_create=yes ;; - - -no-recursion | --no-recursion | --no-recursio | --no-recursi \ - | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) - no_recursion=yes ;; - - -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ - | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ - | --oldin | --oldi | --old | --ol | --o) - ac_prev=oldincludedir ;; - -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ - | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ - | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) - oldincludedir=$ac_optarg ;; - - -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) - ac_prev=prefix ;; - -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) - prefix=$ac_optarg ;; - - -program-prefix | --program-prefix | --program-prefi | --program-pref \ - | --program-pre | --program-pr | --program-p) - ac_prev=program_prefix ;; - -program-prefix=* | --program-prefix=* | --program-prefi=* \ - | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) - program_prefix=$ac_optarg ;; - - -program-suffix | --program-suffix | --program-suffi | --program-suff \ - | --program-suf | --program-su | --program-s) - ac_prev=program_suffix ;; - -program-suffix=* | --program-suffix=* | --program-suffi=* \ - | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) - program_suffix=$ac_optarg ;; - - -program-transform-name | --program-transform-name \ - | --program-transform-nam | --program-transform-na \ - | --program-transform-n | --program-transform- \ - | --program-transform | --program-transfor \ - | --program-transfo | --program-transf \ - | --program-trans | --program-tran \ - | --progr-tra | --program-tr | --program-t) - ac_prev=program_transform_name ;; - -program-transform-name=* | --program-transform-name=* \ - | --program-transform-nam=* | --program-transform-na=* \ - | --program-transform-n=* | --program-transform-=* \ - | --program-transform=* | --program-transfor=* \ - | --program-transfo=* | --program-transf=* \ - | --program-trans=* | --program-tran=* \ - | --progr-tra=* | --program-tr=* | --program-t=*) - program_transform_name=$ac_optarg ;; - - -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) - ac_prev=pdfdir ;; - -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) - pdfdir=$ac_optarg ;; - - -psdir | --psdir | --psdi | --psd | --ps) - ac_prev=psdir ;; - -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) - psdir=$ac_optarg ;; - - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil) - silent=yes ;; - - -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) - ac_prev=sbindir ;; - -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ - | --sbi=* | --sb=*) - sbindir=$ac_optarg ;; - - -sharedstatedir | --sharedstatedir | --sharedstatedi \ - | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ - | --sharedst | --shareds | --shared | --share | --shar \ - | --sha | --sh) - ac_prev=sharedstatedir ;; - -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ - | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ - | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ - | --sha=* | --sh=*) - sharedstatedir=$ac_optarg ;; - - -site | --site | --sit) - ac_prev=site ;; - -site=* | --site=* | --sit=*) - site=$ac_optarg ;; - - -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) - ac_prev=srcdir ;; - -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) - srcdir=$ac_optarg ;; - - -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ - | --syscon | --sysco | --sysc | --sys | --sy) - ac_prev=sysconfdir ;; - -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ - | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) - sysconfdir=$ac_optarg ;; - - -target | --target | --targe | --targ | --tar | --ta | --t) - ac_prev=target_alias ;; - -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) - target_alias=$ac_optarg ;; - - -v | -verbose | --verbose | --verbos | --verbo | --verb) - verbose=yes ;; - - -version | --version | --versio | --versi | --vers | -V) - ac_init_version=: ;; - - -with-* | --with-*) - ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2 - { (exit 1); exit 1; }; } - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"with_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval with_$ac_useropt=\$ac_optarg ;; - - -without-* | --without-*) - ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2 - { (exit 1); exit 1; }; } - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"with_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval with_$ac_useropt=no ;; - - --x) - # Obsolete; use --with-x. - with_x=yes ;; - - -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ - | --x-incl | --x-inc | --x-in | --x-i) - ac_prev=x_includes ;; - -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ - | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) - x_includes=$ac_optarg ;; - - -x-libraries | --x-libraries | --x-librarie | --x-librari \ - | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) - ac_prev=x_libraries ;; - -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ - | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) - x_libraries=$ac_optarg ;; - - -*) { $as_echo "$as_me: error: unrecognized option: $ac_option -Try \`$0 --help' for more information." >&2 - { (exit 1); exit 1; }; } - ;; - - *=*) - ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` - # Reject names that are not valid shell variable names. - expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && - { $as_echo "$as_me: error: invalid variable name: $ac_envvar" >&2 - { (exit 1); exit 1; }; } - eval $ac_envvar=\$ac_optarg - export $ac_envvar ;; - - *) - # FIXME: should be removed in autoconf 3.0. - $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 - expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && - $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 - : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} - ;; - - esac -done - -if test -n "$ac_prev"; then - ac_option=--`echo $ac_prev | sed 's/_/-/g'` - { $as_echo "$as_me: error: missing argument to $ac_option" >&2 - { (exit 1); exit 1; }; } -fi - -if test -n "$ac_unrecognized_opts"; then - case $enable_option_checking in - no) ;; - fatal) { $as_echo "$as_me: error: unrecognized options: $ac_unrecognized_opts" >&2 - { (exit 1); exit 1; }; } ;; - *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; - esac -fi - -# Check all directory arguments for consistency. -for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ - datadir sysconfdir sharedstatedir localstatedir includedir \ - oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ - libdir localedir mandir -do - eval ac_val=\$$ac_var - # Remove trailing slashes. - case $ac_val in - */ ) - ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` - eval $ac_var=\$ac_val;; - esac - # Be sure to have absolute directory names. - case $ac_val in - [\\/$]* | ?:[\\/]* ) continue;; - NONE | '' ) case $ac_var in *prefix ) continue;; esac;; - esac - { $as_echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 - { (exit 1); exit 1; }; } -done - -# There might be people who depend on the old broken behavior: `$host' -# used to hold the argument of --host etc. -# FIXME: To remove some day. -build=$build_alias -host=$host_alias -target=$target_alias - -# FIXME: To remove some day. -if test "x$host_alias" != x; then - if test "x$build_alias" = x; then - cross_compiling=maybe - $as_echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. - If a cross compiler is detected then cross compile mode will be used." >&2 - elif test "x$build_alias" != "x$host_alias"; then - cross_compiling=yes - fi -fi - -ac_tool_prefix= -test -n "$host_alias" && ac_tool_prefix=$host_alias- - -test "$silent" = yes && exec 6>/dev/null - - -ac_pwd=`pwd` && test -n "$ac_pwd" && -ac_ls_di=`ls -di .` && -ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || - { $as_echo "$as_me: error: working directory cannot be determined" >&2 - { (exit 1); exit 1; }; } -test "X$ac_ls_di" = "X$ac_pwd_ls_di" || - { $as_echo "$as_me: error: pwd does not report name of working directory" >&2 - { (exit 1); exit 1; }; } - - -# Find the source files, if location was not specified. -if test -z "$srcdir"; then - ac_srcdir_defaulted=yes - # Try the directory containing this script, then the parent directory. - ac_confdir=`$as_dirname -- "$as_myself" || -$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_myself" : 'X\(//\)[^/]' \| \ - X"$as_myself" : 'X\(//\)$' \| \ - X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_myself" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - srcdir=$ac_confdir - if test ! -r "$srcdir/$ac_unique_file"; then - srcdir=.. - fi -else - ac_srcdir_defaulted=no -fi -if test ! -r "$srcdir/$ac_unique_file"; then - test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." - { $as_echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 - { (exit 1); exit 1; }; } -fi -ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" -ac_abs_confdir=`( - cd "$srcdir" && test -r "./$ac_unique_file" || { $as_echo "$as_me: error: $ac_msg" >&2 - { (exit 1); exit 1; }; } - pwd)` -# When building in place, set srcdir=. -if test "$ac_abs_confdir" = "$ac_pwd"; then - srcdir=. -fi -# Remove unnecessary trailing slashes from srcdir. -# Double slashes in file names in object file debugging info -# mess up M-x gdb in Emacs. -case $srcdir in -*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; -esac -for ac_var in $ac_precious_vars; do - eval ac_env_${ac_var}_set=\${${ac_var}+set} - eval ac_env_${ac_var}_value=\$${ac_var} - eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} - eval ac_cv_env_${ac_var}_value=\$${ac_var} -done - -# -# Report the --help message. -# -if test "$ac_init_help" = "long"; then - # Omit some internal or obsolete options to make the list less imposing. - # This message is too long to be a string in the A/UX 3.1 sh. - cat <<_ACEOF -\`configure' configures this package to adapt to many kinds of systems. - -Usage: $0 [OPTION]... [VAR=VALUE]... - -To assign environment variables (e.g., CC, CFLAGS...), specify them as -VAR=VALUE. See below for descriptions of some of the useful variables. - -Defaults for the options are specified in brackets. - -Configuration: - -h, --help display this help and exit - --help=short display options specific to this package - --help=recursive display the short help of all the included packages - -V, --version display version information and exit - -q, --quiet, --silent do not print \`checking...' messages - --cache-file=FILE cache test results in FILE [disabled] - -C, --config-cache alias for \`--cache-file=config.cache' - -n, --no-create do not create output files - --srcdir=DIR find the sources in DIR [configure dir or \`..'] - -Installation directories: - --prefix=PREFIX install architecture-independent files in PREFIX - [$ac_default_prefix] - --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX - [PREFIX] - -By default, \`make install' will install all the files in -\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify -an installation prefix other than \`$ac_default_prefix' using \`--prefix', -for instance \`--prefix=\$HOME'. - -For better control, use the options below. - -Fine tuning of the installation directories: - --bindir=DIR user executables [EPREFIX/bin] - --sbindir=DIR system admin executables [EPREFIX/sbin] - --libexecdir=DIR program executables [EPREFIX/libexec] - --sysconfdir=DIR read-only single-machine data [PREFIX/etc] - --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] - --localstatedir=DIR modifiable single-machine data [PREFIX/var] - --libdir=DIR object code libraries [EPREFIX/lib] - --includedir=DIR C header files [PREFIX/include] - --oldincludedir=DIR C header files for non-gcc [/usr/include] - --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] - --datadir=DIR read-only architecture-independent data [DATAROOTDIR] - --infodir=DIR info documentation [DATAROOTDIR/info] - --localedir=DIR locale-dependent data [DATAROOTDIR/locale] - --mandir=DIR man documentation [DATAROOTDIR/man] - --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE] - --htmldir=DIR html documentation [DOCDIR] - --dvidir=DIR dvi documentation [DOCDIR] - --pdfdir=DIR pdf documentation [DOCDIR] - --psdir=DIR ps documentation [DOCDIR] -_ACEOF - - cat <<\_ACEOF - -System types: - --build=BUILD configure for building on BUILD [guessed] - --host=HOST cross-compile to build programs to run on HOST [BUILD] - --target=TARGET configure for building compilers for TARGET [HOST] -_ACEOF -fi - -if test -n "$ac_init_help"; then - - cat <<\_ACEOF - -_ACEOF -ac_status=$? -fi - -if test "$ac_init_help" = "recursive"; then - # If there are subdirs, report their specific --help. - for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue - test -d "$ac_dir" || - { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || - continue - ac_builddir=. - -case "$ac_dir" in -.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; -*) - ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` - # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` - case $ac_top_builddir_sub in - "") ac_top_builddir_sub=. ac_top_build_prefix= ;; - *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; - esac ;; -esac -ac_abs_top_builddir=$ac_pwd -ac_abs_builddir=$ac_pwd$ac_dir_suffix -# for backward compatibility: -ac_top_builddir=$ac_top_build_prefix - -case $srcdir in - .) # We are building in place. - ac_srcdir=. - ac_top_srcdir=$ac_top_builddir_sub - ac_abs_top_srcdir=$ac_pwd ;; - [\\/]* | ?:[\\/]* ) # Absolute name. - ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir - ac_abs_top_srcdir=$srcdir ;; - *) # Relative name. - ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_build_prefix$srcdir - ac_abs_top_srcdir=$ac_pwd/$srcdir ;; -esac -ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix - - cd "$ac_dir" || { ac_status=$?; continue; } - # Check for guested configure. - if test -f "$ac_srcdir/configure.gnu"; then - echo && - $SHELL "$ac_srcdir/configure.gnu" --help=recursive - elif test -f "$ac_srcdir/configure"; then - echo && - $SHELL "$ac_srcdir/configure" --help=recursive - else - $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 - fi || ac_status=$? - cd "$ac_pwd" || { ac_status=$?; break; } - done -fi - -test -n "$ac_init_help" && exit $ac_status -if $ac_init_version; then - cat <<\_ACEOF -configure -generated by GNU Autoconf 2.63 - -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. -This configure script is free software; the Free Software Foundation -gives unlimited permission to copy, distribute and modify it. -_ACEOF - exit -fi -cat >config.log <<_ACEOF -This file contains any messages produced by compilers while -running configure, to aid debugging if configure makes a mistake. - -It was created by $as_me, which was -generated by GNU Autoconf 2.63. Invocation command line was - - $ $0 $@ - -_ACEOF -exec 5>>config.log -{ -cat <<_ASUNAME -## --------- ## -## Platform. ## -## --------- ## - -hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` -uname -m = `(uname -m) 2>/dev/null || echo unknown` -uname -r = `(uname -r) 2>/dev/null || echo unknown` -uname -s = `(uname -s) 2>/dev/null || echo unknown` -uname -v = `(uname -v) 2>/dev/null || echo unknown` - -/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` -/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` - -/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` -/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` -/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` -/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` -/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` -/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` -/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` - -_ASUNAME - -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - $as_echo "PATH: $as_dir" -done -IFS=$as_save_IFS - -} >&5 - -cat >&5 <<_ACEOF - - -## ----------- ## -## Core tests. ## -## ----------- ## - -_ACEOF - - -# Keep a trace of the command line. -# Strip out --no-create and --no-recursion so they do not pile up. -# Strip out --silent because we don't want to record it for future runs. -# Also quote any args containing shell meta-characters. -# Make two passes to allow for proper duplicate-argument suppression. -ac_configure_args= -ac_configure_args0= -ac_configure_args1= -ac_must_keep_next=false -for ac_pass in 1 2 -do - for ac_arg - do - case $ac_arg in - -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil) - continue ;; - *\'*) - ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; - esac - case $ac_pass in - 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; - 2) - ac_configure_args1="$ac_configure_args1 '$ac_arg'" - if test $ac_must_keep_next = true; then - ac_must_keep_next=false # Got value, back to normal. - else - case $ac_arg in - *=* | --config-cache | -C | -disable-* | --disable-* \ - | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ - | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ - | -with-* | --with-* | -without-* | --without-* | --x) - case "$ac_configure_args0 " in - "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; - esac - ;; - -* ) ac_must_keep_next=true ;; - esac - fi - ac_configure_args="$ac_configure_args '$ac_arg'" - ;; - esac - done -done -$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } -$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } - -# When interrupted or exit'd, cleanup temporary files, and complete -# config.log. We remove comments because anyway the quotes in there -# would cause problems or look ugly. -# WARNING: Use '\'' to represent an apostrophe within the trap. -# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. -trap 'exit_status=$? - # Save into config.log some information that might help in debugging. - { - echo - - cat <<\_ASBOX -## ---------------- ## -## Cache variables. ## -## ---------------- ## -_ASBOX - echo - # The following way of writing the cache mishandles newlines in values, -( - for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do - eval ac_val=\$$ac_var - case $ac_val in #( - *${as_nl}*) - case $ac_var in #( - *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5 -$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; - esac - case $ac_var in #( - _ | IFS | as_nl) ;; #( - BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( - *) $as_unset $ac_var ;; - esac ;; - esac - done - (set) 2>&1 | - case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( - *${as_nl}ac_space=\ *) - sed -n \ - "s/'\''/'\''\\\\'\'''\''/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" - ;; #( - *) - sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" - ;; - esac | - sort -) - echo - - cat <<\_ASBOX -## ----------------- ## -## Output variables. ## -## ----------------- ## -_ASBOX - echo - for ac_var in $ac_subst_vars - do - eval ac_val=\$$ac_var - case $ac_val in - *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; - esac - $as_echo "$ac_var='\''$ac_val'\''" - done | sort - echo - - if test -n "$ac_subst_files"; then - cat <<\_ASBOX -## ------------------- ## -## File substitutions. ## -## ------------------- ## -_ASBOX - echo - for ac_var in $ac_subst_files - do - eval ac_val=\$$ac_var - case $ac_val in - *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; - esac - $as_echo "$ac_var='\''$ac_val'\''" - done | sort - echo - fi - - if test -s confdefs.h; then - cat <<\_ASBOX -## ----------- ## -## confdefs.h. ## -## ----------- ## -_ASBOX - echo - cat confdefs.h - echo - fi - test "$ac_signal" != 0 && - $as_echo "$as_me: caught signal $ac_signal" - $as_echo "$as_me: exit $exit_status" - } >&5 - rm -f core *.core core.conftest.* && - rm -f -r conftest* confdefs* conf$$* $ac_clean_files && - exit $exit_status -' 0 -for ac_signal in 1 2 13 15; do - trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal -done -ac_signal=0 - -# confdefs.h avoids OS command line length limits that DEFS can exceed. -rm -f -r conftest* confdefs.h - -# Predefined preprocessor variables. - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_NAME "$PACKAGE_NAME" -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_TARNAME "$PACKAGE_TARNAME" -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_VERSION "$PACKAGE_VERSION" -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_STRING "$PACKAGE_STRING" -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" -_ACEOF - - -# Let the site file select an alternate cache file if it wants to. -# Prefer an explicitly selected file to automatically selected ones. -ac_site_file1=NONE -ac_site_file2=NONE -if test -n "$CONFIG_SITE"; then - ac_site_file1=$CONFIG_SITE -elif test "x$prefix" != xNONE; then - ac_site_file1=$prefix/share/config.site - ac_site_file2=$prefix/etc/config.site -else - ac_site_file1=$ac_default_prefix/share/config.site - ac_site_file2=$ac_default_prefix/etc/config.site -fi -for ac_site_file in "$ac_site_file1" "$ac_site_file2" -do - test "x$ac_site_file" = xNONE && continue - if test -r "$ac_site_file"; then - { $as_echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 -$as_echo "$as_me: loading site script $ac_site_file" >&6;} - sed 's/^/| /' "$ac_site_file" >&5 - . "$ac_site_file" - fi -done - -if test -r "$cache_file"; then - # Some versions of bash will fail to source /dev/null (special - # files actually), so we avoid doing that. - if test -f "$cache_file"; then - { $as_echo "$as_me:$LINENO: loading cache $cache_file" >&5 -$as_echo "$as_me: loading cache $cache_file" >&6;} - case $cache_file in - [\\/]* | ?:[\\/]* ) . "$cache_file";; - *) . "./$cache_file";; - esac - fi -else - { $as_echo "$as_me:$LINENO: creating cache $cache_file" >&5 -$as_echo "$as_me: creating cache $cache_file" >&6;} - >$cache_file -fi - -# Check that the precious variables saved in the cache have kept the same -# value. -ac_cache_corrupted=false -for ac_var in $ac_precious_vars; do - eval ac_old_set=\$ac_cv_env_${ac_var}_set - eval ac_new_set=\$ac_env_${ac_var}_set - eval ac_old_val=\$ac_cv_env_${ac_var}_value - eval ac_new_val=\$ac_env_${ac_var}_value - case $ac_old_set,$ac_new_set in - set,) - { $as_echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 -$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,set) - { $as_echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 -$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,);; - *) - if test "x$ac_old_val" != "x$ac_new_val"; then - # differences in whitespace do not lead to failure. - ac_old_val_w=`echo x $ac_old_val` - ac_new_val_w=`echo x $ac_new_val` - if test "$ac_old_val_w" != "$ac_new_val_w"; then - { $as_echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 -$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} - ac_cache_corrupted=: - else - { $as_echo "$as_me:$LINENO: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 -$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} - eval $ac_var=\$ac_old_val - fi - { $as_echo "$as_me:$LINENO: former value: \`$ac_old_val'" >&5 -$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} - { $as_echo "$as_me:$LINENO: current value: \`$ac_new_val'" >&5 -$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} - fi;; - esac - # Pass precious variables to config.status. - if test "$ac_new_set" = set; then - case $ac_new_val in - *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; - *) ac_arg=$ac_var=$ac_new_val ;; - esac - case " $ac_configure_args " in - *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. - *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; - esac - fi -done -if $ac_cache_corrupted; then - { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} - { $as_echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 -$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} - { { $as_echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 -$as_echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} - { (exit 1); exit 1; }; } -fi - - - - - - - - - - - - - - - - - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - - -CC=${CC-cc} - -AS=${AS-as} - -AR=${AR-ar} - -LD=${LD-ld} - -RANLIB=${RANLIB-ranlib} - -DLLTOOL=${DLLTOOL-dlltool} - -DLLWRAP=${DLLWRAP-dllwrap} - -ac_aux_dir= -for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do - if test -f "$ac_dir/install-sh"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install-sh -c" - break - elif test -f "$ac_dir/install.sh"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install.sh -c" - break - elif test -f "$ac_dir/shtool"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/shtool install -c" - break - fi -done -if test -z "$ac_aux_dir"; then - { { $as_echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5 -$as_echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;} - { (exit 1); exit 1; }; } -fi - -# These three variables are undocumented and unsupported, -# and are intended to be withdrawn in a future Autoconf release. -# They can cause serious problems if a builder's source tree is in a directory -# whose full name contains unusual characters. -ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. -ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. -ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. - - -# Make sure we can run config.sub. -$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || - { { $as_echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5 -$as_echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;} - { (exit 1); exit 1; }; } - -{ $as_echo "$as_me:$LINENO: checking build system type" >&5 -$as_echo_n "checking build system type... " >&6; } -if test "${ac_cv_build+set}" = set; then - $as_echo_n "(cached) " >&6 -else - ac_build_alias=$build_alias -test "x$ac_build_alias" = x && - ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` -test "x$ac_build_alias" = x && - { { $as_echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 -$as_echo "$as_me: error: cannot guess build type; you must specify one" >&2;} - { (exit 1); exit 1; }; } -ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || - { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5 -$as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;} - { (exit 1); exit 1; }; } - -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_build" >&5 -$as_echo "$ac_cv_build" >&6; } -case $ac_cv_build in -*-*-*) ;; -*) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical build" >&5 -$as_echo "$as_me: error: invalid value of canonical build" >&2;} - { (exit 1); exit 1; }; };; -esac -build=$ac_cv_build -ac_save_IFS=$IFS; IFS='-' -set x $ac_cv_build -shift -build_cpu=$1 -build_vendor=$2 -shift; shift -# Remember, the first character of IFS is used to create $*, -# except with old shells: -build_os=$* -IFS=$ac_save_IFS -case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac - - -{ $as_echo "$as_me:$LINENO: checking host system type" >&5 -$as_echo_n "checking host system type... " >&6; } -if test "${ac_cv_host+set}" = set; then - $as_echo_n "(cached) " >&6 -else - if test "x$host_alias" = x; then - ac_cv_host=$ac_cv_build -else - ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || - { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5 -$as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;} - { (exit 1); exit 1; }; } -fi - -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_host" >&5 -$as_echo "$ac_cv_host" >&6; } -case $ac_cv_host in -*-*-*) ;; -*) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical host" >&5 -$as_echo "$as_me: error: invalid value of canonical host" >&2;} - { (exit 1); exit 1; }; };; -esac -host=$ac_cv_host -ac_save_IFS=$IFS; IFS='-' -set x $ac_cv_host -shift -host_cpu=$1 -host_vendor=$2 -shift; shift -# Remember, the first character of IFS is used to create $*, -# except with old shells: -host_os=$* -IFS=$ac_save_IFS -case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac - - -{ $as_echo "$as_me:$LINENO: checking target system type" >&5 -$as_echo_n "checking target system type... " >&6; } -if test "${ac_cv_target+set}" = set; then - $as_echo_n "(cached) " >&6 -else - if test "x$target_alias" = x; then - ac_cv_target=$ac_cv_host -else - ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` || - { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $target_alias failed" >&5 -$as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $target_alias failed" >&2;} - { (exit 1); exit 1; }; } -fi - -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_target" >&5 -$as_echo "$ac_cv_target" >&6; } -case $ac_cv_target in -*-*-*) ;; -*) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical target" >&5 -$as_echo "$as_me: error: invalid value of canonical target" >&2;} - { (exit 1); exit 1; }; };; -esac -target=$ac_cv_target -ac_save_IFS=$IFS; IFS='-' -set x $ac_cv_target -shift -target_cpu=$1 -target_vendor=$2 -shift; shift -# Remember, the first character of IFS is used to create $*, -# except with old shells: -target_os=$* -IFS=$ac_save_IFS -case $target_os in *\ *) target_os=`echo "$target_os" | sed 's/ /-/g'`;; esac - - -# The aliases save the names the user supplied, while $host etc. -# will get canonicalized. -test -n "$target_alias" && - test "$program_prefix$program_suffix$program_transform_name" = \ - NONENONEs,x,x, && - program_prefix=${target_alias}- - -LIBGMON_A=libgmon.a - -case "$target_os" in -*mingw32crt*) - CRT_ID=1 - NO_CYGWIN= - RUNTIME=crtdll - CRT0S="gcrt1.o gcrt2.o" - ;; -*cygwin*) - CRT_ID=2 - NO_CYGWIN="$(cd ${srcdir}/../../utils; pwd)/mingw" - RUNTIME=msvcrt - CRT0S=gcrt0.o - # Do not build libm.a when building under Cygwin winsup. Otherwise, it'll - # overwrite Cygwin's one. Likewise for libgmon.a. - ;; -*) - # Build it for MSVCRT by default. - CRT_ID=2 - NO_CYGWIN= - RUNTIME=msvcrt - CRT0S="gcrt1.o gcrt2.o" - ;; -esac - -W32API_INCLUDE='-I $(srcdir)/../../w32api/include' - - - - - - - - -# Find a good install program. We prefer a C program (faster), -# so one script is as good as another. But avoid the broken or -# incompatible versions: -# SysV /etc/install, /usr/sbin/install -# SunOS /usr/etc/install -# IRIX /sbin/install -# AIX /bin/install -# AmigaOS /C/install, which installs bootblocks on floppy discs -# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag -# AFS /usr/afsws/bin/install, which mishandles nonexistent args -# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" -# OS/2's system install, which has a completely different semantic -# ./install, which can be erroneously created by make from ./install.sh. -# Reject install programs that cannot install multiple files. -{ $as_echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 -$as_echo_n "checking for a BSD-compatible install... " >&6; } -if test -z "$INSTALL"; then -if test "${ac_cv_path_install+set}" = set; then - $as_echo_n "(cached) " >&6 -else - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - # Account for people who put trailing slashes in PATH elements. -case $as_dir/ in - ./ | .// | /cC/* | \ - /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ - ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ - /usr/ucb/* ) ;; - *) - # OSF1 and SCO ODT 3.0 have their own names for install. - # Don't use installbsd from OSF since it installs stuff as root - # by default. - for ac_prog in ginstall scoinst install; do - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then - if test $ac_prog = install && - grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then - # AIX install. It has an incompatible calling convention. - : - elif test $ac_prog = install && - grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then - # program-specific install script used by HP pwplus--don't use. - : - else - rm -rf conftest.one conftest.two conftest.dir - echo one > conftest.one - echo two > conftest.two - mkdir conftest.dir - if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && - test -s conftest.one && test -s conftest.two && - test -s conftest.dir/conftest.one && - test -s conftest.dir/conftest.two - then - ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" - break 3 - fi - fi - fi - done - done - ;; -esac - -done -IFS=$as_save_IFS - -rm -rf conftest.one conftest.two conftest.dir - -fi - if test "${ac_cv_path_install+set}" = set; then - INSTALL=$ac_cv_path_install - else - # As a last resort, use the slow shell script. Don't cache a - # value for INSTALL within a source directory, because that will - # break other packages using the cache if that directory is - # removed, or if the value is a relative name. - INSTALL=$ac_install_sh - fi -fi -{ $as_echo "$as_me:$LINENO: result: $INSTALL" >&5 -$as_echo "$INSTALL" >&6; } - -# Use test -z because SunOS4 sh mishandles braces in ${var-val}. -# It thinks the first close brace ends the variable substitution. -test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' - -test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' - -test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' - -ac_config_files="$ac_config_files Makefile" - -cat >confcache <<\_ACEOF -# This file is a shell script that caches the results of configure -# tests run on this system so they can be shared between configure -# scripts and configure runs, see configure's option --config-cache. -# It is not useful on other systems. If it contains results you don't -# want to keep, you may remove or edit it. -# -# config.status only pays attention to the cache file if you give it -# the --recheck option to rerun configure. -# -# `ac_cv_env_foo' variables (set or unset) will be overridden when -# loading this file, other *unset* `ac_cv_foo' will be assigned the -# following values. - -_ACEOF - -# The following way of writing the cache mishandles newlines in values, -# but we know of no workaround that is simple, portable, and efficient. -# So, we kill variables containing newlines. -# Ultrix sh set writes to stderr and can't be redirected directly, -# and sets the high bit in the cache file unless we assign to the vars. -( - for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do - eval ac_val=\$$ac_var - case $ac_val in #( - *${as_nl}*) - case $ac_var in #( - *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5 -$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; - esac - case $ac_var in #( - _ | IFS | as_nl) ;; #( - BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( - *) $as_unset $ac_var ;; - esac ;; - esac - done - - (set) 2>&1 | - case $as_nl`(ac_space=' '; set) 2>&1` in #( - *${as_nl}ac_space=\ *) - # `set' does not quote correctly, so add quotes (double-quote - # substitution turns \\\\ into \\, and sed turns \\ into \). - sed -n \ - "s/'/'\\\\''/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" - ;; #( - *) - # `set' quotes correctly as required by POSIX, so do not add quotes. - sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" - ;; - esac | - sort -) | - sed ' - /^ac_cv_env_/b end - t clear - :clear - s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ - t end - s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ - :end' >>confcache -if diff "$cache_file" confcache >/dev/null 2>&1; then :; else - if test -w "$cache_file"; then - test "x$cache_file" != "x/dev/null" && - { $as_echo "$as_me:$LINENO: updating cache $cache_file" >&5 -$as_echo "$as_me: updating cache $cache_file" >&6;} - cat confcache >$cache_file - else - { $as_echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 -$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} - fi -fi -rm -f confcache - -test "x$prefix" = xNONE && prefix=$ac_default_prefix -# Let make expand exec_prefix. -test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' - -# Transform confdefs.h into DEFS. -# Protect against shell expansion while executing Makefile rules. -# Protect against Makefile macro expansion. -# -# If the first sed substitution is executed (which looks for macros that -# take arguments), then branch to the quote section. Otherwise, -# look for a macro that doesn't take arguments. -ac_script=' -:mline -/\\$/{ - N - s,\\\n,, - b mline -} -t clear -:clear -s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g -t quote -s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g -t quote -b any -:quote -s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g -s/\[/\\&/g -s/\]/\\&/g -s/\$/$$/g -H -:any -${ - g - s/^\n// - s/\n/ /g - p -} -' -DEFS=`sed -n "$ac_script" confdefs.h` - - -ac_libobjs= -ac_ltlibobjs= -for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue - # 1. Remove the extension, and $U if already installed. - ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' - ac_i=`$as_echo "$ac_i" | sed "$ac_script"` - # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR - # will be set to the directory where LIBOBJS objects are built. - ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" - ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' -done -LIBOBJS=$ac_libobjs - -LTLIBOBJS=$ac_ltlibobjs - - - -: ${CONFIG_STATUS=./config.status} -ac_write_fail=0 -ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files $CONFIG_STATUS" -{ $as_echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 -$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} -cat >$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -#! $SHELL -# Generated by $as_me. -# Run this file to recreate the current configuration. -# Compiler output produced by configure, useful for debugging -# configure, is in config.log if it exists. - -debug=false -ac_cs_recheck=false -ac_cs_silent=false -SHELL=\${CONFIG_SHELL-$SHELL} -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -## --------------------- ## -## M4sh Initialization. ## -## --------------------- ## - -# Be more Bourne compatible -DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in - *posix*) set -o posix ;; -esac - -fi - - - - -# PATH needs CR -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits - -as_nl=' -' -export as_nl -# Printing a long string crashes Solaris 7 /usr/bin/printf. -as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo -if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='printf %s\n' - as_echo_n='printf %s' -else - if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then - as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' - as_echo_n='/usr/ucb/echo -n' - else - as_echo_body='eval expr "X$1" : "X\\(.*\\)"' - as_echo_n_body='eval - arg=$1; - case $arg in - *"$as_nl"*) - expr "X$arg" : "X\\(.*\\)$as_nl"; - arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; - esac; - expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" - ' - export as_echo_n_body - as_echo_n='sh -c $as_echo_n_body as_echo' - fi - export as_echo_body - as_echo='sh -c $as_echo_body as_echo' -fi - -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - PATH_SEPARATOR=: - (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { - (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || - PATH_SEPARATOR=';' - } -fi - -# Support unset when possible. -if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then - as_unset=unset -else - as_unset=false -fi - - -# IFS -# We need space, tab and new line, in precisely that order. Quoting is -# there to prevent editors from complaining about space-tab. -# (If _AS_PATH_WALK were called with IFS unset, it would disable word -# splitting by setting IFS to empty value.) -IFS=" "" $as_nl" - -# Find who we are. Look in the path if we contain no directory separator. -case $0 in - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break -done -IFS=$as_save_IFS - - ;; -esac -# We did not find ourselves, most probably we were run as `sh COMMAND' -# in which case we are not to be found in the path. -if test "x$as_myself" = x; then - as_myself=$0 -fi -if test ! -f "$as_myself"; then - $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 - { (exit 1); exit 1; } -fi - -# Work around bugs in pre-3.0 UWIN ksh. -for as_var in ENV MAIL MAILPATH -do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var -done -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -LC_ALL=C -export LC_ALL -LANGUAGE=C -export LANGUAGE - -# Required to use basename. -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi - -if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then - as_basename=basename -else - as_basename=false -fi - - -# Name of the executable. -as_me=`$as_basename -- "$0" || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ - s//\1/ - q - } - /^X\/\(\/\/\)$/{ - s//\1/ - q - } - /^X\/\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - -# CDPATH. -$as_unset CDPATH - - - - as_lineno_1=$LINENO - as_lineno_2=$LINENO - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { - - # Create $as_me.lineno as a copy of $as_myself, but with $LINENO - # uniformly replaced by the line number. The first 'sed' inserts a - # line-number line after each line using $LINENO; the second 'sed' - # does the real work. The second script uses 'N' to pair each - # line-number line with the line containing $LINENO, and appends - # trailing '-' during substitution so that $LINENO is not a special - # case at line end. - # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the - # scripts with optimization help from Paolo Bonzini. Blame Lee - # E. McMahon (1931-1989) for sed's syntax. :-) - sed -n ' - p - /[$]LINENO/= - ' <$as_myself | - sed ' - s/[$]LINENO.*/&-/ - t lineno - b - :lineno - N - :loop - s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ - t loop - s/-\n.*// - ' >$as_me.lineno && - chmod +x "$as_me.lineno" || - { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 - { (exit 1); exit 1; }; } - - # Don't try to exec as it changes $[0], causing all sort of problems - # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensitive to this). - . "./$as_me.lineno" - # Exit status is that of the last command. - exit -} - - -if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then - as_dirname=dirname -else - as_dirname=false -fi - -ECHO_C= ECHO_N= ECHO_T= -case `echo -n x` in --n*) - case `echo 'x\c'` in - *c*) ECHO_T=' ';; # ECHO_T is single tab character. - *) ECHO_C='\c';; - esac;; -*) - ECHO_N='-n';; -esac -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi - -rm -f conf$$ conf$$.exe conf$$.file -if test -d conf$$.dir; then - rm -f conf$$.dir/conf$$.file -else - rm -f conf$$.dir - mkdir conf$$.dir 2>/dev/null -fi -if (echo >conf$$.file) 2>/dev/null; then - if ln -s conf$$.file conf$$ 2>/dev/null; then - as_ln_s='ln -s' - # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -p'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -p' - elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln - else - as_ln_s='cp -p' - fi -else - as_ln_s='cp -p' -fi -rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file -rmdir conf$$.dir 2>/dev/null - -if mkdir -p . 2>/dev/null; then - as_mkdir_p=: -else - test -d ./-p && rmdir ./-p - as_mkdir_p=false -fi - -if test -x / >/dev/null 2>&1; then - as_test_x='test -x' -else - if ls -dL / >/dev/null 2>&1; then - as_ls_L_option=L - else - as_ls_L_option= - fi - as_test_x=' - eval sh -c '\'' - if test -d "$1"; then - test -d "$1/."; - else - case $1 in - -*)set "./$1";; - esac; - case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in - ???[sx]*):;;*)false;;esac;fi - '\'' sh - ' -fi -as_executable_p=$as_test_x - -# Sed expression to map a string onto a valid CPP name. -as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" - -# Sed expression to map a string onto a valid variable name. -as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" - - -exec 6>&1 - -# Save the log message, to keep $[0] and so on meaningful, and to -# report actual input values of CONFIG_FILES etc. instead of their -# values after options handling. -ac_log=" -This file was extended by $as_me, which was -generated by GNU Autoconf 2.63. Invocation command line was - - CONFIG_FILES = $CONFIG_FILES - CONFIG_HEADERS = $CONFIG_HEADERS - CONFIG_LINKS = $CONFIG_LINKS - CONFIG_COMMANDS = $CONFIG_COMMANDS - $ $0 $@ - -on `(hostname || uname -n) 2>/dev/null | sed 1q` -" - -_ACEOF - -case $ac_config_files in *" -"*) set x $ac_config_files; shift; ac_config_files=$*;; -esac - - - -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -# Files that config.status was made for. -config_files="$ac_config_files" - -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -ac_cs_usage="\ -\`$as_me' instantiates files from templates according to the -current configuration. - -Usage: $0 [OPTION]... [FILE]... - - -h, --help print this help, then exit - -V, --version print version number and configuration settings, then exit - -q, --quiet, --silent - do not print progress messages - -d, --debug don't remove temporary files - --recheck update $as_me by reconfiguring in the same conditions - --file=FILE[:TEMPLATE] - instantiate the configuration file FILE - -Configuration files: -$config_files - -Report bugs to <bug-autoconf@gnu.org>." - -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -ac_cs_version="\\ -config.status -configured by $0, generated by GNU Autoconf 2.63, - with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" - -Copyright (C) 2008 Free Software Foundation, Inc. -This config.status script is free software; the Free Software Foundation -gives unlimited permission to copy, distribute and modify it." - -ac_pwd='$ac_pwd' -srcdir='$srcdir' -INSTALL='$INSTALL' -test -n "\$AWK" || AWK=awk -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -# The default lists apply if the user does not specify any file. -ac_need_defaults=: -while test $# != 0 -do - case $1 in - --*=*) - ac_option=`expr "X$1" : 'X\([^=]*\)='` - ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` - ac_shift=: - ;; - *) - ac_option=$1 - ac_optarg=$2 - ac_shift=shift - ;; - esac - - case $ac_option in - # Handling of the options. - -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) - ac_cs_recheck=: ;; - --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) - $as_echo "$ac_cs_version"; exit ;; - --debug | --debu | --deb | --de | --d | -d ) - debug=: ;; - --file | --fil | --fi | --f ) - $ac_shift - case $ac_optarg in - *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; - esac - CONFIG_FILES="$CONFIG_FILES '$ac_optarg'" - ac_need_defaults=false;; - --he | --h | --help | --hel | -h ) - $as_echo "$ac_cs_usage"; exit ;; - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil | --si | --s) - ac_cs_silent=: ;; - - # This is an error. - -*) { $as_echo "$as_me: error: unrecognized option: $1 -Try \`$0 --help' for more information." >&2 - { (exit 1); exit 1; }; } ;; - - *) ac_config_targets="$ac_config_targets $1" - ac_need_defaults=false ;; - - esac - shift -done - -ac_configure_extra_args= - -if $ac_cs_silent; then - exec 6>/dev/null - ac_configure_extra_args="$ac_configure_extra_args --silent" -fi - -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -if \$ac_cs_recheck; then - set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion - shift - \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 - CONFIG_SHELL='$SHELL' - export CONFIG_SHELL - exec "\$@" -fi - -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -exec 5>>config.log -{ - echo - sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX -## Running $as_me. ## -_ASBOX - $as_echo "$ac_log" -} >&5 - -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 - -# Handling of arguments. -for ac_config_target in $ac_config_targets -do - case $ac_config_target in - "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; - - *) { { $as_echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 -$as_echo "$as_me: error: invalid argument: $ac_config_target" >&2;} - { (exit 1); exit 1; }; };; - esac -done - - -# If the user did not use the arguments to specify the items to instantiate, -# then the envvar interface is used. Set only those that are not. -# We use the long form for the default assignment because of an extremely -# bizarre bug on SunOS 4.1.3. -if $ac_need_defaults; then - test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files -fi - -# Have a temporary directory for convenience. Make it in the build tree -# simply because there is no reason against having it here, and in addition, -# creating and moving files from /tmp can sometimes cause problems. -# Hook for its removal unless debugging. -# Note that there is a small window in which the directory will not be cleaned: -# after its creation but before its name has been assigned to `$tmp'. -$debug || -{ - tmp= - trap 'exit_status=$? - { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status -' 0 - trap '{ (exit 1); exit 1; }' 1 2 13 15 -} -# Create a (secure) tmp directory for tmp files. - -{ - tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && - test -n "$tmp" && test -d "$tmp" -} || -{ - tmp=./conf$$-$RANDOM - (umask 077 && mkdir "$tmp") -} || -{ - $as_echo "$as_me: cannot create a temporary directory in ." >&2 - { (exit 1); exit 1; } -} - -# Set up the scripts for CONFIG_FILES section. -# No need to generate them if there are no CONFIG_FILES. -# This happens for instance with `./config.status config.h'. -if test -n "$CONFIG_FILES"; then - - -ac_cr='
' -ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null` -if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then - ac_cs_awk_cr='\\r' -else - ac_cs_awk_cr=$ac_cr -fi - -echo 'BEGIN {' >"$tmp/subs1.awk" && -_ACEOF - - -{ - echo "cat >conf$$subs.awk <<_ACEOF" && - echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && - echo "_ACEOF" -} >conf$$subs.sh || - { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 -$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} - { (exit 1); exit 1; }; } -ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'` -ac_delim='%!_!# ' -for ac_last_try in false false false false false :; do - . ./conf$$subs.sh || - { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 -$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} - { (exit 1); exit 1; }; } - - ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` - if test $ac_delim_n = $ac_delim_num; then - break - elif $ac_last_try; then - { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 -$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} - { (exit 1); exit 1; }; } - else - ac_delim="$ac_delim!$ac_delim _$ac_delim!! " - fi -done -rm -f conf$$subs.sh - -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -cat >>"\$tmp/subs1.awk" <<\\_ACAWK && -_ACEOF -sed -n ' -h -s/^/S["/; s/!.*/"]=/ -p -g -s/^[^!]*!// -:repl -t repl -s/'"$ac_delim"'$// -t delim -:nl -h -s/\(.\{148\}\).*/\1/ -t more1 -s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ -p -n -b repl -:more1 -s/["\\]/\\&/g; s/^/"/; s/$/"\\/ -p -g -s/.\{148\}// -t nl -:delim -h -s/\(.\{148\}\).*/\1/ -t more2 -s/["\\]/\\&/g; s/^/"/; s/$/"/ -p -b -:more2 -s/["\\]/\\&/g; s/^/"/; s/$/"\\/ -p -g -s/.\{148\}// -t delim -' <conf$$subs.awk | sed ' -/^[^""]/{ - N - s/\n// -} -' >>$CONFIG_STATUS || ac_write_fail=1 -rm -f conf$$subs.awk -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -_ACAWK -cat >>"\$tmp/subs1.awk" <<_ACAWK && - for (key in S) S_is_set[key] = 1 - FS = "" - -} -{ - line = $ 0 - nfields = split(line, field, "@") - substed = 0 - len = length(field[1]) - for (i = 2; i < nfields; i++) { - key = field[i] - keylen = length(key) - if (S_is_set[key]) { - value = S[key] - line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) - len += length(value) + length(field[++i]) - substed = 1 - } else - len += 1 + keylen - } - - print line -} - -_ACAWK -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then - sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" -else - cat -fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \ - || { { $as_echo "$as_me:$LINENO: error: could not setup config files machinery" >&5 -$as_echo "$as_me: error: could not setup config files machinery" >&2;} - { (exit 1); exit 1; }; } -_ACEOF - -# VPATH may cause trouble with some makes, so we remove $(srcdir), -# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and -# trailing colons and then remove the whole line if VPATH becomes empty -# (actually we leave an empty line to preserve line numbers). -if test "x$srcdir" = x.; then - ac_vpsub='/^[ ]*VPATH[ ]*=/{ -s/:*\$(srcdir):*/:/ -s/:*\${srcdir}:*/:/ -s/:*@srcdir@:*/:/ -s/^\([^=]*=[ ]*\):*/\1/ -s/:*$// -s/^[^=]*=[ ]*$// -}' -fi - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -fi # test -n "$CONFIG_FILES" - - -eval set X " :F $CONFIG_FILES " -shift -for ac_tag -do - case $ac_tag in - :[FHLC]) ac_mode=$ac_tag; continue;; - esac - case $ac_mode$ac_tag in - :[FHL]*:*);; - :L* | :C*:*) { { $as_echo "$as_me:$LINENO: error: invalid tag $ac_tag" >&5 -$as_echo "$as_me: error: invalid tag $ac_tag" >&2;} - { (exit 1); exit 1; }; };; - :[FH]-) ac_tag=-:-;; - :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; - esac - ac_save_IFS=$IFS - IFS=: - set x $ac_tag - IFS=$ac_save_IFS - shift - ac_file=$1 - shift - - case $ac_mode in - :L) ac_source=$1;; - :[FH]) - ac_file_inputs= - for ac_f - do - case $ac_f in - -) ac_f="$tmp/stdin";; - *) # Look for the file first in the build tree, then in the source tree - # (if the path is not absolute). The absolute path cannot be DOS-style, - # because $ac_f cannot contain `:'. - test -f "$ac_f" || - case $ac_f in - [\\/$]*) false;; - *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; - esac || - { { $as_echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 -$as_echo "$as_me: error: cannot find input file: $ac_f" >&2;} - { (exit 1); exit 1; }; };; - esac - case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac - ac_file_inputs="$ac_file_inputs '$ac_f'" - done - - # Let's still pretend it is `configure' which instantiates (i.e., don't - # use $as_me), people would be surprised to read: - # /* config.h. Generated by config.status. */ - configure_input='Generated from '` - $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' - `' by configure.' - if test x"$ac_file" != x-; then - configure_input="$ac_file. $configure_input" - { $as_echo "$as_me:$LINENO: creating $ac_file" >&5 -$as_echo "$as_me: creating $ac_file" >&6;} - fi - # Neutralize special characters interpreted by sed in replacement strings. - case $configure_input in #( - *\&* | *\|* | *\\* ) - ac_sed_conf_input=`$as_echo "$configure_input" | - sed 's/[\\\\&|]/\\\\&/g'`;; #( - *) ac_sed_conf_input=$configure_input;; - esac - - case $ac_tag in - *:-:* | *:-) cat >"$tmp/stdin" \ - || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 -$as_echo "$as_me: error: could not create $ac_file" >&2;} - { (exit 1); exit 1; }; } ;; - esac - ;; - esac - - ac_dir=`$as_dirname -- "$ac_file" || -$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$ac_file" : 'X\(//\)[^/]' \| \ - X"$ac_file" : 'X\(//\)$' \| \ - X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$ac_file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - { as_dir="$ac_dir" - case $as_dir in #( - -*) as_dir=./$as_dir;; - esac - test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { - as_dirs= - while :; do - case $as_dir in #( - *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( - *) as_qdir=$as_dir;; - esac - as_dirs="'$as_qdir' $as_dirs" - as_dir=`$as_dirname -- "$as_dir" || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - test -d "$as_dir" && break - done - test -z "$as_dirs" || eval "mkdir $as_dirs" - } || test -d "$as_dir" || { { $as_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 -$as_echo "$as_me: error: cannot create directory $as_dir" >&2;} - { (exit 1); exit 1; }; }; } - ac_builddir=. - -case "$ac_dir" in -.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; -*) - ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` - # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` - case $ac_top_builddir_sub in - "") ac_top_builddir_sub=. ac_top_build_prefix= ;; - *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; - esac ;; -esac -ac_abs_top_builddir=$ac_pwd -ac_abs_builddir=$ac_pwd$ac_dir_suffix -# for backward compatibility: -ac_top_builddir=$ac_top_build_prefix - -case $srcdir in - .) # We are building in place. - ac_srcdir=. - ac_top_srcdir=$ac_top_builddir_sub - ac_abs_top_srcdir=$ac_pwd ;; - [\\/]* | ?:[\\/]* ) # Absolute name. - ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir - ac_abs_top_srcdir=$srcdir ;; - *) # Relative name. - ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_build_prefix$srcdir - ac_abs_top_srcdir=$ac_pwd/$srcdir ;; -esac -ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix - - - case $ac_mode in - :F) - # - # CONFIG_FILE - # - - case $INSTALL in - [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; - *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; - esac -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -# If the template does not know about datarootdir, expand it. -# FIXME: This hack should be removed a few years after 2.60. -ac_datarootdir_hack=; ac_datarootdir_seen= - -ac_sed_dataroot=' -/datarootdir/ { - p - q -} -/@datadir@/p -/@docdir@/p -/@infodir@/p -/@localedir@/p -/@mandir@/p -' -case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in -*datarootdir*) ac_datarootdir_seen=yes;; -*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) - { $as_echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 -$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 - ac_datarootdir_hack=' - s&@datadir@&$datadir&g - s&@docdir@&$docdir&g - s&@infodir@&$infodir&g - s&@localedir@&$localedir&g - s&@mandir@&$mandir&g - s&\\\${datarootdir}&$datarootdir&g' ;; -esac -_ACEOF - -# Neutralize VPATH when `$srcdir' = `.'. -# Shell code in configure.ac might set extrasub. -# FIXME: do we really want to maintain this feature? -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -ac_sed_extra="$ac_vpsub -$extrasub -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -:t -/@[a-zA-Z_][a-zA-Z_0-9]*@/!b -s|@configure_input@|$ac_sed_conf_input|;t t -s&@top_builddir@&$ac_top_builddir_sub&;t t -s&@top_build_prefix@&$ac_top_build_prefix&;t t -s&@srcdir@&$ac_srcdir&;t t -s&@abs_srcdir@&$ac_abs_srcdir&;t t -s&@top_srcdir@&$ac_top_srcdir&;t t -s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t -s&@builddir@&$ac_builddir&;t t -s&@abs_builddir@&$ac_abs_builddir&;t t -s&@abs_top_builddir@&$ac_abs_top_builddir&;t t -s&@INSTALL@&$ac_INSTALL&;t t -$ac_datarootdir_hack -" -eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \ - || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 -$as_echo "$as_me: error: could not create $ac_file" >&2;} - { (exit 1); exit 1; }; } - -test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && - { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && - { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && - { $as_echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' -which seems to be undefined. Please make sure it is defined." >&5 -$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' -which seems to be undefined. Please make sure it is defined." >&2;} - - rm -f "$tmp/stdin" - case $ac_file in - -) cat "$tmp/out" && rm -f "$tmp/out";; - *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";; - esac \ - || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 -$as_echo "$as_me: error: could not create $ac_file" >&2;} - { (exit 1); exit 1; }; } - ;; - - - - esac - -done # for ac_tag - - -{ (exit 0); exit 0; } -_ACEOF -chmod +x $CONFIG_STATUS -ac_clean_files=$ac_clean_files_save - -test $ac_write_fail = 0 || - { { $as_echo "$as_me:$LINENO: error: write failure creating $CONFIG_STATUS" >&5 -$as_echo "$as_me: error: write failure creating $CONFIG_STATUS" >&2;} - { (exit 1); exit 1; }; } - - -# configure is writing to config.log, and then calls config.status. -# config.status does its own redirection, appending to config.log. -# Unfortunately, on DOS this fails, as config.log is still kept open -# by configure, so config.status won't be able to write to it; its -# output is simply discarded. So we exec the FD to /dev/null, -# effectively closing config.log, so it can be properly (re)opened and -# appended to by config.status. When coming back to configure, we -# need to make the FD available again. -if test "$no_create" != yes; then - ac_cs_success=: - ac_config_status_args= - test "$silent" = yes && - ac_config_status_args="$ac_config_status_args --quiet" - exec 5>/dev/null - $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false - exec 5>>config.log - # Use ||, not &&, to avoid exiting from the if with $? = 1, which - # would make configure fail if this is the last instruction. - $ac_cs_success || { (exit 1); exit 1; } -fi -if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then - { $as_echo "$as_me:$LINENO: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 -$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} -fi - - diff --git a/winsup/mingw/profile/configure.in b/winsup/mingw/profile/configure.in deleted file mode 100644 index 38e52d1f9..000000000 --- a/winsup/mingw/profile/configure.in +++ /dev/null @@ -1,75 +0,0 @@ -dnl Process this file with autoconf to produce a configure script. - -dnl This file is part of Mingw runtime. -dnl -dnl This program is free software; you can redistribute it and/or modify -dnl it under the terms of the GNU General Public License as published by -dnl the Free Software Foundation; either version 2 of the License, or -dnl (at your option) any later version. -dnl -dnl This program is distributed in the hope that it will be useful, -dnl but WITHOUT ANY WARRANTY; without even the implied warranty of -dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -dnl GNU General Public License for more details. -dnl -dnl You should have received a copy of the GNU General Public License -dnl along with this program; if not, write to the Free Software -dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -AC_PREREQ(2.59) -AC_INIT(gcrt0.c) - -CC=${CC-cc} -AC_SUBST(CC) -AS=${AS-as} -AC_SUBST(AS) -AR=${AR-ar} -AC_SUBST(AR) -LD=${LD-ld} -AC_SUBST(LD) -RANLIB=${RANLIB-ranlib} -AC_SUBST(RANLIB) -DLLTOOL=${DLLTOOL-dlltool} -AC_SUBST(DLLTOOL) -DLLWRAP=${DLLWRAP-dllwrap} -AC_SUBST(DLLWRAP) -AC_CANONICAL_SYSTEM - -LIBGMON_A=libgmon.a - -case "$target_os" in -*mingw32crt*) - CRT_ID=1 - NO_CYGWIN= - RUNTIME=crtdll - CRT0S="gcrt1.o gcrt2.o" - ;; -*cygwin*) - CRT_ID=2 - NO_CYGWIN="$(cd ${srcdir}/../../utils; pwd)/mingw" - RUNTIME=msvcrt - CRT0S=gcrt0.o - # Do not build libm.a when building under Cygwin winsup. Otherwise, it'll - # overwrite Cygwin's one. Likewise for libgmon.a. - ;; -*) - # Build it for MSVCRT by default. - CRT_ID=2 - NO_CYGWIN= - RUNTIME=msvcrt - CRT0S="gcrt1.o gcrt2.o" - ;; -esac - -W32API_INCLUDE='-I $(srcdir)/../../w32api/include' - -AC_SUBST(CRT_ID) -AC_SUBST(RUNTIME) -AC_SUBST(NO_CYGWIN) -AC_SUBST(LIBGMON_A) -AC_SUBST(CRT0S) -AC_SUBST(W32API_INCLUDE) - -AC_PROG_INSTALL -AC_OUTPUT(Makefile) - diff --git a/winsup/mingw/profile/gcrt0.c b/winsup/mingw/profile/gcrt0.c deleted file mode 100644 index 20f3c7ced..000000000 --- a/winsup/mingw/profile/gcrt0.c +++ /dev/null @@ -1,52 +0,0 @@ -/* gcrt0.c - - Copyright 1998, 1999, 2000, 2001, 2002 Red Hat, Inc. - -This file is part of Cygwin. - -This software is a copyrighted work licensed under the terms of the -Cygwin license. Please consult the file "CYGWIN_LICENSE" for -details. */ - -/* - * This file is taken from Cygwin distribution. Please keep it in sync. - * The differences should be within __MINGW32__ guard. - */ - -#include <sys/types.h> -#include <stdlib.h> - -#ifdef __MINGW32__ -typedef unsigned char u_char; -typedef unsigned short u_short; -typedef unsigned int u_int; -typedef unsigned long u_long; -#endif - -extern u_char etext asm ("etext"); -extern u_char eprol asm ("__eprol"); -extern void _mcleanup (void); -extern void monstartup (u_long, u_long); -void _monstartup (void) __attribute__((__constructor__)); - -/* startup initialization for -pg support */ - -void -_monstartup (void) -{ - static int called; - - /* Guard against multiple calls that may happen if DLLs are linked - with profile option set as well. Addede side benefit is that it - makes profiling backward compatible (GCC used to emit a call to - _monstartup when compiling main with profiling enabled). */ - if (called++) - return; - - monstartup ((u_long) &eprol, (u_long) &etext); - atexit (&_mcleanup); -} - -asm (".text"); -asm ("__eprol:"); - diff --git a/winsup/mingw/profile/gmon.c b/winsup/mingw/profile/gmon.c deleted file mode 100644 index a20c33713..000000000 --- a/winsup/mingw/profile/gmon.c +++ /dev/null @@ -1,290 +0,0 @@ -/*- - * Copyright (c) 1983, 1992, 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. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. 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. - */ - -#if !defined(lint) && defined(LIBC_SCCS) -static char rcsid[] = "$OpenBSD: gmon.c,v 1.8 1997/07/23 21:11:27 kstailey Exp $"; -#endif - -/* - * This file is taken from Cygwin distribution. Please keep it in sync. - * The differences should be within __MINGW32__ guard. - */ - -#include <fcntl.h> -#include <stdlib.h> -#include <stdio.h> -#ifndef __MINGW32__ -#include <unistd.h> -#include <sys/param.h> -#endif -#include <sys/types.h> -#include <gmon.h> - -#include <profil.h> - -/* XXX needed? */ -//extern char *minbrk __asm ("minbrk"); - -#ifdef __MINGW32__ -#include <string.h> -#define bzero(ptr,size) memset (ptr, 0, size); -#endif - -struct gmonparam _gmonparam = { GMON_PROF_OFF }; - -static int s_scale; -/* see profil(2) where this is describe (incorrectly) */ -#define SCALE_1_TO_1 0x10000L - -#define ERR(s) write(2, s, sizeof(s)) - -void moncontrol __P((int)); - -static void * -fake_sbrk(int size) -{ - return malloc(size); -} - -void -monstartup(lowpc, highpc) - u_long lowpc; - u_long highpc; -{ - register int o; - char *cp; - struct gmonparam *p = &_gmonparam; - - /* - * round lowpc and highpc to multiples of the density we're using - * so the rest of the scaling (here and in gprof) stays in ints. - */ - p->lowpc = ROUNDDOWN(lowpc, HISTFRACTION * sizeof(HISTCOUNTER)); - p->highpc = ROUNDUP(highpc, HISTFRACTION * sizeof(HISTCOUNTER)); - p->textsize = p->highpc - p->lowpc; - p->kcountsize = p->textsize / HISTFRACTION; - p->hashfraction = HASHFRACTION; - p->fromssize = p->textsize / p->hashfraction; - p->tolimit = p->textsize * ARCDENSITY / 100; - if (p->tolimit < MINARCS) - p->tolimit = MINARCS; - else if (p->tolimit > MAXARCS) - p->tolimit = MAXARCS; - p->tossize = p->tolimit * sizeof(struct tostruct); - - cp = fake_sbrk(p->kcountsize + p->fromssize + p->tossize); - if (cp == (char *)-1) { - ERR("monstartup: out of memory\n"); - return; - } - - /* zero out cp as value will be added there */ - bzero(cp, p->kcountsize + p->fromssize + p->tossize); - - p->tos = (struct tostruct *)cp; - cp += p->tossize; - p->kcount = (u_short *)cp; - cp += p->kcountsize; - p->froms = (u_short *)cp; - - /* XXX minbrk needed? */ - //minbrk = fake_sbrk(0); - p->tos[0].link = 0; - - o = p->highpc - p->lowpc; - if (p->kcountsize < o) { -#ifndef notdef - s_scale = ((float)p->kcountsize / o ) * SCALE_1_TO_1; -#else /* avoid floating point */ - int quot = o / p->kcountsize; - - if (quot >= 0x10000) - s_scale = 1; - else if (quot >= 0x100) - s_scale = 0x10000 / quot; - else if (o >= 0x800000) - s_scale = 0x1000000 / (o / (p->kcountsize >> 8)); - else - s_scale = 0x1000000 / ((o << 8) / p->kcountsize); -#endif - } else - s_scale = SCALE_1_TO_1; - - moncontrol(1); -} - -void -_mcleanup() -{ - int fd; - int hz; - int fromindex; - int endfrom; - u_long frompc; - int toindex; - struct rawarc rawarc; - struct gmonparam *p = &_gmonparam; - struct gmonhdr gmonhdr, *hdr; - char *proffile; -#ifdef DEBUG - int log, len; - char dbuf[200]; -#endif - - if (p->state == GMON_PROF_ERROR) - ERR("_mcleanup: tos overflow\n"); - - hz = PROF_HZ; - moncontrol(0); - -#ifdef nope - if ((profdir = getenv("PROFDIR")) != NULL) { - extern char *__progname; - char *s, *t, *limit; - pid_t pid; - long divisor; - - /* If PROFDIR contains a null value, no profiling - output is produced */ - if (*profdir == '\0') { - return; - } - - limit = buf + sizeof buf - 1 - 10 - 1 - - strlen(__progname) - 1; - t = buf; - s = profdir; - while((*t = *s) != '\0' && t < limit) { - t++; - s++; - } - *t++ = '/'; - - /* - * Copy and convert pid from a pid_t to a string. For - * best performance, divisor should be initialized to - * the largest power of 10 less than PID_MAX. - */ - pid = getpid(); - divisor=10000; - while (divisor > pid) divisor /= 10; /* skip leading zeros */ - do { - *t++ = (pid/divisor) + '0'; - pid %= divisor; - } while (divisor /= 10); - *t++ = '.'; - - s = __progname; - while ((*t++ = *s++) != '\0') - ; - - proffile = buf; - } else { - proffile = "gmon.out"; - } -#else - proffile = "gmon.out"; -#endif - - fd = open(proffile , O_CREAT|O_TRUNC|O_WRONLY|O_BINARY, 0666); - if (fd < 0) { - perror( proffile ); - return; - } -#ifdef DEBUG - log = open("gmon.log", O_CREAT|O_TRUNC|O_WRONLY, 0664); - if (log < 0) { - perror("mcount: gmon.log"); - return; - } - len = sprintf(dbuf, "[mcleanup1] kcount 0x%x ssiz %d\n", - p->kcount, p->kcountsize); - write(log, dbuf, len); -#endif - hdr = (struct gmonhdr *)&gmonhdr; - hdr->lpc = p->lowpc; - hdr->hpc = p->highpc; - hdr->ncnt = p->kcountsize + sizeof(gmonhdr); - hdr->version = GMONVERSION; - hdr->profrate = hz; - write(fd, (char *)hdr, sizeof *hdr); - write(fd, p->kcount, p->kcountsize); - endfrom = p->fromssize / sizeof(*p->froms); - for (fromindex = 0; fromindex < endfrom; fromindex++) { - if (p->froms[fromindex] == 0) - continue; - - frompc = p->lowpc; - frompc += fromindex * p->hashfraction * sizeof(*p->froms); - for (toindex = p->froms[fromindex]; toindex != 0; - toindex = p->tos[toindex].link) { -#ifdef DEBUG - len = sprintf(dbuf, - "[mcleanup2] frompc 0x%x selfpc 0x%x count %d\n" , - frompc, p->tos[toindex].selfpc, - p->tos[toindex].count); - write(log, dbuf, len); -#endif - rawarc.raw_frompc = frompc; - rawarc.raw_selfpc = p->tos[toindex].selfpc; - rawarc.raw_count = p->tos[toindex].count; - write(fd, &rawarc, sizeof rawarc); - } - } - close(fd); -} - -/* - * Control profiling - * profiling is what mcount checks to see if - * all the data structures are ready. - */ -void -moncontrol(mode) - int mode; -{ - struct gmonparam *p = &_gmonparam; - - if (mode) { - /* start */ - profil((char *)p->kcount, p->kcountsize, p->lowpc, - s_scale); - p->state = GMON_PROF_ON; - } else { - /* stop */ - profil((char *)0, 0, 0, 0); - p->state = GMON_PROF_OFF; - } -} - - diff --git a/winsup/mingw/profile/gmon.h b/winsup/mingw/profile/gmon.h deleted file mode 100644 index 1f01bf418..000000000 --- a/winsup/mingw/profile/gmon.h +++ /dev/null @@ -1,181 +0,0 @@ -/* $OpenBSD: gmon.h,v 1.3 1996/04/21 22:31:46 deraadt Exp $ */ -/* $NetBSD: gmon.h,v 1.5 1996/04/09 20:55:30 cgd Exp $ */ - -/*- - * Copyright (c) 1982, 1986, 1992, 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. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. 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. - * - * @(#)gmon.h 8.2 (Berkeley) 1/4/94 - */ - -/* - * This file is taken from Cygwin distribution. Please keep it in sync. - * The differences should be within __MINGW32__ guard. - */ - -#ifndef _SYS_GMON_H_ -#define _SYS_GMON_H_ - -#ifndef __P -#define __P(x) x -#endif - -#include <profile.h> - -#ifdef __MINGW32__ -#ifndef _BSDTYPES_DEFINED -typedef unsigned char u_char; -typedef unsigned short u_short; -typedef unsigned int u_int; -typedef unsigned long u_long; -#define _BSDTYPES_DEFINED -#endif /* _BSDTYPES_DEFINED */ -#endif /* __MINGW32__*/ - -/* - * Structure prepended to gmon.out profiling data file. - */ -struct gmonhdr { - u_long lpc; /* base pc address of sample buffer */ - u_long hpc; /* max pc address of sampled buffer */ - int ncnt; /* size of sample buffer (plus this header) */ - int version; /* version number */ - int profrate; /* profiling clock rate */ - int spare[3]; /* reserved */ -}; -#define GMONVERSION 0x00051879 - -/* - * histogram counters are unsigned shorts (according to the kernel). - */ -#define HISTCOUNTER unsigned short - -/* - * fraction of text space to allocate for histogram counters here, 1/2 - */ -#define HISTFRACTION 2 - -/* - * Fraction of text space to allocate for from hash buckets. - * The value of HASHFRACTION is based on the minimum number of bytes - * of separation between two subroutine call points in the object code. - * Given MIN_SUBR_SEPARATION bytes of separation the value of - * HASHFRACTION is calculated as: - * - * HASHFRACTION = MIN_SUBR_SEPARATION / (2 * sizeof(short) - 1); - * - * For example, on the VAX, the shortest two call sequence is: - * - * calls $0,(r0) - * calls $0,(r0) - * - * which is separated by only three bytes, thus HASHFRACTION is - * calculated as: - * - * HASHFRACTION = 3 / (2 * 2 - 1) = 1 - * - * Note that the division above rounds down, thus if MIN_SUBR_FRACTION - * is less than three, this algorithm will not work! - * - * In practice, however, call instructions are rarely at a minimal - * distance. Hence, we will define HASHFRACTION to be 2 across all - * architectures. This saves a reasonable amount of space for - * profiling data structures without (in practice) sacrificing - * any granularity. - */ -#define HASHFRACTION 2 - -/* - * percent of text space to allocate for tostructs with a minimum. - */ -#define ARCDENSITY 2 -#define MINARCS 50 -#define MAXARCS ((1 << (8 * sizeof(HISTCOUNTER))) - 2) - -struct tostruct { - u_long selfpc; - long count; - u_short link; - u_short pad; -}; - -/* - * a raw arc, with pointers to the calling site and - * the called site and a count. - */ -struct rawarc { - u_long raw_frompc; - u_long raw_selfpc; - long raw_count; -}; - -/* - * general rounding functions. - */ -#define ROUNDDOWN(x,y) (((x)/(y))*(y)) -#define ROUNDUP(x,y) ((((x)+(y)-1)/(y))*(y)) - -/* - * The profiling data structures are housed in this structure. - */ -struct gmonparam { - int state; - u_short *kcount; - u_long kcountsize; - u_short *froms; - u_long fromssize; - struct tostruct *tos; - u_long tossize; - long tolimit; - u_long lowpc; - u_long highpc; - u_long textsize; - u_long hashfraction; -}; -extern struct gmonparam _gmonparam; - -/* - * Possible states of profiling. - */ -#define GMON_PROF_ON 0 -#define GMON_PROF_BUSY 1 -#define GMON_PROF_ERROR 2 -#define GMON_PROF_OFF 3 - -/* - * Sysctl definitions for extracting profiling information from the kernel. - */ -#define GPROF_STATE 0 /* int: profiling enabling variable */ -#define GPROF_COUNT 1 /* struct: profile tick count buffer */ -#define GPROF_FROMS 2 /* struct: from location hash bucket */ -#define GPROF_TOS 3 /* struct: destination/count structure */ -#define GPROF_GMONPARAM 4 /* struct: profiling parameters (see above) */ -#endif /* !_SYS_GMONH_ */ diff --git a/winsup/mingw/profile/mcount.c b/winsup/mingw/profile/mcount.c deleted file mode 100644 index 9f1736d3b..000000000 --- a/winsup/mingw/profile/mcount.c +++ /dev/null @@ -1,179 +0,0 @@ -/*- - * Copyright (c) 1983, 1992, 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. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. 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. - */ - -#if !defined(lint) && !defined(_KERNEL) && defined(LIBC_SCCS) -static char rcsid[] = "$OpenBSD: mcount.c,v 1.6 1997/07/23 21:11:27 kstailey Exp $"; -#endif - -/* - * This file is taken from Cygwin distribution. Please keep it in sync. - * The differences should be within __MINGW32__ guard. - */ - -#ifndef __MINGW32__ -#include <sys/param.h> -#endif -#include <sys/types.h> -#include <gmon.h> - -/* - * mcount is called on entry to each function compiled with the profiling - * switch set. _mcount(), which is declared in a machine-dependent way - * with _MCOUNT_DECL, does the actual work and is either inlined into a - * C routine or called by an assembly stub. In any case, this magic is - * taken care of by the MCOUNT definition in <machine/profile.h>. - * - * _mcount updates data structures that represent traversals of the - * program's call graph edges. frompc and selfpc are the return - * address and function address that represents the given call graph edge. - * - * Note: the original BSD code used the same variable (frompcindex) for - * both frompcindex and frompc. Any reasonable, modern compiler will - * perform this optimization. - */ -/* _mcount; may be static, inline, etc */ -_MCOUNT_DECL (u_long frompc, u_long selfpc) -{ - register u_short *frompcindex; - register struct tostruct *top, *prevtop; - register struct gmonparam *p; - register long toindex; - - p = &_gmonparam; - /* - * check that we are profiling - * and that we aren't recursively invoked. - */ - if (p->state != GMON_PROF_ON) - return; - p->state = GMON_PROF_BUSY; - /* - * check that frompcindex is a reasonable pc value. - * for example: signal catchers get called from the stack, - * not from text space. too bad. - */ - frompc -= p->lowpc; - if (frompc > p->textsize) - goto done; - -#if (HASHFRACTION & (HASHFRACTION - 1)) == 0 - if (p->hashfraction == HASHFRACTION) - frompcindex = - &p->froms[frompc / (HASHFRACTION * sizeof(*p->froms))]; - else -#endif - frompcindex = - &p->froms[frompc / (p->hashfraction * sizeof(*p->froms))]; - toindex = *frompcindex; - if (toindex == 0) { - /* - * first time traversing this arc - */ - toindex = ++p->tos[0].link; - if (toindex >= p->tolimit) - /* halt further profiling */ - goto overflow; - - *frompcindex = toindex; - top = &p->tos[toindex]; - top->selfpc = selfpc; - top->count = 1; - top->link = 0; - goto done; - } - top = &p->tos[toindex]; - if (top->selfpc == selfpc) { - /* - * arc at front of chain; usual case. - */ - top->count++; - goto done; - } - /* - * have to go looking down chain for it. - * top points to what we are looking at, - * prevtop points to previous top. - * we know it is not at the head of the chain. - */ - for (; /* goto done */; ) { - if (top->link == 0) { - /* - * top is end of the chain and none of the chain - * had top->selfpc == selfpc. - * so we allocate a new tostruct - * and link it to the head of the chain. - */ - toindex = ++p->tos[0].link; - if (toindex >= p->tolimit) - goto overflow; - - top = &p->tos[toindex]; - top->selfpc = selfpc; - top->count = 1; - top->link = *frompcindex; - *frompcindex = toindex; - goto done; - } - /* - * otherwise, check the next arc on the chain. - */ - prevtop = top; - top = &p->tos[top->link]; - if (top->selfpc == selfpc) { - /* - * there it is. - * increment its count - * move it to the head of the chain. - */ - top->count++; - toindex = prevtop->link; - prevtop->link = top->link; - top->link = *frompcindex; - *frompcindex = toindex; - goto done; - } - } -done: - p->state = GMON_PROF_ON; - return; -overflow: - p->state = GMON_PROF_ERROR; - return; -} - -/* - * Actual definition of mcount function. Defined in <machine/profile.h>, - * which is included by <sys/gmon.h> - */ -MCOUNT - diff --git a/winsup/mingw/profile/profil.c b/winsup/mingw/profile/profil.c deleted file mode 100644 index dae59d7fd..000000000 --- a/winsup/mingw/profile/profil.c +++ /dev/null @@ -1,185 +0,0 @@ -/* profil.c -- win32 profil.c equivalent - - Copyright 1998, 1999, 2000, 2001, 2002 Red Hat, Inc. - - This file is part of Cygwin. - - This software is a copyrighted work licensed under the terms of the - Cygwin license. Please consult the file "CYGWIN_LICENSE" for - details. */ - -/* - * This file is taken from Cygwin distribution. Please keep it in sync. - * The differences should be within __MINGW32__ guard. - */ - -#include <windows.h> -#include <stdio.h> -#include <sys/types.h> -#include <errno.h> -#include <math.h> - -#include <profil.h> - -#define SLEEPTIME (1000 / PROF_HZ) - -/* global profinfo for profil() call */ -static struct profinfo prof; - -/* Get the pc for thread THR */ - -static u_long -get_thrpc (HANDLE thr) -{ - CONTEXT ctx; - u_long pc; - int res; - - res = SuspendThread (thr); - if (res == -1) - return (u_long) - 1; - ctx.ContextFlags = CONTEXT_CONTROL | CONTEXT_INTEGER; - pc = (u_long) - 1; - if (GetThreadContext (thr, &ctx)) - pc = ctx.Eip; - ResumeThread (thr); - return pc; -} - -/* Display cell of profile buffer */ -#if 0 -static void -print_prof (struct profinfo *p) -{ - printf ("profthr %x\ttarget thr %x\n", p->profthr, p->targthr); - printf ("pc: %x - %x\n", p->lowpc, p->highpc); - printf ("scale: %x\n", p->scale); - return; -} -#endif - -/* Everytime we wake up use the main thread pc to hash into the cell in the - profile buffer ARG. */ - -static DWORD CALLBACK -profthr_func (LPVOID arg) -{ - struct profinfo *p = (struct profinfo *) arg; - u_long pc, idx; - - for (;;) - { - pc = (u_long) get_thrpc (p->targthr); - if (pc >= p->lowpc && pc < p->highpc) - { - idx = PROFIDX (pc, p->lowpc, p->scale); - p->counter[idx]++; - } -#if 0 - print_prof (p); -#endif - Sleep (SLEEPTIME); - } - return 0; -} - -/* Stop profiling to the profiling buffer pointed to by P. */ - -static int -profile_off (struct profinfo *p) -{ - if (p->profthr) - { - TerminateThread (p->profthr, 0); - CloseHandle (p->profthr); - } - if (p->targthr) - CloseHandle (p->targthr); - return 0; -} - -/* Create a timer thread and pass it a pointer P to the profiling buffer. */ - -static int -profile_on (struct profinfo *p) -{ - DWORD thrid; - - /* get handle for this thread */ - if (!DuplicateHandle (GetCurrentProcess (), GetCurrentThread (), - GetCurrentProcess (), &p->targthr, 0, FALSE, - DUPLICATE_SAME_ACCESS)) - { - errno = ESRCH; - return -1; - } - - p->profthr = CreateThread (0, 0, profthr_func, (void *) p, 0, &thrid); - - /* Set profiler thread priority to highest to be sure that it gets the - processor as soon it request it (i.e. when the Sleep terminate) to get - the next data out of the profile. */ - - SetThreadPriority (p->profthr, THREAD_PRIORITY_TIME_CRITICAL); - - if (!p->profthr) - { - CloseHandle (p->targthr); - p->targthr = 0; - errno = EAGAIN; - return -1; - } - return 0; -} - -/* - * start or stop profiling - * - * profiling goes into the SAMPLES buffer of size SIZE (which is treated - * as an array of u_shorts of size size/2) - * - * each bin represents a range of pc addresses from OFFSET. The number - * of pc addresses in a bin depends on SCALE. (A scale of 65536 maps - * each bin to two addresses, A scale of 32768 maps each bin to 4 addresses, - * a scale of 1 maps each bin to 128k addreses). Scale may be 1 - 65536, - * or zero to turn off profiling - */ -int -profile_ctl (struct profinfo * p, char *samples, size_t size, - u_long offset, u_int scale) -{ - u_long maxbin; - - if (scale > 65536) - { - errno = EINVAL; - return -1; - } - - profile_off (p); - if (scale) - { - memset (samples, 0, size); - memset (p, 0, sizeof *p); - maxbin = size >> 1; - prof.counter = (u_short *) samples; - prof.lowpc = offset; - prof.highpc = PROFADDR (maxbin, offset, scale); - prof.scale = scale; - - return profile_on (p); - } - return 0; -} - -/* Equivalent to unix profil() - Every SLEEPTIME interval, the user's program counter (PC) is examined: - offset is subtracted and the result is multiplied by scale. - The word pointed to by this address is incremented. Buf is unused. */ - -int -profil (char *samples, size_t size, u_long offset, u_int scale) -{ - return profile_ctl (&prof, samples, size, offset, scale); -} - diff --git a/winsup/mingw/profile/profil.h b/winsup/mingw/profile/profil.h deleted file mode 100644 index 9245dd25a..000000000 --- a/winsup/mingw/profile/profil.h +++ /dev/null @@ -1,51 +0,0 @@ -/* profil.h: gprof profiling header file - - Copyright 1998, 1999, 2000, 2001, 2002 Red Hat, Inc. - -This file is part of Cygwin. - -This software is a copyrighted work licensed under the terms of the -Cygwin license. Please consult the file "CYGWIN_LICENSE" for -details. */ - -/* - * This file is taken from Cygwin distribution. Please keep it in sync. - * The differences should be within __MINGW32__ guard. - */ - -/* profiling frequency. (No larger than 1000) */ -#define PROF_HZ 100 - -/* convert an addr to an index */ -#define PROFIDX(pc, base, scale) \ - ({ \ - size_t i = (pc - base) / 2; \ - if (sizeof (unsigned long long int) > sizeof (size_t)) \ - i = (unsigned long long int) i * scale / 65536; \ - else \ - i = i / 65536 * scale + i % 65536 * scale / 65536; \ - i; \ - }) - -/* convert an index into an address */ -#define PROFADDR(idx, base, scale) \ - ((base) \ - + ((((unsigned long long)(idx) << 16) \ - / (unsigned long long)(scale)) << 1)) - -/* convert a bin size into a scale */ -#define PROFSCALE(range, bins) (((bins) << 16) / ((range) >> 1)) - -typedef void *_WINHANDLE; - -struct profinfo { - _WINHANDLE targthr; /* thread to profile */ - _WINHANDLE profthr; /* profiling thread */ - u_short *counter; /* profiling counters */ - u_long lowpc, highpc; /* range to be profiled */ - u_int scale; /* scale value of bins */ -}; - -int profile_ctl(struct profinfo *, char *, size_t, u_long, u_int); -int profil(char *, size_t, u_long, u_int); - diff --git a/winsup/mingw/profile/profile.h b/winsup/mingw/profile/profile.h deleted file mode 100644 index d1de0f98e..000000000 --- a/winsup/mingw/profile/profile.h +++ /dev/null @@ -1,83 +0,0 @@ -/* $NetBSD: profile.h,v 1.6 1995/03/28 18:17:08 jtc Exp $ */ - -/* - * Copyright (c) 1992, 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. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. 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. - * - * @(#)profile.h 8.1 (Berkeley) 6/11/93 - */ - -/* - * This file is taken from Cygwin distribution. Please keep it in sync. - * The differences should be within __MINGW32__ guard. - */ -/* If compiler doesn't inline, at least avoid passing args on the stack. */ -#define _MCOUNT_CALL __attribute__ ((regparm (2))) -#define _MCOUNT_DECL static __inline__ void _MCOUNT_CALL _mcount - -/* FIXME: This works, but it would be cleaner to convert mcount into an - assembler stub that calls an extern _mcount. - Older versions of GCC (pre-4.1) will still fail with regparm since the - compiler used %edx to store an unneeded counter variable. */ - -#define MCOUNT \ -void \ -mcount() \ -{ \ - u_long selfpc, frompcindex; \ - /* \ - * Save registers, since this may be called from \ - * the prologue of a regparm function. \ - */ \ - __asm __volatile__ ("pushl %eax\n\t" \ - "pushl %ecx\n\t" \ - "pushl %edx"); \ - /* \ - * find the return address for mcount, \ - * and the return address for mcount's caller. \ - * \ - * selfpc = pc pushed by mcount call \ - */ \ - /* __asm ("movl 4(%%ebp),%0" : "=r" (selfpc)); */ \ - selfpc = (u_long) __builtin_return_address (0); \ - /* \ - * frompcindex = pc pushed by call into self. \ - */ \ - /* __asm ("movl (%%ebp),%0;movl 4(%0),%0" : "=r" (frompcindex)); */ \ - frompcindex = (u_long) __builtin_return_address (1); \ - _mcount(frompcindex, selfpc); \ - /* \ - * Restore registers. \ - */ \ - __asm __volatile__ ("popl %edx\n\t" \ - "popl %ecx\n\t" \ - "popl %eax"); \ -} diff --git a/winsup/mingw/pseudo-reloc-list.c b/winsup/mingw/pseudo-reloc-list.c deleted file mode 100644 index 87a2be247..000000000 --- a/winsup/mingw/pseudo-reloc-list.c +++ /dev/null @@ -1,3 +0,0 @@ -/* Define here in .bss in case not defined by linker script. */ -char __RUNTIME_PSEUDO_RELOC_LIST_END__ = 0; -char __RUNTIME_PSEUDO_RELOC_LIST__ = 0; diff --git a/winsup/mingw/pseudo-reloc.c b/winsup/mingw/pseudo-reloc.c deleted file mode 100644 index 9fe607d2c..000000000 --- a/winsup/mingw/pseudo-reloc.c +++ /dev/null @@ -1,46 +0,0 @@ -/* pseudo-reloc.c - - Written by Egor Duda <deo@logos-m.ru> - THIS SOFTWARE IS NOT COPYRIGHTED - - This source code is offered for use in the public domain. You may - use, modify or distribute it freely. - - This code is distributed in the hope that it will be useful but - WITHOUT ANY WARRANTY. ALL WARRENTIES, EXPRESS OR IMPLIED ARE HEREBY - DISCLAMED. This includes but is not limited to warrenties of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -*/ - -#include <windows.h> - -extern char __RUNTIME_PSEUDO_RELOC_LIST__; -extern char __RUNTIME_PSEUDO_RELOC_LIST_END__; -extern char _image_base__; - -typedef struct - { - DWORD addend; - DWORD target; - } -runtime_pseudo_reloc; - -static void -do_pseudo_reloc (void* start, void* end, void* base) -{ - DWORD reloc_target; - runtime_pseudo_reloc* r; - for (r = (runtime_pseudo_reloc*) start; r < (runtime_pseudo_reloc*) end; r++) - { - reloc_target = (DWORD) base + r->target; - *((DWORD*) reloc_target) += r->addend; - } -} - -void -_pei386_runtime_relocator () -{ - do_pseudo_reloc (&__RUNTIME_PSEUDO_RELOC_LIST__, - &__RUNTIME_PSEUDO_RELOC_LIST_END__, - &_image_base__); -} diff --git a/winsup/mingw/readme.txt b/winsup/mingw/readme.txt deleted file mode 100644 index 4b680df48..000000000 --- a/winsup/mingw/readme.txt +++ /dev/null @@ -1,685 +0,0 @@ - Minimalist GNU-Win32 Readme - version 0.1.3 - March 20, 1997 - Colin Peters <colin@bird.fu.is.saga-u.ac.jp> - - -0. Introduction - -Mingw32 is short for the Minimalist GNU-Win32 package, and it is a -package which allows you to use GCC (as supplied by Cygnus in their GNU- -Win32 or Cygwin32 package) the GNU compiler, on Win32 platforms like -Windows 95 or NT, to compile "native" programs. - -In this case "native" means programs which don't require extra DLLs like -the cygwin DLL. Mingw32 programs use CRTDLL.DLL to provide their C run -time library functions, and CRTDLL.DLL is supplied with all current -Win32 platforms. Thus the programs are light weight and easy to -distribute, they also do not automatically fall under the GNU Public -License as programs written with the GPL version of Cygwin32 do. - - -0.1 Archive Contents - -Mingw32 version 0.1.3 is distributed in two files, mingw32_013.tar.gz -and mingsrc013.tar.gz. The first file contains the following components: - - - Import libraries for building programs which use the - CRTDLL.DLL C run time library supplied with Win32 platforms. - - - crt0.o and dllcrt0.o, two "startup code" object files that - perform program or DLL initialization without using - CRTDLL.DLL (instead of CYGWIN.DLL). - - - specs, a configuration file for GCC which defines appropriate - options for creating executables which use the CRTDLL.DLL C - run time library. - - - Include files with appropriate type and macro definitions, - and function prototypes for use with CRTDLL.DLL. - -The source distribution (mingsrc013.tar.gz) contains the .def files and -source files used to create the various import libraries and object -files in the above list. - - -0.2 Usage Notes - -Unlike some previous releases of Mingw32 the current version defaults to -building console applications, the same way that GCC normally does when -installed from the Cygnus distribution. The Mingw32 specs file also -introduces two command line arguments to GCC which can be used to -conveniently specify a console or GUI type build. When building console -programs "-console" can be used on the GCC command line, while GUI -programs can be built by specifying "-windows" (I tried defining -gui, -and it works, but produces an annoying warning about -gui not being -supported (?)). For example: - - gcc -o hellogui.exe hellogui.c -luser32 -windows - -Although using different "crt0" files for GUI and console applications -has been suggested I have left the system more-or-less as it was in -0.1.1: crt0 sets up for and calls main, and if you don't supply a main -there is one in libmingw32.a, which in turn calls WinMain (actually -WinMain@16). This allows either main or WinMain entry points in console -or GUI applications, but if you don't supply main or WinMain, or don't -prototype WinMain as __stdcall__ you will get a linker error about an -"unresolved reference to WinMain@16." This is unfortunately cryptic, but -otherwise the system works quite well. - -An important note if you want to rebuild from the sources of Mingw32 or -otherwise use the special version of Jam made for Mingw32: you need to -have a version of "rm", the UNIX equivalent of del, somewhere in your -path to use the current Jambase (which is built into the Jam -executable). The version that comes with the Cygnus files is perfectly -adequate. - - -0.3 Fixes and Improvements - -Numerous small bug fixes have been made in the header files. - -Floating point initialization, originally added in version 0.1.2, has -been modified to use the _fpreset function from CRTDLL.DLL instead of -cryptic and possibly less portable assembly code. - -A new DLL-building option has been added to the specs file so that the -following link line will appropriately link in dllcrt0.o instead of the -normal crt0.o, and set the entry point correctly: - - gcc -dll -o dll.dll dll.o -Wl,dll.exp - -A bug that would cause the wrong include files to be included in dual -installations of Cygwin32 and Mingw32 has been fixed (I hope) in the -Mingw32 specs file. - -Alongside this release is a new release of Jam specially built for use -with Mingw32. It should be available from the same place you got this -file. This release of Jam includes rules for building DLLs, including -resources in your executables and creating import libraries. I also -intend to distribute a small set of example files showing how to do all -of these things with Mingw32 and Jam. - -In the "coming soon" category I have a version of the GNU Standard C++ -library ported to Mingw32. This means you can use iostreams, complex -numbers and all those neat STL (Standard Template Library) things -without needing the Cygwin DLL. I hope to put this port up for -downloading soon (along with the source of course). - - - -1. Installing - -1.1 Download and Unpack GNU-Win32 Beta 17.1 - -Because of the enormous size of the beta 17.1 release from Cygnus this -process will require about 85 MB or more of free disk space. The first -step, after downloading the Mingw32 package, is to download the GCC -binary distribution, all.tar.gz, from Cygnus (or a mirror), which is -about 10 MB. (Of course, if you just want the Cygwin32 install and are -not actually interested in adding on Mingw32 you don't need the Mingw32 -package at all.) - -Just to be safe, and if you have the 10 MB to spare, you should probably -copy the all.tar.gz file to a reasonably safe place at this point. This -will save you from the pain of downloading it again if something goes -wrong later. - -To complete this step you need a gzip program (or just gunzip) and a tar -program. You can use the ones supplied by Cygnus (although some people -seem to have trouble with them, especially if you try to use pipes) or -one of the other ports available from your favorite freeware/shareware -software site. - -First un-gzip the file with a command line like: - gunzip all.tar.gz -or - gzip -d all.tar.gz - -This will produce a all.tar file and erase the all.tar.gz file (there -are options for gzip if you want to keep the original around). The tar -file is about 40 MB. - -Make a directory for the cygnus stuff, such as C:\cygnus for example. -Move the tar file there (e.g. move \tmp\all.tar \cygnus). Don’t copy it -unless you like waiting and wasting 40 MB of disk space. - -Unpack the tar file into your new directory with a command line like: - tar xvf all.tar - -Run from the new directory (now containing the tar file). This is the -step where disk space usage reaches its peak, since the tar extraction -does not delete the all.tar file, and the amount of space taken by the -extracted files plus the tar file itself is well in excess of 80 MB -(mainly because, on my system at least, the files which are symbolic -links in the tar archive are copied as they are expanded onto the FAT -filesystem, so for example, a symbolic link to cygwin.dll, a 3 MB file, -takes an extra 3 MB, since the file is simply duplicated in the new -location). I could not actually do this on my laptop and had to extract -the tar file from a mounted network drive! - -NOTE: From here on I will refer to files as if you had installed in -C:\cygnus. If you installed somewhere else then just replace C:\cygnus -with the appropriate path wherever it occurs. - - -1.2 Setup Cygwin32 - -This step is not 100% necessary, but it helps at this point to determine -if you’ve gotten this far without any major problems. Also, if you -intend to use both Cygwin32 and Mingw32 you will have to do some of -these steps eventually. - -GCC and the other programs in the compiler suite all require cygwin.dll -to run. There are two copies of this file: one in C:\cygnus\H-i386- -cygwin32\bin (this might be a symbolic link), and one in C:\cygnus\H- -i386-cygwin32\i386-cygwin32\lib (the original). Since this DLL is -required by all Cygwin32 programs it makes sense to put one copy of it -in your C:\Windows\System directory (or equivalent) and remove the extra -copies. This will also save you headaches when the next release comes -along and you have to make sure that everything is using the latest -release of the DLL. - -After doing that run the cygwin32.bat batch file included with this -distribution, or otherwise perform the following settings: - - PATH=%PATH%;C:\cygnus\H-i386-cygwin32\bin - SET GCC_EXEC_PREFIX=C:\cygnus\H-i386-cygwin32\lib\gcc-lib\i386- - cygwin32\cygnus-2.7.2-961023 - SET LIBRARY_PATH=/cygnus/H-i386-cygwin32/lib/gcc-lib/i386- - cygwin32/cygnus-2.7.2-961023:/cygnus/H-i386-cygwin32/i386- - cygwin32/lib:/cygnus/H-i386-cygwin32/lib - SET C_INCLUDE_PATH=/cygnus/H-i386-cygwin32/lib/gcc-lib/i386- - cygwin32/cygnus-2.7.2-961023/include:/cygnus/H-i386- - cygwin32/i386-cygwin32/include:/cygnus/include - SET CPLUS_INCLUDE_PATH=%C_INCLUDE_PATH% - -NOTE: You may need to increase the amount of environment space available -at the command prompt to get these extremely long environment variables -set. You can do this under Windows 95 by modifying the properties of the -command prompt shortcut you use under the "Program" tab, adding a -/e:#### argument to the command line COMMAND.COM, where #### is the -number of bytes to set aside for the environment. - -NOTE: Under Windows 95 changes made in your autoexec.bat file will not -show up in new DOS boxes unless you reboot your machine. - -Now write and compile a small test hello world program like this: - -#include <stdio.h> - -int -main () -{ - printf ("Hello, world!\n"); - return 0; -} - -Then compile it like this (assuming your file is called hello.c): - - gcc -o hello.exe hello.c - -The compile should proceed without problems and you should be able to -run the hello program at the end. It should print "Hello, world!" -(without the quotes) to the console and then return to the command -prompt. - -If you wanted a full Cygwin32 install you now have it. With this setup -(say, by adding those lines above to your autoexec.bat or global -settings) you can port a great deal of UNIX code to run under Win32 -systems. No more steps are necessary. - -If you are a minimalist or otherwise want to save disk space you should -continue from here. Also if you intend to use the Minimalist GNU-Win32 -files to compile programs which don't use the Cygwin32 API you will need -to do some of the things mentioned below. - -If the compile didn't work for some reason check very carefully that you -followed the instructions above correctly and then check whether one or -more of the files in the download got corrupted. If neither of these -seems to be the case then your system is not behaving like my system. -Try looking at the troubleshooting section later in this file, and if -none of that helps then you can email me (colin@bird.fu.is.saga- -u.ac.jp), though I can't promise I'll be a lot of help. - - -1.3 Separating the Win32 API Files - -Mingw32 and Cygwin32 share the same set of Win32 API include files and -import libraries as included in the GCC distribution from Cygnus. In -order to use the Win32 API with a dual setup or with Mingw32 alone you -will have to separate those files from the bulk of the Cygwin32 API -files. - -Make a new directory to serve as the root for the Win32 API files. I put -mine under C:\cygnus and called it win32, but you can put it where you -like and just replace later references to C:\cygnus\win32 with your own -root directory. - -Move the following from C:\cygnus\H-i386-cygwin32\i386-cygwin32\include -to a new C:\cygnus\win32\include directory: - -windows.h, winadvapi.h, winbase.h, wincon.h, windef.h, windowsx.h, -winerror.h, wingdi.h, winkernel.h, winnt.h, wintypes.h, winuser.h, -winversion.h, commdlg.h, ddeml.h and the Windows32 sub-directory and all -its contents. - -Move the following files from C:\cygnus\H-i386-cygwin32\i386- -cygwin32\lib to a new C:\cygnus\win32\lib directory: - -libadvapi32.a, libcomctl32.a, libcomdlg32.a, libctl3d32.a, libgdi32.a, -libglaux.a, libglu32.a, libimm32.a, libkernel32.a, liblz32.a, -libmapi32.a, libmfcuia32.a, libmgmtapi.a, libmpr.a, libmsacm32.a, -libnddeapi.a, libnetapi32.a, libodbc32.a, libodbccp32.a, libole32.a, -liboleaut32.a, liboledlg.a, libolepro32.a, libopengl32.a, libpenwin32.a, -libpkpd32.a, librasapi32.a, librpcdce4.a, librpcndr.a, librpcns4.a, -librpcrt4.a, libscrnsave.a, libshell32.a, libsnmp.a, libsvrapi.a, -libtapi32.a, libth32.a, libthunk32.a, liburl.a libuser32.a, libvdmdbg.a, -libversion.a, libvfw32.a, libwin32spl.a, libwinmm.a, libwinserve.a, -libwinspool.a, libwinstrm.a, libwow32.a, libwsock32.a, libwst.a. - -That list is quite excessive for most basic Windows programming, which -will only require kernel32, user32, gdi32, shell32 and possibly a couple -of others like the common control and dialog libraries or advapi32. You -may not need the ODBC support, or OLE, or Pen Windows, TAPI and on and -on. Still, if you have the space and intend to use the Win32 API you -might as well keep the ones you’re not sure you’ll ever use around. - -The lists above can also act as lists of files you can safely delete if -you are never going to use the Win32 API in your programs except that -libkernel32.a is still required even if you don’t use the Win32 API -yourself. Note that this means that libkernel32.a must be on the library -path as well, even if you don’t use the Win32 API. (Actually this -appears to be an artifact of the specs file supplied with Cygwin32. If -you like, and feel up to it, you can play around with the specs file and -remove the reference to kernel32.) - -Here are the variable settings you need to make to allow GCC to find the -Win32 API files in their new positions: - - SET LIBRARY_PATH=%LIBRARY_PATH%:/cygnus/win32/lib - SET C_INCLUDE_PATH=%C_INCLUDE_PATH%:/cygnus/win32/include - SET CPLUS_INCLUDE_PATH=%CPLUS_INCLUDE_PATH%:/cygnus/win32/include - -The file win32-api.bat performs these settings. Run it after you run -cygwin32.bat (or mingw32.bat below). - -At this point you should be able to compile programs that use the Win32 -API, just as you could before. You might want to do a simple test -compile to find out, for example this code: - -#include <windows.h> - -int STDCALL -WinMain (HINSTANCE hInst, HINSTANCE hPrev, LPSTR lpCmd, int nShow) -{ - MessageBox (NULL, "Test message", "Test", MB_OK); - return 0; -} - -Should compile with the following command line: - gcc -o test.exe test.c -lkernel32 -luser32 -Wl,--subsystem,windows - -It will produce a warning at link time about not finding -_WinMainCRTStartup, but this is harmless. - -If you have trouble check the troubleshooting section later in this -file. - - -1.4 Specs - -The file C:\cygnus\H-i386-cygwin32\lib\gcc-lib\i386-cygwin32\cygnus- -2.7.2-961023\specs includes a set of options and defaults for GCC, -including such things as which libraries are automatically linked into -executables and such. A different specs file is required depending on -whether you use Cygwin32 or Mingw32. - -To avoid GCC accidentally using the wrong specs file move specs to -C:\cygnus\H-i386-cygwin32\i386-cygwin32\lib. - -You can verify what specs file is being used by attempting a compile -with the -v option to gcc. Note that if no specs file is mentioned the -compiler will default to Cygwin32 behavior. - - -1.5 The Mingw32 Files - -Now we can install the Mingw32 files and start making programs which -don’t use cygwin.dll or the Cygwin32 API. I install my copy under a -separate directory called C:\mingw32, but you could put them wherever -you like (e.g. C:\cygnus\mingw32). Again simply replace references to -C:\mingw32 with the directory where you perform your installation. - -After making the install directory copy mingw32_012.tgz to that -directory and run a command like this: - gunzip -d mingw32_012.tgz - -in that directory, followed by: - tar xvf mingw32_012.tar - -This will unpack the required files. Then you can use the following -environment variable settings (as included in mingw32.bat) to setup for -compiles using Mingw32: - - PATH=%PATH%;C:\cygnus\H-i386-cygwin32\bin - SET GCC_EXEC_PREFIX=C:\cygnus\H-i386-cygwin32\lib\gcc-lib\i386- - cygwin32\cygnus-2.7.2-961023\ - SET LIBRARY_PATH=/mingw32/lib - SET C_INCLUDE_PATH=/mingw32/include:/mingw32/include/nonansi - SET CPLUS_INCLUDE_PATH=%C_INCLUDE_PATH% - -The mingw32.bat file can be used the same way as the cygwin32.bat file. -Depending on which one you run you will be able to do Mingw32 compiles -or Cygwin32 compiles. Note that whichever one you use you must follow it -with an invocation of win32-api.bat so that libkernel32.a will be in the -library path. - -Setup is now complete, you have complete working Mingw32 and Cygwin32 -compiles available along with the bash shell, tons of UNIX-like -utilities. - -If you had trouble with any of the steps above then the next section is -for you. - - - -2. Troubleshooting Setup Problems - -If you ran into trouble at any stage in the section 1 here are a few -general guidelines as well as some solutions to common problems. - -2.1 Winzip, gunzip or tar Complains of Errors - -Winzip may complain that it could not create a file with garbage -characters in it's name. Gunzip, gzip or tar may complain about -formatting errors. Usually this means that the downloaded file is -corrupted. As of this writing this problem was most commonly caused when -downloading the files from Geocities using Netscape Navigator for -Windows 95 or NT. A combination of a badly set MIME type at Geocities -and a bug in Netscape will corrupt files saved with "Save Link As" (and -clicking on the links would display the files as garbage text). At this -time the only solutions are to use another browser (IE, or Netscape for -UNIX or Apple systems) or to download from the Japanese mirror -(http://www.fu.is.saga-u.ac.jp/~colin/gcc.html). Hopefully Geocities -will eventually fix their problem. - - -2.2 Compile and Link Time Problems: General Steps - -First, evaluate that your environment variables are what you expect them -to be by running the SET command with no arguments (if you are using the -bash shell then the output of env might also be illuminating). Do this -immediately before you attempt a compile in the same window as the -compile. - -Secondly include the '-v' option on the gcc command line. This will give -you far more information on what happens during the compile, especially -important are which specs file is being used and what include file -directories are being read, as well as the arguments to cpp and ld. - -If you send me email about a problem the output of these two general -steps will be very helpful in making a diagnosis. - - -2.3 Cannot exec 'cpp' - -On compiling you get an error message like this: - - GCC.EXE: installation problem, cannot exec `cpp': No such file - or directory - GCC.EXE: Internal compiler error: program cpp got fatal signal 127 - -This means more or less what it says. The program cpp is the C -preprocessor (it strips comments and interprets all those lines -beginning in '#') and running it is the first step in compiling a C or -C++ program. The problem here is that GCC.EXE cannot find CPP.EXE. -Normally CPP.EXE is in the directory C:\cygnus\H-i386-cygwin32\lib\gcc- -lib\i386-cygwin32\cygnus-2.7.2-961023\. If the file is there then -probably the GCC_EXEC_PREFIX environment variable is not correctly set. - - -2.4 Can't Find Include Files - -You get an error like this: - - hello.c:2: No include path in which to find stdio.h - -This, again, means what it says (more or less). The compiler cannot find -the file stdio.h which is #included in the source file hello.c at line -2. Of course the particular file names may differ in your case. If this -is not simply a case of including a really non-existent file or -misspelling the file name then probably your C_INCLUDE_PATH or -CPLUS_INCLUDE_PATH environment variable is wrong. (If not, see "But the -environment variables are right" below.) - - -2.5 Can't Find Libraries - -At link time you get an error like this: - - ld: cannot open -lkernel32: No such file or directory - -This one is a bit cryptic, mainly because the name of the file that -can't be opened is not "-lkernel32" but "libkernel32.a". "-lname" is the -ld command line syntax for linking the library named "libname.a". So -basically this error is saying it can't find libkernel32.a (or whatever -library matches the error you got). If you weren't trying to manually -link in a library that doesn't exist or was misspelled (by accidentally -including the 'lib' or '.a' on the command line for example) then -probably your LIBRARY_PATH environment variable is wrong. (If not, see -"But the environment variables are right" below.) - - -2.6 But the Environment Variables are Right! - -You had one of the problems with not finding include files or libraries -but the environment variables all seem to be pointing at the right -places and the files are all there. - -If you installed on a drive other than C: drive this may be your -problem. The Cygwin DLL, and thus all the basic compiler tools, -automatically map C: drive to (UNIX-style) '/'. Thus /cygnus is actually -C:\cygnus. There are a few ways to fix this (without reinstalling on C: -drive): - - - Map your actual install directory to /cygnus using mount - (mount.exe is included with the Cygnus distribution). Simply - type "mount D:\mydir /cygnus" (assuming you installed in the - directory \mydir on D: drive). Similar tricks can be used for - other directories which you may have installed on other drives. - - - Change the mount of C: to / to the actual install drive. This is - possible by using the registry editor (regedit) included with - Windows. Start the editor and go to the key (or folder) "My - Computer\HKEY_CURRENT_USER\Software\Cygnus Support\CYGWIN.DLL - setup\b15.0\mounts". Under this key there are several numbered - keys. One of them will have the variables "native" set to "c:" and - "unix" set to "/". Change the value of "native" to whatever drive - you did your install on and everything should be fixed. NOTE: You - should probably do this after a fresh boot with no Cygnus based - programs running. - - -2.7 Unresolved References to _impure_ptr and/or _ctype_ etc. - -At link time your code produces unresolved references to _impure_ptr, -_ctype_ and/or _errno, among others. - -This is the result of using the Cygwin header files but linking against -the Mingw32 libraries. I have hopefully managed to fix the bug that used -to cause this problem on any dual installation, but perhaps I haven't. -To check you can run gcc with the -v option and see if the list of -directories searched for include files contains any include directories -with Cygwin headers in them. If everything is working correctly you -should only see the directories on your C_INCLUDE_PATH in this list. - -If you have this problem then you may have to modify the Mingw32 specs -file, specifically the part that says: - -*cpp: -%{posix:-D_POSIX_SOURCE} -iprefix /mingw32/include/ - -These are options that get passed to the C preprocessor by gcc. Consult -the documentation for cpp and try options other than -iprefix. You may -have to use -nostdinc and/or -nostdinc++ plus -I options to get the -correct behavior. - - -2.8 My Program Doesn't Print Any Output OR My Windows Program Creates - A Console Window - -Your console application runs, but doesn't print any output, or your GUI -application runs fine, but always creates an extra console window when -run from Explorer or by double clicking on an icon. - -These are basically two sides of the same coin. You have created a GUI -(or console) application when you meant to create a console (or GUI) -application. By default gcc creates console applications. If you make a -windows GUI application with a WinMain and all that you will still get a -console application if you don't tell gcc what to do at link time. The -relevant options are "-windows" "-Wl,--subsystem,windows" or "-Wl,-- -subsystem,console". The first two, if used on a gcc link line, will -create a proper GUI application. The last will make sure you are making -a console application. - - - -3. Optimizing and Reducing Disk Space Usage - -There are still vast amounts of disk space used by the Cygwin32 -installation on your hard-drive, and much of it can be removed while -still maintaining a fully functional compiler system. The following -sections point out which files you actually need for certain tasks, so -that you won’t delete them. - - -3.1 Bare Minimum - -For C only, Mingw32 compiles which don’t use the Win32 API, and if you -don’t want to produce DLLs or do debugging with any of the GNU tools the -list of files required is as follows: - -In C:\cygnus\H-i386-cygwin32\bin: - ar.exe, as.exe, gcc.exe, ld.exe - -In C:\cygnus\H-i386-cygwin32\lib\gcc-lib\i386-cygwin32\cygnus-2.7.2- -961023: - cc1.exe, cpp.exe, libgcc.a - -In C:\cygnus\win32\lib: - libkernel32.a - -Plus all the files in C:\mingw32\lib and C:\mingw32\include and their -subdirectories. - - -3.2 C++ Support - -To add C++ Support to the above the following extra files are required: - -In C:\cygnus\H-i386-cygwin32\lib\gcc-lib\i386-cygwin32\cygnus-2.7.2- -961023: - cc1plus.exe - -Note that this does not include support for the standard C++ libraries -(only the C run time libraries) or for iostreams. That support is still -only available with the Cygwin32 API. - - -3.3 Extra Utilities of Extreme Usefulness - -Even if you do not use the bash shell or UNIX utilities in general some -of the utilities in C:\cygnus\H-i386-cygwin32\bin are extremely useful -for debugging and probably shouldn’t be deleted if you intend to do any -actual programming using the system. - -These include: - dlltool.exe, gdb.exe, nm.exe, and strip.exe. - - -3.4 Jam - -Jam is a make replacement program that I use pretty much exclusively, -which is why you don't find any Makefile, makefile, makefile.mk or all -that in the stuff that I do. You do find jamfiles and the occaisional -mk.bat file. The executable of Jam is only 80 KB and the program is -incredibly useful, so I would encourage you do download the special -Mingw32 version and check it out. The Mingw32 version has built in rules -for adding resources, building DLLs and import libraries as well as -normal C and C++ files. The source code is, of course, freely available. - -The actual point of this section though, is to point out that to use Jam -you need not only the Jam executable but also rm.exe from the Cygwin -distribution. You also might want to download rcl.exe and res2coff.exe -as these are the helper programs Jam expects to use for resource script -handling. - - -4. Legalities - -All of the code in the Mingw32 package is available as public domain -source. You may use and modify the code as you like. Of course I -encourage you to write software which is free, either public domain or -under the GNU Public License for example, but that is up to you. Linking -with the libraries included with Mingw32 similarly does not impose any -licensing restrictions on your code or binaries. - -The library libgcc.a, which is linked into all code produced with GCC, -is under a special version of the LGPL (as far as I know, you should -check for yourself) which allows the distribution of programs which are -simply linked with unmodified versions of libgcc.a with no licensing -restrictions. - -Thus, using Mingw32, you should be able to produce code with no -licensing restrictions imposed by use of the compiler or libraries. The -Cygwin32 API, and the GNU libraries are another matter and you should -consult their license agreements. - -Again I must stress that I am not a lawyer and the above statements only -reflect my personal understanding of the situation. You would be well -advised to consult the actual text of the appropriate copyright notices -and license agreements if you have any concerns. - - -5. Support - -First of all, the Mingw32 code is supplied AS IS with NO WARRANTY either -EXPRESS or IMPLIED. - -There is also no support staff standing by to take your calls. There -are, however, a few people, including myself, using Mingw32 who might be -able to help you. If you have problems you can email me at -colin@bird.fu.is.saga-u.ac.jp and I will try to get back to you. No -guarantees, but I will do my best. - - -6. Suggestions and Contributions - -If you find a bug in the Mingw32 files themselves then feel free to -report it, or even better to supply a fix, by emailing me at -colin@bird.fu.is.saga-u.ac.jp. Any fixes I receive will probably go into -the next release, and if they seem high-priority I may put the patched -files on my web page until I can make a complete release. Please note -that if you supply code it must be in the public domain or I cannot -include it in Mingw32. Please attach an appropriate legal message to the -code or otherwise make sure that there are no copyright issues. Of -course if you just suggest a possible method for solving a problem or -point out a bug then there should be no need for all that. - -Note that the Win32 API header files are not actually part of the -Mingw32 package. I know there are many bugs and omissions, and I try to -keep informed about them, so I do appreciate mail pointing them out. -However I can’t fix these problems at the source. You should send email -to Scott Christley (the author of the GPL windows32-api) or possibly to -Cygnus. Sending email to me might get me to mention it on my homepage or -fix it in my personal copy of the header files, but that’s about it -(sorry). - -Aside from bug reports, suggestions for improvements, testing of the -header files and otherwise praise or criticism is all welcome in my -inbox. - -Good luck, -Colin Peters (colin@bird.fu.is.saga-u.ac.jp) - diff --git a/winsup/mingw/samples/dirent/jamfile b/winsup/mingw/samples/dirent/jamfile deleted file mode 100644 index c920ffe9b..000000000 --- a/winsup/mingw/samples/dirent/jamfile +++ /dev/null @@ -1,3 +0,0 @@ - -Main test.exe : test.c ; - diff --git a/winsup/mingw/samples/dirent/test.c b/winsup/mingw/samples/dirent/test.c deleted file mode 100644 index 9ff4267ee..000000000 --- a/winsup/mingw/samples/dirent/test.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * A test which demonstrates the use of opendir and related functions - * declared in dirent.h. - */ - -#include <stdio.h> -#include <stdlib.h> -#include <errno.h> - -#include <dirent.h> - -int -main (int argc, char* argv[]) -{ - int i; - struct dirent* de; - DIR* dir; - long lPos; - - if (argc == 2) - { - printf ("Opening directory \"%s\"\n", argv[1]); - dir = opendir(argv[1]); - } - else - { - printf ("Opening \".\"\n"); - dir = opendir("."); - } - - if (!dir) - { - printf ("Directory open failed!\n"); - if (errno) - { - printf ("Error : %s\n", strerror(errno)); - } - return 1; - } - - i = 0; - lPos = -1; - - while (de = readdir (dir)) - { - i++; - printf ("%d : \"%s\" (tell %ld)\n", i, de->d_name, - telldir(dir)); - - if (i == 3) - { - printf ("We will seek here later.\n"); - lPos = telldir (dir); - } - } - - printf ("Rewind directory.\n"); - rewinddir (dir); - - if (de = readdir (dir)) - { - printf ("First entry : \"%s\"\n", de->d_name); - } - else - { - printf ("Empty directory.\n"); - } - - if (lPos != -1) - { - printf ("Seeking to fourth entry.\n"); - seekdir (dir, lPos); - - if (de = readdir (dir)) - { - printf ("Fourth entry : \"%s\"\n", de->d_name); - } - else - { - printf ("No fourth entry.\n"); - } - } - else - { - printf ("Seek position is past end of directory.\n"); - } - - printf ("Closing directory.\n"); - closedir (dir); -} - diff --git a/winsup/mingw/samples/dirent/wtest.c b/winsup/mingw/samples/dirent/wtest.c deleted file mode 100644 index 798544374..000000000 --- a/winsup/mingw/samples/dirent/wtest.c +++ /dev/null @@ -1,98 +0,0 @@ -/* - * A test which demonstrates the use of _wopendir and related - * wide char functions declared in dirent.h. - * - * TODO: Make this _UNICODE neutral using tchar.h mappings. - */ - -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <errno.h> -#include <dirent.h> - -int -main (int argc, char* argv[]) -{ - int i; - struct _wdirent* de; - _WDIR* dir; - long lPos; - - if (argc == 2) - { - size_t len = strlen(argv[1]) + 1; - wchar_t* wpath = (wchar_t*) malloc(len *sizeof(wchar_t)); - mbstowcs(wpath, argv[1], len); - wprintf (L"Opening directory \"%s\"\n", wpath); - dir = _wopendir(wpath); - free (wpath); - } - else - { - wprintf (L"Opening \".\"\n"); - dir = _wopendir(L"."); - } - - if (!dir) - { - wprintf (L"Directory open failed!\n"); - if (errno) - { - wprintf (L"Error : %S\n", strerror(errno)); - } - return 1; - } - - i = 0; - lPos = -1; - - while ((de = _wreaddir (dir))) - { - i++; - wprintf (L"%d : \"%s\" (tell %ld)\n", i, de->d_name, - _wtelldir(dir)); - - if (i == 3) - { - wprintf (L"We will seek here later.\n"); - lPos = _wtelldir (dir); - } - } - - printf ("Rewind directory.\n"); - _wrewinddir (dir); - - if ((de = _wreaddir (dir))) - { - wprintf (L"First entry : \"%s\"\n", de->d_name); - } - else - { - wprintf (L"Empty directory.\n"); - } - - if (lPos != -1) - { - wprintf (L"Seeking to fourth entry.\n"); - _wseekdir (dir, lPos); - - if ((de = _wreaddir (dir))) - { - wprintf (L"Fourth entry : \"%s\"\n", de->d_name); - } - else - { - wprintf (L"No fourth entry.\n"); - } - } - else - { - wprintf (L"Seek position is past end of directory.\n"); - } - - wprintf (L"Closing directory.\n"); - _wclosedir (dir); -return 0; -} - diff --git a/winsup/mingw/samples/dlltest/dll.c b/winsup/mingw/samples/dlltest/dll.c deleted file mode 100644 index 257b1b8ff..000000000 --- a/winsup/mingw/samples/dlltest/dll.c +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Source code of the functions inside our test DLL. Note that DllMain is - * not required (it will be provided by the stub in libmingw32.a). - */ - -#if 0 -#include <windows.h> -#endif - -int Add (int x, int y) -{ - printf ("In add!\nx = %d\ny = %d\n", x, y); - return (x + y); -} - - -double __attribute__((stdcall)) Sub (double x, double y) -{ - printf ("In sub!\nx = %f\ny = %f\n", x, y); - return (x - y); -} - diff --git a/winsup/mingw/samples/dlltest/dll.def b/winsup/mingw/samples/dlltest/dll.def deleted file mode 100644 index b20a405d8..000000000 --- a/winsup/mingw/samples/dlltest/dll.def +++ /dev/null @@ -1,3 +0,0 @@ -EXPORTS -Add -Sub@16 diff --git a/winsup/mingw/samples/dlltest/dll.h b/winsup/mingw/samples/dlltest/dll.h deleted file mode 100644 index 8fac5332b..000000000 --- a/winsup/mingw/samples/dlltest/dll.h +++ /dev/null @@ -1,4 +0,0 @@ - -int Add (int x, int y); -double __attribute__((stdcall)) Sub (double x, double y); - diff --git a/winsup/mingw/samples/dlltest/exe.c b/winsup/mingw/samples/dlltest/exe.c deleted file mode 100644 index d778348e4..000000000 --- a/winsup/mingw/samples/dlltest/exe.c +++ /dev/null @@ -1,23 +0,0 @@ -#include <stdio.h> - -#include "dll.h" - -int main() -{ - int i, j, k; - double dk; - - i = 10; - j = 13; - - k = Add(i, j); - - printf ("%d + %d = %d\n", i, j, k); - - dk = Sub(i, j); - - printf ("%d - %d = %f\n", i, j, dk); - - return 0; -} - diff --git a/winsup/mingw/samples/dlltest/exe.exp b/winsup/mingw/samples/dlltest/exe.exp deleted file mode 100644 index 887fdb0ac..000000000 --- a/winsup/mingw/samples/dlltest/exe.exp +++ /dev/null @@ -1,8 +0,0 @@ -In add! -x = 10 -y = 13 -10 + 13 = 23 -In sub! -x = 10 -y = 13 -10 - 13 = -3 diff --git a/winsup/mingw/samples/dlltest/expexe.c b/winsup/mingw/samples/dlltest/expexe.c deleted file mode 100644 index d94ea1e7e..000000000 --- a/winsup/mingw/samples/dlltest/expexe.c +++ /dev/null @@ -1,17 +0,0 @@ - -#include <stdio.h> - -int -ExportedFromExe () -{ - printf ("This output produced by ExportedFromExe.\n"); - return 0; -} - -int main() -{ - printf ("Hello, world\n"); - - return 0; -} - diff --git a/winsup/mingw/samples/dlltest/expexe.def b/winsup/mingw/samples/dlltest/expexe.def deleted file mode 100644 index 309f1508f..000000000 --- a/winsup/mingw/samples/dlltest/expexe.def +++ /dev/null @@ -1,2 +0,0 @@ -EXPORTS -ExportedFromExe diff --git a/winsup/mingw/samples/dlltest/jamfile b/winsup/mingw/samples/dlltest/jamfile deleted file mode 100644 index 5278d0379..000000000 --- a/winsup/mingw/samples/dlltest/jamfile +++ /dev/null @@ -1,46 +0,0 @@ -
-# This option is required to successfully return doubles via STDCALL as in
-# Sub function in dll.c.
-CCFLAGS = -mno-fp-ret-in-387 ;
-
-Main exe.exe : exe.c ;
-
-LinkLibraries exe.exe : libdll.a ;
-
-DEPENDS exe.exe : dll.dll ;
-
-LINKFLAGS on exe.exe = $(LINKFLAGS) -L. ;
-
-
-Main loaddll.exe : loaddll.c ;
-
-DEPENDS loaddll.exe : dll.dll ;
-
-
-Dll dll.dll : dll.c ;
-
-ImportLib libdll.a : dll.def ;
-
-
-Main expexe.exe : expexe.c ;
-
-# Force the executable to include the expexe.def file.
-Exports expexe.exe : expexe.def ;
-
-Main loadexe.exe : loadexe.c ;
-
-DEPENDS loadexe.exe : expexe.exe ;
-
-
-Main silly.exe : silly.cpp ;
-
-LinkLibraries silly.exe : libsilly.a ;
-
-DEPENDS silly.exe : silly.dll ;
-
-LINKFLAGS on silly.exe += -L. ;
-
-Dll silly.dll : sillydll.cpp ;
-
-ImportLib libsilly.a : silly.def ;
-
diff --git a/winsup/mingw/samples/dlltest/loaddll.c b/winsup/mingw/samples/dlltest/loaddll.c deleted file mode 100644 index ec69c9a7e..000000000 --- a/winsup/mingw/samples/dlltest/loaddll.c +++ /dev/null @@ -1,40 +0,0 @@ -/* - * This version attempts to load dll.dll dynamically, get the address of the - * Add function, and then call it. - */ - -#include <stdio.h> -#include <windows.h> - -int (*Add)(int x, int y); - -int main() -{ - HINSTANCE hDll; - int i, j, k; - - hDll = LoadLibrary ("dll.dll"); - if (!hDll) - { - printf ("Error %d loading dll.\n", GetLastError()); - exit (-1); - } - - if (!(Add = GetProcAddress (hDll, "Add"))) - { - printf ("Error %d getting Add function.\n", GetLastError()); - exit (-1); - } - - i = 10; - j = 13; - - k = Add(i, j); - - printf ("i %d, j %d, k %d\n", i, j, k); - - FreeLibrary (hDll); - - return 0; -} - diff --git a/winsup/mingw/samples/dlltest/loadexe.c b/winsup/mingw/samples/dlltest/loadexe.c deleted file mode 100644 index 2ee4e8483..000000000 --- a/winsup/mingw/samples/dlltest/loadexe.c +++ /dev/null @@ -1,47 +0,0 @@ -/* - * This program attempts to load expexe.exe dynamically, get the address of the - * ExportedFromExe function, and then call it. - * - * This example DOES NOT WORK! I don't know exactly what can be done, but - * it simply seems that LoadLibrary refuses to load executables. - */ - -#include <stdio.h> -#include <windows.h> - -int (*ExportedFromExe)(); - -int main() -{ - HINSTANCE hDll; - int i, j, k; - - hDll = LoadLibrary ("expexe.exe"); - if (!hDll) - { - printf ("Error %d loading exe.\n", GetLastError()); - exit (-1); - } - - if (!(ExportedFromExe = GetProcAddress (hDll, "ExportedFromExe"))) - { - printf ("Error %d getting ExportedFromExe function.\n", - GetLastError()); - exit (-1); - } - else - { - ExportedFromExe (); - } - - /* NOTE: Unlike a DLL the exe doesn't have an entry point which - * initializes global objects and adds __do_global_dtors to - * the atexit list. Thus it should be safe(?) to free the - * library. Of course, this also makes it unsafe to use - * executables at all in this manner. - */ - FreeLibrary (hDll); - - return 0; -} - diff --git a/winsup/mingw/samples/dlltest/readme.txt b/winsup/mingw/samples/dlltest/readme.txt deleted file mode 100644 index 3d3101326..000000000 --- a/winsup/mingw/samples/dlltest/readme.txt +++ /dev/null @@ -1,39 +0,0 @@ -This directory contains two examples of building DLLs. The exe.c and dll.c -files are used to build a very simple example DLL with a function that -adds two numbers together (and prints some text at the same time). The -exe.c program links to the DLL and prints the results of the function -call. - -The C++ example "silly" is more interesting because it involves a DLL which -contains the code for a C++ class. The CSilly class has all of its code in -the sillydll.cpp source file, which is used to build the silly.dll. The -silly.cpp source code builds the main silly.exe executable which makes a -dynamic instance of the object and calls its member functions. - -The C++ silly.def file was generated by doing a nm of sillydll.o after it -was generated and then getting the symbol names from that. Removing the -leading underscore produces the appropriate name to include in the EXPORTS -section. Notice there are a few weird functions. - -Since there are now several different versions of the GNU compiler capable -of doing this, and they each seem to have different requirements for exports -for classes, it has gotten kind of messy. The silly.def file here is for -use with the native Mingw32 build of the EGCS version of GCC. The silly.def.old -file was the def file I used when I was using Jan-Jaap's Mingw32 native port -of GCC. The Cygnus version is different again, if I recall correctly, but I -don't have it hanging around anymore. - -The jamfile builds all the components from the raw sources. - -The expected output of exe.exe and silly.exe are in the files exe.exp -and silly.exp. - - -The source code in this directory is in the PUBLIC DOMAIN and can be -used or abused as you see fit. There is NO WARRANTY for this code, -including (but not limited to) implied warranties of MERCHANTABILITY -or FITNESS FOR A PARTICULAR PURPOSE. - - -Colin Peters <colin@bird.fu.is.saga-u.ac.jp> - diff --git a/winsup/mingw/samples/dlltest/silly.cpp b/winsup/mingw/samples/dlltest/silly.cpp deleted file mode 100644 index ee9e1fe77..000000000 --- a/winsup/mingw/samples/dlltest/silly.cpp +++ /dev/null @@ -1,55 +0,0 @@ -// -// C++ test of a dll which contains a C++ class. -// - -#include <stdlib.h> -#include <stdio.h> - -// Interface of class. -#include "silly.h" - -#ifdef DERIVED_TEST -// Here is a derived class too. -class CMoreSilly : public CSilly -{ - public: - CMoreSilly (char* szNewName) : CSilly (szNewName) {}; - ~CMoreSilly (); - - WhatsYourName(); -}; - -CMoreSilly:: -~CMoreSilly () -{ - printf ("In CMoreSilly \"%s\" destructor!\n", szName); -} - -CMoreSilly:: -WhatsYourName () -{ - printf ("I'm more silly and my name is \"%s\"\n", szName); -} -#endif - -int -main () -{ - CSilly* psilly = new CSilly("silly"); - - psilly->WhatsYourName(); - psilly->Poke(); // Poke him, he should say "Ouch!" - psilly->Stab(4); // Stab him four times he should say "Ugh!!!!" - - delete psilly; - -#ifdef DERIVED_TEST - psilly = new CMoreSilly("more silly"); - psilly->WhatsYourName(); - psilly->Stab(5); - delete psilly; -#endif - - return 0; -} - diff --git a/winsup/mingw/samples/dlltest/silly.def b/winsup/mingw/samples/dlltest/silly.def deleted file mode 100644 index a766ff94f..000000000 --- a/winsup/mingw/samples/dlltest/silly.def +++ /dev/null @@ -1,11 +0,0 @@ -EXPORTS -DllMain@12 -Poke__6CSilly -Stab__6CSillyi -WhatsYourName__6CSilly -_$_6CSilly -__6CSilly -__6CSillyPc -__tf6CSilly -__ti6CSilly -_vt$6CSilly diff --git a/winsup/mingw/samples/dlltest/silly.exp b/winsup/mingw/samples/dlltest/silly.exp deleted file mode 100644 index ab544f97f..000000000 --- a/winsup/mingw/samples/dlltest/silly.exp +++ /dev/null @@ -1,8 +0,0 @@ -I'm silly. -Ouch! -Ugh!!!! -In CSilly destructor. -I'm more silly and my name is "more silly" -Ugh!!!!! -In CMoreSilly "more silly" destructor! -In CSilly destructor. diff --git a/winsup/mingw/samples/dlltest/silly.h b/winsup/mingw/samples/dlltest/silly.h deleted file mode 100644 index d3f99bed8..000000000 --- a/winsup/mingw/samples/dlltest/silly.h +++ /dev/null @@ -1,27 +0,0 @@ - -#define DERIVED_TEST 1 - -class CSilly -{ - protected: - char* szName; - - public: - CSilly(); - CSilly(char* szName); -#ifdef DERIVED_TEST - virtual ~CSilly(); -#else - ~CSilly(); -#endif - - Poke (); - Stab (int nTimes); -#ifdef DERIVED_TEST - virtual WhatsYourName (); -#else - WhatsYourName (); -#endif - -}; - diff --git a/winsup/mingw/samples/dlltest/sillydll.cpp b/winsup/mingw/samples/dlltest/sillydll.cpp deleted file mode 100644 index 87385e584..000000000 --- a/winsup/mingw/samples/dlltest/sillydll.cpp +++ /dev/null @@ -1,107 +0,0 @@ - -#include <stdlib.h> -#include <stdio.h> -#include <string.h> -#include <windows.h> - - -#if 0 -#define STREAMS_VERSION -#endif - -#if defined(STREAMS_VERSION) -#include <iostream.h> -#endif - -#include "silly.h" - -extern "C" -BOOL WINAPI DllMain(HANDLE hDll, DWORD dwReason, LPVOID lpReserved) -{ - return TRUE; -} - -CSilly:: -CSilly() -{ - szName = NULL; -} - -CSilly:: -CSilly(char* new_szName) -{ - szName = new char[strlen(new_szName)+1]; - - if (szName) - { - strcpy (szName, new_szName); - } -} - -CSilly:: -~CSilly() -{ - printf ("In CSilly destructor.\n"); - if (szName) - { - delete szName; - } -} - -CSilly:: -Poke () -{ -#ifndef STREAMS_VERSION - printf ("Ouch!\n"); -#else - cout << "Ouch!" << endl; -#endif -} - -CSilly:: -Stab (int nTimes) -{ -#ifndef STREAMS_VERSION - printf ("Ugh"); -#else - cout << "Ugh"; -#endif - - int i; - for (i = 0; i < nTimes; i++) - { -#ifndef STREAMS_VERSION - putchar('!'); -#else - cout << '!' ; -#endif - } - -#ifndef STREAMS_VERSION - putchar('\n'); -#else - cout << endl; -#endif -} - -CSilly:: -WhatsYourName () -{ - if (szName) - { -#ifndef STREAMS_VERSION - printf ("I'm %s.\n", szName); -#else - cout << "I'm " << szName << "." << endl; -#endif - } - else - { -#ifndef STREAMS_VERSION - printf ("I have no name.\n"); -#else - cout << "I have no name." << endl; -#endif - } -} - diff --git a/winsup/mingw/samples/filehand/filehand.c b/winsup/mingw/samples/filehand/filehand.c deleted file mode 100644 index 2af69b371..000000000 --- a/winsup/mingw/samples/filehand/filehand.c +++ /dev/null @@ -1,57 +0,0 @@ -/* - * An example showing how you can obtain the UNIX-ish file number from a - * FILE* and in turn how you can get the Win32 HANDLE of the file from - * the file number. - * - * This code is in the PUBLIC DOMAIN and has NO WARRANTY. - * - * Colin Peters <colin@fu.is.saga-u.ac.jp> - */ - -#include <stdio.h> -#include <io.h> -#include <windows.h> - -int -main (int argc, char* argv[]) -{ - char* szFileName; - FILE* fileIn; - int fnIn; - HANDLE hFileIn; - char caBuf[81]; - int nRead; - - if (argc >= 2) - { - szFileName = argv[1]; - } - else - { - szFileName = "junk.txt"; - } - - fileIn = fopen (szFileName, "r"); - - if (!fileIn) - { - printf ("Could not open %s for reading\n", szFileName); - exit(1); - } - - fnIn = fileno (fileIn); - hFileIn = (HANDLE) _get_osfhandle (fnIn); - - printf ("OS file handle %d\n", (int) hFileIn); - - ReadFile (hFileIn, caBuf, 80, &nRead, NULL); - - printf ("Read %d bytes using ReadFile.\n", nRead); - - caBuf[nRead] = '\0'; - - printf ("\"%s\"\n", caBuf); - - fclose (fileIn); -} - diff --git a/winsup/mingw/samples/filehand/jamfile b/winsup/mingw/samples/filehand/jamfile deleted file mode 100644 index 3b2c726de..000000000 --- a/winsup/mingw/samples/filehand/jamfile +++ /dev/null @@ -1,3 +0,0 @@ - -Main filehand.exe : filehand.c ; - diff --git a/winsup/mingw/samples/filehand/junk.txt b/winsup/mingw/samples/filehand/junk.txt deleted file mode 100644 index 6de7b8c69..000000000 --- a/winsup/mingw/samples/filehand/junk.txt +++ /dev/null @@ -1 +0,0 @@ -This is a test file. diff --git a/winsup/mingw/samples/fixargv/fixargv.c b/winsup/mingw/samples/fixargv/fixargv.c deleted file mode 100644 index c2e2a41e6..000000000 --- a/winsup/mingw/samples/fixargv/fixargv.c +++ /dev/null @@ -1,290 +0,0 @@ -/* - * fixargv.c - * - * A special function which "fixes" an argv array by replacing arguments - * that need quoting with quoted versions. - * - * NOTE: In order to be reasonably consistent there is some misuse of the - * const keyword here-- which leads to compilation warnings. These - * should be ok to ignore. - * - * This is a sample distributed as part of the Mingw32 package. - * - * Contributors: - * Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp> - * - * THIS SOFTWARE IS NOT COPYRIGHTED - * - * This source code is offered for use in the public domain. You may - * use, modify or distribute it freely. - * - * This code is distributed in the hope that it will be useful but - * WITHOUT ANY WARRANTY. ALL WARRENTIES, EXPRESS OR IMPLIED ARE HEREBY - * DISCLAMED. This includes but is not limited to warrenties of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * $Revision$ - * $Author$ - * $Date$ - * - */ - -#include <string.h> -#include "fixargv.h" - -/* - * This takes a single string and fixes it, enclosing it in quotes if it - * contains any spaces and/or escaping the quotes it contains. - */ -char* -fix_arg (const char* szArg) -{ - int nQuoteAll; /* Does the whole arg need quoting? */ - int nBkSlRun; /* How may backslashes in a row? */ - char* sz; - char* szNew; - size_t sizeLen; - - nQuoteAll = 0; - nBkSlRun = 0; - sz = szArg; - sizeLen = 1; - - /* First we figure out how much bigger the new string has to be - * than the old one. */ - while (*sz != '\0') - { - /* - * Arguments containing whitespace of wildcards will be - * quoted to preserve tokenization and/or those special - * characters (i.e. wildcarding will NOT be done at the - * other end-- they will get the * and ? characters as is). - * TODO: Is this the best way? Do we want to enable wildcards? - * If so, when? - */ - if (!nQuoteAll && - (*sz == ' ' || *sz == '\t' || *sz == '*' || *sz == '?')) - { - nQuoteAll = 1; - } - else if (*sz == '\\') - { - nBkSlRun++; - } - else - { - if (*sz == '\"') - { - sizeLen += nBkSlRun + 1; - } - nBkSlRun = 0; - } - - sizeLen++; - sz++; - } - - if (nQuoteAll) - { - sizeLen += 2; - } - - /* - * Make a new string big enough. - */ - szNew = (char*) malloc (sizeLen); - if (!szNew) - { - return NULL; - } - sz = szNew; - - /* First enclosing quote for fully quoted args. */ - if (nQuoteAll) - { - *sz = '\"'; - sz++; - } - - /* - * Go through the string putting backslashes in front of quotes, - * and doubling all backslashes immediately in front of quotes. - */ - nBkSlRun = 0; - while (*szArg != '\0') - { - if (*szArg == '\\') - { - nBkSlRun++; - } - else - { - if (*szArg == '\"') - { - while (nBkSlRun > 0) - { - *sz = '\\'; - sz++; - nBkSlRun--; - } - *sz = '\\'; - sz++; - } - nBkSlRun = 0; - } - - *sz = *szArg; - sz++; - szArg++; - } - - /* Closing quote for fully quoted args. */ - if (nQuoteAll) - { - *sz = '\"'; - sz++; - } - - *sz = '\0'; - return szNew; -} - -/* - * Takes argc and argv and returns a new argv with escaped members. Pass - * this fixed argv (along with the old one) to free_fixed_argv after - * you finish with it. Pass in an argc of -1 and make sure the argv vector - * ends with a null pointer to have fix_argv count the arguments for you. - */ -char* const* -fix_argv (int argc, char* const* szaArgv) -{ - char** szaNew; - char* sz; - int i; - - if (!szaArgv) - { - return NULL; - } - - /* - * Count the arguments if asked. - */ - if (argc == -1) - { - for (i = 0; szaArgv[i]; i++) - ; - - argc = i; - } - - /* - * If there are no args or only one arg then do no escaping. - */ - if (argc < 2) - { - return szaArgv; - } - - for (i = 1, szaNew = NULL; i < argc; i++) - { - sz = szaArgv[i]; - - /* - * If an argument needs fixing, then fix it. - */ - if (strpbrk (sz, "\" \t*?")) - { - /* - * If we haven't created a new argv list already - * then make one. - */ - if (!szaNew) - { - szaNew = (char**) malloc ((argc + 1) * - sizeof (char*)); - if (!szaNew) - { - return NULL; - } - - /* - * Copy previous args from old to new. - */ - memcpy (szaNew, szaArgv, sizeof(char*) * i); - } - - /* - * Now do the fixing. - */ - szaNew[i] = fix_arg (sz); - if (!szaNew[i]) - { - /* Fixing failed, free up and return error. */ - free_fixed_argv (szaNew, szaArgv); - return NULL; - } - } - else if (szaNew) - { - szaNew[i] = sz; - } - } - - if (szaNew) - { - /* If we have created a new argv list then we might as well - * terminate it nicely. (And we depend on it in - * free_fixed_argv.) */ - szaNew[argc] = NULL; - } - else - { - /* If we didn't create a new argv list then return the - * original. */ - return szaArgv; - } - - return szaNew; -} - -void -free_fixed_argv (char* const* szaFixed, char* const* szaOld) -{ - char* const* sza; - - /* - * Check for error conditions. Also note that if no corrections - * were required the fixed argv will actually be the same as - * the old one, and we don't need to do anything. - */ - if (!szaFixed || !szaOld || szaFixed == szaOld) - { - return; - } - - /* - * Go through all members of the argv list. If any of the - * members in the fixed list are different from the old - * list we free those members. - * NOTE: The first member is never modified, so we don't need to - * check. - */ - sza = szaFixed + 1; - szaOld++; - while (*sza) - { - if (*sza != *szaOld) - { - free (*sza); - } - sza++; - szaOld++; - } - - /* - * Now we can free the array of char pointers itself. - */ - free (szaFixed); -} - diff --git a/winsup/mingw/samples/fixargv/fixargv.h b/winsup/mingw/samples/fixargv/fixargv.h deleted file mode 100644 index e4a83fae1..000000000 --- a/winsup/mingw/samples/fixargv/fixargv.h +++ /dev/null @@ -1,24 +0,0 @@ -/* - * fixargv.h - * - * Prototypes of utility functions for 'properly' escaping argv vectors. - * - * THIS SOFTWARE IS NOT COPYRIGHTED - * - * This source code is offered for use in the public domain. You may - * use, modify or distribute it freely. - * - * $Revision$ - * $Author$ - * $Date$ - * - */ - -#ifndef _FIXARGV_H_ -#define _FIXARGV_H_ - -char* fix_arg (const char* szArg); -char* const* fix_argv (int argc, char* const* szaArgv); -void free_fixed_argv (char* const* szaFixed, char* const* szaOld); - -#endif diff --git a/winsup/mingw/samples/fixargv/readme.txt b/winsup/mingw/samples/fixargv/readme.txt deleted file mode 100644 index 555ef9bde..000000000 --- a/winsup/mingw/samples/fixargv/readme.txt +++ /dev/null @@ -1,85 +0,0 @@ - -This code is a utility function I was considering adding to Mingw32. The -Microsoft versions of argc, argv construction use quotes and backslashes -to allow the user to pass arguments containing spaces (or quotes) to -programs they invoke. The rules are - - - Arguments containing spaces must be enclosed in quotes. - - A quote can be passed by preceeding it with a backslash. - - Backslashes immediately preceeding a quote must be doubled to avoid - escaping the quote. - -Thus an argument like: - - -D="Foo Bar\\" - -needs to be mangled as: - - "-D\"Foo Bar\\\\\"" - -in order to get to the program as what was intended above. - -The fix_argv set of functions is meant to be used with spawnv and the -like to allow a program to set up an argv array for the spawned program -and have that array duplicated *exactly* in the spawned program, no -matter what it contains (it also quotes 'globbing' characters like * -and ?, so it does not matter if the destination has globbing turned on -or not; it might be a reasonable extension to allow a flag to allow -globbing characters to pass through unmolested, but they would still -be quoted if the string contained whitespace). - -The reason for writing this came up because of problems with arguments -like -DBLAH="Foo Bar" to GCC (define BLAH as a preprocessor constant -being the string "Foo Bar", including the quotes). Because GCC simply -passes the argument directly to CPP (the preprocessor) it had to be -escaped *twice*: - - "-DBLAH=\"\\\"Foo Bar\\\"\"" - -This would reach GCC as - - -DBLAH="\"Foo Bar\"" - -And that would reach CPP as the desired - - -DBLAH="Foo Bar" - -One level of quoting and escaping is to be expected (although MS's -standard is, arguably, not very good), but forcing the user to know -how many different programs the argument is going to pass through, -and perform double quoting and escaping, seems unreasonable. If -GCC and friends all used fix_argv (they use their own version of -it now) then the original argument could be - - "-DBLAH=\"Foo Bar\"" - -And that would work fine, no matter how many different tools it -passed through. - -The only basic limitation with this code is that it assumes that all -the spawned programs use Microsoft-type escaping when interpreting -their command line. Most programs on Win32 machines do (anything -compiled with Mingw32 will). - -For now, this code has been relegated to 'sample' status. If you want -to use it, feel free (it is public domain after all). - -Colin. - -P.S. Just out of interest you might try writing your own little program - to look at the interaction of wildcards and quotes. Use the glob.exe - program in ../globbing and see what it does with - - glob "foo*.txt" - - even if there are files foo.txt and foobar.txt in the same directory. - - Note that - - del "My *.txt" - - works (i.e. it deletes all files starting with My<space>). This could - not be done unless del does globbing *after* processing escapes and - quotes, which is not the way it seems to work normally (again see - the glob example). - diff --git a/winsup/mingw/samples/fmode/all.c b/winsup/mingw/samples/fmode/all.c deleted file mode 100644 index f052b9306..000000000 --- a/winsup/mingw/samples/fmode/all.c +++ /dev/null @@ -1,49 +0,0 @@ -/* - * A sample program demonstrating how to use _CRT_fmode to change the default - * file opening mode to binary AND change stdin, stdout and stderr. Redirect - * stdout to a file from the command line to see the difference. - * - * Also try directing a file into stdin. If you type into stdin you will get - * \r\n at the end of every line... unlike UNIX. But at least if you - * redirect a file in you will get exactly the characters in the file as input. - * - * THIS CODE IS IN THE PUBLIC DOMAIN. - * - * Colin Peters <colin@fu.is.saga-u.ac.jp> - */ - -#include <stdio.h> -#include <stdlib.h> /* _fmode */ -#include <fcntl.h> /* _O_BINARY */ -#include <io.h> /* _setmode */ - - -unsigned int _CRT_fmode = _O_BINARY; - -main () -{ - char* sz = "This is line one.\nThis is line two.\n"; - FILE* fp; - int c; - - printf (sz); - - /* Note how this fopen does NOT indicate "wb" to open the file in - * binary mode. */ - fp = fopen ("all.out", "w"); - - fprintf (fp, sz); - - fclose (fp); - - if (_isatty (_fileno(stdin))) - { - fprintf (stderr, "Waiting for input, press Ctrl-Z to finish.\n"); - } - - while ((c = fgetc(stdin)) != EOF) - { - printf ("\'%c\' %02X\n", (char) c, c); - } -} - diff --git a/winsup/mingw/samples/fmode/jamfile b/winsup/mingw/samples/fmode/jamfile deleted file mode 100644 index 5b7a1cb06..000000000 --- a/winsup/mingw/samples/fmode/jamfile +++ /dev/null @@ -1,7 +0,0 @@ - -Main test.exe : test.c ; - -Main test2.exe : test2.c ; - -Main all.exe : all.c ; - diff --git a/winsup/mingw/samples/fmode/readme.txt b/winsup/mingw/samples/fmode/readme.txt deleted file mode 100644 index b865bfd4e..000000000 --- a/winsup/mingw/samples/fmode/readme.txt +++ /dev/null @@ -1,5 +0,0 @@ - -These two demos show how _fmode and _CRT_fmode can be used to modify the -default file opening mode (text vs. binary) and/or the mode of the standard -file handles. - diff --git a/winsup/mingw/samples/fmode/test.c b/winsup/mingw/samples/fmode/test.c deleted file mode 100644 index 0ec364534..000000000 --- a/winsup/mingw/samples/fmode/test.c +++ /dev/null @@ -1,32 +0,0 @@ -/* - * A sample program demonstrating how to use fmode to change the default - * file opening mode to binary. NOTE: Does not change stdin, stdout or - * stderr. - * - * THIS CODE IS IN THE PUBLIC DOMAIN. - * - * Colin Peters <colin@fu.is.saga-u.ac.jp> - */ - -#include <stdio.h> -#include <stdlib.h> /* _fmode */ -#include <fcntl.h> /* _O_BINARY */ - -main () -{ - char* sz = "This is line one.\nThis is line two.\n"; - FILE* fp; - - _fmode = _O_BINARY; - - printf (sz); - - /* Note how this fopen does NOT indicate "wb" to open the file in - * binary mode. */ - fp = fopen ("test.out", "w"); - - fprintf (fp, sz); - - fclose (fp); -} - diff --git a/winsup/mingw/samples/fmode/test2.c b/winsup/mingw/samples/fmode/test2.c deleted file mode 100644 index b7d6b1891..000000000 --- a/winsup/mingw/samples/fmode/test2.c +++ /dev/null @@ -1,37 +0,0 @@ -/* - * A sample program demonstrating how to use fmode to change the default - * file opening mode to binary. Compare this file, which sets _fmode - * at file level to test.c, which sets the dll variable directly within - * main. - * NOTE: Does not change stdin, stdout or stderr. - * - * THIS CODE IS IN THE PUBLIC DOMAIN. - * - * Colin Peters <colin@fu.is.saga-u.ac.jp> - * Danny Smith <dannysmith@users.sourceforge.net> - */ - -#include <stdio.h> -#include <stdlib.h> /* _fmode */ -#include <fcntl.h> /* _O_BINARY */ - -#undef _fmode -int _fmode = _O_BINARY; - -main () -{ - - char* sz = "This is line one.\nThis is line two.\n"; - FILE* fp; - - printf (sz); - - /* Note how this fopen does NOT indicate "wb" to open the file in - * binary mode. */ - fp = fopen ("test2.out", "w"); - - fprintf (fp, sz); - - fclose (fp); -} - diff --git a/winsup/mingw/samples/globbing/glob.c b/winsup/mingw/samples/globbing/glob.c deleted file mode 100644 index 6bf8acaee..000000000 --- a/winsup/mingw/samples/globbing/glob.c +++ /dev/null @@ -1,20 +0,0 @@ -
-#include <stdlib.h>
-#include <stdio.h>
-#include <windows.h>
-
-int
-main (int argc, char* argv[])
-{
- int i;
-
- printf ("Command line (via GetCommandLine) \"%s\"\n",
- GetCommandLine());
-
- for (i = 0; i < argc; i++)
- {
- printf ("Argv[%d] \"%s\"\n", i, argv[i]);
- }
-
- return 0;
-}
diff --git a/winsup/mingw/samples/globbing/jamfile b/winsup/mingw/samples/globbing/jamfile deleted file mode 100644 index ff3a585d6..000000000 --- a/winsup/mingw/samples/globbing/jamfile +++ /dev/null @@ -1,11 +0,0 @@ -
-Object glob.o : glob.c ;
-
-MainFromObjects glob.exe : glob.o ;
-
-Main noglob.exe : noglob.c ;
-
-LIBDIR = \\mingw32\\lib\\ ;
-
-MainFromObjects CRTnoglob.exe : glob.o $(LIBDIR)CRT_noglob.o ;
-
diff --git a/winsup/mingw/samples/globbing/noglob.c b/winsup/mingw/samples/globbing/noglob.c deleted file mode 100644 index 8bc4c82a3..000000000 --- a/winsup/mingw/samples/globbing/noglob.c +++ /dev/null @@ -1,22 +0,0 @@ -
-#include <stdlib.h>
-#include <stdio.h>
-#include <windows.h>
-
-/* This line turns off automatic command line globbing. */
-int _CRT_glob = 0;
-
-int
-main (int argc, char* argv[])
-{
- int i;
-
- printf ("Command line (via GetCommandLine) \"%s\"\n",
- GetCommandLine());
- for (i = 0; i < argc; i++)
- {
- printf ("Argv[%d] \"%s\"\n", i, argv[i]);
- }
-
- return 0;
-}
diff --git a/winsup/mingw/samples/globbing/readme.txt b/winsup/mingw/samples/globbing/readme.txt deleted file mode 100644 index 5e20de826..000000000 --- a/winsup/mingw/samples/globbing/readme.txt +++ /dev/null @@ -1,14 +0,0 @@ -
-This directory contains samples which demonstrate default (globbing on)
-behavior, how to turn the globbing off with the _CRT_glob variable, and
-how to turn it off with the CRT_noglob object file.
-
-Run jam and then run glob, noglob and CRTnoglob with an argument like
-*.* to see the difference.
-
-The code in this directory is in the PUBLIC DOMAIN. It has NO WARRANTY,
-including, but not restricted to, warranties of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE.
-
-Colin Peters <colin@bird.fu.is.saga-u.ac.jp>.
-
diff --git a/winsup/mingw/samples/print/jamfile b/winsup/mingw/samples/print/jamfile deleted file mode 100644 index b77e6d66b..000000000 --- a/winsup/mingw/samples/print/jamfile +++ /dev/null @@ -1,9 +0,0 @@ -# -# A simple example which prints a message on a selected printer. This won't -# work right unless you make PRINTDLG a packed structure! -# - -Main prntest.exe : prntest.c ; - -Gui prntest.exe ; - diff --git a/winsup/mingw/samples/print/prntest.c b/winsup/mingw/samples/print/prntest.c deleted file mode 100644 index a70e7ed5d..000000000 --- a/winsup/mingw/samples/print/prntest.c +++ /dev/null @@ -1,65 +0,0 @@ - -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <windows.h> - -main () -{ - PRINTDLG pd; - DOCINFO di; - char* szMessage; - - memset (&pd, 0, sizeof(PRINTDLG)); - memset (&di, 0, sizeof(DOCINFO)); - - di.cbSize = sizeof(DOCINFO); - di.lpszDocName = "Test"; - - pd.lStructSize = sizeof(PRINTDLG); - pd.Flags = PD_PAGENUMS | PD_RETURNDC; - pd.nFromPage = 1; - pd.nToPage = 1; - pd.nMinPage = 1; - pd.nMaxPage = 1; - - szMessage = 0; - - if (PrintDlg (&pd)) - { - if (pd.hDC) - { - if (StartDoc (pd.hDC, &di) != SP_ERROR) - { - StartPage (pd.hDC); - - TextOut (pd.hDC, 0, 0, "Hello, printer!", 15); - - EndPage (pd.hDC); - - EndDoc (pd.hDC); - - szMessage = "Printed."; - } - else - { - szMessage = "Could not start document."; - } - } - else - { - szMessage = "Could not create device context."; - } - } - else - { - szMessage = "Canceled or printer could not be setup."; - } - - if (szMessage) - { - MessageBox (NULL, szMessage, "Print Test", MB_OK); - } - - return 0; -} diff --git a/winsup/mingw/samples/seh/eh3.c b/winsup/mingw/samples/seh/eh3.c deleted file mode 100644 index 49a06ceab..000000000 --- a/winsup/mingw/samples/seh/eh3.c +++ /dev/null @@ -1,112 +0,0 @@ -int -__except_handler3( - struct _EXCEPTION_RECORD* pExceptionRecord, - struct EXCEPTION_REGISTRATION* pRegistrationFrame, - struct _CONTEXT* pContextRecord, - void* pDispatcherContext - ) -{ - LONG filterFuncRet; - LONG trylevel; - EXCEPTION_POINTERS exceptPtrs; - PSCOPETABLE pScopeTable; - - - CLD // Clear the direction flag (make no assumptions!) - - // if neither the EXCEPTION_UNWINDING nor EXCEPTION_EXIT_UNWIND bit - // is set... This is true the first time through the handler (the - // non-unwinding case) - - if ( ! (pExceptionRecord->ExceptionFlags - & (EXCEPTION_UNWINDING | EXCEPTION_EXIT_UNWIND) - ) ) - { - // Build the EXCEPTION_POINTERS structure on the stack - exceptPtrs.ExceptionRecord = pExceptionRecord; - exceptPtrs.ContextRecord = pContextRecord; - - // Put the pointer to the EXCEPTION_POINTERS 4 bytes below the - // establisher frame. See ASM code for GetExceptionInformation - *(PDWORD)((PBYTE)pRegistrationFrame - 4) = &exceptPtrs; - - // Get initial "trylevel" value - trylevel = pRegistrationFrame->trylevel - - // Get a pointer to the scopetable array - scopeTable = pRegistrationFrame->scopetable; - -search_for_handler: - if ( pRegistrationFrame->trylevel != TRYLEVEL_NONE ) - { - if ( pRegistrationFrame->scopetable[trylevel].lpfnFilter ) - { - - PUSH EBP // Save this frame EBP - - // !!!Very Important!!! Switch to original EBP. This is - // what allows all locals in the frame to have the same - // value as before the exception occurred. - - EBP = &pRegistrationFrame->_ebp - - // Call the filter function - filterFuncRet = scopetable[trylevel].lpfnFilter(); - - POP EBP // Restore handler frame EBP - - if ( filterFuncRet != EXCEPTION_CONTINUE_SEARCH ) - { - if ( filterFuncRet < 0 ) // EXCEPTION_CONTINUE_EXECUTION - return ExceptionContinueExecution; - - // If we get here, EXCEPTION_EXECUTE_HANDLER was specified - scopetable == pRegistrationFrame->scopetable - - // Does the actual OS cleanup of registration frames - // Causes this function to recurse - __global_unwind2( pRegistrationFrame ); - - - // Once we get here, everything is all cleaned up, except - // for the last frame, where we'll continue execution - EBP = &pRegistrationFrame->_ebp - - __local_unwind2( pRegistrationFrame, trylevel ); - - // NLG == "non-local-goto" (setjmp/longjmp stuff) - __NLG_Notify( 1 ); // EAX == scopetable->lpfnHandler - - // Set the current trylevel to whatever SCOPETABLE entry - // was being used when a handler was found - pRegistrationFrame->trylevel = scopetable->previousTryLevel; - - // Call the _except {} block. Never returns. - pRegistrationFrame->scopetable[trylevel].lpfnHandler(); - } - } - - scopeTable = pRegistrationFrame->scopetable; - trylevel = scopeTable->previousTryLevel - - goto search_for_handler; - } - else // trylevel == TRYLEVEL_NONE - { - retvalue == DISPOSITION_CONTINUE_SEARCH; - } - } - else // EXCEPTION_UNWINDING or EXCEPTION_EXIT_UNWIND flags are set - { - PUSH EBP // Save EBP - - EBP = pRegistrationFrame->_ebp // Set EBP for __local_unwind2 - - __local_unwind2( pRegistrationFrame, TRYLEVEL_NONE ) - - POP EBP // Restore EBP - - retvalue == DISPOSITION_CONTINUE_SEARCH; - } -} - diff --git a/winsup/mingw/samples/seh/exutil.c b/winsup/mingw/samples/seh/exutil.c deleted file mode 100644 index 187242cd5..000000000 --- a/winsup/mingw/samples/seh/exutil.c +++ /dev/null @@ -1,68 +0,0 @@ - -#include <stdlib.h> -#include <stdio.h> -#include <excpt.h> -#include <windows.h> - -#include "exutil.h" - -void -WalkExceptionHandlers () -{ - PEXCEPTION_REGISTRATION_RECORD p; - int i; - - __asm__("movl %%fs:0,%%eax;movl %%eax,%0" : "=g" (p) : : "%eax"); - - i = 0; - while (p != (PEXCEPTION_REGISTRATION_RECORD) -1 && p) - { - printf ("Registration %d at %08x : ", i, p); - printf ("Handler = %08x ", p->handler); - printf ("Next Registration = %08x\n", p->prev); - p = p->prev; - i++; - } - printf ("End of exception handler list.\n"); - fflush (stdout); -} - -void -DumpExceptionRecord (struct _EXCEPTION_RECORD* pExRec) -{ - printf ("Exception: Code = %08x Flags %08x", pExRec->ExceptionCode, - pExRec->ExceptionFlags); - - if (pExRec->ExceptionFlags) - { - printf (" ( "); - if (pExRec->ExceptionFlags & EH_NONCONTINUABLE) - { - printf ("EH_NONCONTINUABLE "); - } - if (pExRec->ExceptionFlags & EH_UNWINDING) - { - printf ("EH_UNWINDING "); - } - if (pExRec->ExceptionFlags & EH_EXIT_UNWIND) - { - printf ("EH_EXIT_UNWIND "); - } - if (pExRec->ExceptionFlags & EH_STACK_INVALID) - { - printf ("EH_STACK_INVALID "); - } - if (pExRec->ExceptionFlags & EH_NESTED_CALL) - { - printf ("EH_NESTED_CALL "); - } - printf (")\n"); - } - else - { - printf ("\n"); - } - - fflush(stdout); -} - diff --git a/winsup/mingw/samples/seh/exutil.def b/winsup/mingw/samples/seh/exutil.def deleted file mode 100644 index a474be7e5..000000000 --- a/winsup/mingw/samples/seh/exutil.def +++ /dev/null @@ -1,3 +0,0 @@ -EXPORTS - WalkExceptionHandlers - DumpExceptionRecord diff --git a/winsup/mingw/samples/seh/exutil.h b/winsup/mingw/samples/seh/exutil.h deleted file mode 100644 index a56155b96..000000000 --- a/winsup/mingw/samples/seh/exutil.h +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Definitions of some internal stuff for exception handling, including - * a version of the all-important EXCEPTION_REGISTRATION_RECORD. - */ - -#ifndef _EXUTIL_H_ -#define _EXUTIL_H_ - -#include <windows.h> -#include <excpt.h> - -#ifdef __cplusplus -extern "C" { -#endif - -void WalkExceptionHandlers (); -void DumpExceptionRecord (struct _EXCEPTION_RECORD* pExRec); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/winsup/mingw/samples/seh/jamfile b/winsup/mingw/samples/seh/jamfile deleted file mode 100644 index 04d83c770..000000000 --- a/winsup/mingw/samples/seh/jamfile +++ /dev/null @@ -1,13 +0,0 @@ - -Dll exutil.dll : exutil.c ; - -ImportLib libexutil.a : exutil.def ; - -Main sehtest.exe : sehtest.c ; - -Main sehfix.exe : sehfix.c ; - -Main sehsub.exe : sehsub.c ; - -LinkLibraries sehtest.exe sehfix.exe sehsub.exe : libexutil.a ; - diff --git a/winsup/mingw/samples/seh/sehfix.c b/winsup/mingw/samples/seh/sehfix.c deleted file mode 100644 index be527ab0d..000000000 --- a/winsup/mingw/samples/seh/sehfix.c +++ /dev/null @@ -1,60 +0,0 @@ -/* - * sehfix.c - * - * A test program involving an exception handler that fixes the exception - * causing condition. - * - * In this code we install an exception handler my_handler and then a piece - * of inline assembly attempts to write at the address marked in eax, after - * setting eax to 10. This should produce an exception. The handler then - * changes the eax register of the exception context to be the address of - * a static variable and restarts the code. This should allow everything - * to continue. - */ - -#include <windows.h> -#include <excpt.h> - -#include "exutil.h" - -int x; - -EXCEPTION_DISPOSITION -my_handler ( - struct _EXCEPTION_RECORD* pExceptionRec, - void* pEstablisherFrame, - struct _CONTEXT* pContextRecord, - void* pDispatcherContext - ) -{ - printf ("In my exception handler!\n"); - DumpExceptionRecord (pExceptionRec); - pContextRecord->Eax = (DWORD) &x; - return ExceptionContinueExecution; -} - -main () -{ - x = 2; - - printf ("x = %d\n", x); - - WalkExceptionHandlers(); - - __try1(my_handler) - - WalkExceptionHandlers(); - - /* This assembly code should produce an exception. */ - __asm__("movl $10,%%eax;movl $1,(%%eax);" : : : "%eax"); - - __except1 - - WalkExceptionHandlers(); - - printf ("x = %d\n", x); - - printf ("Finished!\n"); -} - - diff --git a/winsup/mingw/samples/seh/sehsub.c b/winsup/mingw/samples/seh/sehsub.c deleted file mode 100644 index 466b2e8e4..000000000 --- a/winsup/mingw/samples/seh/sehsub.c +++ /dev/null @@ -1,43 +0,0 @@ -/* - * sehsub.c - * - * In an attempt to see what might be going on inside CRTDLL, this program - * walks the exception list after creating a new thread with _beginthread. - * - * It turns out that _beginthread DOES install an exception handler, as - * expected, but this handler is NOT exported by CRTDLL (it is certainly - * not _except_handler2 or _XcptFilter)... an odd and unpleasant turn of - * events. - */ - -#include <windows.h> -#include <excpt.h> -#include <process.h> - -#include "exutil.h" - -extern void* __imp__except_handler3; - -unsigned -my_thread (void * p) -{ - printf ("In my thread.\n"); - WalkExceptionHandlers(); - return 0; -} - -main () -{ - unsigned long h; - unsigned id; - printf ("In main.\n"); - WalkExceptionHandlers(); - - printf ("Except_handler3 %08x\n", __imp__except_handler3); - h = _beginthreadex (NULL, 0, my_thread, NULL, 0, &id); - - WaitForSingleObject ((HANDLE) h, INFINITE); - CloseHandle ((HANDLE) h); - return; -} - diff --git a/winsup/mingw/samples/seh/sehtest.c b/winsup/mingw/samples/seh/sehtest.c deleted file mode 100644 index f1c18d05e..000000000 --- a/winsup/mingw/samples/seh/sehtest.c +++ /dev/null @@ -1,72 +0,0 @@ -/* - * This file tests some of the basics of structured exception handling as - * implemented in excpt.h and the Windows API header files. - * - * The program installs two exception handlers, then attempts to write to - * a pointer to an invalid address. This causes an exception which passes - * through the exception handlers and on to the default system exception - * handler. That handler brings up the dialog box all Windows users know - * and love, and then the program is terminated. - * - * You might note that after the initial run up through our exception frames - * we get a second run up through them with the exception code - * STATUS_INVALID_DISPOSITION and the code EH_UNWINDING. This seems normal - * except that the code got changed from the previous STATUS_ACCESS_VIOLATION. - * I don't understand that bit particularly. - */ - -#include <stdio.h> -#include <excpt.h> - -#include "exutil.h" - -EXCEPTION_DISPOSITION -my_handler ( - struct _EXCEPTION_RECORD* pExceptionRec, - void* pEstablisherFrame, - struct _CONTEXT* pContextRecord, - void* pDispatcherContext - ) -{ - printf ("In my exception handler!\n"); - DumpExceptionRecord (pExceptionRec); - return ExceptionContinueSearch; -} - -EXCEPTION_DISPOSITION -my_handler2 ( - struct _EXCEPTION_RECORD* pExceptionRec, - void* pEstablisherFrame, - struct _CONTEXT* pContextRecord, - void* pDispatcherContext - ) -{ - printf ("In top exception handler!\n"); - DumpExceptionRecord (pExceptionRec); - return ExceptionContinueSearch; -} - -main () -{ - char* x; - - printf ("my_handler2 = %08x\n", my_handler2); - printf ("my_handler = %08x\n", my_handler); - - WalkExceptionHandlers(); - - __try1(my_handler2) - x = (char*) 10; - - WalkExceptionHandlers(); - - __try1(my_handler) - - WalkExceptionHandlers(); - - *x = 1; - __except1 - __except1 - printf ("Finished!\n"); -} - diff --git a/winsup/mingw/samples/simpledll/dll.c b/winsup/mingw/samples/simpledll/dll.c deleted file mode 100644 index c642af4d8..000000000 --- a/winsup/mingw/samples/simpledll/dll.c +++ /dev/null @@ -1,33 +0,0 @@ - -#include <windows.h> - -BOOL WINAPI -DllMain (HANDLE hDll, DWORD dwReason, LPVOID lpReserved) -{ - switch (dwReason) - { - case DLL_PROCESS_ATTACH: - printf ("DLL Attached.\n"); - break; - - case DLL_PROCESS_DETACH: - printf ("DLL Detached.\n"); - break; - - case DLL_THREAD_ATTACH: - printf ("DLL Thread Attached.\n"); - break; - - case DLL_THREAD_DETACH: - printf ("DLL Thread Detached.\n"); - break; - } - return TRUE; -} - -void -Test () -{ - printf ("Test Function called!\n"); -} - diff --git a/winsup/mingw/samples/simpledll/dll.cpp b/winsup/mingw/samples/simpledll/dll.cpp deleted file mode 100644 index cdf0dfb9f..000000000 --- a/winsup/mingw/samples/simpledll/dll.cpp +++ /dev/null @@ -1,44 +0,0 @@ -// -// This is a C++ version of the code in dll.c. NOTE that you need to put -// extern "C" { ... } around DllMain or it will not be called when your -// Dll starts up! (It will get name mangled as a C++ function and the C -// default version in libmingw32.a will get called instead.) -// - -#include <windows.h> - -#include <iostream> - -extern "C" { - -BOOL WINAPI -DllMain (HANDLE hDll, DWORD dwReason, LPVOID lpReserved) -{ - switch (dwReason) - { - case DLL_PROCESS_ATTACH: - cout << "Dll Attached" << endl ; - break; - - case DLL_PROCESS_DETACH: - cout << "Dll Detached" << endl ; - break; - - case DLL_THREAD_ATTACH: - printf ("DLL Thread Attached.\n"); - break; - - case DLL_THREAD_DETACH: - printf ("DLL Thread Detached.\n"); - break; - } - return TRUE; -} - -void -Test () -{ - printf ("Test Function called!\n"); -} - -}; diff --git a/winsup/mingw/samples/simpledll/dll.def b/winsup/mingw/samples/simpledll/dll.def deleted file mode 100644 index 3cabd50a5..000000000 --- a/winsup/mingw/samples/simpledll/dll.def +++ /dev/null @@ -1,2 +0,0 @@ -EXPORTS -Test diff --git a/winsup/mingw/samples/simpledll/exe.c b/winsup/mingw/samples/simpledll/exe.c deleted file mode 100644 index af5bb41df..000000000 --- a/winsup/mingw/samples/simpledll/exe.c +++ /dev/null @@ -1,13 +0,0 @@ -#include <stdio.h> - -extern void Test(); - -int main() -{ - printf ("Program started.\n"); - Test (); - printf ("Program ends.\n"); - - return 0; -} - diff --git a/winsup/mingw/samples/simpledll/jamfile b/winsup/mingw/samples/simpledll/jamfile deleted file mode 100644 index d1e2591be..000000000 --- a/winsup/mingw/samples/simpledll/jamfile +++ /dev/null @@ -1,14 +0,0 @@ - -Dll dll.dll : dll.c ; - -ImportLib libdll.a : dll.def ; - - -Main exe.exe : exe.c ; - -LinkLibraries exe.exe : libdll.a ; - -DEPENDS exe.exe : dll.dll ; - -LINKFLAGS on exe.exe = $(LINKFLAGS) -L. ; - diff --git a/winsup/mingw/samples/simpledll/makedll.bat b/winsup/mingw/samples/simpledll/makedll.bat deleted file mode 100644 index c7f9b2ae8..000000000 --- a/winsup/mingw/samples/simpledll/makedll.bat +++ /dev/null @@ -1,23 +0,0 @@ -rem *** Create the import library for the dll ***
-dlltool --dllname dll.dll --def dll.def --output-lib libdll.a
-
-rem *** Compile the dll ***
-gcc -c -o dll.o dll.c
-
-rem *** Link the dll ***
-gcc -s -mdll -o dll.dll -Wl,--base-file,dll.b dll.o
-dlltool --dllname dll.dll --base-file dll.b --output-exp dll.e --def dll.def
-gcc -s -mdll -o dll.dll -Wl,--base-file,dll.b dll.o -Wl,dll.e
-dlltool --dllname dll.dll --base-file dll.b --output-exp dll.e --def dll.def
-gcc -s -mdll -o dll.dll dll.o -Wl,dll.e
-
-rem *** Delete temporary files from dll linking ***
-del dll.b
-del dll.e
-
-rem *** Compile exe, which uses dll. ***
-gcc -c -o exe.o exe.c
-
-rem *** Link exe.exe, which uses dll.dll ***
-gcc -s -L. -o exe.exe exe.o libdll.a
-
diff --git a/winsup/mingw/samples/test/jamfile b/winsup/mingw/samples/test/jamfile deleted file mode 100644 index 2fc7b84af..000000000 --- a/winsup/mingw/samples/test/jamfile +++ /dev/null @@ -1,9 +0,0 @@ -# -# A very simple example with which you can test your compiler/jam setup. -# Also an interesting example of a hybrid console/GUI application. -# - -Main test.exe : test.c ; - -GuiLibs test.exe ; - diff --git a/winsup/mingw/samples/test/test.c b/winsup/mingw/samples/test/test.c deleted file mode 100644 index 82ca6b0fc..000000000 --- a/winsup/mingw/samples/test/test.c +++ /dev/null @@ -1,20 +0,0 @@ -/* - * This source code is in the PUBLIC DOMAIN and has NO WARRANTY. - * - * Colin Peters <colin@bird.fu.is.saga-u.ac.jp>, April 15, 1997. - */ - -#include <windows.h> -#include <stdio.h> - -int STDCALL -WinMain (HINSTANCE hInst, HINSTANCE hPrev, LPSTR lpCmd, int nShow) -{ - char text[80]; - - printf ("Enter message box text:"); - fgets(text, 80, stdin); - MessageBox (NULL, text, "Test", MB_OK); - printf ("\nHello after message box.\n"); - return 0; -} diff --git a/winsup/mingw/samples/wintest/jamfile b/winsup/mingw/samples/wintest/jamfile deleted file mode 100644 index b2f783118..000000000 --- a/winsup/mingw/samples/wintest/jamfile +++ /dev/null @@ -1,8 +0,0 @@ -# -# A example of Win32 GUI programming in C. -# - -Main test.exe : test.c ; - -Gui test.exe ; - diff --git a/winsup/mingw/samples/wintest/test.c b/winsup/mingw/samples/wintest/test.c deleted file mode 100644 index 056888ffc..000000000 --- a/winsup/mingw/samples/wintest/test.c +++ /dev/null @@ -1,212 +0,0 @@ -/* - * A basic example of Win32 programming in C. - * - * This source code is in the PUBLIC DOMAIN and has NO WARRANTY. - * - * Colin Peters <colin@bird.fu.is.saga-u.ac.jp> - */ - -#include <windows.h> -#include <string.h> - -/* - * This is the window function for the main window. Whenever a message is - * dispatched using DispatchMessage (or sent with SendMessage) this function - * gets called with the contents of the message. - */ -LRESULT CALLBACK -MainWndProc (HWND hwnd, UINT nMsg, WPARAM wParam, LPARAM lParam) -{ - /* The window handle for the "Click Me" button. */ - static HWND hwndButton = 0; - static int cx, cy; /* Height and width of our button. */ - - HDC hdc; /* A device context used for drawing */ - PAINTSTRUCT ps; /* Also used during window drawing */ - RECT rc; /* A rectangle used during drawing */ - - /* - * Perform processing based on what kind of message we got. - */ - switch (nMsg) - { - case WM_CREATE: - { - /* The window is being created. Create our button - * window now. */ - TEXTMETRIC tm; - - /* First we use the system fixed font size to choose - * a nice button size. */ - hdc = GetDC (hwnd); - SelectObject (hdc, GetStockObject (SYSTEM_FIXED_FONT)); - GetTextMetrics (hdc, &tm); - cx = tm.tmAveCharWidth * 30; - cy = (tm.tmHeight + tm.tmExternalLeading) * 2; - ReleaseDC (hwnd, hdc); - - /* Now create the button */ - hwndButton = CreateWindow ( - "button", /* Builtin button class */ - "Click Here", - WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON, - 0, 0, cx, cy, - hwnd, /* Parent is this window. */ - (HMENU) 1, /* Control ID: 1 */ - ((LPCREATESTRUCT) lParam)->hInstance, - NULL - ); - - return 0; - break; - } - - case WM_DESTROY: - /* The window is being destroyed, close the application - * (the child button gets destroyed automatically). */ - PostQuitMessage (0); - return 0; - break; - - case WM_PAINT: - /* The window needs to be painted (redrawn). */ - hdc = BeginPaint (hwnd, &ps); - GetClientRect (hwnd, &rc); - - /* Draw "Hello, World" in the middle of the upper - * half of the window. */ - rc.bottom = rc.bottom / 2; - DrawText (hdc, "Hello, World", -1, &rc, - DT_SINGLELINE | DT_CENTER | DT_VCENTER); - - EndPaint (hwnd, &ps); - return 0; - break; - - case WM_SIZE: - /* The window size is changing. If the button exists - * then place it in the center of the bottom half of - * the window. */ - if (hwndButton && - (wParam == SIZEFULLSCREEN || - wParam == SIZENORMAL) - ) - { - rc.left = (LOWORD(lParam) - cx) / 2; - rc.top = HIWORD(lParam) * 3 / 4 - cy / 2; - MoveWindow ( - hwndButton, - rc.left, rc.top, cx, cy, TRUE); - } - break; - - case WM_COMMAND: - /* Check the control ID, notification code and - * control handle to see if this is a button click - * message from our child button. */ - if (LOWORD(wParam) == 1 && - HIWORD(wParam) == BN_CLICKED && - (HWND) lParam == hwndButton) - { - /* Our button was clicked. Close the window. */ - DestroyWindow (hwnd); - } - return 0; - break; - } - - /* If we don't handle a message completely we hand it to the system - * provided default window function. */ - return DefWindowProc (hwnd, nMsg, wParam, lParam); -} - - -int STDCALL -WinMain (HINSTANCE hInst, HINSTANCE hPrev, LPSTR lpCmd, int nShow) -{ - HWND hwndMain; /* Handle for the main window. */ - MSG msg; /* A Win32 message structure. */ - WNDCLASSEX wndclass; /* A window class structure. */ - char* szMainWndClass = "WinTestWin"; - /* The name of the main window class */ - - /* - * First we create a window class for our main window. - */ - - /* Initialize the entire structure to zero. */ - memset (&wndclass, 0, sizeof(WNDCLASSEX)); - - /* This class is called WinTestWin */ - wndclass.lpszClassName = szMainWndClass; - - /* cbSize gives the size of the structure for extensibility. */ - wndclass.cbSize = sizeof(WNDCLASSEX); - - /* All windows of this class redraw when resized. */ - wndclass.style = CS_HREDRAW | CS_VREDRAW; - - /* All windows of this class use the MainWndProc window function. */ - wndclass.lpfnWndProc = MainWndProc; - - /* This class is used with the current program instance. */ - wndclass.hInstance = hInst; - - /* Use standard application icon and arrow cursor provided by the OS */ - wndclass.hIcon = LoadIcon (NULL, IDI_APPLICATION); - wndclass.hIconSm = LoadIcon (NULL, IDI_APPLICATION); - wndclass.hCursor = LoadCursor (NULL, IDC_ARROW); - - /* Color the background white */ - wndclass.hbrBackground = (HBRUSH) GetStockObject (WHITE_BRUSH); - - /* - * Now register the window class for use. - */ - RegisterClassEx (&wndclass); - - /* - * Create our main window using that window class. - */ - hwndMain = CreateWindow ( - szMainWndClass, /* Class name */ - "Hello", /* Caption */ - WS_OVERLAPPEDWINDOW, /* Style */ - CW_USEDEFAULT, /* Initial x (use default) */ - CW_USEDEFAULT, /* Initial y (use default) */ - CW_USEDEFAULT, /* Initial x size (use default) */ - CW_USEDEFAULT, /* Initial y size (use default) */ - NULL, /* No parent window */ - NULL, /* No menu */ - hInst, /* This program instance */ - NULL /* Creation parameters */ - ); - - /* - * Display the window which we just created (using the nShow - * passed by the OS, which allows for start minimized and that - * sort of thing). - */ - ShowWindow (hwndMain, nShow); - UpdateWindow (hwndMain); - - /* - * The main message loop. All messages being sent to the windows - * of the application (or at least the primary thread) are retrieved - * by the GetMessage call, then translated (mainly for keyboard - * messages) and dispatched to the appropriate window procedure. - * This is the simplest kind of message loop. More complex loops - * are required for idle processing or handling modeless dialog - * boxes. When one of the windows calls PostQuitMessage GetMessage - * will return zero and the wParam of the message will be filled - * with the argument to PostQuitMessage. The loop will end and - * the application will close. - */ - while (GetMessage (&msg, NULL, 0, 0)) - { - TranslateMessage (&msg); - DispatchMessage (&msg); - } - return msg.wParam; -} - diff --git a/winsup/mingw/strcasecmp.c b/winsup/mingw/strcasecmp.c deleted file mode 100644 index a238e22f2..000000000 --- a/winsup/mingw/strcasecmp.c +++ /dev/null @@ -1,21 +0,0 @@ -/* - * strcasecmp.c - * This file has no copyright assigned and is placed in the Public Domain. - * This file is a part of the mingw-runtime package. - * No warranty is given; refer to the file DISCLAIMER within the package. - * - * Oldnames from ANSI header string.h - * - * Some wrapper functions for those old name functions whose appropriate - * equivalents are not simply underscore prefixed. - * - */ - -#include <string.h> - -int -strcasecmp (const char *sz1, const char *sz2) -{ - return _stricmp (sz1, sz2); -} - diff --git a/winsup/mingw/strncasecmp.c b/winsup/mingw/strncasecmp.c deleted file mode 100644 index 7607ea1d0..000000000 --- a/winsup/mingw/strncasecmp.c +++ /dev/null @@ -1,21 +0,0 @@ -/* - * strncasecmp.c - * This file has no copyright assigned and is placed in the Public Domain. - * This file is a part of the mingw-runtime package. - * No warranty is given; refer to the file DISCLAIMER within the package. - * - * Oldnames from ANSI header string.h - * - * Some wrapper functions for those old name functions whose appropriate - * equivalents are not simply underscore prefixed. - * - */ - -#include <string.h> - -int -strncasecmp (const char *sz1, const char *sz2, size_t sizeMaxCompare) -{ - return _strnicmp (sz1, sz2, sizeMaxCompare); -} - diff --git a/winsup/mingw/test_headers.c b/winsup/mingw/test_headers.c deleted file mode 100644 index 62402a6f0..000000000 --- a/winsup/mingw/test_headers.c +++ /dev/null @@ -1,54 +0,0 @@ -#include <_mingw.h> -#include <assert.h> -#include <conio.h> -#include <ctype.h> -#include <dir.h> -#include <direct.h> -#include <dirent.h> -#include <dos.h> -#include <errno.h> -#include <excpt.h> -#include <fcntl.h> -#include <fenv.h> -#include <float.h> -#include <inttypes.h> -#include <io.h> -#include <limits.h> -#include <locale.h> -#include <malloc.h> -#include <math.h> -#include <mbctype.h> -#include <mbstring.h> -#include <mem.h> -#include <memory.h> -#include <process.h> -#include <search.h> -#include <setjmp.h> -#include <share.h> -#include <signal.h> -#include <stdarg.h> -#include <stddef.h> -#include <stdint.h> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <strings.h> -#include <tchar.h> -#include <time.h> -#include <unistd.h> -#include <values.h> -#include <wchar.h> -#include <wctype.h> -#include <sys/fcntl.h> -#include <sys/file.h> -#include <sys/locking.h> -#include <sys/param.h> -#include <sys/stat.h> -#include <sys/time.h> -#include <sys/timeb.h> -#include <sys/types.h> -#include <sys/unistd.h> -#include <sys/utime.h> - -int main() -{return 0;} diff --git a/winsup/mingw/toascii.c b/winsup/mingw/toascii.c deleted file mode 100644 index be9f2f50b..000000000 --- a/winsup/mingw/toascii.c +++ /dev/null @@ -1,22 +0,0 @@ -/* - * toascii.c - * This file has no copyright assigned and is placed in the Public Domain. - * This file is a part of the mingw-runtime package. - * No warranty is given; refer to the file DISCLAIMER within the package. - * - * Oldnames from ANSI header ctype.h - * - * Some wrapper functions for those old name functions whose appropriate - * equivalents are not simply underscore prefixed. - * - */ - -#include <ctype.h> - - -int -toascii (int c) -{ - return __toascii(c); -} - diff --git a/winsup/mingw/txtmode.c b/winsup/mingw/txtmode.c deleted file mode 100644 index 077174697..000000000 --- a/winsup/mingw/txtmode.c +++ /dev/null @@ -1,7 +0,0 @@ -#include <fcntl.h> - -/* Set default file mode to text */ - -/* Is this correct? Default value of _fmode in msvcrt.dll is 0. */ - -int _fmode = _O_TEXT; diff --git a/winsup/mingw/wcscmpi.c b/winsup/mingw/wcscmpi.c deleted file mode 100644 index 497964b39..000000000 --- a/winsup/mingw/wcscmpi.c +++ /dev/null @@ -1,21 +0,0 @@ -/* - * wcscmpi.c - * This file has no copyright assigned and is placed in the Public Domain. - * This file is a part of the mingw-runtime package. - * No warranty is given; refer to the file DISCLAIMER within the package. - * - * Oldnames from ANSI header string.h - * - * Some wrapper functions for those old name functions whose appropriate - * equivalents are not simply underscore prefixed. - * - */ - -#include <string.h> - -int -wcscmpi (const wchar_t * ws1, const wchar_t * ws2) -{ - return _wcsicmp (ws1, ws2); -} - |