summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Coghlan <ncoghlan@gmail.com>2017-02-09 16:09:03 +0100
committerNick Coghlan <ncoghlan@gmail.com>2017-02-09 16:09:03 +0100
commit2a1d833d5da7fa7a01a2eef183b0a208ed019427 (patch)
tree8da3ebb695ae55c69d0a58691403fb13d96a9476
parentc6180bb73c8c7c7f9d8ea9816487b710597b6fc1 (diff)
parentbbd3587a29510bd5a318e0a19fc8570c0cd3b622 (diff)
downloadcpython-2a1d833d5da7fa7a01a2eef183b0a208ed019427.tar.gz
Merge issue #26355 fix from 3.6
-rw-r--r--.gitignore4
-rw-r--r--.hgignore7
-rw-r--r--Doc/c-api/init.rst40
-rw-r--r--Doc/c-api/object.rst73
-rw-r--r--Doc/c-api/slice.rst37
-rw-r--r--Doc/c-api/typeobj.rst10
-rw-r--r--Doc/c-api/unicode.rst13
-rw-r--r--Doc/extending/newtypes.rst10
-rw-r--r--Doc/library/dis.rst22
-rw-r--r--Doc/library/http.cookies.rst18
-rw-r--r--Doc/library/io.rst21
-rw-r--r--Doc/library/logging.rst10
-rw-r--r--Doc/library/os.path.rst13
-rw-r--r--Doc/library/re.rst6
-rw-r--r--Doc/library/socket.rst12
-rw-r--r--Doc/library/stdtypes.rst12
-rw-r--r--Doc/library/string.rst6
-rw-r--r--Doc/library/struct.rst27
-rw-r--r--Doc/library/subprocess.rst6
-rw-r--r--Doc/library/sys.rst9
-rw-r--r--Doc/library/tarfile.rst11
-rw-r--r--Doc/library/time.rst9
-rw-r--r--Doc/library/timeit.rst35
-rw-r--r--Doc/library/types.rst23
-rw-r--r--Doc/library/unittest.mock.rst5
-rw-r--r--Doc/library/zipfile.rst4
-rw-r--r--Doc/tools/extensions/patchlevel.py5
-rw-r--r--Doc/tools/susp-ignored.csv3
-rw-r--r--Doc/tools/templates/indexsidebar.html2
-rw-r--r--Doc/tutorial/interpreter.rst8
-rw-r--r--Doc/tutorial/stdlib.rst2
-rw-r--r--Doc/tutorial/stdlib2.rst2
-rw-r--r--Doc/whatsnew/3.7.rst190
-rw-r--r--Doc/whatsnew/index.rst1
-rw-r--r--Include/abstract.h1745
-rw-r--r--Include/ceval.h17
-rw-r--r--Include/code.h7
-rw-r--r--Include/descrobject.h11
-rw-r--r--Include/dictobject.h2
-rw-r--r--Include/frameobject.h6
-rw-r--r--Include/longobject.h2
-rw-r--r--Include/methodobject.h14
-rw-r--r--Include/modsupport.h55
-rw-r--r--Include/moduleobject.h2
-rw-r--r--Include/odictobject.h2
-rw-r--r--Include/opcode.h2
-rw-r--r--Include/patchlevel.h6
-rw-r--r--Include/py_curses.h9
-rw-r--r--Include/pyerrors.h10
-rw-r--r--Include/pyport.h40
-rw-r--r--Include/sliceobject.h2
-rw-r--r--Include/structmember.h4
-rw-r--r--Include/structseq.h8
-rw-r--r--Include/unicodeobject.h72
-rw-r--r--Lib/_bootlocale.py16
-rw-r--r--Lib/_pyio.py18
-rw-r--r--Lib/asyncio/base_events.py1
-rw-r--r--Lib/bisect.py8
-rw-r--r--Lib/calendar.py4
-rw-r--r--Lib/collections/__init__.py19
-rw-r--r--Lib/csv.py4
-rw-r--r--Lib/ctypes/util.py4
-rw-r--r--Lib/dbm/dumb.py9
-rw-r--r--Lib/distutils/cmd.py31
-rw-r--r--Lib/distutils/command/build_ext.py7
-rw-r--r--Lib/distutils/command/sdist.py55
-rw-r--r--Lib/email/_encoded_words.py2
-rw-r--r--Lib/http/client.py10
-rw-r--r--Lib/http/cookies.py30
-rw-r--r--Lib/http/server.py33
-rw-r--r--Lib/idlelib/idle_test/test_macosx.py1
-rw-r--r--Lib/idlelib/idle_test/test_tree.py1
-rw-r--r--Lib/idlelib/macosx.py1
-rw-r--r--Lib/idlelib/stackviewer.py1
-rw-r--r--Lib/importlib/_bootstrap_external.py3
-rw-r--r--Lib/lib2to3/pytree.py1
-rw-r--r--Lib/lib2to3/tests/__init__.py1
-rw-r--r--Lib/locale.py24
-rw-r--r--Lib/logging/__init__.py2
-rw-r--r--Lib/logging/config.py32
-rw-r--r--Lib/macurl2path.py77
-rw-r--r--Lib/modulefinder.py1
-rw-r--r--Lib/ntpath.py24
-rw-r--r--Lib/opcode.py3
-rw-r--r--Lib/pickle.py17
-rw-r--r--Lib/pydoc.py32
-rw-r--r--Lib/pydoc_data/topics.py55
-rw-r--r--Lib/socketserver.py1
-rw-r--r--Lib/sre_compile.py2
-rw-r--r--Lib/sre_parse.py4
-rw-r--r--Lib/string.py10
-rw-r--r--Lib/subprocess.py29
-rwxr-xr-xLib/tarfile.py16
-rw-r--r--Lib/test/libregrtest/main.py17
-rw-r--r--Lib/test/libregrtest/refleak.py2
-rw-r--r--Lib/test/libregrtest/runtest_mp.py9
-rw-r--r--Lib/test/multibytecodec_support.py2
-rwxr-xr-xLib/test/pystone.py277
-rw-r--r--Lib/test/support/__init__.py19
-rw-r--r--Lib/test/support/script_helper.py3
-rw-r--r--Lib/test/test_asyncgen.py1
-rw-r--r--Lib/test/test_asyncio/test_tasks.py1
-rw-r--r--Lib/test/test_asyncio/test_unix_events.py1
-rw-r--r--Lib/test/test_bytes.py8
-rw-r--r--Lib/test/test_bz2.py1
-rw-r--r--Lib/test/test_calendar.py4
-rw-r--r--Lib/test/test_capi.py2
-rw-r--r--Lib/test/test_cmd.py1
-rw-r--r--Lib/test/test_cmd_line.py1
-rw-r--r--Lib/test/test_collections.py3
-rw-r--r--Lib/test/test_compile.py11
-rw-r--r--Lib/test/test_configparser.py1
-rw-r--r--Lib/test/test_dbm_dumb.py15
-rw-r--r--Lib/test/test_decimal.py2
-rw-r--r--Lib/test/test_dis.py1
-rw-r--r--Lib/test/test_enum.py4
-rw-r--r--Lib/test/test_epoll.py2
-rw-r--r--Lib/test/test_exceptions.py14
-rw-r--r--Lib/test/test_faulthandler.py3
-rw-r--r--Lib/test/test_frame.py2
-rw-r--r--Lib/test/test_functools.py45
-rw-r--r--Lib/test/test_gdb.py22
-rw-r--r--Lib/test/test_http_cookies.py22
-rw-r--r--Lib/test/test_httpservers.py10
-rw-r--r--Lib/test/test_import/__init__.py1
-rw-r--r--Lib/test/test_importlib/abc.py1
-rw-r--r--Lib/test/test_importlib/test_abc.py2
-rw-r--r--Lib/test/test_inspect.py3
-rw-r--r--Lib/test/test_io.py16
-rw-r--r--Lib/test/test_keywordonlyarg.py24
-rw-r--r--Lib/test/test_logging.py11
-rw-r--r--Lib/test/test_macurl2path.py31
-rw-r--r--Lib/test/test_memoryio.py6
-rw-r--r--Lib/test/test_ntpath.py25
-rw-r--r--Lib/test/test_os.py1
-rw-r--r--Lib/test/test_peepholer.py3
-rw-r--r--Lib/test/test_raise.py1
-rw-r--r--Lib/test/test_random.py6
-rw-r--r--Lib/test/test_range.py37
-rw-r--r--Lib/test/test_re.py7
-rw-r--r--Lib/test/test_regrtest.py21
-rw-r--r--Lib/test/test_set.py1
-rw-r--r--Lib/test/test_shutil.py1
-rw-r--r--Lib/test/test_signal.py4
-rw-r--r--Lib/test/test_socket.py42
-rw-r--r--Lib/test/test_ssl.py1
-rw-r--r--Lib/test/test_string.py5
-rw-r--r--Lib/test/test_struct.py6
-rw-r--r--Lib/test/test_subclassinit.py1
-rw-r--r--Lib/test/test_subprocess.py13
-rw-r--r--Lib/test/test_super.py1
-rw-r--r--Lib/test/test_support.py23
-rw-r--r--Lib/test/test_syntax.py157
-rw-r--r--Lib/test/test_sys.py9
-rw-r--r--Lib/test/test_sysconfig.py8
-rw-r--r--Lib/test/test_tarfile.py27
-rw-r--r--Lib/test/test_timeit.py115
-rw-r--r--Lib/test/test_types.py18
-rw-r--r--Lib/test/test_unicode.py34
-rw-r--r--Lib/test/test_unicode_identifiers.py1
-rw-r--r--Lib/test/test_winsound.py2
-rw-r--r--Lib/test/test_yield_from.py3
-rw-r--r--Lib/test/test_zipfile.py58
-rw-r--r--Lib/timeit.py110
-rw-r--r--Lib/types.py4
-rw-r--r--Lib/unittest/mock.py32
-rw-r--r--Lib/unittest/test/testmock/testsentinel.py13
-rw-r--r--Lib/urllib/parse.py2
-rw-r--r--Lib/urllib/request.py1
-rw-r--r--Lib/zipfile.py78
-rw-r--r--Makefile.pre.in32
-rw-r--r--Misc/ACKS5
-rw-r--r--Misc/NEWS783
-rw-r--r--Misc/SpecialBuilds.txt11
-rw-r--r--Modules/_asynciomodule.c37
-rw-r--r--Modules/_bisectmodule.c7
-rw-r--r--Modules/_blake2/blake2b_impl.c3
-rw-r--r--Modules/_blake2/blake2s_impl.c3
-rw-r--r--Modules/_collectionsmodule.c43
-rw-r--r--Modules/_csv.c26
-rw-r--r--Modules/_ctypes/_ctypes.c46
-rw-r--r--Modules/_ctypes/_ctypes_test.c6
-rw-r--r--Modules/_ctypes/callbacks.c4
-rw-r--r--Modules/_ctypes/callproc.c46
-rw-r--r--Modules/_ctypes/cfield.c17
-rw-r--r--Modules/_ctypes/libffi.diff209
-rw-r--r--Modules/_ctypes/libffi/ChangeLog5105
-rw-r--r--Modules/_ctypes/libffi/ChangeLog.libffi584
-rw-r--r--Modules/_ctypes/libffi/ChangeLog.libffi-3.16000
-rw-r--r--Modules/_ctypes/libffi/ChangeLog.libgcj40
-rw-r--r--Modules/_ctypes/libffi/ChangeLog.v1764
-rw-r--r--Modules/_ctypes/libffi/LICENSE21
-rw-r--r--Modules/_ctypes/libffi/Makefile.am254
-rw-r--r--Modules/_ctypes/libffi/Makefile.in2156
-rw-r--r--Modules/_ctypes/libffi/README428
-rw-r--r--Modules/_ctypes/libffi/acinclude.m492
-rw-r--r--Modules/_ctypes/libffi/aclocal.m41961
-rwxr-xr-xModules/_ctypes/libffi/compile347
-rwxr-xr-xModules/_ctypes/libffi/config.guess1558
-rwxr-xr-xModules/_ctypes/libffi/config.sub1788
-rwxr-xr-xModules/_ctypes/libffi/configure21691
-rw-r--r--Modules/_ctypes/libffi/configure.ac630
-rwxr-xr-xModules/_ctypes/libffi/depcomp791
-rw-r--r--Modules/_ctypes/libffi/doc/libffi.info618
-rw-r--r--Modules/_ctypes/libffi/doc/libffi.texi625
-rw-r--r--Modules/_ctypes/libffi/doc/stamp-vti4
-rw-r--r--Modules/_ctypes/libffi/doc/version.texi4
-rw-r--r--Modules/_ctypes/libffi/fficonfig.h.in210
-rw-r--r--Modules/_ctypes/libffi/fficonfig.py.in35
-rw-r--r--Modules/_ctypes/libffi/generate-darwin-source-and-headers.py209
-rw-r--r--Modules/_ctypes/libffi/include/Makefile.am9
-rw-r--r--Modules/_ctypes/libffi/include/Makefile.in587
-rw-r--r--Modules/_ctypes/libffi/include/ffi.h.in476
-rw-r--r--Modules/_ctypes/libffi/include/ffi_common.h132
-rwxr-xr-xModules/_ctypes/libffi/install-sh527
-rw-r--r--Modules/_ctypes/libffi/libffi.pc.in11
-rw-r--r--Modules/_ctypes/libffi/libffi.xcodeproj/project.pbxproj637
-rw-r--r--Modules/_ctypes/libffi/libtool-ldflags106
-rw-r--r--Modules/_ctypes/libffi/libtool-version29
-rw-r--r--Modules/_ctypes/libffi/ltmain.sh10932
-rw-r--r--Modules/_ctypes/libffi/m4/asmcfi.m413
-rw-r--r--Modules/_ctypes/libffi/m4/ax_append_flag.m469
-rw-r--r--Modules/_ctypes/libffi/m4/ax_cc_maxopt.m4181
-rw-r--r--Modules/_ctypes/libffi/m4/ax_cflags_warn_all.m4122
-rw-r--r--Modules/_ctypes/libffi/m4/ax_check_compile_flag.m472
-rw-r--r--Modules/_ctypes/libffi/m4/ax_compiler_vendor.m484
-rw-r--r--Modules/_ctypes/libffi/m4/ax_configure_args.m470
-rw-r--r--Modules/_ctypes/libffi/m4/ax_enable_builddir.m4300
-rw-r--r--Modules/_ctypes/libffi/m4/ax_gcc_archflag.m4225
-rw-r--r--Modules/_ctypes/libffi/m4/ax_gcc_x86_cpuid.m479
-rw-r--r--Modules/_ctypes/libffi/m4/libtool.m47989
-rw-r--r--Modules/_ctypes/libffi/m4/ltoptions.m4382
-rw-r--r--Modules/_ctypes/libffi/m4/ltsugar.m4124
-rw-r--r--Modules/_ctypes/libffi/m4/ltversion.m423
-rw-r--r--Modules/_ctypes/libffi/m4/lt~obsolete.m499
-rw-r--r--Modules/_ctypes/libffi/man/Makefile.am8
-rw-r--r--Modules/_ctypes/libffi/man/Makefile.in541
-rw-r--r--Modules/_ctypes/libffi/man/ffi.341
-rw-r--r--Modules/_ctypes/libffi/man/ffi_call.3103
-rw-r--r--Modules/_ctypes/libffi/man/ffi_prep_cif.368
-rw-r--r--Modules/_ctypes/libffi/man/ffi_prep_cif_var.373
-rwxr-xr-xModules/_ctypes/libffi/mdate-sh224
-rwxr-xr-xModules/_ctypes/libffi/missing215
-rwxr-xr-xModules/_ctypes/libffi/msvcc.sh233
-rw-r--r--Modules/_ctypes/libffi/src/aarch64/ffi.c1168
-rw-r--r--Modules/_ctypes/libffi/src/aarch64/ffitarget.h63
-rw-r--r--Modules/_ctypes/libffi/src/aarch64/sysv.S333
-rw-r--r--Modules/_ctypes/libffi/src/alpha/ffi.c288
-rw-r--r--Modules/_ctypes/libffi/src/alpha/ffitarget.h53
-rw-r--r--Modules/_ctypes/libffi/src/alpha/osf.S387
-rw-r--r--Modules/_ctypes/libffi/src/arc/arcompact.S135
-rw-r--r--Modules/_ctypes/libffi/src/arc/ffi.c268
-rw-r--r--Modules/_ctypes/libffi/src/arc/ffitarget.h53
-rw-r--r--Modules/_ctypes/libffi/src/arm/ffi.c931
-rw-r--r--Modules/_ctypes/libffi/src/arm/ffitarget.h71
-rwxr-xr-xModules/_ctypes/libffi/src/arm/gentramp.sh118
-rw-r--r--Modules/_ctypes/libffi/src/arm/sysv.S491
-rw-r--r--Modules/_ctypes/libffi/src/arm/trampoline.S4450
-rw-r--r--Modules/_ctypes/libffi/src/avr32/ffi.c423
-rw-r--r--Modules/_ctypes/libffi/src/avr32/ffitarget.h55
-rw-r--r--Modules/_ctypes/libffi/src/avr32/sysv.S208
-rw-r--r--Modules/_ctypes/libffi/src/bfin/ffi.c196
-rw-r--r--Modules/_ctypes/libffi/src/bfin/ffitarget.h43
-rw-r--r--Modules/_ctypes/libffi/src/bfin/sysv.S179
-rw-r--r--Modules/_ctypes/libffi/src/closures.c660
-rw-r--r--Modules/_ctypes/libffi/src/cris/ffi.c386
-rw-r--r--Modules/_ctypes/libffi/src/cris/ffitarget.h56
-rw-r--r--Modules/_ctypes/libffi/src/cris/sysv.S215
-rw-r--r--Modules/_ctypes/libffi/src/debug.c59
-rw-r--r--Modules/_ctypes/libffi/src/dlmalloc.c5166
-rw-r--r--Modules/_ctypes/libffi/src/frv/eabi.S128
-rw-r--r--Modules/_ctypes/libffi/src/frv/ffi.c292
-rw-r--r--Modules/_ctypes/libffi/src/frv/ffitarget.h62
-rw-r--r--Modules/_ctypes/libffi/src/ia64/ffi.c586
-rw-r--r--Modules/_ctypes/libffi/src/ia64/ffitarget.h55
-rw-r--r--Modules/_ctypes/libffi/src/ia64/ia64_flags.h40
-rw-r--r--Modules/_ctypes/libffi/src/ia64/unix.S560
-rw-r--r--Modules/_ctypes/libffi/src/java_raw_api.c356
-rw-r--r--Modules/_ctypes/libffi/src/m32r/ffi.c232
-rw-r--r--Modules/_ctypes/libffi/src/m32r/ffitarget.h53
-rw-r--r--Modules/_ctypes/libffi/src/m32r/sysv.S121
-rw-r--r--Modules/_ctypes/libffi/src/m68k/ffi.c362
-rw-r--r--Modules/_ctypes/libffi/src/m68k/ffitarget.h54
-rw-r--r--Modules/_ctypes/libffi/src/m68k/sysv.S330
-rw-r--r--Modules/_ctypes/libffi/src/m88k/ffi.c400
-rw-r--r--Modules/_ctypes/libffi/src/m88k/ffitarget.h49
-rw-r--r--Modules/_ctypes/libffi/src/m88k/obsd.S209
-rw-r--r--Modules/_ctypes/libffi/src/metag/ffi.c330
-rw-r--r--Modules/_ctypes/libffi/src/metag/ffitarget.h53
-rw-r--r--Modules/_ctypes/libffi/src/metag/sysv.S311
-rw-r--r--Modules/_ctypes/libffi/src/microblaze/ffi.c321
-rw-r--r--Modules/_ctypes/libffi/src/microblaze/ffitarget.h53
-rw-r--r--Modules/_ctypes/libffi/src/microblaze/sysv.S302
-rw-r--r--Modules/_ctypes/libffi/src/mips/ffi.c1050
-rw-r--r--Modules/_ctypes/libffi/src/mips/ffitarget.h247
-rw-r--r--Modules/_ctypes/libffi/src/mips/n32.S576
-rw-r--r--Modules/_ctypes/libffi/src/mips/o32.S381
-rw-r--r--Modules/_ctypes/libffi/src/moxie/eabi.S101
-rw-r--r--Modules/_ctypes/libffi/src/moxie/ffi.c272
-rw-r--r--Modules/_ctypes/libffi/src/moxie/ffitarget.h52
-rw-r--r--Modules/_ctypes/libffi/src/nios2/ffi.c304
-rw-r--r--Modules/_ctypes/libffi/src/nios2/ffitarget.h52
-rw-r--r--Modules/_ctypes/libffi/src/nios2/sysv.S136
-rw-r--r--Modules/_ctypes/libffi/src/pa/ffi.c719
-rw-r--r--Modules/_ctypes/libffi/src/pa/ffitarget.h83
-rw-r--r--Modules/_ctypes/libffi/src/pa/hpux32.S368
-rw-r--r--Modules/_ctypes/libffi/src/pa/linux.S357
-rw-r--r--Modules/_ctypes/libffi/src/powerpc/aix.S328
-rw-r--r--Modules/_ctypes/libffi/src/powerpc/aix_closure.S447
-rw-r--r--Modules/_ctypes/libffi/src/powerpc/asm.h125
-rw-r--r--Modules/_ctypes/libffi/src/powerpc/darwin.S378
-rw-r--r--Modules/_ctypes/libffi/src/powerpc/darwin_closure.S571
-rw-r--r--Modules/_ctypes/libffi/src/powerpc/ffi.c141
-rw-r--r--Modules/_ctypes/libffi/src/powerpc/ffi_darwin.c1359
-rw-r--r--Modules/_ctypes/libffi/src/powerpc/ffi_linux64.c943
-rw-r--r--Modules/_ctypes/libffi/src/powerpc/ffi_powerpc.h77
-rw-r--r--Modules/_ctypes/libffi/src/powerpc/ffi_sysv.c931
-rw-r--r--Modules/_ctypes/libffi/src/powerpc/ffitarget.h183
-rw-r--r--Modules/_ctypes/libffi/src/powerpc/linux64.S260
-rw-r--r--Modules/_ctypes/libffi/src/powerpc/linux64_closure.S391
-rw-r--r--Modules/_ctypes/libffi/src/powerpc/ppc_closure.S384
-rw-r--r--Modules/_ctypes/libffi/src/powerpc/sysv.S220
-rw-r--r--Modules/_ctypes/libffi/src/prep_cif.c245
-rw-r--r--Modules/_ctypes/libffi/src/raw_api.c254
-rw-r--r--Modules/_ctypes/libffi/src/s390/ffi.c781
-rw-r--r--Modules/_ctypes/libffi/src/s390/ffitarget.h67
-rw-r--r--Modules/_ctypes/libffi/src/s390/sysv.S434
-rw-r--r--Modules/_ctypes/libffi/src/sh/ffi.c717
-rw-r--r--Modules/_ctypes/libffi/src/sh/ffitarget.h54
-rw-r--r--Modules/_ctypes/libffi/src/sh/sysv.S850
-rw-r--r--Modules/_ctypes/libffi/src/sh64/ffi.c469
-rw-r--r--Modules/_ctypes/libffi/src/sh64/ffitarget.h58
-rw-r--r--Modules/_ctypes/libffi/src/sh64/sysv.S539
-rw-r--r--Modules/_ctypes/libffi/src/sparc/ffi.c681
-rw-r--r--Modules/_ctypes/libffi/src/sparc/ffitarget.h73
-rw-r--r--Modules/_ctypes/libffi/src/sparc/v8.S346
-rw-r--r--Modules/_ctypes/libffi/src/sparc/v9.S307
-rw-r--r--Modules/_ctypes/libffi/src/tile/ffi.c355
-rw-r--r--Modules/_ctypes/libffi/src/tile/ffitarget.h65
-rw-r--r--Modules/_ctypes/libffi/src/tile/tile.S360
-rw-r--r--Modules/_ctypes/libffi/src/types.c92
-rw-r--r--Modules/_ctypes/libffi/src/vax/elfbsd.S195
-rw-r--r--Modules/_ctypes/libffi/src/vax/ffi.c276
-rw-r--r--Modules/_ctypes/libffi/src/vax/ffitarget.h49
-rw-r--r--Modules/_ctypes/libffi/src/x86/darwin.S444
-rw-r--r--Modules/_ctypes/libffi/src/x86/darwin64.S416
-rw-r--r--Modules/_ctypes/libffi/src/x86/ffi.c867
-rw-r--r--Modules/_ctypes/libffi/src/x86/ffi64.c676
-rw-r--r--Modules/_ctypes/libffi/src/x86/ffitarget.h143
-rw-r--r--Modules/_ctypes/libffi/src/x86/freebsd.S463
-rw-r--r--Modules/_ctypes/libffi/src/x86/sysv.S483
-rw-r--r--Modules/_ctypes/libffi/src/x86/unix64.S432
-rw-r--r--Modules/_ctypes/libffi/src/x86/win32.S1306
-rw-r--r--Modules/_ctypes/libffi/src/x86/win64.S468
-rw-r--r--Modules/_ctypes/libffi/src/xtensa/ffi.c298
-rw-r--r--Modules/_ctypes/libffi/src/xtensa/ffitarget.h53
-rw-r--r--Modules/_ctypes/libffi/src/xtensa/sysv.S253
-rw-r--r--Modules/_ctypes/libffi/testsuite/Makefile.am85
-rw-r--r--Modules/_ctypes/libffi/testsuite/Makefile.in590
-rw-r--r--Modules/_ctypes/libffi/testsuite/config/default.exp1
-rw-r--r--Modules/_ctypes/libffi/testsuite/lib/libffi.exp413
-rw-r--r--Modules/_ctypes/libffi/testsuite/lib/target-libpath.exp283
-rw-r--r--Modules/_ctypes/libffi/testsuite/lib/wrapper.exp45
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/call.exp28
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/closure_fn0.c89
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/closure_fn1.c81
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/closure_fn2.c81
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/closure_fn3.c82
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/closure_fn4.c89
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/closure_fn5.c92
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/closure_fn6.c90
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/closure_loc_fn0.c95
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/closure_simple.c55
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/cls_12byte.c94
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/cls_16byte.c95
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/cls_18byte.c96
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/cls_19byte.c102
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/cls_1_1byte.c89
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/cls_20byte.c91
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/cls_20byte1.c93
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/cls_24byte.c113
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/cls_2byte.c90
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/cls_3_1byte.c95
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/cls_3byte1.c90
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/cls_3byte2.c90
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/cls_4_1byte.c98
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/cls_4byte.c90
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/cls_5_1_byte.c109
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/cls_5byte.c98
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/cls_64byte.c124
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/cls_6_1_byte.c113
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/cls_6byte.c99
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/cls_7_1_byte.c117
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/cls_7byte.c97
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/cls_8byte.c88
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/cls_9byte1.c90
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/cls_9byte2.c91
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/cls_align_double.c93
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/cls_align_float.c91
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/cls_align_longdouble.c92
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/cls_align_longdouble_split.c134
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/cls_align_longdouble_split2.c117
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/cls_align_pointer.c95
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/cls_align_sint16.c91
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/cls_align_sint32.c91
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/cls_align_sint64.c92
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/cls_align_uint16.c91
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/cls_align_uint32.c91
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/cls_align_uint64.c93
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/cls_dbls_struct.c66
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/cls_double.c43
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/cls_double_va.c61
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/cls_float.c42
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/cls_longdouble.c107
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/cls_longdouble_va.c61
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/cls_multi_schar.c74
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/cls_multi_sshort.c74
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/cls_multi_sshortchar.c86
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/cls_multi_uchar.c91
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/cls_multi_ushort.c74
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/cls_multi_ushortchar.c86
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/cls_pointer.c74
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/cls_pointer_stack.c142
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/cls_schar.c44
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/cls_sint.c42
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/cls_sshort.c42
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/cls_struct_va1.c114
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/cls_uchar.c42
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/cls_uchar_va.c44
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/cls_uint.c43
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/cls_uint_va.c45
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/cls_ulong_va.c45
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/cls_ulonglong.c47
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/cls_ushort.c43
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/cls_ushort_va.c44
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/err_bad_abi.c36
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/err_bad_typedef.c26
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/ffitest.h135
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/float.c59
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/float1.c58
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/float2.c58
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/float3.c72
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/float4.c62
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/float_va.c107
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/huge_struct.c343
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/many.c59
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/many2.c57
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/negint.c52
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/nested_struct.c152
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/nested_struct1.c161
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/nested_struct10.c133
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/nested_struct11.c121
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/nested_struct2.c110
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/nested_struct3.c111
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/nested_struct4.c111
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/nested_struct5.c112
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/nested_struct6.c131
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/nested_struct7.c111
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/nested_struct8.c131
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/nested_struct9.c131
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/problem1.c90
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/promotion.c59
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/pyobjc-tc.c114
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/return_dbl.c36
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/return_dbl1.c43
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/return_dbl2.c42
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/return_fl.c35
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/return_fl1.c36
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/return_fl2.c49
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/return_fl3.c42
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/return_ldl.c34
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/return_ll.c41
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/return_ll1.c43
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/return_sc.c36
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/return_sl.c38
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/return_uc.c38
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/return_ul.c38
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/stret_large.c145
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/stret_large2.c148
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/stret_medium.c124
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/stret_medium2.c125
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/strlen.c44
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/strlen2.c49
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/strlen3.c49
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/strlen4.c55
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/struct1.c67
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/struct2.c67
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/struct3.c60
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/struct4.c64
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/struct5.c66
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/struct6.c64
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/struct7.c74
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/struct8.c81
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/struct9.c68
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/testclosure.c70
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/uninitialized.c61
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/unwindtest.cc117
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/unwindtest_ffi_call.cc54
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/va_1.c196
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/va_struct1.c121
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/va_struct2.c123
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/va_struct3.c125
-rw-r--r--Modules/_ctypes/libffi/texinfo.tex10079
-rw-r--r--Modules/_ctypes/stgdict.c6
-rw-r--r--Modules/_curses_panel.c25
-rw-r--r--Modules/_cursesmodule.c64
-rw-r--r--Modules/_datetimemodule.c60
-rw-r--r--Modules/_dbmmodule.c5
-rw-r--r--Modules/_decimal/_decimal.c2
-rw-r--r--Modules/_elementtree.c58
-rw-r--r--Modules/_functoolsmodule.c12
-rw-r--r--Modules/_gdbmmodule.c17
-rw-r--r--Modules/_hashopenssl.c10
-rw-r--r--Modules/_io/bufferedio.c21
-rw-r--r--Modules/_io/bytesio.c6
-rw-r--r--Modules/_io/clinic/_iomodule.c.h4
-rw-r--r--Modules/_io/clinic/bufferedio.c.h67
-rw-r--r--Modules/_io/clinic/bytesio.c.h80
-rw-r--r--Modules/_io/clinic/fileio.c.h32
-rw-r--r--Modules/_io/clinic/iobase.c.h32
-rw-r--r--Modules/_io/clinic/stringio.c.h42
-rw-r--r--Modules/_io/clinic/textio.c.h44
-rw-r--r--Modules/_io/clinic/winconsoleio.c.h12
-rw-r--r--Modules/_io/fileio.c4
-rw-r--r--Modules/_io/iobase.c3
-rw-r--r--Modules/_io/stringio.c2
-rw-r--r--Modules/_io/textio.c12
-rw-r--r--Modules/_io/winconsoleio.c14
-rw-r--r--Modules/_json.c13
-rw-r--r--Modules/_lsprof.c9
-rw-r--r--Modules/_math.c49
-rw-r--r--Modules/_math.h24
-rw-r--r--Modules/_multiprocessing/multiprocessing.c7
-rw-r--r--Modules/_operator.c1044
-rw-r--r--Modules/_pickle.c92
-rw-r--r--Modules/_randommodule.c3
-rw-r--r--Modules/_scproxy.c3
-rw-r--r--Modules/_sha3/clinic/sha3module.c.h6
-rw-r--r--Modules/_sha3/sha3module.c3
-rw-r--r--Modules/_sqlite/cache.c2
-rw-r--r--Modules/_sqlite/connection.c15
-rw-r--r--Modules/_sqlite/module.c13
-rw-r--r--Modules/_sqlite/row.c8
-rw-r--r--Modules/_sqlite/statement.c2
-rw-r--r--Modules/_sre.c107
-rw-r--r--Modules/_ssl.c8
-rw-r--r--Modules/_struct.c514
-rw-r--r--Modules/_testcapimodule.c79
-rw-r--r--Modules/_testmultiphase.c3
-rw-r--r--Modules/_threadmodule.c6
-rw-r--r--Modules/_tkinter.c6
-rw-r--r--Modules/_tracemalloc.c225
-rwxr-xr-xModules/ar_beos73
-rw-r--r--Modules/arraymodule.c30
-rw-r--r--Modules/cjkcodecs/clinic/multibytecodec.c.h40
-rw-r--r--Modules/cjkcodecs/multibytecodec.c4
-rw-r--r--Modules/clinic/_asynciomodule.c.h14
-rw-r--r--Modules/clinic/_bz2module.c.h4
-rw-r--r--Modules/clinic/_codecsmodule.c.h406
-rw-r--r--Modules/clinic/_cryptmodule.c.h12
-rw-r--r--Modules/clinic/_datetimemodule.c.h4
-rw-r--r--Modules/clinic/_dbmmodule.c.h32
-rw-r--r--Modules/clinic/_elementtree.c.h74
-rw-r--r--Modules/clinic/_gdbmmodule.c.h32
-rw-r--r--Modules/clinic/_hashopenssl.c.h4
-rw-r--r--Modules/clinic/_lzmamodule.c.h14
-rw-r--r--Modules/clinic/_opcode.c.h12
-rw-r--r--Modules/clinic/_operator.c.h1648
-rw-r--r--Modules/clinic/_pickle.c.h20
-rw-r--r--Modules/clinic/_sre.c.h158
-rw-r--r--Modules/clinic/_ssl.c.h48
-rw-r--r--Modules/clinic/_struct.c.h313
-rw-r--r--Modules/clinic/_tkinter.c.h62
-rw-r--r--Modules/clinic/_tracemalloc.c.h192
-rw-r--r--Modules/clinic/_weakref.c.h12
-rw-r--r--Modules/clinic/_winapi.c.h138
-rw-r--r--Modules/clinic/arraymodule.c.h42
-rw-r--r--Modules/clinic/audioop.c.h262
-rw-r--r--Modules/clinic/binascii.c.h28
-rw-r--r--Modules/clinic/cmathmodule.c.h24
-rw-r--r--Modules/clinic/fcntlmodule.c.h42
-rw-r--r--Modules/clinic/gcmodule.c.h258
-rw-r--r--Modules/clinic/grpmodule.c.h6
-rw-r--r--Modules/clinic/mathmodule.c.h539
-rw-r--r--Modules/clinic/md5module.c.h4
-rw-r--r--Modules/clinic/posixmodule.c.h681
-rw-r--r--Modules/clinic/pyexpat.c.h34
-rw-r--r--Modules/clinic/sha1module.c.h4
-rw-r--r--Modules/clinic/sha256module.c.h6
-rw-r--r--Modules/clinic/sha512module.c.h6
-rw-r--r--Modules/clinic/signalmodule.c.h62
-rw-r--r--Modules/clinic/symtablemodule.c.h39
-rw-r--r--Modules/clinic/unicodedata.c.h54
-rw-r--r--Modules/clinic/zlibmodule.c.h52
-rw-r--r--Modules/faulthandler.c15
-rw-r--r--Modules/fpectlmodule.c6
-rw-r--r--Modules/fpetestmodule.c3
-rw-r--r--Modules/gcmodule.c242
-rw-r--r--Modules/itertoolsmodule.c6
-rwxr-xr-xModules/ld_so_beos78
-rw-r--r--Modules/main.c2
-rwxr-xr-xModules/makesetup2
-rw-r--r--Modules/mathmodule.c637
-rw-r--r--Modules/md5module.c3
-rw-r--r--Modules/mmapmodule.c18
-rw-r--r--Modules/ossaudiodev.c15
-rw-r--r--Modules/parsermodule.c3
-rw-r--r--Modules/posixmodule.c213
-rw-r--r--Modules/pyexpat.c19
-rw-r--r--Modules/readline.c2
-rw-r--r--Modules/selectmodule.c29
-rw-r--r--Modules/sha1module.c3
-rw-r--r--Modules/sha256module.c3
-rw-r--r--Modules/sha512module.c12
-rw-r--r--Modules/signalmodule.c4
-rw-r--r--Modules/socketmodule.c94
-rw-r--r--Modules/sre.h4
-rw-r--r--Modules/symtablemodule.c33
-rw-r--r--Modules/syslogmodule.c8
-rw-r--r--Modules/termios.c15
-rw-r--r--Modules/timemodule.c26
-rw-r--r--Modules/unicodedata.c7
-rw-r--r--Modules/zipimport.c19
-rw-r--r--Objects/abstract.c570
-rw-r--r--Objects/bytearrayobject.c5
-rw-r--r--Objects/bytesobject.c13
-rw-r--r--Objects/clinic/bytearrayobject.c.h92
-rw-r--r--Objects/clinic/bytesobject.c.h62
-rw-r--r--Objects/clinic/dictobject.c.h87
-rw-r--r--Objects/clinic/enumobject.c.h71
-rw-r--r--Objects/clinic/longobject.c.h192
-rw-r--r--Objects/clinic/odictobject.c.h134
-rw-r--r--Objects/clinic/unicodeobject.c.h931
-rw-r--r--Objects/codeobject.c25
-rw-r--r--Objects/complexobject.c2
-rw-r--r--Objects/descrobject.c69
-rw-r--r--Objects/dict-common.h2
-rw-r--r--Objects/dictobject.c506
-rw-r--r--Objects/enumobject.c91
-rw-r--r--Objects/exceptions.c55
-rw-r--r--Objects/fileobject.c13
-rw-r--r--Objects/floatobject.c6
-rw-r--r--Objects/frameobject.c24
-rw-r--r--Objects/funcobject.c59
-rw-r--r--Objects/genobject.c5
-rw-r--r--Objects/listobject.c39
-rw-r--r--Objects/longobject.c342
-rw-r--r--Objects/methodobject.c341
-rw-r--r--Objects/moduleobject.c6
-rw-r--r--Objects/object.c110
-rw-r--r--Objects/odictobject.c187
-rw-r--r--Objects/rangeobject.c41
-rw-r--r--Objects/setobject.c22
-rw-r--r--Objects/sliceobject.c2
-rw-r--r--Objects/stringlib/transmogrify.h2
-rw-r--r--Objects/stringlib/unicode_format.h6
-rw-r--r--Objects/structseq.c4
-rw-r--r--Objects/tupleobject.c6
-rw-r--r--Objects/typeobject.c312
-rw-r--r--Objects/unicodeobject.c1166
-rw-r--r--PC/_msi.c36
-rw-r--r--PC/clinic/_testconsole.c.h6
-rw-r--r--PC/clinic/msvcrtmodule.c.h52
-rw-r--r--PC/clinic/winreg.c.h132
-rw-r--r--PC/clinic/winsound.c.h8
-rw-r--r--PC/launcher.c1
-rw-r--r--PC/pyconfig.h4
-rw-r--r--PC/python3.def1572
-rw-r--r--PCbuild/prepare_ssl.bat4
-rw-r--r--PCbuild/readme.txt2
-rw-r--r--PCbuild/rt.bat2
-rw-r--r--Parser/asdl_c.py21
-rw-r--r--Parser/tokenizer.c6
-rw-r--r--Programs/_testembed.c55
-rw-r--r--Python/Python-ast.c51
-rw-r--r--Python/_warnings.c41
-rw-r--r--Python/ast.c10
-rw-r--r--Python/bltinmodule.c105
-rw-r--r--Python/ceval.c330
-rw-r--r--Python/clinic/_warnings.c.h38
-rw-r--r--Python/clinic/bltinmodule.c.h124
-rw-r--r--Python/clinic/import.c.h22
-rw-r--r--Python/codecs.c27
-rw-r--r--Python/compile.c72
-rw-r--r--Python/errors.c18
-rw-r--r--Python/getargs.c527
-rw-r--r--Python/import.c18
-rw-r--r--Python/importdl.c2
-rw-r--r--Python/importlib.h274
-rw-r--r--Python/importlib_external.h684
-rw-r--r--Python/marshal.c4
-rw-r--r--Python/modsupport.c154
-rw-r--r--Python/opcode_targets.h4
-rw-r--r--Python/pylifecycle.c6
-rw-r--r--Python/pythonrun.c6
-rw-r--r--Python/structmember.c2
-rw-r--r--Python/sysmodule.c76
-rw-r--r--README18
-rw-r--r--Tools/README2
-rwxr-xr-xTools/clinic/clinic.py82
-rwxr-xr-xTools/gdb/libpython.py67
-rw-r--r--Tools/msi/buildrelease.bat2
-rw-r--r--Tools/pybench/Arithmetic.py777
-rw-r--r--Tools/pybench/Calls.py560
-rw-r--r--Tools/pybench/CommandLine.py642
-rw-r--r--Tools/pybench/Constructs.py564
-rw-r--r--Tools/pybench/Dict.py504
-rw-r--r--Tools/pybench/Exceptions.py699
-rw-r--r--Tools/pybench/Imports.py138
-rw-r--r--Tools/pybench/Instances.py66
-rw-r--r--Tools/pybench/LICENSE25
-rw-r--r--Tools/pybench/Lists.py350
-rw-r--r--Tools/pybench/Lookups.py945
-rw-r--r--Tools/pybench/NewInstances.py75
-rw-r--r--Tools/pybench/Numbers.py784
-rw-r--r--Tools/pybench/README371
-rw-r--r--Tools/pybench/Setup.py43
-rw-r--r--Tools/pybench/Strings.py568
-rw-r--r--Tools/pybench/Tuples.py360
-rw-r--r--Tools/pybench/Unicode.py541
-rw-r--r--Tools/pybench/With.py189
-rw-r--r--Tools/pybench/clockres.py42
-rw-r--r--Tools/pybench/package/__init__.py0
-rw-r--r--Tools/pybench/package/submodule.py0
-rwxr-xr-xTools/pybench/pybench.py974
-rwxr-xr-xTools/pybench/systimes.py214
-rw-r--r--Tools/scripts/generate_opcode_h.py12
-rwxr-xr-xTools/scripts/google.py32
-rw-r--r--Tools/scripts/run_tests.py1
-rwxr-xr-xconfigure117
-rw-r--r--configure.ac64
-rw-r--r--pyconfig.h.in3
-rw-r--r--setup.py55
733 files changed, 16681 insertions, 159762 deletions
diff --git a/.gitignore b/.gitignore
index ed4ebfbbd9..9606f0f49e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -31,7 +31,9 @@ Modules/Setup.local
Modules/config.c
Modules/ld_so_aix
Programs/_freeze_importlib
+Programs/_freeze_importlib.exe
Programs/_testembed
+Programs/_testembed.exe
PC/python_nt*.h
PC/pythonnt_rc*.h
PC/*/*.exe
@@ -57,6 +59,7 @@ PCbuild/obj/
PCBuild/win32/
.purify
Parser/pgen
+Parser/pgen.exe
__pycache__
autom4te.cache
build/
@@ -72,6 +75,7 @@ ipch/
libpython*.a
libpython*.so*
libpython*.dylib
+libpython*.dll
platform
pybuilddir.txt
pyconfig.h
diff --git a/.hgignore b/.hgignore
index 92896b7bc2..68c607f2e8 100644
--- a/.hgignore
+++ b/.hgignore
@@ -33,7 +33,6 @@ Modules/Setup.config
Modules/Setup.local
Modules/config.c
Modules/ld_so_aix$
-Parser/pgen$
^lcov-report/
^core
^python-gdb.py
@@ -44,6 +43,7 @@ syntax: glob
libpython*.a
libpython*.so*
libpython*.dylib
+libpython*.dll
*.swp
*.o
*.pyc
@@ -87,8 +87,9 @@ Tools/unicode/build/
Tools/unicode/MAPPINGS/
BuildLog.htm
__pycache__
-Programs/_freeze_importlib
-Programs/_testembed
+Parser/pgen{,.exe}
+Programs/_freeze_importlib{,.exe}
+Programs/_testembed{,.exe}
.coverage
coverage/
externals/
diff --git a/Doc/c-api/init.rst b/Doc/c-api/init.rst
index 2965bc931a..7d9eefb1ea 100644
--- a/Doc/c-api/init.rst
+++ b/Doc/c-api/init.rst
@@ -1147,46 +1147,6 @@ Python-level trace functions in previous versions.
:c:func:`PyEval_SetProfile`, except the tracing function does receive line-number
events.
-.. c:function:: PyObject* PyEval_GetCallStats(PyObject *self)
-
- Return a tuple of function call counts. There are constants defined for the
- positions within the tuple:
-
- +-------------------------------+-------+
- | Name | Value |
- +===============================+=======+
- | :const:`PCALL_ALL` | 0 |
- +-------------------------------+-------+
- | :const:`PCALL_FUNCTION` | 1 |
- +-------------------------------+-------+
- | :const:`PCALL_FAST_FUNCTION` | 2 |
- +-------------------------------+-------+
- | :const:`PCALL_FASTER_FUNCTION`| 3 |
- +-------------------------------+-------+
- | :const:`PCALL_METHOD` | 4 |
- +-------------------------------+-------+
- | :const:`PCALL_BOUND_METHOD` | 5 |
- +-------------------------------+-------+
- | :const:`PCALL_CFUNCTION` | 6 |
- +-------------------------------+-------+
- | :const:`PCALL_TYPE` | 7 |
- +-------------------------------+-------+
- | :const:`PCALL_GENERATOR` | 8 |
- +-------------------------------+-------+
- | :const:`PCALL_OTHER` | 9 |
- +-------------------------------+-------+
- | :const:`PCALL_POP` | 10 |
- +-------------------------------+-------+
-
- :const:`PCALL_FAST_FUNCTION` means no argument tuple needs to be created.
- :const:`PCALL_FASTER_FUNCTION` means that the fast-path frame setup code is used.
-
- If there is a method call where the call can be optimized by changing
- the argument tuple and calling the function directly, it gets recorded
- twice.
-
- This function is only present if Python is compiled with :const:`CALL_PROFILE`
- defined.
.. _advanced-debugging:
diff --git a/Doc/c-api/object.rst b/Doc/c-api/object.rst
index b761c808fc..754dedc1c6 100644
--- a/Doc/c-api/object.rst
+++ b/Doc/c-api/object.rst
@@ -244,63 +244,82 @@ Object Protocol
and ``0`` otherwise. This function always succeeds.
-.. c:function:: PyObject* PyObject_Call(PyObject *callable_object, PyObject *args, PyObject *kw)
+.. c:function:: PyObject* PyObject_Call(PyObject *callable, PyObject *args, PyObject *kwargs)
- Call a callable Python object *callable_object*, with arguments given by the
- tuple *args*, and named arguments given by the dictionary *kw*. If no named
- arguments are needed, *kw* may be *NULL*. *args* must not be *NULL*, use an
- empty tuple if no arguments are needed. Returns the result of the call on
- success, or *NULL* on failure. This is the equivalent of the Python expression
- ``callable_object(*args, **kw)``.
+ Call a callable Python object *callable*, with arguments given by the
+ tuple *args*, and named arguments given by the dictionary *kwargs*.
+ *args* must not be *NULL*, use an empty tuple if no arguments are needed.
+ If no named arguments are needed, *kwargs* can be *NULL*.
-.. c:function:: PyObject* PyObject_CallObject(PyObject *callable_object, PyObject *args)
+ Returns the result of the call on success, or *NULL* on failure.
- Call a callable Python object *callable_object*, with arguments given by the
- tuple *args*. If no arguments are needed, then *args* may be *NULL*. Returns
- the result of the call on success, or *NULL* on failure. This is the equivalent
- of the Python expression ``callable_object(*args)``.
+ This is the equivalent of the Python expression:
+ ``callable(*args, **kwargs)``.
+
+
+.. c:function:: PyObject* PyObject_CallObject(PyObject *callable, PyObject *args)
+
+ Call a callable Python object *callable*, with arguments given by the
+ tuple *args*. If no arguments are needed, then *args* can be *NULL*.
+
+ Returns the result of the call on success, or *NULL* on failure.
+
+ This is the equivalent of the Python expression: ``callable(*args)``.
.. c:function:: PyObject* PyObject_CallFunction(PyObject *callable, const char *format, ...)
Call a callable Python object *callable*, with a variable number of C arguments.
The C arguments are described using a :c:func:`Py_BuildValue` style format
- string. The format may be *NULL*, indicating that no arguments are provided.
- Returns the result of the call on success, or *NULL* on failure. This is the
- equivalent of the Python expression ``callable(*args)``. Note that if you only
- pass :c:type:`PyObject \*` args, :c:func:`PyObject_CallFunctionObjArgs` is a
- faster alternative.
+ string. The format can be *NULL*, indicating that no arguments are provided.
+
+ Returns the result of the call on success, or *NULL* on failure.
+
+ This is the equivalent of the Python expression: ``callable(*args)``.
+
+ Note that if you only pass :c:type:`PyObject \*` args,
+ :c:func:`PyObject_CallFunctionObjArgs` is a faster alternative.
.. versionchanged:: 3.4
The type of *format* was changed from ``char *``.
-.. c:function:: PyObject* PyObject_CallMethod(PyObject *o, const char *method, const char *format, ...)
+.. c:function:: PyObject* PyObject_CallMethod(PyObject *obj, const char *name, const char *format, ...)
- Call the method named *method* of object *o* with a variable number of C
+ Call the method named *name* of object *obj* with a variable number of C
arguments. The C arguments are described by a :c:func:`Py_BuildValue` format
- string that should produce a tuple. The format may be *NULL*, indicating that
- no arguments are provided. Returns the result of the call on success, or *NULL*
- on failure. This is the equivalent of the Python expression ``o.method(args)``.
+ string that should produce a tuple.
+
+ The format can be *NULL*, indicating that no arguments are provided.
+
+ Returns the result of the call on success, or *NULL* on failure.
+
+ This is the equivalent of the Python expression:
+ ``obj.name(arg1, arg2, ...)``.
+
Note that if you only pass :c:type:`PyObject \*` args,
:c:func:`PyObject_CallMethodObjArgs` is a faster alternative.
.. versionchanged:: 3.4
- The types of *method* and *format* were changed from ``char *``.
+ The types of *name* and *format* were changed from ``char *``.
.. c:function:: PyObject* PyObject_CallFunctionObjArgs(PyObject *callable, ..., NULL)
Call a callable Python object *callable*, with a variable number of
:c:type:`PyObject\*` arguments. The arguments are provided as a variable number
- of parameters followed by *NULL*. Returns the result of the call on success, or
- *NULL* on failure.
+ of parameters followed by *NULL*.
+
+ Returns the result of the call on success, or *NULL* on failure.
+
+ This is the equivalent of the Python expression:
+ ``callable(arg1, arg2, ...)``.
-.. c:function:: PyObject* PyObject_CallMethodObjArgs(PyObject *o, PyObject *name, ..., NULL)
+.. c:function:: PyObject* PyObject_CallMethodObjArgs(PyObject *obj, PyObject *name, ..., NULL)
- Calls a method of the object *o*, where the name of the method is given as a
+ Calls a method of the Python object *obj*, where the name of the method is given as a
Python string object in *name*. It is called with a variable number of
:c:type:`PyObject\*` arguments. The arguments are provided as a variable number
of parameters followed by *NULL*. Returns the result of the call on success, or
diff --git a/Doc/c-api/slice.rst b/Doc/c-api/slice.rst
index a825164918..5606ae41a5 100644
--- a/Doc/c-api/slice.rst
+++ b/Doc/c-api/slice.rst
@@ -56,3 +56,40 @@ Slice Objects
.. versionchanged:: 3.2
The parameter type for the *slice* parameter was ``PySliceObject*``
before.
+
+ .. versionchanged:: 3.6.1
+ If ``Py_LIMITED_API`` is not set or set to the value between ``0x03050400``
+ and ``0x03060000`` (not including) or ``0x03060100`` or higher
+ :c:func:`!PySlice_GetIndicesEx` is implemented as a macro using
+ :c:func:`PySlice_Unpack` and :c:func:`PySlice_AdjustIndices`.
+ Arguments *start*, *stop* and *step* are evaluated more than once.
+
+ .. deprecated:: 3.6.1
+ If ``Py_LIMITED_API`` is set to the value less than ``0x03050400`` or
+ between ``0x03060000`` and ``0x03060100`` (not including)
+ :c:func:`!PySlice_GetIndicesEx` is a deprecated function.
+
+
+.. c:function:: int PySlice_Unpack(PyObject *slice, Py_ssize_t *start, Py_ssize_t *stop, Py_ssize_t *step)
+
+ Extract the start, stop and step data members from a slice object as
+ C integers. Silently reduce values larger than ``PY_SSIZE_T_MAX`` to
+ ``PY_SSIZE_T_MAX``, silently boost the start and stop values less than
+ ``-PY_SSIZE_T_MAX-1`` to ``-PY_SSIZE_T_MAX-1``, and silently boost the step
+ values less than ``-PY_SSIZE_T_MAX`` to ``-PY_SSIZE_T_MAX``.
+
+ Return ``-1`` on error, ``0`` on success.
+
+ .. versionadded:: 3.6.1
+
+
+.. c:function:: Py_ssize_t PySlice_AdjustIndices(Py_ssize_t length, Py_ssize_t *start, Py_ssize_t *stop, Py_ssize_t step)
+
+ Adjust start/end slice indices assuming a sequence of the specified length.
+ Out of bounds indices are clipped in a manner consistent with the handling
+ of normal slices.
+
+ Return the length of the slice. Always successful. Doesn't call Python
+ code.
+
+ .. versionadded:: 3.6.1
diff --git a/Doc/c-api/typeobj.rst b/Doc/c-api/typeobj.rst
index ac6fd0b53f..2f0081aa3d 100644
--- a/Doc/c-api/typeobj.rst
+++ b/Doc/c-api/typeobj.rst
@@ -727,11 +727,11 @@ type objects) *must* have the :attr:`ob_size` field.
typedef int (*setter)(PyObject *, PyObject *, void *);
typedef struct PyGetSetDef {
- char *name; /* attribute name */
- getter get; /* C function to get the attribute */
- setter set; /* C function to set or delete the attribute */
- char *doc; /* optional doc string */
- void *closure; /* optional additional data for getter and setter */
+ const char *name; /* attribute name */
+ getter get; /* C function to get the attribute */
+ setter set; /* C function to set or delete the attribute */
+ const char *doc; /* optional doc string */
+ void *closure; /* optional additional data for getter and setter */
} PyGetSetDef;
diff --git a/Doc/c-api/unicode.rst b/Doc/c-api/unicode.rst
index 02f7ada7be..bcae44ef49 100644
--- a/Doc/c-api/unicode.rst
+++ b/Doc/c-api/unicode.rst
@@ -1038,7 +1038,7 @@ These are the UTF-8 codec APIs:
raised by the codec.
-.. c:function:: char* PyUnicode_AsUTF8AndSize(PyObject *unicode, Py_ssize_t *size)
+.. c:function:: const char* PyUnicode_AsUTF8AndSize(PyObject *unicode, Py_ssize_t *size)
Return a pointer to the UTF-8 encoding of the Unicode object, and
store the size of the encoded representation (in bytes) in *size*. The
@@ -1055,13 +1055,19 @@ These are the UTF-8 codec APIs:
.. versionadded:: 3.3
+ .. versionchanged:: 3.7
+ The return type is now ``const char *`` rather of ``char *``.
-.. c:function:: char* PyUnicode_AsUTF8(PyObject *unicode)
+
+.. c:function:: const char* PyUnicode_AsUTF8(PyObject *unicode)
As :c:func:`PyUnicode_AsUTF8AndSize`, but does not store the size.
.. versionadded:: 3.3
+ .. versionchanged:: 3.7
+ The return type is now ``const char *`` rather of ``char *``.
+
.. c:function:: PyObject* PyUnicode_EncodeUTF8(const Py_UNICODE *s, Py_ssize_t size, const char *errors)
@@ -1605,6 +1611,9 @@ They all return *NULL* or ``-1`` if an exception occurs.
.. versionadded:: 3.3
+ .. versionchanged:: 3.7
+ *start* and *end* are now adjusted to behave like ``str[start:end]``.
+
.. c:function:: Py_ssize_t PyUnicode_Count(PyObject *str, PyObject *substr, \
Py_ssize_t start, Py_ssize_t end)
diff --git a/Doc/extending/newtypes.rst b/Doc/extending/newtypes.rst
index b8ce437787..118f336ae1 100644
--- a/Doc/extending/newtypes.rst
+++ b/Doc/extending/newtypes.rst
@@ -1138,11 +1138,11 @@ in the instance. A variety of primitive C types are supported, and access may
be read-only or read-write. The structures in the table are defined as::
typedef struct PyMemberDef {
- char *name;
- int type;
- int offset;
- int flags;
- char *doc;
+ const char *name;
+ int type;
+ int offset;
+ int flags;
+ const char *doc;
} PyMemberDef;
For each entry in the table, a :term:`descriptor` will be constructed and added to the
diff --git a/Doc/library/dis.rst b/Doc/library/dis.rst
index a15690ba48..694d5642fb 100644
--- a/Doc/library/dis.rst
+++ b/Doc/library/dis.rst
@@ -957,6 +957,28 @@ All of the following opcodes use their arguments.
value.
+.. opcode:: LOAD_METHOD (namei)
+
+ Loads a method named ``co_names[namei]`` from TOS object. TOS is popped and
+ method and TOS are pushed when interpreter can call unbound method directly.
+ TOS will be uesd as the first argument (``self``) by :opcode:`CALL_METHOD`.
+ Otherwise, ``NULL`` and method is pushed (method is bound method or
+ something else).
+
+ .. versionadded:: 3.7
+
+
+.. opcode:: CALL_METHOD (argc)
+
+ Calls a method. *argc* is number of positional arguments.
+ Keyword arguments are not supported. This opcode is designed to be used
+ with :opcode:`LOAD_METHOD`. Positional arguments are on top of the stack.
+ Below them, two items described in :opcode:`LOAD_METHOD` on the stack.
+ All of them are popped and return value is pushed.
+
+ .. versionadded:: 3.7
+
+
.. opcode:: MAKE_FUNCTION (argc)
Pushes a new function object on the stack. From bottom to top, the consumed
diff --git a/Doc/library/http.cookies.rst b/Doc/library/http.cookies.rst
index 4b45d4bc38..fb8317ad59 100644
--- a/Doc/library/http.cookies.rst
+++ b/Doc/library/http.cookies.rst
@@ -148,39 +148,31 @@ Morsel Objects
:meth:`~Morsel.__eq__` now takes :attr:`~Morsel.key` and :attr:`~Morsel.value`
into account.
+ .. versionchanged:: 3.7
+ Attributes :attr:`~Morsel.key`, :attr:`~Morsel.value` and
+ :attr:`~Morsel.coded_value` are read-only. Use :meth:`~Morsel.set` for
+ setting them.
+
.. attribute:: Morsel.value
The value of the cookie.
- .. deprecated:: 3.5
- assigning to ``value``; use :meth:`~Morsel.set` instead.
-
.. attribute:: Morsel.coded_value
The encoded value of the cookie --- this is what should be sent.
- .. deprecated:: 3.5
- assigning to ``coded_value``; use :meth:`~Morsel.set` instead.
-
.. attribute:: Morsel.key
The name of the cookie.
- .. deprecated:: 3.5
- assigning to ``key``; use :meth:`~Morsel.set` instead.
-
.. method:: Morsel.set(key, value, coded_value)
Set the *key*, *value* and *coded_value* attributes.
- .. deprecated:: 3.5
- The undocumented *LegalChars* parameter is ignored and will be removed in
- a future version.
-
.. method:: Morsel.isReservedKey(K)
diff --git a/Doc/library/io.rst b/Doc/library/io.rst
index 4da6e095d1..c8ff5b826d 100644
--- a/Doc/library/io.rst
+++ b/Doc/library/io.rst
@@ -477,7 +477,7 @@ I/O Base Classes
A :exc:`BlockingIOError` is raised if the underlying raw stream is in
non blocking-mode, and has no data available at the moment.
- .. method:: read1(size=-1)
+ .. method:: read1([size])
Read and return up to *size* bytes, with at most one call to the
underlying raw stream's :meth:`~RawIOBase.read` (or
@@ -485,6 +485,9 @@ I/O Base Classes
implementing your own buffering on top of a :class:`BufferedIOBase`
object.
+ If *size* is ``-1`` (the default), an arbitrary number of bytes are
+ returned (more than zero unless EOF is reached).
+
.. method:: readinto(b)
Read bytes into a pre-allocated, writable
@@ -628,13 +631,16 @@ than raw I/O does.
Return :class:`bytes` containing the entire contents of the buffer.
- .. method:: read1()
+ .. method:: read1([size])
+
+ In :class:`BytesIO`, this is the same as :meth:`~BufferedIOBase.read`.
- In :class:`BytesIO`, this is the same as :meth:`read`.
+ .. versionchanged:: 3.7
+ The *size* argument is now optional.
- .. method:: readinto1()
+ .. method:: readinto1(b)
- In :class:`BytesIO`, this is the same as :meth:`readinto`.
+ In :class:`BytesIO`, this is the same as :meth:`~BufferedIOBase.readinto`.
.. versionadded:: 3.5
@@ -664,12 +670,15 @@ than raw I/O does.
Read and return *size* bytes, or if *size* is not given or negative, until
EOF or if the read call would block in non-blocking mode.
- .. method:: read1(size)
+ .. method:: read1([size])
Read and return up to *size* bytes with only one call on the raw stream.
If at least one byte is buffered, only buffered bytes are returned.
Otherwise, one raw stream read call is made.
+ .. versionchanged:: 3.7
+ The *size* argument is now optional.
+
.. class:: BufferedWriter(raw, buffer_size=DEFAULT_BUFFER_SIZE)
diff --git a/Doc/library/logging.rst b/Doc/library/logging.rst
index 6098878c1a..d03cc50d87 100644
--- a/Doc/library/logging.rst
+++ b/Doc/library/logging.rst
@@ -1023,7 +1023,7 @@ functions.
handlers being added multiple times to the root logger, which can in turn
lead to multiple messages for the same event.
-.. function:: disable(lvl)
+.. function:: disable(lvl=CRITICAL)
Provides an overriding level *lvl* for all loggers which takes precedence over
the logger's own level. When the need arises to temporarily throttle logging
@@ -1036,6 +1036,14 @@ functions.
overriding level, so that logging output again depends on the effective
levels of individual loggers.
+ Note that if you have defined any custom logging level higher than
+ ``CRITICAL`` (this is not recommended), you won't be able to rely on the
+ default value for the *lvl* parameter, but will have to explicitly supply a
+ suitable value.
+
+ .. versionchanged:: 3.7
+ The *lvl* parameter was defaulted to level ``CRITICAL``. See Issue
+ #28524 for more information about this change.
.. function:: addLevelName(lvl, levelName)
diff --git a/Doc/library/os.path.rst b/Doc/library/os.path.rst
index 406054e5d7..38a9331577 100644
--- a/Doc/library/os.path.rst
+++ b/Doc/library/os.path.rst
@@ -453,19 +453,6 @@ the :mod:`glob` module.)
Accepts a :term:`path-like object`.
-.. function:: splitunc(path)
-
- .. deprecated:: 3.1
- Use *splitdrive* instead.
-
- Split the pathname *path* into a pair ``(unc, rest)`` so that *unc* is the UNC
- mount point (such as ``r'\\host\mount'``), if present, and *rest* the rest of
- the path (such as ``r'\path\file.ext'``). For paths containing drive letters,
- *unc* will always be the empty string.
-
- Availability: Windows.
-
-
.. data:: supports_unicode_filenames
``True`` if arbitrary Unicode strings can be used as file names (within limitations
diff --git a/Doc/library/re.rst b/Doc/library/re.rst
index fe5ebcc67c..6e9343a1b5 100644
--- a/Doc/library/re.rst
+++ b/Doc/library/re.rst
@@ -761,9 +761,9 @@ form.
Unknown escapes in *pattern* consisting of ``'\'`` and an ASCII letter
now are errors.
- .. deprecated-removed:: 3.5 3.7
- Unknown escapes in *repl* consisting of ``'\'`` and an ASCII letter now raise
- a deprecation warning and will be forbidden in Python 3.7.
+ .. versionchanged:: 3.7
+ Unknown escapes in *repl* consisting of ``'\'`` and an ASCII letter
+ now are errors.
.. function:: subn(pattern, repl, string, count=0, flags=0)
diff --git a/Doc/library/socket.rst b/Doc/library/socket.rst
index 678e32ce57..d56caf0a58 100644
--- a/Doc/library/socket.rst
+++ b/Doc/library/socket.rst
@@ -664,6 +664,12 @@ The :mod:`socket` module also offers various network-related services:
where the host byte order is the same as network byte order, this is a no-op;
otherwise, it performs a 2-byte swap operation.
+ .. deprecated:: 3.7
+ In case *x* does not fit in 16-bit unsigned integer, but does fit in a
+ positive C int, it is silently truncated to 16-bit unsigned integer.
+ This silent truncation feature is deprecated, and will raise an
+ exception in future versions of Python.
+
.. function:: htonl(x)
@@ -678,6 +684,12 @@ The :mod:`socket` module also offers various network-related services:
where the host byte order is the same as network byte order, this is a no-op;
otherwise, it performs a 2-byte swap operation.
+ .. deprecated:: 3.7
+ In case *x* does not fit in 16-bit unsigned integer, but does fit in a
+ positive C int, it is silently truncated to 16-bit unsigned integer.
+ This silent truncation feature is deprecated, and will raise an
+ exception in future versions of Python.
+
.. function:: inet_aton(ip_string)
diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst
index 9a4f42caa4..d13fc3d920 100644
--- a/Doc/library/stdtypes.rst
+++ b/Doc/library/stdtypes.rst
@@ -2316,11 +2316,15 @@ the bytes type has an additional class method to read data in that format:
This :class:`bytes` class method returns a bytes object, decoding the
given string object. The string must contain two hexadecimal digits per
- byte, with ASCII spaces being ignored.
+ byte, with ASCII whitespace being ignored.
>>> bytes.fromhex('2Ef0 F1f2 ')
b'.\xf0\xf1\xf2'
+ .. versionchanged:: 3.7
+ :meth:`bytes.fromhex` now skips all ASCII whitespace in the string,
+ not just spaces.
+
A reverse conversion function exists to transform a bytes object into its
hexadecimal representation.
@@ -2384,11 +2388,15 @@ the bytearray type has an additional class method to read data in that format:
This :class:`bytearray` class method returns bytearray object, decoding
the given string object. The string must contain two hexadecimal digits
- per byte, with ASCII spaces being ignored.
+ per byte, with ASCII whitespace being ignored.
>>> bytearray.fromhex('2Ef0 F1f2 ')
bytearray(b'.\xf0\xf1\xf2')
+ .. versionchanged:: 3.7
+ :meth:`bytearray.fromhex` now skips all ASCII whitespace in the string,
+ not just spaces.
+
A reverse conversion function exists to transform a bytearray object into its
hexadecimal representation.
diff --git a/Doc/library/string.rst b/Doc/library/string.rst
index a0977b6461..03eaf3b9cd 100644
--- a/Doc/library/string.rst
+++ b/Doc/library/string.rst
@@ -95,9 +95,9 @@ implementation as the built-in :meth:`~str.format` method.
an arbitrary set of positional and keyword arguments.
It is just a wrapper that calls :meth:`vformat`.
- .. deprecated:: 3.5
- Passing a format string as keyword argument *format_string* has been
- deprecated.
+ .. versionchanged:: 3.7
+ A format string argument is now :ref:`positional-only
+ <positional-only_parameter>`.
.. method:: vformat(format_string, args, kwargs)
diff --git a/Doc/library/struct.rst b/Doc/library/struct.rst
index cc3017b5fc..bb32a65d2e 100644
--- a/Doc/library/struct.rst
+++ b/Doc/library/struct.rst
@@ -48,40 +48,40 @@ The module defines the following exception and functions:
is wrong.
-.. function:: pack(fmt, v1, v2, ...)
+.. function:: pack(format, v1, v2, ...)
Return a bytes object containing the values *v1*, *v2*, ... packed according
- to the format string *fmt*. The arguments must match the values required by
+ to the format string *format*. The arguments must match the values required by
the format exactly.
-.. function:: pack_into(fmt, buffer, offset, v1, v2, ...)
+.. function:: pack_into(format, buffer, offset, v1, v2, ...)
- Pack the values *v1*, *v2*, ... according to the format string *fmt* and
+ Pack the values *v1*, *v2*, ... according to the format string *format* and
write the packed bytes into the writable buffer *buffer* starting at
position *offset*. Note that *offset* is a required argument.
-.. function:: unpack(fmt, buffer)
+.. function:: unpack(format, buffer)
- Unpack from the buffer *buffer* (presumably packed by ``pack(fmt, ...)``)
- according to the format string *fmt*. The result is a tuple even if it
+ Unpack from the buffer *buffer* (presumably packed by ``pack(format, ...)``)
+ according to the format string *format*. The result is a tuple even if it
contains exactly one item. The buffer's size in bytes must match the
size required by the format, as reflected by :func:`calcsize`.
-.. function:: unpack_from(fmt, buffer, offset=0)
+.. function:: unpack_from(format, buffer, offset=0)
Unpack from *buffer* starting at position *offset*, according to the format
- string *fmt*. The result is a tuple even if it contains exactly one
+ string *format*. The result is a tuple even if it contains exactly one
item. The buffer's size in bytes, minus *offset*, must be at least
the size required by the format, as reflected by :func:`calcsize`.
-.. function:: iter_unpack(fmt, buffer)
+.. function:: iter_unpack(format, buffer)
Iteratively unpack from the buffer *buffer* according to the format
- string *fmt*. This function returns an iterator which will read
+ string *format*. This function returns an iterator which will read
equally-sized chunks from the buffer until all its contents have been
consumed. The buffer's size in bytes must be a multiple of the size
required by the format, as reflected by :func:`calcsize`.
@@ -91,10 +91,11 @@ The module defines the following exception and functions:
.. versionadded:: 3.4
-.. function:: calcsize(fmt)
+.. function:: calcsize(format)
Return the size of the struct (and hence of the bytes object produced by
- ``pack(fmt, ...)``) corresponding to the format string *fmt*.
+ ``pack(format, ...)``) corresponding to the format string *format*.
+
.. _struct-format-strings:
diff --git a/Doc/library/subprocess.rst b/Doc/library/subprocess.rst
index ad2abe8245..ea065b897e 100644
--- a/Doc/library/subprocess.rst
+++ b/Doc/library/subprocess.rst
@@ -608,12 +608,6 @@ Instances of the :class:`Popen` class have the following methods:
.. versionchanged:: 3.3
*timeout* was added.
- .. deprecated:: 3.4
-
- Do not use the *endtime* parameter. It is was unintentionally
- exposed in 3.3 but was left undocumented as it was intended to be
- private for internal use. Use *timeout* instead.
-
.. method:: Popen.communicate(input=None, timeout=None)
Interact with process: Send data to stdin. Read data from stdout and stderr,
diff --git a/Doc/library/sys.rst b/Doc/library/sys.rst
index dd51ffd56c..54b99e0fd9 100644
--- a/Doc/library/sys.rst
+++ b/Doc/library/sys.rst
@@ -404,6 +404,15 @@ always available.
.. versionadded:: 3.4
+.. function:: getandroidapilevel()
+
+ Return the build time API version of Android as an integer.
+
+ Availability: Android.
+
+ .. versionadded:: 3.7
+
+
.. function:: getcheckinterval()
Return the interpreter's "check interval"; see :func:`setcheckinterval`.
diff --git a/Doc/library/tarfile.rst b/Doc/library/tarfile.rst
index d8f809753d..2167f32f6a 100644
--- a/Doc/library/tarfile.rst
+++ b/Doc/library/tarfile.rst
@@ -429,16 +429,13 @@ be finalized; only the internally used file object will be closed. See the
Return an :class:`io.BufferedReader` object.
-.. method:: TarFile.add(name, arcname=None, recursive=True, exclude=None, *, filter=None)
+.. method:: TarFile.add(name, arcname=None, recursive=True, *, filter=None)
Add the file *name* to the archive. *name* may be any type of file
(directory, fifo, symbolic link, etc.). If given, *arcname* specifies an
alternative name for the file in the archive. Directories are added
recursively by default. This can be avoided by setting *recursive* to
- :const:`False`. If *exclude* is given, it must be a function that takes one
- filename argument and returns a boolean value. Depending on this value the
- respective file is either excluded (:const:`True`) or added
- (:const:`False`). If *filter* is specified it must be a keyword argument. It
+ :const:`False`. If *filter* is given, it
should be a function that takes a :class:`TarInfo` object argument and
returns the changed :class:`TarInfo` object. If it instead returns
:const:`None` the :class:`TarInfo` object will be excluded from the
@@ -447,10 +444,6 @@ be finalized; only the internally used file object will be closed. See the
.. versionchanged:: 3.2
Added the *filter* parameter.
- .. deprecated:: 3.2
- The *exclude* parameter is deprecated, please use the *filter* parameter
- instead.
-
.. method:: TarFile.addfile(tarinfo, fileobj=None)
diff --git a/Doc/library/time.rst b/Doc/library/time.rst
index ae17f6f4f0..6ef02b7403 100644
--- a/Doc/library/time.rst
+++ b/Doc/library/time.rst
@@ -594,8 +594,13 @@ The module defines the following functions and data items:
.. function:: tzset()
- Resets the time conversion rules used by the library routines. The environment
- variable :envvar:`TZ` specifies how this is done.
+ Reset the time conversion rules used by the library routines. The environment
+ variable :envvar:`TZ` specifies how this is done. It will also set the variables
+ ``tzname`` (from the :envvar:`TZ` environment variable), ``timezone`` (non-DST
+ seconds West of UTC), ``altzone`` (DST seconds west of UTC) and ``daylight``
+ (to 0 if this timezone does not have any daylight saving time rules, or to
+ nonzero if there is a time, past, present or future when daylight saving time
+ applies).
Availability: Unix.
diff --git a/Doc/library/timeit.rst b/Doc/library/timeit.rst
index 3b772765ac..4065808854 100644
--- a/Doc/library/timeit.rst
+++ b/Doc/library/timeit.rst
@@ -28,11 +28,11 @@ can be used to compare three different expressions:
.. code-block:: sh
$ python3 -m timeit '"-".join(str(n) for n in range(100))'
- 10000 loops, best of 3: 30.2 usec per loop
+ 10000 loops, best of 5: 30.2 usec per loop
$ python3 -m timeit '"-".join([str(n) for n in range(100)])'
- 10000 loops, best of 3: 27.5 usec per loop
+ 10000 loops, best of 5: 27.5 usec per loop
$ python3 -m timeit '"-".join(map(str, range(100)))'
- 10000 loops, best of 3: 23.2 usec per loop
+ 10000 loops, best of 5: 23.2 usec per loop
This can be achieved from the :ref:`python-interface` with::
@@ -141,9 +141,8 @@ The module defines three convenience functions and a public class:
This is a convenience function that calls :meth:`.timeit` repeatedly
so that the total time >= 0.2 second, returning the eventual
(number of loops, time taken for that number of loops). It calls
- :meth:`.timeit` with *number* set to successive powers of ten (10,
- 100, 1000, ...) up to a maximum of one billion, until the time taken
- is at least 0.2 second, or the maximum is reached.
+ :meth:`.timeit` with increasing numbers from the sequence 1, 2, 5,
+ 10, 20, 50, ... until the time taken is at least 0.2 second.
If *callback* is given and is not ``None``, it will be called after
each trial with two arguments: ``callback(number, time_taken)``.
@@ -197,7 +196,7 @@ Command-Line Interface
When called as a program from the command line, the following form is used::
- python -m timeit [-n N] [-r N] [-u U] [-s S] [-t] [-c] [-h] [statement ...]
+ python -m timeit [-n N] [-r N] [-u U] [-s S] [-h] [statement ...]
Where the following options are understood:
@@ -222,20 +221,12 @@ Where the following options are understood:
.. versionadded:: 3.3
-.. cmdoption:: -t, --time
-
- use :func:`time.time` (deprecated)
-
.. cmdoption:: -u, --unit=U
- specify a time unit for timer output; can select usec, msec, or sec
+ specify a time unit for timer output; can select nsec, usec, msec, or sec
.. versionadded:: 3.5
-.. cmdoption:: -c, --clock
-
- use :func:`time.clock` (deprecated)
-
.. cmdoption:: -v, --verbose
print raw timing results; repeat for more digits precision
@@ -276,9 +267,9 @@ It is possible to provide a setup statement that is executed only once at the be
.. code-block:: sh
$ python -m timeit -s 'text = "sample string"; char = "g"' 'char in text'
- 10000000 loops, best of 3: 0.0877 usec per loop
+ 5000000 loops, best of 5: 0.0877 usec per loop
$ python -m timeit -s 'text = "sample string"; char = "g"' 'text.find(char)'
- 1000000 loops, best of 3: 0.342 usec per loop
+ 1000000 loops, best of 5: 0.342 usec per loop
::
@@ -305,14 +296,14 @@ to test for missing and present object attributes:
.. code-block:: sh
$ python -m timeit 'try:' ' str.__bool__' 'except AttributeError:' ' pass'
- 100000 loops, best of 3: 15.7 usec per loop
+ 20000 loops, best of 5: 15.7 usec per loop
$ python -m timeit 'if hasattr(str, "__bool__"): pass'
- 100000 loops, best of 3: 4.26 usec per loop
+ 50000 loops, best of 5: 4.26 usec per loop
$ python -m timeit 'try:' ' int.__bool__' 'except AttributeError:' ' pass'
- 1000000 loops, best of 3: 1.43 usec per loop
+ 200000 loops, best of 5: 1.43 usec per loop
$ python -m timeit 'if hasattr(int, "__bool__"): pass'
- 100000 loops, best of 3: 2.23 usec per loop
+ 100000 loops, best of 5: 2.23 usec per loop
::
diff --git a/Doc/library/types.rst b/Doc/library/types.rst
index 0c5619c713..2602e3cf76 100644
--- a/Doc/library/types.rst
+++ b/Doc/library/types.rst
@@ -132,6 +132,29 @@ Standard names are defined for the following types:
C".)
+.. data:: SlotWrapperType
+
+ The type of methods of some built-in data types and base classes such as
+ :meth:`object.__init__` or :meth:`object.__lt__`.
+
+ .. versionadded:: 3.7
+
+
+.. data:: MethodWrapperType
+
+ The type of *bound* methods of some built-in data types and base classes.
+ For example it is the type of :code:`object().__str__`.
+
+ .. versionadded:: 3.7
+
+
+.. data:: MethodDescriptorType
+
+ The type of methods of some built-in data types such as :meth:`str.join`.
+
+ .. versionadded:: 3.7
+
+
.. class:: ModuleType(name, doc=None)
The type of :term:`modules <module>`. Constructor takes the name of the
diff --git a/Doc/library/unittest.mock.rst b/Doc/library/unittest.mock.rst
index c6d0ec92b6..ca5c2bc787 100644
--- a/Doc/library/unittest.mock.rst
+++ b/Doc/library/unittest.mock.rst
@@ -1831,8 +1831,9 @@ sentinel
the same attribute will always return the same object. The objects
returned have a sensible repr so that test failure messages are readable.
- The ``sentinel`` attributes don't preserve their identity when they are
- :mod:`copied <copy>` or :mod:`pickled <pickle>`.
+ .. versionchanged:: 3.7
+ The ``sentinel`` attributes now preserve their identity when they are
+ :mod:`copied <copy>` or :mod:`pickled <pickle>`.
Sometimes when testing you need to test that a specific object is passed as an
argument to another method, or returned. It can be common to create named
diff --git a/Doc/library/zipfile.rst b/Doc/library/zipfile.rst
index 5eb6f10338..a0de10cae3 100644
--- a/Doc/library/zipfile.rst
+++ b/Doc/library/zipfile.rst
@@ -672,18 +672,22 @@ Command-line options
~~~~~~~~~~~~~~~~~~~~
.. cmdoption:: -l <zipfile>
+ --list <zipfile>
List files in a zipfile.
.. cmdoption:: -c <zipfile> <source1> ... <sourceN>
+ --create <zipfile> <source1> ... <sourceN>
Create zipfile from source files.
.. cmdoption:: -e <zipfile> <output_dir>
+ --extract <zipfile> <output_dir>
Extract zipfile into target directory.
.. cmdoption:: -t <zipfile>
+ --test <zipfile>
Test whether the zipfile is valid or not.
diff --git a/Doc/tools/extensions/patchlevel.py b/Doc/tools/extensions/patchlevel.py
index 919ba4a12e..617f28c252 100644
--- a/Doc/tools/extensions/patchlevel.py
+++ b/Doc/tools/extensions/patchlevel.py
@@ -24,15 +24,12 @@ def get_header_version_info(srcdir):
rx = re.compile(r'\s*#define\s+([a-zA-Z][a-zA-Z_0-9]*)\s+([a-zA-Z_0-9]+)')
d = {}
- f = open(patchlevel_h)
- try:
+ with open(patchlevel_h) as f:
for line in f:
m = rx.match(line)
if m is not None:
name, value = m.group(1, 2)
d[name] = value
- finally:
- f.close()
release = version = '%s.%s' % (d['PY_MAJOR_VERSION'], d['PY_MINOR_VERSION'])
micro = int(d['PY_MICRO_VERSION'])
diff --git a/Doc/tools/susp-ignored.csv b/Doc/tools/susp-ignored.csv
index c6e03119ae..51edb66238 100644
--- a/Doc/tools/susp-ignored.csv
+++ b/Doc/tools/susp-ignored.csv
@@ -324,6 +324,5 @@ whatsnew/3.5,,::,>>> addr6 = ipaddress.IPv6Address('::1')
whatsnew/3.5,,:root,ERROR:root:exception
whatsnew/3.5,,:exception,ERROR:root:exception
whatsnew/changelog,,:version,import sys; I = version[:version.index(' ')]
-whatsnew/changelog,,:gz,": TarFile opened with external fileobj and ""w:gz"" mode didn't"
-whatsnew/changelog,,::,": Use ""127.0.0.1"" or ""::1"" instead of ""localhost"" as much as"
whatsnew/changelog,,`,"for readability (was ""`"")."
+whatsnew/changelog,,:end,str[start:end]
diff --git a/Doc/tools/templates/indexsidebar.html b/Doc/tools/templates/indexsidebar.html
index 413c0a7699..72a4d7ae99 100644
--- a/Doc/tools/templates/indexsidebar.html
+++ b/Doc/tools/templates/indexsidebar.html
@@ -4,7 +4,7 @@
<ul>
<li><a href="https://docs.python.org/2.7/">{% trans %}Python 2.7 (stable){% endtrans %}</a></li>
<li><a href="https://docs.python.org/3.5/">{% trans %}Python 3.5 (stable){% endtrans %}</a></li>
- <li><a href="https://docs.python.org/3.7/">{% trans %}Python 3.7 (in development){% endtrans %}</a></li>
+ <li><a href="https://docs.python.org/3.6/">{% trans %}Python 3.6 (stable){% endtrans %}</a></li>
<li><a href="https://www.python.org/doc/versions/">{% trans %}Old versions{% endtrans %}</a></li>
</ul>
diff --git a/Doc/tutorial/interpreter.rst b/Doc/tutorial/interpreter.rst
index 3bd100d46a..bf7ce77641 100644
--- a/Doc/tutorial/interpreter.rst
+++ b/Doc/tutorial/interpreter.rst
@@ -10,13 +10,13 @@ Using the Python Interpreter
Invoking the Interpreter
========================
-The Python interpreter is usually installed as :file:`/usr/local/bin/python3.6`
+The Python interpreter is usually installed as :file:`/usr/local/bin/python3.7`
on those machines where it is available; putting :file:`/usr/local/bin` in your
Unix shell's search path makes it possible to start it by typing the command:
.. code-block:: text
- python3.6
+ python3.7
to the shell. [#]_ Since the choice of the directory where the interpreter lives
is an installation option, other places are possible; check with your local
@@ -98,8 +98,8 @@ before printing the first prompt:
.. code-block:: shell-session
- $ python3.6
- Python 3.6 (default, Sep 16 2015, 09:25:04)
+ $ python3.7
+ Python 3.7 (default, Sep 16 2015, 09:25:04)
[GCC 4.8.2] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>
diff --git a/Doc/tutorial/stdlib.rst b/Doc/tutorial/stdlib.rst
index 1dd06c2338..6ac29fc602 100644
--- a/Doc/tutorial/stdlib.rst
+++ b/Doc/tutorial/stdlib.rst
@@ -15,7 +15,7 @@ operating system::
>>> import os
>>> os.getcwd() # Return the current working directory
- 'C:\\Python36'
+ 'C:\\Python37'
>>> os.chdir('/server/accesslogs') # Change current working directory
>>> os.system('mkdir today') # Run the command mkdir in the system shell
0
diff --git a/Doc/tutorial/stdlib2.rst b/Doc/tutorial/stdlib2.rst
index bf02c71b6a..99472314ea 100644
--- a/Doc/tutorial/stdlib2.rst
+++ b/Doc/tutorial/stdlib2.rst
@@ -278,7 +278,7 @@ applications include caching objects that are expensive to create::
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
d['primary'] # entry was automatically removed
- File "C:/python36/lib/weakref.py", line 46, in __getitem__
+ File "C:/python37/lib/weakref.py", line 46, in __getitem__
o = self.data[key]()
KeyError: 'primary'
diff --git a/Doc/whatsnew/3.7.rst b/Doc/whatsnew/3.7.rst
new file mode 100644
index 0000000000..81ad4f9245
--- /dev/null
+++ b/Doc/whatsnew/3.7.rst
@@ -0,0 +1,190 @@
+****************************
+ What's New In Python 3.7
+****************************
+
+:Release: |release|
+:Date: |today|
+
+.. Rules for maintenance:
+
+ * Anyone can add text to this document. Do not spend very much time
+ on the wording of your changes, because your text will probably
+ get rewritten to some degree.
+
+ * The maintainer will go through Misc/NEWS periodically and add
+ changes; it's therefore more important to add your changes to
+ Misc/NEWS than to this file.
+
+ * This is not a complete list of every single change; completeness
+ is the purpose of Misc/NEWS. Some changes I consider too small
+ or esoteric to include. If such a change is added to the text,
+ I'll just remove it. (This is another reason you shouldn't spend
+ too much time on writing your addition.)
+
+ * If you want to draw your new text to the attention of the
+ maintainer, add 'XXX' to the beginning of the paragraph or
+ section.
+
+ * It's OK to just add a fragmentary note about a change. For
+ example: "XXX Describe the transmogrify() function added to the
+ socket module." The maintainer will research the change and
+ write the necessary text.
+
+ * You can comment out your additions if you like, but it's not
+ necessary (especially when a final release is some months away).
+
+ * Credit the author of a patch or bugfix. Just the name is
+ sufficient; the e-mail address isn't necessary.
+
+ * It's helpful to add the bug/patch number as a comment:
+
+ XXX Describe the transmogrify() function added to the socket
+ module.
+ (Contributed by P.Y. Developer in :issue:`12345`.)
+
+ This saves the maintainer the effort of going through the Mercurial log
+ when researching a change.
+
+This article explains the new features in Python 3.7, compared to 3.6.
+
+For full details, see the :ref:`changelog <changelog>`.
+
+.. note::
+
+ Prerelease users should be aware that this document is currently in draft
+ form. It will be updated substantially as Python 3.7 moves towards release,
+ so it's worth checking back even after reading earlier versions.
+
+
+Summary -- Release highlights
+=============================
+
+.. This section singles out the most important changes in Python 3.7.
+ Brevity is key.
+
+
+.. PEP-sized items next.
+
+
+
+New Features
+============
+
+
+
+Other Language Changes
+======================
+
+* More than 255 arguments can now be passed to a function, and a function can
+ now have more than 255 parameters.
+ (Contributed by Serhiy Storchaka in :issue:`12844` and :issue:`18896`.)
+
+* :meth:`bytes.fromhex` and :meth:`bytearray.fromhex` now ignore all ASCII
+ whitespace, not only spaces.
+ (Contributed by Robert Xiao in :issue:`28927`.)
+
+
+New Modules
+===========
+
+* None yet.
+
+
+Improved Modules
+================
+
+unittest.mock
+-------------
+
+The :const:`~unittest.mock.sentinel` attributes now preserve their identity
+when they are :mod:`copied <copy>` or :mod:`pickled <pickle>`.
+(Contributed by Serhiy Storchaka in :issue:`20804`.)
+
+
+Optimizations
+=============
+
+* Added two new opcodes: ``LOAD_METHOD`` and ``CALL_METHOD`` to avoid
+ instantiation of bound method objects for method calls, which results
+ in method calls being faster up to 20%.
+ (Contributed by Yury Selivanov and INADA Naoki in :issue:`26110`.)
+
+
+Build and C API Changes
+=======================
+
+* A full copy of libffi is no longer bundled for use when building the
+ :mod:`_ctypes <ctypes>` module on non-OSX UNIX platforms. An installed copy
+ of libffi is now required when building ``_ctypes`` on such platforms.
+ Contributed by Zachary Ware in :issue:`27979`.
+
+* The fields :c:member:`name` and :c:member:`doc` of structures
+ :c:type:`PyMemberDef`, :c:type:`PyGetSetDef`,
+ :c:type:`PyStructSequence_Field`, :c:type:`PyStructSequence_Desc`,
+ and :c:type:`wrapperbase` are now of type ``const char *`` rather of
+ ``char *``. (Contributed by Serhiy Storchaka in :issue:`28761`.)
+
+* The result of :c:func:`PyUnicode_AsUTF8AndSize` and :c:func:`PyUnicode_AsUTF8`
+ is now of type ``const char *`` rather of ``char *``.
+ (Contributed by Serhiy Storchaka in :issue:`28769`.)
+
+* Added functions :c:func:`PySlice_Unpack` and :c:func:`PySlice_AdjustIndices`.
+ (Contributed by Serhiy Storchaka in :issue:`27867`.)
+
+
+Deprecated
+==========
+
+- Function :c:func:`PySlice_GetIndicesEx` is deprecated and replaced with
+ a macro if ``Py_LIMITED_API`` is not set or set to the value between
+ ``0x03050400`` and ``0x03060000`` (not including) or ``0x03060100`` or
+ higher. (Contributed by Serhiy Storchaka in :issue:`27867`.)
+
+
+Removed
+=======
+
+API and Feature Removals
+------------------------
+
+* Unknown escapes consisting of ``'\'`` and an ASCII letter in replacement
+ templates for :func:`re.sub` were deprecated in Python 3.5, and will now
+ cause an error.
+
+* Removed support of the *exclude* argument in :meth:`tarfile.TarFile.add`.
+ It was deprecated in Python 2.7 and 3.2. Use the *filter* argument instead.
+
+* The ``splitunc()`` function in the :mod:`ntpath` module was deprecated in
+ Python 3.1, and has now been removed. Use the :func:`~os.path.splitdrive`
+ function instead.
+
+
+Porting to Python 3.7
+=====================
+
+This section lists previously described changes and other bugfixes
+that may require changes to your code.
+
+
+Changes in the Python API
+-------------------------
+
+* A format string argument for :meth:`string.Formatter.format`
+ is now :ref:`positional-only <positional-only_parameter>`.
+ Passing it as a keyword argument was deprecated in Python 3.5.
+ (Contributed by Serhiy Storchaka in :issue:`29193`.)
+
+* Attributes :attr:`~http.cookies.Morsel.key`,
+ :attr:`~http.cookies.Morsel.value` and
+ :attr:`~http.cookies.Morsel.coded_value` of class
+ :class:`http.cookies.Morsel` are now read-only.
+ Assigning to them was deprecated in Python 3.5.
+ Use the :meth:`~http.cookies.Morsel.set` method for setting them.
+ (Contributed by Serhiy Storchaka in :issue:`29192`.)
+
+
+CPython bytecode changes
+------------------------
+
+* Added two new opcodes: :opcode:`LOAD_METHOD` and :opcode:`CALL_METHOD`.
+ (Contributed by Yury Selivanov and INADA Naoki in :issue:`26110`.)
diff --git a/Doc/whatsnew/index.rst b/Doc/whatsnew/index.rst
index 7c9252401e..160b364a4b 100644
--- a/Doc/whatsnew/index.rst
+++ b/Doc/whatsnew/index.rst
@@ -11,6 +11,7 @@ anyone wishing to stay up-to-date after a new release.
.. toctree::
:maxdepth: 2
+ 3.7.rst
3.6.rst
3.5.rst
3.4.rst
diff --git a/Include/abstract.h b/Include/abstract.h
index 7d137a22bf..231e209b03 100644
--- a/Include/abstract.h
+++ b/Include/abstract.h
@@ -1,1355 +1,1076 @@
+/* Abstract Object Interface (many thanks to Jim Fulton) */
+
#ifndef Py_ABSTRACTOBJECT_H
#define Py_ABSTRACTOBJECT_H
#ifdef __cplusplus
extern "C" {
#endif
-#ifdef PY_SSIZE_T_CLEAN
-#define PyObject_CallFunction _PyObject_CallFunction_SizeT
-#define PyObject_CallMethod _PyObject_CallMethod_SizeT
-#ifndef Py_LIMITED_API
-#define _PyObject_CallMethodId _PyObject_CallMethodId_SizeT
-#endif /* !Py_LIMITED_API */
-#endif
+/* === Object Protocol ================================================== */
-/* Abstract Object Interface (many thanks to Jim Fulton) */
+/* Implemented elsewhere:
-/*
- PROPOSAL: A Generic Python Object Interface for Python C Modules
-
-Problem
-
- Python modules written in C that must access Python objects must do
- so through routines whose interfaces are described by a set of
- include files. Unfortunately, these routines vary according to the
- object accessed. To use these routines, the C programmer must check
- the type of the object being used and must call a routine based on
- the object type. For example, to access an element of a sequence,
- the programmer must determine whether the sequence is a list or a
- tuple:
-
- if(is_tupleobject(o))
- e=gettupleitem(o,i)
- else if(is_listitem(o))
- e=getlistitem(o,i)
-
- If the programmer wants to get an item from another type of object
- that provides sequence behavior, there is no clear way to do it
- correctly.
-
- The persistent programmer may peruse object.h and find that the
- _typeobject structure provides a means of invoking up to (currently
- about) 41 special operators. So, for example, a routine can get an
- item from any object that provides sequence behavior. However, to
- use this mechanism, the programmer must make their code dependent on
- the current Python implementation.
-
- Also, certain semantics, especially memory management semantics, may
- differ by the type of object being used. Unfortunately, these
- semantics are not clearly described in the current include files.
- An abstract interface providing more consistent semantics is needed.
-
-Proposal
-
- I propose the creation of a standard interface (with an associated
- library of routines and/or macros) for generically obtaining the
- services of Python objects. This proposal can be viewed as one
- components of a Python C interface consisting of several components.
+ int PyObject_Print(PyObject *o, FILE *fp, int flags);
- From the viewpoint of C access to Python services, we have (as
- suggested by Guido in off-line discussions):
+ Print an object 'o' on file 'fp'. Returns -1 on error. The flags argument
+ is used to enable certain printing options. The only option currently
+ supported is Py_Print_RAW.
- - "Very high level layer": two or three functions that let you exec or
- eval arbitrary Python code given as a string in a module whose name is
- given, passing C values in and getting C values out using
- mkvalue/getargs style format strings. This does not require the user
- to declare any variables of type "PyObject *". This should be enough
- to write a simple application that gets Python code from the user,
- execs it, and returns the output or errors. (Error handling must also
- be part of this API.)
+ (What should be said about Py_Print_RAW?). */
- - "Abstract objects layer": which is the subject of this proposal.
- It has many functions operating on objects, and lest you do many
- things from C that you can also write in Python, without going
- through the Python parser.
- - "Concrete objects layer": This is the public type-dependent
- interface provided by the standard built-in types, such as floats,
- strings, and lists. This interface exists and is currently
- documented by the collection of include files provided with the
- Python distributions.
+/* Implemented elsewhere:
- From the point of view of Python accessing services provided by C
- modules:
+ int PyObject_HasAttrString(PyObject *o, const char *attr_name);
- - "Python module interface": this interface consist of the basic
- routines used to define modules and their members. Most of the
- current extensions-writing guide deals with this interface.
+ Returns 1 if object 'o' has the attribute attr_name, and 0 otherwise.
- - "Built-in object interface": this is the interface that a new
- built-in type must provide and the mechanisms and rules that a
- developer of a new built-in type must use and follow.
+ This is equivalent to the Python expression: hasattr(o,attr_name).
- This proposal is a "first-cut" that is intended to spur
- discussion. See especially the lists of notes.
+ This function always succeeds. */
- The Python C object interface will provide four protocols: object,
- numeric, sequence, and mapping. Each protocol consists of a
- collection of related operations. If an operation that is not
- provided by a particular type is invoked, then a standard exception,
- NotImplementedError is raised with an operation name as an argument.
- In addition, for convenience this interface defines a set of
- constructors for building objects of built-in types. This is needed
- so new objects can be returned from C functions that otherwise treat
- objects generically.
-Memory Management
+/* Implemented elsewhere:
- For all of the functions described in this proposal, if a function
- retains a reference to a Python object passed as an argument, then the
- function will increase the reference count of the object. It is
- unnecessary for the caller to increase the reference count of an
- argument in anticipation of the object's retention.
+ PyObject* PyObject_GetAttrString(PyObject *o, const char *attr_name);
- All Python objects returned from functions should be treated as new
- objects. Functions that return objects assume that the caller will
- retain a reference and the reference count of the object has already
- been incremented to account for this fact. A caller that does not
- retain a reference to an object that is returned from a function
- must decrement the reference count of the object (using
- DECREF(object)) to prevent memory leaks.
+ Retrieve an attributed named attr_name form object o.
+ Returns the attribute value on success, or NULL on failure.
- Note that the behavior mentioned here is different from the current
- behavior for some objects (e.g. lists and tuples) when certain
- type-specific routines are called directly (e.g. setlistitem). The
- proposed abstraction layer will provide a consistent memory
- management interface, correcting for inconsistent behavior for some
- built-in types.
+ This is the equivalent of the Python expression: o.attr_name. */
-Protocols
-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
+/* Implemented elsewhere:
-/* Object Protocol: */
+ int PyObject_HasAttr(PyObject *o, PyObject *attr_name);
- /* Implemented elsewhere:
+ Returns 1 if o has the attribute attr_name, and 0 otherwise.
- int PyObject_Print(PyObject *o, FILE *fp, int flags);
+ This is equivalent to the Python expression: hasattr(o,attr_name).
- Print an object, o, on file, fp. Returns -1 on
- error. The flags argument is used to enable certain printing
- options. The only option currently supported is Py_Print_RAW.
+ This function always succeeds. */
- (What should be said about Py_Print_RAW?)
+/* Implemented elsewhere:
- */
+ PyObject* PyObject_GetAttr(PyObject *o, PyObject *attr_name);
- /* Implemented elsewhere:
+ Retrieve an attributed named 'attr_name' form object 'o'.
+ Returns the attribute value on success, or NULL on failure.
- int PyObject_HasAttrString(PyObject *o, const char *attr_name);
+ This is the equivalent of the Python expression: o.attr_name. */
- Returns 1 if o has the attribute attr_name, and 0 otherwise.
- This is equivalent to the Python expression:
- hasattr(o,attr_name).
- This function always succeeds.
+/* Implemented elsewhere:
- */
+ int PyObject_SetAttrString(PyObject *o, const char *attr_name, PyObject *v);
- /* Implemented elsewhere:
+ Set the value of the attribute named attr_name, for object 'o',
+ to the value 'v'. Raise an exception and return -1 on failure; return 0 on
+ success.
- PyObject* PyObject_GetAttrString(PyObject *o, const char *attr_name);
+ This is the equivalent of the Python statement o.attr_name=v. */
- Retrieve an attributed named attr_name form object o.
- Returns the attribute value on success, or NULL on failure.
- This is the equivalent of the Python expression: o.attr_name.
- */
+/* Implemented elsewhere:
- /* Implemented elsewhere:
+ int PyObject_SetAttr(PyObject *o, PyObject *attr_name, PyObject *v);
- int PyObject_HasAttr(PyObject *o, PyObject *attr_name);
+ Set the value of the attribute named attr_name, for object 'o', to the value
+ 'v'. an exception and return -1 on failure; return 0 on success.
- Returns 1 if o has the attribute attr_name, and 0 otherwise.
- This is equivalent to the Python expression:
- hasattr(o,attr_name).
+ This is the equivalent of the Python statement o.attr_name=v. */
- This function always succeeds.
+/* Implemented as a macro:
- */
+ int PyObject_DelAttrString(PyObject *o, const char *attr_name);
- /* Implemented elsewhere:
+ Delete attribute named attr_name, for object o. Returns
+ -1 on failure.
- PyObject* PyObject_GetAttr(PyObject *o, PyObject *attr_name);
+ This is the equivalent of the Python statement: del o.attr_name. */
+#define PyObject_DelAttrString(O,A) PyObject_SetAttrString((O),(A), NULL)
- Retrieve an attributed named attr_name form object o.
- Returns the attribute value on success, or NULL on failure.
- This is the equivalent of the Python expression: o.attr_name.
- */
+/* Implemented as a macro:
+ int PyObject_DelAttr(PyObject *o, PyObject *attr_name);
- /* Implemented elsewhere:
+ Delete attribute named attr_name, for object o. Returns -1
+ on failure. This is the equivalent of the Python
+ statement: del o.attr_name. */
+#define PyObject_DelAttr(O,A) PyObject_SetAttr((O),(A), NULL)
- int PyObject_SetAttrString(PyObject *o, const char *attr_name, PyObject *v);
- Set the value of the attribute named attr_name, for object o,
- to the value v. Raise an exception and return -1 on failure; return 0 on
- success. This is the equivalent of the Python statement o.attr_name=v.
+/* Implemented elsewhere:
- */
+ PyObject *PyObject_Repr(PyObject *o);
- /* Implemented elsewhere:
+ Compute the string representation of object 'o'. Returns the
+ string representation on success, NULL on failure.
- int PyObject_SetAttr(PyObject *o, PyObject *attr_name, PyObject *v);
+ This is the equivalent of the Python expression: repr(o).
- Set the value of the attribute named attr_name, for object o,
- to the value v. Raise an exception and return -1 on failure; return 0 on
- success. This is the equivalent of the Python statement o.attr_name=v.
+ Called by the repr() built-in function. */
- */
- /* implemented as a macro:
+/* Implemented elsewhere:
- int PyObject_DelAttrString(PyObject *o, const char *attr_name);
+ PyObject *PyObject_Str(PyObject *o);
- Delete attribute named attr_name, for object o. Returns
- -1 on failure. This is the equivalent of the Python
- statement: del o.attr_name.
+ Compute the string representation of object, o. Returns the
+ string representation on success, NULL on failure.
- */
-#define PyObject_DelAttrString(O,A) PyObject_SetAttrString((O),(A),NULL)
+ This is the equivalent of the Python expression: str(o).
- /* implemented as a macro:
+ Called by the str() and print() built-in functions. */
- int PyObject_DelAttr(PyObject *o, PyObject *attr_name);
- Delete attribute named attr_name, for object o. Returns -1
- on failure. This is the equivalent of the Python
- statement: del o.attr_name.
+/* Declared elsewhere
- */
-#define PyObject_DelAttr(O,A) PyObject_SetAttr((O),(A),NULL)
+ PyAPI_FUNC(int) PyCallable_Check(PyObject *o);
- /* Implemented elsewhere:
+ Determine if the object, o, is callable. Return 1 if the object is callable
+ and 0 otherwise.
- PyObject *PyObject_Repr(PyObject *o);
+ This function always succeeds. */
- Compute the string representation of object, o. Returns the
- string representation on success, NULL on failure. This is
- the equivalent of the Python expression: repr(o).
- Called by the repr() built-in function.
+#ifdef PY_SSIZE_T_CLEAN
+# define PyObject_CallFunction _PyObject_CallFunction_SizeT
+# define PyObject_CallMethod _PyObject_CallMethod_SizeT
+# ifndef Py_LIMITED_API
+# define _PyObject_CallMethodId _PyObject_CallMethodId_SizeT
+# endif /* !Py_LIMITED_API */
+#endif
- */
- /* Implemented elsewhere:
+/* Call a callable Python object 'callable' with arguments given by the
+ tuple 'args' and keywords arguments given by the dictionary 'kwargs'.
- PyObject *PyObject_Str(PyObject *o);
+ 'args' must not be *NULL*, use an empty tuple if no arguments are
+ needed. If no named arguments are needed, 'kwargs' can be NULL.
- Compute the string representation of object, o. Returns the
- string representation on success, NULL on failure. This is
- the equivalent of the Python expression: str(o).)
+ This is the equivalent of the Python expression:
+ callable(*args, **kwargs). */
+PyAPI_FUNC(PyObject *) PyObject_Call(PyObject *callable,
+ PyObject *args, PyObject *kwargs);
- Called by the str() and print() built-in functions.
+#ifndef Py_LIMITED_API
+PyAPI_FUNC(PyObject*) _PyStack_AsTuple(
+ PyObject **stack,
+ Py_ssize_t nargs);
+
+PyAPI_FUNC(PyObject*) _PyStack_AsTupleSlice(
+ PyObject **stack,
+ Py_ssize_t nargs,
+ Py_ssize_t start,
+ Py_ssize_t end);
+
+/* Convert keyword arguments from the FASTCALL (stack: C array, kwnames: tuple)
+ format to a Python dictionary ("kwargs" dict).
+
+ The type of kwnames keys is not checked. The final function getting
+ arguments is reponsible to check if all keys are strings, for example using
+ PyArg_ParseTupleAndKeywords() or PyArg_ValidateKeywordArguments().
+
+ Duplicate keys are merged using the last value. If duplicate keys must raise
+ an exception, the caller is responsible to implement an explicit keys on
+ kwnames. */
+PyAPI_FUNC(PyObject *) _PyStack_AsDict(
+ PyObject **values,
+ PyObject *kwnames);
+
+/* Convert (args, nargs, kwargs: dict) into a (stack, nargs, kwnames: tuple).
+
+ Return 0 on success, raise an exception and return -1 on error.
+
+ Write the new stack into *p_stack. If *p_stack is differen than args, it
+ must be released by PyMem_Free().
+
+ The stack uses borrowed references.
+
+ The type of keyword keys is not checked, these checks should be done
+ later (ex: _PyArg_ParseStackAndKeywords). */
+PyAPI_FUNC(int) _PyStack_UnpackDict(
+ PyObject **args,
+ Py_ssize_t nargs,
+ PyObject *kwargs,
+ PyObject ***p_stack,
+ PyObject **p_kwnames);
+
+/* Suggested size (number of positional arguments) for arrays of PyObject*
+ allocated on a C stack to avoid allocating memory on the heap memory. Such
+ array is used to pass positional arguments to call functions of the
+ _PyObject_FastCall() family.
+
+ The size is chosen to not abuse the C stack and so limit the risk of stack
+ overflow. The size is also chosen to allow using the small stack for most
+ function calls of the Python standard library. On 64-bit CPU, it allocates
+ 40 bytes on the stack. */
+#define _PY_FASTCALL_SMALL_STACK 5
+
+/* Call the callable object 'callable' with the "fast call" calling convention:
+ args is a C array for positional arguments (nargs is the number of
+ positional arguments), kwargs is a dictionary for keyword arguments.
+
+ If nargs is equal to zero, args can be NULL. kwargs can be NULL.
+ nargs must be greater or equal to zero.
+
+ Return the result on success. Raise an exception on return NULL on
+ error. */
+PyAPI_FUNC(PyObject *) _PyObject_FastCallDict(
+ PyObject *callable,
+ PyObject **args,
+ Py_ssize_t nargs,
+ PyObject *kwargs);
+
+/* Call the callable object 'callable' with the "fast call" calling convention:
+ args is a C array for positional arguments followed by values of
+ keyword arguments. Keys of keyword arguments are stored as a tuple
+ of strings in kwnames. nargs is the number of positional parameters at
+ the beginning of stack. The size of kwnames gives the number of keyword
+ values in the stack after positional arguments.
+
+ kwnames must only contains str strings, no subclass, and all keys must
+ be unique.
+
+ If nargs is equal to zero and there is no keyword argument (kwnames is
+ NULL or its size is zero), args can be NULL.
+
+ Return the result on success. Raise an exception and return NULL on
+ error. */
+PyAPI_FUNC(PyObject *) _PyObject_FastCallKeywords(
+ PyObject *callable,
+ PyObject **args,
+ Py_ssize_t nargs,
+ PyObject *kwnames);
- */
+#define _PyObject_FastCall(func, args, nargs) \
+ _PyObject_FastCallDict((func), (args), (nargs), NULL)
- /* Declared elsewhere
+#define _PyObject_CallNoArg(func) \
+ _PyObject_FastCallDict((func), NULL, 0, NULL)
- PyAPI_FUNC(int) PyCallable_Check(PyObject *o);
+PyAPI_FUNC(PyObject *) _PyObject_Call_Prepend(
+ PyObject *callable,
+ PyObject *obj,
+ PyObject *args,
+ PyObject *kwargs);
- Determine if the object, o, is callable. Return 1 if the
- object is callable and 0 otherwise.
+PyAPI_FUNC(PyObject *) _Py_CheckFunctionResult(PyObject *callable,
+ PyObject *result,
+ const char *where);
+#endif /* Py_LIMITED_API */
- This function always succeeds.
- */
- PyAPI_FUNC(PyObject *) PyObject_Call(PyObject *callable_object,
- PyObject *args, PyObject *kwargs);
+/* Call a callable Python object 'callable', with arguments given by the
+ tuple 'args'. If no arguments are needed, then 'args' can be *NULL*.
- /*
- Call a callable Python object, callable_object, with
- arguments and keywords arguments. The 'args' argument can not be
- NULL.
- */
+ Returns the result of the call on success, or *NULL* on failure.
-#ifndef Py_LIMITED_API
- PyAPI_FUNC(PyObject*) _PyStack_AsTuple(
- PyObject **stack,
- Py_ssize_t nargs);
-
- /* Convert keyword arguments from the (stack, kwnames) format to a Python
- dictionary.
-
- kwnames must only contains str strings, no subclass, and all keys must
- be unique. kwnames is not checked, usually these checks are done before or later
- calling _PyStack_AsDict(). For example, _PyArg_ParseStack() raises an
- error if a key is not a string. */
- PyAPI_FUNC(PyObject *) _PyStack_AsDict(
- PyObject **values,
- PyObject *kwnames);
-
- /* Convert (args, nargs, kwargs) into a (stack, nargs, kwnames).
-
- Return a new stack which should be released by PyMem_Free(), or return
- args unchanged if kwargs is NULL or an empty dictionary.
-
- The stack uses borrowed references.
-
- The type of keyword keys is not checked, these checks should be done
- later (ex: _PyArg_ParseStack). */
- PyAPI_FUNC(PyObject **) _PyStack_UnpackDict(
- PyObject **args,
- Py_ssize_t nargs,
- PyObject *kwargs,
- PyObject **kwnames,
- PyObject *func);
-
- /* Call the callable object func with the "fast call" calling convention:
- args is a C array for positional arguments (nargs is the number of
- positional arguments), kwargs is a dictionary for keyword arguments.
-
- If nargs is equal to zero, args can be NULL. kwargs can be NULL.
- nargs must be greater or equal to zero.
-
- Return the result on success. Raise an exception on return NULL on
- error. */
- PyAPI_FUNC(PyObject *) _PyObject_FastCallDict(PyObject *func,
- PyObject **args, Py_ssize_t nargs,
- PyObject *kwargs);
-
- /* Call the callable object func with the "fast call" calling convention:
- args is a C array for positional arguments followed by values of
- keyword arguments. Keys of keyword arguments are stored as a tuple
- of strings in kwnames. nargs is the number of positional parameters at
- the beginning of stack. The size of kwnames gives the number of keyword
- values in the stack after positional arguments.
-
- kwnames must only contains str strings, no subclass, and all keys must
- be unique.
-
- If nargs is equal to zero and there is no keyword argument (kwnames is
- NULL or its size is zero), args can be NULL.
-
- Return the result on success. Raise an exception and return NULL on
- error. */
- PyAPI_FUNC(PyObject *) _PyObject_FastCallKeywords
- (PyObject *func,
- PyObject **args,
- Py_ssize_t nargs,
- PyObject *kwnames);
+ This is the equivalent of the Python expression:
+ callable(*args). */
+PyAPI_FUNC(PyObject *) PyObject_CallObject(PyObject *callable,
+ PyObject *args);
-#define _PyObject_FastCall(func, args, nargs) \
- _PyObject_FastCallDict((func), (args), (nargs), NULL)
+/* Call a callable Python object, callable, with a variable number of C
+ arguments. The C arguments are described using a mkvalue-style format
+ string.
-#define _PyObject_CallNoArg(func) \
- _PyObject_FastCall((func), NULL, 0)
+ The format may be NULL, indicating that no arguments are provided.
-#define _PyObject_CallArg1(func, arg) \
- _PyObject_FastCall((func), &(arg), 1)
+ Returns the result of the call on success, or NULL on failure.
- PyAPI_FUNC(PyObject *) _PyObject_Call_Prepend(PyObject *func,
- PyObject *obj, PyObject *args,
- PyObject *kwargs);
+ This is the equivalent of the Python expression:
+ callable(arg1, arg2, ...). */
+PyAPI_FUNC(PyObject *) PyObject_CallFunction(PyObject *callable,
+ const char *format, ...);
- PyAPI_FUNC(PyObject *) _Py_CheckFunctionResult(PyObject *func,
- PyObject *result,
- const char *where);
-#endif /* Py_LIMITED_API */
+/* Call the method named 'name' of object 'obj' with a variable number of
+ C arguments. The C arguments are described by a mkvalue format string.
+
+ The format can be NULL, indicating that no arguments are provided.
+
+ Returns the result of the call on success, or NULL on failure.
- PyAPI_FUNC(PyObject *) PyObject_CallObject(PyObject *callable_object,
- PyObject *args);
-
- /*
- Call a callable Python object, callable_object, with
- arguments given by the tuple, args. If no arguments are
- needed, then args may be NULL. Returns the result of the
- call on success, or NULL on failure. This is the equivalent
- of the Python expression: o(*args).
- */
-
- PyAPI_FUNC(PyObject *) PyObject_CallFunction(PyObject *callable_object,
- const char *format, ...);
-
- /*
- Call a callable Python object, callable_object, with a
- variable number of C arguments. The C arguments are described
- using a mkvalue-style format string. The format may be NULL,
- indicating that no arguments are provided. Returns the
- result of the call on success, or NULL on failure. This is
- the equivalent of the Python expression: o(*args).
- */
-
-
- PyAPI_FUNC(PyObject *) PyObject_CallMethod(PyObject *o,
- const char *method,
- const char *format, ...);
-
- /*
- Call the method named m of object o with a variable number of
- C arguments. The C arguments are described by a mkvalue
- format string. The format may be NULL, indicating that no
- arguments are provided. Returns the result of the call on
- success, or NULL on failure. This is the equivalent of the
- Python expression: o.method(args).
- */
+ This is the equivalent of the Python expression:
+ obj.name(arg1, arg2, ...). */
+PyAPI_FUNC(PyObject *) PyObject_CallMethod(PyObject *obj,
+ const char *name,
+ const char *format, ...);
#ifndef Py_LIMITED_API
- PyAPI_FUNC(PyObject *) _PyObject_CallMethodId(PyObject *o,
- _Py_Identifier *method,
- const char *format, ...);
-
- /*
- Like PyObject_CallMethod, but expect a _Py_Identifier* as the
- method name.
- */
+/* Like PyObject_CallMethod(), but expect a _Py_Identifier*
+ as the method name. */
+PyAPI_FUNC(PyObject *) _PyObject_CallMethodId(PyObject *obj,
+ _Py_Identifier *name,
+ const char *format, ...);
#endif /* !Py_LIMITED_API */
- PyAPI_FUNC(PyObject *) _PyObject_CallFunction_SizeT(PyObject *callable,
- const char *format,
- ...);
- PyAPI_FUNC(PyObject *) _PyObject_CallMethod_SizeT(PyObject *o,
- const char *name,
- const char *format,
- ...);
+PyAPI_FUNC(PyObject *) _PyObject_CallFunction_SizeT(PyObject *callable,
+ const char *format,
+ ...);
+
+PyAPI_FUNC(PyObject *) _PyObject_CallMethod_SizeT(PyObject *obj,
+ const char *name,
+ const char *format,
+ ...);
+
#ifndef Py_LIMITED_API
- PyAPI_FUNC(PyObject *) _PyObject_CallMethodId_SizeT(PyObject *o,
- _Py_Identifier *name,
- const char *format,
- ...);
+PyAPI_FUNC(PyObject *) _PyObject_CallMethodId_SizeT(PyObject *obj,
+ _Py_Identifier *name,
+ const char *format,
+ ...);
#endif /* !Py_LIMITED_API */
- PyAPI_FUNC(PyObject *) PyObject_CallFunctionObjArgs(PyObject *callable,
- ...);
+/* Call a callable Python object 'callable' with a variable number of C
+ arguments. The C arguments are provided as PyObject* values, terminated
+ by a NULL.
+
+ Returns the result of the call on success, or NULL on failure.
+
+ This is the equivalent of the Python expression:
+ callable(arg1, arg2, ...). */
+PyAPI_FUNC(PyObject *) PyObject_CallFunctionObjArgs(PyObject *callable,
+ ...);
+
+/* Call the method named 'name' of object 'obj' with a variable number of
+ C arguments. The C arguments are provided as PyObject* values, terminated
+ by NULL.
+
+ Returns the result of the call on success, or NULL on failure.
- /*
- Call a callable Python object, callable_object, with a
- variable number of C arguments. The C arguments are provided
- as PyObject * values, terminated by a NULL. Returns the
- result of the call on success, or NULL on failure. This is
- the equivalent of the Python expression: o(*args).
- */
+ This is the equivalent of the Python expression: obj.name(*args). */
+PyAPI_FUNC(PyObject *) PyObject_CallMethodObjArgs(
+ PyObject *obj,
+ PyObject *name,
+ ...);
- PyAPI_FUNC(PyObject *) PyObject_CallMethodObjArgs(PyObject *o,
- PyObject *method, ...);
#ifndef Py_LIMITED_API
- PyAPI_FUNC(PyObject *) _PyObject_CallMethodIdObjArgs(PyObject *o,
- struct _Py_Identifier *method,
- ...);
+PyAPI_FUNC(PyObject *) _PyObject_CallMethodIdObjArgs(
+ PyObject *obj,
+ struct _Py_Identifier *name,
+ ...);
#endif /* !Py_LIMITED_API */
- /*
- Call the method named m of object o with a variable number of
- C arguments. The C arguments are provided as PyObject *
- values, terminated by NULL. Returns the result of the call
- on success, or NULL on failure. This is the equivalent of
- the Python expression: o.method(args).
- */
+/* Implemented elsewhere:
+
+ long PyObject_Hash(PyObject *o);
+
+ Compute and return the hash, hash_value, of an object, o. On
+ failure, return -1.
+
+ This is the equivalent of the Python expression: hash(o). */
+
+
+/* Implemented elsewhere:
+
+ int PyObject_IsTrue(PyObject *o);
+
+ Returns 1 if the object, o, is considered to be true, 0 if o is
+ considered to be false and -1 on failure.
+
+ This is equivalent to the Python expression: not not o. */
- /* Implemented elsewhere:
- long PyObject_Hash(PyObject *o);
+/* Implemented elsewhere:
- Compute and return the hash, hash_value, of an object, o. On
- failure, return -1. This is the equivalent of the Python
- expression: hash(o).
- */
+ int PyObject_Not(PyObject *o);
+ Returns 0 if the object, o, is considered to be true, 1 if o is
+ considered to be false and -1 on failure.
- /* Implemented elsewhere:
+ This is equivalent to the Python expression: not o. */
- int PyObject_IsTrue(PyObject *o);
- Returns 1 if the object, o, is considered to be true, 0 if o is
- considered to be false and -1 on failure. This is equivalent to the
- Python expression: not not o
- */
+/* Get the type of an object.
- /* Implemented elsewhere:
+ On success, returns a type object corresponding to the object type of object
+ 'o'. On failure, returns NULL.
- int PyObject_Not(PyObject *o);
+ This is equivalent to the Python expression: type(o) */
+PyAPI_FUNC(PyObject *) PyObject_Type(PyObject *o);
- Returns 0 if the object, o, is considered to be true, 1 if o is
- considered to be false and -1 on failure. This is equivalent to the
- Python expression: not o
- */
- PyAPI_FUNC(PyObject *) PyObject_Type(PyObject *o);
+/* Return the size of object 'o'. If the object 'o' provides both sequence and
+ mapping protocols, the sequence size is returned.
- /*
- On success, returns a type object corresponding to the object
- type of object o. On failure, returns NULL. This is
- equivalent to the Python expression: type(o).
- */
+ On error, -1 is returned.
- PyAPI_FUNC(Py_ssize_t) PyObject_Size(PyObject *o);
+ This is the equivalent to the Python expression: len(o) */
+PyAPI_FUNC(Py_ssize_t) PyObject_Size(PyObject *o);
- /*
- Return the size of object o. If the object, o, provides
- both sequence and mapping protocols, the sequence size is
- returned. On error, -1 is returned. This is the equivalent
- to the Python expression: len(o).
- */
- /* For DLL compatibility */
+/* For DLL compatibility */
#undef PyObject_Length
- PyAPI_FUNC(Py_ssize_t) PyObject_Length(PyObject *o);
+PyAPI_FUNC(Py_ssize_t) PyObject_Length(PyObject *o);
#define PyObject_Length PyObject_Size
+
#ifndef Py_LIMITED_API
- PyAPI_FUNC(int) _PyObject_HasLen(PyObject *o);
- PyAPI_FUNC(Py_ssize_t) PyObject_LengthHint(PyObject *o, Py_ssize_t);
+PyAPI_FUNC(int) _PyObject_HasLen(PyObject *o);
+
+/* Guess the size of object 'o' using len(o) or o.__length_hint__().
+ If neither of those return a non-negative value, then return the default
+ value. If one of the calls fails, this function returns -1. */
+PyAPI_FUNC(Py_ssize_t) PyObject_LengthHint(PyObject *o, Py_ssize_t);
#endif
- /*
- Guess the size of object o using len(o) or o.__length_hint__().
- If neither of those return a non-negative value, then return the
- default value. If one of the calls fails, this function returns -1.
- */
-
- PyAPI_FUNC(PyObject *) PyObject_GetItem(PyObject *o, PyObject *key);
-
- /*
- Return element of o corresponding to the object, key, or NULL
- on failure. This is the equivalent of the Python expression:
- o[key].
- */
-
- PyAPI_FUNC(int) PyObject_SetItem(PyObject *o, PyObject *key, PyObject *v);
-
- /*
- Map the object key to the value v. Raise an exception and return -1
- on failure; return 0 on success. This is the equivalent of the Python
- statement o[key]=v.
- */
-
- PyAPI_FUNC(int) PyObject_DelItemString(PyObject *o, const char *key);
-
- /*
- Remove the mapping for object, key, from the object *o.
- Returns -1 on failure. This is equivalent to
- the Python statement: del o[key].
- */
-
- PyAPI_FUNC(int) PyObject_DelItem(PyObject *o, PyObject *key);
-
- /*
- Delete the mapping for key from *o. Returns -1 on failure.
- This is the equivalent of the Python statement: del o[key].
- */
-
- /* old buffer API
- FIXME: usage of these should all be replaced in Python itself
- but for backwards compatibility we will implement them.
- Their usage without a corresponding "unlock" mechanism
- may create issues (but they would already be there). */
-
- PyAPI_FUNC(int) PyObject_AsCharBuffer(PyObject *obj,
- const char **buffer,
- Py_ssize_t *buffer_len);
-
- /*
- Takes an arbitrary object which must support the (character,
- single segment) buffer interface and returns a pointer to a
- read-only memory location useable as character based input
- for subsequent processing.
-
- 0 is returned on success. buffer and buffer_len are only
- set in case no error occurs. Otherwise, -1 is returned and
- an exception set.
- */
-
- PyAPI_FUNC(int) PyObject_CheckReadBuffer(PyObject *obj);
-
- /*
- Checks whether an arbitrary object supports the (character,
- single segment) buffer interface. Returns 1 on success, 0
- on failure.
- */
-
- PyAPI_FUNC(int) PyObject_AsReadBuffer(PyObject *obj,
- const void **buffer,
- Py_ssize_t *buffer_len);
-
- /*
- Same as PyObject_AsCharBuffer() except that this API expects
- (readable, single segment) buffer interface and returns a
- pointer to a read-only memory location which can contain
- arbitrary data.
-
- 0 is returned on success. buffer and buffer_len are only
- set in case no error occurs. Otherwise, -1 is returned and
- an exception set.
- */
-
- PyAPI_FUNC(int) PyObject_AsWriteBuffer(PyObject *obj,
- void **buffer,
- Py_ssize_t *buffer_len);
-
- /*
- Takes an arbitrary object which must support the (writable,
- single segment) buffer interface and returns a pointer to a
- writable memory location in buffer of size buffer_len.
-
- 0 is returned on success. buffer and buffer_len are only
- set in case no error occurs. Otherwise, -1 is returned and
- an exception set.
- */
-
- /* new buffer API */
+/* Return element of 'o' corresponding to the object 'key'. Return NULL
+ on failure.
-#ifndef Py_LIMITED_API
-#define PyObject_CheckBuffer(obj) \
- (((obj)->ob_type->tp_as_buffer != NULL) && \
- ((obj)->ob_type->tp_as_buffer->bf_getbuffer != NULL))
-
- /* Return 1 if the getbuffer function is available, otherwise
- return 0 */
+ This is the equivalent of the Python expression: o[key] */
+PyAPI_FUNC(PyObject *) PyObject_GetItem(PyObject *o, PyObject *key);
- PyAPI_FUNC(int) PyObject_GetBuffer(PyObject *obj, Py_buffer *view,
- int flags);
- /* This is a C-API version of the getbuffer function call. It checks
- to make sure object has the required function pointer and issues the
- call. Returns -1 and raises an error on failure and returns 0 on
- success
- */
+/* Map the object 'key' to the value 'v' into 'o'.
+ Raise an exception and return -1 on failure; return 0 on success.
- PyAPI_FUNC(void *) PyBuffer_GetPointer(Py_buffer *view, Py_ssize_t *indices);
+ This is the equivalent of the Python statement: o[key]=v. */
+PyAPI_FUNC(int) PyObject_SetItem(PyObject *o, PyObject *key, PyObject *v);
- /* Get the memory area pointed to by the indices for the buffer given.
- Note that view->ndim is the assumed size of indices
- */
+/* Remove the mapping for object, key, from the object 'o'.
+ Returns -1 on failure.
- PyAPI_FUNC(int) PyBuffer_SizeFromFormat(const char *);
+ This is equivalent to the Python statement: del o[key]. */
+PyAPI_FUNC(int) PyObject_DelItemString(PyObject *o, const char *key);
- /* Return the implied itemsize of the data-format area from a
- struct-style description */
+/* Delete the mapping for key from object 'o'. Returns -1 on failure.
+ This is the equivalent of the Python statement: del o[key]. */
+PyAPI_FUNC(int) PyObject_DelItem(PyObject *o, PyObject *key);
- /* Implementation in memoryobject.c */
- PyAPI_FUNC(int) PyBuffer_ToContiguous(void *buf, Py_buffer *view,
- Py_ssize_t len, char order);
+/* === Old Buffer API ============================================ */
- PyAPI_FUNC(int) PyBuffer_FromContiguous(Py_buffer *view, void *buf,
- Py_ssize_t len, char order);
+/* FIXME: usage of these should all be replaced in Python itself
+ but for backwards compatibility we will implement them.
+ Their usage without a corresponding "unlock" mechanism
+ may create issues (but they would already be there). */
+/* Takes an arbitrary object which must support the (character, single segment)
+ buffer interface and returns a pointer to a read-only memory location
+ useable as character based input for subsequent processing.
- /* Copy len bytes of data from the contiguous chunk of memory
- pointed to by buf into the buffer exported by obj. Return
- 0 on success and return -1 and raise a PyBuffer_Error on
- error (i.e. the object does not have a buffer interface or
- it is not working).
+ Return 0 on success. buffer and buffer_len are only set in case no error
+ occurs. Otherwise, -1 is returned and an exception set. */
+PyAPI_FUNC(int) PyObject_AsCharBuffer(PyObject *obj,
+ const char **buffer,
+ Py_ssize_t *buffer_len)
+ Py_DEPRECATED(3.0);
- If fort is 'F', then if the object is multi-dimensional,
- then the data will be copied into the array in
- Fortran-style (first dimension varies the fastest). If
- fort is 'C', then the data will be copied into the array
- in C-style (last dimension varies the fastest). If fort
- is 'A', then it does not matter and the copy will be made
- in whatever way is more efficient.
+/* Checks whether an arbitrary object supports the (character, single segment)
+ buffer interface.
- */
+ Returns 1 on success, 0 on failure. */
+PyAPI_FUNC(int) PyObject_CheckReadBuffer(PyObject *obj)
+ Py_DEPRECATED(3.0);
- PyAPI_FUNC(int) PyObject_CopyData(PyObject *dest, PyObject *src);
+/* Same as PyObject_AsCharBuffer() except that this API expects (readable,
+ single segment) buffer interface and returns a pointer to a read-only memory
+ location which can contain arbitrary data.
- /* Copy the data from the src buffer to the buffer of destination
- */
+ 0 is returned on success. buffer and buffer_len are only set in case no
+ error occurs. Otherwise, -1 is returned and an exception set. */
+PyAPI_FUNC(int) PyObject_AsReadBuffer(PyObject *obj,
+ const void **buffer,
+ Py_ssize_t *buffer_len)
+ Py_DEPRECATED(3.0);
- PyAPI_FUNC(int) PyBuffer_IsContiguous(const Py_buffer *view, char fort);
+/* Takes an arbitrary object which must support the (writable, single segment)
+ buffer interface and returns a pointer to a writable memory location in
+ buffer of size 'buffer_len'.
+ Return 0 on success. buffer and buffer_len are only set in case no error
+ occurs. Otherwise, -1 is returned and an exception set. */
+PyAPI_FUNC(int) PyObject_AsWriteBuffer(PyObject *obj,
+ void **buffer,
+ Py_ssize_t *buffer_len)
+ Py_DEPRECATED(3.0);
- PyAPI_FUNC(void) PyBuffer_FillContiguousStrides(int ndims,
- Py_ssize_t *shape,
- Py_ssize_t *strides,
- int itemsize,
- char fort);
- /* Fill the strides array with byte-strides of a contiguous
- (Fortran-style if fort is 'F' or C-style otherwise)
- array of the given shape with the given number of bytes
- per element.
- */
+/* === New Buffer API ============================================ */
- PyAPI_FUNC(int) PyBuffer_FillInfo(Py_buffer *view, PyObject *o, void *buf,
- Py_ssize_t len, int readonly,
- int flags);
+#ifndef Py_LIMITED_API
- /* Fills in a buffer-info structure correctly for an exporter
- that can only share a contiguous chunk of memory of
- "unsigned bytes" of the given length. Returns 0 on success
- and -1 (with raising an error) on error.
- */
+/* Return 1 if the getbuffer function is available, otherwise return 0. */
+#define PyObject_CheckBuffer(obj) \
+ (((obj)->ob_type->tp_as_buffer != NULL) && \
+ ((obj)->ob_type->tp_as_buffer->bf_getbuffer != NULL))
- PyAPI_FUNC(void) PyBuffer_Release(Py_buffer *view);
+/* This is a C-API version of the getbuffer function call. It checks
+ to make sure object has the required function pointer and issues the
+ call.
+
+ Returns -1 and raises an error on failure and returns 0 on success. */
+PyAPI_FUNC(int) PyObject_GetBuffer(PyObject *obj, Py_buffer *view,
+ int flags);
+
+/* Get the memory area pointed to by the indices for the buffer given.
+ Note that view->ndim is the assumed size of indices. */
+PyAPI_FUNC(void *) PyBuffer_GetPointer(Py_buffer *view, Py_ssize_t *indices);
+
+/* Return the implied itemsize of the data-format area from a
+ struct-style description. */
+PyAPI_FUNC(int) PyBuffer_SizeFromFormat(const char *);
+
+/* Implementation in memoryobject.c */
+PyAPI_FUNC(int) PyBuffer_ToContiguous(void *buf, Py_buffer *view,
+ Py_ssize_t len, char order);
+
+PyAPI_FUNC(int) PyBuffer_FromContiguous(Py_buffer *view, void *buf,
+ Py_ssize_t len, char order);
+
+/* Copy len bytes of data from the contiguous chunk of memory
+ pointed to by buf into the buffer exported by obj. Return
+ 0 on success and return -1 and raise a PyBuffer_Error on
+ error (i.e. the object does not have a buffer interface or
+ it is not working).
+
+ If fort is 'F', then if the object is multi-dimensional,
+ then the data will be copied into the array in
+ Fortran-style (first dimension varies the fastest). If
+ fort is 'C', then the data will be copied into the array
+ in C-style (last dimension varies the fastest). If fort
+ is 'A', then it does not matter and the copy will be made
+ in whatever way is more efficient. */
+PyAPI_FUNC(int) PyObject_CopyData(PyObject *dest, PyObject *src);
+
+/* Copy the data from the src buffer to the buffer of destination. */
+PyAPI_FUNC(int) PyBuffer_IsContiguous(const Py_buffer *view, char fort);
+
+/*Fill the strides array with byte-strides of a contiguous
+ (Fortran-style if fort is 'F' or C-style otherwise)
+ array of the given shape with the given number of bytes
+ per element. */
+PyAPI_FUNC(void) PyBuffer_FillContiguousStrides(int ndims,
+ Py_ssize_t *shape,
+ Py_ssize_t *strides,
+ int itemsize,
+ char fort);
+
+/* Fills in a buffer-info structure correctly for an exporter
+ that can only share a contiguous chunk of memory of
+ "unsigned bytes" of the given length.
+
+ Returns 0 on success and -1 (with raising an error) on error. */
+PyAPI_FUNC(int) PyBuffer_FillInfo(Py_buffer *view, PyObject *o, void *buf,
+ Py_ssize_t len, int readonly,
+ int flags);
+
+/* Releases a Py_buffer obtained from getbuffer ParseTuple's "s*". */
+PyAPI_FUNC(void) PyBuffer_Release(Py_buffer *view);
- /* Releases a Py_buffer obtained from getbuffer ParseTuple's s*.
- */
#endif /* Py_LIMITED_API */
- PyAPI_FUNC(PyObject *) PyObject_Format(PyObject* obj,
- PyObject *format_spec);
- /*
- Takes an arbitrary object and returns the result of
- calling obj.__format__(format_spec).
- */
+/* Takes an arbitrary object and returns the result of calling
+ obj.__format__(format_spec). */
+PyAPI_FUNC(PyObject *) PyObject_Format(PyObject *obj,
+ PyObject *format_spec);
-/* Iterators */
- PyAPI_FUNC(PyObject *) PyObject_GetIter(PyObject *);
- /* Takes an object and returns an iterator for it.
- This is typically a new iterator but if the argument
- is an iterator, this returns itself. */
+/* ==== Iterators ================================================ */
+
+/* Takes an object and returns an iterator for it.
+ This is typically a new iterator but if the argument is an iterator, this
+ returns itself. */
+PyAPI_FUNC(PyObject *) PyObject_GetIter(PyObject *);
#define PyIter_Check(obj) \
((obj)->ob_type->tp_iternext != NULL && \
(obj)->ob_type->tp_iternext != &_PyObject_NextNotImplemented)
- PyAPI_FUNC(PyObject *) PyIter_Next(PyObject *);
- /* Takes an iterator object and calls its tp_iternext slot,
- returning the next value. If the iterator is exhausted,
- this returns NULL without setting an exception.
- NULL with an exception means an error occurred. */
+/* Takes an iterator object and calls its tp_iternext slot,
+ returning the next value.
-/* Number Protocol:*/
+ If the iterator is exhausted, this returns NULL without setting an
+ exception.
- PyAPI_FUNC(int) PyNumber_Check(PyObject *o);
+ NULL with an exception means an error occurred. */
+PyAPI_FUNC(PyObject *) PyIter_Next(PyObject *);
- /*
- Returns 1 if the object, o, provides numeric protocols, and
- false otherwise.
- This function always succeeds.
- */
+/* === Number Protocol ================================================== */
- PyAPI_FUNC(PyObject *) PyNumber_Add(PyObject *o1, PyObject *o2);
+/* Returns 1 if the object 'o' provides numeric protocols, and 0 otherwise.
- /*
- Returns the result of adding o1 and o2, or null on failure.
- This is the equivalent of the Python expression: o1+o2.
- */
+ This function always succeeds. */
+PyAPI_FUNC(int) PyNumber_Check(PyObject *o);
- PyAPI_FUNC(PyObject *) PyNumber_Subtract(PyObject *o1, PyObject *o2);
+/* Returns the result of adding o1 and o2, or NULL on failure.
- /*
- Returns the result of subtracting o2 from o1, or null on
- failure. This is the equivalent of the Python expression:
- o1-o2.
- */
+ This is the equivalent of the Python expression: o1 + o2. */
+PyAPI_FUNC(PyObject *) PyNumber_Add(PyObject *o1, PyObject *o2);
- PyAPI_FUNC(PyObject *) PyNumber_Multiply(PyObject *o1, PyObject *o2);
+/* Returns the result of subtracting o2 from o1, or NULL on failure.
- /*
- Returns the result of multiplying o1 and o2, or null on
- failure. This is the equivalent of the Python expression:
- o1*o2.
- */
+ This is the equivalent of the Python expression: o1 - o2. */
+PyAPI_FUNC(PyObject *) PyNumber_Subtract(PyObject *o1, PyObject *o2);
-#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03050000
- PyAPI_FUNC(PyObject *) PyNumber_MatrixMultiply(PyObject *o1, PyObject *o2);
+/* Returns the result of multiplying o1 and o2, or NULL on failure.
- /*
- This is the equivalent of the Python expression: o1 @ o2.
- */
+ This is the equivalent of the Python expression: o1 * o2. */
+PyAPI_FUNC(PyObject *) PyNumber_Multiply(PyObject *o1, PyObject *o2);
+
+#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03050000
+/* This is the equivalent of the Python expression: o1 @ o2. */
+PyAPI_FUNC(PyObject *) PyNumber_MatrixMultiply(PyObject *o1, PyObject *o2);
#endif
- PyAPI_FUNC(PyObject *) PyNumber_FloorDivide(PyObject *o1, PyObject *o2);
+/* Returns the result of dividing o1 by o2 giving an integral result,
+ or NULL on failure.
- /*
- Returns the result of dividing o1 by o2 giving an integral result,
- or null on failure.
- This is the equivalent of the Python expression: o1//o2.
- */
+ This is the equivalent of the Python expression: o1 // o2. */
+PyAPI_FUNC(PyObject *) PyNumber_FloorDivide(PyObject *o1, PyObject *o2);
- PyAPI_FUNC(PyObject *) PyNumber_TrueDivide(PyObject *o1, PyObject *o2);
+/* Returns the result of dividing o1 by o2 giving a float result, or NULL on
+ failure.
- /*
- Returns the result of dividing o1 by o2 giving a float result,
- or null on failure.
- This is the equivalent of the Python expression: o1/o2.
- */
+ This is the equivalent of the Python expression: o1 / o2. */
+PyAPI_FUNC(PyObject *) PyNumber_TrueDivide(PyObject *o1, PyObject *o2);
- PyAPI_FUNC(PyObject *) PyNumber_Remainder(PyObject *o1, PyObject *o2);
+/* Returns the remainder of dividing o1 by o2, or NULL on failure.
- /*
- Returns the remainder of dividing o1 by o2, or null on
- failure. This is the equivalent of the Python expression:
- o1%o2.
- */
+ This is the equivalent of the Python expression: o1 % o2. */
+PyAPI_FUNC(PyObject *) PyNumber_Remainder(PyObject *o1, PyObject *o2);
- PyAPI_FUNC(PyObject *) PyNumber_Divmod(PyObject *o1, PyObject *o2);
+/* See the built-in function divmod.
- /*
- See the built-in function divmod. Returns NULL on failure.
- This is the equivalent of the Python expression:
- divmod(o1,o2).
- */
+ Returns NULL on failure.
- PyAPI_FUNC(PyObject *) PyNumber_Power(PyObject *o1, PyObject *o2,
- PyObject *o3);
+ This is the equivalent of the Python expression: divmod(o1, o2). */
+PyAPI_FUNC(PyObject *) PyNumber_Divmod(PyObject *o1, PyObject *o2);
- /*
- See the built-in function pow. Returns NULL on failure.
- This is the equivalent of the Python expression:
- pow(o1,o2,o3), where o3 is optional.
- */
+/* See the built-in function pow. Returns NULL on failure.
- PyAPI_FUNC(PyObject *) PyNumber_Negative(PyObject *o);
+ This is the equivalent of the Python expression: pow(o1, o2, o3),
+ where o3 is optional. */
+PyAPI_FUNC(PyObject *) PyNumber_Power(PyObject *o1, PyObject *o2,
+ PyObject *o3);
- /*
- Returns the negation of o on success, or null on failure.
- This is the equivalent of the Python expression: -o.
- */
+/* Returns the negation of o on success, or NULL on failure.
- PyAPI_FUNC(PyObject *) PyNumber_Positive(PyObject *o);
+ This is the equivalent of the Python expression: -o. */
+PyAPI_FUNC(PyObject *) PyNumber_Negative(PyObject *o);
- /*
- Returns the (what?) of o on success, or NULL on failure.
- This is the equivalent of the Python expression: +o.
- */
+/* Returns the positive of o on success, or NULL on failure.
- PyAPI_FUNC(PyObject *) PyNumber_Absolute(PyObject *o);
+ This is the equivalent of the Python expression: +o. */
+PyAPI_FUNC(PyObject *) PyNumber_Positive(PyObject *o);
- /*
- Returns the absolute value of o, or null on failure. This is
- the equivalent of the Python expression: abs(o).
- */
+/* Returns the absolute value of 'o', or NULL on failure.
- PyAPI_FUNC(PyObject *) PyNumber_Invert(PyObject *o);
+ This is the equivalent of the Python expression: abs(o). */
+PyAPI_FUNC(PyObject *) PyNumber_Absolute(PyObject *o);
- /*
- Returns the bitwise negation of o on success, or NULL on
- failure. This is the equivalent of the Python expression:
- ~o.
- */
+/* Returns the bitwise negation of 'o' on success, or NULL on failure.
- PyAPI_FUNC(PyObject *) PyNumber_Lshift(PyObject *o1, PyObject *o2);
+ This is the equivalent of the Python expression: ~o. */
+PyAPI_FUNC(PyObject *) PyNumber_Invert(PyObject *o);
- /*
- Returns the result of left shifting o1 by o2 on success, or
- NULL on failure. This is the equivalent of the Python
- expression: o1 << o2.
- */
+/* Returns the result of left shifting o1 by o2 on success, or NULL on failure.
- PyAPI_FUNC(PyObject *) PyNumber_Rshift(PyObject *o1, PyObject *o2);
+ This is the equivalent of the Python expression: o1 << o2. */
+PyAPI_FUNC(PyObject *) PyNumber_Lshift(PyObject *o1, PyObject *o2);
- /*
- Returns the result of right shifting o1 by o2 on success, or
- NULL on failure. This is the equivalent of the Python
- expression: o1 >> o2.
- */
+/* Returns the result of right shifting o1 by o2 on success, or NULL on
+ failure.
- PyAPI_FUNC(PyObject *) PyNumber_And(PyObject *o1, PyObject *o2);
+ This is the equivalent of the Python expression: o1 >> o2. */
+PyAPI_FUNC(PyObject *) PyNumber_Rshift(PyObject *o1, PyObject *o2);
- /*
- Returns the result of bitwise and of o1 and o2 on success, or
- NULL on failure. This is the equivalent of the Python
- expression: o1&o2.
+/* Returns the result of bitwise and of o1 and o2 on success, or NULL on
+ failure.
- */
+ This is the equivalent of the Python expression: o1 & o2. */
+PyAPI_FUNC(PyObject *) PyNumber_And(PyObject *o1, PyObject *o2);
- PyAPI_FUNC(PyObject *) PyNumber_Xor(PyObject *o1, PyObject *o2);
+/* Returns the bitwise exclusive or of o1 by o2 on success, or NULL on failure.
- /*
- Returns the bitwise exclusive or of o1 by o2 on success, or
- NULL on failure. This is the equivalent of the Python
- expression: o1^o2.
- */
+ This is the equivalent of the Python expression: o1 ^ o2. */
+PyAPI_FUNC(PyObject *) PyNumber_Xor(PyObject *o1, PyObject *o2);
- PyAPI_FUNC(PyObject *) PyNumber_Or(PyObject *o1, PyObject *o2);
+/* Returns the result of bitwise or on o1 and o2 on success, or NULL on
+ failure.
- /*
- Returns the result of bitwise or on o1 and o2 on success, or
- NULL on failure. This is the equivalent of the Python
- expression: o1|o2.
- */
+ This is the equivalent of the Python expression: o1 | o2. */
+PyAPI_FUNC(PyObject *) PyNumber_Or(PyObject *o1, PyObject *o2);
-#define PyIndex_Check(obj) \
- ((obj)->ob_type->tp_as_number != NULL && \
- (obj)->ob_type->tp_as_number->nb_index != NULL)
+#define PyIndex_Check(obj) \
+ ((obj)->ob_type->tp_as_number != NULL && \
+ (obj)->ob_type->tp_as_number->nb_index != NULL)
- PyAPI_FUNC(PyObject *) PyNumber_Index(PyObject *o);
+/* Returns the object 'o' converted to a Python int, or NULL with an exception
+ raised on failure. */
+PyAPI_FUNC(PyObject *) PyNumber_Index(PyObject *o);
- /*
- Returns the object converted to a Python int
- or NULL with an error raised on failure.
- */
+/* Returns the object 'o' converted to Py_ssize_t by going through
+ PyNumber_Index() first.
- PyAPI_FUNC(Py_ssize_t) PyNumber_AsSsize_t(PyObject *o, PyObject *exc);
+ If an overflow error occurs while converting the int to Py_ssize_t, then the
+ second argument 'exc' is the error-type to return. If it is NULL, then the
+ overflow error is cleared and the value is clipped. */
+PyAPI_FUNC(Py_ssize_t) PyNumber_AsSsize_t(PyObject *o, PyObject *exc);
- /*
- Returns the object converted to Py_ssize_t by going through
- PyNumber_Index first. If an overflow error occurs while
- converting the int to Py_ssize_t, then the second argument
- is the error-type to return. If it is NULL, then the overflow error
- is cleared and the value is clipped.
- */
+/* Returns the object 'o' converted to an integer object on success, or NULL
+ on failure.
- PyAPI_FUNC(PyObject *) PyNumber_Long(PyObject *o);
+ This is the equivalent of the Python expression: int(o). */
+PyAPI_FUNC(PyObject *) PyNumber_Long(PyObject *o);
- /*
- Returns the o converted to an integer object on success, or
- NULL on failure. This is the equivalent of the Python
- expression: int(o).
- */
+/* Returns the object 'o' converted to a float object on success, or NULL
+ on failure.
- PyAPI_FUNC(PyObject *) PyNumber_Float(PyObject *o);
+ This is the equivalent of the Python expression: float(o). */
+PyAPI_FUNC(PyObject *) PyNumber_Float(PyObject *o);
- /*
- Returns the o converted to a float object on success, or NULL
- on failure. This is the equivalent of the Python expression:
- float(o).
- */
-/* In-place variants of (some of) the above number protocol functions */
+/* --- In-place variants of (some of) the above number protocol functions -- */
- PyAPI_FUNC(PyObject *) PyNumber_InPlaceAdd(PyObject *o1, PyObject *o2);
+/* Returns the result of adding o2 to o1, possibly in-place, or NULL
+ on failure.
- /*
- Returns the result of adding o2 to o1, possibly in-place, or null
- on failure. This is the equivalent of the Python expression:
- o1 += o2.
- */
+ This is the equivalent of the Python expression: o1 += o2. */
+PyAPI_FUNC(PyObject *) PyNumber_InPlaceAdd(PyObject *o1, PyObject *o2);
- PyAPI_FUNC(PyObject *) PyNumber_InPlaceSubtract(PyObject *o1, PyObject *o2);
+/* Returns the result of subtracting o2 from o1, possibly in-place or
+ NULL on failure.
- /*
- Returns the result of subtracting o2 from o1, possibly in-place or
- null on failure. This is the equivalent of the Python expression:
- o1 -= o2.
- */
+ This is the equivalent of the Python expression: o1 -= o2. */
+PyAPI_FUNC(PyObject *) PyNumber_InPlaceSubtract(PyObject *o1, PyObject *o2);
- PyAPI_FUNC(PyObject *) PyNumber_InPlaceMultiply(PyObject *o1, PyObject *o2);
+/* Returns the result of multiplying o1 by o2, possibly in-place, or NULL on
+ failure.
- /*
- Returns the result of multiplying o1 by o2, possibly in-place, or
- null on failure. This is the equivalent of the Python expression:
- o1 *= o2.
- */
+ This is the equivalent of the Python expression: o1 *= o2. */
+PyAPI_FUNC(PyObject *) PyNumber_InPlaceMultiply(PyObject *o1, PyObject *o2);
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03050000
- PyAPI_FUNC(PyObject *) PyNumber_InPlaceMatrixMultiply(PyObject *o1, PyObject *o2);
-
- /*
- This is the equivalent of the Python expression: o1 @= o2.
- */
+/* This is the equivalent of the Python expression: o1 @= o2. */
+PyAPI_FUNC(PyObject *) PyNumber_InPlaceMatrixMultiply(PyObject *o1, PyObject *o2);
#endif
- PyAPI_FUNC(PyObject *) PyNumber_InPlaceFloorDivide(PyObject *o1,
- PyObject *o2);
-
- /*
- Returns the result of dividing o1 by o2 giving an integral result,
- possibly in-place, or null on failure.
- This is the equivalent of the Python expression:
- o1 /= o2.
- */
+/* Returns the result of dividing o1 by o2 giving an integral result, possibly
+ in-place, or NULL on failure.
- PyAPI_FUNC(PyObject *) PyNumber_InPlaceTrueDivide(PyObject *o1,
- PyObject *o2);
+ This is the equivalent of the Python expression: o1 /= o2. */
+PyAPI_FUNC(PyObject *) PyNumber_InPlaceFloorDivide(PyObject *o1,
+ PyObject *o2);
- /*
- Returns the result of dividing o1 by o2 giving a float result,
- possibly in-place, or null on failure.
- This is the equivalent of the Python expression:
- o1 /= o2.
- */
+/* Returns the result of dividing o1 by o2 giving a float result, possibly
+ in-place, or null on failure.
- PyAPI_FUNC(PyObject *) PyNumber_InPlaceRemainder(PyObject *o1, PyObject *o2);
+ This is the equivalent of the Python expression: o1 /= o2. */
+PyAPI_FUNC(PyObject *) PyNumber_InPlaceTrueDivide(PyObject *o1,
+ PyObject *o2);
- /*
- Returns the remainder of dividing o1 by o2, possibly in-place, or
- null on failure. This is the equivalent of the Python expression:
- o1 %= o2.
- */
+/* Returns the remainder of dividing o1 by o2, possibly in-place, or NULL on
+ failure.
- PyAPI_FUNC(PyObject *) PyNumber_InPlacePower(PyObject *o1, PyObject *o2,
- PyObject *o3);
+ This is the equivalent of the Python expression: o1 %= o2. */
+PyAPI_FUNC(PyObject *) PyNumber_InPlaceRemainder(PyObject *o1, PyObject *o2);
- /*
- Returns the result of raising o1 to the power of o2, possibly
- in-place, or null on failure. This is the equivalent of the Python
- expression: o1 **= o2, or pow(o1, o2, o3) if o3 is present.
- */
+/* Returns the result of raising o1 to the power of o2, possibly in-place,
+ or NULL on failure.
- PyAPI_FUNC(PyObject *) PyNumber_InPlaceLshift(PyObject *o1, PyObject *o2);
+ This is the equivalent of the Python expression: o1 **= o2,
+ or o1 = pow(o1, o2, o3) if o3 is present. */
+PyAPI_FUNC(PyObject *) PyNumber_InPlacePower(PyObject *o1, PyObject *o2,
+ PyObject *o3);
- /*
- Returns the result of left shifting o1 by o2, possibly in-place, or
- null on failure. This is the equivalent of the Python expression:
- o1 <<= o2.
- */
+/* Returns the result of left shifting o1 by o2, possibly in-place, or NULL
+ on failure.
- PyAPI_FUNC(PyObject *) PyNumber_InPlaceRshift(PyObject *o1, PyObject *o2);
+ This is the equivalent of the Python expression: o1 <<= o2. */
+PyAPI_FUNC(PyObject *) PyNumber_InPlaceLshift(PyObject *o1, PyObject *o2);
- /*
- Returns the result of right shifting o1 by o2, possibly in-place or
- null on failure. This is the equivalent of the Python expression:
- o1 >>= o2.
- */
+/* Returns the result of right shifting o1 by o2, possibly in-place or NULL
+ on failure.
- PyAPI_FUNC(PyObject *) PyNumber_InPlaceAnd(PyObject *o1, PyObject *o2);
+ This is the equivalent of the Python expression: o1 >>= o2. */
+PyAPI_FUNC(PyObject *) PyNumber_InPlaceRshift(PyObject *o1, PyObject *o2);
- /*
- Returns the result of bitwise and of o1 and o2, possibly in-place,
- or null on failure. This is the equivalent of the Python
- expression: o1 &= o2.
- */
+/* Returns the result of bitwise and of o1 and o2, possibly in-place, or NULL
+ on failure.
- PyAPI_FUNC(PyObject *) PyNumber_InPlaceXor(PyObject *o1, PyObject *o2);
+ This is the equivalent of the Python expression: o1 &= o2. */
+PyAPI_FUNC(PyObject *) PyNumber_InPlaceAnd(PyObject *o1, PyObject *o2);
- /*
- Returns the bitwise exclusive or of o1 by o2, possibly in-place, or
- null on failure. This is the equivalent of the Python expression:
- o1 ^= o2.
- */
+/* Returns the bitwise exclusive or of o1 by o2, possibly in-place, or NULL
+ on failure.
- PyAPI_FUNC(PyObject *) PyNumber_InPlaceOr(PyObject *o1, PyObject *o2);
+ This is the equivalent of the Python expression: o1 ^= o2. */
+PyAPI_FUNC(PyObject *) PyNumber_InPlaceXor(PyObject *o1, PyObject *o2);
- /*
- Returns the result of bitwise or of o1 and o2, possibly in-place,
- or null on failure. This is the equivalent of the Python
- expression: o1 |= o2.
- */
+/* Returns the result of bitwise or of o1 and o2, possibly in-place,
+ or NULL on failure.
- PyAPI_FUNC(PyObject *) PyNumber_ToBase(PyObject *n, int base);
+ This is the equivalent of the Python expression: o1 |= o2. */
+PyAPI_FUNC(PyObject *) PyNumber_InPlaceOr(PyObject *o1, PyObject *o2);
- /*
- Returns the integer n converted to a string with a base, with a base
- marker of 0b, 0o or 0x prefixed if applicable.
- If n is not an int object, it is converted with PyNumber_Index first.
- */
+/* Returns the integer n converted to a string with a base, with a base
+ marker of 0b, 0o or 0x prefixed if applicable.
+ If n is not an int object, it is converted with PyNumber_Index first. */
+PyAPI_FUNC(PyObject *) PyNumber_ToBase(PyObject *n, int base);
-/* Sequence protocol:*/
- PyAPI_FUNC(int) PySequence_Check(PyObject *o);
+/* === Sequence protocol ================================================ */
- /*
- Return 1 if the object provides sequence protocol, and zero
- otherwise.
+/* Return 1 if the object provides sequence protocol, and zero
+ otherwise.
- This function always succeeds.
- */
+ This function always succeeds. */
+PyAPI_FUNC(int) PySequence_Check(PyObject *o);
- PyAPI_FUNC(Py_ssize_t) PySequence_Size(PyObject *o);
+/* Return the size of sequence object o, or -1 on failure. */
+PyAPI_FUNC(Py_ssize_t) PySequence_Size(PyObject *o);
- /*
- Return the size of sequence object o, or -1 on failure.
- */
-
- /* For DLL compatibility */
+/* For DLL compatibility */
#undef PySequence_Length
- PyAPI_FUNC(Py_ssize_t) PySequence_Length(PyObject *o);
+PyAPI_FUNC(Py_ssize_t) PySequence_Length(PyObject *o);
#define PySequence_Length PySequence_Size
- PyAPI_FUNC(PyObject *) PySequence_Concat(PyObject *o1, PyObject *o2);
+/* Return the concatenation of o1 and o2 on success, and NULL on failure.
- /*
- Return the concatenation of o1 and o2 on success, and NULL on
- failure. This is the equivalent of the Python
- expression: o1+o2.
- */
+ This is the equivalent of the Python expression: o1 + o2. */
+PyAPI_FUNC(PyObject *) PySequence_Concat(PyObject *o1, PyObject *o2);
- PyAPI_FUNC(PyObject *) PySequence_Repeat(PyObject *o, Py_ssize_t count);
+/* Return the result of repeating sequence object 'o' 'count' times,
+ or NULL on failure.
- /*
- Return the result of repeating sequence object o count times,
- or NULL on failure. This is the equivalent of the Python
- expression: o1*count.
- */
+ This is the equivalent of the Python expression: o * count. */
+PyAPI_FUNC(PyObject *) PySequence_Repeat(PyObject *o, Py_ssize_t count);
- PyAPI_FUNC(PyObject *) PySequence_GetItem(PyObject *o, Py_ssize_t i);
+/* Return the ith element of o, or NULL on failure.
- /*
- Return the ith element of o, or NULL on failure. This is the
- equivalent of the Python expression: o[i].
- */
+ This is the equivalent of the Python expression: o[i]. */
+PyAPI_FUNC(PyObject *) PySequence_GetItem(PyObject *o, Py_ssize_t i);
- PyAPI_FUNC(PyObject *) PySequence_GetSlice(PyObject *o, Py_ssize_t i1, Py_ssize_t i2);
+/* Return the slice of sequence object o between i1 and i2, or NULL on failure.
- /*
- Return the slice of sequence object o between i1 and i2, or
- NULL on failure. This is the equivalent of the Python
- expression: o[i1:i2].
- */
+ This is the equivalent of the Python expression: o[i1:i2]. */
+PyAPI_FUNC(PyObject *) PySequence_GetSlice(PyObject *o, Py_ssize_t i1, Py_ssize_t i2);
- PyAPI_FUNC(int) PySequence_SetItem(PyObject *o, Py_ssize_t i, PyObject *v);
+/* Assign object 'v' to the ith element of the sequence 'o'. Raise an exception
+ and return -1 on failure; return 0 on success.
- /*
- Assign object v to the ith element of o. Raise an exception and return
- -1 on failure; return 0 on success. This is the equivalent of the
- Python statement o[i]=v.
- */
+ This is the equivalent of the Python statement o[i] = v. */
+PyAPI_FUNC(int) PySequence_SetItem(PyObject *o, Py_ssize_t i, PyObject *v);
- PyAPI_FUNC(int) PySequence_DelItem(PyObject *o, Py_ssize_t i);
+/* Delete the 'i'-th element of the sequence 'v'. Returns -1 on failure.
- /*
- Delete the ith element of object v. Returns
- -1 on failure. This is the equivalent of the Python
- statement: del o[i].
- */
+ This is the equivalent of the Python statement: del o[i]. */
+PyAPI_FUNC(int) PySequence_DelItem(PyObject *o, Py_ssize_t i);
- PyAPI_FUNC(int) PySequence_SetSlice(PyObject *o, Py_ssize_t i1, Py_ssize_t i2,
- PyObject *v);
+/* Assign the sequence object 'v' to the slice in sequence object 'o',
+ from 'i1' to 'i2'. Returns -1 on failure.
- /*
- Assign the sequence object, v, to the slice in sequence
- object, o, from i1 to i2. Returns -1 on failure. This is the
- equivalent of the Python statement: o[i1:i2]=v.
- */
+ This is the equivalent of the Python statement: o[i1:i2] = v. */
+PyAPI_FUNC(int) PySequence_SetSlice(PyObject *o, Py_ssize_t i1, Py_ssize_t i2,
+ PyObject *v);
- PyAPI_FUNC(int) PySequence_DelSlice(PyObject *o, Py_ssize_t i1, Py_ssize_t i2);
+/* Delete the slice in sequence object 'o' from 'i1' to 'i2'.
+ Returns -1 on failure.
- /*
- Delete the slice in sequence object, o, from i1 to i2.
- Returns -1 on failure. This is the equivalent of the Python
- statement: del o[i1:i2].
- */
+ This is the equivalent of the Python statement: del o[i1:i2]. */
+PyAPI_FUNC(int) PySequence_DelSlice(PyObject *o, Py_ssize_t i1, Py_ssize_t i2);
- PyAPI_FUNC(PyObject *) PySequence_Tuple(PyObject *o);
+/* Returns the sequence 'o' as a tuple on success, and NULL on failure.
- /*
- Returns the sequence, o, as a tuple on success, and NULL on failure.
- This is equivalent to the Python expression: tuple(o)
- */
+ This is equivalent to the Python expression: tuple(o). */
+PyAPI_FUNC(PyObject *) PySequence_Tuple(PyObject *o);
+/* Returns the sequence 'o' as a list on success, and NULL on failure.
+ This is equivalent to the Python expression: list(o) */
+PyAPI_FUNC(PyObject *) PySequence_List(PyObject *o);
- PyAPI_FUNC(PyObject *) PySequence_List(PyObject *o);
- /*
- Returns the sequence, o, as a list on success, and NULL on failure.
- This is equivalent to the Python expression: list(o)
- */
+/* Return the sequence 'o' as a list, unless it's already a tuple or list.
- PyAPI_FUNC(PyObject *) PySequence_Fast(PyObject *o, const char* m);
- /*
- Return the sequence, o, as a list, unless it's already a
- tuple or list. Use PySequence_Fast_GET_ITEM to access the
- members of this list, and PySequence_Fast_GET_SIZE to get its length.
+ Use PySequence_Fast_GET_ITEM to access the members of this list, and
+ PySequence_Fast_GET_SIZE to get its length.
- Returns NULL on failure. If the object does not support iteration,
- raises a TypeError exception with m as the message text.
- */
+ Returns NULL on failure. If the object does not support iteration, raises a
+ TypeError exception with 'm' as the message text. */
+PyAPI_FUNC(PyObject *) PySequence_Fast(PyObject *o, const char* m);
+/* Return the size of the sequence 'o', assuming that 'o' was returned by
+ PySequence_Fast and is not NULL. */
#define PySequence_Fast_GET_SIZE(o) \
(PyList_Check(o) ? PyList_GET_SIZE(o) : PyTuple_GET_SIZE(o))
- /*
- Return the size of o, assuming that o was returned by
- PySequence_Fast and is not NULL.
- */
+/* Return the 'i'-th element of the sequence 'o', assuming that o was returned
+ by PySequence_Fast, and that i is within bounds. */
#define PySequence_Fast_GET_ITEM(o, i)\
(PyList_Check(o) ? PyList_GET_ITEM(o, i) : PyTuple_GET_ITEM(o, i))
- /*
- Return the ith element of o, assuming that o was returned by
- PySequence_Fast, and that i is within bounds.
- */
+/* Assume tp_as_sequence and sq_item exist and that 'i' does not
+ need to be corrected for a negative index. */
#define PySequence_ITEM(o, i)\
( Py_TYPE(o)->tp_as_sequence->sq_item(o, i) )
- /* Assume tp_as_sequence and sq_item exist and that i does not
- need to be corrected for a negative index
- */
+/* Return a pointer to the underlying item array for
+ an object retured by PySequence_Fast */
#define PySequence_Fast_ITEMS(sf) \
(PyList_Check(sf) ? ((PyListObject *)(sf))->ob_item \
: ((PyTupleObject *)(sf))->ob_item)
- /* Return a pointer to the underlying item array for
- an object retured by PySequence_Fast */
- PyAPI_FUNC(Py_ssize_t) PySequence_Count(PyObject *o, PyObject *value);
+/* Return the number of occurrences on value on 'o', that is, return
+ the number of keys for which o[key] == value.
+
+ On failure, return -1. This is equivalent to the Python expression:
+ o.count(value). */
+PyAPI_FUNC(Py_ssize_t) PySequence_Count(PyObject *o, PyObject *value);
- /*
- Return the number of occurrences on value on o, that is,
- return the number of keys for which o[key]==value. On
- failure, return -1. This is equivalent to the Python
- expression: o.count(value).
- */
+/* Return 1 if 'ob' is in the sequence 'seq'; 0 if 'ob' is not in the sequence
+ 'seq'; -1 on error.
- PyAPI_FUNC(int) PySequence_Contains(PyObject *seq, PyObject *ob);
- /*
- Return -1 if error; 1 if ob in seq; 0 if ob not in seq.
- Use __contains__ if possible, else _PySequence_IterSearch().
- */
+ Use __contains__ if possible, else _PySequence_IterSearch(). */
+PyAPI_FUNC(int) PySequence_Contains(PyObject *seq, PyObject *ob);
#ifndef Py_LIMITED_API
#define PY_ITERSEARCH_COUNT 1
#define PY_ITERSEARCH_INDEX 2
#define PY_ITERSEARCH_CONTAINS 3
- PyAPI_FUNC(Py_ssize_t) _PySequence_IterSearch(PyObject *seq,
- PyObject *obj, int operation);
+
+/* Iterate over seq.
+
+ Result depends on the operation:
+
+ PY_ITERSEARCH_COUNT: return # of times obj appears in seq; -1 if
+ error.
+ PY_ITERSEARCH_INDEX: return 0-based index of first occurrence of
+ obj in seq; set ValueError and return -1 if none found;
+ also return -1 on error.
+ PY_ITERSEARCH_CONTAINS: return 1 if obj in seq, else 0; -1 on
+ error. */
+PyAPI_FUNC(Py_ssize_t) _PySequence_IterSearch(PyObject *seq,
+ PyObject *obj, int operation);
#endif
- /*
- Iterate over seq. Result depends on the operation:
- PY_ITERSEARCH_COUNT: return # of times obj appears in seq; -1 if
- error.
- PY_ITERSEARCH_INDEX: return 0-based index of first occurrence of
- obj in seq; set ValueError and return -1 if none found;
- also return -1 on error.
- PY_ITERSEARCH_CONTAINS: return 1 if obj in seq, else 0; -1 on
- error.
- */
+
/* For DLL-level backwards compatibility */
#undef PySequence_In
- PyAPI_FUNC(int) PySequence_In(PyObject *o, PyObject *value);
+/* Determine if the sequence 'o' contains 'value'. If an item in 'o' is equal
+ to 'value', return 1, otherwise return 0. On error, return -1.
+
+ This is equivalent to the Python expression: value in o. */
+PyAPI_FUNC(int) PySequence_In(PyObject *o, PyObject *value);
/* For source-level backwards compatibility */
#define PySequence_In PySequence_Contains
- /*
- Determine if o contains value. If an item in o is equal to
- X, return 1, otherwise return 0. On error, return -1. This
- is equivalent to the Python expression: value in o.
- */
-
- PyAPI_FUNC(Py_ssize_t) PySequence_Index(PyObject *o, PyObject *value);
-
- /*
- Return the first index for which o[i]=value. On error,
- return -1. This is equivalent to the Python
- expression: o.index(value).
- */
-/* In-place versions of some of the above Sequence functions. */
+/* Return the first index for which o[i] == value.
+ On error, return -1.
- PyAPI_FUNC(PyObject *) PySequence_InPlaceConcat(PyObject *o1, PyObject *o2);
+ This is equivalent to the Python expression: o.index(value). */
+PyAPI_FUNC(Py_ssize_t) PySequence_Index(PyObject *o, PyObject *value);
- /*
- Append o2 to o1, in-place when possible. Return the resulting
- object, which could be o1, or NULL on failure. This is the
- equivalent of the Python expression: o1 += o2.
- */
+/* --- In-place versions of some of the above Sequence functions --- */
- PyAPI_FUNC(PyObject *) PySequence_InPlaceRepeat(PyObject *o, Py_ssize_t count);
+/* Append sequence 'o2' to sequence 'o1', in-place when possible. Return the
+ resulting object, which could be 'o1', or NULL on failure.
- /*
- Repeat o1 by count, in-place when possible. Return the resulting
- object, which could be o1, or NULL on failure. This is the
- equivalent of the Python expression: o1 *= count.
+ This is the equivalent of the Python expression: o1 += o2. */
+PyAPI_FUNC(PyObject *) PySequence_InPlaceConcat(PyObject *o1, PyObject *o2);
- */
+/* Repeat sequence 'o' by 'count', in-place when possible. Return the resulting
+ object, which could be 'o', or NULL on failure.
-/* Mapping protocol:*/
+ This is the equivalent of the Python expression: o1 *= count. */
+PyAPI_FUNC(PyObject *) PySequence_InPlaceRepeat(PyObject *o, Py_ssize_t count);
- PyAPI_FUNC(int) PyMapping_Check(PyObject *o);
- /*
- Return 1 if the object provides mapping protocol, and zero
- otherwise.
+/* === Mapping protocol ================================================= */
- This function always succeeds.
- */
+/* Return 1 if the object provides mapping protocol, and 0 otherwise.
- PyAPI_FUNC(Py_ssize_t) PyMapping_Size(PyObject *o);
+ This function always succeeds. */
+PyAPI_FUNC(int) PyMapping_Check(PyObject *o);
- /*
- Returns the number of keys in object o on success, and -1 on
- failure. For objects that do not provide sequence protocol,
- this is equivalent to the Python expression: len(o).
- */
+/* Returns the number of keys in mapping object 'o' on success, and -1 on
+ failure. For objects that do not provide sequence protocol, this is
+ equivalent to the Python expression: len(o). */
+PyAPI_FUNC(Py_ssize_t) PyMapping_Size(PyObject *o);
- /* For DLL compatibility */
+/* For DLL compatibility */
#undef PyMapping_Length
- PyAPI_FUNC(Py_ssize_t) PyMapping_Length(PyObject *o);
+PyAPI_FUNC(Py_ssize_t) PyMapping_Length(PyObject *o);
#define PyMapping_Length PyMapping_Size
- /* implemented as a macro:
+/* Implemented as a macro:
- int PyMapping_DelItemString(PyObject *o, const char *key);
+ int PyMapping_DelItemString(PyObject *o, const char *key);
- Remove the mapping for object, key, from the object *o.
- Returns -1 on failure. This is equivalent to
- the Python statement: del o[key].
- */
-#define PyMapping_DelItemString(O,K) PyObject_DelItemString((O),(K))
-
- /* implemented as a macro:
-
- int PyMapping_DelItem(PyObject *o, PyObject *key);
-
- Remove the mapping for object, key, from the object *o.
- Returns -1 on failure. This is equivalent to
- the Python statement: del o[key].
- */
-#define PyMapping_DelItem(O,K) PyObject_DelItem((O),(K))
-
- PyAPI_FUNC(int) PyMapping_HasKeyString(PyObject *o, const char *key);
+ Remove the mapping for object 'key' from the mapping 'o'. Returns -1 on
+ failure.
- /*
- On success, return 1 if the mapping object has the key, key,
- and 0 otherwise. This is equivalent to the Python expression:
- key in o.
+ This is equivalent to the Python statement: del o[key]. */
+#define PyMapping_DelItemString(O,K) PyObject_DelItemString((O),(K))
- This function always succeeds.
- */
+/* Implemented as a macro:
- PyAPI_FUNC(int) PyMapping_HasKey(PyObject *o, PyObject *key);
+ int PyMapping_DelItem(PyObject *o, PyObject *key);
- /*
- Return 1 if the mapping object has the key, key,
- and 0 otherwise. This is equivalent to the Python expression:
- key in o.
+ Remove the mapping for object 'key' from the mapping object 'o'.
+ Returns -1 on failure.
- This function always succeeds.
+ This is equivalent to the Python statement: del o[key]. */
+#define PyMapping_DelItem(O,K) PyObject_DelItem((O),(K))
- */
+/* On success, return 1 if the mapping object 'o' has the key 'key',
+ and 0 otherwise.
- PyAPI_FUNC(PyObject *) PyMapping_Keys(PyObject *o);
+ This is equivalent to the Python expression: key in o.
- /*
- On success, return a list or tuple of the keys in object o.
- On failure, return NULL.
- */
+ This function always succeeds. */
+PyAPI_FUNC(int) PyMapping_HasKeyString(PyObject *o, const char *key);
- PyAPI_FUNC(PyObject *) PyMapping_Values(PyObject *o);
+/* Return 1 if the mapping object has the key 'key', and 0 otherwise.
- /*
- On success, return a list or tuple of the values in object o.
- On failure, return NULL.
- */
+ This is equivalent to the Python expression: key in o.
- PyAPI_FUNC(PyObject *) PyMapping_Items(PyObject *o);
+ This function always succeeds. */
+PyAPI_FUNC(int) PyMapping_HasKey(PyObject *o, PyObject *key);
- /*
- On success, return a list or tuple of the items in object o,
- where each item is a tuple containing a key-value pair.
- On failure, return NULL.
+/* On success, return a list or tuple of the keys in mapping object 'o'.
+ On failure, return NULL. */
+PyAPI_FUNC(PyObject *) PyMapping_Keys(PyObject *o);
- */
+/* On success, return a list or tuple of the values in mapping object 'o'.
+ On failure, return NULL. */
+PyAPI_FUNC(PyObject *) PyMapping_Values(PyObject *o);
- PyAPI_FUNC(PyObject *) PyMapping_GetItemString(PyObject *o,
- const char *key);
+/* On success, return a list or tuple of the items in mapping object 'o',
+ where each item is a tuple containing a key-value pair. On failure, return
+ NULL. */
+PyAPI_FUNC(PyObject *) PyMapping_Items(PyObject *o);
- /*
- Return element of o corresponding to the object, key, or NULL
- on failure. This is the equivalent of the Python expression:
- o[key].
- */
+/* Return element of o corresponding to the object, key, or NULL on failure.
- PyAPI_FUNC(int) PyMapping_SetItemString(PyObject *o, const char *key,
- PyObject *value);
+ This is the equivalent of the Python expression: o[key]. */
+PyAPI_FUNC(PyObject *) PyMapping_GetItemString(PyObject *o,
+ const char *key);
- /*
- Map the object, key, to the value, v. Returns
- -1 on failure. This is the equivalent of the Python
- statement: o[key]=v.
- */
+/* Map the object 'key' to the value 'v' in the mapping 'o'.
+ Returns -1 on failure.
+ This is the equivalent of the Python statement: o[key]=v. */
+PyAPI_FUNC(int) PyMapping_SetItemString(PyObject *o, const char *key,
+ PyObject *value);
+/* isinstance(object, typeorclass) */
PyAPI_FUNC(int) PyObject_IsInstance(PyObject *object, PyObject *typeorclass);
- /* isinstance(object, typeorclass) */
+/* issubclass(object, typeorclass) */
PyAPI_FUNC(int) PyObject_IsSubclass(PyObject *object, PyObject *typeorclass);
- /* issubclass(object, typeorclass) */
#ifndef Py_LIMITED_API
diff --git a/Include/ceval.h b/Include/ceval.h
index 89c6062f11..e4be595469 100644
--- a/Include/ceval.h
+++ b/Include/ceval.h
@@ -8,16 +8,18 @@ extern "C" {
/* Interface to random parts in ceval.c */
PyAPI_FUNC(PyObject *) PyEval_CallObjectWithKeywords(
- PyObject *func, PyObject *args, PyObject *kwargs);
+ PyObject *callable,
+ PyObject *args,
+ PyObject *kwargs);
/* Inline this */
-#define PyEval_CallObject(func,arg) \
- PyEval_CallObjectWithKeywords(func, arg, (PyObject *)NULL)
+#define PyEval_CallObject(callable, arg) \
+ PyEval_CallObjectWithKeywords(callable, arg, (PyObject *)NULL)
-PyAPI_FUNC(PyObject *) PyEval_CallFunction(PyObject *obj,
+PyAPI_FUNC(PyObject *) PyEval_CallFunction(PyObject *callable,
const char *format, ...);
PyAPI_FUNC(PyObject *) PyEval_CallMethod(PyObject *obj,
- const char *methodname,
+ const char *name,
const char *format, ...);
#ifndef Py_LIMITED_API
@@ -120,7 +122,6 @@ PyAPI_DATA(int) _Py_CheckRecursionLimit;
PyAPI_FUNC(const char *) PyEval_GetFuncName(PyObject *);
PyAPI_FUNC(const char *) PyEval_GetFuncDesc(PyObject *);
-PyAPI_FUNC(PyObject *) PyEval_GetCallStats(PyObject *);
PyAPI_FUNC(PyObject *) PyEval_EvalFrame(struct _frame *);
PyAPI_FUNC(PyObject *) PyEval_EvalFrameEx(struct _frame *f, int exc);
#ifndef Py_LIMITED_API
@@ -182,8 +183,8 @@ PyAPI_FUNC(void) PyEval_InitThreads(void);
#ifndef Py_LIMITED_API
PyAPI_FUNC(void) _PyEval_FiniThreads(void);
#endif /* !Py_LIMITED_API */
-PyAPI_FUNC(void) PyEval_AcquireLock(void);
-PyAPI_FUNC(void) PyEval_ReleaseLock(void);
+PyAPI_FUNC(void) PyEval_AcquireLock(void) Py_DEPRECATED(3.2);
+PyAPI_FUNC(void) PyEval_ReleaseLock(void) /* Py_DEPRECATED(3.2) */;
PyAPI_FUNC(void) PyEval_AcquireThread(PyThreadState *tstate);
PyAPI_FUNC(void) PyEval_ReleaseThread(PyThreadState *tstate);
PyAPI_FUNC(void) PyEval_ReInitThreads(void);
diff --git a/Include/code.h b/Include/code.h
index c5fce3c963..385258f93c 100644
--- a/Include/code.h
+++ b/Include/code.h
@@ -37,7 +37,7 @@ typedef struct {
for tracebacks and debuggers; otherwise, constant de-duplication
would collapse identical functions/lambdas defined on different lines.
*/
- unsigned char *co_cell2arg; /* Maps cell vars which are arguments. */
+ Py_ssize_t *co_cell2arg; /* Maps cell vars which are arguments. */
PyObject *co_filename; /* unicode (where it was loaded from) */
PyObject *co_name; /* unicode (name, for reference) */
PyObject *co_lnotab; /* string (encoding addr<->lineno mapping) See
@@ -84,9 +84,8 @@ typedef struct {
#define CO_FUTURE_GENERATOR_STOP 0x80000
/* This value is found in the co_cell2arg array when the associated cell
- variable does not correspond to an argument. The maximum number of
- arguments is 255 (indexed up to 254), so 255 work as a special flag.*/
-#define CO_CELL_NOT_AN_ARG 255
+ variable does not correspond to an argument. */
+#define CO_CELL_NOT_AN_ARG (-1)
/* This should be defined if a future statement modifies the syntax.
For example, when a keyword is added.
diff --git a/Include/descrobject.h b/Include/descrobject.h
index 8f3e84c365..cb43174838 100644
--- a/Include/descrobject.h
+++ b/Include/descrobject.h
@@ -9,10 +9,10 @@ typedef PyObject *(*getter)(PyObject *, void *);
typedef int (*setter)(PyObject *, PyObject *, void *);
typedef struct PyGetSetDef {
- char *name;
+ const char *name;
getter get;
setter set;
- char *doc;
+ const char *doc;
void *closure;
} PyGetSetDef;
@@ -24,11 +24,11 @@ typedef PyObject *(*wrapperfunc_kwds)(PyObject *self, PyObject *args,
void *wrapped, PyObject *kwds);
struct wrapperbase {
- char *name;
+ const char *name;
int offset;
void *function;
wrapperfunc wrapper;
- char *doc;
+ const char *doc;
int flags;
PyObject *name_strobj;
};
@@ -90,6 +90,9 @@ PyAPI_FUNC(PyObject *) PyDescr_NewMember(PyTypeObject *,
PyAPI_FUNC(PyObject *) PyDescr_NewGetSet(PyTypeObject *,
struct PyGetSetDef *);
#ifndef Py_LIMITED_API
+
+PyAPI_FUNC(PyObject *) _PyMethodDescr_FastCallKeywords(
+ PyObject *descrobj, PyObject **stack, Py_ssize_t nargs, PyObject *kwnames);
PyAPI_FUNC(PyObject *) PyDescr_NewWrapper(PyTypeObject *,
struct wrapperbase *, void *);
#define PyDescr_IsData(d) (Py_TYPE(d)->tp_descr_set != NULL)
diff --git a/Include/dictobject.h b/Include/dictobject.h
index c4f2e2f5b3..08a9449925 100644
--- a/Include/dictobject.h
+++ b/Include/dictobject.h
@@ -108,6 +108,8 @@ PyAPI_FUNC(Py_ssize_t) PyDict_Size(PyObject *mp);
PyAPI_FUNC(PyObject *) PyDict_Copy(PyObject *mp);
PyAPI_FUNC(int) PyDict_Contains(PyObject *mp, PyObject *key);
#ifndef Py_LIMITED_API
+/* Get the number of items of a dictionary. */
+#define PyDict_GET_SIZE(mp) (assert(PyDict_Check(mp)),((PyDictObject *)mp)->ma_used)
PyAPI_FUNC(int) _PyDict_Contains(PyObject *mp, PyObject *key, Py_hash_t hash);
PyAPI_FUNC(PyObject *) _PyDict_NewPresized(Py_ssize_t minused);
PyAPI_FUNC(void) _PyDict_MaybeUntrack(PyObject *mp);
diff --git a/Include/frameobject.h b/Include/frameobject.h
index 00c50933dc..616c611c7e 100644
--- a/Include/frameobject.h
+++ b/Include/frameobject.h
@@ -60,7 +60,11 @@ PyAPI_DATA(PyTypeObject) PyFrame_Type;
#define PyFrame_Check(op) (Py_TYPE(op) == &PyFrame_Type)
PyAPI_FUNC(PyFrameObject *) PyFrame_New(PyThreadState *, PyCodeObject *,
- PyObject *, PyObject *);
+ PyObject *, PyObject *);
+
+/* only internal use */
+PyFrameObject* _PyFrame_New_NoTrack(PyThreadState *, PyCodeObject *,
+ PyObject *, PyObject *);
/* The rest of the interface is specific for frame objects */
diff --git a/Include/longobject.h b/Include/longobject.h
index efd409c75a..ac09a00853 100644
--- a/Include/longobject.h
+++ b/Include/longobject.h
@@ -94,7 +94,7 @@ PyAPI_FUNC(long long) PyLong_AsLongLongAndOverflow(PyObject *, int *);
PyAPI_FUNC(PyObject *) PyLong_FromString(const char *, char **, int);
#ifndef Py_LIMITED_API
-PyAPI_FUNC(PyObject *) PyLong_FromUnicode(Py_UNICODE*, Py_ssize_t, int);
+PyAPI_FUNC(PyObject *) PyLong_FromUnicode(Py_UNICODE*, Py_ssize_t, int) Py_DEPRECATED(3.3);
PyAPI_FUNC(PyObject *) PyLong_FromUnicodeObject(PyObject *u, int base);
PyAPI_FUNC(PyObject *) _PyLong_FromBytes(const char *, Py_ssize_t, int);
#endif
diff --git a/Include/methodobject.h b/Include/methodobject.h
index 79fad8235c..b5c4e83730 100644
--- a/Include/methodobject.h
+++ b/Include/methodobject.h
@@ -95,6 +95,20 @@ typedef struct {
PyObject *m_module; /* The __module__ attribute, can be anything */
PyObject *m_weakreflist; /* List of weak references */
} PyCFunctionObject;
+
+PyAPI_FUNC(PyObject *) _PyMethodDef_RawFastCallDict(
+ PyMethodDef *method,
+ PyObject *self,
+ PyObject **args,
+ Py_ssize_t nargs,
+ PyObject *kwargs);
+
+PyAPI_FUNC(PyObject *) _PyMethodDef_RawFastCallKeywords(
+ PyMethodDef *method,
+ PyObject *self,
+ PyObject **args,
+ Py_ssize_t nargs,
+ PyObject *kwnames);
#endif
PyAPI_FUNC(int) PyCFunction_ClearFreeList(void);
diff --git a/Include/modsupport.h b/Include/modsupport.h
index 86719c6e92..853860f4d2 100644
--- a/Include/modsupport.h
+++ b/Include/modsupport.h
@@ -19,9 +19,18 @@ extern "C" {
#define PyArg_VaParseTupleAndKeywords _PyArg_VaParseTupleAndKeywords_SizeT
#define Py_BuildValue _Py_BuildValue_SizeT
#define Py_VaBuildValue _Py_VaBuildValue_SizeT
+#ifndef Py_LIMITED_API
+#define _Py_VaBuildStack _Py_VaBuildStack_SizeT
+#endif
#else
#ifndef Py_LIMITED_API
PyAPI_FUNC(PyObject *) _Py_VaBuildValue_SizeT(const char *, va_list);
+PyAPI_FUNC(PyObject **) _Py_VaBuildStack_SizeT(
+ PyObject **small_stack,
+ Py_ssize_t small_stack_len,
+ const char *format,
+ va_list va,
+ Py_ssize_t *p_nargs);
#endif /* !Py_LIMITED_API */
#endif
@@ -40,11 +49,37 @@ PyAPI_FUNC(int) PyArg_UnpackTuple(PyObject *, const char *, Py_ssize_t, Py_ssize
PyAPI_FUNC(PyObject *) Py_BuildValue(const char *, ...);
PyAPI_FUNC(PyObject *) _Py_BuildValue_SizeT(const char *, ...);
+
#ifndef Py_LIMITED_API
-PyAPI_FUNC(int) _PyArg_NoKeywords(const char *funcname, PyObject *kw);
+PyAPI_FUNC(int) _PyArg_UnpackStack(
+ PyObject **args,
+ Py_ssize_t nargs,
+ const char *name,
+ Py_ssize_t min,
+ Py_ssize_t max,
+ ...);
+
+PyAPI_FUNC(int) _PyArg_NoKeywords(const char *funcname, PyObject *kwargs);
+PyAPI_FUNC(int) _PyArg_NoStackKeywords(const char *funcname, PyObject *kwnames);
PyAPI_FUNC(int) _PyArg_NoPositional(const char *funcname, PyObject *args);
+#define _PyArg_NoKeywords(funcname, kwargs) \
+ ((kwargs) == NULL || _PyArg_NoKeywords((funcname), (kwargs)))
+#define _PyArg_NoStackKeywords(funcname, kwnames) \
+ ((kwnames) == NULL || _PyArg_NoStackKeywords((funcname), (kwnames)))
+#define _PyArg_NoPositional(funcname, args) \
+ ((args) == NULL || _PyArg_NoPositional((funcname), (args)))
+
#endif
+
PyAPI_FUNC(PyObject *) Py_VaBuildValue(const char *, va_list);
+#ifndef Py_LIMITED_API
+PyAPI_FUNC(PyObject **) _Py_VaBuildStack(
+ PyObject **small_stack,
+ Py_ssize_t small_stack_len,
+ const char *format,
+ va_list va,
+ Py_ssize_t *p_nargs);
+#endif
#ifndef Py_LIMITED_API
typedef struct _PyArg_Parser {
@@ -61,16 +96,26 @@ typedef struct _PyArg_Parser {
#ifdef PY_SSIZE_T_CLEAN
#define _PyArg_ParseTupleAndKeywordsFast _PyArg_ParseTupleAndKeywordsFast_SizeT
#define _PyArg_ParseStack _PyArg_ParseStack_SizeT
+#define _PyArg_ParseStackAndKeywords _PyArg_ParseStackAndKeywords_SizeT
#define _PyArg_VaParseTupleAndKeywordsFast _PyArg_VaParseTupleAndKeywordsFast_SizeT
#endif
PyAPI_FUNC(int) _PyArg_ParseTupleAndKeywordsFast(PyObject *, PyObject *,
struct _PyArg_Parser *, ...);
-PyAPI_FUNC(int) _PyArg_ParseStack(PyObject **args, Py_ssize_t nargs, PyObject *kwnames,
- struct _PyArg_Parser *, ...);
+PyAPI_FUNC(int) _PyArg_ParseStack(
+ PyObject **args,
+ Py_ssize_t nargs,
+ const char *format,
+ ...);
+PyAPI_FUNC(int) _PyArg_ParseStackAndKeywords(
+ PyObject **args,
+ Py_ssize_t nargs,
+ PyObject *kwnames,
+ struct _PyArg_Parser *,
+ ...);
PyAPI_FUNC(int) _PyArg_VaParseTupleAndKeywordsFast(PyObject *, PyObject *,
struct _PyArg_Parser *, va_list);
void _PyArg_Fini(void);
-#endif
+#endif /* Py_LIMITED_API */
PyAPI_FUNC(int) PyModule_AddObject(PyObject *, const char *, PyObject *);
PyAPI_FUNC(int) PyModule_AddIntConstant(PyObject *, const char *, long);
@@ -174,7 +219,7 @@ PyAPI_FUNC(PyObject *) PyModule_FromDefAndSpec2(PyModuleDef *def,
#endif /* New in 3.5 */
#ifndef Py_LIMITED_API
-PyAPI_DATA(char *) _Py_PackageContext;
+PyAPI_DATA(const char *) _Py_PackageContext;
#endif
#ifdef __cplusplus
diff --git a/Include/moduleobject.h b/Include/moduleobject.h
index b6e49333d2..1d8fe46dea 100644
--- a/Include/moduleobject.h
+++ b/Include/moduleobject.h
@@ -25,7 +25,7 @@ PyAPI_FUNC(PyObject *) PyModule_GetDict(PyObject *);
PyAPI_FUNC(PyObject *) PyModule_GetNameObject(PyObject *);
#endif
PyAPI_FUNC(const char *) PyModule_GetName(PyObject *);
-PyAPI_FUNC(const char *) PyModule_GetFilename(PyObject *);
+PyAPI_FUNC(const char *) PyModule_GetFilename(PyObject *) Py_DEPRECATED(3.2);
PyAPI_FUNC(PyObject *) PyModule_GetFilenameObject(PyObject *);
#ifndef Py_LIMITED_API
PyAPI_FUNC(void) _PyModule_Clear(PyObject *);
diff --git a/Include/odictobject.h b/Include/odictobject.h
index 381de58ba4..ff6ad64b8b 100644
--- a/Include/odictobject.h
+++ b/Include/odictobject.h
@@ -19,7 +19,7 @@ PyAPI_DATA(PyTypeObject) PyODictValues_Type;
#define PyODict_Check(op) PyObject_TypeCheck(op, &PyODict_Type)
#define PyODict_CheckExact(op) (Py_TYPE(op) == &PyODict_Type)
-#define PyODict_SIZE(op) ((PyDictObject *)op)->ma_used
+#define PyODict_SIZE(op) PyDict_GET_SIZE((op))
#endif /* Py_LIMITED_API */
diff --git a/Include/opcode.h b/Include/opcode.h
index be360e1016..99c3b0ef81 100644
--- a/Include/opcode.h
+++ b/Include/opcode.h
@@ -126,6 +126,8 @@ extern "C" {
#define BUILD_CONST_KEY_MAP 156
#define BUILD_STRING 157
#define BUILD_TUPLE_UNPACK_WITH_CALL 158
+#define LOAD_METHOD 160
+#define CALL_METHOD 161
/* EXCEPT_HANDLER is a special, implicit block type which is created when
entering an except handler. It is not an opcode but we define it here
diff --git a/Include/patchlevel.h b/Include/patchlevel.h
index 49930e8556..9644b1a024 100644
--- a/Include/patchlevel.h
+++ b/Include/patchlevel.h
@@ -17,13 +17,13 @@
/* Version parsed out into numeric values */
/*--start constants--*/
#define PY_MAJOR_VERSION 3
-#define PY_MINOR_VERSION 6
+#define PY_MINOR_VERSION 7
#define PY_MICRO_VERSION 0
-#define PY_RELEASE_LEVEL PY_RELEASE_LEVEL_FINAL
+#define PY_RELEASE_LEVEL PY_RELEASE_LEVEL_ALPHA
#define PY_RELEASE_SERIAL 0
/* Version as a string */
-#define PY_VERSION "3.6.0+"
+#define PY_VERSION "3.7.0a0"
/*--end constants--*/
/* Version as a single 4-byte hex number, e.g. 0x010502B2 == 1.5.2b2.
diff --git a/Include/py_curses.h b/Include/py_curses.h
index 3c21697073..336c95d360 100644
--- a/Include/py_curses.h
+++ b/Include/py_curses.h
@@ -154,19 +154,16 @@ static PyObject *PyCurses_ ## X (PyObject *self) \
{ \
PyCursesInitialised \
if (X () == FALSE) { \
- Py_INCREF(Py_False); \
- return Py_False; \
+ Py_RETURN_FALSE; \
} \
- Py_INCREF(Py_True); \
- return Py_True; }
+ Py_RETURN_TRUE; }
#define NoArgNoReturnVoidFunction(X) \
static PyObject *PyCurses_ ## X (PyObject *self) \
{ \
PyCursesInitialised \
X(); \
- Py_INCREF(Py_None); \
- return Py_None; }
+ Py_RETURN_NONE; }
#ifdef __cplusplus
}
diff --git a/Include/pyerrors.h b/Include/pyerrors.h
index 8c1dbc5047..4540385446 100644
--- a/Include/pyerrors.h
+++ b/Include/pyerrors.h
@@ -252,7 +252,7 @@ PyAPI_FUNC(PyObject *) PyErr_SetFromErrnoWithFilename(
);
#if defined(MS_WINDOWS) && !defined(Py_LIMITED_API)
PyAPI_FUNC(PyObject *) PyErr_SetFromErrnoWithUnicodeFilename(
- PyObject *, const Py_UNICODE *);
+ PyObject *, const Py_UNICODE *) Py_DEPRECATED(3.3);
#endif /* MS_WINDOWS */
PyAPI_FUNC(PyObject *) PyErr_Format(
@@ -286,7 +286,7 @@ PyAPI_FUNC(PyObject *) PyErr_SetFromWindowsErrWithFilename(
#ifndef Py_LIMITED_API
/* XXX redeclare to use WSTRING */
PyAPI_FUNC(PyObject *) PyErr_SetFromWindowsErrWithUnicodeFilename(
- int, const Py_UNICODE *);
+ int, const Py_UNICODE *) Py_DEPRECATED(3.3);
#endif
PyAPI_FUNC(PyObject *) PyErr_SetFromWindowsErr(int);
PyAPI_FUNC(PyObject *) PyErr_SetExcFromWindowsErrWithFilenameObject(
@@ -302,7 +302,7 @@ PyAPI_FUNC(PyObject *) PyErr_SetExcFromWindowsErrWithFilename(
);
#ifndef Py_LIMITED_API
PyAPI_FUNC(PyObject *) PyErr_SetExcFromWindowsErrWithUnicodeFilename(
- PyObject *,int, const Py_UNICODE *);
+ PyObject *,int, const Py_UNICODE *) Py_DEPRECATED(3.3);
#endif
PyAPI_FUNC(PyObject *) PyErr_SetExcFromWindowsErr(PyObject *, int);
#endif /* MS_WINDOWS */
@@ -406,7 +406,7 @@ PyAPI_FUNC(PyObject *) PyUnicodeEncodeError_Create(
Py_ssize_t start,
Py_ssize_t end,
const char *reason /* UTF-8 encoded string */
- );
+ ) Py_DEPRECATED(3.3);
#endif
/* create a UnicodeTranslateError object */
@@ -417,7 +417,7 @@ PyAPI_FUNC(PyObject *) PyUnicodeTranslateError_Create(
Py_ssize_t start,
Py_ssize_t end,
const char *reason /* UTF-8 encoded string */
- );
+ ) Py_DEPRECATED(3.3);
PyAPI_FUNC(PyObject *) _PyUnicodeTranslateError_Create(
PyObject *object,
Py_ssize_t start,
diff --git a/Include/pyport.h b/Include/pyport.h
index 52a91a0d11..03c664f397 100644
--- a/Include/pyport.h
+++ b/Include/pyport.h
@@ -491,13 +491,49 @@ extern "C" {
* typedef int T1 Py_DEPRECATED(2.4);
* extern int x() Py_DEPRECATED(2.5);
*/
-#if defined(__GNUC__) && ((__GNUC__ >= 4) || \
- (__GNUC__ == 3) && (__GNUC_MINOR__ >= 1))
+#if defined(__GNUC__) \
+ && ((__GNUC__ >= 4) || (__GNUC__ == 3) && (__GNUC_MINOR__ >= 1))
#define Py_DEPRECATED(VERSION_UNUSED) __attribute__((__deprecated__))
#else
#define Py_DEPRECATED(VERSION_UNUSED)
#endif
+
+/* _Py_HOT_FUNCTION
+ * The hot attribute on a function is used to inform the compiler that the
+ * function is a hot spot of the compiled program. The function is optimized
+ * more aggressively and on many target it is placed into special subsection of
+ * the text section so all hot functions appears close together improving
+ * locality.
+ *
+ * Usage:
+ * int _Py_HOT_FUNCTION x(void) { return 3; }
+ *
+ * Issue #28618: This attribute must not be abused, otherwise it can have a
+ * negative effect on performance. Only the functions were Python spend most of
+ * its time must use it. Use a profiler when running performance benchmark
+ * suite to find these functions.
+ */
+#if defined(__GNUC__) \
+ && ((__GNUC__ >= 5) || (__GNUC__ == 4) && (__GNUC_MINOR__ >= 3))
+#define _Py_HOT_FUNCTION __attribute__((hot))
+#else
+#define _Py_HOT_FUNCTION
+#endif
+
+/* _Py_NO_INLINE
+ * Disable inlining on a function. For example, it helps to reduce the C stack
+ * consumption.
+ *
+ * Usage:
+ * int _Py_NO_INLINE x(void) { return 3; }
+ */
+#if defined(__GNUC__) || defined(__clang__)
+# define _Py_NO_INLINE __attribute__((noinline))
+#else
+# define _Py_NO_INLINE
+#endif
+
/**************************************************************************
Prototypes that are missing from the standard include files on some systems
(and possibly only some versions of such systems.)
diff --git a/Include/sliceobject.h b/Include/sliceobject.h
index 3626354460..b24f2926f1 100644
--- a/Include/sliceobject.h
+++ b/Include/sliceobject.h
@@ -42,7 +42,7 @@ PyAPI_FUNC(int) PySlice_GetIndices(PyObject *r, Py_ssize_t length,
Py_ssize_t *start, Py_ssize_t *stop, Py_ssize_t *step);
PyAPI_FUNC(int) PySlice_GetIndicesEx(PyObject *r, Py_ssize_t length,
Py_ssize_t *start, Py_ssize_t *stop,
- Py_ssize_t *step, Py_ssize_t *slicelength);
+ Py_ssize_t *step, Py_ssize_t *slicelength) Py_DEPRECATED(3.7);
#if !defined(Py_LIMITED_API) || (Py_LIMITED_API+0 >= 0x03050400 && Py_LIMITED_API+0 < 0x03060000) || Py_LIMITED_API+0 >= 0x03060100
#define PySlice_GetIndicesEx(slice, length, start, stop, step, slicelen) ( \
diff --git a/Include/structmember.h b/Include/structmember.h
index 5da8a46682..b54f7081f4 100644
--- a/Include/structmember.h
+++ b/Include/structmember.h
@@ -16,11 +16,11 @@ extern "C" {
pointer is NULL. */
typedef struct PyMemberDef {
- char *name;
+ const char *name;
int type;
Py_ssize_t offset;
int flags;
- char *doc;
+ const char *doc;
} PyMemberDef;
/* Types */
diff --git a/Include/structseq.h b/Include/structseq.h
index af227164c8..e5e5d5c573 100644
--- a/Include/structseq.h
+++ b/Include/structseq.h
@@ -8,13 +8,13 @@ extern "C" {
#endif
typedef struct PyStructSequence_Field {
- char *name;
- char *doc;
+ const char *name;
+ const char *doc;
} PyStructSequence_Field;
typedef struct PyStructSequence_Desc {
- char *name;
- char *doc;
+ const char *name;
+ const char *doc;
struct PyStructSequence_Field *fields;
int n_in_sequence;
} PyStructSequence_Desc;
diff --git a/Include/unicodeobject.h b/Include/unicodeobject.h
index 587cf03e36..6a0740a0d7 100644
--- a/Include/unicodeobject.h
+++ b/Include/unicodeobject.h
@@ -90,7 +90,7 @@ Copyright (c) Corporation for National Research Initiatives.
#ifndef Py_LIMITED_API
#define PY_UNICODE_TYPE wchar_t
-typedef wchar_t Py_UNICODE;
+typedef wchar_t Py_UNICODE /* Py_DEPRECATED(3.3) */;
#endif
/* If the compiler provides a wchar_t type we try to support it
@@ -387,9 +387,11 @@ PyAPI_DATA(PyTypeObject) PyUnicodeIter_Type;
((void)PyUnicode_AsUnicode((PyObject *)(op)), \
assert(((PyASCIIObject *)(op))->wstr), \
PyUnicode_WSTR_LENGTH(op)))
+ /* Py_DEPRECATED(3.3) */
#define PyUnicode_GET_DATA_SIZE(op) \
(PyUnicode_GET_SIZE(op) * Py_UNICODE_SIZE)
+ /* Py_DEPRECATED(3.3) */
/* Alias for PyUnicode_AsUnicode(). This will create a wchar_t/Py_UNICODE
representation on demand. Using this macro is very inefficient now,
@@ -400,9 +402,11 @@ PyAPI_DATA(PyTypeObject) PyUnicodeIter_Type;
(assert(PyUnicode_Check(op)), \
(((PyASCIIObject *)(op))->wstr) ? (((PyASCIIObject *)(op))->wstr) : \
PyUnicode_AsUnicode((PyObject *)(op)))
+ /* Py_DEPRECATED(3.3) */
#define PyUnicode_AS_DATA(op) \
((const char *)(PyUnicode_AS_UNICODE(op)))
+ /* Py_DEPRECATED(3.3) */
/* --- Flexible String Representation Helper Macros (PEP 393) -------------- */
@@ -688,7 +692,7 @@ PyAPI_FUNC(void) _PyUnicode_FastFill(
PyAPI_FUNC(PyObject*) PyUnicode_FromUnicode(
const Py_UNICODE *u, /* Unicode buffer */
Py_ssize_t size /* size of buffer */
- );
+ ) /* Py_DEPRECATED(3.3) */;
#endif
/* Similar to PyUnicode_FromUnicode(), but u points to UTF-8 encoded bytes */
@@ -760,7 +764,7 @@ PyAPI_FUNC(Py_UCS4*) PyUnicode_AsUCS4Copy(PyObject *unicode);
#ifndef Py_LIMITED_API
PyAPI_FUNC(Py_UNICODE *) PyUnicode_AsUnicode(
PyObject *unicode /* Unicode object */
- );
+ ) /* Py_DEPRECATED(3.3) */;
#endif
/* Return a read-only pointer to the Unicode object's internal
@@ -772,7 +776,7 @@ PyAPI_FUNC(Py_UNICODE *) PyUnicode_AsUnicode(
PyAPI_FUNC(Py_UNICODE *) PyUnicode_AsUnicodeAndSize(
PyObject *unicode, /* Unicode object */
Py_ssize_t *size /* location where to save the length */
- );
+ ) /* Py_DEPRECATED(3.3) */;
#endif
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03030000
@@ -788,7 +792,7 @@ PyAPI_FUNC(Py_ssize_t) PyUnicode_GetLength(
PyAPI_FUNC(Py_ssize_t) PyUnicode_GetSize(
PyObject *unicode /* Unicode object */
- );
+ ) Py_DEPRECATED(3.3);
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03030000
/* Read a character from the string. */
@@ -812,7 +816,7 @@ PyAPI_FUNC(int) PyUnicode_WriteChar(
#ifndef Py_LIMITED_API
/* Get the maximum ordinal for a Unicode character. */
-PyAPI_FUNC(Py_UNICODE) PyUnicode_GetMax(void);
+PyAPI_FUNC(Py_UNICODE) PyUnicode_GetMax(void) Py_DEPRECATED(3.3);
#endif
/* Resize a Unicode object. The length is the number of characters, except
@@ -1131,7 +1135,7 @@ PyAPI_FUNC(int) PyUnicode_ClearFreeList(void);
*/
#ifndef Py_LIMITED_API
-PyAPI_FUNC(char *) PyUnicode_AsUTF8AndSize(
+PyAPI_FUNC(const char *) PyUnicode_AsUTF8AndSize(
PyObject *unicode,
Py_ssize_t *size);
#define _PyUnicode_AsStringAndSize PyUnicode_AsUTF8AndSize
@@ -1158,7 +1162,7 @@ PyAPI_FUNC(char *) PyUnicode_AsUTF8AndSize(
*/
#ifndef Py_LIMITED_API
-PyAPI_FUNC(char *) PyUnicode_AsUTF8(PyObject *unicode);
+PyAPI_FUNC(const char *) PyUnicode_AsUTF8(PyObject *unicode);
#define _PyUnicode_AsString PyUnicode_AsUTF8
#endif
@@ -1213,7 +1217,7 @@ PyAPI_FUNC(PyObject*) PyUnicode_Encode(
Py_ssize_t size, /* number of Py_UNICODE chars to encode */
const char *encoding, /* encoding */
const char *errors /* error handling */
- );
+ ) Py_DEPRECATED(3.3);
#endif
/* Encodes a Unicode object and returns the result as Python
@@ -1280,7 +1284,7 @@ PyAPI_FUNC(PyObject*) PyUnicode_EncodeUTF7(
int base64SetO, /* Encode RFC2152 Set O characters in base64 */
int base64WhiteSpace, /* Encode whitespace (sp, ht, nl, cr) in base64 */
const char *errors /* error handling */
- );
+ ) Py_DEPRECATED(3.3);
PyAPI_FUNC(PyObject*) _PyUnicode_EncodeUTF7(
PyObject *unicode, /* Unicode object */
int base64SetO, /* Encode RFC2152 Set O characters in base64 */
@@ -1317,7 +1321,7 @@ PyAPI_FUNC(PyObject*) PyUnicode_EncodeUTF8(
const Py_UNICODE *data, /* Unicode char buffer */
Py_ssize_t length, /* number of Py_UNICODE chars to encode */
const char *errors /* error handling */
- );
+ ) Py_DEPRECATED(3.3);
#endif
/* --- UTF-32 Codecs ------------------------------------------------------ */
@@ -1393,7 +1397,7 @@ PyAPI_FUNC(PyObject*) PyUnicode_EncodeUTF32(
Py_ssize_t length, /* number of Py_UNICODE chars to encode */
const char *errors, /* error handling */
int byteorder /* byteorder to use 0=BOM+native;-1=LE,1=BE */
- );
+ ) Py_DEPRECATED(3.3);
PyAPI_FUNC(PyObject*) _PyUnicode_EncodeUTF32(
PyObject *object, /* Unicode object */
const char *errors, /* error handling */
@@ -1478,7 +1482,7 @@ PyAPI_FUNC(PyObject*) PyUnicode_EncodeUTF16(
Py_ssize_t length, /* number of Py_UNICODE chars to encode */
const char *errors, /* error handling */
int byteorder /* byteorder to use 0=BOM+native;-1=LE,1=BE */
- );
+ ) Py_DEPRECATED(3.3);
PyAPI_FUNC(PyObject*) _PyUnicode_EncodeUTF16(
PyObject* unicode, /* Unicode object */
const char *errors, /* error handling */
@@ -1515,7 +1519,7 @@ PyAPI_FUNC(PyObject*) PyUnicode_AsUnicodeEscapeString(
PyAPI_FUNC(PyObject*) PyUnicode_EncodeUnicodeEscape(
const Py_UNICODE *data, /* Unicode char buffer */
Py_ssize_t length /* Number of Py_UNICODE chars to encode */
- );
+ ) Py_DEPRECATED(3.3);
#endif
/* --- Raw-Unicode-Escape Codecs ------------------------------------------ */
@@ -1534,7 +1538,7 @@ PyAPI_FUNC(PyObject*) PyUnicode_AsRawUnicodeEscapeString(
PyAPI_FUNC(PyObject*) PyUnicode_EncodeRawUnicodeEscape(
const Py_UNICODE *data, /* Unicode char buffer */
Py_ssize_t length /* Number of Py_UNICODE chars to encode */
- );
+ ) Py_DEPRECATED(3.3);
#endif
/* --- Unicode Internal Codec ---------------------------------------------
@@ -1574,7 +1578,7 @@ PyAPI_FUNC(PyObject*) PyUnicode_EncodeLatin1(
const Py_UNICODE *data, /* Unicode char buffer */
Py_ssize_t length, /* Number of Py_UNICODE chars to encode */
const char *errors /* error handling */
- );
+ ) Py_DEPRECATED(3.3);
#endif
/* --- ASCII Codecs -------------------------------------------------------
@@ -1602,7 +1606,7 @@ PyAPI_FUNC(PyObject*) PyUnicode_EncodeASCII(
const Py_UNICODE *data, /* Unicode char buffer */
Py_ssize_t length, /* Number of Py_UNICODE chars to encode */
const char *errors /* error handling */
- );
+ ) Py_DEPRECATED(3.3);
#endif
/* --- Character Map Codecs -----------------------------------------------
@@ -1648,7 +1652,7 @@ PyAPI_FUNC(PyObject*) PyUnicode_EncodeCharmap(
PyObject *mapping, /* character mapping
(unicode ordinal -> char ordinal) */
const char *errors /* error handling */
- );
+ ) Py_DEPRECATED(3.3);
PyAPI_FUNC(PyObject*) _PyUnicode_EncodeCharmap(
PyObject *unicode, /* Unicode object */
PyObject *mapping, /* character mapping
@@ -1676,7 +1680,7 @@ PyAPI_FUNC(PyObject *) PyUnicode_TranslateCharmap(
Py_ssize_t length, /* Number of Py_UNICODE chars to encode */
PyObject *table, /* Translate table */
const char *errors /* error handling */
- );
+ ) Py_DEPRECATED(3.3);
#endif
#ifdef MS_WINDOWS
@@ -1715,7 +1719,7 @@ PyAPI_FUNC(PyObject*) PyUnicode_EncodeMBCS(
const Py_UNICODE *data, /* Unicode char buffer */
Py_ssize_t length, /* number of Py_UNICODE chars to encode */
const char *errors /* error handling */
- );
+ ) Py_DEPRECATED(3.3);
#endif
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03030000
@@ -1758,7 +1762,7 @@ PyAPI_FUNC(int) PyUnicode_EncodeDecimal(
Py_ssize_t length, /* Number of Py_UNICODE chars to encode */
char *output, /* Output buffer; must have size >= length */
const char *errors /* error handling */
- );
+ ) /* Py_DEPRECATED(3.3) */;
#endif
/* Transforms code points that have decimal digit property to the
@@ -1771,7 +1775,7 @@ PyAPI_FUNC(int) PyUnicode_EncodeDecimal(
PyAPI_FUNC(PyObject*) PyUnicode_TransformDecimalToASCII(
Py_UNICODE *s, /* Unicode buffer */
Py_ssize_t length /* Number of Py_UNICODE chars to transform */
- );
+ ) /* Py_DEPRECATED(3.3) */;
#endif
/* Similar to PyUnicode_TransformDecimalToASCII(), but takes a PyObject
@@ -2196,15 +2200,15 @@ PyAPI_FUNC(int) _PyUnicode_IsLinebreak(
PyAPI_FUNC(Py_UCS4) _PyUnicode_ToLowercase(
Py_UCS4 ch /* Unicode character */
- );
+ ) /* Py_DEPRECATED(3.3) */;
PyAPI_FUNC(Py_UCS4) _PyUnicode_ToUppercase(
Py_UCS4 ch /* Unicode character */
- );
+ ) /* Py_DEPRECATED(3.3) */;
PyAPI_FUNC(Py_UCS4) _PyUnicode_ToTitlecase(
Py_UCS4 ch /* Unicode character */
- );
+ ) Py_DEPRECATED(3.3);
PyAPI_FUNC(int) _PyUnicode_ToLowerFull(
Py_UCS4 ch, /* Unicode character */
@@ -2268,40 +2272,40 @@ PyAPI_FUNC(int) _PyUnicode_IsAlpha(
PyAPI_FUNC(size_t) Py_UNICODE_strlen(
const Py_UNICODE *u
- );
+ ) Py_DEPRECATED(3.3);
PyAPI_FUNC(Py_UNICODE*) Py_UNICODE_strcpy(
Py_UNICODE *s1,
- const Py_UNICODE *s2);
+ const Py_UNICODE *s2) Py_DEPRECATED(3.3);
PyAPI_FUNC(Py_UNICODE*) Py_UNICODE_strcat(
- Py_UNICODE *s1, const Py_UNICODE *s2);
+ Py_UNICODE *s1, const Py_UNICODE *s2) Py_DEPRECATED(3.3);
PyAPI_FUNC(Py_UNICODE*) Py_UNICODE_strncpy(
Py_UNICODE *s1,
const Py_UNICODE *s2,
- size_t n);
+ size_t n) Py_DEPRECATED(3.3);
PyAPI_FUNC(int) Py_UNICODE_strcmp(
const Py_UNICODE *s1,
const Py_UNICODE *s2
- );
+ ) Py_DEPRECATED(3.3);
PyAPI_FUNC(int) Py_UNICODE_strncmp(
const Py_UNICODE *s1,
const Py_UNICODE *s2,
size_t n
- );
+ ) Py_DEPRECATED(3.3);
PyAPI_FUNC(Py_UNICODE*) Py_UNICODE_strchr(
const Py_UNICODE *s,
Py_UNICODE c
- );
+ ) Py_DEPRECATED(3.3);
PyAPI_FUNC(Py_UNICODE*) Py_UNICODE_strrchr(
const Py_UNICODE *s,
Py_UNICODE c
- );
+ ) Py_DEPRECATED(3.3);
PyAPI_FUNC(PyObject*) _PyUnicode_FormatLong(PyObject *, int, int, int);
@@ -2311,7 +2315,7 @@ PyAPI_FUNC(PyObject*) _PyUnicode_FormatLong(PyObject *, int, int, int);
PyAPI_FUNC(Py_UNICODE*) PyUnicode_AsUnicodeCopy(
PyObject *unicode
- );
+ ) Py_DEPRECATED(3.3);
#endif /* Py_LIMITED_API */
#if defined(Py_DEBUG) && !defined(Py_LIMITED_API)
diff --git a/Lib/_bootlocale.py b/Lib/_bootlocale.py
index 4bccac1139..0c61b0d3a0 100644
--- a/Lib/_bootlocale.py
+++ b/Lib/_bootlocale.py
@@ -14,11 +14,17 @@ else:
try:
_locale.CODESET
except AttributeError:
- def getpreferredencoding(do_setlocale=True):
- # This path for legacy systems needs the more complex
- # getdefaultlocale() function, import the full locale module.
- import locale
- return locale.getpreferredencoding(do_setlocale)
+ if hasattr(sys, 'getandroidapilevel'):
+ # On Android langinfo.h and CODESET are missing, and UTF-8 is
+ # always used in mbstowcs() and wcstombs().
+ def getpreferredencoding(do_setlocale=True):
+ return 'UTF-8'
+ else:
+ def getpreferredencoding(do_setlocale=True):
+ # This path for legacy systems needs the more complex
+ # getdefaultlocale() function, import the full locale module.
+ import locale
+ return locale.getpreferredencoding(do_setlocale)
else:
def getpreferredencoding(do_setlocale=True):
assert not do_setlocale
diff --git a/Lib/_pyio.py b/Lib/_pyio.py
index 2ebfb0576f..8f9397660b 100644
--- a/Lib/_pyio.py
+++ b/Lib/_pyio.py
@@ -635,7 +635,7 @@ class BufferedIOBase(IOBase):
implementation, but wrap one.
"""
- def read(self, size=None):
+ def read(self, size=-1):
"""Read and return up to size bytes, where size is an int.
If the argument is omitted, None, or negative, reads and
@@ -655,7 +655,7 @@ class BufferedIOBase(IOBase):
"""
self._unsupported("read")
- def read1(self, size=None):
+ def read1(self, size=-1):
"""Read up to size bytes with at most one read() system call,
where size is an int.
"""
@@ -863,7 +863,7 @@ class BytesIO(BufferedIOBase):
self._buffer.clear()
super().close()
- def read(self, size=None):
+ def read(self, size=-1):
if self.closed:
raise ValueError("read from closed file")
if size is None:
@@ -877,7 +877,7 @@ class BytesIO(BufferedIOBase):
self._pos = newpos
return bytes(b)
- def read1(self, size):
+ def read1(self, size=-1):
"""This is the same as read.
"""
return self.read(size)
@@ -1073,12 +1073,12 @@ class BufferedReader(_BufferedIOMixin):
self._read_pos = 0
return self._read_buf[self._read_pos:]
- def read1(self, size):
+ def read1(self, size=-1):
"""Reads up to size bytes, with at most one read() system call."""
# Returns up to size bytes. If at least one byte is buffered, we
# only return buffered bytes. Otherwise, we do one raw read.
if size < 0:
- raise ValueError("number of bytes to read must be positive")
+ size = self.buffer_size
if size == 0:
return b""
with self._read_lock:
@@ -1270,7 +1270,7 @@ class BufferedRWPair(BufferedIOBase):
self.reader = BufferedReader(reader, buffer_size)
self.writer = BufferedWriter(writer, buffer_size)
- def read(self, size=None):
+ def read(self, size=-1):
if size is None:
size = -1
return self.reader.read(size)
@@ -1284,7 +1284,7 @@ class BufferedRWPair(BufferedIOBase):
def peek(self, size=0):
return self.reader.peek(size)
- def read1(self, size):
+ def read1(self, size=-1):
return self.reader.read1(size)
def readinto1(self, b):
@@ -1370,7 +1370,7 @@ class BufferedRandom(BufferedWriter, BufferedReader):
self.flush()
return BufferedReader.peek(self, size)
- def read1(self, size):
+ def read1(self, size=-1):
self.flush()
return BufferedReader.read1(self, size)
diff --git a/Lib/asyncio/base_events.py b/Lib/asyncio/base_events.py
index 0df58c5f87..ee34996c8a 100644
--- a/Lib/asyncio/base_events.py
+++ b/Lib/asyncio/base_events.py
@@ -16,7 +16,6 @@ to modify the meaning of the API call itself.
import collections
import concurrent.futures
import heapq
-import inspect
import itertools
import logging
import os
diff --git a/Lib/bisect.py b/Lib/bisect.py
index 4a4d05255e..7732c639e3 100644
--- a/Lib/bisect.py
+++ b/Lib/bisect.py
@@ -19,8 +19,6 @@ def insort_right(a, x, lo=0, hi=None):
else: lo = mid+1
a.insert(lo, x)
-insort = insort_right # backward compatibility
-
def bisect_right(a, x, lo=0, hi=None):
"""Return the index where to insert item x in list a, assuming a is sorted.
@@ -42,8 +40,6 @@ def bisect_right(a, x, lo=0, hi=None):
else: lo = mid+1
return lo
-bisect = bisect_right # backward compatibility
-
def insort_left(a, x, lo=0, hi=None):
"""Insert item x in list a, and keep it sorted assuming a is sorted.
@@ -90,3 +86,7 @@ try:
from _bisect import *
except ImportError:
pass
+
+# Create aliases
+bisect = bisect_right
+insort = insort_right
diff --git a/Lib/calendar.py b/Lib/calendar.py
index 07594f3a83..28ac56fdbe 100644
--- a/Lib/calendar.py
+++ b/Lib/calendar.py
@@ -267,7 +267,7 @@ class TextCalendar(Calendar):
"""
Print a single week (no newline).
"""
- print(self.formatweek(theweek, width), end=' ')
+ print(self.formatweek(theweek, width), end='')
def formatday(self, day, weekday, width):
"""
@@ -371,7 +371,7 @@ class TextCalendar(Calendar):
def pryear(self, theyear, w=0, l=0, c=6, m=3):
"""Print a year's calendar."""
- print(self.formatyear(theyear, w, l, c, m))
+ print(self.formatyear(theyear, w, l, c, m), end='')
class HTMLCalendar(Calendar):
diff --git a/Lib/collections/__init__.py b/Lib/collections/__init__.py
index 85b4c3c19a..8408255d27 100644
--- a/Lib/collections/__init__.py
+++ b/Lib/collections/__init__.py
@@ -157,9 +157,9 @@ class OrderedDict(dict):
dict.clear(self)
def popitem(self, last=True):
- '''od.popitem() -> (k, v), return and remove a (key, value) pair.
- Pairs are returned in LIFO order if last is true or FIFO order if false.
+ '''Remove and return a (key, value) pair from the dictionary.
+ Pairs are returned in LIFO order if last is true or FIFO order if false.
'''
if not self:
raise KeyError('dictionary is empty')
@@ -180,11 +180,9 @@ class OrderedDict(dict):
return key, value
def move_to_end(self, key, last=True):
- '''Move an existing element to the end (or beginning if last==False).
-
- Raises KeyError if the element does not exist.
- When last=True, acts like a fast version of self[key]=self.pop(key).
+ '''Move an existing element to the end (or beginning if last is false).
+ Raise KeyError if the element does not exist.
'''
link = self.__map[key]
link_prev = link.prev
@@ -248,7 +246,10 @@ class OrderedDict(dict):
return default
def setdefault(self, key, default=None):
- 'od.setdefault(k[,d]) -> od.get(k,d), also set od[k]=d if k not in od'
+ '''Insert key with a value of default if key is not in the dictionary.
+
+ Return the value for key if key is in the dictionary, else default.
+ '''
if key in self:
return self[key]
self[key] = default
@@ -274,9 +275,7 @@ class OrderedDict(dict):
@classmethod
def fromkeys(cls, iterable, value=None):
- '''OD.fromkeys(S[, v]) -> New ordered dictionary with keys from S.
- If not specified, the value defaults to None.
-
+ '''Create a new ordered dictionary with keys from iterable and values set to value.
'''
self = cls()
for key in iterable:
diff --git a/Lib/csv.py b/Lib/csv.py
index 0349e0bd11..6a8587674f 100644
--- a/Lib/csv.py
+++ b/Lib/csv.py
@@ -307,7 +307,7 @@ class Sniffer:
charFrequency = {}
modes = {}
delims = {}
- start, end = 0, min(chunkLength, len(data))
+ start, end = 0, chunkLength
while start < len(data):
iteration += 1
for line in data[start:end]:
@@ -336,7 +336,7 @@ class Sniffer:
# build a list of possible delimiters
modeList = modes.items()
- total = float(chunkLength * iteration)
+ total = float(min(chunkLength * iteration, len(data)))
# (rows of consistent data) / (number of rows) = 100%
consistency = 1.0
# minimum consistency threshold
diff --git a/Lib/ctypes/util.py b/Lib/ctypes/util.py
index 339ae8aa8a..8856f6594c 100644
--- a/Lib/ctypes/util.py
+++ b/Lib/ctypes/util.py
@@ -318,10 +318,6 @@ def test():
print(find_library("c"))
print(find_library("bz2"))
- # getattr
-## print cdll.m
-## print cdll.bz2
-
# load
if sys.platform == "darwin":
print(cdll.LoadLibrary("libm.dylib"))
diff --git a/Lib/dbm/dumb.py b/Lib/dbm/dumb.py
index 2296dbfd54..c3c4a66601 100644
--- a/Lib/dbm/dumb.py
+++ b/Lib/dbm/dumb.py
@@ -68,7 +68,7 @@ class _Database(collections.MutableMapping):
# Handle the creation
self._create(flag)
- self._update()
+ self._update(flag)
def _create(self, flag):
if flag == 'n':
@@ -92,12 +92,17 @@ class _Database(collections.MutableMapping):
f.close()
# Read directory file into the in-memory index dict.
- def _update(self):
+ def _update(self, flag):
self._index = {}
try:
f = _io.open(self._dirfile, 'r', encoding="Latin-1")
except OSError:
self._modified = not self._readonly
+ if flag not in ('c', 'n'):
+ import warnings
+ warnings.warn("The index file is missing, the "
+ "semantics of the 'c' flag will be used.",
+ DeprecationWarning, stacklevel=4)
else:
self._modified = False
with f:
diff --git a/Lib/distutils/cmd.py b/Lib/distutils/cmd.py
index 939f795945..dba3191e58 100644
--- a/Lib/distutils/cmd.py
+++ b/Lib/distutils/cmd.py
@@ -401,34 +401,3 @@ class Command:
# Otherwise, print the "skip" message
else:
log.debug(skip_msg)
-
-# XXX 'install_misc' class not currently used -- it was the base class for
-# both 'install_scripts' and 'install_data', but they outgrew it. It might
-# still be useful for 'install_headers', though, so I'm keeping it around
-# for the time being.
-
-class install_misc(Command):
- """Common base class for installing some files in a subdirectory.
- Currently used by install_data and install_scripts.
- """
-
- user_options = [('install-dir=', 'd', "directory to install the files to")]
-
- def initialize_options (self):
- self.install_dir = None
- self.outfiles = []
-
- def _install_dir_from(self, dirname):
- self.set_undefined_options('install', (dirname, 'install_dir'))
-
- def _copy_files(self, filelist):
- self.outfiles = []
- if not filelist:
- return
- self.mkpath(self.install_dir)
- for f in filelist:
- self.copy_file(f, self.install_dir)
- self.outfiles.append(os.path.join(self.install_dir, f))
-
- def get_outputs(self):
- return self.outfiles
diff --git a/Lib/distutils/command/build_ext.py b/Lib/distutils/command/build_ext.py
index 74de782d8a..9155626a47 100644
--- a/Lib/distutils/command/build_ext.py
+++ b/Lib/distutils/command/build_ext.py
@@ -715,13 +715,6 @@ class build_ext(Command):
return ext.libraries + [pythonlib]
else:
return ext.libraries
- elif sys.platform[:6] == "cygwin":
- template = "python%d.%d"
- pythonlib = (template %
- (sys.hexversion >> 24, (sys.hexversion >> 16) & 0xff))
- # don't extend ext.libraries, it may be shared with other
- # extensions, it is a reference to the original list
- return ext.libraries + [pythonlib]
elif sys.platform[:6] == "atheos":
from distutils import sysconfig
diff --git a/Lib/distutils/command/sdist.py b/Lib/distutils/command/sdist.py
index 4fd1d4715d..180e28626d 100644
--- a/Lib/distutils/command/sdist.py
+++ b/Lib/distutils/command/sdist.py
@@ -4,17 +4,19 @@ Implements the Distutils 'sdist' command (create a source distribution)."""
import os
import sys
-from types import *
from glob import glob
from warnings import warn
from distutils.core import Command
-from distutils import dir_util, dep_util, file_util, archive_util
+from distutils import dir_util
+from distutils import file_util
+from distutils import archive_util
from distutils.text_file import TextFile
-from distutils.errors import *
from distutils.filelist import FileList
from distutils import log
from distutils.util import convert_path
+from distutils.errors import DistutilsTemplateError, DistutilsOptionError
+
def show_formats():
"""Print all possible values for the 'formats' option (used by
@@ -30,6 +32,7 @@ def show_formats():
FancyGetopt(formats).print_help(
"List of available source distribution formats:")
+
class sdist(Command):
description = "create a source distribution (tarball, zip file, etc.)"
@@ -93,6 +96,8 @@ class sdist(Command):
sub_commands = [('check', checking_metadata)]
+ READMES = 'README', 'README.txt'
+
def initialize_options(self):
# 'template' and 'manifest' are, respectively, the names of
# the manifest template and manifest file.
@@ -216,13 +221,39 @@ class sdist(Command):
Warns if (README or README.txt) or setup.py are missing; everything
else is optional.
"""
- standards = [('README', 'README.txt'), self.distribution.script_name]
+ self._add_defaults_standards()
+ self._add_defaults_optional()
+ self._add_defaults_python()
+ self._add_defaults_data_files()
+ self._add_defaults_ext()
+ self._add_defaults_c_libs()
+ self._add_defaults_scripts()
+
+ @staticmethod
+ def _cs_path_exists(fspath):
+ """
+ Case-sensitive path existence check
+
+ >>> sdist._cs_path_exists(__file__)
+ True
+ >>> sdist._cs_path_exists(__file__.upper())
+ False
+ """
+ if not os.path.exists(fspath):
+ return False
+ # make absolute so we always have a directory
+ abspath = os.path.abspath(fspath)
+ directory, filename = os.path.split(abspath)
+ return filename in os.listdir(directory)
+
+ def _add_defaults_standards(self):
+ standards = [self.READMES, self.distribution.script_name]
for fn in standards:
if isinstance(fn, tuple):
alts = fn
got_it = False
for fn in alts:
- if os.path.exists(fn):
+ if self._cs_path_exists(fn):
got_it = True
self.filelist.append(fn)
break
@@ -231,16 +262,18 @@ class sdist(Command):
self.warn("standard file not found: should have one of " +
', '.join(alts))
else:
- if os.path.exists(fn):
+ if self._cs_path_exists(fn):
self.filelist.append(fn)
else:
self.warn("standard file '%s' not found" % fn)
+ def _add_defaults_optional(self):
optional = ['test/test*.py', 'setup.cfg']
for pattern in optional:
files = filter(os.path.isfile, glob(pattern))
self.filelist.extend(files)
+ def _add_defaults_python(self):
# build_py is used to get:
# - python modules
# - files defined in package_data
@@ -256,28 +289,34 @@ class sdist(Command):
for filename in filenames:
self.filelist.append(os.path.join(src_dir, filename))
+ def _add_defaults_data_files(self):
# getting distribution.data_files
if self.distribution.has_data_files():
for item in self.distribution.data_files:
- if isinstance(item, str): # plain file
+ if isinstance(item, str):
+ # plain file
item = convert_path(item)
if os.path.isfile(item):
self.filelist.append(item)
- else: # a (dirname, filenames) tuple
+ else:
+ # a (dirname, filenames) tuple
dirname, filenames = item
for f in filenames:
f = convert_path(f)
if os.path.isfile(f):
self.filelist.append(f)
+ def _add_defaults_ext(self):
if self.distribution.has_ext_modules():
build_ext = self.get_finalized_command('build_ext')
self.filelist.extend(build_ext.get_source_files())
+ def _add_defaults_c_libs(self):
if self.distribution.has_c_libraries():
build_clib = self.get_finalized_command('build_clib')
self.filelist.extend(build_clib.get_source_files())
+ def _add_defaults_scripts(self):
if self.distribution.has_scripts():
build_scripts = self.get_finalized_command('build_scripts')
self.filelist.extend(build_scripts.get_source_files())
diff --git a/Lib/email/_encoded_words.py b/Lib/email/_encoded_words.py
index 5eaab36ed0..c40ffa917b 100644
--- a/Lib/email/_encoded_words.py
+++ b/Lib/email/_encoded_words.py
@@ -62,7 +62,7 @@ __all__ = ['decode_q',
# regex based decoder.
_q_byte_subber = functools.partial(re.compile(br'=([a-fA-F0-9]{2})').sub,
- lambda m: bytes([int(m.group(1), 16)]))
+ lambda m: bytes.fromhex(m.group(1).decode()))
def decode_q(encoded):
encoded = encoded.replace(b'_', b' ')
diff --git a/Lib/http/client.py b/Lib/http/client.py
index a8e59b9561..0234199dfa 100644
--- a/Lib/http/client.py
+++ b/Lib/http/client.py
@@ -72,7 +72,6 @@ import email.parser
import email.message
import http
import io
-import os
import re
import socket
import collections
@@ -642,14 +641,7 @@ class HTTPResponse(io.BufferedIOBase):
return self._read1_chunked(n)
if self.length is not None and (n < 0 or n > self.length):
n = self.length
- try:
- result = self.fp.read1(n)
- except ValueError:
- if n >= 0:
- raise
- # some implementations, like BufferedReader, don't support -1
- # Read an arbitrarily selected largeish chunk.
- result = self.fp.read1(16*1024)
+ result = self.fp.read1(n)
if not result and n:
self._close_conn()
elif self.length is not None:
diff --git a/Lib/http/cookies.py b/Lib/http/cookies.py
index be3b080aa3..7e0259ee32 100644
--- a/Lib/http/cookies.py
+++ b/Lib/http/cookies.py
@@ -138,12 +138,6 @@ _nulljoin = ''.join
_semispacejoin = '; '.join
_spacejoin = ' '.join
-def _warn_deprecated_setter(setter):
- import warnings
- msg = ('The .%s setter is deprecated. The attribute will be read-only in '
- 'future releases. Please use the set() method instead.' % setter)
- warnings.warn(msg, DeprecationWarning, stacklevel=3)
-
#
# Define an exception visible to External modules
#
@@ -303,29 +297,14 @@ class Morsel(dict):
def key(self):
return self._key
- @key.setter
- def key(self, key):
- _warn_deprecated_setter('key')
- self._key = key
-
@property
def value(self):
return self._value
- @value.setter
- def value(self, value):
- _warn_deprecated_setter('value')
- self._value = value
-
@property
def coded_value(self):
return self._coded_value
- @coded_value.setter
- def coded_value(self, coded_value):
- _warn_deprecated_setter('coded_value')
- self._coded_value = coded_value
-
def __setitem__(self, K, V):
K = K.lower()
if not K in self._reserved:
@@ -366,14 +345,7 @@ class Morsel(dict):
def isReservedKey(self, K):
return K.lower() in self._reserved
- def set(self, key, val, coded_val, LegalChars=_LegalChars):
- if LegalChars != _LegalChars:
- import warnings
- warnings.warn(
- 'LegalChars parameter is deprecated, ignored and will '
- 'be removed in future versions.', DeprecationWarning,
- stacklevel=2)
-
+ def set(self, key, val, coded_val):
if key.lower() in self._reserved:
raise CookieError('Attempt to set a reserved key %r' % (key,))
if not _is_legal_key(key):
diff --git a/Lib/http/server.py b/Lib/http/server.py
index e12e45bfc3..61ddecc7ef 100644
--- a/Lib/http/server.py
+++ b/Lib/http/server.py
@@ -267,8 +267,8 @@ class BaseHTTPRequestHandler(socketserver.StreamRequestHandler):
are in self.command, self.path, self.request_version and
self.headers.
- Return True for success, False for failure; on failure, an
- error is sent back.
+ Return True for success, False for failure; on failure, any relevant
+ error response has already been sent back.
"""
self.command = None # set in case of error on the first line
@@ -278,10 +278,13 @@ class BaseHTTPRequestHandler(socketserver.StreamRequestHandler):
requestline = requestline.rstrip('\r\n')
self.requestline = requestline
words = requestline.split()
- if len(words) == 3:
- command, path, version = words
+ if len(words) == 0:
+ return False
+
+ if len(words) >= 3: # Enough to determine protocol version
+ version = words[-1]
try:
- if version[:5] != 'HTTP/':
+ if not version.startswith('HTTP/'):
raise ValueError
base_version_number = version.split('/', 1)[1]
version_number = base_version_number.split(".")
@@ -306,22 +309,22 @@ class BaseHTTPRequestHandler(socketserver.StreamRequestHandler):
HTTPStatus.HTTP_VERSION_NOT_SUPPORTED,
"Invalid HTTP version (%s)" % base_version_number)
return False
- elif len(words) == 2:
- command, path = words
+ self.request_version = version
+
+ if not 2 <= len(words) <= 3:
+ self.send_error(
+ HTTPStatus.BAD_REQUEST,
+ "Bad request syntax (%r)" % requestline)
+ return False
+ command, path = words[:2]
+ if len(words) == 2:
self.close_connection = True
if command != 'GET':
self.send_error(
HTTPStatus.BAD_REQUEST,
"Bad HTTP/0.9 request type (%r)" % command)
return False
- elif not words:
- return False
- else:
- self.send_error(
- HTTPStatus.BAD_REQUEST,
- "Bad request syntax (%r)" % requestline)
- return False
- self.command, self.path, self.request_version = command, path, version
+ self.command, self.path = command, path
# Examine the headers and look for a Connection directive.
try:
diff --git a/Lib/idlelib/idle_test/test_macosx.py b/Lib/idlelib/idle_test/test_macosx.py
index fae75d8a49..775697b278 100644
--- a/Lib/idlelib/idle_test/test_macosx.py
+++ b/Lib/idlelib/idle_test/test_macosx.py
@@ -4,7 +4,6 @@ Coverage: 71% on Windows.
'''
from idlelib import macosx
from test.support import requires
-import sys
import tkinter as tk
import unittest
import unittest.mock as mock
diff --git a/Lib/idlelib/idle_test/test_tree.py b/Lib/idlelib/idle_test/test_tree.py
index 09ba9641af..bb597d87ff 100644
--- a/Lib/idlelib/idle_test/test_tree.py
+++ b/Lib/idlelib/idle_test/test_tree.py
@@ -5,7 +5,6 @@ Coverage: 56%
from idlelib import tree
from test.support import requires
requires('gui')
-import os
import unittest
from tkinter import Tk
diff --git a/Lib/idlelib/macosx.py b/Lib/idlelib/macosx.py
index c225dd9e1a..d4566cd815 100644
--- a/Lib/idlelib/macosx.py
+++ b/Lib/idlelib/macosx.py
@@ -2,7 +2,6 @@
A number of functions that enhance IDLE on Mac OSX.
"""
from sys import platform # Used in _init_tk_type, changed by test.
-import warnings
import tkinter
diff --git a/Lib/idlelib/stackviewer.py b/Lib/idlelib/stackviewer.py
index 0698def5d4..400fa632a0 100644
--- a/Lib/idlelib/stackviewer.py
+++ b/Lib/idlelib/stackviewer.py
@@ -1,6 +1,5 @@
import linecache
import os
-import re
import sys
import tkinter as tk
diff --git a/Lib/importlib/_bootstrap_external.py b/Lib/importlib/_bootstrap_external.py
index 9feec50842..ec528b2f0d 100644
--- a/Lib/importlib/_bootstrap_external.py
+++ b/Lib/importlib/_bootstrap_external.py
@@ -240,6 +240,7 @@ _code_type = type(_write_atomic.__code__)
# Python 3.6b1 3377 (set __class__ cell from type.__new__ #23722)
# Python 3.6b2 3378 (add BUILD_TUPLE_UNPACK_WITH_CALL #28257)
# Python 3.6rc1 3379 (more thorough __class__ validation #23722)
+# Python 3.7a0 3390 (add LOAD_METHOD and CALL_METHOD opcodes)
#
# MAGIC must change whenever the bytecode emitted by the compiler may no
# longer be understood by older implementations of the eval loop (usually
@@ -248,7 +249,7 @@ _code_type = type(_write_atomic.__code__)
# Whenever MAGIC_NUMBER is changed, the ranges in the magic_values array
# in PC/launcher.c must also be updated.
-MAGIC_NUMBER = (3379).to_bytes(2, 'little') + b'\r\n'
+MAGIC_NUMBER = (3390).to_bytes(2, 'little') + b'\r\n'
_RAW_MAGIC_NUMBER = int.from_bytes(MAGIC_NUMBER, 'little') # For import.c
_PYCACHE = '__pycache__'
diff --git a/Lib/lib2to3/pytree.py b/Lib/lib2to3/pytree.py
index ad3592c05f..c425fe6827 100644
--- a/Lib/lib2to3/pytree.py
+++ b/Lib/lib2to3/pytree.py
@@ -13,7 +13,6 @@ There's also a pattern matching implementation here.
__author__ = "Guido van Rossum <guido@python.org>"
import sys
-import warnings
from io import StringIO
HUGE = 0x7FFFFFFF # maximum repeat count, default max
diff --git a/Lib/lib2to3/tests/__init__.py b/Lib/lib2to3/tests/__init__.py
index c5166fc94c..54221c7994 100644
--- a/Lib/lib2to3/tests/__init__.py
+++ b/Lib/lib2to3/tests/__init__.py
@@ -1,7 +1,6 @@
# Author: Collin Winter
import os
-import unittest
from test.support import load_package_tests
diff --git a/Lib/locale.py b/Lib/locale.py
index 4de0090ed9..f8d1d78c36 100644
--- a/Lib/locale.py
+++ b/Lib/locale.py
@@ -618,15 +618,21 @@ else:
try:
CODESET
except NameError:
- # Fall back to parsing environment variables :-(
- def getpreferredencoding(do_setlocale = True):
- """Return the charset that the user is likely using,
- by looking at environment variables."""
- res = getdefaultlocale()[1]
- if res is None:
- # LANG not set, default conservatively to ASCII
- res = 'ascii'
- return res
+ if hasattr(sys, 'getandroidapilevel'):
+ # On Android langinfo.h and CODESET are missing, and UTF-8 is
+ # always used in mbstowcs() and wcstombs().
+ def getpreferredencoding(do_setlocale = True):
+ return 'UTF-8'
+ else:
+ # Fall back to parsing environment variables :-(
+ def getpreferredencoding(do_setlocale = True):
+ """Return the charset that the user is likely using,
+ by looking at environment variables."""
+ res = getdefaultlocale()[1]
+ if res is None:
+ # LANG not set, default conservatively to ASCII
+ res = 'ascii'
+ return res
else:
def getpreferredencoding(do_setlocale = True):
"""Return the charset that the user is likely using,
diff --git a/Lib/logging/__init__.py b/Lib/logging/__init__.py
index b44a3b2228..49a069255f 100644
--- a/Lib/logging/__init__.py
+++ b/Lib/logging/__init__.py
@@ -1894,7 +1894,7 @@ def log(level, msg, *args, **kwargs):
basicConfig()
root.log(level, msg, *args, **kwargs)
-def disable(level):
+def disable(level=CRITICAL):
"""
Disable all logging calls of severity 'level' and below.
"""
diff --git a/Lib/logging/config.py b/Lib/logging/config.py
index 8a99923bf3..917178e511 100644
--- a/Lib/logging/config.py
+++ b/Lib/logging/config.py
@@ -1,4 +1,4 @@
-# Copyright 2001-2014 by Vinay Sajip. All Rights Reserved.
+# Copyright 2001-2016 by Vinay Sajip. All Rights Reserved.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose and without fee is hereby granted,
@@ -19,7 +19,7 @@ Configuration functions for the logging package for Python. The core package
is based on PEP 282 and comments thereto in comp.lang.python, and influenced
by Apache's log4j system.
-Copyright (C) 2001-2014 Vinay Sajip. All Rights Reserved.
+Copyright (C) 2001-2016 Vinay Sajip. All Rights Reserved.
To use, simply 'import logging' and log away!
"""
@@ -509,21 +509,21 @@ class DictConfigurator(BaseConfigurator):
handler.setLevel(logging._checkLevel(level))
except Exception as e:
raise ValueError('Unable to configure handler '
- '%r: %s' % (name, e))
+ '%r' % name) from e
loggers = config.get('loggers', EMPTY_DICT)
for name in loggers:
try:
self.configure_logger(name, loggers[name], True)
except Exception as e:
raise ValueError('Unable to configure logger '
- '%r: %s' % (name, e))
+ '%r' % name) from e
root = config.get('root', None)
if root:
try:
self.configure_root(root, True)
except Exception as e:
raise ValueError('Unable to configure root '
- 'logger: %s' % e)
+ 'logger') from e
else:
disable_existing = config.pop('disable_existing_loggers', True)
@@ -538,7 +538,7 @@ class DictConfigurator(BaseConfigurator):
formatters[name])
except Exception as e:
raise ValueError('Unable to configure '
- 'formatter %r: %s' % (name, e))
+ 'formatter %r' % name) from e
# Next, do filters - they don't refer to anything else, either
filters = config.get('filters', EMPTY_DICT)
for name in filters:
@@ -546,7 +546,7 @@ class DictConfigurator(BaseConfigurator):
filters[name] = self.configure_filter(filters[name])
except Exception as e:
raise ValueError('Unable to configure '
- 'filter %r: %s' % (name, e))
+ 'filter %r' % name) from e
# Next, do handlers - they refer to formatters and filters
# As handlers can refer to other handlers, sort the keys
@@ -559,11 +559,11 @@ class DictConfigurator(BaseConfigurator):
handler.name = name
handlers[name] = handler
except Exception as e:
- if 'target not configured yet' in str(e):
+ if 'target not configured yet' in str(e.__cause__):
deferred.append(name)
else:
raise ValueError('Unable to configure handler '
- '%r: %s' % (name, e))
+ '%r' % name) from e
# Now do any that were deferred
for name in deferred:
@@ -573,7 +573,7 @@ class DictConfigurator(BaseConfigurator):
handlers[name] = handler
except Exception as e:
raise ValueError('Unable to configure handler '
- '%r: %s' % (name, e))
+ '%r' % name) from e
# Next, do loggers - they refer to handlers and filters
@@ -612,7 +612,7 @@ class DictConfigurator(BaseConfigurator):
self.configure_logger(name, loggers[name])
except Exception as e:
raise ValueError('Unable to configure logger '
- '%r: %s' % (name, e))
+ '%r' % name) from e
#Disable any old loggers. There's no point deleting
#them as other threads may continue to hold references
@@ -637,7 +637,7 @@ class DictConfigurator(BaseConfigurator):
self.configure_root(root)
except Exception as e:
raise ValueError('Unable to configure root '
- 'logger: %s' % e)
+ 'logger') from e
finally:
logging._releaseLock()
@@ -684,7 +684,7 @@ class DictConfigurator(BaseConfigurator):
try:
filterer.addFilter(self.config['filters'][f])
except Exception as e:
- raise ValueError('Unable to add filter %r: %s' % (f, e))
+ raise ValueError('Unable to add filter %r' % f) from e
def configure_handler(self, config):
"""Configure a handler from a dictionary."""
@@ -695,7 +695,7 @@ class DictConfigurator(BaseConfigurator):
formatter = self.config['formatters'][formatter]
except Exception as e:
raise ValueError('Unable to set formatter '
- '%r: %s' % (formatter, e))
+ '%r' % formatter) from e
level = config.pop('level', None)
filters = config.pop('filters', None)
if '()' in config:
@@ -717,7 +717,7 @@ class DictConfigurator(BaseConfigurator):
config['target'] = th
except Exception as e:
raise ValueError('Unable to set target handler '
- '%r: %s' % (config['target'], e))
+ '%r' % config['target']) from e
elif issubclass(klass, logging.handlers.SMTPHandler) and\
'mailhost' in config:
config['mailhost'] = self.as_tuple(config['mailhost'])
@@ -755,7 +755,7 @@ class DictConfigurator(BaseConfigurator):
try:
logger.addHandler(self.config['handlers'][h])
except Exception as e:
- raise ValueError('Unable to add handler %r: %s' % (h, e))
+ raise ValueError('Unable to add handler %r' % h) from e
def common_logger_config(self, logger, config, incremental=False):
"""
diff --git a/Lib/macurl2path.py b/Lib/macurl2path.py
deleted file mode 100644
index a68821d0b7..0000000000
--- a/Lib/macurl2path.py
+++ /dev/null
@@ -1,77 +0,0 @@
-"""Macintosh-specific module for conversion between pathnames and URLs.
-
-Do not import directly; use urllib instead."""
-
-import urllib.parse
-import os
-
-__all__ = ["url2pathname","pathname2url"]
-
-def url2pathname(pathname):
- """OS-specific conversion from a relative URL of the 'file' scheme
- to a file system path; not recommended for general use."""
- #
- # XXXX The .. handling should be fixed...
- #
- tp = urllib.parse.splittype(pathname)[0]
- if tp and tp != 'file':
- raise RuntimeError('Cannot convert non-local URL to pathname')
- # Turn starting /// into /, an empty hostname means current host
- if pathname[:3] == '///':
- pathname = pathname[2:]
- elif pathname[:2] == '//':
- raise RuntimeError('Cannot convert non-local URL to pathname')
- components = pathname.split('/')
- # Remove . and embedded ..
- i = 0
- while i < len(components):
- if components[i] == '.':
- del components[i]
- elif components[i] == '..' and i > 0 and \
- components[i-1] not in ('', '..'):
- del components[i-1:i+1]
- i = i-1
- elif components[i] == '' and i > 0 and components[i-1] != '':
- del components[i]
- else:
- i = i+1
- if not components[0]:
- # Absolute unix path, don't start with colon
- rv = ':'.join(components[1:])
- else:
- # relative unix path, start with colon. First replace
- # leading .. by empty strings (giving ::file)
- i = 0
- while i < len(components) and components[i] == '..':
- components[i] = ''
- i = i + 1
- rv = ':' + ':'.join(components)
- # and finally unquote slashes and other funny characters
- return urllib.parse.unquote(rv)
-
-def pathname2url(pathname):
- """OS-specific conversion from a file system path to a relative URL
- of the 'file' scheme; not recommended for general use."""
- if '/' in pathname:
- raise RuntimeError("Cannot convert pathname containing slashes")
- components = pathname.split(':')
- # Remove empty first and/or last component
- if components[0] == '':
- del components[0]
- if components[-1] == '':
- del components[-1]
- # Replace empty string ('::') by .. (will result in '/../' later)
- for i in range(len(components)):
- if components[i] == '':
- components[i] = '..'
- # Truncate names longer than 31 bytes
- components = map(_pncomp2url, components)
-
- if os.path.isabs(pathname):
- return '/' + '/'.join(components)
- else:
- return '/'.join(components)
-
-def _pncomp2url(component):
- # We want to quote slashes
- return urllib.parse.quote(component[:31], safe='')
diff --git a/Lib/modulefinder.py b/Lib/modulefinder.py
index e220315253..e277ca72f8 100644
--- a/Lib/modulefinder.py
+++ b/Lib/modulefinder.py
@@ -7,7 +7,6 @@ import marshal
import os
import sys
import types
-import struct
import warnings
with warnings.catch_warnings():
warnings.simplefilter('ignore', DeprecationWarning)
diff --git a/Lib/ntpath.py b/Lib/ntpath.py
index a8f4b37f64..10d3f2dc35 100644
--- a/Lib/ntpath.py
+++ b/Lib/ntpath.py
@@ -15,7 +15,7 @@ __all__ = ["normcase","isabs","join","splitdrive","split","splitext",
"basename","dirname","commonprefix","getsize","getmtime",
"getatime","getctime", "islink","exists","lexists","isdir","isfile",
"ismount", "expanduser","expandvars","normpath","abspath",
- "splitunc","curdir","pardir","sep","pathsep","defpath","altsep",
+ "curdir","pardir","sep","pathsep","defpath","altsep",
"extsep","devnull","realpath","supports_unicode_filenames","relpath",
"samefile", "sameopenfile", "samestat", "commonpath"]
@@ -169,28 +169,6 @@ def splitdrive(p):
return p[:0], p
-# Parse UNC paths
-def splitunc(p):
- """Deprecated since Python 3.1. Please use splitdrive() instead;
- it now handles UNC paths.
-
- Split a pathname into UNC mount point and relative path specifiers.
-
- Return a 2-tuple (unc, rest); either part may be empty.
- If unc is not empty, it has the form '//host/mount' (or similar
- using backslashes). unc+rest is always the input path.
- Paths containing drive letters never have a UNC part.
- """
- import warnings
- warnings.warn("ntpath.splitunc is deprecated, use ntpath.splitdrive instead",
- DeprecationWarning, 2)
- drive, path = splitdrive(p)
- if len(drive) == 2:
- # Drive letter present
- return p[:0], p
- return drive, path
-
-
# Split a path in head (everything up to the last '/') and tail (the
# rest). After the trailing '/' is stripped, the invariant
# join(head, tail) == p holds.
diff --git a/Lib/opcode.py b/Lib/opcode.py
index b5916b6619..dffb38c314 100644
--- a/Lib/opcode.py
+++ b/Lib/opcode.py
@@ -212,4 +212,7 @@ def_op('BUILD_CONST_KEY_MAP', 156)
def_op('BUILD_STRING', 157)
def_op('BUILD_TUPLE_UNPACK_WITH_CALL', 158)
+name_op('LOAD_METHOD', 160)
+def_op('CALL_METHOD', 161)
+
del def_op, name_op, jrel_op, jabs_op
diff --git a/Lib/pickle.py b/Lib/pickle.py
index c8370c9f7e..702b0b35ce 100644
--- a/Lib/pickle.py
+++ b/Lib/pickle.py
@@ -1464,12 +1464,19 @@ class _Unpickler:
def load_appends(self):
items = self.pop_mark()
list_obj = self.stack[-1]
- if isinstance(list_obj, list):
- list_obj.extend(items)
+ try:
+ extend = list_obj.extend
+ except AttributeError:
+ pass
else:
- append = list_obj.append
- for item in items:
- append(item)
+ extend(items)
+ return
+ # Even if the PEP 307 requires extend() and append() methods,
+ # fall back on append() if the object has no extend() method
+ # for backward compatibility.
+ append = list_obj.append
+ for item in items:
+ append(item)
dispatch[APPENDS[0]] = load_appends
def load_setitem(self):
diff --git a/Lib/pydoc.py b/Lib/pydoc.py
index 39db3915dc..49555405c5 100644
--- a/Lib/pydoc.py
+++ b/Lib/pydoc.py
@@ -909,7 +909,21 @@ class HTMLDoc(Doc):
for base in bases:
parents.append(self.classlink(base, object.__module__))
title = title + '(%s)' % ', '.join(parents)
- doc = self.markup(getdoc(object), self.preformat, funcs, classes, mdict)
+
+ decl = ''
+ try:
+ signature = inspect.signature(object)
+ except (ValueError, TypeError):
+ signature = None
+ if signature:
+ argspec = str(signature)
+ if argspec and argspec != '()':
+ decl = name + self.escape(argspec) + '\n\n'
+
+ doc = getdoc(object)
+ if decl:
+ doc = decl + (doc or '')
+ doc = self.markup(doc, self.preformat, funcs, classes, mdict)
doc = doc and '<tt>%s<br>&nbsp;</tt>' % doc
return self.section(title, '#000000', '#ffc8d8', contents, 3, doc)
@@ -1213,10 +1227,22 @@ location listed above.
parents = map(makename, bases)
title = title + '(%s)' % ', '.join(parents)
- doc = getdoc(object)
- contents = doc and [doc + '\n'] or []
+ contents = []
push = contents.append
+ try:
+ signature = inspect.signature(object)
+ except (ValueError, TypeError):
+ signature = None
+ if signature:
+ argspec = str(signature)
+ if argspec and argspec != '()':
+ push(name + argspec + '\n')
+
+ doc = getdoc(object)
+ if doc:
+ push(doc + '\n')
+
# List the mro, if non-trivial.
mro = deque(inspect.getmro(object))
if len(mro) > 2:
diff --git a/Lib/pydoc_data/topics.py b/Lib/pydoc_data/topics.py
index c7fac3395b..3579484fd0 100644
--- a/Lib/pydoc_data/topics.py
+++ b/Lib/pydoc_data/topics.py
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
-# Autogenerated by Sphinx on Tue Dec 6 18:51:51 2016
+# Autogenerated by Sphinx on Mon Sep 12 10:47:11 2016
topics = {'assert': '\n'
'The "assert" statement\n'
'**********************\n'
@@ -3702,7 +3702,7 @@ topics = {'assert': '\n'
' end). This is because any time you resume execution (even '
'with a\n'
' simple next or step), you may encounter another '
- 'breakpoint—which\n'
+ 'breakpoint--which\n'
' could have its own command list, leading to ambiguities about '
'which\n'
' list to execute.\n'
@@ -5066,9 +5066,9 @@ topics = {'assert': '\n'
'be formatted\n'
'with the floating point presentation types listed below '
'(except "\'n\'"\n'
- 'and "None"). When doing so, "float()" is used to convert '
- 'the integer\n'
- 'to a floating point number before formatting.\n'
+ 'and None). When doing so, "float()" is used to convert the '
+ 'integer to\n'
+ 'a floating point number before formatting.\n'
'\n'
'The available presentation types for floating point and '
'decimal values\n'
@@ -8503,10 +8503,9 @@ topics = {'assert': '\n'
'defined at the\n'
'class scope. Class variables must be accessed through the '
'first\n'
- 'parameter of instance or class methods, or through the '
- 'implicit\n'
- 'lexically scoped "__class__" reference described in the next '
- 'section.\n'
+ 'parameter of instance or class methods, and cannot be '
+ 'accessed at all\n'
+ 'from static methods.\n'
'\n'
'\n'
'Creating the class object\n'
@@ -8536,38 +8535,6 @@ topics = {'assert': '\n'
'passed to the\n'
'method.\n'
'\n'
- '**CPython implementation detail:** In CPython 3.6 and later, '
- 'the\n'
- '"__class__" cell is passed to the metaclass as a '
- '"__classcell__" entry\n'
- 'in the class namespace. If present, this must be propagated '
- 'up to the\n'
- '"type.__new__" call in order for the class to be '
- 'initialised\n'
- 'correctly. Failing to do so will result in a '
- '"DeprecationWarning" in\n'
- 'Python 3.6, and a "RuntimeWarning" in the future.\n'
- '\n'
- 'When using the default metaclass "type", or any metaclass '
- 'that\n'
- 'ultimately calls "type.__new__", the following additional\n'
- 'customisation steps are invoked after creating the class '
- 'object:\n'
- '\n'
- '* first, "type.__new__" collects all of the descriptors in '
- 'the class\n'
- ' namespace that define a "__set_name__()" method;\n'
- '\n'
- '* second, all of these "__set_name__" methods are called '
- 'with the\n'
- ' class being defined and the assigned name of that '
- 'particular\n'
- ' descriptor; and\n'
- '\n'
- '* finally, the "__init_subclass__()" hook is called on the '
- 'immediate\n'
- ' parent of the new class in its method resolution order.\n'
- '\n'
'After the class object is created, it is passed to the '
'class\n'
'decorators included in the class definition (if any) and the '
@@ -9659,7 +9626,7 @@ topics = {'assert': '\n'
' Unicode ordinals (integers) or characters (strings of '
'length 1) to\n'
' Unicode ordinals, strings (of arbitrary lengths) or '
- '"None".\n'
+ 'None.\n'
' Character keys will then be converted to ordinals.\n'
'\n'
' If there are two arguments, they must be strings of '
@@ -9670,7 +9637,7 @@ topics = {'assert': '\n'
'is a third\n'
' argument, it must be a string, whose characters will be '
'mapped to\n'
- ' "None" in the result.\n'
+ ' None in the result.\n'
'\n'
'str.partition(sep)\n'
'\n'
@@ -11237,7 +11204,7 @@ topics = {'assert': '\n'
'the\n'
' order of their occurrence in the base class list; "__doc__" is '
'the\n'
- ' class\'s documentation string, or "None" if undefined;\n'
+ " class's documentation string, or None if undefined;\n"
' "__annotations__" (optional) is a dictionary containing '
'*variable\n'
' annotations* collected during class body execution.\n'
diff --git a/Lib/socketserver.py b/Lib/socketserver.py
index 41a3766772..6e1ae9fddd 100644
--- a/Lib/socketserver.py
+++ b/Lib/socketserver.py
@@ -126,7 +126,6 @@ __version__ = "0.4"
import socket
import selectors
import os
-import errno
import sys
try:
import threading
diff --git a/Lib/sre_compile.py b/Lib/sre_compile.py
index 420d83de63..2cc39007ac 100644
--- a/Lib/sre_compile.py
+++ b/Lib/sre_compile.py
@@ -576,5 +576,5 @@ def compile(p, flags=0):
return _sre.compile(
pattern, flags | p.pattern.flags, code,
p.pattern.groups-1,
- groupindex, indexgroup
+ groupindex, tuple(indexgroup)
)
diff --git a/Lib/sre_parse.py b/Lib/sre_parse.py
index 6aa49c3bf6..ab37fd3fe2 100644
--- a/Lib/sre_parse.py
+++ b/Lib/sre_parse.py
@@ -947,9 +947,7 @@ def parse_template(source, pattern):
this = chr(ESCAPES[this][1])
except KeyError:
if c in ASCIILETTERS:
- import warnings
- warnings.warn('bad escape %s' % this,
- DeprecationWarning, stacklevel=4)
+ raise s.error('bad escape %s' % this, len(this))
lappend(this)
else:
lappend(this)
diff --git a/Lib/string.py b/Lib/string.py
index c902007643..bc9508c1e6 100644
--- a/Lib/string.py
+++ b/Lib/string.py
@@ -175,14 +175,8 @@ class Formatter:
try:
format_string, *args = args # allow the "format_string" keyword be passed
except ValueError:
- if 'format_string' in kwargs:
- format_string = kwargs.pop('format_string')
- import warnings
- warnings.warn("Passing 'format_string' as keyword argument is "
- "deprecated", DeprecationWarning, stacklevel=2)
- else:
- raise TypeError("format() missing 1 required positional "
- "argument: 'format_string'") from None
+ raise TypeError("format() missing 1 required positional "
+ "argument: 'format_string'") from None
return self.vformat(format_string, args, kwargs)
def vformat(self, format_string, args, kwargs):
diff --git a/Lib/subprocess.py b/Lib/subprocess.py
index 822ddb459e..67b9c9f1b1 100644
--- a/Lib/subprocess.py
+++ b/Lib/subprocess.py
@@ -1027,15 +1027,9 @@ class Popen(object):
return self.returncode
- def wait(self, timeout=None, endtime=None):
+ def wait(self, timeout=None):
"""Wait for child process to terminate. Returns returncode
attribute."""
- if endtime is not None:
- warnings.warn(
- "'endtime' argument is deprecated; use 'timeout'.",
- DeprecationWarning,
- stacklevel=2)
- timeout = self._remaining_time(endtime)
if timeout is None:
timeout_millis = _winapi.INFINITE
else:
@@ -1210,7 +1204,10 @@ class Popen(object):
args = list(args)
if shell:
- args = ["/bin/sh", "-c"] + args
+ # On Android the default shell is at '/system/bin/sh'.
+ unix_shell = ('/system/bin/sh' if
+ hasattr(sys, 'getandroidapilevel') else '/bin/sh')
+ args = [unix_shell, "-c"] + args
if executable:
args[0] = executable
@@ -1393,24 +1390,14 @@ class Popen(object):
return (pid, sts)
- def wait(self, timeout=None, endtime=None):
+ def wait(self, timeout=None):
"""Wait for child process to terminate. Returns returncode
attribute."""
if self.returncode is not None:
return self.returncode
- if endtime is not None:
- warnings.warn(
- "'endtime' argument is deprecated; use 'timeout'.",
- DeprecationWarning,
- stacklevel=2)
- if endtime is not None or timeout is not None:
- if endtime is None:
- endtime = _time() + timeout
- elif timeout is None:
- timeout = self._remaining_time(endtime)
-
- if endtime is not None:
+ if timeout is not None:
+ endtime = _time() + timeout
# Enter a busy loop if we have a timeout. This busy loop was
# cribbed from Lib/threading.py in Thread.wait() at r71065.
delay = 0.0005 # 500 us -> initial delay of 1 ms
diff --git a/Lib/tarfile.py b/Lib/tarfile.py
index 5d4c86ce36..c3777ff2dd 100755
--- a/Lib/tarfile.py
+++ b/Lib/tarfile.py
@@ -1897,13 +1897,12 @@ class TarFile(object):
_safe_print("link to " + tarinfo.linkname)
print()
- def add(self, name, arcname=None, recursive=True, exclude=None, *, filter=None):
+ def add(self, name, arcname=None, recursive=True, *, filter=None):
"""Add the file `name' to the archive. `name' may be any type of file
(directory, fifo, symbolic link, etc.). If given, `arcname'
specifies an alternative name for the file in the archive.
Directories are added recursively by default. This can be avoided by
- setting `recursive' to False. `exclude' is a function that should
- return True for each filename to be excluded. `filter' is a function
+ setting `recursive' to False. `filter' is a function
that expects a TarInfo object argument and returns the changed
TarInfo object, if it returns None the TarInfo object will be
excluded from the archive.
@@ -1913,15 +1912,6 @@ class TarFile(object):
if arcname is None:
arcname = name
- # Exclude pathnames.
- if exclude is not None:
- import warnings
- warnings.warn("use the filter argument instead",
- DeprecationWarning, 2)
- if exclude(name):
- self._dbg(2, "tarfile: Excluded %r" % name)
- return
-
# Skip if somebody tries to archive the archive...
if self.name is not None and os.path.abspath(name) == self.name:
self._dbg(2, "tarfile: Skipped %r" % name)
@@ -1953,7 +1943,7 @@ class TarFile(object):
if recursive:
for f in os.listdir(name):
self.add(os.path.join(name, f), os.path.join(arcname, f),
- recursive, exclude, filter=filter)
+ recursive, filter=filter)
else:
self.addfile(tarinfo)
diff --git a/Lib/test/libregrtest/main.py b/Lib/test/libregrtest/main.py
index f0effc973c..de1f4f9505 100644
--- a/Lib/test/libregrtest/main.py
+++ b/Lib/test/libregrtest/main.py
@@ -107,7 +107,7 @@ class Regrtest:
self.test_times.append((test_time, test))
if ok == PASSED:
self.good.append(test)
- elif ok == FAILED:
+ elif ok in (FAILED, CHILD_ERROR):
self.bad.append(test)
elif ok == ENV_CHANGED:
self.environment_changed.append(test)
@@ -179,19 +179,14 @@ class Regrtest:
self.tests = []
# regex to match 'test_builtin' in line:
# '0:00:00 [ 4/400] test_builtin -- test_dict took 1 sec'
- regex = (r'^(?:[0-9]+:[0-9]+:[0-9]+ *)?'
- r'(?:\[[0-9/ ]+\] *)?'
- r'(test_[a-zA-Z0-9_]+)')
- regex = re.compile(regex)
+ regex = re.compile(r'\btest_[a-zA-Z0-9_]+\b')
with open(os.path.join(support.SAVEDCWD, self.ns.fromfile)) as fp:
for line in fp:
+ line = line.split('#', 1)[0]
line = line.strip()
- if line.startswith('#'):
- continue
- match = regex.match(line)
- if match is None:
- continue
- self.tests.append(match.group(1))
+ match = regex.search(line)
+ if match is not None:
+ self.tests.append(match.group())
removepy(self.tests)
diff --git a/Lib/test/libregrtest/refleak.py b/Lib/test/libregrtest/refleak.py
index 3b3d2458b1..d9f72208cf 100644
--- a/Lib/test/libregrtest/refleak.py
+++ b/Lib/test/libregrtest/refleak.py
@@ -84,7 +84,7 @@ def dash_R(the_module, test, indirect_test, huntrleaks):
indirect_test()
alloc_after, rc_after, fd_after = dash_R_cleanup(fs, ps, pic, zdc,
abcs)
- print('.', end='', flush=True)
+ print('.', end='', file=sys.stderr, flush=True)
if i >= nwarmup:
rc_deltas[i] = rc_after - rc_before
alloc_deltas[i] = alloc_after - alloc_before
diff --git a/Lib/test/libregrtest/runtest_mp.py b/Lib/test/libregrtest/runtest_mp.py
index 9604c16600..34b3ae6a97 100644
--- a/Lib/test/libregrtest/runtest_mp.py
+++ b/Lib/test/libregrtest/runtest_mp.py
@@ -41,7 +41,7 @@ def run_test_in_subprocess(testname, ns):
slaveargs = json.dumps(slaveargs)
cmd = [sys.executable, *support.args_from_interpreter_flags(),
- '-X', 'faulthandler',
+ '-u', # Unbuffered stdout and stderr
'-m', 'test.regrtest',
'--slaveargs', slaveargs]
if ns.pgo:
@@ -129,7 +129,7 @@ class MultiprocessThread(threading.Thread):
result = (CHILD_ERROR, "Exit code %s" % retcode)
self.output.put((test, stdout.rstrip(), stderr.rstrip(),
result))
- return True
+ return False
if not result:
self.output.put((None, None, None, None))
@@ -203,6 +203,8 @@ def run_tests_multiprocess(regrtest):
and test_time >= PROGRESS_MIN_TIME
and not regrtest.ns.pgo):
text += ' (%.0f sec)' % test_time
+ elif ok == CHILD_ERROR:
+ text = '%s (%s)' % (text, test_time)
running = get_running(workers)
if running and not regrtest.ns.pgo:
text += ' -- running: %s' % ', '.join(running)
@@ -216,9 +218,6 @@ def run_tests_multiprocess(regrtest):
if result[0] == INTERRUPTED:
raise KeyboardInterrupt
- if result[0] == CHILD_ERROR:
- msg = "Child error on {}: {}".format(test, result[1])
- raise Exception(msg)
test_index += 1
except KeyboardInterrupt:
regrtest.interrupted = True
diff --git a/Lib/test/multibytecodec_support.py b/Lib/test/multibytecodec_support.py
index f9884c68eb..813b7aa1bd 100644
--- a/Lib/test/multibytecodec_support.py
+++ b/Lib/test/multibytecodec_support.py
@@ -338,7 +338,7 @@ class TestBase_Mapping(unittest.TestCase):
uc = re.findall('<a u="([A-F0-9]{4})" b="([0-9A-F ]+)"/>', ucmdata)
for uni, coded in uc:
unich = chr(int(uni, 16))
- codech = bytes(int(c, 16) for c in coded.split())
+ codech = bytes.fromhex(coded)
self._testpoint(codech, unich)
def test_mapping_supplemental(self):
diff --git a/Lib/test/pystone.py b/Lib/test/pystone.py
deleted file mode 100755
index cf1692ec2d..0000000000
--- a/Lib/test/pystone.py
+++ /dev/null
@@ -1,277 +0,0 @@
-#! /usr/bin/env python3
-
-"""
-"PYSTONE" Benchmark Program
-
-Version: Python/1.2 (corresponds to C/1.1 plus 3 Pystone fixes)
-
-Author: Reinhold P. Weicker, CACM Vol 27, No 10, 10/84 pg. 1013.
-
- Translated from ADA to C by Rick Richardson.
- Every method to preserve ADA-likeness has been used,
- at the expense of C-ness.
-
- Translated from C to Python by Guido van Rossum.
-
-Version History:
-
- Version 1.1 corrects two bugs in version 1.0:
-
- First, it leaked memory: in Proc1(), NextRecord ends
- up having a pointer to itself. I have corrected this
- by zapping NextRecord.PtrComp at the end of Proc1().
-
- Second, Proc3() used the operator != to compare a
- record to None. This is rather inefficient and not
- true to the intention of the original benchmark (where
- a pointer comparison to None is intended; the !=
- operator attempts to find a method __cmp__ to do value
- comparison of the record). Version 1.1 runs 5-10
- percent faster than version 1.0, so benchmark figures
- of different versions can't be compared directly.
-
- Version 1.2 changes the division to floor division.
-
- Under Python 3 version 1.1 would use the normal division
- operator, resulting in some of the operations mistakenly
- yielding floats. Version 1.2 instead uses floor division
- making the benchmark an integer benchmark again.
-
-"""
-
-LOOPS = 50000
-
-from time import time
-
-__version__ = "1.2"
-
-[Ident1, Ident2, Ident3, Ident4, Ident5] = range(1, 6)
-
-class Record:
-
- def __init__(self, PtrComp = None, Discr = 0, EnumComp = 0,
- IntComp = 0, StringComp = 0):
- self.PtrComp = PtrComp
- self.Discr = Discr
- self.EnumComp = EnumComp
- self.IntComp = IntComp
- self.StringComp = StringComp
-
- def copy(self):
- return Record(self.PtrComp, self.Discr, self.EnumComp,
- self.IntComp, self.StringComp)
-
-TRUE = 1
-FALSE = 0
-
-def main(loops=LOOPS):
- benchtime, stones = pystones(loops)
- print("Pystone(%s) time for %d passes = %g" % \
- (__version__, loops, benchtime))
- print("This machine benchmarks at %g pystones/second" % stones)
-
-
-def pystones(loops=LOOPS):
- return Proc0(loops)
-
-IntGlob = 0
-BoolGlob = FALSE
-Char1Glob = '\0'
-Char2Glob = '\0'
-Array1Glob = [0]*51
-Array2Glob = [x[:] for x in [Array1Glob]*51]
-PtrGlb = None
-PtrGlbNext = None
-
-def Proc0(loops=LOOPS):
- global IntGlob
- global BoolGlob
- global Char1Glob
- global Char2Glob
- global Array1Glob
- global Array2Glob
- global PtrGlb
- global PtrGlbNext
-
- starttime = time()
- for i in range(loops):
- pass
- nulltime = time() - starttime
-
- PtrGlbNext = Record()
- PtrGlb = Record()
- PtrGlb.PtrComp = PtrGlbNext
- PtrGlb.Discr = Ident1
- PtrGlb.EnumComp = Ident3
- PtrGlb.IntComp = 40
- PtrGlb.StringComp = "DHRYSTONE PROGRAM, SOME STRING"
- String1Loc = "DHRYSTONE PROGRAM, 1'ST STRING"
- Array2Glob[8][7] = 10
-
- starttime = time()
-
- for i in range(loops):
- Proc5()
- Proc4()
- IntLoc1 = 2
- IntLoc2 = 3
- String2Loc = "DHRYSTONE PROGRAM, 2'ND STRING"
- EnumLoc = Ident2
- BoolGlob = not Func2(String1Loc, String2Loc)
- while IntLoc1 < IntLoc2:
- IntLoc3 = 5 * IntLoc1 - IntLoc2
- IntLoc3 = Proc7(IntLoc1, IntLoc2)
- IntLoc1 = IntLoc1 + 1
- Proc8(Array1Glob, Array2Glob, IntLoc1, IntLoc3)
- PtrGlb = Proc1(PtrGlb)
- CharIndex = 'A'
- while CharIndex <= Char2Glob:
- if EnumLoc == Func1(CharIndex, 'C'):
- EnumLoc = Proc6(Ident1)
- CharIndex = chr(ord(CharIndex)+1)
- IntLoc3 = IntLoc2 * IntLoc1
- IntLoc2 = IntLoc3 // IntLoc1
- IntLoc2 = 7 * (IntLoc3 - IntLoc2) - IntLoc1
- IntLoc1 = Proc2(IntLoc1)
-
- benchtime = time() - starttime - nulltime
- if benchtime == 0.0:
- loopsPerBenchtime = 0.0
- else:
- loopsPerBenchtime = (loops / benchtime)
- return benchtime, loopsPerBenchtime
-
-def Proc1(PtrParIn):
- PtrParIn.PtrComp = NextRecord = PtrGlb.copy()
- PtrParIn.IntComp = 5
- NextRecord.IntComp = PtrParIn.IntComp
- NextRecord.PtrComp = PtrParIn.PtrComp
- NextRecord.PtrComp = Proc3(NextRecord.PtrComp)
- if NextRecord.Discr == Ident1:
- NextRecord.IntComp = 6
- NextRecord.EnumComp = Proc6(PtrParIn.EnumComp)
- NextRecord.PtrComp = PtrGlb.PtrComp
- NextRecord.IntComp = Proc7(NextRecord.IntComp, 10)
- else:
- PtrParIn = NextRecord.copy()
- NextRecord.PtrComp = None
- return PtrParIn
-
-def Proc2(IntParIO):
- IntLoc = IntParIO + 10
- while 1:
- if Char1Glob == 'A':
- IntLoc = IntLoc - 1
- IntParIO = IntLoc - IntGlob
- EnumLoc = Ident1
- if EnumLoc == Ident1:
- break
- return IntParIO
-
-def Proc3(PtrParOut):
- global IntGlob
-
- if PtrGlb is not None:
- PtrParOut = PtrGlb.PtrComp
- else:
- IntGlob = 100
- PtrGlb.IntComp = Proc7(10, IntGlob)
- return PtrParOut
-
-def Proc4():
- global Char2Glob
-
- BoolLoc = Char1Glob == 'A'
- BoolLoc = BoolLoc or BoolGlob
- Char2Glob = 'B'
-
-def Proc5():
- global Char1Glob
- global BoolGlob
-
- Char1Glob = 'A'
- BoolGlob = FALSE
-
-def Proc6(EnumParIn):
- EnumParOut = EnumParIn
- if not Func3(EnumParIn):
- EnumParOut = Ident4
- if EnumParIn == Ident1:
- EnumParOut = Ident1
- elif EnumParIn == Ident2:
- if IntGlob > 100:
- EnumParOut = Ident1
- else:
- EnumParOut = Ident4
- elif EnumParIn == Ident3:
- EnumParOut = Ident2
- elif EnumParIn == Ident4:
- pass
- elif EnumParIn == Ident5:
- EnumParOut = Ident3
- return EnumParOut
-
-def Proc7(IntParI1, IntParI2):
- IntLoc = IntParI1 + 2
- IntParOut = IntParI2 + IntLoc
- return IntParOut
-
-def Proc8(Array1Par, Array2Par, IntParI1, IntParI2):
- global IntGlob
-
- IntLoc = IntParI1 + 5
- Array1Par[IntLoc] = IntParI2
- Array1Par[IntLoc+1] = Array1Par[IntLoc]
- Array1Par[IntLoc+30] = IntLoc
- for IntIndex in range(IntLoc, IntLoc+2):
- Array2Par[IntLoc][IntIndex] = IntLoc
- Array2Par[IntLoc][IntLoc-1] = Array2Par[IntLoc][IntLoc-1] + 1
- Array2Par[IntLoc+20][IntLoc] = Array1Par[IntLoc]
- IntGlob = 5
-
-def Func1(CharPar1, CharPar2):
- CharLoc1 = CharPar1
- CharLoc2 = CharLoc1
- if CharLoc2 != CharPar2:
- return Ident1
- else:
- return Ident2
-
-def Func2(StrParI1, StrParI2):
- IntLoc = 1
- while IntLoc <= 1:
- if Func1(StrParI1[IntLoc], StrParI2[IntLoc+1]) == Ident1:
- CharLoc = 'A'
- IntLoc = IntLoc + 1
- if CharLoc >= 'W' and CharLoc <= 'Z':
- IntLoc = 7
- if CharLoc == 'X':
- return TRUE
- else:
- if StrParI1 > StrParI2:
- IntLoc = IntLoc + 7
- return TRUE
- else:
- return FALSE
-
-def Func3(EnumParIn):
- EnumLoc = EnumParIn
- if EnumLoc == Ident3: return TRUE
- return FALSE
-
-if __name__ == '__main__':
- import sys
- def error(msg):
- print(msg, end=' ', file=sys.stderr)
- print("usage: %s [number_of_loops]" % sys.argv[0], file=sys.stderr)
- sys.exit(100)
- nargs = len(sys.argv) - 1
- if nargs > 1:
- error("%d arguments are too many;" % nargs)
- elif nargs == 1:
- try: loops = int(sys.argv[1])
- except ValueError:
- error("Invalid argument %r;" % sys.argv[1])
- else:
- loops = LOOPS
- main(loops)
diff --git a/Lib/test/support/__init__.py b/Lib/test/support/__init__.py
index 15d8fc849b..6658ece735 100644
--- a/Lib/test/support/__init__.py
+++ b/Lib/test/support/__init__.py
@@ -777,8 +777,13 @@ requires_lzma = unittest.skipUnless(lzma, 'requires lzma')
is_jython = sys.platform.startswith('java')
-_ANDROID_API_LEVEL = sysconfig.get_config_var('ANDROID_API_LEVEL')
-is_android = (_ANDROID_API_LEVEL is not None and _ANDROID_API_LEVEL > 0)
+try:
+ # constant used by requires_android_level()
+ _ANDROID_API_LEVEL = sys.getandroidapilevel()
+ is_android = True
+except AttributeError:
+ # sys.getandroidapilevel() is only available on Android
+ is_android = False
android_not_root = (is_android and os.geteuid() != 0)
if sys.platform != 'win32':
@@ -949,10 +954,11 @@ def temp_dir(path=None, quiet=False):
try:
os.mkdir(path)
dir_created = True
- except OSError:
+ except OSError as exc:
if not quiet:
raise
- warnings.warn('tests may fail, unable to create temp dir: ' + path,
+ warnings.warn(f'tests may fail, unable to create '
+ f'temporary directory {path!r}: {exc}',
RuntimeWarning, stacklevel=3)
try:
yield path
@@ -976,10 +982,11 @@ def change_cwd(path, quiet=False):
saved_dir = os.getcwd()
try:
os.chdir(path)
- except OSError:
+ except OSError as exc:
if not quiet:
raise
- warnings.warn('tests may fail, unable to change CWD to: ' + path,
+ warnings.warn(f'tests may fail, unable to change the current working '
+ f'directory to {path!r}: {exc}',
RuntimeWarning, stacklevel=3)
try:
yield os.getcwd()
diff --git a/Lib/test/support/script_helper.py b/Lib/test/support/script_helper.py
index ca5f9c20dd..1e746472ee 100644
--- a/Lib/test/support/script_helper.py
+++ b/Lib/test/support/script_helper.py
@@ -6,11 +6,8 @@ import importlib
import sys
import os
import os.path
-import tempfile
import subprocess
import py_compile
-import contextlib
-import shutil
import zipfile
from importlib.util import source_from_cache
diff --git a/Lib/test/test_asyncgen.py b/Lib/test/test_asyncgen.py
index 34ab8a04ee..2b7c5d0d35 100644
--- a/Lib/test/test_asyncgen.py
+++ b/Lib/test/test_asyncgen.py
@@ -1,5 +1,4 @@
import inspect
-import sys
import types
import unittest
diff --git a/Lib/test/test_asyncio/test_tasks.py b/Lib/test/test_asyncio/test_tasks.py
index a18d49ae37..fdf91a36b5 100644
--- a/Lib/test/test_asyncio/test_tasks.py
+++ b/Lib/test/test_asyncio/test_tasks.py
@@ -7,7 +7,6 @@ import io
import os
import re
import sys
-import time
import types
import unittest
import weakref
diff --git a/Lib/test/test_asyncio/test_unix_events.py b/Lib/test/test_asyncio/test_unix_events.py
index 5a49984135..11f0890d65 100644
--- a/Lib/test/test_asyncio/test_unix_events.py
+++ b/Lib/test/test_asyncio/test_unix_events.py
@@ -12,7 +12,6 @@ import sys
import tempfile
import threading
import unittest
-import warnings
from unittest import mock
if sys.platform == 'win32':
diff --git a/Lib/test/test_bytes.py b/Lib/test/test_bytes.py
index a103a7d39c..671c35efab 100644
--- a/Lib/test/test_bytes.py
+++ b/Lib/test/test_bytes.py
@@ -306,6 +306,14 @@ class BaseBytesTest:
b = bytearray([0x1a, 0x2b, 0x30])
self.assertEqual(self.type2test.fromhex('1a2B30'), b)
self.assertEqual(self.type2test.fromhex(' 1A 2B 30 '), b)
+
+ # check that ASCII whitespace is ignored
+ self.assertEqual(self.type2test.fromhex(' 1A\n2B\t30\v'), b)
+ for c in "\x09\x0A\x0B\x0C\x0D\x20":
+ self.assertEqual(self.type2test.fromhex(c), self.type2test())
+ for c in "\x1C\x1D\x1E\x1F\x85\xa0\u2000\u2002\u2028":
+ self.assertRaises(ValueError, self.type2test.fromhex, c)
+
self.assertEqual(self.type2test.fromhex('0000'), b'\0\0')
self.assertRaises(TypeError, self.type2test.fromhex, b'1B')
self.assertRaises(ValueError, self.type2test.fromhex, 'a')
diff --git a/Lib/test/test_bz2.py b/Lib/test/test_bz2.py
index eaa472a6cc..e76b283261 100644
--- a/Lib/test/test_bz2.py
+++ b/Lib/test/test_bz2.py
@@ -10,7 +10,6 @@ import pathlib
import random
import shutil
import subprocess
-import sys
from test.support import unlink
import _compression
diff --git a/Lib/test/test_calendar.py b/Lib/test/test_calendar.py
index 2bc4feebbd..bd57653ffa 100644
--- a/Lib/test/test_calendar.py
+++ b/Lib/test/test_calendar.py
@@ -404,7 +404,7 @@ class OutputTestCase(unittest.TestCase):
with support.captured_stdout() as out:
week = [(1,0), (2,1), (3,2), (4,3), (5,4), (6,5), (7,6)]
calendar.TextCalendar().prweek(week, 1)
- self.assertEqual(out.getvalue().strip(), "1 2 3 4 5 6 7")
+ self.assertEqual(out.getvalue(), " 1 2 3 4 5 6 7")
def test_prmonth(self):
with support.captured_stdout() as out:
@@ -414,7 +414,7 @@ class OutputTestCase(unittest.TestCase):
def test_pryear(self):
with support.captured_stdout() as out:
calendar.TextCalendar().pryear(2004)
- self.assertEqual(out.getvalue().strip(), result_2004_text.strip())
+ self.assertEqual(out.getvalue(), result_2004_text)
def test_format(self):
with support.captured_stdout() as out:
diff --git a/Lib/test/test_capi.py b/Lib/test/test_capi.py
index 6c3625d487..2a53f3d081 100644
--- a/Lib/test/test_capi.py
+++ b/Lib/test/test_capi.py
@@ -385,7 +385,7 @@ class EmbeddingTests(unittest.TestCase):
def test_subinterps(self):
# This is just a "don't crash" test
- out, err = self.run_embedded_interpreter()
+ out, err = self.run_embedded_interpreter("repeated_init_and_subinterpreters")
if support.verbose:
print()
print(out)
diff --git a/Lib/test/test_cmd.py b/Lib/test/test_cmd.py
index dd8981f893..99a483be43 100644
--- a/Lib/test/test_cmd.py
+++ b/Lib/test/test_cmd.py
@@ -6,7 +6,6 @@ Original by Michael Schneider
import cmd
import sys
-import re
import unittest
import io
from test import support
diff --git a/Lib/test/test_cmd_line.py b/Lib/test/test_cmd_line.py
index ae2bcd4375..958d282a42 100644
--- a/Lib/test/test_cmd_line.py
+++ b/Lib/test/test_cmd_line.py
@@ -4,7 +4,6 @@
import test.support, unittest
import os
-import shutil
import sys
import subprocess
import tempfile
diff --git a/Lib/test/test_collections.py b/Lib/test/test_collections.py
index 87454cc670..76c71392dd 100644
--- a/Lib/test/test_collections.py
+++ b/Lib/test/test_collections.py
@@ -319,8 +319,7 @@ class TestNamedTuple(unittest.TestCase):
self.assertEqual(Dot(1)._replace(d=999), (999,))
self.assertEqual(Dot(1)._fields, ('d',))
- # n = 5000
- n = 254 # SyntaxError: more than 255 arguments:
+ n = 5000
names = list(set(''.join([choice(string.ascii_letters)
for j in range(10)]) for i in range(n)))
n = len(names)
diff --git a/Lib/test/test_compile.py b/Lib/test/test_compile.py
index da1db1567b..b4a52a5310 100644
--- a/Lib/test/test_compile.py
+++ b/Lib/test/test_compile.py
@@ -401,16 +401,9 @@ if 1:
self.assertNotIn((Ellipsis, Ellipsis), d)
def test_annotation_limit(self):
- # 16 bits are available for # of annotations, but only 8 bits are
- # available for the parameter count, hence 255
- # is the max. Ensure the result of too many annotations is a
- # SyntaxError.
+ # more than 255 annotations, should compile ok
s = "def f(%s): pass"
- s %= ', '.join('a%d:%d' % (i,i) for i in range(256))
- self.assertRaises(SyntaxError, compile, s, '?', 'exec')
- # Test that the max # of annotations compiles.
- s = "def f(%s): pass"
- s %= ', '.join('a%d:%d' % (i,i) for i in range(255))
+ s %= ', '.join('a%d:%d' % (i,i) for i in range(300))
compile(s, '?', 'exec')
def test_mangling(self):
diff --git a/Lib/test/test_configparser.py b/Lib/test/test_configparser.py
index 0d06080da3..696f642621 100644
--- a/Lib/test/test_configparser.py
+++ b/Lib/test/test_configparser.py
@@ -2,7 +2,6 @@ import collections
import configparser
import io
import os
-import sys
import textwrap
import unittest
import warnings
diff --git a/Lib/test/test_dbm_dumb.py b/Lib/test/test_dbm_dumb.py
index df531d64e4..73f2a32a7b 100644
--- a/Lib/test/test_dbm_dumb.py
+++ b/Lib/test/test_dbm_dumb.py
@@ -7,7 +7,6 @@ import operator
import os
import stat
import unittest
-import warnings
import dbm.dumb as dumbdbm
from test import support
from functools import partial
@@ -252,6 +251,20 @@ class DumbDBMTestCase(unittest.TestCase):
f = dumbdbm.open(_fname, value)
f.close()
+ def test_missing_index(self):
+ with dumbdbm.open(_fname, 'n') as f:
+ pass
+ os.unlink(_fname + '.dir')
+ for value in ('r', 'w'):
+ with self.assertWarnsRegex(DeprecationWarning,
+ "The index file is missing, the "
+ "semantics of the 'c' flag will "
+ "be used."):
+ f = dumbdbm.open(_fname, value)
+ f.close()
+ self.assertEqual(os.path.exists(_fname + '.dir'), value == 'w')
+ self.assertFalse(os.path.exists(_fname + '.bak'))
+
def test_invalid_flag(self):
for flag in ('x', 'rf', None):
with self.assertWarnsRegex(DeprecationWarning,
diff --git a/Lib/test/test_decimal.py b/Lib/test/test_decimal.py
index 617a37eec8..59a17af278 100644
--- a/Lib/test/test_decimal.py
+++ b/Lib/test/test_decimal.py
@@ -37,8 +37,6 @@ from test.support import (run_unittest, run_doctest, is_resource_enabled,
from test.support import (check_warnings, import_fresh_module, TestFailed,
run_with_locale, cpython_only)
import random
-import time
-import warnings
import inspect
try:
import threading
diff --git a/Lib/test/test_dis.py b/Lib/test/test_dis.py
index b9b5ac2667..980ae16c65 100644
--- a/Lib/test/test_dis.py
+++ b/Lib/test/test_dis.py
@@ -2,7 +2,6 @@
from test.support import captured_stdout
from test.bytecode_helper import BytecodeTestCase
-import difflib
import unittest
import sys
import dis
diff --git a/Lib/test/test_enum.py b/Lib/test/test_enum.py
index 13a89fc2db..a973081644 100644
--- a/Lib/test/test_enum.py
+++ b/Lib/test/test_enum.py
@@ -2409,6 +2409,8 @@ expected_help_output_with_docs = """\
Help on class Color in module %s:
class Color(enum.Enum)
+ | Color(value, names=None, *, module=None, qualname=None, type=None, start=1)
+ |\x20\x20
| An enumeration.
|\x20\x20
| Method resolution order:
@@ -2446,6 +2448,8 @@ expected_help_output_without_docs = """\
Help on class Color in module %s:
class Color(enum.Enum)
+ | Color(value, names=None, *, module=None, qualname=None, type=None, start=1)
+ |\x20\x20
| Method resolution order:
| Color
| enum.Enum
diff --git a/Lib/test/test_epoll.py b/Lib/test/test_epoll.py
index a7aff8a59e..549e0f7121 100644
--- a/Lib/test/test_epoll.py
+++ b/Lib/test/test_epoll.py
@@ -76,6 +76,8 @@ class TestEPoll(unittest.TestCase):
self.assertRaises(ValueError, ep.fileno)
if hasattr(select, "EPOLL_CLOEXEC"):
select.epoll(select.EPOLL_CLOEXEC).close()
+ select.epoll(flags=select.EPOLL_CLOEXEC).close()
+ select.epoll(flags=0).close()
self.assertRaises(OSError, select.epoll, flags=12356)
def test_badcreate(self):
diff --git a/Lib/test/test_exceptions.py b/Lib/test/test_exceptions.py
index 48379222c3..34265a517f 100644
--- a/Lib/test/test_exceptions.py
+++ b/Lib/test/test_exceptions.py
@@ -1112,6 +1112,20 @@ class ImportErrorTests(unittest.TestCase):
with self.assertRaisesRegex(TypeError, msg):
ImportError('test', invalid='keyword', another=True)
+ def test_reset_attributes(self):
+ exc = ImportError('test', name='name', path='path')
+ self.assertEqual(exc.args, ('test',))
+ self.assertEqual(exc.msg, 'test')
+ self.assertEqual(exc.name, 'name')
+ self.assertEqual(exc.path, 'path')
+
+ # Reset not specified attributes
+ exc.__init__()
+ self.assertEqual(exc.args, ())
+ self.assertEqual(exc.msg, None)
+ self.assertEqual(exc.name, None)
+ self.assertEqual(exc.path, None)
+
def test_non_str_argument(self):
# Issue #15778
with check_warnings(('', BytesWarning), quiet=True):
diff --git a/Lib/test/test_faulthandler.py b/Lib/test/test_faulthandler.py
index bdd8d1a2a6..28dd5f4e98 100644
--- a/Lib/test/test_faulthandler.py
+++ b/Lib/test/test_faulthandler.py
@@ -2,7 +2,6 @@ from contextlib import contextmanager
import datetime
import faulthandler
import os
-import re
import signal
import subprocess
import sys
@@ -44,7 +43,7 @@ def temporary_filename():
def requires_raise(test):
return (test if not is_android else
- requires_android_level(24, 'raise() is buggy')(test))
+ requires_android_level(24, 'raise() is buggy')(test))
class FaultHandlerTests(unittest.TestCase):
def get_output(self, code, filename=None, fd=None):
diff --git a/Lib/test/test_frame.py b/Lib/test/test_frame.py
index 189fca90fe..cabfef236d 100644
--- a/Lib/test/test_frame.py
+++ b/Lib/test/test_frame.py
@@ -1,5 +1,3 @@
-import gc
-import sys
import types
import unittest
import weakref
diff --git a/Lib/test/test_functools.py b/Lib/test/test_functools.py
index 824549b803..63fe83e5db 100644
--- a/Lib/test/test_functools.py
+++ b/Lib/test/test_functools.py
@@ -9,6 +9,7 @@ import sys
from test import support
import time
import unittest
+import unittest.mock
from weakref import proxy
import contextlib
try:
@@ -1191,6 +1192,41 @@ class TestLRU:
self.assertEqual(misses, 4)
self.assertEqual(currsize, 2)
+ def test_lru_hash_only_once(self):
+ # To protect against weird reentrancy bugs and to improve
+ # efficiency when faced with slow __hash__ methods, the
+ # LRU cache guarantees that it will only call __hash__
+ # only once per use as an argument to the cached function.
+
+ @self.module.lru_cache(maxsize=1)
+ def f(x, y):
+ return x * 3 + y
+
+ # Simulate the integer 5
+ mock_int = unittest.mock.Mock()
+ mock_int.__mul__ = unittest.mock.Mock(return_value=15)
+ mock_int.__hash__ = unittest.mock.Mock(return_value=999)
+
+ # Add to cache: One use as an argument gives one call
+ self.assertEqual(f(mock_int, 1), 16)
+ self.assertEqual(mock_int.__hash__.call_count, 1)
+ self.assertEqual(f.cache_info(), (0, 1, 1, 1))
+
+ # Cache hit: One use as an argument gives one additional call
+ self.assertEqual(f(mock_int, 1), 16)
+ self.assertEqual(mock_int.__hash__.call_count, 2)
+ self.assertEqual(f.cache_info(), (1, 1, 1, 1))
+
+ # Cache eviction: No use as an argument gives no additonal call
+ self.assertEqual(f(6, 2), 20)
+ self.assertEqual(mock_int.__hash__.call_count, 2)
+ self.assertEqual(f.cache_info(), (1, 2, 1, 1))
+
+ # Cache miss: One use as an argument gives one additional call
+ self.assertEqual(f(mock_int, 1), 16)
+ self.assertEqual(mock_int.__hash__.call_count, 3)
+ self.assertEqual(f.cache_info(), (1, 3, 1, 1))
+
def test_lru_reentrancy_with_len(self):
# Test to make sure the LRU cache code isn't thrown-off by
# caching the built-in len() function. Since len() can be
@@ -1203,6 +1239,15 @@ class TestLRU:
finally:
builtins.len = old_len
+ def test_lru_star_arg_handling(self):
+ # Test regression that arose in ea064ff3c10f
+ @functools.lru_cache()
+ def f(*args):
+ return args
+
+ self.assertEqual(f(1, 2), (1, 2))
+ self.assertEqual(f((1, 2)), ((1, 2),))
+
def test_lru_type_error(self):
# Regression test for issue #28653.
# lru_cache was leaking when one of the arguments
diff --git a/Lib/test/test_gdb.py b/Lib/test/test_gdb.py
index 60f1d92846..46736f62d5 100644
--- a/Lib/test/test_gdb.py
+++ b/Lib/test/test_gdb.py
@@ -3,13 +3,14 @@
# The code for testing gdb was adapted from similar work in Unladen Swallow's
# Lib/test/test_jit_gdb.py
+import locale
import os
import re
import subprocess
import sys
import sysconfig
+import textwrap
import unittest
-import locale
# Is this Python configured to support threads?
try:
@@ -845,7 +846,24 @@ id(42)
breakpoint='time_gmtime',
cmds_after_breakpoint=['py-bt-full'],
)
- self.assertIn('#0 <built-in method gmtime', gdb_output)
+ self.assertIn('#2 <built-in method gmtime', gdb_output)
+
+ @unittest.skipIf(python_is_optimized(),
+ "Python was compiled with optimizations")
+ def test_wrapper_call(self):
+ cmd = textwrap.dedent('''
+ class MyList(list):
+ def __init__(self):
+ super().__init__() # wrapper_call()
+
+ id("first break point")
+ l = MyList()
+ ''')
+ # Verify with "py-bt":
+ gdb_output = self.get_stack_trace(cmd,
+ cmds_after_breakpoint=['break wrapper_call', 'continue', 'py-bt'])
+ self.assertRegex(gdb_output,
+ r"<method-wrapper u?'__init__' of MyList object at ")
class PyPrintTests(DebuggerTests):
diff --git a/Lib/test/test_http_cookies.py b/Lib/test/test_http_cookies.py
index 2432e0bf53..ca21476da6 100644
--- a/Lib/test/test_http_cookies.py
+++ b/Lib/test/test_http_cookies.py
@@ -9,15 +9,6 @@ import warnings
class CookieTests(unittest.TestCase):
- def setUp(self):
- self._warnings_manager = check_warnings()
- self._warnings_manager.__enter__()
- warnings.filterwarnings("ignore", ".* class is insecure.*",
- DeprecationWarning)
-
- def tearDown(self):
- self._warnings_manager.__exit__(None, None, None)
-
def test_basic(self):
cases = [
{'data': 'chips=ahoy; vienna=finger',
@@ -256,6 +247,9 @@ class MorselTests(unittest.TestCase):
# Check output and js_output.
M['path'] = '/foo' # Try a reserved key as well
M.set(i, "%s_val" % i, "%s_coded_val" % i)
+ self.assertEqual(M.key, i)
+ self.assertEqual(M.value, "%s_val" % i)
+ self.assertEqual(M.coded_value, "%s_coded_val" % i)
self.assertEqual(
M.output(),
"Set-Cookie: %s=%s; Path=/foo" % (i, "%s_coded_val" % i))
@@ -272,16 +266,14 @@ class MorselTests(unittest.TestCase):
self.assertRaises(cookies.CookieError,
M.set, i, '%s_value' % i, '%s_value' % i)
- def test_deprecation(self):
+ def test_set_properties(self):
morsel = cookies.Morsel()
- with self.assertWarnsRegex(DeprecationWarning, r'\bkey\b'):
+ with self.assertRaises(AttributeError):
morsel.key = ''
- with self.assertWarnsRegex(DeprecationWarning, r'\bvalue\b'):
+ with self.assertRaises(AttributeError):
morsel.value = ''
- with self.assertWarnsRegex(DeprecationWarning, r'\bcoded_value\b'):
+ with self.assertRaises(AttributeError):
morsel.coded_value = ''
- with self.assertWarnsRegex(DeprecationWarning, r'\bLegalChars\b'):
- morsel.set('key', 'value', 'coded_value', LegalChars='.*')
def test_eq(self):
base_case = ('key', 'value', '"value"')
diff --git a/Lib/test/test_httpservers.py b/Lib/test/test_httpservers.py
index 4e931446b9..5049538e66 100644
--- a/Lib/test/test_httpservers.py
+++ b/Lib/test/test_httpservers.py
@@ -822,6 +822,16 @@ class BaseHTTPRequestHandlerTestCase(unittest.TestCase):
self.assertEqual(result[0], b'<html><body>Data</body></html>\r\n')
self.verify_get_called()
+ def test_extra_space(self):
+ result = self.send_typical_request(
+ b'GET /spaced out HTTP/1.1\r\n'
+ b'Host: dummy\r\n'
+ b'\r\n'
+ )
+ self.assertTrue(result[0].startswith(b'HTTP/1.1 400 '))
+ self.verify_expected_headers(result[1:result.index(b'\r\n')])
+ self.assertFalse(self.handler.get_called)
+
def test_with_continue_1_0(self):
result = self.send_typical_request(b'GET / HTTP/1.0\r\nExpect: 100-continue\r\n\r\n')
self.verify_http_server_response(result[0])
diff --git a/Lib/test/test_import/__init__.py b/Lib/test/test_import/__init__.py
index 760908efe6..d61782a6cb 100644
--- a/Lib/test/test_import/__init__.py
+++ b/Lib/test/test_import/__init__.py
@@ -14,7 +14,6 @@ import unittest
import unittest.mock as mock
import textwrap
import errno
-import shutil
import contextlib
import test.support
diff --git a/Lib/test/test_importlib/abc.py b/Lib/test/test_importlib/abc.py
index 2070dadc23..5d4b958767 100644
--- a/Lib/test/test_importlib/abc.py
+++ b/Lib/test/test_importlib/abc.py
@@ -1,5 +1,4 @@
import abc
-import unittest
class FinderTests(metaclass=abc.ABCMeta):
diff --git a/Lib/test/test_importlib/test_abc.py b/Lib/test/test_importlib/test_abc.py
index c86248047f..4c090f32de 100644
--- a/Lib/test/test_importlib/test_abc.py
+++ b/Lib/test/test_importlib/test_abc.py
@@ -1,5 +1,3 @@
-import contextlib
-import inspect
import io
import marshal
import os
diff --git a/Lib/test/test_inspect.py b/Lib/test/test_inspect.py
index 88eaabe676..9d9fedc21e 100644
--- a/Lib/test/test_inspect.py
+++ b/Lib/test/test_inspect.py
@@ -10,7 +10,6 @@ import os
from os.path import normcase
import _pickle
import pickle
-import re
import shutil
import sys
import types
@@ -56,8 +55,6 @@ modfile = normcase(modfile)
def revise(filename, *args):
return (normcase(filename),) + args
-import builtins
-
git = mod.StupidGit()
class IsTestBase(unittest.TestCase):
diff --git a/Lib/test/test_io.py b/Lib/test/test_io.py
index aaa64eadff..fc68b09d8f 100644
--- a/Lib/test/test_io.py
+++ b/Lib/test/test_io.py
@@ -1149,6 +1149,7 @@ class BufferedReaderTest(unittest.TestCase, CommonBufferedTests):
self.assertEqual(b"a", bufio.read(1))
self.assertEqual(b"b", bufio.read1(1))
self.assertEqual(rawio._reads, 1)
+ self.assertEqual(b"", bufio.read1(0))
self.assertEqual(b"c", bufio.read1(100))
self.assertEqual(rawio._reads, 1)
self.assertEqual(b"d", bufio.read1(100))
@@ -1157,8 +1158,17 @@ class BufferedReaderTest(unittest.TestCase, CommonBufferedTests):
self.assertEqual(rawio._reads, 3)
self.assertEqual(b"", bufio.read1(100))
self.assertEqual(rawio._reads, 4)
- # Invalid args
- self.assertRaises(ValueError, bufio.read1, -1)
+
+ def test_read1_arbitrary(self):
+ rawio = self.MockRawIO((b"abc", b"d", b"efg"))
+ bufio = self.tp(rawio)
+ self.assertEqual(b"a", bufio.read(1))
+ self.assertEqual(b"bc", bufio.read1())
+ self.assertEqual(b"d", bufio.read1())
+ self.assertEqual(b"efg", bufio.read1(-1))
+ self.assertEqual(rawio._reads, 3)
+ self.assertEqual(b"", bufio.read1())
+ self.assertEqual(rawio._reads, 4)
def test_readinto(self):
rawio = self.MockRawIO((b"abc", b"d", b"efg"))
@@ -1809,6 +1819,7 @@ class BufferedRWPairTest(unittest.TestCase):
pair = self.tp(self.BytesIO(b"abcdef"), self.MockRawIO())
self.assertEqual(pair.read1(3), b"abc")
+ self.assertEqual(pair.read1(), b"def")
def test_readinto(self):
for method in ("readinto", "readinto1"):
@@ -3470,6 +3481,7 @@ class MiscIOTest(unittest.TestCase):
self.assertRaises(ValueError, f.read)
if hasattr(f, "read1"):
self.assertRaises(ValueError, f.read1, 1024)
+ self.assertRaises(ValueError, f.read1)
if hasattr(f, "readall"):
self.assertRaises(ValueError, f.readall)
if hasattr(f, "readinto"):
diff --git a/Lib/test/test_keywordonlyarg.py b/Lib/test/test_keywordonlyarg.py
index d82e33d973..2cf8a89a07 100644
--- a/Lib/test/test_keywordonlyarg.py
+++ b/Lib/test/test_keywordonlyarg.py
@@ -51,24 +51,12 @@ class KeywordOnlyArgTestCase(unittest.TestCase):
self.assertRaisesSyntaxError("def f(p, *, (k1, k2), **kw):\n pass\n")
def testSyntaxForManyArguments(self):
- fundef = "def f("
- for i in range(255):
- fundef += "i%d, "%i
- fundef += "*, key=100):\n pass\n"
- self.assertRaisesSyntaxError(fundef)
-
- fundef2 = "def foo(i,*,"
- for i in range(255):
- fundef2 += "i%d, "%i
- fundef2 += "lastarg):\n pass\n"
- self.assertRaisesSyntaxError(fundef2)
-
- # exactly 255 arguments, should compile ok
- fundef3 = "def f(i,*,"
- for i in range(253):
- fundef3 += "i%d, "%i
- fundef3 += "lastarg):\n pass\n"
- compile(fundef3, "<test>", "single")
+ # more than 255 positional arguments, should compile ok
+ fundef = "def f(%s):\n pass\n" % ', '.join('i%d' % i for i in range(300))
+ compile(fundef, "<test>", "single")
+ # more than 255 keyword-only arguments, should compile ok
+ fundef = "def f(*, %s):\n pass\n" % ', '.join('i%d' % i for i in range(300))
+ compile(fundef, "<test>", "single")
def testTooManyPositionalErrorMessage(self):
def f(a, b=None, *, c=None):
diff --git a/Lib/test/test_logging.py b/Lib/test/test_logging.py
index 9dedc098ba..9f482e1b30 100644
--- a/Lib/test/test_logging.py
+++ b/Lib/test/test_logging.py
@@ -309,6 +309,12 @@ class BuiltinLevelsTest(BaseTest):
self.assertEqual(logging.getLevelName('INFO'), logging.INFO)
self.assertEqual(logging.getLevelName(logging.INFO), 'INFO')
+ def test_regression_29220(self):
+ """See issue #29220 for more information."""
+ logging.addLevelName(logging.INFO, '')
+ self.addCleanup(logging.addLevelName, logging.INFO, 'INFO')
+ self.assertEqual(logging.getLevelName(logging.INFO), '')
+
def test_issue27935(self):
fatal = logging.getLevelName('FATAL')
self.assertEqual(fatal, logging.FATAL)
@@ -3519,6 +3525,11 @@ class ModuleLevelMiscTest(BaseTest):
logging.disable(83)
self.assertEqual(logging.root.manager.disable, 83)
+ # test the default value introduced in 3.7
+ # (Issue #28524)
+ logging.disable()
+ self.assertEqual(logging.root.manager.disable, logging.CRITICAL)
+
def _test_log(self, method, level=None):
called = []
support.patch(self, logging, 'basicConfig',
diff --git a/Lib/test/test_macurl2path.py b/Lib/test/test_macurl2path.py
deleted file mode 100644
index 3490d6daf1..0000000000
--- a/Lib/test/test_macurl2path.py
+++ /dev/null
@@ -1,31 +0,0 @@
-import macurl2path
-import unittest
-
-class MacUrl2PathTestCase(unittest.TestCase):
- def test_url2pathname(self):
- self.assertEqual(":index.html", macurl2path.url2pathname("index.html"))
- self.assertEqual(":bar:index.html", macurl2path.url2pathname("bar/index.html"))
- self.assertEqual("foo:bar:index.html", macurl2path.url2pathname("/foo/bar/index.html"))
- self.assertEqual("foo:bar", macurl2path.url2pathname("/foo/bar/"))
- self.assertEqual("", macurl2path.url2pathname("/"))
- self.assertRaises(RuntimeError, macurl2path.url2pathname, "http://foo.com")
- self.assertEqual("index.html", macurl2path.url2pathname("///index.html"))
- self.assertRaises(RuntimeError, macurl2path.url2pathname, "//index.html")
- self.assertEqual(":index.html", macurl2path.url2pathname("./index.html"))
- self.assertEqual(":index.html", macurl2path.url2pathname("foo/../index.html"))
- self.assertEqual("::index.html", macurl2path.url2pathname("../index.html"))
-
- def test_pathname2url(self):
- self.assertEqual("drive", macurl2path.pathname2url("drive:"))
- self.assertEqual("drive/dir", macurl2path.pathname2url("drive:dir:"))
- self.assertEqual("drive/dir/file", macurl2path.pathname2url("drive:dir:file"))
- self.assertEqual("drive/file", macurl2path.pathname2url("drive:file"))
- self.assertEqual("file", macurl2path.pathname2url("file"))
- self.assertEqual("file", macurl2path.pathname2url(":file"))
- self.assertEqual("dir", macurl2path.pathname2url(":dir:"))
- self.assertEqual("dir/file", macurl2path.pathname2url(":dir:file"))
- self.assertRaises(RuntimeError, macurl2path.pathname2url, "/")
- self.assertEqual("dir/../file", macurl2path.pathname2url("dir::file"))
-
-if __name__ == "__main__":
- unittest.main()
diff --git a/Lib/test/test_memoryio.py b/Lib/test/test_memoryio.py
index 55b693e564..80055ce1e7 100644
--- a/Lib/test/test_memoryio.py
+++ b/Lib/test/test_memoryio.py
@@ -437,10 +437,8 @@ class PyBytesIOTest(MemoryTestMixin, MemorySeekTestMixin, unittest.TestCase):
def test_read1(self):
buf = self.buftype("1234567890")
- memio = self.ioclass(buf)
-
- self.assertRaises(TypeError, memio.read1)
- self.assertEqual(memio.read(), buf)
+ self.assertEqual(self.ioclass(buf).read1(), buf)
+ self.assertEqual(self.ioclass(buf).read1(-1), buf)
def test_readinto(self):
buf = self.buftype("1234567890")
diff --git a/Lib/test/test_ntpath.py b/Lib/test/test_ntpath.py
index 90edb6d080..15215e497d 100644
--- a/Lib/test/test_ntpath.py
+++ b/Lib/test/test_ntpath.py
@@ -72,29 +72,6 @@ class TestNtpath(unittest.TestCase):
self.assertEqual(ntpath.splitdrive('//conky/MOUNTPOİNT/foo/bar'),
('//conky/MOUNTPOİNT', '/foo/bar'))
- def test_splitunc(self):
- with self.assertWarns(DeprecationWarning):
- ntpath.splitunc('')
- with support.check_warnings(('', DeprecationWarning)):
- tester('ntpath.splitunc("c:\\foo\\bar")',
- ('', 'c:\\foo\\bar'))
- tester('ntpath.splitunc("c:/foo/bar")',
- ('', 'c:/foo/bar'))
- tester('ntpath.splitunc("\\\\conky\\mountpoint\\foo\\bar")',
- ('\\\\conky\\mountpoint', '\\foo\\bar'))
- tester('ntpath.splitunc("//conky/mountpoint/foo/bar")',
- ('//conky/mountpoint', '/foo/bar'))
- tester('ntpath.splitunc("\\\\\\conky\\mountpoint\\foo\\bar")',
- ('', '\\\\\\conky\\mountpoint\\foo\\bar'))
- tester('ntpath.splitunc("///conky/mountpoint/foo/bar")',
- ('', '///conky/mountpoint/foo/bar'))
- tester('ntpath.splitunc("\\\\conky\\\\mountpoint\\foo\\bar")',
- ('', '\\\\conky\\\\mountpoint\\foo\\bar'))
- tester('ntpath.splitunc("//conky//mountpoint/foo/bar")',
- ('', '//conky//mountpoint/foo/bar'))
- self.assertEqual(ntpath.splitunc('//conky/MOUNTPOİNT/foo/bar'),
- ('//conky/MOUNTPOİNT', '/foo/bar'))
-
def test_split(self):
tester('ntpath.split("c:\\foo\\bar")', ('c:\\foo', 'bar'))
tester('ntpath.split("\\\\conky\\mountpoint\\foo\\bar")',
@@ -449,7 +426,7 @@ class TestNtpath(unittest.TestCase):
class NtCommonTest(test_genericpath.CommonTest, unittest.TestCase):
pathmodule = ntpath
- attributes = ['relpath', 'splitunc']
+ attributes = ['relpath']
class PathLikeTests(unittest.TestCase):
diff --git a/Lib/test/test_os.py b/Lib/test/test_os.py
index e9fdb0719f..cb15234079 100644
--- a/Lib/test/test_os.py
+++ b/Lib/test/test_os.py
@@ -15,7 +15,6 @@ import locale
import mmap
import os
import pickle
-import re
import shutil
import signal
import socket
diff --git a/Lib/test/test_peepholer.py b/Lib/test/test_peepholer.py
index b0336407c3..efc0afecf5 100644
--- a/Lib/test/test_peepholer.py
+++ b/Lib/test/test_peepholer.py
@@ -1,7 +1,4 @@
import dis
-import re
-import sys
-import textwrap
import unittest
from test.bytecode_helper import BytecodeTestCase
diff --git a/Lib/test/test_raise.py b/Lib/test/test_raise.py
index a41b353778..c6d80b078e 100644
--- a/Lib/test/test_raise.py
+++ b/Lib/test/test_raise.py
@@ -4,7 +4,6 @@
"""Tests for the raise statement."""
from test import support
-import re
import sys
import types
import unittest
diff --git a/Lib/test/test_random.py b/Lib/test/test_random.py
index 5b6a4f06ba..78909dd96e 100644
--- a/Lib/test/test_random.py
+++ b/Lib/test/test_random.py
@@ -5,7 +5,7 @@ import time
import pickle
import warnings
from functools import partial
-from math import log, exp, pi, fsum, sin
+from math import log, exp, pi, fsum, sin, factorial
from test import support
from fractions import Fraction
@@ -118,10 +118,6 @@ class TestBasicOps:
n = 5
pop = range(n)
trials = 10000 # large num prevents false negatives without slowing normal case
- def factorial(n):
- if n == 0:
- return 1
- return n * factorial(n - 1)
for k in range(n):
expected = factorial(n) // factorial(n-k)
perms = {}
diff --git a/Lib/test/test_range.py b/Lib/test/test_range.py
index 9e11e518f6..3675f250af 100644
--- a/Lib/test/test_range.py
+++ b/Lib/test/test_range.py
@@ -4,7 +4,6 @@ import unittest
import sys
import pickle
import itertools
-import test.support
# pure Python implementations (3 args only), for comparison
def pyrange(start, stop, step):
@@ -494,37 +493,13 @@ class RangeTest(unittest.TestCase):
test_id = "reversed(range({}, {}, {}))".format(start, end, step)
self.assert_iterators_equal(iter1, iter2, test_id, limit=100)
- @test.support.cpython_only
- def test_range_iterator_invocation(self):
- import _testcapi
+ def test_range_iterators_invocation(self):
+ # verify range iterators instances cannot be created by
+ # calling their type
rangeiter_type = type(iter(range(0)))
-
- self.assertWarns(DeprecationWarning, rangeiter_type, 1, 3, 1)
-
- with test.support.check_warnings(('', DeprecationWarning)):
- # rangeiter_new doesn't take keyword arguments
- with self.assertRaises(TypeError):
- rangeiter_type(a=1)
-
- # rangeiter_new takes exactly 3 arguments
- self.assertRaises(TypeError, rangeiter_type)
- self.assertRaises(TypeError, rangeiter_type, 1)
- self.assertRaises(TypeError, rangeiter_type, 1, 1)
- self.assertRaises(TypeError, rangeiter_type, 1, 1, 1, 1)
-
- # start, stop and stop must fit in C long
- for good_val in [_testcapi.LONG_MAX, _testcapi.LONG_MIN]:
- rangeiter_type(good_val, good_val, good_val)
- for bad_val in [_testcapi.LONG_MAX + 1, _testcapi.LONG_MIN - 1]:
- self.assertRaises(OverflowError,
- rangeiter_type, bad_val, 1, 1)
- self.assertRaises(OverflowError,
- rangeiter_type, 1, bad_val, 1)
- self.assertRaises(OverflowError,
- rangeiter_type, 1, 1, bad_val)
-
- # step mustn't be zero
- self.assertRaises(ValueError, rangeiter_type, 1, 1, 0)
+ self.assertRaises(TypeError, rangeiter_type, 1, 3, 1)
+ long_rangeiter_type = type(iter(range(1 << 1000)))
+ self.assertRaises(TypeError, long_rangeiter_type, 1, 3, 1)
def test_slice(self):
def check(start, stop, step=None):
diff --git a/Lib/test/test_re.py b/Lib/test/test_re.py
index b945cf094e..1d7fb76c38 100644
--- a/Lib/test/test_re.py
+++ b/Lib/test/test_re.py
@@ -1,12 +1,9 @@
from test.support import verbose, run_unittest, gc_collect, bigmemtest, _2G, \
cpython_only, captured_stdout
-import io
import locale
import re
import sre_compile
import string
-import sys
-import traceback
import unittest
import warnings
from re import Scanner
@@ -126,7 +123,7 @@ class ReTests(unittest.TestCase):
(chr(9)+chr(10)+chr(11)+chr(13)+chr(12)+chr(7)+chr(8)))
for c in 'cdehijklmopqsuwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ':
with self.subTest(c):
- with self.assertWarns(DeprecationWarning):
+ with self.assertRaises(re.error):
self.assertEqual(re.sub('a', '\\' + c, 'a'), '\\' + c)
self.assertEqual(re.sub(r'^\s*', 'X', 'test'), 'Xtest')
@@ -1506,7 +1503,7 @@ class ReTests(unittest.TestCase):
long_overflow = 2**128
self.assertRaises(TypeError, re.finditer, "a", {})
with self.assertRaises(OverflowError):
- _sre.compile("abc", 0, [long_overflow], 0, [], [])
+ _sre.compile("abc", 0, [long_overflow], 0, {}, ())
with self.assertRaises(TypeError):
_sre.compile({}, 0, [], 0, [], [])
diff --git a/Lib/test/test_regrtest.py b/Lib/test/test_regrtest.py
index 751df1537d..0bd62985d9 100644
--- a/Lib/test/test_regrtest.py
+++ b/Lib/test/test_regrtest.py
@@ -354,7 +354,7 @@ class BaseTestCase(unittest.TestCase):
self.assertRegex(output, regex)
def parse_executed_tests(self, output):
- regex = (r'^[0-9]+:[0-9]+:[0-9]+ \[ *[0-9]+(?:/ *[0-9]+)?\] (%s)'
+ regex = (r'^[0-9]+:[0-9]+:[0-9]+ \[ *[0-9]+(?:/ *[0-9]+)*\] (%s)'
% self.TESTNAME_REGEX)
parser = re.finditer(regex, output, re.MULTILINE)
return list(match.group(1) for match in parser)
@@ -676,6 +676,14 @@ class ArgsTestCase(BaseTestCase):
output = self.run_tests('--fromfile', filename)
self.check_executed_tests(output, tests)
+ # test format 'Lib/test/test_opcodes.py'
+ with open(filename, "w") as fp:
+ for name in tests:
+ print('Lib/test/%s.py' % name, file=fp)
+
+ output = self.run_tests('--fromfile', filename)
+ self.check_executed_tests(output, tests)
+
def test_interrupted(self):
code = TEST_INTERRUPTED
test = self.create_test('sigint', code=code)
@@ -801,6 +809,17 @@ class ArgsTestCase(BaseTestCase):
self.assertEqual(output.rstrip().splitlines(),
tests)
+ def test_crashed(self):
+ # Any code which causes a crash
+ code = 'import faulthandler; faulthandler._sigsegv()'
+ crash_test = self.create_test(name="crash", code=code)
+ ok_test = self.create_test(name="ok")
+
+ tests = [crash_test, ok_test]
+ output = self.run_tests("-j2", *tests, exitcode=1)
+ self.check_executed_tests(output, tests, failed=crash_test,
+ randomize=True)
+
if __name__ == '__main__':
unittest.main()
diff --git a/Lib/test/test_set.py b/Lib/test/test_set.py
index 0202981d67..bb1081f034 100644
--- a/Lib/test/test_set.py
+++ b/Lib/test/test_set.py
@@ -10,7 +10,6 @@ import warnings
import collections
import collections.abc
import itertools
-import string
class PassThru(Exception):
pass
diff --git a/Lib/test/test_shutil.py b/Lib/test/test_shutil.py
index 2ad3a21c86..3688eae947 100644
--- a/Lib/test/test_shutil.py
+++ b/Lib/test/test_shutil.py
@@ -20,7 +20,6 @@ from shutil import (make_archive,
SameFileError)
import tarfile
import zipfile
-import warnings
from test import support
from test.support import (TESTFN, check_warnings, captured_stdout,
diff --git a/Lib/test/test_signal.py b/Lib/test/test_signal.py
index ab42ed70cc..8a404ef7a9 100644
--- a/Lib/test/test_signal.py
+++ b/Lib/test/test_signal.py
@@ -1,15 +1,11 @@
import unittest
from test import support
from contextlib import closing
-import enum
-import gc
-import pickle
import select
import signal
import socket
import struct
import subprocess
-import traceback
import sys, os, time, errno
from test.support.script_helper import assert_python_ok, spawn_python
try:
diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py
index 97dc3cd76b..b5c9c0cf21 100644
--- a/Lib/test/test_socket.py
+++ b/Lib/test/test_socket.py
@@ -897,18 +897,28 @@ class GeneralModuleTests(unittest.TestCase):
self.assertRaises(OverflowError, func, 1<<34)
def testNtoHErrors(self):
- good_values = [ 1, 2, 3, 1, 2, 3 ]
- bad_values = [ -1, -2, -3, -1, -2, -3 ]
- for k in good_values:
- socket.ntohl(k)
+ import _testcapi
+ s_good_values = [0, 1, 2, 0xffff]
+ l_good_values = s_good_values + [0xffffffff]
+ l_bad_values = [-1, -2, 1<<32, 1<<1000]
+ s_bad_values = l_bad_values + [_testcapi.INT_MIN - 1,
+ _testcapi.INT_MAX + 1]
+ s_deprecated_values = [1<<16, _testcapi.INT_MAX]
+ for k in s_good_values:
socket.ntohs(k)
- socket.htonl(k)
socket.htons(k)
- for k in bad_values:
- self.assertRaises(OverflowError, socket.ntohl, k)
+ for k in l_good_values:
+ socket.ntohl(k)
+ socket.htonl(k)
+ for k in s_bad_values:
self.assertRaises(OverflowError, socket.ntohs, k)
- self.assertRaises(OverflowError, socket.htonl, k)
self.assertRaises(OverflowError, socket.htons, k)
+ for k in l_bad_values:
+ self.assertRaises(OverflowError, socket.ntohl, k)
+ self.assertRaises(OverflowError, socket.htonl, k)
+ for k in s_deprecated_values:
+ self.assertWarns(DeprecationWarning, socket.ntohs, k)
+ self.assertWarns(DeprecationWarning, socket.htons, k)
def testGetServBy(self):
eq = self.assertEqual
@@ -931,8 +941,11 @@ class GeneralModuleTests(unittest.TestCase):
else:
raise OSError
# Try same call with optional protocol omitted
- port2 = socket.getservbyname(service)
- eq(port, port2)
+ # Issue #26936: Android getservbyname() was broken before API 23.
+ if (not hasattr(sys, 'getandroidapilevel') or
+ sys.getandroidapilevel() >= 23):
+ port2 = socket.getservbyname(service)
+ eq(port, port2)
# Try udp, but don't barf if it doesn't exist
try:
udpport = socket.getservbyname(service, 'udp')
@@ -941,7 +954,9 @@ class GeneralModuleTests(unittest.TestCase):
else:
eq(udpport, port)
# Now make sure the lookup by port returns the same service name
- eq(socket.getservbyport(port2), service)
+ # Issue #26936: Android getservbyport() is broken.
+ if not support.is_android:
+ eq(socket.getservbyport(port2), service)
eq(socket.getservbyport(port, 'tcp'), service)
if udpport is not None:
eq(socket.getservbyport(udpport, 'udp'), service)
@@ -1274,7 +1289,10 @@ class GeneralModuleTests(unittest.TestCase):
socket.getaddrinfo('::1', 80)
# port can be a string service name such as "http", a numeric
# port number or None
- socket.getaddrinfo(HOST, "http")
+ # Issue #26936: Android getaddrinfo() was broken before API level 23.
+ if (not hasattr(sys, 'getandroidapilevel') or
+ sys.getandroidapilevel() >= 23):
+ socket.getaddrinfo(HOST, "http")
socket.getaddrinfo(HOST, 80)
socket.getaddrinfo(HOST, None)
# test family and socktype filters
diff --git a/Lib/test/test_ssl.py b/Lib/test/test_ssl.py
index d203cddbdf..69a65d20a4 100644
--- a/Lib/test/test_ssl.py
+++ b/Lib/test/test_ssl.py
@@ -11,7 +11,6 @@ import gc
import os
import errno
import pprint
-import tempfile
import urllib.request
import traceback
import asyncore
diff --git a/Lib/test/test_string.py b/Lib/test/test_string.py
index 70439f85c8..a7b8aad8ab 100644
--- a/Lib/test/test_string.py
+++ b/Lib/test/test_string.py
@@ -48,9 +48,8 @@ class ModuleTest(unittest.TestCase):
self.assertEqual(fmt.format("-{format_string}-", format_string='test'),
'-test-')
self.assertRaises(KeyError, fmt.format, "-{format_string}-")
- with self.assertWarnsRegex(DeprecationWarning, "format_string"):
- self.assertEqual(fmt.format(arg='test', format_string="-{arg}-"),
- '-test-')
+ with self.assertRaisesRegex(TypeError, "format_string"):
+ fmt.format(format_string="-{arg}-", arg='test')
def test_auto_numbering(self):
fmt = string.Formatter()
diff --git a/Lib/test/test_struct.py b/Lib/test/test_struct.py
index be0047589c..cf1d567966 100644
--- a/Lib/test/test_struct.py
+++ b/Lib/test/test_struct.py
@@ -530,13 +530,13 @@ class StructTest(unittest.TestCase):
# format lists containing only count spec should result in an error
self.assertRaises(struct.error, struct.pack, '12345')
- self.assertRaises(struct.error, struct.unpack, '12345', '')
+ self.assertRaises(struct.error, struct.unpack, '12345', b'')
self.assertRaises(struct.error, struct.pack_into, '12345', store, 0)
self.assertRaises(struct.error, struct.unpack_from, '12345', store, 0)
# Format lists with trailing count spec should result in an error
self.assertRaises(struct.error, struct.pack, 'c12345', 'x')
- self.assertRaises(struct.error, struct.unpack, 'c12345', 'x')
+ self.assertRaises(struct.error, struct.unpack, 'c12345', b'x')
self.assertRaises(struct.error, struct.pack_into, 'c12345', store, 0,
'x')
self.assertRaises(struct.error, struct.unpack_from, 'c12345', store,
@@ -545,7 +545,7 @@ class StructTest(unittest.TestCase):
# Mixed format tests
self.assertRaises(struct.error, struct.pack, '14s42', 'spam and eggs')
self.assertRaises(struct.error, struct.unpack, '14s42',
- 'spam and eggs')
+ b'spam and eggs')
self.assertRaises(struct.error, struct.pack_into, '14s42', store, 0,
'spam and eggs')
self.assertRaises(struct.error, struct.unpack_from, '14s42', store, 0)
diff --git a/Lib/test/test_subclassinit.py b/Lib/test/test_subclassinit.py
index 3c331bb98f..0ad7d17fbd 100644
--- a/Lib/test/test_subclassinit.py
+++ b/Lib/test/test_subclassinit.py
@@ -1,4 +1,3 @@
-import sys
import types
import unittest
diff --git a/Lib/test/test_subprocess.py b/Lib/test/test_subprocess.py
index e63f9f254c..82e0b870af 100644
--- a/Lib/test/test_subprocess.py
+++ b/Lib/test/test_subprocess.py
@@ -1021,19 +1021,6 @@ class ProcessTestCase(BaseTestCase):
# time to start.
self.assertEqual(p.wait(timeout=3), 0)
- def test_wait_endtime(self):
- """Confirm that the deprecated endtime parameter warns."""
- p = subprocess.Popen([sys.executable, "-c", "pass"])
- try:
- with self.assertWarns(DeprecationWarning) as warn_cm:
- p.wait(endtime=time.time()+0.01)
- except subprocess.TimeoutExpired:
- pass # We're not testing endtime timeout behavior.
- finally:
- p.kill()
- self.assertIn('test_subprocess.py', warn_cm.filename)
- self.assertIn('endtime', str(warn_cm.warning))
-
def test_invalid_bufsize(self):
# an invalid type of the bufsize argument should raise
# TypeError.
diff --git a/Lib/test/test_super.py b/Lib/test/test_super.py
index 447dec9130..cb2d7c3223 100644
--- a/Lib/test/test_super.py
+++ b/Lib/test/test_super.py
@@ -1,6 +1,5 @@
"""Unit tests for zero-argument super() & related machinery."""
-import sys
import unittest
import warnings
from test.support import check_warnings
diff --git a/Lib/test/test_support.py b/Lib/test/test_support.py
index e83a4d6426..0dbe02eeb3 100644
--- a/Lib/test/test_support.py
+++ b/Lib/test/test_support.py
@@ -155,8 +155,11 @@ class TestSupport(unittest.TestCase):
finally:
shutil.rmtree(path)
- expected = ['tests may fail, unable to create temp dir: ' + path]
- self.assertEqual(warnings, expected)
+ self.assertEqual(len(warnings), 1, warnings)
+ warn = warnings[0]
+ self.assertTrue(warn.startswith(f'tests may fail, unable to create '
+ f'temporary directory {path!r}: '),
+ warn)
# Tests for change_cwd()
@@ -197,8 +200,12 @@ class TestSupport(unittest.TestCase):
self.assertEqual(os.getcwd(), new_cwd)
warnings = [str(w.message) for w in recorder.warnings]
- expected = ['tests may fail, unable to change CWD to: ' + bad_dir]
- self.assertEqual(warnings, expected)
+ self.assertEqual(len(warnings), 1, warnings)
+ warn = warnings[0]
+ self.assertTrue(warn.startswith(f'tests may fail, unable to change '
+ f'the current working directory '
+ f'to {bad_dir!r}: '),
+ warn)
# Tests for change_cwd()
@@ -209,7 +216,13 @@ class TestSupport(unittest.TestCase):
with support.change_cwd(path=path, quiet=True):
pass
messages = [str(w.message) for w in recorder.warnings]
- self.assertEqual(messages, ['tests may fail, unable to change CWD to: ' + path])
+
+ self.assertEqual(len(messages), 1, messages)
+ msg = messages[0]
+ self.assertTrue(msg.startswith(f'tests may fail, unable to change '
+ f'the current working directory '
+ f'to {path!r}: '),
+ msg)
# Tests for temp_cwd()
diff --git a/Lib/test/test_syntax.py b/Lib/test/test_syntax.py
index 7f7e6dafcf..5d398e6688 100644
--- a/Lib/test/test_syntax.py
+++ b/Lib/test/test_syntax.py
@@ -139,69 +139,100 @@ SyntaxError: Generator expression must be parenthesized if not sole argument
>>> f((x for x in L), 1)
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
->>> f(i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11,
-... i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22,
-... i23, i24, i25, i26, i27, i28, i29, i30, i31, i32, i33,
-... i34, i35, i36, i37, i38, i39, i40, i41, i42, i43, i44,
-... i45, i46, i47, i48, i49, i50, i51, i52, i53, i54, i55,
-... i56, i57, i58, i59, i60, i61, i62, i63, i64, i65, i66,
-... i67, i68, i69, i70, i71, i72, i73, i74, i75, i76, i77,
-... i78, i79, i80, i81, i82, i83, i84, i85, i86, i87, i88,
-... i89, i90, i91, i92, i93, i94, i95, i96, i97, i98, i99,
-... i100, i101, i102, i103, i104, i105, i106, i107, i108,
-... i109, i110, i111, i112, i113, i114, i115, i116, i117,
-... i118, i119, i120, i121, i122, i123, i124, i125, i126,
-... i127, i128, i129, i130, i131, i132, i133, i134, i135,
-... i136, i137, i138, i139, i140, i141, i142, i143, i144,
-... i145, i146, i147, i148, i149, i150, i151, i152, i153,
-... i154, i155, i156, i157, i158, i159, i160, i161, i162,
-... i163, i164, i165, i166, i167, i168, i169, i170, i171,
-... i172, i173, i174, i175, i176, i177, i178, i179, i180,
-... i181, i182, i183, i184, i185, i186, i187, i188, i189,
-... i190, i191, i192, i193, i194, i195, i196, i197, i198,
-... i199, i200, i201, i202, i203, i204, i205, i206, i207,
-... i208, i209, i210, i211, i212, i213, i214, i215, i216,
-... i217, i218, i219, i220, i221, i222, i223, i224, i225,
-... i226, i227, i228, i229, i230, i231, i232, i233, i234,
-... i235, i236, i237, i238, i239, i240, i241, i242, i243,
-... i244, i245, i246, i247, i248, i249, i250, i251, i252,
-... i253, i254, i255)
-Traceback (most recent call last):
-SyntaxError: more than 255 arguments
-
-The actual error cases counts positional arguments, keyword arguments,
-and generator expression arguments separately. This test combines the
-three.
-
->>> f(i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11,
-... i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22,
-... i23, i24, i25, i26, i27, i28, i29, i30, i31, i32, i33,
-... i34, i35, i36, i37, i38, i39, i40, i41, i42, i43, i44,
-... i45, i46, i47, i48, i49, i50, i51, i52, i53, i54, i55,
-... i56, i57, i58, i59, i60, i61, i62, i63, i64, i65, i66,
-... i67, i68, i69, i70, i71, i72, i73, i74, i75, i76, i77,
-... i78, i79, i80, i81, i82, i83, i84, i85, i86, i87, i88,
-... i89, i90, i91, i92, i93, i94, i95, i96, i97, i98, i99,
-... i100, i101, i102, i103, i104, i105, i106, i107, i108,
-... i109, i110, i111, i112, i113, i114, i115, i116, i117,
-... i118, i119, i120, i121, i122, i123, i124, i125, i126,
-... i127, i128, i129, i130, i131, i132, i133, i134, i135,
-... i136, i137, i138, i139, i140, i141, i142, i143, i144,
-... i145, i146, i147, i148, i149, i150, i151, i152, i153,
-... i154, i155, i156, i157, i158, i159, i160, i161, i162,
-... i163, i164, i165, i166, i167, i168, i169, i170, i171,
-... i172, i173, i174, i175, i176, i177, i178, i179, i180,
-... i181, i182, i183, i184, i185, i186, i187, i188, i189,
-... i190, i191, i192, i193, i194, i195, i196, i197, i198,
-... i199, i200, i201, i202, i203, i204, i205, i206, i207,
-... i208, i209, i210, i211, i212, i213, i214, i215, i216,
-... i217, i218, i219, i220, i221, i222, i223, i224, i225,
-... i226, i227, i228, i229, i230, i231, i232, i233, i234,
-... i235, i236, i237, i238, i239, i240, i241, i242, i243,
-... (x for x in i244), i245, i246, i247, i248, i249, i250, i251,
-... i252=1, i253=1, i254=1, i255=1)
-Traceback (most recent call last):
-SyntaxError: more than 255 arguments
+>>> def g(*args, **kwargs):
+... print(args, sorted(kwargs.items()))
+>>> g(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
+... 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37,
+... 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55,
+... 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73,
+... 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91,
+... 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107,
+... 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121,
+... 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135,
+... 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149,
+... 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163,
+... 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177,
+... 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191,
+... 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205,
+... 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219,
+... 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233,
+... 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247,
+... 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261,
+... 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275,
+... 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289,
+... 290, 291, 292, 293, 294, 295, 296, 297, 298, 299) # doctest: +ELLIPSIS
+(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, ..., 297, 298, 299) []
+
+>>> g(a000=0, a001=1, a002=2, a003=3, a004=4, a005=5, a006=6, a007=7, a008=8,
+... a009=9, a010=10, a011=11, a012=12, a013=13, a014=14, a015=15, a016=16,
+... a017=17, a018=18, a019=19, a020=20, a021=21, a022=22, a023=23, a024=24,
+... a025=25, a026=26, a027=27, a028=28, a029=29, a030=30, a031=31, a032=32,
+... a033=33, a034=34, a035=35, a036=36, a037=37, a038=38, a039=39, a040=40,
+... a041=41, a042=42, a043=43, a044=44, a045=45, a046=46, a047=47, a048=48,
+... a049=49, a050=50, a051=51, a052=52, a053=53, a054=54, a055=55, a056=56,
+... a057=57, a058=58, a059=59, a060=60, a061=61, a062=62, a063=63, a064=64,
+... a065=65, a066=66, a067=67, a068=68, a069=69, a070=70, a071=71, a072=72,
+... a073=73, a074=74, a075=75, a076=76, a077=77, a078=78, a079=79, a080=80,
+... a081=81, a082=82, a083=83, a084=84, a085=85, a086=86, a087=87, a088=88,
+... a089=89, a090=90, a091=91, a092=92, a093=93, a094=94, a095=95, a096=96,
+... a097=97, a098=98, a099=99, a100=100, a101=101, a102=102, a103=103,
+... a104=104, a105=105, a106=106, a107=107, a108=108, a109=109, a110=110,
+... a111=111, a112=112, a113=113, a114=114, a115=115, a116=116, a117=117,
+... a118=118, a119=119, a120=120, a121=121, a122=122, a123=123, a124=124,
+... a125=125, a126=126, a127=127, a128=128, a129=129, a130=130, a131=131,
+... a132=132, a133=133, a134=134, a135=135, a136=136, a137=137, a138=138,
+... a139=139, a140=140, a141=141, a142=142, a143=143, a144=144, a145=145,
+... a146=146, a147=147, a148=148, a149=149, a150=150, a151=151, a152=152,
+... a153=153, a154=154, a155=155, a156=156, a157=157, a158=158, a159=159,
+... a160=160, a161=161, a162=162, a163=163, a164=164, a165=165, a166=166,
+... a167=167, a168=168, a169=169, a170=170, a171=171, a172=172, a173=173,
+... a174=174, a175=175, a176=176, a177=177, a178=178, a179=179, a180=180,
+... a181=181, a182=182, a183=183, a184=184, a185=185, a186=186, a187=187,
+... a188=188, a189=189, a190=190, a191=191, a192=192, a193=193, a194=194,
+... a195=195, a196=196, a197=197, a198=198, a199=199, a200=200, a201=201,
+... a202=202, a203=203, a204=204, a205=205, a206=206, a207=207, a208=208,
+... a209=209, a210=210, a211=211, a212=212, a213=213, a214=214, a215=215,
+... a216=216, a217=217, a218=218, a219=219, a220=220, a221=221, a222=222,
+... a223=223, a224=224, a225=225, a226=226, a227=227, a228=228, a229=229,
+... a230=230, a231=231, a232=232, a233=233, a234=234, a235=235, a236=236,
+... a237=237, a238=238, a239=239, a240=240, a241=241, a242=242, a243=243,
+... a244=244, a245=245, a246=246, a247=247, a248=248, a249=249, a250=250,
+... a251=251, a252=252, a253=253, a254=254, a255=255, a256=256, a257=257,
+... a258=258, a259=259, a260=260, a261=261, a262=262, a263=263, a264=264,
+... a265=265, a266=266, a267=267, a268=268, a269=269, a270=270, a271=271,
+... a272=272, a273=273, a274=274, a275=275, a276=276, a277=277, a278=278,
+... a279=279, a280=280, a281=281, a282=282, a283=283, a284=284, a285=285,
+... a286=286, a287=287, a288=288, a289=289, a290=290, a291=291, a292=292,
+... a293=293, a294=294, a295=295, a296=296, a297=297, a298=298, a299=299)
+... # doctest: +ELLIPSIS
+() [('a000', 0), ('a001', 1), ('a002', 2), ..., ('a298', 298), ('a299', 299)]
+
+>>> class C:
+... def meth(self, *args):
+... return args
+>>> obj = C()
+>>> obj.meth(
+... 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
+... 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37,
+... 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55,
+... 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73,
+... 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91,
+... 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107,
+... 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121,
+... 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135,
+... 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149,
+... 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163,
+... 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177,
+... 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191,
+... 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205,
+... 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219,
+... 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233,
+... 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247,
+... 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261,
+... 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275,
+... 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289,
+... 290, 291, 292, 293, 294, 295, 296, 297, 298, 299) # doctest: +ELLIPSIS
+(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, ..., 297, 298, 299)
>>> f(lambda x: x[0] = 3)
Traceback (most recent call last):
diff --git a/Lib/test/test_sys.py b/Lib/test/test_sys.py
index df9ebd4085..e6d8e5082f 100644
--- a/Lib/test/test_sys.py
+++ b/Lib/test/test_sys.py
@@ -826,6 +826,13 @@ class SysModuleTest(unittest.TestCase):
rc, stdout, stderr = assert_python_ok('-c', code)
self.assertEqual(stdout.rstrip(), b'True')
+ @unittest.skipUnless(hasattr(sys, 'getandroidapilevel'),
+ 'need sys.getandroidapilevel()')
+ def test_getandroidapilevel(self):
+ level = sys.getandroidapilevel()
+ self.assertIsInstance(level, int)
+ self.assertGreater(level, 0)
+
@test.support.cpython_only
class SizeofTest(unittest.TestCase):
@@ -919,7 +926,7 @@ class SizeofTest(unittest.TestCase):
def inner():
return x
return inner
- check(get_cell2.__code__, size('6i13P') + 1)
+ check(get_cell2.__code__, size('6i13P') + calcsize('n'))
# complex
check(complex(0,1), size('2d'))
# method_descriptor (descriptor object)
diff --git a/Lib/test/test_sysconfig.py b/Lib/test/test_sysconfig.py
index a29ca96d1f..694435f56c 100644
--- a/Lib/test/test_sysconfig.py
+++ b/Lib/test/test_sysconfig.py
@@ -5,8 +5,7 @@ import subprocess
import shutil
from copy import copy
-from test.support import (run_unittest,
- import_module, TESTFN, unlink, check_warnings,
+from test.support import (import_module, TESTFN, unlink, check_warnings,
captured_stdout, skip_unless_symlink, change_cwd)
import sysconfig
@@ -438,8 +437,5 @@ class MakefileTests(unittest.TestCase):
})
-def test_main():
- run_unittest(TestSysConfig, MakefileTests)
-
if __name__ == "__main__":
- test_main()
+ unittest.main()
diff --git a/Lib/test/test_tarfile.py b/Lib/test/test_tarfile.py
index 619cbc03b2..3c51c04c58 100644
--- a/Lib/test/test_tarfile.py
+++ b/Lib/test/test_tarfile.py
@@ -1145,33 +1145,6 @@ class WriteTest(WriteTestBase, unittest.TestCase):
finally:
tar.close()
- def test_exclude(self):
- tempdir = os.path.join(TEMPDIR, "exclude")
- os.mkdir(tempdir)
- try:
- for name in ("foo", "bar", "baz"):
- name = os.path.join(tempdir, name)
- support.create_empty_file(name)
-
- exclude = os.path.isfile
-
- tar = tarfile.open(tmpname, self.mode, encoding="iso8859-1")
- try:
- with support.check_warnings(("use the filter argument",
- DeprecationWarning)):
- tar.add(tempdir, arcname="empty_dir", exclude=exclude)
- finally:
- tar.close()
-
- tar = tarfile.open(tmpname, "r")
- try:
- self.assertEqual(len(tar.getmembers()), 1)
- self.assertEqual(tar.getnames()[0], "empty_dir")
- finally:
- tar.close()
- finally:
- support.rmtree(tempdir)
-
def test_filter(self):
tempdir = os.path.join(TEMPDIR, "filter")
os.mkdir(tempdir)
diff --git a/Lib/test/test_timeit.py b/Lib/test/test_timeit.py
index 1a95e2979c..e02d4a71a9 100644
--- a/Lib/test/test_timeit.py
+++ b/Lib/test/test_timeit.py
@@ -2,7 +2,6 @@ import timeit
import unittest
import sys
import io
-import time
from textwrap import dedent
from test.support import captured_stdout
@@ -12,7 +11,7 @@ from test.support import captured_stderr
DEFAULT_NUMBER = 1000000
# timeit's default number of repetitions.
-DEFAULT_REPEAT = 3
+DEFAULT_REPEAT = 5
# XXX: some tests are commented out that would improve the coverage but take a
# long time to run because they test the default number of loops, which is
@@ -226,7 +225,7 @@ class TestTimeit(unittest.TestCase):
t.print_exc(s)
self.assert_exc_string(s.getvalue(), 'ZeroDivisionError')
- MAIN_DEFAULT_OUTPUT = "10 loops, best of 3: 1 sec per loop\n"
+ MAIN_DEFAULT_OUTPUT = "1 loop, best of 5: 1 sec per loop\n"
def run_main(self, seconds_per_increment=1.0, switches=None, timer=None):
if timer is None:
@@ -252,39 +251,39 @@ class TestTimeit(unittest.TestCase):
def test_main_seconds(self):
s = self.run_main(seconds_per_increment=5.5)
- self.assertEqual(s, "10 loops, best of 3: 5.5 sec per loop\n")
+ self.assertEqual(s, "1 loop, best of 5: 5.5 sec per loop\n")
def test_main_milliseconds(self):
s = self.run_main(seconds_per_increment=0.0055)
- self.assertEqual(s, "100 loops, best of 3: 5.5 msec per loop\n")
+ self.assertEqual(s, "50 loops, best of 5: 5.5 msec per loop\n")
def test_main_microseconds(self):
s = self.run_main(seconds_per_increment=0.0000025, switches=['-n100'])
- self.assertEqual(s, "100 loops, best of 3: 2.5 usec per loop\n")
+ self.assertEqual(s, "100 loops, best of 5: 2.5 usec per loop\n")
def test_main_fixed_iters(self):
s = self.run_main(seconds_per_increment=2.0, switches=['-n35'])
- self.assertEqual(s, "35 loops, best of 3: 2 sec per loop\n")
+ self.assertEqual(s, "35 loops, best of 5: 2 sec per loop\n")
def test_main_setup(self):
s = self.run_main(seconds_per_increment=2.0,
switches=['-n35', '-s', 'print("CustomSetup")'])
- self.assertEqual(s, "CustomSetup\n" * 3 +
- "35 loops, best of 3: 2 sec per loop\n")
+ self.assertEqual(s, "CustomSetup\n" * DEFAULT_REPEAT +
+ "35 loops, best of 5: 2 sec per loop\n")
def test_main_multiple_setups(self):
s = self.run_main(seconds_per_increment=2.0,
switches=['-n35', '-s', 'a = "CustomSetup"', '-s', 'print(a)'])
- self.assertEqual(s, "CustomSetup\n" * 3 +
- "35 loops, best of 3: 2 sec per loop\n")
+ self.assertEqual(s, "CustomSetup\n" * DEFAULT_REPEAT +
+ "35 loops, best of 5: 2 sec per loop\n")
def test_main_fixed_reps(self):
s = self.run_main(seconds_per_increment=60.0, switches=['-r9'])
- self.assertEqual(s, "10 loops, best of 9: 60 sec per loop\n")
+ self.assertEqual(s, "1 loop, best of 9: 60 sec per loop\n")
def test_main_negative_reps(self):
s = self.run_main(seconds_per_increment=60.0, switches=['-r-5'])
- self.assertEqual(s, "10 loops, best of 1: 60 sec per loop\n")
+ self.assertEqual(s, "1 loop, best of 1: 60 sec per loop\n")
@unittest.skipIf(sys.flags.optimize >= 2, "need __doc__")
def test_main_help(self):
@@ -293,56 +292,57 @@ class TestTimeit(unittest.TestCase):
# the help text, but since it's there, check for it.
self.assertEqual(s, timeit.__doc__ + ' ')
- def test_main_using_time(self):
- fake_timer = FakeTimer()
- s = self.run_main(switches=['-t'], timer=fake_timer)
- self.assertEqual(s, self.MAIN_DEFAULT_OUTPUT)
- self.assertIs(fake_timer.saved_timer, time.time)
-
- def test_main_using_clock(self):
- fake_timer = FakeTimer()
- s = self.run_main(switches=['-c'], timer=fake_timer)
- self.assertEqual(s, self.MAIN_DEFAULT_OUTPUT)
- self.assertIs(fake_timer.saved_timer, time.clock)
-
def test_main_verbose(self):
s = self.run_main(switches=['-v'])
self.assertEqual(s, dedent("""\
- 10 loops -> 10 secs
- raw times: 10 10 10
- 10 loops, best of 3: 1 sec per loop
+ 1 loop -> 1 secs
+
+ raw times: 1 sec, 1 sec, 1 sec, 1 sec, 1 sec
+
+ 1 loop, best of 5: 1 sec per loop
"""))
def test_main_very_verbose(self):
- s = self.run_main(seconds_per_increment=0.000050, switches=['-vv'])
+ s = self.run_main(seconds_per_increment=0.000_030, switches=['-vv'])
self.assertEqual(s, dedent("""\
- 10 loops -> 0.0005 secs
- 100 loops -> 0.005 secs
- 1000 loops -> 0.05 secs
- 10000 loops -> 0.5 secs
- raw times: 0.5 0.5 0.5
- 10000 loops, best of 3: 50 usec per loop
+ 1 loop -> 3e-05 secs
+ 2 loops -> 6e-05 secs
+ 5 loops -> 0.00015 secs
+ 10 loops -> 0.0003 secs
+ 20 loops -> 0.0006 secs
+ 50 loops -> 0.0015 secs
+ 100 loops -> 0.003 secs
+ 200 loops -> 0.006 secs
+ 500 loops -> 0.015 secs
+ 1000 loops -> 0.03 secs
+ 2000 loops -> 0.06 secs
+ 5000 loops -> 0.15 secs
+ 10000 loops -> 0.3 secs
+
+ raw times: 300 msec, 300 msec, 300 msec, 300 msec, 300 msec
+
+ 10000 loops, best of 5: 30 usec per loop
"""))
def test_main_with_time_unit(self):
- unit_sec = self.run_main(seconds_per_increment=0.002,
+ unit_sec = self.run_main(seconds_per_increment=0.003,
switches=['-u', 'sec'])
self.assertEqual(unit_sec,
- "1000 loops, best of 3: 0.002 sec per loop\n")
- unit_msec = self.run_main(seconds_per_increment=0.002,
+ "100 loops, best of 5: 0.003 sec per loop\n")
+ unit_msec = self.run_main(seconds_per_increment=0.003,
switches=['-u', 'msec'])
self.assertEqual(unit_msec,
- "1000 loops, best of 3: 2 msec per loop\n")
- unit_usec = self.run_main(seconds_per_increment=0.002,
+ "100 loops, best of 5: 3 msec per loop\n")
+ unit_usec = self.run_main(seconds_per_increment=0.003,
switches=['-u', 'usec'])
self.assertEqual(unit_usec,
- "1000 loops, best of 3: 2e+03 usec per loop\n")
+ "100 loops, best of 5: 3e+03 usec per loop\n")
# Test invalid unit input
with captured_stderr() as error_stringio:
- invalid = self.run_main(seconds_per_increment=0.002,
+ invalid = self.run_main(seconds_per_increment=0.003,
switches=['-u', 'parsec'])
self.assertEqual(error_stringio.getvalue(),
- "Unrecognized unit. Please select usec, msec, or sec.\n")
+ "Unrecognized unit. Please select nsec, usec, msec, or sec.\n")
def test_main_exception(self):
with captured_stderr() as error_stringio:
@@ -354,26 +354,37 @@ class TestTimeit(unittest.TestCase):
s = self.run_main(switches=['-n1', '1/0'])
self.assert_exc_string(error_stringio.getvalue(), 'ZeroDivisionError')
- def autorange(self, callback=None):
- timer = FakeTimer(seconds_per_increment=0.001)
+ def autorange(self, seconds_per_increment=1/1024, callback=None):
+ timer = FakeTimer(seconds_per_increment=seconds_per_increment)
t = timeit.Timer(stmt=self.fake_stmt, setup=self.fake_setup, timer=timer)
return t.autorange(callback)
def test_autorange(self):
num_loops, time_taken = self.autorange()
- self.assertEqual(num_loops, 1000)
+ self.assertEqual(num_loops, 500)
+ self.assertEqual(time_taken, 500/1024)
+
+ def test_autorange_second(self):
+ num_loops, time_taken = self.autorange(seconds_per_increment=1.0)
+ self.assertEqual(num_loops, 1)
self.assertEqual(time_taken, 1.0)
def test_autorange_with_callback(self):
def callback(a, b):
print("{} {:.3f}".format(a, b))
with captured_stdout() as s:
- num_loops, time_taken = self.autorange(callback)
- self.assertEqual(num_loops, 1000)
- self.assertEqual(time_taken, 1.0)
- expected = ('10 0.010\n'
- '100 0.100\n'
- '1000 1.000\n')
+ num_loops, time_taken = self.autorange(callback=callback)
+ self.assertEqual(num_loops, 500)
+ self.assertEqual(time_taken, 500/1024)
+ expected = ('1 0.001\n'
+ '2 0.002\n'
+ '5 0.005\n'
+ '10 0.010\n'
+ '20 0.020\n'
+ '50 0.049\n'
+ '100 0.098\n'
+ '200 0.195\n'
+ '500 0.488\n')
self.assertEqual(s.getvalue(), expected)
diff --git a/Lib/test/test_types.py b/Lib/test/test_types.py
index 382ca03e5a..4a9fcba526 100644
--- a/Lib/test/test_types.py
+++ b/Lib/test/test_types.py
@@ -576,6 +576,24 @@ class TypesTests(unittest.TestCase):
self.assertGreater(object.__basicsize__, 0)
self.assertGreater(tuple.__itemsize__, 0)
+ def test_slot_wrapper_types(self):
+ self.assertIsInstance(object.__init__, types.SlotWrapperType)
+ self.assertIsInstance(object.__str__, types.SlotWrapperType)
+ self.assertIsInstance(object.__lt__, types.SlotWrapperType)
+ self.assertIsInstance(int.__lt__, types.SlotWrapperType)
+
+ def test_method_wrapper_types(self):
+ self.assertIsInstance(object().__init__, types.MethodWrapperType)
+ self.assertIsInstance(object().__str__, types.MethodWrapperType)
+ self.assertIsInstance(object().__lt__, types.MethodWrapperType)
+ self.assertIsInstance((42).__lt__, types.MethodWrapperType)
+
+ def test_method_descriptor_types(self):
+ self.assertIsInstance(str.join, types.MethodDescriptorType)
+ self.assertIsInstance(list.append, types.MethodDescriptorType)
+ self.assertIsInstance(''.join, types.BuiltinMethodType)
+ self.assertIsInstance([].append, types.BuiltinMethodType)
+
class MappingProxyTests(unittest.TestCase):
mappingproxy = types.MappingProxyType
diff --git a/Lib/test/test_unicode.py b/Lib/test/test_unicode.py
index 86ebd45e7b..b1f7c8966a 100644
--- a/Lib/test/test_unicode.py
+++ b/Lib/test/test_unicode.py
@@ -1800,9 +1800,6 @@ class UnicodeTest(string_tests.CommonTest,
self.assertEqual(seq.decode('utf-8', 'ignore'),
res.replace('\uFFFD', ''))
- def to_bytestring(self, seq):
- return bytes(int(c, 16) for c in seq.split())
-
def assertCorrectUTF8Decoding(self, seq, res, err):
"""
Check that an invalid UTF-8 sequence raises a UnicodeDecodeError when
@@ -1858,7 +1855,7 @@ class UnicodeTest(string_tests.CommonTest,
]
FFFD = '\ufffd'
for seq in sequences:
- self.assertCorrectUTF8Decoding(self.to_bytestring(seq), '\ufffd',
+ self.assertCorrectUTF8Decoding(bytes.fromhex(seq), '\ufffd',
'unexpected end of data')
def test_invalid_cb_for_2bytes_seq(self):
@@ -1880,7 +1877,7 @@ class UnicodeTest(string_tests.CommonTest,
('DF C0', FFFDx2), ('DF FF', FFFDx2),
]
for seq, res in sequences:
- self.assertCorrectUTF8Decoding(self.to_bytestring(seq), res,
+ self.assertCorrectUTF8Decoding(bytes.fromhex(seq), res,
'invalid continuation byte')
def test_invalid_cb_for_3bytes_seq(self):
@@ -1938,7 +1935,7 @@ class UnicodeTest(string_tests.CommonTest,
('EF BF C0', FFFDx2), ('EF BF FF', FFFDx2),
]
for seq, res in sequences:
- self.assertCorrectUTF8Decoding(self.to_bytestring(seq), res,
+ self.assertCorrectUTF8Decoding(bytes.fromhex(seq), res,
'invalid continuation byte')
def test_invalid_cb_for_4bytes_seq(self):
@@ -2017,7 +2014,7 @@ class UnicodeTest(string_tests.CommonTest,
('F4 8F BF C0', FFFDx2), ('F4 8F BF FF', FFFDx2)
]
for seq, res in sequences:
- self.assertCorrectUTF8Decoding(self.to_bytestring(seq), res,
+ self.assertCorrectUTF8Decoding(bytes.fromhex(seq), res,
'invalid continuation byte')
def test_codecs_idna(self):
@@ -2735,6 +2732,29 @@ class CAPITest(unittest.TestCase):
self.assertEqual(unicode_asucs4(s, len(s), 1), s+'\0')
self.assertEqual(unicode_asucs4(s, len(s), 0), s+'\uffff')
+ # Test PyUnicode_FindChar()
+ @support.cpython_only
+ def test_findchar(self):
+ from _testcapi import unicode_findchar
+
+ for str in "\xa1", "\u8000\u8080", "\ud800\udc02", "\U0001f100\U0001f1f1":
+ for i, ch in enumerate(str):
+ self.assertEqual(unicode_findchar(str, ord(ch), 0, len(str), 1), i)
+ self.assertEqual(unicode_findchar(str, ord(ch), 0, len(str), -1), i)
+
+ str = "!>_<!"
+ self.assertEqual(unicode_findchar(str, 0x110000, 0, len(str), 1), -1)
+ self.assertEqual(unicode_findchar(str, 0x110000, 0, len(str), -1), -1)
+ # start < end
+ self.assertEqual(unicode_findchar(str, ord('!'), 1, len(str)+1, 1), 4)
+ self.assertEqual(unicode_findchar(str, ord('!'), 1, len(str)+1, -1), 4)
+ # start >= end
+ self.assertEqual(unicode_findchar(str, ord('!'), 0, 0, 1), -1)
+ self.assertEqual(unicode_findchar(str, ord('!'), len(str), 0, 1), -1)
+ # negative
+ self.assertEqual(unicode_findchar(str, ord('!'), -len(str), -1, 1), 0)
+ self.assertEqual(unicode_findchar(str, ord('!'), -len(str), -1, -1), 0)
+
# Test PyUnicode_CopyCharacters()
@support.cpython_only
def test_copycharacters(self):
diff --git a/Lib/test/test_unicode_identifiers.py b/Lib/test/test_unicode_identifiers.py
index 0679845238..07332c4631 100644
--- a/Lib/test/test_unicode_identifiers.py
+++ b/Lib/test/test_unicode_identifiers.py
@@ -1,5 +1,4 @@
import unittest
-import sys
class PEP3131Test(unittest.TestCase):
diff --git a/Lib/test/test_winsound.py b/Lib/test/test_winsound.py
index 179e069a1c..c86bf553fd 100644
--- a/Lib/test/test_winsound.py
+++ b/Lib/test/test_winsound.py
@@ -1,8 +1,6 @@
# Ridiculously simple test of the winsound module for Windows.
import functools
-import os
-import subprocess
import time
import unittest
diff --git a/Lib/test/test_yield_from.py b/Lib/test/test_yield_from.py
index 7e9711eaf5..d1da838ac7 100644
--- a/Lib/test/test_yield_from.py
+++ b/Lib/test/test_yield_from.py
@@ -8,10 +8,7 @@ see <http://www.cosc.canterbury.ac.nz/greg.ewing/python/yield-from/YieldFrom-Pyt
"""
import unittest
-import io
-import sys
import inspect
-import parser
from test.support import captured_stderr, disable_gc, gc_collect
diff --git a/Lib/test/test_zipfile.py b/Lib/test/test_zipfile.py
index 0a43b20e2b..0a19d76f42 100644
--- a/Lib/test/test_zipfile.py
+++ b/Lib/test/test_zipfile.py
@@ -2055,8 +2055,9 @@ class CommandLineTest(unittest.TestCase):
def test_test_command(self):
zip_name = findfile('zipdir.zip')
- out = self.zipfilecmd('-t', zip_name)
- self.assertEqual(out.rstrip(), b'Done testing')
+ for opt in '-t', '--test':
+ out = self.zipfilecmd(opt, zip_name)
+ self.assertEqual(out.rstrip(), b'Done testing')
zip_name = findfile('testtar.tar')
rc, out, err = self.zipfilecmd_failure('-t', zip_name)
self.assertEqual(out, b'')
@@ -2067,9 +2068,10 @@ class CommandLineTest(unittest.TestCase):
with zipfile.ZipFile(zip_name, 'r') as tf:
tf.printdir(t)
expected = t.getvalue().encode('ascii', 'backslashreplace')
- out = self.zipfilecmd('-l', zip_name,
- PYTHONIOENCODING='ascii:backslashreplace')
- self.assertEqual(out, expected)
+ for opt in '-l', '--list':
+ out = self.zipfilecmd(opt, zip_name,
+ PYTHONIOENCODING='ascii:backslashreplace')
+ self.assertEqual(out, expected)
@requires_zlib
def test_create_command(self):
@@ -2082,31 +2084,33 @@ class CommandLineTest(unittest.TestCase):
f.write('test 2')
files = [TESTFN, TESTFNDIR]
namelist = [TESTFN, TESTFNDIR + '/', TESTFNDIR + '/file.txt']
- try:
- out = self.zipfilecmd('-c', TESTFN2, *files)
- self.assertEqual(out, b'')
- with zipfile.ZipFile(TESTFN2) as zf:
- self.assertEqual(zf.namelist(), namelist)
- self.assertEqual(zf.read(namelist[0]), b'test 1')
- self.assertEqual(zf.read(namelist[2]), b'test 2')
- finally:
- unlink(TESTFN2)
+ for opt in '-c', '--create':
+ try:
+ out = self.zipfilecmd(opt, TESTFN2, *files)
+ self.assertEqual(out, b'')
+ with zipfile.ZipFile(TESTFN2) as zf:
+ self.assertEqual(zf.namelist(), namelist)
+ self.assertEqual(zf.read(namelist[0]), b'test 1')
+ self.assertEqual(zf.read(namelist[2]), b'test 2')
+ finally:
+ unlink(TESTFN2)
def test_extract_command(self):
zip_name = findfile('zipdir.zip')
- with temp_dir() as extdir:
- out = self.zipfilecmd('-e', zip_name, extdir)
- self.assertEqual(out, b'')
- with zipfile.ZipFile(zip_name) as zf:
- for zi in zf.infolist():
- path = os.path.join(extdir,
- zi.filename.replace('/', os.sep))
- if zi.is_dir():
- self.assertTrue(os.path.isdir(path))
- else:
- self.assertTrue(os.path.isfile(path))
- with open(path, 'rb') as f:
- self.assertEqual(f.read(), zf.read(zi))
+ for opt in '-e', '--extract':
+ with temp_dir() as extdir:
+ out = self.zipfilecmd(opt, zip_name, extdir)
+ self.assertEqual(out, b'')
+ with zipfile.ZipFile(zip_name) as zf:
+ for zi in zf.infolist():
+ path = os.path.join(extdir,
+ zi.filename.replace('/', os.sep))
+ if zi.is_dir():
+ self.assertTrue(os.path.isdir(path))
+ else:
+ self.assertTrue(os.path.isfile(path))
+ with open(path, 'rb') as f:
+ self.assertEqual(f.read(), zf.read(zi))
if __name__ == "__main__":
unittest.main()
diff --git a/Lib/timeit.py b/Lib/timeit.py
index 2770efa35a..38c2b1f061 100644
--- a/Lib/timeit.py
+++ b/Lib/timeit.py
@@ -9,7 +9,7 @@ the Python Cookbook, published by O'Reilly.
Library usage: see the Timer class.
Command line usage:
- python timeit.py [-n N] [-r N] [-s S] [-t] [-c] [-p] [-h] [--] [statement]
+ python timeit.py [-n N] [-r N] [-s S] [-p] [-h] [--] [statement]
Options:
-n/--number N: how many times to execute 'statement' (default: see below)
@@ -17,10 +17,8 @@ Options:
-s/--setup S: statement to be executed once initially (default 'pass').
Execution time of this setup statement is NOT timed.
-p/--process: use time.process_time() (default is time.perf_counter())
- -t/--time: use time.time() (deprecated)
- -c/--clock: use time.clock() (deprecated)
-v/--verbose: print raw timing results; repeat for more digits precision
- -u/--unit: set the output time unit (usec, msec, or sec)
+ -u/--unit: set the output time unit (nsec, usec, msec, or sec)
-h/--help: print this usage message and exit
--: separate options from statement, use when statement starts with -
statement: statement to be timed (default 'pass')
@@ -59,7 +57,7 @@ __all__ = ["Timer", "timeit", "repeat", "default_timer"]
dummy_src_name = "<timeit-src>"
default_number = 1000000
-default_repeat = 3
+default_repeat = 5
default_timer = time.perf_counter
_globals = globals
@@ -210,22 +208,23 @@ class Timer:
def autorange(self, callback=None):
"""Return the number of loops so that total time >= 0.2.
- Calls the timeit method with *number* set to successive powers of
- ten (10, 100, 1000, ...) up to a maximum of one billion, until
- the time taken is at least 0.2 second, or the maximum is reached.
- Returns ``(number, time_taken)``.
+ Calls the timeit method with increasing numbers from the sequence
+ 1, 2, 5, 10, 20, 50, ... until the time taken is at least 0.2
+ second. Returns (number, time_taken).
If *callback* is given and is not None, it will be called after
each trial with two arguments: ``callback(number, time_taken)``.
"""
- for i in range(1, 10):
- number = 10**i
- time_taken = self.timeit(number)
- if callback:
- callback(number, time_taken)
- if time_taken >= 0.2:
- break
- return (number, time_taken)
+ i = 1
+ while True:
+ for j in 1, 2, 5:
+ number = i * j
+ time_taken = self.timeit(number)
+ if callback:
+ callback(number, time_taken)
+ if time_taken >= 0.2:
+ return (number, time_taken)
+ i *= 10
def timeit(stmt="pass", setup="pass", timer=default_timer,
number=default_number, globals=None):
@@ -266,6 +265,7 @@ def main(args=None, *, _wrap_timer=None):
print(err)
print("use -h/--help for command line help")
return 2
+
timer = default_timer
stmt = "\n".join(args) or "pass"
number = 0 # auto-determine
@@ -273,7 +273,7 @@ def main(args=None, *, _wrap_timer=None):
repeat = default_repeat
verbose = 0
time_unit = None
- units = {"usec": 1, "msec": 1e3, "sec": 1e6}
+ units = {"nsec": 1e-9, "usec": 1e-6, "msec": 1e-3, "sec": 1.0}
precision = 3
for o, a in opts:
if o in ("-n", "--number"):
@@ -284,17 +284,13 @@ def main(args=None, *, _wrap_timer=None):
if a in units:
time_unit = a
else:
- print("Unrecognized unit. Please select usec, msec, or sec.",
+ print("Unrecognized unit. Please select nsec, usec, msec, or sec.",
file=sys.stderr)
return 2
if o in ("-r", "--repeat"):
repeat = int(a)
if repeat <= 0:
repeat = 1
- if o in ("-t", "--time"):
- timer = time.time
- if o in ("-c", "--clock"):
- timer = time.clock
if o in ("-p", "--process"):
timer = time.process_time
if o in ("-v", "--verbose"):
@@ -305,6 +301,7 @@ def main(args=None, *, _wrap_timer=None):
print(__doc__, end=' ')
return 0
setup = "\n".join(setup) or "pass"
+
# Include the current directory, so that local imports work (sys.path
# contains the directory of this script, rather than the current
# directory)
@@ -312,50 +309,65 @@ def main(args=None, *, _wrap_timer=None):
sys.path.insert(0, os.curdir)
if _wrap_timer is not None:
timer = _wrap_timer(timer)
+
t = Timer(stmt, setup, timer)
if number == 0:
# determine number so that 0.2 <= total time < 2.0
callback = None
if verbose:
def callback(number, time_taken):
- msg = "{num} loops -> {secs:.{prec}g} secs"
- print(msg.format(num=number, secs=time_taken, prec=precision))
+ msg = "{num} loop{s} -> {secs:.{prec}g} secs"
+ plural = (number != 1)
+ print(msg.format(num=number, s='s' if plural else '',
+ secs=time_taken, prec=precision))
try:
number, _ = t.autorange(callback)
except:
t.print_exc()
return 1
+
+ if verbose:
+ print()
+
try:
- r = t.repeat(repeat, number)
+ raw_timings = t.repeat(repeat, number)
except:
t.print_exc()
return 1
- best = min(r)
+
+ def format_time(dt):
+ unit = time_unit
+
+ if unit is not None:
+ scale = units[unit]
+ else:
+ scales = [(scale, unit) for unit, scale in units.items()]
+ scales.sort(reverse=True)
+ for scale, unit in scales:
+ if dt >= scale:
+ break
+
+ return "%.*g %s" % (precision, dt / scale, unit)
+
if verbose:
- print("raw times:", " ".join(["%.*g" % (precision, x) for x in r]))
- print("%d loops," % number, end=' ')
- usec = best * 1e6 / number
- if time_unit is not None:
- scale = units[time_unit]
- else:
- scales = [(scale, unit) for unit, scale in units.items()]
- scales.sort(reverse=True)
- for scale, time_unit in scales:
- if usec >= scale:
- break
- print("best of %d: %.*g %s per loop" % (repeat, precision,
- usec/scale, time_unit))
- best = min(r)
- usec = best * 1e6 / number
- worst = max(r)
+ print("raw times: %s" % ", ".join(map(format_time, raw_timings)))
+ print()
+ timings = [dt / number for dt in raw_timings]
+
+ best = min(timings)
+ print("%d loop%s, best of %d: %s per loop"
+ % (number, 's' if number != 1 else '',
+ repeat, format_time(best)))
+
+ best = min(timings)
+ worst = max(timings)
if worst >= best * 4:
- usec = worst * 1e6 / number
import warnings
- warnings.warn_explicit(
- "The test results are likely unreliable. The worst\n"
- "time (%.*g %s) was more than four times slower than the best time." %
- (precision, usec/scale, time_unit),
- UserWarning, '', 0)
+ warnings.warn_explicit("The test results are likely unreliable. "
+ "The worst time (%s) was more than four times "
+ "slower than the best time (%s)."
+ % (format_time(worst), format_time(best)),
+ UserWarning, '', 0)
return None
if __name__ == "__main__":
diff --git a/Lib/types.py b/Lib/types.py
index d8d84709e1..1b7859e73a 100644
--- a/Lib/types.py
+++ b/Lib/types.py
@@ -36,6 +36,10 @@ MethodType = type(_C()._m)
BuiltinFunctionType = type(len)
BuiltinMethodType = type([].append) # Same as BuiltinFunctionType
+SlotWrapperType = type(object.__init__)
+MethodWrapperType = type(object().__str__)
+MethodDescriptorType = type(str.join)
+
ModuleType = type(sys)
try:
diff --git a/Lib/unittest/mock.py b/Lib/unittest/mock.py
index b6b3836234..315b61157b 100644
--- a/Lib/unittest/mock.py
+++ b/Lib/unittest/mock.py
@@ -104,26 +104,16 @@ def _check_signature(func, mock, skipfirst, instance=False):
def _copy_func_details(func, funcopy):
- funcopy.__name__ = func.__name__
- funcopy.__doc__ = func.__doc__
- try:
- funcopy.__text_signature__ = func.__text_signature__
- except AttributeError:
- pass
# we explicitly don't copy func.__dict__ into this copy as it would
# expose original attributes that should be mocked
- try:
- funcopy.__module__ = func.__module__
- except AttributeError:
- pass
- try:
- funcopy.__defaults__ = func.__defaults__
- except AttributeError:
- pass
- try:
- funcopy.__kwdefaults__ = func.__kwdefaults__
- except AttributeError:
- pass
+ for attribute in (
+ '__name__', '__doc__', '__text_signature__',
+ '__module__', '__defaults__', '__kwdefaults__',
+ ):
+ try:
+ setattr(funcopy, attribute, getattr(func, attribute))
+ except AttributeError:
+ pass
def _callable(obj):
@@ -248,6 +238,9 @@ class _SentinelObject(object):
def __repr__(self):
return 'sentinel.%s' % self.name
+ def __reduce__(self):
+ return 'sentinel.%s' % self.name
+
class _Sentinel(object):
"""Access attributes to return a named object, usable as a sentinel."""
@@ -260,6 +253,9 @@ class _Sentinel(object):
raise AttributeError
return self._sentinels.setdefault(name, _SentinelObject(name))
+ def __reduce__(self):
+ return 'sentinel'
+
sentinel = _Sentinel()
diff --git a/Lib/unittest/test/testmock/testsentinel.py b/Lib/unittest/test/testmock/testsentinel.py
index 3fb5acbc25..de53509803 100644
--- a/Lib/unittest/test/testmock/testsentinel.py
+++ b/Lib/unittest/test/testmock/testsentinel.py
@@ -1,4 +1,6 @@
import unittest
+import copy
+import pickle
from unittest.mock import sentinel, DEFAULT
@@ -23,6 +25,17 @@ class SentinelTest(unittest.TestCase):
# If this doesn't raise an AttributeError then help(mock) is broken
self.assertRaises(AttributeError, lambda: sentinel.__bases__)
+ def testPickle(self):
+ for proto in range(pickle.HIGHEST_PROTOCOL+1):
+ with self.subTest(protocol=proto):
+ pickled = pickle.dumps(sentinel.whatever, proto)
+ unpickled = pickle.loads(pickled)
+ self.assertIs(unpickled, sentinel.whatever)
+
+ def testCopy(self):
+ self.assertIs(copy.copy(sentinel.whatever), sentinel.whatever)
+ self.assertIs(copy.deepcopy(sentinel.whatever), sentinel.whatever)
+
if __name__ == '__main__':
unittest.main()
diff --git a/Lib/urllib/parse.py b/Lib/urllib/parse.py
index 958767a08d..1d08730a89 100644
--- a/Lib/urllib/parse.py
+++ b/Lib/urllib/parse.py
@@ -574,7 +574,7 @@ def unquote_to_bytes(string):
# if the function is never called
global _hextobyte
if _hextobyte is None:
- _hextobyte = {(a + b).encode(): bytes([int(a + b, 16)])
+ _hextobyte = {(a + b).encode(): bytes.fromhex(a + b)
for a in _hexdig for b in _hexdig}
for item in bits[1:]:
try:
diff --git a/Lib/urllib/request.py b/Lib/urllib/request.py
index b6690c3d0e..0a9fdf92bf 100644
--- a/Lib/urllib/request.py
+++ b/Lib/urllib/request.py
@@ -94,7 +94,6 @@ import socket
import string
import sys
import time
-import collections
import tempfile
import contextlib
import warnings
diff --git a/Lib/zipfile.py b/Lib/zipfile.py
index 7f2b43ce1c..93171358e4 100644
--- a/Lib/zipfile.py
+++ b/Lib/zipfile.py
@@ -5,7 +5,6 @@ XXX references to utf-8 need further investigation.
"""
import io
import os
-import re
import importlib.util
import sys
import time
@@ -1951,51 +1950,45 @@ class PyZipFile(ZipFile):
return (fname, archivename)
-def main(args = None):
- import textwrap
- USAGE=textwrap.dedent("""\
- Usage:
- zipfile.py -l zipfile.zip # Show listing of a zipfile
- zipfile.py -t zipfile.zip # Test if a zipfile is valid
- zipfile.py -e zipfile.zip target # Extract zipfile into target dir
- zipfile.py -c zipfile.zip src ... # Create zipfile from sources
- """)
- if args is None:
- args = sys.argv[1:]
-
- if not args or args[0] not in ('-l', '-c', '-e', '-t'):
- print(USAGE)
- sys.exit(1)
-
- if args[0] == '-l':
- if len(args) != 2:
- print(USAGE)
- sys.exit(1)
- with ZipFile(args[1], 'r') as zf:
- zf.printdir()
-
- elif args[0] == '-t':
- if len(args) != 2:
- print(USAGE)
- sys.exit(1)
- with ZipFile(args[1], 'r') as zf:
+def main(args=None):
+ import argparse
+
+ description = 'A simple command line interface for zipfile module.'
+ parser = argparse.ArgumentParser(description=description)
+ group = parser.add_mutually_exclusive_group()
+ group.add_argument('-l', '--list', metavar='<zipfile>',
+ help='Show listing of a zipfile')
+ group.add_argument('-e', '--extract', nargs=2,
+ metavar=('<zipfile>', '<output_dir>'),
+ help='Extract zipfile into target dir')
+ group.add_argument('-c', '--create', nargs='+',
+ metavar=('<name>', '<file>'),
+ help='Create zipfile from sources')
+ group.add_argument('-t', '--test', metavar='<zipfile>',
+ help='Test if a zipfile is valid')
+ args = parser.parse_args(args)
+
+ if args.test is not None:
+ src = args.test
+ with ZipFile(src, 'r') as zf:
badfile = zf.testzip()
if badfile:
print("The following enclosed file is corrupted: {!r}".format(badfile))
print("Done testing")
- elif args[0] == '-e':
- if len(args) != 3:
- print(USAGE)
- sys.exit(1)
+ elif args.list is not None:
+ src = args.list
+ with ZipFile(src, 'r') as zf:
+ zf.printdir()
- with ZipFile(args[1], 'r') as zf:
- zf.extractall(args[2])
+ elif args.extract is not None:
+ src, curdir = args.extract
+ with ZipFile(src, 'r') as zf:
+ zf.extractall(curdir)
- elif args[0] == '-c':
- if len(args) < 3:
- print(USAGE)
- sys.exit(1)
+ elif args.create is not None:
+ zip_name = args.create.pop(0)
+ files = args.create
def addToZip(zf, path, zippath):
if os.path.isfile(path):
@@ -2008,8 +2001,8 @@ def main(args = None):
os.path.join(path, nm), os.path.join(zippath, nm))
# else: ignore
- with ZipFile(args[1], 'w') as zf:
- for path in args[2:]:
+ with ZipFile(zip_name, 'w') as zf:
+ for path in files:
zippath = os.path.basename(path)
if not zippath:
zippath = os.path.basename(os.path.dirname(path))
@@ -2017,5 +2010,8 @@ def main(args = None):
zippath = ''
addToZip(zf, path, zippath)
+ else:
+ parser.exit(2, parser.format_usage())
+
if __name__ == "__main__":
main()
diff --git a/Makefile.pre.in b/Makefile.pre.in
index 93aae91247..8752a02031 100644
--- a/Makefile.pre.in
+++ b/Makefile.pre.in
@@ -497,7 +497,7 @@ build_all_generate_profile:
$(MAKE) @DEF_MAKE_RULE@ CFLAGS_NODIST="$(CFLAGS) $(PGO_PROF_GEN_FLAG) @LTOFLAGS@" LDFLAGS="$(LDFLAGS) $(PGO_PROF_GEN_FLAG) @LTOFLAGS@" LIBS="$(LIBS)"
run_profile_task:
- : # FIXME: can't run for a cross build
+ @ # FIXME: can't run for a cross build
$(LLVM_PROF_FILE) $(RUNSHARED) ./$(BUILDPYTHON) $(PROFILE_TASK) || true
build_all_merge_profile:
@@ -521,8 +521,8 @@ coverage-lcov:
--base-directory $(realpath $(abs_builddir)) \
--path $(realpath $(abs_srcdir)) \
--output-file $(COVERAGE_INFO)
- : # remove 3rd party modules, system headers and internal files with
- : # debug, test or dummy functions.
+ @ # remove 3rd party modules, system headers and internal files with
+ @ # debug, test or dummy functions.
@lcov --remove $(COVERAGE_INFO) \
'*/Modules/_blake2/impl/*' \
'*/Modules/_ctypes/libffi*/*' \
@@ -546,15 +546,15 @@ coverage-lcov:
@echo
coverage-report:
- : # force rebuilding of parser and importlib
+ @ # force rebuilding of parser and importlib
@touch $(GRAMMAR_INPUT)
@touch $(srcdir)/Lib/importlib/_bootstrap.py
@touch $(srcdir)/Lib/importlib/_bootstrap_external.py
- : # build with coverage info
+ @ # build with coverage info
$(MAKE) coverage
- : # run tests, ignore failures
+ @ # run tests, ignore failures
$(TESTRUNNER) $(TESTOPTS) || true
- : # build lcov report
+ @ # build lcov report
$(MAKE) coverage-lcov
# Run "Argument Clinic" over all source files
@@ -674,7 +674,7 @@ $(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK): \
# This rule builds the Cygwin Python DLL and import library if configured
# for a shared core library; otherwise, this rule is a noop.
-$(DLLLIBRARY) libpython$(VERSION).dll.a: $(LIBRARY_OBJS)
+$(DLLLIBRARY) libpython$(LDVERSION).dll.a: $(LIBRARY_OBJS)
if test -n "$(DLLLIBRARY)"; then \
$(LDSHARED) -Wl,--out-implib=$@ -o $(DLLLIBRARY) $^ \
$(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST); \
@@ -1020,7 +1020,7 @@ testall: all platform
# Run the test suite for both architectures in a Universal build on OSX.
# Must be run on an Intel box.
testuniversal: all platform
- if [ `arch` != 'i386' ];then \
+ @if [ `arch` != 'i386' ]; then \
echo "This can only be used on OSX/i386" ;\
exit 1 ;\
fi
@@ -1341,15 +1341,15 @@ libinstall: build_all $(srcdir)/Modules/xxmodule.c
$(PYTHON_FOR_BUILD) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/PatternGrammar.txt
python-config: $(srcdir)/Misc/python-config.in Misc/python-config.sh
- # Substitution happens here, as the completely-expanded BINDIR
- # is not available in configure
+ @ # Substitution happens here, as the completely-expanded BINDIR
+ @ # is not available in configure
sed -e "s,@EXENAME@,$(BINDIR)/python$(LDVERSION)$(EXE)," < $(srcdir)/Misc/python-config.in >python-config.py
- # Replace makefile compat. variable references with shell script compat. ones; $(VAR) -> ${VAR}
+ @ # Replace makefile compat. variable references with shell script compat. ones; $(VAR) -> ${VAR}
LC_ALL=C sed -e 's,\$$(\([A-Za-z0-9_]*\)),\$$\{\1\},g' < Misc/python-config.sh >python-config
- # On Darwin, always use the python version of the script, the shell
- # version doesn't use the compiler customizations that are provided
- # in python (_osx_support.py).
- if test `uname -s` = Darwin; then \
+ @ # On Darwin, always use the python version of the script, the shell
+ @ # version doesn't use the compiler customizations that are provided
+ @ # in python (_osx_support.py).
+ @if test `uname -s` = Darwin; then \
cp python-config.py python-config; \
fi
diff --git a/Misc/ACKS b/Misc/ACKS
index a6b3df12ff..319128c9e9 100644
--- a/Misc/ACKS
+++ b/Misc/ACKS
@@ -378,6 +378,7 @@ Marcos Donolo
Dima Dorfman
Yves Dorfsman
Michael Dorman
+Steve Dower
Cesar Douady
Dean Draayer
Fred L. Drake, Jr.
@@ -513,7 +514,7 @@ Jan-Philip Gehrcke
Thomas Gellekum
Gabriel Genellina
Christos Georgiou
-Elazar Gershuni
+Elazar (אלעזר) Gershuni
Ben Gertzfield
Nadim Ghaznavi
Dinu Gherman
@@ -1420,6 +1421,7 @@ Yann Sionneau
George Sipe
J. Sipprell
Kragen Sitaker
+Kaartic Sivaraam
Ville Skyttä
Michael Sloan
Nick Sloan
@@ -1688,6 +1690,7 @@ Florent Xicluna
Arnon Yaari
Alakshendra Yadav
Hirokazu Yamamoto
+Masayuki Yamamoto
Ka-Ping Yee
Chi Hsuan Yen
Jason Yeo
diff --git a/Misc/NEWS b/Misc/NEWS
index a2d42414c2..dd6fcd0dcb 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -2,8 +2,8 @@
Python News
+++++++++++
-What's New in Python 3.6.1 release candidate 1?
-===============================================
+What's New in Python 3.7.0 alpha 1?
+===================================
*Release date: XXXX-XX-XX*
@@ -22,6 +22,12 @@ Core and Builtins
- Issue #29159: Fix regression in bytes(x) when x.__index__() raises Exception.
+- Issue #29049: Call _PyObject_GC_TRACK() lazily when calling Python function.
+ Calling function is up to 5% faster.
+
+- Issue #28927: bytes.fromhex() and bytearray.fromhex() now ignore all ASCII
+ whitespace, not only spaces. Patch by Robert Xiao.
+
- Issue #28932: Do not include <sys/random.h> if it does not exist.
- Issue #25677: Correct the positioning of the syntax error caret for
@@ -30,6 +36,12 @@ Core and Builtins
- Issue #29000: Fixed bytes formatting of octals with zero padding in alternate
form.
+- Issue #18896: Python function can now have more than 255 parameters.
+ collections.namedtuple() now supports tuples with more than 255 elements.
+
+- Issue #28596: The preferred encoding is UTF-8 on Android. Patch written by
+ Chi Hsuan Yen.
+
- Issue #26919: On Android, operating system data is now always encoded/decoded
to/from UTF-8, instead of the locale encoding to avoid inconsistencies with
os.fsencode() and os.fsdecode() which are already using UTF-8.
@@ -37,6 +49,10 @@ Core and Builtins
- Issue #28991: functools.lru_cache() was susceptible to an obscure reentrancy
bug triggerable by a monkey-patched len() function.
+- Issue #28147: Fix a memory leak in split-table dictionaries: setattr()
+ must not convert combined table into split table. Patch written by INADA
+ Naoki.
+
- Issue #28739: f-string expressions are no longer accepted as docstrings and
by ast.literal_eval() even if they do not include expressions.
@@ -46,9 +62,161 @@ Core and Builtins
- Issue #28918: Fix the cross compilation of xxlimited when Python has been
built with Py_DEBUG defined.
+- Issue #23722: Rather than silently producing a class that doesn't support
+ zero-argument ``super()`` in methods, failing to pass the new
+ ``__classcell__`` namespace entry up to ``type.__new__`` now results in a
+ ``DeprecationWarning`` and a class that supports zero-argument ``super()``.
+
+- Issue #28797: Modifying the class __dict__ inside the __set_name__ method of
+ a descriptor that is used inside that class no longer prevents calling the
+ __set_name__ method of other descriptors.
+
+- Issue #28799: Remove the ``PyEval_GetCallStats()`` function and deprecate
+ the untested and undocumented ``sys.callstats()`` function. Remove the
+ ``CALL_PROFILE`` special build: use the :func:`sys.setprofile` function,
+ :mod:`cProfile` or :mod:`profile` to profile function calls.
+
+- Issue #12844: More than 255 arguments can now be passed to a function.
+
+- Issue #28782: Fix a bug in the implementation ``yield from`` when checking
+ if the next instruction is YIELD_FROM. Regression introduced by WORDCODE
+ (issue #26647).
+
+- Issue #28774: Fix error position of the unicode error in ASCII and Latin1
+ encoders when a string returned by the error handler contains multiple
+ non-encodable characters (non-ASCII for the ASCII codec, characters out
+ of the U+0000-U+00FF range for Latin1).
+
- Issue #28731: Optimize _PyDict_NewPresized() to create correct size dict.
Improve speed of dict literal with constant keys up to 30%.
+- Issue #28532: Show sys.version when -V option is supplied twice.
+
+- Issue #27100: The with-statement now checks for __enter__ before it
+ checks for __exit__. This gives less confusing error messages when
+ both methods are missing. Patch by Jonathan Ellington.
+
+- Issue #28746: Fix the set_inheritable() file descriptor method on platforms
+ that do not have the ioctl FIOCLEX and FIONCLEX commands.
+
+- Issue #26920: Fix not getting the locale's charset upon initializing the
+ interpreter, on platforms that do not have langinfo.
+
+- Issue #28648: Fixed crash in Py_DecodeLocale() in debug build on Mac OS X
+ when decode astral characters. Patch by Xiang Zhang.
+
+- Issue #28665: Improve speed of the STORE_DEREF opcode by 40%.
+
+- Issue #19398: Extra slash no longer added to sys.path components in case of
+ empty compile-time PYTHONPATH components.
+
+- Issue #28621: Sped up converting int to float by reusing faster bits counting
+ implementation. Patch by Adrian Wielgosik.
+
+- Issue #28580: Optimize iterating split table values.
+ Patch by Xiang Zhang.
+
+- Issue #28583: PyDict_SetDefault didn't combine split table when needed.
+ Patch by Xiang Zhang.
+
+- Issue #28128: Deprecation warning for invalid str and byte escape
+ sequences now prints better information about where the error
+ occurs. Patch by Serhiy Storchaka and Eric Smith.
+
+- Issue #28509: dict.update() no longer allocate unnecessary large memory.
+
+- Issue #28426: Fixed potential crash in PyUnicode_AsDecodedObject() in debug
+ build.
+
+- Issue #28517: Fixed of-by-one error in the peephole optimizer that caused
+ keeping unreachable code.
+
+- Issue #28214: Improved exception reporting for problematic __set_name__
+ attributes.
+
+- Issue #23782: Fixed possible memory leak in _PyTraceback_Add() and exception
+ loss in PyTraceBack_Here().
+
+- Issue #28183: Optimize and cleanup dict iteration.
+
+- Issue #26081: Added C implementation of asyncio.Future.
+ Original patch by Yury Selivanov.
+
+- Issue #28379: Added sanity checks and tests for PyUnicode_CopyCharacters().
+ Patch by Xiang Zhang.
+
+- Issue #28376: The type of long range iterator is now registered as Iterator.
+ Patch by Oren Milman.
+
+- Issue #28376: Creating instances of range_iterator by calling range_iterator
+ type now is disallowed. Calling iter() on range instance is the only way.
+ Patch by Oren Milman.
+
+- Issue #26906: Resolving special methods of uninitialized type now causes
+ implicit initialization of the type instead of a fail.
+
+- Issue #18287: PyType_Ready() now checks that tp_name is not NULL.
+ Original patch by Niklas Koep.
+
+- Issue #24098: Fixed possible crash when AST is changed in process of
+ compiling it.
+
+- Issue #28201: Dict reduces possibility of 2nd conflict in hash table when
+ hashes have same lower bits.
+
+- Issue #28350: String constants with null character no longer interned.
+
+- Issue #26617: Fix crash when GC runs during weakref callbacks.
+
+- Issue #27942: String constants now interned recursively in tuples and frozensets.
+
+- Issue #28289: ImportError.__init__ now resets not specified attributes.
+
+- Issue #21578: Fixed misleading error message when ImportError called with
+ invalid keyword args.
+
+- Issue #28203: Fix incorrect type in complex(1.0, {2:3}) error message.
+ Patch by Soumya Sharma.
+
+- Issue #28086: Single var-positional argument of tuple subtype was passed
+ unscathed to the C-defined function. Now it is converted to exact tuple.
+
+- Issue #28214: Now __set_name__ is looked up on the class instead of the
+ instance.
+
+- Issue #27955: Fallback on reading /dev/urandom device when the getrandom()
+ syscall fails with EPERM, for example when blocked by SECCOMP.
+
+- Issue #28192: Don't import readline in isolated mode.
+
+- Issue #27441: Remove some redundant assignments to ob_size in longobject.c.
+ Thanks Oren Milman.
+
+- Issue #27222: Clean up redundant code in long_rshift function. Thanks
+ Oren Milman.
+
+- Upgrade internal unicode databases to Unicode version 9.0.0.
+
+- Issue #28131: Fix a regression in zipimport's compile_source(). zipimport
+ should use the same optimization level as the interpreter.
+
+- Issue #28126: Replace Py_MEMCPY with memcpy(). Visual Studio can properly
+ optimize memcpy().
+
+- Issue #28120: Fix dict.pop() for splitted dictionary when trying to remove a
+ "pending key" (Not yet inserted in split-table). Patch by Xiang Zhang.
+
+- Issue #26182: Raise DeprecationWarning when async and await keywords are
+ used as variable/attribute/class/function name.
+
+- Issue #26182: Fix a refleak in code that raises DeprecationWarning.
+
+- Issue #28721: Fix asynchronous generators aclose() and athrow() to
+ handle StopAsyncIteration propagation properly.
+
+- Issue #26110: Speed-up method calls: add LOAD_METHOD and CALL_METHOD
+ opcodes.
+
Extension Modules
-----------------
@@ -62,6 +230,20 @@ Library
- Issue #29444: Fixed out-of-bounds buffer access in the group() method of
the match object. Based on patch by WGH.
+- Issue #29377: Add SlotWrapperType, MethodWrapperType, and
+ MethodDescriptorType built-in types to types module.
+ Original patch by Manuel Krebber.
+
+- Issue #29218: Unused install_misc command is now removed. It has been
+ documented as unused since 2000. Patch by Eric N. Vander Weele.
+
+- Issue #29368: The extend() method is now called instead of the append()
+ method when unpickle collections.deque and other list-like objects.
+ This can speed up unpickling to 2 times.
+
+- Issue #29338: The help of a builtin or extension class now includes the
+ constructor signature if __text_signature__ is provided for the class.
+
- Issue #29335: Fix subprocess.Popen.wait() when the child process has
exited to a stopped instead of terminated state (ex: when under ptrace).
@@ -70,18 +252,29 @@ Library
- Issue #28735: Fixed the comparison of mock.MagickMock with mock.ANY.
-- Issue #29316: Restore the provisional status of typing module, add
- corresponding note to documentation. Patch by Ivan L.
+- Issue #29197: Removed deprecated function ntpath.splitunc().
+
+- Issue #29210: Removed support of deprecated argument "exclude" in
+ tarfile.TarFile.add().
- Issue #29219: Fixed infinite recursion in the repr of uninitialized
ctypes.CDLL instances.
-- Issue #29011: Fix an important omission by adding Deque to the typing module.
+- Issue #29192: Removed deprecated features in the http.cookies module.
+
+- Issue #29193: A format string argument for string.Formatter.format()
+ is now positional-only.
+
+- Issue #29195: Removed support of deprecated undocumented keyword arguments
+ in methods of regular expression objects.
- Issue #28969: Fixed race condition in C implementation of functools.lru_cache.
KeyError could be raised when cached function with full cache was
simultaneously called from differen threads with the same uncached arguments.
+- Issue #20804: The unittest.mock.sentinel attributes now preserve their
+ identity when they are copied or pickled.
+
- Issue #29142: In urllib.request, suffixes in no_proxy environment variable with
leading dots could match related hostnames again (e.g. .b.c matches a.b.c).
Patch by Milan Oberkirch.
@@ -89,31 +282,20 @@ Library
- Issue #28961: Fix unittest.mock._Call helper: don't ignore the name parameter
anymore. Patch written by Jiajun Huang.
-- Issue #29203: functools.lru_cache() now respects PEP 468 and preserves
- the order of keyword arguments. f(a=1, b=2) is now cached separately
- from f(b=2, a=1) since both calls could potentially give different results.
-
- Issue #15812: inspect.getframeinfo() now correctly shows the first line of
a context. Patch by Sam Breese.
+- Issue #28985: Update authorizer constants in sqlite3 module.
+ Patch by Dingyuan Wang.
+
- Issue #29094: Offsets in a ZIP file created with extern file object and modes
"w" and "x" now are relative to the start of the file.
-- Issue #29085: Allow random.Random.seed() to use high quality OS randomness
- rather than the pid and time.
-
-- Issue #29061: Fixed bug in secrets.randbelow() which would hang when given
- a negative input. Patch by Brendan Donegan.
-
- Issue #29079: Prevent infinite loop in pathlib.resolve() on Windows
- Issue #13051: Fixed recursion errors in large or resized
curses.textpad.Textbox. Based on patch by Tycho Andersen.
-- Issue #29119: Fix weakrefs in the pure python version of
- collections.OrderedDict move_to_end() method.
- Contributed by Andra Bogildea.
-
- Issue #9770: curses.ascii predicates now work correctly with negative
integers.
@@ -122,9 +304,6 @@ Library
- Issue 28923: Remove editor artifacts from Tix.py.
-- Issue #29055: Neaten-up empty population error on random.choice()
- by suppressing the upstream exception.
-
- Issue #28871: Fixed a crash when deallocate deep ElementTree.
- Issue #19542: Fix bugs in WeakValueDictionary.setdefault() and
@@ -134,38 +313,343 @@ Library
- Issue #20191: Fixed a crash in resource.prlimit() when passing a sequence that
doesn't own its elements as limits.
+- Issue #16255: subprocess.Popen uses /system/bin/sh on Android as the shell,
+ instead of /bin/sh.
+
- Issue #28779: multiprocessing.set_forkserver_preload() would crash the
forkserver process if a preloaded module instantiated some
multiprocessing objects such as locks.
-- Issue #28847: dbm.dumb now supports reading read-only files and no longer
- writes the index file when it is not changed.
-
- Issue #26937: The chown() method of the tarfile.TarFile class does not fail
now when the grp module cannot be imported, as for example on Android
platforms.
+- Issue #28847: dbm.dumb now supports reading read-only files and no longer
+ writes the index file when it is not changed. A deprecation warning is now
+ emitted if the index file is missed and recreated in the 'r' and 'w' modes
+ (will be an error in future Python releases).
+
+- Issue #27030: Unknown escapes consisting of ``'\'`` and an ASCII letter in
+ re.sub() replacement templates regular expressions now are errors.
+
+- Issue #28835: Fix a regression introduced in warnings.catch_warnings():
+ call warnings.showwarning() if it was overriden inside the context manager.
+
+- Issue #27172: To assist with upgrades from 2.7, the previously documented
+ deprecation of ``inspect.getfullargspec()`` has been reversed. This decision
+ may be revisited again after the Python 2.7 branch is no longer officially
+ supported.
+
+- Issue #28740: Add sys.getandroidapilevel(): return the build time API version
+ of Android as an integer. Function only available on Android.
+
+- Issue #26273: Add new :data:`socket.TCP_CONGESTION` (Linux 2.6.13) and
+ :data:`socket.TCP_USER_TIMEOUT` (Linux 2.6.37) constants. Patch written by
+ Omar Sandoval.
+
+- Issue #28752: Restored the __reduce__() methods of datetime objects.
+
+- Issue #28727: Regular expression patterns, _sre.SRE_Pattern objects created
+ by re.compile(), become comparable (only x==y and x!=y operators). This
+ change should fix the issue #18383: don't duplicate warning filters when the
+ warnings module is reloaded (thing usually only done in unit tests).
+
+- Issue #20572: Remove the subprocess.Popen.wait endtime parameter. It was
+ deprecated in 3.4 and undocumented prior to that.
+
+- Issue #25659: In ctypes, prevent a crash calling the from_buffer() and
+ from_buffer_copy() methods on abstract classes like Array.
+
+- Issue #28548: In the "http.server" module, parse the protocol version if
+ possible, to avoid using HTTP 0.9 in some error responses.
+
+- Issue #19717: Makes Path.resolve() succeed on paths that do not exist.
+ Patch by Vajrasky Kok
+
+- Issue #28563: Fixed possible DoS and arbitrary code execution when handle
+ plural form selections in the gettext module. The expression parser now
+ supports exact syntax supported by GNU gettext.
+
+- Issue #28387: Fixed possible crash in _io.TextIOWrapper deallocator when
+ the garbage collector is invoked in other thread. Based on patch by
+ Sebastian Cufre.
+
+- Issue #27517: LZMA compressor and decompressor no longer raise exceptions if
+ given empty data twice. Patch by Benjamin Fogle.
+
+- Issue #28549: Fixed segfault in curses's addch() with ncurses6.
+
+- Issue #28449: tarfile.open() with mode "r" or "r:" now tries to open a tar
+ file with compression before trying to open it without compression. Otherwise
+ it had 50% chance failed with ignore_zeros=True.
+
+- Issue #23262: The webbrowser module now supports Firefox 36+ and derived
+ browsers. Based on patch by Oleg Broytman.
+
+- Issue #27939: Fixed bugs in tkinter.ttk.LabeledScale and tkinter.Scale caused
+ by representing the scale as float value internally in Tk. tkinter.IntVar
+ now works if float value is set to underlying Tk variable.
+
+- Issue #28255: calendar.TextCalendar.prweek() no longer prints a space after
+ a weeks's calendar. calendar.TextCalendar.pryear() no longer prints redundant
+ newline after a year's calendar. Based on patch by Xiang Zhang.
+
+- Issue #28255: calendar.TextCalendar.prmonth() no longer prints a space
+ at the start of new line after printing a month's calendar. Patch by
+ Xiang Zhang.
+
+- Issue #20491: The textwrap.TextWrapper class now honors non-breaking spaces.
+ Based on patch by Kaarle Ritvanen.
+
+- Issue #28353: os.fwalk() no longer fails on broken links.
+
+- Issue #28430: Fix iterator of C implemented asyncio.Future doesn't accept
+ non-None value is passed to it.send(val).
+
+- Issue #27025: Generated names for Tkinter widgets now start by the "!" prefix
+ for readability (was "`").
+
+- Issue #25464: Fixed HList.header_exists() in tkinter.tix module by addin
+ a workaround to Tix library bug.
+
+- Issue #28488: shutil.make_archive() no longer adds entry "./" to ZIP archive.
+
+- Issue #25953: re.sub() now raises an error for invalid numerical group
+ reference in replacement template even if the pattern is not found in
+ the string. Error message for invalid group reference now includes the
+ group index and the position of the reference.
+ Based on patch by SilentGhost.
+
+- Issue #28469: timeit now uses the sequence 1, 2, 5, 10, 20, 50,... instead
+ of 1, 10, 100,... for autoranging.
+
+- Issue #28115: Command-line interface of the zipfile module now uses argparse.
+ Added support of long options.
+
+- Issue #18219: Optimize csv.DictWriter for large number of columns.
+ Patch by Mariatta Wijaya.
+
+- Issue #28448: Fix C implemented asyncio.Future didn't work on Windows.
+
+- Issue #23214: In the "io" module, the argument to BufferedReader and
+ BytesIO's read1() methods is now optional and can be -1, matching the
+ BufferedIOBase specification.
+
+- Issue #28480: Fix error building socket module when multithreading is
+ disabled.
+
+- Issue #28240: timeit: remove ``-c/--clock`` and ``-t/--time`` command line
+ options which were deprecated since Python 3.3.
+
+- Issue #28240: timeit now repeats the benchmarks 5 times instead of only 3
+ to make benchmarks more reliable.
+
+- Issue #28240: timeit autorange now uses a single loop iteration if the
+ benchmark takes less than 10 seconds, instead of 10 iterations.
+ "python3 -m timeit -s 'import time' 'time.sleep(1)'" now takes 4 seconds
+ instead of 40 seconds.
+
+- Distutils.sdist now looks for README and setup.py files with case
+ sensitivity. This behavior matches that found in Setuptools 6.0 and
+ later. See `setuptools 100
+ <https://github.com/pypa/setuptools/issues/100>`_ for rationale.
+
+- Issue #24452: Make webbrowser support Chrome on Mac OS X. Patch by
+ Ned Batchelder.
+
+- Issue #20766: Fix references leaked by pdb in the handling of SIGINT
+ handlers.
+
+- Issue #27998: Fixed bytes path support in os.scandir() on Windows.
+ Patch by Eryk Sun.
+
+- Issue #28317: The disassembler now decodes FORMAT_VALUE argument.
+
+- Issue #26293: Fixed writing ZIP files that starts not from the start of the
+ file. Offsets in ZIP file now are relative to the start of the archive in
+ conforming to the specification.
+
+- Issue #28380: unittest.mock Mock autospec functions now properly support
+ assert_called, assert_not_called, and assert_called_once.
+
+- Issue #28229: lzma module now supports pathlib.
+
+- Issue #28321: Fixed writing non-BMP characters with binary format in plistlib.
+
+- Issue #28225: bz2 module now supports pathlib. Initial patch by Ethan Furman.
+
+- Issue #28227: gzip now supports pathlib. Patch by Ethan Furman.
+
+- Issue #28332: Deprecated silent truncations in socket.htons and socket.ntohs.
+ Original patch by Oren Milman.
+
+- Issue #27358: Optimized merging var-keyword arguments and improved error
+ message when passing a non-mapping as a var-keyword argument.
+
+- Issue #28257: Improved error message when passing a non-iterable as
+ a var-positional argument. Added opcode BUILD_TUPLE_UNPACK_WITH_CALL.
+
+- Issue #28322: Fixed possible crashes when unpickle itertools objects from
+ incorrect pickle data. Based on patch by John Leitch.
+
+- Issue #28228: imghdr now supports pathlib.
+
+- Issue #28226: compileall now supports pathlib.
+
+- Issue #28314: Fix function declaration (C flags) for the getiterator() method
+ of xml.etree.ElementTree.Element.
+
+- Issue #28148: Stop using localtime() and gmtime() in the time
+ module.
+
+ Introduced platform independent _PyTime_localtime API that is
+ similar to POSIX localtime_r, but available on all platforms. Patch
+ by Ed Schouten.
+
+- Issue #28253: Fixed calendar functions for extreme months: 0001-01
+ and 9999-12.
+
+ Methods itermonthdays() and itermonthdays2() are reimplemented so
+ that they don't call itermonthdates() which can cause datetime.date
+ under/overflow.
+
+- Issue #28275: Fixed possible use after free in the decompress()
+ methods of the LZMADecompressor and BZ2Decompressor classes.
+ Original patch by John Leitch.
+
+- Issue #27897: Fixed possible crash in sqlite3.Connection.create_collation()
+ if pass invalid string-like object as a name. Patch by Xiang Zhang.
+
+- Issue #18844: random.choices() now has k as a keyword-only argument
+ to improve the readability of common cases and come into line
+ with the signature used in other languages.
+
+- Issue #18893: Fix invalid exception handling in Lib/ctypes/macholib/dyld.py.
+ Patch by Madison May.
+
+- Issue #27611: Fixed support of default root window in the tkinter.tix module.
+ Added the master parameter in the DisplayStyle constructor.
+
+- Issue #27348: In the traceback module, restore the formatting of exception
+ messages like "Exception: None". This fixes a regression introduced in
+ 3.5a2.
+
+- Issue #25651: Allow falsy values to be used for msg parameter of subTest().
+
+- Issue #27778: Fix a memory leak in os.getrandom() when the getrandom() is
+ interrupted by a signal and a signal handler raises a Python exception.
+
+- Issue #28200: Fix memory leak on Windows in the os module (fix
+ path_converter() function).
+
+- Issue #25400: RobotFileParser now correctly returns default values for
+ crawl_delay and request_rate. Initial patch by Peter Wirtz.
+
+- Issue #27932: Prevent memory leak in win32_ver().
+
+- Fix UnboundLocalError in socket._sendfile_use_sendfile.
+
+- Issue #28075: Check for ERROR_ACCESS_DENIED in Windows implementation of
+ os.stat(). Patch by Eryk Sun.
+
+- Issue #22493: Warning message emitted by using inline flags in the middle of
+ regular expression now contains a (truncated) regex pattern.
+ Patch by Tim Graham.
+
+- Issue #25270: Prevent codecs.escape_encode() from raising SystemError when
+ an empty bytestring is passed.
+
+- Issue #28181: Get antigravity over HTTPS. Patch by Kaartic Sivaraam.
+
+- Issue #25895: Enable WebSocket URL schemes in urllib.parse.urljoin.
+ Patch by Gergely Imreh and Markus Holtermann.
+
+- Issue #28114: Fix a crash in parse_envlist() when env contains byte strings.
+ Patch by Eryk Sun.
+
+- Issue #27599: Fixed buffer overrun in binascii.b2a_qp() and binascii.a2b_qp().
+
+- Issue #27906: Fix socket accept exhaustion during high TCP traffic.
+ Patch by Kevin Conway.
+
+- Issue #28174: Handle when SO_REUSEPORT isn't properly supported.
+ Patch by Seth Michael Larson.
+
+- Issue #26654: Inspect functools.partial in asyncio.Handle.__repr__.
+ Patch by iceboy.
+
+- Issue #26909: Fix slow pipes IO in asyncio.
+ Patch by INADA Naoki.
+
+- Issue #28176: Fix callbacks race in asyncio.SelectorLoop.sock_connect.
+
+- Issue #27759: Fix selectors incorrectly retain invalid file descriptors.
+ Patch by Mark Williams.
+
+- Issue #28325: Remove vestigial MacOS 9 macurl2path module and its tests.
+
+- Issue #28368: Refuse monitoring processes if the child watcher has
+ no loop attached.
+ Patch by Vincent Michel.
+
+- Issue #28369: Raise RuntimeError when transport's FD is used with
+ add_reader, add_writer, etc.
+
+- Issue #28370: Speedup asyncio.StreamReader.readexactly.
+ Patch by Коренберг Марк.
+
+- Issue #28371: Deprecate passing asyncio.Handles to run_in_executor.
+
+- Issue #28372: Fix asyncio to support formatting of non-python coroutines.
+
+- Issue #28399: Remove UNIX socket from FS before binding.
+ Patch by Коренберг Марк.
+
+- Issue #27972: Prohibit Tasks to await on themselves.
+
+- Issue #24142: Reading a corrupt config file left configparser in an
+ invalid state. Original patch by Florian Höch.
+
Windows
-------
-- Issue #29326: Ignores blank lines in ._pth files (Patch by Alexey Izbyshev)
+- Issue #25778: winreg does not truncate string correctly (Patch by Eryk Sun)
-- Issue #28164: Correctly handle special console filenames (patch by Eryk Sun)
+- Issue #28896: Deprecate WindowsRegistryFinder and disable it by default
-- Issue #29409: Implement PEP 529 for io.FileIO (Patch by Eryk Sun)
+- Issue #28522: Fixes mishandled buffer reallocation in getpathp.c
-- Issue #29392: Prevent crash when passing invalid arguments into msvcrt module.
+- Issue #28402: Adds signed catalog files for stdlib on Windows.
-- Issue #25778: winreg does not truncate string correctly (Patch by Eryk Sun)
+- Issue #28333: Enables Unicode for ps1/ps2 and input() prompts. (Patch by
+ Eryk Sun)
-- Issue #28896: Deprecate WindowsRegistryFinder and disable it by default.
+- Issue #28251: Improvements to help manuals on Windows.
+
+- Issue #28110: launcher.msi has different product codes between 32-bit and
+ 64-bit
+
+- Issue #28161: Opening CON for write access fails
+
+- Issue #28162: WindowsConsoleIO readall() fails if first line starts with
+ Ctrl+Z
+
+- Issue #28163: WindowsConsoleIO fileno() passes wrong flags to
+ _open_osfhandle
+
+- Issue #28164: _PyIO_get_console_type fails for various paths
+
+- Issue #28137: Renames Windows path file to ._pth
+
+- Issue #28138: Windows ._pth file should allow import site
C API
-----
-- Issue #27867: Function PySlice_GetIndicesEx() is replaced with a macro if
- Py_LIMITED_API is not set or set to the value between 0x03050400
- and 0x03060000 (not including) or 0x03060100 or higher.
+- Issue #27867: Function PySlice_GetIndicesEx() is deprecated and replaced with
+ a macro if Py_LIMITED_API is not set or set to the value between 0x03050400
+ and 0x03060000 (not including) or 0x03060100 or higher. Added functions
+ PySlice_Unpack() and PySlice_AdjustIndices().
- Issue #29083: Fixed the declaration of some public API functions.
PyArg_VaParse() and PyArg_VaParseTupleAndKeywords() were not available in
@@ -173,10 +657,32 @@ C API
Py_BuildValue() were not available in limited API of version < 3.3 when
PY_SSIZE_T_CLEAN is defined.
+- Issue #28769: The result of PyUnicode_AsUTF8AndSize() and PyUnicode_AsUTF8()
+ is now of type "const char *" rather of "char *".
+
- Issue #29058: All stable API extensions added after Python 3.2 are now
available only when Py_LIMITED_API is set to the PY_VERSION_HEX value of
the minimum Python version supporting this API.
+- Issue #28822: The index parameters *start* and *end* of PyUnicode_FindChar()
+ are now adjusted to behave like ``str[start:end]``.
+
+- Issue #28808: PyUnicode_CompareWithASCIIString() now never raises exceptions.
+
+- Issue #28761: The fields name and doc of structures PyMemberDef, PyGetSetDef,
+ PyStructSequence_Field, PyStructSequence_Desc, and wrapperbase are now of
+ type ``const char *`` rather of ``char *``.
+
+- Issue #28748: Private variable _Py_PackageContext is now of type ``const char *``
+ rather of ``char *``.
+
+- Issue #19569: Compiler warnings are now emitted if use most of deprecated
+ functions.
+
+- Issue #28426: Deprecated undocumented functions PyUnicode_AsEncodedObject(),
+ PyUnicode_AsDecodedObject(), PyUnicode_AsDecodedUnicode() and
+ PyUnicode_AsEncodedUnicode().
+
Documentation
-------------
@@ -185,29 +691,226 @@ Documentation
- Issue #29349: Fix Python 2 syntax in code for building the documentation.
+- Issue #23722: The data model reference and the porting section in the
+ 3.6 What's New guide now cover the additional ``__classcell__`` handling
+ needed for custom metaclasses to fully support PEP 487 and zero-argument
+ ``super()``.
+
+- Issue #28513: Documented command-line interface of zipfile.
+
+Build
+-----
+
+- Issue #27659: Prohibit implicit C function declarations: use
+ -Werror=implicit-function-declaration when possible (GCC and Clang, but it
+ depends on the compiler version). Patch written by Chi Hsuan Yen.
+
+- Issue #29384: Remove old Be OS helper scripts.
+
+- Issue #26851: Set Android compilation and link flags.
+
+- Issue #28768: Fix implicit declaration of function _setmode. Patch by
+ Masayuki Yamamoto
+
+- Issue #29080: Removes hard dependency on hg.exe from PCBuild/build.bat
+
+- Issue #23903: Added missed names to PC/python3.def.
+
+- Issue #28762: lockf() is available on Android API level 24, but the F_LOCK
+ macro is not defined in android-ndk-r13.
+
+- Issue #28538: Fix the compilation error that occurs because if_nameindex() is
+ available on Android API level 24, but the if_nameindex structure is not
+ defined.
+
+- Issue #20211: Do not add the directory for installing C header files and the
+ directory for installing object code libraries to the cross compilation
+ search paths. Original patch by Thomas Petazzoni.
+
+- Issue #28849: Do not define sys.implementation._multiarch on Android.
+
+- Issue #10656: Fix out-of-tree building on AIX. Patch by Tristan Carel and
+ Michael Haubenwallner.
+
+- Issue #26359: Rename --with-optimiations to --enable-optimizations.
+
+- Issue #28444: Fix missing extensions modules when cross compiling.
+
+- Issue #28208: Update Windows build and OS X installers to use SQLite 3.14.2.
+
+- Issue #28248: Update Windows build and OS X installers to use OpenSSL 1.0.2j.
+
+- Issue #21124: Fix building the _struct module on Cygwin by passing ``NULL``
+ instead of ``&PyType_Type`` to PyVarObject_HEAD_INIT. Patch by Masayuki
+ Yamamoto.
+
+- Issue #13756: Fix building extensions modules on Cygwin. Patch by Roumen
+ Petrov, based on original patch by Jason Tishler.
+
+- Issue #21085: Add configure check for siginfo_t.si_band, which Cygwin does
+ not provide. Patch by Masayuki Yamamoto with review and rebase by Erik Bray.
+
+- Issue #28258: Fixed build with Estonian locale (python-config and distclean
+ targets in Makefile). Patch by Arfrever Frehtes Taifersar Arahesis.
+
+- Issue #26661: setup.py now detects system libffi with multiarch wrapper.
+
+- Issue #27979: A full copy of libffi is no longer bundled for use when
+ building _ctypes on non-OSX UNIX platforms. An installed copy of libffi is
+ now required when building _ctypes on such platforms.
+
+- Issue #15819: Remove redundant include search directory option for building
+ outside the source tree.
+
+- Issue #28676: Prevent missing 'getentropy' declaration warning on macOS.
+ Patch by Gareth Rees.
+
+Tools/Demos
+-----------
+
+- Issue #29367: python-gdb.py now supports also ``method-wrapper``
+ (``wrapperobject``) objects.
+
+- Issue #28023: Fix python-gdb.py didn't support new dict implementation.
+
+- Issue #15369: The pybench and pystone microbenchmark have been removed from
+ Tools. Please use the new Python benchmark suite
+ https://github.com/python/performance which is more reliable and includes a
+ portable version of pybench working on Python 2 and Python 3.
+
+- Issue #28102: The zipfile module CLI now prints usage to stderr.
+ Patch by Stephen J. Turnbull.
+
Tests
-----
+- Issue #24932: Use proper command line parsing in _testembed
+
- Issue #28950: Disallow -j0 to be combined with -T/-l in regrtest
command line arguments.
- Issue #28683: Fix the tests that bind() a unix socket and raise
PermissionError on Android for a non-root user.
+ - Issue #26936: Fix the test_socket failures on Android - getservbyname(),
+ getservbyport() and getaddrinfo() are broken on some Android API levels.
+
+- Issue #28666: Now test.support.rmtree is able to remove unwritable or
+ unreadable directories.
+
+- Issue #23839: Various caches now are cleared before running every test file.
+
+- Issue #26944: Fix test_posix for Android where 'id -G' is entirely wrong or
+ missing the effective gid.
+
+- Issue #28409: regrtest: fix the parser of command line arguments.
+
+- Issue #28217: Adds _testconsole module to test console input.
+
- Issue #26939: Add the support.setswitchinterval() function to fix
test_functools hanging on the Android armv7 qemu emulator.
-Build
+
+What's New in Python 3.6.1 release candidate 1?
+===============================================
+
+*Release date: XXXX-XX-XX*
+
+Core and Builtins
+-----------------
+
+- Issue #28932: Do not include <sys/random.h> if it does not exist.
+
+- Issue #25677: Correct the positioning of the syntax error caret for
+ indented blocks. Based on patch by Michael Layzell.
+
+- Issue #29000: Fixed bytes formatting of octals with zero padding in alternate
+ form.
+
+- Issue #26919: On Android, operating system data is now always encoded/decoded
+ to/from UTF-8, instead of the locale encoding to avoid inconsistencies with
+ os.fsencode() and os.fsdecode() which are already using UTF-8.
+
+- Issue #28991: functools.lru_cache() was susceptible to an obscure reentrancy
+ bug triggerable by a monkey-patched len() function.
+
+- Issue #28739: f-string expressions are no longer accepted as docstrings and
+ by ast.literal_eval() even if they do not include expressions.
+
+- Issue #28512: Fixed setting the offset attribute of SyntaxError by
+ PyErr_SyntaxLocationEx() and PyErr_SyntaxLocationObject().
+
+- Issue #28918: Fix the cross compilation of xxlimited when Python has been
+ built with Py_DEBUG defined.
+
+- Issue #28731: Optimize _PyDict_NewPresized() to create correct size dict.
+ Improve speed of dict literal with constant keys up to 30%.
+
+Library
+-------
+
+- Issue #29085: Allow random.Random.seed() to use high quality OS randomness
+ rather than the pid and time.
+
+- Issue 28923: Remove editor artifacts from Tix.py.
+
+- Issue #29055: Neaten-up empty population error on random.choice()
+ by suppressing the upstream exception.
+
+- Issue #28871: Fixed a crash when deallocate deep ElementTree.
+
+- Issue #19542: Fix bugs in WeakValueDictionary.setdefault() and
+ WeakValueDictionary.pop() when a GC collection happens in another
+ thread.
+
+- Issue #20191: Fixed a crash in resource.prlimit() when passing a sequence that
+ doesn't own its elements as limits.
+
+- Issue #28779: multiprocessing.set_forkserver_preload() would crash the
+ forkserver process if a preloaded module instantiated some
+ multiprocessing objects such as locks.
+
+- Issue #28847: dbm.dumb now supports reading read-only files and no longer
+ writes the index file when it is not changed.
+
+- Issue #26937: The chown() method of the tarfile.TarFile class does not fail
+ now when the grp module cannot be imported, as for example on Android
+ platforms.
+
+Windows
+-------
+
+- Issue #29326: Ignores blank lines in ._pth files (Patch by Alexey Izbyshev)
+
+- Issue #28164: Correctly handle special console filenames (patch by Eryk Sun)
+
+- Issue #29409: Implement PEP 529 for io.FileIO (Patch by Eryk Sun)
+
+- Issue #29392: Prevent crash when passing invalid arguments into msvcrt module.
+
+- Issue #25778: winreg does not truncate string correctly (Patch by Eryk Sun)
+
+- Issue #28896: Deprecate WindowsRegistryFinder and disable it by default.
+
+Documentation
+-------------
+
+- Issue #29349: Fix Python 2 syntax in code for building the documentation.
+
+Tests
-----
-- Issue #26851: Set Android compilation and link flags.
+- Issue #28950: Disallow -j0 to be combined with -T/-l in regrtest
+ command line arguments.
-- Issue #28768: Fix implicit declaration of function _setmode. Patch by
- Masayuki Yamamoto
+- Issue #28683: Fix the tests that bind() a unix socket and raise
+ PermissionError on Android for a non-root user.
-- Issue #29080: Removes hard dependency on hg.exe from PCBuild/build.bat
+- Issue #26939: Add the support.setswitchinterval() function to fix
+ test_functools hanging on the Android armv7 qemu emulator.
-- Issue #23903: Added missed names to PC/python3.def.
+Build
+-----
- Issue #28762: lockf() is available on Android API level 24, but the F_LOCK
macro is not defined in android-ndk-r13.
diff --git a/Misc/SpecialBuilds.txt b/Misc/SpecialBuilds.txt
index 82fa23e1a7..6799ea3ff1 100644
--- a/Misc/SpecialBuilds.txt
+++ b/Misc/SpecialBuilds.txt
@@ -223,14 +223,3 @@ the interpreter is doing are sprayed to stdout, such as every opcode and opcode
argument and values pushed onto and popped off the value stack.
Not useful very often, but very useful when needed.
-
-
-CALL_PROFILE
-------------
-
-Count the number of function calls executed.
-
-When this symbol is defined, the ceval mainloop and helper functions count the
-number of function calls made. It keeps detailed statistics about what kind of
-object was called and whether the call hit any of the special fast paths in the
-code.
diff --git a/Modules/_asynciomodule.c b/Modules/_asynciomodule.c
index fff90468a5..ceac7f0039 100644
--- a/Modules/_asynciomodule.c
+++ b/Modules/_asynciomodule.c
@@ -118,8 +118,8 @@ future_schedule_callbacks(FutureObj *fut)
PyObject *handle = NULL;
PyObject *cb = PyList_GET_ITEM(iters, i);
- handle = _PyObject_CallMethodId(
- fut->fut_loop, &PyId_call_soon, "OO", cb, fut, NULL);
+ handle = _PyObject_CallMethodIdObjArgs(fut->fut_loop, &PyId_call_soon,
+ cb, fut, NULL);
if (handle == NULL) {
Py_DECREF(iters);
@@ -141,7 +141,7 @@ future_init(FutureObj *fut, PyObject *loop)
_Py_IDENTIFIER(get_debug);
if (loop == NULL || loop == Py_None) {
- loop = PyObject_CallObject(asyncio_get_event_loop, NULL);
+ loop = _PyObject_CallNoArg(asyncio_get_event_loop);
if (loop == NULL) {
return -1;
}
@@ -158,7 +158,7 @@ future_init(FutureObj *fut, PyObject *loop)
}
if (PyObject_IsTrue(res)) {
Py_CLEAR(res);
- fut->fut_source_tb = PyObject_CallObject(traceback_extract_stack, NULL);
+ fut->fut_source_tb = _PyObject_CallNoArg(traceback_extract_stack);
if (fut->fut_source_tb == NULL) {
return -1;
}
@@ -204,7 +204,7 @@ future_set_exception(FutureObj *fut, PyObject *exc)
}
if (PyExceptionClass_Check(exc)) {
- exc_val = PyObject_CallObject(exc, NULL);
+ exc_val = _PyObject_CallNoArg(exc);
if (exc_val == NULL) {
return NULL;
}
@@ -257,7 +257,7 @@ future_get_result(FutureObj *fut, PyObject **result)
return -1;
}
- exc = _PyObject_CallArg1(asyncio_InvalidStateError, msg);
+ exc = PyObject_CallFunctionObjArgs(asyncio_InvalidStateError, msg, NULL);
Py_DECREF(msg);
if (exc == NULL) {
return -1;
@@ -283,8 +283,9 @@ static PyObject *
future_add_done_callback(FutureObj *fut, PyObject *arg)
{
if (fut->fut_state != STATE_PENDING) {
- PyObject *handle = _PyObject_CallMethodId(
- fut->fut_loop, &PyId_call_soon, "OO", arg, fut, NULL);
+ PyObject *handle = _PyObject_CallMethodIdObjArgs(fut->fut_loop,
+ &PyId_call_soon,
+ arg, fut, NULL);
if (handle == NULL) {
return NULL;
@@ -835,7 +836,7 @@ FutureObj_finalize(FutureObj *fut)
func = _PyObject_GetAttrId(fut->fut_loop, &PyId_call_exception_handler);
if (func != NULL) {
- res = _PyObject_CallArg1(func, context);
+ res = PyObject_CallFunctionObjArgs(func, context, NULL);
if (res == NULL) {
PyErr_WriteUnraisable(func);
}
@@ -1429,7 +1430,7 @@ _asyncio_Task_current_task_impl(PyTypeObject *type, PyObject *loop)
PyObject *res;
if (loop == NULL) {
- loop = PyObject_CallObject(asyncio_get_event_loop, NULL);
+ loop = _PyObject_CallNoArg(asyncio_get_event_loop);
if (loop == NULL) {
return NULL;
}
@@ -1514,7 +1515,7 @@ _asyncio_Task_all_tasks_impl(PyTypeObject *type, PyObject *loop)
PyObject *res;
if (loop == NULL) {
- loop = PyObject_CallObject(asyncio_get_event_loop, NULL);
+ loop = _PyObject_CallNoArg(asyncio_get_event_loop);
if (loop == NULL) {
return NULL;
}
@@ -1731,7 +1732,7 @@ TaskObj_finalize(TaskObj *task)
func = _PyObject_GetAttrId(task->task_loop, &PyId_call_exception_handler);
if (func != NULL) {
- res = _PyObject_CallArg1(func, context);
+ res = PyObject_CallFunctionObjArgs(func, context, NULL);
if (res == NULL) {
PyErr_WriteUnraisable(func);
}
@@ -1948,7 +1949,7 @@ task_step_impl(TaskObj *task, PyObject *exc)
if (!exc) {
/* exc was not a CancelledError */
- exc = PyObject_CallFunctionObjArgs(asyncio_CancelledError, NULL);
+ exc = _PyObject_CallNoArg(asyncio_CancelledError);
if (!exc) {
goto fail;
}
@@ -1965,13 +1966,13 @@ task_step_impl(TaskObj *task, PyObject *exc)
result = _PyGen_Send((PyGenObject*)coro, Py_None);
}
else {
- result = _PyObject_CallMethodIdObjArgs(
- coro, &PyId_send, Py_None, NULL);
+ result = _PyObject_CallMethodIdObjArgs(coro, &PyId_send,
+ Py_None, NULL);
}
}
else {
- result = _PyObject_CallMethodIdObjArgs(
- coro, &PyId_throw, exc, NULL);
+ result = _PyObject_CallMethodIdObjArgs(coro, &PyId_throw,
+ exc, NULL);
if (clear_exc) {
/* We created 'exc' during this call */
Py_CLEAR(exc);
@@ -2388,7 +2389,7 @@ module_init(void)
WITH_MOD("weakref")
GET_MOD_ATTR(cls, "WeakSet")
- all_tasks = PyObject_CallObject(cls, NULL);
+ all_tasks = _PyObject_CallNoArg(cls);
Py_CLEAR(cls);
if (all_tasks == NULL) {
goto fail;
diff --git a/Modules/_bisectmodule.c b/Modules/_bisectmodule.c
index 22ddbf2a56..831e10aa60 100644
--- a/Modules/_bisectmodule.c
+++ b/Modules/_bisectmodule.c
@@ -216,18 +216,11 @@ If x is already in a, insert it to the left of the leftmost x.\n\
Optional args lo (default 0) and hi (default len(a)) bound the\n\
slice of a to be searched.\n");
-PyDoc_STRVAR(bisect_doc, "Alias for bisect_right().\n");
-PyDoc_STRVAR(insort_doc, "Alias for insort_right().\n");
-
static PyMethodDef bisect_methods[] = {
{"bisect_right", (PyCFunction)bisect_right,
METH_VARARGS|METH_KEYWORDS, bisect_right_doc},
- {"bisect", (PyCFunction)bisect_right,
- METH_VARARGS|METH_KEYWORDS, bisect_doc},
{"insort_right", (PyCFunction)insort_right,
METH_VARARGS|METH_KEYWORDS, insort_right_doc},
- {"insort", (PyCFunction)insort_right,
- METH_VARARGS|METH_KEYWORDS, insort_doc},
{"bisect_left", (PyCFunction)bisect_left,
METH_VARARGS|METH_KEYWORDS, bisect_left_doc},
{"insort_left", (PyCFunction)insort_left,
diff --git a/Modules/_blake2/blake2b_impl.c b/Modules/_blake2/blake2b_impl.c
index 58b502bb34..ec9e3c14b0 100644
--- a/Modules/_blake2/blake2b_impl.c
+++ b/Modules/_blake2/blake2b_impl.c
@@ -310,8 +310,7 @@ _blake2b_blake2b_update(BLAKE2bObject *self, PyObject *obj)
#endif /* !WITH_THREAD */
PyBuffer_Release(&buf);
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
/*[clinic input]
diff --git a/Modules/_blake2/blake2s_impl.c b/Modules/_blake2/blake2s_impl.c
index 11d2e02251..42257a24fd 100644
--- a/Modules/_blake2/blake2s_impl.c
+++ b/Modules/_blake2/blake2s_impl.c
@@ -310,8 +310,7 @@ _blake2s_blake2s_update(BLAKE2sObject *self, PyObject *obj)
#endif /* !WITH_THREAD */
PyBuffer_Release(&buf);
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
/*[clinic input]
diff --git a/Modules/_collectionsmodule.c b/Modules/_collectionsmodule.c
index e6111c64e7..8615bf1d39 100644
--- a/Modules/_collectionsmodule.c
+++ b/Modules/_collectionsmodule.c
@@ -538,7 +538,8 @@ deque_copy(PyObject *deque)
return NULL;
}
if (old_deque->maxlen < 0)
- return PyObject_CallFunction((PyObject *)(Py_TYPE(deque)), "O", deque, NULL);
+ return PyObject_CallFunctionObjArgs((PyObject *)(Py_TYPE(deque)),
+ deque, NULL);
else
return PyObject_CallFunction((PyObject *)(Py_TYPE(deque)), "Oi",
deque, old_deque->maxlen, NULL);
@@ -907,12 +908,18 @@ done:
}
static PyObject *
-deque_rotate(dequeobject *deque, PyObject *args)
+deque_rotate(dequeobject *deque, PyObject **args, Py_ssize_t nargs,
+ PyObject *kwnames)
{
Py_ssize_t n=1;
- if (!PyArg_ParseTuple(args, "|n:rotate", &n))
+ if (!_PyArg_NoStackKeywords("rotate", kwnames)) {
return NULL;
+ }
+ if (!_PyArg_ParseStack(args, nargs, "|n:rotate", &n)) {
+ return NULL;
+ }
+
if (!_deque_rotate(deque, n))
Py_RETURN_NONE;
return NULL;
@@ -1041,7 +1048,8 @@ deque_len(dequeobject *deque)
}
static PyObject *
-deque_index(dequeobject *deque, PyObject *args)
+deque_index(dequeobject *deque, PyObject **args, Py_ssize_t nargs,
+ PyObject *kwnames)
{
Py_ssize_t i, n, start=0, stop=Py_SIZE(deque);
PyObject *v, *item;
@@ -1050,10 +1058,15 @@ deque_index(dequeobject *deque, PyObject *args)
size_t start_state = deque->state;
int cmp;
- if (!PyArg_ParseTuple(args, "O|O&O&:index", &v,
- _PyEval_SliceIndex, &start,
- _PyEval_SliceIndex, &stop))
+ if (!_PyArg_NoStackKeywords("index", kwnames)) {
+ return NULL;
+ }
+ if (!_PyArg_ParseStack(args, nargs, "O|O&O&:index", &v,
+ _PyEval_SliceIndex, &start,
+ _PyEval_SliceIndex, &stop)) {
return NULL;
+ }
+
if (start < 0) {
start += Py_SIZE(deque);
if (start < 0)
@@ -1116,15 +1129,21 @@ PyDoc_STRVAR(index_doc,
*/
static PyObject *
-deque_insert(dequeobject *deque, PyObject *args)
+deque_insert(dequeobject *deque, PyObject **args, Py_ssize_t nargs,
+ PyObject *kwnames)
{
Py_ssize_t index;
Py_ssize_t n = Py_SIZE(deque);
PyObject *value;
PyObject *rv;
- if (!PyArg_ParseTuple(args, "nO:insert", &index, &value))
+ if (!_PyArg_NoStackKeywords("insert", kwnames)) {
+ return NULL;
+ }
+ if (!_PyArg_ParseStack(args, nargs, "nO:insert", &index, &value)) {
return NULL;
+ }
+
if (deque->maxlen == Py_SIZE(deque)) {
PyErr_SetString(PyExc_IndexError, "deque already at its maximum size");
return NULL;
@@ -1594,9 +1613,9 @@ static PyMethodDef deque_methods[] = {
{"extendleft", (PyCFunction)deque_extendleft,
METH_O, extendleft_doc},
{"index", (PyCFunction)deque_index,
- METH_VARARGS, index_doc},
+ METH_FASTCALL, index_doc},
{"insert", (PyCFunction)deque_insert,
- METH_VARARGS, insert_doc},
+ METH_FASTCALL, insert_doc},
{"pop", (PyCFunction)deque_pop,
METH_NOARGS, pop_doc},
{"popleft", (PyCFunction)deque_popleft,
@@ -1610,7 +1629,7 @@ static PyMethodDef deque_methods[] = {
{"reverse", (PyCFunction)deque_reverse,
METH_NOARGS, reverse_doc},
{"rotate", (PyCFunction)deque_rotate,
- METH_VARARGS, rotate_doc},
+ METH_FASTCALL, rotate_doc},
{"__sizeof__", (PyCFunction)deque_sizeof,
METH_NOARGS, sizeof_doc},
{NULL, NULL} /* sentinel */
diff --git a/Modules/_csv.c b/Modules/_csv.c
index 7a78541bf2..fb5530ab57 100644
--- a/Modules/_csv.c
+++ b/Modules/_csv.c
@@ -152,8 +152,7 @@ static PyObject *
get_nullchar_as_None(Py_UCS4 c)
{
if (c == '\0') {
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
else
return PyUnicode_FromOrdinal(c);
@@ -209,23 +208,17 @@ _set_int(const char *name, int *target, PyObject *src, int dflt)
if (src == NULL)
*target = dflt;
else {
- long value;
+ int value;
if (!PyLong_CheckExact(src)) {
PyErr_Format(PyExc_TypeError,
"\"%s\" must be an integer", name);
return -1;
}
- value = PyLong_AsLong(src);
- if (value == -1 && PyErr_Occurred())
- return -1;
-#if SIZEOF_LONG > SIZEOF_INT
- if (value > INT_MAX || value < INT_MIN) {
- PyErr_Format(PyExc_ValueError,
- "integer out of range for \"%s\"", name);
+ value = _PyLong_AsInt(src);
+ if (value == -1 && PyErr_Occurred()) {
return -1;
}
-#endif
- *target = (int)value;
+ *target = value;
}
return 0;
}
@@ -1300,8 +1293,7 @@ csv_writerows(WriterObj *self, PyObject *seqseq)
Py_DECREF(row_iter);
if (PyErr_Occurred())
return NULL;
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
static struct PyMethodDef Writer_methods[] = {
@@ -1456,8 +1448,7 @@ csv_register_dialect(PyObject *module, PyObject *args, PyObject *kwargs)
return NULL;
}
Py_DECREF(dialect);
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
static PyObject *
@@ -1465,8 +1456,7 @@ csv_unregister_dialect(PyObject *module, PyObject *name_obj)
{
if (PyDict_DelItem(_csvstate_global->dialects, name_obj) < 0)
return PyErr_Format(_csvstate_global->error_obj, "unknown dialect");
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
static PyObject *
diff --git a/Modules/_ctypes/_ctypes.c b/Modules/_ctypes/_ctypes.c
index df3aedec6e..833749a1c5 100644
--- a/Modules/_ctypes/_ctypes.c
+++ b/Modules/_ctypes/_ctypes.c
@@ -156,8 +156,7 @@ _DictRemover_call(PyObject *myself, PyObject *args, PyObject *kw)
Py_CLEAR(self->key);
Py_CLEAR(self->dict);
}
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
static PyTypeObject DictRemover_Type = {
@@ -211,7 +210,7 @@ PyDict_SetItemProxy(PyObject *dict, PyObject *key, PyObject *item)
PyObject *proxy;
int result;
- obj = PyObject_CallObject((PyObject *)&DictRemover_Type, NULL);
+ obj = _PyObject_CallNoArg((PyObject *)&DictRemover_Type);
if (obj == NULL)
return -1;
@@ -373,7 +372,7 @@ StructUnionType_new(PyTypeObject *type, PyObject *args, PyObject *kwds, int isSt
if (PyDict_GetItemString(result->tp_dict, "_abstract_"))
return (PyObject *)result;
- dict = (StgDictObject *)PyObject_CallObject((PyObject *)&PyCStgDict_Type, NULL);
+ dict = (StgDictObject *)_PyObject_CallNoArg((PyObject *)&PyCStgDict_Type);
if (!dict) {
Py_DECREF(result);
return NULL;
@@ -979,8 +978,7 @@ PyCPointerType_set_type(PyTypeObject *self, PyObject *type)
if (-1 == PyDict_SetItemString((PyObject *)dict, "_type_", type))
return NULL;
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
static PyObject *_byref(PyObject *);
@@ -1496,8 +1494,7 @@ c_wchar_p_from_param(PyObject *type, PyObject *value)
PyObject *as_parameter;
int res;
if (value == Py_None) {
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
if (PyUnicode_Check(value)) {
PyCArgObject *parg;
@@ -1561,8 +1558,7 @@ c_char_p_from_param(PyObject *type, PyObject *value)
PyObject *as_parameter;
int res;
if (value == Py_None) {
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
if (PyBytes_Check(value)) {
PyCArgObject *parg;
@@ -1629,8 +1625,7 @@ c_void_p_from_param(PyObject *type, PyObject *value)
/* None */
if (value == Py_None) {
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
/* Should probably allow buffer interface as well */
/* int, long */
@@ -1835,7 +1830,7 @@ static PyCArgObject *
PyCSimpleType_paramfunc(CDataObject *self)
{
StgDictObject *dict;
- char *fmt;
+ const char *fmt;
PyCArgObject *parg;
struct fielddesc *fd;
@@ -2045,7 +2040,7 @@ static PyObject *
PyCSimpleType_from_param(PyObject *type, PyObject *value)
{
StgDictObject *dict;
- char *fmt;
+ const char *fmt;
PyCArgObject *parg;
struct fielddesc *fd;
PyObject *as_parameter;
@@ -2602,8 +2597,7 @@ PyCData_setstate(PyObject *myself, PyObject *args)
Py_DECREF(mydict);
if (res == -1)
return NULL;
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
/*
@@ -2825,8 +2819,7 @@ _PyCData_set(CDataObject *dst, PyObject *type, SETFUNC setfunc, PyObject *value,
return result;
} else if (value == Py_None && PyCPointerTypeObject_Check(type)) {
*(void **)ptr = NULL;
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
} else {
PyErr_Format(PyExc_TypeError,
"expected %s instance, got %s",
@@ -2980,8 +2973,7 @@ PyCFuncPtr_get_errcheck(PyCFuncPtrObject *self)
Py_INCREF(self->errcheck);
return self->errcheck;
}
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
static int
@@ -3019,8 +3011,7 @@ PyCFuncPtr_get_restype(PyCFuncPtrObject *self)
Py_INCREF(dict->restype);
return dict->restype;
} else {
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
}
@@ -3057,8 +3048,7 @@ PyCFuncPtr_get_argtypes(PyCFuncPtrObject *self)
Py_INCREF(dict->argtypes);
return dict->argtypes;
} else {
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
}
@@ -3654,10 +3644,10 @@ _build_callargs(PyCFuncPtrObject *self, PyObject *argtypes,
goto error;
}
if (PyCArrayTypeObject_Check(ob))
- ob = PyObject_CallObject(ob, NULL);
+ ob = _PyObject_CallNoArg(ob);
else
/* Create an instance of the pointed-to type */
- ob = PyObject_CallObject(dict->proto, NULL);
+ ob = _PyObject_CallNoArg(dict->proto);
/*
XXX Is the following correct any longer?
We must not pass a byref() to the array then but
@@ -3684,7 +3674,7 @@ _build_callargs(PyCFuncPtrObject *self, PyObject *argtypes,
must be the same as len(inargs) + len(kwds), otherwise we have
either too much or not enough arguments. */
- actual_args = PyTuple_GET_SIZE(inargs) + (kwds ? PyDict_Size(kwds) : 0);
+ actual_args = PyTuple_GET_SIZE(inargs) + (kwds ? PyDict_GET_SIZE(kwds) : 0);
if (actual_args != inargs_index) {
/* When we have default values or named parameters, this error
message is misleading. See unittests/test_paramflags.py
@@ -5258,7 +5248,7 @@ cast(void *ptr, PyObject *src, PyObject *ctype)
CDataObject *result;
if (0 == cast_check_pointertype(ctype))
return NULL;
- result = (CDataObject *)PyObject_CallFunctionObjArgs(ctype, NULL);
+ result = (CDataObject *)_PyObject_CallNoArg(ctype);
if (result == NULL)
return NULL;
diff --git a/Modules/_ctypes/_ctypes_test.c b/Modules/_ctypes/_ctypes_test.c
index 629ddf66bc..92b5adb0ca 100644
--- a/Modules/_ctypes/_ctypes_test.c
+++ b/Modules/_ctypes/_ctypes_test.c
@@ -363,8 +363,7 @@ PyObject *py_func_si(PyObject *self, PyObject *args)
int i;
if (!PyArg_ParseTuple(args, "si", &name, &i))
return NULL;
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
EXPORT(void) _py_func_si(char *s, int i)
@@ -373,8 +372,7 @@ EXPORT(void) _py_func_si(char *s, int i)
PyObject *py_func(PyObject *self, PyObject *args)
{
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
EXPORT(void) _py_func(void)
diff --git a/Modules/_ctypes/callbacks.c b/Modules/_ctypes/callbacks.c
index b958f304c5..a11ae04763 100644
--- a/Modules/_ctypes/callbacks.c
+++ b/Modules/_ctypes/callbacks.c
@@ -181,7 +181,7 @@ static void _CallPythonObject(void *mem,
*/
} else if (dict) {
/* Hm, shouldn't we use PyCData_AtAddress() or something like that instead? */
- CDataObject *obj = (CDataObject *)PyObject_CallFunctionObjArgs(cnv, NULL);
+ CDataObject *obj = (CDataObject *)_PyObject_CallNoArg(cnv);
if (!obj) {
PrintError("create argument %d:\n", i);
Py_DECREF(cnv);
@@ -535,7 +535,7 @@ long Call_CanUnloadNow(void)
return E_FAIL;
}
- result = PyObject_CallFunction(func, NULL);
+ result = _PyObject_CallNoArg(func);
Py_DECREF(func);
if (!result) {
PyErr_WriteUnraisable(context ? context : Py_None);
diff --git a/Modules/_ctypes/callproc.c b/Modules/_ctypes/callproc.c
index 7d542fb50d..9b368caf65 100644
--- a/Modules/_ctypes/callproc.c
+++ b/Modules/_ctypes/callproc.c
@@ -892,8 +892,7 @@ static PyObject *GetResult(PyObject *restype, void *result, PyObject *checker)
return PyLong_FromLong(*(int *)result);
if (restype == Py_None) {
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
dict = PyType_stgdict(restype);
@@ -1263,8 +1262,7 @@ static PyObject *free_library(PyObject *self, PyObject *args)
return NULL;
if (!FreeLibrary((HMODULE)hMod))
return PyErr_SetFromWindowsErr(GetLastError());
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
static const char copy_com_pointer_doc[] =
@@ -1349,8 +1347,7 @@ static PyObject *py_dl_close(PyObject *self, PyObject *args)
ctypes_dlerror());
return NULL;
}
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
static PyObject *py_dl_sym(PyObject *self, PyObject *args)
@@ -1624,32 +1621,39 @@ resize(PyObject *self, PyObject *args)
obj->b_size = size;
}
done:
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
static PyObject *
unpickle(PyObject *self, PyObject *args)
{
- PyObject *typ;
- PyObject *state;
- PyObject *result;
- PyObject *tmp;
+ PyObject *typ, *state, *meth, *obj, *result;
_Py_IDENTIFIER(__new__);
_Py_IDENTIFIER(__setstate__);
- if (!PyArg_ParseTuple(args, "OO", &typ, &state))
+ if (!PyArg_ParseTuple(args, "OO!", &typ, &PyTuple_Type, &state))
return NULL;
- result = _PyObject_CallMethodId(typ, &PyId___new__, "O", typ);
- if (result == NULL)
- return NULL;
- tmp = _PyObject_CallMethodId(result, &PyId___setstate__, "O", state);
- if (tmp == NULL) {
- Py_DECREF(result);
+ obj = _PyObject_CallMethodIdObjArgs(typ, &PyId___new__, typ, NULL);
+ if (obj == NULL)
return NULL;
+
+ meth = _PyObject_GetAttrId(obj, &PyId___setstate__);
+ if (meth == NULL) {
+ goto error;
}
- Py_DECREF(tmp);
- return result;
+
+ result = PyObject_Call(meth, state, NULL);
+ Py_DECREF(meth);
+ if (result == NULL) {
+ goto error;
+ }
+ Py_DECREF(result);
+
+ return obj;
+
+error:
+ Py_DECREF(obj);
+ return NULL;
}
static PyObject *
diff --git a/Modules/_ctypes/cfield.c b/Modules/_ctypes/cfield.c
index a43585f1b8..bb9b115bd2 100644
--- a/Modules/_ctypes/cfield.c
+++ b/Modules/_ctypes/cfield.c
@@ -498,7 +498,7 @@ get_ulonglong(PyObject *v, unsigned long long *p)
#ifdef _CTYPES_DEBUG_KEEP
#define _RET(x) Py_INCREF(x); return x
#else
-#define _RET(X) Py_INCREF(Py_None); return Py_None
+#define _RET(X) Py_RETURN_NONE
#endif
/*****************************************************************
@@ -1337,8 +1337,7 @@ z_get(void *ptr, Py_ssize_t size)
return PyBytes_FromStringAndSize(*(char **)ptr,
strlen(*(char **)ptr));
} else {
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
}
@@ -1360,8 +1359,7 @@ Z_set(void *ptr, PyObject *value, Py_ssize_t size)
#else
*(wchar_t **)ptr = (wchar_t *)PyLong_AsUnsignedLongMask(value);
#endif
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
if (!PyUnicode_Check(value)) {
PyErr_Format(PyExc_TypeError,
@@ -1392,8 +1390,7 @@ Z_get(void *ptr, Py_ssize_t size)
if (p) {
return PyUnicode_FromWideChar(p, wcslen(p));
} else {
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
}
#endif
@@ -1452,8 +1449,7 @@ BSTR_get(void *ptr, Py_ssize_t size)
/* Hm, it seems NULL pointer and zero length string are the
same in BSTR, see Don Box, p 81
*/
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
}
#endif
@@ -1493,8 +1489,7 @@ static PyObject *
P_get(void *ptr, Py_ssize_t size)
{
if (*(void **)ptr == NULL) {
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
return PyLong_FromVoidPtr(*(void **)ptr);
}
diff --git a/Modules/_ctypes/libffi.diff b/Modules/_ctypes/libffi.diff
deleted file mode 100644
index ffa7bafe0e..0000000000
--- a/Modules/_ctypes/libffi.diff
+++ /dev/null
@@ -1,209 +0,0 @@
-diff -urN libffi-3.1/configure libffi/configure
---- libffi-3.1/configure 2014-05-19 15:44:03.000000000 +0200
-+++ libffi/configure 2014-08-09 21:51:07.877871443 +0200
-@@ -17236,6 +17236,10 @@
- fi
- ;;
-
-+ i*86-*-nto-qnx*)
-+ TARGET=X86; TARGETDIR=x86
-+ ;;
-+
- x86_64-*-darwin*)
- TARGET=X86_DARWIN; TARGETDIR=x86
- ;;
-@@ -17298,12 +17302,12 @@
- ;;
-
- mips-sgi-irix5.* | mips-sgi-irix6.* | mips*-*-rtems*)
-- TARGET=MIPS; TARGETDIR=mips
-+ TARGET=MIPS_IRIX; TARGETDIR=mips
- ;;
- mips*-*linux* | mips*-*-openbsd*)
- # Support 128-bit long double for NewABI.
- HAVE_LONG_DOUBLE='defined(__mips64)'
-- TARGET=MIPS; TARGETDIR=mips
-+ TARGET=MIPS_LINUX; TARGETDIR=mips
- ;;
-
- nios2*-linux*)
-@@ -17373,7 +17377,7 @@
- as_fn_error $? "\"libffi has not been ported to $host.\"" "$LINENO" 5
- fi
-
-- if test x$TARGET = xMIPS; then
-+ if expr x$TARGET : 'xMIPS' > /dev/null; then
- MIPS_TRUE=
- MIPS_FALSE='#'
- else
-@@ -18814,6 +18818,12 @@
- ac_config_files="$ac_config_files include/Makefile include/ffi.h Makefile testsuite/Makefile man/Makefile libffi.pc"
-
-
-+ac_config_links="$ac_config_links include/ffi_common.h:include/ffi_common.h"
-+
-+
-+ac_config_files="$ac_config_files fficonfig.py"
-+
-+
- 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
-@@ -20126,6 +20136,8 @@
- "testsuite/Makefile") CONFIG_FILES="$CONFIG_FILES testsuite/Makefile" ;;
- "man/Makefile") CONFIG_FILES="$CONFIG_FILES man/Makefile" ;;
- "libffi.pc") CONFIG_FILES="$CONFIG_FILES libffi.pc" ;;
-+ "include/ffi_common.h") CONFIG_LINKS="$CONFIG_LINKS include/ffi_common.h:include/ffi_common.h" ;;
-+ "fficonfig.py") CONFIG_FILES="$CONFIG_FILES fficonfig.py" ;;
-
- *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
- esac
-diff -urN libffi-3.1/configure.ac libffi/configure.ac
---- libffi-3.1/configure.ac 2014-05-11 15:57:49.000000000 +0200
-+++ libffi/configure.ac 2014-08-09 21:51:07.877871443 +0200
-@@ -1,4 +1,7 @@
- dnl Process this with autoconf to create configure
-+#
-+# file from libffi - slightly patched for Python's ctypes
-+#
-
- AC_PREREQ(2.68)
-
-@@ -144,6 +147,9 @@
- AM_LTLDFLAGS='-no-undefined -bindir "$(bindir)"';
- fi
- ;;
-+ i*86-*-nto-qnx*)
-+ TARGET=X86; TARGETDIR=x86
-+ ;;
- i?86-*-darwin*)
- TARGET=X86_DARWIN; TARGETDIR=x86
- ;;
-@@ -218,12 +224,12 @@
- ;;
-
- mips-sgi-irix5.* | mips-sgi-irix6.* | mips*-*-rtems*)
-- TARGET=MIPS; TARGETDIR=mips
-+ TARGET=MIPS_IRIX; TARGETDIR=mips
- ;;
- mips*-*linux* | mips*-*-openbsd*)
- # Support 128-bit long double for NewABI.
- HAVE_LONG_DOUBLE='defined(__mips64)'
-- TARGET=MIPS; TARGETDIR=mips
-+ TARGET=MIPS_LINUX; TARGETDIR=mips
- ;;
-
- nios2*-linux*)
-@@ -293,7 +299,7 @@
- AC_MSG_ERROR(["libffi has not been ported to $host."])
- fi
-
--AM_CONDITIONAL(MIPS, test x$TARGET = xMIPS)
-+AM_CONDITIONAL(MIPS,[expr x$TARGET : 'xMIPS' > /dev/null])
- AM_CONDITIONAL(BFIN, test x$TARGET = xBFIN)
- AM_CONDITIONAL(SPARC, test x$TARGET = xSPARC)
- AM_CONDITIONAL(X86, test x$TARGET = xX86)
-@@ -617,4 +623,8 @@
-
- AC_CONFIG_FILES(include/Makefile include/ffi.h Makefile testsuite/Makefile man/Makefile libffi.pc)
-
-+AC_CONFIG_LINKS(include/ffi_common.h:include/ffi_common.h)
-+
-+AC_CONFIG_FILES(fficonfig.py)
-+
- AC_OUTPUT
-diff -urN libffi-3.1/fficonfig.py.in libffi/fficonfig.py.in
---- libffi-3.1/fficonfig.py.in 1970-01-01 01:00:00.000000000 +0100
-+++ libffi/fficonfig.py.in 2014-08-09 21:43:25.229871827 +0200
-@@ -0,0 +1,35 @@
-+ffi_sources = """
-+src/prep_cif.c
-+src/closures.c
-+""".split()
-+
-+ffi_platforms = {
-+ 'MIPS_IRIX': ['src/mips/ffi.c', 'src/mips/o32.S', 'src/mips/n32.S'],
-+ 'MIPS_LINUX': ['src/mips/ffi.c', 'src/mips/o32.S'],
-+ 'X86': ['src/x86/ffi.c', 'src/x86/sysv.S', 'src/x86/win32.S'],
-+ 'X86_FREEBSD': ['src/x86/ffi.c', 'src/x86/freebsd.S'],
-+ 'X86_WIN32': ['src/x86/ffi.c', 'src/x86/win32.S'],
-+ 'SPARC': ['src/sparc/ffi.c', 'src/sparc/v8.S', 'src/sparc/v9.S'],
-+ 'ALPHA': ['src/alpha/ffi.c', 'src/alpha/osf.S'],
-+ 'IA64': ['src/ia64/ffi.c', 'src/ia64/unix.S'],
-+ 'M32R': ['src/m32r/sysv.S', 'src/m32r/ffi.c'],
-+ 'M68K': ['src/m68k/ffi.c', 'src/m68k/sysv.S'],
-+ 'POWERPC': ['src/powerpc/ffi.c', 'src/powerpc/ffi_sysv.c', 'src/powerpc/ffi_linux64.c', 'src/powerpc/sysv.S', 'src/powerpc/ppc_closure.S', 'src/powerpc/linux64.S', 'src/powerpc/linux64_closure.S'],
-+ 'POWERPC_AIX': ['src/powerpc/ffi_darwin.c', 'src/powerpc/aix.S', 'src/powerpc/aix_closure.S'],
-+ 'POWERPC_FREEBSD': ['src/powerpc/ffi.c', 'src/powerpc/sysv.S', 'src/powerpc/ppc_closure.S'],
-+ 'AARCH64': ['src/aarch64/sysv.S', 'src/aarch64/ffi.c'],
-+ 'ARM': ['src/arm/sysv.S', 'src/arm/ffi.c'],
-+ 'LIBFFI_CRIS': ['src/cris/sysv.S', 'src/cris/ffi.c'],
-+ 'FRV': ['src/frv/eabi.S', 'src/frv/ffi.c'],
-+ 'S390': ['src/s390/sysv.S', 'src/s390/ffi.c'],
-+ 'X86_64': ['src/x86/ffi64.c', 'src/x86/unix64.S', 'src/x86/ffi.c', 'src/x86/sysv.S'],
-+ 'SH': ['src/sh/sysv.S', 'src/sh/ffi.c'],
-+ 'SH64': ['src/sh64/sysv.S', 'src/sh64/ffi.c'],
-+ 'PA': ['src/pa/linux.S', 'src/pa/ffi.c'],
-+ 'PA_LINUX': ['src/pa/linux.S', 'src/pa/ffi.c'],
-+ 'PA_HPUX': ['src/pa/hpux32.S', 'src/pa/ffi.c'],
-+}
-+
-+ffi_sources += ffi_platforms['@TARGET@']
-+
-+ffi_cflags = '@CFLAGS@'
-diff -urN libffi-3.1/src/dlmalloc.c libffi/src/dlmalloc.c
---- libffi-3.1/src/dlmalloc.c 2014-04-25 19:45:13.000000000 +0200
-+++ libffi/src/dlmalloc.c 2014-08-09 21:51:07.881871443 +0200
-@@ -457,6 +457,11 @@
- #define LACKS_ERRNO_H
- #define MALLOC_FAILURE_ACTION
- #define MMAP_CLEARS 0 /* WINCE and some others apparently don't clear */
-+#elif !defined _GNU_SOURCE
-+/* mremap() on Linux requires this via sys/mman.h
-+ * See roundup issue 10309
-+ */
-+#define _GNU_SOURCE 1
- #endif /* WIN32 */
-
- #ifdef __OS2__
-@@ -4497,7 +4502,7 @@
- char* tbase = (char*)(CALL_MMAP(tsize));
- if (tbase != CMFAIL) {
- m = init_user_mstate(tbase, tsize);
-- set_segment_flags(&m->seg, IS_MMAPPED_BIT);
-+ (void)set_segment_flags(&m->seg, IS_MMAPPED_BIT);
- set_lock(m, locked);
- }
- }
-@@ -4512,7 +4517,7 @@
- if (capacity > msize + TOP_FOOT_SIZE &&
- capacity < (size_t) -(msize + TOP_FOOT_SIZE + mparams.page_size)) {
- m = init_user_mstate((char*)base, capacity);
-- set_segment_flags(&m->seg, EXTERN_BIT);
-+ (void)set_segment_flags(&m->seg, EXTERN_BIT);
- set_lock(m, locked);
- }
- return (mspace)m;
-diff -urN libffi-3.1/src/arm/ffi.c libffi/src/arm/ffi.c
---- libffi-3.1/src/arm/ffi.c Sat Aug 09 23:52:34 2014 +0200
-+++ libffi/src/arm/ffi.c Sat Aug 09 23:58:38 2014 +0200
-@@ -154,9 +154,6 @@
-
- int ffi_prep_args_VFP(char *stack, extended_cif *ecif, float *vfp_space)
- {
-- // make sure we are using FFI_VFP
-- FFI_ASSERT(ecif->cif->abi == FFI_VFP);
--
- register unsigned int i, vi = 0;
- register void **p_argv;
- register char *argp, *regp, *eo_regp;
-@@ -165,6 +162,9 @@
- char done_with_regs = 0;
- char is_vfp_type;
-
-+ // make sure we are using FFI_VFP
-+ FFI_ASSERT(ecif->cif->abi == FFI_VFP);
-+
- /* the first 4 words on the stack are used for values passed in core
- * registers. */
- regp = stack;
diff --git a/Modules/_ctypes/libffi/ChangeLog b/Modules/_ctypes/libffi/ChangeLog
deleted file mode 100644
index c85cbe621a..0000000000
--- a/Modules/_ctypes/libffi/ChangeLog
+++ /dev/null
@@ -1,5105 +0,0 @@
-commit 0403f332b1f478696c30d3d8a0e2f6eef24aaf88
-Author: Anthony Green <green@moxielogic.com>
-Date: Mon May 19 09:41:32 2014 -0400
-
- Update date. Annoucing 3.1 today.
-
-commit 94ac0c168ee7b115409121d88b25a4979446c8da
-Author: Anthony Green <green@moxielogic.com>
-Date: Mon May 19 09:37:21 2014 -0400
-
- Increment libtool library revision number
-
-commit 57465744b6e1295d7202de5a7734df589518f1c8
-Author: Anthony Green <green@moxielogic.com>
-Date: Sun May 11 10:30:22 2014 -0400
-
- Update to version 3.1
-
-commit 0c2251a42df5108b6d9ebe5fe1cf83d0bcdf660e
-Author: Anthony Green <green@moxielogic.com>
-Date: Sun May 11 10:22:30 2014 -0400
-
- Support versions of git older than 1.8.5
-
-commit 70c303cb88e23aaee91c87c56b108c50ab4f3c2f
-Author: Anthony Green <green@moxielogic.com>
-Date: Sun May 11 09:56:40 2014 -0400
-
- Fix testsuite for GCC 4.9.0
-
-commit 52b3457093ed19b2a7c5fcf243c4014c90ce6225
-Author: Magnus Granberg <zorry@gentoo.org>
-Date: Sun May 11 09:55:28 2014 -0400
-
- Check /proc/self/status for PaX status.
-
-commit 7ba4c5d72aa440a4b21fb57e999e67c5957761da
-Author: Dominik Vogt <dominik.vogt@gmx.de>
-Date: Sun May 11 09:52:47 2014 -0400
-
- Use to get correct dir
-
-commit 31e0d4ecff6dc2a6c75a066ee099b52a43f6ba27
-Merge: 1c0e9a7 99909eb
-Author: Anthony Green <green@moxielogic.com>
-Date: Wed Apr 23 19:24:47 2014 -0400
-
- Merge pull request #119 from joshtriplett/fastcall-fastball
-
- src/x86/win32.S: Define ffi_closure_FASTCALL in the MASM section, too
-
-commit 99909eb6184b62408d88b6b4e7ab38e84e6d0bf3
-Author: Josh Triplett <josh@joshtriplett.org>
-Date: Tue Apr 22 21:17:52 2014 -0700
-
- src/x86/win32.S: Define ffi_closure_FASTCALL in the MASM section, too
-
-commit 1c0e9a7297ced15413c2d2d5d35f6c650c4b46c9
-Merge: 93a24f2 d369522
-Author: Anthony Green <green@moxielogic.com>
-Date: Mon Apr 21 12:41:56 2014 -0400
-
- Merge pull request #101 from joshtriplett/fastcall-closures
-
- Support closures for fastcall
-
-commit d36952273d4fafbda91ecc205fc0824f7cc65e70
-Author: Josh Triplett <josh@joshtriplett.org>
-Date: Sun Apr 20 12:03:25 2014 -0700
-
- Support fastcall closures
-
- libffi on 32-bit x86 now supports closures for all supported ABIs.
- Thus, rewrite the last remaining duplicated-by-ABI test (closure_stdcall
- and closure_thiscall) to use the generic ABI_NUM/ABI_ATTR mechanism.
-
-commit 93a24f216bcdd1018b976d697179c6d49004015a
-Merge: dd11a04 2349fec
-Author: Anthony Green <green@moxielogic.com>
-Date: Sat Apr 12 19:38:07 2014 -0400
-
- Merge pull request #80 from ueno/devel
-
- Fix typo in doc
-
-commit dd11a04061cb49ce1d702545693c24eb1267d648
-Merge: 8fa2812 03ca880
-Author: Anthony Green <green@moxielogic.com>
-Date: Sat Apr 12 19:37:21 2014 -0400
-
- Merge pull request #86 from joshtriplett/testsuite-CC-CXX
-
- testsuite ignores CC parameter supplied to configure or make
-
-commit 8fa2812355e685a42abf9a62fbc674d616b2edee
-Merge: 8a58e6b 419503f
-Author: Anthony Green <green@moxielogic.com>
-Date: Sat Apr 12 19:32:08 2014 -0400
-
- Merge pull request #116 from frida/fix/darwin-aarch64-variadic
-
- Fix handling of variadic calls on Darwin/AArch64
-
-commit 8a58e6b7805b736def197b8baf8e465a2a3f6913
-Merge: 30b77c5 a539f7f
-Author: Anthony Green <green@moxielogic.com>
-Date: Sat Apr 12 19:30:18 2014 -0400
-
- Merge pull request #115 from frida/fix/darwin-aarch64-alignment
-
- Fix alignment of AArch64 assembler functions
-
-commit 30b77c56f95c63ecd83399aafdbad7b07330f2fd
-Merge: dc33cb3 3e2b84d
-Author: Anthony Green <green@moxielogic.com>
-Date: Sat Apr 12 19:29:13 2014 -0400
-
- Merge pull request #117 from frida/fix/windows-regression
-
- Fix Windows regression
-
-commit 3e2b84d295531720917bf46afc532fc6d877e3ec
-Author: Ole André Vadla Ravnås <ole.andre.ravnas@tillitech.com>
-Date: Sat Apr 12 01:04:04 2014 +0200
-
- Fix Windows regression
-
- Introduced by b5fed601948237037513a9b7f967c8fc6c9ff1f6.
-
-commit 419503f409c321fe31ff59d963ef34bb913420d0
-Author: Ole André Vadla Ravnås <ole.andre.ravnas@tillitech.com>
-Date: Sun Apr 6 20:54:13 2014 +0200
-
- Fix handling of variadic calls on Darwin/AArch64
-
-commit a539f7ffd6783aa11353d13265520e453c565fb4
-Author: Ole André Vadla Ravnås <ole.andre.ravnas@tillitech.com>
-Date: Sun Apr 6 20:53:02 2014 +0200
-
- Fix alignment of AArch64 assembler functions
-
-commit dc33cb3c998da521a960385c1269c3aef552f69f
-Merge: c860a99 b5fed60
-Author: Anthony Green <green@moxielogic.com>
-Date: Sat Apr 5 23:41:22 2014 -0400
-
- Merge pull request #114 from joshtriplett/bounce-on-a-tiny-trampoline
-
- Fix ABI on 32-bit non-Windows x86: go back to trampoline size 10
-
-commit b5fed601948237037513a9b7f967c8fc6c9ff1f6
-Author: Josh Triplett <josh@joshtriplett.org>
-Date: Sat Apr 5 17:33:42 2014 -0700
-
- Fix ABI on 32-bit non-Windows x86: go back to trampoline size 10
-
- The trampoline size is part of the ABI, so it cannot change. Move the
- logic from the stdcall and thiscall trampolines to the functions they
- call, to reduce them both to 10 bytes.
-
- This drops the previously added support for raw THISCALL closures on
- non-Windows. (Non-raw THISCALL closures still work.)
-
-commit 03ca880081b22efab09ba72268270f83017d3d7b
-Author: Josh Triplett <josh@joshtriplett.org>
-Date: Thu Mar 27 08:44:34 2014 -0700
-
- README: Note the testsuite changes to respect $CC and $CXX
-
-commit d74df8c5d8c6722ecb908da98c86cc8e2c755b84
-Author: Josh Triplett <josh@joshtriplett.org>
-Date: Thu Mar 27 00:44:12 2014 -0700
-
- README: Update Windows example to set both CC and CXX
-
-commit 7d698125b1f05173f3656a89755a2eb58813b002
-Author: Josh Triplett <josh@joshtriplett.org>
-Date: Wed Mar 26 23:17:56 2014 -0700
-
- Use the proper C++ compiler to run C++ tests
-
- Running the C compiler with -shared-libgcc -lstdc++ does not work on
- non-GCC compilers.
-
-commit fa5e88f170cb37c7b2b9bb015c8c5b854ffd8a3e
-Author: Josh Triplett <josh@joshtriplett.org>
-Date: Wed Mar 26 23:53:57 2014 -0700
-
- .travis.yml: Make the build command more readable by splitting at &&
-
- "script" can contain multiple commands to run in sequence.
-
-commit 0c3824702d3d59d37f8c177d646303f546187683
-Author: Josh Triplett <josh@joshtriplett.org>
-Date: Wed Mar 26 14:51:32 2014 -0700
-
- Always set CC_FOR_TARGET for dejagnu, to make the testsuite respect $CC
-
- This fixes cross-compilation and compilation with CC="gcc -m32".
-
-commit 9946a92af31b30cb7760150d1f8ca6c11b01aeea
-Author: Josh Triplett <josh@joshtriplett.org>
-Date: Wed Mar 26 20:18:58 2014 -0700
-
- Stop looking for expect and runtest above top_builddir
-
- Users wishing to test hand-compiled versions of expect and runtest can
- easily enough put them in their path or set EXPECT and RUNTEST
- themselves.
-
-commit acb202325215058639234efb7af1f04c1c8a1f44
-Author: Josh Triplett <josh@joshtriplett.org>
-Date: Wed Mar 26 20:18:41 2014 -0700
-
- Stop setting an empty AM_RUNTESTFLAGS
-
-commit c860a992fef5d7cd7bb0975b1632d17a9fafe007
-Author: Anthony Green <green@moxielogic.com>
-Date: Tue Mar 25 17:02:51 2014 -0400
-
- Upgrade version to 3.1-rc1
-
-commit 9837073e6203048a162a226798c5d252600219ed
-Author: Anthony Green <green@moxielogic.com>
-Date: Tue Mar 25 16:24:14 2014 -0400
-
- Update copyright date and clean up README notes.
-
-commit 18d3baa9f597b026675baa1b4e5a5eeef7577a08
-Merge: afee537 f0c8a31
-Author: Anthony Green <green@moxielogic.com>
-Date: Tue Mar 25 16:12:53 2014 -0400
-
- Merge pull request #108 from joshtriplett/freebsd
-
- [3.1 blocker] Fix FreeBSD support
-
-commit afee53738a995e23bd2f89fd0f7b30b380566106
-Merge: 7d24785 b2d610e
-Author: Anthony Green <green@moxielogic.com>
-Date: Tue Mar 25 16:12:35 2014 -0400
-
- Merge pull request #106 from joshtriplett/darwin-award
-
- [3.1 blocker] Update OS X build system to include win32.S on 32-bit
-
-commit 7d2478568ed9f03cbf57627f449a2d2cf4d1571c
-Merge: beab5f3 56be47f
-Author: Anthony Green <green@moxielogic.com>
-Date: Tue Mar 25 16:12:17 2014 -0400
-
- Merge pull request #110 from joshtriplett/w64
-
- Fix 64-bit Windows support
-
-commit beab5f334d9ec5b8b91d1cc727d1029b40358e7e
-Merge: 28fb197 ef5890e
-Author: Anthony Green <green@moxielogic.com>
-Date: Tue Mar 25 16:07:47 2014 -0400
-
- Merge pull request #105 from joshtriplett/win32-relocations
-
- [3.1 blocker] win32.S needs to handle relocations/GOT
-
-commit f0c8a31577172104049283f0a80c723084a5bd77
-Author: Josh Triplett <josh@joshtriplett.org>
-Date: Mon Mar 24 22:14:26 2014 -0700
-
- Compile win32.S on FreeBSD
-
-commit b2d610e028b5ce48d1ad7e5d0debc9c321d891b2
-Author: Josh Triplett <josh@joshtriplett.org>
-Date: Fri Mar 21 11:10:13 2014 -0700
-
- Compile win32.S on 32-bit Darwin as well
-
-commit be50b87a490e794362cb4a27ada2fbaab202adb8
-Author: Josh Triplett <josh@joshtriplett.org>
-Date: Mon Mar 24 21:44:13 2014 -0700
-
- Always use configure to detect whether global symbols need underscores
-
- 64-bit Windows already used this check; make it universal, and use it in
- place of an ifdef on X86_WIN32, to handle non-Windows platforms that use
- the underscore, such as Darwin.
-
-commit 56be47f87629e31afbcb0774aa65735f539ee972
-Author: Josh Triplett <josh@joshtriplett.org>
-Date: Mon Mar 24 21:24:53 2014 -0700
-
- Fix a warning on 64-bit Windows
-
- When sizeof(size_t) != sizeof(unsigned), adding a size_t to cif->bytes
- produces a "possible loss of data" warning. However, the size_t in
- question refers to the size of a single parameter. Use a cast to avoid
- the warning.
-
-commit 48a8eda74aad8a21b6f26df5df08fe64c043d208
-Author: Josh Triplett <josh@joshtriplett.org>
-Date: Mon Mar 24 21:21:12 2014 -0700
-
- Avoid referencing undefined ABIs on 64-bit Windows builds
-
- 64-bit Windows does not have FFI_STDCALL, FFI_THISCALL, or FFI_FASTCALL.
-
-commit f0f4138f90345d7d67dfa6783a7e1c7cc30d3c6f
-Author: Josh Triplett <josh@joshtriplett.org>
-Date: Sat Mar 22 10:00:53 2014 -0700
-
- win32.S: Add handling for position-independent code on Darwin
-
- Newer versions of Darwin generate the necessary stub functions
- automatically and just need a call instruction, but accomodating older
- versions as well requires adding the stub.
-
-commit ef5890ebafb7cd2fbf9acf161edb55fe1382871c
-Author: Josh Triplett <josh@joshtriplett.org>
-Date: Fri Mar 21 11:01:39 2014 -0700
-
- win32.S: Use shifting for multiplication rather than repeated addition
-
- The jump table code added a register to itself twice to multiply by 4;
- shift the register left by 2 instead.
-
-commit 4fca48901e7e4f53bf490ed22607b2d2d8f4bfcc
-Author: Josh Triplett <josh@joshtriplett.org>
-Date: Fri Mar 21 11:00:41 2014 -0700
-
- win32.S: Make the jump tables position-independent
-
- Now that non-Windows platforms include win32.S, it needs to support
- building as position-independent code. This fixes build failures on
- target platforms that do not allow text relocations.
-
-commit 2087dcf736274286f76c69d3988fb6d7cc4fd0f5
-Author: Josh Triplett <josh@joshtriplett.org>
-Date: Fri Mar 21 10:57:06 2014 -0700
-
- win32.S: Make calls to ffi_closure_SYSV_inner position-independent
-
- Now that non-Windows platforms include win32.S, it needs to support
- building as position-independent code. This fixes one source of build
- failures on target platforms that do not allow text relocations.
-
-commit 28fb197079cf1d11da4eef7c8c243ab05590c528
-Merge: c697472 c3dd0a1
-Author: Anthony Green <green@moxielogic.com>
-Date: Tue Mar 18 12:19:36 2014 -0400
-
- Merge pull request #107 from rvandermeulen/msvcc
-
- Various compatibility fixes and improvements to msvcc.sh.
-
-commit c3dd0a1a0245fc174361a70876e88ae24285f861
-Author: Ryan VanderMeulen <ryanvm@gmail.com>
-Date: Tue Mar 18 12:09:45 2014 -0400
-
- Various compatibility fixes and improvements to msvcc.sh.
-
- * Don't try to mix incompatible optimization flags in debug builds.
- * Workaround ax_cc_maxopt.m4 not supporting MSVC and change -O3 to -O2.
- * Fix MSVC warning by properly passing linker flags to compiler.
- * Make msvcc.sh return 1 if invalid command line options are used rather than silently eating them.
- * Add more comments.
-
-commit c697472fccfbb5b87b007c053cda9ef014b346b9
-Merge: 83fd2bc e48918e
-Author: Anthony Green <green@moxielogic.com>
-Date: Mon Mar 17 00:32:42 2014 -0400
-
- Merge pull request #102 from joshtriplett/test-generic
-
- Add ABIs to the test matrix; unify many bits of the testsuite
-
-commit e48918ecf876bc85d040fc50a232059c566553a8
-Author: Josh Triplett <josh@joshtriplett.org>
-Date: Sun Mar 16 20:29:27 2014 -0700
-
- testsuite: Add ABIs to the test matrix; unify tests across ABIs
-
- This eliminates all the *_win32.c tests in favor of the tests they were
- branched from, and expands test coverage to run many more tests on
- stdcall, thiscall, and fastcall.
-
- This same mechanism also supports testing any other target that has
- multiple ABIs.
-
-commit 4d4d368e5a55d9443c4c53b1b70d58ab6d8c941c
-Author: Josh Triplett <josh@joshtriplett.org>
-Date: Sun Mar 16 17:02:05 2014 -0700
-
- testsuite: Replace ffitestcxx.h with ffitest.h
-
- ffitest.h contains a superset of the functionality of ffitestcxx.h;
- make the C++ tests include ffitest.h instead, and remove ffitestcxx.h.
-
-commit 3f97cf3413c46caf2a79f32ac9cda4620972c2d7
-Author: Josh Triplett <josh@joshtriplett.org>
-Date: Sun Mar 16 16:53:42 2014 -0700
-
- testsuite: Unify the C and C++ testsuites
-
- These two testsuites differ only in the source file glob and a couple of
- additional compiler options; unify the remaining bits.
-
-commit 0d9cce8edb937bbe771a6cdd25f671edf06d2128
-Author: Josh Triplett <josh@joshtriplett.org>
-Date: Sun Mar 16 16:22:58 2014 -0700
-
- testsuite: ffitest.h: Parenthesize the CHECK macro
-
-commit 5695ec1444c5323e48fe4314f8c8f027625e67df
-Author: Josh Triplett <josh@joshtriplett.org>
-Date: Sun Mar 16 16:04:58 2014 -0700
-
- testsuite: Factor out a function to run a matrix of tests
-
- This commons up code from libffi.call/call.exp and
- libffi.special/special.exp, unifies the optimization option matrix
- between the two, and makes it easier to add more axes to the matrix
- in the future.
-
-commit dfdb02cc869855d3b68571e5f7aa77ae8c9d254a
-Author: Josh Triplett <josh@joshtriplett.org>
-Date: Sun Mar 16 15:26:26 2014 -0700
-
- testsuite: Introduce a __THISCALL__ compiler-specific macro
-
-commit 83fd2bce0456224483435d4b764063f4513fd464
-Merge: 3658a07 06ff924
-Author: Anthony Green <green@moxielogic.com>
-Date: Sun Mar 16 22:03:29 2014 -0400
-
- Merge pull request #99 from joshtriplett/gitignore
-
- .gitignore: Ignore more generated files
-
-commit 3658a0700a50d37a2fdba04fd9d79ad2f706d9f5
-Merge: d948d0a 46c5d3c
-Author: Anthony Green <green@moxielogic.com>
-Date: Sun Mar 16 21:37:42 2014 -0400
-
- Merge pull request #100 from rvandermeulen/bug-756740
-
- Change double quotes in Makefile.am to single quotes.
-
-commit 46c5d3c30fdc2b43c076ad955078d7c5f1e75b37
-Author: Ryan VanderMeulen <ryanvm@gmail.com>
-Date: Sun Mar 16 21:16:08 2014 -0400
-
- Change double quotes in Makefile.am to single quotes.
-
- This was originally done in PR #84, except the change was made to Makefile.in instead of Makefile.am and was therefore reverted the next time the files were regenerated.
-
-commit 06ff924215a2f9739efa2c059dc595bc4ec1c851
-Author: Josh Triplett <josh@joshtriplett.org>
-Date: Sun Mar 16 16:19:46 2014 -0700
-
- .gitignore: Ignore more generated files
-
- The build process generates doc/libffi.info and fficonfig.h.in, so add
- them to .gitignore.
-
-commit bad8948346e9b8813023a0cc78a3b6eb8d9c14c6
-Author: Josh Triplett <josh@joshtriplett.org>
-Date: Sun Mar 16 15:16:18 2014 -0700
-
- testsuite: Introduce a __STDCALL__ compiler-specific macro
-
- Several tests want to use stdcall, which differs in syntax by compiler,
- so introduce a macro for it in ffitest.h.
-
-commit 98a793fa36a4ab3ba24d059cb80a2891cdb940e1
-Author: Josh Triplett <josh@joshtriplett.org>
-Date: Sun Mar 16 15:20:36 2014 -0700
-
- testsuite: Common up the ifdef blocks for compiler-specific macros
-
-commit d948d0a729c934b0224749338a3ba0a2c8f51c45
-Merge: b61b472 a86bd31
-Author: Anthony Green <green@moxielogic.com>
-Date: Sun Mar 16 10:53:48 2014 -0400
-
- Merge pull request #98 from joshtriplett/unconfigure.host
-
- Merge configure.host into configure.ac
-
-commit a86bd318e2424d879d784ee7b29d6536d7a17c18
-Author: Josh Triplett <josh@joshtriplett.org>
-Date: Sun Mar 16 06:58:59 2014 -0700
-
- Merge configure.host into configure.ac
-
- configure.host only has a single entry, and shows no signs of needing
- more added.
-
-commit b61b472bd0647006d6685238721002017f1d119c
-Author: Anthony Green <green@moxielogic.com>
-Date: Sun Mar 16 09:45:55 2014 -0400
-
- Update version to 3.1-rc0. Clean up README.
-
-commit 7a64e7dbba54e6e9f69954adfb943be1856ff928
-Merge: 11a5c5c eef2e02
-Author: Anthony Green <green@moxielogic.com>
-Date: Sun Mar 16 09:39:08 2014 -0400
-
- Merge pull request #97 from joshtriplett/remove-more-generated-files
-
- Remove more generated files
-
-commit 11a5c5c39f5861011f6c5ddf795da3a32b5f0082
-Merge: 9a62a21 1c68c07
-Author: Anthony Green <green@moxielogic.com>
-Date: Sun Mar 16 09:38:47 2014 -0400
-
- Merge pull request #96 from joshtriplett/sawing-changelogs
-
- Generate ChangeLog from git in make dist; remove it from version control
-
-commit eef2e02a13d7d1c8145d47a64467f654406a3548
-Author: Josh Triplett <josh@joshtriplett.org>
-Date: Sun Mar 16 06:26:03 2014 -0700
-
- doc: Remove autogenerated info file and stamp
-
-commit 9fb403d3c5d9643e0f561cab6d4a07b1e54907ff
-Author: Josh Triplett <josh@joshtriplett.org>
-Date: Sun Mar 16 06:25:52 2014 -0700
-
- fficonfig.h.in: Remove, configure generates it
-
-commit 1c68c07217fda78a779778c1480fedef7a58d5b4
-Author: Josh Triplett <josh@joshtriplett.org>
-Date: Sun Mar 16 06:11:58 2014 -0700
-
- Generate ChangeLog from git in make dist
-
- Archive the existing ChangeLog to ChangeLog.libffi-3.1
-
-commit c65ed55e655711e008282edbdd82ce95d008b4f6
-Author: Josh Triplett <josh@joshtriplett.org>
-Date: Sun Mar 16 05:52:00 2014 -0700
-
- ChangeLog.v1: Fix typo in explanatory header.
-
-commit 9a62a21f5c3a8e1da463229f3170c8ab3031d920
-Author: Anthony Green <green@moxielogic.com>
-Date: Sun Mar 16 09:03:57 2014 -0400
-
- Add missing ChangeLog entry. Clean up some entries.
-
-commit 9bc704c58cb7a049d867837e3a11e2e31886ec66
-Merge: 694447a e892e58
-Author: Anthony Green <green@moxielogic.com>
-Date: Sun Mar 16 08:41:00 2014 -0400
-
- Merge pull request #95 from joshtriplett/news
-
- README: Update news for 3.0.14
-
-commit e892e581d1838a06c18c7ecd50ebd79915cff92b
-Author: Josh Triplett <josh@joshtriplett.org>
-Date: Sun Mar 16 05:38:24 2014 -0700
-
- README: Update news for 3.0.14
-
-commit 694447aa29deadd571efb4e9a26ee3f68ede1493
-Merge: fdc87f3 45a6c21
-Author: Anthony Green <green@moxielogic.com>
-Date: Sun Mar 16 08:32:05 2014 -0400
-
- Merge pull request #93 from joshtriplett/travis-dist
-
- Make Travis check "make dist"
-
-commit 45a6c21efa944b520842e631dc54919b04884744
-Author: Josh Triplett <josh@joshtriplett.org>
-Date: Sun Mar 16 05:29:08 2014 -0700
-
- .travis.yml: Test "make dist" too.
-
-commit fdc87f3b2ea37b58a4a9ae6c35083f544909fe3c
-Merge: 7412b83 e1911f7
-Author: Anthony Green <green@moxielogic.com>
-Date: Sun Mar 16 08:05:51 2014 -0400
-
- Merge pull request #85 from joshtriplett/stdcall
-
- stdcall support on Linux
-
-commit e1911f78df113ca58738b66089a070d4cf747de7
-Author: Josh Triplett <josh@joshtriplett.org>
-Date: Sun Mar 16 03:25:53 2014 -0700
-
- Add support for stdcall, thiscall, and fastcall on non-Windows x86-32
-
- Linux supports the stdcall calling convention, either via functions
- explicitly declared with the stdcall attribute, or via code compiled
- with -mrtd which effectively makes stdcall the default.
-
- This introduces FFI_STDCALL, FFI_THISCALL, and FFI_FASTCALL on
- non-Windows x86-32 platforms, as non-default calling conventions.
-
-commit 7412b838d543aae4fa925862bd5702d3dacbc29a
-Merge: c0cc5fd 9531d05
-Author: Anthony Green <green@moxielogic.com>
-Date: Sun Mar 16 07:58:16 2014 -0400
-
- Merge pull request #90 from joshtriplett/win32-unifdef
-
- prep_cif.c: Remove unnecessary ifdef for X86_WIN32
-
-commit c0cc5fdaa237b67e86f22d2f6e13f3b42d9aae33
-Merge: 98b5296 b3a5da0
-Author: Anthony Green <green@moxielogic.com>
-Date: Sun Mar 16 07:57:59 2014 -0400
-
- Merge pull request #89 from joshtriplett/travis32
-
- .travis.yml: Test on both 32-bit and 64-bit
-
-commit 9531d05f64c2a674e0197158ffad68d69f177bd0
-Author: Josh Triplett <josh@joshtriplett.org>
-Date: Sun Mar 16 01:50:02 2014 -0700
-
- prep_cif.c: Remove unnecessary ifdef for X86_WIN32
-
- ffi_prep_cif_core had a special case for X86_WIN32, checking for
- FFI_THISCALL in addition to the FFI_FIRST_ABI-to-FFI_LAST_ABI range
- before returning FFI_BAD_ABI. However, on X86_WIN32, FFI_THISCALL
- already falls in that range, making the special case unnecessary.
- Remove it.
-
-commit b3a5da068abd2f2983d9e67adbf41b0e0f34e37f
-Author: Josh Triplett <josh@joshtriplett.org>
-Date: Sat Mar 15 23:27:56 2014 -0700
-
- .travis.yml: Test on both 32-bit and 64-bit
-
-commit 98b52960485a261399f081915f36063de3854a5f
-Merge: 134ce4c f6dd184
-Author: Anthony Green <green@moxielogic.com>
-Date: Sun Mar 16 07:51:33 2014 -0400
-
- Merge pull request #94 from joshtriplett/esp-extra-stackery-perception
-
- ChangeLog: Document testsuite changes to remove fragile stack pointer checks
-
-commit f6dd1845434dd53e22129becdfa092c082df307c
-Author: Josh Triplett <josh@joshtriplett.org>
-Date: Sun Mar 16 04:49:36 2014 -0700
-
- ChangeLog: Document testsuite changes to remove fragile stack pointer checks
-
-commit 134ce4c0266bf994f07518fc534de53f1d3c8de8
-Merge: 2680e9e 9c27932
-Author: Anthony Green <green@moxielogic.com>
-Date: Sun Mar 16 07:47:17 2014 -0400
-
- Merge pull request #91 from joshtriplett/esp-extra-stackery-perception
-
- testsuite: Remove fragile stack pointer checks
-
-commit 9c279328ee12fc869adff63ca81f1230977bd42b
-Author: Josh Triplett <josh@joshtriplett.org>
-Date: Sun Mar 16 02:31:19 2014 -0700
-
- testsuite: Remove fragile stack pointer checks
-
- testsuite/libffi.call/closure_stdcall.c and
- testsuite/libffi.call/closure_thiscall.c include inline assembly to save
- the stack pointer before and after the call, and compare the values.
- However, compilers can and do leave the stack in different states for
- these two pieces of inline assembly, such as by saving a temporary value
- on the stack across the call; observed with gcc -Os, and verified as
- spurious through careful inspection of disassembly.
-
-commit 2680e9ea9b4c87ea8042a61e551bd667493d4bd3
-Merge: 071eab3 82f8cb2
-Author: Anthony Green <green@moxielogic.com>
-Date: Sun Mar 16 07:44:08 2014 -0400
-
- Merge pull request #88 from joshtriplett/such-precision-many-fail-wow
-
- testsuite/libffi.call/many.c: Avoid spurious failure due to excess precision
-
-commit 82f8cb24a1d976db35ae31a4b86cec8926da327d
-Author: Josh Triplett <josh@joshtriplett.org>
-Date: Sun Mar 16 04:27:32 2014 -0700
-
- ChangeLog: Document many.c and many_win32.c changes to avoid spurious failures
-
-commit 88d562a8b5912e99306063fe3bc289bab6ca6ebe
-Author: Josh Triplett <josh@joshtriplett.org>
-Date: Sat Mar 15 22:08:19 2014 -0700
-
- testsuite/libffi.call/many_win32.c: Avoid spurious failure due to excess precision
-
- The test case testsuite/libffi.call/many_win32.c can spuriously fail due
- to excess floating-point precision. Instrumenting it with some printf
- calls shows differences well above FLT_EPSILON. (Note when
- instrumenting it that multiple computations of the difference, such as
- one in a print and another in the conditional, may produce different
- results.)
-
- Rather than complicating the test suite with architecture-specific flags
- to avoid excess precision, just simplify the floating-point computation
- to avoid a dependency on potential excess precision.
-
-commit c00a49ecd165b2d06c1c9b249d212dc843fa116f
-Author: Josh Triplett <josh@joshtriplett.org>
-Date: Sat Mar 15 22:08:19 2014 -0700
-
- testsuite/libffi.call/many.c: Avoid spurious failure due to excess precision
-
- The test case testsuite/libffi.call/many.c can spuriously fail due to
- excess floating-point precision. Instrumenting it with some printf
- calls shows differences well above FLT_EPSILON. (Note when
- instrumenting it that multiple computations of the difference, such as
- one in a print and another in the conditional, may produce different
- results.)
-
- Rather than complicating the test suite with architecture-specific flags
- to avoid excess precision, just simplify the floating-point computation
- to avoid a dependency on potential excess precision.
-
-commit 071eab32a7f9fbbef46c0d8f37d9985bc9cceb37
-Merge: 2228c7a 2f44952
-Author: Anthony Green <green@moxielogic.com>
-Date: Sun Mar 16 07:36:52 2014 -0400
-
- Merge pull request #92 from joshtriplett/autogen
-
- Re-add libtool-ldflags
-
-commit 2f44952c95765c1486fad66f57235f8d459a9748
-Author: Josh Triplett <josh@joshtriplett.org>
-Date: Sun Mar 16 04:35:12 2014 -0700
-
- Re-add libtool-ldflags
-
-commit 2228c7ab190f3c529b9018495467b841fa21cba2
-Merge: 76d19d0 35634db
-Author: Anthony Green <green@moxielogic.com>
-Date: Sun Mar 16 07:25:18 2014 -0400
-
- Merge pull request #87 from joshtriplett/autogen
-
- Remove autogenerated files from the repository
-
-commit 35634dbceaac0a1544f7385addc01d21ef1ef6a8
-Author: Josh Triplett <josh@joshtriplett.org>
-Date: Sat Mar 15 18:11:16 2014 -0700
-
- Remove autogenerated files from the repository
-
- Add an autogen.sh to regenerate them.
-
-commit 76d19d004e36e99d261ee78261e2f52cea5e4ab1
-Merge: c86d9b6 a1a6f71
-Author: Anthony Green <green@moxielogic.com>
-Date: Fri Mar 14 16:54:31 2014 -0400
-
- Ensure the linker supports @unwind sections in libffi.
-
-commit c86d9b6cc6e16ee262844a33b40441374400758c
-Merge: 4efb7db f8cdf11
-Author: Anthony Green <green@moxielogic.com>
-Date: Fri Mar 14 16:51:20 2014 -0400
-
- Fix merge
-
-commit 4efb7dbfd9427c478a948cd0d464210123db8de8
-Merge: 634a475 18eb81d
-Author: Anthony Green <green@moxielogic.com>
-Date: Fri Mar 14 16:47:57 2014 -0400
-
- Merge pull request #81 from rvandermeulen/bug-756740
-
- Allow building for mipsel with Android NDK r8.
-
-commit a1a6f71bfe4199293043b2e4cfb4c8d3cb1112f9
-Author: Ryan VanderMeulen <ryanvm@gmail.com>
-Date: Mon Mar 10 15:12:47 2014 -0400
-
- Remove stray hunk that shouldn't have been included in this patch.
-
-commit f8cdf11467181f2a9a6b7e748167569aa58e3a81
-Author: Ryan VanderMeulen <ryanvm@gmail.com>
-Date: Mon Mar 10 15:04:58 2014 -0400
-
- Replace double quotes with single quotes in Makefile.in to improve compatibility between some versions of MSYS and gmake. From Mozilla bug 943728.
- https://bugzilla.mozilla.org/show_bug.cgi?id=943728
-
-commit dfa3738732e1bc3a7f4130395ae4bab55fcebb99
-Author: Ryan VanderMeulen <ryanvm@gmail.com>
-Date: Mon Mar 10 14:53:48 2014 -0400
-
- Ensure the linker supports @unwind sections in libffi. From Mozilla bug 756740.
- https://bugzilla.mozilla.org/show_bug.cgi?id=778414
-
- Also tracked as issue #42.
- https://github.com/atgreen/libffi/issues/42
-
-commit 18eb81d032f29d645d0498ba92bddfd651f009ae
-Author: Ryan VanderMeulen <ryanvm@gmail.com>
-Date: Mon Mar 10 14:43:37 2014 -0400
-
- Allow building for mipsel with Android NDK r8. From Mozilla bug 756740.
- https://bugzilla.mozilla.org/show_bug.cgi?id=756740
-
-commit 2349fec9a818fb52fd2f294bcbc7b3156cd113de
-Author: Daiki Ueno <ueno@gnu.org>
-Date: Wed Mar 5 17:53:02 2014 +0900
-
- Fix typo in doc
-
-commit 634a475eaf1bee31c09f7d519e31c13b64cd24df
-Author: Anthony Green <green@moxielogic.com>
-Date: Sat Mar 1 18:37:29 2014 -0500
-
- Update Makefile for new darwin scripts
-
-commit c7b67e874bb89859f9a07d1cf9606052b6c0dcc1
-Author: Anthony Green <green@moxielogic.com>
-Date: Sat Mar 1 18:34:18 2014 -0500
-
- Add README note
-
-commit a04e30ba3dc303133d459c1ac273ceefe4d49b32
-Author: Anthony Green <green@moxielogic.com>
-Date: Fri Feb 28 17:20:59 2014 -0500
-
- Add missing -DFFI_DEBUG flag
-
-commit 934dc1b5c8d6a9e727bedc72342831eb7d62c35f
-Merge: 11d7aa9 67fbef3
-Author: Anthony Green <green@moxielogic.com>
-Date: Fri Feb 28 01:10:17 2014 -0500
-
- Merge branch 'master' of github.com:/atgreen/libffi
-
-commit 11d7aa9d7a4bbe642944edc0f07cf96db9b270b6
-Merge: b40aeda 3b44d41
-Author: Anthony Green <green@moxielogic.com>
-Date: Fri Feb 28 01:06:48 2014 -0500
-
- Merge pull request #46 from makotokato/android-clang
-
- Fix build failure when using clang for Android
-
-commit 67fbef3b56ff0ef88f9b1a7fe48cb77222fa6cec
-Merge: b40aeda 3b44d41
-Author: Anthony Green <green@moxielogic.com>
-Date: Fri Feb 28 01:06:48 2014 -0500
-
- Merge pull request #46 from makotokato/android-clang
-
- Fix build failure when using clang for Android
-
-commit b40aeda31a74d95a37c723b6243aabac466e67c4
-Merge: 20698ab 53ceaf1
-Author: Anthony Green <green@moxielogic.com>
-Date: Fri Feb 28 01:01:29 2014 -0500
-
- Merge branch 'master' of github.com:/atgreen/libffi
-
-commit 53ceaf14c5eeb16ba09745f0ca87cca367d41a90
-Merge: 860fe66 cc9b518
-Author: Anthony Green <green@moxielogic.com>
-Date: Fri Feb 28 01:01:02 2014 -0500
-
- Merge pull request #40 from wojdyr/master
-
- Correct the -L flag in libffi.pc.in
-
-commit 20698abc6a00092fd7fd3e434a3a29dc0f048f1e
-Merge: 64bd069 1a0b01e
-Author: Anthony Green <green@moxielogic.com>
-Date: Fri Feb 28 00:56:27 2014 -0500
-
- Merge pull request #66 from ppizarro/master
-
- BlackFin fixes - Fatal error when calling a function defined in a shared library from within the function called by FFI
-
-commit 860fe6646f5ae603e99a8d1d722ddddba8b75769
-Merge: 64bd069 1a0b01e
-Author: Anthony Green <green@moxielogic.com>
-Date: Fri Feb 28 00:56:27 2014 -0500
-
- Merge pull request #66 from ppizarro/master
-
- BlackFin fixes - Fatal error when calling a function defined in a shared library from within the function called by FFI
-
-commit 64bd06990a7accf72271516a2110b86cdccd8df4
-Author: Anthony Green <green@moxielogic.com>
-Date: Fri Feb 28 00:52:56 2014 -0500
-
- Add ChangeLog entry for Josh's change
-
-commit edf29c5169b06fcfc241445e152e325bc3c50e0e
-Merge: 33c9954 3998d26
-Author: Anthony Green <green@moxielogic.com>
-Date: Fri Feb 28 00:50:25 2014 -0500
-
- Merge pull request #75 from joshtriplett/longdouble
-
- Fix build error on x86 without distinct long double
-
-commit 33c9954f2eec539011a0f93270aaf013318837ae
-Author: Anthony Green <green@moxielogic.com>
-Date: Fri Feb 28 00:38:41 2014 -0500
-
- Rebuilt with new libtool
-
-commit 926b6989fbd08488b9105943293353d45ac527e0
-Merge: 5a88c85 cc82051
-Author: Anthony Green <green@moxielogic.com>
-Date: Fri Feb 28 00:26:57 2014 -0500
-
- Merge branch 'master' of github.com:/atgreen/libffi
-
- Conflicts:
- ChangeLog
-
-commit 5a88c85fde304052bed1581ed0b6452ac2c68838
-Author: Anthony Green <green@moxielogic.com>
-Date: Fri Feb 28 00:23:04 2014 -0500
-
- Fix spelling errors
-
-commit cc82051c7e80cea772c4b72da026eb7e68d598fc
-Author: Anthony Green <green@moxielogic.com>
-Date: Fri Feb 28 00:23:04 2014 -0500
-
- Fix spelling errors
-
-commit 001aaf4b1b56349596bb6f6b5c1613dcbbd84ea8
-Author: Anthony Green <green@moxielogic.com>
-Date: Fri Feb 28 00:20:17 2014 -0500
-
- When no VFP arguments are present the IP register is used
- uninitialized. Initialize it to the value of FP.
-
- This fixes a number of testsuite failures when configured for
- armv7l-unknown-linux-gnueabihf
-
-commit 49f7729c3ce697c12408c42ccb29cdf4eb66bb85
-Author: Anthony Green <green@moxielogic.com>
-Date: Fri Feb 28 00:17:16 2014 -0500
-
- aarch64 fix
-
-commit 447483d51c6aa9df7116f346a73fc1cf795f4c2b
-Merge: 51377bd b4df9cf
-Author: Anthony Green <green@moxielogic.com>
-Date: Thu Feb 27 15:42:41 2014 -0500
-
- Fix ChangeLog merge
-
-commit 3998d2604b5c0d45a098ff3119a9fd9710ef429d
-Author: Josh Triplett <josh@joshtriplett.org>
-Date: Mon Feb 17 11:20:33 2014 -0800
-
- Fix build error on x86 without distinct long double
-
- src/x86/ffi64.c: In function 'classify_argument':
- src/x86/ffi64.c:205:5: error: duplicate case value
- case FFI_TYPE_LONGDOUBLE:
- ^
- src/x86/ffi64.c:202:5: error: previously used here
- case FFI_TYPE_DOUBLE:
- ^
-
-commit 51377bda9aed0b2c1309c818460cab9d9ab3d46e
-Merge: f08da54 40927bd
-Author: Anthony Green <green@moxielogic.com>
-Date: Sat Feb 15 08:06:29 2014 -0500
-
- Merge pull request #72 from heiher/devel
-
- MIPS N32: Fix call floating point va function
-
-commit f08da5465463e60a28f5e921f23ebf2ba984c148
-Merge: 3dc3f32 fa5f25c
-Author: Anthony Green <green@moxielogic.com>
-Date: Sat Feb 15 08:06:11 2014 -0500
-
- Merge pull request #68 from zeldin/master
-
- Linux/ppc64: Remove assumption on contents of r11 in closure
-
-commit 40927bd3e1e7c6007025ba10854fd8a0664e47df
-Author: Heiher <r@hev.cc>
-Date: Tue Jan 21 23:18:27 2014 +0800
-
- Fix call floating point va function
-
- I'm not sure floating-point arguments in GPR or FPR before calling
- variable number arguments function. so, load all arguments to GPR and
- FPR.
-
-commit b4df9cf9cc4a9a9401a53fd6bea1f3c2c283b97b
-Author: Zachary Waldowski <zach@waldowski.me>
-Date: Wed Feb 5 14:22:52 2014 -0500
-
- AArch64: Fix void fall-through case when assertions are enabled
-
-commit f466aad0d91a117e42571d1d6fb434fa0433c930
-Author: Zachary Waldowski <zach@waldowski.me>
-Date: Tue Jan 21 16:38:31 2014 -0500
-
- AArch64: Fix missing semicolons when assertions are enabled
-
-commit 7ea677733bd98917241852b8901a6b7580728895
-Author: Anthony Green <green@moxielogic.com>
-Date: Sat Nov 30 20:58:31 2013 -0500
-
- Remove build-ios from Makefile
-
- Conflicts:
- ChangeLog
-
-commit 6ae046cc59c12b2cd40158d6bcb96f4a59886159
-Author: Anthony Green <green@moxielogic.com>
-Date: Sat Nov 30 21:06:51 2013 -0500
-
- Mention Aarch64 on iOS
-
-commit bfc06b3fdb32abe90ce0749aedfec649df85a7ef
-Author: Zachary Waldowski <zach@waldowski.me>
-Date: Mon Dec 30 17:36:39 2013 -0500
-
- Update ChangeLog
-
-commit 0a0f12ce1f7be81006b08a3c81a636926d283a9b
-Author: Zachary Waldowski <zach@waldowski.me>
-Date: Thu Jan 9 13:50:17 2014 -0500
-
- AArch64: Remove duplicitous element_count call.
-
- This inhibits an analyzer warning by Clang.
-
-commit 4330fdcd92e67c816288d64ab230237065768206
-Author: Zachary Waldowski <zach@waldowski.me>
-Date: Thu Jan 9 13:53:30 2014 -0500
-
- Darwin/aarch64: Respect iOS ABI re: stack argument alignment
-
-commit 0a333d6c3973935d4fe02aae76b10e39d3c88e07
-Author: Zachary Waldowski <zach@waldowski.me>
-Date: Thu Jan 9 14:03:29 2014 -0500
-
- Darwin/aarch64: Fix size_t assumptions
-
-commit 2c18e3c76aad1b426617db05a4384e7c3a920176
-Author: Zachary Waldowski <zach@waldowski.me>
-Date: Mon Dec 30 16:14:02 2013 -0500
-
- Darwin/aarch64: Fix "shadows declaration" warnings
-
-commit 1b8a8e20e344f3c55495ab6eb46bd14e843d4b3e
-Author: Zachary Waldowski <zach@waldowski.me>
-Date: Thu Jan 9 13:55:21 2014 -0500
-
- Darwin/aarch64: Use Clang cache invalidation builtin
-
-commit 6030cdcae776f8fb5876a53168f7d1e75d28a242
-Author: Zachary Waldowski <zach@waldowski.me>
-Date: Mon Dec 30 15:45:51 2013 -0500
-
- Darwin/aarch64: Account for long double being equal to double
-
-commit 5658b0892683d2e24e4d5842978c184a7ad33858
-Author: Zachary Waldowski <zach@waldowski.me>
-Date: Mon Dec 30 16:33:47 2013 -0500
-
- Darwin/aarch64: Use CNAME, restrict .size like ARM
-
-commit 07175780802acec5dc49fdedd6d20a62409a6707
-Author: Zachary Waldowski <zach@waldowski.me>
-Date: Mon Dec 30 17:48:22 2013 -0500
-
- Darwin/aarch64: Fix invalid reference in assembly
-
-commit 9da28b44277fea3aeb827c35dd63d609d2524a8b
-Author: Zachary Waldowski <zach@waldowski.me>
-Date: Mon Dec 30 16:23:21 2013 -0500
-
- Darwin/x86_64: Fix 64-bit type shortening warnings
-
-commit 821d398f08bd1d540a5b235507812ffeee49b580
-Author: Zachary Waldowski <zach@waldowski.me>
-Date: Thu Jan 9 13:15:06 2014 -0500
-
- Darwin: Merge build scripts, redo project, incl. arm64
-
-commit 6eff9ff9e72463b9783be2514f944b6f05692054
-Author: Zachary Waldowski <zach@waldowski.me>
-Date: Mon Dec 30 17:48:10 2013 -0500
-
- Darwin/iOS: Improve unified syntax use for LLVM
-
-commit ba0ea99c82aadd5957386a031e3122011bd36d52
-Author: Zachary Waldowski <zach@waldowski.me>
-Date: Mon Dec 30 15:27:44 2013 -0500
-
- Fix dlmalloc warnings due to set_segment_flags, sizeof(size_t)
-
-commit 994be3a5c1d0d17b19103396103e128517fd62f9
-Author: Zachary Waldowski <zach@waldowski.me>
-Date: Mon Dec 30 15:27:14 2013 -0500
-
- Darwin/iOS: Fix mis-typing of vfp_reg_free
-
-commit a8e0a835ab1f62d03ad6391760e3e8b7732d24f8
-Author: Zachary Waldowski <zach@waldowski.me>
-Date: Mon Dec 30 15:26:20 2013 -0500
-
- Darwin/ARM: Assert on NULL dereference
-
- This inhibits an analyzer warning by Clang on all platforms.
-
-commit 13675341581c489ed9df8ba390c8e08a732decb2
-Author: Zachary Waldowski <zach@waldowski.me>
-Date: Thu Jan 9 13:42:08 2014 -0500
-
- Darwin/i386: Inhibit Clang previous prototype warnings
-
-commit 66469c381e2e2cc96e7d409266dea0ffe177eeca
-Author: Zachary Waldowski <zach@waldowski.me>
-Date: Thu Jan 9 13:41:45 2014 -0500
-
- Darwin/ARM: Inhibit Clang previous prototype warnings
-
-commit 5bfe62a00d2d659eec9f19b39802b6e69844fc27
-Author: Zachary Waldowski <zach@waldowski.me>
-Date: Thu Jan 9 13:41:27 2014 -0500
-
- Darwin/AArch64: Inhibit Clang previous prototype warnings
-
-commit fa5f25c20f76a6ef5e950a7ccbce826672c8a620
-Author: Marcus Comstedt <marcus@mc.pp.se>
-Date: Sat Jan 4 19:00:08 2014 +0100
-
- Linux/ppc64: Remove assumption on contents of r11 in closure
-
-commit 1a0b01e171e9c750437cef2f18917f5a6e32c498
-Author: Paulo Pizarro <paulo.pizarro@gmail.com>
-Date: Thu Jan 2 16:17:59 2014 -0200
-
- When the function called by the ffi called a function defined in a shared library generate a fatal error
- The correction was to take into consideration the GOT.
-
-commit 3dc3f32c35db5ab995a835225f6815369735ceb7
-Author: Anthony Green <green@moxielogic.com>
-Date: Thu Dec 5 16:23:25 2013 -0500
-
- Undo iOS ARM64 changes.
-
-commit 356b2cbc304bfe5bdc28b8d1c68d1ff084e9ec37
-Merge: 484a758 07345a3
-Author: Anthony Green <green@moxielogic.com>
-Date: Sat Nov 30 22:38:13 2013 -0500
-
- Merge branch 'master' of github.com:/atgreen/libffi
-
-commit 484a7584260e2fbb399ce90083046834271bf9ff
-Author: Anthony Green <green@moxielogic.com>
-Date: Sat Nov 30 21:06:51 2013 -0500
-
- Mention Aarch64 on iOS
-
-commit 07345a30ec0a2fa45a7c363d301f57723690cfa0
-Author: Anthony Green <green@moxielogic.com>
-Date: Sat Nov 30 21:06:51 2013 -0500
-
- Mention Aarch64 on iOS
-
-commit d4b931c1b872378c35f12ddbb9a6d55e7f17c65e
-Author: Anthony Green <green@moxielogic.com>
-Date: Sat Nov 30 20:58:31 2013 -0500
-
- Remove build-ios from Makefile
-
-commit dfbf236d70fc1ec68e6ff193584a154353508e2f
-Merge: 852ac3b bb9740e
-Author: Anthony Green <green@moxielogic.com>
-Date: Sat Nov 30 20:54:54 2013 -0500
-
- Merge branch 'master' of github.com:/atgreen/libffi
- Add ChangeLog entry.
-
-commit bb9740e545205f93a525c77aa6d1cbf4ca9371f3
-Merge: ac75368 4d701e0
-Author: Anthony Green <green@moxielogic.com>
-Date: Sat Nov 30 17:54:39 2013 -0800
-
- Merge pull request #60 from zwaldowski/ios-redo
-
- Mac/iOS support, including aarch64 port
-
-commit 4d701e03faa475a5eb3b54b90046114a1e27b813
-Author: Zachary Waldowski <zwaldowski@gmail.com>
-Date: Sat Nov 30 13:25:27 2013 -0500
-
- Darwin: Properly export headers from Xcode project
-
-commit 022f12eb9ad2264e838fa5fb453733f5177888f4
-Author: Zachary Waldowski <zwaldowski@gmail.com>
-Date: Sat Nov 30 12:21:38 2013 -0500
-
- Darwin: Freshen gen scripts, remove old build-ios.sh
-
-commit e820fe2025d7ad3df7584407946dfaad2af69599
-Author: Zachary Waldowski <zwaldowski@gmail.com>
-Date: Sat Nov 30 12:03:51 2013 -0500
-
- Darwin/iOS: Include x86_64+aarch64 pieces in library
-
-commit 0278284e470ec91db7cdc15ac3dcd64683305848
-Author: Zachary Waldowski <zwaldowski@gmail.com>
-Date: Sat Nov 30 03:03:37 2013 -0500
-
- Darwin/aarch64: size_t assumptions
-
-commit 9775446b6441c91cd9059215c106aa3bcf949767
-Author: Zachary Waldowski <zwaldowski@gmail.com>
-Date: Sat Nov 30 02:39:34 2013 -0500
-
- Darwin/aarch64: Fix “shadows declaration” warnings
-
-commit 4260badc37705d3618e774dfe61184ac709881c1
-Author: Zachary Waldowski <zwaldowski@gmail.com>
-Date: Sat Nov 30 02:08:14 2013 -0500
-
- Darwin/aarch64: Use Clang cache invalidation builtin
-
-commit 9fa7998d5f9250908cbf12a671479852ebadf9d1
-Author: Zachary Waldowski <zwaldowski@gmail.com>
-Date: Sat Nov 30 02:07:48 2013 -0500
-
- Darwin/aarch64: Inhibit Xcode warning
-
-commit 0e832048a93830575b0976406444e134e649a4f7
-Author: Zachary Waldowski <zwaldowski@gmail.com>
-Date: Sat Nov 30 02:07:34 2013 -0500
-
- Darwin/aarch64: double == long double
-
-commit 602dc22d76931092610234cf063f9f1b8dbc1a51
-Author: Zachary Waldowski <zwaldowski@gmail.com>
-Date: Sat Nov 30 02:06:00 2013 -0500
-
- Darwin/iOS prep script: try and compile for arm64
-
-commit b513dfe79de4725e8a717325a9e3b5b9f69f63dc
-Author: Zachary Waldowski <zwaldowski@gmail.com>
-Date: Sat Nov 30 02:05:22 2013 -0500
-
- Darwin/aarch64: Restrict .size to ELF like arm32.
-
-commit bc978099bf2812de755c076b67ef9c2547607572
-Author: Zachary Waldowski <zwaldowski@gmail.com>
-Date: Sat Nov 30 02:04:57 2013 -0500
-
- Darwin/aarch64: Potentially(?) fix compile error
-
-commit d6bb9314467c6e0683156559d23ca341c43fa3c8
-Author: Zachary Waldowski <zwaldowski@gmail.com>
-Date: Sat Nov 30 02:04:22 2013 -0500
-
- Darwin/aarch64: Use CNAME refs
-
-commit 33c46ce5680eea28d3437c8771ec1d137e226b45
-Author: Zachary Waldowski <zwaldowski@gmail.com>
-Date: Sat Nov 30 04:13:42 2013 -0500
-
- Darwin/Mac: Fix 64/32 shortening warnings
-
-commit 0612081e6c161d9d820742f995975d35da2adbc2
-Author: Zachary Waldowski <zwaldowski@gmail.com>
-Date: Sat Nov 30 03:03:00 2013 -0500
-
- Darwin: Misc size_t warnings
-
-commit 6a6247d179ec3859311c2d8775841b884f309f66
-Author: Zachary Waldowski <zwaldowski@gmail.com>
-Date: Sat Nov 30 02:55:48 2013 -0500
-
- Darwin: Fix dlmalloc warnings due to sizeof(size_t)
-
-commit 4d60d9e1e32de6166ffd63bbe9ce54cf961c78fc
-Author: Zachary Waldowski <zwaldowski@gmail.com>
-Date: Sat Nov 30 04:09:30 2013 -0500
-
- Darwin: Rebuild Xcode project
-
-commit cb719a5c1c2eb391d6a5f5e02484ba4aa990a51b
-Author: Zachary Waldowski <zwaldowski@gmail.com>
-Date: Sat Nov 30 04:09:18 2013 -0500
-
- Darwin/iOS: Fix LLVM 3.3 warning re: memcpy.
-
-commit 21bde92c9abb378f9c456a9d95e6f9b99ef8c920
-Author: Zachary Waldowski <zwaldowski@gmail.com>
-Date: Sat Nov 30 03:43:42 2013 -0500
-
- Darwin: Clean up, modernize generator scripts
-
-commit fd54eab74cef7891e4acaaafb71e783142ecb69e
-Author: Zachary Waldowski <zwaldowski@gmail.com>
-Date: Sat Nov 30 03:38:02 2013 -0500
-
- Darwin/Mac: Also exclude OS X generated source
-
-commit 953b6f14c655141f9e7d82550a312c3eeb961091
-Author: Zachary Waldowski <zwaldowski@gmail.com>
-Date: Tue Apr 24 11:16:20 2012 -0400
-
- Darwin/iOS: More unified syntax support w/ Clang.
-
- Signed-off-by: Zachary Waldowski <zwaldowski@gmail.com>
-
-commit c713a55379481c339877f2e0003d97cb8d9ed80e
-Author: Zachary Waldowski <zwaldowski@gmail.com>
-Date: Tue Apr 24 10:25:29 2012 -0400
-
- Darwin/iOS: Simplify RETLDM arguments for LLVM 3.1
-
- Signed-off-by: Zachary Waldowski <zwaldowski@gmail.com>
-
-commit 16ba1b80028db5cb71cf86e5f79f5e48317f83c8
-Author: Zachary Waldowski <zwaldowski@gmail.com>
-Date: Wed Apr 11 23:26:04 2012 -0400
-
- Darwin: Silence Clang warnings.
-
-commit 852ac3bd302d6ed97b1ef65f4cbed69c258a48df
-Merge: ab79d6e ac75368
-Author: Anthony Green <green@moxielogic.com>
-Date: Thu Nov 21 21:25:44 2013 -0500
-
- Merge branch 'master' of github.com:/atgreen/libffi
-
- Conflicts:
- ChangeLog
-
-commit ab79d6e21992dd86139ba07530ff888833b78a04
-Author: Alan Modra <amodra@gmail.com>
-Date: Thu Nov 21 06:12:35 2013 -0500
-
- This separates the 32-bit sysv/linux/bsd code from the 64-bit linux
- code, and makes it possible to link code compiled with different
- options to those used to compile libffi. For example, a
- -mlong-double-128 libffi can be used with -mlong-double-64 code.
-
- Using the return value area as a place to pass parameters wasn't such
- a good idea, causing a failure of cls_ulonglong.c. I didn't see this
- when running the mainline gcc libffi testsuite because that version of
- the test is inferior to the upstreamm libffi test.
-
- Using NUM_FPR_ARG_REGISTERS rather than NUM_FPR_ARG_REGISTERS64 meant
- that a parameter save area could be allocated before it was strictly
- necessary. Wrong but harmless. Found when splitting apart ffi.c
- into 32-bit and 64-bit support.
-
-commit ac7536889334d4be50709006d7e23536364d7891
-Author: Alan Modra <amodra@gmail.com>
-Date: Thu Nov 21 06:12:35 2013 -0500
-
- This separates the 32-bit sysv/linux/bsd code from the 64-bit linux
- code, and makes it possible to link code compiled with different
- options to those used to compile libffi. For example, a
- -mlong-double-128 libffi can be used with -mlong-double-64 code.
-
- Using the return value area as a place to pass parameters wasn't such
- a good idea, causing a failure of cls_ulonglong.c. I didn't see this
- when running the mainline gcc libffi testsuite because that version of
- the test is inferior to the upstreamm libffi test.
-
- Using NUM_FPR_ARG_REGISTERS rather than NUM_FPR_ARG_REGISTERS64 meant
- that a parameter save area could be allocated before it was strictly
- necessary. Wrong but harmless. Found when splitting apart ffi.c
- into 32-bit and 64-bit support.
-
-commit 69df91cfb4fa6bcb644350a80bff970f27478a6a
-Merge: 2f45082 aa1f62c
-Author: Anthony Green <green@moxielogic.com>
-Date: Mon Nov 18 06:34:04 2013 -0800
-
- Merge pull request #59 from iains/powerpc-darwin-unwind-fix
-
- Fix PowerPC Darwin FDE encodings to use pcrel correctly. Modernise the picbase labels.
-
-commit aa1f62c0a093c30325dff1d4d2b6b4b22eb96929
-Author: Iain Sandoe <iain@codesourcery.com>
-Date: Mon Nov 18 13:11:56 2013 +0000
-
- Fix PowerPC Darwin FDE encodings to use pcrel correctly. Modernise the picbase labels.
-
-commit 2f450822a8698ba88441c56d152c7dc8924b127f
-Author: Anthony Green <green@moxielogic.com>
-Date: Mon Nov 18 06:52:29 2013 -0500
-
- Clean up code to appease modern GCC compiler.
-
-commit 16d56c51aded374730920a4acde76ff3d2860ae1
-Author: Alan Modra <amodra@gmail.com>
-Date: Mon Nov 18 06:36:03 2013 -0500
-
- An #endif in the wrong place would cause compile failure on powerpcle.
- Using bl instead of b doesn't cause runtime failures as you might think,
- but does mess the processor branch prediction.
-
-commit 34f878a5ef28663f6b1d7fd26fb099429ea1579e
-Merge: 83f65b6 1fd0457
-Author: Anthony Green <green@moxielogic.com>
-Date: Sat Nov 16 06:57:54 2013 -0500
-
- Merge branch 'master' of github.com:/atgreen/libffi
-
- Conflicts:
- ChangeLog
- src/powerpc/ffi.c
-
-commit 83f65b63d9764a9cc7688fc5cda5ee2bd23faf54
-Author: Alan Modra <amodra@gmail.com>
-Date: Sat Nov 16 06:53:50 2013 -0500
-
- Finally, this adds _CALL_ELF == 2 support. ELFv1 objects can't be
- linked with ELFv2 objects, so this is one case where preprocessor
- tests in ffi.c are fine. Also, there is no need to define a new
- FFI_ELFv2 or somesuch value in enum ffi_abi. FFI_LINUX64 will happily
- serve both ABIs.
-
-commit 1fd045784cac874b5d76b7fa931f67209a8280d3
-Author: Alan Modra <amodra@gmail.com>
-Date: Sat Nov 16 06:53:50 2013 -0500
-
- Finally, this adds _CALL_ELF == 2 support. ELFv1 objects can't be
- linked with ELFv2 objects, so this is one case where preprocessor
- tests in ffi.c are fine. Also, there is no need to define a new
- FFI_ELFv2 or somesuch value in enum ffi_abi. FFI_LINUX64 will happily
- serve both ABIs.
-
-commit 362851379a49ce07d3e36e82c4e5c7b6cc16a352
-Author: Alan Modra <amodra@gmail.com>
-Date: Sat Nov 16 06:52:43 2013 -0500
-
- Andreas' 2013-02-08 change reverted some breakage for struct return
- values from 2011-11-12, but in so doing reintroduced string
- instructions to sysv.S that are not supported on all powerpc variants.
- This patch properly copies the bounce buffer to destination in C code
- rather than in asm.
-
- I have tested this on powerpc64-linux, powerpc-linux and
- powerpc-freebsd. Well, the last on powerpc-linux by lying to
- configure with
-
- CC="gcc -m32 -msvr4-struct-return -mlong-double-64" \
- CXX="g++ -m32 -msvr4-struct-return -mlong-double-64" \
- /src/libffi-current/configure --build=powerpc-freebsd
-
- and then
-
- make && make CC="gcc -m32" CXX="g++ -m32" \
- RUNTESTFLAGS=--target_board=unix/-m32/-msvr4-struct-return/-mlong-double-64\
- check
-
-commit 1c06515d927d9de1582438d4eb5953890e79c5c7
-Author: Alan Modra <amodra@gmail.com>
-Date: Sat Nov 16 06:41:36 2013 -0500
-
- The powerpc64 ABIs align structs passed by value, a fact ignored by
- gcc for quite some time. Since gcc now does the correct alignment,
- libffi needs to follow suit. This ought to be made selectable via
- a new abi value, and the #ifdefs removed from ffi.c along with many
- other #ifdefs present there and in assembly. I'll do that with a
- followup patch sometime.
-
- This is a revised version of
- https://sourceware.org/ml/libffi-discuss/2013/msg00162.html
-
-commit a97cf1fae575d8bfd5259c5c422025ad43911326
-Author: Alan Modra <amodra@gmail.com>
-Date: Sat Nov 16 06:40:13 2013 -0500
-
- This patch prepares for ELFv2, where sizes of these areas change. It
- also makes some minor changes to improve code efficiency.
-
-commit 164283f4ac5972ce2ab5e015cc2ab1014c23276c
-Author: Alan Modra <amodra@gmail.com>
-Date: Sat Nov 16 06:38:55 2013 -0500
-
- The powerpc64 support opted to pass floating point values both in the
- fpr area and the parameter save area, necessary when the backend
- doesn't know if a function argument corresponds to the ellipsis
- arguments of a variadic function. This patch adds powerpc support for
- variadic functions, and changes the code to only pass fp in the ABI
- mandated area. ELFv2 needs this change since the parameter save area
- may not exist there.
-
- This also fixes two faulty tests that used a non-variadic function
- cast to call a variadic function, and spuriously reasoned that this is
- somehow necessary for static functions..
-
-commit 31257b3189f81a199bc2902c22bc5f2d7c54ccde
-Author: Andrew Haley <aph@redhat.com>
-Date: Sat Nov 16 06:35:51 2013 -0500
-
- Fix sample closure code
-
-commit db0ace3a38496af73eae3df02ef353736d16909f
-Author: Andrew Haley <aph@redhat.com>
-Date: Sat Nov 16 06:29:25 2013 -0500
-
- Fix broken test cases
-
-commit de10f5039ed7a53382ddcc95c368d03e535edb98
-Merge: 58c2577 f3657da
-Author: Anthony Green <green@moxielogic.com>
-Date: Thu Nov 14 10:56:29 2013 -0500
-
- Merge branch 'master' of https://github.com/bivab/libffi
-
- Conflicts:
- ChangeLog
-
-commit f3657da278dd63afcdd8762894a9bdaea8ef028a
-Author: David Schneider <david.schneider@bivab.de>
-Date: Thu Nov 14 13:02:16 2013 +0100
-
- update Changelog
-
-commit 58c2577a3ff80e7416ef0434769e2af23365719c
-Author: Alan Modra <amodra@gmail.com>
-Date: Wed Nov 13 16:55:36 2013 -0500
-
- This enshrines the current testsuite practice of using ffi_arg for
- returned values. It would be reasonable and logical to use the actual
- return argument type as passed to ffi_prep_cif, but this would mean
- changing a large number of tests that use ffi_arg and all backends
- that write results to an ffi_arg.
-
-commit 8af42f9944f7ed72c81ae360aac6a84dc11f89dc
-Author: Anthony Green <green@moxielogic.com>
-Date: Wed Nov 13 16:40:28 2013 -0500
-
- Respect HAVE_ALLOCA_H
-
-commit cdf405d574f479b782454516366bd4f4b9b3415e
-Author: David Schneider <david.schneider@bivab.de>
-Date: Wed Nov 13 15:50:21 2013 +0100
-
- add a testcase for the double/float issue on ARMHF
-
-commit 77f823e31ffb557a466b24f7fba845fbf7831798
-Author: David Schneider <david.schneider@bivab.de>
-Date: Wed Nov 13 14:26:57 2013 +0100
-
- stop trying to assing vfp regs once we are done with the registers
-
-commit 37067ec5036f2a6ed7a4799f83f8f53160460344
-Author: David Schneider <david.schneider@bivab.de>
-Date: Tue Nov 12 19:49:01 2013 +0100
-
- mark all vfp registers as used when done.
-
- To avoid assigning registers the would fit, once arguments have been on
- the stack, we mark all registers as used once we do not find a free
- register for the first time.
-
-commit 2f5b7ce545473a7f6e41193edc29407cbebe82d5
-Author: Anthony Green <green@moxielogic.com>
-Date: Sat Nov 9 06:16:32 2013 -0500
-
- UltraSPARC IIi fix. Update README and build configury.
-
-commit becd754434173032f426d22ffcbfe24f55b3c137
-Author: Mark Kettenis <kettenis@gnu.org>
-Date: Wed Nov 6 06:43:49 2013 -0500
-
- Align the stack pointer to 16-bytes.
-
-commit 05c31093409f7b3e6d795fac21d2c954313d8162
-Author: Konstantin Belousov <kib@freebsd.org>
-Date: Wed Nov 6 06:40:58 2013 -0500
-
- Mark executable as not requiring executable stack.
-
-commit cf6bf9818e8394cfcdb07a40c6a5e2ee6b01d333
-Author: Anthony Green <green@moxielogic.com>
-Date: Sat Nov 2 17:23:59 2013 -0400
-
- Fix up docs
-
-commit 02177176854d16fc0f1a5958aa34da2f306630ee
-Merge: c242217 c265b4c
-Author: Anthony Green <green@moxielogic.com>
-Date: Sat Nov 2 17:11:22 2013 -0400
-
- Merge branch 'master' of github.com:/atgreen/libffi
-
-commit c2422174b3edc0de0b148dfd6b67087bb881c4a6
-Merge: f4b843f d918d47
-Author: Anthony Green <green@moxielogic.com>
-Date: Sat Nov 2 14:08:23 2013 -0700
-
- Merge pull request #45 from foss-for-synopsys-dwc-arc-processors/arc_support
-
- arc: Fix build error
-
-commit c265b4cacb9130f042699a85de9c7242b3f49cc3
-Merge: f4b843f d918d47
-Author: Anthony Green <green@moxielogic.com>
-Date: Sat Nov 2 14:08:23 2013 -0700
-
- Merge pull request #45 from foss-for-synopsys-dwc-arc-processors/arc_support
-
- arc: Fix build error
-
-commit f4b843f83710ac378c48abd87fe66bb519d30d2e
-Author: Anthony Green <green@moxielogic.com>
-Date: Sat Nov 2 17:01:15 2013 -0400
-
- Don't align stack for win32
-
-commit f3cd39345713db8e414cf642b6cb65a4cfe6018c
-Merge: 666f3e7 6aa1590
-Author: Anthony Green <green@moxielogic.com>
-Date: Sat Nov 2 13:17:57 2013 -0700
-
- Merge pull request #51 from vbudovski/for_upstream
-
- Don't use 16 byte aligned stack for WIN32
-
-commit 666f3e71b56d92c49fcd2d7f349b8f8ebca0f8a3
-Author: Anthony Green <green@moxielogic.com>
-Date: Sat Oct 26 09:12:42 2013 -0400
-
- Add more credits to README. Tidy up.
-
-commit 73ada14e756bad97fad0e6915a821a3c7e079f81
-Author: Anthony Green <green@moxielogic.com>
-Date: Sat Oct 26 09:09:45 2013 -0400
-
- Update README
-
-commit d3372c54ce7117e80d389ba875dc5b6b2213c71e
-Author: Mark H Weaver <mhw@netris.org>
-Date: Sat Oct 26 08:30:06 2013 -0400
-
- Fix N32 ABI issue for MIPS.
-
-commit d6716aba8118eb0513885cfe557bedebb7016e8b
-Author: Anthony Green <green@moxielogic.com>
-Date: Tue Oct 15 15:42:49 2013 -0400
-
- Update travis-ci build dependencies to include texinfo
-
-commit 16b93a211bcfbe4bd0efdcf94de225a71aa0ee02
-Author: Sandra Loosemore <sandra@codesourcery.com>
-Date: Tue Oct 15 15:33:59 2013 -0400
-
- Add nios2 port.
-
-commit 2f5626ce02fce8267ab48ceb6d7d0ed7d672a75e
-Author: Sandra Loosemore <sandra@codesourcery.com>
-Date: Tue Oct 15 15:32:16 2013 -0400
-
- Fix testsuite bug
-
-commit f64e4a865557e440774436b4c2b2fd7374290e97
-Author: Marcus Shawcroft <marcus.shawcroft@arm.com>
-Date: Tue Oct 15 15:20:14 2013 -0400
-
- Fix many.c testcase for Aarch64
-
-commit 128cd1d2f358f26d9fa75a27cf2b30356f5dd903
-Author: Anthony Green <green@moxielogic.com>
-Date: Tue Oct 8 06:45:51 2013 -0400
-
- Fix spelling errors
-
-commit ff06269d707cafbfef2a88afb07a79c9d1480c5f
-Author: Anthony Green <green@moxielogic.com>
-Date: Tue Oct 8 06:32:18 2013 -0400
-
- Update README for M88K and VAX
-
-commit d2fcbcdfbea750d1f6a9f493e2e6c4d5ffa71b34
-Author: Anthony Green <green@moxielogic.com>
-Date: Tue Oct 8 06:27:46 2013 -0400
-
- Add m88k and VAX support. Update some configury bits.
-
-commit 6aa15900accc0a648cdebf11ec11d11697ebfffd
-Author: Vitaly Budovski <vbudovski@gmail.com>
-Date: Thu Sep 5 12:05:06 2013 +1000
-
- Don't use 16 byte aligned stack for WIN32
-
- This fixes a crash when accessing __stdcall functions in Python ctypes.
-
-commit 3b44d41156149af8da2a58825fefdfa23274ae7a
-Author: Makoto Kato <m_kato@ga2.so-net.ne.jp>
-Date: Wed Jul 10 15:34:53 2013 +0900
-
- Fix build failure when using clang for Android
-
- clang for Android generates __gnu_linux__ define, but gcc for Android doesn't. So we should add check it for Android
-
-commit d918d47809c174d62283306b282749f8db93661f
-Author: Mischa Jonker <mjonker@synopsys.com>
-Date: Mon Jul 8 15:51:36 2013 +0200
-
- arc: Fix build error
-
- One part of the patch for ARC support was missing in the upstreamed
- version.
-
- Signed-off-by: Mischa Jonker <mjonker@synopsys.com>
-
-commit d3d099b40c122550279789200263346f120f6909
-Author: Anthony Green <green@moxielogic.com>
-Date: Tue Jul 2 16:11:38 2013 -0400
-
- little-endian ppc64 support
-
-commit 0f8690a84c874ec09a090c8c6adfb93c594acac6
-Author: Anthony Green <green@moxielogic.com>
-Date: Tue Jul 2 15:54:40 2013 -0400
-
- Rebuild for ARC additions
-
-commit f88118b345f27c46f5445d6e4832c498ff9a6d85
-Author: Anthony Green <green@moxielogic.com>
-Date: Tue Jul 2 15:51:27 2013 -0400
-
- Revert "Merge pull request #36 from abergmeier/emscripten_fix"
-
- This reverts commit 6a4d901dde7b3f87984c563505717cde3113d16e, reversing
- changes made to b50a13b9c07ec09af4b9697e482acdad571e6961.
-
-commit 6a4d901dde7b3f87984c563505717cde3113d16e
-Merge: b50a13b 587002c
-Author: Anthony Green <green@moxielogic.com>
-Date: Tue Jul 2 12:12:34 2013 -0700
-
- Merge pull request #36 from abergmeier/emscripten_fix
-
- Fixes for building with Emscripten
-
-commit b50a13b9c07ec09af4b9697e482acdad571e6961
-Merge: 767f1f9 b082e15
-Author: Anthony Green <green@moxielogic.com>
-Date: Tue Jul 2 12:10:26 2013 -0700
-
- Merge pull request #44 from foss-for-synopsys-dwc-arc-processors/arc_support
-
- Add ARC support
-
-commit 767f1f96e5282da44d7340e6815e9820a3f78e39
-Merge: c3c40e0 b8a91d8
-Author: Anthony Green <green@moxielogic.com>
-Date: Tue Jul 2 12:08:04 2013 -0700
-
- Merge pull request #43 from JensTimmerman/__m128
-
- added include for xmmintrin.h
-
-commit b8a91d81be77d479327fdb6bdd9fdae6d18e6e63
-Author: Jens Timmerman <jens.timmerman@ugent.be>
-Date: Tue Jul 2 10:57:37 2013 +0200
-
- added include for xmmintrin.h
-
-commit b082e15091961373c03d10ed0251f619ebb6ed76
-Author: Mischa Jonker <mjonker@synopsys.com>
-Date: Mon Jun 10 16:19:33 2013 +0200
-
- Add ARC support
-
- This adds support for the ARC architecture to libffi. DesignWare ARC
- is a family of processors from Synopsys, Inc.
-
- This patch has been tested on a little-endian system and passes
- the testsuite.
-
- Signed-off-by: Mischa Jonker <mjonker@synopsys.com>
-
-commit cc9b518687e46b0d1acafdd4bc3f3b281c25a3d9
-Author: Marcin Wojdyr <wojdyr@gmail.com>
-Date: Tue May 14 15:01:23 2013 +0200
-
- Update libffi.pc.in
-
- use -L${toolexeclibdir} instead of -L${libdir}
- to be consistent with Makefile.am
-
-commit 587002c092cffe6e7a8d7028f246c241d03b738c
-Author: Andreas Bergmeier <andreas.bergmeier@gmx.net>
-Date: Fri Apr 19 17:12:24 2013 +0200
-
- Enable disabling of libtool on platforms where it does not work (e.g. LLVM).
- Build libraries normally then.
-
-commit c3c40e0290377d7cf948b072eedd8317c4bf215e
-Merge: ede96e4 4750e3c
-Author: Anthony Green <green@moxielogic.com>
-Date: Sat Mar 30 05:24:14 2013 -0700
-
- Merge pull request #34 from davidsch/armhf
-
- Fix ARM hard-float support for large numbers of VFP arguments
-
-commit 4750e3c662fd9569cb3e2d28f539685fd1ca8caf
-Author: David Schneider <david.schneider@bivab.de>
-Date: Thu Mar 28 16:56:36 2013 +0100
-
- update changelog
-
-commit 9708e7cf09f1bf815f4d6485eb1f180fabb35804
-Author: David Schneider <david.schneider@bivab.de>
-Date: Wed Mar 27 19:31:04 2013 +0100
-
- folow the ARM hard-float ABI in ffi_prep_incoming_args_VFP
-
-commit b41120981e5e49ca2da10b94b154775f50da5f36
-Author: David Schneider <david.schneider@bivab.de>
-Date: Wed Mar 27 16:38:35 2013 +0100
-
- create separated versions of ffi_prep_incoming_args_* for SYSV and VFP ABIs.
-
- The different versions will be called depending on the value of cif->abi
-
-commit dd26f1f39c54861c5b91931f0f37a72942c2a072
-Author: David Schneider <david.schneider@bivab.de>
-Date: Thu Mar 28 15:39:01 2013 +0100
-
- add a failing test for closures on ARM hardfloat
-
-commit 3c1608613ab3c2184222b98c5482cddedd6b559b
-Author: David Schneider <david.schneider@bivab.de>
-Date: Tue Mar 26 19:24:47 2013 +0100
-
- extend ffi_prepare_args for FFI_VFP (hard-float ABI), fixing an issue with passing VFP arguments in VFP registers and the stack, while at the same time not using all core registers.
-
-commit 0f2ff2d4c92719be8936179f9ab674f4d1a3fd14
-Author: David Schneider <david.schneider@bivab.de>
-Date: Tue Mar 26 19:22:02 2013 +0100
-
- separate ARM ffi_prepare_args in a version implementing the simple SYSV calling convention and one for the hard-float calling convention
-
-commit 3a352b8a8252400a83de22c7c424bf1887b4a2ef
-Author: David Schneider <david.schneider@bivab.de>
-Date: Tue Mar 26 14:24:04 2013 +0100
-
- move the hardfloat specific argument copying code to the helper function
-
-commit 5df6b7944a4225b6eb329f3886be64e04e966f29
-Author: David Schneider <david.schneider@bivab.de>
-Date: Tue Mar 26 14:02:21 2013 +0100
-
- extract setting of arguments to be passed to a helper function
-
-commit 7d1048c471bb4b1f9d67a9e9f8e95f9a1d2e6d45
-Author: David Schneider <david.schneider@bivab.de>
-Date: Tue Mar 26 11:33:33 2013 +0100
-
- extract code to align the argument storage pointer to a helper function
-
-commit b9f013788f0f384c423ad963475aaacb55598135
-Author: David Schneider <david.schneider@bivab.de>
-Date: Mon Mar 25 13:27:36 2013 +0100
-
- add a testcase, that on ARM hardfloat needs more than the 8 VFP argument registers to pass arguments to a call
-
-commit 2fbdb0f231cafdb77b025d3cd8afe90cda99b3ba
-Author: David Schneider <david.schneider@bivab.de>
-Date: Mon Mar 25 13:26:02 2013 +0100
-
- use the absolute value to check the test result against an epsilon
-
-commit ede96e4eb660bbf3e0fe048135efa8106f48af5d
-Merge: f22ab3c 9e34992
-Author: Anthony Green <green@moxielogic.com>
-Date: Sun Mar 17 18:38:21 2013 -0400
-
- Merge branch 'master' of github.com:/atgreen/libffi
-
-commit f22ab3c6877cbdd07f058b68816b0086b1cb0e1e
-Merge: 12b1886 d08124b
-Author: Anthony Green <green@moxielogic.com>
-Date: Sun Mar 17 18:34:54 2013 -0400
-
- Merge branch 'master' of github.com:/atgreen/libffi
-
-commit 9e34992a5ea2fda1dba5875bf96dc91a7230f51f
-Merge: 12b1886 d08124b
-Author: Anthony Green <green@moxielogic.com>
-Date: Sun Mar 17 18:34:54 2013 -0400
-
- Merge branch 'master' of github.com:/atgreen/libffi
-
-commit 12b1886d7b1f8aa264b1d348bfa47a0e14712df4
-Author: Anthony Green <green@moxielogic.com>
-Date: Sun Mar 17 18:32:12 2013 -0400
-
- cygwin fix & updates for 3.0.13
-
-commit d08124bedf2c6d61874fe215404783aeb9f6f1ac
-Author: Anthony Green <green@moxielogic.com>
-Date: Sun Mar 17 18:32:12 2013 -0400
-
- cygwin fix & updates for 3.0.13
-
-commit cb32c812d04d1dfa72002cc04924e7e4fef89e02
-Author: Anthony Green <green@moxielogic.com>
-Date: Sun Mar 17 09:27:55 2013 -0400
-
- Fix lib install dir
-
-commit efd7866a361a6f636bae8400d26c6811e56ca207
-Author: Anthony Green <green@moxielogic.com>
-Date: Sat Mar 16 08:35:57 2013 -0400
-
- 2.0.13rc1
-
-commit ff647ad4dff2f07dd153f295a1f70b1d906cd6ca
-Merge: 4acf005 d9dd417
-Author: Anthony Green <green@moxielogic.com>
-Date: Sat Mar 16 08:20:40 2013 -0400
-
- Merge branch 'master' of github.com:/atgreen/libffi
-
- Conflicts:
- ChangeLog
-
-commit 4acf0056f55c757490dae6c29a65b0321327ea8a
-Author: Anthony Green <green@moxielogic.com>
-Date: Sat Mar 16 08:18:45 2013 -0400
-
- Build fix for soft-float power targets
-
-commit 675c9839224e4268187f1ec6f512127f9db555d0
-Author: Anthony Green <green@moxielogic.com>
-Date: Sat Mar 16 08:12:38 2013 -0400
-
- Documentation fix
-
-commit 8a286f570ccd41db81f74ea7f248da62241d898a
-Author: Anthony Green <green@moxielogic.com>
-Date: Sat Mar 16 08:01:19 2013 -0400
-
- Fix for m68000 systems
-
-commit d9dd417b09566af55b7b3000bb53ccaf2e1d6c92
-Author: Anthony Green <green@moxielogic.com>
-Date: Sat Mar 16 08:01:19 2013 -0400
-
- Fix for m68000 systems
-
-commit 215763d012a944d95406b394d6013b80d220e870
-Author: Anthony Green <green@moxielogic.com>
-Date: Sat Mar 16 07:57:35 2013 -0400
-
- Update configury.
-
-commit 9180d8f39c9b6afe17b78277c2711a5d9948e824
-Merge: 2fb527a 7e1b326
-Author: Anthony Green <green@moxielogic.com>
-Date: Sat Mar 16 07:46:55 2013 -0400
-
- Merge branch 'master' of github.com:/atgreen/libffi
-
-commit 2fb527a017a4943e176a489ff103231b86464b59
-Author: Anthony Green <green@moxielogic.com>
-Date: Sat Mar 16 07:46:38 2013 -0400
-
- Add Meta processor support
-
-commit 211a9ebf4d1a9801e15e103566aed2b8c42790be
-Merge: f308faf ee18766
-Author: Anthony Green <green@moxielogic.com>
-Date: Sat Mar 16 04:24:40 2013 -0700
-
- Merge pull request #32 from alex/patch-1
-
- Fix for a crasher due to misaligned stack on x86-32.
-
-commit 7e1b32649efd24814e86172e196f390566f9e970
-Merge: f308faf ee18766
-Author: Anthony Green <green@moxielogic.com>
-Date: Sat Mar 16 04:24:40 2013 -0700
-
- Merge pull request #32 from alex/patch-1
-
- Fix for a crasher due to misaligned stack on x86-32.
-
-commit ee18766b169811426c14b011fbb46d81e344f926
-Author: Alex Gaynor <alex.gaynor@gmail.com>
-Date: Thu Mar 14 15:00:33 2013 -0700
-
- Fix for a crasher due to misaligned stack on x86-32.
-
- Full information on reproduction (using Python's ctypes available here: http://bugs.python.org/issue17423)
-
-commit f308faf1eabaf8dc24966ab17fbf94368f46b9c7
-Author: Anthony Green <green@moxielogic.com>
-Date: Mon Feb 11 14:25:13 2013 -0500
-
- Add moxie support. Release 3.0.12.
-
-commit 4ea22e54e3b143fe05c413f6dddd236af6bcbfb2
-Author: Anthony Green <green@moxielogic.com>
-Date: Sun Feb 10 08:48:38 2013 -0500
-
- Update README
-
-commit 10e77227b6ae85f46f28590bfb09ca3608554358
-Author: Anthony Green <green@moxielogic.com>
-Date: Sun Feb 10 08:47:26 2013 -0500
-
- mend
-
-commit a9521411a53d58f2bf88199242200ceb0d4dae3a
-Author: Anthony Green <green@moxielogic.com>
-Date: Sat Feb 9 06:54:40 2013 -0500
-
- sparc v8 and testsuite fixes
-
-commit 70b11b47eea93bf43627588d494d0b3b0d062481
-Author: Anthony Green <green@moxielogic.com>
-Date: Fri Feb 8 16:12:19 2013 -0500
-
- Fix small struct passing on ppc
-
-commit 63ba1fa79f7c4ce42de848debe233aab31aecb51
-Author: Anthony Green <green@moxielogic.com>
-Date: Fri Feb 8 15:18:19 2013 -0500
-
- Remove xfail for arm*-*-*.
-
-commit 24fbca4c1d57d4ea628c0a8ba643684daf54a37e
-Author: Anthony Green <green@moxielogic.com>
-Date: Fri Feb 8 14:19:56 2013 -0500
-
- Fix typo
-
-commit b0fa11cb0a94ce6baca058eab9b10e40475e71d6
-Author: Anthony Green <green@moxielogic.com>
-Date: Fri Feb 8 14:17:13 2013 -0500
-
- More man page cleanup
-
-commit 8bd15d139a58a6e46dc90a1cb2d89f59f32f06c7
-Author: Anthony Green <green@moxielogic.com>
-Date: Fri Feb 8 13:56:37 2013 -0500
-
- Fix many.c testcase for ppc
-
-commit 7aab825cf198be85490d3cd80e778d415d85ad9b
-Author: Anthony Green <green@moxielogic.com>
-Date: Fri Feb 8 13:26:21 2013 -0500
-
- Add missing files to dist
-
-commit cb03ea8f4eb08024e44abe4392edc77b89fbfbad
-Author: Anthony Green <green@moxielogic.com>
-Date: Fri Feb 8 12:25:18 2013 -0500
-
- sparc v9 fixes for sun tools
-
-commit 35ee8d44f31dd3d3b88083c837dc351593e13cc2
-Author: Anthony Green <green@moxielogic.com>
-Date: Fri Feb 8 07:12:41 2013 -0500
-
- Fix microblaze big-endian struct issue
-
-commit 9db7e1a958fc484ba149efe027008b9a170395fb
-Author: Anthony Green <green@moxielogic.com>
-Date: Thu Feb 7 21:06:08 2013 -0500
-
- Fix botched sparc patch. Update version.
-
-commit ce0138e61455f268af326e26908b9680ec2c4bea
-Author: Anthony Green <green@moxielogic.com>
-Date: Thu Feb 7 18:04:01 2013 -0500
-
- Update bug report address. rc2.
-
-commit fd07c9e40451e0ec1d0475cd54a83d45ccaea2c0
-Author: Anthony Green <green@moxielogic.com>
-Date: Thu Feb 7 18:00:36 2013 -0500
-
- Add cache flushing routine for sun compiler on sparc solaris 2.8
-
-commit ed6ae9501b2bab45daf93b4935eb0c977635b763
-Author: Anthony Green <green@moxielogic.com>
-Date: Thu Feb 7 16:43:36 2013 -0500
-
- Add libtool-ldflags. Define toolexeclibdir for non-GCC builds.
-
-commit ffef2e046aaec853be356f0b8770a335185ea9cf
-Author: Anthony Green <green@moxielogic.com>
-Date: Thu Feb 7 15:47:01 2013 -0500
-
- x32 and libtool fixes
-
-commit 95eecebb2858dc6f1495a61072ff36d0a8127144
-Author: Anthony Green <green@moxielogic.com>
-Date: Thu Feb 7 15:32:46 2013 -0500
-
- Remove a.out cruft from dist
-
-commit 176aa9d2e23d9cd57d6f250692d910b408f9a651
-Author: Anthony Green <green@moxielogic.com>
-Date: Thu Feb 7 15:29:22 2013 -0500
-
- Fix GCC usage test and update README
-
-commit f3a4f3fdde89b04d66983a42a25d09161c5d4d54
-Author: Anthony Green <green@moxielogic.com>
-Date: Thu Feb 7 09:57:20 2013 -0500
-
- Fixes for AIX xlc compiler.
-
-commit 522f8fef49848927482bc63c94afaea5b84e5ec1
-Author: Anthony Green <green@moxielogic.com>
-Date: Wed Feb 6 20:31:31 2013 -0500
-
- Fix man page. Clean out junk.
-
-commit c4dfa259eb4e8e6f4c397868d7fee80aa0bb6a12
-Author: Anthony Green <green@moxielogic.com>
-Date: Wed Feb 6 17:43:24 2013 -0500
-
- Bump soversion
-
-commit f62bd63fe6123cadedb8b2b2c72eb549c40fbce9
-Author: Anthony Green <green@moxielogic.com>
-Date: Wed Feb 6 17:38:32 2013 -0500
-
- Release candidate 1
-
-commit f7cd61e9e68a4a51147df04d75bfe5b91b9d9286
-Author: Anthony Green <green@moxielogic.com>
-Date: Wed Feb 6 17:38:04 2013 -0500
-
- Fix pkgconfig install bits
-
-commit 6a790129427121f7db2d876e7218a3104e6d2741
-Author: Anthony Green <green@moxielogic.com>
-Date: Wed Feb 6 17:37:15 2013 -0500
-
- Work around LLVM ABI problem on x86-64
-
-commit 370112938e705128fd5dd4017fc1a1210bd0271a
-Merge: bada2e3 bcc0c28
-Author: Anthony Green <green@moxielogic.com>
-Date: Sun Jan 27 05:09:04 2013 -0800
-
- Merge pull request #28 from jralls/master
-
- Reorder x86_64 checks
-
-commit bcc0c28001b6d427d5cd8037d2e3c892babc6b4c
-Author: John Ralls <jralls@ceridwen.us>
-Date: Sat Jan 26 15:21:14 2013 -0800
-
- Reorder x86_64 tests
-
- So that darwin and cygwin/mingw are tested before the generic check --
- which allows them to actually be set.
-
-commit bada2e326d9a9acf3ae40cfa4f5d7a9ba97b2ea8
-Author: Anthony Green <green@moxielogic.com>
-Date: Mon Jan 21 08:02:07 2013 -0500
-
- Update README
-
-commit 655bb8f3690feba8e840a5f1854b1d78ed08f692
-Merge: 1035ffb 840f975
-Author: Anthony Green <green@moxielogic.com>
-Date: Mon Jan 21 08:01:24 2013 -0500
-
- Merge branch 'master' of github.com:/atgreen/libffi
-
-commit 1035ffb2f468e1a1c401d58cff7e7abb69838e68
-Merge: aeb8719 4086024
-Author: Anthony Green <green@moxielogic.com>
-Date: Mon Jan 21 07:55:53 2013 -0500
-
- Update README
-
-commit 840f975866052fdd91b2c224d56e01ae5900b60d
-Merge: aeb8719 4086024
-Author: Anthony Green <green@moxielogic.com>
-Date: Mon Jan 21 07:55:53 2013 -0500
-
- Merge branch 'master' of github.com:/atgreen/libffi
-
-commit aeb8719a34756969970603fca4568530d56708af
-Author: Anthony Green <green@moxielogic.com>
-Date: Mon Jan 21 07:37:30 2013 -0500
-
- New microblaze support
-
-commit 40860245a4fd91a1b88adc9171ec993c549e45d5
-Author: Anthony Green <green@moxielogic.com>
-Date: Mon Jan 21 07:37:30 2013 -0500
-
- New microblaze support
-
-commit 20cae32b152b43679ae65a85db9a1c6bb8a143dd
-Author: Anthony Green <green@moxielogic.com>
-Date: Mon Jan 21 07:07:38 2013 -0500
-
- Xtensa support
-
-commit 9742f91782faef4a15941508a22c408fb7d1d227
-Author: Anthony Green <green@moxielogic.com>
-Date: Mon Jan 21 07:03:41 2013 -0500
-
- Mention IBM XL compiler support on AIX.
-
-commit f03eab08248f122ce3b623a18df9e19fae1b6e98
-Author: Anthony Green <green@moxielogic.com>
-Date: Fri Jan 11 17:14:11 2013 -0500
-
- Remove obsolete inline test functions
-
-commit 05fbe1faedc7b2580d5f14010d00e9e3cee73951
-Author: Anthony Green <green@moxielogic.com>
-Date: Fri Jan 11 16:54:40 2013 -0500
-
- xlc compiler support
-
-commit 0b4986a7889ed1864674192228f1162c1b5770a8
-Author: Anthony Green <green@moxielogic.com>
-Date: Fri Jan 11 11:19:52 2013 -0500
-
- [travis] install dejagnu with sudo
-
-commit 3c337eef51ab9a4993fc875bfa26289dd6a08881
-Author: Anthony Green <green@moxielogic.com>
-Date: Fri Jan 11 11:18:14 2013 -0500
-
- [travis] install dejagnu
-
-commit 90720962ce1baf9fc35d1bde1738102bcd5bd5ed
-Author: Anthony Green <green@moxielogic.com>
-Date: Fri Jan 11 10:57:30 2013 -0500
-
- Add first travis config file
-
-commit bff052d9cd5be41ba9e47c76114054af487d3c30
-Author: Anthony Green <green@moxielogic.com>
-Date: Fri Jan 11 10:24:32 2013 -0500
-
- 32-bit x86 fix and more
-
-commit cd41aeab6176f839167955c016ecc19f65f75df3
-Author: Anthony Green <green@moxielogic.com>
-Date: Thu Jan 10 17:25:45 2013 -0500
-
- Add compiler column to table
-
-commit 8bf987d4df7c4d21435b9211f6cc86abf5904b42
-Author: Anthony Green <green@moxielogic.com>
-Date: Thu Jan 10 17:24:51 2013 -0500
-
- Fix for sunpro compiler on Solaris
-
-commit 3ee74fd6dc8ccd32b608bbff73526838fc34f70b
-Author: Anthony Green <green@moxielogic.com>
-Date: Thu Jan 10 17:15:03 2013 -0500
-
- Update documentation version.
-
-commit 13e2d7b92557a9511a0414df82bf2df3edc55cba
-Author: Anthony Green <green@moxielogic.com>
-Date: Thu Jan 10 10:52:02 2013 -0500
-
- Handle both 32 and 64-bit x86 builds regardless of target triple
-
-commit 5141543000fc86a3d49a907a2313713ee79e504d
-Author: Anthony Green <green@moxielogic.com>
-Date: Thu Jan 10 07:35:53 2013 -0500
-
- Don't run EH tests with non-GNU compiler
-
-commit 56ba8d86f47937a0afb81a2b9e77c9d235d9db45
-Author: Anthony Green <green@moxielogic.com>
-Date: Thu Jan 10 07:25:10 2013 -0500
-
- Don't use warning checking macro with sun compiler
-
-commit 6a028caec1b2c7904feb4c4f9cb7e1125e1d1b60
-Author: Anthony Green <green@moxielogic.com>
-Date: Thu Jan 10 01:19:43 2013 -0500
-
- Don't use GCCisms to define types when
- + building with the SUNPRO compiler.
-
-commit 2d9b3939751b3ef9739049509d353ade10b32a8f
-Author: Anthony Green <green@moxielogic.com>
-Date: Wed Jan 9 21:14:54 2013 -0500
-
- Fix for closures with sunpro compiler
-
-commit 8308984e479e3274a36e98e8272b5adbb6b774c2
-Author: Anthony Green <green@moxielogic.com>
-Date: Tue Jan 8 15:14:21 2013 -0500
-
- Make sure we're running dejagnu tests with the right compiler.
-
-commit f26c7ca67147450db2fe25ea932944e6cf145d5c
-Author: Anthony Green <green@moxielogic.com>
-Date: Tue Jan 8 14:47:05 2013 -0500
-
- Make compiler options in dejagnu runs compiler specific
-
-commit 74c776e21907fc2e59257c021f23077f8b7966cb
-Author: Anthony Green <green@moxielogic.com>
-Date: Tue Jan 8 12:25:54 2013 -0500
-
- Switch x86 Solaris to X86 from X86_64
-
-commit 8962c8c8d06803e310bac0ffc8e84ea15daeff3f
-Author: Anthony Green <green@moxielogic.com>
-Date: Tue Jan 8 12:22:24 2013 -0500
-
- Fix read-only eh_frame test
-
-commit 35ddb69c2b49746d940e919ca226ecc1be94f14a
-Author: Anthony Green <green@moxielogic.com>
-Date: Tue Jan 8 07:53:37 2013 -0500
-
- Only emit DWARF unwind info when building with GCC
-
-commit f7879bc3f3a8d0bbfcc38771732c160a58ba9cd8
-Author: Anthony Green <green@moxielogic.com>
-Date: Tue Jan 8 07:30:28 2013 -0500
-
- Testsuite fix for Solaris vendor compiler
-
-commit 67cea90fc0897021466fd102671019d30db474cd
-Author: Anthony Green <green@moxielogic.com>
-Date: Mon Jan 7 06:30:24 2013 -0500
-
- mend
-
-commit 0de3277b18cf54be3b81d509b9be9b47d9bc1e82
-Author: Thorsten Glaser <tg@mirbsd.de>
-Date: Mon Dec 3 00:02:31 2012 +0000
-
- Testsuite fixes (was Re: [PATCH] Fix libffi on m68k-linux-gnu, completely)
-
- Dixi quod…
-
- >although I believe some 3.0.11 checks to be broken:
-
- And indeed, with a few minor changes on top of git master,
- I still get a full run of PASS plus one XPASS on amd64-linux!
-
- With the other patches (from this message’s parent) and
- these applied, I get a full PASS on m68k-linux as well.
-
- So, please git am these three diffs ☺
-
- bye,
- //mirabilos
- --
- FWIW, I'm quite impressed with mksh interactively. I thought it was much
- *much* more bare bones. But it turns out it beats the living hell out of
- ksh93 in that respect. I'd even consider it for my daily use if I hadn't
- wasted half my life on my zsh setup. :-) -- Frank Terbeck in #!/bin/mksh
- From 5cb15a3bad1f0fb360520dd48bfc938c821cdcca Mon Sep 17 00:00:00 2001
- From: Thorsten Glaser <tg@mirbsd.org>
- Date: Sun, 2 Dec 2012 23:20:56 +0000
- Subject: [PATCH 1/2] Fix tests writing to a closure retval via pointer casts
-
- As explained in <Pine.BSM.4.64L.1212022014490.23442@herc.mirbsd.org>
- all other tests that do the same cast to an ffi_arg pointer instead.
-
- PASS on amd64-linux (Xen domU) and m68k-linux (ARAnyM)
-
- Signed-off-by: Thorsten Glaser <tg@mirbsd.org>
-
-commit 8f4772f383abd71cfa141c8a70ba11c1aa4ebe2c
-Author: Anthony Green <green@moxielogic.com>
-Date: Mon Jan 7 06:14:53 2013 -0500
-
- m68k fixes for signed 8 and 16-bit calls.
-
-commit ea7f8440d58afbebb181e295ff564fdf3d6590a0
-Author: Anthony Green <green@moxielogic.com>
-Date: Fri Jan 4 09:09:32 2013 -0500
-
- remove gcc-ism
-
-commit f06c0f10377ac04eeba5e632dbe5c62c629df4e6
-Author: Anthony Green <green@moxielogic.com>
-Date: Wed Jan 2 09:39:17 2013 -0500
-
- Add missing ChangeLog entry and generated files.
-
-commit 1f8675d4c101d19d67ca0a55ff2ba973349558ad
-Merge: 335f419 f6b58d2
-Author: Anthony Green <green@moxielogic.com>
-Date: Wed Jan 2 06:34:38 2013 -0800
-
- Merge pull request #26 from rofl0r/master
-
- fix build error on ppc when long double == double
-
-commit 335f419a86090cda9f215d149572f9481c3ad034
-Merge: 53236d5 6d6f711
-Author: Anthony Green <green@moxielogic.com>
-Date: Wed Jan 2 06:30:03 2013 -0800
-
- Merge pull request #23 from rurban/master
-
- cygwin/mingw shared libs need libtool LDFLAGS = -no-undefined
-
-commit 53236d5061034cc0a7f4647fc1bd05ba1aeb3d2a
-Author: Anthony Green <green@moxielogic.com>
-Date: Wed Jan 2 09:24:55 2013 -0500
-
- Regenerate files
-
-commit 72222ca3fbe560e13c8dc89ca441b28b7cc74daf
-Author: Anthony Green <green@moxielogic.com>
-Date: Wed Jan 2 09:06:38 2013 -0500
-
- Update texinfo.tex
-
-commit 1e326c95431fc9896422fa36659f3e833852579c
-Author: Anthony Green <green@moxielogic.com>
-Date: Wed Jan 2 09:05:02 2013 -0500
-
- Update config.guess and config.sub
-
-commit cb6671f5b8a9596ff968c6b6c304f70adf71b368
-Author: Anthony Green <green@moxielogic.com>
-Date: Wed Jan 2 08:56:07 2013 -0500
-
- Missing .gitignore changes for xcode support
-
-commit ebbe77966855395a2a47ed2c09a38f93eb0481cf
-Author: Anthony Green <green@moxielogic.com>
-Date: Wed Jan 2 08:54:05 2013 -0500
-
- missed x32 libtool patch.
-
-commit 4394096da0aca0dd422b479a043c18b4f05c5770
-Author: Anthony Green <green@moxielogic.com>
-Date: Wed Jan 2 08:51:35 2013 -0500
-
- missed trampoline_table patch. Move to GCC.
-
-commit ed7a59c3ff7c84bd95c374a5aff21599f705e6dc
-Author: Anthony Green <green@moxielogic.com>
-Date: Wed Jan 2 08:48:01 2013 -0500
-
- Windows symbol export fix. Move to GCC.
-
-commit ccee09a4ff843b11c7d8b6819776f57d187305c7
-Author: Anthony Green <green@moxielogic.com>
-Date: Wed Jan 2 08:41:55 2013 -0500
-
- +2012-03-21 Peter Rosin <peda@lysator.liu.se>
- +
- + * testsuite/lib/target-libpath.exp [*-*-cygwin*, *-*-mingw*]
- + (set_ld_library_path_env_vars): Add the library search dir to PATH
- + (and save PATH for later).
- + (restore_ld_library_path_env_vars): Restore PATH.
-
-commit 089dbce7cc0889eb26444d89ae062c73c69f26f0
-Author: Anthony Green <green@moxielogic.com>
-Date: Wed Jan 2 08:37:35 2013 -0500
-
- med
-
-commit 980a334c42b4b0eff32e55929ec6727d1326b05d
-Author: Anthony Green <green@moxielogic.com>
-Date: Wed Jan 2 07:36:42 2013 -0500
-
- Test GCC update
-
-commit 8bad679ade5000e57cdc9cacde22e8b99840930f
-Author: Anthony Green <green@moxielogic.com>
-Date: Wed Jan 2 08:28:35 2013 -0500
-
- New stand-alone patch
-
-commit 981c32ee115e9f0d6546a74592875e138222a9d1
-Author: Anthony Green <green@moxielogic.com>
-Date: Wed Jan 2 07:34:03 2013 -0500
-
- Merge with GCC. Eliminate quilt bits.
-
-commit 61a054929517fb80c437ba71c91f3e20cfff581a
-Author: Anthony Green <green@moxielogic.com>
-Date: Wed Nov 28 06:07:41 2012 -0500
-
- Refresh config.guess and config.sub
-
-commit f6b58d2bdc0a24ce94dedce59802f091979df265
-Author: rofl0r <retnyg@gmx.net>
-Date: Thu Nov 22 16:26:21 2012 +0100
-
- fix build on ppc when long double == double
-
-commit 69da33a0761aeac73f9e9646269da61c906d6020
-Author: Anthony Green <green@moxielogic.com>
-Date: Mon Nov 12 15:25:47 2012 -0500
-
- Pull in config.sub for aarch64 support and more
-
-commit f680b598b7bdde325ac9349e8c35151c228bf2df
-Author: Anthony Green <green@moxielogic.com>
-Date: Tue Nov 6 16:00:40 2012 -0500
-
- Add missing aarch64 configury bits
-
-commit dfadfb19853c57c8623c436d0ef2bdafab24b433
-Author: Anthony Green <green@moxielogic.com>
-Date: Wed Oct 31 06:46:41 2012 -0400
-
- Rebase for ppc64 fix
-
-commit e944b8c7eb1e2eeb9c0f3b9742b4d7f476860ce1
-Author: Anthony Green <green@moxielogic.com>
-Date: Tue Oct 30 14:06:09 2012 -0400
-
- Add PaX work-around
-
-commit 9ccd51be1fdeb99f8b4f42f905166c2abbba8ac0
-Merge: f342996 fa5d747
-Author: Anthony Green <green@moxielogic.com>
-Date: Tue Oct 30 13:37:37 2012 -0400
-
- Fix commit conflicts
-
-commit f342996cb50eb23b868afcff5ac0cdbb6b505d63
-Author: Anthony Green <green@moxielogic.com>
-Date: Tue Oct 30 07:42:27 2012 -0400
-
- Darwin12 fix
-
-commit 58e8b66f70cef2e3c9b0e5a707b45d634cbbf5d9
-Author: Anthony Green <green@moxielogic.com>
-Date: Tue Oct 30 07:07:19 2012 -0400
-
- AArch64 port
-
-commit fa5d747905472571fd472c07d4726017624f66b3
-Author: Anthony Green <green@moxielogic.com>
-Date: Tue Oct 30 07:07:19 2012 -0400
-
- AArch64 port
-
-commit 6993a6686f43f2313b18142c1e96189a27db2aa3
-Author: Anthony Green <green@moxielogic.com>
-Date: Tue Oct 30 06:59:32 2012 -0400
-
- Fix autoconf macros
-
-commit 70084e70ddb13b29dd05c751b1904de206bbe790
-Author: Anthony Green <green@moxielogic.com>
-Date: Fri Oct 12 23:55:06 2012 -0400
-
- Update Tile* port info
-
-commit 9c00a3f6742d61404b31268cc773e7130ff43331
-Author: Anthony Green <green@moxielogic.com>
-Date: Fri Oct 12 16:46:06 2012 -0400
-
- TILE-Gx/TILEPro support
-
-commit 048d2f41c3a6664b4b64bf21e804686662da4160
-Author: Anthony Green <green@moxielogic.com>
-Date: Thu Oct 11 10:55:25 2012 -0400
-
- Rebase
-
-commit 6d6f71108064f5069edd7bf771059d3b82640135
-Author: Reini Urban <rurban@cpanel.net>
-Date: Sat Jul 7 12:42:00 2012 -0500
-
- cygwin/mingw shared libs need libtool LDFLAGS = -no-undefined
-
- otherwise only static libs are created.
-
-commit d330f19292da8f39a78a9e2b0ba08df8094e3bc5
-Author: Nicolas Lelong <rotoglup>
-Date: Sat May 5 09:37:02 2012 -0400
-
- iOS build fixes.
-
-commit 09b23cfc1d6d15361eee18818851fd3cacb26559
-Author: Anthony Green <green@moxielogic.com>
-Date: Fri Apr 27 08:29:48 2012 -0400
-
- Update README with Blackfin/uClinux support
-
-commit 213ed15c70e72d666154c08e2b41dae3f61f20d3
-Author: Anthony Green <green@moxielogic.com>
-Date: Fri Apr 27 01:34:15 2012 -0400
-
- Add blackfin supprt from Alexandre Keunecke.
-
-commit ff3d76fd427382ce7d2b2ed54acdd0bce470ca4f
-Author: Anthony Green <green@moxielogic.com>
-Date: Wed Apr 11 23:16:48 2012 -0400
-
- 3.0.11
-
-commit 7e0a412c4fd9cbe77b467a9bf86f56aea62632c3
-Author: Anthony Green <green@moxielogic.com>
-Date: Wed Apr 11 22:47:44 2012 -0400
-
- Update files to ship
-
-commit 39e6a5860416f7bad992149817e1da1ba7c460d4
-Author: Zachary Waldowski <zwaldowski@gmail.com>
-Date: Wed Apr 11 22:39:46 2012 -0400
-
- More mac/ios build improvements
-
-commit 853cc722a16f8d1254573ef3bb73c7b8f3d8a110
-Author: Anthony Green <green@moxielogic.com>
-Date: Tue Apr 10 06:33:33 2012 -0400
-
- Fix typo for darwin targets
-
-commit 3f5023068cda07a3dd6dacbaa875a5b5fc96d4bb
-Author: Anthony Green <green@moxielogic.com>
-Date: Fri Apr 6 20:34:51 2012 -0400
-
- mend
-
-commit ebb8e8945681ce0af7a5c47a980287e8ece84b84
-Author: Mike Lewis <mikelikespie@gmail.com>
-Date: Fri Apr 6 20:02:08 2012 -0400
-
- Build iOS library with xcode
-
-commit a098b44f4c592c2192fcdef4fad6108eb3f4301c
-Author: Anthony Green <green@moxielogic.com>
-Date: Fri Apr 6 17:04:35 2012 -0400
-
- Reapply missing testsuite changes for arm
-
-commit 10d1e51393f08c14045db85843208f44f9f1e9ba
-Author: Anthony Green <green@moxielogic.com>
-Date: Fri Apr 6 11:57:14 2012 -0400
-
- Update to rc4. Upgrade autoconf version.
-
-commit 9bcc884276dc0a807b2605e510b11b1740dd9aa2
-Author: Anthony Green <green@moxielogic.com>
-Date: Fri Apr 6 11:53:07 2012 -0400
-
- Fix Linux/x32 reference in README
-
-commit a044a56b1cd2a0924f5ec0d6b5a5089d14fcd1a1
-Author: Anthony Green <green@moxielogic.com>
-Date: Fri Apr 6 10:39:10 2012 -0400
-
- Linux/x32 libtool fix
-
-commit 59bb61a36661b972e8443531d3b7bc736e131a4b
-Author: Anthony Green <green@moxielogic.com>
-Date: Fri Apr 6 08:26:14 2012 -0400
-
- Update libtool version, README, tests dists
-
-commit f2981454cbe25cf9411b710f46c5f5552003a123
-Author: Anthony Green <green@moxielogic.com>
-Date: Thu Apr 5 15:45:19 2012 -0400
-
- Revert debug code changes
-
-commit 39dccddb606f6fdb8dcb177d416e884041da6e30
-Author: Zachary Waldowski <zwaldowski@gmail.com>
-Date: Thu Apr 5 12:32:41 2012 -0400
-
- Fix building with Clang for Darwin (OS X 10.6+ and iOS
- 4.0+)
-
-commit 3afaa9a34a81a305227ae8cf4f12b9d0484d055e
-Author: Peter Rosin <peda@lysator.liu.se>
-Date: Tue Apr 3 07:40:31 2012 -0400
-
- Fix return_uc.c test case on windows.
-
-commit 65f40c35a2873d8328359ec4512bd0736dbe32c7
-Author: Anthony Green <green@moxielogic.com>
-Date: Tue Apr 3 07:35:59 2012 -0400
-
- Repair ppc build regression.
-
-commit 0a1ab12a8d15caa894116a82249551f23ef65612
-Author: Peter Rosin <peda@lysator.liu.se>
-Date: Fri Mar 30 08:14:08 2012 -0400
-
- Various MSVC-related changes.
-
-commit e1539266e6c6dde3c99832323586f33f977d1dc0
-Author: Anthony Green <green@moxielogic.com>
-Date: Fri Mar 30 00:40:18 2012 -0400
-
- ARM VFP fix for old toolchains
-
-commit 7c5e60b5f47d725036a72162f136272bc407e3a1
-Author: Anthony Green <green@moxielogic.com>
-Date: Thu Mar 29 08:48:22 2012 -0400
-
- Rebase on fixed GCC sources
-
-commit e72ed5eeaa9cfb0fdc86f6b3422734177b659f96
-Author: Anthony Green <green@moxielogic.com>
-Date: Wed Mar 21 09:52:28 2012 -0400
-
- Fix vararg float test
-
-commit bd78c9c3311244dd5f877c915b0dff91621dd253
-Author: Anthony Green <green@moxielogic.com>
-Date: Wed Mar 21 08:09:30 2012 -0400
-
- More cygwin fixes
-
-commit 84d3253f86dad6b4f261231935675d35fd964b05
-Author: Anthony Green <green@moxielogic.com>
-Date: Mon Mar 19 23:07:35 2012 -0400
-
- Rebase post GCC merge
-
-commit 964c5b93f80dcaacf73056b7d15a4d2b4b7a217c
-Author: Anthony Green <green@moxielogic.com>
-Date: Sat Mar 3 14:46:20 2012 -0500
-
- abi check fixes and Linux/x32 support
-
-commit 6c194233a5f6f1d274669afc5924a9e1f69d4876
-Author: Anthony Green <green@moxielogic.com>
-Date: Sat Mar 3 14:17:54 2012 -0500
-
- Add -no-undefined for both 32- and 64-bit x86
- windows-like hosts.
-
-commit 8360bf1cd0aba8db5582266da70467de7e89a57a
-Author: Anthony Green <green@moxielogic.com>
-Date: Thu Feb 23 07:01:13 2012 -0500
-
- Ensure that users don't include ffitarget.h directly
-
-commit d578b89619cf3d2baff027b203619dc307fc12e3
-Author: Anthony Green <green@moxielogic.com>
-Date: Wed Feb 15 00:18:18 2012 -0500
-
- Fix ABI check regression
-
-commit dee20f8e45c486f5018f31e09bb362992aa498c3
-Author: Anthony Green <green@moxielogic.com>
-Date: Fri Feb 10 13:06:46 2012 -0500
-
- Rebased from gcc
-
-commit 4130e1972d001143e5e9f3c6b65f2a6f9524169e
-Author: Anthony Green <green@moxielogic.com>
-Date: Fri Feb 3 13:18:27 2012 -0600
-
- Refresh autoconf-archive m4 scripts
-
-commit 1ff9c604bb214b5a305064af1049577ef783730a
-Author: Anthony Green <green@moxielogic.com>
-Date: Wed Feb 1 16:34:30 2012 -0600
-
- Rebase from GCC
-
-commit 211060eb8f714af0e935430efa6bb45e8e3ffc5d
-Author: Anthony Green <green@moxielogic.com>
-Date: Mon Jan 23 14:24:01 2012 -0500
-
- Alpha fix
-
-commit 78d9c638ba0de6edfbc603fd65d19c6562663248
-Author: Anthony Green <green@moxielogic.com>
-Date: Mon Jan 23 14:17:24 2012 -0500
-
- mend
-
-commit afaf3381604bd81803d8a5f3bf4d462299f1aac3
-Author: Anthony Green <green@moxielogic.com>
-Date: Mon Jan 23 14:17:13 2012 -0500
-
- mend
-
-commit 9e9c4aeb77de5608d602109f22100c1c0c79faad
-Author: Anthony Green <green@moxielogic.com>
-Date: Mon Jan 23 14:11:23 2012 -0500
-
- Add Amiga support
-
-commit 8efc0b1f4027d5a3cbf205e55d422d94e60f3226
-Author: Anthony Green <green@moxielogic.com>
-Date: Mon Jan 23 13:47:38 2012 -0500
-
- Unlikely fixes
-
-commit 1df51398ae183dc208ba4599ee867278b04d13d3
-Author: Anthony Green <green@moxielogic.com>
-Date: Mon Jan 23 13:43:59 2012 -0500
-
- mend
-
-commit cd2277cc796b96b149cd284ae85326529fe7fb9c
-Author: Anthony Green <green@moxielogic.com>
-Date: Mon Jan 23 13:43:38 2012 -0500
-
- mend
-
-commit 164e6fe04b189746c8bd5810c6e3e919770bb9d4
-Author: Anthony Green <green@moxielogic.com>
-Date: Mon Jan 23 12:41:06 2012 -0500
-
- m68k fixes
-
-commit c365ee7577bef00cb3c2c0b5224147aea04138d8
-Author: Anthony Green <green@moxielogic.com>
-Date: Mon Jan 23 11:13:18 2012 -0500
-
- Refresh
-
-commit f22c38bbd93bcc0c04bf26c3e414556b3177c385
-Author: Anthony Green <green@moxielogic.com>
-Date: Fri Nov 18 15:13:41 2011 -0500
-
- Update variadic patch
-
-commit 03e9ee321a3c208f88d2432587ce40b2bb2430ba
-Author: Anthony Green <green@moxielogic.com>
-Date: Fri Nov 18 15:13:00 2011 -0500
-
- Fix cls_double_va.c and update docs
-
-commit 95f31151ec792809cfb80d385350f9f56d95aa25
-Author: Anthony Green <green@moxielogic.com>
-Date: Sat Nov 12 23:46:05 2011 -0500
-
- Rerun automake
-
-commit 198ed1ef85cf18342627f8d44bc3f12c9975a49d
-Author: Anthony Green <green@moxielogic.com>
-Date: Sat Nov 12 23:45:20 2011 -0500
-
- Update version number
-
-commit 4f17e1f142e805b13959ba2594ee735eae439f4e
-Author: Anthony Green <green@moxielogic.com>
-Date: Sat Nov 12 17:22:24 2011 -0500
-
- Fix last patch
-
-commit ff9454da44859716a5bd4eaa344499288c79694f
-Author: Anthony Green <green@moxielogic.com>
-Date: Sat Nov 12 17:18:51 2011 -0500
-
- Add David Gilbert's variadic function call support
-
-commit ea14ae85e8f54ff046b7fb8a9cfe349475272044
-Author: Anthony Green <green@moxielogic.com>
-Date: Sat Nov 12 16:36:59 2011 -0500
-
- clean up
-
-commit 52891f8a93f9b8de801cca4cf05639422dc9773e
-Author: Anthony Green <green@moxielogic.com>
-Date: Sat Nov 12 16:35:55 2011 -0500
-
- Add powerpc soft float support
-
-commit c8f1bde8e2566c5a87474b4d08aa934d6d28ee75
-Author: Anthony Green <green@moxielogic.com>
-Date: Sat Nov 12 16:21:02 2011 -0500
-
- Remove junk file
-
-commit 6a6e7f862f3cc677e19131587caa619e7f9c7ffd
-Author: Anthony Green <green@moxielogic.com>
-Date: Sat Nov 12 16:20:42 2011 -0500
-
- Fix kfreebsd
-
-commit d52fbed05ccbdee9ed8b9c911cbb4f85b0ff0f2a
-Author: Anthony Green <green@moxielogic.com>
-Date: Sat Nov 12 16:13:41 2011 -0500
-
- Add missing ChangeLog entry
-
-commit 322052ce65c4fdac85bedc24726fd0e0094ba521
-Author: Anthony Green <green@moxielogic.com>
-Date: Sat Nov 12 16:11:49 2011 -0500
-
- Fix arm wince alignment issue
-
-commit af18df2bc2f52df81e7b5c619bd86db8489dc873
-Author: Anthony Green <green@moxielogic.com>
-Date: Sat Nov 12 15:52:08 2011 -0500
-
- Remove use of ppc string instructions
-
-commit 236c9391321f83ad40daf03f40c35c9ebc1da6b3
-Author: Anthony Green <green@moxielogic.com>
-Date: Sat Nov 12 07:37:40 2011 -0500
-
- Fix darwin11 build problem
-
-commit c411f140f305ebb00d33c92b7cb2742bcd241b6a
-Author: Anthony Green <green@moxielogic.com>
-Date: Sat Nov 12 07:32:36 2011 -0500
-
- Fix ax_enable_builddir macro on BSD systems
-
-commit 3d56106b07735abef6ae9f032e94f560a0ed2f30
-Author: Anthony Green <green@moxielogic.com>
-Date: Sat Nov 12 07:20:24 2011 -0500
-
- Rebase
-
-commit 8c01954c50bf8ef2e00a3db166060a1b8f83a20d
-Author: Anthony Green <green@moxielogic.com>
-Date: Tue Sep 6 14:26:32 2011 -0400
-
- Build assembly files with debug info
-
-commit fed646a2078969f4ce89c29107f1e72e03f4a977
-Author: Anthony Green <green@moxielogic.com>
-Date: Tue Sep 6 09:50:20 2011 -0400
-
- Regenerate configury with missing m4 macros
-
-commit d76441cf71216f8f1e62e7ec852a7f4e21371ec8
-Author: Anthony Green <green@moxielogic.com>
-Date: Wed Aug 24 10:14:23 2011 -0400
-
- Update list of supported OpenBSD systems
-
-commit ee6696fdf4768ba6dd037fb6dd99435afa13816e
-Author: Anthony Green <green@moxielogic.com>
-Date: Tue Aug 23 12:30:29 2011 -0400
-
- 3.0.11-rc1. soname bump.
-
-commit c6265c36a91eab8175d0e72db84d8225418f2379
-Author: Anthony Green <green@moxielogic.com>
-Date: Tue Aug 23 10:31:33 2011 -0400
-
- Version 3.0.10
-
-commit cc5e41bf32d18a14dbdd653d52eacdbdc934c392
-Author: Anthony Green <green@moxielogic.com>
-Date: Mon Aug 22 16:34:24 2011 -0400
-
- Fix use of autoconf macros
-
-commit 049d8386ff52399e69a530b55b9feedc8a2589d2
-Author: Anthony Green <green@moxielogic.com>
-Date: Mon Aug 22 14:50:10 2011 -0400
-
- Many new patches
-
-commit 3b7efa4e74f0dcebf70b447391987aedd3473306
-Author: Anthony Green <green@moxielogic.com>
-Date: Mon Aug 15 13:25:13 2011 -0400
-
- Revert remove-debug-code patch temporarily (for ARM Fedora release)
-
-commit d992ac54a2a9e7e064ffebcb91e05e7cb86185c7
-Author: Anthony Green <green@gmachine.(none)>
-Date: Fri Jul 29 17:32:53 2011 -0400
-
- Refresh from GCC
-
-commit 2d3fb36420e09304220ee6c0652bae5eccdb965d
-Author: Anthony Green <green@moxielogic.com>
-Date: Wed Mar 30 16:54:42 2011 -0400
-
- Fix darwin EH
-
-commit 30ff28e1d8cd9ed5319f1fbe9c7cccacc8161fb3
-Author: Anthony Green <green@moxielogic.com>
-Date: Mon Feb 28 15:36:23 2011 -0500
-
- Fix permissions
-
-commit 09f8f310f4f53a24289682d3d28f4399d7bafc3b
-Author: Anthony Green <green@moxielogic.com>
-Date: Mon Feb 28 15:36:07 2011 -0500
-
- More AIX fixes. rc9.
-
-commit 53d7b165642c220aa5166ba350b490802f359b54
-Merge: 18dd85d 3000dc2
-Author: Anthony Green <green@moxielogic.com>
-Date: Mon Feb 28 15:23:31 2011 -0500
-
- Merge branch 'master' of https://github.com/landonf/libffi-ios
-
-commit 18dd85d6cb9f3f3eea2a3b70eb4e150045905c55
-Author: Anthony Green <green@moxielogic.com>
-Date: Fri Feb 25 16:23:04 2011 -0500
-
- rc8. fix last patch.
-
-commit 74ee6ea8b42e60d44a3ae8938b1e42a38c1e66b4
-Author: Anthony Green <green@moxielogic.com>
-Date: Fri Feb 25 15:52:14 2011 -0500
-
- rc7. More AIX fixes.
-
-commit 2541679dbd3db0014890f42192dbf8008ab923fa
-Author: Anthony Green <green@moxielogic.com>
-Date: Fri Feb 25 15:09:13 2011 -0500
-
- Fix ppc32 bug
-
-commit cbb062cc35c518004f1ab45c847f8ec4f66069ad
-Author: Anthony Green <green@moxielogic.com>
-Date: Thu Feb 17 20:39:21 2011 -0500
-
- Another non-GCC configury fix
-
-commit 8cf8878425e9971866fa6b27a3e4914729ad3960
-Author: Anthony Green <green@moxielogic.com>
-Date: Tue Feb 15 15:19:49 2011 -0500
-
- Fix ax_cc_maxopt.m4
-
-commit 24b72070c0937f9000744c77a636f07e04786b6a
-Author: Anthony Green <green@moxielogic.com>
-Date: Mon Feb 14 15:30:57 2011 -0500
-
- Fix warning and msvcc patches
-
-commit d72c49e556a8c516e97f6722d1be2f1209c21207
-Author: Anthony Green <green@moxielogic.com>
-Date: Sun Feb 13 11:41:05 2011 -0500
-
- Add missing msvcc.sh
-
-commit 3000dc237f6017a7445d8404097a4f46b73fdd29
-Merge: 55e4a5a 1fbf9dc
-Author: Landon Fuller <landonf@bikemonkey.org>
-Date: Sun Feb 13 08:55:53 2011 -0500
-
- Merge remote branch 'upstream/master'
-
-commit 1fbf9dc44feea564e84ad7406d17c5d5906ce0e0
-Author: Anthony Green <green@moxielogic.com>
-Date: Sun Feb 13 08:06:39 2011 -0500
-
- Fix bad_abi test. rc5.
-
-commit 90af15ef5c1614b76370c4d13954586fabf9e8e3
-Author: Anthony Green <green@moxielogic.com>
-Date: Sat Feb 12 12:29:36 2011 -0500
-
- iOS fixes
-
-commit 55e4a5aa1568558a04aa40f16fc022e459af53e3
-Author: Landon Fuller <landonf@bikemonkey.org>
-Date: Sat Feb 12 12:13:46 2011 -0500
-
- Add support for building a full armv6/armv7/i386 universal iOS library
-
-commit a0c80f279b8733d001cb5e5c5a3289ecb7a6e56a
-Author: Landon Fuller <landonf@bikemonkey.org>
-Date: Sat Feb 12 11:43:49 2011 -0500
-
- Update my e-mail address.
-
-commit 8195e0e11df7a53fa474caa9375f73ca1136ed66
-Author: Landon Fuller <landonf@bikemonkey.org>
-Date: Sat Feb 12 11:27:00 2011 -0500
-
- Fix symbol prefixes on Darwin.
-
-commit 56b3f8cef0f28cefaa0f40fe0cf7c524adef131d
-Author: Landon Fuller <landonf@bikemonkey.org>
-Date: Sat Feb 12 11:14:54 2011 -0500
-
- Modify the ffi_closure structures to hold table/table entry pointers instead of a code buffer.
-
- This re-integrates commit da2773e02ab26cc11a7f.
-
-commit 28a00f61ff3f64c4eb2269ce2aea3d493274469e
-Author: Landon Fuller <landonf@bikemonkey.org>
-Date: Sat Feb 12 11:01:48 2011 -0500
-
- Apple assembler support; fixed most gas/ELF-isms.
-
-commit 7f2ea33a80bfced5e48ed7292f3b8f057d54ff8f
-Author: Landon Fuller <landonf@bikemonkey.org>
-Date: Sat Feb 12 10:39:18 2011 -0500
-
- Replace RETLDM macro.
-
- The macro is incompatible with Apple's assembler; switch to
- a simple inline version.
-
-commit 92ff23e77fa586455b427b71f49e1d9502470e6e
-Author: Landon Fuller <landonf@bikemonkey.org>
-Date: Sat Feb 12 10:24:49 2011 -0500
-
- Switch to the current iOS 4.2 SDK.
-
-commit 58fb8ca2dfb89ad70284bb9678d3d4dbb658c8a7
-Merge: cc3fbd9 71c792f
-Author: Landon Fuller <landonf@bikemonkey.org>
-Date: Sat Feb 12 10:23:19 2011 -0500
-
- Merge remote branch 'upstream/master'
-
-commit cc3fbd975ce9366d4c40a6ff6c108f664867bd7c
-Merge: e449a43 f6ab3ed
-Author: Landon Fuller <landonf@bikemonkey.org>
-Date: Sat Feb 12 10:21:02 2011 -0500
-
- Merge branch 'master' of github.com:landonf/libffi-ios
-
-commit e449a43bbe12f8119399928db1ae26adc71dde14
-Author: Landon Fuller <landonf@bikemonkey.org>
-Date: Sat Feb 12 10:20:42 2011 -0500
-
- Allow specification of the minimum supported iOS version.
-
-commit 71c792f51bcf3e2f334e5ea1fb1a8b667cb3aedb
-Author: Anthony Green <green@moxielogic.com>
-Date: Sat Feb 12 09:33:11 2011 -0500
-
- rc4
-
-commit 7c7c9f327299331022f6000603a35f2310dfe308
-Author: Anthony Green <green@moxielogic.com>
-Date: Sat Feb 12 09:29:29 2011 -0500
-
- ungccify parts of the build
-
-commit ed62e48b95a0fa60b685f647cb73c9e190eec35c
-Author: Anthony Green <green@moxielogic.com>
-Date: Fri Feb 11 12:23:58 2011 -0500
-
- Fix permissions
-
-commit 17d9e9e68ddb1b915a0b9751713033861b598575
-Author: Anthony Green <green@moxielogic.com>
-Date: Fri Feb 11 12:23:20 2011 -0500
-
- Use newer autotools. Only build debug.c when --enable-debug.
-
-commit 6972a4ffda75761eaab7dfbe0fb1516b255e8e0c
-Author: Anthony Green <green@moxielogic.com>
-Date: Fri Feb 11 07:32:51 2011 -0500
-
- Fix xlc build on AIX
-
-commit 1833aa0fb9831eb0725b63e35886c0f6d35df480
-Author: Anthony Green <green@moxielogic.com>
-Date: Fri Feb 11 07:11:04 2011 -0500
-
- sparc ABI test fix.
-
-commit f1fb139b4e283fffdcf205a903943d5e9d2bb2a2
-Author: Anthony Green <green@moxielogic.com>
-Date: Wed Feb 9 18:30:02 2011 -0500
-
- Fix tests
-
-commit 5cb470331d181c84d5d621e88868327a324a5898
-Author: Anthony Green <green@moxielogic.com>
-Date: Wed Feb 9 15:23:06 2011 -0500
-
- Fix permissions
-
-commit 269deef6dbbb426695919d3398357fada3bb288c
-Author: Anthony Green <green@moxielogic.com>
-Date: Wed Feb 9 15:22:23 2011 -0500
-
- rc3
-
-commit 42695e72504f647444b8e8e9b90bd24f1e3220e1
-Author: Anthony Green <green@moxielogic.com>
-Date: Wed Feb 9 15:12:35 2011 -0500
-
- Fix IRIX support
-
-commit a6e56b97f62a3feeb3301c24a2e4cae55e546021
-Author: Anthony Green <green@moxielogic.com>
-Date: Wed Feb 9 15:00:42 2011 -0500
-
- Add powerpc64-*-darwin* support
-
-commit 747d6c32d4abb07c10c3a1f93579c3929aaa2487
-Author: Anthony Green <green@moxielogic.com>
-Date: Wed Feb 9 14:56:23 2011 -0500
-
- Add Interix support
-
-commit eab6e41cde382aa07de6c011d514a14c0d62eb47
-Author: Anthony Green <green@moxielogic.com>
-Date: Wed Feb 9 10:15:02 2011 -0500
-
- Remove README.markdown form libffi-ios
-
-commit 69dbe845f4ee3e6ce8999f17a1e4f2179ef7da89
-Author: Anthony Green <green@moxielogic.com>
-Date: Wed Feb 9 07:38:43 2011 -0500
-
- Fix xfails
-
-commit f498318c07b95137fe259d86bdbe15347588b84a
-Author: Anthony Green <green@moxielogic.com>
-Date: Wed Feb 9 06:26:46 2011 -0500
-
- Update README for iOS again
-
-commit 630b9c0ac43c7edcbfd892e23c09fb26724f4ac0
-Author: Anthony Green <green@moxielogic.com>
-Date: Wed Feb 9 06:24:23 2011 -0500
-
- Update to rc2
-
-commit 0cad4386fa4c9ea5f8ca88b16247db4e5c8fea90
-Author: Anthony Green <green@moxielogic.com>
-Date: Wed Feb 9 06:11:46 2011 -0500
-
- Add ChangeLog entry. Fix copyright headers.
-
-commit 09cb76f2645bd2c151846e9249d8ea707ba01e8c
-Author: Anthony Green <green@moxielogic.com>
-Date: Tue Feb 8 20:39:51 2011 -0500
-
- Add missing change
-
-commit 2e3a48ccdd54340983c46a29a0b41985e3e789ac
-Author: Anthony Green <green@moxielogic.com>
-Date: Tue Feb 8 20:37:26 2011 -0500
-
- Fix make dist
-
-commit 5e4814d9928e236a2a4afe84d6e1d4fdaa473206
-Author: Anthony Green <green@moxielogic.com>
-Date: Tue Feb 8 19:46:28 2011 -0500
-
- fix permissions
-
-commit 5c0cc6f1536aa1738795a97303810a823c7fa2cb
-Author: Anthony Green <green@moxielogic.com>
-Date: Tue Feb 8 19:45:59 2011 -0500
-
- 3.0.10rc1
-
-commit 857fe3de46d2286afa2fe772920ecf4aefa1688f
-Author: Anthony Green <green@moxielogic.com>
-Date: Tue Feb 8 19:39:20 2011 -0500
-
- Clean ups
-
-commit e2214f8adb5577c247452e2cc9f4cbe304d7ca9f
-Author: Anthony Green <green@moxielogic.com>
-Date: Tue Feb 8 19:22:56 2011 -0500
-
- Update README
-
-commit 1106229a5721a659da5c231ec0e8211119615394
-Merge: bc9d0be f6ab3ed
-Author: Anthony Green <green@moxielogic.com>
-Date: Tue Feb 8 19:20:09 2011 -0500
-
- Add iOS support
-
-commit bc9d0be2958ce475757f34dd2c878948aa77a39f
-Author: Anthony Green <green@moxielogic.com>
-Date: Tue Feb 8 17:04:26 2011 -0500
-
- 3.0.10rc0 changes
-
-commit 3b836249feae6d08d3e6887486e4b9961ddafa09
-Author: Anthony Green <green@moxielogic.com>
-Date: Tue Feb 8 14:28:59 2011 -0500
-
- Rebase from GCC
-
-commit a26e3940619faeba6de54824c9540c90b1aab513
-Author: Anthony Green <green@moxielogic.com>
-Date: Tue Feb 8 13:56:12 2011 -0500
-
- copyright updates patch
-
-commit b8099539f00e224107594101e9760b6dc081a056
-Author: Anthony Green <green@moxielogic.com>
-Date: Tue Feb 8 13:50:43 2011 -0500
-
- Fix msvcc.sh botch
-
-commit dc411e8f99113a34656bfd2d3ae51259972488cc
-Author: Anthony Green <green@moxielogic.com>
-Date: Tue Feb 8 10:49:29 2011 -0500
-
- Fix HP-UX build
-
-commit 404585d1348e30ac58203bbd876d9131e5aed874
-Author: Anthony Green <green@moxielogic.com>
-Date: Tue Feb 8 10:44:36 2011 -0500
-
- Fix sparc v8 aggregate type returns for sun's compiler
-
-commit 19ce713188e193e4522740d24c20170411883d2d
-Author: Anthony Green <green@moxielogic.com>
-Date: Tue Feb 8 10:34:23 2011 -0500
-
- grammar fix
-
-commit 89284fe55f1a8ad3bddbea796ee00d0e3ba411ce
-Author: Anthony Green <green@moxielogic.com>
-Date: Tue Feb 8 10:19:19 2011 -0500
-
- Fix AIX build with IBM XLC
-
-commit ba022c338af97cb18d9f8ed5a607fd483a61c09c
-Author: Anthony Green <green@moxielogic.com>
-Date: Tue Feb 8 10:12:48 2011 -0500
-
- fix win64-underscore patch
-
-commit 097e5f3924ee92a3ba6cd72f787da8a3eb14fea3
-Author: Anthony Green <green@moxielogic.com>
-Date: Tue Feb 8 10:11:00 2011 -0500
-
- x86 pcrel test part 2
-
-commit ed2c518d960b91d444be74e5a55779a9c4602f3b
-Author: Anthony Green <green@moxielogic.com>
-Date: Tue Feb 8 10:10:07 2011 -0500
-
- x86 pcrel test
-
-commit 0e5843995f46900ef212531281e08b224464f413
-Author: Anthony Green <green@moxielogic.com>
-Date: Tue Feb 8 07:52:40 2011 -0500
-
- Refresh from GCC
-
-commit 5b9cd52784339a42e417174a55e310e214d435f9
-Author: Anthony Green <green@moxielogic.com>
-Date: Mon Nov 22 15:19:57 2010 -0500
-
- win64-underscore patch
-
-commit 2db72615b50eb5c0f29725c02c740a2f0d7fc7d9
-Author: Anthony Green <green@moxielogic.com>
-Date: Sun Nov 21 10:50:56 2010 -0500
-
- Rebase
-
-commit f6ab3edc23dc8fc7c47a31c896044150c23f04b5
-Author: Landon Fuller <landonf@plausible.coop>
-Date: Wed Oct 27 19:34:51 2010 -0400
-
- Include the license header in the generated output.
-
-commit cef619462887fa0f360e3ee702d1e04f112b5b38
-Author: Landon Fuller <landonf@bikemonkey.org>
-Date: Wed Oct 27 13:59:30 2010 -0400
-
- Add missing copyright/license header.
-
-commit 53f387b203413c9aa6e31f49dbb70d37d816330b
-Author: Landon Fuller <landonf@bikemonkey.org>
-Date: Sun Sep 19 19:57:17 2010 -0700
-
- Minor README fix.
-
-commit 4fbcb5b5fbce11f4b168060e00639db33c85b75b
-Author: Landon Fuller <landonf@bikemonkey.org>
-Date: Sun Sep 19 19:50:37 2010 -0700
-
- Minor README fix.
-
-commit 8e7652ef6acab5db7a29f786686a54f05cdbdc7d
-Author: Landon Fuller <landonf@bikemonkey.org>
-Date: Sun Sep 19 19:49:39 2010 -0700
-
- Add a libffi-ios-specific github README.
-
-commit 83038cf24aa1a92b62b91ffee1dcc25d79243484
-Author: Landon Fuller <landonf@bikemonkey.org>
-Date: Sun Sep 19 14:36:45 2010 -0700
-
- Implement FFI_EXEC_TRAMPOLINE_TABLE allocator for iOS/ARM.
-
- This provides working closure support on iOS/ARM devices where
- PROT_WRITE|PROT_EXEC is not permitted. The code passes basic
- smoke tests, but requires further review.
-
-commit b00ff3e98fdde622cef617030e14d5356dff988f
-Author: Landon Fuller <landonf@bikemonkey.org>
-Date: Sun Sep 19 14:22:26 2010 -0700
-
- Rename the generated symbol
-
-commit da2773e02ab26cc11a7fe87e985599f35cdf0649
-Author: Landon Fuller <landonf@bikemonkey.org>
-Date: Sun Sep 19 14:21:37 2010 -0700
-
- Modify the ffi_closure structures to hold table/table entry pointers instead of a code buffer.
-
-commit 01d71b7bed41844f80cb9feef20dcc5ece5ba2d0
-Author: Landon Fuller <landonf@bikemonkey.org>
-Date: Sun Sep 19 14:21:14 2010 -0700
-
- Regenerated the autoconf script
-
-commit 19afda0069c42e51c81dca7b10a5cf884b4cdce0
-Author: Landon Fuller <landonf@bikemonkey.org>
-Date: Sun Sep 19 14:20:52 2010 -0700
-
- Enable AC_SUBST for FFI_EXEC_TRAMPOLINE_TABLE
-
-commit 9e1196444e78aef20028c18891f44ebe39a815fd
-Author: Landon Fuller <landonf@bikemonkey.org>
-Date: Sun Sep 19 10:43:06 2010 -0700
-
- Add a hard-coded FFI_EXEC_TRAMPOLINE_TABLE arm implementation.
-
- This implements support for re-mapping a shared table of executable
- trampolines directly in front of a writable configuration page, working
- around PROT_WRITE restrictions for sandboxed applications on Apple's
- iOS.
-
- This implementation is for testing purposes; a proper allocator is still
- necessary, and ARM-specific code needs to be moved out of
- src/closures.c.
-
-commit f38364b399184e682fc3e785084bd497827bc5af
-Author: Landon Fuller <landonf@bikemonkey.org>
-Date: Sun Sep 19 10:42:36 2010 -0700
-
- Fix symbol prefix for ffi_closure_SYSV_inner on Darwin.
-
-commit 36849e7716b77aa25e4175d1f4be1b93dbf47aac
-Author: Landon Fuller <landonf@bikemonkey.org>
-Date: Sun Sep 19 09:35:04 2010 -0700
-
- Whitespace/comment fixes.
-
-commit b764162526854686e579a48b6ac5981f4eb886a3
-Author: Landon Fuller <landonf@bikemonkey.org>
-Date: Sun Sep 19 09:04:34 2010 -0700
-
- Fix the script name (build-iphone.sh -> build-ios.sh)
-
-commit a3d9aa85013341451ea97766485b7a11852d32b2
-Author: Landon Fuller <landonf@bikemonkey.org>
-Date: Sun Sep 19 09:03:52 2010 -0700
-
- Update the autogenerated autoconf/automake files.
-
-commit c71480eaf839f26bbdfcd8965f65ac4d8defddc0
-Author: Landon Fuller <landonf@bikemonkey.org>
-Date: Sun Sep 19 09:02:05 2010 -0700
-
- Update automake/autoconf to conditionally build src/arm/trampoline.S if FFI_EXEC_TRAMPOLINE_TABLE is enabled.
-
-commit 9af9291b73bc5e27ecd949bec8157f20426d65b8
-Author: Landon Fuller <landonf@bikemonkey.org>
-Date: Sun Sep 19 08:52:33 2010 -0700
-
- Add the trampoline table generated by gentramp.sh
-
-commit 68ce0c383ece84f69945d1c8c3fed03f7f9cb5d6
-Author: Landon Fuller <landonf@bikemonkey.org>
-Date: Sun Sep 19 08:38:19 2010 -0700
-
- Add a shell script that generates the ARM trampoline page.
-
- This generates a page of 340 trampolines, aligned within one page. The
- trampolines use pc-relative addressing to reference config data
- (context, jump address) from a page placed directly prior to the
- trampoline page. This can be used on systems -- such as iOS -- that do not
- support writable, executable memory by remapping the executable page
- containing the trampolines directly above a newly allocated writable
- config page.
-
-commit 75af086be8830a8eafe9b1ebda199d788bcb0c62
-Author: Landon Fuller <landonf@bikemonkey.org>
-Date: Sat Sep 18 18:12:19 2010 -0700
-
- Update autoconf files
-
-commit 1ac92cca9b02ef8d6a769f0de1adccd5c9630355
-Author: Landon Fuller <landonf@bikemonkey.org>
-Date: Sat Sep 18 18:08:14 2010 -0700
-
- Add autoconf check for W^X platforms that require a trampoline table.
-
- This adds the FFI_EXEC_TRAMPOLINE_TABLE. The flag is enabled for
- arm-apple-darwin, where PROT_EXEC on writable (or formerly writable) pages is
- not permitted for sandboxed binaries.
-
-commit be72fbab29b7190c702d8e1ac3d149855e95879d
-Author: Landon Fuller <landonf@bikemonkey.org>
-Date: Sat Sep 18 18:02:25 2010 -0700
-
- Use the correct host triple for arm/darwin
-
-commit 70150bdf4509269965c72f2032bf74f285767afe
-Author: Landon Fuller <landonf@bikemonkey.org>
-Date: Sat Sep 18 16:38:03 2010 -0700
-
- Add missing UNWIND entry; disables .pad on non-EABI targets.
-
-commit 6b452bafaec498df975ba8ac4c99de174e5f74f7
-Author: Landon Fuller <landonf@bikemonkey.org>
-Date: Sat Sep 18 16:21:32 2010 -0700
-
- Apple assembler support; fixed most gas/ELF-isms.
-
-commit 8ddac835b6f8b54ede764d0ea977dee4c82e2d67
-Author: Landon Fuller <landonf@bikemonkey.org>
-Date: Sat Sep 18 15:38:06 2010 -0700
-
- Fix placement of the __APPLE__ macro.
-
-commit 69043d02936bb0579ac59b4ee1ed8dec38c38db7
-Author: Landon Fuller <landonf@bikemonkey.org>
-Date: Sat Sep 18 15:32:08 2010 -0700
-
- Work-around libffi's FP ABI detection.
-
- On iOS, we must use the AAPCS floating point return value calling
- conventions. libffi's ARM implementation will only use these conventions
- if __SOFTFP__ is defined, which is not the case when GCC's
- -mfloat-abi defaults to 'softfp' instead of 'soft'. To work around this
- we manually define __SOFTFP__ for Apple platforms in the ARM-specific
- sysv.S.
-
- See also:
- http://developer.apple.com/library/ios/#documentation/Xcode/Conceptual/iPhoneOSABIReference/Introduction/Introduction.html
- http://infocenter.arm.com/help/topic/com.arm.doc.ihi0042d/IHI0042D_aapcs.pdf
-
-commit a82e6c354ea805114642a6e440abd0832cb1d23f
-Author: Landon Fuller <landonf@bikemonkey.org>
-Date: Sat Sep 18 14:44:24 2010 -0700
-
- Add a stub iOS build script to drive autoconf
-
-commit 84e8de6e9fc19388f6f1102c013b7d0d52940ecc
-Author: Anthony Green <green@moxielogic.com>
-Date: Fri Aug 6 01:35:12 2010 -0400
-
- Restore execute permissions
-
-commit 3aeecc9eb1a6feba6549849cdd335c926415a4fc
-Author: Anthony Green <green@moxielogic.com>
-Date: Thu Aug 5 15:19:00 2010 -0400
-
- Fix win64-struct-args patch
-
-commit 00d0b59cd13f89ab8b44bd894eb7f0a131fcb472
-Author: Anthony Green <green@moxielogic.com>
-Date: Thu Aug 5 14:56:53 2010 -0400
-
- Fix debug build for windows
-
-commit bda487e87064f27965155459a62dc52a744778d0
-Author: Anthony Green <green@moxielogic.com>
-Date: Thu Aug 5 09:02:41 2010 -0400
-
- Don't use -safeseh with ml64
-
-commit c1d28ba8d5029795af313ffeb81c97efc6d4c847
-Author: Anthony Green <green@moxielogic.com>
-Date: Thu Aug 5 08:48:16 2010 -0400
-
- stdcall-x86-closure-fix
-
-commit 5feacad4a56c85b3f23a267a30b2cf424cd59548
-Author: Anthony Green <green@moxielogic.com>
-Date: Thu Aug 5 08:30:04 2010 -0400
-
- define generic symbols carefully
-
-commit 10ea848900bc3018ac213cef52b44cacbe5cbebc
-Author: Anthony Green <green@moxielogic.com>
-Date: Thu Aug 5 08:24:27 2010 -0400
-
- don't copy win64 struct args
-
-commit d14178be4c49c3ada44a9fe9efe11d444372ddab
-Author: Anthony Green <green@moxielogic.com>
-Date: Fri Jul 23 09:14:00 2010 -0400
-
- FFI_LAST_ABI fix
-
-commit 3f5b1375ab1e2b8e3d593e21b27097a4a50f9b83
-Author: Anthony Green <green@moxielogic.com>
-Date: Mon Jul 12 14:39:18 2010 -0400
-
- rebase
-
-commit eaf444eabc4c78703c0f98ac0197b1619c1b1bef
-Author: Anthony Green <green@moxielogic.com>
-Date: Sat Jul 10 08:59:09 2010 -0400
-
- Fix selinux test
-
-commit 630974152247f100ece4d44f10c3721bb4599fbf
-Author: Anthony Green <green@gmachine.(none)>
-Date: Wed May 5 20:14:56 2010 -0400
-
- Micharl Kohler's spelling fixes
-
-commit 9dc9a293f3d4589fcaf02dd4288c8cebaefa508e
-Author: Anthony Green <green@gmachine.(none)>
-Date: Tue Apr 13 10:33:52 2010 -0400
-
- Rebase to latest GCC sources
-
-commit f2c2a4fce9b3eca9f39b4f3545118bc256da4a73
-Author: Anthony Green <green@gmachine.(none)>
-Date: Tue Apr 13 10:19:28 2010 -0400
-
- Remove warnings and add OS/2 support
-
-commit c0b69e57d529e33d18b658cc5572a21e3663247c
-Author: Anthony Green <green@gmachine.(none)>
-Date: Tue Mar 30 08:30:22 2010 -0400
-
- Dan Witte's windows build fixes.
-
-commit 59a259f4d348f593b45f452309f4d020a28051c4
-Author: Anthony Green <green@gmachine.(none)>
-Date: Mon Mar 15 05:57:51 2010 -0400
-
- Remove junk file
-
-commit 3de1eb36d37a66829e606421939874d0d60d816d
-Author: Anthony Green <green@gmachine.(none)>
-Date: Mon Mar 15 05:57:24 2010 -0400
-
- fix-comments patch
-
-commit c3813b6d7f8a777700f4c5862190c0db148d4de8
-Author: Anthony Green <green@gmachine.(none)>
-Date: Tue Jan 26 16:48:56 2010 -0500
-
- Rebuild Makefiles with automake 1.11.1 for CVE-2009-4029.
-
-commit 8d27f68baa365bf883b6053c5f6bc819646d5434
-Author: Anthony Green <green@gmachine.(none)>
-Date: Fri Jan 15 11:35:37 2010 -0500
-
- Mention recent changes in README
-
-commit ff3cd68b8cf2d9a28cad7aa9beff46236eacec8c
-Author: Anthony Green <green@gmachine.(none)>
-Date: Fri Jan 15 11:27:24 2010 -0500
-
- Add msvc.sh wrapper
-
-commit cadeba6cb53414a1253582f1719c286665de7b6c
-Author: Anthony Green <green@gmachine.(none)>
-Date: Fri Jan 15 10:46:51 2010 -0500
-
- Microsoft Visual C port
-
-commit 0739e7dc00db766eb64f502ec4137b817638c9a1
-Author: Anthony Green <green@gmachine.(none)>
-Date: Fri Jan 15 09:48:33 2010 -0500
-
- Add x86 Sun Studio compiler support
-
-commit edfdfd2e85b8d01d2455934f1d7f4d7eb2f3cf1c
-Author: Anthony Green <green@gmachine.(none)>
-Date: Wed Jan 13 02:56:19 2010 -0500
-
- Add closure example doc
-
-commit 7b7a42f221cf171e8d09df34cac6dc1fd8458cc3
-Author: Anthony Green <green@gmachine.(none)>
-Date: Tue Jan 12 09:14:14 2010 -0500
-
- Rebase from GCC
-
-commit 4b18d1f73dc7733137869e4ab5725cb90c1c8fde
-Author: Anthony Green <green@gmachine.(none)>
-Date: Fri Jan 1 10:24:27 2010 -0500
-
- Add x86-64 MingW to README
-
-commit c3042afaf3f84abbbe9c91bf9bc9896b0d9eb003
-Author: Anthony Green <green@gmachine.(none)>
-Date: Fri Jan 1 08:08:02 2010 -0500
-
- Reset quilt patches post 3.0.9 merge with GCC
-
-commit b0304e9679bdfec6ac45a57b5c96542697249418
-Author: Anthony Green <green@gmachine.(none)>
-Date: Thu Dec 31 11:32:40 2009 -0500
-
- Update version
-
-commit 2e7e03d014d9c9bf40e97ce75cba089ad052fa6b
-Author: Anthony Green <green@gmachine.(none)>
-Date: Thu Dec 31 07:43:22 2009 -0500
-
- Final updates before 3.0.9
-
-commit aea706c52825c8eee677ffa7fdbdd3aed1725492
-Author: Anthony Green <green@gmachine.(none)>
-Date: Tue Dec 29 10:09:31 2009 -0500
-
- really 3.0.9rc12
-
-commit 0cfe60e9d13f132b88995cfee41f2156344f6fa2
-Author: Anthony Green <green@gmachine.(none)>
-Date: Tue Dec 29 10:06:04 2009 -0500
-
- 3.0.9rc12
-
-commit 14e2e92e8645804b6940b3e96c98e9f7f384a6b2
-Author: Anthony Green <green@gmachine.(none)>
-Date: Sun Dec 27 21:03:33 2009 -0500
-
- 3.0.9rc11
-
-commit 884402787bf8eaf7ec207085037cf8ace2f660ec
-Author: Anthony Green <green@gmachine.(none)>
-Date: Sat Dec 26 12:57:23 2009 -0500
-
- HPUX support and avr32 test fixes.
-
-commit 01c78756aff22efb1f122f8e93e068d7bf2185c7
-Author: Anthony Green <green@gmachine.(none)>
-Date: Sat Dec 26 10:05:18 2009 -0500
-
- 3.0.9rc9
-
-commit 70868464651320268d79c6894db5a50fdc11032a
-Author: Anthony Green <green@gmachine.(none)>
-Date: Sat Dec 26 09:58:03 2009 -0500
-
- Remove xfails for mips and arm
-
-commit 838d4ad920ec85cf5ca3b511221d67f6d9a99024
-Author: Anthony Green <green@gmachine.(none)>
-Date: Sat Dec 26 09:57:27 2009 -0500
-
- Remove a bunch of xfails.
-
-commit 7e37eaaf772f48906e69618c773b0a36c3927de9
-Author: Anthony Green <green@gmachine.(none)>
-Date: Sat Dec 26 07:46:50 2009 -0500
-
- Fix huge_struct for solaris
-
-commit 07cc7a37194bc34064ebed7f2724333a798411c8
-Author: Anthony Green <green@gmachine.(none)>
-Date: Sat Dec 26 07:23:04 2009 -0500
-
- 3.0.9rc8
-
-commit 2b9be16ffabc81326128bc1bbdddff8ddc5d13d3
-Author: Anthony Green <green@gmachine.(none)>
-Date: Sat Dec 26 07:04:45 2009 -0500
-
- 3.0.9rc8
-
-commit 9458d88f676e9a21ab8993a54e16754b11687419
-Author: Anthony Green <green@gmachine.(none)>
-Date: Sat Dec 26 07:02:27 2009 -0500
-
- Rebase from GCC
-
-commit 6a3412417593f068a04dc6163f4269cb295ad5ca
-Author: Anthony Green <green@gmachine.(none)>
-Date: Sat Dec 26 06:51:33 2009 -0500
-
- Add Andreas Schwab's powerpc fix
-
-commit 39c8792ece1043f41f4c395a2ce71f4cf0ff4674
-Author: Anthony Green <green@gmachine.(none)>
-Date: Fri Dec 25 21:52:28 2009 -0500
-
- 3.0.9rc7
-
-commit 1d04af52e3e24db69f742064694c22f8df5cc70e
-Author: Anthony Green <green@gmachine.(none)>
-Date: Fri Dec 25 09:50:36 2009 -0500
-
- Updated some mips XFAILs
-
-commit 26e9509c9b7929bc4fcf697071699051a652b1fd
-Author: Anthony Green <green@gmachine.(none)>
-Date: Fri Dec 25 02:19:23 2009 -0500
-
- Clean up ChangeLog.libffi for older patches.
-
-commit 9c157d3215e4393777f83eb6fa801df6528f40d7
-Author: Anthony Green <green@gmachine.(none)>
-Date: Fri Dec 25 02:15:40 2009 -0500
-
- Clean up undefine_AC_ARG_VAR_PRECIOUS patch.
-
-commit d22de05b0bfc480766bc1240615ce2830eee71b8
-Author: Anthony Green <green@gmachine.(none)>
-Date: Fri Dec 25 02:04:23 2009 -0500
-
- Fix patches
-
-commit 1fe3dc7c20dc4dbd8fed0d19c8618027d44ed971
-Author: Anthony Green <green@gmachine.(none)>
-Date: Fri Dec 25 01:39:00 2009 -0500
-
- Add windows support patch.
-
-commit f7c0bc613a88f7dbc2d18b345c10fa438833c170
-Author: Anthony Green <green@gmachine.(none)>
-Date: Fri Dec 25 01:22:11 2009 -0500
-
- 3.0.9rc6
-
-commit c7fa2da8260258c11ab1dc7ac06fb611a2c1b50f
-Author: Anthony Green <green@gmachine.(none)>
-Date: Thu Dec 24 07:22:44 2009 -0500
-
- 3.0.9rc6
-
-commit da11bece0fde66fc0268db3a01207dda857e25d2
-Author: Anthony Green <green@gmachine.(none)>
-Date: Thu Dec 24 05:34:46 2009 -0500
-
- Release 3.0.9rc5
-
-commit e3399b11edeab546b066bfc18574f3edb905d0dc
-Author: Anthony Green <green@gmachine.(none)>
-Date: Thu Dec 24 01:09:32 2009 -0500
-
- Update README
-
-commit 115ab36fceee69740a01ce49bc27e1908cc237b1
-Author: Anthony Green <green@gmachine.(none)>
-Date: Thu Dec 24 00:22:00 2009 -0500
-
- Update missing changes for 3.0.9r4.
-
-commit f8c7a245bf5a80bd7e730ec03fcad17c8dcfcb07
-Author: Anthony Green <green@gmachine.(none)>
-Date: Wed Dec 23 23:46:22 2009 -0500
-
- Switch to quilt. Rebase to latest GCC.
-
-commit ce806772f02387b9a74f6496a263a368bccd5d59
-Merge: cd98813 dcc1f6b
-Author: Anthony Green <green@moxielogic.com>
-Date: Mon Oct 5 00:41:35 2009 -0400
-
- Merge branch 'master' of git@github.com:atgreen/libffi
-
-commit dcc1f6b4f1ffd2713bf68b791a13f85d455c8b1b
-Author: Anthony Green <green@moxielogic.com>
-Date: Mon Oct 5 00:29:33 2009 -0400
-
- More clean up.
-
-commit 2829f5941a223b9d851d8ab6318318e6197d7e01
-Author: Anthony Green <green@moxielogic.com>
-Date: Mon Oct 5 00:28:03 2009 -0400
-
- Clean up
-
-commit cd98813de517ea64041637e3e78d27a001d6d3b4
-Author: Anthony Green <green@moxielogic.com>
-Date: Mon Oct 5 00:25:29 2009 -0400
-
- From Jens Rehsack. Fix for 64-bit AIX.
-
-commit e4a91de766acc47f6c50f13cc11719a65e23ecba
-Author: Anthony Green <green@moxielogic.com>
-Date: Mon Oct 5 00:16:17 2009 -0400
-
- From Abdulaziz Ghuloum. Adds special case for Snow Leopard.
-
-commit 3425a763bcdaadb8b430226f427ec833afdcc96a
-Author: Anthony Green <green@moxielogic.com>
-Date: Sun Oct 4 23:57:29 2009 -0400
-
- Fix detection of free/openbsd. From Alexis Ballier.
-
-commit 2340e7a777902de61499d47823ad8d5e0eeb6203
-Author: Anthony Green <green@moxielogic.com>
-Date: Sun Oct 4 23:53:17 2009 -0400
-
- AVR support
-
-commit 5cbe2058c128e848446ae79fe15ee54260a90559
-Author: Anthony Green <green@moxielogic.com>
-Date: Sun Oct 4 23:53:11 2009 -0400
-
- Initial stand-alone patch.
-
-commit c6dddbd02bad9654ed58cdb0feb360934d105dec
-Author: Anthony Green <green@moxielogic.com>
-Date: Sun Oct 4 08:11:33 2009 -0400
-
- Initial commit
-
-commit 5ffc0c37486fb1538bccc0ca7acc807d4f1af932
-Author: Anthony Green <green@moxielogic.com>
-Date: Sun Oct 4 07:58:22 2009 -0400
-
- Update version to 3.0.9rc1. Add more useful things to .gitignore.
-
-commit bd29f83ee9f6fa6b65adee9d3f57834f364d9887
-Author: Anthony Green <green@moxielogic.com>
-Date: Tue Sep 29 12:07:26 2009 -0400
-
- Add .gitignore
-
-commit 9474f853f83e3f0167c1b306177321bfcc93e56d
-Author: Anthony Green <green@moxielogic.com>
-Date: Tue Sep 29 11:13:02 2009 -0400
-
- Remove old CVSROOT files.
-
-commit 0c25275ec24bfe2c2c25a000465f0950ef9dd51b
-Author: twall <twall>
-Date: Wed Aug 19 12:57:34 2009 +0000
-
- Apply Dave Korn's cygwin/GCC changes
-
-commit 39228c27ed3f677a95b46380a8d31602b5777e1a
-Author: aph <aph>
-Date: Tue Jun 16 18:00:47 2009 +0000
-
- 2009-06-16 Wim Lewis <wiml@hhhh.org>
-
- * src/powerpc/ffi.c: Avoid clobbering cr3 and cr4, which are
- supposed to be callee-saved.
- * src/powerpc/sysv.S (small_struct_return_value): Fix overrun of
- return buffer for odd-size structs.
-
-commit 5e93cc704d127c2c8ae7f5d2cef621145d43e777
-Author: aph <aph>
-Date: Tue Jun 16 17:41:47 2009 +0000
-
- 2009-06-16 Andreas Tobler <a.tobler@schweiz.org>
-
- PR libffi/40444
- * testsuite/lib/libffi-dg.exp (libffi_target_compile): Add
- allow_stack_execute for Darwin.
-
-commit b509af8959dc371b92392c623522ea6f4946a71d
-Author: aph <aph>
-Date: Tue Jun 16 16:17:52 2009 +0000
-
- 2009-06-16 Andrew Haley <aph@redhat.com>
-
- * configure.ac (TARGETDIR): Add missing blank lines.
- * configure: Regenerate.
-
-commit d57e96dc56ee76fbbb9b59d73aeaa92354db5ecb
-Author: aph <aph>
-Date: Tue Jun 16 09:59:02 2009 +0000
-
- 2009-06-16 Andrew Haley <aph@redhat.com>
-
- * testsuite/libffi.call/cls_align_sint64.c,
- testsuite/libffi.call/cls_align_uint64.c,
- testsuite/libffi.call/cls_longdouble_va.c,
- testsuite/libffi.call/cls_ulonglong.c,
- testsuite/libffi.call/return_ll1.c,
- testsuite/libffi.call/stret_medium2.c: Fix printf format
- specifiers.
- * testsuite/libffi.call/huge_struct.c: Ad x86 XFAILs.
- * testsuite/libffi.call/float2.c: Fix dg-excess-errors.
- * testsuite/libffi.call/ffitest.h,
- testsuite/libffi.special/ffitestcxx.h (PRIdLL, PRIuLL): Define.
-
-commit b01d6d1982c9e020507029bfd5a58a8c60d111fa
-Author: aph <aph>
-Date: Tue Jun 16 09:44:54 2009 +0000
-
- 2009-06-16 Andrew Haley <aph@redhat.com>
-
- * testsuite/libffi.call/err_bad_typedef.c: xfail everywhere.
- * testsuite/libffi.call/err_bad_abi.c: Likewise.
-
-commit 35b6ded138591900a88055a8a8ac1fadc29a76d6
-Author: aph <aph>
-Date: Fri Jun 12 15:29:20 2009 +0000
-
- 2009-06-11 Kaz Kojima <kkojima@gcc.gnu.org>
-
- * testsuite/libffi.call/cls_longdouble_va.c: Add xfail sh*-*-linux-*.
- * testsuite/libffi.call/err_bad_abi.c: Add xfail sh*-*-*.
- * testsuite/libffi.call/err_bad_typedef.c: Likewise.
-
-commit acc46605f2d95d67d69398e7644610f10a157ce3
-Author: aph <aph>
-Date: Fri Jun 12 14:21:28 2009 +0000
-
- 2009-06-12 Andrew Haley <aph@redhat.com>
-
- * ChangeLog.libffi: testsuite/libffi.call/cls_align_sint64.c,
- testsuite/libffi.call/cls_align_uint64.c,
- testsuite/libffi.call/cls_ulonglong.c,
- testsuite/libffi.call/return_ll1.c,
- testsuite/libffi.call/stret_medium2.c: Fix printf format
- specifiers.
- testsuite/libffi.special/unwindtest.cc: include stdint.h.
-
-commit 16d1996ed0797bd7c11aca2b0fe7e7748751aaf6
-Author: twall <twall>
-Date: Thu Jun 11 14:27:42 2009 +0000
-
- update changelog
-
-commit 92a515c33efe91be3cb0258f01c63aff208489c7
-Author: twall <twall>
-Date: Thu Jun 11 14:27:28 2009 +0000
-
- use ffi_closure_alloc instead of stack-based closure
-
-commit e4363160ba9e50167f9ca0a7399d537a1d2cd0ce
-Author: twall <twall>
-Date: Thu Jun 11 14:26:23 2009 +0000
-
- remove unused extern
-
-commit 1dc2781d2ba38f5f000ff70069d617fb21e1d2af
-Author: twall <twall>
-Date: Thu Jun 11 11:36:16 2009 +0000
-
- remove not-yet-applied changelog entries
-
-commit bb27735fe689dac97ec0dc847ed8d3d519620109
-Author: twall <twall>
-Date: Wed Jun 10 10:42:36 2009 +0000
-
- add win64 support
-
-commit b2a54c100c74854a409820817d54617fdda39eb8
-Author: aph <aph>
-Date: Mon Jun 8 16:50:49 2009 +0000
-
- 2009-06-08 Andrew Haley <aph@redhat.com>
-
- * testsuite/libffi.call/err_bad_abi.c: Add xfails.
- * testsuite/libffi.call/cls_longdouble_va.c: Add xfails.
- * testsuite/libffi.call/cls_dbls_struct.c: Add xfail x86_64-*-linux-*.
- * testsuite/libffi.call/err_bad_typedef.c: Add xfails.
-
- * testsuite/libffi.call/stret_medium2.c: Add __UNUSED__ to args.
- * testsuite/libffi.call/stret_medium.c: Likewise.
- * testsuite/libffi.call/stret_large2.c: Likewise.
- * testsuite/libffi.call/stret_large.c: Likewise.
-
-commit 25723e7141f73d3736d7244b980c89d97db852b6
-Author: aph <aph>
-Date: Fri Jun 5 13:03:40 2009 +0000
-
- 2009-06-05 Andrew Haley <aph@redhat.com>
-
- * src/x86/win32.S (_ffi_closure_STDCALL): Import from gcc.
-
-commit 70758199c7cd41f411987360ccb302b497a56dc9
-Author: aph <aph>
-Date: Thu Jun 4 16:29:58 2009 +0000
-
- 2009-06-04 Andrew Haley <aph@redhat.com>
-
- * src/powerpc/ffitarget.h: Fix misapplied merge from gcc.
-
-commit e8bb12563f9aa23ddf36fa6a5b92b16b5c3e1a7f
-Author: aph <aph>
-Date: Thu Jun 4 14:59:18 2009 +0000
-
- 2009-06-04 Andrew Haley <aph@redhat.com>
-
- * src/mips/o32.S,
- src/mips/n32.S: Fix licence formatting.
-
-commit d66a8e32c3671479e3ce0f6819673e5932ba6b7f
-Author: aph <aph>
-Date: Thu Jun 4 14:43:40 2009 +0000
-
- 2009-06-04 Andrew Haley <aph@redhat.com>
-
- * src/x86/darwin.S: Fix licence formatting.
- src/x86/win32.S: Likewise.
- src/sh64/sysv.S: Likewise.
- src/sh/sysv.S: Likewise.
-
-commit 7c3b7fd6b5db746b5b09a718f3044f811372f941
-Author: aph <aph>
-Date: Thu Jun 4 14:39:20 2009 +0000
-
- 2009-06-04 Andrew Haley <aph@redhat.com>
-
- * src/sh64/ffi.c: Remove lint directives. Was missing from merge
- of Andreas Tobler's patch from 2006-04-22.
-
-commit 1a2f93a8b362db13638afd9fcb3f2650180bfa17
-Author: aph <aph>
-Date: Thu Jun 4 10:45:51 2009 +0000
-
- 2009-06-04 Andrew Haley <aph@redhat.com>
-
- * src/sh/ffi.c: Apply missing hunk from Alexandre Oliva's patch of
- 2007-03-07.
-
-commit 944c95cf7aaaaf7c5fa368cda4673dd38f45020e
-Author: aph <aph>
-Date: Wed Jun 3 17:42:56 2009 +0000
-
- 2009-05-22 Dave Korn <dave.korn.cygwin@gmail.com>
-
- * src/x86/win32.S (_ffi_closure_STDCALL): New function.
- (.eh_frame): Add FDE for it.
-
- 2009-05-22 Dave Korn <dave.korn.cygwin@gmail.com>
-
- * configure.ac: Also check if assembler supports pc-relative
- relocs on X86_WIN32 targets.
- * configure: Regenerate.
- * src/x86/win32.S (ffi_prep_args): Declare extern, not global.
- (_ffi_call_SYSV): Add missing function type symbol .def and
- add EH markup labels.
- (_ffi_call_STDCALL): Likewise.
- (_ffi_closure_SYSV): Likewise.
- (_ffi_closure_raw_SYSV): Likewise.
- (.eh_frame): Add hand-crafted EH data.
-
- 2008-11-21 Eric Botcazou <ebotcazou@adacore.com>
-
- * src/sparc/ffi.c (ffi_prep_cif_machdep): Add support for
- signed/unsigned int8/16 return values.
- * src/sparc/v8.S (ffi_call_v8): Likewise.
- (ffi_closure_v8): Likewise.
-
- 2008-03-26 Kaz Kojima <kkojima@gcc.gnu.org>
-
- * src/sh/sysv.S: Add .note.GNU-stack on Linux.
- * src/sh64/sysv.S: Likewise.
-
- 2008-03-26 Daniel Jacobowitz <dan@debian.org>
-
- * src/arm/sysv.S: Fix ARM comment marker.
-
-commit 00fa972430bb1535a4b34bf029ebcad500027b0c
-Author: twall <twall>
-Date: Sat Dec 27 16:59:05 2008 +0000
-
- properly glob-match
-
-commit f5179e6794ac35af26fe86e468b8508a7a570c55
-Author: twall <twall>
-Date: Fri Dec 26 19:06:28 2008 +0000
-
- Mark XFAIL on longdouble tests for x86_64/mingw
-
-commit 80e2b5a749208c8a18f994ec5bee84594d051cc8
-Author: twall <twall>
-Date: Mon Dec 22 15:21:15 2008 +0000
-
- clean up tests for win64 use
-
-commit 7063d9996f742576095c7b0eb5016c0f9a670aec
-Author: green <green>
-Date: Fri Dec 19 16:13:46 2008 +0000
-
- Version 3.0.8 with x86-solaris support
-
-commit bdfeb13f0df0a63b19d62597517237b54d92228b
-Author: green <green>
-Date: Fri Dec 19 15:47:44 2008 +0000
-
- Bump to 3.0.7
-
-commit 69205de17d6ac4c11d4ba92d6a5b40a0c5f246b2
-Author: green <green>
-Date: Thu Jul 24 18:03:48 2008 +0000
-
- Many test fixes (failures due to excessive compiler warnings).
-
-commit 260d513fea00b3613fe957a44a157fe72c4ca29e
-Author: green <green>
-Date: Thu Jul 17 13:13:52 2008 +0000
-
- Version 3.0.6. sh/sh64 fixes.
-
-commit 3704031875feabb74e3655ed03cff4c2b3c76ac6
-Author: green <green>
-Date: Thu Apr 3 18:57:57 2008 +0000
-
- Rev 3.0.5.
-
-commit 8406f5f48f7f58a1c982a93a95d521cf82b3241f
-Author: green <green>
-Date: Thu Apr 3 18:57:34 2008 +0000
-
- 3.0.5
-
-commit 23a9e73212b62f9684cedb0ce70e92c59cfdaffa
-Author: green <green>
-Date: Wed Mar 5 00:07:02 2008 +0000
-
- 2008-03-04 Anthony Green <green@redhat.com>
- Blake Chaffin
- hos@tamanegi.org
-
- * testsuite/libffi.call/cls_align_longdouble_split2.c
- testsuite/libffi.call/cls_align_longdouble_split.c
- testsuite/libffi.call/cls_dbls_struct.c
- testsuite/libffi.call/cls_double_va.c
- testsuite/libffi.call/cls_longdouble.c
- testsuite/libffi.call/cls_longdouble_va.c
- testsuite/libffi.call/cls_pointer.c
- testsuite/libffi.call/cls_pointer_stack.c
- testsuite/libffi.call/err_bad_abi.c
- testsuite/libffi.call/err_bad_typedef.c
- testsuite/libffi.call/huge_struct.c
- testsuite/libffi.call/stret_large2.c
- testsuite/libffi.call/stret_large.c
- testsuite/libffi.call/stret_medium2.c
- testsuite/libffi.call/stret_medium.c: New tests from Apple.
-
-commit 429e37d3ad653e52e75bf725c883ab79e859f89a
-Author: green <green>
-Date: Thu Feb 28 04:50:19 2008 +0000
-
- clicky
-
-commit 51e79c428348c033314f54bcb30f7e388c59e347
-Author: green <green>
-Date: Thu Feb 28 04:47:35 2008 +0000
-
- getclicky
-
-commit affcab04e280efeace45a72c4dc6152c0e4f1b7f
-Author: green <green>
-Date: Tue Feb 26 19:01:53 2008 +0000
-
- 2008-02-26 Jakub Jelinek <jakub@redhat.com>
- Anthony Green <green@redhat.com>
-
- * src/alpha/osf.S: Add .note.GNU-stack on Linux.
- * src/s390/sysv.S: Likewise.
- * src/powerpc/linux64.S: Likewise.
- * src/powerpc/linux64_closure.S: Likewise.
- * src/powerpc/ppc_closure.S: Likewise.
- * src/powerpc/sysv.S: Likewise.
- * src/x86/unix64.S: Likewise.
- * src/x86/sysv.S: Likewise.
- * src/sparc/v8.S: Likewise.
- * src/sparc/v9.S: Likewise.
- * src/m68k/sysv.S: Likewise.
- * src/ia64/unix.S: Likewise.
- * src/arm/sysv.S: Likewise.
-
-commit 59689d5522c159a3ac967adb6b891cf5f22c890f
-Author: green <green>
-Date: Tue Feb 26 17:40:51 2008 +0000
-
- 2008-02-26 Anthony Green <green@redhat.com>
- Thomas Heller <theller@ctypes.org>
-
- * src/x86/ffi.c (ffi_closure_SYSV_inner): Change C++ comment to C
- comment.
-
-commit b13c84cf4668828ff8429ba4a2f94cd1eb574ae0
-Author: green <green>
-Date: Tue Feb 26 17:38:15 2008 +0000
-
- 2008-02-26 Anthony Green <green@redhat.org>
- Thomas Heller <theller@ctypes.org>
-
- * include/ffi.h.in: Change void (*)() to void (*)(void).
-
-commit 265289f679ffd24a88ae1aa2cef0e4aa14703cd8
-Author: green <green>
-Date: Tue Feb 26 17:34:36 2008 +0000
-
- 2008-02-26 Anthony Green <green@spindazzle.org>
-
- * src/alpha/ffi.c: Change void (*)() to void (*)(void).
- src/alpha/osf.S, src/arm/ffi.c, src/frv/ffi.c, src/ia64/ffi.c,
- src/ia64/unix.S, src/java_raw_api.c, src/m32r/ffi.c,
- src/mips/ffi.c, src/pa/ffi.c, src/pa/hpux32.S, src/pa/linux.S,
- src/powerpc/ffi.c, src/powerpc/ffi_darwin.c, src/raw_api.c,
- src/s390/ffi.c, src/sh/ffi.c, src/sh64/ffi.c, src/sparc/ffi.c,
- src/x86/ffi.c, src/x86/unix64.S, src/x86/darwin64.S,> src/x86/ffi64.c: Ditto.
-
-commit fb5036cd6d0f909918e90f7d2d9fd80d46682d5d
-Author: green <green>
-Date: Sun Feb 24 17:25:25 2008 +0000
-
- fix date
-
-commit 40bec108e7d0181e6c9928aa7a33187bcc0f3d6f
-Author: green <green>
-Date: Sun Feb 24 17:25:02 2008 +0000
-
- New release
-
-commit b922048fa82ea109a4af269ee47bbc2a586bbac2
-Author: green <green>
-Date: Sun Feb 24 17:24:00 2008 +0000
-
- 2008-02-24 Anthony Green <green@spindazzle.org>
-
- * configure.ac: Accept openbsd*, not just openbsd.
- Bump version to 3.0.4.
- * configure, doc/stamp-vti, doc/version.texi: Rebuilt.
- * libtool-version: Increment revision.
- * README: Update for new release.
-
-commit affca4b92d06e5554784c7e9b233029ef83f7d8a
-Author: green <green>
-Date: Fri Feb 22 21:53:29 2008 +0000
-
- sync readme with web page.
-
-commit 3e53d8752ea74859b4c64fbbf935e62a937c4d78
-Author: green <green>
-Date: Fri Feb 22 21:52:38 2008 +0000
-
- New release
-
-commit 4d92f6c8e78fe084be65f3e8b58b859901ba796d
-Author: green <green>
-Date: Fri Feb 22 21:49:46 2008 +0000
-
- 2008-02-22 Anthony Green <green@redhat.com>
-
- * configure.ac: Bump version to 3.0.3.
- * configure, doc/stamp-vti, doc/version.texi: Rebuilt.
- * libtool-version: Increment revision.
- * README: Update for new release. Clean up test docs.
-
-commit 0e185fa11a01f816824ba2687ed3715ab6219bef
-Author: green <green>
-Date: Fri Feb 22 21:43:18 2008 +0000
-
- Update configure script.
-
-commit f73986bd211cfbbaa593d1309504d0dc68626191
-Author: green <green>
-Date: Fri Feb 22 21:40:53 2008 +0000
-
- 2008-02-22 Bjoern Koenig <bkoenig@alpha-tierchen.de>
- Andreas Tobler <a.tobler@schweiz.org>
-
- * configure.ac: Add amd64-*-freebsd* target.
- * configure: Regenerate.
-
-commit 0208f68fe5de30c33e7f70ebc281635917013f5a
-Author: green <green>
-Date: Fri Feb 22 21:15:44 2008 +0000
-
- 2008-02-22 Thomas Heller <theller@ctypes.org>
-
- * configure.ac: Add x86 OpenBSD support.
- * configure: Rebuilt.
-
-commit 01adb0e638a86cf0d5e668ed8e08be9b0cd2505f
-Author: green <green>
-Date: Thu Feb 21 16:17:26 2008 +0000
-
- Fix README.
-
-commit 1edd4563225981a14f7d4fb9919b1ed88e38082f
-Author: green <green>
-Date: Thu Feb 21 13:39:01 2008 +0000
-
- 3.0.2
-
-commit c9b542800864e2204db6e83f3843a17813ba6165
-Author: green <green>
-Date: Thu Feb 21 13:36:43 2008 +0000
-
- add missing file
-
-commit d5fa5633d5c8d3c212a2267cfa38fba4091baa2c
-Author: green <green>
-Date: Thu Feb 21 13:36:19 2008 +0000
-
- 2008-02-21 Anthony Green <green@redhat.com>
-
- * configure.ac: Bump version to 3.0.2.
- * configure, doc/stamp-vti, doc/version.texi: Rebuilt.
- * libtool-version: Increment revision.
- * README: Update for new release.
-
- 2008-02-21 Björn König <bkoenig@alpha-tierchen.de>
-
- * src/x86/freebsd.S: New file.
- * configure.ac: Add x86 FreeBSD support.
- * Makefile.am: Ditto.
-
-commit ac35bfc6fcadd8880c1efce36724820f9074b318
-Author: green <green>
-Date: Sat Feb 16 01:03:56 2008 +0000
-
- Updated
-
-commit f7942975fee7b0162647dd79e2652615b737e98e
-Author: green <green>
-Date: Sat Feb 16 01:02:00 2008 +0000
-
- 2008-02-15 Anthony Green <green@redhat.com>
-
- * configure.ac: Bump version to 3.0.1.
- * configure, doc/stamp-vti, doc/version.texi: Rebuilt.
- * libtool-version: Increment revision.
- * README: Update for new release.
-
- 2008-02-15 David Daney <ddaney@avtrex.com>
-
- * src/mips/ffi.c: Remove extra '>' from include directive.
- (ffi_prep_closure_loc): Use clear_location instead of tramp.
-
-commit 59aa6bb1bfc86a610ac1a8b123443efd75854dd1
-Author: green <green>
-Date: Fri Feb 15 20:52:26 2008 +0000
-
- Add more platforms.
-
-commit 45a45ab99074448be0ae1a8d2ade50d28b60f8de
-Author: green <green>
-Date: Fri Feb 15 19:16:36 2008 +0000
-
- 3.0 notes
-
-commit 4db74cbea888c9f1251b85baf00d99b83d3b994d
-Author: green <green>
-Date: Fri Feb 15 19:10:26 2008 +0000
-
- Update
-
-commit c3e1101ffabf44d8a2ee46e03ba9ab582050a825
-Author: green <green>
-Date: Fri Feb 15 18:43:40 2008 +0000
-
- 2008-02-15 Anthony Green <green@redhat.com>
-
- * configure.ac: Bump version to 3.0.0,
- * configure, doc/stamp-vti, doc/version.texi: Rebuilt.
-
- 2008-02-15 David Daney <ddaney@avtrex.com>
-
- * src/mips/ffi.c (USE__BUILTIN___CLEAR_CACHE):
- Define (conditionally), and use it to include cachectl.h.
- (ffi_prep_closure_loc): Fix cache flushing.
- * src/mips/ffitarget.h (_ABIN32, _ABI64, _ABIO32): Define.
-
-commit 7e0cc12e9233ad285db41ce8dbdda61ed2a7fb06
-Author: green <green>
-Date: Fri Feb 15 15:51:03 2008 +0000
-
- New release
-
-commit 2d7dc885ec40d53866f29984d595511942c8b686
-Author: green <green>
-Date: Fri Feb 15 15:30:26 2008 +0000
-
- * man/ffi_call.3, man/ffi_prep_cif.3, man/ffi.3:
- Update dates and remove all references to ffi_prep_closure.
- * configure.ac: Bump version to 2.99.9.
- * configure, doc/stamp-vti, doc/version.texi: Rebuilt.
-
-commit a0525f03eeaaed33b1eac80e0c016455cee3615d
-Author: green <green>
-Date: Fri Feb 15 15:14:30 2008 +0000
-
- New release.
-
-commit 2b30dfb3146ee26ad956d00ee05eb835ca1a95b4
-Author: green <green>
-Date: Fri Feb 15 15:12:43 2008 +0000
-
- * man/ffi_prep_closure.3: Delete.
- * man/Makefile.am (EXTRA_DIST): Remove ffi_prep_closure.3.
- (man_MANS): Ditto.
- * man/Makefile.in: Rebuilt.
- * configure.ac: Bump version to 2.99.8.
- * configure, doc/stamp-vti, doc/version.texi: Rebuilt.
-
-commit bf41e64840ebcb6cc31a6f028253c1fde82705d8
-Author: green <green>
-Date: Fri Feb 15 01:56:50 2008 +0000
-
- Update.
-
-commit 4d39ddee677bbb61d621893b91e11eac5e7c4af7
-Author: green <green>
-Date: Fri Feb 15 01:24:06 2008 +0000
-
- * configure.ac: Bump version to 2.99.7.
- * configure, doc/stamp-vti, doc/version.texi: Rebuilt.
- * include/ffi.h.in LICENSE src/debug.c src/closures.c
- src/ffitest.c src/s390/sysv.S src/s390/ffitarget.h
- src/types.c src/m68k/ffitarget.h src/raw_api.c src/frv/ffi.c
- src/frv/ffitarget.h src/sh/ffi.c src/sh/sysv.S
- src/sh/ffitarget.h src/powerpc/ffitarget.h src/pa/ffi.c
- src/pa/ffitarget.h src/pa/linux.S src/java_raw_api.c
- src/cris/ffitarget.h src/x86/ffi.c src/x86/sysv.S
- src/x86/unix64.S src/x86/win32.S src/x86/ffitarget.h
- src/x86/ffi64.c src/x86/darwin.S src/ia64/ffi.c
- src/ia64/ffitarget.h src/ia64/ia64_flags.h src/ia64/unix.S
- src/sparc/ffi.c src/sparc/v9.S src/sparc/ffitarget.h
- src/sparc/v8.S src/alpha/ffi.c src/alpha/ffitarget.h
- src/alpha/osf.S src/sh64/ffi.c src/sh64/sysv.S
- src/sh64/ffitarget.h src/mips/ffi.c src/mips/ffitarget.h
- src/mips/n32.S src/mips/o32.S src/arm/ffi.c src/arm/sysv.S
- src/arm/ffitarget.h src/prep_cif.c: Update license text.
-
-commit d58b032b41a12bd3d72148da6822ab59dd698ff9
-Author: green <green>
-Date: Fri Feb 15 00:59:25 2008 +0000
-
- New release
-
-commit 91e5478df6d5ac63efbb10f025807b4606afab56
-Author: green <green>
-Date: Fri Feb 15 00:50:30 2008 +0000
-
- Update supported platforms. Bump version.
-
-commit bd0768f877c8f7fd0d36af2191b203d4d057b1ce
-Author: green <green>
-Date: Fri Feb 15 00:45:33 2008 +0000
-
- * configure.ac: Bump version to 2.99.5.
- * configure: Rebuilt.
- * Makefile.am (EXTRA_DIST): Add darwin64.S
- * Makefile.in: Rebuilt.
- * testsuite/lib/libffi-dg.exp: Remove libstdc++ bits from GCC tree.
- * LICENSE: Update WARRANTY.
-
-commit 49d345f767bd2cfee951bceaab6a1a07986cf293
-Author: green <green>
-Date: Thu Feb 14 23:43:27 2008 +0000
-
- update license reference
-
-commit 12ac48fc79b515db7c9accd9fcaa87b0dcefccdb
-Author: green <green>
-Date: Thu Feb 14 23:42:08 2008 +0000
-
- Update WARRANTY
-
-commit 6b91c41da87e78552f2990dfc504a0a3349f340b
-Author: green <green>
-Date: Thu Feb 14 23:38:27 2008 +0000
-
- fix tarball reference
-
-commit 2b59579e3533334bee4788e076b4e520c2ab518c
-Author: green <green>
-Date: Thu Feb 14 23:35:58 2008 +0000
-
- First update in 5 years!
-
-commit 6cbdf3f3a3777a93382a2d508ddef1c353ff0955
-Author: green <green>
-Date: Thu Feb 14 22:44:06 2008 +0000
-
- Fix .pc file bug and bump version
-
-commit 1d1dc81104b209df3cfef0840735c59efae2f655
-Author: green <green>
-Date: Thu Feb 14 22:03:37 2008 +0000
-
- Add man files and info file. Update README. Tag as 2.99.3.
-
-commit f045a2367f793fa8b01534cf2e25bcc46afc8fa1
-Author: tromey <tromey>
-Date: Thu Feb 14 20:46:57 2008 +0000
-
- Move entry from ChangeLog to ChangeLog.libffi
-
-commit 6257f07d1a9efd27fa83639cfba281f5d3188731
-Author: tromey <tromey>
-Date: Thu Feb 14 20:33:17 2008 +0000
-
- * aclocal.m4, Makefile.in, configure, fficonfig.h.in: Rebuilt.
- * mdate-sh, texinfo.tex: New files.
- * Makefile.am (info_TEXINFOS): New variable.
- * doc/libffi.texi: New file.
- * doc/version.texi: Likewise.
-
-commit 4232af563c5509c3760a33e3684a2b958be755e1
-Author: green <green>
-Date: Thu Feb 14 16:19:21 2008 +0000
-
- * Makefile.am (AM_CFLAGS): Don't compile with -D.
- (lib_LTLIBRARIES): Define.
- (toolexeclib_LIBRARIES): Undefine.
- * Makefile.in: Rebuilt.
- * configure.ac: Reset version to 2.99.1.
- * configure.in: Rebuilt.
-
-commit 961543615c31f092b578a4b4cda914db64f9d0fa
-Author: green <green>
-Date: Thu Feb 14 15:57:40 2008 +0000
-
- Fix typo.
-
-commit aeb0abab87222f637fbf352d4effd3b76b52ed26
-Author: green <green>
-Date: Thu Feb 14 15:54:27 2008 +0000
-
- * libffi.pc.in: Usse @PACKAGE_NAME@ and @PACKAGE_VERSION@.
- * configure.ac: Reset version to 2.99.1.
- * configure.in: Rebuilt.
- * Makefile.am (EXTRA_DIST): Add ChangeLog.libffi.
- * Makefile.in: Rebuilt.
- * LICENSE: Update copyright notice.
-
-commit 77fe243556433eae119d8bd7469bfccdd5bd8a1a
-Author: green <green>
-Date: Thu Feb 14 15:37:00 2008 +0000
-
- Fix make dist again
-
-commit d4970cf4529459bf0f0e43c602cac396786c6802
-Author: green <green>
-Date: Thu Feb 14 15:18:56 2008 +0000
-
- Fix make dist
-
-commit f0b1462f2d3024922ad71421bd5c4311fcb16da5
-Author: green <green>
-Date: Thu Feb 14 15:01:41 2008 +0000
-
- Use pkgconfig. Increment libtool CURRENT version.
-
-commit 27e52f33baa069012a5adb2a3807f9ca1f2165ab
-Author: green <green>
-Date: Sun Feb 3 13:59:48 2008 +0000
-
- Fix header installs when using DESTDIR.
-
-commit fadab28eb6e33fb6dcdd7b9323e147142216d548
-Author: twall <twall>
-Date: Sun Feb 3 12:32:22 2008 +0000
-
- update changelog
-
-commit b5e44c8dfa92c87b99762c303cf5574a16db8f27
-Author: twall <twall>
-Date: Sun Feb 3 01:12:32 2008 +0000
-
- offset from code base address, not data base address
-
-commit f359848d1a995c0e44566d815f218729dc996e22
-Author: green <green>
-Date: Fri Feb 1 21:29:43 2008 +0000
-
- Fix header installs.
-
-commit c30df49e157c7bfc8e19e3f8a72b9464fe225e54
-Author: green <green>
-Date: Fri Feb 1 21:13:55 2008 +0000
-
- Revert my broken changes to twall's patch.
-
-commit 675561bb9aa0732c76698df10dd3007b5d0ec759
-Author: green <green>
-Date: Thu Jan 31 13:44:25 2008 +0000
-
- Fix make dist .
-
-commit abc0bbf3813dc43e23d4c23e6fe794dbf287639b
-Author: green <green>
-Date: Thu Jan 31 11:58:57 2008 +0000
-
- Add Tim Wall's x86 windows patch.
-
-commit e332366d15a31198735b593ec8f7fc0558d783b8
-Author: green <green>
-Date: Wed Jan 30 13:21:02 2008 +0000
-
- Add HJ's -fomit-frame-pointer struct return fix
-
-commit d4204240392af5b7750a08671b08e9c22dff5e93
-Author: green <green>
-Date: Wed Jan 30 12:42:34 2008 +0000
-
- Clean up for new automake.
-
-commit f4932dd020df574637c9fb3fc1bb18e5a8f304cc
-Author: green <green>
-Date: Wed Jan 30 12:40:25 2008 +0000
-
- Fixes to run testsuite
-
-commit 085520ddc8db6a916bfc416b871fcb2d00074d40
-Author: green <green>
-Date: Tue Jan 29 15:16:43 2008 +0000
-
- New files from gcc tree.
-
-commit 77175b3f7234e4875a4ef554ed1fe9fdc4133794
-Author: green <green>
-Date: Tue Jan 29 15:15:20 2008 +0000
-
- Latest gcc svn sources
-
-commit 2544e45a0b2b634053df02da3a2ed9680eeed2a1
-Author: green <green>
-Date: Tue Jan 29 14:28:13 2008 +0000
-
- Install ffitarget.h in $prefix/include.
-
-commit 6002211b1cc4daeb587d054b4f83968bda2c981e
-Author: green <green>
-Date: Tue Jan 29 12:30:10 2008 +0000
-
- Add new files.
-
-commit ccabd2b16be883cd03e5f0cd88ccfdd6ca39239d
-Author: green <green>
-Date: Tue Jan 29 12:28:15 2008 +0000
-
- Merge from gcc
-
-commit e680ecfbfca1da8d1823e48bc89b8375e66e128b
-Author: tromey <tromey>
-Date: Sun Dec 24 23:12:15 2006 +0000
-
- Pulled in libffi from gcc trunk.
- Fixed build and install for standalone use.
-
-commit e7ba08965942ce872fdbc69f70f9848cc3d0bad6
-Author: root <root>
-Date: Sun Jun 4 23:22:24 2006 +0000
-
- sourcware.org
-
-commit 0cd4aa24e21aaa964dfbdebc25ec5c8188049375
-Author: root <root>
-Date: Sun May 30 01:51:57 2004 +0000
-
- Add LockDir
-
-commit 5826120fbd940d26cca76ed2522187505581e1ed
-Author: green <green>
-Date: Tue Nov 4 06:09:08 2003 +0000
-
- Add link to Gianni's web site.
-
-commit 220aa4b27db42d7ffaac5056000d5179f00d5ea3
-Author: jsm <jsm>
-Date: Tue Jan 21 08:07:42 2003 +0000
-
- Newer, better, increased from before! (list of acceptable anon usernames)
-
-commit 1c3adc892cc1403dc4d3d7003a2385899836612e
-Author: green <green>
-Date: Fri Dec 6 01:28:03 2002 +0000
-
- Fixed Cygnus references.
-
-commit 4af66bb62fab9a8e318af3bf01e5486596a0c8d4
-Author: green <green>
-Date: Sun Oct 21 19:18:42 2001 +0000
-
- Testsuite fixes.
-
-commit 5435965f9015ce40584c98d3816c3d05e7de1d21
-Author: green <green>
-Date: Mon Apr 23 00:32:03 2001 +0000
-
- * include/ffi_common.h: Delete, after moving contents to...
- * include/ffi_private.h: Subsume contents of ffi_common.h.
- * include/Makefile.am (noinst_HEADERS): Remove ffi_common.h.
- * include/Makefile.in: Rebuilt.
- * arm/ffi.c, m68k/ffi.c, mips/ffi.c, powerpc/ffi.c, s390/ffi.c,
- ia64/ffi.c: Include ffi_private.h, not ffi_common.h.
- * alpha/ffi.c, sparc/ffi.c, x86/ffi.c: Don't include ffi_common.h.
- * types.c, raw_api.c, java_raw_api.c, prep_cif.c: Don't include
- ffi_common.h.
- * debug.c: Include ffi_private.h instead of ffi_common.h.
-
- * mips/ffi.c (calc_n32_struct_flags): Make static.
- (FIX_ARGP): Remove call to debugging routine ffi_stop_here.
-
- * mips/n32.S: Include ffi_private.h.
- * mips/o32.S: Include ffi_private.h.
-
-commit 6fdb7de0fe3b7385e1fd78812ae69d9b3069d994
-Author: green <green>
-Date: Sun Apr 22 19:38:34 2001 +0000
-
- * README: Update some comments.
-
- * Makefile.am (SUBDIRS): Add include so ffi.h gets installed.
- * Makefile.in: Rebuilt.
-
- * include/ffi.h: Change ALPHA to __alpha__ and SPARC to __sparc__.
- * types.c: Ditto.
- * prep_cif.c (ffi_prep_cif): Ditto.
-
- * alpha/ffi.c, alpha/osf.S, sparc/ffi.c, sparc/v8.S, sparc/v9.S:
- Include ffi_private.h.
-
- * include/ffi_private.h (FFI_TYPE_LAST): Define.
-
-commit bc7144b01b9707ef35f1a2e3e6996e005e82953a
-Author: green <green>
-Date: Sun Apr 22 18:28:36 2001 +0000
-
- Moved files from old home
-
-commit e57279831e20368c1aa1d2b35462b8629be73959
-Author: green <green>
-Date: Sun Apr 22 18:23:47 2001 +0000
-
- These are dead.
-
-commit 7247436b5fe71767b29dc02b4da0fe18b08082e6
-Author: green <green>
-Date: Sun Apr 22 18:22:43 2001 +0000
-
- All these files live somewhere else now.
-
-commit a8b0d40ff908e275028f676870c31d0d70274a98
-Author: green <green>
-Date: Sun Apr 22 18:17:14 2001 +0000
-
- Many changes. Not quite there yet.
-
-commit f893d2273355710a290a26faebf5f12c3a34d0e3
-Author: green <green>
-Date: Sun Apr 22 18:13:22 2001 +0000
-
- Moved m68k files
-
-commit 688ddfeced89cbb9d37b53005e1f7f2b9c78a8d7
-Author: green <green>
-Date: Sun Apr 22 18:12:33 2001 +0000
-
- New, target indepentent, header
-
-commit f9e40776d488d5ecf43b3ae21444a1a2f6eca528
-Author: green <green>
-Date: Sun Apr 22 18:11:57 2001 +0000
-
- Many changes.
-
-commit 8c1d2eb47f6bc314c431b75c85c107e8e43c4a76
-Author: green <green>
-Date: Sun Apr 22 18:10:47 2001 +0000
-
- Many changes
-
-commit 1359dfc6582680a158b3caa3efb7a368da4aa12d
-Author: green <green>
-Date: Sun Apr 22 18:10:20 2001 +0000
-
- Moved ia64 files
-
-commit 6e2de5eee316a4579869aff50c7c5f6f478582d8
-Author: green <green>
-Date: Sun Apr 22 18:08:11 2001 +0000
-
- Moved arm files
-
-commit 8807355af34cba8ffe87aee51152dfccec2771fa
-Author: green <green>
-Date: Mon Apr 9 00:58:38 2001 +0000
-
- Many many updates. Merge from gcc and then some.
-
-commit f7e9f91adec4ff1c2e7a13b3de81d2c5a3f55e7e
-Author: green <green>
-Date: Mon Apr 17 03:32:37 2000 +0000
-
- Mnay fixes.
-
-commit c4860de618f4956283f5c8230a2544e403dfe390
-Author: green <green>
-Date: Mon Apr 17 03:18:46 2000 +0000
-
- Merge from libgcj. Merged patches from net. See ChangeLog for details.
-
-commit c578b58314990c3853429297c38ba14015fec5fa
-Author: jsm <jsm>
-Date: Sat Oct 9 20:18:16 1999 +0000
-
- 1999-10-09 Jason Molenda (jsm@bugshack.cygnus.com)
-
- * CVSROOT/auto_checkout, CVSROOT/commit_prep, CVSROOT/log_accum:
- Deleted; generic versions now used for all repositories.
-
- * CVSROOT/commitinfo, CVSROOT/loginfo: Change pathnames to
- generic versions.
-
- * CVSROOT/checkoutlist: Don't try to check out the removed
- files any longer.
-
-commit acdb20051207fed7652dd9f122f65de5458c474c
-Author: jsm <jsm>
-Date: Sat Oct 9 20:18:15 1999 +0000
-
- 1999-10-09 Jason Molenda (jsm@bugshack.cygnus.com)
-
- * CVSROOT/auto_checkout, CVSROOT/commit_prep, CVSROOT/log_accum:
- Deleted; generic versions now used for all repositories.
-
- * CVSROOT/commitinfo, CVSROOT/loginfo: Change pathnames to
- generic versions.
-
- * CVSROOT/checkoutlist: Don't try to check out the removed
- files any longer.
-
-commit e75be655ceedf7ab24c4e99d75eec9efeb979bc7
-Author: green <green>
-Date: Sun Aug 8 13:16:41 1999 +0000
-
- New configury
-
-commit d6669a0dd5b266005325bbf6d5a8ff34574d809e
-Author: green <green>
-Date: Sun Aug 8 13:05:12 1999 +0000
-
- * include/ffi.h.in: Try to work around messy header problem
- with PACKAGE and VERSION.
-
- * configure: Rebuilt.
- * configure.in: Change version to 2.00-beta.
-
- * fficonfig.h.in: Rebuilt.
- * acconfig.h (FFI_NO_STRUCTS, FFI_NO_RAW_API): Define.
-
- * src/x86/ffi.c (ffi_raw_call): Rename.
-
-commit 4819d52b007934a40d6d29a75ee30e857c4a93ae
-Author: green <green>
-Date: Wed Aug 4 18:02:34 1999 +0000
-
- New file for Kresten's closure work
-
-commit 2dbf801eb427cbf5021a9e1e512b5fc523524700
-Author: green <green>
-Date: Wed Aug 4 18:00:05 1999 +0000
-
- Kresten's closure work. Initial checkin.
-
-commit d170961701b0f2bf7e824d7caba2ebe10002ed84
-Author: green <green>
-Date: Thu Jul 8 14:36:52 1999 +0000
-
- * configure.in: Add x86 and powerpc BeOS configurations.
- From Makoto Kato <m_kato@ga2.so-net.ne.jp>.
-
-commit c7747d976924ec6f2229cbcfbbdb98d364e10de9
-Author: jsm <jsm>
-Date: Wed May 12 23:32:16 1999 +0000
-
- 1999-05-12 Jason Molenda (jsm@bugshack.cygnus.com)
- * index.html: Add links to libffi* mail list archives.
-
-commit dd2aa9a8de22e26df3bbc85d068358641f6202f7
-Author: green <green>
-Date: Thu May 6 05:34:36 1999 +0000
-
- * configure.in: Add warning about this being beta code.
- Remove src/Makefile.am from the picture.
- * configure: Rebuilt.
- * Makefile.am: Move logic from src/Makefile.am. Add changes
- to support libffi as a target library.
- * Makefile.in: Rebuilt.
- * aclocal.m4, config.guess, config.sub, ltconfig, ltmain.sh:
- Upgraded to new autoconf, automake, libtool.
- * README: Tweaks.
- * LICENSE: Update copyright date.
- * src/Makefile.am, src/Makefile.in: Removed.
-
-commit 4e9452abed58a3058ccdb446f96a29d50dda1f34
-Author: green <green>
-Date: Wed May 5 22:06:13 1999 +0000
-
- Updated to new automake, libtool, autoconf - nothing works :-)
-
-commit 6d3b2bddaf4967fba8b8656c01bfc77ec0f2800c
-Author: jsm <jsm>
-Date: Mon Apr 26 15:55:28 1999 +0000
-
- 1999-04-26 Jason Molenda (jsm@bugshack.cygnus.com)
- * index.html: Missed a reference to libffi-discuss@cygnus.com. Fixed.
-
-commit ebc6a9c28af831d3d187af8ff17319f0f309bd98
-Author: jsm <jsm>
-Date: Mon Apr 26 15:53:29 1999 +0000
-
- 1999-04-26 Jason Molenda (jsm@bugshack.cygnus.com)
- * index.html: Change links to ftp directory to point to sourceware
- directory.
- Change mailing list subscription forms to point to sourceware lists.
-
-commit 78ffc52a8b257061348c576ccb6fbbf8b48b0fff
-Author: jsm <jsm>
-Date: Sun Apr 18 01:33:21 1999 +0000
-
- Standard sourceware setup.
-
-commit b4d77e827d7ebef7e57ebcd71e71c15c62f1e0a8
-Author: jsm <jsm>
-Date: Mon Nov 30 11:11:25 1998 +0000
-
- Small typeo. (I wouldn't bother except that it made the sentence hard
- for me to parse on a casual read.)
-
-commit bfb73f08fdc987e37070c5fb0b196fbd28872888
-Author: jsm <jsm>
-Date: Mon Nov 30 10:44:55 1998 +0000
-
- A few cleanups. Most notably, point to the correct subscribe cgi-bin
- script.
-
-commit af8b7f037ccee3b7939ee226a1a2bbc2f057b35c
-Author: green <green>
-Date: Mon Nov 30 06:20:05 1998 +0000
-
- * index.html: Reformatted and updated to reflect hosting on
- sourceware.cygnus.com (new mailing lists, etc).
-
-commit 334f0b060942aff8d26badaf7dde7830450dc5da
-Author: green <green>
-Date: Sun Nov 29 16:56:12 1998 +0000
-
- initial snapshot of documentation
-
-commit 3ab5cb4a1dcc7ecd7e773c97582b0099976c4753
-Author: green <green>
-Date: Sun Nov 29 16:56:10 1998 +0000
-
- Initial revision
-
-commit d2a9eb5a8b7cbc8b769809cad59c82b975c178e2
-Merge: d3782ec bc75c54
-Author: green <green>
-Date: Sun Nov 29 16:48:16 1998 +0000
-
- This commit was generated by cvs2svn to compensate for changes in r7, which
- included commits to RCS files with non-trunk default branches.
-
-commit bc75c54bd311658005b065f1bf201b204c81cbca
-Author: green <green>
-Date: Sun Nov 29 16:48:16 1998 +0000
-
- Import of v1 code.
-
-commit d3782ec8160c644421dcea17b605fec6e328f14e
-Author: jsm <jsm>
-Date: Fri Nov 20 20:18:00 1998 +0000
-
- Send commit messages to mailing lists.
-
-commit 8d8d3843c484c2bb70d8375b2b799f75eb03f709
-Author: jsm <jsm>
-Date: Thu Oct 1 22:08:36 1998 +0000
-
- initial checkin
-
-commit 49634f3bf221cc1939abafc788f7e4e31293fe73
-Author: jsm <jsm>
-Date: Thu Oct 1 22:08:35 1998 +0000
-
- Add standard setup.
-
-commit c64a84c7693f8cd400fb94bba3c9bcfd9ad1fc36
-Author: jsm <jsm>
-Date: Thu Oct 1 22:08:34 1998 +0000
-
- Add readers and standard modules file.
-
-commit 9813273b07fd082da573b3b6bfb8d23809b59eea
-Author: jsm <jsm>
-Date: Thu Oct 1 22:08:33 1998 +0000
-
- initial checkin
diff --git a/Modules/_ctypes/libffi/ChangeLog.libffi b/Modules/_ctypes/libffi/ChangeLog.libffi
deleted file mode 100644
index 49ba8dad3a..0000000000
--- a/Modules/_ctypes/libffi/ChangeLog.libffi
+++ /dev/null
@@ -1,584 +0,0 @@
-2011-02-08 Andreas Tobler <andreast@fgznet.ch>
-
- * testsuite/lib/libffi.exp: Tweak for stand-alone mode.
-
-2009-12-25 Samuli Suominen <ssuominen@gentoo.org>
-
- * configure.ac: Undefine _AC_ARG_VAR_PRECIOUS for autoconf 2.64.
- * configure: Rebuilt.
- * fficonfig.h.in: Rebuilt.
-
-2009-06-16 Andrew Haley <aph@redhat.com>
-
- * testsuite/libffi.call/cls_align_sint64.c,
- testsuite/libffi.call/cls_align_uint64.c,
- testsuite/libffi.call/cls_longdouble_va.c,
- testsuite/libffi.call/cls_ulonglong.c,
- testsuite/libffi.call/return_ll1.c,
- testsuite/libffi.call/stret_medium2.c: Fix printf format
- specifiers.
- * testsuite/libffi.call/huge_struct.c: Ad x86 XFAILs.
- * testsuite/libffi.call/float2.c: Fix dg-excess-errors.
- * testsuite/libffi.call/ffitest.h,
- testsuite/libffi.special/ffitestcxx.h (PRIdLL, PRIuLL): Define.
-
-2009-06-12 Andrew Haley <aph@redhat.com>
-
- * testsuite/libffi.call/cls_align_sint64.c,
- testsuite/libffi.call/cls_align_uint64.c,
- testsuite/libffi.call/cls_ulonglong.c,
- testsuite/libffi.call/return_ll1.c,
- testsuite/libffi.call/stret_medium2.c: Fix printf format
- specifiers.
- testsuite/libffi.special/unwindtest.cc: include stdint.h.
-
-2009-06-11 Timothy Wall <twall@users.sf.net>
-
- * Makefile.am,
- configure.ac,
- include/ffi.h.in,
- include/ffi_common.h,
- src/closures.c,
- src/dlmalloc.c,
- src/x86/ffi.c,
- src/x86/ffitarget.h,
- src/x86/win64.S (new),
- README: Added win64 support (mingw or MSVC)
- * Makefile.in,
- include/Makefile.in,
- man/Makefile.in,
- testsuite/Makefile.in,
- configure,
- aclocal.m4: Regenerated
- * ltcf-c.sh: properly escape cygwin/w32 path
- * man/ffi_call.3: Clarify size requirements for return value.
- * src/x86/ffi64.c: Fix filename in comment.
- * src/x86/win32.S: Remove unused extern.
-
- * testsuite/libffi.call/closure_fn0.c,
- testsuite/libffi.call/closure_fn1.c,
- testsuite/libffi.call/closure_fn2.c,
- testsuite/libffi.call/closure_fn3.c,
- testsuite/libffi.call/closure_fn4.c,
- testsuite/libffi.call/closure_fn5.c,
- testsuite/libffi.call/closure_fn6.c,
- testsuite/libffi.call/closure_stdcall.c,
- testsuite/libffi.call/cls_12byte.c,
- testsuite/libffi.call/cls_16byte.c,
- testsuite/libffi.call/cls_18byte.c,
- testsuite/libffi.call/cls_19byte.c,
- testsuite/libffi.call/cls_1_1byte.c,
- testsuite/libffi.call/cls_20byte.c,
- testsuite/libffi.call/cls_20byte1.c,
- testsuite/libffi.call/cls_24byte.c,
- testsuite/libffi.call/cls_2byte.c,
- testsuite/libffi.call/cls_3_1byte.c,
- testsuite/libffi.call/cls_3byte1.c,
- testsuite/libffi.call/cls_3byte2.c,
- testsuite/libffi.call/cls_4_1byte.c,
- testsuite/libffi.call/cls_4byte.c,
- testsuite/libffi.call/cls_5_1_byte.c,
- testsuite/libffi.call/cls_5byte.c,
- testsuite/libffi.call/cls_64byte.c,
- testsuite/libffi.call/cls_6_1_byte.c,
- testsuite/libffi.call/cls_6byte.c,
- testsuite/libffi.call/cls_7_1_byte.c,
- testsuite/libffi.call/cls_7byte.c,
- testsuite/libffi.call/cls_8byte.c,
- testsuite/libffi.call/cls_9byte1.c,
- testsuite/libffi.call/cls_9byte2.c,
- testsuite/libffi.call/cls_align_double.c,
- testsuite/libffi.call/cls_align_float.c,
- testsuite/libffi.call/cls_align_longdouble.c,
- testsuite/libffi.call/cls_align_longdouble_split.c,
- testsuite/libffi.call/cls_align_longdouble_split2.c,
- testsuite/libffi.call/cls_align_pointer.c,
- testsuite/libffi.call/cls_align_sint16.c,
- testsuite/libffi.call/cls_align_sint32.c,
- testsuite/libffi.call/cls_align_sint64.c,
- testsuite/libffi.call/cls_align_uint16.c,
- testsuite/libffi.call/cls_align_uint32.c,
- testsuite/libffi.call/cls_align_uint64.c,
- testsuite/libffi.call/cls_dbls_struct.c,
- testsuite/libffi.call/cls_double.c,
- testsuite/libffi.call/cls_double_va.c,
- testsuite/libffi.call/cls_float.c,
- testsuite/libffi.call/cls_longdouble.c,
- testsuite/libffi.call/cls_longdouble_va.c,
- testsuite/libffi.call/cls_multi_schar.c,
- testsuite/libffi.call/cls_multi_sshort.c,
- testsuite/libffi.call/cls_multi_sshortchar.c,
- testsuite/libffi.call/cls_multi_uchar.c,
- testsuite/libffi.call/cls_multi_ushort.c,
- testsuite/libffi.call/cls_multi_ushortchar.c,
- testsuite/libffi.call/cls_pointer.c,
- testsuite/libffi.call/cls_pointer_stack.c,
- testsuite/libffi.call/cls_schar.c,
- testsuite/libffi.call/cls_sint.c,
- testsuite/libffi.call/cls_sshort.c,
- testsuite/libffi.call/cls_uchar.c,
- testsuite/libffi.call/cls_uint.c,
- testsuite/libffi.call/cls_ulonglong.c,
- testsuite/libffi.call/cls_ushort.c,
- testsuite/libffi.call/err_bad_abi.c,
- testsuite/libffi.call/err_bad_typedef.c,
- testsuite/libffi.call/float2.c,
- testsuite/libffi.call/huge_struct.c,
- testsuite/libffi.call/nested_struct.c,
- testsuite/libffi.call/nested_struct1.c,
- testsuite/libffi.call/nested_struct10.c,
- testsuite/libffi.call/nested_struct2.c,
- testsuite/libffi.call/nested_struct3.c,
- testsuite/libffi.call/nested_struct4.c,
- testsuite/libffi.call/nested_struct5.c,
- testsuite/libffi.call/nested_struct6.c,
- testsuite/libffi.call/nested_struct7.c,
- testsuite/libffi.call/nested_struct8.c,
- testsuite/libffi.call/nested_struct9.c,
- testsuite/libffi.call/problem1.c,
- testsuite/libffi.call/return_ldl.c,
- testsuite/libffi.call/return_ll1.c,
- testsuite/libffi.call/stret_large.c,
- testsuite/libffi.call/stret_large2.c,
- testsuite/libffi.call/stret_medium.c,
- testsuite/libffi.call/stret_medium2.c,
- testsuite/libffi.special/unwindtest.cc: use ffi_closure_alloc instead
- of checking for MMAP. Use intptr_t instead of long casts.
-
-2009-06-04 Andrew Haley <aph@redhat.com>
-
- * src/powerpc/ffitarget.h: Fix misapplied merge from gcc.
-
-2009-06-04 Andrew Haley <aph@redhat.com>
-
- * src/mips/o32.S,
- src/mips/n32.S: Fix licence formatting.
-
-2009-06-04 Andrew Haley <aph@redhat.com>
-
- * src/x86/darwin.S: Fix licence formatting.
- src/x86/win32.S: Likewise.
- src/sh64/sysv.S: Likewise.
- src/sh/sysv.S: Likewise.
-
-2009-06-04 Andrew Haley <aph@redhat.com>
-
- * src/sh64/ffi.c: Remove lint directives. Was missing from merge
- of Andreas Tobler's patch from 2006-04-22.
-
-2009-06-04 Andrew Haley <aph@redhat.com>
-
- * src/sh/ffi.c: Apply missing hunk from Alexandre Oliva's patch of
- 2007-03-07.
-
-2008-12-26 Timothy Wall <twall@users.sf.net>
-
- * testsuite/libffi.call/cls_longdouble.c,
- testsuite/libffi.call/cls_longdouble_va.c,
- testsuite/libffi.call/cls_align_longdouble.c,
- testsuite/libffi.call/cls_align_longdouble_split.c,
- testsuite/libffi.call/cls_align_longdouble_split2.c: mark expected
- failures on x86_64 cygwin/mingw.
-
-2008-12-22 Timothy Wall <twall@users.sf.net>
-
- * testsuite/libffi.call/closure_fn0.c,
- testsuite/libffi.call/closure_fn1.c,
- testsuite/libffi.call/closure_fn2.c,
- testsuite/libffi.call/closure_fn3.c,
- testsuite/libffi.call/closure_fn4.c,
- testsuite/libffi.call/closure_fn5.c,
- testsuite/libffi.call/closure_fn6.c,
- testsuite/libffi.call/closure_loc_fn0.c,
- testsuite/libffi.call/closure_stdcall.c,
- testsuite/libffi.call/cls_align_pointer.c,
- testsuite/libffi.call/cls_pointer.c,
- testsuite/libffi.call/cls_pointer_stack.c: use portable cast from
- pointer to integer (intptr_t).
- * testsuite/libffi.call/cls_longdouble.c: disable for win64.
-
-2008-12-19 Anthony Green <green@redhat.com>
-
- * configure.ac: Bump version to 3.0.8.
- * configure, doc/stamp-vti, doc/version.texi: Rebuilt.
- * libtool-version: Increment revision.
- * README: Update for new release.
-
-2008-11-11 Anthony Green <green@redhat.com>
-
- * configure.ac: Bump version to 3.0.7.
- * configure, doc/stamp-vti, doc/version.texi: Rebuilt.
- * libtool-version: Increment revision.
- * README: Update for new release.
-
-2008-08-25 Andreas Tobler <a.tobler@schweiz.org>
-
- * src/powerpc/ffitarget.h (ffi_abi): Add FFI_LINUX and
- FFI_LINUX_SOFT_FLOAT to the POWERPC_FREEBSD enum.
- Add note about flag bits used for FFI_SYSV_TYPE_SMALL_STRUCT.
- Adjust copyright notice.
- * src/powerpc/ffi.c: Add two new flags to indicate if we have one
- register or two register to use for FFI_SYSV structs.
- (ffi_prep_cif_machdep): Pass the right register flag introduced above.
- (ffi_closure_helper_SYSV): Fix the return type for
- FFI_SYSV_TYPE_SMALL_STRUCT. Comment.
- Adjust copyright notice.
-
-2008-07-24 Anthony Green <green@redhat.com>
-
- * testsuite/libffi.call/cls_dbls_struct.c,
- testsuite/libffi.call/cls_double_va.c,
- testsuite/libffi.call/cls_longdouble.c,
- testsuite/libffi.call/cls_longdouble_va.c,
- testsuite/libffi.call/cls_pointer.c,
- testsuite/libffi.call/cls_pointer_stack.c,
- testsuite/libffi.call/err_bad_abi.c: Clean up failures from
- compiler warnings.
-
-2008-07-17 Anthony Green <green@redhat.com>
-
- * configure.ac: Bump version to 3.0.6.
- * configure, doc/stamp-vti, doc/version.texi: Rebuilt.
- * libtool-version: Increment revision. Add documentation.
- * README: Update for new release.
-
-2008-07-16 Kaz Kojima <kkojima@gcc.gnu.org>
-
- * src/sh/ffi.c (ffi_prep_closure_loc): Turn INSN into an unsigned
- int.
-
-2008-07-16 Kaz Kojima <kkojima@gcc.gnu.org>
-
- * src/sh/sysv.S: Add .note.GNU-stack on Linux.
- * src/sh64/sysv.S: Likewise.
-
-2008-04-03 Anthony Green <green@redhat.com>
-
- * libffi.pc.in (Libs): Add -L${libdir}.
- * configure.ac: Bump version to 3.0.5.
- * configure, doc/stamp-vti, doc/version.texi: Rebuilt.
- * libtool-version: Increment revision.
- * README: Update for new release.
-
-2008-04-03 Anthony Green <green@redhat.com>
- Xerces Ranby <xerxes@zafena.se>
-
- * include/ffi.h.in: Wrap definition of target architecture to
- protect from double definitions.
-
-2008-03-22 Moriyoshi Koizumi <moriyoshi@gmail.com>
-
- * src/x86/ffi.c (ffi_prep_closure_loc): Fix for bug revealed in
- closure_loc_fn0.c.
- * testsuite/libffi.call/closure_loc_fn0.c (closure_loc_test_fn0):
- New test.
-
-2008-03-04 Anthony Green <green@redhat.com>
- Blake Chaffin
- hos@tamanegi.org
-
- * testsuite/libffi.call/cls_align_longdouble_split2.c
- testsuite/libffi.call/cls_align_longdouble_split.c
- testsuite/libffi.call/cls_dbls_struct.c
- testsuite/libffi.call/cls_double_va.c
- testsuite/libffi.call/cls_longdouble.c
- testsuite/libffi.call/cls_longdouble_va.c
- testsuite/libffi.call/cls_pointer.c
- testsuite/libffi.call/cls_pointer_stack.c
- testsuite/libffi.call/err_bad_abi.c
- testsuite/libffi.call/err_bad_typedef.c
- testsuite/libffi.call/huge_struct.c
- testsuite/libffi.call/stret_large2.c
- testsuite/libffi.call/stret_large.c
- testsuite/libffi.call/stret_medium2.c
- testsuite/libffi.call/stret_medium.c: New tests from Apple.
-
-2008-02-26 Jakub Jelinek <jakub@redhat.com>
- Anthony Green <green@redhat.com>
-
- * src/alpha/osf.S: Add .note.GNU-stack on Linux.
- * src/s390/sysv.S: Likewise.
- * src/powerpc/linux64.S: Likewise.
- * src/powerpc/linux64_closure.S: Likewise.
- * src/powerpc/ppc_closure.S: Likewise.
- * src/powerpc/sysv.S: Likewise.
- * src/x86/unix64.S: Likewise.
- * src/x86/sysv.S: Likewise.
- * src/sparc/v8.S: Likewise.
- * src/sparc/v9.S: Likewise.
- * src/m68k/sysv.S: Likewise.
- * src/ia64/unix.S: Likewise.
- * src/arm/sysv.S: Likewise.
-
-2008-02-26 Anthony Green <green@redhat.com>
- Thomas Heller <theller@ctypes.org>
-
- * src/x86/ffi.c (ffi_closure_SYSV_inner): Change C++ comment to C
- comment.
-
-2008-02-26 Anthony Green <green@redhat.org>
- Thomas Heller <theller@ctypes.org>
-
- * include/ffi.h.in: Change void (*)() to void (*)(void).
-
-2008-02-26 Anthony Green <green@redhat.org>
- Thomas Heller <theller@ctypes.org>
-
- * src/alpha/ffi.c: Change void (*)() to void (*)(void).
- src/alpha/osf.S, src/arm/ffi.c, src/frv/ffi.c, src/ia64/ffi.c,
- src/ia64/unix.S, src/java_raw_api.c, src/m32r/ffi.c,
- src/mips/ffi.c, src/pa/ffi.c, src/pa/hpux32.S, src/pa/linux.S,
- src/powerpc/ffi.c, src/powerpc/ffi_darwin.c, src/raw_api.c,
- src/s390/ffi.c, src/sh/ffi.c, src/sh64/ffi.c, src/sparc/ffi.c,
- src/x86/ffi.c, src/x86/unix64.S, src/x86/darwin64.S,
- src/x86/ffi64.c: Ditto.
-
-2008-02-24 Anthony Green <green@redhat.org>
-
- * configure.ac: Accept openbsd*, not just openbsd.
- Bump version to 3.0.4.
- * configure, doc/stamp-vti, doc/version.texi: Rebuilt.
- * libtool-version: Increment revision.
- * README: Update for new release.
-
-2008-02-22 Anthony Green <green@redhat.com>
-
- * README: Clean up list of tested platforms.
-
-2008-02-22 Anthony Green <green@redhat.com>
-
- * configure.ac: Bump version to 3.0.3.
- * configure, doc/stamp-vti, doc/version.texi: Rebuilt.
- * libtool-version: Increment revision.
- * README: Update for new release. Clean up test docs.
-
-2008-02-22 Bjoern Koenig <bkoenig@alpha-tierchen.de>
- Andreas Tobler <a.tobler@schweiz.org>
-
- * configure.ac: Add amd64-*-freebsd* target.
- * configure: Regenerate.
-
-2008-02-22 Thomas Heller <theller@ctypes.org>
-
- * configure.ac: Add x86 OpenBSD support.
- * configure: Rebuilt.
-
-2008-02-21 Thomas Heller <theller@ctypes.org>
-
- * README: Change "make test" to "make check".
-
-2008-02-21 Anthony Green <green@redhat.com>
-
- * configure.ac: Bump version to 3.0.2.
- * configure, doc/stamp-vti, doc/version.texi: Rebuilt.
- * libtool-version: Increment revision.
- * README: Update for new release.
-
-2008-02-21 Björn König <bkoenig@alpha-tierchen.de>
-
- * src/x86/freebsd.S: New file.
- * configure.ac: Add x86 FreeBSD support.
- * Makefile.am: Ditto.
-
-2008-02-15 Anthony Green <green@redhat.com>
-
- * configure.ac: Bump version to 3.0.1.
- * configure, doc/stamp-vti, doc/version.texi: Rebuilt.
- * libtool-version: Increment revision.
- * README: Update for new release.
-
-2008-02-15 David Daney <ddaney@avtrex.com>
-
- * src/mips/ffi.c: Remove extra '>' from include directive.
- (ffi_prep_closure_loc): Use clear_location instead of tramp.
-
-2008-02-15 Anthony Green <green@redhat.com>
-
- * configure.ac: Bump version to 3.0.0.
- * configure, doc/stamp-vti, doc/version.texi: Rebuilt.
-
-2008-02-15 David Daney <ddaney@avtrex.com>
-
- * src/mips/ffi.c (USE__BUILTIN___CLEAR_CACHE):
- Define (conditionally), and use it to include cachectl.h.
- (ffi_prep_closure_loc): Fix cache flushing.
- * src/mips/ffitarget.h (_ABIN32, _ABI64, _ABIO32): Define.
-
-2008-02-15 Anthony Green <green@redhat.com>
-
- * man/ffi_call.3, man/ffi_prep_cif.3, man/ffi.3:
- Update dates and remove all references to ffi_prep_closure.
- * configure.ac: Bump version to 2.99.9.
- * configure, doc/stamp-vti, doc/version.texi: Rebuilt.
-
-2008-02-15 Anthony Green <green@redhat.com>
-
- * man/ffi_prep_closure.3: Delete.
- * man/Makefile.am (EXTRA_DIST): Remove ffi_prep_closure.3.
- (man_MANS): Ditto.
- * man/Makefile.in: Rebuilt.
- * configure.ac: Bump version to 2.99.8.
- * configure, doc/stamp-vti, doc/version.texi: Rebuilt.
-
-2008-02-14 Anthony Green <green@redhat.com>
-
- * configure.ac: Bump version to 2.99.7.
- * configure, doc/stamp-vti, doc/version.texi: Rebuilt.
- * include/ffi.h.in LICENSE src/debug.c src/closures.c
- src/ffitest.c src/s390/sysv.S src/s390/ffitarget.h
- src/types.c src/m68k/ffitarget.h src/raw_api.c src/frv/ffi.c
- src/frv/ffitarget.h src/sh/ffi.c src/sh/sysv.S
- src/sh/ffitarget.h src/powerpc/ffitarget.h src/pa/ffi.c
- src/pa/ffitarget.h src/pa/linux.S src/java_raw_api.c
- src/cris/ffitarget.h src/x86/ffi.c src/x86/sysv.S
- src/x86/unix64.S src/x86/win32.S src/x86/ffitarget.h
- src/x86/ffi64.c src/x86/darwin.S src/ia64/ffi.c
- src/ia64/ffitarget.h src/ia64/ia64_flags.h src/ia64/unix.S
- src/sparc/ffi.c src/sparc/v9.S src/sparc/ffitarget.h
- src/sparc/v8.S src/alpha/ffi.c src/alpha/ffitarget.h
- src/alpha/osf.S src/sh64/ffi.c src/sh64/sysv.S
- src/sh64/ffitarget.h src/mips/ffi.c src/mips/ffitarget.h
- src/mips/n32.S src/mips/o32.S src/arm/ffi.c src/arm/sysv.S
- src/arm/ffitarget.h src/prep_cif.c: Update license text.
-
-2008-02-14 Anthony Green <green@redhat.com>
-
- * README: Update tested platforms.
- * configure.ac: Bump version to 2.99.6.
- * configure: Rebuilt.
-
-2008-02-14 Anthony Green <green@redhat.com>
-
- * configure.ac: Bump version to 2.99.5.
- * configure: Rebuilt.
- * Makefile.am (EXTRA_DIST): Add darwin64.S
- * Makefile.in: Rebuilt.
- * testsuite/lib/libffi-dg.exp: Remove libstdc++ bits from GCC tree.
- * LICENSE: Update WARRANTY.
-
-2008-02-14 Anthony Green <green@redhat.com>
-
- * libffi.pc.in (libdir): Fix libdir definition.
- * configure.ac: Bump version to 2.99.4.
- * configure: Rebuilt.
-
-2008-02-14 Anthony Green <green@redhat.com>
-
- * README: Update.
- * libffi.info: New file.
- * doc/stamp-vti: New file.
- * configure.ac: Bump version to 2.99.3.
- * configure: Rebuilt.
-
-2008-02-14 Anthony Green <green@redhat.com>
-
- * Makefile.am (SUBDIRS): Add man dir.
- * Makefile.in: Rebuilt.
- * configure.ac: Create Makefile.
- * configure: Rebuilt.
- * man/ffi_call.3 man/ffi_prep_cif.3 man/ffi_prep_closure.3
- man/Makefile.am man/Makefile.in: New files.
-
-2008-02-14 Tom Tromey <tromey@redhat.com>
-
- * aclocal.m4, Makefile.in, configure, fficonfig.h.in: Rebuilt.
- * mdate-sh, texinfo.tex: New files.
- * Makefile.am (info_TEXINFOS): New variable.
- * doc/libffi.texi: New file.
- * doc/version.texi: Likewise.
-
-2008-02-14 Anthony Green <green@redhat.com>
-
- * Makefile.am (AM_CFLAGS): Don't compile with -D$(TARGET).
- (lib_LTLIBRARIES): Define.
- (toolexeclib_LIBRARIES): Undefine.
- * Makefile.in: Rebuilt.
- * configure.ac: Reset version to 2.99.1.
- * configure.in: Rebuilt.
-
-2008-02-14 Anthony Green <green@redhat.com>
-
- * libffi.pc.in: Use @PACKAGE_NAME@ and @PACKAGE_VERSION@.
- * configure.ac: Reset version to 2.99.1.
- * configure.in: Rebuilt.
- * Makefile.am (EXTRA_DIST): Add ChangeLog.libffi.
- * Makefile.in: Rebuilt.
- * LICENSE: Update copyright notice.
-
-2008-02-14 Anthony Green <green@redhat.com>
-
- * include/Makefile.am (nodist_includes_HEADERS): Define. Don't
- distribute ffitarget.h or ffi.h from the build include dir.
- * Makefile.in: Rebuilt.
-
-2008-02-14 Anthony Green <green@redhat.com>
-
- * include/Makefile.am (includesdir): Install headers under libdir.
- (pkgconfigdir): Define. Install libffi.pc.
- * include/Makefile.in: Rebuilt.
- * libffi.pc.in: Create.
- * libtool-version: Increment CURRENT
- * configure.ac: Add libffi.pc.in
- * configure: Rebuilt.
-
-2008-02-03 Anthony Green <green@redhat.com>
-
- * include/Makefile.am (includesdir): Fix header install with
- DESTDIR.
- * include/Makefile.in: Rebuilt.
-
-2008-02-03 Timothy Wall <twall@users.sf.net>
-
- * src/x86/ffi.c (FFI_INIT_TRAMPOLINE_STDCALL): Calculate jump return
- offset based on code pointer, not data pointer.
-
-2008-02-01 Anthony Green <green@redhat.com>
-
- * include/Makefile.am: Fix header installs.
- * Makefile.am: Ditto.
- * include/Makefile.in: Rebuilt.
- * Makefile.in: Ditto.
-
-2008-02-01 Anthony Green <green@redhat.com>
-
- * src/x86/ffi.c (FFI_INIT_TRAMPOLINE_STDCALL,
- FFI_INIT_TRAMPOLINE): Revert my broken changes to twall's last
- patch.
-
-2008-01-31 Anthony Green <green@redhat.com>
-
- * Makefile.am (EXTRA_DIST): Add missing files.
- * testsuite/Makefile.am: Ditto.
- * Makefile.in, testsuite/Makefile.in: Rebuilt.
-
-2008-01-31 Timothy Wall <twall@users.sf.net>
-
- * testsuite/libffi.call/closure_stdcall.c: Add test for stdcall
- closures.
- * src/x86/ffitarget.h: Increase size of trampoline for stdcall
- closures.
- * src/x86/win32.S: Add assembly for stdcall closure.
- * src/x86/ffi.c: Initialize stdcall closure trampoline.
-
-2008-01-30 H.J. Lu <hongjiu.lu@intel.com>
-
- PR libffi/34612
- * src/x86/sysv.S (ffi_closure_SYSV): Pop 4 byte from stack when
- returning struct.
-
- * testsuite/libffi.call/call.exp: Add "-O2 -fomit-frame-pointer"
- tests.
-
-2008-01-30 Anthony Green <green@redhat.com>
-
- * Makefile.am, include/Makefile.am: Move headers to
- libffi_la_SOURCES for new automake.
- * Makefile.in, include/Makefile.in: Rebuilt.
-
- * testsuite/lib/wrapper.exp: Copied from gcc tree to allow for
- execution outside of gcc tree.
- * testsuite/lib/target-libpath.exp: Ditto.
-
- * testsuite/lib/libffi-dg.exp: Many changes to allow for execution
- outside of gcc tree.
-
diff --git a/Modules/_ctypes/libffi/ChangeLog.libffi-3.1 b/Modules/_ctypes/libffi/ChangeLog.libffi-3.1
deleted file mode 100644
index 8f7f50d6f9..0000000000
--- a/Modules/_ctypes/libffi/ChangeLog.libffi-3.1
+++ /dev/null
@@ -1,6000 +0,0 @@
-2014-03-16 Josh Triplett <josh@joshtriplett.org>
-
- * ChangeLog: Archive to ChangeLog.libffi-3.1 and delete. Future
- changelogs will come from git, with autogenerated snapshots shipped in
- distributed tarballs.
-
-2014-03-16 Josh Triplett <josh@joshtriplett.org>
-
- Add support for stdcall, thiscall, and fastcall on non-Windows
- x86-32.
-
- Linux supports the stdcall calling convention, either via
- functions explicitly declared with the stdcall attribute, or via
- code compiled with -mrtd which effectively makes stdcall the
- default.
-
- This introduces FFI_STDCALL, FFI_THISCALL, and FFI_FASTCALL on
- non-Windows x86-32 platforms, as non-default calling conventions.
-
- * Makefile.am: Compile in src/x86/win32.S on non-Windows x86-32.
- * src/x86/ffitarget.h: Add FFI_STDCALL, FFI_THISCALL, and
- FFI_FASTCALL on non-Windows x86-32. Increase trampoline size to
- accomodate these calling conventions, and unify some ifdeffery.
- * src/x86/ffi.c: Add support for FFI_STDCALL, FFI_THISCALL, and
- FFI_FASTCALL on non-Windows x86-32 platforms; update ifdeffery.
- * src/x86/win32.S: Support compiling on non-Windows x86-32
- platforms. On those platforms, avoid redefining the SYSV symbols
- already provided by src/x86/sysv.S.
- * testsuite/libffi.call/closure_stdcall.c: Run on non-Windows.
- #define __stdcall if needed.
- * testsuite/libffi.call/closure_thiscall.c: Run on non-Windows.
- #define __fastcall if needed.
- * testsuite/libffi.call/fastthis1_win32.c: Run on non-Windows.
- * testsuite/libffi.call/fastthis2_win32.c: Ditto.
- * testsuite/libffi.call/fastthis3_win32.c: Ditto.
- * testsuite/libffi.call/many2_win32.c: Ditto.
- * testsuite/libffi.call/many_win32.c: Ditto.
- * testsuite/libffi.call/strlen2_win32.c: Ditto.
- * testsuite/libffi.call/strlen_win32.c: Ditto.
- * testsuite/libffi.call/struct1_win32.c: Ditto.
- * testsuite/libffi.call/struct2_win32.c: Ditto.
-
-2014-03-16 Josh Triplett <josh@joshtriplett.org>
-
- * prep_cif.c: Remove unnecessary ifdef for X86_WIN32.
- ffi_prep_cif_core had a special case for X86_WIN32, checking for
- FFI_THISCALL in addition to the FFI_FIRST_ABI-to-FFI_LAST_ABI
- range before returning FFI_BAD_ABI. However, on X86_WIN32,
- FFI_THISCALL already falls in that range, making the special case
- unnecessary. Remove it.
-
-2014-03-16 Josh Triplett <josh@joshtriplett.org>
-
- * testsuite/libffi.call/closure_stdcall.c,
- testsuite/libffi.call/closure_thiscall.c: Remove fragile stack
- pointer checks. These files included inline assembly to save the
- stack pointer before and after the call, and compare the values.
- However, compilers can and do leave the stack in different states
- for these two pieces of inline assembly, such as by saving a
- temporary value on the stack across the call; observed with gcc
- -Os, and verified as spurious through careful inspection of
- disassembly.
-
-2014-03-16 Josh Triplett <josh@joshtriplett.org>
-
- * testsuite/libffi.call/many.c: Avoid spurious failure due to
- excess floating-point precision.
- * testsuite/libffi.call/many_win32.c: Ditto.
-
-2014-03-16 Josh Triplett <josh@joshtriplett.org>
-
- * libtool-ldflags: Re-add.
-
-2014-03-16 Josh Triplett <josh@joshtriplett.org>
-
- * Makefile.in, aclocal.m4, compile, config.guess, config.sub,
- configure, depcomp, include/Makefile.in, install-sh,
- libtool-ldflags, ltmain.sh, m4/libtool.m4, m4/ltoptions.m4,
- m4/ltsugar.m4, m4/ltversion.m4, m4/lt~obsolete.m4,
- man/Makefile.in, mdate-sh, missing, testsuite/Makefile.in: Delete
- autogenerated files from version control.
- * .gitignore: Add autogenerated files.
- * autogen.sh: New script to generate the autogenerated files.
- * README: Document requirement to run autogen.sh when building
- directly from version control.
- * .travis.yml: Run autogen.sh
-
-2014-03-14 Anthony Green <green@moxielogic.com>
-
- * configure, Makefile.in: Rebuilt.
-
-2014-03-10 Mike Hommey <mh+mozilla@glandium.org>
-
- * configure.ac: Allow building for mipsel with Android NDK r8.
- * Makefile.am (AM_MAKEFLAGS): Replace double quotes with single
- quotes.
-
-2014-03-10 Landry Breuil <landry@openbsd.org>
-
- * configure.ac: Ensure the linker supports @unwind sections in libffi.
-
-2014-03-01 Anthony Green <green@moxielogic.com>
-
- * Makefile.am (EXTRA_DIST): Replace old scripts with
- generate-darwin-source-and-headers.py.
- * Makefile.in: Rebuilt.
-
-2014-02-28 Anthony Green <green@moxielogic.com>
-
- * Makefile.am (AM_CFLAGS): Reintroduce missing -DFFI_DEBUG for
- --enable-debug builds.
- * Makefile.in: Rebuilt.
-
-2014-02-28 Makoto Kato <m_kato@ga2.so-net.ne.jp>
-
- * src/closures.c: Fix build failure when using clang for Android.
-
-2014-02-28 Marcin Wojdyr <wojdyr@gmail.com>
-
- * libffi.pc.in (toolexeclibdir): use -L${toolexeclibdir} instead
- of -L${libdir}.
-
-2014-02-28 Paulo Pizarro <paulo.pizarro@gmail.com>
-
- * src/bfin/sysv.S: Calling functions in shared libraries requires
- considering the GOT.
-
-2014-02-28 Josh Triplett <josh@joshtriplett.org>
-
- * src/x86/ffi64.c (classify_argument): Handle case where
- FFI_TYPE_LONGDOUBLE == FFI_TYPE_DOUBLE.
-
-2014-02-28 Anthony Green <green@moxielogic.com>
-
- * ltmain.sh: Generate with libtool-2.4.2.418.
- * m4/libtool.m4, m4/ltoptions.m4, m4/ltversion.m4: Ditto.
- * configure: Rebuilt.
-
-2014-02-28 Dominik Vogt <vogt@linux.vnet.ibm.com>
-
- * configure.ac (AC_ARG_ENABLE struct): Fix typo in help
- message.
- (AC_ARG_ENABLE raw_api): Ditto.
- * configure, fficonfig.h.in: Rebuilt.
-
-2014-02-28 Will Newton <will.newton@linaro.org>
-
- * src/arm/sysv.S: Initialize IP register with FP.
-
-2014-02-28 Yufeng Zhang <yufeng.zhang@arm.com>
-
- * src/aarch64/sysv.S (ffi_closure_SYSV): Use x29 as the
- main CFA reg; update cfi_rel_offset.
-
-2014-02-15 Marcus Comstedt <marcus@mc.pp.se>
-
- * src/powerpc/ffi_linux64.c, src/powerpc/linux64_closure.S: Remove
- assumption on contents of r11 in closure.
-
-2014-02-09 Heiher <r@hev.cc>
-
- * src/mips/n32.S: Fix call floating point va function.
-
-2014-01-21 Zachary Waldowski <zach@waldowski.me>
-
- * src/aarch64/ffi.c: Fix missing semicolons on assertions under
- debug mode.
-
-2013-12-30 Zachary Waldowski <zach@waldowski.me>
-
- * .gitignore: Exclude darwin_* generated source and build_* trees.
- * src/aarch64/ffi.c, src/arm/ffi.c, src/x86/ffi.c: Inhibit Clang
- previous prototype warnings.
- * src/arm/ffi.c: Prevent NULL dereference, fix short type warning
- * src/dlmalloc.c: Fix warnings from set_segment_flags return type,
- and the native use of size_t for malloc on platforms
- * src/arm/sysv.S: Use unified syntax. Clang clean-ups for
- ARM_FUNC_START.
- * generate-osx-source-and-headers.py: Remove.
- * build-ios.sh: Remove.
- * libffi.xcodeproj/project.pbxproj: Rebuild targets. Include
- x86_64+aarch64 pieces in library. Export headers properly.
- * src/x86/ffi64.c: More Clang warning clean-ups.
- * src/closures.c (open_temp_exec_file_dir): Use size_t.
- * src/prep_cif.c (ffi_prep_cif_core): Cast ALIGN result.
- * src/aarch64/sysv.S: Use CNAME for global symbols. Only use
- .size for ELF targets.
- * src/aarch64/ffi.c: Clean up for double == long double. Clean up
- from Clang warnings. Use Clang cache invalidation builtin. Use
- size_t in place of unsigned in many places. Accommodate for
- differences in Apple AArch64 ABI.
-
-2013-12-02 Daniel Rodríguez Troitiño <drodrigueztroitino@yahoo.es>
-
- * generate-darwin-source-and-headers.py: Clean up, modernize,
- merged version of previous scripts.
-
-2013-11-21 Anthony Green <green@moxielogic.com>
-
- * configure, Makefile.in, include/Makefile.in, include/ffi.h.in,
- man/Makefile.in, testsuite/Makefile.in, fficonfig.h.in: Rebuilt.
-
-2013-11-21 Alan Modra <amodra@gmail.com>
-
- * Makefile.am (EXTRA_DIST): Add new src/powerpc files.
- (nodist_libffi_la_SOURCES <POWERPC, POWERPC_FREEBSD>): Likewise.
- * configure.ac (HAVE_LONG_DOUBLE_VARIANT): Define for powerpc.
- * include/ffi.h.in (ffi_prep_types): Declare.
- * src/prep_cif.c (ffi_prep_cif_core): Call ffi_prep_types.
- * src/types.c (FFI_NONCONST_TYPEDEF): Define and use for
- HAVE_LONG_DOUBLE_VARIANT.
- * src/powerpc/ffi_powerpc.h: New file.
- * src/powerpc/ffi.c: Split into..
- * src/powerpc/ffi_sysv.c: ..new file, and..
- * src/powerpc/ffi_linux64.c: ..new file, rewriting parts.
- * src/powerpc/ffitarget.h (enum ffi_abi): Rewrite powerpc ABI
- selection as bits controlling features.
- * src/powerpc/linux64.S: For consistency, use POWERPC64 rather
- than __powerpc64__.
- * src/powerpc/linux64_closure.S: Likewise.
- * src/powerpc/ppc_closure.S: Likewise. Move .note.FNU-stack
- inside guard.
- * src/powerpc/sysv.S: Likewise.
- * configure: Regenerate.
- * fficonfig.h.in: Regenerate.
- * Makefile.in: Regenerate.
-
-2013-11-20 Alan Modra <amodra@gmail.com>
-
- * src/powerpc/ffi.c (ffi_prep_cif_machdep_core): Use
- NUM_FPR_ARG_REGISTERS64 and NUM_GPR_ARG_REGISTERS64 not their
- 32-bit versions for 64-bit code.
- * src/powerpc/linux64_closure.S: Don't use the return value area
- as a parameter save area on ELFv2.
-
-2013-11-18 Iain Sandoe <iain@codesourcery.com>
-
- * src/powerpc/darwin.S (EH): Correct use of pcrel FDE encoding.
- * src/powerpc/darwin_closure.S (EH): Likewise. Modernise picbase
- labels.
-
-2013-11-18 Anthony Green <green@moxielogic.com>
-
- * src/arm/ffi.c (ffi_call): Hoist declaration of temp to top of
- function.
- * src/arm/ffi.c (ffi_closure_inner): Moderize function declaration
- to appease compiler.
- Thanks for Gregory P. Smith <greg@krypto.org>.
-
-2013-11-18 Anthony Green <green@moxielogic.com>
-
- * README (tested): Mention PowerPC ELFv2.
-
-2013-11-16 Alan Modra <amodra@gmail.com>
-
- * src/powerpc/ppc_closure.S: Move errant #endif to where it belongs.
- Don't bl .Luint128.
-
-2013-11-16 Alan Modra <amodra@gmail.com>
-
- * src/powerpc/ffi.c (ffi_prep_cif_machdep_core): Use #if _CALL_ELF
- test to select parameter save sizing for ELFv2 vs. ELFv1.
- * src/powerpc/ffitarget.h (FFI_V2_TYPE_FLOAT_HOMOG,
- FFI_V2_TYPE_DOUBLE_HOMOG, FFI_V2_TYPE_SMALL_STRUCT): Define.
- (FFI_TRAMPOLINE_SIZE): Define variant for ELFv2.
- * src/powerpc/ffi.c (FLAG_ARG_NEEDS_PSAVE): Define.
- (discover_homogeneous_aggregate): New function.
- (ffi_prep_args64): Adjust start of param save area for ELFv2.
- Handle homogenous floating point struct parms.
- (ffi_prep_cif_machdep_core): Adjust space calculation for ELFv2.
- Handle ELFv2 return values. Set FLAG_ARG_NEEDS_PSAVE. Handle
- homogenous floating point structs.
- (ffi_call): Increase size of smst_buffer for ELFv2. Handle ELFv2.
- (flush_icache): Compile for ELFv2.
- (ffi_prep_closure_loc): Set up ELFv2 trampoline.
- (ffi_closure_helper_LINUX64): Don't return all structs directly
- to caller. Handle homogenous floating point structs. Handle
- ELFv2 struct return values.
- * src/powerpc/linux64.S (ffi_call_LINUX64): Set up r2 for
- ELFv2. Adjust toc save location. Call function pointer using
- r12. Handle FLAG_RETURNS_SMST. Don't predict branches.
- * src/powerpc/linux64_closure.S (ffi_closure_LINUX64): Set up r2
- for ELFv2. Define ELFv2 versions of STACKFRAME, PARMSAVE, and
- RETVAL. Handle possibly missing parameter save area. Handle
- ELFv2 return values.
- (.note.GNU-stack): Move inside outer #ifdef.
-
-2013-11-16 Alan Modra <amodra@gmail.com>
-
- * src/powerpc/ffi.c (ffi_prep_cif_machdep): Revert 2013-02-08
- change. Do not consume an int arg when returning a small struct
- for FFI_SYSV ABI.
- (ffi_call): Only use bounce buffer when FLAG_RETURNS_SMST.
- Properly copy bounce buffer to destination.
- * src/powerpc/sysv.S: Revert 2013-02-08 change.
- * src/powerpc/ppc_closure.S: Remove stray '+'.
-
-2013-11-16 Alan Modra <amodra@gmail.com>
-
- * src/powerpc/ffi.c (ffi_prep_args64): Align struct parameters
- according to __STRUCT_PARM_ALIGN__.
- (ffi_prep_cif_machdep_core): Likewise.
- (ffi_closure_helper_LINUX64): Likewise.
-
-2013-11-16 Alan Modra <amodra@gmail.com>
-
- * src/powerpc/linux64.S (ffi_call_LINUX64): Tweak restore of r28.
- (.note.GNU-stack): Move inside outer #ifdef.
- * src/powerpc/linux64_closure.S (STACKFRAME, PARMSAVE,
- RETVAL): Define and use throughout.
- (ffi_closure_LINUX64): Save fprs before buying stack.
- (.note.GNU-stack): Move inside outer #ifdef.
-
-2013-11-16 Alan Modra <amodra@gmail.com>
-
- * src/powerpc/ffitarget.h (FFI_TARGET_SPECIFIC_VARIADIC): Define.
- (FFI_EXTRA_CIF_FIELDS): Define.
- * src/powerpc/ffi.c (ffi_prep_args64): Save fprs as per the
- ABI, not to both fpr and param save area.
- (ffi_prep_cif_machdep_core): Renamed from ffi_prep_cif_machdep.
- Keep initial flags. Formatting. Remove dead FFI_LINUX_SOFT_FLOAT
- code.
- (ffi_prep_cif_machdep, ffi_prep_cif_machdep_var): New functions.
- (ffi_closure_helper_LINUX64): Pass floating point as per ABI,
- not to both fpr and parameter save areas.
-
- * libffi/testsuite/libffi.call/cls_double_va.c (main): Correct
- function cast and don't call ffi_prep_cif.
- * libffi/testsuite/libffi.call/cls_longdouble_va.c (main): Likewise.
-
-2013-11-15 Andrew Haley <aph@redhat.com>
-
- * doc/libffi.texi (Closure Example): Fix the sample code.
- * doc/libffi.info, doc/stamp-vti, doc/version.texi: Rebuilt.
-
-2013-11-15 Andrew Haley <aph@redhat.com>
-
- * testsuite/libffi.call/va_struct1.c (main): Fix broken test.
- * testsuite/libffi.call/cls_uint_va.c (cls_ret_T_fn): Likewise
- * testsuite/libffi.call/cls_struct_va1.c (test_fn): Likewise.
- * testsuite/libffi.call/va_1.c (main): Likewise.
-
-2013-11-14 David Schneider <david.schneider@bivab.de>
-
- * src/arm/ffi.c: Fix register allocation for mixed float and
- doubles.
- * testsuite/libffi.call/cls_many_mixed_float_double.c: Testcase
- for many mixed float and double arguments.
-
-2013-11-13 Alan Modra <amodra@gmail.com>
-
- * doc/libffi.texi (Simple Example): Correct example code.
- * doc/libffi.info, doc/stamp-vti, doc/version.texi: Rebuilt.
-
-2013-11-13 Anthony Green <green@moxielogic.com>
-
- * include/ffi_common.h: Respect HAVE_ALLOCA_H for GNU compiler
- based build. (Thanks to tmr111116 on github)
-
-2013-11-09 Anthony Green <green@moxielogic.com>
-
- * m4/libtool.m4: Refresh.
- * configure, Makefile.in: Rebuilt.
- * README: Add more notes about next release.
-
-2013-11-09 Shigeharu TAKENO <shige@iee.niit.ac.jp>
-
- * m4/ax_gcc_archflag.m4 (ax_gcc_arch): Don't recognize
- UltraSPARC-IIi as ultrasparc3.
-
-2013-11-06 Mark Kettenis <kettenis@gnu.org>
-
- * src/x86/freebsd.S (ffi_call_SYSV): Align the stack pointer to
- 16-bytes.
-
-2013-11-06 Konstantin Belousov <kib@freebsd.org>
-
- * src/x86/freebsd.S (ffi_closure_raw_SYSV): Mark the assembler
- source as not requiring executable stack.
-
-2013-11-02 Anthony Green <green@moxielogic.com>
-
- * doc/libffi.texi (The Basics): Clarify return value buffer size
- requirements. Also, NULL result buffer pointers are no longer
- supported.
- * doc/libffi.info: Rebuilt.
-
-2013-11-02 Mischa Jonker <mjonker@synopsys.com>
-
- * Makefile.am (nodist_libffi_la_SOURCES): Fix build error.
- * Makefile.in: Rebuilt.
-
-2013-11-02 David Schneider <david.schneider@bivab.de>
-
- * src/arm/ffi.c: more robust argument handling for closures on arm hardfloat
- * testsuite/libffi.call/many_mixed.c: New file.
- * testsuite/libffi.call/cls_many_mixed_args.c: More tests.
-
-2013-11-02 Vitaly Budovski
-
- * src/x86/ffi.c (ffi_prep_cif_machdep): Don't align stack for win32.
-
-2013-10-23 Mark H Weaver <mhw@netris.org>
-
- * src/mips/ffi.c: Fix handling of uint32_t arguments on the
- MIPS N32 ABI.
-
-2013-10-13 Sandra Loosemore <sandra@codesourcery.com>
-
- * README: Add Nios II to table of supported platforms.
- * Makefile.am (EXTRA_DIST): Add nios2 files.
- (nodist_libffi_la_SOURCES): Likewise.
- * Makefile.in: Regenerated.
- * configure.ac (nios2*-linux*): New host.
- (NIOS2): Add AM_CONDITIONAL.
- * configure: Regenerated.
- * src/nios2/ffi.c: New.
- * src/nios2/ffitarget.h: New.
- * src/nios2/sysv.S: New.
- * src/prep_cif.c (initialize_aggregate): Handle extra structure
- alignment via FFI_AGGREGATE_ALIGNMENT.
- (ffi_prep_cif_core): Conditionalize structure return for NIOS2.
-
-2013-10-10 Sandra Loosemore <sandra@codesourcery.com>
-
- * testsuite/libffi.call/cls_many_mixed_args.c (cls_ret_double_fn):
- Fix uninitialized variable.
-
-2013-10-11 Marcus Shawcroft <marcus.shawcroft@arm.com>
-
- * testsuite/libffi.call/many.c (many): Replace * with +.
-
-2013-10-08 Ondřej Bílka <neleai@seznam.cz>
-
- * src/aarch64/ffi.c, src/aarch64/sysv.S, src/arm/ffi.c,
- src/arm/gentramp.sh, src/bfin/sysv.S, src/closures.c,
- src/dlmalloc.c, src/ia64/ffi.c, src/microblaze/ffi.c,
- src/microblaze/sysv.S, src/powerpc/darwin_closure.S,
- src/powerpc/ffi.c, src/powerpc/ffi_darwin.c, src/sh/ffi.c,
- src/tile/tile.S, testsuite/libffi.call/nested_struct11.c: Fix
- spelling errors.
-
-2013-10-08 Anthony Green <green@moxielogic.com>
-
- * aclocal.m4, compile, config.guess, config.sub, depcomp,
- install-sh, mdate-sh, missing, texinfo.tex: Update from upstream.
- * configure.ac: Update version to 3.0.14-rc0.
- * Makefile.in, configure, Makefile.in, include/Makefile.in,
- man/Makefile.in, testsuite/Makefile.in: Rebuilt.
- * README: Mention M88K and VAX.
-
-2013-07-15 Miod Vallat <miod@openbsd.org>
-
- * Makefile.am,
- configure.ac,
- src/m88k/ffi.c,
- src/m88k/ffitarget.h,
- src/m88k/obsd.S,
- src/vax/elfbsd.S,
- src/vax/ffi.c,
- src/vax/ffitarget.h: Add m88k and vax support.
-
-2013-06-24 Alan Modra <amodra@gmail.com>
-
- * src/powerpc/ffi.c (ffi_prep_args_SYSV): Move var declaration
- before statements.
- (ffi_prep_args64): Support little-endian.
- (ffi_closure_helper_SYSV, ffi_closure_helper_LINUX64): Likewise.
- * src/powerpc/linux64_closure.S (ffi_closure_LINUX64): Likewise.
- * src/powerpc/ppc_closure.S (ffi_closure_SYSV): Likewise.
-
-2013-06-12 Mischa Jonker <mjonker@synopsys.com>
-
- * configure.ac: Add support for ARC.
- * Makefile.am: Likewise.
- * README: Add ARC details.
- * src/arc/arcompact.S: New.
- * src/arc/ffi.c: Likewise.
- * src/arc/ffitarget.h: Likewise.
-
-2013-03-28 David Schneider <david.schneider@bivab.de>
-
- * src/arm/ffi.c: Fix support for ARM hard-float calling convention.
- * src/arm/sysv.S: call different methods for SYSV and VFP ABIs.
- * testsuite/libffi.call/cls_many_mixed_args.c: testcase for a closure with
- mixed arguments, many doubles.
- * testsuite/libffi.call/many_double.c: testcase for calling a function using
- more than 8 doubles.
- * testcase/libffi.call/many.c: use absolute value to check result against an
- epsilon
-
-2013-03-17 Anthony Green <green@moxielogic.com>
-
- * README: Update for 3.0.13.
- * configure.ac: Ditto.
- * configure: Rebuilt.
- * doc/*: Update version.
-
-2013-03-17 Dave Korn <dave.korn.cygwin@gmail.com>
-
- * src/closures.c (is_emutramp_enabled
- [!FFI_MMAP_EXEC_EMUTRAMP_PAX]): Move default definition outside
- enclosing #if scope.
-
-2013-03-17 Anthony Green <green@moxielogic.com>
-
- * configure.ac: Only modify toolexecdir in certain cases.
- * configure: Rebuilt.
-
-2013-03-16 Gilles Talis <gilles.talis@gmail.com>
-
- * src/powerpc/ffi.c (ffi_prep_args_SYSV): Don't use
- fparg_count,etc on __NO_FPRS__ targets.
-
-2013-03-16 Alan Hourihane <alanh@fairlite.co.uk>
-
- * src/m68k/sysv.S (epilogue): Don't use extb instruction on
- m680000 machines.
-
-2013-03-16 Alex Gaynor <alex.gaynor@gmail.com>
-
- * src/x86/ffi.c (ffi_prep_cif_machdep): Always align stack.
-
-2013-03-13 Markos Chandras <markos.chandras@imgtec.com>
-
- * configure.ac: Add support for Imagination Technologies Meta.
- * Makefile.am: Likewise.
- * README: Add Imagination Technologies Meta details.
- * src/metag/ffi.c: New.
- * src/metag/ffitarget.h: Likewise.
- * src/metag/sysv.S: Likewise.
-
-2013-02-24 Andreas Schwab <schwab@linux-m68k.org>
-
- * doc/libffi.texi (Structures): Fix missing category argument of
- @deftp.
-
-2013-02-11 Anthony Green <green@moxielogic.com>
-
- * configure.ac: Update release number to 3.0.12.
- * configure: Rebuilt.
- * README: Update release info.
-
-2013-02-10 Anthony Green <green@moxielogic.com>
-
- * README: Add Moxie.
- * src/moxie/ffi.c: Created.
- * src/moxie/eabi.S: Created.
- * src/moxie/ffitarget.h: Created.
- * Makefile.am (nodist_libffi_la_SOURCES): Add Moxie.
- * Makefile.in: Rebuilt.
- * configure.ac: Add Moxie.
- * configure: Rebuilt.
- * testsuite/libffi.call/huge_struct.c: Disable format string
- warnings for moxie*-*-elf tests.
-
-2013-02-10 Anthony Green <green@moxielogic.com>
-
- * Makefile.am (LTLDFLAGS): Fix reference.
- * Makefile.in: Rebuilt.
-
-2013-02-10 Anthony Green <green@moxielogic.com>
-
- * README: Update supported platforms. Update test results link.
-
-2013-02-09 Anthony Green <green@moxielogic.com>
-
- * testsuite/libffi.call/negint.c: Remove forced -O2.
- * testsuite/libffi.call/many2.c (foo): Remove GCCism.
- * testsuite/libffi.call/ffitest.h: Add default PRIuPTR definition.
-
- * src/sparc/v8.S (ffi_closure_v8): Import ancient ulonglong
- closure return type fix developed by Martin v. Löwis for cpython
- fork.
-
-2013-02-08 Andreas Tobler <andreast@fgznet.ch>
-
- * src/powerpc/ffi.c (ffi_prep_cif_machdep): Fix small struct
- support.
- * src/powerpc/sysv.S: Ditto.
-
-2013-02-08 Anthony Green <green@moxielogic.com>
-
- * testsuite/libffi.call/cls_longdouble.c: Remove xfail for
- arm*-*-*.
-
-2013-02-08 Anthony Green <green@moxielogic.com>
-
- * src/sparc/ffi.c (ffi_prep_closure_loc): Fix cache flushing for GCC.
-
-2013-02-08 Matthias Klose <doko@ubuntu.com>
-
- * man/ffi_prep_cif.3: Clean up for debian linter.
-
-2013-02-08 Peter Bergner <bergner@vnet.ibm.com>
-
- * src/powerpc/ffi.c (ffi_prep_args_SYSV): Account for FP args pushed
- on the stack.
-
-2013-02-08 Anthony Green <green@moxielogic.com>
-
- * Makefile.am (EXTRA_DIST): Add missing files.
- * testsuite/Makefile.am (EXTRA_DIST): Ditto.
- * Makefile.in: Rebuilt.
-
-2013-02-08 Anthony Green <green@moxielogic.com>
-
- * configure.ac: Move sparc asm config checks to within functions
- for compatibility with sun tools.
- * configure: Rebuilt.
- * src/sparc/ffi.c (ffi_prep_closure_loc): Flush cache on v9
- systems.
- * src/sparc/v8.S (ffi_flush_icache): Implement a sparc v9 cache
- flusher.
-
-2013-02-08 Nathan Rossi <nathan.rossi@xilinx.com>
-
- * src/microblaze/ffi.c (ffi_closure_call_SYSV): Fix handling of
- small big-endian structures.
- (ffi_prep_args): Ditto.
-
-2013-02-07 Anthony Green <green@moxielogic.com>
-
- * src/sparc/v8.S (ffi_call_v8): Fix typo from last patch
- (effectively hiding ffi_call_v8).
-
-2013-02-07 Anthony Green <green@moxielogic.com>
-
- * configure.ac: Update bug reporting address.
- * configure.in: Rebuild.
-
- * src/sparc/v8.S (ffi_flush_icache): Out-of-line cache flusher for
- Sun compiler.
- * src/sparc/ffi.c (ffi_call): Remove warning.
- Call ffi_flush_icache for non-GCC builds.
- (ffi_prep_closure_loc): Use ffi_flush_icache.
-
- * Makefile.am (EXTRA_DIST): Add libtool-ldflags.
- * Makefile.in: Rebuilt.
- * libtool-ldflags: New file.
-
-2013-02-07 Daniel Schepler <dschepler@gmail.com>
-
- * configure.ac: Correctly identify x32 systems as 64-bit.
- * m4/libtool.m4: Remove libtool expr error.
- * aclocal.m4, configure: Rebuilt.
-
-2013-02-07 Anthony Green <green@moxielogic.com>
-
- * configure.ac: Fix GCC usage test.
- * configure: Rebuilt.
- * README: Mention LLVM/GCC x86_64 issue.
- * testsuite/Makefile.in: Rebuilt.
-
-2013-02-07 Anthony Green <green@moxielogic.com>
-
- * testsuite/libffi.call/cls_double_va.c (main): Replace // style
- comments with /* */ for xlc compiler.
- * testsuite/libffi.call/stret_large.c (main): Ditto.
- * testsuite/libffi.call/stret_large2.c (main): Ditto.
- * testsuite/libffi.call/nested_struct1.c (main): Ditto.
- * testsuite/libffi.call/huge_struct.c (main): Ditto.
- * testsuite/libffi.call/float_va.c (main): Ditto.
- * testsuite/libffi.call/cls_struct_va1.c (main): Ditto.
- * testsuite/libffi.call/cls_pointer_stack.c (main): Ditto.
- * testsuite/libffi.call/cls_pointer.c (main): Ditto.
- * testsuite/libffi.call/cls_longdouble_va.c (main): Ditto.
-
-2013-02-06 Anthony Green <green@moxielogic.com>
-
- * man/ffi_prep_cif.3: Clean up for debian lintian checker.
-
-2013-02-06 Anthony Green <green@moxielogic.com>
-
- * Makefile.am (pkgconfigdir): Add missing pkgconfig install bits.
- * Makefile.in: Rebuild.
-
-2013-02-02 Mark H Weaver <mhw@netris.org>
-
- * src/x86/ffi64.c (ffi_call): Sign-extend integer arguments passed
- via general purpose registers.
-
-2013-01-21 Nathan Rossi <nathan.rossi@xilinx.com>
-
- * README: Add MicroBlaze details.
- * Makefile.am: Add MicroBlaze support.
- * configure.ac: Likewise.
- * src/microblaze/ffi.c: New.
- * src/microblaze/ffitarget.h: Likewise.
- * src/microblaze/sysv.S: Likewise.
-
-2013-01-21 Nathan Rossi <nathan.rossi@xilinx.com>
- * testsuite/libffi.call/return_uc.c: Fixed issue.
-
-2013-01-21 Chris Zankel <chris@zankel.net>
-
- * README: Add Xtensa support.
- * Makefile.am: Likewise.
- * configure.ac: Likewise.
- * Makefile.in Regenerate.
- * configure: Likewise.
- * src/prep_cif.c: Handle Xtensa.
- * src/xtensa: New directory.
- * src/xtensa/ffi.c: New file.
- * src/xtensa/ffitarget.h: Ditto.
- * src/xtensa/sysv.S: Ditto.
-
-2013-01-11 Anthony Green <green@moxielogic.com>
-
- * src/powerpc/ffi_darwin.c (ffi_prep_args): Replace // style
- comments with /* */ for xlc compiler.
- * src/powerpc/aix.S (ffi_call_AIX): Ditto.
- * testsuite/libffi.call/ffitest.h (allocate_mmap): Delete
- deprecated inline function.
- * testsuite/libffi.special/ffitestcxx.h: Ditto.
- * README: Add update for AIX support.
-
-2013-01-11 Anthony Green <green@moxielogic.com>
-
- * configure.ac: Robustify pc relative reloc check.
- * m4/ax_cc_maxopt.m4: Don't -malign-double. This is an ABI
- changing option for 32-bit x86.
- * aclocal.m4, configure: Rebuilt.
- * README: Update supported target list.
-
-2013-01-10 Anthony Green <green@moxielogic.com>
-
- * README (tested): Add Compiler column to table.
-
-2013-01-10 Anthony Green <green@moxielogic.com>
-
- * src/x86/ffi64.c (struct register_args): Make sse array and array
- of unions for sunpro compiler compatibility.
-
-2013-01-10 Anthony Green <green@moxielogic.com>
-
- * configure.ac: Test target platform size_t size. Handle both 32
- and 64-bit builds for x86_64-* and i?86-* targets (allowing for
- CFLAG option to change default settings).
- * configure, aclocal.m4: Rebuilt.
-
-2013-01-10 Anthony Green <green@moxielogic.com>
-
- * testsuite/libffi.special/special.exp: Only run exception
- handling tests when using GNU compiler.
-
- * m4/ax_compiler_vendor.m4: New file.
- * configure.ac: Test for compiler vendor and don't use
- AX_CFLAGS_WARN_ALL with the sun compiler.
- * aclocal.m4, configure: Rebuilt.
-
-2013-01-10 Anthony Green <green@moxielogic.com>
-
- * include/ffi_common.h: Don't use GCCisms to define types when
- building with the SUNPRO compiler.
-
-2013-01-10 Anthony Green <green@moxielogic.com>
-
- * configure.ac: Put local.exp in the right place.
- * configure: Rebuilt.
-
- * src/x86/ffi.c: Update comment about regparm function attributes.
- * src/x86/sysv.S (ffi_closure_SYSV): The SUNPRO compiler requires
- that all function arguments be passed on the stack (no regparm
- support).
-
-2013-01-08 Anthony Green <green@moxielogic.com>
-
- * configure.ac: Generate local.exp. This sets CC_FOR_TARGET
- when we are using the vendor compiler.
- * testsuite/Makefile.am (EXTRA_DEJAGNU_SITE_CONFIG): Point to
- ../local.exp.
- * configure, testsuite/Makefile.in: Rebuilt.
-
- * testsuite/libffi.call/call.exp: Run tests with different
- options, depending on whether or not we are using gcc or the
- vendor compiler.
- * testsuite/lib/libffi.exp (libffi-init): Set using_gcc based on
- whether or not we are building/testing with gcc.
-
-2013-01-08 Anthony Green <green@moxielogic.com>
-
- * configure.ac: Switch x86 solaris target to X86 by default.
- * configure: Rebuilt.
-
-2013-01-08 Anthony Green <green@moxielogic.com>
-
- * configure.ac: Fix test for read-only eh_frame.
- * configure: Rebuilt.
-
-2013-01-08 Anthony Green <green@moxielogic.com>
-
- * src/x86/sysv.S, src/x86/unix64.S: Only emit DWARF unwind info
- when building with the GNU toolchain.
- * testsuite/libffi.call/ffitest.h (CHECK): Fix for Solaris vendor
- compiler.
-
-2013-01-07 Thorsten Glaser <tg@mirbsd.org>
-
- * testsuite/libffi.call/cls_uchar_va.c,
- testsuite/libffi.call/cls_ushort_va.c,
- testsuite/libffi.call/va_1.c: Testsuite fixes.
-
-2013-01-07 Thorsten Glaser <tg@mirbsd.org>
-
- * src/m68k/ffi.c (CIF_FLAGS_SINT8, CIF_FLAGS_SINT16): Define.
- (ffi_prep_cif_machdep): Fix 8-bit and 16-bit signed calls.
- * src/m68k/sysv.S (ffi_call_SYSV, ffi_closure_SYSV): Ditto.
-
-2013-01-04 Anthony Green <green@moxielogic.com>
-
- * Makefile.am (AM_CFLAGS): Don't automatically add -fexceptions
- and -Wall. This is set in the configure script after testing for
- GCC.
- * Makefile.in: Rebuilt.
-
-2013-01-02 rofl0r <https://github.com/rofl0r>
-
- * src/powerpc/ffi.c (ffi_prep_cif_machdep): Fix build error on ppc
- when long double == double.
-
-2013-01-02 Reini Urban <rurban@x-ray.at>
-
- * Makefile.am (libffi_la_LDFLAGS): Add -no-undefined to LDFLAGS
- (required for shared libs on cygwin/mingw).
- * Makefile.in: Rebuilt.
-
-2012-10-31 Alan Modra <amodra@gmail.co>
-
- * src/powerpc/linux64_closure.S: Add new ABI support.
- * src/powerpc/linux64.S: Likewise.
-
-2012-10-30 Magnus Granberg <zorry@gentoo.org>
- Pavel Labushev <pavel.labushev@runbox.ru>
-
- * configure.ac: New options pax_emutramp
- * configure, fficonfig.h.in: Regenerated
- * src/closures.c: New function emutramp_enabled_check() and
- checks.
-
-2012-10-30 Frederick Cheung <frederick.cheung@gmail.com>
-
- * configure.ac: Enable FFI_MAP_EXEC_WRIT for Darwin 12 (mountain
- lion) and future version.
- * configure: Rebuild.
-
-2012-10-30 James Greenhalgh <james.greenhalgh at arm.com>
- Marcus Shawcroft <marcus.shawcroft at arm.com>
-
- * README: Add details of aarch64 port.
- * src/aarch64/ffi.c: New.
- * src/aarch64/ffitarget.h: Likewise.
- * src/aarch64/sysv.S: Likewise.
- * Makefile.am: Support aarch64.
- * configure.ac: Support aarch64.
- * Makefile.in, configure: Rebuilt.
-
-2012-10-30 James Greenhalgh <james.greenhalgh at arm.com>
- Marcus Shawcroft <marcus.shawcroft at arm.com>
-
- * testsuite/lib/libffi.exp: Add support for aarch64.
- * testsuite/libffi.call/cls_struct_va1.c: New.
- * testsuite/libffi.call/cls_uchar_va.c: Likewise.
- * testsuite/libffi.call/cls_uint_va.c: Likewise.
- * testsuite/libffi.call/cls_ulong_va.c: Likewise.
- * testsuite/libffi.call/cls_ushort_va.c: Likewise.
- * testsuite/libffi.call/nested_struct11.c: Likewise.
- * testsuite/libffi.call/uninitialized.c: Likewise.
- * testsuite/libffi.call/va_1.c: Likewise.
- * testsuite/libffi.call/va_struct1.c: Likewise.
- * testsuite/libffi.call/va_struct2.c: Likewise.
- * testsuite/libffi.call/va_struct3.c: Likewise.
-
-2012-10-12 Walter Lee <walt@tilera.com>
-
- * Makefile.am: Add TILE-Gx/TILEPro support.
- * configure.ac: Likewise.
- * Makefile.in: Regenerate.
- * configure: Likewise.
- * src/prep_cif.c (ffi_prep_cif_core): Handle TILE-Gx/TILEPro.
- * src/tile: New directory.
- * src/tile/ffi.c: New file.
- * src/tile/ffitarget.h: Ditto.
- * src/tile/tile.S: Ditto.
-
-2012-10-12 Matthias Klose <doko@ubuntu.com>
-
- * generate-osx-source-and-headers.py: Normalize whitespace.
-
-2012-09-14 David Edelsohn <dje.gcc@gmail.com>
-
- * configure: Regenerated.
-
-2012-08-26 Andrew Pinski <apinski@cavium.com>
-
- PR libffi/53014
- * src/mips/ffi.c (ffi_prep_closure_loc): Allow n32 with soft-float and n64 with
- soft-float.
-
-2012-08-08 Uros Bizjak <ubizjak@gmail.com>
-
- * src/s390/ffi.c (ffi_prep_closure_loc): Don't ASSERT ABI test,
- just return FFI_BAD_ABI when things are wrong.
-
-2012-07-18 H.J. Lu <hongjiu.lu@intel.com>
-
- PR libffi/53982
- PR libffi/53973
- * src/x86/ffitarget.h: Check __ILP32__ instead of __LP64__ for x32.
- (FFI_SIZEOF_JAVA_RAW): Defined to 4 for x32.
-
-2012-05-16 H.J. Lu <hongjiu.lu@intel.com>
-
- * configure: Regenerated.
-
-2012-05-05 Nicolas Lelong
-
- * libffi.xcodeproj/project.pbxproj: Fixes.
- * README: Update for iOS builds.
-
-2012-04-23 Alexandre Keunecke I. de Mendonca <alexandre.keunecke@gmail.com>
-
- * configure.ac: Add Blackfin/sysv support
- * Makefile.am: Add Blackfin/sysv support
- * src/bfin/ffi.c: Add Blackfin/sysv support
- * src/bfin/ffitarget.h: Add Blackfin/sysv support
-
-2012-04-11 Anthony Green <green@moxielogic.com>
-
- * Makefile.am (EXTRA_DIST): Add new script.
- * Makefile.in: Rebuilt.
-
-2012-04-11 Zachary Waldowski <zwaldowski@gmail.com>
-
- * generate-ios-source-and-headers.py,
- libffi.xcodeproj/project.pbxproj: Support a Mac static library via
- Xcode. Set iOS compatibility to 4.0. Move iOS trampoline
- generation into an Xcode "run script" phase. Include both as
- Xcode build scripts. Don't always regenerate config files.
-
-2012-04-10 Anthony Green <green@moxielogic.com>
-
- * src/powerpc/ffi_darwin.c (ffi_prep_args): Add missing semicolon.
-
-2012-04-06 Anthony Green <green@moxielogic.com>
-
- * Makefile.am (EXTRA_DIST): Add new iOS/xcode files.
- * Makefile.in: Rebuilt.
-
-2012-04-06 Mike Lewis <mikelikespie@gmail.com>
-
- * generate-ios-source-and-headers.py: New file.
- * libffi.xcodeproj/project.pbxproj: New file.
- * README: Update instructions on building iOS binary.
- * build-ios.sh: Delete.
-
-2012-04-06 Anthony Green <green@moxielogic.com>
-
- * src/x86/ffi64.c (UINT128): Define differently for Intel and GNU
- compilers, then use it.
-
-2012-04-06 H.J. Lu <hongjiu.lu@intel.com>
-
- * m4/libtool.m4 (_LT_ENABLE_LOCK): Support x32.
-
-2012-04-06 Anthony Green <green@moxielogic.com>
-
- * testsuite/Makefile.am (EXTRA_DIST): Add missing test cases.
- * testsuite/Makefile.in: Rebuilt.
-
-2012-04-05 Zachary Waldowski <zwaldowski@gmail.com>
-
- * include/ffi.h.in: Add missing trampoline table fields.
- * src/arm/sysv.S: Fix ENTRY definition, and wrap symbol references
- in CNAME.
- * src/x86/ffi.c: Wrap Windows specific code in ifdefs.
-
-2012-04-02 Peter Bergner <bergner@vnet.ibm.com>
-
- * src/powerpc/ffi.c (ffi_prep_args_SYSV): Declare double_tmp.
- Silence casting pointer to integer of different size warning.
- Delete goto to previously deleted label.
- (ffi_call): Silence possibly undefined warning.
- (ffi_closure_helper_SYSV): Declare variable type.
-
-2012-04-02 Peter Rosin <peda@lysator.liu.se>
-
- * src/x86/win32.S (ffi_call_win32): Sign/zero extend the return
- value in the Intel version as is already done for the AT&T version.
- (ffi_closure_SYSV): Likewise.
- (ffi_closure_raw_SYSV): Likewise.
- (ffi_closure_STDCALL): Likewise.
-
-2012-03-29 Peter Rosin <peda@lysator.liu.se>
-
- * src/x86/win32.S (ffi_closure_raw_THISCALL): Unify the frame
- generation, fix the ENDP label and remove the surplus third arg
- from the 'lea' insn.
-
-2012-03-29 Peter Rosin <peda@lysator.liu.se>
-
- * src/x86/win32.S (ffi_closure_raw_SYSV): Make the 'stubraw' label
- visible outside the PROC, so that ffi_closure_raw_THISCALL can see
- it. Also instruct the assembler to add a frame to the function.
-
-2012-03-23 Peter Rosin <peda@lysator.liu.se>
-
- * Makefile.am (AM_CPPFLAGS): Add -DFFI_BUILDING.
- * Makefile.in: Rebuilt.
- * include/ffi.h.in [MSVC]: Add __declspec(dllimport) decorations
- to all data exports, when compiling libffi clients using MSVC.
-
-2012-03-29 Peter Rosin <peda@lysator.liu.se>
-
- * src/x86/ffitarget.h (ffi_abi): Add new ABI FFI_MS_CDECL and
- make it the default for MSVC.
- (FFI_TYPE_MS_STRUCT): New structure return convention.
- * src/x86/ffi.c (ffi_prep_cif_machdep): Tweak the structure
- return convention for FFI_MS_CDECL to be FFI_TYPE_MS_STRUCT
- instead of an ordinary FFI_TYPE_STRUCT.
- (ffi_prep_args): Treat FFI_TYPE_MS_STRUCT as FFI_TYPE_STRUCT.
- (ffi_call): Likewise.
- (ffi_prep_incoming_args_SYSV): Likewise.
- (ffi_raw_call): Likewise.
- (ffi_prep_closure_loc): Treat FFI_MS_CDECL as FFI_SYSV.
- * src/x86/win32.S (ffi_closure_SYSV): For FFI_TYPE_MS_STRUCT,
- return a pointer to the result structure in eax and don't pop
- that pointer from the stack, the caller takes care of it.
- (ffi_call_win32): Treat FFI_TYPE_MS_STRUCT as FFI_TYPE_STRUCT.
- (ffi_closure_raw_SYSV): Likewise.
-
-2012-03-22 Peter Rosin <peda@lysator.liu.se>
-
- * testsuite/libffi.call/closure_stdcall.c [MSVC]: Add inline
- assembly version with Intel syntax.
- * testsuite/libffi.call/closure_thiscall.c [MSVC]: Likewise.
-
-2012-03-23 Peter Rosin <peda@lysator.liu.se>
-
- * testsuite/libffi.call/ffitest.h: Provide abstration of
- __attribute__((fastcall)) in the form of a __FASTCALL__
- define. Define it to __fastcall for MSVC.
- * testsuite/libffi.call/fastthis1_win32.c: Use the above.
- * testsuite/libffi.call/fastthis2_win32.c: Likewise.
- * testsuite/libffi.call/fastthis3_win32.c: Likewise.
- * testsuite/libffi.call/strlen2_win32.c: Likewise.
- * testsuite/libffi.call/struct1_win32.c: Likewise.
- * testsuite/libffi.call/struct2_win32.c: Likewise.
-
-2012-03-22 Peter Rosin <peda@lysator.liu.se>
-
- * src/x86/win32.S [MSVC] (ffi_closure_THISCALL): Remove the manual
- frame on function entry, MASM adds one automatically.
-
-2012-03-22 Peter Rosin <peda@lysator.liu.se>
-
- * testsuite/libffi.call/ffitest.h [MSVC]: Add kludge for missing
- bits in the MSVC headers.
-
-2012-03-22 Peter Rosin <peda@lysator.liu.se>
-
- * testsuite/libffi.call/cls_12byte.c: Adjust to the C89 style
- with no declarations after statements.
- * testsuite/libffi.call/cls_16byte.c: Likewise.
- * testsuite/libffi.call/cls_18byte.c: Likewise.
- * testsuite/libffi.call/cls_19byte.c: Likewise.
- * testsuite/libffi.call/cls_1_1byte.c: Likewise.
- * testsuite/libffi.call/cls_20byte.c: Likewise.
- * testsuite/libffi.call/cls_20byte1.c: Likewise.
- * testsuite/libffi.call/cls_24byte.c: Likewise.
- * testsuite/libffi.call/cls_2byte.c: Likewise.
- * testsuite/libffi.call/cls_3_1byte.c: Likewise.
- * testsuite/libffi.call/cls_3byte1.c: Likewise.
- * testsuite/libffi.call/cls_3byte2.c: Likewise.
- * testsuite/libffi.call/cls_4_1byte.c: Likewise.
- * testsuite/libffi.call/cls_4byte.c: Likewise.
- * testsuite/libffi.call/cls_5_1_byte.c: Likewise.
- * testsuite/libffi.call/cls_5byte.c: Likewise.
- * testsuite/libffi.call/cls_64byte.c: Likewise.
- * testsuite/libffi.call/cls_6_1_byte.c: Likewise.
- * testsuite/libffi.call/cls_6byte.c: Likewise.
- * testsuite/libffi.call/cls_7_1_byte.c: Likewise.
- * testsuite/libffi.call/cls_7byte.c: Likewise.
- * testsuite/libffi.call/cls_8byte.c: Likewise.
- * testsuite/libffi.call/cls_9byte1.c: Likewise.
- * testsuite/libffi.call/cls_9byte2.c: Likewise.
- * testsuite/libffi.call/cls_align_double.c: Likewise.
- * testsuite/libffi.call/cls_align_float.c: Likewise.
- * testsuite/libffi.call/cls_align_longdouble.c: Likewise.
- * testsuite/libffi.call/cls_align_longdouble_split.c: Likewise.
- * testsuite/libffi.call/cls_align_longdouble_split2.c: Likewise.
- * testsuite/libffi.call/cls_align_pointer.c: Likewise.
- * testsuite/libffi.call/cls_align_sint16.c: Likewise.
- * testsuite/libffi.call/cls_align_sint32.c: Likewise.
- * testsuite/libffi.call/cls_align_sint64.c: Likewise.
- * testsuite/libffi.call/cls_align_uint16.c: Likewise.
- * testsuite/libffi.call/cls_align_uint32.c: Likewise.
- * testsuite/libffi.call/cls_align_uint64.c: Likewise.
- * testsuite/libffi.call/cls_dbls_struct.c: Likewise.
- * testsuite/libffi.call/cls_pointer_stack.c: Likewise.
- * testsuite/libffi.call/err_bad_typedef.c: Likewise.
- * testsuite/libffi.call/huge_struct.c: Likewise.
- * testsuite/libffi.call/nested_struct.c: Likewise.
- * testsuite/libffi.call/nested_struct1.c: Likewise.
- * testsuite/libffi.call/nested_struct10.c: Likewise.
- * testsuite/libffi.call/nested_struct2.c: Likewise.
- * testsuite/libffi.call/nested_struct3.c: Likewise.
- * testsuite/libffi.call/nested_struct4.c: Likewise.
- * testsuite/libffi.call/nested_struct5.c: Likewise.
- * testsuite/libffi.call/nested_struct6.c: Likewise.
- * testsuite/libffi.call/nested_struct7.c: Likewise.
- * testsuite/libffi.call/nested_struct8.c: Likewise.
- * testsuite/libffi.call/nested_struct9.c: Likewise.
- * testsuite/libffi.call/stret_large.c: Likewise.
- * testsuite/libffi.call/stret_large2.c: Likewise.
- * testsuite/libffi.call/stret_medium.c: Likewise.
- * testsuite/libffi.call/stret_medium2.c: Likewise.
- * testsuite/libffi.call/struct1.c: Likewise.
- * testsuite/libffi.call/struct1_win32.c: Likewise.
- * testsuite/libffi.call/struct2.c: Likewise.
- * testsuite/libffi.call/struct2_win32.c: Likewise.
- * testsuite/libffi.call/struct3.c: Likewise.
- * testsuite/libffi.call/struct4.c: Likewise.
- * testsuite/libffi.call/struct5.c: Likewise.
- * testsuite/libffi.call/struct6.c: Likewise.
- * testsuite/libffi.call/struct7.c: Likewise.
- * testsuite/libffi.call/struct8.c: Likewise.
- * testsuite/libffi.call/struct9.c: Likewise.
- * testsuite/libffi.call/testclosure.c: Likewise.
-
-2012-03-21 Peter Rosin <peda@lysator.liu.se>
-
- * testsuite/libffi.call/float_va.c (float_va_fn): Use %f when
- printing doubles (%lf is for long doubles).
- (main): Likewise.
-
-2012-03-21 Peter Rosin <peda@lysator.liu.se>
-
- * testsuite/lib/target-libpath.exp [*-*-cygwin*, *-*-mingw*]
- (set_ld_library_path_env_vars): Add the library search dir to PATH
- (and save PATH for later).
- (restore_ld_library_path_env_vars): Restore PATH.
-
-2012-03-21 Peter Rosin <peda@lysator.liu.se>
-
- * testsuite/lib/target-libpath.exp [*-*-cygwin*, *-*-mingw*]
- (set_ld_library_path_env_vars): Add the library search dir to PATH
- (and save PATH for later).
- (restore_ld_library_path_env_vars): Restore PATH.
-
-2012-03-20 Peter Rosin <peda@lysator.liu.se>
-
- * testsuite/libffi.call/strlen2_win32.c (main): Remove bug.
- * src/x86/win32.S [MSVC] (ffi_closure_SYSV): Make the 'stub' label
- visible outside the PROC, so that ffi_closure_THISCALL can see it.
-
-2012-03-20 Peter Rosin <peda@lysator.liu.se>
-
- * testsuite/libffi.call/strlen2_win32.c (main): Remove bug.
- * src/x86/win32.S [MSVC] (ffi_closure_SYSV): Make the 'stub' label
- visible outside the PROC, so that ffi_closure_THISCALL can see it.
-
-2012-03-19 Alan Hourihane <alanh@fairlite.co.uk>
-
- * src/m68k/ffi.c: Add MINT support.
- * src/m68k/sysv.S: Ditto.
-
-2012-03-06 Chung-Lin Tang <cltang@codesourcery.com>
-
- * src/arm/ffi.c (ffi_call): Add __ARM_EABI__ guard around call to
- ffi_call_VFP().
- (ffi_prep_closure_loc): Add __ARM_EABI__ guard around use of
- ffi_closure_VFP.
- * src/arm/sysv.S: Add __ARM_EABI__ guard around VFP code.
-
-2012-03-19 chennam <csit@axway.com>
-
- * src/powerpc/ffi_darwin.c (ffi_prep_closure_loc): Fix AIX closure
- support.
-
-2012-03-13 Kaz Kojima <kkojima@gcc.gnu.org>
-
- * src/sh/ffi.c (ffi_prep_closure_loc): Don't ASSERT ABI test,
- just return FFI_BAD_ABI when things are wrong.
- * src/sh64/ffi.c (ffi_prep_closure_loc): Ditto.
-
-2012-03-09 David Edelsohn <dje.gcc@gmail.com>
-
- * src/powerpc/aix_closure.S (ffi_closure_ASM): Adjust for Darwin64
- change to return value of ffi_closure_helper_DARWIN and load type
- from return type.
-
-2012-03-03 H.J. Lu <hongjiu.lu@intel.com>
-
- * src/x86/ffi64.c (ffi_call): Cast the return value to unsigned
- long.
- (ffi_prep_closure_loc): Cast to 64bit address in trampoline.
- (ffi_closure_unix64_inner): Cast return pointer to unsigned long
- first.
-
- * src/x86/ffitarget.h (FFI_SIZEOF_ARG): Defined to 8 for x32.
- (ffi_arg): Set to unsigned long long for x32.
- (ffi_sarg): Set to long long for x32.
-
-2012-03-03 H.J. Lu <hongjiu.lu@intel.com>
-
- * src/prep_cif.c (ffi_prep_cif_core): Properly check bad ABI.
-
-2012-03-03 Andoni Morales Alastruey <ylatuya@gmail.com>
-
- * configure.ac: Add -no-undefined for both 32- and 64-bit x86
- windows-like hosts.
- * configure: Rebuilt.
-
-2012-02-27 Mikael Pettersson <mikpe@it.uu.se>
-
- PR libffi/52223
- * Makefile.am (FLAGS_TO_PASS): Define.
- * Makefile.in: Regenerate.
-
-2012-02-23 Anthony Green <green@moxielogic.com>
-
- * src/*/ffitarget.h: Ensure that users never include ffitarget.h
- directly.
-
-2012-02-23 Kai Tietz <ktietz@redhat.com>
-
- PR libffi/52221
- * src/x86/ffi.c (ffi_closure_raw_THISCALL): New
- prototype.
- (ffi_prep_raw_closure_loc): Use ffi_closure_raw_THISCALL for
- thiscall-convention.
- (ffi_raw_call): Use ffi_prep_args_raw.
- * src/x86/win32.S (ffi_closure_raw_THISCALL): Add
- implementation for stub.
-
-2012-02-10 Kai Tietz <ktietz@redhat.com>
-
- * configure.ac (AM_LTLDFLAGS): Add -no-undefine for x64
- windows target.
- * configure: Regenerated.
-
-2012-02-08 Kai Tietz <ktietz@redhat.com>
-
- * src/prep_cif.c (ffi_prep_cif): Allow for X86_WIN32
- also FFI_THISCALL.
- * src/x86/ffi.c (ffi_closure_THISCALL): Add prototype.
- (FFI_INIT_TRAMPOLINE_THISCALL): New trampoline code.
- (ffi_prep_closure_loc): Add FFI_THISCALL support.
- * src/x86/ffitarget.h (FFI_TRAMPOLINE_SIZE): Adjust size.
- * src/x86/win32.S (ffi_closure_THISCALL): New closure code
- for thiscall-calling convention.
- * testsuite/libffi.call/closure_thiscall.c: New test.
-
-2012-01-28 Kai Tietz <ktietz@redhat.com>
-
- * src/libffi/src/x86/ffi.c (ffi_call_win32): Add new
- argument to prototype for specify calling-convention.
- (ffi_call): Add support for stdcall/thiscall convention.
- (ffi_prep_args): Likewise.
- (ffi_raw_call): Likewise.
- * src/x86/ffitarget.h (ffi_abi): Add FFI_THISCALL and
- FFI_FASTCALL.
- * src/x86/win32.S (_ffi_call_win32): Add support for
- fastcall/thiscall calling-convention calls.
- * testsuite/libffi.call/fastthis1_win32.c: New test.
- * testsuite/libffi.call/fastthis2_win32.c: New test.
- * testsuite/libffi.call/fastthis3_win32.c: New test.
- * testsuite/libffi.call/strlen2_win32.c: New test.
- * testsuite/libffi.call/many2_win32.c: New test.
- * testsuite/libffi.call/struct1_win32.c: New test.
- * testsuite/libffi.call/struct2_win32.c: New test.
-
-2012-01-23 Uros Bizjak <ubizjak@gmail.com>
-
- * src/alpha/ffi.c (ffi_prep_closure_loc): Check for bad ABI.
-
-2012-01-23 Anthony Green <green@moxielogic.com>
- Chris Young <cdyoung@ntlworld.com>
-
- * configure.ac: Add Amiga support.
- * configure: Rebuilt.
-
-2012-01-23 Dmitry Nadezhin <dmitry.nadezhin@gmail.com>
-
- * include/ffi_common.h (LIKELY, UNLIKELY): Fix definitions.
-
-2012-01-23 Andreas Schwab <schwab@linux-m68k.org>
-
- * src/m68k/sysv.S (ffi_call_SYSV): Properly test for plain
- mc68000. Test for __HAVE_68881__ in addition to __MC68881__.
-
-2012-01-19 Jakub Jelinek <jakub@redhat.com>
-
- PR rtl-optimization/48496
- * src/ia64/ffi.c (ffi_call): Fix up aliasing violations.
-
-2012-01-09 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
-
- * configure.ac (i?86-*-*): Set TARGET to X86_64.
- * configure: Regenerate.
-
-2011-12-07 Andrew Pinski <apinski@cavium.com>
-
- PR libffi/50051
- * src/mips/n32.S: Add ".set mips4".
-
-2011-11-21 Andreas Tobler <andreast@fgznet.ch>
-
- * configure: Regenerate.
-
-2011-11-12 David Gilbert <david.gilbert@linaro.org>
-
- * doc/libffi.texi, include/ffi.h.in, include/ffi_common.h,
- man/Makefile.am, man/ffi.3, man/ffi_prep_cif.3,
- man/ffi_prep_cif_var.3, src/arm/ffi.c, src/arm/ffitarget.h,
- src/cris/ffi.c, src/prep_cif.c,
- testsuite/libffi.call/cls_double_va.c,
- testsuite/libffi.call/cls_longdouble_va.c,
- testsuite/libffi.call/float_va.c: Many changes to support variadic
- function calls.
-
-2011-11-12 Kyle Moffett <Kyle.D.Moffett@boeing.com>
-
- * src/powerpc/ffi.c, src/powerpc/ffitarget.h,
- src/powerpc/ppc_closure.S, src/powerpc/sysv.S: Many changes for
- softfloat powerpc variants.
-
-2011-11-12 Petr Salinger <Petr.Salinger@seznam.cz>
-
- * configure.ac (FFI_EXEC_TRAMPOLINE_TABLE): Fix kfreebsd support.
- * configure: Rebuilt.
-
-2011-11-12 Timothy Wall <twall@users.sf.net>
-
- * src/arm/ffi.c (ffi_prep_args, ffi_prep_incoming_args_SYSV): Max
- alignment of 4 for wince on ARM.
-
-2011-11-12 Kyle Moffett <Kyle.D.Moffett@boeing.com>
- Anthony Green <green@moxielogic.com>
-
- * src/ppc/sysv.S, src/ppc/ffi.c: Remove use of ppc string
- instructions (not available on some cores, like the PPC440).
-
-2011-11-12 Kimura Wataru <kimuraw@i.nifty.jp>
-
- * m4/ax_enable_builddir: Change from string comparison to numeric
- comparison for wc output.
- * configure.ac: Enable FFI_MMAP_EXEC_WRIT for darwin11 aka Mac OS
- X 10.7.
- * configure: Rebuilt.
-
-2011-11-12 Anthony Green <green@moxielogic.com>
-
- * Makefile.am (AM_CCASFLAGS): Add -g option to build assembly
- files with debug info.
- * Makefile.in: Rebuilt.
-
-2011-11-12 Jasper Lievisse Adriaanse <jasper@openbsd.org>
-
- * README: Update list of supported OpenBSD systems.
-
-2011-11-12 Anthony Green <green@moxielogic.com>
-
- * libtool-version: Update.
- * Makefile.am (nodist_libffi_la_SOURCES): Add src/debug.c if
- FFI_DEBUG.
- (libffi_la_SOURCES): Remove src/debug.c
- (EXTRA_DIST): Add src/debug.c
- * Makefile.in: Rebuilt.
- * README: Update for 3.0.11.
-
-2011-11-10 Richard Henderson <rth@redhat.com>
-
- * configure.ac (GCC_AS_CFI_PSEUDO_OP): Use it instead of inline check.
- * configure, aclocal.m4: Rebuild.
-
-2011-09-04 Iain Sandoe <iains@gcc.gnu.org>
-
- PR libffi/49594
- * src/powerpc/darwin_closure.S (stubs): Make the stub binding
- helper reference track the architecture pointer size.
-
-2011-08-25 Andrew Haley <aph@redhat.com>
-
- * src/arm/ffi.c (FFI_INIT_TRAMPOLINE): Remove hard-coded assembly
- instructions.
- * src/arm/sysv.S (ffi_arm_trampoline): Put them here instead.
-
-2011-07-11 Andrew Haley <aph@redhat.com>
-
- * src/arm/ffi.c (FFI_INIT_TRAMPOLINE): Clear icache.
-
-2011-06-29 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
-
- * testsuite/libffi.call/cls_double_va.c: Move PR number to comment.
- * testsuite/libffi.call/cls_longdouble_va.c: Likewise.
-
-2011-06-29 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
-
- PR libffi/46660
- * testsuite/libffi.call/cls_double_va.c: xfail dg-output on
- mips-sgi-irix6*.
- * testsuite/libffi.call/cls_longdouble_va.c: Likewise.
-
-2011-06-14 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
-
- * testsuite/libffi.call/huge_struct.c (test_large_fn): Use PRIu8,
- PRId8 instead of %hhu, %hhd.
- * testsuite/libffi.call/ffitest.h [__alpha__ && __osf__] (PRId8,
- PRIu8): Define.
- [__sgi__] (PRId8, PRIu8): Define.
-
-2011-04-29 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
-
- * src/alpha/osf.S (UA_SI, FDE_ENCODING, FDE_ENCODE, FDE_ARANGE):
- Define.
- Use them to handle ELF vs. ECOFF differences.
- [__osf__] (_GLOBAL__F_ffi_call_osf): Define.
-
-2011-03-30 Timothy Wall <twall@users.sf.net>
-
- * src/powerpc/darwin.S: Fix unknown FDE encoding.
- * src/powerpc/darwin_closure.S: ditto.
-
-2011-02-25 Anthony Green <green@moxielogic.com>
-
- * src/powerpc/ffi.c (ffi_prep_closure_loc): Allow for more
- 32-bit ABIs.
-
-2011-02-15 Anthony Green <green@moxielogic.com>
-
- * m4/ax_cc_maxopt.m4: Don't -malign-double or use -ffast-math.
- * configure: Rebuilt.
-
-2011-02-13 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
-
- * configure: Regenerate.
-
-2011-02-13 Anthony Green <green@moxielogic.com>
-
- * include/ffi_common.h (UNLIKELY, LIKELY): Define.
- * src/x86/ffi64.c (UNLIKELY, LIKELY): Remove definition.
- * src/prep_cif.c (UNLIKELY, LIKELY): Remove definition.
-
- * src/prep_cif.c (initialize_aggregate): Convert assertion into
- FFI_BAD_TYPEDEF return. Initialize arg size and alignment to 0.
-
- * src/pa/ffi.c (ffi_prep_closure_loc): Don't ASSERT ABI test,
- just return FFI_BAD_ABI when things are wrong.
- * src/arm/ffi.c (ffi_prep_closure_loc): Ditto.
- * src/powerpc/ffi.c (ffi_prep_closure_loc): Ditto.
- * src/mips/ffi.c (ffi_prep_closure_loc): Ditto.
- * src/ia64/ffi.c (ffi_prep_closure_loc): Ditto.
- * src/avr32/ffi.c (ffi_prep_closure_loc): Ditto.
-
-2011-02-11 Anthony Green <green@moxielogic.com>
-
- * src/sparc/ffi.c (ffi_prep_closure_loc): Don't ASSERT ABI test,
- just return FFI_BAD_ABI when things are wrong.
-
-2012-02-11 Eric Botcazou <ebotcazou@adacore.com>
-
- * src/sparc/v9.S (STACKFRAME): Bump to 176.
-
-2011-02-09 Stuart Shelton <srcshelton@gmail.com>
-
- http://bugs.gentoo.org/show_bug.cgi?id=286911
- * src/mips/ffitarget.h: Clean up error messages.
- * src/java_raw_api.c (ffi_java_translate_args): Cast raw arg to
- ffi_raw*.
- * include/ffi.h.in: Add pragma for SGI compiler.
-
-2011-02-09 Anthony Green <green@moxielogic.com>
-
- * configure.ac: Add powerpc64-*-darwin* support.
-
-2011-02-09 Anthony Green <green@moxielogic.com>
-
- * README: Mention Interix.
-
-2011-02-09 Jonathan Callen <abcd@gentoo.org>
-
- * configure.ac: Add Interix to win32/cygwin/mingw case.
- * configure: Ditto.
- * src/closures.c: Treat Interix like Cygwin, instead of as a
- generic win32.
-
-2011-02-09 Anthony Green <green@moxielogic.com>
-
- * testsuite/libffi.call/err_bad_typedef.c: Remove xfail.
- * testsuite/libffi.call/err_bad_abi.c: Remove xfail.
- * src/x86/ffi64.c (UNLIKELY, LIKELY): Define.
- (ffi_prep_closure_loc): Check for bad ABI.
- * src/prep_cif.c (UNLIKELY, LIKELY): Define.
- (initialize_aggregate): Check for bad types.
-
-2011-02-09 Landon Fuller <landonf@plausible.coop>
-
- * Makefile.am (EXTRA_DIST): Add build-ios.sh, src/arm/gentramp.sh,
- src/arm/trampoline.S.
- (nodist_libffi_la_SOURCES): Add src/arc/trampoline.S.
- * configure.ac (FFI_EXEC_TRAMPOLINE_TABLE): Define.
- * src/arm/ffi.c (ffi_trampoline_table)
- (ffi_closure_trampoline_table_page, ffi_trampoline_table_entry)
- (FFI_TRAMPOLINE_CODELOC_CONFIG, FFI_TRAMPOLINE_CONFIG_PAGE_OFFSET)
- (FFI_TRAMPOLINE_COUNT, ffi_trampoline_lock, ffi_trampoline_tables)
- (ffi_trampoline_table_alloc, ffi_closure_alloc, ffi_closure_free):
- Define for FFI_EXEC_TRAMPOLINE_TABLE case (iOS).
- (ffi_prep_closure_loc): Handl FFI_EXEC_TRAMPOLINE_TABLE case
- separately.
- * src/arm/sysv.S: Handle Apple iOS host.
- * src/closures.c: Handle FFI_EXEC_TRAMPOLINE_TABLE case.
- * build-ios.sh: New file.
- * fficonfig.h.in, configure, Makefile.in: Rebuilt.
- * README: Mention ARM iOS.
-
-2011-02-08 Oren Held <orenhe@il.ibm.com>
-
- * src/dlmalloc.c (_STRUCT_MALLINFO): Define in order to avoid
- redefinition of mallinfo on HP-UX.
-
-2011-02-08 Ginn Chen <ginn.chen@oracle.com>
-
- * src/sparc/ffi.c (ffi_call): Make compatible with Solaris Studio
- aggregate return ABI. Flush cache.
- (ffi_prep_closure_loc): Flush cache.
-
-2011-02-11 Anthony Green <green@moxielogic.com>
-
- From Tom Honermann <tom.honermann@oracle.com>:
- * src/powerpc/aix.S (ffi_call_AIX): Support for xlc toolchain on
- AIX. Declare .ffi_prep_args. Insert nops after branch
- instructions so that the AIX linker can insert TOC reload
- instructions.
- * src/powerpc/aix_closure.S: Declare .ffi_closure_helper_DARWIN.
-
-2011-02-08 Ed <ed@kdtc.net>
-
- * src/powerpc/asm.h: Fix grammar nit in comment.
-
-2011-02-08 Uli Link <ul.mcamafia@linkitup.de>
-
- * include/ffi.h.in (FFI_64_BIT_MAX): Define and use.
-
-2011-02-09 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
-
- PR libffi/46661
- * testsuite/libffi.call/cls_pointer.c (main): Cast void * to
- uintptr_t first.
- * testsuite/libffi.call/cls_pointer_stack.c (main): Likewise.
-
-2011-02-08 Rafael Avila de Espindola <respindola@mozilla.com>
-
- * configure.ac: Fix x86 test for pc related relocs.
- * configure: Rebuilt.
-
-2011-02-07 Joel Sherrill <joel.sherrill@oarcorp.com>
-
- * libffi/src/m68k/ffi.c: Add RTEMS support for cache flushing.
- Handle case when CPU variant does not have long double support.
- * libffi/src/m68k/sysv.S: Add support for mc68000, Coldfire,
- and cores with soft floating point.
-
-2011-02-07 Joel Sherrill <joel.sherrill@oarcorp.com>
-
- * configure.ac: Add mips*-*-rtems* support.
- * configure: Regenerate.
- * src/mips/ffitarget.h: Ensure needed constants are available
- for targets which do not have sgidefs.h.
-
-2011-01-26 Dave Korn <dave.korn.cygwin@gmail.com>
-
- PR target/40125
- * configure.ac (AM_LTLDFLAGS): Add -bindir option for windows DLLs.
- * configure: Regenerate.
-
-2010-12-18 Iain Sandoe <iains@gcc.gnu.org>
-
- PR libffi/29152
- PR libffi/42378
- * src/powerpc/darwin_closure.S: Provide Darwin64 implementation,
- update comments.
- * src/powerpc/ffitarget.h (POWERPC_DARWIN64): New,
- (FFI_TRAMPOLINE_SIZE): Update for Darwin64.
- * src/powerpc/darwin.S: Provide Darwin64 implementation,
- update comments.
- * src/powerpc/ffi_darwin.c: Likewise.
-
-2010-12-06 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
-
- * configure.ac (libffi_cv_as_ascii_pseudo_op): Use double
- backslashes.
- (libffi_cv_as_string_pseudo_op): Likewise.
- * configure: Regenerate.
-
-2010-12-03 Chung-Lin Tang <cltang@codesourcery.com>
-
- * src/arm/sysv.S (ffi_closure_SYSV): Add UNWIND to .pad directive.
- (ffi_closure_VFP): Same.
- (ffi_call_VFP): Move down to before ffi_closure_VFP. Add '.fpu vfp'
- directive.
-
-2010-12-01 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
-
- * testsuite/libffi.call/ffitest.h [__sgi] (PRId64, PRIu64): Define.
- (PRIuPTR): Define.
-
-2010-11-29 Richard Henderson <rth@redhat.com>
- Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
-
- * src/x86/sysv.S (FDE_ENCODING, FDE_ENCODE): Define.
- (.eh_frame): Use FDE_ENCODING.
- (.LASFDE1, .LASFDE2, LASFDE3): Simplify with FDE_ENCODE.
-
-2010-11-22 Jacek Caban <jacek@codeweavers.com>
-
- * configure.ac: Check for symbol underscores on mingw-w64.
- * configure: Rebuilt.
- * src/x86/win64.S: Correctly access extern symbols in respect to
- underscores.
-
-2010-11-15 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
-
- * testsuite/lib/libffi-dg.exp: Rename ...
- * testsuite/lib/libffi.exp: ... to this.
- * libffi/testsuite/libffi.call/call.exp: Don't load libffi-dg.exp.
- * libffi/testsuite/libffi.special/special.exp: Likewise.
-
-2010-10-28 Chung-Lin Tang <cltang@codesourcery.com>
-
- * src/arm/ffi.c (ffi_prep_args): Add VFP register argument handling
- code, new parameter, and return value. Update comments.
- (ffi_prep_cif_machdep): Add case for VFP struct return values. Add
- call to layout_vfp_args().
- (ffi_call_SYSV): Update declaration.
- (ffi_call_VFP): New declaration.
- (ffi_call): Add VFP struct return conditions. Call ffi_call_VFP()
- when ABI is FFI_VFP.
- (ffi_closure_VFP): New declaration.
- (ffi_closure_SYSV_inner): Add new vfp_args parameter, update call to
- ffi_prep_incoming_args_SYSV().
- (ffi_prep_incoming_args_SYSV): Update parameters. Add VFP argument
- case handling.
- (ffi_prep_closure_loc): Pass ffi_closure_VFP to trampoline
- construction under VFP hard-float.
- (rec_vfp_type_p): New function.
- (vfp_type_p): Same.
- (place_vfp_arg): Same.
- (layout_vfp_args): Same.
- * src/arm/ffitarget.h (ffi_abi): Add FFI_VFP. Define FFI_DEFAULT_ABI
- based on __ARM_PCS_VFP.
- (FFI_EXTRA_CIF_FIELDS): Define for adding VFP hard-float specific
- fields.
- (FFI_TYPE_STRUCT_VFP_FLOAT): Define internally used type code.
- (FFI_TYPE_STRUCT_VFP_DOUBLE): Same.
- * src/arm/sysv.S (ffi_call_SYSV): Change call of ffi_prep_args() to
- direct call. Move function pointer load upwards.
- (ffi_call_VFP): New function.
- (ffi_closure_VFP): Same.
-
- * testsuite/lib/libffi-dg.exp (check-flags): New function.
- (dg-skip-if): New function.
- * testsuite/libffi.call/cls_double_va.c: Skip if target is arm*-*-*
- and compiler options include -mfloat-abi=hard.
- * testsuite/libffi.call/cls_longdouble_va.c: Same.
-
-2010-10-01 Jakub Jelinek <jakub@redhat.com>
-
- PR libffi/45677
- * src/x86/ffi64.c (ffi_prep_cif_machdep): Ensure cif->bytes is
- a multiple of 8.
- * testsuite/libffi.call/many2.c: New test.
-
-2010-08-20 Mark Wielaard <mjw@redhat.com>
-
- * src/closures.c (open_temp_exec_file_mnt): Check if getmntent_r
- returns NULL.
-
-2010-08-09 Andreas Tobler <andreast@fgznet.ch>
-
- * configure.ac: Add target powerpc64-*-freebsd*.
- * configure: Regenerate.
- * testsuite/libffi.call/cls_align_longdouble_split.c: Pass
- -mlong-double-128 only to linux targets.
- * testsuite/libffi.call/cls_align_longdouble_split2.c: Likewise.
- * testsuite/libffi.call/cls_longdouble.c: Likewise.
- * testsuite/libffi.call/huge_struct.c: Likewise.
-
-2010-08-05 Dan Witte <dwitte@mozilla.com>
-
- * Makefile.am: Pass FFI_DEBUG define to msvcc.sh for linking to the
- debug CRT when --enable-debug is given.
- * configure.ac: Define it.
- * msvcc.sh: Translate -g and -DFFI_DEBUG appropriately.
-
-2010-08-04 Dan Witte <dwitte@mozilla.com>
-
- * src/x86/ffitarget.h: Add X86_ANY define for all x86/x86_64
- platforms.
- * src/x86/ffi.c: Remove redundant ifdef checks.
- * src/prep_cif.c: Push stack space computation into src/x86/ffi.c
- for X86_ANY so return value space doesn't get added twice.
-
-2010-08-03 Neil Rashbrooke <neil@parkwaycc.co.uk>
-
- * msvcc.sh: Don't pass -safeseh to ml64 because behavior is buggy.
-
-2010-07-22 Dan Witte <dwitte@mozilla.com>
-
- * src/*/ffitarget.h: Make FFI_LAST_ABI one past the last valid ABI.
- * src/prep_cif.c: Fix ABI assertion.
- * src/cris/ffi.c: Ditto.
-
-2010-07-10 Evan Phoenix <evan@fallingsnow.net>
-
- * src/closures.c (selinux_enabled_check): Fix strncmp usage bug.
-
-2010-07-07 Dan Horák <dan@danny.cz>
-
- * include/ffi.h.in: Protect #define with #ifndef.
- * src/powerpc/ffitarget.h: Ditto.
- * src/s390/ffitarget.h: Ditto.
- * src/sparc/ffitarget.h: Ditto.
-
-2010-07-07 Neil Roberts <neil@linux.intel.com>
-
- * src/x86/sysv.S (ffi_call_SYSV): Align the stack pointer to
- 16-bytes.
-
-2010-07-02 Jakub Jelinek <jakub@redhat.com>
-
- * Makefile.am (AM_MAKEFLAGS): Pass also mandir to submakes.
- * Makefile.in: Regenerated.
-
-2010-05-19 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
-
- * configure.ac (libffi_cv_as_x86_pcrel): Check for illegal in as
- output, too.
- (libffi_cv_as_ascii_pseudo_op): Check for .ascii.
- (libffi_cv_as_string_pseudo_op): Check for .string.
- * configure: Regenerate.
- * fficonfig.h.in: Regenerate.
- * src/x86/sysv.S (.eh_frame): Use .ascii, .string or error.
-
-2010-05-11 Dan Witte <dwitte@mozilla.com>
-
- * doc/libffi.tex: Document previous change.
-
-2010-05-11 Makoto Kato <m_kato@ga2.so-net.ne.jp>
-
- * src/x86/ffi.c (ffi_call): Don't copy structs passed by value.
-
-2010-05-05 Michael Kohler <michaelkohler@live.com>
-
- * src/dlmalloc.c (dlfree): Fix spelling.
- * src/ia64/ffi.c (ffi_prep_cif_machdep): Ditto.
- * configure.ac: Ditto.
- * configure: Rebuilt.
-
-2010-04-13 Dan Witte <dwitte@mozilla.com>
-
- * msvcc.sh: Build with -W3 instead of -Wall.
- * src/powerpc/ffi_darwin.c: Remove build warnings.
- * src/x86/ffi.c: Ditto.
- * src/x86/ffitarget.h: Ditto.
-
-2010-04-12 Dan Witte <dwitte@mozilla.com>
- Walter Meinl <wuno@lsvw.de>
-
- * configure.ac: Add OS/2 support.
- * configure: Rebuilt.
- * src/closures.c: Ditto.
- * src/dlmalloc.c: Ditto.
- * src/x86/win32.S: Ditto.
-
-2010-04-07 Jakub Jelinek <jakub@redhat.com>
-
- * testsuite/libffi.call/err_bad_abi.c: Remove unused args variable.
-
-2010-04-02 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
-
- * Makefile.in: Regenerate.
- * aclocal.m4: Regenerate.
- * include/Makefile.in: Regenerate.
- * man/Makefile.in: Regenerate.
- * testsuite/Makefile.in: Regenerate.
-
-2010-03-30 Dan Witte <dwitte@mozilla.com>
-
- * msvcc.sh: Disable build warnings.
- * README (tested): Clarify windows build procedure.
-
-2010-03-15 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
-
- * configure.ac (libffi_cv_as_x86_64_unwind_section_type): New test.
- * configure: Regenerate.
- * fficonfig.h.in: Regenerate.
- * libffi/src/x86/unix64.S (.eh_frame)
- [HAVE_AS_X86_64_UNWIND_SECTION_TYPE]: Use @unwind section type.
-
-2010-03-14 Matthias Klose <doko@ubuntu.com>
-
- * src/x86/ffi64.c: Fix typo in comment.
- * src/x86/ffi.c: Use /* ... */ comment style.
-
-2010-02-24 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
-
- * doc/libffi.texi (The Closure API): Fix typo.
- * doc/libffi.info: Remove.
-
-2010-02-15 Matthias Klose <doko@ubuntu.com>
-
- * src/arm/sysv.S (__ARM_ARCH__): Define for processor
- __ARM_ARCH_7EM__.
-
-2010-01-15 Anthony Green <green@redhat.com>
-
- * README: Add notes on building with Microsoft Visual C++.
-
-2010-01-15 Daniel Witte <dwitte@mozilla.com>
-
- * msvcc.sh: New file.
-
- * src/x86/win32.S: Port assembly routines to MSVC and #ifdef.
- * src/x86/ffi.c: Tweak function declaration and remove excess
- parens.
- * include/ffi.h.in: Add __declspec(align(8)) to typedef struct
- ffi_closure.
-
- * src/x86/ffi.c: Merge ffi_call_SYSV and ffi_call_STDCALL into new
- function ffi_call_win32 on X86_WIN32.
- * src/x86/win32.S (ffi_call_SYSV): Rename to ffi_call_win32.
- (ffi_call_STDCALL): Remove.
-
- * src/prep_cif.c (ffi_prep_cif): Move stack space allocation code
- to ffi_prep_cif_machdep for x86.
- * src/x86/ffi.c (ffi_prep_cif_machdep): To here.
-
-2010-01-15 Oliver Kiddle <okiddle@yahoo.co.uk>
-
- * src/x86/ffitarget.h (ffi_abi): Check for __i386 and __amd64 for
- Sun Studio compiler compatibility.
-
-2010-01-12 Conrad Irwin <conrad.irwin@gmail.com>
-
- * doc/libffi.texi: Add closure example.
-
-2010-01-07 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
-
- PR libffi/40701
- * testsuite/libffi.call/ffitest.h [__alpha__ && __osf__] (PRIdLL,
- PRIuLL, PRId64, PRIu64, PRIuPTR): Define.
- * testsuite/libffi.call/cls_align_sint64.c: Add -Wno-format on
- alpha*-dec-osf*.
- * testsuite/libffi.call/cls_align_uint64.c: Likewise.
- * testsuite/libffi.call/cls_ulonglong.c: Likewise.
- * testsuite/libffi.call/return_ll1.c: Likewise.
- * testsuite/libffi.call/stret_medium2.c: Likewise.
- * testsuite/libffi.special/ffitestcxx.h (allocate_mmap): Cast
- MAP_FAILED to char *.
-
-2010-01-06 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
-
- * src/mips/n32.S: Use .abicalls and .eh_frame with __GNUC__.
-
-2009-12-31 Anthony Green <green@redhat.com>
-
- * README: Update for libffi 3.0.9.
-
-2009-12-27 Matthias Klose <doko@ubuntu.com>
-
- * configure.ac (HAVE_LONG_DOUBLE): Define for mips when
- appropriate.
- * configure: Rebuilt.
-
-2009-12-26 Anthony Green <green@redhat.com>
-
- * testsuite/libffi.call/cls_longdouble_va.c: Mark as xfail for
- avr32*-*-*.
- * testsuite/libffi.call/cls_double_va.c: Ditto.
-
-2009-12-26 Andreas Tobler <a.tobler@schweiz.org>
-
- * testsuite/libffi.call/ffitest.h: Conditionally include stdint.h
- and inttypes.h.
- * testsuite/libffi.special/unwindtest.cc: Ditto.
-
-2009-12-26 Andreas Tobler <a.tobler@schweiz.org>
-
- * configure.ac: Add amd64-*-openbsd*.
- * configure: Rebuilt.
- * testsuite/lib/libffi-dg.exp (libffi_target_compile): Link
- openbsd programs with -lpthread.
-
-2009-12-26 Anthony Green <green@redhat.com>
-
- * testsuite/libffi.call/cls_double_va.c,
- testsuite/libffi.call/cls_longdouble.c,
- testsuite/libffi.call/cls_longdouble_va.c,
- testsuite/libffi.call/cls_pointer.c,
- testsuite/libffi.call/cls_pointer_stack.c: Remove xfail for
- mips*-*-* and arm*-*-*.
- * testsuite/libffi.call/cls_align_longdouble_split.c,
- testsuite/libffi.call/cls_align_longdouble_split2.c,
- testsuite/libffi.call/stret_medium2.c,
- testsuite/libffi.call/stret_medium.c,
- testsuite/libffi.call/stret_large.c,
- testsuite/libffi.call/stret_large2.c: Remove xfail for arm*-*-*.
-
-2009-12-31 Kay Tietz <ktietz70@googlemail.com>
-
- * testsuite/libffi.call/ffitest.h,
- testsuite/libffi.special/ffitestcxx.h (PRIdLL, PRuLL): Fix
- definitions.
-
-2009-12-31 Carlo Bramini <carlo.bramix@libero.it>
-
- * configure.ac (AM_LTLDFLAGS): Define for windows hosts.
- * Makefile.am (libffi_la_LDFLAGS): Add AM_LTLDFLAGS.
- * configure: Rebuilt.
- * Makefile.in: Rebuilt.
-
-2009-12-31 Anthony Green <green@redhat.com>
- Blake Chaffin.
-
- * testsuite/libffi.call/huge_struct.c: New test case from Blake
- Chaffin @ Apple.
-
-2009-12-28 David Edelsohn <edelsohn@gnu.org>
-
- * src/powerpc/ffi_darwin.c (ffi_prep_args): Copy abi and nargs to
- local variables.
- (aix_adjust_aggregate_sizes): New function.
- (ffi_prep_cif_machdep): Call it.
-
-2009-12-26 Andreas Tobler <a.tobler@schweiz.org>
-
- * configure.ac: Define FFI_MMAP_EXEC_WRIT for the given targets.
- * configure: Regenerate.
- * fficonfig.h.in: Likewise.
- * src/closures.c: Remove the FFI_MMAP_EXEC_WRIT definition for
- Solaris/x86.
-
-2009-12-26 Andreas Schwab <schwab@linux-m68k.org>
-
- * src/powerpc/ffi.c (ffi_prep_args_SYSV): Advance intarg_count
- when a float arguments is passed in memory.
- (ffi_closure_helper_SYSV): Mark general registers as used up when
- a 64bit or soft-float long double argument is passed in memory.
-
-2009-12-25 Matthias Klose <doko@ubuntu.com>
-
- * man/ffi_call.3: Fix #include in examples.
- * doc/libffi.texi: Add dircategory.
-
-2009-12-25 Frank Everdij <f.p.x.everdij@tudelft.nl>
-
- * include/ffi.h.in: Placed '__GNUC__' ifdef around
- '__attribute__((aligned(8)))' in ffi_closure, fixes compile for
- IRIX MIPSPro c99.
- * include/ffi_common.h: Added '__sgi' define to non
- '__attribute__((__mode__()))' integer typedefs.
- * src/mips/ffi.c (ffi_call, ffi_closure_mips_inner_O32,
- ffi_closure_mips_inner_N32): Added 'defined(_MIPSEB)' to BE check.
- (ffi_closure_mips_inner_O32, ffi_closure_mips_inner_N32): Added
- FFI_LONGDOUBLE support and alignment(N32 only).
- * src/mips/ffitarget.h: Corrected '#include <sgidefs.h>' for IRIX and
- fixed non '__attribute__((__mode__()))' integer typedefs.
- * src/mips/n32.S: Put '#ifdef linux' around '.abicalls' and '.eh_frame'
- since they are Linux/GNU Assembler specific.
-
-2009-12-25 Bradley Smith <brad@brad-smith.co.uk>
-
- * configure.ac, Makefile.am, src/avr32/ffi.c,
- src/avr32/ffitarget.h,
- src/avr32/sysv.S: Add AVR32 port.
- * configure, Makefile.in: Rebuilt.
-
-2009-12-21 Andreas Tobler <a.tobler@schweiz.org>
-
- * configure.ac: Make i?86 build on FreeBSD and OpenBSD.
- * configure: Regenerate.
-
-2009-12-15 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
-
- * testsuite/libffi.call/ffitest.h: Define PRIuPTR on PA HP-UX.
-
-2009-12-13 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
-
- * src/pa/ffi.c (ffi_closure_inner_pa32): Handle FFI_TYPE_LONGDOUBLE
- type on HP-UX.
-
-2012-02-13 Kai Tietz <ktietz@redhat.com>
-
- PR libffi/52221
- * src/x86/ffi.c (ffi_prep_raw_closure_loc): Add thiscall
- support for X86_WIN32.
- (FFI_INIT_TRAMPOLINE_THISCALL): Fix displacement.
-
-2009-12-11 Eric Botcazou <ebotcazou@adacore.com>
-
- * src/sparc/ffi.c (ffi_closure_sparc_inner_v9): Properly align 'long
- double' arguments.
-
-2009-12-11 Eric Botcazou <ebotcazou@adacore.com>
-
- * testsuite/libffi.call/ffitest.h: Define PRIuPTR on Solaris < 10.
-
-2009-12-10 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
-
- PR libffi/40700
- * src/closures.c [X86_64 && __sun__ && __svr4__]
- (FFI_MMAP_EXEC_WRIT): Define.
-
-2009-12-08 David Daney <ddaney@caviumnetworks.com>
-
- * testsuite/libffi.call/stret_medium.c: Remove xfail for mips*-*-*
- * testsuite/libffi.call/cls_align_longdouble_split2.c: Same.
- * testsuite/libffi.call/stret_large.c: Same.
- * testsuite/libffi.call/cls_align_longdouble_split.c: Same.
- * testsuite/libffi.call/stret_large2.c: Same.
- * testsuite/libffi.call/stret_medium2.c: Same.
-
-2009-12-07 David Edelsohn <edelsohn@gnu.org>
-
- * src/powerpc/aix_closure.S (libffi_closure_ASM): Fix tablejump
- typo.
-
-2009-12-05 David Edelsohn <edelsohn@gnu.org>
-
- * src/powerpc/aix.S: Update AIX32 code to be consistent with AIX64
- code.
- * src/powerpc/aix_closure.S: Same.
-
-2009-12-05 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
-
- * Makefile.in: Regenerate.
- * configure: Regenerate.
- * include/Makefile.in: Regenerate.
- * man/Makefile.in: Regenerate.
- * testsuite/Makefile.in: Regenerate.
-
-2009-12-04 David Edelsohn <edelsohn@gnu.org>
-
- * src/powerpc/aix_closure.S: Reorganize 64-bit code to match
- linux64_closure.S.
-
-2009-12-04 Uros Bizjak <ubizjak@gmail.com>
-
- PR libffi/41908
- * src/x86/ffi64.c (classify_argument): Update from
- gcc/config/i386/i386.c.
- (ffi_closure_unix64_inner): Do not use the address of two consecutive
- SSE registers directly.
- * testsuite/libffi.call/cls_dbls_struct.c (main): Remove xfail
- for x86_64 linux targets.
-
-2009-12-04 David Edelsohn <edelsohn@gnu.org>
-
- * src/powerpc/ffi_darwin.c (ffi_closure_helper_DARWIN): Increment
- pfr for long double split between fpr13 and stack.
-
-2009-12-03 David Edelsohn <edelsohn@gnu.org>
-
- * src/powerpc/ffi_darwin.c (ffi_prep_args): Increment next_arg and
- fparg_count twice for long double.
-
-2009-12-03 David Edelsohn <edelsohn@gnu.org>
-
- PR libffi/42243
- * src/powerpc/ffi_darwin.c (ffi_prep_args): Remove extra parentheses.
-
-2009-12-03 Uros Bizjak <ubizjak@gmail.com>
-
- * testsuite/libffi.call/cls_longdouble_va.c (main): Fix format string.
- Remove xfails for x86 linux targets.
-
-2009-12-02 David Edelsohn <edelsohn@gnu.org>
-
- * src/powerpc/ffi_darwin.c (ffi_prep_args): Fix typo in INT64
- case.
-
-2009-12-01 David Edelsohn <edelsohn@gnu.org>
-
- * src/powerpc/aix.S (ffi_call_AIX): Convert to more standard
- register usage. Call ffi_prep_args directly. Add long double
- return value support.
- * src/powerpc/ffi_darwin.c (ffi_prep_args): Double arg increment
- applies to FFI_TYPE_DOUBLE. Correct fpr_base increment typo.
- Separate FFI_TYPE_SINT32 and FFI_TYPE_UINT32 cases.
- (ffi_prep_cif_machdep): Only 16 byte stack alignment in 64 bit
- mode.
- (ffi_closure_helper_DARWIN): Remove nf and ng counters. Move temp
- into case.
- * src/powerpc/aix_closure.S: Maintain 16 byte stack alignment.
- Allocate result area between params and FPRs.
-
-2009-11-30 David Edelsohn <edelsohn@gnu.org>
-
- PR target/35484
- * src/powerpc/ffitarget.h (POWERPC64): Define for PPC64 Linux and
- AIX64.
- * src/powerpc/aix.S: Implement AIX64 version.
- * src/powerpc/aix_closure.S: Implement AIX64 version.
- (ffi_closure_ASM): Use extsb, lha and displament addresses.
- * src/powerpc/ffi_darwin.c (ffi_prep_args): Implement AIX64
- support.
- (ffi_prep_cif_machdep): Same.
- (ffi_call): Same.
- (ffi_closure_helper_DARWIN): Same.
-
-2009-11-02 Andreas Tobler <a.tobler@schweiz.org>
-
- PR libffi/41908
- * testsuite/libffi.call/testclosure.c: New test.
-
-2009-09-28 Kai Tietz <kai.tietz@onevision.com>
-
- * src/x86/win64.S (_ffi_call_win64 stack): Remove for gnu
- assembly version use of ___chkstk.
-
-2009-09-23 Matthias Klose <doko@ubuntu.com>
-
- PR libffi/40242, PR libffi/41443
- * src/arm/sysv.S (__ARM_ARCH__): Define for processors
- __ARM_ARCH_6T2__, __ARM_ARCH_6M__, __ARM_ARCH_7__,
- __ARM_ARCH_7A__, __ARM_ARCH_7R__, __ARM_ARCH_7M__.
- Change the conditionals to __SOFTFP__ || __ARM_EABI__
- for -mfloat-abi=softfp to work.
-
-2009-09-17 Loren J. Rittle <ljrittle@acm.org>
-
- PR testsuite/32843 (strikes again)
- * src/x86/ffi.c (ffi_prep_cif_machdep): Add X86_FREEBSD to
- enable proper extension on char and short.
-
-2009-09-15 David Daney <ddaney@caviumnetworks.com>
-
- * src/java_raw_api.c (ffi_java_raw_to_rvalue): Remove special
- handling for FFI_TYPE_POINTER.
- * src/mips/ffitarget.h (FFI_TYPE_STRUCT_D_SOFT,
- FFI_TYPE_STRUCT_F_SOFT, FFI_TYPE_STRUCT_DD_SOFT,
- FFI_TYPE_STRUCT_FF_SOFT, FFI_TYPE_STRUCT_FD_SOFT,
- FFI_TYPE_STRUCT_DF_SOFT, FFI_TYPE_STRUCT_SOFT): New defines.
- (FFI_N32_SOFT_FLOAT, FFI_N64_SOFT_FLOAT): New ffi_abi enumerations.
- (enum ffi_abi): Set FFI_DEFAULT_ABI for soft-float.
- * src/mips/n32.S (ffi_call_N32): Add handling for soft-float
- structure and pointer returns.
- (ffi_closure_N32): Add handling for pointer returns.
- * src/mips/ffi.c (ffi_prep_args, calc_n32_struct_flags,
- calc_n32_return_struct_flags): Handle soft-float.
- (ffi_prep_cif_machdep): Handle soft-float, fix pointer handling.
- (ffi_call_N32): Declare proper argument types.
- (ffi_call, copy_struct_N32, ffi_closure_mips_inner_N32): Handle
- soft-float.
-
-2009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
-
- * configure.ac (AC_PREREQ): Bump to 2.64.
-
-2009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
-
- * Makefile.am (install-html, install-pdf): Remove.
- * Makefile.in: Regenerate.
-
- * Makefile.in: Regenerate.
- * aclocal.m4: Regenerate.
- * configure: Regenerate.
- * fficonfig.h.in: Regenerate.
- * include/Makefile.in: Regenerate.
- * man/Makefile.in: Regenerate.
- * testsuite/Makefile.in: Regenerate.
-
-2011-08-22 Jasper Lievisse Adriaanse <jasper@openbsd.org>
-
- * configure.ac: Add OpenBSD/hppa and OpenBSD/powerpc support.
- * configure: Rebuilt.
-
-2009-07-30 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
-
- * configure.ac (_AC_ARG_VAR_PRECIOUS): Use m4_rename_force.
-
-2009-07-24 Dave Korn <dave.korn.cygwin@gmail.com>
-
- PR libffi/40807
- * src/x86/ffi.c (ffi_prep_cif_machdep): Also use sign/zero-extending
- return types for X86_WIN32.
- * src/x86/win32.S (_ffi_call_SYSV): Handle omitted return types.
- (_ffi_call_STDCALL, _ffi_closure_SYSV, _ffi_closure_raw_SYSV,
- _ffi_closure_STDCALL): Likewise.
-
- * src/closures.c (is_selinux_enabled): Define to const 0 for Cygwin.
- (dlmmap, dlmunmap): Also use these functions on Cygwin.
-
-2009-07-11 Richard Sandiford <rdsandiford@googlemail.com>
-
- PR testsuite/40699
- PR testsuite/40707
- PR testsuite/40709
- * testsuite/lib/libffi-dg.exp: Revert 2009-07-02, 2009-07-01 and
- 2009-06-30 commits.
-
-2009-07-01 Richard Sandiford <r.sandiford@uk.ibm.com>
-
- * testsuite/lib/libffi-dg.exp (libffi-init): Set ld_library_path
- to "" before adding paths. (This reinstates an assignment that
- was removed by my 2009-06-30 commit, but changes the initial
- value from "." to "".)
-
-2009-07-01 H.J. Lu <hongjiu.lu@intel.com>
-
- PR testsuite/40601
- * testsuite/lib/libffi-dg.exp (libffi-init): Properly set
- gccdir. Adjust ld_library_path for gcc only if gccdir isn't
- empty.
-
-2009-06-30 Richard Sandiford <r.sandiford@uk.ibm.com>
-
- * testsuite/lib/libffi-dg.exp (libffi-init): Don't add "."
- to ld_library_path. Use add_path. Add just find_libgcc_s
- to ld_library_path, not every libgcc multilib directory.
-
-2009-06-16 Wim Lewis <wiml@hhhh.org>
-
- * src/powerpc/ffi.c: Avoid clobbering cr3 and cr4, which are
- supposed to be callee-saved.
- * src/powerpc/sysv.S (small_struct_return_value): Fix overrun of
- return buffer for odd-size structs.
-
-2009-06-16 Andreas Tobler <a.tobler@schweiz.org>
-
- PR libffi/40444
- * testsuite/lib/libffi-dg.exp (libffi_target_compile): Add
- allow_stack_execute for Darwin.
-
-2009-06-16 Andrew Haley <aph@redhat.com>
-
- * configure.ac (TARGETDIR): Add missing blank lines.
- * configure: Regenerate.
-
-2009-06-16 Andrew Haley <aph@redhat.com>
-
- * testsuite/libffi.call/cls_align_sint64.c,
- testsuite/libffi.call/cls_align_uint64.c,
- testsuite/libffi.call/cls_longdouble_va.c,
- testsuite/libffi.call/cls_ulonglong.c,
- testsuite/libffi.call/return_ll1.c,
- testsuite/libffi.call/stret_medium2.c: Fix printf format
- specifiers.
- * testsuite/libffi.call/ffitest.h,
- testsuite/libffi.special/ffitestcxx.h (PRIdLL, PRIuLL): Define.
-
-2009-06-15 Andrew Haley <aph@redhat.com>
-
- * testsuite/libffi.call/err_bad_typedef.c: xfail everywhere.
- * testsuite/libffi.call/err_bad_abi.c: Likewise.
-
-2009-06-12 Andrew Haley <aph@redhat.com>
-
- * Makefile.am: Remove info_TEXINFOS.
-
-2009-06-12 Andrew Haley <aph@redhat.com>
-
- * ChangeLog.libffi: testsuite/libffi.call/cls_align_sint64.c,
- testsuite/libffi.call/cls_align_uint64.c,
- testsuite/libffi.call/cls_ulonglong.c,
- testsuite/libffi.call/return_ll1.c,
- testsuite/libffi.call/stret_medium2.c: Fix printf format
- specifiers.
- testsuite/libffi.special/unwindtest.cc: include stdint.h.
-
-2009-06-11 Timothy Wall <twall@users.sf.net>
-
- * Makefile.am,
- configure.ac,
- include/ffi.h.in,
- include/ffi_common.h,
- src/closures.c,
- src/dlmalloc.c,
- src/x86/ffi.c,
- src/x86/ffitarget.h,
- src/x86/win64.S (new),
- README: Added win64 support (mingw or MSVC)
- * Makefile.in,
- include/Makefile.in,
- man/Makefile.in,
- testsuite/Makefile.in,
- configure,
- aclocal.m4: Regenerated
- * ltcf-c.sh: properly escape cygwin/w32 path
- * man/ffi_call.3: Clarify size requirements for return value.
- * src/x86/ffi64.c: Fix filename in comment.
- * src/x86/win32.S: Remove unused extern.
-
- * testsuite/libffi.call/closure_fn0.c,
- testsuite/libffi.call/closure_fn1.c,
- testsuite/libffi.call/closure_fn2.c,
- testsuite/libffi.call/closure_fn3.c,
- testsuite/libffi.call/closure_fn4.c,
- testsuite/libffi.call/closure_fn5.c,
- testsuite/libffi.call/closure_fn6.c,
- testsuite/libffi.call/closure_stdcall.c,
- testsuite/libffi.call/cls_12byte.c,
- testsuite/libffi.call/cls_16byte.c,
- testsuite/libffi.call/cls_18byte.c,
- testsuite/libffi.call/cls_19byte.c,
- testsuite/libffi.call/cls_1_1byte.c,
- testsuite/libffi.call/cls_20byte.c,
- testsuite/libffi.call/cls_20byte1.c,
- testsuite/libffi.call/cls_24byte.c,
- testsuite/libffi.call/cls_2byte.c,
- testsuite/libffi.call/cls_3_1byte.c,
- testsuite/libffi.call/cls_3byte1.c,
- testsuite/libffi.call/cls_3byte2.c,
- testsuite/libffi.call/cls_4_1byte.c,
- testsuite/libffi.call/cls_4byte.c,
- testsuite/libffi.call/cls_5_1_byte.c,
- testsuite/libffi.call/cls_5byte.c,
- testsuite/libffi.call/cls_64byte.c,
- testsuite/libffi.call/cls_6_1_byte.c,
- testsuite/libffi.call/cls_6byte.c,
- testsuite/libffi.call/cls_7_1_byte.c,
- testsuite/libffi.call/cls_7byte.c,
- testsuite/libffi.call/cls_8byte.c,
- testsuite/libffi.call/cls_9byte1.c,
- testsuite/libffi.call/cls_9byte2.c,
- testsuite/libffi.call/cls_align_double.c,
- testsuite/libffi.call/cls_align_float.c,
- testsuite/libffi.call/cls_align_longdouble.c,
- testsuite/libffi.call/cls_align_longdouble_split.c,
- testsuite/libffi.call/cls_align_longdouble_split2.c,
- testsuite/libffi.call/cls_align_pointer.c,
- testsuite/libffi.call/cls_align_sint16.c,
- testsuite/libffi.call/cls_align_sint32.c,
- testsuite/libffi.call/cls_align_sint64.c,
- testsuite/libffi.call/cls_align_uint16.c,
- testsuite/libffi.call/cls_align_uint32.c,
- testsuite/libffi.call/cls_align_uint64.c,
- testsuite/libffi.call/cls_dbls_struct.c,
- testsuite/libffi.call/cls_double.c,
- testsuite/libffi.call/cls_double_va.c,
- testsuite/libffi.call/cls_float.c,
- testsuite/libffi.call/cls_longdouble.c,
- testsuite/libffi.call/cls_longdouble_va.c,
- testsuite/libffi.call/cls_multi_schar.c,
- testsuite/libffi.call/cls_multi_sshort.c,
- testsuite/libffi.call/cls_multi_sshortchar.c,
- testsuite/libffi.call/cls_multi_uchar.c,
- testsuite/libffi.call/cls_multi_ushort.c,
- testsuite/libffi.call/cls_multi_ushortchar.c,
- testsuite/libffi.call/cls_pointer.c,
- testsuite/libffi.call/cls_pointer_stack.c,
- testsuite/libffi.call/cls_schar.c,
- testsuite/libffi.call/cls_sint.c,
- testsuite/libffi.call/cls_sshort.c,
- testsuite/libffi.call/cls_uchar.c,
- testsuite/libffi.call/cls_uint.c,
- testsuite/libffi.call/cls_ulonglong.c,
- testsuite/libffi.call/cls_ushort.c,
- testsuite/libffi.call/err_bad_abi.c,
- testsuite/libffi.call/err_bad_typedef.c,
- testsuite/libffi.call/float2.c,
- testsuite/libffi.call/huge_struct.c,
- testsuite/libffi.call/nested_struct.c,
- testsuite/libffi.call/nested_struct1.c,
- testsuite/libffi.call/nested_struct10.c,
- testsuite/libffi.call/nested_struct2.c,
- testsuite/libffi.call/nested_struct3.c,
- testsuite/libffi.call/nested_struct4.c,
- testsuite/libffi.call/nested_struct5.c,
- testsuite/libffi.call/nested_struct6.c,
- testsuite/libffi.call/nested_struct7.c,
- testsuite/libffi.call/nested_struct8.c,
- testsuite/libffi.call/nested_struct9.c,
- testsuite/libffi.call/problem1.c,
- testsuite/libffi.call/return_ldl.c,
- testsuite/libffi.call/return_ll1.c,
- testsuite/libffi.call/stret_large.c,
- testsuite/libffi.call/stret_large2.c,
- testsuite/libffi.call/stret_medium.c,
- testsuite/libffi.call/stret_medium2.c,
- testsuite/libffi.special/unwindtest.cc: use ffi_closure_alloc instead
- of checking for MMAP. Use intptr_t instead of long casts.
-
-2009-06-11 Kaz Kojima <kkojima@gcc.gnu.org>
-
- * testsuite/libffi.call/cls_longdouble_va.c: Add xfail sh*-*-linux-*.
- * testsuite/libffi.call/err_bad_abi.c: Add xfail sh*-*-*.
- * testsuite/libffi.call/err_bad_typedef.c: Likewise.
-
-2009-06-09 Andrew Haley <aph@redhat.com>
-
- * src/x86/freebsd.S: Add missing file.
-
-2009-06-08 Andrew Haley <aph@redhat.com>
-
- Import from libffi 3.0.8:
-
- * doc/libffi.texi: New file.
- * doc/libffi.info: Likewise.
- * doc/stamp-vti: Likewise.
- * man/Makefile.am: New file.
- * man/ffi_call.3: New file.
-
- * Makefile.am (EXTRA_DIST): Add src/x86/darwin64.S,
- src/dlmalloc.c.
- (nodist_libffi_la_SOURCES): Add X86_FREEBSD.
-
- * configure.ac: Bump version to 3.0.8.
- parisc*-*-linux*: Add.
- i386-*-freebsd* | i386-*-openbsd*: Add.
- powerpc-*-beos*: Add.
- AM_CONDITIONAL X86_FREEBSD: Add.
- AC_CONFIG_FILES: Add man/Makefile.
-
- * include/ffi.h.in (FFI_FN): Change void (*)() to void (*)(void).
-
-2009-06-08 Andrew Haley <aph@redhat.com>
-
- * README: Import from libffi 3.0.8.
-
-2009-06-08 Andrew Haley <aph@redhat.com>
-
- * testsuite/libffi.call/err_bad_abi.c: Add xfails.
- * testsuite/libffi.call/cls_longdouble_va.c: Add xfails.
- * testsuite/libffi.call/cls_dbls_struct.c: Add xfail x86_64-*-linux-*.
- * testsuite/libffi.call/err_bad_typedef.c: Add xfails.
-
- * testsuite/libffi.call/stret_medium2.c: Add __UNUSED__ to args.
- * testsuite/libffi.call/stret_medium.c: Likewise.
- * testsuite/libffi.call/stret_large2.c: Likewise.
- * testsuite/libffi.call/stret_large.c: Likewise.
-
-2008-12-26 Timothy Wall <twall@users.sf.net>
-
- * testsuite/libffi.call/cls_longdouble.c,
- testsuite/libffi.call/cls_longdouble_va.c,
- testsuite/libffi.call/cls_align_longdouble.c,
- testsuite/libffi.call/cls_align_longdouble_split.c,
- testsuite/libffi.call/cls_align_longdouble_split2.c: mark expected
- failures on x86_64 cygwin/mingw.
-
-2008-12-22 Timothy Wall <twall@users.sf.net>
-
- * testsuite/libffi.call/closure_fn0.c,
- testsuite/libffi.call/closure_fn1.c,
- testsuite/libffi.call/closure_fn2.c,
- testsuite/libffi.call/closure_fn3.c,
- testsuite/libffi.call/closure_fn4.c,
- testsuite/libffi.call/closure_fn5.c,
- testsuite/libffi.call/closure_fn6.c,
- testsuite/libffi.call/closure_loc_fn0.c,
- testsuite/libffi.call/closure_stdcall.c,
- testsuite/libffi.call/cls_align_pointer.c,
- testsuite/libffi.call/cls_pointer.c,
- testsuite/libffi.call/cls_pointer_stack.c: use portable cast from
- pointer to integer (intptr_t).
- * testsuite/libffi.call/cls_longdouble.c: disable for win64.
-
-2008-07-24 Anthony Green <green@redhat.com>
-
- * testsuite/libffi.call/cls_dbls_struct.c,
- testsuite/libffi.call/cls_double_va.c,
- testsuite/libffi.call/cls_longdouble.c,
- testsuite/libffi.call/cls_longdouble_va.c,
- testsuite/libffi.call/cls_pointer.c,
- testsuite/libffi.call/cls_pointer_stack.c,
- testsuite/libffi.call/err_bad_abi.c: Clean up failures from
- compiler warnings.
-
-2008-03-04 Anthony Green <green@redhat.com>
- Blake Chaffin
- hos@tamanegi.org
-
- * testsuite/libffi.call/cls_align_longdouble_split2.c
- testsuite/libffi.call/cls_align_longdouble_split.c
- testsuite/libffi.call/cls_dbls_struct.c
- testsuite/libffi.call/cls_double_va.c
- testsuite/libffi.call/cls_longdouble.c
- testsuite/libffi.call/cls_longdouble_va.c
- testsuite/libffi.call/cls_pointer.c
- testsuite/libffi.call/cls_pointer_stack.c
- testsuite/libffi.call/err_bad_abi.c
- testsuite/libffi.call/err_bad_typedef.c
- testsuite/libffi.call/stret_large2.c
- testsuite/libffi.call/stret_large.c
- testsuite/libffi.call/stret_medium2.c
- testsuite/libffi.call/stret_medium.c: New tests from Apple.
-
-2009-06-05 Andrew Haley <aph@redhat.com>
-
- * src/x86/ffitarget.h, src/x86/ffi.c: Merge stdcall changes from
- libffi.
-
-2009-06-04 Andrew Haley <aph@redhat.com>
-
- * src/x86/ffitarget.h, src/x86/win32.S, src/x86/ffi.c: Back out
- stdcall changes.
-
-2008-02-26 Anthony Green <green@redhat.com>
- Thomas Heller <theller@ctypes.org>
-
- * src/x86/ffi.c (ffi_closure_SYSV_inner): Change C++ comment to C
- comment.
-
-2008-02-03 Timothy Wall <twall@users.sf.net>
-
- * src/x86/ffi.c (FFI_INIT_TRAMPOLINE_STDCALL): Calculate jump return
- offset based on code pointer, not data pointer.
-
-2008-01-31 Timothy Wall <twall@users.sf.net>
-
- * testsuite/libffi.call/closure_stdcall.c: Add test for stdcall
- closures.
- * src/x86/ffitarget.h: Increase size of trampoline for stdcall
- closures.
- * src/x86/win32.S: Add assembly for stdcall closure.
- * src/x86/ffi.c: Initialize stdcall closure trampoline.
-
-2009-06-04 Andrew Haley <aph@redhat.com>
-
- * include/ffi.h.in: Change void (*)() to void (*)(void).
- * src/x86/ffi.c: Likewise.
-
-2009-06-04 Andrew Haley <aph@redhat.com>
-
- * src/powerpc/ppc_closure.S: Insert licence header.
- * src/powerpc/linux64_closure.S: Likewise.
- * src/m68k/sysv.S: Likewise.
-
- * src/sh64/ffi.c: Change void (*)() to void (*)(void).
- * src/powerpc/ffi.c: Likewise.
- * src/powerpc/ffi_darwin.c: Likewise.
- * src/m32r/ffi.c: Likewise.
- * src/sh64/ffi.c: Likewise.
- * src/x86/ffi64.c: Likewise.
- * src/alpha/ffi.c: Likewise.
- * src/alpha/osf.S: Likewise.
- * src/frv/ffi.c: Likewise.
- * src/s390/ffi.c: Likewise.
- * src/pa/ffi.c: Likewise.
- * src/pa/hpux32.S: Likewise.
- * src/ia64/unix.S: Likewise.
- * src/ia64/ffi.c: Likewise.
- * src/sparc/ffi.c: Likewise.
- * src/mips/ffi.c: Likewise.
- * src/sh/ffi.c: Likewise.
-
-2008-02-15 David Daney <ddaney@avtrex.com>
-
- * src/mips/ffi.c (USE__BUILTIN___CLEAR_CACHE):
- Define (conditionally), and use it to include cachectl.h.
- (ffi_prep_closure_loc): Fix cache flushing.
- * src/mips/ffitarget.h (_ABIN32, _ABI64, _ABIO32): Define.
-
-2009-06-04 Andrew Haley <aph@redhat.com>
-
- include/ffi.h.in,
- src/arm/ffitarget.h,
- src/arm/ffi.c,
- src/arm/sysv.S,
- src/powerpc/ffitarget.h,
- src/closures.c,
- src/sh64/ffitarget.h,
- src/sh64/ffi.c,
- src/sh64/sysv.S,
- src/types.c,
- src/x86/ffi64.c,
- src/x86/ffitarget.h,
- src/x86/win32.S,
- src/x86/darwin.S,
- src/x86/ffi.c,
- src/x86/sysv.S,
- src/x86/unix64.S,
- src/alpha/ffitarget.h,
- src/alpha/ffi.c,
- src/alpha/osf.S,
- src/m68k/ffitarget.h,
- src/frv/ffitarget.h,
- src/frv/ffi.c,
- src/s390/ffitarget.h,
- src/s390/sysv.S,
- src/cris/ffitarget.h,
- src/pa/linux.S,
- src/pa/ffitarget.h,
- src/pa/ffi.c,
- src/raw_api.c,
- src/ia64/ffitarget.h,
- src/ia64/unix.S,
- src/ia64/ffi.c,
- src/ia64/ia64_flags.h,
- src/java_raw_api.c,
- src/debug.c,
- src/sparc/v9.S,
- src/sparc/ffitarget.h,
- src/sparc/ffi.c,
- src/sparc/v8.S,
- src/mips/ffitarget.h,
- src/mips/n32.S,
- src/mips/o32.S,
- src/mips/ffi.c,
- src/prep_cif.c,
- src/sh/ffitarget.h,
- src/sh/ffi.c,
- src/sh/sysv.S: Update license text.
-
-2009-05-22 Dave Korn <dave.korn.cygwin@gmail.com>
-
- * src/x86/win32.S (_ffi_closure_STDCALL): New function.
- (.eh_frame): Add FDE for it.
-
-2009-05-22 Dave Korn <dave.korn.cygwin@gmail.com>
-
- * configure.ac: Also check if assembler supports pc-relative
- relocs on X86_WIN32 targets.
- * configure: Regenerate.
- * src/x86/win32.S (ffi_prep_args): Declare extern, not global.
- (_ffi_call_SYSV): Add missing function type symbol .def and
- add EH markup labels.
- (_ffi_call_STDCALL): Likewise.
- (_ffi_closure_SYSV): Likewise.
- (_ffi_closure_raw_SYSV): Likewise.
- (.eh_frame): Add hand-crafted EH data.
-
-2009-04-09 Jakub Jelinek <jakub@redhat.com>
-
- * testsuite/lib/libffi-dg.exp: Change copyright header to refer to
- version 3 of the GNU General Public License and to point readers
- at the COPYING3 file and the FSF's license web page.
- * testsuite/libffi.call/call.exp: Likewise.
- * testsuite/libffi.special/special.exp: Likewise.
-
-2009-03-01 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
-
- * configure: Regenerate.
-
-2008-12-18 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
-
- PR libffi/26048
- * configure.ac (HAVE_AS_X86_PCREL): New test.
- * configure: Regenerate.
- * fficonfig.h.in: Regenerate.
- * src/x86/sysv.S [!FFI_NO_RAW_API]: Precalculate
- RAW_CLOSURE_CIF_OFFSET, RAW_CLOSURE_FUN_OFFSET,
- RAW_CLOSURE_USER_DATA_OFFSET for the Solaris 10/x86 assembler.
- (.eh_frame): Only use SYMBOL-. iff HAVE_AS_X86_PCREL.
- * src/x86/unix64.S (.Lstore_table): Move to .text section.
- (.Lload_table): Likewise.
- (.eh_frame): Only use SYMBOL-. iff HAVE_AS_X86_PCREL.
-
-2008-12-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
-
- * configure: Regenerate.
-
-2008-11-21 Eric Botcazou <ebotcazou@adacore.com>
-
- * src/sparc/ffi.c (ffi_prep_cif_machdep): Add support for
- signed/unsigned int8/16 return values.
- * src/sparc/v8.S (ffi_call_v8): Likewise.
- (ffi_closure_v8): Likewise.
-
-2008-09-26 Peter O'Gorman <pogma@thewrittenword.com>
- Steve Ellcey <sje@cup.hp.com>
-
- * configure: Regenerate for new libtool.
- * Makefile.in: Ditto.
- * include/Makefile.in: Ditto.
- * aclocal.m4: Ditto.
-
-2008-08-25 Andreas Tobler <a.tobler@schweiz.org>
-
- * src/powerpc/ffitarget.h (ffi_abi): Add FFI_LINUX and
- FFI_LINUX_SOFT_FLOAT to the POWERPC_FREEBSD enum.
- Add note about flag bits used for FFI_SYSV_TYPE_SMALL_STRUCT.
- Adjust copyright notice.
- * src/powerpc/ffi.c: Add two new flags to indicate if we have one
- register or two register to use for FFI_SYSV structs.
- (ffi_prep_cif_machdep): Pass the right register flag introduced above.
- (ffi_closure_helper_SYSV): Fix the return type for
- FFI_SYSV_TYPE_SMALL_STRUCT. Comment.
- Adjust copyright notice.
-
-2008-07-16 Kaz Kojima <kkojima@gcc.gnu.org>
-
- * src/sh/ffi.c (ffi_prep_closure_loc): Turn INSN into an unsigned
- int.
-
-2008-06-17 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
-
- * configure: Regenerate.
- * include/Makefile.in: Regenerate.
- * testsuite/Makefile.in: Regenerate.
-
-2008-06-07 Joseph Myers <joseph@codesourcery.com>
-
- * configure.ac (parisc*-*-linux*, powerpc-*-sysv*,
- powerpc-*-beos*): Remove.
- * configure: Regenerate.
-
-2008-05-09 Julian Brown <julian@codesourcery.com>
-
- * Makefile.am (LTLDFLAGS): New.
- (libffi_la_LDFLAGS): Use above.
- * Makefile.in: Regenerate.
-
-2008-04-18 Paolo Bonzini <bonzini@gnu.org>
-
- PR bootstrap/35457
- * aclocal.m4: Regenerate.
- * configure: Regenerate.
-
-2008-03-26 Kaz Kojima <kkojima@gcc.gnu.org>
-
- * src/sh/sysv.S: Add .note.GNU-stack on Linux.
- * src/sh64/sysv.S: Likewise.
-
-2008-03-26 Daniel Jacobowitz <dan@debian.org>
-
- * src/arm/sysv.S: Fix ARM comment marker.
-
-2008-03-26 Jakub Jelinek <jakub@redhat.com>
-
- * src/alpha/osf.S: Add .note.GNU-stack on Linux.
- * src/s390/sysv.S: Likewise.
- * src/powerpc/ppc_closure.S: Likewise.
- * src/powerpc/sysv.S: Likewise.
- * src/x86/unix64.S: Likewise.
- * src/x86/sysv.S: Likewise.
- * src/sparc/v8.S: Likewise.
- * src/sparc/v9.S: Likewise.
- * src/m68k/sysv.S: Likewise.
- * src/arm/sysv.S: Likewise.
-
-2008-03-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
-
- * aclocal.m4: Regenerate.
- * configure: Likewise.
- * Makefile.in: Likewise.
- * include/Makefile.in: Likewise.
- * testsuite/Makefile.in: Likewise.
-
-2008-02-12 Bjoern Koenig <bkoenig@alpha-tierchen.de>
- Andreas Tobler <a.tobler@schweiz.org>
-
- * configure.ac: Add amd64-*-freebsd* target.
- * configure: Regenerate.
-
-2008-01-30 H.J. Lu <hongjiu.lu@intel.com>
-
- PR libffi/34612
- * src/x86/sysv.S (ffi_closure_SYSV): Pop 4 byte from stack when
- returning struct.
-
- * testsuite/libffi.call/call.exp: Add "-O2 -fomit-frame-pointer"
- tests.
-
-2008-01-24 David Edelsohn <edelsohn@gnu.org>
-
- * configure: Regenerate.
-
-2008-01-06 Andreas Tobler <a.tobler@schweiz.org>
-
- * src/x86/ffi.c (ffi_prep_cif_machdep): Fix thinko.
-
-2008-01-05 Andreas Tobler <a.tobler@schweiz.org>
-
- PR testsuite/32843
- * src/x86/ffi.c (ffi_prep_cif_machdep): Add code for
- signed/unsigned int8/16 for X86_DARWIN.
- Updated copyright info.
- Handle one and two byte structs with special cif->flags.
- * src/x86/ffitarget.h: Add special types for one and two byte structs.
- Updated copyright info.
- * src/x86/darwin.S (ffi_call_SYSV): Rewrite to use a jump table like
- sysv.S
- Remove code to pop args from the stack after call.
- Special-case signed/unsigned for int8/16, one and two byte structs.
- (ffi_closure_raw_SYSV): Handle FFI_TYPE_UINT8,
- FFI_TYPE_SINT8, FFI_TYPE_UINT16, FFI_TYPE_SINT16, FFI_TYPE_UINT32,
- FFI_TYPE_SINT32.
- Updated copyright info.
-
-2007-12-08 David Daney <ddaney@avtrex.com>
-
- * src/mips/n32.S (ffi_call_N32): Replace dadd with ADDU, dsub with
- SUBU, add with ADDU and use smaller code sequences.
-
-2007-12-07 David Daney <ddaney@avtrex.com>
-
- * src/mips/ffi.c (ffi_prep_cif_machdep): Handle long double return
- type.
-
-2007-12-06 David Daney <ddaney@avtrex.com>
-
- * include/ffi.h.in (FFI_SIZEOF_JAVA_RAW): Define if not already
- defined.
- (ffi_java_raw): New typedef.
- (ffi_java_raw_call, ffi_java_ptrarray_to_raw,
- ffi_java_raw_to_ptrarray): Change parameter types from ffi_raw to
- ffi_java_raw.
- (ffi_java_raw_closure) : Same.
- (ffi_prep_java_raw_closure, ffi_prep_java_raw_closure_loc): Change
- parameter types.
- * src/java_raw_api.c (ffi_java_raw_size): Replace FFI_SIZEOF_ARG with
- FFI_SIZEOF_JAVA_RAW.
- (ffi_java_raw_to_ptrarray): Change type of raw to ffi_java_raw.
- Replace FFI_SIZEOF_ARG with FFI_SIZEOF_JAVA_RAW. Use
- sizeof(ffi_java_raw) for alignment calculations.
- (ffi_java_ptrarray_to_raw): Same.
- (ffi_java_rvalue_to_raw): Add special handling for FFI_TYPE_POINTER
- if FFI_SIZEOF_JAVA_RAW == 4.
- (ffi_java_raw_to_rvalue): Same.
- (ffi_java_raw_call): Change type of raw to ffi_java_raw.
- (ffi_java_translate_args): Same.
- (ffi_prep_java_raw_closure_loc, ffi_prep_java_raw_closure): Change
- parameter types.
- * src/mips/ffitarget.h (FFI_SIZEOF_JAVA_RAW): Define for N32 ABI.
-
-2007-12-06 David Daney <ddaney@avtrex.com>
-
- * src/mips/n32.S (ffi_closure_N32): Use 64-bit add instruction on
- pointer values.
-
-2007-12-01 Andreas Tobler <a.tobler@schweiz.org>
-
- PR libffi/31937
- * src/powerpc/ffitarget.h: Introduce new ABI FFI_LINUX_SOFT_FLOAT.
- Add local FFI_TYPE_UINT128 to handle soft-float long-double-128.
- * src/powerpc/ffi.c: Distinguish between __NO_FPRS__ and not and
- set the NUM_FPR_ARG_REGISTERS according to.
- Add support for potential soft-float support under hard-float
- architecture.
- (ffi_prep_args_SYSV): Set NUM_FPR_ARG_REGISTERS to 0 in case of
- FFI_LINUX_SOFT_FLOAT, handle float, doubles and long-doubles according
- to the FFI_LINUX_SOFT_FLOAT ABI.
- (ffi_prep_cif_machdep): Likewise.
- (ffi_closure_helper_SYSV): Likewise.
- * src/powerpc/ppc_closure.S: Make sure not to store float/double
- on archs where __NO_FPRS__ is true.
- Add FFI_TYPE_UINT128 support.
- * src/powerpc/sysv.S: Add support for soft-float long-double-128.
- Adjust copyright notice.
-
-2007-11-25 Andreas Tobler <a.tobler@schweiz.org>
-
- * src/closures.c: Move defintion of MAYBE_UNUSED from here to ...
- * include/ffi_common.h: ... here.
- Update copyright.
-
-2007-11-17 Andreas Tobler <a.tobler@schweiz.org>
-
- * src/powerpc/sysv.S: Load correct cr to compare if we have long double.
- * src/powerpc/linux64.S: Likewise.
- * src/powerpc/ffi.c: Add a comment to show which part goes into cr6.
- * testsuite/libffi.call/return_ldl.c: New test.
-
-2007-09-04 <aph@redhat.com>
-
- * src/arm/sysv.S (UNWIND): New.
- (Whole file): Conditionally compile unwinder directives.
- * src/arm/sysv.S: Add unwinder directives.
-
- * src/arm/ffi.c (ffi_prep_args): Align structs by at least 4 bytes.
- Only treat r0 as a struct address if we're actually returning a
- struct by address.
- Only copy the bytes that are actually within a struct.
- (ffi_prep_cif_machdep): A Composite Type not larger than 4 bytes
- is returned in r0, not passed by address.
- (ffi_call): Allocate a word-sized temporary for the case where
- a composite is returned in r0.
- (ffi_prep_incoming_args_SYSV): Align as necessary.
-
-2007-08-05 Steven Newbury <s_j_newbury@yahoo.co.uk>
-
- * src/arm/ffi.c (FFI_INIT_TRAMPOLINE): Use __clear_cache instead of
- directly using the sys_cacheflush syscall.
-
-2007-07-27 Andrew Haley <aph@redhat.com>
-
- * src/arm/sysv.S (ffi_closure_SYSV): Add soft-float.
-
-2007-09-03 Maciej W. Rozycki <macro@linux-mips.org>
-
- * Makefile.am: Unify MIPS_IRIX and MIPS_LINUX into MIPS.
- * configure.ac: Likewise.
- * Makefile.in: Regenerate.
- * include/Makefile.in: Likewise.
- * testsuite/Makefile.in: Likewise.
- * configure: Likewise.
-
-2007-08-24 David Daney <ddaney@avtrex.com>
-
- * testsuite/libffi.call/return_sl.c: New test.
-
-2007-08-10 David Daney <ddaney@avtrex.com>
-
- * testsuite/libffi.call/cls_multi_ushort.c,
- testsuite/libffi.call/cls_align_uint16.c,
- testsuite/libffi.call/nested_struct1.c,
- testsuite/libffi.call/nested_struct3.c,
- testsuite/libffi.call/cls_7_1_byte.c,
- testsuite/libffi.call/nested_struct5.c,
- testsuite/libffi.call/cls_double.c,
- testsuite/libffi.call/nested_struct7.c,
- testsuite/libffi.call/cls_sint.c,
- testsuite/libffi.call/nested_struct9.c,
- testsuite/libffi.call/cls_20byte1.c,
- testsuite/libffi.call/cls_multi_sshortchar.c,
- testsuite/libffi.call/cls_align_sint64.c,
- testsuite/libffi.call/cls_3byte2.c,
- testsuite/libffi.call/cls_multi_schar.c,
- testsuite/libffi.call/cls_multi_uchar.c,
- testsuite/libffi.call/cls_19byte.c,
- testsuite/libffi.call/cls_9byte1.c,
- testsuite/libffi.call/cls_align_float.c,
- testsuite/libffi.call/closure_fn1.c,
- testsuite/libffi.call/problem1.c,
- testsuite/libffi.call/closure_fn3.c,
- testsuite/libffi.call/cls_sshort.c,
- testsuite/libffi.call/closure_fn5.c,
- testsuite/libffi.call/cls_align_double.c,
- testsuite/libffi.call/nested_struct.c,
- testsuite/libffi.call/cls_2byte.c,
- testsuite/libffi.call/nested_struct10.c,
- testsuite/libffi.call/cls_4byte.c,
- testsuite/libffi.call/cls_6byte.c,
- testsuite/libffi.call/cls_8byte.c,
- testsuite/libffi.call/cls_multi_sshort.c,
- testsuite/libffi.call/cls_align_sint16.c,
- testsuite/libffi.call/cls_align_uint32.c,
- testsuite/libffi.call/cls_20byte.c,
- testsuite/libffi.call/cls_float.c,
- testsuite/libffi.call/nested_struct2.c,
- testsuite/libffi.call/cls_5_1_byte.c,
- testsuite/libffi.call/nested_struct4.c,
- testsuite/libffi.call/cls_24byte.c,
- testsuite/libffi.call/nested_struct6.c,
- testsuite/libffi.call/cls_64byte.c,
- testsuite/libffi.call/nested_struct8.c,
- testsuite/libffi.call/cls_uint.c,
- testsuite/libffi.call/cls_multi_ushortchar.c,
- testsuite/libffi.call/cls_schar.c,
- testsuite/libffi.call/cls_uchar.c,
- testsuite/libffi.call/cls_align_uint64.c,
- testsuite/libffi.call/cls_ulonglong.c,
- testsuite/libffi.call/cls_align_longdouble.c,
- testsuite/libffi.call/cls_1_1byte.c,
- testsuite/libffi.call/cls_12byte.c,
- testsuite/libffi.call/cls_3_1byte.c,
- testsuite/libffi.call/cls_3byte1.c,
- testsuite/libffi.call/cls_4_1byte.c,
- testsuite/libffi.call/cls_6_1_byte.c,
- testsuite/libffi.call/cls_16byte.c,
- testsuite/libffi.call/cls_18byte.c,
- testsuite/libffi.call/closure_fn0.c,
- testsuite/libffi.call/cls_9byte2.c,
- testsuite/libffi.call/closure_fn2.c,
- testsuite/libffi.call/closure_fn4.c,
- testsuite/libffi.call/cls_ushort.c,
- testsuite/libffi.call/closure_fn6.c,
- testsuite/libffi.call/cls_5byte.c,
- testsuite/libffi.call/cls_align_pointer.c,
- testsuite/libffi.call/cls_7byte.c,
- testsuite/libffi.call/cls_align_sint32.c,
- testsuite/libffi.special/unwindtest_ffi_call.cc,
- testsuite/libffi.special/unwindtest.cc: Remove xfail for mips64*-*-*.
-
-2007-08-10 David Daney <ddaney@avtrex.com>
-
- PR libffi/28313
- * configure.ac: Don't treat mips64 as a special case.
- * Makefile.am (nodist_libffi_la_SOURCES): Add n32.S.
- * configure: Regenerate
- * Makefile.in: Ditto.
- * fficonfig.h.in: Ditto.
- * src/mips/ffitarget.h (REG_L, REG_S, SUBU, ADDU, SRL, LI): Indent.
- (LA, EH_FRAME_ALIGN, FDE_ADDR_BYTES): New preprocessor macros.
- (FFI_DEFAULT_ABI): Set for n64 case.
- (FFI_CLOSURES, FFI_TRAMPOLINE_SIZE): Define for n32 and n64 cases.
- * src/mips/n32.S (ffi_call_N32): Add debug macros and labels for FDE.
- (ffi_closure_N32): New function.
- (.eh_frame): New section
- * src/mips/o32.S: Clean up comments.
- (ffi_closure_O32): Pass ffi_closure parameter in $12.
- * src/mips/ffi.c: Use FFI_MIPS_N32 instead of
- _MIPS_SIM == _ABIN32 throughout.
- (FFI_MIPS_STOP_HERE): New, use in place of
- ffi_stop_here.
- (ffi_prep_args): Use unsigned long to hold pointer values. Rewrite
- to support n32/n64 ABIs.
- (calc_n32_struct_flags): Rewrite.
- (calc_n32_return_struct_flags): Remove unused variable. Reverse
- position of flag bits.
- (ffi_prep_cif_machdep): Rewrite n32 portion.
- (ffi_call): Enable for n64. Add special handling for small structure
- return values.
- (ffi_prep_closure_loc): Add n32 and n64 support.
- (ffi_closure_mips_inner_O32): Add cast to silence warning.
- (copy_struct_N32, ffi_closure_mips_inner_N32): New functions.
-
-2007-08-08 David Daney <ddaney@avtrex.com>
-
- * testsuite/libffi.call/ffitest.h (ffi_type_mylong): Remove definition.
- * testsuite/libffi.call/cls_align_uint16.c (main): Use correct type
- specifiers.
- * testsuite/libffi.call/nested_struct1.c (main): Ditto.
- * testsuite/libffi.call/cls_sint.c (main): Ditto.
- * testsuite/libffi.call/nested_struct9.c (main): Ditto.
- * testsuite/libffi.call/cls_20byte1.c (main): Ditto.
- * testsuite/libffi.call/cls_9byte1.c (main): Ditto.
- * testsuite/libffi.call/closure_fn1.c (main): Ditto.
- * testsuite/libffi.call/closure_fn3.c (main): Ditto.
- * testsuite/libffi.call/return_dbl2.c (main): Ditto.
- * testsuite/libffi.call/cls_sshort.c (main): Ditto.
- * testsuite/libffi.call/return_fl3.c (main): Ditto.
- * testsuite/libffi.call/closure_fn5.c (main): Ditto.
- * testsuite/libffi.call/nested_struct.c (main): Ditto.
- * testsuite/libffi.call/nested_struct10.c (main): Ditto.
- * testsuite/libffi.call/return_ll1.c (main): Ditto.
- * testsuite/libffi.call/cls_8byte.c (main): Ditto.
- * testsuite/libffi.call/cls_align_uint32.c (main): Ditto.
- * testsuite/libffi.call/cls_align_sint16.c (main): Ditto.
- * testsuite/libffi.call/cls_20byte.c (main): Ditto.
- * testsuite/libffi.call/nested_struct2.c (main): Ditto.
- * testsuite/libffi.call/cls_24byte.c (main): Ditto.
- * testsuite/libffi.call/nested_struct6.c (main): Ditto.
- * testsuite/libffi.call/cls_uint.c (main): Ditto.
- * testsuite/libffi.call/cls_12byte.c (main): Ditto.
- * testsuite/libffi.call/cls_16byte.c (main): Ditto.
- * testsuite/libffi.call/closure_fn0.c (main): Ditto.
- * testsuite/libffi.call/cls_9byte2.c (main): Ditto.
- * testsuite/libffi.call/closure_fn2.c (main): Ditto.
- * testsuite/libffi.call/return_dbl1.c (main): Ditto.
- * testsuite/libffi.call/closure_fn4.c (main): Ditto.
- * testsuite/libffi.call/closure_fn6.c (main): Ditto.
- * testsuite/libffi.call/cls_align_sint32.c (main): Ditto.
-
-2007-08-07 Andrew Haley <aph@redhat.com>
-
- * src/x86/sysv.S (ffi_closure_raw_SYSV): Fix typo in previous
- checkin.
-
-2007-08-06 Andrew Haley <aph@redhat.com>
-
- PR testsuite/32843
- * src/x86/sysv.S (ffi_closure_raw_SYSV): Handle FFI_TYPE_UINT8,
- FFI_TYPE_SINT8, FFI_TYPE_UINT16, FFI_TYPE_SINT16, FFI_TYPE_UINT32,
- FFI_TYPE_SINT32.
-
-2007-08-02 David Daney <ddaney@avtrex.com>
-
- * testsuite/libffi.call/return_ul.c (main): Define return type as
- ffi_arg. Use proper printf conversion specifier.
-
-2007-07-30 Andrew Haley <aph@redhat.com>
-
- PR testsuite/32843
- * src/x86/ffi.c (ffi_prep_cif_machdep): in x86 case, add code for
- signed/unsigned int8/16.
- * src/x86/sysv.S (ffi_call_SYSV): Rewrite to:
- Use a jump table.
- Remove code to pop args from the stack after call.
- Special-case signed/unsigned int8/16.
- * testsuite/libffi.call/return_sc.c (main): Revert.
-
-2007-07-26 Richard Guenther <rguenther@suse.de>
-
- PR testsuite/32843
- * testsuite/libffi.call/return_sc.c (main): Verify call
- result as signed char, not ffi_arg.
-
-2007-07-16 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
-
- * configure.ac (i?86-*-solaris2.1[0-9]): Set TARGET to X86_64.
- * configure: Regenerate.
-
-2007-07-11 David Daney <ddaney@avtrex.com>
-
- * src/mips/ffi.c: Don't include sys/cachectl.h.
- (ffi_prep_closure_loc): Use __builtin___clear_cache() instead of
- cacheflush().
-
-2007-05-18 Aurelien Jarno <aurelien@aurel32.net>
-
- * src/arm/ffi.c (ffi_prep_closure_loc): Renamed and ajusted
- from (ffi_prep_closure): ... this.
- (FFI_INIT_TRAMPOLINE): Adjust.
-
-2005-12-31 Phil Blundell <pb@reciva.com>
-
- * src/arm/ffi.c (ffi_prep_incoming_args_SYSV,
- ffi_closure_SYSV_inner, ffi_prep_closure): New, add closure support.
- * src/arm/sysv.S(ffi_closure_SYSV): Likewise.
- * src/arm/ffitarget.h (FFI_TRAMPOLINE_SIZE): Likewise.
- (FFI_CLOSURES): Enable closure support.
-
-2007-07-03 Andrew Haley <aph@hedges.billgatliff.com>
-
- * testsuite/libffi.call/cls_multi_ushort.c,
- testsuite/libffi.call/cls_align_uint16.c,
- testsuite/libffi.call/nested_struct1.c,
- testsuite/libffi.call/nested_struct3.c,
- testsuite/libffi.call/cls_7_1_byte.c,
- testsuite/libffi.call/cls_double.c,
- testsuite/libffi.call/nested_struct5.c,
- testsuite/libffi.call/nested_struct7.c,
- testsuite/libffi.call/cls_sint.c,
- testsuite/libffi.call/nested_struct9.c,
- testsuite/libffi.call/cls_20byte1.c,
- testsuite/libffi.call/cls_multi_sshortchar.c,
- testsuite/libffi.call/cls_align_sint64.c,
- testsuite/libffi.call/cls_3byte2.c,
- testsuite/libffi.call/cls_multi_schar.c,
- testsuite/libffi.call/cls_multi_uchar.c,
- testsuite/libffi.call/cls_19byte.c,
- testsuite/libffi.call/cls_9byte1.c,
- testsuite/libffi.call/cls_align_float.c,
- testsuite/libffi.call/closure_fn1.c,
- testsuite/libffi.call/problem1.c,
- testsuite/libffi.call/closure_fn3.c,
- testsuite/libffi.call/cls_sshort.c,
- testsuite/libffi.call/closure_fn5.c,
- testsuite/libffi.call/cls_align_double.c,
- testsuite/libffi.call/cls_2byte.c,
- testsuite/libffi.call/nested_struct.c,
- testsuite/libffi.call/nested_struct10.c,
- testsuite/libffi.call/cls_4byte.c,
- testsuite/libffi.call/cls_6byte.c,
- testsuite/libffi.call/cls_8byte.c,
- testsuite/libffi.call/cls_multi_sshort.c,
- testsuite/libffi.call/cls_align_uint32.c,
- testsuite/libffi.call/cls_align_sint16.c,
- testsuite/libffi.call/cls_float.c,
- testsuite/libffi.call/cls_20byte.c,
- testsuite/libffi.call/cls_5_1_byte.c,
- testsuite/libffi.call/nested_struct2.c,
- testsuite/libffi.call/cls_24byte.c,
- testsuite/libffi.call/nested_struct4.c,
- testsuite/libffi.call/nested_struct6.c,
- testsuite/libffi.call/cls_64byte.c,
- testsuite/libffi.call/nested_struct8.c,
- testsuite/libffi.call/cls_uint.c,
- testsuite/libffi.call/cls_multi_ushortchar.c,
- testsuite/libffi.call/cls_schar.c,
- testsuite/libffi.call/cls_uchar.c,
- testsuite/libffi.call/cls_align_uint64.c,
- testsuite/libffi.call/cls_ulonglong.c,
- testsuite/libffi.call/cls_align_longdouble.c,
- testsuite/libffi.call/cls_1_1byte.c,
- testsuite/libffi.call/cls_12byte.c,
- testsuite/libffi.call/cls_3_1byte.c,
- testsuite/libffi.call/cls_3byte1.c,
- testsuite/libffi.call/cls_4_1byte.c,
- testsuite/libffi.call/cls_6_1_byte.c,
- testsuite/libffi.call/cls_16byte.c,
- testsuite/libffi.call/cls_18byte.c,
- testsuite/libffi.call/closure_fn0.c,
- testsuite/libffi.call/cls_9byte2.c,
- testsuite/libffi.call/closure_fn2.c,
- testsuite/libffi.call/closure_fn4.c,
- testsuite/libffi.call/cls_ushort.c,
- testsuite/libffi.call/closure_fn6.c,
- testsuite/libffi.call/cls_5byte.c,
- testsuite/libffi.call/cls_align_pointer.c,
- testsuite/libffi.call/cls_7byte.c,
- testsuite/libffi.call/cls_align_sint32.c,
- testsuite/libffi.special/unwindtest_ffi_call.cc,
- testsuite/libffi.special/unwindtest.cc: Enable for ARM.
-
-2007-07-05 H.J. Lu <hongjiu.lu@intel.com>
-
- * aclocal.m4: Regenerated.
-
-2007-06-02 Paolo Bonzini <bonzini@gnu.org>
-
- * configure: Regenerate.
-
-2007-05-23 Steve Ellcey <sje@cup.hp.com>
-
- * Makefile.in: Regenerate.
- * configure: Regenerate.
- * aclocal.m4: Regenerate.
- * include/Makefile.in: Regenerate.
- * testsuite/Makefile.in: Regenerate.
-
-2007-05-10 Roman Zippel <zippel@linux-m68k.org>
-
- * src/m68k/ffi.c (ffi_prep_incoming_args_SYSV,
- ffi_closure_SYSV_inner,ffi_prep_closure): New, add closure support.
- * src/m68k/sysv.S(ffi_closure_SYSV,ffi_closure_struct_SYSV): Likewise.
- * src/m68k/ffitarget.h (FFI_TRAMPOLINE_SIZE): Likewise.
- (FFI_CLOSURES): Enable closure support.
-
-2007-05-10 Roman Zippel <zippel@linux-m68k.org>
-
- * configure.ac (HAVE_AS_CFI_PSEUDO_OP): New test.
- * configure: Regenerate.
- * fficonfig.h.in: Regenerate.
- * src/m68k/sysv.S (CFI_STARTPROC,CFI_ENDPROC,
- CFI_OFFSET,CFI_DEF_CFA): New macros.
- (ffi_call_SYSV): Add callframe annotation.
-
-2007-05-10 Roman Zippel <zippel@linux-m68k.org>
-
- * src/m68k/ffi.c (ffi_prep_args,ffi_prep_cif_machdep): Fix
- numerous test suite failures.
- * src/m68k/sysv.S (ffi_call_SYSV): Likewise.
-
-2007-04-11 Paolo Bonzini <bonzini@gnu.org>
-
- * Makefile.am (EXTRA_DIST): Bring up to date.
- * Makefile.in: Regenerate.
- * src/frv/eabi.S: Remove RCS keyword.
-
-2007-04-06 Richard Henderson <rth@redhat.com>
-
- * configure.ac: Tidy target case.
- (HAVE_LONG_DOUBLE): Allow the target to override.
- * configure: Regenerate.
- * include/ffi.h.in: Don't define ffi_type_foo if
- LIBFFI_HIDE_BASIC_TYPES is defined.
- (ffi_type_longdouble): If not HAVE_LONG_DOUBLE, define
- to ffi_type_double.
- * types.c (LIBFFI_HIDE_BASIC_TYPES): Define.
- (FFI_TYPEDEF, ffi_type_void): Mark the data const.
- (ffi_type_longdouble): Special case for Alpha. Don't define
- if long double == double.
-
- * src/alpha/ffi.c (FFI_TYPE_LONGDOUBLE): Assert unique value.
- (ffi_prep_cif_machdep): Handle it as the 128-bit type.
- (ffi_call, ffi_closure_osf_inner): Likewise.
- (ffi_closure_osf_inner): Likewise. Mark hidden.
- (ffi_call_osf, ffi_closure_osf): Mark hidden.
- * src/alpha/ffitarget.h (FFI_LAST_ABI): Tidy definition.
- * src/alpha/osf.S (ffi_call_osf, ffi_closure_osf): Mark hidden.
- (load_table): Handle 128-bit long double.
-
- * testsuite/libffi.call/float4.c: Add -mieee for alpha.
-
-2007-04-06 Tom Tromey <tromey@redhat.com>
-
- PR libffi/31491:
- * README: Fixed bug in example.
-
-2007-04-03 Jakub Jelinek <jakub@redhat.com>
-
- * src/closures.c: Include sys/statfs.h.
- (_GNU_SOURCE): Define on Linux.
- (FFI_MMAP_EXEC_SELINUX): Define.
- (selinux_enabled): New variable.
- (selinux_enabled_check): New function.
- (is_selinux_enabled): Define.
- (dlmmap): Use it.
-
-2007-03-24 Uros Bizjak <ubizjak@gmail.com>
-
- * testsuite/libffi.call/return_fl2.c (return_fl): Mark as static.
- Use 'volatile float sum' to create sum of floats to avoid false
- negative due to excess precision on ix86 targets.
- (main): Ditto.
-
-2007-03-08 Alexandre Oliva <aoliva@redhat.com>
-
- * src/powerpc/ffi.c (flush_icache): Fix left-over from previous
- patch.
- (ffi_prep_closure_loc): Remove unneeded casts. Add needed ones.
-
-2007-03-07 Alexandre Oliva <aoliva@redhat.com>
-
- * include/ffi.h.in (ffi_closure_alloc, ffi_closure_free): New.
- (ffi_prep_closure_loc): New.
- (ffi_prep_raw_closure_loc): New.
- (ffi_prep_java_raw_closure_loc): New.
- * src/closures.c: New file.
- * src/dlmalloc.c [FFI_MMAP_EXEC_WRIT] (struct malloc_segment):
- Replace sflags with exec_offset.
- [FFI_MMAP_EXEC_WRIT] (mmap_exec_offset, add_segment_exec_offset,
- sub_segment_exec_offset): New macros.
- (get_segment_flags, set_segment_flags, check_segment_merge): New
- macros.
- (is_mmapped_segment, is_extern_segment): Use get_segment_flags.
- (add_segment, sys_alloc, create_mspace, create_mspace_with_base,
- destroy_mspace): Use new macros.
- (sys_alloc): Silence warning.
- * Makefile.am (libffi_la_SOURCES): Add src/closures.c.
- * Makefile.in: Rebuilt.
- * src/prep_cif [FFI_CLOSURES] (ffi_prep_closure): Implement in
- terms of ffi_prep_closure_loc.
- * src/raw_api.c (ffi_prep_raw_closure_loc): Renamed and adjusted
- from...
- (ffi_prep_raw_closure): ... this. Re-implement in terms of the
- renamed version.
- * src/java_raw_api (ffi_prep_java_raw_closure_loc): Renamed and
- adjusted from...
- (ffi_prep_java_raw_closure): ... this. Re-implement in terms of
- the renamed version.
- * src/alpha/ffi.c (ffi_prep_closure_loc): Renamed from
- (ffi_prep_closure): ... this.
- * src/pa/ffi.c: Likewise.
- * src/cris/ffi.c: Likewise. Adjust.
- * src/frv/ffi.c: Likewise.
- * src/ia64/ffi.c: Likewise.
- * src/mips/ffi.c: Likewise.
- * src/powerpc/ffi_darwin.c: Likewise.
- * src/s390/ffi.c: Likewise.
- * src/sh/ffi.c: Likewise.
- * src/sh64/ffi.c: Likewise.
- * src/sparc/ffi.c: Likewise.
- * src/x86/ffi64.c: Likewise.
- * src/x86/ffi.c: Likewise.
- (FFI_INIT_TRAMPOLINE): Adjust.
- (ffi_prep_raw_closure_loc): Renamed and adjusted from...
- (ffi_prep_raw_closure): ... this.
- * src/powerpc/ffi.c (ffi_prep_closure_loc): Renamed from
- (ffi_prep_closure): ... this.
- (flush_icache): Adjust.
-
-2007-03-07 Alexandre Oliva <aoliva@redhat.com>
-
- * src/dlmalloc.c: New file, imported version 2.8.3 of Doug
- Lea's malloc.
-
-2007-03-01 Brooks Moses <brooks.moses@codesourcery.com>
-
- * Makefile.am: Add dummy install-pdf target.
- * Makefile.in: Regenerate
-
-2007-02-13 Andreas Krebbel <krebbel1@de.ibm.com>
-
- * src/s390/ffi.c (ffi_prep_args, ffi_prep_cif_machdep,
- ffi_closure_helper_SYSV): Add long double handling.
-
-2007-02-02 Jakub Jelinek <jakub@redhat.com>
-
- * src/powerpc/linux64.S (ffi_call_LINUX64): Move restore of r2
- immediately after bctrl instruction.
-
-2007-01-18 Alexandre Oliva <aoliva@redhat.com>
-
- * Makefile.am (all-recursive, install-recursive,
- mostlyclean-recursive, clean-recursive, distclean-recursive,
- maintainer-clean-recursive): Add missing targets.
- * Makefile.in: Rebuilt.
-
-2006-12-14 Andreas Tobler <a.tobler@schweiz.org>
-
- * configure.ac: Add TARGET for x86_64-*-darwin*.
- * Makefile.am (nodist_libffi_la_SOURCES): Add rules for 64-bit sources
- for X86_DARWIN.
- * src/x86/ffitarget.h: Set trampoline size for x86_64-*-darwin*.
- * src/x86/darwin64.S: New file for x86_64-*-darwin* support.
- * configure: Regenerate.
- * Makefile.in: Regenerate.
- * include/Makefile.in: Regenerate.
- * testsuite/Makefile.in: Regenerate.
- * testsuite/libffi.special/unwindtest_ffi_call.cc: New test case for
- ffi_call only.
-
-2006-12-13 Andreas Tobler <a.tobler@schweiz.org>
-
- * aclocal.m4: Regenerate with aclocal -I .. as written in the
- Makefile.am.
-
-2006-10-31 Geoffrey Keating <geoffk@apple.com>
-
- * src/powerpc/ffi_darwin.c (darwin_adjust_aggregate_sizes): New.
- (ffi_prep_cif_machdep): Call darwin_adjust_aggregate_sizes for
- Darwin.
- * testsuite/libffi.call/nested_struct4.c: Remove Darwin XFAIL.
- * testsuite/libffi.call/nested_struct6.c: Remove Darwin XFAIL.
-
-2006-10-10 Paolo Bonzini <bonzini@gnu.org>
- Sandro Tolaini <tolaini@libero.it>
-
- * configure.ac [i*86-*-darwin*]: Set X86_DARWIN symbol and
- conditional.
- * configure: Regenerated.
- * Makefile.am (nodist_libffi_la_SOURCES) [X86_DARWIN]: New case.
- (EXTRA_DIST): Add src/x86/darwin.S.
- * Makefile.in: Regenerated.
- * include/Makefile.in: Regenerated.
- * testsuite/Makefile.in: Regenerated.
-
- * src/x86/ffi.c (ffi_prep_cif_machdep) [X86_DARWIN]: Treat like
- X86_WIN32, and additionally align stack to 16 bytes.
- * src/x86/darwin.S: New, based on sysv.S.
- * src/prep_cif.c (ffi_prep_cif) [X86_DARWIN]: Align > 8-byte structs.
-
-2006-09-12 David Daney <ddaney@avtrex.com>
-
- PR libffi/23935
- * include/Makefile.am: Install both ffi.h and ffitarget.h in
- $(libdir)/gcc/$(target_alias)/$(gcc_version)/include.
- * aclocal.m4: Regenerated for automake 1.9.6.
- * Makefile.in: Regenerated.
- * include/Makefile.in: Regenerated.
- * testsuite/Makefile.in: Regenerated.
-
-2006-08-17 Andreas Tobler <a.tobler@schweiz.ch>
-
- * include/ffi_common.h (struct): Revert accidental commit.
-
-2006-08-15 Andreas Tobler <a.tobler@schweiz.ch>
-
- * include/ffi_common.h: Remove lint directives.
- * include/ffi.h.in: Likewise.
-
-2006-07-25 Torsten Schoenfeld <kaffeetisch@gmx.de>
-
- * include/ffi.h.in (ffi_type_ulong, ffi_type_slong): Define correctly
- for 32-bit architectures.
- * testsuite/libffi.call/return_ul.c: New test case.
-
-2006-07-19 David Daney <ddaney@avtrex.com>
-
- * testsuite/libffi.call/closure_fn6.c: Remove xfail for mips,
- xfail remains for mips64.
-
-2006-05-23 Carlos O'Donell <carlos@codesourcery.com>
-
- * Makefile.am: Add install-html target. Add install-html to .PHONY
- * Makefile.in: Regenerate.
- * aclocal.m4: Regenerate.
- * include/Makefile.in: Regenerate.
- * testsuite/Makefile.in: Regenerate.
-
-2006-05-18 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
-
- * pa/ffi.c (ffi_prep_args_pa32): Load floating point arguments from
- stack slot.
-
-2006-04-22 Andreas Tobler <a.tobler@schweiz.ch>
-
- * README: Remove notice about 'Crazy Comments'.
- * src/debug.c: Remove lint directives. Cleanup white spaces.
- * src/java_raw_api.c: Likewise.
- * src/prep_cif.c: Likewise.
- * src/raw_api.c: Likewise.
- * src/ffitest.c: Delete. No longer needed, all test cases migrated
- to the testsuite.
- * src/arm/ffi.c: Remove lint directives.
- * src/m32r/ffi.c: Likewise.
- * src/pa/ffi.c: Likewise.
- * src/powerpc/ffi.c: Likewise.
- * src/powerpc/ffi_darwin.c: Likewise.
- * src/sh/ffi.c: Likewise.
- * src/sh64/ffi.c: Likewise.
- * src/x86/ffi.c: Likewise.
- * testsuite/libffi.call/float2.c: Likewise.
- * testsuite/libffi.call/promotion.c: Likewise.
- * testsuite/libffi.call/struct1.c: Likewise.
-
-2006-04-13 Andreas Tobler <a.tobler@schweiz.ch>
-
- * src/pa/hpux32.S: Correct unwind offset calculation for
- ffi_closure_pa32.
- * src/pa/linux.S: Likewise.
-
-2006-04-12 James E Wilson <wilson@specifix.com>
-
- PR libgcj/26483
- * src/ia64/ffi.c (stf_spill, ldf_fill): Rewrite as macros.
- (hfa_type_load): Call stf_spill.
- (hfa_type_store): Call ldf_fill.
- (ffi_call): Adjust calls to above routines. Add local temps for
- macro result.
-
-2006-04-10 Matthias Klose <doko@debian.org>
-
- * testsuite/lib/libffi-dg.exp (libffi-init): Recognize multilib
- directory names containing underscores.
-
-2006-04-07 James E Wilson <wilson@specifix.com>
-
- * testsuite/libffi.call/float4.c: New testcase.
-
-2006-04-05 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
- Andreas Tobler <a.tobler@schweiz.ch>
-
- * Makefile.am: Add PA_HPUX port.
- * Makefile.in: Regenerate.
- * include/Makefile.in: Likewise.
- * testsuite/Makefile.in: Likewise.
- * configure.ac: Add PA_HPUX rules.
- * configure: Regenerate.
- * src/pa/ffitarget.h: Rename linux target to PA_LINUX.
- Add PA_HPUX and PA64_HPUX.
- Rename FFI_LINUX ABI to FFI_PA32 ABI.
- (FFI_TRAMPOLINE_SIZE): Define for 32-bit HP-UX targets.
- (FFI_TYPE_SMALL_STRUCT2): Define.
- (FFI_TYPE_SMALL_STRUCT4): Likewise.
- (FFI_TYPE_SMALL_STRUCT8): Likewise.
- (FFI_TYPE_SMALL_STRUCT3): Redefine.
- (FFI_TYPE_SMALL_STRUCT5): Likewise.
- (FFI_TYPE_SMALL_STRUCT6): Likewise.
- (FFI_TYPE_SMALL_STRUCT7): Likewise.
- * src/pa/ffi.c (ROUND_DOWN): Delete.
- (fldw, fstw, fldd, fstd): Use '__asm__'.
- (ffi_struct_type): Add support for FFI_TYPE_SMALL_STRUCT2,
- FFI_TYPE_SMALL_STRUCT4 and FFI_TYPE_SMALL_STRUCT8.
- (ffi_prep_args_LINUX): Rename to ffi_prep_args_pa32. Update comment.
- Simplify incrementing of stack slot variable. Change type of local
- 'n' to unsigned int.
- (ffi_size_stack_LINUX): Rename to ffi_size_stack_pa32. Handle long
- double on PA_HPUX.
- (ffi_prep_cif_machdep): Likewise.
- (ffi_call): Likewise.
- (ffi_closure_inner_LINUX): Rename to ffi_closure_inner_pa32. Change
- return type to ffi_status. Simplify incrementing of stack slot
- variable. Only copy floating point argument registers when PA_LINUX
- is true. Reformat debug statement.
- Add support for FFI_TYPE_SMALL_STRUCT2, FFI_TYPE_SMALL_STRUCT4 and
- FFI_TYPE_SMALL_STRUCT8.
- (ffi_closure_LINUX): Rename to ffi_closure_pa32. Add 'extern' to
- declaration.
- (ffi_prep_closure): Make linux trampoline conditional on PA_LINUX.
- Add nops to cache flush. Add trampoline for PA_HPUX.
- * src/pa/hpux32.S: New file.
- * src/pa/linux.S (ffi_call_LINUX): Rename to ffi_call_pa32. Rename
- ffi_prep_args_LINUX to ffi_prep_args_pa32.
- Localize labels. Add support for 2, 4 and 8-byte small structs. Handle
- unaligned destinations in 3, 5, 6 and 7-byte small structs. Order
- argument type checks so that common argument types appear first.
- (ffi_closure_LINUX): Rename to ffi_closure_pa32. Rename
- ffi_closure_inner_LINUX to ffi_closure_inner_pa32.
-
-2006-03-24 Alan Modra <amodra@bigpond.net.au>
-
- * src/powerpc/ffitarget.h (enum ffi_abi): Add FFI_LINUX. Default
- for 32-bit using IBM extended double format. Fix FFI_LAST_ABI.
- * src/powerpc/ffi.c (ffi_prep_args_SYSV): Handle linux variant of
- FFI_TYPE_LONGDOUBLE.
- (ffi_prep_args64): Assert using IBM extended double.
- (ffi_prep_cif_machdep): Don't munge FFI_TYPE_LONGDOUBLE type.
- Handle FFI_LINUX FFI_TYPE_LONGDOUBLE return and args.
- (ffi_call): Handle FFI_LINUX.
- (ffi_closure_helper_SYSV): Non FFI_LINUX long double return needs
- gpr3 return pointer as for struct return. Handle FFI_LINUX
- FFI_TYPE_LONGDOUBLE return and args. Don't increment "nf"
- unnecessarily.
- * src/powerpc/ppc_closure.S (ffi_closure_SYSV): Load both f1 and f2
- for FFI_TYPE_LONGDOUBLE. Move epilogue insns into case table.
- Don't use r6 as pointer to results, instead use sp offset. Don't
- make a special call to load lr with case table address, instead
- use offset from previous call.
- * src/powerpc/sysv.S (ffi_call_SYSV): Save long double return.
- * src/powerpc/linux64.S (ffi_call_LINUX64): Simplify long double
- return.
-
-2006-03-15 Kaz Kojima <kkojima@gcc.gnu.org>
-
- * src/sh64/ffi.c (ffi_prep_cif_machdep): Handle float arguments
- passed with FP registers correctly.
- (ffi_closure_helper_SYSV): Likewise.
- * src/sh64/sysv.S: Likewise.
-
-2006-03-01 Andreas Tobler <a.tobler@schweiz.ch>
-
- * testsuite/libffi.special/unwindtest.cc (closure_test_fn): Mark cif,
- args and userdata unused.
- (closure_test_fn1): Mark cif and userdata unused.
- (main): Remove unused res.
-
-2006-02-28 Andreas Tobler <a.tobler@schweiz.ch>
-
- * testsuite/libffi.call/call.exp: Adjust FSF address. Add test runs for
- -O2, -O3, -Os and the warning flags -W -Wall.
- * testsuite/libffi.special/special.exp: Likewise.
- * testsuite/libffi.call/ffitest.h: Add an __UNUSED__ macro to mark
- unused parameter unused for gcc or else do nothing.
- * testsuite/libffi.special/ffitestcxx.h: Likewise.
- * testsuite/libffi.call/cls_12byte.c (cls_struct_12byte_gn): Mark cif
- and userdata unused.
- * testsuite/libffi.call/cls_16byte.c (cls_struct_16byte_gn): Likewise.
- * testsuite/libffi.call/cls_18byte.c (cls_struct_18byte_gn): Likewise.
- * testsuite/libffi.call/cls_19byte.c (cls_struct_19byte_gn): Likewise.
- * testsuite/libffi.call/cls_1_1byte.c (cls_struct_1_1byte_gn): Likewise.
- * testsuite/libffi.call/cls_20byte.c (cls_struct_20byte_gn): Likewise.
- * testsuite/libffi.call/cls_20byte1.c (cls_struct_20byte_gn): Likewise.
- * testsuite/libffi.call/cls_24byte.c (cls_struct_24byte_gn): Likewise.
- * testsuite/libffi.call/cls_2byte.c (cls_struct_2byte_gn): Likewise.
- * testsuite/libffi.call/cls_3_1byte.c (cls_struct_3_1byte_gn): Likewise.
- * testsuite/libffi.call/cls_3byte1.c (cls_struct_3byte_gn): Likewise.
- * testsuite/libffi.call/cls_3byte2.c (cls_struct_3byte_gn1): Likewise.
- * testsuite/libffi.call/cls_4_1byte.c (cls_struct_4_1byte_gn): Likewise.
- * testsuite/libffi.call/cls_4byte.c (cls_struct_4byte_gn): Likewise.
- * testsuite/libffi.call/cls_5_1_byte.c (cls_struct_5byte_gn): Likewise.
- * testsuite/libffi.call/cls_5byte.c (cls_struct_5byte_gn): Likewise.
- * testsuite/libffi.call/cls_64byte.c (cls_struct_64byte_gn): Likewise.
- * testsuite/libffi.call/cls_6_1_byte.c (cls_struct_6byte_gn): Likewise.
- * testsuite/libffi.call/cls_6byte.c (cls_struct_6byte_gn): Likewise.
- * testsuite/libffi.call/cls_7_1_byte.c (cls_struct_7byte_gn): Likewise.
- * testsuite/libffi.call/cls_7byte.c (cls_struct_7byte_gn): Likewise.
- * testsuite/libffi.call/cls_8byte.c (cls_struct_8byte_gn): Likewise.
- * testsuite/libffi.call/cls_9byte1.c (cls_struct_9byte_gn): Likewise.
- * testsuite/libffi.call/cls_9byte2.c (cls_struct_9byte_gn): Likewise.
- * testsuite/libffi.call/cls_align_double.c (cls_struct_align_gn):
- Likewise.
- * testsuite/libffi.call/cls_align_float.c (cls_struct_align_gn):
- Likewise.
- * testsuite/libffi.call/cls_align_longdouble.c (cls_struct_align_gn):
- Likewise.
- * testsuite/libffi.call/cls_align_pointer.c (cls_struct_align_fn): Cast
- void* to avoid compiler warning.
- (main): Likewise.
- (cls_struct_align_gn): Mark cif and userdata unused.
- * testsuite/libffi.call/cls_align_sint16.c (cls_struct_align_gn):
- Likewise.
- * testsuite/libffi.call/cls_align_sint32.c (cls_struct_align_gn):
- Likewise.
- * testsuite/libffi.call/cls_align_sint64.c (cls_struct_align_gn):
- Likewise.
- * testsuite/libffi.call/cls_align_uint16.c (cls_struct_align_gn):
- Likewise.
- * testsuite/libffi.call/cls_align_uint32.c (cls_struct_align_gn):
- Likewise.
- * testsuite/libffi.call/cls_double.c (cls_ret_double_fn): Likewise.
- * testsuite/libffi.call/cls_float.c (cls_ret_float_fn): Likewise.
- * testsuite/libffi.call/cls_multi_schar.c (test_func_gn): Mark cif and
- data unused.
- (main): Cast res_call to silence gcc.
- * testsuite/libffi.call/cls_multi_sshort.c (test_func_gn): Mark cif and
- data unused.
- (main): Cast res_call to silence gcc.
- * testsuite/libffi.call/cls_multi_sshortchar.c (test_func_gn): Mark cif
- and data unused.
- (main): Cast res_call to silence gcc.
- * testsuite/libffi.call/cls_multi_uchar.c (test_func_gn): Mark cif and
- data unused.
- (main): Cast res_call to silence gcc.
- * testsuite/libffi.call/cls_multi_ushort.c (test_func_gn): Mark cif and
- data unused.
- (main): Cast res_call to silence gcc.
- * testsuite/libffi.call/cls_multi_ushortchar.c (test_func_gn): Mark cif
- and data unused.
- (main): Cast res_call to silence gcc.
- * testsuite/libffi.call/cls_schar.c (cls_ret_schar_fn): Mark cif and
- userdata unused.
- (cls_ret_schar_fn): Cast printf parameter to silence gcc.
- * testsuite/libffi.call/cls_sint.c (cls_ret_sint_fn): Mark cif and
- userdata unused.
- (cls_ret_sint_fn): Cast printf parameter to silence gcc.
- * testsuite/libffi.call/cls_sshort.c (cls_ret_sshort_fn): Mark cif and
- userdata unused.
- (cls_ret_sshort_fn): Cast printf parameter to silence gcc.
- * testsuite/libffi.call/cls_uchar.c (cls_ret_uchar_fn): Mark cif and
- userdata unused.
- (cls_ret_uchar_fn): Cast printf parameter to silence gcc.
- * testsuite/libffi.call/cls_uint.c (cls_ret_uint_fn): Mark cif and
- userdata unused.
- (cls_ret_uint_fn): Cast printf parameter to silence gcc.
- * testsuite/libffi.call/cls_ulonglong.c (cls_ret_ulonglong_fn): Mark cif
- and userdata unused.
- * testsuite/libffi.call/cls_ushort.c (cls_ret_ushort_fn): Mark cif and
- userdata unused.
- (cls_ret_ushort_fn): Cast printf parameter to silence gcc.
- * testsuite/libffi.call/float.c (floating): Remove unused parameter e.
- * testsuite/libffi.call/float1.c (main): Remove unused variable i.
- Cleanup white spaces.
- * testsuite/libffi.call/negint.c (checking): Remove unused variable i.
- * testsuite/libffi.call/nested_struct.c (cls_struct_combined_gn): Mark
- cif and userdata unused.
- * testsuite/libffi.call/nested_struct1.c (cls_struct_combined_gn):
- Likewise.
- * testsuite/libffi.call/nested_struct10.c (B_gn): Likewise.
- * testsuite/libffi.call/nested_struct2.c (B_fn): Adjust printf
- formatters to silence gcc.
- (B_gn): Mark cif and userdata unused.
- * testsuite/libffi.call/nested_struct3.c (B_gn): Mark cif and userdata
- unused.
- * testsuite/libffi.call/nested_struct4.c: Mention related PR.
- (B_gn): Mark cif and userdata unused.
- * testsuite/libffi.call/nested_struct5.c (B_gn): Mark cif and userdata
- unused.
- * testsuite/libffi.call/nested_struct6.c: Mention related PR.
- (B_gn): Mark cif and userdata unused.
- * testsuite/libffi.call/nested_struct7.c (B_gn): Mark cif and userdata
- unused.
- * testsuite/libffi.call/nested_struct8.c (B_gn): Likewise.
- * testsuite/libffi.call/nested_struct9.c (B_gn): Likewise.
- * testsuite/libffi.call/problem1.c (stub): Likewise.
- * testsuite/libffi.call/pyobjc-tc.c (main): Cast the result to silence
- gcc.
- * testsuite/libffi.call/return_fl2.c (return_fl): Add the note mentioned
- in the last commit for this test case in the test case itself.
- * testsuite/libffi.call/closure_fn0.c (closure_test_fn0): Mark cif as
- unused.
- * testsuite/libffi.call/closure_fn1.c (closure_test_fn1): Likewise.
- * testsuite/libffi.call/closure_fn2.c (closure_test_fn2): Likewise.
- * testsuite/libffi.call/closure_fn3.c (closure_test_fn3): Likewise.
- * testsuite/libffi.call/closure_fn4.c (closure_test_fn0): Likewise.
- * testsuite/libffi.call/closure_fn5.c (closure_test_fn5): Likewise.
- * testsuite/libffi.call/closure_fn6.c (closure_test_fn0): Likewise.
-
-2006-02-22 Kaz Kojima <kkojima@gcc.gnu.org>
-
- * src/sh/sysv.S: Fix register numbers in the FDE for
- ffi_closure_SYSV.
-
-2006-02-20 Andreas Tobler <a.tobler@schweiz.ch>
-
- * testsuite/libffi.call/return_fl2.c (return_fl): Remove static
- declaration to avoid a false negative on ix86. See PR323.
-
-2006-02-18 Kaz Kojima <kkojima@gcc.gnu.org>
-
- * src/sh/ffi.c (ffi_closure_helper_SYSV): Remove unused variable
- and cast integer to void * if needed. Update the pointer to
- the FP register saved area correctly.
-
-2006-02-17 Andreas Tobler <a.tobler@schweiz.ch>
-
- * testsuite/libffi.call/nested_struct6.c: XFAIL this test until PR25630
- is fixed.
- * testsuite/libffi.call/nested_struct4.c: Likewise.
-
-2006-02-16 Andreas Tobler <a.tobler@schweiz.ch>
-
- * testsuite/libffi.call/return_dbl.c: New test case.
- * testsuite/libffi.call/return_dbl1.c: Likewise.
- * testsuite/libffi.call/return_dbl2.c: Likewise.
- * testsuite/libffi.call/return_fl.c: Likewise.
- * testsuite/libffi.call/return_fl1.c: Likewise.
- * testsuite/libffi.call/return_fl2.c: Likewise.
- * testsuite/libffi.call/return_fl3.c: Likewise.
- * testsuite/libffi.call/closure_fn6.c: Likewise.
-
- * testsuite/libffi.call/nested_struct2.c: Remove ffi_type_mylong
- definition.
- * testsuite/libffi.call/ffitest.h: Add ffi_type_mylong definition
- here to be used by other test cases too.
-
- * testsuite/libffi.call/nested_struct10.c: New test case.
- * testsuite/libffi.call/nested_struct9.c: Likewise.
- * testsuite/libffi.call/nested_struct8.c: Likewise.
- * testsuite/libffi.call/nested_struct7.c: Likewise.
- * testsuite/libffi.call/nested_struct6.c: Likewise.
- * testsuite/libffi.call/nested_struct5.c: Likewise.
- * testsuite/libffi.call/nested_struct4.c: Likewise.
-
-2006-01-21 Andreas Tobler <a.tobler@schweiz.ch>
-
- * configure.ac: Enable libffi for sparc64-*-freebsd*.
- * configure: Rebuilt.
-
-2006-01-18 Jakub Jelinek <jakub@redhat.com>
-
- * src/powerpc/sysv.S (smst_two_register): Don't call __ashldi3,
- instead do the shifting inline.
- * src/powerpc/ppc_closure.S (ffi_closure_SYSV): Don't compute %r5
- shift count unconditionally. Simplify load sequences for 1, 2, 3, 4
- and 8 byte structs, for the remaining struct sizes don't call
- __lshrdi3, instead do the shifting inline.
-
-2005-12-07 Thiemo Seufer <ths@networkno.de>
-
- * src/mips/ffitarget.h: Remove obsolete sgidefs.h include. Add
- missing parentheses.
- * src/mips/o32.S (ffi_call_O32): Code formatting. Define
- and use A3_OFF, FP_OFF, RA_OFF. Micro-optimizations.
- (ffi_closure_O32): Likewise, but with newly defined A3_OFF2,
- A2_OFF2, A1_OFF2, A0_OFF2, RA_OFF2, FP_OFF2, S0_OFF2, GP_OFF2,
- V1_OFF2, V0_OFF2, FA_1_1_OFF2, FA_1_0_OFF2, FA_0_1_OFF2,
- FA_0_0_OFF2.
- * src/mips/ffi.c (ffi_prep_args): Code formatting. Fix
- endianness bugs.
- (ffi_prep_closure): Improve trampoline instruction scheduling.
- (ffi_closure_mips_inner_O32): Fix endianness bugs.
-
-2005-12-03 Alan Modra <amodra@bigpond.net.au>
-
- * src/powerpc/ffi.c: Formatting.
- (ffi_prep_args_SYSV): Avoid possible aliasing problems by using unions.
- (ffi_prep_args64): Likewise.
-
-2005-09-30 Geoffrey Keating <geoffk@apple.com>
-
- * testsuite/lib/libffi-dg.exp (libffi_target_compile): For
- darwin, use -shared-libgcc not -lgcc_s, and explain why.
-
-2005-09-26 Tom Tromey <tromey@redhat.com>
-
- * testsuite/libffi.call/float1.c (value_type): New typedef.
- (CANARY): New define.
- (main): Check for result buffer overflow.
- * src/powerpc/linux64.S: Handle linux64 long double returns.
- * src/powerpc/ffi.c (FLAG_RETURNS_128BITS): New constant.
- (ffi_prep_cif_machdep): Handle linux64 long double returns.
-
-2005-08-25 Alan Modra <amodra@bigpond.net.au>
-
- PR target/23404
- * src/powerpc/ffi.c (ffi_prep_args_SYSV): Correct placement of stack
- homed fp args.
- (ffi_status ffi_prep_cif_machdep): Correct stack sizing for same.
-
-2005-08-11 Jakub Jelinek <jakub@redhat.com>
-
- * configure.ac (HAVE_HIDDEN_VISIBILITY_ATTRIBUTE): New test.
- (AH_BOTTOM): Add FFI_HIDDEN definition.
- * configure: Rebuilt.
- * fficonfig.h.in: Rebuilt.
- * src/powerpc/ffi.c (hidden): Remove.
- (ffi_closure_LINUX64, ffi_prep_args64, ffi_call_LINUX64,
- ffi_closure_helper_LINUX64): Use FFI_HIDDEN instead of hidden.
- * src/powerpc/linux64_closure.S (ffi_closure_LINUX64,
- .ffi_closure_LINUX64): Use FFI_HIDDEN instead of .hidden.
- * src/x86/ffi.c (ffi_closure_SYSV, ffi_closure_raw_SYSV): Remove,
- add FFI_HIDDEN to its prototype.
- (ffi_closure_SYSV_inner): New.
- * src/x86/sysv.S (ffi_closure_SYSV, ffi_closure_raw_SYSV): New.
- * src/x86/win32.S (ffi_closure_SYSV, ffi_closure_raw_SYSV): New.
-
-2005-08-10 Alfred M. Szmidt <ams@gnu.org>
-
- PR libffi/21819:
- * configure: Rebuilt.
- * configure.ac: Handle i*86-*-gnu*.
-
-2005-08-09 Jakub Jelinek <jakub@redhat.com>
-
- * src/powerpc/ppc_closure.S (ffi_closure_SYSV): Use
- DW_CFA_offset_extended_sf rather than
- DW_CFA_GNU_negative_offset_extended.
- * src/powerpc/sysv.S (ffi_call_SYSV): Likewise.
-
-2005-07-22 SUGIOKA Toshinobu <sugioka@itonet.co.jp>
-
- * src/sh/sysv.S (ffi_call_SYSV): Stop argument popping correctly
- on sh3.
- (ffi_closure_SYSV): Change the stack layout for sh3 struct argument.
- * src/sh/ffi.c (ffi_prep_args): Fix sh3 argument copy, when it is
- partially on register.
- (ffi_closure_helper_SYSV): Likewise.
- (ffi_prep_cif_machdep): Don't set too many cif->flags.
-
-2005-07-20 Kaz Kojima <kkojima@gcc.gnu.org>
-
- * src/sh/ffi.c (ffi_call): Handle small structures correctly.
- Remove empty line.
- * src/sh64/ffi.c (simple_type): Remove.
- (return_type): Handle small structures correctly.
- (ffi_prep_args): Likewise.
- (ffi_call): Likewise.
- (ffi_closure_helper_SYSV): Likewise.
- * src/sh64/sysv.S (ffi_call_SYSV): Handle 1, 2 and 4-byte return.
- Emit position independent code if PIC and remove wrong datalabel
- prefixes from EH data.
-
-2005-07-19 Andreas Tobler <a.tobler@schweiz.ch>
-
- * Makefile.am (nodist_libffi_la_SOURCES): Add POWERPC_FREEBSD.
- * Makefile.in: Regenerate.
- * include/Makefile.in: Likewise.
- * testsuite/Makefile.in: Likewise.
- * configure.ac: Add POWERPC_FREEBSD rules.
- * configure: Regenerate.
- * src/powerpc/ffitarget.h: Add POWERPC_FREEBSD rules.
- (FFI_SYSV_TYPE_SMALL_STRUCT): Define.
- * src/powerpc/ffi.c: Add flags to handle small structure returns
- in ffi_call_SYSV.
- (ffi_prep_cif_machdep): Handle small structures for SYSV 4 ABI.
- Aka FFI_SYSV.
- (ffi_closure_helper_SYSV): Likewise.
- * src/powerpc/ppc_closure.S: Add return types for small structures.
- * src/powerpc/sysv.S: Add bits to handle small structures for
- final SYSV 4 ABI.
-
-2005-07-10 Andreas Tobler <a.tobler@schweiz.ch>
-
- * testsuite/libffi.call/cls_5_1_byte.c: New test file.
- * testsuite/libffi.call/cls_6_1_byte.c: Likewise.
- * testsuite/libffi.call/cls_7_1_byte.c: Likewise.
-
-2005-07-05 Randolph Chung <tausq@debian.org>
-
- * src/pa/ffi.c (ffi_struct_type): Rename FFI_TYPE_SMALL_STRUCT1
- as FFI_TYPE_SMALL_STRUCT3. Break out handling for 5-7 byte
- structures. Kill compilation warnings.
- (ffi_closure_inner_LINUX): Print return values as hex in debug
- message. Rename FFI_TYPE_SMALL_STRUCT1 as FFI_TYPE_SMALL_STRUCT3.
- Properly handle 5-7 byte structure returns.
- * src/pa/ffitarget.h (FFI_TYPE_SMALL_STRUCT1)
- (FFI_TYPE_SMALL_STRUCT2): Remove.
- (FFI_TYPE_SMALL_STRUCT3, FFI_TYPE_SMALL_STRUCT5)
- (FFI_TYPE_SMALL_STRUCT6, FFI_TYPE_SMALL_STRUCT7): Define.
- * src/pa/linux.S: Mark source file as using PA1.1 assembly.
- (checksmst1, checksmst2): Remove.
- (checksmst3): Optimize handling of 3-byte struct returns.
- (checksmst567): Properly handle 5-7 byte struct returns.
-
-2005-06-15 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
-
- PR libgcj/21943
- * src/mips/n32.S: Enforce PIC code.
- * src/mips/o32.S: Likewise.
-
-2005-06-15 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
-
- * configure.ac: Treat i*86-*-solaris2.10 and up as X86_64.
- * configure: Regenerate.
-
-2005-06-01 Alan Modra <amodra@bigpond.net.au>
-
- * src/powerpc/ppc_closure.S (ffi_closure_SYSV): Don't use JUMPTARGET
- to call ffi_closure_helper_SYSV. Append @local instead.
- * src/powerpc/sysv.S (ffi_call_SYSV): Likewise for ffi_prep_args_SYSV.
-
-2005-05-17 Kelley Cook <kcook@gcc.gnu.org>
-
- * configure.ac: Use AC_C_BIGENDIAN instead of AC_C_BIGENDIAN_CROSS.
- Use AC_CHECK_SIZEOF instead of AC_COMPILE_CHECK_SIZEOF.
- * Makefile.am (ACLOCAL_AMFLAGS): Remove -I ../config.
- * aclocal.m4, configure, fficonfig.h.in, Makefile.in,
- include/Makefile.in, testsuite/Makefile.in: Regenerate.
-
-2005-05-09 Mike Stump <mrs@apple.com>
-
- * configure: Regenerate.
-
-2005-05-08 Richard Henderson <rth@redhat.com>
-
- PR libffi/21285
- * src/alpha/osf.S: Update unwind into to match code.
-
-2005-05-04 Andreas Degert <ad@papyrus-gmbh.de>
- Richard Henderson <rth@redhat.com>
-
- * src/x86/ffi64.c (ffi_prep_cif_machdep): Save sse-used flag in
- bit 11 of flags.
- (ffi_call): Mask return type field. Pass ssecount to ffi_call_unix64.
- (ffi_prep_closure): Set carry bit if sse-used flag set.
- * src/x86/unix64.S (ffi_call_unix64): Add ssecount argument.
- Only load sse registers if ssecount non-zero.
- (ffi_closure_unix64): Only save sse registers if carry set on entry.
-
-2005-04-29 Ralf Corsepius <ralf.corsepius@rtems.org>
-
- * configure.ac: Add i*86-*-rtems*, sparc*-*-rtems*,
- powerpc-*rtems*, arm*-*-rtems*, sh-*-rtems*.
- * configure: Regenerate.
-
-2005-04-20 Hans-Peter Nilsson <hp@axis.com>
-
- * testsuite/lib/libffi-dg.exp (libffi-dg-test-1): In regsub use,
- have Tcl8.3-compatible intermediate variable.
-
-2005-04-18 Simon Posnjak <simon.posnjak@siol.net>
- Hans-Peter Nilsson <hp@axis.com>
-
- * Makefile.am: Add CRIS support.
- * configure.ac: Likewise.
- * Makefile.in, configure, testsuite/Makefile.in,
- include/Makefile.in: Regenerate.
- * src/cris: New directory.
- * src/cris/ffi.c, src/cris/sysv.S, src/cris/ffitarget.h: New files.
- * src/prep_cif.c (ffi_prep_cif): Wrap in #ifndef __CRIS__.
-
- * testsuite/lib/libffi-dg.exp (libffi-dg-test-1): Replace \n with
- \r?\n in output tests.
-
-2005-04-12 Mike Stump <mrs@apple.com>
-
- * configure: Regenerate.
-
-2005-03-30 Hans Boehm <Hans.Boehm@hp.com>
-
- * src/ia64/ffitarget.h (ffi_arg): Use long long instead of DI.
-
-2005-03-30 Steve Ellcey <sje@cup.hp.com>
-
- * src/ia64/ffitarget.h (ffi_arg) ADD DI attribute.
- (ffi_sarg) Ditto.
- * src/ia64/unix.S (ffi_closure_unix): Extend gp
- to 64 bits in ILP32 mode.
- Load 64 bits even for short data.
-
-2005-03-23 Mike Stump <mrs@apple.com>
-
- * src/powerpc/darwin.S: Update for -m64 multilib.
- * src/powerpc/darwin_closure.S: Likewise.
-
-2005-03-21 Zack Weinberg <zack@codesourcery.com>
-
- * configure.ac: Do not invoke TL_AC_GCC_VERSION.
- Do not set tool_include_dir.
- * aclocal.m4, configure, Makefile.in, testsuite/Makefile.in:
- Regenerate.
- * include/Makefile.am: Set gcc_version and toollibffidir.
- * include/Makefile.in: Regenerate.
-
-2005-02-22 Andrew Haley <aph@redhat.com>
-
- * src/powerpc/ffi.c (ffi_prep_cif_machdep): Bump alignment to
- odd-numbered register pairs for 64-bit integer types.
-
-2005-02-23 Andreas Tobler <a.tobler@schweiz.ch>
-
- PR libffi/20104
- * testsuite/libffi.call/return_ll1.c: New test case.
-
-2005-02-11 Janis Johnson <janis187@us.ibm.com>
-
- * testsuite/libffi.call/cls_align_longdouble.c: Remove dg-options.
- * testsuite/libffi.call/float.c: Ditto.
- * testsuite/libffi.call/float2.c: Ditto.
- * testsuite/libffi.call/float3.c: Ditto.
-
-2005-02-08 Andreas Tobler <a.tobler@schweiz.ch>
-
- * src/frv/ffitarget.h: Remove PPC stuff which does not belong to frv.
-
-2005-01-12 Eric Botcazou <ebotcazou@libertysurf.fr>
-
- * testsuite/libffi.special/special.exp (cxx_options): Add
- -shared-libgcc.
-
-2004-12-31 Richard Henderson <rth@redhat.com>
-
- * src/types.c (FFI_AGGREGATE_TYPEDEF): Remove.
- (FFI_TYPEDEF): Rename from FFI_INTEGRAL_TYPEDEF. Replace size and
- offset parameters with a type parameter; deduce size and structure
- alignment. Update all users.
-
-2004-12-31 Richard Henderson <rth@redhat.com>
-
- * src/types.c (FFI_TYPE_POINTER): Define with sizeof.
- (FFI_TYPE_LONGDOUBLE): Fix for ia64.
- * src/ia64/ffitarget.h (struct ffi_ia64_trampoline_struct): Move
- into ffi_prep_closure.
- * src/ia64/ia64_flags.h, src/ia64/ffi.c, src/ia64/unix.S: Rewrite
- from scratch.
-
-2004-12-27 Richard Henderson <rth@redhat.com>
-
- * src/x86/unix64.S: Fix typo in unwind info.
-
-2004-12-25 Richard Henderson <rth@redhat.com>
-
- * src/x86/ffi64.c (struct register_args): Rename from stackLayout.
- (enum x86_64_reg_class): Add X86_64_COMPLEX_X87_CLASS.
- (merge_classes): Check for it.
- (SSE_CLASS_P): New.
- (classify_argument): Pass byte_offset by value; perform all updates
- inside struct case.
- (examine_argument): Add classes argument; handle
- X86_64_COMPLEX_X87_CLASS.
- (ffi_prep_args): Merge into ...
- (ffi_call): ... here. Share stack frame with ffi_call_unix64.
- (ffi_prep_cif_machdep): Setup cif->flags for proper structure return.
- (ffi_fill_return_value): Remove.
- (ffi_prep_closure): Remove dead assert.
- (ffi_closure_unix64_inner): Rename from ffi_closure_UNIX64_inner.
- Rewrite to use struct register_args instead of va_list. Create
- flags for handling structure returns.
- * src/x86/unix64.S: Remove dead strings.
- (ffi_call_unix64): Rename from ffi_call_UNIX64. Rewrite to share
- stack frame with ffi_call. Handle structure returns properly.
- (float2sse, floatfloat2sse, double2sse): Remove.
- (sse2float, sse2double, sse2floatfloat): Remove.
- (ffi_closure_unix64): Rename from ffi_closure_UNIX64. Rewrite
- to handle structure returns properly.
-
-2004-12-08 David Edelsohn <edelsohn@gnu.org>
-
- * Makefile.am (AM_MAKEFLAGS): Remove duplicate LIBCFLAGS and
- PICFLAG.
- * Makefile.in: Regenerated.
-
-2004-12-02 Richard Sandiford <rsandifo@redhat.com>
-
- * configure.ac: Use TL_AC_GCC_VERSION to set gcc_version.
- * configure, aclocal.m4, Makefile.in: Regenerate.
- * include/Makefile.in, testsuite/Makefile.in: Regenerate.
-
-2004-11-29 Kelley Cook <kcook@gcc.gnu.org>
-
- * configure: Regenerate for libtool change.
-
-2004-11-25 Kelley Cook <kcook@gcc.gnu.org>
-
- * configure: Regenerate for libtool reversion.
-
-2004-11-24 Kelley Cook <kcook@gcc.gnu.org>
-
- * configure: Regenerate for libtool change.
-
-2004-11-23 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
-
- * testsuite/lib/libffi-dg.exp: Use new procs in target-libpath.exp.
-
-2004-11-23 Richard Sandiford <rsandifo@redhat.com>
-
- * src/mips/o32.S (ffi_call_O32, ffi_closure_O32): Use jalr instead
- of jal. Use an absolute encoding for the frame information.
-
-2004-11-23 Kelley Cook <kcook@gcc.gnu.org>
-
- * Makefile.am: Remove no-dependencies. Add ACLOCAL_AMFLAGS.
- * acinclude.m4: Delete logic for sincludes.
- * aclocal.m4, Makefile.in, configure: Regenerate.
- * include/Makefile: Likewise.
- * testsuite/Makefile: Likewise.
-
-2004-11-22 Eric Botcazou <ebotcazou@libertysurf.fr>
-
- * src/sparc/ffi.c (ffi_prep_closure): Align doubles and 64-bit integers
- on a 8-byte boundary.
- * src/sparc/v8.S (ffi_closure_v8): Reserve frame space for arguments.
-
-2004-10-27 Richard Earnshaw <rearnsha@arm.com>
-
- * src/arm/ffi.c (ffi_prep_cif_machdep): Handle functions that return
- long long values. Round stack allocation to a multiple of 8 bytes
- for ATPCS compatibility.
- * src/arm/sysv.S (ffi_call_SYSV): Rework to avoid use of APCS register
- names. Handle returning long long types. Add Thumb and interworking
- support. Improve soft-float code.
-
-2004-10-27 Richard Earnshaw <rearnsha@arm.com>
-
- * testsuite/lib/libffi-db.exp (load_gcc_lib): New function.
- (libffi_exit): New function.
- (libffi_init): Build the testglue wrapper if needed.
-
-2004-10-25 Eric Botcazou <ebotcazou@libertysurf.fr>
-
- PR other/18138
- * testsuite/lib/libffi-dg.exp: Accept more than one multilib libgcc.
-
-2004-10-25 Kazuhiro Inaoka <inaoka.kazuhiro@renesas.com>
-
- * src/m32r/libffitarget.h (FFI_CLOSURES): Set to 0.
-
-2004-10-20 Kaz Kojima <kkojima@gcc.gnu.org>
-
- * src/sh/sysv.S (ffi_call_SYSV): Don't align for double data.
- * testsuite/libffi.call/float3.c: New test case.
-
-2004-10-18 Kaz Kojima <kkojima@gcc.gnu.org>
-
- * src/sh/ffi.c (ffi_prep_closure): Set T bit in trampoline for
- the function returning a structure pointed with R2.
- * src/sh/sysv.S (ffi_closure_SYSV): Use R2 as the pointer to
- the structure return value if T bit set. Emit position
- independent code and EH data if PIC.
-
-2004-10-13 Kazuhiro Inaoka <inaoka.kazuhiro@renesas.com>
-
- * Makefile.am: Add m32r support.
- * configure.ac: Likewise.
- * Makefile.in: Regenerate.
- * confiugre: Regenerate.
- * src/types.c: Add m32r port to FFI_INTERNAL_TYPEDEF
- (uint64, sint64, double, longdouble)
- * src/m32r: New directory.
- * src/m32r/ffi.c: New file.
- * src/m32r/sysv.S: Likewise.
- * src/m32r/ffitarget.h: Likewise.
-
-2004-10-02 Kaz Kojima <kkojima@gcc.gnu.org>
-
- * testsuite/libffi.call/negint.c: New test case.
-
-2004-09-14 H.J. Lu <hongjiu.lu@intel.com>
-
- PR libgcj/17465
- * testsuite/lib/libffi-dg.exp: Don't use global ld_library_path.
- Set up LD_LIBRARY_PATH, SHLIB_PATH, LD_LIBRARYN32_PATH,
- LD_LIBRARY64_PATH, LD_LIBRARY_PATH_32, LD_LIBRARY_PATH_64 and
- DYLD_LIBRARY_PATH.
-
-2004-09-05 Andreas Tobler <a.tobler@schweiz.ch>
-
- * testsuite/libffi.call/many_win32.c: Remove whitespaces.
- * testsuite/libffi.call/promotion.c: Likewise.
- * testsuite/libffi.call/return_ll.c: Remove unused var. Cleanup
- whitespaces.
- * testsuite/libffi.call/return_sc.c: Likewise.
- * testsuite/libffi.call/return_uc.c: Likewise.
-
-2004-09-05 Andreas Tobler <a.tobler@schweiz.ch>
-
- * src/powerpc/darwin.S: Fix comments and identation.
- * src/powerpc/darwin_closure.S: Likewise.
-
-2004-09-02 Andreas Tobler <a.tobler@schweiz.ch>
-
- * src/powerpc/ffi_darwin.c: Add flag for longdouble return values.
- (ffi_prep_args): Handle longdouble arguments.
- (ffi_prep_cif_machdep): Set flags for longdouble. Calculate space for
- longdouble.
- (ffi_closure_helper_DARWIN): Add closure handling for longdouble.
- * src/powerpc/darwin.S (_ffi_call_DARWIN): Add handling of longdouble
- values.
- * src/powerpc/darwin_closure.S (_ffi_closure_ASM): Likewise.
- * src/types.c: Defined longdouble size and alignment for darwin.
-
-2004-09-02 Andreas Tobler <a.tobler@schweiz.ch>
-
- * src/powerpc/aix.S: Remove whitespaces.
- * src/powerpc/aix_closure.S: Likewise.
- * src/powerpc/asm.h: Likewise.
- * src/powerpc/ffi.c: Likewise.
- * src/powerpc/ffitarget.h: Likewise.
- * src/powerpc/linux64.S: Likewise.
- * src/powerpc/linux64_closure.S: Likewise.
- * src/powerpc/ppc_closure.S: Likewise.
- * src/powerpc/sysv.S: Likewise.
-
-2004-08-30 Anthony Green <green@redhat.com>
-
- * Makefile.am: Add frv support.
- * Makefile.in, testsuite/Makefile.in: Rebuilt.
- * configure.ac: Read configure.host.
- * configure.in: Read configure.host.
- * configure.host: New file. frv-elf needs libgloss.
- * include/ffi.h.in: Force ffi_closure to have a nice big (8)
- alignment. This is needed to frv and shouldn't harm the others.
- * include/ffi_common.h (ALIGN_DOWN): New macro.
- * src/frv/ffi.c, src/frv/ffitarget.h, src/frv/eabi.S: New files.
-
-2004-08-24 David Daney <daney@avtrex.com>
-
- * testsuite/libffi.call/closure_fn0.c: Xfail mips64* instead of mips*.
- * testsuite/libffi.call/closure_fn1.c: Likewise.
- * testsuite/libffi.call/closure_fn2.c Likewise.
- * testsuite/libffi.call/closure_fn3.c: Likewise.
- * testsuite/libffi.call/closure_fn4.c: Likewise.
- * testsuite/libffi.call/closure_fn5.c: Likewise.
- * testsuite/libffi.call/cls_18byte.c: Likewise.
- * testsuite/libffi.call/cls_19byte.c: Likewise.
- * testsuite/libffi.call/cls_1_1byte.c: Likewise.
- * testsuite/libffi.call/cls_20byte.c: Likewise.
- * testsuite/libffi.call/cls_20byte1.c: Likewise.
- * testsuite/libffi.call/cls_24byte.c: Likewise.
- * testsuite/libffi.call/cls_2byte.c: Likewise.
- * testsuite/libffi.call/cls_3_1byte.c: Likewise.
- * testsuite/libffi.call/cls_3byte1.c: Likewise.
- * testsuite/libffi.call/cls_3byte2.c: Likewise.
- * testsuite/libffi.call/cls_4_1byte.c: Likewise.
- * testsuite/libffi.call/cls_4byte.c: Likewise.
- * testsuite/libffi.call/cls_64byte.c: Likewise.
- * testsuite/libffi.call/cls_6byte.c: Likewise.
- * testsuite/libffi.call/cls_7byte.c: Likewise.
- * testsuite/libffi.call/cls_8byte.c: Likewise.
- * testsuite/libffi.call/cls_9byte1.c: Likewise.
- * testsuite/libffi.call/cls_9byte2.c: Likewise.
- * testsuite/libffi.call/cls_align_double.c: Likewise.
- * testsuite/libffi.call/cls_align_float.c: Likewise.
- * testsuite/libffi.call/cls_align_longdouble.c: Likewise.
- * testsuite/libffi.call/cls_align_pointer.c: Likewise.
- * testsuite/libffi.call/cls_align_sint16.c: Likewise.
- * testsuite/libffi.call/cls_align_sint32.c: Likewise.
- * testsuite/libffi.call/cls_align_sint64.c: Likewise.
- * testsuite/libffi.call/cls_align_uint16.c: Likewise.
- * testsuite/libffi.call/cls_align_uint32.c: Likewise.
- * testsuite/libffi.call/cls_align_uint64.c: Likewise.
- * testsuite/libffi.call/cls_double.c: Likewise.
- * testsuite/libffi.call/cls_float.c: Likewise.
- * testsuite/libffi.call/cls_multi_schar.c: Likewise.
- * testsuite/libffi.call/cls_multi_sshort.c: Likewise.
- * testsuite/libffi.call/cls_multi_sshortchar.c: Likewise.
- * testsuite/libffi.call/cls_multi_uchar.c: Likewise.
- * testsuite/libffi.call/cls_multi_ushort.c: Likewise.
- * testsuite/libffi.call/cls_multi_ushortchar.c: Likewise.
- * testsuite/libffi.call/cls_schar.c: Likewise.
- * testsuite/libffi.call/cls_sint.c: Likewise.
- * testsuite/libffi.call/cls_sshort.c: Likewise.
- * testsuite/libffi.call/cls_uchar.c: Likewise.
- * testsuite/libffi.call/cls_uint.c: Likewise.
- * testsuite/libffi.call/cls_ulonglong.c: Likewise.
- * testsuite/libffi.call/cls_ushort.c: Likewise.
- * testsuite/libffi.call/nested_struct.c: Likewise.
- * testsuite/libffi.call/nested_struct1.c: Likewise.
- * testsuite/libffi.call/nested_struct2.c: Likewise.
- * testsuite/libffi.call/nested_struct3.c: Likewise.
- * testsuite/libffi.call/problem1.c: Likewise.
- * testsuite/libffi.special/unwindtest.cc: Likewise.
- * testsuite/libffi.call/cls_12byte.c: Likewise and set return value
- to zero.
- * testsuite/libffi.call/cls_16byte.c: Likewise.
- * testsuite/libffi.call/cls_5byte.c: Likewise.
-
-2004-08-23 David Daney <daney@avtrex.com>
-
- PR libgcj/13141
- * src/mips/ffitarget.h (FFI_O32_SOFT_FLOAT): New ABI.
- * src/mips/ffi.c (ffi_prep_args): Fix alignment calculation.
- (ffi_prep_cif_machdep): Handle FFI_O32_SOFT_FLOAT floating point
- parameters and return types.
- (ffi_call): Handle FFI_O32_SOFT_FLOAT ABI.
- (ffi_prep_closure): Ditto.
- (ffi_closure_mips_inner_O32): Handle FFI_O32_SOFT_FLOAT ABI, fix
- alignment calculations.
- * src/mips/o32.S (ffi_closure_O32): Don't use floating point
- instructions if FFI_O32_SOFT_FLOAT, make stack frame ABI compliant.
-
-2004-08-14 Casey Marshall <csm@gnu.org>
-
- * src/mips/ffi.c (ffi_pref_cif_machdep): set `cif->flags' to
- contain `FFI_TYPE_UINT64' as return type for any 64-bit
- integer (O32 ABI only).
- (ffi_prep_closure): new function.
- (ffi_closure_mips_inner_O32): new function.
- * src/mips/ffitarget.h: Define `FFI_CLOSURES' and
- `FFI_TRAMPOLINE_SIZE' appropriately if the ABI is o32.
- * src/mips/o32.S (ffi_call_O32): add labels for .eh_frame. Return
- 64 bit integers correctly.
- (ffi_closure_O32): new function.
- Added DWARF-2 unwind info for both functions.
-
-2004-08-10 Andrew Haley <aph@redhat.com>
-
- * src/x86/ffi64.c (ffi_prep_args ): 8-align all stack arguments.
-
-2004-08-01 Robert Millan <robertmh@gnu.org>
-
- * configure.ac: Detect knetbsd-gnu and kfreebsd-gnu.
- * configure: Regenerate.
-
-2004-07-30 Maciej W. Rozycki <macro@linux-mips.org>
-
- * acinclude.m4 (AC_FUNC_MMAP_BLACKLIST): Check for <sys/mman.h>
- and mmap() explicitly instead of relying on preset autoconf cache
- variables.
- * aclocal.m4: Regenerate.
- * configure: Regenerate.
-
-2004-07-11 Ulrich Weigand <uweigand@de.ibm.com>
-
- * src/s390/ffi.c (ffi_prep_args): Fix C aliasing violation.
- (ffi_check_float_struct): Remove unused prototype.
-
-2004-06-30 Geoffrey Keating <geoffk@apple.com>
-
- * src/powerpc/ffi_darwin.c (flush_icache): ';' is a comment
- character on Darwin, use '\n\t' instead.
-
-2004-06-26 Matthias Klose <doko@debian.org>
-
- * libtool-version: Fix typo in revision/age.
-
-2004-06-17 Matthias Klose <doko@debian.org>
-
- * libtool-version: New.
- * Makefile.am (libffi_la_LDFLAGS): Use -version-info for soname.
- * Makefile.in: Regenerate.
-
-2004-06-15 Paolo Bonzini <bonzini@gnu.org>
-
- * Makefile.am: Remove useless multilib rules.
- * Makefile.in: Regenerate.
- * aclocal.m4: Regenerate with automake 1.8.5.
- * configure.ac: Remove useless multilib configury.
- * configure: Regenerate.
-
-2004-06-15 Paolo Bonzini <bonzini@gnu.org>
-
- * .cvsignore: New file.
-
-2004-06-10 Jakub Jelinek <jakub@redhat.com>
-
- * src/ia64/unix.S (ffi_call_unix): Insert group barrier break
- fp_done.
- (ffi_closure_UNIX): Fix f14/f15 adjustment if FLOAT_SZ is ever
- changed from 8.
-
-2004-06-06 Sean McNeil <sean@mcneil.com>
-
- * configure.ac: Add x86_64-*-freebsd* support.
- * configure: Regenerate.
-
-2004-04-26 Joe Buck <jbuck@welsh-buck.org>
-
- Bug 15093
- * configure.ac: Test for existence of mmap and sys/mman.h before
- checking blacklist. Fix suggested by Jim Wilson.
- * configure: Regenerate.
-
-2004-04-26 Matt Austern <austern@apple.com>
-
- * src/powerpc/darwin.S: Go through a non-lazy pointer for initial
- FDE location.
- * src/powerpc/darwin_closure.S: Likewise.
-
-2004-04-24 Andreas Tobler <a.tobler@schweiz.ch>
-
- * testsuite/libffi.call/cls_multi_schar.c (main): Fix initialization
- error. Reported by Thomas Heller <theller@python.net>.
- * testsuite/libffi.call/cls_multi_sshort.c (main): Likewise.
- * testsuite/libffi.call/cls_multi_ushort.c (main): Likewise.
-
-2004-03-20 Matthias Klose <doko@debian.org>
-
- * src/pa/linux.S: Fix typo.
-
-2004-03-19 Matthias Klose <doko@debian.org>
-
- * Makefile.am: Update.
- * Makefile.in: Regenerate.
- * src/pa/ffi.h.in: Remove.
- * src/pa/ffitarget.h: New file.
-
-2004-02-10 Randolph Chung <tausq@debian.org>
-
- * Makefile.am: Add PA support.
- * Makefile.in: Regenerate.
- * include/Makefile.in: Regenerate.
- * configure.ac: Add PA target.
- * configure: Regenerate.
- * src/pa/ffi.c: New file.
- * src/pa/ffi.h.in: Add PA support.
- * src/pa/linux.S: New file.
- * prep_cif.c: Add PA support.
-
-2004-03-16 Hosaka Yuji <hos@tamanegi.org>
-
- * src/types.c: Fix alignment size of X86_WIN32 case int64 and
- double.
- * src/x86/ffi.c (ffi_prep_args): Replace ecif->cif->rtype->type
- with ecif->cif->flags.
- (ffi_call, ffi_prep_incoming_args_SYSV): Replace cif->rtype->type
- with cif->flags.
- (ffi_prep_cif_machdep): Add X86_WIN32 struct case.
- (ffi_closure_SYSV): Add 1 or 2-bytes struct case for X86_WIN32.
- * src/x86/win32.S (retstruct1b, retstruct2b, sc_retstruct1b,
- sc_retstruct2b): Add for 1 or 2-bytes struct case.
-
-2004-03-15 Kelley Cook <kcook@gcc.gnu.org>
-
- * configure.in: Rename file to ...
- * configure.ac: ... this.
- * fficonfig.h.in: Regenerate.
- * Makefile.in: Regenerate.
- * include/Makefile.in: Regenerate.
- * testsuite/Makefile.in: Regenerate.
-
-2004-03-12 Matt Austern <austern@apple.com>
-
- * src/powerpc/darwin.S: Fix EH information so it corresponds to
- changes in EH format resulting from addition of linkonce support.
- * src/powerpc/darwin_closure.S: Likewise.
-
-2004-03-11 Andreas Tobler <a.tobler@schweiz.ch>
- Paolo Bonzini <bonzini@gnu.org>
-
- * Makefile.am (AUTOMAKE_OPTIONS): Set them.
- Remove VPATH. Remove rules for object files. Remove multilib support.
- (AM_CCASFLAGS): Add.
- * configure.in (AC_CONFIG_HEADERS): Relace AM_CONFIG_HEADER.
- (AC_PREREQ): Bump version to 2.59.
- (AC_INIT): Fill with version info and bug address.
- (ORIGINAL_LD_FOR_MULTILIBS): Remove.
- (AM_ENABLE_MULTILIB): Use this instead of AC_ARG_ENABLE.
- De-precious CC so that the right flags are passed down to multilibs.
- (AC_MSG_ERROR): Replace obsolete macro AC_ERROR.
- (AC_CONFIG_FILES): Replace obsolete macro AC_LINK_FILES.
- (AC_OUTPUT): Reorganize the output with AC_CONFIG_COMMANDS.
- * configure: Rebuilt.
- * aclocal.m4: Likewise.
- * Makefile.in, include/Makefile.in, testsuite/Makefile.in: Likewise.
- * fficonfig.h.in: Likewise.
-
-2004-03-11 Andreas Schwab <schwab@suse.de>
-
- * src/ia64/ffi.c (ffi_prep_incoming_args_UNIX): Get floating point
- arguments from fp registers only for the first 8 parameter slots.
- Don't convert a float parameter when passed in memory.
-
-2004-03-09 Hans-Peter Nilsson <hp@axis.com>
-
- * configure: Regenerate for config/accross.m4 correction.
-
-2004-02-25 Matt Kraai <kraai@alumni.cmu.edu>
-
- * src/powerpc/ffi.c (ffi_prep_args_SYSV): Change
- ecif->cif->bytes to bytes.
- (ffi_prep_cif_machdep): Add braces around nested if statement.
-
-2004-02-09 Alan Modra <amodra@bigpond.net.au>
-
- * src/types.c (pointer): POWERPC64 has 8 byte pointers.
-
- * src/powerpc/ffi.c (ffi_prep_args64): Correct long double handling.
- (ffi_closure_helper_LINUX64): Fix typo.
- * testsuite/libffi.call/cls_align_longdouble.c: Pass -mlong-double-128
- for powerpc64-*-*.
- * testsuite/libffi.call/float.c: Likewise.
- * testsuite/libffi.call/float2.c: Likewise.
-
-2004-02-08 Alan Modra <amodra@bigpond.net.au>
-
- * src/powerpc/ffi.c (ffi_prep_cif_machdep <FFI_LINUX64>): Correct
- long double function return and long double arg handling.
- (ffi_closure_helper_LINUX64): Formatting. Delete unused "ng" var.
- Use "end_pfr" instead of "nf". Correct long double handling.
- Localise "temp".
- * src/powerpc/linux64.S (ffi_call_LINUX64): Save f2 long double
- return value.
- * src/powerpc/linux64_closure.S (ffi_closure_LINUX64): Allocate
- space for long double return value. Adjust stack frame and offsets.
- Load f2 long double return.
-
-2004-02-07 Alan Modra <amodra@bigpond.net.au>
-
- * src/types.c: Use 16 byte long double for POWERPC64.
-
-2004-01-25 Eric Botcazou <ebotcazou@libertysurf.fr>
-
- * src/sparc/ffi.c (ffi_prep_args_v9): Shift the parameter array
- when the structure return address is passed in %o0.
- (ffi_V9_return_struct): Rename into ffi_v9_layout_struct.
- (ffi_v9_layout_struct): Align the field following a nested structure
- on a word boundary. Use memmove instead of memcpy.
- (ffi_call): Update call to ffi_V9_return_struct.
- (ffi_prep_closure): Define 'ctx' only for V8.
- (ffi_closure_sparc_inner): Clone into ffi_closure_sparc_inner_v8
- and ffi_closure_sparc_inner_v9.
- (ffi_closure_sparc_inner_v8): Return long doubles by reference.
- Always skip the structure return address. For structures and long
- doubles, copy the argument directly.
- (ffi_closure_sparc_inner_v9): Skip the structure return address only
- if required. Shift the maximum floating-point slot accordingly. For
- big structures, copy the argument directly; otherwise, left-justify the
- argument and call ffi_v9_layout_struct to lay out the structure on
- the stack.
- * src/sparc/v8.S: Undef STACKFRAME before defining it.
- (ffi_closure_v8): Pass the structure return address. Update call to
- ffi_closure_sparc_inner_v8. Short-circuit FFI_TYPE_INT handling.
- Skip the 'unimp' insn when returning long doubles and structures.
- * src/sparc/v9.S: Undef STACKFRAME before defining it.
- (ffi_closure_v9): Increase the frame size by 2 words. Short-circuit
- FFI_TYPE_INT handling. Load structures both in integers and
- floating-point registers on return.
- * README: Update status of the SPARC port.
-
-2004-01-24 Andreas Tobler <a.tobler@schweiz.ch>
-
- * testsuite/libffi.call/pyobjc-tc.c (main): Treat result value
- as of type ffi_arg.
- * testsuite/libffi.call/struct3.c (main): Fix CHECK.
-
-2004-01-22 Ulrich Weigand <uweigand@de.ibm.com>
-
- * testsuite/libffi.call/cls_uint.c (cls_ret_uint_fn): Treat result
- value as of type ffi_arg, not unsigned int.
-
-2004-01-21 Michael Ritzert <ritzert@t-online.de>
-
- * ffi64.c (ffi_prep_args): Cast the RHS of an assignment instead
- of the LHS.
-
-2004-01-12 Andreas Tobler <a.tobler@schweiz.ch>
-
- * testsuite/lib/libffi-dg.exp: Set LD_LIBRARY_PATH_32 for
- Solaris.
-
-2004-01-08 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
-
- * testsuite/libffi.call/ffitest.h (allocate_mmap): Cast MAP_FAILED
- to void *.
-
-2003-12-10 Richard Henderson <rth@redhat.com>
-
- * testsuite/libffi.call/cls_align_pointer.c: Cast pointers to
- size_t instead of int.
-
-2003-12-04 Hosaka Yuji <hos@tamanegi.org>
-
- * testsuite/libffi.call/many_win32.c: Include <float.h>.
- * testsuite/libffi.call/many_win32.c (main): Replace variable
- int i with unsigned long ul.
-
- * testsuite/libffi.call/cls_align_uint64.c: New test case.
- * testsuite/libffi.call/cls_align_sint64.c: Likewise.
- * testsuite/libffi.call/cls_align_uint32.c: Likewise.
- * testsuite/libffi.call/cls_align_sint32.c: Likewise.
- * testsuite/libffi.call/cls_align_uint16.c: Likewise.
- * testsuite/libffi.call/cls_align_sint16.c: Likewise.
- * testsuite/libffi.call/cls_align_float.c: Likewise.
- * testsuite/libffi.call/cls_align_double.c: Likewise.
- * testsuite/libffi.call/cls_align_longdouble.c: Likewise.
- * testsuite/libffi.call/cls_align_pointer.c: Likewise.
-
-2003-12-02 Hosaka Yuji <hos@tamanegi.org>
-
- PR other/13221
- * src/x86/ffi.c (ffi_prep_args, ffi_prep_incoming_args_SYSV):
- Align arguments to 32 bits.
-
-2003-12-01 Andreas Tobler <a.tobler@schweiz.ch>
-
- PR other/13221
- * testsuite/libffi.call/cls_multi_sshort.c: New test case.
- * testsuite/libffi.call/cls_multi_sshortchar.c: Likewise.
- * testsuite/libffi.call/cls_multi_uchar.c: Likewise.
- * testsuite/libffi.call/cls_multi_schar.c: Likewise.
- * testsuite/libffi.call/cls_multi_ushortchar.c: Likewise.
- * testsuite/libffi.call/cls_multi_ushort.c: Likewise.
-
- * testsuite/libffi.special/unwindtest.cc: Cosmetics.
-
-2003-11-26 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-
- * testsuite/libffi.call/ffitest.h: Include <fcntl.h>.
- * testsuite/libffi.special/ffitestcxx.h: Likewise.
-
-2003-11-22 Andreas Tobler <a.tobler@schweiz.ch>
-
- * Makefile.in: Rebuilt.
- * configure: Likewise.
- * testsuite/libffi.special/unwindtest.cc: Convert the mmap to
- the right type.
-
-2003-11-21 Andreas Jaeger <aj@suse.de>
- Andreas Tobler <a.tobler@schweiz.ch>
-
- * acinclude.m4: Add AC_FUNC_MMAP_BLACKLIST.
- * configure.in: Call AC_FUNC_MMAP_BLACKLIST.
- * Makefile.in: Rebuilt.
- * aclocal.m4: Likewise.
- * configure: Likewise.
- * fficonfig.h.in: Likewise.
- * testsuite/lib/libffi-dg.exp: Add include dir.
- * testsuite/libffi.call/ffitest.h: Add MMAP definitions.
- * testsuite/libffi.special/ffitestcxx.h: Likewise.
- * testsuite/libffi.call/closure_fn0.c: Use MMAP functionality
- for ffi_closure if available.
- * testsuite/libffi.call/closure_fn1.c: Likewise.
- * testsuite/libffi.call/closure_fn2.c: Likewise.
- * testsuite/libffi.call/closure_fn3.c: Likewise.
- * testsuite/libffi.call/closure_fn4.c: Likewise.
- * testsuite/libffi.call/closure_fn5.c: Likewise.
- * testsuite/libffi.call/cls_12byte.c: Likewise.
- * testsuite/libffi.call/cls_16byte.c: Likewise.
- * testsuite/libffi.call/cls_18byte.c: Likewise.
- * testsuite/libffi.call/cls_19byte.c: Likewise.
- * testsuite/libffi.call/cls_1_1byte.c: Likewise.
- * testsuite/libffi.call/cls_20byte.c: Likewise.
- * testsuite/libffi.call/cls_20byte1.c: Likewise.
- * testsuite/libffi.call/cls_24byte.c: Likewise.
- * testsuite/libffi.call/cls_2byte.c: Likewise.
- * testsuite/libffi.call/cls_3_1byte.c: Likewise.
- * testsuite/libffi.call/cls_3byte1.c: Likewise.
- * testsuite/libffi.call/cls_3byte2.c: Likewise.
- * testsuite/libffi.call/cls_4_1byte.c: Likewise.
- * testsuite/libffi.call/cls_4byte.c: Likewise.
- * testsuite/libffi.call/cls_5byte.c: Likewise.
- * testsuite/libffi.call/cls_64byte.c: Likewise.
- * testsuite/libffi.call/cls_6byte.c: Likewise.
- * testsuite/libffi.call/cls_7byte.c: Likewise.
- * testsuite/libffi.call/cls_8byte.c: Likewise.
- * testsuite/libffi.call/cls_9byte1.c: Likewise.
- * testsuite/libffi.call/cls_9byte2.c: Likewise.
- * testsuite/libffi.call/cls_double.c: Likewise.
- * testsuite/libffi.call/cls_float.c: Likewise.
- * testsuite/libffi.call/cls_schar.c: Likewise.
- * testsuite/libffi.call/cls_sint.c: Likewise.
- * testsuite/libffi.call/cls_sshort.c: Likewise.
- * testsuite/libffi.call/cls_uchar.c: Likewise.
- * testsuite/libffi.call/cls_uint.c: Likewise.
- * testsuite/libffi.call/cls_ulonglong.c: Likewise.
- * testsuite/libffi.call/cls_ushort.c: Likewise.
- * testsuite/libffi.call/nested_struct.c: Likewise.
- * testsuite/libffi.call/nested_struct1.c: Likewise.
- * testsuite/libffi.call/nested_struct2.c: Likewise.
- * testsuite/libffi.call/nested_struct3.c: Likewise.
- * testsuite/libffi.call/problem1.c: Likewise.
- * testsuite/libffi.special/unwindtest.cc: Likewise.
-
-2003-11-20 Andreas Tobler <a.tobler@schweiz.ch>
-
- * testsuite/lib/libffi-dg.exp: Make the -lgcc_s conditional.
-
-2003-11-19 Andreas Tobler <a.tobler@schweiz.ch>
-
- * testsuite/lib/libffi-dg.exp: Add DYLD_LIBRARY_PATH for darwin.
- Add -lgcc_s to additional flags.
-
-2003-11-12 Andreas Tobler <a.tobler@schweiz.ch>
-
- * configure.in, include/Makefile.am: PR libgcj/11147, install
- the ffitarget.h header file in a gcc versioned and target
- dependent place.
- * configure: Regenerated.
- * Makefile.in, include/Makefile.in: Likewise.
- * testsuite/Makefile.in: Likewise.
-
-2003-11-09 Andreas Tobler <a.tobler@schweiz.ch>
-
- * testsuite/libffi.call/closure_fn0.c: Print result and check
- with dg-output to make debugging easier.
- * testsuite/libffi.call/closure_fn1.c: Likewise.
- * testsuite/libffi.call/closure_fn2.c: Likewise.
- * testsuite/libffi.call/closure_fn3.c: Likewise.
- * testsuite/libffi.call/closure_fn4.c: Likewise.
- * testsuite/libffi.call/closure_fn5.c: Likewise.
- * testsuite/libffi.call/cls_12byte.c: Likewise.
- * testsuite/libffi.call/cls_16byte.c: Likewise.
- * testsuite/libffi.call/cls_18byte.c: Likewise.
- * testsuite/libffi.call/cls_19byte.c: Likewise.
- * testsuite/libffi.call/cls_1_1byte.c: Likewise.
- * testsuite/libffi.call/cls_20byte.c: Likewise.
- * testsuite/libffi.call/cls_20byte1.c: Likewise.
- * testsuite/libffi.call/cls_24byte.c: Likewise.
- * testsuite/libffi.call/cls_2byte.c: Likewise.
- * testsuite/libffi.call/cls_3_1byte.c: Likewise.
- * testsuite/libffi.call/cls_3byte1.c: Likewise.
- * testsuite/libffi.call/cls_3byte2.c: Likewise.
- * testsuite/libffi.call/cls_4_1byte.c: Likewise.
- * testsuite/libffi.call/cls_4byte.c: Likewise.
- * testsuite/libffi.call/cls_5byte.c: Likewise.
- * testsuite/libffi.call/cls_64byte.c: Likewise.
- * testsuite/libffi.call/cls_6byte.c: Likewise.
- * testsuite/libffi.call/cls_7byte.c: Likewise.
- * testsuite/libffi.call/cls_8byte.c: Likewise.
- * testsuite/libffi.call/cls_9byte1.c: Likewise.
- * testsuite/libffi.call/cls_9byte2.c: Likewise.
- * testsuite/libffi.call/cls_double.c: Likewise.
- * testsuite/libffi.call/cls_float.c: Likewise.
- * testsuite/libffi.call/cls_schar.c: Likewise.
- * testsuite/libffi.call/cls_sint.c: Likewise.
- * testsuite/libffi.call/cls_sshort.c: Likewise.
- * testsuite/libffi.call/cls_uchar.c: Likewise.
- * testsuite/libffi.call/cls_uint.c: Likewise.
- * testsuite/libffi.call/cls_ulonglong.c: Likewise.
- * testsuite/libffi.call/cls_ushort.c: Likewise.
- * testsuite/libffi.call/problem1.c: Likewise.
-
- * testsuite/libffi.special/unwindtest.cc: Make ffi_closure
- static.
-
-2003-11-08 Andreas Tobler <a.tobler@schweiz.ch>
-
- * testsuite/libffi.call/cls_9byte2.c: New test case.
- * testsuite/libffi.call/cls_9byte1.c: Likewise.
- * testsuite/libffi.call/cls_64byte.c: Likewise.
- * testsuite/libffi.call/cls_20byte1.c: Likewise.
- * testsuite/libffi.call/cls_19byte.c: Likewise.
- * testsuite/libffi.call/cls_18byte.c: Likewise.
- * testsuite/libffi.call/closure_fn4.c: Likewise.
- * testsuite/libffi.call/closure_fn5.c: Likewise.
- * testsuite/libffi.call/cls_schar.c: Likewise.
- * testsuite/libffi.call/cls_sint.c: Likewise.
- * testsuite/libffi.call/cls_sshort.c: Likewise.
- * testsuite/libffi.call/nested_struct2.c: Likewise.
- * testsuite/libffi.call/nested_struct3.c: Likewise.
-
-2003-11-08 Andreas Tobler <a.tobler@schweiz.ch>
-
- * testsuite/libffi.call/cls_double.c: Do a check on the result.
- * testsuite/libffi.call/cls_uchar.c: Likewise.
- * testsuite/libffi.call/cls_uint.c: Likewise.
- * testsuite/libffi.call/cls_ulonglong.c: Likewise.
- * testsuite/libffi.call/cls_ushort.c: Likewise.
- * testsuite/libffi.call/return_sc.c: Cleanup whitespaces.
-
-2003-11-06 Andreas Tobler <a.tobler@schweiz.ch>
-
- * src/prep_cif.c (ffi_prep_cif): Move the validity check after
- the initialization.
-
-2003-10-23 Andreas Tobler <a.tobler@schweiz.ch>
-
- * src/java_raw_api.c (ffi_java_ptrarray_to_raw): Replace
- FFI_ASSERT(FALSE) with FFI_ASSERT(0).
-
-2003-10-22 David Daney <ddaney@avtrex.com>
-
- * src/mips/ffitarget.h: Replace undefined UINT32 and friends with
- __attribute__((__mode__(__SI__))) and friends.
-
-2003-10-22 Andreas Schwab <schwab@suse.de>
-
- * src/ia64/ffi.c: Replace FALSE/TRUE with false/true.
-
-2003-10-21 Andreas Tobler <a.tobler@schweiz.ch>
-
- * configure.in: AC_LINK_FILES(ffitarget.h).
- * configure: Regenerate.
- * Makefile.in: Likewise.
- * include/Makefile.in: Likewise.
- * testsuite/Makefile.in: Likewise.
- * fficonfig.h.in: Likewise.
-
-2003-10-21 Paolo Bonzini <bonzini@gnu.org>
- Richard Henderson <rth@redhat.com>
-
- Avoid that ffi.h includes fficonfig.h.
-
- * Makefile.am (EXTRA_DIST): Include ffitarget.h files
- (TARGET_SRC_MIPS_GCC): Renamed to TARGET_SRC_MIPS_IRIX.
- (TARGET_SRC_MIPS_SGI): Removed.
- (MIPS_GCC): Renamed to TARGET_SRC_MIPS_IRIX.
- (MIPS_SGI): Removed.
- (CLEANFILES): Removed.
- (mostlyclean-am, clean-am, mostlyclean-sub, clean-sub): New
- targets.
- * acconfig.h: Removed.
- * configure.in: Compute sizeofs only for double and long double.
- Use them to define and subst HAVE_LONG_DOUBLE. Include comments
- into AC_DEFINE instead of using acconfig.h. Create
- include/ffitarget.h instead of include/fficonfig.h. Rename
- MIPS_GCC to MIPS_IRIX, drop MIPS_SGI since we are in gcc's tree.
- AC_DEFINE EH_FRAME_FLAGS.
- * include/Makefile.am (DISTCLEANFILES): New automake macro.
- (hack_DATA): Add ffitarget.h.
- * include/ffi.h.in: Remove all system specific definitions.
- Declare raw API even if it is not installed, why bother?
- Use limits.h instead of SIZEOF_* to define ffi_type_*. Do
- not define EH_FRAME_FLAGS, it is in fficonfig.h now. Include
- ffitarget.h instead of fficonfig.h. Remove ALIGN macro.
- (UINT_ARG, INT_ARG): Removed, use ffi_arg and ffi_sarg instead.
- * include/ffi_common.h (bool): Do not define.
- (ffi_assert): Accept failed assertion.
- (ffi_type_test): Return void and accept file/line.
- (FFI_ASSERT): Pass stringized failed assertion.
- (FFI_ASSERT_AT): New macro.
- (FFI_ASSERT_VALID_TYPE): New macro.
- (UINT8, SINT8, UINT16, SINT16, UINT32, SINT32,
- UINT64, SINT64): Define here with gcc's __attribute__ macro
- instead of in ffi.h
- (FLOAT32, ALIGN): Define here instead of in ffi.h
- * include/ffi-mips.h: Removed. Its content moved to
- src/mips/ffitarget.h after separating assembly and C sections.
- * src/alpha/ffi.c, src/alpha/ffi.c, src/java_raw_api.c
- src/prep_cif.c, src/raw_api.c, src/ia64/ffi.c,
- src/mips/ffi.c, src/mips/n32.S, src/mips/o32.S,
- src/mips/ffitarget.h, src/sparc/ffi.c, src/x86/ffi64.c:
- SIZEOF_ARG -> FFI_SIZEOF_ARG.
- * src/ia64/ffi.c: Include stdbool.h (provided by GCC 2.95+).
- * src/debug.c (ffi_assert): Accept stringized failed assertion.
- (ffi_type_test): Rewritten.
- * src/prep-cif.c (initialize_aggregate, ffi_prep_cif): Call
- FFI_ASSERT_VALID_TYPE.
- * src/alpha/ffitarget.h, src/arm/ffitarget.h,
- src/ia64/ffitarget.h, src/m68k/ffitarget.h,
- src/mips/ffitarget.h, src/powerpc/ffitarget.h,
- src/s390/ffitarget.h, src/sh/ffitarget.h,
- src/sh64/ffitarget.h, src/sparc/ffitarget.h,
- src/x86/ffitarget.h: New files.
- * src/alpha/osf.S, src/arm/sysv.S, src/ia64/unix.S,
- src/m68k/sysv.S, src/mips/n32.S, src/mips/o32.S,
- src/powerpc/aix.S, src/powerpc/darwin.S,
- src/powerpc/ffi_darwin.c, src/powerpc/linux64.S,
- src/powerpc/linux64_closure.S, src/powerpc/ppc_closure.S,
- src/powerpc/sysv.S, src/s390/sysv.S, src/sh/sysv.S,
- src/sh64/sysv.S, src/sparc/v8.S, src/sparc/v9.S,
- src/x86/sysv.S, src/x86/unix64.S, src/x86/win32.S:
- include fficonfig.h
-
-2003-10-20 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
-
- * src/mips/ffi.c: Use _ABIN32, _ABIO32 instead of external
- _MIPS_SIM_NABI32, _MIPS_SIM_ABI32.
-
-2003-10-19 Andreas Tobler <a.tobler@schweiz.ch>
-
- * src/powerpc/ffi_darwin.c (ffi_prep_args): Declare bytes again.
- Used when FFI_DEBUG = 1.
-
-2003-10-14 Alan Modra <amodra@bigpond.net.au>
-
- * src/types.c (double, longdouble): Default POWERPC64 to 8 byte size
- and align.
-
-2003-10-06 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
-
- * include/ffi_mips.h: Define FFI_MIPS_N32 for N32/N64 ABIs,
- FFI_MIPS_O32 for O32 ABI.
-
-2003-10-01 Andreas Tobler <a.tobler@schweiz.ch>
-
- * testsuite/lib/libffi-dg.exp: Set LD_LIBRARY_PATH_64 for
- SPARC64. Cleanup whitespaces.
-
-2003-09-19 Andreas Tobler <a.tobler@schweiz.ch>
-
- * testsuite/libffi.call/closure_fn0.c: Xfail mips, arm,
- strongarm, xscale. Cleanup whitespaces.
- * testsuite/libffi.call/closure_fn1.c: Likewise.
- * testsuite/libffi.call/closure_fn2.c: Likewise.
- * testsuite/libffi.call/closure_fn3.c: Likewise.
- * testsuite/libffi.call/cls_12byte.c: Likewise.
- * testsuite/libffi.call/cls_16byte.c: Likewise.
- * testsuite/libffi.call/cls_1_1byte.c: Likewise.
- * testsuite/libffi.call/cls_20byte.c: Likewise.
- * testsuite/libffi.call/cls_24byte.c: Likewise.
- * testsuite/libffi.call/cls_2byte.c: Likewise.
- * testsuite/libffi.call/cls_3_1byte.c: Likewise.
- * testsuite/libffi.call/cls_3byte1.c: Likewise.
- * testsuite/libffi.call/cls_3byte2.c: Likewise.
- * testsuite/libffi.call/cls_4_1byte.c: Likewise.
- * testsuite/libffi.call/cls_4byte.c: Likewise.
- * testsuite/libffi.call/cls_5byte.c: Likewise.
- * testsuite/libffi.call/cls_6byte.c: Likewise.
- * testsuite/libffi.call/cls_7byte.c: Likewise.
- * testsuite/libffi.call/cls_8byte.c: Likewise.
- * testsuite/libffi.call/cls_double.c: Likewise.
- * testsuite/libffi.call/cls_float.c: Likewise.
- * testsuite/libffi.call/cls_uchar.c: Likewise.
- * testsuite/libffi.call/cls_uint.c: Likewise.
- * testsuite/libffi.call/cls_ulonglong.c: Likewise.
- * testsuite/libffi.call/cls_ushort.c: Likewise.
- * testsuite/libffi.call/nested_struct.c: Likewise.
- * testsuite/libffi.call/nested_struct1.c: Likewise.
- * testsuite/libffi.call/problem1.c: Likewise.
- * testsuite/libffi.special/unwindtest.cc: Likewise.
- * testsuite/libffi.call/pyobjc-tc.c: Cleanup whitespaces.
-
-2003-09-18 David Edelsohn <edelsohn@gnu.org>
-
- * src/powerpc/aix.S: Cleanup whitespaces.
- * src/powerpc/aix_closure.S: Likewise.
-
-2003-09-18 Andreas Tobler <a.tobler@schweiz.ch>
-
- * src/powerpc/darwin.S: Cleanup whitespaces, comment formatting.
- * src/powerpc/darwin_closure.S: Likewise.
- * src/powerpc/ffi_darwin.c: Likewise.
-
-2003-09-18 Andreas Tobler <a.tobler@schweiz.ch>
- David Edelsohn <edelsohn@gnu.org>
-
- * src/types.c (double): Add AIX and Darwin to the right TYPEDEF.
- * src/powerpc/aix_closure.S: Remove the pointer to the outgoing
- parameter stack.
- * src/powerpc/darwin_closure.S: Likewise.
- * src/powerpc/ffi_darwin.c (ffi_prep_args): Handle structures
- according to the Darwin/AIX ABI.
- (ffi_prep_cif_machdep): Likewise.
- (ffi_closure_helper_DARWIN): Likewise.
- Remove the outgoing parameter stack logic. Simplify the evaluation
- of the different CASE types.
- (ffi_prep_clousure): Avoid the casts on lvalues. Change the branch
- statement in the trampoline code.
-
-2003-09-18 Kaz Kojima <kkojima@gcc.gnu.org>
-
- * src/sh/ffi.c (ffi_prep_args): Take account into the alignement
- for the register size.
- (ffi_closure_helper_SYSV): Handle the structure return value
- address correctly.
- (ffi_closure_helper_SYSV): Return the appropriate type when
- the registers are used for the structure return value.
- * src/sh/sysv.S (ffi_closure_SYSV): Fix the stack layout for
- the 64-bit return value. Update copyright years.
-
-2003-09-17 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
-
- * testsuite/lib/libffi-dg.exp (libffi_target_compile): Search in
- srcdir for ffi_mips.h.
-
-2003-09-12 Alan Modra <amodra@bigpond.net.au>
-
- * src/prep_cif.c (initialize_aggregate): Include tail padding in
- structure size.
- * src/powerpc/linux64_closure.S (ffi_closure_LINUX64): Correct
- placement of float result.
- * testsuite/libffi.special/unwindtest.cc (closure_test_fn1): Correct
- cast of "resp" for big-endian 64 bit machines.
-
-2003-09-11 Alan Modra <amodra@bigpond.net.au>
-
- * src/types.c (double, longdouble): Merge identical SH and ARM
- typedefs, and add POWERPC64.
- * src/powerpc/ffi.c (ffi_prep_args64): Correct next_arg calc for
- struct split over gpr and rest.
- (ffi_prep_cif_machdep): Correct intarg_count for structures.
- * src/powerpc/linux64.S (ffi_call_LINUX64): Fix gpr offsets.
-
-2003-09-09 Andreas Tobler <a.tobler@schweiz.ch>
-
- * src/powerpc/ffi.c (ffi_closure_helper_SYSV) Handle struct
- passing correctly.
-
-2003-09-09 Alan Modra <amodra@bigpond.net.au>
-
- * configure: Regenerate.
-
-2003-09-04 Andreas Tobler <a.tobler@schweiz.ch>
-
- * Makefile.am: Remove build rules for ffitest.
- * Makefile.in: Rebuilt.
-
-2003-09-04 Andreas Tobler <a.tobler@schweiz.ch>
-
- * src/java_raw_api.c: Include <stdlib.h> to fix compiler warning
- about implicit declaration of abort().
-
-2003-09-04 Andreas Tobler <a.tobler@schweiz.ch>
-
- * Makefile.am: Add dejagnu test framework. Fixes PR other/11411.
- * Makefile.in: Rebuilt.
- * configure.in: Add dejagnu test framework.
- * configure: Rebuilt.
-
- * testsuite/Makefile.am: New file.
- * testsuite/Makefile.in: Built
- * testsuite/lib/libffi-dg.exp: New file.
- * testsuite/config/default.exp: Likewise.
- * testsuite/libffi.call/call.exp: Likewise.
- * testsuite/libffi.call/ffitest.h: Likewise.
- * testsuite/libffi.call/closure_fn0.c: Likewise.
- * testsuite/libffi.call/closure_fn1.c: Likewise.
- * testsuite/libffi.call/closure_fn2.c: Likewise.
- * testsuite/libffi.call/closure_fn3.c: Likewise.
- * testsuite/libffi.call/cls_1_1byte.c: Likewise.
- * testsuite/libffi.call/cls_3_1byte.c: Likewise.
- * testsuite/libffi.call/cls_4_1byte.c: Likewise.
- * testsuite/libffi.call/cls_2byte.c: Likewise.
- * testsuite/libffi.call/cls_3byte1.c: Likewise.
- * testsuite/libffi.call/cls_3byte2.c: Likewise.
- * testsuite/libffi.call/cls_4byte.c: Likewise.
- * testsuite/libffi.call/cls_5byte.c: Likewise.
- * testsuite/libffi.call/cls_6byte.c: Likewise.
- * testsuite/libffi.call/cls_7byte.c: Likewise.
- * testsuite/libffi.call/cls_8byte.c: Likewise.
- * testsuite/libffi.call/cls_12byte.c: Likewise.
- * testsuite/libffi.call/cls_16byte.c: Likewise.
- * testsuite/libffi.call/cls_20byte.c: Likewise.
- * testsuite/libffi.call/cls_24byte.c: Likewise.
- * testsuite/libffi.call/cls_double.c: Likewise.
- * testsuite/libffi.call/cls_float.c: Likewise.
- * testsuite/libffi.call/cls_uchar.c: Likewise.
- * testsuite/libffi.call/cls_uint.c: Likewise.
- * testsuite/libffi.call/cls_ulonglong.c: Likewise.
- * testsuite/libffi.call/cls_ushort.c: Likewise.
- * testsuite/libffi.call/float.c: Likewise.
- * testsuite/libffi.call/float1.c: Likewise.
- * testsuite/libffi.call/float2.c: Likewise.
- * testsuite/libffi.call/many.c: Likewise.
- * testsuite/libffi.call/many_win32.c: Likewise.
- * testsuite/libffi.call/nested_struct.c: Likewise.
- * testsuite/libffi.call/nested_struct1.c: Likewise.
- * testsuite/libffi.call/pyobjc-tc.c: Likewise.
- * testsuite/libffi.call/problem1.c: Likewise.
- * testsuite/libffi.call/promotion.c: Likewise.
- * testsuite/libffi.call/return_ll.c: Likewise.
- * testsuite/libffi.call/return_sc.c: Likewise.
- * testsuite/libffi.call/return_uc.c: Likewise.
- * testsuite/libffi.call/strlen.c: Likewise.
- * testsuite/libffi.call/strlen_win32.c: Likewise.
- * testsuite/libffi.call/struct1.c: Likewise.
- * testsuite/libffi.call/struct2.c: Likewise.
- * testsuite/libffi.call/struct3.c: Likewise.
- * testsuite/libffi.call/struct4.c: Likewise.
- * testsuite/libffi.call/struct5.c: Likewise.
- * testsuite/libffi.call/struct6.c: Likewise.
- * testsuite/libffi.call/struct7.c: Likewise.
- * testsuite/libffi.call/struct8.c: Likewise.
- * testsuite/libffi.call/struct9.c: Likewise.
- * testsuite/libffi.special/special.exp: New file.
- * testsuite/libffi.special/ffitestcxx.h: Likewise.
- * testsuite/libffi.special/unwindtest.cc: Likewise.
-
-
-2003-08-13 Kaz Kojima <kkojima@gcc.gnu.org>
-
- * src/sh/ffi.c (OFS_INT16): Set 0 for little endian case. Update
- copyright years.
-
-2003-08-02 Alan Modra <amodra@bigpond.net.au>
-
- * src/powerpc/ffi.c (ffi_prep_args64): Modify for changed gcc
- structure passing.
- (ffi_closure_helper_LINUX64): Likewise.
- * src/powerpc/linux64.S: Remove code writing to parm save area.
- * src/powerpc/linux64_closure.S (ffi_closure_LINUX64): Use return
- address in lr from ffi_closure_helper_LINUX64 call to calculate
- table address. Optimize function tail.
-
-2003-07-28 Andreas Tobler <a.tobler@schweiz.ch>
-
- * src/sparc/ffi.c: Handle all floating point registers.
- * src/sparc/v9.S: Likewise. Fixes second part of PR target/11410.
-
-2003-07-11 Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
-
- * README: Note that libffi is not part of GCC. Update the project
- URL and status.
-
-2003-06-19 Franz Sirl <Franz.Sirl-kernel@lauterbach.com>
-
- * src/powerpc/ppc_closure.S: Include ffi.h.
-
-2003-06-13 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
-
- * src/x86/sysv.S: Avoid gas-only .uleb128/.sleb128 directives.
- Use C style comments.
-
-2003-06-13 Kaz Kojima <kkojima@rr.iij4u.or.jp>
-
- * Makefile.am: Add SHmedia support. Fix a typo of SH support.
- * Makefile.in: Regenerate.
- * configure.in (sh64-*-linux*, sh5*-*-linux*): Add target.
- * configure: Regenerate.
- * include/ffi.h.in: Add SHmedia support.
- * src/sh64/ffi.c: New file.
- * src/sh64/sysv.S: New file.
-
-2003-05-16 Jakub Jelinek <jakub@redhat.com>
-
- * configure.in (HAVE_RO_EH_FRAME): Check whether .eh_frame section
- should be read-only.
- * configure: Rebuilt.
- * fficonfig.h.in: Rebuilt.
- * include/ffi.h.in (EH_FRAME_FLAGS): Define.
- * src/alpha/osf.S: Use EH_FRAME_FLAGS.
- * src/powerpc/linux64.S: Likewise.
- * src/powerpc/linux64_closure.S: Likewise. Include ffi.h.
- * src/powerpc/sysv.S: Use EH_FRAME_FLAGS. Use pcrel encoding
- if -fpic/-fPIC/-mrelocatable.
- * src/powerpc/powerpc_closure.S: Likewise.
- * src/sparc/v8.S: If HAVE_RO_EH_FRAME is defined, don't include
- #write in .eh_frame flags.
- * src/sparc/v9.S: Likewise.
- * src/x86/unix64.S: Use EH_FRAME_FLAGS.
- * src/x86/sysv.S: Likewise. Use pcrel encoding if -fpic/-fPIC.
- * src/s390/sysv.S: Use EH_FRAME_FLAGS. Include ffi.h.
-
-2003-05-07 Jeff Sturm <jsturm@one-point.com>
-
- Fixes PR bootstrap/10656
- * configure.in (HAVE_AS_REGISTER_PSEUDO_OP): Test assembler
- support for .register pseudo-op.
- * src/sparc/v8.S: Use it.
- * fficonfig.h.in: Rebuilt.
- * configure: Rebuilt.
-
-2003-04-18 Jakub Jelinek <jakub@redhat.com>
-
- * include/ffi.h.in (POWERPC64): Define if 64-bit.
- (enum ffi_abi): Add FFI_LINUX64 on POWERPC.
- Make it the default on POWERPC64.
- (FFI_TRAMPOLINE_SIZE): Define to 24 on POWERPC64.
- * configure.in: Change powerpc-*-linux* into powerpc*-*-linux*.
- * configure: Rebuilt.
- * src/powerpc/ffi.c (hidden): Define.
- (ffi_prep_args_SYSV): Renamed from
- ffi_prep_args. Cast pointers to unsigned long to shut up warnings.
- (NUM_GPR_ARG_REGISTERS64, NUM_FPR_ARG_REGISTERS64,
- ASM_NEEDS_REGISTERS64): New.
- (ffi_prep_args64): New function.
- (ffi_prep_cif_machdep): Handle FFI_LINUX64 ABI.
- (ffi_call): Likewise.
- (ffi_prep_closure): Likewise.
- (flush_icache): Surround by #ifndef POWERPC64.
- (ffi_dblfl): New union type.
- (ffi_closure_helper_SYSV): Use it to avoid aliasing problems.
- (ffi_closure_helper_LINUX64): New function.
- * src/powerpc/ppc_closure.S: Surround whole file by #ifndef
- __powerpc64__.
- * src/powerpc/sysv.S: Likewise.
- (ffi_call_SYSV): Rename ffi_prep_args to ffi_prep_args_SYSV.
- * src/powerpc/linux64.S: New file.
- * src/powerpc/linux64_closure.S: New file.
- * Makefile.am (EXTRA_DIST): Add src/powerpc/linux64.S and
- src/powerpc/linux64_closure.S.
- (TARGET_SRC_POWERPC): Likewise.
-
- * src/ffitest.c (closure_test_fn, closure_test_fn1, closure_test_fn2,
- closure_test_fn3): Fix result printing on big-endian 64-bit
- machines.
- (main): Print tst2_arg instead of uninitialized tst2_result.
-
- * src/ffitest.c (main): Hide what closure pointer really points to
- from the compiler.
-
-2003-04-16 Richard Earnshaw <rearnsha@arm.com>
-
- * configure.in (arm-*-netbsdelf*): Add configuration.
- (configure): Regenerated.
-
-2003-04-04 Loren J. Rittle <ljrittle@acm.org>
-
- * include/Makefile.in: Regenerate.
-
-2003-03-21 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
-
- * libffi/include/ffi.h.in: Define X86 instead of X86_64 in 32
- bit mode.
- * libffi/src/x86/ffi.c (ffi_closure_SYSV, ffi_closure_raw_SYSV):
- Receive closure pointer through parameter, read args using
- __builtin_dwarf_cfa.
- (FFI_INIT_TRAMPOLINE): Send closure reference through eax.
-
-2003-03-12 Andreas Schwab <schwab@suse.de>
-
- * configure.in: Avoid trailing /. in toolexeclibdir.
- * configure: Rebuilt.
-
-2003-03-03 Andreas Tobler <a.tobler@schweiz.ch>
-
- * src/powerpc/darwin_closure.S: Recode to fit dynamic libraries.
-
-2003-02-06 Andreas Tobler <a.tobler@schweiz.ch>
-
- * libffi/src/powerpc/darwin_closure.S:
- Fix alignement bug, allocate 8 bytes for the result.
- * libffi/src/powerpc/aix_closure.S:
- Likewise.
- * libffi/src/powerpc/ffi_darwin.c:
- Update stackframe description for aix/darwin_closure.S.
-
-2003-02-06 Jakub Jelinek <jakub@redhat.com>
-
- * src/s390/ffi.c (ffi_closure_helper_SYSV): Add hidden visibility
- attribute.
-
-2003-01-31 Christian Cornelssen <ccorn@cs.tu-berlin.de>,
- Andreas Schwab <schwab@suse.de>
-
- * configure.in: Adjust command to source config-ml.in to account
- for changes to the libffi_basedir definition.
- (libffi_basedir): Remove ${srcdir} from value and include trailing
- slash if nonempty.
-
- * configure: Regenerate.
-
-2003-01-29 Franz Sirl <Franz.Sirl-kernel@lauterbach.com>
-
- * src/powerpc/ppc_closure.S: Recode to fit shared libs.
-
-2003-01-28 Andrew Haley <aph@redhat.com>
-
- * include/ffi.h.in: Enable FFI_CLOSURES for x86_64.
- * src/x86/ffi64.c (ffi_prep_closure): New.
- (ffi_closure_UNIX64_inner): New.
- * src/x86/unix64.S (ffi_closure_UNIX64): New.
-
-2003-01-27 Alexandre Oliva <aoliva@redhat.com>
-
- * configure.in (toolexecdir, toolexeclibdir): Set and AC_SUBST.
- Remove USE_LIBDIR conditional.
- * Makefile.am (toolexecdir, toolexeclibdir): Don't override.
- * Makefile.in, configure: Rebuilt.
-
-2003-01027 David Edelsohn <edelsohn@gnu.org>
-
- * Makefile.am (TARGET_SRC_POWERPC_AIX): Fix typo.
- * Makefile.in: Regenerate.
-
-2003-01-22 Andrew Haley <aph@redhat.com>
-
- * src/powerpc/darwin.S (_ffi_call_AIX): Add Augmentation size to
- unwind info.
-
-2003-01-21 Andreas Tobler <a.tobler@schweiz.ch>
-
- * src/powerpc/darwin.S: Add unwind info.
- * src/powerpc/darwin_closure.S: Likewise.
-
-2003-01-14 Andrew Haley <aph@redhat.com>
-
- * src/x86/ffi64.c (ffi_prep_args): Check for void retval.
- (ffi_prep_cif_machdep): Likewise.
- * src/x86/unix64.S: Add unwind info.
-
-2003-01-14 Andreas Jaeger <aj@suse.de>
-
- * src/ffitest.c (main): Only use ffi_closures if those are
- supported.
-
-2003-01-13 Andreas Tobler <a.tobler@schweiz.ch>
-
- * libffi/src/ffitest.c
- add closure testcases
-
-2003-01-13 Kevin B. Hendricks <khendricks@ivey.uwo.ca>
-
- * libffi/src/powerpc/ffi.c
- fix alignment bug for float (4 byte aligned iso 8 byte)
-
-2003-01-09 Geoffrey Keating <geoffk@apple.com>
-
- * src/powerpc/ffi_darwin.c: Remove RCS version string.
- * src/powerpc/darwin.S: Remove RCS version string.
-
-2003-01-03 Jeff Sturm <jsturm@one-point.com>
-
- * include/ffi.h.in: Add closure defines for SPARC, SPARC64.
- * src/ffitest.c (main): Use static storage for closure.
- * src/sparc/ffi.c (ffi_prep_closure, ffi_closure_sparc_inner): New.
- * src/sparc/v8.S (ffi_closure_v8): New.
- * src/sparc/v9.S (ffi_closure_v9): New.
-
-2002-11-10 Ranjit Mathew <rmathew@hotmail.com>
-
- * include/ffi.h.in: Added FFI_STDCALL ffi_type
- enumeration for X86_WIN32.
- * src/x86/win32.S: Added ffi_call_STDCALL function
- definition.
- * src/x86/ffi.c (ffi_call/ffi_raw_call): Added
- switch cases for recognising FFI_STDCALL and
- calling ffi_call_STDCALL if target is X86_WIN32.
- * src/ffitest.c (my_stdcall_strlen/stdcall_many):
- stdcall versions of the "my_strlen" and "many"
- test functions (for X86_WIN32).
- Added test cases to test stdcall invocation using
- these functions.
-
-2002-12-02 Kaz Kojima <kkojima@gcc.gnu.org>
-
- * src/sh/sysv.S: Add DWARF2 unwind info.
-
-2002-11-27 Ulrich Weigand <uweigand@de.ibm.com>
-
- * src/s390/sysv.S (.eh_frame section): Make section read-only.
-
-2002-11-26 Jim Wilson <wilson@redhat.com>
-
- * src/types.c (FFI_TYPE_POINTER): Has size 8 on IA64.
-
-2002-11-23 H.J. Lu <hjl@gnu.org>
-
- * acinclude.m4: Add dummy AM_PROG_LIBTOOL.
- Include ../config/accross.m4.
- * aclocal.m4; Rebuild.
- * configure: Likewise.
-
-2002-11-15 Ulrich Weigand <uweigand@de.ibm.com>
-
- * src/s390/sysv.S (.eh_frame section): Adapt to pcrel FDE encoding.
-
-2002-11-11 DJ Delorie <dj@redhat.com>
-
- * configure.in: Look for common files in the right place.
-
-2002-10-08 Ulrich Weigand <uweigand@de.ibm.com>
-
- * src/java_raw_api.c (ffi_java_raw_to_ptrarray): Interpret
- raw data as _Jv_word values, not ffi_raw.
- (ffi_java_ptrarray_to_raw): Likewise.
- (ffi_java_rvalue_to_raw): New function.
- (ffi_java_raw_call): Call it.
- (ffi_java_raw_to_rvalue): New function.
- (ffi_java_translate_args): Call it.
- * src/ffitest.c (closure_test_fn): Interpret return value
- as ffi_arg, not int.
- * src/s390/ffi.c (ffi_prep_cif_machdep): Add missing
- FFI_TYPE_POINTER case.
- (ffi_closure_helper_SYSV): Likewise. Also, assume return
- values extended to word size.
-
-2002-10-02 Andreas Jaeger <aj@suse.de>
-
- * src/x86/ffi64.c (ffi_prep_cif_machdep): Remove debug output.
-
-2002-10-01 Bo Thorsen <bo@smetana.suse.de>
-
- * include/ffi.h.in: Fix i386 win32 compilation.
-
-2002-09-30 Ulrich Weigand <uweigand@de.ibm.com>
-
- * configure.in: Add s390x-*-linux-* target.
- * configure: Regenerate.
- * include/ffi.h.in: Define S390X for s390x targets.
- (FFI_CLOSURES): Define for s390/s390x.
- (FFI_TRAMPOLINE_SIZE): Likewise.
- (FFI_NATIVE_RAW_API): Likewise.
- * src/prep_cif.c (ffi_prep_cif): Do not compute stack space for s390.
- * src/types.c (FFI_TYPE_POINTER): Use 8-byte pointers on s390x.
- * src/s390/ffi.c: Major rework of existing code. Add support for
- s390x targets. Add closure support.
- * src/s390/sysv.S: Likewise.
-
-2002-09-29 Richard Earnshaw <rearnsha@arm.com>
-
- * src/arm/sysv.S: Fix typo.
-
-2002-09-28 Richard Earnshaw <rearnsha@arm.com>
-
- * src/arm/sysv.S: If we don't have machine/asm.h and the pre-processor
- has defined __USER_LABEL_PREFIX__, then use it in CNAME.
- (ffi_call_SYSV): Handle soft-float.
-
-2002-09-27 Bo Thorsen <bo@suse.de>
-
- * include/ffi.h.in: Fix multilib x86-64 support.
-
-2002-09-22 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-
- * Makefile.am (all-multi): Fix multilib parallel build.
-
-2002-07-19 Kaz Kojima <kkojima@gcc.gnu.org>
-
- * configure.in (sh[34]*-*-linux*): Add brackets.
- * configure: Regenerate.
-
-2002-07-18 Kaz Kojima <kkojima@gcc.gnu.org>
-
- * Makefile.am: Add SH support.
- * Makefile.in: Regenerate.
- * configure.in (sh-*-linux*, sh[34]*-*-linux*): Add target.
- * configure: Regenerate.
- * include/ffi.h.in: Add SH support.
- * src/sh/ffi.c: New file.
- * src/sh/sysv.S: New file.
- * src/types.c: Add SH support.
-
-2002-07-16 Bo Thorsen <bo@suse.de>
-
- * src/x86/ffi64.c: New file that adds x86-64 support.
- * src/x86/unix64.S: New file that handles argument setup for
- x86-64.
- * src/x86/sysv.S: Don't use this on x86-64.
- * src/x86/ffi.c: Don't use this on x86-64.
- Remove unused vars.
- * src/prep_cif.c (ffi_prep_cif): Don't do stack size calculation
- for x86-64.
- * src/ffitest.c (struct6): New test that tests a special case in
- the x86-64 ABI.
- (struct7): Likewise.
- (struct8): Likewise.
- (struct9): Likewise.
- (closure_test_fn): Silence warning about this when it's not used.
- (main): Add the new tests.
- (main): Fix a couple of wrong casts and silence some compiler warnings.
- * include/ffi.h.in: Add x86-64 ABI definition.
- * fficonfig.h.in: Regenerate.
- * Makefile.am: Add x86-64 support.
- * configure.in: Likewise.
- * Makefile.in: Regenerate.
- * configure: Likewise.
-
-2002-06-24 Bo Thorsen <bo@suse.de>
-
- * src/types.c: Merge settings for similar architectures.
- Add x86-64 sizes and alignments.
-
-2002-06-23 Bo Thorsen <bo@suse.de>
-
- * src/arm/ffi.c (ffi_prep_args): Remove unused vars.
- * src/sparc/ffi.c (ffi_prep_args_v8): Likewise.
- * src/mips/ffi.c (ffi_prep_args): Likewise.
- * src/m68k/ffi.c (ffi_prep_args): Likewise.
-
-2002-07-18 H.J. Lu (hjl@gnu.org)
-
- * Makefile.am (TARGET_SRC_MIPS_LINUX): New.
- (libffi_la_SOURCES): Support MIPS_LINUX.
- (libffi_convenience_la_SOURCES): Likewise.
- * Makefile.in: Regenerated.
-
- * configure.in (mips64*-*): Skip.
- (mips*-*-linux*): New.
- * configure: Regenerated.
-
- * src/mips/ffi.c: Include <sgidefs.h>.
-
-2002-06-06 Ulrich Weigand <uweigand@de.ibm.com>
-
- * src/s390/sysv.S: Save/restore %r6. Add DWARF-2 unwind info.
-
-2002-05-27 Roger Sayle <roger@eyesopen.com>
-
- * src/x86/ffi.c (ffi_prep_args): Remove reference to avn.
-
-2002-05-27 Bo Thorsen <bo@suse.de>
-
- * src/x86/ffi.c (ffi_prep_args): Remove unused variable and
- fix formatting.
-
-2002-05-13 Andreas Tobler <a.tobler@schweiz.ch>
-
- * src/powerpc/ffi_darwin.c (ffi_prep_closure): Declare fd at
- beginning of function (for older apple cc).
-
-2002-05-08 Alexandre Oliva <aoliva@redhat.com>
-
- * configure.in (ORIGINAL_LD_FOR_MULTILIBS): Preserve LD at
- script entry, and set LD to it when configuring multilibs.
- * configure: Rebuilt.
-
-2002-05-05 Jason Thorpe <thorpej@wasabisystems.com>
-
- * configure.in (sparc64-*-netbsd*): Add target.
- (sparc-*-netbsdelf*): Likewise.
- * configure: Regenerate.
-
-2002-04-28 David S. Miller <davem@redhat.com>
-
- * configure.in, configure: Fix SPARC test in previous change.
-
-2002-04-29 Gerhard Tonn <GerhardTonn@swol.de>
-
- * Makefile.am: Add Linux for S/390 support.
- * Makefile.in: Regenerate.
- * configure.in: Add Linux for S/390 support.
- * configure: Regenerate.
- * include/ffi.h.in: Add Linux for S/390 support.
- * src/s390/ffi.c: New file from libffi CVS tree.
- * src/s390/sysv.S: New file from libffi CVS tree.
-
-2002-04-28 Jakub Jelinek <jakub@redhat.com>
-
- * configure.in (HAVE_AS_SPARC_UA_PCREL): Check for working
- %r_disp32().
- * src/sparc/v8.S: Use it.
- * src/sparc/v9.S: Likewise.
- * fficonfig.h.in: Rebuilt.
- * configure: Rebuilt.
-
-2002-04-08 Hans Boehm <Hans_Boehm@hp.com>
-
- * src/java_raw_api.c (ffi_java_raw_size): Handle FFI_TYPE_DOUBLE
- correctly.
- * src/ia64/unix.S: Add unwind information. Fix comments.
- Save sp in a way that's compatible with unwind info.
- (ffi_call_unix): Correctly restore sp in all cases.
- * src/ia64/ffi.c: Add, fix comments.
-
-2002-04-08 Jakub Jelinek <jakub@redhat.com>
-
- * src/sparc/v8.S: Make .eh_frame dependent on target word size.
-
-2002-04-06 Jason Thorpe <thorpej@wasabisystems.com>
-
- * configure.in (alpha*-*-netbsd*): Add target.
- * configure: Regenerate.
-
-2002-04-04 Jeff Sturm <jsturm@one-point.com>
-
- * src/sparc/v8.S: Add unwind info.
- * src/sparc/v9.S: Likewise.
-
-2002-03-30 Krister Walfridsson <cato@df.lth.se>
-
- * configure.in: Enable i*86-*-netbsdelf*.
- * configure: Rebuilt.
-
-2002-03-29 David Billinghurst <David.Billinghurst@riotinto.com>
-
- PR other/2620
- * src/mips/n32.s: Delete
- * src/mips/o32.s: Delete
-
-2002-03-21 Loren J. Rittle <ljrittle@acm.org>
-
- * configure.in: Enable alpha*-*-freebsd*.
- * configure: Rebuilt.
-
-2002-03-17 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
-
- * Makefile.am: libfficonvenience -> libffi_convenience.
- * Makefile.in: Rebuilt.
-
- * Makefile.am: Define ffitest_OBJECTS.
- * Makefile.in: Rebuilt.
-
-2002-03-07 Andreas Tobler <toa@pop.agri.ch>
- David Edelsohn <edelsohn@gnu.org>
-
- * Makefile.am (EXTRA_DIST): Add Darwin and AIX closure files.
- (TARGET_SRC_POWERPC_AIX): Add aix_closure.S.
- (TARGET_SRC_POWERPC_DARWIN): Add darwin_closure.S.
- * Makefile.in: Regenerate.
- * include/ffi.h.in: Add AIX and Darwin closure definitions.
- * src/powerpc/ffi_darwin.c (ffi_prep_closure): New function.
- (flush_icache, flush_range): New functions.
- (ffi_closure_helper_DARWIN): New function.
- * src/powerpc/aix_closure.S: New file.
- * src/powerpc/darwin_closure.S: New file.
-
-2002-02-24 Jeff Sturm <jsturm@one-point.com>
-
- * include/ffi.h.in: Add typedef for ffi_arg.
- * src/ffitest.c (main): Declare rint with ffi_arg.
-
-2002-02-21 Andreas Tobler <toa@pop.agri.ch>
-
- * src/powerpc/ffi_darwin.c (ffi_prep_args): Skip appropriate
- number of GPRs for floating-point arguments.
-
-2002-01-31 Anthony Green <green@redhat.com>
-
- * configure: Rebuilt.
- * configure.in: Replace CHECK_SIZEOF and endian tests with
- cross-compiler friendly macros.
- * aclocal.m4 (AC_COMPILE_CHECK_SIZEOF, AC_C_BIGENDIAN_CROSS): New
- macros.
-
-2002-01-18 David Edelsohn <edelsohn@gnu.org>
-
- * src/powerpc/darwin.S (_ffi_call_AIX): New.
- * src/powerpc/aix.S (ffi_call_DARWIN): New.
-
-2002-01-17 David Edelsohn <edelsohn@gnu.org>
-
- * Makefile.am (EXTRA_DIST): Add Darwin and AIX files.
- (TARGET_SRC_POWERPC_AIX): New.
- (POWERPC_AIX): New stanza.
- * Makefile.in: Regenerate.
- * configure.in: Add AIX case.
- * configure: Regenerate.
- * include/ffi.h.in (ffi_abi): Add FFI_AIX.
- * src/powerpc/ffi_darwin.c (ffi_status): Use "long" to scale frame
- size. Fix "long double" support.
- (ffi_call): Add FFI_AIX case.
- * src/powerpc/aix.S: New.
-
-2001-10-09 John Hornkvist <john@toastedmarshmallow.com>
-
- Implement Darwin PowerPC ABI.
- * configure.in: Handle powerpc-*-darwin*.
- * Makefile.am: Set source files for POWERPC_DARWIN.
- * configure: Rebuilt.
- * Makefile.in: Rebuilt.
- * include/ffi.h.in: Define FFI_DARWIN and FFI_DEFAULT_ABI for
- POWERPC_DARWIN.
- * src/powerpc/darwin.S: New file.
- * src/powerpc/ffi_darwin.c: New file.
-
-2001-10-07 Joseph S. Myers <jsm28@cam.ac.uk>
-
- * src/x86/ffi.c: Fix spelling error of "separate" as "seperate".
-
-2001-07-16 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
-
- * src/x86/sysv.S: Avoid gas-only .balign directive.
- Use C style comments.
-
-2001-07-16 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
-
- * src/alpha/ffi.c (ffi_prep_closure): Avoid gas-only mnemonic.
- Fixes PR bootstrap/3563.
-
-2001-06-26 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
-
- * src/alpha/osf.S (ffi_closure_osf): Use .rdata for ECOFF.
-
-2001-06-25 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
-
- * configure.in: Recognize sparc*-sun-* host.
- * configure: Regenerate.
-
-2001-06-06 Andrew Haley <aph@redhat.com>
-
- * src/alpha/osf.S (__FRAME_BEGIN__): Conditionalize for ELF.
-
-2001-06-03 Andrew Haley <aph@redhat.com>
-
- * src/alpha/osf.S: Add unwind info.
- * src/powerpc/sysv.S: Add unwind info.
- * src/powerpc/ppc_closure.S: Likewise.
-
-2000-05-31 Jeff Sturm <jsturm@one-point.com>
-
- * configure.in: Fix AC_ARG_ENABLE usage.
- * configure: Rebuilt.
-
-2001-05-06 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
-
- * configure.in: Remove warning about beta code.
- * configure: Rebuilt.
-
-2001-04-25 Hans Boehm <Hans_Boehm@hp.com>
-
- * src/ia64/unix.S: Restore stack pointer when returning from
- ffi_closure_UNIX.
- * src/ia64/ffi.c: Fix typo in comment.
-
-2001-04-18 Jim Wilson <wilson@redhat.com>
-
- * src/ia64/unix.S: Delete unnecessary increment and decrement of loc2
- to eliminate RAW DV.
-
-2001-04-12 Bryce McKinlay <bryce@albatross.co.nz>
-
- * Makefile.am: Make a libtool convenience library.
- * Makefile.in: Rebuilt.
-
-2001-03-29 Bryce McKinlay <bryce@albatross.co.nz>
-
- * configure.in: Use different syntax for subdirectory creation.
- * configure: Rebuilt.
-
-2001-03-27 Jon Beniston <jon@beniston.com>
-
- * configure.in: Added X86_WIN32 target (Win32, CygWin, MingW).
- * configure: Rebuilt.
- * Makefile.am: Added X86_WIN32 target support.
- * Makefile.in: Rebuilt.
-
- * include/ffi.h.in: Added X86_WIN32 target support.
-
- * src/ffitest.c: Doesn't run structure tests for X86_WIN32 targets.
- * src/types.c: Added X86_WIN32 target support.
-
- * src/x86/win32.S: New file. Based on sysv.S, but with EH
- stuff removed and made to work with CygWin's gas.
-
-2001-03-26 Bryce McKinlay <bryce@albatross.co.nz>
-
- * configure.in: Make target subdirectory in build dir.
- * Makefile.am: Override suffix based rules to specify correct output
- subdirectory.
- * Makefile.in: Rebuilt.
- * configure: Rebuilt.
-
-2001-03-23 Kevin B Hendricks <khendricks@ivey.uwo.ca>
-
- * src/powerpc/ppc_closure.S: New file.
- * src/powerpc/ffi.c (ffi_prep_args): Fixed ABI compatibility bug
- involving long long and register pairs.
- (ffi_prep_closure): New function.
- (flush_icache): Likewise.
- (ffi_closure_helper_SYSV): Likewise.
- * include/ffi.h.in (FFI_CLOSURES): Define on PPC.
- (FFI_TRAMPOLINE_SIZE): Likewise.
- (FFI_NATIVE_RAW_API): Likewise.
- * Makefile.in: Rebuilt.
- * Makefile.am (EXTRA_DIST): Added src/powerpc/ppc_closure.S.
- (TARGET_SRC_POWERPC): Likewise.
-
-2001-03-19 Tom Tromey <tromey@redhat.com>
-
- * Makefile.in: Rebuilt.
- * Makefile.am (ffitest_LDFLAGS): New macro.
-
-2001-03-02 Nick Clifton <nickc@redhat.com>
-
- * include/ffi.h.in: Remove RCS ident string.
- * include/ffi_mips.h: Remove RCS ident string.
- * src/debug.c: Remove RCS ident string.
- * src/ffitest.c: Remove RCS ident string.
- * src/prep_cif.c: Remove RCS ident string.
- * src/types.c: Remove RCS ident string.
- * src/alpha/ffi.c: Remove RCS ident string.
- * src/alpha/osf.S: Remove RCS ident string.
- * src/arm/ffi.c: Remove RCS ident string.
- * src/arm/sysv.S: Remove RCS ident string.
- * src/mips/ffi.c: Remove RCS ident string.
- * src/mips/n32.S: Remove RCS ident string.
- * src/mips/o32.S: Remove RCS ident string.
- * src/sparc/ffi.c: Remove RCS ident string.
- * src/sparc/v8.S: Remove RCS ident string.
- * src/sparc/v9.S: Remove RCS ident string.
- * src/x86/ffi.c: Remove RCS ident string.
- * src/x86/sysv.S: Remove RCS ident string.
-
-2001-02-08 Joseph S. Myers <jsm28@cam.ac.uk>
-
- * include/ffi.h.in: Change sourceware.cygnus.com references to
- gcc.gnu.org.
-
-2000-12-09 Richard Henderson <rth@redhat.com>
-
- * src/alpha/ffi.c (ffi_call): Simplify struct return test.
- (ffi_closure_osf_inner): Index rather than increment avalue
- and arg_types. Give ffi_closure_osf the raw return value type.
- * src/alpha/osf.S (ffi_closure_osf): Handle return value type
- promotion.
-
-2000-12-07 Richard Henderson <rth@redhat.com>
-
- * src/raw_api.c (ffi_translate_args): Fix typo.
- (ffi_prep_closure): Likewise.
-
- * include/ffi.h.in [ALPHA]: Define FFI_CLOSURES and
- FFI_TRAMPOLINE_SIZE.
- * src/alpha/ffi.c (ffi_prep_cif_machdep): Adjust minimal
- cif->bytes for new ffi_call_osf implementation.
- (ffi_prep_args): Absorb into ...
- (ffi_call): ... here. Do all stack allocation here and
- avoid a callback function.
- (ffi_prep_closure, ffi_closure_osf_inner): New.
- * src/alpha/osf.S (ffi_call_osf): Reimplement with no callback.
- (ffi_closure_osf): New.
-
-2000-09-10 Alexandre Oliva <aoliva@redhat.com>
-
- * config.guess, config.sub, install-sh: Removed.
- * ltconfig, ltmain.sh, missing, mkinstalldirs: Likewise.
- * Makefile.in: Rebuilt.
-
- * acinclude.m4: Include libtool macros from the top level.
- * aclocal.m4, configure: Rebuilt.
-
-2000-08-22 Alexandre Oliva <aoliva@redhat.com>
-
- * configure.in [i*86-*-freebsd*] (TARGET, TARGETDIR): Set.
- * configure: Rebuilt.
-
-2000-05-11 Scott Bambrough <scottb@netwinder.org>
-
- * libffi/src/arm/sysv.S (ffi_call_SYSV): Doubles are not saved to
- memory correctly. Use conditional instructions, not branches where
- possible.
-
-2000-05-04 Tom Tromey <tromey@cygnus.com>
-
- * configure: Rebuilt.
- * configure.in: Match `arm*-*-linux-*'.
- From Chris Dornan <cdornan@arm.com>.
-
-2000-04-28 Jakub Jelinek <jakub@redhat.com>
-
- * Makefile.am (SUBDIRS): Define.
- (AM_MAKEFLAGS): Likewise.
- (Multilib support.): Add section.
- * Makefile.in: Rebuilt.
- * ltconfig (extra_compiler_flags, extra_compiler_flags_value):
- New variables. Set for gcc using -print-multi-lib. Export them
- to libtool.
- (sparc64-*-linux-gnu*): Use libsuff 64 for search paths.
- * ltmain.sh (B|b|V): Don't throw away gcc's -B, -b and -V options
- for -shared links.
- (extra_compiler_flags_value, extra_compiler_flags): Check these
- for extra compiler options which need to be passed down in
- compiler_flags.
-
-2000-04-16 Anthony Green <green@redhat.com>
-
- * configure: Rebuilt.
- * configure.in: Change i*86-pc-linux* to i*86-*-linux*.
-
-2000-04-14 Jakub Jelinek <jakub@redhat.com>
-
- * include/ffi.h.in (SPARC64): Define for 64bit SPARC builds.
- Set SPARC FFI_DEFAULT_ABI based on SPARC64 define.
- * src/sparc/ffi.c (ffi_prep_args_v8): Renamed from ffi_prep_args.
- Replace all void * sizeofs with sizeof(int).
- Only compare type with FFI_TYPE_LONGDOUBLE if LONGDOUBLE is
- different than DOUBLE.
- Remove FFI_TYPE_SINT32 and FFI_TYPE_UINT32 cases (handled elsewhere).
- (ffi_prep_args_v9): New function.
- (ffi_prep_cif_machdep): Handle V9 ABI and long long on V8.
- (ffi_V9_return_struct): New function.
- (ffi_call): Handle FFI_V9 ABI from 64bit code and FFI_V8 ABI from
- 32bit code (not yet cross-arch calls).
- * src/sparc/v8.S: Add struct return delay nop.
- Handle long long.
- * src/sparc/v9.S: New file.
- * src/prep_cif.c (ffi_prep_cif): Return structure pointer
- is used on sparc64 only for structures larger than 32 bytes.
- Pass by reference for structures is done for structure arguments
- larger than 16 bytes.
- * src/ffitest.c (main): Use 64bit rint on sparc64.
- Run long long tests on sparc.
- * src/types.c (FFI_TYPE_POINTER): Pointer is 64bit on alpha and
- sparc64.
- (FFI_TYPE_LONGDOUBLE): long double is 128 bit aligned to 128 bits
- on sparc64.
- * configure.in (sparc-*-linux*): New supported target.
- (sparc64-*-linux*): Likewise.
- * configure: Rebuilt.
- * Makefile.am: Add v9.S to SPARC files.
- * Makefile.in: Likewise.
- (LINK): Surround $(CCLD) into double quotes, so that multilib
- compiles work correctly.
-
-2000-04-04 Alexandre Petit-Bianco <apbianco@cygnus.com>
-
- * configure: Rebuilt.
- * configure.in: (i*86-*-solaris*): New libffi target. Patch
- proposed by Bryce McKinlay.
-
-2000-03-20 Tom Tromey <tromey@cygnus.com>
-
- * Makefile.in: Hand edit for java_raw_api.lo.
-
-2000-03-08 Bryce McKinlay <bryce@albatross.co.nz>
-
- * config.guess, config.sub: Update from the gcc tree.
- Fix for PR libgcj/168.
-
-2000-03-03 Tom Tromey <tromey@cygnus.com>
-
- * Makefile.in: Fixed ia64 by hand.
-
- * configure: Rebuilt.
- * configure.in (--enable-multilib): New option.
- (libffi_basedir): New subst.
- (AC_OUTPUT): Added multilib code.
-
-2000-03-02 Tom Tromey <tromey@cygnus.com>
-
- * Makefile.in: Rebuilt.
- * Makefile.am (TARGET_SRC_IA64): Use `ia64', not `alpha', as
- directory name.
-
-2000-02-25 Hans Boehm <boehm@acm.org>
-
- * src/ia64/ffi.c, src/ia64/ia64_flags.h, src/ia64/unix.S: New
- files.
- * src/raw_api.c (ffi_translate_args): Fixed typo in argument
- list.
- (ffi_prep_raw_closure): Use ffi_translate_args, not
- ffi_closure_translate.
- * src/java_raw_api.c: New file.
- * src/ffitest.c (closure_test_fn): New function.
- (main): Define `rint' as long long on IA64. Added new test when
- FFI_CLOSURES is defined.
- * include/ffi.h.in (ALIGN): Use size_t, not unsigned.
- (ffi_abi): Recognize IA64.
- (ffi_raw): Added `flt' field.
- Added "Java raw API" code.
- * configure.in: Recognize ia64.
- * Makefile.am (TARGET_SRC_IA64): New macro.
- (libffi_la_common_SOURCES): Added java_raw_api.c.
- (libffi_la_SOURCES): Define in IA64 case.
-
-2000-01-04 Tom Tromey <tromey@cygnus.com>
-
- * Makefile.in: Rebuilt with newer automake.
-
-1999-12-31 Tom Tromey <tromey@cygnus.com>
-
- * Makefile.am (INCLUDES): Added -I$(top_srcdir)/src.
-
-1999-09-01 Tom Tromey <tromey@cygnus.com>
-
- * include/ffi.h.in: Removed PACKAGE and VERSION defines and
- undefs.
- * fficonfig.h.in: Rebuilt.
- * configure: Rebuilt.
- * configure.in: Pass 3rd argument to AM_INIT_AUTOMAKE.
- Use AM_PROG_LIBTOOL (automake 1.4 compatibility).
- * acconfig.h: Don't #undef PACKAGE or VERSION.
-
-1999-08-09 Anthony Green <green@cygnus.com>
-
- * include/ffi.h.in: Try to work around messy header problem
- with PACKAGE and VERSION.
-
- * configure: Rebuilt.
- * configure.in: Change version to 2.00-beta.
-
- * fficonfig.h.in: Rebuilt.
- * acconfig.h (FFI_NO_STRUCTS, FFI_NO_RAW_API): Define.
-
- * src/x86/ffi.c (ffi_raw_call): Rename.
-
-1999-08-02 Kresten Krab Thorup <krab@dominiq.is.s.u-tokyo.ac.jp>
-
- * src/x86/ffi.c (ffi_closure_SYSV): New function.
- (ffi_prep_incoming_args_SYSV): Ditto.
- (ffi_prep_closure): Ditto.
- (ffi_closure_raw_SYSV): Ditto.
- (ffi_prep_raw_closure): More ditto.
- (ffi_call_raw): Final ditto.
-
- * include/ffi.h.in: Add definitions for closure and raw API.
-
- * src/x86/ffi.c (ffi_prep_cif_machdep): Added case for
- FFI_TYPE_UINT64.
-
- * Makefile.am (libffi_la_common_SOURCES): Added raw_api.c
-
- * src/raw_api.c: New file.
-
- * include/ffi.h.in (ffi_raw): New type.
- (UINT_ARG, SINT_ARG): New defines.
- (ffi_closure, ffi_raw_closure): New types.
- (ffi_prep_closure, ffi_prep_raw_closure): New declarations.
-
- * configure.in: Add check for endianness and sizeof void*.
-
- * src/x86/sysv.S (ffi_call_SYSV): Call fixup routine via argument,
- instead of directly.
-
- * configure: Rebuilt.
-
-Thu Jul 8 14:28:42 1999 Anthony Green <green@cygnus.com>
-
- * configure.in: Add x86 and powerpc BeOS configurations.
- From Makoto Kato <m_kato@ga2.so-net.ne.jp>.
-
-1999-05-09 Anthony Green <green@cygnus.com>
-
- * configure.in: Add warning about this being beta code.
- Remove src/Makefile.am from the picture.
- * configure: Rebuilt.
-
- * Makefile.am: Move logic from src/Makefile.am. Add changes
- to support libffi as a target library.
- * Makefile.in: Rebuilt.
-
- * aclocal.m4, config.guess, config.sub, ltconfig, ltmain.sh:
- Upgraded to new autoconf, automake, libtool.
-
- * README: Tweaks.
-
- * LICENSE: Update copyright date.
-
- * src/Makefile.am, src/Makefile.in: Removed.
-
-1998-11-29 Anthony Green <green@cygnus.com>
-
- * include/ChangeLog: Removed.
- * src/ChangeLog: Removed.
- * src/mips/ChangeLog: Removed.
- * src/sparc/ChangeLog: Remboved.
- * src/x86/ChangeLog: Removed.
-
- * ChangeLog.v1: Created.
diff --git a/Modules/_ctypes/libffi/ChangeLog.libgcj b/Modules/_ctypes/libffi/ChangeLog.libgcj
deleted file mode 100644
index ea5d02f19b..0000000000
--- a/Modules/_ctypes/libffi/ChangeLog.libgcj
+++ /dev/null
@@ -1,40 +0,0 @@
-2004-01-14 Kelley Cook <kcook@gcc.gnu.org>
-
- * configure.in: Add in AC_PREREQ(2.13)
-
-2003-02-20 Alexandre Oliva <aoliva@redhat.com>
-
- * configure.in: Propagate ORIGINAL_LD_FOR_MULTILIBS to
- config.status.
- * configure: Rebuilt.
-
-2002-01-27 Alexandre Oliva <aoliva@redhat.com>
-
- * configure.in (toolexecdir, toolexeclibdir): Set and AC_SUBST.
- Remove USE_LIBDIR conditional.
- * Makefile.am (toolexecdir, toolexeclibdir): Don't override.
- * Makefile.in, configure: Rebuilt.
-
-Mon Aug 9 18:33:38 1999 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
-
- * include/Makefile.in: Rebuilt.
- * Makefile.in: Rebuilt
- * Makefile.am (toolexeclibdir): Add $(MULTISUBDIR) even for native
- builds.
- Use USE_LIBDIR.
-
- * configure: Rebuilt.
- * configure.in (USE_LIBDIR): Define for native builds.
- Use lowercase in configure --help explanations.
-
-1999-08-08 Anthony Green <green@cygnus.com>
-
- * include/ffi.h.in (FFI_FN): Remove `...'.
-
-1999-08-08 Anthony Green <green@cygnus.com>
-
- * Makefile.in: Rebuilt.
- * Makefile.am (AM_CFLAGS): Compile with -fexceptions.
-
- * src/x86/sysv.S: Add exception handling metadata.
-
diff --git a/Modules/_ctypes/libffi/ChangeLog.v1 b/Modules/_ctypes/libffi/ChangeLog.v1
deleted file mode 100644
index af3a377568..0000000000
--- a/Modules/_ctypes/libffi/ChangeLog.v1
+++ /dev/null
@@ -1,764 +0,0 @@
-The libffi version 1 ChangeLog archive.
-
-Version 1 of libffi had per-directory ChangeLogs. Current and future
-versions have a single ChangeLog file in the root directory. The
-version 1 ChangeLogs have all been concatenated into this file for
-future reference only.
-
---- libffi ----------------------------------------------------------------
-
-Mon Oct 5 02:17:50 1998 Anthony Green <green@cygnus.com>
-
- * configure.in: Boosted rev.
- * configure, Makefile.in, aclocal.m4: Rebuilt.
- * README: Boosted rev and updated release notes.
-
-Mon Oct 5 01:03:03 1998 Anthony Green <green@cygnus.com>
-
- * configure.in: Boosted rev.
- * configure, Makefile.in, aclocal.m4: Rebuilt.
- * README: Boosted rev and updated release notes.
-
-1998-07-25 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
-
- * m68k/ffi.c (ffi_prep_cif_machdep): Use bitmask for cif->flags.
- Correctly handle small structures.
- (ffi_prep_args): Also handle small structures.
- (ffi_call): Pass size of return type to ffi_call_SYSV.
- * m68k/sysv.S: Adjust for above changes. Correctly align small
- structures in the return value.
-
- * types.c (uint64, sint64) [M68K]: Change alignment to 4.
-
-Fri Apr 17 17:26:58 1998 Anthony Green <green@hoser.cygnus.com>
-
- * configure.in: Boosted rev.
- * configure,Makefile.in,aclocal.m4: Rebuilt.
- * README: Boosted rev and added release notes.
-
-Sun Feb 22 00:50:41 1998 Geoff Keating <geoffk@ozemail.com.au>
-
- * configure.in: Add PowerPC config bits.
-
-1998-02-14 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
-
- * configure.in: Add m68k config bits. Change AC_CANONICAL_SYSTEM
- to AC_CANONICAL_HOST, this is not a compiler. Use $host instead
- of $target. Remove AC_CHECK_SIZEOF(char), we already know the
- result. Fix argument of AC_ARG_ENABLE.
- * configure, fficonfig.h.in: Rebuilt.
-
-Tue Feb 10 20:53:40 1998 Richard Henderson <rth@cygnus.com>
-
- * configure.in: Add Alpha config bits.
-
-Tue May 13 13:39:20 1997 Anthony Green <green@hoser.cygnus.com>
-
- * README: Updated dates and reworded Irix comments.
-
- * configure.in: Removed AC_PROG_RANLIB.
-
- * Makefile.in, aclocal.m4, config.guess, config.sub, configure,
- ltmain.sh, */Makefile.in: libtoolized again and rebuilt with
- automake and autoconf.
-
-Sat May 10 18:44:50 1997 Tom Tromey <tromey@cygnus.com>
-
- * configure, aclocal.m4: Rebuilt.
- * configure.in: Don't compute EXTRADIST; now handled in
- src/Makefile.in. Removed macros implied by AM_INIT_AUTOMAKE.
- Don't run AM_MAINTAINER_MODE.
-
-Thu May 8 14:34:05 1997 Anthony Green <green@hoser.cygnus.com>
-
- * missing, ltmain.sh, ltconfig.sh: Created. These are new files
- required by automake and libtool.
-
- * README: Boosted rev to 1.14. Added notes.
-
- * acconfig.h: Moved PACKAGE and VERSION for new automake.
-
- * configure.in: Changes for libtool.
-
- * Makefile.am (check): make test now make check. Uses libtool now.
-
- * Makefile.in, configure.in, aclocal.h, fficonfig.h.in: Rebuilt.
-
-Thu May 1 16:27:07 1997 Anthony Green <green@hoser.cygnus.com>
-
- * missing: Added file required by new automake.
-
-Tue Nov 26 14:10:42 1996 Anthony Green <green@csk3.cygnus.com>
-
- * acconfig.h: Added USING_PURIFY flag. This is defined when
- --enable-purify-safety was used at configure time.
-
- * configure.in (allsources): Added --enable-purify-safety switch.
- (VERSION): Boosted rev to 1.13.
- * configure: Rebuilt.
-
-Fri Nov 22 06:46:12 1996 Anthony Green <green@rtl.cygnus.com>
-
- * configure.in (VERSION): Boosted rev to 1.12.
- Removed special CFLAGS hack for gcc.
- * configure: Rebuilt.
-
- * README: Boosted rev to 1.12. Added notes.
-
- * Many files: Cygnus Support changed to Cygnus Solutions.
-
-Wed Oct 30 11:15:25 1996 Anthony Green <green@rtl.cygnus.com>
-
- * configure.in (VERSION): Boosted rev to 1.11.
- * configure: Rebuilt.
-
- * README: Boosted rev to 1.11. Added notes about GNU make.
-
-Tue Oct 29 12:25:12 1996 Anthony Green <green@rtl.cygnus.com>
-
- * configure.in: Fixed -Wall trick.
- (VERSION): Boosted rev.
- * configure: Rebuilt
-
- * acconfig.h: Needed for --enable-debug configure switch.
-
- * README: Boosted rev to 1.09. Added more notes on building
- libffi, and LCLint.
-
- * configure.in: Added --enable-debug switch. Boosted rev to
- 1.09.
- * configure: Rebuilt
-
-Tue Oct 15 13:11:28 1996 Anthony Green <green@hoser.cygnus.com>
-
- * configure.in (VERSION): Boosted rev to 1.08
- * configure: Rebuilt.
-
- * README: Added n32 bug fix notes.
-
- * Makefile.am: Added "make lint" production.
- * Makefile.in: Rebuilt.
-
-Mon Oct 14 10:54:46 1996 Anthony Green <green@rtl.cygnus.com>
-
- * README: Added web page reference.
-
- * configure.in, README: Boosted rev to 1.05
- * configure: Rebuilt.
-
- * README: Fixed n32 sample code.
-
-Fri Oct 11 17:09:28 1996 Anthony Green <green@rtl.cygnus.com>
-
- * README: Added sparc notes.
-
- * configure.in, README: Boosted rev to 1.04.
- * configure: Rebuilt.
-
-Thu Oct 10 10:31:03 1996 Anthony Green <green@rtl.cygnus.com>
-
- * configure.in, README: Boosted rev to 1.03.
- * configure: Rebuilt.
-
- * README: Added struct notes.
-
- * Makefile.am (EXTRA_DIST): Added LICENSE to distribution.
- * Makefile.in: Rebuilt.
-
- * README: Removed Linux section. No special notes now
- because aggregates arg/return types work.
-
-Wed Oct 9 16:16:42 1996 Anthony Green <green@rtl.cygnus.com>
-
- * README, configure.in (VERSION): Boosted rev to 1.02
- * configure: Rebuilt.
-
-Tue Oct 8 11:56:33 1996 Anthony Green <green@rtl.cygnus.com>
-
- * README (NOTE): Added n32 notes.
-
- * Makefile.am: Added test production.
- * Makefile: Rebuilt
-
- * README: spell checked!
-
- * configure.in (VERSION): Boosted rev to 1.01
- * configure: Rebuilt.
-
-Mon Oct 7 15:50:22 1996 Anthony Green <green@rtl.cygnus.com>
-
- * configure.in: Added nasty bit to support SGI tools.
- * configure: Rebuilt.
-
- * README: Added SGI notes. Added note about automake bug.
-
-Mon Oct 7 11:00:28 1996 Anthony Green <green@hoser.cygnus.com>
-
- * README: Rewrote intro, and fixed examples.
-
-Fri Oct 4 10:19:55 1996 Anthony Green <green@hoser.cygnus.com>
-
- * configure.in: -D$TARGET is no longer used as a compiler switch.
- It is now inserted into ffi.h at configure time.
- * configure: Rebuilt.
-
- * FFI_ABI and FFI_STATUS are now ffi_abi and ffi_status.
-
-Thu Oct 3 13:47:34 1996 Anthony Green <green@hoser.cygnus.com>
-
- * README, LICENSE: Created. Wrote some docs.
-
- * configure.in: Don't barf on i586-unknown-linuxaout.
- Added EXTRADIST code for "make dist".
- * configure: Rebuilt.
-
- * */Makefile.in: Rebuilt with patched automake.
-
-Tue Oct 1 17:12:25 1996 Anthony Green <green@rtl.cygnus.com>
-
- * Makefile.am, aclocal.m4, config.guess, config.sub,
- configure.in, fficonfig.h.in, install-sh, mkinstalldirs,
- stamp-h.in: Created
- * Makefile.in, configure: Generated
-
---- libffi/include --------------------------------------------------------
-
-Tue Feb 24 13:09:36 1998 Anthony Green <green@gerbil.cygnus.com>
-
- * ffi_mips.h: Updated FFI_TYPE_STRUCT_* values based on
- ffi.h.in changes. This is a work-around for SGI's "simple"
- assembler.
-
-Sun Feb 22 00:51:55 1998 Geoff Keating <geoffk@ozemail.com.au>
-
- * ffi.h.in: PowerPC support.
-
-1998-02-14 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
-
- * ffi.h.in: Add m68k support.
- (FFI_TYPE_LONGDOUBLE): Make it a separate value.
-
-Tue Feb 10 20:55:16 1998 Richard Henderson <rth@cygnus.com>
-
- * ffi.h.in (SIZEOF_ARG): Use a pointer type by default.
-
- * ffi.h.in: Alpha support.
-
-Fri Nov 22 06:48:45 1996 Anthony Green <green@rtl.cygnus.com>
-
- * ffi.h.in, ffi_common.h: Cygnus Support -> Cygnus Solutions.
-
-Wed Nov 20 22:31:01 1996 Anthony Green <green@hoser.cygnus.com>
-
- * ffi.h.in: Added ffi_type_void definition.
-
-Tue Oct 29 12:22:40 1996 Anthony Green <green@rtl.cygnus.com>
-
- * Makefile.am (hack_DATA): Always install ffi_mips.h.
-
- * ffi.h.in: Removed FFI_DEBUG. It's now in the correct
- place (acconfig.h).
- Added #include <stddef.h> for size_t definition.
-
-Tue Oct 15 17:23:35 1996 Anthony Green <green@hoser.cygnus.com>
-
- * ffi.h.in, ffi_common.h, ffi_mips.h: More clean up.
- Commented out #define of FFI_DEBUG.
-
-Tue Oct 15 13:01:06 1996 Anthony Green <green@rtl.cygnus.com>
-
- * ffi_common.h: Added bool definition.
-
- * ffi.h.in, ffi_common.h: Clean up based on LCLint output.
- Added funny /*@...@*/ comments to annotate source.
-
-Mon Oct 14 12:29:23 1996 Anthony Green <green@rtl.cygnus.com>
-
- * ffi.h.in: Interface changes based on feedback from Jim
- Blandy.
-
-Fri Oct 11 16:49:35 1996 Anthony Green <green@rtl.cygnus.com>
-
- * ffi.h.in: Small change for sparc support.
-
-Thu Oct 10 14:53:37 1996 Anthony Green <green@rtl.cygnus.com>
-
- * ffi_mips.h: Added FFI_TYPE_STRUCT_* definitions for
- special structure return types.
-
-Wed Oct 9 13:55:57 1996 Anthony Green <green@rtl.cygnus.com>
-
- * ffi.h.in: Added SIZEOF_ARG definition for X86
-
-Tue Oct 8 11:40:36 1996 Anthony Green <green@rtl.cygnus.com>
-
- * ffi.h.in (FFI_FN): Added macro for eliminating compiler warnings.
- Use it to case your function pointers to the proper type.
-
- * ffi_mips.h (SIZEOF_ARG): Added magic to fix type promotion bug.
-
- * Makefile.am (EXTRA_DIST): Added ffi_mips.h to EXTRA_DIST.
- * Makefile: Rebuilt.
-
- * ffi_mips.h: Created. Moved all common mips definitions here.
-
-Mon Oct 7 10:58:12 1996 Anthony Green <green@hoser.cygnus.com>
-
- * ffi.h.in: The SGI assember is very picky about parens. Redefined
- some macros to avoid problems.
-
- * ffi.h.in: Added FFI_DEFAULT_ABI definitions. Also added
- externs for pointer, and 64bit integral ffi_types.
-
-Fri Oct 4 09:51:37 1996 Anthony Green <green@hoser.cygnus.com>
-
- * ffi.h.in: Added FFI_ABI member to ffi_cif and changed
- function prototypes accordingly.
- Added #define @TARGET@. Now programs including ffi.h don't
- have to specify this themselves.
-
-Thu Oct 3 15:36:44 1996 Anthony Green <green@hoser.cygnus.com>
-
- * ffi.h.in: Changed ffi_prep_cif's values from void* to void**
-
- * Makefile.am (EXTRA_DIST): Added EXTRA_DIST for "make dist"
- to work.
- * Makefile.in: Regenerated.
-
-Wed Oct 2 10:16:59 1996 Anthony Green <green@hoser.cygnus.com>
-
- * Makefile.am: Created
- * Makefile.in: Generated
-
- * ffi_common.h: Added rcsid comment
-
-Tue Oct 1 17:13:51 1996 Anthony Green <green@rtl.cygnus.com>
-
- * ffi.h.in, ffi_common.h: Created
-
---- libffi/src ------------------------------------------------------------
-
-Mon Oct 5 02:17:50 1998 Anthony Green <green@cygnus.com>
-
- * arm/ffi.c, arm/sysv.S: Created.
-
- * Makefile.am: Added arm files.
- * Makefile.in: Rebuilt.
-
-Mon Oct 5 01:41:38 1998 Anthony Green <green@rtl.cygnus.com>
-
- * Makefile.am (libffi_la_LDFLAGS): Incremented revision.
-
-Sun Oct 4 16:27:17 1998 Anthony Green <green@cygnus.com>
-
- * alpha/osf.S (ffi_call_osf): Patch for DU assembler.
-
- * ffitest.c (main): long long and long double return values work
- for x86.
-
-Fri Apr 17 11:50:58 1998 Anthony Green <green@hoser.cygnus.com>
-
- * Makefile.in: Rebuilt.
-
- * ffitest.c (main): Floating point tests not executed for systems
- with broken lond double (SunOS 4 w/ GCC).
-
- * types.c: Fixed x86 alignment info for long long types.
-
-Thu Apr 16 07:15:28 1998 Anthony Green <green@ada.cygnus.com>
-
- * ffitest.c: Added more notes about GCC bugs under Irix 6.
-
-Wed Apr 15 08:42:22 1998 Anthony Green <green@hoser.cygnus.com>
-
- * ffitest.c (struct5): New test function.
- (main): New test with struct5.
-
-Thu Mar 5 10:48:11 1998 Anthony Green <green@tootie.to.cygnus.com>
-
- * prep_cif.c (initialize_aggregate): Fix assertion for
- nested structures.
-
-Tue Feb 24 16:33:41 1998 Anthony Green <green@hoser.cygnus.com>
-
- * prep_cif.c (ffi_prep_cif): Added long double support for sparc.
-
-Sun Feb 22 00:52:18 1998 Geoff Keating <geoffk@ozemail.com.au>
-
- * powerpc/asm.h: New file.
- * powerpc/ffi.c: New file.
- * powerpc/sysv.S: New file.
- * Makefile.am: PowerPC port.
- * ffitest.c (main): Allow all tests to run even in presence of gcc
- bug on PowerPC.
-
-1998-02-17 Anthony Green <green@hoser.cygnus.com>
-
- * mips/ffi.c: Fixed comment typo.
-
- * x86/ffi.c (ffi_prep_cif_machdep), x86/sysv.S (retfloat):
- Fixed x86 long double return handling.
-
- * types.c: Fixed x86 long double alignment info.
-
-1998-02-14 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
-
- * types.c: Add m68k support.
-
- * ffitest.c (floating): Add long double parameter.
- (return_ll, ldblit): New functions to test long long and long
- double return value.
- (main): Fix type error in assignment of ts[1-4]_type.elements.
- Add tests for long long and long double arguments and return
- values.
-
- * prep_cif.c (ffi_prep_cif) [M68K]: Don't allocate argument for
- struct value pointer.
-
- * m68k/ffi.c, m68k/sysv.S: New files.
- * Makefile.am: Add bits for m68k port. Add kludge to work around
- automake deficiency.
- (test): Don't require "." in $PATH.
- * Makefile.in: Rebuilt.
-
-Wed Feb 11 07:36:50 1998 Anthony Green <green@hoser.cygnus.com>
-
- * Makefile.in: Rebuilt.
-
-Tue Feb 10 20:56:00 1998 Richard Henderson <rth@cygnus.com>
-
- * alpha/ffi.c, alpha/osf.S: New files.
- * Makefile.am: Alpha port.
-
-Tue Nov 18 14:12:07 1997 Anthony Green <green@hoser.cygnus.com>
-
- * mips/ffi.c (ffi_prep_cif_machdep): Initialize rstruct_flag
- for n32.
-
-Tue Jun 3 17:18:20 1997 Anthony Green <green@hoser.cygnus.com>
-
- * ffitest.c (main): Added hack to get structure tests working
- correctly.
-
-Sat May 10 19:06:42 1997 Tom Tromey <tromey@cygnus.com>
-
- * Makefile.in: Rebuilt.
- * Makefile.am (EXTRA_DIST): Explicitly list all distributable
- files in subdirs.
- (VERSION, CC): Removed.
-
-Thu May 8 17:19:01 1997 Anthony Green <green@hoser.cygnus.com>
-
- * Makefile.am: Many changes for new automake and libtool.
- * Makefile.in: Rebuilt.
-
-Fri Nov 22 06:57:56 1996 Anthony Green <green@rtl.cygnus.com>
-
- * ffitest.c (main): Fixed test case for non mips machines.
-
-Wed Nov 20 22:31:59 1996 Anthony Green <green@hoser.cygnus.com>
-
- * types.c: Added ffi_type_void declaration.
-
-Tue Oct 29 13:07:19 1996 Anthony Green <green@rtl.cygnus.com>
-
- * ffitest.c (main): Fixed character constants.
- (main): Emit warning for structure test 3 failure on Sun.
-
- * Makefile.am (VPATH): Fixed VPATH def'n so automake won't
- strip it out.
- Moved distdir hack from libffi to automake.
- (ffitest): Added missing -c for $(COMPILE) (change in automake).
- * Makefile.in: Rebuilt.
-
-Tue Oct 15 13:08:20 1996 Anthony Green <green@hoser.cygnus.com>
-
- * Makefile.am: Added "make lint" production.
- * Makefile.in: Rebuilt.
-
- * prep_cif.c (STACK_ARG_SIZE): Improved STACK_ARG_SIZE macro.
- Clean up based on LCLint output. Added funny /*@...@*/ comments to
- annotate source.
-
- * ffitest.c, debug.c: Cleaned up code.
-
-Mon Oct 14 12:26:56 1996 Anthony Green <green@rtl.cygnus.com>
-
- * ffitest.c: Changes based on interface changes.
-
- * prep_cif.c (ffi_prep_cif): Cleaned up interface based on
- feedback from Jim Blandy.
-
-Fri Oct 11 15:53:18 1996 Anthony Green <green@rtl.cygnus.com>
-
- * ffitest.c: Reordered tests while porting to sparc.
- Made changes to handle lame structure passing for sparc.
- Removed calls to fflush().
-
- * prep_cif.c (ffi_prep_cif): Added special case for sparc
- aggregate type arguments.
-
-Thu Oct 10 09:56:51 1996 Anthony Green <green@rtl.cygnus.com>
-
- * ffitest.c (main): Added structure passing/returning tests.
-
- * prep_cif.c (ffi_prep_cif): Perform proper initialization
- of structure return types if needed.
- (initialize_aggregate): Bug fix
-
-Wed Oct 9 16:04:20 1996 Anthony Green <green@rtl.cygnus.com>
-
- * types.c: Added special definitions for x86 (double doesn't
- need double word alignment).
-
- * ffitest.c: Added many tests
-
-Tue Oct 8 09:19:22 1996 Anthony Green <green@rtl.cygnus.com>
-
- * prep_cif.c (ffi_prep_cif): Fixed assertion.
-
- * debug.c (ffi_assert): Must return a non void now.
-
- * Makefile.am: Added test production.
- * Makefile: Rebuilt.
-
- * ffitest.c (main): Created.
-
- * types.c: Created. Stripped common code out of */ffi.c.
-
- * prep_cif.c: Added missing stdlib.h include.
-
- * debug.c (ffi_type_test): Used "a" to eliminate compiler
- warnings in non-debug builds. Included ffi_common.h.
-
-Mon Oct 7 15:36:42 1996 Anthony Green <green@rtl.cygnus.com>
-
- * Makefile.am: Added a rule for .s -> .o
- This is required by the SGI compiler.
- * Makefile: Rebuilt.
-
-Fri Oct 4 09:51:08 1996 Anthony Green <green@hoser.cygnus.com>
-
- * prep_cif.c (initialize_aggregate): Moved abi specification
- to ffi_prep_cif().
-
-Thu Oct 3 15:37:37 1996 Anthony Green <green@hoser.cygnus.com>
-
- * prep_cif.c (ffi_prep_cif): Changed values from void* to void**.
- (initialize_aggregate): Fixed aggregate type initialization.
-
- * Makefile.am (EXTRA_DIST): Added support code for "make dist".
- * Makefile.in: Regenerated.
-
-Wed Oct 2 11:41:57 1996 Anthony Green <green@hoser.cygnus.com>
-
- * debug.c, prep_cif: Created.
-
- * Makefile.am: Added debug.o and prep_cif.o to OBJ.
- * Makefile.in: Regenerated.
-
- * Makefile.am (INCLUDES): Added missing -I../include
- * Makefile.in: Regenerated.
-
-Tue Oct 1 17:11:51 1996 Anthony Green <green@rtl.cygnus.com>
-
- * error.c, Makefile.am: Created.
- * Makefile.in: Generated.
-
---- libffi/src/x86 --------------------------------------------------------
-
-Sun Oct 4 16:27:17 1998 Anthony Green <green@cygnus.com>
-
- * sysv.S (retlongdouble): Fixed long long return value support.
- * ffi.c (ffi_prep_cif_machdep): Ditto.
-
-Wed May 13 04:30:33 1998 Anthony Green <green@raft.ppp.tsoft.net>
-
- * ffi.c (ffi_prep_cif_machdep): Fixed long double return value
- support.
-
-Wed Apr 15 08:43:20 1998 Anthony Green <green@hoser.cygnus.com>
-
- * ffi.c (ffi_prep_args): small struct support was missing.
-
-Thu May 8 16:53:58 1997 Anthony Green <green@hoser.cygnus.com>
-
- * objects.mak: Removed.
-
-Mon Dec 2 15:12:58 1996 Tom Tromey <tromey@cygnus.com>
-
- * sysv.S: Use .balign, for a.out Linux boxes.
-
-Tue Oct 15 13:06:50 1996 Anthony Green <green@hoser.cygnus.com>
-
- * ffi.c: Clean up based on LCLint output.
- Added funny /*@...@*/ comments to annotate source.
-
-Fri Oct 11 16:43:38 1996 Anthony Green <green@rtl.cygnus.com>
-
- * ffi.c (ffi_call): Added assertion for bad ABIs.
-
-Wed Oct 9 13:57:27 1996 Anthony Green <green@rtl.cygnus.com>
-
- * sysv.S (retdouble): Fixed double return problems.
-
- * ffi.c (ffi_call): Corrected fn arg definition.
- (ffi_prep_cif_machdep): Fixed double return problems
-
-Tue Oct 8 12:12:49 1996 Anthony Green <green@rtl.cygnus.com>
-
- * ffi.c: Moved ffi_type definitions to types.c.
- (ffi_prep_args): Fixed type promotion bug.
-
-Mon Oct 7 15:53:06 1996 Anthony Green <green@rtl.cygnus.com>
-
- * ffi.c (FFI_*_TYPEDEF): Removed redundant ';'
-
-Fri Oct 4 09:54:53 1996 Anthony Green <green@hoser.cygnus.com>
-
- * ffi.c (ffi_call): Removed FFI_ABI arg, and swapped
- remaining args.
-
-Wed Oct 2 10:07:05 1996 Anthony Green <green@hoser.cygnus.com>
-
- * ffi.c, sysv.S, objects.mak: Created.
- (ffi_prep_cif): cif->rvalue no longer initialized to NULL.
- (ffi_prep_cif_machdep): Moved machine independent cif processing
- to src/prep_cif.c. Introduced ffi_prep_cif_machdep().
-
---- libffi/src/mips -------------------------------------------------------
-
-Tue Feb 17 17:18:07 1998 Anthony Green <green@hoser.cygnus.com>
-
- * o32.S: Fixed typo in comment.
-
- * ffi.c (ffi_prep_cif_machdep): Fixed argument processing.
-
-Thu May 8 16:53:58 1997 Anthony Green <green@hoser.cygnus.com>
-
- * o32.s, n32.s: Wrappers for SGI tool support.
-
- * objects.mak: Removed.
-
-Tue Oct 29 14:37:45 1996 Anthony Green <green@rtl.cygnus.com>
-
- * ffi.c (ffi_prep_args): Changed int z to size_t z.
-
-Tue Oct 15 13:17:25 1996 Anthony Green <green@hoser.cygnus.com>
-
- * n32.S: Fixed bad stack munging.
-
- * ffi.c: Moved prototypes for ffi_call_?32() to here from
- ffi_mips.h because extended_cif is not defined in ffi_mips.h.
-
-Mon Oct 14 12:42:02 1996 Anthony Green <green@rtl.cygnus.com>
-
- * ffi.c: Interface changes based on feedback from Jim Blandy.
-
-Thu Oct 10 11:22:16 1996 Anthony Green <green@rtl.cygnus.com>
-
- * n32.S, ffi.c: Lots of changes to support passing and
- returning structures with the n32 calling convention.
-
- * n32.S: Fixed fn pointer bug.
-
- * ffi.c (ffi_prep_cif_machdep): Fix for o32 structure
- return values.
- (ffi_prep_args): Fixed n32 structure passing when structures
- partially fit in registers.
-
-Wed Oct 9 13:49:25 1996 Anthony Green <green@rtl.cygnus.com>
-
- * objects.mak: Added n32.o.
-
- * n32.S: Created.
-
- * ffi.c (ffi_prep_args): Added magic to support proper
- n32 processing.
-
-Tue Oct 8 10:37:35 1996 Anthony Green <green@rtl.cygnus.com>
-
- * ffi.c: Moved ffi_type definitions to types.c.
- (ffi_prep_args): Fixed type promotion bug.
-
- * o32.S: This code is only built for o32 compiles.
- A lot of the #define cruft has moved to ffi_mips.h.
-
- * ffi.c (ffi_prep_cif_machdep): Fixed arg flags. Second arg
- is only processed if the first is either a float or double.
-
-Mon Oct 7 15:33:59 1996 Anthony Green <green@rtl.cygnus.com>
-
- * o32.S: Modified to compile under each of o32, n32 and n64.
-
- * ffi.c (FFI_*_TYPEDEF): Removed redundant ';'
-
-Fri Oct 4 09:53:25 1996 Anthony Green <green@hoser.cygnus.com>
-
- * ffi.c (ffi_call): Removed FFI_ABI arg, and swapped
- remaining args.
-
-Wed Oct 2 17:41:22 1996 Anthony Green <green@rtl.cygnus.com>
-
- * o32.S: Removed crufty definitions.
-
-Wed Oct 2 12:53:42 1996 Anthony Green <green@hoser.cygnus.com>
-
- * ffi.c (ffi_prep_cif): cif->rvalue no longer initialized to NULL.
- (ffi_prep_cif_machdep): Moved all machine independent cif processing
- to src/prep_cif.c. Introduced ffi_prep_cif_machdep. Return types
- of FFI_TYPE_STRUCT are no different than FFI_TYPE_INT.
-
-Tue Oct 1 17:11:02 1996 Anthony Green <green@rtl.cygnus.com>
-
- * ffi.c, o32.S, object.mak: Created
-
---- libffi/src/sparc ------------------------------------------------------
-
-Tue Feb 24 16:33:18 1998 Anthony Green <green@hoser.cygnus.com>
-
- * ffi.c (ffi_prep_args): Added long double support.
-
-Thu May 8 16:53:58 1997 Anthony Green <green@hoser.cygnus.com>
-
- * objects.mak: Removed.
-
-Thu May 1 16:07:56 1997 Anthony Green <green@hoser.cygnus.com>
-
- * v8.S: Fixed minor portability problem reported by
- Russ McManus <mcmanr@eq.gs.com>.
-
-Tue Nov 26 14:12:43 1996 Anthony Green <green@csk3.cygnus.com>
-
- * v8.S: Used STACKFRAME define elsewhere.
-
- * ffi.c (ffi_prep_args): Zero out space when USING_PURIFY
- is set.
- (ffi_prep_cif_machdep): Allocate the correct stack frame
- space for functions with < 6 args.
-
-Tue Oct 29 15:08:55 1996 Anthony Green <green@rtl.cygnus.com>
-
- * ffi.c (ffi_prep_args): int z is now size_t z.
-
-Mon Oct 14 13:31:24 1996 Anthony Green <green@rtl.cygnus.com>
-
- * v8.S (ffi_call_V8): Gordon rewrites this again. It looks
- great now.
-
- * ffi.c (ffi_call): The comment about hijacked registers
- is no longer valid after gordoni hacked v8.S.
-
- * v8.S (ffi_call_V8): Rewrote with gordoni. Much simpler.
-
- * v8.S, ffi.c: ffi_call() had changed to accept more than
- two args, so v8.S had to change (because it hijacks incoming
- arg registers).
-
- * ffi.c: Interface changes based on feedback from Jim Blandy.
-
-Thu Oct 10 17:48:16 1996 Anthony Green <green@rtl.cygnus.com>
-
- * ffi.c, v8.S, objects.mak: Created.
-
-
diff --git a/Modules/_ctypes/libffi/LICENSE b/Modules/_ctypes/libffi/LICENSE
deleted file mode 100644
index a66fab4f25..0000000000
--- a/Modules/_ctypes/libffi/LICENSE
+++ /dev/null
@@ -1,21 +0,0 @@
-libffi - Copyright (c) 1996-2014 Anthony Green, Red Hat, Inc and others.
-See source files for details.
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-``Software''), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice shall be
-included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
-CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/Modules/_ctypes/libffi/Makefile.am b/Modules/_ctypes/libffi/Makefile.am
deleted file mode 100644
index 1dcdc8110e..0000000000
--- a/Modules/_ctypes/libffi/Makefile.am
+++ /dev/null
@@ -1,254 +0,0 @@
-## Process this with automake to create Makefile.in
-
-AUTOMAKE_OPTIONS = foreign subdir-objects
-
-ACLOCAL_AMFLAGS = -I m4
-
-SUBDIRS = include testsuite man
-
-EXTRA_DIST = LICENSE ChangeLog.v1 ChangeLog.libgcj \
- src/aarch64/ffi.c src/aarch64/ffitarget.h src/aarch64/sysv.S \
- src/alpha/ffi.c src/alpha/osf.S \
- src/alpha/ffitarget.h src/arc/ffi.c src/arc/arcompact.S \
- src/arc/ffitarget.h src/arm/ffi.c src/arm/sysv.S \
- src/arm/ffitarget.h src/avr32/ffi.c src/avr32/sysv.S \
- src/avr32/ffitarget.h src/cris/ffi.c src/cris/sysv.S \
- src/cris/ffitarget.h src/ia64/ffi.c src/ia64/ffitarget.h \
- src/ia64/ia64_flags.h src/ia64/unix.S src/mips/ffi.c \
- src/mips/n32.S src/mips/o32.S src/metag/ffi.c \
- src/metag/ffitarget.h src/metag/sysv.S src/moxie/ffi.c \
- src/moxie/ffitarget.h src/moxie/eabi.S src/mips/ffitarget.h \
- src/m32r/ffi.c src/m32r/sysv.S src/m32r/ffitarget.h \
- src/m68k/ffi.c src/m68k/sysv.S src/m68k/ffitarget.h \
- src/m88k/ffi.c src/m88k/obsd.S src/m88k/ffitarget.h \
- src/microblaze/ffi.c src/microblaze/sysv.S \
- src/microblaze/ffitarget.h \
- src/nios2/ffi.c src/nios2/ffitarget.h src/nios2/sysv.S \
- src/powerpc/ffi.c src/powerpc/ffi_powerpc.h \
- src/powerpc/ffi_sysv.c src/powerpc/ffi_linux64.c \
- src/powerpc/sysv.S src/powerpc/linux64.S \
- src/powerpc/linux64_closure.S src/powerpc/ppc_closure.S \
- src/powerpc/asm.h src/powerpc/aix.S src/powerpc/darwin.S \
- src/powerpc/aix_closure.S src/powerpc/darwin_closure.S \
- src/powerpc/ffi_darwin.c src/powerpc/ffitarget.h \
- src/s390/ffi.c src/s390/sysv.S src/s390/ffitarget.h \
- src/sh/ffi.c src/sh/sysv.S src/sh/ffitarget.h src/sh64/ffi.c \
- src/sh64/sysv.S src/sh64/ffitarget.h src/sparc/v8.S \
- src/sparc/v9.S src/sparc/ffitarget.h src/sparc/ffi.c \
- src/x86/darwin64.S src/x86/ffi.c src/x86/sysv.S \
- src/x86/win32.S src/x86/darwin.S src/x86/win64.S \
- src/x86/freebsd.S src/x86/ffi64.c src/x86/unix64.S \
- src/x86/ffitarget.h src/pa/ffitarget.h src/pa/ffi.c \
- src/pa/linux.S src/pa/hpux32.S src/frv/ffi.c src/bfin/ffi.c \
- src/bfin/ffitarget.h src/bfin/sysv.S src/frv/eabi.S \
- src/frv/ffitarget.h src/dlmalloc.c src/tile/ffi.c \
- src/tile/ffitarget.h src/tile/tile.S libtool-version \
- src/vax/ffi.c src/vax/ffitarget.h src/vax/elfbsd.S \
- src/xtensa/ffitarget.h src/xtensa/ffi.c src/xtensa/sysv.S \
- ChangeLog.libffi m4/libtool.m4 m4/lt~obsolete.m4 \
- m4/ltoptions.m4 m4/ltsugar.m4 m4/ltversion.m4 \
- m4/ltversion.m4 src/arm/gentramp.sh src/debug.c msvcc.sh \
- generate-darwin-source-and-headers.py \
- libffi.xcodeproj/project.pbxproj src/arm/trampoline.S \
- libtool-ldflags ChangeLog.libffi-3.1
-
-info_TEXINFOS = doc/libffi.texi
-
-## ################################################################
-
-##
-## This section is for make and multilib madness.
-##
-
-# Work around what appears to be a GNU make bug handling MAKEFLAGS
-# values defined in terms of make variables, as is the case for CC and
-# friends when we are called from the top level Makefile.
-AM_MAKEFLAGS = \
- 'AR_FLAGS=$(AR_FLAGS)' \
- 'CC_FOR_BUILD=$(CC_FOR_BUILD)' \
- 'CFLAGS=$(CFLAGS)' \
- 'CXXFLAGS=$(CXXFLAGS)' \
- 'CFLAGS_FOR_BUILD=$(CFLAGS_FOR_BUILD)' \
- 'CFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET)' \
- 'INSTALL=$(INSTALL)' \
- 'INSTALL_DATA=$(INSTALL_DATA)' \
- 'INSTALL_PROGRAM=$(INSTALL_PROGRAM)' \
- 'INSTALL_SCRIPT=$(INSTALL_SCRIPT)' \
- 'JC1FLAGS=$(JC1FLAGS)' \
- 'LDFLAGS=$(LDFLAGS)' \
- 'LIBCFLAGS=$(LIBCFLAGS)' \
- 'LIBCFLAGS_FOR_TARGET=$(LIBCFLAGS_FOR_TARGET)' \
- 'MAKE=$(MAKE)' \
- 'MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)' \
- 'PICFLAG=$(PICFLAG)' \
- 'PICFLAG_FOR_TARGET=$(PICFLAG_FOR_TARGET)' \
- 'RUNTESTFLAGS=$(RUNTESTFLAGS)' \
- 'SHELL=$(SHELL)' \
- 'exec_prefix=$(exec_prefix)' \
- 'infodir=$(infodir)' \
- 'libdir=$(libdir)' \
- 'mandir=$(mandir)' \
- 'prefix=$(prefix)' \
- 'AR=$(AR)' \
- 'AS=$(AS)' \
- 'CC=$(CC)' \
- 'CXX=$(CXX)' \
- 'LD=$(LD)' \
- 'NM=$(NM)' \
- 'RANLIB=$(RANLIB)' \
- 'DESTDIR=$(DESTDIR)'
-
-# Subdir rules rely on $(FLAGS_TO_PASS)
-FLAGS_TO_PASS = $(AM_MAKEFLAGS)
-
-MAKEOVERRIDES=
-
-toolexeclib_LTLIBRARIES = libffi.la
-noinst_LTLIBRARIES = libffi_convenience.la
-
-libffi_la_SOURCES = src/prep_cif.c src/types.c \
- src/raw_api.c src/java_raw_api.c src/closures.c
-
-pkgconfigdir = $(libdir)/pkgconfig
-pkgconfig_DATA = libffi.pc
-
-nodist_libffi_la_SOURCES =
-
-if FFI_DEBUG
-nodist_libffi_la_SOURCES += src/debug.c
-endif
-
-if MIPS
-nodist_libffi_la_SOURCES += src/mips/ffi.c src/mips/o32.S src/mips/n32.S
-endif
-if BFIN
-nodist_libffi_la_SOURCES += src/bfin/ffi.c src/bfin/sysv.S
-endif
-if X86
-nodist_libffi_la_SOURCES += src/x86/ffi.c src/x86/sysv.S src/x86/win32.S
-endif
-if X86_FREEBSD
-nodist_libffi_la_SOURCES += src/x86/ffi.c src/x86/freebsd.S src/x86/win32.S
-endif
-if X86_WIN32
-nodist_libffi_la_SOURCES += src/x86/ffi.c src/x86/win32.S
-endif
-if X86_WIN64
-nodist_libffi_la_SOURCES += src/x86/ffi.c src/x86/win64.S
-endif
-if X86_DARWIN
-nodist_libffi_la_SOURCES += src/x86/ffi.c src/x86/darwin.S src/x86/ffi64.c src/x86/darwin64.S
-if X86_DARWIN32
-nodist_libffi_la_SOURCES += src/x86/win32.S
-endif
-endif
-if SPARC
-nodist_libffi_la_SOURCES += src/sparc/ffi.c src/sparc/v8.S src/sparc/v9.S
-endif
-if ALPHA
-nodist_libffi_la_SOURCES += src/alpha/ffi.c src/alpha/osf.S
-endif
-if IA64
-nodist_libffi_la_SOURCES += src/ia64/ffi.c src/ia64/unix.S
-endif
-if M32R
-nodist_libffi_la_SOURCES += src/m32r/sysv.S src/m32r/ffi.c
-endif
-if M68K
-nodist_libffi_la_SOURCES += src/m68k/ffi.c src/m68k/sysv.S
-endif
-if M88K
-nodist_libffi_la_SOURCES += src/m88k/ffi.c src/m88k/obsd.S
-endif
-if MOXIE
-nodist_libffi_la_SOURCES += src/moxie/ffi.c src/moxie/eabi.S
-endif
-if MICROBLAZE
-nodist_libffi_la_SOURCES += src/microblaze/ffi.c src/microblaze/sysv.S
-endif
-if NIOS2
-nodist_libffi_la_SOURCES += src/nios2/sysv.S src/nios2/ffi.c
-endif
-if POWERPC
-nodist_libffi_la_SOURCES += src/powerpc/ffi.c src/powerpc/ffi_sysv.c src/powerpc/ffi_linux64.c src/powerpc/sysv.S src/powerpc/ppc_closure.S src/powerpc/linux64.S src/powerpc/linux64_closure.S
-endif
-if POWERPC_AIX
-nodist_libffi_la_SOURCES += src/powerpc/ffi_darwin.c src/powerpc/aix.S src/powerpc/aix_closure.S
-endif
-if POWERPC_DARWIN
-nodist_libffi_la_SOURCES += src/powerpc/ffi_darwin.c src/powerpc/darwin.S src/powerpc/darwin_closure.S
-endif
-if POWERPC_FREEBSD
-nodist_libffi_la_SOURCES += src/powerpc/ffi.c src/powerpc/ffi_sysv.c src/powerpc/sysv.S src/powerpc/ppc_closure.S
-endif
-if AARCH64
-nodist_libffi_la_SOURCES += src/aarch64/sysv.S src/aarch64/ffi.c
-endif
-if ARC
-nodist_libffi_la_SOURCES += src/arc/arcompact.S src/arc/ffi.c
-endif
-if ARM
-nodist_libffi_la_SOURCES += src/arm/sysv.S src/arm/ffi.c
-if FFI_EXEC_TRAMPOLINE_TABLE
-nodist_libffi_la_SOURCES += src/arm/trampoline.S
-endif
-endif
-if AVR32
-nodist_libffi_la_SOURCES += src/avr32/sysv.S src/avr32/ffi.c
-endif
-if LIBFFI_CRIS
-nodist_libffi_la_SOURCES += src/cris/sysv.S src/cris/ffi.c
-endif
-if FRV
-nodist_libffi_la_SOURCES += src/frv/eabi.S src/frv/ffi.c
-endif
-if S390
-nodist_libffi_la_SOURCES += src/s390/sysv.S src/s390/ffi.c
-endif
-if X86_64
-nodist_libffi_la_SOURCES += src/x86/ffi64.c src/x86/unix64.S src/x86/ffi.c src/x86/sysv.S
-endif
-if SH
-nodist_libffi_la_SOURCES += src/sh/sysv.S src/sh/ffi.c
-endif
-if SH64
-nodist_libffi_la_SOURCES += src/sh64/sysv.S src/sh64/ffi.c
-endif
-if PA_LINUX
-nodist_libffi_la_SOURCES += src/pa/linux.S src/pa/ffi.c
-endif
-if PA_HPUX
-nodist_libffi_la_SOURCES += src/pa/hpux32.S src/pa/ffi.c
-endif
-if TILE
-nodist_libffi_la_SOURCES += src/tile/tile.S src/tile/ffi.c
-endif
-if XTENSA
-nodist_libffi_la_SOURCES += src/xtensa/sysv.S src/xtensa/ffi.c
-endif
-if METAG
-nodist_libffi_la_SOURCES += src/metag/sysv.S src/metag/ffi.c
-endif
-if VAX
-nodist_libffi_la_SOURCES += src/vax/elfbsd.S src/vax/ffi.c
-endif
-
-libffi_convenience_la_SOURCES = $(libffi_la_SOURCES)
-nodist_libffi_convenience_la_SOURCES = $(nodist_libffi_la_SOURCES)
-
-LTLDFLAGS = $(shell $(SHELL) $(top_srcdir)/libtool-ldflags $(LDFLAGS))
-
-AM_CFLAGS =
-if FFI_DEBUG
-# Build debug. Define FFI_DEBUG on the commandline so that, when building with
-# MSVC, it can link against the debug CRT.
-AM_CFLAGS += -DFFI_DEBUG
-endif
-
-libffi_la_LDFLAGS = -no-undefined -version-info `grep -v '^\#' $(srcdir)/libtool-version` $(LTLDFLAGS) $(AM_LTLDFLAGS)
-
-AM_CPPFLAGS = -I. -I$(top_srcdir)/include -Iinclude -I$(top_srcdir)/src
-AM_CCASFLAGS = $(AM_CPPFLAGS)
-
-dist-hook:
- if [ -d $(top_srcdir)/.git ] ; then (cd $(top_srcdir); git log --no-decorate) ; else echo 'See git log for history.' ; fi > $(distdir)/ChangeLog
diff --git a/Modules/_ctypes/libffi/Makefile.in b/Modules/_ctypes/libffi/Makefile.in
deleted file mode 100644
index 4a57abd3c1..0000000000
--- a/Modules/_ctypes/libffi/Makefile.in
+++ /dev/null
@@ -1,2156 +0,0 @@
-# Makefile.in generated by automake 1.13.4 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
-
-# This Makefile.in 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.
-
-@SET_MAKE@
-
-
-VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
-am__make_running_with_option = \
- case $${target_option-} in \
- ?) ;; \
- *) echo "am__make_running_with_option: internal error: invalid" \
- "target option '$${target_option-}' specified" >&2; \
- exit 1;; \
- esac; \
- has_opt=no; \
- sane_makeflags=$$MAKEFLAGS; \
- if $(am__is_gnu_make); then \
- sane_makeflags=$$MFLAGS; \
- else \
- case $$MAKEFLAGS in \
- *\\[\ \ ]*) \
- bs=\\; \
- sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
- | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
- esac; \
- fi; \
- skip_next=no; \
- strip_trailopt () \
- { \
- flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
- }; \
- for flg in $$sane_makeflags; do \
- test $$skip_next = yes && { skip_next=no; continue; }; \
- case $$flg in \
- *=*|--*) continue;; \
- -*I) strip_trailopt 'I'; skip_next=yes;; \
- -*I?*) strip_trailopt 'I';; \
- -*O) strip_trailopt 'O'; skip_next=yes;; \
- -*O?*) strip_trailopt 'O';; \
- -*l) strip_trailopt 'l'; skip_next=yes;; \
- -*l?*) strip_trailopt 'l';; \
- -[dEDm]) skip_next=yes;; \
- -[JT]) skip_next=yes;; \
- esac; \
- case $$flg in \
- *$$target_option*) has_opt=yes; break;; \
- esac; \
- done; \
- test $$has_opt = yes
-am__make_dryrun = (target_option=n; $(am__make_running_with_option))
-am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-target_triplet = @target@
-@FFI_DEBUG_TRUE@am__append_1 = src/debug.c
-@MIPS_TRUE@am__append_2 = src/mips/ffi.c src/mips/o32.S src/mips/n32.S
-@BFIN_TRUE@am__append_3 = src/bfin/ffi.c src/bfin/sysv.S
-@X86_TRUE@am__append_4 = src/x86/ffi.c src/x86/sysv.S src/x86/win32.S
-@X86_FREEBSD_TRUE@am__append_5 = src/x86/ffi.c src/x86/freebsd.S src/x86/win32.S
-@X86_WIN32_TRUE@am__append_6 = src/x86/ffi.c src/x86/win32.S
-@X86_WIN64_TRUE@am__append_7 = src/x86/ffi.c src/x86/win64.S
-@X86_DARWIN_TRUE@am__append_8 = src/x86/ffi.c src/x86/darwin.S src/x86/ffi64.c src/x86/darwin64.S
-@X86_DARWIN32_TRUE@@X86_DARWIN_TRUE@am__append_9 = src/x86/win32.S
-@SPARC_TRUE@am__append_10 = src/sparc/ffi.c src/sparc/v8.S src/sparc/v9.S
-@ALPHA_TRUE@am__append_11 = src/alpha/ffi.c src/alpha/osf.S
-@IA64_TRUE@am__append_12 = src/ia64/ffi.c src/ia64/unix.S
-@M32R_TRUE@am__append_13 = src/m32r/sysv.S src/m32r/ffi.c
-@M68K_TRUE@am__append_14 = src/m68k/ffi.c src/m68k/sysv.S
-@M88K_TRUE@am__append_15 = src/m88k/ffi.c src/m88k/obsd.S
-@MOXIE_TRUE@am__append_16 = src/moxie/ffi.c src/moxie/eabi.S
-@MICROBLAZE_TRUE@am__append_17 = src/microblaze/ffi.c src/microblaze/sysv.S
-@NIOS2_TRUE@am__append_18 = src/nios2/sysv.S src/nios2/ffi.c
-@POWERPC_TRUE@am__append_19 = src/powerpc/ffi.c src/powerpc/ffi_sysv.c src/powerpc/ffi_linux64.c src/powerpc/sysv.S src/powerpc/ppc_closure.S src/powerpc/linux64.S src/powerpc/linux64_closure.S
-@POWERPC_AIX_TRUE@am__append_20 = src/powerpc/ffi_darwin.c src/powerpc/aix.S src/powerpc/aix_closure.S
-@POWERPC_DARWIN_TRUE@am__append_21 = src/powerpc/ffi_darwin.c src/powerpc/darwin.S src/powerpc/darwin_closure.S
-@POWERPC_FREEBSD_TRUE@am__append_22 = src/powerpc/ffi.c src/powerpc/ffi_sysv.c src/powerpc/sysv.S src/powerpc/ppc_closure.S
-@AARCH64_TRUE@am__append_23 = src/aarch64/sysv.S src/aarch64/ffi.c
-@ARC_TRUE@am__append_24 = src/arc/arcompact.S src/arc/ffi.c
-@ARM_TRUE@am__append_25 = src/arm/sysv.S src/arm/ffi.c
-@ARM_TRUE@@FFI_EXEC_TRAMPOLINE_TABLE_TRUE@am__append_26 = src/arm/trampoline.S
-@AVR32_TRUE@am__append_27 = src/avr32/sysv.S src/avr32/ffi.c
-@LIBFFI_CRIS_TRUE@am__append_28 = src/cris/sysv.S src/cris/ffi.c
-@FRV_TRUE@am__append_29 = src/frv/eabi.S src/frv/ffi.c
-@S390_TRUE@am__append_30 = src/s390/sysv.S src/s390/ffi.c
-@X86_64_TRUE@am__append_31 = src/x86/ffi64.c src/x86/unix64.S src/x86/ffi.c src/x86/sysv.S
-@SH_TRUE@am__append_32 = src/sh/sysv.S src/sh/ffi.c
-@SH64_TRUE@am__append_33 = src/sh64/sysv.S src/sh64/ffi.c
-@PA_LINUX_TRUE@am__append_34 = src/pa/linux.S src/pa/ffi.c
-@PA_HPUX_TRUE@am__append_35 = src/pa/hpux32.S src/pa/ffi.c
-@TILE_TRUE@am__append_36 = src/tile/tile.S src/tile/ffi.c
-@XTENSA_TRUE@am__append_37 = src/xtensa/sysv.S src/xtensa/ffi.c
-@METAG_TRUE@am__append_38 = src/metag/sysv.S src/metag/ffi.c
-@VAX_TRUE@am__append_39 = src/vax/elfbsd.S src/vax/ffi.c
-# Build debug. Define FFI_DEBUG on the commandline so that, when building with
-# MSVC, it can link against the debug CRT.
-@FFI_DEBUG_TRUE@am__append_40 = -DFFI_DEBUG
-subdir = .
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
- $(top_srcdir)/configure $(am__configure_deps) \
- $(srcdir)/fficonfig.h.in $(srcdir)/libffi.pc.in depcomp \
- mdate-sh $(srcdir)/doc/version.texi $(srcdir)/doc/stamp-vti \
- texinfo.tex README compile config.guess config.sub install-sh \
- missing ltmain.sh
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/asmcfi.m4 \
- $(top_srcdir)/m4/ax_append_flag.m4 \
- $(top_srcdir)/m4/ax_cc_maxopt.m4 \
- $(top_srcdir)/m4/ax_cflags_warn_all.m4 \
- $(top_srcdir)/m4/ax_check_compile_flag.m4 \
- $(top_srcdir)/m4/ax_compiler_vendor.m4 \
- $(top_srcdir)/m4/ax_configure_args.m4 \
- $(top_srcdir)/m4/ax_enable_builddir.m4 \
- $(top_srcdir)/m4/ax_gcc_archflag.m4 \
- $(top_srcdir)/m4/ax_gcc_x86_cpuid.m4 \
- $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
- $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
- $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/acinclude.m4 \
- $(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
- $(ACLOCAL_M4)
-am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
- configure.lineno config.status.lineno
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = fficonfig.h
-CONFIG_CLEAN_FILES = libffi.pc
-CONFIG_CLEAN_VPATH_FILES =
-am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
-am__vpath_adj = case $$p in \
- $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
- *) f=$$p;; \
- esac;
-am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
-am__install_max = 40
-am__nobase_strip_setup = \
- srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
-am__nobase_strip = \
- for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
-am__nobase_list = $(am__nobase_strip_setup); \
- for p in $$list; do echo "$$p $$p"; done | \
- sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
- $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
- if (++n[$$2] == $(am__install_max)) \
- { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
- END { for (dir in files) print dir, files[dir] }'
-am__base_list = \
- sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
- sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
-am__uninstall_files_from_dir = { \
- test -z "$$files" \
- || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
- || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
- $(am__cd) "$$dir" && rm -f $$files; }; \
- }
-am__installdirs = "$(DESTDIR)$(toolexeclibdir)" "$(DESTDIR)$(infodir)" \
- "$(DESTDIR)$(pkgconfigdir)"
-LTLIBRARIES = $(noinst_LTLIBRARIES) $(toolexeclib_LTLIBRARIES)
-libffi_la_LIBADD =
-am__dirstamp = $(am__leading_dot)dirstamp
-am_libffi_la_OBJECTS = src/prep_cif.lo src/types.lo src/raw_api.lo \
- src/java_raw_api.lo src/closures.lo
-@FFI_DEBUG_TRUE@am__objects_1 = src/debug.lo
-@MIPS_TRUE@am__objects_2 = src/mips/ffi.lo src/mips/o32.lo \
-@MIPS_TRUE@ src/mips/n32.lo
-@BFIN_TRUE@am__objects_3 = src/bfin/ffi.lo src/bfin/sysv.lo
-@X86_TRUE@am__objects_4 = src/x86/ffi.lo src/x86/sysv.lo \
-@X86_TRUE@ src/x86/win32.lo
-@X86_FREEBSD_TRUE@am__objects_5 = src/x86/ffi.lo src/x86/freebsd.lo \
-@X86_FREEBSD_TRUE@ src/x86/win32.lo
-@X86_WIN32_TRUE@am__objects_6 = src/x86/ffi.lo src/x86/win32.lo
-@X86_WIN64_TRUE@am__objects_7 = src/x86/ffi.lo src/x86/win64.lo
-@X86_DARWIN_TRUE@am__objects_8 = src/x86/ffi.lo src/x86/darwin.lo \
-@X86_DARWIN_TRUE@ src/x86/ffi64.lo src/x86/darwin64.lo
-@X86_DARWIN32_TRUE@@X86_DARWIN_TRUE@am__objects_9 = src/x86/win32.lo
-@SPARC_TRUE@am__objects_10 = src/sparc/ffi.lo src/sparc/v8.lo \
-@SPARC_TRUE@ src/sparc/v9.lo
-@ALPHA_TRUE@am__objects_11 = src/alpha/ffi.lo src/alpha/osf.lo
-@IA64_TRUE@am__objects_12 = src/ia64/ffi.lo src/ia64/unix.lo
-@M32R_TRUE@am__objects_13 = src/m32r/sysv.lo src/m32r/ffi.lo
-@M68K_TRUE@am__objects_14 = src/m68k/ffi.lo src/m68k/sysv.lo
-@M88K_TRUE@am__objects_15 = src/m88k/ffi.lo src/m88k/obsd.lo
-@MOXIE_TRUE@am__objects_16 = src/moxie/ffi.lo src/moxie/eabi.lo
-@MICROBLAZE_TRUE@am__objects_17 = src/microblaze/ffi.lo \
-@MICROBLAZE_TRUE@ src/microblaze/sysv.lo
-@NIOS2_TRUE@am__objects_18 = src/nios2/sysv.lo src/nios2/ffi.lo
-@POWERPC_TRUE@am__objects_19 = src/powerpc/ffi.lo \
-@POWERPC_TRUE@ src/powerpc/ffi_sysv.lo \
-@POWERPC_TRUE@ src/powerpc/ffi_linux64.lo src/powerpc/sysv.lo \
-@POWERPC_TRUE@ src/powerpc/ppc_closure.lo \
-@POWERPC_TRUE@ src/powerpc/linux64.lo \
-@POWERPC_TRUE@ src/powerpc/linux64_closure.lo
-@POWERPC_AIX_TRUE@am__objects_20 = src/powerpc/ffi_darwin.lo \
-@POWERPC_AIX_TRUE@ src/powerpc/aix.lo \
-@POWERPC_AIX_TRUE@ src/powerpc/aix_closure.lo
-@POWERPC_DARWIN_TRUE@am__objects_21 = src/powerpc/ffi_darwin.lo \
-@POWERPC_DARWIN_TRUE@ src/powerpc/darwin.lo \
-@POWERPC_DARWIN_TRUE@ src/powerpc/darwin_closure.lo
-@POWERPC_FREEBSD_TRUE@am__objects_22 = src/powerpc/ffi.lo \
-@POWERPC_FREEBSD_TRUE@ src/powerpc/ffi_sysv.lo \
-@POWERPC_FREEBSD_TRUE@ src/powerpc/sysv.lo \
-@POWERPC_FREEBSD_TRUE@ src/powerpc/ppc_closure.lo
-@AARCH64_TRUE@am__objects_23 = src/aarch64/sysv.lo src/aarch64/ffi.lo
-@ARC_TRUE@am__objects_24 = src/arc/arcompact.lo src/arc/ffi.lo
-@ARM_TRUE@am__objects_25 = src/arm/sysv.lo src/arm/ffi.lo
-@ARM_TRUE@@FFI_EXEC_TRAMPOLINE_TABLE_TRUE@am__objects_26 = src/arm/trampoline.lo
-@AVR32_TRUE@am__objects_27 = src/avr32/sysv.lo src/avr32/ffi.lo
-@LIBFFI_CRIS_TRUE@am__objects_28 = src/cris/sysv.lo src/cris/ffi.lo
-@FRV_TRUE@am__objects_29 = src/frv/eabi.lo src/frv/ffi.lo
-@S390_TRUE@am__objects_30 = src/s390/sysv.lo src/s390/ffi.lo
-@X86_64_TRUE@am__objects_31 = src/x86/ffi64.lo src/x86/unix64.lo \
-@X86_64_TRUE@ src/x86/ffi.lo src/x86/sysv.lo
-@SH_TRUE@am__objects_32 = src/sh/sysv.lo src/sh/ffi.lo
-@SH64_TRUE@am__objects_33 = src/sh64/sysv.lo src/sh64/ffi.lo
-@PA_LINUX_TRUE@am__objects_34 = src/pa/linux.lo src/pa/ffi.lo
-@PA_HPUX_TRUE@am__objects_35 = src/pa/hpux32.lo src/pa/ffi.lo
-@TILE_TRUE@am__objects_36 = src/tile/tile.lo src/tile/ffi.lo
-@XTENSA_TRUE@am__objects_37 = src/xtensa/sysv.lo src/xtensa/ffi.lo
-@METAG_TRUE@am__objects_38 = src/metag/sysv.lo src/metag/ffi.lo
-@VAX_TRUE@am__objects_39 = src/vax/elfbsd.lo src/vax/ffi.lo
-nodist_libffi_la_OBJECTS = $(am__objects_1) $(am__objects_2) \
- $(am__objects_3) $(am__objects_4) $(am__objects_5) \
- $(am__objects_6) $(am__objects_7) $(am__objects_8) \
- $(am__objects_9) $(am__objects_10) $(am__objects_11) \
- $(am__objects_12) $(am__objects_13) $(am__objects_14) \
- $(am__objects_15) $(am__objects_16) $(am__objects_17) \
- $(am__objects_18) $(am__objects_19) $(am__objects_20) \
- $(am__objects_21) $(am__objects_22) $(am__objects_23) \
- $(am__objects_24) $(am__objects_25) $(am__objects_26) \
- $(am__objects_27) $(am__objects_28) $(am__objects_29) \
- $(am__objects_30) $(am__objects_31) $(am__objects_32) \
- $(am__objects_33) $(am__objects_34) $(am__objects_35) \
- $(am__objects_36) $(am__objects_37) $(am__objects_38) \
- $(am__objects_39)
-libffi_la_OBJECTS = $(am_libffi_la_OBJECTS) \
- $(nodist_libffi_la_OBJECTS)
-AM_V_lt = $(am__v_lt_@AM_V@)
-am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
-am__v_lt_0 = --silent
-am__v_lt_1 =
-libffi_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
- $(libffi_la_LDFLAGS) $(LDFLAGS) -o $@
-libffi_convenience_la_LIBADD =
-am__objects_40 = src/prep_cif.lo src/types.lo src/raw_api.lo \
- src/java_raw_api.lo src/closures.lo
-am_libffi_convenience_la_OBJECTS = $(am__objects_40)
-am__objects_41 = $(am__objects_1) $(am__objects_2) $(am__objects_3) \
- $(am__objects_4) $(am__objects_5) $(am__objects_6) \
- $(am__objects_7) $(am__objects_8) $(am__objects_9) \
- $(am__objects_10) $(am__objects_11) $(am__objects_12) \
- $(am__objects_13) $(am__objects_14) $(am__objects_15) \
- $(am__objects_16) $(am__objects_17) $(am__objects_18) \
- $(am__objects_19) $(am__objects_20) $(am__objects_21) \
- $(am__objects_22) $(am__objects_23) $(am__objects_24) \
- $(am__objects_25) $(am__objects_26) $(am__objects_27) \
- $(am__objects_28) $(am__objects_29) $(am__objects_30) \
- $(am__objects_31) $(am__objects_32) $(am__objects_33) \
- $(am__objects_34) $(am__objects_35) $(am__objects_36) \
- $(am__objects_37) $(am__objects_38) $(am__objects_39)
-nodist_libffi_convenience_la_OBJECTS = $(am__objects_41)
-libffi_convenience_la_OBJECTS = $(am_libffi_convenience_la_OBJECTS) \
- $(nodist_libffi_convenience_la_OBJECTS)
-AM_V_P = $(am__v_P_@AM_V@)
-am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
-am__v_P_0 = false
-am__v_P_1 = :
-AM_V_GEN = $(am__v_GEN_@AM_V@)
-am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
-am__v_GEN_0 = @echo " GEN " $@;
-am__v_GEN_1 =
-AM_V_at = $(am__v_at_@AM_V@)
-am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
-am__v_at_0 = @
-am__v_at_1 =
-DEFAULT_INCLUDES = -I.@am__isrc@
-depcomp = $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe = depfiles
-am__mv = mv -f
-CPPASCOMPILE = $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
- $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS)
-LTCPPASCOMPILE = $(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) \
- $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
- $(AM_CCASFLAGS) $(CCASFLAGS)
-AM_V_CPPAS = $(am__v_CPPAS_@AM_V@)
-am__v_CPPAS_ = $(am__v_CPPAS_@AM_DEFAULT_V@)
-am__v_CPPAS_0 = @echo " CPPAS " $@;
-am__v_CPPAS_1 =
-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
- $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
- $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
- $(AM_CFLAGS) $(CFLAGS)
-AM_V_CC = $(am__v_CC_@AM_V@)
-am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
-am__v_CC_0 = @echo " CC " $@;
-am__v_CC_1 =
-CCLD = $(CC)
-LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
- $(AM_LDFLAGS) $(LDFLAGS) -o $@
-AM_V_CCLD = $(am__v_CCLD_@AM_V@)
-am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
-am__v_CCLD_0 = @echo " CCLD " $@;
-am__v_CCLD_1 =
-SOURCES = $(libffi_la_SOURCES) $(nodist_libffi_la_SOURCES) \
- $(libffi_convenience_la_SOURCES) \
- $(nodist_libffi_convenience_la_SOURCES)
-DIST_SOURCES = $(libffi_la_SOURCES) $(libffi_convenience_la_SOURCES)
-AM_V_DVIPS = $(am__v_DVIPS_@AM_V@)
-am__v_DVIPS_ = $(am__v_DVIPS_@AM_DEFAULT_V@)
-am__v_DVIPS_0 = @echo " DVIPS " $@;
-am__v_DVIPS_1 =
-AM_V_MAKEINFO = $(am__v_MAKEINFO_@AM_V@)
-am__v_MAKEINFO_ = $(am__v_MAKEINFO_@AM_DEFAULT_V@)
-am__v_MAKEINFO_0 = @echo " MAKEINFO" $@;
-am__v_MAKEINFO_1 =
-AM_V_INFOHTML = $(am__v_INFOHTML_@AM_V@)
-am__v_INFOHTML_ = $(am__v_INFOHTML_@AM_DEFAULT_V@)
-am__v_INFOHTML_0 = @echo " INFOHTML" $@;
-am__v_INFOHTML_1 =
-AM_V_TEXI2DVI = $(am__v_TEXI2DVI_@AM_V@)
-am__v_TEXI2DVI_ = $(am__v_TEXI2DVI_@AM_DEFAULT_V@)
-am__v_TEXI2DVI_0 = @echo " TEXI2DVI" $@;
-am__v_TEXI2DVI_1 =
-AM_V_TEXI2PDF = $(am__v_TEXI2PDF_@AM_V@)
-am__v_TEXI2PDF_ = $(am__v_TEXI2PDF_@AM_DEFAULT_V@)
-am__v_TEXI2PDF_0 = @echo " TEXI2PDF" $@;
-am__v_TEXI2PDF_1 =
-AM_V_texinfo = $(am__v_texinfo_@AM_V@)
-am__v_texinfo_ = $(am__v_texinfo_@AM_DEFAULT_V@)
-am__v_texinfo_0 = -q
-am__v_texinfo_1 =
-AM_V_texidevnull = $(am__v_texidevnull_@AM_V@)
-am__v_texidevnull_ = $(am__v_texidevnull_@AM_DEFAULT_V@)
-am__v_texidevnull_0 = > /dev/null
-am__v_texidevnull_1 =
-INFO_DEPS = $(srcdir)/doc/libffi.info
-am__TEXINFO_TEX_DIR = $(srcdir)
-DVIS = doc/libffi.dvi
-PDFS = doc/libffi.pdf
-PSS = doc/libffi.ps
-HTMLS = doc/libffi.html
-TEXINFOS = doc/libffi.texi
-TEXI2DVI = texi2dvi
-TEXI2PDF = $(TEXI2DVI) --pdf --batch
-MAKEINFOHTML = $(MAKEINFO) --html
-AM_MAKEINFOHTMLFLAGS = $(AM_MAKEINFOFLAGS)
-DVIPS = dvips
-RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
- ctags-recursive dvi-recursive html-recursive info-recursive \
- install-data-recursive install-dvi-recursive \
- install-exec-recursive install-html-recursive \
- install-info-recursive install-pdf-recursive \
- install-ps-recursive install-recursive installcheck-recursive \
- installdirs-recursive pdf-recursive ps-recursive \
- tags-recursive uninstall-recursive
-am__can_run_installinfo = \
- case $$AM_UPDATE_INFO_DIR in \
- n|no|NO) false;; \
- *) (install-info --version) >/dev/null 2>&1;; \
- esac
-DATA = $(pkgconfig_DATA)
-RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
- distclean-recursive maintainer-clean-recursive
-am__recursive_targets = \
- $(RECURSIVE_TARGETS) \
- $(RECURSIVE_CLEAN_TARGETS) \
- $(am__extra_recursive_targets)
-AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
- cscope distdir dist dist-all distcheck
-am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \
- $(LISP)fficonfig.h.in
-# Read a list of newline-separated strings from the standard input,
-# and print each of them once, without duplicates. Input order is
-# *not* preserved.
-am__uniquify_input = $(AWK) '\
- BEGIN { nonempty = 0; } \
- { items[$$0] = 1; nonempty = 1; } \
- END { if (nonempty) { for (i in items) print i; }; } \
-'
-# Make sure the list of sources is unique. This is necessary because,
-# e.g., the same source file might be shared among _SOURCES variables
-# for different programs/libraries.
-am__define_uniq_tagged_files = \
- list='$(am__tagged_files)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | $(am__uniquify_input)`
-ETAGS = etags
-CTAGS = ctags
-CSCOPE = cscope
-DIST_SUBDIRS = $(SUBDIRS)
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-distdir = $(PACKAGE)-$(VERSION)
-top_distdir = $(distdir)
-am__remove_distdir = \
- if test -d "$(distdir)"; then \
- find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \
- && rm -rf "$(distdir)" \
- || { sleep 5 && rm -rf "$(distdir)"; }; \
- else :; fi
-am__post_remove_distdir = $(am__remove_distdir)
-am__relativize = \
- dir0=`pwd`; \
- sed_first='s,^\([^/]*\)/.*$$,\1,'; \
- sed_rest='s,^[^/]*/*,,'; \
- sed_last='s,^.*/\([^/]*\)$$,\1,'; \
- sed_butlast='s,/*[^/]*$$,,'; \
- while test -n "$$dir1"; do \
- first=`echo "$$dir1" | sed -e "$$sed_first"`; \
- if test "$$first" != "."; then \
- if test "$$first" = ".."; then \
- dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
- dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
- else \
- first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
- if test "$$first2" = "$$first"; then \
- dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
- else \
- dir2="../$$dir2"; \
- fi; \
- dir0="$$dir0"/"$$first"; \
- fi; \
- fi; \
- dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
- done; \
- reldir="$$dir2"
-DIST_ARCHIVES = $(distdir).tar.gz
-GZIP_ENV = --best
-DIST_TARGETS = dist-gzip
-distuninstallcheck_listfiles = find . -type f -print
-am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \
- | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$'
-distcleancheck_listfiles = find . -type f -print
-ACLOCAL = @ACLOCAL@
-ALLOCA = @ALLOCA@
-AMTAR = @AMTAR@
-AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
-AM_LTLDFLAGS = @AM_LTLDFLAGS@
-AM_RUNTESTFLAGS = @AM_RUNTESTFLAGS@
-AR = @AR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-CC = @CC@
-CCAS = @CCAS@
-CCASDEPMODE = @CCASDEPMODE@
-CCASFLAGS = @CCASFLAGS@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DLLTOOL = @DLLTOOL@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FFI_EXEC_TRAMPOLINE_TABLE = @FFI_EXEC_TRAMPOLINE_TABLE@
-FGREP = @FGREP@
-GREP = @GREP@
-HAVE_LONG_DOUBLE = @HAVE_LONG_DOUBLE@
-HAVE_LONG_DOUBLE_VARIANT = @HAVE_LONG_DOUBLE_VARIANT@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LTLIBOBJS = @LTLIBOBJS@
-MAINT = @MAINT@
-MAKEINFO = @MAKEINFO@
-MANIFEST_TOOL = @MANIFEST_TOOL@
-MKDIR_P = @MKDIR_P@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_URL = @PACKAGE_URL@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PRTDIAG = @PRTDIAG@
-RANLIB = @RANLIB@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-TARGET = @TARGET@
-TARGETDIR = @TARGETDIR@
-VERSION = @VERSION@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_AR = @ac_ct_AR@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-ax_enable_builddir_sed = @ax_enable_builddir_sed@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sys_symbol_underscore = @sys_symbol_underscore@
-sysconfdir = @sysconfdir@
-target = @target@
-target_alias = @target_alias@
-target_cpu = @target_cpu@
-target_os = @target_os@
-target_vendor = @target_vendor@
-toolexecdir = @toolexecdir@
-toolexeclibdir = @toolexeclibdir@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-AUTOMAKE_OPTIONS = foreign subdir-objects
-ACLOCAL_AMFLAGS = -I m4
-SUBDIRS = include testsuite man
-EXTRA_DIST = LICENSE ChangeLog.v1 ChangeLog.libgcj \
- src/aarch64/ffi.c src/aarch64/ffitarget.h src/aarch64/sysv.S \
- src/alpha/ffi.c src/alpha/osf.S \
- src/alpha/ffitarget.h src/arc/ffi.c src/arc/arcompact.S \
- src/arc/ffitarget.h src/arm/ffi.c src/arm/sysv.S \
- src/arm/ffitarget.h src/avr32/ffi.c src/avr32/sysv.S \
- src/avr32/ffitarget.h src/cris/ffi.c src/cris/sysv.S \
- src/cris/ffitarget.h src/ia64/ffi.c src/ia64/ffitarget.h \
- src/ia64/ia64_flags.h src/ia64/unix.S src/mips/ffi.c \
- src/mips/n32.S src/mips/o32.S src/metag/ffi.c \
- src/metag/ffitarget.h src/metag/sysv.S src/moxie/ffi.c \
- src/moxie/ffitarget.h src/moxie/eabi.S src/mips/ffitarget.h \
- src/m32r/ffi.c src/m32r/sysv.S src/m32r/ffitarget.h \
- src/m68k/ffi.c src/m68k/sysv.S src/m68k/ffitarget.h \
- src/m88k/ffi.c src/m88k/obsd.S src/m88k/ffitarget.h \
- src/microblaze/ffi.c src/microblaze/sysv.S \
- src/microblaze/ffitarget.h \
- src/nios2/ffi.c src/nios2/ffitarget.h src/nios2/sysv.S \
- src/powerpc/ffi.c src/powerpc/ffi_powerpc.h \
- src/powerpc/ffi_sysv.c src/powerpc/ffi_linux64.c \
- src/powerpc/sysv.S src/powerpc/linux64.S \
- src/powerpc/linux64_closure.S src/powerpc/ppc_closure.S \
- src/powerpc/asm.h src/powerpc/aix.S src/powerpc/darwin.S \
- src/powerpc/aix_closure.S src/powerpc/darwin_closure.S \
- src/powerpc/ffi_darwin.c src/powerpc/ffitarget.h \
- src/s390/ffi.c src/s390/sysv.S src/s390/ffitarget.h \
- src/sh/ffi.c src/sh/sysv.S src/sh/ffitarget.h src/sh64/ffi.c \
- src/sh64/sysv.S src/sh64/ffitarget.h src/sparc/v8.S \
- src/sparc/v9.S src/sparc/ffitarget.h src/sparc/ffi.c \
- src/x86/darwin64.S src/x86/ffi.c src/x86/sysv.S \
- src/x86/win32.S src/x86/darwin.S src/x86/win64.S \
- src/x86/freebsd.S src/x86/ffi64.c src/x86/unix64.S \
- src/x86/ffitarget.h src/pa/ffitarget.h src/pa/ffi.c \
- src/pa/linux.S src/pa/hpux32.S src/frv/ffi.c src/bfin/ffi.c \
- src/bfin/ffitarget.h src/bfin/sysv.S src/frv/eabi.S \
- src/frv/ffitarget.h src/dlmalloc.c src/tile/ffi.c \
- src/tile/ffitarget.h src/tile/tile.S libtool-version \
- src/vax/ffi.c src/vax/ffitarget.h src/vax/elfbsd.S \
- src/xtensa/ffitarget.h src/xtensa/ffi.c src/xtensa/sysv.S \
- ChangeLog.libffi m4/libtool.m4 m4/lt~obsolete.m4 \
- m4/ltoptions.m4 m4/ltsugar.m4 m4/ltversion.m4 \
- m4/ltversion.m4 src/arm/gentramp.sh src/debug.c msvcc.sh \
- generate-darwin-source-and-headers.py \
- libffi.xcodeproj/project.pbxproj src/arm/trampoline.S \
- libtool-ldflags ChangeLog.libffi-3.1
-
-info_TEXINFOS = doc/libffi.texi
-
-# Work around what appears to be a GNU make bug handling MAKEFLAGS
-# values defined in terms of make variables, as is the case for CC and
-# friends when we are called from the top level Makefile.
-AM_MAKEFLAGS = \
- 'AR_FLAGS=$(AR_FLAGS)' \
- 'CC_FOR_BUILD=$(CC_FOR_BUILD)' \
- 'CFLAGS=$(CFLAGS)' \
- 'CXXFLAGS=$(CXXFLAGS)' \
- 'CFLAGS_FOR_BUILD=$(CFLAGS_FOR_BUILD)' \
- 'CFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET)' \
- 'INSTALL=$(INSTALL)' \
- 'INSTALL_DATA=$(INSTALL_DATA)' \
- 'INSTALL_PROGRAM=$(INSTALL_PROGRAM)' \
- 'INSTALL_SCRIPT=$(INSTALL_SCRIPT)' \
- 'JC1FLAGS=$(JC1FLAGS)' \
- 'LDFLAGS=$(LDFLAGS)' \
- 'LIBCFLAGS=$(LIBCFLAGS)' \
- 'LIBCFLAGS_FOR_TARGET=$(LIBCFLAGS_FOR_TARGET)' \
- 'MAKE=$(MAKE)' \
- 'MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)' \
- 'PICFLAG=$(PICFLAG)' \
- 'PICFLAG_FOR_TARGET=$(PICFLAG_FOR_TARGET)' \
- 'RUNTESTFLAGS=$(RUNTESTFLAGS)' \
- 'SHELL=$(SHELL)' \
- 'exec_prefix=$(exec_prefix)' \
- 'infodir=$(infodir)' \
- 'libdir=$(libdir)' \
- 'mandir=$(mandir)' \
- 'prefix=$(prefix)' \
- 'AR=$(AR)' \
- 'AS=$(AS)' \
- 'CC=$(CC)' \
- 'CXX=$(CXX)' \
- 'LD=$(LD)' \
- 'NM=$(NM)' \
- 'RANLIB=$(RANLIB)' \
- 'DESTDIR=$(DESTDIR)'
-
-
-# Subdir rules rely on $(FLAGS_TO_PASS)
-FLAGS_TO_PASS = $(AM_MAKEFLAGS)
-MAKEOVERRIDES =
-toolexeclib_LTLIBRARIES = libffi.la
-noinst_LTLIBRARIES = libffi_convenience.la
-libffi_la_SOURCES = src/prep_cif.c src/types.c \
- src/raw_api.c src/java_raw_api.c src/closures.c
-
-pkgconfigdir = $(libdir)/pkgconfig
-pkgconfig_DATA = libffi.pc
-nodist_libffi_la_SOURCES = $(am__append_1) $(am__append_2) \
- $(am__append_3) $(am__append_4) $(am__append_5) \
- $(am__append_6) $(am__append_7) $(am__append_8) \
- $(am__append_9) $(am__append_10) $(am__append_11) \
- $(am__append_12) $(am__append_13) $(am__append_14) \
- $(am__append_15) $(am__append_16) $(am__append_17) \
- $(am__append_18) $(am__append_19) $(am__append_20) \
- $(am__append_21) $(am__append_22) $(am__append_23) \
- $(am__append_24) $(am__append_25) $(am__append_26) \
- $(am__append_27) $(am__append_28) $(am__append_29) \
- $(am__append_30) $(am__append_31) $(am__append_32) \
- $(am__append_33) $(am__append_34) $(am__append_35) \
- $(am__append_36) $(am__append_37) $(am__append_38) \
- $(am__append_39)
-libffi_convenience_la_SOURCES = $(libffi_la_SOURCES)
-nodist_libffi_convenience_la_SOURCES = $(nodist_libffi_la_SOURCES)
-LTLDFLAGS = $(shell $(SHELL) $(top_srcdir)/libtool-ldflags $(LDFLAGS))
-AM_CFLAGS = $(am__append_40)
-libffi_la_LDFLAGS = -no-undefined -version-info `grep -v '^\#' $(srcdir)/libtool-version` $(LTLDFLAGS) $(AM_LTLDFLAGS)
-AM_CPPFLAGS = -I. -I$(top_srcdir)/include -Iinclude -I$(top_srcdir)/src
-AM_CCASFLAGS = $(AM_CPPFLAGS)
-all: fficonfig.h
- $(MAKE) $(AM_MAKEFLAGS) all-recursive
-
-.SUFFIXES:
-.SUFFIXES: .S .c .dvi .lo .o .obj .ps
-am--refresh: Makefile
- @:
-$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
- @for dep in $?; do \
- case '$(am__configure_deps)' in \
- *$$dep*) \
- echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \
- $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \
- && exit 0; \
- exit 1;; \
- esac; \
- done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \
- $(am__cd) $(top_srcdir) && \
- $(AUTOMAKE) --foreign Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
- @case '$?' in \
- *config.status*) \
- echo ' $(SHELL) ./config.status'; \
- $(SHELL) ./config.status;; \
- *) \
- echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
- cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
- esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
- $(SHELL) ./config.status --recheck
-
-$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
- $(am__cd) $(srcdir) && $(AUTOCONF)
-$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
- $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
-$(am__aclocal_m4_deps):
-
-fficonfig.h: stamp-h1
- @if test ! -f $@; then rm -f stamp-h1; else :; fi
- @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) stamp-h1; else :; fi
-
-stamp-h1: $(srcdir)/fficonfig.h.in $(top_builddir)/config.status
- @rm -f stamp-h1
- cd $(top_builddir) && $(SHELL) ./config.status fficonfig.h
-$(srcdir)/fficonfig.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
- ($(am__cd) $(top_srcdir) && $(AUTOHEADER))
- rm -f stamp-h1
- touch $@
-
-distclean-hdr:
- -rm -f fficonfig.h stamp-h1
-libffi.pc: $(top_builddir)/config.status $(srcdir)/libffi.pc.in
- cd $(top_builddir) && $(SHELL) ./config.status $@
-
-clean-noinstLTLIBRARIES:
- -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
- @list='$(noinst_LTLIBRARIES)'; \
- locs=`for p in $$list; do echo $$p; done | \
- sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
- sort -u`; \
- test -z "$$locs" || { \
- echo rm -f $${locs}; \
- rm -f $${locs}; \
- }
-
-install-toolexeclibLTLIBRARIES: $(toolexeclib_LTLIBRARIES)
- @$(NORMAL_INSTALL)
- @list='$(toolexeclib_LTLIBRARIES)'; test -n "$(toolexeclibdir)" || list=; \
- list2=; for p in $$list; do \
- if test -f $$p; then \
- list2="$$list2 $$p"; \
- else :; fi; \
- done; \
- test -z "$$list2" || { \
- echo " $(MKDIR_P) '$(DESTDIR)$(toolexeclibdir)'"; \
- $(MKDIR_P) "$(DESTDIR)$(toolexeclibdir)" || exit 1; \
- echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(toolexeclibdir)'"; \
- $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(toolexeclibdir)"; \
- }
-
-uninstall-toolexeclibLTLIBRARIES:
- @$(NORMAL_UNINSTALL)
- @list='$(toolexeclib_LTLIBRARIES)'; test -n "$(toolexeclibdir)" || list=; \
- for p in $$list; do \
- $(am__strip_dir) \
- echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(toolexeclibdir)/$$f'"; \
- $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(toolexeclibdir)/$$f"; \
- done
-
-clean-toolexeclibLTLIBRARIES:
- -test -z "$(toolexeclib_LTLIBRARIES)" || rm -f $(toolexeclib_LTLIBRARIES)
- @list='$(toolexeclib_LTLIBRARIES)'; \
- locs=`for p in $$list; do echo $$p; done | \
- sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
- sort -u`; \
- test -z "$$locs" || { \
- echo rm -f $${locs}; \
- rm -f $${locs}; \
- }
-src/$(am__dirstamp):
- @$(MKDIR_P) src
- @: > src/$(am__dirstamp)
-src/$(DEPDIR)/$(am__dirstamp):
- @$(MKDIR_P) src/$(DEPDIR)
- @: > src/$(DEPDIR)/$(am__dirstamp)
-src/prep_cif.lo: src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp)
-src/types.lo: src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp)
-src/raw_api.lo: src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp)
-src/java_raw_api.lo: src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp)
-src/closures.lo: src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp)
-src/debug.lo: src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp)
-src/mips/$(am__dirstamp):
- @$(MKDIR_P) src/mips
- @: > src/mips/$(am__dirstamp)
-src/mips/$(DEPDIR)/$(am__dirstamp):
- @$(MKDIR_P) src/mips/$(DEPDIR)
- @: > src/mips/$(DEPDIR)/$(am__dirstamp)
-src/mips/ffi.lo: src/mips/$(am__dirstamp) \
- src/mips/$(DEPDIR)/$(am__dirstamp)
-src/mips/o32.lo: src/mips/$(am__dirstamp) \
- src/mips/$(DEPDIR)/$(am__dirstamp)
-src/mips/n32.lo: src/mips/$(am__dirstamp) \
- src/mips/$(DEPDIR)/$(am__dirstamp)
-src/bfin/$(am__dirstamp):
- @$(MKDIR_P) src/bfin
- @: > src/bfin/$(am__dirstamp)
-src/bfin/$(DEPDIR)/$(am__dirstamp):
- @$(MKDIR_P) src/bfin/$(DEPDIR)
- @: > src/bfin/$(DEPDIR)/$(am__dirstamp)
-src/bfin/ffi.lo: src/bfin/$(am__dirstamp) \
- src/bfin/$(DEPDIR)/$(am__dirstamp)
-src/bfin/sysv.lo: src/bfin/$(am__dirstamp) \
- src/bfin/$(DEPDIR)/$(am__dirstamp)
-src/x86/$(am__dirstamp):
- @$(MKDIR_P) src/x86
- @: > src/x86/$(am__dirstamp)
-src/x86/$(DEPDIR)/$(am__dirstamp):
- @$(MKDIR_P) src/x86/$(DEPDIR)
- @: > src/x86/$(DEPDIR)/$(am__dirstamp)
-src/x86/ffi.lo: src/x86/$(am__dirstamp) \
- src/x86/$(DEPDIR)/$(am__dirstamp)
-src/x86/sysv.lo: src/x86/$(am__dirstamp) \
- src/x86/$(DEPDIR)/$(am__dirstamp)
-src/x86/win32.lo: src/x86/$(am__dirstamp) \
- src/x86/$(DEPDIR)/$(am__dirstamp)
-src/x86/freebsd.lo: src/x86/$(am__dirstamp) \
- src/x86/$(DEPDIR)/$(am__dirstamp)
-src/x86/win64.lo: src/x86/$(am__dirstamp) \
- src/x86/$(DEPDIR)/$(am__dirstamp)
-src/x86/darwin.lo: src/x86/$(am__dirstamp) \
- src/x86/$(DEPDIR)/$(am__dirstamp)
-src/x86/ffi64.lo: src/x86/$(am__dirstamp) \
- src/x86/$(DEPDIR)/$(am__dirstamp)
-src/x86/darwin64.lo: src/x86/$(am__dirstamp) \
- src/x86/$(DEPDIR)/$(am__dirstamp)
-src/sparc/$(am__dirstamp):
- @$(MKDIR_P) src/sparc
- @: > src/sparc/$(am__dirstamp)
-src/sparc/$(DEPDIR)/$(am__dirstamp):
- @$(MKDIR_P) src/sparc/$(DEPDIR)
- @: > src/sparc/$(DEPDIR)/$(am__dirstamp)
-src/sparc/ffi.lo: src/sparc/$(am__dirstamp) \
- src/sparc/$(DEPDIR)/$(am__dirstamp)
-src/sparc/v8.lo: src/sparc/$(am__dirstamp) \
- src/sparc/$(DEPDIR)/$(am__dirstamp)
-src/sparc/v9.lo: src/sparc/$(am__dirstamp) \
- src/sparc/$(DEPDIR)/$(am__dirstamp)
-src/alpha/$(am__dirstamp):
- @$(MKDIR_P) src/alpha
- @: > src/alpha/$(am__dirstamp)
-src/alpha/$(DEPDIR)/$(am__dirstamp):
- @$(MKDIR_P) src/alpha/$(DEPDIR)
- @: > src/alpha/$(DEPDIR)/$(am__dirstamp)
-src/alpha/ffi.lo: src/alpha/$(am__dirstamp) \
- src/alpha/$(DEPDIR)/$(am__dirstamp)
-src/alpha/osf.lo: src/alpha/$(am__dirstamp) \
- src/alpha/$(DEPDIR)/$(am__dirstamp)
-src/ia64/$(am__dirstamp):
- @$(MKDIR_P) src/ia64
- @: > src/ia64/$(am__dirstamp)
-src/ia64/$(DEPDIR)/$(am__dirstamp):
- @$(MKDIR_P) src/ia64/$(DEPDIR)
- @: > src/ia64/$(DEPDIR)/$(am__dirstamp)
-src/ia64/ffi.lo: src/ia64/$(am__dirstamp) \
- src/ia64/$(DEPDIR)/$(am__dirstamp)
-src/ia64/unix.lo: src/ia64/$(am__dirstamp) \
- src/ia64/$(DEPDIR)/$(am__dirstamp)
-src/m32r/$(am__dirstamp):
- @$(MKDIR_P) src/m32r
- @: > src/m32r/$(am__dirstamp)
-src/m32r/$(DEPDIR)/$(am__dirstamp):
- @$(MKDIR_P) src/m32r/$(DEPDIR)
- @: > src/m32r/$(DEPDIR)/$(am__dirstamp)
-src/m32r/sysv.lo: src/m32r/$(am__dirstamp) \
- src/m32r/$(DEPDIR)/$(am__dirstamp)
-src/m32r/ffi.lo: src/m32r/$(am__dirstamp) \
- src/m32r/$(DEPDIR)/$(am__dirstamp)
-src/m68k/$(am__dirstamp):
- @$(MKDIR_P) src/m68k
- @: > src/m68k/$(am__dirstamp)
-src/m68k/$(DEPDIR)/$(am__dirstamp):
- @$(MKDIR_P) src/m68k/$(DEPDIR)
- @: > src/m68k/$(DEPDIR)/$(am__dirstamp)
-src/m68k/ffi.lo: src/m68k/$(am__dirstamp) \
- src/m68k/$(DEPDIR)/$(am__dirstamp)
-src/m68k/sysv.lo: src/m68k/$(am__dirstamp) \
- src/m68k/$(DEPDIR)/$(am__dirstamp)
-src/m88k/$(am__dirstamp):
- @$(MKDIR_P) src/m88k
- @: > src/m88k/$(am__dirstamp)
-src/m88k/$(DEPDIR)/$(am__dirstamp):
- @$(MKDIR_P) src/m88k/$(DEPDIR)
- @: > src/m88k/$(DEPDIR)/$(am__dirstamp)
-src/m88k/ffi.lo: src/m88k/$(am__dirstamp) \
- src/m88k/$(DEPDIR)/$(am__dirstamp)
-src/m88k/obsd.lo: src/m88k/$(am__dirstamp) \
- src/m88k/$(DEPDIR)/$(am__dirstamp)
-src/moxie/$(am__dirstamp):
- @$(MKDIR_P) src/moxie
- @: > src/moxie/$(am__dirstamp)
-src/moxie/$(DEPDIR)/$(am__dirstamp):
- @$(MKDIR_P) src/moxie/$(DEPDIR)
- @: > src/moxie/$(DEPDIR)/$(am__dirstamp)
-src/moxie/ffi.lo: src/moxie/$(am__dirstamp) \
- src/moxie/$(DEPDIR)/$(am__dirstamp)
-src/moxie/eabi.lo: src/moxie/$(am__dirstamp) \
- src/moxie/$(DEPDIR)/$(am__dirstamp)
-src/microblaze/$(am__dirstamp):
- @$(MKDIR_P) src/microblaze
- @: > src/microblaze/$(am__dirstamp)
-src/microblaze/$(DEPDIR)/$(am__dirstamp):
- @$(MKDIR_P) src/microblaze/$(DEPDIR)
- @: > src/microblaze/$(DEPDIR)/$(am__dirstamp)
-src/microblaze/ffi.lo: src/microblaze/$(am__dirstamp) \
- src/microblaze/$(DEPDIR)/$(am__dirstamp)
-src/microblaze/sysv.lo: src/microblaze/$(am__dirstamp) \
- src/microblaze/$(DEPDIR)/$(am__dirstamp)
-src/nios2/$(am__dirstamp):
- @$(MKDIR_P) src/nios2
- @: > src/nios2/$(am__dirstamp)
-src/nios2/$(DEPDIR)/$(am__dirstamp):
- @$(MKDIR_P) src/nios2/$(DEPDIR)
- @: > src/nios2/$(DEPDIR)/$(am__dirstamp)
-src/nios2/sysv.lo: src/nios2/$(am__dirstamp) \
- src/nios2/$(DEPDIR)/$(am__dirstamp)
-src/nios2/ffi.lo: src/nios2/$(am__dirstamp) \
- src/nios2/$(DEPDIR)/$(am__dirstamp)
-src/powerpc/$(am__dirstamp):
- @$(MKDIR_P) src/powerpc
- @: > src/powerpc/$(am__dirstamp)
-src/powerpc/$(DEPDIR)/$(am__dirstamp):
- @$(MKDIR_P) src/powerpc/$(DEPDIR)
- @: > src/powerpc/$(DEPDIR)/$(am__dirstamp)
-src/powerpc/ffi.lo: src/powerpc/$(am__dirstamp) \
- src/powerpc/$(DEPDIR)/$(am__dirstamp)
-src/powerpc/ffi_sysv.lo: src/powerpc/$(am__dirstamp) \
- src/powerpc/$(DEPDIR)/$(am__dirstamp)
-src/powerpc/ffi_linux64.lo: src/powerpc/$(am__dirstamp) \
- src/powerpc/$(DEPDIR)/$(am__dirstamp)
-src/powerpc/sysv.lo: src/powerpc/$(am__dirstamp) \
- src/powerpc/$(DEPDIR)/$(am__dirstamp)
-src/powerpc/ppc_closure.lo: src/powerpc/$(am__dirstamp) \
- src/powerpc/$(DEPDIR)/$(am__dirstamp)
-src/powerpc/linux64.lo: src/powerpc/$(am__dirstamp) \
- src/powerpc/$(DEPDIR)/$(am__dirstamp)
-src/powerpc/linux64_closure.lo: src/powerpc/$(am__dirstamp) \
- src/powerpc/$(DEPDIR)/$(am__dirstamp)
-src/powerpc/ffi_darwin.lo: src/powerpc/$(am__dirstamp) \
- src/powerpc/$(DEPDIR)/$(am__dirstamp)
-src/powerpc/aix.lo: src/powerpc/$(am__dirstamp) \
- src/powerpc/$(DEPDIR)/$(am__dirstamp)
-src/powerpc/aix_closure.lo: src/powerpc/$(am__dirstamp) \
- src/powerpc/$(DEPDIR)/$(am__dirstamp)
-src/powerpc/darwin.lo: src/powerpc/$(am__dirstamp) \
- src/powerpc/$(DEPDIR)/$(am__dirstamp)
-src/powerpc/darwin_closure.lo: src/powerpc/$(am__dirstamp) \
- src/powerpc/$(DEPDIR)/$(am__dirstamp)
-src/aarch64/$(am__dirstamp):
- @$(MKDIR_P) src/aarch64
- @: > src/aarch64/$(am__dirstamp)
-src/aarch64/$(DEPDIR)/$(am__dirstamp):
- @$(MKDIR_P) src/aarch64/$(DEPDIR)
- @: > src/aarch64/$(DEPDIR)/$(am__dirstamp)
-src/aarch64/sysv.lo: src/aarch64/$(am__dirstamp) \
- src/aarch64/$(DEPDIR)/$(am__dirstamp)
-src/aarch64/ffi.lo: src/aarch64/$(am__dirstamp) \
- src/aarch64/$(DEPDIR)/$(am__dirstamp)
-src/arc/$(am__dirstamp):
- @$(MKDIR_P) src/arc
- @: > src/arc/$(am__dirstamp)
-src/arc/$(DEPDIR)/$(am__dirstamp):
- @$(MKDIR_P) src/arc/$(DEPDIR)
- @: > src/arc/$(DEPDIR)/$(am__dirstamp)
-src/arc/arcompact.lo: src/arc/$(am__dirstamp) \
- src/arc/$(DEPDIR)/$(am__dirstamp)
-src/arc/ffi.lo: src/arc/$(am__dirstamp) \
- src/arc/$(DEPDIR)/$(am__dirstamp)
-src/arm/$(am__dirstamp):
- @$(MKDIR_P) src/arm
- @: > src/arm/$(am__dirstamp)
-src/arm/$(DEPDIR)/$(am__dirstamp):
- @$(MKDIR_P) src/arm/$(DEPDIR)
- @: > src/arm/$(DEPDIR)/$(am__dirstamp)
-src/arm/sysv.lo: src/arm/$(am__dirstamp) \
- src/arm/$(DEPDIR)/$(am__dirstamp)
-src/arm/ffi.lo: src/arm/$(am__dirstamp) \
- src/arm/$(DEPDIR)/$(am__dirstamp)
-src/arm/trampoline.lo: src/arm/$(am__dirstamp) \
- src/arm/$(DEPDIR)/$(am__dirstamp)
-src/avr32/$(am__dirstamp):
- @$(MKDIR_P) src/avr32
- @: > src/avr32/$(am__dirstamp)
-src/avr32/$(DEPDIR)/$(am__dirstamp):
- @$(MKDIR_P) src/avr32/$(DEPDIR)
- @: > src/avr32/$(DEPDIR)/$(am__dirstamp)
-src/avr32/sysv.lo: src/avr32/$(am__dirstamp) \
- src/avr32/$(DEPDIR)/$(am__dirstamp)
-src/avr32/ffi.lo: src/avr32/$(am__dirstamp) \
- src/avr32/$(DEPDIR)/$(am__dirstamp)
-src/cris/$(am__dirstamp):
- @$(MKDIR_P) src/cris
- @: > src/cris/$(am__dirstamp)
-src/cris/$(DEPDIR)/$(am__dirstamp):
- @$(MKDIR_P) src/cris/$(DEPDIR)
- @: > src/cris/$(DEPDIR)/$(am__dirstamp)
-src/cris/sysv.lo: src/cris/$(am__dirstamp) \
- src/cris/$(DEPDIR)/$(am__dirstamp)
-src/cris/ffi.lo: src/cris/$(am__dirstamp) \
- src/cris/$(DEPDIR)/$(am__dirstamp)
-src/frv/$(am__dirstamp):
- @$(MKDIR_P) src/frv
- @: > src/frv/$(am__dirstamp)
-src/frv/$(DEPDIR)/$(am__dirstamp):
- @$(MKDIR_P) src/frv/$(DEPDIR)
- @: > src/frv/$(DEPDIR)/$(am__dirstamp)
-src/frv/eabi.lo: src/frv/$(am__dirstamp) \
- src/frv/$(DEPDIR)/$(am__dirstamp)
-src/frv/ffi.lo: src/frv/$(am__dirstamp) \
- src/frv/$(DEPDIR)/$(am__dirstamp)
-src/s390/$(am__dirstamp):
- @$(MKDIR_P) src/s390
- @: > src/s390/$(am__dirstamp)
-src/s390/$(DEPDIR)/$(am__dirstamp):
- @$(MKDIR_P) src/s390/$(DEPDIR)
- @: > src/s390/$(DEPDIR)/$(am__dirstamp)
-src/s390/sysv.lo: src/s390/$(am__dirstamp) \
- src/s390/$(DEPDIR)/$(am__dirstamp)
-src/s390/ffi.lo: src/s390/$(am__dirstamp) \
- src/s390/$(DEPDIR)/$(am__dirstamp)
-src/x86/unix64.lo: src/x86/$(am__dirstamp) \
- src/x86/$(DEPDIR)/$(am__dirstamp)
-src/sh/$(am__dirstamp):
- @$(MKDIR_P) src/sh
- @: > src/sh/$(am__dirstamp)
-src/sh/$(DEPDIR)/$(am__dirstamp):
- @$(MKDIR_P) src/sh/$(DEPDIR)
- @: > src/sh/$(DEPDIR)/$(am__dirstamp)
-src/sh/sysv.lo: src/sh/$(am__dirstamp) \
- src/sh/$(DEPDIR)/$(am__dirstamp)
-src/sh/ffi.lo: src/sh/$(am__dirstamp) src/sh/$(DEPDIR)/$(am__dirstamp)
-src/sh64/$(am__dirstamp):
- @$(MKDIR_P) src/sh64
- @: > src/sh64/$(am__dirstamp)
-src/sh64/$(DEPDIR)/$(am__dirstamp):
- @$(MKDIR_P) src/sh64/$(DEPDIR)
- @: > src/sh64/$(DEPDIR)/$(am__dirstamp)
-src/sh64/sysv.lo: src/sh64/$(am__dirstamp) \
- src/sh64/$(DEPDIR)/$(am__dirstamp)
-src/sh64/ffi.lo: src/sh64/$(am__dirstamp) \
- src/sh64/$(DEPDIR)/$(am__dirstamp)
-src/pa/$(am__dirstamp):
- @$(MKDIR_P) src/pa
- @: > src/pa/$(am__dirstamp)
-src/pa/$(DEPDIR)/$(am__dirstamp):
- @$(MKDIR_P) src/pa/$(DEPDIR)
- @: > src/pa/$(DEPDIR)/$(am__dirstamp)
-src/pa/linux.lo: src/pa/$(am__dirstamp) \
- src/pa/$(DEPDIR)/$(am__dirstamp)
-src/pa/ffi.lo: src/pa/$(am__dirstamp) src/pa/$(DEPDIR)/$(am__dirstamp)
-src/pa/hpux32.lo: src/pa/$(am__dirstamp) \
- src/pa/$(DEPDIR)/$(am__dirstamp)
-src/tile/$(am__dirstamp):
- @$(MKDIR_P) src/tile
- @: > src/tile/$(am__dirstamp)
-src/tile/$(DEPDIR)/$(am__dirstamp):
- @$(MKDIR_P) src/tile/$(DEPDIR)
- @: > src/tile/$(DEPDIR)/$(am__dirstamp)
-src/tile/tile.lo: src/tile/$(am__dirstamp) \
- src/tile/$(DEPDIR)/$(am__dirstamp)
-src/tile/ffi.lo: src/tile/$(am__dirstamp) \
- src/tile/$(DEPDIR)/$(am__dirstamp)
-src/xtensa/$(am__dirstamp):
- @$(MKDIR_P) src/xtensa
- @: > src/xtensa/$(am__dirstamp)
-src/xtensa/$(DEPDIR)/$(am__dirstamp):
- @$(MKDIR_P) src/xtensa/$(DEPDIR)
- @: > src/xtensa/$(DEPDIR)/$(am__dirstamp)
-src/xtensa/sysv.lo: src/xtensa/$(am__dirstamp) \
- src/xtensa/$(DEPDIR)/$(am__dirstamp)
-src/xtensa/ffi.lo: src/xtensa/$(am__dirstamp) \
- src/xtensa/$(DEPDIR)/$(am__dirstamp)
-src/metag/$(am__dirstamp):
- @$(MKDIR_P) src/metag
- @: > src/metag/$(am__dirstamp)
-src/metag/$(DEPDIR)/$(am__dirstamp):
- @$(MKDIR_P) src/metag/$(DEPDIR)
- @: > src/metag/$(DEPDIR)/$(am__dirstamp)
-src/metag/sysv.lo: src/metag/$(am__dirstamp) \
- src/metag/$(DEPDIR)/$(am__dirstamp)
-src/metag/ffi.lo: src/metag/$(am__dirstamp) \
- src/metag/$(DEPDIR)/$(am__dirstamp)
-src/vax/$(am__dirstamp):
- @$(MKDIR_P) src/vax
- @: > src/vax/$(am__dirstamp)
-src/vax/$(DEPDIR)/$(am__dirstamp):
- @$(MKDIR_P) src/vax/$(DEPDIR)
- @: > src/vax/$(DEPDIR)/$(am__dirstamp)
-src/vax/elfbsd.lo: src/vax/$(am__dirstamp) \
- src/vax/$(DEPDIR)/$(am__dirstamp)
-src/vax/ffi.lo: src/vax/$(am__dirstamp) \
- src/vax/$(DEPDIR)/$(am__dirstamp)
-
-libffi.la: $(libffi_la_OBJECTS) $(libffi_la_DEPENDENCIES) $(EXTRA_libffi_la_DEPENDENCIES)
- $(AM_V_CCLD)$(libffi_la_LINK) -rpath $(toolexeclibdir) $(libffi_la_OBJECTS) $(libffi_la_LIBADD) $(LIBS)
-
-libffi_convenience.la: $(libffi_convenience_la_OBJECTS) $(libffi_convenience_la_DEPENDENCIES) $(EXTRA_libffi_convenience_la_DEPENDENCIES)
- $(AM_V_CCLD)$(LINK) $(libffi_convenience_la_OBJECTS) $(libffi_convenience_la_LIBADD) $(LIBS)
-
-mostlyclean-compile:
- -rm -f *.$(OBJEXT)
- -rm -f src/*.$(OBJEXT)
- -rm -f src/*.lo
- -rm -f src/aarch64/*.$(OBJEXT)
- -rm -f src/aarch64/*.lo
- -rm -f src/alpha/*.$(OBJEXT)
- -rm -f src/alpha/*.lo
- -rm -f src/arc/*.$(OBJEXT)
- -rm -f src/arc/*.lo
- -rm -f src/arm/*.$(OBJEXT)
- -rm -f src/arm/*.lo
- -rm -f src/avr32/*.$(OBJEXT)
- -rm -f src/avr32/*.lo
- -rm -f src/bfin/*.$(OBJEXT)
- -rm -f src/bfin/*.lo
- -rm -f src/cris/*.$(OBJEXT)
- -rm -f src/cris/*.lo
- -rm -f src/frv/*.$(OBJEXT)
- -rm -f src/frv/*.lo
- -rm -f src/ia64/*.$(OBJEXT)
- -rm -f src/ia64/*.lo
- -rm -f src/m32r/*.$(OBJEXT)
- -rm -f src/m32r/*.lo
- -rm -f src/m68k/*.$(OBJEXT)
- -rm -f src/m68k/*.lo
- -rm -f src/m88k/*.$(OBJEXT)
- -rm -f src/m88k/*.lo
- -rm -f src/metag/*.$(OBJEXT)
- -rm -f src/metag/*.lo
- -rm -f src/microblaze/*.$(OBJEXT)
- -rm -f src/microblaze/*.lo
- -rm -f src/mips/*.$(OBJEXT)
- -rm -f src/mips/*.lo
- -rm -f src/moxie/*.$(OBJEXT)
- -rm -f src/moxie/*.lo
- -rm -f src/nios2/*.$(OBJEXT)
- -rm -f src/nios2/*.lo
- -rm -f src/pa/*.$(OBJEXT)
- -rm -f src/pa/*.lo
- -rm -f src/powerpc/*.$(OBJEXT)
- -rm -f src/powerpc/*.lo
- -rm -f src/s390/*.$(OBJEXT)
- -rm -f src/s390/*.lo
- -rm -f src/sh/*.$(OBJEXT)
- -rm -f src/sh/*.lo
- -rm -f src/sh64/*.$(OBJEXT)
- -rm -f src/sh64/*.lo
- -rm -f src/sparc/*.$(OBJEXT)
- -rm -f src/sparc/*.lo
- -rm -f src/tile/*.$(OBJEXT)
- -rm -f src/tile/*.lo
- -rm -f src/vax/*.$(OBJEXT)
- -rm -f src/vax/*.lo
- -rm -f src/x86/*.$(OBJEXT)
- -rm -f src/x86/*.lo
- -rm -f src/xtensa/*.$(OBJEXT)
- -rm -f src/xtensa/*.lo
-
-distclean-compile:
- -rm -f *.tab.c
-
-@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/closures.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/debug.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/java_raw_api.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/prep_cif.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/raw_api.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/types.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/aarch64/$(DEPDIR)/ffi.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/aarch64/$(DEPDIR)/sysv.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/alpha/$(DEPDIR)/ffi.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/alpha/$(DEPDIR)/osf.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/arc/$(DEPDIR)/arcompact.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/arc/$(DEPDIR)/ffi.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/arm/$(DEPDIR)/ffi.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/arm/$(DEPDIR)/sysv.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/arm/$(DEPDIR)/trampoline.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/avr32/$(DEPDIR)/ffi.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/avr32/$(DEPDIR)/sysv.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/bfin/$(DEPDIR)/ffi.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/bfin/$(DEPDIR)/sysv.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/cris/$(DEPDIR)/ffi.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/cris/$(DEPDIR)/sysv.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/frv/$(DEPDIR)/eabi.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/frv/$(DEPDIR)/ffi.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/ia64/$(DEPDIR)/ffi.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/ia64/$(DEPDIR)/unix.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/m32r/$(DEPDIR)/ffi.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/m32r/$(DEPDIR)/sysv.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/m68k/$(DEPDIR)/ffi.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/m68k/$(DEPDIR)/sysv.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/m88k/$(DEPDIR)/ffi.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/m88k/$(DEPDIR)/obsd.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/metag/$(DEPDIR)/ffi.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/metag/$(DEPDIR)/sysv.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/microblaze/$(DEPDIR)/ffi.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/microblaze/$(DEPDIR)/sysv.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/mips/$(DEPDIR)/ffi.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/mips/$(DEPDIR)/n32.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/mips/$(DEPDIR)/o32.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/moxie/$(DEPDIR)/eabi.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/moxie/$(DEPDIR)/ffi.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/nios2/$(DEPDIR)/ffi.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/nios2/$(DEPDIR)/sysv.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/pa/$(DEPDIR)/ffi.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/pa/$(DEPDIR)/hpux32.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/pa/$(DEPDIR)/linux.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/powerpc/$(DEPDIR)/aix.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/powerpc/$(DEPDIR)/aix_closure.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/powerpc/$(DEPDIR)/darwin.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/powerpc/$(DEPDIR)/darwin_closure.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/powerpc/$(DEPDIR)/ffi.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/powerpc/$(DEPDIR)/ffi_darwin.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/powerpc/$(DEPDIR)/ffi_linux64.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/powerpc/$(DEPDIR)/ffi_sysv.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/powerpc/$(DEPDIR)/linux64.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/powerpc/$(DEPDIR)/linux64_closure.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/powerpc/$(DEPDIR)/ppc_closure.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/powerpc/$(DEPDIR)/sysv.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/s390/$(DEPDIR)/ffi.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/s390/$(DEPDIR)/sysv.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/sh/$(DEPDIR)/ffi.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/sh/$(DEPDIR)/sysv.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/sh64/$(DEPDIR)/ffi.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/sh64/$(DEPDIR)/sysv.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/sparc/$(DEPDIR)/ffi.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/sparc/$(DEPDIR)/v8.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/sparc/$(DEPDIR)/v9.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/tile/$(DEPDIR)/ffi.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/tile/$(DEPDIR)/tile.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/vax/$(DEPDIR)/elfbsd.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/vax/$(DEPDIR)/ffi.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/x86/$(DEPDIR)/darwin.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/x86/$(DEPDIR)/darwin64.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/x86/$(DEPDIR)/ffi.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/x86/$(DEPDIR)/ffi64.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/x86/$(DEPDIR)/freebsd.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/x86/$(DEPDIR)/sysv.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/x86/$(DEPDIR)/unix64.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/x86/$(DEPDIR)/win32.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/x86/$(DEPDIR)/win64.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/xtensa/$(DEPDIR)/ffi.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/xtensa/$(DEPDIR)/sysv.Plo@am__quote@
-
-.S.o:
-@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
-@am__fastdepCCAS_TRUE@ $(CPPASCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
-@am__fastdepCCAS_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
-@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(CPPASCOMPILE) -c -o $@ $<
-
-.S.obj:
-@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\
-@am__fastdepCCAS_TRUE@ $(CPPASCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\
-@am__fastdepCCAS_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
-@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(CPPASCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
-
-.S.lo:
-@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\
-@am__fastdepCCAS_TRUE@ $(LTCPPASCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
-@am__fastdepCCAS_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo
-@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(LTCPPASCOMPILE) -c -o $@ $<
-
-.c.o:
-@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
-@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
-@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
-
-.c.obj:
-@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\
-@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\
-@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
-
-.c.lo:
-@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\
-@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
-@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
-
-mostlyclean-libtool:
- -rm -f *.lo
-
-clean-libtool:
- -rm -rf .libs _libs
- -rm -rf src/.libs src/_libs
- -rm -rf src/aarch64/.libs src/aarch64/_libs
- -rm -rf src/alpha/.libs src/alpha/_libs
- -rm -rf src/arc/.libs src/arc/_libs
- -rm -rf src/arm/.libs src/arm/_libs
- -rm -rf src/avr32/.libs src/avr32/_libs
- -rm -rf src/bfin/.libs src/bfin/_libs
- -rm -rf src/cris/.libs src/cris/_libs
- -rm -rf src/frv/.libs src/frv/_libs
- -rm -rf src/ia64/.libs src/ia64/_libs
- -rm -rf src/m32r/.libs src/m32r/_libs
- -rm -rf src/m68k/.libs src/m68k/_libs
- -rm -rf src/m88k/.libs src/m88k/_libs
- -rm -rf src/metag/.libs src/metag/_libs
- -rm -rf src/microblaze/.libs src/microblaze/_libs
- -rm -rf src/mips/.libs src/mips/_libs
- -rm -rf src/moxie/.libs src/moxie/_libs
- -rm -rf src/nios2/.libs src/nios2/_libs
- -rm -rf src/pa/.libs src/pa/_libs
- -rm -rf src/powerpc/.libs src/powerpc/_libs
- -rm -rf src/s390/.libs src/s390/_libs
- -rm -rf src/sh/.libs src/sh/_libs
- -rm -rf src/sh64/.libs src/sh64/_libs
- -rm -rf src/sparc/.libs src/sparc/_libs
- -rm -rf src/tile/.libs src/tile/_libs
- -rm -rf src/vax/.libs src/vax/_libs
- -rm -rf src/x86/.libs src/x86/_libs
- -rm -rf src/xtensa/.libs src/xtensa/_libs
-
-distclean-libtool:
- -rm -f libtool config.lt
-doc/$(am__dirstamp):
- @$(MKDIR_P) doc
- @: > doc/$(am__dirstamp)
-
-$(srcdir)/doc/libffi.info: doc/libffi.texi $(srcdir)/doc/version.texi
- $(AM_V_MAKEINFO)restore=: && backupdir="$(am__leading_dot)am$$$$" && \
- am__cwd=`pwd` && $(am__cd) $(srcdir) && \
- rm -rf $$backupdir && mkdir $$backupdir && \
- if ($(MAKEINFO) --version) >/dev/null 2>&1; then \
- for f in $@ $@-[0-9] $@-[0-9][0-9] $(@:.info=).i[0-9] $(@:.info=).i[0-9][0-9]; do \
- if test -f $$f; then mv $$f $$backupdir; restore=mv; else :; fi; \
- done; \
- else :; fi && \
- cd "$$am__cwd"; \
- if $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I doc -I $(srcdir)/doc \
- -o $@ $(srcdir)/doc/libffi.texi; \
- then \
- rc=0; \
- $(am__cd) $(srcdir); \
- else \
- rc=$$?; \
- $(am__cd) $(srcdir) && \
- $$restore $$backupdir/* `echo "./$@" | sed 's|[^/]*$$||'`; \
- fi; \
- rm -rf $$backupdir; exit $$rc
-
-doc/libffi.dvi: doc/libffi.texi $(srcdir)/doc/version.texi doc/$(am__dirstamp)
- $(AM_V_TEXI2DVI)TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
- MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I doc -I $(srcdir)/doc' \
- $(TEXI2DVI) $(AM_V_texinfo) --build-dir=$(@:.dvi=.t2d) -o $@ $(AM_V_texidevnull) \
- `test -f 'doc/libffi.texi' || echo '$(srcdir)/'`doc/libffi.texi
-
-doc/libffi.pdf: doc/libffi.texi $(srcdir)/doc/version.texi doc/$(am__dirstamp)
- $(AM_V_TEXI2PDF)TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
- MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I doc -I $(srcdir)/doc' \
- $(TEXI2PDF) $(AM_V_texinfo) --build-dir=$(@:.pdf=.t2p) -o $@ $(AM_V_texidevnull) \
- `test -f 'doc/libffi.texi' || echo '$(srcdir)/'`doc/libffi.texi
-
-doc/libffi.html: doc/libffi.texi $(srcdir)/doc/version.texi doc/$(am__dirstamp)
- $(AM_V_MAKEINFO)rm -rf $(@:.html=.htp)
- $(AM_V_at)if $(MAKEINFOHTML) $(AM_MAKEINFOHTMLFLAGS) $(MAKEINFOFLAGS) -I doc -I $(srcdir)/doc \
- -o $(@:.html=.htp) `test -f 'doc/libffi.texi' || echo '$(srcdir)/'`doc/libffi.texi; \
- then \
- rm -rf $@; \
- if test ! -d $(@:.html=.htp) && test -d $(@:.html=); then \
- mv $(@:.html=) $@; else mv $(@:.html=.htp) $@; fi; \
- else \
- if test ! -d $(@:.html=.htp) && test -d $(@:.html=); then \
- rm -rf $(@:.html=); else rm -Rf $(@:.html=.htp) $@; fi; \
- exit 1; \
- fi
-$(srcdir)/doc/version.texi: @MAINTAINER_MODE_TRUE@ $(srcdir)/doc/stamp-vti
-$(srcdir)/doc/stamp-vti: doc/libffi.texi $(top_srcdir)/configure
- test -f doc/$(am__dirstamp) || $(MAKE) $(AM_MAKEFLAGS) doc/$(am__dirstamp)
- @(dir=.; test -f ./doc/libffi.texi || dir=$(srcdir); \
- set `$(SHELL) $(srcdir)/mdate-sh $$dir/doc/libffi.texi`; \
- echo "@set UPDATED $$1 $$2 $$3"; \
- echo "@set UPDATED-MONTH $$2 $$3"; \
- echo "@set EDITION $(VERSION)"; \
- echo "@set VERSION $(VERSION)") > vti.tmp
- @cmp -s vti.tmp $(srcdir)/doc/version.texi \
- || (echo "Updating $(srcdir)/doc/version.texi"; \
- cp vti.tmp $(srcdir)/doc/version.texi)
- -@rm -f vti.tmp
- @cp $(srcdir)/doc/version.texi $@
-
-mostlyclean-vti:
- -rm -f vti.tmp
-
-maintainer-clean-vti:
-@MAINTAINER_MODE_TRUE@ -rm -f $(srcdir)/doc/stamp-vti $(srcdir)/doc/version.texi
-.dvi.ps:
- $(AM_V_DVIPS)TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
- $(DVIPS) $(AM_V_texinfo) -o $@ $<
-
-uninstall-dvi-am:
- @$(NORMAL_UNINSTALL)
- @list='$(DVIS)'; test -n "$(dvidir)" || list=; \
- for p in $$list; do \
- $(am__strip_dir) \
- echo " rm -f '$(DESTDIR)$(dvidir)/$$f'"; \
- rm -f "$(DESTDIR)$(dvidir)/$$f"; \
- done
-
-uninstall-html-am:
- @$(NORMAL_UNINSTALL)
- @list='$(HTMLS)'; test -n "$(htmldir)" || list=; \
- for p in $$list; do \
- $(am__strip_dir) \
- echo " rm -rf '$(DESTDIR)$(htmldir)/$$f'"; \
- rm -rf "$(DESTDIR)$(htmldir)/$$f"; \
- done
-
-uninstall-info-am:
- @$(PRE_UNINSTALL)
- @if test -d '$(DESTDIR)$(infodir)' && $(am__can_run_installinfo); then \
- list='$(INFO_DEPS)'; \
- for file in $$list; do \
- relfile=`echo "$$file" | sed 's|^.*/||'`; \
- echo " install-info --info-dir='$(DESTDIR)$(infodir)' --remove '$(DESTDIR)$(infodir)/$$relfile'"; \
- if install-info --info-dir="$(DESTDIR)$(infodir)" --remove "$(DESTDIR)$(infodir)/$$relfile"; \
- then :; else test ! -f "$(DESTDIR)$(infodir)/$$relfile" || exit 1; fi; \
- done; \
- else :; fi
- @$(NORMAL_UNINSTALL)
- @list='$(INFO_DEPS)'; \
- for file in $$list; do \
- relfile=`echo "$$file" | sed 's|^.*/||'`; \
- relfile_i=`echo "$$relfile" | sed 's|\.info$$||;s|$$|.i|'`; \
- (if test -d "$(DESTDIR)$(infodir)" && cd "$(DESTDIR)$(infodir)"; then \
- echo " cd '$(DESTDIR)$(infodir)' && rm -f $$relfile $$relfile-[0-9] $$relfile-[0-9][0-9] $$relfile_i[0-9] $$relfile_i[0-9][0-9]"; \
- rm -f $$relfile $$relfile-[0-9] $$relfile-[0-9][0-9] $$relfile_i[0-9] $$relfile_i[0-9][0-9]; \
- else :; fi); \
- done
-
-uninstall-pdf-am:
- @$(NORMAL_UNINSTALL)
- @list='$(PDFS)'; test -n "$(pdfdir)" || list=; \
- for p in $$list; do \
- $(am__strip_dir) \
- echo " rm -f '$(DESTDIR)$(pdfdir)/$$f'"; \
- rm -f "$(DESTDIR)$(pdfdir)/$$f"; \
- done
-
-uninstall-ps-am:
- @$(NORMAL_UNINSTALL)
- @list='$(PSS)'; test -n "$(psdir)" || list=; \
- for p in $$list; do \
- $(am__strip_dir) \
- echo " rm -f '$(DESTDIR)$(psdir)/$$f'"; \
- rm -f "$(DESTDIR)$(psdir)/$$f"; \
- done
-
-dist-info: $(INFO_DEPS)
- @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
- list='$(INFO_DEPS)'; \
- for base in $$list; do \
- case $$base in \
- $(srcdir)/*) base=`echo "$$base" | sed "s|^$$srcdirstrip/||"`;; \
- esac; \
- if test -f $$base; then d=.; else d=$(srcdir); fi; \
- base_i=`echo "$$base" | sed 's|\.info$$||;s|$$|.i|'`; \
- for file in $$d/$$base $$d/$$base-[0-9] $$d/$$base-[0-9][0-9] $$d/$$base_i[0-9] $$d/$$base_i[0-9][0-9]; do \
- if test -f $$file; then \
- relfile=`expr "$$file" : "$$d/\(.*\)"`; \
- test -f "$(distdir)/$$relfile" || \
- cp -p $$file "$(distdir)/$$relfile"; \
- else :; fi; \
- done; \
- done
-
-mostlyclean-aminfo:
- -rm -rf doc/libffi.t2d doc/libffi.t2p
-
-clean-aminfo:
- -test -z "doc/libffi.dvi doc/libffi.pdf doc/libffi.ps doc/libffi.html" \
- || rm -rf doc/libffi.dvi doc/libffi.pdf doc/libffi.ps doc/libffi.html
-
-maintainer-clean-aminfo:
- @list='$(INFO_DEPS)'; for i in $$list; do \
- i_i=`echo "$$i" | sed 's|\.info$$||;s|$$|.i|'`; \
- echo " rm -f $$i $$i-[0-9] $$i-[0-9][0-9] $$i_i[0-9] $$i_i[0-9][0-9]"; \
- rm -f $$i $$i-[0-9] $$i-[0-9][0-9] $$i_i[0-9] $$i_i[0-9][0-9]; \
- done
-install-pkgconfigDATA: $(pkgconfig_DATA)
- @$(NORMAL_INSTALL)
- @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \
- if test -n "$$list"; then \
- echo " $(MKDIR_P) '$(DESTDIR)$(pkgconfigdir)'"; \
- $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" || exit 1; \
- fi; \
- for p in $$list; do \
- if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
- echo "$$d$$p"; \
- done | $(am__base_list) | \
- while read files; do \
- echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgconfigdir)'"; \
- $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgconfigdir)" || exit $$?; \
- done
-
-uninstall-pkgconfigDATA:
- @$(NORMAL_UNINSTALL)
- @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \
- files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
- dir='$(DESTDIR)$(pkgconfigdir)'; $(am__uninstall_files_from_dir)
-
-# This directory's subdirectories are mostly independent; you can cd
-# into them and run 'make' without going through this Makefile.
-# To change the values of 'make' variables: instead of editing Makefiles,
-# (1) if the variable is set in 'config.status', edit 'config.status'
-# (which will cause the Makefiles to be regenerated when you run 'make');
-# (2) otherwise, pass the desired values on the 'make' command line.
-$(am__recursive_targets):
- @fail=; \
- if $(am__make_keepgoing); then \
- failcom='fail=yes'; \
- else \
- failcom='exit 1'; \
- fi; \
- dot_seen=no; \
- target=`echo $@ | sed s/-recursive//`; \
- case "$@" in \
- distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
- *) list='$(SUBDIRS)' ;; \
- esac; \
- for subdir in $$list; do \
- echo "Making $$target in $$subdir"; \
- if test "$$subdir" = "."; then \
- dot_seen=yes; \
- local_target="$$target-am"; \
- else \
- local_target="$$target"; \
- fi; \
- ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
- || eval $$failcom; \
- done; \
- if test "$$dot_seen" = "no"; then \
- $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
- fi; test -z "$$fail"
-
-ID: $(am__tagged_files)
- $(am__define_uniq_tagged_files); mkid -fID $$unique
-tags: tags-recursive
-TAGS: tags
-
-tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
- set x; \
- here=`pwd`; \
- if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
- include_option=--etags-include; \
- empty_fix=.; \
- else \
- include_option=--include; \
- empty_fix=; \
- fi; \
- list='$(SUBDIRS)'; for subdir in $$list; do \
- if test "$$subdir" = .; then :; else \
- test ! -f $$subdir/TAGS || \
- set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
- fi; \
- done; \
- $(am__define_uniq_tagged_files); \
- shift; \
- if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
- test -n "$$unique" || unique=$$empty_fix; \
- if test $$# -gt 0; then \
- $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- "$$@" $$unique; \
- else \
- $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- $$unique; \
- fi; \
- fi
-ctags: ctags-recursive
-
-CTAGS: ctags
-ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
- $(am__define_uniq_tagged_files); \
- test -z "$(CTAGS_ARGS)$$unique" \
- || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
- $$unique
-
-GTAGS:
- here=`$(am__cd) $(top_builddir) && pwd` \
- && $(am__cd) $(top_srcdir) \
- && gtags -i $(GTAGS_ARGS) "$$here"
-cscope: cscope.files
- test ! -s cscope.files \
- || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS)
-clean-cscope:
- -rm -f cscope.files
-cscope.files: clean-cscope cscopelist
-cscopelist: cscopelist-recursive
-
-cscopelist-am: $(am__tagged_files)
- list='$(am__tagged_files)'; \
- case "$(srcdir)" in \
- [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
- *) sdir=$(subdir)/$(srcdir) ;; \
- esac; \
- for i in $$list; do \
- if test -f "$$i"; then \
- echo "$(subdir)/$$i"; \
- else \
- echo "$$sdir/$$i"; \
- fi; \
- done >> $(top_builddir)/cscope.files
-
-distclean-tags:
- -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
- -rm -f cscope.out cscope.in.out cscope.po.out cscope.files
-
-distdir: $(DISTFILES)
- $(am__remove_distdir)
- test -d "$(distdir)" || mkdir "$(distdir)"
- @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
- topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
- list='$(DISTFILES)'; \
- dist_files=`for file in $$list; do echo $$file; done | \
- sed -e "s|^$$srcdirstrip/||;t" \
- -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
- case $$dist_files in \
- */*) $(MKDIR_P) `echo "$$dist_files" | \
- sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
- sort -u` ;; \
- esac; \
- for file in $$dist_files; do \
- if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
- if test -d $$d/$$file; then \
- dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
- if test -d "$(distdir)/$$file"; then \
- find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
- fi; \
- if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
- cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
- find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
- fi; \
- cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
- else \
- test -f "$(distdir)/$$file" \
- || cp -p $$d/$$file "$(distdir)/$$file" \
- || exit 1; \
- fi; \
- done
- @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
- if test "$$subdir" = .; then :; else \
- $(am__make_dryrun) \
- || test -d "$(distdir)/$$subdir" \
- || $(MKDIR_P) "$(distdir)/$$subdir" \
- || exit 1; \
- dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
- $(am__relativize); \
- new_distdir=$$reldir; \
- dir1=$$subdir; dir2="$(top_distdir)"; \
- $(am__relativize); \
- new_top_distdir=$$reldir; \
- echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
- echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
- ($(am__cd) $$subdir && \
- $(MAKE) $(AM_MAKEFLAGS) \
- top_distdir="$$new_top_distdir" \
- distdir="$$new_distdir" \
- am__remove_distdir=: \
- am__skip_length_check=: \
- am__skip_mode_fix=: \
- distdir) \
- || exit 1; \
- fi; \
- done
- $(MAKE) $(AM_MAKEFLAGS) \
- top_distdir="$(top_distdir)" distdir="$(distdir)" \
- dist-info dist-hook
- -test -n "$(am__skip_mode_fix)" \
- || find "$(distdir)" -type d ! -perm -755 \
- -exec chmod u+rwx,go+rx {} \; -o \
- ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
- ! -type d ! -perm -400 -exec chmod a+r {} \; -o \
- ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
- || chmod -R a+r "$(distdir)"
-dist-gzip: distdir
- tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
- $(am__post_remove_distdir)
-
-dist-bzip2: distdir
- tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2
- $(am__post_remove_distdir)
-
-dist-lzip: distdir
- tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz
- $(am__post_remove_distdir)
-
-dist-xz: distdir
- tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz
- $(am__post_remove_distdir)
-
-dist-tarZ: distdir
- tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
- $(am__post_remove_distdir)
-
-dist-shar: distdir
- shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
- $(am__post_remove_distdir)
-
-dist-zip: distdir
- -rm -f $(distdir).zip
- zip -rq $(distdir).zip $(distdir)
- $(am__post_remove_distdir)
-
-dist dist-all:
- $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:'
- $(am__post_remove_distdir)
-
-# This target untars the dist file and tries a VPATH configuration. Then
-# it guarantees that the distribution is self-contained by making another
-# tarfile.
-distcheck: dist
- case '$(DIST_ARCHIVES)' in \
- *.tar.gz*) \
- GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
- *.tar.bz2*) \
- bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
- *.tar.lz*) \
- lzip -dc $(distdir).tar.lz | $(am__untar) ;;\
- *.tar.xz*) \
- xz -dc $(distdir).tar.xz | $(am__untar) ;;\
- *.tar.Z*) \
- uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
- *.shar.gz*) \
- GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\
- *.zip*) \
- unzip $(distdir).zip ;;\
- esac
- chmod -R a-w $(distdir)
- chmod u+w $(distdir)
- mkdir $(distdir)/_build $(distdir)/_inst
- chmod a-w $(distdir)
- test -d $(distdir)/_build || exit 0; \
- dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
- && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
- && am__cwd=`pwd` \
- && $(am__cd) $(distdir)/_build \
- && ../configure --srcdir=.. --prefix="$$dc_install_base" \
- $(AM_DISTCHECK_CONFIGURE_FLAGS) \
- $(DISTCHECK_CONFIGURE_FLAGS) \
- && $(MAKE) $(AM_MAKEFLAGS) \
- && $(MAKE) $(AM_MAKEFLAGS) dvi \
- && $(MAKE) $(AM_MAKEFLAGS) check \
- && $(MAKE) $(AM_MAKEFLAGS) install \
- && $(MAKE) $(AM_MAKEFLAGS) installcheck \
- && $(MAKE) $(AM_MAKEFLAGS) uninstall \
- && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
- distuninstallcheck \
- && chmod -R a-w "$$dc_install_base" \
- && ({ \
- (cd ../.. && umask 077 && mkdir "$$dc_destdir") \
- && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
- && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
- && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
- distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
- } || { rm -rf "$$dc_destdir"; exit 1; }) \
- && rm -rf "$$dc_destdir" \
- && $(MAKE) $(AM_MAKEFLAGS) dist \
- && rm -rf $(DIST_ARCHIVES) \
- && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \
- && cd "$$am__cwd" \
- || exit 1
- $(am__post_remove_distdir)
- @(echo "$(distdir) archives ready for distribution: "; \
- list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
- sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
-distuninstallcheck:
- @test -n '$(distuninstallcheck_dir)' || { \
- echo 'ERROR: trying to run $@ with an empty' \
- '$$(distuninstallcheck_dir)' >&2; \
- exit 1; \
- }; \
- $(am__cd) '$(distuninstallcheck_dir)' || { \
- echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \
- exit 1; \
- }; \
- test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \
- || { echo "ERROR: files left after uninstall:" ; \
- if test -n "$(DESTDIR)"; then \
- echo " (check DESTDIR support)"; \
- fi ; \
- $(distuninstallcheck_listfiles) ; \
- exit 1; } >&2
-distcleancheck: distclean
- @if test '$(srcdir)' = . ; then \
- echo "ERROR: distcleancheck can only run from a VPATH build" ; \
- exit 1 ; \
- fi
- @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
- || { echo "ERROR: files left in build directory after distclean:" ; \
- $(distcleancheck_listfiles) ; \
- exit 1; } >&2
-check-am: all-am
-check: check-recursive
-all-am: Makefile $(INFO_DEPS) $(LTLIBRARIES) $(DATA) fficonfig.h
-installdirs: installdirs-recursive
-installdirs-am:
- for dir in "$(DESTDIR)$(toolexeclibdir)" "$(DESTDIR)$(infodir)" "$(DESTDIR)$(pkgconfigdir)"; do \
- test -z "$$dir" || $(MKDIR_P) "$$dir"; \
- done
-install: install-recursive
-install-exec: install-exec-recursive
-install-data: install-data-recursive
-uninstall: uninstall-recursive
-
-install-am: all-am
- @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-recursive
-install-strip:
- if test -z '$(STRIP)'; then \
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- install; \
- else \
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
- fi
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
- -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
- -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
- -rm -f doc/$(am__dirstamp)
- -rm -f src/$(DEPDIR)/$(am__dirstamp)
- -rm -f src/$(am__dirstamp)
- -rm -f src/aarch64/$(DEPDIR)/$(am__dirstamp)
- -rm -f src/aarch64/$(am__dirstamp)
- -rm -f src/alpha/$(DEPDIR)/$(am__dirstamp)
- -rm -f src/alpha/$(am__dirstamp)
- -rm -f src/arc/$(DEPDIR)/$(am__dirstamp)
- -rm -f src/arc/$(am__dirstamp)
- -rm -f src/arm/$(DEPDIR)/$(am__dirstamp)
- -rm -f src/arm/$(am__dirstamp)
- -rm -f src/avr32/$(DEPDIR)/$(am__dirstamp)
- -rm -f src/avr32/$(am__dirstamp)
- -rm -f src/bfin/$(DEPDIR)/$(am__dirstamp)
- -rm -f src/bfin/$(am__dirstamp)
- -rm -f src/cris/$(DEPDIR)/$(am__dirstamp)
- -rm -f src/cris/$(am__dirstamp)
- -rm -f src/frv/$(DEPDIR)/$(am__dirstamp)
- -rm -f src/frv/$(am__dirstamp)
- -rm -f src/ia64/$(DEPDIR)/$(am__dirstamp)
- -rm -f src/ia64/$(am__dirstamp)
- -rm -f src/m32r/$(DEPDIR)/$(am__dirstamp)
- -rm -f src/m32r/$(am__dirstamp)
- -rm -f src/m68k/$(DEPDIR)/$(am__dirstamp)
- -rm -f src/m68k/$(am__dirstamp)
- -rm -f src/m88k/$(DEPDIR)/$(am__dirstamp)
- -rm -f src/m88k/$(am__dirstamp)
- -rm -f src/metag/$(DEPDIR)/$(am__dirstamp)
- -rm -f src/metag/$(am__dirstamp)
- -rm -f src/microblaze/$(DEPDIR)/$(am__dirstamp)
- -rm -f src/microblaze/$(am__dirstamp)
- -rm -f src/mips/$(DEPDIR)/$(am__dirstamp)
- -rm -f src/mips/$(am__dirstamp)
- -rm -f src/moxie/$(DEPDIR)/$(am__dirstamp)
- -rm -f src/moxie/$(am__dirstamp)
- -rm -f src/nios2/$(DEPDIR)/$(am__dirstamp)
- -rm -f src/nios2/$(am__dirstamp)
- -rm -f src/pa/$(DEPDIR)/$(am__dirstamp)
- -rm -f src/pa/$(am__dirstamp)
- -rm -f src/powerpc/$(DEPDIR)/$(am__dirstamp)
- -rm -f src/powerpc/$(am__dirstamp)
- -rm -f src/s390/$(DEPDIR)/$(am__dirstamp)
- -rm -f src/s390/$(am__dirstamp)
- -rm -f src/sh/$(DEPDIR)/$(am__dirstamp)
- -rm -f src/sh/$(am__dirstamp)
- -rm -f src/sh64/$(DEPDIR)/$(am__dirstamp)
- -rm -f src/sh64/$(am__dirstamp)
- -rm -f src/sparc/$(DEPDIR)/$(am__dirstamp)
- -rm -f src/sparc/$(am__dirstamp)
- -rm -f src/tile/$(DEPDIR)/$(am__dirstamp)
- -rm -f src/tile/$(am__dirstamp)
- -rm -f src/vax/$(DEPDIR)/$(am__dirstamp)
- -rm -f src/vax/$(am__dirstamp)
- -rm -f src/x86/$(DEPDIR)/$(am__dirstamp)
- -rm -f src/x86/$(am__dirstamp)
- -rm -f src/xtensa/$(DEPDIR)/$(am__dirstamp)
- -rm -f src/xtensa/$(am__dirstamp)
-
-maintainer-clean-generic:
- @echo "This command is intended for maintainers to use"
- @echo "it deletes files that may require special tools to rebuild."
-clean: clean-recursive
-
-clean-am: clean-aminfo clean-generic clean-libtool \
- clean-noinstLTLIBRARIES clean-toolexeclibLTLIBRARIES \
- mostlyclean-am
-
-distclean: distclean-recursive
- -rm -f $(am__CONFIG_DISTCLEAN_FILES)
- -rm -rf src/$(DEPDIR) src/aarch64/$(DEPDIR) src/alpha/$(DEPDIR) src/arc/$(DEPDIR) src/arm/$(DEPDIR) src/avr32/$(DEPDIR) src/bfin/$(DEPDIR) src/cris/$(DEPDIR) src/frv/$(DEPDIR) src/ia64/$(DEPDIR) src/m32r/$(DEPDIR) src/m68k/$(DEPDIR) src/m88k/$(DEPDIR) src/metag/$(DEPDIR) src/microblaze/$(DEPDIR) src/mips/$(DEPDIR) src/moxie/$(DEPDIR) src/nios2/$(DEPDIR) src/pa/$(DEPDIR) src/powerpc/$(DEPDIR) src/s390/$(DEPDIR) src/sh/$(DEPDIR) src/sh64/$(DEPDIR) src/sparc/$(DEPDIR) src/tile/$(DEPDIR) src/vax/$(DEPDIR) src/x86/$(DEPDIR) src/xtensa/$(DEPDIR)
- -rm -f Makefile
-distclean-am: clean-am distclean-compile distclean-generic \
- distclean-hdr distclean-libtool distclean-tags
-
-dvi: dvi-recursive
-
-dvi-am: $(DVIS)
-
-html: html-recursive
-
-html-am: $(HTMLS)
-
-info: info-recursive
-
-info-am: $(INFO_DEPS)
-
-install-data-am: install-info-am install-pkgconfigDATA
-
-install-dvi: install-dvi-recursive
-
-install-dvi-am: $(DVIS)
- @$(NORMAL_INSTALL)
- @list='$(DVIS)'; test -n "$(dvidir)" || list=; \
- if test -n "$$list"; then \
- echo " $(MKDIR_P) '$(DESTDIR)$(dvidir)'"; \
- $(MKDIR_P) "$(DESTDIR)$(dvidir)" || exit 1; \
- fi; \
- for p in $$list; do \
- if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
- echo "$$d$$p"; \
- done | $(am__base_list) | \
- while read files; do \
- echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(dvidir)'"; \
- $(INSTALL_DATA) $$files "$(DESTDIR)$(dvidir)" || exit $$?; \
- done
-install-exec-am: install-toolexeclibLTLIBRARIES
-
-install-html: install-html-recursive
-
-install-html-am: $(HTMLS)
- @$(NORMAL_INSTALL)
- @list='$(HTMLS)'; list2=; test -n "$(htmldir)" || list=; \
- if test -n "$$list"; then \
- echo " $(MKDIR_P) '$(DESTDIR)$(htmldir)'"; \
- $(MKDIR_P) "$(DESTDIR)$(htmldir)" || exit 1; \
- fi; \
- for p in $$list; do \
- if test -f "$$p" || test -d "$$p"; then d=; else d="$(srcdir)/"; fi; \
- $(am__strip_dir) \
- d2=$$d$$p; \
- if test -d "$$d2"; then \
- echo " $(MKDIR_P) '$(DESTDIR)$(htmldir)/$$f'"; \
- $(MKDIR_P) "$(DESTDIR)$(htmldir)/$$f" || exit 1; \
- echo " $(INSTALL_DATA) '$$d2'/* '$(DESTDIR)$(htmldir)/$$f'"; \
- $(INSTALL_DATA) "$$d2"/* "$(DESTDIR)$(htmldir)/$$f" || exit $$?; \
- else \
- list2="$$list2 $$d2"; \
- fi; \
- done; \
- test -z "$$list2" || { echo "$$list2" | $(am__base_list) | \
- while read files; do \
- echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(htmldir)'"; \
- $(INSTALL_DATA) $$files "$(DESTDIR)$(htmldir)" || exit $$?; \
- done; }
-install-info: install-info-recursive
-
-install-info-am: $(INFO_DEPS)
- @$(NORMAL_INSTALL)
- @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
- list='$(INFO_DEPS)'; test -n "$(infodir)" || list=; \
- if test -n "$$list"; then \
- echo " $(MKDIR_P) '$(DESTDIR)$(infodir)'"; \
- $(MKDIR_P) "$(DESTDIR)$(infodir)" || exit 1; \
- fi; \
- for file in $$list; do \
- case $$file in \
- $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
- esac; \
- if test -f $$file; then d=.; else d=$(srcdir); fi; \
- file_i=`echo "$$file" | sed 's|\.info$$||;s|$$|.i|'`; \
- for ifile in $$d/$$file $$d/$$file-[0-9] $$d/$$file-[0-9][0-9] \
- $$d/$$file_i[0-9] $$d/$$file_i[0-9][0-9] ; do \
- if test -f $$ifile; then \
- echo "$$ifile"; \
- else : ; fi; \
- done; \
- done | $(am__base_list) | \
- while read files; do \
- echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(infodir)'"; \
- $(INSTALL_DATA) $$files "$(DESTDIR)$(infodir)" || exit $$?; done
- @$(POST_INSTALL)
- @if $(am__can_run_installinfo); then \
- list='$(INFO_DEPS)'; test -n "$(infodir)" || list=; \
- for file in $$list; do \
- relfile=`echo "$$file" | sed 's|^.*/||'`; \
- echo " install-info --info-dir='$(DESTDIR)$(infodir)' '$(DESTDIR)$(infodir)/$$relfile'";\
- install-info --info-dir="$(DESTDIR)$(infodir)" "$(DESTDIR)$(infodir)/$$relfile" || :;\
- done; \
- else : ; fi
-install-man:
-
-install-pdf: install-pdf-recursive
-
-install-pdf-am: $(PDFS)
- @$(NORMAL_INSTALL)
- @list='$(PDFS)'; test -n "$(pdfdir)" || list=; \
- if test -n "$$list"; then \
- echo " $(MKDIR_P) '$(DESTDIR)$(pdfdir)'"; \
- $(MKDIR_P) "$(DESTDIR)$(pdfdir)" || exit 1; \
- fi; \
- for p in $$list; do \
- if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
- echo "$$d$$p"; \
- done | $(am__base_list) | \
- while read files; do \
- echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pdfdir)'"; \
- $(INSTALL_DATA) $$files "$(DESTDIR)$(pdfdir)" || exit $$?; done
-install-ps: install-ps-recursive
-
-install-ps-am: $(PSS)
- @$(NORMAL_INSTALL)
- @list='$(PSS)'; test -n "$(psdir)" || list=; \
- if test -n "$$list"; then \
- echo " $(MKDIR_P) '$(DESTDIR)$(psdir)'"; \
- $(MKDIR_P) "$(DESTDIR)$(psdir)" || exit 1; \
- fi; \
- for p in $$list; do \
- if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
- echo "$$d$$p"; \
- done | $(am__base_list) | \
- while read files; do \
- echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(psdir)'"; \
- $(INSTALL_DATA) $$files "$(DESTDIR)$(psdir)" || exit $$?; done
-installcheck-am:
-
-maintainer-clean: maintainer-clean-recursive
- -rm -f $(am__CONFIG_DISTCLEAN_FILES)
- -rm -rf $(top_srcdir)/autom4te.cache
- -rm -rf src/$(DEPDIR) src/aarch64/$(DEPDIR) src/alpha/$(DEPDIR) src/arc/$(DEPDIR) src/arm/$(DEPDIR) src/avr32/$(DEPDIR) src/bfin/$(DEPDIR) src/cris/$(DEPDIR) src/frv/$(DEPDIR) src/ia64/$(DEPDIR) src/m32r/$(DEPDIR) src/m68k/$(DEPDIR) src/m88k/$(DEPDIR) src/metag/$(DEPDIR) src/microblaze/$(DEPDIR) src/mips/$(DEPDIR) src/moxie/$(DEPDIR) src/nios2/$(DEPDIR) src/pa/$(DEPDIR) src/powerpc/$(DEPDIR) src/s390/$(DEPDIR) src/sh/$(DEPDIR) src/sh64/$(DEPDIR) src/sparc/$(DEPDIR) src/tile/$(DEPDIR) src/vax/$(DEPDIR) src/x86/$(DEPDIR) src/xtensa/$(DEPDIR)
- -rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-aminfo \
- maintainer-clean-generic maintainer-clean-vti
-
-mostlyclean: mostlyclean-recursive
-
-mostlyclean-am: mostlyclean-aminfo mostlyclean-compile \
- mostlyclean-generic mostlyclean-libtool mostlyclean-vti
-
-pdf: pdf-recursive
-
-pdf-am: $(PDFS)
-
-ps: ps-recursive
-
-ps-am: $(PSS)
-
-uninstall-am: uninstall-dvi-am uninstall-html-am uninstall-info-am \
- uninstall-pdf-am uninstall-pkgconfigDATA uninstall-ps-am \
- uninstall-toolexeclibLTLIBRARIES
-
-.MAKE: $(am__recursive_targets) all install-am install-strip
-
-.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \
- am--refresh check check-am clean clean-aminfo clean-cscope \
- clean-generic clean-libtool clean-noinstLTLIBRARIES \
- clean-toolexeclibLTLIBRARIES cscope cscopelist-am ctags \
- ctags-am dist dist-all dist-bzip2 dist-gzip dist-hook \
- dist-info dist-lzip dist-shar dist-tarZ dist-xz dist-zip \
- distcheck distclean distclean-compile distclean-generic \
- distclean-hdr distclean-libtool distclean-tags distcleancheck \
- distdir distuninstallcheck dvi dvi-am html html-am info \
- info-am install install-am install-data install-data-am \
- install-dvi install-dvi-am install-exec install-exec-am \
- install-html install-html-am install-info install-info-am \
- install-man install-pdf install-pdf-am install-pkgconfigDATA \
- install-ps install-ps-am install-strip \
- install-toolexeclibLTLIBRARIES installcheck installcheck-am \
- installdirs installdirs-am maintainer-clean \
- maintainer-clean-aminfo maintainer-clean-generic \
- maintainer-clean-vti mostlyclean mostlyclean-aminfo \
- mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
- mostlyclean-vti pdf pdf-am ps ps-am tags tags-am uninstall \
- uninstall-am uninstall-dvi-am uninstall-html-am \
- uninstall-info-am uninstall-pdf-am uninstall-pkgconfigDATA \
- uninstall-ps-am uninstall-toolexeclibLTLIBRARIES
-
-
-dist-hook:
- if [ -d $(top_srcdir)/.git ] ; then (cd $(top_srcdir); git log --no-decorate) ; else echo 'See git log for history.' ; fi > $(distdir)/ChangeLog
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/Modules/_ctypes/libffi/README b/Modules/_ctypes/libffi/README
deleted file mode 100644
index 84b942677a..0000000000
--- a/Modules/_ctypes/libffi/README
+++ /dev/null
@@ -1,428 +0,0 @@
-Status
-======
-
-libffi-3.1 was released on May 19, 2014. Check the libffi web page
-for updates: <URL:http://sourceware.org/libffi/>.
-
-
-What is libffi?
-===============
-
-Compilers for high level languages generate code that follow certain
-conventions. These conventions are necessary, in part, for separate
-compilation to work. One such convention is the "calling
-convention". The "calling convention" is essentially a set of
-assumptions made by the compiler about where function arguments will
-be found on entry to a function. A "calling convention" also specifies
-where the return value for a function is found.
-
-Some programs may not know at the time of compilation what arguments
-are to be passed to a function. For instance, an interpreter may be
-told at run-time about the number and types of arguments used to call
-a given function. Libffi can be used in such programs to provide a
-bridge from the interpreter program to compiled code.
-
-The libffi library provides a portable, high level programming
-interface to various calling conventions. This allows a programmer to
-call any function specified by a call interface description at run
-time.
-
-FFI stands for Foreign Function Interface. A foreign function
-interface is the popular name for the interface that allows code
-written in one language to call code written in another language. The
-libffi library really only provides the lowest, machine dependent
-layer of a fully featured foreign function interface. A layer must
-exist above libffi that handles type conversions for values passed
-between the two languages.
-
-
-Supported Platforms
-===================
-
-Libffi has been ported to many different platforms.
-For specific configuration details and testing status, please
-refer to the wiki page here:
-
- http://www.moxielogic.org/wiki/index.php?title=Libffi_3.1
-
-At the time of release, the following basic configurations have been
-tested:
-
-|-----------------+------------------+-------------------------|
-| Architecture | Operating System | Compiler |
-|-----------------+------------------+-------------------------|
-| AArch64 (ARM64) | iOS | Clang |
-| AArch64 | Linux | GCC |
-| Alpha | Linux | GCC |
-| Alpha | Tru64 | GCC |
-| ARC | Linux | GCC |
-| ARM | Linux | GCC |
-| ARM | iOS | GCC |
-| AVR32 | Linux | GCC |
-| Blackfin | uClinux | GCC |
-| HPPA | HPUX | GCC |
-| IA-64 | Linux | GCC |
-| M68K | FreeMiNT | GCC |
-| M68K | Linux | GCC |
-| M68K | RTEMS | GCC |
-| M88K | OpenBSD/mvme88k | GCC |
-| Meta | Linux | GCC |
-| MicroBlaze | Linux | GCC |
-| MIPS | IRIX | GCC |
-| MIPS | Linux | GCC |
-| MIPS | RTEMS | GCC |
-| MIPS64 | Linux | GCC |
-| Moxie | Bare metal | GCC |
-| Nios II | Linux | GCC |
-| PowerPC 32-bit | AIX | IBM XL C |
-| PowerPC 64-bit | AIX | IBM XL C |
-| PowerPC | AMIGA | GCC |
-| PowerPC | Linux | GCC |
-| PowerPC | Mac OSX | GCC |
-| PowerPC | FreeBSD | GCC |
-| PowerPC 64-bit | FreeBSD | GCC |
-| PowerPC 64-bit | Linux ELFv1 | GCC |
-| PowerPC 64-bit | Linux ELFv2 | GCC |
-| S390 | Linux | GCC |
-| S390X | Linux | GCC |
-| SPARC | Linux | GCC |
-| SPARC | Solaris | GCC |
-| SPARC | Solaris | Oracle Solaris Studio C |
-| SPARC64 | Linux | GCC |
-| SPARC64 | FreeBSD | GCC |
-| SPARC64 | Solaris | Oracle Solaris Studio C |
-| TILE-Gx/TILEPro | Linux | GCC |
-| VAX | OpenBSD/vax | GCC |
-| X86 | FreeBSD | GCC |
-| X86 | GNU HURD | GCC |
-| X86 | Interix | GCC |
-| X86 | kFreeBSD | GCC |
-| X86 | Linux | GCC |
-| X86 | Mac OSX | GCC |
-| X86 | OpenBSD | GCC |
-| X86 | OS/2 | GCC |
-| X86 | Solaris | GCC |
-| X86 | Solaris | Oracle Solaris Studio C |
-| X86 | Windows/Cygwin | GCC |
-| X86 | Windows/MingW | GCC |
-| X86-64 | FreeBSD | GCC |
-| X86-64 | Linux | GCC |
-| X86-64 | Linux/x32 | GCC |
-| X86-64 | OpenBSD | GCC |
-| X86-64 | Solaris | Oracle Solaris Studio C |
-| X86-64 | Windows/MingW | GCC |
-| Xtensa | Linux | GCC |
-|-----------------+------------------+-------------------------|
-
-Please send additional platform test results to
-libffi-discuss@sourceware.org and feel free to update the wiki page
-above.
-
-Installing libffi
-=================
-
-First you must configure the distribution for your particular
-system. Go to the directory you wish to build libffi in and run the
-"configure" program found in the root directory of the libffi source
-distribution.
-
-If you're building libffi directly from version control, configure won't
-exist yet; run ./autogen.sh first.
-
-You may want to tell configure where to install the libffi library and
-header files. To do that, use the --prefix configure switch. Libffi
-will install under /usr/local by default.
-
-If you want to enable extra run-time debugging checks use the the
---enable-debug configure switch. This is useful when your program dies
-mysteriously while using libffi.
-
-Another useful configure switch is --enable-purify-safety. Using this
-will add some extra code which will suppress certain warnings when you
-are using Purify with libffi. Only use this switch when using
-Purify, as it will slow down the library.
-
-It's also possible to build libffi on Windows platforms with
-Microsoft's Visual C++ compiler. In this case, use the msvcc.sh
-wrapper script during configuration like so:
-
-path/to/configure CC=path/to/msvcc.sh CXX=path/to/msvcc.sh LD=link CPP=\"cl -nologo -EP\"
-
-For 64-bit Windows builds, use CC="path/to/msvcc.sh -m64" and
-CXX="path/to/msvcc.sh -m64". You may also need to specify --build
-appropriately.
-
-When building with MSVC under a MingW environment, you may need to
-remove the line in configure that sets 'fix_srcfile_path' to a 'cygpath'
-command. ('cygpath' is not present in MingW, and is not required when
-using MingW-style paths.)
-
-For iOS builds, the 'libffi.xcodeproj' Xcode project is available.
-
-Configure has many other options. Use "configure --help" to see them all.
-
-Once configure has finished, type "make". Note that you must be using
-GNU make. You can ftp GNU make from ftp.gnu.org:/pub/gnu/make .
-
-To ensure that libffi is working as advertised, type "make check".
-This will require that you have DejaGNU installed.
-
-To install the library and header files, type "make install".
-
-
-History
-=======
-
-See the git log for details at http://github.com/atgreen/libffi.
-
-3.1 May-19-14
- Add AArch64 (ARM64) iOS support.
- Add Nios II support.
- Add m88k and DEC VAX support.
- Add support for stdcall, thiscall, and fastcall on non-Windows
- 32-bit x86 targets such as Linux.
- Various Android, MIPS N32, x86, FreeBSD and UltraSPARC IIi
- fixes.
- Make the testsuite more robust: eliminate several spurious
- failures, and respect the $CC and $CXX environment variables.
- Archive off the manually maintained ChangeLog in favor of git
- log.
-
-3.0.13 Mar-17-13
- Add Meta support.
- Add missing Moxie bits.
- Fix stack alignment bug on 32-bit x86.
- Build fix for m68000 targets.
- Build fix for soft-float Power targets.
- Fix the install dir location for some platforms when building
- with GCC (OS X, Solaris).
- Fix Cygwin regression.
-
-3.0.12 Feb-11-13
- Add Moxie support.
- Add AArch64 support.
- Add Blackfin support.
- Add TILE-Gx/TILEPro support.
- Add MicroBlaze support.
- Add Xtensa support.
- Add support for PaX enabled kernels with MPROTECT.
- Add support for native vendor compilers on
- Solaris and AIX.
- Work around LLVM/GCC interoperability issue on x86_64.
-
-3.0.11 Apr-11-12
- Lots of build fixes.
- Add support for variadic functions (ffi_prep_cif_var).
- Add Linux/x32 support.
- Add thiscall, fastcall and MSVC cdecl support on Windows.
- Add Amiga and newer MacOS support.
- Add m68k FreeMiNT support.
- Integration with iOS' xcode build tools.
- Fix Octeon and MC68881 support.
- Fix code pessimizations.
-
-3.0.10 Aug-23-11
- Add support for Apple's iOS.
- Add support for ARM VFP ABI.
- Add RTEMS support for MIPS and M68K.
- Fix instruction cache clearing problems on
- ARM and SPARC.
- Fix the N64 build on mips-sgi-irix6.5.
- Enable builds with Microsoft's compiler.
- Enable x86 builds with Oracle's Solaris compiler.
- Fix support for calling code compiled with Oracle's Sparc
- Solaris compiler.
- Testsuite fixes for Tru64 Unix.
- Additional platform support.
-
-3.0.9 Dec-31-09
- Add AVR32 and win64 ports. Add ARM softfp support.
- Many fixes for AIX, Solaris, HP-UX, *BSD.
- Several PowerPC and x86-64 bug fixes.
- Build DLL for windows.
-
-3.0.8 Dec-19-08
- Add *BSD, BeOS, and PA-Linux support.
-
-3.0.7 Nov-11-08
- Fix for ppc FreeBSD.
- (thanks to Andreas Tobler)
-
-3.0.6 Jul-17-08
- Fix for closures on sh.
- Mark the sh/sh64 stack as non-executable.
- (both thanks to Kaz Kojima)
-
-3.0.5 Apr-3-08
- Fix libffi.pc file.
- Fix #define ARM for IcedTea users.
- Fix x86 closure bug.
-
-3.0.4 Feb-24-08
- Fix x86 OpenBSD configury.
-
-3.0.3 Feb-22-08
- Enable x86 OpenBSD thanks to Thomas Heller, and
- x86-64 FreeBSD thanks to Björn König and Andreas Tobler.
- Clean up test instruction in README.
-
-3.0.2 Feb-21-08
- Improved x86 FreeBSD support.
- Thanks to Björn König.
-
-3.0.1 Feb-15-08
- Fix instruction cache flushing bug on MIPS.
- Thanks to David Daney.
-
-3.0.0 Feb-15-08
- Many changes, mostly thanks to the GCC project.
- Cygnus Solutions is now Red Hat.
-
- [10 years go by...]
-
-1.20 Oct-5-98
- Raffaele Sena produces ARM port.
-
-1.19 Oct-5-98
- Fixed x86 long double and long long return support.
- m68k bug fixes from Andreas Schwab.
- Patch for DU assembler compatibility for the Alpha from Richard
- Henderson.
-
-1.18 Apr-17-98
- Bug fixes and MIPS configuration changes.
-
-1.17 Feb-24-98
- Bug fixes and m68k port from Andreas Schwab. PowerPC port from
- Geoffrey Keating. Various bug x86, Sparc and MIPS bug fixes.
-
-1.16 Feb-11-98
- Richard Henderson produces Alpha port.
-
-1.15 Dec-4-97
- Fixed an n32 ABI bug. New libtool, auto* support.
-
-1.14 May-13-97
- libtool is now used to generate shared and static libraries.
- Fixed a minor portability problem reported by Russ McManus
- <mcmanr@eq.gs.com>.
-
-1.13 Dec-2-96
- Added --enable-purify-safety to keep Purify from complaining
- about certain low level code.
- Sparc fix for calling functions with < 6 args.
- Linux x86 a.out fix.
-
-1.12 Nov-22-96
- Added missing ffi_type_void, needed for supporting void return
- types. Fixed test case for non MIPS machines. Cygnus Support
- is now Cygnus Solutions.
-
-1.11 Oct-30-96
- Added notes about GNU make.
-
-1.10 Oct-29-96
- Added configuration fix for non GNU compilers.
-
-1.09 Oct-29-96
- Added --enable-debug configure switch. Clean-ups based on LCLint
- feedback. ffi_mips.h is always installed. Many configuration
- fixes. Fixed ffitest.c for sparc builds.
-
-1.08 Oct-15-96
- Fixed n32 problem. Many clean-ups.
-
-1.07 Oct-14-96
- Gordon Irlam rewrites v8.S again. Bug fixes.
-
-1.06 Oct-14-96
- Gordon Irlam improved the sparc port.
-
-1.05 Oct-14-96
- Interface changes based on feedback.
-
-1.04 Oct-11-96
- Sparc port complete (modulo struct passing bug).
-
-1.03 Oct-10-96
- Passing struct args, and returning struct values works for
- all architectures/calling conventions. Expanded tests.
-
-1.02 Oct-9-96
- Added SGI n32 support. Fixed bugs in both o32 and Linux support.
- Added "make test".
-
-1.01 Oct-8-96
- Fixed float passing bug in mips version. Restructured some
- of the code. Builds cleanly with SGI tools.
-
-1.00 Oct-7-96
- First release. No public announcement.
-
-
-Authors & Credits
-=================
-
-libffi was originally written by Anthony Green <green@moxielogic.com>.
-
-The developers of the GNU Compiler Collection project have made
-innumerable valuable contributions. See the ChangeLog file for
-details.
-
-Some of the ideas behind libffi were inspired by Gianni Mariani's free
-gencall library for Silicon Graphics machines.
-
-The closure mechanism was designed and implemented by Kresten Krab
-Thorup.
-
-Major processor architecture ports were contributed by the following
-developers:
-
-aarch64 Marcus Shawcroft, James Greenhalgh
-alpha Richard Henderson
-arm Raffaele Sena
-blackfin Alexandre Keunecke I. de Mendonca
-cris Simon Posnjak, Hans-Peter Nilsson
-frv Anthony Green
-ia64 Hans Boehm
-m32r Kazuhiro Inaoka
-m68k Andreas Schwab
-m88k Miod Vallat
-microblaze Nathan Rossi
-mips Anthony Green, Casey Marshall
-mips64 David Daney
-moxie Anthony Green
-nios ii Sandra Loosemore
-pa Randolph Chung, Dave Anglin, Andreas Tobler
-powerpc Geoffrey Keating, Andreas Tobler,
- David Edelsohn, John Hornkvist
-powerpc64 Jakub Jelinek
-s390 Gerhard Tonn, Ulrich Weigand
-sh Kaz Kojima
-sh64 Kaz Kojima
-sparc Anthony Green, Gordon Irlam
-tile-gx/tilepro Walter Lee
-vax Miod Vallat
-x86 Anthony Green, Jon Beniston
-x86-64 Bo Thorsen
-xtensa Chris Zankel
-
-Jesper Skov and Andrew Haley both did more than their fair share of
-stepping through the code and tracking down bugs.
-
-Thanks also to Tom Tromey for bug fixes, documentation and
-configuration help.
-
-Thanks to Jim Blandy, who provided some useful feedback on the libffi
-interface.
-
-Andreas Tobler has done a tremendous amount of work on the testsuite.
-
-Alex Oliva solved the executable page problem for SElinux.
-
-The list above is almost certainly incomplete and inaccurate. I'm
-happy to make corrections or additions upon request.
-
-If you have a problem, or have found a bug, please send a note to the
-author at green@moxielogic.com, or the project mailing list at
-libffi-discuss@sourceware.org.
diff --git a/Modules/_ctypes/libffi/acinclude.m4 b/Modules/_ctypes/libffi/acinclude.m4
deleted file mode 100644
index 3e8f8ba570..0000000000
--- a/Modules/_ctypes/libffi/acinclude.m4
+++ /dev/null
@@ -1,92 +0,0 @@
-# mmap(2) blacklisting. Some platforms provide the mmap library routine
-# but don't support all of the features we need from it.
-AC_DEFUN([AC_FUNC_MMAP_BLACKLIST],
-[
-AC_CHECK_HEADER([sys/mman.h],
- [libffi_header_sys_mman_h=yes], [libffi_header_sys_mman_h=no])
-AC_CHECK_FUNC([mmap], [libffi_func_mmap=yes], [libffi_func_mmap=no])
-if test "$libffi_header_sys_mman_h" != yes \
- || test "$libffi_func_mmap" != yes; then
- ac_cv_func_mmap_file=no
- ac_cv_func_mmap_dev_zero=no
- ac_cv_func_mmap_anon=no
-else
- AC_CACHE_CHECK([whether read-only mmap of a plain file works],
- ac_cv_func_mmap_file,
- [# Add a system to this blacklist if
- # mmap(0, stat_size, PROT_READ, MAP_PRIVATE, fd, 0) doesn't return a
- # memory area containing the same data that you'd get if you applied
- # read() to the same fd. The only system known to have a problem here
- # is VMS, where text files have record structure.
- case "$host_os" in
- vms* | ultrix*)
- ac_cv_func_mmap_file=no ;;
- *)
- ac_cv_func_mmap_file=yes;;
- esac])
- AC_CACHE_CHECK([whether mmap from /dev/zero works],
- ac_cv_func_mmap_dev_zero,
- [# Add a system to this blacklist if it has mmap() but /dev/zero
- # does not exist, or if mmapping /dev/zero does not give anonymous
- # zeroed pages with both the following properties:
- # 1. If you map N consecutive pages in with one call, and then
- # unmap any subset of those pages, the pages that were not
- # explicitly unmapped remain accessible.
- # 2. If you map two adjacent blocks of memory and then unmap them
- # both at once, they must both go away.
- # Systems known to be in this category are Windows (all variants),
- # VMS, and Darwin.
- case "$host_os" in
- vms* | cygwin* | pe | mingw* | darwin* | ultrix* | hpux10* | hpux11.00)
- ac_cv_func_mmap_dev_zero=no ;;
- *)
- ac_cv_func_mmap_dev_zero=yes;;
- esac])
-
- # Unlike /dev/zero, the MAP_ANON(YMOUS) defines can be probed for.
- AC_CACHE_CHECK([for MAP_ANON(YMOUS)], ac_cv_decl_map_anon,
- [AC_TRY_COMPILE(
-[#include <sys/types.h>
-#include <sys/mman.h>
-#include <unistd.h>
-
-#ifndef MAP_ANONYMOUS
-#define MAP_ANONYMOUS MAP_ANON
-#endif
-],
-[int n = MAP_ANONYMOUS;],
- ac_cv_decl_map_anon=yes,
- ac_cv_decl_map_anon=no)])
-
- if test $ac_cv_decl_map_anon = no; then
- ac_cv_func_mmap_anon=no
- else
- AC_CACHE_CHECK([whether mmap with MAP_ANON(YMOUS) works],
- ac_cv_func_mmap_anon,
- [# Add a system to this blacklist if it has mmap() and MAP_ANON or
- # MAP_ANONYMOUS, but using mmap(..., MAP_PRIVATE|MAP_ANONYMOUS, -1, 0)
- # doesn't give anonymous zeroed pages with the same properties listed
- # above for use of /dev/zero.
- # Systems known to be in this category are Windows, VMS, and SCO Unix.
- case "$host_os" in
- vms* | cygwin* | pe | mingw* | sco* | udk* )
- ac_cv_func_mmap_anon=no ;;
- *)
- ac_cv_func_mmap_anon=yes;;
- esac])
- fi
-fi
-
-if test $ac_cv_func_mmap_file = yes; then
- AC_DEFINE(HAVE_MMAP_FILE, 1,
- [Define if read-only mmap of a plain file works.])
-fi
-if test $ac_cv_func_mmap_dev_zero = yes; then
- AC_DEFINE(HAVE_MMAP_DEV_ZERO, 1,
- [Define if mmap of /dev/zero works.])
-fi
-if test $ac_cv_func_mmap_anon = yes; then
- AC_DEFINE(HAVE_MMAP_ANON, 1,
- [Define if mmap with MAP_ANON(YMOUS) works.])
-fi
-])
diff --git a/Modules/_ctypes/libffi/aclocal.m4 b/Modules/_ctypes/libffi/aclocal.m4
deleted file mode 100644
index 6292fbab7a..0000000000
--- a/Modules/_ctypes/libffi/aclocal.m4
+++ /dev/null
@@ -1,1961 +0,0 @@
-# generated automatically by aclocal 1.13.4 -*- Autoconf -*-
-
-# Copyright (C) 1996-2013 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.
-
-m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
-m4_ifndef([AC_AUTOCONF_VERSION],
- [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
-m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],,
-[m4_warning([this file was generated for autoconf 2.69.
-You have another version of autoconf. It may work, but is not guaranteed to.
-If you have problems, you may need to regenerate the build system entirely.
-To do so, use the procedure documented by the package, typically 'autoreconf'.])])
-
-# ltdl.m4 - Configure ltdl for the target system. -*-Autoconf-*-
-#
-# Copyright (C) 1999-2006, 2007, 2008, 2011 Free Software Foundation, Inc.
-# Written by Thomas Tanner, 1999
-#
-# 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.
-
-# serial 18 LTDL_INIT
-
-# LT_CONFIG_LTDL_DIR(DIRECTORY, [LTDL-MODE])
-# ------------------------------------------
-# DIRECTORY contains the libltdl sources. It is okay to call this
-# function multiple times, as long as the same DIRECTORY is always given.
-AC_DEFUN([LT_CONFIG_LTDL_DIR],
-[AC_BEFORE([$0], [LTDL_INIT])
-_$0($*)
-])# LT_CONFIG_LTDL_DIR
-
-# We break this out into a separate macro, so that we can call it safely
-# internally without being caught accidentally by the sed scan in libtoolize.
-m4_defun([_LT_CONFIG_LTDL_DIR],
-[dnl remove trailing slashes
-m4_pushdef([_ARG_DIR], m4_bpatsubst([$1], [/*$]))
-m4_case(_LTDL_DIR,
- [], [dnl only set lt_ltdl_dir if _ARG_DIR is not simply `.'
- m4_if(_ARG_DIR, [.],
- [],
- [m4_define([_LTDL_DIR], _ARG_DIR)
- _LT_SHELL_INIT([lt_ltdl_dir=']_ARG_DIR['])])],
- [m4_if(_ARG_DIR, _LTDL_DIR,
- [],
- [m4_fatal([multiple libltdl directories: `]_LTDL_DIR[', `]_ARG_DIR['])])])
-m4_popdef([_ARG_DIR])
-])# _LT_CONFIG_LTDL_DIR
-
-# Initialise:
-m4_define([_LTDL_DIR], [])
-
-
-# _LT_BUILD_PREFIX
-# ----------------
-# If Autoconf is new enough, expand to `${top_build_prefix}', otherwise
-# to `${top_builddir}/'.
-m4_define([_LT_BUILD_PREFIX],
-[m4_ifdef([AC_AUTOCONF_VERSION],
- [m4_if(m4_version_compare(m4_defn([AC_AUTOCONF_VERSION]), [2.62]),
- [-1], [m4_ifdef([_AC_HAVE_TOP_BUILD_PREFIX],
- [${top_build_prefix}],
- [${top_builddir}/])],
- [${top_build_prefix}])],
- [${top_builddir}/])[]dnl
-])
-
-
-# LTDL_CONVENIENCE
-# ----------------
-# sets LIBLTDL to the link flags for the libltdl convenience library and
-# LTDLINCL to the include flags for the libltdl header and adds
-# --enable-ltdl-convenience to the configure arguments. Note that
-# AC_CONFIG_SUBDIRS is not called here. LIBLTDL will be prefixed with
-# '${top_build_prefix}' if available, otherwise with '${top_builddir}/',
-# and LTDLINCL will be prefixed with '${top_srcdir}/' (note the single
-# quotes!). If your package is not flat and you're not using automake,
-# define top_build_prefix, top_builddir, and top_srcdir appropriately
-# in your Makefiles.
-AC_DEFUN([LTDL_CONVENIENCE],
-[AC_BEFORE([$0], [LTDL_INIT])dnl
-dnl Although the argument is deprecated and no longer documented,
-dnl LTDL_CONVENIENCE used to take a DIRECTORY orgument, if we have one
-dnl here make sure it is the same as any other declaration of libltdl's
-dnl location! This also ensures lt_ltdl_dir is set when configure.ac is
-dnl not yet using an explicit LT_CONFIG_LTDL_DIR.
-m4_ifval([$1], [_LT_CONFIG_LTDL_DIR([$1])])dnl
-_$0()
-])# LTDL_CONVENIENCE
-
-# AC_LIBLTDL_CONVENIENCE accepted a directory argument in older libtools,
-# now we have LT_CONFIG_LTDL_DIR:
-AU_DEFUN([AC_LIBLTDL_CONVENIENCE],
-[_LT_CONFIG_LTDL_DIR([m4_default([$1], [libltdl])])
-_LTDL_CONVENIENCE])
-
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_LIBLTDL_CONVENIENCE], [])
-
-
-# _LTDL_CONVENIENCE
-# -----------------
-# Code shared by LTDL_CONVENIENCE and LTDL_INIT([convenience]).
-m4_defun([_LTDL_CONVENIENCE],
-[case $enable_ltdl_convenience in
- no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
- "") enable_ltdl_convenience=yes
- ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
-esac
-LIBLTDL='_LT_BUILD_PREFIX'"${lt_ltdl_dir+$lt_ltdl_dir/}libltdlc.la"
-LTDLDEPS=$LIBLTDL
-LTDLINCL='-I${top_srcdir}'"${lt_ltdl_dir+/$lt_ltdl_dir}"
-
-AC_SUBST([LIBLTDL])
-AC_SUBST([LTDLDEPS])
-AC_SUBST([LTDLINCL])
-
-# For backwards non-gettext consistent compatibility...
-INCLTDL="$LTDLINCL"
-AC_SUBST([INCLTDL])
-])# _LTDL_CONVENIENCE
-
-
-# LTDL_INSTALLABLE
-# ----------------
-# sets LIBLTDL to the link flags for the libltdl installable library
-# and LTDLINCL to the include flags for the libltdl header and adds
-# --enable-ltdl-install to the configure arguments. Note that
-# AC_CONFIG_SUBDIRS is not called from here. If an installed libltdl
-# is not found, LIBLTDL will be prefixed with '${top_build_prefix}' if
-# available, otherwise with '${top_builddir}/', and LTDLINCL will be
-# prefixed with '${top_srcdir}/' (note the single quotes!). If your
-# package is not flat and you're not using automake, define top_build_prefix,
-# top_builddir, and top_srcdir appropriately in your Makefiles.
-# In the future, this macro may have to be called after LT_INIT.
-AC_DEFUN([LTDL_INSTALLABLE],
-[AC_BEFORE([$0], [LTDL_INIT])dnl
-dnl Although the argument is deprecated and no longer documented,
-dnl LTDL_INSTALLABLE used to take a DIRECTORY orgument, if we have one
-dnl here make sure it is the same as any other declaration of libltdl's
-dnl location! This also ensures lt_ltdl_dir is set when configure.ac is
-dnl not yet using an explicit LT_CONFIG_LTDL_DIR.
-m4_ifval([$1], [_LT_CONFIG_LTDL_DIR([$1])])dnl
-_$0()
-])# LTDL_INSTALLABLE
-
-# AC_LIBLTDL_INSTALLABLE accepted a directory argument in older libtools,
-# now we have LT_CONFIG_LTDL_DIR:
-AU_DEFUN([AC_LIBLTDL_INSTALLABLE],
-[_LT_CONFIG_LTDL_DIR([m4_default([$1], [libltdl])])
-_LTDL_INSTALLABLE])
-
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_LIBLTDL_INSTALLABLE], [])
-
-
-# _LTDL_INSTALLABLE
-# -----------------
-# Code shared by LTDL_INSTALLABLE and LTDL_INIT([installable]).
-m4_defun([_LTDL_INSTALLABLE],
-[if test -f $prefix/lib/libltdl.la; then
- lt_save_LDFLAGS="$LDFLAGS"
- LDFLAGS="-L$prefix/lib $LDFLAGS"
- AC_CHECK_LIB([ltdl], [lt_dlinit], [lt_lib_ltdl=yes])
- LDFLAGS="$lt_save_LDFLAGS"
- if test x"${lt_lib_ltdl-no}" = xyes; then
- if test x"$enable_ltdl_install" != xyes; then
- # Don't overwrite $prefix/lib/libltdl.la without --enable-ltdl-install
- AC_MSG_WARN([not overwriting libltdl at $prefix, force with `--enable-ltdl-install'])
- enable_ltdl_install=no
- fi
- elif test x"$enable_ltdl_install" = xno; then
- AC_MSG_WARN([libltdl not installed, but installation disabled])
- fi
-fi
-
-# If configure.ac declared an installable ltdl, and the user didn't override
-# with --disable-ltdl-install, we will install the shipped libltdl.
-case $enable_ltdl_install in
- no) ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
- LIBLTDL="-lltdl"
- LTDLDEPS=
- LTDLINCL=
- ;;
- *) enable_ltdl_install=yes
- ac_configure_args="$ac_configure_args --enable-ltdl-install"
- LIBLTDL='_LT_BUILD_PREFIX'"${lt_ltdl_dir+$lt_ltdl_dir/}libltdl.la"
- LTDLDEPS=$LIBLTDL
- LTDLINCL='-I${top_srcdir}'"${lt_ltdl_dir+/$lt_ltdl_dir}"
- ;;
-esac
-
-AC_SUBST([LIBLTDL])
-AC_SUBST([LTDLDEPS])
-AC_SUBST([LTDLINCL])
-
-# For backwards non-gettext consistent compatibility...
-INCLTDL="$LTDLINCL"
-AC_SUBST([INCLTDL])
-])# LTDL_INSTALLABLE
-
-
-# _LTDL_MODE_DISPATCH
-# -------------------
-m4_define([_LTDL_MODE_DISPATCH],
-[dnl If _LTDL_DIR is `.', then we are configuring libltdl itself:
-m4_if(_LTDL_DIR, [],
- [],
- dnl if _LTDL_MODE was not set already, the default value is `subproject':
- [m4_case(m4_default(_LTDL_MODE, [subproject]),
- [subproject], [AC_CONFIG_SUBDIRS(_LTDL_DIR)
- _LT_SHELL_INIT([lt_dlopen_dir="$lt_ltdl_dir"])],
- [nonrecursive], [_LT_SHELL_INIT([lt_dlopen_dir="$lt_ltdl_dir"; lt_libobj_prefix="$lt_ltdl_dir/"])],
- [recursive], [],
- [m4_fatal([unknown libltdl mode: ]_LTDL_MODE)])])dnl
-dnl Be careful not to expand twice:
-m4_define([$0], [])
-])# _LTDL_MODE_DISPATCH
-
-
-# _LT_LIBOBJ(MODULE_NAME)
-# -----------------------
-# Like AC_LIBOBJ, except that MODULE_NAME goes into _LT_LIBOBJS instead
-# of into LIBOBJS.
-AC_DEFUN([_LT_LIBOBJ], [
- m4_pattern_allow([^_LT_LIBOBJS$])
- _LT_LIBOBJS="$_LT_LIBOBJS $1.$ac_objext"
-])# _LT_LIBOBJS
-
-
-# LTDL_INIT([OPTIONS])
-# --------------------
-# Clients of libltdl can use this macro to allow the installer to
-# choose between a shipped copy of the ltdl sources or a preinstalled
-# version of the library. If the shipped ltdl sources are not in a
-# subdirectory named libltdl, the directory name must be given by
-# LT_CONFIG_LTDL_DIR.
-AC_DEFUN([LTDL_INIT],
-[dnl Parse OPTIONS
-_LT_SET_OPTIONS([$0], [$1])
-
-dnl We need to keep our own list of libobjs separate from our parent project,
-dnl and the easiest way to do that is redefine the AC_LIBOBJs macro while
-dnl we look for our own LIBOBJs.
-m4_pushdef([AC_LIBOBJ], m4_defn([_LT_LIBOBJ]))
-m4_pushdef([AC_LIBSOURCES])
-
-dnl If not otherwise defined, default to the 1.5.x compatible subproject mode:
-m4_if(_LTDL_MODE, [],
- [m4_define([_LTDL_MODE], m4_default([$2], [subproject]))
- m4_if([-1], [m4_bregexp(_LTDL_MODE, [\(subproject\|\(non\)?recursive\)])],
- [m4_fatal([unknown libltdl mode: ]_LTDL_MODE)])])
-
-AC_ARG_WITH([included_ltdl],
- [AS_HELP_STRING([--with-included-ltdl],
- [use the GNU ltdl sources included here])])
-
-if test "x$with_included_ltdl" != xyes; then
- # We are not being forced to use the included libltdl sources, so
- # decide whether there is a useful installed version we can use.
- AC_CHECK_HEADER([ltdl.h],
- [AC_CHECK_DECL([lt_dlinterface_register],
- [AC_CHECK_LIB([ltdl], [lt_dladvise_preload],
- [with_included_ltdl=no],
- [with_included_ltdl=yes])],
- [with_included_ltdl=yes],
- [AC_INCLUDES_DEFAULT
- #include <ltdl.h>])],
- [with_included_ltdl=yes],
- [AC_INCLUDES_DEFAULT]
- )
-fi
-
-dnl If neither LT_CONFIG_LTDL_DIR, LTDL_CONVENIENCE nor LTDL_INSTALLABLE
-dnl was called yet, then for old times' sake, we assume libltdl is in an
-dnl eponymous directory:
-AC_PROVIDE_IFELSE([LT_CONFIG_LTDL_DIR], [], [_LT_CONFIG_LTDL_DIR([libltdl])])
-
-AC_ARG_WITH([ltdl_include],
- [AS_HELP_STRING([--with-ltdl-include=DIR],
- [use the ltdl headers installed in DIR])])
-
-if test -n "$with_ltdl_include"; then
- if test -f "$with_ltdl_include/ltdl.h"; then :
- else
- AC_MSG_ERROR([invalid ltdl include directory: `$with_ltdl_include'])
- fi
-else
- with_ltdl_include=no
-fi
-
-AC_ARG_WITH([ltdl_lib],
- [AS_HELP_STRING([--with-ltdl-lib=DIR],
- [use the libltdl.la installed in DIR])])
-
-if test -n "$with_ltdl_lib"; then
- if test -f "$with_ltdl_lib/libltdl.la"; then :
- else
- AC_MSG_ERROR([invalid ltdl library directory: `$with_ltdl_lib'])
- fi
-else
- with_ltdl_lib=no
-fi
-
-case ,$with_included_ltdl,$with_ltdl_include,$with_ltdl_lib, in
- ,yes,no,no,)
- m4_case(m4_default(_LTDL_TYPE, [convenience]),
- [convenience], [_LTDL_CONVENIENCE],
- [installable], [_LTDL_INSTALLABLE],
- [m4_fatal([unknown libltdl build type: ]_LTDL_TYPE)])
- ;;
- ,no,no,no,)
- # If the included ltdl is not to be used, then use the
- # preinstalled libltdl we found.
- AC_DEFINE([HAVE_LTDL], [1],
- [Define this if a modern libltdl is already installed])
- LIBLTDL=-lltdl
- LTDLDEPS=
- LTDLINCL=
- ;;
- ,no*,no,*)
- AC_MSG_ERROR([`--with-ltdl-include' and `--with-ltdl-lib' options must be used together])
- ;;
- *) with_included_ltdl=no
- LIBLTDL="-L$with_ltdl_lib -lltdl"
- LTDLDEPS=
- LTDLINCL="-I$with_ltdl_include"
- ;;
-esac
-INCLTDL="$LTDLINCL"
-
-# Report our decision...
-AC_MSG_CHECKING([where to find libltdl headers])
-AC_MSG_RESULT([$LTDLINCL])
-AC_MSG_CHECKING([where to find libltdl library])
-AC_MSG_RESULT([$LIBLTDL])
-
-_LTDL_SETUP
-
-dnl restore autoconf definition.
-m4_popdef([AC_LIBOBJ])
-m4_popdef([AC_LIBSOURCES])
-
-AC_CONFIG_COMMANDS_PRE([
- _ltdl_libobjs=
- _ltdl_ltlibobjs=
- if test -n "$_LT_LIBOBJS"; then
- # Remove the extension.
- _lt_sed_drop_objext='s/\.o$//;s/\.obj$//'
- for i in `for i in $_LT_LIBOBJS; do echo "$i"; done | sed "$_lt_sed_drop_objext" | sort -u`; do
- _ltdl_libobjs="$_ltdl_libobjs $lt_libobj_prefix$i.$ac_objext"
- _ltdl_ltlibobjs="$_ltdl_ltlibobjs $lt_libobj_prefix$i.lo"
- done
- fi
- AC_SUBST([ltdl_LIBOBJS], [$_ltdl_libobjs])
- AC_SUBST([ltdl_LTLIBOBJS], [$_ltdl_ltlibobjs])
-])
-
-# Only expand once:
-m4_define([LTDL_INIT])
-])# LTDL_INIT
-
-# Old names:
-AU_DEFUN([AC_LIB_LTDL], [LTDL_INIT($@)])
-AU_DEFUN([AC_WITH_LTDL], [LTDL_INIT($@)])
-AU_DEFUN([LT_WITH_LTDL], [LTDL_INIT($@)])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_LIB_LTDL], [])
-dnl AC_DEFUN([AC_WITH_LTDL], [])
-dnl AC_DEFUN([LT_WITH_LTDL], [])
-
-
-# _LTDL_SETUP
-# -----------
-# Perform all the checks necessary for compilation of the ltdl objects
-# -- including compiler checks and header checks. This is a public
-# interface mainly for the benefit of libltdl's own configure.ac, most
-# other users should call LTDL_INIT instead.
-AC_DEFUN([_LTDL_SETUP],
-[AC_REQUIRE([AC_PROG_CC])dnl
-AC_REQUIRE([LT_SYS_MODULE_EXT])dnl
-AC_REQUIRE([LT_SYS_MODULE_PATH])dnl
-AC_REQUIRE([LT_SYS_DLSEARCH_PATH])dnl
-AC_REQUIRE([LT_LIB_DLLOAD])dnl
-AC_REQUIRE([LT_SYS_SYMBOL_USCORE])dnl
-AC_REQUIRE([LT_FUNC_DLSYM_USCORE])dnl
-AC_REQUIRE([LT_SYS_DLOPEN_DEPLIBS])dnl
-AC_REQUIRE([gl_FUNC_ARGZ])dnl
-
-m4_require([_LT_CHECK_OBJDIR])dnl
-m4_require([_LT_HEADER_DLFCN])dnl
-m4_require([_LT_CHECK_DLPREOPEN])dnl
-m4_require([_LT_DECL_SED])dnl
-
-dnl Don't require this, or it will be expanded earlier than the code
-dnl that sets the variables it relies on:
-_LT_ENABLE_INSTALL
-
-dnl _LTDL_MODE specific code must be called at least once:
-_LTDL_MODE_DISPATCH
-
-# In order that ltdl.c can compile, find out the first AC_CONFIG_HEADERS
-# the user used. This is so that ltdl.h can pick up the parent projects
-# config.h file, The first file in AC_CONFIG_HEADERS must contain the
-# definitions required by ltdl.c.
-# FIXME: Remove use of undocumented AC_LIST_HEADERS (2.59 compatibility).
-AC_CONFIG_COMMANDS_PRE([dnl
-m4_pattern_allow([^LT_CONFIG_H$])dnl
-m4_ifset([AH_HEADER],
- [LT_CONFIG_H=AH_HEADER],
- [m4_ifset([AC_LIST_HEADERS],
- [LT_CONFIG_H=`echo "AC_LIST_HEADERS" | $SED 's,^[[ ]]*,,;s,[[ :]].*$,,'`],
- [])])])
-AC_SUBST([LT_CONFIG_H])
-
-AC_CHECK_HEADERS([unistd.h dl.h sys/dl.h dld.h mach-o/dyld.h dirent.h],
- [], [], [AC_INCLUDES_DEFAULT])
-
-AC_CHECK_FUNCS([closedir opendir readdir], [], [AC_LIBOBJ([lt__dirent])])
-AC_CHECK_FUNCS([strlcat strlcpy], [], [AC_LIBOBJ([lt__strl])])
-
-m4_pattern_allow([LT_LIBEXT])dnl
-AC_DEFINE_UNQUOTED([LT_LIBEXT],["$libext"],[The archive extension])
-
-name=
-eval "lt_libprefix=\"$libname_spec\""
-m4_pattern_allow([LT_LIBPREFIX])dnl
-AC_DEFINE_UNQUOTED([LT_LIBPREFIX],["$lt_libprefix"],[The archive prefix])
-
-name=ltdl
-eval "LTDLOPEN=\"$libname_spec\""
-AC_SUBST([LTDLOPEN])
-])# _LTDL_SETUP
-
-
-# _LT_ENABLE_INSTALL
-# ------------------
-m4_define([_LT_ENABLE_INSTALL],
-[AC_ARG_ENABLE([ltdl-install],
- [AS_HELP_STRING([--enable-ltdl-install], [install libltdl])])
-
-case ,${enable_ltdl_install},${enable_ltdl_convenience} in
- *yes*) ;;
- *) enable_ltdl_convenience=yes ;;
-esac
-
-m4_ifdef([AM_CONDITIONAL],
-[AM_CONDITIONAL(INSTALL_LTDL, test x"${enable_ltdl_install-no}" != xno)
- AM_CONDITIONAL(CONVENIENCE_LTDL, test x"${enable_ltdl_convenience-no}" != xno)])
-])# _LT_ENABLE_INSTALL
-
-
-# LT_SYS_DLOPEN_DEPLIBS
-# ---------------------
-AC_DEFUN([LT_SYS_DLOPEN_DEPLIBS],
-[AC_REQUIRE([AC_CANONICAL_HOST])dnl
-AC_CACHE_CHECK([whether deplibs are loaded by dlopen],
- [lt_cv_sys_dlopen_deplibs],
- [# PORTME does your system automatically load deplibs for dlopen?
- # or its logical equivalent (e.g. shl_load for HP-UX < 11)
- # For now, we just catch OSes we know something about -- in the
- # future, we'll try test this programmatically.
- lt_cv_sys_dlopen_deplibs=unknown
- case $host_os in
- aix3*|aix4.1.*|aix4.2.*)
- # Unknown whether this is true for these versions of AIX, but
- # we want this `case' here to explicitly catch those versions.
- lt_cv_sys_dlopen_deplibs=unknown
- ;;
- aix[[4-9]]*)
- lt_cv_sys_dlopen_deplibs=yes
- ;;
- amigaos*)
- case $host_cpu in
- powerpc)
- lt_cv_sys_dlopen_deplibs=no
- ;;
- esac
- ;;
- darwin*)
- # Assuming the user has installed a libdl from somewhere, this is true
- # If you are looking for one http://www.opendarwin.org/projects/dlcompat
- lt_cv_sys_dlopen_deplibs=yes
- ;;
- freebsd* | dragonfly*)
- lt_cv_sys_dlopen_deplibs=yes
- ;;
- gnu* | linux* | k*bsd*-gnu | kopensolaris*-gnu)
- # GNU and its variants, using gnu ld.so (Glibc)
- lt_cv_sys_dlopen_deplibs=yes
- ;;
- hpux10*|hpux11*)
- lt_cv_sys_dlopen_deplibs=yes
- ;;
- interix*)
- lt_cv_sys_dlopen_deplibs=yes
- ;;
- irix[[12345]]*|irix6.[[01]]*)
- # Catch all versions of IRIX before 6.2, and indicate that we don't
- # know how it worked for any of those versions.
- lt_cv_sys_dlopen_deplibs=unknown
- ;;
- irix*)
- # The case above catches anything before 6.2, and it's known that
- # at 6.2 and later dlopen does load deplibs.
- lt_cv_sys_dlopen_deplibs=yes
- ;;
- netbsd*)
- lt_cv_sys_dlopen_deplibs=yes
- ;;
- openbsd*)
- lt_cv_sys_dlopen_deplibs=yes
- ;;
- osf[[1234]]*)
- # dlopen did load deplibs (at least at 4.x), but until the 5.x series,
- # it did *not* use an RPATH in a shared library to find objects the
- # library depends on, so we explicitly say `no'.
- lt_cv_sys_dlopen_deplibs=no
- ;;
- osf5.0|osf5.0a|osf5.1)
- # dlopen *does* load deplibs and with the right loader patch applied
- # it even uses RPATH in a shared library to search for shared objects
- # that the library depends on, but there's no easy way to know if that
- # patch is installed. Since this is the case, all we can really
- # say is unknown -- it depends on the patch being installed. If
- # it is, this changes to `yes'. Without it, it would be `no'.
- lt_cv_sys_dlopen_deplibs=unknown
- ;;
- osf*)
- # the two cases above should catch all versions of osf <= 5.1. Read
- # the comments above for what we know about them.
- # At > 5.1, deplibs are loaded *and* any RPATH in a shared library
- # is used to find them so we can finally say `yes'.
- lt_cv_sys_dlopen_deplibs=yes
- ;;
- qnx*)
- lt_cv_sys_dlopen_deplibs=yes
- ;;
- solaris*)
- lt_cv_sys_dlopen_deplibs=yes
- ;;
- sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
- libltdl_cv_sys_dlopen_deplibs=yes
- ;;
- esac
- ])
-if test "$lt_cv_sys_dlopen_deplibs" != yes; then
- AC_DEFINE([LTDL_DLOPEN_DEPLIBS], [1],
- [Define if the OS needs help to load dependent libraries for dlopen().])
-fi
-])# LT_SYS_DLOPEN_DEPLIBS
-
-# Old name:
-AU_ALIAS([AC_LTDL_SYS_DLOPEN_DEPLIBS], [LT_SYS_DLOPEN_DEPLIBS])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_LTDL_SYS_DLOPEN_DEPLIBS], [])
-
-
-# LT_SYS_MODULE_EXT
-# -----------------
-AC_DEFUN([LT_SYS_MODULE_EXT],
-[m4_require([_LT_SYS_DYNAMIC_LINKER])dnl
-AC_CACHE_CHECK([which extension is used for runtime loadable modules],
- [libltdl_cv_shlibext],
-[
-module=yes
-eval libltdl_cv_shlibext=$shrext_cmds
-module=no
-eval libltdl_cv_shrext=$shrext_cmds
- ])
-if test -n "$libltdl_cv_shlibext"; then
- m4_pattern_allow([LT_MODULE_EXT])dnl
- AC_DEFINE_UNQUOTED([LT_MODULE_EXT], ["$libltdl_cv_shlibext"],
- [Define to the extension used for runtime loadable modules, say, ".so".])
-fi
-if test "$libltdl_cv_shrext" != "$libltdl_cv_shlibext"; then
- m4_pattern_allow([LT_SHARED_EXT])dnl
- AC_DEFINE_UNQUOTED([LT_SHARED_EXT], ["$libltdl_cv_shrext"],
- [Define to the shared library suffix, say, ".dylib".])
-fi
-])# LT_SYS_MODULE_EXT
-
-# Old name:
-AU_ALIAS([AC_LTDL_SHLIBEXT], [LT_SYS_MODULE_EXT])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_LTDL_SHLIBEXT], [])
-
-
-# LT_SYS_MODULE_PATH
-# ------------------
-AC_DEFUN([LT_SYS_MODULE_PATH],
-[m4_require([_LT_SYS_DYNAMIC_LINKER])dnl
-AC_CACHE_CHECK([which variable specifies run-time module search path],
- [lt_cv_module_path_var], [lt_cv_module_path_var="$shlibpath_var"])
-if test -n "$lt_cv_module_path_var"; then
- m4_pattern_allow([LT_MODULE_PATH_VAR])dnl
- AC_DEFINE_UNQUOTED([LT_MODULE_PATH_VAR], ["$lt_cv_module_path_var"],
- [Define to the name of the environment variable that determines the run-time module search path.])
-fi
-])# LT_SYS_MODULE_PATH
-
-# Old name:
-AU_ALIAS([AC_LTDL_SHLIBPATH], [LT_SYS_MODULE_PATH])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_LTDL_SHLIBPATH], [])
-
-
-# LT_SYS_DLSEARCH_PATH
-# --------------------
-AC_DEFUN([LT_SYS_DLSEARCH_PATH],
-[m4_require([_LT_SYS_DYNAMIC_LINKER])dnl
-AC_CACHE_CHECK([for the default library search path],
- [lt_cv_sys_dlsearch_path],
- [lt_cv_sys_dlsearch_path="$sys_lib_dlsearch_path_spec"])
-if test -n "$lt_cv_sys_dlsearch_path"; then
- sys_dlsearch_path=
- for dir in $lt_cv_sys_dlsearch_path; do
- if test -z "$sys_dlsearch_path"; then
- sys_dlsearch_path="$dir"
- else
- sys_dlsearch_path="$sys_dlsearch_path$PATH_SEPARATOR$dir"
- fi
- done
- m4_pattern_allow([LT_DLSEARCH_PATH])dnl
- AC_DEFINE_UNQUOTED([LT_DLSEARCH_PATH], ["$sys_dlsearch_path"],
- [Define to the system default library search path.])
-fi
-])# LT_SYS_DLSEARCH_PATH
-
-# Old name:
-AU_ALIAS([AC_LTDL_SYSSEARCHPATH], [LT_SYS_DLSEARCH_PATH])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_LTDL_SYSSEARCHPATH], [])
-
-
-# _LT_CHECK_DLPREOPEN
-# -------------------
-m4_defun([_LT_CHECK_DLPREOPEN],
-[m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
-AC_CACHE_CHECK([whether libtool supports -dlopen/-dlpreopen],
- [libltdl_cv_preloaded_symbols],
- [if test -n "$lt_cv_sys_global_symbol_pipe"; then
- libltdl_cv_preloaded_symbols=yes
- else
- libltdl_cv_preloaded_symbols=no
- fi
- ])
-if test x"$libltdl_cv_preloaded_symbols" = xyes; then
- AC_DEFINE([HAVE_PRELOADED_SYMBOLS], [1],
- [Define if libtool can extract symbol lists from object files.])
-fi
-])# _LT_CHECK_DLPREOPEN
-
-
-# LT_LIB_DLLOAD
-# -------------
-AC_DEFUN([LT_LIB_DLLOAD],
-[m4_pattern_allow([^LT_DLLOADERS$])
-LT_DLLOADERS=
-AC_SUBST([LT_DLLOADERS])
-
-AC_LANG_PUSH([C])
-
-LIBADD_DLOPEN=
-AC_SEARCH_LIBS([dlopen], [dl],
- [AC_DEFINE([HAVE_LIBDL], [1],
- [Define if you have the libdl library or equivalent.])
- if test "$ac_cv_search_dlopen" != "none required" ; then
- LIBADD_DLOPEN="-ldl"
- fi
- libltdl_cv_lib_dl_dlopen="yes"
- LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dlopen.la"],
- [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#if HAVE_DLFCN_H
-# include <dlfcn.h>
-#endif
- ]], [[dlopen(0, 0);]])],
- [AC_DEFINE([HAVE_LIBDL], [1],
- [Define if you have the libdl library or equivalent.])
- libltdl_cv_func_dlopen="yes"
- LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dlopen.la"],
- [AC_CHECK_LIB([svld], [dlopen],
- [AC_DEFINE([HAVE_LIBDL], [1],
- [Define if you have the libdl library or equivalent.])
- LIBADD_DLOPEN="-lsvld" libltdl_cv_func_dlopen="yes"
- LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dlopen.la"])])])
-if test x"$libltdl_cv_func_dlopen" = xyes || test x"$libltdl_cv_lib_dl_dlopen" = xyes
-then
- lt_save_LIBS="$LIBS"
- LIBS="$LIBS $LIBADD_DLOPEN"
- AC_CHECK_FUNCS([dlerror])
- LIBS="$lt_save_LIBS"
-fi
-AC_SUBST([LIBADD_DLOPEN])
-
-LIBADD_SHL_LOAD=
-AC_CHECK_FUNC([shl_load],
- [AC_DEFINE([HAVE_SHL_LOAD], [1],
- [Define if you have the shl_load function.])
- LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}shl_load.la"],
- [AC_CHECK_LIB([dld], [shl_load],
- [AC_DEFINE([HAVE_SHL_LOAD], [1],
- [Define if you have the shl_load function.])
- LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}shl_load.la"
- LIBADD_SHL_LOAD="-ldld"])])
-AC_SUBST([LIBADD_SHL_LOAD])
-
-case $host_os in
-darwin[[1567]].*)
-# We only want this for pre-Mac OS X 10.4.
- AC_CHECK_FUNC([_dyld_func_lookup],
- [AC_DEFINE([HAVE_DYLD], [1],
- [Define if you have the _dyld_func_lookup function.])
- LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dyld.la"])
- ;;
-beos*)
- LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}load_add_on.la"
- ;;
-cygwin* | mingw* | os2* | pw32*)
- AC_CHECK_DECLS([cygwin_conv_path], [], [], [[#include <sys/cygwin.h>]])
- LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}loadlibrary.la"
- ;;
-esac
-
-AC_CHECK_LIB([dld], [dld_link],
- [AC_DEFINE([HAVE_DLD], [1],
- [Define if you have the GNU dld library.])
- LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dld_link.la"])
-AC_SUBST([LIBADD_DLD_LINK])
-
-m4_pattern_allow([^LT_DLPREOPEN$])
-LT_DLPREOPEN=
-if test -n "$LT_DLLOADERS"
-then
- for lt_loader in $LT_DLLOADERS; do
- LT_DLPREOPEN="$LT_DLPREOPEN-dlpreopen $lt_loader "
- done
- AC_DEFINE([HAVE_LIBDLLOADER], [1],
- [Define if libdlloader will be built on this platform])
-fi
-AC_SUBST([LT_DLPREOPEN])
-
-dnl This isn't used anymore, but set it for backwards compatibility
-LIBADD_DL="$LIBADD_DLOPEN $LIBADD_SHL_LOAD"
-AC_SUBST([LIBADD_DL])
-
-AC_LANG_POP
-])# LT_LIB_DLLOAD
-
-# Old name:
-AU_ALIAS([AC_LTDL_DLLIB], [LT_LIB_DLLOAD])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_LTDL_DLLIB], [])
-
-
-# LT_SYS_SYMBOL_USCORE
-# --------------------
-# does the compiler prefix global symbols with an underscore?
-AC_DEFUN([LT_SYS_SYMBOL_USCORE],
-[m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
-AC_CACHE_CHECK([for _ prefix in compiled symbols],
- [lt_cv_sys_symbol_underscore],
- [lt_cv_sys_symbol_underscore=no
- cat > conftest.$ac_ext <<_LT_EOF
-void nm_test_func(){}
-int main(){nm_test_func;return 0;}
-_LT_EOF
- if AC_TRY_EVAL(ac_compile); then
- # Now try to grab the symbols.
- ac_nlist=conftest.nm
- if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $ac_nlist) && test -s "$ac_nlist"; then
- # See whether the symbols have a leading underscore.
- if grep '^. _nm_test_func' "$ac_nlist" >/dev/null; then
- lt_cv_sys_symbol_underscore=yes
- else
- if grep '^. nm_test_func ' "$ac_nlist" >/dev/null; then
- :
- else
- echo "configure: cannot find nm_test_func in $ac_nlist" >&AS_MESSAGE_LOG_FD
- fi
- fi
- else
- echo "configure: cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
- fi
- else
- echo "configure: failed program was:" >&AS_MESSAGE_LOG_FD
- cat conftest.c >&AS_MESSAGE_LOG_FD
- fi
- rm -rf conftest*
- ])
- sys_symbol_underscore=$lt_cv_sys_symbol_underscore
- AC_SUBST([sys_symbol_underscore])
-])# LT_SYS_SYMBOL_USCORE
-
-# Old name:
-AU_ALIAS([AC_LTDL_SYMBOL_USCORE], [LT_SYS_SYMBOL_USCORE])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_LTDL_SYMBOL_USCORE], [])
-
-
-# LT_FUNC_DLSYM_USCORE
-# --------------------
-AC_DEFUN([LT_FUNC_DLSYM_USCORE],
-[AC_REQUIRE([LT_SYS_SYMBOL_USCORE])dnl
-if test x"$lt_cv_sys_symbol_underscore" = xyes; then
- if test x"$libltdl_cv_func_dlopen" = xyes ||
- test x"$libltdl_cv_lib_dl_dlopen" = xyes ; then
- AC_CACHE_CHECK([whether we have to add an underscore for dlsym],
- [libltdl_cv_need_uscore],
- [libltdl_cv_need_uscore=unknown
- save_LIBS="$LIBS"
- LIBS="$LIBS $LIBADD_DLOPEN"
- _LT_TRY_DLOPEN_SELF(
- [libltdl_cv_need_uscore=no], [libltdl_cv_need_uscore=yes],
- [], [libltdl_cv_need_uscore=cross])
- LIBS="$save_LIBS"
- ])
- fi
-fi
-
-if test x"$libltdl_cv_need_uscore" = xyes; then
- AC_DEFINE([NEED_USCORE], [1],
- [Define if dlsym() requires a leading underscore in symbol names.])
-fi
-])# LT_FUNC_DLSYM_USCORE
-
-# Old name:
-AU_ALIAS([AC_LTDL_DLSYM_USCORE], [LT_FUNC_DLSYM_USCORE])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_LTDL_DLSYM_USCORE], [])
-
-# Copyright (C) 2002-2013 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.
-
-# AM_AUTOMAKE_VERSION(VERSION)
-# ----------------------------
-# Automake X.Y traces this macro to ensure aclocal.m4 has been
-# generated from the m4 files accompanying Automake X.Y.
-# (This private macro should not be called outside this file.)
-AC_DEFUN([AM_AUTOMAKE_VERSION],
-[am__api_version='1.13'
-dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
-dnl require some minimum version. Point them to the right macro.
-m4_if([$1], [1.13.4], [],
- [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
-])
-
-# _AM_AUTOCONF_VERSION(VERSION)
-# -----------------------------
-# aclocal traces this macro to find the Autoconf version.
-# This is a private macro too. Using m4_define simplifies
-# the logic in aclocal, which can simply ignore this definition.
-m4_define([_AM_AUTOCONF_VERSION], [])
-
-# AM_SET_CURRENT_AUTOMAKE_VERSION
-# -------------------------------
-# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
-# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
-AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
-[AM_AUTOMAKE_VERSION([1.13.4])dnl
-m4_ifndef([AC_AUTOCONF_VERSION],
- [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
-_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
-
-# Figure out how to run the assembler. -*- Autoconf -*-
-
-# Copyright (C) 2001-2013 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.
-
-# AM_PROG_AS
-# ----------
-AC_DEFUN([AM_PROG_AS],
-[# By default we simply use the C compiler to build assembly code.
-AC_REQUIRE([AC_PROG_CC])
-test "${CCAS+set}" = set || CCAS=$CC
-test "${CCASFLAGS+set}" = set || CCASFLAGS=$CFLAGS
-AC_ARG_VAR([CCAS], [assembler compiler command (defaults to CC)])
-AC_ARG_VAR([CCASFLAGS], [assembler compiler flags (defaults to CFLAGS)])
-_AM_IF_OPTION([no-dependencies],, [_AM_DEPENDENCIES([CCAS])])dnl
-])
-
-# AM_AUX_DIR_EXPAND -*- Autoconf -*-
-
-# Copyright (C) 2001-2013 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.
-
-# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
-# $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to
-# '$srcdir', '$srcdir/..', or '$srcdir/../..'.
-#
-# Of course, Automake must honor this variable whenever it calls a
-# tool from the auxiliary directory. The problem is that $srcdir (and
-# therefore $ac_aux_dir as well) can be either absolute or relative,
-# depending on how configure is run. This is pretty annoying, since
-# it makes $ac_aux_dir quite unusable in subdirectories: in the top
-# source directory, any form will work fine, but in subdirectories a
-# relative path needs to be adjusted first.
-#
-# $ac_aux_dir/missing
-# fails when called from a subdirectory if $ac_aux_dir is relative
-# $top_srcdir/$ac_aux_dir/missing
-# fails if $ac_aux_dir is absolute,
-# fails when called from a subdirectory in a VPATH build with
-# a relative $ac_aux_dir
-#
-# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
-# are both prefixed by $srcdir. In an in-source build this is usually
-# harmless because $srcdir is '.', but things will broke when you
-# start a VPATH build or use an absolute $srcdir.
-#
-# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
-# iff we strip the leading $srcdir from $ac_aux_dir. That would be:
-# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
-# and then we would define $MISSING as
-# MISSING="\${SHELL} $am_aux_dir/missing"
-# This will work as long as MISSING is not called from configure, because
-# unfortunately $(top_srcdir) has no meaning in configure.
-# However there are other variables, like CC, which are often used in
-# configure, and could therefore not use this "fixed" $ac_aux_dir.
-#
-# Another solution, used here, is to always expand $ac_aux_dir to an
-# absolute PATH. The drawback is that using absolute paths prevent a
-# configured tree to be moved without reconfiguration.
-
-AC_DEFUN([AM_AUX_DIR_EXPAND],
-[dnl Rely on autoconf to set up CDPATH properly.
-AC_PREREQ([2.50])dnl
-# expand $ac_aux_dir to an absolute path
-am_aux_dir=`cd $ac_aux_dir && pwd`
-])
-
-# AM_CONDITIONAL -*- Autoconf -*-
-
-# Copyright (C) 1997-2013 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.
-
-# AM_CONDITIONAL(NAME, SHELL-CONDITION)
-# -------------------------------------
-# Define a conditional.
-AC_DEFUN([AM_CONDITIONAL],
-[AC_PREREQ([2.52])dnl
- m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
- [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
-AC_SUBST([$1_TRUE])dnl
-AC_SUBST([$1_FALSE])dnl
-_AM_SUBST_NOTMAKE([$1_TRUE])dnl
-_AM_SUBST_NOTMAKE([$1_FALSE])dnl
-m4_define([_AM_COND_VALUE_$1], [$2])dnl
-if $2; then
- $1_TRUE=
- $1_FALSE='#'
-else
- $1_TRUE='#'
- $1_FALSE=
-fi
-AC_CONFIG_COMMANDS_PRE(
-[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
- AC_MSG_ERROR([[conditional "$1" was never defined.
-Usually this means the macro was only invoked conditionally.]])
-fi])])
-
-# Copyright (C) 1999-2013 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.
-
-
-# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be
-# written in clear, in which case automake, when reading aclocal.m4,
-# will think it sees a *use*, and therefore will trigger all it's
-# C support machinery. Also note that it means that autoscan, seeing
-# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
-
-
-# _AM_DEPENDENCIES(NAME)
-# ----------------------
-# See how the compiler implements dependency checking.
-# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC".
-# We try a few techniques and use that to set a single cache variable.
-#
-# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
-# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
-# dependency, and given that the user is not expected to run this macro,
-# just rely on AC_PROG_CC.
-AC_DEFUN([_AM_DEPENDENCIES],
-[AC_REQUIRE([AM_SET_DEPDIR])dnl
-AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
-AC_REQUIRE([AM_MAKE_INCLUDE])dnl
-AC_REQUIRE([AM_DEP_TRACK])dnl
-
-m4_if([$1], [CC], [depcc="$CC" am_compiler_list=],
- [$1], [CXX], [depcc="$CXX" am_compiler_list=],
- [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
- [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'],
- [$1], [UPC], [depcc="$UPC" am_compiler_list=],
- [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
- [depcc="$$1" am_compiler_list=])
-
-AC_CACHE_CHECK([dependency style of $depcc],
- [am_cv_$1_dependencies_compiler_type],
-[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
- # We make a subdir and do the tests there. Otherwise we can end up
- # making bogus files that we don't know about and never remove. For
- # instance it was reported that on HP-UX the gcc test will end up
- # making a dummy file named 'D' -- because '-MD' means "put the output
- # in D".
- rm -rf conftest.dir
- mkdir conftest.dir
- # Copy depcomp to subdir because otherwise we won't find it if we're
- # using a relative directory.
- cp "$am_depcomp" conftest.dir
- cd conftest.dir
- # We will build objects and dependencies in a subdirectory because
- # it helps to detect inapplicable dependency modes. For instance
- # both Tru64's cc and ICC support -MD to output dependencies as a
- # side effect of compilation, but ICC will put the dependencies in
- # the current directory while Tru64 will put them in the object
- # directory.
- mkdir sub
-
- am_cv_$1_dependencies_compiler_type=none
- if test "$am_compiler_list" = ""; then
- am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
- fi
- am__universal=false
- m4_case([$1], [CC],
- [case " $depcc " in #(
- *\ -arch\ *\ -arch\ *) am__universal=true ;;
- esac],
- [CXX],
- [case " $depcc " in #(
- *\ -arch\ *\ -arch\ *) am__universal=true ;;
- esac])
-
- for depmode in $am_compiler_list; do
- # Setup a source with many dependencies, because some compilers
- # like to wrap large dependency lists on column 80 (with \), and
- # we should not choose a depcomp mode which is confused by this.
- #
- # We need to recreate these files for each test, as the compiler may
- # overwrite some of them when testing with obscure command lines.
- # This happens at least with the AIX C compiler.
- : > sub/conftest.c
- for i in 1 2 3 4 5 6; do
- echo '#include "conftst'$i'.h"' >> sub/conftest.c
- # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
- # Solaris 10 /bin/sh.
- echo '/* dummy */' > sub/conftst$i.h
- done
- echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
-
- # We check with '-c' and '-o' for the sake of the "dashmstdout"
- # mode. It turns out that the SunPro C++ compiler does not properly
- # handle '-M -o', and we need to detect this. Also, some Intel
- # versions had trouble with output in subdirs.
- am__obj=sub/conftest.${OBJEXT-o}
- am__minus_obj="-o $am__obj"
- case $depmode in
- gcc)
- # This depmode causes a compiler race in universal mode.
- test "$am__universal" = false || continue
- ;;
- nosideeffect)
- # After this tag, mechanisms are not by side-effect, so they'll
- # only be used when explicitly requested.
- if test "x$enable_dependency_tracking" = xyes; then
- continue
- else
- break
- fi
- ;;
- msvc7 | msvc7msys | msvisualcpp | msvcmsys)
- # This compiler won't grok '-c -o', but also, the minuso test has
- # not run yet. These depmodes are late enough in the game, and
- # so weak that their functioning should not be impacted.
- am__obj=conftest.${OBJEXT-o}
- am__minus_obj=
- ;;
- none) break ;;
- esac
- if depmode=$depmode \
- source=sub/conftest.c object=$am__obj \
- depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
- $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
- >/dev/null 2>conftest.err &&
- grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
- grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
- grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
- ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
- # icc doesn't choke on unknown options, it will just issue warnings
- # or remarks (even with -Werror). So we grep stderr for any message
- # that says an option was ignored or not supported.
- # When given -MP, icc 7.0 and 7.1 complain thusly:
- # icc: Command line warning: ignoring option '-M'; no argument required
- # The diagnosis changed in icc 8.0:
- # icc: Command line remark: option '-MP' not supported
- if (grep 'ignoring option' conftest.err ||
- grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
- am_cv_$1_dependencies_compiler_type=$depmode
- break
- fi
- fi
- done
-
- cd ..
- rm -rf conftest.dir
-else
- am_cv_$1_dependencies_compiler_type=none
-fi
-])
-AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
-AM_CONDITIONAL([am__fastdep$1], [
- test "x$enable_dependency_tracking" != xno \
- && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
-])
-
-
-# AM_SET_DEPDIR
-# -------------
-# Choose a directory name for dependency files.
-# This macro is AC_REQUIREd in _AM_DEPENDENCIES.
-AC_DEFUN([AM_SET_DEPDIR],
-[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
-AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
-])
-
-
-# AM_DEP_TRACK
-# ------------
-AC_DEFUN([AM_DEP_TRACK],
-[AC_ARG_ENABLE([dependency-tracking], [dnl
-AS_HELP_STRING(
- [--enable-dependency-tracking],
- [do not reject slow dependency extractors])
-AS_HELP_STRING(
- [--disable-dependency-tracking],
- [speeds up one-time build])])
-if test "x$enable_dependency_tracking" != xno; then
- am_depcomp="$ac_aux_dir/depcomp"
- AMDEPBACKSLASH='\'
- am__nodep='_no'
-fi
-AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
-AC_SUBST([AMDEPBACKSLASH])dnl
-_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
-AC_SUBST([am__nodep])dnl
-_AM_SUBST_NOTMAKE([am__nodep])dnl
-])
-
-# Generate code to set up dependency tracking. -*- Autoconf -*-
-
-# Copyright (C) 1999-2013 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.
-
-
-# _AM_OUTPUT_DEPENDENCY_COMMANDS
-# ------------------------------
-AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
-[{
- # Older Autoconf quotes --file arguments for eval, but not when files
- # are listed without --file. Let's play safe and only enable the eval
- # if we detect the quoting.
- case $CONFIG_FILES in
- *\'*) eval set x "$CONFIG_FILES" ;;
- *) set x $CONFIG_FILES ;;
- esac
- shift
- for mf
- do
- # Strip MF so we end up with the name of the file.
- mf=`echo "$mf" | sed -e 's/:.*$//'`
- # Check whether this is an Automake generated Makefile or not.
- # We used to match only the files named 'Makefile.in', but
- # some people rename them; so instead we look at the file content.
- # Grep'ing the first line is not enough: some people post-process
- # each Makefile.in and add a new line on top of each file to say so.
- # Grep'ing the whole file is not good either: AIX grep has a line
- # limit of 2048, but all sed's we know have understand at least 4000.
- if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
- dirpart=`AS_DIRNAME("$mf")`
- else
- continue
- fi
- # Extract the definition of DEPDIR, am__include, and am__quote
- # from the Makefile without running 'make'.
- DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
- test -z "$DEPDIR" && continue
- am__include=`sed -n 's/^am__include = //p' < "$mf"`
- test -z "$am__include" && continue
- am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
- # Find all dependency output files, they are included files with
- # $(DEPDIR) in their names. We invoke sed twice because it is the
- # simplest approach to changing $(DEPDIR) to its actual value in the
- # expansion.
- for file in `sed -n "
- s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
- sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
- # Make sure the directory exists.
- test -f "$dirpart/$file" && continue
- fdir=`AS_DIRNAME(["$file"])`
- AS_MKDIR_P([$dirpart/$fdir])
- # echo "creating $dirpart/$file"
- echo '# dummy' > "$dirpart/$file"
- done
- done
-}
-])# _AM_OUTPUT_DEPENDENCY_COMMANDS
-
-
-# AM_OUTPUT_DEPENDENCY_COMMANDS
-# -----------------------------
-# This macro should only be invoked once -- use via AC_REQUIRE.
-#
-# This code is only required when automatic dependency tracking
-# is enabled. FIXME. This creates each '.P' file that we will
-# need in order to bootstrap the dependency handling code.
-AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
-[AC_CONFIG_COMMANDS([depfiles],
- [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
- [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
-])
-
-# Do all the work for Automake. -*- Autoconf -*-
-
-# Copyright (C) 1996-2013 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 macro actually does too much. Some checks are only needed if
-# your package does certain things. But this isn't really a big deal.
-
-# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
-# AM_INIT_AUTOMAKE([OPTIONS])
-# -----------------------------------------------
-# The call with PACKAGE and VERSION arguments is the old style
-# call (pre autoconf-2.50), which is being phased out. PACKAGE
-# and VERSION should now be passed to AC_INIT and removed from
-# the call to AM_INIT_AUTOMAKE.
-# We support both call styles for the transition. After
-# the next Automake release, Autoconf can make the AC_INIT
-# arguments mandatory, and then we can depend on a new Autoconf
-# release and drop the old call support.
-AC_DEFUN([AM_INIT_AUTOMAKE],
-[AC_PREREQ([2.65])dnl
-dnl Autoconf wants to disallow AM_ names. We explicitly allow
-dnl the ones we care about.
-m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
-AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
-AC_REQUIRE([AC_PROG_INSTALL])dnl
-if test "`cd $srcdir && pwd`" != "`pwd`"; then
- # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
- # is not polluted with repeated "-I."
- AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
- # test to see if srcdir already configured
- if test -f $srcdir/config.status; then
- AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
- fi
-fi
-
-# test whether we have cygpath
-if test -z "$CYGPATH_W"; then
- if (cygpath --version) >/dev/null 2>/dev/null; then
- CYGPATH_W='cygpath -w'
- else
- CYGPATH_W=echo
- fi
-fi
-AC_SUBST([CYGPATH_W])
-
-# Define the identity of the package.
-dnl Distinguish between old-style and new-style calls.
-m4_ifval([$2],
-[AC_DIAGNOSE([obsolete],
- [$0: two- and three-arguments forms are deprecated.])
-m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
- AC_SUBST([PACKAGE], [$1])dnl
- AC_SUBST([VERSION], [$2])],
-[_AM_SET_OPTIONS([$1])dnl
-dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
-m4_if(
- m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]),
- [ok:ok],,
- [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
- AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
- AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
-
-_AM_IF_OPTION([no-define],,
-[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package])
- AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl
-
-# Some tools Automake needs.
-AC_REQUIRE([AM_SANITY_CHECK])dnl
-AC_REQUIRE([AC_ARG_PROGRAM])dnl
-AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}])
-AM_MISSING_PROG([AUTOCONF], [autoconf])
-AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}])
-AM_MISSING_PROG([AUTOHEADER], [autoheader])
-AM_MISSING_PROG([MAKEINFO], [makeinfo])
-AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
-AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
-AC_REQUIRE([AC_PROG_MKDIR_P])dnl
-# For better backward compatibility. To be removed once Automake 1.9.x
-# dies out for good. For more background, see:
-# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
-# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
-AC_SUBST([mkdir_p], ['$(MKDIR_P)'])
-# We need awk for the "check" target. The system "awk" is bad on
-# some platforms.
-AC_REQUIRE([AC_PROG_AWK])dnl
-AC_REQUIRE([AC_PROG_MAKE_SET])dnl
-AC_REQUIRE([AM_SET_LEADING_DOT])dnl
-_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
- [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
- [_AM_PROG_TAR([v7])])])
-_AM_IF_OPTION([no-dependencies],,
-[AC_PROVIDE_IFELSE([AC_PROG_CC],
- [_AM_DEPENDENCIES([CC])],
- [m4_define([AC_PROG_CC],
- m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl
-AC_PROVIDE_IFELSE([AC_PROG_CXX],
- [_AM_DEPENDENCIES([CXX])],
- [m4_define([AC_PROG_CXX],
- m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl
-AC_PROVIDE_IFELSE([AC_PROG_OBJC],
- [_AM_DEPENDENCIES([OBJC])],
- [m4_define([AC_PROG_OBJC],
- m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl
-AC_PROVIDE_IFELSE([AC_PROG_OBJCXX],
- [_AM_DEPENDENCIES([OBJCXX])],
- [m4_define([AC_PROG_OBJCXX],
- m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl
-])
-AC_REQUIRE([AM_SILENT_RULES])dnl
-dnl The testsuite driver may need to know about EXEEXT, so add the
-dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This
-dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below.
-AC_CONFIG_COMMANDS_PRE(dnl
-[m4_provide_if([_AM_COMPILER_EXEEXT],
- [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
-])
-
-dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not
-dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
-dnl mangled by Autoconf and run in a shell conditional statement.
-m4_define([_AC_COMPILER_EXEEXT],
-m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
-
-
-# When config.status generates a header, we must update the stamp-h file.
-# This file resides in the same directory as the config header
-# that is generated. The stamp files are numbered to have different names.
-
-# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
-# loop where config.status creates the headers, so we can generate
-# our stamp files there.
-AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
-[# Compute $1's index in $config_headers.
-_am_arg=$1
-_am_stamp_count=1
-for _am_header in $config_headers :; do
- case $_am_header in
- $_am_arg | $_am_arg:* )
- break ;;
- * )
- _am_stamp_count=`expr $_am_stamp_count + 1` ;;
- esac
-done
-echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
-
-# Copyright (C) 2001-2013 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.
-
-# AM_PROG_INSTALL_SH
-# ------------------
-# Define $install_sh.
-AC_DEFUN([AM_PROG_INSTALL_SH],
-[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
-if test x"${install_sh}" != xset; then
- case $am_aux_dir in
- *\ * | *\ *)
- install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
- *)
- install_sh="\${SHELL} $am_aux_dir/install-sh"
- esac
-fi
-AC_SUBST([install_sh])])
-
-# Copyright (C) 2003-2013 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.
-
-# Check whether the underlying file-system supports filenames
-# with a leading dot. For instance MS-DOS doesn't.
-AC_DEFUN([AM_SET_LEADING_DOT],
-[rm -rf .tst 2>/dev/null
-mkdir .tst 2>/dev/null
-if test -d .tst; then
- am__leading_dot=.
-else
- am__leading_dot=_
-fi
-rmdir .tst 2>/dev/null
-AC_SUBST([am__leading_dot])])
-
-# Add --enable-maintainer-mode option to configure. -*- Autoconf -*-
-# From Jim Meyering
-
-# Copyright (C) 1996-2013 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.
-
-# AM_MAINTAINER_MODE([DEFAULT-MODE])
-# ----------------------------------
-# Control maintainer-specific portions of Makefiles.
-# Default is to disable them, unless 'enable' is passed literally.
-# For symmetry, 'disable' may be passed as well. Anyway, the user
-# can override the default with the --enable/--disable switch.
-AC_DEFUN([AM_MAINTAINER_MODE],
-[m4_case(m4_default([$1], [disable]),
- [enable], [m4_define([am_maintainer_other], [disable])],
- [disable], [m4_define([am_maintainer_other], [enable])],
- [m4_define([am_maintainer_other], [enable])
- m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
-AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
- dnl maintainer-mode's default is 'disable' unless 'enable' is passed
- AC_ARG_ENABLE([maintainer-mode],
- [AS_HELP_STRING([--]am_maintainer_other[-maintainer-mode],
- am_maintainer_other[ make rules and dependencies not useful
- (and sometimes confusing) to the casual installer])],
- [USE_MAINTAINER_MODE=$enableval],
- [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
- AC_MSG_RESULT([$USE_MAINTAINER_MODE])
- AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
- MAINT=$MAINTAINER_MODE_TRUE
- AC_SUBST([MAINT])dnl
-]
-)
-
-# Check to see how 'make' treats includes. -*- Autoconf -*-
-
-# Copyright (C) 2001-2013 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.
-
-# AM_MAKE_INCLUDE()
-# -----------------
-# Check to see how make treats includes.
-AC_DEFUN([AM_MAKE_INCLUDE],
-[am_make=${MAKE-make}
-cat > confinc << 'END'
-am__doit:
- @echo this is the am__doit target
-.PHONY: am__doit
-END
-# If we don't find an include directive, just comment out the code.
-AC_MSG_CHECKING([for style of include used by $am_make])
-am__include="#"
-am__quote=
-_am_result=none
-# First try GNU make style include.
-echo "include confinc" > confmf
-# Ignore all kinds of additional output from 'make'.
-case `$am_make -s -f confmf 2> /dev/null` in #(
-*the\ am__doit\ target*)
- am__include=include
- am__quote=
- _am_result=GNU
- ;;
-esac
-# Now try BSD make style include.
-if test "$am__include" = "#"; then
- echo '.include "confinc"' > confmf
- case `$am_make -s -f confmf 2> /dev/null` in #(
- *the\ am__doit\ target*)
- am__include=.include
- am__quote="\""
- _am_result=BSD
- ;;
- esac
-fi
-AC_SUBST([am__include])
-AC_SUBST([am__quote])
-AC_MSG_RESULT([$_am_result])
-rm -f confinc confmf
-])
-
-# Copyright (C) 1999-2013 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.
-
-# AM_PROG_CC_C_O
-# --------------
-# Like AC_PROG_CC_C_O, but changed for automake.
-AC_DEFUN([AM_PROG_CC_C_O],
-[AC_REQUIRE([AC_PROG_CC_C_O])dnl
-AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
-AC_REQUIRE_AUX_FILE([compile])dnl
-# FIXME: we rely on the cache variable name because
-# there is no other way.
-set dummy $CC
-am_cc=`echo $[2] | sed ['s/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/']`
-eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o
-if test "$am_t" != yes; then
- # Losing compiler, so override with the script.
- # FIXME: It is wrong to rewrite CC.
- # But if we don't then we get into trouble of one sort or another.
- # A longer-term fix would be to have automake use am__CC in this case,
- # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
- CC="$am_aux_dir/compile $CC"
-fi
-dnl Make sure AC_PROG_CC is never called again, or it will override our
-dnl setting of CC.
-m4_define([AC_PROG_CC],
- [m4_fatal([AC_PROG_CC cannot be called after AM_PROG_CC_C_O])])
-])
-
-# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
-
-# Copyright (C) 1997-2013 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.
-
-# AM_MISSING_PROG(NAME, PROGRAM)
-# ------------------------------
-AC_DEFUN([AM_MISSING_PROG],
-[AC_REQUIRE([AM_MISSING_HAS_RUN])
-$1=${$1-"${am_missing_run}$2"}
-AC_SUBST($1)])
-
-# AM_MISSING_HAS_RUN
-# ------------------
-# Define MISSING if not defined so far and test if it is modern enough.
-# If it is, set am_missing_run to use it, otherwise, to nothing.
-AC_DEFUN([AM_MISSING_HAS_RUN],
-[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
-AC_REQUIRE_AUX_FILE([missing])dnl
-if test x"${MISSING+set}" != xset; then
- case $am_aux_dir in
- *\ * | *\ *)
- MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
- *)
- MISSING="\${SHELL} $am_aux_dir/missing" ;;
- esac
-fi
-# Use eval to expand $SHELL
-if eval "$MISSING --is-lightweight"; then
- am_missing_run="$MISSING "
-else
- am_missing_run=
- AC_MSG_WARN(['missing' script is too old or missing])
-fi
-])
-
-# Helper functions for option handling. -*- Autoconf -*-
-
-# Copyright (C) 2001-2013 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.
-
-# _AM_MANGLE_OPTION(NAME)
-# -----------------------
-AC_DEFUN([_AM_MANGLE_OPTION],
-[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
-
-# _AM_SET_OPTION(NAME)
-# --------------------
-# Set option NAME. Presently that only means defining a flag for this option.
-AC_DEFUN([_AM_SET_OPTION],
-[m4_define(_AM_MANGLE_OPTION([$1]), [1])])
-
-# _AM_SET_OPTIONS(OPTIONS)
-# ------------------------
-# OPTIONS is a space-separated list of Automake options.
-AC_DEFUN([_AM_SET_OPTIONS],
-[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
-
-# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
-# -------------------------------------------
-# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
-AC_DEFUN([_AM_IF_OPTION],
-[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
-
-# Check to make sure that the build environment is sane. -*- Autoconf -*-
-
-# Copyright (C) 1996-2013 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.
-
-# AM_SANITY_CHECK
-# ---------------
-AC_DEFUN([AM_SANITY_CHECK],
-[AC_MSG_CHECKING([whether build environment is sane])
-# Reject unsafe characters in $srcdir or the absolute working directory
-# name. Accept space and tab only in the latter.
-am_lf='
-'
-case `pwd` in
- *[[\\\"\#\$\&\'\`$am_lf]]*)
- AC_MSG_ERROR([unsafe absolute working directory name]);;
-esac
-case $srcdir in
- *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*)
- AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);;
-esac
-
-# Do 'set' in a subshell so we don't clobber the current shell's
-# arguments. Must try -L first in case configure is actually a
-# symlink; some systems play weird games with the mod time of symlinks
-# (eg FreeBSD returns the mod time of the symlink's containing
-# directory).
-if (
- am_has_slept=no
- for am_try in 1 2; do
- echo "timestamp, slept: $am_has_slept" > conftest.file
- set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
- if test "$[*]" = "X"; then
- # -L didn't work.
- set X `ls -t "$srcdir/configure" conftest.file`
- fi
- if test "$[*]" != "X $srcdir/configure conftest.file" \
- && test "$[*]" != "X conftest.file $srcdir/configure"; then
-
- # If neither matched, then we have a broken ls. This can happen
- # if, for instance, CONFIG_SHELL is bash and it inherits a
- # broken ls alias from the environment. This has actually
- # happened. Such a system could not be considered "sane".
- AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
- alias in your environment])
- fi
- if test "$[2]" = conftest.file || test $am_try -eq 2; then
- break
- fi
- # Just in case.
- sleep 1
- am_has_slept=yes
- done
- test "$[2]" = conftest.file
- )
-then
- # Ok.
- :
-else
- AC_MSG_ERROR([newly created file is older than distributed files!
-Check your system clock])
-fi
-AC_MSG_RESULT([yes])
-# If we didn't sleep, we still need to ensure time stamps of config.status and
-# generated files are strictly newer.
-am_sleep_pid=
-if grep 'slept: no' conftest.file >/dev/null 2>&1; then
- ( sleep 1 ) &
- am_sleep_pid=$!
-fi
-AC_CONFIG_COMMANDS_PRE(
- [AC_MSG_CHECKING([that generated files are newer than configure])
- if test -n "$am_sleep_pid"; then
- # Hide warnings about reused PIDs.
- wait $am_sleep_pid 2>/dev/null
- fi
- AC_MSG_RESULT([done])])
-rm -f conftest.file
-])
-
-# Copyright (C) 2009-2013 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.
-
-# AM_SILENT_RULES([DEFAULT])
-# --------------------------
-# Enable less verbose build rules; with the default set to DEFAULT
-# ("yes" being less verbose, "no" or empty being verbose).
-AC_DEFUN([AM_SILENT_RULES],
-[AC_ARG_ENABLE([silent-rules], [dnl
-AS_HELP_STRING(
- [--enable-silent-rules],
- [less verbose build output (undo: "make V=1")])
-AS_HELP_STRING(
- [--disable-silent-rules],
- [verbose build output (undo: "make V=0")])dnl
-])
-case $enable_silent_rules in @%:@ (((
- yes) AM_DEFAULT_VERBOSITY=0;;
- no) AM_DEFAULT_VERBOSITY=1;;
- *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
-esac
-dnl
-dnl A few 'make' implementations (e.g., NonStop OS and NextStep)
-dnl do not support nested variable expansions.
-dnl See automake bug#9928 and bug#10237.
-am_make=${MAKE-make}
-AC_CACHE_CHECK([whether $am_make supports nested variables],
- [am_cv_make_support_nested_variables],
- [if AS_ECHO([['TRUE=$(BAR$(V))
-BAR0=false
-BAR1=true
-V=1
-am__doit:
- @$(TRUE)
-.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then
- am_cv_make_support_nested_variables=yes
-else
- am_cv_make_support_nested_variables=no
-fi])
-if test $am_cv_make_support_nested_variables = yes; then
- dnl Using '$V' instead of '$(V)' breaks IRIX make.
- AM_V='$(V)'
- AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
-else
- AM_V=$AM_DEFAULT_VERBOSITY
- AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
-fi
-AC_SUBST([AM_V])dnl
-AM_SUBST_NOTMAKE([AM_V])dnl
-AC_SUBST([AM_DEFAULT_V])dnl
-AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl
-AC_SUBST([AM_DEFAULT_VERBOSITY])dnl
-AM_BACKSLASH='\'
-AC_SUBST([AM_BACKSLASH])dnl
-_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
-])
-
-# Copyright (C) 2001-2013 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.
-
-# AM_PROG_INSTALL_STRIP
-# ---------------------
-# One issue with vendor 'install' (even GNU) is that you can't
-# specify the program used to strip binaries. This is especially
-# annoying in cross-compiling environments, where the build's strip
-# is unlikely to handle the host's binaries.
-# Fortunately install-sh will honor a STRIPPROG variable, so we
-# always use install-sh in "make install-strip", and initialize
-# STRIPPROG with the value of the STRIP variable (set by the user).
-AC_DEFUN([AM_PROG_INSTALL_STRIP],
-[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
-# Installed binaries are usually stripped using 'strip' when the user
-# run "make install-strip". However 'strip' might not be the right
-# tool to use in cross-compilation environments, therefore Automake
-# will honor the 'STRIP' environment variable to overrule this program.
-dnl Don't test for $cross_compiling = yes, because it might be 'maybe'.
-if test "$cross_compiling" != no; then
- AC_CHECK_TOOL([STRIP], [strip], :)
-fi
-INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
-AC_SUBST([INSTALL_STRIP_PROGRAM])])
-
-# Copyright (C) 2006-2013 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.
-
-# _AM_SUBST_NOTMAKE(VARIABLE)
-# ---------------------------
-# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
-# This macro is traced by Automake.
-AC_DEFUN([_AM_SUBST_NOTMAKE])
-
-# AM_SUBST_NOTMAKE(VARIABLE)
-# --------------------------
-# Public sister of _AM_SUBST_NOTMAKE.
-AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
-
-# Check how to create a tarball. -*- Autoconf -*-
-
-# Copyright (C) 2004-2013 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.
-
-# _AM_PROG_TAR(FORMAT)
-# --------------------
-# Check how to create a tarball in format FORMAT.
-# FORMAT should be one of 'v7', 'ustar', or 'pax'.
-#
-# Substitute a variable $(am__tar) that is a command
-# writing to stdout a FORMAT-tarball containing the directory
-# $tardir.
-# tardir=directory && $(am__tar) > result.tar
-#
-# Substitute a variable $(am__untar) that extract such
-# a tarball read from stdin.
-# $(am__untar) < result.tar
-#
-AC_DEFUN([_AM_PROG_TAR],
-[# Always define AMTAR for backward compatibility. Yes, it's still used
-# in the wild :-( We should find a proper way to deprecate it ...
-AC_SUBST([AMTAR], ['$${TAR-tar}'])
-
-# We'll loop over all known methods to create a tar archive until one works.
-_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
-
-m4_if([$1], [v7],
- [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
-
- [m4_case([$1],
- [ustar],
- [# The POSIX 1988 'ustar' format is defined with fixed-size fields.
- # There is notably a 21 bits limit for the UID and the GID. In fact,
- # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343
- # and bug#13588).
- am_max_uid=2097151 # 2^21 - 1
- am_max_gid=$am_max_uid
- # The $UID and $GID variables are not portable, so we need to resort
- # to the POSIX-mandated id(1) utility. Errors in the 'id' calls
- # below are definitely unexpected, so allow the users to see them
- # (that is, avoid stderr redirection).
- am_uid=`id -u || echo unknown`
- am_gid=`id -g || echo unknown`
- AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format])
- if test $am_uid -le $am_max_uid; then
- AC_MSG_RESULT([yes])
- else
- AC_MSG_RESULT([no])
- _am_tools=none
- fi
- AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format])
- if test $am_gid -le $am_max_gid; then
- AC_MSG_RESULT([yes])
- else
- AC_MSG_RESULT([no])
- _am_tools=none
- fi],
-
- [pax],
- [],
-
- [m4_fatal([Unknown tar format])])
-
- AC_MSG_CHECKING([how to create a $1 tar archive])
-
- # Go ahead even if we have the value already cached. We do so because we
- # need to set the values for the 'am__tar' and 'am__untar' variables.
- _am_tools=${am_cv_prog_tar_$1-$_am_tools}
-
- for _am_tool in $_am_tools; do
- case $_am_tool in
- gnutar)
- for _am_tar in tar gnutar gtar; do
- AM_RUN_LOG([$_am_tar --version]) && break
- done
- am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
- am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
- am__untar="$_am_tar -xf -"
- ;;
- plaintar)
- # Must skip GNU tar: if it does not support --format= it doesn't create
- # ustar tarball either.
- (tar --version) >/dev/null 2>&1 && continue
- am__tar='tar chf - "$$tardir"'
- am__tar_='tar chf - "$tardir"'
- am__untar='tar xf -'
- ;;
- pax)
- am__tar='pax -L -x $1 -w "$$tardir"'
- am__tar_='pax -L -x $1 -w "$tardir"'
- am__untar='pax -r'
- ;;
- cpio)
- am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
- am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
- am__untar='cpio -i -H $1 -d'
- ;;
- none)
- am__tar=false
- am__tar_=false
- am__untar=false
- ;;
- esac
-
- # If the value was cached, stop now. We just wanted to have am__tar
- # and am__untar set.
- test -n "${am_cv_prog_tar_$1}" && break
-
- # tar/untar a dummy directory, and stop if the command works.
- rm -rf conftest.dir
- mkdir conftest.dir
- echo GrepMe > conftest.dir/file
- AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
- rm -rf conftest.dir
- if test -s conftest.tar; then
- AM_RUN_LOG([$am__untar <conftest.tar])
- AM_RUN_LOG([cat conftest.dir/file])
- grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
- fi
- done
- rm -rf conftest.dir
-
- AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
- AC_MSG_RESULT([$am_cv_prog_tar_$1])])
-
-AC_SUBST([am__tar])
-AC_SUBST([am__untar])
-]) # _AM_PROG_TAR
-
-m4_include([m4/asmcfi.m4])
-m4_include([m4/ax_append_flag.m4])
-m4_include([m4/ax_cc_maxopt.m4])
-m4_include([m4/ax_cflags_warn_all.m4])
-m4_include([m4/ax_check_compile_flag.m4])
-m4_include([m4/ax_compiler_vendor.m4])
-m4_include([m4/ax_configure_args.m4])
-m4_include([m4/ax_enable_builddir.m4])
-m4_include([m4/ax_gcc_archflag.m4])
-m4_include([m4/ax_gcc_x86_cpuid.m4])
-m4_include([m4/libtool.m4])
-m4_include([m4/ltoptions.m4])
-m4_include([m4/ltsugar.m4])
-m4_include([m4/ltversion.m4])
-m4_include([m4/lt~obsolete.m4])
-m4_include([acinclude.m4])
diff --git a/Modules/_ctypes/libffi/compile b/Modules/_ctypes/libffi/compile
deleted file mode 100755
index 531136b068..0000000000
--- a/Modules/_ctypes/libffi/compile
+++ /dev/null
@@ -1,347 +0,0 @@
-#! /bin/sh
-# Wrapper for compilers which do not understand '-c -o'.
-
-scriptversion=2012-10-14.11; # UTC
-
-# Copyright (C) 1999-2013 Free Software Foundation, Inc.
-# Written by Tom Tromey <tromey@cygnus.com>.
-#
-# 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, 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, see <http://www.gnu.org/licenses/>.
-
-# 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.
-
-# This file is maintained in Automake, please report
-# bugs to <bug-automake@gnu.org> or send patches to
-# <automake-patches@gnu.org>.
-
-nl='
-'
-
-# We need space, tab and new line, in precisely that order. Quoting is
-# there to prevent tools from complaining about whitespace usage.
-IFS=" "" $nl"
-
-file_conv=
-
-# func_file_conv build_file lazy
-# Convert a $build file to $host form and store it in $file
-# Currently only supports Windows hosts. If the determined conversion
-# type is listed in (the comma separated) LAZY, no conversion will
-# take place.
-func_file_conv ()
-{
- file=$1
- case $file in
- / | /[!/]*) # absolute file, and not a UNC file
- if test -z "$file_conv"; then
- # lazily determine how to convert abs files
- case `uname -s` in
- MINGW*)
- file_conv=mingw
- ;;
- CYGWIN*)
- file_conv=cygwin
- ;;
- *)
- file_conv=wine
- ;;
- esac
- fi
- case $file_conv/,$2, in
- *,$file_conv,*)
- ;;
- mingw/*)
- file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
- ;;
- cygwin/*)
- file=`cygpath -m "$file" || echo "$file"`
- ;;
- wine/*)
- file=`winepath -w "$file" || echo "$file"`
- ;;
- esac
- ;;
- esac
-}
-
-# func_cl_dashL linkdir
-# Make cl look for libraries in LINKDIR
-func_cl_dashL ()
-{
- func_file_conv "$1"
- if test -z "$lib_path"; then
- lib_path=$file
- else
- lib_path="$lib_path;$file"
- fi
- linker_opts="$linker_opts -LIBPATH:$file"
-}
-
-# func_cl_dashl library
-# Do a library search-path lookup for cl
-func_cl_dashl ()
-{
- lib=$1
- found=no
- save_IFS=$IFS
- IFS=';'
- for dir in $lib_path $LIB
- do
- IFS=$save_IFS
- if $shared && test -f "$dir/$lib.dll.lib"; then
- found=yes
- lib=$dir/$lib.dll.lib
- break
- fi
- if test -f "$dir/$lib.lib"; then
- found=yes
- lib=$dir/$lib.lib
- break
- fi
- if test -f "$dir/lib$lib.a"; then
- found=yes
- lib=$dir/lib$lib.a
- break
- fi
- done
- IFS=$save_IFS
-
- if test "$found" != yes; then
- lib=$lib.lib
- fi
-}
-
-# func_cl_wrapper cl arg...
-# Adjust compile command to suit cl
-func_cl_wrapper ()
-{
- # Assume a capable shell
- lib_path=
- shared=:
- linker_opts=
- for arg
- do
- if test -n "$eat"; then
- eat=
- else
- case $1 in
- -o)
- # configure might choose to run compile as 'compile cc -o foo foo.c'.
- eat=1
- case $2 in
- *.o | *.[oO][bB][jJ])
- func_file_conv "$2"
- set x "$@" -Fo"$file"
- shift
- ;;
- *)
- func_file_conv "$2"
- set x "$@" -Fe"$file"
- shift
- ;;
- esac
- ;;
- -I)
- eat=1
- func_file_conv "$2" mingw
- set x "$@" -I"$file"
- shift
- ;;
- -I*)
- func_file_conv "${1#-I}" mingw
- set x "$@" -I"$file"
- shift
- ;;
- -l)
- eat=1
- func_cl_dashl "$2"
- set x "$@" "$lib"
- shift
- ;;
- -l*)
- func_cl_dashl "${1#-l}"
- set x "$@" "$lib"
- shift
- ;;
- -L)
- eat=1
- func_cl_dashL "$2"
- ;;
- -L*)
- func_cl_dashL "${1#-L}"
- ;;
- -static)
- shared=false
- ;;
- -Wl,*)
- arg=${1#-Wl,}
- save_ifs="$IFS"; IFS=','
- for flag in $arg; do
- IFS="$save_ifs"
- linker_opts="$linker_opts $flag"
- done
- IFS="$save_ifs"
- ;;
- -Xlinker)
- eat=1
- linker_opts="$linker_opts $2"
- ;;
- -*)
- set x "$@" "$1"
- shift
- ;;
- *.cc | *.CC | *.cxx | *.CXX | *.[cC]++)
- func_file_conv "$1"
- set x "$@" -Tp"$file"
- shift
- ;;
- *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO])
- func_file_conv "$1" mingw
- set x "$@" "$file"
- shift
- ;;
- *)
- set x "$@" "$1"
- shift
- ;;
- esac
- fi
- shift
- done
- if test -n "$linker_opts"; then
- linker_opts="-link$linker_opts"
- fi
- exec "$@" $linker_opts
- exit 1
-}
-
-eat=
-
-case $1 in
- '')
- echo "$0: No command. Try '$0 --help' for more information." 1>&2
- exit 1;
- ;;
- -h | --h*)
- cat <<\EOF
-Usage: compile [--help] [--version] PROGRAM [ARGS]
-
-Wrapper for compilers which do not understand '-c -o'.
-Remove '-o dest.o' from ARGS, run PROGRAM with the remaining
-arguments, and rename the output as expected.
-
-If you are trying to build a whole package this is not the
-right script to run: please start by reading the file 'INSTALL'.
-
-Report bugs to <bug-automake@gnu.org>.
-EOF
- exit $?
- ;;
- -v | --v*)
- echo "compile $scriptversion"
- exit $?
- ;;
- cl | *[/\\]cl | cl.exe | *[/\\]cl.exe )
- func_cl_wrapper "$@" # Doesn't return...
- ;;
-esac
-
-ofile=
-cfile=
-
-for arg
-do
- if test -n "$eat"; then
- eat=
- else
- case $1 in
- -o)
- # configure might choose to run compile as 'compile cc -o foo foo.c'.
- # So we strip '-o arg' only if arg is an object.
- eat=1
- case $2 in
- *.o | *.obj)
- ofile=$2
- ;;
- *)
- set x "$@" -o "$2"
- shift
- ;;
- esac
- ;;
- *.c)
- cfile=$1
- set x "$@" "$1"
- shift
- ;;
- *)
- set x "$@" "$1"
- shift
- ;;
- esac
- fi
- shift
-done
-
-if test -z "$ofile" || test -z "$cfile"; then
- # If no '-o' option was seen then we might have been invoked from a
- # pattern rule where we don't need one. That is ok -- this is a
- # normal compilation that the losing compiler can handle. If no
- # '.c' file was seen then we are probably linking. That is also
- # ok.
- exec "$@"
-fi
-
-# Name of file we expect compiler to create.
-cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'`
-
-# Create the lock directory.
-# Note: use '[/\\:.-]' here to ensure that we don't use the same name
-# that we are using for the .o file. Also, base the name on the expected
-# object file name, since that is what matters with a parallel build.
-lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d
-while true; do
- if mkdir "$lockdir" >/dev/null 2>&1; then
- break
- fi
- sleep 1
-done
-# FIXME: race condition here if user kills between mkdir and trap.
-trap "rmdir '$lockdir'; exit 1" 1 2 15
-
-# Run the compile.
-"$@"
-ret=$?
-
-if test -f "$cofile"; then
- test "$cofile" = "$ofile" || mv "$cofile" "$ofile"
-elif test -f "${cofile}bj"; then
- test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile"
-fi
-
-rmdir "$lockdir"
-exit $ret
-
-# Local Variables:
-# mode: shell-script
-# sh-indentation: 2
-# eval: (add-hook 'write-file-hooks 'time-stamp)
-# time-stamp-start: "scriptversion="
-# time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-time-zone: "UTC"
-# time-stamp-end: "; # UTC"
-# End:
diff --git a/Modules/_ctypes/libffi/config.guess b/Modules/_ctypes/libffi/config.guess
deleted file mode 100755
index b79252d6b1..0000000000
--- a/Modules/_ctypes/libffi/config.guess
+++ /dev/null
@@ -1,1558 +0,0 @@
-#! /bin/sh
-# Attempt to guess a canonical system name.
-# Copyright 1992-2013 Free Software Foundation, Inc.
-
-timestamp='2013-06-10'
-
-# 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 3 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, see <http://www.gnu.org/licenses/>.
-#
-# 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. This Exception is an additional permission under section 7
-# of the GNU General Public License, version 3 ("GPLv3").
-#
-# Originally written by Per Bothner.
-#
-# You can get the latest version of this script from:
-# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
-#
-# Please send patches with a ChangeLog entry to config-patches@gnu.org.
-
-
-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 1992-2013 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 ;;
- --version | -v )
- echo "$version" ; exit ;;
- --help | --h* | -h )
- echo "$usage"; exit ;;
- -- ) # 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 "$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 ; set_cc_for_build= ;'
-
-# 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
-
-case "${UNAME_SYSTEM}" in
-Linux|GNU|GNU/*)
- # If the system lacks a compiler, then just pick glibc.
- # We could probably try harder.
- LIBC=gnu
-
- eval $set_cc_for_build
- cat <<-EOF > $dummy.c
- #include <features.h>
- #if defined(__UCLIBC__)
- LIBC=uclibc
- #elif defined(__dietlibc__)
- LIBC=dietlibc
- #else
- LIBC=gnu
- #endif
- EOF
- eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
- ;;
-esac
-
-# 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 tuples: *-*-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 ;;
- sh5el) machine=sh5le-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 -q __ELF__
- 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 ;;
- *:Bitrig:*:*)
- UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
- echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE}
- exit ;;
- *:OpenBSD:*:*)
- UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
- echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
- exit ;;
- *:ekkoBSD:*:*)
- echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
- exit ;;
- *:SolidBSD:*:*)
- echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
- exit ;;
- macppc:MirBSD:*:*)
- echo powerpc-unknown-mirbsd${UNAME_RELEASE}
- exit ;;
- *:MirBSD:*:*)
- echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
- exit ;;
- alpha:OSF1:*:*)
- case $UNAME_RELEASE in
- *4.0)
- UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
- ;;
- *5.*)
- UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
- ;;
- esac
- # 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 Pn.n version is a patched version.
- # 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/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
- # Reset EXIT trap before exiting to avoid spurious non-zero exit code.
- exitcode=$?
- trap '' 0
- exit $exitcode ;;
- 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 ;;
- 21064:Windows_NT:50:3)
- echo alpha-dec-winnt3.5
- exit ;;
- Amiga*:UNIX_System_V:4.0:*)
- echo m68k-unknown-sysv4
- exit ;;
- *:[Aa]miga[Oo][Ss]:*:*)
- echo ${UNAME_MACHINE}-unknown-amigaos
- exit ;;
- *:[Mm]orph[Oo][Ss]:*:*)
- echo ${UNAME_MACHINE}-unknown-morphos
- exit ;;
- *:OS/390:*:*)
- echo i370-ibm-openedition
- exit ;;
- *:z/VM:*:*)
- echo s390-ibm-zvmoe
- exit ;;
- *:OS400:*:*)
- echo powerpc-ibm-os400
- exit ;;
- arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
- echo arm-acorn-riscix${UNAME_RELEASE}
- exit ;;
- arm*:riscos:*:*|arm*:RISCOS:*:*)
- echo arm-unknown-riscos
- exit ;;
- SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
- echo hppa1.1-hitachi-hiuxmpp
- exit ;;
- 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 ;;
- NILE*:*:*:dcosx)
- echo pyramid-pyramid-svr4
- exit ;;
- DRS?6000:unix:4.0:6*)
- echo sparc-icl-nx6
- exit ;;
- DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
- case `/usr/bin/uname -p` in
- sparc) echo sparc-icl-nx7; exit ;;
- esac ;;
- s390x:SunOS:*:*)
- echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit ;;
- sun4H:SunOS:5.*:*)
- echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit ;;
- sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
- echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit ;;
- i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
- echo i386-pc-auroraux${UNAME_RELEASE}
- exit ;;
- i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
- eval $set_cc_for_build
- SUN_ARCH="i386"
- # If there is a compiler, see if it is configured for 64-bit objects.
- # Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
- # This test works for both compilers.
- if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
- if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
- (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
- grep IS_64BIT_ARCH >/dev/null
- then
- SUN_ARCH="x86_64"
- fi
- fi
- echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit ;;
- 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 ;;
- 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 ;;
- sun3*:SunOS:*:*)
- echo m68k-sun-sunos${UNAME_RELEASE}
- exit ;;
- 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 ;;
- aushp:SunOS:*:*)
- echo sparc-auspex-sunos${UNAME_RELEASE}
- exit ;;
- # 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 ;;
- atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
- echo m68k-atari-mint${UNAME_RELEASE}
- exit ;;
- *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
- echo m68k-atari-mint${UNAME_RELEASE}
- exit ;;
- milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
- echo m68k-milan-mint${UNAME_RELEASE}
- exit ;;
- hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
- echo m68k-hades-mint${UNAME_RELEASE}
- exit ;;
- *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
- echo m68k-unknown-mint${UNAME_RELEASE}
- exit ;;
- m68k:machten:*:*)
- echo m68k-apple-machten${UNAME_RELEASE}
- exit ;;
- powerpc:machten:*:*)
- echo powerpc-apple-machten${UNAME_RELEASE}
- exit ;;
- RISC*:Mach:*:*)
- echo mips-dec-mach_bsd4.3
- exit ;;
- RISC*:ULTRIX:*:*)
- echo mips-dec-ultrix${UNAME_RELEASE}
- exit ;;
- VAX*:ULTRIX*:*:*)
- echo vax-dec-ultrix${UNAME_RELEASE}
- exit ;;
- 2020:CLIX:*:* | 2430:CLIX:*:*)
- echo clipper-intergraph-clix${UNAME_RELEASE}
- exit ;;
- 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 &&
- dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
- SYSTEM_NAME=`$dummy $dummyarg` &&
- { echo "$SYSTEM_NAME"; exit; }
- echo mips-mips-riscos${UNAME_RELEASE}
- exit ;;
- Motorola:PowerMAX_OS:*:*)
- echo powerpc-motorola-powermax
- exit ;;
- Motorola:*:4.3:PL8-*)
- echo powerpc-harris-powermax
- exit ;;
- Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
- echo powerpc-harris-powermax
- exit ;;
- Night_Hawk:Power_UNIX:*:*)
- echo powerpc-harris-powerunix
- exit ;;
- m88k:CX/UX:7*:*)
- echo m88k-harris-cxux7
- exit ;;
- m88k:*:4*:R4*)
- echo m88k-motorola-sysv4
- exit ;;
- m88k:*:3*:R3*)
- echo m88k-motorola-sysv3
- exit ;;
- 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 ;;
- M88*:DolphinOS:*:*) # DolphinOS (SVR3)
- echo m88k-dolphin-sysv3
- exit ;;
- M88*:*:R3*:*)
- # Delta 88k system running SVR3
- echo m88k-motorola-sysv3
- exit ;;
- XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
- echo m88k-tektronix-sysv3
- exit ;;
- Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
- echo m68k-tektronix-bsd
- exit ;;
- *:IRIX*:*:*)
- echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
- exit ;;
- ????????: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 ;; # Note that: echo "'`uname -s`'" gives 'AIX '
- i*86:AIX:*:*)
- echo i386-ibm-aix
- exit ;;
- 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 ;;
- *: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
- if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
- then
- echo "$SYSTEM_NAME"
- else
- echo rs6000-ibm-aix3.2.5
- fi
- 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 ;;
- *:AIX:*:[4567])
- 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 ;;
- *:AIX:*:*)
- echo rs6000-ibm-aix
- exit ;;
- ibmrt:4.4BSD:*|romp-ibm:BSD:*)
- echo romp-ibm-bsd4.4
- exit ;;
- ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and
- echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to
- exit ;; # report: romp-ibm BSD 4.3
- *:BOSX:*:*)
- echo rs6000-bull-bosx
- exit ;;
- DPX/2?00:B.O.S.:*:*)
- echo m68k-bull-sysv3
- exit ;;
- 9000/[34]??:4.3bsd:1.*:*)
- echo m68k-hp-bsd
- exit ;;
- hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
- echo m68k-hp-bsd4.4
- exit ;;
- 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
- eval $set_cc_for_build
-
- # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
- # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler
- # generating 64-bit code. GNU and HP use different nomenclature:
- #
- # $ CC_FOR_BUILD=cc ./config.guess
- # => hppa2.0w-hp-hpux11.23
- # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
- # => hppa64-hp-hpux11.23
-
- if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
- grep -q __LP64__
- then
- HP_ARCH="hppa2.0w"
- else
- HP_ARCH="hppa64"
- fi
- fi
- echo ${HP_ARCH}-hp-hpux${HPUX_REV}
- exit ;;
- ia64:HP-UX:*:*)
- HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
- echo ia64-hp-hpux${HPUX_REV}
- exit ;;
- 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 && SYSTEM_NAME=`$dummy` &&
- { echo "$SYSTEM_NAME"; exit; }
- echo unknown-hitachi-hiuxwe2
- exit ;;
- 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
- echo hppa1.1-hp-bsd
- exit ;;
- 9000/8??:4.3bsd:*:*)
- echo hppa1.0-hp-bsd
- exit ;;
- *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
- echo hppa1.0-hp-mpeix
- exit ;;
- hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
- echo hppa1.1-hp-osf
- exit ;;
- hp8??:OSF1:*:*)
- echo hppa1.0-hp-osf
- exit ;;
- i*86:OSF1:*:*)
- if [ -x /usr/sbin/sysversion ] ; then
- echo ${UNAME_MACHINE}-unknown-osf1mk
- else
- echo ${UNAME_MACHINE}-unknown-osf1
- fi
- exit ;;
- parisc*:Lites*:*:*)
- echo hppa1.1-hp-lites
- exit ;;
- C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
- echo c1-convex-bsd
- exit ;;
- C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
- if getsysinfo -f scalar_acc
- then echo c32-convex-bsd
- else echo c2-convex-bsd
- fi
- exit ;;
- C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
- echo c34-convex-bsd
- exit ;;
- C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
- echo c38-convex-bsd
- exit ;;
- C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
- echo c4-convex-bsd
- exit ;;
- CRAY*Y-MP:*:*:*)
- echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit ;;
- 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 ;;
- CRAY*TS:*:*:*)
- echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit ;;
- CRAY*T3E:*:*:*)
- echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit ;;
- CRAY*SV1:*:*:*)
- echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit ;;
- *:UNICOS/mp:*:*)
- echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit ;;
- 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 ;;
- 5000:UNIX_System_V:4.*:*)
- FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
- FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
- echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
- exit ;;
- i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
- echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
- exit ;;
- sparc*:BSD/OS:*:*)
- echo sparc-unknown-bsdi${UNAME_RELEASE}
- exit ;;
- *:BSD/OS:*:*)
- echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
- exit ;;
- *:FreeBSD:*:*)
- UNAME_PROCESSOR=`/usr/bin/uname -p`
- case ${UNAME_PROCESSOR} in
- amd64)
- echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
- *)
- echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
- esac
- exit ;;
- i*:CYGWIN*:*)
- echo ${UNAME_MACHINE}-pc-cygwin
- exit ;;
- *:MINGW64*:*)
- echo ${UNAME_MACHINE}-pc-mingw64
- exit ;;
- *:MINGW*:*)
- echo ${UNAME_MACHINE}-pc-mingw32
- exit ;;
- i*:MSYS*:*)
- echo ${UNAME_MACHINE}-pc-msys
- exit ;;
- i*:windows32*:*)
- # uname -m includes "-pc" on this system.
- echo ${UNAME_MACHINE}-mingw32
- exit ;;
- i*:PW*:*)
- echo ${UNAME_MACHINE}-pc-pw32
- exit ;;
- *:Interix*:*)
- case ${UNAME_MACHINE} in
- x86)
- echo i586-pc-interix${UNAME_RELEASE}
- exit ;;
- authenticamd | genuineintel | EM64T)
- echo x86_64-unknown-interix${UNAME_RELEASE}
- exit ;;
- IA64)
- echo ia64-unknown-interix${UNAME_RELEASE}
- exit ;;
- esac ;;
- [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
- echo i${UNAME_MACHINE}-pc-mks
- exit ;;
- 8664:Windows_NT:*)
- echo x86_64-pc-mks
- exit ;;
- 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 ;;
- i*:UWIN*:*)
- echo ${UNAME_MACHINE}-pc-uwin
- exit ;;
- amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
- echo x86_64-unknown-cygwin
- exit ;;
- p*:CYGWIN*:*)
- echo powerpcle-unknown-cygwin
- exit ;;
- prep*:SunOS:5.*:*)
- echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit ;;
- *:GNU:*:*)
- # the GNU system
- echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
- exit ;;
- *:GNU/*:*:*)
- # other systems with GNU libc and userland
- echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC}
- exit ;;
- i*86:Minix:*:*)
- echo ${UNAME_MACHINE}-pc-minix
- exit ;;
- aarch64:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
- aarch64_be:Linux:*:*)
- UNAME_MACHINE=aarch64_be
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
- 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 -q ld.so.1
- if test "$?" = 0 ; then LIBC="gnulibc1" ; fi
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
- arc:Linux:*:* | arceb:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
- arm*:Linux:*:*)
- eval $set_cc_for_build
- if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
- | grep -q __ARM_EABI__
- then
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- else
- if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
- | grep -q __ARM_PCS_VFP
- then
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi
- else
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf
- fi
- fi
- exit ;;
- avr32*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
- cris:Linux:*:*)
- echo ${UNAME_MACHINE}-axis-linux-${LIBC}
- exit ;;
- crisv32:Linux:*:*)
- echo ${UNAME_MACHINE}-axis-linux-${LIBC}
- exit ;;
- frv:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
- hexagon:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
- i*86:Linux:*:*)
- echo ${UNAME_MACHINE}-pc-linux-${LIBC}
- exit ;;
- ia64:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
- m32r*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
- m68*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
- mips:Linux:*:* | mips64:Linux:*:*)
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
- #undef CPU
- #undef ${UNAME_MACHINE}
- #undef ${UNAME_MACHINE}el
- #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
- CPU=${UNAME_MACHINE}el
- #else
- #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
- CPU=${UNAME_MACHINE}
- #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-${LIBC}"; exit; }
- ;;
- or1k:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
- or32:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
- padre:Linux:*:*)
- echo sparc-unknown-linux-${LIBC}
- exit ;;
- parisc64:Linux:*:* | hppa64:Linux:*:*)
- echo hppa64-unknown-linux-${LIBC}
- exit ;;
- 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-${LIBC} ;;
- PA8*) echo hppa2.0-unknown-linux-${LIBC} ;;
- *) echo hppa-unknown-linux-${LIBC} ;;
- esac
- exit ;;
- ppc64:Linux:*:*)
- echo powerpc64-unknown-linux-${LIBC}
- exit ;;
- ppc:Linux:*:*)
- echo powerpc-unknown-linux-${LIBC}
- exit ;;
- ppc64le:Linux:*:*)
- echo powerpc64le-unknown-linux-${LIBC}
- exit ;;
- ppcle:Linux:*:*)
- echo powerpcle-unknown-linux-${LIBC}
- exit ;;
- s390:Linux:*:* | s390x:Linux:*:*)
- echo ${UNAME_MACHINE}-ibm-linux-${LIBC}
- exit ;;
- sh64*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
- sh*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
- sparc:Linux:*:* | sparc64:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
- tile*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
- vax:Linux:*:*)
- echo ${UNAME_MACHINE}-dec-linux-${LIBC}
- exit ;;
- x86_64:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
- xtensa*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
- 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 ;;
- 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 ;;
- 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 ;;
- i*86:XTS-300:*:STOP)
- echo ${UNAME_MACHINE}-unknown-stop
- exit ;;
- i*86:atheos:*:*)
- echo ${UNAME_MACHINE}-unknown-atheos
- exit ;;
- i*86:syllable:*:*)
- echo ${UNAME_MACHINE}-pc-syllable
- exit ;;
- i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
- echo i386-unknown-lynxos${UNAME_RELEASE}
- exit ;;
- i*86:*DOS:*:*)
- echo ${UNAME_MACHINE}-pc-msdosdjgpp
- exit ;;
- 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 ;;
- i*86:*:5:[678]*)
- # UnixWare 7.x, OpenUNIX and OpenServer 6.
- 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 ;;
- 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 ;;
- 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 i586.
- # Note: whatever this is, it MUST be the same as what config.sub
- # prints for the "djgpp" host, or else GDB configury will decide that
- # this is a cross-build.
- echo i586-pc-msdosdjgpp
- exit ;;
- Intel:Mach:3*:*)
- echo i386-pc-mach3
- exit ;;
- paragon:*:*:*)
- echo i860-intel-osf1
- exit ;;
- 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 ;;
- mini*:CTIX:SYS*5:*)
- # "miniframe"
- echo m68010-convergent-sysv
- exit ;;
- mc68k:UNIX:SYSTEM5:3.51m)
- echo m68k-convergent-sysv
- exit ;;
- M680?0:D-NIX:5.3:*)
- echo m68k-diab-dnix
- exit ;;
- M68*:*:R3V[5678]*:*)
- test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
- 3[345]??:*: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 | S7501*:*: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; }
- /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
- && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
- 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
- /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
- && { echo i486-ncr-sysv4; exit; } ;;
- NCR*:*:4.2:* | MPRAS*:*:4.2:*)
- OS_REL='.3'
- 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; }
- /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
- && { echo i586-ncr-sysv4.3${OS_REL}; exit; }
- /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
- && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
- m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
- echo m68k-unknown-lynxos${UNAME_RELEASE}
- exit ;;
- mc68030:UNIX_System_V:4.*:*)
- echo m68k-atari-sysv4
- exit ;;
- TSUNAMI:LynxOS:2.*:*)
- echo sparc-unknown-lynxos${UNAME_RELEASE}
- exit ;;
- rs6000:LynxOS:2.*:*)
- echo rs6000-unknown-lynxos${UNAME_RELEASE}
- exit ;;
- PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
- echo powerpc-unknown-lynxos${UNAME_RELEASE}
- exit ;;
- SM[BE]S:UNIX_SV:*:*)
- echo mips-dde-sysv${UNAME_RELEASE}
- exit ;;
- RM*:ReliantUNIX-*:*:*)
- echo mips-sni-sysv4
- exit ;;
- RM*:SINIX-*:*:*)
- echo mips-sni-sysv4
- exit ;;
- *: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 ;;
- PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
- # says <Richard.M.Bartel@ccMail.Census.GOV>
- echo i586-unisys-sysv4
- exit ;;
- *:UNIX_System_V:4*:FTX*)
- # From Gerald Hewes <hewes@openmarket.com>.
- # How about differentiating between stratus architectures? -djm
- echo hppa1.1-stratus-sysv4
- exit ;;
- *:*:*:FTX*)
- # From seanf@swdc.stratus.com.
- echo i860-stratus-sysv4
- exit ;;
- i*86:VOS:*:*)
- # From Paul.Green@stratus.com.
- echo ${UNAME_MACHINE}-stratus-vos
- exit ;;
- *:VOS:*:*)
- # From Paul.Green@stratus.com.
- echo hppa1.1-stratus-vos
- exit ;;
- mc68*:A/UX:*:*)
- echo m68k-apple-aux${UNAME_RELEASE}
- exit ;;
- news*:NEWS-OS:6*:*)
- echo mips-sony-newsos6
- exit ;;
- 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 ;;
- BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
- echo powerpc-be-beos
- exit ;;
- BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only.
- echo powerpc-apple-beos
- exit ;;
- BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
- echo i586-pc-beos
- exit ;;
- BePC:Haiku:*:*) # Haiku running on Intel PC compatible.
- echo i586-pc-haiku
- exit ;;
- x86_64:Haiku:*:*)
- echo x86_64-unknown-haiku
- exit ;;
- SX-4:SUPER-UX:*:*)
- echo sx4-nec-superux${UNAME_RELEASE}
- exit ;;
- SX-5:SUPER-UX:*:*)
- echo sx5-nec-superux${UNAME_RELEASE}
- exit ;;
- SX-6:SUPER-UX:*:*)
- echo sx6-nec-superux${UNAME_RELEASE}
- exit ;;
- SX-7:SUPER-UX:*:*)
- echo sx7-nec-superux${UNAME_RELEASE}
- exit ;;
- SX-8:SUPER-UX:*:*)
- echo sx8-nec-superux${UNAME_RELEASE}
- exit ;;
- SX-8R:SUPER-UX:*:*)
- echo sx8r-nec-superux${UNAME_RELEASE}
- exit ;;
- Power*:Rhapsody:*:*)
- echo powerpc-apple-rhapsody${UNAME_RELEASE}
- exit ;;
- *:Rhapsody:*:*)
- echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
- exit ;;
- *:Darwin:*:*)
- UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
- eval $set_cc_for_build
- if test "$UNAME_PROCESSOR" = unknown ; then
- UNAME_PROCESSOR=powerpc
- fi
- if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
- if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
- (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
- grep IS_64BIT_ARCH >/dev/null
- then
- case $UNAME_PROCESSOR in
- i386) UNAME_PROCESSOR=x86_64 ;;
- powerpc) UNAME_PROCESSOR=powerpc64 ;;
- esac
- fi
- fi
- echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
- exit ;;
- *: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 ;;
- *:QNX:*:4*)
- echo i386-pc-qnx
- exit ;;
- NEO-?:NONSTOP_KERNEL:*:*)
- echo neo-tandem-nsk${UNAME_RELEASE}
- exit ;;
- NSE-*:NONSTOP_KERNEL:*:*)
- echo nse-tandem-nsk${UNAME_RELEASE}
- exit ;;
- NSR-?:NONSTOP_KERNEL:*:*)
- echo nsr-tandem-nsk${UNAME_RELEASE}
- exit ;;
- *:NonStop-UX:*:*)
- echo mips-compaq-nonstopux
- exit ;;
- BS2000:POSIX*:*:*)
- echo bs2000-siemens-sysv
- exit ;;
- DS/*:UNIX_System_V:*:*)
- echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
- exit ;;
- *: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 ;;
- *:TOPS-10:*:*)
- echo pdp10-unknown-tops10
- exit ;;
- *:TENEX:*:*)
- echo pdp10-unknown-tenex
- exit ;;
- KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
- echo pdp10-dec-tops20
- exit ;;
- XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
- echo pdp10-xkl-tops20
- exit ;;
- *:TOPS-20:*:*)
- echo pdp10-unknown-tops20
- exit ;;
- *:ITS:*:*)
- echo pdp10-unknown-its
- exit ;;
- SEI:*:*:SEIUX)
- echo mips-sei-seiux${UNAME_RELEASE}
- exit ;;
- *:DragonFly:*:*)
- echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
- exit ;;
- *:*VMS:*:*)
- UNAME_MACHINE=`(uname -p) 2>/dev/null`
- case "${UNAME_MACHINE}" in
- A*) echo alpha-dec-vms ; exit ;;
- I*) echo ia64-dec-vms ; exit ;;
- V*) echo vax-dec-vms ; exit ;;
- esac ;;
- *:XENIX:*:SysV)
- echo i386-pc-xenix
- exit ;;
- i*86:skyos:*:*)
- echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
- exit ;;
- i*86:rdos:*:*)
- echo ${UNAME_MACHINE}-pc-rdos
- exit ;;
- i*86:AROS:*:*)
- echo ${UNAME_MACHINE}-pc-aros
- exit ;;
- x86_64:VMkernel:*:*)
- echo ${UNAME_MACHINE}-unknown-esx
- exit ;;
-esac
-
-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\n"); 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 && SYSTEM_NAME=`$dummy` &&
- { echo "$SYSTEM_NAME"; exit; }
-
-# Apollos put the system type in the environment.
-
-test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
-
-# 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 ;;
- c2*)
- if getsysinfo -f scalar_acc
- then echo c32-convex-bsd
- else echo c2-convex-bsd
- fi
- exit ;;
- c34*)
- echo c34-convex-bsd
- exit ;;
- c38*)
- echo c38-convex-bsd
- exit ;;
- c4*)
- echo c4-convex-bsd
- exit ;;
- 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
-
- http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
-and
- http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
-
-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/Modules/_ctypes/libffi/config.sub b/Modules/_ctypes/libffi/config.sub
deleted file mode 100755
index c765b34b7b..0000000000
--- a/Modules/_ctypes/libffi/config.sub
+++ /dev/null
@@ -1,1788 +0,0 @@
-#! /bin/sh
-# Configuration validation subroutine script.
-# Copyright 1992-2013 Free Software Foundation, Inc.
-
-timestamp='2013-04-24'
-
-# 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 3 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, see <http://www.gnu.org/licenses/>.
-#
-# 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. This Exception is an additional permission under section 7
-# of the GNU General Public License, version 3 ("GPLv3").
-
-
-# Please send patches with a ChangeLog entry to config-patches@gnu.org.
-#
-# 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.
-
-# You can get the latest version of this script from:
-# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
-
-# 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 1992-2013 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 ;;
- --version | -v )
- echo "$version" ; exit ;;
- --help | --h* | -h )
- echo "$usage"; exit ;;
- -- ) # 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 ;;
-
- * )
- 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* | linux-android* | linux-dietlibc | linux-newlib* | \
- linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
- knetbsd*-gnu* | netbsd*-gnu* | \
- kopensolaris*-gnu* | \
- storm-chaos* | os2-emx* | rtmk-nova*)
- os=-$maybe_os
- basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
- ;;
- android-linux)
- os=-linux-android
- basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown
- ;;
- *)
- 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 | -knuth | -cray | -microblaze*)
- os=
- basic_machine=$1
- ;;
- -bluegene*)
- os=-cnk
- ;;
- -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
- ;;
- -sco6)
- os=-sco5v6
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -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/'`
- ;;
- -sco5v6*)
- # 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*178)
- os=-lynxos178
- ;;
- -lynx*5)
- os=-lynxos5
- ;;
- -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 \
- | aarch64 | aarch64_be \
- | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
- | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
- | am33_2.0 \
- | arc | arceb \
- | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \
- | avr | avr32 \
- | be32 | be64 \
- | bfin \
- | c4x | clipper \
- | d10v | d30v | dlx | dsp16xx \
- | epiphany \
- | fido | fr30 | frv \
- | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
- | hexagon \
- | i370 | i860 | i960 | ia64 \
- | ip2k | iq2000 \
- | le32 | le64 \
- | lm32 \
- | m32c | m32r | m32rle | m68000 | m68k | m88k \
- | maxq | mb | microblaze | microblazeel | mcore | mep | metag \
- | mips | mipsbe | mipseb | mipsel | mipsle \
- | mips16 \
- | mips64 | mips64el \
- | mips64octeon | mips64octeonel \
- | mips64orion | mips64orionel \
- | mips64r5900 | mips64r5900el \
- | mips64vr | mips64vrel \
- | mips64vr4100 | mips64vr4100el \
- | mips64vr4300 | mips64vr4300el \
- | mips64vr5000 | mips64vr5000el \
- | mips64vr5900 | mips64vr5900el \
- | mipsisa32 | mipsisa32el \
- | mipsisa32r2 | mipsisa32r2el \
- | mipsisa64 | mipsisa64el \
- | mipsisa64r2 | mipsisa64r2el \
- | mipsisa64sb1 | mipsisa64sb1el \
- | mipsisa64sr71k | mipsisa64sr71kel \
- | mipsr5900 | mipsr5900el \
- | mipstx39 | mipstx39el \
- | mn10200 | mn10300 \
- | moxie \
- | mt \
- | msp430 \
- | nds32 | nds32le | nds32be \
- | nios | nios2 | nios2eb | nios2el \
- | ns16k | ns32k \
- | open8 \
- | or1k | or32 \
- | pdp10 | pdp11 | pj | pjl \
- | powerpc | powerpc64 | powerpc64le | powerpcle \
- | pyramid \
- | rl78 | rx \
- | score \
- | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
- | sh64 | sh64le \
- | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
- | sparcv8 | sparcv9 | sparcv9b | sparcv9v \
- | spu \
- | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
- | ubicom32 \
- | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
- | we32k \
- | x86 | xc16x | xstormy16 | xtensa \
- | z8k | z80)
- basic_machine=$basic_machine-unknown
- ;;
- c54x)
- basic_machine=tic54x-unknown
- ;;
- c55x)
- basic_machine=tic55x-unknown
- ;;
- c6x)
- basic_machine=tic6x-unknown
- ;;
- m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip)
- basic_machine=$basic_machine-unknown
- os=-none
- ;;
- m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
- ;;
- ms1)
- basic_machine=mt-unknown
- ;;
-
- strongarm | thumb | xscale)
- basic_machine=arm-unknown
- ;;
- xgate)
- basic_machine=$basic_machine-unknown
- os=-none
- ;;
- xscaleeb)
- basic_machine=armeb-unknown
- ;;
-
- xscaleel)
- basic_machine=armel-unknown
- ;;
-
- # 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-* \
- | aarch64-* | aarch64_be-* \
- | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
- | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
- | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \
- | arm-* | armbe-* | armle-* | armeb-* | armv*-* \
- | avr-* | avr32-* \
- | be32-* | be64-* \
- | bfin-* | bs2000-* \
- | c[123]* | c30-* | [cjt]90-* | c4x-* \
- | clipper-* | craynv-* | cydra-* \
- | d10v-* | d30v-* | dlx-* \
- | elxsi-* \
- | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
- | h8300-* | h8500-* \
- | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
- | hexagon-* \
- | i*86-* | i860-* | i960-* | ia64-* \
- | ip2k-* | iq2000-* \
- | le32-* | le64-* \
- | lm32-* \
- | m32c-* | m32r-* | m32rle-* \
- | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
- | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
- | microblaze-* | microblazeel-* \
- | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
- | mips16-* \
- | mips64-* | mips64el-* \
- | mips64octeon-* | mips64octeonel-* \
- | mips64orion-* | mips64orionel-* \
- | mips64r5900-* | mips64r5900el-* \
- | mips64vr-* | mips64vrel-* \
- | mips64vr4100-* | mips64vr4100el-* \
- | mips64vr4300-* | mips64vr4300el-* \
- | mips64vr5000-* | mips64vr5000el-* \
- | mips64vr5900-* | mips64vr5900el-* \
- | mipsisa32-* | mipsisa32el-* \
- | mipsisa32r2-* | mipsisa32r2el-* \
- | mipsisa64-* | mipsisa64el-* \
- | mipsisa64r2-* | mipsisa64r2el-* \
- | mipsisa64sb1-* | mipsisa64sb1el-* \
- | mipsisa64sr71k-* | mipsisa64sr71kel-* \
- | mipsr5900-* | mipsr5900el-* \
- | mipstx39-* | mipstx39el-* \
- | mmix-* \
- | mt-* \
- | msp430-* \
- | nds32-* | nds32le-* | nds32be-* \
- | nios-* | nios2-* | nios2eb-* | nios2el-* \
- | none-* | np1-* | ns16k-* | ns32k-* \
- | open8-* \
- | orion-* \
- | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
- | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
- | pyramid-* \
- | rl78-* | romp-* | rs6000-* | rx-* \
- | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
- | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
- | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
- | sparclite-* \
- | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \
- | tahoe-* \
- | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
- | tile*-* \
- | tron-* \
- | ubicom32-* \
- | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
- | vax-* \
- | we32k-* \
- | x86-* | x86_64-* | xc16x-* | xps100-* \
- | xstormy16-* | xtensa*-* \
- | ymp-* \
- | z8k-* | z80-*)
- ;;
- # Recognize the basic CPU types without company name, with glob match.
- xtensa*)
- basic_machine=$basic_machine-unknown
- ;;
- # 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
- ;;
- abacus)
- basic_machine=abacus-unknown
- ;;
- 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
- ;;
- amd64-*)
- basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- 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
- ;;
- aros)
- basic_machine=i386-pc
- os=-aros
- ;;
- aux)
- basic_machine=m68k-apple
- os=-aux
- ;;
- balance)
- basic_machine=ns32k-sequent
- os=-dynix
- ;;
- blackfin)
- basic_machine=bfin-unknown
- os=-linux
- ;;
- blackfin-*)
- basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
- os=-linux
- ;;
- bluegene*)
- basic_machine=powerpc-ibm
- os=-cnk
- ;;
- c54x-*)
- basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- c55x-*)
- basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- c6x-*)
- basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- c90)
- basic_machine=c90-cray
- os=-unicos
- ;;
- cegcc)
- basic_machine=arm-unknown
- os=-cegcc
- ;;
- 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
- ;;
- craynv)
- basic_machine=craynv-cray
- os=-unicosmp
- ;;
- cr16 | cr16-*)
- basic_machine=cr16-unknown
- os=-elf
- ;;
- crds | unos)
- basic_machine=m68k-crds
- ;;
- crisv32 | crisv32-* | etraxfs*)
- basic_machine=crisv32-axis
- ;;
- cris | cris-* | etrax*)
- basic_machine=cris-axis
- ;;
- crx)
- basic_machine=crx-unknown
- os=-elf
- ;;
- 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
- ;;
- dicos)
- basic_machine=i686-pc
- os=-dicos
- ;;
- djgpp)
- basic_machine=i586-pc
- os=-msdosdjgpp
- ;;
- 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*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
- ;;
- m68knommu)
- basic_machine=m68k-unknown
- os=-linux
- ;;
- m68knommu-*)
- basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
- os=-linux
- ;;
- m88k-omron*)
- basic_machine=m88k-omron
- ;;
- magnum | m3230)
- basic_machine=mips-mips
- os=-sysv
- ;;
- merlin)
- basic_machine=ns32k-utek
- os=-sysv
- ;;
- microblaze*)
- basic_machine=microblaze-xilinx
- ;;
- mingw64)
- basic_machine=x86_64-pc
- os=-mingw64
- ;;
- mingw32)
- basic_machine=i386-pc
- os=-mingw32
- ;;
- mingw32ce)
- basic_machine=arm-unknown
- os=-mingw32ce
- ;;
- 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
- ;;
- monitor)
- basic_machine=m68k-rom68k
- os=-coff
- ;;
- morphos)
- basic_machine=powerpc-unknown
- os=-morphos
- ;;
- msdos)
- basic_machine=i386-pc
- os=-msdos
- ;;
- ms1-*)
- basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
- ;;
- msys)
- basic_machine=i386-pc
- os=-msys
- ;;
- mvs)
- basic_machine=i370-ibm
- os=-mvs
- ;;
- nacl)
- basic_machine=le32-unknown
- os=-nacl
- ;;
- 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
- ;;
- neo-tandem)
- basic_machine=neo-tandem
- ;;
- nse-tandem)
- basic_machine=nse-tandem
- ;;
- nsr-tandem)
- basic_machine=nsr-tandem
- ;;
- op50n-* | op60c-*)
- basic_machine=hppa1.1-oki
- os=-proelf
- ;;
- openrisc | openrisc-*)
- basic_machine=or32-unknown
- ;;
- os400)
- basic_machine=powerpc-ibm
- os=-os400
- ;;
- 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
- ;;
- parisc)
- basic_machine=hppa-unknown
- os=-linux
- ;;
- parisc-*)
- basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
- os=-linux
- ;;
- pbd)
- basic_machine=sparc-tti
- ;;
- pbb)
- basic_machine=m68k-tti
- ;;
- pc532 | pc532-*)
- basic_machine=ns32k-pc532
- ;;
- pc98)
- basic_machine=i386-pc
- ;;
- pc98-*)
- basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- 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 | ppcbe) basic_machine=powerpc-unknown
- ;;
- ppc-* | ppcbe-*)
- 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-* | ppc64p7-*) 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
- ;;
- rdos | rdos64)
- basic_machine=x86_64-pc
- os=-rdos
- ;;
- rdos32)
- basic_machine=i386-pc
- os=-rdos
- ;;
- 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
- ;;
- sde)
- basic_machine=mipsisa32-sde
- os=-elf
- ;;
- sei)
- basic_machine=mips-sei
- os=-seiux
- ;;
- sequent)
- basic_machine=i386-sequent
- ;;
- sh)
- basic_machine=sh-hitachi
- os=-hms
- ;;
- sh5el)
- basic_machine=sh5le-unknown
- ;;
- 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
- ;;
- strongarm-* | thumb-*)
- basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- 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
- ;;
- tile*)
- basic_machine=$basic_machine-unknown
- os=-linux-gnu
- ;;
- tx39)
- basic_machine=mipstx39-unknown
- ;;
- tx39el)
- basic_machine=mipstx39el-unknown
- ;;
- toad1)
- basic_machine=pdp10-xkl
- os=-tops20
- ;;
- tower | tower-32)
- basic_machine=m68k-ncr
- ;;
- tpf)
- basic_machine=s390x-ibm
- os=-tpf
- ;;
- 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
- ;;
- xbox)
- basic_machine=i686-pc
- os=-mingw32
- ;;
- xps | xps100)
- basic_machine=xps100-honeywell
- ;;
- xscale-* | xscalee[bl]-*)
- basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'`
- ;;
- ymp)
- basic_machine=ymp-cray
- os=-unicos
- ;;
- z8k-*-coff)
- basic_machine=z8k-unknown
- os=-sim
- ;;
- z80-*-coff)
- basic_machine=z80-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
- ;;
- mmix)
- basic_machine=mmix-knuth
- ;;
- 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
- ;;
- sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
- basic_machine=sh-unknown
- ;;
- sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
- 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.
- -auroraux)
- os=-auroraux
- ;;
- -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* | -cnk* | -sunos | -sunos[34]*\
- | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
- | -sym* | -kopensolaris* | -plan9* \
- | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
- | -aos* | -aros* \
- | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
- | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
- | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
- | -bitrig* | -openbsd* | -solidbsd* \
- | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
- | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
- | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
- | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
- | -chorusos* | -chorusrdb* | -cegcc* \
- | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
- | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
- | -linux-newlib* | -linux-musl* | -linux-uclibc* \
- | -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* | -dragonfly* \
- | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*)
- # 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* | -haiku* \
- | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
- ;;
- -mac*)
- os=`echo $os | sed -e 's|mac|macos|'`
- ;;
- -linux-dietlibc)
- os=-linux-dietlibc
- ;;
- -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
- ;;
- -os400*)
- os=-os400
- ;;
- -wince*)
- os=-wince
- ;;
- -osfrose*)
- os=-osfrose
- ;;
- -osf*)
- os=-osf
- ;;
- -utek*)
- os=-bsd
- ;;
- -dynix*)
- os=-bsd
- ;;
- -acis*)
- os=-aos
- ;;
- -atheos*)
- os=-atheos
- ;;
- -syllable*)
- os=-syllable
- ;;
- -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
- ;;
- -tpf*)
- os=-tpf
- ;;
- -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
- ;;
- -zvmoe)
- os=-zvmoe
- ;;
- -dicos*)
- os=-dicos
- ;;
- -nacl*)
- ;;
- -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
- score-*)
- os=-elf
- ;;
- spu-*)
- os=-elf
- ;;
- *-acorn)
- os=-riscix1.2
- ;;
- arm*-rebel)
- os=-linux
- ;;
- arm*-semi)
- os=-aout
- ;;
- c4x-* | tic4x-*)
- os=-coff
- ;;
- hexagon-*)
- os=-elf
- ;;
- tic54x-*)
- os=-coff
- ;;
- tic55x-*)
- os=-coff
- ;;
- tic6x-*)
- 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
- ;;
- m68*-cisco)
- os=-aout
- ;;
- mep-*)
- os=-elf
- ;;
- mips*-cisco)
- os=-elf
- ;;
- mips*-*)
- os=-elf
- ;;
- or1k-*)
- 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
- ;;
- *-haiku)
- os=-haiku
- ;;
- *-ibm)
- os=-aix
- ;;
- *-knuth)
- os=-mmixware
- ;;
- *-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
- ;;
- -cnk*|-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
- ;;
- -os400*)
- vendor=ibm
- ;;
- -ptx*)
- vendor=sequent
- ;;
- -tpf*)
- vendor=ibm
- ;;
- -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
-
-# 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/Modules/_ctypes/libffi/configure b/Modules/_ctypes/libffi/configure
deleted file mode 100755
index 75f62a7c4c..0000000000
--- a/Modules/_ctypes/libffi/configure
+++ /dev/null
@@ -1,21691 +0,0 @@
-#! /bin/sh
-# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for libffi 3.1.
-#
-# Report bugs to <http://github.com/atgreen/libffi/issues>.
-#
-#
-# Copyright (C) 1992-1996, 1998-2012 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
-
-
-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
-# Prefer a ksh shell builtin over an external printf program on Solaris,
-# but without wasting forks for bash or zsh.
-if test -z "$BASH_VERSION$ZSH_VERSION" \
- && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
- as_echo='print -r --'
- as_echo_n='print -rn --'
-elif (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
-
-
-# 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.
-as_myself=
-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
-fi
-
-# Unset variables that we do not need and which cause bugs (e.g. in
-# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1"
-# suppresses any "Segmentation fault" message there. '((' could
-# trigger a bug in pdksh 5.2.14.
-for as_var in BASH_ENV ENV MAIL MAILPATH
-do eval test x\${$as_var+set} = xset \
- && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
-done
-PS1='$ '
-PS2='> '
-PS4='+ '
-
-# NLS nuisances.
-LC_ALL=C
-export LC_ALL
-LANGUAGE=C
-export LANGUAGE
-
-# CDPATH.
-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
-
-# Use a proper internal environment variable to ensure we don't fall
- # into an infinite loop, continuously re-executing ourselves.
- if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then
- _as_can_reexec=no; export _as_can_reexec;
- # We cannot yet assume a decent shell, so we have to provide a
-# neutralization value for shells without unset; and this also
-# works around shells that cannot unset nonexistent variables.
-# Preserve -v and -x to the replacement shell.
-BASH_ENV=/dev/null
-ENV=/dev/null
-(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
-case $- in # ((((
- *v*x* | *x*v* ) as_opts=-vx ;;
- *v* ) as_opts=-v ;;
- *x* ) as_opts=-x ;;
- * ) as_opts= ;;
-esac
-exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
-# Admittedly, this is quite paranoid, since all the known shells bail
-# out after a failed `exec'.
-$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
-as_fn_exit 255
- fi
- # We don't want this to propagate to other subprocesses.
- { _as_can_reexec=; unset _as_can_reexec;}
-if test "x$CONFIG_SHELL" = x; then
- as_bourne_compatible="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_required="as_fn_return () { (exit \$1); }
-as_fn_success () { as_fn_return 0; }
-as_fn_failure () { as_fn_return 1; }
-as_fn_ret_success () { return 0; }
-as_fn_ret_failure () { return 1; }
-
-exitcode=0
-as_fn_success || { exitcode=1; echo as_fn_success failed.; }
-as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; }
-as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; }
-as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; }
-if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :
-
-else
- exitcode=1; echo positional parameters were not saved.
-fi
-test x\$exitcode = x0 || exit 1
-test -x / || exit 1"
- as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
- as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
- eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
- test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1
-
- test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || (
- ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
- ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO
- ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO
- PATH=/empty FPATH=/empty; export PATH FPATH
- test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\
- || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1
-test \$(( 1 + 1 )) = 2 || exit 1"
- if (eval "$as_required") 2>/dev/null; then :
- as_have_required=yes
-else
- as_have_required=no
-fi
- if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then :
-
-else
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-as_found=false
-for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- as_found=:
- case $as_dir in #(
- /*)
- for as_base in sh bash ksh sh5; do
- # Try only shells that exist, to save several forks.
- as_shell=$as_dir/$as_base
- if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
- { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then :
- CONFIG_SHELL=$as_shell as_have_required=yes
- if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then :
- break 2
-fi
-fi
- done;;
- esac
- as_found=false
-done
-$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } &&
- { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then :
- CONFIG_SHELL=$SHELL as_have_required=yes
-fi; }
-IFS=$as_save_IFS
-
-
- if test "x$CONFIG_SHELL" != x; then :
- export CONFIG_SHELL
- # We cannot yet assume a decent shell, so we have to provide a
-# neutralization value for shells without unset; and this also
-# works around shells that cannot unset nonexistent variables.
-# Preserve -v and -x to the replacement shell.
-BASH_ENV=/dev/null
-ENV=/dev/null
-(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
-case $- in # ((((
- *v*x* | *x*v* ) as_opts=-vx ;;
- *v* ) as_opts=-v ;;
- *x* ) as_opts=-x ;;
- * ) as_opts= ;;
-esac
-exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
-# Admittedly, this is quite paranoid, since all the known shells bail
-# out after a failed `exec'.
-$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
-exit 255
-fi
-
- if test x$as_have_required = xno; then :
- $as_echo "$0: This script requires a shell more modern than all"
- $as_echo "$0: the shells that I found on your system."
- if test x${ZSH_VERSION+set} = xset ; then
- $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should"
- $as_echo "$0: be upgraded to zsh 4.3.4 or later."
- else
- $as_echo "$0: Please tell bug-autoconf@gnu.org and
-$0: http://github.com/atgreen/libffi/issues about your
-$0: system, including any error possibly output before this
-$0: message. Then install a modern shell, or manually run
-$0: the script under such a shell if you do have one."
- fi
- exit 1
-fi
-fi
-fi
-SHELL=${CONFIG_SHELL-/bin/sh}
-export SHELL
-# Unset more variables known to interfere with behavior of common tools.
-CLICOLOR_FORCE= GREP_OPTIONS=
-unset CLICOLOR_FORCE GREP_OPTIONS
-
-## --------------------- ##
-## M4sh Shell Functions. ##
-## --------------------- ##
-# as_fn_unset VAR
-# ---------------
-# Portably unset VAR.
-as_fn_unset ()
-{
- { eval $1=; unset $1;}
-}
-as_unset=as_fn_unset
-
-# as_fn_set_status STATUS
-# -----------------------
-# Set $? to STATUS, without forking.
-as_fn_set_status ()
-{
- return $1
-} # as_fn_set_status
-
-# as_fn_exit STATUS
-# -----------------
-# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
-as_fn_exit ()
-{
- set +e
- as_fn_set_status $1
- exit $1
-} # as_fn_exit
-
-# as_fn_mkdir_p
-# -------------
-# Create "$as_dir" as a directory, including parents if necessary.
-as_fn_mkdir_p ()
-{
-
- case $as_dir in #(
- -*) as_dir=./$as_dir;;
- esac
- test -d "$as_dir" || eval $as_mkdir_p || {
- 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_fn_error $? "cannot create directory $as_dir"
-
-
-} # as_fn_mkdir_p
-
-# as_fn_executable_p FILE
-# -----------------------
-# Test if FILE is an executable regular file.
-as_fn_executable_p ()
-{
- test -f "$1" && test -x "$1"
-} # as_fn_executable_p
-# as_fn_append VAR VALUE
-# ----------------------
-# Append the text in VALUE to the end of the definition contained in VAR. Take
-# advantage of any shell optimizations that allow amortized linear growth over
-# repeated appends, instead of the typical quadratic growth present in naive
-# implementations.
-if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
- eval 'as_fn_append ()
- {
- eval $1+=\$2
- }'
-else
- as_fn_append ()
- {
- eval $1=\$$1\$2
- }
-fi # as_fn_append
-
-# as_fn_arith ARG...
-# ------------------
-# Perform arithmetic evaluation on the ARGs, and store the result in the
-# global $as_val. Take advantage of shells that can avoid forks. The arguments
-# must be portable across $(()) and expr.
-if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
- eval 'as_fn_arith ()
- {
- as_val=$(( $* ))
- }'
-else
- as_fn_arith ()
- {
- as_val=`expr "$@" || test $? -eq 1`
- }
-fi # as_fn_arith
-
-
-# as_fn_error STATUS ERROR [LINENO LOG_FD]
-# ----------------------------------------
-# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
-# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
-# script with STATUS, using 1 if that was 0.
-as_fn_error ()
-{
- as_status=$1; test $as_status -eq 0 && as_status=1
- if test "$4"; then
- as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
- fi
- $as_echo "$as_me: error: $2" >&2
- as_fn_exit $as_status
-} # as_fn_error
-
-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
-
-if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
- as_dirname=dirname
-else
- as_dirname=false
-fi
-
-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'`
-
-# 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_lineno_1=$LINENO as_lineno_1a=$LINENO
- as_lineno_2=$LINENO as_lineno_2a=$LINENO
- eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" &&
- test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || {
- # 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; as_fn_exit 1; }
-
- # If we had to re-execute with $CONFIG_SHELL, we're ensured to have
- # already done that, so ensure we don't try to do so again and fall
- # in an infinite loop. This has already happened in practice.
- _as_can_reexec=no; export _as_can_reexec
- # 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
-}
-
-ECHO_C= ECHO_N= ECHO_T=
-case `echo -n x` in #(((((
--n*)
- case `echo 'xy\c'` in
- *c*) ECHO_T=' ';; # ECHO_T is single tab character.
- xy) ECHO_C='\c';;
- *) echo `echo ksh88 bug on AIX 6.1` > /dev/null
- ECHO_T=' ';;
- esac;;
-*)
- ECHO_N='-n';;
-esac
-
-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 -pR'.
- ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
- as_ln_s='cp -pR'
- elif ln conf$$.file conf$$ 2>/dev/null; then
- as_ln_s=ln
- else
- as_ln_s='cp -pR'
- fi
-else
- as_ln_s='cp -pR'
-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='mkdir -p "$as_dir"'
-else
- test -d ./-p && rmdir ./-p
- as_mkdir_p=false
-fi
-
-as_test_x='test -x'
-as_executable_p=as_fn_executable_p
-
-# 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'"
-
-SHELL=${CONFIG_SHELL-/bin/sh}
-
-
-test -n "$DJDIR" || exec 7<&0 </dev/null
-exec 6>&1
-
-# Name of the host.
-# hostname on some systems (SVR3.2, old GNU/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=
-
-# Identity of this package.
-PACKAGE_NAME='libffi'
-PACKAGE_TARNAME='libffi'
-PACKAGE_VERSION='3.1'
-PACKAGE_STRING='libffi 3.1'
-PACKAGE_BUGREPORT='http://github.com/atgreen/libffi/issues'
-PACKAGE_URL=''
-
-# Factoring default headers for most tests.
-ac_includes_default="\
-#include <stdio.h>
-#ifdef HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
-#ifdef HAVE_SYS_STAT_H
-# include <sys/stat.h>
-#endif
-#ifdef STDC_HEADERS
-# include <stdlib.h>
-# include <stddef.h>
-#else
-# ifdef HAVE_STDLIB_H
-# include <stdlib.h>
-# endif
-#endif
-#ifdef HAVE_STRING_H
-# if !defined STDC_HEADERS && defined HAVE_MEMORY_H
-# include <memory.h>
-# endif
-# include <string.h>
-#endif
-#ifdef HAVE_STRINGS_H
-# include <strings.h>
-#endif
-#ifdef HAVE_INTTYPES_H
-# include <inttypes.h>
-#endif
-#ifdef HAVE_STDINT_H
-# include <stdint.h>
-#endif
-#ifdef HAVE_UNISTD_H
-# include <unistd.h>
-#endif"
-
-ac_subst_vars='am__EXEEXT_FALSE
-am__EXEEXT_TRUE
-LTLIBOBJS
-LIBOBJS
-toolexeclibdir
-toolexecdir
-FFI_DEBUG_FALSE
-FFI_DEBUG_TRUE
-TARGETDIR
-TARGET
-FFI_EXEC_TRAMPOLINE_TABLE
-FFI_EXEC_TRAMPOLINE_TABLE_FALSE
-FFI_EXEC_TRAMPOLINE_TABLE_TRUE
-sys_symbol_underscore
-HAVE_LONG_DOUBLE_VARIANT
-HAVE_LONG_DOUBLE
-ALLOCA
-XTENSA_FALSE
-XTENSA_TRUE
-VAX_FALSE
-VAX_TRUE
-TILE_FALSE
-TILE_TRUE
-PA64_HPUX_FALSE
-PA64_HPUX_TRUE
-PA_HPUX_FALSE
-PA_HPUX_TRUE
-PA_LINUX_FALSE
-PA_LINUX_TRUE
-SH64_FALSE
-SH64_TRUE
-SH_FALSE
-SH_TRUE
-X86_64_FALSE
-X86_64_TRUE
-S390_FALSE
-S390_TRUE
-FRV_FALSE
-FRV_TRUE
-LIBFFI_CRIS_FALSE
-LIBFFI_CRIS_TRUE
-AVR32_FALSE
-AVR32_TRUE
-ARM_FALSE
-ARM_TRUE
-ARC_FALSE
-ARC_TRUE
-AARCH64_FALSE
-AARCH64_TRUE
-POWERPC_FREEBSD_FALSE
-POWERPC_FREEBSD_TRUE
-POWERPC_DARWIN_FALSE
-POWERPC_DARWIN_TRUE
-POWERPC_AIX_FALSE
-POWERPC_AIX_TRUE
-POWERPC_FALSE
-POWERPC_TRUE
-NIOS2_FALSE
-NIOS2_TRUE
-MOXIE_FALSE
-MOXIE_TRUE
-METAG_FALSE
-METAG_TRUE
-MICROBLAZE_FALSE
-MICROBLAZE_TRUE
-M88K_FALSE
-M88K_TRUE
-M68K_FALSE
-M68K_TRUE
-M32R_FALSE
-M32R_TRUE
-IA64_FALSE
-IA64_TRUE
-ALPHA_FALSE
-ALPHA_TRUE
-X86_DARWIN64_FALSE
-X86_DARWIN64_TRUE
-X86_DARWIN32_FALSE
-X86_DARWIN32_TRUE
-X86_DARWIN_FALSE
-X86_DARWIN_TRUE
-X86_WIN64_FALSE
-X86_WIN64_TRUE
-X86_WIN32_FALSE
-X86_WIN32_TRUE
-X86_FREEBSD_FALSE
-X86_FREEBSD_TRUE
-X86_FALSE
-X86_TRUE
-SPARC_FALSE
-SPARC_TRUE
-BFIN_FALSE
-BFIN_TRUE
-MIPS_FALSE
-MIPS_TRUE
-AM_LTLDFLAGS
-AM_RUNTESTFLAGS
-TESTSUBDIR_FALSE
-TESTSUBDIR_TRUE
-MAINT
-MAINTAINER_MODE_FALSE
-MAINTAINER_MODE_TRUE
-PRTDIAG
-CXXCPP
-CPP
-OTOOL64
-OTOOL
-LIPO
-NMEDIT
-DSYMUTIL
-MANIFEST_TOOL
-RANLIB
-ac_ct_AR
-AR
-DLLTOOL
-OBJDUMP
-LN_S
-NM
-ac_ct_DUMPBIN
-DUMPBIN
-LD
-FGREP
-EGREP
-GREP
-SED
-LIBTOOL
-am__fastdepCCAS_FALSE
-am__fastdepCCAS_TRUE
-CCASDEPMODE
-CCASFLAGS
-CCAS
-am__fastdepCXX_FALSE
-am__fastdepCXX_TRUE
-CXXDEPMODE
-ac_ct_CXX
-CXXFLAGS
-CXX
-am__fastdepCC_FALSE
-am__fastdepCC_TRUE
-CCDEPMODE
-am__nodep
-AMDEPBACKSLASH
-AMDEP_FALSE
-AMDEP_TRUE
-am__quote
-am__include
-DEPDIR
-OBJEXT
-EXEEXT
-ac_ct_CC
-CPPFLAGS
-LDFLAGS
-CFLAGS
-CC
-AM_BACKSLASH
-AM_DEFAULT_VERBOSITY
-AM_DEFAULT_V
-AM_V
-am__untar
-am__tar
-AMTAR
-am__leading_dot
-SET_MAKE
-AWK
-mkdir_p
-MKDIR_P
-INSTALL_STRIP_PROGRAM
-STRIP
-install_sh
-MAKEINFO
-AUTOHEADER
-AUTOMAKE
-AUTOCONF
-ACLOCAL
-VERSION
-PACKAGE
-CYGPATH_W
-am__isrc
-INSTALL_DATA
-INSTALL_SCRIPT
-INSTALL_PROGRAM
-ax_enable_builddir_sed
-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_URL
-PACKAGE_BUGREPORT
-PACKAGE_STRING
-PACKAGE_VERSION
-PACKAGE_TARNAME
-PACKAGE_NAME
-PATH_SEPARATOR
-SHELL'
-ac_subst_files=''
-ac_user_opts='
-enable_option_checking
-enable_builddir
-enable_silent_rules
-enable_dependency_tracking
-enable_shared
-enable_static
-with_pic
-enable_fast_install
-with_gnu_ld
-with_sysroot
-enable_libtool_lock
-enable_portable_binary
-with_gcc_arch
-enable_maintainer_mode
-enable_pax_emutramp
-enable_debug
-enable_structs
-enable_raw_api
-enable_purify_safety
-'
- ac_precious_vars='build_alias
-host_alias
-target_alias
-CCAS
-CCASFLAGS
-CPP
-CPPFLAGS
-CXXCPP'
-
-
-# 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= ;;
- *) 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_fn_error $? "invalid feature name: $ac_useropt"
- 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_fn_error $? "invalid feature name: $ac_useropt"
- 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_fn_error $? "invalid package name: $ac_useropt"
- 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_fn_error $? "invalid package name: $ac_useropt"
- 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_fn_error $? "unrecognized option: \`$ac_option'
-Try \`$0 --help' for more information"
- ;;
-
- *=*)
- ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
- # Reject names that are not valid shell variable names.
- case $ac_envvar in #(
- '' | [0-9]* | *[!_$as_cr_alnum]* )
- as_fn_error $? "invalid variable name: \`$ac_envvar'" ;;
- esac
- 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_fn_error $? "missing argument to $ac_option"
-fi
-
-if test -n "$ac_unrecognized_opts"; then
- case $enable_option_checking in
- no) ;;
- fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;;
- *) $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_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val"
-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
- 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_fn_error $? "working directory cannot be determined"
-test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
- as_fn_error $? "pwd does not report name of working directory"
-
-
-# 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_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir"
-fi
-ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
-ac_abs_confdir=`(
- cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg"
- 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 libffi 3.1 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/libffi]
- --htmldir=DIR html documentation [DOCDIR]
- --dvidir=DIR dvi documentation [DOCDIR]
- --pdfdir=DIR pdf documentation [DOCDIR]
- --psdir=DIR ps documentation [DOCDIR]
-_ACEOF
-
- cat <<\_ACEOF
-
-Program names:
- --program-prefix=PREFIX prepend PREFIX to installed program names
- --program-suffix=SUFFIX append SUFFIX to installed program names
- --program-transform-name=PROGRAM run sed PROGRAM on installed program names
-
-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 libffi 3.1:";;
- 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]
- --disable-builddir disable automatic build in subdir of sources
-
- --enable-silent-rules less verbose build output (undo: "make V=1")
- --disable-silent-rules verbose build output (undo: "make V=0")
- --enable-dependency-tracking
- do not reject slow dependency extractors
- --disable-dependency-tracking
- speeds up one-time build
- --enable-shared[=PKGS] build shared libraries [default=yes]
- --enable-static[=PKGS] build static libraries [default=yes]
- --enable-fast-install[=PKGS]
- optimize for fast installation [default=yes]
- --disable-libtool-lock avoid locking (might break parallel builds)
- --enable-portable-binary
- disable compiler optimizations that would produce
- unportable binaries
- --enable-maintainer-mode
- enable make rules and dependencies not useful (and
- sometimes confusing) to the casual installer
- --enable-pax_emutramp enable pax emulated trampolines, for we can't use PROT_EXEC
- --enable-debug debugging mode
- --disable-structs omit code for struct support
- --disable-raw-api make the raw api unavailable
- --enable-purify-safety purify-safe mode
-
-Optional Packages:
- --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
- --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
- --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use
- both]
- --with-gnu-ld assume the C compiler uses GNU ld [default=no]
- --with-sysroot[=DIR] Search for dependent libraries within DIR (or the
- compiler's sysroot if not specified).
- --with-gcc-arch=<arch> use architecture <arch> for gcc -march/-mtune,
- instead of guessing
-
-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 (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
- you have headers in a nonstandard directory <include dir>
- CXX C++ compiler command
- CXXFLAGS C++ compiler flags
- CCAS assembler compiler command (defaults to CC)
- CCASFLAGS assembler compiler flags (defaults to CFLAGS)
- CPP C preprocessor
- CXXCPP C++ preprocessor
-
-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://github.com/atgreen/libffi/issues>.
-_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
-libffi configure 3.1
-generated by GNU Autoconf 2.69
-
-Copyright (C) 2012 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
-
-## ------------------------ ##
-## Autoconf initialization. ##
-## ------------------------ ##
-
-# ac_fn_c_try_compile LINENO
-# --------------------------
-# Try to compile conftest.$ac_ext, and return whether this succeeded.
-ac_fn_c_try_compile ()
-{
- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- 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:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_compile") 2>conftest.err
- ac_status=$?
- if test -s conftest.err; then
- grep -v '^ *+' conftest.err >conftest.er1
- cat conftest.er1 >&5
- mv -f conftest.er1 conftest.err
- fi
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then :
- ac_retval=0
-else
- $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_retval=1
-fi
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
- as_fn_set_status $ac_retval
-
-} # ac_fn_c_try_compile
-
-# ac_fn_cxx_try_compile LINENO
-# ----------------------------
-# Try to compile conftest.$ac_ext, and return whether this succeeded.
-ac_fn_cxx_try_compile ()
-{
- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- 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:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_compile") 2>conftest.err
- ac_status=$?
- if test -s conftest.err; then
- grep -v '^ *+' conftest.err >conftest.er1
- cat conftest.er1 >&5
- mv -f conftest.er1 conftest.err
- fi
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; } && {
- test -z "$ac_cxx_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then :
- ac_retval=0
-else
- $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_retval=1
-fi
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
- as_fn_set_status $ac_retval
-
-} # ac_fn_cxx_try_compile
-
-# ac_fn_c_try_link LINENO
-# -----------------------
-# Try to link conftest.$ac_ext, and return whether this succeeded.
-ac_fn_c_try_link ()
-{
- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- rm -f conftest.$ac_objext conftest$ac_exeext
- 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:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_link") 2>conftest.err
- ac_status=$?
- if test -s conftest.err; then
- grep -v '^ *+' conftest.err >conftest.er1
- cat conftest.er1 >&5
- mv -f conftest.er1 conftest.err
- fi
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext && {
- test "$cross_compiling" = yes ||
- test -x conftest$ac_exeext
- }; then :
- ac_retval=0
-else
- $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_retval=1
-fi
- # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
- # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
- # interfere with the next link command; also delete a directory that is
- # left behind by Apple's compiler. We do this before executing the actions.
- rm -rf conftest.dSYM conftest_ipa8_conftest.oo
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
- as_fn_set_status $ac_retval
-
-} # ac_fn_c_try_link
-
-# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES
-# -------------------------------------------------------
-# Tests whether HEADER exists and can be compiled using the include files in
-# INCLUDES, setting the cache variable VAR accordingly.
-ac_fn_c_check_header_compile ()
-{
- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
-$as_echo_n "checking for $2... " >&6; }
-if eval \${$3+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-$4
-#include <$2>
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- eval "$3=yes"
-else
- eval "$3=no"
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-eval ac_res=\$$3
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
-
-} # ac_fn_c_check_header_compile
-
-# ac_fn_c_try_cpp LINENO
-# ----------------------
-# Try to preprocess conftest.$ac_ext, and return whether this succeeded.
-ac_fn_c_try_cpp ()
-{
- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- if { { ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err
- ac_status=$?
- if test -s conftest.err; then
- grep -v '^ *+' conftest.err >conftest.er1
- cat conftest.er1 >&5
- mv -f conftest.er1 conftest.err
- fi
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; } > conftest.i && {
- test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
- test ! -s conftest.err
- }; then :
- ac_retval=0
-else
- $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_retval=1
-fi
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
- as_fn_set_status $ac_retval
-
-} # ac_fn_c_try_cpp
-
-# ac_fn_c_try_run LINENO
-# ----------------------
-# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes
-# that executables *can* be run.
-ac_fn_c_try_run ()
-{
- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- 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:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_link") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; } && { ac_try='./conftest$ac_exeext'
- { { case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; }; then :
- ac_retval=0
-else
- $as_echo "$as_me: program exited with status $ac_status" >&5
- $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_retval=$ac_status
-fi
- rm -rf conftest.dSYM conftest_ipa8_conftest.oo
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
- as_fn_set_status $ac_retval
-
-} # ac_fn_c_try_run
-
-# ac_fn_c_check_func LINENO FUNC VAR
-# ----------------------------------
-# Tests whether FUNC exists, setting the cache variable VAR accordingly
-ac_fn_c_check_func ()
-{
- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
-$as_echo_n "checking for $2... " >&6; }
-if eval \${$3+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-/* Define $2 to an innocuous variant, in case <limits.h> declares $2.
- For example, HP-UX 11i <limits.h> declares gettimeofday. */
-#define $2 innocuous_$2
-
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $2 (); below.
- Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- <limits.h> exists even on freestanding compilers. */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef $2
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char $2 ();
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined __stub_$2 || defined __stub___$2
-choke me
-#endif
-
-int
-main ()
-{
-return $2 ();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- eval "$3=yes"
-else
- eval "$3=no"
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-fi
-eval ac_res=\$$3
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
-
-} # ac_fn_c_check_func
-
-# ac_fn_cxx_try_cpp LINENO
-# ------------------------
-# Try to preprocess conftest.$ac_ext, and return whether this succeeded.
-ac_fn_cxx_try_cpp ()
-{
- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- if { { ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err
- ac_status=$?
- if test -s conftest.err; then
- grep -v '^ *+' conftest.err >conftest.er1
- cat conftest.er1 >&5
- mv -f conftest.er1 conftest.err
- fi
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; } > conftest.i && {
- test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" ||
- test ! -s conftest.err
- }; then :
- ac_retval=0
-else
- $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_retval=1
-fi
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
- as_fn_set_status $ac_retval
-
-} # ac_fn_cxx_try_cpp
-
-# ac_fn_cxx_try_link LINENO
-# -------------------------
-# Try to link conftest.$ac_ext, and return whether this succeeded.
-ac_fn_cxx_try_link ()
-{
- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- rm -f conftest.$ac_objext conftest$ac_exeext
- 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:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_link") 2>conftest.err
- ac_status=$?
- if test -s conftest.err; then
- grep -v '^ *+' conftest.err >conftest.er1
- cat conftest.er1 >&5
- mv -f conftest.er1 conftest.err
- fi
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; } && {
- test -z "$ac_cxx_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext && {
- test "$cross_compiling" = yes ||
- test -x conftest$ac_exeext
- }; then :
- ac_retval=0
-else
- $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_retval=1
-fi
- # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
- # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
- # interfere with the next link command; also delete a directory that is
- # left behind by Apple's compiler. We do this before executing the actions.
- rm -rf conftest.dSYM conftest_ipa8_conftest.oo
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
- as_fn_set_status $ac_retval
-
-} # ac_fn_cxx_try_link
-
-# ac_fn_c_compute_int LINENO EXPR VAR INCLUDES
-# --------------------------------------------
-# Tries to find the compile-time value of EXPR in a program that includes
-# INCLUDES, setting VAR accordingly. Returns whether the value could be
-# computed
-ac_fn_c_compute_int ()
-{
- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- if test "$cross_compiling" = yes; then
- # Depending upon the size, compute the lo and hi bounds.
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-$4
-int
-main ()
-{
-static int test_array [1 - 2 * !(($2) >= 0)];
-test_array [0] = 0;
-return test_array [0];
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_lo=0 ac_mid=0
- while :; do
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-$4
-int
-main ()
-{
-static int test_array [1 - 2 * !(($2) <= $ac_mid)];
-test_array [0] = 0;
-return test_array [0];
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_hi=$ac_mid; break
-else
- as_fn_arith $ac_mid + 1 && ac_lo=$as_val
- if test $ac_lo -le $ac_mid; then
- ac_lo= ac_hi=
- break
- fi
- as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- done
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-$4
-int
-main ()
-{
-static int test_array [1 - 2 * !(($2) < 0)];
-test_array [0] = 0;
-return test_array [0];
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_hi=-1 ac_mid=-1
- while :; do
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-$4
-int
-main ()
-{
-static int test_array [1 - 2 * !(($2) >= $ac_mid)];
-test_array [0] = 0;
-return test_array [0];
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_lo=$ac_mid; break
-else
- as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val
- if test $ac_mid -le $ac_hi; then
- ac_lo= ac_hi=
- break
- fi
- as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- done
-else
- ac_lo= ac_hi=
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-# Binary search between lo and hi bounds.
-while test "x$ac_lo" != "x$ac_hi"; do
- as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-$4
-int
-main ()
-{
-static int test_array [1 - 2 * !(($2) <= $ac_mid)];
-test_array [0] = 0;
-return test_array [0];
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_hi=$ac_mid
-else
- as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-done
-case $ac_lo in #((
-?*) eval "$3=\$ac_lo"; ac_retval=0 ;;
-'') ac_retval=1 ;;
-esac
- else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-$4
-static long int longval () { return $2; }
-static unsigned long int ulongval () { return $2; }
-#include <stdio.h>
-#include <stdlib.h>
-int
-main ()
-{
-
- FILE *f = fopen ("conftest.val", "w");
- if (! f)
- return 1;
- if (($2) < 0)
- {
- long int i = longval ();
- if (i != ($2))
- return 1;
- fprintf (f, "%ld", i);
- }
- else
- {
- unsigned long int i = ulongval ();
- if (i != ($2))
- return 1;
- fprintf (f, "%lu", i);
- }
- /* Do not output a trailing newline, as this causes \r\n confusion
- on some platforms. */
- return ferror (f) || fclose (f) != 0;
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
- echo >>conftest.val; read $3 <conftest.val; ac_retval=0
-else
- ac_retval=1
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
- conftest.$ac_objext conftest.beam conftest.$ac_ext
-rm -f conftest.val
-
- fi
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
- as_fn_set_status $ac_retval
-
-} # ac_fn_c_compute_int
-
-# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES
-# -------------------------------------------------------
-# Tests whether HEADER exists, giving a warning if it cannot be compiled using
-# the include files in INCLUDES and setting the cache variable VAR
-# accordingly.
-ac_fn_c_check_header_mongrel ()
-{
- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- if eval \${$3+:} false; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
-$as_echo_n "checking for $2... " >&6; }
-if eval \${$3+:} false; then :
- $as_echo_n "(cached) " >&6
-fi
-eval ac_res=\$$3
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-else
- # Is the header compilable?
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5
-$as_echo_n "checking $2 usability... " >&6; }
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-$4
-#include <$2>
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_header_compiler=yes
-else
- ac_header_compiler=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5
-$as_echo "$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5
-$as_echo_n "checking $2 presence... " >&6; }
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <$2>
-_ACEOF
-if ac_fn_c_try_cpp "$LINENO"; then :
- ac_header_preproc=yes
-else
- ac_header_preproc=no
-fi
-rm -f conftest.err conftest.i conftest.$ac_ext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5
-$as_echo "$ac_header_preproc" >&6; }
-
-# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #((
- yes:no: )
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5
-$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
-$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
- ;;
- no:yes:* )
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5
-$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;}
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5
-$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;}
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5
-$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;}
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5
-$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;}
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
-$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
-( $as_echo "## ------------------------------------------------------ ##
-## Report this to http://github.com/atgreen/libffi/issues ##
-## ------------------------------------------------------ ##"
- ) | sed "s/^/$as_me: WARNING: /" >&2
- ;;
-esac
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
-$as_echo_n "checking for $2... " >&6; }
-if eval \${$3+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- eval "$3=\$ac_header_compiler"
-fi
-eval ac_res=\$$3
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-fi
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
-
-} # ac_fn_c_check_header_mongrel
-
-# ac_fn_c_check_type LINENO TYPE VAR INCLUDES
-# -------------------------------------------
-# Tests whether TYPE exists after having included INCLUDES, setting cache
-# variable VAR accordingly.
-ac_fn_c_check_type ()
-{
- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
-$as_echo_n "checking for $2... " >&6; }
-if eval \${$3+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- eval "$3=no"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-$4
-int
-main ()
-{
-if (sizeof ($2))
- return 0;
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-$4
-int
-main ()
-{
-if (sizeof (($2)))
- return 0;
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-
-else
- eval "$3=yes"
-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
-eval ac_res=\$$3
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
-
-} # ac_fn_c_check_type
-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 libffi $as_me 3.1, which was
-generated by GNU Autoconf 2.69. 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) as_fn_append ac_configure_args0 " '$ac_arg'" ;;
- 2)
- as_fn_append 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
- as_fn_append ac_configure_args " '$ac_arg'"
- ;;
- esac
- done
-done
-{ ac_configure_args0=; unset ac_configure_args0;}
-{ ac_configure_args1=; unset 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
-
- $as_echo "## ---------------- ##
-## Cache variables. ##
-## ---------------- ##"
- 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:${as_lineno-$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= ;; #(
- *) { eval $ac_var=; 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
-
- $as_echo "## ----------------- ##
-## Output variables. ##
-## ----------------- ##"
- 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
- $as_echo "## ------------------- ##
-## File substitutions. ##
-## ------------------- ##"
- 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
- $as_echo "## ----------- ##
-## confdefs.h. ##
-## ----------- ##"
- 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'; as_fn_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
-
-$as_echo "/* confdefs.h */" > 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
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_URL "$PACKAGE_URL"
-_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
- # We do not want a PATH search for config.site.
- case $CONFIG_SITE in #((
- -*) ac_site_file1=./$CONFIG_SITE;;
- */*) ac_site_file1=$CONFIG_SITE;;
- *) ac_site_file1=./$CONFIG_SITE;;
- esac
-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 /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then
- { $as_echo "$as_me:${as_lineno-$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" \
- || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "failed to load site script $ac_site_file
-See \`config.log' for more details" "$LINENO" 5; }
- 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. DJGPP emulates it as a regular file.
- if test /dev/null != "$cache_file" && test -f "$cache_file"; then
- { $as_echo "$as_me:${as_lineno-$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:${as_lineno-$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:${as_lineno-$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:${as_lineno-$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:${as_lineno-$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:${as_lineno-$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:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5
-$as_echo "$as_me: former value: \`$ac_old_val'" >&2;}
- { $as_echo "$as_me:${as_lineno-$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.
- *) as_fn_append ac_configure_args " '$ac_arg'" ;;
- esac
- fi
-done
-if $ac_cache_corrupted; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
- { $as_echo "$as_me:${as_lineno-$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_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5
-fi
-## -------------------- ##
-## Main body of script. ##
-## -------------------- ##
-
-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
-
-
-ac_config_headers="$ac_config_headers fficonfig.h"
-
-
-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_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5
-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_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
-$as_echo_n "checking build system type... " >&6; }
-if ${ac_cv_build+:} false; 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_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5
-ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
- as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5
-$as_echo "$ac_cv_build" >&6; }
-case $ac_cv_build in
-*-*-*) ;;
-*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;;
-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:${as_lineno-$LINENO}: checking host system type" >&5
-$as_echo_n "checking host system type... " >&6; }
-if ${ac_cv_host+:} false; 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_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5
-$as_echo "$ac_cv_host" >&6; }
-case $ac_cv_host in
-*-*-*) ;;
-*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;;
-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:${as_lineno-$LINENO}: checking target system type" >&5
-$as_echo_n "checking target system type... " >&6; }
-if ${ac_cv_target+:} false; 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_fn_error $? "$SHELL $ac_aux_dir/config.sub $target_alias failed" "$LINENO" 5
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_target" >&5
-$as_echo "$ac_cv_target" >&6; }
-case $ac_cv_target in
-*-*-*) ;;
-*) as_fn_error $? "invalid value of canonical target" "$LINENO" 5;;
-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}-
-
-target_alias=${target_alias-$host_alias}
-
-case "${host}" in
- frv*-elf)
- LDFLAGS=`echo $LDFLAGS | sed "s/\-B^ *libgloss\/frv\///"`\ -B`pwd`/../libgloss/frv/
- ;;
-esac
-
-
- # [$]@ is unsable in 2.60+ but earlier autoconf had no ac_configure_args
- if test "${ac_configure_args+set}" != "set" ; then
- ac_configure_args=
- for ac_arg in ${1+"$@"}; do
- ac_configure_args="$ac_configure_args '$ac_arg'"
- done
- fi
-
-# expand $ac_aux_dir to an absolute path
-am_aux_dir=`cd $ac_aux_dir && pwd`
-
-
-ax_enable_builddir="."
-# Check whether --enable-builddir was given.
-if test "${enable_builddir+set}" = set; then :
- enableval=$enable_builddir; ax_enable_builddir="$enableval"
-else
- ax_enable_builddir="auto"
-fi
-
-if test ".$ac_srcdir_defaulted" != ".no" ; then
-if test ".$srcdir" = ".." ; then
- if test -f config.status ; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: toplevel srcdir already configured... skipping subdir build" >&5
-$as_echo "$as_me: toplevel srcdir already configured... skipping subdir build" >&6;}
- else
- test ".$ax_enable_builddir" = "." && ax_enable_builddir="."
- test ".$ax_enable_builddir" = ".no" && ax_enable_builddir="."
- test ".$TARGET" = "." && TARGET="$target"
- test ".$ax_enable_builddir" = ".auto" && ax_enable_builddir="$TARGET"
- if test ".$ax_enable_builddir" != ".." ; then # we know where to go and
- as_dir=$ax_enable_builddir; as_fn_mkdir_p
- echo __.$ax_enable_builddir.__ > $ax_enable_builddir/conftest.tmp
- cd $ax_enable_builddir
- if grep __.$ax_enable_builddir.__ conftest.tmp >/dev/null 2>/dev/null ; then
- rm conftest.tmp
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: continue configure in default builddir \"./$ax_enable_builddir\"" >&5
-$as_echo "continue configure in default builddir \"./$ax_enable_builddir\"" >&6; }
- else
- as_fn_error $? "could not change to default builddir \"./$ax_enable_builddir\"" "$LINENO" 5
- fi
- srcdir=`echo "$ax_enable_builddir" |
- sed -e 's,^\./,,;s,[^/]$,&/,;s,[^/]*/,../,g;s,[/]$,,;'`
- # going to restart from subdirectory location
- test -f $srcdir/config.log && mv $srcdir/config.log .
- test -f $srcdir/confdefs.h && mv $srcdir/confdefs.h .
- test -f $srcdir/conftest.log && mv $srcdir/conftest.log .
- test -f $srcdir/$cache_file && mv $srcdir/$cache_file .
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: ....exec $SHELL $srcdir/$0 \"--srcdir=$srcdir\" \"--enable-builddir=$ax_enable_builddir\" ${1+\"$@\"}" >&5
-$as_echo "....exec $SHELL $srcdir/$0 \"--srcdir=$srcdir\" \"--enable-builddir=$ax_enable_builddir\" ${1+\"$@\"}" >&6; }
- case "$0" in # restart
- /\\*) eval $SHELL "'$0'" "'--srcdir=$srcdir'" "'--enable-builddir=$ax_enable_builddir'" $ac_configure_args ;;
- *) eval $SHELL "'$srcdir/$0'" "'--srcdir=$srcdir'" "'--enable-builddir=$ax_enable_builddir'" $ac_configure_args ;;
- esac ; exit $?
- fi
- fi
-fi fi
-test ".$ax_enable_builddir" = ".auto" && ax_enable_builddir="."
-# Extract the first word of "gsed sed", so it can be a program name with args.
-set dummy gsed sed; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_ax_enable_builddir_sed+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- case $ax_enable_builddir_sed in
- [\\/]* | ?:[\\/]*)
- ac_cv_path_ax_enable_builddir_sed="$ax_enable_builddir_sed" # Let the user override the test with a path.
- ;;
- *)
- 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_path_ax_enable_builddir_sed="$as_dir/$ac_word$ac_exec_ext"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
- test -z "$ac_cv_path_ax_enable_builddir_sed" && ac_cv_path_ax_enable_builddir_sed="sed"
- ;;
-esac
-fi
-ax_enable_builddir_sed=$ac_cv_path_ax_enable_builddir_sed
-if test -n "$ax_enable_builddir_sed"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_enable_builddir_sed" >&5
-$as_echo "$ax_enable_builddir_sed" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-ax_enable_builddir_auxdir="$am_aux_dir"
-ac_config_commands="$ac_config_commands buildir"
-
-
-am__api_version='1.13'
-
-# 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:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5
-$as_echo_n "checking for a BSD-compatible install... " >&6; }
-if test -z "$INSTALL"; then
-if ${ac_cv_path_install+:} false; 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 as_fn_executable_p "$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:${as_lineno-$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'
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5
-$as_echo_n "checking whether build environment is sane... " >&6; }
-# Reject unsafe characters in $srcdir or the absolute working directory
-# name. Accept space and tab only in the latter.
-am_lf='
-'
-case `pwd` in
- *[\\\"\#\$\&\'\`$am_lf]*)
- as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;;
-esac
-case $srcdir in
- *[\\\"\#\$\&\'\`$am_lf\ \ ]*)
- as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;;
-esac
-
-# Do 'set' in a subshell so we don't clobber the current shell's
-# arguments. Must try -L first in case configure is actually a
-# symlink; some systems play weird games with the mod time of symlinks
-# (eg FreeBSD returns the mod time of the symlink's containing
-# directory).
-if (
- am_has_slept=no
- for am_try in 1 2; do
- echo "timestamp, slept: $am_has_slept" > conftest.file
- set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
- if test "$*" = "X"; then
- # -L didn't work.
- set X `ls -t "$srcdir/configure" conftest.file`
- fi
- if test "$*" != "X $srcdir/configure conftest.file" \
- && test "$*" != "X conftest.file $srcdir/configure"; then
-
- # If neither matched, then we have a broken ls. This can happen
- # if, for instance, CONFIG_SHELL is bash and it inherits a
- # broken ls alias from the environment. This has actually
- # happened. Such a system could not be considered "sane".
- as_fn_error $? "ls -t appears to fail. Make sure there is not a broken
- alias in your environment" "$LINENO" 5
- fi
- if test "$2" = conftest.file || test $am_try -eq 2; then
- break
- fi
- # Just in case.
- sleep 1
- am_has_slept=yes
- done
- test "$2" = conftest.file
- )
-then
- # Ok.
- :
-else
- as_fn_error $? "newly created file is older than distributed files!
-Check your system clock" "$LINENO" 5
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-# If we didn't sleep, we still need to ensure time stamps of config.status and
-# generated files are strictly newer.
-am_sleep_pid=
-if grep 'slept: no' conftest.file >/dev/null 2>&1; then
- ( sleep 1 ) &
- am_sleep_pid=$!
-fi
-
-rm -f conftest.file
-
-test "$program_prefix" != NONE &&
- program_transform_name="s&^&$program_prefix&;$program_transform_name"
-# Use a double $ so make ignores it.
-test "$program_suffix" != NONE &&
- program_transform_name="s&\$&$program_suffix&;$program_transform_name"
-# Double any \ or $.
-# By default was `s,x,x', remove it if useless.
-ac_script='s/[\\$]/&&/g;s/;s,x,x,$//'
-program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"`
-
-if test x"${MISSING+set}" != xset; then
- case $am_aux_dir in
- *\ * | *\ *)
- MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
- *)
- MISSING="\${SHELL} $am_aux_dir/missing" ;;
- esac
-fi
-# Use eval to expand $SHELL
-if eval "$MISSING --is-lightweight"; then
- am_missing_run="$MISSING "
-else
- am_missing_run=
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5
-$as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;}
-fi
-
-if test x"${install_sh}" != xset; then
- case $am_aux_dir in
- *\ * | *\ *)
- install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
- *)
- install_sh="\${SHELL} $am_aux_dir/install-sh"
- esac
-fi
-
-# Installed binaries are usually stripped using 'strip' when the user
-# run "make install-strip". However 'strip' might not be the right
-# tool to use in cross-compilation environments, therefore Automake
-# will honor the 'STRIP' environment variable to overrule this program.
-if test "$cross_compiling" != no; then
- if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
-set dummy ${ac_tool_prefix}strip; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_STRIP+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$STRIP"; then
- ac_cv_prog_STRIP="$STRIP" # 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_STRIP="${ac_tool_prefix}strip"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-STRIP=$ac_cv_prog_STRIP
-if test -n "$STRIP"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
-$as_echo "$STRIP" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_STRIP"; then
- ac_ct_STRIP=$STRIP
- # Extract the first word of "strip", so it can be a program name with args.
-set dummy strip; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_STRIP+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$ac_ct_STRIP"; then
- ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_STRIP="strip"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
-if test -n "$ac_ct_STRIP"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
-$as_echo "$ac_ct_STRIP" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
- if test "x$ac_ct_STRIP" = x; then
- STRIP=":"
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$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
- STRIP=$ac_ct_STRIP
- fi
-else
- STRIP="$ac_cv_prog_STRIP"
-fi
-
-fi
-INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5
-$as_echo_n "checking for a thread-safe mkdir -p... " >&6; }
-if test -z "$MKDIR_P"; then
- if ${ac_cv_path_mkdir+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_prog in mkdir gmkdir; do
- for ac_exec_ext in '' $ac_executable_extensions; do
- as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue
- case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #(
- 'mkdir (GNU coreutils) '* | \
- 'mkdir (coreutils) '* | \
- 'mkdir (fileutils) '4.1*)
- ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext
- break 3;;
- esac
- done
- done
- done
-IFS=$as_save_IFS
-
-fi
-
- test -d ./--version && rmdir ./--version
- if test "${ac_cv_path_mkdir+set}" = set; then
- MKDIR_P="$ac_cv_path_mkdir -p"
- else
- # As a last resort, use the slow shell script. Don't cache a
- # value for MKDIR_P 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.
- MKDIR_P="$ac_install_sh -d"
- fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5
-$as_echo "$MKDIR_P" >&6; }
-
-for ac_prog in gawk mawk nawk awk
-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:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_AWK+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$AWK"; then
- ac_cv_prog_AWK="$AWK" # 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_AWK="$ac_prog"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-AWK=$ac_cv_prog_AWK
-if test -n "$AWK"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5
-$as_echo "$AWK" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
- test -n "$AWK" && break
-done
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5
-$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
-set x ${MAKE-make}
-ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
-if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat >conftest.make <<\_ACEOF
-SHELL = /bin/sh
-all:
- @echo '@@@%%%=$(MAKE)=@@@%%%'
-_ACEOF
-# GNU make sometimes prints "make[1]: Entering ...", which would confuse us.
-case `${MAKE-make} -f conftest.make 2>/dev/null` in
- *@@@%%%=?*=@@@%%%*)
- eval ac_cv_prog_make_${ac_make}_set=yes;;
- *)
- eval ac_cv_prog_make_${ac_make}_set=no;;
-esac
-rm -f conftest.make
-fi
-if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
- SET_MAKE=
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
- SET_MAKE="MAKE=${MAKE-make}"
-fi
-
-rm -rf .tst 2>/dev/null
-mkdir .tst 2>/dev/null
-if test -d .tst; then
- am__leading_dot=.
-else
- am__leading_dot=_
-fi
-rmdir .tst 2>/dev/null
-
-# Check whether --enable-silent-rules was given.
-if test "${enable_silent_rules+set}" = set; then :
- enableval=$enable_silent_rules;
-fi
-
-case $enable_silent_rules in # (((
- yes) AM_DEFAULT_VERBOSITY=0;;
- no) AM_DEFAULT_VERBOSITY=1;;
- *) AM_DEFAULT_VERBOSITY=1;;
-esac
-am_make=${MAKE-make}
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5
-$as_echo_n "checking whether $am_make supports nested variables... " >&6; }
-if ${am_cv_make_support_nested_variables+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if $as_echo 'TRUE=$(BAR$(V))
-BAR0=false
-BAR1=true
-V=1
-am__doit:
- @$(TRUE)
-.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then
- am_cv_make_support_nested_variables=yes
-else
- am_cv_make_support_nested_variables=no
-fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5
-$as_echo "$am_cv_make_support_nested_variables" >&6; }
-if test $am_cv_make_support_nested_variables = yes; then
- AM_V='$(V)'
- AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
-else
- AM_V=$AM_DEFAULT_VERBOSITY
- AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
-fi
-AM_BACKSLASH='\'
-
-if test "`cd $srcdir && pwd`" != "`pwd`"; then
- # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
- # is not polluted with repeated "-I."
- am__isrc=' -I$(srcdir)'
- # test to see if srcdir already configured
- if test -f $srcdir/config.status; then
- as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5
- fi
-fi
-
-# test whether we have cygpath
-if test -z "$CYGPATH_W"; then
- if (cygpath --version) >/dev/null 2>/dev/null; then
- CYGPATH_W='cygpath -w'
- else
- CYGPATH_W=echo
- fi
-fi
-
-
-# Define the identity of the package.
- PACKAGE='libffi'
- VERSION='3.1'
-
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE "$PACKAGE"
-_ACEOF
-
-
-cat >>confdefs.h <<_ACEOF
-#define VERSION "$VERSION"
-_ACEOF
-
-# Some tools Automake needs.
-
-ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"}
-
-
-AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"}
-
-
-AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"}
-
-
-AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
-
-
-MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
-
-# For better backward compatibility. To be removed once Automake 1.9.x
-# dies out for good. For more background, see:
-# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
-# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
-mkdir_p='$(MKDIR_P)'
-
-# We need awk for the "check" target. The system "awk" is bad on
-# some platforms.
-# Always define AMTAR for backward compatibility. Yes, it's still used
-# in the wild :-( We should find a proper way to deprecate it ...
-AMTAR='$${TAR-tar}'
-
-
-# We'll loop over all known methods to create a tar archive until one works.
-_am_tools='gnutar pax cpio none'
-
-am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'
-
-
-
-
-
-
-
-# The same as in boehm-gc and libstdc++. Have to borrow it from there.
-# We must force CC to /not/ be precious variables; otherwise
-# the wrong, non-multilib-adjusted value will be used in multilibs.
-# As a side effect, we have to subst CFLAGS ourselves.
-# Also save and restore CFLAGS, since AC_PROG_CC will come up with
-# defaults of its own if none are provided.
-
-
-
-save_CFLAGS=$CFLAGS
-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:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CC+:} false; 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_CC="${ac_tool_prefix}gcc"
- $as_echo "$as_me:${as_lineno-$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:${as_lineno-$LINENO}: result: $CC" >&5
-$as_echo "$CC" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$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:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_CC+:} false; 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_CC="gcc"
- $as_echo "$as_me:${as_lineno-$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:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
-$as_echo "$ac_ct_CC" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$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:${as_lineno-$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:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CC+:} false; 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_CC="${ac_tool_prefix}cc"
- $as_echo "$as_me:${as_lineno-$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:${as_lineno-$LINENO}: result: $CC" >&5
-$as_echo "$CC" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$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:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CC+:} false; 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 as_fn_executable_p "$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:${as_lineno-$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:${as_lineno-$LINENO}: result: $CC" >&5
-$as_echo "$CC" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$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:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CC+:} false; 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
- $as_echo "$as_me:${as_lineno-$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:${as_lineno-$LINENO}: result: $CC" >&5
-$as_echo "$CC" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$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:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_CC+:} false; 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_CC="$ac_prog"
- $as_echo "$as_me:${as_lineno-$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:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
-$as_echo "$ac_ct_CC" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$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:${as_lineno-$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:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "no acceptable C compiler found in \$PATH
-See \`config.log' for more details" "$LINENO" 5; }
-
-# Provide some information about the compiler.
-$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
-set X $ac_compile
-ac_compiler=$2
-for ac_option in --version -v -V -qversion; do
- { { ac_try="$ac_compiler $ac_option >&5"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_compiler $ac_option >&5") 2>conftest.err
- ac_status=$?
- if test -s conftest.err; then
- sed '10a\
-... rest of stderr output deleted ...
- 10q' conftest.err >conftest.er1
- cat conftest.er1 >&5
- fi
- rm -f conftest.er1 conftest.err
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }
-done
-
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* 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:${as_lineno-$LINENO}: checking whether the C compiler works" >&5
-$as_echo_n "checking whether the C compiler works... " >&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:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_link_default") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; 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
-if test -z "$ac_file"; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-$as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error 77 "C compiler cannot create executables
-See \`config.log' for more details" "$LINENO" 5; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5
-$as_echo_n "checking for C compiler default output file name... " >&6; }
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5
-$as_echo "$ac_file" >&6; }
-ac_exeext=$ac_cv_exeext
-
-rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
-ac_clean_files=$ac_clean_files_save
-{ $as_echo "$as_me:${as_lineno-$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:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_link") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; 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:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "cannot compute suffix of executables: cannot compile and link
-See \`config.log' for more details" "$LINENO" 5; }
-fi
-rm -f conftest conftest$ac_cv_exeext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
-$as_echo "$ac_cv_exeext" >&6; }
-
-rm -f conftest.$ac_ext
-EXEEXT=$ac_cv_exeext
-ac_exeext=$EXEEXT
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <stdio.h>
-int
-main ()
-{
-FILE *f = fopen ("conftest.out", "w");
- return ferror (f) || fclose (f) != 0;
-
- ;
- return 0;
-}
-_ACEOF
-ac_clean_files="$ac_clean_files conftest.out"
-# Check that the compiler produces executables we can run. If not, either
-# the compiler is broken, or we cross compile.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5
-$as_echo_n "checking whether we are cross compiling... " >&6; }
-if test "$cross_compiling" != yes; then
- { { 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:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_link") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }
- if { ac_try='./conftest$ac_cv_exeext'
- { { case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; }; then
- cross_compiling=no
- else
- if test "$cross_compiling" = maybe; then
- cross_compiling=yes
- else
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "cannot run C compiled programs.
-If you meant to cross compile, use \`--host'.
-See \`config.log' for more details" "$LINENO" 5; }
- fi
- fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5
-$as_echo "$cross_compiling" >&6; }
-
-rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out
-ac_clean_files=$ac_clean_files_save
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
-$as_echo_n "checking for suffix of object files... " >&6; }
-if ${ac_cv_objext+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* 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:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_compile") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; 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:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "cannot compute suffix of object files: cannot compile
-See \`config.log' for more details" "$LINENO" 5; }
-fi
-rm -f conftest.$ac_cv_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5
-$as_echo "$ac_cv_objext" >&6; }
-OBJEXT=$ac_cv_objext
-ac_objext=$OBJEXT
-{ $as_echo "$as_me:${as_lineno-$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 ${ac_cv_c_compiler_gnu+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-#ifndef __GNUC__
- choke me
-#endif
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_compiler_gnu=yes
-else
- 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:${as_lineno-$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:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
-$as_echo_n "checking whether $CC accepts -g... " >&6; }
-if ${ac_cv_prog_cc_g+:} false; 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 confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_prog_cc_g=yes
-else
- CFLAGS=""
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-
-else
- ac_c_werror_flag=$ac_save_c_werror_flag
- CFLAGS="-g"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_prog_cc_g=yes
-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:${as_lineno-$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:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
-$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
-if ${ac_cv_prog_cc_c89+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_cv_prog_cc_c89=no
-ac_save_CC=$CC
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <stdarg.h>
-#include <stdio.h>
-struct stat;
-/* 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"
- if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_prog_cc_c89=$ac_arg
-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:${as_lineno-$LINENO}: result: none needed" >&5
-$as_echo "none needed" >&6; } ;;
- xno)
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
-$as_echo "unsupported" >&6; } ;;
- *)
- CC="$CC $ac_cv_prog_cc_c89"
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
-$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
-esac
-if test "x$ac_cv_prog_cc_c89" != xno; then :
-
-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
-DEPDIR="${am__leading_dot}deps"
-
-ac_config_commands="$ac_config_commands depfiles"
-
-
-am_make=${MAKE-make}
-cat > confinc << 'END'
-am__doit:
- @echo this is the am__doit target
-.PHONY: am__doit
-END
-# If we don't find an include directive, just comment out the code.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5
-$as_echo_n "checking for style of include used by $am_make... " >&6; }
-am__include="#"
-am__quote=
-_am_result=none
-# First try GNU make style include.
-echo "include confinc" > confmf
-# Ignore all kinds of additional output from 'make'.
-case `$am_make -s -f confmf 2> /dev/null` in #(
-*the\ am__doit\ target*)
- am__include=include
- am__quote=
- _am_result=GNU
- ;;
-esac
-# Now try BSD make style include.
-if test "$am__include" = "#"; then
- echo '.include "confinc"' > confmf
- case `$am_make -s -f confmf 2> /dev/null` in #(
- *the\ am__doit\ target*)
- am__include=.include
- am__quote="\""
- _am_result=BSD
- ;;
- esac
-fi
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5
-$as_echo "$_am_result" >&6; }
-rm -f confinc confmf
-
-# Check whether --enable-dependency-tracking was given.
-if test "${enable_dependency_tracking+set}" = set; then :
- enableval=$enable_dependency_tracking;
-fi
-
-if test "x$enable_dependency_tracking" != xno; then
- am_depcomp="$ac_aux_dir/depcomp"
- AMDEPBACKSLASH='\'
- am__nodep='_no'
-fi
- if test "x$enable_dependency_tracking" != xno; then
- AMDEP_TRUE=
- AMDEP_FALSE='#'
-else
- AMDEP_TRUE='#'
- AMDEP_FALSE=
-fi
-
-
-
-depcc="$CC" am_compiler_list=
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
-$as_echo_n "checking dependency style of $depcc... " >&6; }
-if ${am_cv_CC_dependencies_compiler_type+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
- # We make a subdir and do the tests there. Otherwise we can end up
- # making bogus files that we don't know about and never remove. For
- # instance it was reported that on HP-UX the gcc test will end up
- # making a dummy file named 'D' -- because '-MD' means "put the output
- # in D".
- rm -rf conftest.dir
- mkdir conftest.dir
- # Copy depcomp to subdir because otherwise we won't find it if we're
- # using a relative directory.
- cp "$am_depcomp" conftest.dir
- cd conftest.dir
- # We will build objects and dependencies in a subdirectory because
- # it helps to detect inapplicable dependency modes. For instance
- # both Tru64's cc and ICC support -MD to output dependencies as a
- # side effect of compilation, but ICC will put the dependencies in
- # the current directory while Tru64 will put them in the object
- # directory.
- mkdir sub
-
- am_cv_CC_dependencies_compiler_type=none
- if test "$am_compiler_list" = ""; then
- am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
- fi
- am__universal=false
- case " $depcc " in #(
- *\ -arch\ *\ -arch\ *) am__universal=true ;;
- esac
-
- for depmode in $am_compiler_list; do
- # Setup a source with many dependencies, because some compilers
- # like to wrap large dependency lists on column 80 (with \), and
- # we should not choose a depcomp mode which is confused by this.
- #
- # We need to recreate these files for each test, as the compiler may
- # overwrite some of them when testing with obscure command lines.
- # This happens at least with the AIX C compiler.
- : > sub/conftest.c
- for i in 1 2 3 4 5 6; do
- echo '#include "conftst'$i'.h"' >> sub/conftest.c
- # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
- # Solaris 10 /bin/sh.
- echo '/* dummy */' > sub/conftst$i.h
- done
- echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
-
- # We check with '-c' and '-o' for the sake of the "dashmstdout"
- # mode. It turns out that the SunPro C++ compiler does not properly
- # handle '-M -o', and we need to detect this. Also, some Intel
- # versions had trouble with output in subdirs.
- am__obj=sub/conftest.${OBJEXT-o}
- am__minus_obj="-o $am__obj"
- case $depmode in
- gcc)
- # This depmode causes a compiler race in universal mode.
- test "$am__universal" = false || continue
- ;;
- nosideeffect)
- # After this tag, mechanisms are not by side-effect, so they'll
- # only be used when explicitly requested.
- if test "x$enable_dependency_tracking" = xyes; then
- continue
- else
- break
- fi
- ;;
- msvc7 | msvc7msys | msvisualcpp | msvcmsys)
- # This compiler won't grok '-c -o', but also, the minuso test has
- # not run yet. These depmodes are late enough in the game, and
- # so weak that their functioning should not be impacted.
- am__obj=conftest.${OBJEXT-o}
- am__minus_obj=
- ;;
- none) break ;;
- esac
- if depmode=$depmode \
- source=sub/conftest.c object=$am__obj \
- depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
- $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
- >/dev/null 2>conftest.err &&
- grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
- grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
- grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
- ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
- # icc doesn't choke on unknown options, it will just issue warnings
- # or remarks (even with -Werror). So we grep stderr for any message
- # that says an option was ignored or not supported.
- # When given -MP, icc 7.0 and 7.1 complain thusly:
- # icc: Command line warning: ignoring option '-M'; no argument required
- # The diagnosis changed in icc 8.0:
- # icc: Command line remark: option '-MP' not supported
- if (grep 'ignoring option' conftest.err ||
- grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
- am_cv_CC_dependencies_compiler_type=$depmode
- break
- fi
- fi
- done
-
- cd ..
- rm -rf conftest.dir
-else
- am_cv_CC_dependencies_compiler_type=none
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5
-$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; }
-CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
-
- if
- test "x$enable_dependency_tracking" != xno \
- && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
- am__fastdepCC_TRUE=
- am__fastdepCC_FALSE='#'
-else
- am__fastdepCC_TRUE='#'
- am__fastdepCC_FALSE=
-fi
-
-
-ac_ext=cpp
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-if test -z "$CXX"; then
- if test -n "$CCC"; then
- CXX=$CCC
- else
- if test -n "$ac_tool_prefix"; then
- for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC
- 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:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CXX+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$CXX"; then
- ac_cv_prog_CXX="$CXX" # 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_CXX="$ac_tool_prefix$ac_prog"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-CXX=$ac_cv_prog_CXX
-if test -n "$CXX"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5
-$as_echo "$CXX" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
- test -n "$CXX" && break
- done
-fi
-if test -z "$CXX"; then
- ac_ct_CXX=$CXX
- for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC
-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:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_CXX+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$ac_ct_CXX"; then
- ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_CXX="$ac_prog"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_CXX=$ac_cv_prog_ac_ct_CXX
-if test -n "$ac_ct_CXX"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5
-$as_echo "$ac_ct_CXX" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
- test -n "$ac_ct_CXX" && break
-done
-
- if test "x$ac_ct_CXX" = x; then
- CXX="g++"
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$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
- CXX=$ac_ct_CXX
- fi
-fi
-
- fi
-fi
-# Provide some information about the compiler.
-$as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5
-set X $ac_compile
-ac_compiler=$2
-for ac_option in --version -v -V -qversion; do
- { { ac_try="$ac_compiler $ac_option >&5"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_compiler $ac_option >&5") 2>conftest.err
- ac_status=$?
- if test -s conftest.err; then
- sed '10a\
-... rest of stderr output deleted ...
- 10q' conftest.err >conftest.er1
- cat conftest.er1 >&5
- fi
- rm -f conftest.er1 conftest.err
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }
-done
-
-{ $as_echo "$as_me:${as_lineno-$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 ${ac_cv_cxx_compiler_gnu+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-#ifndef __GNUC__
- choke me
-#endif
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_cxx_try_compile "$LINENO"; then :
- ac_compiler_gnu=yes
-else
- ac_compiler_gnu=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-ac_cv_cxx_compiler_gnu=$ac_compiler_gnu
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5
-$as_echo "$ac_cv_cxx_compiler_gnu" >&6; }
-if test $ac_compiler_gnu = yes; then
- GXX=yes
-else
- GXX=
-fi
-ac_test_CXXFLAGS=${CXXFLAGS+set}
-ac_save_CXXFLAGS=$CXXFLAGS
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5
-$as_echo_n "checking whether $CXX accepts -g... " >&6; }
-if ${ac_cv_prog_cxx_g+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_save_cxx_werror_flag=$ac_cxx_werror_flag
- ac_cxx_werror_flag=yes
- ac_cv_prog_cxx_g=no
- CXXFLAGS="-g"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_cxx_try_compile "$LINENO"; then :
- ac_cv_prog_cxx_g=yes
-else
- CXXFLAGS=""
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_cxx_try_compile "$LINENO"; then :
-
-else
- ac_cxx_werror_flag=$ac_save_cxx_werror_flag
- CXXFLAGS="-g"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_cxx_try_compile "$LINENO"; then :
- ac_cv_prog_cxx_g=yes
-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_cxx_werror_flag=$ac_save_cxx_werror_flag
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5
-$as_echo "$ac_cv_prog_cxx_g" >&6; }
-if test "$ac_test_CXXFLAGS" = set; then
- CXXFLAGS=$ac_save_CXXFLAGS
-elif test $ac_cv_prog_cxx_g = yes; then
- if test "$GXX" = yes; then
- CXXFLAGS="-g -O2"
- else
- CXXFLAGS="-g"
- fi
-else
- if test "$GXX" = yes; then
- CXXFLAGS="-O2"
- else
- CXXFLAGS=
- fi
-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
-
-depcc="$CXX" am_compiler_list=
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
-$as_echo_n "checking dependency style of $depcc... " >&6; }
-if ${am_cv_CXX_dependencies_compiler_type+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
- # We make a subdir and do the tests there. Otherwise we can end up
- # making bogus files that we don't know about and never remove. For
- # instance it was reported that on HP-UX the gcc test will end up
- # making a dummy file named 'D' -- because '-MD' means "put the output
- # in D".
- rm -rf conftest.dir
- mkdir conftest.dir
- # Copy depcomp to subdir because otherwise we won't find it if we're
- # using a relative directory.
- cp "$am_depcomp" conftest.dir
- cd conftest.dir
- # We will build objects and dependencies in a subdirectory because
- # it helps to detect inapplicable dependency modes. For instance
- # both Tru64's cc and ICC support -MD to output dependencies as a
- # side effect of compilation, but ICC will put the dependencies in
- # the current directory while Tru64 will put them in the object
- # directory.
- mkdir sub
-
- am_cv_CXX_dependencies_compiler_type=none
- if test "$am_compiler_list" = ""; then
- am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
- fi
- am__universal=false
- case " $depcc " in #(
- *\ -arch\ *\ -arch\ *) am__universal=true ;;
- esac
-
- for depmode in $am_compiler_list; do
- # Setup a source with many dependencies, because some compilers
- # like to wrap large dependency lists on column 80 (with \), and
- # we should not choose a depcomp mode which is confused by this.
- #
- # We need to recreate these files for each test, as the compiler may
- # overwrite some of them when testing with obscure command lines.
- # This happens at least with the AIX C compiler.
- : > sub/conftest.c
- for i in 1 2 3 4 5 6; do
- echo '#include "conftst'$i'.h"' >> sub/conftest.c
- # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
- # Solaris 10 /bin/sh.
- echo '/* dummy */' > sub/conftst$i.h
- done
- echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
-
- # We check with '-c' and '-o' for the sake of the "dashmstdout"
- # mode. It turns out that the SunPro C++ compiler does not properly
- # handle '-M -o', and we need to detect this. Also, some Intel
- # versions had trouble with output in subdirs.
- am__obj=sub/conftest.${OBJEXT-o}
- am__minus_obj="-o $am__obj"
- case $depmode in
- gcc)
- # This depmode causes a compiler race in universal mode.
- test "$am__universal" = false || continue
- ;;
- nosideeffect)
- # After this tag, mechanisms are not by side-effect, so they'll
- # only be used when explicitly requested.
- if test "x$enable_dependency_tracking" = xyes; then
- continue
- else
- break
- fi
- ;;
- msvc7 | msvc7msys | msvisualcpp | msvcmsys)
- # This compiler won't grok '-c -o', but also, the minuso test has
- # not run yet. These depmodes are late enough in the game, and
- # so weak that their functioning should not be impacted.
- am__obj=conftest.${OBJEXT-o}
- am__minus_obj=
- ;;
- none) break ;;
- esac
- if depmode=$depmode \
- source=sub/conftest.c object=$am__obj \
- depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
- $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
- >/dev/null 2>conftest.err &&
- grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
- grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
- grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
- ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
- # icc doesn't choke on unknown options, it will just issue warnings
- # or remarks (even with -Werror). So we grep stderr for any message
- # that says an option was ignored or not supported.
- # When given -MP, icc 7.0 and 7.1 complain thusly:
- # icc: Command line warning: ignoring option '-M'; no argument required
- # The diagnosis changed in icc 8.0:
- # icc: Command line remark: option '-MP' not supported
- if (grep 'ignoring option' conftest.err ||
- grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
- am_cv_CXX_dependencies_compiler_type=$depmode
- break
- fi
- fi
- done
-
- cd ..
- rm -rf conftest.dir
-else
- am_cv_CXX_dependencies_compiler_type=none
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CXX_dependencies_compiler_type" >&5
-$as_echo "$am_cv_CXX_dependencies_compiler_type" >&6; }
-CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type
-
- if
- test "x$enable_dependency_tracking" != xno \
- && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then
- am__fastdepCXX_TRUE=
- am__fastdepCXX_FALSE='#'
-else
- am__fastdepCXX_TRUE='#'
- am__fastdepCXX_FALSE=
-fi
-
-
-CFLAGS=$save_CFLAGS
-
-
-
-
-
-# By default we simply use the C compiler to build assembly code.
-
-test "${CCAS+set}" = set || CCAS=$CC
-test "${CCASFLAGS+set}" = set || CCASFLAGS=$CFLAGS
-
-
-
-depcc="$CCAS" am_compiler_list=
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
-$as_echo_n "checking dependency style of $depcc... " >&6; }
-if ${am_cv_CCAS_dependencies_compiler_type+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
- # We make a subdir and do the tests there. Otherwise we can end up
- # making bogus files that we don't know about and never remove. For
- # instance it was reported that on HP-UX the gcc test will end up
- # making a dummy file named 'D' -- because '-MD' means "put the output
- # in D".
- rm -rf conftest.dir
- mkdir conftest.dir
- # Copy depcomp to subdir because otherwise we won't find it if we're
- # using a relative directory.
- cp "$am_depcomp" conftest.dir
- cd conftest.dir
- # We will build objects and dependencies in a subdirectory because
- # it helps to detect inapplicable dependency modes. For instance
- # both Tru64's cc and ICC support -MD to output dependencies as a
- # side effect of compilation, but ICC will put the dependencies in
- # the current directory while Tru64 will put them in the object
- # directory.
- mkdir sub
-
- am_cv_CCAS_dependencies_compiler_type=none
- if test "$am_compiler_list" = ""; then
- am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
- fi
- am__universal=false
-
-
- for depmode in $am_compiler_list; do
- # Setup a source with many dependencies, because some compilers
- # like to wrap large dependency lists on column 80 (with \), and
- # we should not choose a depcomp mode which is confused by this.
- #
- # We need to recreate these files for each test, as the compiler may
- # overwrite some of them when testing with obscure command lines.
- # This happens at least with the AIX C compiler.
- : > sub/conftest.c
- for i in 1 2 3 4 5 6; do
- echo '#include "conftst'$i'.h"' >> sub/conftest.c
- # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
- # Solaris 10 /bin/sh.
- echo '/* dummy */' > sub/conftst$i.h
- done
- echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
-
- # We check with '-c' and '-o' for the sake of the "dashmstdout"
- # mode. It turns out that the SunPro C++ compiler does not properly
- # handle '-M -o', and we need to detect this. Also, some Intel
- # versions had trouble with output in subdirs.
- am__obj=sub/conftest.${OBJEXT-o}
- am__minus_obj="-o $am__obj"
- case $depmode in
- gcc)
- # This depmode causes a compiler race in universal mode.
- test "$am__universal" = false || continue
- ;;
- nosideeffect)
- # After this tag, mechanisms are not by side-effect, so they'll
- # only be used when explicitly requested.
- if test "x$enable_dependency_tracking" = xyes; then
- continue
- else
- break
- fi
- ;;
- msvc7 | msvc7msys | msvisualcpp | msvcmsys)
- # This compiler won't grok '-c -o', but also, the minuso test has
- # not run yet. These depmodes are late enough in the game, and
- # so weak that their functioning should not be impacted.
- am__obj=conftest.${OBJEXT-o}
- am__minus_obj=
- ;;
- none) break ;;
- esac
- if depmode=$depmode \
- source=sub/conftest.c object=$am__obj \
- depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
- $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
- >/dev/null 2>conftest.err &&
- grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
- grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
- grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
- ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
- # icc doesn't choke on unknown options, it will just issue warnings
- # or remarks (even with -Werror). So we grep stderr for any message
- # that says an option was ignored or not supported.
- # When given -MP, icc 7.0 and 7.1 complain thusly:
- # icc: Command line warning: ignoring option '-M'; no argument required
- # The diagnosis changed in icc 8.0:
- # icc: Command line remark: option '-MP' not supported
- if (grep 'ignoring option' conftest.err ||
- grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
- am_cv_CCAS_dependencies_compiler_type=$depmode
- break
- fi
- fi
- done
-
- cd ..
- rm -rf conftest.dir
-else
- am_cv_CCAS_dependencies_compiler_type=none
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CCAS_dependencies_compiler_type" >&5
-$as_echo "$am_cv_CCAS_dependencies_compiler_type" >&6; }
-CCASDEPMODE=depmode=$am_cv_CCAS_dependencies_compiler_type
-
- if
- test "x$enable_dependency_tracking" != xno \
- && test "$am_cv_CCAS_dependencies_compiler_type" = gcc3; then
- am__fastdepCCAS_TRUE=
- am__fastdepCCAS_FALSE='#'
-else
- am__fastdepCCAS_TRUE='#'
- am__fastdepCCAS_FALSE=
-fi
-
-
-if test "x$CC" != xcc; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC and cc understand -c and -o together" >&5
-$as_echo_n "checking whether $CC and cc understand -c and -o together... " >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether cc understands -c and -o together" >&5
-$as_echo_n "checking whether cc understands -c and -o together... " >&6; }
-fi
-set dummy $CC; ac_cc=`$as_echo "$2" |
- sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'`
-if eval \${ac_cv_prog_cc_${ac_cc}_c_o+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-# Make sure it works both with $CC and with simple cc.
-# We do the test twice because some compilers refuse to overwrite an
-# existing .o file with -o, though they will create one.
-ac_try='$CC -c conftest.$ac_ext -o conftest2.$ac_objext >&5'
-rm -f conftest2.*
-if { { case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; } &&
- test -f conftest2.$ac_objext && { { case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; };
-then
- eval ac_cv_prog_cc_${ac_cc}_c_o=yes
- if test "x$CC" != xcc; then
- # Test first that cc exists at all.
- if { ac_try='cc -c conftest.$ac_ext >&5'
- { { case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; }; then
- ac_try='cc -c conftest.$ac_ext -o conftest2.$ac_objext >&5'
- rm -f conftest2.*
- if { { case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; } &&
- test -f conftest2.$ac_objext && { { case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; };
- then
- # cc works too.
- :
- else
- # cc exists but doesn't like -o.
- eval ac_cv_prog_cc_${ac_cc}_c_o=no
- fi
- fi
- fi
-else
- eval ac_cv_prog_cc_${ac_cc}_c_o=no
-fi
-rm -f core conftest*
-
-fi
-if eval test \$ac_cv_prog_cc_${ac_cc}_c_o = yes; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-
-$as_echo "#define NO_MINUS_C_MINUS_O 1" >>confdefs.h
-
-fi
-
-# FIXME: we rely on the cache variable name because
-# there is no other way.
-set dummy $CC
-am_cc=`echo $2 | sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'`
-eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o
-if test "$am_t" != yes; then
- # Losing compiler, so override with the script.
- # FIXME: It is wrong to rewrite CC.
- # But if we don't then we get into trouble of one sort or another.
- # A longer-term fix would be to have automake use am__CC in this case,
- # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
- CC="$am_aux_dir/compile $CC"
-fi
-
-
-case `pwd` in
- *\ * | *\ *)
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5
-$as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;;
-esac
-
-
-
-macro_version='2.4.2.418'
-macro_revision='2.4.2.418'
-
-
-
-
-
-
-
-
-
-
-
-
-
-ltmain=$ac_aux_dir/ltmain.sh
-
-# Backslashify metacharacters that are still active within
-# double-quoted strings.
-sed_quote_subst='s/\(["`$\\]\)/\\\1/g'
-
-# Same as above, but do not quote variable references.
-double_quote_subst='s/\(["`\\]\)/\\\1/g'
-
-# Sed substitution to delay expansion of an escaped shell variable in a
-# double_quote_subst'ed string.
-delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
-
-# Sed substitution to delay expansion of an escaped single quote.
-delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
-
-# Sed substitution to avoid accidental globbing in evaled expressions
-no_glob_subst='s/\*/\\\*/g'
-
-ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
-ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
-ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5
-$as_echo_n "checking how to print strings... " >&6; }
-# Test print first, because it will be a builtin if present.
-if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
- test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
- ECHO='print -r --'
-elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
- ECHO='printf %s\n'
-else
- # Use this function as a fallback that always works.
- func_fallback_echo ()
- {
- eval 'cat <<_LTECHO_EOF
-$1
-_LTECHO_EOF'
- }
- ECHO='func_fallback_echo'
-fi
-
-# func_echo_all arg...
-# Invoke $ECHO with all args, space-separated.
-func_echo_all ()
-{
- $ECHO ""
-}
-
-case $ECHO in
- printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5
-$as_echo "printf" >&6; } ;;
- print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5
-$as_echo "print -r" >&6; } ;;
- *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5
-$as_echo "cat" >&6; } ;;
-esac
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5
-$as_echo_n "checking for a sed that does not truncate output... " >&6; }
-if ${ac_cv_path_SED+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/
- for ac_i in 1 2 3 4 5 6 7; do
- ac_script="$ac_script$as_nl$ac_script"
- done
- echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed
- { ac_script=; unset ac_script;}
- if test -z "$SED"; then
- ac_path_SED_found=false
- # Loop through the user's path and test for each of PROGNAME-LIST
- 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_prog in sed gsed; do
- for ac_exec_ext in '' $ac_executable_extensions; do
- ac_path_SED="$as_dir/$ac_prog$ac_exec_ext"
- as_fn_executable_p "$ac_path_SED" || continue
-# Check for GNU ac_path_SED and select it if it is found.
- # Check for GNU $ac_path_SED
-case `"$ac_path_SED" --version 2>&1` in
-*GNU*)
- ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;;
-*)
- ac_count=0
- $as_echo_n 0123456789 >"conftest.in"
- while :
- do
- cat "conftest.in" "conftest.in" >"conftest.tmp"
- mv "conftest.tmp" "conftest.in"
- cp "conftest.in" "conftest.nl"
- $as_echo '' >> "conftest.nl"
- "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break
- diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
- as_fn_arith $ac_count + 1 && ac_count=$as_val
- if test $ac_count -gt ${ac_path_SED_max-0}; then
- # Best one so far, save it but keep looking for a better one
- ac_cv_path_SED="$ac_path_SED"
- ac_path_SED_max=$ac_count
- fi
- # 10*(2^10) chars as input seems more than enough
- test $ac_count -gt 10 && break
- done
- rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
-esac
-
- $ac_path_SED_found && break 3
- done
- done
- done
-IFS=$as_save_IFS
- if test -z "$ac_cv_path_SED"; then
- as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5
- fi
-else
- ac_cv_path_SED=$SED
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5
-$as_echo "$ac_cv_path_SED" >&6; }
- SED="$ac_cv_path_SED"
- rm -f conftest.sed
-
-test -z "$SED" && SED=sed
-Xsed="$SED -e 1s/^X//"
-
-
-
-
-
-
-
-
-
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
-$as_echo_n "checking for grep that handles long lines and -e... " >&6; }
-if ${ac_cv_path_GREP+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -z "$GREP"; then
- ac_path_GREP_found=false
- # Loop through the user's path and test for each of PROGNAME-LIST
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_prog in grep ggrep; do
- for ac_exec_ext in '' $ac_executable_extensions; do
- ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
- as_fn_executable_p "$ac_path_GREP" || continue
-# Check for GNU ac_path_GREP and select it if it is found.
- # Check for GNU $ac_path_GREP
-case `"$ac_path_GREP" --version 2>&1` in
-*GNU*)
- ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
-*)
- ac_count=0
- $as_echo_n 0123456789 >"conftest.in"
- while :
- do
- cat "conftest.in" "conftest.in" >"conftest.tmp"
- mv "conftest.tmp" "conftest.in"
- cp "conftest.in" "conftest.nl"
- $as_echo 'GREP' >> "conftest.nl"
- "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
- diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
- as_fn_arith $ac_count + 1 && ac_count=$as_val
- if test $ac_count -gt ${ac_path_GREP_max-0}; then
- # Best one so far, save it but keep looking for a better one
- ac_cv_path_GREP="$ac_path_GREP"
- ac_path_GREP_max=$ac_count
- fi
- # 10*(2^10) chars as input seems more than enough
- test $ac_count -gt 10 && break
- done
- rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
-esac
-
- $ac_path_GREP_found && break 3
- done
- done
- done
-IFS=$as_save_IFS
- if test -z "$ac_cv_path_GREP"; then
- as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
- fi
-else
- ac_cv_path_GREP=$GREP
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
-$as_echo "$ac_cv_path_GREP" >&6; }
- GREP="$ac_cv_path_GREP"
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
-$as_echo_n "checking for egrep... " >&6; }
-if ${ac_cv_path_EGREP+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
- then ac_cv_path_EGREP="$GREP -E"
- else
- if test -z "$EGREP"; then
- ac_path_EGREP_found=false
- # Loop through the user's path and test for each of PROGNAME-LIST
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_prog in egrep; do
- for ac_exec_ext in '' $ac_executable_extensions; do
- ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
- as_fn_executable_p "$ac_path_EGREP" || continue
-# Check for GNU ac_path_EGREP and select it if it is found.
- # Check for GNU $ac_path_EGREP
-case `"$ac_path_EGREP" --version 2>&1` in
-*GNU*)
- ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
-*)
- ac_count=0
- $as_echo_n 0123456789 >"conftest.in"
- while :
- do
- cat "conftest.in" "conftest.in" >"conftest.tmp"
- mv "conftest.tmp" "conftest.in"
- cp "conftest.in" "conftest.nl"
- $as_echo 'EGREP' >> "conftest.nl"
- "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
- diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
- as_fn_arith $ac_count + 1 && ac_count=$as_val
- if test $ac_count -gt ${ac_path_EGREP_max-0}; then
- # Best one so far, save it but keep looking for a better one
- ac_cv_path_EGREP="$ac_path_EGREP"
- ac_path_EGREP_max=$ac_count
- fi
- # 10*(2^10) chars as input seems more than enough
- test $ac_count -gt 10 && break
- done
- rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
-esac
-
- $ac_path_EGREP_found && break 3
- done
- done
- done
-IFS=$as_save_IFS
- if test -z "$ac_cv_path_EGREP"; then
- as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
- fi
-else
- ac_cv_path_EGREP=$EGREP
-fi
-
- fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5
-$as_echo "$ac_cv_path_EGREP" >&6; }
- EGREP="$ac_cv_path_EGREP"
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5
-$as_echo_n "checking for fgrep... " >&6; }
-if ${ac_cv_path_FGREP+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1
- then ac_cv_path_FGREP="$GREP -F"
- else
- if test -z "$FGREP"; then
- ac_path_FGREP_found=false
- # Loop through the user's path and test for each of PROGNAME-LIST
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_prog in fgrep; do
- for ac_exec_ext in '' $ac_executable_extensions; do
- ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext"
- as_fn_executable_p "$ac_path_FGREP" || continue
-# Check for GNU ac_path_FGREP and select it if it is found.
- # Check for GNU $ac_path_FGREP
-case `"$ac_path_FGREP" --version 2>&1` in
-*GNU*)
- ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;;
-*)
- ac_count=0
- $as_echo_n 0123456789 >"conftest.in"
- while :
- do
- cat "conftest.in" "conftest.in" >"conftest.tmp"
- mv "conftest.tmp" "conftest.in"
- cp "conftest.in" "conftest.nl"
- $as_echo 'FGREP' >> "conftest.nl"
- "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break
- diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
- as_fn_arith $ac_count + 1 && ac_count=$as_val
- if test $ac_count -gt ${ac_path_FGREP_max-0}; then
- # Best one so far, save it but keep looking for a better one
- ac_cv_path_FGREP="$ac_path_FGREP"
- ac_path_FGREP_max=$ac_count
- fi
- # 10*(2^10) chars as input seems more than enough
- test $ac_count -gt 10 && break
- done
- rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
-esac
-
- $ac_path_FGREP_found && break 3
- done
- done
- done
-IFS=$as_save_IFS
- if test -z "$ac_cv_path_FGREP"; then
- as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
- fi
-else
- ac_cv_path_FGREP=$FGREP
-fi
-
- fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5
-$as_echo "$ac_cv_path_FGREP" >&6; }
- FGREP="$ac_cv_path_FGREP"
-
-
-test -z "$GREP" && GREP=grep
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-# Check whether --with-gnu-ld was given.
-if test "${with_gnu_ld+set}" = set; then :
- withval=$with_gnu_ld; test no = "$withval" || with_gnu_ld=yes
-else
- with_gnu_ld=no
-fi
-
-ac_prog=ld
-if test yes = "$GCC"; then
- # Check if gcc -print-prog-name=ld gives a path.
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5
-$as_echo_n "checking for ld used by $CC... " >&6; }
- 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.
- [\\/]* | ?:[\\/]*)
- re_direlt='/[^/][^/]*/\.\./'
- # Canonicalize the pathname 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 yes = "$with_gnu_ld"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5
-$as_echo_n "checking for GNU ld... " >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5
-$as_echo_n "checking for non-GNU ld... " >&6; }
-fi
-if ${lt_cv_path_LD+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -z "$LD"; then
- lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
- for ac_dir in $PATH; do
- IFS=$lt_save_ifs
- test -z "$ac_dir" && ac_dir=.
- if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
- lt_cv_path_LD=$ac_dir/$ac_prog
- # Check to see if the program is GNU ld. I'd rather use --version,
- # but apparently some variants of GNU ld only accept -v.
- # Break only if it was the GNU/non-GNU ld that we prefer.
- case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
- *GNU* | *'with BFD'*)
- test no != "$with_gnu_ld" && break
- ;;
- *)
- test yes != "$with_gnu_ld" && break
- ;;
- esac
- fi
- done
- IFS=$lt_save_ifs
-else
- lt_cv_path_LD=$LD # Let the user override the test with a path.
-fi
-fi
-
-LD=$lt_cv_path_LD
-if test -n "$LD"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5
-$as_echo "$LD" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5
-$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; }
-if ${lt_cv_prog_gnu_ld+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- # I'd rather use --version here, but apparently some GNU lds only accept -v.
-case `$LD -v 2>&1 </dev/null` in
-*GNU* | *'with BFD'*)
- lt_cv_prog_gnu_ld=yes
- ;;
-*)
- lt_cv_prog_gnu_ld=no
- ;;
-esac
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_gnu_ld" >&5
-$as_echo "$lt_cv_prog_gnu_ld" >&6; }
-with_gnu_ld=$lt_cv_prog_gnu_ld
-
-
-
-
-
-
-
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5
-$as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; }
-if ${lt_cv_path_NM+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$NM"; then
- # Let the user override the test.
- lt_cv_path_NM=$NM
-else
- lt_nm_to_check=${ac_tool_prefix}nm
- if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
- lt_nm_to_check="$lt_nm_to_check nm"
- fi
- for lt_tmp_nm in $lt_nm_to_check; do
- lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
- for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
- IFS=$lt_save_ifs
- test -z "$ac_dir" && ac_dir=.
- tmp_nm=$ac_dir/$lt_tmp_nm
- if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then
- # Check to see if the nm accepts a BSD-compat flag.
- # Adding the 'sed 1q' prevents false positives on HP-UX, which says:
- # nm: unknown option "B" ignored
- # Tru64's nm complains that /dev/null is an invalid object file
- case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
- */dev/null* | *'Invalid file or object type'*)
- lt_cv_path_NM="$tmp_nm -B"
- break 2
- ;;
- *)
- case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
- */dev/null*)
- lt_cv_path_NM="$tmp_nm -p"
- break 2
- ;;
- *)
- lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
- continue # so that we can try to find one that supports BSD flags
- ;;
- esac
- ;;
- esac
- fi
- done
- IFS=$lt_save_ifs
- done
- : ${lt_cv_path_NM=no}
-fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5
-$as_echo "$lt_cv_path_NM" >&6; }
-if test no != "$lt_cv_path_NM"; then
- NM=$lt_cv_path_NM
-else
- # Didn't find any BSD compatible name lister, look for dumpbin.
- if test -n "$DUMPBIN"; then :
- # Let the user override the test.
- else
- if test -n "$ac_tool_prefix"; then
- for ac_prog in dumpbin "link -dump"
- 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:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_DUMPBIN+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$DUMPBIN"; then
- ac_cv_prog_DUMPBIN="$DUMPBIN" # 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-DUMPBIN=$ac_cv_prog_DUMPBIN
-if test -n "$DUMPBIN"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5
-$as_echo "$DUMPBIN" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
- test -n "$DUMPBIN" && break
- done
-fi
-if test -z "$DUMPBIN"; then
- ac_ct_DUMPBIN=$DUMPBIN
- for ac_prog in dumpbin "link -dump"
-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:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_DUMPBIN+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$ac_ct_DUMPBIN"; then
- ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_DUMPBIN="$ac_prog"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN
-if test -n "$ac_ct_DUMPBIN"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5
-$as_echo "$ac_ct_DUMPBIN" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
- test -n "$ac_ct_DUMPBIN" && break
-done
-
- if test "x$ac_ct_DUMPBIN" = x; then
- DUMPBIN=":"
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$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
- DUMPBIN=$ac_ct_DUMPBIN
- fi
-fi
-
- case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in
- *COFF*)
- DUMPBIN="$DUMPBIN -symbols -headers"
- ;;
- *)
- DUMPBIN=:
- ;;
- esac
- fi
-
- if test : != "$DUMPBIN"; then
- NM=$DUMPBIN
- fi
-fi
-test -z "$NM" && NM=nm
-
-
-
-
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5
-$as_echo_n "checking the name lister ($NM) interface... " >&6; }
-if ${lt_cv_nm_interface+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- lt_cv_nm_interface="BSD nm"
- echo "int some_variable = 0;" > conftest.$ac_ext
- (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5)
- (eval "$ac_compile" 2>conftest.err)
- cat conftest.err >&5
- (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
- (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
- cat conftest.err >&5
- (eval echo "\"\$as_me:$LINENO: output\"" >&5)
- cat conftest.out >&5
- if $GREP 'External.*some_variable' conftest.out > /dev/null; then
- lt_cv_nm_interface="MS dumpbin"
- fi
- rm -f conftest*
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5
-$as_echo "$lt_cv_nm_interface" >&6; }
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5
-$as_echo_n "checking whether ln -s works... " >&6; }
-LN_S=$as_ln_s
-if test "$LN_S" = "ln -s"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5
-$as_echo "no, using $LN_S" >&6; }
-fi
-
-# find the maximum length of command line arguments
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5
-$as_echo_n "checking the maximum length of command line arguments... " >&6; }
-if ${lt_cv_sys_max_cmd_len+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- i=0
- teststring=ABCD
-
- case $build_os in
- msdosdjgpp*)
- # On DJGPP, this test can blow up pretty badly due to problems in libc
- # (any single argument exceeding 2000 bytes causes a buffer overrun
- # during glob expansion). Even if it were fixed, the result of this
- # check would be larger than it should be.
- lt_cv_sys_max_cmd_len=12288; # 12K is about right
- ;;
-
- gnu*)
- # Under GNU Hurd, this test is not required because there is
- # no limit to the length of command line arguments.
- # Libtool will interpret -1 as no limit whatsoever
- lt_cv_sys_max_cmd_len=-1;
- ;;
-
- cygwin* | mingw* | cegcc*)
- # On Win9x/ME, this test blows up -- it succeeds, but takes
- # about 5 minutes as the teststring grows exponentially.
- # Worse, since 9x/ME are not pre-emptively multitasking,
- # you end up with a "frozen" computer, even though with patience
- # the test eventually succeeds (with a max line length of 256k).
- # Instead, let's just punt: use the minimum linelength reported by
- # all of the supported platforms: 8192 (on NT/2K/XP).
- lt_cv_sys_max_cmd_len=8192;
- ;;
-
- mint*)
- # On MiNT this can take a long time and run out of memory.
- lt_cv_sys_max_cmd_len=8192;
- ;;
-
- amigaos*)
- # On AmigaOS with pdksh, this test takes hours, literally.
- # So we just punt and use a minimum line length of 8192.
- lt_cv_sys_max_cmd_len=8192;
- ;;
-
- bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*)
- # This has been around since 386BSD, at least. Likely further.
- if test -x /sbin/sysctl; then
- lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
- elif test -x /usr/sbin/sysctl; then
- lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
- else
- lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs
- fi
- # And add a safety zone
- lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
- lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
- ;;
-
- interix*)
- # We know the value 262144 and hardcode it with a safety zone (like BSD)
- lt_cv_sys_max_cmd_len=196608
- ;;
-
- os2*)
- # The test takes a long time on OS/2.
- lt_cv_sys_max_cmd_len=8192
- ;;
-
- osf*)
- # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
- # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
- # nice to cause kernel panics so lets avoid the loop below.
- # First set a reasonable default.
- lt_cv_sys_max_cmd_len=16384
- #
- if test -x /sbin/sysconfig; then
- case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
- *1*) lt_cv_sys_max_cmd_len=-1 ;;
- esac
- fi
- ;;
- sco3.2v5*)
- lt_cv_sys_max_cmd_len=102400
- ;;
- sysv5* | sco5v6* | sysv4.2uw2*)
- kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
- if test -n "$kargmax"; then
- lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'`
- else
- lt_cv_sys_max_cmd_len=32768
- fi
- ;;
- *)
- lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
- if test -n "$lt_cv_sys_max_cmd_len" && \
- test undefined != "$lt_cv_sys_max_cmd_len"; then
- lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
- lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
- else
- # Make teststring a little bigger before we do anything with it.
- # a 1K string should be a reasonable start.
- for i in 1 2 3 4 5 6 7 8; do
- teststring=$teststring$teststring
- done
- SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
- # If test is not a shell built-in, we'll probably end up computing a
- # maximum length that is only half of the actual maximum length, but
- # we can't tell.
- while { test X`env echo "$teststring$teststring" 2>/dev/null` \
- = "X$teststring$teststring"; } >/dev/null 2>&1 &&
- test 17 != "$i" # 1/2 MB should be enough
- do
- i=`expr $i + 1`
- teststring=$teststring$teststring
- done
- # Only check the string length outside the loop.
- lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
- teststring=
- # Add a significant safety factor because C++ compilers can tack on
- # massive amounts of additional arguments before passing them to the
- # linker. It appears as though 1/2 is a usable value.
- lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
- fi
- ;;
- esac
-
-fi
-
-if test -n "$lt_cv_sys_max_cmd_len"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5
-$as_echo "$lt_cv_sys_max_cmd_len" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
-$as_echo "none" >&6; }
-fi
-max_cmd_len=$lt_cv_sys_max_cmd_len
-
-
-
-
-
-
-: ${CP="cp -f"}
-: ${MV="mv -f"}
-: ${RM="rm -f"}
-
-if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
- lt_unset=unset
-else
- lt_unset=false
-fi
-
-
-
-
-
-# test EBCDIC or ASCII
-case `echo X|tr X '\101'` in
- A) # ASCII based system
- # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
- lt_SP2NL='tr \040 \012'
- lt_NL2SP='tr \015\012 \040\040'
- ;;
- *) # EBCDIC based system
- lt_SP2NL='tr \100 \n'
- lt_NL2SP='tr \r\n \100\100'
- ;;
-esac
-
-
-
-
-
-
-
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5
-$as_echo_n "checking how to convert $build file names to $host format... " >&6; }
-if ${lt_cv_to_host_file_cmd+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- case $host in
- *-*-mingw* )
- case $build in
- *-*-mingw* ) # actually msys
- lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
- ;;
- *-*-cygwin* )
- lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
- ;;
- * ) # otherwise, assume *nix
- lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
- ;;
- esac
- ;;
- *-*-cygwin* )
- case $build in
- *-*-mingw* ) # actually msys
- lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
- ;;
- *-*-cygwin* )
- lt_cv_to_host_file_cmd=func_convert_file_noop
- ;;
- * ) # otherwise, assume *nix
- lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
- ;;
- esac
- ;;
- * ) # unhandled hosts (and "normal" native builds)
- lt_cv_to_host_file_cmd=func_convert_file_noop
- ;;
-esac
-
-fi
-
-to_host_file_cmd=$lt_cv_to_host_file_cmd
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5
-$as_echo "$lt_cv_to_host_file_cmd" >&6; }
-
-
-
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5
-$as_echo_n "checking how to convert $build file names to toolchain format... " >&6; }
-if ${lt_cv_to_tool_file_cmd+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- #assume ordinary cross tools, or native build.
-lt_cv_to_tool_file_cmd=func_convert_file_noop
-case $host in
- *-*-mingw* )
- case $build in
- *-*-mingw* ) # actually msys
- lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
- ;;
- esac
- ;;
-esac
-
-fi
-
-to_tool_file_cmd=$lt_cv_to_tool_file_cmd
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5
-$as_echo "$lt_cv_to_tool_file_cmd" >&6; }
-
-
-
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5
-$as_echo_n "checking for $LD option to reload object files... " >&6; }
-if ${lt_cv_ld_reload_flag+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- lt_cv_ld_reload_flag='-r'
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5
-$as_echo "$lt_cv_ld_reload_flag" >&6; }
-reload_flag=$lt_cv_ld_reload_flag
-case $reload_flag in
-"" | " "*) ;;
-*) reload_flag=" $reload_flag" ;;
-esac
-reload_cmds='$LD$reload_flag -o $output$reload_objs'
-case $host_os in
- cygwin* | mingw* | pw32* | cegcc*)
- if test yes != "$GCC"; then
- reload_cmds=false
- fi
- ;;
- darwin*)
- if test yes = "$GCC"; then
- reload_cmds='$LTCC $LTCFLAGS -nostdlib $wl-r -o $output$reload_objs'
- else
- reload_cmds='$LD$reload_flag -o $output$reload_objs'
- fi
- ;;
-esac
-
-
-
-
-
-
-
-
-
-if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args.
-set dummy ${ac_tool_prefix}objdump; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_OBJDUMP+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$OBJDUMP"; then
- ac_cv_prog_OBJDUMP="$OBJDUMP" # 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-OBJDUMP=$ac_cv_prog_OBJDUMP
-if test -n "$OBJDUMP"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5
-$as_echo "$OBJDUMP" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_OBJDUMP"; then
- ac_ct_OBJDUMP=$OBJDUMP
- # Extract the first word of "objdump", so it can be a program name with args.
-set dummy objdump; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$ac_ct_OBJDUMP"; then
- ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_OBJDUMP="objdump"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP
-if test -n "$ac_ct_OBJDUMP"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5
-$as_echo "$ac_ct_OBJDUMP" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
- if test "x$ac_ct_OBJDUMP" = x; then
- OBJDUMP="false"
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$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
- OBJDUMP=$ac_ct_OBJDUMP
- fi
-else
- OBJDUMP="$ac_cv_prog_OBJDUMP"
-fi
-
-test -z "$OBJDUMP" && OBJDUMP=objdump
-
-
-
-
-
-
-
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5
-$as_echo_n "checking how to recognize dependent libraries... " >&6; }
-if ${lt_cv_deplibs_check_method+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- lt_cv_file_magic_cmd='$MAGIC_CMD'
-lt_cv_file_magic_test_file=
-lt_cv_deplibs_check_method='unknown'
-# Need to set the preceding variable on all platforms that support
-# interlibrary dependencies.
-# 'none' -- dependencies not supported.
-# 'unknown' -- same as none, but documents that we really don't know.
-# 'pass_all' -- all dependencies passed with no checks.
-# 'test_compile' -- check by making test program.
-# 'file_magic [[regex]]' -- check by looking for files in library path
-# that responds to the $file_magic_cmd with a given extended regex.
-# If you have 'file' or equivalent on your system and you're not sure
-# whether 'pass_all' will *always* work, you probably want this one.
-
-case $host_os in
-aix[4-9]*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-beos*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-bsdi[45]*)
- lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)'
- lt_cv_file_magic_cmd='/usr/bin/file -L'
- lt_cv_file_magic_test_file=/shlib/libc.so
- ;;
-
-cygwin*)
- # func_win32_libid is a shell function defined in ltmain.sh
- lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
- lt_cv_file_magic_cmd='func_win32_libid'
- ;;
-
-mingw* | pw32*)
- # Base MSYS/MinGW do not provide the 'file' command needed by
- # func_win32_libid shell function, so use a weaker test based on 'objdump',
- # unless we find 'file', for example because we are cross-compiling.
- if ( file / ) >/dev/null 2>&1; then
- lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
- lt_cv_file_magic_cmd='func_win32_libid'
- else
- # Keep this pattern in sync with the one in func_win32_libid.
- lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
- lt_cv_file_magic_cmd='$OBJDUMP -f'
- fi
- ;;
-
-cegcc*)
- # use the weaker test based on 'objdump'. See mingw*.
- lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
- lt_cv_file_magic_cmd='$OBJDUMP -f'
- ;;
-
-darwin* | rhapsody*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-freebsd* | dragonfly*)
- if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
- case $host_cpu in
- i*86 )
- # Not sure whether the presence of OpenBSD here was a mistake.
- # Let's accept both of them until this is cleared up.
- lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library'
- lt_cv_file_magic_cmd=/usr/bin/file
- lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
- ;;
- esac
- else
- lt_cv_deplibs_check_method=pass_all
- fi
- ;;
-
-haiku*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-hpux10.20* | hpux11*)
- lt_cv_file_magic_cmd=/usr/bin/file
- case $host_cpu in
- ia64*)
- lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64'
- lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
- ;;
- hppa*64*)
- lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]'
- lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
- ;;
- *)
- lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library'
- lt_cv_file_magic_test_file=/usr/lib/libc.sl
- ;;
- esac
- ;;
-
-interix[3-9]*)
- # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
- lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$'
- ;;
-
-irix5* | irix6* | nonstopux*)
- case $LD in
- *-32|*"-32 ") libmagic=32-bit;;
- *-n32|*"-n32 ") libmagic=N32;;
- *-64|*"-64 ") libmagic=64-bit;;
- *) libmagic=never-match;;
- esac
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-# This must be glibc/ELF.
-linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-netbsd*)
- if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
- lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
- else
- lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$'
- fi
- ;;
-
-newos6*)
- lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)'
- lt_cv_file_magic_cmd=/usr/bin/file
- lt_cv_file_magic_test_file=/usr/lib/libnls.so
- ;;
-
-*nto* | *qnx*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-openbsd* | bitrig*)
- if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
- lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$'
- else
- lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
- fi
- ;;
-
-osf3* | osf4* | osf5*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-rdos*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-solaris*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-sysv4 | sysv4.3*)
- case $host_vendor in
- motorola)
- lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]'
- lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
- ;;
- ncr)
- lt_cv_deplibs_check_method=pass_all
- ;;
- sequent)
- lt_cv_file_magic_cmd='/bin/file'
- lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )'
- ;;
- sni)
- lt_cv_file_magic_cmd='/bin/file'
- lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib"
- lt_cv_file_magic_test_file=/lib/libc.so
- ;;
- siemens)
- lt_cv_deplibs_check_method=pass_all
- ;;
- pc)
- lt_cv_deplibs_check_method=pass_all
- ;;
- esac
- ;;
-
-tpf*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-esac
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5
-$as_echo "$lt_cv_deplibs_check_method" >&6; }
-
-file_magic_glob=
-want_nocaseglob=no
-if test "$build" = "$host"; then
- case $host_os in
- mingw* | pw32*)
- if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
- want_nocaseglob=yes
- else
- file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"`
- fi
- ;;
- esac
-fi
-
-file_magic_cmd=$lt_cv_file_magic_cmd
-deplibs_check_method=$lt_cv_deplibs_check_method
-test -z "$deplibs_check_method" && deplibs_check_method=unknown
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-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:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_DLLTOOL+:} false; 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool"
- $as_echo "$as_me:${as_lineno-$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:${as_lineno-$LINENO}: result: $DLLTOOL" >&5
-$as_echo "$DLLTOOL" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$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:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_DLLTOOL="dlltool"
- $as_echo "$as_me:${as_lineno-$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:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5
-$as_echo "$ac_ct_DLLTOOL" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
- if test "x$ac_ct_DLLTOOL" = x; then
- DLLTOOL="false"
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$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
-
-test -z "$DLLTOOL" && DLLTOOL=dlltool
-
-
-
-
-
-
-
-
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5
-$as_echo_n "checking how to associate runtime and link libraries... " >&6; }
-if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- lt_cv_sharedlib_from_linklib_cmd='unknown'
-
-case $host_os in
-cygwin* | mingw* | pw32* | cegcc*)
- # two different shell functions defined in ltmain.sh;
- # decide which one to use based on capabilities of $DLLTOOL
- case `$DLLTOOL --help 2>&1` in
- *--identify-strict*)
- lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
- ;;
- *)
- lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
- ;;
- esac
- ;;
-*)
- # fallback: assume linklib IS sharedlib
- lt_cv_sharedlib_from_linklib_cmd=$ECHO
- ;;
-esac
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5
-$as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; }
-sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
-test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
-
-
-
-
-
-
-
-
-if test -n "$ac_tool_prefix"; then
- for ac_prog in ar
- 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:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_AR+:} false; 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_AR="$ac_tool_prefix$ac_prog"
- $as_echo "$as_me:${as_lineno-$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:${as_lineno-$LINENO}: result: $AR" >&5
-$as_echo "$AR" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
- test -n "$AR" && break
- done
-fi
-if test -z "$AR"; then
- ac_ct_AR=$AR
- for ac_prog in ar
-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:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_AR+:} false; 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_AR="$ac_prog"
- $as_echo "$as_me:${as_lineno-$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:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5
-$as_echo "$ac_ct_AR" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
- test -n "$ac_ct_AR" && break
-done
-
- if test "x$ac_ct_AR" = x; then
- AR="false"
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$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
-fi
-
-: ${AR=ar}
-: ${AR_FLAGS=cru}
-
-
-
-
-
-
-
-
-
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5
-$as_echo_n "checking for archiver @FILE support... " >&6; }
-if ${lt_cv_ar_at_file+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- lt_cv_ar_at_file=no
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- echo conftest.$ac_objext > conftest.lst
- lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5'
- { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5
- (eval $lt_ar_try) 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }
- if test 0 -eq "$ac_status"; then
- # Ensure the archiver fails upon bogus file names.
- rm -f conftest.$ac_objext libconftest.a
- { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5
- (eval $lt_ar_try) 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }
- if test 0 -ne "$ac_status"; then
- lt_cv_ar_at_file=@
- fi
- fi
- rm -f conftest.* libconftest.a
-
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5
-$as_echo "$lt_cv_ar_at_file" >&6; }
-
-if test no = "$lt_cv_ar_at_file"; then
- archiver_list_spec=
-else
- archiver_list_spec=$lt_cv_ar_at_file
-fi
-
-
-
-
-
-
-
-if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
-set dummy ${ac_tool_prefix}strip; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_STRIP+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$STRIP"; then
- ac_cv_prog_STRIP="$STRIP" # 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_STRIP="${ac_tool_prefix}strip"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-STRIP=$ac_cv_prog_STRIP
-if test -n "$STRIP"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
-$as_echo "$STRIP" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_STRIP"; then
- ac_ct_STRIP=$STRIP
- # Extract the first word of "strip", so it can be a program name with args.
-set dummy strip; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_STRIP+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$ac_ct_STRIP"; then
- ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_STRIP="strip"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
-if test -n "$ac_ct_STRIP"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
-$as_echo "$ac_ct_STRIP" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
- if test "x$ac_ct_STRIP" = x; then
- STRIP=":"
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$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
- STRIP=$ac_ct_STRIP
- fi
-else
- STRIP="$ac_cv_prog_STRIP"
-fi
-
-test -z "$STRIP" && STRIP=:
-
-
-
-
-
-
-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:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_RANLIB+:} false; 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
- $as_echo "$as_me:${as_lineno-$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:${as_lineno-$LINENO}: result: $RANLIB" >&5
-$as_echo "$RANLIB" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$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:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_RANLIB+:} false; 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_RANLIB="ranlib"
- $as_echo "$as_me:${as_lineno-$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:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5
-$as_echo "$ac_ct_RANLIB" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
- if test "x$ac_ct_RANLIB" = x; then
- RANLIB=":"
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$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
-
-test -z "$RANLIB" && RANLIB=:
-
-
-
-
-
-
-# Determine commands to create old-style static archives.
-old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
-old_postinstall_cmds='chmod 644 $oldlib'
-old_postuninstall_cmds=
-
-if test -n "$RANLIB"; then
- case $host_os in
- bitrig* | openbsd*)
- old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib"
- ;;
- *)
- old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib"
- ;;
- esac
- old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib"
-fi
-
-case $host_os in
- darwin*)
- lock_old_archive_extraction=yes ;;
- *)
- lock_old_archive_extraction=no ;;
-esac
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-# If no C compiler was specified, use CC.
-LTCC=${LTCC-"$CC"}
-
-# If no C compiler flags were specified, use CFLAGS.
-LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
-
-# Allow CC to be a program name with arguments.
-compiler=$CC
-
-
-# Check for command to grab the raw symbol name followed by C symbol from nm.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5
-$as_echo_n "checking command to parse $NM output from $compiler object... " >&6; }
-if ${lt_cv_sys_global_symbol_pipe+:} false; then :
- $as_echo_n "(cached) " >&6
-else
-
-# These are sane defaults that work on at least a few old systems.
-# [They come from Ultrix. What could be older than Ultrix?!! ;)]
-
-# Character class describing NM global symbol codes.
-symcode='[BCDEGRST]'
-
-# Regexp to match symbols that can be accessed directly from C.
-sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
-
-# Define system-specific variables.
-case $host_os in
-aix*)
- symcode='[BCDT]'
- ;;
-cygwin* | mingw* | pw32* | cegcc*)
- symcode='[ABCDGISTW]'
- ;;
-hpux*)
- if test ia64 = "$host_cpu"; then
- symcode='[ABCDEGRST]'
- fi
- ;;
-irix* | nonstopux*)
- symcode='[BCDEGRST]'
- ;;
-osf*)
- symcode='[BCDEGQRST]'
- ;;
-solaris*)
- symcode='[BDRT]'
- ;;
-sco3.2v5*)
- symcode='[DT]'
- ;;
-sysv4.2uw2*)
- symcode='[DT]'
- ;;
-sysv5* | sco5v6* | unixware* | OpenUNIX*)
- symcode='[ABDT]'
- ;;
-sysv4)
- symcode='[DFNSTU]'
- ;;
-esac
-
-# If we're using GNU nm, then use its standard symbol codes.
-case `$NM -V 2>&1` in
-*GNU* | *'with BFD'*)
- symcode='[ABCDGIRSTW]' ;;
-esac
-
-if test "$lt_cv_nm_interface" = "MS dumpbin"; then
- # Gets list of data symbols to import.
- lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'"
- # Adjust the below global symbol transforms to fixup imported variables.
- lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'"
- lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'"
- lt_c_name_lib_hook="\
- -e 's/^I .* \(lib.*\)$/ {\"\1\", (void *) 0},/p'\
- -e 's/^I .* \(.*\)$/ {\"lib\1\", (void *) 0},/p'"
-else
- # Disable hooks by default.
- lt_cv_sys_global_symbol_to_import=
- lt_cdecl_hook=
- lt_c_name_hook=
- lt_c_name_lib_hook=
-fi
-
-# Transform an extracted symbol line into a proper C declaration.
-# Some systems (esp. on ia64) link data and code symbols differently,
-# so use this general approach.
-lt_cv_sys_global_symbol_to_cdecl="sed -n"\
-$lt_cdecl_hook\
-" -e 's/^T .* \(.*\)$/extern int \1();/p'"\
-" -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'"
-
-# Transform an extracted symbol line into symbol name and symbol address
-lt_cv_sys_global_symbol_to_c_name_address="sed -n"\
-$lt_c_name_hook\
-" -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\
-" -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'"
-
-# Transform an extracted symbol line into symbol name with lib prefix and
-# symbol address.
-lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\
-$lt_c_name_lib_hook\
-" -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\
-" -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\
-" -e 's/^$symcode$symcode* .* \(.*\)$/ {\"lib\1\", (void *) \&\1},/p'"
-
-# Handle CRLF in mingw tool chain
-opt_cr=
-case $build_os in
-mingw*)
- opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
- ;;
-esac
-
-# Try without a prefix underscore, then with it.
-for ac_symprfx in "" "_"; do
-
- # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
- symxfrm="\\1 $ac_symprfx\\2 \\2"
-
- # Write the raw and C identifiers.
- if test "$lt_cv_nm_interface" = "MS dumpbin"; then
- # Fake it for dumpbin and say T for any non-static function,
- # D for any global variable and I for any imported variable.
- # Also find C++ and __fastcall symbols from MSVC++,
- # which start with @ or ?.
- lt_cv_sys_global_symbol_pipe="$AWK '"\
-" {last_section=section; section=\$ 3};"\
-" /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\
-" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
-" /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\
-" /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\
-" /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\
-" \$ 0!~/External *\|/{next};"\
-" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
-" {if(hide[section]) next};"\
-" {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\
-" {split(\$ 0,a,/\||\r/); split(a[2],s)};"\
-" s[1]~/^[@?]/{print f,s[1],s[1]; next};"\
-" s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\
-" ' prfx=^$ac_symprfx"
- else
- lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
- fi
- lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
-
- # Check to see that the pipe works correctly.
- pipe_works=no
-
- rm -f conftest*
- cat > conftest.$ac_ext <<_LT_EOF
-#ifdef __cplusplus
-extern "C" {
-#endif
-char nm_test_var;
-void nm_test_func(void);
-void nm_test_func(void){}
-#ifdef __cplusplus
-}
-#endif
-int main(){nm_test_var='a';nm_test_func();return(0);}
-_LT_EOF
-
- if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
- (eval $ac_compile) 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; then
- # Now try to grab the symbols.
- nlist=conftest.nm
- if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5
- (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; } && test -s "$nlist"; then
- # Try sorting and uniquifying the output.
- if sort "$nlist" | uniq > "$nlist"T; then
- mv -f "$nlist"T "$nlist"
- else
- rm -f "$nlist"T
- fi
-
- # Make sure that we snagged all the symbols we need.
- if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
- if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
- cat <<_LT_EOF > conftest.$ac_ext
-/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */
-#if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE
-/* DATA imports from DLLs on WIN32 can't be const, because runtime
- relocations are performed -- see ld's documentation on pseudo-relocs. */
-# define LT_DLSYM_CONST
-#elif defined __osf__
-/* This system does not cope well with relocations in const data. */
-# define LT_DLSYM_CONST
-#else
-# define LT_DLSYM_CONST const
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-_LT_EOF
- # Now generate the symbol file.
- eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
-
- cat <<_LT_EOF >> conftest.$ac_ext
-
-/* The mapping between symbol names and symbols. */
-LT_DLSYM_CONST struct {
- const char *name;
- void *address;
-}
-lt__PROGRAM__LTX_preloaded_symbols[] =
-{
- { "@PROGRAM@", (void *) 0 },
-_LT_EOF
- $SED "s/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
- cat <<\_LT_EOF >> conftest.$ac_ext
- {0, (void *) 0}
-};
-
-/* This works around a problem in FreeBSD linker */
-#ifdef FREEBSD_WORKAROUND
-static const void *lt_preloaded_setup() {
- return lt__PROGRAM__LTX_preloaded_symbols;
-}
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-_LT_EOF
- # Now try linking the two files.
- mv conftest.$ac_objext conftstm.$ac_objext
- lt_globsym_save_LIBS=$LIBS
- lt_globsym_save_CFLAGS=$CFLAGS
- LIBS=conftstm.$ac_objext
- CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag"
- if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
- (eval $ac_link) 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; } && test -s conftest$ac_exeext; then
- pipe_works=yes
- fi
- LIBS=$lt_globsym_save_LIBS
- CFLAGS=$lt_globsym_save_CFLAGS
- else
- echo "cannot find nm_test_func in $nlist" >&5
- fi
- else
- echo "cannot find nm_test_var in $nlist" >&5
- fi
- else
- echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5
- fi
- else
- echo "$progname: failed program was:" >&5
- cat conftest.$ac_ext >&5
- fi
- rm -rf conftest* conftst*
-
- # Do not use the global_symbol_pipe unless it works.
- if test yes = "$pipe_works"; then
- break
- else
- lt_cv_sys_global_symbol_pipe=
- fi
-done
-
-fi
-
-if test -z "$lt_cv_sys_global_symbol_pipe"; then
- lt_cv_sys_global_symbol_to_cdecl=
-fi
-if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5
-$as_echo "failed" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
-$as_echo "ok" >&6; }
-fi
-
-# Response file support.
-if test "$lt_cv_nm_interface" = "MS dumpbin"; then
- nm_file_list_spec='@'
-elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then
- nm_file_list_spec='@'
-fi
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
-$as_echo_n "checking for sysroot... " >&6; }
-
-# Check whether --with-sysroot was given.
-if test "${with_sysroot+set}" = set; then :
- withval=$with_sysroot;
-else
- with_sysroot=no
-fi
-
-
-lt_sysroot=
-case $with_sysroot in #(
- yes)
- if test yes = "$GCC"; then
- lt_sysroot=`$CC --print-sysroot 2>/dev/null`
- fi
- ;; #(
- /*)
- lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
- ;; #(
- no|'')
- ;; #(
- *)
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_sysroot" >&5
-$as_echo "$with_sysroot" >&6; }
- as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5
- ;;
-esac
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5
-$as_echo "${lt_sysroot:-no}" >&6; }
-
-
-
-
-
-# Check whether --enable-libtool-lock was given.
-if test "${enable_libtool_lock+set}" = set; then :
- enableval=$enable_libtool_lock;
-fi
-
-test no = "$enable_libtool_lock" || enable_libtool_lock=yes
-
-# Some flags need to be propagated to the compiler or linker for good
-# libtool support.
-case $host in
-ia64-*-hpux*)
- # Find out what ABI is being produced by ac_compile, and set mode
- # options accordingly.
- echo 'int i;' > conftest.$ac_ext
- if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
- (eval $ac_compile) 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; then
- case `/usr/bin/file conftest.$ac_objext` in
- *ELF-32*)
- HPUX_IA64_MODE=32
- ;;
- *ELF-64*)
- HPUX_IA64_MODE=64
- ;;
- esac
- fi
- rm -rf conftest*
- ;;
-*-*-irix6*)
- # Find out what ABI is being produced by ac_compile, and set linker
- # options accordingly.
- echo '#line '$LINENO' "configure"' > conftest.$ac_ext
- if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
- (eval $ac_compile) 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; then
- if test yes = "$lt_cv_prog_gnu_ld"; then
- case `/usr/bin/file conftest.$ac_objext` in
- *32-bit*)
- LD="${LD-ld} -melf32bsmip"
- ;;
- *N32*)
- LD="${LD-ld} -melf32bmipn32"
- ;;
- *64-bit*)
- LD="${LD-ld} -melf64bmip"
- ;;
- esac
- else
- case `/usr/bin/file conftest.$ac_objext` in
- *32-bit*)
- LD="${LD-ld} -32"
- ;;
- *N32*)
- LD="${LD-ld} -n32"
- ;;
- *64-bit*)
- LD="${LD-ld} -64"
- ;;
- esac
- fi
- fi
- rm -rf conftest*
- ;;
-
-mips64*-*linux*)
- # Find out what ABI is being produced by ac_compile, and set linker
- # options accordingly.
- echo '#line '$LINENO' "configure"' > conftest.$ac_ext
- if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
- (eval $ac_compile) 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; then
- emul=elf
- case `/usr/bin/file conftest.$ac_objext` in
- *32-bit*)
- emul="${emul}32"
- ;;
- *64-bit*)
- emul="${emul}64"
- ;;
- esac
- case `/usr/bin/file conftest.$ac_objext` in
- *MSB*)
- emul="${emul}btsmip"
- ;;
- *LSB*)
- emul="${emul}ltsmip"
- ;;
- esac
- case `/usr/bin/file conftest.$ac_objext` in
- *N32*)
- emul="${emul}n32"
- ;;
- esac
- LD="${LD-ld} -m $emul"
- fi
- rm -rf conftest*
- ;;
-
-x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \
-s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
- # Find out what ABI is being produced by ac_compile, and set linker
- # options accordingly. Note that the listed cases only cover the
- # situations where additional linker options are needed (such as when
- # doing 32-bit compilation for a host where ld defaults to 64-bit, or
- # vice versa); the common cases where no linker options are needed do
- # not appear in the list.
- echo 'int i;' > conftest.$ac_ext
- if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
- (eval $ac_compile) 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; then
- case `/usr/bin/file conftest.o` in
- *32-bit*)
- case $host in
- x86_64-*kfreebsd*-gnu)
- LD="${LD-ld} -m elf_i386_fbsd"
- ;;
- x86_64-*linux*)
- case `/usr/bin/file conftest.o` in
- *x86-64*)
- LD="${LD-ld} -m elf32_x86_64"
- ;;
- *)
- LD="${LD-ld} -m elf_i386"
- ;;
- esac
- ;;
- powerpc64le-*linux*)
- LD="${LD-ld} -m elf32lppclinux"
- ;;
- powerpc64-*linux*)
- LD="${LD-ld} -m elf32ppclinux"
- ;;
- s390x-*linux*)
- LD="${LD-ld} -m elf_s390"
- ;;
- sparc64-*linux*)
- LD="${LD-ld} -m elf32_sparc"
- ;;
- esac
- ;;
- *64-bit*)
- case $host in
- x86_64-*kfreebsd*-gnu)
- LD="${LD-ld} -m elf_x86_64_fbsd"
- ;;
- x86_64-*linux*)
- LD="${LD-ld} -m elf_x86_64"
- ;;
- powerpcle-*linux*)
- LD="${LD-ld} -m elf64lppc"
- ;;
- powerpc-*linux*)
- LD="${LD-ld} -m elf64ppc"
- ;;
- s390*-*linux*|s390*-*tpf*)
- LD="${LD-ld} -m elf64_s390"
- ;;
- sparc*-*linux*)
- LD="${LD-ld} -m elf64_sparc"
- ;;
- esac
- ;;
- esac
- fi
- rm -rf conftest*
- ;;
-
-*-*-sco3.2v5*)
- # On SCO OpenServer 5, we need -belf to get full-featured binaries.
- SAVE_CFLAGS=$CFLAGS
- CFLAGS="$CFLAGS -belf"
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5
-$as_echo_n "checking whether the C compiler needs -belf... " >&6; }
-if ${lt_cv_cc_needs_belf+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- 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
-
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- lt_cv_cc_needs_belf=yes
-else
- lt_cv_cc_needs_belf=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
- 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
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5
-$as_echo "$lt_cv_cc_needs_belf" >&6; }
- if test yes != "$lt_cv_cc_needs_belf"; then
- # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
- CFLAGS=$SAVE_CFLAGS
- fi
- ;;
-*-*solaris*)
- # Find out what ABI is being produced by ac_compile, and set linker
- # options accordingly.
- echo 'int i;' > conftest.$ac_ext
- if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
- (eval $ac_compile) 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; then
- case `/usr/bin/file conftest.o` in
- *64-bit*)
- case $lt_cv_prog_gnu_ld in
- yes*)
- case $host in
- i?86-*-solaris*|x86_64-*-solaris*)
- LD="${LD-ld} -m elf_x86_64"
- ;;
- sparc*-*-solaris*)
- LD="${LD-ld} -m elf64_sparc"
- ;;
- esac
- # GNU ld 2.21 introduced _sol2 emulations. Use them if available.
- if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then
- LD=${LD-ld}_sol2
- fi
- ;;
- *)
- if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
- LD="${LD-ld} -64"
- fi
- ;;
- esac
- ;;
- esac
- fi
- rm -rf conftest*
- ;;
-esac
-
-need_locks=$enable_libtool_lock
-
-if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args.
-set dummy ${ac_tool_prefix}mt; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_MANIFEST_TOOL+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$MANIFEST_TOOL"; then
- ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL
-if test -n "$MANIFEST_TOOL"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5
-$as_echo "$MANIFEST_TOOL" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_MANIFEST_TOOL"; then
- ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL
- # Extract the first word of "mt", so it can be a program name with args.
-set dummy mt; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_MANIFEST_TOOL+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$ac_ct_MANIFEST_TOOL"; then
- ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_MANIFEST_TOOL="mt"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL
-if test -n "$ac_ct_MANIFEST_TOOL"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5
-$as_echo "$ac_ct_MANIFEST_TOOL" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
- if test "x$ac_ct_MANIFEST_TOOL" = x; then
- MANIFEST_TOOL=":"
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$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
- MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL
- fi
-else
- MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL"
-fi
-
-test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5
-$as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; }
-if ${lt_cv_path_mainfest_tool+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- lt_cv_path_mainfest_tool=no
- echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5
- $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
- cat conftest.err >&5
- if $GREP 'Manifest Tool' conftest.out > /dev/null; then
- lt_cv_path_mainfest_tool=yes
- fi
- rm -f conftest*
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5
-$as_echo "$lt_cv_path_mainfest_tool" >&6; }
-if test yes != "$lt_cv_path_mainfest_tool"; then
- MANIFEST_TOOL=:
-fi
-
-
-
-
-
-
- case $host_os in
- rhapsody* | darwin*)
- if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args.
-set dummy ${ac_tool_prefix}dsymutil; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_DSYMUTIL+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$DSYMUTIL"; then
- ac_cv_prog_DSYMUTIL="$DSYMUTIL" # 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-DSYMUTIL=$ac_cv_prog_DSYMUTIL
-if test -n "$DSYMUTIL"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5
-$as_echo "$DSYMUTIL" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_DSYMUTIL"; then
- ac_ct_DSYMUTIL=$DSYMUTIL
- # Extract the first word of "dsymutil", so it can be a program name with args.
-set dummy dsymutil; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_DSYMUTIL+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$ac_ct_DSYMUTIL"; then
- ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_DSYMUTIL="dsymutil"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL
-if test -n "$ac_ct_DSYMUTIL"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5
-$as_echo "$ac_ct_DSYMUTIL" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
- if test "x$ac_ct_DSYMUTIL" = x; then
- DSYMUTIL=":"
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$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
- DSYMUTIL=$ac_ct_DSYMUTIL
- fi
-else
- DSYMUTIL="$ac_cv_prog_DSYMUTIL"
-fi
-
- if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args.
-set dummy ${ac_tool_prefix}nmedit; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_NMEDIT+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$NMEDIT"; then
- ac_cv_prog_NMEDIT="$NMEDIT" # 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-NMEDIT=$ac_cv_prog_NMEDIT
-if test -n "$NMEDIT"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5
-$as_echo "$NMEDIT" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_NMEDIT"; then
- ac_ct_NMEDIT=$NMEDIT
- # Extract the first word of "nmedit", so it can be a program name with args.
-set dummy nmedit; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_NMEDIT+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$ac_ct_NMEDIT"; then
- ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_NMEDIT="nmedit"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT
-if test -n "$ac_ct_NMEDIT"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5
-$as_echo "$ac_ct_NMEDIT" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
- if test "x$ac_ct_NMEDIT" = x; then
- NMEDIT=":"
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$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
- NMEDIT=$ac_ct_NMEDIT
- fi
-else
- NMEDIT="$ac_cv_prog_NMEDIT"
-fi
-
- if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args.
-set dummy ${ac_tool_prefix}lipo; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_LIPO+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$LIPO"; then
- ac_cv_prog_LIPO="$LIPO" # 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_LIPO="${ac_tool_prefix}lipo"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-LIPO=$ac_cv_prog_LIPO
-if test -n "$LIPO"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5
-$as_echo "$LIPO" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_LIPO"; then
- ac_ct_LIPO=$LIPO
- # Extract the first word of "lipo", so it can be a program name with args.
-set dummy lipo; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_LIPO+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$ac_ct_LIPO"; then
- ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_LIPO="lipo"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO
-if test -n "$ac_ct_LIPO"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5
-$as_echo "$ac_ct_LIPO" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
- if test "x$ac_ct_LIPO" = x; then
- LIPO=":"
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$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
- LIPO=$ac_ct_LIPO
- fi
-else
- LIPO="$ac_cv_prog_LIPO"
-fi
-
- if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args.
-set dummy ${ac_tool_prefix}otool; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_OTOOL+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$OTOOL"; then
- ac_cv_prog_OTOOL="$OTOOL" # 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_OTOOL="${ac_tool_prefix}otool"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-OTOOL=$ac_cv_prog_OTOOL
-if test -n "$OTOOL"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5
-$as_echo "$OTOOL" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_OTOOL"; then
- ac_ct_OTOOL=$OTOOL
- # Extract the first word of "otool", so it can be a program name with args.
-set dummy otool; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_OTOOL+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$ac_ct_OTOOL"; then
- ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_OTOOL="otool"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL
-if test -n "$ac_ct_OTOOL"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5
-$as_echo "$ac_ct_OTOOL" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
- if test "x$ac_ct_OTOOL" = x; then
- OTOOL=":"
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$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
- OTOOL=$ac_ct_OTOOL
- fi
-else
- OTOOL="$ac_cv_prog_OTOOL"
-fi
-
- if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args.
-set dummy ${ac_tool_prefix}otool64; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_OTOOL64+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$OTOOL64"; then
- ac_cv_prog_OTOOL64="$OTOOL64" # 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-OTOOL64=$ac_cv_prog_OTOOL64
-if test -n "$OTOOL64"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5
-$as_echo "$OTOOL64" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_OTOOL64"; then
- ac_ct_OTOOL64=$OTOOL64
- # Extract the first word of "otool64", so it can be a program name with args.
-set dummy otool64; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_OTOOL64+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$ac_ct_OTOOL64"; then
- ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_OTOOL64="otool64"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64
-if test -n "$ac_ct_OTOOL64"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5
-$as_echo "$ac_ct_OTOOL64" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
- if test "x$ac_ct_OTOOL64" = x; then
- OTOOL64=":"
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$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
- OTOOL64=$ac_ct_OTOOL64
- fi
-else
- OTOOL64="$ac_cv_prog_OTOOL64"
-fi
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5
-$as_echo_n "checking for -single_module linker flag... " >&6; }
-if ${lt_cv_apple_cc_single_mod+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- lt_cv_apple_cc_single_mod=no
- if test -z "$LT_MULTI_MODULE"; then
- # By default we will add the -single_module flag. You can override
- # by either setting the environment variable LT_MULTI_MODULE
- # non-empty at configure time, or by adding -multi_module to the
- # link flags.
- rm -rf libconftest.dylib*
- echo "int foo(void){return 1;}" > conftest.c
- echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
--dynamiclib -Wl,-single_module conftest.c" >&5
- $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
- -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
- _lt_result=$?
- # If there is a non-empty error log, and "single_module"
- # appears in it, assume the flag caused a linker warning
- if test -s conftest.err && $GREP single_module conftest.err; then
- cat conftest.err >&5
- # Otherwise, if the output was created with a 0 exit code from
- # the compiler, it worked.
- elif test -f libconftest.dylib && test 0 = "$_lt_result"; then
- lt_cv_apple_cc_single_mod=yes
- else
- cat conftest.err >&5
- fi
- rm -rf libconftest.dylib*
- rm -f conftest.*
- fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5
-$as_echo "$lt_cv_apple_cc_single_mod" >&6; }
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5
-$as_echo_n "checking for -exported_symbols_list linker flag... " >&6; }
-if ${lt_cv_ld_exported_symbols_list+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- lt_cv_ld_exported_symbols_list=no
- save_LDFLAGS=$LDFLAGS
- echo "_main" > conftest.sym
- LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- lt_cv_ld_exported_symbols_list=yes
-else
- lt_cv_ld_exported_symbols_list=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
- LDFLAGS=$save_LDFLAGS
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5
-$as_echo "$lt_cv_ld_exported_symbols_list" >&6; }
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5
-$as_echo_n "checking for -force_load linker flag... " >&6; }
-if ${lt_cv_ld_force_load+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- lt_cv_ld_force_load=no
- cat > conftest.c << _LT_EOF
-int forced_loaded() { return 2;}
-_LT_EOF
- echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5
- $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5
- echo "$AR cru libconftest.a conftest.o" >&5
- $AR cru libconftest.a conftest.o 2>&5
- echo "$RANLIB libconftest.a" >&5
- $RANLIB libconftest.a 2>&5
- cat > conftest.c << _LT_EOF
-int main() { return 0;}
-_LT_EOF
- echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5
- $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
- _lt_result=$?
- if test -s conftest.err && $GREP force_load conftest.err; then
- cat conftest.err >&5
- elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then
- lt_cv_ld_force_load=yes
- else
- cat conftest.err >&5
- fi
- rm -f conftest.err libconftest.a conftest conftest.c
- rm -rf conftest.dSYM
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5
-$as_echo "$lt_cv_ld_force_load" >&6; }
- case $host_os in
- rhapsody* | darwin1.[012])
- _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;;
- darwin1.*)
- _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
- darwin*) # darwin 5.x on
- # if running on 10.5 or later, the deployment target defaults
- # to the OS version, if on x86, and 10.4, the deployment
- # target defaults to 10.4. Don't you love it?
- case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
- 10.0,*86*-darwin8*|10.0,*-darwin[91]*)
- _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
- 10.[012]*)
- _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
- 10.*)
- _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
- esac
- ;;
- esac
- if test yes = "$lt_cv_apple_cc_single_mod"; then
- _lt_dar_single_mod='$single_module'
- fi
- if test yes = "$lt_cv_ld_exported_symbols_list"; then
- _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym'
- else
- _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib'
- fi
- if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then
- _lt_dsymutil='~$DSYMUTIL $lib || :'
- else
- _lt_dsymutil=
- fi
- ;;
- 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
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5
-$as_echo_n "checking how to run the C preprocessor... " >&6; }
-# On Suns, sometimes $CPP names a directory.
-if test -n "$CPP" && test -d "$CPP"; then
- CPP=
-fi
-if test -z "$CPP"; then
- if ${ac_cv_prog_CPP+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- # Double quotes because CPP needs to be expanded
- for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
- do
- ac_preproc_ok=false
-for ac_c_preproc_warn_flag in '' yes
-do
- # Use a header file that comes with gcc, so configuring glibc
- # with a fresh cross-compiler works.
- # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- # <limits.h> exists even on freestanding compilers.
- # On the NeXT, cc -E runs the code through the compiler's parser,
- # not just through cpp. "Syntax error" is here to catch this case.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
- Syntax error
-_ACEOF
-if ac_fn_c_try_cpp "$LINENO"; then :
-
-else
- # Broken: fails on valid input.
-continue
-fi
-rm -f conftest.err conftest.i conftest.$ac_ext
-
- # OK, works on sane cases. Now check whether nonexistent headers
- # can be detected and how.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <ac_nonexistent.h>
-_ACEOF
-if ac_fn_c_try_cpp "$LINENO"; then :
- # Broken: success on invalid input.
-continue
-else
- # Passes both tests.
-ac_preproc_ok=:
-break
-fi
-rm -f conftest.err conftest.i conftest.$ac_ext
-
-done
-# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.i conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then :
- break
-fi
-
- done
- ac_cv_prog_CPP=$CPP
-
-fi
- CPP=$ac_cv_prog_CPP
-else
- ac_cv_prog_CPP=$CPP
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5
-$as_echo "$CPP" >&6; }
-ac_preproc_ok=false
-for ac_c_preproc_warn_flag in '' yes
-do
- # Use a header file that comes with gcc, so configuring glibc
- # with a fresh cross-compiler works.
- # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- # <limits.h> exists even on freestanding compilers.
- # On the NeXT, cc -E runs the code through the compiler's parser,
- # not just through cpp. "Syntax error" is here to catch this case.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
- Syntax error
-_ACEOF
-if ac_fn_c_try_cpp "$LINENO"; then :
-
-else
- # Broken: fails on valid input.
-continue
-fi
-rm -f conftest.err conftest.i conftest.$ac_ext
-
- # OK, works on sane cases. Now check whether nonexistent headers
- # can be detected and how.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <ac_nonexistent.h>
-_ACEOF
-if ac_fn_c_try_cpp "$LINENO"; then :
- # Broken: success on invalid input.
-continue
-else
- # Passes both tests.
-ac_preproc_ok=:
-break
-fi
-rm -f conftest.err conftest.i conftest.$ac_ext
-
-done
-# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.i conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then :
-
-else
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
-See \`config.log' for more details" "$LINENO" 5; }
-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:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
-$as_echo_n "checking for ANSI C header files... " >&6; }
-if ${ac_cv_header_stdc+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <stdlib.h>
-#include <stdarg.h>
-#include <string.h>
-#include <float.h>
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_header_stdc=yes
-else
- ac_cv_header_stdc=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-if test $ac_cv_header_stdc = yes; then
- # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <string.h>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- $EGREP "memchr" >/dev/null 2>&1; then :
-
-else
- ac_cv_header_stdc=no
-fi
-rm -f conftest*
-
-fi
-
-if test $ac_cv_header_stdc = yes; then
- # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <stdlib.h>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- $EGREP "free" >/dev/null 2>&1; then :
-
-else
- ac_cv_header_stdc=no
-fi
-rm -f conftest*
-
-fi
-
-if test $ac_cv_header_stdc = yes; then
- # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
- if test "$cross_compiling" = yes; then :
- :
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <ctype.h>
-#include <stdlib.h>
-#if ((' ' & 0x0FF) == 0x020)
-# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
-# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
-#else
-# define ISLOWER(c) \
- (('a' <= (c) && (c) <= 'i') \
- || ('j' <= (c) && (c) <= 'r') \
- || ('s' <= (c) && (c) <= 'z'))
-# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
-#endif
-
-#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
-int
-main ()
-{
- int i;
- for (i = 0; i < 256; i++)
- if (XOR (islower (i), ISLOWER (i))
- || toupper (i) != TOUPPER (i))
- return 2;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-
-else
- ac_cv_header_stdc=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
- conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
-fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
-$as_echo "$ac_cv_header_stdc" >&6; }
-if test $ac_cv_header_stdc = yes; then
-
-$as_echo "#define STDC_HEADERS 1" >>confdefs.h
-
-fi
-
-# On IRIX 5.3, sys/types and inttypes.h are conflicting.
-for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
- inttypes.h stdint.h unistd.h
-do :
- as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
-"
-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
- cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-
-for ac_header in dlfcn.h
-do :
- ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default
-"
-if test "x$ac_cv_header_dlfcn_h" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_DLFCN_H 1
-_ACEOF
-
-fi
-
-done
-
-
-
-
-func_stripname_cnf ()
-{
- case $2 in
- .*) func_stripname_result=`$ECHO "$3" | $SED "s%^$1%%; s%\\\\$2\$%%"`;;
- *) func_stripname_result=`$ECHO "$3" | $SED "s%^$1%%; s%$2\$%%"`;;
- esac
-} # func_stripname_cnf
-
-
-
-
-
-# Set options
-
-
-
- enable_dlopen=no
-
-
- enable_win32_dll=no
-
-
- # Check whether --enable-shared was given.
-if test "${enable_shared+set}" = set; then :
- enableval=$enable_shared; p=${PACKAGE-default}
- case $enableval in
- yes) enable_shared=yes ;;
- no) enable_shared=no ;;
- *)
- enable_shared=no
- # Look at the argument we got. We use all the common list separators.
- lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
- for pkg in $enableval; do
- IFS=$lt_save_ifs
- if test "X$pkg" = "X$p"; then
- enable_shared=yes
- fi
- done
- IFS=$lt_save_ifs
- ;;
- esac
-else
- enable_shared=yes
-fi
-
-
-
-
-
-
-
-
-
- # Check whether --enable-static was given.
-if test "${enable_static+set}" = set; then :
- enableval=$enable_static; p=${PACKAGE-default}
- case $enableval in
- yes) enable_static=yes ;;
- no) enable_static=no ;;
- *)
- enable_static=no
- # Look at the argument we got. We use all the common list separators.
- lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
- for pkg in $enableval; do
- IFS=$lt_save_ifs
- if test "X$pkg" = "X$p"; then
- enable_static=yes
- fi
- done
- IFS=$lt_save_ifs
- ;;
- esac
-else
- enable_static=yes
-fi
-
-
-
-
-
-
-
-
-
-
-# Check whether --with-pic was given.
-if test "${with_pic+set}" = set; then :
- withval=$with_pic; lt_p=${PACKAGE-default}
- case $withval in
- yes|no) pic_mode=$withval ;;
- *)
- pic_mode=default
- # Look at the argument we got. We use all the common list separators.
- lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
- for lt_pkg in $withval; do
- IFS=$lt_save_ifs
- if test "X$lt_pkg" = "X$lt_p"; then
- pic_mode=yes
- fi
- done
- IFS=$lt_save_ifs
- ;;
- esac
-else
- pic_mode=default
-fi
-
-
-
-
-
-
-
-
- # Check whether --enable-fast-install was given.
-if test "${enable_fast_install+set}" = set; then :
- enableval=$enable_fast_install; p=${PACKAGE-default}
- case $enableval in
- yes) enable_fast_install=yes ;;
- no) enable_fast_install=no ;;
- *)
- enable_fast_install=no
- # Look at the argument we got. We use all the common list separators.
- lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
- for pkg in $enableval; do
- IFS=$lt_save_ifs
- if test "X$pkg" = "X$p"; then
- enable_fast_install=yes
- fi
- done
- IFS=$lt_save_ifs
- ;;
- esac
-else
- enable_fast_install=yes
-fi
-
-
-
-
-
-
-
-
-
-
-
-# This can be used to rebuild libtool when needed
-LIBTOOL_DEPS=$ltmain
-
-# Always use our own libtool.
-LIBTOOL='$(SHELL) $(top_builddir)/libtool'
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-test -z "$LN_S" && LN_S="ln -s"
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-if test -n "${ZSH_VERSION+set}"; then
- setopt NO_GLOB_SUBST
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5
-$as_echo_n "checking for objdir... " >&6; }
-if ${lt_cv_objdir+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- rm -f .libs 2>/dev/null
-mkdir .libs 2>/dev/null
-if test -d .libs; then
- lt_cv_objdir=.libs
-else
- # MS-DOS does not allow filenames that begin with a dot.
- lt_cv_objdir=_libs
-fi
-rmdir .libs 2>/dev/null
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5
-$as_echo "$lt_cv_objdir" >&6; }
-objdir=$lt_cv_objdir
-
-
-
-
-
-cat >>confdefs.h <<_ACEOF
-#define LT_OBJDIR "$lt_cv_objdir/"
-_ACEOF
-
-
-
-
-case $host_os in
-aix3*)
- # AIX sometimes has problems with the GCC collect2 program. For some
- # reason, if we set the COLLECT_NAMES environment variable, the problems
- # vanish in a puff of smoke.
- if test set != "${COLLECT_NAMES+set}"; then
- COLLECT_NAMES=
- export COLLECT_NAMES
- fi
- ;;
-esac
-
-# Global variables:
-ofile=libtool
-can_build_shared=yes
-
-# All known linkers require a '.a' archive for static linking (except MSVC,
-# which needs '.lib').
-libext=a
-
-with_gnu_ld=$lt_cv_prog_gnu_ld
-
-old_CC=$CC
-old_CFLAGS=$CFLAGS
-
-# Set sane defaults for various variables
-test -z "$CC" && CC=cc
-test -z "$LTCC" && LTCC=$CC
-test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
-test -z "$LD" && LD=ld
-test -z "$ac_objext" && ac_objext=o
-
-for cc_temp in $compiler""; do
- case $cc_temp in
- compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
- distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
- \-*) ;;
- *) break;;
- esac
-done
-cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
-
-
-# Only perform the check for file, if the check method requires it
-test -z "$MAGIC_CMD" && MAGIC_CMD=file
-case $deplibs_check_method in
-file_magic*)
- if test "$file_magic_cmd" = '$MAGIC_CMD'; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5
-$as_echo_n "checking for ${ac_tool_prefix}file... " >&6; }
-if ${lt_cv_path_MAGIC_CMD+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- case $MAGIC_CMD in
-[\\/*] | ?:[\\/]*)
- lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path.
- ;;
-*)
- lt_save_MAGIC_CMD=$MAGIC_CMD
- lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
- ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
- for ac_dir in $ac_dummy; do
- IFS=$lt_save_ifs
- test -z "$ac_dir" && ac_dir=.
- if test -f "$ac_dir/${ac_tool_prefix}file"; then
- lt_cv_path_MAGIC_CMD=$ac_dir/"${ac_tool_prefix}file"
- if test -n "$file_magic_test_file"; then
- case $deplibs_check_method in
- "file_magic "*)
- file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
- MAGIC_CMD=$lt_cv_path_MAGIC_CMD
- if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
- $EGREP "$file_magic_regex" > /dev/null; then
- :
- else
- cat <<_LT_EOF 1>&2
-
-*** Warning: the command libtool uses to detect shared libraries,
-*** $file_magic_cmd, produces output that libtool cannot recognize.
-*** The result is that libtool may fail to recognize shared libraries
-*** as such. This will affect the creation of libtool libraries that
-*** depend on shared libraries, but programs linked with such libtool
-*** libraries will work regardless of this problem. Nevertheless, you
-*** may want to report the problem to your system manager and/or to
-*** bug-libtool@gnu.org
-
-_LT_EOF
- fi ;;
- esac
- fi
- break
- fi
- done
- IFS=$lt_save_ifs
- MAGIC_CMD=$lt_save_MAGIC_CMD
- ;;
-esac
-fi
-
-MAGIC_CMD=$lt_cv_path_MAGIC_CMD
-if test -n "$MAGIC_CMD"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5
-$as_echo "$MAGIC_CMD" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-
-
-
-if test -z "$lt_cv_path_MAGIC_CMD"; then
- if test -n "$ac_tool_prefix"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5
-$as_echo_n "checking for file... " >&6; }
-if ${lt_cv_path_MAGIC_CMD+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- case $MAGIC_CMD in
-[\\/*] | ?:[\\/]*)
- lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path.
- ;;
-*)
- lt_save_MAGIC_CMD=$MAGIC_CMD
- lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
- ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
- for ac_dir in $ac_dummy; do
- IFS=$lt_save_ifs
- test -z "$ac_dir" && ac_dir=.
- if test -f "$ac_dir/file"; then
- lt_cv_path_MAGIC_CMD=$ac_dir/"file"
- if test -n "$file_magic_test_file"; then
- case $deplibs_check_method in
- "file_magic "*)
- file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
- MAGIC_CMD=$lt_cv_path_MAGIC_CMD
- if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
- $EGREP "$file_magic_regex" > /dev/null; then
- :
- else
- cat <<_LT_EOF 1>&2
-
-*** Warning: the command libtool uses to detect shared libraries,
-*** $file_magic_cmd, produces output that libtool cannot recognize.
-*** The result is that libtool may fail to recognize shared libraries
-*** as such. This will affect the creation of libtool libraries that
-*** depend on shared libraries, but programs linked with such libtool
-*** libraries will work regardless of this problem. Nevertheless, you
-*** may want to report the problem to your system manager and/or to
-*** bug-libtool@gnu.org
-
-_LT_EOF
- fi ;;
- esac
- fi
- break
- fi
- done
- IFS=$lt_save_ifs
- MAGIC_CMD=$lt_save_MAGIC_CMD
- ;;
-esac
-fi
-
-MAGIC_CMD=$lt_cv_path_MAGIC_CMD
-if test -n "$MAGIC_CMD"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5
-$as_echo "$MAGIC_CMD" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
- else
- MAGIC_CMD=:
- fi
-fi
-
- fi
- ;;
-esac
-
-# Use C for the default configuration in the libtool script
-
-lt_save_CC=$CC
-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
-
-
-# Source file extension for C test sources.
-ac_ext=c
-
-# Object file extension for compiled C test sources.
-objext=o
-objext=$objext
-
-# Code to be used in simple compile tests
-lt_simple_compile_test_code="int some_variable = 0;"
-
-# Code to be used in simple link tests
-lt_simple_link_test_code='int main(){return(0);}'
-
-
-
-
-
-
-
-# If no C compiler was specified, use CC.
-LTCC=${LTCC-"$CC"}
-
-# If no C compiler flags were specified, use CFLAGS.
-LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
-
-# Allow CC to be a program name with arguments.
-compiler=$CC
-
-# Save the default compiler, since it gets overwritten when the other
-# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
-compiler_DEFAULT=$CC
-
-# save warnings/boilerplate of simple test code
-ac_outfile=conftest.$ac_objext
-echo "$lt_simple_compile_test_code" >conftest.$ac_ext
-eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
-_lt_compiler_boilerplate=`cat conftest.err`
-$RM conftest*
-
-ac_outfile=conftest.$ac_objext
-echo "$lt_simple_link_test_code" >conftest.$ac_ext
-eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
-_lt_linker_boilerplate=`cat conftest.err`
-$RM -r conftest*
-
-
-## CAVEAT EMPTOR:
-## There is no encapsulation within the following macros, do not change
-## the running order or otherwise move them around unless you know exactly
-## what you are doing...
-if test -n "$compiler"; then
-
-lt_prog_compiler_no_builtin_flag=
-
-if test yes = "$GCC"; then
- case $cc_basename in
- nvcc*)
- lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;;
- *)
- lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;;
- esac
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
-$as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; }
-if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- lt_cv_prog_compiler_rtti_exceptions=no
- ac_outfile=conftest.$ac_objext
- echo "$lt_simple_compile_test_code" > conftest.$ac_ext
- lt_compiler_flag="-fno-rtti -fno-exceptions" ## exclude from sc_useless_quotes_in_assignment
- # Insert the option either (1) after the last *FLAGS variable, or
- # (2) before a word containing "conftest.", or (3) at the end.
- # Note that $ac_compile itself does not contain backslashes and begins
- # with a dollar sign (not a hyphen), so the echo should work correctly.
- # The option is referenced via a variable to avoid confusing sed.
- lt_compile=`echo "$ac_compile" | $SED \
- -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
- -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
- -e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
- (eval "$lt_compile" 2>conftest.err)
- ac_status=$?
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- if (exit $ac_status) && test -s "$ac_outfile"; then
- # The compiler can only warn and ignore the option if not recognized
- # So say no if there are warnings other than the usual output.
- $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
- $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
- if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
- lt_cv_prog_compiler_rtti_exceptions=yes
- fi
- fi
- $RM conftest*
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5
-$as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; }
-
-if test yes = "$lt_cv_prog_compiler_rtti_exceptions"; then
- lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions"
-else
- :
-fi
-
-fi
-
-
-
-
-
-
- lt_prog_compiler_wl=
-lt_prog_compiler_pic=
-lt_prog_compiler_static=
-
-
- if test yes = "$GCC"; then
- lt_prog_compiler_wl='-Wl,'
- lt_prog_compiler_static='-static'
-
- case $host_os in
- aix*)
- # All AIX code is PIC.
- if test ia64 = "$host_cpu"; then
- # AIX 5 now supports IA64 processor
- lt_prog_compiler_static='-Bstatic'
- fi
- lt_prog_compiler_pic='-fPIC'
- ;;
-
- amigaos*)
- case $host_cpu in
- powerpc)
- # see comment about AmigaOS4 .so support
- lt_prog_compiler_pic='-fPIC'
- ;;
- m68k)
- # FIXME: we need at least 68020 code to build shared libraries, but
- # adding the '-m68020' flag to GCC prevents building anything better,
- # like '-m68040'.
- lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4'
- ;;
- esac
- ;;
-
- beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
- # PIC is the default for these OSes.
- ;;
-
- mingw* | cygwin* | pw32* | os2* | cegcc*)
- # This hack is so that the source file can tell whether it is being
- # built for inclusion in a dll (and should export symbols for example).
- # Although the cygwin gcc ignores -fPIC, still need this for old-style
- # (--disable-auto-import) libraries
- lt_prog_compiler_pic='-DDLL_EXPORT'
- ;;
-
- darwin* | rhapsody*)
- # PIC is the default on this platform
- # Common symbols not allowed in MH_DYLIB files
- lt_prog_compiler_pic='-fno-common'
- ;;
-
- haiku*)
- # PIC is the default for Haiku.
- # The "-static" flag exists, but is broken.
- lt_prog_compiler_static=
- ;;
-
- hpux*)
- # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
- # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag
- # sets the default TLS model and affects inlining.
- case $host_cpu in
- hppa*64*)
- # +Z the default
- ;;
- *)
- lt_prog_compiler_pic='-fPIC'
- ;;
- esac
- ;;
-
- interix[3-9]*)
- # Interix 3.x gcc -fpic/-fPIC options generate broken code.
- # Instead, we relocate shared libraries at runtime.
- ;;
-
- msdosdjgpp*)
- # Just because we use GCC doesn't mean we suddenly get shared libraries
- # on systems that don't support them.
- lt_prog_compiler_can_build_shared=no
- enable_shared=no
- ;;
-
- *nto* | *qnx*)
- # QNX uses GNU C++, but need to define -shared option too, otherwise
- # it will coredump.
- lt_prog_compiler_pic='-fPIC -shared'
- ;;
-
- sysv4*MP*)
- if test -d /usr/nec; then
- lt_prog_compiler_pic=-Kconform_pic
- fi
- ;;
-
- *)
- lt_prog_compiler_pic='-fPIC'
- ;;
- esac
-
- case $cc_basename in
- nvcc*) # Cuda Compiler Driver 2.2
- lt_prog_compiler_wl='-Xlinker '
- if test -n "$lt_prog_compiler_pic"; then
- lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic"
- fi
- ;;
- esac
- else
- # PORTME Check for flag to pass linker flags through the system compiler.
- case $host_os in
- aix*)
- lt_prog_compiler_wl='-Wl,'
- if test ia64 = "$host_cpu"; then
- # AIX 5 now supports IA64 processor
- lt_prog_compiler_static='-Bstatic'
- else
- lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp'
- fi
- ;;
-
- darwin* | rhapsody*)
- # PIC is the default on this platform
- # Common symbols not allowed in MH_DYLIB files
- lt_prog_compiler_pic='-fno-common'
- case $cc_basename in
- nagfor*)
- # NAG Fortran compiler
- lt_prog_compiler_wl='-Wl,-Wl,,'
- lt_prog_compiler_pic='-PIC'
- lt_prog_compiler_static='-Bstatic'
- ;;
- esac
- ;;
-
- mingw* | cygwin* | pw32* | os2* | cegcc*)
- # This hack is so that the source file can tell whether it is being
- # built for inclusion in a dll (and should export symbols for example).
- lt_prog_compiler_pic='-DDLL_EXPORT'
- ;;
-
- hpux9* | hpux10* | hpux11*)
- lt_prog_compiler_wl='-Wl,'
- # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
- # not for PA HP-UX.
- case $host_cpu in
- hppa*64*|ia64*)
- # +Z the default
- ;;
- *)
- lt_prog_compiler_pic='+Z'
- ;;
- esac
- # Is there a better lt_prog_compiler_static that works with the bundled CC?
- lt_prog_compiler_static='$wl-a ${wl}archive'
- ;;
-
- irix5* | irix6* | nonstopux*)
- lt_prog_compiler_wl='-Wl,'
- # PIC (with -KPIC) is the default.
- lt_prog_compiler_static='-non_shared'
- ;;
-
- linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
- case $cc_basename in
- # old Intel for x86_64, which still supported -KPIC.
- ecc*)
- lt_prog_compiler_wl='-Wl,'
- lt_prog_compiler_pic='-KPIC'
- lt_prog_compiler_static='-static'
- ;;
- # icc used to be incompatible with GCC.
- # ICC 10 doesn't accept -KPIC any more.
- icc* | ifort*)
- lt_prog_compiler_wl='-Wl,'
- lt_prog_compiler_pic='-fPIC'
- lt_prog_compiler_static='-static'
- ;;
- # Lahey Fortran 8.1.
- lf95*)
- lt_prog_compiler_wl='-Wl,'
- lt_prog_compiler_pic='--shared'
- lt_prog_compiler_static='--static'
- ;;
- nagfor*)
- # NAG Fortran compiler
- lt_prog_compiler_wl='-Wl,-Wl,,'
- lt_prog_compiler_pic='-PIC'
- lt_prog_compiler_static='-Bstatic'
- ;;
- tcc*)
- # Fabrice Bellard et al's Tiny C Compiler
- lt_prog_compiler_wl='-Wl,'
- lt_prog_compiler_pic='-fPIC'
- lt_prog_compiler_static='-static'
- ;;
- pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
- # Portland Group compilers (*not* the Pentium gcc compiler,
- # which looks to be a dead project)
- lt_prog_compiler_wl='-Wl,'
- lt_prog_compiler_pic='-fpic'
- lt_prog_compiler_static='-Bstatic'
- ;;
- ccc*)
- lt_prog_compiler_wl='-Wl,'
- # All Alpha code is PIC.
- lt_prog_compiler_static='-non_shared'
- ;;
- xl* | bgxl* | bgf* | mpixl*)
- # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
- lt_prog_compiler_wl='-Wl,'
- lt_prog_compiler_pic='-qpic'
- lt_prog_compiler_static='-qstaticlink'
- ;;
- *)
- case `$CC -V 2>&1 | sed 5q` in
- *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*)
- # Sun Fortran 8.3 passes all unrecognized flags to the linker
- lt_prog_compiler_pic='-KPIC'
- lt_prog_compiler_static='-Bstatic'
- lt_prog_compiler_wl=''
- ;;
- *Sun\ F* | *Sun*Fortran*)
- lt_prog_compiler_pic='-KPIC'
- lt_prog_compiler_static='-Bstatic'
- lt_prog_compiler_wl='-Qoption ld '
- ;;
- *Sun\ C*)
- # Sun C 5.9
- lt_prog_compiler_pic='-KPIC'
- lt_prog_compiler_static='-Bstatic'
- lt_prog_compiler_wl='-Wl,'
- ;;
- *Intel*\ [CF]*Compiler*)
- lt_prog_compiler_wl='-Wl,'
- lt_prog_compiler_pic='-fPIC'
- lt_prog_compiler_static='-static'
- ;;
- *Portland\ Group*)
- lt_prog_compiler_wl='-Wl,'
- lt_prog_compiler_pic='-fpic'
- lt_prog_compiler_static='-Bstatic'
- ;;
- esac
- ;;
- esac
- ;;
-
- newsos6)
- lt_prog_compiler_pic='-KPIC'
- lt_prog_compiler_static='-Bstatic'
- ;;
-
- *nto* | *qnx*)
- # QNX uses GNU C++, but need to define -shared option too, otherwise
- # it will coredump.
- lt_prog_compiler_pic='-fPIC -shared'
- ;;
-
- osf3* | osf4* | osf5*)
- lt_prog_compiler_wl='-Wl,'
- # All OSF/1 code is PIC.
- lt_prog_compiler_static='-non_shared'
- ;;
-
- rdos*)
- lt_prog_compiler_static='-non_shared'
- ;;
-
- solaris*)
- lt_prog_compiler_pic='-KPIC'
- lt_prog_compiler_static='-Bstatic'
- case $cc_basename in
- f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
- lt_prog_compiler_wl='-Qoption ld ';;
- *)
- lt_prog_compiler_wl='-Wl,';;
- esac
- ;;
-
- sunos4*)
- lt_prog_compiler_wl='-Qoption ld '
- lt_prog_compiler_pic='-PIC'
- lt_prog_compiler_static='-Bstatic'
- ;;
-
- sysv4 | sysv4.2uw2* | sysv4.3*)
- lt_prog_compiler_wl='-Wl,'
- lt_prog_compiler_pic='-KPIC'
- lt_prog_compiler_static='-Bstatic'
- ;;
-
- sysv4*MP*)
- if test -d /usr/nec; then
- lt_prog_compiler_pic='-Kconform_pic'
- lt_prog_compiler_static='-Bstatic'
- fi
- ;;
-
- sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
- lt_prog_compiler_wl='-Wl,'
- lt_prog_compiler_pic='-KPIC'
- lt_prog_compiler_static='-Bstatic'
- ;;
-
- unicos*)
- lt_prog_compiler_wl='-Wl,'
- lt_prog_compiler_can_build_shared=no
- ;;
-
- uts4*)
- lt_prog_compiler_pic='-pic'
- lt_prog_compiler_static='-Bstatic'
- ;;
-
- *)
- lt_prog_compiler_can_build_shared=no
- ;;
- esac
- fi
-
-case $host_os in
- # For platforms that do not support PIC, -DPIC is meaningless:
- *djgpp*)
- lt_prog_compiler_pic=
- ;;
- *)
- lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC"
- ;;
-esac
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
-$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
-if ${lt_cv_prog_compiler_pic+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- lt_cv_prog_compiler_pic=$lt_prog_compiler_pic
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5
-$as_echo "$lt_cv_prog_compiler_pic" >&6; }
-lt_prog_compiler_pic=$lt_cv_prog_compiler_pic
-
-#
-# Check to make sure the PIC flag actually works.
-#
-if test -n "$lt_prog_compiler_pic"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5
-$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; }
-if ${lt_cv_prog_compiler_pic_works+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- lt_cv_prog_compiler_pic_works=no
- ac_outfile=conftest.$ac_objext
- echo "$lt_simple_compile_test_code" > conftest.$ac_ext
- lt_compiler_flag="$lt_prog_compiler_pic -DPIC" ## exclude from sc_useless_quotes_in_assignment
- # Insert the option either (1) after the last *FLAGS variable, or
- # (2) before a word containing "conftest.", or (3) at the end.
- # Note that $ac_compile itself does not contain backslashes and begins
- # with a dollar sign (not a hyphen), so the echo should work correctly.
- # The option is referenced via a variable to avoid confusing sed.
- lt_compile=`echo "$ac_compile" | $SED \
- -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
- -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
- -e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
- (eval "$lt_compile" 2>conftest.err)
- ac_status=$?
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- if (exit $ac_status) && test -s "$ac_outfile"; then
- # The compiler can only warn and ignore the option if not recognized
- # So say no if there are warnings other than the usual output.
- $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
- $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
- if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
- lt_cv_prog_compiler_pic_works=yes
- fi
- fi
- $RM conftest*
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5
-$as_echo "$lt_cv_prog_compiler_pic_works" >&6; }
-
-if test yes = "$lt_cv_prog_compiler_pic_works"; then
- case $lt_prog_compiler_pic in
- "" | " "*) ;;
- *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;;
- esac
-else
- lt_prog_compiler_pic=
- lt_prog_compiler_can_build_shared=no
-fi
-
-fi
-
-
-
-
-
-
-
-
-
-
-
-#
-# Check to make sure the static flag actually works.
-#
-wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\"
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5
-$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; }
-if ${lt_cv_prog_compiler_static_works+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- lt_cv_prog_compiler_static_works=no
- save_LDFLAGS=$LDFLAGS
- LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
- echo "$lt_simple_link_test_code" > conftest.$ac_ext
- if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
- # The linker can only warn and ignore the option if not recognized
- # So say no if there are warnings
- if test -s conftest.err; then
- # Append any errors to the config.log.
- cat conftest.err 1>&5
- $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
- $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
- if diff conftest.exp conftest.er2 >/dev/null; then
- lt_cv_prog_compiler_static_works=yes
- fi
- else
- lt_cv_prog_compiler_static_works=yes
- fi
- fi
- $RM -r conftest*
- LDFLAGS=$save_LDFLAGS
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5
-$as_echo "$lt_cv_prog_compiler_static_works" >&6; }
-
-if test yes = "$lt_cv_prog_compiler_static_works"; then
- :
-else
- lt_prog_compiler_static=
-fi
-
-
-
-
-
-
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
-$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
-if ${lt_cv_prog_compiler_c_o+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- lt_cv_prog_compiler_c_o=no
- $RM -r conftest 2>/dev/null
- mkdir conftest
- cd conftest
- mkdir out
- echo "$lt_simple_compile_test_code" > conftest.$ac_ext
-
- lt_compiler_flag="-o out/conftest2.$ac_objext"
- # Insert the option either (1) after the last *FLAGS variable, or
- # (2) before a word containing "conftest.", or (3) at the end.
- # Note that $ac_compile itself does not contain backslashes and begins
- # with a dollar sign (not a hyphen), so the echo should work correctly.
- lt_compile=`echo "$ac_compile" | $SED \
- -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
- -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
- -e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
- (eval "$lt_compile" 2>out/conftest.err)
- ac_status=$?
- cat out/conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- if (exit $ac_status) && test -s out/conftest2.$ac_objext
- then
- # The compiler can only warn and ignore the option if not recognized
- # So say no if there are warnings
- $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
- $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
- if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
- lt_cv_prog_compiler_c_o=yes
- fi
- fi
- chmod u+w . 2>&5
- $RM conftest*
- # SGI C++ compiler will create directory out/ii_files/ for
- # template instantiation
- test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
- $RM out/* && rmdir out
- cd ..
- $RM -r conftest
- $RM conftest*
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5
-$as_echo "$lt_cv_prog_compiler_c_o" >&6; }
-
-
-
-
-
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
-$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
-if ${lt_cv_prog_compiler_c_o+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- lt_cv_prog_compiler_c_o=no
- $RM -r conftest 2>/dev/null
- mkdir conftest
- cd conftest
- mkdir out
- echo "$lt_simple_compile_test_code" > conftest.$ac_ext
-
- lt_compiler_flag="-o out/conftest2.$ac_objext"
- # Insert the option either (1) after the last *FLAGS variable, or
- # (2) before a word containing "conftest.", or (3) at the end.
- # Note that $ac_compile itself does not contain backslashes and begins
- # with a dollar sign (not a hyphen), so the echo should work correctly.
- lt_compile=`echo "$ac_compile" | $SED \
- -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
- -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
- -e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
- (eval "$lt_compile" 2>out/conftest.err)
- ac_status=$?
- cat out/conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- if (exit $ac_status) && test -s out/conftest2.$ac_objext
- then
- # The compiler can only warn and ignore the option if not recognized
- # So say no if there are warnings
- $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
- $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
- if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
- lt_cv_prog_compiler_c_o=yes
- fi
- fi
- chmod u+w . 2>&5
- $RM conftest*
- # SGI C++ compiler will create directory out/ii_files/ for
- # template instantiation
- test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
- $RM out/* && rmdir out
- cd ..
- $RM -r conftest
- $RM conftest*
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5
-$as_echo "$lt_cv_prog_compiler_c_o" >&6; }
-
-
-
-
-hard_links=nottested
-if test no = "$lt_cv_prog_compiler_c_o" && test no != "$need_locks"; then
- # do not overwrite the value of need_locks provided by the user
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5
-$as_echo_n "checking if we can lock with hard links... " >&6; }
- hard_links=yes
- $RM conftest*
- ln conftest.a conftest.b 2>/dev/null && hard_links=no
- touch conftest.a
- ln conftest.a conftest.b 2>&5 || hard_links=no
- ln conftest.a conftest.b 2>/dev/null && hard_links=no
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5
-$as_echo "$hard_links" >&6; }
- if test no = "$hard_links"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&5
-$as_echo "$as_me: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&2;}
- need_locks=warn
- fi
-else
- need_locks=no
-fi
-
-
-
-
-
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5
-$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; }
-
- runpath_var=
- allow_undefined_flag=
- always_export_symbols=no
- archive_cmds=
- archive_expsym_cmds=
- compiler_needs_object=no
- enable_shared_with_static_runtimes=no
- export_dynamic_flag_spec=
- export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
- hardcode_automatic=no
- hardcode_direct=no
- hardcode_direct_absolute=no
- hardcode_libdir_flag_spec=
- hardcode_libdir_separator=
- hardcode_minus_L=no
- hardcode_shlibpath_var=unsupported
- inherit_rpath=no
- link_all_deplibs=unknown
- module_cmds=
- module_expsym_cmds=
- old_archive_from_new_cmds=
- old_archive_from_expsyms_cmds=
- thread_safe_flag_spec=
- whole_archive_flag_spec=
- # include_expsyms should be a list of space-separated symbols to be *always*
- # included in the symbol list
- include_expsyms=
- # exclude_expsyms can be an extended regexp of symbols to exclude
- # it will be wrapped by ' (' and ')$', so one must not match beginning or
- # end of line. Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc',
- # as well as any symbol that contains 'd'.
- exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'
- # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
- # platforms (ab)use it in PIC code, but their linkers get confused if
- # the symbol is explicitly referenced. Since portable code cannot
- # rely on this symbol name, it's probably fine to never include it in
- # preloaded symbol tables.
- # Exclude shared library initialization/finalization symbols.
- extract_expsyms_cmds=
-
- case $host_os in
- cygwin* | mingw* | pw32* | cegcc*)
- # FIXME: the MSVC++ port hasn't been tested in a loooong time
- # When not using gcc, we currently assume that we are using
- # Microsoft Visual C++.
- if test yes != "$GCC"; then
- with_gnu_ld=no
- fi
- ;;
- interix*)
- # we just hope/assume this is gcc and not c89 (= MSVC++)
- with_gnu_ld=yes
- ;;
- openbsd* | bitrig*)
- with_gnu_ld=no
- ;;
- esac
-
- ld_shlibs=yes
-
- # On some targets, GNU ld is compatible enough with the native linker
- # that we're better off using the native interface for both.
- lt_use_gnu_ld_interface=no
- if test yes = "$with_gnu_ld"; then
- case $host_os in
- aix*)
- # The AIX port of GNU ld has always aspired to compatibility
- # with the native linker. However, as the warning in the GNU ld
- # block says, versions before 2.19.5* couldn't really create working
- # shared libraries, regardless of the interface used.
- case `$LD -v 2>&1` in
- *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
- *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;;
- *\ \(GNU\ Binutils\)\ [3-9]*) ;;
- *)
- lt_use_gnu_ld_interface=yes
- ;;
- esac
- ;;
- *)
- lt_use_gnu_ld_interface=yes
- ;;
- esac
- fi
-
- if test yes = "$lt_use_gnu_ld_interface"; then
- # If archive_cmds runs LD, not CC, wlarc should be empty
- wlarc='$wl'
-
- # Set some defaults for GNU ld with shared library support. These
- # are reset later if shared libraries are not supported. Putting them
- # here allows them to be overridden if necessary.
- runpath_var=LD_RUN_PATH
- hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
- export_dynamic_flag_spec='$wl--export-dynamic'
- # ancient GNU ld didn't support --whole-archive et. al.
- if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
- whole_archive_flag_spec=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
- else
- whole_archive_flag_spec=
- fi
- supports_anon_versioning=no
- case `$LD -v | $SED -e 's/(^)\+)\s\+//' 2>&1` in
- *GNU\ gold*) supports_anon_versioning=yes ;;
- *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
- *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
- *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
- *\ 2.11.*) ;; # other 2.11 versions
- *) supports_anon_versioning=yes ;;
- esac
-
- # See if GNU ld supports shared libraries.
- case $host_os in
- aix[3-9]*)
- # On AIX/PPC, the GNU linker is very broken
- if test ia64 != "$host_cpu"; then
- ld_shlibs=no
- cat <<_LT_EOF 1>&2
-
-*** Warning: the GNU linker, at least up to release 2.19, is reported
-*** to be unable to reliably create shared libraries on AIX.
-*** Therefore, libtool is disabling shared libraries support. If you
-*** really care for shared libraries, you may want to install binutils
-*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
-*** You will then need to restart the configuration process.
-
-_LT_EOF
- fi
- ;;
-
- amigaos*)
- case $host_cpu in
- powerpc)
- # see comment about AmigaOS4 .so support
- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
- archive_expsym_cmds=''
- ;;
- m68k)
- archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
- hardcode_libdir_flag_spec='-L$libdir'
- hardcode_minus_L=yes
- ;;
- esac
- ;;
-
- beos*)
- if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
- allow_undefined_flag=unsupported
- # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
- # support --undefined. This deserves some investigation. FIXME
- archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
- else
- ld_shlibs=no
- fi
- ;;
-
- cygwin* | mingw* | pw32* | cegcc*)
- # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless,
- # as there is no search path for DLLs.
- hardcode_libdir_flag_spec='-L$libdir'
- export_dynamic_flag_spec='$wl--export-all-symbols'
- allow_undefined_flag=unsupported
- always_export_symbols=no
- enable_shared_with_static_runtimes=yes
- export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols'
- exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'
-
- if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
- # If the export-symbols file already is a .def file, use it as
- # is; otherwise, prepend EXPORTS...
- archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then
- cp $export_symbols $output_objdir/$soname.def;
- else
- echo EXPORTS > $output_objdir/$soname.def;
- cat $export_symbols >> $output_objdir/$soname.def;
- fi~
- $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
- else
- ld_shlibs=no
- fi
- ;;
-
- haiku*)
- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
- link_all_deplibs=yes
- ;;
-
- interix[3-9]*)
- hardcode_direct=no
- hardcode_shlibpath_var=no
- hardcode_libdir_flag_spec='$wl-rpath,$libdir'
- export_dynamic_flag_spec='$wl-E'
- # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
- # Instead, shared libraries are loaded at an image base (0x10000000 by
- # default) and relocated if they conflict, which is a slow very memory
- # consuming and fragmenting process. To avoid this, we pick a random,
- # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
- # time. Moving up from 0x10000000 also allows more sbrk(2) space.
- archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
- archive_expsym_cmds='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
- ;;
-
- gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
- tmp_diet=no
- if test linux-dietlibc = "$host_os"; then
- case $cc_basename in
- diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn)
- esac
- fi
- if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
- && test no = "$tmp_diet"
- then
- tmp_addflag=' $pic_flag'
- tmp_sharedflag='-shared'
- case $cc_basename,$host_cpu in
- pgcc*) # Portland Group C compiler
- whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
- tmp_addflag=' $pic_flag'
- ;;
- pgf77* | pgf90* | pgf95* | pgfortran*)
- # Portland Group f77 and f90 compilers
- whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
- tmp_addflag=' $pic_flag -Mnomain' ;;
- ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64
- tmp_addflag=' -i_dynamic' ;;
- efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64
- tmp_addflag=' -i_dynamic -nofor_main' ;;
- ifc* | ifort*) # Intel Fortran compiler
- tmp_addflag=' -nofor_main' ;;
- lf95*) # Lahey Fortran 8.1
- whole_archive_flag_spec=
- tmp_sharedflag='--shared' ;;
- nagfor*) # NAGFOR 5.3
- tmp_sharedflag='-Wl,-shared' ;;
- xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below)
- tmp_sharedflag='-qmkshrobj'
- tmp_addflag= ;;
- nvcc*) # Cuda Compiler Driver 2.2
- whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
- compiler_needs_object=yes
- ;;
- esac
- case `$CC -V 2>&1 | sed 5q` in
- *Sun\ C*) # Sun C 5.9
- whole_archive_flag_spec='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
- compiler_needs_object=yes
- tmp_sharedflag='-G' ;;
- *Sun\ F*) # Sun Fortran 8.3
- tmp_sharedflag='-G' ;;
- esac
- archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
-
- if test yes = "$supports_anon_versioning"; then
- archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
- cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
- echo "local: *; };" >> $output_objdir/$libname.ver~
- $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib'
- fi
-
- case $cc_basename in
- xlf* | bgf* | bgxlf* | mpixlf*)
- # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
- whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive'
- hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
- archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
- if test yes = "$supports_anon_versioning"; then
- archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
- cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
- echo "local: *; };" >> $output_objdir/$libname.ver~
- $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
- fi
- ;;
- esac
- else
- ld_shlibs=no
- fi
- ;;
-
- netbsd*)
- if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
- archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
- wlarc=
- else
- archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
- archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
- fi
- ;;
-
- solaris*)
- if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
- ld_shlibs=no
- cat <<_LT_EOF 1>&2
-
-*** Warning: The releases 2.8.* of the GNU linker cannot reliably
-*** create shared libraries on Solaris systems. Therefore, libtool
-*** is disabling shared libraries support. We urge you to upgrade GNU
-*** binutils to release 2.9.1 or newer. Another option is to modify
-*** your PATH or compiler configuration so that the native linker is
-*** used, and then restart.
-
-_LT_EOF
- elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
- archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
- archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
- else
- ld_shlibs=no
- fi
- ;;
-
- sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
- case `$LD -v 2>&1` in
- *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
- ld_shlibs=no
- cat <<_LT_EOF 1>&2
-
-*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot
-*** reliably create shared libraries on SCO systems. Therefore, libtool
-*** is disabling shared libraries support. We urge you to upgrade GNU
-*** binutils to release 2.16.91.0.3 or newer. Another option is to modify
-*** your PATH or compiler configuration so that the native linker is
-*** used, and then restart.
-
-_LT_EOF
- ;;
- *)
- # For security reasons, it is highly recommended that you always
- # use absolute paths for naming shared libraries, and exclude the
- # DT_RUNPATH tag from executables and libraries. But doing so
- # requires that you compile everything twice, which is a pain.
- if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
- hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
- archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
- else
- ld_shlibs=no
- fi
- ;;
- esac
- ;;
-
- sunos4*)
- archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
- wlarc=
- hardcode_direct=yes
- hardcode_shlibpath_var=no
- ;;
-
- *)
- if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
- archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
- archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
- else
- ld_shlibs=no
- fi
- ;;
- esac
-
- if test no = "$ld_shlibs"; then
- runpath_var=
- hardcode_libdir_flag_spec=
- export_dynamic_flag_spec=
- whole_archive_flag_spec=
- fi
- else
- # PORTME fill in a description of your system's linker (not GNU ld)
- case $host_os in
- aix3*)
- allow_undefined_flag=unsupported
- always_export_symbols=yes
- archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
- # Note: this linker hardcodes the directories in LIBPATH if there
- # are no directories specified by -L.
- hardcode_minus_L=yes
- if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then
- # Neither direct hardcoding nor static linking is supported with a
- # broken collect2.
- hardcode_direct=unsupported
- fi
- ;;
-
- aix[4-9]*)
- if test ia64 = "$host_cpu"; then
- # On IA64, the linker does run time linking by default, so we don't
- # have to do anything special.
- aix_use_runtimelinking=no
- exp_sym_flag='-Bexport'
- no_entry_flag=
- else
- # If we're using GNU nm, then we don't want the "-C" option.
- # -C means demangle to AIX nm, but means don't demangle with GNU nm
- # Also, AIX nm treats weak defined symbols like other global
- # defined symbols, whereas GNU nm marks them as "W".
- if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
- export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
- else
- export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
- fi
- aix_use_runtimelinking=no
-
- # Test if we are trying to use run time linking or normal
- # AIX style linking. If -brtl is somewhere in LDFLAGS, we
- # need to do runtime linking.
- case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
- for ld_flag in $LDFLAGS; do
- if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then
- aix_use_runtimelinking=yes
- break
- fi
- done
- ;;
- esac
-
- exp_sym_flag='-bexport'
- no_entry_flag='-bnoentry'
- fi
-
- # When large executables or shared objects are built, AIX ld can
- # have problems creating the table of contents. If linking a library
- # or program results in "error TOC overflow" add -mminimal-toc to
- # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
- # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
-
- archive_cmds=''
- hardcode_direct=yes
- hardcode_direct_absolute=yes
- hardcode_libdir_separator=':'
- link_all_deplibs=yes
- file_list_spec='$wl-f,'
-
- if test yes = "$GCC"; then
- case $host_os in aix4.[012]|aix4.[012].*)
- # We only want to do this on AIX 4.2 and lower, the check
- # below for broken collect2 doesn't work under 4.3+
- collect2name=`$CC -print-prog-name=collect2`
- if test -f "$collect2name" &&
- strings "$collect2name" | $GREP resolve_lib_name >/dev/null
- then
- # We have reworked collect2
- :
- else
- # We have old collect2
- hardcode_direct=unsupported
- # It fails to find uninstalled libraries when the uninstalled
- # path is not listed in the libpath. Setting hardcode_minus_L
- # to unsupported forces relinking
- hardcode_minus_L=yes
- hardcode_libdir_flag_spec='-L$libdir'
- hardcode_libdir_separator=
- fi
- ;;
- esac
- shared_flag='-shared'
- if test yes = "$aix_use_runtimelinking"; then
- shared_flag="$shared_flag "'$wl-G'
- fi
- else
- # not using gcc
- if test ia64 = "$host_cpu"; then
- # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
- # chokes on -Wl,-G. The following line is correct:
- shared_flag='-G'
- else
- if test yes = "$aix_use_runtimelinking"; then
- shared_flag='$wl-G'
- else
- shared_flag='$wl-bM:SRE'
- fi
- fi
- fi
-
- export_dynamic_flag_spec='$wl-bexpall'
- # It seems that -bexpall does not export symbols beginning with
- # underscore (_), so it is better to generate a list of symbols to export.
- always_export_symbols=yes
- if test yes = "$aix_use_runtimelinking"; then
- # Warning - without using the other runtime loading flags (-brtl),
- # -berok will link without error, but may produce a broken library.
- allow_undefined_flag='-berok'
- # Determine the default libpath from the value encoded in an
- # empty executable.
- if test set = "${lt_cv_aix_libpath+set}"; then
- aix_libpath=$lt_cv_aix_libpath
-else
- if ${lt_cv_aix_libpath_+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-
- lt_aix_libpath_sed='
- /Import File Strings/,/^$/ {
- /^0/ {
- s/^0 *\([^ ]*\) *$/\1/
- p
- }
- }'
- lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
- # Check for a 64-bit object if we didn't find anything.
- if test -z "$lt_cv_aix_libpath_"; then
- lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
- fi
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
- if test -z "$lt_cv_aix_libpath_"; then
- lt_cv_aix_libpath_=/usr/lib:/lib
- fi
-
-fi
-
- aix_libpath=$lt_cv_aix_libpath_
-fi
-
- hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath"
- archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag
- else
- if test ia64 = "$host_cpu"; then
- hardcode_libdir_flag_spec='$wl-R $libdir:/usr/lib:/lib'
- allow_undefined_flag="-z nodefs"
- archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols"
- else
- # Determine the default libpath from the value encoded in an
- # empty executable.
- if test set = "${lt_cv_aix_libpath+set}"; then
- aix_libpath=$lt_cv_aix_libpath
-else
- if ${lt_cv_aix_libpath_+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-
- lt_aix_libpath_sed='
- /Import File Strings/,/^$/ {
- /^0/ {
- s/^0 *\([^ ]*\) *$/\1/
- p
- }
- }'
- lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
- # Check for a 64-bit object if we didn't find anything.
- if test -z "$lt_cv_aix_libpath_"; then
- lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
- fi
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
- if test -z "$lt_cv_aix_libpath_"; then
- lt_cv_aix_libpath_=/usr/lib:/lib
- fi
-
-fi
-
- aix_libpath=$lt_cv_aix_libpath_
-fi
-
- hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath"
- # Warning - without using the other run time loading flags,
- # -berok will link without error, but may produce a broken library.
- no_undefined_flag=' $wl-bernotok'
- allow_undefined_flag=' $wl-berok'
- if test yes = "$with_gnu_ld"; then
- # We only use this code for GNU lds that support --whole-archive.
- whole_archive_flag_spec='$wl--whole-archive$convenience $wl--no-whole-archive'
- else
- # Exported symbols can be pulled into shared objects from archives
- whole_archive_flag_spec='$convenience'
- fi
- archive_cmds_need_lc=yes
- # This is similar to how AIX traditionally builds its shared libraries.
- archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $wl-bnoentry $compiler_flags $wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
- fi
- fi
- ;;
-
- amigaos*)
- case $host_cpu in
- powerpc)
- # see comment about AmigaOS4 .so support
- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
- archive_expsym_cmds=''
- ;;
- m68k)
- archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
- hardcode_libdir_flag_spec='-L$libdir'
- hardcode_minus_L=yes
- ;;
- esac
- ;;
-
- bsdi[45]*)
- export_dynamic_flag_spec=-rdynamic
- ;;
-
- cygwin* | mingw* | pw32* | cegcc*)
- # When not using gcc, we currently assume that we are using
- # Microsoft Visual C++.
- # hardcode_libdir_flag_spec is actually meaningless, as there is
- # no search path for DLLs.
- case $cc_basename in
- cl*)
- # Native MSVC
- hardcode_libdir_flag_spec=' '
- allow_undefined_flag=unsupported
- always_export_symbols=yes
- file_list_spec='@'
- # Tell ltmain to make .lib files, not .a files.
- libext=lib
- # Tell ltmain to make .dll files, not .so files.
- shrext_cmds=.dll
- # FIXME: Setting linknames here is a bad hack.
- archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames='
- archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then
- cp "$export_symbols" "$output_objdir/$soname.def";
- echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp";
- else
- $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp;
- fi~
- $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
- linknames='
- # The linker will not automatically build a static lib if we build a DLL.
- # _LT_TAGVAR(old_archive_from_new_cmds, )='true'
- enable_shared_with_static_runtimes=yes
- exclude_expsyms='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
- export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
- # Don't use ranlib
- old_postinstall_cmds='chmod 644 $oldlib'
- postlink_cmds='lt_outputfile="@OUTPUT@"~
- lt_tool_outputfile="@TOOL_OUTPUT@"~
- case $lt_outputfile in
- *.exe|*.EXE) ;;
- *)
- lt_outputfile=$lt_outputfile.exe
- lt_tool_outputfile=$lt_tool_outputfile.exe
- ;;
- esac~
- if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then
- $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
- $RM "$lt_outputfile.manifest";
- fi'
- ;;
- *)
- # Assume MSVC wrapper
- hardcode_libdir_flag_spec=' '
- allow_undefined_flag=unsupported
- # Tell ltmain to make .lib files, not .a files.
- libext=lib
- # Tell ltmain to make .dll files, not .so files.
- shrext_cmds=.dll
- # FIXME: Setting linknames here is a bad hack.
- archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
- # The linker will automatically build a .lib file if we build a DLL.
- old_archive_from_new_cmds='true'
- # FIXME: Should let the user specify the lib program.
- old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs'
- enable_shared_with_static_runtimes=yes
- ;;
- esac
- ;;
-
- darwin* | rhapsody*)
-
-
- archive_cmds_need_lc=no
- hardcode_direct=no
- hardcode_automatic=yes
- hardcode_shlibpath_var=unsupported
- if test yes = "$lt_cv_ld_force_load"; then
- whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
-
- else
- whole_archive_flag_spec=''
- fi
- link_all_deplibs=yes
- allow_undefined_flag=$_lt_dar_allow_undefined
- case $cc_basename in
- ifort*|nagfor*) _lt_dar_can_shared=yes ;;
- *) _lt_dar_can_shared=$GCC ;;
- esac
- if test yes = "$_lt_dar_can_shared"; then
- output_verbose_link_cmd=func_echo_all
- archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil"
- module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil"
- archive_expsym_cmds="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil"
- module_expsym_cmds="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil"
-
- else
- ld_shlibs=no
- fi
-
- ;;
-
- dgux*)
- archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_libdir_flag_spec='-L$libdir'
- hardcode_shlibpath_var=no
- ;;
-
- # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
- # support. Future versions do this automatically, but an explicit c++rt0.o
- # does not break anything, and helps significantly (at the cost of a little
- # extra space).
- freebsd2.2*)
- archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
- hardcode_libdir_flag_spec='-R$libdir'
- hardcode_direct=yes
- hardcode_shlibpath_var=no
- ;;
-
- # Unfortunately, older versions of FreeBSD 2 do not have this feature.
- freebsd2.*)
- archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
- hardcode_direct=yes
- hardcode_minus_L=yes
- hardcode_shlibpath_var=no
- ;;
-
- # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
- freebsd* | dragonfly*)
- archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
- hardcode_libdir_flag_spec='-R$libdir'
- hardcode_direct=yes
- hardcode_shlibpath_var=no
- ;;
-
- hpux9*)
- if test yes = "$GCC"; then
- archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
- else
- archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
- fi
- hardcode_libdir_flag_spec='$wl+b $wl$libdir'
- hardcode_libdir_separator=:
- hardcode_direct=yes
-
- # hardcode_minus_L: Not really in the search PATH,
- # but as the default location of the library.
- hardcode_minus_L=yes
- export_dynamic_flag_spec='$wl-E'
- ;;
-
- hpux10*)
- if test yes,no = "$GCC,$with_gnu_ld"; then
- archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
- else
- archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
- fi
- if test no = "$with_gnu_ld"; then
- hardcode_libdir_flag_spec='$wl+b $wl$libdir'
- hardcode_libdir_separator=:
- hardcode_direct=yes
- hardcode_direct_absolute=yes
- export_dynamic_flag_spec='$wl-E'
- # hardcode_minus_L: Not really in the search PATH,
- # but as the default location of the library.
- hardcode_minus_L=yes
- fi
- ;;
-
- hpux11*)
- if test yes,no = "$GCC,$with_gnu_ld"; then
- case $host_cpu in
- hppa*64*)
- archive_cmds='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- ia64*)
- archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- *)
- archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- esac
- else
- case $host_cpu in
- hppa*64*)
- archive_cmds='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- ia64*)
- archive_cmds='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- *)
-
- # Older versions of the 11.00 compiler do not understand -b yet
- # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5
-$as_echo_n "checking if $CC understands -b... " >&6; }
-if ${lt_cv_prog_compiler__b+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- lt_cv_prog_compiler__b=no
- save_LDFLAGS=$LDFLAGS
- LDFLAGS="$LDFLAGS -b"
- echo "$lt_simple_link_test_code" > conftest.$ac_ext
- if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
- # The linker can only warn and ignore the option if not recognized
- # So say no if there are warnings
- if test -s conftest.err; then
- # Append any errors to the config.log.
- cat conftest.err 1>&5
- $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
- $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
- if diff conftest.exp conftest.er2 >/dev/null; then
- lt_cv_prog_compiler__b=yes
- fi
- else
- lt_cv_prog_compiler__b=yes
- fi
- fi
- $RM -r conftest*
- LDFLAGS=$save_LDFLAGS
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5
-$as_echo "$lt_cv_prog_compiler__b" >&6; }
-
-if test yes = "$lt_cv_prog_compiler__b"; then
- archive_cmds='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
-else
- archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
-fi
-
- ;;
- esac
- fi
- if test no = "$with_gnu_ld"; then
- hardcode_libdir_flag_spec='$wl+b $wl$libdir'
- hardcode_libdir_separator=:
-
- case $host_cpu in
- hppa*64*|ia64*)
- hardcode_direct=no
- hardcode_shlibpath_var=no
- ;;
- *)
- hardcode_direct=yes
- hardcode_direct_absolute=yes
- export_dynamic_flag_spec='$wl-E'
-
- # hardcode_minus_L: Not really in the search PATH,
- # but as the default location of the library.
- hardcode_minus_L=yes
- ;;
- esac
- fi
- ;;
-
- irix5* | irix6* | nonstopux*)
- if test yes = "$GCC"; then
- archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
- # Try to use the -exported_symbol ld option, if it does not
- # work, assume that -exports_file does not work either and
- # implicitly export all symbols.
- # This should be the same for all languages, so no per-tag cache variable.
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5
-$as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; }
-if ${lt_cv_irix_exported_symbol+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- save_LDFLAGS=$LDFLAGS
- LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-int foo (void) { return 0; }
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- lt_cv_irix_exported_symbol=yes
-else
- lt_cv_irix_exported_symbol=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
- LDFLAGS=$save_LDFLAGS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5
-$as_echo "$lt_cv_irix_exported_symbol" >&6; }
- if test yes = "$lt_cv_irix_exported_symbol"; then
- archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib'
- fi
- else
- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
- archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib'
- fi
- archive_cmds_need_lc='no'
- hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
- hardcode_libdir_separator=:
- inherit_rpath=yes
- link_all_deplibs=yes
- ;;
-
- netbsd*)
- if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
- archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
- else
- archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF
- fi
- hardcode_libdir_flag_spec='-R$libdir'
- hardcode_direct=yes
- hardcode_shlibpath_var=no
- ;;
-
- newsos6)
- archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_direct=yes
- hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
- hardcode_libdir_separator=:
- hardcode_shlibpath_var=no
- ;;
-
- *nto* | *qnx*)
- ;;
-
- openbsd* | bitrig*)
- if test -f /usr/libexec/ld.so; then
- hardcode_direct=yes
- hardcode_shlibpath_var=no
- hardcode_direct_absolute=yes
- if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
- archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols'
- hardcode_libdir_flag_spec='$wl-rpath,$libdir'
- export_dynamic_flag_spec='$wl-E'
- else
- archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
- hardcode_libdir_flag_spec='$wl-rpath,$libdir'
- fi
- else
- ld_shlibs=no
- fi
- ;;
-
- os2*)
- hardcode_libdir_flag_spec='-L$libdir'
- hardcode_minus_L=yes
- allow_undefined_flag=unsupported
- archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
- old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
- ;;
-
- osf3*)
- if test yes = "$GCC"; then
- allow_undefined_flag=' $wl-expect_unresolved $wl\*'
- archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
- else
- allow_undefined_flag=' -expect_unresolved \*'
- archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
- fi
- archive_cmds_need_lc='no'
- hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
- hardcode_libdir_separator=:
- ;;
-
- osf4* | osf5*) # as osf3* with the addition of -msym flag
- if test yes = "$GCC"; then
- allow_undefined_flag=' $wl-expect_unresolved $wl\*'
- archive_cmds='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
- hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
- else
- allow_undefined_flag=' -expect_unresolved \*'
- archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
- archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~
- $CC -shared$allow_undefined_flag $wl-input $wl$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~$RM $lib.exp'
-
- # Both c and cxx compiler support -rpath directly
- hardcode_libdir_flag_spec='-rpath $libdir'
- fi
- archive_cmds_need_lc='no'
- hardcode_libdir_separator=:
- ;;
-
- solaris*)
- no_undefined_flag=' -z defs'
- if test yes = "$GCC"; then
- wlarc='$wl'
- archive_cmds='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
- $CC -shared $pic_flag $wl-z ${wl}text $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
- else
- case `$CC -V 2>&1` in
- *"Compilers 5.0"*)
- wlarc=''
- archive_cmds='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags'
- archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
- $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
- ;;
- *)
- wlarc='$wl'
- archive_cmds='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
- $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
- ;;
- esac
- fi
- hardcode_libdir_flag_spec='-R$libdir'
- hardcode_shlibpath_var=no
- case $host_os in
- solaris2.[0-5] | solaris2.[0-5].*) ;;
- *)
- # The compiler driver will combine and reorder linker options,
- # but understands '-z linker_flag'. GCC discards it without '$wl',
- # but is careful enough not to reorder.
- # Supported since Solaris 2.6 (maybe 2.5.1?)
- if test yes = "$GCC"; then
- whole_archive_flag_spec='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract'
- else
- whole_archive_flag_spec='-z allextract$convenience -z defaultextract'
- fi
- ;;
- esac
- link_all_deplibs=yes
- ;;
-
- sunos4*)
- if test sequent = "$host_vendor"; then
- # Use $CC to link under sequent, because it throws in some extra .o
- # files that make .init and .fini sections work.
- archive_cmds='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags'
- else
- archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
- fi
- hardcode_libdir_flag_spec='-L$libdir'
- hardcode_direct=yes
- hardcode_minus_L=yes
- hardcode_shlibpath_var=no
- ;;
-
- sysv4)
- case $host_vendor in
- sni)
- archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_direct=yes # is this really true???
- ;;
- siemens)
- ## LD is ld it makes a PLAMLIB
- ## CC just makes a GrossModule.
- archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
- reload_cmds='$CC -r -o $output$reload_objs'
- hardcode_direct=no
- ;;
- motorola)
- archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_direct=no #Motorola manual says yes, but my tests say they lie
- ;;
- esac
- runpath_var='LD_RUN_PATH'
- hardcode_shlibpath_var=no
- ;;
-
- sysv4.3*)
- archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_shlibpath_var=no
- export_dynamic_flag_spec='-Bexport'
- ;;
-
- sysv4*MP*)
- if test -d /usr/nec; then
- archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_shlibpath_var=no
- runpath_var=LD_RUN_PATH
- hardcode_runpath_var=yes
- ld_shlibs=yes
- fi
- ;;
-
- sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
- no_undefined_flag='$wl-z,text'
- archive_cmds_need_lc=no
- hardcode_shlibpath_var=no
- runpath_var='LD_RUN_PATH'
-
- if test yes = "$GCC"; then
- archive_cmds='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- else
- archive_cmds='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- fi
- ;;
-
- sysv5* | sco3.2v5* | sco5v6*)
- # Note: We CANNOT use -z defs as we might desire, because we do not
- # link with -lc, and that would cause any symbols used from libc to
- # always be unresolved, which means just about no library would
- # ever link correctly. If we're not using GNU ld we use -z text
- # though, which does catch some bad symbols but isn't as heavy-handed
- # as -z defs.
- no_undefined_flag='$wl-z,text'
- allow_undefined_flag='$wl-z,nodefs'
- archive_cmds_need_lc=no
- hardcode_shlibpath_var=no
- hardcode_libdir_flag_spec='$wl-R,$libdir'
- hardcode_libdir_separator=':'
- link_all_deplibs=yes
- export_dynamic_flag_spec='$wl-Bexport'
- runpath_var='LD_RUN_PATH'
-
- if test yes = "$GCC"; then
- archive_cmds='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- else
- archive_cmds='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- fi
- ;;
-
- uts4*)
- archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_libdir_flag_spec='-L$libdir'
- hardcode_shlibpath_var=no
- ;;
-
- *)
- ld_shlibs=no
- ;;
- esac
-
- if test sni = "$host_vendor"; then
- case $host in
- sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
- export_dynamic_flag_spec='$wl-Blargedynsym'
- ;;
- esac
- fi
- fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5
-$as_echo "$ld_shlibs" >&6; }
-test no = "$ld_shlibs" && can_build_shared=no
-
-with_gnu_ld=$with_gnu_ld
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-#
-# Do we need to explicitly link libc?
-#
-case "x$archive_cmds_need_lc" in
-x|xyes)
- # Assume -lc should be added
- archive_cmds_need_lc=yes
-
- if test yes,yes = "$GCC,$enable_shared"; then
- case $archive_cmds in
- *'~'*)
- # FIXME: we may have to deal with multi-command sequences.
- ;;
- '$CC '*)
- # Test whether the compiler implicitly links with -lc since on some
- # systems, -lgcc has to come before -lc. If gcc already passes -lc
- # to ld, don't add -lc before -lgcc.
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5
-$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; }
-if ${lt_cv_archive_cmds_need_lc+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- $RM conftest*
- echo "$lt_simple_compile_test_code" > conftest.$ac_ext
-
- if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
- (eval $ac_compile) 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; } 2>conftest.err; then
- soname=conftest
- lib=conftest
- libobjs=conftest.$ac_objext
- deplibs=
- wl=$lt_prog_compiler_wl
- pic_flag=$lt_prog_compiler_pic
- compiler_flags=-v
- linker_flags=-v
- verstring=
- output_objdir=.
- libname=conftest
- lt_save_allow_undefined_flag=$allow_undefined_flag
- allow_undefined_flag=
- if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5
- (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }
- then
- lt_cv_archive_cmds_need_lc=no
- else
- lt_cv_archive_cmds_need_lc=yes
- fi
- allow_undefined_flag=$lt_save_allow_undefined_flag
- else
- cat conftest.err 1>&5
- fi
- $RM conftest*
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5
-$as_echo "$lt_cv_archive_cmds_need_lc" >&6; }
- archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc
- ;;
- esac
- fi
- ;;
-esac
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5
-$as_echo_n "checking dynamic linker characteristics... " >&6; }
-
-if test yes = "$GCC"; then
- case $host_os in
- darwin*) lt_awk_arg='/^libraries:/,/LR/' ;;
- *) lt_awk_arg='/^libraries:/' ;;
- esac
- case $host_os in
- mingw* | cegcc*) lt_sed_strip_eq='s|=\([A-Za-z]:\)|\1|g' ;;
- *) lt_sed_strip_eq='s|=/|/|g' ;;
- esac
- lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
- case $lt_search_path_spec in
- *\;*)
- # if the path contains ";" then we assume it to be the separator
- # otherwise default to the standard path separator (i.e. ":") - it is
- # assumed that no part of a normal pathname contains ";" but that should
- # okay in the real world where ";" in dirpaths is itself problematic.
- lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'`
- ;;
- *)
- lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"`
- ;;
- esac
- # Ok, now we have the path, separated by spaces, we can step through it
- # and add multilib dir if necessary...
- lt_tmp_lt_search_path_spec=
- lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
- # ...but if some path component already ends with the multilib dir we assume
- # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer).
- case "$lt_multi_os_dir; $lt_search_path_spec " in
- "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*)
- lt_multi_os_dir=
- ;;
- esac
- for lt_sys_path in $lt_search_path_spec; do
- if test -d "$lt_sys_path$lt_multi_os_dir"; then
- lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir"
- elif test -n "$lt_multi_os_dir"; then
- test -d "$lt_sys_path" && \
- lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
- fi
- done
- lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
-BEGIN {RS = " "; FS = "/|\n";} {
- lt_foo = "";
- lt_count = 0;
- for (lt_i = NF; lt_i > 0; lt_i--) {
- if ($lt_i != "" && $lt_i != ".") {
- if ($lt_i == "..") {
- lt_count++;
- } else {
- if (lt_count == 0) {
- lt_foo = "/" $lt_i lt_foo;
- } else {
- lt_count--;
- }
- }
- }
- }
- if (lt_foo != "") { lt_freq[lt_foo]++; }
- if (lt_freq[lt_foo] == 1) { print lt_foo; }
-}'`
- # AWK program above erroneously prepends '/' to C:/dos/paths
- # for these hosts.
- case $host_os in
- mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
- $SED 's|/\([A-Za-z]:\)|\1|g'` ;;
- esac
- sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
-else
- sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
-fi
-library_names_spec=
-libname_spec='lib$name'
-soname_spec=
-shrext_cmds=.so
-postinstall_cmds=
-postuninstall_cmds=
-finish_cmds=
-finish_eval=
-shlibpath_var=
-shlibpath_overrides_runpath=unknown
-version_type=none
-dynamic_linker="$host_os ld.so"
-sys_lib_dlsearch_path_spec="/lib /usr/lib"
-need_lib_prefix=unknown
-hardcode_into_libs=no
-
-# when you set need_version to no, make sure it does not cause -set_version
-# flags to be left without arguments
-need_version=unknown
-
-case $host_os in
-aix3*)
- version_type=linux # correct to gnu/linux during the next big refactor
- library_names_spec='$libname$release$shared_ext$versuffix $libname.a'
- shlibpath_var=LIBPATH
-
- # AIX 3 has no versioning support, so we append a major version to the name.
- soname_spec='$libname$release$shared_ext$major'
- ;;
-
-aix[4-9]*)
- version_type=linux # correct to gnu/linux during the next big refactor
- need_lib_prefix=no
- need_version=no
- hardcode_into_libs=yes
- if test ia64 = "$host_cpu"; then
- # AIX 5 supports IA64
- library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext'
- shlibpath_var=LD_LIBRARY_PATH
- else
- # With GCC up to 2.95.x, collect2 would create an import file
- # for dependence libraries. The import file would start with
- # the line '#! .'. This would cause the generated library to
- # depend on '.', always an invalid library. This was fixed in
- # development snapshots of GCC prior to 3.0.
- case $host_os in
- aix4 | aix4.[01] | aix4.[01].*)
- if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
- echo ' yes '
- echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then
- :
- else
- can_build_shared=no
- fi
- ;;
- esac
- # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct
- # soname into executable. Probably we can add versioning support to
- # collect2, so additional links can be useful in future.
- if test yes = "$aix_use_runtimelinking"; then
- # If using run time linking (on AIX 4.2 or later) use lib<name>.so
- # instead of lib<name>.a to let people know that these are not
- # typical AIX shared libraries.
- library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
- else
- # We preserve .a as extension for shared libraries through AIX4.2
- # and later when we are not doing run time linking.
- library_names_spec='$libname$release.a $libname.a'
- soname_spec='$libname$release$shared_ext$major'
- fi
- shlibpath_var=LIBPATH
- fi
- ;;
-
-amigaos*)
- case $host_cpu in
- powerpc)
- # Since July 2007 AmigaOS4 officially supports .so libraries.
- # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
- library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
- ;;
- m68k)
- library_names_spec='$libname.ixlibrary $libname.a'
- # Create ${libname}_ixlibrary.a entries in /sys/libs.
- finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
- ;;
- esac
- ;;
-
-beos*)
- library_names_spec='$libname$shared_ext'
- dynamic_linker="$host_os ld.so"
- shlibpath_var=LIBRARY_PATH
- ;;
-
-bsdi[45]*)
- version_type=linux # correct to gnu/linux during the next big refactor
- need_version=no
- library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
- soname_spec='$libname$release$shared_ext$major'
- finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
- shlibpath_var=LD_LIBRARY_PATH
- sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
- sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
- # the default ld.so.conf also contains /usr/contrib/lib and
- # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
- # libtool to hard-code these into programs
- ;;
-
-cygwin* | mingw* | pw32* | cegcc*)
- version_type=windows
- shrext_cmds=.dll
- need_version=no
- need_lib_prefix=no
-
- case $GCC,$cc_basename in
- yes,*)
- # gcc
- library_names_spec='$libname.dll.a'
- # DLL is installed to $(libdir)/../bin by postinstall_cmds
- postinstall_cmds='base_file=`basename \$file`~
- dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
- dldir=$destdir/`dirname \$dlpath`~
- test -d \$dldir || mkdir -p \$dldir~
- $install_prog $dir/$dlname \$dldir/$dlname~
- chmod a+x \$dldir/$dlname~
- if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
- eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
- fi'
- postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
- dlpath=$dir/\$dldll~
- $RM \$dlpath'
- shlibpath_overrides_runpath=yes
-
- case $host_os in
- cygwin*)
- # Cygwin DLLs use 'cyg' prefix rather than 'lib'
- soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext'
-
- sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"
- ;;
- mingw* | cegcc*)
- # MinGW DLLs use traditional 'lib' prefix
- soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext'
- ;;
- pw32*)
- # pw32 DLLs use 'pw' prefix rather than 'lib'
- library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext'
- ;;
- esac
- dynamic_linker='Win32 ld.exe'
- ;;
-
- *,cl*)
- # Native MSVC
- libname_spec='$name'
- soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext'
- library_names_spec='$libname.dll.lib'
-
- case $build_os in
- mingw*)
- sys_lib_search_path_spec=
- lt_save_ifs=$IFS
- IFS=';'
- for lt_path in $LIB
- do
- IFS=$lt_save_ifs
- # Let DOS variable expansion print the short 8.3 style file name.
- lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
- sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
- done
- IFS=$lt_save_ifs
- # Convert to MSYS style.
- sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'`
- ;;
- cygwin*)
- # Convert to unix form, then to dos form, then back to unix form
- # but this time dos style (no spaces!) so that the unix form looks
- # like /cygdrive/c/PROGRA~1:/cygdr...
- sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
- sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
- sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
- ;;
- *)
- sys_lib_search_path_spec=$LIB
- if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then
- # It is most probably a Windows format PATH.
- sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
- else
- sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
- fi
- # FIXME: find the short name or the path components, as spaces are
- # common. (e.g. "Program Files" -> "PROGRA~1")
- ;;
- esac
-
- # DLL is installed to $(libdir)/../bin by postinstall_cmds
- postinstall_cmds='base_file=`basename \$file`~
- dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
- dldir=$destdir/`dirname \$dlpath`~
- test -d \$dldir || mkdir -p \$dldir~
- $install_prog $dir/$dlname \$dldir/$dlname'
- postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
- dlpath=$dir/\$dldll~
- $RM \$dlpath'
- shlibpath_overrides_runpath=yes
- dynamic_linker='Win32 link.exe'
- ;;
-
- *)
- # Assume MSVC wrapper
- library_names_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext $libname.lib'
- dynamic_linker='Win32 ld.exe'
- ;;
- esac
- # FIXME: first we should search . and the directory the executable is in
- shlibpath_var=PATH
- ;;
-
-darwin* | rhapsody*)
- dynamic_linker="$host_os dyld"
- version_type=darwin
- need_lib_prefix=no
- need_version=no
- library_names_spec='$libname$release$major$shared_ext $libname$shared_ext'
- soname_spec='$libname$release$major$shared_ext'
- shlibpath_overrides_runpath=yes
- shlibpath_var=DYLD_LIBRARY_PATH
- shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
-
- sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"
- sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
- ;;
-
-dgux*)
- version_type=linux # correct to gnu/linux during the next big refactor
- need_lib_prefix=no
- need_version=no
- library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
- soname_spec='$libname$release$shared_ext$major'
- shlibpath_var=LD_LIBRARY_PATH
- ;;
-
-freebsd* | dragonfly*)
- # DragonFly does not have aout. When/if they implement a new
- # versioning mechanism, adjust this.
- if test -x /usr/bin/objformat; then
- objformat=`/usr/bin/objformat`
- else
- case $host_os in
- freebsd[23].*) objformat=aout ;;
- *) objformat=elf ;;
- esac
- fi
- version_type=freebsd-$objformat
- case $version_type in
- freebsd-elf*)
- library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext'
- need_version=no
- need_lib_prefix=no
- ;;
- freebsd-*)
- library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
- need_version=yes
- ;;
- esac
- shlibpath_var=LD_LIBRARY_PATH
- case $host_os in
- freebsd2.*)
- shlibpath_overrides_runpath=yes
- ;;
- freebsd3.[01]* | freebsdelf3.[01]*)
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- ;;
- freebsd3.[2-9]* | freebsdelf3.[2-9]* | \
- freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1)
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- ;;
- *) # from 4.6 on, and DragonFly
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- ;;
- esac
- ;;
-
-haiku*)
- version_type=linux # correct to gnu/linux during the next big refactor
- need_lib_prefix=no
- need_version=no
- dynamic_linker="$host_os runtime_loader"
- library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
- soname_spec='$libname$release$shared_ext$major'
- shlibpath_var=LIBRARY_PATH
- shlibpath_overrides_runpath=no
- sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
- hardcode_into_libs=yes
- ;;
-
-hpux9* | hpux10* | hpux11*)
- # Give a soname corresponding to the major version so that dld.sl refuses to
- # link against other versions.
- version_type=sunos
- need_lib_prefix=no
- need_version=no
- case $host_cpu in
- ia64*)
- shrext_cmds='.so'
- hardcode_into_libs=yes
- dynamic_linker="$host_os dld.so"
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
- library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
- soname_spec='$libname$release$shared_ext$major'
- if test 32 = "$HPUX_IA64_MODE"; then
- sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
- else
- sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
- fi
- sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
- ;;
- hppa*64*)
- shrext_cmds='.sl'
- hardcode_into_libs=yes
- dynamic_linker="$host_os dld.sl"
- shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
- shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
- library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
- soname_spec='$libname$release$shared_ext$major'
- sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
- sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
- ;;
- *)
- shrext_cmds='.sl'
- dynamic_linker="$host_os dld.sl"
- shlibpath_var=SHLIB_PATH
- shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
- library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
- soname_spec='$libname$release$shared_ext$major'
- ;;
- esac
- # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
- postinstall_cmds='chmod 555 $lib'
- # or fails outright, so override atomically:
- install_override_mode=555
- ;;
-
-interix[3-9]*)
- version_type=linux # correct to gnu/linux during the next big refactor
- need_lib_prefix=no
- need_version=no
- library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
- soname_spec='$libname$release$shared_ext$major'
- dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- ;;
-
-irix5* | irix6* | nonstopux*)
- case $host_os in
- nonstopux*) version_type=nonstopux ;;
- *)
- if test yes = "$lt_cv_prog_gnu_ld"; then
- version_type=linux # correct to gnu/linux during the next big refactor
- else
- version_type=irix
- fi ;;
- esac
- need_lib_prefix=no
- need_version=no
- soname_spec='$libname$release$shared_ext$major'
- library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext'
- case $host_os in
- irix5* | nonstopux*)
- libsuff= shlibsuff=
- ;;
- *)
- case $LD in # libtool.m4 will add one of these switches to LD
- *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
- libsuff= shlibsuff= libmagic=32-bit;;
- *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
- libsuff=32 shlibsuff=N32 libmagic=N32;;
- *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
- libsuff=64 shlibsuff=64 libmagic=64-bit;;
- *) libsuff= shlibsuff= libmagic=never-match;;
- esac
- ;;
- esac
- shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
- shlibpath_overrides_runpath=no
- sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff"
- sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff"
- hardcode_into_libs=yes
- ;;
-
-# No shared lib support for Linux oldld, aout, or coff.
-linux*oldld* | linux*aout* | linux*coff*)
- dynamic_linker=no
- ;;
-
-linux*android*)
- version_type=none # Android doesn't support versioned libraries.
- need_lib_prefix=no
- need_version=no
- library_names_spec='$libname$release$shared_ext'
- soname_spec='$libname$release$shared_ext'
- finish_cmds=
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
-
- # This implies no fast_install, which is unacceptable.
- # Some rework will be needed to allow for fast_install
- # before this can be enabled.
- hardcode_into_libs=yes
-
- dynamic_linker='Android linker'
- # Don't embed -rpath directories since the linker doesn't support them.
- hardcode_libdir_flag_spec='-L$libdir'
- ;;
-
-# This must be glibc/ELF.
-linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
- version_type=linux # correct to gnu/linux during the next big refactor
- need_lib_prefix=no
- need_version=no
- library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
- soname_spec='$libname$release$shared_ext$major'
- finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
-
- # Some binutils ld are patched to set DT_RUNPATH
- if ${lt_cv_shlibpath_overrides_runpath+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- lt_cv_shlibpath_overrides_runpath=no
- save_LDFLAGS=$LDFLAGS
- save_libdir=$libdir
- eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \
- LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\""
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then :
- lt_cv_shlibpath_overrides_runpath=yes
-fi
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
- LDFLAGS=$save_LDFLAGS
- libdir=$save_libdir
-
-fi
-
- shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
-
- # This implies no fast_install, which is unacceptable.
- # Some rework will be needed to allow for fast_install
- # before this can be enabled.
- hardcode_into_libs=yes
-
- # Append ld.so.conf contents to the search path
- if test -f /etc/ld.so.conf; then
- lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
- sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
- fi
-
- # We used to test for /lib/ld.so.1 and disable shared libraries on
- # powerpc, because MkLinux only supported shared libraries with the
- # GNU dynamic linker. Since this was broken with cross compilers,
- # most powerpc-linux boxes support dynamic linking these days and
- # people can always --disable-shared, the test was removed, and we
- # assume the GNU/Linux dynamic linker is in use.
- dynamic_linker='GNU/Linux ld.so'
- ;;
-
-netbsd*)
- version_type=sunos
- need_lib_prefix=no
- need_version=no
- if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
- library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
- finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
- dynamic_linker='NetBSD (a.out) ld.so'
- else
- library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
- soname_spec='$libname$release$shared_ext$major'
- dynamic_linker='NetBSD ld.elf_so'
- fi
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- ;;
-
-newsos6)
- version_type=linux # correct to gnu/linux during the next big refactor
- library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- ;;
-
-*nto* | *qnx*)
- version_type=qnx
- need_lib_prefix=no
- need_version=no
- library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
- soname_spec='$libname$release$shared_ext$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- dynamic_linker='ldqnx.so'
- ;;
-
-openbsd* | bitrig*)
- version_type=sunos
- sys_lib_dlsearch_path_spec=/usr/lib
- need_lib_prefix=no
- if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
- need_version=no
- else
- need_version=yes
- fi
- library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
- finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- ;;
-
-os2*)
- libname_spec='$name'
- shrext_cmds=.dll
- need_lib_prefix=no
- library_names_spec='$libname$shared_ext $libname.a'
- dynamic_linker='OS/2 ld.exe'
- shlibpath_var=LIBPATH
- ;;
-
-osf3* | osf4* | osf5*)
- version_type=osf
- need_lib_prefix=no
- need_version=no
- soname_spec='$libname$release$shared_ext$major'
- library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
- shlibpath_var=LD_LIBRARY_PATH
- sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
- sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
- ;;
-
-rdos*)
- dynamic_linker=no
- ;;
-
-solaris*)
- version_type=linux # correct to gnu/linux during the next big refactor
- need_lib_prefix=no
- need_version=no
- library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
- soname_spec='$libname$release$shared_ext$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- # ldd complains unless libraries are executable
- postinstall_cmds='chmod +x $lib'
- ;;
-
-sunos4*)
- version_type=sunos
- library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
- finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- if test yes = "$with_gnu_ld"; then
- need_lib_prefix=no
- fi
- need_version=yes
- ;;
-
-sysv4 | sysv4.3*)
- version_type=linux # correct to gnu/linux during the next big refactor
- library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
- soname_spec='$libname$release$shared_ext$major'
- shlibpath_var=LD_LIBRARY_PATH
- case $host_vendor in
- sni)
- shlibpath_overrides_runpath=no
- need_lib_prefix=no
- runpath_var=LD_RUN_PATH
- ;;
- siemens)
- need_lib_prefix=no
- ;;
- motorola)
- need_lib_prefix=no
- need_version=no
- shlibpath_overrides_runpath=no
- sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
- ;;
- esac
- ;;
-
-sysv4*MP*)
- if test -d /usr/nec; then
- version_type=linux # correct to gnu/linux during the next big refactor
- library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext'
- soname_spec='$libname$shared_ext.$major'
- shlibpath_var=LD_LIBRARY_PATH
- fi
- ;;
-
-sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
- version_type=freebsd-elf
- need_lib_prefix=no
- need_version=no
- library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext'
- soname_spec='$libname$release$shared_ext$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- if test yes = "$with_gnu_ld"; then
- sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
- else
- sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
- case $host_os in
- sco3.2v5*)
- sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
- ;;
- esac
- fi
- sys_lib_dlsearch_path_spec='/usr/lib'
- ;;
-
-tpf*)
- # TPF is a cross-target only. Preferred cross-host = GNU/Linux.
- version_type=linux # correct to gnu/linux during the next big refactor
- need_lib_prefix=no
- need_version=no
- library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- ;;
-
-uts4*)
- version_type=linux # correct to gnu/linux during the next big refactor
- library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
- soname_spec='$libname$release$shared_ext$major'
- shlibpath_var=LD_LIBRARY_PATH
- ;;
-
-*)
- dynamic_linker=no
- ;;
-esac
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5
-$as_echo "$dynamic_linker" >&6; }
-test no = "$dynamic_linker" && can_build_shared=no
-
-variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
-if test yes = "$GCC"; then
- variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
-fi
-
-if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then
- sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec
-fi
-if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then
- sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec
-fi
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5
-$as_echo_n "checking how to hardcode library paths into programs... " >&6; }
-hardcode_action=
-if test -n "$hardcode_libdir_flag_spec" ||
- test -n "$runpath_var" ||
- test yes = "$hardcode_automatic"; then
-
- # We can hardcode non-existent directories.
- if test no != "$hardcode_direct" &&
- # If the only mechanism to avoid hardcoding is shlibpath_var, we
- # have to relink, otherwise we might link with an installed library
- # when we should be linking with a yet-to-be-installed one
- ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, )" &&
- test no != "$hardcode_minus_L"; then
- # Linking always hardcodes the temporary library directory.
- hardcode_action=relink
- else
- # We can link without hardcoding, and we can hardcode nonexisting dirs.
- hardcode_action=immediate
- fi
-else
- # We cannot hardcode anything, or else we can only hardcode existing
- # directories.
- hardcode_action=unsupported
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5
-$as_echo "$hardcode_action" >&6; }
-
-if test relink = "$hardcode_action" ||
- test yes = "$inherit_rpath"; then
- # Fast installation is not supported
- enable_fast_install=no
-elif test yes = "$shlibpath_overrides_runpath" ||
- test no = "$enable_shared"; then
- # Fast installation is not necessary
- enable_fast_install=needless
-fi
-
-
-
-
-
-
- if test yes != "$enable_dlopen"; then
- enable_dlopen=unknown
- enable_dlopen_self=unknown
- enable_dlopen_self_static=unknown
-else
- lt_cv_dlopen=no
- lt_cv_dlopen_libs=
-
- case $host_os in
- beos*)
- lt_cv_dlopen=load_add_on
- lt_cv_dlopen_libs=
- lt_cv_dlopen_self=yes
- ;;
-
- mingw* | pw32* | cegcc*)
- lt_cv_dlopen=LoadLibrary
- lt_cv_dlopen_libs=
- ;;
-
- cygwin*)
- lt_cv_dlopen=dlopen
- lt_cv_dlopen_libs=
- ;;
-
- darwin*)
- # if libdl is installed we need to link against it
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
-$as_echo_n "checking for dlopen in -ldl... " >&6; }
-if ${ac_cv_lib_dl_dlopen+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-ldl $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char dlopen ();
-int
-main ()
-{
-return dlopen ();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_dl_dlopen=yes
-else
- ac_cv_lib_dl_dlopen=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5
-$as_echo "$ac_cv_lib_dl_dlopen" >&6; }
-if test "x$ac_cv_lib_dl_dlopen" = xyes; then :
- lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl
-else
-
- lt_cv_dlopen=dyld
- lt_cv_dlopen_libs=
- lt_cv_dlopen_self=yes
-
-fi
-
- ;;
-
- tpf*)
- # Don't try to run any link tests for TPF. We know it's impossible
- # because TPF is a cross-compiler, and we know how we open DSOs.
- lt_cv_dlopen=dlopen
- lt_cv_dlopen_libs=
- lt_cv_dlopen_self=no
- ;;
-
- *)
- ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load"
-if test "x$ac_cv_func_shl_load" = xyes; then :
- lt_cv_dlopen=shl_load
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5
-$as_echo_n "checking for shl_load in -ldld... " >&6; }
-if ${ac_cv_lib_dld_shl_load+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-ldld $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char shl_load ();
-int
-main ()
-{
-return shl_load ();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_dld_shl_load=yes
-else
- ac_cv_lib_dld_shl_load=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5
-$as_echo "$ac_cv_lib_dld_shl_load" >&6; }
-if test "x$ac_cv_lib_dld_shl_load" = xyes; then :
- lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld
-else
- ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen"
-if test "x$ac_cv_func_dlopen" = xyes; then :
- lt_cv_dlopen=dlopen
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
-$as_echo_n "checking for dlopen in -ldl... " >&6; }
-if ${ac_cv_lib_dl_dlopen+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-ldl $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char dlopen ();
-int
-main ()
-{
-return dlopen ();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_dl_dlopen=yes
-else
- ac_cv_lib_dl_dlopen=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5
-$as_echo "$ac_cv_lib_dl_dlopen" >&6; }
-if test "x$ac_cv_lib_dl_dlopen" = xyes; then :
- lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5
-$as_echo_n "checking for dlopen in -lsvld... " >&6; }
-if ${ac_cv_lib_svld_dlopen+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lsvld $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char dlopen ();
-int
-main ()
-{
-return dlopen ();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_svld_dlopen=yes
-else
- ac_cv_lib_svld_dlopen=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5
-$as_echo "$ac_cv_lib_svld_dlopen" >&6; }
-if test "x$ac_cv_lib_svld_dlopen" = xyes; then :
- lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5
-$as_echo_n "checking for dld_link in -ldld... " >&6; }
-if ${ac_cv_lib_dld_dld_link+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-ldld $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char dld_link ();
-int
-main ()
-{
-return dld_link ();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_dld_dld_link=yes
-else
- ac_cv_lib_dld_dld_link=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5
-$as_echo "$ac_cv_lib_dld_dld_link" >&6; }
-if test "x$ac_cv_lib_dld_dld_link" = xyes; then :
- lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld
-fi
-
-
-fi
-
-
-fi
-
-
-fi
-
-
-fi
-
-
-fi
-
- ;;
- esac
-
- if test no = "$lt_cv_dlopen"; then
- enable_dlopen=no
- else
- enable_dlopen=yes
- fi
-
- case $lt_cv_dlopen in
- dlopen)
- save_CPPFLAGS=$CPPFLAGS
- test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
-
- save_LDFLAGS=$LDFLAGS
- wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
-
- save_LIBS=$LIBS
- LIBS="$lt_cv_dlopen_libs $LIBS"
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5
-$as_echo_n "checking whether a program can dlopen itself... " >&6; }
-if ${lt_cv_dlopen_self+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test yes = "$cross_compiling"; then :
- lt_cv_dlopen_self=cross
-else
- lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
- lt_status=$lt_dlunknown
- cat > conftest.$ac_ext <<_LT_EOF
-#line $LINENO "configure"
-#include "confdefs.h"
-
-#if HAVE_DLFCN_H
-#include <dlfcn.h>
-#endif
-
-#include <stdio.h>
-
-#ifdef RTLD_GLOBAL
-# define LT_DLGLOBAL RTLD_GLOBAL
-#else
-# ifdef DL_GLOBAL
-# define LT_DLGLOBAL DL_GLOBAL
-# else
-# define LT_DLGLOBAL 0
-# endif
-#endif
-
-/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
- find out it does not work in some platform. */
-#ifndef LT_DLLAZY_OR_NOW
-# ifdef RTLD_LAZY
-# define LT_DLLAZY_OR_NOW RTLD_LAZY
-# else
-# ifdef DL_LAZY
-# define LT_DLLAZY_OR_NOW DL_LAZY
-# else
-# ifdef RTLD_NOW
-# define LT_DLLAZY_OR_NOW RTLD_NOW
-# else
-# ifdef DL_NOW
-# define LT_DLLAZY_OR_NOW DL_NOW
-# else
-# define LT_DLLAZY_OR_NOW 0
-# endif
-# endif
-# endif
-# endif
-#endif
-
-/* When -fvisbility=hidden is used, assume the code has been annotated
- correspondingly for the symbols needed. */
-#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
-int fnord () __attribute__((visibility("default")));
-#endif
-
-int fnord () { return 42; }
-int main ()
-{
- void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
- int status = $lt_dlunknown;
-
- if (self)
- {
- if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
- else
- {
- if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
- else puts (dlerror ());
- }
- /* dlclose (self); */
- }
- else
- puts (dlerror ());
-
- return status;
-}
-_LT_EOF
- if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
- (eval $ac_link) 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then
- (./conftest; exit; ) >&5 2>/dev/null
- lt_status=$?
- case x$lt_status in
- x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;;
- x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;;
- x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;;
- esac
- else :
- # compilation failed
- lt_cv_dlopen_self=no
- fi
-fi
-rm -fr conftest*
-
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5
-$as_echo "$lt_cv_dlopen_self" >&6; }
-
- if test yes = "$lt_cv_dlopen_self"; then
- wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5
-$as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; }
-if ${lt_cv_dlopen_self_static+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test yes = "$cross_compiling"; then :
- lt_cv_dlopen_self_static=cross
-else
- lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
- lt_status=$lt_dlunknown
- cat > conftest.$ac_ext <<_LT_EOF
-#line $LINENO "configure"
-#include "confdefs.h"
-
-#if HAVE_DLFCN_H
-#include <dlfcn.h>
-#endif
-
-#include <stdio.h>
-
-#ifdef RTLD_GLOBAL
-# define LT_DLGLOBAL RTLD_GLOBAL
-#else
-# ifdef DL_GLOBAL
-# define LT_DLGLOBAL DL_GLOBAL
-# else
-# define LT_DLGLOBAL 0
-# endif
-#endif
-
-/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
- find out it does not work in some platform. */
-#ifndef LT_DLLAZY_OR_NOW
-# ifdef RTLD_LAZY
-# define LT_DLLAZY_OR_NOW RTLD_LAZY
-# else
-# ifdef DL_LAZY
-# define LT_DLLAZY_OR_NOW DL_LAZY
-# else
-# ifdef RTLD_NOW
-# define LT_DLLAZY_OR_NOW RTLD_NOW
-# else
-# ifdef DL_NOW
-# define LT_DLLAZY_OR_NOW DL_NOW
-# else
-# define LT_DLLAZY_OR_NOW 0
-# endif
-# endif
-# endif
-# endif
-#endif
-
-/* When -fvisbility=hidden is used, assume the code has been annotated
- correspondingly for the symbols needed. */
-#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
-int fnord () __attribute__((visibility("default")));
-#endif
-
-int fnord () { return 42; }
-int main ()
-{
- void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
- int status = $lt_dlunknown;
-
- if (self)
- {
- if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
- else
- {
- if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
- else puts (dlerror ());
- }
- /* dlclose (self); */
- }
- else
- puts (dlerror ());
-
- return status;
-}
-_LT_EOF
- if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
- (eval $ac_link) 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then
- (./conftest; exit; ) >&5 2>/dev/null
- lt_status=$?
- case x$lt_status in
- x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;;
- x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;;
- x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;;
- esac
- else :
- # compilation failed
- lt_cv_dlopen_self_static=no
- fi
-fi
-rm -fr conftest*
-
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5
-$as_echo "$lt_cv_dlopen_self_static" >&6; }
- fi
-
- CPPFLAGS=$save_CPPFLAGS
- LDFLAGS=$save_LDFLAGS
- LIBS=$save_LIBS
- ;;
- esac
-
- case $lt_cv_dlopen_self in
- yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
- *) enable_dlopen_self=unknown ;;
- esac
-
- case $lt_cv_dlopen_self_static in
- yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
- *) enable_dlopen_self_static=unknown ;;
- esac
-fi
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-striplib=
-old_striplib=
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5
-$as_echo_n "checking whether stripping libraries is possible... " >&6; }
-if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
- test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
- test -z "$striplib" && striplib="$STRIP --strip-unneeded"
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-else
-# FIXME - insert some real tests, host_os isn't really good enough
- case $host_os in
- darwin*)
- if test -n "$STRIP"; then
- striplib="$STRIP -x"
- old_striplib="$STRIP -S"
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
- fi
- ;;
- *)
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
- ;;
- esac
-fi
-
-
-
-
-
-
-
-
-
-
-
-
- # Report what library types will actually be built
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5
-$as_echo_n "checking if libtool supports shared libraries... " >&6; }
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5
-$as_echo "$can_build_shared" >&6; }
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5
-$as_echo_n "checking whether to build shared libraries... " >&6; }
- test no = "$can_build_shared" && enable_shared=no
-
- # On AIX, shared libraries and static libraries use the same namespace, and
- # are all built from PIC.
- case $host_os in
- aix3*)
- test yes = "$enable_shared" && enable_static=no
- if test -n "$RANLIB"; then
- archive_cmds="$archive_cmds~\$RANLIB \$lib"
- postinstall_cmds='$RANLIB $lib'
- fi
- ;;
-
- aix[4-9]*)
- if test ia64 != "$host_cpu" && test no = "$aix_use_runtimelinking"; then
- test yes = "$enable_shared" && enable_static=no
- fi
- ;;
- esac
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5
-$as_echo "$enable_shared" >&6; }
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5
-$as_echo_n "checking whether to build static libraries... " >&6; }
- # Make sure either enable_shared or enable_static is yes.
- test yes = "$enable_shared" || enable_static=yes
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5
-$as_echo "$enable_static" >&6; }
-
-
-
-
-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=$lt_save_CC
-
- if test -n "$CXX" && ( test no != "$CXX" &&
- ( (test g++ = "$CXX" && `g++ -v >/dev/null 2>&1` ) ||
- (test g++ != "$CXX"))); then
- ac_ext=cpp
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C++ preprocessor" >&5
-$as_echo_n "checking how to run the C++ preprocessor... " >&6; }
-if test -z "$CXXCPP"; then
- if ${ac_cv_prog_CXXCPP+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- # Double quotes because CXXCPP needs to be expanded
- for CXXCPP in "$CXX -E" "/lib/cpp"
- do
- ac_preproc_ok=false
-for ac_cxx_preproc_warn_flag in '' yes
-do
- # Use a header file that comes with gcc, so configuring glibc
- # with a fresh cross-compiler works.
- # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- # <limits.h> exists even on freestanding compilers.
- # On the NeXT, cc -E runs the code through the compiler's parser,
- # not just through cpp. "Syntax error" is here to catch this case.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
- Syntax error
-_ACEOF
-if ac_fn_cxx_try_cpp "$LINENO"; then :
-
-else
- # Broken: fails on valid input.
-continue
-fi
-rm -f conftest.err conftest.i conftest.$ac_ext
-
- # OK, works on sane cases. Now check whether nonexistent headers
- # can be detected and how.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <ac_nonexistent.h>
-_ACEOF
-if ac_fn_cxx_try_cpp "$LINENO"; then :
- # Broken: success on invalid input.
-continue
-else
- # Passes both tests.
-ac_preproc_ok=:
-break
-fi
-rm -f conftest.err conftest.i conftest.$ac_ext
-
-done
-# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.i conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then :
- break
-fi
-
- done
- ac_cv_prog_CXXCPP=$CXXCPP
-
-fi
- CXXCPP=$ac_cv_prog_CXXCPP
-else
- ac_cv_prog_CXXCPP=$CXXCPP
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXXCPP" >&5
-$as_echo "$CXXCPP" >&6; }
-ac_preproc_ok=false
-for ac_cxx_preproc_warn_flag in '' yes
-do
- # Use a header file that comes with gcc, so configuring glibc
- # with a fresh cross-compiler works.
- # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- # <limits.h> exists even on freestanding compilers.
- # On the NeXT, cc -E runs the code through the compiler's parser,
- # not just through cpp. "Syntax error" is here to catch this case.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
- Syntax error
-_ACEOF
-if ac_fn_cxx_try_cpp "$LINENO"; then :
-
-else
- # Broken: fails on valid input.
-continue
-fi
-rm -f conftest.err conftest.i conftest.$ac_ext
-
- # OK, works on sane cases. Now check whether nonexistent headers
- # can be detected and how.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <ac_nonexistent.h>
-_ACEOF
-if ac_fn_cxx_try_cpp "$LINENO"; then :
- # Broken: success on invalid input.
-continue
-else
- # Passes both tests.
-ac_preproc_ok=:
-break
-fi
-rm -f conftest.err conftest.i conftest.$ac_ext
-
-done
-# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.i conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then :
-
-else
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "C++ preprocessor \"$CXXCPP\" fails sanity check
-See \`config.log' for more details" "$LINENO" 5; }
-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
-
-else
- _lt_caught_CXX_error=yes
-fi
-
-ac_ext=cpp
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-
-archive_cmds_need_lc_CXX=no
-allow_undefined_flag_CXX=
-always_export_symbols_CXX=no
-archive_expsym_cmds_CXX=
-compiler_needs_object_CXX=no
-export_dynamic_flag_spec_CXX=
-hardcode_direct_CXX=no
-hardcode_direct_absolute_CXX=no
-hardcode_libdir_flag_spec_CXX=
-hardcode_libdir_separator_CXX=
-hardcode_minus_L_CXX=no
-hardcode_shlibpath_var_CXX=unsupported
-hardcode_automatic_CXX=no
-inherit_rpath_CXX=no
-module_cmds_CXX=
-module_expsym_cmds_CXX=
-link_all_deplibs_CXX=unknown
-old_archive_cmds_CXX=$old_archive_cmds
-reload_flag_CXX=$reload_flag
-reload_cmds_CXX=$reload_cmds
-no_undefined_flag_CXX=
-whole_archive_flag_spec_CXX=
-enable_shared_with_static_runtimes_CXX=no
-
-# Source file extension for C++ test sources.
-ac_ext=cpp
-
-# Object file extension for compiled C++ test sources.
-objext=o
-objext_CXX=$objext
-
-# No sense in running all these tests if we already determined that
-# the CXX compiler isn't working. Some variables (like enable_shared)
-# are currently assumed to apply to all compilers on this platform,
-# and will be corrupted by setting them based on a non-working compiler.
-if test yes != "$_lt_caught_CXX_error"; then
- # Code to be used in simple compile tests
- lt_simple_compile_test_code="int some_variable = 0;"
-
- # Code to be used in simple link tests
- lt_simple_link_test_code='int main(int, char *[]) { return(0); }'
-
- # ltmain only uses $CC for tagged configurations so make sure $CC is set.
-
-
-
-
-
-
-# If no C compiler was specified, use CC.
-LTCC=${LTCC-"$CC"}
-
-# If no C compiler flags were specified, use CFLAGS.
-LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
-
-# Allow CC to be a program name with arguments.
-compiler=$CC
-
-
- # save warnings/boilerplate of simple test code
- ac_outfile=conftest.$ac_objext
-echo "$lt_simple_compile_test_code" >conftest.$ac_ext
-eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
-_lt_compiler_boilerplate=`cat conftest.err`
-$RM conftest*
-
- ac_outfile=conftest.$ac_objext
-echo "$lt_simple_link_test_code" >conftest.$ac_ext
-eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
-_lt_linker_boilerplate=`cat conftest.err`
-$RM -r conftest*
-
-
- # Allow CC to be a program name with arguments.
- lt_save_CC=$CC
- lt_save_CFLAGS=$CFLAGS
- lt_save_LD=$LD
- lt_save_GCC=$GCC
- GCC=$GXX
- lt_save_with_gnu_ld=$with_gnu_ld
- lt_save_path_LD=$lt_cv_path_LD
- if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
- lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
- else
- $as_unset lt_cv_prog_gnu_ld
- fi
- if test -n "${lt_cv_path_LDCXX+set}"; then
- lt_cv_path_LD=$lt_cv_path_LDCXX
- else
- $as_unset lt_cv_path_LD
- fi
- test -z "${LDCXX+set}" || LD=$LDCXX
- CC=${CXX-"c++"}
- CFLAGS=$CXXFLAGS
- compiler=$CC
- compiler_CXX=$CC
- for cc_temp in $compiler""; do
- case $cc_temp in
- compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
- distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
- \-*) ;;
- *) break;;
- esac
-done
-cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
-
-
- if test -n "$compiler"; then
- # We don't want -fno-exception when compiling C++ code, so set the
- # no_builtin_flag separately
- if test yes = "$GXX"; then
- lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin'
- else
- lt_prog_compiler_no_builtin_flag_CXX=
- fi
-
- if test yes = "$GXX"; then
- # Set up default GNU C++ configuration
-
-
-
-# Check whether --with-gnu-ld was given.
-if test "${with_gnu_ld+set}" = set; then :
- withval=$with_gnu_ld; test no = "$withval" || with_gnu_ld=yes
-else
- with_gnu_ld=no
-fi
-
-ac_prog=ld
-if test yes = "$GCC"; then
- # Check if gcc -print-prog-name=ld gives a path.
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5
-$as_echo_n "checking for ld used by $CC... " >&6; }
- 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.
- [\\/]* | ?:[\\/]*)
- re_direlt='/[^/][^/]*/\.\./'
- # Canonicalize the pathname 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 yes = "$with_gnu_ld"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5
-$as_echo_n "checking for GNU ld... " >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5
-$as_echo_n "checking for non-GNU ld... " >&6; }
-fi
-if ${lt_cv_path_LD+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -z "$LD"; then
- lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
- for ac_dir in $PATH; do
- IFS=$lt_save_ifs
- test -z "$ac_dir" && ac_dir=.
- if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
- lt_cv_path_LD=$ac_dir/$ac_prog
- # Check to see if the program is GNU ld. I'd rather use --version,
- # but apparently some variants of GNU ld only accept -v.
- # Break only if it was the GNU/non-GNU ld that we prefer.
- case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
- *GNU* | *'with BFD'*)
- test no != "$with_gnu_ld" && break
- ;;
- *)
- test yes != "$with_gnu_ld" && break
- ;;
- esac
- fi
- done
- IFS=$lt_save_ifs
-else
- lt_cv_path_LD=$LD # Let the user override the test with a path.
-fi
-fi
-
-LD=$lt_cv_path_LD
-if test -n "$LD"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5
-$as_echo "$LD" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5
-$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; }
-if ${lt_cv_prog_gnu_ld+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- # I'd rather use --version here, but apparently some GNU lds only accept -v.
-case `$LD -v 2>&1 </dev/null` in
-*GNU* | *'with BFD'*)
- lt_cv_prog_gnu_ld=yes
- ;;
-*)
- lt_cv_prog_gnu_ld=no
- ;;
-esac
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_gnu_ld" >&5
-$as_echo "$lt_cv_prog_gnu_ld" >&6; }
-with_gnu_ld=$lt_cv_prog_gnu_ld
-
-
-
-
-
-
-
- # Check if GNU C++ uses GNU ld as the underlying linker, since the
- # archiving commands below assume that GNU ld is being used.
- if test yes = "$with_gnu_ld"; then
- archive_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
- archive_expsym_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
-
- hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir'
- export_dynamic_flag_spec_CXX='$wl--export-dynamic'
-
- # If archive_cmds runs LD, not CC, wlarc should be empty
- # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
- # investigate it a little bit more. (MM)
- wlarc='$wl'
-
- # ancient GNU ld didn't support --whole-archive et. al.
- if eval "`$CC -print-prog-name=ld` --help 2>&1" |
- $GREP 'no-whole-archive' > /dev/null; then
- whole_archive_flag_spec_CXX=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
- else
- whole_archive_flag_spec_CXX=
- fi
- else
- with_gnu_ld=no
- wlarc=
-
- # A generic and very simple default shared library creation
- # command for GNU C++ for the case where it uses the native
- # linker, instead of GNU ld. If possible, this setting should
- # overridden to take advantage of the native linker features on
- # the platform it is being used on.
- archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
- fi
-
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
-
- else
- GXX=no
- with_gnu_ld=no
- wlarc=
- fi
-
- # PORTME: fill in a description of your system's C++ link characteristics
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5
-$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; }
- ld_shlibs_CXX=yes
- case $host_os in
- aix3*)
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- aix[4-9]*)
- if test ia64 = "$host_cpu"; then
- # On IA64, the linker does run time linking by default, so we don't
- # have to do anything special.
- aix_use_runtimelinking=no
- exp_sym_flag='-Bexport'
- no_entry_flag=
- else
- aix_use_runtimelinking=no
-
- # Test if we are trying to use run time linking or normal
- # AIX style linking. If -brtl is somewhere in LDFLAGS, we
- # need to do runtime linking.
- case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
- for ld_flag in $LDFLAGS; do
- case $ld_flag in
- *-brtl*)
- aix_use_runtimelinking=yes
- break
- ;;
- esac
- done
- ;;
- esac
-
- exp_sym_flag='-bexport'
- no_entry_flag='-bnoentry'
- fi
-
- # When large executables or shared objects are built, AIX ld can
- # have problems creating the table of contents. If linking a library
- # or program results in "error TOC overflow" add -mminimal-toc to
- # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
- # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
-
- archive_cmds_CXX=''
- hardcode_direct_CXX=yes
- hardcode_direct_absolute_CXX=yes
- hardcode_libdir_separator_CXX=':'
- link_all_deplibs_CXX=yes
- file_list_spec_CXX='$wl-f,'
-
- if test yes = "$GXX"; then
- case $host_os in aix4.[012]|aix4.[012].*)
- # We only want to do this on AIX 4.2 and lower, the check
- # below for broken collect2 doesn't work under 4.3+
- collect2name=`$CC -print-prog-name=collect2`
- if test -f "$collect2name" &&
- strings "$collect2name" | $GREP resolve_lib_name >/dev/null
- then
- # We have reworked collect2
- :
- else
- # We have old collect2
- hardcode_direct_CXX=unsupported
- # It fails to find uninstalled libraries when the uninstalled
- # path is not listed in the libpath. Setting hardcode_minus_L
- # to unsupported forces relinking
- hardcode_minus_L_CXX=yes
- hardcode_libdir_flag_spec_CXX='-L$libdir'
- hardcode_libdir_separator_CXX=
- fi
- esac
- shared_flag='-shared'
- if test yes = "$aix_use_runtimelinking"; then
- shared_flag=$shared_flag' $wl-G'
- fi
- else
- # not using gcc
- if test ia64 = "$host_cpu"; then
- # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
- # chokes on -Wl,-G. The following line is correct:
- shared_flag='-G'
- else
- if test yes = "$aix_use_runtimelinking"; then
- shared_flag='$wl-G'
- else
- shared_flag='$wl-bM:SRE'
- fi
- fi
- fi
-
- export_dynamic_flag_spec_CXX='$wl-bexpall'
- # It seems that -bexpall does not export symbols beginning with
- # underscore (_), so it is better to generate a list of symbols to
- # export.
- always_export_symbols_CXX=yes
- if test yes = "$aix_use_runtimelinking"; then
- # Warning - without using the other runtime loading flags (-brtl),
- # -berok will link without error, but may produce a broken library.
- allow_undefined_flag_CXX='-berok'
- # Determine the default libpath from the value encoded in an empty
- # executable.
- if test set = "${lt_cv_aix_libpath+set}"; then
- aix_libpath=$lt_cv_aix_libpath
-else
- if ${lt_cv_aix_libpath__CXX+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_cxx_try_link "$LINENO"; then :
-
- lt_aix_libpath_sed='
- /Import File Strings/,/^$/ {
- /^0/ {
- s/^0 *\([^ ]*\) *$/\1/
- p
- }
- }'
- lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
- # Check for a 64-bit object if we didn't find anything.
- if test -z "$lt_cv_aix_libpath__CXX"; then
- lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
- fi
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
- if test -z "$lt_cv_aix_libpath__CXX"; then
- lt_cv_aix_libpath__CXX=/usr/lib:/lib
- fi
-
-fi
-
- aix_libpath=$lt_cv_aix_libpath__CXX
-fi
-
- hardcode_libdir_flag_spec_CXX='$wl-blibpath:$libdir:'"$aix_libpath"
-
- archive_expsym_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag
- else
- if test ia64 = "$host_cpu"; then
- hardcode_libdir_flag_spec_CXX='$wl-R $libdir:/usr/lib:/lib'
- allow_undefined_flag_CXX="-z nodefs"
- archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols"
- else
- # Determine the default libpath from the value encoded in an
- # empty executable.
- if test set = "${lt_cv_aix_libpath+set}"; then
- aix_libpath=$lt_cv_aix_libpath
-else
- if ${lt_cv_aix_libpath__CXX+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_cxx_try_link "$LINENO"; then :
-
- lt_aix_libpath_sed='
- /Import File Strings/,/^$/ {
- /^0/ {
- s/^0 *\([^ ]*\) *$/\1/
- p
- }
- }'
- lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
- # Check for a 64-bit object if we didn't find anything.
- if test -z "$lt_cv_aix_libpath__CXX"; then
- lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
- fi
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
- if test -z "$lt_cv_aix_libpath__CXX"; then
- lt_cv_aix_libpath__CXX=/usr/lib:/lib
- fi
-
-fi
-
- aix_libpath=$lt_cv_aix_libpath__CXX
-fi
-
- hardcode_libdir_flag_spec_CXX='$wl-blibpath:$libdir:'"$aix_libpath"
- # Warning - without using the other run time loading flags,
- # -berok will link without error, but may produce a broken library.
- no_undefined_flag_CXX=' $wl-bernotok'
- allow_undefined_flag_CXX=' $wl-berok'
- if test yes = "$with_gnu_ld"; then
- # We only use this code for GNU lds that support --whole-archive.
- whole_archive_flag_spec_CXX='$wl--whole-archive$convenience $wl--no-whole-archive'
- else
- # Exported symbols can be pulled into shared objects from archives
- whole_archive_flag_spec_CXX='$convenience'
- fi
- archive_cmds_need_lc_CXX=yes
- # This is similar to how AIX traditionally builds its shared
- # libraries.
- archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $wl-bnoentry $compiler_flags $wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
- fi
- fi
- ;;
-
- beos*)
- if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
- allow_undefined_flag_CXX=unsupported
- # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
- # support --undefined. This deserves some investigation. FIXME
- archive_cmds_CXX='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
- else
- ld_shlibs_CXX=no
- fi
- ;;
-
- chorus*)
- case $cc_basename in
- *)
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- esac
- ;;
-
- cygwin* | mingw* | pw32* | cegcc*)
- case $GXX,$cc_basename in
- ,cl* | no,cl*)
- # Native MSVC
- # hardcode_libdir_flag_spec is actually meaningless, as there is
- # no search path for DLLs.
- hardcode_libdir_flag_spec_CXX=' '
- allow_undefined_flag_CXX=unsupported
- always_export_symbols_CXX=yes
- file_list_spec_CXX='@'
- # Tell ltmain to make .lib files, not .a files.
- libext=lib
- # Tell ltmain to make .dll files, not .so files.
- shrext_cmds=.dll
- # FIXME: Setting linknames here is a bad hack.
- archive_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames='
- archive_expsym_cmds_CXX='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then
- cp "$export_symbols" "$output_objdir/$soname.def";
- echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp";
- else
- $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp;
- fi~
- $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
- linknames='
- # The linker will not automatically build a static lib if we build a DLL.
- # _LT_TAGVAR(old_archive_from_new_cmds, CXX)='true'
- enable_shared_with_static_runtimes_CXX=yes
- # Don't use ranlib
- old_postinstall_cmds_CXX='chmod 644 $oldlib'
- postlink_cmds_CXX='lt_outputfile="@OUTPUT@"~
- lt_tool_outputfile="@TOOL_OUTPUT@"~
- case $lt_outputfile in
- *.exe|*.EXE) ;;
- *)
- lt_outputfile=$lt_outputfile.exe
- lt_tool_outputfile=$lt_tool_outputfile.exe
- ;;
- esac~
- func_to_tool_file "$lt_outputfile"~
- if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then
- $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
- $RM "$lt_outputfile.manifest";
- fi'
- ;;
- *)
- # g++
- # _LT_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless,
- # as there is no search path for DLLs.
- hardcode_libdir_flag_spec_CXX='-L$libdir'
- export_dynamic_flag_spec_CXX='$wl--export-all-symbols'
- allow_undefined_flag_CXX=unsupported
- always_export_symbols_CXX=no
- enable_shared_with_static_runtimes_CXX=yes
-
- if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
- archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
- # If the export-symbols file already is a .def file, use it as
- # is; otherwise, prepend EXPORTS...
- archive_expsym_cmds_CXX='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then
- cp $export_symbols $output_objdir/$soname.def;
- else
- echo EXPORTS > $output_objdir/$soname.def;
- cat $export_symbols >> $output_objdir/$soname.def;
- fi~
- $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
- else
- ld_shlibs_CXX=no
- fi
- ;;
- esac
- ;;
- darwin* | rhapsody*)
-
-
- archive_cmds_need_lc_CXX=no
- hardcode_direct_CXX=no
- hardcode_automatic_CXX=yes
- hardcode_shlibpath_var_CXX=unsupported
- if test yes = "$lt_cv_ld_force_load"; then
- whole_archive_flag_spec_CXX='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
-
- else
- whole_archive_flag_spec_CXX=''
- fi
- link_all_deplibs_CXX=yes
- allow_undefined_flag_CXX=$_lt_dar_allow_undefined
- case $cc_basename in
- ifort*|nagfor*) _lt_dar_can_shared=yes ;;
- *) _lt_dar_can_shared=$GCC ;;
- esac
- if test yes = "$_lt_dar_can_shared"; then
- output_verbose_link_cmd=func_echo_all
- archive_cmds_CXX="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil"
- module_cmds_CXX="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil"
- archive_expsym_cmds_CXX="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil"
- module_expsym_cmds_CXX="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil"
- if test yes != "$lt_cv_apple_cc_single_mod"; then
- archive_cmds_CXX="\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dsymutil"
- archive_expsym_cmds_CXX="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dar_export_syms$_lt_dsymutil"
- fi
-
- else
- ld_shlibs_CXX=no
- fi
-
- ;;
-
- dgux*)
- case $cc_basename in
- ec++*)
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- ghcx*)
- # Green Hills C++ Compiler
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- *)
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- esac
- ;;
-
- freebsd2.*)
- # C++ shared libraries reported to be fairly broken before
- # switch to ELF
- ld_shlibs_CXX=no
- ;;
-
- freebsd-elf*)
- archive_cmds_need_lc_CXX=no
- ;;
-
- freebsd* | dragonfly*)
- # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
- # conventions
- ld_shlibs_CXX=yes
- ;;
-
- haiku*)
- archive_cmds_CXX='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
- link_all_deplibs_CXX=yes
- ;;
-
- hpux9*)
- hardcode_libdir_flag_spec_CXX='$wl+b $wl$libdir'
- hardcode_libdir_separator_CXX=:
- export_dynamic_flag_spec_CXX='$wl-E'
- hardcode_direct_CXX=yes
- hardcode_minus_L_CXX=yes # Not in the search PATH,
- # but as the default
- # location of the library.
-
- case $cc_basename in
- CC*)
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- aCC*)
- archive_cmds_CXX='$RM $output_objdir/$soname~$CC -b $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- #
- # There doesn't appear to be a way to prevent this compiler from
- # explicitly linking system object files so we need to strip them
- # from the output so that they don't get included in the library
- # dependencies.
- output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
- ;;
- *)
- if test yes = "$GXX"; then
- archive_cmds_CXX='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
- else
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- fi
- ;;
- esac
- ;;
-
- hpux10*|hpux11*)
- if test no = "$with_gnu_ld"; then
- hardcode_libdir_flag_spec_CXX='$wl+b $wl$libdir'
- hardcode_libdir_separator_CXX=:
-
- case $host_cpu in
- hppa*64*|ia64*)
- ;;
- *)
- export_dynamic_flag_spec_CXX='$wl-E'
- ;;
- esac
- fi
- case $host_cpu in
- hppa*64*|ia64*)
- hardcode_direct_CXX=no
- hardcode_shlibpath_var_CXX=no
- ;;
- *)
- hardcode_direct_CXX=yes
- hardcode_direct_absolute_CXX=yes
- hardcode_minus_L_CXX=yes # Not in the search PATH,
- # but as the default
- # location of the library.
- ;;
- esac
-
- case $cc_basename in
- CC*)
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- aCC*)
- case $host_cpu in
- hppa*64*)
- archive_cmds_CXX='$CC -b $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- ;;
- ia64*)
- archive_cmds_CXX='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- ;;
- *)
- archive_cmds_CXX='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- ;;
- esac
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- #
- # There doesn't appear to be a way to prevent this compiler from
- # explicitly linking system object files so we need to strip them
- # from the output so that they don't get included in the library
- # dependencies.
- output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
- ;;
- *)
- if test yes = "$GXX"; then
- if test no = "$with_gnu_ld"; then
- case $host_cpu in
- hppa*64*)
- archive_cmds_CXX='$CC -shared -nostdlib -fPIC $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- ;;
- ia64*)
- archive_cmds_CXX='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- ;;
- *)
- archive_cmds_CXX='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- ;;
- esac
- fi
- else
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- fi
- ;;
- esac
- ;;
-
- interix[3-9]*)
- hardcode_direct_CXX=no
- hardcode_shlibpath_var_CXX=no
- hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir'
- export_dynamic_flag_spec_CXX='$wl-E'
- # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
- # Instead, shared libraries are loaded at an image base (0x10000000 by
- # default) and relocated if they conflict, which is a slow very memory
- # consuming and fragmenting process. To avoid this, we pick a random,
- # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
- # time. Moving up from 0x10000000 also allows more sbrk(2) space.
- archive_cmds_CXX='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
- archive_expsym_cmds_CXX='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
- ;;
- irix5* | irix6*)
- case $cc_basename in
- CC*)
- # SGI C++
- archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
-
- # Archives containing C++ object files must be created using
- # "CC -ar", where "CC" is the IRIX C++ compiler. This is
- # necessary to make sure instantiated templates are included
- # in the archive.
- old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs'
- ;;
- *)
- if test yes = "$GXX"; then
- if test no = "$with_gnu_ld"; then
- archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
- else
- archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` -o $lib'
- fi
- fi
- link_all_deplibs_CXX=yes
- ;;
- esac
- hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir'
- hardcode_libdir_separator_CXX=:
- inherit_rpath_CXX=yes
- ;;
-
- linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
- case $cc_basename in
- KCC*)
- # Kuck and Associates, Inc. (KAI) C++ Compiler
-
- # KCC will only create a shared library if the output file
- # ends with ".so" (or ".sl" for HP-UX), so rename the library
- # to its proper name (with version) after linking.
- archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
- archive_expsym_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib $wl-retain-symbols-file,$export_symbols; mv \$templib $lib'
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- #
- # There doesn't appear to be a way to prevent this compiler from
- # explicitly linking system object files so we need to strip them
- # from the output so that they don't get included in the library
- # dependencies.
- output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
-
- hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir'
- export_dynamic_flag_spec_CXX='$wl--export-dynamic'
-
- # Archives containing C++ object files must be created using
- # "CC -Bstatic", where "CC" is the KAI C++ compiler.
- old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs'
- ;;
- icpc* | ecpc* )
- # Intel C++
- with_gnu_ld=yes
- # version 8.0 and above of icpc choke on multiply defined symbols
- # if we add $predep_objects and $postdep_objects, however 7.1 and
- # earlier do not add the objects themselves.
- case `$CC -V 2>&1` in
- *"Version 7."*)
- archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
- archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
- ;;
- *) # Version 8.0 or newer
- tmp_idyn=
- case $host_cpu in
- ia64*) tmp_idyn=' -i_dynamic';;
- esac
- archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
- archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
- ;;
- esac
- archive_cmds_need_lc_CXX=no
- hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir'
- export_dynamic_flag_spec_CXX='$wl--export-dynamic'
- whole_archive_flag_spec_CXX='$wl--whole-archive$convenience $wl--no-whole-archive'
- ;;
- pgCC* | pgcpp*)
- # Portland Group C++ compiler
- case `$CC -V` in
- *pgCC\ [1-5].* | *pgcpp\ [1-5].*)
- prelink_cmds_CXX='tpldir=Template.dir~
- rm -rf $tpldir~
- $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
- compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
- old_archive_cmds_CXX='tpldir=Template.dir~
- rm -rf $tpldir~
- $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
- $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
- $RANLIB $oldlib'
- archive_cmds_CXX='tpldir=Template.dir~
- rm -rf $tpldir~
- $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
- $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
- archive_expsym_cmds_CXX='tpldir=Template.dir~
- rm -rf $tpldir~
- $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
- $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
- ;;
- *) # Version 6 and above use weak symbols
- archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
- archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
- ;;
- esac
-
- hardcode_libdir_flag_spec_CXX='$wl--rpath $wl$libdir'
- export_dynamic_flag_spec_CXX='$wl--export-dynamic'
- whole_archive_flag_spec_CXX='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
- ;;
- cxx*)
- # Compaq C++
- archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
- archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib $wl-retain-symbols-file $wl$export_symbols'
-
- runpath_var=LD_RUN_PATH
- hardcode_libdir_flag_spec_CXX='-rpath $libdir'
- hardcode_libdir_separator_CXX=:
-
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- #
- # There doesn't appear to be a way to prevent this compiler from
- # explicitly linking system object files so we need to strip them
- # from the output so that they don't get included in the library
- # dependencies.
- output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed'
- ;;
- xl* | mpixl* | bgxl*)
- # IBM XL 8.0 on PPC, with GNU ld
- hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir'
- export_dynamic_flag_spec_CXX='$wl--export-dynamic'
- archive_cmds_CXX='$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
- if test yes = "$supports_anon_versioning"; then
- archive_expsym_cmds_CXX='echo "{ global:" > $output_objdir/$libname.ver~
- cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
- echo "local: *; };" >> $output_objdir/$libname.ver~
- $CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib'
- fi
- ;;
- *)
- case `$CC -V 2>&1 | sed 5q` in
- *Sun\ C*)
- # Sun C++ 5.9
- no_undefined_flag_CXX=' -zdefs'
- archive_cmds_CXX='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- archive_expsym_cmds_CXX='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file $wl$export_symbols'
- hardcode_libdir_flag_spec_CXX='-R$libdir'
- whole_archive_flag_spec_CXX='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
- compiler_needs_object_CXX=yes
-
- # Not sure whether something based on
- # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
- # would be better.
- output_verbose_link_cmd='func_echo_all'
-
- # Archives containing C++ object files must be created using
- # "CC -xar", where "CC" is the Sun C++ compiler. This is
- # necessary to make sure instantiated templates are included
- # in the archive.
- old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs'
- ;;
- esac
- ;;
- esac
- ;;
-
- lynxos*)
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
-
- m88k*)
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
-
- mvs*)
- case $cc_basename in
- cxx*)
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- *)
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- esac
- ;;
-
- netbsd*)
- if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
- archive_cmds_CXX='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
- wlarc=
- hardcode_libdir_flag_spec_CXX='-R$libdir'
- hardcode_direct_CXX=yes
- hardcode_shlibpath_var_CXX=no
- fi
- # Workaround some broken pre-1.5 toolchains
- output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
- ;;
-
- *nto* | *qnx*)
- ld_shlibs_CXX=yes
- ;;
-
- openbsd* | bitrig*)
- if test -f /usr/libexec/ld.so; then
- hardcode_direct_CXX=yes
- hardcode_shlibpath_var_CXX=no
- hardcode_direct_absolute_CXX=yes
- archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
- hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir'
- if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`"; then
- archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file,$export_symbols -o $lib'
- export_dynamic_flag_spec_CXX='$wl-E'
- whole_archive_flag_spec_CXX=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
- fi
- output_verbose_link_cmd=func_echo_all
- else
- ld_shlibs_CXX=no
- fi
- ;;
-
- osf3* | osf4* | osf5*)
- case $cc_basename in
- KCC*)
- # Kuck and Associates, Inc. (KAI) C++ Compiler
-
- # KCC will only create a shared library if the output file
- # ends with ".so" (or ".sl" for HP-UX), so rename the library
- # to its proper name (with version) after linking.
- archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
-
- hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir'
- hardcode_libdir_separator_CXX=:
-
- # Archives containing C++ object files must be created using
- # the KAI C++ compiler.
- case $host in
- osf3*) old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;;
- *) old_archive_cmds_CXX='$CC -o $oldlib $oldobjs' ;;
- esac
- ;;
- RCC*)
- # Rational C++ 2.4.1
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- cxx*)
- case $host in
- osf3*)
- allow_undefined_flag_CXX=' $wl-expect_unresolved $wl\*'
- archive_cmds_CXX='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $soname `test -n "$verstring" && func_echo_all "$wl-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
- hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir'
- ;;
- *)
- allow_undefined_flag_CXX=' -expect_unresolved \*'
- archive_cmds_CXX='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
- archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
- echo "-hidden">> $lib.exp~
- $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname $wl-input $wl$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~
- $RM $lib.exp'
- hardcode_libdir_flag_spec_CXX='-rpath $libdir'
- ;;
- esac
-
- hardcode_libdir_separator_CXX=:
-
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- #
- # There doesn't appear to be a way to prevent this compiler from
- # explicitly linking system object files so we need to strip them
- # from the output so that they don't get included in the library
- # dependencies.
- output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
- ;;
- *)
- if test yes,no = "$GXX,$with_gnu_ld"; then
- allow_undefined_flag_CXX=' $wl-expect_unresolved $wl\*'
- case $host in
- osf3*)
- archive_cmds_CXX='$CC -shared -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
- ;;
- *)
- archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
- ;;
- esac
-
- hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir'
- hardcode_libdir_separator_CXX=:
-
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
-
- else
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- fi
- ;;
- esac
- ;;
-
- psos*)
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
-
- sunos4*)
- case $cc_basename in
- CC*)
- # Sun C++ 4.x
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- lcc*)
- # Lucid
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- *)
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- esac
- ;;
-
- solaris*)
- case $cc_basename in
- CC* | sunCC*)
- # Sun C++ 4.2, 5.x and Centerline C++
- archive_cmds_need_lc_CXX=yes
- no_undefined_flag_CXX=' -zdefs'
- archive_cmds_CXX='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
- $CC -G$allow_undefined_flag $wl-M $wl$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
-
- hardcode_libdir_flag_spec_CXX='-R$libdir'
- hardcode_shlibpath_var_CXX=no
- case $host_os in
- solaris2.[0-5] | solaris2.[0-5].*) ;;
- *)
- # The compiler driver will combine and reorder linker options,
- # but understands '-z linker_flag'.
- # Supported since Solaris 2.6 (maybe 2.5.1?)
- whole_archive_flag_spec_CXX='-z allextract$convenience -z defaultextract'
- ;;
- esac
- link_all_deplibs_CXX=yes
-
- output_verbose_link_cmd='func_echo_all'
-
- # Archives containing C++ object files must be created using
- # "CC -xar", where "CC" is the Sun C++ compiler. This is
- # necessary to make sure instantiated templates are included
- # in the archive.
- old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs'
- ;;
- gcx*)
- # Green Hills C++ Compiler
- archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib'
-
- # The C++ compiler must be used to create the archive.
- old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
- ;;
- *)
- # GNU C++ compiler with Solaris linker
- if test yes,no = "$GXX,$with_gnu_ld"; then
- no_undefined_flag_CXX=' $wl-z ${wl}defs'
- if $CC --version | $GREP -v '^2\.7' > /dev/null; then
- archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib'
- archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
- $CC -shared $pic_flag -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
-
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
- else
- # g++ 2.7 appears to require '-G' NOT '-shared' on this
- # platform.
- archive_cmds_CXX='$CC -G -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib'
- archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
- $CC -G -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
-
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
- fi
-
- hardcode_libdir_flag_spec_CXX='$wl-R $wl$libdir'
- case $host_os in
- solaris2.[0-5] | solaris2.[0-5].*) ;;
- *)
- whole_archive_flag_spec_CXX='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract'
- ;;
- esac
- fi
- ;;
- esac
- ;;
-
- sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
- no_undefined_flag_CXX='$wl-z,text'
- archive_cmds_need_lc_CXX=no
- hardcode_shlibpath_var_CXX=no
- runpath_var='LD_RUN_PATH'
-
- case $cc_basename in
- CC*)
- archive_cmds_CXX='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds_CXX='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- *)
- archive_cmds_CXX='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds_CXX='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- esac
- ;;
-
- sysv5* | sco3.2v5* | sco5v6*)
- # Note: We CANNOT use -z defs as we might desire, because we do not
- # link with -lc, and that would cause any symbols used from libc to
- # always be unresolved, which means just about no library would
- # ever link correctly. If we're not using GNU ld we use -z text
- # though, which does catch some bad symbols but isn't as heavy-handed
- # as -z defs.
- no_undefined_flag_CXX='$wl-z,text'
- allow_undefined_flag_CXX='$wl-z,nodefs'
- archive_cmds_need_lc_CXX=no
- hardcode_shlibpath_var_CXX=no
- hardcode_libdir_flag_spec_CXX='$wl-R,$libdir'
- hardcode_libdir_separator_CXX=':'
- link_all_deplibs_CXX=yes
- export_dynamic_flag_spec_CXX='$wl-Bexport'
- runpath_var='LD_RUN_PATH'
-
- case $cc_basename in
- CC*)
- archive_cmds_CXX='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds_CXX='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- old_archive_cmds_CXX='$CC -Tprelink_objects $oldobjs~
- '"$old_archive_cmds_CXX"
- reload_cmds_CXX='$CC -Tprelink_objects $reload_objs~
- '"$reload_cmds_CXX"
- ;;
- *)
- archive_cmds_CXX='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds_CXX='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- esac
- ;;
-
- tandem*)
- case $cc_basename in
- NCC*)
- # NonStop-UX NCC 3.20
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- *)
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- esac
- ;;
-
- vxworks*)
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
-
- *)
- # FIXME: insert proper C++ library support
- ld_shlibs_CXX=no
- ;;
- esac
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5
-$as_echo "$ld_shlibs_CXX" >&6; }
- test no = "$ld_shlibs_CXX" && can_build_shared=no
-
- GCC_CXX=$GXX
- LD_CXX=$LD
-
- ## CAVEAT EMPTOR:
- ## There is no encapsulation within the following macros, do not change
- ## the running order or otherwise move them around unless you know exactly
- ## what you are doing...
- # Dependencies to place before and after the object being linked:
-predep_objects_CXX=
-postdep_objects_CXX=
-predeps_CXX=
-postdeps_CXX=
-compiler_lib_search_path_CXX=
-
-cat > conftest.$ac_ext <<_LT_EOF
-class Foo
-{
-public:
- Foo (void) { a = 0; }
-private:
- int a;
-};
-_LT_EOF
-
-
-_lt_libdeps_save_CFLAGS=$CFLAGS
-case "$CC $CFLAGS " in #(
-*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;;
-*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;;
-*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;;
-esac
-
-if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
- (eval $ac_compile) 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; then
- # Parse the compiler output and extract the necessary
- # objects, libraries and library flags.
-
- # Sentinel used to keep track of whether or not we are before
- # the conftest object file.
- pre_test_object_deps_done=no
-
- for p in `eval "$output_verbose_link_cmd"`; do
- case $prev$p in
-
- -L* | -R* | -l*)
- # Some compilers place space between "-{L,R}" and the path.
- # Remove the space.
- if test x-L = "$p" ||
- test x-R = "$p"; then
- prev=$p
- continue
- fi
-
- # Expand the sysroot to ease extracting the directories later.
- if test -z "$prev"; then
- case $p in
- -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;;
- -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;;
- -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;;
- esac
- fi
- case $p in
- =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;;
- esac
- if test no = "$pre_test_object_deps_done"; then
- case $prev in
- -L | -R)
- # Internal compiler library paths should come after those
- # provided the user. The postdeps already come after the
- # user supplied libs so there is no need to process them.
- if test -z "$compiler_lib_search_path_CXX"; then
- compiler_lib_search_path_CXX=$prev$p
- else
- compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} $prev$p"
- fi
- ;;
- # The "-l" case would never come before the object being
- # linked, so don't bother handling this case.
- esac
- else
- if test -z "$postdeps_CXX"; then
- postdeps_CXX=$prev$p
- else
- postdeps_CXX="${postdeps_CXX} $prev$p"
- fi
- fi
- prev=
- ;;
-
- *.lto.$objext) ;; # Ignore GCC LTO objects
- *.$objext)
- # This assumes that the test object file only shows up
- # once in the compiler output.
- if test "$p" = "conftest.$objext"; then
- pre_test_object_deps_done=yes
- continue
- fi
-
- if test no = "$pre_test_object_deps_done"; then
- if test -z "$predep_objects_CXX"; then
- predep_objects_CXX=$p
- else
- predep_objects_CXX="$predep_objects_CXX $p"
- fi
- else
- if test -z "$postdep_objects_CXX"; then
- postdep_objects_CXX=$p
- else
- postdep_objects_CXX="$postdep_objects_CXX $p"
- fi
- fi
- ;;
-
- *) ;; # Ignore the rest.
-
- esac
- done
-
- # Clean up.
- rm -f a.out a.exe
-else
- echo "libtool.m4: error: problem compiling CXX test program"
-fi
-
-$RM -f confest.$objext
-CFLAGS=$_lt_libdeps_save_CFLAGS
-
-# PORTME: override above test on systems where it is broken
-case $host_os in
-interix[3-9]*)
- # Interix 3.5 installs completely hosed .la files for C++, so rather than
- # hack all around it, let's just trust "g++" to DTRT.
- predep_objects_CXX=
- postdep_objects_CXX=
- postdeps_CXX=
- ;;
-
-linux*)
- case `$CC -V 2>&1 | sed 5q` in
- *Sun\ C*)
- # Sun C++ 5.9
-
- # The more standards-conforming stlport4 library is
- # incompatible with the Cstd library. Avoid specifying
- # it if it's in CXXFLAGS. Ignore libCrun as
- # -library=stlport4 depends on it.
- case " $CXX $CXXFLAGS " in
- *" -library=stlport4 "*)
- solaris_use_stlport4=yes
- ;;
- esac
-
- if test yes != "$solaris_use_stlport4"; then
- postdeps_CXX='-library=Cstd -library=Crun'
- fi
- ;;
- esac
- ;;
-
-solaris*)
- case $cc_basename in
- CC* | sunCC*)
- # The more standards-conforming stlport4 library is
- # incompatible with the Cstd library. Avoid specifying
- # it if it's in CXXFLAGS. Ignore libCrun as
- # -library=stlport4 depends on it.
- case " $CXX $CXXFLAGS " in
- *" -library=stlport4 "*)
- solaris_use_stlport4=yes
- ;;
- esac
-
- # Adding this requires a known-good setup of shared libraries for
- # Sun compiler versions before 5.6, else PIC objects from an old
- # archive will be linked into the output, leading to subtle bugs.
- if test yes != "$solaris_use_stlport4"; then
- postdeps_CXX='-library=Cstd -library=Crun'
- fi
- ;;
- esac
- ;;
-esac
-
-
-case " $postdeps_CXX " in
-*" -lc "*) archive_cmds_need_lc_CXX=no ;;
-esac
- compiler_lib_search_dirs_CXX=
-if test -n "${compiler_lib_search_path_CXX}"; then
- compiler_lib_search_dirs_CXX=`echo " ${compiler_lib_search_path_CXX}" | $SED -e 's! -L! !g' -e 's!^ !!'`
-fi
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- lt_prog_compiler_wl_CXX=
-lt_prog_compiler_pic_CXX=
-lt_prog_compiler_static_CXX=
-
-
- # C++ specific cases for pic, static, wl, etc.
- if test yes = "$GXX"; then
- lt_prog_compiler_wl_CXX='-Wl,'
- lt_prog_compiler_static_CXX='-static'
-
- case $host_os in
- aix*)
- # All AIX code is PIC.
- if test ia64 = "$host_cpu"; then
- # AIX 5 now supports IA64 processor
- lt_prog_compiler_static_CXX='-Bstatic'
- fi
- lt_prog_compiler_pic_CXX='-fPIC'
- ;;
-
- amigaos*)
- case $host_cpu in
- powerpc)
- # see comment about AmigaOS4 .so support
- lt_prog_compiler_pic_CXX='-fPIC'
- ;;
- m68k)
- # FIXME: we need at least 68020 code to build shared libraries, but
- # adding the '-m68020' flag to GCC prevents building anything better,
- # like '-m68040'.
- lt_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4'
- ;;
- esac
- ;;
-
- beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
- # PIC is the default for these OSes.
- ;;
- mingw* | cygwin* | os2* | pw32* | cegcc*)
- # This hack is so that the source file can tell whether it is being
- # built for inclusion in a dll (and should export symbols for example).
- # Although the cygwin gcc ignores -fPIC, still need this for old-style
- # (--disable-auto-import) libraries
- lt_prog_compiler_pic_CXX='-DDLL_EXPORT'
- ;;
- darwin* | rhapsody*)
- # PIC is the default on this platform
- # Common symbols not allowed in MH_DYLIB files
- lt_prog_compiler_pic_CXX='-fno-common'
- ;;
- *djgpp*)
- # DJGPP does not support shared libraries at all
- lt_prog_compiler_pic_CXX=
- ;;
- haiku*)
- # PIC is the default for Haiku.
- # The "-static" flag exists, but is broken.
- lt_prog_compiler_static_CXX=
- ;;
- interix[3-9]*)
- # Interix 3.x gcc -fpic/-fPIC options generate broken code.
- # Instead, we relocate shared libraries at runtime.
- ;;
- sysv4*MP*)
- if test -d /usr/nec; then
- lt_prog_compiler_pic_CXX=-Kconform_pic
- fi
- ;;
- hpux*)
- # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
- # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag
- # sets the default TLS model and affects inlining.
- case $host_cpu in
- hppa*64*)
- ;;
- *)
- lt_prog_compiler_pic_CXX='-fPIC'
- ;;
- esac
- ;;
- *qnx* | *nto*)
- # QNX uses GNU C++, but need to define -shared option too, otherwise
- # it will coredump.
- lt_prog_compiler_pic_CXX='-fPIC -shared'
- ;;
- *)
- lt_prog_compiler_pic_CXX='-fPIC'
- ;;
- esac
- else
- case $host_os in
- aix[4-9]*)
- # All AIX code is PIC.
- if test ia64 = "$host_cpu"; then
- # AIX 5 now supports IA64 processor
- lt_prog_compiler_static_CXX='-Bstatic'
- else
- lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp'
- fi
- ;;
- chorus*)
- case $cc_basename in
- cxch68*)
- # Green Hills C++ Compiler
- # _LT_TAGVAR(lt_prog_compiler_static, CXX)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a"
- ;;
- esac
- ;;
- mingw* | cygwin* | os2* | pw32* | cegcc*)
- # This hack is so that the source file can tell whether it is being
- # built for inclusion in a dll (and should export symbols for example).
- lt_prog_compiler_pic_CXX='-DDLL_EXPORT'
- ;;
- dgux*)
- case $cc_basename in
- ec++*)
- lt_prog_compiler_pic_CXX='-KPIC'
- ;;
- ghcx*)
- # Green Hills C++ Compiler
- lt_prog_compiler_pic_CXX='-pic'
- ;;
- *)
- ;;
- esac
- ;;
- freebsd* | dragonfly*)
- # FreeBSD uses GNU C++
- ;;
- hpux9* | hpux10* | hpux11*)
- case $cc_basename in
- CC*)
- lt_prog_compiler_wl_CXX='-Wl,'
- lt_prog_compiler_static_CXX='$wl-a ${wl}archive'
- if test ia64 != "$host_cpu"; then
- lt_prog_compiler_pic_CXX='+Z'
- fi
- ;;
- aCC*)
- lt_prog_compiler_wl_CXX='-Wl,'
- lt_prog_compiler_static_CXX='$wl-a ${wl}archive'
- case $host_cpu in
- hppa*64*|ia64*)
- # +Z the default
- ;;
- *)
- lt_prog_compiler_pic_CXX='+Z'
- ;;
- esac
- ;;
- *)
- ;;
- esac
- ;;
- interix*)
- # This is c89, which is MS Visual C++ (no shared libs)
- # Anyone wants to do a port?
- ;;
- irix5* | irix6* | nonstopux*)
- case $cc_basename in
- CC*)
- lt_prog_compiler_wl_CXX='-Wl,'
- lt_prog_compiler_static_CXX='-non_shared'
- # CC pic flag -KPIC is the default.
- ;;
- *)
- ;;
- esac
- ;;
- linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
- case $cc_basename in
- KCC*)
- # KAI C++ Compiler
- lt_prog_compiler_wl_CXX='--backend -Wl,'
- lt_prog_compiler_pic_CXX='-fPIC'
- ;;
- ecpc* )
- # old Intel C++ for x86_64, which still supported -KPIC.
- lt_prog_compiler_wl_CXX='-Wl,'
- lt_prog_compiler_pic_CXX='-KPIC'
- lt_prog_compiler_static_CXX='-static'
- ;;
- icpc* )
- # Intel C++, used to be incompatible with GCC.
- # ICC 10 doesn't accept -KPIC any more.
- lt_prog_compiler_wl_CXX='-Wl,'
- lt_prog_compiler_pic_CXX='-fPIC'
- lt_prog_compiler_static_CXX='-static'
- ;;
- pgCC* | pgcpp*)
- # Portland Group C++ compiler
- lt_prog_compiler_wl_CXX='-Wl,'
- lt_prog_compiler_pic_CXX='-fpic'
- lt_prog_compiler_static_CXX='-Bstatic'
- ;;
- cxx*)
- # Compaq C++
- # Make sure the PIC flag is empty. It appears that all Alpha
- # Linux and Compaq Tru64 Unix objects are PIC.
- lt_prog_compiler_pic_CXX=
- lt_prog_compiler_static_CXX='-non_shared'
- ;;
- xlc* | xlC* | bgxl[cC]* | mpixl[cC]*)
- # IBM XL 8.0, 9.0 on PPC and BlueGene
- lt_prog_compiler_wl_CXX='-Wl,'
- lt_prog_compiler_pic_CXX='-qpic'
- lt_prog_compiler_static_CXX='-qstaticlink'
- ;;
- *)
- case `$CC -V 2>&1 | sed 5q` in
- *Sun\ C*)
- # Sun C++ 5.9
- lt_prog_compiler_pic_CXX='-KPIC'
- lt_prog_compiler_static_CXX='-Bstatic'
- lt_prog_compiler_wl_CXX='-Qoption ld '
- ;;
- esac
- ;;
- esac
- ;;
- lynxos*)
- ;;
- m88k*)
- ;;
- mvs*)
- case $cc_basename in
- cxx*)
- lt_prog_compiler_pic_CXX='-W c,exportall'
- ;;
- *)
- ;;
- esac
- ;;
- netbsd*)
- ;;
- *qnx* | *nto*)
- # QNX uses GNU C++, but need to define -shared option too, otherwise
- # it will coredump.
- lt_prog_compiler_pic_CXX='-fPIC -shared'
- ;;
- osf3* | osf4* | osf5*)
- case $cc_basename in
- KCC*)
- lt_prog_compiler_wl_CXX='--backend -Wl,'
- ;;
- RCC*)
- # Rational C++ 2.4.1
- lt_prog_compiler_pic_CXX='-pic'
- ;;
- cxx*)
- # Digital/Compaq C++
- lt_prog_compiler_wl_CXX='-Wl,'
- # Make sure the PIC flag is empty. It appears that all Alpha
- # Linux and Compaq Tru64 Unix objects are PIC.
- lt_prog_compiler_pic_CXX=
- lt_prog_compiler_static_CXX='-non_shared'
- ;;
- *)
- ;;
- esac
- ;;
- psos*)
- ;;
- solaris*)
- case $cc_basename in
- CC* | sunCC*)
- # Sun C++ 4.2, 5.x and Centerline C++
- lt_prog_compiler_pic_CXX='-KPIC'
- lt_prog_compiler_static_CXX='-Bstatic'
- lt_prog_compiler_wl_CXX='-Qoption ld '
- ;;
- gcx*)
- # Green Hills C++ Compiler
- lt_prog_compiler_pic_CXX='-PIC'
- ;;
- *)
- ;;
- esac
- ;;
- sunos4*)
- case $cc_basename in
- CC*)
- # Sun C++ 4.x
- lt_prog_compiler_pic_CXX='-pic'
- lt_prog_compiler_static_CXX='-Bstatic'
- ;;
- lcc*)
- # Lucid
- lt_prog_compiler_pic_CXX='-pic'
- ;;
- *)
- ;;
- esac
- ;;
- sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
- case $cc_basename in
- CC*)
- lt_prog_compiler_wl_CXX='-Wl,'
- lt_prog_compiler_pic_CXX='-KPIC'
- lt_prog_compiler_static_CXX='-Bstatic'
- ;;
- esac
- ;;
- tandem*)
- case $cc_basename in
- NCC*)
- # NonStop-UX NCC 3.20
- lt_prog_compiler_pic_CXX='-KPIC'
- ;;
- *)
- ;;
- esac
- ;;
- vxworks*)
- ;;
- *)
- lt_prog_compiler_can_build_shared_CXX=no
- ;;
- esac
- fi
-
-case $host_os in
- # For platforms that do not support PIC, -DPIC is meaningless:
- *djgpp*)
- lt_prog_compiler_pic_CXX=
- ;;
- *)
- lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC"
- ;;
-esac
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
-$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
-if ${lt_cv_prog_compiler_pic_CXX+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- lt_cv_prog_compiler_pic_CXX=$lt_prog_compiler_pic_CXX
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_CXX" >&5
-$as_echo "$lt_cv_prog_compiler_pic_CXX" >&6; }
-lt_prog_compiler_pic_CXX=$lt_cv_prog_compiler_pic_CXX
-
-#
-# Check to make sure the PIC flag actually works.
-#
-if test -n "$lt_prog_compiler_pic_CXX"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5
-$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... " >&6; }
-if ${lt_cv_prog_compiler_pic_works_CXX+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- lt_cv_prog_compiler_pic_works_CXX=no
- ac_outfile=conftest.$ac_objext
- echo "$lt_simple_compile_test_code" > conftest.$ac_ext
- lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC" ## exclude from sc_useless_quotes_in_assignment
- # Insert the option either (1) after the last *FLAGS variable, or
- # (2) before a word containing "conftest.", or (3) at the end.
- # Note that $ac_compile itself does not contain backslashes and begins
- # with a dollar sign (not a hyphen), so the echo should work correctly.
- # The option is referenced via a variable to avoid confusing sed.
- lt_compile=`echo "$ac_compile" | $SED \
- -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
- -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
- -e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
- (eval "$lt_compile" 2>conftest.err)
- ac_status=$?
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- if (exit $ac_status) && test -s "$ac_outfile"; then
- # The compiler can only warn and ignore the option if not recognized
- # So say no if there are warnings other than the usual output.
- $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
- $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
- if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
- lt_cv_prog_compiler_pic_works_CXX=yes
- fi
- fi
- $RM conftest*
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works_CXX" >&5
-$as_echo "$lt_cv_prog_compiler_pic_works_CXX" >&6; }
-
-if test yes = "$lt_cv_prog_compiler_pic_works_CXX"; then
- case $lt_prog_compiler_pic_CXX in
- "" | " "*) ;;
- *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;;
- esac
-else
- lt_prog_compiler_pic_CXX=
- lt_prog_compiler_can_build_shared_CXX=no
-fi
-
-fi
-
-
-
-
-
-#
-# Check to make sure the static flag actually works.
-#
-wl=$lt_prog_compiler_wl_CXX eval lt_tmp_static_flag=\"$lt_prog_compiler_static_CXX\"
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5
-$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; }
-if ${lt_cv_prog_compiler_static_works_CXX+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- lt_cv_prog_compiler_static_works_CXX=no
- save_LDFLAGS=$LDFLAGS
- LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
- echo "$lt_simple_link_test_code" > conftest.$ac_ext
- if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
- # The linker can only warn and ignore the option if not recognized
- # So say no if there are warnings
- if test -s conftest.err; then
- # Append any errors to the config.log.
- cat conftest.err 1>&5
- $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
- $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
- if diff conftest.exp conftest.er2 >/dev/null; then
- lt_cv_prog_compiler_static_works_CXX=yes
- fi
- else
- lt_cv_prog_compiler_static_works_CXX=yes
- fi
- fi
- $RM -r conftest*
- LDFLAGS=$save_LDFLAGS
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works_CXX" >&5
-$as_echo "$lt_cv_prog_compiler_static_works_CXX" >&6; }
-
-if test yes = "$lt_cv_prog_compiler_static_works_CXX"; then
- :
-else
- lt_prog_compiler_static_CXX=
-fi
-
-
-
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
-$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
-if ${lt_cv_prog_compiler_c_o_CXX+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- lt_cv_prog_compiler_c_o_CXX=no
- $RM -r conftest 2>/dev/null
- mkdir conftest
- cd conftest
- mkdir out
- echo "$lt_simple_compile_test_code" > conftest.$ac_ext
-
- lt_compiler_flag="-o out/conftest2.$ac_objext"
- # Insert the option either (1) after the last *FLAGS variable, or
- # (2) before a word containing "conftest.", or (3) at the end.
- # Note that $ac_compile itself does not contain backslashes and begins
- # with a dollar sign (not a hyphen), so the echo should work correctly.
- lt_compile=`echo "$ac_compile" | $SED \
- -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
- -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
- -e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
- (eval "$lt_compile" 2>out/conftest.err)
- ac_status=$?
- cat out/conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- if (exit $ac_status) && test -s out/conftest2.$ac_objext
- then
- # The compiler can only warn and ignore the option if not recognized
- # So say no if there are warnings
- $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
- $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
- if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
- lt_cv_prog_compiler_c_o_CXX=yes
- fi
- fi
- chmod u+w . 2>&5
- $RM conftest*
- # SGI C++ compiler will create directory out/ii_files/ for
- # template instantiation
- test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
- $RM out/* && rmdir out
- cd ..
- $RM -r conftest
- $RM conftest*
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5
-$as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; }
-
-
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
-$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
-if ${lt_cv_prog_compiler_c_o_CXX+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- lt_cv_prog_compiler_c_o_CXX=no
- $RM -r conftest 2>/dev/null
- mkdir conftest
- cd conftest
- mkdir out
- echo "$lt_simple_compile_test_code" > conftest.$ac_ext
-
- lt_compiler_flag="-o out/conftest2.$ac_objext"
- # Insert the option either (1) after the last *FLAGS variable, or
- # (2) before a word containing "conftest.", or (3) at the end.
- # Note that $ac_compile itself does not contain backslashes and begins
- # with a dollar sign (not a hyphen), so the echo should work correctly.
- lt_compile=`echo "$ac_compile" | $SED \
- -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
- -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
- -e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
- (eval "$lt_compile" 2>out/conftest.err)
- ac_status=$?
- cat out/conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- if (exit $ac_status) && test -s out/conftest2.$ac_objext
- then
- # The compiler can only warn and ignore the option if not recognized
- # So say no if there are warnings
- $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
- $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
- if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
- lt_cv_prog_compiler_c_o_CXX=yes
- fi
- fi
- chmod u+w . 2>&5
- $RM conftest*
- # SGI C++ compiler will create directory out/ii_files/ for
- # template instantiation
- test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
- $RM out/* && rmdir out
- cd ..
- $RM -r conftest
- $RM conftest*
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5
-$as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; }
-
-
-
-
-hard_links=nottested
-if test no = "$lt_cv_prog_compiler_c_o_CXX" && test no != "$need_locks"; then
- # do not overwrite the value of need_locks provided by the user
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5
-$as_echo_n "checking if we can lock with hard links... " >&6; }
- hard_links=yes
- $RM conftest*
- ln conftest.a conftest.b 2>/dev/null && hard_links=no
- touch conftest.a
- ln conftest.a conftest.b 2>&5 || hard_links=no
- ln conftest.a conftest.b 2>/dev/null && hard_links=no
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5
-$as_echo "$hard_links" >&6; }
- if test no = "$hard_links"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&5
-$as_echo "$as_me: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&2;}
- need_locks=warn
- fi
-else
- need_locks=no
-fi
-
-
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5
-$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; }
-
- export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
- exclude_expsyms_CXX='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'
- case $host_os in
- aix[4-9]*)
- # If we're using GNU nm, then we don't want the "-C" option.
- # -C means demangle to AIX nm, but means don't demangle with GNU nm
- # Also, AIX nm treats weak defined symbols like other global defined
- # symbols, whereas GNU nm marks them as "W".
- if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
- export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
- else
- export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
- fi
- ;;
- pw32*)
- export_symbols_cmds_CXX=$ltdll_cmds
- ;;
- cygwin* | mingw* | cegcc*)
- case $cc_basename in
- cl*)
- exclude_expsyms_CXX='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
- ;;
- *)
- export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols'
- exclude_expsyms_CXX='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'
- ;;
- esac
- ;;
- *)
- export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
- ;;
- esac
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5
-$as_echo "$ld_shlibs_CXX" >&6; }
-test no = "$ld_shlibs_CXX" && can_build_shared=no
-
-with_gnu_ld_CXX=$with_gnu_ld
-
-
-
-
-
-
-#
-# Do we need to explicitly link libc?
-#
-case "x$archive_cmds_need_lc_CXX" in
-x|xyes)
- # Assume -lc should be added
- archive_cmds_need_lc_CXX=yes
-
- if test yes,yes = "$GCC,$enable_shared"; then
- case $archive_cmds_CXX in
- *'~'*)
- # FIXME: we may have to deal with multi-command sequences.
- ;;
- '$CC '*)
- # Test whether the compiler implicitly links with -lc since on some
- # systems, -lgcc has to come before -lc. If gcc already passes -lc
- # to ld, don't add -lc before -lgcc.
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5
-$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; }
-if ${lt_cv_archive_cmds_need_lc_CXX+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- $RM conftest*
- echo "$lt_simple_compile_test_code" > conftest.$ac_ext
-
- if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
- (eval $ac_compile) 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; } 2>conftest.err; then
- soname=conftest
- lib=conftest
- libobjs=conftest.$ac_objext
- deplibs=
- wl=$lt_prog_compiler_wl_CXX
- pic_flag=$lt_prog_compiler_pic_CXX
- compiler_flags=-v
- linker_flags=-v
- verstring=
- output_objdir=.
- libname=conftest
- lt_save_allow_undefined_flag=$allow_undefined_flag_CXX
- allow_undefined_flag_CXX=
- if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5
- (eval $archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }
- then
- lt_cv_archive_cmds_need_lc_CXX=no
- else
- lt_cv_archive_cmds_need_lc_CXX=yes
- fi
- allow_undefined_flag_CXX=$lt_save_allow_undefined_flag
- else
- cat conftest.err 1>&5
- fi
- $RM conftest*
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc_CXX" >&5
-$as_echo "$lt_cv_archive_cmds_need_lc_CXX" >&6; }
- archive_cmds_need_lc_CXX=$lt_cv_archive_cmds_need_lc_CXX
- ;;
- esac
- fi
- ;;
-esac
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5
-$as_echo_n "checking dynamic linker characteristics... " >&6; }
-
-library_names_spec=
-libname_spec='lib$name'
-soname_spec=
-shrext_cmds=.so
-postinstall_cmds=
-postuninstall_cmds=
-finish_cmds=
-finish_eval=
-shlibpath_var=
-shlibpath_overrides_runpath=unknown
-version_type=none
-dynamic_linker="$host_os ld.so"
-sys_lib_dlsearch_path_spec="/lib /usr/lib"
-need_lib_prefix=unknown
-hardcode_into_libs=no
-
-# when you set need_version to no, make sure it does not cause -set_version
-# flags to be left without arguments
-need_version=unknown
-
-case $host_os in
-aix3*)
- version_type=linux # correct to gnu/linux during the next big refactor
- library_names_spec='$libname$release$shared_ext$versuffix $libname.a'
- shlibpath_var=LIBPATH
-
- # AIX 3 has no versioning support, so we append a major version to the name.
- soname_spec='$libname$release$shared_ext$major'
- ;;
-
-aix[4-9]*)
- version_type=linux # correct to gnu/linux during the next big refactor
- need_lib_prefix=no
- need_version=no
- hardcode_into_libs=yes
- if test ia64 = "$host_cpu"; then
- # AIX 5 supports IA64
- library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext'
- shlibpath_var=LD_LIBRARY_PATH
- else
- # With GCC up to 2.95.x, collect2 would create an import file
- # for dependence libraries. The import file would start with
- # the line '#! .'. This would cause the generated library to
- # depend on '.', always an invalid library. This was fixed in
- # development snapshots of GCC prior to 3.0.
- case $host_os in
- aix4 | aix4.[01] | aix4.[01].*)
- if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
- echo ' yes '
- echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then
- :
- else
- can_build_shared=no
- fi
- ;;
- esac
- # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct
- # soname into executable. Probably we can add versioning support to
- # collect2, so additional links can be useful in future.
- if test yes = "$aix_use_runtimelinking"; then
- # If using run time linking (on AIX 4.2 or later) use lib<name>.so
- # instead of lib<name>.a to let people know that these are not
- # typical AIX shared libraries.
- library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
- else
- # We preserve .a as extension for shared libraries through AIX4.2
- # and later when we are not doing run time linking.
- library_names_spec='$libname$release.a $libname.a'
- soname_spec='$libname$release$shared_ext$major'
- fi
- shlibpath_var=LIBPATH
- fi
- ;;
-
-amigaos*)
- case $host_cpu in
- powerpc)
- # Since July 2007 AmigaOS4 officially supports .so libraries.
- # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
- library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
- ;;
- m68k)
- library_names_spec='$libname.ixlibrary $libname.a'
- # Create ${libname}_ixlibrary.a entries in /sys/libs.
- finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
- ;;
- esac
- ;;
-
-beos*)
- library_names_spec='$libname$shared_ext'
- dynamic_linker="$host_os ld.so"
- shlibpath_var=LIBRARY_PATH
- ;;
-
-bsdi[45]*)
- version_type=linux # correct to gnu/linux during the next big refactor
- need_version=no
- library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
- soname_spec='$libname$release$shared_ext$major'
- finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
- shlibpath_var=LD_LIBRARY_PATH
- sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
- sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
- # the default ld.so.conf also contains /usr/contrib/lib and
- # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
- # libtool to hard-code these into programs
- ;;
-
-cygwin* | mingw* | pw32* | cegcc*)
- version_type=windows
- shrext_cmds=.dll
- need_version=no
- need_lib_prefix=no
-
- case $GCC,$cc_basename in
- yes,*)
- # gcc
- library_names_spec='$libname.dll.a'
- # DLL is installed to $(libdir)/../bin by postinstall_cmds
- postinstall_cmds='base_file=`basename \$file`~
- dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
- dldir=$destdir/`dirname \$dlpath`~
- test -d \$dldir || mkdir -p \$dldir~
- $install_prog $dir/$dlname \$dldir/$dlname~
- chmod a+x \$dldir/$dlname~
- if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
- eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
- fi'
- postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
- dlpath=$dir/\$dldll~
- $RM \$dlpath'
- shlibpath_overrides_runpath=yes
-
- case $host_os in
- cygwin*)
- # Cygwin DLLs use 'cyg' prefix rather than 'lib'
- soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext'
-
- ;;
- mingw* | cegcc*)
- # MinGW DLLs use traditional 'lib' prefix
- soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext'
- ;;
- pw32*)
- # pw32 DLLs use 'pw' prefix rather than 'lib'
- library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext'
- ;;
- esac
- dynamic_linker='Win32 ld.exe'
- ;;
-
- *,cl*)
- # Native MSVC
- libname_spec='$name'
- soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext'
- library_names_spec='$libname.dll.lib'
-
- case $build_os in
- mingw*)
- sys_lib_search_path_spec=
- lt_save_ifs=$IFS
- IFS=';'
- for lt_path in $LIB
- do
- IFS=$lt_save_ifs
- # Let DOS variable expansion print the short 8.3 style file name.
- lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
- sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
- done
- IFS=$lt_save_ifs
- # Convert to MSYS style.
- sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'`
- ;;
- cygwin*)
- # Convert to unix form, then to dos form, then back to unix form
- # but this time dos style (no spaces!) so that the unix form looks
- # like /cygdrive/c/PROGRA~1:/cygdr...
- sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
- sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
- sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
- ;;
- *)
- sys_lib_search_path_spec=$LIB
- if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then
- # It is most probably a Windows format PATH.
- sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
- else
- sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
- fi
- # FIXME: find the short name or the path components, as spaces are
- # common. (e.g. "Program Files" -> "PROGRA~1")
- ;;
- esac
-
- # DLL is installed to $(libdir)/../bin by postinstall_cmds
- postinstall_cmds='base_file=`basename \$file`~
- dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
- dldir=$destdir/`dirname \$dlpath`~
- test -d \$dldir || mkdir -p \$dldir~
- $install_prog $dir/$dlname \$dldir/$dlname'
- postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
- dlpath=$dir/\$dldll~
- $RM \$dlpath'
- shlibpath_overrides_runpath=yes
- dynamic_linker='Win32 link.exe'
- ;;
-
- *)
- # Assume MSVC wrapper
- library_names_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext $libname.lib'
- dynamic_linker='Win32 ld.exe'
- ;;
- esac
- # FIXME: first we should search . and the directory the executable is in
- shlibpath_var=PATH
- ;;
-
-darwin* | rhapsody*)
- dynamic_linker="$host_os dyld"
- version_type=darwin
- need_lib_prefix=no
- need_version=no
- library_names_spec='$libname$release$major$shared_ext $libname$shared_ext'
- soname_spec='$libname$release$major$shared_ext'
- shlibpath_overrides_runpath=yes
- shlibpath_var=DYLD_LIBRARY_PATH
- shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
-
- sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
- ;;
-
-dgux*)
- version_type=linux # correct to gnu/linux during the next big refactor
- need_lib_prefix=no
- need_version=no
- library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
- soname_spec='$libname$release$shared_ext$major'
- shlibpath_var=LD_LIBRARY_PATH
- ;;
-
-freebsd* | dragonfly*)
- # DragonFly does not have aout. When/if they implement a new
- # versioning mechanism, adjust this.
- if test -x /usr/bin/objformat; then
- objformat=`/usr/bin/objformat`
- else
- case $host_os in
- freebsd[23].*) objformat=aout ;;
- *) objformat=elf ;;
- esac
- fi
- version_type=freebsd-$objformat
- case $version_type in
- freebsd-elf*)
- library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext'
- need_version=no
- need_lib_prefix=no
- ;;
- freebsd-*)
- library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
- need_version=yes
- ;;
- esac
- shlibpath_var=LD_LIBRARY_PATH
- case $host_os in
- freebsd2.*)
- shlibpath_overrides_runpath=yes
- ;;
- freebsd3.[01]* | freebsdelf3.[01]*)
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- ;;
- freebsd3.[2-9]* | freebsdelf3.[2-9]* | \
- freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1)
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- ;;
- *) # from 4.6 on, and DragonFly
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- ;;
- esac
- ;;
-
-haiku*)
- version_type=linux # correct to gnu/linux during the next big refactor
- need_lib_prefix=no
- need_version=no
- dynamic_linker="$host_os runtime_loader"
- library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
- soname_spec='$libname$release$shared_ext$major'
- shlibpath_var=LIBRARY_PATH
- shlibpath_overrides_runpath=no
- sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
- hardcode_into_libs=yes
- ;;
-
-hpux9* | hpux10* | hpux11*)
- # Give a soname corresponding to the major version so that dld.sl refuses to
- # link against other versions.
- version_type=sunos
- need_lib_prefix=no
- need_version=no
- case $host_cpu in
- ia64*)
- shrext_cmds='.so'
- hardcode_into_libs=yes
- dynamic_linker="$host_os dld.so"
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
- library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
- soname_spec='$libname$release$shared_ext$major'
- if test 32 = "$HPUX_IA64_MODE"; then
- sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
- else
- sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
- fi
- sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
- ;;
- hppa*64*)
- shrext_cmds='.sl'
- hardcode_into_libs=yes
- dynamic_linker="$host_os dld.sl"
- shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
- shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
- library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
- soname_spec='$libname$release$shared_ext$major'
- sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
- sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
- ;;
- *)
- shrext_cmds='.sl'
- dynamic_linker="$host_os dld.sl"
- shlibpath_var=SHLIB_PATH
- shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
- library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
- soname_spec='$libname$release$shared_ext$major'
- ;;
- esac
- # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
- postinstall_cmds='chmod 555 $lib'
- # or fails outright, so override atomically:
- install_override_mode=555
- ;;
-
-interix[3-9]*)
- version_type=linux # correct to gnu/linux during the next big refactor
- need_lib_prefix=no
- need_version=no
- library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
- soname_spec='$libname$release$shared_ext$major'
- dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- ;;
-
-irix5* | irix6* | nonstopux*)
- case $host_os in
- nonstopux*) version_type=nonstopux ;;
- *)
- if test yes = "$lt_cv_prog_gnu_ld"; then
- version_type=linux # correct to gnu/linux during the next big refactor
- else
- version_type=irix
- fi ;;
- esac
- need_lib_prefix=no
- need_version=no
- soname_spec='$libname$release$shared_ext$major'
- library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext'
- case $host_os in
- irix5* | nonstopux*)
- libsuff= shlibsuff=
- ;;
- *)
- case $LD in # libtool.m4 will add one of these switches to LD
- *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
- libsuff= shlibsuff= libmagic=32-bit;;
- *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
- libsuff=32 shlibsuff=N32 libmagic=N32;;
- *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
- libsuff=64 shlibsuff=64 libmagic=64-bit;;
- *) libsuff= shlibsuff= libmagic=never-match;;
- esac
- ;;
- esac
- shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
- shlibpath_overrides_runpath=no
- sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff"
- sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff"
- hardcode_into_libs=yes
- ;;
-
-# No shared lib support for Linux oldld, aout, or coff.
-linux*oldld* | linux*aout* | linux*coff*)
- dynamic_linker=no
- ;;
-
-linux*android*)
- version_type=none # Android doesn't support versioned libraries.
- need_lib_prefix=no
- need_version=no
- library_names_spec='$libname$release$shared_ext'
- soname_spec='$libname$release$shared_ext'
- finish_cmds=
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
-
- # This implies no fast_install, which is unacceptable.
- # Some rework will be needed to allow for fast_install
- # before this can be enabled.
- hardcode_into_libs=yes
-
- dynamic_linker='Android linker'
- # Don't embed -rpath directories since the linker doesn't support them.
- hardcode_libdir_flag_spec_CXX='-L$libdir'
- ;;
-
-# This must be glibc/ELF.
-linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
- version_type=linux # correct to gnu/linux during the next big refactor
- need_lib_prefix=no
- need_version=no
- library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
- soname_spec='$libname$release$shared_ext$major'
- finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
-
- # Some binutils ld are patched to set DT_RUNPATH
- if ${lt_cv_shlibpath_overrides_runpath+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- lt_cv_shlibpath_overrides_runpath=no
- save_LDFLAGS=$LDFLAGS
- save_libdir=$libdir
- eval "libdir=/foo; wl=\"$lt_prog_compiler_wl_CXX\"; \
- LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec_CXX\""
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_cxx_try_link "$LINENO"; then :
- if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then :
- lt_cv_shlibpath_overrides_runpath=yes
-fi
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
- LDFLAGS=$save_LDFLAGS
- libdir=$save_libdir
-
-fi
-
- shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
-
- # This implies no fast_install, which is unacceptable.
- # Some rework will be needed to allow for fast_install
- # before this can be enabled.
- hardcode_into_libs=yes
-
- # Append ld.so.conf contents to the search path
- if test -f /etc/ld.so.conf; then
- lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
- sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
- fi
-
- # We used to test for /lib/ld.so.1 and disable shared libraries on
- # powerpc, because MkLinux only supported shared libraries with the
- # GNU dynamic linker. Since this was broken with cross compilers,
- # most powerpc-linux boxes support dynamic linking these days and
- # people can always --disable-shared, the test was removed, and we
- # assume the GNU/Linux dynamic linker is in use.
- dynamic_linker='GNU/Linux ld.so'
- ;;
-
-netbsd*)
- version_type=sunos
- need_lib_prefix=no
- need_version=no
- if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
- library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
- finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
- dynamic_linker='NetBSD (a.out) ld.so'
- else
- library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
- soname_spec='$libname$release$shared_ext$major'
- dynamic_linker='NetBSD ld.elf_so'
- fi
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- ;;
-
-newsos6)
- version_type=linux # correct to gnu/linux during the next big refactor
- library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- ;;
-
-*nto* | *qnx*)
- version_type=qnx
- need_lib_prefix=no
- need_version=no
- library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
- soname_spec='$libname$release$shared_ext$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- dynamic_linker='ldqnx.so'
- ;;
-
-openbsd* | bitrig*)
- version_type=sunos
- sys_lib_dlsearch_path_spec=/usr/lib
- need_lib_prefix=no
- if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
- need_version=no
- else
- need_version=yes
- fi
- library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
- finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- ;;
-
-os2*)
- libname_spec='$name'
- shrext_cmds=.dll
- need_lib_prefix=no
- library_names_spec='$libname$shared_ext $libname.a'
- dynamic_linker='OS/2 ld.exe'
- shlibpath_var=LIBPATH
- ;;
-
-osf3* | osf4* | osf5*)
- version_type=osf
- need_lib_prefix=no
- need_version=no
- soname_spec='$libname$release$shared_ext$major'
- library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
- shlibpath_var=LD_LIBRARY_PATH
- sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
- sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
- ;;
-
-rdos*)
- dynamic_linker=no
- ;;
-
-solaris*)
- version_type=linux # correct to gnu/linux during the next big refactor
- need_lib_prefix=no
- need_version=no
- library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
- soname_spec='$libname$release$shared_ext$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- # ldd complains unless libraries are executable
- postinstall_cmds='chmod +x $lib'
- ;;
-
-sunos4*)
- version_type=sunos
- library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
- finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- if test yes = "$with_gnu_ld"; then
- need_lib_prefix=no
- fi
- need_version=yes
- ;;
-
-sysv4 | sysv4.3*)
- version_type=linux # correct to gnu/linux during the next big refactor
- library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
- soname_spec='$libname$release$shared_ext$major'
- shlibpath_var=LD_LIBRARY_PATH
- case $host_vendor in
- sni)
- shlibpath_overrides_runpath=no
- need_lib_prefix=no
- runpath_var=LD_RUN_PATH
- ;;
- siemens)
- need_lib_prefix=no
- ;;
- motorola)
- need_lib_prefix=no
- need_version=no
- shlibpath_overrides_runpath=no
- sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
- ;;
- esac
- ;;
-
-sysv4*MP*)
- if test -d /usr/nec; then
- version_type=linux # correct to gnu/linux during the next big refactor
- library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext'
- soname_spec='$libname$shared_ext.$major'
- shlibpath_var=LD_LIBRARY_PATH
- fi
- ;;
-
-sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
- version_type=freebsd-elf
- need_lib_prefix=no
- need_version=no
- library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext'
- soname_spec='$libname$release$shared_ext$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- if test yes = "$with_gnu_ld"; then
- sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
- else
- sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
- case $host_os in
- sco3.2v5*)
- sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
- ;;
- esac
- fi
- sys_lib_dlsearch_path_spec='/usr/lib'
- ;;
-
-tpf*)
- # TPF is a cross-target only. Preferred cross-host = GNU/Linux.
- version_type=linux # correct to gnu/linux during the next big refactor
- need_lib_prefix=no
- need_version=no
- library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- ;;
-
-uts4*)
- version_type=linux # correct to gnu/linux during the next big refactor
- library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
- soname_spec='$libname$release$shared_ext$major'
- shlibpath_var=LD_LIBRARY_PATH
- ;;
-
-*)
- dynamic_linker=no
- ;;
-esac
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5
-$as_echo "$dynamic_linker" >&6; }
-test no = "$dynamic_linker" && can_build_shared=no
-
-variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
-if test yes = "$GCC"; then
- variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
-fi
-
-if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then
- sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec
-fi
-if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then
- sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec
-fi
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5
-$as_echo_n "checking how to hardcode library paths into programs... " >&6; }
-hardcode_action_CXX=
-if test -n "$hardcode_libdir_flag_spec_CXX" ||
- test -n "$runpath_var_CXX" ||
- test yes = "$hardcode_automatic_CXX"; then
-
- # We can hardcode non-existent directories.
- if test no != "$hardcode_direct_CXX" &&
- # If the only mechanism to avoid hardcoding is shlibpath_var, we
- # have to relink, otherwise we might link with an installed library
- # when we should be linking with a yet-to-be-installed one
- ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, CXX)" &&
- test no != "$hardcode_minus_L_CXX"; then
- # Linking always hardcodes the temporary library directory.
- hardcode_action_CXX=relink
- else
- # We can link without hardcoding, and we can hardcode nonexisting dirs.
- hardcode_action_CXX=immediate
- fi
-else
- # We cannot hardcode anything, or else we can only hardcode existing
- # directories.
- hardcode_action_CXX=unsupported
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action_CXX" >&5
-$as_echo "$hardcode_action_CXX" >&6; }
-
-if test relink = "$hardcode_action_CXX" ||
- test yes = "$inherit_rpath_CXX"; then
- # Fast installation is not supported
- enable_fast_install=no
-elif test yes = "$shlibpath_overrides_runpath" ||
- test no = "$enable_shared"; then
- # Fast installation is not necessary
- enable_fast_install=needless
-fi
-
-
-
-
-
-
-
- fi # test -n "$compiler"
-
- CC=$lt_save_CC
- CFLAGS=$lt_save_CFLAGS
- LDCXX=$LD
- LD=$lt_save_LD
- GCC=$lt_save_GCC
- with_gnu_ld=$lt_save_with_gnu_ld
- lt_cv_path_LDCXX=$lt_cv_path_LD
- lt_cv_path_LD=$lt_save_path_LD
- lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
- lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
-fi # test yes != "$_lt_caught_CXX_error"
-
-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
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- ac_config_commands="$ac_config_commands libtool"
-
-
-
-
-# Only expand once:
-
-
-
-
-# Test for 64-bit build.
-# The cast to long int works around a bug in the HP C Compiler
-# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
-# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
-# This bug is HP SR number 8606223364.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of size_t" >&5
-$as_echo_n "checking size of size_t... " >&6; }
-if ${ac_cv_sizeof_size_t+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (size_t))" "ac_cv_sizeof_size_t" "$ac_includes_default"; then :
-
-else
- if test "$ac_cv_type_size_t" = yes; then
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error 77 "cannot compute sizeof (size_t)
-See \`config.log' for more details" "$LINENO" 5; }
- else
- ac_cv_sizeof_size_t=0
- fi
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_size_t" >&5
-$as_echo "$ac_cv_sizeof_size_t" >&6; }
-
-
-
-cat >>confdefs.h <<_ACEOF
-#define SIZEOF_SIZE_T $ac_cv_sizeof_size_t
-_ACEOF
-
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler vendor" >&5
-$as_echo_n "checking for C compiler vendor... " >&6; }
-if ${ax_cv_c_compiler_vendor+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- # note: don't check for gcc first since some other compilers define __GNUC__
- vendors="intel: __ICC,__ECC,__INTEL_COMPILER
- ibm: __xlc__,__xlC__,__IBMC__,__IBMCPP__
- pathscale: __PATHCC__,__PATHSCALE__
- clang: __clang__
- gnu: __GNUC__
- sun: __SUNPRO_C,__SUNPRO_CC
- hp: __HP_cc,__HP_aCC
- dec: __DECC,__DECCXX,__DECC_VER,__DECCXX_VER
- borland: __BORLANDC__,__TURBOC__
- comeau: __COMO__
- cray: _CRAYC
- kai: __KCC
- lcc: __LCC__
- sgi: __sgi,sgi
- microsoft: _MSC_VER
- metrowerks: __MWERKS__
- watcom: __WATCOMC__
- portland: __PGI
- unknown: UNKNOWN"
- for ventest in $vendors; do
- case $ventest in
- *:) vendor=$ventest; continue ;;
- *) vencpp="defined("`echo $ventest | sed 's/,/) || defined(/g'`")" ;;
- esac
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- #if !($vencpp)
- thisisanerror;
- #endif
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- break
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- done
- ax_cv_c_compiler_vendor=`echo $vendor | cut -d: -f1`
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_c_compiler_vendor" >&5
-$as_echo "$ax_cv_c_compiler_vendor" >&6; }
-
-
-
-
-
-
-# Check whether --enable-portable-binary was given.
-if test "${enable_portable_binary+set}" = set; then :
- enableval=$enable_portable_binary; acx_maxopt_portable=$enableval
-else
- acx_maxopt_portable=no
-fi
-
-
-# Try to determine "good" native compiler flags if none specified via CFLAGS
-if test "$ac_test_CFLAGS" != "set"; then
- CFLAGS=""
- case $ax_cv_c_compiler_vendor in
- dec) CFLAGS="-newc -w0 -O5 -ansi_alias -ansi_args -fp_reorder -tune host"
- if test "x$acx_maxopt_portable" = xno; then
- CFLAGS="$CFLAGS -arch host"
- fi;;
-
- sun) CFLAGS="-native -fast -xO5 -dalign"
- if test "x$acx_maxopt_portable" = xyes; then
- CFLAGS="$CFLAGS -xarch=generic"
- fi;;
-
- hp) CFLAGS="+Oall +Optrs_ansi +DSnative"
- if test "x$acx_maxopt_portable" = xyes; then
- CFLAGS="$CFLAGS +DAportable"
- fi;;
-
- ibm) if test "x$acx_maxopt_portable" = xno; then
- xlc_opt="-qarch=auto -qtune=auto"
- else
- xlc_opt="-qtune=auto"
- fi
- as_CACHEVAR=`$as_echo "ax_cv_check_cflags__$xlc_opt" | $as_tr_sh`
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $xlc_opt" >&5
-$as_echo_n "checking whether C compiler accepts $xlc_opt... " >&6; }
-if eval \${$as_CACHEVAR+:} false; then :
- $as_echo_n "(cached) " >&6
-else
-
- ax_check_save_flags=$CFLAGS
- CFLAGS="$CFLAGS $xlc_opt"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- eval "$as_CACHEVAR=yes"
-else
- eval "$as_CACHEVAR=no"
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- CFLAGS=$ax_check_save_flags
-fi
-eval ac_res=\$$as_CACHEVAR
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-if test x"`eval 'as_val=${'$as_CACHEVAR'};$as_echo "$as_val"'`" = xyes; then :
- CFLAGS="-O3 -qansialias -w $xlc_opt"
-else
- CFLAGS="-O3 -qansialias -w"
- echo "******************************************************"
- echo "* You seem to have the IBM C compiler. It is *"
- echo "* recommended for best performance that you use: *"
- echo "* *"
- echo "* CFLAGS=-O3 -qarch=xxx -qtune=xxx -qansialias -w *"
- echo "* ^^^ ^^^ *"
- echo "* where xxx is pwr2, pwr3, 604, or whatever kind of *"
- echo "* CPU you have. (Set the CFLAGS environment var. *"
- echo "* and re-run configure.) For more info, man cc. *"
- echo "******************************************************"
-fi
-
- ;;
-
- intel) CFLAGS="-O3 -ansi_alias"
- if test "x$acx_maxopt_portable" = xno; then
- icc_archflag=unknown
- icc_flags=""
- case $host_cpu in
- i686*|x86_64*)
- # icc accepts gcc assembly syntax, so these should work:
-
-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:${as_lineno-$LINENO}: checking for x86 cpuid 0 output" >&5
-$as_echo_n "checking for x86 cpuid 0 output... " >&6; }
-if ${ax_cv_gcc_x86_cpuid_0+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test "$cross_compiling" = yes; then :
- ax_cv_gcc_x86_cpuid_0=unknown
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <stdio.h>
-int
-main ()
-{
-
- int op = 0, eax, ebx, ecx, edx;
- FILE *f;
- __asm__("cpuid"
- : "=a" (eax), "=b" (ebx), "=c" (ecx), "=d" (edx)
- : "a" (op));
- f = fopen("conftest_cpuid", "w"); if (!f) return 1;
- fprintf(f, "%x:%x:%x:%x\n", eax, ebx, ecx, edx);
- fclose(f);
- return 0;
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
- ax_cv_gcc_x86_cpuid_0=`cat conftest_cpuid`; rm -f conftest_cpuid
-else
- ax_cv_gcc_x86_cpuid_0=unknown; rm -f conftest_cpuid
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
- conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_gcc_x86_cpuid_0" >&5
-$as_echo "$ax_cv_gcc_x86_cpuid_0" >&6; }
-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
-
-
-
-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:${as_lineno-$LINENO}: checking for x86 cpuid 1 output" >&5
-$as_echo_n "checking for x86 cpuid 1 output... " >&6; }
-if ${ax_cv_gcc_x86_cpuid_1+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test "$cross_compiling" = yes; then :
- ax_cv_gcc_x86_cpuid_1=unknown
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <stdio.h>
-int
-main ()
-{
-
- int op = 1, eax, ebx, ecx, edx;
- FILE *f;
- __asm__("cpuid"
- : "=a" (eax), "=b" (ebx), "=c" (ecx), "=d" (edx)
- : "a" (op));
- f = fopen("conftest_cpuid", "w"); if (!f) return 1;
- fprintf(f, "%x:%x:%x:%x\n", eax, ebx, ecx, edx);
- fclose(f);
- return 0;
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
- ax_cv_gcc_x86_cpuid_1=`cat conftest_cpuid`; rm -f conftest_cpuid
-else
- ax_cv_gcc_x86_cpuid_1=unknown; rm -f conftest_cpuid
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
- conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_gcc_x86_cpuid_1" >&5
-$as_echo "$ax_cv_gcc_x86_cpuid_1" >&6; }
-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 $ax_cv_gcc_x86_cpuid_0 in # see AX_GCC_ARCHFLAG
- *:756e6547:*:*) # Intel
- case $ax_cv_gcc_x86_cpuid_1 in
- *6a?:*[234]:*:*|*6[789b]?:*:*:*) icc_flags="-xK";;
- *f3[347]:*:*:*|*f41347:*:*:*) icc_flags="-xP -xN -xW -xK";;
- *f??:*:*:*) icc_flags="-xN -xW -xK";;
- esac ;;
- esac ;;
- esac
- if test "x$icc_flags" != x; then
- for flag in $icc_flags; do
- as_CACHEVAR=`$as_echo "ax_cv_check_cflags__$flag" | $as_tr_sh`
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $flag" >&5
-$as_echo_n "checking whether C compiler accepts $flag... " >&6; }
-if eval \${$as_CACHEVAR+:} false; then :
- $as_echo_n "(cached) " >&6
-else
-
- ax_check_save_flags=$CFLAGS
- CFLAGS="$CFLAGS $flag"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- eval "$as_CACHEVAR=yes"
-else
- eval "$as_CACHEVAR=no"
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- CFLAGS=$ax_check_save_flags
-fi
-eval ac_res=\$$as_CACHEVAR
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-if test x"`eval 'as_val=${'$as_CACHEVAR'};$as_echo "$as_val"'`" = xyes; then :
- icc_archflag=$flag; break
-else
- :
-fi
-
- done
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for icc architecture flag" >&5
-$as_echo_n "checking for icc architecture flag... " >&6; }
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $icc_archflag" >&5
-$as_echo "$icc_archflag" >&6; }
- if test "x$icc_archflag" != xunknown; then
- CFLAGS="$CFLAGS $icc_archflag"
- fi
- fi
- ;;
-
- gnu)
- # default optimization flags for gcc on all systems
- CFLAGS="-O3 -fomit-frame-pointer"
-
- # -malign-double for x86 systems
- # LIBFFI -- DON'T DO THIS - CHANGES ABI
- # AX_CHECK_COMPILE_FLAG(-malign-double, CFLAGS="$CFLAGS -malign-double")
-
- # -fstrict-aliasing for gcc-2.95+
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -fstrict-aliasing" >&5
-$as_echo_n "checking whether C compiler accepts -fstrict-aliasing... " >&6; }
-if ${ax_cv_check_cflags___fstrict_aliasing+:} false; then :
- $as_echo_n "(cached) " >&6
-else
-
- ax_check_save_flags=$CFLAGS
- CFLAGS="$CFLAGS -fstrict-aliasing"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ax_cv_check_cflags___fstrict_aliasing=yes
-else
- ax_cv_check_cflags___fstrict_aliasing=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- CFLAGS=$ax_check_save_flags
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___fstrict_aliasing" >&5
-$as_echo "$ax_cv_check_cflags___fstrict_aliasing" >&6; }
-if test x"$ax_cv_check_cflags___fstrict_aliasing" = xyes; then :
- CFLAGS="$CFLAGS -fstrict-aliasing"
-else
- :
-fi
-
-
- # note that we enable "unsafe" fp optimization with other compilers, too
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -ffast-math" >&5
-$as_echo_n "checking whether C compiler accepts -ffast-math... " >&6; }
-if ${ax_cv_check_cflags___ffast_math+:} false; then :
- $as_echo_n "(cached) " >&6
-else
-
- ax_check_save_flags=$CFLAGS
- CFLAGS="$CFLAGS -ffast-math"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ax_cv_check_cflags___ffast_math=yes
-else
- ax_cv_check_cflags___ffast_math=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- CFLAGS=$ax_check_save_flags
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___ffast_math" >&5
-$as_echo "$ax_cv_check_cflags___ffast_math" >&6; }
-if test x"$ax_cv_check_cflags___ffast_math" = xyes; then :
- CFLAGS="$CFLAGS -ffast-math"
-else
- :
-fi
-
-
-
-
-
-
-# Check whether --with-gcc-arch was given.
-if test "${with_gcc_arch+set}" = set; then :
- withval=$with_gcc_arch; ax_gcc_arch=$withval
-else
- ax_gcc_arch=yes
-fi
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for gcc architecture flag" >&5
-$as_echo_n "checking for gcc architecture flag... " >&6; }
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: " >&5
-$as_echo "" >&6; }
-if ${ax_cv_gcc_archflag+:} false; then :
- $as_echo_n "(cached) " >&6
-else
-
-ax_cv_gcc_archflag="unknown"
-
-if test "$GCC" = yes; then
-
-if test "x$ax_gcc_arch" = xyes; then
-ax_gcc_arch=""
-if test "$cross_compiling" = no; then
-case $host_cpu in
- i[3456]86*|x86_64*) # use cpuid codes
-
-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:${as_lineno-$LINENO}: checking for x86 cpuid 0 output" >&5
-$as_echo_n "checking for x86 cpuid 0 output... " >&6; }
-if ${ax_cv_gcc_x86_cpuid_0+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test "$cross_compiling" = yes; then :
- ax_cv_gcc_x86_cpuid_0=unknown
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <stdio.h>
-int
-main ()
-{
-
- int op = 0, eax, ebx, ecx, edx;
- FILE *f;
- __asm__("cpuid"
- : "=a" (eax), "=b" (ebx), "=c" (ecx), "=d" (edx)
- : "a" (op));
- f = fopen("conftest_cpuid", "w"); if (!f) return 1;
- fprintf(f, "%x:%x:%x:%x\n", eax, ebx, ecx, edx);
- fclose(f);
- return 0;
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
- ax_cv_gcc_x86_cpuid_0=`cat conftest_cpuid`; rm -f conftest_cpuid
-else
- ax_cv_gcc_x86_cpuid_0=unknown; rm -f conftest_cpuid
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
- conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_gcc_x86_cpuid_0" >&5
-$as_echo "$ax_cv_gcc_x86_cpuid_0" >&6; }
-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
-
-
-
-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:${as_lineno-$LINENO}: checking for x86 cpuid 1 output" >&5
-$as_echo_n "checking for x86 cpuid 1 output... " >&6; }
-if ${ax_cv_gcc_x86_cpuid_1+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test "$cross_compiling" = yes; then :
- ax_cv_gcc_x86_cpuid_1=unknown
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <stdio.h>
-int
-main ()
-{
-
- int op = 1, eax, ebx, ecx, edx;
- FILE *f;
- __asm__("cpuid"
- : "=a" (eax), "=b" (ebx), "=c" (ecx), "=d" (edx)
- : "a" (op));
- f = fopen("conftest_cpuid", "w"); if (!f) return 1;
- fprintf(f, "%x:%x:%x:%x\n", eax, ebx, ecx, edx);
- fclose(f);
- return 0;
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
- ax_cv_gcc_x86_cpuid_1=`cat conftest_cpuid`; rm -f conftest_cpuid
-else
- ax_cv_gcc_x86_cpuid_1=unknown; rm -f conftest_cpuid
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
- conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_gcc_x86_cpuid_1" >&5
-$as_echo "$ax_cv_gcc_x86_cpuid_1" >&6; }
-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 $ax_cv_gcc_x86_cpuid_0 in
- *:756e6547:*:*) # Intel
- case $ax_cv_gcc_x86_cpuid_1 in
- *5[48]?:*:*:*) ax_gcc_arch="pentium-mmx pentium" ;;
- *5??:*:*:*) ax_gcc_arch=pentium ;;
- *0?6[3456]?:*:*:*) ax_gcc_arch="pentium2 pentiumpro" ;;
- *0?6a?:*[01]:*:*) ax_gcc_arch="pentium2 pentiumpro" ;;
- *0?6a?:*[234]:*:*) ax_gcc_arch="pentium3 pentiumpro" ;;
- *0?6[9de]?:*:*:*) ax_gcc_arch="pentium-m pentium3 pentiumpro" ;;
- *0?6[78b]?:*:*:*) ax_gcc_arch="pentium3 pentiumpro" ;;
- *0?6f?:*:*:*|*1?66?:*:*:*) ax_gcc_arch="core2 pentium-m pentium3 pentiumpro" ;;
- *1?6[7d]?:*:*:*) ax_gcc_arch="penryn core2 pentium-m pentium3 pentiumpro" ;;
- *1?6[aef]?:*:*:*|*2?6[5cef]?:*:*:*) ax_gcc_arch="corei7 core2 pentium-m pentium3 pentiumpro" ;;
- *1?6c?:*:*:*|*[23]?66?:*:*:*) ax_gcc_arch="atom core2 pentium-m pentium3 pentiumpro" ;;
- *2?6[ad]?:*:*:*) ax_gcc_arch="corei7-avx corei7 core2 pentium-m pentium3 pentiumpro" ;;
- *0?6??:*:*:*) ax_gcc_arch=pentiumpro ;;
- *6??:*:*:*) ax_gcc_arch="core2 pentiumpro" ;;
- ?000?f3[347]:*:*:*|?000?f41347:*:*:*|?000?f6?:*:*:*)
- case $host_cpu in
- x86_64*) ax_gcc_arch="nocona pentium4 pentiumpro" ;;
- *) ax_gcc_arch="prescott pentium4 pentiumpro" ;;
- esac ;;
- ?000?f??:*:*:*) ax_gcc_arch="pentium4 pentiumpro";;
- esac ;;
- *:68747541:*:*) # AMD
- case $ax_cv_gcc_x86_cpuid_1 in
- *5[67]?:*:*:*) ax_gcc_arch=k6 ;;
- *5[8d]?:*:*:*) ax_gcc_arch="k6-2 k6" ;;
- *5[9]?:*:*:*) ax_gcc_arch="k6-3 k6" ;;
- *60?:*:*:*) ax_gcc_arch=k7 ;;
- *6[12]?:*:*:*) ax_gcc_arch="athlon k7" ;;
- *6[34]?:*:*:*) ax_gcc_arch="athlon-tbird k7" ;;
- *67?:*:*:*) ax_gcc_arch="athlon-4 athlon k7" ;;
- *6[68a]?:*:*:*)
-
-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:${as_lineno-$LINENO}: checking for x86 cpuid 0x80000006 output" >&5
-$as_echo_n "checking for x86 cpuid 0x80000006 output... " >&6; }
-if ${ax_cv_gcc_x86_cpuid_0x80000006+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test "$cross_compiling" = yes; then :
- ax_cv_gcc_x86_cpuid_0x80000006=unknown
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <stdio.h>
-int
-main ()
-{
-
- int op = 0x80000006, eax, ebx, ecx, edx;
- FILE *f;
- __asm__("cpuid"
- : "=a" (eax), "=b" (ebx), "=c" (ecx), "=d" (edx)
- : "a" (op));
- f = fopen("conftest_cpuid", "w"); if (!f) return 1;
- fprintf(f, "%x:%x:%x:%x\n", eax, ebx, ecx, edx);
- fclose(f);
- return 0;
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
- ax_cv_gcc_x86_cpuid_0x80000006=`cat conftest_cpuid`; rm -f conftest_cpuid
-else
- ax_cv_gcc_x86_cpuid_0x80000006=unknown; rm -f conftest_cpuid
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
- conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_gcc_x86_cpuid_0x80000006" >&5
-$as_echo "$ax_cv_gcc_x86_cpuid_0x80000006" >&6; }
-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
-
- # L2 cache size
- case $ax_cv_gcc_x86_cpuid_0x80000006 in
- *:*:*[1-9a-f]??????:*) # (L2 = ecx >> 16) >= 256
- ax_gcc_arch="athlon-xp athlon-4 athlon k7" ;;
- *) ax_gcc_arch="athlon-4 athlon k7" ;;
- esac ;;
- ?00??f[4cef8b]?:*:*:*) ax_gcc_arch="athlon64 k8" ;;
- ?00??f5?:*:*:*) ax_gcc_arch="opteron k8" ;;
- ?00??f7?:*:*:*) ax_gcc_arch="athlon-fx opteron k8" ;;
- ?00??f??:*:*:*) ax_gcc_arch="k8" ;;
- ?05??f??:*:*:*) ax_gcc_arch="btver1 amdfam10 k8" ;;
- ?06??f??:*:*:*) ax_gcc_arch="bdver1 amdfam10 k8" ;;
- *f??:*:*:*) ax_gcc_arch="amdfam10 k8" ;;
- esac ;;
- *:746e6543:*:*) # IDT
- case $ax_cv_gcc_x86_cpuid_1 in
- *54?:*:*:*) ax_gcc_arch=winchip-c6 ;;
- *58?:*:*:*) ax_gcc_arch=winchip2 ;;
- *6[78]?:*:*:*) ax_gcc_arch=c3 ;;
- *69?:*:*:*) ax_gcc_arch="c3-2 c3" ;;
- esac ;;
- esac
- if test x"$ax_gcc_arch" = x; then # fallback
- case $host_cpu in
- i586*) ax_gcc_arch=pentium ;;
- i686*) ax_gcc_arch=pentiumpro ;;
- esac
- fi
- ;;
-
- sparc*)
- # Extract the first word of "prtdiag", so it can be a program name with args.
-set dummy prtdiag; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_PRTDIAG+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- case $PRTDIAG in
- [\\/]* | ?:[\\/]*)
- ac_cv_path_PRTDIAG="$PRTDIAG" # Let the user override the test with a path.
- ;;
- *)
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-as_dummy="$PATH:/usr/platform/`uname -i`/sbin/:/usr/platform/`uname -m`/sbin/"
-for as_dir in $as_dummy
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_path_PRTDIAG="$as_dir/$ac_word$ac_exec_ext"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
- test -z "$ac_cv_path_PRTDIAG" && ac_cv_path_PRTDIAG="prtdiag"
- ;;
-esac
-fi
-PRTDIAG=$ac_cv_path_PRTDIAG
-if test -n "$PRTDIAG"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PRTDIAG" >&5
-$as_echo "$PRTDIAG" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
- cputype=`(((grep cpu /proc/cpuinfo | cut -d: -f2) ; ($PRTDIAG -v |grep -i sparc) ; grep -i cpu /var/run/dmesg.boot ) | head -n 1) 2> /dev/null`
- cputype=`echo "$cputype" | tr -d ' -' | sed 's/SPARCIIi/SPARCII/' | tr $as_cr_LETTERS $as_cr_letters`
- case $cputype in
- *ultrasparciv*) ax_gcc_arch="ultrasparc4 ultrasparc3 ultrasparc v9" ;;
- *ultrasparciii*) ax_gcc_arch="ultrasparc3 ultrasparc v9" ;;
- *ultrasparc*) ax_gcc_arch="ultrasparc v9" ;;
- *supersparc*|*tms390z5[05]*) ax_gcc_arch="supersparc v8" ;;
- *hypersparc*|*rt62[056]*) ax_gcc_arch="hypersparc v8" ;;
- *cypress*) ax_gcc_arch=cypress ;;
- esac ;;
-
- alphaev5) ax_gcc_arch=ev5 ;;
- alphaev56) ax_gcc_arch=ev56 ;;
- alphapca56) ax_gcc_arch="pca56 ev56" ;;
- alphapca57) ax_gcc_arch="pca57 pca56 ev56" ;;
- alphaev6) ax_gcc_arch=ev6 ;;
- alphaev67) ax_gcc_arch=ev67 ;;
- alphaev68) ax_gcc_arch="ev68 ev67" ;;
- alphaev69) ax_gcc_arch="ev69 ev68 ev67" ;;
- alphaev7) ax_gcc_arch="ev7 ev69 ev68 ev67" ;;
- alphaev79) ax_gcc_arch="ev79 ev7 ev69 ev68 ev67" ;;
-
- powerpc*)
- cputype=`((grep cpu /proc/cpuinfo | head -n 1 | cut -d: -f2 | cut -d, -f1 | sed 's/ //g') ; /usr/bin/machine ; /bin/machine; grep CPU /var/run/dmesg.boot | head -n 1 | cut -d" " -f2) 2> /dev/null`
- cputype=`echo $cputype | sed -e 's/ppc//g;s/ *//g'`
- case $cputype in
- *750*) ax_gcc_arch="750 G3" ;;
- *740[0-9]*) ax_gcc_arch="$cputype 7400 G4" ;;
- *74[4-5][0-9]*) ax_gcc_arch="$cputype 7450 G4" ;;
- *74[0-9][0-9]*) ax_gcc_arch="$cputype G4" ;;
- *970*) ax_gcc_arch="970 G5 power4";;
- *POWER4*|*power4*|*gq*) ax_gcc_arch="power4 970";;
- *POWER5*|*power5*|*gr*|*gs*) ax_gcc_arch="power5 power4 970";;
- 603ev|8240) ax_gcc_arch="$cputype 603e 603";;
- *) ax_gcc_arch=$cputype ;;
- esac
- ax_gcc_arch="$ax_gcc_arch powerpc"
- ;;
-esac
-fi # not cross-compiling
-fi # guess arch
-
-if test "x$ax_gcc_arch" != x -a "x$ax_gcc_arch" != xno; then
-for arch in $ax_gcc_arch; do
- if test "x$acx_maxopt_portable" = xyes; then # if we require portable code
- flags="-mtune=$arch"
- # -mcpu=$arch and m$arch generate nonportable code on every arch except
- # x86. And some other arches (e.g. Alpha) don't accept -mtune. Grrr.
- case $host_cpu in i*86|x86_64*) flags="$flags -mcpu=$arch -m$arch";; esac
- else
- flags="-march=$arch -mcpu=$arch -m$arch"
- fi
- for flag in $flags; do
- as_CACHEVAR=`$as_echo "ax_cv_check_cflags__$flag" | $as_tr_sh`
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $flag" >&5
-$as_echo_n "checking whether C compiler accepts $flag... " >&6; }
-if eval \${$as_CACHEVAR+:} false; then :
- $as_echo_n "(cached) " >&6
-else
-
- ax_check_save_flags=$CFLAGS
- CFLAGS="$CFLAGS $flag"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- eval "$as_CACHEVAR=yes"
-else
- eval "$as_CACHEVAR=no"
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- CFLAGS=$ax_check_save_flags
-fi
-eval ac_res=\$$as_CACHEVAR
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-if test x"`eval 'as_val=${'$as_CACHEVAR'};$as_echo "$as_val"'`" = xyes; then :
- ax_cv_gcc_archflag=$flag; break
-else
- :
-fi
-
- done
- test "x$ax_cv_gcc_archflag" = xunknown || break
-done
-fi
-
-fi # $GCC=yes
-
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for gcc architecture flag" >&5
-$as_echo_n "checking for gcc architecture flag... " >&6; }
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_gcc_archflag" >&5
-$as_echo "$ax_cv_gcc_archflag" >&6; }
-if test "x$ax_cv_gcc_archflag" = xunknown; then
- :
-else
- CFLAGS="$CFLAGS $ax_cv_gcc_archflag"
-fi
-
- ;;
- esac
-
- if test -z "$CFLAGS"; then
- echo ""
- echo "********************************************************"
- echo "* WARNING: Don't know the best CFLAGS for this system *"
- echo "* Use ./configure CFLAGS=... to specify your own flags *"
- echo "* (otherwise, a default of CFLAGS=-O3 will be used) *"
- echo "********************************************************"
- echo ""
- CFLAGS="-O3"
- fi
-
- as_CACHEVAR=`$as_echo "ax_cv_check_cflags__$CFLAGS" | $as_tr_sh`
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $CFLAGS" >&5
-$as_echo_n "checking whether C compiler accepts $CFLAGS... " >&6; }
-if eval \${$as_CACHEVAR+:} false; then :
- $as_echo_n "(cached) " >&6
-else
-
- ax_check_save_flags=$CFLAGS
- CFLAGS="$CFLAGS $CFLAGS"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- eval "$as_CACHEVAR=yes"
-else
- eval "$as_CACHEVAR=no"
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- CFLAGS=$ax_check_save_flags
-fi
-eval ac_res=\$$as_CACHEVAR
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-if test x"`eval 'as_val=${'$as_CACHEVAR'};$as_echo "$as_val"'`" = xyes; then :
- :
-else
-
- echo ""
- echo "********************************************************"
- echo "* WARNING: The guessed CFLAGS don't seem to work with *"
- echo "* your compiler. *"
- echo "* Use ./configure CFLAGS=... to specify your own flags *"
- echo "********************************************************"
- echo ""
- CFLAGS=""
-
-fi
-
-
-fi
-
-# The AX_CFLAGS_WARN_ALL macro doesn't currently work for sunpro
-# compiler.
-if test "$ax_cv_c_compiler_vendor" != "sun"; then
- if ${CFLAGS+:} false; then :
- case " $CFLAGS " in
- *" "*)
- { { $as_echo "$as_me:${as_lineno-$LINENO}: : CFLAGS already contains "; } >&5
- (: CFLAGS already contains ) 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }
- ;;
- *)
- { { $as_echo "$as_me:${as_lineno-$LINENO}: : CFLAGS=\"\$CFLAGS \""; } >&5
- (: CFLAGS="$CFLAGS ") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }
- CFLAGS="$CFLAGS "
- ;;
- esac
-else
- CFLAGS=""
-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:${as_lineno-$LINENO}: checking CFLAGS for maximum warnings" >&5
-$as_echo_n "checking CFLAGS for maximum warnings... " >&6; }
-if ${ac_cv_cflags_warn_all+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_cv_cflags_warn_all="no, unknown"
-ac_save_CFLAGS="$CFLAGS"
-for ac_arg in "-warn all % -warn all" "-pedantic % -Wall" "-xstrconst % -v" "-std1 % -verbose -w0 -warnprotos" "-qlanglvl=ansi % -qsrcmsg -qinfo=all:noppt:noppc:noobs:nocnd" "-ansi -ansiE % -fullwarn" "+ESlit % +w1" "-Xc % -pvctl,fullmsg" "-h conform % -h msglevel 2" #
-do CFLAGS="$ac_save_CFLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'`
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_cflags_warn_all=`echo $ac_arg | sed -e 's,.*% *,,'` ; break
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-done
-CFLAGS="$ac_save_CFLAGS"
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags_warn_all" >&5
-$as_echo "$ac_cv_cflags_warn_all" >&6; }
-
-case ".$ac_cv_cflags_warn_all" in
- .ok|.ok,*) ;;
- .|.no|.no,*) ;;
- *) if ${CFLAGS+:} false; then :
- case " $CFLAGS " in
- *" $ac_cv_cflags_warn_all "*)
- { { $as_echo "$as_me:${as_lineno-$LINENO}: : CFLAGS already contains \$ac_cv_cflags_warn_all"; } >&5
- (: CFLAGS already contains $ac_cv_cflags_warn_all) 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }
- ;;
- *)
- { { $as_echo "$as_me:${as_lineno-$LINENO}: : CFLAGS=\"\$CFLAGS \$ac_cv_cflags_warn_all\""; } >&5
- (: CFLAGS="$CFLAGS $ac_cv_cflags_warn_all") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }
- CFLAGS="$CFLAGS $ac_cv_cflags_warn_all"
- ;;
- esac
-else
- CFLAGS="$ac_cv_cflags_warn_all"
-fi
- ;;
-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
-
-
-fi
-
-if test "x$GCC" = "xyes"; then
- CFLAGS="$CFLAGS -fexceptions"
-fi
-
-cat > local.exp <<EOF
-set CC_FOR_TARGET "$CC"
-set CXX_FOR_TARGET "$CXX"
-EOF
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5
-$as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; }
- # Check whether --enable-maintainer-mode was given.
-if test "${enable_maintainer_mode+set}" = set; then :
- enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval
-else
- USE_MAINTAINER_MODE=no
-fi
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5
-$as_echo "$USE_MAINTAINER_MODE" >&6; }
- if test $USE_MAINTAINER_MODE = yes; then
- MAINTAINER_MODE_TRUE=
- MAINTAINER_MODE_FALSE='#'
-else
- MAINTAINER_MODE_TRUE='#'
- MAINTAINER_MODE_FALSE=
-fi
-
- MAINT=$MAINTAINER_MODE_TRUE
-
-
-
-for ac_header in sys/mman.h
-do :
- ac_fn_c_check_header_mongrel "$LINENO" "sys/mman.h" "ac_cv_header_sys_mman_h" "$ac_includes_default"
-if test "x$ac_cv_header_sys_mman_h" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_SYS_MMAN_H 1
-_ACEOF
-
-fi
-
-done
-
-for ac_func in mmap
-do :
- ac_fn_c_check_func "$LINENO" "mmap" "ac_cv_func_mmap"
-if test "x$ac_cv_func_mmap" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_MMAP 1
-_ACEOF
-
-fi
-done
-
-
-ac_fn_c_check_header_mongrel "$LINENO" "sys/mman.h" "ac_cv_header_sys_mman_h" "$ac_includes_default"
-if test "x$ac_cv_header_sys_mman_h" = xyes; then :
- libffi_header_sys_mman_h=yes
-else
- libffi_header_sys_mman_h=no
-fi
-
-
-ac_fn_c_check_func "$LINENO" "mmap" "ac_cv_func_mmap"
-if test "x$ac_cv_func_mmap" = xyes; then :
- libffi_func_mmap=yes
-else
- libffi_func_mmap=no
-fi
-
-if test "$libffi_header_sys_mman_h" != yes \
- || test "$libffi_func_mmap" != yes; then
- ac_cv_func_mmap_file=no
- ac_cv_func_mmap_dev_zero=no
- ac_cv_func_mmap_anon=no
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether read-only mmap of a plain file works" >&5
-$as_echo_n "checking whether read-only mmap of a plain file works... " >&6; }
-if ${ac_cv_func_mmap_file+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- # Add a system to this blacklist if
- # mmap(0, stat_size, PROT_READ, MAP_PRIVATE, fd, 0) doesn't return a
- # memory area containing the same data that you'd get if you applied
- # read() to the same fd. The only system known to have a problem here
- # is VMS, where text files have record structure.
- case "$host_os" in
- vms* | ultrix*)
- ac_cv_func_mmap_file=no ;;
- *)
- ac_cv_func_mmap_file=yes;;
- esac
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_mmap_file" >&5
-$as_echo "$ac_cv_func_mmap_file" >&6; }
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mmap from /dev/zero works" >&5
-$as_echo_n "checking whether mmap from /dev/zero works... " >&6; }
-if ${ac_cv_func_mmap_dev_zero+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- # Add a system to this blacklist if it has mmap() but /dev/zero
- # does not exist, or if mmapping /dev/zero does not give anonymous
- # zeroed pages with both the following properties:
- # 1. If you map N consecutive pages in with one call, and then
- # unmap any subset of those pages, the pages that were not
- # explicitly unmapped remain accessible.
- # 2. If you map two adjacent blocks of memory and then unmap them
- # both at once, they must both go away.
- # Systems known to be in this category are Windows (all variants),
- # VMS, and Darwin.
- case "$host_os" in
- vms* | cygwin* | pe | mingw* | darwin* | ultrix* | hpux10* | hpux11.00)
- ac_cv_func_mmap_dev_zero=no ;;
- *)
- ac_cv_func_mmap_dev_zero=yes;;
- esac
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_mmap_dev_zero" >&5
-$as_echo "$ac_cv_func_mmap_dev_zero" >&6; }
-
- # Unlike /dev/zero, the MAP_ANON(YMOUS) defines can be probed for.
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for MAP_ANON(YMOUS)" >&5
-$as_echo_n "checking for MAP_ANON(YMOUS)... " >&6; }
-if ${ac_cv_decl_map_anon+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <sys/types.h>
-#include <sys/mman.h>
-#include <unistd.h>
-
-#ifndef MAP_ANONYMOUS
-#define MAP_ANONYMOUS MAP_ANON
-#endif
-
-int
-main ()
-{
-int n = MAP_ANONYMOUS;
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_decl_map_anon=yes
-else
- ac_cv_decl_map_anon=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_decl_map_anon" >&5
-$as_echo "$ac_cv_decl_map_anon" >&6; }
-
- if test $ac_cv_decl_map_anon = no; then
- ac_cv_func_mmap_anon=no
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mmap with MAP_ANON(YMOUS) works" >&5
-$as_echo_n "checking whether mmap with MAP_ANON(YMOUS) works... " >&6; }
-if ${ac_cv_func_mmap_anon+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- # Add a system to this blacklist if it has mmap() and MAP_ANON or
- # MAP_ANONYMOUS, but using mmap(..., MAP_PRIVATE|MAP_ANONYMOUS, -1, 0)
- # doesn't give anonymous zeroed pages with the same properties listed
- # above for use of /dev/zero.
- # Systems known to be in this category are Windows, VMS, and SCO Unix.
- case "$host_os" in
- vms* | cygwin* | pe | mingw* | sco* | udk* )
- ac_cv_func_mmap_anon=no ;;
- *)
- ac_cv_func_mmap_anon=yes;;
- esac
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_mmap_anon" >&5
-$as_echo "$ac_cv_func_mmap_anon" >&6; }
- fi
-fi
-
-if test $ac_cv_func_mmap_file = yes; then
-
-$as_echo "#define HAVE_MMAP_FILE 1" >>confdefs.h
-
-fi
-if test $ac_cv_func_mmap_dev_zero = yes; then
-
-$as_echo "#define HAVE_MMAP_DEV_ZERO 1" >>confdefs.h
-
-fi
-if test $ac_cv_func_mmap_anon = yes; then
-
-$as_echo "#define HAVE_MMAP_ANON 1" >>confdefs.h
-
-fi
-
-
- if test -d $srcdir/testsuite; then
- TESTSUBDIR_TRUE=
- TESTSUBDIR_FALSE='#'
-else
- TESTSUBDIR_TRUE='#'
- TESTSUBDIR_FALSE=
-fi
-
-
-TARGETDIR="unknown"
-HAVE_LONG_DOUBLE_VARIANT=0
-case "$host" in
- aarch64*-*-*)
- TARGET=AARCH64; TARGETDIR=aarch64
- ;;
-
- alpha*-*-*)
- TARGET=ALPHA; TARGETDIR=alpha;
- # Support 128-bit long double, changeable via command-line switch.
- HAVE_LONG_DOUBLE='defined(__LONG_DOUBLE_128__)'
- ;;
-
- arc*-*-*)
- TARGET=ARC; TARGETDIR=arc
- ;;
-
- arm*-*-*)
- TARGET=ARM; TARGETDIR=arm
- ;;
-
- amd64-*-freebsd* | amd64-*-openbsd*)
- TARGET=X86_64; TARGETDIR=x86
- ;;
-
- amd64-*-freebsd*)
- TARGET=X86_64; TARGETDIR=x86
- ;;
-
- amd64-*-freebsd*)
- TARGET=X86_64; TARGETDIR=x86
- ;;
-
- avr32*-*-*)
- TARGET=AVR32; TARGETDIR=avr32
- ;;
-
- bfin*)
- TARGET=BFIN; TARGETDIR=bfin
- ;;
-
- cris-*-*)
- TARGET=LIBFFI_CRIS; TARGETDIR=cris
- ;;
-
- frv-*-*)
- TARGET=FRV; TARGETDIR=frv
- ;;
-
- hppa*-*-linux* | parisc*-*-linux* | hppa*-*-openbsd*)
- TARGET=PA_LINUX; TARGETDIR=pa
- ;;
- hppa*64-*-hpux*)
- TARGET=PA64_HPUX; TARGETDIR=pa
- ;;
- hppa*-*-hpux*)
- TARGET=PA_HPUX; TARGETDIR=pa
- ;;
-
- i?86-*-freebsd* | i?86-*-openbsd*)
- TARGET=X86_FREEBSD; TARGETDIR=x86
- ;;
- i?86-win32* | i?86-*-cygwin* | i?86-*-mingw* | i?86-*-os2* | i?86-*-interix*)
- TARGET=X86_WIN32; TARGETDIR=x86
- # All mingw/cygwin/win32 builds require -no-undefined for sharedlib.
- # We must also check with_cross_host to decide if this is a native
- # or cross-build and select where to install dlls appropriately.
- if test -n "$with_cross_host" &&
- test x"$with_cross_host" != x"no"; then
- AM_LTLDFLAGS='-no-undefined -bindir "$(toolexeclibdir)"';
- else
- AM_LTLDFLAGS='-no-undefined -bindir "$(bindir)"';
- fi
- ;;
- i?86-*-darwin*)
- TARGET=X86_DARWIN; TARGETDIR=x86
- ;;
- i?86-*-solaris2.1[0-9]*)
- TARGETDIR=x86
- if test $ac_cv_sizeof_size_t = 4; then
- TARGET=X86;
- else
- TARGET=X86_64;
- fi
- ;;
-
- i*86-*-nto-qnx*)
- TARGET=X86; TARGETDIR=x86
- ;;
-
- x86_64-*-darwin*)
- TARGET=X86_DARWIN; TARGETDIR=x86
- ;;
-
- x86_64-*-cygwin* | x86_64-*-mingw*)
- TARGET=X86_WIN64; TARGETDIR=x86
- # All mingw/cygwin/win32 builds require -no-undefined for sharedlib.
- # We must also check with_cross_host to decide if this is a native
- # or cross-build and select where to install dlls appropriately.
- if test -n "$with_cross_host" &&
- test x"$with_cross_host" != x"no"; then
- AM_LTLDFLAGS='-no-undefined -bindir "$(toolexeclibdir)"';
- else
- AM_LTLDFLAGS='-no-undefined -bindir "$(bindir)"';
- fi
- ;;
-
- i?86-*-* | x86_64-*-*)
- TARGETDIR=x86
- if test $ac_cv_sizeof_size_t = 4; then
- case "$host" in
- *-gnux32)
- TARGET=X86_64
- ;;
- *)
- TARGET=X86
- ;;
- esac
- else
- TARGET=X86_64;
- fi
- ;;
-
- ia64*-*-*)
- TARGET=IA64; TARGETDIR=ia64
- ;;
-
- m32r*-*-*)
- TARGET=M32R; TARGETDIR=m32r
- ;;
-
- m68k-*-*)
- TARGET=M68K; TARGETDIR=m68k
- ;;
-
- m88k-*-*)
- TARGET=M88K; TARGETDIR=m88k
- ;;
-
- microblaze*-*-*)
- TARGET=MICROBLAZE; TARGETDIR=microblaze
- ;;
-
- moxie-*-*)
- TARGET=MOXIE; TARGETDIR=moxie
- ;;
-
- metag-*-*)
- TARGET=METAG; TARGETDIR=metag
- ;;
-
- mips-sgi-irix5.* | mips-sgi-irix6.* | mips*-*-rtems*)
- TARGET=MIPS_IRIX; TARGETDIR=mips
- ;;
- mips*-*linux* | mips*-*-openbsd*)
- # Support 128-bit long double for NewABI.
- HAVE_LONG_DOUBLE='defined(__mips64)'
- TARGET=MIPS_LINUX; TARGETDIR=mips
- ;;
-
- nios2*-linux*)
- TARGET=NIOS2; TARGETDIR=nios2
- ;;
-
- powerpc*-*-linux* | powerpc-*-sysv*)
- TARGET=POWERPC; TARGETDIR=powerpc
- HAVE_LONG_DOUBLE_VARIANT=1
- ;;
- powerpc-*-amigaos*)
- TARGET=POWERPC; TARGETDIR=powerpc
- ;;
- powerpc-*-beos*)
- TARGET=POWERPC; TARGETDIR=powerpc
- ;;
- powerpc-*-darwin* | powerpc64-*-darwin*)
- TARGET=POWERPC_DARWIN; TARGETDIR=powerpc
- ;;
- powerpc-*-aix* | rs6000-*-aix*)
- TARGET=POWERPC_AIX; TARGETDIR=powerpc
- ;;
- powerpc-*-freebsd* | powerpc-*-openbsd*)
- TARGET=POWERPC_FREEBSD; TARGETDIR=powerpc
- HAVE_LONG_DOUBLE_VARIANT=1
- ;;
- powerpc64-*-freebsd*)
- TARGET=POWERPC; TARGETDIR=powerpc
- ;;
- powerpc*-*-rtems*)
- TARGET=POWERPC; TARGETDIR=powerpc
- ;;
-
- s390-*-* | s390x-*-*)
- TARGET=S390; TARGETDIR=s390
- ;;
-
- sh-*-* | sh[34]*-*-*)
- TARGET=SH; TARGETDIR=sh
- ;;
- sh64-*-* | sh5*-*-*)
- TARGET=SH64; TARGETDIR=sh64
- ;;
-
- sparc*-*-*)
- TARGET=SPARC; TARGETDIR=sparc
- ;;
-
- tile*-*)
- TARGET=TILE; TARGETDIR=tile
- ;;
-
- vax-*-*)
- TARGET=VAX; TARGETDIR=vax
- ;;
-
- xtensa*-*)
- TARGET=XTENSA; TARGETDIR=xtensa
- ;;
-
-esac
-
-
-
-
-if test $TARGETDIR = unknown; then
- as_fn_error $? "\"libffi has not been ported to $host.\"" "$LINENO" 5
-fi
-
- if expr x$TARGET : 'xMIPS' > /dev/null; then
- MIPS_TRUE=
- MIPS_FALSE='#'
-else
- MIPS_TRUE='#'
- MIPS_FALSE=
-fi
-
- if test x$TARGET = xBFIN; then
- BFIN_TRUE=
- BFIN_FALSE='#'
-else
- BFIN_TRUE='#'
- BFIN_FALSE=
-fi
-
- if test x$TARGET = xSPARC; then
- SPARC_TRUE=
- SPARC_FALSE='#'
-else
- SPARC_TRUE='#'
- SPARC_FALSE=
-fi
-
- if test x$TARGET = xX86; then
- X86_TRUE=
- X86_FALSE='#'
-else
- X86_TRUE='#'
- X86_FALSE=
-fi
-
- if test x$TARGET = xX86_FREEBSD; then
- X86_FREEBSD_TRUE=
- X86_FREEBSD_FALSE='#'
-else
- X86_FREEBSD_TRUE='#'
- X86_FREEBSD_FALSE=
-fi
-
- if test x$TARGET = xX86_WIN32; then
- X86_WIN32_TRUE=
- X86_WIN32_FALSE='#'
-else
- X86_WIN32_TRUE='#'
- X86_WIN32_FALSE=
-fi
-
- if test x$TARGET = xX86_WIN64; then
- X86_WIN64_TRUE=
- X86_WIN64_FALSE='#'
-else
- X86_WIN64_TRUE='#'
- X86_WIN64_FALSE=
-fi
-
- if test x$TARGET = xX86_DARWIN; then
- X86_DARWIN_TRUE=
- X86_DARWIN_FALSE='#'
-else
- X86_DARWIN_TRUE='#'
- X86_DARWIN_FALSE=
-fi
-
- if test x$TARGET = xX86_DARWIN && test $ac_cv_sizeof_size_t = 4; then
- X86_DARWIN32_TRUE=
- X86_DARWIN32_FALSE='#'
-else
- X86_DARWIN32_TRUE='#'
- X86_DARWIN32_FALSE=
-fi
-
- if test x$TARGET = xX86_DARWIN && test $ac_cv_sizeof_size_t = 8; then
- X86_DARWIN64_TRUE=
- X86_DARWIN64_FALSE='#'
-else
- X86_DARWIN64_TRUE='#'
- X86_DARWIN64_FALSE=
-fi
-
- if test x$TARGET = xALPHA; then
- ALPHA_TRUE=
- ALPHA_FALSE='#'
-else
- ALPHA_TRUE='#'
- ALPHA_FALSE=
-fi
-
- if test x$TARGET = xIA64; then
- IA64_TRUE=
- IA64_FALSE='#'
-else
- IA64_TRUE='#'
- IA64_FALSE=
-fi
-
- if test x$TARGET = xM32R; then
- M32R_TRUE=
- M32R_FALSE='#'
-else
- M32R_TRUE='#'
- M32R_FALSE=
-fi
-
- if test x$TARGET = xM68K; then
- M68K_TRUE=
- M68K_FALSE='#'
-else
- M68K_TRUE='#'
- M68K_FALSE=
-fi
-
- if test x$TARGET = xM88K; then
- M88K_TRUE=
- M88K_FALSE='#'
-else
- M88K_TRUE='#'
- M88K_FALSE=
-fi
-
- if test x$TARGET = xMICROBLAZE; then
- MICROBLAZE_TRUE=
- MICROBLAZE_FALSE='#'
-else
- MICROBLAZE_TRUE='#'
- MICROBLAZE_FALSE=
-fi
-
- if test x$TARGET = xMETAG; then
- METAG_TRUE=
- METAG_FALSE='#'
-else
- METAG_TRUE='#'
- METAG_FALSE=
-fi
-
- if test x$TARGET = xMOXIE; then
- MOXIE_TRUE=
- MOXIE_FALSE='#'
-else
- MOXIE_TRUE='#'
- MOXIE_FALSE=
-fi
-
- if test x$TARGET = xNIOS2; then
- NIOS2_TRUE=
- NIOS2_FALSE='#'
-else
- NIOS2_TRUE='#'
- NIOS2_FALSE=
-fi
-
- if test x$TARGET = xPOWERPC; then
- POWERPC_TRUE=
- POWERPC_FALSE='#'
-else
- POWERPC_TRUE='#'
- POWERPC_FALSE=
-fi
-
- if test x$TARGET = xPOWERPC_AIX; then
- POWERPC_AIX_TRUE=
- POWERPC_AIX_FALSE='#'
-else
- POWERPC_AIX_TRUE='#'
- POWERPC_AIX_FALSE=
-fi
-
- if test x$TARGET = xPOWERPC_DARWIN; then
- POWERPC_DARWIN_TRUE=
- POWERPC_DARWIN_FALSE='#'
-else
- POWERPC_DARWIN_TRUE='#'
- POWERPC_DARWIN_FALSE=
-fi
-
- if test x$TARGET = xPOWERPC_FREEBSD; then
- POWERPC_FREEBSD_TRUE=
- POWERPC_FREEBSD_FALSE='#'
-else
- POWERPC_FREEBSD_TRUE='#'
- POWERPC_FREEBSD_FALSE=
-fi
-
- if test x$TARGET = xAARCH64; then
- AARCH64_TRUE=
- AARCH64_FALSE='#'
-else
- AARCH64_TRUE='#'
- AARCH64_FALSE=
-fi
-
- if test x$TARGET = xARC; then
- ARC_TRUE=
- ARC_FALSE='#'
-else
- ARC_TRUE='#'
- ARC_FALSE=
-fi
-
- if test x$TARGET = xARM; then
- ARM_TRUE=
- ARM_FALSE='#'
-else
- ARM_TRUE='#'
- ARM_FALSE=
-fi
-
- if test x$TARGET = xAVR32; then
- AVR32_TRUE=
- AVR32_FALSE='#'
-else
- AVR32_TRUE='#'
- AVR32_FALSE=
-fi
-
- if test x$TARGET = xLIBFFI_CRIS; then
- LIBFFI_CRIS_TRUE=
- LIBFFI_CRIS_FALSE='#'
-else
- LIBFFI_CRIS_TRUE='#'
- LIBFFI_CRIS_FALSE=
-fi
-
- if test x$TARGET = xFRV; then
- FRV_TRUE=
- FRV_FALSE='#'
-else
- FRV_TRUE='#'
- FRV_FALSE=
-fi
-
- if test x$TARGET = xS390; then
- S390_TRUE=
- S390_FALSE='#'
-else
- S390_TRUE='#'
- S390_FALSE=
-fi
-
- if test x$TARGET = xX86_64; then
- X86_64_TRUE=
- X86_64_FALSE='#'
-else
- X86_64_TRUE='#'
- X86_64_FALSE=
-fi
-
- if test x$TARGET = xSH; then
- SH_TRUE=
- SH_FALSE='#'
-else
- SH_TRUE='#'
- SH_FALSE=
-fi
-
- if test x$TARGET = xSH64; then
- SH64_TRUE=
- SH64_FALSE='#'
-else
- SH64_TRUE='#'
- SH64_FALSE=
-fi
-
- if test x$TARGET = xPA_LINUX; then
- PA_LINUX_TRUE=
- PA_LINUX_FALSE='#'
-else
- PA_LINUX_TRUE='#'
- PA_LINUX_FALSE=
-fi
-
- if test x$TARGET = xPA_HPUX; then
- PA_HPUX_TRUE=
- PA_HPUX_FALSE='#'
-else
- PA_HPUX_TRUE='#'
- PA_HPUX_FALSE=
-fi
-
- if test x$TARGET = xPA64_HPUX; then
- PA64_HPUX_TRUE=
- PA64_HPUX_FALSE='#'
-else
- PA64_HPUX_TRUE='#'
- PA64_HPUX_FALSE=
-fi
-
- if test x$TARGET = xTILE; then
- TILE_TRUE=
- TILE_FALSE='#'
-else
- TILE_TRUE='#'
- TILE_FALSE=
-fi
-
- if test x$TARGET = xVAX; then
- VAX_TRUE=
- VAX_FALSE='#'
-else
- VAX_TRUE='#'
- VAX_FALSE=
-fi
-
- if test x$TARGET = xXTENSA; then
- XTENSA_TRUE=
- XTENSA_FALSE='#'
-else
- XTENSA_TRUE='#'
- XTENSA_FALSE=
-fi
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
-$as_echo_n "checking for ANSI C header files... " >&6; }
-if ${ac_cv_header_stdc+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <stdlib.h>
-#include <stdarg.h>
-#include <string.h>
-#include <float.h>
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_header_stdc=yes
-else
- ac_cv_header_stdc=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-if test $ac_cv_header_stdc = yes; then
- # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <string.h>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- $EGREP "memchr" >/dev/null 2>&1; then :
-
-else
- ac_cv_header_stdc=no
-fi
-rm -f conftest*
-
-fi
-
-if test $ac_cv_header_stdc = yes; then
- # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <stdlib.h>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- $EGREP "free" >/dev/null 2>&1; then :
-
-else
- ac_cv_header_stdc=no
-fi
-rm -f conftest*
-
-fi
-
-if test $ac_cv_header_stdc = yes; then
- # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
- if test "$cross_compiling" = yes; then :
- :
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <ctype.h>
-#include <stdlib.h>
-#if ((' ' & 0x0FF) == 0x020)
-# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
-# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
-#else
-# define ISLOWER(c) \
- (('a' <= (c) && (c) <= 'i') \
- || ('j' <= (c) && (c) <= 'r') \
- || ('s' <= (c) && (c) <= 'z'))
-# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
-#endif
-
-#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
-int
-main ()
-{
- int i;
- for (i = 0; i < 256; i++)
- if (XOR (islower (i), ISLOWER (i))
- || toupper (i) != TOUPPER (i))
- return 2;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-
-else
- ac_cv_header_stdc=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
- conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
-fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
-$as_echo "$ac_cv_header_stdc" >&6; }
-if test $ac_cv_header_stdc = yes; then
-
-$as_echo "#define STDC_HEADERS 1" >>confdefs.h
-
-fi
-
-for ac_func in memcpy
-do :
- ac_fn_c_check_func "$LINENO" "memcpy" "ac_cv_func_memcpy"
-if test "x$ac_cv_func_memcpy" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_MEMCPY 1
-_ACEOF
-
-fi
-done
-
-ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default"
-if test "x$ac_cv_type_size_t" = xyes; then :
-
-else
-
-cat >>confdefs.h <<_ACEOF
-#define size_t unsigned int
-_ACEOF
-
-fi
-
-# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
-# for constant arguments. Useless!
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working alloca.h" >&5
-$as_echo_n "checking for working alloca.h... " >&6; }
-if ${ac_cv_working_alloca_h+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <alloca.h>
-int
-main ()
-{
-char *p = (char *) alloca (2 * sizeof (int));
- if (p) return 0;
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_working_alloca_h=yes
-else
- ac_cv_working_alloca_h=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_working_alloca_h" >&5
-$as_echo "$ac_cv_working_alloca_h" >&6; }
-if test $ac_cv_working_alloca_h = yes; then
-
-$as_echo "#define HAVE_ALLOCA_H 1" >>confdefs.h
-
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for alloca" >&5
-$as_echo_n "checking for alloca... " >&6; }
-if ${ac_cv_func_alloca_works+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#ifdef __GNUC__
-# define alloca __builtin_alloca
-#else
-# ifdef _MSC_VER
-# include <malloc.h>
-# define alloca _alloca
-# else
-# ifdef HAVE_ALLOCA_H
-# include <alloca.h>
-# else
-# ifdef _AIX
- #pragma alloca
-# else
-# ifndef alloca /* predefined by HP cc +Olibcalls */
-void *alloca (size_t);
-# endif
-# endif
-# endif
-# endif
-#endif
-
-int
-main ()
-{
-char *p = (char *) alloca (1);
- if (p) return 0;
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_func_alloca_works=yes
-else
- ac_cv_func_alloca_works=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_alloca_works" >&5
-$as_echo "$ac_cv_func_alloca_works" >&6; }
-
-if test $ac_cv_func_alloca_works = yes; then
-
-$as_echo "#define HAVE_ALLOCA 1" >>confdefs.h
-
-else
- # The SVR3 libPW and SVR4 libucb both contain incompatible functions
-# that cause trouble. Some versions do not even contain alloca or
-# contain a buggy version. If you still want to use their alloca,
-# use ar to extract alloca.o from them instead of compiling alloca.c.
-
-ALLOCA=\${LIBOBJDIR}alloca.$ac_objext
-
-$as_echo "#define C_ALLOCA 1" >>confdefs.h
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether \`alloca.c' needs Cray hooks" >&5
-$as_echo_n "checking whether \`alloca.c' needs Cray hooks... " >&6; }
-if ${ac_cv_os_cray+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#if defined CRAY && ! defined CRAY2
-webecray
-#else
-wenotbecray
-#endif
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- $EGREP "webecray" >/dev/null 2>&1; then :
- ac_cv_os_cray=yes
-else
- ac_cv_os_cray=no
-fi
-rm -f conftest*
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_os_cray" >&5
-$as_echo "$ac_cv_os_cray" >&6; }
-if test $ac_cv_os_cray = yes; then
- for ac_func in _getb67 GETB67 getb67; do
- as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
-
-cat >>confdefs.h <<_ACEOF
-#define CRAY_STACKSEG_END $ac_func
-_ACEOF
-
- break
-fi
-
- done
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking stack direction for C alloca" >&5
-$as_echo_n "checking stack direction for C alloca... " >&6; }
-if ${ac_cv_c_stack_direction+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test "$cross_compiling" = yes; then :
- ac_cv_c_stack_direction=0
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-$ac_includes_default
-int
-find_stack_direction (int *addr, int depth)
-{
- int dir, dummy = 0;
- if (! addr)
- addr = &dummy;
- *addr = addr < &dummy ? 1 : addr == &dummy ? 0 : -1;
- dir = depth ? find_stack_direction (addr, depth - 1) : 0;
- return dir + dummy;
-}
-
-int
-main (int argc, char **argv)
-{
- return find_stack_direction (0, argc + !argv + 20) < 0;
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
- ac_cv_c_stack_direction=1
-else
- ac_cv_c_stack_direction=-1
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
- conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_stack_direction" >&5
-$as_echo "$ac_cv_c_stack_direction" >&6; }
-cat >>confdefs.h <<_ACEOF
-#define STACK_DIRECTION $ac_cv_c_stack_direction
-_ACEOF
-
-
-fi
-
-
-# The cast to long int works around a bug in the HP C Compiler
-# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
-# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
-# This bug is HP SR number 8606223364.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of double" >&5
-$as_echo_n "checking size of double... " >&6; }
-if ${ac_cv_sizeof_double+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (double))" "ac_cv_sizeof_double" "$ac_includes_default"; then :
-
-else
- if test "$ac_cv_type_double" = yes; then
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error 77 "cannot compute sizeof (double)
-See \`config.log' for more details" "$LINENO" 5; }
- else
- ac_cv_sizeof_double=0
- fi
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_double" >&5
-$as_echo "$ac_cv_sizeof_double" >&6; }
-
-
-
-cat >>confdefs.h <<_ACEOF
-#define SIZEOF_DOUBLE $ac_cv_sizeof_double
-_ACEOF
-
-
-# The cast to long int works around a bug in the HP C Compiler
-# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
-# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
-# This bug is HP SR number 8606223364.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long double" >&5
-$as_echo_n "checking size of long double... " >&6; }
-if ${ac_cv_sizeof_long_double+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long double))" "ac_cv_sizeof_long_double" "$ac_includes_default"; then :
-
-else
- if test "$ac_cv_type_long_double" = yes; then
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error 77 "cannot compute sizeof (long double)
-See \`config.log' for more details" "$LINENO" 5; }
- else
- ac_cv_sizeof_long_double=0
- fi
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long_double" >&5
-$as_echo "$ac_cv_sizeof_long_double" >&6; }
-
-
-
-cat >>confdefs.h <<_ACEOF
-#define SIZEOF_LONG_DOUBLE $ac_cv_sizeof_long_double
-_ACEOF
-
-
-
-# Also AC_SUBST this variable for ffi.h.
-if test -z "$HAVE_LONG_DOUBLE"; then
- HAVE_LONG_DOUBLE=0
- if test $ac_cv_sizeof_long_double != 0; then
- if test $HAVE_LONG_DOUBLE_VARIANT != 0; then
-
-$as_echo "#define HAVE_LONG_DOUBLE_VARIANT 1" >>confdefs.h
-
- HAVE_LONG_DOUBLE=1
- else
- if test $ac_cv_sizeof_double != $ac_cv_sizeof_long_double; then
- HAVE_LONG_DOUBLE=1
-
-$as_echo "#define HAVE_LONG_DOUBLE 1" >>confdefs.h
-
- fi
- fi
- fi
-fi
-
-
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5
-$as_echo_n "checking whether byte ordering is bigendian... " >&6; }
-if ${ac_cv_c_bigendian+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_cv_c_bigendian=unknown
- # See if we're dealing with a universal compiler.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#ifndef __APPLE_CC__
- not a universal capable compiler
- #endif
- typedef int dummy;
-
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-
- # Check for potential -arch flags. It is not universal unless
- # there are at least two -arch flags with different values.
- ac_arch=
- ac_prev=
- for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do
- if test -n "$ac_prev"; then
- case $ac_word in
- i?86 | x86_64 | ppc | ppc64)
- if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then
- ac_arch=$ac_word
- else
- ac_cv_c_bigendian=universal
- break
- fi
- ;;
- esac
- ac_prev=
- elif test "x$ac_word" = "x-arch"; then
- ac_prev=arch
- fi
- done
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- if test $ac_cv_c_bigendian = unknown; then
- # See if sys/param.h defines the BYTE_ORDER macro.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <sys/types.h>
- #include <sys/param.h>
-
-int
-main ()
-{
-#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \
- && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \
- && LITTLE_ENDIAN)
- bogus endian macros
- #endif
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- # It does; now see whether it defined to BIG_ENDIAN or not.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <sys/types.h>
- #include <sys/param.h>
-
-int
-main ()
-{
-#if BYTE_ORDER != BIG_ENDIAN
- not big endian
- #endif
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_c_bigendian=yes
-else
- ac_cv_c_bigendian=no
-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
- if test $ac_cv_c_bigendian = unknown; then
- # See if <limits.h> defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris).
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <limits.h>
-
-int
-main ()
-{
-#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN)
- bogus endian macros
- #endif
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- # It does; now see whether it defined to _BIG_ENDIAN or not.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <limits.h>
-
-int
-main ()
-{
-#ifndef _BIG_ENDIAN
- not big endian
- #endif
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_c_bigendian=yes
-else
- ac_cv_c_bigendian=no
-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
- if test $ac_cv_c_bigendian = unknown; then
- # Compile a test program.
- if test "$cross_compiling" = yes; then :
- # Try to guess by grepping values from an object file.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-short int ascii_mm[] =
- { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
- short int ascii_ii[] =
- { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 };
- int use_ascii (int i) {
- return ascii_mm[i] + ascii_ii[i];
- }
- short int ebcdic_ii[] =
- { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 };
- short int ebcdic_mm[] =
- { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 };
- int use_ebcdic (int i) {
- return ebcdic_mm[i] + ebcdic_ii[i];
- }
- extern int foo;
-
-int
-main ()
-{
-return use_ascii (foo) == use_ebcdic (foo);
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then
- ac_cv_c_bigendian=yes
- fi
- if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then
- if test "$ac_cv_c_bigendian" = unknown; then
- ac_cv_c_bigendian=no
- else
- # finding both strings is unlikely to happen, but who knows?
- ac_cv_c_bigendian=unknown
- fi
- fi
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-$ac_includes_default
-int
-main ()
-{
-
- /* Are we little or big endian? From Harbison&Steele. */
- union
- {
- long int l;
- char c[sizeof (long int)];
- } u;
- u.l = 1;
- return u.c[sizeof (long int) - 1] == 1;
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
- ac_cv_c_bigendian=no
-else
- ac_cv_c_bigendian=yes
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
- conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
- fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5
-$as_echo "$ac_cv_c_bigendian" >&6; }
- case $ac_cv_c_bigendian in #(
- yes)
- $as_echo "#define WORDS_BIGENDIAN 1" >>confdefs.h
-;; #(
- no)
- ;; #(
- universal)
-
-$as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h
-
- ;; #(
- *)
- as_fn_error $? "unknown endianness
- presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;;
- esac
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler .cfi pseudo-op support" >&5
-$as_echo_n "checking assembler .cfi pseudo-op support... " >&6; }
-if ${gcc_cv_as_cfi_pseudo_op+:} false; then :
- $as_echo_n "(cached) " >&6
-else
-
- gcc_cv_as_cfi_pseudo_op=unknown
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-asm (".cfi_startproc\n\t.cfi_endproc");
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- gcc_cv_as_cfi_pseudo_op=yes
-else
- gcc_cv_as_cfi_pseudo_op=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_as_cfi_pseudo_op" >&5
-$as_echo "$gcc_cv_as_cfi_pseudo_op" >&6; }
- if test "x$gcc_cv_as_cfi_pseudo_op" = xyes; then
-
-$as_echo "#define HAVE_AS_CFI_PSEUDO_OP 1" >>confdefs.h
-
- fi
-
-
-if test x$TARGET = xSPARC; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler and linker support unaligned pc related relocs" >&5
-$as_echo_n "checking assembler and linker support unaligned pc related relocs... " >&6; }
-if ${libffi_cv_as_sparc_ua_pcrel+:} false; then :
- $as_echo_n "(cached) " >&6
-else
-
- save_CFLAGS="$CFLAGS"
- save_LDFLAGS="$LDFLAGS"
- CFLAGS="$CFLAGS -fpic"
- LDFLAGS="$LDFLAGS -shared"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-asm (".text; foo: nop; .data; .align 4; .byte 0; .uaword %r_disp32(foo); .text");
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- libffi_cv_as_sparc_ua_pcrel=yes
-else
- libffi_cv_as_sparc_ua_pcrel=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
- CFLAGS="$save_CFLAGS"
- LDFLAGS="$save_LDFLAGS"
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libffi_cv_as_sparc_ua_pcrel" >&5
-$as_echo "$libffi_cv_as_sparc_ua_pcrel" >&6; }
- if test "x$libffi_cv_as_sparc_ua_pcrel" = xyes; then
-
-$as_echo "#define HAVE_AS_SPARC_UA_PCREL 1" >>confdefs.h
-
- fi
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler .register pseudo-op support" >&5
-$as_echo_n "checking assembler .register pseudo-op support... " >&6; }
-if ${libffi_cv_as_register_pseudo_op+:} false; then :
- $as_echo_n "(cached) " >&6
-else
-
- libffi_cv_as_register_pseudo_op=unknown
- # Check if we have .register
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-asm (".register %g2, #scratch");
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- libffi_cv_as_register_pseudo_op=yes
-else
- libffi_cv_as_register_pseudo_op=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libffi_cv_as_register_pseudo_op" >&5
-$as_echo "$libffi_cv_as_register_pseudo_op" >&6; }
- if test "x$libffi_cv_as_register_pseudo_op" = xyes; then
-
-$as_echo "#define HAVE_AS_REGISTER_PSEUDO_OP 1" >>confdefs.h
-
- fi
-fi
-
-if test x$TARGET = xX86 || test x$TARGET = xX86_WIN32 || test x$TARGET = xX86_64; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler supports pc related relocs" >&5
-$as_echo_n "checking assembler supports pc related relocs... " >&6; }
-if ${libffi_cv_as_x86_pcrel+:} false; then :
- $as_echo_n "(cached) " >&6
-else
-
- libffi_cv_as_x86_pcrel=no
- echo '.text; foo: nop; .data; .long foo-.; .text' > conftest.s
- if $CC $CFLAGS -c conftest.s > /dev/null 2>&1; then
- libffi_cv_as_x86_pcrel=yes
- fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libffi_cv_as_x86_pcrel" >&5
-$as_echo "$libffi_cv_as_x86_pcrel" >&6; }
- if test "x$libffi_cv_as_x86_pcrel" = xyes; then
-
-$as_echo "#define HAVE_AS_X86_PCREL 1" >>confdefs.h
-
- fi
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler .ascii pseudo-op support" >&5
-$as_echo_n "checking assembler .ascii pseudo-op support... " >&6; }
-if ${libffi_cv_as_ascii_pseudo_op+:} false; then :
- $as_echo_n "(cached) " >&6
-else
-
- libffi_cv_as_ascii_pseudo_op=unknown
- # Check if we have .ascii
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-asm (".ascii \\"string\\"");
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- libffi_cv_as_ascii_pseudo_op=yes
-else
- libffi_cv_as_ascii_pseudo_op=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libffi_cv_as_ascii_pseudo_op" >&5
-$as_echo "$libffi_cv_as_ascii_pseudo_op" >&6; }
- if test "x$libffi_cv_as_ascii_pseudo_op" = xyes; then
-
-$as_echo "#define HAVE_AS_ASCII_PSEUDO_OP 1" >>confdefs.h
-
- fi
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler .string pseudo-op support" >&5
-$as_echo_n "checking assembler .string pseudo-op support... " >&6; }
-if ${libffi_cv_as_string_pseudo_op+:} false; then :
- $as_echo_n "(cached) " >&6
-else
-
- libffi_cv_as_string_pseudo_op=unknown
- # Check if we have .string
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-asm (".string \\"string\\"");
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- libffi_cv_as_string_pseudo_op=yes
-else
- libffi_cv_as_string_pseudo_op=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libffi_cv_as_string_pseudo_op" >&5
-$as_echo "$libffi_cv_as_string_pseudo_op" >&6; }
- if test "x$libffi_cv_as_string_pseudo_op" = xyes; then
-
-$as_echo "#define HAVE_AS_STRING_PSEUDO_OP 1" >>confdefs.h
-
- fi
-fi
-
-# On PaX enable kernels that have MPROTECT enable we can't use PROT_EXEC.
-# Check whether --enable-pax_emutramp was given.
-if test "${enable_pax_emutramp+set}" = set; then :
- enableval=$enable_pax_emutramp; if test "$enable_pax_emutramp" = "yes"; then
-
-$as_echo "#define FFI_MMAP_EXEC_EMUTRAMP_PAX 1" >>confdefs.h
-
- fi
-fi
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for _ prefix in compiled symbols" >&5
-$as_echo_n "checking for _ prefix in compiled symbols... " >&6; }
-if ${lt_cv_sys_symbol_underscore+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- lt_cv_sys_symbol_underscore=no
- cat > conftest.$ac_ext <<_LT_EOF
-void nm_test_func(){}
-int main(){nm_test_func;return 0;}
-_LT_EOF
- if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
- (eval $ac_compile) 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; then
- # Now try to grab the symbols.
- ac_nlist=conftest.nm
- if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $ac_nlist\""; } >&5
- (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $ac_nlist) 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; } && test -s "$ac_nlist"; then
- # See whether the symbols have a leading underscore.
- if grep '^. _nm_test_func' "$ac_nlist" >/dev/null; then
- lt_cv_sys_symbol_underscore=yes
- else
- if grep '^. nm_test_func ' "$ac_nlist" >/dev/null; then
- :
- else
- echo "configure: cannot find nm_test_func in $ac_nlist" >&5
- fi
- fi
- else
- echo "configure: cannot run $lt_cv_sys_global_symbol_pipe" >&5
- fi
- else
- echo "configure: failed program was:" >&5
- cat conftest.c >&5
- fi
- rm -rf conftest*
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_symbol_underscore" >&5
-$as_echo "$lt_cv_sys_symbol_underscore" >&6; }
- sys_symbol_underscore=$lt_cv_sys_symbol_underscore
-
-
-if test "x$sys_symbol_underscore" = xyes; then
-
-$as_echo "#define SYMBOL_UNDERSCORE 1" >>confdefs.h
-
-fi
-
-FFI_EXEC_TRAMPOLINE_TABLE=0
-case "$target" in
- *arm*-apple-darwin*)
- FFI_EXEC_TRAMPOLINE_TABLE=1
-
-$as_echo "#define FFI_EXEC_TRAMPOLINE_TABLE 1" >>confdefs.h
-
- ;;
- *-apple-darwin1* | *-*-freebsd* | *-*-kfreebsd* | *-*-openbsd* | *-pc-solaris*)
-
-$as_echo "#define FFI_MMAP_EXEC_WRIT 1" >>confdefs.h
-
- ;;
-esac
- if test x$FFI_EXEC_TRAMPOLINE_TABLE = x1; then
- FFI_EXEC_TRAMPOLINE_TABLE_TRUE=
- FFI_EXEC_TRAMPOLINE_TABLE_FALSE='#'
-else
- FFI_EXEC_TRAMPOLINE_TABLE_TRUE='#'
- FFI_EXEC_TRAMPOLINE_TABLE_FALSE=
-fi
-
-
-
-if test x$TARGET = xX86_64; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking toolchain supports unwind section type" >&5
-$as_echo_n "checking toolchain supports unwind section type... " >&6; }
-if ${libffi_cv_as_x86_64_unwind_section_type+:} false; then :
- $as_echo_n "(cached) " >&6
-else
-
- cat > conftest1.s << EOF
-.text
-.globl foo
-foo:
-jmp bar
-.section .eh_frame,"a",@unwind
-bar:
-EOF
-
- cat > conftest2.c << EOF
-extern void foo();
-int main(){foo();}
-EOF
-
- libffi_cv_as_x86_64_unwind_section_type=no
- # we ensure that we can compile _and_ link an assembly file containing an @unwind section
- # since the compiler can support it and not the linker (ie old binutils)
- if $CC -Wa,--fatal-warnings $CFLAGS -c conftest1.s > /dev/null 2>&1 && \
- $CC conftest2.c conftest1.o > /dev/null 2>&1 ; then
- libffi_cv_as_x86_64_unwind_section_type=yes
- fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libffi_cv_as_x86_64_unwind_section_type" >&5
-$as_echo "$libffi_cv_as_x86_64_unwind_section_type" >&6; }
- if test "x$libffi_cv_as_x86_64_unwind_section_type" = xyes; then
-
-$as_echo "#define HAVE_AS_X86_64_UNWIND_SECTION_TYPE 1" >>confdefs.h
-
- fi
-fi
-
-if test "x$GCC" = "xyes"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether .eh_frame section should be read-only" >&5
-$as_echo_n "checking whether .eh_frame section should be read-only... " >&6; }
-if ${libffi_cv_ro_eh_frame+:} false; then :
- $as_echo_n "(cached) " >&6
-else
-
- libffi_cv_ro_eh_frame=no
- echo 'extern void foo (void); void bar (void) { foo (); foo (); }' > conftest.c
- if $CC $CFLAGS -c -fpic -fexceptions -o conftest.o conftest.c > /dev/null 2>&1; then
- objdump -h conftest.o > conftest.dump 2>&1
- libffi_eh_frame_line=`grep -n eh_frame conftest.dump | cut -d: -f 1`
- libffi_test_line=`expr $libffi_eh_frame_line + 1`p
- sed -n $libffi_test_line conftest.dump > conftest.line
- if grep READONLY conftest.line > /dev/null; then
- libffi_cv_ro_eh_frame=yes
- fi
- fi
- rm -f conftest.*
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libffi_cv_ro_eh_frame" >&5
-$as_echo "$libffi_cv_ro_eh_frame" >&6; }
- if test "x$libffi_cv_ro_eh_frame" = xyes; then
-
-$as_echo "#define HAVE_RO_EH_FRAME 1" >>confdefs.h
-
-
-$as_echo "#define EH_FRAME_FLAGS \"a\"" >>confdefs.h
-
- else
-
-$as_echo "#define EH_FRAME_FLAGS \"aw\"" >>confdefs.h
-
- fi
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __attribute__((visibility(\"hidden\")))" >&5
-$as_echo_n "checking for __attribute__((visibility(\"hidden\")))... " >&6; }
-if ${libffi_cv_hidden_visibility_attribute+:} false; then :
- $as_echo_n "(cached) " >&6
-else
-
- echo 'int __attribute__ ((visibility ("hidden"))) foo (void) { return 1 ; }' > conftest.c
- libffi_cv_hidden_visibility_attribute=no
- if { ac_try='${CC-cc} -Werror -S conftest.c -o conftest.s 1>&5'
- { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; }; then
- if grep '\.hidden.*foo' conftest.s >/dev/null; then
- libffi_cv_hidden_visibility_attribute=yes
- fi
- fi
- rm -f conftest.*
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libffi_cv_hidden_visibility_attribute" >&5
-$as_echo "$libffi_cv_hidden_visibility_attribute" >&6; }
- if test $libffi_cv_hidden_visibility_attribute = yes; then
-
-$as_echo "#define HAVE_HIDDEN_VISIBILITY_ATTRIBUTE 1" >>confdefs.h
-
- fi
-fi
-
-
-
-
-
-
-
-
-# Check whether --enable-debug was given.
-if test "${enable_debug+set}" = set; then :
- enableval=$enable_debug; if test "$enable_debug" = "yes"; then
-
-$as_echo "#define FFI_DEBUG 1" >>confdefs.h
-
- fi
-fi
-
- if test "$enable_debug" = "yes"; then
- FFI_DEBUG_TRUE=
- FFI_DEBUG_FALSE='#'
-else
- FFI_DEBUG_TRUE='#'
- FFI_DEBUG_FALSE=
-fi
-
-
-# Check whether --enable-structs was given.
-if test "${enable_structs+set}" = set; then :
- enableval=$enable_structs; if test "$enable_structs" = "no"; then
-
-$as_echo "#define FFI_NO_STRUCTS 1" >>confdefs.h
-
- fi
-fi
-
- if test "$enable_debug" = "yes"; then
- FFI_DEBUG_TRUE=
- FFI_DEBUG_FALSE='#'
-else
- FFI_DEBUG_TRUE='#'
- FFI_DEBUG_FALSE=
-fi
-
-
-# Check whether --enable-raw-api was given.
-if test "${enable_raw_api+set}" = set; then :
- enableval=$enable_raw_api; if test "$enable_raw_api" = "no"; then
-
-$as_echo "#define FFI_NO_RAW_API 1" >>confdefs.h
-
- fi
-fi
-
-
-# Check whether --enable-purify-safety was given.
-if test "${enable_purify_safety+set}" = set; then :
- enableval=$enable_purify_safety; if test "$enable_purify_safety" = "yes"; then
-
-$as_echo "#define USING_PURIFY 1" >>confdefs.h
-
- fi
-fi
-
-
-# These variables are only ever used when we cross-build to X86_WIN32.
-# And we only support this with GCC, so...
-if test "x$GCC" = "xyes"; then
- if test -n "$with_cross_host" &&
- test x"$with_cross_host" != x"no"; then
- toolexecdir='$(exec_prefix)/$(target_alias)'
- toolexeclibdir='$(toolexecdir)/lib'
- else
- toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
- toolexeclibdir='$(libdir)'
- fi
- multi_os_directory=`$CC $CFLAGS -print-multi-os-directory`
- case $multi_os_directory in
- .) ;; # Avoid trailing /.
- ../*) toolexeclibdir=$toolexeclibdir/$multi_os_directory ;;
- esac
-
-else
- toolexeclibdir='$(libdir)'
-fi
-
-
-ac_config_commands="$ac_config_commands include"
-
-ac_config_commands="$ac_config_commands src"
-
-
-ac_config_links="$ac_config_links include/ffitarget.h:src/$TARGETDIR/ffitarget.h"
-
-
-ac_config_files="$ac_config_files include/Makefile include/ffi.h Makefile testsuite/Makefile man/Makefile libffi.pc"
-
-
-ac_config_links="$ac_config_links include/ffi_common.h:include/ffi_common.h"
-
-
-ac_config_files="$ac_config_files fficonfig.py"
-
-
-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:${as_lineno-$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= ;; #(
- *) { eval $ac_var=; 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
- if test "x$cache_file" != "x/dev/null"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
-$as_echo "$as_me: updating cache $cache_file" >&6;}
- if test ! -f "$cache_file" || test -h "$cache_file"; then
- cat confcache >"$cache_file"
- else
- case $cache_file in #(
- */* | ?:*)
- mv -f confcache "$cache_file"$$ &&
- mv -f "$cache_file"$$ "$cache_file" ;; #(
- *)
- mv -f confcache "$cache_file" ;;
- esac
- fi
- fi
- else
- { $as_echo "$as_me:${as_lineno-$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}'
-
-DEFS=-DHAVE_CONFIG_H
-
-ac_libobjs=
-ac_ltlibobjs=
-U=
-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.
- as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext"
- as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo'
-done
-LIBOBJS=$ac_libobjs
-
-LTLIBOBJS=$ac_ltlibobjs
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5
-$as_echo_n "checking that generated files are newer than configure... " >&6; }
- if test -n "$am_sleep_pid"; then
- # Hide warnings about reused PIDs.
- wait $am_sleep_pid 2>/dev/null
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5
-$as_echo "done" >&6; }
- if test -n "$EXEEXT"; then
- am__EXEEXT_TRUE=
- am__EXEEXT_FALSE='#'
-else
- am__EXEEXT_TRUE='#'
- am__EXEEXT_FALSE=
-fi
-
-if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
- as_fn_error $? "conditional \"AMDEP\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
- as_fn_error $? "conditional \"am__fastdepCC\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then
- as_fn_error $? "conditional \"am__fastdepCXX\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${am__fastdepCCAS_TRUE}" && test -z "${am__fastdepCCAS_FALSE}"; then
- as_fn_error $? "conditional \"am__fastdepCCAS\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then
- as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${TESTSUBDIR_TRUE}" && test -z "${TESTSUBDIR_FALSE}"; then
- as_fn_error $? "conditional \"TESTSUBDIR\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${MIPS_TRUE}" && test -z "${MIPS_FALSE}"; then
- as_fn_error $? "conditional \"MIPS\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${BFIN_TRUE}" && test -z "${BFIN_FALSE}"; then
- as_fn_error $? "conditional \"BFIN\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${SPARC_TRUE}" && test -z "${SPARC_FALSE}"; then
- as_fn_error $? "conditional \"SPARC\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${X86_TRUE}" && test -z "${X86_FALSE}"; then
- as_fn_error $? "conditional \"X86\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${X86_FREEBSD_TRUE}" && test -z "${X86_FREEBSD_FALSE}"; then
- as_fn_error $? "conditional \"X86_FREEBSD\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${X86_WIN32_TRUE}" && test -z "${X86_WIN32_FALSE}"; then
- as_fn_error $? "conditional \"X86_WIN32\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${X86_WIN64_TRUE}" && test -z "${X86_WIN64_FALSE}"; then
- as_fn_error $? "conditional \"X86_WIN64\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${X86_DARWIN_TRUE}" && test -z "${X86_DARWIN_FALSE}"; then
- as_fn_error $? "conditional \"X86_DARWIN\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${X86_DARWIN32_TRUE}" && test -z "${X86_DARWIN32_FALSE}"; then
- as_fn_error $? "conditional \"X86_DARWIN32\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${X86_DARWIN64_TRUE}" && test -z "${X86_DARWIN64_FALSE}"; then
- as_fn_error $? "conditional \"X86_DARWIN64\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${ALPHA_TRUE}" && test -z "${ALPHA_FALSE}"; then
- as_fn_error $? "conditional \"ALPHA\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${IA64_TRUE}" && test -z "${IA64_FALSE}"; then
- as_fn_error $? "conditional \"IA64\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${M32R_TRUE}" && test -z "${M32R_FALSE}"; then
- as_fn_error $? "conditional \"M32R\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${M68K_TRUE}" && test -z "${M68K_FALSE}"; then
- as_fn_error $? "conditional \"M68K\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${M88K_TRUE}" && test -z "${M88K_FALSE}"; then
- as_fn_error $? "conditional \"M88K\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${MICROBLAZE_TRUE}" && test -z "${MICROBLAZE_FALSE}"; then
- as_fn_error $? "conditional \"MICROBLAZE\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${METAG_TRUE}" && test -z "${METAG_FALSE}"; then
- as_fn_error $? "conditional \"METAG\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${MOXIE_TRUE}" && test -z "${MOXIE_FALSE}"; then
- as_fn_error $? "conditional \"MOXIE\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${NIOS2_TRUE}" && test -z "${NIOS2_FALSE}"; then
- as_fn_error $? "conditional \"NIOS2\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${POWERPC_TRUE}" && test -z "${POWERPC_FALSE}"; then
- as_fn_error $? "conditional \"POWERPC\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${POWERPC_AIX_TRUE}" && test -z "${POWERPC_AIX_FALSE}"; then
- as_fn_error $? "conditional \"POWERPC_AIX\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${POWERPC_DARWIN_TRUE}" && test -z "${POWERPC_DARWIN_FALSE}"; then
- as_fn_error $? "conditional \"POWERPC_DARWIN\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${POWERPC_FREEBSD_TRUE}" && test -z "${POWERPC_FREEBSD_FALSE}"; then
- as_fn_error $? "conditional \"POWERPC_FREEBSD\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${AARCH64_TRUE}" && test -z "${AARCH64_FALSE}"; then
- as_fn_error $? "conditional \"AARCH64\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${ARC_TRUE}" && test -z "${ARC_FALSE}"; then
- as_fn_error $? "conditional \"ARC\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${ARM_TRUE}" && test -z "${ARM_FALSE}"; then
- as_fn_error $? "conditional \"ARM\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${AVR32_TRUE}" && test -z "${AVR32_FALSE}"; then
- as_fn_error $? "conditional \"AVR32\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${LIBFFI_CRIS_TRUE}" && test -z "${LIBFFI_CRIS_FALSE}"; then
- as_fn_error $? "conditional \"LIBFFI_CRIS\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${FRV_TRUE}" && test -z "${FRV_FALSE}"; then
- as_fn_error $? "conditional \"FRV\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${S390_TRUE}" && test -z "${S390_FALSE}"; then
- as_fn_error $? "conditional \"S390\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${X86_64_TRUE}" && test -z "${X86_64_FALSE}"; then
- as_fn_error $? "conditional \"X86_64\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${SH_TRUE}" && test -z "${SH_FALSE}"; then
- as_fn_error $? "conditional \"SH\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${SH64_TRUE}" && test -z "${SH64_FALSE}"; then
- as_fn_error $? "conditional \"SH64\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${PA_LINUX_TRUE}" && test -z "${PA_LINUX_FALSE}"; then
- as_fn_error $? "conditional \"PA_LINUX\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${PA_HPUX_TRUE}" && test -z "${PA_HPUX_FALSE}"; then
- as_fn_error $? "conditional \"PA_HPUX\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${PA64_HPUX_TRUE}" && test -z "${PA64_HPUX_FALSE}"; then
- as_fn_error $? "conditional \"PA64_HPUX\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${TILE_TRUE}" && test -z "${TILE_FALSE}"; then
- as_fn_error $? "conditional \"TILE\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${VAX_TRUE}" && test -z "${VAX_FALSE}"; then
- as_fn_error $? "conditional \"VAX\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${XTENSA_TRUE}" && test -z "${XTENSA_FALSE}"; then
- as_fn_error $? "conditional \"XTENSA\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-
-if test -z "${FFI_EXEC_TRAMPOLINE_TABLE_TRUE}" && test -z "${FFI_EXEC_TRAMPOLINE_TABLE_FALSE}"; then
- as_fn_error $? "conditional \"FFI_EXEC_TRAMPOLINE_TABLE\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${FFI_DEBUG_TRUE}" && test -z "${FFI_DEBUG_FALSE}"; then
- as_fn_error $? "conditional \"FFI_DEBUG\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${FFI_DEBUG_TRUE}" && test -z "${FFI_DEBUG_FALSE}"; then
- as_fn_error $? "conditional \"FFI_DEBUG\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-
-: "${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:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5
-$as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
-as_write_fail=0
-cat >$CONFIG_STATUS <<_ASEOF || as_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}
-export SHELL
-_ASEOF
-cat >>$CONFIG_STATUS <<\_ASEOF || as_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
-
-
-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
-# Prefer a ksh shell builtin over an external printf program on Solaris,
-# but without wasting forks for bash or zsh.
-if test -z "$BASH_VERSION$ZSH_VERSION" \
- && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
- as_echo='print -r --'
- as_echo_n='print -rn --'
-elif (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
-
-
-# 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.
-as_myself=
-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
-fi
-
-# Unset variables that we do not need and which cause bugs (e.g. in
-# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1"
-# suppresses any "Segmentation fault" message there. '((' could
-# trigger a bug in pdksh 5.2.14.
-for as_var in BASH_ENV ENV MAIL MAILPATH
-do eval test x\${$as_var+set} = xset \
- && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
-done
-PS1='$ '
-PS2='> '
-PS4='+ '
-
-# NLS nuisances.
-LC_ALL=C
-export LC_ALL
-LANGUAGE=C
-export LANGUAGE
-
-# CDPATH.
-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
-
-
-# as_fn_error STATUS ERROR [LINENO LOG_FD]
-# ----------------------------------------
-# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
-# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
-# script with STATUS, using 1 if that was 0.
-as_fn_error ()
-{
- as_status=$1; test $as_status -eq 0 && as_status=1
- if test "$4"; then
- as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
- fi
- $as_echo "$as_me: error: $2" >&2
- as_fn_exit $as_status
-} # as_fn_error
-
-
-# as_fn_set_status STATUS
-# -----------------------
-# Set $? to STATUS, without forking.
-as_fn_set_status ()
-{
- return $1
-} # as_fn_set_status
-
-# as_fn_exit STATUS
-# -----------------
-# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
-as_fn_exit ()
-{
- set +e
- as_fn_set_status $1
- exit $1
-} # as_fn_exit
-
-# as_fn_unset VAR
-# ---------------
-# Portably unset VAR.
-as_fn_unset ()
-{
- { eval $1=; unset $1;}
-}
-as_unset=as_fn_unset
-# as_fn_append VAR VALUE
-# ----------------------
-# Append the text in VALUE to the end of the definition contained in VAR. Take
-# advantage of any shell optimizations that allow amortized linear growth over
-# repeated appends, instead of the typical quadratic growth present in naive
-# implementations.
-if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
- eval 'as_fn_append ()
- {
- eval $1+=\$2
- }'
-else
- as_fn_append ()
- {
- eval $1=\$$1\$2
- }
-fi # as_fn_append
-
-# as_fn_arith ARG...
-# ------------------
-# Perform arithmetic evaluation on the ARGs, and store the result in the
-# global $as_val. Take advantage of shells that can avoid forks. The arguments
-# must be portable across $(()) and expr.
-if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
- eval 'as_fn_arith ()
- {
- as_val=$(( $* ))
- }'
-else
- as_fn_arith ()
- {
- as_val=`expr "$@" || test $? -eq 1`
- }
-fi # as_fn_arith
-
-
-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
-
-if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
- as_dirname=dirname
-else
- as_dirname=false
-fi
-
-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'`
-
-# 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
-
-ECHO_C= ECHO_N= ECHO_T=
-case `echo -n x` in #(((((
--n*)
- case `echo 'xy\c'` in
- *c*) ECHO_T=' ';; # ECHO_T is single tab character.
- xy) ECHO_C='\c';;
- *) echo `echo ksh88 bug on AIX 6.1` > /dev/null
- ECHO_T=' ';;
- esac;;
-*)
- ECHO_N='-n';;
-esac
-
-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 -pR'.
- ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
- as_ln_s='cp -pR'
- elif ln conf$$.file conf$$ 2>/dev/null; then
- as_ln_s=ln
- else
- as_ln_s='cp -pR'
- fi
-else
- as_ln_s='cp -pR'
-fi
-rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
-rmdir conf$$.dir 2>/dev/null
-
-
-# as_fn_mkdir_p
-# -------------
-# Create "$as_dir" as a directory, including parents if necessary.
-as_fn_mkdir_p ()
-{
-
- case $as_dir in #(
- -*) as_dir=./$as_dir;;
- esac
- test -d "$as_dir" || eval $as_mkdir_p || {
- 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_fn_error $? "cannot create directory $as_dir"
-
-
-} # as_fn_mkdir_p
-if mkdir -p . 2>/dev/null; then
- as_mkdir_p='mkdir -p "$as_dir"'
-else
- test -d ./-p && rmdir ./-p
- as_mkdir_p=false
-fi
-
-
-# as_fn_executable_p FILE
-# -----------------------
-# Test if FILE is an executable regular file.
-as_fn_executable_p ()
-{
- test -f "$1" && test -x "$1"
-} # as_fn_executable_p
-as_test_x='test -x'
-as_executable_p=as_fn_executable_p
-
-# 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
-## ----------------------------------- ##
-## Main body of $CONFIG_STATUS script. ##
-## ----------------------------------- ##
-_ASEOF
-test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1
-
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=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 libffi $as_me 3.1, which was
-generated by GNU Autoconf 2.69. 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
-
-case $ac_config_headers in *"
-"*) set x $ac_config_headers; shift; ac_config_headers=$*;;
-esac
-
-
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-# Files that config.status was made for.
-config_files="$ac_config_files"
-config_headers="$ac_config_headers"
-config_links="$ac_config_links"
-config_commands="$ac_config_commands"
-
-_ACEOF
-
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-ac_cs_usage="\
-\`$as_me' instantiates files and other configuration actions
-from templates according to the current configuration. Unless the files
-and actions are specified as TAGs, all are instantiated by default.
-
-Usage: $0 [OPTION]... [TAG]...
-
- -h, --help print this help, then exit
- -V, --version print version number and configuration settings, then exit
- --config print configuration, 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
- --header=FILE[:TEMPLATE]
- instantiate the configuration header FILE
-
-Configuration files:
-$config_files
-
-Configuration headers:
-$config_headers
-
-Configuration links:
-$config_links
-
-Configuration commands:
-$config_commands
-
-Report bugs to <http://github.com/atgreen/libffi/issues>."
-
-_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
-ac_cs_version="\\
-libffi config.status 3.1
-configured by $0, generated by GNU Autoconf 2.69,
- with options \\"\$ac_cs_config\\"
-
-Copyright (C) 2012 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'
-MKDIR_P='$MKDIR_P'
-AWK='$AWK'
-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=`expr "X$1" : 'X\([^=]*\)='`
- ac_optarg=
- 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 ;;
- --config | --confi | --conf | --con | --co | --c )
- $as_echo "$ac_cs_config"; 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"` ;;
- '') as_fn_error $? "missing file argument" ;;
- esac
- as_fn_append CONFIG_FILES " '$ac_optarg'"
- ac_need_defaults=false;;
- --header | --heade | --head | --hea )
- $ac_shift
- case $ac_optarg in
- *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
- esac
- as_fn_append CONFIG_HEADERS " '$ac_optarg'"
- ac_need_defaults=false;;
- --he | --h)
- # Conflict between --help and --header
- as_fn_error $? "ambiguous option: \`$1'
-Try \`$0 --help' for more information.";;
- --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_fn_error $? "unrecognized option: \`$1'
-Try \`$0 --help' for more information." ;;
-
- *) as_fn_append 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
-#
-# INIT-COMMANDS
-#
-ax_enable_builddir_srcdir="$srcdir" # $srcdir
-ax_enable_builddir_host="$HOST" # $HOST / $host
-ax_enable_builddir_version="$VERSION" # $VERSION
-ax_enable_builddir_package="$PACKAGE" # $PACKAGE
-ax_enable_builddir_auxdir="$ax_enable_builddir_auxdir" # $AUX
-ax_enable_builddir_sed="$ax_enable_builddir_sed" # $SED
-ax_enable_builddir="$ax_enable_builddir" # $SUB
-
-AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
-
-
-# The HP-UX ksh and POSIX shell print the target directory to stdout
-# if CDPATH is set.
-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
-
-sed_quote_subst='$sed_quote_subst'
-double_quote_subst='$double_quote_subst'
-delay_variable_subst='$delay_variable_subst'
-macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`'
-macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`'
-enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`'
-enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`'
-pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`'
-enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`'
-SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`'
-ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`'
-PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`'
-host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`'
-host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`'
-host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`'
-build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`'
-build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`'
-build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`'
-SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`'
-Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`'
-GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`'
-EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`'
-FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`'
-LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`'
-NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`'
-LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`'
-max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`'
-ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`'
-exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`'
-lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`'
-lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`'
-lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`'
-lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`'
-lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`'
-reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`'
-reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`'
-OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`'
-deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`'
-file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`'
-file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`'
-want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`'
-DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`'
-sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`'
-AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`'
-AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`'
-archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`'
-STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`'
-RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`'
-old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`'
-old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`'
-old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`'
-lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`'
-CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`'
-CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`'
-compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`'
-GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`'
-lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`'
-lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`'
-lt_cv_sys_global_symbol_to_import='`$ECHO "$lt_cv_sys_global_symbol_to_import" | $SED "$delay_single_quote_subst"`'
-lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`'
-lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`'
-lt_cv_nm_interface='`$ECHO "$lt_cv_nm_interface" | $SED "$delay_single_quote_subst"`'
-nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`'
-lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`'
-objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`'
-MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`'
-lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`'
-lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`'
-lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`'
-lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`'
-lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`'
-need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`'
-MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`'
-DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`'
-NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`'
-LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`'
-OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`'
-OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`'
-libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`'
-shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`'
-extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`'
-archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`'
-enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`'
-export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`'
-whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`'
-compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`'
-old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`'
-old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`'
-archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`'
-archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`'
-module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`'
-module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`'
-with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`'
-allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`'
-no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`'
-hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`'
-hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`'
-hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`'
-hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`'
-hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`'
-hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`'
-hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`'
-inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`'
-link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`'
-always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`'
-export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`'
-exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`'
-include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`'
-prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`'
-postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`'
-file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`'
-variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`'
-need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`'
-need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`'
-version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`'
-runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`'
-shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`'
-shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`'
-libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`'
-library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`'
-soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`'
-install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`'
-postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`'
-postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`'
-finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`'
-finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`'
-hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`'
-sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`'
-sys_lib_dlsearch_path_spec='`$ECHO "$sys_lib_dlsearch_path_spec" | $SED "$delay_single_quote_subst"`'
-hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`'
-enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`'
-enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`'
-enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`'
-old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`'
-striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`'
-compiler_lib_search_dirs='`$ECHO "$compiler_lib_search_dirs" | $SED "$delay_single_quote_subst"`'
-predep_objects='`$ECHO "$predep_objects" | $SED "$delay_single_quote_subst"`'
-postdep_objects='`$ECHO "$postdep_objects" | $SED "$delay_single_quote_subst"`'
-predeps='`$ECHO "$predeps" | $SED "$delay_single_quote_subst"`'
-postdeps='`$ECHO "$postdeps" | $SED "$delay_single_quote_subst"`'
-compiler_lib_search_path='`$ECHO "$compiler_lib_search_path" | $SED "$delay_single_quote_subst"`'
-LD_CXX='`$ECHO "$LD_CXX" | $SED "$delay_single_quote_subst"`'
-reload_flag_CXX='`$ECHO "$reload_flag_CXX" | $SED "$delay_single_quote_subst"`'
-reload_cmds_CXX='`$ECHO "$reload_cmds_CXX" | $SED "$delay_single_quote_subst"`'
-old_archive_cmds_CXX='`$ECHO "$old_archive_cmds_CXX" | $SED "$delay_single_quote_subst"`'
-compiler_CXX='`$ECHO "$compiler_CXX" | $SED "$delay_single_quote_subst"`'
-GCC_CXX='`$ECHO "$GCC_CXX" | $SED "$delay_single_quote_subst"`'
-lt_prog_compiler_no_builtin_flag_CXX='`$ECHO "$lt_prog_compiler_no_builtin_flag_CXX" | $SED "$delay_single_quote_subst"`'
-lt_prog_compiler_pic_CXX='`$ECHO "$lt_prog_compiler_pic_CXX" | $SED "$delay_single_quote_subst"`'
-lt_prog_compiler_wl_CXX='`$ECHO "$lt_prog_compiler_wl_CXX" | $SED "$delay_single_quote_subst"`'
-lt_prog_compiler_static_CXX='`$ECHO "$lt_prog_compiler_static_CXX" | $SED "$delay_single_quote_subst"`'
-lt_cv_prog_compiler_c_o_CXX='`$ECHO "$lt_cv_prog_compiler_c_o_CXX" | $SED "$delay_single_quote_subst"`'
-archive_cmds_need_lc_CXX='`$ECHO "$archive_cmds_need_lc_CXX" | $SED "$delay_single_quote_subst"`'
-enable_shared_with_static_runtimes_CXX='`$ECHO "$enable_shared_with_static_runtimes_CXX" | $SED "$delay_single_quote_subst"`'
-export_dynamic_flag_spec_CXX='`$ECHO "$export_dynamic_flag_spec_CXX" | $SED "$delay_single_quote_subst"`'
-whole_archive_flag_spec_CXX='`$ECHO "$whole_archive_flag_spec_CXX" | $SED "$delay_single_quote_subst"`'
-compiler_needs_object_CXX='`$ECHO "$compiler_needs_object_CXX" | $SED "$delay_single_quote_subst"`'
-old_archive_from_new_cmds_CXX='`$ECHO "$old_archive_from_new_cmds_CXX" | $SED "$delay_single_quote_subst"`'
-old_archive_from_expsyms_cmds_CXX='`$ECHO "$old_archive_from_expsyms_cmds_CXX" | $SED "$delay_single_quote_subst"`'
-archive_cmds_CXX='`$ECHO "$archive_cmds_CXX" | $SED "$delay_single_quote_subst"`'
-archive_expsym_cmds_CXX='`$ECHO "$archive_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`'
-module_cmds_CXX='`$ECHO "$module_cmds_CXX" | $SED "$delay_single_quote_subst"`'
-module_expsym_cmds_CXX='`$ECHO "$module_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`'
-with_gnu_ld_CXX='`$ECHO "$with_gnu_ld_CXX" | $SED "$delay_single_quote_subst"`'
-allow_undefined_flag_CXX='`$ECHO "$allow_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`'
-no_undefined_flag_CXX='`$ECHO "$no_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`'
-hardcode_libdir_flag_spec_CXX='`$ECHO "$hardcode_libdir_flag_spec_CXX" | $SED "$delay_single_quote_subst"`'
-hardcode_libdir_separator_CXX='`$ECHO "$hardcode_libdir_separator_CXX" | $SED "$delay_single_quote_subst"`'
-hardcode_direct_CXX='`$ECHO "$hardcode_direct_CXX" | $SED "$delay_single_quote_subst"`'
-hardcode_direct_absolute_CXX='`$ECHO "$hardcode_direct_absolute_CXX" | $SED "$delay_single_quote_subst"`'
-hardcode_minus_L_CXX='`$ECHO "$hardcode_minus_L_CXX" | $SED "$delay_single_quote_subst"`'
-hardcode_shlibpath_var_CXX='`$ECHO "$hardcode_shlibpath_var_CXX" | $SED "$delay_single_quote_subst"`'
-hardcode_automatic_CXX='`$ECHO "$hardcode_automatic_CXX" | $SED "$delay_single_quote_subst"`'
-inherit_rpath_CXX='`$ECHO "$inherit_rpath_CXX" | $SED "$delay_single_quote_subst"`'
-link_all_deplibs_CXX='`$ECHO "$link_all_deplibs_CXX" | $SED "$delay_single_quote_subst"`'
-always_export_symbols_CXX='`$ECHO "$always_export_symbols_CXX" | $SED "$delay_single_quote_subst"`'
-export_symbols_cmds_CXX='`$ECHO "$export_symbols_cmds_CXX" | $SED "$delay_single_quote_subst"`'
-exclude_expsyms_CXX='`$ECHO "$exclude_expsyms_CXX" | $SED "$delay_single_quote_subst"`'
-include_expsyms_CXX='`$ECHO "$include_expsyms_CXX" | $SED "$delay_single_quote_subst"`'
-prelink_cmds_CXX='`$ECHO "$prelink_cmds_CXX" | $SED "$delay_single_quote_subst"`'
-postlink_cmds_CXX='`$ECHO "$postlink_cmds_CXX" | $SED "$delay_single_quote_subst"`'
-file_list_spec_CXX='`$ECHO "$file_list_spec_CXX" | $SED "$delay_single_quote_subst"`'
-hardcode_action_CXX='`$ECHO "$hardcode_action_CXX" | $SED "$delay_single_quote_subst"`'
-compiler_lib_search_dirs_CXX='`$ECHO "$compiler_lib_search_dirs_CXX" | $SED "$delay_single_quote_subst"`'
-predep_objects_CXX='`$ECHO "$predep_objects_CXX" | $SED "$delay_single_quote_subst"`'
-postdep_objects_CXX='`$ECHO "$postdep_objects_CXX" | $SED "$delay_single_quote_subst"`'
-predeps_CXX='`$ECHO "$predeps_CXX" | $SED "$delay_single_quote_subst"`'
-postdeps_CXX='`$ECHO "$postdeps_CXX" | $SED "$delay_single_quote_subst"`'
-compiler_lib_search_path_CXX='`$ECHO "$compiler_lib_search_path_CXX" | $SED "$delay_single_quote_subst"`'
-
-LTCC='$LTCC'
-LTCFLAGS='$LTCFLAGS'
-compiler='$compiler_DEFAULT'
-
-# A function that is used when there is no print builtin or printf.
-func_fallback_echo ()
-{
- eval 'cat <<_LTECHO_EOF
-\$1
-_LTECHO_EOF'
-}
-
-# Quote evaled strings.
-for var in SHELL \
-ECHO \
-PATH_SEPARATOR \
-SED \
-GREP \
-EGREP \
-FGREP \
-LD \
-NM \
-LN_S \
-lt_SP2NL \
-lt_NL2SP \
-reload_flag \
-OBJDUMP \
-deplibs_check_method \
-file_magic_cmd \
-file_magic_glob \
-want_nocaseglob \
-DLLTOOL \
-sharedlib_from_linklib_cmd \
-AR \
-AR_FLAGS \
-archiver_list_spec \
-STRIP \
-RANLIB \
-CC \
-CFLAGS \
-compiler \
-lt_cv_sys_global_symbol_pipe \
-lt_cv_sys_global_symbol_to_cdecl \
-lt_cv_sys_global_symbol_to_import \
-lt_cv_sys_global_symbol_to_c_name_address \
-lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \
-lt_cv_nm_interface \
-nm_file_list_spec \
-lt_prog_compiler_no_builtin_flag \
-lt_prog_compiler_pic \
-lt_prog_compiler_wl \
-lt_prog_compiler_static \
-lt_cv_prog_compiler_c_o \
-need_locks \
-MANIFEST_TOOL \
-DSYMUTIL \
-NMEDIT \
-LIPO \
-OTOOL \
-OTOOL64 \
-shrext_cmds \
-export_dynamic_flag_spec \
-whole_archive_flag_spec \
-compiler_needs_object \
-with_gnu_ld \
-allow_undefined_flag \
-no_undefined_flag \
-hardcode_libdir_flag_spec \
-hardcode_libdir_separator \
-exclude_expsyms \
-include_expsyms \
-file_list_spec \
-variables_saved_for_relink \
-libname_spec \
-library_names_spec \
-soname_spec \
-install_override_mode \
-finish_eval \
-old_striplib \
-striplib \
-compiler_lib_search_dirs \
-predep_objects \
-postdep_objects \
-predeps \
-postdeps \
-compiler_lib_search_path \
-LD_CXX \
-reload_flag_CXX \
-compiler_CXX \
-lt_prog_compiler_no_builtin_flag_CXX \
-lt_prog_compiler_pic_CXX \
-lt_prog_compiler_wl_CXX \
-lt_prog_compiler_static_CXX \
-lt_cv_prog_compiler_c_o_CXX \
-export_dynamic_flag_spec_CXX \
-whole_archive_flag_spec_CXX \
-compiler_needs_object_CXX \
-with_gnu_ld_CXX \
-allow_undefined_flag_CXX \
-no_undefined_flag_CXX \
-hardcode_libdir_flag_spec_CXX \
-hardcode_libdir_separator_CXX \
-exclude_expsyms_CXX \
-include_expsyms_CXX \
-file_list_spec_CXX \
-compiler_lib_search_dirs_CXX \
-predep_objects_CXX \
-postdep_objects_CXX \
-predeps_CXX \
-postdeps_CXX \
-compiler_lib_search_path_CXX; do
- case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
- *[\\\\\\\`\\"\\\$]*)
- eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes
- ;;
- *)
- eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
- ;;
- esac
-done
-
-# Double-quote double-evaled strings.
-for var in reload_cmds \
-old_postinstall_cmds \
-old_postuninstall_cmds \
-old_archive_cmds \
-extract_expsyms_cmds \
-old_archive_from_new_cmds \
-old_archive_from_expsyms_cmds \
-archive_cmds \
-archive_expsym_cmds \
-module_cmds \
-module_expsym_cmds \
-export_symbols_cmds \
-prelink_cmds \
-postlink_cmds \
-postinstall_cmds \
-postuninstall_cmds \
-finish_cmds \
-sys_lib_search_path_spec \
-sys_lib_dlsearch_path_spec \
-reload_cmds_CXX \
-old_archive_cmds_CXX \
-old_archive_from_new_cmds_CXX \
-old_archive_from_expsyms_cmds_CXX \
-archive_cmds_CXX \
-archive_expsym_cmds_CXX \
-module_cmds_CXX \
-module_expsym_cmds_CXX \
-export_symbols_cmds_CXX \
-prelink_cmds_CXX \
-postlink_cmds_CXX; do
- case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
- *[\\\\\\\`\\"\\\$]*)
- eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes
- ;;
- *)
- eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
- ;;
- esac
-done
-
-ac_aux_dir='$ac_aux_dir'
-
-# See if we are running on zsh, and set the options that allow our
-# commands through without removal of \ escapes INIT.
-if test -n "\${ZSH_VERSION+set}"; then
- setopt NO_GLOB_SUBST
-fi
-
-
- PACKAGE='$PACKAGE'
- VERSION='$VERSION'
- RM='$RM'
- ofile='$ofile'
-
-
-
-
-
-TARGETDIR="$TARGETDIR"
-
-_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
- "fficonfig.h") CONFIG_HEADERS="$CONFIG_HEADERS fficonfig.h" ;;
- "buildir") CONFIG_COMMANDS="$CONFIG_COMMANDS buildir" ;;
- "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
- "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;;
- "include") CONFIG_COMMANDS="$CONFIG_COMMANDS include" ;;
- "src") CONFIG_COMMANDS="$CONFIG_COMMANDS src" ;;
- "include/ffitarget.h") CONFIG_LINKS="$CONFIG_LINKS include/ffitarget.h:src/$TARGETDIR/ffitarget.h" ;;
- "include/Makefile") CONFIG_FILES="$CONFIG_FILES include/Makefile" ;;
- "include/ffi.h") CONFIG_FILES="$CONFIG_FILES include/ffi.h" ;;
- "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
- "testsuite/Makefile") CONFIG_FILES="$CONFIG_FILES testsuite/Makefile" ;;
- "man/Makefile") CONFIG_FILES="$CONFIG_FILES man/Makefile" ;;
- "libffi.pc") CONFIG_FILES="$CONFIG_FILES libffi.pc" ;;
- "include/ffi_common.h") CONFIG_LINKS="$CONFIG_LINKS include/ffi_common.h:include/ffi_common.h" ;;
- "fficonfig.py") CONFIG_FILES="$CONFIG_FILES fficonfig.py" ;;
-
- *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
- 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
- test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
- test "${CONFIG_LINKS+set}" = set || CONFIG_LINKS=$config_links
- test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
-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= ac_tmp=
- trap 'exit_status=$?
- : "${ac_tmp:=$tmp}"
- { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status
-' 0
- trap 'as_fn_exit 1' 1 2 13 15
-}
-# Create a (secure) tmp directory for tmp files.
-
-{
- tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
- test -d "$tmp"
-} ||
-{
- tmp=./conf$$-$RANDOM
- (umask 077 && mkdir "$tmp")
-} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5
-ac_tmp=$tmp
-
-# 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=`echo X | tr X '\015'`
-# On cygwin, bash can eat \r inside `` if the user requested igncr.
-# But we know of no other shell where ac_cr would be empty at this
-# point, so we can use a bashism as a fallback.
-if test "x$ac_cr" = x; then
- eval ac_cr=\$\'\\r\'
-fi
-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 {' >"$ac_tmp/subs1.awk" &&
-_ACEOF
-
-
-{
- echo "cat >conf$$subs.awk <<_ACEOF" &&
- echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
- echo "_ACEOF"
-} >conf$$subs.sh ||
- as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
-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_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
-
- 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_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
- 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 >>"\$ac_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 >>"\$ac_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 < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \
- || as_fn_error $? "could not setup config files machinery" "$LINENO" 5
-_ACEOF
-
-# VPATH may cause trouble with some makes, so we remove sole $(srcdir),
-# ${srcdir} and @srcdir@ entries 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[ ]*=[ ]*/{
-h
-s///
-s/^/:/
-s/[ ]*$/:/
-s/:\$(srcdir):/:/g
-s/:\${srcdir}:/:/g
-s/:@srcdir@:/:/g
-s/^:*//
-s/:*$//
-x
-s/\(=[ ]*\).*/\1/
-G
-s/\n//
-s/^[^=]*=[ ]*$//
-}'
-fi
-
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-fi # test -n "$CONFIG_FILES"
-
-# Set up the scripts for CONFIG_HEADERS section.
-# No need to generate them if there are no CONFIG_HEADERS.
-# This happens for instance with `./config.status Makefile'.
-if test -n "$CONFIG_HEADERS"; then
-cat >"$ac_tmp/defines.awk" <<\_ACAWK ||
-BEGIN {
-_ACEOF
-
-# Transform confdefs.h into an awk script `defines.awk', embedded as
-# here-document in config.status, that substitutes the proper values into
-# config.h.in to produce config.h.
-
-# Create a delimiter string that does not exist in confdefs.h, to ease
-# handling of long lines.
-ac_delim='%!_!# '
-for ac_last_try in false false :; do
- ac_tt=`sed -n "/$ac_delim/p" confdefs.h`
- if test -z "$ac_tt"; then
- break
- elif $ac_last_try; then
- as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5
- else
- ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
- fi
-done
-
-# For the awk script, D is an array of macro values keyed by name,
-# likewise P contains macro parameters if any. Preserve backslash
-# newline sequences.
-
-ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
-sed -n '
-s/.\{148\}/&'"$ac_delim"'/g
-t rset
-:rset
-s/^[ ]*#[ ]*define[ ][ ]*/ /
-t def
-d
-:def
-s/\\$//
-t bsnl
-s/["\\]/\\&/g
-s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\
-D["\1"]=" \3"/p
-s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p
-d
-:bsnl
-s/["\\]/\\&/g
-s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\
-D["\1"]=" \3\\\\\\n"\\/p
-t cont
-s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p
-t cont
-d
-:cont
-n
-s/.\{148\}/&'"$ac_delim"'/g
-t clear
-:clear
-s/\\$//
-t bsnlc
-s/["\\]/\\&/g; s/^/"/; s/$/"/p
-d
-:bsnlc
-s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p
-b cont
-' <confdefs.h | sed '
-s/'"$ac_delim"'/"\\\
-"/g' >>$CONFIG_STATUS || ac_write_fail=1
-
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
- for (key in D) D_is_set[key] = 1
- FS = ""
-}
-/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ {
- line = \$ 0
- split(line, arg, " ")
- if (arg[1] == "#") {
- defundef = arg[2]
- mac1 = arg[3]
- } else {
- defundef = substr(arg[1], 2)
- mac1 = arg[2]
- }
- split(mac1, mac2, "(") #)
- macro = mac2[1]
- prefix = substr(line, 1, index(line, defundef) - 1)
- if (D_is_set[macro]) {
- # Preserve the white space surrounding the "#".
- print prefix "define", macro P[macro] D[macro]
- next
- } else {
- # Replace #undef with comments. This is necessary, for example,
- # in the case of _POSIX_SOURCE, which is predefined and required
- # on some systems where configure will not decide to define it.
- if (defundef == "undef") {
- print "/*", prefix defundef, macro, "*/"
- next
- }
- }
-}
-{ print }
-_ACAWK
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
- as_fn_error $? "could not setup config headers machinery" "$LINENO" 5
-fi # test -n "$CONFIG_HEADERS"
-
-
-eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :L $CONFIG_LINKS :C $CONFIG_COMMANDS"
-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_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;;
- :[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="$ac_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_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;;
- esac
- case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
- as_fn_append 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:${as_lineno-$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 >"$ac_tmp/stdin" \
- || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
- 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"; as_fn_mkdir_p
- 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
- ac_MKDIR_P=$MKDIR_P
- case $MKDIR_P in
- [\\/$]* | ?:[\\/]* ) ;;
- */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;;
- 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:${as_lineno-$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
-s&@MKDIR_P@&$ac_MKDIR_P&;t t
-$ac_datarootdir_hack
-"
-eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \
- >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5
-
-test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
- { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } &&
- { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \
- "$ac_tmp/out"`; test -z "$ac_out"; } &&
- { $as_echo "$as_me:${as_lineno-$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 "$ac_tmp/stdin"
- case $ac_file in
- -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";;
- *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";;
- esac \
- || as_fn_error $? "could not create $ac_file" "$LINENO" 5
- ;;
- :H)
- #
- # CONFIG_HEADER
- #
- if test x"$ac_file" != x-; then
- {
- $as_echo "/* $configure_input */" \
- && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs"
- } >"$ac_tmp/config.h" \
- || as_fn_error $? "could not create $ac_file" "$LINENO" 5
- if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5
-$as_echo "$as_me: $ac_file is unchanged" >&6;}
- else
- rm -f "$ac_file"
- mv "$ac_tmp/config.h" "$ac_file" \
- || as_fn_error $? "could not create $ac_file" "$LINENO" 5
- fi
- else
- $as_echo "/* $configure_input */" \
- && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \
- || as_fn_error $? "could not create -" "$LINENO" 5
- fi
-# Compute "$ac_file"'s index in $config_headers.
-_am_arg="$ac_file"
-_am_stamp_count=1
-for _am_header in $config_headers :; do
- case $_am_header in
- $_am_arg | $_am_arg:* )
- break ;;
- * )
- _am_stamp_count=`expr $_am_stamp_count + 1` ;;
- esac
-done
-echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" ||
-$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$_am_arg" : 'X\(//\)[^/]' \| \
- X"$_am_arg" : 'X\(//\)$' \| \
- X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$_am_arg" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
- s//\1/
- q
- }
- /^X\(\/\/\)[^/].*/{
- s//\1/
- q
- }
- /^X\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`/stamp-h$_am_stamp_count
- ;;
- :L)
- #
- # CONFIG_LINK
- #
-
- if test "$ac_source" = "$ac_file" && test "$srcdir" = '.'; then
- :
- else
- # Prefer the file from the source tree if names are identical.
- if test "$ac_source" = "$ac_file" || test ! -r "$ac_source"; then
- ac_source=$srcdir/$ac_source
- fi
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: linking $ac_source to $ac_file" >&5
-$as_echo "$as_me: linking $ac_source to $ac_file" >&6;}
-
- if test ! -r "$ac_source"; then
- as_fn_error $? "$ac_source: file not found" "$LINENO" 5
- fi
- rm -f "$ac_file"
-
- # Try a relative symlink, then a hard link, then a copy.
- case $ac_source in
- [\\/$]* | ?:[\\/]* ) ac_rel_source=$ac_source ;;
- *) ac_rel_source=$ac_top_build_prefix$ac_source ;;
- esac
- ln -s "$ac_rel_source" "$ac_file" 2>/dev/null ||
- ln "$ac_source" "$ac_file" 2>/dev/null ||
- cp -p "$ac_source" "$ac_file" ||
- as_fn_error $? "cannot link or copy $ac_source to $ac_file" "$LINENO" 5
- fi
- ;;
- :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5
-$as_echo "$as_me: executing $ac_file commands" >&6;}
- ;;
- esac
-
-
- case $ac_file$ac_mode in
- "buildir":C) ac_top_srcdir="$ax_enable_builddir_srcdir"
- if test ".$ax_enable_builddir" = ".." ; then
- if test -f "$top_srcdir/Makefile" ; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: skipping top_srcdir/Makefile - left untouched" >&5
-$as_echo "$as_me: skipping top_srcdir/Makefile - left untouched" >&6;}
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: skipping top_srcdir/Makefile - not created" >&5
-$as_echo "$as_me: skipping top_srcdir/Makefile - not created" >&6;}
- fi
- else
- if test -f "$ac_top_srcdir/Makefile" ; then
- a=`grep "^VERSION " "$ac_top_srcdir/Makefile"` ; b=`grep "^VERSION " Makefile`
- test "$a" != "$b" && rm "$ac_top_srcdir/Makefile"
- fi
- if test -f "$ac_top_srcdir/Makefile" ; then
- echo "$ac_top_srcdir/Makefile : $ac_top_srcdir/Makefile.in" > $tmp/conftemp.mk
- echo " @ echo 'REMOVED,,,' >\$@" >> $tmp/conftemp.mk
- eval "${MAKE-make} -f $tmp/conftemp.mk 2>/dev/null >/dev/null"
- if grep '^REMOVED,,,' "$ac_top_srcdir/Makefile" >/dev/null
- then rm $ac_top_srcdir/Makefile ; fi
- cp $tmp/conftemp.mk $ac_top_srcdir/makefiles.mk~ ## DEBUGGING
- fi
- if test ! -f "$ac_top_srcdir/Makefile" ; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: create top_srcdir/Makefile guessed from local Makefile" >&5
-$as_echo "$as_me: create top_srcdir/Makefile guessed from local Makefile" >&6;}
- x='`' ; cat >$tmp/conftemp.sed <<_EOF
-/^\$/n
-x
-/^\$/bS
-x
-/\\\\\$/{H;d;}
-{H;s/.*//;x;}
-bM
-:S
-x
-/\\\\\$/{h;d;}
-{h;s/.*//;x;}
-:M
-s/\\(\\n\\) /\\1 /g
-/^ /d
-/^[ ]*[\\#]/d
-/^VPATH *=/d
-s/^srcdir *=.*/srcdir = ./
-s/^top_srcdir *=.*/top_srcdir = ./
-/[:=]/!d
-/^\\./d
-/ = /b
-/ .= /b
-/:/!b
-s/:.*/:/
-s/ / /g
-s/ \\([a-z][a-z-]*[a-zA-Z0-9]\\)\\([ :]\\)/ \\1 \\1-all\\2/g
-s/^\\([a-z][a-z-]*[a-zA-Z0-9]\\)\\([ :]\\)/\\1 \\1-all\\2/
-s/ / /g
-/^all all-all[ :]/i\\
-all-configured : all-all
-s/ [a-zA-Z0-9-]*-all [a-zA-Z0-9-]*-all-all//g
-/-all-all/d
-a\\
- @ HOST="\$(HOST)\" \\\\\\
- ; test ".\$\$HOST" = "." && HOST=$x sh $ax_enable_builddir_auxdir/config.guess $x \\\\\\
- ; BUILD=$x grep "^#### \$\$HOST " Makefile | sed -e 's/.*|//' $x \\\\\\
- ; use=$x basename "\$\@" -all $x; n=$x echo \$\$BUILD | wc -w $x \\\\\\
- ; echo "MAKE \$\$HOST : \$\$n * \$\@"; if test "\$\$n" -eq "0" ; then : \\\\\\
- ; BUILD=$x grep "^####.*|" Makefile |tail -1| sed -e 's/.*|//' $x ; fi \\\\\\
- ; test ".\$\$BUILD" = "." && BUILD="." \\\\\\
- ; test "\$\$use" = "\$\@" && BUILD=$x echo "\$\$BUILD" | tail -1 $x \\\\\\
- ; for i in \$\$BUILD ; do test ".\$\$i" = "." && continue \\\\\\
- ; (cd "\$\$i" && test ! -f configure && \$(MAKE) \$\$use) || exit; done
-/dist-all *:/a\\
- @ HOST="\$(HOST)\" \\\\\\
- ; test ".\$\$HOST" = "." && HOST=$x sh $ax_enable_builddir_auxdir/config.guess $x \\\\\\
- ; BUILD=$x grep "^#### \$\$HOST " Makefile | sed -e 's/.*|//' $x \\\\\\
- ; found=$x echo \$\$BUILD | wc -w $x \\\\\\
- ; echo "MAKE \$\$HOST : \$\$found \$(PACKAGE)-\$(VERSION).tar.*" \\\\\\
- ; if test "\$\$found" -eq "0" ; then : \\\\\\
- ; BUILD=$x grep "^#### .*|" Makefile |tail -1| sed -e 's/.*|//' $x \\\\\\
- ; fi ; for i in \$\$BUILD ; do test ".\$\$i" = "." && continue \\\\\\
- ; for f in \$\$i/\$(PACKAGE)-\$(VERSION).tar.* \\\\\\
- ; do test -f "\$\$f" && mv "\$\$f" \$(PUB). ; done ; break ; done
-/dist-[a-zA-Z0-9]*-all *:/a\\
- @ HOST="\$(HOST)\" \\\\\\
- ; test ".\$\$HOST" = "." && HOST=$x sh ./config.guess $x \\\\\\
- ; BUILD=$x grep "^#### \$\$HOST " Makefile | sed -e 's/.*|//' $x \\\\\\
- ; found=$x echo \$\$BUILD | wc -w $x \\\\\\
- ; echo "MAKE \$\$HOST : \$\$found \$(PACKAGE)-\$(VERSION).*" \\\\\\
- ; if test "\$\$found" -eq "0" ; then : \\\\\\
- ; BUILD=$x grep "^#### .*|" Makefile |tail -1| sed -e 's/.*|//' $x \\\\\\
- ; fi ; for i in \$\$BUILD ; do test ".\$\$i" = "." && continue \\\\\\
- ; for f in \$\$i/\$(PACKAGE)-\$(VERSION).* \\\\\\
- ; do test -f "\$\$f" && mv "\$\$f" \$(PUB). ; done ; break ; done
-/distclean-all *:/a\\
- @ HOST="\$(HOST)\" \\\\\\
- ; test ".\$\$HOST" = "." && HOST=$x sh $ax_enable_builddir_auxdir/config.guess $x \\\\\\
- ; BUILD=$x grep "^#### .*|" Makefile | sed -e 's/.*|//' $x \\\\\\
- ; use=$x basename "\$\@" -all $x; n=$x echo \$\$BUILD | wc -w $x \\\\\\
- ; echo "MAKE \$\$HOST : \$\$n * \$\@ (all local builds)" \\\\\\
- ; test ".\$\$BUILD" = "." && BUILD="." \\\\\\
- ; for i in \$\$BUILD ; do test ".\$\$i" = "." && continue \\\\\\
- ; echo "# rm -r \$\$i"; done ; echo "# (sleep 3)" ; sleep 3 \\\\\\
- ; for i in \$\$BUILD ; do test ".\$\$i" = "." && continue \\\\\\
- ; echo "\$\$i" | grep "^/" > /dev/null && continue \\\\\\
- ; echo "\$\$i" | grep "^../" > /dev/null && continue \\\\\\
- ; echo "rm -r \$\$i"; (rm -r "\$\$i") ; done ; rm Makefile
-_EOF
- cp "$tmp/conftemp.sed" "$ac_top_srcdir/makefile.sed~" ## DEBUGGING
- $ax_enable_builddir_sed -f $tmp/conftemp.sed Makefile >$ac_top_srcdir/Makefile
- if test -f "$ac_top_srcdir/Makefile.mk" ; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: extend top_srcdir/Makefile with top_srcdir/Makefile.mk" >&5
-$as_echo "$as_me: extend top_srcdir/Makefile with top_srcdir/Makefile.mk" >&6;}
- cat $ac_top_srcdir/Makefile.mk >>$ac_top_srcdir/Makefile
- fi ; xxxx="####"
- echo "$xxxx CONFIGURATIONS FOR TOPLEVEL MAKEFILE: " >>$ac_top_srcdir/Makefile
- # sanity check
- if grep '^; echo "MAKE ' $ac_top_srcdir/Makefile >/dev/null ; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: buggy sed found - it deletes tab in \"a\" text parts" >&5
-$as_echo "$as_me: buggy sed found - it deletes tab in \"a\" text parts" >&6;}
- $ax_enable_builddir_sed -e '/^@ HOST=/s/^/ /' -e '/^; /s/^/ /' $ac_top_srcdir/Makefile \
- >$ac_top_srcdir/Makefile~
- (test -s $ac_top_srcdir/Makefile~ && mv $ac_top_srcdir/Makefile~ $ac_top_srcdir/Makefile) 2>/dev/null
- fi
- else
- xxxx="\\#\\#\\#\\#"
- # echo "/^$xxxx *$ax_enable_builddir_host /d" >$tmp/conftemp.sed
- echo "s!^$xxxx [^|]* | *$ax_enable_builddir *\$!$xxxx ...... $ax_enable_builddir!" >$tmp/conftemp.sed
- $ax_enable_builddir_sed -f "$tmp/conftemp.sed" "$ac_top_srcdir/Makefile" >$tmp/mkfile.tmp
- cp "$tmp/conftemp.sed" "$ac_top_srcdir/makefiles.sed~" ## DEBUGGING
- cp "$tmp/mkfile.tmp" "$ac_top_srcdir/makefiles.out~" ## DEBUGGING
- if cmp -s "$ac_top_srcdir/Makefile" "$tmp/mkfile.tmp" 2>/dev/null ; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: keeping top_srcdir/Makefile from earlier configure" >&5
-$as_echo "$as_me: keeping top_srcdir/Makefile from earlier configure" >&6;}
- rm "$tmp/mkfile.tmp"
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: reusing top_srcdir/Makefile from earlier configure" >&5
-$as_echo "$as_me: reusing top_srcdir/Makefile from earlier configure" >&6;}
- mv "$tmp/mkfile.tmp" "$ac_top_srcdir/Makefile"
- fi
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: build in $ax_enable_builddir (HOST=$ax_enable_builddir_host)" >&5
-$as_echo "$as_me: build in $ax_enable_builddir (HOST=$ax_enable_builddir_host)" >&6;}
- xxxx="####"
- echo "$xxxx" "$ax_enable_builddir_host" "|$ax_enable_builddir" >>$ac_top_srcdir/Makefile
- fi
- ;;
- "depfiles":C) test x"$AMDEP_TRUE" != x"" || {
- # Older Autoconf quotes --file arguments for eval, but not when files
- # are listed without --file. Let's play safe and only enable the eval
- # if we detect the quoting.
- case $CONFIG_FILES in
- *\'*) eval set x "$CONFIG_FILES" ;;
- *) set x $CONFIG_FILES ;;
- esac
- shift
- for mf
- do
- # Strip MF so we end up with the name of the file.
- mf=`echo "$mf" | sed -e 's/:.*$//'`
- # Check whether this is an Automake generated Makefile or not.
- # We used to match only the files named 'Makefile.in', but
- # some people rename them; so instead we look at the file content.
- # Grep'ing the first line is not enough: some people post-process
- # each Makefile.in and add a new line on top of each file to say so.
- # Grep'ing the whole file is not good either: AIX grep has a line
- # limit of 2048, but all sed's we know have understand at least 4000.
- if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
- dirpart=`$as_dirname -- "$mf" ||
-$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$mf" : 'X\(//\)[^/]' \| \
- X"$mf" : 'X\(//\)$' \| \
- X"$mf" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$mf" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
- s//\1/
- q
- }
- /^X\(\/\/\)[^/].*/{
- s//\1/
- q
- }
- /^X\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
- else
- continue
- fi
- # Extract the definition of DEPDIR, am__include, and am__quote
- # from the Makefile without running 'make'.
- DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
- test -z "$DEPDIR" && continue
- am__include=`sed -n 's/^am__include = //p' < "$mf"`
- test -z "$am__include" && continue
- am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
- # Find all dependency output files, they are included files with
- # $(DEPDIR) in their names. We invoke sed twice because it is the
- # simplest approach to changing $(DEPDIR) to its actual value in the
- # expansion.
- for file in `sed -n "
- s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
- sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
- # Make sure the directory exists.
- test -f "$dirpart/$file" && continue
- fdir=`$as_dirname -- "$file" ||
-$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$file" : 'X\(//\)[^/]' \| \
- X"$file" : 'X\(//\)$' \| \
- X"$file" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$file" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
- s//\1/
- q
- }
- /^X\(\/\/\)[^/].*/{
- s//\1/
- q
- }
- /^X\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
- as_dir=$dirpart/$fdir; as_fn_mkdir_p
- # echo "creating $dirpart/$file"
- echo '# dummy' > "$dirpart/$file"
- done
- done
-}
- ;;
- "libtool":C)
-
- # See if we are running on zsh, and set the options that allow our
- # commands through without removal of \ escapes.
- if test -n "${ZSH_VERSION+set}"; then
- setopt NO_GLOB_SUBST
- fi
-
- cfgfile=${ofile}T
- trap "$RM \"$cfgfile\"; exit 1" 1 2 15
- $RM "$cfgfile"
-
- cat <<_LT_EOF >> "$cfgfile"
-#! $SHELL
-
-# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
-# Generated automatically by $as_me ($PACKAGE) $VERSION
-# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
-# NOTE: Changes made to this file will be lost: look at ltmain.sh.
-#
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
-# 2006, 2007, 2008, 2009, 2010, 2011 Free Software
-# Foundation, Inc.
-# Written by Gordon Matzigkeit, 1996
-#
-# This file is part of GNU Libtool.
-#
-# GNU Libtool 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.
-#
-# As a special exception to the GNU General Public License,
-# if you distribute this file as part of a program or library that
-# is built using GNU Libtool, you may include this file under the
-# same distribution terms that you use for the rest of that program.
-#
-# GNU Libtool 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 GNU Libtool; see the file COPYING. If not, a copy
-# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
-# obtained by writing to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-
-
-# The names of the tagged configurations supported by this script.
-available_tags='CXX '
-
-# ### BEGIN LIBTOOL CONFIG
-
-# Which release of libtool.m4 was used?
-macro_version=$macro_version
-macro_revision=$macro_revision
-
-# Whether or not to build shared libraries.
-build_libtool_libs=$enable_shared
-
-# Whether or not to build static libraries.
-build_old_libs=$enable_static
-
-# What type of objects to build.
-pic_mode=$pic_mode
-
-# Whether or not to optimize for fast installation.
-fast_install=$enable_fast_install
-
-# Shell to use when invoking shell scripts.
-SHELL=$lt_SHELL
-
-# An echo program that protects backslashes.
-ECHO=$lt_ECHO
-
-# The PATH separator for the build system.
-PATH_SEPARATOR=$lt_PATH_SEPARATOR
-
-# The host system.
-host_alias=$host_alias
-host=$host
-host_os=$host_os
-
-# The build system.
-build_alias=$build_alias
-build=$build
-build_os=$build_os
-
-# A sed program that does not truncate output.
-SED=$lt_SED
-
-# Sed that helps us avoid accidentally triggering echo(1) options like -n.
-Xsed="\$SED -e 1s/^X//"
-
-# A grep program that handles long lines.
-GREP=$lt_GREP
-
-# An ERE matcher.
-EGREP=$lt_EGREP
-
-# A literal string matcher.
-FGREP=$lt_FGREP
-
-# A BSD- or MS-compatible name lister.
-NM=$lt_NM
-
-# Whether we need soft or hard links.
-LN_S=$lt_LN_S
-
-# What is the maximum length of a command?
-max_cmd_len=$max_cmd_len
-
-# Object file suffix (normally "o").
-objext=$ac_objext
-
-# Executable file suffix (normally "").
-exeext=$exeext
-
-# whether the shell understands "unset".
-lt_unset=$lt_unset
-
-# turn spaces into newlines.
-SP2NL=$lt_lt_SP2NL
-
-# turn newlines into spaces.
-NL2SP=$lt_lt_NL2SP
-
-# convert \$build file names to \$host format.
-to_host_file_cmd=$lt_cv_to_host_file_cmd
-
-# convert \$build files to toolchain format.
-to_tool_file_cmd=$lt_cv_to_tool_file_cmd
-
-# An object symbol dumper.
-OBJDUMP=$lt_OBJDUMP
-
-# Method to check whether dependent libraries are shared objects.
-deplibs_check_method=$lt_deplibs_check_method
-
-# Command to use when deplibs_check_method = "file_magic".
-file_magic_cmd=$lt_file_magic_cmd
-
-# How to find potential files when deplibs_check_method = "file_magic".
-file_magic_glob=$lt_file_magic_glob
-
-# Find potential files using nocaseglob when deplibs_check_method = "file_magic".
-want_nocaseglob=$lt_want_nocaseglob
-
-# DLL creation program.
-DLLTOOL=$lt_DLLTOOL
-
-# Command to associate shared and link libraries.
-sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd
-
-# The archiver.
-AR=$lt_AR
-
-# Flags to create an archive.
-AR_FLAGS=$lt_AR_FLAGS
-
-# How to feed a file listing to the archiver.
-archiver_list_spec=$lt_archiver_list_spec
-
-# A symbol stripping program.
-STRIP=$lt_STRIP
-
-# Commands used to install an old-style archive.
-RANLIB=$lt_RANLIB
-old_postinstall_cmds=$lt_old_postinstall_cmds
-old_postuninstall_cmds=$lt_old_postuninstall_cmds
-
-# Whether to use a lock for old archive extraction.
-lock_old_archive_extraction=$lock_old_archive_extraction
-
-# A C compiler.
-LTCC=$lt_CC
-
-# LTCC compiler flags.
-LTCFLAGS=$lt_CFLAGS
-
-# Take the output of nm and produce a listing of raw symbols and C names.
-global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
-
-# Transform the output of nm in a proper C declaration.
-global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
-
-# Transform the output of nm into a list of symbols to manually relocate.
-global_symbol_to_import=$lt_lt_cv_sys_global_symbol_to_import
-
-# Transform the output of nm in a C name address pair.
-global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
-
-# Transform the output of nm in a C name address pair when lib prefix is needed.
-global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix
-
-# The name lister interface.
-nm_interface=$lt_lt_cv_nm_interface
-
-# Specify filename containing input files for \$NM.
-nm_file_list_spec=$lt_nm_file_list_spec
-
-# The root where to search for dependent libraries,and where our libraries should be installed.
-lt_sysroot=$lt_sysroot
-
-# The name of the directory that contains temporary libtool files.
-objdir=$objdir
-
-# Used to examine libraries when file_magic_cmd begins with "file".
-MAGIC_CMD=$MAGIC_CMD
-
-# Must we lock files when doing compilation?
-need_locks=$lt_need_locks
-
-# Manifest tool.
-MANIFEST_TOOL=$lt_MANIFEST_TOOL
-
-# Tool to manipulate archived DWARF debug symbol files on Mac OS X.
-DSYMUTIL=$lt_DSYMUTIL
-
-# Tool to change global to local symbols on Mac OS X.
-NMEDIT=$lt_NMEDIT
-
-# Tool to manipulate fat objects and archives on Mac OS X.
-LIPO=$lt_LIPO
-
-# ldd/readelf like tool for Mach-O binaries on Mac OS X.
-OTOOL=$lt_OTOOL
-
-# ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4.
-OTOOL64=$lt_OTOOL64
-
-# Old archive suffix (normally "a").
-libext=$libext
-
-# Shared library suffix (normally ".so").
-shrext_cmds=$lt_shrext_cmds
-
-# The commands to extract the exported symbol list from a shared archive.
-extract_expsyms_cmds=$lt_extract_expsyms_cmds
-
-# Variables whose values should be saved in libtool wrapper scripts and
-# restored at link time.
-variables_saved_for_relink=$lt_variables_saved_for_relink
-
-# Do we need the "lib" prefix for modules?
-need_lib_prefix=$need_lib_prefix
-
-# Do we need a version for libraries?
-need_version=$need_version
-
-# Library versioning type.
-version_type=$version_type
-
-# Shared library runtime path variable.
-runpath_var=$runpath_var
-
-# Shared library path variable.
-shlibpath_var=$shlibpath_var
-
-# Is shlibpath searched before the hard-coded library search path?
-shlibpath_overrides_runpath=$shlibpath_overrides_runpath
-
-# Format of library name prefix.
-libname_spec=$lt_libname_spec
-
-# List of archive names. First name is the real one, the rest are links.
-# The last name is the one that the linker finds with -lNAME
-library_names_spec=$lt_library_names_spec
-
-# The coded name of the library, if different from the real name.
-soname_spec=$lt_soname_spec
-
-# Permission mode override for installation of shared libraries.
-install_override_mode=$lt_install_override_mode
-
-# Command to use after installation of a shared archive.
-postinstall_cmds=$lt_postinstall_cmds
-
-# Command to use after uninstallation of a shared archive.
-postuninstall_cmds=$lt_postuninstall_cmds
-
-# Commands used to finish a libtool library installation in a directory.
-finish_cmds=$lt_finish_cmds
-
-# As "finish_cmds", except a single script fragment to be evaled but
-# not shown.
-finish_eval=$lt_finish_eval
-
-# Whether we should hardcode library paths into libraries.
-hardcode_into_libs=$hardcode_into_libs
-
-# Compile-time system search path for libraries.
-sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
-
-# Run-time system search path for libraries.
-sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
-
-# Whether dlopen is supported.
-dlopen_support=$enable_dlopen
-
-# Whether dlopen of programs is supported.
-dlopen_self=$enable_dlopen_self
-
-# Whether dlopen of statically linked programs is supported.
-dlopen_self_static=$enable_dlopen_self_static
-
-# Commands to strip libraries.
-old_striplib=$lt_old_striplib
-striplib=$lt_striplib
-
-
-# The linker used to build libraries.
-LD=$lt_LD
-
-# How to create reloadable object files.
-reload_flag=$lt_reload_flag
-reload_cmds=$lt_reload_cmds
-
-# Commands used to build an old-style archive.
-old_archive_cmds=$lt_old_archive_cmds
-
-# A language specific compiler.
-CC=$lt_compiler
-
-# Is the compiler the GNU compiler?
-with_gcc=$GCC
-
-# Compiler flag to turn off builtin functions.
-no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag
-
-# Additional compiler flags for building library objects.
-pic_flag=$lt_lt_prog_compiler_pic
-
-# How to pass a linker flag through the compiler.
-wl=$lt_lt_prog_compiler_wl
-
-# Compiler flag to prevent dynamic linking.
-link_static_flag=$lt_lt_prog_compiler_static
-
-# Does compiler simultaneously support -c and -o options?
-compiler_c_o=$lt_lt_cv_prog_compiler_c_o
-
-# Whether or not to add -lc for building shared libraries.
-build_libtool_need_lc=$archive_cmds_need_lc
-
-# Whether or not to disallow shared libs when runtime libs are static.
-allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes
-
-# Compiler flag to allow reflexive dlopens.
-export_dynamic_flag_spec=$lt_export_dynamic_flag_spec
-
-# Compiler flag to generate shared objects directly from archives.
-whole_archive_flag_spec=$lt_whole_archive_flag_spec
-
-# Whether the compiler copes with passing no objects directly.
-compiler_needs_object=$lt_compiler_needs_object
-
-# Create an old-style archive from a shared archive.
-old_archive_from_new_cmds=$lt_old_archive_from_new_cmds
-
-# Create a temporary old-style archive to link instead of a shared archive.
-old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds
-
-# Commands used to build a shared archive.
-archive_cmds=$lt_archive_cmds
-archive_expsym_cmds=$lt_archive_expsym_cmds
-
-# Commands used to build a loadable module if different from building
-# a shared archive.
-module_cmds=$lt_module_cmds
-module_expsym_cmds=$lt_module_expsym_cmds
-
-# Whether we are building with GNU ld or not.
-with_gnu_ld=$lt_with_gnu_ld
-
-# Flag that allows shared libraries with undefined symbols to be built.
-allow_undefined_flag=$lt_allow_undefined_flag
-
-# Flag that enforces no undefined symbols.
-no_undefined_flag=$lt_no_undefined_flag
-
-# Flag to hardcode \$libdir into a binary during linking.
-# This must work even if \$libdir does not exist
-hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec
-
-# Whether we need a single "-rpath" flag with a separated argument.
-hardcode_libdir_separator=$lt_hardcode_libdir_separator
-
-# Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes
-# DIR into the resulting binary.
-hardcode_direct=$hardcode_direct
-
-# Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes
-# DIR into the resulting binary and the resulting library dependency is
-# "absolute",i.e impossible to change by setting \$shlibpath_var if the
-# library is relocated.
-hardcode_direct_absolute=$hardcode_direct_absolute
-
-# Set to "yes" if using the -LDIR flag during linking hardcodes DIR
-# into the resulting binary.
-hardcode_minus_L=$hardcode_minus_L
-
-# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
-# into the resulting binary.
-hardcode_shlibpath_var=$hardcode_shlibpath_var
-
-# Set to "yes" if building a shared library automatically hardcodes DIR
-# into the library and all subsequent libraries and executables linked
-# against it.
-hardcode_automatic=$hardcode_automatic
-
-# Set to yes if linker adds runtime paths of dependent libraries
-# to runtime path list.
-inherit_rpath=$inherit_rpath
-
-# Whether libtool must link a program against all its dependency libraries.
-link_all_deplibs=$link_all_deplibs
-
-# Set to "yes" if exported symbols are required.
-always_export_symbols=$always_export_symbols
-
-# The commands to list exported symbols.
-export_symbols_cmds=$lt_export_symbols_cmds
-
-# Symbols that should not be listed in the preloaded symbols.
-exclude_expsyms=$lt_exclude_expsyms
-
-# Symbols that must always be exported.
-include_expsyms=$lt_include_expsyms
-
-# Commands necessary for linking programs (against libraries) with templates.
-prelink_cmds=$lt_prelink_cmds
-
-# Commands necessary for finishing linking programs.
-postlink_cmds=$lt_postlink_cmds
-
-# Specify filename containing input files.
-file_list_spec=$lt_file_list_spec
-
-# How to hardcode a shared library path into an executable.
-hardcode_action=$hardcode_action
-
-# The directories searched by this compiler when creating a shared library.
-compiler_lib_search_dirs=$lt_compiler_lib_search_dirs
-
-# Dependencies to place before and after the objects being linked to
-# create a shared library.
-predep_objects=$lt_predep_objects
-postdep_objects=$lt_postdep_objects
-predeps=$lt_predeps
-postdeps=$lt_postdeps
-
-# The library search path used internally by the compiler when linking
-# a shared library.
-compiler_lib_search_path=$lt_compiler_lib_search_path
-
-# ### END LIBTOOL CONFIG
-
-_LT_EOF
-
- case $host_os in
- aix3*)
- cat <<\_LT_EOF >> "$cfgfile"
-# AIX sometimes has problems with the GCC collect2 program. For some
-# reason, if we set the COLLECT_NAMES environment variable, the problems
-# vanish in a puff of smoke.
-if test set != "${COLLECT_NAMES+set}"; then
- COLLECT_NAMES=
- export COLLECT_NAMES
-fi
-_LT_EOF
- ;;
- esac
-
-
-ltmain=$ac_aux_dir/ltmain.sh
-
-
- # We use sed instead of cat because bash on DJGPP gets confused if
- # if finds mixed CR/LF and LF-only lines. Since sed operates in
- # text mode, it properly converts lines to CR/LF. This bash problem
- # is reportedly fixed, but why not run on old versions too?
- sed '$q' "$ltmain" >> "$cfgfile" \
- || (rm -f "$cfgfile"; exit 1)
-
- mv -f "$cfgfile" "$ofile" ||
- (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
- chmod +x "$ofile"
-
-
- cat <<_LT_EOF >> "$ofile"
-
-# ### BEGIN LIBTOOL TAG CONFIG: CXX
-
-# The linker used to build libraries.
-LD=$lt_LD_CXX
-
-# How to create reloadable object files.
-reload_flag=$lt_reload_flag_CXX
-reload_cmds=$lt_reload_cmds_CXX
-
-# Commands used to build an old-style archive.
-old_archive_cmds=$lt_old_archive_cmds_CXX
-
-# A language specific compiler.
-CC=$lt_compiler_CXX
-
-# Is the compiler the GNU compiler?
-with_gcc=$GCC_CXX
-
-# Compiler flag to turn off builtin functions.
-no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX
-
-# Additional compiler flags for building library objects.
-pic_flag=$lt_lt_prog_compiler_pic_CXX
-
-# How to pass a linker flag through the compiler.
-wl=$lt_lt_prog_compiler_wl_CXX
-
-# Compiler flag to prevent dynamic linking.
-link_static_flag=$lt_lt_prog_compiler_static_CXX
-
-# Does compiler simultaneously support -c and -o options?
-compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX
-
-# Whether or not to add -lc for building shared libraries.
-build_libtool_need_lc=$archive_cmds_need_lc_CXX
-
-# Whether or not to disallow shared libs when runtime libs are static.
-allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX
-
-# Compiler flag to allow reflexive dlopens.
-export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX
-
-# Compiler flag to generate shared objects directly from archives.
-whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX
-
-# Whether the compiler copes with passing no objects directly.
-compiler_needs_object=$lt_compiler_needs_object_CXX
-
-# Create an old-style archive from a shared archive.
-old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX
-
-# Create a temporary old-style archive to link instead of a shared archive.
-old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX
-
-# Commands used to build a shared archive.
-archive_cmds=$lt_archive_cmds_CXX
-archive_expsym_cmds=$lt_archive_expsym_cmds_CXX
-
-# Commands used to build a loadable module if different from building
-# a shared archive.
-module_cmds=$lt_module_cmds_CXX
-module_expsym_cmds=$lt_module_expsym_cmds_CXX
-
-# Whether we are building with GNU ld or not.
-with_gnu_ld=$lt_with_gnu_ld_CXX
-
-# Flag that allows shared libraries with undefined symbols to be built.
-allow_undefined_flag=$lt_allow_undefined_flag_CXX
-
-# Flag that enforces no undefined symbols.
-no_undefined_flag=$lt_no_undefined_flag_CXX
-
-# Flag to hardcode \$libdir into a binary during linking.
-# This must work even if \$libdir does not exist
-hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_CXX
-
-# Whether we need a single "-rpath" flag with a separated argument.
-hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX
-
-# Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes
-# DIR into the resulting binary.
-hardcode_direct=$hardcode_direct_CXX
-
-# Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes
-# DIR into the resulting binary and the resulting library dependency is
-# "absolute",i.e impossible to change by setting \$shlibpath_var if the
-# library is relocated.
-hardcode_direct_absolute=$hardcode_direct_absolute_CXX
-
-# Set to "yes" if using the -LDIR flag during linking hardcodes DIR
-# into the resulting binary.
-hardcode_minus_L=$hardcode_minus_L_CXX
-
-# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
-# into the resulting binary.
-hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX
-
-# Set to "yes" if building a shared library automatically hardcodes DIR
-# into the library and all subsequent libraries and executables linked
-# against it.
-hardcode_automatic=$hardcode_automatic_CXX
-
-# Set to yes if linker adds runtime paths of dependent libraries
-# to runtime path list.
-inherit_rpath=$inherit_rpath_CXX
-
-# Whether libtool must link a program against all its dependency libraries.
-link_all_deplibs=$link_all_deplibs_CXX
-
-# Set to "yes" if exported symbols are required.
-always_export_symbols=$always_export_symbols_CXX
-
-# The commands to list exported symbols.
-export_symbols_cmds=$lt_export_symbols_cmds_CXX
-
-# Symbols that should not be listed in the preloaded symbols.
-exclude_expsyms=$lt_exclude_expsyms_CXX
-
-# Symbols that must always be exported.
-include_expsyms=$lt_include_expsyms_CXX
-
-# Commands necessary for linking programs (against libraries) with templates.
-prelink_cmds=$lt_prelink_cmds_CXX
-
-# Commands necessary for finishing linking programs.
-postlink_cmds=$lt_postlink_cmds_CXX
-
-# Specify filename containing input files.
-file_list_spec=$lt_file_list_spec_CXX
-
-# How to hardcode a shared library path into an executable.
-hardcode_action=$hardcode_action_CXX
-
-# The directories searched by this compiler when creating a shared library.
-compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_CXX
-
-# Dependencies to place before and after the objects being linked to
-# create a shared library.
-predep_objects=$lt_predep_objects_CXX
-postdep_objects=$lt_postdep_objects_CXX
-predeps=$lt_predeps_CXX
-postdeps=$lt_postdeps_CXX
-
-# The library search path used internally by the compiler when linking
-# a shared library.
-compiler_lib_search_path=$lt_compiler_lib_search_path_CXX
-
-# ### END LIBTOOL TAG CONFIG: CXX
-_LT_EOF
-
- ;;
- "include":C) test -d include || mkdir include ;;
- "src":C)
-test -d src || mkdir src
-test -d src/$TARGETDIR || mkdir src/$TARGETDIR
- ;;
-
- esac
-done # for ac_tag
-
-
-as_fn_exit 0
-_ACEOF
-ac_clean_files=$ac_clean_files_save
-
-test $ac_write_fail = 0 ||
- as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5
-
-
-# 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 || as_fn_exit 1
-fi
-if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
-$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
-fi
-
diff --git a/Modules/_ctypes/libffi/configure.ac b/Modules/_ctypes/libffi/configure.ac
deleted file mode 100644
index 5c8885fa63..0000000000
--- a/Modules/_ctypes/libffi/configure.ac
+++ /dev/null
@@ -1,630 +0,0 @@
-dnl Process this with autoconf to create configure
-#
-# file from libffi - slightly patched for Python's ctypes
-#
-
-AC_PREREQ(2.68)
-
-AC_INIT([libffi], [3.1], [http://github.com/atgreen/libffi/issues])
-AC_CONFIG_HEADERS([fficonfig.h])
-
-AC_CANONICAL_SYSTEM
-target_alias=${target_alias-$host_alias}
-
-case "${host}" in
- frv*-elf)
- LDFLAGS=`echo $LDFLAGS | sed "s/\-B[^ ]*libgloss\/frv\///"`\ -B`pwd`/../libgloss/frv/
- ;;
-esac
-
-AX_ENABLE_BUILDDIR
-
-AM_INIT_AUTOMAKE
-
-# The same as in boehm-gc and libstdc++. Have to borrow it from there.
-# We must force CC to /not/ be precious variables; otherwise
-# the wrong, non-multilib-adjusted value will be used in multilibs.
-# As a side effect, we have to subst CFLAGS ourselves.
-# Also save and restore CFLAGS, since AC_PROG_CC will come up with
-# defaults of its own if none are provided.
-
-m4_rename([_AC_ARG_VAR_PRECIOUS],[real_PRECIOUS])
-m4_define([_AC_ARG_VAR_PRECIOUS],[])
-save_CFLAGS=$CFLAGS
-AC_PROG_CC
-AC_PROG_CXX
-CFLAGS=$save_CFLAGS
-m4_undefine([_AC_ARG_VAR_PRECIOUS])
-m4_rename_force([real_PRECIOUS],[_AC_ARG_VAR_PRECIOUS])
-
-AC_SUBST(CFLAGS)
-
-AM_PROG_AS
-AM_PROG_CC_C_O
-AC_PROG_LIBTOOL
-AC_CONFIG_MACRO_DIR([m4])
-
-# Test for 64-bit build.
-AC_CHECK_SIZEOF([size_t])
-
-AX_COMPILER_VENDOR
-AX_CC_MAXOPT
-# The AX_CFLAGS_WARN_ALL macro doesn't currently work for sunpro
-# compiler.
-if test "$ax_cv_c_compiler_vendor" != "sun"; then
- AX_CFLAGS_WARN_ALL
-fi
-
-if test "x$GCC" = "xyes"; then
- CFLAGS="$CFLAGS -fexceptions"
-fi
-
-cat > local.exp <<EOF
-set CC_FOR_TARGET "$CC"
-set CXX_FOR_TARGET "$CXX"
-EOF
-
-AM_MAINTAINER_MODE
-
-AC_CHECK_HEADERS(sys/mman.h)
-AC_CHECK_FUNCS(mmap)
-AC_FUNC_MMAP_BLACKLIST
-
-dnl The -no-testsuite modules omit the test subdir.
-AM_CONDITIONAL(TESTSUBDIR, test -d $srcdir/testsuite)
-
-TARGETDIR="unknown"
-HAVE_LONG_DOUBLE_VARIANT=0
-case "$host" in
- aarch64*-*-*)
- TARGET=AARCH64; TARGETDIR=aarch64
- ;;
-
- alpha*-*-*)
- TARGET=ALPHA; TARGETDIR=alpha;
- # Support 128-bit long double, changeable via command-line switch.
- HAVE_LONG_DOUBLE='defined(__LONG_DOUBLE_128__)'
- ;;
-
- arc*-*-*)
- TARGET=ARC; TARGETDIR=arc
- ;;
-
- arm*-*-*)
- TARGET=ARM; TARGETDIR=arm
- ;;
-
- amd64-*-freebsd* | amd64-*-openbsd*)
- TARGET=X86_64; TARGETDIR=x86
- ;;
-
- amd64-*-freebsd*)
- TARGET=X86_64; TARGETDIR=x86
- ;;
-
- amd64-*-freebsd*)
- TARGET=X86_64; TARGETDIR=x86
- ;;
-
- avr32*-*-*)
- TARGET=AVR32; TARGETDIR=avr32
- ;;
-
- bfin*)
- TARGET=BFIN; TARGETDIR=bfin
- ;;
-
- cris-*-*)
- TARGET=LIBFFI_CRIS; TARGETDIR=cris
- ;;
-
- frv-*-*)
- TARGET=FRV; TARGETDIR=frv
- ;;
-
- hppa*-*-linux* | parisc*-*-linux* | hppa*-*-openbsd*)
- TARGET=PA_LINUX; TARGETDIR=pa
- ;;
- hppa*64-*-hpux*)
- TARGET=PA64_HPUX; TARGETDIR=pa
- ;;
- hppa*-*-hpux*)
- TARGET=PA_HPUX; TARGETDIR=pa
- ;;
-
- i?86-*-freebsd* | i?86-*-openbsd*)
- TARGET=X86_FREEBSD; TARGETDIR=x86
- ;;
- i?86-win32* | i?86-*-cygwin* | i?86-*-mingw* | i?86-*-os2* | i?86-*-interix*)
- TARGET=X86_WIN32; TARGETDIR=x86
- # All mingw/cygwin/win32 builds require -no-undefined for sharedlib.
- # We must also check with_cross_host to decide if this is a native
- # or cross-build and select where to install dlls appropriately.
- if test -n "$with_cross_host" &&
- test x"$with_cross_host" != x"no"; then
- AM_LTLDFLAGS='-no-undefined -bindir "$(toolexeclibdir)"';
- else
- AM_LTLDFLAGS='-no-undefined -bindir "$(bindir)"';
- fi
- ;;
- i*86-*-nto-qnx*)
- TARGET=X86; TARGETDIR=x86
- ;;
- i?86-*-darwin*)
- TARGET=X86_DARWIN; TARGETDIR=x86
- ;;
- i?86-*-solaris2.1[[0-9]]*)
- TARGETDIR=x86
- if test $ac_cv_sizeof_size_t = 4; then
- TARGET=X86;
- else
- TARGET=X86_64;
- fi
- ;;
-
- x86_64-*-darwin*)
- TARGET=X86_DARWIN; TARGETDIR=x86
- ;;
-
- x86_64-*-cygwin* | x86_64-*-mingw*)
- TARGET=X86_WIN64; TARGETDIR=x86
- # All mingw/cygwin/win32 builds require -no-undefined for sharedlib.
- # We must also check with_cross_host to decide if this is a native
- # or cross-build and select where to install dlls appropriately.
- if test -n "$with_cross_host" &&
- test x"$with_cross_host" != x"no"; then
- AM_LTLDFLAGS='-no-undefined -bindir "$(toolexeclibdir)"';
- else
- AM_LTLDFLAGS='-no-undefined -bindir "$(bindir)"';
- fi
- ;;
-
- i?86-*-* | x86_64-*-*)
- TARGETDIR=x86
- if test $ac_cv_sizeof_size_t = 4; then
- case "$host" in
- *-gnux32)
- TARGET=X86_64
- ;;
- *)
- TARGET=X86
- ;;
- esac
- else
- TARGET=X86_64;
- fi
- ;;
-
- ia64*-*-*)
- TARGET=IA64; TARGETDIR=ia64
- ;;
-
- m32r*-*-*)
- TARGET=M32R; TARGETDIR=m32r
- ;;
-
- m68k-*-*)
- TARGET=M68K; TARGETDIR=m68k
- ;;
-
- m88k-*-*)
- TARGET=M88K; TARGETDIR=m88k
- ;;
-
- microblaze*-*-*)
- TARGET=MICROBLAZE; TARGETDIR=microblaze
- ;;
-
- moxie-*-*)
- TARGET=MOXIE; TARGETDIR=moxie
- ;;
-
- metag-*-*)
- TARGET=METAG; TARGETDIR=metag
- ;;
-
- mips-sgi-irix5.* | mips-sgi-irix6.* | mips*-*-rtems*)
- TARGET=MIPS_IRIX; TARGETDIR=mips
- ;;
- mips*-*linux* | mips*-*-openbsd*)
- # Support 128-bit long double for NewABI.
- HAVE_LONG_DOUBLE='defined(__mips64)'
- TARGET=MIPS_LINUX; TARGETDIR=mips
- ;;
-
- nios2*-linux*)
- TARGET=NIOS2; TARGETDIR=nios2
- ;;
-
- powerpc*-*-linux* | powerpc-*-sysv*)
- TARGET=POWERPC; TARGETDIR=powerpc
- HAVE_LONG_DOUBLE_VARIANT=1
- ;;
- powerpc-*-amigaos*)
- TARGET=POWERPC; TARGETDIR=powerpc
- ;;
- powerpc-*-beos*)
- TARGET=POWERPC; TARGETDIR=powerpc
- ;;
- powerpc-*-darwin* | powerpc64-*-darwin*)
- TARGET=POWERPC_DARWIN; TARGETDIR=powerpc
- ;;
- powerpc-*-aix* | rs6000-*-aix*)
- TARGET=POWERPC_AIX; TARGETDIR=powerpc
- ;;
- powerpc-*-freebsd* | powerpc-*-openbsd*)
- TARGET=POWERPC_FREEBSD; TARGETDIR=powerpc
- HAVE_LONG_DOUBLE_VARIANT=1
- ;;
- powerpc64-*-freebsd*)
- TARGET=POWERPC; TARGETDIR=powerpc
- ;;
- powerpc*-*-rtems*)
- TARGET=POWERPC; TARGETDIR=powerpc
- ;;
-
- s390-*-* | s390x-*-*)
- TARGET=S390; TARGETDIR=s390
- ;;
-
- sh-*-* | sh[[34]]*-*-*)
- TARGET=SH; TARGETDIR=sh
- ;;
- sh64-*-* | sh5*-*-*)
- TARGET=SH64; TARGETDIR=sh64
- ;;
-
- sparc*-*-*)
- TARGET=SPARC; TARGETDIR=sparc
- ;;
-
- tile*-*)
- TARGET=TILE; TARGETDIR=tile
- ;;
-
- vax-*-*)
- TARGET=VAX; TARGETDIR=vax
- ;;
-
- xtensa*-*)
- TARGET=XTENSA; TARGETDIR=xtensa
- ;;
-
-esac
-
-AC_SUBST(AM_RUNTESTFLAGS)
-AC_SUBST(AM_LTLDFLAGS)
-
-if test $TARGETDIR = unknown; then
- AC_MSG_ERROR(["libffi has not been ported to $host."])
-fi
-
-AM_CONDITIONAL(MIPS,[expr x$TARGET : 'xMIPS' > /dev/null])
-AM_CONDITIONAL(BFIN, test x$TARGET = xBFIN)
-AM_CONDITIONAL(SPARC, test x$TARGET = xSPARC)
-AM_CONDITIONAL(X86, test x$TARGET = xX86)
-AM_CONDITIONAL(X86_FREEBSD, test x$TARGET = xX86_FREEBSD)
-AM_CONDITIONAL(X86_WIN32, test x$TARGET = xX86_WIN32)
-AM_CONDITIONAL(X86_WIN64, test x$TARGET = xX86_WIN64)
-AM_CONDITIONAL(X86_DARWIN, test x$TARGET = xX86_DARWIN)
-AM_CONDITIONAL(X86_DARWIN32, test x$TARGET = xX86_DARWIN && test $ac_cv_sizeof_size_t = 4)
-AM_CONDITIONAL(X86_DARWIN64, test x$TARGET = xX86_DARWIN && test $ac_cv_sizeof_size_t = 8)
-AM_CONDITIONAL(ALPHA, test x$TARGET = xALPHA)
-AM_CONDITIONAL(IA64, test x$TARGET = xIA64)
-AM_CONDITIONAL(M32R, test x$TARGET = xM32R)
-AM_CONDITIONAL(M68K, test x$TARGET = xM68K)
-AM_CONDITIONAL(M88K, test x$TARGET = xM88K)
-AM_CONDITIONAL(MICROBLAZE, test x$TARGET = xMICROBLAZE)
-AM_CONDITIONAL(METAG, test x$TARGET = xMETAG)
-AM_CONDITIONAL(MOXIE, test x$TARGET = xMOXIE)
-AM_CONDITIONAL(NIOS2, test x$TARGET = xNIOS2)
-AM_CONDITIONAL(POWERPC, test x$TARGET = xPOWERPC)
-AM_CONDITIONAL(POWERPC_AIX, test x$TARGET = xPOWERPC_AIX)
-AM_CONDITIONAL(POWERPC_DARWIN, test x$TARGET = xPOWERPC_DARWIN)
-AM_CONDITIONAL(POWERPC_FREEBSD, test x$TARGET = xPOWERPC_FREEBSD)
-AM_CONDITIONAL(AARCH64, test x$TARGET = xAARCH64)
-AM_CONDITIONAL(ARC, test x$TARGET = xARC)
-AM_CONDITIONAL(ARM, test x$TARGET = xARM)
-AM_CONDITIONAL(AVR32, test x$TARGET = xAVR32)
-AM_CONDITIONAL(LIBFFI_CRIS, test x$TARGET = xLIBFFI_CRIS)
-AM_CONDITIONAL(FRV, test x$TARGET = xFRV)
-AM_CONDITIONAL(S390, test x$TARGET = xS390)
-AM_CONDITIONAL(X86_64, test x$TARGET = xX86_64)
-AM_CONDITIONAL(SH, test x$TARGET = xSH)
-AM_CONDITIONAL(SH64, test x$TARGET = xSH64)
-AM_CONDITIONAL(PA_LINUX, test x$TARGET = xPA_LINUX)
-AM_CONDITIONAL(PA_HPUX, test x$TARGET = xPA_HPUX)
-AM_CONDITIONAL(PA64_HPUX, test x$TARGET = xPA64_HPUX)
-AM_CONDITIONAL(TILE, test x$TARGET = xTILE)
-AM_CONDITIONAL(VAX, test x$TARGET = xVAX)
-AM_CONDITIONAL(XTENSA, test x$TARGET = xXTENSA)
-
-AC_HEADER_STDC
-AC_CHECK_FUNCS(memcpy)
-AC_FUNC_ALLOCA
-
-AC_CHECK_SIZEOF(double)
-AC_CHECK_SIZEOF(long double)
-
-# Also AC_SUBST this variable for ffi.h.
-if test -z "$HAVE_LONG_DOUBLE"; then
- HAVE_LONG_DOUBLE=0
- if test $ac_cv_sizeof_long_double != 0; then
- if test $HAVE_LONG_DOUBLE_VARIANT != 0; then
- AC_DEFINE(HAVE_LONG_DOUBLE_VARIANT, 1, [Define if you support more than one size of the long double type])
- HAVE_LONG_DOUBLE=1
- else
- if test $ac_cv_sizeof_double != $ac_cv_sizeof_long_double; then
- HAVE_LONG_DOUBLE=1
- AC_DEFINE(HAVE_LONG_DOUBLE, 1, [Define if you have the long double type and it is bigger than a double])
- fi
- fi
- fi
-fi
-AC_SUBST(HAVE_LONG_DOUBLE)
-AC_SUBST(HAVE_LONG_DOUBLE_VARIANT)
-
-AC_C_BIGENDIAN
-
-GCC_AS_CFI_PSEUDO_OP
-
-if test x$TARGET = xSPARC; then
- AC_CACHE_CHECK([assembler and linker support unaligned pc related relocs],
- libffi_cv_as_sparc_ua_pcrel, [
- save_CFLAGS="$CFLAGS"
- save_LDFLAGS="$LDFLAGS"
- CFLAGS="$CFLAGS -fpic"
- LDFLAGS="$LDFLAGS -shared"
- AC_TRY_LINK([asm (".text; foo: nop; .data; .align 4; .byte 0; .uaword %r_disp32(foo); .text");],,
- [libffi_cv_as_sparc_ua_pcrel=yes],
- [libffi_cv_as_sparc_ua_pcrel=no])
- CFLAGS="$save_CFLAGS"
- LDFLAGS="$save_LDFLAGS"])
- if test "x$libffi_cv_as_sparc_ua_pcrel" = xyes; then
- AC_DEFINE(HAVE_AS_SPARC_UA_PCREL, 1,
- [Define if your assembler and linker support unaligned PC relative relocs.])
- fi
-
- AC_CACHE_CHECK([assembler .register pseudo-op support],
- libffi_cv_as_register_pseudo_op, [
- libffi_cv_as_register_pseudo_op=unknown
- # Check if we have .register
- AC_TRY_COMPILE(,[asm (".register %g2, #scratch");],
- [libffi_cv_as_register_pseudo_op=yes],
- [libffi_cv_as_register_pseudo_op=no])
- ])
- if test "x$libffi_cv_as_register_pseudo_op" = xyes; then
- AC_DEFINE(HAVE_AS_REGISTER_PSEUDO_OP, 1,
- [Define if your assembler supports .register.])
- fi
-fi
-
-if test x$TARGET = xX86 || test x$TARGET = xX86_WIN32 || test x$TARGET = xX86_64; then
- AC_CACHE_CHECK([assembler supports pc related relocs],
- libffi_cv_as_x86_pcrel, [
- libffi_cv_as_x86_pcrel=no
- echo '.text; foo: nop; .data; .long foo-.; .text' > conftest.s
- if $CC $CFLAGS -c conftest.s > /dev/null 2>&1; then
- libffi_cv_as_x86_pcrel=yes
- fi
- ])
- if test "x$libffi_cv_as_x86_pcrel" = xyes; then
- AC_DEFINE(HAVE_AS_X86_PCREL, 1,
- [Define if your assembler supports PC relative relocs.])
- fi
-
- AC_CACHE_CHECK([assembler .ascii pseudo-op support],
- libffi_cv_as_ascii_pseudo_op, [
- libffi_cv_as_ascii_pseudo_op=unknown
- # Check if we have .ascii
- AC_TRY_COMPILE(,[asm (".ascii \\"string\\"");],
- [libffi_cv_as_ascii_pseudo_op=yes],
- [libffi_cv_as_ascii_pseudo_op=no])
- ])
- if test "x$libffi_cv_as_ascii_pseudo_op" = xyes; then
- AC_DEFINE(HAVE_AS_ASCII_PSEUDO_OP, 1,
- [Define if your assembler supports .ascii.])
- fi
-
- AC_CACHE_CHECK([assembler .string pseudo-op support],
- libffi_cv_as_string_pseudo_op, [
- libffi_cv_as_string_pseudo_op=unknown
- # Check if we have .string
- AC_TRY_COMPILE(,[asm (".string \\"string\\"");],
- [libffi_cv_as_string_pseudo_op=yes],
- [libffi_cv_as_string_pseudo_op=no])
- ])
- if test "x$libffi_cv_as_string_pseudo_op" = xyes; then
- AC_DEFINE(HAVE_AS_STRING_PSEUDO_OP, 1,
- [Define if your assembler supports .string.])
- fi
-fi
-
-# On PaX enable kernels that have MPROTECT enable we can't use PROT_EXEC.
-AC_ARG_ENABLE(pax_emutramp,
- [ --enable-pax_emutramp enable pax emulated trampolines, for we can't use PROT_EXEC],
- if test "$enable_pax_emutramp" = "yes"; then
- AC_DEFINE(FFI_MMAP_EXEC_EMUTRAMP_PAX, 1,
- [Define this if you want to enable pax emulated trampolines])
- fi)
-
-LT_SYS_SYMBOL_USCORE
-if test "x$sys_symbol_underscore" = xyes; then
- AC_DEFINE(SYMBOL_UNDERSCORE, 1, [Define if symbols are underscored.])
-fi
-
-FFI_EXEC_TRAMPOLINE_TABLE=0
-case "$target" in
- *arm*-apple-darwin*)
- FFI_EXEC_TRAMPOLINE_TABLE=1
- AC_DEFINE(FFI_EXEC_TRAMPOLINE_TABLE, 1,
- [Cannot use PROT_EXEC on this target, so, we revert to
- alternative means])
- ;;
- *-apple-darwin1* | *-*-freebsd* | *-*-kfreebsd* | *-*-openbsd* | *-pc-solaris*)
- AC_DEFINE(FFI_MMAP_EXEC_WRIT, 1,
- [Cannot use malloc on this target, so, we revert to
- alternative means])
- ;;
-esac
-AM_CONDITIONAL(FFI_EXEC_TRAMPOLINE_TABLE, test x$FFI_EXEC_TRAMPOLINE_TABLE = x1)
-AC_SUBST(FFI_EXEC_TRAMPOLINE_TABLE)
-
-if test x$TARGET = xX86_64; then
- AC_CACHE_CHECK([toolchain supports unwind section type],
- libffi_cv_as_x86_64_unwind_section_type, [
- cat > conftest1.s << EOF
-.text
-.globl foo
-foo:
-jmp bar
-.section .eh_frame,"a",@unwind
-bar:
-EOF
-
- cat > conftest2.c << EOF
-extern void foo();
-int main(){foo();}
-EOF
-
- libffi_cv_as_x86_64_unwind_section_type=no
- # we ensure that we can compile _and_ link an assembly file containing an @unwind section
- # since the compiler can support it and not the linker (ie old binutils)
- if $CC -Wa,--fatal-warnings $CFLAGS -c conftest1.s > /dev/null 2>&1 && \
- $CC conftest2.c conftest1.o > /dev/null 2>&1 ; then
- libffi_cv_as_x86_64_unwind_section_type=yes
- fi
- ])
- if test "x$libffi_cv_as_x86_64_unwind_section_type" = xyes; then
- AC_DEFINE(HAVE_AS_X86_64_UNWIND_SECTION_TYPE, 1,
- [Define if your assembler supports unwind section type.])
- fi
-fi
-
-if test "x$GCC" = "xyes"; then
- AC_CACHE_CHECK([whether .eh_frame section should be read-only],
- libffi_cv_ro_eh_frame, [
- libffi_cv_ro_eh_frame=no
- echo 'extern void foo (void); void bar (void) { foo (); foo (); }' > conftest.c
- if $CC $CFLAGS -c -fpic -fexceptions -o conftest.o conftest.c > /dev/null 2>&1; then
- objdump -h conftest.o > conftest.dump 2>&1
- libffi_eh_frame_line=`grep -n eh_frame conftest.dump | cut -d: -f 1`
- libffi_test_line=`expr $libffi_eh_frame_line + 1`p
- sed -n $libffi_test_line conftest.dump > conftest.line
- if grep READONLY conftest.line > /dev/null; then
- libffi_cv_ro_eh_frame=yes
- fi
- fi
- rm -f conftest.*
- ])
- if test "x$libffi_cv_ro_eh_frame" = xyes; then
- AC_DEFINE(HAVE_RO_EH_FRAME, 1,
- [Define if .eh_frame sections should be read-only.])
- AC_DEFINE(EH_FRAME_FLAGS, "a",
- [Define to the flags needed for the .section .eh_frame directive. ])
- else
- AC_DEFINE(EH_FRAME_FLAGS, "aw",
- [Define to the flags needed for the .section .eh_frame directive. ])
- fi
-
- AC_CACHE_CHECK([for __attribute__((visibility("hidden")))],
- libffi_cv_hidden_visibility_attribute, [
- echo 'int __attribute__ ((visibility ("hidden"))) foo (void) { return 1 ; }' > conftest.c
- libffi_cv_hidden_visibility_attribute=no
- if AC_TRY_COMMAND(${CC-cc} -Werror -S conftest.c -o conftest.s 1>&AS_MESSAGE_LOG_FD); then
- if grep '\.hidden.*foo' conftest.s >/dev/null; then
- libffi_cv_hidden_visibility_attribute=yes
- fi
- fi
- rm -f conftest.*
- ])
- if test $libffi_cv_hidden_visibility_attribute = yes; then
- AC_DEFINE(HAVE_HIDDEN_VISIBILITY_ATTRIBUTE, 1,
- [Define if __attribute__((visibility("hidden"))) is supported.])
- fi
-fi
-
-AH_BOTTOM([
-#ifdef HAVE_HIDDEN_VISIBILITY_ATTRIBUTE
-#ifdef LIBFFI_ASM
-#define FFI_HIDDEN(name) .hidden name
-#else
-#define FFI_HIDDEN __attribute__ ((visibility ("hidden")))
-#endif
-#else
-#ifdef LIBFFI_ASM
-#define FFI_HIDDEN(name)
-#else
-#define FFI_HIDDEN
-#endif
-#endif
-])
-
-AC_SUBST(TARGET)
-AC_SUBST(TARGETDIR)
-
-AC_SUBST(SHELL)
-
-AC_ARG_ENABLE(debug,
-[ --enable-debug debugging mode],
- if test "$enable_debug" = "yes"; then
- AC_DEFINE(FFI_DEBUG, 1, [Define this if you want extra debugging.])
- fi)
-AM_CONDITIONAL(FFI_DEBUG, test "$enable_debug" = "yes")
-
-AC_ARG_ENABLE(structs,
-[ --disable-structs omit code for struct support],
- if test "$enable_structs" = "no"; then
- AC_DEFINE(FFI_NO_STRUCTS, 1, [Define this if you do not want support for aggregate types.])
- fi)
-AM_CONDITIONAL(FFI_DEBUG, test "$enable_debug" = "yes")
-
-AC_ARG_ENABLE(raw-api,
-[ --disable-raw-api make the raw api unavailable],
- if test "$enable_raw_api" = "no"; then
- AC_DEFINE(FFI_NO_RAW_API, 1, [Define this if you do not want support for the raw API.])
- fi)
-
-AC_ARG_ENABLE(purify-safety,
-[ --enable-purify-safety purify-safe mode],
- if test "$enable_purify_safety" = "yes"; then
- AC_DEFINE(USING_PURIFY, 1, [Define this if you are using Purify and want to suppress spurious messages.])
- fi)
-
-# These variables are only ever used when we cross-build to X86_WIN32.
-# And we only support this with GCC, so...
-if test "x$GCC" = "xyes"; then
- if test -n "$with_cross_host" &&
- test x"$with_cross_host" != x"no"; then
- toolexecdir='$(exec_prefix)/$(target_alias)'
- toolexeclibdir='$(toolexecdir)/lib'
- else
- toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
- toolexeclibdir='$(libdir)'
- fi
- multi_os_directory=`$CC $CFLAGS -print-multi-os-directory`
- case $multi_os_directory in
- .) ;; # Avoid trailing /.
- ../*) toolexeclibdir=$toolexeclibdir/$multi_os_directory ;;
- esac
- AC_SUBST(toolexecdir)
-else
- toolexeclibdir='$(libdir)'
-fi
-AC_SUBST(toolexeclibdir)
-
-AC_CONFIG_COMMANDS(include, [test -d include || mkdir include])
-AC_CONFIG_COMMANDS(src, [
-test -d src || mkdir src
-test -d src/$TARGETDIR || mkdir src/$TARGETDIR
-], [TARGETDIR="$TARGETDIR"])
-
-AC_CONFIG_LINKS(include/ffitarget.h:src/$TARGETDIR/ffitarget.h)
-
-AC_CONFIG_FILES(include/Makefile include/ffi.h Makefile testsuite/Makefile man/Makefile libffi.pc)
-
-AC_CONFIG_LINKS(include/ffi_common.h:include/ffi_common.h)
-
-AC_CONFIG_FILES(fficonfig.py)
-
-AC_OUTPUT
diff --git a/Modules/_ctypes/libffi/depcomp b/Modules/_ctypes/libffi/depcomp
deleted file mode 100755
index 4ebd5b3a2f..0000000000
--- a/Modules/_ctypes/libffi/depcomp
+++ /dev/null
@@ -1,791 +0,0 @@
-#! /bin/sh
-# depcomp - compile a program generating dependencies as side-effects
-
-scriptversion=2013-05-30.07; # UTC
-
-# Copyright (C) 1999-2013 Free Software Foundation, Inc.
-
-# 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, 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, see <http://www.gnu.org/licenses/>.
-
-# 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 Alexandre Oliva <oliva@dcc.unicamp.br>.
-
-case $1 in
- '')
- echo "$0: No command. Try '$0 --help' for more information." 1>&2
- exit 1;
- ;;
- -h | --h*)
- cat <<\EOF
-Usage: depcomp [--help] [--version] PROGRAM [ARGS]
-
-Run PROGRAMS ARGS to compile a file, generating dependencies
-as side-effects.
-
-Environment variables:
- depmode Dependency tracking mode.
- source Source file read by 'PROGRAMS ARGS'.
- object Object file output by 'PROGRAMS ARGS'.
- DEPDIR directory where to store dependencies.
- depfile Dependency file to output.
- tmpdepfile Temporary file to use when outputting dependencies.
- libtool Whether libtool is used (yes/no).
-
-Report bugs to <bug-automake@gnu.org>.
-EOF
- exit $?
- ;;
- -v | --v*)
- echo "depcomp $scriptversion"
- exit $?
- ;;
-esac
-
-# Get the directory component of the given path, and save it in the
-# global variables '$dir'. Note that this directory component will
-# be either empty or ending with a '/' character. This is deliberate.
-set_dir_from ()
-{
- case $1 in
- */*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;;
- *) dir=;;
- esac
-}
-
-# Get the suffix-stripped basename of the given path, and save it the
-# global variable '$base'.
-set_base_from ()
-{
- base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'`
-}
-
-# If no dependency file was actually created by the compiler invocation,
-# we still have to create a dummy depfile, to avoid errors with the
-# Makefile "include basename.Plo" scheme.
-make_dummy_depfile ()
-{
- echo "#dummy" > "$depfile"
-}
-
-# Factor out some common post-processing of the generated depfile.
-# Requires the auxiliary global variable '$tmpdepfile' to be set.
-aix_post_process_depfile ()
-{
- # If the compiler actually managed to produce a dependency file,
- # post-process it.
- if test -f "$tmpdepfile"; then
- # Each line is of the form 'foo.o: dependency.h'.
- # Do two passes, one to just change these to
- # $object: dependency.h
- # and one to simply output
- # dependency.h:
- # which is needed to avoid the deleted-header problem.
- { sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile"
- sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile"
- } > "$depfile"
- rm -f "$tmpdepfile"
- else
- make_dummy_depfile
- fi
-}
-
-# A tabulation character.
-tab=' '
-# A newline character.
-nl='
-'
-# Character ranges might be problematic outside the C locale.
-# These definitions help.
-upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ
-lower=abcdefghijklmnopqrstuvwxyz
-digits=0123456789
-alpha=${upper}${lower}
-
-if test -z "$depmode" || test -z "$source" || test -z "$object"; then
- echo "depcomp: Variables source, object and depmode must be set" 1>&2
- exit 1
-fi
-
-# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
-depfile=${depfile-`echo "$object" |
- sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
-tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
-
-rm -f "$tmpdepfile"
-
-# Avoid interferences from the environment.
-gccflag= dashmflag=
-
-# Some modes work just like other modes, but use different flags. We
-# parameterize here, but still list the modes in the big case below,
-# to make depend.m4 easier to write. Note that we *cannot* use a case
-# here, because this file can only contain one case statement.
-if test "$depmode" = hp; then
- # HP compiler uses -M and no extra arg.
- gccflag=-M
- depmode=gcc
-fi
-
-if test "$depmode" = dashXmstdout; then
- # This is just like dashmstdout with a different argument.
- dashmflag=-xM
- depmode=dashmstdout
-fi
-
-cygpath_u="cygpath -u -f -"
-if test "$depmode" = msvcmsys; then
- # This is just like msvisualcpp but w/o cygpath translation.
- # Just convert the backslash-escaped backslashes to single forward
- # slashes to satisfy depend.m4
- cygpath_u='sed s,\\\\,/,g'
- depmode=msvisualcpp
-fi
-
-if test "$depmode" = msvc7msys; then
- # This is just like msvc7 but w/o cygpath translation.
- # Just convert the backslash-escaped backslashes to single forward
- # slashes to satisfy depend.m4
- cygpath_u='sed s,\\\\,/,g'
- depmode=msvc7
-fi
-
-if test "$depmode" = xlc; then
- # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information.
- gccflag=-qmakedep=gcc,-MF
- depmode=gcc
-fi
-
-case "$depmode" in
-gcc3)
-## gcc 3 implements dependency tracking that does exactly what
-## we want. Yay! Note: for some reason libtool 1.4 doesn't like
-## it if -MD -MP comes after the -MF stuff. Hmm.
-## Unfortunately, FreeBSD c89 acceptance of flags depends upon
-## the command line argument order; so add the flags where they
-## appear in depend2.am. Note that the slowdown incurred here
-## affects only configure: in makefiles, %FASTDEP% shortcuts this.
- for arg
- do
- case $arg in
- -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;
- *) set fnord "$@" "$arg" ;;
- esac
- shift # fnord
- shift # $arg
- done
- "$@"
- stat=$?
- if test $stat -ne 0; then
- rm -f "$tmpdepfile"
- exit $stat
- fi
- mv "$tmpdepfile" "$depfile"
- ;;
-
-gcc)
-## Note that this doesn't just cater to obsosete pre-3.x GCC compilers.
-## but also to in-use compilers like IMB xlc/xlC and the HP C compiler.
-## (see the conditional assignment to $gccflag above).
-## There are various ways to get dependency output from gcc. Here's
-## why we pick this rather obscure method:
-## - Don't want to use -MD because we'd like the dependencies to end
-## up in a subdir. Having to rename by hand is ugly.
-## (We might end up doing this anyway to support other compilers.)
-## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
-## -MM, not -M (despite what the docs say). Also, it might not be
-## supported by the other compilers which use the 'gcc' depmode.
-## - Using -M directly means running the compiler twice (even worse
-## than renaming).
- if test -z "$gccflag"; then
- gccflag=-MD,
- fi
- "$@" -Wp,"$gccflag$tmpdepfile"
- stat=$?
- if test $stat -ne 0; then
- rm -f "$tmpdepfile"
- exit $stat
- fi
- rm -f "$depfile"
- echo "$object : \\" > "$depfile"
- # The second -e expression handles DOS-style file names with drive
- # letters.
- sed -e 's/^[^:]*: / /' \
- -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
-## This next piece of magic avoids the "deleted header file" problem.
-## The problem is that when a header file which appears in a .P file
-## is deleted, the dependency causes make to die (because there is
-## typically no way to rebuild the header). We avoid this by adding
-## dummy dependencies for each header file. Too bad gcc doesn't do
-## this for us directly.
-## Some versions of gcc put a space before the ':'. On the theory
-## that the space means something, we add a space to the output as
-## well. hp depmode also adds that space, but also prefixes the VPATH
-## to the object. Take care to not repeat it in the output.
-## Some versions of the HPUX 10.20 sed can't process this invocation
-## correctly. Breaking it into two sed invocations is a workaround.
- tr ' ' "$nl" < "$tmpdepfile" \
- | sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \
- | sed -e 's/$/ :/' >> "$depfile"
- rm -f "$tmpdepfile"
- ;;
-
-hp)
- # This case exists only to let depend.m4 do its work. It works by
- # looking at the text of this script. This case will never be run,
- # since it is checked for above.
- exit 1
- ;;
-
-sgi)
- if test "$libtool" = yes; then
- "$@" "-Wp,-MDupdate,$tmpdepfile"
- else
- "$@" -MDupdate "$tmpdepfile"
- fi
- stat=$?
- if test $stat -ne 0; then
- rm -f "$tmpdepfile"
- exit $stat
- fi
- rm -f "$depfile"
-
- if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
- echo "$object : \\" > "$depfile"
- # Clip off the initial element (the dependent). Don't try to be
- # clever and replace this with sed code, as IRIX sed won't handle
- # lines with more than a fixed number of characters (4096 in
- # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines;
- # the IRIX cc adds comments like '#:fec' to the end of the
- # dependency line.
- tr ' ' "$nl" < "$tmpdepfile" \
- | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \
- | tr "$nl" ' ' >> "$depfile"
- echo >> "$depfile"
- # The second pass generates a dummy entry for each header file.
- tr ' ' "$nl" < "$tmpdepfile" \
- | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
- >> "$depfile"
- else
- make_dummy_depfile
- fi
- rm -f "$tmpdepfile"
- ;;
-
-xlc)
- # This case exists only to let depend.m4 do its work. It works by
- # looking at the text of this script. This case will never be run,
- # since it is checked for above.
- exit 1
- ;;
-
-aix)
- # The C for AIX Compiler uses -M and outputs the dependencies
- # in a .u file. In older versions, this file always lives in the
- # current directory. Also, the AIX compiler puts '$object:' at the
- # start of each line; $object doesn't have directory information.
- # Version 6 uses the directory in both cases.
- set_dir_from "$object"
- set_base_from "$object"
- if test "$libtool" = yes; then
- tmpdepfile1=$dir$base.u
- tmpdepfile2=$base.u
- tmpdepfile3=$dir.libs/$base.u
- "$@" -Wc,-M
- else
- tmpdepfile1=$dir$base.u
- tmpdepfile2=$dir$base.u
- tmpdepfile3=$dir$base.u
- "$@" -M
- fi
- stat=$?
- if test $stat -ne 0; then
- rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
- exit $stat
- fi
-
- for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
- do
- test -f "$tmpdepfile" && break
- done
- aix_post_process_depfile
- ;;
-
-tcc)
- # tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26
- # FIXME: That version still under development at the moment of writing.
- # Make that this statement remains true also for stable, released
- # versions.
- # It will wrap lines (doesn't matter whether long or short) with a
- # trailing '\', as in:
- #
- # foo.o : \
- # foo.c \
- # foo.h \
- #
- # It will put a trailing '\' even on the last line, and will use leading
- # spaces rather than leading tabs (at least since its commit 0394caf7
- # "Emit spaces for -MD").
- "$@" -MD -MF "$tmpdepfile"
- stat=$?
- if test $stat -ne 0; then
- rm -f "$tmpdepfile"
- exit $stat
- fi
- rm -f "$depfile"
- # Each non-empty line is of the form 'foo.o : \' or ' dep.h \'.
- # We have to change lines of the first kind to '$object: \'.
- sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile"
- # And for each line of the second kind, we have to emit a 'dep.h:'
- # dummy dependency, to avoid the deleted-header problem.
- sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile"
- rm -f "$tmpdepfile"
- ;;
-
-## The order of this option in the case statement is important, since the
-## shell code in configure will try each of these formats in the order
-## listed in this file. A plain '-MD' option would be understood by many
-## compilers, so we must ensure this comes after the gcc and icc options.
-pgcc)
- # Portland's C compiler understands '-MD'.
- # Will always output deps to 'file.d' where file is the root name of the
- # source file under compilation, even if file resides in a subdirectory.
- # The object file name does not affect the name of the '.d' file.
- # pgcc 10.2 will output
- # foo.o: sub/foo.c sub/foo.h
- # and will wrap long lines using '\' :
- # foo.o: sub/foo.c ... \
- # sub/foo.h ... \
- # ...
- set_dir_from "$object"
- # Use the source, not the object, to determine the base name, since
- # that's sadly what pgcc will do too.
- set_base_from "$source"
- tmpdepfile=$base.d
-
- # For projects that build the same source file twice into different object
- # files, the pgcc approach of using the *source* file root name can cause
- # problems in parallel builds. Use a locking strategy to avoid stomping on
- # the same $tmpdepfile.
- lockdir=$base.d-lock
- trap "
- echo '$0: caught signal, cleaning up...' >&2
- rmdir '$lockdir'
- exit 1
- " 1 2 13 15
- numtries=100
- i=$numtries
- while test $i -gt 0; do
- # mkdir is a portable test-and-set.
- if mkdir "$lockdir" 2>/dev/null; then
- # This process acquired the lock.
- "$@" -MD
- stat=$?
- # Release the lock.
- rmdir "$lockdir"
- break
- else
- # If the lock is being held by a different process, wait
- # until the winning process is done or we timeout.
- while test -d "$lockdir" && test $i -gt 0; do
- sleep 1
- i=`expr $i - 1`
- done
- fi
- i=`expr $i - 1`
- done
- trap - 1 2 13 15
- if test $i -le 0; then
- echo "$0: failed to acquire lock after $numtries attempts" >&2
- echo "$0: check lockdir '$lockdir'" >&2
- exit 1
- fi
-
- if test $stat -ne 0; then
- rm -f "$tmpdepfile"
- exit $stat
- fi
- rm -f "$depfile"
- # Each line is of the form `foo.o: dependent.h',
- # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
- # Do two passes, one to just change these to
- # `$object: dependent.h' and one to simply `dependent.h:'.
- sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
- # Some versions of the HPUX 10.20 sed can't process this invocation
- # correctly. Breaking it into two sed invocations is a workaround.
- sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \
- | sed -e 's/$/ :/' >> "$depfile"
- rm -f "$tmpdepfile"
- ;;
-
-hp2)
- # The "hp" stanza above does not work with aCC (C++) and HP's ia64
- # compilers, which have integrated preprocessors. The correct option
- # to use with these is +Maked; it writes dependencies to a file named
- # 'foo.d', which lands next to the object file, wherever that
- # happens to be.
- # Much of this is similar to the tru64 case; see comments there.
- set_dir_from "$object"
- set_base_from "$object"
- if test "$libtool" = yes; then
- tmpdepfile1=$dir$base.d
- tmpdepfile2=$dir.libs/$base.d
- "$@" -Wc,+Maked
- else
- tmpdepfile1=$dir$base.d
- tmpdepfile2=$dir$base.d
- "$@" +Maked
- fi
- stat=$?
- if test $stat -ne 0; then
- rm -f "$tmpdepfile1" "$tmpdepfile2"
- exit $stat
- fi
-
- for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2"
- do
- test -f "$tmpdepfile" && break
- done
- if test -f "$tmpdepfile"; then
- sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile"
- # Add 'dependent.h:' lines.
- sed -ne '2,${
- s/^ *//
- s/ \\*$//
- s/$/:/
- p
- }' "$tmpdepfile" >> "$depfile"
- else
- make_dummy_depfile
- fi
- rm -f "$tmpdepfile" "$tmpdepfile2"
- ;;
-
-tru64)
- # The Tru64 compiler uses -MD to generate dependencies as a side
- # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'.
- # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
- # dependencies in 'foo.d' instead, so we check for that too.
- # Subdirectories are respected.
- set_dir_from "$object"
- set_base_from "$object"
-
- if test "$libtool" = yes; then
- # Libtool generates 2 separate objects for the 2 libraries. These
- # two compilations output dependencies in $dir.libs/$base.o.d and
- # in $dir$base.o.d. We have to check for both files, because
- # one of the two compilations can be disabled. We should prefer
- # $dir$base.o.d over $dir.libs/$base.o.d because the latter is
- # automatically cleaned when .libs/ is deleted, while ignoring
- # the former would cause a distcleancheck panic.
- tmpdepfile1=$dir$base.o.d # libtool 1.5
- tmpdepfile2=$dir.libs/$base.o.d # Likewise.
- tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504
- "$@" -Wc,-MD
- else
- tmpdepfile1=$dir$base.d
- tmpdepfile2=$dir$base.d
- tmpdepfile3=$dir$base.d
- "$@" -MD
- fi
-
- stat=$?
- if test $stat -ne 0; then
- rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
- exit $stat
- fi
-
- for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
- do
- test -f "$tmpdepfile" && break
- done
- # Same post-processing that is required for AIX mode.
- aix_post_process_depfile
- ;;
-
-msvc7)
- if test "$libtool" = yes; then
- showIncludes=-Wc,-showIncludes
- else
- showIncludes=-showIncludes
- fi
- "$@" $showIncludes > "$tmpdepfile"
- stat=$?
- grep -v '^Note: including file: ' "$tmpdepfile"
- if test $stat -ne 0; then
- rm -f "$tmpdepfile"
- exit $stat
- fi
- rm -f "$depfile"
- echo "$object : \\" > "$depfile"
- # The first sed program below extracts the file names and escapes
- # backslashes for cygpath. The second sed program outputs the file
- # name when reading, but also accumulates all include files in the
- # hold buffer in order to output them again at the end. This only
- # works with sed implementations that can handle large buffers.
- sed < "$tmpdepfile" -n '
-/^Note: including file: *\(.*\)/ {
- s//\1/
- s/\\/\\\\/g
- p
-}' | $cygpath_u | sort -u | sed -n '
-s/ /\\ /g
-s/\(.*\)/'"$tab"'\1 \\/p
-s/.\(.*\) \\/\1:/
-H
-$ {
- s/.*/'"$tab"'/
- G
- p
-}' >> "$depfile"
- echo >> "$depfile" # make sure the fragment doesn't end with a backslash
- rm -f "$tmpdepfile"
- ;;
-
-msvc7msys)
- # This case exists only to let depend.m4 do its work. It works by
- # looking at the text of this script. This case will never be run,
- # since it is checked for above.
- exit 1
- ;;
-
-#nosideeffect)
- # This comment above is used by automake to tell side-effect
- # dependency tracking mechanisms from slower ones.
-
-dashmstdout)
- # Important note: in order to support this mode, a compiler *must*
- # always write the preprocessed file to stdout, regardless of -o.
- "$@" || exit $?
-
- # Remove the call to Libtool.
- if test "$libtool" = yes; then
- while test "X$1" != 'X--mode=compile'; do
- shift
- done
- shift
- fi
-
- # Remove '-o $object'.
- IFS=" "
- for arg
- do
- case $arg in
- -o)
- shift
- ;;
- $object)
- shift
- ;;
- *)
- set fnord "$@" "$arg"
- shift # fnord
- shift # $arg
- ;;
- esac
- done
-
- test -z "$dashmflag" && dashmflag=-M
- # Require at least two characters before searching for ':'
- # in the target name. This is to cope with DOS-style filenames:
- # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise.
- "$@" $dashmflag |
- sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile"
- rm -f "$depfile"
- cat < "$tmpdepfile" > "$depfile"
- # Some versions of the HPUX 10.20 sed can't process this sed invocation
- # correctly. Breaking it into two sed invocations is a workaround.
- tr ' ' "$nl" < "$tmpdepfile" \
- | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \
- | sed -e 's/$/ :/' >> "$depfile"
- rm -f "$tmpdepfile"
- ;;
-
-dashXmstdout)
- # This case only exists to satisfy depend.m4. It is never actually
- # run, as this mode is specially recognized in the preamble.
- exit 1
- ;;
-
-makedepend)
- "$@" || exit $?
- # Remove any Libtool call
- if test "$libtool" = yes; then
- while test "X$1" != 'X--mode=compile'; do
- shift
- done
- shift
- fi
- # X makedepend
- shift
- cleared=no eat=no
- for arg
- do
- case $cleared in
- no)
- set ""; shift
- cleared=yes ;;
- esac
- if test $eat = yes; then
- eat=no
- continue
- fi
- case "$arg" in
- -D*|-I*)
- set fnord "$@" "$arg"; shift ;;
- # Strip any option that makedepend may not understand. Remove
- # the object too, otherwise makedepend will parse it as a source file.
- -arch)
- eat=yes ;;
- -*|$object)
- ;;
- *)
- set fnord "$@" "$arg"; shift ;;
- esac
- done
- obj_suffix=`echo "$object" | sed 's/^.*\././'`
- touch "$tmpdepfile"
- ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
- rm -f "$depfile"
- # makedepend may prepend the VPATH from the source file name to the object.
- # No need to regex-escape $object, excess matching of '.' is harmless.
- sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile"
- # Some versions of the HPUX 10.20 sed can't process the last invocation
- # correctly. Breaking it into two sed invocations is a workaround.
- sed '1,2d' "$tmpdepfile" \
- | tr ' ' "$nl" \
- | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \
- | sed -e 's/$/ :/' >> "$depfile"
- rm -f "$tmpdepfile" "$tmpdepfile".bak
- ;;
-
-cpp)
- # Important note: in order to support this mode, a compiler *must*
- # always write the preprocessed file to stdout.
- "$@" || exit $?
-
- # Remove the call to Libtool.
- if test "$libtool" = yes; then
- while test "X$1" != 'X--mode=compile'; do
- shift
- done
- shift
- fi
-
- # Remove '-o $object'.
- IFS=" "
- for arg
- do
- case $arg in
- -o)
- shift
- ;;
- $object)
- shift
- ;;
- *)
- set fnord "$@" "$arg"
- shift # fnord
- shift # $arg
- ;;
- esac
- done
-
- "$@" -E \
- | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
- -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
- | sed '$ s: \\$::' > "$tmpdepfile"
- rm -f "$depfile"
- echo "$object : \\" > "$depfile"
- cat < "$tmpdepfile" >> "$depfile"
- sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
- rm -f "$tmpdepfile"
- ;;
-
-msvisualcpp)
- # Important note: in order to support this mode, a compiler *must*
- # always write the preprocessed file to stdout.
- "$@" || exit $?
-
- # Remove the call to Libtool.
- if test "$libtool" = yes; then
- while test "X$1" != 'X--mode=compile'; do
- shift
- done
- shift
- fi
-
- IFS=" "
- for arg
- do
- case "$arg" in
- -o)
- shift
- ;;
- $object)
- shift
- ;;
- "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
- set fnord "$@"
- shift
- shift
- ;;
- *)
- set fnord "$@" "$arg"
- shift
- shift
- ;;
- esac
- done
- "$@" -E 2>/dev/null |
- sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile"
- rm -f "$depfile"
- echo "$object : \\" > "$depfile"
- sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile"
- echo "$tab" >> "$depfile"
- sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile"
- rm -f "$tmpdepfile"
- ;;
-
-msvcmsys)
- # This case exists only to let depend.m4 do its work. It works by
- # looking at the text of this script. This case will never be run,
- # since it is checked for above.
- exit 1
- ;;
-
-none)
- exec "$@"
- ;;
-
-*)
- echo "Unknown depmode $depmode" 1>&2
- exit 1
- ;;
-esac
-
-exit 0
-
-# Local Variables:
-# mode: shell-script
-# sh-indentation: 2
-# eval: (add-hook 'write-file-hooks 'time-stamp)
-# time-stamp-start: "scriptversion="
-# time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-time-zone: "UTC"
-# time-stamp-end: "; # UTC"
-# End:
diff --git a/Modules/_ctypes/libffi/doc/libffi.info b/Modules/_ctypes/libffi/doc/libffi.info
deleted file mode 100644
index 3990939473..0000000000
--- a/Modules/_ctypes/libffi/doc/libffi.info
+++ /dev/null
@@ -1,618 +0,0 @@
-This is libffi.info, produced by makeinfo version 5.1 from libffi.texi.
-
-This manual is for Libffi, a portable foreign-function interface
-library.
-
- Copyright (C) 2008, 2010, 2011 Red Hat, Inc.
-
- Permission is granted to copy, distribute and/or modify this
- document under the terms of the GNU General Public License as
- published by the Free Software Foundation; either version 2, or (at
- your option) any later version. A copy of the license is included
- in the section entitled "GNU General Public License".
-
-INFO-DIR-SECTION Development
-START-INFO-DIR-ENTRY
-* libffi: (libffi). Portable foreign-function interface library.
-END-INFO-DIR-ENTRY
-
-
-File: libffi.info, Node: Top, Next: Introduction, Up: (dir)
-
-libffi
-******
-
-This manual is for Libffi, a portable foreign-function interface
-library.
-
- Copyright (C) 2008, 2010, 2011 Red Hat, Inc.
-
- Permission is granted to copy, distribute and/or modify this
- document under the terms of the GNU General Public License as
- published by the Free Software Foundation; either version 2, or (at
- your option) any later version. A copy of the license is included
- in the section entitled "GNU General Public License".
-
-* Menu:
-
-* Introduction:: What is libffi?
-* Using libffi:: How to use libffi.
-* Missing Features:: Things libffi can't do.
-* Index:: Index.
-
-
-File: libffi.info, Node: Introduction, Next: Using libffi, Prev: Top, Up: Top
-
-1 What is libffi?
-*****************
-
-Compilers for high level languages generate code that follow certain
-conventions. These conventions are necessary, in part, for separate
-compilation to work. One such convention is the "calling convention".
-The calling convention is a set of assumptions made by the compiler
-about where function arguments will be found on entry to a function. A
-calling convention also specifies where the return value for a function
-is found. The calling convention is also sometimes called the "ABI" or
-"Application Binary Interface".
-
- Some programs may not know at the time of compilation what arguments
-are to be passed to a function. For instance, an interpreter may be
-told at run-time about the number and types of arguments used to call a
-given function. 'Libffi' can be used in such programs to provide a
-bridge from the interpreter program to compiled code.
-
- The 'libffi' library provides a portable, high level programming
-interface to various calling conventions. This allows a programmer to
-call any function specified by a call interface description at run time.
-
- FFI stands for Foreign Function Interface. A foreign function
-interface is the popular name for the interface that allows code written
-in one language to call code written in another language. The 'libffi'
-library really only provides the lowest, machine dependent layer of a
-fully featured foreign function interface. A layer must exist above
-'libffi' that handles type conversions for values passed between the two
-languages.
-
-
-File: libffi.info, Node: Using libffi, Next: Missing Features, Prev: Introduction, Up: Top
-
-2 Using libffi
-**************
-
-* Menu:
-
-* The Basics:: The basic libffi API.
-* Simple Example:: A simple example.
-* Types:: libffi type descriptions.
-* Multiple ABIs:: Different passing styles on one platform.
-* The Closure API:: Writing a generic function.
-* Closure Example:: A closure example.
-
-
-File: libffi.info, Node: The Basics, Next: Simple Example, Up: Using libffi
-
-2.1 The Basics
-==============
-
-'Libffi' assumes that you have a pointer to the function you wish to
-call and that you know the number and types of arguments to pass it, as
-well as the return type of the function.
-
- The first thing you must do is create an 'ffi_cif' object that
-matches the signature of the function you wish to call. This is a
-separate step because it is common to make multiple calls using a single
-'ffi_cif'. The "cif" in 'ffi_cif' stands for Call InterFace. To
-prepare a call interface object, use the function 'ffi_prep_cif'.
-
- -- Function: ffi_status ffi_prep_cif (ffi_cif *CIF, ffi_abi ABI,
- unsigned int NARGS, ffi_type *RTYPE, ffi_type **ARGTYPES)
- This initializes CIF according to the given parameters.
-
- ABI is the ABI to use; normally 'FFI_DEFAULT_ABI' is what you want.
- *note Multiple ABIs:: for more information.
-
- NARGS is the number of arguments that this function accepts.
-
- RTYPE is a pointer to an 'ffi_type' structure that describes the
- return type of the function. *Note Types::.
-
- ARGTYPES is a vector of 'ffi_type' pointers. ARGTYPES must have
- NARGS elements. If NARGS is 0, this argument is ignored.
-
- 'ffi_prep_cif' returns a 'libffi' status code, of type
- 'ffi_status'. This will be either 'FFI_OK' if everything worked
- properly; 'FFI_BAD_TYPEDEF' if one of the 'ffi_type' objects is
- incorrect; or 'FFI_BAD_ABI' if the ABI parameter is invalid.
-
- If the function being called is variadic (varargs) then
-'ffi_prep_cif_var' must be used instead of 'ffi_prep_cif'.
-
- -- Function: ffi_status ffi_prep_cif_var (ffi_cif *CIF, ffi_abi varabi,
- unsigned int NFIXEDARGS, unsigned int varntotalargs, ffi_type
- *RTYPE, ffi_type **ARGTYPES)
- This initializes CIF according to the given parameters for a call
- to a variadic function. In general it's operation is the same as
- for 'ffi_prep_cif' except that:
-
- NFIXEDARGS is the number of fixed arguments, prior to any variadic
- arguments. It must be greater than zero.
-
- NTOTALARGS the total number of arguments, including variadic and
- fixed arguments.
-
- Note that, different cif's must be prepped for calls to the same
- function when different numbers of arguments are passed.
-
- Also note that a call to 'ffi_prep_cif_var' with
- NFIXEDARGS=NOTOTALARGS is NOT equivalent to a call to
- 'ffi_prep_cif'.
-
- To call a function using an initialized 'ffi_cif', use the 'ffi_call'
-function:
-
- -- Function: void ffi_call (ffi_cif *CIF, void *FN, void *RVALUE, void
- **AVALUES)
- This calls the function FN according to the description given in
- CIF. CIF must have already been prepared using 'ffi_prep_cif'.
-
- RVALUE is a pointer to a chunk of memory that will hold the result
- of the function call. This must be large enough to hold the
- result, no smaller than the system register size (generally 32 or
- 64 bits), and must be suitably aligned; it is the caller's
- responsibility to ensure this. If CIF declares that the function
- returns 'void' (using 'ffi_type_void'), then RVALUE is ignored.
-
- AVALUES is a vector of 'void *' pointers that point to the memory
- locations holding the argument values for a call. If CIF declares
- that the function has no arguments (i.e., NARGS was 0), then
- AVALUES is ignored. Note that argument values may be modified by
- the callee (for instance, structs passed by value); the burden of
- copying pass-by-value arguments is placed on the caller.
-
-
-File: libffi.info, Node: Simple Example, Next: Types, Prev: The Basics, Up: Using libffi
-
-2.2 Simple Example
-==================
-
-Here is a trivial example that calls 'puts' a few times.
-
- #include <stdio.h>
- #include <ffi.h>
-
- int main()
- {
- ffi_cif cif;
- ffi_type *args[1];
- void *values[1];
- char *s;
- ffi_arg rc;
-
- /* Initialize the argument info vectors */
- args[0] = &ffi_type_pointer;
- values[0] = &s;
-
- /* Initialize the cif */
- if (ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1,
- &ffi_type_sint, args) == FFI_OK)
- {
- s = "Hello World!";
- ffi_call(&cif, puts, &rc, values);
- /* rc now holds the result of the call to puts */
-
- /* values holds a pointer to the function's arg, so to
- call puts() again all we need to do is change the
- value of s */
- s = "This is cool!";
- ffi_call(&cif, puts, &rc, values);
- }
-
- return 0;
- }
-
-
-File: libffi.info, Node: Types, Next: Multiple ABIs, Prev: Simple Example, Up: Using libffi
-
-2.3 Types
-=========
-
-* Menu:
-
-* Primitive Types:: Built-in types.
-* Structures:: Structure types.
-* Type Example:: Structure type example.
-
-
-File: libffi.info, Node: Primitive Types, Next: Structures, Up: Types
-
-2.3.1 Primitive Types
----------------------
-
-'Libffi' provides a number of built-in type descriptors that can be used
-to describe argument and return types:
-
-'ffi_type_void'
- The type 'void'. This cannot be used for argument types, only for
- return values.
-
-'ffi_type_uint8'
- An unsigned, 8-bit integer type.
-
-'ffi_type_sint8'
- A signed, 8-bit integer type.
-
-'ffi_type_uint16'
- An unsigned, 16-bit integer type.
-
-'ffi_type_sint16'
- A signed, 16-bit integer type.
-
-'ffi_type_uint32'
- An unsigned, 32-bit integer type.
-
-'ffi_type_sint32'
- A signed, 32-bit integer type.
-
-'ffi_type_uint64'
- An unsigned, 64-bit integer type.
-
-'ffi_type_sint64'
- A signed, 64-bit integer type.
-
-'ffi_type_float'
- The C 'float' type.
-
-'ffi_type_double'
- The C 'double' type.
-
-'ffi_type_uchar'
- The C 'unsigned char' type.
-
-'ffi_type_schar'
- The C 'signed char' type. (Note that there is not an exact
- equivalent to the C 'char' type in 'libffi'; ordinarily you should
- either use 'ffi_type_schar' or 'ffi_type_uchar' depending on
- whether 'char' is signed.)
-
-'ffi_type_ushort'
- The C 'unsigned short' type.
-
-'ffi_type_sshort'
- The C 'short' type.
-
-'ffi_type_uint'
- The C 'unsigned int' type.
-
-'ffi_type_sint'
- The C 'int' type.
-
-'ffi_type_ulong'
- The C 'unsigned long' type.
-
-'ffi_type_slong'
- The C 'long' type.
-
-'ffi_type_longdouble'
- On platforms that have a C 'long double' type, this is defined. On
- other platforms, it is not.
-
-'ffi_type_pointer'
- A generic 'void *' pointer. You should use this for all pointers,
- regardless of their real type.
-
- Each of these is of type 'ffi_type', so you must take the address
-when passing to 'ffi_prep_cif'.
-
-
-File: libffi.info, Node: Structures, Next: Type Example, Prev: Primitive Types, Up: Types
-
-2.3.2 Structures
-----------------
-
-Although 'libffi' has no special support for unions or bit-fields, it is
-perfectly happy passing structures back and forth. You must first
-describe the structure to 'libffi' by creating a new 'ffi_type' object
-for it.
-
- -- Data type: ffi_type
- The 'ffi_type' has the following members:
- 'size_t size'
- This is set by 'libffi'; you should initialize it to zero.
-
- 'unsigned short alignment'
- This is set by 'libffi'; you should initialize it to zero.
-
- 'unsigned short type'
- For a structure, this should be set to 'FFI_TYPE_STRUCT'.
-
- 'ffi_type **elements'
- This is a 'NULL'-terminated array of pointers to 'ffi_type'
- objects. There is one element per field of the struct.
-
-
-File: libffi.info, Node: Type Example, Prev: Structures, Up: Types
-
-2.3.3 Type Example
-------------------
-
-The following example initializes a 'ffi_type' object representing the
-'tm' struct from Linux's 'time.h'.
-
- Here is how the struct is defined:
-
- struct tm {
- int tm_sec;
- int tm_min;
- int tm_hour;
- int tm_mday;
- int tm_mon;
- int tm_year;
- int tm_wday;
- int tm_yday;
- int tm_isdst;
- /* Those are for future use. */
- long int __tm_gmtoff__;
- __const char *__tm_zone__;
- };
-
- Here is the corresponding code to describe this struct to 'libffi':
-
- {
- ffi_type tm_type;
- ffi_type *tm_type_elements[12];
- int i;
-
- tm_type.size = tm_type.alignment = 0;
- tm_type.type = FFI_TYPE_STRUCT;
- tm_type.elements = &tm_type_elements;
-
- for (i = 0; i < 9; i++)
- tm_type_elements[i] = &ffi_type_sint;
-
- tm_type_elements[9] = &ffi_type_slong;
- tm_type_elements[10] = &ffi_type_pointer;
- tm_type_elements[11] = NULL;
-
- /* tm_type can now be used to represent tm argument types and
- return types for ffi_prep_cif() */
- }
-
-
-File: libffi.info, Node: Multiple ABIs, Next: The Closure API, Prev: Types, Up: Using libffi
-
-2.4 Multiple ABIs
-=================
-
-A given platform may provide multiple different ABIs at once. For
-instance, the x86 platform has both 'stdcall' and 'fastcall' functions.
-
- 'libffi' provides some support for this. However, this is
-necessarily platform-specific.
-
-
-File: libffi.info, Node: The Closure API, Next: Closure Example, Prev: Multiple ABIs, Up: Using libffi
-
-2.5 The Closure API
-===================
-
-'libffi' also provides a way to write a generic function - a function
-that can accept and decode any combination of arguments. This can be
-useful when writing an interpreter, or to provide wrappers for arbitrary
-functions.
-
- This facility is called the "closure API". Closures are not supported
-on all platforms; you can check the 'FFI_CLOSURES' define to determine
-whether they are supported on the current platform.
-
- Because closures work by assembling a tiny function at runtime, they
-require special allocation on platforms that have a non-executable heap.
-Memory management for closures is handled by a pair of functions:
-
- -- Function: void *ffi_closure_alloc (size_t SIZE, void **CODE)
- Allocate a chunk of memory holding SIZE bytes. This returns a
- pointer to the writable address, and sets *CODE to the
- corresponding executable address.
-
- SIZE should be sufficient to hold a 'ffi_closure' object.
-
- -- Function: void ffi_closure_free (void *WRITABLE)
- Free memory allocated using 'ffi_closure_alloc'. The argument is
- the writable address that was returned.
-
- Once you have allocated the memory for a closure, you must construct
-a 'ffi_cif' describing the function call. Finally you can prepare the
-closure function:
-
- -- Function: ffi_status ffi_prep_closure_loc (ffi_closure *CLOSURE,
- ffi_cif *CIF, void (*FUN) (ffi_cif *CIF, void *RET, void
- **ARGS, void *USER_DATA), void *USER_DATA, void *CODELOC)
- Prepare a closure function.
-
- CLOSURE is the address of a 'ffi_closure' object; this is the
- writable address returned by 'ffi_closure_alloc'.
-
- CIF is the 'ffi_cif' describing the function parameters.
-
- USER_DATA is an arbitrary datum that is passed, uninterpreted, to
- your closure function.
-
- CODELOC is the executable address returned by 'ffi_closure_alloc'.
-
- FUN is the function which will be called when the closure is
- invoked. It is called with the arguments:
- CIF
- The 'ffi_cif' passed to 'ffi_prep_closure_loc'.
-
- RET
- A pointer to the memory used for the function's return value.
- FUN must fill this, unless the function is declared as
- returning 'void'.
-
- ARGS
- A vector of pointers to memory holding the arguments to the
- function.
-
- USER_DATA
- The same USER_DATA that was passed to 'ffi_prep_closure_loc'.
-
- 'ffi_prep_closure_loc' will return 'FFI_OK' if everything went ok,
- and something else on error.
-
- After calling 'ffi_prep_closure_loc', you can cast CODELOC to the
- appropriate pointer-to-function type.
-
- You may see old code referring to 'ffi_prep_closure'. This function
-is deprecated, as it cannot handle the need for separate writable and
-executable addresses.
-
-
-File: libffi.info, Node: Closure Example, Prev: The Closure API, Up: Using libffi
-
-2.6 Closure Example
-===================
-
-A trivial example that creates a new 'puts' by binding 'fputs' with
-'stdout'.
-
- #include <stdio.h>
- #include <ffi.h>
-
- /* Acts like puts with the file given at time of enclosure. */
- void puts_binding(ffi_cif *cif, void *ret, void* args[],
- void *stream)
- {
- *(ffi_arg *)ret = fputs(*(char **)args[0], (FILE *)stream);
- }
-
- typedef int (*puts_t)(char *);
-
- int main()
- {
- ffi_cif cif;
- ffi_type *args[1];
- ffi_closure *closure;
-
- void *bound_puts;
- int rc;
-
- /* Allocate closure and bound_puts */
- closure = ffi_closure_alloc(sizeof(ffi_closure), &bound_puts);
-
- if (closure)
- {
- /* Initialize the argument info vectors */
- args[0] = &ffi_type_pointer;
-
- /* Initialize the cif */
- if (ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1,
- &ffi_type_sint, args) == FFI_OK)
- {
- /* Initialize the closure, setting stream to stdout */
- if (ffi_prep_closure_loc(closure, &cif, puts_binding,
- stdout, bound_puts) == FFI_OK)
- {
- rc = ((puts_t)bound_puts)("Hello World!");
- /* rc now holds the result of the call to fputs */
- }
- }
- }
-
- /* Deallocate both closure, and bound_puts */
- ffi_closure_free(closure);
-
- return 0;
- }
-
-
-File: libffi.info, Node: Missing Features, Next: Index, Prev: Using libffi, Up: Top
-
-3 Missing Features
-******************
-
-'libffi' is missing a few features. We welcome patches to add support
-for these.
-
- * Variadic closures.
-
- * There is no support for bit fields in structures.
-
- * The closure API is
-
- * The "raw" API is undocumented.
-
- Note that variadic support is very new and tested on a relatively
-small number of platforms.
-
-
-File: libffi.info, Node: Index, Prev: Missing Features, Up: Top
-
-Index
-*****
-
-
-* Menu:
-
-* ABI: Introduction. (line 13)
-* Application Binary Interface: Introduction. (line 13)
-* calling convention: Introduction. (line 13)
-* cif: The Basics. (line 14)
-* closure API: The Closure API. (line 13)
-* closures: The Closure API. (line 13)
-* FFI: Introduction. (line 31)
-* ffi_call: The Basics. (line 62)
-* FFI_CLOSURES: The Closure API. (line 13)
-* ffi_closure_alloc: The Closure API. (line 19)
-* ffi_closure_free: The Closure API. (line 26)
-* ffi_prep_cif: The Basics. (line 16)
-* ffi_prep_cif_var: The Basics. (line 39)
-* ffi_prep_closure_loc: The Closure API. (line 34)
-* ffi_status: The Basics. (line 16)
-* ffi_status <1>: The Basics. (line 39)
-* ffi_status <2>: The Closure API. (line 34)
-* ffi_type: Structures. (line 11)
-* ffi_type <1>: Structures. (line 11)
-* ffi_type_double: Primitive Types. (line 41)
-* ffi_type_float: Primitive Types. (line 38)
-* ffi_type_longdouble: Primitive Types. (line 71)
-* ffi_type_pointer: Primitive Types. (line 75)
-* ffi_type_schar: Primitive Types. (line 47)
-* ffi_type_sint: Primitive Types. (line 62)
-* ffi_type_sint16: Primitive Types. (line 23)
-* ffi_type_sint32: Primitive Types. (line 29)
-* ffi_type_sint64: Primitive Types. (line 35)
-* ffi_type_sint8: Primitive Types. (line 17)
-* ffi_type_slong: Primitive Types. (line 68)
-* ffi_type_sshort: Primitive Types. (line 56)
-* ffi_type_uchar: Primitive Types. (line 44)
-* ffi_type_uint: Primitive Types. (line 59)
-* ffi_type_uint16: Primitive Types. (line 20)
-* ffi_type_uint32: Primitive Types. (line 26)
-* ffi_type_uint64: Primitive Types. (line 32)
-* ffi_type_uint8: Primitive Types. (line 14)
-* ffi_type_ulong: Primitive Types. (line 65)
-* ffi_type_ushort: Primitive Types. (line 53)
-* ffi_type_void: Primitive Types. (line 10)
-* Foreign Function Interface: Introduction. (line 31)
-* void: The Basics. (line 62)
-* void <1>: The Closure API. (line 19)
-* void <2>: The Closure API. (line 26)
-
-
-
-Tag Table:
-Node: Top682
-Node: Introduction1429
-Node: Using libffi3061
-Node: The Basics3547
-Node: Simple Example7198
-Node: Types8229
-Node: Primitive Types8512
-Node: Structures10333
-Node: Type Example11207
-Node: Multiple ABIs12473
-Node: The Closure API12844
-Node: Closure Example15788
-Node: Missing Features17397
-Node: Index17850
-
-End Tag Table
diff --git a/Modules/_ctypes/libffi/doc/libffi.texi b/Modules/_ctypes/libffi/doc/libffi.texi
deleted file mode 100644
index a2b1242802..0000000000
--- a/Modules/_ctypes/libffi/doc/libffi.texi
+++ /dev/null
@@ -1,625 +0,0 @@
-\input texinfo @c -*-texinfo-*-
-@c %**start of header
-@setfilename libffi.info
-@settitle libffi
-@setchapternewpage off
-@c %**end of header
-
-@c Merge the standard indexes into a single one.
-@syncodeindex fn cp
-@syncodeindex vr cp
-@syncodeindex ky cp
-@syncodeindex pg cp
-@syncodeindex tp cp
-
-@include version.texi
-
-@copying
-
-This manual is for Libffi, a portable foreign-function interface
-library.
-
-Copyright @copyright{} 2008, 2010, 2011 Red Hat, Inc.
-
-@quotation
-Permission is granted to copy, distribute and/or modify this document
-under the terms of the GNU General Public License as published by the
-Free Software Foundation; either version 2, or (at your option) any
-later version. A copy of the license is included in the
-section entitled ``GNU General Public License''.
-
-@end quotation
-@end copying
-
-@dircategory Development
-@direntry
-* libffi: (libffi). Portable foreign-function interface library.
-@end direntry
-
-@titlepage
-@title Libffi
-@page
-@vskip 0pt plus 1filll
-@insertcopying
-@end titlepage
-
-
-@ifnottex
-@node Top
-@top libffi
-
-@insertcopying
-
-@menu
-* Introduction:: What is libffi?
-* Using libffi:: How to use libffi.
-* Missing Features:: Things libffi can't do.
-* Index:: Index.
-@end menu
-
-@end ifnottex
-
-
-@node Introduction
-@chapter What is libffi?
-
-Compilers for high level languages generate code that follow certain
-conventions. These conventions are necessary, in part, for separate
-compilation to work. One such convention is the @dfn{calling
-convention}. The calling convention is a set of assumptions made by
-the compiler about where function arguments will be found on entry to
-a function. A calling convention also specifies where the return
-value for a function is found. The calling convention is also
-sometimes called the @dfn{ABI} or @dfn{Application Binary Interface}.
-@cindex calling convention
-@cindex ABI
-@cindex Application Binary Interface
-
-Some programs may not know at the time of compilation what arguments
-are to be passed to a function. For instance, an interpreter may be
-told at run-time about the number and types of arguments used to call
-a given function. @samp{Libffi} can be used in such programs to
-provide a bridge from the interpreter program to compiled code.
-
-The @samp{libffi} library provides a portable, high level programming
-interface to various calling conventions. This allows a programmer to
-call any function specified by a call interface description at run
-time.
-
-@acronym{FFI} stands for Foreign Function Interface. A foreign
-function interface is the popular name for the interface that allows
-code written in one language to call code written in another language.
-The @samp{libffi} library really only provides the lowest, machine
-dependent layer of a fully featured foreign function interface. A
-layer must exist above @samp{libffi} that handles type conversions for
-values passed between the two languages.
-@cindex FFI
-@cindex Foreign Function Interface
-
-
-@node Using libffi
-@chapter Using libffi
-
-@menu
-* The Basics:: The basic libffi API.
-* Simple Example:: A simple example.
-* Types:: libffi type descriptions.
-* Multiple ABIs:: Different passing styles on one platform.
-* The Closure API:: Writing a generic function.
-* Closure Example:: A closure example.
-@end menu
-
-
-@node The Basics
-@section The Basics
-
-@samp{Libffi} assumes that you have a pointer to the function you wish
-to call and that you know the number and types of arguments to pass
-it, as well as the return type of the function.
-
-The first thing you must do is create an @code{ffi_cif} object that
-matches the signature of the function you wish to call. This is a
-separate step because it is common to make multiple calls using a
-single @code{ffi_cif}. The @dfn{cif} in @code{ffi_cif} stands for
-Call InterFace. To prepare a call interface object, use the function
-@code{ffi_prep_cif}.
-@cindex cif
-
-@findex ffi_prep_cif
-@defun ffi_status ffi_prep_cif (ffi_cif *@var{cif}, ffi_abi @var{abi}, unsigned int @var{nargs}, ffi_type *@var{rtype}, ffi_type **@var{argtypes})
-This initializes @var{cif} according to the given parameters.
-
-@var{abi} is the ABI to use; normally @code{FFI_DEFAULT_ABI} is what
-you want. @ref{Multiple ABIs} for more information.
-
-@var{nargs} is the number of arguments that this function accepts.
-
-@var{rtype} is a pointer to an @code{ffi_type} structure that
-describes the return type of the function. @xref{Types}.
-
-@var{argtypes} is a vector of @code{ffi_type} pointers.
-@var{argtypes} must have @var{nargs} elements. If @var{nargs} is 0,
-this argument is ignored.
-
-@code{ffi_prep_cif} returns a @code{libffi} status code, of type
-@code{ffi_status}. This will be either @code{FFI_OK} if everything
-worked properly; @code{FFI_BAD_TYPEDEF} if one of the @code{ffi_type}
-objects is incorrect; or @code{FFI_BAD_ABI} if the @var{abi} parameter
-is invalid.
-@end defun
-
-If the function being called is variadic (varargs) then
-@code{ffi_prep_cif_var} must be used instead of @code{ffi_prep_cif}.
-
-@findex ffi_prep_cif_var
-@defun ffi_status ffi_prep_cif_var (ffi_cif *@var{cif}, ffi_abi var{abi}, unsigned int @var{nfixedargs}, unsigned int var{ntotalargs}, ffi_type *@var{rtype}, ffi_type **@var{argtypes})
-This initializes @var{cif} according to the given parameters for
-a call to a variadic function. In general it's operation is the
-same as for @code{ffi_prep_cif} except that:
-
-@var{nfixedargs} is the number of fixed arguments, prior to any
-variadic arguments. It must be greater than zero.
-
-@var{ntotalargs} the total number of arguments, including variadic
-and fixed arguments.
-
-Note that, different cif's must be prepped for calls to the same
-function when different numbers of arguments are passed.
-
-Also note that a call to @code{ffi_prep_cif_var} with
-@var{nfixedargs}=@var{nototalargs} is NOT equivalent to a call to
-@code{ffi_prep_cif}.
-
-@end defun
-
-
-To call a function using an initialized @code{ffi_cif}, use the
-@code{ffi_call} function:
-
-@findex ffi_call
-@defun void ffi_call (ffi_cif *@var{cif}, void *@var{fn}, void *@var{rvalue}, void **@var{avalues})
-This calls the function @var{fn} according to the description given in
-@var{cif}. @var{cif} must have already been prepared using
-@code{ffi_prep_cif}.
-
-@var{rvalue} is a pointer to a chunk of memory that will hold the
-result of the function call. This must be large enough to hold the
-result, no smaller than the system register size (generally 32 or 64
-bits), and must be suitably aligned; it is the caller's responsibility
-to ensure this. If @var{cif} declares that the function returns
-@code{void} (using @code{ffi_type_void}), then @var{rvalue} is
-ignored.
-
-@var{avalues} is a vector of @code{void *} pointers that point to the
-memory locations holding the argument values for a call. If @var{cif}
-declares that the function has no arguments (i.e., @var{nargs} was 0),
-then @var{avalues} is ignored. Note that argument values may be
-modified by the callee (for instance, structs passed by value); the
-burden of copying pass-by-value arguments is placed on the caller.
-@end defun
-
-
-@node Simple Example
-@section Simple Example
-
-Here is a trivial example that calls @code{puts} a few times.
-
-@example
-#include <stdio.h>
-#include <ffi.h>
-
-int main()
-@{
- ffi_cif cif;
- ffi_type *args[1];
- void *values[1];
- char *s;
- ffi_arg rc;
-
- /* Initialize the argument info vectors */
- args[0] = &ffi_type_pointer;
- values[0] = &s;
-
- /* Initialize the cif */
- if (ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1,
- &ffi_type_sint, args) == FFI_OK)
- @{
- s = "Hello World!";
- ffi_call(&cif, puts, &rc, values);
- /* rc now holds the result of the call to puts */
-
- /* values holds a pointer to the function's arg, so to
- call puts() again all we need to do is change the
- value of s */
- s = "This is cool!";
- ffi_call(&cif, puts, &rc, values);
- @}
-
- return 0;
-@}
-@end example
-
-
-@node Types
-@section Types
-
-@menu
-* Primitive Types:: Built-in types.
-* Structures:: Structure types.
-* Type Example:: Structure type example.
-@end menu
-
-@node Primitive Types
-@subsection Primitive Types
-
-@code{Libffi} provides a number of built-in type descriptors that can
-be used to describe argument and return types:
-
-@table @code
-@item ffi_type_void
-@tindex ffi_type_void
-The type @code{void}. This cannot be used for argument types, only
-for return values.
-
-@item ffi_type_uint8
-@tindex ffi_type_uint8
-An unsigned, 8-bit integer type.
-
-@item ffi_type_sint8
-@tindex ffi_type_sint8
-A signed, 8-bit integer type.
-
-@item ffi_type_uint16
-@tindex ffi_type_uint16
-An unsigned, 16-bit integer type.
-
-@item ffi_type_sint16
-@tindex ffi_type_sint16
-A signed, 16-bit integer type.
-
-@item ffi_type_uint32
-@tindex ffi_type_uint32
-An unsigned, 32-bit integer type.
-
-@item ffi_type_sint32
-@tindex ffi_type_sint32
-A signed, 32-bit integer type.
-
-@item ffi_type_uint64
-@tindex ffi_type_uint64
-An unsigned, 64-bit integer type.
-
-@item ffi_type_sint64
-@tindex ffi_type_sint64
-A signed, 64-bit integer type.
-
-@item ffi_type_float
-@tindex ffi_type_float
-The C @code{float} type.
-
-@item ffi_type_double
-@tindex ffi_type_double
-The C @code{double} type.
-
-@item ffi_type_uchar
-@tindex ffi_type_uchar
-The C @code{unsigned char} type.
-
-@item ffi_type_schar
-@tindex ffi_type_schar
-The C @code{signed char} type. (Note that there is not an exact
-equivalent to the C @code{char} type in @code{libffi}; ordinarily you
-should either use @code{ffi_type_schar} or @code{ffi_type_uchar}
-depending on whether @code{char} is signed.)
-
-@item ffi_type_ushort
-@tindex ffi_type_ushort
-The C @code{unsigned short} type.
-
-@item ffi_type_sshort
-@tindex ffi_type_sshort
-The C @code{short} type.
-
-@item ffi_type_uint
-@tindex ffi_type_uint
-The C @code{unsigned int} type.
-
-@item ffi_type_sint
-@tindex ffi_type_sint
-The C @code{int} type.
-
-@item ffi_type_ulong
-@tindex ffi_type_ulong
-The C @code{unsigned long} type.
-
-@item ffi_type_slong
-@tindex ffi_type_slong
-The C @code{long} type.
-
-@item ffi_type_longdouble
-@tindex ffi_type_longdouble
-On platforms that have a C @code{long double} type, this is defined.
-On other platforms, it is not.
-
-@item ffi_type_pointer
-@tindex ffi_type_pointer
-A generic @code{void *} pointer. You should use this for all
-pointers, regardless of their real type.
-@end table
-
-Each of these is of type @code{ffi_type}, so you must take the address
-when passing to @code{ffi_prep_cif}.
-
-
-@node Structures
-@subsection Structures
-
-Although @samp{libffi} has no special support for unions or
-bit-fields, it is perfectly happy passing structures back and forth.
-You must first describe the structure to @samp{libffi} by creating a
-new @code{ffi_type} object for it.
-
-@tindex ffi_type
-@deftp {Data type} ffi_type
-The @code{ffi_type} has the following members:
-@table @code
-@item size_t size
-This is set by @code{libffi}; you should initialize it to zero.
-
-@item unsigned short alignment
-This is set by @code{libffi}; you should initialize it to zero.
-
-@item unsigned short type
-For a structure, this should be set to @code{FFI_TYPE_STRUCT}.
-
-@item ffi_type **elements
-This is a @samp{NULL}-terminated array of pointers to @code{ffi_type}
-objects. There is one element per field of the struct.
-@end table
-@end deftp
-
-
-@node Type Example
-@subsection Type Example
-
-The following example initializes a @code{ffi_type} object
-representing the @code{tm} struct from Linux's @file{time.h}.
-
-Here is how the struct is defined:
-
-@example
-struct tm @{
- int tm_sec;
- int tm_min;
- int tm_hour;
- int tm_mday;
- int tm_mon;
- int tm_year;
- int tm_wday;
- int tm_yday;
- int tm_isdst;
- /* Those are for future use. */
- long int __tm_gmtoff__;
- __const char *__tm_zone__;
-@};
-@end example
-
-Here is the corresponding code to describe this struct to
-@code{libffi}:
-
-@example
- @{
- ffi_type tm_type;
- ffi_type *tm_type_elements[12];
- int i;
-
- tm_type.size = tm_type.alignment = 0;
- tm_type.type = FFI_TYPE_STRUCT;
- tm_type.elements = &tm_type_elements;
-
- for (i = 0; i < 9; i++)
- tm_type_elements[i] = &ffi_type_sint;
-
- tm_type_elements[9] = &ffi_type_slong;
- tm_type_elements[10] = &ffi_type_pointer;
- tm_type_elements[11] = NULL;
-
- /* tm_type can now be used to represent tm argument types and
- return types for ffi_prep_cif() */
- @}
-@end example
-
-
-@node Multiple ABIs
-@section Multiple ABIs
-
-A given platform may provide multiple different ABIs at once. For
-instance, the x86 platform has both @samp{stdcall} and @samp{fastcall}
-functions.
-
-@code{libffi} provides some support for this. However, this is
-necessarily platform-specific.
-
-@c FIXME: document the platforms
-
-@node The Closure API
-@section The Closure API
-
-@code{libffi} also provides a way to write a generic function -- a
-function that can accept and decode any combination of arguments.
-This can be useful when writing an interpreter, or to provide wrappers
-for arbitrary functions.
-
-This facility is called the @dfn{closure API}. Closures are not
-supported on all platforms; you can check the @code{FFI_CLOSURES}
-define to determine whether they are supported on the current
-platform.
-@cindex closures
-@cindex closure API
-@findex FFI_CLOSURES
-
-Because closures work by assembling a tiny function at runtime, they
-require special allocation on platforms that have a non-executable
-heap. Memory management for closures is handled by a pair of
-functions:
-
-@findex ffi_closure_alloc
-@defun void *ffi_closure_alloc (size_t @var{size}, void **@var{code})
-Allocate a chunk of memory holding @var{size} bytes. This returns a
-pointer to the writable address, and sets *@var{code} to the
-corresponding executable address.
-
-@var{size} should be sufficient to hold a @code{ffi_closure} object.
-@end defun
-
-@findex ffi_closure_free
-@defun void ffi_closure_free (void *@var{writable})
-Free memory allocated using @code{ffi_closure_alloc}. The argument is
-the writable address that was returned.
-@end defun
-
-
-Once you have allocated the memory for a closure, you must construct a
-@code{ffi_cif} describing the function call. Finally you can prepare
-the closure function:
-
-@findex ffi_prep_closure_loc
-@defun ffi_status ffi_prep_closure_loc (ffi_closure *@var{closure}, ffi_cif *@var{cif}, void (*@var{fun}) (ffi_cif *@var{cif}, void *@var{ret}, void **@var{args}, void *@var{user_data}), void *@var{user_data}, void *@var{codeloc})
-Prepare a closure function.
-
-@var{closure} is the address of a @code{ffi_closure} object; this is
-the writable address returned by @code{ffi_closure_alloc}.
-
-@var{cif} is the @code{ffi_cif} describing the function parameters.
-
-@var{user_data} is an arbitrary datum that is passed, uninterpreted,
-to your closure function.
-
-@var{codeloc} is the executable address returned by
-@code{ffi_closure_alloc}.
-
-@var{fun} is the function which will be called when the closure is
-invoked. It is called with the arguments:
-@table @var
-@item cif
-The @code{ffi_cif} passed to @code{ffi_prep_closure_loc}.
-
-@item ret
-A pointer to the memory used for the function's return value.
-@var{fun} must fill this, unless the function is declared as returning
-@code{void}.
-@c FIXME: is this NULL for void-returning functions?
-
-@item args
-A vector of pointers to memory holding the arguments to the function.
-
-@item user_data
-The same @var{user_data} that was passed to
-@code{ffi_prep_closure_loc}.
-@end table
-
-@code{ffi_prep_closure_loc} will return @code{FFI_OK} if everything
-went ok, and something else on error.
-@c FIXME: what?
-
-After calling @code{ffi_prep_closure_loc}, you can cast @var{codeloc}
-to the appropriate pointer-to-function type.
-@end defun
-
-You may see old code referring to @code{ffi_prep_closure}. This
-function is deprecated, as it cannot handle the need for separate
-writable and executable addresses.
-
-@node Closure Example
-@section Closure Example
-
-A trivial example that creates a new @code{puts} by binding
-@code{fputs} with @code{stdout}.
-
-@example
-#include <stdio.h>
-#include <ffi.h>
-
-/* Acts like puts with the file given at time of enclosure. */
-void puts_binding(ffi_cif *cif, void *ret, void* args[],
- void *stream)
-@{
- *(ffi_arg *)ret = fputs(*(char **)args[0], (FILE *)stream);
-@}
-
-typedef int (*puts_t)(char *);
-
-int main()
-@{
- ffi_cif cif;
- ffi_type *args[1];
- ffi_closure *closure;
-
- void *bound_puts;
- int rc;
-
- /* Allocate closure and bound_puts */
- closure = ffi_closure_alloc(sizeof(ffi_closure), &bound_puts);
-
- if (closure)
- @{
- /* Initialize the argument info vectors */
- args[0] = &ffi_type_pointer;
-
- /* Initialize the cif */
- if (ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1,
- &ffi_type_sint, args) == FFI_OK)
- @{
- /* Initialize the closure, setting stream to stdout */
- if (ffi_prep_closure_loc(closure, &cif, puts_binding,
- stdout, bound_puts) == FFI_OK)
- @{
- rc = ((puts_t)bound_puts)("Hello World!");
- /* rc now holds the result of the call to fputs */
- @}
- @}
- @}
-
- /* Deallocate both closure, and bound_puts */
- ffi_closure_free(closure);
-
- return 0;
-@}
-
-@end example
-
-
-@node Missing Features
-@chapter Missing Features
-
-@code{libffi} is missing a few features. We welcome patches to add
-support for these.
-
-@itemize @bullet
-@item
-Variadic closures.
-
-@item
-There is no support for bit fields in structures.
-
-@item
-The closure API is
-
-@c FIXME: ...
-
-@item
-The ``raw'' API is undocumented.
-@c argument promotion?
-@c unions?
-@c anything else?
-@end itemize
-
-Note that variadic support is very new and tested on a relatively
-small number of platforms.
-
-@node Index
-@unnumbered Index
-
-@printindex cp
-
-@bye
diff --git a/Modules/_ctypes/libffi/doc/stamp-vti b/Modules/_ctypes/libffi/doc/stamp-vti
deleted file mode 100644
index 378595332f..0000000000
--- a/Modules/_ctypes/libffi/doc/stamp-vti
+++ /dev/null
@@ -1,4 +0,0 @@
-@set UPDATED 25 April 2014
-@set UPDATED-MONTH April 2014
-@set EDITION 3.1
-@set VERSION 3.1
diff --git a/Modules/_ctypes/libffi/doc/version.texi b/Modules/_ctypes/libffi/doc/version.texi
deleted file mode 100644
index 378595332f..0000000000
--- a/Modules/_ctypes/libffi/doc/version.texi
+++ /dev/null
@@ -1,4 +0,0 @@
-@set UPDATED 25 April 2014
-@set UPDATED-MONTH April 2014
-@set EDITION 3.1
-@set VERSION 3.1
diff --git a/Modules/_ctypes/libffi/fficonfig.h.in b/Modules/_ctypes/libffi/fficonfig.h.in
deleted file mode 100644
index cdef91b88f..0000000000
--- a/Modules/_ctypes/libffi/fficonfig.h.in
+++ /dev/null
@@ -1,210 +0,0 @@
-/* fficonfig.h.in. Generated from configure.ac by autoheader. */
-
-/* Define if building universal (internal helper macro) */
-#undef AC_APPLE_UNIVERSAL_BUILD
-
-/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP
- systems. This function is required for `alloca.c' support on those systems.
- */
-#undef CRAY_STACKSEG_END
-
-/* Define to 1 if using `alloca.c'. */
-#undef C_ALLOCA
-
-/* Define to the flags needed for the .section .eh_frame directive. */
-#undef EH_FRAME_FLAGS
-
-/* Define this if you want extra debugging. */
-#undef FFI_DEBUG
-
-/* Cannot use PROT_EXEC on this target, so, we revert to alternative means */
-#undef FFI_EXEC_TRAMPOLINE_TABLE
-
-/* Define this if you want to enable pax emulated trampolines */
-#undef FFI_MMAP_EXEC_EMUTRAMP_PAX
-
-/* Cannot use malloc on this target, so, we revert to alternative means */
-#undef FFI_MMAP_EXEC_WRIT
-
-/* Define this if you do not want support for the raw API. */
-#undef FFI_NO_RAW_API
-
-/* Define this if you do not want support for aggregate types. */
-#undef FFI_NO_STRUCTS
-
-/* Define to 1 if you have `alloca', as a function or macro. */
-#undef HAVE_ALLOCA
-
-/* Define to 1 if you have <alloca.h> and it should be used (not on Ultrix).
- */
-#undef HAVE_ALLOCA_H
-
-/* Define if your assembler supports .ascii. */
-#undef HAVE_AS_ASCII_PSEUDO_OP
-
-/* Define if your assembler supports .cfi_* directives. */
-#undef HAVE_AS_CFI_PSEUDO_OP
-
-/* Define if your assembler supports .register. */
-#undef HAVE_AS_REGISTER_PSEUDO_OP
-
-/* Define if your assembler and linker support unaligned PC relative relocs.
- */
-#undef HAVE_AS_SPARC_UA_PCREL
-
-/* Define if your assembler supports .string. */
-#undef HAVE_AS_STRING_PSEUDO_OP
-
-/* Define if your assembler supports unwind section type. */
-#undef HAVE_AS_X86_64_UNWIND_SECTION_TYPE
-
-/* Define if your assembler supports PC relative relocs. */
-#undef HAVE_AS_X86_PCREL
-
-/* Define to 1 if you have the <dlfcn.h> header file. */
-#undef HAVE_DLFCN_H
-
-/* Define if __attribute__((visibility("hidden"))) is supported. */
-#undef HAVE_HIDDEN_VISIBILITY_ATTRIBUTE
-
-/* Define to 1 if you have the <inttypes.h> header file. */
-#undef HAVE_INTTYPES_H
-
-/* Define if you have the long double type and it is bigger than a double */
-#undef HAVE_LONG_DOUBLE
-
-/* Define if you support more than one size of the long double type */
-#undef HAVE_LONG_DOUBLE_VARIANT
-
-/* Define to 1 if you have the `memcpy' function. */
-#undef HAVE_MEMCPY
-
-/* Define to 1 if you have the <memory.h> header file. */
-#undef HAVE_MEMORY_H
-
-/* Define to 1 if you have the `mmap' function. */
-#undef HAVE_MMAP
-
-/* Define if mmap with MAP_ANON(YMOUS) works. */
-#undef HAVE_MMAP_ANON
-
-/* Define if mmap of /dev/zero works. */
-#undef HAVE_MMAP_DEV_ZERO
-
-/* Define if read-only mmap of a plain file works. */
-#undef HAVE_MMAP_FILE
-
-/* Define if .eh_frame sections should be read-only. */
-#undef HAVE_RO_EH_FRAME
-
-/* Define to 1 if you have the <stdint.h> header file. */
-#undef HAVE_STDINT_H
-
-/* Define to 1 if you have the <stdlib.h> header file. */
-#undef HAVE_STDLIB_H
-
-/* Define to 1 if you have the <strings.h> header file. */
-#undef HAVE_STRINGS_H
-
-/* Define to 1 if you have the <string.h> header file. */
-#undef HAVE_STRING_H
-
-/* Define to 1 if you have the <sys/mman.h> header file. */
-#undef HAVE_SYS_MMAN_H
-
-/* Define to 1 if you have the <sys/stat.h> header file. */
-#undef HAVE_SYS_STAT_H
-
-/* Define to 1 if you have the <sys/types.h> header file. */
-#undef HAVE_SYS_TYPES_H
-
-/* Define to 1 if you have the <unistd.h> header file. */
-#undef HAVE_UNISTD_H
-
-/* Define to the sub-directory where libtool stores uninstalled libraries. */
-#undef LT_OBJDIR
-
-/* Define to 1 if your C compiler doesn't accept -c and -o together. */
-#undef NO_MINUS_C_MINUS_O
-
-/* Name of package */
-#undef PACKAGE
-
-/* Define to the address where bug reports for this package should be sent. */
-#undef PACKAGE_BUGREPORT
-
-/* Define to the full name of this package. */
-#undef PACKAGE_NAME
-
-/* Define to the full name and version of this package. */
-#undef PACKAGE_STRING
-
-/* Define to the one symbol short name of this package. */
-#undef PACKAGE_TARNAME
-
-/* Define to the home page for this package. */
-#undef PACKAGE_URL
-
-/* Define to the version of this package. */
-#undef PACKAGE_VERSION
-
-/* The size of `double', as computed by sizeof. */
-#undef SIZEOF_DOUBLE
-
-/* The size of `long double', as computed by sizeof. */
-#undef SIZEOF_LONG_DOUBLE
-
-/* The size of `size_t', as computed by sizeof. */
-#undef SIZEOF_SIZE_T
-
-/* If using the C implementation of alloca, define if you know the
- direction of stack growth for your system; otherwise it will be
- automatically deduced at runtime.
- STACK_DIRECTION > 0 => grows toward higher addresses
- STACK_DIRECTION < 0 => grows toward lower addresses
- STACK_DIRECTION = 0 => direction of growth unknown */
-#undef STACK_DIRECTION
-
-/* Define to 1 if you have the ANSI C header files. */
-#undef STDC_HEADERS
-
-/* Define if symbols are underscored. */
-#undef SYMBOL_UNDERSCORE
-
-/* Define this if you are using Purify and want to suppress spurious messages.
- */
-#undef USING_PURIFY
-
-/* Version number of package */
-#undef VERSION
-
-/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
- significant byte first (like Motorola and SPARC, unlike Intel). */
-#if defined AC_APPLE_UNIVERSAL_BUILD
-# if defined __BIG_ENDIAN__
-# define WORDS_BIGENDIAN 1
-# endif
-#else
-# ifndef WORDS_BIGENDIAN
-# undef WORDS_BIGENDIAN
-# endif
-#endif
-
-/* Define to `unsigned int' if <sys/types.h> does not define. */
-#undef size_t
-
-
-#ifdef HAVE_HIDDEN_VISIBILITY_ATTRIBUTE
-#ifdef LIBFFI_ASM
-#define FFI_HIDDEN(name) .hidden name
-#else
-#define FFI_HIDDEN __attribute__ ((visibility ("hidden")))
-#endif
-#else
-#ifdef LIBFFI_ASM
-#define FFI_HIDDEN(name)
-#else
-#define FFI_HIDDEN
-#endif
-#endif
-
diff --git a/Modules/_ctypes/libffi/fficonfig.py.in b/Modules/_ctypes/libffi/fficonfig.py.in
deleted file mode 100644
index d10249866d..0000000000
--- a/Modules/_ctypes/libffi/fficonfig.py.in
+++ /dev/null
@@ -1,35 +0,0 @@
-ffi_sources = """
-src/prep_cif.c
-src/closures.c
-""".split()
-
-ffi_platforms = {
- 'MIPS_IRIX': ['src/mips/ffi.c', 'src/mips/o32.S', 'src/mips/n32.S'],
- 'MIPS_LINUX': ['src/mips/ffi.c', 'src/mips/o32.S'],
- 'X86': ['src/x86/ffi.c', 'src/x86/sysv.S', 'src/x86/win32.S'],
- 'X86_FREEBSD': ['src/x86/ffi.c', 'src/x86/freebsd.S'],
- 'X86_WIN32': ['src/x86/ffi.c', 'src/x86/win32.S'],
- 'SPARC': ['src/sparc/ffi.c', 'src/sparc/v8.S', 'src/sparc/v9.S'],
- 'ALPHA': ['src/alpha/ffi.c', 'src/alpha/osf.S'],
- 'IA64': ['src/ia64/ffi.c', 'src/ia64/unix.S'],
- 'M32R': ['src/m32r/sysv.S', 'src/m32r/ffi.c'],
- 'M68K': ['src/m68k/ffi.c', 'src/m68k/sysv.S'],
- 'POWERPC': ['src/powerpc/ffi.c', 'src/powerpc/ffi_sysv.c', 'src/powerpc/ffi_linux64.c', 'src/powerpc/sysv.S', 'src/powerpc/ppc_closure.S', 'src/powerpc/linux64.S', 'src/powerpc/linux64_closure.S'],
- 'POWERPC_AIX': ['src/powerpc/ffi_darwin.c', 'src/powerpc/aix.S', 'src/powerpc/aix_closure.S'],
- 'POWERPC_FREEBSD': ['src/powerpc/ffi.c', 'src/powerpc/sysv.S', 'src/powerpc/ppc_closure.S'],
- 'AARCH64': ['src/aarch64/sysv.S', 'src/aarch64/ffi.c'],
- 'ARM': ['src/arm/sysv.S', 'src/arm/ffi.c'],
- 'LIBFFI_CRIS': ['src/cris/sysv.S', 'src/cris/ffi.c'],
- 'FRV': ['src/frv/eabi.S', 'src/frv/ffi.c'],
- 'S390': ['src/s390/sysv.S', 'src/s390/ffi.c'],
- 'X86_64': ['src/x86/ffi64.c', 'src/x86/unix64.S', 'src/x86/ffi.c', 'src/x86/sysv.S'],
- 'SH': ['src/sh/sysv.S', 'src/sh/ffi.c'],
- 'SH64': ['src/sh64/sysv.S', 'src/sh64/ffi.c'],
- 'PA': ['src/pa/linux.S', 'src/pa/ffi.c'],
- 'PA_LINUX': ['src/pa/linux.S', 'src/pa/ffi.c'],
- 'PA_HPUX': ['src/pa/hpux32.S', 'src/pa/ffi.c'],
-}
-
-ffi_sources += ffi_platforms['@TARGET@']
-
-ffi_cflags = '@CFLAGS@'
diff --git a/Modules/_ctypes/libffi/generate-darwin-source-and-headers.py b/Modules/_ctypes/libffi/generate-darwin-source-and-headers.py
deleted file mode 100644
index 964e861d43..0000000000
--- a/Modules/_ctypes/libffi/generate-darwin-source-and-headers.py
+++ /dev/null
@@ -1,209 +0,0 @@
-#!/usr/bin/env python
-import subprocess
-import os
-import errno
-import collections
-import glob
-import argparse
-
-class Platform(object):
- pass
-
-class simulator_platform(Platform):
- directory = 'darwin_ios'
- sdk = 'iphonesimulator'
- arch = 'i386'
- triple = 'i386-apple-darwin11'
- version_min = '-miphoneos-version-min=5.1.1'
-
- prefix = "#ifdef __i386__\n\n"
- suffix = "\n\n#endif"
- src_dir = 'x86'
- src_files = ['darwin.S', 'win32.S', 'ffi.c']
-
-
-class simulator64_platform(Platform):
- directory = 'darwin_ios'
- sdk = 'iphonesimulator'
- arch = 'x86_64'
- triple = 'x86_64-apple-darwin13'
- version_min = '-miphoneos-version-min=7.0'
-
- prefix = "#ifdef __x86_64__\n\n"
- suffix = "\n\n#endif"
- src_dir = 'x86'
- src_files = ['darwin64.S', 'ffi64.c']
-
-
-class device_platform(Platform):
- directory = 'darwin_ios'
- sdk = 'iphoneos'
- arch = 'armv7'
- triple = 'arm-apple-darwin11'
- version_min = '-miphoneos-version-min=5.1.1'
-
- prefix = "#ifdef __arm__\n\n"
- suffix = "\n\n#endif"
- src_dir = 'arm'
- src_files = ['sysv.S', 'trampoline.S', 'ffi.c']
-
-
-class device64_platform(Platform):
- directory = 'darwin_ios'
- sdk = 'iphoneos'
- arch = 'arm64'
- triple = 'aarch64-apple-darwin13'
- version_min = '-miphoneos-version-min=7.0'
-
- prefix = "#ifdef __arm64__\n\n"
- suffix = "\n\n#endif"
- src_dir = 'aarch64'
- src_files = ['sysv.S', 'ffi.c']
-
-
-class desktop32_platform(Platform):
- directory = 'darwin_osx'
- sdk = 'macosx'
- arch = 'i386'
- triple = 'i386-apple-darwin10'
- version_min = '-mmacosx-version-min=10.6'
- src_dir = 'x86'
- src_files = ['darwin.S', 'win32.S', 'ffi.c']
-
- prefix = "#ifdef __i386__\n\n"
- suffix = "\n\n#endif"
-
-
-class desktop64_platform(Platform):
- directory = 'darwin_osx'
- sdk = 'macosx'
- arch = 'x86_64'
- triple = 'x86_64-apple-darwin10'
- version_min = '-mmacosx-version-min=10.6'
-
- prefix = "#ifdef __x86_64__\n\n"
- suffix = "\n\n#endif"
- src_dir = 'x86'
- src_files = ['darwin64.S', 'ffi64.c']
-
-
-def mkdir_p(path):
- try:
- os.makedirs(path)
- except OSError as exc: # Python >2.5
- if exc.errno == errno.EEXIST:
- pass
- else:
- raise
-
-
-def move_file(src_dir, dst_dir, filename, file_suffix=None, prefix='', suffix=''):
- mkdir_p(dst_dir)
- out_filename = filename
-
- if file_suffix:
- split_name = os.path.splitext(filename)
- out_filename = "%s_%s%s" % (split_name[0], file_suffix, split_name[1])
-
- with open(os.path.join(src_dir, filename)) as in_file:
- with open(os.path.join(dst_dir, out_filename), 'w') as out_file:
- if prefix:
- out_file.write(prefix)
-
- out_file.write(in_file.read())
-
- if suffix:
- out_file.write(suffix)
-
-
-def list_files(src_dir, pattern=None, filelist=None):
- if pattern: filelist = glob.iglob(os.path.join(src_dir, pattern))
- for file in filelist:
- yield os.path.basename(file)
-
-
-def copy_files(src_dir, dst_dir, pattern=None, filelist=None, file_suffix=None, prefix=None, suffix=None):
- for filename in list_files(src_dir, pattern=pattern, filelist=filelist):
- move_file(src_dir, dst_dir, filename, file_suffix=file_suffix, prefix=prefix, suffix=suffix)
-
-
-def copy_src_platform_files(platform):
- src_dir = os.path.join('src', platform.src_dir)
- dst_dir = os.path.join(platform.directory, 'src', platform.src_dir)
- copy_files(src_dir, dst_dir, filelist=platform.src_files, file_suffix=platform.arch, prefix=platform.prefix, suffix=platform.suffix)
-
-
-def build_target(platform, platform_headers):
- def xcrun_cmd(cmd):
- return 'xcrun -sdk %s %s -arch %s' % (platform.sdk, cmd, platform.arch)
-
- tag='%s-%s' % (platform.sdk, platform.arch)
- build_dir = 'build_%s' % tag
- mkdir_p(build_dir)
- env = dict(CC=xcrun_cmd('clang'),
- LD=xcrun_cmd('ld'),
- CFLAGS='%s' % (platform.version_min))
- working_dir = os.getcwd()
- try:
- os.chdir(build_dir)
- subprocess.check_call(['../configure', '-host', platform.triple], env=env)
- finally:
- os.chdir(working_dir)
-
- for src_dir in [build_dir, os.path.join(build_dir, 'include')]:
- copy_files(src_dir,
- os.path.join(platform.directory, 'include'),
- pattern='*.h',
- file_suffix=platform.arch,
- prefix=platform.prefix,
- suffix=platform.suffix)
-
- for filename in list_files(src_dir, pattern='*.h'):
- platform_headers[filename].add((platform.prefix, platform.arch, platform.suffix))
-
-
-def make_tramp():
- with open('src/arm/trampoline.S', 'w') as tramp_out:
- p = subprocess.Popen(['bash', 'src/arm/gentramp.sh'], stdout=tramp_out)
- p.wait()
-
-
-def generate_source_and_headers(generate_osx=True, generate_ios=True):
- copy_files('src', 'darwin_common/src', pattern='*.c')
- copy_files('include', 'darwin_common/include', pattern='*.h')
-
- if generate_ios:
- make_tramp()
- copy_src_platform_files(simulator_platform)
- copy_src_platform_files(simulator64_platform)
- copy_src_platform_files(device_platform)
- copy_src_platform_files(device64_platform)
- if generate_osx:
- copy_src_platform_files(desktop32_platform)
- copy_src_platform_files(desktop64_platform)
-
- platform_headers = collections.defaultdict(set)
-
- if generate_ios:
- build_target(simulator_platform, platform_headers)
- build_target(simulator64_platform, platform_headers)
- build_target(device_platform, platform_headers)
- build_target(device64_platform, platform_headers)
- if generate_osx:
- build_target(desktop32_platform, platform_headers)
- build_target(desktop64_platform, platform_headers)
-
- mkdir_p('darwin_common/include')
- for header_name, tag_tuples in platform_headers.iteritems():
- basename, suffix = os.path.splitext(header_name)
- with open(os.path.join('darwin_common/include', header_name), 'w') as header:
- for tag_tuple in tag_tuples:
- header.write('%s#include <%s_%s%s>\n%s\n' % (tag_tuple[0], basename, tag_tuple[1], suffix, tag_tuple[2]))
-
-if __name__ == '__main__':
- parser = argparse.ArgumentParser()
- parser.add_argument('--only-ios', action='store_true', default=False)
- parser.add_argument('--only-osx', action='store_true', default=False)
- args = parser.parse_args()
-
- generate_source_and_headers(generate_osx=not args.only_ios, generate_ios=not args.only_osx)
diff --git a/Modules/_ctypes/libffi/include/Makefile.am b/Modules/_ctypes/libffi/include/Makefile.am
deleted file mode 100644
index fd28024973..0000000000
--- a/Modules/_ctypes/libffi/include/Makefile.am
+++ /dev/null
@@ -1,9 +0,0 @@
-## Process this with automake to create Makefile.in
-
-AUTOMAKE_OPTIONS=foreign
-
-DISTCLEANFILES=ffitarget.h
-EXTRA_DIST=ffi.h.in ffi_common.h
-
-includesdir = $(libdir)/@PACKAGE_NAME@-@PACKAGE_VERSION@/include
-nodist_includes_HEADERS = ffi.h ffitarget.h
diff --git a/Modules/_ctypes/libffi/include/Makefile.in b/Modules/_ctypes/libffi/include/Makefile.in
deleted file mode 100644
index 9d747e80e5..0000000000
--- a/Modules/_ctypes/libffi/include/Makefile.in
+++ /dev/null
@@ -1,587 +0,0 @@
-# Makefile.in generated by automake 1.13.4 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
-
-# This Makefile.in 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.
-
-@SET_MAKE@
-
-VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
-am__make_running_with_option = \
- case $${target_option-} in \
- ?) ;; \
- *) echo "am__make_running_with_option: internal error: invalid" \
- "target option '$${target_option-}' specified" >&2; \
- exit 1;; \
- esac; \
- has_opt=no; \
- sane_makeflags=$$MAKEFLAGS; \
- if $(am__is_gnu_make); then \
- sane_makeflags=$$MFLAGS; \
- else \
- case $$MAKEFLAGS in \
- *\\[\ \ ]*) \
- bs=\\; \
- sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
- | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
- esac; \
- fi; \
- skip_next=no; \
- strip_trailopt () \
- { \
- flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
- }; \
- for flg in $$sane_makeflags; do \
- test $$skip_next = yes && { skip_next=no; continue; }; \
- case $$flg in \
- *=*|--*) continue;; \
- -*I) strip_trailopt 'I'; skip_next=yes;; \
- -*I?*) strip_trailopt 'I';; \
- -*O) strip_trailopt 'O'; skip_next=yes;; \
- -*O?*) strip_trailopt 'O';; \
- -*l) strip_trailopt 'l'; skip_next=yes;; \
- -*l?*) strip_trailopt 'l';; \
- -[dEDm]) skip_next=yes;; \
- -[JT]) skip_next=yes;; \
- esac; \
- case $$flg in \
- *$$target_option*) has_opt=yes; break;; \
- esac; \
- done; \
- test $$has_opt = yes
-am__make_dryrun = (target_option=n; $(am__make_running_with_option))
-am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-target_triplet = @target@
-subdir = include
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
- $(srcdir)/ffi.h.in
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/asmcfi.m4 \
- $(top_srcdir)/m4/ax_append_flag.m4 \
- $(top_srcdir)/m4/ax_cc_maxopt.m4 \
- $(top_srcdir)/m4/ax_cflags_warn_all.m4 \
- $(top_srcdir)/m4/ax_check_compile_flag.m4 \
- $(top_srcdir)/m4/ax_compiler_vendor.m4 \
- $(top_srcdir)/m4/ax_configure_args.m4 \
- $(top_srcdir)/m4/ax_enable_builddir.m4 \
- $(top_srcdir)/m4/ax_gcc_archflag.m4 \
- $(top_srcdir)/m4/ax_gcc_x86_cpuid.m4 \
- $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
- $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
- $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/acinclude.m4 \
- $(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
- $(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/fficonfig.h
-CONFIG_CLEAN_FILES = ffi.h ffitarget.h
-CONFIG_CLEAN_VPATH_FILES =
-AM_V_P = $(am__v_P_@AM_V@)
-am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
-am__v_P_0 = false
-am__v_P_1 = :
-AM_V_GEN = $(am__v_GEN_@AM_V@)
-am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
-am__v_GEN_0 = @echo " GEN " $@;
-am__v_GEN_1 =
-AM_V_at = $(am__v_at_@AM_V@)
-am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
-am__v_at_0 = @
-am__v_at_1 =
-SOURCES =
-DIST_SOURCES =
-am__can_run_installinfo = \
- case $$AM_UPDATE_INFO_DIR in \
- n|no|NO) false;; \
- *) (install-info --version) >/dev/null 2>&1;; \
- esac
-am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
-am__vpath_adj = case $$p in \
- $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
- *) f=$$p;; \
- esac;
-am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
-am__install_max = 40
-am__nobase_strip_setup = \
- srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
-am__nobase_strip = \
- for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
-am__nobase_list = $(am__nobase_strip_setup); \
- for p in $$list; do echo "$$p $$p"; done | \
- sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
- $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
- if (++n[$$2] == $(am__install_max)) \
- { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
- END { for (dir in files) print dir, files[dir] }'
-am__base_list = \
- sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
- sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
-am__uninstall_files_from_dir = { \
- test -z "$$files" \
- || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
- || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
- $(am__cd) "$$dir" && rm -f $$files; }; \
- }
-am__installdirs = "$(DESTDIR)$(includesdir)"
-HEADERS = $(nodist_includes_HEADERS)
-am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
-# Read a list of newline-separated strings from the standard input,
-# and print each of them once, without duplicates. Input order is
-# *not* preserved.
-am__uniquify_input = $(AWK) '\
- BEGIN { nonempty = 0; } \
- { items[$$0] = 1; nonempty = 1; } \
- END { if (nonempty) { for (i in items) print i; }; } \
-'
-# Make sure the list of sources is unique. This is necessary because,
-# e.g., the same source file might be shared among _SOURCES variables
-# for different programs/libraries.
-am__define_uniq_tagged_files = \
- list='$(am__tagged_files)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | $(am__uniquify_input)`
-ETAGS = etags
-CTAGS = ctags
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = @ACLOCAL@
-ALLOCA = @ALLOCA@
-AMTAR = @AMTAR@
-AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
-AM_LTLDFLAGS = @AM_LTLDFLAGS@
-AM_RUNTESTFLAGS = @AM_RUNTESTFLAGS@
-AR = @AR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-CC = @CC@
-CCAS = @CCAS@
-CCASDEPMODE = @CCASDEPMODE@
-CCASFLAGS = @CCASFLAGS@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DLLTOOL = @DLLTOOL@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FFI_EXEC_TRAMPOLINE_TABLE = @FFI_EXEC_TRAMPOLINE_TABLE@
-FGREP = @FGREP@
-GREP = @GREP@
-HAVE_LONG_DOUBLE = @HAVE_LONG_DOUBLE@
-HAVE_LONG_DOUBLE_VARIANT = @HAVE_LONG_DOUBLE_VARIANT@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LTLIBOBJS = @LTLIBOBJS@
-MAINT = @MAINT@
-MAKEINFO = @MAKEINFO@
-MANIFEST_TOOL = @MANIFEST_TOOL@
-MKDIR_P = @MKDIR_P@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_URL = @PACKAGE_URL@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PRTDIAG = @PRTDIAG@
-RANLIB = @RANLIB@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-TARGET = @TARGET@
-TARGETDIR = @TARGETDIR@
-VERSION = @VERSION@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_AR = @ac_ct_AR@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-ax_enable_builddir_sed = @ax_enable_builddir_sed@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sys_symbol_underscore = @sys_symbol_underscore@
-sysconfdir = @sysconfdir@
-target = @target@
-target_alias = @target_alias@
-target_cpu = @target_cpu@
-target_os = @target_os@
-target_vendor = @target_vendor@
-toolexecdir = @toolexecdir@
-toolexeclibdir = @toolexeclibdir@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-AUTOMAKE_OPTIONS = foreign
-DISTCLEANFILES = ffitarget.h
-EXTRA_DIST = ffi.h.in ffi_common.h
-includesdir = $(libdir)/@PACKAGE_NAME@-@PACKAGE_VERSION@/include
-nodist_includes_HEADERS = ffi.h ffitarget.h
-all: all-am
-
-.SUFFIXES:
-$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
- @for dep in $?; do \
- case '$(am__configure_deps)' in \
- *$$dep*) \
- ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
- && { if test -f $@; then exit 0; else break; fi; }; \
- exit 1;; \
- esac; \
- done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign include/Makefile'; \
- $(am__cd) $(top_srcdir) && \
- $(AUTOMAKE) --foreign include/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
- @case '$?' in \
- *config.status*) \
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
- *) \
- echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
- esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-ffi.h: $(top_builddir)/config.status $(srcdir)/ffi.h.in
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
-
-mostlyclean-libtool:
- -rm -f *.lo
-
-clean-libtool:
- -rm -rf .libs _libs
-install-nodist_includesHEADERS: $(nodist_includes_HEADERS)
- @$(NORMAL_INSTALL)
- @list='$(nodist_includes_HEADERS)'; test -n "$(includesdir)" || list=; \
- if test -n "$$list"; then \
- echo " $(MKDIR_P) '$(DESTDIR)$(includesdir)'"; \
- $(MKDIR_P) "$(DESTDIR)$(includesdir)" || exit 1; \
- fi; \
- for p in $$list; do \
- if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
- echo "$$d$$p"; \
- done | $(am__base_list) | \
- while read files; do \
- echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(includesdir)'"; \
- $(INSTALL_HEADER) $$files "$(DESTDIR)$(includesdir)" || exit $$?; \
- done
-
-uninstall-nodist_includesHEADERS:
- @$(NORMAL_UNINSTALL)
- @list='$(nodist_includes_HEADERS)'; test -n "$(includesdir)" || list=; \
- files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
- dir='$(DESTDIR)$(includesdir)'; $(am__uninstall_files_from_dir)
-
-ID: $(am__tagged_files)
- $(am__define_uniq_tagged_files); mkid -fID $$unique
-tags: tags-am
-TAGS: tags
-
-tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
- set x; \
- here=`pwd`; \
- $(am__define_uniq_tagged_files); \
- shift; \
- if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
- test -n "$$unique" || unique=$$empty_fix; \
- if test $$# -gt 0; then \
- $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- "$$@" $$unique; \
- else \
- $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- $$unique; \
- fi; \
- fi
-ctags: ctags-am
-
-CTAGS: ctags
-ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
- $(am__define_uniq_tagged_files); \
- test -z "$(CTAGS_ARGS)$$unique" \
- || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
- $$unique
-
-GTAGS:
- here=`$(am__cd) $(top_builddir) && pwd` \
- && $(am__cd) $(top_srcdir) \
- && gtags -i $(GTAGS_ARGS) "$$here"
-cscopelist: cscopelist-am
-
-cscopelist-am: $(am__tagged_files)
- list='$(am__tagged_files)'; \
- case "$(srcdir)" in \
- [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
- *) sdir=$(subdir)/$(srcdir) ;; \
- esac; \
- for i in $$list; do \
- if test -f "$$i"; then \
- echo "$(subdir)/$$i"; \
- else \
- echo "$$sdir/$$i"; \
- fi; \
- done >> $(top_builddir)/cscope.files
-
-distclean-tags:
- -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-
-distdir: $(DISTFILES)
- @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
- topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
- list='$(DISTFILES)'; \
- dist_files=`for file in $$list; do echo $$file; done | \
- sed -e "s|^$$srcdirstrip/||;t" \
- -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
- case $$dist_files in \
- */*) $(MKDIR_P) `echo "$$dist_files" | \
- sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
- sort -u` ;; \
- esac; \
- for file in $$dist_files; do \
- if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
- if test -d $$d/$$file; then \
- dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
- if test -d "$(distdir)/$$file"; then \
- find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
- fi; \
- if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
- cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
- find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
- fi; \
- cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
- else \
- test -f "$(distdir)/$$file" \
- || cp -p $$d/$$file "$(distdir)/$$file" \
- || exit 1; \
- fi; \
- done
-check-am: all-am
-check: check-am
-all-am: Makefile $(HEADERS)
-installdirs:
- for dir in "$(DESTDIR)$(includesdir)"; do \
- test -z "$$dir" || $(MKDIR_P) "$$dir"; \
- done
-install: install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
- @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
- if test -z '$(STRIP)'; then \
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- install; \
- else \
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
- fi
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
- -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
- -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
- -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
-
-maintainer-clean-generic:
- @echo "This command is intended for maintainers to use"
- @echo "it deletes files that may require special tools to rebuild."
-clean: clean-am
-
-clean-am: clean-generic clean-libtool mostlyclean-am
-
-distclean: distclean-am
- -rm -f Makefile
-distclean-am: clean-am distclean-generic distclean-tags
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-html-am:
-
-info: info-am
-
-info-am:
-
-install-data-am: install-nodist_includesHEADERS
-
-install-dvi: install-dvi-am
-
-install-dvi-am:
-
-install-exec-am:
-
-install-html: install-html-am
-
-install-html-am:
-
-install-info: install-info-am
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-am
-
-install-pdf-am:
-
-install-ps: install-ps-am
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
- -rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-generic mostlyclean-libtool
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am: uninstall-nodist_includesHEADERS
-
-.MAKE: install-am install-strip
-
-.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \
- clean-libtool cscopelist-am ctags ctags-am distclean \
- distclean-generic distclean-libtool distclean-tags distdir dvi \
- dvi-am html html-am info info-am install install-am \
- install-data install-data-am install-dvi install-dvi-am \
- install-exec install-exec-am install-html install-html-am \
- install-info install-info-am install-man \
- install-nodist_includesHEADERS install-pdf install-pdf-am \
- install-ps install-ps-am install-strip installcheck \
- installcheck-am installdirs maintainer-clean \
- maintainer-clean-generic mostlyclean mostlyclean-generic \
- mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \
- uninstall-am uninstall-nodist_includesHEADERS
-
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/Modules/_ctypes/libffi/include/ffi.h.in b/Modules/_ctypes/libffi/include/ffi.h.in
deleted file mode 100644
index 93c776fbbe..0000000000
--- a/Modules/_ctypes/libffi/include/ffi.h.in
+++ /dev/null
@@ -1,476 +0,0 @@
-/* -----------------------------------------------------------------*-C-*-
- libffi @VERSION@ - Copyright (c) 2011 Anthony Green
- - Copyright (c) 1996-2003, 2007, 2008 Red Hat, Inc.
-
- Permission is hereby granted, free of charge, to any person
- obtaining a copy of this software and associated documentation
- files (the ``Software''), to deal in the Software without
- restriction, including without limitation the rights to use, copy,
- modify, merge, publish, distribute, sublicense, and/or sell copies
- of the Software, and to permit persons to whom the Software is
- furnished to do so, subject to the following conditions:
-
- The above copyright notice and this permission notice shall be
- included in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- DEALINGS IN THE SOFTWARE.
-
- ----------------------------------------------------------------------- */
-
-/* -------------------------------------------------------------------
- The basic API is described in the README file.
-
- The raw API is designed to bypass some of the argument packing
- and unpacking on architectures for which it can be avoided.
-
- The closure API allows interpreted functions to be packaged up
- inside a C function pointer, so that they can be called as C functions,
- with no understanding on the client side that they are interpreted.
- It can also be used in other cases in which it is necessary to package
- up a user specified parameter and a function pointer as a single
- function pointer.
-
- The closure API must be implemented in order to get its functionality,
- e.g. for use by gij. Routines are provided to emulate the raw API
- if the underlying platform doesn't allow faster implementation.
-
- More details on the raw and cloure API can be found in:
-
- http://gcc.gnu.org/ml/java/1999-q3/msg00138.html
-
- and
-
- http://gcc.gnu.org/ml/java/1999-q3/msg00174.html
- -------------------------------------------------------------------- */
-
-#ifndef LIBFFI_H
-#define LIBFFI_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* Specify which architecture libffi is configured for. */
-#ifndef @TARGET@
-#define @TARGET@
-#endif
-
-/* ---- System configuration information --------------------------------- */
-
-#include <ffitarget.h>
-
-#ifndef LIBFFI_ASM
-
-#ifdef _MSC_VER
-#define __attribute__(X)
-#endif
-
-#include <stddef.h>
-#include <limits.h>
-
-/* LONG_LONG_MAX is not always defined (not if STRICT_ANSI, for example).
- But we can find it either under the correct ANSI name, or under GNU
- C's internal name. */
-
-#define FFI_64_BIT_MAX 9223372036854775807
-
-#ifdef LONG_LONG_MAX
-# define FFI_LONG_LONG_MAX LONG_LONG_MAX
-#else
-# ifdef LLONG_MAX
-# define FFI_LONG_LONG_MAX LLONG_MAX
-# ifdef _AIX52 /* or newer has C99 LLONG_MAX */
-# undef FFI_64_BIT_MAX
-# define FFI_64_BIT_MAX 9223372036854775807LL
-# endif /* _AIX52 or newer */
-# else
-# ifdef __GNUC__
-# define FFI_LONG_LONG_MAX __LONG_LONG_MAX__
-# endif
-# ifdef _AIX /* AIX 5.1 and earlier have LONGLONG_MAX */
-# ifndef __PPC64__
-# if defined (__IBMC__) || defined (__IBMCPP__)
-# define FFI_LONG_LONG_MAX LONGLONG_MAX
-# endif
-# endif /* __PPC64__ */
-# undef FFI_64_BIT_MAX
-# define FFI_64_BIT_MAX 9223372036854775807LL
-# endif
-# endif
-#endif
-
-/* The closure code assumes that this works on pointers, i.e. a size_t */
-/* can hold a pointer. */
-
-typedef struct _ffi_type
-{
- size_t size;
- unsigned short alignment;
- unsigned short type;
- struct _ffi_type **elements;
-} ffi_type;
-
-#ifndef LIBFFI_HIDE_BASIC_TYPES
-#if SCHAR_MAX == 127
-# define ffi_type_uchar ffi_type_uint8
-# define ffi_type_schar ffi_type_sint8
-#else
- #error "char size not supported"
-#endif
-
-#if SHRT_MAX == 32767
-# define ffi_type_ushort ffi_type_uint16
-# define ffi_type_sshort ffi_type_sint16
-#elif SHRT_MAX == 2147483647
-# define ffi_type_ushort ffi_type_uint32
-# define ffi_type_sshort ffi_type_sint32
-#else
- #error "short size not supported"
-#endif
-
-#if INT_MAX == 32767
-# define ffi_type_uint ffi_type_uint16
-# define ffi_type_sint ffi_type_sint16
-#elif INT_MAX == 2147483647
-# define ffi_type_uint ffi_type_uint32
-# define ffi_type_sint ffi_type_sint32
-#elif INT_MAX == 9223372036854775807
-# define ffi_type_uint ffi_type_uint64
-# define ffi_type_sint ffi_type_sint64
-#else
- #error "int size not supported"
-#endif
-
-#if LONG_MAX == 2147483647
-# if FFI_LONG_LONG_MAX != FFI_64_BIT_MAX
- #error "no 64-bit data type supported"
-# endif
-#elif LONG_MAX != FFI_64_BIT_MAX
- #error "long size not supported"
-#endif
-
-#if LONG_MAX == 2147483647
-# define ffi_type_ulong ffi_type_uint32
-# define ffi_type_slong ffi_type_sint32
-#elif LONG_MAX == FFI_64_BIT_MAX
-# define ffi_type_ulong ffi_type_uint64
-# define ffi_type_slong ffi_type_sint64
-#else
- #error "long size not supported"
-#endif
-
-/* Need minimal decorations for DLLs to works on Windows. */
-/* GCC has autoimport and autoexport. Rely on Libtool to */
-/* help MSVC export from a DLL, but always declare data */
-/* to be imported for MSVC clients. This costs an extra */
-/* indirection for MSVC clients using the static version */
-/* of the library, but don't worry about that. Besides, */
-/* as a workaround, they can define FFI_BUILDING if they */
-/* *know* they are going to link with the static library. */
-#if defined _MSC_VER && !defined FFI_BUILDING
-#define FFI_EXTERN extern __declspec(dllimport)
-#else
-#define FFI_EXTERN extern
-#endif
-
-/* These are defined in types.c */
-FFI_EXTERN ffi_type ffi_type_void;
-FFI_EXTERN ffi_type ffi_type_uint8;
-FFI_EXTERN ffi_type ffi_type_sint8;
-FFI_EXTERN ffi_type ffi_type_uint16;
-FFI_EXTERN ffi_type ffi_type_sint16;
-FFI_EXTERN ffi_type ffi_type_uint32;
-FFI_EXTERN ffi_type ffi_type_sint32;
-FFI_EXTERN ffi_type ffi_type_uint64;
-FFI_EXTERN ffi_type ffi_type_sint64;
-FFI_EXTERN ffi_type ffi_type_float;
-FFI_EXTERN ffi_type ffi_type_double;
-FFI_EXTERN ffi_type ffi_type_pointer;
-
-#if @HAVE_LONG_DOUBLE@
-FFI_EXTERN ffi_type ffi_type_longdouble;
-#else
-#define ffi_type_longdouble ffi_type_double
-#endif
-#endif /* LIBFFI_HIDE_BASIC_TYPES */
-
-typedef enum {
- FFI_OK = 0,
- FFI_BAD_TYPEDEF,
- FFI_BAD_ABI
-} ffi_status;
-
-typedef unsigned FFI_TYPE;
-
-typedef struct {
- ffi_abi abi;
- unsigned nargs;
- ffi_type **arg_types;
- ffi_type *rtype;
- unsigned bytes;
- unsigned flags;
-#ifdef FFI_EXTRA_CIF_FIELDS
- FFI_EXTRA_CIF_FIELDS;
-#endif
-} ffi_cif;
-
-#if HAVE_LONG_DOUBLE_VARIANT
-/* Used to adjust size/alignment of ffi types. */
-void ffi_prep_types (ffi_abi abi);
-# endif
-
-/* Used internally, but overridden by some architectures */
-ffi_status ffi_prep_cif_core(ffi_cif *cif,
- ffi_abi abi,
- unsigned int isvariadic,
- unsigned int nfixedargs,
- unsigned int ntotalargs,
- ffi_type *rtype,
- ffi_type **atypes);
-
-/* ---- Definitions for the raw API -------------------------------------- */
-
-#ifndef FFI_SIZEOF_ARG
-# if LONG_MAX == 2147483647
-# define FFI_SIZEOF_ARG 4
-# elif LONG_MAX == FFI_64_BIT_MAX
-# define FFI_SIZEOF_ARG 8
-# endif
-#endif
-
-#ifndef FFI_SIZEOF_JAVA_RAW
-# define FFI_SIZEOF_JAVA_RAW FFI_SIZEOF_ARG
-#endif
-
-typedef union {
- ffi_sarg sint;
- ffi_arg uint;
- float flt;
- char data[FFI_SIZEOF_ARG];
- void* ptr;
-} ffi_raw;
-
-#if FFI_SIZEOF_JAVA_RAW == 4 && FFI_SIZEOF_ARG == 8
-/* This is a special case for mips64/n32 ABI (and perhaps others) where
- sizeof(void *) is 4 and FFI_SIZEOF_ARG is 8. */
-typedef union {
- signed int sint;
- unsigned int uint;
- float flt;
- char data[FFI_SIZEOF_JAVA_RAW];
- void* ptr;
-} ffi_java_raw;
-#else
-typedef ffi_raw ffi_java_raw;
-#endif
-
-
-void ffi_raw_call (ffi_cif *cif,
- void (*fn)(void),
- void *rvalue,
- ffi_raw *avalue);
-
-void ffi_ptrarray_to_raw (ffi_cif *cif, void **args, ffi_raw *raw);
-void ffi_raw_to_ptrarray (ffi_cif *cif, ffi_raw *raw, void **args);
-size_t ffi_raw_size (ffi_cif *cif);
-
-/* This is analogous to the raw API, except it uses Java parameter */
-/* packing, even on 64-bit machines. I.e. on 64-bit machines */
-/* longs and doubles are followed by an empty 64-bit word. */
-
-void ffi_java_raw_call (ffi_cif *cif,
- void (*fn)(void),
- void *rvalue,
- ffi_java_raw *avalue);
-
-void ffi_java_ptrarray_to_raw (ffi_cif *cif, void **args, ffi_java_raw *raw);
-void ffi_java_raw_to_ptrarray (ffi_cif *cif, ffi_java_raw *raw, void **args);
-size_t ffi_java_raw_size (ffi_cif *cif);
-
-/* ---- Definitions for closures ----------------------------------------- */
-
-#if FFI_CLOSURES
-
-#ifdef _MSC_VER
-__declspec(align(8))
-#endif
-typedef struct {
-#if @FFI_EXEC_TRAMPOLINE_TABLE@
- void *trampoline_table;
- void *trampoline_table_entry;
-#else
- char tramp[FFI_TRAMPOLINE_SIZE];
-#endif
- ffi_cif *cif;
- void (*fun)(ffi_cif*,void*,void**,void*);
- void *user_data;
-#ifdef __GNUC__
-} ffi_closure __attribute__((aligned (8)));
-#else
-} ffi_closure;
-# ifdef __sgi
-# pragma pack 0
-# endif
-#endif
-
-void *ffi_closure_alloc (size_t size, void **code);
-void ffi_closure_free (void *);
-
-ffi_status
-ffi_prep_closure (ffi_closure*,
- ffi_cif *,
- void (*fun)(ffi_cif*,void*,void**,void*),
- void *user_data);
-
-ffi_status
-ffi_prep_closure_loc (ffi_closure*,
- ffi_cif *,
- void (*fun)(ffi_cif*,void*,void**,void*),
- void *user_data,
- void*codeloc);
-
-#ifdef __sgi
-# pragma pack 8
-#endif
-typedef struct {
-#if @FFI_EXEC_TRAMPOLINE_TABLE@
- void *trampoline_table;
- void *trampoline_table_entry;
-#else
- char tramp[FFI_TRAMPOLINE_SIZE];
-#endif
- ffi_cif *cif;
-
-#if !FFI_NATIVE_RAW_API
-
- /* if this is enabled, then a raw closure has the same layout
- as a regular closure. We use this to install an intermediate
- handler to do the transaltion, void** -> ffi_raw*. */
-
- void (*translate_args)(ffi_cif*,void*,void**,void*);
- void *this_closure;
-
-#endif
-
- void (*fun)(ffi_cif*,void*,ffi_raw*,void*);
- void *user_data;
-
-} ffi_raw_closure;
-
-typedef struct {
-#if @FFI_EXEC_TRAMPOLINE_TABLE@
- void *trampoline_table;
- void *trampoline_table_entry;
-#else
- char tramp[FFI_TRAMPOLINE_SIZE];
-#endif
-
- ffi_cif *cif;
-
-#if !FFI_NATIVE_RAW_API
-
- /* if this is enabled, then a raw closure has the same layout
- as a regular closure. We use this to install an intermediate
- handler to do the transaltion, void** -> ffi_raw*. */
-
- void (*translate_args)(ffi_cif*,void*,void**,void*);
- void *this_closure;
-
-#endif
-
- void (*fun)(ffi_cif*,void*,ffi_java_raw*,void*);
- void *user_data;
-
-} ffi_java_raw_closure;
-
-ffi_status
-ffi_prep_raw_closure (ffi_raw_closure*,
- ffi_cif *cif,
- void (*fun)(ffi_cif*,void*,ffi_raw*,void*),
- void *user_data);
-
-ffi_status
-ffi_prep_raw_closure_loc (ffi_raw_closure*,
- ffi_cif *cif,
- void (*fun)(ffi_cif*,void*,ffi_raw*,void*),
- void *user_data,
- void *codeloc);
-
-ffi_status
-ffi_prep_java_raw_closure (ffi_java_raw_closure*,
- ffi_cif *cif,
- void (*fun)(ffi_cif*,void*,ffi_java_raw*,void*),
- void *user_data);
-
-ffi_status
-ffi_prep_java_raw_closure_loc (ffi_java_raw_closure*,
- ffi_cif *cif,
- void (*fun)(ffi_cif*,void*,ffi_java_raw*,void*),
- void *user_data,
- void *codeloc);
-
-#endif /* FFI_CLOSURES */
-
-/* ---- Public interface definition -------------------------------------- */
-
-ffi_status ffi_prep_cif(ffi_cif *cif,
- ffi_abi abi,
- unsigned int nargs,
- ffi_type *rtype,
- ffi_type **atypes);
-
-ffi_status ffi_prep_cif_var(ffi_cif *cif,
- ffi_abi abi,
- unsigned int nfixedargs,
- unsigned int ntotalargs,
- ffi_type *rtype,
- ffi_type **atypes);
-
-void ffi_call(ffi_cif *cif,
- void (*fn)(void),
- void *rvalue,
- void **avalue);
-
-/* Useful for eliminating compiler warnings */
-#define FFI_FN(f) ((void (*)(void))f)
-
-/* ---- Definitions shared with assembly code ---------------------------- */
-
-#endif
-
-/* If these change, update src/mips/ffitarget.h. */
-#define FFI_TYPE_VOID 0
-#define FFI_TYPE_INT 1
-#define FFI_TYPE_FLOAT 2
-#define FFI_TYPE_DOUBLE 3
-#if @HAVE_LONG_DOUBLE@
-#define FFI_TYPE_LONGDOUBLE 4
-#else
-#define FFI_TYPE_LONGDOUBLE FFI_TYPE_DOUBLE
-#endif
-#define FFI_TYPE_UINT8 5
-#define FFI_TYPE_SINT8 6
-#define FFI_TYPE_UINT16 7
-#define FFI_TYPE_SINT16 8
-#define FFI_TYPE_UINT32 9
-#define FFI_TYPE_SINT32 10
-#define FFI_TYPE_UINT64 11
-#define FFI_TYPE_SINT64 12
-#define FFI_TYPE_STRUCT 13
-#define FFI_TYPE_POINTER 14
-
-/* This should always refer to the last type code (for sanity checks) */
-#define FFI_TYPE_LAST FFI_TYPE_POINTER
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/Modules/_ctypes/libffi/include/ffi_common.h b/Modules/_ctypes/libffi/include/ffi_common.h
deleted file mode 100644
index 37f5a9e924..0000000000
--- a/Modules/_ctypes/libffi/include/ffi_common.h
+++ /dev/null
@@ -1,132 +0,0 @@
-/* -----------------------------------------------------------------------
- ffi_common.h - Copyright (C) 2011, 2012, 2013 Anthony Green
- Copyright (C) 2007 Free Software Foundation, Inc
- Copyright (c) 1996 Red Hat, Inc.
-
- Common internal definitions and macros. Only necessary for building
- libffi.
- ----------------------------------------------------------------------- */
-
-#ifndef FFI_COMMON_H
-#define FFI_COMMON_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <fficonfig.h>
-
-/* Do not move this. Some versions of AIX are very picky about where
- this is positioned. */
-#ifdef __GNUC__
-# if HAVE_ALLOCA_H
-# include <alloca.h>
-# else
- /* mingw64 defines this already in malloc.h. */
-# ifndef alloca
-# define alloca __builtin_alloca
-# endif
-# endif
-# define MAYBE_UNUSED __attribute__((__unused__))
-#else
-# define MAYBE_UNUSED
-# if HAVE_ALLOCA_H
-# include <alloca.h>
-# else
-# ifdef _AIX
-# pragma alloca
-# else
-# ifndef alloca /* predefined by HP cc +Olibcalls */
-# ifdef _MSC_VER
-# define alloca _alloca
-# else
-char *alloca ();
-# endif
-# endif
-# endif
-# endif
-#endif
-
-/* Check for the existence of memcpy. */
-#if STDC_HEADERS
-# include <string.h>
-#else
-# ifndef HAVE_MEMCPY
-# define memcpy(d, s, n) bcopy ((s), (d), (n))
-# endif
-#endif
-
-#if defined(FFI_DEBUG)
-#include <stdio.h>
-#endif
-
-#ifdef FFI_DEBUG
-void ffi_assert(char *expr, char *file, int line);
-void ffi_stop_here(void);
-void ffi_type_test(ffi_type *a, char *file, int line);
-
-#define FFI_ASSERT(x) ((x) ? (void)0 : ffi_assert(#x, __FILE__,__LINE__))
-#define FFI_ASSERT_AT(x, f, l) ((x) ? 0 : ffi_assert(#x, (f), (l)))
-#define FFI_ASSERT_VALID_TYPE(x) ffi_type_test (x, __FILE__, __LINE__)
-#else
-#define FFI_ASSERT(x)
-#define FFI_ASSERT_AT(x, f, l)
-#define FFI_ASSERT_VALID_TYPE(x)
-#endif
-
-#define ALIGN(v, a) (((((size_t) (v))-1) | ((a)-1))+1)
-#define ALIGN_DOWN(v, a) (((size_t) (v)) & -a)
-
-/* Perform machine dependent cif processing */
-ffi_status ffi_prep_cif_machdep(ffi_cif *cif);
-ffi_status ffi_prep_cif_machdep_var(ffi_cif *cif,
- unsigned int nfixedargs, unsigned int ntotalargs);
-
-/* Extended cif, used in callback from assembly routine */
-typedef struct
-{
- ffi_cif *cif;
- void *rvalue;
- void **avalue;
-} extended_cif;
-
-/* Terse sized type definitions. */
-#if defined(_MSC_VER) || defined(__sgi) || defined(__SUNPRO_C)
-typedef unsigned char UINT8;
-typedef signed char SINT8;
-typedef unsigned short UINT16;
-typedef signed short SINT16;
-typedef unsigned int UINT32;
-typedef signed int SINT32;
-# ifdef _MSC_VER
-typedef unsigned __int64 UINT64;
-typedef signed __int64 SINT64;
-# else
-# include <inttypes.h>
-typedef uint64_t UINT64;
-typedef int64_t SINT64;
-# endif
-#else
-typedef unsigned int UINT8 __attribute__((__mode__(__QI__)));
-typedef signed int SINT8 __attribute__((__mode__(__QI__)));
-typedef unsigned int UINT16 __attribute__((__mode__(__HI__)));
-typedef signed int SINT16 __attribute__((__mode__(__HI__)));
-typedef unsigned int UINT32 __attribute__((__mode__(__SI__)));
-typedef signed int SINT32 __attribute__((__mode__(__SI__)));
-typedef unsigned int UINT64 __attribute__((__mode__(__DI__)));
-typedef signed int SINT64 __attribute__((__mode__(__DI__)));
-#endif
-
-typedef float FLOAT32;
-
-#ifndef __GNUC__
-#define __builtin_expect(x, expected_value) (x)
-#endif
-#define LIKELY(x) __builtin_expect(!!(x),1)
-#define UNLIKELY(x) __builtin_expect((x)!=0,0)
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/Modules/_ctypes/libffi/install-sh b/Modules/_ctypes/libffi/install-sh
deleted file mode 100755
index 377bb8687f..0000000000
--- a/Modules/_ctypes/libffi/install-sh
+++ /dev/null
@@ -1,527 +0,0 @@
-#!/bin/sh
-# install - install a program, script, or datafile
-
-scriptversion=2011-11-20.07; # UTC
-
-# This originates from X11R5 (mit/util/scripts/install.sh), which was
-# later released in X11R6 (xc/config/util/install.sh) with the
-# following copyright and license.
-#
-# Copyright (C) 1994 X Consortium
-#
-# Permission is hereby granted, free of charge, to any person obtaining a copy
-# of this software and associated documentation files (the "Software"), to
-# deal in the Software without restriction, including without limitation the
-# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
-# sell copies of the Software, and to permit persons to whom the Software is
-# furnished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice shall be included in
-# all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
-# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-#
-# Except as contained in this notice, the name of the X Consortium shall not
-# be used in advertising or otherwise to promote the sale, use or other deal-
-# ings in this Software without prior written authorization from the X Consor-
-# tium.
-#
-#
-# FSF changes to this file are in the public domain.
-#
-# 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.
-
-nl='
-'
-IFS=" "" $nl"
-
-# set DOITPROG to echo to test this script
-
-# Don't use :- since 4.3BSD and earlier shells don't like it.
-doit=${DOITPROG-}
-if test -z "$doit"; then
- doit_exec=exec
-else
- doit_exec=$doit
-fi
-
-# Put in absolute file names if you don't have them in your path;
-# or use environment vars.
-
-chgrpprog=${CHGRPPROG-chgrp}
-chmodprog=${CHMODPROG-chmod}
-chownprog=${CHOWNPROG-chown}
-cmpprog=${CMPPROG-cmp}
-cpprog=${CPPROG-cp}
-mkdirprog=${MKDIRPROG-mkdir}
-mvprog=${MVPROG-mv}
-rmprog=${RMPROG-rm}
-stripprog=${STRIPPROG-strip}
-
-posix_glob='?'
-initialize_posix_glob='
- test "$posix_glob" != "?" || {
- if (set -f) 2>/dev/null; then
- posix_glob=
- else
- posix_glob=:
- fi
- }
-'
-
-posix_mkdir=
-
-# Desired mode of installed file.
-mode=0755
-
-chgrpcmd=
-chmodcmd=$chmodprog
-chowncmd=
-mvcmd=$mvprog
-rmcmd="$rmprog -f"
-stripcmd=
-
-src=
-dst=
-dir_arg=
-dst_arg=
-
-copy_on_change=false
-no_target_directory=
-
-usage="\
-Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
- or: $0 [OPTION]... SRCFILES... DIRECTORY
- or: $0 [OPTION]... -t DIRECTORY SRCFILES...
- or: $0 [OPTION]... -d DIRECTORIES...
-
-In the 1st form, copy SRCFILE to DSTFILE.
-In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
-In the 4th, create DIRECTORIES.
-
-Options:
- --help display this help and exit.
- --version display version info and exit.
-
- -c (ignored)
- -C install only if different (preserve the last data modification time)
- -d create directories instead of installing files.
- -g GROUP $chgrpprog installed files to GROUP.
- -m MODE $chmodprog installed files to MODE.
- -o USER $chownprog installed files to USER.
- -s $stripprog installed files.
- -t DIRECTORY install into DIRECTORY.
- -T report an error if DSTFILE is a directory.
-
-Environment variables override the default commands:
- CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
- RMPROG STRIPPROG
-"
-
-while test $# -ne 0; do
- case $1 in
- -c) ;;
-
- -C) copy_on_change=true;;
-
- -d) dir_arg=true;;
-
- -g) chgrpcmd="$chgrpprog $2"
- shift;;
-
- --help) echo "$usage"; exit $?;;
-
- -m) mode=$2
- case $mode in
- *' '* | *' '* | *'
-'* | *'*'* | *'?'* | *'['*)
- echo "$0: invalid mode: $mode" >&2
- exit 1;;
- esac
- shift;;
-
- -o) chowncmd="$chownprog $2"
- shift;;
-
- -s) stripcmd=$stripprog;;
-
- -t) dst_arg=$2
- # Protect names problematic for 'test' and other utilities.
- case $dst_arg in
- -* | [=\(\)!]) dst_arg=./$dst_arg;;
- esac
- shift;;
-
- -T) no_target_directory=true;;
-
- --version) echo "$0 $scriptversion"; exit $?;;
-
- --) shift
- break;;
-
- -*) echo "$0: invalid option: $1" >&2
- exit 1;;
-
- *) break;;
- esac
- shift
-done
-
-if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
- # When -d is used, all remaining arguments are directories to create.
- # When -t is used, the destination is already specified.
- # Otherwise, the last argument is the destination. Remove it from $@.
- for arg
- do
- if test -n "$dst_arg"; then
- # $@ is not empty: it contains at least $arg.
- set fnord "$@" "$dst_arg"
- shift # fnord
- fi
- shift # arg
- dst_arg=$arg
- # Protect names problematic for 'test' and other utilities.
- case $dst_arg in
- -* | [=\(\)!]) dst_arg=./$dst_arg;;
- esac
- done
-fi
-
-if test $# -eq 0; then
- if test -z "$dir_arg"; then
- echo "$0: no input file specified." >&2
- exit 1
- fi
- # It's OK to call 'install-sh -d' without argument.
- # This can happen when creating conditional directories.
- exit 0
-fi
-
-if test -z "$dir_arg"; then
- do_exit='(exit $ret); exit $ret'
- trap "ret=129; $do_exit" 1
- trap "ret=130; $do_exit" 2
- trap "ret=141; $do_exit" 13
- trap "ret=143; $do_exit" 15
-
- # Set umask so as not to create temps with too-generous modes.
- # However, 'strip' requires both read and write access to temps.
- case $mode in
- # Optimize common cases.
- *644) cp_umask=133;;
- *755) cp_umask=22;;
-
- *[0-7])
- if test -z "$stripcmd"; then
- u_plus_rw=
- else
- u_plus_rw='% 200'
- fi
- cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
- *)
- if test -z "$stripcmd"; then
- u_plus_rw=
- else
- u_plus_rw=,u+rw
- fi
- cp_umask=$mode$u_plus_rw;;
- esac
-fi
-
-for src
-do
- # Protect names problematic for 'test' and other utilities.
- case $src in
- -* | [=\(\)!]) src=./$src;;
- esac
-
- if test -n "$dir_arg"; then
- dst=$src
- dstdir=$dst
- test -d "$dstdir"
- dstdir_status=$?
- else
-
- # Waiting for this to be detected by the "$cpprog $src $dsttmp" command
- # might cause directories to be created, which would be especially bad
- # if $src (and thus $dsttmp) contains '*'.
- if test ! -f "$src" && test ! -d "$src"; then
- echo "$0: $src does not exist." >&2
- exit 1
- fi
-
- if test -z "$dst_arg"; then
- echo "$0: no destination specified." >&2
- exit 1
- fi
- dst=$dst_arg
-
- # If destination is a directory, append the input filename; won't work
- # if double slashes aren't ignored.
- if test -d "$dst"; then
- if test -n "$no_target_directory"; then
- echo "$0: $dst_arg: Is a directory" >&2
- exit 1
- fi
- dstdir=$dst
- dst=$dstdir/`basename "$src"`
- dstdir_status=0
- else
- # Prefer dirname, but fall back on a substitute if dirname fails.
- dstdir=`
- (dirname "$dst") 2>/dev/null ||
- expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$dst" : 'X\(//\)[^/]' \| \
- X"$dst" : 'X\(//\)$' \| \
- X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
- echo X"$dst" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
- s//\1/
- q
- }
- /^X\(\/\/\)[^/].*/{
- s//\1/
- q
- }
- /^X\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'
- `
-
- test -d "$dstdir"
- dstdir_status=$?
- fi
- fi
-
- obsolete_mkdir_used=false
-
- if test $dstdir_status != 0; then
- case $posix_mkdir in
- '')
- # Create intermediate dirs using mode 755 as modified by the umask.
- # This is like FreeBSD 'install' as of 1997-10-28.
- umask=`umask`
- case $stripcmd.$umask in
- # Optimize common cases.
- *[2367][2367]) mkdir_umask=$umask;;
- .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
-
- *[0-7])
- mkdir_umask=`expr $umask + 22 \
- - $umask % 100 % 40 + $umask % 20 \
- - $umask % 10 % 4 + $umask % 2
- `;;
- *) mkdir_umask=$umask,go-w;;
- esac
-
- # With -d, create the new directory with the user-specified mode.
- # Otherwise, rely on $mkdir_umask.
- if test -n "$dir_arg"; then
- mkdir_mode=-m$mode
- else
- mkdir_mode=
- fi
-
- posix_mkdir=false
- case $umask in
- *[123567][0-7][0-7])
- # POSIX mkdir -p sets u+wx bits regardless of umask, which
- # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
- ;;
- *)
- tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
- trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
-
- if (umask $mkdir_umask &&
- exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
- then
- if test -z "$dir_arg" || {
- # Check for POSIX incompatibilities with -m.
- # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
- # other-writable bit of parent directory when it shouldn't.
- # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
- ls_ld_tmpdir=`ls -ld "$tmpdir"`
- case $ls_ld_tmpdir in
- d????-?r-*) different_mode=700;;
- d????-?--*) different_mode=755;;
- *) false;;
- esac &&
- $mkdirprog -m$different_mode -p -- "$tmpdir" && {
- ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
- test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
- }
- }
- then posix_mkdir=:
- fi
- rmdir "$tmpdir/d" "$tmpdir"
- else
- # Remove any dirs left behind by ancient mkdir implementations.
- rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
- fi
- trap '' 0;;
- esac;;
- esac
-
- if
- $posix_mkdir && (
- umask $mkdir_umask &&
- $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
- )
- then :
- else
-
- # The umask is ridiculous, or mkdir does not conform to POSIX,
- # or it failed possibly due to a race condition. Create the
- # directory the slow way, step by step, checking for races as we go.
-
- case $dstdir in
- /*) prefix='/';;
- [-=\(\)!]*) prefix='./';;
- *) prefix='';;
- esac
-
- eval "$initialize_posix_glob"
-
- oIFS=$IFS
- IFS=/
- $posix_glob set -f
- set fnord $dstdir
- shift
- $posix_glob set +f
- IFS=$oIFS
-
- prefixes=
-
- for d
- do
- test X"$d" = X && continue
-
- prefix=$prefix$d
- if test -d "$prefix"; then
- prefixes=
- else
- if $posix_mkdir; then
- (umask=$mkdir_umask &&
- $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
- # Don't fail if two instances are running concurrently.
- test -d "$prefix" || exit 1
- else
- case $prefix in
- *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
- *) qprefix=$prefix;;
- esac
- prefixes="$prefixes '$qprefix'"
- fi
- fi
- prefix=$prefix/
- done
-
- if test -n "$prefixes"; then
- # Don't fail if two instances are running concurrently.
- (umask $mkdir_umask &&
- eval "\$doit_exec \$mkdirprog $prefixes") ||
- test -d "$dstdir" || exit 1
- obsolete_mkdir_used=true
- fi
- fi
- fi
-
- if test -n "$dir_arg"; then
- { test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
- { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
- { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
- test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
- else
-
- # Make a couple of temp file names in the proper directory.
- dsttmp=$dstdir/_inst.$$_
- rmtmp=$dstdir/_rm.$$_
-
- # Trap to clean up those temp files at exit.
- trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
-
- # Copy the file name to the temp name.
- (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
-
- # 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 $cpprog $src $dsttmp" command.
- #
- { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
- { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
- { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
- { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
-
- # If -C, don't bother to copy if it wouldn't change the file.
- if $copy_on_change &&
- old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
- new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
-
- eval "$initialize_posix_glob" &&
- $posix_glob set -f &&
- set X $old && old=:$2:$4:$5:$6 &&
- set X $new && new=:$2:$4:$5:$6 &&
- $posix_glob set +f &&
-
- test "$old" = "$new" &&
- $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
- then
- rm -f "$dsttmp"
- else
- # Rename the file to the real destination.
- $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
-
- # The rename failed, perhaps because mv can't rename something else
- # to itself, or perhaps because mv is so ancient that it does not
- # support -f.
- {
- # Now remove or move aside any old file at destination location.
- # We try this two ways since rm can't unlink itself on some
- # systems and the destination file might be busy for other
- # reasons. In this case, the final cleanup might fail but the new
- # file should still install successfully.
- {
- test ! -f "$dst" ||
- $doit $rmcmd -f "$dst" 2>/dev/null ||
- { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
- { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
- } ||
- { echo "$0: cannot unlink or rename $dst" >&2
- (exit 1); exit 1
- }
- } &&
-
- # Now rename the file to the real destination.
- $doit $mvcmd "$dsttmp" "$dst"
- }
- fi || exit 1
-
- trap '' 0
- fi
-done
-
-# Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
-# time-stamp-start: "scriptversion="
-# time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-time-zone: "UTC"
-# time-stamp-end: "; # UTC"
-# End:
diff --git a/Modules/_ctypes/libffi/libffi.pc.in b/Modules/_ctypes/libffi/libffi.pc.in
deleted file mode 100644
index edf6fde5e2..0000000000
--- a/Modules/_ctypes/libffi/libffi.pc.in
+++ /dev/null
@@ -1,11 +0,0 @@
-prefix=@prefix@
-exec_prefix=@exec_prefix@
-libdir=@libdir@
-toolexeclibdir=@toolexeclibdir@
-includedir=${libdir}/@PACKAGE_NAME@-@PACKAGE_VERSION@/include
-
-Name: @PACKAGE_NAME@
-Description: Library supporting Foreign Function Interfaces
-Version: @PACKAGE_VERSION@
-Libs: -L${toolexeclibdir} -lffi
-Cflags: -I${includedir}
diff --git a/Modules/_ctypes/libffi/libffi.xcodeproj/project.pbxproj b/Modules/_ctypes/libffi/libffi.xcodeproj/project.pbxproj
deleted file mode 100644
index 1cf396ffa1..0000000000
--- a/Modules/_ctypes/libffi/libffi.xcodeproj/project.pbxproj
+++ /dev/null
@@ -1,637 +0,0 @@
-// !$*UTF8*$!
-{
- archiveVersion = 1;
- classes = {
- };
- objectVersion = 46;
- objects = {
-
-/* Begin PBXBuildFile section */
- DBFA714A187F1D8600A76262 /* ffi.h in Headers */ = {isa = PBXBuildFile; fileRef = DBFA713E187F1D8600A76262 /* ffi.h */; };
- DBFA714B187F1D8600A76262 /* ffi_common.h in Headers */ = {isa = PBXBuildFile; fileRef = DBFA713F187F1D8600A76262 /* ffi_common.h */; };
- DBFA714C187F1D8600A76262 /* fficonfig.h in Headers */ = {isa = PBXBuildFile; fileRef = DBFA7140187F1D8600A76262 /* fficonfig.h */; };
- DBFA714D187F1D8600A76262 /* ffitarget.h in Headers */ = {isa = PBXBuildFile; fileRef = DBFA7141187F1D8600A76262 /* ffitarget.h */; };
- DBFA714E187F1D8600A76262 /* closures.c in Sources */ = {isa = PBXBuildFile; fileRef = DBFA7143187F1D8600A76262 /* closures.c */; };
- DBFA714F187F1D8600A76262 /* closures.c in Sources */ = {isa = PBXBuildFile; fileRef = DBFA7143187F1D8600A76262 /* closures.c */; };
- DBFA7156187F1D8600A76262 /* prep_cif.c in Sources */ = {isa = PBXBuildFile; fileRef = DBFA7147187F1D8600A76262 /* prep_cif.c */; };
- DBFA7157187F1D8600A76262 /* prep_cif.c in Sources */ = {isa = PBXBuildFile; fileRef = DBFA7147187F1D8600A76262 /* prep_cif.c */; };
- DBFA7158187F1D8600A76262 /* raw_api.c in Sources */ = {isa = PBXBuildFile; fileRef = DBFA7148187F1D8600A76262 /* raw_api.c */; };
- DBFA7159187F1D8600A76262 /* raw_api.c in Sources */ = {isa = PBXBuildFile; fileRef = DBFA7148187F1D8600A76262 /* raw_api.c */; };
- DBFA715A187F1D8600A76262 /* types.c in Sources */ = {isa = PBXBuildFile; fileRef = DBFA7149187F1D8600A76262 /* types.c */; };
- DBFA715B187F1D8600A76262 /* types.c in Sources */ = {isa = PBXBuildFile; fileRef = DBFA7149187F1D8600A76262 /* types.c */; };
- DBFA7177187F1D9B00A76262 /* ffi_arm64.c in Sources */ = {isa = PBXBuildFile; fileRef = DBFA716C187F1D9B00A76262 /* ffi_arm64.c */; };
- DBFA7178187F1D9B00A76262 /* sysv_arm64.S in Sources */ = {isa = PBXBuildFile; fileRef = DBFA716D187F1D9B00A76262 /* sysv_arm64.S */; };
- DBFA7179187F1D9B00A76262 /* ffi_armv7.c in Sources */ = {isa = PBXBuildFile; fileRef = DBFA716F187F1D9B00A76262 /* ffi_armv7.c */; };
- DBFA717A187F1D9B00A76262 /* sysv_armv7.S in Sources */ = {isa = PBXBuildFile; fileRef = DBFA7170187F1D9B00A76262 /* sysv_armv7.S */; };
- DBFA717B187F1D9B00A76262 /* trampoline_armv7.S in Sources */ = {isa = PBXBuildFile; fileRef = DBFA7171187F1D9B00A76262 /* trampoline_armv7.S */; };
- DBFA717C187F1D9B00A76262 /* darwin64_x86_64.S in Sources */ = {isa = PBXBuildFile; fileRef = DBFA7173187F1D9B00A76262 /* darwin64_x86_64.S */; };
- DBFA717D187F1D9B00A76262 /* darwin_i386.S in Sources */ = {isa = PBXBuildFile; fileRef = DBFA7174187F1D9B00A76262 /* darwin_i386.S */; };
- DBFA717E187F1D9B00A76262 /* ffi64_x86_64.c in Sources */ = {isa = PBXBuildFile; fileRef = DBFA7175187F1D9B00A76262 /* ffi64_x86_64.c */; };
- DBFA717F187F1D9B00A76262 /* ffi_i386.c in Sources */ = {isa = PBXBuildFile; fileRef = DBFA7176187F1D9B00A76262 /* ffi_i386.c */; };
- DBFA718E187F1DA100A76262 /* ffi_i386.h in Headers */ = {isa = PBXBuildFile; fileRef = DBFA7182187F1DA100A76262 /* ffi_i386.h */; };
- DBFA718F187F1DA100A76262 /* ffi_x86_64.h in Headers */ = {isa = PBXBuildFile; fileRef = DBFA7183187F1DA100A76262 /* ffi_x86_64.h */; };
- DBFA7190187F1DA100A76262 /* fficonfig_i386.h in Headers */ = {isa = PBXBuildFile; fileRef = DBFA7184187F1DA100A76262 /* fficonfig_i386.h */; };
- DBFA7191187F1DA100A76262 /* fficonfig_x86_64.h in Headers */ = {isa = PBXBuildFile; fileRef = DBFA7185187F1DA100A76262 /* fficonfig_x86_64.h */; };
- DBFA7192187F1DA100A76262 /* ffitarget_i386.h in Headers */ = {isa = PBXBuildFile; fileRef = DBFA7186187F1DA100A76262 /* ffitarget_i386.h */; };
- DBFA7193187F1DA100A76262 /* ffitarget_x86_64.h in Headers */ = {isa = PBXBuildFile; fileRef = DBFA7187187F1DA100A76262 /* ffitarget_x86_64.h */; };
- DBFA7194187F1DA100A76262 /* darwin64_x86_64.S in Sources */ = {isa = PBXBuildFile; fileRef = DBFA718A187F1DA100A76262 /* darwin64_x86_64.S */; };
- DBFA7195187F1DA100A76262 /* darwin_i386.S in Sources */ = {isa = PBXBuildFile; fileRef = DBFA718B187F1DA100A76262 /* darwin_i386.S */; };
- DBFA7196187F1DA100A76262 /* ffi64_x86_64.c in Sources */ = {isa = PBXBuildFile; fileRef = DBFA718C187F1DA100A76262 /* ffi64_x86_64.c */; };
- DBFA7197187F1DA100A76262 /* ffi_i386.c in Sources */ = {isa = PBXBuildFile; fileRef = DBFA718D187F1DA100A76262 /* ffi_i386.c */; };
-/* End PBXBuildFile section */
-
-/* Begin PBXCopyFilesBuildPhase section */
- DB13B1641849DF1E0010F42D /* CopyFiles */ = {
- isa = PBXCopyFilesBuildPhase;
- buildActionMask = 8;
- dstPath = "include/$(PRODUCT_NAME)";
- dstSubfolderSpec = 16;
- files = (
- );
- runOnlyForDeploymentPostprocessing = 1;
- };
-/* End PBXCopyFilesBuildPhase section */
-
-/* Begin PBXFileReference section */
- DB13B1661849DF1E0010F42D /* libffi.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libffi.a; sourceTree = BUILT_PRODUCTS_DIR; };
- DB13B1911849DF510010F42D /* ffi.dylib */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.dylib"; includeInIndex = 0; path = ffi.dylib; sourceTree = BUILT_PRODUCTS_DIR; };
- DBFA713E187F1D8600A76262 /* ffi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffi.h; sourceTree = "<group>"; };
- DBFA713F187F1D8600A76262 /* ffi_common.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffi_common.h; sourceTree = "<group>"; };
- DBFA7140187F1D8600A76262 /* fficonfig.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = fficonfig.h; sourceTree = "<group>"; };
- DBFA7141187F1D8600A76262 /* ffitarget.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffitarget.h; sourceTree = "<group>"; };
- DBFA7143187F1D8600A76262 /* closures.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = closures.c; sourceTree = "<group>"; };
- DBFA7145187F1D8600A76262 /* dlmalloc.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = dlmalloc.c; sourceTree = "<group>"; };
- DBFA7147187F1D8600A76262 /* prep_cif.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = prep_cif.c; sourceTree = "<group>"; };
- DBFA7148187F1D8600A76262 /* raw_api.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = raw_api.c; sourceTree = "<group>"; };
- DBFA7149187F1D8600A76262 /* types.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = types.c; sourceTree = "<group>"; };
- DBFA715E187F1D9B00A76262 /* ffi_arm64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffi_arm64.h; sourceTree = "<group>"; };
- DBFA715F187F1D9B00A76262 /* ffi_armv7.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffi_armv7.h; sourceTree = "<group>"; };
- DBFA7160187F1D9B00A76262 /* ffi_i386.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffi_i386.h; sourceTree = "<group>"; };
- DBFA7161187F1D9B00A76262 /* ffi_x86_64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffi_x86_64.h; sourceTree = "<group>"; };
- DBFA7162187F1D9B00A76262 /* fficonfig_arm64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = fficonfig_arm64.h; sourceTree = "<group>"; };
- DBFA7163187F1D9B00A76262 /* fficonfig_armv7.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = fficonfig_armv7.h; sourceTree = "<group>"; };
- DBFA7164187F1D9B00A76262 /* fficonfig_i386.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = fficonfig_i386.h; sourceTree = "<group>"; };
- DBFA7165187F1D9B00A76262 /* fficonfig_x86_64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = fficonfig_x86_64.h; sourceTree = "<group>"; };
- DBFA7166187F1D9B00A76262 /* ffitarget_arm64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffitarget_arm64.h; sourceTree = "<group>"; };
- DBFA7167187F1D9B00A76262 /* ffitarget_armv7.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffitarget_armv7.h; sourceTree = "<group>"; };
- DBFA7168187F1D9B00A76262 /* ffitarget_i386.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffitarget_i386.h; sourceTree = "<group>"; };
- DBFA7169187F1D9B00A76262 /* ffitarget_x86_64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffitarget_x86_64.h; sourceTree = "<group>"; };
- DBFA716C187F1D9B00A76262 /* ffi_arm64.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ffi_arm64.c; sourceTree = "<group>"; };
- DBFA716D187F1D9B00A76262 /* sysv_arm64.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = sysv_arm64.S; sourceTree = "<group>"; };
- DBFA716F187F1D9B00A76262 /* ffi_armv7.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ffi_armv7.c; sourceTree = "<group>"; };
- DBFA7170187F1D9B00A76262 /* sysv_armv7.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = sysv_armv7.S; sourceTree = "<group>"; };
- DBFA7171187F1D9B00A76262 /* trampoline_armv7.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = trampoline_armv7.S; sourceTree = "<group>"; };
- DBFA7173187F1D9B00A76262 /* darwin64_x86_64.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = darwin64_x86_64.S; sourceTree = "<group>"; };
- DBFA7174187F1D9B00A76262 /* darwin_i386.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = darwin_i386.S; sourceTree = "<group>"; };
- DBFA7175187F1D9B00A76262 /* ffi64_x86_64.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ffi64_x86_64.c; sourceTree = "<group>"; };
- DBFA7176187F1D9B00A76262 /* ffi_i386.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ffi_i386.c; sourceTree = "<group>"; };
- DBFA7182187F1DA100A76262 /* ffi_i386.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffi_i386.h; sourceTree = "<group>"; };
- DBFA7183187F1DA100A76262 /* ffi_x86_64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffi_x86_64.h; sourceTree = "<group>"; };
- DBFA7184187F1DA100A76262 /* fficonfig_i386.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = fficonfig_i386.h; sourceTree = "<group>"; };
- DBFA7185187F1DA100A76262 /* fficonfig_x86_64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = fficonfig_x86_64.h; sourceTree = "<group>"; };
- DBFA7186187F1DA100A76262 /* ffitarget_i386.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffitarget_i386.h; sourceTree = "<group>"; };
- DBFA7187187F1DA100A76262 /* ffitarget_x86_64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffitarget_x86_64.h; sourceTree = "<group>"; };
- DBFA718A187F1DA100A76262 /* darwin64_x86_64.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = darwin64_x86_64.S; sourceTree = "<group>"; };
- DBFA718B187F1DA100A76262 /* darwin_i386.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = darwin_i386.S; sourceTree = "<group>"; };
- DBFA718C187F1DA100A76262 /* ffi64_x86_64.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ffi64_x86_64.c; sourceTree = "<group>"; };
- DBFA718D187F1DA100A76262 /* ffi_i386.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ffi_i386.c; sourceTree = "<group>"; };
-/* End PBXFileReference section */
-
-/* Begin PBXGroup section */
- DB13B15B1849DEB70010F42D = {
- isa = PBXGroup;
- children = (
- DBFA713C187F1D8600A76262 /* darwin_common */,
- DBFA715C187F1D9B00A76262 /* darwin_ios */,
- DBFA7180187F1DA100A76262 /* darwin_osx */,
- DB13B1671849DF1E0010F42D /* Products */,
- );
- sourceTree = "<group>";
- };
- DB13B1671849DF1E0010F42D /* Products */ = {
- isa = PBXGroup;
- children = (
- DB13B1661849DF1E0010F42D /* libffi.a */,
- DB13B1911849DF510010F42D /* ffi.dylib */,
- );
- name = Products;
- sourceTree = "<group>";
- };
- DBFA713C187F1D8600A76262 /* darwin_common */ = {
- isa = PBXGroup;
- children = (
- DBFA713D187F1D8600A76262 /* include */,
- DBFA7142187F1D8600A76262 /* src */,
- );
- path = "darwin_common";
- sourceTree = "<group>";
- };
- DBFA713D187F1D8600A76262 /* include */ = {
- isa = PBXGroup;
- children = (
- DBFA713E187F1D8600A76262 /* ffi.h */,
- DBFA713F187F1D8600A76262 /* ffi_common.h */,
- DBFA7140187F1D8600A76262 /* fficonfig.h */,
- DBFA7141187F1D8600A76262 /* ffitarget.h */,
- );
- path = include;
- sourceTree = "<group>";
- };
- DBFA7142187F1D8600A76262 /* src */ = {
- isa = PBXGroup;
- children = (
- DBFA7143187F1D8600A76262 /* closures.c */,
- DBFA7145187F1D8600A76262 /* dlmalloc.c */,
- DBFA7147187F1D8600A76262 /* prep_cif.c */,
- DBFA7148187F1D8600A76262 /* raw_api.c */,
- DBFA7149187F1D8600A76262 /* types.c */,
- );
- path = src;
- sourceTree = "<group>";
- };
- DBFA715C187F1D9B00A76262 /* darwin_ios */ = {
- isa = PBXGroup;
- children = (
- DBFA715D187F1D9B00A76262 /* include */,
- DBFA716A187F1D9B00A76262 /* src */,
- );
- path = "darwin_ios";
- sourceTree = "<group>";
- };
- DBFA715D187F1D9B00A76262 /* include */ = {
- isa = PBXGroup;
- children = (
- DBFA715E187F1D9B00A76262 /* ffi_arm64.h */,
- DBFA715F187F1D9B00A76262 /* ffi_armv7.h */,
- DBFA7160187F1D9B00A76262 /* ffi_i386.h */,
- DBFA7161187F1D9B00A76262 /* ffi_x86_64.h */,
- DBFA7162187F1D9B00A76262 /* fficonfig_arm64.h */,
- DBFA7163187F1D9B00A76262 /* fficonfig_armv7.h */,
- DBFA7164187F1D9B00A76262 /* fficonfig_i386.h */,
- DBFA7165187F1D9B00A76262 /* fficonfig_x86_64.h */,
- DBFA7166187F1D9B00A76262 /* ffitarget_arm64.h */,
- DBFA7167187F1D9B00A76262 /* ffitarget_armv7.h */,
- DBFA7168187F1D9B00A76262 /* ffitarget_i386.h */,
- DBFA7169187F1D9B00A76262 /* ffitarget_x86_64.h */,
- );
- path = include;
- sourceTree = "<group>";
- };
- DBFA716A187F1D9B00A76262 /* src */ = {
- isa = PBXGroup;
- children = (
- DBFA716B187F1D9B00A76262 /* aarch64 */,
- DBFA716E187F1D9B00A76262 /* arm */,
- DBFA7172187F1D9B00A76262 /* x86 */,
- );
- path = src;
- sourceTree = "<group>";
- };
- DBFA716B187F1D9B00A76262 /* aarch64 */ = {
- isa = PBXGroup;
- children = (
- DBFA716C187F1D9B00A76262 /* ffi_arm64.c */,
- DBFA716D187F1D9B00A76262 /* sysv_arm64.S */,
- );
- path = aarch64;
- sourceTree = "<group>";
- };
- DBFA716E187F1D9B00A76262 /* arm */ = {
- isa = PBXGroup;
- children = (
- DBFA716F187F1D9B00A76262 /* ffi_armv7.c */,
- DBFA7170187F1D9B00A76262 /* sysv_armv7.S */,
- DBFA7171187F1D9B00A76262 /* trampoline_armv7.S */,
- );
- path = arm;
- sourceTree = "<group>";
- };
- DBFA7172187F1D9B00A76262 /* x86 */ = {
- isa = PBXGroup;
- children = (
- DBFA7173187F1D9B00A76262 /* darwin64_x86_64.S */,
- DBFA7174187F1D9B00A76262 /* darwin_i386.S */,
- DBFA7175187F1D9B00A76262 /* ffi64_x86_64.c */,
- DBFA7176187F1D9B00A76262 /* ffi_i386.c */,
- );
- path = x86;
- sourceTree = "<group>";
- };
- DBFA7180187F1DA100A76262 /* darwin_osx */ = {
- isa = PBXGroup;
- children = (
- DBFA7181187F1DA100A76262 /* include */,
- DBFA7188187F1DA100A76262 /* src */,
- );
- path = "darwin_osx";
- sourceTree = "<group>";
- };
- DBFA7181187F1DA100A76262 /* include */ = {
- isa = PBXGroup;
- children = (
- DBFA7182187F1DA100A76262 /* ffi_i386.h */,
- DBFA7183187F1DA100A76262 /* ffi_x86_64.h */,
- DBFA7184187F1DA100A76262 /* fficonfig_i386.h */,
- DBFA7185187F1DA100A76262 /* fficonfig_x86_64.h */,
- DBFA7186187F1DA100A76262 /* ffitarget_i386.h */,
- DBFA7187187F1DA100A76262 /* ffitarget_x86_64.h */,
- );
- path = include;
- sourceTree = "<group>";
- };
- DBFA7188187F1DA100A76262 /* src */ = {
- isa = PBXGroup;
- children = (
- DBFA7189187F1DA100A76262 /* x86 */,
- );
- path = src;
- sourceTree = "<group>";
- };
- DBFA7189187F1DA100A76262 /* x86 */ = {
- isa = PBXGroup;
- children = (
- DBFA718A187F1DA100A76262 /* darwin64_x86_64.S */,
- DBFA718B187F1DA100A76262 /* darwin_i386.S */,
- DBFA718C187F1DA100A76262 /* ffi64_x86_64.c */,
- DBFA718D187F1DA100A76262 /* ffi_i386.c */,
- );
- path = x86;
- sourceTree = "<group>";
- };
-/* End PBXGroup section */
-
-/* Begin PBXHeadersBuildPhase section */
- DB13B18F1849DF510010F42D /* Headers */ = {
- isa = PBXHeadersBuildPhase;
- buildActionMask = 2147483647;
- files = (
- DBFA714C187F1D8600A76262 /* fficonfig.h in Headers */,
- DBFA714D187F1D8600A76262 /* ffitarget.h in Headers */,
- DBFA714A187F1D8600A76262 /* ffi.h in Headers */,
- DBFA718F187F1DA100A76262 /* ffi_x86_64.h in Headers */,
- DBFA7191187F1DA100A76262 /* fficonfig_x86_64.h in Headers */,
- DBFA718E187F1DA100A76262 /* ffi_i386.h in Headers */,
- DBFA7190187F1DA100A76262 /* fficonfig_i386.h in Headers */,
- DBFA714B187F1D8600A76262 /* ffi_common.h in Headers */,
- DBFA7193187F1DA100A76262 /* ffitarget_x86_64.h in Headers */,
- DBFA7192187F1DA100A76262 /* ffitarget_i386.h in Headers */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
-/* End PBXHeadersBuildPhase section */
-
-/* Begin PBXNativeTarget section */
- DB13B1651849DF1E0010F42D /* libffi-iOS */ = {
- isa = PBXNativeTarget;
- buildConfigurationList = DB13B18B1849DF1E0010F42D /* Build configuration list for PBXNativeTarget "libffi-iOS" */;
- buildPhases = (
- DB13B3051849E01C0010F42D /* ShellScript */,
- DB13B1621849DF1E0010F42D /* Sources */,
- DB13B1641849DF1E0010F42D /* CopyFiles */,
- );
- buildRules = (
- );
- dependencies = (
- );
- name = "libffi-iOS";
- productName = ffi;
- productReference = DB13B1661849DF1E0010F42D /* libffi.a */;
- productType = "com.apple.product-type.library.static";
- };
- DB13B1901849DF510010F42D /* libffi-Mac */ = {
- isa = PBXNativeTarget;
- buildConfigurationList = DB13B1B01849DF520010F42D /* Build configuration list for PBXNativeTarget "libffi-Mac" */;
- buildPhases = (
- DB13B3061849E0490010F42D /* ShellScript */,
- DB13B18D1849DF510010F42D /* Sources */,
- DB13B18F1849DF510010F42D /* Headers */,
- );
- buildRules = (
- );
- dependencies = (
- );
- name = "libffi-Mac";
- productName = ffi;
- productReference = DB13B1911849DF510010F42D /* ffi.dylib */;
- productType = "com.apple.product-type.library.dynamic";
- };
-/* End PBXNativeTarget section */
-
-/* Begin PBXProject section */
- DB13B15C1849DEB70010F42D /* Project object */ = {
- isa = PBXProject;
- attributes = {
- LastUpgradeCheck = 0510;
- };
- buildConfigurationList = DB13B15F1849DEB70010F42D /* Build configuration list for PBXProject "libffi" */;
- compatibilityVersion = "Xcode 3.2";
- developmentRegion = English;
- hasScannedForEncodings = 0;
- knownRegions = (
- en,
- );
- mainGroup = DB13B15B1849DEB70010F42D;
- productRefGroup = DB13B1671849DF1E0010F42D /* Products */;
- projectDirPath = "";
- projectRoot = "";
- targets = (
- DB13B1651849DF1E0010F42D /* libffi-iOS */,
- DB13B1901849DF510010F42D /* libffi-Mac */,
- );
- };
-/* End PBXProject section */
-
-/* Begin PBXShellScriptBuildPhase section */
- DB13B3051849E01C0010F42D /* ShellScript */ = {
- isa = PBXShellScriptBuildPhase;
- buildActionMask = 2147483647;
- files = (
- );
- inputPaths = (
- );
- outputPaths = (
- );
- runOnlyForDeploymentPostprocessing = 0;
- shellPath = /bin/sh;
- shellScript = "/usr/bin/python generate-darwin-source-and-headers.py --only-ios";
- };
- DB13B3061849E0490010F42D /* ShellScript */ = {
- isa = PBXShellScriptBuildPhase;
- buildActionMask = 2147483647;
- files = (
- );
- inputPaths = (
- );
- outputPaths = (
- );
- runOnlyForDeploymentPostprocessing = 0;
- shellPath = /bin/sh;
- shellScript = "/usr/bin/python generate-darwin-source-and-headers.py --only-osx";
- };
-/* End PBXShellScriptBuildPhase section */
-
-/* Begin PBXSourcesBuildPhase section */
- DB13B1621849DF1E0010F42D /* Sources */ = {
- isa = PBXSourcesBuildPhase;
- buildActionMask = 2147483647;
- files = (
- DBFA717E187F1D9B00A76262 /* ffi64_x86_64.c in Sources */,
- DBFA7179187F1D9B00A76262 /* ffi_armv7.c in Sources */,
- DBFA717B187F1D9B00A76262 /* trampoline_armv7.S in Sources */,
- DBFA714E187F1D8600A76262 /* closures.c in Sources */,
- DBFA717A187F1D9B00A76262 /* sysv_armv7.S in Sources */,
- DBFA717D187F1D9B00A76262 /* darwin_i386.S in Sources */,
- DBFA7156187F1D8600A76262 /* prep_cif.c in Sources */,
- DBFA717F187F1D9B00A76262 /* ffi_i386.c in Sources */,
- DBFA7158187F1D8600A76262 /* raw_api.c in Sources */,
- DBFA7178187F1D9B00A76262 /* sysv_arm64.S in Sources */,
- DBFA717C187F1D9B00A76262 /* darwin64_x86_64.S in Sources */,
- DBFA715A187F1D8600A76262 /* types.c in Sources */,
- DBFA7177187F1D9B00A76262 /* ffi_arm64.c in Sources */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
- DB13B18D1849DF510010F42D /* Sources */ = {
- isa = PBXSourcesBuildPhase;
- buildActionMask = 2147483647;
- files = (
- DBFA7196187F1DA100A76262 /* ffi64_x86_64.c in Sources */,
- DBFA7195187F1DA100A76262 /* darwin_i386.S in Sources */,
- DBFA7157187F1D8600A76262 /* prep_cif.c in Sources */,
- DBFA7197187F1DA100A76262 /* ffi_i386.c in Sources */,
- DBFA715B187F1D8600A76262 /* types.c in Sources */,
- DBFA7159187F1D8600A76262 /* raw_api.c in Sources */,
- DBFA714F187F1D8600A76262 /* closures.c in Sources */,
- DBFA7194187F1DA100A76262 /* darwin64_x86_64.S in Sources */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
-/* End PBXSourcesBuildPhase section */
-
-/* Begin XCBuildConfiguration section */
- DB13B1601849DEB70010F42D /* Debug */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- HEADER_SEARCH_PATHS = (
- "$(inherited)",
- "darwin_common/include",
- );
- ONLY_ACTIVE_ARCH = YES;
- };
- name = Debug;
- };
- DB13B1611849DEB70010F42D /* Release */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- HEADER_SEARCH_PATHS = (
- "$(inherited)",
- "darwin_common/include",
- );
- };
- name = Release;
- };
- DB13B1871849DF1E0010F42D /* Debug */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- ALWAYS_SEARCH_USER_PATHS = NO;
- ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)";
- CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
- CLANG_CXX_LIBRARY = "libc++";
- CLANG_ENABLE_MODULES = YES;
- CLANG_ENABLE_OBJC_ARC = YES;
- CLANG_WARN_BOOL_CONVERSION = YES;
- CLANG_WARN_CONSTANT_CONVERSION = YES;
- CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
- CLANG_WARN_EMPTY_BODY = YES;
- CLANG_WARN_ENUM_CONVERSION = YES;
- CLANG_WARN_INT_CONVERSION = YES;
- CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
- CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
- COPY_PHASE_STRIP = NO;
- DSTROOT = /tmp/ffi.dst;
- GCC_C_LANGUAGE_STANDARD = gnu99;
- GCC_DYNAMIC_NO_PIC = NO;
- GCC_OPTIMIZATION_LEVEL = 0;
- GCC_PREPROCESSOR_DEFINITIONS = (
- "DEBUG=1",
- "$(inherited)",
- );
- GCC_SYMBOLS_PRIVATE_EXTERN = NO;
- GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
- GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
- GCC_WARN_UNDECLARED_SELECTOR = YES;
- GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
- GCC_WARN_UNUSED_FUNCTION = YES;
- GCC_WARN_UNUSED_VARIABLE = YES;
- HEADER_SEARCH_PATHS = (
- "$(inherited)",
- "darwin_ios/include",
- );
- IPHONEOS_DEPLOYMENT_TARGET = 5.0;
- "IPHONEOS_DEPLOYMENT_TARGET[arch=arm64]" = 7.0;
- OTHER_LDFLAGS = "-ObjC";
- PRODUCT_NAME = ffi;
- SDKROOT = iphoneos;
- SKIP_INSTALL = YES;
- };
- name = Debug;
- };
- DB13B1881849DF1E0010F42D /* Release */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- ALWAYS_SEARCH_USER_PATHS = NO;
- ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)";
- CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
- CLANG_CXX_LIBRARY = "libc++";
- CLANG_ENABLE_MODULES = YES;
- CLANG_ENABLE_OBJC_ARC = YES;
- CLANG_WARN_BOOL_CONVERSION = YES;
- CLANG_WARN_CONSTANT_CONVERSION = YES;
- CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
- CLANG_WARN_EMPTY_BODY = YES;
- CLANG_WARN_ENUM_CONVERSION = YES;
- CLANG_WARN_INT_CONVERSION = YES;
- CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
- CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
- COPY_PHASE_STRIP = YES;
- DSTROOT = /tmp/ffi.dst;
- ENABLE_NS_ASSERTIONS = NO;
- GCC_C_LANGUAGE_STANDARD = gnu99;
- GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
- GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
- GCC_WARN_UNDECLARED_SELECTOR = YES;
- GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
- GCC_WARN_UNUSED_FUNCTION = YES;
- GCC_WARN_UNUSED_VARIABLE = YES;
- HEADER_SEARCH_PATHS = (
- "$(inherited)",
- "darwin_ios/include",
- );
- IPHONEOS_DEPLOYMENT_TARGET = 5.0;
- "IPHONEOS_DEPLOYMENT_TARGET[arch=arm64]" = 7.0;
- OTHER_LDFLAGS = "-ObjC";
- PRODUCT_NAME = ffi;
- SDKROOT = iphoneos;
- SKIP_INSTALL = YES;
- VALIDATE_PRODUCT = YES;
- };
- name = Release;
- };
- DB13B1B11849DF520010F42D /* Debug */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- ALWAYS_SEARCH_USER_PATHS = NO;
- CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
- CLANG_CXX_LIBRARY = "libc++";
- CLANG_ENABLE_OBJC_ARC = YES;
- CLANG_WARN_BOOL_CONVERSION = YES;
- CLANG_WARN_CONSTANT_CONVERSION = YES;
- CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
- CLANG_WARN_EMPTY_BODY = YES;
- CLANG_WARN_ENUM_CONVERSION = YES;
- CLANG_WARN_INT_CONVERSION = YES;
- CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
- CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
- COPY_PHASE_STRIP = NO;
- DYLIB_COMPATIBILITY_VERSION = 1;
- DYLIB_CURRENT_VERSION = 1;
- GCC_C_LANGUAGE_STANDARD = gnu99;
- GCC_DYNAMIC_NO_PIC = NO;
- GCC_ENABLE_OBJC_EXCEPTIONS = YES;
- GCC_OPTIMIZATION_LEVEL = 0;
- GCC_PREPROCESSOR_DEFINITIONS = (
- "DEBUG=1",
- "$(inherited)",
- );
- GCC_SYMBOLS_PRIVATE_EXTERN = NO;
- GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
- GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
- GCC_WARN_UNDECLARED_SELECTOR = YES;
- GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
- GCC_WARN_UNUSED_FUNCTION = YES;
- GCC_WARN_UNUSED_VARIABLE = YES;
- HEADER_SEARCH_PATHS = (
- "$(inherited)",
- "darwin_osx/include",
- );
- MACOSX_DEPLOYMENT_TARGET = 10.6;
- ONLY_ACTIVE_ARCH = YES;
- OTHER_LDFLAGS = "-Wl,-no_compact_unwind";
- PRODUCT_NAME = ffi;
- SDKROOT = macosx;
- };
- name = Debug;
- };
- DB13B1B21849DF520010F42D /* Release */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- ALWAYS_SEARCH_USER_PATHS = NO;
- CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
- CLANG_CXX_LIBRARY = "libc++";
- CLANG_ENABLE_OBJC_ARC = YES;
- CLANG_WARN_BOOL_CONVERSION = YES;
- CLANG_WARN_CONSTANT_CONVERSION = YES;
- CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
- CLANG_WARN_EMPTY_BODY = YES;
- CLANG_WARN_ENUM_CONVERSION = YES;
- CLANG_WARN_INT_CONVERSION = YES;
- CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
- CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
- COPY_PHASE_STRIP = YES;
- DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
- DYLIB_COMPATIBILITY_VERSION = 1;
- DYLIB_CURRENT_VERSION = 1;
- ENABLE_NS_ASSERTIONS = NO;
- GCC_C_LANGUAGE_STANDARD = gnu99;
- GCC_ENABLE_OBJC_EXCEPTIONS = YES;
- GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
- GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
- GCC_WARN_UNDECLARED_SELECTOR = YES;
- GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
- GCC_WARN_UNUSED_FUNCTION = YES;
- GCC_WARN_UNUSED_VARIABLE = YES;
- HEADER_SEARCH_PATHS = (
- "$(inherited)",
- "darwin_osx/include",
- );
- MACOSX_DEPLOYMENT_TARGET = 10.6;
- OTHER_LDFLAGS = "-Wl,-no_compact_unwind";
- PRODUCT_NAME = ffi;
- SDKROOT = macosx;
- };
- name = Release;
- };
-/* End XCBuildConfiguration section */
-
-/* Begin XCConfigurationList section */
- DB13B15F1849DEB70010F42D /* Build configuration list for PBXProject "libffi" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- DB13B1601849DEB70010F42D /* Debug */,
- DB13B1611849DEB70010F42D /* Release */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Release;
- };
- DB13B18B1849DF1E0010F42D /* Build configuration list for PBXNativeTarget "libffi-iOS" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- DB13B1871849DF1E0010F42D /* Debug */,
- DB13B1881849DF1E0010F42D /* Release */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Release;
- };
- DB13B1B01849DF520010F42D /* Build configuration list for PBXNativeTarget "libffi-Mac" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- DB13B1B11849DF520010F42D /* Debug */,
- DB13B1B21849DF520010F42D /* Release */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Release;
- };
-/* End XCConfigurationList section */
- };
- rootObject = DB13B15C1849DEB70010F42D /* Project object */;
-}
diff --git a/Modules/_ctypes/libffi/libtool-ldflags b/Modules/_ctypes/libffi/libtool-ldflags
deleted file mode 100644
index e32e37bf10..0000000000
--- a/Modules/_ctypes/libffi/libtool-ldflags
+++ /dev/null
@@ -1,106 +0,0 @@
-#! /bin/sh
-
-# Script to translate LDFLAGS into a form suitable for use with libtool.
-
-# Copyright (C) 2005 Free Software Foundation, Inc.
-#
-# 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., 51 Franklin Street, Fifth Floor, Boston,
-# MA 02110-1301, USA.
-
-# Contributed by CodeSourcery, LLC.
-
-# This script is designed to be used from a Makefile that uses libtool
-# to build libraries as follows:
-#
-# LTLDFLAGS = $(shell libtool-ldflags $(LDFLAGS))
-#
-# Then, use (LTLDFLAGS) in place of $(LDFLAGS) in your link line.
-
-# The output of the script. This string is built up as we process the
-# arguments.
-result=
-prev_arg=
-
-for arg
-do
- case $arg in
- -f*|--*)
- # Libtool does not ascribe any special meaning options
- # that begin with -f or with a double-dash. So, it will
- # think these options are linker options, and prefix them
- # with "-Wl,". Then, the compiler driver will ignore the
- # options. So, we prefix these options with -Xcompiler to
- # make clear to libtool that they are in fact compiler
- # options.
- case $prev_arg in
- -Xpreprocessor|-Xcompiler|-Xlinker)
- # This option is already prefixed; don't prefix it again.
- ;;
- *)
- result="$result -Xcompiler"
- ;;
- esac
- ;;
- *)
- # We do not want to add -Xcompiler to other options because
- # that would prevent libtool itself from recognizing them.
- ;;
- esac
- prev_arg=$arg
-
- # If $(LDFLAGS) is (say):
- # a "b'c d" e
- # then the user expects that:
- # $(LD) $(LDFLAGS)
- # will pass three arguments to $(LD):
- # 1) a
- # 2) b'c d
- # 3) e
- # We must ensure, therefore, that the arguments are appropriately
- # quoted so that using:
- # libtool --mode=link ... $(LTLDFLAGS)
- # will result in the same number of arguments being passed to
- # libtool. In other words, when this script was invoked, the shell
- # removed one level of quoting, present in $(LDFLAGS); we have to put
- # it back.
-
- # Quote any embedded single quotes.
- case $arg in
- *"'"*)
- # The following command creates the script:
- # 1s,^X,,;s|'|'"'"'|g
- # which removes a leading X, and then quotes and embedded single
- # quotes.
- sed_script="1s,^X,,;s|'|'\"'\"'|g"
- # Add a leading "X" so that if $arg starts with a dash,
- # the echo command will not try to interpret the argument
- # as a command-line option.
- arg="X$arg"
- # Generate the quoted string.
- quoted_arg=`echo "$arg" | sed -e "$sed_script"`
- ;;
- *)
- quoted_arg=$arg
- ;;
- esac
- # Surround the entire argument with single quotes.
- quoted_arg="'"$quoted_arg"'"
-
- # Add it to the string.
- result="$result $quoted_arg"
-done
-
-# Output the string we have built up.
-echo "$result"
diff --git a/Modules/_ctypes/libffi/libtool-version b/Modules/_ctypes/libffi/libtool-version
deleted file mode 100644
index d4f501c4d0..0000000000
--- a/Modules/_ctypes/libffi/libtool-version
+++ /dev/null
@@ -1,29 +0,0 @@
-# This file is used to maintain libtool version info for libffi. See
-# the libtool manual to understand the meaning of the fields. This is
-# a separate file so that version updates don't involve re-running
-# automake.
-#
-# Here are a set of rules to help you update your library version
-# information:
-#
-# 1. Start with version information of `0:0:0' for each libtool library.
-#
-# 2. Update the version information only immediately before a public
-# release of your software. More frequent updates are unnecessary,
-# and only guarantee that the current interface number gets larger
-# faster.
-#
-# 3. If the library source code has changed at all since the last
-# update, then increment revision (`c:r:a' becomes `c:r+1:a').
-#
-# 4. If any interfaces have been added, removed, or changed since the
-# last update, increment current, and set revision to 0.
-#
-# 5. If any interfaces have been added since the last public release,
-# then increment age.
-#
-# 6. If any interfaces have been removed since the last public
-# release, then set age to 0.
-#
-# CURRENT:REVISION:AGE
-6:2:0
diff --git a/Modules/_ctypes/libffi/ltmain.sh b/Modules/_ctypes/libffi/ltmain.sh
deleted file mode 100644
index 059598045e..0000000000
--- a/Modules/_ctypes/libffi/ltmain.sh
+++ /dev/null
@@ -1,10932 +0,0 @@
-#! /bin/sh
-
-# libtool (GNU libtool) 2.4.2.418
-# Provide generalized library-building support services.
-# Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
-
-# Copyright (C) 1996-2013 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.
-
-# GNU Libtool 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.
-#
-# As a special exception to the GNU General Public License,
-# if you distribute this file as part of a program or library that
-# is built using GNU Libtool, you may include this file under the
-# same distribution terms that you use for the rest of that program.
-#
-# GNU Libtool 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, see <http://www.gnu.org/licenses/>.
-
-
-PROGRAM=libtool
-PACKAGE=libtool
-VERSION=2.4.2.418
-package_revision=2.4.2.418
-
-
-## ------ ##
-## Usage. ##
-## ------ ##
-
-# Run './libtool --help' for help with using this script from the
-# command line.
-
-
-## ------------------------------- ##
-## User overridable command paths. ##
-## ------------------------------- ##
-
-# After configure completes, it has a better idea of some of the
-# shell tools we need than the defaults used by the functions shared
-# with bootstrap, so set those here where they can still be over-
-# ridden by the user, but otherwise take precedence.
-
-: ${AUTOCONF="autoconf"}
-: ${AUTOMAKE="automake"}
-
-
-## -------------------------- ##
-## Source external libraries. ##
-## -------------------------- ##
-
-# Much of our low-level functionality needs to be sourced from external
-# libraries, which are installed to $pkgauxdir.
-
-# Set a version string for this script.
-scriptversion=2013-08-23.20; # UTC
-
-# General shell script boiler plate, and helper functions.
-# Written by Gary V. Vaughan, 2004
-
-# Copyright (C) 2004-2013 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.
-
-# 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 3 of the License, or
-# (at your option) any later version.
-
-# As a special exception to the GNU General Public License, if you distribute
-# this file as part of a program or library that is built using GNU Libtool,
-# you may include this file under the same distribution terms that you use
-# for the rest of that program.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNES 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, see <http://www.gnu.org/licenses/>.
-
-# Please report bugs or propose patches to gary@gnu.org.
-
-
-## ------ ##
-## Usage. ##
-## ------ ##
-
-# Evaluate this file near the top of your script to gain access to
-# the functions and variables defined here:
-#
-# . `echo "$0" | ${SED-sed} 's|[^/]*$||'`/build-aux/funclib.sh
-#
-# If you need to override any of the default environment variable
-# settings, do that before evaluating this file.
-
-
-## -------------------- ##
-## Shell normalisation. ##
-## -------------------- ##
-
-# Some shells need a little help to be as Bourne compatible as possible.
-# Before doing anything else, make sure all that help has been provided!
-
-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
-
-# NLS nuisances: We save the old values in case they are required later.
-_G_user_locale=
-_G_safe_locale=
-for _G_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
-do
- eval "if test set = \"\${$_G_var+set}\"; then
- save_$_G_var=\$$_G_var
- $_G_var=C
- export $_G_var
- _G_user_locale=\"$_G_var=\\\$save_\$_G_var; \$_G_user_locale\"
- _G_safe_locale=\"$_G_var=C; \$_G_safe_locale\"
- fi"
-done
-
-# CDPATH.
-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
-
-# Make sure IFS has a sensible default
-sp=' '
-nl='
-'
-IFS="$sp $nl"
-
-# There are still modern systems that have problems with 'echo' mis-
-# handling backslashes, among others, so make sure $bs_echo is set to a
-# command that correctly interprets backslashes.
-# (this code from Autoconf 2.68)
-
-# Printing a long string crashes Solaris 7 /usr/bin/printf.
-bs_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
-bs_echo=$bs_echo$bs_echo$bs_echo$bs_echo$bs_echo
-bs_echo=$bs_echo$bs_echo$bs_echo$bs_echo$bs_echo$bs_echo
-# Prefer a ksh shell builtin over an external printf program on Solaris,
-# but without wasting forks for bash or zsh.
-if test -z "$BASH_VERSION$ZSH_VERSION" \
- && (test "X`print -r -- $bs_echo`" = "X$bs_echo") 2>/dev/null; then
- bs_echo='print -r --'
- bs_echo_n='print -rn --'
-elif (test "X`printf %s $bs_echo`" = "X$bs_echo") 2>/dev/null; then
- bs_echo='printf %s\n'
- bs_echo_n='printf %s'
-else
- if test "X`(/usr/ucb/echo -n -n $bs_echo) 2>/dev/null`" = "X-n $bs_echo"; then
- bs_echo_body='eval /usr/ucb/echo -n "$1$nl"'
- bs_echo_n='/usr/ucb/echo -n'
- else
- bs_echo_body='eval expr "X$1" : "X\\(.*\\)"'
- bs_echo_n_body='eval
- arg=$1;
- case $arg in #(
- *"$nl"*)
- expr "X$arg" : "X\\(.*\\)$nl";
- arg=`expr "X$arg" : ".*$nl\\(.*\\)"`;;
- esac;
- expr "X$arg" : "X\\(.*\\)" | tr -d "$nl"
- '
- export bs_echo_n_body
- bs_echo_n='sh -c $bs_echo_n_body bs_echo'
- fi
- export bs_echo_body
- bs_echo='sh -c $bs_echo_body bs_echo'
-fi
-
-
-## ------------------------------- ##
-## User overridable command paths. ##
-## ------------------------------- ##
-
-# All uppercase variable names are used for environment variables. These
-# variables can be overridden by the user before calling a script that
-# uses them if a suitable command of that name is not already available
-# in the command search PATH.
-
-: ${CP="cp -f"}
-: ${ECHO="$bs_echo"}
-: ${EGREP="grep -E"}
-: ${FGREP="grep -F"}
-: ${GREP="grep"}
-: ${LN_S="ln -s"}
-: ${MAKE="make"}
-: ${MKDIR="mkdir"}
-: ${MV="mv -f"}
-: ${RM="rm -f"}
-: ${SED="sed"}
-: ${SHELL="${CONFIG_SHELL-/bin/sh}"}
-
-
-## -------------------- ##
-## Useful sed snippets. ##
-## -------------------- ##
-
-sed_dirname='s|/[^/]*$||'
-sed_basename='s|^.*/||'
-
-# Sed substitution that helps us do robust quoting. It backslashifies
-# metacharacters that are still active within double-quoted strings.
-sed_quote_subst='s|\([`"$\\]\)|\\\1|g'
-
-# Same as above, but do not quote variable references.
-sed_double_quote_subst='s/\(["`\\]\)/\\\1/g'
-
-# Sed substitution that turns a string into a regex matching for the
-# string literally.
-sed_make_literal_regex='s|[].[^$\\*\/]|\\&|g'
-
-# Sed substitution that converts a w32 file name or path
-# that contains forward slashes, into one that contains
-# (escaped) backslashes. A very naive implementation.
-sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
-
-# Re-'\' parameter expansions in output of sed_double_quote_subst that
-# were '\'-ed in input to the same. If an odd number of '\' preceded a
-# '$' in input to sed_double_quote_subst, that '$' was protected from
-# expansion. Since each input '\' is now two '\'s, look for any number
-# of runs of four '\'s followed by two '\'s and then a '$'. '\' that '$'.
-_G_bs='\\'
-_G_bs2='\\\\'
-_G_bs4='\\\\\\\\'
-_G_dollar='\$'
-sed_double_backslash="\
- s/$_G_bs4/&\\
-/g
- s/^$_G_bs2$_G_dollar/$_G_bs&/
- s/\\([^$_G_bs]\\)$_G_bs2$_G_dollar/\\1$_G_bs2$_G_bs$_G_dollar/g
- s/\n//g"
-
-
-## ----------------- ##
-## Global variables. ##
-## ----------------- ##
-
-# Except for the global variables explicitly listed below, the following
-# functions in the '^func_' namespace, and the '^require_' namespace
-# variables initialised in the 'Resource management' section, sourcing
-# this file will not pollute your global namespace with anything
-# else. There's no portable way to scope variables in Bourne shell
-# though, so actually running these functions will sometimes place
-# results into a variable named after the function, and often use
-# temporary variables in the '^_G_' namespace. If you are careful to
-# avoid using those namespaces casually in your sourcing script, things
-# should continue to work as you expect. And, of course, you can freely
-# overwrite any of the functions or variables defined here before
-# calling anything to customize them.
-
-EXIT_SUCCESS=0
-EXIT_FAILURE=1
-EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing.
-EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake.
-
-# Allow overriding, eg assuming that you follow the convention of
-# putting '$debug_cmd' at the start of all your functions, you can get
-# bash to show function call trace with:
-#
-# debug_cmd='eval echo "${FUNCNAME[0]} $*" >&2' bash your-script-name
-debug_cmd=${debug_cmd-":"}
-exit_cmd=:
-
-# By convention, finish your script with:
-#
-# exit $exit_status
-#
-# so that you can set exit_status to non-zero if you want to indicate
-# something went wrong during execution without actually bailing out at
-# the point of failure.
-exit_status=$EXIT_SUCCESS
-
-# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
-# is ksh but when the shell is invoked as "sh" and the current value of
-# the _XPG environment variable is not equal to 1 (one), the special
-# positional parameter $0, within a function call, is the name of the
-# function.
-progpath=$0
-
-# The name of this program.
-progname=`$bs_echo "$progpath" |$SED "$sed_basename"`
-
-# Make sure we have an absolute progpath for reexecution:
-case $progpath in
- [\\/]*|[A-Za-z]:\\*) ;;
- *[\\/]*)
- progdir=`$bs_echo "$progpath" |$SED "$sed_dirname"`
- progdir=`cd "$progdir" && pwd`
- progpath=$progdir/$progname
- ;;
- *)
- _G_IFS=$IFS
- IFS=${PATH_SEPARATOR-:}
- for progdir in $PATH; do
- IFS=$_G_IFS
- test -x "$progdir/$progname" && break
- done
- IFS=$_G_IFS
- test -n "$progdir" || progdir=`pwd`
- progpath=$progdir/$progname
- ;;
-esac
-
-
-## ----------------- ##
-## Standard options. ##
-## ----------------- ##
-
-# The following options affect the operation of the functions defined
-# below, and should be set appropriately depending on run-time para-
-# meters passed on the command line.
-
-opt_dry_run=false
-opt_quiet=false
-opt_verbose=false
-
-# Categories 'all' and 'none' are always available. Append any others
-# you will pass as the first argument to func_warning from your own
-# code.
-warning_categories=
-
-# By default, display warnings according to 'opt_warning_types'. Set
-# 'warning_func' to ':' to elide all warnings, or func_fatal_error to
-# treat the next displayed warning as a fatal error.
-warning_func=func_warn_and_continue
-
-# Set to 'all' to display all warnings, 'none' to suppress all
-# warnings, or a space delimited list of some subset of
-# 'warning_categories' to display only the listed warnings.
-opt_warning_types=all
-
-
-## -------------------- ##
-## Resource management. ##
-## -------------------- ##
-
-# This section contains definitions for functions that each ensure a
-# particular resource (a file, or a non-empty configuration variable for
-# example) is available, and if appropriate to extract default values
-# from pertinent package files. Call them using their associated
-# 'require_*' variable to ensure that they are executed, at most, once.
-#
-# It's entirely deliberate that calling these functions can set
-# variables that don't obey the namespace limitations obeyed by the rest
-# of this file, in order that that they be as useful as possible to
-# callers.
-
-
-# require_term_colors
-# -------------------
-# Allow display of bold text on terminals that support it.
-require_term_colors=func_require_term_colors
-func_require_term_colors ()
-{
- $debug_cmd
-
- test -t 1 && {
- # COLORTERM and USE_ANSI_COLORS environment variables take
- # precedence, because most terminfo databases neglect to describe
- # whether color sequences are supported.
- test -n "${COLORTERM+set}" && : ${USE_ANSI_COLORS="1"}
-
- if test 1 = "$USE_ANSI_COLORS"; then
- # Standard ANSI escape sequences
- tc_reset=''
- tc_bold=''; tc_standout=''
- tc_red=''; tc_green=''
- tc_blue=''; tc_cyan=''
- else
- # Otherwise trust the terminfo database after all.
- test -n "`tput sgr0 2>/dev/null`" && {
- tc_reset=`tput sgr0`
- test -n "`tput bold 2>/dev/null`" && tc_bold=`tput bold`
- tc_standout=$tc_bold
- test -n "`tput smso 2>/dev/null`" && tc_standout=`tput smso`
- test -n "`tput setaf 1 2>/dev/null`" && tc_red=`tput setaf 1`
- test -n "`tput setaf 2 2>/dev/null`" && tc_green=`tput setaf 2`
- test -n "`tput setaf 4 2>/dev/null`" && tc_blue=`tput setaf 4`
- test -n "`tput setaf 5 2>/dev/null`" && tc_cyan=`tput setaf 5`
- }
- fi
- }
-
- require_term_colors=:
-}
-
-
-## ----------------- ##
-## Function library. ##
-## ----------------- ##
-
-# This section contains a variety of useful functions to call in your
-# scripts. Take note of the portable wrappers for features provided by
-# some modern shells, which will fall back to slower equivalents on
-# less featureful shells.
-
-
-# func_append VAR VALUE
-# ---------------------
-# Append VALUE onto the existing contents of VAR.
-
- # We should try to minimise forks, especially on Windows where they are
- # unreasonably slow, so skip the feature probes when bash or zsh are
- # being used:
- if test set = "${BASH_VERSION+set}${ZSH_VERSION+set}"; then
- : ${_G_HAVE_ARITH_OP="yes"}
- : ${_G_HAVE_XSI_OPS="yes"}
- # The += operator was introduced in bash 3.1
- case $BASH_VERSION in
- [12].* | 3.0 | 3.0*) ;;
- *)
- : ${_G_HAVE_PLUSEQ_OP="yes"}
- ;;
- esac
- fi
-
- # _G_HAVE_PLUSEQ_OP
- # Can be empty, in which case the shell is probed, "yes" if += is
- # useable or anything else if it does not work.
- test -z "$_G_HAVE_PLUSEQ_OP" \
- && (eval 'x=a; x+=" b"; test "a b" = "$x"') 2>/dev/null \
- && _G_HAVE_PLUSEQ_OP=yes
-
-if test yes = "$_G_HAVE_PLUSEQ_OP"
-then
- # This is an XSI compatible shell, allowing a faster implementation...
- eval 'func_append ()
- {
- $debug_cmd
-
- eval "$1+=\$2"
- }'
-else
- # ...otherwise fall back to using expr, which is often a shell builtin.
- func_append ()
- {
- $debug_cmd
-
- eval "$1=\$$1\$2"
- }
-fi
-
-
-# func_append_quoted VAR VALUE
-# ----------------------------
-# Quote VALUE and append to the end of shell variable VAR, separated
-# by a space.
-if test yes = "$_G_HAVE_PLUSEQ_OP"; then
- eval 'func_append_quoted ()
- {
- $debug_cmd
-
- func_quote_for_eval "$2"
- eval "$1+=\\ \$func_quote_for_eval_result"
- }'
-else
- func_append_quoted ()
- {
- $debug_cmd
-
- func_quote_for_eval "$2"
- eval "$1=\$$1\\ \$func_quote_for_eval_result"
- }
-fi
-
-
-# func_append_uniq VAR VALUE
-# --------------------------
-# Append unique VALUE onto the existing contents of VAR, assuming
-# entries are delimited by the first character of VALUE. For example:
-#
-# func_append_uniq options " --another-option option-argument"
-#
-# will only append to $options if " --another-option option-argument "
-# is not already present somewhere in $options already (note spaces at
-# each end implied by leading space in second argument).
-func_append_uniq ()
-{
- $debug_cmd
-
- eval _G_current_value='`$bs_echo $'$1'`'
- _G_delim=`expr "$2" : '\(.\)'`
-
- case $_G_delim$_G_current_value$_G_delim in
- *"$2$_G_delim"*) ;;
- *) func_append "$@" ;;
- esac
-}
-
-
-# func_arith TERM...
-# ------------------
-# Set func_arith_result to the result of evaluating TERMs.
- test -z "$_G_HAVE_ARITH_OP" \
- && (eval 'test 2 = $(( 1 + 1 ))') 2>/dev/null \
- && _G_HAVE_ARITH_OP=yes
-
-if test yes = "$_G_HAVE_ARITH_OP"; then
- eval 'func_arith ()
- {
- $debug_cmd
-
- func_arith_result=$(( $* ))
- }'
-else
- func_arith ()
- {
- $debug_cmd
-
- func_arith_result=`expr "$@"`
- }
-fi
-
-
-# func_basename FILE
-# ------------------
-# Set func_basename_result to FILE with everything up to and including
-# the last / stripped.
-if test yes = "$_G_HAVE_XSI_OPS"; then
- # If this shell supports suffix pattern removal, then use it to avoid
- # forking. Hide the definitions single quotes in case the shell chokes
- # on unsupported syntax...
- _b='func_basename_result=${1##*/}'
- _d='case $1 in
- */*) func_dirname_result=${1%/*}$2 ;;
- * ) func_dirname_result=$3 ;;
- esac'
-
-else
- # ...otherwise fall back to using sed.
- _b='func_basename_result=`$ECHO "$1" |$SED "$sed_basename"`'
- _d='func_dirname_result=`$ECHO "$1" |$SED "$sed_dirname"`
- if test "X$func_dirname_result" = "X$1"; then
- func_dirname_result=$3
- else
- func_append func_dirname_result "$2"
- fi'
-fi
-
-eval 'func_basename ()
-{
- $debug_cmd
-
- '"$_b"'
-}'
-
-
-# func_dirname FILE APPEND NONDIR_REPLACEMENT
-# -------------------------------------------
-# Compute the dirname of FILE. If nonempty, add APPEND to the result,
-# otherwise set result to NONDIR_REPLACEMENT.
-eval 'func_dirname ()
-{
- $debug_cmd
-
- '"$_d"'
-}'
-
-
-# func_dirname_and_basename FILE APPEND NONDIR_REPLACEMENT
-# --------------------------------------------------------
-# Perform func_basename and func_dirname in a single function
-# call:
-# dirname: Compute the dirname of FILE. If nonempty,
-# add APPEND to the result, otherwise set result
-# to NONDIR_REPLACEMENT.
-# value returned in "$func_dirname_result"
-# basename: Compute filename of FILE.
-# value retuned in "$func_basename_result"
-# For efficiency, we do not delegate to the functions above but instead
-# duplicate the functionality here.
-eval 'func_dirname_and_basename ()
-{
- $debug_cmd
-
- '"$_b"'
- '"$_d"'
-}'
-
-
-# func_echo ARG...
-# ----------------
-# Echo program name prefixed message.
-func_echo ()
-{
- $debug_cmd
-
- _G_message=$*
-
- func_echo_IFS=$IFS
- IFS=$nl
- for _G_line in $_G_message; do
- IFS=$func_echo_IFS
- $bs_echo "$progname: $_G_line"
- done
- IFS=$func_echo_IFS
-}
-
-
-# func_echo_all ARG...
-# --------------------
-# Invoke $ECHO with all args, space-separated.
-func_echo_all ()
-{
- $ECHO "$*"
-}
-
-
-# func_echo_infix_1 INFIX ARG...
-# ------------------------------
-# Echo program name, followed by INFIX on the first line, with any
-# additional lines not showing INFIX.
-func_echo_infix_1 ()
-{
- $debug_cmd
-
- $require_term_colors
-
- _G_infix=$1; shift
- _G_indent=$_G_infix
- _G_prefix="$progname: $_G_infix: "
- _G_message=$*
-
- # Strip color escape sequences before counting printable length
- for _G_tc in "$tc_reset" "$tc_bold" "$tc_standout" "$tc_red" "$tc_green" "$tc_blue" "$tc_cyan"
- do
- test -n "$_G_tc" && {
- _G_esc_tc=`$bs_echo "$_G_tc" | sed "$sed_make_literal_regex"`
- _G_indent=`$bs_echo "$_G_indent" | sed "s|$_G_esc_tc||g"`
- }
- done
- _G_indent="$progname: "`echo "$_G_indent" | sed 's|.| |g'`" " ## exclude from sc_prohibit_nested_quotes
-
- func_echo_infix_1_IFS=$IFS
- IFS=$nl
- for _G_line in $_G_message; do
- IFS=$func_echo_infix_1_IFS
- $bs_echo "$_G_prefix$tc_bold$_G_line$tc_reset" >&2
- _G_prefix=$_G_indent
- done
- IFS=$func_echo_infix_1_IFS
-}
-
-
-# func_error ARG...
-# -----------------
-# Echo program name prefixed message to standard error.
-func_error ()
-{
- $debug_cmd
-
- $require_term_colors
-
- func_echo_infix_1 " $tc_standout${tc_red}error$tc_reset" "$*" >&2
-}
-
-
-# func_fatal_error ARG...
-# -----------------------
-# Echo program name prefixed message to standard error, and exit.
-func_fatal_error ()
-{
- $debug_cmd
-
- func_error "$*"
- exit $EXIT_FAILURE
-}
-
-
-# func_grep EXPRESSION FILENAME
-# -----------------------------
-# Check whether EXPRESSION matches any line of FILENAME, without output.
-func_grep ()
-{
- $debug_cmd
-
- $GREP "$1" "$2" >/dev/null 2>&1
-}
-
-
-# func_len STRING
-# ---------------
-# Set func_len_result to the length of STRING. STRING may not
-# start with a hyphen.
- test -z "$_G_HAVE_XSI_OPS" \
- && (eval 'x=a/b/c;
- test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \
- && _G_HAVE_XSI_OPS=yes
-
-if test yes = "$_G_HAVE_XSI_OPS"; then
- eval 'func_len ()
- {
- $debug_cmd
-
- func_len_result=${#1}
- }'
-else
- func_len ()
- {
- $debug_cmd
-
- func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len`
- }
-fi
-
-
-# func_mkdir_p DIRECTORY-PATH
-# ---------------------------
-# Make sure the entire path to DIRECTORY-PATH is available.
-func_mkdir_p ()
-{
- $debug_cmd
-
- _G_directory_path=$1
- _G_dir_list=
-
- if test -n "$_G_directory_path" && test : != "$opt_dry_run"; then
-
- # Protect directory names starting with '-'
- case $_G_directory_path in
- -*) _G_directory_path=./$_G_directory_path ;;
- esac
-
- # While some portion of DIR does not yet exist...
- while test ! -d "$_G_directory_path"; do
- # ...make a list in topmost first order. Use a colon delimited
- # list incase some portion of path contains whitespace.
- _G_dir_list=$_G_directory_path:$_G_dir_list
-
- # If the last portion added has no slash in it, the list is done
- case $_G_directory_path in */*) ;; *) break ;; esac
-
- # ...otherwise throw away the child directory and loop
- _G_directory_path=`$ECHO "$_G_directory_path" | $SED -e "$sed_dirname"`
- done
- _G_dir_list=`$ECHO "$_G_dir_list" | $SED 's|:*$||'`
-
- func_mkdir_p_IFS=$IFS; IFS=:
- for _G_dir in $_G_dir_list; do
- IFS=$func_mkdir_p_IFS
- # mkdir can fail with a 'File exist' error if two processes
- # try to create one of the directories concurrently. Don't
- # stop in that case!
- $MKDIR "$_G_dir" 2>/dev/null || :
- done
- IFS=$func_mkdir_p_IFS
-
- # Bail out if we (or some other process) failed to create a directory.
- test -d "$_G_directory_path" || \
- func_fatal_error "Failed to create '$1'"
- fi
-}
-
-
-# func_mktempdir [BASENAME]
-# -------------------------
-# Make a temporary directory that won't clash with other running
-# libtool processes, and avoids race conditions if possible. If
-# given, BASENAME is the basename for that directory.
-func_mktempdir ()
-{
- $debug_cmd
-
- _G_template=${TMPDIR-/tmp}/${1-$progname}
-
- if test : = "$opt_dry_run"; then
- # Return a directory name, but don't create it in dry-run mode
- _G_tmpdir=$_G_template-$$
- else
-
- # If mktemp works, use that first and foremost
- _G_tmpdir=`mktemp -d "$_G_template-XXXXXXXX" 2>/dev/null`
-
- if test ! -d "$_G_tmpdir"; then
- # Failing that, at least try and use $RANDOM to avoid a race
- _G_tmpdir=$_G_template-${RANDOM-0}$$
-
- func_mktempdir_umask=`umask`
- umask 0077
- $MKDIR "$_G_tmpdir"
- umask $func_mktempdir_umask
- fi
-
- # If we're not in dry-run mode, bomb out on failure
- test -d "$_G_tmpdir" || \
- func_fatal_error "cannot create temporary directory '$_G_tmpdir'"
- fi
-
- $ECHO "$_G_tmpdir"
-}
-
-
-# func_normal_abspath PATH
-# ------------------------
-# Remove doubled-up and trailing slashes, "." path components,
-# and cancel out any ".." path components in PATH after making
-# it an absolute path.
-func_normal_abspath ()
-{
- $debug_cmd
-
- # These SED scripts presuppose an absolute path with a trailing slash.
- _G_pathcar='s|^/\([^/]*\).*$|\1|'
- _G_pathcdr='s|^/[^/]*||'
- _G_removedotparts=':dotsl
- s|/\./|/|g
- t dotsl
- s|/\.$|/|'
- _G_collapseslashes='s|/\{1,\}|/|g'
- _G_finalslash='s|/*$|/|'
-
- # Start from root dir and reassemble the path.
- func_normal_abspath_result=
- func_normal_abspath_tpath=$1
- func_normal_abspath_altnamespace=
- case $func_normal_abspath_tpath in
- "")
- # Empty path, that just means $cwd.
- func_stripname '' '/' "`pwd`"
- func_normal_abspath_result=$func_stripname_result
- return
- ;;
- # The next three entries are used to spot a run of precisely
- # two leading slashes without using negated character classes;
- # we take advantage of case's first-match behaviour.
- ///*)
- # Unusual form of absolute path, do nothing.
- ;;
- //*)
- # Not necessarily an ordinary path; POSIX reserves leading '//'
- # and for example Cygwin uses it to access remote file shares
- # over CIFS/SMB, so we conserve a leading double slash if found.
- func_normal_abspath_altnamespace=/
- ;;
- /*)
- # Absolute path, do nothing.
- ;;
- *)
- # Relative path, prepend $cwd.
- func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath
- ;;
- esac
-
- # Cancel out all the simple stuff to save iterations. We also want
- # the path to end with a slash for ease of parsing, so make sure
- # there is one (and only one) here.
- func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
- -e "$_G_removedotparts" -e "$_G_collapseslashes" -e "$_G_finalslash"`
- while :; do
- # Processed it all yet?
- if test / = "$func_normal_abspath_tpath"; then
- # If we ascended to the root using ".." the result may be empty now.
- if test -z "$func_normal_abspath_result"; then
- func_normal_abspath_result=/
- fi
- break
- fi
- func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \
- -e "$_G_pathcar"`
- func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
- -e "$_G_pathcdr"`
- # Figure out what to do with it
- case $func_normal_abspath_tcomponent in
- "")
- # Trailing empty path component, ignore it.
- ;;
- ..)
- # Parent dir; strip last assembled component from result.
- func_dirname "$func_normal_abspath_result"
- func_normal_abspath_result=$func_dirname_result
- ;;
- *)
- # Actual path component, append it.
- func_append func_normal_abspath_result "/$func_normal_abspath_tcomponent"
- ;;
- esac
- done
- # Restore leading double-slash if one was found on entry.
- func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result
-}
-
-
-# func_notquiet ARG...
-# --------------------
-# Echo program name prefixed message only when not in quiet mode.
-func_notquiet ()
-{
- $debug_cmd
-
- $opt_quiet || func_echo ${1+"$@"}
-
- # A bug in bash halts the script if the last line of a function
- # fails when set -e is in force, so we need another command to
- # work around that:
- :
-}
-
-
-# func_relative_path SRCDIR DSTDIR
-# --------------------------------
-# Set func_relative_path_result to the relative path from SRCDIR to DSTDIR.
-func_relative_path ()
-{
- $debug_cmd
-
- func_relative_path_result=
- func_normal_abspath "$1"
- func_relative_path_tlibdir=$func_normal_abspath_result
- func_normal_abspath "$2"
- func_relative_path_tbindir=$func_normal_abspath_result
-
- # Ascend the tree starting from libdir
- while :; do
- # check if we have found a prefix of bindir
- case $func_relative_path_tbindir in
- $func_relative_path_tlibdir)
- # found an exact match
- func_relative_path_tcancelled=
- break
- ;;
- $func_relative_path_tlibdir*)
- # found a matching prefix
- func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir"
- func_relative_path_tcancelled=$func_stripname_result
- if test -z "$func_relative_path_result"; then
- func_relative_path_result=.
- fi
- break
- ;;
- *)
- func_dirname $func_relative_path_tlibdir
- func_relative_path_tlibdir=$func_dirname_result
- if test -z "$func_relative_path_tlibdir"; then
- # Have to descend all the way to the root!
- func_relative_path_result=../$func_relative_path_result
- func_relative_path_tcancelled=$func_relative_path_tbindir
- break
- fi
- func_relative_path_result=../$func_relative_path_result
- ;;
- esac
- done
-
- # Now calculate path; take care to avoid doubling-up slashes.
- func_stripname '' '/' "$func_relative_path_result"
- func_relative_path_result=$func_stripname_result
- func_stripname '/' '/' "$func_relative_path_tcancelled"
- if test -n "$func_stripname_result"; then
- func_append func_relative_path_result "/$func_stripname_result"
- fi
-
- # Normalisation. If bindir is libdir, return '.' else relative path.
- if test -n "$func_relative_path_result"; then
- func_stripname './' '' "$func_relative_path_result"
- func_relative_path_result=$func_stripname_result
- fi
-
- test -n "$func_relative_path_result" || func_relative_path_result=.
-
- :
-}
-
-
-# func_quote_for_eval ARG...
-# --------------------------
-# Aesthetically quote ARGs to be evaled later.
-# This function returns two values:
-# i) func_quote_for_eval_result
-# double-quoted, suitable for a subsequent eval
-# ii) func_quote_for_eval_unquoted_result
-# has all characters that are still active within double
-# quotes backslashified.
-func_quote_for_eval ()
-{
- $debug_cmd
-
- func_quote_for_eval_unquoted_result=
- func_quote_for_eval_result=
- while test 0 -lt $#; do
- case $1 in
- *[\\\`\"\$]*)
- _G_unquoted_arg=`printf '%s\n' "$1" |$SED "$sed_quote_subst"` ;;
- *)
- _G_unquoted_arg=$1 ;;
- esac
- if test -n "$func_quote_for_eval_unquoted_result"; then
- func_append func_quote_for_eval_unquoted_result " $_G_unquoted_arg"
- else
- func_append func_quote_for_eval_unquoted_result "$_G_unquoted_arg"
- fi
-
- case $_G_unquoted_arg in
- # Double-quote args containing shell metacharacters to delay
- # word splitting, command substitution and variable expansion
- # for a subsequent eval.
- # Many Bourne shells cannot handle close brackets correctly
- # in scan sets, so we specify it separately.
- *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
- _G_quoted_arg=\"$_G_unquoted_arg\"
- ;;
- *)
- _G_quoted_arg=$_G_unquoted_arg
- ;;
- esac
-
- if test -n "$func_quote_for_eval_result"; then
- func_append func_quote_for_eval_result " $_G_quoted_arg"
- else
- func_append func_quote_for_eval_result "$_G_quoted_arg"
- fi
- shift
- done
-}
-
-
-# func_quote_for_expand ARG
-# -------------------------
-# Aesthetically quote ARG to be evaled later; same as above,
-# but do not quote variable references.
-func_quote_for_expand ()
-{
- $debug_cmd
-
- case $1 in
- *[\\\`\"]*)
- _G_arg=`$ECHO "$1" | $SED \
- -e "$sed_double_quote_subst" -e "$sed_double_backslash"` ;;
- *)
- _G_arg=$1 ;;
- esac
-
- case $_G_arg in
- # Double-quote args containing shell metacharacters to delay
- # word splitting and command substitution for a subsequent eval.
- # Many Bourne shells cannot handle close brackets correctly
- # in scan sets, so we specify it separately.
- *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
- _G_arg=\"$_G_arg\"
- ;;
- esac
-
- func_quote_for_expand_result=$_G_arg
-}
-
-
-# func_stripname PREFIX SUFFIX NAME
-# ---------------------------------
-# strip PREFIX and SUFFIX from NAME, and store in func_stripname_result.
-# PREFIX and SUFFIX must not contain globbing or regex special
-# characters, hashes, percent signs, but SUFFIX may contain a leading
-# dot (in which case that matches only a dot).
-if test yes = "$_G_HAVE_XSI_OPS"; then
- eval 'func_stripname ()
- {
- $debug_cmd
-
- # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
- # positional parameters, so assign one to ordinary variable first.
- func_stripname_result=$3
- func_stripname_result=${func_stripname_result#"$1"}
- func_stripname_result=${func_stripname_result%"$2"}
- }'
-else
- func_stripname ()
- {
- $debug_cmd
-
- case $2 in
- .*) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%\\\\$2\$%%"`;;
- *) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%$2\$%%"`;;
- esac
- }
-fi
-
-
-# func_show_eval CMD [FAIL_EXP]
-# -----------------------------
-# Unless opt_quiet is true, then output CMD. Then, if opt_dryrun is
-# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP
-# is given, then evaluate it.
-func_show_eval ()
-{
- $debug_cmd
-
- _G_cmd=$1
- _G_fail_exp=${2-':'}
-
- func_quote_for_expand "$_G_cmd"
- eval "func_notquiet $func_quote_for_expand_result"
-
- $opt_dry_run || {
- eval "$_G_cmd"
- _G_status=$?
- if test 0 -ne "$_G_status"; then
- eval "(exit $_G_status); $_G_fail_exp"
- fi
- }
-}
-
-
-# func_show_eval_locale CMD [FAIL_EXP]
-# ------------------------------------
-# Unless opt_quiet is true, then output CMD. Then, if opt_dryrun is
-# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP
-# is given, then evaluate it. Use the saved locale for evaluation.
-func_show_eval_locale ()
-{
- $debug_cmd
-
- _G_cmd=$1
- _G_fail_exp=${2-':'}
-
- $opt_quiet || {
- func_quote_for_expand "$_G_cmd"
- eval "func_echo $func_quote_for_expand_result"
- }
-
- $opt_dry_run || {
- eval "$_G_user_locale
- $_G_cmd"
- _G_status=$?
- eval "$_G_safe_locale"
- if test 0 -ne "$_G_status"; then
- eval "(exit $_G_status); $_G_fail_exp"
- fi
- }
-}
-
-
-# func_tr_sh
-# ----------
-# Turn $1 into a string suitable for a shell variable name.
-# Result is stored in $func_tr_sh_result. All characters
-# not in the set a-zA-Z0-9_ are replaced with '_'. Further,
-# if $1 begins with a digit, a '_' is prepended as well.
-func_tr_sh ()
-{
- $debug_cmd
-
- case $1 in
- [0-9]* | *[!a-zA-Z0-9_]*)
- func_tr_sh_result=`$ECHO "$1" | $SED -e 's/^\([0-9]\)/_\1/' -e 's/[^a-zA-Z0-9_]/_/g'`
- ;;
- * )
- func_tr_sh_result=$1
- ;;
- esac
-}
-
-
-# func_verbose ARG...
-# -------------------
-# Echo program name prefixed message in verbose mode only.
-func_verbose ()
-{
- $debug_cmd
-
- $opt_verbose && func_echo "$*"
-
- :
-}
-
-
-# func_warn_and_continue ARG...
-# -----------------------------
-# Echo program name prefixed warning message to standard error.
-func_warn_and_continue ()
-{
- $debug_cmd
-
- $require_term_colors
-
- func_echo_infix_1 "${tc_red}warning$tc_reset" "$*" >&2
-}
-
-
-# func_warning CATEGORY ARG...
-# ----------------------------
-# Echo program name prefixed warning message to standard error. Warning
-# messages can be filtered according to CATEGORY, where this function
-# elides messages where CATEGORY is not listed in the global variable
-# 'opt_warning_types'.
-func_warning ()
-{
- $debug_cmd
-
- # CATEGORY must be in the warning_categories list!
- case " $warning_categories " in
- *" $1 "*) ;;
- *) func_internal_error "invalid warning category '$1'" ;;
- esac
-
- _G_category=$1
- shift
-
- case " $opt_warning_types " in
- *" $_G_category "*) $warning_func ${1+"$@"} ;;
- esac
-}
-
-
-# func_sort_ver VER1 VER2
-# -----------------------
-# 'sort -V' is not generally available.
-# Note this deviates from the version comparison in automake
-# in that it treats 1.5 < 1.5.0, and treats 1.4.4a < 1.4-p3a
-# but this should suffice as we won't be specifying old
-# version formats or redundant trailing .0 in bootstrap.conf.
-# If we did want full compatibility then we should probably
-# use m4_version_compare from autoconf.
-func_sort_ver ()
-{
- $debug_cmd
-
- ver1=$1
- ver2=$2
-
- # Split on '.' and compare each component.
- i=1
- while :; do
- p1=`echo "$ver1" |cut -d. -f$i`
- p2=`echo "$ver2" |cut -d. -f$i`
- if test ! "$p1"; then
- echo "$1 $2"
- break
- elif test ! "$p2"; then
- echo "$2 $1"
- break
- elif test ! "$p1" = "$p2"; then
- if test "$p1" -gt "$p2" 2>/dev/null; then # numeric comparison
- echo "$2 $1"
- elif test "$p2" -gt "$p1" 2>/dev/null; then # numeric comparison
- echo "$1 $2"
- else # numeric, then lexicographic comparison
- lp=`printf "$p1\n$p2\n" |sort -n |tail -n1`
- if test "$lp" = "$p2"; then
- echo "$1 $2"
- else
- echo "$2 $1"
- fi
- fi
- break
- fi
- i=`expr $i + 1`
- done
-}
-
-
-# Local variables:
-# mode: shell-script
-# sh-indentation: 2
-# eval: (add-hook 'write-file-hooks 'time-stamp)
-# time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC"
-# time-stamp-time-zone: "UTC"
-# End:
-#! /bin/sh
-
-# Set a version string for this script.
-scriptversion=2012-10-21.11; # UTC
-
-# A portable, pluggable option parser for Bourne shell.
-# Written by Gary V. Vaughan, 2010
-
-# Copyright (C) 2010-2013 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.
-
-# 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 3 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, see <http://www.gnu.org/licenses/>.
-
-# Please report bugs or propose patches to gary@gnu.org.
-
-
-## ------ ##
-## Usage. ##
-## ------ ##
-
-# This file is a library for parsing options in your shell scripts along
-# with assorted other useful supporting features that you can make use
-# of too.
-#
-# For the simplest scripts you might need only:
-#
-# #!/bin/sh
-# . relative/path/to/funclib.sh
-# . relative/path/to/options-parser
-# scriptversion=1.0
-# func_options ${1+"$@"}
-# eval set dummy "$func_options_result"; shift
-# ...rest of your script...
-#
-# In order for the '--version' option to work, you will need to have a
-# suitably formatted comment like the one at the top of this file
-# starting with '# Written by ' and ending with '# warranty; '.
-#
-# For '-h' and '--help' to work, you will also need a one line
-# description of your script's purpose in a comment directly above the
-# '# Written by ' line, like the one at the top of this file.
-#
-# The default options also support '--debug', which will turn on shell
-# execution tracing (see the comment above debug_cmd below for another
-# use), and '--verbose' and the func_verbose function to allow your script
-# to display verbose messages only when your user has specified
-# '--verbose'.
-#
-# After sourcing this file, you can plug processing for additional
-# options by amending the variables from the 'Configuration' section
-# below, and following the instructions in the 'Option parsing'
-# section further down.
-
-## -------------- ##
-## Configuration. ##
-## -------------- ##
-
-# You should override these variables in your script after sourcing this
-# file so that they reflect the customisations you have added to the
-# option parser.
-
-# The usage line for option parsing errors and the start of '-h' and
-# '--help' output messages. You can embed shell variables for delayed
-# expansion at the time the message is displayed, but you will need to
-# quote other shell meta-characters carefully to prevent them being
-# expanded when the contents are evaled.
-usage='$progpath [OPTION]...'
-
-# Short help message in response to '-h' and '--help'. Add to this or
-# override it after sourcing this library to reflect the full set of
-# options your script accepts.
-usage_message="\
- --debug enable verbose shell tracing
- -W, --warnings=CATEGORY
- report the warnings falling in CATEGORY [all]
- -v, --verbose verbosely report processing
- --version print version information and exit
- -h, --help print short or long help message and exit
-"
-
-# Additional text appended to 'usage_message' in response to '--help'.
-long_help_message="
-Warning categories include:
- 'all' show all warnings
- 'none' turn off all the warnings
- 'error' warnings are treated as fatal errors"
-
-# Help message printed before fatal option parsing errors.
-fatal_help="Try '\$progname --help' for more information."
-
-
-
-## ------------------------- ##
-## Hook function management. ##
-## ------------------------- ##
-
-# This section contains functions for adding, removing, and running hooks
-# to the main code. A hook is just a named list of of function, that can
-# be run in order later on.
-
-# func_hookable FUNC_NAME
-# -----------------------
-# Declare that FUNC_NAME will run hooks added with
-# 'func_add_hook FUNC_NAME ...'.
-func_hookable ()
-{
- $debug_cmd
-
- func_append hookable_fns " $1"
-}
-
-
-# func_add_hook FUNC_NAME HOOK_FUNC
-# ---------------------------------
-# Request that FUNC_NAME call HOOK_FUNC before it returns. FUNC_NAME must
-# first have been declared "hookable" by a call to 'func_hookable'.
-func_add_hook ()
-{
- $debug_cmd
-
- case " $hookable_fns " in
- *" $1 "*) ;;
- *) func_fatal_error "'$1' does not accept hook functions." ;;
- esac
-
- eval func_append ${1}_hooks '" $2"'
-}
-
-
-# func_remove_hook FUNC_NAME HOOK_FUNC
-# ------------------------------------
-# Remove HOOK_FUNC from the list of functions called by FUNC_NAME.
-func_remove_hook ()
-{
- $debug_cmd
-
- eval ${1}_hooks='`$bs_echo "\$'$1'_hooks" |$SED "s| '$2'||"`'
-}
-
-
-# func_run_hooks FUNC_NAME [ARG]...
-# ---------------------------------
-# Run all hook functions registered to FUNC_NAME.
-# It is assumed that the list of hook functions contains nothing more
-# than a whitespace-delimited list of legal shell function names, and
-# no effort is wasted trying to catch shell meta-characters or preserve
-# whitespace.
-func_run_hooks ()
-{
- $debug_cmd
-
- case " $hookable_fns " in
- *" $1 "*) ;;
- *) func_fatal_error "'$1' does not support hook functions." ;;
- esac
-
- eval _G_hook_fns=\$$1_hooks; shift
-
- for _G_hook in $_G_hook_fns; do
- eval $_G_hook '"$@"'
-
- # store returned options list back into positional
- # parameters for next 'cmd' execution.
- eval _G_hook_result=\$${_G_hook}_result
- eval set dummy "$_G_hook_result"; shift
- done
-
- func_quote_for_eval ${1+"$@"}
- func_run_hooks_result=$func_quote_for_eval_result
-}
-
-
-
-## --------------- ##
-## Option parsing. ##
-## --------------- ##
-
-# In order to add your own option parsing hooks, you must accept the
-# full positional parameter list in your hook function, remove any
-# options that you action, and then pass back the remaining unprocessed
-# options in '<hooked_function_name>_result', escaped suitably for
-# 'eval'. Like this:
-#
-# my_options_prep ()
-# {
-# $debug_cmd
-#
-# # Extend the existing usage message.
-# usage_message=$usage_message'
-# -s, --silent don'\''t print informational messages
-# '
-#
-# func_quote_for_eval ${1+"$@"}
-# my_options_prep_result=$func_quote_for_eval_result
-# }
-# func_add_hook func_options_prep my_options_prep
-#
-#
-# my_silent_option ()
-# {
-# $debug_cmd
-#
-# # Note that for efficiency, we parse as many options as we can
-# # recognise in a loop before passing the remainder back to the
-# # caller on the first unrecognised argument we encounter.
-# while test $# -gt 0; do
-# opt=$1; shift
-# case $opt in
-# --silent|-s) opt_silent=: ;;
-# # Separate non-argument short options:
-# -s*) func_split_short_opt "$_G_opt"
-# set dummy "$func_split_short_opt_name" \
-# "-$func_split_short_opt_arg" ${1+"$@"}
-# shift
-# ;;
-# *) set dummy "$_G_opt" "$*"; shift; break ;;
-# esac
-# done
-#
-# func_quote_for_eval ${1+"$@"}
-# my_silent_option_result=$func_quote_for_eval_result
-# }
-# func_add_hook func_parse_options my_silent_option
-#
-#
-# my_option_validation ()
-# {
-# $debug_cmd
-#
-# $opt_silent && $opt_verbose && func_fatal_help "\
-# '--silent' and '--verbose' options are mutually exclusive."
-#
-# func_quote_for_eval ${1+"$@"}
-# my_option_validation_result=$func_quote_for_eval_result
-# }
-# func_add_hook func_validate_options my_option_validation
-#
-# You'll alse need to manually amend $usage_message to reflect the extra
-# options you parse. It's preferable to append if you can, so that
-# multiple option parsing hooks can be added safely.
-
-
-# func_options [ARG]...
-# ---------------------
-# All the functions called inside func_options are hookable. See the
-# individual implementations for details.
-func_hookable func_options
-func_options ()
-{
- $debug_cmd
-
- func_options_prep ${1+"$@"}
- eval func_parse_options \
- ${func_options_prep_result+"$func_options_prep_result"}
- eval func_validate_options \
- ${func_parse_options_result+"$func_parse_options_result"}
-
- eval func_run_hooks func_options \
- ${func_validate_options_result+"$func_validate_options_result"}
-
- # save modified positional parameters for caller
- func_options_result=$func_run_hooks_result
-}
-
-
-# func_options_prep [ARG]...
-# --------------------------
-# All initialisations required before starting the option parse loop.
-# Note that when calling hook functions, we pass through the list of
-# positional parameters. If a hook function modifies that list, and
-# needs to propogate that back to rest of this script, then the complete
-# modified list must be put in 'func_run_hooks_result' before
-# returning.
-func_hookable func_options_prep
-func_options_prep ()
-{
- $debug_cmd
-
- # Option defaults:
- opt_verbose=false
- opt_warning_types=
-
- func_run_hooks func_options_prep ${1+"$@"}
-
- # save modified positional parameters for caller
- func_options_prep_result=$func_run_hooks_result
-}
-
-
-# func_parse_options [ARG]...
-# ---------------------------
-# The main option parsing loop.
-func_hookable func_parse_options
-func_parse_options ()
-{
- $debug_cmd
-
- func_parse_options_result=
-
- # this just eases exit handling
- while test $# -gt 0; do
- # Defer to hook functions for initial option parsing, so they
- # get priority in the event of reusing an option name.
- func_run_hooks func_parse_options ${1+"$@"}
-
- # Adjust func_parse_options positional parameters to match
- eval set dummy "$func_run_hooks_result"; shift
-
- # Break out of the loop if we already parsed every option.
- test $# -gt 0 || break
-
- _G_opt=$1
- shift
- case $_G_opt in
- --debug|-x) debug_cmd='set -x'
- func_echo "enabling shell trace mode"
- $debug_cmd
- ;;
-
- --no-warnings|--no-warning|--no-warn)
- set dummy --warnings none ${1+"$@"}
- shift
- ;;
-
- --warnings|--warning|-W)
- test $# = 0 && func_missing_arg $_G_opt && break
- case " $warning_categories $1" in
- *" $1 "*)
- # trailing space prevents matching last $1 above
- func_append_uniq opt_warning_types " $1"
- ;;
- *all)
- opt_warning_types=$warning_categories
- ;;
- *none)
- opt_warning_types=none
- warning_func=:
- ;;
- *error)
- opt_warning_types=$warning_categories
- warning_func=func_fatal_error
- ;;
- *)
- func_fatal_error \
- "unsupported warning category: '$1'"
- ;;
- esac
- shift
- ;;
-
- --verbose|-v) opt_verbose=: ;;
- --version) func_version ;;
- -\?|-h) func_usage ;;
- --help) func_help ;;
-
- # Separate optargs to long options (plugins may need this):
- --*=*) func_split_equals "$_G_opt"
- set dummy "$func_split_equals_lhs" \
- "$func_split_equals_rhs" ${1+"$@"}
- shift
- ;;
-
- # Separate optargs to short options:
- -W*)
- func_split_short_opt "$_G_opt"
- set dummy "$func_split_short_opt_name" \
- "$func_split_short_opt_arg" ${1+"$@"}
- shift
- ;;
-
- # Separate non-argument short options:
- -\?*|-h*|-v*|-x*)
- func_split_short_opt "$_G_opt"
- set dummy "$func_split_short_opt_name" \
- "-$func_split_short_opt_arg" ${1+"$@"}
- shift
- ;;
-
- --) break ;;
- -*) func_fatal_help "unrecognised option: '$_G_opt'" ;;
- *) set dummy "$_G_opt" ${1+"$@"}; shift; break ;;
- esac
- done
-
- # save modified positional parameters for caller
- func_quote_for_eval ${1+"$@"}
- func_parse_options_result=$func_quote_for_eval_result
-}
-
-
-# func_validate_options [ARG]...
-# ------------------------------
-# Perform any sanity checks on option settings and/or unconsumed
-# arguments.
-func_hookable func_validate_options
-func_validate_options ()
-{
- $debug_cmd
-
- # Display all warnings if -W was not given.
- test -n "$opt_warning_types" || opt_warning_types=" $warning_categories"
-
- func_run_hooks func_validate_options ${1+"$@"}
-
- # Bail if the options were screwed!
- $exit_cmd $EXIT_FAILURE
-
- # save modified positional parameters for caller
- func_validate_options_result=$func_run_hooks_result
-}
-
-
-
-## ------------------##
-## Helper functions. ##
-## ------------------##
-
-# This section contains the helper functions used by the rest of the
-# hookable option parser framework in ascii-betical order.
-
-
-# func_fatal_help ARG...
-# ----------------------
-# Echo program name prefixed message to standard error, followed by
-# a help hint, and exit.
-func_fatal_help ()
-{
- $debug_cmd
-
- eval \$bs_echo \""Usage: $usage"\"
- eval \$bs_echo \""$fatal_help"\"
- func_error ${1+"$@"}
- exit $EXIT_FAILURE
-}
-
-
-# func_help
-# ---------
-# Echo long help message to standard output and exit.
-func_help ()
-{
- $debug_cmd
-
- func_usage_message
- $bs_echo "$long_help_message"
- exit 0
-}
-
-
-# func_missing_arg ARGNAME
-# ------------------------
-# Echo program name prefixed message to standard error and set global
-# exit_cmd.
-func_missing_arg ()
-{
- $debug_cmd
-
- func_error "Missing argument for '$1'."
- exit_cmd=exit
-}
-
-
-# func_split_equals STRING
-# ------------------------
-# Set func_split_equals_lhs and func_split_equals_rhs shell variables after
-# splitting STRING at the '=' sign.
-test -z "$_G_HAVE_XSI_OPS" \
- && (eval 'x=a/b/c;
- test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \
- && _G_HAVE_XSI_OPS=yes
-
-if test yes = "$_G_HAVE_XSI_OPS"
-then
- # This is an XSI compatible shell, allowing a faster implementation...
- eval 'func_split_equals ()
- {
- $debug_cmd
-
- func_split_equals_lhs=${1%%=*}
- func_split_equals_rhs=${1#*=}
- test "x$func_split_equals_lhs" = "x$1" \
- && func_split_equals_rhs=
- }'
-else
- # ...otherwise fall back to using expr, which is often a shell builtin.
- func_split_equals ()
- {
- $debug_cmd
-
- func_split_equals_lhs=`expr "x$1" : 'x\([^=]*\)'`
- func_split_equals_rhs=
- test "x$func_split_equals_lhs" = "x$1" \
- || func_split_equals_rhs=`expr "x$1" : 'x[^=]*=\(.*\)$'`
- }
-fi #func_split_equals
-
-
-# func_split_short_opt SHORTOPT
-# -----------------------------
-# Set func_split_short_opt_name and func_split_short_opt_arg shell
-# variables after splitting SHORTOPT after the 2nd character.
-if test yes = "$_G_HAVE_XSI_OPS"
-then
- # This is an XSI compatible shell, allowing a faster implementation...
- eval 'func_split_short_opt ()
- {
- $debug_cmd
-
- func_split_short_opt_arg=${1#??}
- func_split_short_opt_name=${1%"$func_split_short_opt_arg"}
- }'
-else
- # ...otherwise fall back to using expr, which is often a shell builtin.
- func_split_short_opt ()
- {
- $debug_cmd
-
- func_split_short_opt_name=`expr "x$1" : 'x-\(.\)'`
- func_split_short_opt_arg=`expr "x$1" : 'x-.\(.*\)$'`
- }
-fi #func_split_short_opt
-
-
-# func_usage
-# ----------
-# Echo short help message to standard output and exit.
-func_usage ()
-{
- $debug_cmd
-
- func_usage_message
- $bs_echo "Run '$progname --help |${PAGER-more}' for full usage"
- exit 0
-}
-
-
-# func_usage_message
-# ------------------
-# Echo short help message to standard output.
-func_usage_message ()
-{
- $debug_cmd
-
- eval \$bs_echo \""Usage: $usage"\"
- echo
- $SED -n 's|^# ||
- /^Written by/{
- x;p;x
- }
- h
- /^Written by/q' < "$progpath"
- echo
- eval \$bs_echo \""$usage_message"\"
-}
-
-
-# func_version
-# ------------
-# Echo version message to standard output and exit.
-func_version ()
-{
- $debug_cmd
-
- printf '%s\n' "$progname $scriptversion"
- $SED -n '/^##/q
- /(C)/!b go
- :more
- /\./!{
- N
- s|\n# | |
- b more
- }
- :go
- /^# Written by /,/# warranty; / {
- s|^# ||
- s|^# *$||
- s|\((C)\)[ 0-9,-]*[ ,-]\([1-9][0-9]* \)|\1 \2|
- p
- }
- /^# Written by / {
- s|^# ||
- p
- }
- /^warranty; /q' < "$progpath"
-
- exit $?
-}
-
-
-# Local variables:
-# mode: shell-script
-# sh-indentation: 2
-# eval: (add-hook 'write-file-hooks 'time-stamp)
-# time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC"
-# time-stamp-time-zone: "UTC"
-# End:
-
-# Set a version string.
-scriptversion='(GNU libtool) 2.4.2.418'
-
-
-# func_echo ARG...
-# ----------------
-# Libtool also displays the current mode in messages, so override
-# funclib.sh func_echo with this custom definition.
-func_echo ()
-{
- $debug_cmd
-
- _G_message=$*
-
- func_echo_IFS=$IFS
- IFS=$nl
- for _G_line in $_G_message; do
- IFS=$func_echo_IFS
- $bs_echo "$progname${opt_mode+: $opt_mode}: $_G_line"
- done
- IFS=$func_echo_IFS
-}
-
-
-# func_warning ARG...
-# -------------------
-# Libtool warnings are not categorized, so override funclib.sh
-# func_warning with this simpler definition.
-func_warning ()
-{
- $debug_cmd
-
- $warning_func ${1+"$@"}
-}
-
-
-## ---------------- ##
-## Options parsing. ##
-## ---------------- ##
-
-# Hook in the functions to make sure our own options are parsed during
-# the option parsing loop.
-
-usage='$progpath [OPTION]... [MODE-ARG]...'
-
-# Short help message in response to '-h'.
-usage_message="Options:
- --config show all configuration variables
- --debug enable verbose shell tracing
- -n, --dry-run display commands without modifying any files
- --features display basic configuration information and exit
- --mode=MODE use operation mode MODE
- --no-warnings equivalent to '-Wnone'
- --preserve-dup-deps don't remove duplicate dependency libraries
- --quiet, --silent don't print informational messages
- --tag=TAG use configuration variables from tag TAG
- -v, --verbose print more informational messages than default
- --version print version information
- -W, --warnings=CATEGORY report the warnings falling in CATEGORY [all]
- -h, --help, --help-all print short, long, or detailed help message
-"
-
-# Additional text appended to 'usage_message' in response to '--help'.
-long_help_message=$long_help_message"
-
-MODE must be one of the following:
-
- clean remove files from the build directory
- compile compile a source file into a libtool object
- execute automatically set library path, then run a program
- finish complete the installation of libtool libraries
- install install libraries or executables
- link create a library or an executable
- uninstall remove libraries from an installed directory
-
-MODE-ARGS vary depending on the MODE. When passed as first option,
-'--mode=MODE' may be abbreviated as 'MODE' or a unique abbreviation of that.
-Try '$progname --help --mode=MODE' for a more detailed description of MODE.
-
-When reporting a bug, please describe a test case to reproduce it and
-include the following information:
-
- host-triplet: $host
- shell: $SHELL
- compiler: $LTCC
- compiler flags: $LTCFLAGS
- linker: $LD (gnu? $with_gnu_ld)
- version: $progname (GNU libtool) 2.4.2.418
- automake: `($AUTOMAKE --version) 2>/dev/null |$SED 1q`
- autoconf: `($AUTOCONF --version) 2>/dev/null |$SED 1q`
-
-Report bugs to <bug-libtool@gnu.org>.
-GNU libtool home page: <http://www.gnu.org/software/libtool/>.
-General help using GNU software: <http://www.gnu.org/gethelp/>."
-
-
-# func_lo2o OBJECT-NAME
-# ---------------------
-# Transform OBJECT-NAME from a '.lo' suffix to the platform specific
-# object suffix.
-
-lo2o=s/\\.lo\$/.$objext/
-o2lo=s/\\.$objext\$/.lo/
-
-if test yes = "$_G_HAVE_XSI_OPS"; then
- eval 'func_lo2o ()
- {
- case $1 in
- *.lo) func_lo2o_result=${1%.lo}.$objext ;;
- * ) func_lo2o_result=$1 ;;
- esac
- }'
-
- # func_xform LIBOBJ-OR-SOURCE
- # ---------------------------
- # Transform LIBOBJ-OR-SOURCE from a '.o' or '.c' (or otherwise)
- # suffix to a '.lo' libtool-object suffix.
- eval 'func_xform ()
- {
- func_xform_result=${1%.*}.lo
- }'
-else
- # ...otherwise fall back to using sed.
- func_lo2o ()
- {
- func_lo2o_result=`$ECHO "$1" | $SED "$lo2o"`
- }
-
- func_xform ()
- {
- func_xform_result=`$ECHO "$1" | $SED 's|\.[^.]*$|.lo|'`
- }
-fi
-
-
-# func_fatal_configuration ARG...
-# -------------------------------
-# Echo program name prefixed message to standard error, followed by
-# a configuration failure hint, and exit.
-func_fatal_configuration ()
-{
- func__fatal_error ${1+"$@"} \
- "See the $PACKAGE documentation for more information." \
- "Fatal configuration error."
-}
-
-
-# func_config
-# -----------
-# Display the configuration for all the tags in this script.
-func_config ()
-{
- re_begincf='^# ### BEGIN LIBTOOL'
- re_endcf='^# ### END LIBTOOL'
-
- # Default configuration.
- $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath"
-
- # Now print the configurations for the tags.
- for tagname in $taglist; do
- $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath"
- done
-
- exit $?
-}
-
-
-# func_features
-# -------------
-# Display the features supported by this script.
-func_features ()
-{
- echo "host: $host"
- if test yes = "$build_libtool_libs"; then
- echo "enable shared libraries"
- else
- echo "disable shared libraries"
- fi
- if test yes = "$build_old_libs"; then
- echo "enable static libraries"
- else
- echo "disable static libraries"
- fi
-
- exit $?
-}
-
-
-# func_enable_tag TAGNAME
-# -----------------------
-# Verify that TAGNAME is valid, and either flag an error and exit, or
-# enable the TAGNAME tag. We also add TAGNAME to the global $taglist
-# variable here.
-func_enable_tag ()
-{
- # Global variable:
- tagname=$1
-
- re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$"
- re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$"
- sed_extractcf=/$re_begincf/,/$re_endcf/p
-
- # Validate tagname.
- case $tagname in
- *[!-_A-Za-z0-9,/]*)
- func_fatal_error "invalid tag name: $tagname"
- ;;
- esac
-
- # Don't test for the "default" C tag, as we know it's
- # there but not specially marked.
- case $tagname in
- CC) ;;
- *)
- if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then
- taglist="$taglist $tagname"
-
- # Evaluate the configuration. Be careful to quote the path
- # and the sed script, to avoid splitting on whitespace, but
- # also don't use non-portable quotes within backquotes within
- # quotes we have to do it in 2 steps:
- extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"`
- eval "$extractedcf"
- else
- func_error "ignoring unknown tag $tagname"
- fi
- ;;
- esac
-}
-
-
-# func_check_version_match
-# ------------------------
-# Ensure that we are using m4 macros, and libtool script from the same
-# release of libtool.
-func_check_version_match ()
-{
- if test "$package_revision" != "$macro_revision"; then
- if test "$VERSION" != "$macro_version"; then
- if test -z "$macro_version"; then
- cat >&2 <<_LT_EOF
-$progname: Version mismatch error. This is $PACKAGE $VERSION, but the
-$progname: definition of this LT_INIT comes from an older release.
-$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
-$progname: and run autoconf again.
-_LT_EOF
- else
- cat >&2 <<_LT_EOF
-$progname: Version mismatch error. This is $PACKAGE $VERSION, but the
-$progname: definition of this LT_INIT comes from $PACKAGE $macro_version.
-$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
-$progname: and run autoconf again.
-_LT_EOF
- fi
- else
- cat >&2 <<_LT_EOF
-$progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision,
-$progname: but the definition of this LT_INIT comes from revision $macro_revision.
-$progname: You should recreate aclocal.m4 with macros from revision $package_revision
-$progname: of $PACKAGE $VERSION and run autoconf again.
-_LT_EOF
- fi
-
- exit $EXIT_MISMATCH
- fi
-}
-
-
-# libtool_options_prep [ARG]...
-# -----------------------------
-# Preparation for options parsed by libtool.
-libtool_options_prep ()
-{
- $debug_mode
-
- # Option defaults:
- opt_config=false
- opt_dlopen=
- opt_dry_run=false
- opt_help=false
- opt_mode=
- opt_preserve_dup_deps=false
- opt_quiet=false
-
- nonopt=
- preserve_args=
-
- # Shorthand for --mode=foo, only valid as the first argument
- case $1 in
- clean|clea|cle|cl)
- shift; set dummy --mode clean ${1+"$@"}; shift
- ;;
- compile|compil|compi|comp|com|co|c)
- shift; set dummy --mode compile ${1+"$@"}; shift
- ;;
- execute|execut|execu|exec|exe|ex|e)
- shift; set dummy --mode execute ${1+"$@"}; shift
- ;;
- finish|finis|fini|fin|fi|f)
- shift; set dummy --mode finish ${1+"$@"}; shift
- ;;
- install|instal|insta|inst|ins|in|i)
- shift; set dummy --mode install ${1+"$@"}; shift
- ;;
- link|lin|li|l)
- shift; set dummy --mode link ${1+"$@"}; shift
- ;;
- uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
- shift; set dummy --mode uninstall ${1+"$@"}; shift
- ;;
- esac
-
- # Pass back the list of options.
- func_quote_for_eval ${1+"$@"}
- libtool_options_prep_result=$func_quote_for_eval_result
-}
-func_add_hook func_options_prep libtool_options_prep
-
-
-# libtool_parse_options [ARG]...
-# ---------------------------------
-# Provide handling for libtool specific options.
-libtool_parse_options ()
-{
- $debug_cmd
-
- # Perform our own loop to consume as many options as possible in
- # each iteration.
- while test $# -gt 0; do
- _G_opt=$1
- shift
- case $_G_opt in
- --dry-run|--dryrun|-n)
- opt_dry_run=:
- ;;
-
- --config) func_config ;;
-
- --dlopen|-dlopen)
- opt_dlopen="${opt_dlopen+$opt_dlopen
-}$1"
- shift
- ;;
-
- --preserve-dup-deps)
- opt_preserve_dup_deps=: ;;
-
- --features) func_features ;;
-
- --finish) set dummy --mode finish ${1+"$@"}; shift ;;
-
- --help) opt_help=: ;;
-
- --help-all) opt_help=': help-all' ;;
-
- --mode) test $# = 0 && func_missing_arg $_G_opt && break
- opt_mode=$1
- case $1 in
- # Valid mode arguments:
- clean|compile|execute|finish|install|link|relink|uninstall) ;;
-
- # Catch anything else as an error
- *) func_error "invalid argument for $_G_opt"
- exit_cmd=exit
- break
- ;;
- esac
- shift
- ;;
-
- --no-silent|--no-quiet)
- opt_quiet=false
- func_append preserve_args " $_G_opt"
- ;;
-
- --no-warnings|--no-warning|--no-warn)
- opt_warning=false
- func_append preserve_args " $_G_opt"
- ;;
-
- --no-verbose)
- opt_verbose=false
- func_append preserve_args " $_G_opt"
- ;;
-
- --silent|--quiet)
- opt_quiet=:
- opt_verbose=false
- func_append preserve_args " $_G_opt"
- ;;
-
- --tag) test $# = 0 && func_missing_arg $_G_opt && break
- opt_tag=$1
- func_append preserve_args " $_G_opt $1"
- func_enable_tag "$1"
- shift
- ;;
-
- --verbose|-v) opt_quiet=false
- opt_verbose=:
- func_append preserve_args " $_G_opt"
- ;;
-
- # An option not handled by this hook function:
- *) set dummy "$_G_opt" ${1+"$@"}; shift; break ;;
- esac
- done
-
-
- # save modified positional parameters for caller
- func_quote_for_eval ${1+"$@"}
- libtool_parse_options_result=$func_quote_for_eval_result
-}
-func_add_hook func_parse_options libtool_parse_options
-
-
-
-# libtool_validate_options [ARG]...
-# ---------------------------------
-# Perform any sanity checks on option settings and/or unconsumed
-# arguments.
-libtool_validate_options ()
-{
- # save first non-option argument
- if test 0 -lt $#; then
- nonopt=$1
- shift
- fi
-
- # preserve --debug
- test : = "$debug_cmd" || func_append preserve_args " --debug"
-
- case $host in
- *cygwin* | *mingw* | *pw32* | *cegcc*)
- # don't eliminate duplications in $postdeps and $predeps
- opt_duplicate_compiler_generated_deps=:
- ;;
- *)
- opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps
- ;;
- esac
-
- $opt_help || {
- # Sanity checks first:
- func_check_version_match
-
- test yes != "$build_libtool_libs" \
- && test yes != "$build_old_libs" \
- && func_fatal_configuration "not configured to build any kind of library"
-
- # Darwin sucks
- eval std_shrext=\"$shrext_cmds\"
-
- # Only execute mode is allowed to have -dlopen flags.
- if test -n "$opt_dlopen" && test execute != "$opt_mode"; then
- func_error "unrecognized option '-dlopen'"
- $ECHO "$help" 1>&2
- exit $EXIT_FAILURE
- fi
-
- # Change the help message to a mode-specific one.
- generic_help=$help
- help="Try '$progname --help --mode=$opt_mode' for more information."
- }
-
- # Pass back the unparsed argument list
- func_quote_for_eval ${1+"$@"}
- libtool_validate_options_result=$func_quote_for_eval_result
-}
-func_add_hook func_validate_options libtool_validate_options
-
-
-# Process options as early as possible so that --help and --version
-# can return quickly.
-func_options ${1+"$@"}
-eval set dummy "$func_options_result"; shift
-
-
-
-## ----------- ##
-## Main. ##
-## ----------- ##
-
-magic='%%%MAGIC variable%%%'
-magic_exe='%%%MAGIC EXE variable%%%'
-
-# Global variables.
-extracted_archives=
-extracted_serial=0
-
-# If this variable is set in any of the actions, the command in it
-# will be execed at the end. This prevents here-documents from being
-# left over by shells.
-exec_cmd=
-
-
-# A function that is used when there is no print builtin or printf.
-func_fallback_echo ()
-{
- eval 'cat <<_LTECHO_EOF
-$1
-_LTECHO_EOF'
-}
-
-# func_lalib_p file
-# True iff FILE is a libtool '.la' library or '.lo' object file.
-# This function is only a basic sanity check; it will hardly flush out
-# determined imposters.
-func_lalib_p ()
-{
- test -f "$1" &&
- $SED -e 4q "$1" 2>/dev/null \
- | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1
-}
-
-# func_lalib_unsafe_p file
-# True iff FILE is a libtool '.la' library or '.lo' object file.
-# This function implements the same check as func_lalib_p without
-# resorting to external programs. To this end, it redirects stdin and
-# closes it afterwards, without saving the original file descriptor.
-# As a safety measure, use it only where a negative result would be
-# fatal anyway. Works if 'file' does not exist.
-func_lalib_unsafe_p ()
-{
- lalib_p=no
- if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then
- for lalib_p_l in 1 2 3 4
- do
- read lalib_p_line
- case $lalib_p_line in
- \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;;
- esac
- done
- exec 0<&5 5<&-
- fi
- test yes = "$lalib_p"
-}
-
-# func_ltwrapper_script_p file
-# True iff FILE is a libtool wrapper script
-# This function is only a basic sanity check; it will hardly flush out
-# determined imposters.
-func_ltwrapper_script_p ()
-{
- func_lalib_p "$1"
-}
-
-# func_ltwrapper_executable_p file
-# True iff FILE is a libtool wrapper executable
-# This function is only a basic sanity check; it will hardly flush out
-# determined imposters.
-func_ltwrapper_executable_p ()
-{
- func_ltwrapper_exec_suffix=
- case $1 in
- *.exe) ;;
- *) func_ltwrapper_exec_suffix=.exe ;;
- esac
- $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1
-}
-
-# func_ltwrapper_scriptname file
-# Assumes file is an ltwrapper_executable
-# uses $file to determine the appropriate filename for a
-# temporary ltwrapper_script.
-func_ltwrapper_scriptname ()
-{
- func_dirname_and_basename "$1" "" "."
- func_stripname '' '.exe' "$func_basename_result"
- func_ltwrapper_scriptname_result=$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper
-}
-
-# func_ltwrapper_p file
-# True iff FILE is a libtool wrapper script or wrapper executable
-# This function is only a basic sanity check; it will hardly flush out
-# determined imposters.
-func_ltwrapper_p ()
-{
- func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1"
-}
-
-
-# func_execute_cmds commands fail_cmd
-# Execute tilde-delimited COMMANDS.
-# If FAIL_CMD is given, eval that upon failure.
-# FAIL_CMD may read-access the current command in variable CMD!
-func_execute_cmds ()
-{
- $debug_cmd
-
- save_ifs=$IFS; IFS='~'
- for cmd in $1; do
- IFS=$sp$nl
- eval cmd=\"$cmd\"
- IFS=$save_ifs
- func_show_eval "$cmd" "${2-:}"
- done
- IFS=$save_ifs
-}
-
-
-# func_source file
-# Source FILE, adding directory component if necessary.
-# Note that it is not necessary on cygwin/mingw to append a dot to
-# FILE even if both FILE and FILE.exe exist: automatic-append-.exe
-# behavior happens only for exec(3), not for open(2)! Also, sourcing
-# 'FILE.' does not work on cygwin managed mounts.
-func_source ()
-{
- $debug_cmd
-
- case $1 in
- */* | *\\*) . "$1" ;;
- *) . "./$1" ;;
- esac
-}
-
-
-# func_resolve_sysroot PATH
-# Replace a leading = in PATH with a sysroot. Store the result into
-# func_resolve_sysroot_result
-func_resolve_sysroot ()
-{
- func_resolve_sysroot_result=$1
- case $func_resolve_sysroot_result in
- =*)
- func_stripname '=' '' "$func_resolve_sysroot_result"
- func_resolve_sysroot_result=$lt_sysroot$func_stripname_result
- ;;
- esac
-}
-
-# func_replace_sysroot PATH
-# If PATH begins with the sysroot, replace it with = and
-# store the result into func_replace_sysroot_result.
-func_replace_sysroot ()
-{
- case $lt_sysroot:$1 in
- ?*:"$lt_sysroot"*)
- func_stripname "$lt_sysroot" '' "$1"
- func_replace_sysroot_result='='$func_stripname_result
- ;;
- *)
- # Including no sysroot.
- func_replace_sysroot_result=$1
- ;;
- esac
-}
-
-# func_infer_tag arg
-# Infer tagged configuration to use if any are available and
-# if one wasn't chosen via the "--tag" command line option.
-# Only attempt this if the compiler in the base compile
-# command doesn't match the default compiler.
-# arg is usually of the form 'gcc ...'
-func_infer_tag ()
-{
- $debug_cmd
-
- if test -n "$available_tags" && test -z "$tagname"; then
- CC_quoted=
- for arg in $CC; do
- func_append_quoted CC_quoted "$arg"
- done
- CC_expanded=`func_echo_all $CC`
- CC_quoted_expanded=`func_echo_all $CC_quoted`
- case $@ in
- # Blanks in the command may have been stripped by the calling shell,
- # but not from the CC environment variable when configure was run.
- " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \
- " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;;
- # Blanks at the start of $base_compile will cause this to fail
- # if we don't check for them as well.
- *)
- for z in $available_tags; do
- if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
- # Evaluate the configuration.
- eval "`$SED -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
- CC_quoted=
- for arg in $CC; do
- # Double-quote args containing other shell metacharacters.
- func_append_quoted CC_quoted "$arg"
- done
- CC_expanded=`func_echo_all $CC`
- CC_quoted_expanded=`func_echo_all $CC_quoted`
- case "$@ " in
- " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \
- " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*)
- # The compiler in the base compile command matches
- # the one in the tagged configuration.
- # Assume this is the tagged configuration we want.
- tagname=$z
- break
- ;;
- esac
- fi
- done
- # If $tagname still isn't set, then no tagged configuration
- # was found and let the user know that the "--tag" command
- # line option must be used.
- if test -z "$tagname"; then
- func_echo "unable to infer tagged configuration"
- func_fatal_error "specify a tag with '--tag'"
-# else
-# func_verbose "using $tagname tagged configuration"
- fi
- ;;
- esac
- fi
-}
-
-
-
-# func_write_libtool_object output_name pic_name nonpic_name
-# Create a libtool object file (analogous to a ".la" file),
-# but don't create it if we're doing a dry run.
-func_write_libtool_object ()
-{
- write_libobj=$1
- if test yes = "$build_libtool_libs"; then
- write_lobj=\'$2\'
- else
- write_lobj=none
- fi
-
- if test yes = "$build_old_libs"; then
- write_oldobj=\'$3\'
- else
- write_oldobj=none
- fi
-
- $opt_dry_run || {
- cat >${write_libobj}T <<EOF
-# $write_libobj - a libtool object file
-# Generated by $PROGRAM (GNU $PACKAGE) $VERSION
-#
-# Please DO NOT delete this file!
-# It is necessary for linking the library.
-
-# Name of the PIC object.
-pic_object=$write_lobj
-
-# Name of the non-PIC object
-non_pic_object=$write_oldobj
-
-EOF
- $MV "${write_libobj}T" "$write_libobj"
- }
-}
-
-
-##################################################
-# FILE NAME AND PATH CONVERSION HELPER FUNCTIONS #
-##################################################
-
-# func_convert_core_file_wine_to_w32 ARG
-# Helper function used by file name conversion functions when $build is *nix,
-# and $host is mingw, cygwin, or some other w32 environment. Relies on a
-# correctly configured wine environment available, with the winepath program
-# in $build's $PATH.
-#
-# ARG is the $build file name to be converted to w32 format.
-# Result is available in $func_convert_core_file_wine_to_w32_result, and will
-# be empty on error (or when ARG is empty)
-func_convert_core_file_wine_to_w32 ()
-{
- $debug_cmd
-
- func_convert_core_file_wine_to_w32_result=$1
- if test -n "$1"; then
- # Unfortunately, winepath does not exit with a non-zero error code, so we
- # are forced to check the contents of stdout. On the other hand, if the
- # command is not found, the shell will set an exit code of 127 and print
- # *an error message* to stdout. So we must check for both error code of
- # zero AND non-empty stdout, which explains the odd construction:
- func_convert_core_file_wine_to_w32_tmp=`winepath -w "$1" 2>/dev/null`
- if test "$?" -eq 0 && test -n "$func_convert_core_file_wine_to_w32_tmp"; then
- func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" |
- $SED -e "$sed_naive_backslashify"`
- else
- func_convert_core_file_wine_to_w32_result=
- fi
- fi
-}
-# end: func_convert_core_file_wine_to_w32
-
-
-# func_convert_core_path_wine_to_w32 ARG
-# Helper function used by path conversion functions when $build is *nix, and
-# $host is mingw, cygwin, or some other w32 environment. Relies on a correctly
-# configured wine environment available, with the winepath program in $build's
-# $PATH. Assumes ARG has no leading or trailing path separator characters.
-#
-# ARG is path to be converted from $build format to win32.
-# Result is available in $func_convert_core_path_wine_to_w32_result.
-# Unconvertible file (directory) names in ARG are skipped; if no directory names
-# are convertible, then the result may be empty.
-func_convert_core_path_wine_to_w32 ()
-{
- $debug_cmd
-
- # unfortunately, winepath doesn't convert paths, only file names
- func_convert_core_path_wine_to_w32_result=
- if test -n "$1"; then
- oldIFS=$IFS
- IFS=:
- for func_convert_core_path_wine_to_w32_f in $1; do
- IFS=$oldIFS
- func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f"
- if test -n "$func_convert_core_file_wine_to_w32_result"; then
- if test -z "$func_convert_core_path_wine_to_w32_result"; then
- func_convert_core_path_wine_to_w32_result=$func_convert_core_file_wine_to_w32_result
- else
- func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result"
- fi
- fi
- done
- IFS=$oldIFS
- fi
-}
-# end: func_convert_core_path_wine_to_w32
-
-
-# func_cygpath ARGS...
-# Wrapper around calling the cygpath program via LT_CYGPATH. This is used when
-# when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2)
-# $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or
-# (2), returns the Cygwin file name or path in func_cygpath_result (input
-# file name or path is assumed to be in w32 format, as previously converted
-# from $build's *nix or MSYS format). In case (3), returns the w32 file name
-# or path in func_cygpath_result (input file name or path is assumed to be in
-# Cygwin format). Returns an empty string on error.
-#
-# ARGS are passed to cygpath, with the last one being the file name or path to
-# be converted.
-#
-# Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH
-# environment variable; do not put it in $PATH.
-func_cygpath ()
-{
- $debug_cmd
-
- if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then
- func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null`
- if test "$?" -ne 0; then
- # on failure, ensure result is empty
- func_cygpath_result=
- fi
- else
- func_cygpath_result=
- func_error "LT_CYGPATH is empty or specifies non-existent file: '$LT_CYGPATH'"
- fi
-}
-#end: func_cygpath
-
-
-# func_convert_core_msys_to_w32 ARG
-# Convert file name or path ARG from MSYS format to w32 format. Return
-# result in func_convert_core_msys_to_w32_result.
-func_convert_core_msys_to_w32 ()
-{
- $debug_cmd
-
- # awkward: cmd appends spaces to result
- func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null |
- $SED -e 's/[ ]*$//' -e "$sed_naive_backslashify"`
-}
-#end: func_convert_core_msys_to_w32
-
-
-# func_convert_file_check ARG1 ARG2
-# Verify that ARG1 (a file name in $build format) was converted to $host
-# format in ARG2. Otherwise, emit an error message, but continue (resetting
-# func_to_host_file_result to ARG1).
-func_convert_file_check ()
-{
- $debug_cmd
-
- if test -z "$2" && test -n "$1"; then
- func_error "Could not determine host file name corresponding to"
- func_error " '$1'"
- func_error "Continuing, but uninstalled executables may not work."
- # Fallback:
- func_to_host_file_result=$1
- fi
-}
-# end func_convert_file_check
-
-
-# func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH
-# Verify that FROM_PATH (a path in $build format) was converted to $host
-# format in TO_PATH. Otherwise, emit an error message, but continue, resetting
-# func_to_host_file_result to a simplistic fallback value (see below).
-func_convert_path_check ()
-{
- $debug_cmd
-
- if test -z "$4" && test -n "$3"; then
- func_error "Could not determine the host path corresponding to"
- func_error " '$3'"
- func_error "Continuing, but uninstalled executables may not work."
- # Fallback. This is a deliberately simplistic "conversion" and
- # should not be "improved". See libtool.info.
- if test "x$1" != "x$2"; then
- lt_replace_pathsep_chars="s|$1|$2|g"
- func_to_host_path_result=`echo "$3" |
- $SED -e "$lt_replace_pathsep_chars"`
- else
- func_to_host_path_result=$3
- fi
- fi
-}
-# end func_convert_path_check
-
-
-# func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG
-# Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT
-# and appending REPL if ORIG matches BACKPAT.
-func_convert_path_front_back_pathsep ()
-{
- $debug_cmd
-
- case $4 in
- $1 ) func_to_host_path_result=$3$func_to_host_path_result
- ;;
- esac
- case $4 in
- $2 ) func_append func_to_host_path_result "$3"
- ;;
- esac
-}
-# end func_convert_path_front_back_pathsep
-
-
-##################################################
-# $build to $host FILE NAME CONVERSION FUNCTIONS #
-##################################################
-# invoked via '$to_host_file_cmd ARG'
-#
-# In each case, ARG is the path to be converted from $build to $host format.
-# Result will be available in $func_to_host_file_result.
-
-
-# func_to_host_file ARG
-# Converts the file name ARG from $build format to $host format. Return result
-# in func_to_host_file_result.
-func_to_host_file ()
-{
- $debug_cmd
-
- $to_host_file_cmd "$1"
-}
-# end func_to_host_file
-
-
-# func_to_tool_file ARG LAZY
-# converts the file name ARG from $build format to toolchain format. Return
-# result in func_to_tool_file_result. If the conversion in use is listed
-# in (the comma separated) LAZY, no conversion takes place.
-func_to_tool_file ()
-{
- $debug_cmd
-
- case ,$2, in
- *,"$to_tool_file_cmd",*)
- func_to_tool_file_result=$1
- ;;
- *)
- $to_tool_file_cmd "$1"
- func_to_tool_file_result=$func_to_host_file_result
- ;;
- esac
-}
-# end func_to_tool_file
-
-
-# func_convert_file_noop ARG
-# Copy ARG to func_to_host_file_result.
-func_convert_file_noop ()
-{
- func_to_host_file_result=$1
-}
-# end func_convert_file_noop
-
-
-# func_convert_file_msys_to_w32 ARG
-# Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic
-# conversion to w32 is not available inside the cwrapper. Returns result in
-# func_to_host_file_result.
-func_convert_file_msys_to_w32 ()
-{
- $debug_cmd
-
- func_to_host_file_result=$1
- if test -n "$1"; then
- func_convert_core_msys_to_w32 "$1"
- func_to_host_file_result=$func_convert_core_msys_to_w32_result
- fi
- func_convert_file_check "$1" "$func_to_host_file_result"
-}
-# end func_convert_file_msys_to_w32
-
-
-# func_convert_file_cygwin_to_w32 ARG
-# Convert file name ARG from Cygwin to w32 format. Returns result in
-# func_to_host_file_result.
-func_convert_file_cygwin_to_w32 ()
-{
- $debug_cmd
-
- func_to_host_file_result=$1
- if test -n "$1"; then
- # because $build is cygwin, we call "the" cygpath in $PATH; no need to use
- # LT_CYGPATH in this case.
- func_to_host_file_result=`cygpath -m "$1"`
- fi
- func_convert_file_check "$1" "$func_to_host_file_result"
-}
-# end func_convert_file_cygwin_to_w32
-
-
-# func_convert_file_nix_to_w32 ARG
-# Convert file name ARG from *nix to w32 format. Requires a wine environment
-# and a working winepath. Returns result in func_to_host_file_result.
-func_convert_file_nix_to_w32 ()
-{
- $debug_cmd
-
- func_to_host_file_result=$1
- if test -n "$1"; then
- func_convert_core_file_wine_to_w32 "$1"
- func_to_host_file_result=$func_convert_core_file_wine_to_w32_result
- fi
- func_convert_file_check "$1" "$func_to_host_file_result"
-}
-# end func_convert_file_nix_to_w32
-
-
-# func_convert_file_msys_to_cygwin ARG
-# Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set.
-# Returns result in func_to_host_file_result.
-func_convert_file_msys_to_cygwin ()
-{
- $debug_cmd
-
- func_to_host_file_result=$1
- if test -n "$1"; then
- func_convert_core_msys_to_w32 "$1"
- func_cygpath -u "$func_convert_core_msys_to_w32_result"
- func_to_host_file_result=$func_cygpath_result
- fi
- func_convert_file_check "$1" "$func_to_host_file_result"
-}
-# end func_convert_file_msys_to_cygwin
-
-
-# func_convert_file_nix_to_cygwin ARG
-# Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed
-# in a wine environment, working winepath, and LT_CYGPATH set. Returns result
-# in func_to_host_file_result.
-func_convert_file_nix_to_cygwin ()
-{
- $debug_cmd
-
- func_to_host_file_result=$1
- if test -n "$1"; then
- # convert from *nix to w32, then use cygpath to convert from w32 to cygwin.
- func_convert_core_file_wine_to_w32 "$1"
- func_cygpath -u "$func_convert_core_file_wine_to_w32_result"
- func_to_host_file_result=$func_cygpath_result
- fi
- func_convert_file_check "$1" "$func_to_host_file_result"
-}
-# end func_convert_file_nix_to_cygwin
-
-
-#############################################
-# $build to $host PATH CONVERSION FUNCTIONS #
-#############################################
-# invoked via '$to_host_path_cmd ARG'
-#
-# In each case, ARG is the path to be converted from $build to $host format.
-# The result will be available in $func_to_host_path_result.
-#
-# Path separators are also converted from $build format to $host format. If
-# ARG begins or ends with a path separator character, it is preserved (but
-# converted to $host format) on output.
-#
-# All path conversion functions are named using the following convention:
-# file name conversion function : func_convert_file_X_to_Y ()
-# path conversion function : func_convert_path_X_to_Y ()
-# where, for any given $build/$host combination the 'X_to_Y' value is the
-# same. If conversion functions are added for new $build/$host combinations,
-# the two new functions must follow this pattern, or func_init_to_host_path_cmd
-# will break.
-
-
-# func_init_to_host_path_cmd
-# Ensures that function "pointer" variable $to_host_path_cmd is set to the
-# appropriate value, based on the value of $to_host_file_cmd.
-to_host_path_cmd=
-func_init_to_host_path_cmd ()
-{
- $debug_cmd
-
- if test -z "$to_host_path_cmd"; then
- func_stripname 'func_convert_file_' '' "$to_host_file_cmd"
- to_host_path_cmd=func_convert_path_$func_stripname_result
- fi
-}
-
-
-# func_to_host_path ARG
-# Converts the path ARG from $build format to $host format. Return result
-# in func_to_host_path_result.
-func_to_host_path ()
-{
- $debug_cmd
-
- func_init_to_host_path_cmd
- $to_host_path_cmd "$1"
-}
-# end func_to_host_path
-
-
-# func_convert_path_noop ARG
-# Copy ARG to func_to_host_path_result.
-func_convert_path_noop ()
-{
- func_to_host_path_result=$1
-}
-# end func_convert_path_noop
-
-
-# func_convert_path_msys_to_w32 ARG
-# Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic
-# conversion to w32 is not available inside the cwrapper. Returns result in
-# func_to_host_path_result.
-func_convert_path_msys_to_w32 ()
-{
- $debug_cmd
-
- func_to_host_path_result=$1
- if test -n "$1"; then
- # Remove leading and trailing path separator characters from ARG. MSYS
- # behavior is inconsistent here; cygpath turns them into '.;' and ';.';
- # and winepath ignores them completely.
- func_stripname : : "$1"
- func_to_host_path_tmp1=$func_stripname_result
- func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
- func_to_host_path_result=$func_convert_core_msys_to_w32_result
- func_convert_path_check : ";" \
- "$func_to_host_path_tmp1" "$func_to_host_path_result"
- func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
- fi
-}
-# end func_convert_path_msys_to_w32
-
-
-# func_convert_path_cygwin_to_w32 ARG
-# Convert path ARG from Cygwin to w32 format. Returns result in
-# func_to_host_file_result.
-func_convert_path_cygwin_to_w32 ()
-{
- $debug_cmd
-
- func_to_host_path_result=$1
- if test -n "$1"; then
- # See func_convert_path_msys_to_w32:
- func_stripname : : "$1"
- func_to_host_path_tmp1=$func_stripname_result
- func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"`
- func_convert_path_check : ";" \
- "$func_to_host_path_tmp1" "$func_to_host_path_result"
- func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
- fi
-}
-# end func_convert_path_cygwin_to_w32
-
-
-# func_convert_path_nix_to_w32 ARG
-# Convert path ARG from *nix to w32 format. Requires a wine environment and
-# a working winepath. Returns result in func_to_host_file_result.
-func_convert_path_nix_to_w32 ()
-{
- $debug_cmd
-
- func_to_host_path_result=$1
- if test -n "$1"; then
- # See func_convert_path_msys_to_w32:
- func_stripname : : "$1"
- func_to_host_path_tmp1=$func_stripname_result
- func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
- func_to_host_path_result=$func_convert_core_path_wine_to_w32_result
- func_convert_path_check : ";" \
- "$func_to_host_path_tmp1" "$func_to_host_path_result"
- func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
- fi
-}
-# end func_convert_path_nix_to_w32
-
-
-# func_convert_path_msys_to_cygwin ARG
-# Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set.
-# Returns result in func_to_host_file_result.
-func_convert_path_msys_to_cygwin ()
-{
- $debug_cmd
-
- func_to_host_path_result=$1
- if test -n "$1"; then
- # See func_convert_path_msys_to_w32:
- func_stripname : : "$1"
- func_to_host_path_tmp1=$func_stripname_result
- func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
- func_cygpath -u -p "$func_convert_core_msys_to_w32_result"
- func_to_host_path_result=$func_cygpath_result
- func_convert_path_check : : \
- "$func_to_host_path_tmp1" "$func_to_host_path_result"
- func_convert_path_front_back_pathsep ":*" "*:" : "$1"
- fi
-}
-# end func_convert_path_msys_to_cygwin
-
-
-# func_convert_path_nix_to_cygwin ARG
-# Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a
-# a wine environment, working winepath, and LT_CYGPATH set. Returns result in
-# func_to_host_file_result.
-func_convert_path_nix_to_cygwin ()
-{
- $debug_cmd
-
- func_to_host_path_result=$1
- if test -n "$1"; then
- # Remove leading and trailing path separator characters from
- # ARG. msys behavior is inconsistent here, cygpath turns them
- # into '.;' and ';.', and winepath ignores them completely.
- func_stripname : : "$1"
- func_to_host_path_tmp1=$func_stripname_result
- func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
- func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result"
- func_to_host_path_result=$func_cygpath_result
- func_convert_path_check : : \
- "$func_to_host_path_tmp1" "$func_to_host_path_result"
- func_convert_path_front_back_pathsep ":*" "*:" : "$1"
- fi
-}
-# end func_convert_path_nix_to_cygwin
-
-
-# func_dll_def_p FILE
-# True iff FILE is a Windows DLL '.def' file.
-# Keep in sync with _LT_DLL_DEF_P in libtool.m4
-func_dll_def_p ()
-{
- $debug_cmd
-
- func_dll_def_p_tmp=`$SED -n \
- -e 's/^[ ]*//' \
- -e '/^\(;.*\)*$/d' \
- -e 's/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p' \
- -e q \
- "$1"`
- test DEF = "$func_dll_def_p_tmp"
-}
-
-
-# func_mode_compile arg...
-func_mode_compile ()
-{
- $debug_cmd
-
- # Get the compilation command and the source file.
- base_compile=
- srcfile=$nonopt # always keep a non-empty value in "srcfile"
- suppress_opt=yes
- suppress_output=
- arg_mode=normal
- libobj=
- later=
- pie_flag=
-
- for arg
- do
- case $arg_mode in
- arg )
- # do not "continue". Instead, add this to base_compile
- lastarg=$arg
- arg_mode=normal
- ;;
-
- target )
- libobj=$arg
- arg_mode=normal
- continue
- ;;
-
- normal )
- # Accept any command-line options.
- case $arg in
- -o)
- test -n "$libobj" && \
- func_fatal_error "you cannot specify '-o' more than once"
- arg_mode=target
- continue
- ;;
-
- -pie | -fpie | -fPIE)
- func_append pie_flag " $arg"
- continue
- ;;
-
- -shared | -static | -prefer-pic | -prefer-non-pic)
- func_append later " $arg"
- continue
- ;;
-
- -no-suppress)
- suppress_opt=no
- continue
- ;;
-
- -Xcompiler)
- arg_mode=arg # the next one goes into the "base_compile" arg list
- continue # The current "srcfile" will either be retained or
- ;; # replaced later. I would guess that would be a bug.
-
- -Wc,*)
- func_stripname '-Wc,' '' "$arg"
- args=$func_stripname_result
- lastarg=
- save_ifs=$IFS; IFS=,
- for arg in $args; do
- IFS=$save_ifs
- func_append_quoted lastarg "$arg"
- done
- IFS=$save_ifs
- func_stripname ' ' '' "$lastarg"
- lastarg=$func_stripname_result
-
- # Add the arguments to base_compile.
- func_append base_compile " $lastarg"
- continue
- ;;
-
- *)
- # Accept the current argument as the source file.
- # The previous "srcfile" becomes the current argument.
- #
- lastarg=$srcfile
- srcfile=$arg
- ;;
- esac # case $arg
- ;;
- esac # case $arg_mode
-
- # Aesthetically quote the previous argument.
- func_append_quoted base_compile "$lastarg"
- done # for arg
-
- case $arg_mode in
- arg)
- func_fatal_error "you must specify an argument for -Xcompile"
- ;;
- target)
- func_fatal_error "you must specify a target with '-o'"
- ;;
- *)
- # Get the name of the library object.
- test -z "$libobj" && {
- func_basename "$srcfile"
- libobj=$func_basename_result
- }
- ;;
- esac
-
- # Recognize several different file suffixes.
- # If the user specifies -o file.o, it is replaced with file.lo
- case $libobj in
- *.[cCFSifmso] | \
- *.ada | *.adb | *.ads | *.asm | \
- *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \
- *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup)
- func_xform "$libobj"
- libobj=$func_xform_result
- ;;
- esac
-
- case $libobj in
- *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;;
- *)
- func_fatal_error "cannot determine name of library object from '$libobj'"
- ;;
- esac
-
- func_infer_tag $base_compile
-
- for arg in $later; do
- case $arg in
- -shared)
- test yes = "$build_libtool_libs" \
- || func_fatal_configuration "cannot build a shared library"
- build_old_libs=no
- continue
- ;;
-
- -static)
- build_libtool_libs=no
- build_old_libs=yes
- continue
- ;;
-
- -prefer-pic)
- pic_mode=yes
- continue
- ;;
-
- -prefer-non-pic)
- pic_mode=no
- continue
- ;;
- esac
- done
-
- func_quote_for_eval "$libobj"
- test "X$libobj" != "X$func_quote_for_eval_result" \
- && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \
- && func_warning "libobj name '$libobj' may not contain shell special characters."
- func_dirname_and_basename "$obj" "/" ""
- objname=$func_basename_result
- xdir=$func_dirname_result
- lobj=$xdir$objdir/$objname
-
- test -z "$base_compile" && \
- func_fatal_help "you must specify a compilation command"
-
- # Delete any leftover library objects.
- if test yes = "$build_old_libs"; then
- removelist="$obj $lobj $libobj ${libobj}T"
- else
- removelist="$lobj $libobj ${libobj}T"
- fi
-
- # On Cygwin there's no "real" PIC flag so we must build both object types
- case $host_os in
- cygwin* | mingw* | pw32* | os2* | cegcc*)
- pic_mode=default
- ;;
- esac
- if test no = "$pic_mode" && test pass_all != "$deplibs_check_method"; then
- # non-PIC code in shared libraries is not supported
- pic_mode=default
- fi
-
- # Calculate the filename of the output object if compiler does
- # not support -o with -c
- if test no = "$compiler_c_o"; then
- output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.$objext
- lockfile=$output_obj.lock
- else
- output_obj=
- need_locks=no
- lockfile=
- fi
-
- # Lock this critical section if it is needed
- # We use this script file to make the link, it avoids creating a new file
- if test yes = "$need_locks"; then
- until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
- func_echo "Waiting for $lockfile to be removed"
- sleep 2
- done
- elif test warn = "$need_locks"; then
- if test -f "$lockfile"; then
- $ECHO "\
-*** ERROR, $lockfile exists and contains:
-`cat $lockfile 2>/dev/null`
-
-This indicates that another process is trying to use the same
-temporary object file, and libtool could not work around it because
-your compiler does not support '-c' and '-o' together. If you
-repeat this compilation, it may succeed, by chance, but you had better
-avoid parallel builds (make -j) in this platform, or get a better
-compiler."
-
- $opt_dry_run || $RM $removelist
- exit $EXIT_FAILURE
- fi
- func_append removelist " $output_obj"
- $ECHO "$srcfile" > "$lockfile"
- fi
-
- $opt_dry_run || $RM $removelist
- func_append removelist " $lockfile"
- trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15
-
- func_to_tool_file "$srcfile" func_convert_file_msys_to_w32
- srcfile=$func_to_tool_file_result
- func_quote_for_eval "$srcfile"
- qsrcfile=$func_quote_for_eval_result
-
- # Only build a PIC object if we are building libtool libraries.
- if test yes = "$build_libtool_libs"; then
- # Without this assignment, base_compile gets emptied.
- fbsd_hideous_sh_bug=$base_compile
-
- if test no != "$pic_mode"; then
- command="$base_compile $qsrcfile $pic_flag"
- else
- # Don't build PIC code
- command="$base_compile $qsrcfile"
- fi
-
- func_mkdir_p "$xdir$objdir"
-
- if test -z "$output_obj"; then
- # Place PIC objects in $objdir
- func_append command " -o $lobj"
- fi
-
- func_show_eval_locale "$command" \
- 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE'
-
- if test warn = "$need_locks" &&
- test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
- $ECHO "\
-*** ERROR, $lockfile contains:
-`cat $lockfile 2>/dev/null`
-
-but it should contain:
-$srcfile
-
-This indicates that another process is trying to use the same
-temporary object file, and libtool could not work around it because
-your compiler does not support '-c' and '-o' together. If you
-repeat this compilation, it may succeed, by chance, but you had better
-avoid parallel builds (make -j) in this platform, or get a better
-compiler."
-
- $opt_dry_run || $RM $removelist
- exit $EXIT_FAILURE
- fi
-
- # Just move the object if needed, then go on to compile the next one
- if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
- func_show_eval '$MV "$output_obj" "$lobj"' \
- 'error=$?; $opt_dry_run || $RM $removelist; exit $error'
- fi
-
- # Allow error messages only from the first compilation.
- if test yes = "$suppress_opt"; then
- suppress_output=' >/dev/null 2>&1'
- fi
- fi
-
- # Only build a position-dependent object if we build old libraries.
- if test yes = "$build_old_libs"; then
- if test yes != "$pic_mode"; then
- # Don't build PIC code
- command="$base_compile $qsrcfile$pie_flag"
- else
- command="$base_compile $qsrcfile $pic_flag"
- fi
- if test yes = "$compiler_c_o"; then
- func_append command " -o $obj"
- fi
-
- # Suppress compiler output if we already did a PIC compilation.
- func_append command "$suppress_output"
- func_show_eval_locale "$command" \
- '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE'
-
- if test warn = "$need_locks" &&
- test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
- $ECHO "\
-*** ERROR, $lockfile contains:
-`cat $lockfile 2>/dev/null`
-
-but it should contain:
-$srcfile
-
-This indicates that another process is trying to use the same
-temporary object file, and libtool could not work around it because
-your compiler does not support '-c' and '-o' together. If you
-repeat this compilation, it may succeed, by chance, but you had better
-avoid parallel builds (make -j) in this platform, or get a better
-compiler."
-
- $opt_dry_run || $RM $removelist
- exit $EXIT_FAILURE
- fi
-
- # Just move the object if needed
- if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
- func_show_eval '$MV "$output_obj" "$obj"' \
- 'error=$?; $opt_dry_run || $RM $removelist; exit $error'
- fi
- fi
-
- $opt_dry_run || {
- func_write_libtool_object "$libobj" "$objdir/$objname" "$objname"
-
- # Unlock the critical section if it was locked
- if test no != "$need_locks"; then
- removelist=$lockfile
- $RM "$lockfile"
- fi
- }
-
- exit $EXIT_SUCCESS
-}
-
-$opt_help || {
- test compile = "$opt_mode" && func_mode_compile ${1+"$@"}
-}
-
-func_mode_help ()
-{
- # We need to display help for each of the modes.
- case $opt_mode in
- "")
- # Generic help is extracted from the usage comments
- # at the start of this file.
- func_help
- ;;
-
- clean)
- $ECHO \
-"Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
-
-Remove files from the build directory.
-
-RM is the name of the program to use to delete files associated with each FILE
-(typically '/bin/rm'). RM-OPTIONS are options (such as '-f') to be passed
-to RM.
-
-If FILE is a libtool library, object or program, all the files associated
-with it are deleted. Otherwise, only FILE itself is deleted using RM."
- ;;
-
- compile)
- $ECHO \
-"Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
-
-Compile a source file into a libtool library object.
-
-This mode accepts the following additional options:
-
- -o OUTPUT-FILE set the output file name to OUTPUT-FILE
- -no-suppress do not suppress compiler output for multiple passes
- -prefer-pic try to build PIC objects only
- -prefer-non-pic try to build non-PIC objects only
- -shared do not build a '.o' file suitable for static linking
- -static only build a '.o' file suitable for static linking
- -Wc,FLAG pass FLAG directly to the compiler
-
-COMPILE-COMMAND is a command to be used in creating a 'standard' object file
-from the given SOURCEFILE.
-
-The output file name is determined by removing the directory component from
-SOURCEFILE, then substituting the C source code suffix '.c' with the
-library object suffix, '.lo'."
- ;;
-
- execute)
- $ECHO \
-"Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]...
-
-Automatically set library path, then run a program.
-
-This mode accepts the following additional options:
-
- -dlopen FILE add the directory containing FILE to the library path
-
-This mode sets the library path environment variable according to '-dlopen'
-flags.
-
-If any of the ARGS are libtool executable wrappers, then they are translated
-into their corresponding uninstalled binary, and any of their required library
-directories are added to the library path.
-
-Then, COMMAND is executed, with ARGS as arguments."
- ;;
-
- finish)
- $ECHO \
-"Usage: $progname [OPTION]... --mode=finish [LIBDIR]...
-
-Complete the installation of libtool libraries.
-
-Each LIBDIR is a directory that contains libtool libraries.
-
-The commands that this mode executes may require superuser privileges. Use
-the '--dry-run' option if you just want to see what would be executed."
- ;;
-
- install)
- $ECHO \
-"Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND...
-
-Install executables or libraries.
-
-INSTALL-COMMAND is the installation command. The first component should be
-either the 'install' or 'cp' program.
-
-The following components of INSTALL-COMMAND are treated specially:
-
- -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation
-
-The rest of the components are interpreted as arguments to that command (only
-BSD-compatible install options are recognized)."
- ;;
-
- link)
- $ECHO \
-"Usage: $progname [OPTION]... --mode=link LINK-COMMAND...
-
-Link object files or libraries together to form another library, or to
-create an executable program.
-
-LINK-COMMAND is a command using the C compiler that you would use to create
-a program from several object files.
-
-The following components of LINK-COMMAND are treated specially:
-
- -all-static do not do any dynamic linking at all
- -avoid-version do not add a version suffix if possible
- -bindir BINDIR specify path to binaries directory (for systems where
- libraries must be found in the PATH setting at runtime)
- -dlopen FILE '-dlpreopen' FILE if it cannot be dlopened at runtime
- -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
- -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
- -export-symbols SYMFILE
- try to export only the symbols listed in SYMFILE
- -export-symbols-regex REGEX
- try to export only the symbols matching REGEX
- -LLIBDIR search LIBDIR for required installed libraries
- -lNAME OUTPUT-FILE requires the installed library libNAME
- -module build a library that can dlopened
- -no-fast-install disable the fast-install mode
- -no-install link a not-installable executable
- -no-undefined declare that a library does not refer to external symbols
- -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
- -objectlist FILE Use a list of object files found in FILE to specify objects
- -precious-files-regex REGEX
- don't remove output files matching REGEX
- -release RELEASE specify package release information
- -rpath LIBDIR the created library will eventually be installed in LIBDIR
- -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
- -shared only do dynamic linking of libtool libraries
- -shrext SUFFIX override the standard shared library file extension
- -static do not do any dynamic linking of uninstalled libtool libraries
- -static-libtool-libs
- do not do any dynamic linking of libtool libraries
- -version-info CURRENT[:REVISION[:AGE]]
- specify library version info [each variable defaults to 0]
- -weak LIBNAME declare that the target provides the LIBNAME interface
- -Wc,FLAG
- -Xcompiler FLAG pass linker-specific FLAG directly to the compiler
- -Wl,FLAG
- -Xlinker FLAG pass linker-specific FLAG directly to the linker
- -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC)
-
-All other options (arguments beginning with '-') are ignored.
-
-Every other argument is treated as a filename. Files ending in '.la' are
-treated as uninstalled libtool libraries, other files are standard or library
-object files.
-
-If the OUTPUT-FILE ends in '.la', then a libtool library is created,
-only library objects ('.lo' files) may be specified, and '-rpath' is
-required, except when creating a convenience library.
-
-If OUTPUT-FILE ends in '.a' or '.lib', then a standard library is created
-using 'ar' and 'ranlib', or on Windows using 'lib'.
-
-If OUTPUT-FILE ends in '.lo' or '.$objext', then a reloadable object file
-is created, otherwise an executable program is created."
- ;;
-
- uninstall)
- $ECHO \
-"Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
-
-Remove libraries from an installation directory.
-
-RM is the name of the program to use to delete files associated with each FILE
-(typically '/bin/rm'). RM-OPTIONS are options (such as '-f') to be passed
-to RM.
-
-If FILE is a libtool library, all the files associated with it are deleted.
-Otherwise, only FILE itself is deleted using RM."
- ;;
-
- *)
- func_fatal_help "invalid operation mode '$opt_mode'"
- ;;
- esac
-
- echo
- $ECHO "Try '$progname --help' for more information about other modes."
-}
-
-# Now that we've collected a possible --mode arg, show help if necessary
-if $opt_help; then
- if test : = "$opt_help"; then
- func_mode_help
- else
- {
- func_help noexit
- for opt_mode in compile link execute install finish uninstall clean; do
- func_mode_help
- done
- } | sed -n '1p; 2,$s/^Usage:/ or: /p'
- {
- func_help noexit
- for opt_mode in compile link execute install finish uninstall clean; do
- echo
- func_mode_help
- done
- } |
- sed '1d
- /^When reporting/,/^Report/{
- H
- d
- }
- $x
- /information about other modes/d
- /more detailed .*MODE/d
- s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/'
- fi
- exit $?
-fi
-
-
-# func_mode_execute arg...
-func_mode_execute ()
-{
- $debug_cmd
-
- # The first argument is the command name.
- cmd=$nonopt
- test -z "$cmd" && \
- func_fatal_help "you must specify a COMMAND"
-
- # Handle -dlopen flags immediately.
- for file in $opt_dlopen; do
- test -f "$file" \
- || func_fatal_help "'$file' is not a file"
-
- dir=
- case $file in
- *.la)
- func_resolve_sysroot "$file"
- file=$func_resolve_sysroot_result
-
- # Check to see that this really is a libtool archive.
- func_lalib_unsafe_p "$file" \
- || func_fatal_help "'$lib' is not a valid libtool archive"
-
- # Read the libtool library.
- dlname=
- library_names=
- func_source "$file"
-
- # Skip this library if it cannot be dlopened.
- if test -z "$dlname"; then
- # Warn if it was a shared library.
- test -n "$library_names" && \
- func_warning "'$file' was not linked with '-export-dynamic'"
- continue
- fi
-
- func_dirname "$file" "" "."
- dir=$func_dirname_result
-
- if test -f "$dir/$objdir/$dlname"; then
- func_append dir "/$objdir"
- else
- if test ! -f "$dir/$dlname"; then
- func_fatal_error "cannot find '$dlname' in '$dir' or '$dir/$objdir'"
- fi
- fi
- ;;
-
- *.lo)
- # Just add the directory containing the .lo file.
- func_dirname "$file" "" "."
- dir=$func_dirname_result
- ;;
-
- *)
- func_warning "'-dlopen' is ignored for non-libtool libraries and objects"
- continue
- ;;
- esac
-
- # Get the absolute pathname.
- absdir=`cd "$dir" && pwd`
- test -n "$absdir" && dir=$absdir
-
- # Now add the directory to shlibpath_var.
- if eval "test -z \"\$$shlibpath_var\""; then
- eval "$shlibpath_var=\"\$dir\""
- else
- eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
- fi
- done
-
- # This variable tells wrapper scripts just to set shlibpath_var
- # rather than running their programs.
- libtool_execute_magic=$magic
-
- # Check if any of the arguments is a wrapper script.
- args=
- for file
- do
- case $file in
- -* | *.la | *.lo ) ;;
- *)
- # Do a test to see if this is really a libtool program.
- if func_ltwrapper_script_p "$file"; then
- func_source "$file"
- # Transform arg to wrapped name.
- file=$progdir/$program
- elif func_ltwrapper_executable_p "$file"; then
- func_ltwrapper_scriptname "$file"
- func_source "$func_ltwrapper_scriptname_result"
- # Transform arg to wrapped name.
- file=$progdir/$program
- fi
- ;;
- esac
- # Quote arguments (to preserve shell metacharacters).
- func_append_quoted args "$file"
- done
-
- if $opt_dry_run; then
- # Display what would be done.
- if test -n "$shlibpath_var"; then
- eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\""
- echo "export $shlibpath_var"
- fi
- $ECHO "$cmd$args"
- exit $EXIT_SUCCESS
- else
- if test -n "$shlibpath_var"; then
- # Export the shlibpath_var.
- eval "export $shlibpath_var"
- fi
-
- # Restore saved environment variables
- for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
- do
- eval "if test \"\${save_$lt_var+set}\" = set; then
- $lt_var=\$save_$lt_var; export $lt_var
- else
- $lt_unset $lt_var
- fi"
- done
-
- # Now prepare to actually exec the command.
- exec_cmd=\$cmd$args
- fi
-}
-
-test execute = "$opt_mode" && func_mode_execute ${1+"$@"}
-
-
-# func_mode_finish arg...
-func_mode_finish ()
-{
- $debug_cmd
-
- libs=
- libdirs=
- admincmds=
-
- for opt in "$nonopt" ${1+"$@"}
- do
- if test -d "$opt"; then
- func_append libdirs " $opt"
-
- elif test -f "$opt"; then
- if func_lalib_unsafe_p "$opt"; then
- func_append libs " $opt"
- else
- func_warning "'$opt' is not a valid libtool archive"
- fi
-
- else
- func_fatal_error "invalid argument '$opt'"
- fi
- done
-
- if test -n "$libs"; then
- if test -n "$lt_sysroot"; then
- sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"`
- sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;"
- else
- sysroot_cmd=
- fi
-
- # Remove sysroot references
- if $opt_dry_run; then
- for lib in $libs; do
- echo "removing references to $lt_sysroot and '=' prefixes from $lib"
- done
- else
- tmpdir=`func_mktempdir`
- for lib in $libs; do
- sed -e "$sysroot_cmd s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \
- > $tmpdir/tmp-la
- mv -f $tmpdir/tmp-la $lib
- done
- ${RM}r "$tmpdir"
- fi
- fi
-
- if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
- for libdir in $libdirs; do
- if test -n "$finish_cmds"; then
- # Do each command in the finish commands.
- func_execute_cmds "$finish_cmds" 'admincmds="$admincmds
-'"$cmd"'"'
- fi
- if test -n "$finish_eval"; then
- # Do the single finish_eval.
- eval cmds=\"$finish_eval\"
- $opt_dry_run || eval "$cmds" || func_append admincmds "
- $cmds"
- fi
- done
- fi
-
- # Exit here if they wanted silent mode.
- $opt_quiet && exit $EXIT_SUCCESS
-
- if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
- echo "----------------------------------------------------------------------"
- echo "Libraries have been installed in:"
- for libdir in $libdirs; do
- $ECHO " $libdir"
- done
- echo
- echo "If you ever happen to want to link against installed libraries"
- echo "in a given directory, LIBDIR, you must either use libtool, and"
- echo "specify the full pathname of the library, or use the '-LLIBDIR'"
- echo "flag during linking and do at least one of the following:"
- if test -n "$shlibpath_var"; then
- echo " - add LIBDIR to the '$shlibpath_var' environment variable"
- echo " during execution"
- fi
- if test -n "$runpath_var"; then
- echo " - add LIBDIR to the '$runpath_var' environment variable"
- echo " during linking"
- fi
- if test -n "$hardcode_libdir_flag_spec"; then
- libdir=LIBDIR
- eval flag=\"$hardcode_libdir_flag_spec\"
-
- $ECHO " - use the '$flag' linker flag"
- fi
- if test -n "$admincmds"; then
- $ECHO " - have your system administrator run these commands:$admincmds"
- fi
- if test -f /etc/ld.so.conf; then
- echo " - have your system administrator add LIBDIR to '/etc/ld.so.conf'"
- fi
- echo
-
- echo "See any operating system documentation about shared libraries for"
- case $host in
- solaris2.[6789]|solaris2.1[0-9])
- echo "more information, such as the ld(1), crle(1) and ld.so(8) manual"
- echo "pages."
- ;;
- *)
- echo "more information, such as the ld(1) and ld.so(8) manual pages."
- ;;
- esac
- echo "----------------------------------------------------------------------"
- fi
- exit $EXIT_SUCCESS
-}
-
-test finish = "$opt_mode" && func_mode_finish ${1+"$@"}
-
-
-# func_mode_install arg...
-func_mode_install ()
-{
- $debug_cmd
-
- # There may be an optional sh(1) argument at the beginning of
- # install_prog (especially on Windows NT).
- if test "$SHELL" = "$nonopt" || test /bin/sh = "$nonopt" ||
- # Allow the use of GNU shtool's install command.
- case $nonopt in *shtool*) :;; *) false;; esac
- then
- # Aesthetically quote it.
- func_quote_for_eval "$nonopt"
- install_prog="$func_quote_for_eval_result "
- arg=$1
- shift
- else
- install_prog=
- arg=$nonopt
- fi
-
- # The real first argument should be the name of the installation program.
- # Aesthetically quote it.
- func_quote_for_eval "$arg"
- func_append install_prog "$func_quote_for_eval_result"
- install_shared_prog=$install_prog
- case " $install_prog " in
- *[\\\ /]cp\ *) install_cp=: ;;
- *) install_cp=false ;;
- esac
-
- # We need to accept at least all the BSD install flags.
- dest=
- files=
- opts=
- prev=
- install_type=
- isdir=false
- stripme=
- no_mode=:
- for arg
- do
- arg2=
- if test -n "$dest"; then
- func_append files " $dest"
- dest=$arg
- continue
- fi
-
- case $arg in
- -d) isdir=: ;;
- -f)
- if $install_cp; then :; else
- prev=$arg
- fi
- ;;
- -g | -m | -o)
- prev=$arg
- ;;
- -s)
- stripme=" -s"
- continue
- ;;
- -*)
- ;;
- *)
- # If the previous option needed an argument, then skip it.
- if test -n "$prev"; then
- if test X-m = "X$prev" && test -n "$install_override_mode"; then
- arg2=$install_override_mode
- no_mode=false
- fi
- prev=
- else
- dest=$arg
- continue
- fi
- ;;
- esac
-
- # Aesthetically quote the argument.
- func_quote_for_eval "$arg"
- func_append install_prog " $func_quote_for_eval_result"
- if test -n "$arg2"; then
- func_quote_for_eval "$arg2"
- fi
- func_append install_shared_prog " $func_quote_for_eval_result"
- done
-
- test -z "$install_prog" && \
- func_fatal_help "you must specify an install program"
-
- test -n "$prev" && \
- func_fatal_help "the '$prev' option requires an argument"
-
- if test -n "$install_override_mode" && $no_mode; then
- if $install_cp; then :; else
- func_quote_for_eval "$install_override_mode"
- func_append install_shared_prog " -m $func_quote_for_eval_result"
- fi
- fi
-
- if test -z "$files"; then
- if test -z "$dest"; then
- func_fatal_help "no file or destination specified"
- else
- func_fatal_help "you must specify a destination"
- fi
- fi
-
- # Strip any trailing slash from the destination.
- func_stripname '' '/' "$dest"
- dest=$func_stripname_result
-
- # Check to see that the destination is a directory.
- test -d "$dest" && isdir=:
- if $isdir; then
- destdir=$dest
- destname=
- else
- func_dirname_and_basename "$dest" "" "."
- destdir=$func_dirname_result
- destname=$func_basename_result
-
- # Not a directory, so check to see that there is only one file specified.
- set dummy $files; shift
- test "$#" -gt 1 && \
- func_fatal_help "'$dest' is not a directory"
- fi
- case $destdir in
- [\\/]* | [A-Za-z]:[\\/]*) ;;
- *)
- for file in $files; do
- case $file in
- *.lo) ;;
- *)
- func_fatal_help "'$destdir' must be an absolute directory name"
- ;;
- esac
- done
- ;;
- esac
-
- # This variable tells wrapper scripts just to set variables rather
- # than running their programs.
- libtool_install_magic=$magic
-
- staticlibs=
- future_libdirs=
- current_libdirs=
- for file in $files; do
-
- # Do each installation.
- case $file in
- *.$libext)
- # Do the static libraries later.
- func_append staticlibs " $file"
- ;;
-
- *.la)
- func_resolve_sysroot "$file"
- file=$func_resolve_sysroot_result
-
- # Check to see that this really is a libtool archive.
- func_lalib_unsafe_p "$file" \
- || func_fatal_help "'$file' is not a valid libtool archive"
-
- library_names=
- old_library=
- relink_command=
- func_source "$file"
-
- # Add the libdir to current_libdirs if it is the destination.
- if test "X$destdir" = "X$libdir"; then
- case "$current_libdirs " in
- *" $libdir "*) ;;
- *) func_append current_libdirs " $libdir" ;;
- esac
- else
- # Note the libdir as a future libdir.
- case "$future_libdirs " in
- *" $libdir "*) ;;
- *) func_append future_libdirs " $libdir" ;;
- esac
- fi
-
- func_dirname "$file" "/" ""
- dir=$func_dirname_result
- func_append dir "$objdir"
-
- if test -n "$relink_command"; then
- # Determine the prefix the user has applied to our future dir.
- inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"`
-
- # Don't allow the user to place us outside of our expected
- # location b/c this prevents finding dependent libraries that
- # are installed to the same prefix.
- # At present, this check doesn't affect windows .dll's that
- # are installed into $libdir/../bin (currently, that works fine)
- # but it's something to keep an eye on.
- test "$inst_prefix_dir" = "$destdir" && \
- func_fatal_error "error: cannot install '$file' to a directory not ending in $libdir"
-
- if test -n "$inst_prefix_dir"; then
- # Stick the inst_prefix_dir data into the link command.
- relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
- else
- relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
- fi
-
- func_warning "relinking '$file'"
- func_show_eval "$relink_command" \
- 'func_fatal_error "error: relink '\''$file'\'' with the above command before installing it"'
- fi
-
- # See the names of the shared library.
- set dummy $library_names; shift
- if test -n "$1"; then
- realname=$1
- shift
-
- srcname=$realname
- test -n "$relink_command" && srcname=${realname}T
-
- # Install the shared library and build the symlinks.
- func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \
- 'exit $?'
- tstripme=$stripme
- case $host_os in
- cygwin* | mingw* | pw32* | cegcc*)
- case $realname in
- *.dll.a)
- tstripme=
- ;;
- esac
- ;;
- esac
- if test -n "$tstripme" && test -n "$striplib"; then
- func_show_eval "$striplib $destdir/$realname" 'exit $?'
- fi
-
- if test "$#" -gt 0; then
- # Delete the old symlinks, and create new ones.
- # Try 'ln -sf' first, because the 'ln' binary might depend on
- # the symlink we replace! Solaris /bin/ln does not understand -f,
- # so we also need to try rm && ln -s.
- for linkname
- do
- test "$linkname" != "$realname" \
- && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })"
- done
- fi
-
- # Do each command in the postinstall commands.
- lib=$destdir/$realname
- func_execute_cmds "$postinstall_cmds" 'exit $?'
- fi
-
- # Install the pseudo-library for information purposes.
- func_basename "$file"
- name=$func_basename_result
- instname=$dir/${name}i
- func_show_eval "$install_prog $instname $destdir/$name" 'exit $?'
-
- # Maybe install the static library, too.
- test -n "$old_library" && func_append staticlibs " $dir/$old_library"
- ;;
-
- *.lo)
- # Install (i.e. copy) a libtool object.
-
- # Figure out destination file name, if it wasn't already specified.
- if test -n "$destname"; then
- destfile=$destdir/$destname
- else
- func_basename "$file"
- destfile=$func_basename_result
- destfile=$destdir/$destfile
- fi
-
- # Deduce the name of the destination old-style object file.
- case $destfile in
- *.lo)
- func_lo2o "$destfile"
- staticdest=$func_lo2o_result
- ;;
- *.$objext)
- staticdest=$destfile
- destfile=
- ;;
- *)
- func_fatal_help "cannot copy a libtool object to '$destfile'"
- ;;
- esac
-
- # Install the libtool object if requested.
- test -n "$destfile" && \
- func_show_eval "$install_prog $file $destfile" 'exit $?'
-
- # Install the old object if enabled.
- if test yes = "$build_old_libs"; then
- # Deduce the name of the old-style object file.
- func_lo2o "$file"
- staticobj=$func_lo2o_result
- func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?'
- fi
- exit $EXIT_SUCCESS
- ;;
-
- *)
- # Figure out destination file name, if it wasn't already specified.
- if test -n "$destname"; then
- destfile=$destdir/$destname
- else
- func_basename "$file"
- destfile=$func_basename_result
- destfile=$destdir/$destfile
- fi
-
- # If the file is missing, and there is a .exe on the end, strip it
- # because it is most likely a libtool script we actually want to
- # install
- stripped_ext=
- case $file in
- *.exe)
- if test ! -f "$file"; then
- func_stripname '' '.exe' "$file"
- file=$func_stripname_result
- stripped_ext=.exe
- fi
- ;;
- esac
-
- # Do a test to see if this is really a libtool program.
- case $host in
- *cygwin* | *mingw*)
- if func_ltwrapper_executable_p "$file"; then
- func_ltwrapper_scriptname "$file"
- wrapper=$func_ltwrapper_scriptname_result
- else
- func_stripname '' '.exe' "$file"
- wrapper=$func_stripname_result
- fi
- ;;
- *)
- wrapper=$file
- ;;
- esac
- if func_ltwrapper_script_p "$wrapper"; then
- notinst_deplibs=
- relink_command=
-
- func_source "$wrapper"
-
- # Check the variables that should have been set.
- test -z "$generated_by_libtool_version" && \
- func_fatal_error "invalid libtool wrapper script '$wrapper'"
-
- finalize=:
- for lib in $notinst_deplibs; do
- # Check to see that each library is installed.
- libdir=
- if test -f "$lib"; then
- func_source "$lib"
- fi
- libfile=$libdir/`$ECHO "$lib" | $SED 's%^.*/%%g'`
- if test -n "$libdir" && test ! -f "$libfile"; then
- func_warning "'$lib' has not been installed in '$libdir'"
- finalize=false
- fi
- done
-
- relink_command=
- func_source "$wrapper"
-
- outputname=
- if test no = "$fast_install" && test -n "$relink_command"; then
- $opt_dry_run || {
- if $finalize; then
- tmpdir=`func_mktempdir`
- func_basename "$file$stripped_ext"
- file=$func_basename_result
- outputname=$tmpdir/$file
- # Replace the output file specification.
- relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'`
-
- $opt_quiet || {
- func_quote_for_expand "$relink_command"
- eval "func_echo $func_quote_for_expand_result"
- }
- if eval "$relink_command"; then :
- else
- func_error "error: relink '$file' with the above command before installing it"
- $opt_dry_run || ${RM}r "$tmpdir"
- continue
- fi
- file=$outputname
- else
- func_warning "cannot relink '$file'"
- fi
- }
- else
- # Install the binary that we compiled earlier.
- file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"`
- fi
- fi
-
- # remove .exe since cygwin /usr/bin/install will append another
- # one anyway
- case $install_prog,$host in
- */usr/bin/install*,*cygwin*)
- case $file:$destfile in
- *.exe:*.exe)
- # this is ok
- ;;
- *.exe:*)
- destfile=$destfile.exe
- ;;
- *:*.exe)
- func_stripname '' '.exe' "$destfile"
- destfile=$func_stripname_result
- ;;
- esac
- ;;
- esac
- func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?'
- $opt_dry_run || if test -n "$outputname"; then
- ${RM}r "$tmpdir"
- fi
- ;;
- esac
- done
-
- for file in $staticlibs; do
- func_basename "$file"
- name=$func_basename_result
-
- # Set up the ranlib parameters.
- oldlib=$destdir/$name
- func_to_tool_file "$oldlib" func_convert_file_msys_to_w32
- tool_oldlib=$func_to_tool_file_result
-
- func_show_eval "$install_prog \$file \$oldlib" 'exit $?'
-
- if test -n "$stripme" && test -n "$old_striplib"; then
- func_show_eval "$old_striplib $tool_oldlib" 'exit $?'
- fi
-
- # Do each command in the postinstall commands.
- func_execute_cmds "$old_postinstall_cmds" 'exit $?'
- done
-
- test -n "$future_libdirs" && \
- func_warning "remember to run '$progname --finish$future_libdirs'"
-
- if test -n "$current_libdirs"; then
- # Maybe just do a dry run.
- $opt_dry_run && current_libdirs=" -n$current_libdirs"
- exec_cmd='$SHELL "$progpath" $preserve_args --finish$current_libdirs'
- else
- exit $EXIT_SUCCESS
- fi
-}
-
-test install = "$opt_mode" && func_mode_install ${1+"$@"}
-
-
-# func_generate_dlsyms outputname originator pic_p
-# Extract symbols from dlprefiles and create ${outputname}S.o with
-# a dlpreopen symbol table.
-func_generate_dlsyms ()
-{
- $debug_cmd
-
- my_outputname=$1
- my_originator=$2
- my_pic_p=${3-false}
- my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'`
- my_dlsyms=
-
- if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then
- if test -n "$NM" && test -n "$global_symbol_pipe"; then
- my_dlsyms=${my_outputname}S.c
- else
- func_error "not configured to extract global symbols from dlpreopened files"
- fi
- fi
-
- if test -n "$my_dlsyms"; then
- case $my_dlsyms in
- "") ;;
- *.c)
- # Discover the nlist of each of the dlfiles.
- nlist=$output_objdir/$my_outputname.nm
-
- func_show_eval "$RM $nlist ${nlist}S ${nlist}T"
-
- # Parse the name list into a source file.
- func_verbose "creating $output_objdir/$my_dlsyms"
-
- $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\
-/* $my_dlsyms - symbol resolution table for '$my_outputname' dlsym emulation. */
-/* Generated by $PROGRAM (GNU $PACKAGE) $VERSION */
-
-#ifdef __cplusplus
-extern \"C\" {
-#endif
-
-#if defined __GNUC__ && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4))
-#pragma GCC diagnostic ignored \"-Wstrict-prototypes\"
-#endif
-
-/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */
-#if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE
-/* DATA imports from DLLs on WIN32 can't be const, because runtime
- relocations are performed -- see ld's documentation on pseudo-relocs. */
-# define LT_DLSYM_CONST
-#elif defined __osf__
-/* This system does not cope well with relocations in const data. */
-# define LT_DLSYM_CONST
-#else
-# define LT_DLSYM_CONST const
-#endif
-
-#define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0)
-
-/* External symbol declarations for the compiler. */\
-"
-
- if test yes = "$dlself"; then
- func_verbose "generating symbol list for '$output'"
-
- $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist"
-
- # Add our own program objects to the symbol list.
- progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP`
- for progfile in $progfiles; do
- func_to_tool_file "$progfile" func_convert_file_msys_to_w32
- func_verbose "extracting global C symbols from '$func_to_tool_file_result'"
- $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'"
- done
-
- if test -n "$exclude_expsyms"; then
- $opt_dry_run || {
- eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
- eval '$MV "$nlist"T "$nlist"'
- }
- fi
-
- if test -n "$export_symbols_regex"; then
- $opt_dry_run || {
- eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
- eval '$MV "$nlist"T "$nlist"'
- }
- fi
-
- # Prepare the list of exported symbols
- if test -z "$export_symbols"; then
- export_symbols=$output_objdir/$outputname.exp
- $opt_dry_run || {
- $RM $export_symbols
- eval "$SED -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
- case $host in
- *cygwin* | *mingw* | *cegcc* )
- eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
- eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
- ;;
- esac
- }
- else
- $opt_dry_run || {
- eval "$SED -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
- eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
- eval '$MV "$nlist"T "$nlist"'
- case $host in
- *cygwin* | *mingw* | *cegcc* )
- eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
- eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
- ;;
- esac
- }
- fi
- fi
-
- for dlprefile in $dlprefiles; do
- func_verbose "extracting global C symbols from '$dlprefile'"
- func_basename "$dlprefile"
- name=$func_basename_result
- case $host in
- *cygwin* | *mingw* | *cegcc* )
- # if an import library, we need to obtain dlname
- if func_win32_import_lib_p "$dlprefile"; then
- func_tr_sh "$dlprefile"
- eval "curr_lafile=\$libfile_$func_tr_sh_result"
- dlprefile_dlbasename=
- if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then
- # Use subshell, to avoid clobbering current variable values
- dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"`
- if test -n "$dlprefile_dlname"; then
- func_basename "$dlprefile_dlname"
- dlprefile_dlbasename=$func_basename_result
- else
- # no lafile. user explicitly requested -dlpreopen <import library>.
- $sharedlib_from_linklib_cmd "$dlprefile"
- dlprefile_dlbasename=$sharedlib_from_linklib_result
- fi
- fi
- $opt_dry_run || {
- if test -n "$dlprefile_dlbasename"; then
- eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"'
- else
- func_warning "Could not compute DLL name from $name"
- eval '$ECHO ": $name " >> "$nlist"'
- fi
- func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
- eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe |
- $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'"
- }
- else # not an import lib
- $opt_dry_run || {
- eval '$ECHO ": $name " >> "$nlist"'
- func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
- eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'"
- }
- fi
- ;;
- *)
- $opt_dry_run || {
- eval '$ECHO ": $name " >> "$nlist"'
- func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
- eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'"
- }
- ;;
- esac
- done
-
- $opt_dry_run || {
- # Make sure we have at least an empty file.
- test -f "$nlist" || : > "$nlist"
-
- if test -n "$exclude_expsyms"; then
- $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
- $MV "$nlist"T "$nlist"
- fi
-
- # Try sorting and uniquifying the output.
- if $GREP -v "^: " < "$nlist" |
- if sort -k 3 </dev/null >/dev/null 2>&1; then
- sort -k 3
- else
- sort +2
- fi |
- uniq > "$nlist"S; then
- :
- else
- $GREP -v "^: " < "$nlist" > "$nlist"S
- fi
-
- if test -f "$nlist"S; then
- eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"'
- else
- echo '/* NONE */' >> "$output_objdir/$my_dlsyms"
- fi
-
- func_show_eval '$RM "${nlist}I"'
- if test -n "$global_symbol_to_import"; then
- eval "$global_symbol_to_import"' < "$nlist"S > "$nlist"I'
- fi
-
- echo >> "$output_objdir/$my_dlsyms" "\
-
-/* The mapping between symbol names and symbols. */
-typedef struct {
- const char *name;
- void *address;
-} lt_dlsymlist;
-extern LT_DLSYM_CONST lt_dlsymlist
-lt_${my_prefix}_LTX_preloaded_symbols[];\
-"
-
- if test -s "$nlist"I; then
- echo >> "$output_objdir/$my_dlsyms" "\
-static void lt_syminit(void)
-{
- LT_DLSYM_CONST lt_dlsymlist *symbol = lt_${my_prefix}_LTX_preloaded_symbols;
- for (; symbol->name; ++symbol)
- {"
- $SED 's/.*/ if (STREQ (symbol->name, \"&\")) symbol->address = (void *) \&&;/' < "$nlist"I >> "$output_objdir/$my_dlsyms"
- echo >> "$output_objdir/$my_dlsyms" "\
- }
-}"
- fi
- echo >> "$output_objdir/$my_dlsyms" "\
-LT_DLSYM_CONST lt_dlsymlist
-lt_${my_prefix}_LTX_preloaded_symbols[] =
-{ {\"$my_originator\", (void *) 0},"
-
- if test -s "$nlist"I; then
- echo >> "$output_objdir/$my_dlsyms" "\
- {\"@INIT@\", (void *) &lt_syminit},"
- fi
-
- case $need_lib_prefix in
- no)
- eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms"
- ;;
- *)
- eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms"
- ;;
- esac
- echo >> "$output_objdir/$my_dlsyms" "\
- {0, (void *) 0}
-};
-
-/* This works around a problem in FreeBSD linker */
-#ifdef FREEBSD_WORKAROUND
-static const void *lt_preloaded_setup() {
- return lt_${my_prefix}_LTX_preloaded_symbols;
-}
-#endif
-
-#ifdef __cplusplus
-}
-#endif\
-"
- } # !$opt_dry_run
-
- pic_flag_for_symtable=
- case "$compile_command " in
- *" -static "*) ;;
- *)
- case $host in
- # compiling the symbol table file with pic_flag works around
- # a FreeBSD bug that causes programs to crash when -lm is
- # linked before any other PIC object. But we must not use
- # pic_flag when linking with -static. The problem exists in
- # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
- *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
- pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;;
- *-*-hpux*)
- pic_flag_for_symtable=" $pic_flag" ;;
- *)
- $my_pic_p && pic_flag_for_symtable=" $pic_flag"
- ;;
- esac
- ;;
- esac
- symtab_cflags=
- for arg in $LTCFLAGS; do
- case $arg in
- -pie | -fpie | -fPIE) ;;
- *) func_append symtab_cflags " $arg" ;;
- esac
- done
-
- # Now compile the dynamic symbol file.
- func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?'
-
- # Clean up the generated files.
- func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T" "${nlist}I"'
-
- # Transform the symbol file into the correct name.
- symfileobj=$output_objdir/${my_outputname}S.$objext
- case $host in
- *cygwin* | *mingw* | *cegcc* )
- if test -f "$output_objdir/$my_outputname.def"; then
- compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
- finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
- else
- compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"`
- finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"`
- fi
- ;;
- *)
- compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"`
- finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"`
- ;;
- esac
- ;;
- *)
- func_fatal_error "unknown suffix for '$my_dlsyms'"
- ;;
- esac
- else
- # We keep going just in case the user didn't refer to
- # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
- # really was required.
-
- # Nullify the symbol file.
- compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"`
- finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"`
- fi
-}
-
-# func_cygming_gnu_implib_p ARG
-# This predicate returns with zero status (TRUE) if
-# ARG is a GNU/binutils-style import library. Returns
-# with nonzero status (FALSE) otherwise.
-func_cygming_gnu_implib_p ()
-{
- $debug_cmd
-
- func_to_tool_file "$1" func_convert_file_msys_to_w32
- func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'`
- test -n "$func_cygming_gnu_implib_tmp"
-}
-
-# func_cygming_ms_implib_p ARG
-# This predicate returns with zero status (TRUE) if
-# ARG is an MS-style import library. Returns
-# with nonzero status (FALSE) otherwise.
-func_cygming_ms_implib_p ()
-{
- $debug_cmd
-
- func_to_tool_file "$1" func_convert_file_msys_to_w32
- func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'`
- test -n "$func_cygming_ms_implib_tmp"
-}
-
-# func_win32_libid arg
-# return the library type of file 'arg'
-#
-# Need a lot of goo to handle *both* DLLs and import libs
-# Has to be a shell function in order to 'eat' the argument
-# that is supplied when $file_magic_command is called.
-# Despite the name, also deal with 64 bit binaries.
-func_win32_libid ()
-{
- $debug_cmd
-
- win32_libid_type=unknown
- win32_fileres=`file -L $1 2>/dev/null`
- case $win32_fileres in
- *ar\ archive\ import\ library*) # definitely import
- win32_libid_type="x86 archive import"
- ;;
- *ar\ archive*) # could be an import, or static
- # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD.
- if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null |
- $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then
- case $nm_interface in
- "MS dumpbin")
- if func_cygming_ms_implib_p "$1" ||
- func_cygming_gnu_implib_p "$1"
- then
- win32_nmres=import
- else
- win32_nmres=
- fi
- ;;
- *)
- func_to_tool_file "$1" func_convert_file_msys_to_w32
- win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" |
- $SED -n -e '
- 1,100{
- / I /{
- s|.*|import|
- p
- q
- }
- }'`
- ;;
- esac
- case $win32_nmres in
- import*) win32_libid_type="x86 archive import";;
- *) win32_libid_type="x86 archive static";;
- esac
- fi
- ;;
- *DLL*)
- win32_libid_type="x86 DLL"
- ;;
- *executable*) # but shell scripts are "executable" too...
- case $win32_fileres in
- *MS\ Windows\ PE\ Intel*)
- win32_libid_type="x86 DLL"
- ;;
- esac
- ;;
- esac
- $ECHO "$win32_libid_type"
-}
-
-# func_cygming_dll_for_implib ARG
-#
-# Platform-specific function to extract the
-# name of the DLL associated with the specified
-# import library ARG.
-# Invoked by eval'ing the libtool variable
-# $sharedlib_from_linklib_cmd
-# Result is available in the variable
-# $sharedlib_from_linklib_result
-func_cygming_dll_for_implib ()
-{
- $debug_cmd
-
- sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"`
-}
-
-# func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs
-#
-# The is the core of a fallback implementation of a
-# platform-specific function to extract the name of the
-# DLL associated with the specified import library LIBNAME.
-#
-# SECTION_NAME is either .idata$6 or .idata$7, depending
-# on the platform and compiler that created the implib.
-#
-# Echos the name of the DLL associated with the
-# specified import library.
-func_cygming_dll_for_implib_fallback_core ()
-{
- $debug_cmd
-
- match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"`
- $OBJDUMP -s --section "$1" "$2" 2>/dev/null |
- $SED '/^Contents of section '"$match_literal"':/{
- # Place marker at beginning of archive member dllname section
- s/.*/====MARK====/
- p
- d
- }
- # These lines can sometimes be longer than 43 characters, but
- # are always uninteresting
- /:[ ]*file format pe[i]\{,1\}-/d
- /^In archive [^:]*:/d
- # Ensure marker is printed
- /^====MARK====/p
- # Remove all lines with less than 43 characters
- /^.\{43\}/!d
- # From remaining lines, remove first 43 characters
- s/^.\{43\}//' |
- $SED -n '
- # Join marker and all lines until next marker into a single line
- /^====MARK====/ b para
- H
- $ b para
- b
- :para
- x
- s/\n//g
- # Remove the marker
- s/^====MARK====//
- # Remove trailing dots and whitespace
- s/[\. \t]*$//
- # Print
- /./p' |
- # we now have a list, one entry per line, of the stringified
- # contents of the appropriate section of all members of the
- # archive that possess that section. Heuristic: eliminate
- # all those that have a first or second character that is
- # a '.' (that is, objdump's representation of an unprintable
- # character.) This should work for all archives with less than
- # 0x302f exports -- but will fail for DLLs whose name actually
- # begins with a literal '.' or a single character followed by
- # a '.'.
- #
- # Of those that remain, print the first one.
- $SED -e '/^\./d;/^.\./d;q'
-}
-
-# func_cygming_dll_for_implib_fallback ARG
-# Platform-specific function to extract the
-# name of the DLL associated with the specified
-# import library ARG.
-#
-# This fallback implementation is for use when $DLLTOOL
-# does not support the --identify-strict option.
-# Invoked by eval'ing the libtool variable
-# $sharedlib_from_linklib_cmd
-# Result is available in the variable
-# $sharedlib_from_linklib_result
-func_cygming_dll_for_implib_fallback ()
-{
- $debug_cmd
-
- if func_cygming_gnu_implib_p "$1"; then
- # binutils import library
- sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"`
- elif func_cygming_ms_implib_p "$1"; then
- # ms-generated import library
- sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"`
- else
- # unknown
- sharedlib_from_linklib_result=
- fi
-}
-
-
-# func_extract_an_archive dir oldlib
-func_extract_an_archive ()
-{
- $debug_cmd
-
- f_ex_an_ar_dir=$1; shift
- f_ex_an_ar_oldlib=$1
- if test yes = "$lock_old_archive_extraction"; then
- lockfile=$f_ex_an_ar_oldlib.lock
- until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
- func_echo "Waiting for $lockfile to be removed"
- sleep 2
- done
- fi
- func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \
- 'stat=$?; rm -f "$lockfile"; exit $stat'
- if test yes = "$lock_old_archive_extraction"; then
- $opt_dry_run || rm -f "$lockfile"
- fi
- if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
- :
- else
- func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib"
- fi
-}
-
-
-# func_extract_archives gentop oldlib ...
-func_extract_archives ()
-{
- $debug_cmd
-
- my_gentop=$1; shift
- my_oldlibs=${1+"$@"}
- my_oldobjs=
- my_xlib=
- my_xabs=
- my_xdir=
-
- for my_xlib in $my_oldlibs; do
- # Extract the objects.
- case $my_xlib in
- [\\/]* | [A-Za-z]:[\\/]*) my_xabs=$my_xlib ;;
- *) my_xabs=`pwd`"/$my_xlib" ;;
- esac
- func_basename "$my_xlib"
- my_xlib=$func_basename_result
- my_xlib_u=$my_xlib
- while :; do
- case " $extracted_archives " in
- *" $my_xlib_u "*)
- func_arith $extracted_serial + 1
- extracted_serial=$func_arith_result
- my_xlib_u=lt$extracted_serial-$my_xlib ;;
- *) break ;;
- esac
- done
- extracted_archives="$extracted_archives $my_xlib_u"
- my_xdir=$my_gentop/$my_xlib_u
-
- func_mkdir_p "$my_xdir"
-
- case $host in
- *-darwin*)
- func_verbose "Extracting $my_xabs"
- # Do not bother doing anything if just a dry run
- $opt_dry_run || {
- darwin_orig_dir=`pwd`
- cd $my_xdir || exit $?
- darwin_archive=$my_xabs
- darwin_curdir=`pwd`
- func_basename "$darwin_archive"
- darwin_base_archive=$func_basename_result
- darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true`
- if test -n "$darwin_arches"; then
- darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'`
- darwin_arch=
- func_verbose "$darwin_base_archive has multiple architectures $darwin_arches"
- for darwin_arch in $darwin_arches; do
- func_mkdir_p "unfat-$$/$darwin_base_archive-$darwin_arch"
- $LIPO -thin $darwin_arch -output "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive" "$darwin_archive"
- cd "unfat-$$/$darwin_base_archive-$darwin_arch"
- func_extract_an_archive "`pwd`" "$darwin_base_archive"
- cd "$darwin_curdir"
- $RM "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive"
- done # $darwin_arches
- ## Okay now we've a bunch of thin objects, gotta fatten them up :)
- darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u`
- darwin_file=
- darwin_files=
- for darwin_file in $darwin_filelist; do
- darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP`
- $LIPO -create -output "$darwin_file" $darwin_files
- done # $darwin_filelist
- $RM -rf unfat-$$
- cd "$darwin_orig_dir"
- else
- cd $darwin_orig_dir
- func_extract_an_archive "$my_xdir" "$my_xabs"
- fi # $darwin_arches
- } # !$opt_dry_run
- ;;
- *)
- func_extract_an_archive "$my_xdir" "$my_xabs"
- ;;
- esac
- my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP`
- done
-
- func_extract_archives_result=$my_oldobjs
-}
-
-
-# func_emit_wrapper [arg=no]
-#
-# Emit a libtool wrapper script on stdout.
-# Don't directly open a file because we may want to
-# incorporate the script contents within a cygwin/mingw
-# wrapper executable. Must ONLY be called from within
-# func_mode_link because it depends on a number of variables
-# set therein.
-#
-# ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR
-# variable will take. If 'yes', then the emitted script
-# will assume that the directory where it is stored is
-# the $objdir directory. This is a cygwin/mingw-specific
-# behavior.
-func_emit_wrapper ()
-{
- func_emit_wrapper_arg1=${1-no}
-
- $ECHO "\
-#! $SHELL
-
-# $output - temporary wrapper script for $objdir/$outputname
-# Generated by $PROGRAM (GNU $PACKAGE) $VERSION
-#
-# The $output program cannot be directly executed until all the libtool
-# libraries that it depends on are installed.
-#
-# This wrapper script should never be moved out of the build directory.
-# If it is, it will not operate correctly.
-
-# Sed substitution that helps us do robust quoting. It backslashifies
-# metacharacters that are still active within double-quoted strings.
-sed_quote_subst='$sed_quote_subst'
-
-# Be Bourne compatible
-if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then
- emulate sh
- NULLCMD=:
- # Zsh 3.x and 4.x performs 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
-BIN_SH=xpg4; export BIN_SH # for Tru64
-DUALCASE=1; export DUALCASE # for MKS sh
-
-# The HP-UX ksh and POSIX shell print the target directory to stdout
-# if CDPATH is set.
-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
-
-relink_command=\"$relink_command\"
-
-# This environment variable determines our operation mode.
-if test \"\$libtool_install_magic\" = \"$magic\"; then
- # install mode needs the following variables:
- generated_by_libtool_version='$macro_version'
- notinst_deplibs='$notinst_deplibs'
-else
- # When we are sourced in execute mode, \$file and \$ECHO are already set.
- if test \"\$libtool_execute_magic\" != \"$magic\"; then
- file=\"\$0\""
-
- qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"`
- $ECHO "\
-
-# A function that is used when there is no print builtin or printf.
-func_fallback_echo ()
-{
- eval 'cat <<_LTECHO_EOF
-\$1
-_LTECHO_EOF'
-}
- ECHO=\"$qECHO\"
- fi
-
-# Very basic option parsing. These options are (a) specific to
-# the libtool wrapper, (b) are identical between the wrapper
-# /script/ and the wrapper /executable/ that is used only on
-# windows platforms, and (c) all begin with the string "--lt-"
-# (application programs are unlikely to have options that match
-# this pattern).
-#
-# There are only two supported options: --lt-debug and
-# --lt-dump-script. There is, deliberately, no --lt-help.
-#
-# The first argument to this parsing function should be the
-# script's $0 value, followed by "$@".
-lt_option_debug=
-func_parse_lt_options ()
-{
- lt_script_arg0=\$0
- shift
- for lt_opt
- do
- case \"\$lt_opt\" in
- --lt-debug) lt_option_debug=1 ;;
- --lt-dump-script)
- lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\`
- test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=.
- lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\`
- cat \"\$lt_dump_D/\$lt_dump_F\"
- exit 0
- ;;
- --lt-*)
- \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2
- exit 1
- ;;
- esac
- done
-
- # Print the debug banner immediately:
- if test -n \"\$lt_option_debug\"; then
- echo \"$outputname:$output:\$LINENO: libtool wrapper (GNU $PACKAGE) $VERSION\" 1>&2
- fi
-}
-
-# Used when --lt-debug. Prints its arguments to stdout
-# (redirection is the responsibility of the caller)
-func_lt_dump_args ()
-{
- lt_dump_args_N=1;
- for lt_arg
- do
- \$ECHO \"$outputname:$output:\$LINENO: newargv[\$lt_dump_args_N]: \$lt_arg\"
- lt_dump_args_N=\`expr \$lt_dump_args_N + 1\`
- done
-}
-
-# Core function for launching the target application
-func_exec_program_core ()
-{
-"
- case $host in
- # Backslashes separate directories on plain windows
- *-*-mingw | *-*-os2* | *-cegcc*)
- $ECHO "\
- if test -n \"\$lt_option_debug\"; then
- \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir\\\\\$program\" 1>&2
- func_lt_dump_args \${1+\"\$@\"} 1>&2
- fi
- exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
-"
- ;;
-
- *)
- $ECHO "\
- if test -n \"\$lt_option_debug\"; then
- \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir/\$program\" 1>&2
- func_lt_dump_args \${1+\"\$@\"} 1>&2
- fi
- exec \"\$progdir/\$program\" \${1+\"\$@\"}
-"
- ;;
- esac
- $ECHO "\
- \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2
- exit 1
-}
-
-# A function to encapsulate launching the target application
-# Strips options in the --lt-* namespace from \$@ and
-# launches target application with the remaining arguments.
-func_exec_program ()
-{
- case \" \$* \" in
- *\\ --lt-*)
- for lt_wr_arg
- do
- case \$lt_wr_arg in
- --lt-*) ;;
- *) set x \"\$@\" \"\$lt_wr_arg\"; shift;;
- esac
- shift
- done ;;
- esac
- func_exec_program_core \${1+\"\$@\"}
-}
-
- # Parse options
- func_parse_lt_options \"\$0\" \${1+\"\$@\"}
-
- # Find the directory that this script lives in.
- thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\`
- test \"x\$thisdir\" = \"x\$file\" && thisdir=.
-
- # Follow symbolic links until we get to the real thisdir.
- file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\`
- while test -n \"\$file\"; do
- destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\`
-
- # If there was a directory component, then change thisdir.
- if test \"x\$destdir\" != \"x\$file\"; then
- case \"\$destdir\" in
- [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
- *) thisdir=\"\$thisdir/\$destdir\" ;;
- esac
- fi
-
- file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\`
- file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\`
- done
-
- # Usually 'no', except on cygwin/mingw when embedded into
- # the cwrapper.
- WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1
- if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then
- # special case for '.'
- if test \"\$thisdir\" = \".\"; then
- thisdir=\`pwd\`
- fi
- # remove .libs from thisdir
- case \"\$thisdir\" in
- *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;;
- $objdir ) thisdir=. ;;
- esac
- fi
-
- # Try to get the absolute directory name.
- absdir=\`cd \"\$thisdir\" && pwd\`
- test -n \"\$absdir\" && thisdir=\"\$absdir\"
-"
-
- if test yes = "$fast_install"; then
- $ECHO "\
- program=lt-'$outputname'$exeext
- progdir=\"\$thisdir/$objdir\"
-
- if test ! -f \"\$progdir/\$program\" ||
- { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | $SED 1q\`; \\
- test \"X\$file\" != \"X\$progdir/\$program\"; }; then
-
- file=\"\$\$-\$program\"
-
- if test ! -d \"\$progdir\"; then
- $MKDIR \"\$progdir\"
- else
- $RM \"\$progdir/\$file\"
- fi"
-
- $ECHO "\
-
- # relink executable if necessary
- if test -n \"\$relink_command\"; then
- if relink_command_output=\`eval \$relink_command 2>&1\`; then :
- else
- $ECHO \"\$relink_command_output\" >&2
- $RM \"\$progdir/\$file\"
- exit 1
- fi
- fi
-
- $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
- { $RM \"\$progdir/\$program\";
- $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; }
- $RM \"\$progdir/\$file\"
- fi"
- else
- $ECHO "\
- program='$outputname'
- progdir=\"\$thisdir/$objdir\"
-"
- fi
-
- $ECHO "\
-
- if test -f \"\$progdir/\$program\"; then"
-
- # fixup the dll searchpath if we need to.
- #
- # Fix the DLL searchpath if we need to. Do this before prepending
- # to shlibpath, because on Windows, both are PATH and uninstalled
- # libraries must come first.
- if test -n "$dllsearchpath"; then
- $ECHO "\
- # Add the dll search path components to the executable PATH
- PATH=$dllsearchpath:\$PATH
-"
- fi
-
- # Export our shlibpath_var if we have one.
- if test yes = "$shlibpath_overrides_runpath" && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
- $ECHO "\
- # Add our own library path to $shlibpath_var
- $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
-
- # Some systems cannot cope with colon-terminated $shlibpath_var
- # The second colon is a workaround for a bug in BeOS R4 sed
- $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\`
-
- export $shlibpath_var
-"
- fi
-
- $ECHO "\
- if test \"\$libtool_execute_magic\" != \"$magic\"; then
- # Run the actual program with our arguments.
- func_exec_program \${1+\"\$@\"}
- fi
- else
- # The program doesn't exist.
- \$ECHO \"\$0: error: '\$progdir/\$program' does not exist\" 1>&2
- \$ECHO \"This script is just a wrapper for \$program.\" 1>&2
- \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2
- exit 1
- fi
-fi\
-"
-}
-
-
-# func_emit_cwrapperexe_src
-# emit the source code for a wrapper executable on stdout
-# Must ONLY be called from within func_mode_link because
-# it depends on a number of variable set therein.
-func_emit_cwrapperexe_src ()
-{
- cat <<EOF
-
-/* $cwrappersource - temporary wrapper executable for $objdir/$outputname
- Generated by $PROGRAM (GNU $PACKAGE) $VERSION
-
- The $output program cannot be directly executed until all the libtool
- libraries that it depends on are installed.
-
- This wrapper executable should never be moved out of the build directory.
- If it is, it will not operate correctly.
-*/
-EOF
- cat <<"EOF"
-#ifdef _MSC_VER
-# define _CRT_SECURE_NO_DEPRECATE 1
-#endif
-#include <stdio.h>
-#include <stdlib.h>
-#ifdef _MSC_VER
-# include <direct.h>
-# include <process.h>
-# include <io.h>
-#else
-# include <unistd.h>
-# include <stdint.h>
-# ifdef __CYGWIN__
-# include <io.h>
-# endif
-#endif
-#include <malloc.h>
-#include <stdarg.h>
-#include <assert.h>
-#include <string.h>
-#include <ctype.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <sys/stat.h>
-
-#define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0)
-
-/* declarations of non-ANSI functions */
-#if defined __MINGW32__
-# ifdef __STRICT_ANSI__
-int _putenv (const char *);
-# endif
-#elif defined __CYGWIN__
-# ifdef __STRICT_ANSI__
-char *realpath (const char *, char *);
-int putenv (char *);
-int setenv (const char *, const char *, int);
-# endif
-/* #elif defined other_platform || defined ... */
-#endif
-
-/* portability defines, excluding path handling macros */
-#if defined _MSC_VER
-# define setmode _setmode
-# define stat _stat
-# define chmod _chmod
-# define getcwd _getcwd
-# define putenv _putenv
-# define S_IXUSR _S_IEXEC
-#elif defined __MINGW32__
-# define setmode _setmode
-# define stat _stat
-# define chmod _chmod
-# define getcwd _getcwd
-# define putenv _putenv
-#elif defined __CYGWIN__
-# define HAVE_SETENV
-# define FOPEN_WB "wb"
-/* #elif defined other platforms ... */
-#endif
-
-#if defined PATH_MAX
-# define LT_PATHMAX PATH_MAX
-#elif defined MAXPATHLEN
-# define LT_PATHMAX MAXPATHLEN
-#else
-# define LT_PATHMAX 1024
-#endif
-
-#ifndef S_IXOTH
-# define S_IXOTH 0
-#endif
-#ifndef S_IXGRP
-# define S_IXGRP 0
-#endif
-
-/* path handling portability macros */
-#ifndef DIR_SEPARATOR
-# define DIR_SEPARATOR '/'
-# define PATH_SEPARATOR ':'
-#endif
-
-#if defined _WIN32 || defined __MSDOS__ || defined __DJGPP__ || \
- defined __OS2__
-# define HAVE_DOS_BASED_FILE_SYSTEM
-# define FOPEN_WB "wb"
-# ifndef DIR_SEPARATOR_2
-# define DIR_SEPARATOR_2 '\\'
-# endif
-# ifndef PATH_SEPARATOR_2
-# define PATH_SEPARATOR_2 ';'
-# endif
-#endif
-
-#ifndef DIR_SEPARATOR_2
-# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
-#else /* DIR_SEPARATOR_2 */
-# define IS_DIR_SEPARATOR(ch) \
- (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
-#endif /* DIR_SEPARATOR_2 */
-
-#ifndef PATH_SEPARATOR_2
-# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR)
-#else /* PATH_SEPARATOR_2 */
-# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
-#endif /* PATH_SEPARATOR_2 */
-
-#ifndef FOPEN_WB
-# define FOPEN_WB "w"
-#endif
-#ifndef _O_BINARY
-# define _O_BINARY 0
-#endif
-
-#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
-#define XFREE(stale) do { \
- if (stale) { free (stale); stale = 0; } \
-} while (0)
-
-#if defined LT_DEBUGWRAPPER
-static int lt_debug = 1;
-#else
-static int lt_debug = 0;
-#endif
-
-const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */
-
-void *xmalloc (size_t num);
-char *xstrdup (const char *string);
-const char *base_name (const char *name);
-char *find_executable (const char *wrapper);
-char *chase_symlinks (const char *pathspec);
-int make_executable (const char *path);
-int check_executable (const char *path);
-char *strendzap (char *str, const char *pat);
-void lt_debugprintf (const char *file, int line, const char *fmt, ...);
-void lt_fatal (const char *file, int line, const char *message, ...);
-static const char *nonnull (const char *s);
-static const char *nonempty (const char *s);
-void lt_setenv (const char *name, const char *value);
-char *lt_extend_str (const char *orig_value, const char *add, int to_end);
-void lt_update_exe_path (const char *name, const char *value);
-void lt_update_lib_path (const char *name, const char *value);
-char **prepare_spawn (char **argv);
-void lt_dump_script (FILE *f);
-EOF
-
- cat <<EOF
-volatile const char * MAGIC_EXE = "$magic_exe";
-const char * LIB_PATH_VARNAME = "$shlibpath_var";
-EOF
-
- if test yes = "$shlibpath_overrides_runpath" && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
- func_to_host_path "$temp_rpath"
- cat <<EOF
-const char * LIB_PATH_VALUE = "$func_to_host_path_result";
-EOF
- else
- cat <<"EOF"
-const char * LIB_PATH_VALUE = "";
-EOF
- fi
-
- if test -n "$dllsearchpath"; then
- func_to_host_path "$dllsearchpath:"
- cat <<EOF
-const char * EXE_PATH_VARNAME = "PATH";
-const char * EXE_PATH_VALUE = "$func_to_host_path_result";
-EOF
- else
- cat <<"EOF"
-const char * EXE_PATH_VARNAME = "";
-const char * EXE_PATH_VALUE = "";
-EOF
- fi
-
- if test yes = "$fast_install"; then
- cat <<EOF
-const char * TARGET_PROGRAM_NAME = "lt-$outputname"; /* hopefully, no .exe */
-EOF
- else
- cat <<EOF
-const char * TARGET_PROGRAM_NAME = "$outputname"; /* hopefully, no .exe */
-EOF
- fi
-
-
- cat <<"EOF"
-
-#define LTWRAPPER_OPTION_PREFIX "--lt-"
-
-static const char *ltwrapper_option_prefix = LTWRAPPER_OPTION_PREFIX;
-static const char *dumpscript_opt = LTWRAPPER_OPTION_PREFIX "dump-script";
-static const char *debug_opt = LTWRAPPER_OPTION_PREFIX "debug";
-
-int
-main (int argc, char *argv[])
-{
- char **newargz;
- int newargc;
- char *tmp_pathspec;
- char *actual_cwrapper_path;
- char *actual_cwrapper_name;
- char *target_name;
- char *lt_argv_zero;
- int rval = 127;
-
- int i;
-
- program_name = (char *) xstrdup (base_name (argv[0]));
- newargz = XMALLOC (char *, (size_t) argc + 1);
-
- /* very simple arg parsing; don't want to rely on getopt
- * also, copy all non cwrapper options to newargz, except
- * argz[0], which is handled differently
- */
- newargc=0;
- for (i = 1; i < argc; i++)
- {
- if (STREQ (argv[i], dumpscript_opt))
- {
-EOF
- case $host in
- *mingw* | *cygwin* )
- # make stdout use "unix" line endings
- echo " setmode(1,_O_BINARY);"
- ;;
- esac
-
- cat <<"EOF"
- lt_dump_script (stdout);
- return 0;
- }
- if (STREQ (argv[i], debug_opt))
- {
- lt_debug = 1;
- continue;
- }
- if (STREQ (argv[i], ltwrapper_option_prefix))
- {
- /* however, if there is an option in the LTWRAPPER_OPTION_PREFIX
- namespace, but it is not one of the ones we know about and
- have already dealt with, above (inluding dump-script), then
- report an error. Otherwise, targets might begin to believe
- they are allowed to use options in the LTWRAPPER_OPTION_PREFIX
- namespace. The first time any user complains about this, we'll
- need to make LTWRAPPER_OPTION_PREFIX a configure-time option
- or a configure.ac-settable value.
- */
- lt_fatal (__FILE__, __LINE__,
- "unrecognized %s option: '%s'",
- ltwrapper_option_prefix, argv[i]);
- }
- /* otherwise ... */
- newargz[++newargc] = xstrdup (argv[i]);
- }
- newargz[++newargc] = NULL;
-
-EOF
- cat <<EOF
- /* The GNU banner must be the first non-error debug message */
- lt_debugprintf (__FILE__, __LINE__, "libtool wrapper (GNU $PACKAGE) $VERSION\n");
-EOF
- cat <<"EOF"
- lt_debugprintf (__FILE__, __LINE__, "(main) argv[0]: %s\n", argv[0]);
- lt_debugprintf (__FILE__, __LINE__, "(main) program_name: %s\n", program_name);
-
- tmp_pathspec = find_executable (argv[0]);
- if (tmp_pathspec == NULL)
- lt_fatal (__FILE__, __LINE__, "couldn't find %s", argv[0]);
- lt_debugprintf (__FILE__, __LINE__,
- "(main) found exe (before symlink chase) at: %s\n",
- tmp_pathspec);
-
- actual_cwrapper_path = chase_symlinks (tmp_pathspec);
- lt_debugprintf (__FILE__, __LINE__,
- "(main) found exe (after symlink chase) at: %s\n",
- actual_cwrapper_path);
- XFREE (tmp_pathspec);
-
- actual_cwrapper_name = xstrdup (base_name (actual_cwrapper_path));
- strendzap (actual_cwrapper_path, actual_cwrapper_name);
-
- /* wrapper name transforms */
- strendzap (actual_cwrapper_name, ".exe");
- tmp_pathspec = lt_extend_str (actual_cwrapper_name, ".exe", 1);
- XFREE (actual_cwrapper_name);
- actual_cwrapper_name = tmp_pathspec;
- tmp_pathspec = 0;
-
- /* target_name transforms -- use actual target program name; might have lt- prefix */
- target_name = xstrdup (base_name (TARGET_PROGRAM_NAME));
- strendzap (target_name, ".exe");
- tmp_pathspec = lt_extend_str (target_name, ".exe", 1);
- XFREE (target_name);
- target_name = tmp_pathspec;
- tmp_pathspec = 0;
-
- lt_debugprintf (__FILE__, __LINE__,
- "(main) libtool target name: %s\n",
- target_name);
-EOF
-
- cat <<EOF
- newargz[0] =
- XMALLOC (char, (strlen (actual_cwrapper_path) +
- strlen ("$objdir") + 1 + strlen (actual_cwrapper_name) + 1));
- strcpy (newargz[0], actual_cwrapper_path);
- strcat (newargz[0], "$objdir");
- strcat (newargz[0], "/");
-EOF
-
- cat <<"EOF"
- /* stop here, and copy so we don't have to do this twice */
- tmp_pathspec = xstrdup (newargz[0]);
-
- /* do NOT want the lt- prefix here, so use actual_cwrapper_name */
- strcat (newargz[0], actual_cwrapper_name);
-
- /* DO want the lt- prefix here if it exists, so use target_name */
- lt_argv_zero = lt_extend_str (tmp_pathspec, target_name, 1);
- XFREE (tmp_pathspec);
- tmp_pathspec = NULL;
-EOF
-
- case $host_os in
- mingw*)
- cat <<"EOF"
- {
- char* p;
- while ((p = strchr (newargz[0], '\\')) != NULL)
- {
- *p = '/';
- }
- while ((p = strchr (lt_argv_zero, '\\')) != NULL)
- {
- *p = '/';
- }
- }
-EOF
- ;;
- esac
-
- cat <<"EOF"
- XFREE (target_name);
- XFREE (actual_cwrapper_path);
- XFREE (actual_cwrapper_name);
-
- lt_setenv ("BIN_SH", "xpg4"); /* for Tru64 */
- lt_setenv ("DUALCASE", "1"); /* for MSK sh */
- /* Update the DLL searchpath. EXE_PATH_VALUE ($dllsearchpath) must
- be prepended before (that is, appear after) LIB_PATH_VALUE ($temp_rpath)
- because on Windows, both *_VARNAMEs are PATH but uninstalled
- libraries must come first. */
- lt_update_exe_path (EXE_PATH_VARNAME, EXE_PATH_VALUE);
- lt_update_lib_path (LIB_PATH_VARNAME, LIB_PATH_VALUE);
-
- lt_debugprintf (__FILE__, __LINE__, "(main) lt_argv_zero: %s\n",
- nonnull (lt_argv_zero));
- for (i = 0; i < newargc; i++)
- {
- lt_debugprintf (__FILE__, __LINE__, "(main) newargz[%d]: %s\n",
- i, nonnull (newargz[i]));
- }
-
-EOF
-
- case $host_os in
- mingw*)
- cat <<"EOF"
- /* execv doesn't actually work on mingw as expected on unix */
- newargz = prepare_spawn (newargz);
- rval = (int) _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz);
- if (rval == -1)
- {
- /* failed to start process */
- lt_debugprintf (__FILE__, __LINE__,
- "(main) failed to launch target \"%s\": %s\n",
- lt_argv_zero, nonnull (strerror (errno)));
- return 127;
- }
- return rval;
-EOF
- ;;
- *)
- cat <<"EOF"
- execv (lt_argv_zero, newargz);
- return rval; /* =127, but avoids unused variable warning */
-EOF
- ;;
- esac
-
- cat <<"EOF"
-}
-
-void *
-xmalloc (size_t num)
-{
- void *p = (void *) malloc (num);
- if (!p)
- lt_fatal (__FILE__, __LINE__, "memory exhausted");
-
- return p;
-}
-
-char *
-xstrdup (const char *string)
-{
- return string ? strcpy ((char *) xmalloc (strlen (string) + 1),
- string) : NULL;
-}
-
-const char *
-base_name (const char *name)
-{
- const char *base;
-
-#if defined HAVE_DOS_BASED_FILE_SYSTEM
- /* Skip over the disk name in MSDOS pathnames. */
- if (isalpha ((unsigned char) name[0]) && name[1] == ':')
- name += 2;
-#endif
-
- for (base = name; *name; name++)
- if (IS_DIR_SEPARATOR (*name))
- base = name + 1;
- return base;
-}
-
-int
-check_executable (const char *path)
-{
- struct stat st;
-
- lt_debugprintf (__FILE__, __LINE__, "(check_executable): %s\n",
- nonempty (path));
- if ((!path) || (!*path))
- return 0;
-
- if ((stat (path, &st) >= 0)
- && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH)))
- return 1;
- else
- return 0;
-}
-
-int
-make_executable (const char *path)
-{
- int rval = 0;
- struct stat st;
-
- lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n",
- nonempty (path));
- if ((!path) || (!*path))
- return 0;
-
- if (stat (path, &st) >= 0)
- {
- rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR);
- }
- return rval;
-}
-
-/* Searches for the full path of the wrapper. Returns
- newly allocated full path name if found, NULL otherwise
- Does not chase symlinks, even on platforms that support them.
-*/
-char *
-find_executable (const char *wrapper)
-{
- int has_slash = 0;
- const char *p;
- const char *p_next;
- /* static buffer for getcwd */
- char tmp[LT_PATHMAX + 1];
- size_t tmp_len;
- char *concat_name;
-
- lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n",
- nonempty (wrapper));
-
- if ((wrapper == NULL) || (*wrapper == '\0'))
- return NULL;
-
- /* Absolute path? */
-#if defined HAVE_DOS_BASED_FILE_SYSTEM
- if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':')
- {
- concat_name = xstrdup (wrapper);
- if (check_executable (concat_name))
- return concat_name;
- XFREE (concat_name);
- }
- else
- {
-#endif
- if (IS_DIR_SEPARATOR (wrapper[0]))
- {
- concat_name = xstrdup (wrapper);
- if (check_executable (concat_name))
- return concat_name;
- XFREE (concat_name);
- }
-#if defined HAVE_DOS_BASED_FILE_SYSTEM
- }
-#endif
-
- for (p = wrapper; *p; p++)
- if (*p == '/')
- {
- has_slash = 1;
- break;
- }
- if (!has_slash)
- {
- /* no slashes; search PATH */
- const char *path = getenv ("PATH");
- if (path != NULL)
- {
- for (p = path; *p; p = p_next)
- {
- const char *q;
- size_t p_len;
- for (q = p; *q; q++)
- if (IS_PATH_SEPARATOR (*q))
- break;
- p_len = (size_t) (q - p);
- p_next = (*q == '\0' ? q : q + 1);
- if (p_len == 0)
- {
- /* empty path: current directory */
- if (getcwd (tmp, LT_PATHMAX) == NULL)
- lt_fatal (__FILE__, __LINE__, "getcwd failed: %s",
- nonnull (strerror (errno)));
- tmp_len = strlen (tmp);
- concat_name =
- XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
- memcpy (concat_name, tmp, tmp_len);
- concat_name[tmp_len] = '/';
- strcpy (concat_name + tmp_len + 1, wrapper);
- }
- else
- {
- concat_name =
- XMALLOC (char, p_len + 1 + strlen (wrapper) + 1);
- memcpy (concat_name, p, p_len);
- concat_name[p_len] = '/';
- strcpy (concat_name + p_len + 1, wrapper);
- }
- if (check_executable (concat_name))
- return concat_name;
- XFREE (concat_name);
- }
- }
- /* not found in PATH; assume curdir */
- }
- /* Relative path | not found in path: prepend cwd */
- if (getcwd (tmp, LT_PATHMAX) == NULL)
- lt_fatal (__FILE__, __LINE__, "getcwd failed: %s",
- nonnull (strerror (errno)));
- tmp_len = strlen (tmp);
- concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
- memcpy (concat_name, tmp, tmp_len);
- concat_name[tmp_len] = '/';
- strcpy (concat_name + tmp_len + 1, wrapper);
-
- if (check_executable (concat_name))
- return concat_name;
- XFREE (concat_name);
- return NULL;
-}
-
-char *
-chase_symlinks (const char *pathspec)
-{
-#ifndef S_ISLNK
- return xstrdup (pathspec);
-#else
- char buf[LT_PATHMAX];
- struct stat s;
- char *tmp_pathspec = xstrdup (pathspec);
- char *p;
- int has_symlinks = 0;
- while (strlen (tmp_pathspec) && !has_symlinks)
- {
- lt_debugprintf (__FILE__, __LINE__,
- "checking path component for symlinks: %s\n",
- tmp_pathspec);
- if (lstat (tmp_pathspec, &s) == 0)
- {
- if (S_ISLNK (s.st_mode) != 0)
- {
- has_symlinks = 1;
- break;
- }
-
- /* search backwards for last DIR_SEPARATOR */
- p = tmp_pathspec + strlen (tmp_pathspec) - 1;
- while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))
- p--;
- if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))
- {
- /* no more DIR_SEPARATORS left */
- break;
- }
- *p = '\0';
- }
- else
- {
- lt_fatal (__FILE__, __LINE__,
- "error accessing file \"%s\": %s",
- tmp_pathspec, nonnull (strerror (errno)));
- }
- }
- XFREE (tmp_pathspec);
-
- if (!has_symlinks)
- {
- return xstrdup (pathspec);
- }
-
- tmp_pathspec = realpath (pathspec, buf);
- if (tmp_pathspec == 0)
- {
- lt_fatal (__FILE__, __LINE__,
- "could not follow symlinks for %s", pathspec);
- }
- return xstrdup (tmp_pathspec);
-#endif
-}
-
-char *
-strendzap (char *str, const char *pat)
-{
- size_t len, patlen;
-
- assert (str != NULL);
- assert (pat != NULL);
-
- len = strlen (str);
- patlen = strlen (pat);
-
- if (patlen <= len)
- {
- str += len - patlen;
- if (STREQ (str, pat))
- *str = '\0';
- }
- return str;
-}
-
-void
-lt_debugprintf (const char *file, int line, const char *fmt, ...)
-{
- va_list args;
- if (lt_debug)
- {
- (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line);
- va_start (args, fmt);
- (void) vfprintf (stderr, fmt, args);
- va_end (args);
- }
-}
-
-static void
-lt_error_core (int exit_status, const char *file,
- int line, const char *mode,
- const char *message, va_list ap)
-{
- fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode);
- vfprintf (stderr, message, ap);
- fprintf (stderr, ".\n");
-
- if (exit_status >= 0)
- exit (exit_status);
-}
-
-void
-lt_fatal (const char *file, int line, const char *message, ...)
-{
- va_list ap;
- va_start (ap, message);
- lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap);
- va_end (ap);
-}
-
-static const char *
-nonnull (const char *s)
-{
- return s ? s : "(null)";
-}
-
-static const char *
-nonempty (const char *s)
-{
- return (s && !*s) ? "(empty)" : nonnull (s);
-}
-
-void
-lt_setenv (const char *name, const char *value)
-{
- lt_debugprintf (__FILE__, __LINE__,
- "(lt_setenv) setting '%s' to '%s'\n",
- nonnull (name), nonnull (value));
- {
-#ifdef HAVE_SETENV
- /* always make a copy, for consistency with !HAVE_SETENV */
- char *str = xstrdup (value);
- setenv (name, str, 1);
-#else
- size_t len = strlen (name) + 1 + strlen (value) + 1;
- char *str = XMALLOC (char, len);
- sprintf (str, "%s=%s", name, value);
- if (putenv (str) != EXIT_SUCCESS)
- {
- XFREE (str);
- }
-#endif
- }
-}
-
-char *
-lt_extend_str (const char *orig_value, const char *add, int to_end)
-{
- char *new_value;
- if (orig_value && *orig_value)
- {
- size_t orig_value_len = strlen (orig_value);
- size_t add_len = strlen (add);
- new_value = XMALLOC (char, add_len + orig_value_len + 1);
- if (to_end)
- {
- strcpy (new_value, orig_value);
- strcpy (new_value + orig_value_len, add);
- }
- else
- {
- strcpy (new_value, add);
- strcpy (new_value + add_len, orig_value);
- }
- }
- else
- {
- new_value = xstrdup (add);
- }
- return new_value;
-}
-
-void
-lt_update_exe_path (const char *name, const char *value)
-{
- lt_debugprintf (__FILE__, __LINE__,
- "(lt_update_exe_path) modifying '%s' by prepending '%s'\n",
- nonnull (name), nonnull (value));
-
- if (name && *name && value && *value)
- {
- char *new_value = lt_extend_str (getenv (name), value, 0);
- /* some systems can't cope with a ':'-terminated path #' */
- size_t len = strlen (new_value);
- while ((len > 0) && IS_PATH_SEPARATOR (new_value[len-1]))
- {
- new_value[--len] = '\0';
- }
- lt_setenv (name, new_value);
- XFREE (new_value);
- }
-}
-
-void
-lt_update_lib_path (const char *name, const char *value)
-{
- lt_debugprintf (__FILE__, __LINE__,
- "(lt_update_lib_path) modifying '%s' by prepending '%s'\n",
- nonnull (name), nonnull (value));
-
- if (name && *name && value && *value)
- {
- char *new_value = lt_extend_str (getenv (name), value, 0);
- lt_setenv (name, new_value);
- XFREE (new_value);
- }
-}
-
-EOF
- case $host_os in
- mingw*)
- cat <<"EOF"
-
-/* Prepares an argument vector before calling spawn().
- Note that spawn() does not by itself call the command interpreter
- (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") :
- ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
- GetVersionEx(&v);
- v.dwPlatformId == VER_PLATFORM_WIN32_NT;
- }) ? "cmd.exe" : "command.com").
- Instead it simply concatenates the arguments, separated by ' ', and calls
- CreateProcess(). We must quote the arguments since Win32 CreateProcess()
- interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a
- special way:
- - Space and tab are interpreted as delimiters. They are not treated as
- delimiters if they are surrounded by double quotes: "...".
- - Unescaped double quotes are removed from the input. Their only effect is
- that within double quotes, space and tab are treated like normal
- characters.
- - Backslashes not followed by double quotes are not special.
- - But 2*n+1 backslashes followed by a double quote become
- n backslashes followed by a double quote (n >= 0):
- \" -> "
- \\\" -> \"
- \\\\\" -> \\"
- */
-#define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037"
-#define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037"
-char **
-prepare_spawn (char **argv)
-{
- size_t argc;
- char **new_argv;
- size_t i;
-
- /* Count number of arguments. */
- for (argc = 0; argv[argc] != NULL; argc++)
- ;
-
- /* Allocate new argument vector. */
- new_argv = XMALLOC (char *, argc + 1);
-
- /* Put quoted arguments into the new argument vector. */
- for (i = 0; i < argc; i++)
- {
- const char *string = argv[i];
-
- if (string[0] == '\0')
- new_argv[i] = xstrdup ("\"\"");
- else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL)
- {
- int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL);
- size_t length;
- unsigned int backslashes;
- const char *s;
- char *quoted_string;
- char *p;
-
- length = 0;
- backslashes = 0;
- if (quote_around)
- length++;
- for (s = string; *s != '\0'; s++)
- {
- char c = *s;
- if (c == '"')
- length += backslashes + 1;
- length++;
- if (c == '\\')
- backslashes++;
- else
- backslashes = 0;
- }
- if (quote_around)
- length += backslashes + 1;
-
- quoted_string = XMALLOC (char, length + 1);
-
- p = quoted_string;
- backslashes = 0;
- if (quote_around)
- *p++ = '"';
- for (s = string; *s != '\0'; s++)
- {
- char c = *s;
- if (c == '"')
- {
- unsigned int j;
- for (j = backslashes + 1; j > 0; j--)
- *p++ = '\\';
- }
- *p++ = c;
- if (c == '\\')
- backslashes++;
- else
- backslashes = 0;
- }
- if (quote_around)
- {
- unsigned int j;
- for (j = backslashes; j > 0; j--)
- *p++ = '\\';
- *p++ = '"';
- }
- *p = '\0';
-
- new_argv[i] = quoted_string;
- }
- else
- new_argv[i] = (char *) string;
- }
- new_argv[argc] = NULL;
-
- return new_argv;
-}
-EOF
- ;;
- esac
-
- cat <<"EOF"
-void lt_dump_script (FILE* f)
-{
-EOF
- func_emit_wrapper yes |
- $SED -n -e '
-s/^\(.\{79\}\)\(..*\)/\1\
-\2/
-h
-s/\([\\"]\)/\\\1/g
-s/$/\\n/
-s/\([^\n]*\).*/ fputs ("\1", f);/p
-g
-D'
- cat <<"EOF"
-}
-EOF
-}
-# end: func_emit_cwrapperexe_src
-
-# func_win32_import_lib_p ARG
-# True if ARG is an import lib, as indicated by $file_magic_cmd
-func_win32_import_lib_p ()
-{
- $debug_cmd
-
- case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in
- *import*) : ;;
- *) false ;;
- esac
-}
-
-# func_mode_link arg...
-func_mode_link ()
-{
- $debug_cmd
-
- case $host in
- *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
- # It is impossible to link a dll without this setting, and
- # we shouldn't force the makefile maintainer to figure out
- # what system we are compiling for in order to pass an extra
- # flag for every libtool invocation.
- # allow_undefined=no
-
- # FIXME: Unfortunately, there are problems with the above when trying
- # to make a dll that has undefined symbols, in which case not
- # even a static library is built. For now, we need to specify
- # -no-undefined on the libtool link line when we can be certain
- # that all symbols are satisfied, otherwise we get a static library.
- allow_undefined=yes
- ;;
- *)
- allow_undefined=yes
- ;;
- esac
- libtool_args=$nonopt
- base_compile="$nonopt $@"
- compile_command=$nonopt
- finalize_command=$nonopt
-
- compile_rpath=
- finalize_rpath=
- compile_shlibpath=
- finalize_shlibpath=
- convenience=
- old_convenience=
- deplibs=
- old_deplibs=
- compiler_flags=
- linker_flags=
- dllsearchpath=
- lib_search_path=`pwd`
- inst_prefix_dir=
- new_inherited_linker_flags=
-
- avoid_version=no
- bindir=
- dlfiles=
- dlprefiles=
- dlself=no
- export_dynamic=no
- export_symbols=
- export_symbols_regex=
- generated=
- libobjs=
- ltlibs=
- module=no
- no_install=no
- objs=
- non_pic_objects=
- precious_files_regex=
- prefer_static_libs=no
- preload=false
- prev=
- prevarg=
- release=
- rpath=
- xrpath=
- perm_rpath=
- temp_rpath=
- thread_safe=no
- vinfo=
- vinfo_number=no
- weak_libs=
- single_module=$wl-single_module
- func_infer_tag $base_compile
-
- # We need to know -static, to get the right output filenames.
- for arg
- do
- case $arg in
- -shared)
- test yes != "$build_libtool_libs" \
- && func_fatal_configuration "cannot build a shared library"
- build_old_libs=no
- break
- ;;
- -all-static | -static | -static-libtool-libs)
- case $arg in
- -all-static)
- if test yes = "$build_libtool_libs" && test -z "$link_static_flag"; then
- func_warning "complete static linking is impossible in this configuration"
- fi
- if test -n "$link_static_flag"; then
- dlopen_self=$dlopen_self_static
- fi
- prefer_static_libs=yes
- ;;
- -static)
- if test -z "$pic_flag" && test -n "$link_static_flag"; then
- dlopen_self=$dlopen_self_static
- fi
- prefer_static_libs=built
- ;;
- -static-libtool-libs)
- if test -z "$pic_flag" && test -n "$link_static_flag"; then
- dlopen_self=$dlopen_self_static
- fi
- prefer_static_libs=yes
- ;;
- esac
- build_libtool_libs=no
- build_old_libs=yes
- break
- ;;
- esac
- done
-
- # See if our shared archives depend on static archives.
- test -n "$old_archive_from_new_cmds" && build_old_libs=yes
-
- # Go through the arguments, transforming them on the way.
- while test "$#" -gt 0; do
- arg=$1
- shift
- func_quote_for_eval "$arg"
- qarg=$func_quote_for_eval_unquoted_result
- func_append libtool_args " $func_quote_for_eval_result"
-
- # If the previous option needs an argument, assign it.
- if test -n "$prev"; then
- case $prev in
- output)
- func_append compile_command " @OUTPUT@"
- func_append finalize_command " @OUTPUT@"
- ;;
- esac
-
- case $prev in
- bindir)
- bindir=$arg
- prev=
- continue
- ;;
- dlfiles|dlprefiles)
- $preload || {
- # Add the symbol object into the linking commands.
- func_append compile_command " @SYMFILE@"
- func_append finalize_command " @SYMFILE@"
- preload=:
- }
- case $arg in
- *.la | *.lo) ;; # We handle these cases below.
- force)
- if test no = "$dlself"; then
- dlself=needless
- export_dynamic=yes
- fi
- prev=
- continue
- ;;
- self)
- if test dlprefiles = "$prev"; then
- dlself=yes
- elif test dlfiles = "$prev" && test yes != "$dlopen_self"; then
- dlself=yes
- else
- dlself=needless
- export_dynamic=yes
- fi
- prev=
- continue
- ;;
- *)
- if test dlfiles = "$prev"; then
- func_append dlfiles " $arg"
- else
- func_append dlprefiles " $arg"
- fi
- prev=
- continue
- ;;
- esac
- ;;
- expsyms)
- export_symbols=$arg
- test -f "$arg" \
- || func_fatal_error "symbol file '$arg' does not exist"
- prev=
- continue
- ;;
- expsyms_regex)
- export_symbols_regex=$arg
- prev=
- continue
- ;;
- framework)
- case $host in
- *-*-darwin*)
- case "$deplibs " in
- *" $qarg.ltframework "*) ;;
- *) func_append deplibs " $qarg.ltframework" # this is fixed later
- ;;
- esac
- ;;
- esac
- prev=
- continue
- ;;
- inst_prefix)
- inst_prefix_dir=$arg
- prev=
- continue
- ;;
- mllvm)
- # Clang does not use LLVM to link, so we can simply discard any
- # '-mllvm $arg' options when doing the link step.
- prev=
- continue
- ;;
- objectlist)
- if test -f "$arg"; then
- save_arg=$arg
- moreargs=
- for fil in `cat "$save_arg"`
- do
-# func_append moreargs " $fil"
- arg=$fil
- # A libtool-controlled object.
-
- # Check to see that this really is a libtool object.
- if func_lalib_unsafe_p "$arg"; then
- pic_object=
- non_pic_object=
-
- # Read the .lo file
- func_source "$arg"
-
- if test -z "$pic_object" ||
- test -z "$non_pic_object" ||
- test none = "$pic_object" &&
- test none = "$non_pic_object"; then
- func_fatal_error "cannot find name of object for '$arg'"
- fi
-
- # Extract subdirectory from the argument.
- func_dirname "$arg" "/" ""
- xdir=$func_dirname_result
-
- if test none != "$pic_object"; then
- # Prepend the subdirectory the object is found in.
- pic_object=$xdir$pic_object
-
- if test dlfiles = "$prev"; then
- if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then
- func_append dlfiles " $pic_object"
- prev=
- continue
- else
- # If libtool objects are unsupported, then we need to preload.
- prev=dlprefiles
- fi
- fi
-
- # CHECK ME: I think I busted this. -Ossama
- if test dlprefiles = "$prev"; then
- # Preload the old-style object.
- func_append dlprefiles " $pic_object"
- prev=
- fi
-
- # A PIC object.
- func_append libobjs " $pic_object"
- arg=$pic_object
- fi
-
- # Non-PIC object.
- if test none != "$non_pic_object"; then
- # Prepend the subdirectory the object is found in.
- non_pic_object=$xdir$non_pic_object
-
- # A standard non-PIC object
- func_append non_pic_objects " $non_pic_object"
- if test -z "$pic_object" || test none = "$pic_object"; then
- arg=$non_pic_object
- fi
- else
- # If the PIC object exists, use it instead.
- # $xdir was prepended to $pic_object above.
- non_pic_object=$pic_object
- func_append non_pic_objects " $non_pic_object"
- fi
- else
- # Only an error if not doing a dry-run.
- if $opt_dry_run; then
- # Extract subdirectory from the argument.
- func_dirname "$arg" "/" ""
- xdir=$func_dirname_result
-
- func_lo2o "$arg"
- pic_object=$xdir$objdir/$func_lo2o_result
- non_pic_object=$xdir$func_lo2o_result
- func_append libobjs " $pic_object"
- func_append non_pic_objects " $non_pic_object"
- else
- func_fatal_error "'$arg' is not a valid libtool object"
- fi
- fi
- done
- else
- func_fatal_error "link input file '$arg' does not exist"
- fi
- arg=$save_arg
- prev=
- continue
- ;;
- precious_regex)
- precious_files_regex=$arg
- prev=
- continue
- ;;
- release)
- release=-$arg
- prev=
- continue
- ;;
- rpath | xrpath)
- # We need an absolute path.
- case $arg in
- [\\/]* | [A-Za-z]:[\\/]*) ;;
- *)
- func_fatal_error "only absolute run-paths are allowed"
- ;;
- esac
- if test rpath = "$prev"; then
- case "$rpath " in
- *" $arg "*) ;;
- *) func_append rpath " $arg" ;;
- esac
- else
- case "$xrpath " in
- *" $arg "*) ;;
- *) func_append xrpath " $arg" ;;
- esac
- fi
- prev=
- continue
- ;;
- shrext)
- shrext_cmds=$arg
- prev=
- continue
- ;;
- weak)
- func_append weak_libs " $arg"
- prev=
- continue
- ;;
- xcclinker)
- func_append linker_flags " $qarg"
- func_append compiler_flags " $qarg"
- prev=
- func_append compile_command " $qarg"
- func_append finalize_command " $qarg"
- continue
- ;;
- xcompiler)
- func_append compiler_flags " $qarg"
- prev=
- func_append compile_command " $qarg"
- func_append finalize_command " $qarg"
- continue
- ;;
- xlinker)
- func_append linker_flags " $qarg"
- func_append compiler_flags " $wl$qarg"
- prev=
- func_append compile_command " $wl$qarg"
- func_append finalize_command " $wl$qarg"
- continue
- ;;
- *)
- eval "$prev=\"\$arg\""
- prev=
- continue
- ;;
- esac
- fi # test -n "$prev"
-
- prevarg=$arg
-
- case $arg in
- -all-static)
- if test -n "$link_static_flag"; then
- # See comment for -static flag below, for more details.
- func_append compile_command " $link_static_flag"
- func_append finalize_command " $link_static_flag"
- fi
- continue
- ;;
-
- -allow-undefined)
- # FIXME: remove this flag sometime in the future.
- func_fatal_error "'-allow-undefined' must not be used because it is the default"
- ;;
-
- -avoid-version)
- avoid_version=yes
- continue
- ;;
-
- -bindir)
- prev=bindir
- continue
- ;;
-
- -dlopen)
- prev=dlfiles
- continue
- ;;
-
- -dlpreopen)
- prev=dlprefiles
- continue
- ;;
-
- -export-dynamic)
- export_dynamic=yes
- continue
- ;;
-
- -export-symbols | -export-symbols-regex)
- if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
- func_fatal_error "more than one -exported-symbols argument is not allowed"
- fi
- if test X-export-symbols = "X$arg"; then
- prev=expsyms
- else
- prev=expsyms_regex
- fi
- continue
- ;;
-
- -framework)
- prev=framework
- continue
- ;;
-
- -inst-prefix-dir)
- prev=inst_prefix
- continue
- ;;
-
- # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
- # so, if we see these flags be careful not to treat them like -L
- -L[A-Z][A-Z]*:*)
- case $with_gcc/$host in
- no/*-*-irix* | /*-*-irix*)
- func_append compile_command " $arg"
- func_append finalize_command " $arg"
- ;;
- esac
- continue
- ;;
-
- -L*)
- func_stripname "-L" '' "$arg"
- if test -z "$func_stripname_result"; then
- if test "$#" -gt 0; then
- func_fatal_error "require no space between '-L' and '$1'"
- else
- func_fatal_error "need path for '-L' option"
- fi
- fi
- func_resolve_sysroot "$func_stripname_result"
- dir=$func_resolve_sysroot_result
- # We need an absolute path.
- case $dir in
- [\\/]* | [A-Za-z]:[\\/]*) ;;
- *)
- absdir=`cd "$dir" && pwd`
- test -z "$absdir" && \
- func_fatal_error "cannot determine absolute directory name of '$dir'"
- dir=$absdir
- ;;
- esac
- case "$deplibs " in
- *" -L$dir "* | *" $arg "*)
- # Will only happen for absolute or sysroot arguments
- ;;
- *)
- # Preserve sysroot, but never include relative directories
- case $dir in
- [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;;
- *) func_append deplibs " -L$dir" ;;
- esac
- func_append lib_search_path " $dir"
- ;;
- esac
- case $host in
- *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
- testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'`
- case :$dllsearchpath: in
- *":$dir:"*) ;;
- ::) dllsearchpath=$dir;;
- *) func_append dllsearchpath ":$dir";;
- esac
- case :$dllsearchpath: in
- *":$testbindir:"*) ;;
- ::) dllsearchpath=$testbindir;;
- *) func_append dllsearchpath ":$testbindir";;
- esac
- ;;
- esac
- continue
- ;;
-
- -l*)
- if test X-lc = "X$arg" || test X-lm = "X$arg"; then
- case $host in
- *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*)
- # These systems don't actually have a C or math library (as such)
- continue
- ;;
- *-*-os2*)
- # These systems don't actually have a C library (as such)
- test X-lc = "X$arg" && continue
- ;;
- *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*)
- # Do not include libc due to us having libc/libc_r.
- test X-lc = "X$arg" && continue
- ;;
- *-*-rhapsody* | *-*-darwin1.[012])
- # Rhapsody C and math libraries are in the System framework
- func_append deplibs " System.ltframework"
- continue
- ;;
- *-*-sco3.2v5* | *-*-sco5v6*)
- # Causes problems with __ctype
- test X-lc = "X$arg" && continue
- ;;
- *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
- # Compiler inserts libc in the correct place for threads to work
- test X-lc = "X$arg" && continue
- ;;
- esac
- elif test X-lc_r = "X$arg"; then
- case $host in
- *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*)
- # Do not include libc_r directly, use -pthread flag.
- continue
- ;;
- esac
- fi
- func_append deplibs " $arg"
- continue
- ;;
-
- -mllvm)
- prev=mllvm
- continue
- ;;
-
- -module)
- module=yes
- continue
- ;;
-
- # Tru64 UNIX uses -model [arg] to determine the layout of C++
- # classes, name mangling, and exception handling.
- # Darwin uses the -arch flag to determine output architecture.
- -model|-arch|-isysroot|--sysroot)
- func_append compiler_flags " $arg"
- func_append compile_command " $arg"
- func_append finalize_command " $arg"
- prev=xcompiler
- continue
- ;;
-
- -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \
- |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
- func_append compiler_flags " $arg"
- func_append compile_command " $arg"
- func_append finalize_command " $arg"
- case "$new_inherited_linker_flags " in
- *" $arg "*) ;;
- * ) func_append new_inherited_linker_flags " $arg" ;;
- esac
- continue
- ;;
-
- -multi_module)
- single_module=$wl-multi_module
- continue
- ;;
-
- -no-fast-install)
- fast_install=no
- continue
- ;;
-
- -no-install)
- case $host in
- *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*)
- # The PATH hackery in wrapper scripts is required on Windows
- # and Darwin in order for the loader to find any dlls it needs.
- func_warning "'-no-install' is ignored for $host"
- func_warning "assuming '-no-fast-install' instead"
- fast_install=no
- ;;
- *) no_install=yes ;;
- esac
- continue
- ;;
-
- -no-undefined)
- allow_undefined=no
- continue
- ;;
-
- -objectlist)
- prev=objectlist
- continue
- ;;
-
- -o) prev=output ;;
-
- -precious-files-regex)
- prev=precious_regex
- continue
- ;;
-
- -release)
- prev=release
- continue
- ;;
-
- -rpath)
- prev=rpath
- continue
- ;;
-
- -R)
- prev=xrpath
- continue
- ;;
-
- -R*)
- func_stripname '-R' '' "$arg"
- dir=$func_stripname_result
- # We need an absolute path.
- case $dir in
- [\\/]* | [A-Za-z]:[\\/]*) ;;
- =*)
- func_stripname '=' '' "$dir"
- dir=$lt_sysroot$func_stripname_result
- ;;
- *)
- func_fatal_error "only absolute run-paths are allowed"
- ;;
- esac
- case "$xrpath " in
- *" $dir "*) ;;
- *) func_append xrpath " $dir" ;;
- esac
- continue
- ;;
-
- -shared)
- # The effects of -shared are defined in a previous loop.
- continue
- ;;
-
- -shrext)
- prev=shrext
- continue
- ;;
-
- -static | -static-libtool-libs)
- # The effects of -static are defined in a previous loop.
- # We used to do the same as -all-static on platforms that
- # didn't have a PIC flag, but the assumption that the effects
- # would be equivalent was wrong. It would break on at least
- # Digital Unix and AIX.
- continue
- ;;
-
- -thread-safe)
- thread_safe=yes
- continue
- ;;
-
- -version-info)
- prev=vinfo
- continue
- ;;
-
- -version-number)
- prev=vinfo
- vinfo_number=yes
- continue
- ;;
-
- -weak)
- prev=weak
- continue
- ;;
-
- -Wc,*)
- func_stripname '-Wc,' '' "$arg"
- args=$func_stripname_result
- arg=
- save_ifs=$IFS; IFS=,
- for flag in $args; do
- IFS=$save_ifs
- func_quote_for_eval "$flag"
- func_append arg " $func_quote_for_eval_result"
- func_append compiler_flags " $func_quote_for_eval_result"
- done
- IFS=$save_ifs
- func_stripname ' ' '' "$arg"
- arg=$func_stripname_result
- ;;
-
- -Wl,*)
- func_stripname '-Wl,' '' "$arg"
- args=$func_stripname_result
- arg=
- save_ifs=$IFS; IFS=,
- for flag in $args; do
- IFS=$save_ifs
- func_quote_for_eval "$flag"
- func_append arg " $wl$func_quote_for_eval_result"
- func_append compiler_flags " $wl$func_quote_for_eval_result"
- func_append linker_flags " $func_quote_for_eval_result"
- done
- IFS=$save_ifs
- func_stripname ' ' '' "$arg"
- arg=$func_stripname_result
- ;;
-
- -Xcompiler)
- prev=xcompiler
- continue
- ;;
-
- -Xlinker)
- prev=xlinker
- continue
- ;;
-
- -XCClinker)
- prev=xcclinker
- continue
- ;;
-
- # -msg_* for osf cc
- -msg_*)
- func_quote_for_eval "$arg"
- arg=$func_quote_for_eval_result
- ;;
-
- # Flags to be passed through unchanged, with rationale:
- # -64, -mips[0-9] enable 64-bit mode for the SGI compiler
- # -r[0-9][0-9]* specify processor for the SGI compiler
- # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler
- # +DA*, +DD* enable 64-bit mode for the HP compiler
- # -q* compiler args for the IBM compiler
- # -m*, -t[45]*, -txscale* architecture-specific flags for GCC
- # -F/path path to uninstalled frameworks, gcc on darwin
- # -p, -pg, --coverage, -fprofile-* profiling flags for GCC
- # @file GCC response files
- # -tp=* Portland pgcc target processor selection
- # --sysroot=* for sysroot support
- # -O*, -g*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization
- # -stdlib=* select c++ std lib with clang
- -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
- -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \
- -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-stdlib=*)
- func_quote_for_eval "$arg"
- arg=$func_quote_for_eval_result
- func_append compile_command " $arg"
- func_append finalize_command " $arg"
- func_append compiler_flags " $arg"
- continue
- ;;
-
- # Some other compiler flag.
- -* | +*)
- func_quote_for_eval "$arg"
- arg=$func_quote_for_eval_result
- ;;
-
- *.$objext)
- # A standard object.
- func_append objs " $arg"
- ;;
-
- *.lo)
- # A libtool-controlled object.
-
- # Check to see that this really is a libtool object.
- if func_lalib_unsafe_p "$arg"; then
- pic_object=
- non_pic_object=
-
- # Read the .lo file
- func_source "$arg"
-
- if test -z "$pic_object" ||
- test -z "$non_pic_object" ||
- test none = "$pic_object" &&
- test none = "$non_pic_object"; then
- func_fatal_error "cannot find name of object for '$arg'"
- fi
-
- # Extract subdirectory from the argument.
- func_dirname "$arg" "/" ""
- xdir=$func_dirname_result
-
- test none = "$pic_object" || {
- # Prepend the subdirectory the object is found in.
- pic_object=$xdir$pic_object
-
- if test dlfiles = "$prev"; then
- if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then
- func_append dlfiles " $pic_object"
- prev=
- continue
- else
- # If libtool objects are unsupported, then we need to preload.
- prev=dlprefiles
- fi
- fi
-
- # CHECK ME: I think I busted this. -Ossama
- if test dlprefiles = "$prev"; then
- # Preload the old-style object.
- func_append dlprefiles " $pic_object"
- prev=
- fi
-
- # A PIC object.
- func_append libobjs " $pic_object"
- arg=$pic_object
- }
-
- # Non-PIC object.
- if test none != "$non_pic_object"; then
- # Prepend the subdirectory the object is found in.
- non_pic_object=$xdir$non_pic_object
-
- # A standard non-PIC object
- func_append non_pic_objects " $non_pic_object"
- if test -z "$pic_object" || test none = "$pic_object"; then
- arg=$non_pic_object
- fi
- else
- # If the PIC object exists, use it instead.
- # $xdir was prepended to $pic_object above.
- non_pic_object=$pic_object
- func_append non_pic_objects " $non_pic_object"
- fi
- else
- # Only an error if not doing a dry-run.
- if $opt_dry_run; then
- # Extract subdirectory from the argument.
- func_dirname "$arg" "/" ""
- xdir=$func_dirname_result
-
- func_lo2o "$arg"
- pic_object=$xdir$objdir/$func_lo2o_result
- non_pic_object=$xdir$func_lo2o_result
- func_append libobjs " $pic_object"
- func_append non_pic_objects " $non_pic_object"
- else
- func_fatal_error "'$arg' is not a valid libtool object"
- fi
- fi
- ;;
-
- *.$libext)
- # An archive.
- func_append deplibs " $arg"
- func_append old_deplibs " $arg"
- continue
- ;;
-
- *.la)
- # A libtool-controlled library.
-
- func_resolve_sysroot "$arg"
- if test dlfiles = "$prev"; then
- # This library was specified with -dlopen.
- func_append dlfiles " $func_resolve_sysroot_result"
- prev=
- elif test dlprefiles = "$prev"; then
- # The library was specified with -dlpreopen.
- func_append dlprefiles " $func_resolve_sysroot_result"
- prev=
- else
- func_append deplibs " $func_resolve_sysroot_result"
- fi
- continue
- ;;
-
- # Some other compiler argument.
- *)
- # Unknown arguments in both finalize_command and compile_command need
- # to be aesthetically quoted because they are evaled later.
- func_quote_for_eval "$arg"
- arg=$func_quote_for_eval_result
- ;;
- esac # arg
-
- # Now actually substitute the argument into the commands.
- if test -n "$arg"; then
- func_append compile_command " $arg"
- func_append finalize_command " $arg"
- fi
- done # argument parsing loop
-
- test -n "$prev" && \
- func_fatal_help "the '$prevarg' option requires an argument"
-
- if test yes = "$export_dynamic" && test -n "$export_dynamic_flag_spec"; then
- eval arg=\"$export_dynamic_flag_spec\"
- func_append compile_command " $arg"
- func_append finalize_command " $arg"
- fi
-
- oldlibs=
- # calculate the name of the file, without its directory
- func_basename "$output"
- outputname=$func_basename_result
- libobjs_save=$libobjs
-
- if test -n "$shlibpath_var"; then
- # get the directories listed in $shlibpath_var
- eval shlib_search_path=\`\$ECHO \"\$$shlibpath_var\" \| \$SED \'s/:/ /g\'\`
- else
- shlib_search_path=
- fi
- eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
- eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
-
- func_dirname "$output" "/" ""
- output_objdir=$func_dirname_result$objdir
- func_to_tool_file "$output_objdir/"
- tool_output_objdir=$func_to_tool_file_result
- # Create the object directory.
- func_mkdir_p "$output_objdir"
-
- # Determine the type of output
- case $output in
- "")
- func_fatal_help "you must specify an output file"
- ;;
- *.$libext) linkmode=oldlib ;;
- *.lo | *.$objext) linkmode=obj ;;
- *.la) linkmode=lib ;;
- *) linkmode=prog ;; # Anything else should be a program.
- esac
-
- specialdeplibs=
-
- libs=
- # Find all interdependent deplibs by searching for libraries
- # that are linked more than once (e.g. -la -lb -la)
- for deplib in $deplibs; do
- if $opt_preserve_dup_deps; then
- case "$libs " in
- *" $deplib "*) func_append specialdeplibs " $deplib" ;;
- esac
- fi
- func_append libs " $deplib"
- done
-
- if test lib = "$linkmode"; then
- libs="$predeps $libs $compiler_lib_search_path $postdeps"
-
- # Compute libraries that are listed more than once in $predeps
- # $postdeps and mark them as special (i.e., whose duplicates are
- # not to be eliminated).
- pre_post_deps=
- if $opt_duplicate_compiler_generated_deps; then
- for pre_post_dep in $predeps $postdeps; do
- case "$pre_post_deps " in
- *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;;
- esac
- func_append pre_post_deps " $pre_post_dep"
- done
- fi
- pre_post_deps=
- fi
-
- deplibs=
- newdependency_libs=
- newlib_search_path=
- need_relink=no # whether we're linking any uninstalled libtool libraries
- notinst_deplibs= # not-installed libtool libraries
- notinst_path= # paths that contain not-installed libtool libraries
-
- case $linkmode in
- lib)
- passes="conv dlpreopen link"
- for file in $dlfiles $dlprefiles; do
- case $file in
- *.la) ;;
- *)
- func_fatal_help "libraries can '-dlopen' only libtool libraries: $file"
- ;;
- esac
- done
- ;;
- prog)
- compile_deplibs=
- finalize_deplibs=
- alldeplibs=false
- newdlfiles=
- newdlprefiles=
- passes="conv scan dlopen dlpreopen link"
- ;;
- *) passes="conv"
- ;;
- esac
-
- for pass in $passes; do
- # The preopen pass in lib mode reverses $deplibs; put it back here
- # so that -L comes before libs that need it for instance...
- if test lib,link = "$linkmode,$pass"; then
- ## FIXME: Find the place where the list is rebuilt in the wrong
- ## order, and fix it there properly
- tmp_deplibs=
- for deplib in $deplibs; do
- tmp_deplibs="$deplib $tmp_deplibs"
- done
- deplibs=$tmp_deplibs
- fi
-
- if test lib,link = "$linkmode,$pass" ||
- test prog,scan = "$linkmode,$pass"; then
- libs=$deplibs
- deplibs=
- fi
- if test prog = "$linkmode"; then
- case $pass in
- dlopen) libs=$dlfiles ;;
- dlpreopen) libs=$dlprefiles ;;
- link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
- esac
- fi
- if test lib,dlpreopen = "$linkmode,$pass"; then
- # Collect and forward deplibs of preopened libtool libs
- for lib in $dlprefiles; do
- # Ignore non-libtool-libs
- dependency_libs=
- func_resolve_sysroot "$lib"
- case $lib in
- *.la) func_source "$func_resolve_sysroot_result" ;;
- esac
-
- # Collect preopened libtool deplibs, except any this library
- # has declared as weak libs
- for deplib in $dependency_libs; do
- func_basename "$deplib"
- deplib_base=$func_basename_result
- case " $weak_libs " in
- *" $deplib_base "*) ;;
- *) func_append deplibs " $deplib" ;;
- esac
- done
- done
- libs=$dlprefiles
- fi
- if test dlopen = "$pass"; then
- # Collect dlpreopened libraries
- save_deplibs=$deplibs
- deplibs=
- fi
-
- for deplib in $libs; do
- lib=
- found=false
- case $deplib in
- -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \
- |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
- if test prog,link = "$linkmode,$pass"; then
- compile_deplibs="$deplib $compile_deplibs"
- finalize_deplibs="$deplib $finalize_deplibs"
- else
- func_append compiler_flags " $deplib"
- if test lib = "$linkmode"; then
- case "$new_inherited_linker_flags " in
- *" $deplib "*) ;;
- * ) func_append new_inherited_linker_flags " $deplib" ;;
- esac
- fi
- fi
- continue
- ;;
- -l*)
- if test lib != "$linkmode" && test prog != "$linkmode"; then
- func_warning "'-l' is ignored for archives/objects"
- continue
- fi
- func_stripname '-l' '' "$deplib"
- name=$func_stripname_result
- if test lib = "$linkmode"; then
- searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path"
- else
- searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path"
- fi
- for searchdir in $searchdirs; do
- for search_ext in .la $std_shrext .so .a; do
- # Search the libtool library
- lib=$searchdir/lib$name$search_ext
- if test -f "$lib"; then
- if test .la = "$search_ext"; then
- found=:
- else
- found=false
- fi
- break 2
- fi
- done
- done
- if $found; then
- # deplib is a libtool library
- # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
- # We need to do some special things here, and not later.
- if test yes = "$allow_libtool_libs_with_static_runtimes"; then
- case " $predeps $postdeps " in
- *" $deplib "*)
- if func_lalib_p "$lib"; then
- library_names=
- old_library=
- func_source "$lib"
- for l in $old_library $library_names; do
- ll=$l
- done
- if test "X$ll" = "X$old_library"; then # only static version available
- found=false
- func_dirname "$lib" "" "."
- ladir=$func_dirname_result
- lib=$ladir/$old_library
- if test prog,link = "$linkmode,$pass"; then
- compile_deplibs="$deplib $compile_deplibs"
- finalize_deplibs="$deplib $finalize_deplibs"
- else
- deplibs="$deplib $deplibs"
- test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs"
- fi
- continue
- fi
- fi
- ;;
- *) ;;
- esac
- fi
- else
- # deplib doesn't seem to be a libtool library
- if test prog,link = "$linkmode,$pass"; then
- compile_deplibs="$deplib $compile_deplibs"
- finalize_deplibs="$deplib $finalize_deplibs"
- else
- deplibs="$deplib $deplibs"
- test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs"
- fi
- continue
- fi
- ;; # -l
- *.ltframework)
- if test prog,link = "$linkmode,$pass"; then
- compile_deplibs="$deplib $compile_deplibs"
- finalize_deplibs="$deplib $finalize_deplibs"
- else
- deplibs="$deplib $deplibs"
- if test lib = "$linkmode"; then
- case "$new_inherited_linker_flags " in
- *" $deplib "*) ;;
- * ) func_append new_inherited_linker_flags " $deplib" ;;
- esac
- fi
- fi
- continue
- ;;
- -L*)
- case $linkmode in
- lib)
- deplibs="$deplib $deplibs"
- test conv = "$pass" && continue
- newdependency_libs="$deplib $newdependency_libs"
- func_stripname '-L' '' "$deplib"
- func_resolve_sysroot "$func_stripname_result"
- func_append newlib_search_path " $func_resolve_sysroot_result"
- ;;
- prog)
- if test conv = "$pass"; then
- deplibs="$deplib $deplibs"
- continue
- fi
- if test scan = "$pass"; then
- deplibs="$deplib $deplibs"
- else
- compile_deplibs="$deplib $compile_deplibs"
- finalize_deplibs="$deplib $finalize_deplibs"
- fi
- func_stripname '-L' '' "$deplib"
- func_resolve_sysroot "$func_stripname_result"
- func_append newlib_search_path " $func_resolve_sysroot_result"
- ;;
- *)
- func_warning "'-L' is ignored for archives/objects"
- ;;
- esac # linkmode
- continue
- ;; # -L
- -R*)
- if test link = "$pass"; then
- func_stripname '-R' '' "$deplib"
- func_resolve_sysroot "$func_stripname_result"
- dir=$func_resolve_sysroot_result
- # Make sure the xrpath contains only unique directories.
- case "$xrpath " in
- *" $dir "*) ;;
- *) func_append xrpath " $dir" ;;
- esac
- fi
- deplibs="$deplib $deplibs"
- continue
- ;;
- *.la)
- func_resolve_sysroot "$deplib"
- lib=$func_resolve_sysroot_result
- ;;
- *.$libext)
- if test conv = "$pass"; then
- deplibs="$deplib $deplibs"
- continue
- fi
- case $linkmode in
- lib)
- # Linking convenience modules into shared libraries is allowed,
- # but linking other static libraries is non-portable.
- case " $dlpreconveniencelibs " in
- *" $deplib "*) ;;
- *)
- valid_a_lib=false
- case $deplibs_check_method in
- match_pattern*)
- set dummy $deplibs_check_method; shift
- match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
- if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \
- | $EGREP "$match_pattern_regex" > /dev/null; then
- valid_a_lib=:
- fi
- ;;
- pass_all)
- valid_a_lib=:
- ;;
- esac
- if $valid_a_lib; then
- echo
- $ECHO "*** Warning: Linking the shared library $output against the"
- $ECHO "*** static library $deplib is not portable!"
- deplibs="$deplib $deplibs"
- else
- echo
- $ECHO "*** Warning: Trying to link with static lib archive $deplib."
- echo "*** I have the capability to make that library automatically link in when"
- echo "*** you link to this library. But I can only do this if you have a"
- echo "*** shared version of the library, which you do not appear to have"
- echo "*** because the file extensions .$libext of this argument makes me believe"
- echo "*** that it is just a static archive that I should not use here."
- fi
- ;;
- esac
- continue
- ;;
- prog)
- if test link != "$pass"; then
- deplibs="$deplib $deplibs"
- else
- compile_deplibs="$deplib $compile_deplibs"
- finalize_deplibs="$deplib $finalize_deplibs"
- fi
- continue
- ;;
- esac # linkmode
- ;; # *.$libext
- *.lo | *.$objext)
- if test conv = "$pass"; then
- deplibs="$deplib $deplibs"
- elif test prog = "$linkmode"; then
- if test dlpreopen = "$pass" || test yes != "$dlopen_support" || test no = "$build_libtool_libs"; then
- # If there is no dlopen support or we're linking statically,
- # we need to preload.
- func_append newdlprefiles " $deplib"
- compile_deplibs="$deplib $compile_deplibs"
- finalize_deplibs="$deplib $finalize_deplibs"
- else
- func_append newdlfiles " $deplib"
- fi
- fi
- continue
- ;;
- %DEPLIBS%)
- alldeplibs=:
- continue
- ;;
- esac # case $deplib
-
- $found || test -f "$lib" \
- || func_fatal_error "cannot find the library '$lib' or unhandled argument '$deplib'"
-
- # Check to see that this really is a libtool archive.
- func_lalib_unsafe_p "$lib" \
- || func_fatal_error "'$lib' is not a valid libtool archive"
-
- func_dirname "$lib" "" "."
- ladir=$func_dirname_result
-
- dlname=
- dlopen=
- dlpreopen=
- libdir=
- library_names=
- old_library=
- inherited_linker_flags=
- # If the library was installed with an old release of libtool,
- # it will not redefine variables installed, or shouldnotlink
- installed=yes
- shouldnotlink=no
- avoidtemprpath=
-
-
- # Read the .la file
- func_source "$lib"
-
- # Convert "-framework foo" to "foo.ltframework"
- if test -n "$inherited_linker_flags"; then
- tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'`
- for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do
- case " $new_inherited_linker_flags " in
- *" $tmp_inherited_linker_flag "*) ;;
- *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";;
- esac
- done
- fi
- dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
- if test lib,link = "$linkmode,$pass" ||
- test prog,scan = "$linkmode,$pass" ||
- { test prog != "$linkmode" && test lib != "$linkmode"; }; then
- test -n "$dlopen" && func_append dlfiles " $dlopen"
- test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen"
- fi
-
- if test conv = "$pass"; then
- # Only check for convenience libraries
- deplibs="$lib $deplibs"
- if test -z "$libdir"; then
- if test -z "$old_library"; then
- func_fatal_error "cannot find name of link library for '$lib'"
- fi
- # It is a libtool convenience library, so add in its objects.
- func_append convenience " $ladir/$objdir/$old_library"
- func_append old_convenience " $ladir/$objdir/$old_library"
- elif test prog != "$linkmode" && test lib != "$linkmode"; then
- func_fatal_error "'$lib' is not a convenience library"
- fi
- tmp_libs=
- for deplib in $dependency_libs; do
- deplibs="$deplib $deplibs"
- if $opt_preserve_dup_deps; then
- case "$tmp_libs " in
- *" $deplib "*) func_append specialdeplibs " $deplib" ;;
- esac
- fi
- func_append tmp_libs " $deplib"
- done
- continue
- fi # $pass = conv
-
-
- # Get the name of the library we link against.
- linklib=
- if test -n "$old_library" &&
- { test yes = "$prefer_static_libs" ||
- test built,no = "$prefer_static_libs,$installed"; }; then
- linklib=$old_library
- else
- for l in $old_library $library_names; do
- linklib=$l
- done
- fi
- if test -z "$linklib"; then
- func_fatal_error "cannot find name of link library for '$lib'"
- fi
-
- # This library was specified with -dlopen.
- if test dlopen = "$pass"; then
- test -z "$libdir" \
- && func_fatal_error "cannot -dlopen a convenience library: '$lib'"
- if test -z "$dlname" ||
- test yes != "$dlopen_support" ||
- test no = "$build_libtool_libs"
- then
- # If there is no dlname, no dlopen support or we're linking
- # statically, we need to preload. We also need to preload any
- # dependent libraries so libltdl's deplib preloader doesn't
- # bomb out in the load deplibs phase.
- func_append dlprefiles " $lib $dependency_libs"
- else
- func_append newdlfiles " $lib"
- fi
- continue
- fi # $pass = dlopen
-
- # We need an absolute path.
- case $ladir in
- [\\/]* | [A-Za-z]:[\\/]*) abs_ladir=$ladir ;;
- *)
- abs_ladir=`cd "$ladir" && pwd`
- if test -z "$abs_ladir"; then
- func_warning "cannot determine absolute directory name of '$ladir'"
- func_warning "passing it literally to the linker, although it might fail"
- abs_ladir=$ladir
- fi
- ;;
- esac
- func_basename "$lib"
- laname=$func_basename_result
-
- # Find the relevant object directory and library name.
- if test yes = "$installed"; then
- if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
- func_warning "library '$lib' was moved."
- dir=$ladir
- absdir=$abs_ladir
- libdir=$abs_ladir
- else
- dir=$lt_sysroot$libdir
- absdir=$lt_sysroot$libdir
- fi
- test yes = "$hardcode_automatic" && avoidtemprpath=yes
- else
- if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
- dir=$ladir
- absdir=$abs_ladir
- # Remove this search path later
- func_append notinst_path " $abs_ladir"
- else
- dir=$ladir/$objdir
- absdir=$abs_ladir/$objdir
- # Remove this search path later
- func_append notinst_path " $abs_ladir"
- fi
- fi # $installed = yes
- func_stripname 'lib' '.la' "$laname"
- name=$func_stripname_result
-
- # This library was specified with -dlpreopen.
- if test dlpreopen = "$pass"; then
- if test -z "$libdir" && test prog = "$linkmode"; then
- func_fatal_error "only libraries may -dlpreopen a convenience library: '$lib'"
- fi
- case $host in
- # special handling for platforms with PE-DLLs.
- *cygwin* | *mingw* | *cegcc* )
- # Linker will automatically link against shared library if both
- # static and shared are present. Therefore, ensure we extract
- # symbols from the import library if a shared library is present
- # (otherwise, the dlopen module name will be incorrect). We do
- # this by putting the import library name into $newdlprefiles.
- # We recover the dlopen module name by 'saving' the la file
- # name in a special purpose variable, and (later) extracting the
- # dlname from the la file.
- if test -n "$dlname"; then
- func_tr_sh "$dir/$linklib"
- eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname"
- func_append newdlprefiles " $dir/$linklib"
- else
- func_append newdlprefiles " $dir/$old_library"
- # Keep a list of preopened convenience libraries to check
- # that they are being used correctly in the link pass.
- test -z "$libdir" && \
- func_append dlpreconveniencelibs " $dir/$old_library"
- fi
- ;;
- * )
- # Prefer using a static library (so that no silly _DYNAMIC symbols
- # are required to link).
- if test -n "$old_library"; then
- func_append newdlprefiles " $dir/$old_library"
- # Keep a list of preopened convenience libraries to check
- # that they are being used correctly in the link pass.
- test -z "$libdir" && \
- func_append dlpreconveniencelibs " $dir/$old_library"
- # Otherwise, use the dlname, so that lt_dlopen finds it.
- elif test -n "$dlname"; then
- func_append newdlprefiles " $dir/$dlname"
- else
- func_append newdlprefiles " $dir/$linklib"
- fi
- ;;
- esac
- fi # $pass = dlpreopen
-
- if test -z "$libdir"; then
- # Link the convenience library
- if test lib = "$linkmode"; then
- deplibs="$dir/$old_library $deplibs"
- elif test prog,link = "$linkmode,$pass"; then
- compile_deplibs="$dir/$old_library $compile_deplibs"
- finalize_deplibs="$dir/$old_library $finalize_deplibs"
- else
- deplibs="$lib $deplibs" # used for prog,scan pass
- fi
- continue
- fi
-
-
- if test prog = "$linkmode" && test link != "$pass"; then
- func_append newlib_search_path " $ladir"
- deplibs="$lib $deplibs"
-
- linkalldeplibs=false
- if test no != "$link_all_deplibs" || test -z "$library_names" ||
- test no = "$build_libtool_libs"; then
- linkalldeplibs=:
- fi
-
- tmp_libs=
- for deplib in $dependency_libs; do
- case $deplib in
- -L*) func_stripname '-L' '' "$deplib"
- func_resolve_sysroot "$func_stripname_result"
- func_append newlib_search_path " $func_resolve_sysroot_result"
- ;;
- esac
- # Need to link against all dependency_libs?
- if $linkalldeplibs; then
- deplibs="$deplib $deplibs"
- else
- # Need to hardcode shared library paths
- # or/and link against static libraries
- newdependency_libs="$deplib $newdependency_libs"
- fi
- if $opt_preserve_dup_deps; then
- case "$tmp_libs " in
- *" $deplib "*) func_append specialdeplibs " $deplib" ;;
- esac
- fi
- func_append tmp_libs " $deplib"
- done # for deplib
- continue
- fi # $linkmode = prog...
-
- if test prog,link = "$linkmode,$pass"; then
- if test -n "$library_names" &&
- { { test no = "$prefer_static_libs" ||
- test built,yes = "$prefer_static_libs,$installed"; } ||
- test -z "$old_library"; }; then
- # We need to hardcode the library path
- if test -n "$shlibpath_var" && test -z "$avoidtemprpath"; then
- # Make sure the rpath contains only unique directories.
- case $temp_rpath: in
- *"$absdir:"*) ;;
- *) func_append temp_rpath "$absdir:" ;;
- esac
- fi
-
- # Hardcode the library path.
- # Skip directories that are in the system default run-time
- # search path.
- case " $sys_lib_dlsearch_path " in
- *" $absdir "*) ;;
- *)
- case "$compile_rpath " in
- *" $absdir "*) ;;
- *) func_append compile_rpath " $absdir" ;;
- esac
- ;;
- esac
- case " $sys_lib_dlsearch_path " in
- *" $libdir "*) ;;
- *)
- case "$finalize_rpath " in
- *" $libdir "*) ;;
- *) func_append finalize_rpath " $libdir" ;;
- esac
- ;;
- esac
- fi # $linkmode,$pass = prog,link...
-
- if $alldeplibs &&
- { test pass_all = "$deplibs_check_method" ||
- { test yes = "$build_libtool_libs" &&
- test -n "$library_names"; }; }; then
- # We only need to search for static libraries
- continue
- fi
- fi
-
- link_static=no # Whether the deplib will be linked statically
- use_static_libs=$prefer_static_libs
- if test built = "$use_static_libs" && test yes = "$installed"; then
- use_static_libs=no
- fi
- if test -n "$library_names" &&
- { test no = "$use_static_libs" || test -z "$old_library"; }; then
- case $host in
- *cygwin* | *mingw* | *cegcc*)
- # No point in relinking DLLs because paths are not encoded
- func_append notinst_deplibs " $lib"
- need_relink=no
- ;;
- *)
- if test no = "$installed"; then
- func_append notinst_deplibs " $lib"
- need_relink=yes
- fi
- ;;
- esac
- # This is a shared library
-
- # Warn about portability, can't link against -module's on some
- # systems (darwin). Don't bleat about dlopened modules though!
- dlopenmodule=
- for dlpremoduletest in $dlprefiles; do
- if test "X$dlpremoduletest" = "X$lib"; then
- dlopenmodule=$dlpremoduletest
- break
- fi
- done
- if test -z "$dlopenmodule" && test yes = "$shouldnotlink" && test link = "$pass"; then
- echo
- if test prog = "$linkmode"; then
- $ECHO "*** Warning: Linking the executable $output against the loadable module"
- else
- $ECHO "*** Warning: Linking the shared library $output against the loadable module"
- fi
- $ECHO "*** $linklib is not portable!"
- fi
- if test lib = "$linkmode" &&
- test yes = "$hardcode_into_libs"; then
- # Hardcode the library path.
- # Skip directories that are in the system default run-time
- # search path.
- case " $sys_lib_dlsearch_path " in
- *" $absdir "*) ;;
- *)
- case "$compile_rpath " in
- *" $absdir "*) ;;
- *) func_append compile_rpath " $absdir" ;;
- esac
- ;;
- esac
- case " $sys_lib_dlsearch_path " in
- *" $libdir "*) ;;
- *)
- case "$finalize_rpath " in
- *" $libdir "*) ;;
- *) func_append finalize_rpath " $libdir" ;;
- esac
- ;;
- esac
- fi
-
- if test -n "$old_archive_from_expsyms_cmds"; then
- # figure out the soname
- set dummy $library_names
- shift
- realname=$1
- shift
- libname=`eval "\\$ECHO \"$libname_spec\""`
- # use dlname if we got it. it's perfectly good, no?
- if test -n "$dlname"; then
- soname=$dlname
- elif test -n "$soname_spec"; then
- # bleh windows
- case $host in
- *cygwin* | mingw* | *cegcc*)
- func_arith $current - $age
- major=$func_arith_result
- versuffix=-$major
- ;;
- esac
- eval soname=\"$soname_spec\"
- else
- soname=$realname
- fi
-
- # Make a new name for the extract_expsyms_cmds to use
- soroot=$soname
- func_basename "$soroot"
- soname=$func_basename_result
- func_stripname 'lib' '.dll' "$soname"
- newlib=libimp-$func_stripname_result.a
-
- # If the library has no export list, then create one now
- if test -f "$output_objdir/$soname-def"; then :
- else
- func_verbose "extracting exported symbol list from '$soname'"
- func_execute_cmds "$extract_expsyms_cmds" 'exit $?'
- fi
-
- # Create $newlib
- if test -f "$output_objdir/$newlib"; then :; else
- func_verbose "generating import library for '$soname'"
- func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?'
- fi
- # make sure the library variables are pointing to the new library
- dir=$output_objdir
- linklib=$newlib
- fi # test -n "$old_archive_from_expsyms_cmds"
-
- if test prog = "$linkmode" || test relink != "$opt_mode"; then
- add_shlibpath=
- add_dir=
- add=
- lib_linked=yes
- case $hardcode_action in
- immediate | unsupported)
- if test no = "$hardcode_direct"; then
- add=$dir/$linklib
- case $host in
- *-*-sco3.2v5.0.[024]*) add_dir=-L$dir ;;
- *-*-sysv4*uw2*) add_dir=-L$dir ;;
- *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \
- *-*-unixware7*) add_dir=-L$dir ;;
- *-*-darwin* )
- # if the lib is a (non-dlopened) module then we cannot
- # link against it, someone is ignoring the earlier warnings
- if /usr/bin/file -L $add 2> /dev/null |
- $GREP ": [^:]* bundle" >/dev/null; then
- if test "X$dlopenmodule" != "X$lib"; then
- $ECHO "*** Warning: lib $linklib is a module, not a shared library"
- if test -z "$old_library"; then
- echo
- echo "*** And there doesn't seem to be a static archive available"
- echo "*** The link will probably fail, sorry"
- else
- add=$dir/$old_library
- fi
- elif test -n "$old_library"; then
- add=$dir/$old_library
- fi
- fi
- esac
- elif test no = "$hardcode_minus_L"; then
- case $host in
- *-*-sunos*) add_shlibpath=$dir ;;
- esac
- add_dir=-L$dir
- add=-l$name
- elif test no = "$hardcode_shlibpath_var"; then
- add_shlibpath=$dir
- add=-l$name
- else
- lib_linked=no
- fi
- ;;
- relink)
- if test yes = "$hardcode_direct" &&
- test no = "$hardcode_direct_absolute"; then
- add=$dir/$linklib
- elif test yes = "$hardcode_minus_L"; then
- add_dir=-L$absdir
- # Try looking first in the location we're being installed to.
- if test -n "$inst_prefix_dir"; then
- case $libdir in
- [\\/]*)
- func_append add_dir " -L$inst_prefix_dir$libdir"
- ;;
- esac
- fi
- add=-l$name
- elif test yes = "$hardcode_shlibpath_var"; then
- add_shlibpath=$dir
- add=-l$name
- else
- lib_linked=no
- fi
- ;;
- *) lib_linked=no ;;
- esac
-
- if test yes != "$lib_linked"; then
- func_fatal_configuration "unsupported hardcode properties"
- fi
-
- if test -n "$add_shlibpath"; then
- case :$compile_shlibpath: in
- *":$add_shlibpath:"*) ;;
- *) func_append compile_shlibpath "$add_shlibpath:" ;;
- esac
- fi
- if test prog = "$linkmode"; then
- test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
- test -n "$add" && compile_deplibs="$add $compile_deplibs"
- else
- test -n "$add_dir" && deplibs="$add_dir $deplibs"
- test -n "$add" && deplibs="$add $deplibs"
- if test yes != "$hardcode_direct" &&
- test yes != "$hardcode_minus_L" &&
- test yes = "$hardcode_shlibpath_var"; then
- case :$finalize_shlibpath: in
- *":$libdir:"*) ;;
- *) func_append finalize_shlibpath "$libdir:" ;;
- esac
- fi
- fi
- fi
-
- if test prog = "$linkmode" || test relink = "$opt_mode"; then
- add_shlibpath=
- add_dir=
- add=
- # Finalize command for both is simple: just hardcode it.
- if test yes = "$hardcode_direct" &&
- test no = "$hardcode_direct_absolute"; then
- add=$libdir/$linklib
- elif test yes = "$hardcode_minus_L"; then
- add_dir=-L$libdir
- add=-l$name
- elif test yes = "$hardcode_shlibpath_var"; then
- case :$finalize_shlibpath: in
- *":$libdir:"*) ;;
- *) func_append finalize_shlibpath "$libdir:" ;;
- esac
- add=-l$name
- elif test yes = "$hardcode_automatic"; then
- if test -n "$inst_prefix_dir" &&
- test -f "$inst_prefix_dir$libdir/$linklib"; then
- add=$inst_prefix_dir$libdir/$linklib
- else
- add=$libdir/$linklib
- fi
- else
- # We cannot seem to hardcode it, guess we'll fake it.
- add_dir=-L$libdir
- # Try looking first in the location we're being installed to.
- if test -n "$inst_prefix_dir"; then
- case $libdir in
- [\\/]*)
- func_append add_dir " -L$inst_prefix_dir$libdir"
- ;;
- esac
- fi
- add=-l$name
- fi
-
- if test prog = "$linkmode"; then
- test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
- test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
- else
- test -n "$add_dir" && deplibs="$add_dir $deplibs"
- test -n "$add" && deplibs="$add $deplibs"
- fi
- fi
- elif test prog = "$linkmode"; then
- # Here we assume that one of hardcode_direct or hardcode_minus_L
- # is not unsupported. This is valid on all known static and
- # shared platforms.
- if test unsupported != "$hardcode_direct"; then
- test -n "$old_library" && linklib=$old_library
- compile_deplibs="$dir/$linklib $compile_deplibs"
- finalize_deplibs="$dir/$linklib $finalize_deplibs"
- else
- compile_deplibs="-l$name -L$dir $compile_deplibs"
- finalize_deplibs="-l$name -L$dir $finalize_deplibs"
- fi
- elif test yes = "$build_libtool_libs"; then
- # Not a shared library
- if test pass_all != "$deplibs_check_method"; then
- # We're trying link a shared library against a static one
- # but the system doesn't support it.
-
- # Just print a warning and add the library to dependency_libs so
- # that the program can be linked against the static library.
- echo
- $ECHO "*** Warning: This system cannot link to static lib archive $lib."
- echo "*** I have the capability to make that library automatically link in when"
- echo "*** you link to this library. But I can only do this if you have a"
- echo "*** shared version of the library, which you do not appear to have."
- if test yes = "$module"; then
- echo "*** But as you try to build a module library, libtool will still create "
- echo "*** a static module, that should work as long as the dlopening application"
- echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
- if test -z "$global_symbol_pipe"; then
- echo
- echo "*** However, this would only work if libtool was able to extract symbol"
- echo "*** lists from a program, using 'nm' or equivalent, but libtool could"
- echo "*** not find such a program. So, this module is probably useless."
- echo "*** 'nm' from GNU binutils and a full rebuild may help."
- fi
- if test no = "$build_old_libs"; then
- build_libtool_libs=module
- build_old_libs=yes
- else
- build_libtool_libs=no
- fi
- fi
- else
- deplibs="$dir/$old_library $deplibs"
- link_static=yes
- fi
- fi # link shared/static library?
-
- if test lib = "$linkmode"; then
- if test -n "$dependency_libs" &&
- { test yes != "$hardcode_into_libs" ||
- test yes = "$build_old_libs" ||
- test yes = "$link_static"; }; then
- # Extract -R from dependency_libs
- temp_deplibs=
- for libdir in $dependency_libs; do
- case $libdir in
- -R*) func_stripname '-R' '' "$libdir"
- temp_xrpath=$func_stripname_result
- case " $xrpath " in
- *" $temp_xrpath "*) ;;
- *) func_append xrpath " $temp_xrpath";;
- esac;;
- *) func_append temp_deplibs " $libdir";;
- esac
- done
- dependency_libs=$temp_deplibs
- fi
-
- func_append newlib_search_path " $absdir"
- # Link against this library
- test no = "$link_static" && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
- # ... and its dependency_libs
- tmp_libs=
- for deplib in $dependency_libs; do
- newdependency_libs="$deplib $newdependency_libs"
- case $deplib in
- -L*) func_stripname '-L' '' "$deplib"
- func_resolve_sysroot "$func_stripname_result";;
- *) func_resolve_sysroot "$deplib" ;;
- esac
- if $opt_preserve_dup_deps; then
- case "$tmp_libs " in
- *" $func_resolve_sysroot_result "*)
- func_append specialdeplibs " $func_resolve_sysroot_result" ;;
- esac
- fi
- func_append tmp_libs " $func_resolve_sysroot_result"
- done
-
- if test no != "$link_all_deplibs"; then
- # Add the search paths of all dependency libraries
- for deplib in $dependency_libs; do
- path=
- case $deplib in
- -L*) path=$deplib ;;
- *.la)
- func_resolve_sysroot "$deplib"
- deplib=$func_resolve_sysroot_result
- func_dirname "$deplib" "" "."
- dir=$func_dirname_result
- # We need an absolute path.
- case $dir in
- [\\/]* | [A-Za-z]:[\\/]*) absdir=$dir ;;
- *)
- absdir=`cd "$dir" && pwd`
- if test -z "$absdir"; then
- func_warning "cannot determine absolute directory name of '$dir'"
- absdir=$dir
- fi
- ;;
- esac
- if $GREP "^installed=no" $deplib > /dev/null; then
- case $host in
- *-*-darwin*)
- depdepl=
- eval deplibrary_names=`$SED -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
- if test -n "$deplibrary_names"; then
- for tmp in $deplibrary_names; do
- depdepl=$tmp
- done
- if test -f "$absdir/$objdir/$depdepl"; then
- depdepl=$absdir/$objdir/$depdepl
- darwin_install_name=`$OTOOL -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
- if test -z "$darwin_install_name"; then
- darwin_install_name=`$OTOOL64 -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
- fi
- func_append compiler_flags " $wl-dylib_file $wl$darwin_install_name:$depdepl"
- func_append linker_flags " -dylib_file $darwin_install_name:$depdepl"
- path=
- fi
- fi
- ;;
- *)
- path=-L$absdir/$objdir
- ;;
- esac
- else
- eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
- test -z "$libdir" && \
- func_fatal_error "'$deplib' is not a valid libtool archive"
- test "$absdir" != "$libdir" && \
- func_warning "'$deplib' seems to be moved"
-
- path=-L$absdir
- fi
- ;;
- esac
- case " $deplibs " in
- *" $path "*) ;;
- *) deplibs="$path $deplibs" ;;
- esac
- done
- fi # link_all_deplibs != no
- fi # linkmode = lib
- done # for deplib in $libs
- if test link = "$pass"; then
- if test prog = "$linkmode"; then
- compile_deplibs="$new_inherited_linker_flags $compile_deplibs"
- finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs"
- else
- compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
- fi
- fi
- dependency_libs=$newdependency_libs
- if test dlpreopen = "$pass"; then
- # Link the dlpreopened libraries before other libraries
- for deplib in $save_deplibs; do
- deplibs="$deplib $deplibs"
- done
- fi
- if test dlopen != "$pass"; then
- test conv = "$pass" || {
- # Make sure lib_search_path contains only unique directories.
- lib_search_path=
- for dir in $newlib_search_path; do
- case "$lib_search_path " in
- *" $dir "*) ;;
- *) func_append lib_search_path " $dir" ;;
- esac
- done
- newlib_search_path=
- }
-
- if test prog,link = "$linkmode,$pass"; then
- vars="compile_deplibs finalize_deplibs"
- else
- vars=deplibs
- fi
- for var in $vars dependency_libs; do
- # Add libraries to $var in reverse order
- eval tmp_libs=\"\$$var\"
- new_libs=
- for deplib in $tmp_libs; do
- # FIXME: Pedantically, this is the right thing to do, so
- # that some nasty dependency loop isn't accidentally
- # broken:
- #new_libs="$deplib $new_libs"
- # Pragmatically, this seems to cause very few problems in
- # practice:
- case $deplib in
- -L*) new_libs="$deplib $new_libs" ;;
- -R*) ;;
- *)
- # And here is the reason: when a library appears more
- # than once as an explicit dependence of a library, or
- # is implicitly linked in more than once by the
- # compiler, it is considered special, and multiple
- # occurrences thereof are not removed. Compare this
- # with having the same library being listed as a
- # dependency of multiple other libraries: in this case,
- # we know (pedantically, we assume) the library does not
- # need to be listed more than once, so we keep only the
- # last copy. This is not always right, but it is rare
- # enough that we require users that really mean to play
- # such unportable linking tricks to link the library
- # using -Wl,-lname, so that libtool does not consider it
- # for duplicate removal.
- case " $specialdeplibs " in
- *" $deplib "*) new_libs="$deplib $new_libs" ;;
- *)
- case " $new_libs " in
- *" $deplib "*) ;;
- *) new_libs="$deplib $new_libs" ;;
- esac
- ;;
- esac
- ;;
- esac
- done
- tmp_libs=
- for deplib in $new_libs; do
- case $deplib in
- -L*)
- case " $tmp_libs " in
- *" $deplib "*) ;;
- *) func_append tmp_libs " $deplib" ;;
- esac
- ;;
- *) func_append tmp_libs " $deplib" ;;
- esac
- done
- eval $var=\"$tmp_libs\"
- done # for var
- fi
- # Last step: remove runtime libs from dependency_libs
- # (they stay in deplibs)
- tmp_libs=
- for i in $dependency_libs; do
- case " $predeps $postdeps $compiler_lib_search_path " in
- *" $i "*)
- i=
- ;;
- esac
- if test -n "$i"; then
- func_append tmp_libs " $i"
- fi
- done
- dependency_libs=$tmp_libs
- done # for pass
- if test prog = "$linkmode"; then
- dlfiles=$newdlfiles
- fi
- if test prog = "$linkmode" || test lib = "$linkmode"; then
- dlprefiles=$newdlprefiles
- fi
-
- case $linkmode in
- oldlib)
- if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then
- func_warning "'-dlopen' is ignored for archives"
- fi
-
- case " $deplibs" in
- *\ -l* | *\ -L*)
- func_warning "'-l' and '-L' are ignored for archives" ;;
- esac
-
- test -n "$rpath" && \
- func_warning "'-rpath' is ignored for archives"
-
- test -n "$xrpath" && \
- func_warning "'-R' is ignored for archives"
-
- test -n "$vinfo" && \
- func_warning "'-version-info/-version-number' is ignored for archives"
-
- test -n "$release" && \
- func_warning "'-release' is ignored for archives"
-
- test -n "$export_symbols$export_symbols_regex" && \
- func_warning "'-export-symbols' is ignored for archives"
-
- # Now set the variables for building old libraries.
- build_libtool_libs=no
- oldlibs=$output
- func_append objs "$old_deplibs"
- ;;
-
- lib)
- # Make sure we only generate libraries of the form 'libNAME.la'.
- case $outputname in
- lib*)
- func_stripname 'lib' '.la' "$outputname"
- name=$func_stripname_result
- eval shared_ext=\"$shrext_cmds\"
- eval libname=\"$libname_spec\"
- ;;
- *)
- test no = "$module" \
- && func_fatal_help "libtool library '$output' must begin with 'lib'"
-
- if test no != "$need_lib_prefix"; then
- # Add the "lib" prefix for modules if required
- func_stripname '' '.la' "$outputname"
- name=$func_stripname_result
- eval shared_ext=\"$shrext_cmds\"
- eval libname=\"$libname_spec\"
- else
- func_stripname '' '.la' "$outputname"
- libname=$func_stripname_result
- fi
- ;;
- esac
-
- if test -n "$objs"; then
- if test pass_all != "$deplibs_check_method"; then
- func_fatal_error "cannot build libtool library '$output' from non-libtool objects on this host:$objs"
- else
- echo
- $ECHO "*** Warning: Linking the shared library $output against the non-libtool"
- $ECHO "*** objects $objs is not portable!"
- func_append libobjs " $objs"
- fi
- fi
-
- test no = "$dlself" \
- || func_warning "'-dlopen self' is ignored for libtool libraries"
-
- set dummy $rpath
- shift
- test 1 -lt "$#" \
- && func_warning "ignoring multiple '-rpath's for a libtool library"
-
- install_libdir=$1
-
- oldlibs=
- if test -z "$rpath"; then
- if test yes = "$build_libtool_libs"; then
- # Building a libtool convenience library.
- # Some compilers have problems with a '.al' extension so
- # convenience libraries should have the same extension an
- # archive normally would.
- oldlibs="$output_objdir/$libname.$libext $oldlibs"
- build_libtool_libs=convenience
- build_old_libs=yes
- fi
-
- test -n "$vinfo" && \
- func_warning "'-version-info/-version-number' is ignored for convenience libraries"
-
- test -n "$release" && \
- func_warning "'-release' is ignored for convenience libraries"
- else
-
- # Parse the version information argument.
- save_ifs=$IFS; IFS=:
- set dummy $vinfo 0 0 0
- shift
- IFS=$save_ifs
-
- test -n "$7" && \
- func_fatal_help "too many parameters to '-version-info'"
-
- # convert absolute version numbers to libtool ages
- # this retains compatibility with .la files and attempts
- # to make the code below a bit more comprehensible
-
- case $vinfo_number in
- yes)
- number_major=$1
- number_minor=$2
- number_revision=$3
- #
- # There are really only two kinds -- those that
- # use the current revision as the major version
- # and those that subtract age and use age as
- # a minor version. But, then there is irix
- # that has an extra 1 added just for fun
- #
- case $version_type in
- # correct linux to gnu/linux during the next big refactor
- darwin|linux|osf|windows|none)
- func_arith $number_major + $number_minor
- current=$func_arith_result
- age=$number_minor
- revision=$number_revision
- ;;
- freebsd-aout|freebsd-elf|qnx|sunos)
- current=$number_major
- revision=$number_minor
- age=0
- ;;
- irix|nonstopux)
- func_arith $number_major + $number_minor
- current=$func_arith_result
- age=$number_minor
- revision=$number_minor
- lt_irix_increment=no
- ;;
- esac
- ;;
- no)
- current=$1
- revision=$2
- age=$3
- ;;
- esac
-
- # Check that each of the things are valid numbers.
- case $current in
- 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
- *)
- func_error "CURRENT '$current' must be a nonnegative integer"
- func_fatal_error "'$vinfo' is not valid version information"
- ;;
- esac
-
- case $revision in
- 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
- *)
- func_error "REVISION '$revision' must be a nonnegative integer"
- func_fatal_error "'$vinfo' is not valid version information"
- ;;
- esac
-
- case $age in
- 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
- *)
- func_error "AGE '$age' must be a nonnegative integer"
- func_fatal_error "'$vinfo' is not valid version information"
- ;;
- esac
-
- if test "$age" -gt "$current"; then
- func_error "AGE '$age' is greater than the current interface number '$current'"
- func_fatal_error "'$vinfo' is not valid version information"
- fi
-
- # Calculate the version variables.
- major=
- versuffix=
- verstring=
- case $version_type in
- none) ;;
-
- darwin)
- # Like Linux, but with the current version available in
- # verstring for coding it into the library header
- func_arith $current - $age
- major=.$func_arith_result
- versuffix=$major.$age.$revision
- # Darwin ld doesn't like 0 for these options...
- func_arith $current + 1
- minor_current=$func_arith_result
- xlcverstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision"
- verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
- # On Darwin other compilers
- case $CC in
- nagfor*)
- verstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision"
- ;;
- *)
- verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
- ;;
- esac
- ;;
-
- freebsd-aout)
- major=.$current
- versuffix=.$current.$revision
- ;;
-
- freebsd-elf)
- major=.$current
- versuffix=.$current
- ;;
-
- irix | nonstopux)
- if test no = "$lt_irix_increment"; then
- func_arith $current - $age
- else
- func_arith $current - $age + 1
- fi
- major=$func_arith_result
-
- case $version_type in
- nonstopux) verstring_prefix=nonstopux ;;
- *) verstring_prefix=sgi ;;
- esac
- verstring=$verstring_prefix$major.$revision
-
- # Add in all the interfaces that we are compatible with.
- loop=$revision
- while test 0 -ne "$loop"; do
- func_arith $revision - $loop
- iface=$func_arith_result
- func_arith $loop - 1
- loop=$func_arith_result
- verstring=$verstring_prefix$major.$iface:$verstring
- done
-
- # Before this point, $major must not contain '.'.
- major=.$major
- versuffix=$major.$revision
- ;;
-
- linux) # correct to gnu/linux during the next big refactor
- func_arith $current - $age
- major=.$func_arith_result
- versuffix=$major.$age.$revision
- ;;
-
- osf)
- func_arith $current - $age
- major=.$func_arith_result
- versuffix=.$current.$age.$revision
- verstring=$current.$age.$revision
-
- # Add in all the interfaces that we are compatible with.
- loop=$age
- while test 0 -ne "$loop"; do
- func_arith $current - $loop
- iface=$func_arith_result
- func_arith $loop - 1
- loop=$func_arith_result
- verstring=$verstring:$iface.0
- done
-
- # Make executables depend on our current version.
- func_append verstring ":$current.0"
- ;;
-
- qnx)
- major=.$current
- versuffix=.$current
- ;;
-
- sunos)
- major=.$current
- versuffix=.$current.$revision
- ;;
-
- windows)
- # Use '-' rather than '.', since we only want one
- # extension on DOS 8.3 file systems.
- func_arith $current - $age
- major=$func_arith_result
- versuffix=-$major
- ;;
-
- *)
- func_fatal_configuration "unknown library version type '$version_type'"
- ;;
- esac
-
- # Clear the version info if we defaulted, and they specified a release.
- if test -z "$vinfo" && test -n "$release"; then
- major=
- case $version_type in
- darwin)
- # we can't check for "0.0" in archive_cmds due to quoting
- # problems, so we reset it completely
- verstring=
- ;;
- *)
- verstring=0.0
- ;;
- esac
- if test no = "$need_version"; then
- versuffix=
- else
- versuffix=.0.0
- fi
- fi
-
- # Remove version info from name if versioning should be avoided
- if test yes,no = "$avoid_version,$need_version"; then
- major=
- versuffix=
- verstring=
- fi
-
- # Check to see if the archive will have undefined symbols.
- if test yes = "$allow_undefined"; then
- if test unsupported = "$allow_undefined_flag"; then
- if test yes = "$build_old_libs"; then
- func_warning "undefined symbols not allowed in $host shared libraries; building static only"
- build_libtool_libs=no
- else
- func_fatal_error "can't build $host shared library unless -no-undefined is specified"
- fi
- fi
- else
- # Don't allow undefined symbols.
- allow_undefined_flag=$no_undefined_flag
- fi
-
- fi
-
- func_generate_dlsyms "$libname" "$libname" :
- func_append libobjs " $symfileobj"
- test " " = "$libobjs" && libobjs=
-
- if test relink != "$opt_mode"; then
- # Remove our outputs, but don't remove object files since they
- # may have been created when compiling PIC objects.
- removelist=
- tempremovelist=`$ECHO "$output_objdir/*"`
- for p in $tempremovelist; do
- case $p in
- *.$objext | *.gcno)
- ;;
- $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/$libname$release.*)
- if test -n "$precious_files_regex"; then
- if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
- then
- continue
- fi
- fi
- func_append removelist " $p"
- ;;
- *) ;;
- esac
- done
- test -n "$removelist" && \
- func_show_eval "${RM}r \$removelist"
- fi
-
- # Now set the variables for building old libraries.
- if test yes = "$build_old_libs" && test convenience != "$build_libtool_libs"; then
- func_append oldlibs " $output_objdir/$libname.$libext"
-
- # Transform .lo files to .o files.
- oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; $lo2o" | $NL2SP`
- fi
-
- # Eliminate all temporary directories.
- #for path in $notinst_path; do
- # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"`
- # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"`
- # dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"`
- #done
-
- if test -n "$xrpath"; then
- # If the user specified any rpath flags, then add them.
- temp_xrpath=
- for libdir in $xrpath; do
- func_replace_sysroot "$libdir"
- func_append temp_xrpath " -R$func_replace_sysroot_result"
- case "$finalize_rpath " in
- *" $libdir "*) ;;
- *) func_append finalize_rpath " $libdir" ;;
- esac
- done
- if test yes != "$hardcode_into_libs" || test yes = "$build_old_libs"; then
- dependency_libs="$temp_xrpath $dependency_libs"
- fi
- fi
-
- # Make sure dlfiles contains only unique files that won't be dlpreopened
- old_dlfiles=$dlfiles
- dlfiles=
- for lib in $old_dlfiles; do
- case " $dlprefiles $dlfiles " in
- *" $lib "*) ;;
- *) func_append dlfiles " $lib" ;;
- esac
- done
-
- # Make sure dlprefiles contains only unique files
- old_dlprefiles=$dlprefiles
- dlprefiles=
- for lib in $old_dlprefiles; do
- case "$dlprefiles " in
- *" $lib "*) ;;
- *) func_append dlprefiles " $lib" ;;
- esac
- done
-
- if test yes = "$build_libtool_libs"; then
- if test -n "$rpath"; then
- case $host in
- *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*)
- # these systems don't actually have a c library (as such)!
- ;;
- *-*-rhapsody* | *-*-darwin1.[012])
- # Rhapsody C library is in the System framework
- func_append deplibs " System.ltframework"
- ;;
- *-*-netbsd*)
- # Don't link with libc until the a.out ld.so is fixed.
- ;;
- *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
- # Do not include libc due to us having libc/libc_r.
- ;;
- *-*-sco3.2v5* | *-*-sco5v6*)
- # Causes problems with __ctype
- ;;
- *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
- # Compiler inserts libc in the correct place for threads to work
- ;;
- *)
- # Add libc to deplibs on all other systems if necessary.
- if test yes = "$build_libtool_need_lc"; then
- func_append deplibs " -lc"
- fi
- ;;
- esac
- fi
-
- # Transform deplibs into only deplibs that can be linked in shared.
- name_save=$name
- libname_save=$libname
- release_save=$release
- versuffix_save=$versuffix
- major_save=$major
- # I'm not sure if I'm treating the release correctly. I think
- # release should show up in the -l (ie -lgmp5) so we don't want to
- # add it in twice. Is that correct?
- release=
- versuffix=
- major=
- newdeplibs=
- droppeddeps=no
- case $deplibs_check_method in
- pass_all)
- # Don't check for shared/static. Everything works.
- # This might be a little naive. We might want to check
- # whether the library exists or not. But this is on
- # osf3 & osf4 and I'm not really sure... Just
- # implementing what was already the behavior.
- newdeplibs=$deplibs
- ;;
- test_compile)
- # This code stresses the "libraries are programs" paradigm to its
- # limits. Maybe even breaks it. We compile a program, linking it
- # against the deplibs as a proxy for the library. Then we can check
- # whether they linked in statically or dynamically with ldd.
- $opt_dry_run || $RM conftest.c
- cat > conftest.c <<EOF
- int main() { return 0; }
-EOF
- $opt_dry_run || $RM conftest
- if $LTCC $LTCFLAGS -o conftest conftest.c $deplibs; then
- ldd_output=`ldd conftest`
- for i in $deplibs; do
- case $i in
- -l*)
- func_stripname -l '' "$i"
- name=$func_stripname_result
- if test yes = "$allow_libtool_libs_with_static_runtimes"; then
- case " $predeps $postdeps " in
- *" $i "*)
- func_append newdeplibs " $i"
- i=
- ;;
- esac
- fi
- if test -n "$i"; then
- libname=`eval "\\$ECHO \"$libname_spec\""`
- deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
- set dummy $deplib_matches; shift
- deplib_match=$1
- if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0; then
- func_append newdeplibs " $i"
- else
- droppeddeps=yes
- echo
- $ECHO "*** Warning: dynamic linker does not accept needed library $i."
- echo "*** I have the capability to make that library automatically link in when"
- echo "*** you link to this library. But I can only do this if you have a"
- echo "*** shared version of the library, which I believe you do not have"
- echo "*** because a test_compile did reveal that the linker did not use it for"
- echo "*** its dynamic dependency list that programs get resolved with at runtime."
- fi
- fi
- ;;
- *)
- func_append newdeplibs " $i"
- ;;
- esac
- done
- else
- # Error occurred in the first compile. Let's try to salvage
- # the situation: Compile a separate program for each library.
- for i in $deplibs; do
- case $i in
- -l*)
- func_stripname -l '' "$i"
- name=$func_stripname_result
- $opt_dry_run || $RM conftest
- if $LTCC $LTCFLAGS -o conftest conftest.c $i; then
- ldd_output=`ldd conftest`
- if test yes = "$allow_libtool_libs_with_static_runtimes"; then
- case " $predeps $postdeps " in
- *" $i "*)
- func_append newdeplibs " $i"
- i=
- ;;
- esac
- fi
- if test -n "$i"; then
- libname=`eval "\\$ECHO \"$libname_spec\""`
- deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
- set dummy $deplib_matches; shift
- deplib_match=$1
- if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0; then
- func_append newdeplibs " $i"
- else
- droppeddeps=yes
- echo
- $ECHO "*** Warning: dynamic linker does not accept needed library $i."
- echo "*** I have the capability to make that library automatically link in when"
- echo "*** you link to this library. But I can only do this if you have a"
- echo "*** shared version of the library, which you do not appear to have"
- echo "*** because a test_compile did reveal that the linker did not use this one"
- echo "*** as a dynamic dependency that programs can get resolved with at runtime."
- fi
- fi
- else
- droppeddeps=yes
- echo
- $ECHO "*** Warning! Library $i is needed by this library but I was not able to"
- echo "*** make it link in! You will probably need to install it or some"
- echo "*** library that it depends on before this library will be fully"
- echo "*** functional. Installing it before continuing would be even better."
- fi
- ;;
- *)
- func_append newdeplibs " $i"
- ;;
- esac
- done
- fi
- ;;
- file_magic*)
- set dummy $deplibs_check_method; shift
- file_magic_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
- for a_deplib in $deplibs; do
- case $a_deplib in
- -l*)
- func_stripname -l '' "$a_deplib"
- name=$func_stripname_result
- if test yes = "$allow_libtool_libs_with_static_runtimes"; then
- case " $predeps $postdeps " in
- *" $a_deplib "*)
- func_append newdeplibs " $a_deplib"
- a_deplib=
- ;;
- esac
- fi
- if test -n "$a_deplib"; then
- libname=`eval "\\$ECHO \"$libname_spec\""`
- if test -n "$file_magic_glob"; then
- libnameglob=`func_echo_all "$libname" | $SED -e $file_magic_glob`
- else
- libnameglob=$libname
- fi
- test yes = "$want_nocaseglob" && nocaseglob=`shopt -p nocaseglob`
- for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
- if test yes = "$want_nocaseglob"; then
- shopt -s nocaseglob
- potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`
- $nocaseglob
- else
- potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`
- fi
- for potent_lib in $potential_libs; do
- # Follow soft links.
- if ls -lLd "$potent_lib" 2>/dev/null |
- $GREP " -> " >/dev/null; then
- continue
- fi
- # The statement above tries to avoid entering an
- # endless loop below, in case of cyclic links.
- # We might still enter an endless loop, since a link
- # loop can be closed while we follow links,
- # but so what?
- potlib=$potent_lib
- while test -h "$potlib" 2>/dev/null; do
- potliblink=`ls -ld $potlib | $SED 's/.* -> //'`
- case $potliblink in
- [\\/]* | [A-Za-z]:[\\/]*) potlib=$potliblink;;
- *) potlib=`$ECHO "$potlib" | $SED 's|[^/]*$||'`"$potliblink";;
- esac
- done
- if eval $file_magic_cmd \"\$potlib\" 2>/dev/null |
- $SED -e 10q |
- $EGREP "$file_magic_regex" > /dev/null; then
- func_append newdeplibs " $a_deplib"
- a_deplib=
- break 2
- fi
- done
- done
- fi
- if test -n "$a_deplib"; then
- droppeddeps=yes
- echo
- $ECHO "*** Warning: linker path does not have real file for library $a_deplib."
- echo "*** I have the capability to make that library automatically link in when"
- echo "*** you link to this library. But I can only do this if you have a"
- echo "*** shared version of the library, which you do not appear to have"
- echo "*** because I did check the linker path looking for a file starting"
- if test -z "$potlib"; then
- $ECHO "*** with $libname but no candidates were found. (...for file magic test)"
- else
- $ECHO "*** with $libname and none of the candidates passed a file format test"
- $ECHO "*** using a file magic. Last file checked: $potlib"
- fi
- fi
- ;;
- *)
- # Add a -L argument.
- func_append newdeplibs " $a_deplib"
- ;;
- esac
- done # Gone through all deplibs.
- ;;
- match_pattern*)
- set dummy $deplibs_check_method; shift
- match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
- for a_deplib in $deplibs; do
- case $a_deplib in
- -l*)
- func_stripname -l '' "$a_deplib"
- name=$func_stripname_result
- if test yes = "$allow_libtool_libs_with_static_runtimes"; then
- case " $predeps $postdeps " in
- *" $a_deplib "*)
- func_append newdeplibs " $a_deplib"
- a_deplib=
- ;;
- esac
- fi
- if test -n "$a_deplib"; then
- libname=`eval "\\$ECHO \"$libname_spec\""`
- for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
- potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
- for potent_lib in $potential_libs; do
- potlib=$potent_lib # see symlink-check above in file_magic test
- if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \
- $EGREP "$match_pattern_regex" > /dev/null; then
- func_append newdeplibs " $a_deplib"
- a_deplib=
- break 2
- fi
- done
- done
- fi
- if test -n "$a_deplib"; then
- droppeddeps=yes
- echo
- $ECHO "*** Warning: linker path does not have real file for library $a_deplib."
- echo "*** I have the capability to make that library automatically link in when"
- echo "*** you link to this library. But I can only do this if you have a"
- echo "*** shared version of the library, which you do not appear to have"
- echo "*** because I did check the linker path looking for a file starting"
- if test -z "$potlib"; then
- $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)"
- else
- $ECHO "*** with $libname and none of the candidates passed a file format test"
- $ECHO "*** using a regex pattern. Last file checked: $potlib"
- fi
- fi
- ;;
- *)
- # Add a -L argument.
- func_append newdeplibs " $a_deplib"
- ;;
- esac
- done # Gone through all deplibs.
- ;;
- none | unknown | *)
- newdeplibs=
- tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'`
- if test yes = "$allow_libtool_libs_with_static_runtimes"; then
- for i in $predeps $postdeps; do
- # can't use Xsed below, because $i might contain '/'
- tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s|$i||"`
- done
- fi
- case $tmp_deplibs in
- *[!\ \ ]*)
- echo
- if test none = "$deplibs_check_method"; then
- echo "*** Warning: inter-library dependencies are not supported in this platform."
- else
- echo "*** Warning: inter-library dependencies are not known to be supported."
- fi
- echo "*** All declared inter-library dependencies are being dropped."
- droppeddeps=yes
- ;;
- esac
- ;;
- esac
- versuffix=$versuffix_save
- major=$major_save
- release=$release_save
- libname=$libname_save
- name=$name_save
-
- case $host in
- *-*-rhapsody* | *-*-darwin1.[012])
- # On Rhapsody replace the C library with the System framework
- newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'`
- ;;
- esac
-
- if test yes = "$droppeddeps"; then
- if test yes = "$module"; then
- echo
- echo "*** Warning: libtool could not satisfy all declared inter-library"
- $ECHO "*** dependencies of module $libname. Therefore, libtool will create"
- echo "*** a static module, that should work as long as the dlopening"
- echo "*** application is linked with the -dlopen flag."
- if test -z "$global_symbol_pipe"; then
- echo
- echo "*** However, this would only work if libtool was able to extract symbol"
- echo "*** lists from a program, using 'nm' or equivalent, but libtool could"
- echo "*** not find such a program. So, this module is probably useless."
- echo "*** 'nm' from GNU binutils and a full rebuild may help."
- fi
- if test no = "$build_old_libs"; then
- oldlibs=$output_objdir/$libname.$libext
- build_libtool_libs=module
- build_old_libs=yes
- else
- build_libtool_libs=no
- fi
- else
- echo "*** The inter-library dependencies that have been dropped here will be"
- echo "*** automatically added whenever a program is linked with this library"
- echo "*** or is declared to -dlopen it."
-
- if test no = "$allow_undefined"; then
- echo
- echo "*** Since this library must not contain undefined symbols,"
- echo "*** because either the platform does not support them or"
- echo "*** it was explicitly requested with -no-undefined,"
- echo "*** libtool will only create a static version of it."
- if test no = "$build_old_libs"; then
- oldlibs=$output_objdir/$libname.$libext
- build_libtool_libs=module
- build_old_libs=yes
- else
- build_libtool_libs=no
- fi
- fi
- fi
- fi
- # Done checking deplibs!
- deplibs=$newdeplibs
- fi
- # Time to change all our "foo.ltframework" stuff back to "-framework foo"
- case $host in
- *-*-darwin*)
- newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
- new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
- deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
- ;;
- esac
-
- # move library search paths that coincide with paths to not yet
- # installed libraries to the beginning of the library search list
- new_libs=
- for path in $notinst_path; do
- case " $new_libs " in
- *" -L$path/$objdir "*) ;;
- *)
- case " $deplibs " in
- *" -L$path/$objdir "*)
- func_append new_libs " -L$path/$objdir" ;;
- esac
- ;;
- esac
- done
- for deplib in $deplibs; do
- case $deplib in
- -L*)
- case " $new_libs " in
- *" $deplib "*) ;;
- *) func_append new_libs " $deplib" ;;
- esac
- ;;
- *) func_append new_libs " $deplib" ;;
- esac
- done
- deplibs=$new_libs
-
- # All the library-specific variables (install_libdir is set above).
- library_names=
- old_library=
- dlname=
-
- # Test again, we may have decided not to build it any more
- if test yes = "$build_libtool_libs"; then
- # Remove $wl instances when linking with ld.
- # FIXME: should test the right _cmds variable.
- case $archive_cmds in
- *\$LD\ *) wl= ;;
- esac
- if test yes = "$hardcode_into_libs"; then
- # Hardcode the library paths
- hardcode_libdirs=
- dep_rpath=
- rpath=$finalize_rpath
- test relink = "$opt_mode" || rpath=$compile_rpath$rpath
- for libdir in $rpath; do
- if test -n "$hardcode_libdir_flag_spec"; then
- if test -n "$hardcode_libdir_separator"; then
- func_replace_sysroot "$libdir"
- libdir=$func_replace_sysroot_result
- if test -z "$hardcode_libdirs"; then
- hardcode_libdirs=$libdir
- else
- # Just accumulate the unique libdirs.
- case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
- *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
- ;;
- *)
- func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
- ;;
- esac
- fi
- else
- eval flag=\"$hardcode_libdir_flag_spec\"
- func_append dep_rpath " $flag"
- fi
- elif test -n "$runpath_var"; then
- case "$perm_rpath " in
- *" $libdir "*) ;;
- *) func_append perm_rpath " $libdir" ;;
- esac
- fi
- done
- # Substitute the hardcoded libdirs into the rpath.
- if test -n "$hardcode_libdir_separator" &&
- test -n "$hardcode_libdirs"; then
- libdir=$hardcode_libdirs
- eval "dep_rpath=\"$hardcode_libdir_flag_spec\""
- fi
- if test -n "$runpath_var" && test -n "$perm_rpath"; then
- # We should set the runpath_var.
- rpath=
- for dir in $perm_rpath; do
- func_append rpath "$dir:"
- done
- eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
- fi
- test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
- fi
-
- shlibpath=$finalize_shlibpath
- test relink = "$opt_mode" || shlibpath=$compile_shlibpath$shlibpath
- if test -n "$shlibpath"; then
- eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
- fi
-
- # Get the real and link names of the library.
- eval shared_ext=\"$shrext_cmds\"
- eval library_names=\"$library_names_spec\"
- set dummy $library_names
- shift
- realname=$1
- shift
-
- if test -n "$soname_spec"; then
- eval soname=\"$soname_spec\"
- else
- soname=$realname
- fi
- if test -z "$dlname"; then
- dlname=$soname
- fi
-
- lib=$output_objdir/$realname
- linknames=
- for link
- do
- func_append linknames " $link"
- done
-
- # Use standard objects if they are pic
- test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP`
- test "X$libobjs" = "X " && libobjs=
-
- delfiles=
- if test -n "$export_symbols" && test -n "$include_expsyms"; then
- $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp"
- export_symbols=$output_objdir/$libname.uexp
- func_append delfiles " $export_symbols"
- fi
-
- orig_export_symbols=
- case $host_os in
- cygwin* | mingw* | cegcc*)
- if test -n "$export_symbols" && test -z "$export_symbols_regex"; then
- # exporting using user supplied symfile
- func_dll_def_p "$export_symbols" || {
- # and it's NOT already a .def file. Must figure out
- # which of the given symbols are data symbols and tag
- # them as such. So, trigger use of export_symbols_cmds.
- # export_symbols gets reassigned inside the "prepare
- # the list of exported symbols" if statement, so the
- # include_expsyms logic still works.
- orig_export_symbols=$export_symbols
- export_symbols=
- always_export_symbols=yes
- }
- fi
- ;;
- esac
-
- # Prepare the list of exported symbols
- if test -z "$export_symbols"; then
- if test yes = "$always_export_symbols" || test -n "$export_symbols_regex"; then
- func_verbose "generating symbol list for '$libname.la'"
- export_symbols=$output_objdir/$libname.exp
- $opt_dry_run || $RM $export_symbols
- cmds=$export_symbols_cmds
- save_ifs=$IFS; IFS='~'
- for cmd1 in $cmds; do
- IFS=$save_ifs
- # Take the normal branch if the nm_file_list_spec branch
- # doesn't work or if tool conversion is not needed.
- case $nm_file_list_spec~$to_tool_file_cmd in
- *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*)
- try_normal_branch=yes
- eval cmd=\"$cmd1\"
- func_len " $cmd"
- len=$func_len_result
- ;;
- *)
- try_normal_branch=no
- ;;
- esac
- if test yes = "$try_normal_branch" \
- && { test "$len" -lt "$max_cmd_len" \
- || test "$max_cmd_len" -le -1; }
- then
- func_show_eval "$cmd" 'exit $?'
- skipped_export=false
- elif test -n "$nm_file_list_spec"; then
- func_basename "$output"
- output_la=$func_basename_result
- save_libobjs=$libobjs
- save_output=$output
- output=$output_objdir/$output_la.nm
- func_to_tool_file "$output"
- libobjs=$nm_file_list_spec$func_to_tool_file_result
- func_append delfiles " $output"
- func_verbose "creating $NM input file list: $output"
- for obj in $save_libobjs; do
- func_to_tool_file "$obj"
- $ECHO "$func_to_tool_file_result"
- done > "$output"
- eval cmd=\"$cmd1\"
- func_show_eval "$cmd" 'exit $?'
- output=$save_output
- libobjs=$save_libobjs
- skipped_export=false
- else
- # The command line is too long to execute in one step.
- func_verbose "using reloadable object file for export list..."
- skipped_export=:
- # Break out early, otherwise skipped_export may be
- # set to false by a later but shorter cmd.
- break
- fi
- done
- IFS=$save_ifs
- if test -n "$export_symbols_regex" && test : != "$skipped_export"; then
- func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
- func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
- fi
- fi
- fi
-
- if test -n "$export_symbols" && test -n "$include_expsyms"; then
- tmp_export_symbols=$export_symbols
- test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_symbols
- $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
- fi
-
- if test : != "$skipped_export" && test -n "$orig_export_symbols"; then
- # The given exports_symbols file has to be filtered, so filter it.
- func_verbose "filter symbol list for '$libname.la' to tag DATA exports"
- # FIXME: $output_objdir/$libname.filter potentially contains lots of
- # 's' commands, which not all seds can handle. GNU sed should be fine
- # though. Also, the filter scales superlinearly with the number of
- # global variables. join(1) would be nice here, but unfortunately
- # isn't a blessed tool.
- $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
- func_append delfiles " $export_symbols $output_objdir/$libname.filter"
- export_symbols=$output_objdir/$libname.def
- $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
- fi
-
- tmp_deplibs=
- for test_deplib in $deplibs; do
- case " $convenience " in
- *" $test_deplib "*) ;;
- *)
- func_append tmp_deplibs " $test_deplib"
- ;;
- esac
- done
- deplibs=$tmp_deplibs
-
- if test -n "$convenience"; then
- if test -n "$whole_archive_flag_spec" &&
- test yes = "$compiler_needs_object" &&
- test -z "$libobjs"; then
- # extract the archives, so we have objects to list.
- # TODO: could optimize this to just extract one archive.
- whole_archive_flag_spec=
- fi
- if test -n "$whole_archive_flag_spec"; then
- save_libobjs=$libobjs
- eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
- test "X$libobjs" = "X " && libobjs=
- else
- gentop=$output_objdir/${outputname}x
- func_append generated " $gentop"
-
- func_extract_archives $gentop $convenience
- func_append libobjs " $func_extract_archives_result"
- test "X$libobjs" = "X " && libobjs=
- fi
- fi
-
- if test yes = "$thread_safe" && test -n "$thread_safe_flag_spec"; then
- eval flag=\"$thread_safe_flag_spec\"
- func_append linker_flags " $flag"
- fi
-
- # Make a backup of the uninstalled library when relinking
- if test relink = "$opt_mode"; then
- $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $?
- fi
-
- # Do each of the archive commands.
- if test yes = "$module" && test -n "$module_cmds"; then
- if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
- eval test_cmds=\"$module_expsym_cmds\"
- cmds=$module_expsym_cmds
- else
- eval test_cmds=\"$module_cmds\"
- cmds=$module_cmds
- fi
- else
- if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
- eval test_cmds=\"$archive_expsym_cmds\"
- cmds=$archive_expsym_cmds
- else
- eval test_cmds=\"$archive_cmds\"
- cmds=$archive_cmds
- fi
- fi
-
- if test : != "$skipped_export" &&
- func_len " $test_cmds" &&
- len=$func_len_result &&
- test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
- :
- else
- # The command line is too long to link in one step, link piecewise
- # or, if using GNU ld and skipped_export is not :, use a linker
- # script.
-
- # Save the value of $output and $libobjs because we want to
- # use them later. If we have whole_archive_flag_spec, we
- # want to use save_libobjs as it was before
- # whole_archive_flag_spec was expanded, because we can't
- # assume the linker understands whole_archive_flag_spec.
- # This may have to be revisited, in case too many
- # convenience libraries get linked in and end up exceeding
- # the spec.
- if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
- save_libobjs=$libobjs
- fi
- save_output=$output
- func_basename "$output"
- output_la=$func_basename_result
-
- # Clear the reloadable object creation command queue and
- # initialize k to one.
- test_cmds=
- concat_cmds=
- objlist=
- last_robj=
- k=1
-
- if test -n "$save_libobjs" && test : != "$skipped_export" && test yes = "$with_gnu_ld"; then
- output=$output_objdir/$output_la.lnkscript
- func_verbose "creating GNU ld script: $output"
- echo 'INPUT (' > $output
- for obj in $save_libobjs
- do
- func_to_tool_file "$obj"
- $ECHO "$func_to_tool_file_result" >> $output
- done
- echo ')' >> $output
- func_append delfiles " $output"
- func_to_tool_file "$output"
- output=$func_to_tool_file_result
- elif test -n "$save_libobjs" && test : != "$skipped_export" && test -n "$file_list_spec"; then
- output=$output_objdir/$output_la.lnk
- func_verbose "creating linker input file list: $output"
- : > $output
- set x $save_libobjs
- shift
- firstobj=
- if test yes = "$compiler_needs_object"; then
- firstobj="$1 "
- shift
- fi
- for obj
- do
- func_to_tool_file "$obj"
- $ECHO "$func_to_tool_file_result" >> $output
- done
- func_append delfiles " $output"
- func_to_tool_file "$output"
- output=$firstobj\"$file_list_spec$func_to_tool_file_result\"
- else
- if test -n "$save_libobjs"; then
- func_verbose "creating reloadable object files..."
- output=$output_objdir/$output_la-$k.$objext
- eval test_cmds=\"$reload_cmds\"
- func_len " $test_cmds"
- len0=$func_len_result
- len=$len0
-
- # Loop over the list of objects to be linked.
- for obj in $save_libobjs
- do
- func_len " $obj"
- func_arith $len + $func_len_result
- len=$func_arith_result
- if test -z "$objlist" ||
- test "$len" -lt "$max_cmd_len"; then
- func_append objlist " $obj"
- else
- # The command $test_cmds is almost too long, add a
- # command to the queue.
- if test 1 -eq "$k"; then
- # The first file doesn't have a previous command to add.
- reload_objs=$objlist
- eval concat_cmds=\"$reload_cmds\"
- else
- # All subsequent reloadable object files will link in
- # the last one created.
- reload_objs="$objlist $last_robj"
- eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\"
- fi
- last_robj=$output_objdir/$output_la-$k.$objext
- func_arith $k + 1
- k=$func_arith_result
- output=$output_objdir/$output_la-$k.$objext
- objlist=" $obj"
- func_len " $last_robj"
- func_arith $len0 + $func_len_result
- len=$func_arith_result
- fi
- done
- # Handle the remaining objects by creating one last
- # reloadable object file. All subsequent reloadable object
- # files will link in the last one created.
- test -z "$concat_cmds" || concat_cmds=$concat_cmds~
- reload_objs="$objlist $last_robj"
- eval concat_cmds=\"\$concat_cmds$reload_cmds\"
- if test -n "$last_robj"; then
- eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\"
- fi
- func_append delfiles " $output"
-
- else
- output=
- fi
-
- ${skipped_export-false} && {
- func_verbose "generating symbol list for '$libname.la'"
- export_symbols=$output_objdir/$libname.exp
- $opt_dry_run || $RM $export_symbols
- libobjs=$output
- # Append the command to create the export file.
- test -z "$concat_cmds" || concat_cmds=$concat_cmds~
- eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\"
- if test -n "$last_robj"; then
- eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\"
- fi
- }
-
- test -n "$save_libobjs" &&
- func_verbose "creating a temporary reloadable object file: $output"
-
- # Loop through the commands generated above and execute them.
- save_ifs=$IFS; IFS='~'
- for cmd in $concat_cmds; do
- IFS=$save_ifs
- $opt_quiet || {
- func_quote_for_expand "$cmd"
- eval "func_echo $func_quote_for_expand_result"
- }
- $opt_dry_run || eval "$cmd" || {
- lt_exit=$?
-
- # Restore the uninstalled library and exit
- if test relink = "$opt_mode"; then
- ( cd "$output_objdir" && \
- $RM "${realname}T" && \
- $MV "${realname}U" "$realname" )
- fi
-
- exit $lt_exit
- }
- done
- IFS=$save_ifs
-
- if test -n "$export_symbols_regex" && ${skipped_export-false}; then
- func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
- func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
- fi
- fi
-
- ${skipped_export-false} && {
- if test -n "$export_symbols" && test -n "$include_expsyms"; then
- tmp_export_symbols=$export_symbols
- test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_symbols
- $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
- fi
-
- if test -n "$orig_export_symbols"; then
- # The given exports_symbols file has to be filtered, so filter it.
- func_verbose "filter symbol list for '$libname.la' to tag DATA exports"
- # FIXME: $output_objdir/$libname.filter potentially contains lots of
- # 's' commands, which not all seds can handle. GNU sed should be fine
- # though. Also, the filter scales superlinearly with the number of
- # global variables. join(1) would be nice here, but unfortunately
- # isn't a blessed tool.
- $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
- func_append delfiles " $export_symbols $output_objdir/$libname.filter"
- export_symbols=$output_objdir/$libname.def
- $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
- fi
- }
-
- libobjs=$output
- # Restore the value of output.
- output=$save_output
-
- if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
- eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
- test "X$libobjs" = "X " && libobjs=
- fi
- # Expand the library linking commands again to reset the
- # value of $libobjs for piecewise linking.
-
- # Do each of the archive commands.
- if test yes = "$module" && test -n "$module_cmds"; then
- if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
- cmds=$module_expsym_cmds
- else
- cmds=$module_cmds
- fi
- else
- if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
- cmds=$archive_expsym_cmds
- else
- cmds=$archive_cmds
- fi
- fi
- fi
-
- if test -n "$delfiles"; then
- # Append the command to remove temporary files to $cmds.
- eval cmds=\"\$cmds~\$RM $delfiles\"
- fi
-
- # Add any objects from preloaded convenience libraries
- if test -n "$dlprefiles"; then
- gentop=$output_objdir/${outputname}x
- func_append generated " $gentop"
-
- func_extract_archives $gentop $dlprefiles
- func_append libobjs " $func_extract_archives_result"
- test "X$libobjs" = "X " && libobjs=
- fi
-
- save_ifs=$IFS; IFS='~'
- for cmd in $cmds; do
- IFS=$sp$nl
- eval cmd=\"$cmd\"
- IFS=$save_ifs
- $opt_quiet || {
- func_quote_for_expand "$cmd"
- eval "func_echo $func_quote_for_expand_result"
- }
- $opt_dry_run || eval "$cmd" || {
- lt_exit=$?
-
- # Restore the uninstalled library and exit
- if test relink = "$opt_mode"; then
- ( cd "$output_objdir" && \
- $RM "${realname}T" && \
- $MV "${realname}U" "$realname" )
- fi
-
- exit $lt_exit
- }
- done
- IFS=$save_ifs
-
- # Restore the uninstalled library and exit
- if test relink = "$opt_mode"; then
- $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $?
-
- if test -n "$convenience"; then
- if test -z "$whole_archive_flag_spec"; then
- func_show_eval '${RM}r "$gentop"'
- fi
- fi
-
- exit $EXIT_SUCCESS
- fi
-
- # Create links to the real library.
- for linkname in $linknames; do
- if test "$realname" != "$linkname"; then
- func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?'
- fi
- done
-
- # If -module or -export-dynamic was specified, set the dlname.
- if test yes = "$module" || test yes = "$export_dynamic"; then
- # On all known operating systems, these are identical.
- dlname=$soname
- fi
- fi
- ;;
-
- obj)
- if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then
- func_warning "'-dlopen' is ignored for objects"
- fi
-
- case " $deplibs" in
- *\ -l* | *\ -L*)
- func_warning "'-l' and '-L' are ignored for objects" ;;
- esac
-
- test -n "$rpath" && \
- func_warning "'-rpath' is ignored for objects"
-
- test -n "$xrpath" && \
- func_warning "'-R' is ignored for objects"
-
- test -n "$vinfo" && \
- func_warning "'-version-info' is ignored for objects"
-
- test -n "$release" && \
- func_warning "'-release' is ignored for objects"
-
- case $output in
- *.lo)
- test -n "$objs$old_deplibs" && \
- func_fatal_error "cannot build library object '$output' from non-libtool objects"
-
- libobj=$output
- func_lo2o "$libobj"
- obj=$func_lo2o_result
- ;;
- *)
- libobj=
- obj=$output
- ;;
- esac
-
- # Delete the old objects.
- $opt_dry_run || $RM $obj $libobj
-
- # Objects from convenience libraries. This assumes
- # single-version convenience libraries. Whenever we create
- # different ones for PIC/non-PIC, this we'll have to duplicate
- # the extraction.
- reload_conv_objs=
- gentop=
- # reload_cmds runs $LD directly, so let us get rid of
- # -Wl from whole_archive_flag_spec and hope we can get by with
- # turning comma into space..
- wl=
-
- if test -n "$convenience"; then
- if test -n "$whole_archive_flag_spec"; then
- eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\"
- reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'`
- else
- gentop=$output_objdir/${obj}x
- func_append generated " $gentop"
-
- func_extract_archives $gentop $convenience
- reload_conv_objs="$reload_objs $func_extract_archives_result"
- fi
- fi
-
- # If we're not building shared, we need to use non_pic_objs
- test yes = "$build_libtool_libs" || libobjs=$non_pic_objects
-
- # Create the old-style object.
- reload_objs=$objs$old_deplibs' '`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; /\.lib$/d; $lo2o" | $NL2SP`' '$reload_conv_objs
-
- output=$obj
- func_execute_cmds "$reload_cmds" 'exit $?'
-
- # Exit if we aren't doing a library object file.
- if test -z "$libobj"; then
- if test -n "$gentop"; then
- func_show_eval '${RM}r "$gentop"'
- fi
-
- exit $EXIT_SUCCESS
- fi
-
- test yes = "$build_libtool_libs" || {
- if test -n "$gentop"; then
- func_show_eval '${RM}r "$gentop"'
- fi
-
- # Create an invalid libtool object if no PIC, so that we don't
- # accidentally link it into a program.
- # $show "echo timestamp > $libobj"
- # $opt_dry_run || eval "echo timestamp > $libobj" || exit $?
- exit $EXIT_SUCCESS
- }
-
- if test -n "$pic_flag" || test default != "$pic_mode"; then
- # Only do commands if we really have different PIC objects.
- reload_objs="$libobjs $reload_conv_objs"
- output=$libobj
- func_execute_cmds "$reload_cmds" 'exit $?'
- fi
-
- if test -n "$gentop"; then
- func_show_eval '${RM}r "$gentop"'
- fi
-
- exit $EXIT_SUCCESS
- ;;
-
- prog)
- case $host in
- *cygwin*) func_stripname '' '.exe' "$output"
- output=$func_stripname_result.exe;;
- esac
- test -n "$vinfo" && \
- func_warning "'-version-info' is ignored for programs"
-
- test -n "$release" && \
- func_warning "'-release' is ignored for programs"
-
- $preload \
- && test unknown,unknown,unknown = "$dlopen_support,$dlopen_self,$dlopen_self_static" \
- && func_warning "'LT_INIT([dlopen])' not used. Assuming no dlopen support."
-
- case $host in
- *-*-rhapsody* | *-*-darwin1.[012])
- # On Rhapsody replace the C library is the System framework
- compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'`
- finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'`
- ;;
- esac
-
- case $host in
- *-*-darwin*)
- # Don't allow lazy linking, it breaks C++ global constructors
- # But is supposedly fixed on 10.4 or later (yay!).
- if test CXX = "$tagname"; then
- case ${MACOSX_DEPLOYMENT_TARGET-10.0} in
- 10.[0123])
- func_append compile_command " $wl-bind_at_load"
- func_append finalize_command " $wl-bind_at_load"
- ;;
- esac
- fi
- # Time to change all our "foo.ltframework" stuff back to "-framework foo"
- compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
- finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
- ;;
- esac
-
-
- # move library search paths that coincide with paths to not yet
- # installed libraries to the beginning of the library search list
- new_libs=
- for path in $notinst_path; do
- case " $new_libs " in
- *" -L$path/$objdir "*) ;;
- *)
- case " $compile_deplibs " in
- *" -L$path/$objdir "*)
- func_append new_libs " -L$path/$objdir" ;;
- esac
- ;;
- esac
- done
- for deplib in $compile_deplibs; do
- case $deplib in
- -L*)
- case " $new_libs " in
- *" $deplib "*) ;;
- *) func_append new_libs " $deplib" ;;
- esac
- ;;
- *) func_append new_libs " $deplib" ;;
- esac
- done
- compile_deplibs=$new_libs
-
-
- func_append compile_command " $compile_deplibs"
- func_append finalize_command " $finalize_deplibs"
-
- if test -n "$rpath$xrpath"; then
- # If the user specified any rpath flags, then add them.
- for libdir in $rpath $xrpath; do
- # This is the magic to use -rpath.
- case "$finalize_rpath " in
- *" $libdir "*) ;;
- *) func_append finalize_rpath " $libdir" ;;
- esac
- done
- fi
-
- # Now hardcode the library paths
- rpath=
- hardcode_libdirs=
- for libdir in $compile_rpath $finalize_rpath; do
- if test -n "$hardcode_libdir_flag_spec"; then
- if test -n "$hardcode_libdir_separator"; then
- if test -z "$hardcode_libdirs"; then
- hardcode_libdirs=$libdir
- else
- # Just accumulate the unique libdirs.
- case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
- *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
- ;;
- *)
- func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
- ;;
- esac
- fi
- else
- eval flag=\"$hardcode_libdir_flag_spec\"
- func_append rpath " $flag"
- fi
- elif test -n "$runpath_var"; then
- case "$perm_rpath " in
- *" $libdir "*) ;;
- *) func_append perm_rpath " $libdir" ;;
- esac
- fi
- case $host in
- *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
- testbindir=`$ECHO "$libdir" | $SED -e 's*/lib$*/bin*'`
- case :$dllsearchpath: in
- *":$libdir:"*) ;;
- ::) dllsearchpath=$libdir;;
- *) func_append dllsearchpath ":$libdir";;
- esac
- case :$dllsearchpath: in
- *":$testbindir:"*) ;;
- ::) dllsearchpath=$testbindir;;
- *) func_append dllsearchpath ":$testbindir";;
- esac
- ;;
- esac
- done
- # Substitute the hardcoded libdirs into the rpath.
- if test -n "$hardcode_libdir_separator" &&
- test -n "$hardcode_libdirs"; then
- libdir=$hardcode_libdirs
- eval rpath=\" $hardcode_libdir_flag_spec\"
- fi
- compile_rpath=$rpath
-
- rpath=
- hardcode_libdirs=
- for libdir in $finalize_rpath; do
- if test -n "$hardcode_libdir_flag_spec"; then
- if test -n "$hardcode_libdir_separator"; then
- if test -z "$hardcode_libdirs"; then
- hardcode_libdirs=$libdir
- else
- # Just accumulate the unique libdirs.
- case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
- *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
- ;;
- *)
- func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
- ;;
- esac
- fi
- else
- eval flag=\"$hardcode_libdir_flag_spec\"
- func_append rpath " $flag"
- fi
- elif test -n "$runpath_var"; then
- case "$finalize_perm_rpath " in
- *" $libdir "*) ;;
- *) func_append finalize_perm_rpath " $libdir" ;;
- esac
- fi
- done
- # Substitute the hardcoded libdirs into the rpath.
- if test -n "$hardcode_libdir_separator" &&
- test -n "$hardcode_libdirs"; then
- libdir=$hardcode_libdirs
- eval rpath=\" $hardcode_libdir_flag_spec\"
- fi
- finalize_rpath=$rpath
-
- if test -n "$libobjs" && test yes = "$build_old_libs"; then
- # Transform all the library objects into standard objects.
- compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
- finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
- fi
-
- func_generate_dlsyms "$outputname" "@PROGRAM@" false
-
- # template prelinking step
- if test -n "$prelink_cmds"; then
- func_execute_cmds "$prelink_cmds" 'exit $?'
- fi
-
- wrappers_required=:
- case $host in
- *cegcc* | *mingw32ce*)
- # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway.
- wrappers_required=false
- ;;
- *cygwin* | *mingw* )
- test yes = "$build_libtool_libs" || wrappers_required=false
- ;;
- *)
- if test no = "$need_relink" || test yes != "$build_libtool_libs"; then
- wrappers_required=false
- fi
- ;;
- esac
- $wrappers_required || {
- # Replace the output file specification.
- compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
- link_command=$compile_command$compile_rpath
-
- # We have no uninstalled library dependencies, so finalize right now.
- exit_status=0
- func_show_eval "$link_command" 'exit_status=$?'
-
- if test -n "$postlink_cmds"; then
- func_to_tool_file "$output"
- postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
- func_execute_cmds "$postlink_cmds" 'exit $?'
- fi
-
- # Delete the generated files.
- if test -f "$output_objdir/${outputname}S.$objext"; then
- func_show_eval '$RM "$output_objdir/${outputname}S.$objext"'
- fi
-
- exit $exit_status
- }
-
- if test -n "$compile_shlibpath$finalize_shlibpath"; then
- compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
- fi
- if test -n "$finalize_shlibpath"; then
- finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
- fi
-
- compile_var=
- finalize_var=
- if test -n "$runpath_var"; then
- if test -n "$perm_rpath"; then
- # We should set the runpath_var.
- rpath=
- for dir in $perm_rpath; do
- func_append rpath "$dir:"
- done
- compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
- fi
- if test -n "$finalize_perm_rpath"; then
- # We should set the runpath_var.
- rpath=
- for dir in $finalize_perm_rpath; do
- func_append rpath "$dir:"
- done
- finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
- fi
- fi
-
- if test yes = "$no_install"; then
- # We don't need to create a wrapper script.
- link_command=$compile_var$compile_command$compile_rpath
- # Replace the output file specification.
- link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
- # Delete the old output file.
- $opt_dry_run || $RM $output
- # Link the executable and exit
- func_show_eval "$link_command" 'exit $?'
-
- if test -n "$postlink_cmds"; then
- func_to_tool_file "$output"
- postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
- func_execute_cmds "$postlink_cmds" 'exit $?'
- fi
-
- exit $EXIT_SUCCESS
- fi
-
- case $hardcode_action,$fast_install in
- relink,*)
- # Fast installation is not supported
- link_command=$compile_var$compile_command$compile_rpath
- relink_command=$finalize_var$finalize_command$finalize_rpath
-
- func_warning "this platform does not like uninstalled shared libraries"
- func_warning "'$output' will be relinked during installation"
- ;;
- *,yes)
- link_command=$finalize_var$compile_command$finalize_rpath
- relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'`
- ;;
- *,no)
- link_command=$compile_var$compile_command$compile_rpath
- relink_command=$finalize_var$finalize_command$finalize_rpath
- ;;
- *,needless)
- link_command=$finalize_var$compile_command$finalize_rpath
- relink_command=
- ;;
- esac
-
- # Replace the output file specification.
- link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
-
- # Delete the old output files.
- $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname
-
- func_show_eval "$link_command" 'exit $?'
-
- if test -n "$postlink_cmds"; then
- func_to_tool_file "$output_objdir/$outputname"
- postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
- func_execute_cmds "$postlink_cmds" 'exit $?'
- fi
-
- # Now create the wrapper script.
- func_verbose "creating $output"
-
- # Quote the relink command for shipping.
- if test -n "$relink_command"; then
- # Preserve any variables that may affect compiler behavior
- for var in $variables_saved_for_relink; do
- if eval test -z \"\${$var+set}\"; then
- relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
- elif eval var_value=\$$var; test -z "$var_value"; then
- relink_command="$var=; export $var; $relink_command"
- else
- func_quote_for_eval "$var_value"
- relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
- fi
- done
- relink_command="(cd `pwd`; $relink_command)"
- relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
- fi
-
- # Only actually do things if not in dry run mode.
- $opt_dry_run || {
- # win32 will think the script is a binary if it has
- # a .exe suffix, so we strip it off here.
- case $output in
- *.exe) func_stripname '' '.exe' "$output"
- output=$func_stripname_result ;;
- esac
- # test for cygwin because mv fails w/o .exe extensions
- case $host in
- *cygwin*)
- exeext=.exe
- func_stripname '' '.exe' "$outputname"
- outputname=$func_stripname_result ;;
- *) exeext= ;;
- esac
- case $host in
- *cygwin* | *mingw* )
- func_dirname_and_basename "$output" "" "."
- output_name=$func_basename_result
- output_path=$func_dirname_result
- cwrappersource=$output_path/$objdir/lt-$output_name.c
- cwrapper=$output_path/$output_name.exe
- $RM $cwrappersource $cwrapper
- trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
-
- func_emit_cwrapperexe_src > $cwrappersource
-
- # The wrapper executable is built using the $host compiler,
- # because it contains $host paths and files. If cross-
- # compiling, it, like the target executable, must be
- # executed on the $host or under an emulation environment.
- $opt_dry_run || {
- $LTCC $LTCFLAGS -o $cwrapper $cwrappersource
- $STRIP $cwrapper
- }
-
- # Now, create the wrapper script for func_source use:
- func_ltwrapper_scriptname $cwrapper
- $RM $func_ltwrapper_scriptname_result
- trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15
- $opt_dry_run || {
- # note: this script will not be executed, so do not chmod.
- if test "x$build" = "x$host"; then
- $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result
- else
- func_emit_wrapper no > $func_ltwrapper_scriptname_result
- fi
- }
- ;;
- * )
- $RM $output
- trap "$RM $output; exit $EXIT_FAILURE" 1 2 15
-
- func_emit_wrapper no > $output
- chmod +x $output
- ;;
- esac
- }
- exit $EXIT_SUCCESS
- ;;
- esac
-
- # See if we need to build an old-fashioned archive.
- for oldlib in $oldlibs; do
-
- case $build_libtool_libs in
- convenience)
- oldobjs="$libobjs_save $symfileobj"
- addlibs=$convenience
- build_libtool_libs=no
- ;;
- module)
- oldobjs=$libobjs_save
- addlibs=$old_convenience
- build_libtool_libs=no
- ;;
- *)
- oldobjs="$old_deplibs $non_pic_objects"
- $preload && test -f "$symfileobj" \
- && func_append oldobjs " $symfileobj"
- addlibs=$old_convenience
- ;;
- esac
-
- if test -n "$addlibs"; then
- gentop=$output_objdir/${outputname}x
- func_append generated " $gentop"
-
- func_extract_archives $gentop $addlibs
- func_append oldobjs " $func_extract_archives_result"
- fi
-
- # Do each command in the archive commands.
- if test -n "$old_archive_from_new_cmds" && test yes = "$build_libtool_libs"; then
- cmds=$old_archive_from_new_cmds
- else
-
- # Add any objects from preloaded convenience libraries
- if test -n "$dlprefiles"; then
- gentop=$output_objdir/${outputname}x
- func_append generated " $gentop"
-
- func_extract_archives $gentop $dlprefiles
- func_append oldobjs " $func_extract_archives_result"
- fi
-
- # POSIX demands no paths to be encoded in archives. We have
- # to avoid creating archives with duplicate basenames if we
- # might have to extract them afterwards, e.g., when creating a
- # static archive out of a convenience library, or when linking
- # the entirety of a libtool archive into another (currently
- # not supported by libtool).
- if (for obj in $oldobjs
- do
- func_basename "$obj"
- $ECHO "$func_basename_result"
- done | sort | sort -uc >/dev/null 2>&1); then
- :
- else
- echo "copying selected object files to avoid basename conflicts..."
- gentop=$output_objdir/${outputname}x
- func_append generated " $gentop"
- func_mkdir_p "$gentop"
- save_oldobjs=$oldobjs
- oldobjs=
- counter=1
- for obj in $save_oldobjs
- do
- func_basename "$obj"
- objbase=$func_basename_result
- case " $oldobjs " in
- " ") oldobjs=$obj ;;
- *[\ /]"$objbase "*)
- while :; do
- # Make sure we don't pick an alternate name that also
- # overlaps.
- newobj=lt$counter-$objbase
- func_arith $counter + 1
- counter=$func_arith_result
- case " $oldobjs " in
- *[\ /]"$newobj "*) ;;
- *) if test ! -f "$gentop/$newobj"; then break; fi ;;
- esac
- done
- func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
- func_append oldobjs " $gentop/$newobj"
- ;;
- *) func_append oldobjs " $obj" ;;
- esac
- done
- fi
- func_to_tool_file "$oldlib" func_convert_file_msys_to_w32
- tool_oldlib=$func_to_tool_file_result
- eval cmds=\"$old_archive_cmds\"
-
- func_len " $cmds"
- len=$func_len_result
- if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
- cmds=$old_archive_cmds
- elif test -n "$archiver_list_spec"; then
- func_verbose "using command file archive linking..."
- for obj in $oldobjs
- do
- func_to_tool_file "$obj"
- $ECHO "$func_to_tool_file_result"
- done > $output_objdir/$libname.libcmd
- func_to_tool_file "$output_objdir/$libname.libcmd"
- oldobjs=" $archiver_list_spec$func_to_tool_file_result"
- cmds=$old_archive_cmds
- else
- # the command line is too long to link in one step, link in parts
- func_verbose "using piecewise archive linking..."
- save_RANLIB=$RANLIB
- RANLIB=:
- objlist=
- concat_cmds=
- save_oldobjs=$oldobjs
- oldobjs=
- # Is there a better way of finding the last object in the list?
- for obj in $save_oldobjs
- do
- last_oldobj=$obj
- done
- eval test_cmds=\"$old_archive_cmds\"
- func_len " $test_cmds"
- len0=$func_len_result
- len=$len0
- for obj in $save_oldobjs
- do
- func_len " $obj"
- func_arith $len + $func_len_result
- len=$func_arith_result
- func_append objlist " $obj"
- if test "$len" -lt "$max_cmd_len"; then
- :
- else
- # the above command should be used before it gets too long
- oldobjs=$objlist
- if test "$obj" = "$last_oldobj"; then
- RANLIB=$save_RANLIB
- fi
- test -z "$concat_cmds" || concat_cmds=$concat_cmds~
- eval concat_cmds=\"\$concat_cmds$old_archive_cmds\"
- objlist=
- len=$len0
- fi
- done
- RANLIB=$save_RANLIB
- oldobjs=$objlist
- if test -z "$oldobjs"; then
- eval cmds=\"\$concat_cmds\"
- else
- eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
- fi
- fi
- fi
- func_execute_cmds "$cmds" 'exit $?'
- done
-
- test -n "$generated" && \
- func_show_eval "${RM}r$generated"
-
- # Now create the libtool archive.
- case $output in
- *.la)
- old_library=
- test yes = "$build_old_libs" && old_library=$libname.$libext
- func_verbose "creating $output"
-
- # Preserve any variables that may affect compiler behavior
- for var in $variables_saved_for_relink; do
- if eval test -z \"\${$var+set}\"; then
- relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
- elif eval var_value=\$$var; test -z "$var_value"; then
- relink_command="$var=; export $var; $relink_command"
- else
- func_quote_for_eval "$var_value"
- relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
- fi
- done
- # Quote the link command for shipping.
- relink_command="(cd `pwd`; $SHELL \"$progpath\" $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
- relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
- if test yes = "$hardcode_automatic"; then
- relink_command=
- fi
-
- # Only create the output if not a dry run.
- $opt_dry_run || {
- for installed in no yes; do
- if test yes = "$installed"; then
- if test -z "$install_libdir"; then
- break
- fi
- output=$output_objdir/${outputname}i
- # Replace all uninstalled libtool libraries with the installed ones
- newdependency_libs=
- for deplib in $dependency_libs; do
- case $deplib in
- *.la)
- func_basename "$deplib"
- name=$func_basename_result
- func_resolve_sysroot "$deplib"
- eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result`
- test -z "$libdir" && \
- func_fatal_error "'$deplib' is not a valid libtool archive"
- func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name"
- ;;
- -L*)
- func_stripname -L '' "$deplib"
- func_replace_sysroot "$func_stripname_result"
- func_append newdependency_libs " -L$func_replace_sysroot_result"
- ;;
- -R*)
- func_stripname -R '' "$deplib"
- func_replace_sysroot "$func_stripname_result"
- func_append newdependency_libs " -R$func_replace_sysroot_result"
- ;;
- *) func_append newdependency_libs " $deplib" ;;
- esac
- done
- dependency_libs=$newdependency_libs
- newdlfiles=
-
- for lib in $dlfiles; do
- case $lib in
- *.la)
- func_basename "$lib"
- name=$func_basename_result
- eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
- test -z "$libdir" && \
- func_fatal_error "'$lib' is not a valid libtool archive"
- func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name"
- ;;
- *) func_append newdlfiles " $lib" ;;
- esac
- done
- dlfiles=$newdlfiles
- newdlprefiles=
- for lib in $dlprefiles; do
- case $lib in
- *.la)
- # Only pass preopened files to the pseudo-archive (for
- # eventual linking with the app. that links it) if we
- # didn't already link the preopened objects directly into
- # the library:
- func_basename "$lib"
- name=$func_basename_result
- eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
- test -z "$libdir" && \
- func_fatal_error "'$lib' is not a valid libtool archive"
- func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name"
- ;;
- esac
- done
- dlprefiles=$newdlprefiles
- else
- newdlfiles=
- for lib in $dlfiles; do
- case $lib in
- [\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;;
- *) abs=`pwd`"/$lib" ;;
- esac
- func_append newdlfiles " $abs"
- done
- dlfiles=$newdlfiles
- newdlprefiles=
- for lib in $dlprefiles; do
- case $lib in
- [\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;;
- *) abs=`pwd`"/$lib" ;;
- esac
- func_append newdlprefiles " $abs"
- done
- dlprefiles=$newdlprefiles
- fi
- $RM $output
- # place dlname in correct position for cygwin
- # In fact, it would be nice if we could use this code for all target
- # systems that can't hard-code library paths into their executables
- # and that have no shared library path variable independent of PATH,
- # but it turns out we can't easily determine that from inspecting
- # libtool variables, so we have to hard-code the OSs to which it
- # applies here; at the moment, that means platforms that use the PE
- # object format with DLL files. See the long comment at the top of
- # tests/bindir.at for full details.
- tdlname=$dlname
- case $host,$output,$installed,$module,$dlname in
- *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll)
- # If a -bindir argument was supplied, place the dll there.
- if test -n "$bindir"; then
- func_relative_path "$install_libdir" "$bindir"
- tdlname=$func_relative_path_result/$dlname
- else
- # Otherwise fall back on heuristic.
- tdlname=../bin/$dlname
- fi
- ;;
- esac
- $ECHO > $output "\
-# $outputname - a libtool library file
-# Generated by $PROGRAM (GNU $PACKAGE) $VERSION
-#
-# Please DO NOT delete this file!
-# It is necessary for linking the library.
-
-# The name that we can dlopen(3).
-dlname='$tdlname'
-
-# Names of this library.
-library_names='$library_names'
-
-# The name of the static archive.
-old_library='$old_library'
-
-# Linker flags that cannot go in dependency_libs.
-inherited_linker_flags='$new_inherited_linker_flags'
-
-# Libraries that this one depends upon.
-dependency_libs='$dependency_libs'
-
-# Names of additional weak libraries provided by this library
-weak_library_names='$weak_libs'
-
-# Version information for $libname.
-current=$current
-age=$age
-revision=$revision
-
-# Is this an already installed library?
-installed=$installed
-
-# Should we warn about portability when linking against -modules?
-shouldnotlink=$module
-
-# Files to dlopen/dlpreopen
-dlopen='$dlfiles'
-dlpreopen='$dlprefiles'
-
-# Directory that this library needs to be installed in:
-libdir='$install_libdir'"
- if test no,yes = "$installed,$need_relink"; then
- $ECHO >> $output "\
-relink_command=\"$relink_command\""
- fi
- done
- }
-
- # Do a symbolic link so that the libtool archive can be found in
- # LD_LIBRARY_PATH before the program is installed.
- func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?'
- ;;
- esac
- exit $EXIT_SUCCESS
-}
-
-if test link = "$opt_mode" || test relink = "$opt_mode"; then
- func_mode_link ${1+"$@"}
-fi
-
-
-# func_mode_uninstall arg...
-func_mode_uninstall ()
-{
- $debug_cmd
-
- RM=$nonopt
- files=
- rmforce=false
- exit_status=0
-
- # This variable tells wrapper scripts just to set variables rather
- # than running their programs.
- libtool_install_magic=$magic
-
- for arg
- do
- case $arg in
- -f) func_append RM " $arg"; rmforce=: ;;
- -*) func_append RM " $arg" ;;
- *) func_append files " $arg" ;;
- esac
- done
-
- test -z "$RM" && \
- func_fatal_help "you must specify an RM program"
-
- rmdirs=
-
- for file in $files; do
- func_dirname "$file" "" "."
- dir=$func_dirname_result
- if test . = "$dir"; then
- odir=$objdir
- else
- odir=$dir/$objdir
- fi
- func_basename "$file"
- name=$func_basename_result
- test uninstall = "$opt_mode" && odir=$dir
-
- # Remember odir for removal later, being careful to avoid duplicates
- if test clean = "$opt_mode"; then
- case " $rmdirs " in
- *" $odir "*) ;;
- *) func_append rmdirs " $odir" ;;
- esac
- fi
-
- # Don't error if the file doesn't exist and rm -f was used.
- if { test -L "$file"; } >/dev/null 2>&1 ||
- { test -h "$file"; } >/dev/null 2>&1 ||
- test -f "$file"; then
- :
- elif test -d "$file"; then
- exit_status=1
- continue
- elif $rmforce; then
- continue
- fi
-
- rmfiles=$file
-
- case $name in
- *.la)
- # Possibly a libtool archive, so verify it.
- if func_lalib_p "$file"; then
- func_source $dir/$name
-
- # Delete the libtool libraries and symlinks.
- for n in $library_names; do
- func_append rmfiles " $odir/$n"
- done
- test -n "$old_library" && func_append rmfiles " $odir/$old_library"
-
- case $opt_mode in
- clean)
- case " $library_names " in
- *" $dlname "*) ;;
- *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;;
- esac
- test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i"
- ;;
- uninstall)
- if test -n "$library_names"; then
- # Do each command in the postuninstall commands.
- func_execute_cmds "$postuninstall_cmds" '$rmforce || exit_status=1'
- fi
-
- if test -n "$old_library"; then
- # Do each command in the old_postuninstall commands.
- func_execute_cmds "$old_postuninstall_cmds" '$rmforce || exit_status=1'
- fi
- # FIXME: should reinstall the best remaining shared library.
- ;;
- esac
- fi
- ;;
-
- *.lo)
- # Possibly a libtool object, so verify it.
- if func_lalib_p "$file"; then
-
- # Read the .lo file
- func_source $dir/$name
-
- # Add PIC object to the list of files to remove.
- if test -n "$pic_object" && test none != "$pic_object"; then
- func_append rmfiles " $dir/$pic_object"
- fi
-
- # Add non-PIC object to the list of files to remove.
- if test -n "$non_pic_object" && test none != "$non_pic_object"; then
- func_append rmfiles " $dir/$non_pic_object"
- fi
- fi
- ;;
-
- *)
- if test clean = "$opt_mode"; then
- noexename=$name
- case $file in
- *.exe)
- func_stripname '' '.exe' "$file"
- file=$func_stripname_result
- func_stripname '' '.exe' "$name"
- noexename=$func_stripname_result
- # $file with .exe has already been added to rmfiles,
- # add $file without .exe
- func_append rmfiles " $file"
- ;;
- esac
- # Do a test to see if this is a libtool program.
- if func_ltwrapper_p "$file"; then
- if func_ltwrapper_executable_p "$file"; then
- func_ltwrapper_scriptname "$file"
- relink_command=
- func_source $func_ltwrapper_scriptname_result
- func_append rmfiles " $func_ltwrapper_scriptname_result"
- else
- relink_command=
- func_source $dir/$noexename
- fi
-
- # note $name still contains .exe if it was in $file originally
- # as does the version of $file that was added into $rmfiles
- func_append rmfiles " $odir/$name $odir/${name}S.$objext"
- if test yes = "$fast_install" && test -n "$relink_command"; then
- func_append rmfiles " $odir/lt-$name"
- fi
- if test "X$noexename" != "X$name"; then
- func_append rmfiles " $odir/lt-$noexename.c"
- fi
- fi
- fi
- ;;
- esac
- func_show_eval "$RM $rmfiles" 'exit_status=1'
- done
-
- # Try to remove the $objdir's in the directories where we deleted files
- for dir in $rmdirs; do
- if test -d "$dir"; then
- func_show_eval "rmdir $dir >/dev/null 2>&1"
- fi
- done
-
- exit $exit_status
-}
-
-if test uninstall = "$opt_mode" || test clean = "$opt_mode"; then
- func_mode_uninstall ${1+"$@"}
-fi
-
-test -z "$opt_mode" && {
- help=$generic_help
- func_fatal_help "you must specify a MODE"
-}
-
-test -z "$exec_cmd" && \
- func_fatal_help "invalid operation mode '$opt_mode'"
-
-if test -n "$exec_cmd"; then
- eval exec "$exec_cmd"
- exit $EXIT_FAILURE
-fi
-
-exit $exit_status
-
-
-# The TAGs below are defined such that we never get into a situation
-# where we disable both kinds of libraries. Given conflicting
-# choices, we go for a static library, that is the most portable,
-# since we can't tell whether shared libraries were disabled because
-# the user asked for that or because the platform doesn't support
-# them. This is particularly important on AIX, because we don't
-# support having both static and shared libraries enabled at the same
-# time on that platform, so we default to a shared-only configuration.
-# If a disable-shared tag is given, we'll fallback to a static-only
-# configuration. But we'll never go from static-only to shared-only.
-
-# ### BEGIN LIBTOOL TAG CONFIG: disable-shared
-build_libtool_libs=no
-build_old_libs=yes
-# ### END LIBTOOL TAG CONFIG: disable-shared
-
-# ### BEGIN LIBTOOL TAG CONFIG: disable-static
-build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
-# ### END LIBTOOL TAG CONFIG: disable-static
-
-# Local Variables:
-# mode:shell-script
-# sh-indentation:2
-# End:
diff --git a/Modules/_ctypes/libffi/m4/asmcfi.m4 b/Modules/_ctypes/libffi/m4/asmcfi.m4
deleted file mode 100644
index dbf73a0b3e..0000000000
--- a/Modules/_ctypes/libffi/m4/asmcfi.m4
+++ /dev/null
@@ -1,13 +0,0 @@
-AC_DEFUN([GCC_AS_CFI_PSEUDO_OP],
-[AC_CACHE_CHECK([assembler .cfi pseudo-op support],
- gcc_cv_as_cfi_pseudo_op, [
- gcc_cv_as_cfi_pseudo_op=unknown
- AC_TRY_COMPILE([asm (".cfi_startproc\n\t.cfi_endproc");],,
- [gcc_cv_as_cfi_pseudo_op=yes],
- [gcc_cv_as_cfi_pseudo_op=no])
- ])
- if test "x$gcc_cv_as_cfi_pseudo_op" = xyes; then
- AC_DEFINE(HAVE_AS_CFI_PSEUDO_OP, 1,
- [Define if your assembler supports .cfi_* directives.])
- fi
-])
diff --git a/Modules/_ctypes/libffi/m4/ax_append_flag.m4 b/Modules/_ctypes/libffi/m4/ax_append_flag.m4
deleted file mode 100644
index 1d38b76fb8..0000000000
--- a/Modules/_ctypes/libffi/m4/ax_append_flag.m4
+++ /dev/null
@@ -1,69 +0,0 @@
-# ===========================================================================
-# http://www.gnu.org/software/autoconf-archive/ax_append_flag.html
-# ===========================================================================
-#
-# SYNOPSIS
-#
-# AX_APPEND_FLAG(FLAG, [FLAGS-VARIABLE])
-#
-# DESCRIPTION
-#
-# FLAG is appended to the FLAGS-VARIABLE shell variable, with a space
-# added in between.
-#
-# If FLAGS-VARIABLE is not specified, the current language's flags (e.g.
-# CFLAGS) is used. FLAGS-VARIABLE is not changed if it already contains
-# FLAG. If FLAGS-VARIABLE is unset in the shell, it is set to exactly
-# FLAG.
-#
-# NOTE: Implementation based on AX_CFLAGS_GCC_OPTION.
-#
-# LICENSE
-#
-# Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
-# Copyright (c) 2011 Maarten Bosmans <mkbosmans@gmail.com>
-#
-# 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 3 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, see <http://www.gnu.org/licenses/>.
-#
-# As a special exception, the respective Autoconf Macro's copyright owner
-# gives unlimited permission to copy, distribute and modify the configure
-# scripts that are the output of Autoconf when processing the Macro. You
-# need not follow the terms of the GNU General Public License when using
-# or distributing such scripts, even though portions of the text of the
-# Macro appear in them. The GNU General Public License (GPL) does govern
-# all other use of the material that constitutes the Autoconf Macro.
-#
-# This special exception to the GPL applies to versions of the Autoconf
-# Macro released by the Autoconf Archive. When you make and distribute a
-# modified version of the Autoconf Macro, you may extend this special
-# exception to the GPL to apply to your modified version as well.
-
-#serial 2
-
-AC_DEFUN([AX_APPEND_FLAG],
-[AC_PREREQ(2.59)dnl for _AC_LANG_PREFIX
-AS_VAR_PUSHDEF([FLAGS], [m4_default($2,_AC_LANG_PREFIX[FLAGS])])dnl
-AS_VAR_SET_IF(FLAGS,
- [case " AS_VAR_GET(FLAGS) " in
- *" $1 "*)
- AC_RUN_LOG([: FLAGS already contains $1])
- ;;
- *)
- AC_RUN_LOG([: FLAGS="$FLAGS $1"])
- AS_VAR_SET(FLAGS, ["AS_VAR_GET(FLAGS) $1"])
- ;;
- esac],
- [AS_VAR_SET(FLAGS,["$1"])])
-AS_VAR_POPDEF([FLAGS])dnl
-])dnl AX_APPEND_FLAG
diff --git a/Modules/_ctypes/libffi/m4/ax_cc_maxopt.m4 b/Modules/_ctypes/libffi/m4/ax_cc_maxopt.m4
deleted file mode 100644
index 62e3b5330b..0000000000
--- a/Modules/_ctypes/libffi/m4/ax_cc_maxopt.m4
+++ /dev/null
@@ -1,181 +0,0 @@
-# ===========================================================================
-# http://www.gnu.org/software/autoconf-archive/ax_cc_maxopt.html
-# ===========================================================================
-#
-# SYNOPSIS
-#
-# AX_CC_MAXOPT
-#
-# DESCRIPTION
-#
-# Try to turn on "good" C optimization flags for various compilers and
-# architectures, for some definition of "good". (In our case, good for
-# FFTW and hopefully for other scientific codes. Modify as needed.)
-#
-# The user can override the flags by setting the CFLAGS environment
-# variable. The user can also specify --enable-portable-binary in order to
-# disable any optimization flags that might result in a binary that only
-# runs on the host architecture.
-#
-# Note also that the flags assume that ANSI C aliasing rules are followed
-# by the code (e.g. for gcc's -fstrict-aliasing), and that floating-point
-# computations can be re-ordered as needed.
-#
-# Requires macros: AX_CHECK_COMPILE_FLAG, AX_COMPILER_VENDOR,
-# AX_GCC_ARCHFLAG, AX_GCC_X86_CPUID.
-#
-# LICENSE
-#
-# Copyright (c) 2008 Steven G. Johnson <stevenj@alum.mit.edu>
-# Copyright (c) 2008 Matteo Frigo
-#
-# 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 3 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, see <http://www.gnu.org/licenses/>.
-#
-# As a special exception, the respective Autoconf Macro's copyright owner
-# gives unlimited permission to copy, distribute and modify the configure
-# scripts that are the output of Autoconf when processing the Macro. You
-# need not follow the terms of the GNU General Public License when using
-# or distributing such scripts, even though portions of the text of the
-# Macro appear in them. The GNU General Public License (GPL) does govern
-# all other use of the material that constitutes the Autoconf Macro.
-#
-# This special exception to the GPL applies to versions of the Autoconf
-# Macro released by the Autoconf Archive. When you make and distribute a
-# modified version of the Autoconf Macro, you may extend this special
-# exception to the GPL to apply to your modified version as well.
-
-#serial 13
-
-AC_DEFUN([AX_CC_MAXOPT],
-[
-AC_REQUIRE([AC_PROG_CC])
-AC_REQUIRE([AX_COMPILER_VENDOR])
-AC_REQUIRE([AC_CANONICAL_HOST])
-
-AC_ARG_ENABLE(portable-binary, [AS_HELP_STRING([--enable-portable-binary], [disable compiler optimizations that would produce unportable binaries])],
- acx_maxopt_portable=$enableval, acx_maxopt_portable=no)
-
-# Try to determine "good" native compiler flags if none specified via CFLAGS
-if test "$ac_test_CFLAGS" != "set"; then
- CFLAGS=""
- case $ax_cv_c_compiler_vendor in
- dec) CFLAGS="-newc -w0 -O5 -ansi_alias -ansi_args -fp_reorder -tune host"
- if test "x$acx_maxopt_portable" = xno; then
- CFLAGS="$CFLAGS -arch host"
- fi;;
-
- sun) CFLAGS="-native -fast -xO5 -dalign"
- if test "x$acx_maxopt_portable" = xyes; then
- CFLAGS="$CFLAGS -xarch=generic"
- fi;;
-
- hp) CFLAGS="+Oall +Optrs_ansi +DSnative"
- if test "x$acx_maxopt_portable" = xyes; then
- CFLAGS="$CFLAGS +DAportable"
- fi;;
-
- ibm) if test "x$acx_maxopt_portable" = xno; then
- xlc_opt="-qarch=auto -qtune=auto"
- else
- xlc_opt="-qtune=auto"
- fi
- AX_CHECK_COMPILE_FLAG($xlc_opt,
- CFLAGS="-O3 -qansialias -w $xlc_opt",
- [CFLAGS="-O3 -qansialias -w"
- echo "******************************************************"
- echo "* You seem to have the IBM C compiler. It is *"
- echo "* recommended for best performance that you use: *"
- echo "* *"
- echo "* CFLAGS=-O3 -qarch=xxx -qtune=xxx -qansialias -w *"
- echo "* ^^^ ^^^ *"
- echo "* where xxx is pwr2, pwr3, 604, or whatever kind of *"
- echo "* CPU you have. (Set the CFLAGS environment var. *"
- echo "* and re-run configure.) For more info, man cc. *"
- echo "******************************************************"])
- ;;
-
- intel) CFLAGS="-O3 -ansi_alias"
- if test "x$acx_maxopt_portable" = xno; then
- icc_archflag=unknown
- icc_flags=""
- case $host_cpu in
- i686*|x86_64*)
- # icc accepts gcc assembly syntax, so these should work:
- AX_GCC_X86_CPUID(0)
- AX_GCC_X86_CPUID(1)
- case $ax_cv_gcc_x86_cpuid_0 in # see AX_GCC_ARCHFLAG
- *:756e6547:*:*) # Intel
- case $ax_cv_gcc_x86_cpuid_1 in
- *6a?:*[[234]]:*:*|*6[[789b]]?:*:*:*) icc_flags="-xK";;
- *f3[[347]]:*:*:*|*f4[1347]:*:*:*) icc_flags="-xP -xN -xW -xK";;
- *f??:*:*:*) icc_flags="-xN -xW -xK";;
- esac ;;
- esac ;;
- esac
- if test "x$icc_flags" != x; then
- for flag in $icc_flags; do
- AX_CHECK_COMPILE_FLAG($flag, [icc_archflag=$flag; break])
- done
- fi
- AC_MSG_CHECKING([for icc architecture flag])
- AC_MSG_RESULT($icc_archflag)
- if test "x$icc_archflag" != xunknown; then
- CFLAGS="$CFLAGS $icc_archflag"
- fi
- fi
- ;;
-
- gnu)
- # default optimization flags for gcc on all systems
- CFLAGS="-O3 -fomit-frame-pointer"
-
- # -malign-double for x86 systems
- # LIBFFI -- DON'T DO THIS - CHANGES ABI
- # AX_CHECK_COMPILE_FLAG(-malign-double, CFLAGS="$CFLAGS -malign-double")
-
- # -fstrict-aliasing for gcc-2.95+
- AX_CHECK_COMPILE_FLAG(-fstrict-aliasing,
- CFLAGS="$CFLAGS -fstrict-aliasing")
-
- # note that we enable "unsafe" fp optimization with other compilers, too
- AX_CHECK_COMPILE_FLAG(-ffast-math, CFLAGS="$CFLAGS -ffast-math")
-
- AX_GCC_ARCHFLAG($acx_maxopt_portable)
- ;;
- esac
-
- if test -z "$CFLAGS"; then
- echo ""
- echo "********************************************************"
- echo "* WARNING: Don't know the best CFLAGS for this system *"
- echo "* Use ./configure CFLAGS=... to specify your own flags *"
- echo "* (otherwise, a default of CFLAGS=-O3 will be used) *"
- echo "********************************************************"
- echo ""
- CFLAGS="-O3"
- fi
-
- AX_CHECK_COMPILE_FLAG($CFLAGS, [], [
- echo ""
- echo "********************************************************"
- echo "* WARNING: The guessed CFLAGS don't seem to work with *"
- echo "* your compiler. *"
- echo "* Use ./configure CFLAGS=... to specify your own flags *"
- echo "********************************************************"
- echo ""
- CFLAGS=""
- ])
-
-fi
-])
diff --git a/Modules/_ctypes/libffi/m4/ax_cflags_warn_all.m4 b/Modules/_ctypes/libffi/m4/ax_cflags_warn_all.m4
deleted file mode 100644
index 0fa3e186b4..0000000000
--- a/Modules/_ctypes/libffi/m4/ax_cflags_warn_all.m4
+++ /dev/null
@@ -1,122 +0,0 @@
-# ===========================================================================
-# http://www.gnu.org/software/autoconf-archive/ax_cflags_warn_all.html
-# ===========================================================================
-#
-# SYNOPSIS
-#
-# AX_CFLAGS_WARN_ALL [(shellvar [,default, [A/NA]])]
-# AX_CXXFLAGS_WARN_ALL [(shellvar [,default, [A/NA]])]
-# AX_FCFLAGS_WARN_ALL [(shellvar [,default, [A/NA]])]
-#
-# DESCRIPTION
-#
-# Try to find a compiler option that enables most reasonable warnings.
-#
-# For the GNU compiler it will be -Wall (and -ansi -pedantic) The result
-# is added to the shellvar being CFLAGS, CXXFLAGS, or FCFLAGS by default.
-#
-# Currently this macro knows about the GCC, Solaris, Digital Unix, AIX,
-# HP-UX, IRIX, NEC SX-5 (Super-UX 10), Cray J90 (Unicos 10.0.0.8), and
-# Intel compilers. For a given compiler, the Fortran flags are much more
-# experimental than their C equivalents.
-#
-# - $1 shell-variable-to-add-to : CFLAGS, CXXFLAGS, or FCFLAGS
-# - $2 add-value-if-not-found : nothing
-# - $3 action-if-found : add value to shellvariable
-# - $4 action-if-not-found : nothing
-#
-# NOTE: These macros depend on AX_APPEND_FLAG.
-#
-# LICENSE
-#
-# Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
-# Copyright (c) 2010 Rhys Ulerich <rhys.ulerich@gmail.com>
-#
-# 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 3 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, see <http://www.gnu.org/licenses/>.
-#
-# As a special exception, the respective Autoconf Macro's copyright owner
-# gives unlimited permission to copy, distribute and modify the configure
-# scripts that are the output of Autoconf when processing the Macro. You
-# need not follow the terms of the GNU General Public License when using
-# or distributing such scripts, even though portions of the text of the
-# Macro appear in them. The GNU General Public License (GPL) does govern
-# all other use of the material that constitutes the Autoconf Macro.
-#
-# This special exception to the GPL applies to versions of the Autoconf
-# Macro released by the Autoconf Archive. When you make and distribute a
-# modified version of the Autoconf Macro, you may extend this special
-# exception to the GPL to apply to your modified version as well.
-
-#serial 14
-
-AC_DEFUN([AX_FLAGS_WARN_ALL],[dnl
-AS_VAR_PUSHDEF([FLAGS],[_AC_LANG_PREFIX[]FLAGS])dnl
-AS_VAR_PUSHDEF([VAR],[ac_cv_[]_AC_LANG_ABBREV[]flags_warn_all])dnl
-AC_CACHE_CHECK([m4_ifval($1,$1,FLAGS) for maximum warnings],
-VAR,[VAR="no, unknown"
-ac_save_[]FLAGS="$[]FLAGS"
-for ac_arg dnl
-in "-warn all % -warn all" dnl Intel
- "-pedantic % -Wall" dnl GCC
- "-xstrconst % -v" dnl Solaris C
- "-std1 % -verbose -w0 -warnprotos" dnl Digital Unix
- "-qlanglvl=ansi % -qsrcmsg -qinfo=all:noppt:noppc:noobs:nocnd" dnl AIX
- "-ansi -ansiE % -fullwarn" dnl IRIX
- "+ESlit % +w1" dnl HP-UX C
- "-Xc % -pvctl[,]fullmsg" dnl NEC SX-5 (Super-UX 10)
- "-h conform % -h msglevel 2" dnl Cray C (Unicos)
- #
-do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'`
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM],
- [VAR=`echo $ac_arg | sed -e 's,.*% *,,'` ; break])
-done
-FLAGS="$ac_save_[]FLAGS"
-])
-AS_VAR_POPDEF([FLAGS])dnl
-AC_REQUIRE([AX_APPEND_FLAG])
-case ".$VAR" in
- .ok|.ok,*) m4_ifvaln($3,$3) ;;
- .|.no|.no,*) m4_default($4,[m4_ifval($2,[AX_APPEND_FLAG([$2], [$1])])]) ;;
- *) m4_default($3,[AX_APPEND_FLAG([$VAR], [$1])]) ;;
-esac
-AS_VAR_POPDEF([VAR])dnl
-])dnl AX_FLAGS_WARN_ALL
-dnl implementation tactics:
-dnl the for-argument contains a list of options. The first part of
-dnl these does only exist to detect the compiler - usually it is
-dnl a global option to enable -ansi or -extrawarnings. All other
-dnl compilers will fail about it. That was needed since a lot of
-dnl compilers will give false positives for some option-syntax
-dnl like -Woption or -Xoption as they think of it is a pass-through
-dnl to later compile stages or something. The "%" is used as a
-dnl delimiter. A non-option comment can be given after "%%" marks
-dnl which will be shown but not added to the respective C/CXXFLAGS.
-
-AC_DEFUN([AX_CFLAGS_WARN_ALL],[dnl
-AC_LANG_PUSH([C])
-AX_FLAGS_WARN_ALL([$1], [$2], [$3], [$4])
-AC_LANG_POP([C])
-])
-
-AC_DEFUN([AX_CXXFLAGS_WARN_ALL],[dnl
-AC_LANG_PUSH([C++])
-AX_FLAGS_WARN_ALL([$1], [$2], [$3], [$4])
-AC_LANG_POP([C++])
-])
-
-AC_DEFUN([AX_FCFLAGS_WARN_ALL],[dnl
-AC_LANG_PUSH([Fortran])
-AX_FLAGS_WARN_ALL([$1], [$2], [$3], [$4])
-AC_LANG_POP([Fortran])
-])
diff --git a/Modules/_ctypes/libffi/m4/ax_check_compile_flag.m4 b/Modules/_ctypes/libffi/m4/ax_check_compile_flag.m4
deleted file mode 100644
index c3a8d695a1..0000000000
--- a/Modules/_ctypes/libffi/m4/ax_check_compile_flag.m4
+++ /dev/null
@@ -1,72 +0,0 @@
-# ===========================================================================
-# http://www.gnu.org/software/autoconf-archive/ax_check_compile_flag.html
-# ===========================================================================
-#
-# SYNOPSIS
-#
-# AX_CHECK_COMPILE_FLAG(FLAG, [ACTION-SUCCESS], [ACTION-FAILURE], [EXTRA-FLAGS])
-#
-# DESCRIPTION
-#
-# Check whether the given FLAG works with the current language's compiler
-# or gives an error. (Warnings, however, are ignored)
-#
-# ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
-# success/failure.
-#
-# If EXTRA-FLAGS is defined, it is added to the current language's default
-# flags (e.g. CFLAGS) when the check is done. The check is thus made with
-# the flags: "CFLAGS EXTRA-FLAGS FLAG". This can for example be used to
-# force the compiler to issue an error when a bad flag is given.
-#
-# NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. Please keep this
-# macro in sync with AX_CHECK_{PREPROC,LINK}_FLAG.
-#
-# LICENSE
-#
-# Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
-# Copyright (c) 2011 Maarten Bosmans <mkbosmans@gmail.com>
-#
-# 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 3 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, see <http://www.gnu.org/licenses/>.
-#
-# As a special exception, the respective Autoconf Macro's copyright owner
-# gives unlimited permission to copy, distribute and modify the configure
-# scripts that are the output of Autoconf when processing the Macro. You
-# need not follow the terms of the GNU General Public License when using
-# or distributing such scripts, even though portions of the text of the
-# Macro appear in them. The GNU General Public License (GPL) does govern
-# all other use of the material that constitutes the Autoconf Macro.
-#
-# This special exception to the GPL applies to versions of the Autoconf
-# Macro released by the Autoconf Archive. When you make and distribute a
-# modified version of the Autoconf Macro, you may extend this special
-# exception to the GPL to apply to your modified version as well.
-
-#serial 2
-
-AC_DEFUN([AX_CHECK_COMPILE_FLAG],
-[AC_PREREQ(2.59)dnl for _AC_LANG_PREFIX
-AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_[]_AC_LANG_ABBREV[]flags_$4_$1])dnl
-AC_CACHE_CHECK([whether _AC_LANG compiler accepts $1], CACHEVAR, [
- ax_check_save_flags=$[]_AC_LANG_PREFIX[]FLAGS
- _AC_LANG_PREFIX[]FLAGS="$[]_AC_LANG_PREFIX[]FLAGS $4 $1"
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM()],
- [AS_VAR_SET(CACHEVAR,[yes])],
- [AS_VAR_SET(CACHEVAR,[no])])
- _AC_LANG_PREFIX[]FLAGS=$ax_check_save_flags])
-AS_IF([test x"AS_VAR_GET(CACHEVAR)" = xyes],
- [m4_default([$2], :)],
- [m4_default([$3], :)])
-AS_VAR_POPDEF([CACHEVAR])dnl
-])dnl AX_CHECK_COMPILE_FLAGS
diff --git a/Modules/_ctypes/libffi/m4/ax_compiler_vendor.m4 b/Modules/_ctypes/libffi/m4/ax_compiler_vendor.m4
deleted file mode 100644
index 73e32ea9ef..0000000000
--- a/Modules/_ctypes/libffi/m4/ax_compiler_vendor.m4
+++ /dev/null
@@ -1,84 +0,0 @@
-# ===========================================================================
-# http://www.gnu.org/software/autoconf-archive/ax_compiler_vendor.html
-# ===========================================================================
-#
-# SYNOPSIS
-#
-# AX_COMPILER_VENDOR
-#
-# DESCRIPTION
-#
-# Determine the vendor of the C/C++ compiler, e.g., gnu, intel, ibm, sun,
-# hp, borland, comeau, dec, cray, kai, lcc, metrowerks, sgi, microsoft,
-# watcom, etc. The vendor is returned in the cache variable
-# $ax_cv_c_compiler_vendor for C and $ax_cv_cxx_compiler_vendor for C++.
-#
-# LICENSE
-#
-# Copyright (c) 2008 Steven G. Johnson <stevenj@alum.mit.edu>
-# Copyright (c) 2008 Matteo Frigo
-#
-# 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 3 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, see <http://www.gnu.org/licenses/>.
-#
-# As a special exception, the respective Autoconf Macro's copyright owner
-# gives unlimited permission to copy, distribute and modify the configure
-# scripts that are the output of Autoconf when processing the Macro. You
-# need not follow the terms of the GNU General Public License when using
-# or distributing such scripts, even though portions of the text of the
-# Macro appear in them. The GNU General Public License (GPL) does govern
-# all other use of the material that constitutes the Autoconf Macro.
-#
-# This special exception to the GPL applies to versions of the Autoconf
-# Macro released by the Autoconf Archive. When you make and distribute a
-# modified version of the Autoconf Macro, you may extend this special
-# exception to the GPL to apply to your modified version as well.
-
-#serial 11
-
-AC_DEFUN([AX_COMPILER_VENDOR],
-[AC_CACHE_CHECK([for _AC_LANG compiler vendor], ax_cv_[]_AC_LANG_ABBREV[]_compiler_vendor,
- [# note: don't check for gcc first since some other compilers define __GNUC__
- vendors="intel: __ICC,__ECC,__INTEL_COMPILER
- ibm: __xlc__,__xlC__,__IBMC__,__IBMCPP__
- pathscale: __PATHCC__,__PATHSCALE__
- clang: __clang__
- gnu: __GNUC__
- sun: __SUNPRO_C,__SUNPRO_CC
- hp: __HP_cc,__HP_aCC
- dec: __DECC,__DECCXX,__DECC_VER,__DECCXX_VER
- borland: __BORLANDC__,__TURBOC__
- comeau: __COMO__
- cray: _CRAYC
- kai: __KCC
- lcc: __LCC__
- sgi: __sgi,sgi
- microsoft: _MSC_VER
- metrowerks: __MWERKS__
- watcom: __WATCOMC__
- portland: __PGI
- unknown: UNKNOWN"
- for ventest in $vendors; do
- case $ventest in
- *:) vendor=$ventest; continue ;;
- *) vencpp="defined("`echo $ventest | sed 's/,/) || defined(/g'`")" ;;
- esac
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[
- #if !($vencpp)
- thisisanerror;
- #endif
- ])], [break])
- done
- ax_cv_[]_AC_LANG_ABBREV[]_compiler_vendor=`echo $vendor | cut -d: -f1`
- ])
-])
diff --git a/Modules/_ctypes/libffi/m4/ax_configure_args.m4 b/Modules/_ctypes/libffi/m4/ax_configure_args.m4
deleted file mode 100644
index 0726b1bc8a..0000000000
--- a/Modules/_ctypes/libffi/m4/ax_configure_args.m4
+++ /dev/null
@@ -1,70 +0,0 @@
-# ===========================================================================
-# http://www.gnu.org/software/autoconf-archive/ax_configure_args.html
-# ===========================================================================
-#
-# SYNOPSIS
-#
-# AX_CONFIGURE_ARGS
-#
-# DESCRIPTION
-#
-# Helper macro for AX_ENABLE_BUILDDIR.
-#
-# The traditional way of starting a subdir-configure is running the script
-# with ${1+"$@"} but since autoconf 2.60 this is broken. Instead we have
-# to rely on eval'ing $ac_configure_args however some old autoconf
-# versions do not provide that. To ensure maximum portability of autoconf
-# extension macros this helper can be AC_REQUIRE'd so that
-# $ac_configure_args will alsways be present.
-#
-# Sadly, the traditional "exec $SHELL" of the enable_builddir macros is
-# spoiled now and must be replaced by "eval + exit $?".
-#
-# Example:
-#
-# AC_DEFUN([AX_ENABLE_SUBDIR],[dnl
-# AC_REQUIRE([AX_CONFIGURE_ARGS])dnl
-# eval $SHELL $ac_configure_args || exit $?
-# ...])
-#
-# LICENSE
-#
-# Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
-#
-# 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 3 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, see <http://www.gnu.org/licenses/>.
-#
-# As a special exception, the respective Autoconf Macro's copyright owner
-# gives unlimited permission to copy, distribute and modify the configure
-# scripts that are the output of Autoconf when processing the Macro. You
-# need not follow the terms of the GNU General Public License when using
-# or distributing such scripts, even though portions of the text of the
-# Macro appear in them. The GNU General Public License (GPL) does govern
-# all other use of the material that constitutes the Autoconf Macro.
-#
-# This special exception to the GPL applies to versions of the Autoconf
-# Macro released by the Autoconf Archive. When you make and distribute a
-# modified version of the Autoconf Macro, you may extend this special
-# exception to the GPL to apply to your modified version as well.
-
-#serial 9
-
-AC_DEFUN([AX_CONFIGURE_ARGS],[
- # [$]@ is unsable in 2.60+ but earlier autoconf had no ac_configure_args
- if test "${ac_configure_args+set}" != "set" ; then
- ac_configure_args=
- for ac_arg in ${1+"[$]@"}; do
- ac_configure_args="$ac_configure_args '$ac_arg'"
- done
- fi
-])
diff --git a/Modules/_ctypes/libffi/m4/ax_enable_builddir.m4 b/Modules/_ctypes/libffi/m4/ax_enable_builddir.m4
deleted file mode 100644
index 3fb87317dc..0000000000
--- a/Modules/_ctypes/libffi/m4/ax_enable_builddir.m4
+++ /dev/null
@@ -1,300 +0,0 @@
-# ===========================================================================
-# http://www.gnu.org/software/autoconf-archive/ax_enable_builddir.html
-# ===========================================================================
-#
-# SYNOPSIS
-#
-# AX_ENABLE_BUILDDIR [(dirstring-or-command [,Makefile.mk [,-all]])]
-#
-# DESCRIPTION
-#
-# If the current configure was run within the srcdir then we move all
-# configure-files into a subdir and let the configure steps continue
-# there. We provide an option --disable-builddir to suppress the move into
-# a separate builddir.
-#
-# Defaults:
-#
-# $1 = $host (overridden with $HOST)
-# $2 = Makefile.mk
-# $3 = -all
-#
-# This macro must be called before AM_INIT_AUTOMAKE. It creates a default
-# toplevel srcdir Makefile from the information found in the created
-# toplevel builddir Makefile. It just copies the variables and
-# rule-targets, each extended with a default rule-execution that recurses
-# into the build directory of the current "HOST". You can override the
-# auto-dection through `config.guess` and build-time of course, as in
-#
-# make HOST=i386-mingw-cross
-#
-# which can of course set at configure time as well using
-#
-# configure --host=i386-mingw-cross
-#
-# After the default has been created, additional rules can be appended
-# that will not just recurse into the subdirectories and only ever exist
-# in the srcdir toplevel makefile - these parts are read from the $2 =
-# Makefile.mk file
-#
-# The automatic rules are usually scanning the toplevel Makefile for lines
-# like '#### $host |$builddir' to recognize the place where to recurse
-# into. Usually, the last one is the only one used. However, almost all
-# targets have an additional "*-all" rule which makes the script to
-# recurse into _all_ variants of the current HOST (!!) setting. The "-all"
-# suffix can be overriden for the macro as well.
-#
-# a special rule is only given for things like "dist" that will copy the
-# tarball from the builddir to the sourcedir (or $(PUB)) for reason of
-# convenience.
-#
-# LICENSE
-#
-# Copyright (c) 2009 Guido U. Draheim <guidod@gmx.de>
-# Copyright (c) 2009 Alan Jenkins <alan-jenkins@tuffmail.co.uk>
-#
-# 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 3 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, see <http://www.gnu.org/licenses/>.
-#
-# As a special exception, the respective Autoconf Macro's copyright owner
-# gives unlimited permission to copy, distribute and modify the configure
-# scripts that are the output of Autoconf when processing the Macro. You
-# need not follow the terms of the GNU General Public License when using
-# or distributing such scripts, even though portions of the text of the
-# Macro appear in them. The GNU General Public License (GPL) does govern
-# all other use of the material that constitutes the Autoconf Macro.
-#
-# This special exception to the GPL applies to versions of the Autoconf
-# Macro released by the Autoconf Archive. When you make and distribute a
-# modified version of the Autoconf Macro, you may extend this special
-# exception to the GPL to apply to your modified version as well.
-
-#serial 23
-
-AC_DEFUN([AX_ENABLE_BUILDDIR],[
-AC_REQUIRE([AC_CANONICAL_HOST])[]dnl
-AC_REQUIRE([AX_CONFIGURE_ARGS])[]dnl
-AC_REQUIRE([AM_AUX_DIR_EXPAND])[]dnl
-AC_BEFORE([$0],[AM_INIT_AUTOMAKE])dnl
-AS_VAR_PUSHDEF([SUB],[ax_enable_builddir])dnl
-AS_VAR_PUSHDEF([AUX],[ax_enable_builddir_auxdir])dnl
-AS_VAR_PUSHDEF([SED],[ax_enable_builddir_sed])dnl
-SUB="."
-AC_ARG_ENABLE([builddir], AS_HELP_STRING(
- [--disable-builddir],[disable automatic build in subdir of sources])
- ,[SUB="$enableval"], [SUB="auto"])
-if test ".$ac_srcdir_defaulted" != ".no" ; then
-if test ".$srcdir" = ".." ; then
- if test -f config.status ; then
- AC_MSG_NOTICE(toplevel srcdir already configured... skipping subdir build)
- else
- test ".$SUB" = "." && SUB="."
- test ".$SUB" = ".no" && SUB="."
- test ".$TARGET" = "." && TARGET="$target"
- test ".$SUB" = ".auto" && SUB="m4_ifval([$1], [$1],[$TARGET])"
- if test ".$SUB" != ".." ; then # we know where to go and
- AS_MKDIR_P([$SUB])
- echo __.$SUB.__ > $SUB/conftest.tmp
- cd $SUB
- if grep __.$SUB.__ conftest.tmp >/dev/null 2>/dev/null ; then
- rm conftest.tmp
- AC_MSG_RESULT([continue configure in default builddir "./$SUB"])
- else
- AC_MSG_ERROR([could not change to default builddir "./$SUB"])
- fi
- srcdir=`echo "$SUB" |
- sed -e 's,^\./,,;s,[[^/]]$,&/,;s,[[^/]]*/,../,g;s,[[/]]$,,;'`
- # going to restart from subdirectory location
- test -f $srcdir/config.log && mv $srcdir/config.log .
- test -f $srcdir/confdefs.h && mv $srcdir/confdefs.h .
- test -f $srcdir/conftest.log && mv $srcdir/conftest.log .
- test -f $srcdir/$cache_file && mv $srcdir/$cache_file .
- AC_MSG_RESULT(....exec $SHELL $srcdir/[$]0 "--srcdir=$srcdir" "--enable-builddir=$SUB" ${1+"[$]@"})
- case "[$]0" in # restart
- [/\\]*) eval $SHELL "'[$]0'" "'--srcdir=$srcdir'" "'--enable-builddir=$SUB'" $ac_configure_args ;;
- *) eval $SHELL "'$srcdir/[$]0'" "'--srcdir=$srcdir'" "'--enable-builddir=$SUB'" $ac_configure_args ;;
- esac ; exit $?
- fi
- fi
-fi fi
-test ".$SUB" = ".auto" && SUB="."
-dnl ac_path_prog uses "set dummy" to override $@ which would defeat the "exec"
-AC_PATH_PROG(SED,gsed sed, sed)
-AUX="$am_aux_dir"
-AS_VAR_POPDEF([SED])dnl
-AS_VAR_POPDEF([AUX])dnl
-AS_VAR_POPDEF([SUB])dnl
-AC_CONFIG_COMMANDS([buildir],[dnl .............. config.status ..............
-AS_VAR_PUSHDEF([SUB],[ax_enable_builddir])dnl
-AS_VAR_PUSHDEF([TOP],[top_srcdir])dnl
-AS_VAR_PUSHDEF([SRC],[ac_top_srcdir])dnl
-AS_VAR_PUSHDEF([AUX],[ax_enable_builddir_auxdir])dnl
-AS_VAR_PUSHDEF([SED],[ax_enable_builddir_sed])dnl
-pushdef([END],[Makefile.mk])dnl
-pushdef([_ALL],[ifelse([$3],,[-all],[$3])])dnl
- SRC="$ax_enable_builddir_srcdir"
- if test ".$SUB" = ".." ; then
- if test -f "$TOP/Makefile" ; then
- AC_MSG_NOTICE([skipping TOP/Makefile - left untouched])
- else
- AC_MSG_NOTICE([skipping TOP/Makefile - not created])
- fi
- else
- if test -f "$SRC/Makefile" ; then
- a=`grep "^VERSION " "$SRC/Makefile"` ; b=`grep "^VERSION " Makefile`
- test "$a" != "$b" && rm "$SRC/Makefile"
- fi
- if test -f "$SRC/Makefile" ; then
- echo "$SRC/Makefile : $SRC/Makefile.in" > $tmp/conftemp.mk
- echo " []@ echo 'REMOVED,,,' >\$[]@" >> $tmp/conftemp.mk
- eval "${MAKE-make} -f $tmp/conftemp.mk 2>/dev/null >/dev/null"
- if grep '^REMOVED,,,' "$SRC/Makefile" >/dev/null
- then rm $SRC/Makefile ; fi
- cp $tmp/conftemp.mk $SRC/makefiles.mk~ ## DEBUGGING
- fi
- if test ! -f "$SRC/Makefile" ; then
- AC_MSG_NOTICE([create TOP/Makefile guessed from local Makefile])
- x='`' ; cat >$tmp/conftemp.sed <<_EOF
-/^\$/n
-x
-/^\$/bS
-x
-/\\\\\$/{H;d;}
-{H;s/.*//;x;}
-bM
-:S
-x
-/\\\\\$/{h;d;}
-{h;s/.*//;x;}
-:M
-s/\\(\\n\\) /\\1 /g
-/^ /d
-/^[[ ]]*[[\\#]]/d
-/^VPATH *=/d
-s/^srcdir *=.*/srcdir = ./
-s/^top_srcdir *=.*/top_srcdir = ./
-/[[:=]]/!d
-/^\\./d
-dnl Now handle rules (i.e. lines containing ":" but not " = ").
-/ = /b
-/ .= /b
-/:/!b
-s/:.*/:/
-s/ / /g
-s/ \\([[a-z]][[a-z-]]*[[a-zA-Z0-9]]\\)\\([[ :]]\\)/ \\1 \\1[]_ALL\\2/g
-s/^\\([[a-z]][[a-z-]]*[[a-zA-Z0-9]]\\)\\([[ :]]\\)/\\1 \\1[]_ALL\\2/
-s/ / /g
-/^all all[]_ALL[[ :]]/i\\
-all-configured : all[]_ALL
-dnl dist-all exists... and would make for dist-all-all
-s/ [[a-zA-Z0-9-]]*[]_ALL [[a-zA-Z0-9-]]*[]_ALL[]_ALL//g
-/[]_ALL[]_ALL/d
-a\\
- @ HOST="\$(HOST)\" \\\\\\
- ; test ".\$\$HOST" = "." && HOST=$x sh $AUX/config.guess $x \\\\\\
- ; BUILD=$x grep "^#### \$\$HOST " Makefile | sed -e 's/.*|//' $x \\\\\\
- ; use=$x basename "\$\@" _ALL $x; n=$x echo \$\$BUILD | wc -w $x \\\\\\
- ; echo "MAKE \$\$HOST : \$\$n * \$\@"; if test "\$\$n" -eq "0" ; then : \\\\\\
- ; BUILD=$x grep "^####.*|" Makefile |tail -1| sed -e 's/.*|//' $x ; fi \\\\\\
- ; test ".\$\$BUILD" = "." && BUILD="." \\\\\\
- ; test "\$\$use" = "\$\@" && BUILD=$x echo "\$\$BUILD" | tail -1 $x \\\\\\
- ; for i in \$\$BUILD ; do test ".\$\$i" = "." && continue \\\\\\
- ; (cd "\$\$i" && test ! -f configure && \$(MAKE) \$\$use) || exit; done
-dnl special rule add-on: "dist" copies the tarball to $(PUB). (source tree)
-/dist[]_ALL *:/a\\
- @ HOST="\$(HOST)\" \\\\\\
- ; test ".\$\$HOST" = "." && HOST=$x sh $AUX/config.guess $x \\\\\\
- ; BUILD=$x grep "^#### \$\$HOST " Makefile | sed -e 's/.*|//' $x \\\\\\
- ; found=$x echo \$\$BUILD | wc -w $x \\\\\\
- ; echo "MAKE \$\$HOST : \$\$found \$(PACKAGE)-\$(VERSION).tar.*" \\\\\\
- ; if test "\$\$found" -eq "0" ; then : \\\\\\
- ; BUILD=$x grep "^#### .*|" Makefile |tail -1| sed -e 's/.*|//' $x \\\\\\
- ; fi ; for i in \$\$BUILD ; do test ".\$\$i" = "." && continue \\\\\\
- ; for f in \$\$i/\$(PACKAGE)-\$(VERSION).tar.* \\\\\\
- ; do test -f "\$\$f" && mv "\$\$f" \$(PUB). ; done ; break ; done
-dnl special rule add-on: "dist-foo" copies all the archives to $(PUB). (source tree)
-/dist-[[a-zA-Z0-9]]*[]_ALL *:/a\\
- @ HOST="\$(HOST)\" \\\\\\
- ; test ".\$\$HOST" = "." && HOST=$x sh ./config.guess $x \\\\\\
- ; BUILD=$x grep "^#### \$\$HOST " Makefile | sed -e 's/.*|//' $x \\\\\\
- ; found=$x echo \$\$BUILD | wc -w $x \\\\\\
- ; echo "MAKE \$\$HOST : \$\$found \$(PACKAGE)-\$(VERSION).*" \\\\\\
- ; if test "\$\$found" -eq "0" ; then : \\\\\\
- ; BUILD=$x grep "^#### .*|" Makefile |tail -1| sed -e 's/.*|//' $x \\\\\\
- ; fi ; for i in \$\$BUILD ; do test ".\$\$i" = "." && continue \\\\\\
- ; for f in \$\$i/\$(PACKAGE)-\$(VERSION).* \\\\\\
- ; do test -f "\$\$f" && mv "\$\$f" \$(PUB). ; done ; break ; done
-dnl special rule add-on: "distclean" removes all local builddirs completely
-/distclean[]_ALL *:/a\\
- @ HOST="\$(HOST)\" \\\\\\
- ; test ".\$\$HOST" = "." && HOST=$x sh $AUX/config.guess $x \\\\\\
- ; BUILD=$x grep "^#### .*|" Makefile | sed -e 's/.*|//' $x \\\\\\
- ; use=$x basename "\$\@" _ALL $x; n=$x echo \$\$BUILD | wc -w $x \\\\\\
- ; echo "MAKE \$\$HOST : \$\$n * \$\@ (all local builds)" \\\\\\
- ; test ".\$\$BUILD" = "." && BUILD="." \\\\\\
- ; for i in \$\$BUILD ; do test ".\$\$i" = "." && continue \\\\\\
- ; echo "# rm -r \$\$i"; done ; echo "# (sleep 3)" ; sleep 3 \\\\\\
- ; for i in \$\$BUILD ; do test ".\$\$i" = "." && continue \\\\\\
- ; echo "\$\$i" | grep "^/" > /dev/null && continue \\\\\\
- ; echo "\$\$i" | grep "^../" > /dev/null && continue \\\\\\
- ; echo "rm -r \$\$i"; (rm -r "\$\$i") ; done ; rm Makefile
-_EOF
- cp "$tmp/conftemp.sed" "$SRC/makefile.sed~" ## DEBUGGING
- $SED -f $tmp/conftemp.sed Makefile >$SRC/Makefile
- if test -f "$SRC/m4_ifval([$2],[$2],[END])" ; then
- AC_MSG_NOTICE([extend TOP/Makefile with TOP/m4_ifval([$2],[$2],[END])])
- cat $SRC/END >>$SRC/Makefile
- fi ; xxxx="####"
- echo "$xxxx CONFIGURATIONS FOR TOPLEVEL MAKEFILE: " >>$SRC/Makefile
- # sanity check
- if grep '^; echo "MAKE ' $SRC/Makefile >/dev/null ; then
- AC_MSG_NOTICE([buggy sed found - it deletes tab in "a" text parts])
- $SED -e '/^@ HOST=/s/^/ /' -e '/^; /s/^/ /' $SRC/Makefile \
- >$SRC/Makefile~
- (test -s $SRC/Makefile~ && mv $SRC/Makefile~ $SRC/Makefile) 2>/dev/null
- fi
- else
- xxxx="\\#\\#\\#\\#"
- # echo "/^$xxxx *$ax_enable_builddir_host /d" >$tmp/conftemp.sed
- echo "s!^$xxxx [[^|]]* | *$SUB *\$!$xxxx ...... $SUB!" >$tmp/conftemp.sed
- $SED -f "$tmp/conftemp.sed" "$SRC/Makefile" >$tmp/mkfile.tmp
- cp "$tmp/conftemp.sed" "$SRC/makefiles.sed~" ## DEBUGGING
- cp "$tmp/mkfile.tmp" "$SRC/makefiles.out~" ## DEBUGGING
- if cmp -s "$SRC/Makefile" "$tmp/mkfile.tmp" 2>/dev/null ; then
- AC_MSG_NOTICE([keeping TOP/Makefile from earlier configure])
- rm "$tmp/mkfile.tmp"
- else
- AC_MSG_NOTICE([reusing TOP/Makefile from earlier configure])
- mv "$tmp/mkfile.tmp" "$SRC/Makefile"
- fi
- fi
- AC_MSG_NOTICE([build in $SUB (HOST=$ax_enable_builddir_host)])
- xxxx="####"
- echo "$xxxx" "$ax_enable_builddir_host" "|$SUB" >>$SRC/Makefile
- fi
-popdef([END])dnl
-AS_VAR_POPDEF([SED])dnl
-AS_VAR_POPDEF([AUX])dnl
-AS_VAR_POPDEF([SRC])dnl
-AS_VAR_POPDEF([TOP])dnl
-AS_VAR_POPDEF([SUB])dnl
-],[dnl
-ax_enable_builddir_srcdir="$srcdir" # $srcdir
-ax_enable_builddir_host="$HOST" # $HOST / $host
-ax_enable_builddir_version="$VERSION" # $VERSION
-ax_enable_builddir_package="$PACKAGE" # $PACKAGE
-ax_enable_builddir_auxdir="$ax_enable_builddir_auxdir" # $AUX
-ax_enable_builddir_sed="$ax_enable_builddir_sed" # $SED
-ax_enable_builddir="$ax_enable_builddir" # $SUB
-])dnl
-])
diff --git a/Modules/_ctypes/libffi/m4/ax_gcc_archflag.m4 b/Modules/_ctypes/libffi/m4/ax_gcc_archflag.m4
deleted file mode 100644
index aab2661c30..0000000000
--- a/Modules/_ctypes/libffi/m4/ax_gcc_archflag.m4
+++ /dev/null
@@ -1,225 +0,0 @@
-# ===========================================================================
-# http://www.gnu.org/software/autoconf-archive/ax_gcc_archflag.html
-# ===========================================================================
-#
-# SYNOPSIS
-#
-# AX_GCC_ARCHFLAG([PORTABLE?], [ACTION-SUCCESS], [ACTION-FAILURE])
-#
-# DESCRIPTION
-#
-# This macro tries to guess the "native" arch corresponding to the target
-# architecture for use with gcc's -march=arch or -mtune=arch flags. If
-# found, the cache variable $ax_cv_gcc_archflag is set to this flag and
-# ACTION-SUCCESS is executed; otherwise $ax_cv_gcc_archflag is set to
-# "unknown" and ACTION-FAILURE is executed. The default ACTION-SUCCESS is
-# to add $ax_cv_gcc_archflag to the end of $CFLAGS.
-#
-# PORTABLE? should be either [yes] (default) or [no]. In the former case,
-# the flag is set to -mtune (or equivalent) so that the architecture is
-# only used for tuning, but the instruction set used is still portable. In
-# the latter case, the flag is set to -march (or equivalent) so that
-# architecture-specific instructions are enabled.
-#
-# The user can specify --with-gcc-arch=<arch> in order to override the
-# macro's choice of architecture, or --without-gcc-arch to disable this.
-#
-# When cross-compiling, or if $CC is not gcc, then ACTION-FAILURE is
-# called unless the user specified --with-gcc-arch manually.
-#
-# Requires macros: AX_CHECK_COMPILE_FLAG, AX_GCC_X86_CPUID
-#
-# (The main emphasis here is on recent CPUs, on the principle that doing
-# high-performance computing on old hardware is uncommon.)
-#
-# LICENSE
-#
-# Copyright (c) 2008 Steven G. Johnson <stevenj@alum.mit.edu>
-# Copyright (c) 2008 Matteo Frigo
-# Copyright (c) 2012 Tsukasa Oi
-#
-# 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 3 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, see <http://www.gnu.org/licenses/>.
-#
-# As a special exception, the respective Autoconf Macro's copyright owner
-# gives unlimited permission to copy, distribute and modify the configure
-# scripts that are the output of Autoconf when processing the Macro. You
-# need not follow the terms of the GNU General Public License when using
-# or distributing such scripts, even though portions of the text of the
-# Macro appear in them. The GNU General Public License (GPL) does govern
-# all other use of the material that constitutes the Autoconf Macro.
-#
-# This special exception to the GPL applies to versions of the Autoconf
-# Macro released by the Autoconf Archive. When you make and distribute a
-# modified version of the Autoconf Macro, you may extend this special
-# exception to the GPL to apply to your modified version as well.
-
-#serial 11
-
-AC_DEFUN([AX_GCC_ARCHFLAG],
-[AC_REQUIRE([AC_PROG_CC])
-AC_REQUIRE([AC_CANONICAL_HOST])
-
-AC_ARG_WITH(gcc-arch, [AS_HELP_STRING([--with-gcc-arch=<arch>], [use architecture <arch> for gcc -march/-mtune, instead of guessing])],
- ax_gcc_arch=$withval, ax_gcc_arch=yes)
-
-AC_MSG_CHECKING([for gcc architecture flag])
-AC_MSG_RESULT([])
-AC_CACHE_VAL(ax_cv_gcc_archflag,
-[
-ax_cv_gcc_archflag="unknown"
-
-if test "$GCC" = yes; then
-
-if test "x$ax_gcc_arch" = xyes; then
-ax_gcc_arch=""
-if test "$cross_compiling" = no; then
-case $host_cpu in
- i[[3456]]86*|x86_64*) # use cpuid codes
- AX_GCC_X86_CPUID(0)
- AX_GCC_X86_CPUID(1)
- case $ax_cv_gcc_x86_cpuid_0 in
- *:756e6547:*:*) # Intel
- case $ax_cv_gcc_x86_cpuid_1 in
- *5[[48]]?:*:*:*) ax_gcc_arch="pentium-mmx pentium" ;;
- *5??:*:*:*) ax_gcc_arch=pentium ;;
- *0?6[[3456]]?:*:*:*) ax_gcc_arch="pentium2 pentiumpro" ;;
- *0?6a?:*[[01]]:*:*) ax_gcc_arch="pentium2 pentiumpro" ;;
- *0?6a?:*[[234]]:*:*) ax_gcc_arch="pentium3 pentiumpro" ;;
- *0?6[[9de]]?:*:*:*) ax_gcc_arch="pentium-m pentium3 pentiumpro" ;;
- *0?6[[78b]]?:*:*:*) ax_gcc_arch="pentium3 pentiumpro" ;;
- *0?6f?:*:*:*|*1?66?:*:*:*) ax_gcc_arch="core2 pentium-m pentium3 pentiumpro" ;;
- *1?6[[7d]]?:*:*:*) ax_gcc_arch="penryn core2 pentium-m pentium3 pentiumpro" ;;
- *1?6[[aef]]?:*:*:*|*2?6[[5cef]]?:*:*:*) ax_gcc_arch="corei7 core2 pentium-m pentium3 pentiumpro" ;;
- *1?6c?:*:*:*|*[[23]]?66?:*:*:*) ax_gcc_arch="atom core2 pentium-m pentium3 pentiumpro" ;;
- *2?6[[ad]]?:*:*:*) ax_gcc_arch="corei7-avx corei7 core2 pentium-m pentium3 pentiumpro" ;;
- *0?6??:*:*:*) ax_gcc_arch=pentiumpro ;;
- *6??:*:*:*) ax_gcc_arch="core2 pentiumpro" ;;
- ?000?f3[[347]]:*:*:*|?000?f4[1347]:*:*:*|?000?f6?:*:*:*)
- case $host_cpu in
- x86_64*) ax_gcc_arch="nocona pentium4 pentiumpro" ;;
- *) ax_gcc_arch="prescott pentium4 pentiumpro" ;;
- esac ;;
- ?000?f??:*:*:*) ax_gcc_arch="pentium4 pentiumpro";;
- esac ;;
- *:68747541:*:*) # AMD
- case $ax_cv_gcc_x86_cpuid_1 in
- *5[[67]]?:*:*:*) ax_gcc_arch=k6 ;;
- *5[[8d]]?:*:*:*) ax_gcc_arch="k6-2 k6" ;;
- *5[[9]]?:*:*:*) ax_gcc_arch="k6-3 k6" ;;
- *60?:*:*:*) ax_gcc_arch=k7 ;;
- *6[[12]]?:*:*:*) ax_gcc_arch="athlon k7" ;;
- *6[[34]]?:*:*:*) ax_gcc_arch="athlon-tbird k7" ;;
- *67?:*:*:*) ax_gcc_arch="athlon-4 athlon k7" ;;
- *6[[68a]]?:*:*:*)
- AX_GCC_X86_CPUID(0x80000006) # L2 cache size
- case $ax_cv_gcc_x86_cpuid_0x80000006 in
- *:*:*[[1-9a-f]]??????:*) # (L2 = ecx >> 16) >= 256
- ax_gcc_arch="athlon-xp athlon-4 athlon k7" ;;
- *) ax_gcc_arch="athlon-4 athlon k7" ;;
- esac ;;
- ?00??f[[4cef8b]]?:*:*:*) ax_gcc_arch="athlon64 k8" ;;
- ?00??f5?:*:*:*) ax_gcc_arch="opteron k8" ;;
- ?00??f7?:*:*:*) ax_gcc_arch="athlon-fx opteron k8" ;;
- ?00??f??:*:*:*) ax_gcc_arch="k8" ;;
- ?05??f??:*:*:*) ax_gcc_arch="btver1 amdfam10 k8" ;;
- ?06??f??:*:*:*) ax_gcc_arch="bdver1 amdfam10 k8" ;;
- *f??:*:*:*) ax_gcc_arch="amdfam10 k8" ;;
- esac ;;
- *:746e6543:*:*) # IDT
- case $ax_cv_gcc_x86_cpuid_1 in
- *54?:*:*:*) ax_gcc_arch=winchip-c6 ;;
- *58?:*:*:*) ax_gcc_arch=winchip2 ;;
- *6[[78]]?:*:*:*) ax_gcc_arch=c3 ;;
- *69?:*:*:*) ax_gcc_arch="c3-2 c3" ;;
- esac ;;
- esac
- if test x"$ax_gcc_arch" = x; then # fallback
- case $host_cpu in
- i586*) ax_gcc_arch=pentium ;;
- i686*) ax_gcc_arch=pentiumpro ;;
- esac
- fi
- ;;
-
- sparc*)
- AC_PATH_PROG([PRTDIAG], [prtdiag], [prtdiag], [$PATH:/usr/platform/`uname -i`/sbin/:/usr/platform/`uname -m`/sbin/])
- cputype=`(((grep cpu /proc/cpuinfo | cut -d: -f2) ; ($PRTDIAG -v |grep -i sparc) ; grep -i cpu /var/run/dmesg.boot ) | head -n 1) 2> /dev/null`
- cputype=`echo "$cputype" | tr -d ' -' | sed 's/SPARCIIi/SPARCII/' | tr $as_cr_LETTERS $as_cr_letters`
- case $cputype in
- *ultrasparciv*) ax_gcc_arch="ultrasparc4 ultrasparc3 ultrasparc v9" ;;
- *ultrasparciii*) ax_gcc_arch="ultrasparc3 ultrasparc v9" ;;
- *ultrasparc*) ax_gcc_arch="ultrasparc v9" ;;
- *supersparc*|*tms390z5[[05]]*) ax_gcc_arch="supersparc v8" ;;
- *hypersparc*|*rt62[[056]]*) ax_gcc_arch="hypersparc v8" ;;
- *cypress*) ax_gcc_arch=cypress ;;
- esac ;;
-
- alphaev5) ax_gcc_arch=ev5 ;;
- alphaev56) ax_gcc_arch=ev56 ;;
- alphapca56) ax_gcc_arch="pca56 ev56" ;;
- alphapca57) ax_gcc_arch="pca57 pca56 ev56" ;;
- alphaev6) ax_gcc_arch=ev6 ;;
- alphaev67) ax_gcc_arch=ev67 ;;
- alphaev68) ax_gcc_arch="ev68 ev67" ;;
- alphaev69) ax_gcc_arch="ev69 ev68 ev67" ;;
- alphaev7) ax_gcc_arch="ev7 ev69 ev68 ev67" ;;
- alphaev79) ax_gcc_arch="ev79 ev7 ev69 ev68 ev67" ;;
-
- powerpc*)
- cputype=`((grep cpu /proc/cpuinfo | head -n 1 | cut -d: -f2 | cut -d, -f1 | sed 's/ //g') ; /usr/bin/machine ; /bin/machine; grep CPU /var/run/dmesg.boot | head -n 1 | cut -d" " -f2) 2> /dev/null`
- cputype=`echo $cputype | sed -e 's/ppc//g;s/ *//g'`
- case $cputype in
- *750*) ax_gcc_arch="750 G3" ;;
- *740[[0-9]]*) ax_gcc_arch="$cputype 7400 G4" ;;
- *74[[4-5]][[0-9]]*) ax_gcc_arch="$cputype 7450 G4" ;;
- *74[[0-9]][[0-9]]*) ax_gcc_arch="$cputype G4" ;;
- *970*) ax_gcc_arch="970 G5 power4";;
- *POWER4*|*power4*|*gq*) ax_gcc_arch="power4 970";;
- *POWER5*|*power5*|*gr*|*gs*) ax_gcc_arch="power5 power4 970";;
- 603ev|8240) ax_gcc_arch="$cputype 603e 603";;
- *) ax_gcc_arch=$cputype ;;
- esac
- ax_gcc_arch="$ax_gcc_arch powerpc"
- ;;
-esac
-fi # not cross-compiling
-fi # guess arch
-
-if test "x$ax_gcc_arch" != x -a "x$ax_gcc_arch" != xno; then
-for arch in $ax_gcc_arch; do
- if test "x[]m4_default([$1],yes)" = xyes; then # if we require portable code
- flags="-mtune=$arch"
- # -mcpu=$arch and m$arch generate nonportable code on every arch except
- # x86. And some other arches (e.g. Alpha) don't accept -mtune. Grrr.
- case $host_cpu in i*86|x86_64*) flags="$flags -mcpu=$arch -m$arch";; esac
- else
- flags="-march=$arch -mcpu=$arch -m$arch"
- fi
- for flag in $flags; do
- AX_CHECK_COMPILE_FLAG($flag, [ax_cv_gcc_archflag=$flag; break])
- done
- test "x$ax_cv_gcc_archflag" = xunknown || break
-done
-fi
-
-fi # $GCC=yes
-])
-AC_MSG_CHECKING([for gcc architecture flag])
-AC_MSG_RESULT($ax_cv_gcc_archflag)
-if test "x$ax_cv_gcc_archflag" = xunknown; then
- m4_default([$3],:)
-else
- m4_default([$2], [CFLAGS="$CFLAGS $ax_cv_gcc_archflag"])
-fi
-])
diff --git a/Modules/_ctypes/libffi/m4/ax_gcc_x86_cpuid.m4 b/Modules/_ctypes/libffi/m4/ax_gcc_x86_cpuid.m4
deleted file mode 100644
index 7d46fee021..0000000000
--- a/Modules/_ctypes/libffi/m4/ax_gcc_x86_cpuid.m4
+++ /dev/null
@@ -1,79 +0,0 @@
-# ===========================================================================
-# http://www.gnu.org/software/autoconf-archive/ax_gcc_x86_cpuid.html
-# ===========================================================================
-#
-# SYNOPSIS
-#
-# AX_GCC_X86_CPUID(OP)
-#
-# DESCRIPTION
-#
-# On Pentium and later x86 processors, with gcc or a compiler that has a
-# compatible syntax for inline assembly instructions, run a small program
-# that executes the cpuid instruction with input OP. This can be used to
-# detect the CPU type.
-#
-# On output, the values of the eax, ebx, ecx, and edx registers are stored
-# as hexadecimal strings as "eax:ebx:ecx:edx" in the cache variable
-# ax_cv_gcc_x86_cpuid_OP.
-#
-# If the cpuid instruction fails (because you are running a
-# cross-compiler, or because you are not using gcc, or because you are on
-# a processor that doesn't have this instruction), ax_cv_gcc_x86_cpuid_OP
-# is set to the string "unknown".
-#
-# This macro mainly exists to be used in AX_GCC_ARCHFLAG.
-#
-# LICENSE
-#
-# Copyright (c) 2008 Steven G. Johnson <stevenj@alum.mit.edu>
-# Copyright (c) 2008 Matteo Frigo
-#
-# 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 3 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, see <http://www.gnu.org/licenses/>.
-#
-# As a special exception, the respective Autoconf Macro's copyright owner
-# gives unlimited permission to copy, distribute and modify the configure
-# scripts that are the output of Autoconf when processing the Macro. You
-# need not follow the terms of the GNU General Public License when using
-# or distributing such scripts, even though portions of the text of the
-# Macro appear in them. The GNU General Public License (GPL) does govern
-# all other use of the material that constitutes the Autoconf Macro.
-#
-# This special exception to the GPL applies to versions of the Autoconf
-# Macro released by the Autoconf Archive. When you make and distribute a
-# modified version of the Autoconf Macro, you may extend this special
-# exception to the GPL to apply to your modified version as well.
-
-#serial 7
-
-AC_DEFUN([AX_GCC_X86_CPUID],
-[AC_REQUIRE([AC_PROG_CC])
-AC_LANG_PUSH([C])
-AC_CACHE_CHECK(for x86 cpuid $1 output, ax_cv_gcc_x86_cpuid_$1,
- [AC_RUN_IFELSE([AC_LANG_PROGRAM([#include <stdio.h>], [
- int op = $1, eax, ebx, ecx, edx;
- FILE *f;
- __asm__("cpuid"
- : "=a" (eax), "=b" (ebx), "=c" (ecx), "=d" (edx)
- : "a" (op));
- f = fopen("conftest_cpuid", "w"); if (!f) return 1;
- fprintf(f, "%x:%x:%x:%x\n", eax, ebx, ecx, edx);
- fclose(f);
- return 0;
-])],
- [ax_cv_gcc_x86_cpuid_$1=`cat conftest_cpuid`; rm -f conftest_cpuid],
- [ax_cv_gcc_x86_cpuid_$1=unknown; rm -f conftest_cpuid],
- [ax_cv_gcc_x86_cpuid_$1=unknown])])
-AC_LANG_POP([C])
-])
diff --git a/Modules/_ctypes/libffi/m4/libtool.m4 b/Modules/_ctypes/libffi/m4/libtool.m4
deleted file mode 100644
index d9cc77b840..0000000000
--- a/Modules/_ctypes/libffi/m4/libtool.m4
+++ /dev/null
@@ -1,7989 +0,0 @@
-# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
-#
-# Copyright (C) 1996-2001, 2003-2013 Free Software Foundation, Inc.
-# Written by Gordon Matzigkeit, 1996
-#
-# 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.
-
-m4_define([_LT_COPYING], [dnl
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
-# 2006, 2007, 2008, 2009, 2010, 2011 Free Software
-# Foundation, Inc.
-# Written by Gordon Matzigkeit, 1996
-#
-# This file is part of GNU Libtool.
-#
-# GNU Libtool 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.
-#
-# As a special exception to the GNU General Public License,
-# if you distribute this file as part of a program or library that
-# is built using GNU Libtool, you may include this file under the
-# same distribution terms that you use for the rest of that program.
-#
-# GNU Libtool 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 GNU Libtool; see the file COPYING. If not, a copy
-# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
-# obtained by writing to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-])
-
-# serial 58 LT_INIT
-
-
-# LT_PREREQ(VERSION)
-# ------------------
-# Complain and exit if this libtool version is less that VERSION.
-m4_defun([LT_PREREQ],
-[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1,
- [m4_default([$3],
- [m4_fatal([Libtool version $1 or higher is required],
- 63)])],
- [$2])])
-
-
-# _LT_CHECK_BUILDDIR
-# ------------------
-# Complain if the absolute build directory name contains unusual characters
-m4_defun([_LT_CHECK_BUILDDIR],
-[case `pwd` in
- *\ * | *\ *)
- AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;;
-esac
-])
-
-
-# LT_INIT([OPTIONS])
-# ------------------
-AC_DEFUN([LT_INIT],
-[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT
-AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
-AC_BEFORE([$0], [LT_LANG])dnl
-AC_BEFORE([$0], [LT_OUTPUT])dnl
-AC_BEFORE([$0], [LTDL_INIT])dnl
-m4_require([_LT_CHECK_BUILDDIR])dnl
-
-dnl Autoconf doesn't catch unexpanded LT_ macros by default:
-m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl
-m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl
-dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4
-dnl unless we require an AC_DEFUNed macro:
-AC_REQUIRE([LTOPTIONS_VERSION])dnl
-AC_REQUIRE([LTSUGAR_VERSION])dnl
-AC_REQUIRE([LTVERSION_VERSION])dnl
-AC_REQUIRE([LTOBSOLETE_VERSION])dnl
-m4_require([_LT_PROG_LTMAIN])dnl
-
-_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}])
-
-dnl Parse OPTIONS
-_LT_SET_OPTIONS([$0], [$1])
-
-# This can be used to rebuild libtool when needed
-LIBTOOL_DEPS=$ltmain
-
-# Always use our own libtool.
-LIBTOOL='$(SHELL) $(top_builddir)/libtool'
-AC_SUBST(LIBTOOL)dnl
-
-_LT_SETUP
-
-# Only expand once:
-m4_define([LT_INIT])
-])# LT_INIT
-
-# Old names:
-AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT])
-AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_PROG_LIBTOOL], [])
-dnl AC_DEFUN([AM_PROG_LIBTOOL], [])
-
-
-# _LT_CC_BASENAME(CC)
-# -------------------
-# Calculate cc_basename. Skip known compiler wrappers and cross-prefix.
-m4_defun([_LT_CC_BASENAME],
-[for cc_temp in $1""; do
- case $cc_temp in
- compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
- distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
- \-*) ;;
- *) break;;
- esac
-done
-cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
-])
-
-
-# _LT_FILEUTILS_DEFAULTS
-# ----------------------
-# It is okay to use these file commands and assume they have been set
-# sensibly after 'm4_require([_LT_FILEUTILS_DEFAULTS])'.
-m4_defun([_LT_FILEUTILS_DEFAULTS],
-[: ${CP="cp -f"}
-: ${MV="mv -f"}
-: ${RM="rm -f"}
-])# _LT_FILEUTILS_DEFAULTS
-
-
-# _LT_SETUP
-# ---------
-m4_defun([_LT_SETUP],
-[AC_REQUIRE([AC_CANONICAL_HOST])dnl
-AC_REQUIRE([AC_CANONICAL_BUILD])dnl
-AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl
-AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
-
-_LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl
-dnl
-_LT_DECL([], [host_alias], [0], [The host system])dnl
-_LT_DECL([], [host], [0])dnl
-_LT_DECL([], [host_os], [0])dnl
-dnl
-_LT_DECL([], [build_alias], [0], [The build system])dnl
-_LT_DECL([], [build], [0])dnl
-_LT_DECL([], [build_os], [0])dnl
-dnl
-AC_REQUIRE([AC_PROG_CC])dnl
-AC_REQUIRE([LT_PATH_LD])dnl
-AC_REQUIRE([LT_PATH_NM])dnl
-dnl
-AC_REQUIRE([AC_PROG_LN_S])dnl
-test -z "$LN_S" && LN_S="ln -s"
-_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl
-dnl
-AC_REQUIRE([LT_CMD_MAX_LEN])dnl
-_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl
-_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl
-dnl
-m4_require([_LT_FILEUTILS_DEFAULTS])dnl
-m4_require([_LT_CHECK_SHELL_FEATURES])dnl
-m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl
-m4_require([_LT_CMD_RELOAD])dnl
-m4_require([_LT_CHECK_MAGIC_METHOD])dnl
-m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl
-m4_require([_LT_CMD_OLD_ARCHIVE])dnl
-m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
-m4_require([_LT_WITH_SYSROOT])dnl
-
-_LT_CONFIG_LIBTOOL_INIT([
-# See if we are running on zsh, and set the options that allow our
-# commands through without removal of \ escapes INIT.
-if test -n "\${ZSH_VERSION+set}"; then
- setopt NO_GLOB_SUBST
-fi
-])
-if test -n "${ZSH_VERSION+set}"; then
- setopt NO_GLOB_SUBST
-fi
-
-_LT_CHECK_OBJDIR
-
-m4_require([_LT_TAG_COMPILER])dnl
-
-case $host_os in
-aix3*)
- # AIX sometimes has problems with the GCC collect2 program. For some
- # reason, if we set the COLLECT_NAMES environment variable, the problems
- # vanish in a puff of smoke.
- if test set != "${COLLECT_NAMES+set}"; then
- COLLECT_NAMES=
- export COLLECT_NAMES
- fi
- ;;
-esac
-
-# Global variables:
-ofile=libtool
-can_build_shared=yes
-
-# All known linkers require a '.a' archive for static linking (except MSVC,
-# which needs '.lib').
-libext=a
-
-with_gnu_ld=$lt_cv_prog_gnu_ld
-
-old_CC=$CC
-old_CFLAGS=$CFLAGS
-
-# Set sane defaults for various variables
-test -z "$CC" && CC=cc
-test -z "$LTCC" && LTCC=$CC
-test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
-test -z "$LD" && LD=ld
-test -z "$ac_objext" && ac_objext=o
-
-_LT_CC_BASENAME([$compiler])
-
-# Only perform the check for file, if the check method requires it
-test -z "$MAGIC_CMD" && MAGIC_CMD=file
-case $deplibs_check_method in
-file_magic*)
- if test "$file_magic_cmd" = '$MAGIC_CMD'; then
- _LT_PATH_MAGIC
- fi
- ;;
-esac
-
-# Use C for the default configuration in the libtool script
-LT_SUPPORTED_TAG([CC])
-_LT_LANG_C_CONFIG
-_LT_LANG_DEFAULT_CONFIG
-_LT_CONFIG_COMMANDS
-])# _LT_SETUP
-
-
-# _LT_PREPARE_SED_QUOTE_VARS
-# --------------------------
-# Define a few sed substitution that help us do robust quoting.
-m4_defun([_LT_PREPARE_SED_QUOTE_VARS],
-[# Backslashify metacharacters that are still active within
-# double-quoted strings.
-sed_quote_subst='s/\([["`$\\]]\)/\\\1/g'
-
-# Same as above, but do not quote variable references.
-double_quote_subst='s/\([["`\\]]\)/\\\1/g'
-
-# Sed substitution to delay expansion of an escaped shell variable in a
-# double_quote_subst'ed string.
-delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
-
-# Sed substitution to delay expansion of an escaped single quote.
-delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
-
-# Sed substitution to avoid accidental globbing in evaled expressions
-no_glob_subst='s/\*/\\\*/g'
-])
-
-# _LT_PROG_LTMAIN
-# ---------------
-# Note that this code is called both from 'configure', and 'config.status'
-# now that we use AC_CONFIG_COMMANDS to generate libtool. Notably,
-# 'config.status' has no value for ac_aux_dir unless we are using Automake,
-# so we pass a copy along to make sure it has a sensible value anyway.
-m4_defun([_LT_PROG_LTMAIN],
-[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl
-_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir'])
-ltmain=$ac_aux_dir/ltmain.sh
-])# _LT_PROG_LTMAIN
-
-
-## ------------------------------------- ##
-## Accumulate code for creating libtool. ##
-## ------------------------------------- ##
-
-# So that we can recreate a full libtool script including additional
-# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS
-# in macros and then make a single call at the end using the 'libtool'
-# label.
-
-
-# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS])
-# ----------------------------------------
-# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later.
-m4_define([_LT_CONFIG_LIBTOOL_INIT],
-[m4_ifval([$1],
- [m4_append([_LT_OUTPUT_LIBTOOL_INIT],
- [$1
-])])])
-
-# Initialize.
-m4_define([_LT_OUTPUT_LIBTOOL_INIT])
-
-
-# _LT_CONFIG_LIBTOOL([COMMANDS])
-# ------------------------------
-# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later.
-m4_define([_LT_CONFIG_LIBTOOL],
-[m4_ifval([$1],
- [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS],
- [$1
-])])])
-
-# Initialize.
-m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS])
-
-
-# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS])
-# -----------------------------------------------------
-m4_defun([_LT_CONFIG_SAVE_COMMANDS],
-[_LT_CONFIG_LIBTOOL([$1])
-_LT_CONFIG_LIBTOOL_INIT([$2])
-])
-
-
-# _LT_FORMAT_COMMENT([COMMENT])
-# -----------------------------
-# Add leading comment marks to the start of each line, and a trailing
-# full-stop to the whole comment if one is not present already.
-m4_define([_LT_FORMAT_COMMENT],
-[m4_ifval([$1], [
-m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])],
- [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.])
-)])
-
-
-
-## ------------------------ ##
-## FIXME: Eliminate VARNAME ##
-## ------------------------ ##
-
-
-# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?])
-# -------------------------------------------------------------------
-# CONFIGNAME is the name given to the value in the libtool script.
-# VARNAME is the (base) name used in the configure script.
-# VALUE may be 0, 1 or 2 for a computed quote escaped value based on
-# VARNAME. Any other value will be used directly.
-m4_define([_LT_DECL],
-[lt_if_append_uniq([lt_decl_varnames], [$2], [, ],
- [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name],
- [m4_ifval([$1], [$1], [$2])])
- lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3])
- m4_ifval([$4],
- [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])])
- lt_dict_add_subkey([lt_decl_dict], [$2],
- [tagged?], [m4_ifval([$5], [yes], [no])])])
-])
-
-
-# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION])
-# --------------------------------------------------------
-m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])])
-
-
-# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...])
-# ------------------------------------------------
-m4_define([lt_decl_tag_varnames],
-[_lt_decl_filter([tagged?], [yes], $@)])
-
-
-# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..])
-# ---------------------------------------------------------
-m4_define([_lt_decl_filter],
-[m4_case([$#],
- [0], [m4_fatal([$0: too few arguments: $#])],
- [1], [m4_fatal([$0: too few arguments: $#: $1])],
- [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)],
- [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)],
- [lt_dict_filter([lt_decl_dict], $@)])[]dnl
-])
-
-
-# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...])
-# --------------------------------------------------
-m4_define([lt_decl_quote_varnames],
-[_lt_decl_filter([value], [1], $@)])
-
-
-# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...])
-# ---------------------------------------------------
-m4_define([lt_decl_dquote_varnames],
-[_lt_decl_filter([value], [2], $@)])
-
-
-# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...])
-# ---------------------------------------------------
-m4_define([lt_decl_varnames_tagged],
-[m4_assert([$# <= 2])dnl
-_$0(m4_quote(m4_default([$1], [[, ]])),
- m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]),
- m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))])
-m4_define([_lt_decl_varnames_tagged],
-[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])])
-
-
-# lt_decl_all_varnames([SEPARATOR], [VARNAME1...])
-# ------------------------------------------------
-m4_define([lt_decl_all_varnames],
-[_$0(m4_quote(m4_default([$1], [[, ]])),
- m4_if([$2], [],
- m4_quote(lt_decl_varnames),
- m4_quote(m4_shift($@))))[]dnl
-])
-m4_define([_lt_decl_all_varnames],
-[lt_join($@, lt_decl_varnames_tagged([$1],
- lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl
-])
-
-
-# _LT_CONFIG_STATUS_DECLARE([VARNAME])
-# ------------------------------------
-# Quote a variable value, and forward it to 'config.status' so that its
-# declaration there will have the same value as in 'configure'. VARNAME
-# must have a single quote delimited value for this to work.
-m4_define([_LT_CONFIG_STATUS_DECLARE],
-[$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`'])
-
-
-# _LT_CONFIG_STATUS_DECLARATIONS
-# ------------------------------
-# We delimit libtool config variables with single quotes, so when
-# we write them to config.status, we have to be sure to quote all
-# embedded single quotes properly. In configure, this macro expands
-# each variable declared with _LT_DECL (and _LT_TAGDECL) into:
-#
-# <var>='`$ECHO "$<var>" | $SED "$delay_single_quote_subst"`'
-m4_defun([_LT_CONFIG_STATUS_DECLARATIONS],
-[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames),
- [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])])
-
-
-# _LT_LIBTOOL_TAGS
-# ----------------
-# Output comment and list of tags supported by the script
-m4_defun([_LT_LIBTOOL_TAGS],
-[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl
-available_tags='_LT_TAGS'dnl
-])
-
-
-# _LT_LIBTOOL_DECLARE(VARNAME, [TAG])
-# -----------------------------------
-# Extract the dictionary values for VARNAME (optionally with TAG) and
-# expand to a commented shell variable setting:
-#
-# # Some comment about what VAR is for.
-# visible_name=$lt_internal_name
-m4_define([_LT_LIBTOOL_DECLARE],
-[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1],
- [description])))[]dnl
-m4_pushdef([_libtool_name],
- m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl
-m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])),
- [0], [_libtool_name=[$]$1],
- [1], [_libtool_name=$lt_[]$1],
- [2], [_libtool_name=$lt_[]$1],
- [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl
-m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl
-])
-
-
-# _LT_LIBTOOL_CONFIG_VARS
-# -----------------------
-# Produce commented declarations of non-tagged libtool config variables
-# suitable for insertion in the LIBTOOL CONFIG section of the 'libtool'
-# script. Tagged libtool config variables (even for the LIBTOOL CONFIG
-# section) are produced by _LT_LIBTOOL_TAG_VARS.
-m4_defun([_LT_LIBTOOL_CONFIG_VARS],
-[m4_foreach([_lt_var],
- m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)),
- [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])])
-
-
-# _LT_LIBTOOL_TAG_VARS(TAG)
-# -------------------------
-m4_define([_LT_LIBTOOL_TAG_VARS],
-[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames),
- [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])])
-
-
-# _LT_TAGVAR(VARNAME, [TAGNAME])
-# ------------------------------
-m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])])
-
-
-# _LT_CONFIG_COMMANDS
-# -------------------
-# Send accumulated output to $CONFIG_STATUS. Thanks to the lists of
-# variables for single and double quote escaping we saved from calls
-# to _LT_DECL, we can put quote escaped variables declarations
-# into 'config.status', and then the shell code to quote escape them in
-# for loops in 'config.status'. Finally, any additional code accumulated
-# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded.
-m4_defun([_LT_CONFIG_COMMANDS],
-[AC_PROVIDE_IFELSE([LT_OUTPUT],
- dnl If the libtool generation code has been placed in $CONFIG_LT,
- dnl instead of duplicating it all over again into config.status,
- dnl then we will have config.status run $CONFIG_LT later, so it
- dnl needs to know what name is stored there:
- [AC_CONFIG_COMMANDS([libtool],
- [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])],
- dnl If the libtool generation code is destined for config.status,
- dnl expand the accumulated commands and init code now:
- [AC_CONFIG_COMMANDS([libtool],
- [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])])
-])#_LT_CONFIG_COMMANDS
-
-
-# Initialize.
-m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT],
-[
-
-# The HP-UX ksh and POSIX shell print the target directory to stdout
-# if CDPATH is set.
-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
-
-sed_quote_subst='$sed_quote_subst'
-double_quote_subst='$double_quote_subst'
-delay_variable_subst='$delay_variable_subst'
-_LT_CONFIG_STATUS_DECLARATIONS
-LTCC='$LTCC'
-LTCFLAGS='$LTCFLAGS'
-compiler='$compiler_DEFAULT'
-
-# A function that is used when there is no print builtin or printf.
-func_fallback_echo ()
-{
- eval 'cat <<_LTECHO_EOF
-\$[]1
-_LTECHO_EOF'
-}
-
-# Quote evaled strings.
-for var in lt_decl_all_varnames([[ \
-]], lt_decl_quote_varnames); do
- case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
- *[[\\\\\\\`\\"\\\$]]*)
- eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes
- ;;
- *)
- eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
- ;;
- esac
-done
-
-# Double-quote double-evaled strings.
-for var in lt_decl_all_varnames([[ \
-]], lt_decl_dquote_varnames); do
- case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
- *[[\\\\\\\`\\"\\\$]]*)
- eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes
- ;;
- *)
- eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
- ;;
- esac
-done
-
-_LT_OUTPUT_LIBTOOL_INIT
-])
-
-# _LT_GENERATED_FILE_INIT(FILE, [COMMENT])
-# ------------------------------------
-# Generate a child script FILE with all initialization necessary to
-# reuse the environment learned by the parent script, and make the
-# file executable. If COMMENT is supplied, it is inserted after the
-# '#!' sequence but before initialization text begins. After this
-# macro, additional text can be appended to FILE to form the body of
-# the child script. The macro ends with non-zero status if the
-# file could not be fully written (such as if the disk is full).
-m4_ifdef([AS_INIT_GENERATED],
-[m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])],
-[m4_defun([_LT_GENERATED_FILE_INIT],
-[m4_require([AS_PREPARE])]dnl
-[m4_pushdef([AS_MESSAGE_LOG_FD])]dnl
-[lt_write_fail=0
-cat >$1 <<_ASEOF || lt_write_fail=1
-#! $SHELL
-# Generated by $as_me.
-$2
-SHELL=\${CONFIG_SHELL-$SHELL}
-export SHELL
-_ASEOF
-cat >>$1 <<\_ASEOF || lt_write_fail=1
-AS_SHELL_SANITIZE
-_AS_PREPARE
-exec AS_MESSAGE_FD>&1
-_ASEOF
-test 0 = "$lt_write_fail" && chmod +x $1[]dnl
-m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT
-
-# LT_OUTPUT
-# ---------
-# This macro allows early generation of the libtool script (before
-# AC_OUTPUT is called), incase it is used in configure for compilation
-# tests.
-AC_DEFUN([LT_OUTPUT],
-[: ${CONFIG_LT=./config.lt}
-AC_MSG_NOTICE([creating $CONFIG_LT])
-_LT_GENERATED_FILE_INIT(["$CONFIG_LT"],
-[# Run this file to recreate a libtool stub with the current configuration.])
-
-cat >>"$CONFIG_LT" <<\_LTEOF
-lt_cl_silent=false
-exec AS_MESSAGE_LOG_FD>>config.log
-{
- echo
- AS_BOX([Running $as_me.])
-} >&AS_MESSAGE_LOG_FD
-
-lt_cl_help="\
-'$as_me' creates a local libtool stub from the current configuration,
-for use in further configure time tests before the real libtool is
-generated.
-
-Usage: $[0] [[OPTIONS]]
-
- -h, --help print this help, then exit
- -V, --version print version number, then exit
- -q, --quiet do not print progress messages
- -d, --debug don't remove temporary files
-
-Report bugs to <bug-libtool@gnu.org>."
-
-lt_cl_version="\
-m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl
-m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
-configured by $[0], generated by m4_PACKAGE_STRING.
-
-Copyright (C) 2011 Free Software Foundation, Inc.
-This config.lt script is free software; the Free Software Foundation
-gives unlimited permision to copy, distribute and modify it."
-
-while test 0 != $[#]
-do
- case $[1] in
- --version | --v* | -V )
- echo "$lt_cl_version"; exit 0 ;;
- --help | --h* | -h )
- echo "$lt_cl_help"; exit 0 ;;
- --debug | --d* | -d )
- debug=: ;;
- --quiet | --q* | --silent | --s* | -q )
- lt_cl_silent=: ;;
-
- -*) AC_MSG_ERROR([unrecognized option: $[1]
-Try '$[0] --help' for more information.]) ;;
-
- *) AC_MSG_ERROR([unrecognized argument: $[1]
-Try '$[0] --help' for more information.]) ;;
- esac
- shift
-done
-
-if $lt_cl_silent; then
- exec AS_MESSAGE_FD>/dev/null
-fi
-_LTEOF
-
-cat >>"$CONFIG_LT" <<_LTEOF
-_LT_OUTPUT_LIBTOOL_COMMANDS_INIT
-_LTEOF
-
-cat >>"$CONFIG_LT" <<\_LTEOF
-AC_MSG_NOTICE([creating $ofile])
-_LT_OUTPUT_LIBTOOL_COMMANDS
-AS_EXIT(0)
-_LTEOF
-chmod +x "$CONFIG_LT"
-
-# configure is writing to config.log, but config.lt does its own redirection,
-# appending to config.log, which fails on DOS, as config.log is still kept
-# open by configure. Here we exec the FD to /dev/null, effectively closing
-# config.log, so it can be properly (re)opened and appended to by config.lt.
-lt_cl_success=:
-test yes = "$silent" &&
- lt_config_lt_args="$lt_config_lt_args --quiet"
-exec AS_MESSAGE_LOG_FD>/dev/null
-$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
-exec AS_MESSAGE_LOG_FD>>config.log
-$lt_cl_success || AS_EXIT(1)
-])# LT_OUTPUT
-
-
-# _LT_CONFIG(TAG)
-# ---------------
-# If TAG is the built-in tag, create an initial libtool script with a
-# default configuration from the untagged config vars. Otherwise add code
-# to config.status for appending the configuration named by TAG from the
-# matching tagged config vars.
-m4_defun([_LT_CONFIG],
-[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
-_LT_CONFIG_SAVE_COMMANDS([
- m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl
- m4_if(_LT_TAG, [C], [
- # See if we are running on zsh, and set the options that allow our
- # commands through without removal of \ escapes.
- if test -n "${ZSH_VERSION+set}"; then
- setopt NO_GLOB_SUBST
- fi
-
- cfgfile=${ofile}T
- trap "$RM \"$cfgfile\"; exit 1" 1 2 15
- $RM "$cfgfile"
-
- cat <<_LT_EOF >> "$cfgfile"
-#! $SHELL
-
-# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
-# Generated automatically by $as_me ($PACKAGE) $VERSION
-# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
-# NOTE: Changes made to this file will be lost: look at ltmain.sh.
-#
-_LT_COPYING
-_LT_LIBTOOL_TAGS
-
-# ### BEGIN LIBTOOL CONFIG
-_LT_LIBTOOL_CONFIG_VARS
-_LT_LIBTOOL_TAG_VARS
-# ### END LIBTOOL CONFIG
-
-_LT_EOF
-
- case $host_os in
- aix3*)
- cat <<\_LT_EOF >> "$cfgfile"
-# AIX sometimes has problems with the GCC collect2 program. For some
-# reason, if we set the COLLECT_NAMES environment variable, the problems
-# vanish in a puff of smoke.
-if test set != "${COLLECT_NAMES+set}"; then
- COLLECT_NAMES=
- export COLLECT_NAMES
-fi
-_LT_EOF
- ;;
- esac
-
- _LT_PROG_LTMAIN
-
- # We use sed instead of cat because bash on DJGPP gets confused if
- # if finds mixed CR/LF and LF-only lines. Since sed operates in
- # text mode, it properly converts lines to CR/LF. This bash problem
- # is reportedly fixed, but why not run on old versions too?
- sed '$q' "$ltmain" >> "$cfgfile" \
- || (rm -f "$cfgfile"; exit 1)
-
- mv -f "$cfgfile" "$ofile" ||
- (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
- chmod +x "$ofile"
-],
-[cat <<_LT_EOF >> "$ofile"
-
-dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded
-dnl in a comment (ie after a #).
-# ### BEGIN LIBTOOL TAG CONFIG: $1
-_LT_LIBTOOL_TAG_VARS(_LT_TAG)
-# ### END LIBTOOL TAG CONFIG: $1
-_LT_EOF
-])dnl /m4_if
-],
-[m4_if([$1], [], [
- PACKAGE='$PACKAGE'
- VERSION='$VERSION'
- RM='$RM'
- ofile='$ofile'], [])
-])dnl /_LT_CONFIG_SAVE_COMMANDS
-])# _LT_CONFIG
-
-
-# LT_SUPPORTED_TAG(TAG)
-# ---------------------
-# Trace this macro to discover what tags are supported by the libtool
-# --tag option, using:
-# autoconf --trace 'LT_SUPPORTED_TAG:$1'
-AC_DEFUN([LT_SUPPORTED_TAG], [])
-
-
-# C support is built-in for now
-m4_define([_LT_LANG_C_enabled], [])
-m4_define([_LT_TAGS], [])
-
-
-# LT_LANG(LANG)
-# -------------
-# Enable libtool support for the given language if not already enabled.
-AC_DEFUN([LT_LANG],
-[AC_BEFORE([$0], [LT_OUTPUT])dnl
-m4_case([$1],
- [C], [_LT_LANG(C)],
- [C++], [_LT_LANG(CXX)],
- [Go], [_LT_LANG(GO)],
- [Java], [_LT_LANG(GCJ)],
- [Fortran 77], [_LT_LANG(F77)],
- [Fortran], [_LT_LANG(FC)],
- [Windows Resource], [_LT_LANG(RC)],
- [m4_ifdef([_LT_LANG_]$1[_CONFIG],
- [_LT_LANG($1)],
- [m4_fatal([$0: unsupported language: "$1"])])])dnl
-])# LT_LANG
-
-
-# _LT_LANG(LANGNAME)
-# ------------------
-m4_defun([_LT_LANG],
-[m4_ifdef([_LT_LANG_]$1[_enabled], [],
- [LT_SUPPORTED_TAG([$1])dnl
- m4_append([_LT_TAGS], [$1 ])dnl
- m4_define([_LT_LANG_]$1[_enabled], [])dnl
- _LT_LANG_$1_CONFIG($1)])dnl
-])# _LT_LANG
-
-
-m4_ifndef([AC_PROG_GO], [
-############################################################
-# NOTE: This macro has been submitted for inclusion into #
-# GNU Autoconf as AC_PROG_GO. When it is available in #
-# a released version of Autoconf we should remove this #
-# macro and use it instead. #
-############################################################
-m4_defun([AC_PROG_GO],
-[AC_LANG_PUSH(Go)dnl
-AC_ARG_VAR([GOC], [Go compiler command])dnl
-AC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl
-_AC_ARG_VAR_LDFLAGS()dnl
-AC_CHECK_TOOL(GOC, gccgo)
-if test -z "$GOC"; then
- if test -n "$ac_tool_prefix"; then
- AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo])
- fi
-fi
-if test -z "$GOC"; then
- AC_CHECK_PROG(GOC, gccgo, gccgo, false)
-fi
-])#m4_defun
-])#m4_ifndef
-
-
-# _LT_LANG_DEFAULT_CONFIG
-# -----------------------
-m4_defun([_LT_LANG_DEFAULT_CONFIG],
-[AC_PROVIDE_IFELSE([AC_PROG_CXX],
- [LT_LANG(CXX)],
- [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])])
-
-AC_PROVIDE_IFELSE([AC_PROG_F77],
- [LT_LANG(F77)],
- [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])])
-
-AC_PROVIDE_IFELSE([AC_PROG_FC],
- [LT_LANG(FC)],
- [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])])
-
-dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal
-dnl pulling things in needlessly.
-AC_PROVIDE_IFELSE([AC_PROG_GCJ],
- [LT_LANG(GCJ)],
- [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
- [LT_LANG(GCJ)],
- [AC_PROVIDE_IFELSE([LT_PROG_GCJ],
- [LT_LANG(GCJ)],
- [m4_ifdef([AC_PROG_GCJ],
- [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])])
- m4_ifdef([A][M_PROG_GCJ],
- [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])])
- m4_ifdef([LT_PROG_GCJ],
- [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])])
-
-AC_PROVIDE_IFELSE([AC_PROG_GO],
- [LT_LANG(GO)],
- [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])])
-
-AC_PROVIDE_IFELSE([LT_PROG_RC],
- [LT_LANG(RC)],
- [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])])
-])# _LT_LANG_DEFAULT_CONFIG
-
-# Obsolete macros:
-AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)])
-AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)])
-AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)])
-AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)])
-AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_LIBTOOL_CXX], [])
-dnl AC_DEFUN([AC_LIBTOOL_F77], [])
-dnl AC_DEFUN([AC_LIBTOOL_FC], [])
-dnl AC_DEFUN([AC_LIBTOOL_GCJ], [])
-dnl AC_DEFUN([AC_LIBTOOL_RC], [])
-
-
-# _LT_TAG_COMPILER
-# ----------------
-m4_defun([_LT_TAG_COMPILER],
-[AC_REQUIRE([AC_PROG_CC])dnl
-
-_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl
-_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl
-_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl
-_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl
-
-# If no C compiler was specified, use CC.
-LTCC=${LTCC-"$CC"}
-
-# If no C compiler flags were specified, use CFLAGS.
-LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
-
-# Allow CC to be a program name with arguments.
-compiler=$CC
-])# _LT_TAG_COMPILER
-
-
-# _LT_COMPILER_BOILERPLATE
-# ------------------------
-# Check for compiler boilerplate output or warnings with
-# the simple compiler test code.
-m4_defun([_LT_COMPILER_BOILERPLATE],
-[m4_require([_LT_DECL_SED])dnl
-ac_outfile=conftest.$ac_objext
-echo "$lt_simple_compile_test_code" >conftest.$ac_ext
-eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
-_lt_compiler_boilerplate=`cat conftest.err`
-$RM conftest*
-])# _LT_COMPILER_BOILERPLATE
-
-
-# _LT_LINKER_BOILERPLATE
-# ----------------------
-# Check for linker boilerplate output or warnings with
-# the simple link test code.
-m4_defun([_LT_LINKER_BOILERPLATE],
-[m4_require([_LT_DECL_SED])dnl
-ac_outfile=conftest.$ac_objext
-echo "$lt_simple_link_test_code" >conftest.$ac_ext
-eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
-_lt_linker_boilerplate=`cat conftest.err`
-$RM -r conftest*
-])# _LT_LINKER_BOILERPLATE
-
-# _LT_REQUIRED_DARWIN_CHECKS
-# -------------------------
-m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
- case $host_os in
- rhapsody* | darwin*)
- AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])
- AC_CHECK_TOOL([NMEDIT], [nmedit], [:])
- AC_CHECK_TOOL([LIPO], [lipo], [:])
- AC_CHECK_TOOL([OTOOL], [otool], [:])
- AC_CHECK_TOOL([OTOOL64], [otool64], [:])
- _LT_DECL([], [DSYMUTIL], [1],
- [Tool to manipulate archived DWARF debug symbol files on Mac OS X])
- _LT_DECL([], [NMEDIT], [1],
- [Tool to change global to local symbols on Mac OS X])
- _LT_DECL([], [LIPO], [1],
- [Tool to manipulate fat objects and archives on Mac OS X])
- _LT_DECL([], [OTOOL], [1],
- [ldd/readelf like tool for Mach-O binaries on Mac OS X])
- _LT_DECL([], [OTOOL64], [1],
- [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4])
-
- AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
- [lt_cv_apple_cc_single_mod=no
- if test -z "$LT_MULTI_MODULE"; then
- # By default we will add the -single_module flag. You can override
- # by either setting the environment variable LT_MULTI_MODULE
- # non-empty at configure time, or by adding -multi_module to the
- # link flags.
- rm -rf libconftest.dylib*
- echo "int foo(void){return 1;}" > conftest.c
- echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
--dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD
- $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
- -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
- _lt_result=$?
- # If there is a non-empty error log, and "single_module"
- # appears in it, assume the flag caused a linker warning
- if test -s conftest.err && $GREP single_module conftest.err; then
- cat conftest.err >&AS_MESSAGE_LOG_FD
- # Otherwise, if the output was created with a 0 exit code from
- # the compiler, it worked.
- elif test -f libconftest.dylib && test 0 = "$_lt_result"; then
- lt_cv_apple_cc_single_mod=yes
- else
- cat conftest.err >&AS_MESSAGE_LOG_FD
- fi
- rm -rf libconftest.dylib*
- rm -f conftest.*
- fi])
-
- AC_CACHE_CHECK([for -exported_symbols_list linker flag],
- [lt_cv_ld_exported_symbols_list],
- [lt_cv_ld_exported_symbols_list=no
- save_LDFLAGS=$LDFLAGS
- echo "_main" > conftest.sym
- LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
- AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
- [lt_cv_ld_exported_symbols_list=yes],
- [lt_cv_ld_exported_symbols_list=no])
- LDFLAGS=$save_LDFLAGS
- ])
-
- AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load],
- [lt_cv_ld_force_load=no
- cat > conftest.c << _LT_EOF
-int forced_loaded() { return 2;}
-_LT_EOF
- echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD
- $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD
- echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD
- $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD
- echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD
- $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD
- cat > conftest.c << _LT_EOF
-int main() { return 0;}
-_LT_EOF
- echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD
- $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
- _lt_result=$?
- if test -s conftest.err && $GREP force_load conftest.err; then
- cat conftest.err >&AS_MESSAGE_LOG_FD
- elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then
- lt_cv_ld_force_load=yes
- else
- cat conftest.err >&AS_MESSAGE_LOG_FD
- fi
- rm -f conftest.err libconftest.a conftest conftest.c
- rm -rf conftest.dSYM
- ])
- case $host_os in
- rhapsody* | darwin1.[[012]])
- _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;;
- darwin1.*)
- _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
- darwin*) # darwin 5.x on
- # if running on 10.5 or later, the deployment target defaults
- # to the OS version, if on x86, and 10.4, the deployment
- # target defaults to 10.4. Don't you love it?
- case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
- 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
- _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
- 10.[[012]]*)
- _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
- 10.*)
- _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
- esac
- ;;
- esac
- if test yes = "$lt_cv_apple_cc_single_mod"; then
- _lt_dar_single_mod='$single_module'
- fi
- if test yes = "$lt_cv_ld_exported_symbols_list"; then
- _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym'
- else
- _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib'
- fi
- if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then
- _lt_dsymutil='~$DSYMUTIL $lib || :'
- else
- _lt_dsymutil=
- fi
- ;;
- esac
-])
-
-
-# _LT_DARWIN_LINKER_FEATURES([TAG])
-# ---------------------------------
-# Checks for linker and compiler features on darwin
-m4_defun([_LT_DARWIN_LINKER_FEATURES],
-[
- m4_require([_LT_REQUIRED_DARWIN_CHECKS])
- _LT_TAGVAR(archive_cmds_need_lc, $1)=no
- _LT_TAGVAR(hardcode_direct, $1)=no
- _LT_TAGVAR(hardcode_automatic, $1)=yes
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
- if test yes = "$lt_cv_ld_force_load"; then
- _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
- m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes],
- [FC], [_LT_TAGVAR(compiler_needs_object, $1)=yes])
- else
- _LT_TAGVAR(whole_archive_flag_spec, $1)=''
- fi
- _LT_TAGVAR(link_all_deplibs, $1)=yes
- _LT_TAGVAR(allow_undefined_flag, $1)=$_lt_dar_allow_undefined
- case $cc_basename in
- ifort*|nagfor*) _lt_dar_can_shared=yes ;;
- *) _lt_dar_can_shared=$GCC ;;
- esac
- if test yes = "$_lt_dar_can_shared"; then
- output_verbose_link_cmd=func_echo_all
- _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil"
- _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil"
- _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil"
- _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil"
- m4_if([$1], [CXX],
-[ if test yes != "$lt_cv_apple_cc_single_mod"; then
- _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dsymutil"
- _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dar_export_syms$_lt_dsymutil"
- fi
-],[])
- else
- _LT_TAGVAR(ld_shlibs, $1)=no
- fi
-])
-
-# _LT_SYS_MODULE_PATH_AIX([TAGNAME])
-# ----------------------------------
-# Links a minimal program and checks the executable
-# for the system default hardcoded library path. In most cases,
-# this is /usr/lib:/lib, but when the MPI compilers are used
-# the location of the communication and MPI libs are included too.
-# If we don't find anything, use the default library path according
-# to the aix ld manual.
-# Store the results from the different compilers for each TAGNAME.
-# Allow overriding them for all tags through lt_cv_aix_libpath.
-m4_defun([_LT_SYS_MODULE_PATH_AIX],
-[m4_require([_LT_DECL_SED])dnl
-if test set = "${lt_cv_aix_libpath+set}"; then
- aix_libpath=$lt_cv_aix_libpath
-else
- AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])],
- [AC_LINK_IFELSE([AC_LANG_PROGRAM],[
- lt_aix_libpath_sed='[
- /Import File Strings/,/^$/ {
- /^0/ {
- s/^0 *\([^ ]*\) *$/\1/
- p
- }
- }]'
- _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
- # Check for a 64-bit object if we didn't find anything.
- if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
- _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
- fi],[])
- if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
- _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=/usr/lib:/lib
- fi
- ])
- aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])
-fi
-])# _LT_SYS_MODULE_PATH_AIX
-
-
-# _LT_SHELL_INIT(ARG)
-# -------------------
-m4_define([_LT_SHELL_INIT],
-[m4_divert_text([M4SH-INIT], [$1
-])])# _LT_SHELL_INIT
-
-
-
-# _LT_PROG_ECHO_BACKSLASH
-# -----------------------
-# Find how we can fake an echo command that does not interpret backslash.
-# In particular, with Autoconf 2.60 or later we add some code to the start
-# of the generated configure script that will find a shell with a builtin
-# printf (that we can use as an echo command).
-m4_defun([_LT_PROG_ECHO_BACKSLASH],
-[ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
-ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
-ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
-
-AC_MSG_CHECKING([how to print strings])
-# Test print first, because it will be a builtin if present.
-if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
- test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
- ECHO='print -r --'
-elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
- ECHO='printf %s\n'
-else
- # Use this function as a fallback that always works.
- func_fallback_echo ()
- {
- eval 'cat <<_LTECHO_EOF
-$[]1
-_LTECHO_EOF'
- }
- ECHO='func_fallback_echo'
-fi
-
-# func_echo_all arg...
-# Invoke $ECHO with all args, space-separated.
-func_echo_all ()
-{
- $ECHO "$*"
-}
-
-case $ECHO in
- printf*) AC_MSG_RESULT([printf]) ;;
- print*) AC_MSG_RESULT([print -r]) ;;
- *) AC_MSG_RESULT([cat]) ;;
-esac
-
-m4_ifdef([_AS_DETECT_SUGGESTED],
-[_AS_DETECT_SUGGESTED([
- test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || (
- ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
- ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
- ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
- PATH=/empty FPATH=/empty; export PATH FPATH
- test "X`printf %s $ECHO`" = "X$ECHO" \
- || test "X`print -r -- $ECHO`" = "X$ECHO" )])])
-
-_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts])
-_LT_DECL([], [ECHO], [1], [An echo program that protects backslashes])
-])# _LT_PROG_ECHO_BACKSLASH
-
-
-# _LT_WITH_SYSROOT
-# ----------------
-AC_DEFUN([_LT_WITH_SYSROOT],
-[AC_MSG_CHECKING([for sysroot])
-AC_ARG_WITH([sysroot],
-[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@],
- [Search for dependent libraries within DIR (or the compiler's sysroot
- if not specified).])],
-[], [with_sysroot=no])
-
-dnl lt_sysroot will always be passed unquoted. We quote it here
-dnl in case the user passed a directory name.
-lt_sysroot=
-case $with_sysroot in #(
- yes)
- if test yes = "$GCC"; then
- lt_sysroot=`$CC --print-sysroot 2>/dev/null`
- fi
- ;; #(
- /*)
- lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
- ;; #(
- no|'')
- ;; #(
- *)
- AC_MSG_RESULT([$with_sysroot])
- AC_MSG_ERROR([The sysroot must be an absolute path.])
- ;;
-esac
-
- AC_MSG_RESULT([${lt_sysroot:-no}])
-_LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl
-[dependent libraries, and where our libraries should be installed.])])
-
-# _LT_ENABLE_LOCK
-# ---------------
-m4_defun([_LT_ENABLE_LOCK],
-[AC_ARG_ENABLE([libtool-lock],
- [AS_HELP_STRING([--disable-libtool-lock],
- [avoid locking (might break parallel builds)])])
-test no = "$enable_libtool_lock" || enable_libtool_lock=yes
-
-# Some flags need to be propagated to the compiler or linker for good
-# libtool support.
-case $host in
-ia64-*-hpux*)
- # Find out what ABI is being produced by ac_compile, and set mode
- # options accordingly.
- echo 'int i;' > conftest.$ac_ext
- if AC_TRY_EVAL(ac_compile); then
- case `/usr/bin/file conftest.$ac_objext` in
- *ELF-32*)
- HPUX_IA64_MODE=32
- ;;
- *ELF-64*)
- HPUX_IA64_MODE=64
- ;;
- esac
- fi
- rm -rf conftest*
- ;;
-*-*-irix6*)
- # Find out what ABI is being produced by ac_compile, and set linker
- # options accordingly.
- echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
- if AC_TRY_EVAL(ac_compile); then
- if test yes = "$lt_cv_prog_gnu_ld"; then
- case `/usr/bin/file conftest.$ac_objext` in
- *32-bit*)
- LD="${LD-ld} -melf32bsmip"
- ;;
- *N32*)
- LD="${LD-ld} -melf32bmipn32"
- ;;
- *64-bit*)
- LD="${LD-ld} -melf64bmip"
- ;;
- esac
- else
- case `/usr/bin/file conftest.$ac_objext` in
- *32-bit*)
- LD="${LD-ld} -32"
- ;;
- *N32*)
- LD="${LD-ld} -n32"
- ;;
- *64-bit*)
- LD="${LD-ld} -64"
- ;;
- esac
- fi
- fi
- rm -rf conftest*
- ;;
-
-mips64*-*linux*)
- # Find out what ABI is being produced by ac_compile, and set linker
- # options accordingly.
- echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
- if AC_TRY_EVAL(ac_compile); then
- emul=elf
- case `/usr/bin/file conftest.$ac_objext` in
- *32-bit*)
- emul="${emul}32"
- ;;
- *64-bit*)
- emul="${emul}64"
- ;;
- esac
- case `/usr/bin/file conftest.$ac_objext` in
- *MSB*)
- emul="${emul}btsmip"
- ;;
- *LSB*)
- emul="${emul}ltsmip"
- ;;
- esac
- case `/usr/bin/file conftest.$ac_objext` in
- *N32*)
- emul="${emul}n32"
- ;;
- esac
- LD="${LD-ld} -m $emul"
- fi
- rm -rf conftest*
- ;;
-
-x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \
-s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
- # Find out what ABI is being produced by ac_compile, and set linker
- # options accordingly. Note that the listed cases only cover the
- # situations where additional linker options are needed (such as when
- # doing 32-bit compilation for a host where ld defaults to 64-bit, or
- # vice versa); the common cases where no linker options are needed do
- # not appear in the list.
- echo 'int i;' > conftest.$ac_ext
- if AC_TRY_EVAL(ac_compile); then
- case `/usr/bin/file conftest.o` in
- *32-bit*)
- case $host in
- x86_64-*kfreebsd*-gnu)
- LD="${LD-ld} -m elf_i386_fbsd"
- ;;
- x86_64-*linux*)
- case `/usr/bin/file conftest.o` in
- *x86-64*)
- LD="${LD-ld} -m elf32_x86_64"
- ;;
- *)
- LD="${LD-ld} -m elf_i386"
- ;;
- esac
- ;;
- powerpc64le-*linux*)
- LD="${LD-ld} -m elf32lppclinux"
- ;;
- powerpc64-*linux*)
- LD="${LD-ld} -m elf32ppclinux"
- ;;
- s390x-*linux*)
- LD="${LD-ld} -m elf_s390"
- ;;
- sparc64-*linux*)
- LD="${LD-ld} -m elf32_sparc"
- ;;
- esac
- ;;
- *64-bit*)
- case $host in
- x86_64-*kfreebsd*-gnu)
- LD="${LD-ld} -m elf_x86_64_fbsd"
- ;;
- x86_64-*linux*)
- LD="${LD-ld} -m elf_x86_64"
- ;;
- powerpcle-*linux*)
- LD="${LD-ld} -m elf64lppc"
- ;;
- powerpc-*linux*)
- LD="${LD-ld} -m elf64ppc"
- ;;
- s390*-*linux*|s390*-*tpf*)
- LD="${LD-ld} -m elf64_s390"
- ;;
- sparc*-*linux*)
- LD="${LD-ld} -m elf64_sparc"
- ;;
- esac
- ;;
- esac
- fi
- rm -rf conftest*
- ;;
-
-*-*-sco3.2v5*)
- # On SCO OpenServer 5, we need -belf to get full-featured binaries.
- SAVE_CFLAGS=$CFLAGS
- CFLAGS="$CFLAGS -belf"
- AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
- [AC_LANG_PUSH(C)
- AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
- AC_LANG_POP])
- if test yes != "$lt_cv_cc_needs_belf"; then
- # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
- CFLAGS=$SAVE_CFLAGS
- fi
- ;;
-*-*solaris*)
- # Find out what ABI is being produced by ac_compile, and set linker
- # options accordingly.
- echo 'int i;' > conftest.$ac_ext
- if AC_TRY_EVAL(ac_compile); then
- case `/usr/bin/file conftest.o` in
- *64-bit*)
- case $lt_cv_prog_gnu_ld in
- yes*)
- case $host in
- i?86-*-solaris*|x86_64-*-solaris*)
- LD="${LD-ld} -m elf_x86_64"
- ;;
- sparc*-*-solaris*)
- LD="${LD-ld} -m elf64_sparc"
- ;;
- esac
- # GNU ld 2.21 introduced _sol2 emulations. Use them if available.
- if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then
- LD=${LD-ld}_sol2
- fi
- ;;
- *)
- if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
- LD="${LD-ld} -64"
- fi
- ;;
- esac
- ;;
- esac
- fi
- rm -rf conftest*
- ;;
-esac
-
-need_locks=$enable_libtool_lock
-])# _LT_ENABLE_LOCK
-
-
-# _LT_PROG_AR
-# -----------
-m4_defun([_LT_PROG_AR],
-[AC_CHECK_TOOLS(AR, [ar], false)
-: ${AR=ar}
-: ${AR_FLAGS=cru}
-_LT_DECL([], [AR], [1], [The archiver])
-_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive])
-
-AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file],
- [lt_cv_ar_at_file=no
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM],
- [echo conftest.$ac_objext > conftest.lst
- lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD'
- AC_TRY_EVAL([lt_ar_try])
- if test 0 -eq "$ac_status"; then
- # Ensure the archiver fails upon bogus file names.
- rm -f conftest.$ac_objext libconftest.a
- AC_TRY_EVAL([lt_ar_try])
- if test 0 -ne "$ac_status"; then
- lt_cv_ar_at_file=@
- fi
- fi
- rm -f conftest.* libconftest.a
- ])
- ])
-
-if test no = "$lt_cv_ar_at_file"; then
- archiver_list_spec=
-else
- archiver_list_spec=$lt_cv_ar_at_file
-fi
-_LT_DECL([], [archiver_list_spec], [1],
- [How to feed a file listing to the archiver])
-])# _LT_PROG_AR
-
-
-# _LT_CMD_OLD_ARCHIVE
-# -------------------
-m4_defun([_LT_CMD_OLD_ARCHIVE],
-[_LT_PROG_AR
-
-AC_CHECK_TOOL(STRIP, strip, :)
-test -z "$STRIP" && STRIP=:
-_LT_DECL([], [STRIP], [1], [A symbol stripping program])
-
-AC_CHECK_TOOL(RANLIB, ranlib, :)
-test -z "$RANLIB" && RANLIB=:
-_LT_DECL([], [RANLIB], [1],
- [Commands used to install an old-style archive])
-
-# Determine commands to create old-style static archives.
-old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
-old_postinstall_cmds='chmod 644 $oldlib'
-old_postuninstall_cmds=
-
-if test -n "$RANLIB"; then
- case $host_os in
- bitrig* | openbsd*)
- old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib"
- ;;
- *)
- old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib"
- ;;
- esac
- old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib"
-fi
-
-case $host_os in
- darwin*)
- lock_old_archive_extraction=yes ;;
- *)
- lock_old_archive_extraction=no ;;
-esac
-_LT_DECL([], [old_postinstall_cmds], [2])
-_LT_DECL([], [old_postuninstall_cmds], [2])
-_LT_TAGDECL([], [old_archive_cmds], [2],
- [Commands used to build an old-style archive])
-_LT_DECL([], [lock_old_archive_extraction], [0],
- [Whether to use a lock for old archive extraction])
-])# _LT_CMD_OLD_ARCHIVE
-
-
-# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
-# [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
-# ----------------------------------------------------------------
-# Check whether the given compiler option works
-AC_DEFUN([_LT_COMPILER_OPTION],
-[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
-m4_require([_LT_DECL_SED])dnl
-AC_CACHE_CHECK([$1], [$2],
- [$2=no
- m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
- echo "$lt_simple_compile_test_code" > conftest.$ac_ext
- lt_compiler_flag="$3" ## exclude from sc_useless_quotes_in_assignment
- # Insert the option either (1) after the last *FLAGS variable, or
- # (2) before a word containing "conftest.", or (3) at the end.
- # Note that $ac_compile itself does not contain backslashes and begins
- # with a dollar sign (not a hyphen), so the echo should work correctly.
- # The option is referenced via a variable to avoid confusing sed.
- lt_compile=`echo "$ac_compile" | $SED \
- -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
- -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
- -e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
- (eval "$lt_compile" 2>conftest.err)
- ac_status=$?
- cat conftest.err >&AS_MESSAGE_LOG_FD
- echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
- if (exit $ac_status) && test -s "$ac_outfile"; then
- # The compiler can only warn and ignore the option if not recognized
- # So say no if there are warnings other than the usual output.
- $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
- $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
- if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
- $2=yes
- fi
- fi
- $RM conftest*
-])
-
-if test yes = "[$]$2"; then
- m4_if([$5], , :, [$5])
-else
- m4_if([$6], , :, [$6])
-fi
-])# _LT_COMPILER_OPTION
-
-# Old name:
-AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [])
-
-
-# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
-# [ACTION-SUCCESS], [ACTION-FAILURE])
-# ----------------------------------------------------
-# Check whether the given linker option works
-AC_DEFUN([_LT_LINKER_OPTION],
-[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
-m4_require([_LT_DECL_SED])dnl
-AC_CACHE_CHECK([$1], [$2],
- [$2=no
- save_LDFLAGS=$LDFLAGS
- LDFLAGS="$LDFLAGS $3"
- echo "$lt_simple_link_test_code" > conftest.$ac_ext
- if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
- # The linker can only warn and ignore the option if not recognized
- # So say no if there are warnings
- if test -s conftest.err; then
- # Append any errors to the config.log.
- cat conftest.err 1>&AS_MESSAGE_LOG_FD
- $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
- $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
- if diff conftest.exp conftest.er2 >/dev/null; then
- $2=yes
- fi
- else
- $2=yes
- fi
- fi
- $RM -r conftest*
- LDFLAGS=$save_LDFLAGS
-])
-
-if test yes = "[$]$2"; then
- m4_if([$4], , :, [$4])
-else
- m4_if([$5], , :, [$5])
-fi
-])# _LT_LINKER_OPTION
-
-# Old name:
-AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [])
-
-
-# LT_CMD_MAX_LEN
-#---------------
-AC_DEFUN([LT_CMD_MAX_LEN],
-[AC_REQUIRE([AC_CANONICAL_HOST])dnl
-# find the maximum length of command line arguments
-AC_MSG_CHECKING([the maximum length of command line arguments])
-AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
- i=0
- teststring=ABCD
-
- case $build_os in
- msdosdjgpp*)
- # On DJGPP, this test can blow up pretty badly due to problems in libc
- # (any single argument exceeding 2000 bytes causes a buffer overrun
- # during glob expansion). Even if it were fixed, the result of this
- # check would be larger than it should be.
- lt_cv_sys_max_cmd_len=12288; # 12K is about right
- ;;
-
- gnu*)
- # Under GNU Hurd, this test is not required because there is
- # no limit to the length of command line arguments.
- # Libtool will interpret -1 as no limit whatsoever
- lt_cv_sys_max_cmd_len=-1;
- ;;
-
- cygwin* | mingw* | cegcc*)
- # On Win9x/ME, this test blows up -- it succeeds, but takes
- # about 5 minutes as the teststring grows exponentially.
- # Worse, since 9x/ME are not pre-emptively multitasking,
- # you end up with a "frozen" computer, even though with patience
- # the test eventually succeeds (with a max line length of 256k).
- # Instead, let's just punt: use the minimum linelength reported by
- # all of the supported platforms: 8192 (on NT/2K/XP).
- lt_cv_sys_max_cmd_len=8192;
- ;;
-
- mint*)
- # On MiNT this can take a long time and run out of memory.
- lt_cv_sys_max_cmd_len=8192;
- ;;
-
- amigaos*)
- # On AmigaOS with pdksh, this test takes hours, literally.
- # So we just punt and use a minimum line length of 8192.
- lt_cv_sys_max_cmd_len=8192;
- ;;
-
- bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*)
- # This has been around since 386BSD, at least. Likely further.
- if test -x /sbin/sysctl; then
- lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
- elif test -x /usr/sbin/sysctl; then
- lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
- else
- lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs
- fi
- # And add a safety zone
- lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
- lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
- ;;
-
- interix*)
- # We know the value 262144 and hardcode it with a safety zone (like BSD)
- lt_cv_sys_max_cmd_len=196608
- ;;
-
- os2*)
- # The test takes a long time on OS/2.
- lt_cv_sys_max_cmd_len=8192
- ;;
-
- osf*)
- # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
- # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
- # nice to cause kernel panics so lets avoid the loop below.
- # First set a reasonable default.
- lt_cv_sys_max_cmd_len=16384
- #
- if test -x /sbin/sysconfig; then
- case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
- *1*) lt_cv_sys_max_cmd_len=-1 ;;
- esac
- fi
- ;;
- sco3.2v5*)
- lt_cv_sys_max_cmd_len=102400
- ;;
- sysv5* | sco5v6* | sysv4.2uw2*)
- kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
- if test -n "$kargmax"; then
- lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'`
- else
- lt_cv_sys_max_cmd_len=32768
- fi
- ;;
- *)
- lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
- if test -n "$lt_cv_sys_max_cmd_len" && \
- test undefined != "$lt_cv_sys_max_cmd_len"; then
- lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
- lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
- else
- # Make teststring a little bigger before we do anything with it.
- # a 1K string should be a reasonable start.
- for i in 1 2 3 4 5 6 7 8; do
- teststring=$teststring$teststring
- done
- SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
- # If test is not a shell built-in, we'll probably end up computing a
- # maximum length that is only half of the actual maximum length, but
- # we can't tell.
- while { test X`env echo "$teststring$teststring" 2>/dev/null` \
- = "X$teststring$teststring"; } >/dev/null 2>&1 &&
- test 17 != "$i" # 1/2 MB should be enough
- do
- i=`expr $i + 1`
- teststring=$teststring$teststring
- done
- # Only check the string length outside the loop.
- lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
- teststring=
- # Add a significant safety factor because C++ compilers can tack on
- # massive amounts of additional arguments before passing them to the
- # linker. It appears as though 1/2 is a usable value.
- lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
- fi
- ;;
- esac
-])
-if test -n "$lt_cv_sys_max_cmd_len"; then
- AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
-else
- AC_MSG_RESULT(none)
-fi
-max_cmd_len=$lt_cv_sys_max_cmd_len
-_LT_DECL([], [max_cmd_len], [0],
- [What is the maximum length of a command?])
-])# LT_CMD_MAX_LEN
-
-# Old name:
-AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [])
-
-
-# _LT_HEADER_DLFCN
-# ----------------
-m4_defun([_LT_HEADER_DLFCN],
-[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl
-])# _LT_HEADER_DLFCN
-
-
-# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
-# ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
-# ----------------------------------------------------------------
-m4_defun([_LT_TRY_DLOPEN_SELF],
-[m4_require([_LT_HEADER_DLFCN])dnl
-if test yes = "$cross_compiling"; then :
- [$4]
-else
- lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
- lt_status=$lt_dlunknown
- cat > conftest.$ac_ext <<_LT_EOF
-[#line $LINENO "configure"
-#include "confdefs.h"
-
-#if HAVE_DLFCN_H
-#include <dlfcn.h>
-#endif
-
-#include <stdio.h>
-
-#ifdef RTLD_GLOBAL
-# define LT_DLGLOBAL RTLD_GLOBAL
-#else
-# ifdef DL_GLOBAL
-# define LT_DLGLOBAL DL_GLOBAL
-# else
-# define LT_DLGLOBAL 0
-# endif
-#endif
-
-/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
- find out it does not work in some platform. */
-#ifndef LT_DLLAZY_OR_NOW
-# ifdef RTLD_LAZY
-# define LT_DLLAZY_OR_NOW RTLD_LAZY
-# else
-# ifdef DL_LAZY
-# define LT_DLLAZY_OR_NOW DL_LAZY
-# else
-# ifdef RTLD_NOW
-# define LT_DLLAZY_OR_NOW RTLD_NOW
-# else
-# ifdef DL_NOW
-# define LT_DLLAZY_OR_NOW DL_NOW
-# else
-# define LT_DLLAZY_OR_NOW 0
-# endif
-# endif
-# endif
-# endif
-#endif
-
-/* When -fvisbility=hidden is used, assume the code has been annotated
- correspondingly for the symbols needed. */
-#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
-int fnord () __attribute__((visibility("default")));
-#endif
-
-int fnord () { return 42; }
-int main ()
-{
- void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
- int status = $lt_dlunknown;
-
- if (self)
- {
- if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
- else
- {
- if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
- else puts (dlerror ());
- }
- /* dlclose (self); */
- }
- else
- puts (dlerror ());
-
- return status;
-}]
-_LT_EOF
- if AC_TRY_EVAL(ac_link) && test -s "conftest$ac_exeext" 2>/dev/null; then
- (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
- lt_status=$?
- case x$lt_status in
- x$lt_dlno_uscore) $1 ;;
- x$lt_dlneed_uscore) $2 ;;
- x$lt_dlunknown|x*) $3 ;;
- esac
- else :
- # compilation failed
- $3
- fi
-fi
-rm -fr conftest*
-])# _LT_TRY_DLOPEN_SELF
-
-
-# LT_SYS_DLOPEN_SELF
-# ------------------
-AC_DEFUN([LT_SYS_DLOPEN_SELF],
-[m4_require([_LT_HEADER_DLFCN])dnl
-if test yes != "$enable_dlopen"; then
- enable_dlopen=unknown
- enable_dlopen_self=unknown
- enable_dlopen_self_static=unknown
-else
- lt_cv_dlopen=no
- lt_cv_dlopen_libs=
-
- case $host_os in
- beos*)
- lt_cv_dlopen=load_add_on
- lt_cv_dlopen_libs=
- lt_cv_dlopen_self=yes
- ;;
-
- mingw* | pw32* | cegcc*)
- lt_cv_dlopen=LoadLibrary
- lt_cv_dlopen_libs=
- ;;
-
- cygwin*)
- lt_cv_dlopen=dlopen
- lt_cv_dlopen_libs=
- ;;
-
- darwin*)
- # if libdl is installed we need to link against it
- AC_CHECK_LIB([dl], [dlopen],
- [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl],[
- lt_cv_dlopen=dyld
- lt_cv_dlopen_libs=
- lt_cv_dlopen_self=yes
- ])
- ;;
-
- tpf*)
- # Don't try to run any link tests for TPF. We know it's impossible
- # because TPF is a cross-compiler, and we know how we open DSOs.
- lt_cv_dlopen=dlopen
- lt_cv_dlopen_libs=
- lt_cv_dlopen_self=no
- ;;
-
- *)
- AC_CHECK_FUNC([shl_load],
- [lt_cv_dlopen=shl_load],
- [AC_CHECK_LIB([dld], [shl_load],
- [lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld],
- [AC_CHECK_FUNC([dlopen],
- [lt_cv_dlopen=dlopen],
- [AC_CHECK_LIB([dl], [dlopen],
- [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl],
- [AC_CHECK_LIB([svld], [dlopen],
- [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld],
- [AC_CHECK_LIB([dld], [dld_link],
- [lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld])
- ])
- ])
- ])
- ])
- ])
- ;;
- esac
-
- if test no = "$lt_cv_dlopen"; then
- enable_dlopen=no
- else
- enable_dlopen=yes
- fi
-
- case $lt_cv_dlopen in
- dlopen)
- save_CPPFLAGS=$CPPFLAGS
- test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
-
- save_LDFLAGS=$LDFLAGS
- wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
-
- save_LIBS=$LIBS
- LIBS="$lt_cv_dlopen_libs $LIBS"
-
- AC_CACHE_CHECK([whether a program can dlopen itself],
- lt_cv_dlopen_self, [dnl
- _LT_TRY_DLOPEN_SELF(
- lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
- lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
- ])
-
- if test yes = "$lt_cv_dlopen_self"; then
- wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
- AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
- lt_cv_dlopen_self_static, [dnl
- _LT_TRY_DLOPEN_SELF(
- lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
- lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross)
- ])
- fi
-
- CPPFLAGS=$save_CPPFLAGS
- LDFLAGS=$save_LDFLAGS
- LIBS=$save_LIBS
- ;;
- esac
-
- case $lt_cv_dlopen_self in
- yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
- *) enable_dlopen_self=unknown ;;
- esac
-
- case $lt_cv_dlopen_self_static in
- yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
- *) enable_dlopen_self_static=unknown ;;
- esac
-fi
-_LT_DECL([dlopen_support], [enable_dlopen], [0],
- [Whether dlopen is supported])
-_LT_DECL([dlopen_self], [enable_dlopen_self], [0],
- [Whether dlopen of programs is supported])
-_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0],
- [Whether dlopen of statically linked programs is supported])
-])# LT_SYS_DLOPEN_SELF
-
-# Old name:
-AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [])
-
-
-# _LT_COMPILER_C_O([TAGNAME])
-# ---------------------------
-# Check to see if options -c and -o are simultaneously supported by compiler.
-# This macro does not hard code the compiler like AC_PROG_CC_C_O.
-m4_defun([_LT_COMPILER_C_O],
-[m4_require([_LT_DECL_SED])dnl
-m4_require([_LT_FILEUTILS_DEFAULTS])dnl
-m4_require([_LT_TAG_COMPILER])dnl
-AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
- [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
- [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
- $RM -r conftest 2>/dev/null
- mkdir conftest
- cd conftest
- mkdir out
- echo "$lt_simple_compile_test_code" > conftest.$ac_ext
-
- lt_compiler_flag="-o out/conftest2.$ac_objext"
- # Insert the option either (1) after the last *FLAGS variable, or
- # (2) before a word containing "conftest.", or (3) at the end.
- # Note that $ac_compile itself does not contain backslashes and begins
- # with a dollar sign (not a hyphen), so the echo should work correctly.
- lt_compile=`echo "$ac_compile" | $SED \
- -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
- -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
- -e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
- (eval "$lt_compile" 2>out/conftest.err)
- ac_status=$?
- cat out/conftest.err >&AS_MESSAGE_LOG_FD
- echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
- if (exit $ac_status) && test -s out/conftest2.$ac_objext
- then
- # The compiler can only warn and ignore the option if not recognized
- # So say no if there are warnings
- $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
- $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
- if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
- _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
- fi
- fi
- chmod u+w . 2>&AS_MESSAGE_LOG_FD
- $RM conftest*
- # SGI C++ compiler will create directory out/ii_files/ for
- # template instantiation
- test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
- $RM out/* && rmdir out
- cd ..
- $RM -r conftest
- $RM conftest*
-])
-_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1],
- [Does compiler simultaneously support -c and -o options?])
-])# _LT_COMPILER_C_O
-
-
-# _LT_COMPILER_FILE_LOCKS([TAGNAME])
-# ----------------------------------
-# Check to see if we can do hard links to lock some files if needed
-m4_defun([_LT_COMPILER_FILE_LOCKS],
-[m4_require([_LT_ENABLE_LOCK])dnl
-m4_require([_LT_FILEUTILS_DEFAULTS])dnl
-_LT_COMPILER_C_O([$1])
-
-hard_links=nottested
-if test no = "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" && test no != "$need_locks"; then
- # do not overwrite the value of need_locks provided by the user
- AC_MSG_CHECKING([if we can lock with hard links])
- hard_links=yes
- $RM conftest*
- ln conftest.a conftest.b 2>/dev/null && hard_links=no
- touch conftest.a
- ln conftest.a conftest.b 2>&5 || hard_links=no
- ln conftest.a conftest.b 2>/dev/null && hard_links=no
- AC_MSG_RESULT([$hard_links])
- if test no = "$hard_links"; then
- AC_MSG_WARN(['$CC' does not support '-c -o', so 'make -j' may be unsafe])
- need_locks=warn
- fi
-else
- need_locks=no
-fi
-_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?])
-])# _LT_COMPILER_FILE_LOCKS
-
-
-# _LT_CHECK_OBJDIR
-# ----------------
-m4_defun([_LT_CHECK_OBJDIR],
-[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
-[rm -f .libs 2>/dev/null
-mkdir .libs 2>/dev/null
-if test -d .libs; then
- lt_cv_objdir=.libs
-else
- # MS-DOS does not allow filenames that begin with a dot.
- lt_cv_objdir=_libs
-fi
-rmdir .libs 2>/dev/null])
-objdir=$lt_cv_objdir
-_LT_DECL([], [objdir], [0],
- [The name of the directory that contains temporary libtool files])dnl
-m4_pattern_allow([LT_OBJDIR])dnl
-AC_DEFINE_UNQUOTED([LT_OBJDIR], "$lt_cv_objdir/",
- [Define to the sub-directory where libtool stores uninstalled libraries.])
-])# _LT_CHECK_OBJDIR
-
-
-# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME])
-# --------------------------------------
-# Check hardcoding attributes.
-m4_defun([_LT_LINKER_HARDCODE_LIBPATH],
-[AC_MSG_CHECKING([how to hardcode library paths into programs])
-_LT_TAGVAR(hardcode_action, $1)=
-if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" ||
- test -n "$_LT_TAGVAR(runpath_var, $1)" ||
- test yes = "$_LT_TAGVAR(hardcode_automatic, $1)"; then
-
- # We can hardcode non-existent directories.
- if test no != "$_LT_TAGVAR(hardcode_direct, $1)" &&
- # If the only mechanism to avoid hardcoding is shlibpath_var, we
- # have to relink, otherwise we might link with an installed library
- # when we should be linking with a yet-to-be-installed one
- ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" &&
- test no != "$_LT_TAGVAR(hardcode_minus_L, $1)"; then
- # Linking always hardcodes the temporary library directory.
- _LT_TAGVAR(hardcode_action, $1)=relink
- else
- # We can link without hardcoding, and we can hardcode nonexisting dirs.
- _LT_TAGVAR(hardcode_action, $1)=immediate
- fi
-else
- # We cannot hardcode anything, or else we can only hardcode existing
- # directories.
- _LT_TAGVAR(hardcode_action, $1)=unsupported
-fi
-AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)])
-
-if test relink = "$_LT_TAGVAR(hardcode_action, $1)" ||
- test yes = "$_LT_TAGVAR(inherit_rpath, $1)"; then
- # Fast installation is not supported
- enable_fast_install=no
-elif test yes = "$shlibpath_overrides_runpath" ||
- test no = "$enable_shared"; then
- # Fast installation is not necessary
- enable_fast_install=needless
-fi
-_LT_TAGDECL([], [hardcode_action], [0],
- [How to hardcode a shared library path into an executable])
-])# _LT_LINKER_HARDCODE_LIBPATH
-
-
-# _LT_CMD_STRIPLIB
-# ----------------
-m4_defun([_LT_CMD_STRIPLIB],
-[m4_require([_LT_DECL_EGREP])
-striplib=
-old_striplib=
-AC_MSG_CHECKING([whether stripping libraries is possible])
-if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
- test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
- test -z "$striplib" && striplib="$STRIP --strip-unneeded"
- AC_MSG_RESULT([yes])
-else
-# FIXME - insert some real tests, host_os isn't really good enough
- case $host_os in
- darwin*)
- if test -n "$STRIP"; then
- striplib="$STRIP -x"
- old_striplib="$STRIP -S"
- AC_MSG_RESULT([yes])
- else
- AC_MSG_RESULT([no])
- fi
- ;;
- *)
- AC_MSG_RESULT([no])
- ;;
- esac
-fi
-_LT_DECL([], [old_striplib], [1], [Commands to strip libraries])
-_LT_DECL([], [striplib], [1])
-])# _LT_CMD_STRIPLIB
-
-
-# _LT_SYS_DYNAMIC_LINKER([TAG])
-# -----------------------------
-# PORTME Fill in your ld.so characteristics
-m4_defun([_LT_SYS_DYNAMIC_LINKER],
-[AC_REQUIRE([AC_CANONICAL_HOST])dnl
-m4_require([_LT_DECL_EGREP])dnl
-m4_require([_LT_FILEUTILS_DEFAULTS])dnl
-m4_require([_LT_DECL_OBJDUMP])dnl
-m4_require([_LT_DECL_SED])dnl
-m4_require([_LT_CHECK_SHELL_FEATURES])dnl
-AC_MSG_CHECKING([dynamic linker characteristics])
-m4_if([$1],
- [], [
-if test yes = "$GCC"; then
- case $host_os in
- darwin*) lt_awk_arg='/^libraries:/,/LR/' ;;
- *) lt_awk_arg='/^libraries:/' ;;
- esac
- case $host_os in
- mingw* | cegcc*) lt_sed_strip_eq='s|=\([[A-Za-z]]:\)|\1|g' ;;
- *) lt_sed_strip_eq='s|=/|/|g' ;;
- esac
- lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
- case $lt_search_path_spec in
- *\;*)
- # if the path contains ";" then we assume it to be the separator
- # otherwise default to the standard path separator (i.e. ":") - it is
- # assumed that no part of a normal pathname contains ";" but that should
- # okay in the real world where ";" in dirpaths is itself problematic.
- lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'`
- ;;
- *)
- lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"`
- ;;
- esac
- # Ok, now we have the path, separated by spaces, we can step through it
- # and add multilib dir if necessary...
- lt_tmp_lt_search_path_spec=
- lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
- # ...but if some path component already ends with the multilib dir we assume
- # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer).
- case "$lt_multi_os_dir; $lt_search_path_spec " in
- "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*)
- lt_multi_os_dir=
- ;;
- esac
- for lt_sys_path in $lt_search_path_spec; do
- if test -d "$lt_sys_path$lt_multi_os_dir"; then
- lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir"
- elif test -n "$lt_multi_os_dir"; then
- test -d "$lt_sys_path" && \
- lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
- fi
- done
- lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
-BEGIN {RS = " "; FS = "/|\n";} {
- lt_foo = "";
- lt_count = 0;
- for (lt_i = NF; lt_i > 0; lt_i--) {
- if ($lt_i != "" && $lt_i != ".") {
- if ($lt_i == "..") {
- lt_count++;
- } else {
- if (lt_count == 0) {
- lt_foo = "/" $lt_i lt_foo;
- } else {
- lt_count--;
- }
- }
- }
- }
- if (lt_foo != "") { lt_freq[[lt_foo]]++; }
- if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
-}'`
- # AWK program above erroneously prepends '/' to C:/dos/paths
- # for these hosts.
- case $host_os in
- mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
- $SED 's|/\([[A-Za-z]]:\)|\1|g'` ;;
- esac
- sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
-else
- sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
-fi])
-library_names_spec=
-libname_spec='lib$name'
-soname_spec=
-shrext_cmds=.so
-postinstall_cmds=
-postuninstall_cmds=
-finish_cmds=
-finish_eval=
-shlibpath_var=
-shlibpath_overrides_runpath=unknown
-version_type=none
-dynamic_linker="$host_os ld.so"
-sys_lib_dlsearch_path_spec="/lib /usr/lib"
-need_lib_prefix=unknown
-hardcode_into_libs=no
-
-# when you set need_version to no, make sure it does not cause -set_version
-# flags to be left without arguments
-need_version=unknown
-
-case $host_os in
-aix3*)
- version_type=linux # correct to gnu/linux during the next big refactor
- library_names_spec='$libname$release$shared_ext$versuffix $libname.a'
- shlibpath_var=LIBPATH
-
- # AIX 3 has no versioning support, so we append a major version to the name.
- soname_spec='$libname$release$shared_ext$major'
- ;;
-
-aix[[4-9]]*)
- version_type=linux # correct to gnu/linux during the next big refactor
- need_lib_prefix=no
- need_version=no
- hardcode_into_libs=yes
- if test ia64 = "$host_cpu"; then
- # AIX 5 supports IA64
- library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext'
- shlibpath_var=LD_LIBRARY_PATH
- else
- # With GCC up to 2.95.x, collect2 would create an import file
- # for dependence libraries. The import file would start with
- # the line '#! .'. This would cause the generated library to
- # depend on '.', always an invalid library. This was fixed in
- # development snapshots of GCC prior to 3.0.
- case $host_os in
- aix4 | aix4.[[01]] | aix4.[[01]].*)
- if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
- echo ' yes '
- echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then
- :
- else
- can_build_shared=no
- fi
- ;;
- esac
- # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct
- # soname into executable. Probably we can add versioning support to
- # collect2, so additional links can be useful in future.
- if test yes = "$aix_use_runtimelinking"; then
- # If using run time linking (on AIX 4.2 or later) use lib<name>.so
- # instead of lib<name>.a to let people know that these are not
- # typical AIX shared libraries.
- library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
- else
- # We preserve .a as extension for shared libraries through AIX4.2
- # and later when we are not doing run time linking.
- library_names_spec='$libname$release.a $libname.a'
- soname_spec='$libname$release$shared_ext$major'
- fi
- shlibpath_var=LIBPATH
- fi
- ;;
-
-amigaos*)
- case $host_cpu in
- powerpc)
- # Since July 2007 AmigaOS4 officially supports .so libraries.
- # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
- library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
- ;;
- m68k)
- library_names_spec='$libname.ixlibrary $libname.a'
- # Create ${libname}_ixlibrary.a entries in /sys/libs.
- finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
- ;;
- esac
- ;;
-
-beos*)
- library_names_spec='$libname$shared_ext'
- dynamic_linker="$host_os ld.so"
- shlibpath_var=LIBRARY_PATH
- ;;
-
-bsdi[[45]]*)
- version_type=linux # correct to gnu/linux during the next big refactor
- need_version=no
- library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
- soname_spec='$libname$release$shared_ext$major'
- finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
- shlibpath_var=LD_LIBRARY_PATH
- sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
- sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
- # the default ld.so.conf also contains /usr/contrib/lib and
- # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
- # libtool to hard-code these into programs
- ;;
-
-cygwin* | mingw* | pw32* | cegcc*)
- version_type=windows
- shrext_cmds=.dll
- need_version=no
- need_lib_prefix=no
-
- case $GCC,$cc_basename in
- yes,*)
- # gcc
- library_names_spec='$libname.dll.a'
- # DLL is installed to $(libdir)/../bin by postinstall_cmds
- postinstall_cmds='base_file=`basename \$file`~
- dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
- dldir=$destdir/`dirname \$dlpath`~
- test -d \$dldir || mkdir -p \$dldir~
- $install_prog $dir/$dlname \$dldir/$dlname~
- chmod a+x \$dldir/$dlname~
- if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
- eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
- fi'
- postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
- dlpath=$dir/\$dldll~
- $RM \$dlpath'
- shlibpath_overrides_runpath=yes
-
- case $host_os in
- cygwin*)
- # Cygwin DLLs use 'cyg' prefix rather than 'lib'
- soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
-m4_if([$1], [],[
- sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"])
- ;;
- mingw* | cegcc*)
- # MinGW DLLs use traditional 'lib' prefix
- soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
- ;;
- pw32*)
- # pw32 DLLs use 'pw' prefix rather than 'lib'
- library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
- ;;
- esac
- dynamic_linker='Win32 ld.exe'
- ;;
-
- *,cl*)
- # Native MSVC
- libname_spec='$name'
- soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
- library_names_spec='$libname.dll.lib'
-
- case $build_os in
- mingw*)
- sys_lib_search_path_spec=
- lt_save_ifs=$IFS
- IFS=';'
- for lt_path in $LIB
- do
- IFS=$lt_save_ifs
- # Let DOS variable expansion print the short 8.3 style file name.
- lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
- sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
- done
- IFS=$lt_save_ifs
- # Convert to MSYS style.
- sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'`
- ;;
- cygwin*)
- # Convert to unix form, then to dos form, then back to unix form
- # but this time dos style (no spaces!) so that the unix form looks
- # like /cygdrive/c/PROGRA~1:/cygdr...
- sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
- sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
- sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
- ;;
- *)
- sys_lib_search_path_spec=$LIB
- if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
- # It is most probably a Windows format PATH.
- sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
- else
- sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
- fi
- # FIXME: find the short name or the path components, as spaces are
- # common. (e.g. "Program Files" -> "PROGRA~1")
- ;;
- esac
-
- # DLL is installed to $(libdir)/../bin by postinstall_cmds
- postinstall_cmds='base_file=`basename \$file`~
- dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
- dldir=$destdir/`dirname \$dlpath`~
- test -d \$dldir || mkdir -p \$dldir~
- $install_prog $dir/$dlname \$dldir/$dlname'
- postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
- dlpath=$dir/\$dldll~
- $RM \$dlpath'
- shlibpath_overrides_runpath=yes
- dynamic_linker='Win32 link.exe'
- ;;
-
- *)
- # Assume MSVC wrapper
- library_names_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext $libname.lib'
- dynamic_linker='Win32 ld.exe'
- ;;
- esac
- # FIXME: first we should search . and the directory the executable is in
- shlibpath_var=PATH
- ;;
-
-darwin* | rhapsody*)
- dynamic_linker="$host_os dyld"
- version_type=darwin
- need_lib_prefix=no
- need_version=no
- library_names_spec='$libname$release$major$shared_ext $libname$shared_ext'
- soname_spec='$libname$release$major$shared_ext'
- shlibpath_overrides_runpath=yes
- shlibpath_var=DYLD_LIBRARY_PATH
- shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
-m4_if([$1], [],[
- sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"])
- sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
- ;;
-
-dgux*)
- version_type=linux # correct to gnu/linux during the next big refactor
- need_lib_prefix=no
- need_version=no
- library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
- soname_spec='$libname$release$shared_ext$major'
- shlibpath_var=LD_LIBRARY_PATH
- ;;
-
-freebsd* | dragonfly*)
- # DragonFly does not have aout. When/if they implement a new
- # versioning mechanism, adjust this.
- if test -x /usr/bin/objformat; then
- objformat=`/usr/bin/objformat`
- else
- case $host_os in
- freebsd[[23]].*) objformat=aout ;;
- *) objformat=elf ;;
- esac
- fi
- version_type=freebsd-$objformat
- case $version_type in
- freebsd-elf*)
- library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext'
- need_version=no
- need_lib_prefix=no
- ;;
- freebsd-*)
- library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
- need_version=yes
- ;;
- esac
- shlibpath_var=LD_LIBRARY_PATH
- case $host_os in
- freebsd2.*)
- shlibpath_overrides_runpath=yes
- ;;
- freebsd3.[[01]]* | freebsdelf3.[[01]]*)
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- ;;
- freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
- freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- ;;
- *) # from 4.6 on, and DragonFly
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- ;;
- esac
- ;;
-
-haiku*)
- version_type=linux # correct to gnu/linux during the next big refactor
- need_lib_prefix=no
- need_version=no
- dynamic_linker="$host_os runtime_loader"
- library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
- soname_spec='$libname$release$shared_ext$major'
- shlibpath_var=LIBRARY_PATH
- shlibpath_overrides_runpath=no
- sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
- hardcode_into_libs=yes
- ;;
-
-hpux9* | hpux10* | hpux11*)
- # Give a soname corresponding to the major version so that dld.sl refuses to
- # link against other versions.
- version_type=sunos
- need_lib_prefix=no
- need_version=no
- case $host_cpu in
- ia64*)
- shrext_cmds='.so'
- hardcode_into_libs=yes
- dynamic_linker="$host_os dld.so"
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
- library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
- soname_spec='$libname$release$shared_ext$major'
- if test 32 = "$HPUX_IA64_MODE"; then
- sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
- else
- sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
- fi
- sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
- ;;
- hppa*64*)
- shrext_cmds='.sl'
- hardcode_into_libs=yes
- dynamic_linker="$host_os dld.sl"
- shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
- shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
- library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
- soname_spec='$libname$release$shared_ext$major'
- sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
- sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
- ;;
- *)
- shrext_cmds='.sl'
- dynamic_linker="$host_os dld.sl"
- shlibpath_var=SHLIB_PATH
- shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
- library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
- soname_spec='$libname$release$shared_ext$major'
- ;;
- esac
- # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
- postinstall_cmds='chmod 555 $lib'
- # or fails outright, so override atomically:
- install_override_mode=555
- ;;
-
-interix[[3-9]]*)
- version_type=linux # correct to gnu/linux during the next big refactor
- need_lib_prefix=no
- need_version=no
- library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
- soname_spec='$libname$release$shared_ext$major'
- dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- ;;
-
-irix5* | irix6* | nonstopux*)
- case $host_os in
- nonstopux*) version_type=nonstopux ;;
- *)
- if test yes = "$lt_cv_prog_gnu_ld"; then
- version_type=linux # correct to gnu/linux during the next big refactor
- else
- version_type=irix
- fi ;;
- esac
- need_lib_prefix=no
- need_version=no
- soname_spec='$libname$release$shared_ext$major'
- library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext'
- case $host_os in
- irix5* | nonstopux*)
- libsuff= shlibsuff=
- ;;
- *)
- case $LD in # libtool.m4 will add one of these switches to LD
- *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
- libsuff= shlibsuff= libmagic=32-bit;;
- *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
- libsuff=32 shlibsuff=N32 libmagic=N32;;
- *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
- libsuff=64 shlibsuff=64 libmagic=64-bit;;
- *) libsuff= shlibsuff= libmagic=never-match;;
- esac
- ;;
- esac
- shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
- shlibpath_overrides_runpath=no
- sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff"
- sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff"
- hardcode_into_libs=yes
- ;;
-
-# No shared lib support for Linux oldld, aout, or coff.
-linux*oldld* | linux*aout* | linux*coff*)
- dynamic_linker=no
- ;;
-
-linux*android*)
- version_type=none # Android doesn't support versioned libraries.
- need_lib_prefix=no
- need_version=no
- library_names_spec='$libname$release$shared_ext'
- soname_spec='$libname$release$shared_ext'
- finish_cmds=
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
-
- # This implies no fast_install, which is unacceptable.
- # Some rework will be needed to allow for fast_install
- # before this can be enabled.
- hardcode_into_libs=yes
-
- dynamic_linker='Android linker'
- # Don't embed -rpath directories since the linker doesn't support them.
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
- ;;
-
-# This must be glibc/ELF.
-linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
- version_type=linux # correct to gnu/linux during the next big refactor
- need_lib_prefix=no
- need_version=no
- library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
- soname_spec='$libname$release$shared_ext$major'
- finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
-
- # Some binutils ld are patched to set DT_RUNPATH
- AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath],
- [lt_cv_shlibpath_overrides_runpath=no
- save_LDFLAGS=$LDFLAGS
- save_libdir=$libdir
- eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \
- LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\""
- AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
- [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null],
- [lt_cv_shlibpath_overrides_runpath=yes])])
- LDFLAGS=$save_LDFLAGS
- libdir=$save_libdir
- ])
- shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
-
- # This implies no fast_install, which is unacceptable.
- # Some rework will be needed to allow for fast_install
- # before this can be enabled.
- hardcode_into_libs=yes
-
- # Append ld.so.conf contents to the search path
- if test -f /etc/ld.so.conf; then
- lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
- sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
- fi
-
- # We used to test for /lib/ld.so.1 and disable shared libraries on
- # powerpc, because MkLinux only supported shared libraries with the
- # GNU dynamic linker. Since this was broken with cross compilers,
- # most powerpc-linux boxes support dynamic linking these days and
- # people can always --disable-shared, the test was removed, and we
- # assume the GNU/Linux dynamic linker is in use.
- dynamic_linker='GNU/Linux ld.so'
- ;;
-
-netbsd*)
- version_type=sunos
- need_lib_prefix=no
- need_version=no
- if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
- library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
- finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
- dynamic_linker='NetBSD (a.out) ld.so'
- else
- library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
- soname_spec='$libname$release$shared_ext$major'
- dynamic_linker='NetBSD ld.elf_so'
- fi
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- ;;
-
-newsos6)
- version_type=linux # correct to gnu/linux during the next big refactor
- library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- ;;
-
-*nto* | *qnx*)
- version_type=qnx
- need_lib_prefix=no
- need_version=no
- library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
- soname_spec='$libname$release$shared_ext$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- dynamic_linker='ldqnx.so'
- ;;
-
-openbsd* | bitrig*)
- version_type=sunos
- sys_lib_dlsearch_path_spec=/usr/lib
- need_lib_prefix=no
- if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
- need_version=no
- else
- need_version=yes
- fi
- library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
- finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- ;;
-
-os2*)
- libname_spec='$name'
- shrext_cmds=.dll
- need_lib_prefix=no
- library_names_spec='$libname$shared_ext $libname.a'
- dynamic_linker='OS/2 ld.exe'
- shlibpath_var=LIBPATH
- ;;
-
-osf3* | osf4* | osf5*)
- version_type=osf
- need_lib_prefix=no
- need_version=no
- soname_spec='$libname$release$shared_ext$major'
- library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
- shlibpath_var=LD_LIBRARY_PATH
- sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
- sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
- ;;
-
-rdos*)
- dynamic_linker=no
- ;;
-
-solaris*)
- version_type=linux # correct to gnu/linux during the next big refactor
- need_lib_prefix=no
- need_version=no
- library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
- soname_spec='$libname$release$shared_ext$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- # ldd complains unless libraries are executable
- postinstall_cmds='chmod +x $lib'
- ;;
-
-sunos4*)
- version_type=sunos
- library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
- finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- if test yes = "$with_gnu_ld"; then
- need_lib_prefix=no
- fi
- need_version=yes
- ;;
-
-sysv4 | sysv4.3*)
- version_type=linux # correct to gnu/linux during the next big refactor
- library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
- soname_spec='$libname$release$shared_ext$major'
- shlibpath_var=LD_LIBRARY_PATH
- case $host_vendor in
- sni)
- shlibpath_overrides_runpath=no
- need_lib_prefix=no
- runpath_var=LD_RUN_PATH
- ;;
- siemens)
- need_lib_prefix=no
- ;;
- motorola)
- need_lib_prefix=no
- need_version=no
- shlibpath_overrides_runpath=no
- sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
- ;;
- esac
- ;;
-
-sysv4*MP*)
- if test -d /usr/nec; then
- version_type=linux # correct to gnu/linux during the next big refactor
- library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext'
- soname_spec='$libname$shared_ext.$major'
- shlibpath_var=LD_LIBRARY_PATH
- fi
- ;;
-
-sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
- version_type=freebsd-elf
- need_lib_prefix=no
- need_version=no
- library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext'
- soname_spec='$libname$release$shared_ext$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- if test yes = "$with_gnu_ld"; then
- sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
- else
- sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
- case $host_os in
- sco3.2v5*)
- sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
- ;;
- esac
- fi
- sys_lib_dlsearch_path_spec='/usr/lib'
- ;;
-
-tpf*)
- # TPF is a cross-target only. Preferred cross-host = GNU/Linux.
- version_type=linux # correct to gnu/linux during the next big refactor
- need_lib_prefix=no
- need_version=no
- library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- ;;
-
-uts4*)
- version_type=linux # correct to gnu/linux during the next big refactor
- library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
- soname_spec='$libname$release$shared_ext$major'
- shlibpath_var=LD_LIBRARY_PATH
- ;;
-
-*)
- dynamic_linker=no
- ;;
-esac
-AC_MSG_RESULT([$dynamic_linker])
-test no = "$dynamic_linker" && can_build_shared=no
-
-variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
-if test yes = "$GCC"; then
- variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
-fi
-
-if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then
- sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec
-fi
-if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then
- sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec
-fi
-
-_LT_DECL([], [variables_saved_for_relink], [1],
- [Variables whose values should be saved in libtool wrapper scripts and
- restored at link time])
-_LT_DECL([], [need_lib_prefix], [0],
- [Do we need the "lib" prefix for modules?])
-_LT_DECL([], [need_version], [0], [Do we need a version for libraries?])
-_LT_DECL([], [version_type], [0], [Library versioning type])
-_LT_DECL([], [runpath_var], [0], [Shared library runtime path variable])
-_LT_DECL([], [shlibpath_var], [0],[Shared library path variable])
-_LT_DECL([], [shlibpath_overrides_runpath], [0],
- [Is shlibpath searched before the hard-coded library search path?])
-_LT_DECL([], [libname_spec], [1], [Format of library name prefix])
-_LT_DECL([], [library_names_spec], [1],
- [[List of archive names. First name is the real one, the rest are links.
- The last name is the one that the linker finds with -lNAME]])
-_LT_DECL([], [soname_spec], [1],
- [[The coded name of the library, if different from the real name]])
-_LT_DECL([], [install_override_mode], [1],
- [Permission mode override for installation of shared libraries])
-_LT_DECL([], [postinstall_cmds], [2],
- [Command to use after installation of a shared archive])
-_LT_DECL([], [postuninstall_cmds], [2],
- [Command to use after uninstallation of a shared archive])
-_LT_DECL([], [finish_cmds], [2],
- [Commands used to finish a libtool library installation in a directory])
-_LT_DECL([], [finish_eval], [1],
- [[As "finish_cmds", except a single script fragment to be evaled but
- not shown]])
-_LT_DECL([], [hardcode_into_libs], [0],
- [Whether we should hardcode library paths into libraries])
-_LT_DECL([], [sys_lib_search_path_spec], [2],
- [Compile-time system search path for libraries])
-_LT_DECL([], [sys_lib_dlsearch_path_spec], [2],
- [Run-time system search path for libraries])
-])# _LT_SYS_DYNAMIC_LINKER
-
-
-# _LT_PATH_TOOL_PREFIX(TOOL)
-# --------------------------
-# find a file program that can recognize shared library
-AC_DEFUN([_LT_PATH_TOOL_PREFIX],
-[m4_require([_LT_DECL_EGREP])dnl
-AC_MSG_CHECKING([for $1])
-AC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
-[case $MAGIC_CMD in
-[[\\/*] | ?:[\\/]*])
- lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path.
- ;;
-*)
- lt_save_MAGIC_CMD=$MAGIC_CMD
- lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
-dnl $ac_dummy forces splitting on constant user-supplied paths.
-dnl POSIX.2 word splitting is done only on the output of word expansions,
-dnl not every word. This closes a longstanding sh security hole.
- ac_dummy="m4_if([$2], , $PATH, [$2])"
- for ac_dir in $ac_dummy; do
- IFS=$lt_save_ifs
- test -z "$ac_dir" && ac_dir=.
- if test -f "$ac_dir/$1"; then
- lt_cv_path_MAGIC_CMD=$ac_dir/"$1"
- if test -n "$file_magic_test_file"; then
- case $deplibs_check_method in
- "file_magic "*)
- file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
- MAGIC_CMD=$lt_cv_path_MAGIC_CMD
- if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
- $EGREP "$file_magic_regex" > /dev/null; then
- :
- else
- cat <<_LT_EOF 1>&2
-
-*** Warning: the command libtool uses to detect shared libraries,
-*** $file_magic_cmd, produces output that libtool cannot recognize.
-*** The result is that libtool may fail to recognize shared libraries
-*** as such. This will affect the creation of libtool libraries that
-*** depend on shared libraries, but programs linked with such libtool
-*** libraries will work regardless of this problem. Nevertheless, you
-*** may want to report the problem to your system manager and/or to
-*** bug-libtool@gnu.org
-
-_LT_EOF
- fi ;;
- esac
- fi
- break
- fi
- done
- IFS=$lt_save_ifs
- MAGIC_CMD=$lt_save_MAGIC_CMD
- ;;
-esac])
-MAGIC_CMD=$lt_cv_path_MAGIC_CMD
-if test -n "$MAGIC_CMD"; then
- AC_MSG_RESULT($MAGIC_CMD)
-else
- AC_MSG_RESULT(no)
-fi
-_LT_DECL([], [MAGIC_CMD], [0],
- [Used to examine libraries when file_magic_cmd begins with "file"])dnl
-])# _LT_PATH_TOOL_PREFIX
-
-# Old name:
-AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], [])
-
-
-# _LT_PATH_MAGIC
-# --------------
-# find a file program that can recognize a shared library
-m4_defun([_LT_PATH_MAGIC],
-[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
-if test -z "$lt_cv_path_MAGIC_CMD"; then
- if test -n "$ac_tool_prefix"; then
- _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
- else
- MAGIC_CMD=:
- fi
-fi
-])# _LT_PATH_MAGIC
-
-
-# LT_PATH_LD
-# ----------
-# find the pathname to the GNU or non-GNU linker
-AC_DEFUN([LT_PATH_LD],
-[AC_REQUIRE([AC_PROG_CC])dnl
-AC_REQUIRE([AC_CANONICAL_HOST])dnl
-AC_REQUIRE([AC_CANONICAL_BUILD])dnl
-m4_require([_LT_DECL_SED])dnl
-m4_require([_LT_DECL_EGREP])dnl
-m4_require([_LT_PROG_ECHO_BACKSLASH])dnl
-
-AC_ARG_WITH([gnu-ld],
- [AS_HELP_STRING([--with-gnu-ld],
- [assume the C compiler uses GNU ld @<:@default=no@:>@])],
- [test no = "$withval" || with_gnu_ld=yes],
- [with_gnu_ld=no])dnl
-
-ac_prog=ld
-if test yes = "$GCC"; then
- # Check if gcc -print-prog-name=ld gives a path.
- AC_MSG_CHECKING([for ld used by $CC])
- 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.
- [[\\/]]* | ?:[[\\/]]*)
- re_direlt='/[[^/]][[^/]]*/\.\./'
- # Canonicalize the pathname 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 yes = "$with_gnu_ld"; then
- AC_MSG_CHECKING([for GNU ld])
-else
- AC_MSG_CHECKING([for non-GNU ld])
-fi
-AC_CACHE_VAL(lt_cv_path_LD,
-[if test -z "$LD"; then
- lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
- for ac_dir in $PATH; do
- IFS=$lt_save_ifs
- test -z "$ac_dir" && ac_dir=.
- if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
- lt_cv_path_LD=$ac_dir/$ac_prog
- # Check to see if the program is GNU ld. I'd rather use --version,
- # but apparently some variants of GNU ld only accept -v.
- # Break only if it was the GNU/non-GNU ld that we prefer.
- case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
- *GNU* | *'with BFD'*)
- test no != "$with_gnu_ld" && break
- ;;
- *)
- test yes != "$with_gnu_ld" && break
- ;;
- esac
- fi
- done
- IFS=$lt_save_ifs
-else
- lt_cv_path_LD=$LD # Let the user override the test with a path.
-fi])
-LD=$lt_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])
-_LT_PATH_LD_GNU
-AC_SUBST([LD])
-
-_LT_TAGDECL([], [LD], [1], [The linker used to build libraries])
-])# LT_PATH_LD
-
-# Old names:
-AU_ALIAS([AM_PROG_LD], [LT_PATH_LD])
-AU_ALIAS([AC_PROG_LD], [LT_PATH_LD])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AM_PROG_LD], [])
-dnl AC_DEFUN([AC_PROG_LD], [])
-
-
-# _LT_PATH_LD_GNU
-#- --------------
-m4_defun([_LT_PATH_LD_GNU],
-[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
-[# I'd rather use --version here, but apparently some GNU lds only accept -v.
-case `$LD -v 2>&1 </dev/null` in
-*GNU* | *'with BFD'*)
- lt_cv_prog_gnu_ld=yes
- ;;
-*)
- lt_cv_prog_gnu_ld=no
- ;;
-esac])
-with_gnu_ld=$lt_cv_prog_gnu_ld
-])# _LT_PATH_LD_GNU
-
-
-# _LT_CMD_RELOAD
-# --------------
-# find reload flag for linker
-# -- PORTME Some linkers may need a different reload flag.
-m4_defun([_LT_CMD_RELOAD],
-[AC_CACHE_CHECK([for $LD option to reload object files],
- lt_cv_ld_reload_flag,
- [lt_cv_ld_reload_flag='-r'])
-reload_flag=$lt_cv_ld_reload_flag
-case $reload_flag in
-"" | " "*) ;;
-*) reload_flag=" $reload_flag" ;;
-esac
-reload_cmds='$LD$reload_flag -o $output$reload_objs'
-case $host_os in
- cygwin* | mingw* | pw32* | cegcc*)
- if test yes != "$GCC"; then
- reload_cmds=false
- fi
- ;;
- darwin*)
- if test yes = "$GCC"; then
- reload_cmds='$LTCC $LTCFLAGS -nostdlib $wl-r -o $output$reload_objs'
- else
- reload_cmds='$LD$reload_flag -o $output$reload_objs'
- fi
- ;;
-esac
-_LT_TAGDECL([], [reload_flag], [1], [How to create reloadable object files])dnl
-_LT_TAGDECL([], [reload_cmds], [2])dnl
-])# _LT_CMD_RELOAD
-
-
-# _LT_CHECK_MAGIC_METHOD
-# ----------------------
-# how to check for library dependencies
-# -- PORTME fill in with the dynamic library characteristics
-m4_defun([_LT_CHECK_MAGIC_METHOD],
-[m4_require([_LT_DECL_EGREP])
-m4_require([_LT_DECL_OBJDUMP])
-AC_CACHE_CHECK([how to recognize dependent libraries],
-lt_cv_deplibs_check_method,
-[lt_cv_file_magic_cmd='$MAGIC_CMD'
-lt_cv_file_magic_test_file=
-lt_cv_deplibs_check_method='unknown'
-# Need to set the preceding variable on all platforms that support
-# interlibrary dependencies.
-# 'none' -- dependencies not supported.
-# 'unknown' -- same as none, but documents that we really don't know.
-# 'pass_all' -- all dependencies passed with no checks.
-# 'test_compile' -- check by making test program.
-# 'file_magic [[regex]]' -- check by looking for files in library path
-# that responds to the $file_magic_cmd with a given extended regex.
-# If you have 'file' or equivalent on your system and you're not sure
-# whether 'pass_all' will *always* work, you probably want this one.
-
-case $host_os in
-aix[[4-9]]*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-beos*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-bsdi[[45]]*)
- lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
- lt_cv_file_magic_cmd='/usr/bin/file -L'
- lt_cv_file_magic_test_file=/shlib/libc.so
- ;;
-
-cygwin*)
- # func_win32_libid is a shell function defined in ltmain.sh
- lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
- lt_cv_file_magic_cmd='func_win32_libid'
- ;;
-
-mingw* | pw32*)
- # Base MSYS/MinGW do not provide the 'file' command needed by
- # func_win32_libid shell function, so use a weaker test based on 'objdump',
- # unless we find 'file', for example because we are cross-compiling.
- if ( file / ) >/dev/null 2>&1; then
- lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
- lt_cv_file_magic_cmd='func_win32_libid'
- else
- # Keep this pattern in sync with the one in func_win32_libid.
- lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
- lt_cv_file_magic_cmd='$OBJDUMP -f'
- fi
- ;;
-
-cegcc*)
- # use the weaker test based on 'objdump'. See mingw*.
- lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
- lt_cv_file_magic_cmd='$OBJDUMP -f'
- ;;
-
-darwin* | rhapsody*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-freebsd* | dragonfly*)
- if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
- case $host_cpu in
- i*86 )
- # Not sure whether the presence of OpenBSD here was a mistake.
- # Let's accept both of them until this is cleared up.
- lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
- lt_cv_file_magic_cmd=/usr/bin/file
- lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
- ;;
- esac
- else
- lt_cv_deplibs_check_method=pass_all
- fi
- ;;
-
-haiku*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-hpux10.20* | hpux11*)
- lt_cv_file_magic_cmd=/usr/bin/file
- case $host_cpu in
- ia64*)
- lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
- lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
- ;;
- hppa*64*)
- [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]']
- lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
- ;;
- *)
- lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library'
- lt_cv_file_magic_test_file=/usr/lib/libc.sl
- ;;
- esac
- ;;
-
-interix[[3-9]]*)
- # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
- lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
- ;;
-
-irix5* | irix6* | nonstopux*)
- case $LD in
- *-32|*"-32 ") libmagic=32-bit;;
- *-n32|*"-n32 ") libmagic=N32;;
- *-64|*"-64 ") libmagic=64-bit;;
- *) libmagic=never-match;;
- esac
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-# This must be glibc/ELF.
-linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-netbsd*)
- if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
- lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
- else
- lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
- fi
- ;;
-
-newos6*)
- lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
- lt_cv_file_magic_cmd=/usr/bin/file
- lt_cv_file_magic_test_file=/usr/lib/libnls.so
- ;;
-
-*nto* | *qnx*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-openbsd* | bitrig*)
- if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
- lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
- else
- lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
- fi
- ;;
-
-osf3* | osf4* | osf5*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-rdos*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-solaris*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-sysv4 | sysv4.3*)
- case $host_vendor in
- motorola)
- lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]'
- lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
- ;;
- ncr)
- lt_cv_deplibs_check_method=pass_all
- ;;
- sequent)
- lt_cv_file_magic_cmd='/bin/file'
- lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
- ;;
- sni)
- lt_cv_file_magic_cmd='/bin/file'
- lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
- lt_cv_file_magic_test_file=/lib/libc.so
- ;;
- siemens)
- lt_cv_deplibs_check_method=pass_all
- ;;
- pc)
- lt_cv_deplibs_check_method=pass_all
- ;;
- esac
- ;;
-
-tpf*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-esac
-])
-
-file_magic_glob=
-want_nocaseglob=no
-if test "$build" = "$host"; then
- case $host_os in
- mingw* | pw32*)
- if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
- want_nocaseglob=yes
- else
- file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"`
- fi
- ;;
- esac
-fi
-
-file_magic_cmd=$lt_cv_file_magic_cmd
-deplibs_check_method=$lt_cv_deplibs_check_method
-test -z "$deplibs_check_method" && deplibs_check_method=unknown
-
-_LT_DECL([], [deplibs_check_method], [1],
- [Method to check whether dependent libraries are shared objects])
-_LT_DECL([], [file_magic_cmd], [1],
- [Command to use when deplibs_check_method = "file_magic"])
-_LT_DECL([], [file_magic_glob], [1],
- [How to find potential files when deplibs_check_method = "file_magic"])
-_LT_DECL([], [want_nocaseglob], [1],
- [Find potential files using nocaseglob when deplibs_check_method = "file_magic"])
-])# _LT_CHECK_MAGIC_METHOD
-
-
-# LT_PATH_NM
-# ----------
-# find the pathname to a BSD- or MS-compatible name lister
-AC_DEFUN([LT_PATH_NM],
-[AC_REQUIRE([AC_PROG_CC])dnl
-AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM,
-[if test -n "$NM"; then
- # Let the user override the test.
- lt_cv_path_NM=$NM
-else
- lt_nm_to_check=${ac_tool_prefix}nm
- if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
- lt_nm_to_check="$lt_nm_to_check nm"
- fi
- for lt_tmp_nm in $lt_nm_to_check; do
- lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
- for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
- IFS=$lt_save_ifs
- test -z "$ac_dir" && ac_dir=.
- tmp_nm=$ac_dir/$lt_tmp_nm
- if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then
- # Check to see if the nm accepts a BSD-compat flag.
- # Adding the 'sed 1q' prevents false positives on HP-UX, which says:
- # nm: unknown option "B" ignored
- # Tru64's nm complains that /dev/null is an invalid object file
- case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
- */dev/null* | *'Invalid file or object type'*)
- lt_cv_path_NM="$tmp_nm -B"
- break 2
- ;;
- *)
- case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
- */dev/null*)
- lt_cv_path_NM="$tmp_nm -p"
- break 2
- ;;
- *)
- lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
- continue # so that we can try to find one that supports BSD flags
- ;;
- esac
- ;;
- esac
- fi
- done
- IFS=$lt_save_ifs
- done
- : ${lt_cv_path_NM=no}
-fi])
-if test no != "$lt_cv_path_NM"; then
- NM=$lt_cv_path_NM
-else
- # Didn't find any BSD compatible name lister, look for dumpbin.
- if test -n "$DUMPBIN"; then :
- # Let the user override the test.
- else
- AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :)
- case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in
- *COFF*)
- DUMPBIN="$DUMPBIN -symbols -headers"
- ;;
- *)
- DUMPBIN=:
- ;;
- esac
- fi
- AC_SUBST([DUMPBIN])
- if test : != "$DUMPBIN"; then
- NM=$DUMPBIN
- fi
-fi
-test -z "$NM" && NM=nm
-AC_SUBST([NM])
-_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl
-
-AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface],
- [lt_cv_nm_interface="BSD nm"
- echo "int some_variable = 0;" > conftest.$ac_ext
- (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD)
- (eval "$ac_compile" 2>conftest.err)
- cat conftest.err >&AS_MESSAGE_LOG_FD
- (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD)
- (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
- cat conftest.err >&AS_MESSAGE_LOG_FD
- (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD)
- cat conftest.out >&AS_MESSAGE_LOG_FD
- if $GREP 'External.*some_variable' conftest.out > /dev/null; then
- lt_cv_nm_interface="MS dumpbin"
- fi
- rm -f conftest*])
-])# LT_PATH_NM
-
-# Old names:
-AU_ALIAS([AM_PROG_NM], [LT_PATH_NM])
-AU_ALIAS([AC_PROG_NM], [LT_PATH_NM])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AM_PROG_NM], [])
-dnl AC_DEFUN([AC_PROG_NM], [])
-
-# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
-# --------------------------------
-# how to determine the name of the shared library
-# associated with a specific link library.
-# -- PORTME fill in with the dynamic library characteristics
-m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB],
-[m4_require([_LT_DECL_EGREP])
-m4_require([_LT_DECL_OBJDUMP])
-m4_require([_LT_DECL_DLLTOOL])
-AC_CACHE_CHECK([how to associate runtime and link libraries],
-lt_cv_sharedlib_from_linklib_cmd,
-[lt_cv_sharedlib_from_linklib_cmd='unknown'
-
-case $host_os in
-cygwin* | mingw* | pw32* | cegcc*)
- # two different shell functions defined in ltmain.sh;
- # decide which one to use based on capabilities of $DLLTOOL
- case `$DLLTOOL --help 2>&1` in
- *--identify-strict*)
- lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
- ;;
- *)
- lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
- ;;
- esac
- ;;
-*)
- # fallback: assume linklib IS sharedlib
- lt_cv_sharedlib_from_linklib_cmd=$ECHO
- ;;
-esac
-])
-sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
-test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
-
-_LT_DECL([], [sharedlib_from_linklib_cmd], [1],
- [Command to associate shared and link libraries])
-])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
-
-
-# _LT_PATH_MANIFEST_TOOL
-# ----------------------
-# locate the manifest tool
-m4_defun([_LT_PATH_MANIFEST_TOOL],
-[AC_CHECK_TOOL(MANIFEST_TOOL, mt, :)
-test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
-AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool],
- [lt_cv_path_mainfest_tool=no
- echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD
- $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
- cat conftest.err >&AS_MESSAGE_LOG_FD
- if $GREP 'Manifest Tool' conftest.out > /dev/null; then
- lt_cv_path_mainfest_tool=yes
- fi
- rm -f conftest*])
-if test yes != "$lt_cv_path_mainfest_tool"; then
- MANIFEST_TOOL=:
-fi
-_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl
-])# _LT_PATH_MANIFEST_TOOL
-
-
-# _LT_DLL_DEF_P([FILE])
-# ---------------------
-# True iff FILE is a Windows DLL '.def' file.
-# Keep in sync with func_dll_def_p in the libtool script
-AC_DEFUN([_LT_DLL_DEF_P],
-[dnl
- test DEF = "`$SED -n dnl
- -e '\''s/^[[ ]]*//'\'' dnl Strip leading whitespace
- -e '\''/^\(;.*\)*$/d'\'' dnl Delete empty lines and comments
- -e '\''s/^\(EXPORTS\|LIBRARY\)\([[ ]].*\)*$/DEF/p'\'' dnl
- -e q dnl Only consider the first "real" line
- $1`" dnl
-])# _LT_DLL_DEF_P
-
-
-# LT_LIB_M
-# --------
-# check for math library
-AC_DEFUN([LT_LIB_M],
-[AC_REQUIRE([AC_CANONICAL_HOST])dnl
-LIBM=
-case $host in
-*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*)
- # These system don't have libm, or don't need it
- ;;
-*-ncr-sysv4.3*)
- AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM=-lmw)
- AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
- ;;
-*)
- AC_CHECK_LIB(m, cos, LIBM=-lm)
- ;;
-esac
-AC_SUBST([LIBM])
-])# LT_LIB_M
-
-# Old name:
-AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_CHECK_LIBM], [])
-
-
-# _LT_COMPILER_NO_RTTI([TAGNAME])
-# -------------------------------
-m4_defun([_LT_COMPILER_NO_RTTI],
-[m4_require([_LT_TAG_COMPILER])dnl
-
-_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
-
-if test yes = "$GCC"; then
- case $cc_basename in
- nvcc*)
- _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;;
- *)
- _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;;
- esac
-
- _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
- lt_cv_prog_compiler_rtti_exceptions,
- [-fno-rtti -fno-exceptions], [],
- [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
-fi
-_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1],
- [Compiler flag to turn off builtin functions])
-])# _LT_COMPILER_NO_RTTI
-
-
-# _LT_CMD_GLOBAL_SYMBOLS
-# ----------------------
-m4_defun([_LT_CMD_GLOBAL_SYMBOLS],
-[AC_REQUIRE([AC_CANONICAL_HOST])dnl
-AC_REQUIRE([AC_PROG_CC])dnl
-AC_REQUIRE([AC_PROG_AWK])dnl
-AC_REQUIRE([LT_PATH_NM])dnl
-AC_REQUIRE([LT_PATH_LD])dnl
-m4_require([_LT_DECL_SED])dnl
-m4_require([_LT_DECL_EGREP])dnl
-m4_require([_LT_TAG_COMPILER])dnl
-
-# Check for command to grab the raw symbol name followed by C symbol from nm.
-AC_MSG_CHECKING([command to parse $NM output from $compiler object])
-AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
-[
-# These are sane defaults that work on at least a few old systems.
-# [They come from Ultrix. What could be older than Ultrix?!! ;)]
-
-# Character class describing NM global symbol codes.
-symcode='[[BCDEGRST]]'
-
-# Regexp to match symbols that can be accessed directly from C.
-sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
-
-# Define system-specific variables.
-case $host_os in
-aix*)
- symcode='[[BCDT]]'
- ;;
-cygwin* | mingw* | pw32* | cegcc*)
- symcode='[[ABCDGISTW]]'
- ;;
-hpux*)
- if test ia64 = "$host_cpu"; then
- symcode='[[ABCDEGRST]]'
- fi
- ;;
-irix* | nonstopux*)
- symcode='[[BCDEGRST]]'
- ;;
-osf*)
- symcode='[[BCDEGQRST]]'
- ;;
-solaris*)
- symcode='[[BDRT]]'
- ;;
-sco3.2v5*)
- symcode='[[DT]]'
- ;;
-sysv4.2uw2*)
- symcode='[[DT]]'
- ;;
-sysv5* | sco5v6* | unixware* | OpenUNIX*)
- symcode='[[ABDT]]'
- ;;
-sysv4)
- symcode='[[DFNSTU]]'
- ;;
-esac
-
-# If we're using GNU nm, then use its standard symbol codes.
-case `$NM -V 2>&1` in
-*GNU* | *'with BFD'*)
- symcode='[[ABCDGIRSTW]]' ;;
-esac
-
-if test "$lt_cv_nm_interface" = "MS dumpbin"; then
- # Gets list of data symbols to import.
- lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'"
- # Adjust the below global symbol transforms to fixup imported variables.
- lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'"
- lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'"
- lt_c_name_lib_hook="\
- -e 's/^I .* \(lib.*\)$/ {\"\1\", (void *) 0},/p'\
- -e 's/^I .* \(.*\)$/ {\"lib\1\", (void *) 0},/p'"
-else
- # Disable hooks by default.
- lt_cv_sys_global_symbol_to_import=
- lt_cdecl_hook=
- lt_c_name_hook=
- lt_c_name_lib_hook=
-fi
-
-# Transform an extracted symbol line into a proper C declaration.
-# Some systems (esp. on ia64) link data and code symbols differently,
-# so use this general approach.
-lt_cv_sys_global_symbol_to_cdecl="sed -n"\
-$lt_cdecl_hook\
-" -e 's/^T .* \(.*\)$/extern int \1();/p'"\
-" -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'"
-
-# Transform an extracted symbol line into symbol name and symbol address
-lt_cv_sys_global_symbol_to_c_name_address="sed -n"\
-$lt_c_name_hook\
-" -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\
-" -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'"
-
-# Transform an extracted symbol line into symbol name with lib prefix and
-# symbol address.
-lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\
-$lt_c_name_lib_hook\
-" -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\
-" -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\
-" -e 's/^$symcode$symcode* .* \(.*\)$/ {\"lib\1\", (void *) \&\1},/p'"
-
-# Handle CRLF in mingw tool chain
-opt_cr=
-case $build_os in
-mingw*)
- opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
- ;;
-esac
-
-# Try without a prefix underscore, then with it.
-for ac_symprfx in "" "_"; do
-
- # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
- symxfrm="\\1 $ac_symprfx\\2 \\2"
-
- # Write the raw and C identifiers.
- if test "$lt_cv_nm_interface" = "MS dumpbin"; then
- # Fake it for dumpbin and say T for any non-static function,
- # D for any global variable and I for any imported variable.
- # Also find C++ and __fastcall symbols from MSVC++,
- # which start with @ or ?.
- lt_cv_sys_global_symbol_pipe="$AWK ['"\
-" {last_section=section; section=\$ 3};"\
-" /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\
-" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
-" /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\
-" /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\
-" /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\
-" \$ 0!~/External *\|/{next};"\
-" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
-" {if(hide[section]) next};"\
-" {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\
-" {split(\$ 0,a,/\||\r/); split(a[2],s)};"\
-" s[1]~/^[@?]/{print f,s[1],s[1]; next};"\
-" s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\
-" ' prfx=^$ac_symprfx]"
- else
- lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
- fi
- lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
-
- # Check to see that the pipe works correctly.
- pipe_works=no
-
- rm -f conftest*
- cat > conftest.$ac_ext <<_LT_EOF
-#ifdef __cplusplus
-extern "C" {
-#endif
-char nm_test_var;
-void nm_test_func(void);
-void nm_test_func(void){}
-#ifdef __cplusplus
-}
-#endif
-int main(){nm_test_var='a';nm_test_func();return(0);}
-_LT_EOF
-
- if AC_TRY_EVAL(ac_compile); then
- # Now try to grab the symbols.
- nlist=conftest.nm
- if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then
- # Try sorting and uniquifying the output.
- if sort "$nlist" | uniq > "$nlist"T; then
- mv -f "$nlist"T "$nlist"
- else
- rm -f "$nlist"T
- fi
-
- # Make sure that we snagged all the symbols we need.
- if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
- if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
- cat <<_LT_EOF > conftest.$ac_ext
-/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */
-#if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE
-/* DATA imports from DLLs on WIN32 can't be const, because runtime
- relocations are performed -- see ld's documentation on pseudo-relocs. */
-# define LT@&t@_DLSYM_CONST
-#elif defined __osf__
-/* This system does not cope well with relocations in const data. */
-# define LT@&t@_DLSYM_CONST
-#else
-# define LT@&t@_DLSYM_CONST const
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-_LT_EOF
- # Now generate the symbol file.
- eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
-
- cat <<_LT_EOF >> conftest.$ac_ext
-
-/* The mapping between symbol names and symbols. */
-LT@&t@_DLSYM_CONST struct {
- const char *name;
- void *address;
-}
-lt__PROGRAM__LTX_preloaded_symbols[[]] =
-{
- { "@PROGRAM@", (void *) 0 },
-_LT_EOF
- $SED "s/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
- cat <<\_LT_EOF >> conftest.$ac_ext
- {0, (void *) 0}
-};
-
-/* This works around a problem in FreeBSD linker */
-#ifdef FREEBSD_WORKAROUND
-static const void *lt_preloaded_setup() {
- return lt__PROGRAM__LTX_preloaded_symbols;
-}
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-_LT_EOF
- # Now try linking the two files.
- mv conftest.$ac_objext conftstm.$ac_objext
- lt_globsym_save_LIBS=$LIBS
- lt_globsym_save_CFLAGS=$CFLAGS
- LIBS=conftstm.$ac_objext
- CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
- if AC_TRY_EVAL(ac_link) && test -s conftest$ac_exeext; then
- pipe_works=yes
- fi
- LIBS=$lt_globsym_save_LIBS
- CFLAGS=$lt_globsym_save_CFLAGS
- else
- echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
- fi
- else
- echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
- fi
- else
- echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
- fi
- else
- echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
- cat conftest.$ac_ext >&5
- fi
- rm -rf conftest* conftst*
-
- # Do not use the global_symbol_pipe unless it works.
- if test yes = "$pipe_works"; then
- break
- else
- lt_cv_sys_global_symbol_pipe=
- fi
-done
-])
-if test -z "$lt_cv_sys_global_symbol_pipe"; then
- lt_cv_sys_global_symbol_to_cdecl=
-fi
-if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
- AC_MSG_RESULT(failed)
-else
- AC_MSG_RESULT(ok)
-fi
-
-# Response file support.
-if test "$lt_cv_nm_interface" = "MS dumpbin"; then
- nm_file_list_spec='@'
-elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then
- nm_file_list_spec='@'
-fi
-
-_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1],
- [Take the output of nm and produce a listing of raw symbols and C names])
-_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],
- [Transform the output of nm in a proper C declaration])
-_LT_DECL([global_symbol_to_import], [lt_cv_sys_global_symbol_to_import], [1],
- [Transform the output of nm into a list of symbols to manually relocate])
-_LT_DECL([global_symbol_to_c_name_address],
- [lt_cv_sys_global_symbol_to_c_name_address], [1],
- [Transform the output of nm in a C name address pair])
-_LT_DECL([global_symbol_to_c_name_address_lib_prefix],
- [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],
- [Transform the output of nm in a C name address pair when lib prefix is needed])
-_LT_DECL([nm_interface], [lt_cv_nm_interface], [1],
- [The name lister interface])
-_LT_DECL([], [nm_file_list_spec], [1],
- [Specify filename containing input files for $NM])
-]) # _LT_CMD_GLOBAL_SYMBOLS
-
-
-# _LT_COMPILER_PIC([TAGNAME])
-# ---------------------------
-m4_defun([_LT_COMPILER_PIC],
-[m4_require([_LT_TAG_COMPILER])dnl
-_LT_TAGVAR(lt_prog_compiler_wl, $1)=
-_LT_TAGVAR(lt_prog_compiler_pic, $1)=
-_LT_TAGVAR(lt_prog_compiler_static, $1)=
-
-m4_if([$1], [CXX], [
- # C++ specific cases for pic, static, wl, etc.
- if test yes = "$GXX"; then
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
-
- case $host_os in
- aix*)
- # All AIX code is PIC.
- if test ia64 = "$host_cpu"; then
- # AIX 5 now supports IA64 processor
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- fi
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
- ;;
-
- amigaos*)
- case $host_cpu in
- powerpc)
- # see comment about AmigaOS4 .so support
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
- ;;
- m68k)
- # FIXME: we need at least 68020 code to build shared libraries, but
- # adding the '-m68020' flag to GCC prevents building anything better,
- # like '-m68040'.
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
- ;;
- esac
- ;;
-
- beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
- # PIC is the default for these OSes.
- ;;
- mingw* | cygwin* | os2* | pw32* | cegcc*)
- # This hack is so that the source file can tell whether it is being
- # built for inclusion in a dll (and should export symbols for example).
- # Although the cygwin gcc ignores -fPIC, still need this for old-style
- # (--disable-auto-import) libraries
- m4_if([$1], [GCJ], [],
- [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
- ;;
- darwin* | rhapsody*)
- # PIC is the default on this platform
- # Common symbols not allowed in MH_DYLIB files
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
- ;;
- *djgpp*)
- # DJGPP does not support shared libraries at all
- _LT_TAGVAR(lt_prog_compiler_pic, $1)=
- ;;
- haiku*)
- # PIC is the default for Haiku.
- # The "-static" flag exists, but is broken.
- _LT_TAGVAR(lt_prog_compiler_static, $1)=
- ;;
- interix[[3-9]]*)
- # Interix 3.x gcc -fpic/-fPIC options generate broken code.
- # Instead, we relocate shared libraries at runtime.
- ;;
- sysv4*MP*)
- if test -d /usr/nec; then
- _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
- fi
- ;;
- hpux*)
- # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
- # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag
- # sets the default TLS model and affects inlining.
- case $host_cpu in
- hppa*64*)
- ;;
- *)
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
- ;;
- esac
- ;;
- *qnx* | *nto*)
- # QNX uses GNU C++, but need to define -shared option too, otherwise
- # it will coredump.
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
- ;;
- *)
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
- ;;
- esac
- else
- case $host_os in
- aix[[4-9]]*)
- # All AIX code is PIC.
- if test ia64 = "$host_cpu"; then
- # AIX 5 now supports IA64 processor
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- else
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
- fi
- ;;
- chorus*)
- case $cc_basename in
- cxch68*)
- # Green Hills C++ Compiler
- # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a"
- ;;
- esac
- ;;
- mingw* | cygwin* | os2* | pw32* | cegcc*)
- # This hack is so that the source file can tell whether it is being
- # built for inclusion in a dll (and should export symbols for example).
- m4_if([$1], [GCJ], [],
- [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
- ;;
- dgux*)
- case $cc_basename in
- ec++*)
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
- ;;
- ghcx*)
- # Green Hills C++ Compiler
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
- ;;
- *)
- ;;
- esac
- ;;
- freebsd* | dragonfly*)
- # FreeBSD uses GNU C++
- ;;
- hpux9* | hpux10* | hpux11*)
- case $cc_basename in
- CC*)
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive'
- if test ia64 != "$host_cpu"; then
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
- fi
- ;;
- aCC*)
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive'
- case $host_cpu in
- hppa*64*|ia64*)
- # +Z the default
- ;;
- *)
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
- ;;
- esac
- ;;
- *)
- ;;
- esac
- ;;
- interix*)
- # This is c89, which is MS Visual C++ (no shared libs)
- # Anyone wants to do a port?
- ;;
- irix5* | irix6* | nonstopux*)
- case $cc_basename in
- CC*)
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
- # CC pic flag -KPIC is the default.
- ;;
- *)
- ;;
- esac
- ;;
- linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
- case $cc_basename in
- KCC*)
- # KAI C++ Compiler
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
- ;;
- ecpc* )
- # old Intel C++ for x86_64, which still supported -KPIC.
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
- ;;
- icpc* )
- # Intel C++, used to be incompatible with GCC.
- # ICC 10 doesn't accept -KPIC any more.
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
- ;;
- pgCC* | pgcpp*)
- # Portland Group C++ compiler
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- ;;
- cxx*)
- # Compaq C++
- # Make sure the PIC flag is empty. It appears that all Alpha
- # Linux and Compaq Tru64 Unix objects are PIC.
- _LT_TAGVAR(lt_prog_compiler_pic, $1)=
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
- ;;
- xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*)
- # IBM XL 8.0, 9.0 on PPC and BlueGene
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
- ;;
- *)
- case `$CC -V 2>&1 | sed 5q` in
- *Sun\ C*)
- # Sun C++ 5.9
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
- ;;
- esac
- ;;
- esac
- ;;
- lynxos*)
- ;;
- m88k*)
- ;;
- mvs*)
- case $cc_basename in
- cxx*)
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
- ;;
- *)
- ;;
- esac
- ;;
- netbsd*)
- ;;
- *qnx* | *nto*)
- # QNX uses GNU C++, but need to define -shared option too, otherwise
- # it will coredump.
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
- ;;
- osf3* | osf4* | osf5*)
- case $cc_basename in
- KCC*)
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
- ;;
- RCC*)
- # Rational C++ 2.4.1
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
- ;;
- cxx*)
- # Digital/Compaq C++
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- # Make sure the PIC flag is empty. It appears that all Alpha
- # Linux and Compaq Tru64 Unix objects are PIC.
- _LT_TAGVAR(lt_prog_compiler_pic, $1)=
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
- ;;
- *)
- ;;
- esac
- ;;
- psos*)
- ;;
- solaris*)
- case $cc_basename in
- CC* | sunCC*)
- # Sun C++ 4.2, 5.x and Centerline C++
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
- ;;
- gcx*)
- # Green Hills C++ Compiler
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
- ;;
- *)
- ;;
- esac
- ;;
- sunos4*)
- case $cc_basename in
- CC*)
- # Sun C++ 4.x
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- ;;
- lcc*)
- # Lucid
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
- ;;
- *)
- ;;
- esac
- ;;
- sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
- case $cc_basename in
- CC*)
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- ;;
- esac
- ;;
- tandem*)
- case $cc_basename in
- NCC*)
- # NonStop-UX NCC 3.20
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
- ;;
- *)
- ;;
- esac
- ;;
- vxworks*)
- ;;
- *)
- _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
- ;;
- esac
- fi
-],
-[
- if test yes = "$GCC"; then
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
-
- case $host_os in
- aix*)
- # All AIX code is PIC.
- if test ia64 = "$host_cpu"; then
- # AIX 5 now supports IA64 processor
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- fi
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
- ;;
-
- amigaos*)
- case $host_cpu in
- powerpc)
- # see comment about AmigaOS4 .so support
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
- ;;
- m68k)
- # FIXME: we need at least 68020 code to build shared libraries, but
- # adding the '-m68020' flag to GCC prevents building anything better,
- # like '-m68040'.
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
- ;;
- esac
- ;;
-
- beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
- # PIC is the default for these OSes.
- ;;
-
- mingw* | cygwin* | pw32* | os2* | cegcc*)
- # This hack is so that the source file can tell whether it is being
- # built for inclusion in a dll (and should export symbols for example).
- # Although the cygwin gcc ignores -fPIC, still need this for old-style
- # (--disable-auto-import) libraries
- m4_if([$1], [GCJ], [],
- [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
- ;;
-
- darwin* | rhapsody*)
- # PIC is the default on this platform
- # Common symbols not allowed in MH_DYLIB files
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
- ;;
-
- haiku*)
- # PIC is the default for Haiku.
- # The "-static" flag exists, but is broken.
- _LT_TAGVAR(lt_prog_compiler_static, $1)=
- ;;
-
- hpux*)
- # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
- # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag
- # sets the default TLS model and affects inlining.
- case $host_cpu in
- hppa*64*)
- # +Z the default
- ;;
- *)
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
- ;;
- esac
- ;;
-
- interix[[3-9]]*)
- # Interix 3.x gcc -fpic/-fPIC options generate broken code.
- # Instead, we relocate shared libraries at runtime.
- ;;
-
- msdosdjgpp*)
- # Just because we use GCC doesn't mean we suddenly get shared libraries
- # on systems that don't support them.
- _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
- enable_shared=no
- ;;
-
- *nto* | *qnx*)
- # QNX uses GNU C++, but need to define -shared option too, otherwise
- # it will coredump.
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
- ;;
-
- sysv4*MP*)
- if test -d /usr/nec; then
- _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
- fi
- ;;
-
- *)
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
- ;;
- esac
-
- case $cc_basename in
- nvcc*) # Cuda Compiler Driver 2.2
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker '
- if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
- _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)"
- fi
- ;;
- esac
- else
- # PORTME Check for flag to pass linker flags through the system compiler.
- case $host_os in
- aix*)
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- if test ia64 = "$host_cpu"; then
- # AIX 5 now supports IA64 processor
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- else
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
- fi
- ;;
-
- darwin* | rhapsody*)
- # PIC is the default on this platform
- # Common symbols not allowed in MH_DYLIB files
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
- case $cc_basename in
- nagfor*)
- # NAG Fortran compiler
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- ;;
- esac
- ;;
-
- mingw* | cygwin* | pw32* | os2* | cegcc*)
- # This hack is so that the source file can tell whether it is being
- # built for inclusion in a dll (and should export symbols for example).
- m4_if([$1], [GCJ], [],
- [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
- ;;
-
- hpux9* | hpux10* | hpux11*)
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
- # not for PA HP-UX.
- case $host_cpu in
- hppa*64*|ia64*)
- # +Z the default
- ;;
- *)
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
- ;;
- esac
- # Is there a better lt_prog_compiler_static that works with the bundled CC?
- _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive'
- ;;
-
- irix5* | irix6* | nonstopux*)
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- # PIC (with -KPIC) is the default.
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
- ;;
-
- linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
- case $cc_basename in
- # old Intel for x86_64, which still supported -KPIC.
- ecc*)
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
- ;;
- # icc used to be incompatible with GCC.
- # ICC 10 doesn't accept -KPIC any more.
- icc* | ifort*)
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
- ;;
- # Lahey Fortran 8.1.
- lf95*)
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='--static'
- ;;
- nagfor*)
- # NAG Fortran compiler
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- ;;
- tcc*)
- # Fabrice Bellard et al's Tiny C Compiler
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
- ;;
- pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
- # Portland Group compilers (*not* the Pentium gcc compiler,
- # which looks to be a dead project)
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- ;;
- ccc*)
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- # All Alpha code is PIC.
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
- ;;
- xl* | bgxl* | bgf* | mpixl*)
- # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
- ;;
- *)
- case `$CC -V 2>&1 | sed 5q` in
- *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*)
- # Sun Fortran 8.3 passes all unrecognized flags to the linker
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- _LT_TAGVAR(lt_prog_compiler_wl, $1)=''
- ;;
- *Sun\ F* | *Sun*Fortran*)
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
- ;;
- *Sun\ C*)
- # Sun C 5.9
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- ;;
- *Intel*\ [[CF]]*Compiler*)
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
- ;;
- *Portland\ Group*)
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- ;;
- esac
- ;;
- esac
- ;;
-
- newsos6)
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- ;;
-
- *nto* | *qnx*)
- # QNX uses GNU C++, but need to define -shared option too, otherwise
- # it will coredump.
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
- ;;
-
- osf3* | osf4* | osf5*)
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- # All OSF/1 code is PIC.
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
- ;;
-
- rdos*)
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
- ;;
-
- solaris*)
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- case $cc_basename in
- f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
- *)
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
- esac
- ;;
-
- sunos4*)
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- ;;
-
- sysv4 | sysv4.2uw2* | sysv4.3*)
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- ;;
-
- sysv4*MP*)
- if test -d /usr/nec; then
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- fi
- ;;
-
- sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- ;;
-
- unicos*)
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
- ;;
-
- uts4*)
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- ;;
-
- *)
- _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
- ;;
- esac
- fi
-])
-case $host_os in
- # For platforms that do not support PIC, -DPIC is meaningless:
- *djgpp*)
- _LT_TAGVAR(lt_prog_compiler_pic, $1)=
- ;;
- *)
- _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])"
- ;;
-esac
-
-AC_CACHE_CHECK([for $compiler option to produce PIC],
- [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)],
- [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)])
-_LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)
-
-#
-# Check to make sure the PIC flag actually works.
-#
-if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
- _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works],
- [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)],
- [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [],
- [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in
- "" | " "*) ;;
- *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;;
- esac],
- [_LT_TAGVAR(lt_prog_compiler_pic, $1)=
- _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
-fi
-_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1],
- [Additional compiler flags for building library objects])
-
-_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
- [How to pass a linker flag through the compiler])
-#
-# Check to make sure the static flag actually works.
-#
-wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\"
-_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
- _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1),
- $lt_tmp_static_flag,
- [],
- [_LT_TAGVAR(lt_prog_compiler_static, $1)=])
-_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1],
- [Compiler flag to prevent dynamic linking])
-])# _LT_COMPILER_PIC
-
-
-# _LT_LINKER_SHLIBS([TAGNAME])
-# ----------------------------
-# See if the linker supports building shared libraries.
-m4_defun([_LT_LINKER_SHLIBS],
-[AC_REQUIRE([LT_PATH_LD])dnl
-AC_REQUIRE([LT_PATH_NM])dnl
-m4_require([_LT_PATH_MANIFEST_TOOL])dnl
-m4_require([_LT_FILEUTILS_DEFAULTS])dnl
-m4_require([_LT_DECL_EGREP])dnl
-m4_require([_LT_DECL_SED])dnl
-m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
-m4_require([_LT_TAG_COMPILER])dnl
-AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
-m4_if([$1], [CXX], [
- _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
- _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
- case $host_os in
- aix[[4-9]]*)
- # If we're using GNU nm, then we don't want the "-C" option.
- # -C means demangle to AIX nm, but means don't demangle with GNU nm
- # Also, AIX nm treats weak defined symbols like other global defined
- # symbols, whereas GNU nm marks them as "W".
- if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
- _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
- else
- _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
- fi
- ;;
- pw32*)
- _LT_TAGVAR(export_symbols_cmds, $1)=$ltdll_cmds
- ;;
- cygwin* | mingw* | cegcc*)
- case $cc_basename in
- cl*)
- _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
- ;;
- *)
- _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
- _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
- ;;
- esac
- ;;
- *)
- _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
- ;;
- esac
-], [
- runpath_var=
- _LT_TAGVAR(allow_undefined_flag, $1)=
- _LT_TAGVAR(always_export_symbols, $1)=no
- _LT_TAGVAR(archive_cmds, $1)=
- _LT_TAGVAR(archive_expsym_cmds, $1)=
- _LT_TAGVAR(compiler_needs_object, $1)=no
- _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
- _LT_TAGVAR(export_dynamic_flag_spec, $1)=
- _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
- _LT_TAGVAR(hardcode_automatic, $1)=no
- _LT_TAGVAR(hardcode_direct, $1)=no
- _LT_TAGVAR(hardcode_direct_absolute, $1)=no
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
- _LT_TAGVAR(hardcode_libdir_separator, $1)=
- _LT_TAGVAR(hardcode_minus_L, $1)=no
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
- _LT_TAGVAR(inherit_rpath, $1)=no
- _LT_TAGVAR(link_all_deplibs, $1)=unknown
- _LT_TAGVAR(module_cmds, $1)=
- _LT_TAGVAR(module_expsym_cmds, $1)=
- _LT_TAGVAR(old_archive_from_new_cmds, $1)=
- _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)=
- _LT_TAGVAR(thread_safe_flag_spec, $1)=
- _LT_TAGVAR(whole_archive_flag_spec, $1)=
- # include_expsyms should be a list of space-separated symbols to be *always*
- # included in the symbol list
- _LT_TAGVAR(include_expsyms, $1)=
- # exclude_expsyms can be an extended regexp of symbols to exclude
- # it will be wrapped by ' (' and ')$', so one must not match beginning or
- # end of line. Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc',
- # as well as any symbol that contains 'd'.
- _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
- # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
- # platforms (ab)use it in PIC code, but their linkers get confused if
- # the symbol is explicitly referenced. Since portable code cannot
- # rely on this symbol name, it's probably fine to never include it in
- # preloaded symbol tables.
- # Exclude shared library initialization/finalization symbols.
-dnl Note also adjust exclude_expsyms for C++ above.
- extract_expsyms_cmds=
-
- case $host_os in
- cygwin* | mingw* | pw32* | cegcc*)
- # FIXME: the MSVC++ port hasn't been tested in a loooong time
- # When not using gcc, we currently assume that we are using
- # Microsoft Visual C++.
- if test yes != "$GCC"; then
- with_gnu_ld=no
- fi
- ;;
- interix*)
- # we just hope/assume this is gcc and not c89 (= MSVC++)
- with_gnu_ld=yes
- ;;
- openbsd* | bitrig*)
- with_gnu_ld=no
- ;;
- esac
-
- _LT_TAGVAR(ld_shlibs, $1)=yes
-
- # On some targets, GNU ld is compatible enough with the native linker
- # that we're better off using the native interface for both.
- lt_use_gnu_ld_interface=no
- if test yes = "$with_gnu_ld"; then
- case $host_os in
- aix*)
- # The AIX port of GNU ld has always aspired to compatibility
- # with the native linker. However, as the warning in the GNU ld
- # block says, versions before 2.19.5* couldn't really create working
- # shared libraries, regardless of the interface used.
- case `$LD -v 2>&1` in
- *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
- *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;;
- *\ \(GNU\ Binutils\)\ [[3-9]]*) ;;
- *)
- lt_use_gnu_ld_interface=yes
- ;;
- esac
- ;;
- *)
- lt_use_gnu_ld_interface=yes
- ;;
- esac
- fi
-
- if test yes = "$lt_use_gnu_ld_interface"; then
- # If archive_cmds runs LD, not CC, wlarc should be empty
- wlarc='$wl'
-
- # Set some defaults for GNU ld with shared library support. These
- # are reset later if shared libraries are not supported. Putting them
- # here allows them to be overridden if necessary.
- runpath_var=LD_RUN_PATH
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
- # ancient GNU ld didn't support --whole-archive et. al.
- if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
- _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
- else
- _LT_TAGVAR(whole_archive_flag_spec, $1)=
- fi
- supports_anon_versioning=no
- case `$LD -v | $SED -e 's/([^)]\+)\s\+//' 2>&1` in
- *GNU\ gold*) supports_anon_versioning=yes ;;
- *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
- *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
- *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
- *\ 2.11.*) ;; # other 2.11 versions
- *) supports_anon_versioning=yes ;;
- esac
-
- # See if GNU ld supports shared libraries.
- case $host_os in
- aix[[3-9]]*)
- # On AIX/PPC, the GNU linker is very broken
- if test ia64 != "$host_cpu"; then
- _LT_TAGVAR(ld_shlibs, $1)=no
- cat <<_LT_EOF 1>&2
-
-*** Warning: the GNU linker, at least up to release 2.19, is reported
-*** to be unable to reliably create shared libraries on AIX.
-*** Therefore, libtool is disabling shared libraries support. If you
-*** really care for shared libraries, you may want to install binutils
-*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
-*** You will then need to restart the configuration process.
-
-_LT_EOF
- fi
- ;;
-
- amigaos*)
- case $host_cpu in
- powerpc)
- # see comment about AmigaOS4 .so support
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)=''
- ;;
- m68k)
- _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
- _LT_TAGVAR(hardcode_minus_L, $1)=yes
- ;;
- esac
- ;;
-
- beos*)
- if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
- _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
- # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
- # support --undefined. This deserves some investigation. FIXME
- _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
- else
- _LT_TAGVAR(ld_shlibs, $1)=no
- fi
- ;;
-
- cygwin* | mingw* | pw32* | cegcc*)
- # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
- # as there is no search path for DLLs.
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols'
- _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
- _LT_TAGVAR(always_export_symbols, $1)=no
- _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
- _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
- _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
-
- if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
- # If the export-symbols file already is a .def file, use it as
- # is; otherwise, prepend EXPORTS...
- _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
- cp $export_symbols $output_objdir/$soname.def;
- else
- echo EXPORTS > $output_objdir/$soname.def;
- cat $export_symbols >> $output_objdir/$soname.def;
- fi~
- $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
- else
- _LT_TAGVAR(ld_shlibs, $1)=no
- fi
- ;;
-
- haiku*)
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
- _LT_TAGVAR(link_all_deplibs, $1)=yes
- ;;
-
- interix[[3-9]]*)
- _LT_TAGVAR(hardcode_direct, $1)=no
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
- # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
- # Instead, shared libraries are loaded at an image base (0x10000000 by
- # default) and relocated if they conflict, which is a slow very memory
- # consuming and fragmenting process. To avoid this, we pick a random,
- # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
- # time. Moving up from 0x10000000 also allows more sbrk(2) space.
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
- ;;
-
- gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
- tmp_diet=no
- if test linux-dietlibc = "$host_os"; then
- case $cc_basename in
- diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn)
- esac
- fi
- if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
- && test no = "$tmp_diet"
- then
- tmp_addflag=' $pic_flag'
- tmp_sharedflag='-shared'
- case $cc_basename,$host_cpu in
- pgcc*) # Portland Group C compiler
- _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
- tmp_addflag=' $pic_flag'
- ;;
- pgf77* | pgf90* | pgf95* | pgfortran*)
- # Portland Group f77 and f90 compilers
- _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
- tmp_addflag=' $pic_flag -Mnomain' ;;
- ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64
- tmp_addflag=' -i_dynamic' ;;
- efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64
- tmp_addflag=' -i_dynamic -nofor_main' ;;
- ifc* | ifort*) # Intel Fortran compiler
- tmp_addflag=' -nofor_main' ;;
- lf95*) # Lahey Fortran 8.1
- _LT_TAGVAR(whole_archive_flag_spec, $1)=
- tmp_sharedflag='--shared' ;;
- nagfor*) # NAGFOR 5.3
- tmp_sharedflag='-Wl,-shared' ;;
- xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below)
- tmp_sharedflag='-qmkshrobj'
- tmp_addflag= ;;
- nvcc*) # Cuda Compiler Driver 2.2
- _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
- _LT_TAGVAR(compiler_needs_object, $1)=yes
- ;;
- esac
- case `$CC -V 2>&1 | sed 5q` in
- *Sun\ C*) # Sun C 5.9
- _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
- _LT_TAGVAR(compiler_needs_object, $1)=yes
- tmp_sharedflag='-G' ;;
- *Sun\ F*) # Sun Fortran 8.3
- tmp_sharedflag='-G' ;;
- esac
- _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
-
- if test yes = "$supports_anon_versioning"; then
- _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
- cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
- echo "local: *; };" >> $output_objdir/$libname.ver~
- $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib'
- fi
-
- case $cc_basename in
- xlf* | bgf* | bgxlf* | mpixlf*)
- # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
- _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
- _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
- if test yes = "$supports_anon_versioning"; then
- _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
- cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
- echo "local: *; };" >> $output_objdir/$libname.ver~
- $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
- fi
- ;;
- esac
- else
- _LT_TAGVAR(ld_shlibs, $1)=no
- fi
- ;;
-
- netbsd*)
- if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
- _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
- wlarc=
- else
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
- fi
- ;;
-
- solaris*)
- if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
- _LT_TAGVAR(ld_shlibs, $1)=no
- cat <<_LT_EOF 1>&2
-
-*** Warning: The releases 2.8.* of the GNU linker cannot reliably
-*** create shared libraries on Solaris systems. Therefore, libtool
-*** is disabling shared libraries support. We urge you to upgrade GNU
-*** binutils to release 2.9.1 or newer. Another option is to modify
-*** your PATH or compiler configuration so that the native linker is
-*** used, and then restart.
-
-_LT_EOF
- elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
- else
- _LT_TAGVAR(ld_shlibs, $1)=no
- fi
- ;;
-
- sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
- case `$LD -v 2>&1` in
- *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
- _LT_TAGVAR(ld_shlibs, $1)=no
- cat <<_LT_EOF 1>&2
-
-*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot
-*** reliably create shared libraries on SCO systems. Therefore, libtool
-*** is disabling shared libraries support. We urge you to upgrade GNU
-*** binutils to release 2.16.91.0.3 or newer. Another option is to modify
-*** your PATH or compiler configuration so that the native linker is
-*** used, and then restart.
-
-_LT_EOF
- ;;
- *)
- # For security reasons, it is highly recommended that you always
- # use absolute paths for naming shared libraries, and exclude the
- # DT_RUNPATH tag from executables and libraries. But doing so
- # requires that you compile everything twice, which is a pain.
- if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
- else
- _LT_TAGVAR(ld_shlibs, $1)=no
- fi
- ;;
- esac
- ;;
-
- sunos4*)
- _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
- wlarc=
- _LT_TAGVAR(hardcode_direct, $1)=yes
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- ;;
-
- *)
- if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
- else
- _LT_TAGVAR(ld_shlibs, $1)=no
- fi
- ;;
- esac
-
- if test no = "$_LT_TAGVAR(ld_shlibs, $1)"; then
- runpath_var=
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
- _LT_TAGVAR(export_dynamic_flag_spec, $1)=
- _LT_TAGVAR(whole_archive_flag_spec, $1)=
- fi
- else
- # PORTME fill in a description of your system's linker (not GNU ld)
- case $host_os in
- aix3*)
- _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
- _LT_TAGVAR(always_export_symbols, $1)=yes
- _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
- # Note: this linker hardcodes the directories in LIBPATH if there
- # are no directories specified by -L.
- _LT_TAGVAR(hardcode_minus_L, $1)=yes
- if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then
- # Neither direct hardcoding nor static linking is supported with a
- # broken collect2.
- _LT_TAGVAR(hardcode_direct, $1)=unsupported
- fi
- ;;
-
- aix[[4-9]]*)
- if test ia64 = "$host_cpu"; then
- # On IA64, the linker does run time linking by default, so we don't
- # have to do anything special.
- aix_use_runtimelinking=no
- exp_sym_flag='-Bexport'
- no_entry_flag=
- else
- # If we're using GNU nm, then we don't want the "-C" option.
- # -C means demangle to AIX nm, but means don't demangle with GNU nm
- # Also, AIX nm treats weak defined symbols like other global
- # defined symbols, whereas GNU nm marks them as "W".
- if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
- _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
- else
- _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
- fi
- aix_use_runtimelinking=no
-
- # Test if we are trying to use run time linking or normal
- # AIX style linking. If -brtl is somewhere in LDFLAGS, we
- # need to do runtime linking.
- case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
- for ld_flag in $LDFLAGS; do
- if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then
- aix_use_runtimelinking=yes
- break
- fi
- done
- ;;
- esac
-
- exp_sym_flag='-bexport'
- no_entry_flag='-bnoentry'
- fi
-
- # When large executables or shared objects are built, AIX ld can
- # have problems creating the table of contents. If linking a library
- # or program results in "error TOC overflow" add -mminimal-toc to
- # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
- # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
-
- _LT_TAGVAR(archive_cmds, $1)=''
- _LT_TAGVAR(hardcode_direct, $1)=yes
- _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
- _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
- _LT_TAGVAR(link_all_deplibs, $1)=yes
- _LT_TAGVAR(file_list_spec, $1)='$wl-f,'
-
- if test yes = "$GCC"; then
- case $host_os in aix4.[[012]]|aix4.[[012]].*)
- # We only want to do this on AIX 4.2 and lower, the check
- # below for broken collect2 doesn't work under 4.3+
- collect2name=`$CC -print-prog-name=collect2`
- if test -f "$collect2name" &&
- strings "$collect2name" | $GREP resolve_lib_name >/dev/null
- then
- # We have reworked collect2
- :
- else
- # We have old collect2
- _LT_TAGVAR(hardcode_direct, $1)=unsupported
- # It fails to find uninstalled libraries when the uninstalled
- # path is not listed in the libpath. Setting hardcode_minus_L
- # to unsupported forces relinking
- _LT_TAGVAR(hardcode_minus_L, $1)=yes
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
- _LT_TAGVAR(hardcode_libdir_separator, $1)=
- fi
- ;;
- esac
- shared_flag='-shared'
- if test yes = "$aix_use_runtimelinking"; then
- shared_flag="$shared_flag "'$wl-G'
- fi
- else
- # not using gcc
- if test ia64 = "$host_cpu"; then
- # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
- # chokes on -Wl,-G. The following line is correct:
- shared_flag='-G'
- else
- if test yes = "$aix_use_runtimelinking"; then
- shared_flag='$wl-G'
- else
- shared_flag='$wl-bM:SRE'
- fi
- fi
- fi
-
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall'
- # It seems that -bexpall does not export symbols beginning with
- # underscore (_), so it is better to generate a list of symbols to export.
- _LT_TAGVAR(always_export_symbols, $1)=yes
- if test yes = "$aix_use_runtimelinking"; then
- # Warning - without using the other runtime loading flags (-brtl),
- # -berok will link without error, but may produce a broken library.
- _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
- # Determine the default libpath from the value encoded in an
- # empty executable.
- _LT_SYS_MODULE_PATH_AIX([$1])
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag
- else
- if test ia64 = "$host_cpu"; then
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib'
- _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
- _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols"
- else
- # Determine the default libpath from the value encoded in an
- # empty executable.
- _LT_SYS_MODULE_PATH_AIX([$1])
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
- # Warning - without using the other run time loading flags,
- # -berok will link without error, but may produce a broken library.
- _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok'
- _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok'
- if test yes = "$with_gnu_ld"; then
- # We only use this code for GNU lds that support --whole-archive.
- _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive'
- else
- # Exported symbols can be pulled into shared objects from archives
- _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
- fi
- _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
- # This is similar to how AIX traditionally builds its shared libraries.
- _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $wl-bnoentry $compiler_flags $wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
- fi
- fi
- ;;
-
- amigaos*)
- case $host_cpu in
- powerpc)
- # see comment about AmigaOS4 .so support
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)=''
- ;;
- m68k)
- _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
- _LT_TAGVAR(hardcode_minus_L, $1)=yes
- ;;
- esac
- ;;
-
- bsdi[[45]]*)
- _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
- ;;
-
- cygwin* | mingw* | pw32* | cegcc*)
- # When not using gcc, we currently assume that we are using
- # Microsoft Visual C++.
- # hardcode_libdir_flag_spec is actually meaningless, as there is
- # no search path for DLLs.
- case $cc_basename in
- cl*)
- # Native MSVC
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
- _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
- _LT_TAGVAR(always_export_symbols, $1)=yes
- _LT_TAGVAR(file_list_spec, $1)='@'
- # Tell ltmain to make .lib files, not .a files.
- libext=lib
- # Tell ltmain to make .dll files, not .so files.
- shrext_cmds=.dll
- # FIXME: Setting linknames here is a bad hack.
- _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames='
- _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
- cp "$export_symbols" "$output_objdir/$soname.def";
- echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp";
- else
- $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp;
- fi~
- $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
- linknames='
- # The linker will not automatically build a static lib if we build a DLL.
- # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
- _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
- _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
- _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols'
- # Don't use ranlib
- _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
- _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
- lt_tool_outputfile="@TOOL_OUTPUT@"~
- case $lt_outputfile in
- *.exe|*.EXE) ;;
- *)
- lt_outputfile=$lt_outputfile.exe
- lt_tool_outputfile=$lt_tool_outputfile.exe
- ;;
- esac~
- if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then
- $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
- $RM "$lt_outputfile.manifest";
- fi'
- ;;
- *)
- # Assume MSVC wrapper
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
- _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
- # Tell ltmain to make .lib files, not .a files.
- libext=lib
- # Tell ltmain to make .dll files, not .so files.
- shrext_cmds=.dll
- # FIXME: Setting linknames here is a bad hack.
- _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
- # The linker will automatically build a .lib file if we build a DLL.
- _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
- # FIXME: Should let the user specify the lib program.
- _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
- _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
- ;;
- esac
- ;;
-
- darwin* | rhapsody*)
- _LT_DARWIN_LINKER_FEATURES($1)
- ;;
-
- dgux*)
- _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- ;;
-
- # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
- # support. Future versions do this automatically, but an explicit c++rt0.o
- # does not break anything, and helps significantly (at the cost of a little
- # extra space).
- freebsd2.2*)
- _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
- _LT_TAGVAR(hardcode_direct, $1)=yes
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- ;;
-
- # Unfortunately, older versions of FreeBSD 2 do not have this feature.
- freebsd2.*)
- _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
- _LT_TAGVAR(hardcode_direct, $1)=yes
- _LT_TAGVAR(hardcode_minus_L, $1)=yes
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- ;;
-
- # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
- freebsd* | dragonfly*)
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
- _LT_TAGVAR(hardcode_direct, $1)=yes
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- ;;
-
- hpux9*)
- if test yes = "$GCC"; then
- _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
- else
- _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
- fi
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
- _LT_TAGVAR(hardcode_libdir_separator, $1)=:
- _LT_TAGVAR(hardcode_direct, $1)=yes
-
- # hardcode_minus_L: Not really in the search PATH,
- # but as the default location of the library.
- _LT_TAGVAR(hardcode_minus_L, $1)=yes
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
- ;;
-
- hpux10*)
- if test yes,no = "$GCC,$with_gnu_ld"; then
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
- else
- _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
- fi
- if test no = "$with_gnu_ld"; then
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
- _LT_TAGVAR(hardcode_libdir_separator, $1)=:
- _LT_TAGVAR(hardcode_direct, $1)=yes
- _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
- # hardcode_minus_L: Not really in the search PATH,
- # but as the default location of the library.
- _LT_TAGVAR(hardcode_minus_L, $1)=yes
- fi
- ;;
-
- hpux11*)
- if test yes,no = "$GCC,$with_gnu_ld"; then
- case $host_cpu in
- hppa*64*)
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- ia64*)
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- *)
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- esac
- else
- case $host_cpu in
- hppa*64*)
- _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- ia64*)
- _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- *)
- m4_if($1, [], [
- # Older versions of the 11.00 compiler do not understand -b yet
- # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
- _LT_LINKER_OPTION([if $CC understands -b],
- _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b],
- [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'],
- [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])],
- [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'])
- ;;
- esac
- fi
- if test no = "$with_gnu_ld"; then
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
- _LT_TAGVAR(hardcode_libdir_separator, $1)=:
-
- case $host_cpu in
- hppa*64*|ia64*)
- _LT_TAGVAR(hardcode_direct, $1)=no
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- ;;
- *)
- _LT_TAGVAR(hardcode_direct, $1)=yes
- _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
-
- # hardcode_minus_L: Not really in the search PATH,
- # but as the default location of the library.
- _LT_TAGVAR(hardcode_minus_L, $1)=yes
- ;;
- esac
- fi
- ;;
-
- irix5* | irix6* | nonstopux*)
- if test yes = "$GCC"; then
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
- # Try to use the -exported_symbol ld option, if it does not
- # work, assume that -exports_file does not work either and
- # implicitly export all symbols.
- # This should be the same for all languages, so no per-tag cache variable.
- AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol],
- [lt_cv_irix_exported_symbol],
- [save_LDFLAGS=$LDFLAGS
- LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null"
- AC_LINK_IFELSE(
- [AC_LANG_SOURCE(
- [AC_LANG_CASE([C], [[int foo (void) { return 0; }]],
- [C++], [[int foo (void) { return 0; }]],
- [Fortran 77], [[
- subroutine foo
- end]],
- [Fortran], [[
- subroutine foo
- end]])])],
- [lt_cv_irix_exported_symbol=yes],
- [lt_cv_irix_exported_symbol=no])
- LDFLAGS=$save_LDFLAGS])
- if test yes = "$lt_cv_irix_exported_symbol"; then
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib'
- fi
- else
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib'
- fi
- _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
- _LT_TAGVAR(hardcode_libdir_separator, $1)=:
- _LT_TAGVAR(inherit_rpath, $1)=yes
- _LT_TAGVAR(link_all_deplibs, $1)=yes
- ;;
-
- netbsd*)
- if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
- _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
- else
- _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF
- fi
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
- _LT_TAGVAR(hardcode_direct, $1)=yes
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- ;;
-
- newsos6)
- _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- _LT_TAGVAR(hardcode_direct, $1)=yes
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
- _LT_TAGVAR(hardcode_libdir_separator, $1)=:
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- ;;
-
- *nto* | *qnx*)
- ;;
-
- openbsd* | bitrig*)
- if test -f /usr/libexec/ld.so; then
- _LT_TAGVAR(hardcode_direct, $1)=yes
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
- if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols'
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
- else
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
- fi
- else
- _LT_TAGVAR(ld_shlibs, $1)=no
- fi
- ;;
-
- os2*)
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
- _LT_TAGVAR(hardcode_minus_L, $1)=yes
- _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
- _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
- _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
- ;;
-
- osf3*)
- if test yes = "$GCC"; then
- _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
- else
- _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
- fi
- _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
- _LT_TAGVAR(hardcode_libdir_separator, $1)=:
- ;;
-
- osf4* | osf5*) # as osf3* with the addition of -msym flag
- if test yes = "$GCC"; then
- _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
- else
- _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~
- $CC -shared$allow_undefined_flag $wl-input $wl$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~$RM $lib.exp'
-
- # Both c and cxx compiler support -rpath directly
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
- fi
- _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
- _LT_TAGVAR(hardcode_libdir_separator, $1)=:
- ;;
-
- solaris*)
- _LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
- if test yes = "$GCC"; then
- wlarc='$wl'
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
- _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
- $CC -shared $pic_flag $wl-z ${wl}text $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
- else
- case `$CC -V 2>&1` in
- *"Compilers 5.0"*)
- wlarc=''
- _LT_TAGVAR(archive_cmds, $1)='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags'
- _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
- $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
- ;;
- *)
- wlarc='$wl'
- _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags'
- _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
- $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
- ;;
- esac
- fi
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- case $host_os in
- solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
- *)
- # The compiler driver will combine and reorder linker options,
- # but understands '-z linker_flag'. GCC discards it without '$wl',
- # but is careful enough not to reorder.
- # Supported since Solaris 2.6 (maybe 2.5.1?)
- if test yes = "$GCC"; then
- _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract'
- else
- _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
- fi
- ;;
- esac
- _LT_TAGVAR(link_all_deplibs, $1)=yes
- ;;
-
- sunos4*)
- if test sequent = "$host_vendor"; then
- # Use $CC to link under sequent, because it throws in some extra .o
- # files that make .init and .fini sections work.
- _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags'
- else
- _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
- fi
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
- _LT_TAGVAR(hardcode_direct, $1)=yes
- _LT_TAGVAR(hardcode_minus_L, $1)=yes
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- ;;
-
- sysv4)
- case $host_vendor in
- sni)
- _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true???
- ;;
- siemens)
- ## LD is ld it makes a PLAMLIB
- ## CC just makes a GrossModule.
- _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
- _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
- _LT_TAGVAR(hardcode_direct, $1)=no
- ;;
- motorola)
- _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
- ;;
- esac
- runpath_var='LD_RUN_PATH'
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- ;;
-
- sysv4.3*)
- _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
- ;;
-
- sysv4*MP*)
- if test -d /usr/nec; then
- _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- runpath_var=LD_RUN_PATH
- hardcode_runpath_var=yes
- _LT_TAGVAR(ld_shlibs, $1)=yes
- fi
- ;;
-
- sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
- _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
- _LT_TAGVAR(archive_cmds_need_lc, $1)=no
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- runpath_var='LD_RUN_PATH'
-
- if test yes = "$GCC"; then
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- else
- _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- fi
- ;;
-
- sysv5* | sco3.2v5* | sco5v6*)
- # Note: We CANNOT use -z defs as we might desire, because we do not
- # link with -lc, and that would cause any symbols used from libc to
- # always be unresolved, which means just about no library would
- # ever link correctly. If we're not using GNU ld we use -z text
- # though, which does catch some bad symbols but isn't as heavy-handed
- # as -z defs.
- _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
- _LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs'
- _LT_TAGVAR(archive_cmds_need_lc, $1)=no
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir'
- _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
- _LT_TAGVAR(link_all_deplibs, $1)=yes
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport'
- runpath_var='LD_RUN_PATH'
-
- if test yes = "$GCC"; then
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- else
- _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- fi
- ;;
-
- uts4*)
- _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- ;;
-
- *)
- _LT_TAGVAR(ld_shlibs, $1)=no
- ;;
- esac
-
- if test sni = "$host_vendor"; then
- case $host in
- sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Blargedynsym'
- ;;
- esac
- fi
- fi
-])
-AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
-test no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no
-
-_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld
-
-_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl
-_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl
-_LT_DECL([], [extract_expsyms_cmds], [2],
- [The commands to extract the exported symbol list from a shared archive])
-
-#
-# Do we need to explicitly link libc?
-#
-case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in
-x|xyes)
- # Assume -lc should be added
- _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
-
- if test yes,yes = "$GCC,$enable_shared"; then
- case $_LT_TAGVAR(archive_cmds, $1) in
- *'~'*)
- # FIXME: we may have to deal with multi-command sequences.
- ;;
- '$CC '*)
- # Test whether the compiler implicitly links with -lc since on some
- # systems, -lgcc has to come before -lc. If gcc already passes -lc
- # to ld, don't add -lc before -lgcc.
- AC_CACHE_CHECK([whether -lc should be explicitly linked in],
- [lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1),
- [$RM conftest*
- echo "$lt_simple_compile_test_code" > conftest.$ac_ext
-
- if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
- soname=conftest
- lib=conftest
- libobjs=conftest.$ac_objext
- deplibs=
- wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1)
- pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1)
- compiler_flags=-v
- linker_flags=-v
- verstring=
- output_objdir=.
- libname=conftest
- lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1)
- _LT_TAGVAR(allow_undefined_flag, $1)=
- if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1)
- then
- lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no
- else
- lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes
- fi
- _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
- else
- cat conftest.err 1>&5
- fi
- $RM conftest*
- ])
- _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)
- ;;
- esac
- fi
- ;;
-esac
-
-_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0],
- [Whether or not to add -lc for building shared libraries])
-_LT_TAGDECL([allow_libtool_libs_with_static_runtimes],
- [enable_shared_with_static_runtimes], [0],
- [Whether or not to disallow shared libs when runtime libs are static])
-_LT_TAGDECL([], [export_dynamic_flag_spec], [1],
- [Compiler flag to allow reflexive dlopens])
-_LT_TAGDECL([], [whole_archive_flag_spec], [1],
- [Compiler flag to generate shared objects directly from archives])
-_LT_TAGDECL([], [compiler_needs_object], [1],
- [Whether the compiler copes with passing no objects directly])
-_LT_TAGDECL([], [old_archive_from_new_cmds], [2],
- [Create an old-style archive from a shared archive])
-_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2],
- [Create a temporary old-style archive to link instead of a shared archive])
-_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive])
-_LT_TAGDECL([], [archive_expsym_cmds], [2])
-_LT_TAGDECL([], [module_cmds], [2],
- [Commands used to build a loadable module if different from building
- a shared archive.])
-_LT_TAGDECL([], [module_expsym_cmds], [2])
-_LT_TAGDECL([], [with_gnu_ld], [1],
- [Whether we are building with GNU ld or not])
-_LT_TAGDECL([], [allow_undefined_flag], [1],
- [Flag that allows shared libraries with undefined symbols to be built])
-_LT_TAGDECL([], [no_undefined_flag], [1],
- [Flag that enforces no undefined symbols])
-_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1],
- [Flag to hardcode $libdir into a binary during linking.
- This must work even if $libdir does not exist])
-_LT_TAGDECL([], [hardcode_libdir_separator], [1],
- [Whether we need a single "-rpath" flag with a separated argument])
-_LT_TAGDECL([], [hardcode_direct], [0],
- [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes
- DIR into the resulting binary])
-_LT_TAGDECL([], [hardcode_direct_absolute], [0],
- [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes
- DIR into the resulting binary and the resulting library dependency is
- "absolute", i.e impossible to change by setting $shlibpath_var if the
- library is relocated])
-_LT_TAGDECL([], [hardcode_minus_L], [0],
- [Set to "yes" if using the -LDIR flag during linking hardcodes DIR
- into the resulting binary])
-_LT_TAGDECL([], [hardcode_shlibpath_var], [0],
- [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
- into the resulting binary])
-_LT_TAGDECL([], [hardcode_automatic], [0],
- [Set to "yes" if building a shared library automatically hardcodes DIR
- into the library and all subsequent libraries and executables linked
- against it])
-_LT_TAGDECL([], [inherit_rpath], [0],
- [Set to yes if linker adds runtime paths of dependent libraries
- to runtime path list])
-_LT_TAGDECL([], [link_all_deplibs], [0],
- [Whether libtool must link a program against all its dependency libraries])
-_LT_TAGDECL([], [always_export_symbols], [0],
- [Set to "yes" if exported symbols are required])
-_LT_TAGDECL([], [export_symbols_cmds], [2],
- [The commands to list exported symbols])
-_LT_TAGDECL([], [exclude_expsyms], [1],
- [Symbols that should not be listed in the preloaded symbols])
-_LT_TAGDECL([], [include_expsyms], [1],
- [Symbols that must always be exported])
-_LT_TAGDECL([], [prelink_cmds], [2],
- [Commands necessary for linking programs (against libraries) with templates])
-_LT_TAGDECL([], [postlink_cmds], [2],
- [Commands necessary for finishing linking programs])
-_LT_TAGDECL([], [file_list_spec], [1],
- [Specify filename containing input files])
-dnl FIXME: Not yet implemented
-dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1],
-dnl [Compiler flag to generate thread safe objects])
-])# _LT_LINKER_SHLIBS
-
-
-# _LT_LANG_C_CONFIG([TAG])
-# ------------------------
-# Ensure that the configuration variables for a C compiler are suitably
-# defined. These variables are subsequently used by _LT_CONFIG to write
-# the compiler configuration to 'libtool'.
-m4_defun([_LT_LANG_C_CONFIG],
-[m4_require([_LT_DECL_EGREP])dnl
-lt_save_CC=$CC
-AC_LANG_PUSH(C)
-
-# Source file extension for C test sources.
-ac_ext=c
-
-# Object file extension for compiled C test sources.
-objext=o
-_LT_TAGVAR(objext, $1)=$objext
-
-# Code to be used in simple compile tests
-lt_simple_compile_test_code="int some_variable = 0;"
-
-# Code to be used in simple link tests
-lt_simple_link_test_code='int main(){return(0);}'
-
-_LT_TAG_COMPILER
-# Save the default compiler, since it gets overwritten when the other
-# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
-compiler_DEFAULT=$CC
-
-# save warnings/boilerplate of simple test code
-_LT_COMPILER_BOILERPLATE
-_LT_LINKER_BOILERPLATE
-
-## CAVEAT EMPTOR:
-## There is no encapsulation within the following macros, do not change
-## the running order or otherwise move them around unless you know exactly
-## what you are doing...
-if test -n "$compiler"; then
- _LT_COMPILER_NO_RTTI($1)
- _LT_COMPILER_PIC($1)
- _LT_COMPILER_C_O($1)
- _LT_COMPILER_FILE_LOCKS($1)
- _LT_LINKER_SHLIBS($1)
- _LT_SYS_DYNAMIC_LINKER($1)
- _LT_LINKER_HARDCODE_LIBPATH($1)
- LT_SYS_DLOPEN_SELF
- _LT_CMD_STRIPLIB
-
- # Report what library types will actually be built
- AC_MSG_CHECKING([if libtool supports shared libraries])
- AC_MSG_RESULT([$can_build_shared])
-
- AC_MSG_CHECKING([whether to build shared libraries])
- test no = "$can_build_shared" && enable_shared=no
-
- # On AIX, shared libraries and static libraries use the same namespace, and
- # are all built from PIC.
- case $host_os in
- aix3*)
- test yes = "$enable_shared" && enable_static=no
- if test -n "$RANLIB"; then
- archive_cmds="$archive_cmds~\$RANLIB \$lib"
- postinstall_cmds='$RANLIB $lib'
- fi
- ;;
-
- aix[[4-9]]*)
- if test ia64 != "$host_cpu" && test no = "$aix_use_runtimelinking"; then
- test yes = "$enable_shared" && enable_static=no
- fi
- ;;
- esac
- AC_MSG_RESULT([$enable_shared])
-
- AC_MSG_CHECKING([whether to build static libraries])
- # Make sure either enable_shared or enable_static is yes.
- test yes = "$enable_shared" || enable_static=yes
- AC_MSG_RESULT([$enable_static])
-
- _LT_CONFIG($1)
-fi
-AC_LANG_POP
-CC=$lt_save_CC
-])# _LT_LANG_C_CONFIG
-
-
-# _LT_LANG_CXX_CONFIG([TAG])
-# --------------------------
-# Ensure that the configuration variables for a C++ compiler are suitably
-# defined. These variables are subsequently used by _LT_CONFIG to write
-# the compiler configuration to 'libtool'.
-m4_defun([_LT_LANG_CXX_CONFIG],
-[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
-m4_require([_LT_DECL_EGREP])dnl
-m4_require([_LT_PATH_MANIFEST_TOOL])dnl
-if test -n "$CXX" && ( test no != "$CXX" &&
- ( (test g++ = "$CXX" && `g++ -v >/dev/null 2>&1` ) ||
- (test g++ != "$CXX"))); then
- AC_PROG_CXXCPP
-else
- _lt_caught_CXX_error=yes
-fi
-
-AC_LANG_PUSH(C++)
-_LT_TAGVAR(archive_cmds_need_lc, $1)=no
-_LT_TAGVAR(allow_undefined_flag, $1)=
-_LT_TAGVAR(always_export_symbols, $1)=no
-_LT_TAGVAR(archive_expsym_cmds, $1)=
-_LT_TAGVAR(compiler_needs_object, $1)=no
-_LT_TAGVAR(export_dynamic_flag_spec, $1)=
-_LT_TAGVAR(hardcode_direct, $1)=no
-_LT_TAGVAR(hardcode_direct_absolute, $1)=no
-_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
-_LT_TAGVAR(hardcode_libdir_separator, $1)=
-_LT_TAGVAR(hardcode_minus_L, $1)=no
-_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
-_LT_TAGVAR(hardcode_automatic, $1)=no
-_LT_TAGVAR(inherit_rpath, $1)=no
-_LT_TAGVAR(module_cmds, $1)=
-_LT_TAGVAR(module_expsym_cmds, $1)=
-_LT_TAGVAR(link_all_deplibs, $1)=unknown
-_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
-_LT_TAGVAR(reload_flag, $1)=$reload_flag
-_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
-_LT_TAGVAR(no_undefined_flag, $1)=
-_LT_TAGVAR(whole_archive_flag_spec, $1)=
-_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
-
-# Source file extension for C++ test sources.
-ac_ext=cpp
-
-# Object file extension for compiled C++ test sources.
-objext=o
-_LT_TAGVAR(objext, $1)=$objext
-
-# No sense in running all these tests if we already determined that
-# the CXX compiler isn't working. Some variables (like enable_shared)
-# are currently assumed to apply to all compilers on this platform,
-# and will be corrupted by setting them based on a non-working compiler.
-if test yes != "$_lt_caught_CXX_error"; then
- # Code to be used in simple compile tests
- lt_simple_compile_test_code="int some_variable = 0;"
-
- # Code to be used in simple link tests
- lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'
-
- # ltmain only uses $CC for tagged configurations so make sure $CC is set.
- _LT_TAG_COMPILER
-
- # save warnings/boilerplate of simple test code
- _LT_COMPILER_BOILERPLATE
- _LT_LINKER_BOILERPLATE
-
- # Allow CC to be a program name with arguments.
- lt_save_CC=$CC
- lt_save_CFLAGS=$CFLAGS
- lt_save_LD=$LD
- lt_save_GCC=$GCC
- GCC=$GXX
- lt_save_with_gnu_ld=$with_gnu_ld
- lt_save_path_LD=$lt_cv_path_LD
- if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
- lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
- else
- $as_unset lt_cv_prog_gnu_ld
- fi
- if test -n "${lt_cv_path_LDCXX+set}"; then
- lt_cv_path_LD=$lt_cv_path_LDCXX
- else
- $as_unset lt_cv_path_LD
- fi
- test -z "${LDCXX+set}" || LD=$LDCXX
- CC=${CXX-"c++"}
- CFLAGS=$CXXFLAGS
- compiler=$CC
- _LT_TAGVAR(compiler, $1)=$CC
- _LT_CC_BASENAME([$compiler])
-
- if test -n "$compiler"; then
- # We don't want -fno-exception when compiling C++ code, so set the
- # no_builtin_flag separately
- if test yes = "$GXX"; then
- _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
- else
- _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
- fi
-
- if test yes = "$GXX"; then
- # Set up default GNU C++ configuration
-
- LT_PATH_LD
-
- # Check if GNU C++ uses GNU ld as the underlying linker, since the
- # archiving commands below assume that GNU ld is being used.
- if test yes = "$with_gnu_ld"; then
- _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
-
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
-
- # If archive_cmds runs LD, not CC, wlarc should be empty
- # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
- # investigate it a little bit more. (MM)
- wlarc='$wl'
-
- # ancient GNU ld didn't support --whole-archive et. al.
- if eval "`$CC -print-prog-name=ld` --help 2>&1" |
- $GREP 'no-whole-archive' > /dev/null; then
- _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
- else
- _LT_TAGVAR(whole_archive_flag_spec, $1)=
- fi
- else
- with_gnu_ld=no
- wlarc=
-
- # A generic and very simple default shared library creation
- # command for GNU C++ for the case where it uses the native
- # linker, instead of GNU ld. If possible, this setting should
- # overridden to take advantage of the native linker features on
- # the platform it is being used on.
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
- fi
-
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
-
- else
- GXX=no
- with_gnu_ld=no
- wlarc=
- fi
-
- # PORTME: fill in a description of your system's C++ link characteristics
- AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
- _LT_TAGVAR(ld_shlibs, $1)=yes
- case $host_os in
- aix3*)
- # FIXME: insert proper C++ library support
- _LT_TAGVAR(ld_shlibs, $1)=no
- ;;
- aix[[4-9]]*)
- if test ia64 = "$host_cpu"; then
- # On IA64, the linker does run time linking by default, so we don't
- # have to do anything special.
- aix_use_runtimelinking=no
- exp_sym_flag='-Bexport'
- no_entry_flag=
- else
- aix_use_runtimelinking=no
-
- # Test if we are trying to use run time linking or normal
- # AIX style linking. If -brtl is somewhere in LDFLAGS, we
- # need to do runtime linking.
- case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
- for ld_flag in $LDFLAGS; do
- case $ld_flag in
- *-brtl*)
- aix_use_runtimelinking=yes
- break
- ;;
- esac
- done
- ;;
- esac
-
- exp_sym_flag='-bexport'
- no_entry_flag='-bnoentry'
- fi
-
- # When large executables or shared objects are built, AIX ld can
- # have problems creating the table of contents. If linking a library
- # or program results in "error TOC overflow" add -mminimal-toc to
- # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
- # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
-
- _LT_TAGVAR(archive_cmds, $1)=''
- _LT_TAGVAR(hardcode_direct, $1)=yes
- _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
- _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
- _LT_TAGVAR(link_all_deplibs, $1)=yes
- _LT_TAGVAR(file_list_spec, $1)='$wl-f,'
-
- if test yes = "$GXX"; then
- case $host_os in aix4.[[012]]|aix4.[[012]].*)
- # We only want to do this on AIX 4.2 and lower, the check
- # below for broken collect2 doesn't work under 4.3+
- collect2name=`$CC -print-prog-name=collect2`
- if test -f "$collect2name" &&
- strings "$collect2name" | $GREP resolve_lib_name >/dev/null
- then
- # We have reworked collect2
- :
- else
- # We have old collect2
- _LT_TAGVAR(hardcode_direct, $1)=unsupported
- # It fails to find uninstalled libraries when the uninstalled
- # path is not listed in the libpath. Setting hardcode_minus_L
- # to unsupported forces relinking
- _LT_TAGVAR(hardcode_minus_L, $1)=yes
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
- _LT_TAGVAR(hardcode_libdir_separator, $1)=
- fi
- esac
- shared_flag='-shared'
- if test yes = "$aix_use_runtimelinking"; then
- shared_flag=$shared_flag' $wl-G'
- fi
- else
- # not using gcc
- if test ia64 = "$host_cpu"; then
- # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
- # chokes on -Wl,-G. The following line is correct:
- shared_flag='-G'
- else
- if test yes = "$aix_use_runtimelinking"; then
- shared_flag='$wl-G'
- else
- shared_flag='$wl-bM:SRE'
- fi
- fi
- fi
-
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall'
- # It seems that -bexpall does not export symbols beginning with
- # underscore (_), so it is better to generate a list of symbols to
- # export.
- _LT_TAGVAR(always_export_symbols, $1)=yes
- if test yes = "$aix_use_runtimelinking"; then
- # Warning - without using the other runtime loading flags (-brtl),
- # -berok will link without error, but may produce a broken library.
- _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
- # Determine the default libpath from the value encoded in an empty
- # executable.
- _LT_SYS_MODULE_PATH_AIX([$1])
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
-
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag
- else
- if test ia64 = "$host_cpu"; then
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib'
- _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
- _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols"
- else
- # Determine the default libpath from the value encoded in an
- # empty executable.
- _LT_SYS_MODULE_PATH_AIX([$1])
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
- # Warning - without using the other run time loading flags,
- # -berok will link without error, but may produce a broken library.
- _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok'
- _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok'
- if test yes = "$with_gnu_ld"; then
- # We only use this code for GNU lds that support --whole-archive.
- _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive'
- else
- # Exported symbols can be pulled into shared objects from archives
- _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
- fi
- _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
- # This is similar to how AIX traditionally builds its shared
- # libraries.
- _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $wl-bnoentry $compiler_flags $wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
- fi
- fi
- ;;
-
- beos*)
- if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
- _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
- # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
- # support --undefined. This deserves some investigation. FIXME
- _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
- else
- _LT_TAGVAR(ld_shlibs, $1)=no
- fi
- ;;
-
- chorus*)
- case $cc_basename in
- *)
- # FIXME: insert proper C++ library support
- _LT_TAGVAR(ld_shlibs, $1)=no
- ;;
- esac
- ;;
-
- cygwin* | mingw* | pw32* | cegcc*)
- case $GXX,$cc_basename in
- ,cl* | no,cl*)
- # Native MSVC
- # hardcode_libdir_flag_spec is actually meaningless, as there is
- # no search path for DLLs.
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
- _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
- _LT_TAGVAR(always_export_symbols, $1)=yes
- _LT_TAGVAR(file_list_spec, $1)='@'
- # Tell ltmain to make .lib files, not .a files.
- libext=lib
- # Tell ltmain to make .dll files, not .so files.
- shrext_cmds=.dll
- # FIXME: Setting linknames here is a bad hack.
- _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames='
- _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
- cp "$export_symbols" "$output_objdir/$soname.def";
- echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp";
- else
- $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp;
- fi~
- $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
- linknames='
- # The linker will not automatically build a static lib if we build a DLL.
- # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
- _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
- # Don't use ranlib
- _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
- _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
- lt_tool_outputfile="@TOOL_OUTPUT@"~
- case $lt_outputfile in
- *.exe|*.EXE) ;;
- *)
- lt_outputfile=$lt_outputfile.exe
- lt_tool_outputfile=$lt_tool_outputfile.exe
- ;;
- esac~
- func_to_tool_file "$lt_outputfile"~
- if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then
- $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
- $RM "$lt_outputfile.manifest";
- fi'
- ;;
- *)
- # g++
- # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
- # as there is no search path for DLLs.
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols'
- _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
- _LT_TAGVAR(always_export_symbols, $1)=no
- _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
-
- if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
- # If the export-symbols file already is a .def file, use it as
- # is; otherwise, prepend EXPORTS...
- _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
- cp $export_symbols $output_objdir/$soname.def;
- else
- echo EXPORTS > $output_objdir/$soname.def;
- cat $export_symbols >> $output_objdir/$soname.def;
- fi~
- $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
- else
- _LT_TAGVAR(ld_shlibs, $1)=no
- fi
- ;;
- esac
- ;;
- darwin* | rhapsody*)
- _LT_DARWIN_LINKER_FEATURES($1)
- ;;
-
- dgux*)
- case $cc_basename in
- ec++*)
- # FIXME: insert proper C++ library support
- _LT_TAGVAR(ld_shlibs, $1)=no
- ;;
- ghcx*)
- # Green Hills C++ Compiler
- # FIXME: insert proper C++ library support
- _LT_TAGVAR(ld_shlibs, $1)=no
- ;;
- *)
- # FIXME: insert proper C++ library support
- _LT_TAGVAR(ld_shlibs, $1)=no
- ;;
- esac
- ;;
-
- freebsd2.*)
- # C++ shared libraries reported to be fairly broken before
- # switch to ELF
- _LT_TAGVAR(ld_shlibs, $1)=no
- ;;
-
- freebsd-elf*)
- _LT_TAGVAR(archive_cmds_need_lc, $1)=no
- ;;
-
- freebsd* | dragonfly*)
- # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
- # conventions
- _LT_TAGVAR(ld_shlibs, $1)=yes
- ;;
-
- haiku*)
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
- _LT_TAGVAR(link_all_deplibs, $1)=yes
- ;;
-
- hpux9*)
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
- _LT_TAGVAR(hardcode_libdir_separator, $1)=:
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
- _LT_TAGVAR(hardcode_direct, $1)=yes
- _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
- # but as the default
- # location of the library.
-
- case $cc_basename in
- CC*)
- # FIXME: insert proper C++ library support
- _LT_TAGVAR(ld_shlibs, $1)=no
- ;;
- aCC*)
- _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- #
- # There doesn't appear to be a way to prevent this compiler from
- # explicitly linking system object files so we need to strip them
- # from the output so that they don't get included in the library
- # dependencies.
- output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
- ;;
- *)
- if test yes = "$GXX"; then
- _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
- else
- # FIXME: insert proper C++ library support
- _LT_TAGVAR(ld_shlibs, $1)=no
- fi
- ;;
- esac
- ;;
-
- hpux10*|hpux11*)
- if test no = "$with_gnu_ld"; then
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
- _LT_TAGVAR(hardcode_libdir_separator, $1)=:
-
- case $host_cpu in
- hppa*64*|ia64*)
- ;;
- *)
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
- ;;
- esac
- fi
- case $host_cpu in
- hppa*64*|ia64*)
- _LT_TAGVAR(hardcode_direct, $1)=no
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- ;;
- *)
- _LT_TAGVAR(hardcode_direct, $1)=yes
- _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
- _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
- # but as the default
- # location of the library.
- ;;
- esac
-
- case $cc_basename in
- CC*)
- # FIXME: insert proper C++ library support
- _LT_TAGVAR(ld_shlibs, $1)=no
- ;;
- aCC*)
- case $host_cpu in
- hppa*64*)
- _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- ;;
- ia64*)
- _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- ;;
- *)
- _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- ;;
- esac
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- #
- # There doesn't appear to be a way to prevent this compiler from
- # explicitly linking system object files so we need to strip them
- # from the output so that they don't get included in the library
- # dependencies.
- output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
- ;;
- *)
- if test yes = "$GXX"; then
- if test no = "$with_gnu_ld"; then
- case $host_cpu in
- hppa*64*)
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- ;;
- ia64*)
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- ;;
- *)
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- ;;
- esac
- fi
- else
- # FIXME: insert proper C++ library support
- _LT_TAGVAR(ld_shlibs, $1)=no
- fi
- ;;
- esac
- ;;
-
- interix[[3-9]]*)
- _LT_TAGVAR(hardcode_direct, $1)=no
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
- # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
- # Instead, shared libraries are loaded at an image base (0x10000000 by
- # default) and relocated if they conflict, which is a slow very memory
- # consuming and fragmenting process. To avoid this, we pick a random,
- # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
- # time. Moving up from 0x10000000 also allows more sbrk(2) space.
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
- ;;
- irix5* | irix6*)
- case $cc_basename in
- CC*)
- # SGI C++
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
-
- # Archives containing C++ object files must be created using
- # "CC -ar", where "CC" is the IRIX C++ compiler. This is
- # necessary to make sure instantiated templates are included
- # in the archive.
- _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
- ;;
- *)
- if test yes = "$GXX"; then
- if test no = "$with_gnu_ld"; then
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
- else
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` -o $lib'
- fi
- fi
- _LT_TAGVAR(link_all_deplibs, $1)=yes
- ;;
- esac
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
- _LT_TAGVAR(hardcode_libdir_separator, $1)=:
- _LT_TAGVAR(inherit_rpath, $1)=yes
- ;;
-
- linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
- case $cc_basename in
- KCC*)
- # Kuck and Associates, Inc. (KAI) C++ Compiler
-
- # KCC will only create a shared library if the output file
- # ends with ".so" (or ".sl" for HP-UX), so rename the library
- # to its proper name (with version) after linking.
- _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib $wl-retain-symbols-file,$export_symbols; mv \$templib $lib'
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- #
- # There doesn't appear to be a way to prevent this compiler from
- # explicitly linking system object files so we need to strip them
- # from the output so that they don't get included in the library
- # dependencies.
- output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
-
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
-
- # Archives containing C++ object files must be created using
- # "CC -Bstatic", where "CC" is the KAI C++ compiler.
- _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
- ;;
- icpc* | ecpc* )
- # Intel C++
- with_gnu_ld=yes
- # version 8.0 and above of icpc choke on multiply defined symbols
- # if we add $predep_objects and $postdep_objects, however 7.1 and
- # earlier do not add the objects themselves.
- case `$CC -V 2>&1` in
- *"Version 7."*)
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
- ;;
- *) # Version 8.0 or newer
- tmp_idyn=
- case $host_cpu in
- ia64*) tmp_idyn=' -i_dynamic';;
- esac
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
- ;;
- esac
- _LT_TAGVAR(archive_cmds_need_lc, $1)=no
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
- _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive'
- ;;
- pgCC* | pgcpp*)
- # Portland Group C++ compiler
- case `$CC -V` in
- *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*)
- _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~
- rm -rf $tpldir~
- $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
- compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
- _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~
- rm -rf $tpldir~
- $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
- $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
- $RANLIB $oldlib'
- _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
- rm -rf $tpldir~
- $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
- $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~
- rm -rf $tpldir~
- $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
- $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
- ;;
- *) # Version 6 and above use weak symbols
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
- ;;
- esac
-
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl--rpath $wl$libdir'
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
- _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
- ;;
- cxx*)
- # Compaq C++
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib $wl-retain-symbols-file $wl$export_symbols'
-
- runpath_var=LD_RUN_PATH
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
- _LT_TAGVAR(hardcode_libdir_separator, $1)=:
-
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- #
- # There doesn't appear to be a way to prevent this compiler from
- # explicitly linking system object files so we need to strip them
- # from the output so that they don't get included in the library
- # dependencies.
- output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed'
- ;;
- xl* | mpixl* | bgxl*)
- # IBM XL 8.0 on PPC, with GNU ld
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
- _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
- if test yes = "$supports_anon_versioning"; then
- _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
- cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
- echo "local: *; };" >> $output_objdir/$libname.ver~
- $CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib'
- fi
- ;;
- *)
- case `$CC -V 2>&1 | sed 5q` in
- *Sun\ C*)
- # Sun C++ 5.9
- _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
- _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file $wl$export_symbols'
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
- _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
- _LT_TAGVAR(compiler_needs_object, $1)=yes
-
- # Not sure whether something based on
- # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
- # would be better.
- output_verbose_link_cmd='func_echo_all'
-
- # Archives containing C++ object files must be created using
- # "CC -xar", where "CC" is the Sun C++ compiler. This is
- # necessary to make sure instantiated templates are included
- # in the archive.
- _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
- ;;
- esac
- ;;
- esac
- ;;
-
- lynxos*)
- # FIXME: insert proper C++ library support
- _LT_TAGVAR(ld_shlibs, $1)=no
- ;;
-
- m88k*)
- # FIXME: insert proper C++ library support
- _LT_TAGVAR(ld_shlibs, $1)=no
- ;;
-
- mvs*)
- case $cc_basename in
- cxx*)
- # FIXME: insert proper C++ library support
- _LT_TAGVAR(ld_shlibs, $1)=no
- ;;
- *)
- # FIXME: insert proper C++ library support
- _LT_TAGVAR(ld_shlibs, $1)=no
- ;;
- esac
- ;;
-
- netbsd*)
- if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
- _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
- wlarc=
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
- _LT_TAGVAR(hardcode_direct, $1)=yes
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- fi
- # Workaround some broken pre-1.5 toolchains
- output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
- ;;
-
- *nto* | *qnx*)
- _LT_TAGVAR(ld_shlibs, $1)=yes
- ;;
-
- openbsd* | bitrig*)
- if test -f /usr/libexec/ld.so; then
- _LT_TAGVAR(hardcode_direct, $1)=yes
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
- if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`"; then
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file,$export_symbols -o $lib'
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
- _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
- fi
- output_verbose_link_cmd=func_echo_all
- else
- _LT_TAGVAR(ld_shlibs, $1)=no
- fi
- ;;
-
- osf3* | osf4* | osf5*)
- case $cc_basename in
- KCC*)
- # Kuck and Associates, Inc. (KAI) C++ Compiler
-
- # KCC will only create a shared library if the output file
- # ends with ".so" (or ".sl" for HP-UX), so rename the library
- # to its proper name (with version) after linking.
- _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
-
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
- _LT_TAGVAR(hardcode_libdir_separator, $1)=:
-
- # Archives containing C++ object files must be created using
- # the KAI C++ compiler.
- case $host in
- osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;;
- *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;;
- esac
- ;;
- RCC*)
- # Rational C++ 2.4.1
- # FIXME: insert proper C++ library support
- _LT_TAGVAR(ld_shlibs, $1)=no
- ;;
- cxx*)
- case $host in
- osf3*)
- _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $soname `test -n "$verstring" && func_echo_all "$wl-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
- ;;
- *)
- _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
- echo "-hidden">> $lib.exp~
- $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname $wl-input $wl$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~
- $RM $lib.exp'
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
- ;;
- esac
-
- _LT_TAGVAR(hardcode_libdir_separator, $1)=:
-
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- #
- # There doesn't appear to be a way to prevent this compiler from
- # explicitly linking system object files so we need to strip them
- # from the output so that they don't get included in the library
- # dependencies.
- output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
- ;;
- *)
- if test yes,no = "$GXX,$with_gnu_ld"; then
- _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
- case $host in
- osf3*)
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
- ;;
- *)
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
- ;;
- esac
-
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
- _LT_TAGVAR(hardcode_libdir_separator, $1)=:
-
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
-
- else
- # FIXME: insert proper C++ library support
- _LT_TAGVAR(ld_shlibs, $1)=no
- fi
- ;;
- esac
- ;;
-
- psos*)
- # FIXME: insert proper C++ library support
- _LT_TAGVAR(ld_shlibs, $1)=no
- ;;
-
- sunos4*)
- case $cc_basename in
- CC*)
- # Sun C++ 4.x
- # FIXME: insert proper C++ library support
- _LT_TAGVAR(ld_shlibs, $1)=no
- ;;
- lcc*)
- # Lucid
- # FIXME: insert proper C++ library support
- _LT_TAGVAR(ld_shlibs, $1)=no
- ;;
- *)
- # FIXME: insert proper C++ library support
- _LT_TAGVAR(ld_shlibs, $1)=no
- ;;
- esac
- ;;
-
- solaris*)
- case $cc_basename in
- CC* | sunCC*)
- # Sun C++ 4.2, 5.x and Centerline C++
- _LT_TAGVAR(archive_cmds_need_lc,$1)=yes
- _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
- _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
- $CC -G$allow_undefined_flag $wl-M $wl$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
-
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- case $host_os in
- solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
- *)
- # The compiler driver will combine and reorder linker options,
- # but understands '-z linker_flag'.
- # Supported since Solaris 2.6 (maybe 2.5.1?)
- _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
- ;;
- esac
- _LT_TAGVAR(link_all_deplibs, $1)=yes
-
- output_verbose_link_cmd='func_echo_all'
-
- # Archives containing C++ object files must be created using
- # "CC -xar", where "CC" is the Sun C++ compiler. This is
- # necessary to make sure instantiated templates are included
- # in the archive.
- _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
- ;;
- gcx*)
- # Green Hills C++ Compiler
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib'
-
- # The C++ compiler must be used to create the archive.
- _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
- ;;
- *)
- # GNU C++ compiler with Solaris linker
- if test yes,no = "$GXX,$with_gnu_ld"; then
- _LT_TAGVAR(no_undefined_flag, $1)=' $wl-z ${wl}defs'
- if $CC --version | $GREP -v '^2\.7' > /dev/null; then
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
- $CC -shared $pic_flag -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
-
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
- else
- # g++ 2.7 appears to require '-G' NOT '-shared' on this
- # platform.
- _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
- $CC -G -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
-
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
- fi
-
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $wl$libdir'
- case $host_os in
- solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
- *)
- _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract'
- ;;
- esac
- fi
- ;;
- esac
- ;;
-
- sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
- _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
- _LT_TAGVAR(archive_cmds_need_lc, $1)=no
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- runpath_var='LD_RUN_PATH'
-
- case $cc_basename in
- CC*)
- _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- *)
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- esac
- ;;
-
- sysv5* | sco3.2v5* | sco5v6*)
- # Note: We CANNOT use -z defs as we might desire, because we do not
- # link with -lc, and that would cause any symbols used from libc to
- # always be unresolved, which means just about no library would
- # ever link correctly. If we're not using GNU ld we use -z text
- # though, which does catch some bad symbols but isn't as heavy-handed
- # as -z defs.
- _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
- _LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs'
- _LT_TAGVAR(archive_cmds_need_lc, $1)=no
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir'
- _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
- _LT_TAGVAR(link_all_deplibs, $1)=yes
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport'
- runpath_var='LD_RUN_PATH'
-
- case $cc_basename in
- CC*)
- _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~
- '"$_LT_TAGVAR(old_archive_cmds, $1)"
- _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~
- '"$_LT_TAGVAR(reload_cmds, $1)"
- ;;
- *)
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- esac
- ;;
-
- tandem*)
- case $cc_basename in
- NCC*)
- # NonStop-UX NCC 3.20
- # FIXME: insert proper C++ library support
- _LT_TAGVAR(ld_shlibs, $1)=no
- ;;
- *)
- # FIXME: insert proper C++ library support
- _LT_TAGVAR(ld_shlibs, $1)=no
- ;;
- esac
- ;;
-
- vxworks*)
- # FIXME: insert proper C++ library support
- _LT_TAGVAR(ld_shlibs, $1)=no
- ;;
-
- *)
- # FIXME: insert proper C++ library support
- _LT_TAGVAR(ld_shlibs, $1)=no
- ;;
- esac
-
- AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
- test no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no
-
- _LT_TAGVAR(GCC, $1)=$GXX
- _LT_TAGVAR(LD, $1)=$LD
-
- ## CAVEAT EMPTOR:
- ## There is no encapsulation within the following macros, do not change
- ## the running order or otherwise move them around unless you know exactly
- ## what you are doing...
- _LT_SYS_HIDDEN_LIBDEPS($1)
- _LT_COMPILER_PIC($1)
- _LT_COMPILER_C_O($1)
- _LT_COMPILER_FILE_LOCKS($1)
- _LT_LINKER_SHLIBS($1)
- _LT_SYS_DYNAMIC_LINKER($1)
- _LT_LINKER_HARDCODE_LIBPATH($1)
-
- _LT_CONFIG($1)
- fi # test -n "$compiler"
-
- CC=$lt_save_CC
- CFLAGS=$lt_save_CFLAGS
- LDCXX=$LD
- LD=$lt_save_LD
- GCC=$lt_save_GCC
- with_gnu_ld=$lt_save_with_gnu_ld
- lt_cv_path_LDCXX=$lt_cv_path_LD
- lt_cv_path_LD=$lt_save_path_LD
- lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
- lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
-fi # test yes != "$_lt_caught_CXX_error"
-
-AC_LANG_POP
-])# _LT_LANG_CXX_CONFIG
-
-
-# _LT_FUNC_STRIPNAME_CNF
-# ----------------------
-# func_stripname_cnf prefix suffix name
-# strip PREFIX and SUFFIX off of NAME.
-# PREFIX and SUFFIX must not contain globbing or regex special
-# characters, hashes, percent signs, but SUFFIX may contain a leading
-# dot (in which case that matches only a dot).
-#
-# This function is identical to the (non-XSI) version of func_stripname,
-# except this one can be used by m4 code that may be executed by configure,
-# rather than the libtool script.
-m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl
-AC_REQUIRE([_LT_DECL_SED])
-AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])
-func_stripname_cnf ()
-{
- case @S|@2 in
- .*) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%\\\\@S|@2\$%%"`;;
- *) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%@S|@2\$%%"`;;
- esac
-} # func_stripname_cnf
-])# _LT_FUNC_STRIPNAME_CNF
-
-# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
-# ---------------------------------
-# Figure out "hidden" library dependencies from verbose
-# compiler output when linking a shared library.
-# Parse the compiler output and extract the necessary
-# objects, libraries and library flags.
-m4_defun([_LT_SYS_HIDDEN_LIBDEPS],
-[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
-AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl
-# Dependencies to place before and after the object being linked:
-_LT_TAGVAR(predep_objects, $1)=
-_LT_TAGVAR(postdep_objects, $1)=
-_LT_TAGVAR(predeps, $1)=
-_LT_TAGVAR(postdeps, $1)=
-_LT_TAGVAR(compiler_lib_search_path, $1)=
-
-dnl we can't use the lt_simple_compile_test_code here,
-dnl because it contains code intended for an executable,
-dnl not a library. It's possible we should let each
-dnl tag define a new lt_????_link_test_code variable,
-dnl but it's only used here...
-m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF
-int a;
-void foo (void) { a = 0; }
-_LT_EOF
-], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF
-class Foo
-{
-public:
- Foo (void) { a = 0; }
-private:
- int a;
-};
-_LT_EOF
-], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF
- subroutine foo
- implicit none
- integer*4 a
- a=0
- return
- end
-_LT_EOF
-], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF
- subroutine foo
- implicit none
- integer a
- a=0
- return
- end
-_LT_EOF
-], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF
-public class foo {
- private int a;
- public void bar (void) {
- a = 0;
- }
-};
-_LT_EOF
-], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF
-package foo
-func foo() {
-}
-_LT_EOF
-])
-
-_lt_libdeps_save_CFLAGS=$CFLAGS
-case "$CC $CFLAGS " in #(
-*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;;
-*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;;
-*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;;
-esac
-
-dnl Parse the compiler output and extract the necessary
-dnl objects, libraries and library flags.
-if AC_TRY_EVAL(ac_compile); then
- # Parse the compiler output and extract the necessary
- # objects, libraries and library flags.
-
- # Sentinel used to keep track of whether or not we are before
- # the conftest object file.
- pre_test_object_deps_done=no
-
- for p in `eval "$output_verbose_link_cmd"`; do
- case $prev$p in
-
- -L* | -R* | -l*)
- # Some compilers place space between "-{L,R}" and the path.
- # Remove the space.
- if test x-L = "$p" ||
- test x-R = "$p"; then
- prev=$p
- continue
- fi
-
- # Expand the sysroot to ease extracting the directories later.
- if test -z "$prev"; then
- case $p in
- -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;;
- -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;;
- -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;;
- esac
- fi
- case $p in
- =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;;
- esac
- if test no = "$pre_test_object_deps_done"; then
- case $prev in
- -L | -R)
- # Internal compiler library paths should come after those
- # provided the user. The postdeps already come after the
- # user supplied libs so there is no need to process them.
- if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then
- _LT_TAGVAR(compiler_lib_search_path, $1)=$prev$p
- else
- _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} $prev$p"
- fi
- ;;
- # The "-l" case would never come before the object being
- # linked, so don't bother handling this case.
- esac
- else
- if test -z "$_LT_TAGVAR(postdeps, $1)"; then
- _LT_TAGVAR(postdeps, $1)=$prev$p
- else
- _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} $prev$p"
- fi
- fi
- prev=
- ;;
-
- *.lto.$objext) ;; # Ignore GCC LTO objects
- *.$objext)
- # This assumes that the test object file only shows up
- # once in the compiler output.
- if test "$p" = "conftest.$objext"; then
- pre_test_object_deps_done=yes
- continue
- fi
-
- if test no = "$pre_test_object_deps_done"; then
- if test -z "$_LT_TAGVAR(predep_objects, $1)"; then
- _LT_TAGVAR(predep_objects, $1)=$p
- else
- _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p"
- fi
- else
- if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then
- _LT_TAGVAR(postdep_objects, $1)=$p
- else
- _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p"
- fi
- fi
- ;;
-
- *) ;; # Ignore the rest.
-
- esac
- done
-
- # Clean up.
- rm -f a.out a.exe
-else
- echo "libtool.m4: error: problem compiling $1 test program"
-fi
-
-$RM -f confest.$objext
-CFLAGS=$_lt_libdeps_save_CFLAGS
-
-# PORTME: override above test on systems where it is broken
-m4_if([$1], [CXX],
-[case $host_os in
-interix[[3-9]]*)
- # Interix 3.5 installs completely hosed .la files for C++, so rather than
- # hack all around it, let's just trust "g++" to DTRT.
- _LT_TAGVAR(predep_objects,$1)=
- _LT_TAGVAR(postdep_objects,$1)=
- _LT_TAGVAR(postdeps,$1)=
- ;;
-
-linux*)
- case `$CC -V 2>&1 | sed 5q` in
- *Sun\ C*)
- # Sun C++ 5.9
-
- # The more standards-conforming stlport4 library is
- # incompatible with the Cstd library. Avoid specifying
- # it if it's in CXXFLAGS. Ignore libCrun as
- # -library=stlport4 depends on it.
- case " $CXX $CXXFLAGS " in
- *" -library=stlport4 "*)
- solaris_use_stlport4=yes
- ;;
- esac
-
- if test yes != "$solaris_use_stlport4"; then
- _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
- fi
- ;;
- esac
- ;;
-
-solaris*)
- case $cc_basename in
- CC* | sunCC*)
- # The more standards-conforming stlport4 library is
- # incompatible with the Cstd library. Avoid specifying
- # it if it's in CXXFLAGS. Ignore libCrun as
- # -library=stlport4 depends on it.
- case " $CXX $CXXFLAGS " in
- *" -library=stlport4 "*)
- solaris_use_stlport4=yes
- ;;
- esac
-
- # Adding this requires a known-good setup of shared libraries for
- # Sun compiler versions before 5.6, else PIC objects from an old
- # archive will be linked into the output, leading to subtle bugs.
- if test yes != "$solaris_use_stlport4"; then
- _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
- fi
- ;;
- esac
- ;;
-esac
-])
-
-case " $_LT_TAGVAR(postdeps, $1) " in
-*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;;
-esac
- _LT_TAGVAR(compiler_lib_search_dirs, $1)=
-if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then
- _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | $SED -e 's! -L! !g' -e 's!^ !!'`
-fi
-_LT_TAGDECL([], [compiler_lib_search_dirs], [1],
- [The directories searched by this compiler when creating a shared library])
-_LT_TAGDECL([], [predep_objects], [1],
- [Dependencies to place before and after the objects being linked to
- create a shared library])
-_LT_TAGDECL([], [postdep_objects], [1])
-_LT_TAGDECL([], [predeps], [1])
-_LT_TAGDECL([], [postdeps], [1])
-_LT_TAGDECL([], [compiler_lib_search_path], [1],
- [The library search path used internally by the compiler when linking
- a shared library])
-])# _LT_SYS_HIDDEN_LIBDEPS
-
-
-# _LT_LANG_F77_CONFIG([TAG])
-# --------------------------
-# Ensure that the configuration variables for a Fortran 77 compiler are
-# suitably defined. These variables are subsequently used by _LT_CONFIG
-# to write the compiler configuration to 'libtool'.
-m4_defun([_LT_LANG_F77_CONFIG],
-[AC_LANG_PUSH(Fortran 77)
-if test -z "$F77" || test no = "$F77"; then
- _lt_disable_F77=yes
-fi
-
-_LT_TAGVAR(archive_cmds_need_lc, $1)=no
-_LT_TAGVAR(allow_undefined_flag, $1)=
-_LT_TAGVAR(always_export_symbols, $1)=no
-_LT_TAGVAR(archive_expsym_cmds, $1)=
-_LT_TAGVAR(export_dynamic_flag_spec, $1)=
-_LT_TAGVAR(hardcode_direct, $1)=no
-_LT_TAGVAR(hardcode_direct_absolute, $1)=no
-_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
-_LT_TAGVAR(hardcode_libdir_separator, $1)=
-_LT_TAGVAR(hardcode_minus_L, $1)=no
-_LT_TAGVAR(hardcode_automatic, $1)=no
-_LT_TAGVAR(inherit_rpath, $1)=no
-_LT_TAGVAR(module_cmds, $1)=
-_LT_TAGVAR(module_expsym_cmds, $1)=
-_LT_TAGVAR(link_all_deplibs, $1)=unknown
-_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
-_LT_TAGVAR(reload_flag, $1)=$reload_flag
-_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
-_LT_TAGVAR(no_undefined_flag, $1)=
-_LT_TAGVAR(whole_archive_flag_spec, $1)=
-_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
-
-# Source file extension for f77 test sources.
-ac_ext=f
-
-# Object file extension for compiled f77 test sources.
-objext=o
-_LT_TAGVAR(objext, $1)=$objext
-
-# No sense in running all these tests if we already determined that
-# the F77 compiler isn't working. Some variables (like enable_shared)
-# are currently assumed to apply to all compilers on this platform,
-# and will be corrupted by setting them based on a non-working compiler.
-if test yes != "$_lt_disable_F77"; then
- # Code to be used in simple compile tests
- lt_simple_compile_test_code="\
- subroutine t
- return
- end
-"
-
- # Code to be used in simple link tests
- lt_simple_link_test_code="\
- program t
- end
-"
-
- # ltmain only uses $CC for tagged configurations so make sure $CC is set.
- _LT_TAG_COMPILER
-
- # save warnings/boilerplate of simple test code
- _LT_COMPILER_BOILERPLATE
- _LT_LINKER_BOILERPLATE
-
- # Allow CC to be a program name with arguments.
- lt_save_CC=$CC
- lt_save_GCC=$GCC
- lt_save_CFLAGS=$CFLAGS
- CC=${F77-"f77"}
- CFLAGS=$FFLAGS
- compiler=$CC
- _LT_TAGVAR(compiler, $1)=$CC
- _LT_CC_BASENAME([$compiler])
- GCC=$G77
- if test -n "$compiler"; then
- AC_MSG_CHECKING([if libtool supports shared libraries])
- AC_MSG_RESULT([$can_build_shared])
-
- AC_MSG_CHECKING([whether to build shared libraries])
- test no = "$can_build_shared" && enable_shared=no
-
- # On AIX, shared libraries and static libraries use the same namespace, and
- # are all built from PIC.
- case $host_os in
- aix3*)
- test yes = "$enable_shared" && enable_static=no
- if test -n "$RANLIB"; then
- archive_cmds="$archive_cmds~\$RANLIB \$lib"
- postinstall_cmds='$RANLIB $lib'
- fi
- ;;
- aix[[4-9]]*)
- if test ia64 != "$host_cpu" && test no = "$aix_use_runtimelinking"; then
- test yes = "$enable_shared" && enable_static=no
- fi
- ;;
- esac
- AC_MSG_RESULT([$enable_shared])
-
- AC_MSG_CHECKING([whether to build static libraries])
- # Make sure either enable_shared or enable_static is yes.
- test yes = "$enable_shared" || enable_static=yes
- AC_MSG_RESULT([$enable_static])
-
- _LT_TAGVAR(GCC, $1)=$G77
- _LT_TAGVAR(LD, $1)=$LD
-
- ## CAVEAT EMPTOR:
- ## There is no encapsulation within the following macros, do not change
- ## the running order or otherwise move them around unless you know exactly
- ## what you are doing...
- _LT_COMPILER_PIC($1)
- _LT_COMPILER_C_O($1)
- _LT_COMPILER_FILE_LOCKS($1)
- _LT_LINKER_SHLIBS($1)
- _LT_SYS_DYNAMIC_LINKER($1)
- _LT_LINKER_HARDCODE_LIBPATH($1)
-
- _LT_CONFIG($1)
- fi # test -n "$compiler"
-
- GCC=$lt_save_GCC
- CC=$lt_save_CC
- CFLAGS=$lt_save_CFLAGS
-fi # test yes != "$_lt_disable_F77"
-
-AC_LANG_POP
-])# _LT_LANG_F77_CONFIG
-
-
-# _LT_LANG_FC_CONFIG([TAG])
-# -------------------------
-# Ensure that the configuration variables for a Fortran compiler are
-# suitably defined. These variables are subsequently used by _LT_CONFIG
-# to write the compiler configuration to 'libtool'.
-m4_defun([_LT_LANG_FC_CONFIG],
-[AC_LANG_PUSH(Fortran)
-
-if test -z "$FC" || test no = "$FC"; then
- _lt_disable_FC=yes
-fi
-
-_LT_TAGVAR(archive_cmds_need_lc, $1)=no
-_LT_TAGVAR(allow_undefined_flag, $1)=
-_LT_TAGVAR(always_export_symbols, $1)=no
-_LT_TAGVAR(archive_expsym_cmds, $1)=
-_LT_TAGVAR(export_dynamic_flag_spec, $1)=
-_LT_TAGVAR(hardcode_direct, $1)=no
-_LT_TAGVAR(hardcode_direct_absolute, $1)=no
-_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
-_LT_TAGVAR(hardcode_libdir_separator, $1)=
-_LT_TAGVAR(hardcode_minus_L, $1)=no
-_LT_TAGVAR(hardcode_automatic, $1)=no
-_LT_TAGVAR(inherit_rpath, $1)=no
-_LT_TAGVAR(module_cmds, $1)=
-_LT_TAGVAR(module_expsym_cmds, $1)=
-_LT_TAGVAR(link_all_deplibs, $1)=unknown
-_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
-_LT_TAGVAR(reload_flag, $1)=$reload_flag
-_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
-_LT_TAGVAR(no_undefined_flag, $1)=
-_LT_TAGVAR(whole_archive_flag_spec, $1)=
-_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
-
-# Source file extension for fc test sources.
-ac_ext=${ac_fc_srcext-f}
-
-# Object file extension for compiled fc test sources.
-objext=o
-_LT_TAGVAR(objext, $1)=$objext
-
-# No sense in running all these tests if we already determined that
-# the FC compiler isn't working. Some variables (like enable_shared)
-# are currently assumed to apply to all compilers on this platform,
-# and will be corrupted by setting them based on a non-working compiler.
-if test yes != "$_lt_disable_FC"; then
- # Code to be used in simple compile tests
- lt_simple_compile_test_code="\
- subroutine t
- return
- end
-"
-
- # Code to be used in simple link tests
- lt_simple_link_test_code="\
- program t
- end
-"
-
- # ltmain only uses $CC for tagged configurations so make sure $CC is set.
- _LT_TAG_COMPILER
-
- # save warnings/boilerplate of simple test code
- _LT_COMPILER_BOILERPLATE
- _LT_LINKER_BOILERPLATE
-
- # Allow CC to be a program name with arguments.
- lt_save_CC=$CC
- lt_save_GCC=$GCC
- lt_save_CFLAGS=$CFLAGS
- CC=${FC-"f95"}
- CFLAGS=$FCFLAGS
- compiler=$CC
- GCC=$ac_cv_fc_compiler_gnu
-
- _LT_TAGVAR(compiler, $1)=$CC
- _LT_CC_BASENAME([$compiler])
-
- if test -n "$compiler"; then
- AC_MSG_CHECKING([if libtool supports shared libraries])
- AC_MSG_RESULT([$can_build_shared])
-
- AC_MSG_CHECKING([whether to build shared libraries])
- test no = "$can_build_shared" && enable_shared=no
-
- # On AIX, shared libraries and static libraries use the same namespace, and
- # are all built from PIC.
- case $host_os in
- aix3*)
- test yes = "$enable_shared" && enable_static=no
- if test -n "$RANLIB"; then
- archive_cmds="$archive_cmds~\$RANLIB \$lib"
- postinstall_cmds='$RANLIB $lib'
- fi
- ;;
- aix[[4-9]]*)
- if test ia64 != "$host_cpu" && test no = "$aix_use_runtimelinking"; then
- test yes = "$enable_shared" && enable_static=no
- fi
- ;;
- esac
- AC_MSG_RESULT([$enable_shared])
-
- AC_MSG_CHECKING([whether to build static libraries])
- # Make sure either enable_shared or enable_static is yes.
- test yes = "$enable_shared" || enable_static=yes
- AC_MSG_RESULT([$enable_static])
-
- _LT_TAGVAR(GCC, $1)=$ac_cv_fc_compiler_gnu
- _LT_TAGVAR(LD, $1)=$LD
-
- ## CAVEAT EMPTOR:
- ## There is no encapsulation within the following macros, do not change
- ## the running order or otherwise move them around unless you know exactly
- ## what you are doing...
- _LT_SYS_HIDDEN_LIBDEPS($1)
- _LT_COMPILER_PIC($1)
- _LT_COMPILER_C_O($1)
- _LT_COMPILER_FILE_LOCKS($1)
- _LT_LINKER_SHLIBS($1)
- _LT_SYS_DYNAMIC_LINKER($1)
- _LT_LINKER_HARDCODE_LIBPATH($1)
-
- _LT_CONFIG($1)
- fi # test -n "$compiler"
-
- GCC=$lt_save_GCC
- CC=$lt_save_CC
- CFLAGS=$lt_save_CFLAGS
-fi # test yes != "$_lt_disable_FC"
-
-AC_LANG_POP
-])# _LT_LANG_FC_CONFIG
-
-
-# _LT_LANG_GCJ_CONFIG([TAG])
-# --------------------------
-# Ensure that the configuration variables for the GNU Java Compiler compiler
-# are suitably defined. These variables are subsequently used by _LT_CONFIG
-# to write the compiler configuration to 'libtool'.
-m4_defun([_LT_LANG_GCJ_CONFIG],
-[AC_REQUIRE([LT_PROG_GCJ])dnl
-AC_LANG_SAVE
-
-# Source file extension for Java test sources.
-ac_ext=java
-
-# Object file extension for compiled Java test sources.
-objext=o
-_LT_TAGVAR(objext, $1)=$objext
-
-# Code to be used in simple compile tests
-lt_simple_compile_test_code="class foo {}"
-
-# Code to be used in simple link tests
-lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'
-
-# ltmain only uses $CC for tagged configurations so make sure $CC is set.
-_LT_TAG_COMPILER
-
-# save warnings/boilerplate of simple test code
-_LT_COMPILER_BOILERPLATE
-_LT_LINKER_BOILERPLATE
-
-# Allow CC to be a program name with arguments.
-lt_save_CC=$CC
-lt_save_CFLAGS=$CFLAGS
-lt_save_GCC=$GCC
-GCC=yes
-CC=${GCJ-"gcj"}
-CFLAGS=$GCJFLAGS
-compiler=$CC
-_LT_TAGVAR(compiler, $1)=$CC
-_LT_TAGVAR(LD, $1)=$LD
-_LT_CC_BASENAME([$compiler])
-
-# GCJ did not exist at the time GCC didn't implicitly link libc in.
-_LT_TAGVAR(archive_cmds_need_lc, $1)=no
-
-_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
-_LT_TAGVAR(reload_flag, $1)=$reload_flag
-_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
-
-## CAVEAT EMPTOR:
-## There is no encapsulation within the following macros, do not change
-## the running order or otherwise move them around unless you know exactly
-## what you are doing...
-if test -n "$compiler"; then
- _LT_COMPILER_NO_RTTI($1)
- _LT_COMPILER_PIC($1)
- _LT_COMPILER_C_O($1)
- _LT_COMPILER_FILE_LOCKS($1)
- _LT_LINKER_SHLIBS($1)
- _LT_LINKER_HARDCODE_LIBPATH($1)
-
- _LT_CONFIG($1)
-fi
-
-AC_LANG_RESTORE
-
-GCC=$lt_save_GCC
-CC=$lt_save_CC
-CFLAGS=$lt_save_CFLAGS
-])# _LT_LANG_GCJ_CONFIG
-
-
-# _LT_LANG_GO_CONFIG([TAG])
-# --------------------------
-# Ensure that the configuration variables for the GNU Go compiler
-# are suitably defined. These variables are subsequently used by _LT_CONFIG
-# to write the compiler configuration to 'libtool'.
-m4_defun([_LT_LANG_GO_CONFIG],
-[AC_REQUIRE([LT_PROG_GO])dnl
-AC_LANG_SAVE
-
-# Source file extension for Go test sources.
-ac_ext=go
-
-# Object file extension for compiled Go test sources.
-objext=o
-_LT_TAGVAR(objext, $1)=$objext
-
-# Code to be used in simple compile tests
-lt_simple_compile_test_code="package main; func main() { }"
-
-# Code to be used in simple link tests
-lt_simple_link_test_code='package main; func main() { }'
-
-# ltmain only uses $CC for tagged configurations so make sure $CC is set.
-_LT_TAG_COMPILER
-
-# save warnings/boilerplate of simple test code
-_LT_COMPILER_BOILERPLATE
-_LT_LINKER_BOILERPLATE
-
-# Allow CC to be a program name with arguments.
-lt_save_CC=$CC
-lt_save_CFLAGS=$CFLAGS
-lt_save_GCC=$GCC
-GCC=yes
-CC=${GOC-"gccgo"}
-CFLAGS=$GOFLAGS
-compiler=$CC
-_LT_TAGVAR(compiler, $1)=$CC
-_LT_TAGVAR(LD, $1)=$LD
-_LT_CC_BASENAME([$compiler])
-
-# Go did not exist at the time GCC didn't implicitly link libc in.
-_LT_TAGVAR(archive_cmds_need_lc, $1)=no
-
-_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
-_LT_TAGVAR(reload_flag, $1)=$reload_flag
-_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
-
-## CAVEAT EMPTOR:
-## There is no encapsulation within the following macros, do not change
-## the running order or otherwise move them around unless you know exactly
-## what you are doing...
-if test -n "$compiler"; then
- _LT_COMPILER_NO_RTTI($1)
- _LT_COMPILER_PIC($1)
- _LT_COMPILER_C_O($1)
- _LT_COMPILER_FILE_LOCKS($1)
- _LT_LINKER_SHLIBS($1)
- _LT_LINKER_HARDCODE_LIBPATH($1)
-
- _LT_CONFIG($1)
-fi
-
-AC_LANG_RESTORE
-
-GCC=$lt_save_GCC
-CC=$lt_save_CC
-CFLAGS=$lt_save_CFLAGS
-])# _LT_LANG_GO_CONFIG
-
-
-# _LT_LANG_RC_CONFIG([TAG])
-# -------------------------
-# Ensure that the configuration variables for the Windows resource compiler
-# are suitably defined. These variables are subsequently used by _LT_CONFIG
-# to write the compiler configuration to 'libtool'.
-m4_defun([_LT_LANG_RC_CONFIG],
-[AC_REQUIRE([LT_PROG_RC])dnl
-AC_LANG_SAVE
-
-# Source file extension for RC test sources.
-ac_ext=rc
-
-# Object file extension for compiled RC test sources.
-objext=o
-_LT_TAGVAR(objext, $1)=$objext
-
-# Code to be used in simple compile tests
-lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
-
-# Code to be used in simple link tests
-lt_simple_link_test_code=$lt_simple_compile_test_code
-
-# ltmain only uses $CC for tagged configurations so make sure $CC is set.
-_LT_TAG_COMPILER
-
-# save warnings/boilerplate of simple test code
-_LT_COMPILER_BOILERPLATE
-_LT_LINKER_BOILERPLATE
-
-# Allow CC to be a program name with arguments.
-lt_save_CC=$CC
-lt_save_CFLAGS=$CFLAGS
-lt_save_GCC=$GCC
-GCC=
-CC=${RC-"windres"}
-CFLAGS=
-compiler=$CC
-_LT_TAGVAR(compiler, $1)=$CC
-_LT_CC_BASENAME([$compiler])
-_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
-
-if test -n "$compiler"; then
- :
- _LT_CONFIG($1)
-fi
-
-GCC=$lt_save_GCC
-AC_LANG_RESTORE
-CC=$lt_save_CC
-CFLAGS=$lt_save_CFLAGS
-])# _LT_LANG_RC_CONFIG
-
-
-# LT_PROG_GCJ
-# -----------
-AC_DEFUN([LT_PROG_GCJ],
-[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ],
- [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ],
- [AC_CHECK_TOOL(GCJ, gcj,)
- test set = "${GCJFLAGS+set}" || GCJFLAGS="-g -O2"
- AC_SUBST(GCJFLAGS)])])[]dnl
-])
-
-# Old name:
-AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([LT_AC_PROG_GCJ], [])
-
-
-# LT_PROG_GO
-# ----------
-AC_DEFUN([LT_PROG_GO],
-[AC_CHECK_TOOL(GOC, gccgo,)
-])
-
-
-# LT_PROG_RC
-# ----------
-AC_DEFUN([LT_PROG_RC],
-[AC_CHECK_TOOL(RC, windres,)
-])
-
-# Old name:
-AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([LT_AC_PROG_RC], [])
-
-
-# _LT_DECL_EGREP
-# --------------
-# If we don't have a new enough Autoconf to choose the best grep
-# available, choose the one first in the user's PATH.
-m4_defun([_LT_DECL_EGREP],
-[AC_REQUIRE([AC_PROG_EGREP])dnl
-AC_REQUIRE([AC_PROG_FGREP])dnl
-test -z "$GREP" && GREP=grep
-_LT_DECL([], [GREP], [1], [A grep program that handles long lines])
-_LT_DECL([], [EGREP], [1], [An ERE matcher])
-_LT_DECL([], [FGREP], [1], [A literal string matcher])
-dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too
-AC_SUBST([GREP])
-])
-
-
-# _LT_DECL_OBJDUMP
-# --------------
-# If we don't have a new enough Autoconf to choose the best objdump
-# available, choose the one first in the user's PATH.
-m4_defun([_LT_DECL_OBJDUMP],
-[AC_CHECK_TOOL(OBJDUMP, objdump, false)
-test -z "$OBJDUMP" && OBJDUMP=objdump
-_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper])
-AC_SUBST([OBJDUMP])
-])
-
-# _LT_DECL_DLLTOOL
-# ----------------
-# Ensure DLLTOOL variable is set.
-m4_defun([_LT_DECL_DLLTOOL],
-[AC_CHECK_TOOL(DLLTOOL, dlltool, false)
-test -z "$DLLTOOL" && DLLTOOL=dlltool
-_LT_DECL([], [DLLTOOL], [1], [DLL creation program])
-AC_SUBST([DLLTOOL])
-])
-
-# _LT_DECL_SED
-# ------------
-# Check for a fully-functional sed program, that truncates
-# as few characters as possible. Prefer GNU sed if found.
-m4_defun([_LT_DECL_SED],
-[AC_PROG_SED
-test -z "$SED" && SED=sed
-Xsed="$SED -e 1s/^X//"
-_LT_DECL([], [SED], [1], [A sed program that does not truncate output])
-_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"],
- [Sed that helps us avoid accidentally triggering echo(1) options like -n])
-])# _LT_DECL_SED
-
-m4_ifndef([AC_PROG_SED], [
-############################################################
-# NOTE: This macro has been submitted for inclusion into #
-# GNU Autoconf as AC_PROG_SED. When it is available in #
-# a released version of Autoconf we should remove this #
-# macro and use it instead. #
-############################################################
-
-m4_defun([AC_PROG_SED],
-[AC_MSG_CHECKING([for a sed that does not truncate output])
-AC_CACHE_VAL(lt_cv_path_SED,
-[# Loop through the user's path and test for sed and gsed.
-# Then use that list of sed's as ones to test for truncation.
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for lt_ac_prog in sed gsed; do
- for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
- lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
- fi
- done
- done
-done
-IFS=$as_save_IFS
-lt_ac_max=0
-lt_ac_count=0
-# Add /usr/xpg4/bin/sed as it is typically found on Solaris
-# along with /bin/sed that truncates output.
-for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
- test ! -f "$lt_ac_sed" && continue
- cat /dev/null > conftest.in
- lt_ac_count=0
- echo $ECHO_N "0123456789$ECHO_C" >conftest.in
- # Check for GNU sed and select it if it is found.
- if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
- lt_cv_path_SED=$lt_ac_sed
- break
- fi
- while true; do
- cat conftest.in conftest.in >conftest.tmp
- mv conftest.tmp conftest.in
- cp conftest.in conftest.nl
- echo >>conftest.nl
- $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
- cmp -s conftest.out conftest.nl || break
- # 10000 chars as input seems more than enough
- test 10 -lt "$lt_ac_count" && break
- lt_ac_count=`expr $lt_ac_count + 1`
- if test "$lt_ac_count" -gt "$lt_ac_max"; then
- lt_ac_max=$lt_ac_count
- lt_cv_path_SED=$lt_ac_sed
- fi
- done
-done
-])
-SED=$lt_cv_path_SED
-AC_SUBST([SED])
-AC_MSG_RESULT([$SED])
-])#AC_PROG_SED
-])#m4_ifndef
-
-# Old name:
-AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([LT_AC_PROG_SED], [])
-
-
-# _LT_CHECK_SHELL_FEATURES
-# ------------------------
-# Find out whether the shell is Bourne or XSI compatible,
-# or has some other useful features.
-m4_defun([_LT_CHECK_SHELL_FEATURES],
-[if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
- lt_unset=unset
-else
- lt_unset=false
-fi
-_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl
-
-# test EBCDIC or ASCII
-case `echo X|tr X '\101'` in
- A) # ASCII based system
- # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
- lt_SP2NL='tr \040 \012'
- lt_NL2SP='tr \015\012 \040\040'
- ;;
- *) # EBCDIC based system
- lt_SP2NL='tr \100 \n'
- lt_NL2SP='tr \r\n \100\100'
- ;;
-esac
-_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl
-_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl
-])# _LT_CHECK_SHELL_FEATURES
-
-
-# _LT_PATH_CONVERSION_FUNCTIONS
-# -----------------------------
-# Determine what file name conversion functions should be used by
-# func_to_host_file (and, implicitly, by func_to_host_path). These are needed
-# for certain cross-compile configurations and native mingw.
-m4_defun([_LT_PATH_CONVERSION_FUNCTIONS],
-[AC_REQUIRE([AC_CANONICAL_HOST])dnl
-AC_REQUIRE([AC_CANONICAL_BUILD])dnl
-AC_MSG_CHECKING([how to convert $build file names to $host format])
-AC_CACHE_VAL(lt_cv_to_host_file_cmd,
-[case $host in
- *-*-mingw* )
- case $build in
- *-*-mingw* ) # actually msys
- lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
- ;;
- *-*-cygwin* )
- lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
- ;;
- * ) # otherwise, assume *nix
- lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
- ;;
- esac
- ;;
- *-*-cygwin* )
- case $build in
- *-*-mingw* ) # actually msys
- lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
- ;;
- *-*-cygwin* )
- lt_cv_to_host_file_cmd=func_convert_file_noop
- ;;
- * ) # otherwise, assume *nix
- lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
- ;;
- esac
- ;;
- * ) # unhandled hosts (and "normal" native builds)
- lt_cv_to_host_file_cmd=func_convert_file_noop
- ;;
-esac
-])
-to_host_file_cmd=$lt_cv_to_host_file_cmd
-AC_MSG_RESULT([$lt_cv_to_host_file_cmd])
-_LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd],
- [0], [convert $build file names to $host format])dnl
-
-AC_MSG_CHECKING([how to convert $build file names to toolchain format])
-AC_CACHE_VAL(lt_cv_to_tool_file_cmd,
-[#assume ordinary cross tools, or native build.
-lt_cv_to_tool_file_cmd=func_convert_file_noop
-case $host in
- *-*-mingw* )
- case $build in
- *-*-mingw* ) # actually msys
- lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
- ;;
- esac
- ;;
-esac
-])
-to_tool_file_cmd=$lt_cv_to_tool_file_cmd
-AC_MSG_RESULT([$lt_cv_to_tool_file_cmd])
-_LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd],
- [0], [convert $build files to toolchain format])dnl
-])# _LT_PATH_CONVERSION_FUNCTIONS
diff --git a/Modules/_ctypes/libffi/m4/ltoptions.m4 b/Modules/_ctypes/libffi/m4/ltoptions.m4
deleted file mode 100644
index 50c77236c6..0000000000
--- a/Modules/_ctypes/libffi/m4/ltoptions.m4
+++ /dev/null
@@ -1,382 +0,0 @@
-# Helper functions for option handling. -*- Autoconf -*-
-#
-# Copyright (C) 2004-2005, 2007-2009, 2011-2013 Free Software
-# Foundation, Inc.
-# Written by Gary V. Vaughan, 2004
-#
-# 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.
-
-# serial 8 ltoptions.m4
-
-# This is to help aclocal find these macros, as it can't see m4_define.
-AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
-
-
-# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
-# ------------------------------------------
-m4_define([_LT_MANGLE_OPTION],
-[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
-
-
-# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
-# ---------------------------------------
-# Set option OPTION-NAME for macro MACRO-NAME, and if there is a
-# matching handler defined, dispatch to it. Other OPTION-NAMEs are
-# saved as a flag.
-m4_define([_LT_SET_OPTION],
-[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
-m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
- _LT_MANGLE_DEFUN([$1], [$2]),
- [m4_warning([Unknown $1 option '$2'])])[]dnl
-])
-
-
-# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
-# ------------------------------------------------------------
-# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
-m4_define([_LT_IF_OPTION],
-[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
-
-
-# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
-# -------------------------------------------------------
-# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
-# are set.
-m4_define([_LT_UNLESS_OPTIONS],
-[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
- [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
- [m4_define([$0_found])])])[]dnl
-m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
-])[]dnl
-])
-
-
-# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
-# ----------------------------------------
-# OPTION-LIST is a space-separated list of Libtool options associated
-# with MACRO-NAME. If any OPTION has a matching handler declared with
-# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
-# the unknown option and exit.
-m4_defun([_LT_SET_OPTIONS],
-[# Set options
-m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
- [_LT_SET_OPTION([$1], _LT_Option)])
-
-m4_if([$1],[LT_INIT],[
- dnl
- dnl Simply set some default values (i.e off) if boolean options were not
- dnl specified:
- _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
- ])
- _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
- ])
- dnl
- dnl If no reference was made to various pairs of opposing options, then
- dnl we run the default mode handler for the pair. For example, if neither
- dnl 'shared' nor 'disable-shared' was passed, we enable building of shared
- dnl archives by default:
- _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
- _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
- _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
- _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
- [_LT_ENABLE_FAST_INSTALL])
- ])
-])# _LT_SET_OPTIONS
-
-
-## --------------------------------- ##
-## Macros to handle LT_INIT options. ##
-## --------------------------------- ##
-
-# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
-# -----------------------------------------
-m4_define([_LT_MANGLE_DEFUN],
-[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
-
-
-# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
-# -----------------------------------------------
-m4_define([LT_OPTION_DEFINE],
-[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
-])# LT_OPTION_DEFINE
-
-
-# dlopen
-# ------
-LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
-])
-
-AU_DEFUN([AC_LIBTOOL_DLOPEN],
-[_LT_SET_OPTION([LT_INIT], [dlopen])
-AC_DIAGNOSE([obsolete],
-[$0: Remove this warning and the call to _LT_SET_OPTION when you
-put the 'dlopen' option into LT_INIT's first parameter.])
-])
-
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
-
-
-# win32-dll
-# ---------
-# Declare package support for building win32 dll's.
-LT_OPTION_DEFINE([LT_INIT], [win32-dll],
-[enable_win32_dll=yes
-
-case $host in
-*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)
- AC_CHECK_TOOL(AS, as, false)
- AC_CHECK_TOOL(DLLTOOL, dlltool, false)
- AC_CHECK_TOOL(OBJDUMP, objdump, false)
- ;;
-esac
-
-test -z "$AS" && AS=as
-_LT_DECL([], [AS], [1], [Assembler program])dnl
-
-test -z "$DLLTOOL" && DLLTOOL=dlltool
-_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl
-
-test -z "$OBJDUMP" && OBJDUMP=objdump
-_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl
-])# win32-dll
-
-AU_DEFUN([AC_LIBTOOL_WIN32_DLL],
-[AC_REQUIRE([AC_CANONICAL_HOST])dnl
-_LT_SET_OPTION([LT_INIT], [win32-dll])
-AC_DIAGNOSE([obsolete],
-[$0: Remove this warning and the call to _LT_SET_OPTION when you
-put the 'win32-dll' option into LT_INIT's first parameter.])
-])
-
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
-
-
-# _LT_ENABLE_SHARED([DEFAULT])
-# ----------------------------
-# implement the --enable-shared flag, and supports the 'shared' and
-# 'disable-shared' LT_INIT options.
-# DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'.
-m4_define([_LT_ENABLE_SHARED],
-[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
-AC_ARG_ENABLE([shared],
- [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
- [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
- [p=${PACKAGE-default}
- case $enableval in
- yes) enable_shared=yes ;;
- no) enable_shared=no ;;
- *)
- enable_shared=no
- # Look at the argument we got. We use all the common list separators.
- lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
- for pkg in $enableval; do
- IFS=$lt_save_ifs
- if test "X$pkg" = "X$p"; then
- enable_shared=yes
- fi
- done
- IFS=$lt_save_ifs
- ;;
- esac],
- [enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
-
- _LT_DECL([build_libtool_libs], [enable_shared], [0],
- [Whether or not to build shared libraries])
-])# _LT_ENABLE_SHARED
-
-LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
-LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
-
-# Old names:
-AC_DEFUN([AC_ENABLE_SHARED],
-[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
-])
-
-AC_DEFUN([AC_DISABLE_SHARED],
-[_LT_SET_OPTION([LT_INIT], [disable-shared])
-])
-
-AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
-AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
-
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AM_ENABLE_SHARED], [])
-dnl AC_DEFUN([AM_DISABLE_SHARED], [])
-
-
-
-# _LT_ENABLE_STATIC([DEFAULT])
-# ----------------------------
-# implement the --enable-static flag, and support the 'static' and
-# 'disable-static' LT_INIT options.
-# DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'.
-m4_define([_LT_ENABLE_STATIC],
-[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
-AC_ARG_ENABLE([static],
- [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
- [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],
- [p=${PACKAGE-default}
- case $enableval in
- yes) enable_static=yes ;;
- no) enable_static=no ;;
- *)
- enable_static=no
- # Look at the argument we got. We use all the common list separators.
- lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
- for pkg in $enableval; do
- IFS=$lt_save_ifs
- if test "X$pkg" = "X$p"; then
- enable_static=yes
- fi
- done
- IFS=$lt_save_ifs
- ;;
- esac],
- [enable_static=]_LT_ENABLE_STATIC_DEFAULT)
-
- _LT_DECL([build_old_libs], [enable_static], [0],
- [Whether or not to build static libraries])
-])# _LT_ENABLE_STATIC
-
-LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])
-LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])
-
-# Old names:
-AC_DEFUN([AC_ENABLE_STATIC],
-[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])
-])
-
-AC_DEFUN([AC_DISABLE_STATIC],
-[_LT_SET_OPTION([LT_INIT], [disable-static])
-])
-
-AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
-AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
-
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AM_ENABLE_STATIC], [])
-dnl AC_DEFUN([AM_DISABLE_STATIC], [])
-
-
-
-# _LT_ENABLE_FAST_INSTALL([DEFAULT])
-# ----------------------------------
-# implement the --enable-fast-install flag, and support the 'fast-install'
-# and 'disable-fast-install' LT_INIT options.
-# DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'.
-m4_define([_LT_ENABLE_FAST_INSTALL],
-[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
-AC_ARG_ENABLE([fast-install],
- [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
- [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
- [p=${PACKAGE-default}
- case $enableval in
- yes) enable_fast_install=yes ;;
- no) enable_fast_install=no ;;
- *)
- enable_fast_install=no
- # Look at the argument we got. We use all the common list separators.
- lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
- for pkg in $enableval; do
- IFS=$lt_save_ifs
- if test "X$pkg" = "X$p"; then
- enable_fast_install=yes
- fi
- done
- IFS=$lt_save_ifs
- ;;
- esac],
- [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
-
-_LT_DECL([fast_install], [enable_fast_install], [0],
- [Whether or not to optimize for fast installation])dnl
-])# _LT_ENABLE_FAST_INSTALL
-
-LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])
-LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])
-
-# Old names:
-AU_DEFUN([AC_ENABLE_FAST_INSTALL],
-[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
-AC_DIAGNOSE([obsolete],
-[$0: Remove this warning and the call to _LT_SET_OPTION when you put
-the 'fast-install' option into LT_INIT's first parameter.])
-])
-
-AU_DEFUN([AC_DISABLE_FAST_INSTALL],
-[_LT_SET_OPTION([LT_INIT], [disable-fast-install])
-AC_DIAGNOSE([obsolete],
-[$0: Remove this warning and the call to _LT_SET_OPTION when you put
-the 'disable-fast-install' option into LT_INIT's first parameter.])
-])
-
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
-dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
-
-
-# _LT_WITH_PIC([MODE])
-# --------------------
-# implement the --with-pic flag, and support the 'pic-only' and 'no-pic'
-# LT_INIT options.
-# MODE is either 'yes' or 'no'. If omitted, it defaults to 'both'.
-m4_define([_LT_WITH_PIC],
-[AC_ARG_WITH([pic],
- [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@],
- [try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
- [lt_p=${PACKAGE-default}
- case $withval in
- yes|no) pic_mode=$withval ;;
- *)
- pic_mode=default
- # Look at the argument we got. We use all the common list separators.
- lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
- for lt_pkg in $withval; do
- IFS=$lt_save_ifs
- if test "X$lt_pkg" = "X$lt_p"; then
- pic_mode=yes
- fi
- done
- IFS=$lt_save_ifs
- ;;
- esac],
- [pic_mode=m4_default([$1], [default])])
-
-_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
-])# _LT_WITH_PIC
-
-LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
-LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
-
-# Old name:
-AU_DEFUN([AC_LIBTOOL_PICMODE],
-[_LT_SET_OPTION([LT_INIT], [pic-only])
-AC_DIAGNOSE([obsolete],
-[$0: Remove this warning and the call to _LT_SET_OPTION when you
-put the 'pic-only' option into LT_INIT's first parameter.])
-])
-
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
-
-## ----------------- ##
-## LTDL_INIT Options ##
-## ----------------- ##
-
-m4_define([_LTDL_MODE], [])
-LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],
- [m4_define([_LTDL_MODE], [nonrecursive])])
-LT_OPTION_DEFINE([LTDL_INIT], [recursive],
- [m4_define([_LTDL_MODE], [recursive])])
-LT_OPTION_DEFINE([LTDL_INIT], [subproject],
- [m4_define([_LTDL_MODE], [subproject])])
-
-m4_define([_LTDL_TYPE], [])
-LT_OPTION_DEFINE([LTDL_INIT], [installable],
- [m4_define([_LTDL_TYPE], [installable])])
-LT_OPTION_DEFINE([LTDL_INIT], [convenience],
- [m4_define([_LTDL_TYPE], [convenience])])
diff --git a/Modules/_ctypes/libffi/m4/ltsugar.m4 b/Modules/_ctypes/libffi/m4/ltsugar.m4
deleted file mode 100644
index 7cbc638b69..0000000000
--- a/Modules/_ctypes/libffi/m4/ltsugar.m4
+++ /dev/null
@@ -1,124 +0,0 @@
-# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*-
-#
-# Copyright (C) 2004-2005, 2007-2008, 2011-2013 Free Software
-# Foundation, Inc.
-# Written by Gary V. Vaughan, 2004
-#
-# 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.
-
-# serial 6 ltsugar.m4
-
-# This is to help aclocal find these macros, as it can't see m4_define.
-AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])
-
-
-# lt_join(SEP, ARG1, [ARG2...])
-# -----------------------------
-# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their
-# associated separator.
-# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier
-# versions in m4sugar had bugs.
-m4_define([lt_join],
-[m4_if([$#], [1], [],
- [$#], [2], [[$2]],
- [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])
-m4_define([_lt_join],
-[m4_if([$#$2], [2], [],
- [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])
-
-
-# lt_car(LIST)
-# lt_cdr(LIST)
-# ------------
-# Manipulate m4 lists.
-# These macros are necessary as long as will still need to support
-# Autoconf-2.59, which quotes differently.
-m4_define([lt_car], [[$1]])
-m4_define([lt_cdr],
-[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
- [$#], 1, [],
- [m4_dquote(m4_shift($@))])])
-m4_define([lt_unquote], $1)
-
-
-# lt_append(MACRO-NAME, STRING, [SEPARATOR])
-# ------------------------------------------
-# Redefine MACRO-NAME to hold its former content plus 'SEPARATOR''STRING'.
-# Note that neither SEPARATOR nor STRING are expanded; they are appended
-# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
-# No SEPARATOR is output if MACRO-NAME was previously undefined (different
-# than defined and empty).
-#
-# This macro is needed until we can rely on Autoconf 2.62, since earlier
-# versions of m4sugar mistakenly expanded SEPARATOR but not STRING.
-m4_define([lt_append],
-[m4_define([$1],
- m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])
-
-
-
-# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])
-# ----------------------------------------------------------
-# Produce a SEP delimited list of all paired combinations of elements of
-# PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list
-# has the form PREFIXmINFIXSUFFIXn.
-# Needed until we can rely on m4_combine added in Autoconf 2.62.
-m4_define([lt_combine],
-[m4_if(m4_eval([$# > 3]), [1],
- [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl
-[[m4_foreach([_Lt_prefix], [$2],
- [m4_foreach([_Lt_suffix],
- ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[,
- [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])])
-
-
-# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])
-# -----------------------------------------------------------------------
-# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited
-# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.
-m4_define([lt_if_append_uniq],
-[m4_ifdef([$1],
- [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],
- [lt_append([$1], [$2], [$3])$4],
- [$5])],
- [lt_append([$1], [$2], [$3])$4])])
-
-
-# lt_dict_add(DICT, KEY, VALUE)
-# -----------------------------
-m4_define([lt_dict_add],
-[m4_define([$1($2)], [$3])])
-
-
-# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)
-# --------------------------------------------
-m4_define([lt_dict_add_subkey],
-[m4_define([$1($2:$3)], [$4])])
-
-
-# lt_dict_fetch(DICT, KEY, [SUBKEY])
-# ----------------------------------
-m4_define([lt_dict_fetch],
-[m4_ifval([$3],
- m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),
- m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])
-
-
-# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])
-# -----------------------------------------------------------------
-m4_define([lt_if_dict_fetch],
-[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],
- [$5],
- [$6])])
-
-
-# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])
-# --------------------------------------------------------------
-m4_define([lt_dict_filter],
-[m4_if([$5], [], [],
- [lt_join(m4_quote(m4_default([$4], [[, ]])),
- lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),
- [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl
-])
diff --git a/Modules/_ctypes/libffi/m4/ltversion.m4 b/Modules/_ctypes/libffi/m4/ltversion.m4
deleted file mode 100644
index daeb0af7af..0000000000
--- a/Modules/_ctypes/libffi/m4/ltversion.m4
+++ /dev/null
@@ -1,23 +0,0 @@
-# ltversion.m4 -- version numbers -*- Autoconf -*-
-#
-# Copyright (C) 2004, 2011-2013 Free Software Foundation, Inc.
-# Written by Scott James Remnant, 2004
-#
-# 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.
-
-# @configure_input@
-
-# serial 4038 ltversion.m4
-# This file is part of GNU Libtool
-
-m4_define([LT_PACKAGE_VERSION], [2.4.2.418])
-m4_define([LT_PACKAGE_REVISION], [2.4.2.418])
-
-AC_DEFUN([LTVERSION_VERSION],
-[macro_version='2.4.2.418'
-macro_revision='2.4.2.418'
-_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
-_LT_DECL(, macro_revision, 0)
-])
diff --git a/Modules/_ctypes/libffi/m4/lt~obsolete.m4 b/Modules/_ctypes/libffi/m4/lt~obsolete.m4
deleted file mode 100644
index 59461e458c..0000000000
--- a/Modules/_ctypes/libffi/m4/lt~obsolete.m4
+++ /dev/null
@@ -1,99 +0,0 @@
-# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*-
-#
-# Copyright (C) 2004-2005, 2007, 2009, 2011-2013 Free Software
-# Foundation, Inc.
-# Written by Scott James Remnant, 2004.
-#
-# 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.
-
-# serial 5 lt~obsolete.m4
-
-# These exist entirely to fool aclocal when bootstrapping libtool.
-#
-# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN),
-# which have later been changed to m4_define as they aren't part of the
-# exported API, or moved to Autoconf or Automake where they belong.
-#
-# The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN
-# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us
-# using a macro with the same name in our local m4/libtool.m4 it'll
-# pull the old libtool.m4 in (it doesn't see our shiny new m4_define
-# and doesn't know about Autoconf macros at all.)
-#
-# So we provide this file, which has a silly filename so it's always
-# included after everything else. This provides aclocal with the
-# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
-# because those macros already exist, or will be overwritten later.
-# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6.
-#
-# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
-# Yes, that means every name once taken will need to remain here until
-# we give up compatibility with versions before 1.7, at which point
-# we need to keep only those names which we still refer to.
-
-# This is to help aclocal find these macros, as it can't see m4_define.
-AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])
-
-m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])
-m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])])
-m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])
-m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])])
-m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])
-m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])])
-m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])])
-m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])
-m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])])
-m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])])
-m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])])
-m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])
-m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])
-m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])
-m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])
-m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])])
-m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])])
-m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])
-m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])
-m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])])
-m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])])
-m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])
-m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])
-m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])
-m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])
-m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])
-m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])
-m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])
-m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])])
-m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])])
-m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])])
-m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])])
-m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])])
-m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])])
-m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])])
-m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])])
-m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])
-m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])])
-m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
-m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])])
-m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])])
-m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])])
-m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
-m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
-m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
-m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])
-m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])
-m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])
-m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])
-m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])
-m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
-m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
-m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])])
-m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
-m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])])
-m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])])
-m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])])
-m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])])
-m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])])
-m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])])
-m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])])
diff --git a/Modules/_ctypes/libffi/man/Makefile.am b/Modules/_ctypes/libffi/man/Makefile.am
deleted file mode 100644
index afcbfb69f1..0000000000
--- a/Modules/_ctypes/libffi/man/Makefile.am
+++ /dev/null
@@ -1,8 +0,0 @@
-## Process this with automake to create Makefile.in
-
-AUTOMAKE_OPTIONS=foreign
-
-EXTRA_DIST = ffi.3 ffi_call.3 ffi_prep_cif.3 ffi_prep_cif_var.3
-
-man_MANS = ffi.3 ffi_call.3 ffi_prep_cif.3 ffi_prep_cif_var.3
-
diff --git a/Modules/_ctypes/libffi/man/Makefile.in b/Modules/_ctypes/libffi/man/Makefile.in
deleted file mode 100644
index d92af74fb6..0000000000
--- a/Modules/_ctypes/libffi/man/Makefile.in
+++ /dev/null
@@ -1,541 +0,0 @@
-# Makefile.in generated by automake 1.13.4 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
-
-# This Makefile.in 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.
-
-@SET_MAKE@
-VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
-am__make_running_with_option = \
- case $${target_option-} in \
- ?) ;; \
- *) echo "am__make_running_with_option: internal error: invalid" \
- "target option '$${target_option-}' specified" >&2; \
- exit 1;; \
- esac; \
- has_opt=no; \
- sane_makeflags=$$MAKEFLAGS; \
- if $(am__is_gnu_make); then \
- sane_makeflags=$$MFLAGS; \
- else \
- case $$MAKEFLAGS in \
- *\\[\ \ ]*) \
- bs=\\; \
- sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
- | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
- esac; \
- fi; \
- skip_next=no; \
- strip_trailopt () \
- { \
- flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
- }; \
- for flg in $$sane_makeflags; do \
- test $$skip_next = yes && { skip_next=no; continue; }; \
- case $$flg in \
- *=*|--*) continue;; \
- -*I) strip_trailopt 'I'; skip_next=yes;; \
- -*I?*) strip_trailopt 'I';; \
- -*O) strip_trailopt 'O'; skip_next=yes;; \
- -*O?*) strip_trailopt 'O';; \
- -*l) strip_trailopt 'l'; skip_next=yes;; \
- -*l?*) strip_trailopt 'l';; \
- -[dEDm]) skip_next=yes;; \
- -[JT]) skip_next=yes;; \
- esac; \
- case $$flg in \
- *$$target_option*) has_opt=yes; break;; \
- esac; \
- done; \
- test $$has_opt = yes
-am__make_dryrun = (target_option=n; $(am__make_running_with_option))
-am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-target_triplet = @target@
-subdir = man
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/asmcfi.m4 \
- $(top_srcdir)/m4/ax_append_flag.m4 \
- $(top_srcdir)/m4/ax_cc_maxopt.m4 \
- $(top_srcdir)/m4/ax_cflags_warn_all.m4 \
- $(top_srcdir)/m4/ax_check_compile_flag.m4 \
- $(top_srcdir)/m4/ax_compiler_vendor.m4 \
- $(top_srcdir)/m4/ax_configure_args.m4 \
- $(top_srcdir)/m4/ax_enable_builddir.m4 \
- $(top_srcdir)/m4/ax_gcc_archflag.m4 \
- $(top_srcdir)/m4/ax_gcc_x86_cpuid.m4 \
- $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
- $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
- $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/acinclude.m4 \
- $(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
- $(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/fficonfig.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-AM_V_P = $(am__v_P_@AM_V@)
-am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
-am__v_P_0 = false
-am__v_P_1 = :
-AM_V_GEN = $(am__v_GEN_@AM_V@)
-am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
-am__v_GEN_0 = @echo " GEN " $@;
-am__v_GEN_1 =
-AM_V_at = $(am__v_at_@AM_V@)
-am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
-am__v_at_0 = @
-am__v_at_1 =
-SOURCES =
-DIST_SOURCES =
-am__can_run_installinfo = \
- case $$AM_UPDATE_INFO_DIR in \
- n|no|NO) false;; \
- *) (install-info --version) >/dev/null 2>&1;; \
- esac
-am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
-am__vpath_adj = case $$p in \
- $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
- *) f=$$p;; \
- esac;
-am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
-am__install_max = 40
-am__nobase_strip_setup = \
- srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
-am__nobase_strip = \
- for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
-am__nobase_list = $(am__nobase_strip_setup); \
- for p in $$list; do echo "$$p $$p"; done | \
- sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
- $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
- if (++n[$$2] == $(am__install_max)) \
- { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
- END { for (dir in files) print dir, files[dir] }'
-am__base_list = \
- sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
- sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
-am__uninstall_files_from_dir = { \
- test -z "$$files" \
- || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
- || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
- $(am__cd) "$$dir" && rm -f $$files; }; \
- }
-man3dir = $(mandir)/man3
-am__installdirs = "$(DESTDIR)$(man3dir)"
-NROFF = nroff
-MANS = $(man_MANS)
-am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = @ACLOCAL@
-ALLOCA = @ALLOCA@
-AMTAR = @AMTAR@
-AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
-AM_LTLDFLAGS = @AM_LTLDFLAGS@
-AM_RUNTESTFLAGS = @AM_RUNTESTFLAGS@
-AR = @AR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-CC = @CC@
-CCAS = @CCAS@
-CCASDEPMODE = @CCASDEPMODE@
-CCASFLAGS = @CCASFLAGS@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DLLTOOL = @DLLTOOL@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FFI_EXEC_TRAMPOLINE_TABLE = @FFI_EXEC_TRAMPOLINE_TABLE@
-FGREP = @FGREP@
-GREP = @GREP@
-HAVE_LONG_DOUBLE = @HAVE_LONG_DOUBLE@
-HAVE_LONG_DOUBLE_VARIANT = @HAVE_LONG_DOUBLE_VARIANT@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LTLIBOBJS = @LTLIBOBJS@
-MAINT = @MAINT@
-MAKEINFO = @MAKEINFO@
-MANIFEST_TOOL = @MANIFEST_TOOL@
-MKDIR_P = @MKDIR_P@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_URL = @PACKAGE_URL@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PRTDIAG = @PRTDIAG@
-RANLIB = @RANLIB@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-TARGET = @TARGET@
-TARGETDIR = @TARGETDIR@
-VERSION = @VERSION@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_AR = @ac_ct_AR@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-ax_enable_builddir_sed = @ax_enable_builddir_sed@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sys_symbol_underscore = @sys_symbol_underscore@
-sysconfdir = @sysconfdir@
-target = @target@
-target_alias = @target_alias@
-target_cpu = @target_cpu@
-target_os = @target_os@
-target_vendor = @target_vendor@
-toolexecdir = @toolexecdir@
-toolexeclibdir = @toolexeclibdir@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-AUTOMAKE_OPTIONS = foreign
-EXTRA_DIST = ffi.3 ffi_call.3 ffi_prep_cif.3 ffi_prep_cif_var.3
-man_MANS = ffi.3 ffi_call.3 ffi_prep_cif.3 ffi_prep_cif_var.3
-all: all-am
-
-.SUFFIXES:
-$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
- @for dep in $?; do \
- case '$(am__configure_deps)' in \
- *$$dep*) \
- ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
- && { if test -f $@; then exit 0; else break; fi; }; \
- exit 1;; \
- esac; \
- done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign man/Makefile'; \
- $(am__cd) $(top_srcdir) && \
- $(AUTOMAKE) --foreign man/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
- @case '$?' in \
- *config.status*) \
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
- *) \
- echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
- esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-
-mostlyclean-libtool:
- -rm -f *.lo
-
-clean-libtool:
- -rm -rf .libs _libs
-install-man3: $(man_MANS)
- @$(NORMAL_INSTALL)
- @list1=''; \
- list2='$(man_MANS)'; \
- test -n "$(man3dir)" \
- && test -n "`echo $$list1$$list2`" \
- || exit 0; \
- echo " $(MKDIR_P) '$(DESTDIR)$(man3dir)'"; \
- $(MKDIR_P) "$(DESTDIR)$(man3dir)" || exit 1; \
- { for i in $$list1; do echo "$$i"; done; \
- if test -n "$$list2"; then \
- for i in $$list2; do echo "$$i"; done \
- | sed -n '/\.3[a-z]*$$/p'; \
- fi; \
- } | while read p; do \
- if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
- echo "$$d$$p"; echo "$$p"; \
- done | \
- sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^3][0-9a-z]*$$,3,;x' \
- -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \
- sed 'N;N;s,\n, ,g' | { \
- list=; while read file base inst; do \
- if test "$$base" = "$$inst"; then list="$$list $$file"; else \
- echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man3dir)/$$inst'"; \
- $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man3dir)/$$inst" || exit $$?; \
- fi; \
- done; \
- for i in $$list; do echo "$$i"; done | $(am__base_list) | \
- while read files; do \
- test -z "$$files" || { \
- echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man3dir)'"; \
- $(INSTALL_DATA) $$files "$(DESTDIR)$(man3dir)" || exit $$?; }; \
- done; }
-
-uninstall-man3:
- @$(NORMAL_UNINSTALL)
- @list=''; test -n "$(man3dir)" || exit 0; \
- files=`{ for i in $$list; do echo "$$i"; done; \
- l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \
- sed -n '/\.3[a-z]*$$/p'; \
- } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^3][0-9a-z]*$$,3,;x' \
- -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
- dir='$(DESTDIR)$(man3dir)'; $(am__uninstall_files_from_dir)
-tags TAGS:
-
-ctags CTAGS:
-
-cscope cscopelist:
-
-
-distdir: $(DISTFILES)
- @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
- topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
- list='$(DISTFILES)'; \
- dist_files=`for file in $$list; do echo $$file; done | \
- sed -e "s|^$$srcdirstrip/||;t" \
- -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
- case $$dist_files in \
- */*) $(MKDIR_P) `echo "$$dist_files" | \
- sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
- sort -u` ;; \
- esac; \
- for file in $$dist_files; do \
- if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
- if test -d $$d/$$file; then \
- dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
- if test -d "$(distdir)/$$file"; then \
- find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
- fi; \
- if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
- cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
- find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
- fi; \
- cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
- else \
- test -f "$(distdir)/$$file" \
- || cp -p $$d/$$file "$(distdir)/$$file" \
- || exit 1; \
- fi; \
- done
-check-am: all-am
-check: check-am
-all-am: Makefile $(MANS)
-installdirs:
- for dir in "$(DESTDIR)$(man3dir)"; do \
- test -z "$$dir" || $(MKDIR_P) "$$dir"; \
- done
-install: install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
- @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
- if test -z '$(STRIP)'; then \
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- install; \
- else \
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
- fi
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
- -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
- -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
- @echo "This command is intended for maintainers to use"
- @echo "it deletes files that may require special tools to rebuild."
-clean: clean-am
-
-clean-am: clean-generic clean-libtool mostlyclean-am
-
-distclean: distclean-am
- -rm -f Makefile
-distclean-am: clean-am distclean-generic
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-html-am:
-
-info: info-am
-
-info-am:
-
-install-data-am: install-man
-
-install-dvi: install-dvi-am
-
-install-dvi-am:
-
-install-exec-am:
-
-install-html: install-html-am
-
-install-html-am:
-
-install-info: install-info-am
-
-install-info-am:
-
-install-man: install-man3
-
-install-pdf: install-pdf-am
-
-install-pdf-am:
-
-install-ps: install-ps-am
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
- -rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-generic mostlyclean-libtool
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am: uninstall-man
-
-uninstall-man: uninstall-man3
-
-.MAKE: install-am install-strip
-
-.PHONY: all all-am check check-am clean clean-generic clean-libtool \
- cscopelist-am ctags-am distclean distclean-generic \
- distclean-libtool distdir dvi dvi-am html html-am info info-am \
- install install-am install-data install-data-am install-dvi \
- install-dvi-am install-exec install-exec-am install-html \
- install-html-am install-info install-info-am install-man \
- install-man3 install-pdf install-pdf-am install-ps \
- install-ps-am install-strip installcheck installcheck-am \
- installdirs maintainer-clean maintainer-clean-generic \
- mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
- ps ps-am tags-am uninstall uninstall-am uninstall-man \
- uninstall-man3
-
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/Modules/_ctypes/libffi/man/ffi.3 b/Modules/_ctypes/libffi/man/ffi.3
deleted file mode 100644
index 1f1d3031c9..0000000000
--- a/Modules/_ctypes/libffi/man/ffi.3
+++ /dev/null
@@ -1,41 +0,0 @@
-.Dd February 15, 2008
-.Dt FFI 3
-.Sh NAME
-.Nm FFI
-.Nd Foreign Function Interface
-.Sh LIBRARY
-libffi, -lffi
-.Sh SYNOPSIS
-.In ffi.h
-.Ft ffi_status
-.Fo ffi_prep_cif
-.Fa "ffi_cif *cif"
-.Fa "ffi_abi abi"
-.Fa "unsigned int nargs"
-.Fa "ffi_type *rtype"
-.Fa "ffi_type **atypes"
-.Fc
-.Ft void
-.Fo ffi_prep_cif_var
-.Fa "ffi_cif *cif"
-.Fa "ffi_abi abi"
-.Fa "unsigned int nfixedargs"
-.Fa "unsigned int ntotalargs"
-.Fa "ffi_type *rtype"
-.Fa "ffi_type **atypes"
-.Fc
-.Ft void
-.Fo ffi_call
-.Fa "ffi_cif *cif"
-.Fa "void (*fn)(void)"
-.Fa "void *rvalue"
-.Fa "void **avalue"
-.Fc
-.Sh DESCRIPTION
-The foreign function interface provides a mechanism by which a function can
-generate a call to another function at runtime without requiring knowledge of
-the called function's interface at compile time.
-.Sh SEE ALSO
-.Xr ffi_prep_cif 3 ,
-.Xr ffi_prep_cif_var 3 ,
-.Xr ffi_call 3
diff --git a/Modules/_ctypes/libffi/man/ffi_call.3 b/Modules/_ctypes/libffi/man/ffi_call.3
deleted file mode 100644
index 5351513f90..0000000000
--- a/Modules/_ctypes/libffi/man/ffi_call.3
+++ /dev/null
@@ -1,103 +0,0 @@
-.Dd February 15, 2008
-.Dt ffi_call 3
-.Sh NAME
-.Nm ffi_call
-.Nd Invoke a foreign function.
-.Sh SYNOPSIS
-.In ffi.h
-.Ft void
-.Fo ffi_call
-.Fa "ffi_cif *cif"
-.Fa "void (*fn)(void)"
-.Fa "void *rvalue"
-.Fa "void **avalue"
-.Fc
-.Sh DESCRIPTION
-The
-.Nm ffi_call
-function provides a simple mechanism for invoking a function without
-requiring knowledge of the function's interface at compile time.
-.Fa fn
-is called with the values retrieved from the pointers in the
-.Fa avalue
-array. The return value from
-.Fa fn
-is placed in storage pointed to by
-.Fa rvalue .
-.Fa cif
-contains information describing the data types, sizes and alignments of the
-arguments to and return value from
-.Fa fn ,
-and must be initialized with
-.Nm ffi_prep_cif
-before it is used with
-.Nm ffi_call .
-.Pp
-.Fa rvalue
-must point to storage that is sizeof(ffi_arg) or larger for non-floating point
-types. For smaller-sized return value types, the
-.Nm ffi_arg
-or
-.Nm ffi_sarg
-integral type must be used to hold
-the return value.
-.Sh EXAMPLES
-.Bd -literal
-#include <ffi.h>
-#include <stdio.h>
-
-unsigned char
-foo(unsigned int, float);
-
-int
-main(int argc, const char **argv)
-{
- ffi_cif cif;
- ffi_type *arg_types[2];
- void *arg_values[2];
- ffi_status status;
-
- // Because the return value from foo() is smaller than sizeof(long), it
- // must be passed as ffi_arg or ffi_sarg.
- ffi_arg result;
-
- // Specify the data type of each argument. Available types are defined
- // in <ffi/ffi.h>.
- arg_types[0] = &ffi_type_uint;
- arg_types[1] = &ffi_type_float;
-
- // Prepare the ffi_cif structure.
- if ((status = ffi_prep_cif(&cif, FFI_DEFAULT_ABI,
- 2, &ffi_type_uint8, arg_types)) != FFI_OK)
- {
- // Handle the ffi_status error.
- }
-
- // Specify the values of each argument.
- unsigned int arg1 = 42;
- float arg2 = 5.1;
-
- arg_values[0] = &arg1;
- arg_values[1] = &arg2;
-
- // Invoke the function.
- ffi_call(&cif, FFI_FN(foo), &result, arg_values);
-
- // The ffi_arg 'result' now contains the unsigned char returned from foo(),
- // which can be accessed by a typecast.
- printf("result is %hhu", (unsigned char)result);
-
- return 0;
-}
-
-// The target function.
-unsigned char
-foo(unsigned int x, float y)
-{
- unsigned char result = x - y;
- return result;
-}
-.Ed
-.Sh SEE ALSO
-.Xr ffi 3 ,
-.Xr ffi_prep_cif 3
diff --git a/Modules/_ctypes/libffi/man/ffi_prep_cif.3 b/Modules/_ctypes/libffi/man/ffi_prep_cif.3
deleted file mode 100644
index ab2be8adc1..0000000000
--- a/Modules/_ctypes/libffi/man/ffi_prep_cif.3
+++ /dev/null
@@ -1,68 +0,0 @@
-.Dd February 15, 2008
-.Dt ffi_prep_cif 3
-.Sh NAME
-.Nm ffi_prep_cif
-.Nd Prepare a
-.Nm ffi_cif
-structure for use with
-.Nm ffi_call
-.
-.Sh SYNOPSIS
-.In ffi.h
-.Ft ffi_status
-.Fo ffi_prep_cif
-.Fa "ffi_cif *cif"
-.Fa "ffi_abi abi"
-.Fa "unsigned int nargs"
-.Fa "ffi_type *rtype"
-.Fa "ffi_type **atypes"
-.Fc
-.Sh DESCRIPTION
-The
-.Nm ffi_prep_cif
-function prepares a
-.Nm ffi_cif
-structure for use with
-.Nm ffi_call
-.
-.Fa abi
-specifies a set of calling conventions to use.
-.Fa atypes
-is an array of
-.Fa nargs
-pointers to
-.Nm ffi_type
-structs that describe the data type, size and alignment of each argument.
-.Fa rtype
-points to an
-.Nm ffi_type
-that describes the data type, size and alignment of the
-return value. Note that to call a variadic function
-.Nm ffi_prep_cif_var
-must be used instead.
-.Sh RETURN VALUES
-Upon successful completion,
-.Nm ffi_prep_cif
-returns
-.Nm FFI_OK .
-It will return
-.Nm FFI_BAD_TYPEDEF
-if
-.Fa cif
-is
-.Nm NULL
-or
-.Fa atypes
-or
-.Fa rtype
-is malformed. If
-.Fa abi
-does not refer to a valid ABI,
-.Nm FFI_BAD_ABI
-will be returned. Available ABIs are
-defined in
-.Nm <ffitarget.h> .
-.Sh SEE ALSO
-.Xr ffi 3 ,
-.Xr ffi_call 3 ,
-.Xr ffi_prep_cif_var 3
diff --git a/Modules/_ctypes/libffi/man/ffi_prep_cif_var.3 b/Modules/_ctypes/libffi/man/ffi_prep_cif_var.3
deleted file mode 100644
index 7e19d0b070..0000000000
--- a/Modules/_ctypes/libffi/man/ffi_prep_cif_var.3
+++ /dev/null
@@ -1,73 +0,0 @@
-.Dd January 25, 2011
-.Dt ffi_prep_cif_var 3
-.Sh NAME
-.Nm ffi_prep_cif_var
-.Nd Prepare a
-.Nm ffi_cif
-structure for use with
-.Nm ffi_call
-for variadic functions.
-.Sh SYNOPSIS
-.In ffi.h
-.Ft ffi_status
-.Fo ffi_prep_cif_var
-.Fa "ffi_cif *cif"
-.Fa "ffi_abi abi"
-.Fa "unsigned int nfixedargs"
-.Fa "unsigned int ntotalargs"
-.Fa "ffi_type *rtype"
-.Fa "ffi_type **atypes"
-.Fc
-.Sh DESCRIPTION
-The
-.Nm ffi_prep_cif_var
-function prepares a
-.Nm ffi_cif
-structure for use with
-.Nm ffi_call
-for variadic functions.
-.Fa abi
-specifies a set of calling conventions to use.
-.Fa atypes
-is an array of
-.Fa ntotalargs
-pointers to
-.Nm ffi_type
-structs that describe the data type, size and alignment of each argument.
-.Fa rtype
-points to an
-.Nm ffi_type
-that describes the data type, size and alignment of the
-return value.
-.Fa nfixedargs
-must contain the number of fixed (non-variadic) arguments.
-Note that to call a non-variadic function
-.Nm ffi_prep_cif
-must be used.
-.Sh RETURN VALUES
-Upon successful completion,
-.Nm ffi_prep_cif_var
-returns
-.Nm FFI_OK .
-It will return
-.Nm FFI_BAD_TYPEDEF
-if
-.Fa cif
-is
-.Nm NULL
-or
-.Fa atypes
-or
-.Fa rtype
-is malformed. If
-.Fa abi
-does not refer to a valid ABI,
-.Nm FFI_BAD_ABI
-will be returned. Available ABIs are
-defined in
-.Nm <ffitarget.h>
-.
-.Sh SEE ALSO
-.Xr ffi 3 ,
-.Xr ffi_call 3 ,
-.Xr ffi_prep_cif 3
diff --git a/Modules/_ctypes/libffi/mdate-sh b/Modules/_ctypes/libffi/mdate-sh
deleted file mode 100755
index b3719cf761..0000000000
--- a/Modules/_ctypes/libffi/mdate-sh
+++ /dev/null
@@ -1,224 +0,0 @@
-#!/bin/sh
-# Get modification time of a file or directory and pretty-print it.
-
-scriptversion=2010-08-21.06; # UTC
-
-# Copyright (C) 1995-2013 Free Software Foundation, Inc.
-# written by Ulrich Drepper <drepper@gnu.ai.mit.edu>, June 1995
-#
-# 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, 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, see <http://www.gnu.org/licenses/>.
-
-# 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.
-
-# This file is maintained in Automake, please report
-# bugs to <bug-automake@gnu.org> or send patches to
-# <automake-patches@gnu.org>.
-
-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
-fi
-
-case $1 in
- '')
- echo "$0: No file. Try '$0 --help' for more information." 1>&2
- exit 1;
- ;;
- -h | --h*)
- cat <<\EOF
-Usage: mdate-sh [--help] [--version] FILE
-
-Pretty-print the modification day of FILE, in the format:
-1 January 1970
-
-Report bugs to <bug-automake@gnu.org>.
-EOF
- exit $?
- ;;
- -v | --v*)
- echo "mdate-sh $scriptversion"
- exit $?
- ;;
-esac
-
-error ()
-{
- echo "$0: $1" >&2
- exit 1
-}
-
-
-# Prevent date giving response in another language.
-LANG=C
-export LANG
-LC_ALL=C
-export LC_ALL
-LC_TIME=C
-export LC_TIME
-
-# GNU ls changes its time format in response to the TIME_STYLE
-# variable. Since we cannot assume 'unset' works, revert this
-# variable to its documented default.
-if test "${TIME_STYLE+set}" = set; then
- TIME_STYLE=posix-long-iso
- export TIME_STYLE
-fi
-
-save_arg1=$1
-
-# Find out how to get the extended ls output of a file or directory.
-if ls -L /dev/null 1>/dev/null 2>&1; then
- ls_command='ls -L -l -d'
-else
- ls_command='ls -l -d'
-fi
-# Avoid user/group names that might have spaces, when possible.
-if ls -n /dev/null 1>/dev/null 2>&1; then
- ls_command="$ls_command -n"
-fi
-
-# A 'ls -l' line looks as follows on OS/2.
-# drwxrwx--- 0 Aug 11 2001 foo
-# This differs from Unix, which adds ownership information.
-# drwxrwx--- 2 root root 4096 Aug 11 2001 foo
-#
-# To find the date, we split the line on spaces and iterate on words
-# until we find a month. This cannot work with files whose owner is a
-# user named "Jan", or "Feb", etc. However, it's unlikely that '/'
-# will be owned by a user whose name is a month. So we first look at
-# the extended ls output of the root directory to decide how many
-# words should be skipped to get the date.
-
-# On HPUX /bin/sh, "set" interprets "-rw-r--r--" as options, so the "x" below.
-set x`$ls_command /`
-
-# Find which argument is the month.
-month=
-command=
-until test $month
-do
- test $# -gt 0 || error "failed parsing '$ls_command /' output"
- shift
- # Add another shift to the command.
- command="$command shift;"
- case $1 in
- Jan) month=January; nummonth=1;;
- Feb) month=February; nummonth=2;;
- Mar) month=March; nummonth=3;;
- Apr) month=April; nummonth=4;;
- May) month=May; nummonth=5;;
- Jun) month=June; nummonth=6;;
- Jul) month=July; nummonth=7;;
- Aug) month=August; nummonth=8;;
- Sep) month=September; nummonth=9;;
- Oct) month=October; nummonth=10;;
- Nov) month=November; nummonth=11;;
- Dec) month=December; nummonth=12;;
- esac
-done
-
-test -n "$month" || error "failed parsing '$ls_command /' output"
-
-# Get the extended ls output of the file or directory.
-set dummy x`eval "$ls_command \"\\\$save_arg1\""`
-
-# Remove all preceding arguments
-eval $command
-
-# Because of the dummy argument above, month is in $2.
-#
-# On a POSIX system, we should have
-#
-# $# = 5
-# $1 = file size
-# $2 = month
-# $3 = day
-# $4 = year or time
-# $5 = filename
-#
-# On Darwin 7.7.0 and 7.6.0, we have
-#
-# $# = 4
-# $1 = day
-# $2 = month
-# $3 = year or time
-# $4 = filename
-
-# Get the month.
-case $2 in
- Jan) month=January; nummonth=1;;
- Feb) month=February; nummonth=2;;
- Mar) month=March; nummonth=3;;
- Apr) month=April; nummonth=4;;
- May) month=May; nummonth=5;;
- Jun) month=June; nummonth=6;;
- Jul) month=July; nummonth=7;;
- Aug) month=August; nummonth=8;;
- Sep) month=September; nummonth=9;;
- Oct) month=October; nummonth=10;;
- Nov) month=November; nummonth=11;;
- Dec) month=December; nummonth=12;;
-esac
-
-case $3 in
- ???*) day=$1;;
- *) day=$3; shift;;
-esac
-
-# Here we have to deal with the problem that the ls output gives either
-# the time of day or the year.
-case $3 in
- *:*) set `date`; eval year=\$$#
- case $2 in
- Jan) nummonthtod=1;;
- Feb) nummonthtod=2;;
- Mar) nummonthtod=3;;
- Apr) nummonthtod=4;;
- May) nummonthtod=5;;
- Jun) nummonthtod=6;;
- Jul) nummonthtod=7;;
- Aug) nummonthtod=8;;
- Sep) nummonthtod=9;;
- Oct) nummonthtod=10;;
- Nov) nummonthtod=11;;
- Dec) nummonthtod=12;;
- esac
- # For the first six month of the year the time notation can also
- # be used for files modified in the last year.
- if (expr $nummonth \> $nummonthtod) > /dev/null;
- then
- year=`expr $year - 1`
- fi;;
- *) year=$3;;
-esac
-
-# The result.
-echo $day $month $year
-
-# Local Variables:
-# mode: shell-script
-# sh-indentation: 2
-# eval: (add-hook 'write-file-hooks 'time-stamp)
-# time-stamp-start: "scriptversion="
-# time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-time-zone: "UTC"
-# time-stamp-end: "; # UTC"
-# End:
diff --git a/Modules/_ctypes/libffi/missing b/Modules/_ctypes/libffi/missing
deleted file mode 100755
index cdea514931..0000000000
--- a/Modules/_ctypes/libffi/missing
+++ /dev/null
@@ -1,215 +0,0 @@
-#! /bin/sh
-# Common wrapper for a few potentially missing GNU programs.
-
-scriptversion=2012-06-26.16; # UTC
-
-# Copyright (C) 1996-2013 Free Software Foundation, Inc.
-# Originally written by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
-
-# 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, 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, see <http://www.gnu.org/licenses/>.
-
-# 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.
-
-if test $# -eq 0; then
- echo 1>&2 "Try '$0 --help' for more information"
- exit 1
-fi
-
-case $1 in
-
- --is-lightweight)
- # Used by our autoconf macros to check whether the available missing
- # script is modern enough.
- exit 0
- ;;
-
- --run)
- # Back-compat with the calling convention used by older automake.
- shift
- ;;
-
- -h|--h|--he|--hel|--help)
- echo "\
-$0 [OPTION]... PROGRAM [ARGUMENT]...
-
-Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due
-to PROGRAM being missing or too old.
-
-Options:
- -h, --help display this help and exit
- -v, --version output version information and exit
-
-Supported PROGRAM values:
- aclocal autoconf autoheader autom4te automake makeinfo
- bison yacc flex lex help2man
-
-Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and
-'g' are ignored when checking the name.
-
-Send bug reports to <bug-automake@gnu.org>."
- exit $?
- ;;
-
- -v|--v|--ve|--ver|--vers|--versi|--versio|--version)
- echo "missing $scriptversion (GNU Automake)"
- exit $?
- ;;
-
- -*)
- echo 1>&2 "$0: unknown '$1' option"
- echo 1>&2 "Try '$0 --help' for more information"
- exit 1
- ;;
-
-esac
-
-# Run the given program, remember its exit status.
-"$@"; st=$?
-
-# If it succeeded, we are done.
-test $st -eq 0 && exit 0
-
-# Also exit now if we it failed (or wasn't found), and '--version' was
-# passed; such an option is passed most likely to detect whether the
-# program is present and works.
-case $2 in --version|--help) exit $st;; esac
-
-# Exit code 63 means version mismatch. This often happens when the user
-# tries to use an ancient version of a tool on a file that requires a
-# minimum version.
-if test $st -eq 63; then
- msg="probably too old"
-elif test $st -eq 127; then
- # Program was missing.
- msg="missing on your system"
-else
- # Program was found and executed, but failed. Give up.
- exit $st
-fi
-
-perl_URL=http://www.perl.org/
-flex_URL=http://flex.sourceforge.net/
-gnu_software_URL=http://www.gnu.org/software
-
-program_details ()
-{
- case $1 in
- aclocal|automake)
- echo "The '$1' program is part of the GNU Automake package:"
- echo "<$gnu_software_URL/automake>"
- echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:"
- echo "<$gnu_software_URL/autoconf>"
- echo "<$gnu_software_URL/m4/>"
- echo "<$perl_URL>"
- ;;
- autoconf|autom4te|autoheader)
- echo "The '$1' program is part of the GNU Autoconf package:"
- echo "<$gnu_software_URL/autoconf/>"
- echo "It also requires GNU m4 and Perl in order to run:"
- echo "<$gnu_software_URL/m4/>"
- echo "<$perl_URL>"
- ;;
- esac
-}
-
-give_advice ()
-{
- # Normalize program name to check for.
- normalized_program=`echo "$1" | sed '
- s/^gnu-//; t
- s/^gnu//; t
- s/^g//; t'`
-
- printf '%s\n' "'$1' is $msg."
-
- configure_deps="'configure.ac' or m4 files included by 'configure.ac'"
- case $normalized_program in
- autoconf*)
- echo "You should only need it if you modified 'configure.ac',"
- echo "or m4 files included by it."
- program_details 'autoconf'
- ;;
- autoheader*)
- echo "You should only need it if you modified 'acconfig.h' or"
- echo "$configure_deps."
- program_details 'autoheader'
- ;;
- automake*)
- echo "You should only need it if you modified 'Makefile.am' or"
- echo "$configure_deps."
- program_details 'automake'
- ;;
- aclocal*)
- echo "You should only need it if you modified 'acinclude.m4' or"
- echo "$configure_deps."
- program_details 'aclocal'
- ;;
- autom4te*)
- echo "You might have modified some maintainer files that require"
- echo "the 'automa4te' program to be rebuilt."
- program_details 'autom4te'
- ;;
- bison*|yacc*)
- echo "You should only need it if you modified a '.y' file."
- echo "You may want to install the GNU Bison package:"
- echo "<$gnu_software_URL/bison/>"
- ;;
- lex*|flex*)
- echo "You should only need it if you modified a '.l' file."
- echo "You may want to install the Fast Lexical Analyzer package:"
- echo "<$flex_URL>"
- ;;
- help2man*)
- echo "You should only need it if you modified a dependency" \
- "of a man page."
- echo "You may want to install the GNU Help2man package:"
- echo "<$gnu_software_URL/help2man/>"
- ;;
- makeinfo*)
- echo "You should only need it if you modified a '.texi' file, or"
- echo "any other file indirectly affecting the aspect of the manual."
- echo "You might want to install the Texinfo package:"
- echo "<$gnu_software_URL/texinfo/>"
- echo "The spurious makeinfo call might also be the consequence of"
- echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might"
- echo "want to install GNU make:"
- echo "<$gnu_software_URL/make/>"
- ;;
- *)
- echo "You might have modified some files without having the proper"
- echo "tools for further handling them. Check the 'README' file, it"
- echo "often tells you about the needed prerequisites for installing"
- echo "this package. You may also peek at any GNU archive site, in"
- echo "case some other package contains this missing '$1' program."
- ;;
- esac
-}
-
-give_advice "$1" | sed -e '1s/^/WARNING: /' \
- -e '2,$s/^/ /' >&2
-
-# Propagate the correct exit status (expected to be 127 for a program
-# not found, 63 for a program that failed due to version mismatch).
-exit $st
-
-# Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
-# time-stamp-start: "scriptversion="
-# time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-time-zone: "UTC"
-# time-stamp-end: "; # UTC"
-# End:
diff --git a/Modules/_ctypes/libffi/msvcc.sh b/Modules/_ctypes/libffi/msvcc.sh
deleted file mode 100755
index 7440deb340..0000000000
--- a/Modules/_ctypes/libffi/msvcc.sh
+++ /dev/null
@@ -1,233 +0,0 @@
-#!/bin/sh
-
-# ***** BEGIN LICENSE BLOCK *****
-# Version: MPL 1.1/GPL 2.0/LGPL 2.1
-#
-# The contents of this file are subject to the Mozilla Public License Version
-# 1.1 (the "License"); you may not use this file except in compliance with
-# the License. You may obtain a copy of the License at
-# http://www.mozilla.org/MPL/
-#
-# Software distributed under the License is distributed on an "AS IS" basis,
-# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
-# for the specific language governing rights and limitations under the
-# License.
-#
-# The Original Code is the MSVC wrappificator.
-#
-# The Initial Developer of the Original Code is
-# Timothy Wall <twalljava@dev.java.net>.
-# Portions created by the Initial Developer are Copyright (C) 2009
-# the Initial Developer. All Rights Reserved.
-#
-# Contributor(s):
-# Daniel Witte <dwitte@mozilla.com>
-#
-# Alternatively, the contents of this file may be used under the terms of
-# either the GNU General Public License Version 2 or later (the "GPL"), or
-# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
-# in which case the provisions of the GPL or the LGPL are applicable instead
-# of those above. If you wish to allow use of your version of this file only
-# under the terms of either the GPL or the LGPL, and not to allow others to
-# use your version of this file under the terms of the MPL, indicate your
-# decision by deleting the provisions above and replace them with the notice
-# and other provisions required by the GPL or the LGPL. If you do not delete
-# the provisions above, a recipient may use your version of this file under
-# the terms of any one of the MPL, the GPL or the LGPL.
-#
-# ***** END LICENSE BLOCK *****
-
-#
-# GCC-compatible wrapper for cl.exe and ml.exe. Arguments are given in GCC
-# format and translated into something sensible for cl or ml.
-#
-
-args_orig=$@
-args="-nologo -W3"
-md=-MD
-cl="cl"
-ml="ml"
-safeseh="-safeseh"
-output=
-
-while [ $# -gt 0 ]
-do
- case $1
- in
- -fexceptions)
- # Don't enable exceptions for now.
- #args="$args -EHac"
- shift 1
- ;;
- -m32)
- shift 1
- ;;
- -m64)
- cl="cl" # "$MSVC/x86_amd64/cl"
- ml="ml64" # "$MSVC/x86_amd64/ml64"
- safeseh=
- shift 1
- ;;
- -O0)
- args="$args -Od"
- shift 1
- ;;
- -O*)
- # Runtime error checks (enabled by setting -RTC1 in the -DFFI_DEBUG
- # case below) are not compatible with optimization flags and will
- # cause the build to fail. Therefore, drop the optimization flag if
- # -DFFI_DEBUG is also set.
- case $args_orig in
- *-DFFI_DEBUG*)
- args="$args"
- ;;
- *)
- # The ax_cc_maxopt.m4 macro from the upstream autoconf-archive
- # project doesn't support MSVC and therefore ends up trying to
- # use -O3. Use the equivalent "max optimization" flag for MSVC
- # instead of erroring out.
- case $1 in
- -O3)
- args="$args -O2"
- ;;
- *)
- args="$args $1"
- ;;
- esac
- opt="true"
- ;;
- esac
- shift 1
- ;;
- -g)
- # Enable debug symbol generation.
- args="$args -Zi"
- shift 1
- ;;
- -DFFI_DEBUG)
- # Link against debug CRT and enable runtime error checks.
- args="$args -RTC1"
- defines="$defines $1"
- md=-MDd
- shift 1
- ;;
- -c)
- args="$args -c"
- args="$(echo $args | sed 's%/Fe%/Fo%g')"
- single="-c"
- shift 1
- ;;
- -D*=*)
- name="$(echo $1|sed 's/-D\([^=][^=]*\)=.*/\1/g')"
- value="$(echo $1|sed 's/-D[^=][^=]*=//g')"
- args="$args -D${name}='$value'"
- defines="$defines -D${name}='$value'"
- shift 1
- ;;
- -D*)
- args="$args $1"
- defines="$defines $1"
- shift 1
- ;;
- -I)
- args="$args -I$2"
- includes="$includes -I$2"
- shift 2
- ;;
- -I*)
- args="$args $1"
- includes="$includes $1"
- shift 1
- ;;
- -W|-Wextra)
- # TODO map extra warnings
- shift 1
- ;;
- -Wall)
- # -Wall on MSVC is overzealous, and we already build with -W3. Nothing
- # to do here.
- shift 1
- ;;
- -pedantic)
- # libffi tests -pedantic with -Wall, so drop it also.
- shift 1
- ;;
- -Werror)
- args="$args -WX"
- shift 1
- ;;
- -W*)
- # TODO map specific warnings
- shift 1
- ;;
- -S)
- args="$args -FAs"
- shift 1
- ;;
- -o)
- outdir="$(dirname $2)"
- base="$(basename $2|sed 's/\.[^.]*//g')"
- if [ -n "$single" ]; then
- output="-Fo$2"
- else
- output="-Fe$2"
- fi
- if [ -n "$assembly" ]; then
- args="$args $output"
- else
- args="$args $output -Fd$outdir/$base -Fp$outdir/$base -Fa$outdir/$base"
- fi
- shift 2
- ;;
- *.S)
- src=$1
- assembly="true"
- shift 1
- ;;
- *.c)
- args="$args $1"
- shift 1
- ;;
- *)
- # Assume it's an MSVC argument, and pass it through.
- args="$args $1"
- shift 1
- ;;
- esac
-done
-
-# If -Zi is specified, certain optimizations are implicitly disabled
-# by MSVC. Add back those optimizations if this is an optimized build.
-# NOTE: These arguments must come after all others.
-if [ -n "$opt" ]; then
- args="$args -link -OPT:REF -OPT:ICF -INCREMENTAL:NO"
-fi
-
-if [ -n "$assembly" ]; then
- if [ -z "$outdir" ]; then
- outdir="."
- fi
- ppsrc="$outdir/$(basename $src|sed 's/.S$/.asm/g')"
- echo "$cl -nologo -EP $includes $defines $src > $ppsrc"
- "$cl" -nologo -EP $includes $defines $src > $ppsrc || exit $?
- output="$(echo $output | sed 's%/F[dpa][^ ]*%%g')"
- args="-nologo $safeseh $single $output $ppsrc"
-
- echo "$ml $args"
- eval "\"$ml\" $args"
- result=$?
-
- # required to fix ml64 broken output?
- #mv *.obj $outdir
-else
- args="$md $args"
- echo "$cl $args"
- # Return an error code of 1 if an invalid command line parameter is passed
- # instead of just ignoring it.
- eval "(\"$cl\" $args 2>&1 1>&3 | \
- awk '{print \$0} /D9002/ {error=1} END{exit error}' >&2) 3>&1"
- result=$?
-fi
-
-exit $result
-
diff --git a/Modules/_ctypes/libffi/src/aarch64/ffi.c b/Modules/_ctypes/libffi/src/aarch64/ffi.c
deleted file mode 100644
index b807a2d381..0000000000
--- a/Modules/_ctypes/libffi/src/aarch64/ffi.c
+++ /dev/null
@@ -1,1168 +0,0 @@
-/* Copyright (c) 2009, 2010, 2011, 2012 ARM Ltd.
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-``Software''), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice shall be
-included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
-CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
-
-#include <stdio.h>
-
-#include <ffi.h>
-#include <ffi_common.h>
-
-#include <stdlib.h>
-
-/* Stack alignment requirement in bytes */
-#if defined (__APPLE__)
-#define AARCH64_STACK_ALIGN 1
-#else
-#define AARCH64_STACK_ALIGN 16
-#endif
-
-#define N_X_ARG_REG 8
-#define N_V_ARG_REG 8
-
-#define AARCH64_FFI_WITH_V (1 << AARCH64_FFI_WITH_V_BIT)
-
-union _d
-{
- UINT64 d;
- UINT32 s[2];
-};
-
-struct call_context
-{
- UINT64 x [AARCH64_N_XREG];
- struct
- {
- union _d d[2];
- } v [AARCH64_N_VREG];
-};
-
-#if defined (__clang__) && defined (__APPLE__)
-extern void
-sys_icache_invalidate (void *start, size_t len);
-#endif
-
-static inline void
-ffi_clear_cache (void *start, void *end)
-{
-#if defined (__clang__) && defined (__APPLE__)
- sys_icache_invalidate (start, (char *)end - (char *)start);
-#elif defined (__GNUC__)
- __builtin___clear_cache (start, end);
-#else
-#error "Missing builtin to flush instruction cache"
-#endif
-}
-
-static void *
-get_x_addr (struct call_context *context, unsigned n)
-{
- return &context->x[n];
-}
-
-static void *
-get_s_addr (struct call_context *context, unsigned n)
-{
-#if defined __AARCH64EB__
- return &context->v[n].d[1].s[1];
-#else
- return &context->v[n].d[0].s[0];
-#endif
-}
-
-static void *
-get_d_addr (struct call_context *context, unsigned n)
-{
-#if defined __AARCH64EB__
- return &context->v[n].d[1];
-#else
- return &context->v[n].d[0];
-#endif
-}
-
-static void *
-get_v_addr (struct call_context *context, unsigned n)
-{
- return &context->v[n];
-}
-
-/* Return the memory location at which a basic type would reside
- were it to have been stored in register n. */
-
-static void *
-get_basic_type_addr (unsigned short type, struct call_context *context,
- unsigned n)
-{
- switch (type)
- {
- case FFI_TYPE_FLOAT:
- return get_s_addr (context, n);
- case FFI_TYPE_DOUBLE:
- return get_d_addr (context, n);
-#if FFI_TYPE_DOUBLE != FFI_TYPE_LONGDOUBLE
- case FFI_TYPE_LONGDOUBLE:
- return get_v_addr (context, n);
-#endif
- case FFI_TYPE_UINT8:
- case FFI_TYPE_SINT8:
- case FFI_TYPE_UINT16:
- case FFI_TYPE_SINT16:
- case FFI_TYPE_UINT32:
- case FFI_TYPE_SINT32:
- case FFI_TYPE_INT:
- case FFI_TYPE_POINTER:
- case FFI_TYPE_UINT64:
- case FFI_TYPE_SINT64:
- return get_x_addr (context, n);
- case FFI_TYPE_VOID:
- return NULL;
- default:
- FFI_ASSERT (0);
- return NULL;
- }
-}
-
-/* Return the alignment width for each of the basic types. */
-
-static size_t
-get_basic_type_alignment (unsigned short type)
-{
- switch (type)
- {
- case FFI_TYPE_FLOAT:
- case FFI_TYPE_DOUBLE:
- return sizeof (UINT64);
-#if FFI_TYPE_DOUBLE != FFI_TYPE_LONGDOUBLE
- case FFI_TYPE_LONGDOUBLE:
- return sizeof (long double);
-#endif
- case FFI_TYPE_UINT8:
- case FFI_TYPE_SINT8:
-#if defined (__APPLE__)
- return sizeof (UINT8);
-#endif
- case FFI_TYPE_UINT16:
- case FFI_TYPE_SINT16:
-#if defined (__APPLE__)
- return sizeof (UINT16);
-#endif
- case FFI_TYPE_UINT32:
- case FFI_TYPE_INT:
- case FFI_TYPE_SINT32:
-#if defined (__APPLE__)
- return sizeof (UINT32);
-#endif
- case FFI_TYPE_POINTER:
- case FFI_TYPE_UINT64:
- case FFI_TYPE_SINT64:
- return sizeof (UINT64);
-
- default:
- FFI_ASSERT (0);
- return 0;
- }
-}
-
-/* Return the size in bytes for each of the basic types. */
-
-static size_t
-get_basic_type_size (unsigned short type)
-{
- switch (type)
- {
- case FFI_TYPE_FLOAT:
- return sizeof (UINT32);
- case FFI_TYPE_DOUBLE:
- return sizeof (UINT64);
-#if FFI_TYPE_DOUBLE != FFI_TYPE_LONGDOUBLE
- case FFI_TYPE_LONGDOUBLE:
- return sizeof (long double);
-#endif
- case FFI_TYPE_UINT8:
- return sizeof (UINT8);
- case FFI_TYPE_SINT8:
- return sizeof (SINT8);
- case FFI_TYPE_UINT16:
- return sizeof (UINT16);
- case FFI_TYPE_SINT16:
- return sizeof (SINT16);
- case FFI_TYPE_UINT32:
- return sizeof (UINT32);
- case FFI_TYPE_INT:
- case FFI_TYPE_SINT32:
- return sizeof (SINT32);
- case FFI_TYPE_POINTER:
- case FFI_TYPE_UINT64:
- return sizeof (UINT64);
- case FFI_TYPE_SINT64:
- return sizeof (SINT64);
-
- default:
- FFI_ASSERT (0);
- return 0;
- }
-}
-
-extern void
-ffi_call_SYSV (unsigned (*)(struct call_context *context, unsigned char *,
- extended_cif *),
- struct call_context *context,
- extended_cif *,
- size_t,
- void (*fn)(void));
-
-extern void
-ffi_closure_SYSV (ffi_closure *);
-
-/* Test for an FFI floating point representation. */
-
-static unsigned
-is_floating_type (unsigned short type)
-{
- return (type == FFI_TYPE_FLOAT || type == FFI_TYPE_DOUBLE
- || type == FFI_TYPE_LONGDOUBLE);
-}
-
-/* Test for a homogeneous structure. */
-
-static unsigned short
-get_homogeneous_type (ffi_type *ty)
-{
- if (ty->type == FFI_TYPE_STRUCT && ty->elements)
- {
- unsigned i;
- unsigned short candidate_type
- = get_homogeneous_type (ty->elements[0]);
- for (i =1; ty->elements[i]; i++)
- {
- unsigned short iteration_type = 0;
- /* If we have a nested struct, we must find its homogeneous type.
- If that fits with our candidate type, we are still
- homogeneous. */
- if (ty->elements[i]->type == FFI_TYPE_STRUCT
- && ty->elements[i]->elements)
- {
- iteration_type = get_homogeneous_type (ty->elements[i]);
- }
- else
- {
- iteration_type = ty->elements[i]->type;
- }
-
- /* If we are not homogeneous, return FFI_TYPE_STRUCT. */
- if (candidate_type != iteration_type)
- return FFI_TYPE_STRUCT;
- }
- return candidate_type;
- }
-
- /* Base case, we have no more levels of nesting, so we
- are a basic type, and so, trivially homogeneous in that type. */
- return ty->type;
-}
-
-/* Determine the number of elements within a STRUCT.
-
- Note, we must handle nested structs.
-
- If ty is not a STRUCT this function will return 0. */
-
-static unsigned
-element_count (ffi_type *ty)
-{
- if (ty->type == FFI_TYPE_STRUCT && ty->elements)
- {
- unsigned n;
- unsigned elems = 0;
- for (n = 0; ty->elements[n]; n++)
- {
- if (ty->elements[n]->type == FFI_TYPE_STRUCT
- && ty->elements[n]->elements)
- elems += element_count (ty->elements[n]);
- else
- elems++;
- }
- return elems;
- }
- return 0;
-}
-
-/* Test for a homogeneous floating point aggregate.
-
- A homogeneous floating point aggregate is a homogeneous aggregate of
- a half- single- or double- precision floating point type with one
- to four elements. Note that this includes nested structs of the
- basic type. */
-
-static int
-is_hfa (ffi_type *ty)
-{
- if (ty->type == FFI_TYPE_STRUCT
- && ty->elements[0]
- && is_floating_type (get_homogeneous_type (ty)))
- {
- unsigned n = element_count (ty);
- return n >= 1 && n <= 4;
- }
- return 0;
-}
-
-/* Test if an ffi_type is a candidate for passing in a register.
-
- This test does not check that sufficient registers of the
- appropriate class are actually available, merely that IFF
- sufficient registers are available then the argument will be passed
- in register(s).
-
- Note that an ffi_type that is deemed to be a register candidate
- will always be returned in registers.
-
- Returns 1 if a register candidate else 0. */
-
-static int
-is_register_candidate (ffi_type *ty)
-{
- switch (ty->type)
- {
- case FFI_TYPE_VOID:
- case FFI_TYPE_FLOAT:
- case FFI_TYPE_DOUBLE:
-#if FFI_TYPE_DOUBLE != FFI_TYPE_LONGDOUBLE
- case FFI_TYPE_LONGDOUBLE:
-#endif
- case FFI_TYPE_UINT8:
- case FFI_TYPE_UINT16:
- case FFI_TYPE_UINT32:
- case FFI_TYPE_UINT64:
- case FFI_TYPE_POINTER:
- case FFI_TYPE_SINT8:
- case FFI_TYPE_SINT16:
- case FFI_TYPE_SINT32:
- case FFI_TYPE_INT:
- case FFI_TYPE_SINT64:
- return 1;
-
- case FFI_TYPE_STRUCT:
- if (is_hfa (ty))
- {
- return 1;
- }
- else if (ty->size > 16)
- {
- /* Too large. Will be replaced with a pointer to memory. The
- pointer MAY be passed in a register, but the value will
- not. This test specifically fails since the argument will
- never be passed by value in registers. */
- return 0;
- }
- else
- {
- /* Might be passed in registers depending on the number of
- registers required. */
- return (ty->size + 7) / 8 < N_X_ARG_REG;
- }
- break;
-
- default:
- FFI_ASSERT (0);
- break;
- }
-
- return 0;
-}
-
-/* Test if an ffi_type argument or result is a candidate for a vector
- register. */
-
-static int
-is_v_register_candidate (ffi_type *ty)
-{
- return is_floating_type (ty->type)
- || (ty->type == FFI_TYPE_STRUCT && is_hfa (ty));
-}
-
-/* Representation of the procedure call argument marshalling
- state.
-
- The terse state variable names match the names used in the AARCH64
- PCS. */
-
-struct arg_state
-{
- unsigned ngrn; /* Next general-purpose register number. */
- unsigned nsrn; /* Next vector register number. */
- size_t nsaa; /* Next stack offset. */
-
-#if defined (__APPLE__)
- unsigned allocating_variadic;
-#endif
-};
-
-/* Initialize a procedure call argument marshalling state. */
-static void
-arg_init (struct arg_state *state, size_t call_frame_size)
-{
- state->ngrn = 0;
- state->nsrn = 0;
- state->nsaa = 0;
-
-#if defined (__APPLE__)
- state->allocating_variadic = 0;
-#endif
-}
-
-/* Return the number of available consecutive core argument
- registers. */
-
-static unsigned
-available_x (struct arg_state *state)
-{
- return N_X_ARG_REG - state->ngrn;
-}
-
-/* Return the number of available consecutive vector argument
- registers. */
-
-static unsigned
-available_v (struct arg_state *state)
-{
- return N_V_ARG_REG - state->nsrn;
-}
-
-static void *
-allocate_to_x (struct call_context *context, struct arg_state *state)
-{
- FFI_ASSERT (state->ngrn < N_X_ARG_REG);
- return get_x_addr (context, (state->ngrn)++);
-}
-
-static void *
-allocate_to_s (struct call_context *context, struct arg_state *state)
-{
- FFI_ASSERT (state->nsrn < N_V_ARG_REG);
- return get_s_addr (context, (state->nsrn)++);
-}
-
-static void *
-allocate_to_d (struct call_context *context, struct arg_state *state)
-{
- FFI_ASSERT (state->nsrn < N_V_ARG_REG);
- return get_d_addr (context, (state->nsrn)++);
-}
-
-static void *
-allocate_to_v (struct call_context *context, struct arg_state *state)
-{
- FFI_ASSERT (state->nsrn < N_V_ARG_REG);
- return get_v_addr (context, (state->nsrn)++);
-}
-
-/* Allocate an aligned slot on the stack and return a pointer to it. */
-static void *
-allocate_to_stack (struct arg_state *state, void *stack, size_t alignment,
- size_t size)
-{
- void *allocation;
-
- /* Round up the NSAA to the larger of 8 or the natural
- alignment of the argument's type. */
- state->nsaa = ALIGN (state->nsaa, alignment);
- state->nsaa = ALIGN (state->nsaa, alignment);
-#if defined (__APPLE__)
- if (state->allocating_variadic)
- state->nsaa = ALIGN (state->nsaa, 8);
-#else
- state->nsaa = ALIGN (state->nsaa, 8);
-#endif
-
- allocation = stack + state->nsaa;
-
- state->nsaa += size;
- return allocation;
-}
-
-static void
-copy_basic_type (void *dest, void *source, unsigned short type)
-{
- /* This is necessary to ensure that basic types are copied
- sign extended to 64-bits as libffi expects. */
- switch (type)
- {
- case FFI_TYPE_FLOAT:
- *(float *) dest = *(float *) source;
- break;
- case FFI_TYPE_DOUBLE:
- *(double *) dest = *(double *) source;
- break;
-#if FFI_TYPE_DOUBLE != FFI_TYPE_LONGDOUBLE
- case FFI_TYPE_LONGDOUBLE:
- *(long double *) dest = *(long double *) source;
- break;
-#endif
- case FFI_TYPE_UINT8:
- *(ffi_arg *) dest = *(UINT8 *) source;
- break;
- case FFI_TYPE_SINT8:
- *(ffi_sarg *) dest = *(SINT8 *) source;
- break;
- case FFI_TYPE_UINT16:
- *(ffi_arg *) dest = *(UINT16 *) source;
- break;
- case FFI_TYPE_SINT16:
- *(ffi_sarg *) dest = *(SINT16 *) source;
- break;
- case FFI_TYPE_UINT32:
- *(ffi_arg *) dest = *(UINT32 *) source;
- break;
- case FFI_TYPE_INT:
- case FFI_TYPE_SINT32:
- *(ffi_sarg *) dest = *(SINT32 *) source;
- break;
- case FFI_TYPE_POINTER:
- case FFI_TYPE_UINT64:
- *(ffi_arg *) dest = *(UINT64 *) source;
- break;
- case FFI_TYPE_SINT64:
- *(ffi_sarg *) dest = *(SINT64 *) source;
- break;
- case FFI_TYPE_VOID:
- break;
-
- default:
- FFI_ASSERT (0);
- }
-}
-
-static void
-copy_hfa_to_reg_or_stack (void *memory,
- ffi_type *ty,
- struct call_context *context,
- unsigned char *stack,
- struct arg_state *state)
-{
- unsigned elems = element_count (ty);
- if (available_v (state) < elems)
- {
- /* There are insufficient V registers. Further V register allocations
- are prevented, the NSAA is adjusted (by allocate_to_stack ())
- and the argument is copied to memory at the adjusted NSAA. */
- state->nsrn = N_V_ARG_REG;
- memcpy (allocate_to_stack (state, stack, ty->alignment, ty->size),
- memory,
- ty->size);
- }
- else
- {
- int i;
- unsigned short type = get_homogeneous_type (ty);
- for (i = 0; i < elems; i++)
- {
- void *reg = allocate_to_v (context, state);
- copy_basic_type (reg, memory, type);
- memory += get_basic_type_size (type);
- }
- }
-}
-
-/* Either allocate an appropriate register for the argument type, or if
- none are available, allocate a stack slot and return a pointer
- to the allocated space. */
-
-static void *
-allocate_to_register_or_stack (struct call_context *context,
- unsigned char *stack,
- struct arg_state *state,
- unsigned short type)
-{
- size_t alignment = get_basic_type_alignment (type);
- size_t size = alignment;
- switch (type)
- {
- case FFI_TYPE_FLOAT:
- /* This is the only case for which the allocated stack size
- should not match the alignment of the type. */
- size = sizeof (UINT32);
- /* Fall through. */
- case FFI_TYPE_DOUBLE:
- if (state->nsrn < N_V_ARG_REG)
- return allocate_to_d (context, state);
- state->nsrn = N_V_ARG_REG;
- break;
-#if FFI_TYPE_DOUBLE != FFI_TYPE_LONGDOUBLE
- case FFI_TYPE_LONGDOUBLE:
- if (state->nsrn < N_V_ARG_REG)
- return allocate_to_v (context, state);
- state->nsrn = N_V_ARG_REG;
- break;
-#endif
- case FFI_TYPE_UINT8:
- case FFI_TYPE_SINT8:
- case FFI_TYPE_UINT16:
- case FFI_TYPE_SINT16:
- case FFI_TYPE_UINT32:
- case FFI_TYPE_SINT32:
- case FFI_TYPE_INT:
- case FFI_TYPE_POINTER:
- case FFI_TYPE_UINT64:
- case FFI_TYPE_SINT64:
- if (state->ngrn < N_X_ARG_REG)
- return allocate_to_x (context, state);
- state->ngrn = N_X_ARG_REG;
- break;
- default:
- FFI_ASSERT (0);
- }
-
- return allocate_to_stack (state, stack, alignment, size);
-}
-
-/* Copy a value to an appropriate register, or if none are
- available, to the stack. */
-
-static void
-copy_to_register_or_stack (struct call_context *context,
- unsigned char *stack,
- struct arg_state *state,
- void *value,
- unsigned short type)
-{
- copy_basic_type (
- allocate_to_register_or_stack (context, stack, state, type),
- value,
- type);
-}
-
-/* Marshall the arguments from FFI representation to procedure call
- context and stack. */
-
-static unsigned
-aarch64_prep_args (struct call_context *context, unsigned char *stack,
- extended_cif *ecif)
-{
- int i;
- struct arg_state state;
-
- arg_init (&state, ALIGN(ecif->cif->bytes, 16));
-
- for (i = 0; i < ecif->cif->nargs; i++)
- {
- ffi_type *ty = ecif->cif->arg_types[i];
- switch (ty->type)
- {
- case FFI_TYPE_VOID:
- FFI_ASSERT (0);
- break;
-
- /* If the argument is a basic type the argument is allocated to an
- appropriate register, or if none are available, to the stack. */
- case FFI_TYPE_FLOAT:
- case FFI_TYPE_DOUBLE:
-#if FFI_TYPE_DOUBLE != FFI_TYPE_LONGDOUBLE
- case FFI_TYPE_LONGDOUBLE:
-#endif
- case FFI_TYPE_UINT8:
- case FFI_TYPE_SINT8:
- case FFI_TYPE_UINT16:
- case FFI_TYPE_SINT16:
- case FFI_TYPE_UINT32:
- case FFI_TYPE_INT:
- case FFI_TYPE_SINT32:
- case FFI_TYPE_POINTER:
- case FFI_TYPE_UINT64:
- case FFI_TYPE_SINT64:
- copy_to_register_or_stack (context, stack, &state,
- ecif->avalue[i], ty->type);
- break;
-
- case FFI_TYPE_STRUCT:
- if (is_hfa (ty))
- {
- copy_hfa_to_reg_or_stack (ecif->avalue[i], ty, context,
- stack, &state);
- }
- else if (ty->size > 16)
- {
- /* If the argument is a composite type that is larger than 16
- bytes, then the argument has been copied to memory, and
- the argument is replaced by a pointer to the copy. */
-
- copy_to_register_or_stack (context, stack, &state,
- &(ecif->avalue[i]), FFI_TYPE_POINTER);
- }
- else if (available_x (&state) >= (ty->size + 7) / 8)
- {
- /* If the argument is a composite type and the size in
- double-words is not more than the number of available
- X registers, then the argument is copied into consecutive
- X registers. */
- int j;
- for (j = 0; j < (ty->size + 7) / 8; j++)
- {
- memcpy (allocate_to_x (context, &state),
- &(((UINT64 *) ecif->avalue[i])[j]),
- sizeof (UINT64));
- }
- }
- else
- {
- /* Otherwise, there are insufficient X registers. Further X
- register allocations are prevented, the NSAA is adjusted
- (by allocate_to_stack ()) and the argument is copied to
- memory at the adjusted NSAA. */
- state.ngrn = N_X_ARG_REG;
-
- memcpy (allocate_to_stack (&state, stack, ty->alignment,
- ty->size), ecif->avalue + i, ty->size);
- }
- break;
-
- default:
- FFI_ASSERT (0);
- break;
- }
-
-#if defined (__APPLE__)
- if (i + 1 == ecif->cif->aarch64_nfixedargs)
- {
- state.ngrn = N_X_ARG_REG;
- state.nsrn = N_V_ARG_REG;
-
- state.allocating_variadic = 1;
- }
-#endif
- }
-
- return ecif->cif->aarch64_flags;
-}
-
-ffi_status
-ffi_prep_cif_machdep (ffi_cif *cif)
-{
- /* Round the stack up to a multiple of the stack alignment requirement. */
- cif->bytes =
- (cif->bytes + (AARCH64_STACK_ALIGN - 1)) & ~ (AARCH64_STACK_ALIGN - 1);
-
- /* Initialize our flags. We are interested if this CIF will touch a
- vector register, if so we will enable context save and load to
- those registers, otherwise not. This is intended to be friendly
- to lazy float context switching in the kernel. */
- cif->aarch64_flags = 0;
-
- if (is_v_register_candidate (cif->rtype))
- {
- cif->aarch64_flags |= AARCH64_FFI_WITH_V;
- }
- else
- {
- int i;
- for (i = 0; i < cif->nargs; i++)
- if (is_v_register_candidate (cif->arg_types[i]))
- {
- cif->aarch64_flags |= AARCH64_FFI_WITH_V;
- break;
- }
- }
-
- return FFI_OK;
-}
-
-#if defined (__APPLE__)
-
-/* Perform Apple-specific cif processing for variadic calls */
-ffi_status ffi_prep_cif_machdep_var(ffi_cif *cif,
- unsigned int nfixedargs,
- unsigned int ntotalargs)
-{
- cif->aarch64_nfixedargs = nfixedargs;
-
- return ffi_prep_cif_machdep(cif);
-}
-
-#endif
-
-/* Call a function with the provided arguments and capture the return
- value. */
-void
-ffi_call (ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue)
-{
- extended_cif ecif;
-
- ecif.cif = cif;
- ecif.avalue = avalue;
- ecif.rvalue = rvalue;
-
- switch (cif->abi)
- {
- case FFI_SYSV:
- {
- struct call_context context;
- size_t stack_bytes;
-
- /* Figure out the total amount of stack space we need, the
- above call frame space needs to be 16 bytes aligned to
- ensure correct alignment of the first object inserted in
- that space hence the ALIGN applied to cif->bytes.*/
- stack_bytes = ALIGN(cif->bytes, 16);
-
- memset (&context, 0, sizeof (context));
- if (is_register_candidate (cif->rtype))
- {
- ffi_call_SYSV (aarch64_prep_args, &context, &ecif, stack_bytes, fn);
- switch (cif->rtype->type)
- {
- case FFI_TYPE_VOID:
- case FFI_TYPE_FLOAT:
- case FFI_TYPE_DOUBLE:
-#if FFI_TYPE_DOUBLE != FFI_TYPE_LONGDOUBLE
- case FFI_TYPE_LONGDOUBLE:
-#endif
- case FFI_TYPE_UINT8:
- case FFI_TYPE_SINT8:
- case FFI_TYPE_UINT16:
- case FFI_TYPE_SINT16:
- case FFI_TYPE_UINT32:
- case FFI_TYPE_SINT32:
- case FFI_TYPE_POINTER:
- case FFI_TYPE_UINT64:
- case FFI_TYPE_INT:
- case FFI_TYPE_SINT64:
- {
- void *addr = get_basic_type_addr (cif->rtype->type,
- &context, 0);
- copy_basic_type (rvalue, addr, cif->rtype->type);
- break;
- }
-
- case FFI_TYPE_STRUCT:
- if (is_hfa (cif->rtype))
- {
- int j;
- unsigned short type = get_homogeneous_type (cif->rtype);
- unsigned elems = element_count (cif->rtype);
- for (j = 0; j < elems; j++)
- {
- void *reg = get_basic_type_addr (type, &context, j);
- copy_basic_type (rvalue, reg, type);
- rvalue += get_basic_type_size (type);
- }
- }
- else if ((cif->rtype->size + 7) / 8 < N_X_ARG_REG)
- {
- size_t size = ALIGN (cif->rtype->size, sizeof (UINT64));
- memcpy (rvalue, get_x_addr (&context, 0), size);
- }
- else
- {
- FFI_ASSERT (0);
- }
- break;
-
- default:
- FFI_ASSERT (0);
- break;
- }
- }
- else
- {
- memcpy (get_x_addr (&context, 8), &rvalue, sizeof (UINT64));
- ffi_call_SYSV (aarch64_prep_args, &context, &ecif,
- stack_bytes, fn);
- }
- break;
- }
-
- default:
- FFI_ASSERT (0);
- break;
- }
-}
-
-static unsigned char trampoline [] =
-{ 0x70, 0x00, 0x00, 0x58, /* ldr x16, 1f */
- 0x91, 0x00, 0x00, 0x10, /* adr x17, 2f */
- 0x00, 0x02, 0x1f, 0xd6 /* br x16 */
-};
-
-/* Build a trampoline. */
-
-#define FFI_INIT_TRAMPOLINE(TRAMP,FUN,CTX,FLAGS) \
- ({unsigned char *__tramp = (unsigned char*)(TRAMP); \
- UINT64 __fun = (UINT64)(FUN); \
- UINT64 __ctx = (UINT64)(CTX); \
- UINT64 __flags = (UINT64)(FLAGS); \
- memcpy (__tramp, trampoline, sizeof (trampoline)); \
- memcpy (__tramp + 12, &__fun, sizeof (__fun)); \
- memcpy (__tramp + 20, &__ctx, sizeof (__ctx)); \
- memcpy (__tramp + 28, &__flags, sizeof (__flags)); \
- ffi_clear_cache(__tramp, __tramp + FFI_TRAMPOLINE_SIZE); \
- })
-
-ffi_status
-ffi_prep_closure_loc (ffi_closure* closure,
- ffi_cif* cif,
- void (*fun)(ffi_cif*,void*,void**,void*),
- void *user_data,
- void *codeloc)
-{
- if (cif->abi != FFI_SYSV)
- return FFI_BAD_ABI;
-
- FFI_INIT_TRAMPOLINE (&closure->tramp[0], &ffi_closure_SYSV, codeloc,
- cif->aarch64_flags);
-
- closure->cif = cif;
- closure->user_data = user_data;
- closure->fun = fun;
-
- return FFI_OK;
-}
-
-/* Primary handler to setup and invoke a function within a closure.
-
- A closure when invoked enters via the assembler wrapper
- ffi_closure_SYSV(). The wrapper allocates a call context on the
- stack, saves the interesting registers (from the perspective of
- the calling convention) into the context then passes control to
- ffi_closure_SYSV_inner() passing the saved context and a pointer to
- the stack at the point ffi_closure_SYSV() was invoked.
-
- On the return path the assembler wrapper will reload call context
- registers.
-
- ffi_closure_SYSV_inner() marshalls the call context into ffi value
- descriptors, invokes the wrapped function, then marshalls the return
- value back into the call context. */
-
-void FFI_HIDDEN
-ffi_closure_SYSV_inner (ffi_closure *closure, struct call_context *context,
- void *stack)
-{
- ffi_cif *cif = closure->cif;
- void **avalue = (void**) alloca (cif->nargs * sizeof (void*));
- void *rvalue = NULL;
- int i;
- struct arg_state state;
-
- arg_init (&state, ALIGN(cif->bytes, 16));
-
- for (i = 0; i < cif->nargs; i++)
- {
- ffi_type *ty = cif->arg_types[i];
-
- switch (ty->type)
- {
- case FFI_TYPE_VOID:
- FFI_ASSERT (0);
- break;
-
- case FFI_TYPE_UINT8:
- case FFI_TYPE_SINT8:
- case FFI_TYPE_UINT16:
- case FFI_TYPE_SINT16:
- case FFI_TYPE_UINT32:
- case FFI_TYPE_SINT32:
- case FFI_TYPE_INT:
- case FFI_TYPE_POINTER:
- case FFI_TYPE_UINT64:
- case FFI_TYPE_SINT64:
- case FFI_TYPE_FLOAT:
- case FFI_TYPE_DOUBLE:
-#if FFI_TYPE_DOUBLE != FFI_TYPE_LONGDOUBLE
- case FFI_TYPE_LONGDOUBLE:
- avalue[i] = allocate_to_register_or_stack (context, stack,
- &state, ty->type);
- break;
-#endif
-
- case FFI_TYPE_STRUCT:
- if (is_hfa (ty))
- {
- unsigned n = element_count (ty);
- if (available_v (&state) < n)
- {
- state.nsrn = N_V_ARG_REG;
- avalue[i] = allocate_to_stack (&state, stack, ty->alignment,
- ty->size);
- }
- else
- {
- switch (get_homogeneous_type (ty))
- {
- case FFI_TYPE_FLOAT:
- {
- /* Eeek! We need a pointer to the structure,
- however the homogeneous float elements are
- being passed in individual S registers,
- therefore the structure is not represented as
- a contiguous sequence of bytes in our saved
- register context. We need to fake up a copy
- of the structure laid out in memory
- correctly. The fake can be tossed once the
- closure function has returned hence alloca()
- is sufficient. */
- int j;
- UINT32 *p = avalue[i] = alloca (ty->size);
- for (j = 0; j < element_count (ty); j++)
- memcpy (&p[j],
- allocate_to_s (context, &state),
- sizeof (*p));
- break;
- }
-
- case FFI_TYPE_DOUBLE:
- {
- /* Eeek! We need a pointer to the structure,
- however the homogeneous float elements are
- being passed in individual S registers,
- therefore the structure is not represented as
- a contiguous sequence of bytes in our saved
- register context. We need to fake up a copy
- of the structure laid out in memory
- correctly. The fake can be tossed once the
- closure function has returned hence alloca()
- is sufficient. */
- int j;
- UINT64 *p = avalue[i] = alloca (ty->size);
- for (j = 0; j < element_count (ty); j++)
- memcpy (&p[j],
- allocate_to_d (context, &state),
- sizeof (*p));
- break;
- }
-
-#if FFI_TYPE_DOUBLE != FFI_TYPE_LONGDOUBLE
- case FFI_TYPE_LONGDOUBLE:
- memcpy (&avalue[i],
- allocate_to_v (context, &state),
- sizeof (*avalue));
- break;
-#endif
-
- default:
- FFI_ASSERT (0);
- break;
- }
- }
- }
- else if (ty->size > 16)
- {
- /* Replace Composite type of size greater than 16 with a
- pointer. */
- memcpy (&avalue[i],
- allocate_to_register_or_stack (context, stack,
- &state, FFI_TYPE_POINTER),
- sizeof (avalue[i]));
- }
- else if (available_x (&state) >= (ty->size + 7) / 8)
- {
- avalue[i] = get_x_addr (context, state.ngrn);
- state.ngrn += (ty->size + 7) / 8;
- }
- else
- {
- state.ngrn = N_X_ARG_REG;
-
- avalue[i] = allocate_to_stack (&state, stack, ty->alignment,
- ty->size);
- }
- break;
-
- default:
- FFI_ASSERT (0);
- break;
- }
- }
-
- /* Figure out where the return value will be passed, either in
- registers or in a memory block allocated by the caller and passed
- in x8. */
-
- if (is_register_candidate (cif->rtype))
- {
- /* Register candidates are *always* returned in registers. */
-
- /* Allocate a scratchpad for the return value, we will let the
- callee scrible the result into the scratch pad then move the
- contents into the appropriate return value location for the
- call convention. */
- rvalue = alloca (cif->rtype->size);
- (closure->fun) (cif, rvalue, avalue, closure->user_data);
-
- /* Copy the return value into the call context so that it is returned
- as expected to our caller. */
- switch (cif->rtype->type)
- {
- case FFI_TYPE_VOID:
- break;
-
- case FFI_TYPE_UINT8:
- case FFI_TYPE_UINT16:
- case FFI_TYPE_UINT32:
- case FFI_TYPE_POINTER:
- case FFI_TYPE_UINT64:
- case FFI_TYPE_SINT8:
- case FFI_TYPE_SINT16:
- case FFI_TYPE_INT:
- case FFI_TYPE_SINT32:
- case FFI_TYPE_SINT64:
- case FFI_TYPE_FLOAT:
- case FFI_TYPE_DOUBLE:
-#if FFI_TYPE_DOUBLE != FFI_TYPE_LONGDOUBLE
- case FFI_TYPE_LONGDOUBLE:
-#endif
- {
- void *addr = get_basic_type_addr (cif->rtype->type, context, 0);
- copy_basic_type (addr, rvalue, cif->rtype->type);
- break;
- }
- case FFI_TYPE_STRUCT:
- if (is_hfa (cif->rtype))
- {
- int j;
- unsigned short type = get_homogeneous_type (cif->rtype);
- unsigned elems = element_count (cif->rtype);
- for (j = 0; j < elems; j++)
- {
- void *reg = get_basic_type_addr (type, context, j);
- copy_basic_type (reg, rvalue, type);
- rvalue += get_basic_type_size (type);
- }
- }
- else if ((cif->rtype->size + 7) / 8 < N_X_ARG_REG)
- {
- size_t size = ALIGN (cif->rtype->size, sizeof (UINT64)) ;
- memcpy (get_x_addr (context, 0), rvalue, size);
- }
- else
- {
- FFI_ASSERT (0);
- }
- break;
- default:
- FFI_ASSERT (0);
- break;
- }
- }
- else
- {
- memcpy (&rvalue, get_x_addr (context, 8), sizeof (UINT64));
- (closure->fun) (cif, rvalue, avalue, closure->user_data);
- }
-}
-
diff --git a/Modules/_ctypes/libffi/src/aarch64/ffitarget.h b/Modules/_ctypes/libffi/src/aarch64/ffitarget.h
deleted file mode 100644
index 4bbced26f0..0000000000
--- a/Modules/_ctypes/libffi/src/aarch64/ffitarget.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/* Copyright (c) 2009, 2010, 2011, 2012 ARM Ltd.
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-``Software''), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice shall be
-included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
-CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
-
-#ifndef LIBFFI_TARGET_H
-#define LIBFFI_TARGET_H
-
-#ifndef LIBFFI_H
-#error "Please do not include ffitarget.h directly into your source. Use ffi.h instead."
-#endif
-
-#ifndef LIBFFI_ASM
-typedef unsigned long ffi_arg;
-typedef signed long ffi_sarg;
-
-typedef enum ffi_abi
- {
- FFI_FIRST_ABI = 0,
- FFI_SYSV,
- FFI_LAST_ABI,
- FFI_DEFAULT_ABI = FFI_SYSV
- } ffi_abi;
-#endif
-
-/* ---- Definitions for closures ----------------------------------------- */
-
-#define FFI_CLOSURES 1
-#define FFI_TRAMPOLINE_SIZE 36
-#define FFI_NATIVE_RAW_API 0
-
-/* ---- Internal ---- */
-
-#if defined (__APPLE__)
-#define FFI_TARGET_SPECIFIC_VARIADIC
-#define FFI_EXTRA_CIF_FIELDS unsigned aarch64_flags; unsigned aarch64_nfixedargs
-#else
-#define FFI_EXTRA_CIF_FIELDS unsigned aarch64_flags
-#endif
-
-#define AARCH64_FFI_WITH_V_BIT 0
-
-#define AARCH64_N_XREG 32
-#define AARCH64_N_VREG 32
-#define AARCH64_CALL_CONTEXT_SIZE (AARCH64_N_XREG * 8 + AARCH64_N_VREG * 16)
-
-#endif
diff --git a/Modules/_ctypes/libffi/src/aarch64/sysv.S b/Modules/_ctypes/libffi/src/aarch64/sysv.S
deleted file mode 100644
index 169eab804e..0000000000
--- a/Modules/_ctypes/libffi/src/aarch64/sysv.S
+++ /dev/null
@@ -1,333 +0,0 @@
-/* Copyright (c) 2009, 2010, 2011, 2012 ARM Ltd.
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-``Software''), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice shall be
-included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
-CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
-
-#define LIBFFI_ASM
-#include <fficonfig.h>
-#include <ffi.h>
-
-#ifdef HAVE_MACHINE_ASM_H
-#include <machine/asm.h>
-#else
-#ifdef __USER_LABEL_PREFIX__
-#define CONCAT1(a, b) CONCAT2(a, b)
-#define CONCAT2(a, b) a ## b
-
-/* Use the right prefix for global labels. */
-#define CNAME(x) CONCAT1 (__USER_LABEL_PREFIX__, x)
-#else
-#define CNAME(x) x
-#endif
-#endif
-
-#define cfi_adjust_cfa_offset(off) .cfi_adjust_cfa_offset off
-#define cfi_rel_offset(reg, off) .cfi_rel_offset reg, off
-#define cfi_restore(reg) .cfi_restore reg
-#define cfi_def_cfa_register(reg) .cfi_def_cfa_register reg
-
- .text
- .globl CNAME(ffi_call_SYSV)
-#ifdef __ELF__
- .type CNAME(ffi_call_SYSV), #function
-#endif
-#ifdef __APPLE__
- .align 2
-#endif
-
-/* ffi_call_SYSV()
-
- Create a stack frame, setup an argument context, call the callee
- and extract the result.
-
- The maximum required argument stack size is provided,
- ffi_call_SYSV() allocates that stack space then calls the
- prepare_fn to populate register context and stack. The
- argument passing registers are loaded from the register
- context and the callee called, on return the register passing
- register are saved back to the context. Our caller will
- extract the return value from the final state of the saved
- register context.
-
- Prototype:
-
- extern unsigned
- ffi_call_SYSV (void (*)(struct call_context *context, unsigned char *,
- extended_cif *),
- struct call_context *context,
- extended_cif *,
- size_t required_stack_size,
- void (*fn)(void));
-
- Therefore on entry we have:
-
- x0 prepare_fn
- x1 &context
- x2 &ecif
- x3 bytes
- x4 fn
-
- This function uses the following stack frame layout:
-
- ==
- saved x30(lr)
- x29(fp)-> saved x29(fp)
- saved x24
- saved x23
- saved x22
- sp' -> saved x21
- ...
- sp -> (constructed callee stack arguments)
- ==
-
- Voila! */
-
-#define ffi_call_SYSV_FS (8 * 4)
-
- .cfi_startproc
-CNAME(ffi_call_SYSV):
- stp x29, x30, [sp, #-16]!
- cfi_adjust_cfa_offset (16)
- cfi_rel_offset (x29, 0)
- cfi_rel_offset (x30, 8)
-
- mov x29, sp
- cfi_def_cfa_register (x29)
- sub sp, sp, #ffi_call_SYSV_FS
-
- stp x21, x22, [sp, #0]
- cfi_rel_offset (x21, 0 - ffi_call_SYSV_FS)
- cfi_rel_offset (x22, 8 - ffi_call_SYSV_FS)
-
- stp x23, x24, [sp, #16]
- cfi_rel_offset (x23, 16 - ffi_call_SYSV_FS)
- cfi_rel_offset (x24, 24 - ffi_call_SYSV_FS)
-
- mov x21, x1
- mov x22, x2
- mov x24, x4
-
- /* Allocate the stack space for the actual arguments, many
- arguments will be passed in registers, but we assume
- worst case and allocate sufficient stack for ALL of
- the arguments. */
- sub sp, sp, x3
-
- /* unsigned (*prepare_fn) (struct call_context *context,
- unsigned char *stack, extended_cif *ecif);
- */
- mov x23, x0
- mov x0, x1
- mov x1, sp
- /* x2 already in place */
- blr x23
-
- /* Preserve the flags returned. */
- mov x23, x0
-
- /* Figure out if we should touch the vector registers. */
- tbz x23, #AARCH64_FFI_WITH_V_BIT, 1f
-
- /* Load the vector argument passing registers. */
- ldp q0, q1, [x21, #8*32 + 0]
- ldp q2, q3, [x21, #8*32 + 32]
- ldp q4, q5, [x21, #8*32 + 64]
- ldp q6, q7, [x21, #8*32 + 96]
-1:
- /* Load the core argument passing registers. */
- ldp x0, x1, [x21, #0]
- ldp x2, x3, [x21, #16]
- ldp x4, x5, [x21, #32]
- ldp x6, x7, [x21, #48]
-
- /* Don't forget x8 which may be holding the address of a return buffer.
- */
- ldr x8, [x21, #8*8]
-
- blr x24
-
- /* Save the core argument passing registers. */
- stp x0, x1, [x21, #0]
- stp x2, x3, [x21, #16]
- stp x4, x5, [x21, #32]
- stp x6, x7, [x21, #48]
-
- /* Note nothing useful ever comes back in x8! */
-
- /* Figure out if we should touch the vector registers. */
- tbz x23, #AARCH64_FFI_WITH_V_BIT, 1f
-
- /* Save the vector argument passing registers. */
- stp q0, q1, [x21, #8*32 + 0]
- stp q2, q3, [x21, #8*32 + 32]
- stp q4, q5, [x21, #8*32 + 64]
- stp q6, q7, [x21, #8*32 + 96]
-1:
- /* All done, unwind our stack frame. */
- ldp x21, x22, [x29, # - ffi_call_SYSV_FS]
- cfi_restore (x21)
- cfi_restore (x22)
-
- ldp x23, x24, [x29, # - ffi_call_SYSV_FS + 16]
- cfi_restore (x23)
- cfi_restore (x24)
-
- mov sp, x29
- cfi_def_cfa_register (sp)
-
- ldp x29, x30, [sp], #16
- cfi_adjust_cfa_offset (-16)
- cfi_restore (x29)
- cfi_restore (x30)
-
- ret
-
- .cfi_endproc
-#ifdef __ELF__
- .size CNAME(ffi_call_SYSV), .-CNAME(ffi_call_SYSV)
-#endif
-
-#define ffi_closure_SYSV_FS (8 * 2 + AARCH64_CALL_CONTEXT_SIZE)
-
-/* ffi_closure_SYSV
-
- Closure invocation glue. This is the low level code invoked directly by
- the closure trampoline to setup and call a closure.
-
- On entry x17 points to a struct trampoline_data, x16 has been clobbered
- all other registers are preserved.
-
- We allocate a call context and save the argument passing registers,
- then invoked the generic C ffi_closure_SYSV_inner() function to do all
- the real work, on return we load the result passing registers back from
- the call context.
-
- On entry
-
- extern void
- ffi_closure_SYSV (struct trampoline_data *);
-
- struct trampoline_data
- {
- UINT64 *ffi_closure;
- UINT64 flags;
- };
-
- This function uses the following stack frame layout:
-
- ==
- saved x30(lr)
- x29(fp)-> saved x29(fp)
- saved x22
- saved x21
- ...
- sp -> call_context
- ==
-
- Voila! */
-
- .text
- .globl CNAME(ffi_closure_SYSV)
-#ifdef __APPLE__
- .align 2
-#endif
- .cfi_startproc
-CNAME(ffi_closure_SYSV):
- stp x29, x30, [sp, #-16]!
- cfi_adjust_cfa_offset (16)
- cfi_rel_offset (x29, 0)
- cfi_rel_offset (x30, 8)
-
- mov x29, sp
- cfi_def_cfa_register (x29)
-
- sub sp, sp, #ffi_closure_SYSV_FS
-
- stp x21, x22, [x29, #-16]
- cfi_rel_offset (x21, -16)
- cfi_rel_offset (x22, -8)
-
- /* Load x21 with &call_context. */
- mov x21, sp
- /* Preserve our struct trampoline_data * */
- mov x22, x17
-
- /* Save the rest of the argument passing registers. */
- stp x0, x1, [x21, #0]
- stp x2, x3, [x21, #16]
- stp x4, x5, [x21, #32]
- stp x6, x7, [x21, #48]
- /* Don't forget we may have been given a result scratch pad address.
- */
- str x8, [x21, #64]
-
- /* Figure out if we should touch the vector registers. */
- ldr x0, [x22, #8]
- tbz x0, #AARCH64_FFI_WITH_V_BIT, 1f
-
- /* Save the argument passing vector registers. */
- stp q0, q1, [x21, #8*32 + 0]
- stp q2, q3, [x21, #8*32 + 32]
- stp q4, q5, [x21, #8*32 + 64]
- stp q6, q7, [x21, #8*32 + 96]
-1:
- /* Load &ffi_closure.. */
- ldr x0, [x22, #0]
- mov x1, x21
- /* Compute the location of the stack at the point that the
- trampoline was called. */
- add x2, x29, #16
-
- bl CNAME(ffi_closure_SYSV_inner)
-
- /* Figure out if we should touch the vector registers. */
- ldr x0, [x22, #8]
- tbz x0, #AARCH64_FFI_WITH_V_BIT, 1f
-
- /* Load the result passing vector registers. */
- ldp q0, q1, [x21, #8*32 + 0]
- ldp q2, q3, [x21, #8*32 + 32]
- ldp q4, q5, [x21, #8*32 + 64]
- ldp q6, q7, [x21, #8*32 + 96]
-1:
- /* Load the result passing core registers. */
- ldp x0, x1, [x21, #0]
- ldp x2, x3, [x21, #16]
- ldp x4, x5, [x21, #32]
- ldp x6, x7, [x21, #48]
- /* Note nothing useful is returned in x8. */
-
- /* We are done, unwind our frame. */
- ldp x21, x22, [x29, #-16]
- cfi_restore (x21)
- cfi_restore (x22)
-
- mov sp, x29
- cfi_def_cfa_register (sp)
-
- ldp x29, x30, [sp], #16
- cfi_adjust_cfa_offset (-16)
- cfi_restore (x29)
- cfi_restore (x30)
-
- ret
- .cfi_endproc
-#ifdef __ELF__
- .size CNAME(ffi_closure_SYSV), .-CNAME(ffi_closure_SYSV)
-#endif
diff --git a/Modules/_ctypes/libffi/src/alpha/ffi.c b/Modules/_ctypes/libffi/src/alpha/ffi.c
deleted file mode 100644
index 192f691c4a..0000000000
--- a/Modules/_ctypes/libffi/src/alpha/ffi.c
+++ /dev/null
@@ -1,288 +0,0 @@
-/* -----------------------------------------------------------------------
- ffi.c - Copyright (c) 2012 Anthony Green
- Copyright (c) 1998, 2001, 2007, 2008 Red Hat, Inc.
-
- Alpha Foreign Function Interface
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- ``Software''), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to
- permit persons to whom the Software is furnished to do so, subject to
- the following conditions:
-
- The above copyright notice and this permission notice shall be included
- in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- DEALINGS IN THE SOFTWARE.
- ----------------------------------------------------------------------- */
-
-#include <ffi.h>
-#include <ffi_common.h>
-#include <stdlib.h>
-
-/* Force FFI_TYPE_LONGDOUBLE to be different than FFI_TYPE_DOUBLE;
- all further uses in this file will refer to the 128-bit type. */
-#if defined(__LONG_DOUBLE_128__)
-# if FFI_TYPE_LONGDOUBLE != 4
-# error FFI_TYPE_LONGDOUBLE out of date
-# endif
-#else
-# undef FFI_TYPE_LONGDOUBLE
-# define FFI_TYPE_LONGDOUBLE 4
-#endif
-
-extern void ffi_call_osf(void *, unsigned long, unsigned, void *, void (*)(void))
- FFI_HIDDEN;
-extern void ffi_closure_osf(void) FFI_HIDDEN;
-
-
-ffi_status
-ffi_prep_cif_machdep(ffi_cif *cif)
-{
- /* Adjust cif->bytes to represent a minimum 6 words for the temporary
- register argument loading area. */
- if (cif->bytes < 6*FFI_SIZEOF_ARG)
- cif->bytes = 6*FFI_SIZEOF_ARG;
-
- /* Set the return type flag */
- switch (cif->rtype->type)
- {
- case FFI_TYPE_STRUCT:
- case FFI_TYPE_FLOAT:
- case FFI_TYPE_DOUBLE:
- cif->flags = cif->rtype->type;
- break;
-
- case FFI_TYPE_LONGDOUBLE:
- /* 128-bit long double is returned in memory, like a struct. */
- cif->flags = FFI_TYPE_STRUCT;
- break;
-
- default:
- cif->flags = FFI_TYPE_INT;
- break;
- }
-
- return FFI_OK;
-}
-
-
-void
-ffi_call(ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue)
-{
- unsigned long *stack, *argp;
- long i, avn;
- ffi_type **arg_types;
-
- /* If the return value is a struct and we don't have a return
- value address then we need to make one. */
- if (rvalue == NULL && cif->flags == FFI_TYPE_STRUCT)
- rvalue = alloca(cif->rtype->size);
-
- /* Allocate the space for the arguments, plus 4 words of temp
- space for ffi_call_osf. */
- argp = stack = alloca(cif->bytes + 4*FFI_SIZEOF_ARG);
-
- if (cif->flags == FFI_TYPE_STRUCT)
- *(void **) argp++ = rvalue;
-
- i = 0;
- avn = cif->nargs;
- arg_types = cif->arg_types;
-
- while (i < avn)
- {
- size_t size = (*arg_types)->size;
-
- switch ((*arg_types)->type)
- {
- case FFI_TYPE_SINT8:
- *(SINT64 *) argp = *(SINT8 *)(* avalue);
- break;
-
- case FFI_TYPE_UINT8:
- *(SINT64 *) argp = *(UINT8 *)(* avalue);
- break;
-
- case FFI_TYPE_SINT16:
- *(SINT64 *) argp = *(SINT16 *)(* avalue);
- break;
-
- case FFI_TYPE_UINT16:
- *(SINT64 *) argp = *(UINT16 *)(* avalue);
- break;
-
- case FFI_TYPE_SINT32:
- case FFI_TYPE_UINT32:
- /* Note that unsigned 32-bit quantities are sign extended. */
- *(SINT64 *) argp = *(SINT32 *)(* avalue);
- break;
-
- case FFI_TYPE_SINT64:
- case FFI_TYPE_UINT64:
- case FFI_TYPE_POINTER:
- *(UINT64 *) argp = *(UINT64 *)(* avalue);
- break;
-
- case FFI_TYPE_FLOAT:
- if (argp - stack < 6)
- {
- /* Note the conversion -- all the fp regs are loaded as
- doubles. The in-register format is the same. */
- *(double *) argp = *(float *)(* avalue);
- }
- else
- *(float *) argp = *(float *)(* avalue);
- break;
-
- case FFI_TYPE_DOUBLE:
- *(double *) argp = *(double *)(* avalue);
- break;
-
- case FFI_TYPE_LONGDOUBLE:
- /* 128-bit long double is passed by reference. */
- *(long double **) argp = (long double *)(* avalue);
- size = sizeof (long double *);
- break;
-
- case FFI_TYPE_STRUCT:
- memcpy(argp, *avalue, (*arg_types)->size);
- break;
-
- default:
- FFI_ASSERT(0);
- }
-
- argp += ALIGN(size, FFI_SIZEOF_ARG) / FFI_SIZEOF_ARG;
- i++, arg_types++, avalue++;
- }
-
- ffi_call_osf(stack, cif->bytes, cif->flags, rvalue, fn);
-}
-
-
-ffi_status
-ffi_prep_closure_loc (ffi_closure* closure,
- ffi_cif* cif,
- void (*fun)(ffi_cif*, void*, void**, void*),
- void *user_data,
- void *codeloc)
-{
- unsigned int *tramp;
-
- if (cif->abi != FFI_OSF)
- return FFI_BAD_ABI;
-
- tramp = (unsigned int *) &closure->tramp[0];
- tramp[0] = 0x47fb0401; /* mov $27,$1 */
- tramp[1] = 0xa77b0010; /* ldq $27,16($27) */
- tramp[2] = 0x6bfb0000; /* jmp $31,($27),0 */
- tramp[3] = 0x47ff041f; /* nop */
- *(void **) &tramp[4] = ffi_closure_osf;
-
- closure->cif = cif;
- closure->fun = fun;
- closure->user_data = user_data;
-
- /* Flush the Icache.
-
- Tru64 UNIX as doesn't understand the imb mnemonic, so use call_pal
- instead, since both Compaq as and gas can handle it.
-
- 0x86 is PAL_imb in Tru64 UNIX <alpha/pal.h>. */
- asm volatile ("call_pal 0x86" : : : "memory");
-
- return FFI_OK;
-}
-
-
-long FFI_HIDDEN
-ffi_closure_osf_inner(ffi_closure *closure, void *rvalue, unsigned long *argp)
-{
- ffi_cif *cif;
- void **avalue;
- ffi_type **arg_types;
- long i, avn, argn;
-
- cif = closure->cif;
- avalue = alloca(cif->nargs * sizeof(void *));
-
- argn = 0;
-
- /* Copy the caller's structure return address to that the closure
- returns the data directly to the caller. */
- if (cif->flags == FFI_TYPE_STRUCT)
- {
- rvalue = (void *) argp[0];
- argn = 1;
- }
-
- i = 0;
- avn = cif->nargs;
- arg_types = cif->arg_types;
-
- /* Grab the addresses of the arguments from the stack frame. */
- while (i < avn)
- {
- size_t size = arg_types[i]->size;
-
- switch (arg_types[i]->type)
- {
- case FFI_TYPE_SINT8:
- case FFI_TYPE_UINT8:
- case FFI_TYPE_SINT16:
- case FFI_TYPE_UINT16:
- case FFI_TYPE_SINT32:
- case FFI_TYPE_UINT32:
- case FFI_TYPE_SINT64:
- case FFI_TYPE_UINT64:
- case FFI_TYPE_POINTER:
- case FFI_TYPE_STRUCT:
- avalue[i] = &argp[argn];
- break;
-
- case FFI_TYPE_FLOAT:
- if (argn < 6)
- {
- /* Floats coming from registers need conversion from double
- back to float format. */
- *(float *)&argp[argn - 6] = *(double *)&argp[argn - 6];
- avalue[i] = &argp[argn - 6];
- }
- else
- avalue[i] = &argp[argn];
- break;
-
- case FFI_TYPE_DOUBLE:
- avalue[i] = &argp[argn - (argn < 6 ? 6 : 0)];
- break;
-
- case FFI_TYPE_LONGDOUBLE:
- /* 128-bit long double is passed by reference. */
- avalue[i] = (long double *) argp[argn];
- size = sizeof (long double *);
- break;
-
- default:
- abort ();
- }
-
- argn += ALIGN(size, FFI_SIZEOF_ARG) / FFI_SIZEOF_ARG;
- i++;
- }
-
- /* Invoke the closure. */
- closure->fun (cif, rvalue, avalue, closure->user_data);
-
- /* Tell ffi_closure_osf how to perform return type promotions. */
- return cif->rtype->type;
-}
diff --git a/Modules/_ctypes/libffi/src/alpha/ffitarget.h b/Modules/_ctypes/libffi/src/alpha/ffitarget.h
deleted file mode 100644
index af145bce83..0000000000
--- a/Modules/_ctypes/libffi/src/alpha/ffitarget.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/* -----------------------------------------------------------------*-C-*-
- ffitarget.h - Copyright (c) 2012 Anthony Green
- Copyright (c) 1996-2003 Red Hat, Inc.
- Target configuration macros for Alpha.
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- ``Software''), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to
- permit persons to whom the Software is furnished to do so, subject to
- the following conditions:
-
- The above copyright notice and this permission notice shall be included
- in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- DEALINGS IN THE SOFTWARE.
-
- ----------------------------------------------------------------------- */
-
-#ifndef LIBFFI_TARGET_H
-#define LIBFFI_TARGET_H
-
-#ifndef LIBFFI_H
-#error "Please do not include ffitarget.h directly into your source. Use ffi.h instead."
-#endif
-
-#ifndef LIBFFI_ASM
-typedef unsigned long ffi_arg;
-typedef signed long ffi_sarg;
-
-typedef enum ffi_abi {
- FFI_FIRST_ABI = 0,
- FFI_OSF,
- FFI_LAST_ABI,
- FFI_DEFAULT_ABI = FFI_OSF
-} ffi_abi;
-#endif
-
-/* ---- Definitions for closures ----------------------------------------- */
-
-#define FFI_CLOSURES 1
-#define FFI_TRAMPOLINE_SIZE 24
-#define FFI_NATIVE_RAW_API 0
-
-#endif
diff --git a/Modules/_ctypes/libffi/src/alpha/osf.S b/Modules/_ctypes/libffi/src/alpha/osf.S
deleted file mode 100644
index 6b9f4dfa03..0000000000
--- a/Modules/_ctypes/libffi/src/alpha/osf.S
+++ /dev/null
@@ -1,387 +0,0 @@
-/* -----------------------------------------------------------------------
- osf.S - Copyright (c) 1998, 2001, 2007, 2008, 2011 Red Hat
-
- Alpha/OSF Foreign Function Interface
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- ``Software''), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to
- permit persons to whom the Software is furnished to do so, subject to
- the following conditions:
-
- The above copyright notice and this permission notice shall be included
- in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- DEALINGS IN THE SOFTWARE.
- ----------------------------------------------------------------------- */
-
-#define LIBFFI_ASM
-#include <fficonfig.h>
-#include <ffi.h>
-
- .arch ev6
- .text
-
-/* ffi_call_osf (void *args, unsigned long bytes, unsigned flags,
- void *raddr, void (*fnaddr)(void));
-
- Bit o trickiness here -- ARGS+BYTES is the base of the stack frame
- for this function. This has been allocated by ffi_call. We also
- deallocate some of the stack that has been alloca'd. */
-
- .align 3
- .globl ffi_call_osf
- .ent ffi_call_osf
- FFI_HIDDEN(ffi_call_osf)
-
-ffi_call_osf:
- .frame $15, 32, $26, 0
- .mask 0x4008000, -32
-$LFB1:
- addq $16,$17,$1
- mov $16, $30
- stq $26, 0($1)
- stq $15, 8($1)
- stq $18, 16($1)
- mov $1, $15
-$LCFI1:
- .prologue 0
-
- stq $19, 24($1)
- mov $20, $27
-
- # Load up all of the (potential) argument registers.
- ldq $16, 0($30)
- ldt $f16, 0($30)
- ldt $f17, 8($30)
- ldq $17, 8($30)
- ldt $f18, 16($30)
- ldq $18, 16($30)
- ldt $f19, 24($30)
- ldq $19, 24($30)
- ldt $f20, 32($30)
- ldq $20, 32($30)
- ldt $f21, 40($30)
- ldq $21, 40($30)
-
- # Deallocate the register argument area.
- lda $30, 48($30)
-
- jsr $26, ($27), 0
- ldgp $29, 0($26)
-
- # If the return value pointer is NULL, assume no return value.
- ldq $19, 24($15)
- ldq $18, 16($15)
- ldq $26, 0($15)
-$LCFI2:
- beq $19, $noretval
-
- # Store the return value out in the proper type.
- cmpeq $18, FFI_TYPE_INT, $1
- bne $1, $retint
- cmpeq $18, FFI_TYPE_FLOAT, $2
- bne $2, $retfloat
- cmpeq $18, FFI_TYPE_DOUBLE, $3
- bne $3, $retdouble
-
- .align 3
-$noretval:
- ldq $15, 8($15)
- ret
-
- .align 4
-$retint:
- stq $0, 0($19)
- nop
- ldq $15, 8($15)
- ret
-
- .align 4
-$retfloat:
- sts $f0, 0($19)
- nop
- ldq $15, 8($15)
- ret
-
- .align 4
-$retdouble:
- stt $f0, 0($19)
- nop
- ldq $15, 8($15)
- ret
-$LFE1:
-
- .end ffi_call_osf
-
-/* ffi_closure_osf(...)
-
- Receives the closure argument in $1. */
-
- .align 3
- .globl ffi_closure_osf
- .ent ffi_closure_osf
- FFI_HIDDEN(ffi_closure_osf)
-
-ffi_closure_osf:
- .frame $30, 16*8, $26, 0
- .mask 0x4000000, -16*8
-$LFB2:
- ldgp $29, 0($27)
- subq $30, 16*8, $30
-$LCFI5:
- stq $26, 0($30)
-$LCFI6:
- .prologue 1
-
- # Store all of the potential argument registers in va_list format.
- stt $f16, 4*8($30)
- stt $f17, 5*8($30)
- stt $f18, 6*8($30)
- stt $f19, 7*8($30)
- stt $f20, 8*8($30)
- stt $f21, 9*8($30)
- stq $16, 10*8($30)
- stq $17, 11*8($30)
- stq $18, 12*8($30)
- stq $19, 13*8($30)
- stq $20, 14*8($30)
- stq $21, 15*8($30)
-
- # Call ffi_closure_osf_inner to do the bulk of the work.
- mov $1, $16
- lda $17, 2*8($30)
- lda $18, 10*8($30)
- jsr $26, ffi_closure_osf_inner
- ldgp $29, 0($26)
- ldq $26, 0($30)
-
- # Load up the return value in the proper type.
- lda $1, $load_table
- s4addq $0, $1, $1
- ldl $1, 0($1)
- addq $1, $29, $1
- jmp $31, ($1), $load_32
-
- .align 4
-$load_none:
- addq $30, 16*8, $30
- ret
-
- .align 4
-$load_float:
- lds $f0, 16($30)
- nop
- addq $30, 16*8, $30
- ret
-
- .align 4
-$load_double:
- ldt $f0, 16($30)
- nop
- addq $30, 16*8, $30
- ret
-
- .align 4
-$load_u8:
-#ifdef __alpha_bwx__
- ldbu $0, 16($30)
- nop
-#else
- ldq $0, 16($30)
- and $0, 255, $0
-#endif
- addq $30, 16*8, $30
- ret
-
- .align 4
-$load_s8:
-#ifdef __alpha_bwx__
- ldbu $0, 16($30)
- sextb $0, $0
-#else
- ldq $0, 16($30)
- sll $0, 56, $0
- sra $0, 56, $0
-#endif
- addq $30, 16*8, $30
- ret
-
- .align 4
-$load_u16:
-#ifdef __alpha_bwx__
- ldwu $0, 16($30)
- nop
-#else
- ldq $0, 16($30)
- zapnot $0, 3, $0
-#endif
- addq $30, 16*8, $30
- ret
-
- .align 4
-$load_s16:
-#ifdef __alpha_bwx__
- ldwu $0, 16($30)
- sextw $0, $0
-#else
- ldq $0, 16($30)
- sll $0, 48, $0
- sra $0, 48, $0
-#endif
- addq $30, 16*8, $30
- ret
-
- .align 4
-$load_32:
- ldl $0, 16($30)
- nop
- addq $30, 16*8, $30
- ret
-
- .align 4
-$load_64:
- ldq $0, 16($30)
- nop
- addq $30, 16*8, $30
- ret
-$LFE2:
-
- .end ffi_closure_osf
-
-#ifdef __ELF__
-.section .rodata
-#else
-.rdata
-#endif
-$load_table:
- .gprel32 $load_none # FFI_TYPE_VOID
- .gprel32 $load_32 # FFI_TYPE_INT
- .gprel32 $load_float # FFI_TYPE_FLOAT
- .gprel32 $load_double # FFI_TYPE_DOUBLE
- .gprel32 $load_none # FFI_TYPE_LONGDOUBLE
- .gprel32 $load_u8 # FFI_TYPE_UINT8
- .gprel32 $load_s8 # FFI_TYPE_SINT8
- .gprel32 $load_u16 # FFI_TYPE_UINT16
- .gprel32 $load_s16 # FFI_TYPE_SINT16
- .gprel32 $load_32 # FFI_TYPE_UINT32
- .gprel32 $load_32 # FFI_TYPE_SINT32
- .gprel32 $load_64 # FFI_TYPE_UINT64
- .gprel32 $load_64 # FFI_TYPE_SINT64
- .gprel32 $load_none # FFI_TYPE_STRUCT
- .gprel32 $load_64 # FFI_TYPE_POINTER
-
-/* Assert that the table above is in sync with ffi.h. */
-
-#if FFI_TYPE_FLOAT != 2 \
- || FFI_TYPE_DOUBLE != 3 \
- || FFI_TYPE_UINT8 != 5 \
- || FFI_TYPE_SINT8 != 6 \
- || FFI_TYPE_UINT16 != 7 \
- || FFI_TYPE_SINT16 != 8 \
- || FFI_TYPE_UINT32 != 9 \
- || FFI_TYPE_SINT32 != 10 \
- || FFI_TYPE_UINT64 != 11 \
- || FFI_TYPE_SINT64 != 12 \
- || FFI_TYPE_STRUCT != 13 \
- || FFI_TYPE_POINTER != 14 \
- || FFI_TYPE_LAST != 14
-#error "osf.S out of sync with ffi.h"
-#endif
-
-#ifdef __ELF__
-# define UA_SI .4byte
-# define FDE_ENCODING 0x1b /* pcrel sdata4 */
-# define FDE_ENCODE(X) .4byte X-.
-# define FDE_ARANGE(X) .4byte X
-#elif defined __osf__
-# define UA_SI .align 0; .long
-# define FDE_ENCODING 0x50 /* aligned absolute */
-# define FDE_ENCODE(X) .align 3; .quad X
-# define FDE_ARANGE(X) .align 0; .quad X
-#endif
-
-#ifdef __ELF__
- .section .eh_frame,EH_FRAME_FLAGS,@progbits
-#elif defined __osf__
- .data
- .align 3
- .globl _GLOBAL__F_ffi_call_osf
-_GLOBAL__F_ffi_call_osf:
-#endif
-__FRAME_BEGIN__:
- UA_SI $LECIE1-$LSCIE1 # Length of Common Information Entry
-$LSCIE1:
- UA_SI 0x0 # CIE Identifier Tag
- .byte 0x1 # CIE Version
- .ascii "zR\0" # CIE Augmentation
- .byte 0x1 # uleb128 0x1; CIE Code Alignment Factor
- .byte 0x78 # sleb128 -8; CIE Data Alignment Factor
- .byte 26 # CIE RA Column
- .byte 0x1 # uleb128 0x1; Augmentation size
- .byte FDE_ENCODING # FDE Encoding
- .byte 0xc # DW_CFA_def_cfa
- .byte 30 # uleb128 column 30
- .byte 0 # uleb128 offset 0
- .align 3
-$LECIE1:
-$LSFDE1:
- UA_SI $LEFDE1-$LASFDE1 # FDE Length
-$LASFDE1:
- UA_SI $LASFDE1-__FRAME_BEGIN__ # FDE CIE offset
- FDE_ENCODE($LFB1) # FDE initial location
- FDE_ARANGE($LFE1-$LFB1) # FDE address range
- .byte 0x0 # uleb128 0x0; Augmentation size
-
- .byte 0x4 # DW_CFA_advance_loc4
- UA_SI $LCFI1-$LFB1
- .byte 0x9a # DW_CFA_offset, column 26
- .byte 4 # uleb128 4*-8
- .byte 0x8f # DW_CFA_offset, column 15
- .byte 0x3 # uleb128 3*-8
- .byte 0xc # DW_CFA_def_cfa
- .byte 15 # uleb128 column 15
- .byte 32 # uleb128 offset 32
-
- .byte 0x4 # DW_CFA_advance_loc4
- UA_SI $LCFI2-$LCFI1
- .byte 0xda # DW_CFA_restore, column 26
- .align 3
-$LEFDE1:
-
-$LSFDE3:
- UA_SI $LEFDE3-$LASFDE3 # FDE Length
-$LASFDE3:
- UA_SI $LASFDE3-__FRAME_BEGIN__ # FDE CIE offset
- FDE_ENCODE($LFB2) # FDE initial location
- FDE_ARANGE($LFE2-$LFB2) # FDE address range
- .byte 0x0 # uleb128 0x0; Augmentation size
-
- .byte 0x4 # DW_CFA_advance_loc4
- UA_SI $LCFI5-$LFB2
- .byte 0xe # DW_CFA_def_cfa_offset
- .byte 0x80,0x1 # uleb128 128
-
- .byte 0x4 # DW_CFA_advance_loc4
- UA_SI $LCFI6-$LCFI5
- .byte 0x9a # DW_CFA_offset, column 26
- .byte 16 # uleb128 offset 16*-8
- .align 3
-$LEFDE3:
-#if defined __osf__
- .align 0
- .long 0 # End of Table
-#endif
-
-#if defined __ELF__ && defined __linux__
- .section .note.GNU-stack,"",@progbits
-#endif
diff --git a/Modules/_ctypes/libffi/src/arc/arcompact.S b/Modules/_ctypes/libffi/src/arc/arcompact.S
deleted file mode 100644
index 03715fde49..0000000000
--- a/Modules/_ctypes/libffi/src/arc/arcompact.S
+++ /dev/null
@@ -1,135 +0,0 @@
-/* -----------------------------------------------------------------------
- arcompact.S - Copyright (c) 2013 Synposys, Inc. (www.synopsys.com)
-
- ARCompact Foreign Function Interface
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- ``Software''), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to
- permit persons to whom the Software is furnished to do so, subject to
- the following conditions:
-
- The above copyright notice and this permission notice shall be included
- in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS
- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- IN NO EVENT SHALL RENESAS TECHNOLOGY BE LIABLE FOR ANY CLAIM, DAMAGES OR
- OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- OTHER DEALINGS IN THE SOFTWARE.
- ----------------------------------------------------------------------- */
-
-#define LIBFFI_ASM
-#include <fficonfig.h>
-#include <ffi.h>
-#ifdef HAVE_MACHINE_ASM_H
-#include <machine/asm.h>
-#else
-#define CNAME(x) x
-#define ENTRY(x) .globl CNAME(x)` .type CNAME(x),%function` CNAME(x):
-#endif
-
-.text
-
- /* R0: ffi_prep_args */
- /* R1: &ecif */
- /* R2: cif->bytes */
- /* R3: fig->flags */
- /* R4: ecif.rvalue */
- /* R5: fn */
-ENTRY(ffi_call_ARCompact)
- /* Save registers. */
- st.a fp, [sp, -4] /* fp + 20, fp */
- push_s blink /* fp + 16, blink */
- st.a r4, [sp, -4] /* fp + 12, ecif.rvalue */
- push_s r3 /* fp + 8, fig->flags */
- st.a r5, [sp, -4] /* fp + 4, fn */
- push_s r2 /* fp + 0, cif->bytes */
- mov fp, sp
-
- /* Make room for all of the new args. */
- sub sp, sp, r2
-
- /* Place all of the ffi_prep_args in position. */
- /* ffi_prep_args(char *stack, extended_cif *ecif) */
- /* R1 already set. */
-
- /* And call. */
- jl_s.d [r0]
- mov_s r0, sp
-
- ld.ab r12, [fp, 4] /* cif->bytes */
- ld.ab r11, [fp, 4] /* fn */
-
- /* Move first 8 parameters in registers... */
- ld_s r0, [sp]
- ld_s r1, [sp, 4]
- ld_s r2, [sp, 8]
- ld_s r3, [sp, 12]
- ld r4, [sp, 16]
- ld r5, [sp, 20]
- ld r6, [sp, 24]
- ld r7, [sp, 28]
-
- /* ...and adjust the stack. */
- min r12, r12, 32
-
- /* Call the function. */
- jl.d [r11]
- add sp, sp, r12
-
- mov sp, fp
- pop_s r3 /* fig->flags, return type */
- pop_s r2 /* ecif.rvalue, pointer for return value */
-
- /* If the return value pointer is NULL, assume no return value. */
- breq.d r2, 0, epilogue
- pop_s blink
-
- /* Return INT. */
- brne r3, FFI_TYPE_INT, return_double
- b.d epilogue
- st_s r0, [r2]
-
-return_double:
- brne r3, FFI_TYPE_DOUBLE, epilogue
- st_s r0, [r2]
- st_s r1, [r2,4]
-
-epilogue:
- j_s.d [blink]
- ld.ab fp, [sp, 4]
-
-ENTRY(ffi_closure_ARCompact)
- st.a r0, [sp, -32]
- st_s r1, [sp, 4]
- st_s r2, [sp, 8]
- st_s r3, [sp, 12]
- st r4, [sp, 16]
- st r5, [sp, 20]
- st r6, [sp, 24]
- st r7, [sp, 28]
-
- /* pointer to arguments */
- mov_s r2, sp
-
- /* return value goes here */
- sub sp, sp, 8
- mov_s r1, sp
-
- push_s blink
-
- bl.d ffi_closure_inner_ARCompact
- mov_s r0, r8 /* codeloc, set by trampoline */
-
- pop_s blink
-
- /* set return value to r1:r0 */
- pop_s r0
- pop_s r1
- j_s.d [blink]
- add_s sp, sp, 32
diff --git a/Modules/_ctypes/libffi/src/arc/ffi.c b/Modules/_ctypes/libffi/src/arc/ffi.c
deleted file mode 100644
index 32f82a7d5b..0000000000
--- a/Modules/_ctypes/libffi/src/arc/ffi.c
+++ /dev/null
@@ -1,268 +0,0 @@
-/* -----------------------------------------------------------------------
- ffi.c - Copyright (c) 2013 Synopsys, Inc. (www.synopsys.com)
-
- ARC Foreign Function Interface
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- ``Software''), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to
- permit persons to whom the Software is furnished to do so, subject to
- the following conditions:
-
- The above copyright notice and this permission notice shall be included
- in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS
- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- IN NO EVENT SHALL RENESAS TECHNOLOGY BE LIABLE FOR ANY CLAIM, DAMAGES OR
- OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- OTHER DEALINGS IN THE SOFTWARE.
- ----------------------------------------------------------------------- */
-
-#include <ffi.h>
-#include <ffi_common.h>
-
-#include <stdlib.h>
-#include <stdint.h>
-
-#include <sys/cachectl.h>
-
-/* for little endian ARC, the code is in fact stored as mixed endian for
- performance reasons */
-#if __BIG_ENDIAN__
-#define CODE_ENDIAN(x) (x)
-#else
-#define CODE_ENDIAN(x) ( (((uint32_t) (x)) << 16) | (((uint32_t) (x)) >> 16))
-#endif
-
-/* ffi_prep_args is called by the assembly routine once stack
- space has been allocated for the function's arguments. */
-
-void
-ffi_prep_args (char *stack, extended_cif * ecif)
-{
- unsigned int i;
- int tmp;
- void **p_argv;
- char *argp;
- ffi_type **p_arg;
-
- tmp = 0;
- argp = stack;
-
- if (ecif->cif->rtype->type == FFI_TYPE_STRUCT)
- {
- *(void **) argp = ecif->rvalue;
- argp += 4;
- }
-
- p_argv = ecif->avalue;
-
- for (i = ecif->cif->nargs, p_arg = ecif->cif->arg_types;
- (i != 0); i--, p_arg++)
- {
- size_t z;
- int alignment;
-
- /* align alignment to 4 */
- alignment = (((*p_arg)->alignment - 1) | 3) + 1;
-
- /* Align if necessary. */
- if ((alignment - 1) & (unsigned) argp)
- argp = (char *) ALIGN (argp, alignment);
-
- z = (*p_arg)->size;
- if (z < sizeof (int))
- {
- z = sizeof (int);
-
- switch ((*p_arg)->type)
- {
- case FFI_TYPE_SINT8:
- *(signed int *) argp = (signed int) *(SINT8 *) (*p_argv);
- break;
-
- case FFI_TYPE_UINT8:
- *(unsigned int *) argp = (unsigned int) *(UINT8 *) (*p_argv);
- break;
-
- case FFI_TYPE_SINT16:
- *(signed int *) argp = (signed int) *(SINT16 *) (*p_argv);
- break;
-
- case FFI_TYPE_UINT16:
- *(unsigned int *) argp = (unsigned int) *(UINT16 *) (*p_argv);
- break;
-
- case FFI_TYPE_STRUCT:
- memcpy (argp, *p_argv, (*p_arg)->size);
- break;
-
- default:
- FFI_ASSERT (0);
- }
- }
- else if (z == sizeof (int))
- {
- *(unsigned int *) argp = (unsigned int) *(UINT32 *) (*p_argv);
- }
- else
- {
- if ((*p_arg)->type == FFI_TYPE_STRUCT)
- {
- memcpy (argp, *p_argv, z);
- }
- else
- {
- /* Double or long long 64bit. */
- memcpy (argp, *p_argv, z);
- }
- }
- p_argv++;
- argp += z;
- }
-
- return;
-}
-
-/* Perform machine dependent cif processing. */
-ffi_status
-ffi_prep_cif_machdep (ffi_cif * cif)
-{
- /* Set the return type flag. */
- switch (cif->rtype->type)
- {
- case FFI_TYPE_VOID:
- cif->flags = (unsigned) cif->rtype->type;
- break;
-
- case FFI_TYPE_STRUCT:
- cif->flags = (unsigned) cif->rtype->type;
- break;
-
- case FFI_TYPE_SINT64:
- case FFI_TYPE_UINT64:
- case FFI_TYPE_DOUBLE:
- cif->flags = FFI_TYPE_DOUBLE;
- break;
-
- case FFI_TYPE_FLOAT:
- default:
- cif->flags = FFI_TYPE_INT;
- break;
- }
-
- return FFI_OK;
-}
-
-extern void ffi_call_ARCompact (void (*)(char *, extended_cif *),
- extended_cif *, unsigned, unsigned,
- unsigned *, void (*fn) (void));
-
-void
-ffi_call (ffi_cif * cif, void (*fn) (void), void *rvalue, void **avalue)
-{
- extended_cif ecif;
-
- ecif.cif = cif;
- ecif.avalue = avalue;
-
- /* If the return value is a struct and we don't have
- a return value address then we need to make one. */
- if ((rvalue == NULL) && (cif->rtype->type == FFI_TYPE_STRUCT))
- {
- ecif.rvalue = alloca (cif->rtype->size);
- }
- else
- ecif.rvalue = rvalue;
-
- switch (cif->abi)
- {
- case FFI_ARCOMPACT:
- ffi_call_ARCompact (ffi_prep_args, &ecif, cif->bytes,
- cif->flags, ecif.rvalue, fn);
- break;
-
- default:
- FFI_ASSERT (0);
- break;
- }
-}
-
-int
-ffi_closure_inner_ARCompact (ffi_closure * closure, void *rvalue,
- ffi_arg * args)
-{
- void **arg_area, **p_argv;
- ffi_cif *cif = closure->cif;
- char *argp = (char *) args;
- ffi_type **p_argt;
- int i;
-
- arg_area = (void **) alloca (cif->nargs * sizeof (void *));
-
- /* handle hidden argument */
- if (cif->flags == FFI_TYPE_STRUCT)
- {
- rvalue = *(void **) argp;
- argp += 4;
- }
-
- p_argv = arg_area;
-
- for (i = 0, p_argt = cif->arg_types; i < cif->nargs;
- i++, p_argt++, p_argv++)
- {
- size_t z;
- int alignment;
-
- /* align alignment to 4 */
- alignment = (((*p_argt)->alignment - 1) | 3) + 1;
-
- /* Align if necessary. */
- if ((alignment - 1) & (unsigned) argp)
- argp = (char *) ALIGN (argp, alignment);
-
- z = (*p_argt)->size;
- *p_argv = (void *) argp;
- argp += z;
- }
-
- (closure->fun) (cif, rvalue, arg_area, closure->user_data);
-
- return cif->flags;
-}
-
-extern void ffi_closure_ARCompact (void);
-
-ffi_status
-ffi_prep_closure_loc (ffi_closure * closure, ffi_cif * cif,
- void (*fun) (ffi_cif *, void *, void **, void *),
- void *user_data, void *codeloc)
-{
- uint32_t *tramp = (uint32_t *) & (closure->tramp[0]);
-
- switch (cif->abi)
- {
- case FFI_ARCOMPACT:
- FFI_ASSERT (tramp == codeloc);
- tramp[0] = CODE_ENDIAN (0x200a1fc0); /* mov r8, pcl */
- tramp[1] = CODE_ENDIAN (0x20200f80); /* j [long imm] */
- tramp[2] = CODE_ENDIAN (ffi_closure_ARCompact);
- break;
-
- default:
- return FFI_BAD_ABI;
- }
-
- closure->cif = cif;
- closure->fun = fun;
- closure->user_data = user_data;
- cacheflush (codeloc, FFI_TRAMPOLINE_SIZE, BCACHE);
-
- return FFI_OK;
-}
diff --git a/Modules/_ctypes/libffi/src/arc/ffitarget.h b/Modules/_ctypes/libffi/src/arc/ffitarget.h
deleted file mode 100644
index bf8311bc83..0000000000
--- a/Modules/_ctypes/libffi/src/arc/ffitarget.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/* -----------------------------------------------------------------------
- ffitarget.h - Copyright (c) 2012 Anthony Green
- Copyright (c) 2013 Synopsys, Inc. (www.synopsys.com)
- Target configuration macros for ARC.
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- ``Software''), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to
- permit persons to whom the Software is furnished to do so, subject to
- the following conditions:
-
- The above copyright notice and this permission notice shall be included
- in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS
- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- IN NO EVENT SHALL RENESAS TECHNOLOGY BE LIABLE FOR ANY CLAIM, DAMAGES OR
- OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- OTHER DEALINGS IN THE SOFTWARE.
-
- ----------------------------------------------------------------------- */
-
-#ifndef LIBFFI_TARGET_H
-#define LIBFFI_TARGET_H
-
-#ifndef LIBFFI_H
-#error "Please do not include ffitarget.h directly into your source. Use ffi.h instead."
-#endif
-
-/* ---- Generic type definitions ----------------------------------------- */
-
-#ifndef LIBFFI_ASM
-typedef unsigned long ffi_arg;
-typedef signed long ffi_sarg;
-
-typedef enum ffi_abi
-{
- FFI_FIRST_ABI = 0,
- FFI_ARCOMPACT,
- FFI_LAST_ABI,
- FFI_DEFAULT_ABI = FFI_ARCOMPACT
-} ffi_abi;
-#endif
-
-#define FFI_CLOSURES 1
-#define FFI_TRAMPOLINE_SIZE 12
-#define FFI_NATIVE_RAW_API 0
-
-#endif
diff --git a/Modules/_ctypes/libffi/src/arm/ffi.c b/Modules/_ctypes/libffi/src/arm/ffi.c
deleted file mode 100644
index 6691ab57da..0000000000
--- a/Modules/_ctypes/libffi/src/arm/ffi.c
+++ /dev/null
@@ -1,931 +0,0 @@
-/* -----------------------------------------------------------------------
- ffi.c - Copyright (c) 2011 Timothy Wall
- Copyright (c) 2011 Plausible Labs Cooperative, Inc.
- Copyright (c) 2011 Anthony Green
- Copyright (c) 2011 Free Software Foundation
- Copyright (c) 1998, 2008, 2011 Red Hat, Inc.
-
- ARM Foreign Function Interface
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- ``Software''), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to
- permit persons to whom the Software is furnished to do so, subject to
- the following conditions:
-
- The above copyright notice and this permission notice shall be included
- in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- DEALINGS IN THE SOFTWARE.
- ----------------------------------------------------------------------- */
-
-#include <ffi.h>
-#include <ffi_common.h>
-
-#include <stdlib.h>
-
-/* Forward declares. */
-static int vfp_type_p (ffi_type *);
-static void layout_vfp_args (ffi_cif *);
-
-int ffi_prep_args_SYSV(char *stack, extended_cif *ecif, float *vfp_space);
-int ffi_prep_args_VFP(char *stack, extended_cif *ecif, float *vfp_space);
-
-static char* ffi_align(ffi_type **p_arg, char *argp)
-{
- /* Align if necessary */
- register size_t alignment = (*p_arg)->alignment;
- if (alignment < 4)
- {
- alignment = 4;
- }
-#ifdef _WIN32_WCE
- if (alignment > 4)
- {
- alignment = 4;
- }
-#endif
- if ((alignment - 1) & (unsigned) argp)
- {
- argp = (char *) ALIGN(argp, alignment);
- }
-
- if ((*p_arg)->type == FFI_TYPE_STRUCT)
- {
- argp = (char *) ALIGN(argp, 4);
- }
- return argp;
-}
-
-static size_t ffi_put_arg(ffi_type **arg_type, void **arg, char *stack)
-{
- register char* argp = stack;
- register ffi_type **p_arg = arg_type;
- register void **p_argv = arg;
- register size_t z = (*p_arg)->size;
- if (z < sizeof(int))
- {
- z = sizeof(int);
- switch ((*p_arg)->type)
- {
- case FFI_TYPE_SINT8:
- *(signed int *) argp = (signed int)*(SINT8 *)(* p_argv);
- break;
-
- case FFI_TYPE_UINT8:
- *(unsigned int *) argp = (unsigned int)*(UINT8 *)(* p_argv);
- break;
-
- case FFI_TYPE_SINT16:
- *(signed int *) argp = (signed int)*(SINT16 *)(* p_argv);
- break;
-
- case FFI_TYPE_UINT16:
- *(unsigned int *) argp = (unsigned int)*(UINT16 *)(* p_argv);
- break;
-
- case FFI_TYPE_STRUCT:
- memcpy(argp, *p_argv, (*p_arg)->size);
- break;
-
- default:
- FFI_ASSERT(0);
- }
- }
- else if (z == sizeof(int))
- {
- if ((*p_arg)->type == FFI_TYPE_FLOAT)
- *(float *) argp = *(float *)(* p_argv);
- else
- *(unsigned int *) argp = (unsigned int)*(UINT32 *)(* p_argv);
- }
- else if (z == sizeof(double) && (*p_arg)->type == FFI_TYPE_DOUBLE)
- {
- *(double *) argp = *(double *)(* p_argv);
- }
- else
- {
- memcpy(argp, *p_argv, z);
- }
- return z;
-}
-/* ffi_prep_args is called by the assembly routine once stack space
- has been allocated for the function's arguments
-
- The vfp_space parameter is the load area for VFP regs, the return
- value is cif->vfp_used (word bitset of VFP regs used for passing
- arguments). These are only used for the VFP hard-float ABI.
-*/
-int ffi_prep_args_SYSV(char *stack, extended_cif *ecif, float *vfp_space)
-{
- register unsigned int i;
- register void **p_argv;
- register char *argp;
- register ffi_type **p_arg;
- argp = stack;
-
-
- if ( ecif->cif->flags == FFI_TYPE_STRUCT ) {
- *(void **) argp = ecif->rvalue;
- argp += 4;
- }
-
- p_argv = ecif->avalue;
-
- for (i = ecif->cif->nargs, p_arg = ecif->cif->arg_types;
- (i != 0);
- i--, p_arg++, p_argv++)
- {
- argp = ffi_align(p_arg, argp);
- argp += ffi_put_arg(p_arg, p_argv, argp);
- }
-
- return 0;
-}
-
-int ffi_prep_args_VFP(char *stack, extended_cif *ecif, float *vfp_space)
-{
- register unsigned int i, vi = 0;
- register void **p_argv;
- register char *argp, *regp, *eo_regp;
- register ffi_type **p_arg;
- char stack_used = 0;
- char done_with_regs = 0;
- char is_vfp_type;
-
- // make sure we are using FFI_VFP
- FFI_ASSERT(ecif->cif->abi == FFI_VFP);
-
- /* the first 4 words on the stack are used for values passed in core
- * registers. */
- regp = stack;
- eo_regp = argp = regp + 16;
-
-
- /* if the function returns an FFI_TYPE_STRUCT in memory, that address is
- * passed in r0 to the function */
- if ( ecif->cif->flags == FFI_TYPE_STRUCT ) {
- *(void **) regp = ecif->rvalue;
- regp += 4;
- }
-
- p_argv = ecif->avalue;
-
- for (i = ecif->cif->nargs, p_arg = ecif->cif->arg_types;
- (i != 0);
- i--, p_arg++, p_argv++)
- {
- is_vfp_type = vfp_type_p (*p_arg);
-
- /* Allocated in VFP registers. */
- if(vi < ecif->cif->vfp_nargs && is_vfp_type)
- {
- char *vfp_slot = (char *)(vfp_space + ecif->cif->vfp_args[vi++]);
- ffi_put_arg(p_arg, p_argv, vfp_slot);
- continue;
- }
- /* Try allocating in core registers. */
- else if (!done_with_regs && !is_vfp_type)
- {
- char *tregp = ffi_align(p_arg, regp);
- size_t size = (*p_arg)->size;
- size = (size < 4)? 4 : size; // pad
- /* Check if there is space left in the aligned register area to place
- * the argument */
- if(tregp + size <= eo_regp)
- {
- regp = tregp + ffi_put_arg(p_arg, p_argv, tregp);
- done_with_regs = (regp == argp);
- // ensure we did not write into the stack area
- FFI_ASSERT(regp <= argp);
- continue;
- }
- /* In case there are no arguments in the stack area yet,
- the argument is passed in the remaining core registers and on the
- stack. */
- else if (!stack_used)
- {
- stack_used = 1;
- done_with_regs = 1;
- argp = tregp + ffi_put_arg(p_arg, p_argv, tregp);
- FFI_ASSERT(eo_regp < argp);
- continue;
- }
- }
- /* Base case, arguments are passed on the stack */
- stack_used = 1;
- argp = ffi_align(p_arg, argp);
- argp += ffi_put_arg(p_arg, p_argv, argp);
- }
- /* Indicate the VFP registers used. */
- return ecif->cif->vfp_used;
-}
-
-/* Perform machine dependent cif processing */
-ffi_status ffi_prep_cif_machdep(ffi_cif *cif)
-{
- int type_code;
- /* Round the stack up to a multiple of 8 bytes. This isn't needed
- everywhere, but it is on some platforms, and it doesn't harm anything
- when it isn't needed. */
- cif->bytes = (cif->bytes + 7) & ~7;
-
- /* Set the return type flag */
- switch (cif->rtype->type)
- {
- case FFI_TYPE_VOID:
- case FFI_TYPE_FLOAT:
- case FFI_TYPE_DOUBLE:
- cif->flags = (unsigned) cif->rtype->type;
- break;
-
- case FFI_TYPE_SINT64:
- case FFI_TYPE_UINT64:
- cif->flags = (unsigned) FFI_TYPE_SINT64;
- break;
-
- case FFI_TYPE_STRUCT:
- if (cif->abi == FFI_VFP
- && (type_code = vfp_type_p (cif->rtype)) != 0)
- {
- /* A Composite Type passed in VFP registers, either
- FFI_TYPE_STRUCT_VFP_FLOAT or FFI_TYPE_STRUCT_VFP_DOUBLE. */
- cif->flags = (unsigned) type_code;
- }
- else if (cif->rtype->size <= 4)
- /* A Composite Type not larger than 4 bytes is returned in r0. */
- cif->flags = (unsigned)FFI_TYPE_INT;
- else
- /* A Composite Type larger than 4 bytes, or whose size cannot
- be determined statically ... is stored in memory at an
- address passed [in r0]. */
- cif->flags = (unsigned)FFI_TYPE_STRUCT;
- break;
-
- default:
- cif->flags = FFI_TYPE_INT;
- break;
- }
-
- /* Map out the register placements of VFP register args.
- The VFP hard-float calling conventions are slightly more sophisticated than
- the base calling conventions, so we do it here instead of in ffi_prep_args(). */
- if (cif->abi == FFI_VFP)
- layout_vfp_args (cif);
-
- return FFI_OK;
-}
-
-/* Perform machine dependent cif processing for variadic calls */
-ffi_status ffi_prep_cif_machdep_var(ffi_cif *cif,
- unsigned int nfixedargs,
- unsigned int ntotalargs)
-{
- /* VFP variadic calls actually use the SYSV ABI */
- if (cif->abi == FFI_VFP)
- cif->abi = FFI_SYSV;
-
- return ffi_prep_cif_machdep(cif);
-}
-
-/* Prototypes for assembly functions, in sysv.S */
-extern void ffi_call_SYSV (void (*fn)(void), extended_cif *, unsigned, unsigned, unsigned *);
-extern void ffi_call_VFP (void (*fn)(void), extended_cif *, unsigned, unsigned, unsigned *);
-
-void ffi_call(ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue)
-{
- extended_cif ecif;
-
- int small_struct = (cif->flags == FFI_TYPE_INT
- && cif->rtype->type == FFI_TYPE_STRUCT);
- int vfp_struct = (cif->flags == FFI_TYPE_STRUCT_VFP_FLOAT
- || cif->flags == FFI_TYPE_STRUCT_VFP_DOUBLE);
-
- unsigned int temp;
-
- ecif.cif = cif;
- ecif.avalue = avalue;
-
- /* If the return value is a struct and we don't have a return */
- /* value address then we need to make one */
-
- if ((rvalue == NULL) &&
- (cif->flags == FFI_TYPE_STRUCT))
- {
- ecif.rvalue = alloca(cif->rtype->size);
- }
- else if (small_struct)
- ecif.rvalue = &temp;
- else if (vfp_struct)
- {
- /* Largest case is double x 4. */
- ecif.rvalue = alloca(32);
- }
- else
- ecif.rvalue = rvalue;
-
- switch (cif->abi)
- {
- case FFI_SYSV:
- ffi_call_SYSV (fn, &ecif, cif->bytes, cif->flags, ecif.rvalue);
- break;
-
- case FFI_VFP:
-#ifdef __ARM_EABI__
- ffi_call_VFP (fn, &ecif, cif->bytes, cif->flags, ecif.rvalue);
- break;
-#endif
-
- default:
- FFI_ASSERT(0);
- break;
- }
- if (small_struct)
- {
- FFI_ASSERT(rvalue != NULL);
- memcpy (rvalue, &temp, cif->rtype->size);
- }
-
- else if (vfp_struct)
- {
- FFI_ASSERT(rvalue != NULL);
- memcpy (rvalue, ecif.rvalue, cif->rtype->size);
- }
-
-}
-
-/** private members **/
-
-static void ffi_prep_incoming_args_SYSV (char *stack, void **ret,
- void** args, ffi_cif* cif, float *vfp_stack);
-
-static void ffi_prep_incoming_args_VFP (char *stack, void **ret,
- void** args, ffi_cif* cif, float *vfp_stack);
-
-void ffi_closure_SYSV (ffi_closure *);
-
-void ffi_closure_VFP (ffi_closure *);
-
-/* This function is jumped to by the trampoline */
-
-unsigned int FFI_HIDDEN
-ffi_closure_inner (ffi_closure *closure,
- void **respp, void *args, void *vfp_args)
-{
- // our various things...
- ffi_cif *cif;
- void **arg_area;
-
- cif = closure->cif;
- arg_area = (void**) alloca (cif->nargs * sizeof (void*));
-
- /* this call will initialize ARG_AREA, such that each
- * element in that array points to the corresponding
- * value on the stack; and if the function returns
- * a structure, it will re-set RESP to point to the
- * structure return address. */
- if (cif->abi == FFI_VFP)
- ffi_prep_incoming_args_VFP(args, respp, arg_area, cif, vfp_args);
- else
- ffi_prep_incoming_args_SYSV(args, respp, arg_area, cif, vfp_args);
-
- (closure->fun) (cif, *respp, arg_area, closure->user_data);
-
- return cif->flags;
-}
-
-/*@-exportheader@*/
-static void
-ffi_prep_incoming_args_SYSV(char *stack, void **rvalue,
- void **avalue, ffi_cif *cif,
- /* Used only under VFP hard-float ABI. */
- float *vfp_stack)
-/*@=exportheader@*/
-{
- register unsigned int i;
- register void **p_argv;
- register char *argp;
- register ffi_type **p_arg;
-
- argp = stack;
-
- if ( cif->flags == FFI_TYPE_STRUCT ) {
- *rvalue = *(void **) argp;
- argp += 4;
- }
-
- p_argv = avalue;
-
- for (i = cif->nargs, p_arg = cif->arg_types; (i != 0); i--, p_arg++)
- {
- size_t z;
-
- argp = ffi_align(p_arg, argp);
-
- z = (*p_arg)->size;
-
- /* because we're little endian, this is what it turns into. */
-
- *p_argv = (void*) argp;
-
- p_argv++;
- argp += z;
- }
-
- return;
-}
-
-/*@-exportheader@*/
-static void
-ffi_prep_incoming_args_VFP(char *stack, void **rvalue,
- void **avalue, ffi_cif *cif,
- /* Used only under VFP hard-float ABI. */
- float *vfp_stack)
-/*@=exportheader@*/
-{
- register unsigned int i, vi = 0;
- register void **p_argv;
- register char *argp, *regp, *eo_regp;
- register ffi_type **p_arg;
- char done_with_regs = 0;
- char stack_used = 0;
- char is_vfp_type;
-
- FFI_ASSERT(cif->abi == FFI_VFP);
- regp = stack;
- eo_regp = argp = regp + 16;
-
- if ( cif->flags == FFI_TYPE_STRUCT ) {
- *rvalue = *(void **) regp;
- regp += 4;
- }
-
- p_argv = avalue;
-
- for (i = cif->nargs, p_arg = cif->arg_types; (i != 0); i--, p_arg++)
- {
- size_t z;
- is_vfp_type = vfp_type_p (*p_arg);
-
- if(vi < cif->vfp_nargs && is_vfp_type)
- {
- *p_argv++ = (void*)(vfp_stack + cif->vfp_args[vi++]);
- continue;
- }
- else if (!done_with_regs && !is_vfp_type)
- {
- char* tregp = ffi_align(p_arg, regp);
-
- z = (*p_arg)->size;
- z = (z < 4)? 4 : z; // pad
-
- /* if the arguments either fits into the registers or uses registers
- * and stack, while we haven't read other things from the stack */
- if(tregp + z <= eo_regp || !stack_used)
- {
- /* because we're little endian, this is what it turns into. */
- *p_argv = (void*) tregp;
-
- p_argv++;
- regp = tregp + z;
- // if we read past the last core register, make sure we have not read
- // from the stack before and continue reading after regp
- if(regp > eo_regp)
- {
- if(stack_used)
- {
- abort(); // we should never read past the end of the register
- // are if the stack is already in use
- }
- argp = regp;
- }
- if(regp >= eo_regp)
- {
- done_with_regs = 1;
- stack_used = 1;
- }
- continue;
- }
- }
- stack_used = 1;
-
- argp = ffi_align(p_arg, argp);
-
- z = (*p_arg)->size;
-
- /* because we're little endian, this is what it turns into. */
-
- *p_argv = (void*) argp;
-
- p_argv++;
- argp += z;
- }
-
- return;
-}
-
-/* How to make a trampoline. */
-
-extern unsigned int ffi_arm_trampoline[3];
-
-#if FFI_EXEC_TRAMPOLINE_TABLE
-
-#include <mach/mach.h>
-#include <pthread.h>
-#include <stdio.h>
-#include <stdlib.h>
-
-extern void *ffi_closure_trampoline_table_page;
-
-typedef struct ffi_trampoline_table ffi_trampoline_table;
-typedef struct ffi_trampoline_table_entry ffi_trampoline_table_entry;
-
-struct ffi_trampoline_table {
- /* contiguous writable and executable pages */
- vm_address_t config_page;
- vm_address_t trampoline_page;
-
- /* free list tracking */
- uint16_t free_count;
- ffi_trampoline_table_entry *free_list;
- ffi_trampoline_table_entry *free_list_pool;
-
- ffi_trampoline_table *prev;
- ffi_trampoline_table *next;
-};
-
-struct ffi_trampoline_table_entry {
- void *(*trampoline)();
- ffi_trampoline_table_entry *next;
-};
-
-/* Override the standard architecture trampoline size */
-// XXX TODO - Fix
-#undef FFI_TRAMPOLINE_SIZE
-#define FFI_TRAMPOLINE_SIZE 12
-
-/* The trampoline configuration is placed at 4080 bytes prior to the trampoline's entry point */
-#define FFI_TRAMPOLINE_CODELOC_CONFIG(codeloc) ((void **) (((uint8_t *) codeloc) - 4080));
-
-/* The first 16 bytes of the config page are unused, as they are unaddressable from the trampoline page. */
-#define FFI_TRAMPOLINE_CONFIG_PAGE_OFFSET 16
-
-/* Total number of trampolines that fit in one trampoline table */
-#define FFI_TRAMPOLINE_COUNT ((PAGE_SIZE - FFI_TRAMPOLINE_CONFIG_PAGE_OFFSET) / FFI_TRAMPOLINE_SIZE)
-
-static pthread_mutex_t ffi_trampoline_lock = PTHREAD_MUTEX_INITIALIZER;
-static ffi_trampoline_table *ffi_trampoline_tables = NULL;
-
-static ffi_trampoline_table *
-ffi_trampoline_table_alloc ()
-{
- ffi_trampoline_table *table = NULL;
-
- /* Loop until we can allocate two contiguous pages */
- while (table == NULL) {
- vm_address_t config_page = 0x0;
- kern_return_t kt;
-
- /* Try to allocate two pages */
- kt = vm_allocate (mach_task_self (), &config_page, PAGE_SIZE*2, VM_FLAGS_ANYWHERE);
- if (kt != KERN_SUCCESS) {
- fprintf(stderr, "vm_allocate() failure: %d at %s:%d\n", kt, __FILE__, __LINE__);
- break;
- }
-
- /* Now drop the second half of the allocation to make room for the trampoline table */
- vm_address_t trampoline_page = config_page+PAGE_SIZE;
- kt = vm_deallocate (mach_task_self (), trampoline_page, PAGE_SIZE);
- if (kt != KERN_SUCCESS) {
- fprintf(stderr, "vm_deallocate() failure: %d at %s:%d\n", kt, __FILE__, __LINE__);
- break;
- }
-
- /* Remap the trampoline table to directly follow the config page */
- vm_prot_t cur_prot;
- vm_prot_t max_prot;
-
- kt = vm_remap (mach_task_self (), &trampoline_page, PAGE_SIZE, 0x0, FALSE, mach_task_self (), (vm_address_t) &ffi_closure_trampoline_table_page, FALSE, &cur_prot, &max_prot, VM_INHERIT_SHARE);
-
- /* If we lost access to the destination trampoline page, drop our config allocation mapping and retry */
- if (kt != KERN_SUCCESS) {
- /* Log unexpected failures */
- if (kt != KERN_NO_SPACE) {
- fprintf(stderr, "vm_remap() failure: %d at %s:%d\n", kt, __FILE__, __LINE__);
- }
-
- vm_deallocate (mach_task_self (), config_page, PAGE_SIZE);
- continue;
- }
-
- /* We have valid trampoline and config pages */
- table = calloc (1, sizeof(ffi_trampoline_table));
- table->free_count = FFI_TRAMPOLINE_COUNT;
- table->config_page = config_page;
- table->trampoline_page = trampoline_page;
-
- /* Create and initialize the free list */
- table->free_list_pool = calloc(FFI_TRAMPOLINE_COUNT, sizeof(ffi_trampoline_table_entry));
-
- uint16_t i;
- for (i = 0; i < table->free_count; i++) {
- ffi_trampoline_table_entry *entry = &table->free_list_pool[i];
- entry->trampoline = (void *) (table->trampoline_page + (i * FFI_TRAMPOLINE_SIZE));
-
- if (i < table->free_count - 1)
- entry->next = &table->free_list_pool[i+1];
- }
-
- table->free_list = table->free_list_pool;
- }
-
- return table;
-}
-
-void *
-ffi_closure_alloc (size_t size, void **code)
-{
- /* Create the closure */
- ffi_closure *closure = malloc(size);
- if (closure == NULL)
- return NULL;
-
- pthread_mutex_lock(&ffi_trampoline_lock);
-
- /* Check for an active trampoline table with available entries. */
- ffi_trampoline_table *table = ffi_trampoline_tables;
- if (table == NULL || table->free_list == NULL) {
- table = ffi_trampoline_table_alloc ();
- if (table == NULL) {
- free(closure);
- return NULL;
- }
-
- /* Insert the new table at the top of the list */
- table->next = ffi_trampoline_tables;
- if (table->next != NULL)
- table->next->prev = table;
-
- ffi_trampoline_tables = table;
- }
-
- /* Claim the free entry */
- ffi_trampoline_table_entry *entry = ffi_trampoline_tables->free_list;
- ffi_trampoline_tables->free_list = entry->next;
- ffi_trampoline_tables->free_count--;
- entry->next = NULL;
-
- pthread_mutex_unlock(&ffi_trampoline_lock);
-
- /* Initialize the return values */
- *code = entry->trampoline;
- closure->trampoline_table = table;
- closure->trampoline_table_entry = entry;
-
- return closure;
-}
-
-void
-ffi_closure_free (void *ptr)
-{
- ffi_closure *closure = ptr;
-
- pthread_mutex_lock(&ffi_trampoline_lock);
-
- /* Fetch the table and entry references */
- ffi_trampoline_table *table = closure->trampoline_table;
- ffi_trampoline_table_entry *entry = closure->trampoline_table_entry;
-
- /* Return the entry to the free list */
- entry->next = table->free_list;
- table->free_list = entry;
- table->free_count++;
-
- /* If all trampolines within this table are free, and at least one other table exists, deallocate
- * the table */
- if (table->free_count == FFI_TRAMPOLINE_COUNT && ffi_trampoline_tables != table) {
- /* Remove from the list */
- if (table->prev != NULL)
- table->prev->next = table->next;
-
- if (table->next != NULL)
- table->next->prev = table->prev;
-
- /* Deallocate pages */
- kern_return_t kt;
- kt = vm_deallocate (mach_task_self (), table->config_page, PAGE_SIZE);
- if (kt != KERN_SUCCESS)
- fprintf(stderr, "vm_deallocate() failure: %d at %s:%d\n", kt, __FILE__, __LINE__);
-
- kt = vm_deallocate (mach_task_self (), table->trampoline_page, PAGE_SIZE);
- if (kt != KERN_SUCCESS)
- fprintf(stderr, "vm_deallocate() failure: %d at %s:%d\n", kt, __FILE__, __LINE__);
-
- /* Deallocate free list */
- free (table->free_list_pool);
- free (table);
- } else if (ffi_trampoline_tables != table) {
- /* Otherwise, bump this table to the top of the list */
- table->prev = NULL;
- table->next = ffi_trampoline_tables;
- if (ffi_trampoline_tables != NULL)
- ffi_trampoline_tables->prev = table;
-
- ffi_trampoline_tables = table;
- }
-
- pthread_mutex_unlock (&ffi_trampoline_lock);
-
- /* Free the closure */
- free (closure);
-}
-
-#else
-
-#define FFI_INIT_TRAMPOLINE(TRAMP,FUN,CTX) \
-({ unsigned char *__tramp = (unsigned char*)(TRAMP); \
- unsigned int __fun = (unsigned int)(FUN); \
- unsigned int __ctx = (unsigned int)(CTX); \
- unsigned char *insns = (unsigned char *)(CTX); \
- memcpy (__tramp, ffi_arm_trampoline, sizeof ffi_arm_trampoline); \
- *(unsigned int*) &__tramp[12] = __ctx; \
- *(unsigned int*) &__tramp[16] = __fun; \
- __clear_cache((&__tramp[0]), (&__tramp[19])); /* Clear data mapping. */ \
- __clear_cache(insns, insns + 3 * sizeof (unsigned int)); \
- /* Clear instruction \
- mapping. */ \
- })
-
-#endif
-
-/* the cif must already be prep'ed */
-
-ffi_status
-ffi_prep_closure_loc (ffi_closure* closure,
- ffi_cif* cif,
- void (*fun)(ffi_cif*,void*,void**,void*),
- void *user_data,
- void *codeloc)
-{
- void (*closure_func)(ffi_closure*) = NULL;
-
- if (cif->abi == FFI_SYSV)
- closure_func = &ffi_closure_SYSV;
-#ifdef __ARM_EABI__
- else if (cif->abi == FFI_VFP)
- closure_func = &ffi_closure_VFP;
-#endif
- else
- return FFI_BAD_ABI;
-
-#if FFI_EXEC_TRAMPOLINE_TABLE
- void **config = FFI_TRAMPOLINE_CODELOC_CONFIG(codeloc);
- config[0] = closure;
- config[1] = closure_func;
-#else
- FFI_INIT_TRAMPOLINE (&closure->tramp[0], \
- closure_func, \
- codeloc);
-#endif
-
- closure->cif = cif;
- closure->user_data = user_data;
- closure->fun = fun;
-
- return FFI_OK;
-}
-
-/* Below are routines for VFP hard-float support. */
-
-static int rec_vfp_type_p (ffi_type *t, int *elt, int *elnum)
-{
- switch (t->type)
- {
- case FFI_TYPE_FLOAT:
- case FFI_TYPE_DOUBLE:
- *elt = (int) t->type;
- *elnum = 1;
- return 1;
-
- case FFI_TYPE_STRUCT_VFP_FLOAT:
- *elt = FFI_TYPE_FLOAT;
- *elnum = t->size / sizeof (float);
- return 1;
-
- case FFI_TYPE_STRUCT_VFP_DOUBLE:
- *elt = FFI_TYPE_DOUBLE;
- *elnum = t->size / sizeof (double);
- return 1;
-
- case FFI_TYPE_STRUCT:;
- {
- int base_elt = 0, total_elnum = 0;
- ffi_type **el = t->elements;
- while (*el)
- {
- int el_elt = 0, el_elnum = 0;
- if (! rec_vfp_type_p (*el, &el_elt, &el_elnum)
- || (base_elt && base_elt != el_elt)
- || total_elnum + el_elnum > 4)
- return 0;
- base_elt = el_elt;
- total_elnum += el_elnum;
- el++;
- }
- *elnum = total_elnum;
- *elt = base_elt;
- return 1;
- }
- default: ;
- }
- return 0;
-}
-
-static int vfp_type_p (ffi_type *t)
-{
- int elt, elnum;
- if (rec_vfp_type_p (t, &elt, &elnum))
- {
- if (t->type == FFI_TYPE_STRUCT)
- {
- if (elnum == 1)
- t->type = elt;
- else
- t->type = (elt == FFI_TYPE_FLOAT
- ? FFI_TYPE_STRUCT_VFP_FLOAT
- : FFI_TYPE_STRUCT_VFP_DOUBLE);
- }
- return (int) t->type;
- }
- return 0;
-}
-
-static int place_vfp_arg (ffi_cif *cif, ffi_type *t)
-{
- short reg = cif->vfp_reg_free;
- int nregs = t->size / sizeof (float);
- int align = ((t->type == FFI_TYPE_STRUCT_VFP_FLOAT
- || t->type == FFI_TYPE_FLOAT) ? 1 : 2);
- /* Align register number. */
- if ((reg & 1) && align == 2)
- reg++;
- while (reg + nregs <= 16)
- {
- int s, new_used = 0;
- for (s = reg; s < reg + nregs; s++)
- {
- new_used |= (1 << s);
- if (cif->vfp_used & (1 << s))
- {
- reg += align;
- goto next_reg;
- }
- }
- /* Found regs to allocate. */
- cif->vfp_used |= new_used;
- cif->vfp_args[cif->vfp_nargs++] = reg;
-
- /* Update vfp_reg_free. */
- if (cif->vfp_used & (1 << cif->vfp_reg_free))
- {
- reg += nregs;
- while (cif->vfp_used & (1 << reg))
- reg += 1;
- cif->vfp_reg_free = reg;
- }
- return 0;
- next_reg: ;
- }
- // done, mark all regs as used
- cif->vfp_reg_free = 16;
- cif->vfp_used = 0xFFFF;
- return 1;
-}
-
-static void layout_vfp_args (ffi_cif *cif)
-{
- int i;
- /* Init VFP fields */
- cif->vfp_used = 0;
- cif->vfp_nargs = 0;
- cif->vfp_reg_free = 0;
- memset (cif->vfp_args, -1, 16); /* Init to -1. */
-
- for (i = 0; i < cif->nargs; i++)
- {
- ffi_type *t = cif->arg_types[i];
- if (vfp_type_p (t) && place_vfp_arg (cif, t) == 1)
- {
- break;
- }
- }
-}
diff --git a/Modules/_ctypes/libffi/src/arm/ffitarget.h b/Modules/_ctypes/libffi/src/arm/ffitarget.h
deleted file mode 100644
index 26d494d616..0000000000
--- a/Modules/_ctypes/libffi/src/arm/ffitarget.h
+++ /dev/null
@@ -1,71 +0,0 @@
-/* -----------------------------------------------------------------*-C-*-
- ffitarget.h - Copyright (c) 2012 Anthony Green
- Copyright (c) 2010 CodeSourcery
- Copyright (c) 1996-2003 Red Hat, Inc.
-
- Target configuration macros for ARM.
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- ``Software''), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to
- permit persons to whom the Software is furnished to do so, subject to
- the following conditions:
-
- The above copyright notice and this permission notice shall be included
- in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- DEALINGS IN THE SOFTWARE.
-
- ----------------------------------------------------------------------- */
-
-#ifndef LIBFFI_TARGET_H
-#define LIBFFI_TARGET_H
-
-#ifndef LIBFFI_H
-#error "Please do not include ffitarget.h directly into your source. Use ffi.h instead."
-#endif
-
-#ifndef LIBFFI_ASM
-typedef unsigned long ffi_arg;
-typedef signed long ffi_sarg;
-
-typedef enum ffi_abi {
- FFI_FIRST_ABI = 0,
- FFI_SYSV,
- FFI_VFP,
- FFI_LAST_ABI,
-#ifdef __ARM_PCS_VFP
- FFI_DEFAULT_ABI = FFI_VFP,
-#else
- FFI_DEFAULT_ABI = FFI_SYSV,
-#endif
-} ffi_abi;
-#endif
-
-#define FFI_EXTRA_CIF_FIELDS \
- int vfp_used; \
- short vfp_reg_free, vfp_nargs; \
- signed char vfp_args[16] \
-
-/* Internally used. */
-#define FFI_TYPE_STRUCT_VFP_FLOAT (FFI_TYPE_LAST + 1)
-#define FFI_TYPE_STRUCT_VFP_DOUBLE (FFI_TYPE_LAST + 2)
-
-#define FFI_TARGET_SPECIFIC_VARIADIC
-
-/* ---- Definitions for closures ----------------------------------------- */
-
-#define FFI_CLOSURES 1
-#define FFI_TRAMPOLINE_SIZE 20
-#define FFI_NATIVE_RAW_API 0
-
-#endif
diff --git a/Modules/_ctypes/libffi/src/arm/gentramp.sh b/Modules/_ctypes/libffi/src/arm/gentramp.sh
deleted file mode 100755
index 05c43a30fc..0000000000
--- a/Modules/_ctypes/libffi/src/arm/gentramp.sh
+++ /dev/null
@@ -1,118 +0,0 @@
-#!/bin/sh
-
-# -----------------------------------------------------------------------
-# gentramp.sh - Copyright (c) 2010, Plausible Labs Cooperative, Inc.
-#
-# ARM Trampoline Page Generator
-#
-# Permission is hereby granted, free of charge, to any person obtaining
-# a copy of this software and associated documentation files (the
-# ``Software''), to deal in the Software without restriction, including
-# without limitation the rights to use, copy, modify, merge, publish,
-# distribute, sublicense, and/or sell copies of the Software, and to
-# permit persons to whom the Software is furnished to do so, subject to
-# the following conditions:
-#
-# The above copyright notice and this permission notice shall be included
-# in all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
-# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
-# HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-# DEALINGS IN THE SOFTWARE.
-# -----------------------------------------------------------------------
-
-PROGNAME=$0
-
-# Each trampoline is exactly 3 instructions, or 12 bytes. If any of these values change,
-# the entire arm trampoline implementation must be updated to match, too.
-
-# Size of an individual trampoline, in bytes
-TRAMPOLINE_SIZE=12
-
-# Page size, in bytes
-PAGE_SIZE=4096
-
-# Compute the size of the reachable config page; The first 16 bytes of the config page
-# are unreachable due to our maximum pc-relative ldr offset.
-PAGE_AVAIL=`expr $PAGE_SIZE - 16`
-
-# Compute the number of of available trampolines.
-TRAMPOLINE_COUNT=`expr $PAGE_AVAIL / $TRAMPOLINE_SIZE`
-
-header () {
- echo "# GENERATED CODE - DO NOT EDIT"
- echo "# This file was generated by $PROGNAME"
- echo ""
-
- # Write out the license header
-cat << EOF
-# Copyright (c) 2010, Plausible Labs Cooperative, Inc.
-#
-# Permission is hereby granted, free of charge, to any person obtaining
-# a copy of this software and associated documentation files (the
-# ``Software''), to deal in the Software without restriction, including
-# without limitation the rights to use, copy, modify, merge, publish,
-# distribute, sublicense, and/or sell copies of the Software, and to
-# permit persons to whom the Software is furnished to do so, subject to
-# the following conditions:
-#
-# The above copyright notice and this permission notice shall be included
-# in all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
-# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
-# HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-# DEALINGS IN THE SOFTWARE.
-# -----------------------------------------------------------------------
-
-EOF
-
- # Write out the trampoline table, aligned to the page boundary
- echo ".text"
- echo ".align 12"
- echo ".globl _ffi_closure_trampoline_table_page"
- echo "_ffi_closure_trampoline_table_page:"
-}
-
-
-# WARNING - Don't modify the trampoline code size without also updating the relevant libffi code
-trampoline () {
- cat << END
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-END
-}
-
-main () {
- # Write out the header
- header
-
- # Write out the trampolines
- local i=0
- while [ $i -lt ${TRAMPOLINE_COUNT} ]; do
- trampoline
- local i=`expr $i + 1`
- done
-}
-
-main
diff --git a/Modules/_ctypes/libffi/src/arm/sysv.S b/Modules/_ctypes/libffi/src/arm/sysv.S
deleted file mode 100644
index 541bbe9230..0000000000
--- a/Modules/_ctypes/libffi/src/arm/sysv.S
+++ /dev/null
@@ -1,491 +0,0 @@
-/* -----------------------------------------------------------------------
- sysv.S - Copyright (c) 1998, 2008, 2011 Red Hat, Inc.
- Copyright (c) 2011 Plausible Labs Cooperative, Inc.
-
- ARM Foreign Function Interface
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- ``Software''), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to
- permit persons to whom the Software is furnished to do so, subject to
- the following conditions:
-
- The above copyright notice and this permission notice shall be included
- in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- DEALINGS IN THE SOFTWARE.
- ----------------------------------------------------------------------- */
-
-#define LIBFFI_ASM
-#include <fficonfig.h>
-#include <ffi.h>
-#ifdef HAVE_MACHINE_ASM_H
-#include <machine/asm.h>
-#else
-#ifdef __USER_LABEL_PREFIX__
-#define CONCAT1(a, b) CONCAT2(a, b)
-#define CONCAT2(a, b) a ## b
-
-/* Use the right prefix for global labels. */
-#define CNAME(x) CONCAT1 (__USER_LABEL_PREFIX__, x)
-#else
-#define CNAME(x) x
-#endif
-#ifdef __APPLE__
-#define ENTRY(x) .globl _##x; _##x:
-#else
-#define ENTRY(x) .globl CNAME(x); .type CNAME(x),%function; CNAME(x):
-#endif /* __APPLE__ */
-#endif
-
-#ifdef __ELF__
-#define LSYM(x) .x
-#else
-#define LSYM(x) x
-#endif
-
-/* Use the SOFTFP return value ABI on Mac OS X, as per the iOS ABI
- Function Call Guide */
-#ifdef __APPLE__
-#define __SOFTFP__
-#endif
-
-/* We need a better way of testing for this, but for now, this is all
- we can do. */
-@ This selects the minimum architecture level required.
-#define __ARM_ARCH__ 3
-
-#if defined(__ARM_ARCH_4__) || defined(__ARM_ARCH_4T__)
-# undef __ARM_ARCH__
-# define __ARM_ARCH__ 4
-#endif
-
-#if defined(__ARM_ARCH_5__) || defined(__ARM_ARCH_5T__) \
- || defined(__ARM_ARCH_5E__) || defined(__ARM_ARCH_5TE__) \
- || defined(__ARM_ARCH_5TEJ__)
-# undef __ARM_ARCH__
-# define __ARM_ARCH__ 5
-#endif
-
-#if defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_6J__) \
- || defined(__ARM_ARCH_6K__) || defined(__ARM_ARCH_6Z__) \
- || defined(__ARM_ARCH_6ZK__) || defined(__ARM_ARCH_6T2__) \
- || defined(__ARM_ARCH_6M__)
-# undef __ARM_ARCH__
-# define __ARM_ARCH__ 6
-#endif
-
-#if defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7A__) \
- || defined(__ARM_ARCH_7R__) || defined(__ARM_ARCH_7M__) \
- || defined(__ARM_ARCH_7EM__)
-# undef __ARM_ARCH__
-# define __ARM_ARCH__ 7
-#endif
-
-#if __ARM_ARCH__ >= 5
-# define call_reg(x) blx x
-#elif defined (__ARM_ARCH_4T__)
-# define call_reg(x) mov lr, pc ; bx x
-# if defined(__thumb__) || defined(__THUMB_INTERWORK__)
-# define __INTERWORKING__
-# endif
-#else
-# define call_reg(x) mov lr, pc ; mov pc, x
-#endif
-
-/* Conditionally compile unwinder directives. */
-#ifdef __ARM_EABI__
-#define UNWIND
-#else
-#define UNWIND @
-#endif
-
-.syntax unified
-
-#if defined(__thumb__) && !defined(__THUMB_INTERWORK__)
-#define ARM_FUNC_START(name) \
- .text; \
- .align 2; \
- .thumb; \
- .thumb_func; \
- ENTRY(name); \
- bx pc; \
- nop; \
- .arm; \
- UNWIND .fnstart; \
-_L__##name:
-#else
-#define ARM_FUNC_START(name) \
- .text; \
- .align 2; \
- .arm; \
- ENTRY(name); \
- UNWIND .fnstart
-#endif
-
-.macro RETLDM regs=, cond=, dirn=ia
-#if defined (__INTERWORKING__)
- .ifc "\regs",""
- ldr\cond lr, [sp], #4
- .else
- ldm\cond\dirn sp!, {\regs, lr}
- .endif
- bx\cond lr
-#else
- .ifc "\regs",""
- ldr\cond pc, [sp], #4
- .else
- ldm\cond\dirn sp!, {\regs, pc}
- .endif
-#endif
-.endm
-
- @ r0: ffi_prep_args
- @ r1: &ecif
- @ r2: cif->bytes
- @ r3: fig->flags
- @ sp+0: ecif.rvalue
-
- @ This assumes we are using gas.
-ARM_FUNC_START(ffi_call_SYSV)
- @ Save registers
- stmfd sp!, {r0-r3, fp, lr}
- UNWIND .save {r0-r3, fp, lr}
- mov fp, sp
-
- UNWIND .setfp fp, sp
-
- @ Make room for all of the new args.
- sub sp, fp, r2
-
- @ Place all of the ffi_prep_args in position
- mov r0, sp
- @ r1 already set
-
- @ Call ffi_prep_args(stack, &ecif)
- bl CNAME(ffi_prep_args_SYSV)
-
- @ move first 4 parameters in registers
- ldmia sp, {r0-r3}
-
- @ and adjust stack
- sub lr, fp, sp @ cif->bytes == fp - sp
- ldr ip, [fp] @ load fn() in advance
- cmp lr, #16
- movhs lr, #16
- add sp, sp, lr
-
- @ call (fn) (...)
- call_reg(ip)
-
- @ Remove the space we pushed for the args
- mov sp, fp
-
- @ Load r2 with the pointer to storage for the return value
- ldr r2, [sp, #24]
-
- @ Load r3 with the return type code
- ldr r3, [sp, #12]
-
- @ If the return value pointer is NULL, assume no return value.
- cmp r2, #0
- beq LSYM(Lepilogue)
-
-@ return INT
- cmp r3, #FFI_TYPE_INT
-#if defined(__SOFTFP__) || defined(__ARM_EABI__)
- cmpne r3, #FFI_TYPE_FLOAT
-#endif
- streq r0, [r2]
- beq LSYM(Lepilogue)
-
- @ return INT64
- cmp r3, #FFI_TYPE_SINT64
-#if defined(__SOFTFP__) || defined(__ARM_EABI__)
- cmpne r3, #FFI_TYPE_DOUBLE
-#endif
- stmiaeq r2, {r0, r1}
-
-#if !defined(__SOFTFP__) && !defined(__ARM_EABI__)
- beq LSYM(Lepilogue)
-
-@ return FLOAT
- cmp r3, #FFI_TYPE_FLOAT
- stfeqs f0, [r2]
- beq LSYM(Lepilogue)
-
-@ return DOUBLE or LONGDOUBLE
- cmp r3, #FFI_TYPE_DOUBLE
- stfeqd f0, [r2]
-#endif
-
-LSYM(Lepilogue):
-#if defined (__INTERWORKING__)
- ldmia sp!, {r0-r3,fp, lr}
- bx lr
-#else
- ldmia sp!, {r0-r3,fp, pc}
-#endif
-
-.ffi_call_SYSV_end:
- UNWIND .fnend
-#ifdef __ELF__
- .size CNAME(ffi_call_SYSV),.ffi_call_SYSV_end-CNAME(ffi_call_SYSV)
-#endif
-
-
-/*
- unsigned int FFI_HIDDEN
- ffi_closure_inner (closure, respp, args)
- ffi_closure *closure;
- void **respp;
- void *args;
-*/
-
-ARM_FUNC_START(ffi_closure_SYSV)
- UNWIND .pad #16
- add ip, sp, #16
- stmfd sp!, {ip, lr}
- UNWIND .save {r0, lr}
- add r2, sp, #8
- UNWIND .pad #16
- sub sp, sp, #16
- str sp, [sp, #8]
- add r1, sp, #8
- bl CNAME(ffi_closure_inner)
- cmp r0, #FFI_TYPE_INT
- beq .Lretint
-
- cmp r0, #FFI_TYPE_FLOAT
-#if defined(__SOFTFP__) || defined(__ARM_EABI__)
- beq .Lretint
-#else
- beq .Lretfloat
-#endif
-
- cmp r0, #FFI_TYPE_DOUBLE
-#if defined(__SOFTFP__) || defined(__ARM_EABI__)
- beq .Lretlonglong
-#else
- beq .Lretdouble
-#endif
-
- cmp r0, #FFI_TYPE_LONGDOUBLE
-#if defined(__SOFTFP__) || defined(__ARM_EABI__)
- beq .Lretlonglong
-#else
- beq .Lretlongdouble
-#endif
-
- cmp r0, #FFI_TYPE_SINT64
- beq .Lretlonglong
-.Lclosure_epilogue:
- add sp, sp, #16
- ldmfd sp, {sp, pc}
-.Lretint:
- ldr r0, [sp]
- b .Lclosure_epilogue
-.Lretlonglong:
- ldr r0, [sp]
- ldr r1, [sp, #4]
- b .Lclosure_epilogue
-
-#if !defined(__SOFTFP__) && !defined(__ARM_EABI__)
-.Lretfloat:
- ldfs f0, [sp]
- b .Lclosure_epilogue
-.Lretdouble:
- ldfd f0, [sp]
- b .Lclosure_epilogue
-.Lretlongdouble:
- ldfd f0, [sp]
- b .Lclosure_epilogue
-#endif
-
-.ffi_closure_SYSV_end:
- UNWIND .fnend
-#ifdef __ELF__
- .size CNAME(ffi_closure_SYSV),.ffi_closure_SYSV_end-CNAME(ffi_closure_SYSV)
-#endif
-
-
-/* Below are VFP hard-float ABI call and closure implementations.
- Add VFP FPU directive here. This is only compiled into the library
- under EABI. */
-#ifdef __ARM_EABI__
- .fpu vfp
-
- @ r0: fn
- @ r1: &ecif
- @ r2: cif->bytes
- @ r3: fig->flags
- @ sp+0: ecif.rvalue
-
-ARM_FUNC_START(ffi_call_VFP)
- @ Save registers
- stmfd sp!, {r0-r3, fp, lr}
- UNWIND .save {r0-r3, fp, lr}
- mov fp, sp
- UNWIND .setfp fp, sp
-
- @ Make room for all of the new args.
- sub sp, sp, r2
-
- @ Make room for loading VFP args
- sub sp, sp, #64
-
- @ Place all of the ffi_prep_args in position
- mov r0, sp
- @ r1 already set
- sub r2, fp, #64 @ VFP scratch space
-
- @ Call ffi_prep_args(stack, &ecif, vfp_space)
- bl CNAME(ffi_prep_args_VFP)
-
- @ Load VFP register args if needed
- cmp r0, #0
- mov ip, fp
- beq LSYM(Lbase_args)
-
- @ Load only d0 if possible
- cmp r0, #3
- sub ip, fp, #64
- flddle d0, [ip]
- fldmiadgt ip, {d0-d7}
-
-LSYM(Lbase_args):
- @ move first 4 parameters in registers
- ldmia sp, {r0-r3}
-
- @ and adjust stack
- sub lr, ip, sp @ cif->bytes == (fp - 64) - sp
- ldr ip, [fp] @ load fn() in advance
- cmp lr, #16
- movhs lr, #16
- add sp, sp, lr
-
- @ call (fn) (...)
- call_reg(ip)
-
- @ Remove the space we pushed for the args
- mov sp, fp
-
- @ Load r2 with the pointer to storage for
- @ the return value
- ldr r2, [sp, #24]
-
- @ Load r3 with the return type code
- ldr r3, [sp, #12]
-
- @ If the return value pointer is NULL,
- @ assume no return value.
- cmp r2, #0
- beq LSYM(Lepilogue_vfp)
-
- cmp r3, #FFI_TYPE_INT
- streq r0, [r2]
- beq LSYM(Lepilogue_vfp)
-
- cmp r3, #FFI_TYPE_SINT64
- stmeqia r2, {r0, r1}
- beq LSYM(Lepilogue_vfp)
-
- cmp r3, #FFI_TYPE_FLOAT
- fstseq s0, [r2]
- beq LSYM(Lepilogue_vfp)
-
- cmp r3, #FFI_TYPE_DOUBLE
- fstdeq d0, [r2]
- beq LSYM(Lepilogue_vfp)
-
- cmp r3, #FFI_TYPE_STRUCT_VFP_FLOAT
- cmpne r3, #FFI_TYPE_STRUCT_VFP_DOUBLE
- fstmiadeq r2, {d0-d3}
-
-LSYM(Lepilogue_vfp):
- RETLDM "r0-r3,fp"
-
-.ffi_call_VFP_end:
- UNWIND .fnend
- .size CNAME(ffi_call_VFP),.ffi_call_VFP_end-CNAME(ffi_call_VFP)
-
-
-ARM_FUNC_START(ffi_closure_VFP)
- fstmfdd sp!, {d0-d7}
- @ r0-r3, then d0-d7
- UNWIND .pad #80
- add ip, sp, #80
- stmfd sp!, {ip, lr}
- UNWIND .save {r0, lr}
- add r2, sp, #72
- add r3, sp, #8
- UNWIND .pad #72
- sub sp, sp, #72
- str sp, [sp, #64]
- add r1, sp, #64
- bl CNAME(ffi_closure_inner)
-
- cmp r0, #FFI_TYPE_INT
- beq .Lretint_vfp
-
- cmp r0, #FFI_TYPE_FLOAT
- beq .Lretfloat_vfp
-
- cmp r0, #FFI_TYPE_DOUBLE
- cmpne r0, #FFI_TYPE_LONGDOUBLE
- beq .Lretdouble_vfp
-
- cmp r0, #FFI_TYPE_SINT64
- beq .Lretlonglong_vfp
-
- cmp r0, #FFI_TYPE_STRUCT_VFP_FLOAT
- beq .Lretfloat_struct_vfp
-
- cmp r0, #FFI_TYPE_STRUCT_VFP_DOUBLE
- beq .Lretdouble_struct_vfp
-
-.Lclosure_epilogue_vfp:
- add sp, sp, #72
- ldmfd sp, {sp, pc}
-
-.Lretfloat_vfp:
- flds s0, [sp]
- b .Lclosure_epilogue_vfp
-.Lretdouble_vfp:
- fldd d0, [sp]
- b .Lclosure_epilogue_vfp
-.Lretint_vfp:
- ldr r0, [sp]
- b .Lclosure_epilogue_vfp
-.Lretlonglong_vfp:
- ldmia sp, {r0, r1}
- b .Lclosure_epilogue_vfp
-.Lretfloat_struct_vfp:
- fldmiad sp, {d0-d1}
- b .Lclosure_epilogue_vfp
-.Lretdouble_struct_vfp:
- fldmiad sp, {d0-d3}
- b .Lclosure_epilogue_vfp
-
-.ffi_closure_VFP_end:
- UNWIND .fnend
- .size CNAME(ffi_closure_VFP),.ffi_closure_VFP_end-CNAME(ffi_closure_VFP)
-#endif
-
-ENTRY(ffi_arm_trampoline)
- stmfd sp!, {r0-r3}
- ldr r0, [pc]
- ldr pc, [pc]
-
-#if defined __ELF__ && defined __linux__
- .section .note.GNU-stack,"",%progbits
-#endif
diff --git a/Modules/_ctypes/libffi/src/arm/trampoline.S b/Modules/_ctypes/libffi/src/arm/trampoline.S
deleted file mode 100644
index 935e8de179..0000000000
--- a/Modules/_ctypes/libffi/src/arm/trampoline.S
+++ /dev/null
@@ -1,4450 +0,0 @@
-# GENERATED CODE - DO NOT EDIT
-# This file was generated by src/arm/gentramp.sh
-
-# Copyright (c) 2010, Plausible Labs Cooperative, Inc.
-#
-# Permission is hereby granted, free of charge, to any person obtaining
-# a copy of this software and associated documentation files (the
-# Software''), to deal in the Software without restriction, including
-# without limitation the rights to use, copy, modify, merge, publish,
-# distribute, sublicense, and/or sell copies of the Software, and to
-# permit persons to whom the Software is furnished to do so, subject to
-# the following conditions:
-#
-# The above copyright notice and this permission notice shall be included
-# in all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED AS IS'', WITHOUT WARRANTY OF ANY KIND,
-# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
-# HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-# DEALINGS IN THE SOFTWARE.
-# -----------------------------------------------------------------------
-
-.text
-.align 12
-.globl _ffi_closure_trampoline_table_page
-_ffi_closure_trampoline_table_page:
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
-
- // trampoline
- // Save to stack
- stmfd sp!, {r0-r3}
-
- // Load the context argument from the config page.
- // This places the first usable config value at _ffi_closure_trampoline_table-4080
- // This accounts for the above 4-byte stmfd instruction, plus 8 bytes constant when loading from pc.
- ldr r0, [pc, #-4092]
-
- // Load the jump address from the config page.
- ldr pc, [pc, #-4092]
-
diff --git a/Modules/_ctypes/libffi/src/avr32/ffi.c b/Modules/_ctypes/libffi/src/avr32/ffi.c
deleted file mode 100644
index 3d43397b03..0000000000
--- a/Modules/_ctypes/libffi/src/avr32/ffi.c
+++ /dev/null
@@ -1,423 +0,0 @@
-/* -----------------------------------------------------------------------
- ffi.c - Copyright (c) 2011 Anthony Green
- Copyright (c) 2009 Bradley Smith <brad@brad-smith.co.uk>
-
- AVR32 Foreign Function Interface
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- ``Software''), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to
- permit persons to whom the Software is furnished to do so, subject to
- the following conditions:
-
- The above copyright notice and this permission notice shall be included
- in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- DEALINGS IN THE SOFTWARE.
- ----------------------------------------------------------------------- */
-
-#include <ffi.h>
-#include <ffi_common.h>
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <unistd.h>
-#include <asm/unistd.h>
-
-/* #define DEBUG */
-
-extern void ffi_call_SYSV(void (*)(char *, extended_cif *), extended_cif *,
- unsigned int, unsigned int, unsigned int*, unsigned int,
- void (*fn)(void));
-extern void ffi_closure_SYSV (ffi_closure *);
-
-unsigned int pass_struct_on_stack(ffi_type *type)
-{
- if(type->type != FFI_TYPE_STRUCT)
- return 0;
-
- if(type->alignment < type->size &&
- !(type->size == 4 || type->size == 8) &&
- !(type->size == 8 && type->alignment >= 4))
- return 1;
-
- if(type->size == 3 || type->size == 5 || type->size == 6 ||
- type->size == 7)
- return 1;
-
- return 0;
-}
-
-/* ffi_prep_args is called by the assembly routine once stack space
- * has been allocated for the function's arguments
- *
- * This is annoyingly complex since we need to keep track of used
- * registers.
- */
-
-void ffi_prep_args(char *stack, extended_cif *ecif)
-{
- unsigned int i;
- void **p_argv;
- ffi_type **p_arg;
- char *reg_base = stack;
- char *stack_base = stack + 20;
- unsigned int stack_offset = 0;
- unsigned int reg_mask = 0;
-
- p_argv = ecif->avalue;
-
- /* If cif->flags is struct then we know it's not passed in registers */
- if(ecif->cif->flags == FFI_TYPE_STRUCT)
- {
- *(void**)reg_base = ecif->rvalue;
- reg_mask |= 1;
- }
-
- for(i = 0, p_arg = ecif->cif->arg_types; i < ecif->cif->nargs;
- i++, p_arg++)
- {
- size_t z = (*p_arg)->size;
- int alignment = (*p_arg)->alignment;
- int type = (*p_arg)->type;
- char *addr = 0;
-
- if(z % 4 != 0)
- z += (4 - z % 4);
-
- if(reg_mask != 0x1f)
- {
- if(pass_struct_on_stack(*p_arg))
- {
- addr = stack_base + stack_offset;
- stack_offset += z;
- }
- else if(z == sizeof(int))
- {
- char index = 0;
-
- while((reg_mask >> index) & 1)
- index++;
-
- addr = reg_base + (index * 4);
- reg_mask |= (1 << index);
- }
- else if(z == 2 * sizeof(int))
- {
- if(!((reg_mask >> 1) & 1))
- {
- addr = reg_base + 4;
- reg_mask |= (3 << 1);
- }
- else if(!((reg_mask >> 3) & 1))
- {
- addr = reg_base + 12;
- reg_mask |= (3 << 3);
- }
- }
- }
-
- if(!addr)
- {
- addr = stack_base + stack_offset;
- stack_offset += z;
- }
-
- if(type == FFI_TYPE_STRUCT && (*p_arg)->elements[1] == NULL)
- type = (*p_arg)->elements[0]->type;
-
- switch(type)
- {
- case FFI_TYPE_UINT8:
- *(unsigned int *)addr = (unsigned int)*(UINT8 *)(*p_argv);
- break;
- case FFI_TYPE_SINT8:
- *(signed int *)addr = (signed int)*(SINT8 *)(*p_argv);
- break;
- case FFI_TYPE_UINT16:
- *(unsigned int *)addr = (unsigned int)*(UINT16 *)(*p_argv);
- break;
- case FFI_TYPE_SINT16:
- *(signed int *)addr = (signed int)*(SINT16 *)(*p_argv);
- break;
- default:
- memcpy(addr, *p_argv, z);
- }
-
- p_argv++;
- }
-
-#ifdef DEBUG
- /* Debugging */
- for(i = 0; i < 5; i++)
- {
- if((reg_mask & (1 << i)) == 0)
- printf("r%d: (unused)\n", 12 - i);
- else
- printf("r%d: 0x%08x\n", 12 - i, ((unsigned int*)reg_base)[i]);
- }
-
- for(i = 0; i < stack_offset / 4; i++)
- {
- printf("sp+%d: 0x%08x\n", i*4, ((unsigned int*)stack_base)[i]);
- }
-#endif
-}
-
-/* Perform machine dependent cif processing */
-ffi_status ffi_prep_cif_machdep(ffi_cif *cif)
-{
- /* Round the stack up to a multiple of 8 bytes. This isn't needed
- * everywhere, but it is on some platforms, and it doesn't harm
- * anything when it isn't needed. */
- cif->bytes = (cif->bytes + 7) & ~7;
-
- /* Flag to indicate that he return value is in fact a struct */
- cif->rstruct_flag = 0;
-
- /* Set the return type flag */
- switch(cif->rtype->type)
- {
- case FFI_TYPE_SINT8:
- case FFI_TYPE_UINT8:
- cif->flags = (unsigned)FFI_TYPE_UINT8;
- break;
- case FFI_TYPE_SINT16:
- case FFI_TYPE_UINT16:
- cif->flags = (unsigned)FFI_TYPE_UINT16;
- break;
- case FFI_TYPE_FLOAT:
- case FFI_TYPE_SINT32:
- case FFI_TYPE_UINT32:
- case FFI_TYPE_POINTER:
- cif->flags = (unsigned)FFI_TYPE_UINT32;
- break;
- case FFI_TYPE_DOUBLE:
- case FFI_TYPE_SINT64:
- case FFI_TYPE_UINT64:
- cif->flags = (unsigned)FFI_TYPE_UINT64;
- break;
- case FFI_TYPE_STRUCT:
- cif->rstruct_flag = 1;
- if(!pass_struct_on_stack(cif->rtype))
- {
- if(cif->rtype->size <= 1)
- cif->flags = (unsigned)FFI_TYPE_UINT8;
- else if(cif->rtype->size <= 2)
- cif->flags = (unsigned)FFI_TYPE_UINT16;
- else if(cif->rtype->size <= 4)
- cif->flags = (unsigned)FFI_TYPE_UINT32;
- else if(cif->rtype->size <= 8)
- cif->flags = (unsigned)FFI_TYPE_UINT64;
- else
- cif->flags = (unsigned)cif->rtype->type;
- }
- else
- cif->flags = (unsigned)cif->rtype->type;
- break;
- default:
- cif->flags = (unsigned)cif->rtype->type;
- break;
- }
-
- return FFI_OK;
-}
-
-void ffi_call(ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue)
-{
- extended_cif ecif;
-
- unsigned int size = 0, i = 0;
- ffi_type **p_arg;
-
- ecif.cif = cif;
- ecif.avalue = avalue;
-
- for(i = 0, p_arg = cif->arg_types; i < cif->nargs; i++, p_arg++)
- size += (*p_arg)->size + (4 - (*p_arg)->size % 4);
-
- /* If the return value is a struct and we don't have a return value
- * address then we need to make one */
-
- /* If cif->flags is struct then it's not suitable for registers */
- if((rvalue == NULL) && (cif->flags == FFI_TYPE_STRUCT))
- ecif.rvalue = alloca(cif->rtype->size);
- else
- ecif.rvalue = rvalue;
-
- switch(cif->abi)
- {
- case FFI_SYSV:
- ffi_call_SYSV(ffi_prep_args, &ecif, size, cif->flags,
- ecif.rvalue, cif->rstruct_flag, fn);
- break;
- default:
- FFI_ASSERT(0);
- break;
- }
-}
-
-static void ffi_prep_incoming_args_SYSV(char *stack, void **rvalue,
- void **avalue, ffi_cif *cif)
-{
- register unsigned int i, reg_mask = 0;
- register void **p_argv;
- register ffi_type **p_arg;
- register char *reg_base = stack;
- register char *stack_base = stack + 20;
- register unsigned int stack_offset = 0;
-
-#ifdef DEBUG
- /* Debugging */
- for(i = 0; i < cif->nargs + 7; i++)
- {
- printf("sp+%d: 0x%08x\n", i*4, ((unsigned int*)stack)[i]);
- }
-#endif
-
- /* If cif->flags is struct then we know it's not passed in registers */
- if(cif->flags == FFI_TYPE_STRUCT)
- {
- *rvalue = *(void **)reg_base;
- reg_mask |= 1;
- }
-
- p_argv = avalue;
-
- for(i = 0, p_arg = cif->arg_types; i < cif->nargs; i++, p_arg++)
- {
- size_t z = (*p_arg)->size;
- int alignment = (*p_arg)->alignment;
-
- *p_argv = 0;
-
- if(z % 4 != 0)
- z += (4 - z % 4);
-
- if(reg_mask != 0x1f)
- {
- if(pass_struct_on_stack(*p_arg))
- {
- *p_argv = (void*)stack_base + stack_offset;
- stack_offset += z;
- }
- else if(z <= sizeof(int))
- {
- char index = 0;
-
- while((reg_mask >> index) & 1)
- index++;
-
- *p_argv = (void*)reg_base + (index * 4);
- reg_mask |= (1 << index);
- }
- else if(z == 2 * sizeof(int))
- {
- if(!((reg_mask >> 1) & 1))
- {
- *p_argv = (void*)reg_base + 4;
- reg_mask |= (3 << 1);
- }
- else if(!((reg_mask >> 3) & 1))
- {
- *p_argv = (void*)reg_base + 12;
- reg_mask |= (3 << 3);
- }
- }
- }
-
- if(!*p_argv)
- {
- *p_argv = (void*)stack_base + stack_offset;
- stack_offset += z;
- }
-
- if((*p_arg)->type != FFI_TYPE_STRUCT ||
- (*p_arg)->elements[1] == NULL)
- {
- if(alignment == 1)
- **(unsigned int**)p_argv <<= 24;
- else if(alignment == 2)
- **(unsigned int**)p_argv <<= 16;
- }
-
- p_argv++;
- }
-
-#ifdef DEBUG
- /* Debugging */
- for(i = 0; i < cif->nargs; i++)
- {
- printf("sp+%d: 0x%08x\n", i*4, *(((unsigned int**)avalue)[i]));
- }
-#endif
-}
-
-/* This function is jumped to by the trampoline */
-
-unsigned int ffi_closure_SYSV_inner(ffi_closure *closure, void **respp,
- void *args)
-{
- ffi_cif *cif;
- void **arg_area;
- unsigned int i, size = 0;
- ffi_type **p_arg;
-
- cif = closure->cif;
-
- for(i = 0, p_arg = cif->arg_types; i < cif->nargs; i++, p_arg++)
- size += (*p_arg)->size + (4 - (*p_arg)->size % 4);
-
- arg_area = (void **)alloca(size);
-
- /* this call will initialize ARG_AREA, such that each element in that
- * array points to the corresponding value on the stack; and if the
- * function returns a structure, it will re-set RESP to point to the
- * structure return address. */
-
- ffi_prep_incoming_args_SYSV(args, respp, arg_area, cif);
-
- (closure->fun)(cif, *respp, arg_area, closure->user_data);
-
- return cif->flags;
-}
-
-ffi_status ffi_prep_closure_loc(ffi_closure* closure, ffi_cif* cif,
- void (*fun)(ffi_cif*, void*, void**, void*), void *user_data,
- void *codeloc)
-{
- if (cif->abi != FFI_SYSV)
- return FFI_BAD_ABI;
-
- unsigned char *__tramp = (unsigned char*)(&closure->tramp[0]);
- unsigned int __fun = (unsigned int)(&ffi_closure_SYSV);
- unsigned int __ctx = (unsigned int)(codeloc);
- unsigned int __rstruct_flag = (unsigned int)(cif->rstruct_flag);
- unsigned int __inner = (unsigned int)(&ffi_closure_SYSV_inner);
- *(unsigned int*) &__tramp[0] = 0xebcd1f00; /* pushm r8-r12 */
- *(unsigned int*) &__tramp[4] = 0xfefc0010; /* ld.w r12, pc[16] */
- *(unsigned int*) &__tramp[8] = 0xfefb0010; /* ld.w r11, pc[16] */
- *(unsigned int*) &__tramp[12] = 0xfefa0010; /* ld.w r10, pc[16] */
- *(unsigned int*) &__tramp[16] = 0xfeff0010; /* ld.w pc, pc[16] */
- *(unsigned int*) &__tramp[20] = __ctx;
- *(unsigned int*) &__tramp[24] = __rstruct_flag;
- *(unsigned int*) &__tramp[28] = __inner;
- *(unsigned int*) &__tramp[32] = __fun;
- syscall(__NR_cacheflush, 0, (&__tramp[0]), 36);
-
- closure->cif = cif;
- closure->user_data = user_data;
- closure->fun = fun;
-
- return FFI_OK;
-}
-
diff --git a/Modules/_ctypes/libffi/src/avr32/ffitarget.h b/Modules/_ctypes/libffi/src/avr32/ffitarget.h
deleted file mode 100644
index d0c7586f9a..0000000000
--- a/Modules/_ctypes/libffi/src/avr32/ffitarget.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/* -----------------------------------------------------------------*-C-*-
- ffitarget.h - Copyright (c) 2012 Anthony Green
- Copyright (c) 2009 Bradley Smith <brad@brad-smith.co.uk>
- Target configuration macros for AVR32.
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- ``Software''), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to
- permit persons to whom the Software is furnished to do so, subject to
- the following conditions:
-
- The above copyright notice and this permission notice shall be included
- in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- DEALINGS IN THE SOFTWARE.
-
- ----------------------------------------------------------------------- */
-
-#ifndef LIBFFI_TARGET_H
-#define LIBFFI_TARGET_H
-
-#ifndef LIBFFI_H
-#error "Please do not include ffitarget.h directly into your source. Use ffi.h instead."
-#endif
-
-#ifndef LIBFFI_ASM
-typedef unsigned long ffi_arg;
-typedef signed long ffi_sarg;
-
-typedef enum ffi_abi {
- FFI_FIRST_ABI = 0,
- FFI_SYSV,
- FFI_LAST_ABI,
- FFI_DEFAULT_ABI = FFI_SYSV
-} ffi_abi;
-#endif
-
-#define FFI_EXTRA_CIF_FIELDS unsigned int rstruct_flag
-
-/* Definitions for closures */
-
-#define FFI_CLOSURES 1
-#define FFI_TRAMPOLINE_SIZE 36
-#define FFI_NATIVE_RAW_API 0
-
-#endif
diff --git a/Modules/_ctypes/libffi/src/avr32/sysv.S b/Modules/_ctypes/libffi/src/avr32/sysv.S
deleted file mode 100644
index a984b3c88a..0000000000
--- a/Modules/_ctypes/libffi/src/avr32/sysv.S
+++ /dev/null
@@ -1,208 +0,0 @@
-/* -----------------------------------------------------------------------
- sysv.S - Copyright (c) 2009 Bradley Smith <brad@brad-smith.co.uk>
-
- AVR32 Foreign Function Interface
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- ``Software''), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to
- permit persons to whom the Software is furnished to do so, subject to
- the following conditions:
-
- The above copyright notice and this permission notice shall be included
- in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
- CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- --------------------------------------------------------------------- */
-
-#define LIBFFI_ASM
-#include <fficonfig.h>
-#include <ffi.h>
-
- /* r12: ffi_prep_args
- * r11: &ecif
- * r10: size
- * r9: cif->flags
- * r8: ecif.rvalue
- * sp+0: cif->rstruct_flag
- * sp+4: fn */
-
- .text
- .align 1
- .globl ffi_call_SYSV
- .type ffi_call_SYSV, @function
-ffi_call_SYSV:
- stm --sp, r0,r1,lr
- stm --sp, r8-r12
- mov r0, sp
-
- /* Make room for all of the new args. */
- sub sp, r10
- /* Pad to make way for potential skipped registers */
- sub sp, 20
-
- /* Call ffi_prep_args(stack, &ecif). */
- /* r11 already set */
- mov r1, r12
- mov r12, sp
- icall r1
-
- /* Save new argument size */
- mov r1, r12
-
- /* Move first 5 parameters in registers. */
- ldm sp++, r8-r12
-
- /* call (fn) (...). */
- ld.w r1, r0[36]
- icall r1
-
- /* Remove the space we pushed for the args. */
- mov sp, r0
-
- /* Load r1 with the rstruct flag. */
- ld.w r1, sp[32]
-
- /* Load r9 with the return type code. */
- ld.w r9, sp[12]
-
- /* Load r8 with the return value pointer. */
- ld.w r8, sp[16]
-
- /* If the return value pointer is NULL, assume no return value. */
- cp.w r8, 0
- breq .Lend
-
- /* Check if return type is actually a struct */
- cp.w r1, 0
- breq 1f
-
- /* Return 8bit */
- cp.w r9, FFI_TYPE_UINT8
- breq .Lstore8
-
- /* Return 16bit */
- cp.w r9, FFI_TYPE_UINT16
- breq .Lstore16
-
-1:
- /* Return 32bit */
- cp.w r9, FFI_TYPE_UINT32
- breq .Lstore32
- cp.w r9, FFI_TYPE_UINT16
- breq .Lstore32
- cp.w r9, FFI_TYPE_UINT8
- breq .Lstore32
-
- /* Return 64bit */
- cp.w r9, FFI_TYPE_UINT64
- breq .Lstore64
-
- /* Didn't match anything */
- bral .Lend
-
-.Lstore64:
- st.w r8[0], r11
- st.w r8[4], r10
- bral .Lend
-
-.Lstore32:
- st.w r8[0], r12
- bral .Lend
-
-.Lstore16:
- st.h r8[0], r12
- bral .Lend
-
-.Lstore8:
- st.b r8[0], r12
- bral .Lend
-
-.Lend:
- sub sp, -20
- ldm sp++, r0,r1,pc
-
- .size ffi_call_SYSV, . - ffi_call_SYSV
-
-
- /* r12: __ctx
- * r11: __rstruct_flag
- * r10: __inner */
-
- .align 1
- .globl ffi_closure_SYSV
- .type ffi_closure_SYSV, @function
-ffi_closure_SYSV:
- stm --sp, r0,lr
- mov r0, r11
- mov r8, r10
- sub r10, sp, -8
- sub sp, 12
- st.w sp[8], sp
- sub r11, sp, -8
- icall r8
-
- /* Check if return type is actually a struct */
- cp.w r0, 0
- breq 1f
-
- /* Return 8bit */
- cp.w r12, FFI_TYPE_UINT8
- breq .Lget8
-
- /* Return 16bit */
- cp.w r12, FFI_TYPE_UINT16
- breq .Lget16
-
-1:
- /* Return 32bit */
- cp.w r12, FFI_TYPE_UINT32
- breq .Lget32
- cp.w r12, FFI_TYPE_UINT16
- breq .Lget32
- cp.w r12, FFI_TYPE_UINT8
- breq .Lget32
-
- /* Return 64bit */
- cp.w r12, FFI_TYPE_UINT64
- breq .Lget64
-
- /* Didn't match anything */
- bral .Lclend
-
-.Lget64:
- ld.w r11, sp[0]
- ld.w r10, sp[4]
- bral .Lclend
-
-.Lget32:
- ld.w r12, sp[0]
- bral .Lclend
-
-.Lget16:
- ld.uh r12, sp[0]
- bral .Lclend
-
-.Lget8:
- ld.ub r12, sp[0]
- bral .Lclend
-
-.Lclend:
- sub sp, -12
- ldm sp++, r0,lr
- sub sp, -20
- mov pc, lr
-
- .size ffi_closure_SYSV, . - ffi_closure_SYSV
-
-#if defined __ELF__ && defined __linux__
- .section .note.GNU-stack,"",@progbits
-#endif
diff --git a/Modules/_ctypes/libffi/src/bfin/ffi.c b/Modules/_ctypes/libffi/src/bfin/ffi.c
deleted file mode 100644
index 22a2acdac1..0000000000
--- a/Modules/_ctypes/libffi/src/bfin/ffi.c
+++ /dev/null
@@ -1,196 +0,0 @@
-/* -----------------------------------------------------------------------
- ffi.c - Copyright (c) 2012 Alexandre K. I. de Mendonca <alexandre.keunecke@gmail.com>,
- Paulo Pizarro <paulo.pizarro@gmail.com>
-
- Blackfin Foreign Function Interface
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- ``Software''), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to
- permit persons to whom the Software is furnished to do so, subject to
- the following conditions:
-
- The above copyright notice and this permission notice shall be included
- in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- DEALINGS IN THE SOFTWARE.
- ----------------------------------------------------------------------- */
-#include <ffi.h>
-#include <ffi_common.h>
-
-#include <stdlib.h>
-#include <stdio.h>
-
-/* Maximum number of GPRs available for argument passing. */
-#define MAX_GPRARGS 3
-
-/*
- * Return types
- */
-#define FFIBFIN_RET_VOID 0
-#define FFIBFIN_RET_BYTE 1
-#define FFIBFIN_RET_HALFWORD 2
-#define FFIBFIN_RET_INT64 3
-#define FFIBFIN_RET_INT32 4
-
-/*====================================================================*/
-/* PROTOTYPE *
- /*====================================================================*/
-void ffi_prep_args(unsigned char *, extended_cif *);
-
-/*====================================================================*/
-/* Externals */
-/* (Assembly) */
-/*====================================================================*/
-
-extern void ffi_call_SYSV(unsigned, extended_cif *, void(*)(unsigned char *, extended_cif *), unsigned, void *, void(*fn)(void));
-
-/*====================================================================*/
-/* Implementation */
-/* */
-/*====================================================================*/
-
-
-/*
- * This function calculates the return type (size) based on type.
- */
-
-ffi_status ffi_prep_cif_machdep(ffi_cif *cif)
-{
- /* --------------------------------------*
- * Return handling *
- * --------------------------------------*/
- switch (cif->rtype->type) {
- case FFI_TYPE_VOID:
- cif->flags = FFIBFIN_RET_VOID;
- break;
- case FFI_TYPE_UINT16:
- case FFI_TYPE_SINT16:
- cif->flags = FFIBFIN_RET_HALFWORD;
- break;
- case FFI_TYPE_UINT8:
- cif->flags = FFIBFIN_RET_BYTE;
- break;
- case FFI_TYPE_INT:
- case FFI_TYPE_UINT32:
- case FFI_TYPE_SINT32:
- case FFI_TYPE_FLOAT:
- case FFI_TYPE_POINTER:
- case FFI_TYPE_SINT8:
- cif->flags = FFIBFIN_RET_INT32;
- break;
- case FFI_TYPE_SINT64:
- case FFI_TYPE_UINT64:
- case FFI_TYPE_DOUBLE:
- cif->flags = FFIBFIN_RET_INT64;
- break;
- case FFI_TYPE_STRUCT:
- if (cif->rtype->size <= 4){
- cif->flags = FFIBFIN_RET_INT32;
- }else if (cif->rtype->size == 8){
- cif->flags = FFIBFIN_RET_INT64;
- }else{
- //it will return via a hidden pointer in P0
- cif->flags = FFIBFIN_RET_VOID;
- }
- break;
- default:
- FFI_ASSERT(0);
- break;
- }
- return FFI_OK;
-}
-
-/*
- * This will prepare the arguments and will call the assembly routine
- * cif = the call interface
- * fn = the function to be called
- * rvalue = the return value
- * avalue = the arguments
- */
-void ffi_call(ffi_cif *cif, void(*fn)(void), void *rvalue, void **avalue)
-{
- int ret_type = cif->flags;
- extended_cif ecif;
- ecif.cif = cif;
- ecif.avalue = avalue;
- ecif.rvalue = rvalue;
-
- switch (cif->abi) {
- case FFI_SYSV:
- ffi_call_SYSV(cif->bytes, &ecif, ffi_prep_args, ret_type, ecif.rvalue, fn);
- break;
- default:
- FFI_ASSERT(0);
- break;
- }
-}
-
-
-/*
-* This function prepares the parameters (copies them from the ecif to the stack)
-* to call the function (ffi_prep_args is called by the assembly routine in file
-* sysv.S, which also calls the actual function)
-*/
-void ffi_prep_args(unsigned char *stack, extended_cif *ecif)
-{
- register unsigned int i = 0;
- void **p_argv;
- unsigned char *argp;
- ffi_type **p_arg;
- argp = stack;
- p_argv = ecif->avalue;
- for (i = ecif->cif->nargs, p_arg = ecif->cif->arg_types;
- (i != 0);
- i--, p_arg++) {
- size_t z;
- z = (*p_arg)->size;
- if (z < sizeof(int)) {
- z = sizeof(int);
- switch ((*p_arg)->type) {
- case FFI_TYPE_SINT8: {
- signed char v = *(SINT8 *)(* p_argv);
- signed int t = v;
- *(signed int *) argp = t;
- }
- break;
- case FFI_TYPE_UINT8: {
- unsigned char v = *(UINT8 *)(* p_argv);
- unsigned int t = v;
- *(unsigned int *) argp = t;
- }
- break;
- case FFI_TYPE_SINT16:
- *(signed int *) argp = (signed int) * (SINT16 *)(* p_argv);
- break;
- case FFI_TYPE_UINT16:
- *(unsigned int *) argp = (unsigned int) * (UINT16 *)(* p_argv);
- break;
- case FFI_TYPE_STRUCT:
- memcpy(argp, *p_argv, (*p_arg)->size);
- break;
- default:
- FFI_ASSERT(0);
- break;
- }
- } else if (z == sizeof(int)) {
- *(unsigned int *) argp = (unsigned int) * (UINT32 *)(* p_argv);
- } else {
- memcpy(argp, *p_argv, z);
- }
- p_argv++;
- argp += z;
- }
-}
-
-
-
diff --git a/Modules/_ctypes/libffi/src/bfin/ffitarget.h b/Modules/_ctypes/libffi/src/bfin/ffitarget.h
deleted file mode 100644
index 2175c01016..0000000000
--- a/Modules/_ctypes/libffi/src/bfin/ffitarget.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/* -----------------------------------------------------------------------
- ffitarget.h - Copyright (c) 2012 Alexandre K. I. de Mendonca <alexandre.keunecke@gmail.com>
-
- Blackfin Foreign Function Interface
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- ``Software''), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to
- permit persons to whom the Software is furnished to do so, subject to
- the following conditions:
-
- The above copyright notice and this permission notice shall be included
- in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- DEALINGS IN THE SOFTWARE.
- ----------------------------------------------------------------------- */
-
-#ifndef LIBFFI_TARGET_H
-#define LIBFFI_TARGET_H
-
-#ifndef LIBFFI_ASM
-typedef unsigned long ffi_arg;
-typedef signed long ffi_sarg;
-
-typedef enum ffi_abi {
- FFI_FIRST_ABI = 0,
- FFI_SYSV,
- FFI_LAST_ABI,
- FFI_DEFAULT_ABI = FFI_SYSV
-} ffi_abi;
-#endif
-
-#endif
-
diff --git a/Modules/_ctypes/libffi/src/bfin/sysv.S b/Modules/_ctypes/libffi/src/bfin/sysv.S
deleted file mode 100644
index f4278be242..0000000000
--- a/Modules/_ctypes/libffi/src/bfin/sysv.S
+++ /dev/null
@@ -1,179 +0,0 @@
-/* -----------------------------------------------------------------------
- sysv.S - Copyright (c) 2012 Alexandre K. I. de Mendonca <alexandre.keunecke@gmail.com>,
- Paulo Pizarro <paulo.pizarro@gmail.com>
-
- Blackfin Foreign Function Interface
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- ``Software''), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to
- permit persons to whom the Software is furnished to do so, subject to
- the following conditions:
-
- The above copyright notice and this permission notice shall be included
- in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- DEALINGS IN THE SOFTWARE.
- ----------------------------------------------------------------------- */
-
-#define LIBFFI_ASM
-#include <fficonfig.h>
-#include <ffi.h>
-
-.text
-.align 4
-
- /*
- There is a "feature" in the bfin toolchain that it puts a _ before function names
- that's why the function here it's called _ffi_call_SYSV and not ffi_call_SYSV
- */
- .global _ffi_call_SYSV;
- .type _ffi_call_SYSV, STT_FUNC;
- .func ffi_call_SYSV
-
- /*
- cif->bytes = R0 (fp+8)
- &ecif = R1 (fp+12)
- ffi_prep_args = R2 (fp+16)
- ret_type = stack (fp+20)
- ecif.rvalue = stack (fp+24)
- fn = stack (fp+28)
- got (fp+32)
-
- There is room for improvement here (we can use temporary registers
- instead of saving the values in the memory)
- REGS:
- P5 => Stack pointer (function arguments)
- R5 => cif->bytes
- R4 => ret->type
-
- FP-20 = P3
- FP-16 = SP (parameters area)
- FP-12 = SP (temp)
- FP-08 = function return part 1 [R0]
- FP-04 = function return part 2 [R1]
- */
-
-_ffi_call_SYSV:
-.prologue:
- LINK 20;
- [FP-20] = P3;
- [FP+8] = R0;
- [FP+12] = R1;
- [FP+16] = R2;
-
-.allocate_stack:
- //alocate cif->bytes into the stack
- R1 = [FP+8];
- R0 = SP;
- R0 = R0 - R1;
- R1 = 4;
- R0 = R0 - R1;
- [FP-12] = SP;
- SP = R0;
- [FP-16] = SP;
-
-.call_prep_args:
- //get the addr of prep_args
- P0 = [P3 + _ffi_prep_args@FUNCDESC_GOT17M4];
- P1 = [P0];
- P3 = [P0+4];
- R0 = [FP-16];//SP (parameter area)
- R1 = [FP+12];//ecif
- call (P1);
-
-.call_user_function:
- //ajust SP so as to allow the user function access the parameters on the stack
- SP = [FP-16]; //point to function parameters
- R0 = [SP];
- R1 = [SP+4];
- R2 = [SP+8];
- //load user function address
- P0 = FP;
- P0 +=28;
- P1 = [P0];
- P1 = [P1];
- P3 = [P0+4];
- /*
- For functions returning aggregate values (struct) occupying more than 8 bytes,
- the caller allocates the return value object on the stack and the address
- of this object is passed to the callee as a hidden argument in register P0.
- */
- P0 = [FP+24];
-
- call (P1);
- SP = [FP-12];
-.compute_return:
- P2 = [FP-20];
- [FP-8] = R0;
- [FP-4] = R1;
-
- R0 = [FP+20];
- R1 = R0 << 2;
-
- R0 = [P2+.rettable@GOT17M4];
- R0 = R1 + R0;
- P2 = R0;
- R1 = [P2];
-
- P2 = [FP+-20];
- R0 = [P2+.rettable@GOT17M4];
- R0 = R1 + R0;
- P2 = R0;
- R0 = [FP-8];
- R1 = [FP-4];
- jump (P2);
-
-/*
-#define FFIBFIN_RET_VOID 0
-#define FFIBFIN_RET_BYTE 1
-#define FFIBFIN_RET_HALFWORD 2
-#define FFIBFIN_RET_INT64 3
-#define FFIBFIN_RET_INT32 4
-*/
-.align 4
-.align 4
-.rettable:
- .dd .epilogue - .rettable
- .dd .rbyte - .rettable;
- .dd .rhalfword - .rettable;
- .dd .rint64 - .rettable;
- .dd .rint32 - .rettable;
-
-.rbyte:
- P0 = [FP+24];
- R0 = R0.B (Z);
- [P0] = R0;
- JUMP .epilogue
-.rhalfword:
- P0 = [FP+24];
- R0 = R0.L;
- [P0] = R0;
- JUMP .epilogue
-.rint64:
- P0 = [FP+24];// &rvalue
- [P0] = R0;
- [P0+4] = R1;
- JUMP .epilogue
-.rint32:
- P0 = [FP+24];
- [P0] = R0;
-.epilogue:
- R0 = [FP+8];
- R1 = [FP+12];
- R2 = [FP+16];
- P3 = [FP-20];
- UNLINK;
- RTS;
-
-.size _ffi_call_SYSV,.-_ffi_call_SYSV;
-.endfunc
diff --git a/Modules/_ctypes/libffi/src/closures.c b/Modules/_ctypes/libffi/src/closures.c
deleted file mode 100644
index c7863f3d0a..0000000000
--- a/Modules/_ctypes/libffi/src/closures.c
+++ /dev/null
@@ -1,660 +0,0 @@
-/* -----------------------------------------------------------------------
- closures.c - Copyright (c) 2007, 2009, 2010 Red Hat, Inc.
- Copyright (C) 2007, 2009, 2010 Free Software Foundation, Inc
- Copyright (c) 2011 Plausible Labs Cooperative, Inc.
-
- Code to allocate and deallocate memory for closures.
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- ``Software''), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to
- permit persons to whom the Software is furnished to do so, subject to
- the following conditions:
-
- The above copyright notice and this permission notice shall be included
- in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- DEALINGS IN THE SOFTWARE.
- ----------------------------------------------------------------------- */
-
-#if defined __linux__ && !defined _GNU_SOURCE
-#define _GNU_SOURCE 1
-#endif
-
-#include <ffi.h>
-#include <ffi_common.h>
-
-#if !FFI_MMAP_EXEC_WRIT && !FFI_EXEC_TRAMPOLINE_TABLE
-# if __gnu_linux__ && !defined(__ANDROID__)
-/* This macro indicates it may be forbidden to map anonymous memory
- with both write and execute permission. Code compiled when this
- option is defined will attempt to map such pages once, but if it
- fails, it falls back to creating a temporary file in a writable and
- executable filesystem and mapping pages from it into separate
- locations in the virtual memory space, one location writable and
- another executable. */
-# define FFI_MMAP_EXEC_WRIT 1
-# define HAVE_MNTENT 1
-# endif
-# if defined(X86_WIN32) || defined(X86_WIN64) || defined(__OS2__)
-/* Windows systems may have Data Execution Protection (DEP) enabled,
- which requires the use of VirtualMalloc/VirtualFree to alloc/free
- executable memory. */
-# define FFI_MMAP_EXEC_WRIT 1
-# endif
-#endif
-
-#if FFI_MMAP_EXEC_WRIT && !defined FFI_MMAP_EXEC_SELINUX
-# ifdef __linux__
-/* When defined to 1 check for SELinux and if SELinux is active,
- don't attempt PROT_EXEC|PROT_WRITE mapping at all, as that
- might cause audit messages. */
-# define FFI_MMAP_EXEC_SELINUX 1
-# endif
-#endif
-
-#if FFI_CLOSURES
-
-# if FFI_EXEC_TRAMPOLINE_TABLE
-
-// Per-target implementation; It's unclear what can reasonable be shared between two OS/architecture implementations.
-
-# elif FFI_MMAP_EXEC_WRIT /* !FFI_EXEC_TRAMPOLINE_TABLE */
-
-#define USE_LOCKS 1
-#define USE_DL_PREFIX 1
-#ifdef __GNUC__
-#ifndef USE_BUILTIN_FFS
-#define USE_BUILTIN_FFS 1
-#endif
-#endif
-
-/* We need to use mmap, not sbrk. */
-#define HAVE_MORECORE 0
-
-/* We could, in theory, support mremap, but it wouldn't buy us anything. */
-#define HAVE_MREMAP 0
-
-/* We have no use for this, so save some code and data. */
-#define NO_MALLINFO 1
-
-/* We need all allocations to be in regular segments, otherwise we
- lose track of the corresponding code address. */
-#define DEFAULT_MMAP_THRESHOLD MAX_SIZE_T
-
-/* Don't allocate more than a page unless needed. */
-#define DEFAULT_GRANULARITY ((size_t)malloc_getpagesize)
-
-#if FFI_CLOSURE_TEST
-/* Don't release single pages, to avoid a worst-case scenario of
- continuously allocating and releasing single pages, but release
- pairs of pages, which should do just as well given that allocations
- are likely to be small. */
-#define DEFAULT_TRIM_THRESHOLD ((size_t)malloc_getpagesize)
-#endif
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <errno.h>
-#ifndef _MSC_VER
-#include <unistd.h>
-#endif
-#include <string.h>
-#include <stdio.h>
-#if !defined(X86_WIN32) && !defined(X86_WIN64)
-#ifdef HAVE_MNTENT
-#include <mntent.h>
-#endif /* HAVE_MNTENT */
-#include <sys/param.h>
-#include <pthread.h>
-
-/* We don't want sys/mman.h to be included after we redefine mmap and
- dlmunmap. */
-#include <sys/mman.h>
-#define LACKS_SYS_MMAN_H 1
-
-#if FFI_MMAP_EXEC_SELINUX
-#include <sys/statfs.h>
-#include <stdlib.h>
-
-static int selinux_enabled = -1;
-
-static int
-selinux_enabled_check (void)
-{
- struct statfs sfs;
- FILE *f;
- char *buf = NULL;
- size_t len = 0;
-
- if (statfs ("/selinux", &sfs) >= 0
- && (unsigned int) sfs.f_type == 0xf97cff8cU)
- return 1;
- f = fopen ("/proc/mounts", "r");
- if (f == NULL)
- return 0;
- while (getline (&buf, &len, f) >= 0)
- {
- char *p = strchr (buf, ' ');
- if (p == NULL)
- break;
- p = strchr (p + 1, ' ');
- if (p == NULL)
- break;
- if (strncmp (p + 1, "selinuxfs ", 10) == 0)
- {
- free (buf);
- fclose (f);
- return 1;
- }
- }
- free (buf);
- fclose (f);
- return 0;
-}
-
-#define is_selinux_enabled() (selinux_enabled >= 0 ? selinux_enabled \
- : (selinux_enabled = selinux_enabled_check ()))
-
-#else
-
-#define is_selinux_enabled() 0
-
-#endif /* !FFI_MMAP_EXEC_SELINUX */
-
-/* On PaX enable kernels that have MPROTECT enable we can't use PROT_EXEC. */
-#ifdef FFI_MMAP_EXEC_EMUTRAMP_PAX
-#include <stdlib.h>
-
-static int emutramp_enabled = -1;
-
-static int
-emutramp_enabled_check (void)
-{
- char *buf = NULL;
- size_t len = 0;
- FILE *f;
- int ret;
- f = fopen ("/proc/self/status", "r");
- if (f == NULL)
- return 0;
- ret = 0;
-
- while (getline (&buf, &len, f) != -1)
- if (!strncmp (buf, "PaX:", 4))
- {
- char emutramp;
- if (sscanf (buf, "%*s %*c%c", &emutramp) == 1)
- ret = (emutramp == 'E');
- break;
- }
- free (buf);
- fclose (f);
- return ret;
-}
-
-#define is_emutramp_enabled() (emutramp_enabled >= 0 ? emutramp_enabled \
- : (emutramp_enabled = emutramp_enabled_check ()))
-#endif /* FFI_MMAP_EXEC_EMUTRAMP_PAX */
-
-#elif defined (__CYGWIN__) || defined(__INTERIX)
-
-#include <sys/mman.h>
-
-/* Cygwin is Linux-like, but not quite that Linux-like. */
-#define is_selinux_enabled() 0
-
-#endif /* !defined(X86_WIN32) && !defined(X86_WIN64) */
-
-#ifndef FFI_MMAP_EXEC_EMUTRAMP_PAX
-#define is_emutramp_enabled() 0
-#endif /* FFI_MMAP_EXEC_EMUTRAMP_PAX */
-
-/* Declare all functions defined in dlmalloc.c as static. */
-static void *dlmalloc(size_t);
-static void dlfree(void*);
-static void *dlcalloc(size_t, size_t) MAYBE_UNUSED;
-static void *dlrealloc(void *, size_t) MAYBE_UNUSED;
-static void *dlmemalign(size_t, size_t) MAYBE_UNUSED;
-static void *dlvalloc(size_t) MAYBE_UNUSED;
-static int dlmallopt(int, int) MAYBE_UNUSED;
-static size_t dlmalloc_footprint(void) MAYBE_UNUSED;
-static size_t dlmalloc_max_footprint(void) MAYBE_UNUSED;
-static void** dlindependent_calloc(size_t, size_t, void**) MAYBE_UNUSED;
-static void** dlindependent_comalloc(size_t, size_t*, void**) MAYBE_UNUSED;
-static void *dlpvalloc(size_t) MAYBE_UNUSED;
-static int dlmalloc_trim(size_t) MAYBE_UNUSED;
-static size_t dlmalloc_usable_size(void*) MAYBE_UNUSED;
-static void dlmalloc_stats(void) MAYBE_UNUSED;
-
-#if !(defined(X86_WIN32) || defined(X86_WIN64) || defined(__OS2__)) || defined (__CYGWIN__) || defined(__INTERIX)
-/* Use these for mmap and munmap within dlmalloc.c. */
-static void *dlmmap(void *, size_t, int, int, int, off_t);
-static int dlmunmap(void *, size_t);
-#endif /* !(defined(X86_WIN32) || defined(X86_WIN64) || defined(__OS2__)) || defined (__CYGWIN__) || defined(__INTERIX) */
-
-#define mmap dlmmap
-#define munmap dlmunmap
-
-#include "dlmalloc.c"
-
-#undef mmap
-#undef munmap
-
-#if !(defined(X86_WIN32) || defined(X86_WIN64) || defined(__OS2__)) || defined (__CYGWIN__) || defined(__INTERIX)
-
-/* A mutex used to synchronize access to *exec* variables in this file. */
-static pthread_mutex_t open_temp_exec_file_mutex = PTHREAD_MUTEX_INITIALIZER;
-
-/* A file descriptor of a temporary file from which we'll map
- executable pages. */
-static int execfd = -1;
-
-/* The amount of space already allocated from the temporary file. */
-static size_t execsize = 0;
-
-/* Open a temporary file name, and immediately unlink it. */
-static int
-open_temp_exec_file_name (char *name)
-{
- int fd = mkstemp (name);
-
- if (fd != -1)
- unlink (name);
-
- return fd;
-}
-
-/* Open a temporary file in the named directory. */
-static int
-open_temp_exec_file_dir (const char *dir)
-{
- static const char suffix[] = "/ffiXXXXXX";
- size_t lendir = strlen (dir);
- char *tempname = __builtin_alloca (lendir + sizeof (suffix));
-
- if (!tempname)
- return -1;
-
- memcpy (tempname, dir, lendir);
- memcpy (tempname + lendir, suffix, sizeof (suffix));
-
- return open_temp_exec_file_name (tempname);
-}
-
-/* Open a temporary file in the directory in the named environment
- variable. */
-static int
-open_temp_exec_file_env (const char *envvar)
-{
- const char *value = getenv (envvar);
-
- if (!value)
- return -1;
-
- return open_temp_exec_file_dir (value);
-}
-
-#ifdef HAVE_MNTENT
-/* Open a temporary file in an executable and writable mount point
- listed in the mounts file. Subsequent calls with the same mounts
- keep searching for mount points in the same file. Providing NULL
- as the mounts file closes the file. */
-static int
-open_temp_exec_file_mnt (const char *mounts)
-{
- static const char *last_mounts;
- static FILE *last_mntent;
-
- if (mounts != last_mounts)
- {
- if (last_mntent)
- endmntent (last_mntent);
-
- last_mounts = mounts;
-
- if (mounts)
- last_mntent = setmntent (mounts, "r");
- else
- last_mntent = NULL;
- }
-
- if (!last_mntent)
- return -1;
-
- for (;;)
- {
- int fd;
- struct mntent mnt;
- char buf[MAXPATHLEN * 3];
-
- if (getmntent_r (last_mntent, &mnt, buf, sizeof (buf)) == NULL)
- return -1;
-
- if (hasmntopt (&mnt, "ro")
- || hasmntopt (&mnt, "noexec")
- || access (mnt.mnt_dir, W_OK))
- continue;
-
- fd = open_temp_exec_file_dir (mnt.mnt_dir);
-
- if (fd != -1)
- return fd;
- }
-}
-#endif /* HAVE_MNTENT */
-
-/* Instructions to look for a location to hold a temporary file that
- can be mapped in for execution. */
-static struct
-{
- int (*func)(const char *);
- const char *arg;
- int repeat;
-} open_temp_exec_file_opts[] = {
- { open_temp_exec_file_env, "TMPDIR", 0 },
- { open_temp_exec_file_dir, "/tmp", 0 },
- { open_temp_exec_file_dir, "/var/tmp", 0 },
- { open_temp_exec_file_dir, "/dev/shm", 0 },
- { open_temp_exec_file_env, "HOME", 0 },
-#ifdef HAVE_MNTENT
- { open_temp_exec_file_mnt, "/etc/mtab", 1 },
- { open_temp_exec_file_mnt, "/proc/mounts", 1 },
-#endif /* HAVE_MNTENT */
-};
-
-/* Current index into open_temp_exec_file_opts. */
-static int open_temp_exec_file_opts_idx = 0;
-
-/* Reset a current multi-call func, then advances to the next entry.
- If we're at the last, go back to the first and return nonzero,
- otherwise return zero. */
-static int
-open_temp_exec_file_opts_next (void)
-{
- if (open_temp_exec_file_opts[open_temp_exec_file_opts_idx].repeat)
- open_temp_exec_file_opts[open_temp_exec_file_opts_idx].func (NULL);
-
- open_temp_exec_file_opts_idx++;
- if (open_temp_exec_file_opts_idx
- == (sizeof (open_temp_exec_file_opts)
- / sizeof (*open_temp_exec_file_opts)))
- {
- open_temp_exec_file_opts_idx = 0;
- return 1;
- }
-
- return 0;
-}
-
-/* Return a file descriptor of a temporary zero-sized file in a
- writable and executable filesystem. */
-static int
-open_temp_exec_file (void)
-{
- int fd;
-
- do
- {
- fd = open_temp_exec_file_opts[open_temp_exec_file_opts_idx].func
- (open_temp_exec_file_opts[open_temp_exec_file_opts_idx].arg);
-
- if (!open_temp_exec_file_opts[open_temp_exec_file_opts_idx].repeat
- || fd == -1)
- {
- if (open_temp_exec_file_opts_next ())
- break;
- }
- }
- while (fd == -1);
-
- return fd;
-}
-
-/* Map in a chunk of memory from the temporary exec file into separate
- locations in the virtual memory address space, one writable and one
- executable. Returns the address of the writable portion, after
- storing an offset to the corresponding executable portion at the
- last word of the requested chunk. */
-static void *
-dlmmap_locked (void *start, size_t length, int prot, int flags, off_t offset)
-{
- void *ptr;
-
- if (execfd == -1)
- {
- open_temp_exec_file_opts_idx = 0;
- retry_open:
- execfd = open_temp_exec_file ();
- if (execfd == -1)
- return MFAIL;
- }
-
- offset = execsize;
-
- if (ftruncate (execfd, offset + length))
- return MFAIL;
-
- flags &= ~(MAP_PRIVATE | MAP_ANONYMOUS);
- flags |= MAP_SHARED;
-
- ptr = mmap (NULL, length, (prot & ~PROT_WRITE) | PROT_EXEC,
- flags, execfd, offset);
- if (ptr == MFAIL)
- {
- if (!offset)
- {
- close (execfd);
- goto retry_open;
- }
- ftruncate (execfd, offset);
- return MFAIL;
- }
- else if (!offset
- && open_temp_exec_file_opts[open_temp_exec_file_opts_idx].repeat)
- open_temp_exec_file_opts_next ();
-
- start = mmap (start, length, prot, flags, execfd, offset);
-
- if (start == MFAIL)
- {
- munmap (ptr, length);
- ftruncate (execfd, offset);
- return start;
- }
-
- mmap_exec_offset ((char *)start, length) = (char*)ptr - (char*)start;
-
- execsize += length;
-
- return start;
-}
-
-/* Map in a writable and executable chunk of memory if possible.
- Failing that, fall back to dlmmap_locked. */
-static void *
-dlmmap (void *start, size_t length, int prot,
- int flags, int fd, off_t offset)
-{
- void *ptr;
-
- assert (start == NULL && length % malloc_getpagesize == 0
- && prot == (PROT_READ | PROT_WRITE)
- && flags == (MAP_PRIVATE | MAP_ANONYMOUS)
- && fd == -1 && offset == 0);
-
-#if FFI_CLOSURE_TEST
- printf ("mapping in %zi\n", length);
-#endif
-
- if (execfd == -1 && is_emutramp_enabled ())
- {
- ptr = mmap (start, length, prot & ~PROT_EXEC, flags, fd, offset);
- return ptr;
- }
-
- if (execfd == -1 && !is_selinux_enabled ())
- {
- ptr = mmap (start, length, prot | PROT_EXEC, flags, fd, offset);
-
- if (ptr != MFAIL || (errno != EPERM && errno != EACCES))
- /* Cool, no need to mess with separate segments. */
- return ptr;
-
- /* If MREMAP_DUP is ever introduced and implemented, try mmap
- with ((prot & ~PROT_WRITE) | PROT_EXEC) and mremap with
- MREMAP_DUP and prot at this point. */
- }
-
- if (execsize == 0 || execfd == -1)
- {
- pthread_mutex_lock (&open_temp_exec_file_mutex);
- ptr = dlmmap_locked (start, length, prot, flags, offset);
- pthread_mutex_unlock (&open_temp_exec_file_mutex);
-
- return ptr;
- }
-
- return dlmmap_locked (start, length, prot, flags, offset);
-}
-
-/* Release memory at the given address, as well as the corresponding
- executable page if it's separate. */
-static int
-dlmunmap (void *start, size_t length)
-{
- /* We don't bother decreasing execsize or truncating the file, since
- we can't quite tell whether we're unmapping the end of the file.
- We don't expect frequent deallocation anyway. If we did, we
- could locate pages in the file by writing to the pages being
- deallocated and checking that the file contents change.
- Yuck. */
- msegmentptr seg = segment_holding (gm, start);
- void *code;
-
-#if FFI_CLOSURE_TEST
- printf ("unmapping %zi\n", length);
-#endif
-
- if (seg && (code = add_segment_exec_offset (start, seg)) != start)
- {
- int ret = munmap (code, length);
- if (ret)
- return ret;
- }
-
- return munmap (start, length);
-}
-
-#if FFI_CLOSURE_FREE_CODE
-/* Return segment holding given code address. */
-static msegmentptr
-segment_holding_code (mstate m, char* addr)
-{
- msegmentptr sp = &m->seg;
- for (;;) {
- if (addr >= add_segment_exec_offset (sp->base, sp)
- && addr < add_segment_exec_offset (sp->base, sp) + sp->size)
- return sp;
- if ((sp = sp->next) == 0)
- return 0;
- }
-}
-#endif
-
-#endif /* !(defined(X86_WIN32) || defined(X86_WIN64) || defined(__OS2__)) || defined (__CYGWIN__) || defined(__INTERIX) */
-
-/* Allocate a chunk of memory with the given size. Returns a pointer
- to the writable address, and sets *CODE to the executable
- corresponding virtual address. */
-void *
-ffi_closure_alloc (size_t size, void **code)
-{
- void *ptr;
-
- if (!code)
- return NULL;
-
- ptr = dlmalloc (size);
-
- if (ptr)
- {
- msegmentptr seg = segment_holding (gm, ptr);
-
- *code = add_segment_exec_offset (ptr, seg);
- }
-
- return ptr;
-}
-
-/* Release a chunk of memory allocated with ffi_closure_alloc. If
- FFI_CLOSURE_FREE_CODE is nonzero, the given address can be the
- writable or the executable address given. Otherwise, only the
- writable address can be provided here. */
-void
-ffi_closure_free (void *ptr)
-{
-#if FFI_CLOSURE_FREE_CODE
- msegmentptr seg = segment_holding_code (gm, ptr);
-
- if (seg)
- ptr = sub_segment_exec_offset (ptr, seg);
-#endif
-
- dlfree (ptr);
-}
-
-
-#if FFI_CLOSURE_TEST
-/* Do some internal sanity testing to make sure allocation and
- deallocation of pages are working as intended. */
-int main ()
-{
- void *p[3];
-#define GET(idx, len) do { p[idx] = dlmalloc (len); printf ("allocated %zi for p[%i]\n", (len), (idx)); } while (0)
-#define PUT(idx) do { printf ("freeing p[%i]\n", (idx)); dlfree (p[idx]); } while (0)
- GET (0, malloc_getpagesize / 2);
- GET (1, 2 * malloc_getpagesize - 64 * sizeof (void*));
- PUT (1);
- GET (1, 2 * malloc_getpagesize);
- GET (2, malloc_getpagesize / 2);
- PUT (1);
- PUT (0);
- PUT (2);
- return 0;
-}
-#endif /* FFI_CLOSURE_TEST */
-# else /* ! FFI_MMAP_EXEC_WRIT */
-
-/* On many systems, memory returned by malloc is writable and
- executable, so just use it. */
-
-#include <stdlib.h>
-
-void *
-ffi_closure_alloc (size_t size, void **code)
-{
- if (!code)
- return NULL;
-
- return *code = malloc (size);
-}
-
-void
-ffi_closure_free (void *ptr)
-{
- free (ptr);
-}
-
-# endif /* ! FFI_MMAP_EXEC_WRIT */
-#endif /* FFI_CLOSURES */
diff --git a/Modules/_ctypes/libffi/src/cris/ffi.c b/Modules/_ctypes/libffi/src/cris/ffi.c
deleted file mode 100644
index aaca5b1cba..0000000000
--- a/Modules/_ctypes/libffi/src/cris/ffi.c
+++ /dev/null
@@ -1,386 +0,0 @@
-/* -----------------------------------------------------------------------
- ffi.c - Copyright (c) 1998 Cygnus Solutions
- Copyright (c) 2004 Simon Posnjak
- Copyright (c) 2005 Axis Communications AB
- Copyright (C) 2007 Free Software Foundation, Inc.
-
- CRIS Foreign Function Interface
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- ``Software''), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to
- permit persons to whom the Software is furnished to do so, subject to
- the following conditions:
-
- The above copyright notice and this permission notice shall be included
- in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS
- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- IN NO EVENT SHALL SIMON POSNJAK BE LIABLE FOR ANY CLAIM, DAMAGES OR
- OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- OTHER DEALINGS IN THE SOFTWARE.
- ----------------------------------------------------------------------- */
-
-#include <ffi.h>
-#include <ffi_common.h>
-
-#define STACK_ARG_SIZE(x) ALIGN(x, FFI_SIZEOF_ARG)
-
-static ffi_status
-initialize_aggregate_packed_struct (ffi_type * arg)
-{
- ffi_type **ptr;
-
- FFI_ASSERT (arg != NULL);
-
- FFI_ASSERT (arg->elements != NULL);
- FFI_ASSERT (arg->size == 0);
- FFI_ASSERT (arg->alignment == 0);
-
- ptr = &(arg->elements[0]);
-
- while ((*ptr) != NULL)
- {
- if (((*ptr)->size == 0)
- && (initialize_aggregate_packed_struct ((*ptr)) != FFI_OK))
- return FFI_BAD_TYPEDEF;
-
- FFI_ASSERT (ffi_type_test ((*ptr)));
-
- arg->size += (*ptr)->size;
-
- arg->alignment = (arg->alignment > (*ptr)->alignment) ?
- arg->alignment : (*ptr)->alignment;
-
- ptr++;
- }
-
- if (arg->size == 0)
- return FFI_BAD_TYPEDEF;
- else
- return FFI_OK;
-}
-
-int
-ffi_prep_args (char *stack, extended_cif * ecif)
-{
- unsigned int i;
- unsigned int struct_count = 0;
- void **p_argv;
- char *argp;
- ffi_type **p_arg;
-
- argp = stack;
-
- p_argv = ecif->avalue;
-
- for (i = ecif->cif->nargs, p_arg = ecif->cif->arg_types;
- (i != 0); i--, p_arg++)
- {
- size_t z;
-
- switch ((*p_arg)->type)
- {
- case FFI_TYPE_STRUCT:
- {
- z = (*p_arg)->size;
- if (z <= 4)
- {
- memcpy (argp, *p_argv, z);
- z = 4;
- }
- else if (z <= 8)
- {
- memcpy (argp, *p_argv, z);
- z = 8;
- }
- else
- {
- unsigned int uiLocOnStack;
- z = sizeof (void *);
- uiLocOnStack = 4 * ecif->cif->nargs + struct_count;
- struct_count = struct_count + (*p_arg)->size;
- *(unsigned int *) argp =
- (unsigned int) (UINT32 *) (stack + uiLocOnStack);
- memcpy ((stack + uiLocOnStack), *p_argv, (*p_arg)->size);
- }
- break;
- }
- default:
- z = (*p_arg)->size;
- if (z < sizeof (int))
- {
- switch ((*p_arg)->type)
- {
- case FFI_TYPE_SINT8:
- *(signed int *) argp = (signed int) *(SINT8 *) (*p_argv);
- break;
-
- case FFI_TYPE_UINT8:
- *(unsigned int *) argp =
- (unsigned int) *(UINT8 *) (*p_argv);
- break;
-
- case FFI_TYPE_SINT16:
- *(signed int *) argp = (signed int) *(SINT16 *) (*p_argv);
- break;
-
- case FFI_TYPE_UINT16:
- *(unsigned int *) argp =
- (unsigned int) *(UINT16 *) (*p_argv);
- break;
-
- default:
- FFI_ASSERT (0);
- }
- z = sizeof (int);
- }
- else if (z == sizeof (int))
- *(unsigned int *) argp = (unsigned int) *(UINT32 *) (*p_argv);
- else
- memcpy (argp, *p_argv, z);
- break;
- }
- p_argv++;
- argp += z;
- }
-
- return (struct_count);
-}
-
-ffi_status FFI_HIDDEN
-ffi_prep_cif_core (ffi_cif * cif,
- ffi_abi abi, unsigned int isvariadic,
- unsigned int nfixedargs, unsigned int ntotalargs,
- ffi_type * rtype, ffi_type ** atypes)
-{
- unsigned bytes = 0;
- unsigned int i;
- ffi_type **ptr;
-
- FFI_ASSERT (cif != NULL);
- FFI_ASSERT((!isvariadic) || (nfixedargs >= 1));
- FFI_ASSERT(nfixedargs <= ntotalargs);
- FFI_ASSERT (abi > FFI_FIRST_ABI && abi < FFI_LAST_ABI);
-
- cif->abi = abi;
- cif->arg_types = atypes;
- cif->nargs = ntotalargs;
- cif->rtype = rtype;
-
- cif->flags = 0;
-
- if ((cif->rtype->size == 0)
- && (initialize_aggregate_packed_struct (cif->rtype) != FFI_OK))
- return FFI_BAD_TYPEDEF;
-
- FFI_ASSERT_VALID_TYPE (cif->rtype);
-
- for (ptr = cif->arg_types, i = cif->nargs; i > 0; i--, ptr++)
- {
- if (((*ptr)->size == 0)
- && (initialize_aggregate_packed_struct ((*ptr)) != FFI_OK))
- return FFI_BAD_TYPEDEF;
-
- FFI_ASSERT_VALID_TYPE (*ptr);
-
- if (((*ptr)->alignment - 1) & bytes)
- bytes = ALIGN (bytes, (*ptr)->alignment);
- if ((*ptr)->type == FFI_TYPE_STRUCT)
- {
- if ((*ptr)->size > 8)
- {
- bytes += (*ptr)->size;
- bytes += sizeof (void *);
- }
- else
- {
- if ((*ptr)->size > 4)
- bytes += 8;
- else
- bytes += 4;
- }
- }
- else
- bytes += STACK_ARG_SIZE ((*ptr)->size);
- }
-
- cif->bytes = bytes;
-
- return ffi_prep_cif_machdep (cif);
-}
-
-ffi_status
-ffi_prep_cif_machdep (ffi_cif * cif)
-{
- switch (cif->rtype->type)
- {
- case FFI_TYPE_VOID:
- case FFI_TYPE_STRUCT:
- case FFI_TYPE_FLOAT:
- case FFI_TYPE_DOUBLE:
- case FFI_TYPE_SINT64:
- case FFI_TYPE_UINT64:
- cif->flags = (unsigned) cif->rtype->type;
- break;
-
- default:
- cif->flags = FFI_TYPE_INT;
- break;
- }
-
- return FFI_OK;
-}
-
-extern void ffi_call_SYSV (int (*)(char *, extended_cif *),
- extended_cif *,
- unsigned, unsigned, unsigned *, void (*fn) ())
- __attribute__ ((__visibility__ ("hidden")));
-
-void
-ffi_call (ffi_cif * cif, void (*fn) (), void *rvalue, void **avalue)
-{
- extended_cif ecif;
-
- ecif.cif = cif;
- ecif.avalue = avalue;
-
- if ((rvalue == NULL) && (cif->rtype->type == FFI_TYPE_STRUCT))
- {
- ecif.rvalue = alloca (cif->rtype->size);
- }
- else
- ecif.rvalue = rvalue;
-
- switch (cif->abi)
- {
- case FFI_SYSV:
- ffi_call_SYSV (ffi_prep_args, &ecif, cif->bytes,
- cif->flags, ecif.rvalue, fn);
- break;
- default:
- FFI_ASSERT (0);
- break;
- }
-}
-
-/* Because the following variables are not exported outside libffi, we
- mark them hidden. */
-
-/* Assembly code for the jump stub. */
-extern const char ffi_cris_trampoline_template[]
- __attribute__ ((__visibility__ ("hidden")));
-
-/* Offset into ffi_cris_trampoline_template of where to put the
- ffi_prep_closure_inner function. */
-extern const int ffi_cris_trampoline_fn_offset
- __attribute__ ((__visibility__ ("hidden")));
-
-/* Offset into ffi_cris_trampoline_template of where to put the
- closure data. */
-extern const int ffi_cris_trampoline_closure_offset
- __attribute__ ((__visibility__ ("hidden")));
-
-/* This function is sibling-called (jumped to) by the closure
- trampoline. We get R10..R13 at PARAMS[0..3] and a copy of [SP] at
- PARAMS[4] to simplify handling of a straddling parameter. A copy
- of R9 is at PARAMS[5] and SP at PARAMS[6]. These parameters are
- put at the appropriate place in CLOSURE which is then executed and
- the return value is passed back to the caller. */
-
-static unsigned long long
-ffi_prep_closure_inner (void **params, ffi_closure* closure)
-{
- char *register_args = (char *) params;
- void *struct_ret = params[5];
- char *stack_args = params[6];
- char *ptr = register_args;
- ffi_cif *cif = closure->cif;
- ffi_type **arg_types = cif->arg_types;
-
- /* Max room needed is number of arguments as 64-bit values. */
- void **avalue = alloca (closure->cif->nargs * sizeof(void *));
- int i;
- int doing_regs;
- long long llret = 0;
-
- /* Find the address of each argument. */
- for (i = 0, doing_regs = 1; i < cif->nargs; i++)
- {
- /* Types up to and including 8 bytes go by-value. */
- if (arg_types[i]->size <= 4)
- {
- avalue[i] = ptr;
- ptr += 4;
- }
- else if (arg_types[i]->size <= 8)
- {
- avalue[i] = ptr;
- ptr += 8;
- }
- else
- {
- FFI_ASSERT (arg_types[i]->type == FFI_TYPE_STRUCT);
-
- /* Passed by-reference, so copy the pointer. */
- avalue[i] = *(void **) ptr;
- ptr += 4;
- }
-
- /* If we've handled more arguments than fit in registers, start
- looking at the those passed on the stack. Step over the
- first one if we had a straddling parameter. */
- if (doing_regs && ptr >= register_args + 4*4)
- {
- ptr = stack_args + ((ptr > register_args + 4*4) ? 4 : 0);
- doing_regs = 0;
- }
- }
-
- /* Invoke the closure. */
- (closure->fun) (cif,
-
- cif->rtype->type == FFI_TYPE_STRUCT
- /* The caller allocated space for the return
- structure, and passed a pointer to this space in
- R9. */
- ? struct_ret
-
- /* We take advantage of being able to ignore that
- the high part isn't set if the return value is
- not in R10:R11, but in R10 only. */
- : (void *) &llret,
-
- avalue, closure->user_data);
-
- return llret;
-}
-
-/* API function: Prepare the trampoline. */
-
-ffi_status
-ffi_prep_closure_loc (ffi_closure* closure,
- ffi_cif* cif,
- void (*fun)(ffi_cif *, void *, void **, void*),
- void *user_data,
- void *codeloc)
-{
- void *innerfn = ffi_prep_closure_inner;
- FFI_ASSERT (cif->abi == FFI_SYSV);
- closure->cif = cif;
- closure->user_data = user_data;
- closure->fun = fun;
- memcpy (closure->tramp, ffi_cris_trampoline_template,
- FFI_CRIS_TRAMPOLINE_CODE_PART_SIZE);
- memcpy (closure->tramp + ffi_cris_trampoline_fn_offset,
- &innerfn, sizeof (void *));
- memcpy (closure->tramp + ffi_cris_trampoline_closure_offset,
- &codeloc, sizeof (void *));
-
- return FFI_OK;
-}
diff --git a/Modules/_ctypes/libffi/src/cris/ffitarget.h b/Modules/_ctypes/libffi/src/cris/ffitarget.h
deleted file mode 100644
index b837e976e4..0000000000
--- a/Modules/_ctypes/libffi/src/cris/ffitarget.h
+++ /dev/null
@@ -1,56 +0,0 @@
-/* -----------------------------------------------------------------*-C-*-
- ffitarget.h - Copyright (c) 2012 Anthony Green
- Copyright (c) 1996-2003 Red Hat, Inc.
- Target configuration macros for CRIS.
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- ``Software''), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to
- permit persons to whom the Software is furnished to do so, subject to
- the following conditions:
-
- The above copyright notice and this permission notice shall be included
- in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- DEALINGS IN THE SOFTWARE.
-
- ----------------------------------------------------------------------- */
-
-#ifndef LIBFFI_TARGET_H
-#define LIBFFI_TARGET_H
-
-#ifndef LIBFFI_H
-#error "Please do not include ffitarget.h directly into your source. Use ffi.h instead."
-#endif
-
-#ifndef LIBFFI_ASM
-typedef unsigned long ffi_arg;
-typedef signed long ffi_sarg;
-
-typedef enum ffi_abi {
- FFI_FIRST_ABI = 0,
- FFI_SYSV,
- FFI_LAST_ABI,
- FFI_DEFAULT_ABI = FFI_SYSV
-} ffi_abi;
-#endif
-
-/* ---- Definitions for closures ----------------------------------------- */
-
-#define FFI_CLOSURES 1
-#define FFI_CRIS_TRAMPOLINE_CODE_PART_SIZE 36
-#define FFI_CRIS_TRAMPOLINE_DATA_PART_SIZE (7*4)
-#define FFI_TRAMPOLINE_SIZE \
- (FFI_CRIS_TRAMPOLINE_CODE_PART_SIZE + FFI_CRIS_TRAMPOLINE_DATA_PART_SIZE)
-#define FFI_NATIVE_RAW_API 0
-
-#endif
diff --git a/Modules/_ctypes/libffi/src/cris/sysv.S b/Modules/_ctypes/libffi/src/cris/sysv.S
deleted file mode 100644
index 79abaee4d9..0000000000
--- a/Modules/_ctypes/libffi/src/cris/sysv.S
+++ /dev/null
@@ -1,215 +0,0 @@
-/* -----------------------------------------------------------------------
- sysv.S - Copyright (c) 2004 Simon Posnjak
- Copyright (c) 2005 Axis Communications AB
-
- CRIS Foreign Function Interface
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- ``Software''), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to
- permit persons to whom the Software is furnished to do so, subject to
- the following conditions:
-
- The above copyright notice and this permission notice shall be included
- in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS
- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- IN NO EVENT SHALL SIMON POSNJAK BE LIABLE FOR ANY CLAIM, DAMAGES OR
- OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- OTHER DEALINGS IN THE SOFTWARE.
- ----------------------------------------------------------------------- */
-
-#define LIBFFI_ASM
-#include <ffi.h>
-#define CONCAT(x,y) x ## y
-#define XCONCAT(x,y) CONCAT (x, y)
-#define L(x) XCONCAT (__USER_LABEL_PREFIX__, x)
-
- .text
-
- ;; OK, when we get called we should have this (according to
- ;; AXIS ETRAX 100LX Programmer's Manual chapter 6.3).
- ;;
- ;; R10: ffi_prep_args (func. pointer)
- ;; R11: &ecif
- ;; R12: cif->bytes
- ;; R13: fig->flags
- ;; sp+0: ecif.rvalue
- ;; sp+4: fn (function pointer to the function that we need to call)
-
- .globl L(ffi_call_SYSV)
- .type L(ffi_call_SYSV),@function
- .hidden L(ffi_call_SYSV)
-
-L(ffi_call_SYSV):
- ;; Save the regs to the stack.
- push $srp
- ;; Used for stack pointer saving.
- push $r6
- ;; Used for function address pointer.
- push $r7
- ;; Used for stack pointer saving.
- push $r8
- ;; We save fig->flags to stack we will need them after we
- ;; call The Function.
- push $r13
-
- ;; Saving current stack pointer.
- move.d $sp,$r8
- move.d $sp,$r6
-
- ;; Move address of ffi_prep_args to r13.
- move.d $r10,$r13
-
- ;; Make room on the stack for the args of fn.
- sub.d $r12,$sp
-
- ;; Function void ffi_prep_args(char *stack, extended_cif *ecif) parameters are:
- ;; r10 <-- stack pointer
- ;; r11 <-- &ecif (already there)
- move.d $sp,$r10
-
- ;; Call the function.
- jsr $r13
-
- ;; Save the size of the structures which are passed on stack.
- move.d $r10,$r7
-
- ;; Move first four args in to r10..r13.
- move.d [$sp+0],$r10
- move.d [$sp+4],$r11
- move.d [$sp+8],$r12
- move.d [$sp+12],$r13
-
- ;; Adjust the stack and check if any parameters are given on stack.
- addq 16,$sp
- sub.d $r7,$r6
- cmp.d $sp,$r6
-
- bpl go_on
- nop
-
-go_on_no_params_on_stack:
- move.d $r6,$sp
-
-go_on:
- ;; Discover if we need to put rval address in to r9.
- move.d [$r8+0],$r7
- cmpq FFI_TYPE_STRUCT,$r7
- bne call_now
- nop
-
- ;; Move rval address to $r9.
- move.d [$r8+20],$r9
-
-call_now:
- ;; Move address of The Function in to r7.
- move.d [$r8+24],$r7
-
- ;; Call The Function.
- jsr $r7
-
- ;; Reset stack.
- move.d $r8,$sp
-
- ;; Load rval type (fig->flags) in to r13.
- pop $r13
-
- ;; Detect rval type.
- cmpq FFI_TYPE_VOID,$r13
- beq epilogue
-
- cmpq FFI_TYPE_STRUCT,$r13
- beq epilogue
-
- cmpq FFI_TYPE_DOUBLE,$r13
- beq return_double_or_longlong
-
- cmpq FFI_TYPE_UINT64,$r13
- beq return_double_or_longlong
-
- cmpq FFI_TYPE_SINT64,$r13
- beq return_double_or_longlong
- nop
-
- ;; Just return the 32 bit value.
- ba return
- nop
-
-return_double_or_longlong:
- ;; Load half of the rval to r10 and the other half to r11.
- move.d [$sp+16],$r13
- move.d $r10,[$r13]
- addq 4,$r13
- move.d $r11,[$r13]
- ba epilogue
- nop
-
-return:
- ;; Load the rval to r10.
- move.d [$sp+16],$r13
- move.d $r10,[$r13]
-
-epilogue:
- pop $r8
- pop $r7
- pop $r6
- Jump [$sp+]
-
- .size ffi_call_SYSV,.-ffi_call_SYSV
-
-/* Save R10..R13 into an array, somewhat like varargs. Copy the next
- argument too, to simplify handling of any straddling parameter.
- Save R9 and SP after those. Jump to function handling the rest.
- Since this is a template, copied and the main function filled in by
- the user. */
-
- .globl L(ffi_cris_trampoline_template)
- .type L(ffi_cris_trampoline_template),@function
- .hidden L(ffi_cris_trampoline_template)
-
-L(ffi_cris_trampoline_template):
-0:
- /* The value we get for "PC" is right after the prefix instruction,
- two bytes from the beginning, i.e. 0b+2. */
- move.d $r10,[$pc+2f-(0b+2)]
- move.d $pc,$r10
-1:
- addq 2f-1b+4,$r10
- move.d $r11,[$r10+]
- move.d $r12,[$r10+]
- move.d $r13,[$r10+]
- move.d [$sp],$r11
- move.d $r11,[$r10+]
- move.d $r9,[$r10+]
- move.d $sp,[$r10+]
- subq FFI_CRIS_TRAMPOLINE_DATA_PART_SIZE,$r10
- move.d 0,$r11
-3:
- jump 0
-2:
- .size ffi_cris_trampoline_template,.-0b
-
-/* This macro create a constant usable as "extern const int \name" in
- C from within libffi, when \name has no prefix decoration. */
-
- .macro const name,value
- .globl \name
- .type \name,@object
- .hidden \name
-\name:
- .dword \value
- .size \name,4
- .endm
-
-/* Constants for offsets within the trampoline. We could do this with
- just symbols, avoiding memory contents and memory accesses, but the
- C usage code would look a bit stranger. */
-
- const L(ffi_cris_trampoline_fn_offset),2b-4-0b
- const L(ffi_cris_trampoline_closure_offset),3b-4-0b
diff --git a/Modules/_ctypes/libffi/src/debug.c b/Modules/_ctypes/libffi/src/debug.c
deleted file mode 100644
index 51dcfcf229..0000000000
--- a/Modules/_ctypes/libffi/src/debug.c
+++ /dev/null
@@ -1,59 +0,0 @@
-/* -----------------------------------------------------------------------
- debug.c - Copyright (c) 1996 Red Hat, Inc.
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- ``Software''), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to
- permit persons to whom the Software is furnished to do so, subject to
- the following conditions:
-
- The above copyright notice and this permission notice shall be included
- in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- DEALINGS IN THE SOFTWARE.
- ----------------------------------------------------------------------- */
-
-#include <ffi.h>
-#include <ffi_common.h>
-#include <stdlib.h>
-#include <stdio.h>
-
-/* General debugging routines */
-
-void ffi_stop_here(void)
-{
- /* This function is only useful for debugging purposes.
- Place a breakpoint on ffi_stop_here to be notified of
- significant events. */
-}
-
-/* This function should only be called via the FFI_ASSERT() macro */
-
-void ffi_assert(char *expr, char *file, int line)
-{
- fprintf(stderr, "ASSERTION FAILURE: %s at %s:%d\n", expr, file, line);
- ffi_stop_here();
- abort();
-}
-
-/* Perform a sanity check on an ffi_type structure */
-
-void ffi_type_test(ffi_type *a, char *file, int line)
-{
- FFI_ASSERT_AT(a != NULL, file, line);
-
- FFI_ASSERT_AT(a->type <= FFI_TYPE_LAST, file, line);
- FFI_ASSERT_AT(a->type == FFI_TYPE_VOID || a->size > 0, file, line);
- FFI_ASSERT_AT(a->type == FFI_TYPE_VOID || a->alignment > 0, file, line);
- FFI_ASSERT_AT(a->type != FFI_TYPE_STRUCT || a->elements != NULL, file, line);
-
-}
diff --git a/Modules/_ctypes/libffi/src/dlmalloc.c b/Modules/_ctypes/libffi/src/dlmalloc.c
deleted file mode 100644
index 55c2d768b2..0000000000
--- a/Modules/_ctypes/libffi/src/dlmalloc.c
+++ /dev/null
@@ -1,5166 +0,0 @@
-/*
- This is a version (aka dlmalloc) of malloc/free/realloc written by
- Doug Lea and released to the public domain, as explained at
- http://creativecommons.org/licenses/publicdomain. Send questions,
- comments, complaints, performance data, etc to dl@cs.oswego.edu
-
-* Version 2.8.3 Thu Sep 22 11:16:15 2005 Doug Lea (dl at gee)
-
- Note: There may be an updated version of this malloc obtainable at
- ftp://gee.cs.oswego.edu/pub/misc/malloc.c
- Check before installing!
-
-* Quickstart
-
- This library is all in one file to simplify the most common usage:
- ftp it, compile it (-O3), and link it into another program. All of
- the compile-time options default to reasonable values for use on
- most platforms. You might later want to step through various
- compile-time and dynamic tuning options.
-
- For convenience, an include file for code using this malloc is at:
- ftp://gee.cs.oswego.edu/pub/misc/malloc-2.8.3.h
- You don't really need this .h file unless you call functions not
- defined in your system include files. The .h file contains only the
- excerpts from this file needed for using this malloc on ANSI C/C++
- systems, so long as you haven't changed compile-time options about
- naming and tuning parameters. If you do, then you can create your
- own malloc.h that does include all settings by cutting at the point
- indicated below. Note that you may already by default be using a C
- library containing a malloc that is based on some version of this
- malloc (for example in linux). You might still want to use the one
- in this file to customize settings or to avoid overheads associated
- with library versions.
-
-* Vital statistics:
-
- Supported pointer/size_t representation: 4 or 8 bytes
- size_t MUST be an unsigned type of the same width as
- pointers. (If you are using an ancient system that declares
- size_t as a signed type, or need it to be a different width
- than pointers, you can use a previous release of this malloc
- (e.g. 2.7.2) supporting these.)
-
- Alignment: 8 bytes (default)
- This suffices for nearly all current machines and C compilers.
- However, you can define MALLOC_ALIGNMENT to be wider than this
- if necessary (up to 128bytes), at the expense of using more space.
-
- Minimum overhead per allocated chunk: 4 or 8 bytes (if 4byte sizes)
- 8 or 16 bytes (if 8byte sizes)
- Each malloced chunk has a hidden word of overhead holding size
- and status information, and additional cross-check word
- if FOOTERS is defined.
-
- Minimum allocated size: 4-byte ptrs: 16 bytes (including overhead)
- 8-byte ptrs: 32 bytes (including overhead)
-
- Even a request for zero bytes (i.e., malloc(0)) returns a
- pointer to something of the minimum allocatable size.
- The maximum overhead wastage (i.e., number of extra bytes
- allocated than were requested in malloc) is less than or equal
- to the minimum size, except for requests >= mmap_threshold that
- are serviced via mmap(), where the worst case wastage is about
- 32 bytes plus the remainder from a system page (the minimal
- mmap unit); typically 4096 or 8192 bytes.
-
- Security: static-safe; optionally more or less
- The "security" of malloc refers to the ability of malicious
- code to accentuate the effects of errors (for example, freeing
- space that is not currently malloc'ed or overwriting past the
- ends of chunks) in code that calls malloc. This malloc
- guarantees not to modify any memory locations below the base of
- heap, i.e., static variables, even in the presence of usage
- errors. The routines additionally detect most improper frees
- and reallocs. All this holds as long as the static bookkeeping
- for malloc itself is not corrupted by some other means. This
- is only one aspect of security -- these checks do not, and
- cannot, detect all possible programming errors.
-
- If FOOTERS is defined nonzero, then each allocated chunk
- carries an additional check word to verify that it was malloced
- from its space. These check words are the same within each
- execution of a program using malloc, but differ across
- executions, so externally crafted fake chunks cannot be
- freed. This improves security by rejecting frees/reallocs that
- could corrupt heap memory, in addition to the checks preventing
- writes to statics that are always on. This may further improve
- security at the expense of time and space overhead. (Note that
- FOOTERS may also be worth using with MSPACES.)
-
- By default detected errors cause the program to abort (calling
- "abort()"). You can override this to instead proceed past
- errors by defining PROCEED_ON_ERROR. In this case, a bad free
- has no effect, and a malloc that encounters a bad address
- caused by user overwrites will ignore the bad address by
- dropping pointers and indices to all known memory. This may
- be appropriate for programs that should continue if at all
- possible in the face of programming errors, although they may
- run out of memory because dropped memory is never reclaimed.
-
- If you don't like either of these options, you can define
- CORRUPTION_ERROR_ACTION and USAGE_ERROR_ACTION to do anything
- else. And if if you are sure that your program using malloc has
- no errors or vulnerabilities, you can define INSECURE to 1,
- which might (or might not) provide a small performance improvement.
-
- Thread-safety: NOT thread-safe unless USE_LOCKS defined
- When USE_LOCKS is defined, each public call to malloc, free,
- etc is surrounded with either a pthread mutex or a win32
- spinlock (depending on WIN32). This is not especially fast, and
- can be a major bottleneck. It is designed only to provide
- minimal protection in concurrent environments, and to provide a
- basis for extensions. If you are using malloc in a concurrent
- program, consider instead using ptmalloc, which is derived from
- a version of this malloc. (See http://www.malloc.de).
-
- System requirements: Any combination of MORECORE and/or MMAP/MUNMAP
- This malloc can use unix sbrk or any emulation (invoked using
- the CALL_MORECORE macro) and/or mmap/munmap or any emulation
- (invoked using CALL_MMAP/CALL_MUNMAP) to get and release system
- memory. On most unix systems, it tends to work best if both
- MORECORE and MMAP are enabled. On Win32, it uses emulations
- based on VirtualAlloc. It also uses common C library functions
- like memset.
-
- Compliance: I believe it is compliant with the Single Unix Specification
- (See http://www.unix.org). Also SVID/XPG, ANSI C, and probably
- others as well.
-
-* Overview of algorithms
-
- This is not the fastest, most space-conserving, most portable, or
- most tunable malloc ever written. However it is among the fastest
- while also being among the most space-conserving, portable and
- tunable. Consistent balance across these factors results in a good
- general-purpose allocator for malloc-intensive programs.
-
- In most ways, this malloc is a best-fit allocator. Generally, it
- chooses the best-fitting existing chunk for a request, with ties
- broken in approximately least-recently-used order. (This strategy
- normally maintains low fragmentation.) However, for requests less
- than 256bytes, it deviates from best-fit when there is not an
- exactly fitting available chunk by preferring to use space adjacent
- to that used for the previous small request, as well as by breaking
- ties in approximately most-recently-used order. (These enhance
- locality of series of small allocations.) And for very large requests
- (>= 256Kb by default), it relies on system memory mapping
- facilities, if supported. (This helps avoid carrying around and
- possibly fragmenting memory used only for large chunks.)
-
- All operations (except malloc_stats and mallinfo) have execution
- times that are bounded by a constant factor of the number of bits in
- a size_t, not counting any clearing in calloc or copying in realloc,
- or actions surrounding MORECORE and MMAP that have times
- proportional to the number of non-contiguous regions returned by
- system allocation routines, which is often just 1.
-
- The implementation is not very modular and seriously overuses
- macros. Perhaps someday all C compilers will do as good a job
- inlining modular code as can now be done by brute-force expansion,
- but now, enough of them seem not to.
-
- Some compilers issue a lot of warnings about code that is
- dead/unreachable only on some platforms, and also about intentional
- uses of negation on unsigned types. All known cases of each can be
- ignored.
-
- For a longer but out of date high-level description, see
- http://gee.cs.oswego.edu/dl/html/malloc.html
-
-* MSPACES
- If MSPACES is defined, then in addition to malloc, free, etc.,
- this file also defines mspace_malloc, mspace_free, etc. These
- are versions of malloc routines that take an "mspace" argument
- obtained using create_mspace, to control all internal bookkeeping.
- If ONLY_MSPACES is defined, only these versions are compiled.
- So if you would like to use this allocator for only some allocations,
- and your system malloc for others, you can compile with
- ONLY_MSPACES and then do something like...
- static mspace mymspace = create_mspace(0,0); // for example
- #define mymalloc(bytes) mspace_malloc(mymspace, bytes)
-
- (Note: If you only need one instance of an mspace, you can instead
- use "USE_DL_PREFIX" to relabel the global malloc.)
-
- You can similarly create thread-local allocators by storing
- mspaces as thread-locals. For example:
- static __thread mspace tlms = 0;
- void* tlmalloc(size_t bytes) {
- if (tlms == 0) tlms = create_mspace(0, 0);
- return mspace_malloc(tlms, bytes);
- }
- void tlfree(void* mem) { mspace_free(tlms, mem); }
-
- Unless FOOTERS is defined, each mspace is completely independent.
- You cannot allocate from one and free to another (although
- conformance is only weakly checked, so usage errors are not always
- caught). If FOOTERS is defined, then each chunk carries around a tag
- indicating its originating mspace, and frees are directed to their
- originating spaces.
-
- ------------------------- Compile-time options ---------------------------
-
-Be careful in setting #define values for numerical constants of type
-size_t. On some systems, literal values are not automatically extended
-to size_t precision unless they are explicitly casted.
-
-WIN32 default: defined if _WIN32 defined
- Defining WIN32 sets up defaults for MS environment and compilers.
- Otherwise defaults are for unix.
-
-MALLOC_ALIGNMENT default: (size_t)8
- Controls the minimum alignment for malloc'ed chunks. It must be a
- power of two and at least 8, even on machines for which smaller
- alignments would suffice. It may be defined as larger than this
- though. Note however that code and data structures are optimized for
- the case of 8-byte alignment.
-
-MSPACES default: 0 (false)
- If true, compile in support for independent allocation spaces.
- This is only supported if HAVE_MMAP is true.
-
-ONLY_MSPACES default: 0 (false)
- If true, only compile in mspace versions, not regular versions.
-
-USE_LOCKS default: 0 (false)
- Causes each call to each public routine to be surrounded with
- pthread or WIN32 mutex lock/unlock. (If set true, this can be
- overridden on a per-mspace basis for mspace versions.)
-
-FOOTERS default: 0
- If true, provide extra checking and dispatching by placing
- information in the footers of allocated chunks. This adds
- space and time overhead.
-
-INSECURE default: 0
- If true, omit checks for usage errors and heap space overwrites.
-
-USE_DL_PREFIX default: NOT defined
- Causes compiler to prefix all public routines with the string 'dl'.
- This can be useful when you only want to use this malloc in one part
- of a program, using your regular system malloc elsewhere.
-
-ABORT default: defined as abort()
- Defines how to abort on failed checks. On most systems, a failed
- check cannot die with an "assert" or even print an informative
- message, because the underlying print routines in turn call malloc,
- which will fail again. Generally, the best policy is to simply call
- abort(). It's not very useful to do more than this because many
- errors due to overwriting will show up as address faults (null, odd
- addresses etc) rather than malloc-triggered checks, so will also
- abort. Also, most compilers know that abort() does not return, so
- can better optimize code conditionally calling it.
-
-PROCEED_ON_ERROR default: defined as 0 (false)
- Controls whether detected bad addresses cause them to bypassed
- rather than aborting. If set, detected bad arguments to free and
- realloc are ignored. And all bookkeeping information is zeroed out
- upon a detected overwrite of freed heap space, thus losing the
- ability to ever return it from malloc again, but enabling the
- application to proceed. If PROCEED_ON_ERROR is defined, the
- static variable malloc_corruption_error_count is compiled in
- and can be examined to see if errors have occurred. This option
- generates slower code than the default abort policy.
-
-DEBUG default: NOT defined
- The DEBUG setting is mainly intended for people trying to modify
- this code or diagnose problems when porting to new platforms.
- However, it may also be able to better isolate user errors than just
- using runtime checks. The assertions in the check routines spell
- out in more detail the assumptions and invariants underlying the
- algorithms. The checking is fairly extensive, and will slow down
- execution noticeably. Calling malloc_stats or mallinfo with DEBUG
- set will attempt to check every non-mmapped allocated and free chunk
- in the course of computing the summaries.
-
-ABORT_ON_ASSERT_FAILURE default: defined as 1 (true)
- Debugging assertion failures can be nearly impossible if your
- version of the assert macro causes malloc to be called, which will
- lead to a cascade of further failures, blowing the runtime stack.
- ABORT_ON_ASSERT_FAILURE cause assertions failures to call abort(),
- which will usually make debugging easier.
-
-MALLOC_FAILURE_ACTION default: sets errno to ENOMEM, or no-op on win32
- The action to take before "return 0" when malloc fails to be able to
- return memory because there is none available.
-
-HAVE_MORECORE default: 1 (true) unless win32 or ONLY_MSPACES
- True if this system supports sbrk or an emulation of it.
-
-MORECORE default: sbrk
- The name of the sbrk-style system routine to call to obtain more
- memory. See below for guidance on writing custom MORECORE
- functions. The type of the argument to sbrk/MORECORE varies across
- systems. It cannot be size_t, because it supports negative
- arguments, so it is normally the signed type of the same width as
- size_t (sometimes declared as "intptr_t"). It doesn't much matter
- though. Internally, we only call it with arguments less than half
- the max value of a size_t, which should work across all reasonable
- possibilities, although sometimes generating compiler warnings. See
- near the end of this file for guidelines for creating a custom
- version of MORECORE.
-
-MORECORE_CONTIGUOUS default: 1 (true)
- If true, take advantage of fact that consecutive calls to MORECORE
- with positive arguments always return contiguous increasing
- addresses. This is true of unix sbrk. It does not hurt too much to
- set it true anyway, since malloc copes with non-contiguities.
- Setting it false when definitely non-contiguous saves time
- and possibly wasted space it would take to discover this though.
-
-MORECORE_CANNOT_TRIM default: NOT defined
- True if MORECORE cannot release space back to the system when given
- negative arguments. This is generally necessary only if you are
- using a hand-crafted MORECORE function that cannot handle negative
- arguments.
-
-HAVE_MMAP default: 1 (true)
- True if this system supports mmap or an emulation of it. If so, and
- HAVE_MORECORE is not true, MMAP is used for all system
- allocation. If set and HAVE_MORECORE is true as well, MMAP is
- primarily used to directly allocate very large blocks. It is also
- used as a backup strategy in cases where MORECORE fails to provide
- space from system. Note: A single call to MUNMAP is assumed to be
- able to unmap memory that may have be allocated using multiple calls
- to MMAP, so long as they are adjacent.
-
-HAVE_MREMAP default: 1 on linux, else 0
- If true realloc() uses mremap() to re-allocate large blocks and
- extend or shrink allocation spaces.
-
-MMAP_CLEARS default: 1 on unix
- True if mmap clears memory so calloc doesn't need to. This is true
- for standard unix mmap using /dev/zero.
-
-USE_BUILTIN_FFS default: 0 (i.e., not used)
- Causes malloc to use the builtin ffs() function to compute indices.
- Some compilers may recognize and intrinsify ffs to be faster than the
- supplied C version. Also, the case of x86 using gcc is special-cased
- to an asm instruction, so is already as fast as it can be, and so
- this setting has no effect. (On most x86s, the asm version is only
- slightly faster than the C version.)
-
-malloc_getpagesize default: derive from system includes, or 4096.
- The system page size. To the extent possible, this malloc manages
- memory from the system in page-size units. This may be (and
- usually is) a function rather than a constant. This is ignored
- if WIN32, where page size is determined using getSystemInfo during
- initialization.
-
-USE_DEV_RANDOM default: 0 (i.e., not used)
- Causes malloc to use /dev/random to initialize secure magic seed for
- stamping footers. Otherwise, the current time is used.
-
-NO_MALLINFO default: 0
- If defined, don't compile "mallinfo". This can be a simple way
- of dealing with mismatches between system declarations and
- those in this file.
-
-MALLINFO_FIELD_TYPE default: size_t
- The type of the fields in the mallinfo struct. This was originally
- defined as "int" in SVID etc, but is more usefully defined as
- size_t. The value is used only if HAVE_USR_INCLUDE_MALLOC_H is not set
-
-REALLOC_ZERO_BYTES_FREES default: not defined
- This should be set if a call to realloc with zero bytes should
- be the same as a call to free. Some people think it should. Otherwise,
- since this malloc returns a unique pointer for malloc(0), so does
- realloc(p, 0).
-
-LACKS_UNISTD_H, LACKS_FCNTL_H, LACKS_SYS_PARAM_H, LACKS_SYS_MMAN_H
-LACKS_STRINGS_H, LACKS_STRING_H, LACKS_SYS_TYPES_H, LACKS_ERRNO_H
-LACKS_STDLIB_H default: NOT defined unless on WIN32
- Define these if your system does not have these header files.
- You might need to manually insert some of the declarations they provide.
-
-DEFAULT_GRANULARITY default: page size if MORECORE_CONTIGUOUS,
- system_info.dwAllocationGranularity in WIN32,
- otherwise 64K.
- Also settable using mallopt(M_GRANULARITY, x)
- The unit for allocating and deallocating memory from the system. On
- most systems with contiguous MORECORE, there is no reason to
- make this more than a page. However, systems with MMAP tend to
- either require or encourage larger granularities. You can increase
- this value to prevent system allocation functions to be called so
- often, especially if they are slow. The value must be at least one
- page and must be a power of two. Setting to 0 causes initialization
- to either page size or win32 region size. (Note: In previous
- versions of malloc, the equivalent of this option was called
- "TOP_PAD")
-
-DEFAULT_TRIM_THRESHOLD default: 2MB
- Also settable using mallopt(M_TRIM_THRESHOLD, x)
- The maximum amount of unused top-most memory to keep before
- releasing via malloc_trim in free(). Automatic trimming is mainly
- useful in long-lived programs using contiguous MORECORE. Because
- trimming via sbrk can be slow on some systems, and can sometimes be
- wasteful (in cases where programs immediately afterward allocate
- more large chunks) the value should be high enough so that your
- overall system performance would improve by releasing this much
- memory. As a rough guide, you might set to a value close to the
- average size of a process (program) running on your system.
- Releasing this much memory would allow such a process to run in
- memory. Generally, it is worth tuning trim thresholds when a
- program undergoes phases where several large chunks are allocated
- and released in ways that can reuse each other's storage, perhaps
- mixed with phases where there are no such chunks at all. The trim
- value must be greater than page size to have any useful effect. To
- disable trimming completely, you can set to MAX_SIZE_T. Note that the trick
- some people use of mallocing a huge space and then freeing it at
- program startup, in an attempt to reserve system memory, doesn't
- have the intended effect under automatic trimming, since that memory
- will immediately be returned to the system.
-
-DEFAULT_MMAP_THRESHOLD default: 256K
- Also settable using mallopt(M_MMAP_THRESHOLD, x)
- The request size threshold for using MMAP to directly service a
- request. Requests of at least this size that cannot be allocated
- using already-existing space will be serviced via mmap. (If enough
- normal freed space already exists it is used instead.) Using mmap
- segregates relatively large chunks of memory so that they can be
- individually obtained and released from the host system. A request
- serviced through mmap is never reused by any other request (at least
- not directly; the system may just so happen to remap successive
- requests to the same locations). Segregating space in this way has
- the benefits that: Mmapped space can always be individually released
- back to the system, which helps keep the system level memory demands
- of a long-lived program low. Also, mapped memory doesn't become
- `locked' between other chunks, as can happen with normally allocated
- chunks, which means that even trimming via malloc_trim would not
- release them. However, it has the disadvantage that the space
- cannot be reclaimed, consolidated, and then used to service later
- requests, as happens with normal chunks. The advantages of mmap
- nearly always outweigh disadvantages for "large" chunks, but the
- value of "large" may vary across systems. The default is an
- empirically derived value that works well in most systems. You can
- disable mmap by setting to MAX_SIZE_T.
-
-*/
-
-#ifndef WIN32
-#ifdef _WIN32
-#define WIN32 1
-#endif /* _WIN32 */
-#endif /* WIN32 */
-#ifdef WIN32
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
-#define HAVE_MMAP 1
-#define HAVE_MORECORE 0
-#define LACKS_UNISTD_H
-#define LACKS_SYS_PARAM_H
-#define LACKS_SYS_MMAN_H
-#define LACKS_STRING_H
-#define LACKS_STRINGS_H
-#define LACKS_SYS_TYPES_H
-#define LACKS_ERRNO_H
-#define MALLOC_FAILURE_ACTION
-#define MMAP_CLEARS 0 /* WINCE and some others apparently don't clear */
-#elif !defined _GNU_SOURCE
-/* mremap() on Linux requires this via sys/mman.h
- * See roundup issue 10309
- */
-#define _GNU_SOURCE 1
-#endif /* WIN32 */
-
-#ifdef __OS2__
-#define INCL_DOS
-#include <os2.h>
-#define HAVE_MMAP 1
-#define HAVE_MORECORE 0
-#define LACKS_SYS_MMAN_H
-#endif /* __OS2__ */
-
-#if defined(DARWIN) || defined(_DARWIN)
-/* Mac OSX docs advise not to use sbrk; it seems better to use mmap */
-#ifndef HAVE_MORECORE
-#define HAVE_MORECORE 0
-#define HAVE_MMAP 1
-#endif /* HAVE_MORECORE */
-#endif /* DARWIN */
-
-#ifndef LACKS_SYS_TYPES_H
-#include <sys/types.h> /* For size_t */
-#endif /* LACKS_SYS_TYPES_H */
-
-/* The maximum possible size_t value has all bits set */
-#define MAX_SIZE_T (~(size_t)0)
-
-#ifndef ONLY_MSPACES
-#define ONLY_MSPACES 0
-#endif /* ONLY_MSPACES */
-#ifndef MSPACES
-#if ONLY_MSPACES
-#define MSPACES 1
-#else /* ONLY_MSPACES */
-#define MSPACES 0
-#endif /* ONLY_MSPACES */
-#endif /* MSPACES */
-#ifndef MALLOC_ALIGNMENT
-#define MALLOC_ALIGNMENT ((size_t)8U)
-#endif /* MALLOC_ALIGNMENT */
-#ifndef FOOTERS
-#define FOOTERS 0
-#endif /* FOOTERS */
-#ifndef ABORT
-#define ABORT abort()
-#endif /* ABORT */
-#ifndef ABORT_ON_ASSERT_FAILURE
-#define ABORT_ON_ASSERT_FAILURE 1
-#endif /* ABORT_ON_ASSERT_FAILURE */
-#ifndef PROCEED_ON_ERROR
-#define PROCEED_ON_ERROR 0
-#endif /* PROCEED_ON_ERROR */
-#ifndef USE_LOCKS
-#define USE_LOCKS 0
-#endif /* USE_LOCKS */
-#ifndef INSECURE
-#define INSECURE 0
-#endif /* INSECURE */
-#ifndef HAVE_MMAP
-#define HAVE_MMAP 1
-#endif /* HAVE_MMAP */
-#ifndef MMAP_CLEARS
-#define MMAP_CLEARS 1
-#endif /* MMAP_CLEARS */
-#ifndef HAVE_MREMAP
-#ifdef __linux__
-#define HAVE_MREMAP 1
-#else /* linux */
-#define HAVE_MREMAP 0
-#endif /* linux */
-#endif /* HAVE_MREMAP */
-#ifndef MALLOC_FAILURE_ACTION
-#define MALLOC_FAILURE_ACTION errno = ENOMEM;
-#endif /* MALLOC_FAILURE_ACTION */
-#ifndef HAVE_MORECORE
-#if ONLY_MSPACES
-#define HAVE_MORECORE 0
-#else /* ONLY_MSPACES */
-#define HAVE_MORECORE 1
-#endif /* ONLY_MSPACES */
-#endif /* HAVE_MORECORE */
-#if !HAVE_MORECORE
-#define MORECORE_CONTIGUOUS 0
-#else /* !HAVE_MORECORE */
-#ifndef MORECORE
-#define MORECORE sbrk
-#endif /* MORECORE */
-#ifndef MORECORE_CONTIGUOUS
-#define MORECORE_CONTIGUOUS 1
-#endif /* MORECORE_CONTIGUOUS */
-#endif /* HAVE_MORECORE */
-#ifndef DEFAULT_GRANULARITY
-#if MORECORE_CONTIGUOUS
-#define DEFAULT_GRANULARITY (0) /* 0 means to compute in init_mparams */
-#else /* MORECORE_CONTIGUOUS */
-#define DEFAULT_GRANULARITY ((size_t)64U * (size_t)1024U)
-#endif /* MORECORE_CONTIGUOUS */
-#endif /* DEFAULT_GRANULARITY */
-#ifndef DEFAULT_TRIM_THRESHOLD
-#ifndef MORECORE_CANNOT_TRIM
-#define DEFAULT_TRIM_THRESHOLD ((size_t)2U * (size_t)1024U * (size_t)1024U)
-#else /* MORECORE_CANNOT_TRIM */
-#define DEFAULT_TRIM_THRESHOLD MAX_SIZE_T
-#endif /* MORECORE_CANNOT_TRIM */
-#endif /* DEFAULT_TRIM_THRESHOLD */
-#ifndef DEFAULT_MMAP_THRESHOLD
-#if HAVE_MMAP
-#define DEFAULT_MMAP_THRESHOLD ((size_t)256U * (size_t)1024U)
-#else /* HAVE_MMAP */
-#define DEFAULT_MMAP_THRESHOLD MAX_SIZE_T
-#endif /* HAVE_MMAP */
-#endif /* DEFAULT_MMAP_THRESHOLD */
-#ifndef USE_BUILTIN_FFS
-#define USE_BUILTIN_FFS 0
-#endif /* USE_BUILTIN_FFS */
-#ifndef USE_DEV_RANDOM
-#define USE_DEV_RANDOM 0
-#endif /* USE_DEV_RANDOM */
-#ifndef NO_MALLINFO
-#define NO_MALLINFO 0
-#endif /* NO_MALLINFO */
-#ifndef MALLINFO_FIELD_TYPE
-#define MALLINFO_FIELD_TYPE size_t
-#endif /* MALLINFO_FIELD_TYPE */
-
-/*
- mallopt tuning options. SVID/XPG defines four standard parameter
- numbers for mallopt, normally defined in malloc.h. None of these
- are used in this malloc, so setting them has no effect. But this
- malloc does support the following options.
-*/
-
-#define M_TRIM_THRESHOLD (-1)
-#define M_GRANULARITY (-2)
-#define M_MMAP_THRESHOLD (-3)
-
-/* ------------------------ Mallinfo declarations ------------------------ */
-
-#if !NO_MALLINFO
-/*
- This version of malloc supports the standard SVID/XPG mallinfo
- routine that returns a struct containing usage properties and
- statistics. It should work on any system that has a
- /usr/include/malloc.h defining struct mallinfo. The main
- declaration needed is the mallinfo struct that is returned (by-copy)
- by mallinfo(). The malloinfo struct contains a bunch of fields that
- are not even meaningful in this version of malloc. These fields are
- are instead filled by mallinfo() with other numbers that might be of
- interest.
-
- HAVE_USR_INCLUDE_MALLOC_H should be set if you have a
- /usr/include/malloc.h file that includes a declaration of struct
- mallinfo. If so, it is included; else a compliant version is
- declared below. These must be precisely the same for mallinfo() to
- work. The original SVID version of this struct, defined on most
- systems with mallinfo, declares all fields as ints. But some others
- define as unsigned long. If your system defines the fields using a
- type of different width than listed here, you MUST #include your
- system version and #define HAVE_USR_INCLUDE_MALLOC_H.
-*/
-
-/* #define HAVE_USR_INCLUDE_MALLOC_H */
-
-#ifdef HAVE_USR_INCLUDE_MALLOC_H
-#include "/usr/include/malloc.h"
-#else /* HAVE_USR_INCLUDE_MALLOC_H */
-
-/* HP-UX's stdlib.h redefines mallinfo unless _STRUCT_MALLINFO is defined */
-#define _STRUCT_MALLINFO
-
-struct mallinfo {
- MALLINFO_FIELD_TYPE arena; /* non-mmapped space allocated from system */
- MALLINFO_FIELD_TYPE ordblks; /* number of free chunks */
- MALLINFO_FIELD_TYPE smblks; /* always 0 */
- MALLINFO_FIELD_TYPE hblks; /* always 0 */
- MALLINFO_FIELD_TYPE hblkhd; /* space in mmapped regions */
- MALLINFO_FIELD_TYPE usmblks; /* maximum total allocated space */
- MALLINFO_FIELD_TYPE fsmblks; /* always 0 */
- MALLINFO_FIELD_TYPE uordblks; /* total allocated space */
- MALLINFO_FIELD_TYPE fordblks; /* total free space */
- MALLINFO_FIELD_TYPE keepcost; /* releasable (via malloc_trim) space */
-};
-
-#endif /* HAVE_USR_INCLUDE_MALLOC_H */
-#endif /* NO_MALLINFO */
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
-#if !ONLY_MSPACES
-
-/* ------------------- Declarations of public routines ------------------- */
-
-#ifndef USE_DL_PREFIX
-#define dlcalloc calloc
-#define dlfree free
-#define dlmalloc malloc
-#define dlmemalign memalign
-#define dlrealloc realloc
-#define dlvalloc valloc
-#define dlpvalloc pvalloc
-#define dlmallinfo mallinfo
-#define dlmallopt mallopt
-#define dlmalloc_trim malloc_trim
-#define dlmalloc_stats malloc_stats
-#define dlmalloc_usable_size malloc_usable_size
-#define dlmalloc_footprint malloc_footprint
-#define dlmalloc_max_footprint malloc_max_footprint
-#define dlindependent_calloc independent_calloc
-#define dlindependent_comalloc independent_comalloc
-#endif /* USE_DL_PREFIX */
-
-
-/*
- malloc(size_t n)
- Returns a pointer to a newly allocated chunk of at least n bytes, or
- null if no space is available, in which case errno is set to ENOMEM
- on ANSI C systems.
-
- If n is zero, malloc returns a minimum-sized chunk. (The minimum
- size is 16 bytes on most 32bit systems, and 32 bytes on 64bit
- systems.) Note that size_t is an unsigned type, so calls with
- arguments that would be negative if signed are interpreted as
- requests for huge amounts of space, which will often fail. The
- maximum supported value of n differs across systems, but is in all
- cases less than the maximum representable value of a size_t.
-*/
-void* dlmalloc(size_t);
-
-/*
- free(void* p)
- Releases the chunk of memory pointed to by p, that had been previously
- allocated using malloc or a related routine such as realloc.
- It has no effect if p is null. If p was not malloced or already
- freed, free(p) will by default cause the current program to abort.
-*/
-void dlfree(void*);
-
-/*
- calloc(size_t n_elements, size_t element_size);
- Returns a pointer to n_elements * element_size bytes, with all locations
- set to zero.
-*/
-void* dlcalloc(size_t, size_t);
-
-/*
- realloc(void* p, size_t n)
- Returns a pointer to a chunk of size n that contains the same data
- as does chunk p up to the minimum of (n, p's size) bytes, or null
- if no space is available.
-
- The returned pointer may or may not be the same as p. The algorithm
- prefers extending p in most cases when possible, otherwise it
- employs the equivalent of a malloc-copy-free sequence.
-
- If p is null, realloc is equivalent to malloc.
-
- If space is not available, realloc returns null, errno is set (if on
- ANSI) and p is NOT freed.
-
- if n is for fewer bytes than already held by p, the newly unused
- space is lopped off and freed if possible. realloc with a size
- argument of zero (re)allocates a minimum-sized chunk.
-
- The old unix realloc convention of allowing the last-free'd chunk
- to be used as an argument to realloc is not supported.
-*/
-
-void* dlrealloc(void*, size_t);
-
-/*
- memalign(size_t alignment, size_t n);
- Returns a pointer to a newly allocated chunk of n bytes, aligned
- in accord with the alignment argument.
-
- The alignment argument should be a power of two. If the argument is
- not a power of two, the nearest greater power is used.
- 8-byte alignment is guaranteed by normal malloc calls, so don't
- bother calling memalign with an argument of 8 or less.
-
- Overreliance on memalign is a sure way to fragment space.
-*/
-void* dlmemalign(size_t, size_t);
-
-/*
- valloc(size_t n);
- Equivalent to memalign(pagesize, n), where pagesize is the page
- size of the system. If the pagesize is unknown, 4096 is used.
-*/
-void* dlvalloc(size_t);
-
-/*
- mallopt(int parameter_number, int parameter_value)
- Sets tunable parameters The format is to provide a
- (parameter-number, parameter-value) pair. mallopt then sets the
- corresponding parameter to the argument value if it can (i.e., so
- long as the value is meaningful), and returns 1 if successful else
- 0. SVID/XPG/ANSI defines four standard param numbers for mallopt,
- normally defined in malloc.h. None of these are use in this malloc,
- so setting them has no effect. But this malloc also supports other
- options in mallopt. See below for details. Briefly, supported
- parameters are as follows (listed defaults are for "typical"
- configurations).
-
- Symbol param # default allowed param values
- M_TRIM_THRESHOLD -1 2*1024*1024 any (MAX_SIZE_T disables)
- M_GRANULARITY -2 page size any power of 2 >= page size
- M_MMAP_THRESHOLD -3 256*1024 any (or 0 if no MMAP support)
-*/
-int dlmallopt(int, int);
-
-/*
- malloc_footprint();
- Returns the number of bytes obtained from the system. The total
- number of bytes allocated by malloc, realloc etc., is less than this
- value. Unlike mallinfo, this function returns only a precomputed
- result, so can be called frequently to monitor memory consumption.
- Even if locks are otherwise defined, this function does not use them,
- so results might not be up to date.
-*/
-size_t dlmalloc_footprint(void);
-
-/*
- malloc_max_footprint();
- Returns the maximum number of bytes obtained from the system. This
- value will be greater than current footprint if deallocated space
- has been reclaimed by the system. The peak number of bytes allocated
- by malloc, realloc etc., is less than this value. Unlike mallinfo,
- this function returns only a precomputed result, so can be called
- frequently to monitor memory consumption. Even if locks are
- otherwise defined, this function does not use them, so results might
- not be up to date.
-*/
-size_t dlmalloc_max_footprint(void);
-
-#if !NO_MALLINFO
-/*
- mallinfo()
- Returns (by copy) a struct containing various summary statistics:
-
- arena: current total non-mmapped bytes allocated from system
- ordblks: the number of free chunks
- smblks: always zero.
- hblks: current number of mmapped regions
- hblkhd: total bytes held in mmapped regions
- usmblks: the maximum total allocated space. This will be greater
- than current total if trimming has occurred.
- fsmblks: always zero
- uordblks: current total allocated space (normal or mmapped)
- fordblks: total free space
- keepcost: the maximum number of bytes that could ideally be released
- back to system via malloc_trim. ("ideally" means that
- it ignores page restrictions etc.)
-
- Because these fields are ints, but internal bookkeeping may
- be kept as longs, the reported values may wrap around zero and
- thus be inaccurate.
-*/
-struct mallinfo dlmallinfo(void);
-#endif /* NO_MALLINFO */
-
-/*
- independent_calloc(size_t n_elements, size_t element_size, void* chunks[]);
-
- independent_calloc is similar to calloc, but instead of returning a
- single cleared space, it returns an array of pointers to n_elements
- independent elements that can hold contents of size elem_size, each
- of which starts out cleared, and can be independently freed,
- realloc'ed etc. The elements are guaranteed to be adjacently
- allocated (this is not guaranteed to occur with multiple callocs or
- mallocs), which may also improve cache locality in some
- applications.
-
- The "chunks" argument is optional (i.e., may be null, which is
- probably the most typical usage). If it is null, the returned array
- is itself dynamically allocated and should also be freed when it is
- no longer needed. Otherwise, the chunks array must be of at least
- n_elements in length. It is filled in with the pointers to the
- chunks.
-
- In either case, independent_calloc returns this pointer array, or
- null if the allocation failed. If n_elements is zero and "chunks"
- is null, it returns a chunk representing an array with zero elements
- (which should be freed if not wanted).
-
- Each element must be individually freed when it is no longer
- needed. If you'd like to instead be able to free all at once, you
- should instead use regular calloc and assign pointers into this
- space to represent elements. (In this case though, you cannot
- independently free elements.)
-
- independent_calloc simplifies and speeds up implementations of many
- kinds of pools. It may also be useful when constructing large data
- structures that initially have a fixed number of fixed-sized nodes,
- but the number is not known at compile time, and some of the nodes
- may later need to be freed. For example:
-
- struct Node { int item; struct Node* next; };
-
- struct Node* build_list() {
- struct Node** pool;
- int n = read_number_of_nodes_needed();
- if (n <= 0) return 0;
- pool = (struct Node**)(independent_calloc(n, sizeof(struct Node), 0);
- if (pool == 0) die();
- // organize into a linked list...
- struct Node* first = pool[0];
- for (i = 0; i < n-1; ++i)
- pool[i]->next = pool[i+1];
- free(pool); // Can now free the array (or not, if it is needed later)
- return first;
- }
-*/
-void** dlindependent_calloc(size_t, size_t, void**);
-
-/*
- independent_comalloc(size_t n_elements, size_t sizes[], void* chunks[]);
-
- independent_comalloc allocates, all at once, a set of n_elements
- chunks with sizes indicated in the "sizes" array. It returns
- an array of pointers to these elements, each of which can be
- independently freed, realloc'ed etc. The elements are guaranteed to
- be adjacently allocated (this is not guaranteed to occur with
- multiple callocs or mallocs), which may also improve cache locality
- in some applications.
-
- The "chunks" argument is optional (i.e., may be null). If it is null
- the returned array is itself dynamically allocated and should also
- be freed when it is no longer needed. Otherwise, the chunks array
- must be of at least n_elements in length. It is filled in with the
- pointers to the chunks.
-
- In either case, independent_comalloc returns this pointer array, or
- null if the allocation failed. If n_elements is zero and chunks is
- null, it returns a chunk representing an array with zero elements
- (which should be freed if not wanted).
-
- Each element must be individually freed when it is no longer
- needed. If you'd like to instead be able to free all at once, you
- should instead use a single regular malloc, and assign pointers at
- particular offsets in the aggregate space. (In this case though, you
- cannot independently free elements.)
-
- independent_comallac differs from independent_calloc in that each
- element may have a different size, and also that it does not
- automatically clear elements.
-
- independent_comalloc can be used to speed up allocation in cases
- where several structs or objects must always be allocated at the
- same time. For example:
-
- struct Head { ... }
- struct Foot { ... }
-
- void send_message(char* msg) {
- int msglen = strlen(msg);
- size_t sizes[3] = { sizeof(struct Head), msglen, sizeof(struct Foot) };
- void* chunks[3];
- if (independent_comalloc(3, sizes, chunks) == 0)
- die();
- struct Head* head = (struct Head*)(chunks[0]);
- char* body = (char*)(chunks[1]);
- struct Foot* foot = (struct Foot*)(chunks[2]);
- // ...
- }
-
- In general though, independent_comalloc is worth using only for
- larger values of n_elements. For small values, you probably won't
- detect enough difference from series of malloc calls to bother.
-
- Overuse of independent_comalloc can increase overall memory usage,
- since it cannot reuse existing noncontiguous small chunks that
- might be available for some of the elements.
-*/
-void** dlindependent_comalloc(size_t, size_t*, void**);
-
-
-/*
- pvalloc(size_t n);
- Equivalent to valloc(minimum-page-that-holds(n)), that is,
- round up n to nearest pagesize.
- */
-void* dlpvalloc(size_t);
-
-/*
- malloc_trim(size_t pad);
-
- If possible, gives memory back to the system (via negative arguments
- to sbrk) if there is unused memory at the `high' end of the malloc
- pool or in unused MMAP segments. You can call this after freeing
- large blocks of memory to potentially reduce the system-level memory
- requirements of a program. However, it cannot guarantee to reduce
- memory. Under some allocation patterns, some large free blocks of
- memory will be locked between two used chunks, so they cannot be
- given back to the system.
-
- The `pad' argument to malloc_trim represents the amount of free
- trailing space to leave untrimmed. If this argument is zero, only
- the minimum amount of memory to maintain internal data structures
- will be left. Non-zero arguments can be supplied to maintain enough
- trailing space to service future expected allocations without having
- to re-obtain memory from the system.
-
- Malloc_trim returns 1 if it actually released any memory, else 0.
-*/
-int dlmalloc_trim(size_t);
-
-/*
- malloc_usable_size(void* p);
-
- Returns the number of bytes you can actually use in
- an allocated chunk, which may be more than you requested (although
- often not) due to alignment and minimum size constraints.
- You can use this many bytes without worrying about
- overwriting other allocated objects. This is not a particularly great
- programming practice. malloc_usable_size can be more useful in
- debugging and assertions, for example:
-
- p = malloc(n);
- assert(malloc_usable_size(p) >= 256);
-*/
-size_t dlmalloc_usable_size(void*);
-
-/*
- malloc_stats();
- Prints on stderr the amount of space obtained from the system (both
- via sbrk and mmap), the maximum amount (which may be more than
- current if malloc_trim and/or munmap got called), and the current
- number of bytes allocated via malloc (or realloc, etc) but not yet
- freed. Note that this is the number of bytes allocated, not the
- number requested. It will be larger than the number requested
- because of alignment and bookkeeping overhead. Because it includes
- alignment wastage as being in use, this figure may be greater than
- zero even when no user-level chunks are allocated.
-
- The reported current and maximum system memory can be inaccurate if
- a program makes other calls to system memory allocation functions
- (normally sbrk) outside of malloc.
-
- malloc_stats prints only the most commonly interesting statistics.
- More information can be obtained by calling mallinfo.
-*/
-void dlmalloc_stats(void);
-
-#endif /* ONLY_MSPACES */
-
-#if MSPACES
-
-/*
- mspace is an opaque type representing an independent
- region of space that supports mspace_malloc, etc.
-*/
-typedef void* mspace;
-
-/*
- create_mspace creates and returns a new independent space with the
- given initial capacity, or, if 0, the default granularity size. It
- returns null if there is no system memory available to create the
- space. If argument locked is non-zero, the space uses a separate
- lock to control access. The capacity of the space will grow
- dynamically as needed to service mspace_malloc requests. You can
- control the sizes of incremental increases of this space by
- compiling with a different DEFAULT_GRANULARITY or dynamically
- setting with mallopt(M_GRANULARITY, value).
-*/
-mspace create_mspace(size_t capacity, int locked);
-
-/*
- destroy_mspace destroys the given space, and attempts to return all
- of its memory back to the system, returning the total number of
- bytes freed. After destruction, the results of access to all memory
- used by the space become undefined.
-*/
-size_t destroy_mspace(mspace msp);
-
-/*
- create_mspace_with_base uses the memory supplied as the initial base
- of a new mspace. Part (less than 128*sizeof(size_t) bytes) of this
- space is used for bookkeeping, so the capacity must be at least this
- large. (Otherwise 0 is returned.) When this initial space is
- exhausted, additional memory will be obtained from the system.
- Destroying this space will deallocate all additionally allocated
- space (if possible) but not the initial base.
-*/
-mspace create_mspace_with_base(void* base, size_t capacity, int locked);
-
-/*
- mspace_malloc behaves as malloc, but operates within
- the given space.
-*/
-void* mspace_malloc(mspace msp, size_t bytes);
-
-/*
- mspace_free behaves as free, but operates within
- the given space.
-
- If compiled with FOOTERS==1, mspace_free is not actually needed.
- free may be called instead of mspace_free because freed chunks from
- any space are handled by their originating spaces.
-*/
-void mspace_free(mspace msp, void* mem);
-
-/*
- mspace_realloc behaves as realloc, but operates within
- the given space.
-
- If compiled with FOOTERS==1, mspace_realloc is not actually
- needed. realloc may be called instead of mspace_realloc because
- realloced chunks from any space are handled by their originating
- spaces.
-*/
-void* mspace_realloc(mspace msp, void* mem, size_t newsize);
-
-/*
- mspace_calloc behaves as calloc, but operates within
- the given space.
-*/
-void* mspace_calloc(mspace msp, size_t n_elements, size_t elem_size);
-
-/*
- mspace_memalign behaves as memalign, but operates within
- the given space.
-*/
-void* mspace_memalign(mspace msp, size_t alignment, size_t bytes);
-
-/*
- mspace_independent_calloc behaves as independent_calloc, but
- operates within the given space.
-*/
-void** mspace_independent_calloc(mspace msp, size_t n_elements,
- size_t elem_size, void* chunks[]);
-
-/*
- mspace_independent_comalloc behaves as independent_comalloc, but
- operates within the given space.
-*/
-void** mspace_independent_comalloc(mspace msp, size_t n_elements,
- size_t sizes[], void* chunks[]);
-
-/*
- mspace_footprint() returns the number of bytes obtained from the
- system for this space.
-*/
-size_t mspace_footprint(mspace msp);
-
-/*
- mspace_max_footprint() returns the peak number of bytes obtained from the
- system for this space.
-*/
-size_t mspace_max_footprint(mspace msp);
-
-
-#if !NO_MALLINFO
-/*
- mspace_mallinfo behaves as mallinfo, but reports properties of
- the given space.
-*/
-struct mallinfo mspace_mallinfo(mspace msp);
-#endif /* NO_MALLINFO */
-
-/*
- mspace_malloc_stats behaves as malloc_stats, but reports
- properties of the given space.
-*/
-void mspace_malloc_stats(mspace msp);
-
-/*
- mspace_trim behaves as malloc_trim, but
- operates within the given space.
-*/
-int mspace_trim(mspace msp, size_t pad);
-
-/*
- An alias for mallopt.
-*/
-int mspace_mallopt(int, int);
-
-#endif /* MSPACES */
-
-#ifdef __cplusplus
-}; /* end of extern "C" */
-#endif /* __cplusplus */
-
-/*
- ========================================================================
- To make a fully customizable malloc.h header file, cut everything
- above this line, put into file malloc.h, edit to suit, and #include it
- on the next line, as well as in programs that use this malloc.
- ========================================================================
-*/
-
-/* #include "malloc.h" */
-
-/*------------------------------ internal #includes ---------------------- */
-
-#ifdef _MSC_VER
-#pragma warning( disable : 4146 ) /* no "unsigned" warnings */
-#endif /* _MSC_VER */
-
-#include <stdio.h> /* for printing in malloc_stats */
-
-#ifndef LACKS_ERRNO_H
-#include <errno.h> /* for MALLOC_FAILURE_ACTION */
-#endif /* LACKS_ERRNO_H */
-#if FOOTERS
-#include <time.h> /* for magic initialization */
-#endif /* FOOTERS */
-#ifndef LACKS_STDLIB_H
-#include <stdlib.h> /* for abort() */
-#endif /* LACKS_STDLIB_H */
-#ifdef DEBUG
-#if ABORT_ON_ASSERT_FAILURE
-#define assert(x) if(!(x)) ABORT
-#else /* ABORT_ON_ASSERT_FAILURE */
-#include <assert.h>
-#endif /* ABORT_ON_ASSERT_FAILURE */
-#else /* DEBUG */
-#define assert(x)
-#endif /* DEBUG */
-#ifndef LACKS_STRING_H
-#include <string.h> /* for memset etc */
-#endif /* LACKS_STRING_H */
-#if USE_BUILTIN_FFS
-#ifndef LACKS_STRINGS_H
-#include <strings.h> /* for ffs */
-#endif /* LACKS_STRINGS_H */
-#endif /* USE_BUILTIN_FFS */
-#if HAVE_MMAP
-#ifndef LACKS_SYS_MMAN_H
-#include <sys/mman.h> /* for mmap */
-#endif /* LACKS_SYS_MMAN_H */
-#ifndef LACKS_FCNTL_H
-#include <fcntl.h>
-#endif /* LACKS_FCNTL_H */
-#endif /* HAVE_MMAP */
-#if HAVE_MORECORE
-#ifndef LACKS_UNISTD_H
-#include <unistd.h> /* for sbrk */
-#else /* LACKS_UNISTD_H */
-#if !defined(__FreeBSD__) && !defined(__OpenBSD__) && !defined(__NetBSD__)
-extern void* sbrk(ptrdiff_t);
-#endif /* FreeBSD etc */
-#endif /* LACKS_UNISTD_H */
-#endif /* HAVE_MMAP */
-
-#ifndef WIN32
-#ifndef malloc_getpagesize
-# ifdef _SC_PAGESIZE /* some SVR4 systems omit an underscore */
-# ifndef _SC_PAGE_SIZE
-# define _SC_PAGE_SIZE _SC_PAGESIZE
-# endif
-# endif
-# ifdef _SC_PAGE_SIZE
-# define malloc_getpagesize sysconf(_SC_PAGE_SIZE)
-# else
-# if defined(BSD) || defined(DGUX) || defined(HAVE_GETPAGESIZE)
- extern size_t getpagesize();
-# define malloc_getpagesize getpagesize()
-# else
-# ifdef WIN32 /* use supplied emulation of getpagesize */
-# define malloc_getpagesize getpagesize()
-# else
-# ifndef LACKS_SYS_PARAM_H
-# include <sys/param.h>
-# endif
-# ifdef EXEC_PAGESIZE
-# define malloc_getpagesize EXEC_PAGESIZE
-# else
-# ifdef NBPG
-# ifndef CLSIZE
-# define malloc_getpagesize NBPG
-# else
-# define malloc_getpagesize (NBPG * CLSIZE)
-# endif
-# else
-# ifdef NBPC
-# define malloc_getpagesize NBPC
-# else
-# ifdef PAGESIZE
-# define malloc_getpagesize PAGESIZE
-# else /* just guess */
-# define malloc_getpagesize ((size_t)4096U)
-# endif
-# endif
-# endif
-# endif
-# endif
-# endif
-# endif
-#endif
-#endif
-
-/* ------------------- size_t and alignment properties -------------------- */
-
-/* The byte and bit size of a size_t */
-#define SIZE_T_SIZE (sizeof(size_t))
-#define SIZE_T_BITSIZE (sizeof(size_t) << 3)
-
-/* Some constants coerced to size_t */
-/* Annoying but necessary to avoid errors on some platforms */
-#define SIZE_T_ZERO ((size_t)0)
-#define SIZE_T_ONE ((size_t)1)
-#define SIZE_T_TWO ((size_t)2)
-#define TWO_SIZE_T_SIZES (SIZE_T_SIZE<<1)
-#define FOUR_SIZE_T_SIZES (SIZE_T_SIZE<<2)
-#define SIX_SIZE_T_SIZES (FOUR_SIZE_T_SIZES+TWO_SIZE_T_SIZES)
-#define HALF_MAX_SIZE_T (MAX_SIZE_T / 2U)
-
-/* The bit mask value corresponding to MALLOC_ALIGNMENT */
-#define CHUNK_ALIGN_MASK (MALLOC_ALIGNMENT - SIZE_T_ONE)
-
-/* True if address a has acceptable alignment */
-#define is_aligned(A) (((size_t)((A)) & (CHUNK_ALIGN_MASK)) == 0)
-
-/* the number of bytes to offset an address to align it */
-#define align_offset(A)\
- ((((size_t)(A) & CHUNK_ALIGN_MASK) == 0)? 0 :\
- ((MALLOC_ALIGNMENT - ((size_t)(A) & CHUNK_ALIGN_MASK)) & CHUNK_ALIGN_MASK))
-
-/* -------------------------- MMAP preliminaries ------------------------- */
-
-/*
- If HAVE_MORECORE or HAVE_MMAP are false, we just define calls and
- checks to fail so compiler optimizer can delete code rather than
- using so many "#if"s.
-*/
-
-
-/* MORECORE and MMAP must return MFAIL on failure */
-#define MFAIL ((void*)(MAX_SIZE_T))
-#define CMFAIL ((char*)(MFAIL)) /* defined for convenience */
-
-#if !HAVE_MMAP
-#define IS_MMAPPED_BIT (SIZE_T_ZERO)
-#define USE_MMAP_BIT (SIZE_T_ZERO)
-#define CALL_MMAP(s) MFAIL
-#define CALL_MUNMAP(a, s) (-1)
-#define DIRECT_MMAP(s) MFAIL
-
-#else /* HAVE_MMAP */
-#define IS_MMAPPED_BIT (SIZE_T_ONE)
-#define USE_MMAP_BIT (SIZE_T_ONE)
-
-#if !defined(WIN32) && !defined (__OS2__)
-#define CALL_MUNMAP(a, s) munmap((a), (s))
-#define MMAP_PROT (PROT_READ|PROT_WRITE)
-#if !defined(MAP_ANONYMOUS) && defined(MAP_ANON)
-#define MAP_ANONYMOUS MAP_ANON
-#endif /* MAP_ANON */
-#ifdef MAP_ANONYMOUS
-#define MMAP_FLAGS (MAP_PRIVATE|MAP_ANONYMOUS)
-#define CALL_MMAP(s) mmap(0, (s), MMAP_PROT, MMAP_FLAGS, -1, 0)
-#else /* MAP_ANONYMOUS */
-/*
- Nearly all versions of mmap support MAP_ANONYMOUS, so the following
- is unlikely to be needed, but is supplied just in case.
-*/
-#define MMAP_FLAGS (MAP_PRIVATE)
-static int dev_zero_fd = -1; /* Cached file descriptor for /dev/zero. */
-#define CALL_MMAP(s) ((dev_zero_fd < 0) ? \
- (dev_zero_fd = open("/dev/zero", O_RDWR), \
- mmap(0, (s), MMAP_PROT, MMAP_FLAGS, dev_zero_fd, 0)) : \
- mmap(0, (s), MMAP_PROT, MMAP_FLAGS, dev_zero_fd, 0))
-#endif /* MAP_ANONYMOUS */
-
-#define DIRECT_MMAP(s) CALL_MMAP(s)
-
-#elif defined(__OS2__)
-
-/* OS/2 MMAP via DosAllocMem */
-static void* os2mmap(size_t size) {
- void* ptr;
- if (DosAllocMem(&ptr, size, OBJ_ANY|PAG_COMMIT|PAG_READ|PAG_WRITE) &&
- DosAllocMem(&ptr, size, PAG_COMMIT|PAG_READ|PAG_WRITE))
- return MFAIL;
- return ptr;
-}
-
-#define os2direct_mmap(n) os2mmap(n)
-
-/* This function supports releasing coalesed segments */
-static int os2munmap(void* ptr, size_t size) {
- while (size) {
- ULONG ulSize = size;
- ULONG ulFlags = 0;
- if (DosQueryMem(ptr, &ulSize, &ulFlags) != 0)
- return -1;
- if ((ulFlags & PAG_BASE) == 0 ||(ulFlags & PAG_COMMIT) == 0 ||
- ulSize > size)
- return -1;
- if (DosFreeMem(ptr) != 0)
- return -1;
- ptr = ( void * ) ( ( char * ) ptr + ulSize );
- size -= ulSize;
- }
- return 0;
-}
-
-#define CALL_MMAP(s) os2mmap(s)
-#define CALL_MUNMAP(a, s) os2munmap((a), (s))
-#define DIRECT_MMAP(s) os2direct_mmap(s)
-
-#else /* WIN32 */
-
-/* Win32 MMAP via VirtualAlloc */
-static void* win32mmap(size_t size) {
- void* ptr = VirtualAlloc(0, size, MEM_RESERVE|MEM_COMMIT, PAGE_EXECUTE_READWRITE);
- return (ptr != 0)? ptr: MFAIL;
-}
-
-/* For direct MMAP, use MEM_TOP_DOWN to minimize interference */
-static void* win32direct_mmap(size_t size) {
- void* ptr = VirtualAlloc(0, size, MEM_RESERVE|MEM_COMMIT|MEM_TOP_DOWN,
- PAGE_EXECUTE_READWRITE);
- return (ptr != 0)? ptr: MFAIL;
-}
-
-/* This function supports releasing coalesed segments */
-static int win32munmap(void* ptr, size_t size) {
- MEMORY_BASIC_INFORMATION minfo;
- char* cptr = ptr;
- while (size) {
- if (VirtualQuery(cptr, &minfo, sizeof(minfo)) == 0)
- return -1;
- if (minfo.BaseAddress != cptr || minfo.AllocationBase != cptr ||
- minfo.State != MEM_COMMIT || minfo.RegionSize > size)
- return -1;
- if (VirtualFree(cptr, 0, MEM_RELEASE) == 0)
- return -1;
- cptr += minfo.RegionSize;
- size -= minfo.RegionSize;
- }
- return 0;
-}
-
-#define CALL_MMAP(s) win32mmap(s)
-#define CALL_MUNMAP(a, s) win32munmap((a), (s))
-#define DIRECT_MMAP(s) win32direct_mmap(s)
-#endif /* WIN32 */
-#endif /* HAVE_MMAP */
-
-#if HAVE_MMAP && HAVE_MREMAP
-#define CALL_MREMAP(addr, osz, nsz, mv) mremap((addr), (osz), (nsz), (mv))
-#else /* HAVE_MMAP && HAVE_MREMAP */
-#define CALL_MREMAP(addr, osz, nsz, mv) MFAIL
-#endif /* HAVE_MMAP && HAVE_MREMAP */
-
-#if HAVE_MORECORE
-#define CALL_MORECORE(S) MORECORE(S)
-#else /* HAVE_MORECORE */
-#define CALL_MORECORE(S) MFAIL
-#endif /* HAVE_MORECORE */
-
-/* mstate bit set if contiguous morecore disabled or failed */
-#define USE_NONCONTIGUOUS_BIT (4U)
-
-/* segment bit set in create_mspace_with_base */
-#define EXTERN_BIT (8U)
-
-
-/* --------------------------- Lock preliminaries ------------------------ */
-
-#if USE_LOCKS
-
-/*
- When locks are defined, there are up to two global locks:
-
- * If HAVE_MORECORE, morecore_mutex protects sequences of calls to
- MORECORE. In many cases sys_alloc requires two calls, that should
- not be interleaved with calls by other threads. This does not
- protect against direct calls to MORECORE by other threads not
- using this lock, so there is still code to cope the best we can on
- interference.
-
- * magic_init_mutex ensures that mparams.magic and other
- unique mparams values are initialized only once.
-*/
-
-#if !defined(WIN32) && !defined(__OS2__)
-/* By default use posix locks */
-#include <pthread.h>
-#define MLOCK_T pthread_mutex_t
-#define INITIAL_LOCK(l) pthread_mutex_init(l, NULL)
-#define ACQUIRE_LOCK(l) pthread_mutex_lock(l)
-#define RELEASE_LOCK(l) pthread_mutex_unlock(l)
-
-#if HAVE_MORECORE
-static MLOCK_T morecore_mutex = PTHREAD_MUTEX_INITIALIZER;
-#endif /* HAVE_MORECORE */
-
-static MLOCK_T magic_init_mutex = PTHREAD_MUTEX_INITIALIZER;
-
-#elif defined(__OS2__)
-#define MLOCK_T HMTX
-#define INITIAL_LOCK(l) DosCreateMutexSem(0, l, 0, FALSE)
-#define ACQUIRE_LOCK(l) DosRequestMutexSem(*l, SEM_INDEFINITE_WAIT)
-#define RELEASE_LOCK(l) DosReleaseMutexSem(*l)
-#if HAVE_MORECORE
-static MLOCK_T morecore_mutex;
-#endif /* HAVE_MORECORE */
-static MLOCK_T magic_init_mutex;
-
-#else /* WIN32 */
-/*
- Because lock-protected regions have bounded times, and there
- are no recursive lock calls, we can use simple spinlocks.
-*/
-
-#define MLOCK_T long
-static int win32_acquire_lock (MLOCK_T *sl) {
- for (;;) {
-#ifdef InterlockedCompareExchangePointer
- if (!InterlockedCompareExchange(sl, 1, 0))
- return 0;
-#else /* Use older void* version */
- if (!InterlockedCompareExchange((void**)sl, (void*)1, (void*)0))
- return 0;
-#endif /* InterlockedCompareExchangePointer */
- Sleep (0);
- }
-}
-
-static void win32_release_lock (MLOCK_T *sl) {
- InterlockedExchange (sl, 0);
-}
-
-#define INITIAL_LOCK(l) *(l)=0
-#define ACQUIRE_LOCK(l) win32_acquire_lock(l)
-#define RELEASE_LOCK(l) win32_release_lock(l)
-#if HAVE_MORECORE
-static MLOCK_T morecore_mutex;
-#endif /* HAVE_MORECORE */
-static MLOCK_T magic_init_mutex;
-#endif /* WIN32 */
-
-#define USE_LOCK_BIT (2U)
-#else /* USE_LOCKS */
-#define USE_LOCK_BIT (0U)
-#define INITIAL_LOCK(l)
-#endif /* USE_LOCKS */
-
-#if USE_LOCKS && HAVE_MORECORE
-#define ACQUIRE_MORECORE_LOCK() ACQUIRE_LOCK(&morecore_mutex);
-#define RELEASE_MORECORE_LOCK() RELEASE_LOCK(&morecore_mutex);
-#else /* USE_LOCKS && HAVE_MORECORE */
-#define ACQUIRE_MORECORE_LOCK()
-#define RELEASE_MORECORE_LOCK()
-#endif /* USE_LOCKS && HAVE_MORECORE */
-
-#if USE_LOCKS
-#define ACQUIRE_MAGIC_INIT_LOCK() ACQUIRE_LOCK(&magic_init_mutex);
-#define RELEASE_MAGIC_INIT_LOCK() RELEASE_LOCK(&magic_init_mutex);
-#else /* USE_LOCKS */
-#define ACQUIRE_MAGIC_INIT_LOCK()
-#define RELEASE_MAGIC_INIT_LOCK()
-#endif /* USE_LOCKS */
-
-
-/* ----------------------- Chunk representations ------------------------ */
-
-/*
- (The following includes lightly edited explanations by Colin Plumb.)
-
- The malloc_chunk declaration below is misleading (but accurate and
- necessary). It declares a "view" into memory allowing access to
- necessary fields at known offsets from a given base.
-
- Chunks of memory are maintained using a `boundary tag' method as
- originally described by Knuth. (See the paper by Paul Wilson
- ftp://ftp.cs.utexas.edu/pub/garbage/allocsrv.ps for a survey of such
- techniques.) Sizes of free chunks are stored both in the front of
- each chunk and at the end. This makes consolidating fragmented
- chunks into bigger chunks fast. The head fields also hold bits
- representing whether chunks are free or in use.
-
- Here are some pictures to make it clearer. They are "exploded" to
- show that the state of a chunk can be thought of as extending from
- the high 31 bits of the head field of its header through the
- prev_foot and PINUSE_BIT bit of the following chunk header.
-
- A chunk that's in use looks like:
-
- chunk-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- | Size of previous chunk (if P = 1) |
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |P|
- | Size of this chunk 1| +-+
- mem-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- | |
- +- -+
- | |
- +- -+
- | :
- +- size - sizeof(size_t) available payload bytes -+
- : |
- chunk-> +- -+
- | |
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |1|
- | Size of next chunk (may or may not be in use) | +-+
- mem-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-
- And if it's free, it looks like this:
-
- chunk-> +- -+
- | User payload (must be in use, or we would have merged!) |
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |P|
- | Size of this chunk 0| +-+
- mem-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- | Next pointer |
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- | Prev pointer |
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- | :
- +- size - sizeof(struct chunk) unused bytes -+
- : |
- chunk-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- | Size of this chunk |
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |0|
- | Size of next chunk (must be in use, or we would have merged)| +-+
- mem-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- | :
- +- User payload -+
- : |
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- |0|
- +-+
- Note that since we always merge adjacent free chunks, the chunks
- adjacent to a free chunk must be in use.
-
- Given a pointer to a chunk (which can be derived trivially from the
- payload pointer) we can, in O(1) time, find out whether the adjacent
- chunks are free, and if so, unlink them from the lists that they
- are on and merge them with the current chunk.
-
- Chunks always begin on even word boundaries, so the mem portion
- (which is returned to the user) is also on an even word boundary, and
- thus at least double-word aligned.
-
- The P (PINUSE_BIT) bit, stored in the unused low-order bit of the
- chunk size (which is always a multiple of two words), is an in-use
- bit for the *previous* chunk. If that bit is *clear*, then the
- word before the current chunk size contains the previous chunk
- size, and can be used to find the front of the previous chunk.
- The very first chunk allocated always has this bit set, preventing
- access to non-existent (or non-owned) memory. If pinuse is set for
- any given chunk, then you CANNOT determine the size of the
- previous chunk, and might even get a memory addressing fault when
- trying to do so.
-
- The C (CINUSE_BIT) bit, stored in the unused second-lowest bit of
- the chunk size redundantly records whether the current chunk is
- inuse. This redundancy enables usage checks within free and realloc,
- and reduces indirection when freeing and consolidating chunks.
-
- Each freshly allocated chunk must have both cinuse and pinuse set.
- That is, each allocated chunk borders either a previously allocated
- and still in-use chunk, or the base of its memory arena. This is
- ensured by making all allocations from the the `lowest' part of any
- found chunk. Further, no free chunk physically borders another one,
- so each free chunk is known to be preceded and followed by either
- inuse chunks or the ends of memory.
-
- Note that the `foot' of the current chunk is actually represented
- as the prev_foot of the NEXT chunk. This makes it easier to
- deal with alignments etc but can be very confusing when trying
- to extend or adapt this code.
-
- The exceptions to all this are
-
- 1. The special chunk `top' is the top-most available chunk (i.e.,
- the one bordering the end of available memory). It is treated
- specially. Top is never included in any bin, is used only if
- no other chunk is available, and is released back to the
- system if it is very large (see M_TRIM_THRESHOLD). In effect,
- the top chunk is treated as larger (and thus less well
- fitting) than any other available chunk. The top chunk
- doesn't update its trailing size field since there is no next
- contiguous chunk that would have to index off it. However,
- space is still allocated for it (TOP_FOOT_SIZE) to enable
- separation or merging when space is extended.
-
- 3. Chunks allocated via mmap, which have the lowest-order bit
- (IS_MMAPPED_BIT) set in their prev_foot fields, and do not set
- PINUSE_BIT in their head fields. Because they are allocated
- one-by-one, each must carry its own prev_foot field, which is
- also used to hold the offset this chunk has within its mmapped
- region, which is needed to preserve alignment. Each mmapped
- chunk is trailed by the first two fields of a fake next-chunk
- for sake of usage checks.
-
-*/
-
-struct malloc_chunk {
- size_t prev_foot; /* Size of previous chunk (if free). */
- size_t head; /* Size and inuse bits. */
- struct malloc_chunk* fd; /* double links -- used only if free. */
- struct malloc_chunk* bk;
-};
-
-typedef struct malloc_chunk mchunk;
-typedef struct malloc_chunk* mchunkptr;
-typedef struct malloc_chunk* sbinptr; /* The type of bins of chunks */
-typedef size_t bindex_t; /* Described below */
-typedef unsigned int binmap_t; /* Described below */
-typedef unsigned int flag_t; /* The type of various bit flag sets */
-
-/* ------------------- Chunks sizes and alignments ----------------------- */
-
-#define MCHUNK_SIZE (sizeof(mchunk))
-
-#if FOOTERS
-#define CHUNK_OVERHEAD (TWO_SIZE_T_SIZES)
-#else /* FOOTERS */
-#define CHUNK_OVERHEAD (SIZE_T_SIZE)
-#endif /* FOOTERS */
-
-/* MMapped chunks need a second word of overhead ... */
-#define MMAP_CHUNK_OVERHEAD (TWO_SIZE_T_SIZES)
-/* ... and additional padding for fake next-chunk at foot */
-#define MMAP_FOOT_PAD (FOUR_SIZE_T_SIZES)
-
-/* The smallest size we can malloc is an aligned minimal chunk */
-#define MIN_CHUNK_SIZE\
- ((MCHUNK_SIZE + CHUNK_ALIGN_MASK) & ~CHUNK_ALIGN_MASK)
-
-/* conversion from malloc headers to user pointers, and back */
-#define chunk2mem(p) ((void*)((char*)(p) + TWO_SIZE_T_SIZES))
-#define mem2chunk(mem) ((mchunkptr)((char*)(mem) - TWO_SIZE_T_SIZES))
-/* chunk associated with aligned address A */
-#define align_as_chunk(A) (mchunkptr)((A) + align_offset(chunk2mem(A)))
-
-/* Bounds on request (not chunk) sizes. */
-#define MAX_REQUEST ((-MIN_CHUNK_SIZE) << 2)
-#define MIN_REQUEST (MIN_CHUNK_SIZE - CHUNK_OVERHEAD - SIZE_T_ONE)
-
-/* pad request bytes into a usable size */
-#define pad_request(req) \
- (((req) + CHUNK_OVERHEAD + CHUNK_ALIGN_MASK) & ~CHUNK_ALIGN_MASK)
-
-/* pad request, checking for minimum (but not maximum) */
-#define request2size(req) \
- (((req) < MIN_REQUEST)? MIN_CHUNK_SIZE : pad_request(req))
-
-
-/* ------------------ Operations on head and foot fields ----------------- */
-
-/*
- The head field of a chunk is or'ed with PINUSE_BIT when previous
- adjacent chunk in use, and or'ed with CINUSE_BIT if this chunk is in
- use. If the chunk was obtained with mmap, the prev_foot field has
- IS_MMAPPED_BIT set, otherwise holding the offset of the base of the
- mmapped region to the base of the chunk.
-*/
-
-#define PINUSE_BIT (SIZE_T_ONE)
-#define CINUSE_BIT (SIZE_T_TWO)
-#define INUSE_BITS (PINUSE_BIT|CINUSE_BIT)
-
-/* Head value for fenceposts */
-#define FENCEPOST_HEAD (INUSE_BITS|SIZE_T_SIZE)
-
-/* extraction of fields from head words */
-#define cinuse(p) ((p)->head & CINUSE_BIT)
-#define pinuse(p) ((p)->head & PINUSE_BIT)
-#define chunksize(p) ((p)->head & ~(INUSE_BITS))
-
-#define clear_pinuse(p) ((p)->head &= ~PINUSE_BIT)
-#define clear_cinuse(p) ((p)->head &= ~CINUSE_BIT)
-
-/* Treat space at ptr +/- offset as a chunk */
-#define chunk_plus_offset(p, s) ((mchunkptr)(((char*)(p)) + (s)))
-#define chunk_minus_offset(p, s) ((mchunkptr)(((char*)(p)) - (s)))
-
-/* Ptr to next or previous physical malloc_chunk. */
-#define next_chunk(p) ((mchunkptr)( ((char*)(p)) + ((p)->head & ~INUSE_BITS)))
-#define prev_chunk(p) ((mchunkptr)( ((char*)(p)) - ((p)->prev_foot) ))
-
-/* extract next chunk's pinuse bit */
-#define next_pinuse(p) ((next_chunk(p)->head) & PINUSE_BIT)
-
-/* Get/set size at footer */
-#define get_foot(p, s) (((mchunkptr)((char*)(p) + (s)))->prev_foot)
-#define set_foot(p, s) (((mchunkptr)((char*)(p) + (s)))->prev_foot = (s))
-
-/* Set size, pinuse bit, and foot */
-#define set_size_and_pinuse_of_free_chunk(p, s)\
- ((p)->head = (s|PINUSE_BIT), set_foot(p, s))
-
-/* Set size, pinuse bit, foot, and clear next pinuse */
-#define set_free_with_pinuse(p, s, n)\
- (clear_pinuse(n), set_size_and_pinuse_of_free_chunk(p, s))
-
-#define is_mmapped(p)\
- (!((p)->head & PINUSE_BIT) && ((p)->prev_foot & IS_MMAPPED_BIT))
-
-/* Get the internal overhead associated with chunk p */
-#define overhead_for(p)\
- (is_mmapped(p)? MMAP_CHUNK_OVERHEAD : CHUNK_OVERHEAD)
-
-/* Return true if malloced space is not necessarily cleared */
-#if MMAP_CLEARS
-#define calloc_must_clear(p) (!is_mmapped(p))
-#else /* MMAP_CLEARS */
-#define calloc_must_clear(p) (1)
-#endif /* MMAP_CLEARS */
-
-/* ---------------------- Overlaid data structures ----------------------- */
-
-/*
- When chunks are not in use, they are treated as nodes of either
- lists or trees.
-
- "Small" chunks are stored in circular doubly-linked lists, and look
- like this:
-
- chunk-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- | Size of previous chunk |
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- `head:' | Size of chunk, in bytes |P|
- mem-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- | Forward pointer to next chunk in list |
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- | Back pointer to previous chunk in list |
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- | Unused space (may be 0 bytes long) .
- . .
- . |
-nextchunk-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- `foot:' | Size of chunk, in bytes |
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-
- Larger chunks are kept in a form of bitwise digital trees (aka
- tries) keyed on chunksizes. Because malloc_tree_chunks are only for
- free chunks greater than 256 bytes, their size doesn't impose any
- constraints on user chunk sizes. Each node looks like:
-
- chunk-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- | Size of previous chunk |
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- `head:' | Size of chunk, in bytes |P|
- mem-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- | Forward pointer to next chunk of same size |
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- | Back pointer to previous chunk of same size |
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- | Pointer to left child (child[0]) |
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- | Pointer to right child (child[1]) |
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- | Pointer to parent |
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- | bin index of this chunk |
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- | Unused space .
- . |
-nextchunk-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- `foot:' | Size of chunk, in bytes |
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-
- Each tree holding treenodes is a tree of unique chunk sizes. Chunks
- of the same size are arranged in a circularly-linked list, with only
- the oldest chunk (the next to be used, in our FIFO ordering)
- actually in the tree. (Tree members are distinguished by a non-null
- parent pointer.) If a chunk with the same size an an existing node
- is inserted, it is linked off the existing node using pointers that
- work in the same way as fd/bk pointers of small chunks.
-
- Each tree contains a power of 2 sized range of chunk sizes (the
- smallest is 0x100 <= x < 0x180), which is is divided in half at each
- tree level, with the chunks in the smaller half of the range (0x100
- <= x < 0x140 for the top nose) in the left subtree and the larger
- half (0x140 <= x < 0x180) in the right subtree. This is, of course,
- done by inspecting individual bits.
-
- Using these rules, each node's left subtree contains all smaller
- sizes than its right subtree. However, the node at the root of each
- subtree has no particular ordering relationship to either. (The
- dividing line between the subtree sizes is based on trie relation.)
- If we remove the last chunk of a given size from the interior of the
- tree, we need to replace it with a leaf node. The tree ordering
- rules permit a node to be replaced by any leaf below it.
-
- The smallest chunk in a tree (a common operation in a best-fit
- allocator) can be found by walking a path to the leftmost leaf in
- the tree. Unlike a usual binary tree, where we follow left child
- pointers until we reach a null, here we follow the right child
- pointer any time the left one is null, until we reach a leaf with
- both child pointers null. The smallest chunk in the tree will be
- somewhere along that path.
-
- The worst case number of steps to add, find, or remove a node is
- bounded by the number of bits differentiating chunks within
- bins. Under current bin calculations, this ranges from 6 up to 21
- (for 32 bit sizes) or up to 53 (for 64 bit sizes). The typical case
- is of course much better.
-*/
-
-struct malloc_tree_chunk {
- /* The first four fields must be compatible with malloc_chunk */
- size_t prev_foot;
- size_t head;
- struct malloc_tree_chunk* fd;
- struct malloc_tree_chunk* bk;
-
- struct malloc_tree_chunk* child[2];
- struct malloc_tree_chunk* parent;
- bindex_t index;
-};
-
-typedef struct malloc_tree_chunk tchunk;
-typedef struct malloc_tree_chunk* tchunkptr;
-typedef struct malloc_tree_chunk* tbinptr; /* The type of bins of trees */
-
-/* A little helper macro for trees */
-#define leftmost_child(t) ((t)->child[0] != 0? (t)->child[0] : (t)->child[1])
-
-/* ----------------------------- Segments -------------------------------- */
-
-/*
- Each malloc space may include non-contiguous segments, held in a
- list headed by an embedded malloc_segment record representing the
- top-most space. Segments also include flags holding properties of
- the space. Large chunks that are directly allocated by mmap are not
- included in this list. They are instead independently created and
- destroyed without otherwise keeping track of them.
-
- Segment management mainly comes into play for spaces allocated by
- MMAP. Any call to MMAP might or might not return memory that is
- adjacent to an existing segment. MORECORE normally contiguously
- extends the current space, so this space is almost always adjacent,
- which is simpler and faster to deal with. (This is why MORECORE is
- used preferentially to MMAP when both are available -- see
- sys_alloc.) When allocating using MMAP, we don't use any of the
- hinting mechanisms (inconsistently) supported in various
- implementations of unix mmap, or distinguish reserving from
- committing memory. Instead, we just ask for space, and exploit
- contiguity when we get it. It is probably possible to do
- better than this on some systems, but no general scheme seems
- to be significantly better.
-
- Management entails a simpler variant of the consolidation scheme
- used for chunks to reduce fragmentation -- new adjacent memory is
- normally prepended or appended to an existing segment. However,
- there are limitations compared to chunk consolidation that mostly
- reflect the fact that segment processing is relatively infrequent
- (occurring only when getting memory from system) and that we
- don't expect to have huge numbers of segments:
-
- * Segments are not indexed, so traversal requires linear scans. (It
- would be possible to index these, but is not worth the extra
- overhead and complexity for most programs on most platforms.)
- * New segments are only appended to old ones when holding top-most
- memory; if they cannot be prepended to others, they are held in
- different segments.
-
- Except for the top-most segment of an mstate, each segment record
- is kept at the tail of its segment. Segments are added by pushing
- segment records onto the list headed by &mstate.seg for the
- containing mstate.
-
- Segment flags control allocation/merge/deallocation policies:
- * If EXTERN_BIT set, then we did not allocate this segment,
- and so should not try to deallocate or merge with others.
- (This currently holds only for the initial segment passed
- into create_mspace_with_base.)
- * If IS_MMAPPED_BIT set, the segment may be merged with
- other surrounding mmapped segments and trimmed/de-allocated
- using munmap.
- * If neither bit is set, then the segment was obtained using
- MORECORE so can be merged with surrounding MORECORE'd segments
- and deallocated/trimmed using MORECORE with negative arguments.
-*/
-
-struct malloc_segment {
- char* base; /* base address */
- size_t size; /* allocated size */
- struct malloc_segment* next; /* ptr to next segment */
-#if FFI_MMAP_EXEC_WRIT
- /* The mmap magic is supposed to store the address of the executable
- segment at the very end of the requested block. */
-
-# define mmap_exec_offset(b,s) (*(ptrdiff_t*)((b)+(s)-sizeof(ptrdiff_t)))
-
- /* We can only merge segments if their corresponding executable
- segments are at identical offsets. */
-# define check_segment_merge(S,b,s) \
- (mmap_exec_offset((b),(s)) == (S)->exec_offset)
-
-# define add_segment_exec_offset(p,S) ((char*)(p) + (S)->exec_offset)
-# define sub_segment_exec_offset(p,S) ((char*)(p) - (S)->exec_offset)
-
- /* The removal of sflags only works with HAVE_MORECORE == 0. */
-
-# define get_segment_flags(S) (IS_MMAPPED_BIT)
-# define set_segment_flags(S,v) \
- (((v) != IS_MMAPPED_BIT) ? (ABORT, (v)) : \
- (((S)->exec_offset = \
- mmap_exec_offset((S)->base, (S)->size)), \
- (mmap_exec_offset((S)->base + (S)->exec_offset, (S)->size) != \
- (S)->exec_offset) ? (ABORT, (v)) : \
- (mmap_exec_offset((S)->base, (S)->size) = 0), (v)))
-
- /* We use an offset here, instead of a pointer, because then, when
- base changes, we don't have to modify this. On architectures
- with segmented addresses, this might not work. */
- ptrdiff_t exec_offset;
-#else
-
-# define get_segment_flags(S) ((S)->sflags)
-# define set_segment_flags(S,v) ((S)->sflags = (v))
-# define check_segment_merge(S,b,s) (1)
-
- flag_t sflags; /* mmap and extern flag */
-#endif
-};
-
-#define is_mmapped_segment(S) (get_segment_flags(S) & IS_MMAPPED_BIT)
-#define is_extern_segment(S) (get_segment_flags(S) & EXTERN_BIT)
-
-typedef struct malloc_segment msegment;
-typedef struct malloc_segment* msegmentptr;
-
-/* ---------------------------- malloc_state ----------------------------- */
-
-/*
- A malloc_state holds all of the bookkeeping for a space.
- The main fields are:
-
- Top
- The topmost chunk of the currently active segment. Its size is
- cached in topsize. The actual size of topmost space is
- topsize+TOP_FOOT_SIZE, which includes space reserved for adding
- fenceposts and segment records if necessary when getting more
- space from the system. The size at which to autotrim top is
- cached from mparams in trim_check, except that it is disabled if
- an autotrim fails.
-
- Designated victim (dv)
- This is the preferred chunk for servicing small requests that
- don't have exact fits. It is normally the chunk split off most
- recently to service another small request. Its size is cached in
- dvsize. The link fields of this chunk are not maintained since it
- is not kept in a bin.
-
- SmallBins
- An array of bin headers for free chunks. These bins hold chunks
- with sizes less than MIN_LARGE_SIZE bytes. Each bin contains
- chunks of all the same size, spaced 8 bytes apart. To simplify
- use in double-linked lists, each bin header acts as a malloc_chunk
- pointing to the real first node, if it exists (else pointing to
- itself). This avoids special-casing for headers. But to avoid
- waste, we allocate only the fd/bk pointers of bins, and then use
- repositioning tricks to treat these as the fields of a chunk.
-
- TreeBins
- Treebins are pointers to the roots of trees holding a range of
- sizes. There are 2 equally spaced treebins for each power of two
- from TREE_SHIFT to TREE_SHIFT+16. The last bin holds anything
- larger.
-
- Bin maps
- There is one bit map for small bins ("smallmap") and one for
- treebins ("treemap). Each bin sets its bit when non-empty, and
- clears the bit when empty. Bit operations are then used to avoid
- bin-by-bin searching -- nearly all "search" is done without ever
- looking at bins that won't be selected. The bit maps
- conservatively use 32 bits per map word, even if on 64bit system.
- For a good description of some of the bit-based techniques used
- here, see Henry S. Warren Jr's book "Hacker's Delight" (and
- supplement at http://hackersdelight.org/). Many of these are
- intended to reduce the branchiness of paths through malloc etc, as
- well as to reduce the number of memory locations read or written.
-
- Segments
- A list of segments headed by an embedded malloc_segment record
- representing the initial space.
-
- Address check support
- The least_addr field is the least address ever obtained from
- MORECORE or MMAP. Attempted frees and reallocs of any address less
- than this are trapped (unless INSECURE is defined).
-
- Magic tag
- A cross-check field that should always hold same value as mparams.magic.
-
- Flags
- Bits recording whether to use MMAP, locks, or contiguous MORECORE
-
- Statistics
- Each space keeps track of current and maximum system memory
- obtained via MORECORE or MMAP.
-
- Locking
- If USE_LOCKS is defined, the "mutex" lock is acquired and released
- around every public call using this mspace.
-*/
-
-/* Bin types, widths and sizes */
-#define NSMALLBINS (32U)
-#define NTREEBINS (32U)
-#define SMALLBIN_SHIFT (3U)
-#define SMALLBIN_WIDTH (SIZE_T_ONE << SMALLBIN_SHIFT)
-#define TREEBIN_SHIFT (8U)
-#define MIN_LARGE_SIZE (SIZE_T_ONE << TREEBIN_SHIFT)
-#define MAX_SMALL_SIZE (MIN_LARGE_SIZE - SIZE_T_ONE)
-#define MAX_SMALL_REQUEST (MAX_SMALL_SIZE - CHUNK_ALIGN_MASK - CHUNK_OVERHEAD)
-
-struct malloc_state {
- binmap_t smallmap;
- binmap_t treemap;
- size_t dvsize;
- size_t topsize;
- char* least_addr;
- mchunkptr dv;
- mchunkptr top;
- size_t trim_check;
- size_t magic;
- mchunkptr smallbins[(NSMALLBINS+1)*2];
- tbinptr treebins[NTREEBINS];
- size_t footprint;
- size_t max_footprint;
- flag_t mflags;
-#if USE_LOCKS
- MLOCK_T mutex; /* locate lock among fields that rarely change */
-#endif /* USE_LOCKS */
- msegment seg;
-};
-
-typedef struct malloc_state* mstate;
-
-/* ------------- Global malloc_state and malloc_params ------------------- */
-
-/*
- malloc_params holds global properties, including those that can be
- dynamically set using mallopt. There is a single instance, mparams,
- initialized in init_mparams.
-*/
-
-struct malloc_params {
- size_t magic;
- size_t page_size;
- size_t granularity;
- size_t mmap_threshold;
- size_t trim_threshold;
- flag_t default_mflags;
-};
-
-static struct malloc_params mparams;
-
-/* The global malloc_state used for all non-"mspace" calls */
-static struct malloc_state _gm_;
-#define gm (&_gm_)
-#define is_global(M) ((M) == &_gm_)
-#define is_initialized(M) ((M)->top != 0)
-
-/* -------------------------- system alloc setup ------------------------- */
-
-/* Operations on mflags */
-
-#define use_lock(M) ((M)->mflags & USE_LOCK_BIT)
-#define enable_lock(M) ((M)->mflags |= USE_LOCK_BIT)
-#define disable_lock(M) ((M)->mflags &= ~USE_LOCK_BIT)
-
-#define use_mmap(M) ((M)->mflags & USE_MMAP_BIT)
-#define enable_mmap(M) ((M)->mflags |= USE_MMAP_BIT)
-#define disable_mmap(M) ((M)->mflags &= ~USE_MMAP_BIT)
-
-#define use_noncontiguous(M) ((M)->mflags & USE_NONCONTIGUOUS_BIT)
-#define disable_contiguous(M) ((M)->mflags |= USE_NONCONTIGUOUS_BIT)
-
-#define set_lock(M,L)\
- ((M)->mflags = (L)?\
- ((M)->mflags | USE_LOCK_BIT) :\
- ((M)->mflags & ~USE_LOCK_BIT))
-
-/* page-align a size */
-#define page_align(S)\
- (((S) + (mparams.page_size)) & ~(mparams.page_size - SIZE_T_ONE))
-
-/* granularity-align a size */
-#define granularity_align(S)\
- (((S) + (mparams.granularity)) & ~(mparams.granularity - SIZE_T_ONE))
-
-#define is_page_aligned(S)\
- (((size_t)(S) & (mparams.page_size - SIZE_T_ONE)) == 0)
-#define is_granularity_aligned(S)\
- (((size_t)(S) & (mparams.granularity - SIZE_T_ONE)) == 0)
-
-/* True if segment S holds address A */
-#define segment_holds(S, A)\
- ((char*)(A) >= S->base && (char*)(A) < S->base + S->size)
-
-/* Return segment holding given address */
-static msegmentptr segment_holding(mstate m, char* addr) {
- msegmentptr sp = &m->seg;
- for (;;) {
- if (addr >= sp->base && addr < sp->base + sp->size)
- return sp;
- if ((sp = sp->next) == 0)
- return 0;
- }
-}
-
-/* Return true if segment contains a segment link */
-static int has_segment_link(mstate m, msegmentptr ss) {
- msegmentptr sp = &m->seg;
- for (;;) {
- if ((char*)sp >= ss->base && (char*)sp < ss->base + ss->size)
- return 1;
- if ((sp = sp->next) == 0)
- return 0;
- }
-}
-
-#ifndef MORECORE_CANNOT_TRIM
-#define should_trim(M,s) ((s) > (M)->trim_check)
-#else /* MORECORE_CANNOT_TRIM */
-#define should_trim(M,s) (0)
-#endif /* MORECORE_CANNOT_TRIM */
-
-/*
- TOP_FOOT_SIZE is padding at the end of a segment, including space
- that may be needed to place segment records and fenceposts when new
- noncontiguous segments are added.
-*/
-#define TOP_FOOT_SIZE\
- (align_offset(chunk2mem(0))+pad_request(sizeof(struct malloc_segment))+MIN_CHUNK_SIZE)
-
-
-/* ------------------------------- Hooks -------------------------------- */
-
-/*
- PREACTION should be defined to return 0 on success, and nonzero on
- failure. If you are not using locking, you can redefine these to do
- anything you like.
-*/
-
-#if USE_LOCKS
-
-/* Ensure locks are initialized */
-#define GLOBALLY_INITIALIZE() (mparams.page_size == 0 && init_mparams())
-
-#define PREACTION(M) ((GLOBALLY_INITIALIZE() || use_lock(M))? ACQUIRE_LOCK(&(M)->mutex) : 0)
-#define POSTACTION(M) { if (use_lock(M)) RELEASE_LOCK(&(M)->mutex); }
-#else /* USE_LOCKS */
-
-#ifndef PREACTION
-#define PREACTION(M) (0)
-#endif /* PREACTION */
-
-#ifndef POSTACTION
-#define POSTACTION(M)
-#endif /* POSTACTION */
-
-#endif /* USE_LOCKS */
-
-/*
- CORRUPTION_ERROR_ACTION is triggered upon detected bad addresses.
- USAGE_ERROR_ACTION is triggered on detected bad frees and
- reallocs. The argument p is an address that might have triggered the
- fault. It is ignored by the two predefined actions, but might be
- useful in custom actions that try to help diagnose errors.
-*/
-
-#if PROCEED_ON_ERROR
-
-/* A count of the number of corruption errors causing resets */
-int malloc_corruption_error_count;
-
-/* default corruption action */
-static void reset_on_error(mstate m);
-
-#define CORRUPTION_ERROR_ACTION(m) reset_on_error(m)
-#define USAGE_ERROR_ACTION(m, p)
-
-#else /* PROCEED_ON_ERROR */
-
-#ifndef CORRUPTION_ERROR_ACTION
-#define CORRUPTION_ERROR_ACTION(m) ABORT
-#endif /* CORRUPTION_ERROR_ACTION */
-
-#ifndef USAGE_ERROR_ACTION
-#define USAGE_ERROR_ACTION(m,p) ABORT
-#endif /* USAGE_ERROR_ACTION */
-
-#endif /* PROCEED_ON_ERROR */
-
-/* -------------------------- Debugging setup ---------------------------- */
-
-#if ! DEBUG
-
-#define check_free_chunk(M,P)
-#define check_inuse_chunk(M,P)
-#define check_malloced_chunk(M,P,N)
-#define check_mmapped_chunk(M,P)
-#define check_malloc_state(M)
-#define check_top_chunk(M,P)
-
-#else /* DEBUG */
-#define check_free_chunk(M,P) do_check_free_chunk(M,P)
-#define check_inuse_chunk(M,P) do_check_inuse_chunk(M,P)
-#define check_top_chunk(M,P) do_check_top_chunk(M,P)
-#define check_malloced_chunk(M,P,N) do_check_malloced_chunk(M,P,N)
-#define check_mmapped_chunk(M,P) do_check_mmapped_chunk(M,P)
-#define check_malloc_state(M) do_check_malloc_state(M)
-
-static void do_check_any_chunk(mstate m, mchunkptr p);
-static void do_check_top_chunk(mstate m, mchunkptr p);
-static void do_check_mmapped_chunk(mstate m, mchunkptr p);
-static void do_check_inuse_chunk(mstate m, mchunkptr p);
-static void do_check_free_chunk(mstate m, mchunkptr p);
-static void do_check_malloced_chunk(mstate m, void* mem, size_t s);
-static void do_check_tree(mstate m, tchunkptr t);
-static void do_check_treebin(mstate m, bindex_t i);
-static void do_check_smallbin(mstate m, bindex_t i);
-static void do_check_malloc_state(mstate m);
-static int bin_find(mstate m, mchunkptr x);
-static size_t traverse_and_check(mstate m);
-#endif /* DEBUG */
-
-/* ---------------------------- Indexing Bins ---------------------------- */
-
-#define is_small(s) (((s) >> SMALLBIN_SHIFT) < NSMALLBINS)
-#define small_index(s) ((s) >> SMALLBIN_SHIFT)
-#define small_index2size(i) ((i) << SMALLBIN_SHIFT)
-#define MIN_SMALL_INDEX (small_index(MIN_CHUNK_SIZE))
-
-/* addressing by index. See above about smallbin repositioning */
-#define smallbin_at(M, i) ((sbinptr)((char*)&((M)->smallbins[(i)<<1])))
-#define treebin_at(M,i) (&((M)->treebins[i]))
-
-/* assign tree index for size S to variable I */
-#if defined(__GNUC__) && defined(i386)
-#define compute_tree_index(S, I)\
-{\
- size_t X = S >> TREEBIN_SHIFT;\
- if (X == 0)\
- I = 0;\
- else if (X > 0xFFFF)\
- I = NTREEBINS-1;\
- else {\
- unsigned int K;\
- __asm__("bsrl %1,%0\n\t" : "=r" (K) : "rm" (X));\
- I = (bindex_t)((K << 1) + ((S >> (K + (TREEBIN_SHIFT-1)) & 1)));\
- }\
-}
-#else /* GNUC */
-#define compute_tree_index(S, I)\
-{\
- size_t X = S >> TREEBIN_SHIFT;\
- if (X == 0)\
- I = 0;\
- else if (X > 0xFFFF)\
- I = NTREEBINS-1;\
- else {\
- unsigned int Y = (unsigned int)X;\
- unsigned int N = ((Y - 0x100) >> 16) & 8;\
- unsigned int K = (((Y <<= N) - 0x1000) >> 16) & 4;\
- N += K;\
- N += K = (((Y <<= K) - 0x4000) >> 16) & 2;\
- K = 14 - N + ((Y <<= K) >> 15);\
- I = (K << 1) + ((S >> (K + (TREEBIN_SHIFT-1)) & 1));\
- }\
-}
-#endif /* GNUC */
-
-/* Bit representing maximum resolved size in a treebin at i */
-#define bit_for_tree_index(i) \
- (i == NTREEBINS-1)? (SIZE_T_BITSIZE-1) : (((i) >> 1) + TREEBIN_SHIFT - 2)
-
-/* Shift placing maximum resolved bit in a treebin at i as sign bit */
-#define leftshift_for_tree_index(i) \
- ((i == NTREEBINS-1)? 0 : \
- ((SIZE_T_BITSIZE-SIZE_T_ONE) - (((i) >> 1) + TREEBIN_SHIFT - 2)))
-
-/* The size of the smallest chunk held in bin with index i */
-#define minsize_for_tree_index(i) \
- ((SIZE_T_ONE << (((i) >> 1) + TREEBIN_SHIFT)) | \
- (((size_t)((i) & SIZE_T_ONE)) << (((i) >> 1) + TREEBIN_SHIFT - 1)))
-
-
-/* ------------------------ Operations on bin maps ----------------------- */
-
-/* bit corresponding to given index */
-#define idx2bit(i) ((binmap_t)(1) << (i))
-
-/* Mark/Clear bits with given index */
-#define mark_smallmap(M,i) ((M)->smallmap |= idx2bit(i))
-#define clear_smallmap(M,i) ((M)->smallmap &= ~idx2bit(i))
-#define smallmap_is_marked(M,i) ((M)->smallmap & idx2bit(i))
-
-#define mark_treemap(M,i) ((M)->treemap |= idx2bit(i))
-#define clear_treemap(M,i) ((M)->treemap &= ~idx2bit(i))
-#define treemap_is_marked(M,i) ((M)->treemap & idx2bit(i))
-
-/* index corresponding to given bit */
-
-#if defined(__GNUC__) && defined(i386)
-#define compute_bit2idx(X, I)\
-{\
- unsigned int J;\
- __asm__("bsfl %1,%0\n\t" : "=r" (J) : "rm" (X));\
- I = (bindex_t)J;\
-}
-
-#else /* GNUC */
-#if USE_BUILTIN_FFS
-#define compute_bit2idx(X, I) I = ffs(X)-1
-
-#else /* USE_BUILTIN_FFS */
-#define compute_bit2idx(X, I)\
-{\
- unsigned int Y = X - 1;\
- unsigned int K = Y >> (16-4) & 16;\
- unsigned int N = K; Y >>= K;\
- N += K = Y >> (8-3) & 8; Y >>= K;\
- N += K = Y >> (4-2) & 4; Y >>= K;\
- N += K = Y >> (2-1) & 2; Y >>= K;\
- N += K = Y >> (1-0) & 1; Y >>= K;\
- I = (bindex_t)(N + Y);\
-}
-#endif /* USE_BUILTIN_FFS */
-#endif /* GNUC */
-
-/* isolate the least set bit of a bitmap */
-#define least_bit(x) ((x) & -(x))
-
-/* mask with all bits to left of least bit of x on */
-#define left_bits(x) ((x<<1) | -(x<<1))
-
-/* mask with all bits to left of or equal to least bit of x on */
-#define same_or_left_bits(x) ((x) | -(x))
-
-
-/* ----------------------- Runtime Check Support ------------------------- */
-
-/*
- For security, the main invariant is that malloc/free/etc never
- writes to a static address other than malloc_state, unless static
- malloc_state itself has been corrupted, which cannot occur via
- malloc (because of these checks). In essence this means that we
- believe all pointers, sizes, maps etc held in malloc_state, but
- check all of those linked or offsetted from other embedded data
- structures. These checks are interspersed with main code in a way
- that tends to minimize their run-time cost.
-
- When FOOTERS is defined, in addition to range checking, we also
- verify footer fields of inuse chunks, which can be used guarantee
- that the mstate controlling malloc/free is intact. This is a
- streamlined version of the approach described by William Robertson
- et al in "Run-time Detection of Heap-based Overflows" LISA'03
- http://www.usenix.org/events/lisa03/tech/robertson.html The footer
- of an inuse chunk holds the xor of its mstate and a random seed,
- that is checked upon calls to free() and realloc(). This is
- (probablistically) unguessable from outside the program, but can be
- computed by any code successfully malloc'ing any chunk, so does not
- itself provide protection against code that has already broken
- security through some other means. Unlike Robertson et al, we
- always dynamically check addresses of all offset chunks (previous,
- next, etc). This turns out to be cheaper than relying on hashes.
-*/
-
-#if !INSECURE
-/* Check if address a is at least as high as any from MORECORE or MMAP */
-#define ok_address(M, a) ((char*)(a) >= (M)->least_addr)
-/* Check if address of next chunk n is higher than base chunk p */
-#define ok_next(p, n) ((char*)(p) < (char*)(n))
-/* Check if p has its cinuse bit on */
-#define ok_cinuse(p) cinuse(p)
-/* Check if p has its pinuse bit on */
-#define ok_pinuse(p) pinuse(p)
-
-#else /* !INSECURE */
-#define ok_address(M, a) (1)
-#define ok_next(b, n) (1)
-#define ok_cinuse(p) (1)
-#define ok_pinuse(p) (1)
-#endif /* !INSECURE */
-
-#if (FOOTERS && !INSECURE)
-/* Check if (alleged) mstate m has expected magic field */
-#define ok_magic(M) ((M)->magic == mparams.magic)
-#else /* (FOOTERS && !INSECURE) */
-#define ok_magic(M) (1)
-#endif /* (FOOTERS && !INSECURE) */
-
-
-/* In gcc, use __builtin_expect to minimize impact of checks */
-#if !INSECURE
-#if defined(__GNUC__) && __GNUC__ >= 3
-#define RTCHECK(e) __builtin_expect(e, 1)
-#else /* GNUC */
-#define RTCHECK(e) (e)
-#endif /* GNUC */
-#else /* !INSECURE */
-#define RTCHECK(e) (1)
-#endif /* !INSECURE */
-
-/* macros to set up inuse chunks with or without footers */
-
-#if !FOOTERS
-
-#define mark_inuse_foot(M,p,s)
-
-/* Set cinuse bit and pinuse bit of next chunk */
-#define set_inuse(M,p,s)\
- ((p)->head = (((p)->head & PINUSE_BIT)|s|CINUSE_BIT),\
- ((mchunkptr)(((char*)(p)) + (s)))->head |= PINUSE_BIT)
-
-/* Set cinuse and pinuse of this chunk and pinuse of next chunk */
-#define set_inuse_and_pinuse(M,p,s)\
- ((p)->head = (s|PINUSE_BIT|CINUSE_BIT),\
- ((mchunkptr)(((char*)(p)) + (s)))->head |= PINUSE_BIT)
-
-/* Set size, cinuse and pinuse bit of this chunk */
-#define set_size_and_pinuse_of_inuse_chunk(M, p, s)\
- ((p)->head = (s|PINUSE_BIT|CINUSE_BIT))
-
-#else /* FOOTERS */
-
-/* Set foot of inuse chunk to be xor of mstate and seed */
-#define mark_inuse_foot(M,p,s)\
- (((mchunkptr)((char*)(p) + (s)))->prev_foot = ((size_t)(M) ^ mparams.magic))
-
-#define get_mstate_for(p)\
- ((mstate)(((mchunkptr)((char*)(p) +\
- (chunksize(p))))->prev_foot ^ mparams.magic))
-
-#define set_inuse(M,p,s)\
- ((p)->head = (((p)->head & PINUSE_BIT)|s|CINUSE_BIT),\
- (((mchunkptr)(((char*)(p)) + (s)))->head |= PINUSE_BIT), \
- mark_inuse_foot(M,p,s))
-
-#define set_inuse_and_pinuse(M,p,s)\
- ((p)->head = (s|PINUSE_BIT|CINUSE_BIT),\
- (((mchunkptr)(((char*)(p)) + (s)))->head |= PINUSE_BIT),\
- mark_inuse_foot(M,p,s))
-
-#define set_size_and_pinuse_of_inuse_chunk(M, p, s)\
- ((p)->head = (s|PINUSE_BIT|CINUSE_BIT),\
- mark_inuse_foot(M, p, s))
-
-#endif /* !FOOTERS */
-
-/* ---------------------------- setting mparams -------------------------- */
-
-/* Initialize mparams */
-static int init_mparams(void) {
- if (mparams.page_size == 0) {
- size_t s;
-
- mparams.mmap_threshold = DEFAULT_MMAP_THRESHOLD;
- mparams.trim_threshold = DEFAULT_TRIM_THRESHOLD;
-#if MORECORE_CONTIGUOUS
- mparams.default_mflags = USE_LOCK_BIT|USE_MMAP_BIT;
-#else /* MORECORE_CONTIGUOUS */
- mparams.default_mflags = USE_LOCK_BIT|USE_MMAP_BIT|USE_NONCONTIGUOUS_BIT;
-#endif /* MORECORE_CONTIGUOUS */
-
-#if (FOOTERS && !INSECURE)
- {
-#if USE_DEV_RANDOM
- int fd;
- unsigned char buf[sizeof(size_t)];
- /* Try to use /dev/urandom, else fall back on using time */
- if ((fd = open("/dev/urandom", O_RDONLY)) >= 0 &&
- read(fd, buf, sizeof(buf)) == sizeof(buf)) {
- s = *((size_t *) buf);
- close(fd);
- }
- else
-#endif /* USE_DEV_RANDOM */
- s = (size_t)(time(0) ^ (size_t)0x55555555U);
-
- s |= (size_t)8U; /* ensure nonzero */
- s &= ~(size_t)7U; /* improve chances of fault for bad values */
-
- }
-#else /* (FOOTERS && !INSECURE) */
- s = (size_t)0x58585858U;
-#endif /* (FOOTERS && !INSECURE) */
- ACQUIRE_MAGIC_INIT_LOCK();
- if (mparams.magic == 0) {
- mparams.magic = s;
- /* Set up lock for main malloc area */
- INITIAL_LOCK(&gm->mutex);
- gm->mflags = mparams.default_mflags;
- }
- RELEASE_MAGIC_INIT_LOCK();
-
-#if !defined(WIN32) && !defined(__OS2__)
- mparams.page_size = malloc_getpagesize;
- mparams.granularity = ((DEFAULT_GRANULARITY != 0)?
- DEFAULT_GRANULARITY : mparams.page_size);
-#elif defined (__OS2__)
- /* if low-memory is used, os2munmap() would break
- if it were anything other than 64k */
- mparams.page_size = 4096u;
- mparams.granularity = 65536u;
-#else /* WIN32 */
- {
- SYSTEM_INFO system_info;
- GetSystemInfo(&system_info);
- mparams.page_size = system_info.dwPageSize;
- mparams.granularity = system_info.dwAllocationGranularity;
- }
-#endif /* WIN32 */
-
- /* Sanity-check configuration:
- size_t must be unsigned and as wide as pointer type.
- ints must be at least 4 bytes.
- alignment must be at least 8.
- Alignment, min chunk size, and page size must all be powers of 2.
- */
- if ((sizeof(size_t) != sizeof(char*)) ||
- (MAX_SIZE_T < MIN_CHUNK_SIZE) ||
- (sizeof(int) < 4) ||
- (MALLOC_ALIGNMENT < (size_t)8U) ||
- ((MALLOC_ALIGNMENT & (MALLOC_ALIGNMENT-SIZE_T_ONE)) != 0) ||
- ((MCHUNK_SIZE & (MCHUNK_SIZE-SIZE_T_ONE)) != 0) ||
- ((mparams.granularity & (mparams.granularity-SIZE_T_ONE)) != 0) ||
- ((mparams.page_size & (mparams.page_size-SIZE_T_ONE)) != 0))
- ABORT;
- }
- return 0;
-}
-
-/* support for mallopt */
-static int change_mparam(int param_number, int value) {
- size_t val = (size_t)value;
- init_mparams();
- switch(param_number) {
- case M_TRIM_THRESHOLD:
- mparams.trim_threshold = val;
- return 1;
- case M_GRANULARITY:
- if (val >= mparams.page_size && ((val & (val-1)) == 0)) {
- mparams.granularity = val;
- return 1;
- }
- else
- return 0;
- case M_MMAP_THRESHOLD:
- mparams.mmap_threshold = val;
- return 1;
- default:
- return 0;
- }
-}
-
-#if DEBUG
-/* ------------------------- Debugging Support --------------------------- */
-
-/* Check properties of any chunk, whether free, inuse, mmapped etc */
-static void do_check_any_chunk(mstate m, mchunkptr p) {
- assert((is_aligned(chunk2mem(p))) || (p->head == FENCEPOST_HEAD));
- assert(ok_address(m, p));
-}
-
-/* Check properties of top chunk */
-static void do_check_top_chunk(mstate m, mchunkptr p) {
- msegmentptr sp = segment_holding(m, (char*)p);
- size_t sz = chunksize(p);
- assert(sp != 0);
- assert((is_aligned(chunk2mem(p))) || (p->head == FENCEPOST_HEAD));
- assert(ok_address(m, p));
- assert(sz == m->topsize);
- assert(sz > 0);
- assert(sz == ((sp->base + sp->size) - (char*)p) - TOP_FOOT_SIZE);
- assert(pinuse(p));
- assert(!next_pinuse(p));
-}
-
-/* Check properties of (inuse) mmapped chunks */
-static void do_check_mmapped_chunk(mstate m, mchunkptr p) {
- size_t sz = chunksize(p);
- size_t len = (sz + (p->prev_foot & ~IS_MMAPPED_BIT) + MMAP_FOOT_PAD);
- assert(is_mmapped(p));
- assert(use_mmap(m));
- assert((is_aligned(chunk2mem(p))) || (p->head == FENCEPOST_HEAD));
- assert(ok_address(m, p));
- assert(!is_small(sz));
- assert((len & (mparams.page_size-SIZE_T_ONE)) == 0);
- assert(chunk_plus_offset(p, sz)->head == FENCEPOST_HEAD);
- assert(chunk_plus_offset(p, sz+SIZE_T_SIZE)->head == 0);
-}
-
-/* Check properties of inuse chunks */
-static void do_check_inuse_chunk(mstate m, mchunkptr p) {
- do_check_any_chunk(m, p);
- assert(cinuse(p));
- assert(next_pinuse(p));
- /* If not pinuse and not mmapped, previous chunk has OK offset */
- assert(is_mmapped(p) || pinuse(p) || next_chunk(prev_chunk(p)) == p);
- if (is_mmapped(p))
- do_check_mmapped_chunk(m, p);
-}
-
-/* Check properties of free chunks */
-static void do_check_free_chunk(mstate m, mchunkptr p) {
- size_t sz = p->head & ~(PINUSE_BIT|CINUSE_BIT);
- mchunkptr next = chunk_plus_offset(p, sz);
- do_check_any_chunk(m, p);
- assert(!cinuse(p));
- assert(!next_pinuse(p));
- assert (!is_mmapped(p));
- if (p != m->dv && p != m->top) {
- if (sz >= MIN_CHUNK_SIZE) {
- assert((sz & CHUNK_ALIGN_MASK) == 0);
- assert(is_aligned(chunk2mem(p)));
- assert(next->prev_foot == sz);
- assert(pinuse(p));
- assert (next == m->top || cinuse(next));
- assert(p->fd->bk == p);
- assert(p->bk->fd == p);
- }
- else /* markers are always of size SIZE_T_SIZE */
- assert(sz == SIZE_T_SIZE);
- }
-}
-
-/* Check properties of malloced chunks at the point they are malloced */
-static void do_check_malloced_chunk(mstate m, void* mem, size_t s) {
- if (mem != 0) {
- mchunkptr p = mem2chunk(mem);
- size_t sz = p->head & ~(PINUSE_BIT|CINUSE_BIT);
- do_check_inuse_chunk(m, p);
- assert((sz & CHUNK_ALIGN_MASK) == 0);
- assert(sz >= MIN_CHUNK_SIZE);
- assert(sz >= s);
- /* unless mmapped, size is less than MIN_CHUNK_SIZE more than request */
- assert(is_mmapped(p) || sz < (s + MIN_CHUNK_SIZE));
- }
-}
-
-/* Check a tree and its subtrees. */
-static void do_check_tree(mstate m, tchunkptr t) {
- tchunkptr head = 0;
- tchunkptr u = t;
- bindex_t tindex = t->index;
- size_t tsize = chunksize(t);
- bindex_t idx;
- compute_tree_index(tsize, idx);
- assert(tindex == idx);
- assert(tsize >= MIN_LARGE_SIZE);
- assert(tsize >= minsize_for_tree_index(idx));
- assert((idx == NTREEBINS-1) || (tsize < minsize_for_tree_index((idx+1))));
-
- do { /* traverse through chain of same-sized nodes */
- do_check_any_chunk(m, ((mchunkptr)u));
- assert(u->index == tindex);
- assert(chunksize(u) == tsize);
- assert(!cinuse(u));
- assert(!next_pinuse(u));
- assert(u->fd->bk == u);
- assert(u->bk->fd == u);
- if (u->parent == 0) {
- assert(u->child[0] == 0);
- assert(u->child[1] == 0);
- }
- else {
- assert(head == 0); /* only one node on chain has parent */
- head = u;
- assert(u->parent != u);
- assert (u->parent->child[0] == u ||
- u->parent->child[1] == u ||
- *((tbinptr*)(u->parent)) == u);
- if (u->child[0] != 0) {
- assert(u->child[0]->parent == u);
- assert(u->child[0] != u);
- do_check_tree(m, u->child[0]);
- }
- if (u->child[1] != 0) {
- assert(u->child[1]->parent == u);
- assert(u->child[1] != u);
- do_check_tree(m, u->child[1]);
- }
- if (u->child[0] != 0 && u->child[1] != 0) {
- assert(chunksize(u->child[0]) < chunksize(u->child[1]));
- }
- }
- u = u->fd;
- } while (u != t);
- assert(head != 0);
-}
-
-/* Check all the chunks in a treebin. */
-static void do_check_treebin(mstate m, bindex_t i) {
- tbinptr* tb = treebin_at(m, i);
- tchunkptr t = *tb;
- int empty = (m->treemap & (1U << i)) == 0;
- if (t == 0)
- assert(empty);
- if (!empty)
- do_check_tree(m, t);
-}
-
-/* Check all the chunks in a smallbin. */
-static void do_check_smallbin(mstate m, bindex_t i) {
- sbinptr b = smallbin_at(m, i);
- mchunkptr p = b->bk;
- unsigned int empty = (m->smallmap & (1U << i)) == 0;
- if (p == b)
- assert(empty);
- if (!empty) {
- for (; p != b; p = p->bk) {
- size_t size = chunksize(p);
- mchunkptr q;
- /* each chunk claims to be free */
- do_check_free_chunk(m, p);
- /* chunk belongs in bin */
- assert(small_index(size) == i);
- assert(p->bk == b || chunksize(p->bk) == chunksize(p));
- /* chunk is followed by an inuse chunk */
- q = next_chunk(p);
- if (q->head != FENCEPOST_HEAD)
- do_check_inuse_chunk(m, q);
- }
- }
-}
-
-/* Find x in a bin. Used in other check functions. */
-static int bin_find(mstate m, mchunkptr x) {
- size_t size = chunksize(x);
- if (is_small(size)) {
- bindex_t sidx = small_index(size);
- sbinptr b = smallbin_at(m, sidx);
- if (smallmap_is_marked(m, sidx)) {
- mchunkptr p = b;
- do {
- if (p == x)
- return 1;
- } while ((p = p->fd) != b);
- }
- }
- else {
- bindex_t tidx;
- compute_tree_index(size, tidx);
- if (treemap_is_marked(m, tidx)) {
- tchunkptr t = *treebin_at(m, tidx);
- size_t sizebits = size << leftshift_for_tree_index(tidx);
- while (t != 0 && chunksize(t) != size) {
- t = t->child[(sizebits >> (SIZE_T_BITSIZE-SIZE_T_ONE)) & 1];
- sizebits <<= 1;
- }
- if (t != 0) {
- tchunkptr u = t;
- do {
- if (u == (tchunkptr)x)
- return 1;
- } while ((u = u->fd) != t);
- }
- }
- }
- return 0;
-}
-
-/* Traverse each chunk and check it; return total */
-static size_t traverse_and_check(mstate m) {
- size_t sum = 0;
- if (is_initialized(m)) {
- msegmentptr s = &m->seg;
- sum += m->topsize + TOP_FOOT_SIZE;
- while (s != 0) {
- mchunkptr q = align_as_chunk(s->base);
- mchunkptr lastq = 0;
- assert(pinuse(q));
- while (segment_holds(s, q) &&
- q != m->top && q->head != FENCEPOST_HEAD) {
- sum += chunksize(q);
- if (cinuse(q)) {
- assert(!bin_find(m, q));
- do_check_inuse_chunk(m, q);
- }
- else {
- assert(q == m->dv || bin_find(m, q));
- assert(lastq == 0 || cinuse(lastq)); /* Not 2 consecutive free */
- do_check_free_chunk(m, q);
- }
- lastq = q;
- q = next_chunk(q);
- }
- s = s->next;
- }
- }
- return sum;
-}
-
-/* Check all properties of malloc_state. */
-static void do_check_malloc_state(mstate m) {
- bindex_t i;
- size_t total;
- /* check bins */
- for (i = 0; i < NSMALLBINS; ++i)
- do_check_smallbin(m, i);
- for (i = 0; i < NTREEBINS; ++i)
- do_check_treebin(m, i);
-
- if (m->dvsize != 0) { /* check dv chunk */
- do_check_any_chunk(m, m->dv);
- assert(m->dvsize == chunksize(m->dv));
- assert(m->dvsize >= MIN_CHUNK_SIZE);
- assert(bin_find(m, m->dv) == 0);
- }
-
- if (m->top != 0) { /* check top chunk */
- do_check_top_chunk(m, m->top);
- assert(m->topsize == chunksize(m->top));
- assert(m->topsize > 0);
- assert(bin_find(m, m->top) == 0);
- }
-
- total = traverse_and_check(m);
- assert(total <= m->footprint);
- assert(m->footprint <= m->max_footprint);
-}
-#endif /* DEBUG */
-
-/* ----------------------------- statistics ------------------------------ */
-
-#if !NO_MALLINFO
-static struct mallinfo internal_mallinfo(mstate m) {
- struct mallinfo nm = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
- if (!PREACTION(m)) {
- check_malloc_state(m);
- if (is_initialized(m)) {
- size_t nfree = SIZE_T_ONE; /* top always free */
- size_t mfree = m->topsize + TOP_FOOT_SIZE;
- size_t sum = mfree;
- msegmentptr s = &m->seg;
- while (s != 0) {
- mchunkptr q = align_as_chunk(s->base);
- while (segment_holds(s, q) &&
- q != m->top && q->head != FENCEPOST_HEAD) {
- size_t sz = chunksize(q);
- sum += sz;
- if (!cinuse(q)) {
- mfree += sz;
- ++nfree;
- }
- q = next_chunk(q);
- }
- s = s->next;
- }
-
- nm.arena = sum;
- nm.ordblks = nfree;
- nm.hblkhd = m->footprint - sum;
- nm.usmblks = m->max_footprint;
- nm.uordblks = m->footprint - mfree;
- nm.fordblks = mfree;
- nm.keepcost = m->topsize;
- }
-
- POSTACTION(m);
- }
- return nm;
-}
-#endif /* !NO_MALLINFO */
-
-static void internal_malloc_stats(mstate m) {
- if (!PREACTION(m)) {
- size_t maxfp = 0;
- size_t fp = 0;
- size_t used = 0;
- check_malloc_state(m);
- if (is_initialized(m)) {
- msegmentptr s = &m->seg;
- maxfp = m->max_footprint;
- fp = m->footprint;
- used = fp - (m->topsize + TOP_FOOT_SIZE);
-
- while (s != 0) {
- mchunkptr q = align_as_chunk(s->base);
- while (segment_holds(s, q) &&
- q != m->top && q->head != FENCEPOST_HEAD) {
- if (!cinuse(q))
- used -= chunksize(q);
- q = next_chunk(q);
- }
- s = s->next;
- }
- }
-
- fprintf(stderr, "max system bytes = %10lu\n", (unsigned long)(maxfp));
- fprintf(stderr, "system bytes = %10lu\n", (unsigned long)(fp));
- fprintf(stderr, "in use bytes = %10lu\n", (unsigned long)(used));
-
- POSTACTION(m);
- }
-}
-
-/* ----------------------- Operations on smallbins ----------------------- */
-
-/*
- Various forms of linking and unlinking are defined as macros. Even
- the ones for trees, which are very long but have very short typical
- paths. This is ugly but reduces reliance on inlining support of
- compilers.
-*/
-
-/* Link a free chunk into a smallbin */
-#define insert_small_chunk(M, P, S) {\
- bindex_t I = small_index(S);\
- mchunkptr B = smallbin_at(M, I);\
- mchunkptr F = B;\
- assert(S >= MIN_CHUNK_SIZE);\
- if (!smallmap_is_marked(M, I))\
- mark_smallmap(M, I);\
- else if (RTCHECK(ok_address(M, B->fd)))\
- F = B->fd;\
- else {\
- CORRUPTION_ERROR_ACTION(M);\
- }\
- B->fd = P;\
- F->bk = P;\
- P->fd = F;\
- P->bk = B;\
-}
-
-/* Unlink a chunk from a smallbin */
-#define unlink_small_chunk(M, P, S) {\
- mchunkptr F = P->fd;\
- mchunkptr B = P->bk;\
- bindex_t I = small_index(S);\
- assert(P != B);\
- assert(P != F);\
- assert(chunksize(P) == small_index2size(I));\
- if (F == B)\
- clear_smallmap(M, I);\
- else if (RTCHECK((F == smallbin_at(M,I) || ok_address(M, F)) &&\
- (B == smallbin_at(M,I) || ok_address(M, B)))) {\
- F->bk = B;\
- B->fd = F;\
- }\
- else {\
- CORRUPTION_ERROR_ACTION(M);\
- }\
-}
-
-/* Unlink the first chunk from a smallbin */
-#define unlink_first_small_chunk(M, B, P, I) {\
- mchunkptr F = P->fd;\
- assert(P != B);\
- assert(P != F);\
- assert(chunksize(P) == small_index2size(I));\
- if (B == F)\
- clear_smallmap(M, I);\
- else if (RTCHECK(ok_address(M, F))) {\
- B->fd = F;\
- F->bk = B;\
- }\
- else {\
- CORRUPTION_ERROR_ACTION(M);\
- }\
-}
-
-/* Replace dv node, binning the old one */
-/* Used only when dvsize known to be small */
-#define replace_dv(M, P, S) {\
- size_t DVS = M->dvsize;\
- if (DVS != 0) {\
- mchunkptr DV = M->dv;\
- assert(is_small(DVS));\
- insert_small_chunk(M, DV, DVS);\
- }\
- M->dvsize = S;\
- M->dv = P;\
-}
-
-/* ------------------------- Operations on trees ------------------------- */
-
-/* Insert chunk into tree */
-#define insert_large_chunk(M, X, S) {\
- tbinptr* H;\
- bindex_t I;\
- compute_tree_index(S, I);\
- H = treebin_at(M, I);\
- X->index = I;\
- X->child[0] = X->child[1] = 0;\
- if (!treemap_is_marked(M, I)) {\
- mark_treemap(M, I);\
- *H = X;\
- X->parent = (tchunkptr)H;\
- X->fd = X->bk = X;\
- }\
- else {\
- tchunkptr T = *H;\
- size_t K = S << leftshift_for_tree_index(I);\
- for (;;) {\
- if (chunksize(T) != S) {\
- tchunkptr* C = &(T->child[(K >> (SIZE_T_BITSIZE-SIZE_T_ONE)) & 1]);\
- K <<= 1;\
- if (*C != 0)\
- T = *C;\
- else if (RTCHECK(ok_address(M, C))) {\
- *C = X;\
- X->parent = T;\
- X->fd = X->bk = X;\
- break;\
- }\
- else {\
- CORRUPTION_ERROR_ACTION(M);\
- break;\
- }\
- }\
- else {\
- tchunkptr F = T->fd;\
- if (RTCHECK(ok_address(M, T) && ok_address(M, F))) {\
- T->fd = F->bk = X;\
- X->fd = F;\
- X->bk = T;\
- X->parent = 0;\
- break;\
- }\
- else {\
- CORRUPTION_ERROR_ACTION(M);\
- break;\
- }\
- }\
- }\
- }\
-}
-
-/*
- Unlink steps:
-
- 1. If x is a chained node, unlink it from its same-sized fd/bk links
- and choose its bk node as its replacement.
- 2. If x was the last node of its size, but not a leaf node, it must
- be replaced with a leaf node (not merely one with an open left or
- right), to make sure that lefts and rights of descendants
- correspond properly to bit masks. We use the rightmost descendant
- of x. We could use any other leaf, but this is easy to locate and
- tends to counteract removal of leftmosts elsewhere, and so keeps
- paths shorter than minimally guaranteed. This doesn't loop much
- because on average a node in a tree is near the bottom.
- 3. If x is the base of a chain (i.e., has parent links) relink
- x's parent and children to x's replacement (or null if none).
-*/
-
-#define unlink_large_chunk(M, X) {\
- tchunkptr XP = X->parent;\
- tchunkptr R;\
- if (X->bk != X) {\
- tchunkptr F = X->fd;\
- R = X->bk;\
- if (RTCHECK(ok_address(M, F))) {\
- F->bk = R;\
- R->fd = F;\
- }\
- else {\
- CORRUPTION_ERROR_ACTION(M);\
- }\
- }\
- else {\
- tchunkptr* RP;\
- if (((R = *(RP = &(X->child[1]))) != 0) ||\
- ((R = *(RP = &(X->child[0]))) != 0)) {\
- tchunkptr* CP;\
- while ((*(CP = &(R->child[1])) != 0) ||\
- (*(CP = &(R->child[0])) != 0)) {\
- R = *(RP = CP);\
- }\
- if (RTCHECK(ok_address(M, RP)))\
- *RP = 0;\
- else {\
- CORRUPTION_ERROR_ACTION(M);\
- }\
- }\
- }\
- if (XP != 0) {\
- tbinptr* H = treebin_at(M, X->index);\
- if (X == *H) {\
- if ((*H = R) == 0) \
- clear_treemap(M, X->index);\
- }\
- else if (RTCHECK(ok_address(M, XP))) {\
- if (XP->child[0] == X) \
- XP->child[0] = R;\
- else \
- XP->child[1] = R;\
- }\
- else\
- CORRUPTION_ERROR_ACTION(M);\
- if (R != 0) {\
- if (RTCHECK(ok_address(M, R))) {\
- tchunkptr C0, C1;\
- R->parent = XP;\
- if ((C0 = X->child[0]) != 0) {\
- if (RTCHECK(ok_address(M, C0))) {\
- R->child[0] = C0;\
- C0->parent = R;\
- }\
- else\
- CORRUPTION_ERROR_ACTION(M);\
- }\
- if ((C1 = X->child[1]) != 0) {\
- if (RTCHECK(ok_address(M, C1))) {\
- R->child[1] = C1;\
- C1->parent = R;\
- }\
- else\
- CORRUPTION_ERROR_ACTION(M);\
- }\
- }\
- else\
- CORRUPTION_ERROR_ACTION(M);\
- }\
- }\
-}
-
-/* Relays to large vs small bin operations */
-
-#define insert_chunk(M, P, S)\
- if (is_small(S)) insert_small_chunk(M, P, S)\
- else { tchunkptr TP = (tchunkptr)(P); insert_large_chunk(M, TP, S); }
-
-#define unlink_chunk(M, P, S)\
- if (is_small(S)) unlink_small_chunk(M, P, S)\
- else { tchunkptr TP = (tchunkptr)(P); unlink_large_chunk(M, TP); }
-
-
-/* Relays to internal calls to malloc/free from realloc, memalign etc */
-
-#if ONLY_MSPACES
-#define internal_malloc(m, b) mspace_malloc(m, b)
-#define internal_free(m, mem) mspace_free(m,mem);
-#else /* ONLY_MSPACES */
-#if MSPACES
-#define internal_malloc(m, b)\
- (m == gm)? dlmalloc(b) : mspace_malloc(m, b)
-#define internal_free(m, mem)\
- if (m == gm) dlfree(mem); else mspace_free(m,mem);
-#else /* MSPACES */
-#define internal_malloc(m, b) dlmalloc(b)
-#define internal_free(m, mem) dlfree(mem)
-#endif /* MSPACES */
-#endif /* ONLY_MSPACES */
-
-/* ----------------------- Direct-mmapping chunks ----------------------- */
-
-/*
- Directly mmapped chunks are set up with an offset to the start of
- the mmapped region stored in the prev_foot field of the chunk. This
- allows reconstruction of the required argument to MUNMAP when freed,
- and also allows adjustment of the returned chunk to meet alignment
- requirements (especially in memalign). There is also enough space
- allocated to hold a fake next chunk of size SIZE_T_SIZE to maintain
- the PINUSE bit so frees can be checked.
-*/
-
-/* Malloc using mmap */
-static void* mmap_alloc(mstate m, size_t nb) {
- size_t mmsize = granularity_align(nb + SIX_SIZE_T_SIZES + CHUNK_ALIGN_MASK);
- if (mmsize > nb) { /* Check for wrap around 0 */
- char* mm = (char*)(DIRECT_MMAP(mmsize));
- if (mm != CMFAIL) {
- size_t offset = align_offset(chunk2mem(mm));
- size_t psize = mmsize - offset - MMAP_FOOT_PAD;
- mchunkptr p = (mchunkptr)(mm + offset);
- p->prev_foot = offset | IS_MMAPPED_BIT;
- (p)->head = (psize|CINUSE_BIT);
- mark_inuse_foot(m, p, psize);
- chunk_plus_offset(p, psize)->head = FENCEPOST_HEAD;
- chunk_plus_offset(p, psize+SIZE_T_SIZE)->head = 0;
-
- if (mm < m->least_addr)
- m->least_addr = mm;
- if ((m->footprint += mmsize) > m->max_footprint)
- m->max_footprint = m->footprint;
- assert(is_aligned(chunk2mem(p)));
- check_mmapped_chunk(m, p);
- return chunk2mem(p);
- }
- }
- return 0;
-}
-
-/* Realloc using mmap */
-static mchunkptr mmap_resize(mstate m, mchunkptr oldp, size_t nb) {
- size_t oldsize = chunksize(oldp);
- if (is_small(nb)) /* Can't shrink mmap regions below small size */
- return 0;
- /* Keep old chunk if big enough but not too big */
- if (oldsize >= nb + SIZE_T_SIZE &&
- (oldsize - nb) <= (mparams.granularity << 1))
- return oldp;
- else {
- size_t offset = oldp->prev_foot & ~IS_MMAPPED_BIT;
- size_t oldmmsize = oldsize + offset + MMAP_FOOT_PAD;
- size_t newmmsize = granularity_align(nb + SIX_SIZE_T_SIZES +
- CHUNK_ALIGN_MASK);
- char* cp = (char*)CALL_MREMAP((char*)oldp - offset,
- oldmmsize, newmmsize, 1);
- if (cp != CMFAIL) {
- mchunkptr newp = (mchunkptr)(cp + offset);
- size_t psize = newmmsize - offset - MMAP_FOOT_PAD;
- newp->head = (psize|CINUSE_BIT);
- mark_inuse_foot(m, newp, psize);
- chunk_plus_offset(newp, psize)->head = FENCEPOST_HEAD;
- chunk_plus_offset(newp, psize+SIZE_T_SIZE)->head = 0;
-
- if (cp < m->least_addr)
- m->least_addr = cp;
- if ((m->footprint += newmmsize - oldmmsize) > m->max_footprint)
- m->max_footprint = m->footprint;
- check_mmapped_chunk(m, newp);
- return newp;
- }
- }
- return 0;
-}
-
-/* -------------------------- mspace management -------------------------- */
-
-/* Initialize top chunk and its size */
-static void init_top(mstate m, mchunkptr p, size_t psize) {
- /* Ensure alignment */
- size_t offset = align_offset(chunk2mem(p));
- p = (mchunkptr)((char*)p + offset);
- psize -= offset;
-
- m->top = p;
- m->topsize = psize;
- p->head = psize | PINUSE_BIT;
- /* set size of fake trailing chunk holding overhead space only once */
- chunk_plus_offset(p, psize)->head = TOP_FOOT_SIZE;
- m->trim_check = mparams.trim_threshold; /* reset on each update */
-}
-
-/* Initialize bins for a new mstate that is otherwise zeroed out */
-static void init_bins(mstate m) {
- /* Establish circular links for smallbins */
- bindex_t i;
- for (i = 0; i < NSMALLBINS; ++i) {
- sbinptr bin = smallbin_at(m,i);
- bin->fd = bin->bk = bin;
- }
-}
-
-#if PROCEED_ON_ERROR
-
-/* default corruption action */
-static void reset_on_error(mstate m) {
- int i;
- ++malloc_corruption_error_count;
- /* Reinitialize fields to forget about all memory */
- m->smallbins = m->treebins = 0;
- m->dvsize = m->topsize = 0;
- m->seg.base = 0;
- m->seg.size = 0;
- m->seg.next = 0;
- m->top = m->dv = 0;
- for (i = 0; i < NTREEBINS; ++i)
- *treebin_at(m, i) = 0;
- init_bins(m);
-}
-#endif /* PROCEED_ON_ERROR */
-
-/* Allocate chunk and prepend remainder with chunk in successor base. */
-static void* prepend_alloc(mstate m, char* newbase, char* oldbase,
- size_t nb) {
- mchunkptr p = align_as_chunk(newbase);
- mchunkptr oldfirst = align_as_chunk(oldbase);
- size_t psize = (char*)oldfirst - (char*)p;
- mchunkptr q = chunk_plus_offset(p, nb);
- size_t qsize = psize - nb;
- set_size_and_pinuse_of_inuse_chunk(m, p, nb);
-
- assert((char*)oldfirst > (char*)q);
- assert(pinuse(oldfirst));
- assert(qsize >= MIN_CHUNK_SIZE);
-
- /* consolidate remainder with first chunk of old base */
- if (oldfirst == m->top) {
- size_t tsize = m->topsize += qsize;
- m->top = q;
- q->head = tsize | PINUSE_BIT;
- check_top_chunk(m, q);
- }
- else if (oldfirst == m->dv) {
- size_t dsize = m->dvsize += qsize;
- m->dv = q;
- set_size_and_pinuse_of_free_chunk(q, dsize);
- }
- else {
- if (!cinuse(oldfirst)) {
- size_t nsize = chunksize(oldfirst);
- unlink_chunk(m, oldfirst, nsize);
- oldfirst = chunk_plus_offset(oldfirst, nsize);
- qsize += nsize;
- }
- set_free_with_pinuse(q, qsize, oldfirst);
- insert_chunk(m, q, qsize);
- check_free_chunk(m, q);
- }
-
- check_malloced_chunk(m, chunk2mem(p), nb);
- return chunk2mem(p);
-}
-
-
-/* Add a segment to hold a new noncontiguous region */
-static void add_segment(mstate m, char* tbase, size_t tsize, flag_t mmapped) {
- /* Determine locations and sizes of segment, fenceposts, old top */
- char* old_top = (char*)m->top;
- msegmentptr oldsp = segment_holding(m, old_top);
- char* old_end = oldsp->base + oldsp->size;
- size_t ssize = pad_request(sizeof(struct malloc_segment));
- char* rawsp = old_end - (ssize + FOUR_SIZE_T_SIZES + CHUNK_ALIGN_MASK);
- size_t offset = align_offset(chunk2mem(rawsp));
- char* asp = rawsp + offset;
- char* csp = (asp < (old_top + MIN_CHUNK_SIZE))? old_top : asp;
- mchunkptr sp = (mchunkptr)csp;
- msegmentptr ss = (msegmentptr)(chunk2mem(sp));
- mchunkptr tnext = chunk_plus_offset(sp, ssize);
- mchunkptr p = tnext;
- int nfences = 0;
-
- /* reset top to new space */
- init_top(m, (mchunkptr)tbase, tsize - TOP_FOOT_SIZE);
-
- /* Set up segment record */
- assert(is_aligned(ss));
- set_size_and_pinuse_of_inuse_chunk(m, sp, ssize);
- *ss = m->seg; /* Push current record */
- m->seg.base = tbase;
- m->seg.size = tsize;
- (void)set_segment_flags(&m->seg, mmapped);
- m->seg.next = ss;
-
- /* Insert trailing fenceposts */
- for (;;) {
- mchunkptr nextp = chunk_plus_offset(p, SIZE_T_SIZE);
- p->head = FENCEPOST_HEAD;
- ++nfences;
- if ((char*)(&(nextp->head)) < old_end)
- p = nextp;
- else
- break;
- }
- assert(nfences >= 2);
-
- /* Insert the rest of old top into a bin as an ordinary free chunk */
- if (csp != old_top) {
- mchunkptr q = (mchunkptr)old_top;
- size_t psize = csp - old_top;
- mchunkptr tn = chunk_plus_offset(q, psize);
- set_free_with_pinuse(q, psize, tn);
- insert_chunk(m, q, psize);
- }
-
- check_top_chunk(m, m->top);
-}
-
-/* -------------------------- System allocation -------------------------- */
-
-/* Get memory from system using MORECORE or MMAP */
-static void* sys_alloc(mstate m, size_t nb) {
- char* tbase = CMFAIL;
- size_t tsize = 0;
- flag_t mmap_flag = 0;
-
- init_mparams();
-
- /* Directly map large chunks */
- if (use_mmap(m) && nb >= mparams.mmap_threshold) {
- void* mem = mmap_alloc(m, nb);
- if (mem != 0)
- return mem;
- }
-
- /*
- Try getting memory in any of three ways (in most-preferred to
- least-preferred order):
- 1. A call to MORECORE that can normally contiguously extend memory.
- (disabled if not MORECORE_CONTIGUOUS or not HAVE_MORECORE or
- or main space is mmapped or a previous contiguous call failed)
- 2. A call to MMAP new space (disabled if not HAVE_MMAP).
- Note that under the default settings, if MORECORE is unable to
- fulfill a request, and HAVE_MMAP is true, then mmap is
- used as a noncontiguous system allocator. This is a useful backup
- strategy for systems with holes in address spaces -- in this case
- sbrk cannot contiguously expand the heap, but mmap may be able to
- find space.
- 3. A call to MORECORE that cannot usually contiguously extend memory.
- (disabled if not HAVE_MORECORE)
- */
-
- if (MORECORE_CONTIGUOUS && !use_noncontiguous(m)) {
- char* br = CMFAIL;
- msegmentptr ss = (m->top == 0)? 0 : segment_holding(m, (char*)m->top);
- size_t asize = 0;
- ACQUIRE_MORECORE_LOCK();
-
- if (ss == 0) { /* First time through or recovery */
- char* base = (char*)CALL_MORECORE(0);
- if (base != CMFAIL) {
- asize = granularity_align(nb + TOP_FOOT_SIZE + SIZE_T_ONE);
- /* Adjust to end on a page boundary */
- if (!is_page_aligned(base))
- asize += (page_align((size_t)base) - (size_t)base);
- /* Can't call MORECORE if size is negative when treated as signed */
- if (asize < HALF_MAX_SIZE_T &&
- (br = (char*)(CALL_MORECORE(asize))) == base) {
- tbase = base;
- tsize = asize;
- }
- }
- }
- else {
- /* Subtract out existing available top space from MORECORE request. */
- asize = granularity_align(nb - m->topsize + TOP_FOOT_SIZE + SIZE_T_ONE);
- /* Use mem here only if it did continuously extend old space */
- if (asize < HALF_MAX_SIZE_T &&
- (br = (char*)(CALL_MORECORE(asize))) == ss->base+ss->size) {
- tbase = br;
- tsize = asize;
- }
- }
-
- if (tbase == CMFAIL) { /* Cope with partial failure */
- if (br != CMFAIL) { /* Try to use/extend the space we did get */
- if (asize < HALF_MAX_SIZE_T &&
- asize < nb + TOP_FOOT_SIZE + SIZE_T_ONE) {
- size_t esize = granularity_align(nb + TOP_FOOT_SIZE + SIZE_T_ONE - asize);
- if (esize < HALF_MAX_SIZE_T) {
- char* end = (char*)CALL_MORECORE(esize);
- if (end != CMFAIL)
- asize += esize;
- else { /* Can't use; try to release */
- (void)CALL_MORECORE(-asize);
- br = CMFAIL;
- }
- }
- }
- }
- if (br != CMFAIL) { /* Use the space we did get */
- tbase = br;
- tsize = asize;
- }
- else
- disable_contiguous(m); /* Don't try contiguous path in the future */
- }
-
- RELEASE_MORECORE_LOCK();
- }
-
- if (HAVE_MMAP && tbase == CMFAIL) { /* Try MMAP */
- size_t req = nb + TOP_FOOT_SIZE + SIZE_T_ONE;
- size_t rsize = granularity_align(req);
- if (rsize > nb) { /* Fail if wraps around zero */
- char* mp = (char*)(CALL_MMAP(rsize));
- if (mp != CMFAIL) {
- tbase = mp;
- tsize = rsize;
- mmap_flag = IS_MMAPPED_BIT;
- }
- }
- }
-
- if (HAVE_MORECORE && tbase == CMFAIL) { /* Try noncontiguous MORECORE */
- size_t asize = granularity_align(nb + TOP_FOOT_SIZE + SIZE_T_ONE);
- if (asize < HALF_MAX_SIZE_T) {
- char* br = CMFAIL;
- char* end = CMFAIL;
- ACQUIRE_MORECORE_LOCK();
- br = (char*)(CALL_MORECORE(asize));
- end = (char*)(CALL_MORECORE(0));
- RELEASE_MORECORE_LOCK();
- if (br != CMFAIL && end != CMFAIL && br < end) {
- size_t ssize = end - br;
- if (ssize > nb + TOP_FOOT_SIZE) {
- tbase = br;
- tsize = ssize;
- }
- }
- }
- }
-
- if (tbase != CMFAIL) {
-
- if ((m->footprint += tsize) > m->max_footprint)
- m->max_footprint = m->footprint;
-
- if (!is_initialized(m)) { /* first-time initialization */
- m->seg.base = m->least_addr = tbase;
- m->seg.size = tsize;
- (void)set_segment_flags(&m->seg, mmap_flag);
- m->magic = mparams.magic;
- init_bins(m);
- if (is_global(m))
- init_top(m, (mchunkptr)tbase, tsize - TOP_FOOT_SIZE);
- else {
- /* Offset top by embedded malloc_state */
- mchunkptr mn = next_chunk(mem2chunk(m));
- init_top(m, mn, (size_t)((tbase + tsize) - (char*)mn) -TOP_FOOT_SIZE);
- }
- }
-
- else {
- /* Try to merge with an existing segment */
- msegmentptr sp = &m->seg;
- while (sp != 0 && tbase != sp->base + sp->size)
- sp = sp->next;
- if (sp != 0 &&
- !is_extern_segment(sp) &&
- check_segment_merge(sp, tbase, tsize) &&
- (get_segment_flags(sp) & IS_MMAPPED_BIT) == mmap_flag &&
- segment_holds(sp, m->top)) { /* append */
- sp->size += tsize;
- init_top(m, m->top, m->topsize + tsize);
- }
- else {
- if (tbase < m->least_addr)
- m->least_addr = tbase;
- sp = &m->seg;
- while (sp != 0 && sp->base != tbase + tsize)
- sp = sp->next;
- if (sp != 0 &&
- !is_extern_segment(sp) &&
- check_segment_merge(sp, tbase, tsize) &&
- (get_segment_flags(sp) & IS_MMAPPED_BIT) == mmap_flag) {
- char* oldbase = sp->base;
- sp->base = tbase;
- sp->size += tsize;
- return prepend_alloc(m, tbase, oldbase, nb);
- }
- else
- add_segment(m, tbase, tsize, mmap_flag);
- }
- }
-
- if (nb < m->topsize) { /* Allocate from new or extended top space */
- size_t rsize = m->topsize -= nb;
- mchunkptr p = m->top;
- mchunkptr r = m->top = chunk_plus_offset(p, nb);
- r->head = rsize | PINUSE_BIT;
- set_size_and_pinuse_of_inuse_chunk(m, p, nb);
- check_top_chunk(m, m->top);
- check_malloced_chunk(m, chunk2mem(p), nb);
- return chunk2mem(p);
- }
- }
-
- MALLOC_FAILURE_ACTION;
- return 0;
-}
-
-/* ----------------------- system deallocation -------------------------- */
-
-/* Unmap and unlink any mmapped segments that don't contain used chunks */
-static size_t release_unused_segments(mstate m) {
- size_t released = 0;
- msegmentptr pred = &m->seg;
- msegmentptr sp = pred->next;
- while (sp != 0) {
- char* base = sp->base;
- size_t size = sp->size;
- msegmentptr next = sp->next;
- if (is_mmapped_segment(sp) && !is_extern_segment(sp)) {
- mchunkptr p = align_as_chunk(base);
- size_t psize = chunksize(p);
- /* Can unmap if first chunk holds entire segment and not pinned */
- if (!cinuse(p) && (char*)p + psize >= base + size - TOP_FOOT_SIZE) {
- tchunkptr tp = (tchunkptr)p;
- assert(segment_holds(sp, (char*)sp));
- if (p == m->dv) {
- m->dv = 0;
- m->dvsize = 0;
- }
- else {
- unlink_large_chunk(m, tp);
- }
- if (CALL_MUNMAP(base, size) == 0) {
- released += size;
- m->footprint -= size;
- /* unlink obsoleted record */
- sp = pred;
- sp->next = next;
- }
- else { /* back out if cannot unmap */
- insert_large_chunk(m, tp, psize);
- }
- }
- }
- pred = sp;
- sp = next;
- }
- return released;
-}
-
-static int sys_trim(mstate m, size_t pad) {
- size_t released = 0;
- if (pad < MAX_REQUEST && is_initialized(m)) {
- pad += TOP_FOOT_SIZE; /* ensure enough room for segment overhead */
-
- if (m->topsize > pad) {
- /* Shrink top space in granularity-size units, keeping at least one */
- size_t unit = mparams.granularity;
- size_t extra = ((m->topsize - pad + (unit - SIZE_T_ONE)) / unit -
- SIZE_T_ONE) * unit;
- msegmentptr sp = segment_holding(m, (char*)m->top);
-
- if (!is_extern_segment(sp)) {
- if (is_mmapped_segment(sp)) {
- if (HAVE_MMAP &&
- sp->size >= extra &&
- !has_segment_link(m, sp)) { /* can't shrink if pinned */
- size_t newsize = sp->size - extra;
- /* Prefer mremap, fall back to munmap */
- if ((CALL_MREMAP(sp->base, sp->size, newsize, 0) != MFAIL) ||
- (CALL_MUNMAP(sp->base + newsize, extra) == 0)) {
- released = extra;
- }
- }
- }
- else if (HAVE_MORECORE) {
- if (extra >= HALF_MAX_SIZE_T) /* Avoid wrapping negative */
- extra = (HALF_MAX_SIZE_T) + SIZE_T_ONE - unit;
- ACQUIRE_MORECORE_LOCK();
- {
- /* Make sure end of memory is where we last set it. */
- char* old_br = (char*)(CALL_MORECORE(0));
- if (old_br == sp->base + sp->size) {
- char* rel_br = (char*)(CALL_MORECORE(-extra));
- char* new_br = (char*)(CALL_MORECORE(0));
- if (rel_br != CMFAIL && new_br < old_br)
- released = old_br - new_br;
- }
- }
- RELEASE_MORECORE_LOCK();
- }
- }
-
- if (released != 0) {
- sp->size -= released;
- m->footprint -= released;
- init_top(m, m->top, m->topsize - released);
- check_top_chunk(m, m->top);
- }
- }
-
- /* Unmap any unused mmapped segments */
- if (HAVE_MMAP)
- released += release_unused_segments(m);
-
- /* On failure, disable autotrim to avoid repeated failed future calls */
- if (released == 0)
- m->trim_check = MAX_SIZE_T;
- }
-
- return (released != 0)? 1 : 0;
-}
-
-/* ---------------------------- malloc support --------------------------- */
-
-/* allocate a large request from the best fitting chunk in a treebin */
-static void* tmalloc_large(mstate m, size_t nb) {
- tchunkptr v = 0;
- size_t rsize = -nb; /* Unsigned negation */
- tchunkptr t;
- bindex_t idx;
- compute_tree_index(nb, idx);
-
- if ((t = *treebin_at(m, idx)) != 0) {
- /* Traverse tree for this bin looking for node with size == nb */
- size_t sizebits = nb << leftshift_for_tree_index(idx);
- tchunkptr rst = 0; /* The deepest untaken right subtree */
- for (;;) {
- tchunkptr rt;
- size_t trem = chunksize(t) - nb;
- if (trem < rsize) {
- v = t;
- if ((rsize = trem) == 0)
- break;
- }
- rt = t->child[1];
- t = t->child[(sizebits >> (SIZE_T_BITSIZE-SIZE_T_ONE)) & 1];
- if (rt != 0 && rt != t)
- rst = rt;
- if (t == 0) {
- t = rst; /* set t to least subtree holding sizes > nb */
- break;
- }
- sizebits <<= 1;
- }
- }
-
- if (t == 0 && v == 0) { /* set t to root of next non-empty treebin */
- binmap_t leftbits = left_bits(idx2bit(idx)) & m->treemap;
- if (leftbits != 0) {
- bindex_t i;
- binmap_t leastbit = least_bit(leftbits);
- compute_bit2idx(leastbit, i);
- t = *treebin_at(m, i);
- }
- }
-
- while (t != 0) { /* find smallest of tree or subtree */
- size_t trem = chunksize(t) - nb;
- if (trem < rsize) {
- rsize = trem;
- v = t;
- }
- t = leftmost_child(t);
- }
-
- /* If dv is a better fit, return 0 so malloc will use it */
- if (v != 0 && rsize < (size_t)(m->dvsize - nb)) {
- if (RTCHECK(ok_address(m, v))) { /* split */
- mchunkptr r = chunk_plus_offset(v, nb);
- assert(chunksize(v) == rsize + nb);
- if (RTCHECK(ok_next(v, r))) {
- unlink_large_chunk(m, v);
- if (rsize < MIN_CHUNK_SIZE)
- set_inuse_and_pinuse(m, v, (rsize + nb));
- else {
- set_size_and_pinuse_of_inuse_chunk(m, v, nb);
- set_size_and_pinuse_of_free_chunk(r, rsize);
- insert_chunk(m, r, rsize);
- }
- return chunk2mem(v);
- }
- }
- CORRUPTION_ERROR_ACTION(m);
- }
- return 0;
-}
-
-/* allocate a small request from the best fitting chunk in a treebin */
-static void* tmalloc_small(mstate m, size_t nb) {
- tchunkptr t, v;
- size_t rsize;
- bindex_t i;
- binmap_t leastbit = least_bit(m->treemap);
- compute_bit2idx(leastbit, i);
-
- v = t = *treebin_at(m, i);
- rsize = chunksize(t) - nb;
-
- while ((t = leftmost_child(t)) != 0) {
- size_t trem = chunksize(t) - nb;
- if (trem < rsize) {
- rsize = trem;
- v = t;
- }
- }
-
- if (RTCHECK(ok_address(m, v))) {
- mchunkptr r = chunk_plus_offset(v, nb);
- assert(chunksize(v) == rsize + nb);
- if (RTCHECK(ok_next(v, r))) {
- unlink_large_chunk(m, v);
- if (rsize < MIN_CHUNK_SIZE)
- set_inuse_and_pinuse(m, v, (rsize + nb));
- else {
- set_size_and_pinuse_of_inuse_chunk(m, v, nb);
- set_size_and_pinuse_of_free_chunk(r, rsize);
- replace_dv(m, r, rsize);
- }
- return chunk2mem(v);
- }
- }
-
- CORRUPTION_ERROR_ACTION(m);
- return 0;
-}
-
-/* --------------------------- realloc support --------------------------- */
-
-static void* internal_realloc(mstate m, void* oldmem, size_t bytes) {
- if (bytes >= MAX_REQUEST) {
- MALLOC_FAILURE_ACTION;
- return 0;
- }
- if (!PREACTION(m)) {
- mchunkptr oldp = mem2chunk(oldmem);
- size_t oldsize = chunksize(oldp);
- mchunkptr next = chunk_plus_offset(oldp, oldsize);
- mchunkptr newp = 0;
- void* extra = 0;
-
- /* Try to either shrink or extend into top. Else malloc-copy-free */
-
- if (RTCHECK(ok_address(m, oldp) && ok_cinuse(oldp) &&
- ok_next(oldp, next) && ok_pinuse(next))) {
- size_t nb = request2size(bytes);
- if (is_mmapped(oldp))
- newp = mmap_resize(m, oldp, nb);
- else if (oldsize >= nb) { /* already big enough */
- size_t rsize = oldsize - nb;
- newp = oldp;
- if (rsize >= MIN_CHUNK_SIZE) {
- mchunkptr remainder = chunk_plus_offset(newp, nb);
- set_inuse(m, newp, nb);
- set_inuse(m, remainder, rsize);
- extra = chunk2mem(remainder);
- }
- }
- else if (next == m->top && oldsize + m->topsize > nb) {
- /* Expand into top */
- size_t newsize = oldsize + m->topsize;
- size_t newtopsize = newsize - nb;
- mchunkptr newtop = chunk_plus_offset(oldp, nb);
- set_inuse(m, oldp, nb);
- newtop->head = newtopsize |PINUSE_BIT;
- m->top = newtop;
- m->topsize = newtopsize;
- newp = oldp;
- }
- }
- else {
- USAGE_ERROR_ACTION(m, oldmem);
- POSTACTION(m);
- return 0;
- }
-
- POSTACTION(m);
-
- if (newp != 0) {
- if (extra != 0) {
- internal_free(m, extra);
- }
- check_inuse_chunk(m, newp);
- return chunk2mem(newp);
- }
- else {
- void* newmem = internal_malloc(m, bytes);
- if (newmem != 0) {
- size_t oc = oldsize - overhead_for(oldp);
- memcpy(newmem, oldmem, (oc < bytes)? oc : bytes);
- internal_free(m, oldmem);
- }
- return newmem;
- }
- }
- return 0;
-}
-
-/* --------------------------- memalign support -------------------------- */
-
-static void* internal_memalign(mstate m, size_t alignment, size_t bytes) {
- if (alignment <= MALLOC_ALIGNMENT) /* Can just use malloc */
- return internal_malloc(m, bytes);
- if (alignment < MIN_CHUNK_SIZE) /* must be at least a minimum chunk size */
- alignment = MIN_CHUNK_SIZE;
- if ((alignment & (alignment-SIZE_T_ONE)) != 0) {/* Ensure a power of 2 */
- size_t a = MALLOC_ALIGNMENT << 1;
- while (a < alignment) a <<= 1;
- alignment = a;
- }
-
- if (bytes >= MAX_REQUEST - alignment) {
- if (m != 0) { /* Test isn't needed but avoids compiler warning */
- MALLOC_FAILURE_ACTION;
- }
- }
- else {
- size_t nb = request2size(bytes);
- size_t req = nb + alignment + MIN_CHUNK_SIZE - CHUNK_OVERHEAD;
- char* mem = (char*)internal_malloc(m, req);
- if (mem != 0) {
- void* leader = 0;
- void* trailer = 0;
- mchunkptr p = mem2chunk(mem);
-
- if (PREACTION(m)) return 0;
- if ((((size_t)(mem)) % alignment) != 0) { /* misaligned */
- /*
- Find an aligned spot inside chunk. Since we need to give
- back leading space in a chunk of at least MIN_CHUNK_SIZE, if
- the first calculation places us at a spot with less than
- MIN_CHUNK_SIZE leader, we can move to the next aligned spot.
- We've allocated enough total room so that this is always
- possible.
- */
- char* br = (char*)mem2chunk((size_t)(((size_t)(mem +
- alignment -
- SIZE_T_ONE)) &
- -alignment));
- char* pos = ((size_t)(br - (char*)(p)) >= MIN_CHUNK_SIZE)?
- br : br+alignment;
- mchunkptr newp = (mchunkptr)pos;
- size_t leadsize = pos - (char*)(p);
- size_t newsize = chunksize(p) - leadsize;
-
- if (is_mmapped(p)) { /* For mmapped chunks, just adjust offset */
- newp->prev_foot = p->prev_foot + leadsize;
- newp->head = (newsize|CINUSE_BIT);
- }
- else { /* Otherwise, give back leader, use the rest */
- set_inuse(m, newp, newsize);
- set_inuse(m, p, leadsize);
- leader = chunk2mem(p);
- }
- p = newp;
- }
-
- /* Give back spare room at the end */
- if (!is_mmapped(p)) {
- size_t size = chunksize(p);
- if (size > nb + MIN_CHUNK_SIZE) {
- size_t remainder_size = size - nb;
- mchunkptr remainder = chunk_plus_offset(p, nb);
- set_inuse(m, p, nb);
- set_inuse(m, remainder, remainder_size);
- trailer = chunk2mem(remainder);
- }
- }
-
- assert (chunksize(p) >= nb);
- assert((((size_t)(chunk2mem(p))) % alignment) == 0);
- check_inuse_chunk(m, p);
- POSTACTION(m);
- if (leader != 0) {
- internal_free(m, leader);
- }
- if (trailer != 0) {
- internal_free(m, trailer);
- }
- return chunk2mem(p);
- }
- }
- return 0;
-}
-
-/* ------------------------ comalloc/coalloc support --------------------- */
-
-static void** ialloc(mstate m,
- size_t n_elements,
- size_t* sizes,
- int opts,
- void* chunks[]) {
- /*
- This provides common support for independent_X routines, handling
- all of the combinations that can result.
-
- The opts arg has:
- bit 0 set if all elements are same size (using sizes[0])
- bit 1 set if elements should be zeroed
- */
-
- size_t element_size; /* chunksize of each element, if all same */
- size_t contents_size; /* total size of elements */
- size_t array_size; /* request size of pointer array */
- void* mem; /* malloced aggregate space */
- mchunkptr p; /* corresponding chunk */
- size_t remainder_size; /* remaining bytes while splitting */
- void** marray; /* either "chunks" or malloced ptr array */
- mchunkptr array_chunk; /* chunk for malloced ptr array */
- flag_t was_enabled; /* to disable mmap */
- size_t size;
- size_t i;
-
- /* compute array length, if needed */
- if (chunks != 0) {
- if (n_elements == 0)
- return chunks; /* nothing to do */
- marray = chunks;
- array_size = 0;
- }
- else {
- /* if empty req, must still return chunk representing empty array */
- if (n_elements == 0)
- return (void**)internal_malloc(m, 0);
- marray = 0;
- array_size = request2size(n_elements * (sizeof(void*)));
- }
-
- /* compute total element size */
- if (opts & 0x1) { /* all-same-size */
- element_size = request2size(*sizes);
- contents_size = n_elements * element_size;
- }
- else { /* add up all the sizes */
- element_size = 0;
- contents_size = 0;
- for (i = 0; i != n_elements; ++i)
- contents_size += request2size(sizes[i]);
- }
-
- size = contents_size + array_size;
-
- /*
- Allocate the aggregate chunk. First disable direct-mmapping so
- malloc won't use it, since we would not be able to later
- free/realloc space internal to a segregated mmap region.
- */
- was_enabled = use_mmap(m);
- disable_mmap(m);
- mem = internal_malloc(m, size - CHUNK_OVERHEAD);
- if (was_enabled)
- enable_mmap(m);
- if (mem == 0)
- return 0;
-
- if (PREACTION(m)) return 0;
- p = mem2chunk(mem);
- remainder_size = chunksize(p);
-
- assert(!is_mmapped(p));
-
- if (opts & 0x2) { /* optionally clear the elements */
- memset((size_t*)mem, 0, remainder_size - SIZE_T_SIZE - array_size);
- }
-
- /* If not provided, allocate the pointer array as final part of chunk */
- if (marray == 0) {
- size_t array_chunk_size;
- array_chunk = chunk_plus_offset(p, contents_size);
- array_chunk_size = remainder_size - contents_size;
- marray = (void**) (chunk2mem(array_chunk));
- set_size_and_pinuse_of_inuse_chunk(m, array_chunk, array_chunk_size);
- remainder_size = contents_size;
- }
-
- /* split out elements */
- for (i = 0; ; ++i) {
- marray[i] = chunk2mem(p);
- if (i != n_elements-1) {
- if (element_size != 0)
- size = element_size;
- else
- size = request2size(sizes[i]);
- remainder_size -= size;
- set_size_and_pinuse_of_inuse_chunk(m, p, size);
- p = chunk_plus_offset(p, size);
- }
- else { /* the final element absorbs any overallocation slop */
- set_size_and_pinuse_of_inuse_chunk(m, p, remainder_size);
- break;
- }
- }
-
-#if DEBUG
- if (marray != chunks) {
- /* final element must have exactly exhausted chunk */
- if (element_size != 0) {
- assert(remainder_size == element_size);
- }
- else {
- assert(remainder_size == request2size(sizes[i]));
- }
- check_inuse_chunk(m, mem2chunk(marray));
- }
- for (i = 0; i != n_elements; ++i)
- check_inuse_chunk(m, mem2chunk(marray[i]));
-
-#endif /* DEBUG */
-
- POSTACTION(m);
- return marray;
-}
-
-
-/* -------------------------- public routines ---------------------------- */
-
-#if !ONLY_MSPACES
-
-void* dlmalloc(size_t bytes) {
- /*
- Basic algorithm:
- If a small request (< 256 bytes minus per-chunk overhead):
- 1. If one exists, use a remainderless chunk in associated smallbin.
- (Remainderless means that there are too few excess bytes to
- represent as a chunk.)
- 2. If it is big enough, use the dv chunk, which is normally the
- chunk adjacent to the one used for the most recent small request.
- 3. If one exists, split the smallest available chunk in a bin,
- saving remainder in dv.
- 4. If it is big enough, use the top chunk.
- 5. If available, get memory from system and use it
- Otherwise, for a large request:
- 1. Find the smallest available binned chunk that fits, and use it
- if it is better fitting than dv chunk, splitting if necessary.
- 2. If better fitting than any binned chunk, use the dv chunk.
- 3. If it is big enough, use the top chunk.
- 4. If request size >= mmap threshold, try to directly mmap this chunk.
- 5. If available, get memory from system and use it
-
- The ugly goto's here ensure that postaction occurs along all paths.
- */
-
- if (!PREACTION(gm)) {
- void* mem;
- size_t nb;
- if (bytes <= MAX_SMALL_REQUEST) {
- bindex_t idx;
- binmap_t smallbits;
- nb = (bytes < MIN_REQUEST)? MIN_CHUNK_SIZE : pad_request(bytes);
- idx = small_index(nb);
- smallbits = gm->smallmap >> idx;
-
- if ((smallbits & 0x3U) != 0) { /* Remainderless fit to a smallbin. */
- mchunkptr b, p;
- idx += ~smallbits & 1; /* Uses next bin if idx empty */
- b = smallbin_at(gm, idx);
- p = b->fd;
- assert(chunksize(p) == small_index2size(idx));
- unlink_first_small_chunk(gm, b, p, idx);
- set_inuse_and_pinuse(gm, p, small_index2size(idx));
- mem = chunk2mem(p);
- check_malloced_chunk(gm, mem, nb);
- goto postaction;
- }
-
- else if (nb > gm->dvsize) {
- if (smallbits != 0) { /* Use chunk in next nonempty smallbin */
- mchunkptr b, p, r;
- size_t rsize;
- bindex_t i;
- binmap_t leftbits = (smallbits << idx) & left_bits(idx2bit(idx));
- binmap_t leastbit = least_bit(leftbits);
- compute_bit2idx(leastbit, i);
- b = smallbin_at(gm, i);
- p = b->fd;
- assert(chunksize(p) == small_index2size(i));
- unlink_first_small_chunk(gm, b, p, i);
- rsize = small_index2size(i) - nb;
- /* Fit here cannot be remainderless if 4byte sizes */
- if (SIZE_T_SIZE != 4 && rsize < MIN_CHUNK_SIZE)
- set_inuse_and_pinuse(gm, p, small_index2size(i));
- else {
- set_size_and_pinuse_of_inuse_chunk(gm, p, nb);
- r = chunk_plus_offset(p, nb);
- set_size_and_pinuse_of_free_chunk(r, rsize);
- replace_dv(gm, r, rsize);
- }
- mem = chunk2mem(p);
- check_malloced_chunk(gm, mem, nb);
- goto postaction;
- }
-
- else if (gm->treemap != 0 && (mem = tmalloc_small(gm, nb)) != 0) {
- check_malloced_chunk(gm, mem, nb);
- goto postaction;
- }
- }
- }
- else if (bytes >= MAX_REQUEST)
- nb = MAX_SIZE_T; /* Too big to allocate. Force failure (in sys alloc) */
- else {
- nb = pad_request(bytes);
- if (gm->treemap != 0 && (mem = tmalloc_large(gm, nb)) != 0) {
- check_malloced_chunk(gm, mem, nb);
- goto postaction;
- }
- }
-
- if (nb <= gm->dvsize) {
- size_t rsize = gm->dvsize - nb;
- mchunkptr p = gm->dv;
- if (rsize >= MIN_CHUNK_SIZE) { /* split dv */
- mchunkptr r = gm->dv = chunk_plus_offset(p, nb);
- gm->dvsize = rsize;
- set_size_and_pinuse_of_free_chunk(r, rsize);
- set_size_and_pinuse_of_inuse_chunk(gm, p, nb);
- }
- else { /* exhaust dv */
- size_t dvs = gm->dvsize;
- gm->dvsize = 0;
- gm->dv = 0;
- set_inuse_and_pinuse(gm, p, dvs);
- }
- mem = chunk2mem(p);
- check_malloced_chunk(gm, mem, nb);
- goto postaction;
- }
-
- else if (nb < gm->topsize) { /* Split top */
- size_t rsize = gm->topsize -= nb;
- mchunkptr p = gm->top;
- mchunkptr r = gm->top = chunk_plus_offset(p, nb);
- r->head = rsize | PINUSE_BIT;
- set_size_and_pinuse_of_inuse_chunk(gm, p, nb);
- mem = chunk2mem(p);
- check_top_chunk(gm, gm->top);
- check_malloced_chunk(gm, mem, nb);
- goto postaction;
- }
-
- mem = sys_alloc(gm, nb);
-
- postaction:
- POSTACTION(gm);
- return mem;
- }
-
- return 0;
-}
-
-void dlfree(void* mem) {
- /*
- Consolidate freed chunks with preceding or succeeding bordering
- free chunks, if they exist, and then place in a bin. Intermixed
- with special cases for top, dv, mmapped chunks, and usage errors.
- */
-
- if (mem != 0) {
- mchunkptr p = mem2chunk(mem);
-#if FOOTERS
- mstate fm = get_mstate_for(p);
- if (!ok_magic(fm)) {
- USAGE_ERROR_ACTION(fm, p);
- return;
- }
-#else /* FOOTERS */
-#define fm gm
-#endif /* FOOTERS */
- if (!PREACTION(fm)) {
- check_inuse_chunk(fm, p);
- if (RTCHECK(ok_address(fm, p) && ok_cinuse(p))) {
- size_t psize = chunksize(p);
- mchunkptr next = chunk_plus_offset(p, psize);
- if (!pinuse(p)) {
- size_t prevsize = p->prev_foot;
- if ((prevsize & IS_MMAPPED_BIT) != 0) {
- prevsize &= ~IS_MMAPPED_BIT;
- psize += prevsize + MMAP_FOOT_PAD;
- if (CALL_MUNMAP((char*)p - prevsize, psize) == 0)
- fm->footprint -= psize;
- goto postaction;
- }
- else {
- mchunkptr prev = chunk_minus_offset(p, prevsize);
- psize += prevsize;
- p = prev;
- if (RTCHECK(ok_address(fm, prev))) { /* consolidate backward */
- if (p != fm->dv) {
- unlink_chunk(fm, p, prevsize);
- }
- else if ((next->head & INUSE_BITS) == INUSE_BITS) {
- fm->dvsize = psize;
- set_free_with_pinuse(p, psize, next);
- goto postaction;
- }
- }
- else
- goto erroraction;
- }
- }
-
- if (RTCHECK(ok_next(p, next) && ok_pinuse(next))) {
- if (!cinuse(next)) { /* consolidate forward */
- if (next == fm->top) {
- size_t tsize = fm->topsize += psize;
- fm->top = p;
- p->head = tsize | PINUSE_BIT;
- if (p == fm->dv) {
- fm->dv = 0;
- fm->dvsize = 0;
- }
- if (should_trim(fm, tsize))
- sys_trim(fm, 0);
- goto postaction;
- }
- else if (next == fm->dv) {
- size_t dsize = fm->dvsize += psize;
- fm->dv = p;
- set_size_and_pinuse_of_free_chunk(p, dsize);
- goto postaction;
- }
- else {
- size_t nsize = chunksize(next);
- psize += nsize;
- unlink_chunk(fm, next, nsize);
- set_size_and_pinuse_of_free_chunk(p, psize);
- if (p == fm->dv) {
- fm->dvsize = psize;
- goto postaction;
- }
- }
- }
- else
- set_free_with_pinuse(p, psize, next);
- insert_chunk(fm, p, psize);
- check_free_chunk(fm, p);
- goto postaction;
- }
- }
- erroraction:
- USAGE_ERROR_ACTION(fm, p);
- postaction:
- POSTACTION(fm);
- }
- }
-#if !FOOTERS
-#undef fm
-#endif /* FOOTERS */
-}
-
-void* dlcalloc(size_t n_elements, size_t elem_size) {
- void* mem;
- size_t req = 0;
- if (n_elements != 0) {
- req = n_elements * elem_size;
- if (((n_elements | elem_size) & ~(size_t)0xffff) &&
- (req / n_elements != elem_size))
- req = MAX_SIZE_T; /* force downstream failure on overflow */
- }
- mem = dlmalloc(req);
- if (mem != 0 && calloc_must_clear(mem2chunk(mem)))
- memset(mem, 0, req);
- return mem;
-}
-
-void* dlrealloc(void* oldmem, size_t bytes) {
- if (oldmem == 0)
- return dlmalloc(bytes);
-#ifdef REALLOC_ZERO_BYTES_FREES
- if (bytes == 0) {
- dlfree(oldmem);
- return 0;
- }
-#endif /* REALLOC_ZERO_BYTES_FREES */
- else {
-#if ! FOOTERS
- mstate m = gm;
-#else /* FOOTERS */
- mstate m = get_mstate_for(mem2chunk(oldmem));
- if (!ok_magic(m)) {
- USAGE_ERROR_ACTION(m, oldmem);
- return 0;
- }
-#endif /* FOOTERS */
- return internal_realloc(m, oldmem, bytes);
- }
-}
-
-void* dlmemalign(size_t alignment, size_t bytes) {
- return internal_memalign(gm, alignment, bytes);
-}
-
-void** dlindependent_calloc(size_t n_elements, size_t elem_size,
- void* chunks[]) {
- size_t sz = elem_size; /* serves as 1-element array */
- return ialloc(gm, n_elements, &sz, 3, chunks);
-}
-
-void** dlindependent_comalloc(size_t n_elements, size_t sizes[],
- void* chunks[]) {
- return ialloc(gm, n_elements, sizes, 0, chunks);
-}
-
-void* dlvalloc(size_t bytes) {
- size_t pagesz;
- init_mparams();
- pagesz = mparams.page_size;
- return dlmemalign(pagesz, bytes);
-}
-
-void* dlpvalloc(size_t bytes) {
- size_t pagesz;
- init_mparams();
- pagesz = mparams.page_size;
- return dlmemalign(pagesz, (bytes + pagesz - SIZE_T_ONE) & ~(pagesz - SIZE_T_ONE));
-}
-
-int dlmalloc_trim(size_t pad) {
- int result = 0;
- if (!PREACTION(gm)) {
- result = sys_trim(gm, pad);
- POSTACTION(gm);
- }
- return result;
-}
-
-size_t dlmalloc_footprint(void) {
- return gm->footprint;
-}
-
-size_t dlmalloc_max_footprint(void) {
- return gm->max_footprint;
-}
-
-#if !NO_MALLINFO
-struct mallinfo dlmallinfo(void) {
- return internal_mallinfo(gm);
-}
-#endif /* NO_MALLINFO */
-
-void dlmalloc_stats() {
- internal_malloc_stats(gm);
-}
-
-size_t dlmalloc_usable_size(void* mem) {
- if (mem != 0) {
- mchunkptr p = mem2chunk(mem);
- if (cinuse(p))
- return chunksize(p) - overhead_for(p);
- }
- return 0;
-}
-
-int dlmallopt(int param_number, int value) {
- return change_mparam(param_number, value);
-}
-
-#endif /* !ONLY_MSPACES */
-
-/* ----------------------------- user mspaces ---------------------------- */
-
-#if MSPACES
-
-static mstate init_user_mstate(char* tbase, size_t tsize) {
- size_t msize = pad_request(sizeof(struct malloc_state));
- mchunkptr mn;
- mchunkptr msp = align_as_chunk(tbase);
- mstate m = (mstate)(chunk2mem(msp));
- memset(m, 0, msize);
- INITIAL_LOCK(&m->mutex);
- msp->head = (msize|PINUSE_BIT|CINUSE_BIT);
- m->seg.base = m->least_addr = tbase;
- m->seg.size = m->footprint = m->max_footprint = tsize;
- m->magic = mparams.magic;
- m->mflags = mparams.default_mflags;
- disable_contiguous(m);
- init_bins(m);
- mn = next_chunk(mem2chunk(m));
- init_top(m, mn, (size_t)((tbase + tsize) - (char*)mn) - TOP_FOOT_SIZE);
- check_top_chunk(m, m->top);
- return m;
-}
-
-mspace create_mspace(size_t capacity, int locked) {
- mstate m = 0;
- size_t msize = pad_request(sizeof(struct malloc_state));
- init_mparams(); /* Ensure pagesize etc initialized */
-
- if (capacity < (size_t) -(msize + TOP_FOOT_SIZE + mparams.page_size)) {
- size_t rs = ((capacity == 0)? mparams.granularity :
- (capacity + TOP_FOOT_SIZE + msize));
- size_t tsize = granularity_align(rs);
- char* tbase = (char*)(CALL_MMAP(tsize));
- if (tbase != CMFAIL) {
- m = init_user_mstate(tbase, tsize);
- (void)set_segment_flags(&m->seg, IS_MMAPPED_BIT);
- set_lock(m, locked);
- }
- }
- return (mspace)m;
-}
-
-mspace create_mspace_with_base(void* base, size_t capacity, int locked) {
- mstate m = 0;
- size_t msize = pad_request(sizeof(struct malloc_state));
- init_mparams(); /* Ensure pagesize etc initialized */
-
- if (capacity > msize + TOP_FOOT_SIZE &&
- capacity < (size_t) -(msize + TOP_FOOT_SIZE + mparams.page_size)) {
- m = init_user_mstate((char*)base, capacity);
- (void)set_segment_flags(&m->seg, EXTERN_BIT);
- set_lock(m, locked);
- }
- return (mspace)m;
-}
-
-size_t destroy_mspace(mspace msp) {
- size_t freed = 0;
- mstate ms = (mstate)msp;
- if (ok_magic(ms)) {
- msegmentptr sp = &ms->seg;
- while (sp != 0) {
- char* base = sp->base;
- size_t size = sp->size;
- flag_t flag = get_segment_flags(sp);
- sp = sp->next;
- if ((flag & IS_MMAPPED_BIT) && !(flag & EXTERN_BIT) &&
- CALL_MUNMAP(base, size) == 0)
- freed += size;
- }
- }
- else {
- USAGE_ERROR_ACTION(ms,ms);
- }
- return freed;
-}
-
-/*
- mspace versions of routines are near-clones of the global
- versions. This is not so nice but better than the alternatives.
-*/
-
-
-void* mspace_malloc(mspace msp, size_t bytes) {
- mstate ms = (mstate)msp;
- if (!ok_magic(ms)) {
- USAGE_ERROR_ACTION(ms,ms);
- return 0;
- }
- if (!PREACTION(ms)) {
- void* mem;
- size_t nb;
- if (bytes <= MAX_SMALL_REQUEST) {
- bindex_t idx;
- binmap_t smallbits;
- nb = (bytes < MIN_REQUEST)? MIN_CHUNK_SIZE : pad_request(bytes);
- idx = small_index(nb);
- smallbits = ms->smallmap >> idx;
-
- if ((smallbits & 0x3U) != 0) { /* Remainderless fit to a smallbin. */
- mchunkptr b, p;
- idx += ~smallbits & 1; /* Uses next bin if idx empty */
- b = smallbin_at(ms, idx);
- p = b->fd;
- assert(chunksize(p) == small_index2size(idx));
- unlink_first_small_chunk(ms, b, p, idx);
- set_inuse_and_pinuse(ms, p, small_index2size(idx));
- mem = chunk2mem(p);
- check_malloced_chunk(ms, mem, nb);
- goto postaction;
- }
-
- else if (nb > ms->dvsize) {
- if (smallbits != 0) { /* Use chunk in next nonempty smallbin */
- mchunkptr b, p, r;
- size_t rsize;
- bindex_t i;
- binmap_t leftbits = (smallbits << idx) & left_bits(idx2bit(idx));
- binmap_t leastbit = least_bit(leftbits);
- compute_bit2idx(leastbit, i);
- b = smallbin_at(ms, i);
- p = b->fd;
- assert(chunksize(p) == small_index2size(i));
- unlink_first_small_chunk(ms, b, p, i);
- rsize = small_index2size(i) - nb;
- /* Fit here cannot be remainderless if 4byte sizes */
- if (SIZE_T_SIZE != 4 && rsize < MIN_CHUNK_SIZE)
- set_inuse_and_pinuse(ms, p, small_index2size(i));
- else {
- set_size_and_pinuse_of_inuse_chunk(ms, p, nb);
- r = chunk_plus_offset(p, nb);
- set_size_and_pinuse_of_free_chunk(r, rsize);
- replace_dv(ms, r, rsize);
- }
- mem = chunk2mem(p);
- check_malloced_chunk(ms, mem, nb);
- goto postaction;
- }
-
- else if (ms->treemap != 0 && (mem = tmalloc_small(ms, nb)) != 0) {
- check_malloced_chunk(ms, mem, nb);
- goto postaction;
- }
- }
- }
- else if (bytes >= MAX_REQUEST)
- nb = MAX_SIZE_T; /* Too big to allocate. Force failure (in sys alloc) */
- else {
- nb = pad_request(bytes);
- if (ms->treemap != 0 && (mem = tmalloc_large(ms, nb)) != 0) {
- check_malloced_chunk(ms, mem, nb);
- goto postaction;
- }
- }
-
- if (nb <= ms->dvsize) {
- size_t rsize = ms->dvsize - nb;
- mchunkptr p = ms->dv;
- if (rsize >= MIN_CHUNK_SIZE) { /* split dv */
- mchunkptr r = ms->dv = chunk_plus_offset(p, nb);
- ms->dvsize = rsize;
- set_size_and_pinuse_of_free_chunk(r, rsize);
- set_size_and_pinuse_of_inuse_chunk(ms, p, nb);
- }
- else { /* exhaust dv */
- size_t dvs = ms->dvsize;
- ms->dvsize = 0;
- ms->dv = 0;
- set_inuse_and_pinuse(ms, p, dvs);
- }
- mem = chunk2mem(p);
- check_malloced_chunk(ms, mem, nb);
- goto postaction;
- }
-
- else if (nb < ms->topsize) { /* Split top */
- size_t rsize = ms->topsize -= nb;
- mchunkptr p = ms->top;
- mchunkptr r = ms->top = chunk_plus_offset(p, nb);
- r->head = rsize | PINUSE_BIT;
- set_size_and_pinuse_of_inuse_chunk(ms, p, nb);
- mem = chunk2mem(p);
- check_top_chunk(ms, ms->top);
- check_malloced_chunk(ms, mem, nb);
- goto postaction;
- }
-
- mem = sys_alloc(ms, nb);
-
- postaction:
- POSTACTION(ms);
- return mem;
- }
-
- return 0;
-}
-
-void mspace_free(mspace msp, void* mem) {
- if (mem != 0) {
- mchunkptr p = mem2chunk(mem);
-#if FOOTERS
- mstate fm = get_mstate_for(p);
-#else /* FOOTERS */
- mstate fm = (mstate)msp;
-#endif /* FOOTERS */
- if (!ok_magic(fm)) {
- USAGE_ERROR_ACTION(fm, p);
- return;
- }
- if (!PREACTION(fm)) {
- check_inuse_chunk(fm, p);
- if (RTCHECK(ok_address(fm, p) && ok_cinuse(p))) {
- size_t psize = chunksize(p);
- mchunkptr next = chunk_plus_offset(p, psize);
- if (!pinuse(p)) {
- size_t prevsize = p->prev_foot;
- if ((prevsize & IS_MMAPPED_BIT) != 0) {
- prevsize &= ~IS_MMAPPED_BIT;
- psize += prevsize + MMAP_FOOT_PAD;
- if (CALL_MUNMAP((char*)p - prevsize, psize) == 0)
- fm->footprint -= psize;
- goto postaction;
- }
- else {
- mchunkptr prev = chunk_minus_offset(p, prevsize);
- psize += prevsize;
- p = prev;
- if (RTCHECK(ok_address(fm, prev))) { /* consolidate backward */
- if (p != fm->dv) {
- unlink_chunk(fm, p, prevsize);
- }
- else if ((next->head & INUSE_BITS) == INUSE_BITS) {
- fm->dvsize = psize;
- set_free_with_pinuse(p, psize, next);
- goto postaction;
- }
- }
- else
- goto erroraction;
- }
- }
-
- if (RTCHECK(ok_next(p, next) && ok_pinuse(next))) {
- if (!cinuse(next)) { /* consolidate forward */
- if (next == fm->top) {
- size_t tsize = fm->topsize += psize;
- fm->top = p;
- p->head = tsize | PINUSE_BIT;
- if (p == fm->dv) {
- fm->dv = 0;
- fm->dvsize = 0;
- }
- if (should_trim(fm, tsize))
- sys_trim(fm, 0);
- goto postaction;
- }
- else if (next == fm->dv) {
- size_t dsize = fm->dvsize += psize;
- fm->dv = p;
- set_size_and_pinuse_of_free_chunk(p, dsize);
- goto postaction;
- }
- else {
- size_t nsize = chunksize(next);
- psize += nsize;
- unlink_chunk(fm, next, nsize);
- set_size_and_pinuse_of_free_chunk(p, psize);
- if (p == fm->dv) {
- fm->dvsize = psize;
- goto postaction;
- }
- }
- }
- else
- set_free_with_pinuse(p, psize, next);
- insert_chunk(fm, p, psize);
- check_free_chunk(fm, p);
- goto postaction;
- }
- }
- erroraction:
- USAGE_ERROR_ACTION(fm, p);
- postaction:
- POSTACTION(fm);
- }
- }
-}
-
-void* mspace_calloc(mspace msp, size_t n_elements, size_t elem_size) {
- void* mem;
- size_t req = 0;
- mstate ms = (mstate)msp;
- if (!ok_magic(ms)) {
- USAGE_ERROR_ACTION(ms,ms);
- return 0;
- }
- if (n_elements != 0) {
- req = n_elements * elem_size;
- if (((n_elements | elem_size) & ~(size_t)0xffff) &&
- (req / n_elements != elem_size))
- req = MAX_SIZE_T; /* force downstream failure on overflow */
- }
- mem = internal_malloc(ms, req);
- if (mem != 0 && calloc_must_clear(mem2chunk(mem)))
- memset(mem, 0, req);
- return mem;
-}
-
-void* mspace_realloc(mspace msp, void* oldmem, size_t bytes) {
- if (oldmem == 0)
- return mspace_malloc(msp, bytes);
-#ifdef REALLOC_ZERO_BYTES_FREES
- if (bytes == 0) {
- mspace_free(msp, oldmem);
- return 0;
- }
-#endif /* REALLOC_ZERO_BYTES_FREES */
- else {
-#if FOOTERS
- mchunkptr p = mem2chunk(oldmem);
- mstate ms = get_mstate_for(p);
-#else /* FOOTERS */
- mstate ms = (mstate)msp;
-#endif /* FOOTERS */
- if (!ok_magic(ms)) {
- USAGE_ERROR_ACTION(ms,ms);
- return 0;
- }
- return internal_realloc(ms, oldmem, bytes);
- }
-}
-
-void* mspace_memalign(mspace msp, size_t alignment, size_t bytes) {
- mstate ms = (mstate)msp;
- if (!ok_magic(ms)) {
- USAGE_ERROR_ACTION(ms,ms);
- return 0;
- }
- return internal_memalign(ms, alignment, bytes);
-}
-
-void** mspace_independent_calloc(mspace msp, size_t n_elements,
- size_t elem_size, void* chunks[]) {
- size_t sz = elem_size; /* serves as 1-element array */
- mstate ms = (mstate)msp;
- if (!ok_magic(ms)) {
- USAGE_ERROR_ACTION(ms,ms);
- return 0;
- }
- return ialloc(ms, n_elements, &sz, 3, chunks);
-}
-
-void** mspace_independent_comalloc(mspace msp, size_t n_elements,
- size_t sizes[], void* chunks[]) {
- mstate ms = (mstate)msp;
- if (!ok_magic(ms)) {
- USAGE_ERROR_ACTION(ms,ms);
- return 0;
- }
- return ialloc(ms, n_elements, sizes, 0, chunks);
-}
-
-int mspace_trim(mspace msp, size_t pad) {
- int result = 0;
- mstate ms = (mstate)msp;
- if (ok_magic(ms)) {
- if (!PREACTION(ms)) {
- result = sys_trim(ms, pad);
- POSTACTION(ms);
- }
- }
- else {
- USAGE_ERROR_ACTION(ms,ms);
- }
- return result;
-}
-
-void mspace_malloc_stats(mspace msp) {
- mstate ms = (mstate)msp;
- if (ok_magic(ms)) {
- internal_malloc_stats(ms);
- }
- else {
- USAGE_ERROR_ACTION(ms,ms);
- }
-}
-
-size_t mspace_footprint(mspace msp) {
- size_t result;
- mstate ms = (mstate)msp;
- if (ok_magic(ms)) {
- result = ms->footprint;
- }
- USAGE_ERROR_ACTION(ms,ms);
- return result;
-}
-
-
-size_t mspace_max_footprint(mspace msp) {
- size_t result;
- mstate ms = (mstate)msp;
- if (ok_magic(ms)) {
- result = ms->max_footprint;
- }
- USAGE_ERROR_ACTION(ms,ms);
- return result;
-}
-
-
-#if !NO_MALLINFO
-struct mallinfo mspace_mallinfo(mspace msp) {
- mstate ms = (mstate)msp;
- if (!ok_magic(ms)) {
- USAGE_ERROR_ACTION(ms,ms);
- }
- return internal_mallinfo(ms);
-}
-#endif /* NO_MALLINFO */
-
-int mspace_mallopt(int param_number, int value) {
- return change_mparam(param_number, value);
-}
-
-#endif /* MSPACES */
-
-/* -------------------- Alternative MORECORE functions ------------------- */
-
-/*
- Guidelines for creating a custom version of MORECORE:
-
- * For best performance, MORECORE should allocate in multiples of pagesize.
- * MORECORE may allocate more memory than requested. (Or even less,
- but this will usually result in a malloc failure.)
- * MORECORE must not allocate memory when given argument zero, but
- instead return one past the end address of memory from previous
- nonzero call.
- * For best performance, consecutive calls to MORECORE with positive
- arguments should return increasing addresses, indicating that
- space has been contiguously extended.
- * Even though consecutive calls to MORECORE need not return contiguous
- addresses, it must be OK for malloc'ed chunks to span multiple
- regions in those cases where they do happen to be contiguous.
- * MORECORE need not handle negative arguments -- it may instead
- just return MFAIL when given negative arguments.
- Negative arguments are always multiples of pagesize. MORECORE
- must not misinterpret negative args as large positive unsigned
- args. You can suppress all such calls from even occurring by defining
- MORECORE_CANNOT_TRIM,
-
- As an example alternative MORECORE, here is a custom allocator
- kindly contributed for pre-OSX macOS. It uses virtually but not
- necessarily physically contiguous non-paged memory (locked in,
- present and won't get swapped out). You can use it by uncommenting
- this section, adding some #includes, and setting up the appropriate
- defines above:
-
- #define MORECORE osMoreCore
-
- There is also a shutdown routine that should somehow be called for
- cleanup upon program exit.
-
- #define MAX_POOL_ENTRIES 100
- #define MINIMUM_MORECORE_SIZE (64 * 1024U)
- static int next_os_pool;
- void *our_os_pools[MAX_POOL_ENTRIES];
-
- void *osMoreCore(int size)
- {
- void *ptr = 0;
- static void *sbrk_top = 0;
-
- if (size > 0)
- {
- if (size < MINIMUM_MORECORE_SIZE)
- size = MINIMUM_MORECORE_SIZE;
- if (CurrentExecutionLevel() == kTaskLevel)
- ptr = PoolAllocateResident(size + RM_PAGE_SIZE, 0);
- if (ptr == 0)
- {
- return (void *) MFAIL;
- }
- // save ptrs so they can be freed during cleanup
- our_os_pools[next_os_pool] = ptr;
- next_os_pool++;
- ptr = (void *) ((((size_t) ptr) + RM_PAGE_MASK) & ~RM_PAGE_MASK);
- sbrk_top = (char *) ptr + size;
- return ptr;
- }
- else if (size < 0)
- {
- // we don't currently support shrink behavior
- return (void *) MFAIL;
- }
- else
- {
- return sbrk_top;
- }
- }
-
- // cleanup any allocated memory pools
- // called as last thing before shutting down driver
-
- void osCleanupMem(void)
- {
- void **ptr;
-
- for (ptr = our_os_pools; ptr < &our_os_pools[MAX_POOL_ENTRIES]; ptr++)
- if (*ptr)
- {
- PoolDeallocate(*ptr);
- *ptr = 0;
- }
- }
-
-*/
-
-
-/* -----------------------------------------------------------------------
-History:
- V2.8.3 Thu Sep 22 11:16:32 2005 Doug Lea (dl at gee)
- * Add max_footprint functions
- * Ensure all appropriate literals are size_t
- * Fix conditional compilation problem for some #define settings
- * Avoid concatenating segments with the one provided
- in create_mspace_with_base
- * Rename some variables to avoid compiler shadowing warnings
- * Use explicit lock initialization.
- * Better handling of sbrk interference.
- * Simplify and fix segment insertion, trimming and mspace_destroy
- * Reinstate REALLOC_ZERO_BYTES_FREES option from 2.7.x
- * Thanks especially to Dennis Flanagan for help on these.
-
- V2.8.2 Sun Jun 12 16:01:10 2005 Doug Lea (dl at gee)
- * Fix memalign brace error.
-
- V2.8.1 Wed Jun 8 16:11:46 2005 Doug Lea (dl at gee)
- * Fix improper #endif nesting in C++
- * Add explicit casts needed for C++
-
- V2.8.0 Mon May 30 14:09:02 2005 Doug Lea (dl at gee)
- * Use trees for large bins
- * Support mspaces
- * Use segments to unify sbrk-based and mmap-based system allocation,
- removing need for emulation on most platforms without sbrk.
- * Default safety checks
- * Optional footer checks. Thanks to William Robertson for the idea.
- * Internal code refactoring
- * Incorporate suggestions and platform-specific changes.
- Thanks to Dennis Flanagan, Colin Plumb, Niall Douglas,
- Aaron Bachmann, Emery Berger, and others.
- * Speed up non-fastbin processing enough to remove fastbins.
- * Remove useless cfree() to avoid conflicts with other apps.
- * Remove internal memcpy, memset. Compilers handle builtins better.
- * Remove some options that no one ever used and rename others.
-
- V2.7.2 Sat Aug 17 09:07:30 2002 Doug Lea (dl at gee)
- * Fix malloc_state bitmap array misdeclaration
-
- V2.7.1 Thu Jul 25 10:58:03 2002 Doug Lea (dl at gee)
- * Allow tuning of FIRST_SORTED_BIN_SIZE
- * Use PTR_UINT as type for all ptr->int casts. Thanks to John Belmonte.
- * Better detection and support for non-contiguousness of MORECORE.
- Thanks to Andreas Mueller, Conal Walsh, and Wolfram Gloger
- * Bypass most of malloc if no frees. Thanks To Emery Berger.
- * Fix freeing of old top non-contiguous chunk im sysmalloc.
- * Raised default trim and map thresholds to 256K.
- * Fix mmap-related #defines. Thanks to Lubos Lunak.
- * Fix copy macros; added LACKS_FCNTL_H. Thanks to Neal Walfield.
- * Branch-free bin calculation
- * Default trim and mmap thresholds now 256K.
-
- V2.7.0 Sun Mar 11 14:14:06 2001 Doug Lea (dl at gee)
- * Introduce independent_comalloc and independent_calloc.
- Thanks to Michael Pachos for motivation and help.
- * Make optional .h file available
- * Allow > 2GB requests on 32bit systems.
- * new WIN32 sbrk, mmap, munmap, lock code from <Walter@GeNeSys-e.de>.
- Thanks also to Andreas Mueller <a.mueller at paradatec.de>,
- and Anonymous.
- * Allow override of MALLOC_ALIGNMENT (Thanks to Ruud Waij for
- helping test this.)
- * memalign: check alignment arg
- * realloc: don't try to shift chunks backwards, since this
- leads to more fragmentation in some programs and doesn't
- seem to help in any others.
- * Collect all cases in malloc requiring system memory into sysmalloc
- * Use mmap as backup to sbrk
- * Place all internal state in malloc_state
- * Introduce fastbins (although similar to 2.5.1)
- * Many minor tunings and cosmetic improvements
- * Introduce USE_PUBLIC_MALLOC_WRAPPERS, USE_MALLOC_LOCK
- * Introduce MALLOC_FAILURE_ACTION, MORECORE_CONTIGUOUS
- Thanks to Tony E. Bennett <tbennett@nvidia.com> and others.
- * Include errno.h to support default failure action.
-
- V2.6.6 Sun Dec 5 07:42:19 1999 Doug Lea (dl at gee)
- * return null for negative arguments
- * Added Several WIN32 cleanups from Martin C. Fong <mcfong at yahoo.com>
- * Add 'LACKS_SYS_PARAM_H' for those systems without 'sys/param.h'
- (e.g. WIN32 platforms)
- * Cleanup header file inclusion for WIN32 platforms
- * Cleanup code to avoid Microsoft Visual C++ compiler complaints
- * Add 'USE_DL_PREFIX' to quickly allow co-existence with existing
- memory allocation routines
- * Set 'malloc_getpagesize' for WIN32 platforms (needs more work)
- * Use 'assert' rather than 'ASSERT' in WIN32 code to conform to
- usage of 'assert' in non-WIN32 code
- * Improve WIN32 'sbrk()' emulation's 'findRegion()' routine to
- avoid infinite loop
- * Always call 'fREe()' rather than 'free()'
-
- V2.6.5 Wed Jun 17 15:57:31 1998 Doug Lea (dl at gee)
- * Fixed ordering problem with boundary-stamping
-
- V2.6.3 Sun May 19 08:17:58 1996 Doug Lea (dl at gee)
- * Added pvalloc, as recommended by H.J. Liu
- * Added 64bit pointer support mainly from Wolfram Gloger
- * Added anonymously donated WIN32 sbrk emulation
- * Malloc, calloc, getpagesize: add optimizations from Raymond Nijssen
- * malloc_extend_top: fix mask error that caused wastage after
- foreign sbrks
- * Add linux mremap support code from HJ Liu
-
- V2.6.2 Tue Dec 5 06:52:55 1995 Doug Lea (dl at gee)
- * Integrated most documentation with the code.
- * Add support for mmap, with help from
- Wolfram Gloger (Gloger@lrz.uni-muenchen.de).
- * Use last_remainder in more cases.
- * Pack bins using idea from colin@nyx10.cs.du.edu
- * Use ordered bins instead of best-fit threshold
- * Eliminate block-local decls to simplify tracing and debugging.
- * Support another case of realloc via move into top
- * Fix error occurring when initial sbrk_base not word-aligned.
- * Rely on page size for units instead of SBRK_UNIT to
- avoid surprises about sbrk alignment conventions.
- * Add mallinfo, mallopt. Thanks to Raymond Nijssen
- (raymond@es.ele.tue.nl) for the suggestion.
- * Add `pad' argument to malloc_trim and top_pad mallopt parameter.
- * More precautions for cases where other routines call sbrk,
- courtesy of Wolfram Gloger (Gloger@lrz.uni-muenchen.de).
- * Added macros etc., allowing use in linux libc from
- H.J. Lu (hjl@gnu.ai.mit.edu)
- * Inverted this history list
-
- V2.6.1 Sat Dec 2 14:10:57 1995 Doug Lea (dl at gee)
- * Re-tuned and fixed to behave more nicely with V2.6.0 changes.
- * Removed all preallocation code since under current scheme
- the work required to undo bad preallocations exceeds
- the work saved in good cases for most test programs.
- * No longer use return list or unconsolidated bins since
- no scheme using them consistently outperforms those that don't
- given above changes.
- * Use best fit for very large chunks to prevent some worst-cases.
- * Added some support for debugging
-
- V2.6.0 Sat Nov 4 07:05:23 1995 Doug Lea (dl at gee)
- * Removed footers when chunks are in use. Thanks to
- Paul Wilson (wilson@cs.texas.edu) for the suggestion.
-
- V2.5.4 Wed Nov 1 07:54:51 1995 Doug Lea (dl at gee)
- * Added malloc_trim, with help from Wolfram Gloger
- (wmglo@Dent.MED.Uni-Muenchen.DE).
-
- V2.5.3 Tue Apr 26 10:16:01 1994 Doug Lea (dl at g)
-
- V2.5.2 Tue Apr 5 16:20:40 1994 Doug Lea (dl at g)
- * realloc: try to expand in both directions
- * malloc: swap order of clean-bin strategy;
- * realloc: only conditionally expand backwards
- * Try not to scavenge used bins
- * Use bin counts as a guide to preallocation
- * Occasionally bin return list chunks in first scan
- * Add a few optimizations from colin@nyx10.cs.du.edu
-
- V2.5.1 Sat Aug 14 15:40:43 1993 Doug Lea (dl at g)
- * faster bin computation & slightly different binning
- * merged all consolidations to one part of malloc proper
- (eliminating old malloc_find_space & malloc_clean_bin)
- * Scan 2 returns chunks (not just 1)
- * Propagate failure in realloc if malloc returns 0
- * Add stuff to allow compilation on non-ANSI compilers
- from kpv@research.att.com
-
- V2.5 Sat Aug 7 07:41:59 1993 Doug Lea (dl at g.oswego.edu)
- * removed potential for odd address access in prev_chunk
- * removed dependency on getpagesize.h
- * misc cosmetics and a bit more internal documentation
- * anticosmetics: mangled names in macros to evade debugger strangeness
- * tested on sparc, hp-700, dec-mips, rs6000
- with gcc & native cc (hp, dec only) allowing
- Detlefs & Zorn comparison study (in SIGPLAN Notices.)
-
- Trial version Fri Aug 28 13:14:29 1992 Doug Lea (dl at g.oswego.edu)
- * Based loosely on libg++-1.2X malloc. (It retains some of the overall
- structure of old version, but most details differ.)
-
-*/
diff --git a/Modules/_ctypes/libffi/src/frv/eabi.S b/Modules/_ctypes/libffi/src/frv/eabi.S
deleted file mode 100644
index 379ea4bb0a..0000000000
--- a/Modules/_ctypes/libffi/src/frv/eabi.S
+++ /dev/null
@@ -1,128 +0,0 @@
-/* -----------------------------------------------------------------------
- eabi.S - Copyright (c) 2004 Anthony Green
-
- FR-V Assembly glue.
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- ``Software''), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to
- permit persons to whom the Software is furnished to do so, subject to
- the following conditions:
-
- The above copyright notice and this permission notice shall be included
- in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS
- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR
- OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- OTHER DEALINGS IN THE SOFTWARE.
- ----------------------------------------------------------------------- */
-
-#define LIBFFI_ASM
-#include <fficonfig.h>
-#include <ffi.h>
-
- .globl ffi_prep_args_EABI
-
- .text
- .p2align 4
- .globl ffi_call_EABI
- .type ffi_call_EABI, @function
-
- # gr8 : ffi_prep_args
- # gr9 : &ecif
- # gr10: cif->bytes
- # gr11: fig->flags
- # gr12: ecif.rvalue
- # gr13: fn
-
-ffi_call_EABI:
- addi sp, #-80, sp
- sti fp, @(sp, #24)
- addi sp, #24, fp
- movsg lr, gr5
-
- /* Make room for the new arguments. */
- /* subi sp, fp, gr10 */
-
- /* Store return address and incoming args on stack. */
- sti gr5, @(fp, #8)
- sti gr8, @(fp, #-4)
- sti gr9, @(fp, #-8)
- sti gr10, @(fp, #-12)
- sti gr11, @(fp, #-16)
- sti gr12, @(fp, #-20)
- sti gr13, @(fp, #-24)
-
- sub sp, gr10, sp
-
- /* Call ffi_prep_args. */
- ldi @(fp, #-4), gr4
- addi sp, #0, gr8
- ldi @(fp, #-8), gr9
-#ifdef __FRV_FDPIC__
- ldd @(gr4, gr0), gr14
- calll @(gr14, gr0)
-#else
- calll @(gr4, gr0)
-#endif
-
- /* ffi_prep_args returns the new stack pointer. */
- mov gr8, gr4
-
- ldi @(sp, #0), gr8
- ldi @(sp, #4), gr9
- ldi @(sp, #8), gr10
- ldi @(sp, #12), gr11
- ldi @(sp, #16), gr12
- ldi @(sp, #20), gr13
-
- /* Always copy the return value pointer into the hidden
- parameter register. This is only strictly necessary
- when we're returning an aggregate type, but it doesn't
- hurt to do this all the time, and it saves a branch. */
- ldi @(fp, #-20), gr3
-
- /* Use the ffi_prep_args return value for the new sp. */
- mov gr4, sp
-
- /* Call the target function. */
- ldi @(fp, -24), gr4
-#ifdef __FRV_FDPIC__
- ldd @(gr4, gr0), gr14
- calll @(gr14, gr0)
-#else
- calll @(gr4, gr0)
-#endif
-
- /* Store the result. */
- ldi @(fp, #-16), gr10 /* fig->flags */
- ldi @(fp, #-20), gr4 /* ecif.rvalue */
-
- /* Is the return value stored in two registers? */
- cmpi gr10, #8, icc0
- bne icc0, 0, .L2
- /* Yes, save them. */
- sti gr8, @(gr4, #0)
- sti gr9, @(gr4, #4)
- bra .L3
-.L2:
- /* Is the return value a structure? */
- cmpi gr10, #-1, icc0
- beq icc0, 0, .L3
- /* No, save a 4 byte return value. */
- sti gr8, @(gr4, #0)
-.L3:
-
- /* Restore the stack, and return. */
- ldi @(fp, 8), gr5
- ld @(fp, gr0), fp
- addi sp,#80,sp
- jmpl @(gr5,gr0)
- .size ffi_call_EABI, .-ffi_call_EABI
-
diff --git a/Modules/_ctypes/libffi/src/frv/ffi.c b/Modules/_ctypes/libffi/src/frv/ffi.c
deleted file mode 100644
index 5698c89c35..0000000000
--- a/Modules/_ctypes/libffi/src/frv/ffi.c
+++ /dev/null
@@ -1,292 +0,0 @@
-/* -----------------------------------------------------------------------
- ffi.c - Copyright (C) 2004 Anthony Green
- Copyright (C) 2007 Free Software Foundation, Inc.
- Copyright (C) 2008 Red Hat, Inc.
-
- FR-V Foreign Function Interface
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- ``Software''), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to
- permit persons to whom the Software is furnished to do so, subject to
- the following conditions:
-
- The above copyright notice and this permission notice shall be included
- in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- DEALINGS IN THE SOFTWARE.
- ----------------------------------------------------------------------- */
-
-#include <ffi.h>
-#include <ffi_common.h>
-
-#include <stdlib.h>
-
-/* ffi_prep_args is called by the assembly routine once stack space
- has been allocated for the function's arguments */
-
-void *ffi_prep_args(char *stack, extended_cif *ecif)
-{
- register unsigned int i;
- register void **p_argv;
- register char *argp;
- register ffi_type **p_arg;
- register int count = 0;
-
- p_argv = ecif->avalue;
- argp = stack;
-
- for (i = ecif->cif->nargs, p_arg = ecif->cif->arg_types;
- (i != 0);
- i--, p_arg++)
- {
- size_t z;
-
- z = (*p_arg)->size;
-
- if ((*p_arg)->type == FFI_TYPE_STRUCT)
- {
- z = sizeof(void*);
- *(void **) argp = *p_argv;
- }
- /* if ((*p_arg)->type == FFI_TYPE_FLOAT)
- {
- if (count > 24)
- {
- // This is going on the stack. Turn it into a double.
- *(double *) argp = (double) *(float*)(* p_argv);
- z = sizeof(double);
- }
- else
- *(void **) argp = *(void **)(* p_argv);
- } */
- else if (z < sizeof(int))
- {
- z = sizeof(int);
- switch ((*p_arg)->type)
- {
- case FFI_TYPE_SINT8:
- *(signed int *) argp = (signed int)*(SINT8 *)(* p_argv);
- break;
-
- case FFI_TYPE_UINT8:
- *(unsigned int *) argp = (unsigned int)*(UINT8 *)(* p_argv);
- break;
-
- case FFI_TYPE_SINT16:
- *(signed int *) argp = (signed int)*(SINT16 *)(* p_argv);
- break;
-
- case FFI_TYPE_UINT16:
- *(unsigned int *) argp = (unsigned int)*(UINT16 *)(* p_argv);
- break;
-
- default:
- FFI_ASSERT(0);
- }
- }
- else if (z == sizeof(int))
- {
- *(unsigned int *) argp = (unsigned int)*(UINT32 *)(* p_argv);
- }
- else
- {
- memcpy(argp, *p_argv, z);
- }
- p_argv++;
- argp += z;
- count += z;
- }
-
- return (stack + ((count > 24) ? 24 : ALIGN_DOWN(count, 8)));
-}
-
-/* Perform machine dependent cif processing */
-ffi_status ffi_prep_cif_machdep(ffi_cif *cif)
-{
- if (cif->rtype->type == FFI_TYPE_STRUCT)
- cif->flags = -1;
- else
- cif->flags = cif->rtype->size;
-
- cif->bytes = ALIGN (cif->bytes, 8);
-
- return FFI_OK;
-}
-
-extern void ffi_call_EABI(void *(*)(char *, extended_cif *),
- extended_cif *,
- unsigned, unsigned,
- unsigned *,
- void (*fn)(void));
-
-void ffi_call(ffi_cif *cif,
- void (*fn)(void),
- void *rvalue,
- void **avalue)
-{
- extended_cif ecif;
-
- ecif.cif = cif;
- ecif.avalue = avalue;
-
- /* If the return value is a struct and we don't have a return */
- /* value address then we need to make one */
-
- if ((rvalue == NULL) &&
- (cif->rtype->type == FFI_TYPE_STRUCT))
- {
- ecif.rvalue = alloca(cif->rtype->size);
- }
- else
- ecif.rvalue = rvalue;
-
-
- switch (cif->abi)
- {
- case FFI_EABI:
- ffi_call_EABI(ffi_prep_args, &ecif, cif->bytes,
- cif->flags, ecif.rvalue, fn);
- break;
- default:
- FFI_ASSERT(0);
- break;
- }
-}
-
-void ffi_closure_eabi (unsigned arg1, unsigned arg2, unsigned arg3,
- unsigned arg4, unsigned arg5, unsigned arg6)
-{
- /* This function is called by a trampoline. The trampoline stows a
- pointer to the ffi_closure object in gr7. We must save this
- pointer in a place that will persist while we do our work. */
- register ffi_closure *creg __asm__ ("gr7");
- ffi_closure *closure = creg;
-
- /* Arguments that don't fit in registers are found on the stack
- at a fixed offset above the current frame pointer. */
- register char *frame_pointer __asm__ ("fp");
- char *stack_args = frame_pointer + 16;
-
- /* Lay the register arguments down in a continuous chunk of memory. */
- unsigned register_args[6] =
- { arg1, arg2, arg3, arg4, arg5, arg6 };
-
- ffi_cif *cif = closure->cif;
- ffi_type **arg_types = cif->arg_types;
- void **avalue = alloca (cif->nargs * sizeof(void *));
- char *ptr = (char *) register_args;
- int i;
-
- /* Find the address of each argument. */
- for (i = 0; i < cif->nargs; i++)
- {
- switch (arg_types[i]->type)
- {
- case FFI_TYPE_SINT8:
- case FFI_TYPE_UINT8:
- avalue[i] = ptr + 3;
- break;
- case FFI_TYPE_SINT16:
- case FFI_TYPE_UINT16:
- avalue[i] = ptr + 2;
- break;
- case FFI_TYPE_SINT32:
- case FFI_TYPE_UINT32:
- case FFI_TYPE_FLOAT:
- avalue[i] = ptr;
- break;
- case FFI_TYPE_STRUCT:
- avalue[i] = *(void**)ptr;
- break;
- default:
- /* This is an 8-byte value. */
- avalue[i] = ptr;
- ptr += 4;
- break;
- }
- ptr += 4;
-
- /* If we've handled more arguments than fit in registers,
- start looking at the those passed on the stack. */
- if (ptr == ((char *)register_args + (6*4)))
- ptr = stack_args;
- }
-
- /* Invoke the closure. */
- if (cif->rtype->type == FFI_TYPE_STRUCT)
- {
- /* The caller allocates space for the return structure, and
- passes a pointer to this space in gr3. Use this value directly
- as the return value. */
- register void *return_struct_ptr __asm__("gr3");
- (closure->fun) (cif, return_struct_ptr, avalue, closure->user_data);
- }
- else
- {
- /* Allocate space for the return value and call the function. */
- long long rvalue;
- (closure->fun) (cif, &rvalue, avalue, closure->user_data);
-
- /* Functions return 4-byte or smaller results in gr8. 8-byte
- values also use gr9. We fill the both, even for small return
- values, just to avoid a branch. */
- asm ("ldi @(%0, #0), gr8" : : "r" (&rvalue));
- asm ("ldi @(%0, #0), gr9" : : "r" (&((int *) &rvalue)[1]));
- }
-}
-
-ffi_status
-ffi_prep_closure_loc (ffi_closure* closure,
- ffi_cif* cif,
- void (*fun)(ffi_cif*, void*, void**, void*),
- void *user_data,
- void *codeloc)
-{
- unsigned int *tramp = (unsigned int *) &closure->tramp[0];
- unsigned long fn = (long) ffi_closure_eabi;
- unsigned long cls = (long) codeloc;
-#ifdef __FRV_FDPIC__
- register void *got __asm__("gr15");
-#endif
- int i;
-
- fn = (unsigned long) ffi_closure_eabi;
-
-#ifdef __FRV_FDPIC__
- tramp[0] = &((unsigned int *)codeloc)[2];
- tramp[1] = got;
- tramp[2] = 0x8cfc0000 + (fn & 0xffff); /* setlos lo(fn), gr6 */
- tramp[3] = 0x8efc0000 + (cls & 0xffff); /* setlos lo(cls), gr7 */
- tramp[4] = 0x8cf80000 + (fn >> 16); /* sethi hi(fn), gr6 */
- tramp[5] = 0x8ef80000 + (cls >> 16); /* sethi hi(cls), gr7 */
- tramp[6] = 0x9cc86000; /* ldi @(gr6, #0), gr14 */
- tramp[7] = 0x8030e000; /* jmpl @(gr14, gr0) */
-#else
- tramp[0] = 0x8cfc0000 + (fn & 0xffff); /* setlos lo(fn), gr6 */
- tramp[1] = 0x8efc0000 + (cls & 0xffff); /* setlos lo(cls), gr7 */
- tramp[2] = 0x8cf80000 + (fn >> 16); /* sethi hi(fn), gr6 */
- tramp[3] = 0x8ef80000 + (cls >> 16); /* sethi hi(cls), gr7 */
- tramp[4] = 0x80300006; /* jmpl @(gr0, gr6) */
-#endif
-
- closure->cif = cif;
- closure->fun = fun;
- closure->user_data = user_data;
-
- /* Cache flushing. */
- for (i = 0; i < FFI_TRAMPOLINE_SIZE; i++)
- __asm__ volatile ("dcf @(%0,%1)\n\tici @(%2,%1)" :: "r" (tramp), "r" (i),
- "r" (codeloc));
-
- return FFI_OK;
-}
diff --git a/Modules/_ctypes/libffi/src/frv/ffitarget.h b/Modules/_ctypes/libffi/src/frv/ffitarget.h
deleted file mode 100644
index d42540e53d..0000000000
--- a/Modules/_ctypes/libffi/src/frv/ffitarget.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/* -----------------------------------------------------------------*-C-*-
- ffitarget.h - Copyright (c) 2012 Anthony Green
- Copyright (c) 1996-2004 Red Hat, Inc.
- Target configuration macros for FR-V
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- ``Software''), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to
- permit persons to whom the Software is furnished to do so, subject to
- the following conditions:
-
- The above copyright notice and this permission notice shall be included
- in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- DEALINGS IN THE SOFTWARE.
-
- ----------------------------------------------------------------------- */
-
-#ifndef LIBFFI_TARGET_H
-#define LIBFFI_TARGET_H
-
-#ifndef LIBFFI_H
-#error "Please do not include ffitarget.h directly into your source. Use ffi.h instead."
-#endif
-
-/* ---- System specific configurations ----------------------------------- */
-
-#ifndef LIBFFI_ASM
-typedef unsigned long ffi_arg;
-typedef signed long ffi_sarg;
-
-typedef enum ffi_abi {
- FFI_FIRST_ABI = 0,
- FFI_EABI,
- FFI_LAST_ABI,
- FFI_DEFAULT_ABI = FFI_EABI
-} ffi_abi;
-#endif
-
-/* ---- Definitions for closures ----------------------------------------- */
-
-#define FFI_CLOSURES 1
-#define FFI_NATIVE_RAW_API 0
-
-#ifdef __FRV_FDPIC__
-/* Trampolines are 8 4-byte instructions long. */
-#define FFI_TRAMPOLINE_SIZE (8*4)
-#else
-/* Trampolines are 5 4-byte instructions long. */
-#define FFI_TRAMPOLINE_SIZE (5*4)
-#endif
-
-#endif
diff --git a/Modules/_ctypes/libffi/src/ia64/ffi.c b/Modules/_ctypes/libffi/src/ia64/ffi.c
deleted file mode 100644
index b77a836ddc..0000000000
--- a/Modules/_ctypes/libffi/src/ia64/ffi.c
+++ /dev/null
@@ -1,586 +0,0 @@
-/* -----------------------------------------------------------------------
- ffi.c - Copyright (c) 1998, 2007, 2008, 2012 Red Hat, Inc.
- Copyright (c) 2000 Hewlett Packard Company
- Copyright (c) 2011 Anthony Green
-
- IA64 Foreign Function Interface
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- ``Software''), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to
- permit persons to whom the Software is furnished to do so, subject to
- the following conditions:
-
- The above copyright notice and this permission notice shall be included
- in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- DEALINGS IN THE SOFTWARE.
- ----------------------------------------------------------------------- */
-
-#include <ffi.h>
-#include <ffi_common.h>
-
-#include <stdlib.h>
-#include <stdbool.h>
-#include <float.h>
-
-#include "ia64_flags.h"
-
-/* A 64-bit pointer value. In LP64 mode, this is effectively a plain
- pointer. In ILP32 mode, it's a pointer that's been extended to
- 64 bits by "addp4". */
-typedef void *PTR64 __attribute__((mode(DI)));
-
-/* Memory image of fp register contents. This is the implementation
- specific format used by ldf.fill/stf.spill. All we care about is
- that it wants a 16 byte aligned slot. */
-typedef struct
-{
- UINT64 x[2] __attribute__((aligned(16)));
-} fpreg;
-
-
-/* The stack layout given to ffi_call_unix and ffi_closure_unix_inner. */
-
-struct ia64_args
-{
- fpreg fp_regs[8]; /* Contents of 8 fp arg registers. */
- UINT64 gp_regs[8]; /* Contents of 8 gp arg registers. */
- UINT64 other_args[]; /* Arguments passed on stack, variable size. */
-};
-
-
-/* Adjust ADDR, a pointer to an 8 byte slot, to point to the low LEN bytes. */
-
-static inline void *
-endian_adjust (void *addr, size_t len)
-{
-#ifdef __BIG_ENDIAN__
- return addr + (8 - len);
-#else
- return addr;
-#endif
-}
-
-/* Store VALUE to ADDR in the current cpu implementation's fp spill format.
- This is a macro instead of a function, so that it works for all 3 floating
- point types without type conversions. Type conversion to long double breaks
- the denorm support. */
-
-#define stf_spill(addr, value) \
- asm ("stf.spill %0 = %1%P0" : "=m" (*addr) : "f"(value));
-
-/* Load a value from ADDR, which is in the current cpu implementation's
- fp spill format. As above, this must also be a macro. */
-
-#define ldf_fill(result, addr) \
- asm ("ldf.fill %0 = %1%P1" : "=f"(result) : "m"(*addr));
-
-/* Return the size of the C type associated with with TYPE. Which will
- be one of the FFI_IA64_TYPE_HFA_* values. */
-
-static size_t
-hfa_type_size (int type)
-{
- switch (type)
- {
- case FFI_IA64_TYPE_HFA_FLOAT:
- return sizeof(float);
- case FFI_IA64_TYPE_HFA_DOUBLE:
- return sizeof(double);
- case FFI_IA64_TYPE_HFA_LDOUBLE:
- return sizeof(__float80);
- default:
- abort ();
- }
-}
-
-/* Load from ADDR a value indicated by TYPE. Which will be one of
- the FFI_IA64_TYPE_HFA_* values. */
-
-static void
-hfa_type_load (fpreg *fpaddr, int type, void *addr)
-{
- switch (type)
- {
- case FFI_IA64_TYPE_HFA_FLOAT:
- stf_spill (fpaddr, *(float *) addr);
- return;
- case FFI_IA64_TYPE_HFA_DOUBLE:
- stf_spill (fpaddr, *(double *) addr);
- return;
- case FFI_IA64_TYPE_HFA_LDOUBLE:
- stf_spill (fpaddr, *(__float80 *) addr);
- return;
- default:
- abort ();
- }
-}
-
-/* Load VALUE into ADDR as indicated by TYPE. Which will be one of
- the FFI_IA64_TYPE_HFA_* values. */
-
-static void
-hfa_type_store (int type, void *addr, fpreg *fpaddr)
-{
- switch (type)
- {
- case FFI_IA64_TYPE_HFA_FLOAT:
- {
- float result;
- ldf_fill (result, fpaddr);
- *(float *) addr = result;
- break;
- }
- case FFI_IA64_TYPE_HFA_DOUBLE:
- {
- double result;
- ldf_fill (result, fpaddr);
- *(double *) addr = result;
- break;
- }
- case FFI_IA64_TYPE_HFA_LDOUBLE:
- {
- __float80 result;
- ldf_fill (result, fpaddr);
- *(__float80 *) addr = result;
- break;
- }
- default:
- abort ();
- }
-}
-
-/* Is TYPE a struct containing floats, doubles, or extended doubles,
- all of the same fp type? If so, return the element type. Return
- FFI_TYPE_VOID if not. */
-
-static int
-hfa_element_type (ffi_type *type, int nested)
-{
- int element = FFI_TYPE_VOID;
-
- switch (type->type)
- {
- case FFI_TYPE_FLOAT:
- /* We want to return VOID for raw floating-point types, but the
- synthetic HFA type if we're nested within an aggregate. */
- if (nested)
- element = FFI_IA64_TYPE_HFA_FLOAT;
- break;
-
- case FFI_TYPE_DOUBLE:
- /* Similarly. */
- if (nested)
- element = FFI_IA64_TYPE_HFA_DOUBLE;
- break;
-
- case FFI_TYPE_LONGDOUBLE:
- /* Similarly, except that that HFA is true for double extended,
- but not quad precision. Both have sizeof == 16, so tell the
- difference based on the precision. */
- if (LDBL_MANT_DIG == 64 && nested)
- element = FFI_IA64_TYPE_HFA_LDOUBLE;
- break;
-
- case FFI_TYPE_STRUCT:
- {
- ffi_type **ptr = &type->elements[0];
-
- for (ptr = &type->elements[0]; *ptr ; ptr++)
- {
- int sub_element = hfa_element_type (*ptr, 1);
- if (sub_element == FFI_TYPE_VOID)
- return FFI_TYPE_VOID;
-
- if (element == FFI_TYPE_VOID)
- element = sub_element;
- else if (element != sub_element)
- return FFI_TYPE_VOID;
- }
- }
- break;
-
- default:
- return FFI_TYPE_VOID;
- }
-
- return element;
-}
-
-
-/* Perform machine dependent cif processing. */
-
-ffi_status
-ffi_prep_cif_machdep(ffi_cif *cif)
-{
- int flags;
-
- /* Adjust cif->bytes to include space for the bits of the ia64_args frame
- that precedes the integer register portion. The estimate that the
- generic bits did for the argument space required is good enough for the
- integer component. */
- cif->bytes += offsetof(struct ia64_args, gp_regs[0]);
- if (cif->bytes < sizeof(struct ia64_args))
- cif->bytes = sizeof(struct ia64_args);
-
- /* Set the return type flag. */
- flags = cif->rtype->type;
- switch (cif->rtype->type)
- {
- case FFI_TYPE_LONGDOUBLE:
- /* Leave FFI_TYPE_LONGDOUBLE as meaning double extended precision,
- and encode quad precision as a two-word integer structure. */
- if (LDBL_MANT_DIG != 64)
- flags = FFI_IA64_TYPE_SMALL_STRUCT | (16 << 8);
- break;
-
- case FFI_TYPE_STRUCT:
- {
- size_t size = cif->rtype->size;
- int hfa_type = hfa_element_type (cif->rtype, 0);
-
- if (hfa_type != FFI_TYPE_VOID)
- {
- size_t nelts = size / hfa_type_size (hfa_type);
- if (nelts <= 8)
- flags = hfa_type | (size << 8);
- }
- else
- {
- if (size <= 32)
- flags = FFI_IA64_TYPE_SMALL_STRUCT | (size << 8);
- }
- }
- break;
-
- default:
- break;
- }
- cif->flags = flags;
-
- return FFI_OK;
-}
-
-extern int ffi_call_unix (struct ia64_args *, PTR64, void (*)(void), UINT64);
-
-void
-ffi_call(ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue)
-{
- struct ia64_args *stack;
- long i, avn, gpcount, fpcount;
- ffi_type **p_arg;
-
- FFI_ASSERT (cif->abi == FFI_UNIX);
-
- /* If we have no spot for a return value, make one. */
- if (rvalue == NULL && cif->rtype->type != FFI_TYPE_VOID)
- rvalue = alloca (cif->rtype->size);
-
- /* Allocate the stack frame. */
- stack = alloca (cif->bytes);
-
- gpcount = fpcount = 0;
- avn = cif->nargs;
- for (i = 0, p_arg = cif->arg_types; i < avn; i++, p_arg++)
- {
- switch ((*p_arg)->type)
- {
- case FFI_TYPE_SINT8:
- stack->gp_regs[gpcount++] = *(SINT8 *)avalue[i];
- break;
- case FFI_TYPE_UINT8:
- stack->gp_regs[gpcount++] = *(UINT8 *)avalue[i];
- break;
- case FFI_TYPE_SINT16:
- stack->gp_regs[gpcount++] = *(SINT16 *)avalue[i];
- break;
- case FFI_TYPE_UINT16:
- stack->gp_regs[gpcount++] = *(UINT16 *)avalue[i];
- break;
- case FFI_TYPE_SINT32:
- stack->gp_regs[gpcount++] = *(SINT32 *)avalue[i];
- break;
- case FFI_TYPE_UINT32:
- stack->gp_regs[gpcount++] = *(UINT32 *)avalue[i];
- break;
- case FFI_TYPE_SINT64:
- case FFI_TYPE_UINT64:
- stack->gp_regs[gpcount++] = *(UINT64 *)avalue[i];
- break;
-
- case FFI_TYPE_POINTER:
- stack->gp_regs[gpcount++] = (UINT64)(PTR64) *(void **)avalue[i];
- break;
-
- case FFI_TYPE_FLOAT:
- if (gpcount < 8 && fpcount < 8)
- stf_spill (&stack->fp_regs[fpcount++], *(float *)avalue[i]);
- {
- UINT32 tmp;
- memcpy (&tmp, avalue[i], sizeof (UINT32));
- stack->gp_regs[gpcount++] = tmp;
- }
- break;
-
- case FFI_TYPE_DOUBLE:
- if (gpcount < 8 && fpcount < 8)
- stf_spill (&stack->fp_regs[fpcount++], *(double *)avalue[i]);
- memcpy (&stack->gp_regs[gpcount++], avalue[i], sizeof (UINT64));
- break;
-
- case FFI_TYPE_LONGDOUBLE:
- if (gpcount & 1)
- gpcount++;
- if (LDBL_MANT_DIG == 64 && gpcount < 8 && fpcount < 8)
- stf_spill (&stack->fp_regs[fpcount++], *(__float80 *)avalue[i]);
- memcpy (&stack->gp_regs[gpcount], avalue[i], 16);
- gpcount += 2;
- break;
-
- case FFI_TYPE_STRUCT:
- {
- size_t size = (*p_arg)->size;
- size_t align = (*p_arg)->alignment;
- int hfa_type = hfa_element_type (*p_arg, 0);
-
- FFI_ASSERT (align <= 16);
- if (align == 16 && (gpcount & 1))
- gpcount++;
-
- if (hfa_type != FFI_TYPE_VOID)
- {
- size_t hfa_size = hfa_type_size (hfa_type);
- size_t offset = 0;
- size_t gp_offset = gpcount * 8;
-
- while (fpcount < 8
- && offset < size
- && gp_offset < 8 * 8)
- {
- hfa_type_load (&stack->fp_regs[fpcount], hfa_type,
- avalue[i] + offset);
- offset += hfa_size;
- gp_offset += hfa_size;
- fpcount += 1;
- }
- }
-
- memcpy (&stack->gp_regs[gpcount], avalue[i], size);
- gpcount += (size + 7) / 8;
- }
- break;
-
- default:
- abort ();
- }
- }
-
- ffi_call_unix (stack, rvalue, fn, cif->flags);
-}
-
-/* Closures represent a pair consisting of a function pointer, and
- some user data. A closure is invoked by reinterpreting the closure
- as a function pointer, and branching to it. Thus we can make an
- interpreted function callable as a C function: We turn the
- interpreter itself, together with a pointer specifying the
- interpreted procedure, into a closure.
-
- For IA64, function pointer are already pairs consisting of a code
- pointer, and a gp pointer. The latter is needed to access global
- variables. Here we set up such a pair as the first two words of
- the closure (in the "trampoline" area), but we replace the gp
- pointer with a pointer to the closure itself. We also add the real
- gp pointer to the closure. This allows the function entry code to
- both retrieve the user data, and to restore the correct gp pointer. */
-
-extern void ffi_closure_unix ();
-
-ffi_status
-ffi_prep_closure_loc (ffi_closure* closure,
- ffi_cif* cif,
- void (*fun)(ffi_cif*,void*,void**,void*),
- void *user_data,
- void *codeloc)
-{
- /* The layout of a function descriptor. A C function pointer really
- points to one of these. */
- struct ia64_fd
- {
- UINT64 code_pointer;
- UINT64 gp;
- };
-
- struct ffi_ia64_trampoline_struct
- {
- UINT64 code_pointer; /* Pointer to ffi_closure_unix. */
- UINT64 fake_gp; /* Pointer to closure, installed as gp. */
- UINT64 real_gp; /* Real gp value. */
- };
-
- struct ffi_ia64_trampoline_struct *tramp;
- struct ia64_fd *fd;
-
- if (cif->abi != FFI_UNIX)
- return FFI_BAD_ABI;
-
- tramp = (struct ffi_ia64_trampoline_struct *)closure->tramp;
- fd = (struct ia64_fd *)(void *)ffi_closure_unix;
-
- tramp->code_pointer = fd->code_pointer;
- tramp->real_gp = fd->gp;
- tramp->fake_gp = (UINT64)(PTR64)codeloc;
- closure->cif = cif;
- closure->user_data = user_data;
- closure->fun = fun;
-
- return FFI_OK;
-}
-
-
-UINT64
-ffi_closure_unix_inner (ffi_closure *closure, struct ia64_args *stack,
- void *rvalue, void *r8)
-{
- ffi_cif *cif;
- void **avalue;
- ffi_type **p_arg;
- long i, avn, gpcount, fpcount;
-
- cif = closure->cif;
- avn = cif->nargs;
- avalue = alloca (avn * sizeof (void *));
-
- /* If the structure return value is passed in memory get that location
- from r8 so as to pass the value directly back to the caller. */
- if (cif->flags == FFI_TYPE_STRUCT)
- rvalue = r8;
-
- gpcount = fpcount = 0;
- for (i = 0, p_arg = cif->arg_types; i < avn; i++, p_arg++)
- {
- switch ((*p_arg)->type)
- {
- case FFI_TYPE_SINT8:
- case FFI_TYPE_UINT8:
- avalue[i] = endian_adjust(&stack->gp_regs[gpcount++], 1);
- break;
- case FFI_TYPE_SINT16:
- case FFI_TYPE_UINT16:
- avalue[i] = endian_adjust(&stack->gp_regs[gpcount++], 2);
- break;
- case FFI_TYPE_SINT32:
- case FFI_TYPE_UINT32:
- avalue[i] = endian_adjust(&stack->gp_regs[gpcount++], 4);
- break;
- case FFI_TYPE_SINT64:
- case FFI_TYPE_UINT64:
- avalue[i] = &stack->gp_regs[gpcount++];
- break;
- case FFI_TYPE_POINTER:
- avalue[i] = endian_adjust(&stack->gp_regs[gpcount++], sizeof(void*));
- break;
-
- case FFI_TYPE_FLOAT:
- if (gpcount < 8 && fpcount < 8)
- {
- fpreg *addr = &stack->fp_regs[fpcount++];
- float result;
- avalue[i] = addr;
- ldf_fill (result, addr);
- *(float *)addr = result;
- }
- else
- avalue[i] = endian_adjust(&stack->gp_regs[gpcount], 4);
- gpcount++;
- break;
-
- case FFI_TYPE_DOUBLE:
- if (gpcount < 8 && fpcount < 8)
- {
- fpreg *addr = &stack->fp_regs[fpcount++];
- double result;
- avalue[i] = addr;
- ldf_fill (result, addr);
- *(double *)addr = result;
- }
- else
- avalue[i] = &stack->gp_regs[gpcount];
- gpcount++;
- break;
-
- case FFI_TYPE_LONGDOUBLE:
- if (gpcount & 1)
- gpcount++;
- if (LDBL_MANT_DIG == 64 && gpcount < 8 && fpcount < 8)
- {
- fpreg *addr = &stack->fp_regs[fpcount++];
- __float80 result;
- avalue[i] = addr;
- ldf_fill (result, addr);
- *(__float80 *)addr = result;
- }
- else
- avalue[i] = &stack->gp_regs[gpcount];
- gpcount += 2;
- break;
-
- case FFI_TYPE_STRUCT:
- {
- size_t size = (*p_arg)->size;
- size_t align = (*p_arg)->alignment;
- int hfa_type = hfa_element_type (*p_arg, 0);
-
- FFI_ASSERT (align <= 16);
- if (align == 16 && (gpcount & 1))
- gpcount++;
-
- if (hfa_type != FFI_TYPE_VOID)
- {
- size_t hfa_size = hfa_type_size (hfa_type);
- size_t offset = 0;
- size_t gp_offset = gpcount * 8;
- void *addr = alloca (size);
-
- avalue[i] = addr;
-
- while (fpcount < 8
- && offset < size
- && gp_offset < 8 * 8)
- {
- hfa_type_store (hfa_type, addr + offset,
- &stack->fp_regs[fpcount]);
- offset += hfa_size;
- gp_offset += hfa_size;
- fpcount += 1;
- }
-
- if (offset < size)
- memcpy (addr + offset, (char *)stack->gp_regs + gp_offset,
- size - offset);
- }
- else
- avalue[i] = &stack->gp_regs[gpcount];
-
- gpcount += (size + 7) / 8;
- }
- break;
-
- default:
- abort ();
- }
- }
-
- closure->fun (cif, rvalue, avalue, closure->user_data);
-
- return cif->flags;
-}
diff --git a/Modules/_ctypes/libffi/src/ia64/ffitarget.h b/Modules/_ctypes/libffi/src/ia64/ffitarget.h
deleted file mode 100644
index e68cea6154..0000000000
--- a/Modules/_ctypes/libffi/src/ia64/ffitarget.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/* -----------------------------------------------------------------*-C-*-
- ffitarget.h - Copyright (c) 2012 Anthony Green
- Copyright (c) 1996-2003 Red Hat, Inc.
- Target configuration macros for IA-64.
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- ``Software''), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to
- permit persons to whom the Software is furnished to do so, subject to
- the following conditions:
-
- The above copyright notice and this permission notice shall be included
- in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- DEALINGS IN THE SOFTWARE.
-
- ----------------------------------------------------------------------- */
-
-#ifndef LIBFFI_TARGET_H
-#define LIBFFI_TARGET_H
-
-#ifndef LIBFFI_H
-#error "Please do not include ffitarget.h directly into your source. Use ffi.h instead."
-#endif
-
-#ifndef LIBFFI_ASM
-typedef unsigned long long ffi_arg;
-typedef signed long long ffi_sarg;
-
-typedef enum ffi_abi {
- FFI_FIRST_ABI = 0,
- FFI_UNIX, /* Linux and all Unix variants use the same conventions */
- FFI_LAST_ABI,
- FFI_DEFAULT_ABI = FFI_UNIX
-} ffi_abi;
-#endif
-
-/* ---- Definitions for closures ----------------------------------------- */
-
-#define FFI_CLOSURES 1
-#define FFI_TRAMPOLINE_SIZE 24 /* Really the following struct, which */
- /* can be interpreted as a C function */
- /* descriptor: */
-
-#endif
-
diff --git a/Modules/_ctypes/libffi/src/ia64/ia64_flags.h b/Modules/_ctypes/libffi/src/ia64/ia64_flags.h
deleted file mode 100644
index 9d652cef14..0000000000
--- a/Modules/_ctypes/libffi/src/ia64/ia64_flags.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/* -----------------------------------------------------------------------
- ia64_flags.h - Copyright (c) 2000 Hewlett Packard Company
-
- IA64/unix Foreign Function Interface
-
- Original author: Hans Boehm, HP Labs
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- ``Software''), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to
- permit persons to whom the Software is furnished to do so, subject to
- the following conditions:
-
- The above copyright notice and this permission notice shall be included
- in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- DEALINGS IN THE SOFTWARE.
- ----------------------------------------------------------------------- */
-
-/* "Type" codes used between assembly and C. When used as a part of
- a cfi->flags value, the low byte will be these extra type codes,
- and bits 8-31 will be the actual size of the type. */
-
-/* Small structures containing N words in integer registers. */
-#define FFI_IA64_TYPE_SMALL_STRUCT (FFI_TYPE_LAST + 1)
-
-/* Homogeneous Floating Point Aggregates (HFAs) which are returned
- in FP registers. */
-#define FFI_IA64_TYPE_HFA_FLOAT (FFI_TYPE_LAST + 2)
-#define FFI_IA64_TYPE_HFA_DOUBLE (FFI_TYPE_LAST + 3)
-#define FFI_IA64_TYPE_HFA_LDOUBLE (FFI_TYPE_LAST + 4)
diff --git a/Modules/_ctypes/libffi/src/ia64/unix.S b/Modules/_ctypes/libffi/src/ia64/unix.S
deleted file mode 100644
index 4d2a86d421..0000000000
--- a/Modules/_ctypes/libffi/src/ia64/unix.S
+++ /dev/null
@@ -1,560 +0,0 @@
-/* -----------------------------------------------------------------------
- unix.S - Copyright (c) 1998, 2008 Red Hat, Inc.
- Copyright (c) 2000 Hewlett Packard Company
-
- IA64/unix Foreign Function Interface
-
- Primary author: Hans Boehm, HP Labs
-
- Loosely modeled on Cygnus code for other platforms.
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- ``Software''), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to
- permit persons to whom the Software is furnished to do so, subject to
- the following conditions:
-
- The above copyright notice and this permission notice shall be included
- in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- DEALINGS IN THE SOFTWARE.
- ----------------------------------------------------------------------- */
-
-#define LIBFFI_ASM
-#include <fficonfig.h>
-#include <ffi.h>
-#include "ia64_flags.h"
-
- .pred.safe_across_calls p1-p5,p16-p63
-.text
-
-/* int ffi_call_unix (struct ia64_args *stack, PTR64 rvalue,
- void (*fn)(void), int flags);
- */
-
- .align 16
- .global ffi_call_unix
- .proc ffi_call_unix
-ffi_call_unix:
- .prologue
- /* Bit o trickiness. We actually share a stack frame with ffi_call.
- Rely on the fact that ffi_call uses a vframe and don't bother
- tracking one here at all. */
- .fframe 0
- .save ar.pfs, r36 // loc0
- alloc loc0 = ar.pfs, 4, 3, 8, 0
- .save rp, loc1
- mov loc1 = b0
- .body
- add r16 = 16, in0
- mov loc2 = gp
- mov r8 = in1
- ;;
-
- /* Load up all of the argument registers. */
- ldf.fill f8 = [in0], 32
- ldf.fill f9 = [r16], 32
- ;;
- ldf.fill f10 = [in0], 32
- ldf.fill f11 = [r16], 32
- ;;
- ldf.fill f12 = [in0], 32
- ldf.fill f13 = [r16], 32
- ;;
- ldf.fill f14 = [in0], 32
- ldf.fill f15 = [r16], 24
- ;;
- ld8 out0 = [in0], 16
- ld8 out1 = [r16], 16
- ;;
- ld8 out2 = [in0], 16
- ld8 out3 = [r16], 16
- ;;
- ld8 out4 = [in0], 16
- ld8 out5 = [r16], 16
- ;;
- ld8 out6 = [in0]
- ld8 out7 = [r16]
- ;;
-
- /* Deallocate the register save area from the stack frame. */
- mov sp = in0
-
- /* Call the target function. */
- ld8 r16 = [in2], 8
- ;;
- ld8 gp = [in2]
- mov b6 = r16
- br.call.sptk.many b0 = b6
- ;;
-
- /* Dispatch to handle return value. */
- mov gp = loc2
- zxt1 r16 = in3
- ;;
- mov ar.pfs = loc0
- addl r18 = @ltoffx(.Lst_table), gp
- ;;
- ld8.mov r18 = [r18], .Lst_table
- mov b0 = loc1
- ;;
- shladd r18 = r16, 3, r18
- ;;
- ld8 r17 = [r18]
- shr in3 = in3, 8
- ;;
- add r17 = r17, r18
- ;;
- mov b6 = r17
- br b6
- ;;
-
-.Lst_void:
- br.ret.sptk.many b0
- ;;
-.Lst_uint8:
- zxt1 r8 = r8
- ;;
- st8 [in1] = r8
- br.ret.sptk.many b0
- ;;
-.Lst_sint8:
- sxt1 r8 = r8
- ;;
- st8 [in1] = r8
- br.ret.sptk.many b0
- ;;
-.Lst_uint16:
- zxt2 r8 = r8
- ;;
- st8 [in1] = r8
- br.ret.sptk.many b0
- ;;
-.Lst_sint16:
- sxt2 r8 = r8
- ;;
- st8 [in1] = r8
- br.ret.sptk.many b0
- ;;
-.Lst_uint32:
- zxt4 r8 = r8
- ;;
- st8 [in1] = r8
- br.ret.sptk.many b0
- ;;
-.Lst_sint32:
- sxt4 r8 = r8
- ;;
- st8 [in1] = r8
- br.ret.sptk.many b0
- ;;
-.Lst_int64:
- st8 [in1] = r8
- br.ret.sptk.many b0
- ;;
-.Lst_float:
- stfs [in1] = f8
- br.ret.sptk.many b0
- ;;
-.Lst_double:
- stfd [in1] = f8
- br.ret.sptk.many b0
- ;;
-.Lst_ldouble:
- stfe [in1] = f8
- br.ret.sptk.many b0
- ;;
-
-.Lst_small_struct:
- add sp = -16, sp
- cmp.lt p6, p0 = 8, in3
- cmp.lt p7, p0 = 16, in3
- cmp.lt p8, p0 = 24, in3
- ;;
- add r16 = 8, sp
- add r17 = 16, sp
- add r18 = 24, sp
- ;;
- st8 [sp] = r8
-(p6) st8 [r16] = r9
- mov out0 = in1
-(p7) st8 [r17] = r10
-(p8) st8 [r18] = r11
- mov out1 = sp
- mov out2 = in3
- br.call.sptk.many b0 = memcpy#
- ;;
- mov ar.pfs = loc0
- mov b0 = loc1
- mov gp = loc2
- br.ret.sptk.many b0
-
-.Lst_hfa_float:
- add r16 = 4, in1
- cmp.lt p6, p0 = 4, in3
- ;;
- stfs [in1] = f8, 8
-(p6) stfs [r16] = f9, 8
- cmp.lt p7, p0 = 8, in3
- cmp.lt p8, p0 = 12, in3
- ;;
-(p7) stfs [in1] = f10, 8
-(p8) stfs [r16] = f11, 8
- cmp.lt p9, p0 = 16, in3
- cmp.lt p10, p0 = 20, in3
- ;;
-(p9) stfs [in1] = f12, 8
-(p10) stfs [r16] = f13, 8
- cmp.lt p6, p0 = 24, in3
- cmp.lt p7, p0 = 28, in3
- ;;
-(p6) stfs [in1] = f14
-(p7) stfs [r16] = f15
- br.ret.sptk.many b0
- ;;
-
-.Lst_hfa_double:
- add r16 = 8, in1
- cmp.lt p6, p0 = 8, in3
- ;;
- stfd [in1] = f8, 16
-(p6) stfd [r16] = f9, 16
- cmp.lt p7, p0 = 16, in3
- cmp.lt p8, p0 = 24, in3
- ;;
-(p7) stfd [in1] = f10, 16
-(p8) stfd [r16] = f11, 16
- cmp.lt p9, p0 = 32, in3
- cmp.lt p10, p0 = 40, in3
- ;;
-(p9) stfd [in1] = f12, 16
-(p10) stfd [r16] = f13, 16
- cmp.lt p6, p0 = 48, in3
- cmp.lt p7, p0 = 56, in3
- ;;
-(p6) stfd [in1] = f14
-(p7) stfd [r16] = f15
- br.ret.sptk.many b0
- ;;
-
-.Lst_hfa_ldouble:
- add r16 = 16, in1
- cmp.lt p6, p0 = 16, in3
- ;;
- stfe [in1] = f8, 32
-(p6) stfe [r16] = f9, 32
- cmp.lt p7, p0 = 32, in3
- cmp.lt p8, p0 = 48, in3
- ;;
-(p7) stfe [in1] = f10, 32
-(p8) stfe [r16] = f11, 32
- cmp.lt p9, p0 = 64, in3
- cmp.lt p10, p0 = 80, in3
- ;;
-(p9) stfe [in1] = f12, 32
-(p10) stfe [r16] = f13, 32
- cmp.lt p6, p0 = 96, in3
- cmp.lt p7, p0 = 112, in3
- ;;
-(p6) stfe [in1] = f14
-(p7) stfe [r16] = f15
- br.ret.sptk.many b0
- ;;
-
- .endp ffi_call_unix
-
- .align 16
- .global ffi_closure_unix
- .proc ffi_closure_unix
-
-#define FRAME_SIZE (8*16 + 8*8 + 8*16)
-
-ffi_closure_unix:
- .prologue
- .save ar.pfs, r40 // loc0
- alloc loc0 = ar.pfs, 8, 4, 4, 0
- .fframe FRAME_SIZE
- add r12 = -FRAME_SIZE, r12
- .save rp, loc1
- mov loc1 = b0
- .save ar.unat, loc2
- mov loc2 = ar.unat
- .body
-
- /* Retrieve closure pointer and real gp. */
-#ifdef _ILP32
- addp4 out0 = 0, gp
- addp4 gp = 16, gp
-#else
- mov out0 = gp
- add gp = 16, gp
-#endif
- ;;
- ld8 gp = [gp]
-
- /* Spill all of the possible argument registers. */
- add r16 = 16 + 8*16, sp
- add r17 = 16 + 8*16 + 16, sp
- ;;
- stf.spill [r16] = f8, 32
- stf.spill [r17] = f9, 32
- mov loc3 = gp
- ;;
- stf.spill [r16] = f10, 32
- stf.spill [r17] = f11, 32
- ;;
- stf.spill [r16] = f12, 32
- stf.spill [r17] = f13, 32
- ;;
- stf.spill [r16] = f14, 32
- stf.spill [r17] = f15, 24
- ;;
- .mem.offset 0, 0
- st8.spill [r16] = in0, 16
- .mem.offset 8, 0
- st8.spill [r17] = in1, 16
- add out1 = 16 + 8*16, sp
- ;;
- .mem.offset 0, 0
- st8.spill [r16] = in2, 16
- .mem.offset 8, 0
- st8.spill [r17] = in3, 16
- add out2 = 16, sp
- ;;
- .mem.offset 0, 0
- st8.spill [r16] = in4, 16
- .mem.offset 8, 0
- st8.spill [r17] = in5, 16
- mov out3 = r8
- ;;
- .mem.offset 0, 0
- st8.spill [r16] = in6
- .mem.offset 8, 0
- st8.spill [r17] = in7
-
- /* Invoke ffi_closure_unix_inner for the hard work. */
- br.call.sptk.many b0 = ffi_closure_unix_inner
- ;;
-
- /* Dispatch to handle return value. */
- mov gp = loc3
- zxt1 r16 = r8
- ;;
- addl r18 = @ltoffx(.Lld_table), gp
- mov ar.pfs = loc0
- ;;
- ld8.mov r18 = [r18], .Lld_table
- mov b0 = loc1
- ;;
- shladd r18 = r16, 3, r18
- mov ar.unat = loc2
- ;;
- ld8 r17 = [r18]
- shr r8 = r8, 8
- ;;
- add r17 = r17, r18
- add r16 = 16, sp
- ;;
- mov b6 = r17
- br b6
- ;;
- .label_state 1
-
-.Lld_void:
- .restore sp
- add sp = FRAME_SIZE, sp
- br.ret.sptk.many b0
- ;;
-.Lld_int:
- .body
- .copy_state 1
- ld8 r8 = [r16]
- .restore sp
- add sp = FRAME_SIZE, sp
- br.ret.sptk.many b0
- ;;
-.Lld_float:
- .body
- .copy_state 1
- ldfs f8 = [r16]
- .restore sp
- add sp = FRAME_SIZE, sp
- br.ret.sptk.many b0
- ;;
-.Lld_double:
- .body
- .copy_state 1
- ldfd f8 = [r16]
- .restore sp
- add sp = FRAME_SIZE, sp
- br.ret.sptk.many b0
- ;;
-.Lld_ldouble:
- .body
- .copy_state 1
- ldfe f8 = [r16]
- .restore sp
- add sp = FRAME_SIZE, sp
- br.ret.sptk.many b0
- ;;
-
-.Lld_small_struct:
- .body
- .copy_state 1
- add r17 = 8, r16
- cmp.lt p6, p0 = 8, r8
- cmp.lt p7, p0 = 16, r8
- cmp.lt p8, p0 = 24, r8
- ;;
- ld8 r8 = [r16], 16
-(p6) ld8 r9 = [r17], 16
- ;;
-(p7) ld8 r10 = [r16]
-(p8) ld8 r11 = [r17]
- .restore sp
- add sp = FRAME_SIZE, sp
- br.ret.sptk.many b0
- ;;
-
-.Lld_hfa_float:
- .body
- .copy_state 1
- add r17 = 4, r16
- cmp.lt p6, p0 = 4, r8
- ;;
- ldfs f8 = [r16], 8
-(p6) ldfs f9 = [r17], 8
- cmp.lt p7, p0 = 8, r8
- cmp.lt p8, p0 = 12, r8
- ;;
-(p7) ldfs f10 = [r16], 8
-(p8) ldfs f11 = [r17], 8
- cmp.lt p9, p0 = 16, r8
- cmp.lt p10, p0 = 20, r8
- ;;
-(p9) ldfs f12 = [r16], 8
-(p10) ldfs f13 = [r17], 8
- cmp.lt p6, p0 = 24, r8
- cmp.lt p7, p0 = 28, r8
- ;;
-(p6) ldfs f14 = [r16]
-(p7) ldfs f15 = [r17]
- .restore sp
- add sp = FRAME_SIZE, sp
- br.ret.sptk.many b0
- ;;
-
-.Lld_hfa_double:
- .body
- .copy_state 1
- add r17 = 8, r16
- cmp.lt p6, p0 = 8, r8
- ;;
- ldfd f8 = [r16], 16
-(p6) ldfd f9 = [r17], 16
- cmp.lt p7, p0 = 16, r8
- cmp.lt p8, p0 = 24, r8
- ;;
-(p7) ldfd f10 = [r16], 16
-(p8) ldfd f11 = [r17], 16
- cmp.lt p9, p0 = 32, r8
- cmp.lt p10, p0 = 40, r8
- ;;
-(p9) ldfd f12 = [r16], 16
-(p10) ldfd f13 = [r17], 16
- cmp.lt p6, p0 = 48, r8
- cmp.lt p7, p0 = 56, r8
- ;;
-(p6) ldfd f14 = [r16]
-(p7) ldfd f15 = [r17]
- .restore sp
- add sp = FRAME_SIZE, sp
- br.ret.sptk.many b0
- ;;
-
-.Lld_hfa_ldouble:
- .body
- .copy_state 1
- add r17 = 16, r16
- cmp.lt p6, p0 = 16, r8
- ;;
- ldfe f8 = [r16], 32
-(p6) ldfe f9 = [r17], 32
- cmp.lt p7, p0 = 32, r8
- cmp.lt p8, p0 = 48, r8
- ;;
-(p7) ldfe f10 = [r16], 32
-(p8) ldfe f11 = [r17], 32
- cmp.lt p9, p0 = 64, r8
- cmp.lt p10, p0 = 80, r8
- ;;
-(p9) ldfe f12 = [r16], 32
-(p10) ldfe f13 = [r17], 32
- cmp.lt p6, p0 = 96, r8
- cmp.lt p7, p0 = 112, r8
- ;;
-(p6) ldfe f14 = [r16]
-(p7) ldfe f15 = [r17]
- .restore sp
- add sp = FRAME_SIZE, sp
- br.ret.sptk.many b0
- ;;
-
- .endp ffi_closure_unix
-
- .section .rodata
- .align 8
-.Lst_table:
- data8 @pcrel(.Lst_void) // FFI_TYPE_VOID
- data8 @pcrel(.Lst_sint32) // FFI_TYPE_INT
- data8 @pcrel(.Lst_float) // FFI_TYPE_FLOAT
- data8 @pcrel(.Lst_double) // FFI_TYPE_DOUBLE
- data8 @pcrel(.Lst_ldouble) // FFI_TYPE_LONGDOUBLE
- data8 @pcrel(.Lst_uint8) // FFI_TYPE_UINT8
- data8 @pcrel(.Lst_sint8) // FFI_TYPE_SINT8
- data8 @pcrel(.Lst_uint16) // FFI_TYPE_UINT16
- data8 @pcrel(.Lst_sint16) // FFI_TYPE_SINT16
- data8 @pcrel(.Lst_uint32) // FFI_TYPE_UINT32
- data8 @pcrel(.Lst_sint32) // FFI_TYPE_SINT32
- data8 @pcrel(.Lst_int64) // FFI_TYPE_UINT64
- data8 @pcrel(.Lst_int64) // FFI_TYPE_SINT64
- data8 @pcrel(.Lst_void) // FFI_TYPE_STRUCT
- data8 @pcrel(.Lst_int64) // FFI_TYPE_POINTER
- data8 @pcrel(.Lst_small_struct) // FFI_IA64_TYPE_SMALL_STRUCT
- data8 @pcrel(.Lst_hfa_float) // FFI_IA64_TYPE_HFA_FLOAT
- data8 @pcrel(.Lst_hfa_double) // FFI_IA64_TYPE_HFA_DOUBLE
- data8 @pcrel(.Lst_hfa_ldouble) // FFI_IA64_TYPE_HFA_LDOUBLE
-
-.Lld_table:
- data8 @pcrel(.Lld_void) // FFI_TYPE_VOID
- data8 @pcrel(.Lld_int) // FFI_TYPE_INT
- data8 @pcrel(.Lld_float) // FFI_TYPE_FLOAT
- data8 @pcrel(.Lld_double) // FFI_TYPE_DOUBLE
- data8 @pcrel(.Lld_ldouble) // FFI_TYPE_LONGDOUBLE
- data8 @pcrel(.Lld_int) // FFI_TYPE_UINT8
- data8 @pcrel(.Lld_int) // FFI_TYPE_SINT8
- data8 @pcrel(.Lld_int) // FFI_TYPE_UINT16
- data8 @pcrel(.Lld_int) // FFI_TYPE_SINT16
- data8 @pcrel(.Lld_int) // FFI_TYPE_UINT32
- data8 @pcrel(.Lld_int) // FFI_TYPE_SINT32
- data8 @pcrel(.Lld_int) // FFI_TYPE_UINT64
- data8 @pcrel(.Lld_int) // FFI_TYPE_SINT64
- data8 @pcrel(.Lld_void) // FFI_TYPE_STRUCT
- data8 @pcrel(.Lld_int) // FFI_TYPE_POINTER
- data8 @pcrel(.Lld_small_struct) // FFI_IA64_TYPE_SMALL_STRUCT
- data8 @pcrel(.Lld_hfa_float) // FFI_IA64_TYPE_HFA_FLOAT
- data8 @pcrel(.Lld_hfa_double) // FFI_IA64_TYPE_HFA_DOUBLE
- data8 @pcrel(.Lld_hfa_ldouble) // FFI_IA64_TYPE_HFA_LDOUBLE
-
-#if defined __ELF__ && defined __linux__
- .section .note.GNU-stack,"",@progbits
-#endif
diff --git a/Modules/_ctypes/libffi/src/java_raw_api.c b/Modules/_ctypes/libffi/src/java_raw_api.c
deleted file mode 100644
index 522c8bfd67..0000000000
--- a/Modules/_ctypes/libffi/src/java_raw_api.c
+++ /dev/null
@@ -1,356 +0,0 @@
-/* -----------------------------------------------------------------------
- java_raw_api.c - Copyright (c) 1999, 2007, 2008 Red Hat, Inc.
-
- Cloned from raw_api.c
-
- Raw_api.c author: Kresten Krab Thorup <krab@gnu.org>
- Java_raw_api.c author: Hans-J. Boehm <hboehm@hpl.hp.com>
-
- $Id $
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- ``Software''), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to
- permit persons to whom the Software is furnished to do so, subject to
- the following conditions:
-
- The above copyright notice and this permission notice shall be included
- in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- DEALINGS IN THE SOFTWARE.
- ----------------------------------------------------------------------- */
-
-/* This defines a Java- and 64-bit specific variant of the raw API. */
-/* It assumes that "raw" argument blocks look like Java stacks on a */
-/* 64-bit machine. Arguments that can be stored in a single stack */
-/* stack slots (longs, doubles) occupy 128 bits, but only the first */
-/* 64 bits are actually used. */
-
-#include <ffi.h>
-#include <ffi_common.h>
-#include <stdlib.h>
-
-#if !defined(NO_JAVA_RAW_API) && !defined(FFI_NO_RAW_API)
-
-size_t
-ffi_java_raw_size (ffi_cif *cif)
-{
- size_t result = 0;
- int i;
-
- ffi_type **at = cif->arg_types;
-
- for (i = cif->nargs-1; i >= 0; i--, at++)
- {
- switch((*at) -> type) {
- case FFI_TYPE_UINT64:
- case FFI_TYPE_SINT64:
- case FFI_TYPE_DOUBLE:
- result += 2 * FFI_SIZEOF_JAVA_RAW;
- break;
- case FFI_TYPE_STRUCT:
- /* No structure parameters in Java. */
- abort();
- default:
- result += FFI_SIZEOF_JAVA_RAW;
- }
- }
-
- return result;
-}
-
-
-void
-ffi_java_raw_to_ptrarray (ffi_cif *cif, ffi_java_raw *raw, void **args)
-{
- unsigned i;
- ffi_type **tp = cif->arg_types;
-
-#if WORDS_BIGENDIAN
-
- for (i = 0; i < cif->nargs; i++, tp++, args++)
- {
- switch ((*tp)->type)
- {
- case FFI_TYPE_UINT8:
- case FFI_TYPE_SINT8:
- *args = (void*) ((char*)(raw++) + 3);
- break;
-
- case FFI_TYPE_UINT16:
- case FFI_TYPE_SINT16:
- *args = (void*) ((char*)(raw++) + 2);
- break;
-
-#if FFI_SIZEOF_JAVA_RAW == 8
- case FFI_TYPE_UINT64:
- case FFI_TYPE_SINT64:
- case FFI_TYPE_DOUBLE:
- *args = (void *)raw;
- raw += 2;
- break;
-#endif
-
- case FFI_TYPE_POINTER:
- *args = (void*) &(raw++)->ptr;
- break;
-
- default:
- *args = raw;
- raw +=
- ALIGN ((*tp)->size, sizeof(ffi_java_raw)) / sizeof(ffi_java_raw);
- }
- }
-
-#else /* WORDS_BIGENDIAN */
-
-#if !PDP
-
- /* then assume little endian */
- for (i = 0; i < cif->nargs; i++, tp++, args++)
- {
-#if FFI_SIZEOF_JAVA_RAW == 8
- switch((*tp)->type) {
- case FFI_TYPE_UINT64:
- case FFI_TYPE_SINT64:
- case FFI_TYPE_DOUBLE:
- *args = (void*) raw;
- raw += 2;
- break;
- default:
- *args = (void*) raw++;
- }
-#else /* FFI_SIZEOF_JAVA_RAW != 8 */
- *args = (void*) raw;
- raw +=
- ALIGN ((*tp)->size, sizeof(ffi_java_raw)) / sizeof(ffi_java_raw);
-#endif /* FFI_SIZEOF_JAVA_RAW == 8 */
- }
-
-#else
-#error "pdp endian not supported"
-#endif /* ! PDP */
-
-#endif /* WORDS_BIGENDIAN */
-}
-
-void
-ffi_java_ptrarray_to_raw (ffi_cif *cif, void **args, ffi_java_raw *raw)
-{
- unsigned i;
- ffi_type **tp = cif->arg_types;
-
- for (i = 0; i < cif->nargs; i++, tp++, args++)
- {
- switch ((*tp)->type)
- {
- case FFI_TYPE_UINT8:
-#if WORDS_BIGENDIAN
- *(UINT32*)(raw++) = *(UINT8*) (*args);
-#else
- (raw++)->uint = *(UINT8*) (*args);
-#endif
- break;
-
- case FFI_TYPE_SINT8:
-#if WORDS_BIGENDIAN
- *(SINT32*)(raw++) = *(SINT8*) (*args);
-#else
- (raw++)->sint = *(SINT8*) (*args);
-#endif
- break;
-
- case FFI_TYPE_UINT16:
-#if WORDS_BIGENDIAN
- *(UINT32*)(raw++) = *(UINT16*) (*args);
-#else
- (raw++)->uint = *(UINT16*) (*args);
-#endif
- break;
-
- case FFI_TYPE_SINT16:
-#if WORDS_BIGENDIAN
- *(SINT32*)(raw++) = *(SINT16*) (*args);
-#else
- (raw++)->sint = *(SINT16*) (*args);
-#endif
- break;
-
- case FFI_TYPE_UINT32:
-#if WORDS_BIGENDIAN
- *(UINT32*)(raw++) = *(UINT32*) (*args);
-#else
- (raw++)->uint = *(UINT32*) (*args);
-#endif
- break;
-
- case FFI_TYPE_SINT32:
-#if WORDS_BIGENDIAN
- *(SINT32*)(raw++) = *(SINT32*) (*args);
-#else
- (raw++)->sint = *(SINT32*) (*args);
-#endif
- break;
-
- case FFI_TYPE_FLOAT:
- (raw++)->flt = *(FLOAT32*) (*args);
- break;
-
-#if FFI_SIZEOF_JAVA_RAW == 8
- case FFI_TYPE_UINT64:
- case FFI_TYPE_SINT64:
- case FFI_TYPE_DOUBLE:
- raw->uint = *(UINT64*) (*args);
- raw += 2;
- break;
-#endif
-
- case FFI_TYPE_POINTER:
- (raw++)->ptr = **(void***) args;
- break;
-
- default:
-#if FFI_SIZEOF_JAVA_RAW == 8
- FFI_ASSERT(0); /* Should have covered all cases */
-#else
- memcpy ((void*) raw->data, (void*)*args, (*tp)->size);
- raw +=
- ALIGN ((*tp)->size, sizeof(ffi_java_raw)) / sizeof(ffi_java_raw);
-#endif
- }
- }
-}
-
-#if !FFI_NATIVE_RAW_API
-
-static void
-ffi_java_rvalue_to_raw (ffi_cif *cif, void *rvalue)
-{
-#if WORDS_BIGENDIAN && FFI_SIZEOF_ARG == 8
- switch (cif->rtype->type)
- {
- case FFI_TYPE_UINT8:
- case FFI_TYPE_UINT16:
- case FFI_TYPE_UINT32:
- *(UINT64 *)rvalue <<= 32;
- break;
-
- case FFI_TYPE_SINT8:
- case FFI_TYPE_SINT16:
- case FFI_TYPE_SINT32:
- case FFI_TYPE_INT:
-#if FFI_SIZEOF_JAVA_RAW == 4
- case FFI_TYPE_POINTER:
-#endif
- *(SINT64 *)rvalue <<= 32;
- break;
-
- default:
- break;
- }
-#endif
-}
-
-static void
-ffi_java_raw_to_rvalue (ffi_cif *cif, void *rvalue)
-{
-#if WORDS_BIGENDIAN && FFI_SIZEOF_ARG == 8
- switch (cif->rtype->type)
- {
- case FFI_TYPE_UINT8:
- case FFI_TYPE_UINT16:
- case FFI_TYPE_UINT32:
- *(UINT64 *)rvalue >>= 32;
- break;
-
- case FFI_TYPE_SINT8:
- case FFI_TYPE_SINT16:
- case FFI_TYPE_SINT32:
- case FFI_TYPE_INT:
- *(SINT64 *)rvalue >>= 32;
- break;
-
- default:
- break;
- }
-#endif
-}
-
-/* This is a generic definition of ffi_raw_call, to be used if the
- * native system does not provide a machine-specific implementation.
- * Having this, allows code to be written for the raw API, without
- * the need for system-specific code to handle input in that format;
- * these following couple of functions will handle the translation forth
- * and back automatically. */
-
-void ffi_java_raw_call (ffi_cif *cif, void (*fn)(void), void *rvalue,
- ffi_java_raw *raw)
-{
- void **avalue = (void**) alloca (cif->nargs * sizeof (void*));
- ffi_java_raw_to_ptrarray (cif, raw, avalue);
- ffi_call (cif, fn, rvalue, avalue);
- ffi_java_rvalue_to_raw (cif, rvalue);
-}
-
-#if FFI_CLOSURES /* base system provides closures */
-
-static void
-ffi_java_translate_args (ffi_cif *cif, void *rvalue,
- void **avalue, void *user_data)
-{
- ffi_java_raw *raw = (ffi_java_raw*)alloca (ffi_java_raw_size (cif));
- ffi_raw_closure *cl = (ffi_raw_closure*)user_data;
-
- ffi_java_ptrarray_to_raw (cif, avalue, raw);
- (*cl->fun) (cif, rvalue, (ffi_raw*)raw, cl->user_data);
- ffi_java_raw_to_rvalue (cif, rvalue);
-}
-
-ffi_status
-ffi_prep_java_raw_closure_loc (ffi_java_raw_closure* cl,
- ffi_cif *cif,
- void (*fun)(ffi_cif*,void*,ffi_java_raw*,void*),
- void *user_data,
- void *codeloc)
-{
- ffi_status status;
-
- status = ffi_prep_closure_loc ((ffi_closure*) cl,
- cif,
- &ffi_java_translate_args,
- codeloc,
- codeloc);
- if (status == FFI_OK)
- {
- cl->fun = fun;
- cl->user_data = user_data;
- }
-
- return status;
-}
-
-/* Again, here is the generic version of ffi_prep_raw_closure, which
- * will install an intermediate "hub" for translation of arguments from
- * the pointer-array format, to the raw format */
-
-ffi_status
-ffi_prep_java_raw_closure (ffi_java_raw_closure* cl,
- ffi_cif *cif,
- void (*fun)(ffi_cif*,void*,ffi_java_raw*,void*),
- void *user_data)
-{
- return ffi_prep_java_raw_closure_loc (cl, cif, fun, user_data, cl);
-}
-
-#endif /* FFI_CLOSURES */
-#endif /* !FFI_NATIVE_RAW_API */
-#endif /* !FFI_NO_RAW_API */
diff --git a/Modules/_ctypes/libffi/src/m32r/ffi.c b/Modules/_ctypes/libffi/src/m32r/ffi.c
deleted file mode 100644
index 300006349b..0000000000
--- a/Modules/_ctypes/libffi/src/m32r/ffi.c
+++ /dev/null
@@ -1,232 +0,0 @@
-/* -----------------------------------------------------------------------
- ffi.c - Copyright (c) 2004 Renesas Technology
- Copyright (c) 2008 Red Hat, Inc.
-
- M32R Foreign Function Interface
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- ``Software''), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to
- permit persons to whom the Software is furnished to do so, subject to
- the following conditions:
-
- The above copyright notice and this permission notice shall be included
- in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS
- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- IN NO EVENT SHALL RENESAS TECHNOLOGY BE LIABLE FOR ANY CLAIM, DAMAGES OR
- OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- OTHER DEALINGS IN THE SOFTWARE.
- ----------------------------------------------------------------------- */
-
-#include <ffi.h>
-#include <ffi_common.h>
-
-#include <stdlib.h>
-
-/* ffi_prep_args is called by the assembly routine once stack
- space has been allocated for the function's arguments. */
-
-void ffi_prep_args(char *stack, extended_cif *ecif)
-{
- unsigned int i;
- int tmp;
- unsigned int avn;
- void **p_argv;
- char *argp;
- ffi_type **p_arg;
-
- tmp = 0;
- argp = stack;
-
- if (ecif->cif->rtype->type == FFI_TYPE_STRUCT && ecif->cif->rtype->size > 8)
- {
- *(void **) argp = ecif->rvalue;
- argp += 4;
- }
-
- avn = ecif->cif->nargs;
- p_argv = ecif->avalue;
-
- for (i = ecif->cif->nargs, p_arg = ecif->cif->arg_types;
- (i != 0) && (avn != 0);
- i--, p_arg++)
- {
- size_t z;
-
- /* Align if necessary. */
- if (((*p_arg)->alignment - 1) & (unsigned) argp)
- argp = (char *) ALIGN (argp, (*p_arg)->alignment);
-
- if (avn != 0)
- {
- avn--;
- z = (*p_arg)->size;
- if (z < sizeof (int))
- {
- z = sizeof (int);
-
- switch ((*p_arg)->type)
- {
- case FFI_TYPE_SINT8:
- *(signed int *) argp = (signed int)*(SINT8 *)(* p_argv);
- break;
-
- case FFI_TYPE_UINT8:
- *(unsigned int *) argp = (unsigned int)*(UINT8 *)(* p_argv);
- break;
-
- case FFI_TYPE_SINT16:
- *(signed int *) argp = (signed int)*(SINT16 *)(* p_argv);
- break;
-
- case FFI_TYPE_UINT16:
- *(unsigned int *) argp = (unsigned int)*(UINT16 *)(* p_argv);
- break;
-
- case FFI_TYPE_STRUCT:
- z = (*p_arg)->size;
- if ((*p_arg)->alignment != 1)
- memcpy (argp, *p_argv, z);
- else
- memcpy (argp + 4 - z, *p_argv, z);
- z = sizeof (int);
- break;
-
- default:
- FFI_ASSERT(0);
- }
- }
- else if (z == sizeof (int))
- {
- *(unsigned int *) argp = (unsigned int)*(UINT32 *)(* p_argv);
- }
- else
- {
- if ((*p_arg)->type == FFI_TYPE_STRUCT)
- {
- if (z > 8)
- {
- *(unsigned int *) argp = (unsigned int)(void *)(* p_argv);
- z = sizeof(void *);
- }
- else
- {
- memcpy(argp, *p_argv, z);
- z = 8;
- }
- }
- else
- {
- /* Double or long long 64bit. */
- memcpy (argp, *p_argv, z);
- }
- }
- p_argv++;
- argp += z;
- }
- }
-
- return;
-}
-
-/* Perform machine dependent cif processing. */
-ffi_status
-ffi_prep_cif_machdep(ffi_cif *cif)
-{
- /* Set the return type flag. */
- switch (cif->rtype->type)
- {
- case FFI_TYPE_VOID:
- cif->flags = (unsigned) cif->rtype->type;
- break;
-
- case FFI_TYPE_STRUCT:
- if (cif->rtype->size <= 4)
- cif->flags = FFI_TYPE_INT;
-
- else if (cif->rtype->size <= 8)
- cif->flags = FFI_TYPE_DOUBLE;
-
- else
- cif->flags = (unsigned) cif->rtype->type;
- break;
-
- case FFI_TYPE_SINT64:
- case FFI_TYPE_UINT64:
- case FFI_TYPE_DOUBLE:
- cif->flags = FFI_TYPE_DOUBLE;
- break;
-
- case FFI_TYPE_FLOAT:
- default:
- cif->flags = FFI_TYPE_INT;
- break;
- }
-
- return FFI_OK;
-}
-
-extern void ffi_call_SYSV(void (*)(char *, extended_cif *), extended_cif *,
- unsigned, unsigned, unsigned *, void (*fn)(void));
-
-void ffi_call(ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue)
-{
- extended_cif ecif;
-
- ecif.cif = cif;
- ecif.avalue = avalue;
-
- /* If the return value is a struct and we don't have
- a return value address then we need to make one. */
- if ((rvalue == NULL) &&
- (cif->rtype->type == FFI_TYPE_STRUCT))
- {
- ecif.rvalue = alloca (cif->rtype->size);
- }
- else
- ecif.rvalue = rvalue;
-
- switch (cif->abi)
- {
- case FFI_SYSV:
- ffi_call_SYSV(ffi_prep_args, &ecif, cif->bytes,
- cif->flags, ecif.rvalue, fn);
- if (cif->rtype->type == FFI_TYPE_STRUCT)
- {
- int size = cif->rtype->size;
- int align = cif->rtype->alignment;
-
- if (size < 4)
- {
- if (align == 1)
- *(unsigned long *)(ecif.rvalue) <<= (4 - size) * 8;
- }
- else if (4 < size && size < 8)
- {
- if (align == 1)
- {
- memcpy (ecif.rvalue, ecif.rvalue + 8-size, size);
- }
- else if (align == 2)
- {
- if (size & 1)
- size += 1;
-
- if (size != 8)
- memcpy (ecif.rvalue, ecif.rvalue + 8-size, size);
- }
- }
- }
- break;
-
- default:
- FFI_ASSERT(0);
- break;
- }
-}
diff --git a/Modules/_ctypes/libffi/src/m32r/ffitarget.h b/Modules/_ctypes/libffi/src/m32r/ffitarget.h
deleted file mode 100644
index 6c34801982..0000000000
--- a/Modules/_ctypes/libffi/src/m32r/ffitarget.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/* -----------------------------------------------------------------*-C-*-
- ffitarget.h - Copyright (c) 2012 Anthony Green
- Copyright (c) 2004 Renesas Technology.
- Target configuration macros for M32R.
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- ``Software''), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to
- permit persons to whom the Software is furnished to do so, subject to
- the following conditions:
-
- The above copyright notice and this permission notice shall be included
- in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS
- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- IN NO EVENT SHALL RENESAS TECHNOLOGY BE LIABLE FOR ANY CLAIM, DAMAGES OR
- OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- OTHER DEALINGS IN THE SOFTWARE.
-
- ----------------------------------------------------------------------- */
-
-#ifndef LIBFFI_TARGET_H
-#define LIBFFI_TARGET_H
-
-#ifndef LIBFFI_H
-#error "Please do not include ffitarget.h directly into your source. Use ffi.h instead."
-#endif
-
-/* ---- Generic type definitions ----------------------------------------- */
-
-#ifndef LIBFFI_ASM
-typedef unsigned long ffi_arg;
-typedef signed long ffi_sarg;
-
-typedef enum ffi_abi
- {
- FFI_FIRST_ABI = 0,
- FFI_SYSV,
- FFI_LAST_ABI,
- FFI_DEFAULT_ABI = FFI_SYSV
- } ffi_abi;
-#endif
-
-#define FFI_CLOSURES 0
-#define FFI_TRAMPOLINE_SIZE 24
-#define FFI_NATIVE_RAW_API 0
-
-#endif
diff --git a/Modules/_ctypes/libffi/src/m32r/sysv.S b/Modules/_ctypes/libffi/src/m32r/sysv.S
deleted file mode 100644
index 06b75c2263..0000000000
--- a/Modules/_ctypes/libffi/src/m32r/sysv.S
+++ /dev/null
@@ -1,121 +0,0 @@
-/* -----------------------------------------------------------------------
- sysv.S - Copyright (c) 2004 Renesas Technology
-
- M32R Foreign Function Interface
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- ``Software''), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to
- permit persons to whom the Software is furnished to do so, subject to
- the following conditions:
-
- The above copyright notice and this permission notice shall be included
- in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS
- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- IN NO EVENT SHALL RENESAS TECHNOLOGY BE LIABLE FOR ANY CLAIM, DAMAGES OR
- OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- OTHER DEALINGS IN THE SOFTWARE.
- ----------------------------------------------------------------------- */
-
-#define LIBFFI_ASM
-#include <fficonfig.h>
-#include <ffi.h>
-#ifdef HAVE_MACHINE_ASM_H
-#include <machine/asm.h>
-#else
-/* XXX these lose for some platforms, I'm sure. */
-#define CNAME(x) x
-#define ENTRY(x) .globl CNAME(x)! .type CNAME(x),%function! CNAME(x):
-#endif
-
-.text
-
- /* R0: ffi_prep_args */
- /* R1: &ecif */
- /* R2: cif->bytes */
- /* R3: fig->flags */
- /* sp+0: ecif.rvalue */
- /* sp+4: fn */
-
- /* This assumes we are using gas. */
-ENTRY(ffi_call_SYSV)
- /* Save registers. */
- push fp
- push lr
- push r3
- push r2
- push r1
- push r0
- mv fp, sp
-
- /* Make room for all of the new args. */
- sub sp, r2
-
- /* Place all of the ffi_prep_args in position. */
- mv lr, r0
- mv r0, sp
- /* R1 already set. */
-
- /* And call. */
- jl lr
-
- /* Move first 4 parameters in registers... */
- ld r0, @(0,sp)
- ld r1, @(4,sp)
- ld r2, @(8,sp)
- ld r3, @(12,sp)
-
- /* ...and adjust the stack. */
- ld lr, @(8,fp)
- cmpi lr, #16
- bc adjust_stack
- ldi lr, #16
-adjust_stack:
- add sp, lr
-
- /* Call the function. */
- ld lr, @(28,fp)
- jl lr
-
- /* Remove the space we pushed for the args. */
- mv sp, fp
-
- /* Load R2 with the pointer to storage for the return value. */
- ld r2, @(24,sp)
-
- /* Load R3 with the return type code. */
- ld r3, @(12,sp)
-
- /* If the return value pointer is NULL, assume no return value. */
- beqz r2, epilogue
-
- /* Return INT. */
- ldi r4, #FFI_TYPE_INT
- bne r3, r4, return_double
- st r0, @r2
- bra epilogue
-
-return_double:
- /* Return DOUBLE or LONGDOUBLE. */
- ldi r4, #FFI_TYPE_DOUBLE
- bne r3, r4, epilogue
- st r0, @r2
- st r1, @(4,r2)
-
-epilogue:
- pop r0
- pop r1
- pop r2
- pop r3
- pop lr
- pop fp
- jmp lr
-
-.ffi_call_SYSV_end:
- .size CNAME(ffi_call_SYSV),.ffi_call_SYSV_end-CNAME(ffi_call_SYSV)
diff --git a/Modules/_ctypes/libffi/src/m68k/ffi.c b/Modules/_ctypes/libffi/src/m68k/ffi.c
deleted file mode 100644
index 0dee9383a8..0000000000
--- a/Modules/_ctypes/libffi/src/m68k/ffi.c
+++ /dev/null
@@ -1,362 +0,0 @@
-/* -----------------------------------------------------------------------
- ffi.c
-
- m68k Foreign Function Interface
- ----------------------------------------------------------------------- */
-
-#include <ffi.h>
-#include <ffi_common.h>
-
-#include <stdlib.h>
-#include <unistd.h>
-#ifdef __rtems__
-void rtems_cache_flush_multiple_data_lines( const void *, size_t );
-#else
-#include <sys/syscall.h>
-#ifdef __MINT__
-#include <mint/mintbind.h>
-#include <mint/ssystem.h>
-#else
-#include <asm/cachectl.h>
-#endif
-#endif
-
-void ffi_call_SYSV (extended_cif *,
- unsigned, unsigned,
- void *, void (*fn) ());
-void *ffi_prep_args (void *stack, extended_cif *ecif);
-void ffi_closure_SYSV (ffi_closure *);
-void ffi_closure_struct_SYSV (ffi_closure *);
-unsigned int ffi_closure_SYSV_inner (ffi_closure *closure,
- void *resp, void *args);
-
-/* ffi_prep_args is called by the assembly routine once stack space has
- been allocated for the function's arguments. */
-
-void *
-ffi_prep_args (void *stack, extended_cif *ecif)
-{
- unsigned int i;
- void **p_argv;
- char *argp;
- ffi_type **p_arg;
- void *struct_value_ptr;
-
- argp = stack;
-
- if (
-#ifdef __MINT__
- (ecif->cif->rtype->type == FFI_TYPE_LONGDOUBLE) ||
-#endif
- (((ecif->cif->rtype->type == FFI_TYPE_STRUCT)
- && !ecif->cif->flags)))
- struct_value_ptr = ecif->rvalue;
- else
- struct_value_ptr = NULL;
-
- p_argv = ecif->avalue;
-
- for (i = ecif->cif->nargs, p_arg = ecif->cif->arg_types;
- i != 0;
- i--, p_arg++)
- {
- size_t z = (*p_arg)->size;
- int type = (*p_arg)->type;
-
- if (z < sizeof (int))
- {
- switch (type)
- {
- case FFI_TYPE_SINT8:
- *(signed int *) argp = (signed int) *(SINT8 *) *p_argv;
- break;
-
- case FFI_TYPE_UINT8:
- *(unsigned int *) argp = (unsigned int) *(UINT8 *) *p_argv;
- break;
-
- case FFI_TYPE_SINT16:
- *(signed int *) argp = (signed int) *(SINT16 *) *p_argv;
- break;
-
- case FFI_TYPE_UINT16:
- *(unsigned int *) argp = (unsigned int) *(UINT16 *) *p_argv;
- break;
-
- case FFI_TYPE_STRUCT:
-#ifdef __MINT__
- if (z == 1 || z == 2)
- memcpy (argp + 2, *p_argv, z);
- else
- memcpy (argp, *p_argv, z);
-#else
- memcpy (argp + sizeof (int) - z, *p_argv, z);
-#endif
- break;
-
- default:
- FFI_ASSERT (0);
- }
- z = sizeof (int);
- }
- else
- {
- memcpy (argp, *p_argv, z);
-
- /* Align if necessary. */
- if ((sizeof(int) - 1) & z)
- z = ALIGN(z, sizeof(int));
- }
-
- p_argv++;
- argp += z;
- }
-
- return struct_value_ptr;
-}
-
-#define CIF_FLAGS_INT 1
-#define CIF_FLAGS_DINT 2
-#define CIF_FLAGS_FLOAT 4
-#define CIF_FLAGS_DOUBLE 8
-#define CIF_FLAGS_LDOUBLE 16
-#define CIF_FLAGS_POINTER 32
-#define CIF_FLAGS_STRUCT1 64
-#define CIF_FLAGS_STRUCT2 128
-#define CIF_FLAGS_SINT8 256
-#define CIF_FLAGS_SINT16 512
-
-/* Perform machine dependent cif processing */
-ffi_status
-ffi_prep_cif_machdep (ffi_cif *cif)
-{
- /* Set the return type flag */
- switch (cif->rtype->type)
- {
- case FFI_TYPE_VOID:
- cif->flags = 0;
- break;
-
- case FFI_TYPE_STRUCT:
- if (cif->rtype->elements[0]->type == FFI_TYPE_STRUCT &&
- cif->rtype->elements[1])
- {
- cif->flags = 0;
- break;
- }
-
- switch (cif->rtype->size)
- {
- case 1:
-#ifdef __MINT__
- cif->flags = CIF_FLAGS_STRUCT2;
-#else
- cif->flags = CIF_FLAGS_STRUCT1;
-#endif
- break;
- case 2:
- cif->flags = CIF_FLAGS_STRUCT2;
- break;
-#ifdef __MINT__
- case 3:
-#endif
- case 4:
- cif->flags = CIF_FLAGS_INT;
- break;
-#ifdef __MINT__
- case 7:
-#endif
- case 8:
- cif->flags = CIF_FLAGS_DINT;
- break;
- default:
- cif->flags = 0;
- break;
- }
- break;
-
- case FFI_TYPE_FLOAT:
- cif->flags = CIF_FLAGS_FLOAT;
- break;
-
- case FFI_TYPE_DOUBLE:
- cif->flags = CIF_FLAGS_DOUBLE;
- break;
-
-#if (FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE)
- case FFI_TYPE_LONGDOUBLE:
-#ifdef __MINT__
- cif->flags = 0;
-#else
- cif->flags = CIF_FLAGS_LDOUBLE;
-#endif
- break;
-#endif
-
- case FFI_TYPE_POINTER:
- cif->flags = CIF_FLAGS_POINTER;
- break;
-
- case FFI_TYPE_SINT64:
- case FFI_TYPE_UINT64:
- cif->flags = CIF_FLAGS_DINT;
- break;
-
- case FFI_TYPE_SINT16:
- cif->flags = CIF_FLAGS_SINT16;
- break;
-
- case FFI_TYPE_SINT8:
- cif->flags = CIF_FLAGS_SINT8;
- break;
-
- default:
- cif->flags = CIF_FLAGS_INT;
- break;
- }
-
- return FFI_OK;
-}
-
-void
-ffi_call (ffi_cif *cif, void (*fn) (), void *rvalue, void **avalue)
-{
- extended_cif ecif;
-
- ecif.cif = cif;
- ecif.avalue = avalue;
-
- /* If the return value is a struct and we don't have a return value
- address then we need to make one. */
-
- if (rvalue == NULL
- && cif->rtype->type == FFI_TYPE_STRUCT
- && cif->rtype->size > 8)
- ecif.rvalue = alloca (cif->rtype->size);
- else
- ecif.rvalue = rvalue;
-
- switch (cif->abi)
- {
- case FFI_SYSV:
- ffi_call_SYSV (&ecif, cif->bytes, cif->flags,
- ecif.rvalue, fn);
- break;
-
- default:
- FFI_ASSERT (0);
- break;
- }
-}
-
-static void
-ffi_prep_incoming_args_SYSV (char *stack, void **avalue, ffi_cif *cif)
-{
- unsigned int i;
- void **p_argv;
- char *argp;
- ffi_type **p_arg;
-
- argp = stack;
- p_argv = avalue;
-
- for (i = cif->nargs, p_arg = cif->arg_types; (i != 0); i--, p_arg++)
- {
- size_t z;
-
- z = (*p_arg)->size;
-#ifdef __MINT__
- if (cif->flags &&
- cif->rtype->type == FFI_TYPE_STRUCT &&
- (z == 1 || z == 2))
- {
- *p_argv = (void *) (argp + 2);
-
- z = 4;
- }
- else
- if (cif->flags &&
- cif->rtype->type == FFI_TYPE_STRUCT &&
- (z == 3 || z == 4))
- {
- *p_argv = (void *) (argp);
-
- z = 4;
- }
- else
-#endif
- if (z <= 4)
- {
- *p_argv = (void *) (argp + 4 - z);
-
- z = 4;
- }
- else
- {
- *p_argv = (void *) argp;
-
- /* Align if necessary */
- if ((sizeof(int) - 1) & z)
- z = ALIGN(z, sizeof(int));
- }
-
- p_argv++;
- argp += z;
- }
-}
-
-unsigned int
-ffi_closure_SYSV_inner (ffi_closure *closure, void *resp, void *args)
-{
- ffi_cif *cif;
- void **arg_area;
-
- cif = closure->cif;
- arg_area = (void**) alloca (cif->nargs * sizeof (void *));
-
- ffi_prep_incoming_args_SYSV(args, arg_area, cif);
-
- (closure->fun) (cif, resp, arg_area, closure->user_data);
-
- return cif->flags;
-}
-
-ffi_status
-ffi_prep_closure_loc (ffi_closure* closure,
- ffi_cif* cif,
- void (*fun)(ffi_cif*,void*,void**,void*),
- void *user_data,
- void *codeloc)
-{
- if (cif->abi != FFI_SYSV)
- return FFI_BAD_ABI;
-
- *(unsigned short *)closure->tramp = 0x207c;
- *(void **)(closure->tramp + 2) = codeloc;
- *(unsigned short *)(closure->tramp + 6) = 0x4ef9;
-
- if (
-#ifdef __MINT__
- (cif->rtype->type == FFI_TYPE_LONGDOUBLE) ||
-#endif
- (((cif->rtype->type == FFI_TYPE_STRUCT)
- && !cif->flags)))
- *(void **)(closure->tramp + 8) = ffi_closure_struct_SYSV;
- else
- *(void **)(closure->tramp + 8) = ffi_closure_SYSV;
-
-#ifdef __rtems__
- rtems_cache_flush_multiple_data_lines( codeloc, FFI_TRAMPOLINE_SIZE );
-#elif defined(__MINT__)
- Ssystem(S_FLUSHCACHE, codeloc, FFI_TRAMPOLINE_SIZE);
-#else
- syscall(SYS_cacheflush, codeloc, FLUSH_SCOPE_LINE,
- FLUSH_CACHE_BOTH, FFI_TRAMPOLINE_SIZE);
-#endif
-
- closure->cif = cif;
- closure->user_data = user_data;
- closure->fun = fun;
-
- return FFI_OK;
-}
diff --git a/Modules/_ctypes/libffi/src/m68k/ffitarget.h b/Modules/_ctypes/libffi/src/m68k/ffitarget.h
deleted file mode 100644
index e81dde2b2e..0000000000
--- a/Modules/_ctypes/libffi/src/m68k/ffitarget.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/* -----------------------------------------------------------------*-C-*-
- ffitarget.h - Copyright (c) 2012 Anthony Green
- Copyright (c) 1996-2003 Red Hat, Inc.
- Target configuration macros for Motorola 68K.
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- ``Software''), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to
- permit persons to whom the Software is furnished to do so, subject to
- the following conditions:
-
- The above copyright notice and this permission notice shall be included
- in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- DEALINGS IN THE SOFTWARE.
-
- ----------------------------------------------------------------------- */
-
-#ifndef LIBFFI_TARGET_H
-#define LIBFFI_TARGET_H
-
-#ifndef LIBFFI_H
-#error "Please do not include ffitarget.h directly into your source. Use ffi.h instead."
-#endif
-
-#ifndef LIBFFI_ASM
-typedef unsigned long ffi_arg;
-typedef signed long ffi_sarg;
-
-typedef enum ffi_abi {
- FFI_FIRST_ABI = 0,
- FFI_SYSV,
- FFI_LAST_ABI,
- FFI_DEFAULT_ABI = FFI_SYSV
-} ffi_abi;
-#endif
-
-/* ---- Definitions for closures ----------------------------------------- */
-
-#define FFI_CLOSURES 1
-#define FFI_TRAMPOLINE_SIZE 16
-#define FFI_NATIVE_RAW_API 0
-
-#endif
-
diff --git a/Modules/_ctypes/libffi/src/m68k/sysv.S b/Modules/_ctypes/libffi/src/m68k/sysv.S
deleted file mode 100644
index ec2b14f3d9..0000000000
--- a/Modules/_ctypes/libffi/src/m68k/sysv.S
+++ /dev/null
@@ -1,330 +0,0 @@
-/* -----------------------------------------------------------------------
-
- sysv.S - Copyright (c) 2012 Alan Hourihane
- Copyright (c) 1998, 2012 Andreas Schwab
- Copyright (c) 2008 Red Hat, Inc.
- Copyright (c) 2012 Thorsten Glaser
-
- m68k Foreign Function Interface
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- ``Software''), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to
- permit persons to whom the Software is furnished to do so, subject to
- the following conditions:
-
- The above copyright notice and this permission notice shall be included
- in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- DEALINGS IN THE SOFTWARE.
- ----------------------------------------------------------------------- */
-
-#define LIBFFI_ASM
-#include <fficonfig.h>
-#include <ffi.h>
-
-#ifdef HAVE_AS_CFI_PSEUDO_OP
-#define CFI_STARTPROC() .cfi_startproc
-#define CFI_OFFSET(reg,off) .cfi_offset reg,off
-#define CFI_DEF_CFA(reg,off) .cfi_def_cfa reg,off
-#define CFI_ENDPROC() .cfi_endproc
-#else
-#define CFI_STARTPROC()
-#define CFI_OFFSET(reg,off)
-#define CFI_DEF_CFA(reg,off)
-#define CFI_ENDPROC()
-#endif
-
-#ifdef __MINT__
-#define CALLFUNC(funcname) _ ## funcname
-#else
-#define CALLFUNC(funcname) funcname
-#endif
-
- .text
-
- .globl CALLFUNC(ffi_call_SYSV)
- .type CALLFUNC(ffi_call_SYSV),@function
- .align 4
-
-CALLFUNC(ffi_call_SYSV):
- CFI_STARTPROC()
- link %fp,#0
- CFI_OFFSET(14,-8)
- CFI_DEF_CFA(14,8)
- move.l %d2,-(%sp)
- CFI_OFFSET(2,-12)
-
- | Make room for all of the new args.
- sub.l 12(%fp),%sp
-
- | Call ffi_prep_args
- move.l 8(%fp),-(%sp)
- pea 4(%sp)
-#if !defined __PIC__
- jsr CALLFUNC(ffi_prep_args)
-#else
- bsr.l CALLFUNC(ffi_prep_args@PLTPC)
-#endif
- addq.l #8,%sp
-
- | Pass pointer to struct value, if any
-#ifdef __MINT__
- move.l %d0,%a1
-#else
- move.l %a0,%a1
-#endif
-
- | Call the function
- move.l 24(%fp),%a0
- jsr (%a0)
-
- | Remove the space we pushed for the args
- add.l 12(%fp),%sp
-
- | Load the pointer to storage for the return value
- move.l 20(%fp),%a1
-
- | Load the return type code
- move.l 16(%fp),%d2
-
- | If the return value pointer is NULL, assume no return value.
- | NOTE: On the mc68000, tst on an address register is not supported.
-#if !defined(__mc68020__) && !defined(__mc68030__) && !defined(__mc68040__) && !defined(__mc68060__) && !defined(__mcoldfire__)
- cmp.w #0, %a1
-#else
- tst.l %a1
-#endif
- jbeq noretval
-
- btst #0,%d2
- jbeq retlongint
- move.l %d0,(%a1)
- jbra epilogue
-
-retlongint:
- btst #1,%d2
- jbeq retfloat
- move.l %d0,(%a1)
- move.l %d1,4(%a1)
- jbra epilogue
-
-retfloat:
- btst #2,%d2
- jbeq retdouble
-#if defined(__MC68881__) || defined(__HAVE_68881__)
- fmove.s %fp0,(%a1)
-#else
- move.l %d0,(%a1)
-#endif
- jbra epilogue
-
-retdouble:
- btst #3,%d2
- jbeq retlongdouble
-#if defined(__MC68881__) || defined(__HAVE_68881__)
- fmove.d %fp0,(%a1)
-#else
- move.l %d0,(%a1)+
- move.l %d1,(%a1)
-#endif
- jbra epilogue
-
-retlongdouble:
- btst #4,%d2
- jbeq retpointer
-#if defined(__MC68881__) || defined(__HAVE_68881__)
- fmove.x %fp0,(%a1)
-#else
- move.l %d0,(%a1)+
- move.l %d1,(%a1)+
- move.l %d2,(%a1)
-#endif
- jbra epilogue
-
-retpointer:
- btst #5,%d2
- jbeq retstruct1
-#ifdef __MINT__
- move.l %d0,(%a1)
-#else
- move.l %a0,(%a1)
-#endif
- jbra epilogue
-
-retstruct1:
- btst #6,%d2
- jbeq retstruct2
- move.b %d0,(%a1)
- jbra epilogue
-
-retstruct2:
- btst #7,%d2
- jbeq retsint8
- move.w %d0,(%a1)
- jbra epilogue
-
-retsint8:
- btst #8,%d2
- jbeq retsint16
- | NOTE: On the mc68000, extb is not supported. 8->16, then 16->32.
-#if !defined(__mc68020__) && !defined(__mc68030__) && !defined(__mc68040__) && !defined(__mc68060__) && !defined(__mcoldfire__)
- ext.w %d0
- ext.l %d0
-#else
- extb.l %d0
-#endif
- move.l %d0,(%a1)
- jbra epilogue
-
-retsint16:
- btst #9,%d2
- jbeq noretval
- ext.l %d0
- move.l %d0,(%a1)
-
-noretval:
-epilogue:
- move.l (%sp)+,%d2
- unlk %fp
- rts
- CFI_ENDPROC()
- .size CALLFUNC(ffi_call_SYSV),.-CALLFUNC(ffi_call_SYSV)
-
- .globl CALLFUNC(ffi_closure_SYSV)
- .type CALLFUNC(ffi_closure_SYSV), @function
- .align 4
-
-CALLFUNC(ffi_closure_SYSV):
- CFI_STARTPROC()
- link %fp,#-12
- CFI_OFFSET(14,-8)
- CFI_DEF_CFA(14,8)
- move.l %sp,-12(%fp)
- pea 8(%fp)
- pea -12(%fp)
- move.l %a0,-(%sp)
-#if !defined __PIC__
- jsr CALLFUNC(ffi_closure_SYSV_inner)
-#else
- bsr.l CALLFUNC(ffi_closure_SYSV_inner@PLTPC)
-#endif
-
- lsr.l #1,%d0
- jne 1f
- jcc .Lcls_epilogue
- | CIF_FLAGS_INT
- move.l -12(%fp),%d0
-.Lcls_epilogue:
- | no CIF_FLAGS_*
- unlk %fp
- rts
-1:
- lea -12(%fp),%a0
- lsr.l #2,%d0
- jne 1f
- jcs .Lcls_ret_float
- | CIF_FLAGS_DINT
- move.l (%a0)+,%d0
- move.l (%a0),%d1
- jra .Lcls_epilogue
-.Lcls_ret_float:
-#if defined(__MC68881__) || defined(__HAVE_68881__)
- fmove.s (%a0),%fp0
-#else
- move.l (%a0),%d0
-#endif
- jra .Lcls_epilogue
-1:
- lsr.l #2,%d0
- jne 1f
- jcs .Lcls_ret_ldouble
- | CIF_FLAGS_DOUBLE
-#if defined(__MC68881__) || defined(__HAVE_68881__)
- fmove.d (%a0),%fp0
-#else
- move.l (%a0)+,%d0
- move.l (%a0),%d1
-#endif
- jra .Lcls_epilogue
-.Lcls_ret_ldouble:
-#if defined(__MC68881__) || defined(__HAVE_68881__)
- fmove.x (%a0),%fp0
-#else
- move.l (%a0)+,%d0
- move.l (%a0)+,%d1
- move.l (%a0),%d2
-#endif
- jra .Lcls_epilogue
-1:
- lsr.l #2,%d0
- jne 1f
- jcs .Lcls_ret_struct1
- | CIF_FLAGS_POINTER
- move.l (%a0),%a0
- move.l %a0,%d0
- jra .Lcls_epilogue
-.Lcls_ret_struct1:
- move.b (%a0),%d0
- jra .Lcls_epilogue
-1:
- lsr.l #2,%d0
- jne 1f
- jcs .Lcls_ret_sint8
- | CIF_FLAGS_STRUCT2
- move.w (%a0),%d0
- jra .Lcls_epilogue
-.Lcls_ret_sint8:
- move.l (%a0),%d0
- | NOTE: On the mc68000, extb is not supported. 8->16, then 16->32.
-#if !defined(__mc68020__) && !defined(__mc68030__) && !defined(__mc68040__) && !defined(__mc68060__) && !defined(__mcoldfire__)
- ext.w %d0
- ext.l %d0
-#else
- extb.l %d0
-#endif
- jra .Lcls_epilogue
-1:
- | CIF_FLAGS_SINT16
- move.l (%a0),%d0
- ext.l %d0
- jra .Lcls_epilogue
- CFI_ENDPROC()
-
- .size CALLFUNC(ffi_closure_SYSV),.-CALLFUNC(ffi_closure_SYSV)
-
- .globl CALLFUNC(ffi_closure_struct_SYSV)
- .type CALLFUNC(ffi_closure_struct_SYSV), @function
- .align 4
-
-CALLFUNC(ffi_closure_struct_SYSV):
- CFI_STARTPROC()
- link %fp,#0
- CFI_OFFSET(14,-8)
- CFI_DEF_CFA(14,8)
- move.l %sp,-12(%fp)
- pea 8(%fp)
- move.l %a1,-(%sp)
- move.l %a0,-(%sp)
-#if !defined __PIC__
- jsr CALLFUNC(ffi_closure_SYSV_inner)
-#else
- bsr.l CALLFUNC(ffi_closure_SYSV_inner@PLTPC)
-#endif
- unlk %fp
- rts
- CFI_ENDPROC()
- .size CALLFUNC(ffi_closure_struct_SYSV),.-CALLFUNC(ffi_closure_struct_SYSV)
-
-#if defined __ELF__ && defined __linux__
- .section .note.GNU-stack,"",@progbits
-#endif
diff --git a/Modules/_ctypes/libffi/src/m88k/ffi.c b/Modules/_ctypes/libffi/src/m88k/ffi.c
deleted file mode 100644
index 68df494955..0000000000
--- a/Modules/_ctypes/libffi/src/m88k/ffi.c
+++ /dev/null
@@ -1,400 +0,0 @@
-/*
- * Copyright (c) 2013 Miodrag Vallat. <miod@openbsd.org>
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- * ``Software''), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
- * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-/*
- * m88k Foreign Function Interface
- *
- * This file attempts to provide all the FFI entry points which can reliably
- * be implemented in C.
- *
- * Only OpenBSD/m88k is currently supported; other platforms (such as
- * Motorola's SysV/m88k) could be supported with the following tweaks:
- *
- * - non-OpenBSD systems use an `outgoing parameter area' as part of the
- * 88BCS calling convention, which is not supported under OpenBSD from
- * release 3.6 onwards. Supporting it should be as easy as taking it
- * into account when adjusting the stack, in the assembly code.
- *
- * - the logic deciding whether a function argument gets passed through
- * registers, or on the stack, has changed several times in OpenBSD in
- * edge cases (especially for structs larger than 32 bytes being passed
- * by value). The code below attemps to match the logic used by the
- * system compiler of OpenBSD 5.3, i.e. gcc 3.3.6 with many m88k backend
- * fixes.
- */
-
-#include <ffi.h>
-#include <ffi_common.h>
-
-#include <stdlib.h>
-#include <unistd.h>
-
-void ffi_call_OBSD (unsigned int, extended_cif *, unsigned int, void *,
- void (*fn) ());
-void *ffi_prep_args (void *, extended_cif *);
-void ffi_closure_OBSD (ffi_closure *);
-void ffi_closure_struct_OBSD (ffi_closure *);
-unsigned int ffi_closure_OBSD_inner (ffi_closure *, void *, unsigned int *,
- char *);
-void ffi_cacheflush_OBSD (unsigned int, unsigned int);
-
-#define CIF_FLAGS_INT (1 << 0)
-#define CIF_FLAGS_DINT (1 << 1)
-
-/*
- * Foreign Function Interface API
- */
-
-/* ffi_prep_args is called by the assembly routine once stack space has
- been allocated for the function's arguments. */
-
-void *
-ffi_prep_args (void *stack, extended_cif *ecif)
-{
- unsigned int i;
- void **p_argv;
- char *argp, *stackp;
- unsigned int *regp;
- unsigned int regused;
- ffi_type **p_arg;
- void *struct_value_ptr;
-
- regp = (unsigned int *)stack;
- stackp = (char *)(regp + 8);
- regused = 0;
-
- if (ecif->cif->rtype->type == FFI_TYPE_STRUCT
- && !ecif->cif->flags)
- struct_value_ptr = ecif->rvalue;
- else
- struct_value_ptr = NULL;
-
- p_argv = ecif->avalue;
-
- for (i = ecif->cif->nargs, p_arg = ecif->cif->arg_types; i != 0; i--, p_arg++)
- {
- size_t z;
- unsigned short t, a;
-
- z = (*p_arg)->size;
- t = (*p_arg)->type;
- a = (*p_arg)->alignment;
-
- /*
- * Figure out whether the argument can be passed through registers
- * or on the stack.
- * The rule is that registers can only receive simple types not larger
- * than 64 bits, or structs the exact size of a register and aligned to
- * the size of a register.
- */
- if (t == FFI_TYPE_STRUCT)
- {
- if (z == sizeof (int) && a == sizeof (int) && regused < 8)
- argp = (char *)regp;
- else
- argp = stackp;
- }
- else
- {
- if (z > sizeof (int) && regused < 8 - 1)
- {
- /* align to an even register pair */
- if (regused & 1)
- {
- regp++;
- regused++;
- }
- }
- if (regused < 8)
- argp = (char *)regp;
- else
- argp = stackp;
- }
-
- /* Enforce proper stack alignment of 64-bit types */
- if (argp == stackp && a > sizeof (int))
- {
- stackp = (char *) ALIGN(stackp, a);
- argp = stackp;
- }
-
- switch (t)
- {
- case FFI_TYPE_SINT8:
- *(signed int *) argp = (signed int) *(SINT8 *) *p_argv;
- break;
-
- case FFI_TYPE_UINT8:
- *(unsigned int *) argp = (unsigned int) *(UINT8 *) *p_argv;
- break;
-
- case FFI_TYPE_SINT16:
- *(signed int *) argp = (signed int) *(SINT16 *) *p_argv;
- break;
-
- case FFI_TYPE_UINT16:
- *(unsigned int *) argp = (unsigned int) *(UINT16 *) *p_argv;
- break;
-
- case FFI_TYPE_INT:
- case FFI_TYPE_FLOAT:
- case FFI_TYPE_UINT32:
- case FFI_TYPE_SINT32:
- case FFI_TYPE_POINTER:
- *(unsigned int *) argp = *(unsigned int *) *p_argv;
- break;
-
- case FFI_TYPE_DOUBLE:
- case FFI_TYPE_UINT64:
- case FFI_TYPE_SINT64:
- case FFI_TYPE_STRUCT:
- memcpy (argp, *p_argv, z);
- break;
-
- default:
- FFI_ASSERT (0);
- }
-
- /* Align if necessary. */
- if ((sizeof (int) - 1) & z)
- z = ALIGN(z, sizeof (int));
-
- p_argv++;
-
- /* Be careful, once all registers are filled, and about to continue
- on stack, regp == stackp. Therefore the check for regused as well. */
- if (argp == (char *)regp && regused < 8)
- {
- regp += z / sizeof (int);
- regused += z / sizeof (int);
- }
- else
- stackp += z;
- }
-
- return struct_value_ptr;
-}
-
-/* Perform machine dependent cif processing */
-ffi_status
-ffi_prep_cif_machdep (ffi_cif *cif)
-{
- /* Set the return type flag */
- switch (cif->rtype->type)
- {
- case FFI_TYPE_VOID:
- cif->flags = 0;
- break;
-
- case FFI_TYPE_STRUCT:
- if (cif->rtype->size == sizeof (int) &&
- cif->rtype->alignment == sizeof (int))
- cif->flags = CIF_FLAGS_INT;
- else
- cif->flags = 0;
- break;
-
- case FFI_TYPE_DOUBLE:
- case FFI_TYPE_SINT64:
- case FFI_TYPE_UINT64:
- cif->flags = CIF_FLAGS_DINT;
- break;
-
- default:
- cif->flags = CIF_FLAGS_INT;
- break;
- }
-
- return FFI_OK;
-}
-
-void
-ffi_call (ffi_cif *cif, void (*fn) (), void *rvalue, void **avalue)
-{
- extended_cif ecif;
-
- ecif.cif = cif;
- ecif.avalue = avalue;
-
- /* If the return value is a struct and we don't have a return value
- address then we need to make one. */
-
- if (rvalue == NULL
- && cif->rtype->type == FFI_TYPE_STRUCT
- && (cif->rtype->size != sizeof (int)
- || cif->rtype->alignment != sizeof (int)))
- ecif.rvalue = alloca (cif->rtype->size);
- else
- ecif.rvalue = rvalue;
-
- switch (cif->abi)
- {
- case FFI_OBSD:
- ffi_call_OBSD (cif->bytes, &ecif, cif->flags, ecif.rvalue, fn);
- break;
-
- default:
- FFI_ASSERT (0);
- break;
- }
-}
-
-/*
- * Closure API
- */
-
-static void
-ffi_prep_closure_args_OBSD (ffi_cif *cif, void **avalue, unsigned int *regp,
- char *stackp)
-{
- unsigned int i;
- void **p_argv;
- char *argp;
- unsigned int regused;
- ffi_type **p_arg;
-
- regused = 0;
-
- p_argv = avalue;
-
- for (i = cif->nargs, p_arg = cif->arg_types; i != 0; i--, p_arg++)
- {
- size_t z;
- unsigned short t, a;
-
- z = (*p_arg)->size;
- t = (*p_arg)->type;
- a = (*p_arg)->alignment;
-
- /*
- * Figure out whether the argument has been passed through registers
- * or on the stack.
- * The rule is that registers can only receive simple types not larger
- * than 64 bits, or structs the exact size of a register and aligned to
- * the size of a register.
- */
- if (t == FFI_TYPE_STRUCT)
- {
- if (z == sizeof (int) && a == sizeof (int) && regused < 8)
- argp = (char *)regp;
- else
- argp = stackp;
- }
- else
- {
- if (z > sizeof (int) && regused < 8 - 1)
- {
- /* align to an even register pair */
- if (regused & 1)
- {
- regp++;
- regused++;
- }
- }
- if (regused < 8)
- argp = (char *)regp;
- else
- argp = stackp;
- }
-
- /* Enforce proper stack alignment of 64-bit types */
- if (argp == stackp && a > sizeof (int))
- {
- stackp = (char *) ALIGN(stackp, a);
- argp = stackp;
- }
-
- if (z < sizeof (int) && t != FFI_TYPE_STRUCT)
- *p_argv = (void *) (argp + sizeof (int) - z);
- else
- *p_argv = (void *) argp;
-
- /* Align if necessary */
- if ((sizeof (int) - 1) & z)
- z = ALIGN(z, sizeof (int));
-
- p_argv++;
-
- /* Be careful, once all registers are exhausted, and about to fetch from
- stack, regp == stackp. Therefore the check for regused as well. */
- if (argp == (char *)regp && regused < 8)
- {
- regp += z / sizeof (int);
- regused += z / sizeof (int);
- }
- else
- stackp += z;
- }
-}
-
-unsigned int
-ffi_closure_OBSD_inner (ffi_closure *closure, void *resp, unsigned int *regp,
- char *stackp)
-{
- ffi_cif *cif;
- void **arg_area;
-
- cif = closure->cif;
- arg_area = (void**) alloca (cif->nargs * sizeof (void *));
-
- ffi_prep_closure_args_OBSD(cif, arg_area, regp, stackp);
-
- (closure->fun) (cif, resp, arg_area, closure->user_data);
-
- return cif->flags;
-}
-
-ffi_status
-ffi_prep_closure_loc (ffi_closure* closure, ffi_cif* cif,
- void (*fun)(ffi_cif*,void*,void**,void*),
- void *user_data, void *codeloc)
-{
- unsigned int *tramp = (unsigned int *) codeloc;
- void *fn;
-
- FFI_ASSERT (cif->abi == FFI_OBSD);
-
- if (cif->rtype->type == FFI_TYPE_STRUCT && !cif->flags)
- fn = &ffi_closure_struct_OBSD;
- else
- fn = &ffi_closure_OBSD;
-
- /* or.u %r10, %r0, %hi16(fn) */
- tramp[0] = 0x5d400000 | (((unsigned int)fn) >> 16);
- /* or.u %r13, %r0, %hi16(closure) */
- tramp[1] = 0x5da00000 | ((unsigned int)closure >> 16);
- /* or %r10, %r10, %lo16(fn) */
- tramp[2] = 0x594a0000 | (((unsigned int)fn) & 0xffff);
- /* jmp.n %r10 */
- tramp[3] = 0xf400c40a;
- /* or %r13, %r13, %lo16(closure) */
- tramp[4] = 0x59ad0000 | ((unsigned int)closure & 0xffff);
-
- ffi_cacheflush_OBSD((unsigned int)codeloc, FFI_TRAMPOLINE_SIZE);
-
- closure->cif = cif;
- closure->user_data = user_data;
- closure->fun = fun;
-
- return FFI_OK;
-}
diff --git a/Modules/_ctypes/libffi/src/m88k/ffitarget.h b/Modules/_ctypes/libffi/src/m88k/ffitarget.h
deleted file mode 100644
index e52bf9fa30..0000000000
--- a/Modules/_ctypes/libffi/src/m88k/ffitarget.h
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Copyright (c) 2013 Miodrag Vallat. <miod@openbsd.org>
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- * ``Software''), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
- * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-/*
- * m88k Foreign Function Interface
- */
-
-#ifndef LIBFFI_TARGET_H
-#define LIBFFI_TARGET_H
-
-#ifndef LIBFFI_ASM
-typedef unsigned long ffi_arg;
-typedef signed long ffi_sarg;
-
-typedef enum ffi_abi {
- FFI_FIRST_ABI = 0,
- FFI_OBSD,
- FFI_DEFAULT_ABI = FFI_OBSD,
- FFI_LAST_ABI = FFI_DEFAULT_ABI + 1
-} ffi_abi;
-#endif
-
-/* ---- Definitions for closures ----------------------------------------- */
-
-#define FFI_CLOSURES 1
-#define FFI_TRAMPOLINE_SIZE 0x14
-#define FFI_NATIVE_RAW_API 0
-
-#endif
diff --git a/Modules/_ctypes/libffi/src/m88k/obsd.S b/Modules/_ctypes/libffi/src/m88k/obsd.S
deleted file mode 100644
index 1944a23de4..0000000000
--- a/Modules/_ctypes/libffi/src/m88k/obsd.S
+++ /dev/null
@@ -1,209 +0,0 @@
-/*
- * Copyright (c) 2013 Miodrag Vallat. <miod@openbsd.org>
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- * ``Software''), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
- * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-/*
- * m88k Foreign Function Interface
- */
-
-#define LIBFFI_ASM
-#include <fficonfig.h>
-#include <ffi.h>
-
- .text
-
-/*
- * ffi_cacheflush_OBSD(unsigned int addr, %r2
- * unsigned int size); %r3
- */
- .align 4
- .globl ffi_cacheflush_OBSD
- .type ffi_cacheflush_OBSD,@function
-ffi_cacheflush_OBSD:
- tb0 0, %r0, 451
- or %r0, %r0, %r0
- jmp %r1
- .size ffi_cacheflush_OBSD, . - ffi_cacheflush_OBSD
-
-/*
- * ffi_call_OBSD(unsigned bytes, %r2
- * extended_cif *ecif, %r3
- * unsigned flags, %r4
- * void *rvalue, %r5
- * void (*fn)()); %r6
- */
- .align 4
- .globl ffi_call_OBSD
- .type ffi_call_OBSD,@function
-ffi_call_OBSD:
- subu %r31, %r31, 32
- st %r30, %r31, 4
- st %r1, %r31, 0
- addu %r30, %r31, 32
-
- | Save the few arguments we'll need after ffi_prep_args()
- st.d %r4, %r31, 8
- st %r6, %r31, 16
-
- | Allocate room for the image of r2-r9, and the stack space for
- | the args (rounded to a 16-byte boundary)
- addu %r2, %r2, (8 * 4) + 15
- clr %r2, %r2, 4<0>
- subu %r31, %r31, %r2
-
- | Fill register and stack image
- or %r2, %r31, %r0
-#ifdef PIC
- bsr ffi_prep_args#plt
-#else
- bsr ffi_prep_args
-#endif
-
- | Save pointer to return struct address, if any
- or %r12, %r2, %r0
-
- | Get function pointer
- subu %r4, %r30, 32
- ld %r1, %r4, 16
-
- | Fetch the register arguments
- ld.d %r2, %r31, (0 * 4)
- ld.d %r4, %r31, (2 * 4)
- ld.d %r6, %r31, (4 * 4)
- ld.d %r8, %r31, (6 * 4)
- addu %r31, %r31, (8 * 4)
-
- | Invoke the function
- jsr %r1
-
- | Restore stack now that we don't need the args anymore
- subu %r31, %r30, 32
-
- | Figure out what to return as the function's return value
- ld %r5, %r31, 12 | rvalue
- ld %r4, %r31, 8 | flags
-
- bcnd eq0, %r5, 9f
-
- bb0 0, %r4, 1f | CIF_FLAGS_INT
- st %r2, %r5, 0
- br 9f
-
-1:
- bb0 1, %r4, 1f | CIF_FLAGS_DINT
- st.d %r2, %r5, 0
- br 9f
-
-1:
-9:
- ld %r1, %r31, 0
- ld %r30, %r31, 4
- jmp.n %r1
- addu %r31, %r31, 32
- .size ffi_call_OBSD, . - ffi_call_OBSD
-
-/*
- * ffi_closure_OBSD(ffi_closure *closure); %r13
- */
- .align 4
- .globl ffi_closure_OBSD
- .type ffi_closure_OBSD, @function
-ffi_closure_OBSD:
- subu %r31, %r31, 16
- st %r30, %r31, 4
- st %r1, %r31, 0
- addu %r30, %r31, 16
-
- | Make room on the stack for saved register arguments and return
- | value
- subu %r31, %r31, (8 * 4) + (2 * 4)
- st.d %r2, %r31, (0 * 4)
- st.d %r4, %r31, (2 * 4)
- st.d %r6, %r31, (4 * 4)
- st.d %r8, %r31, (6 * 4)
-
- | Invoke the closure function
- or %r5, %r30, 0 | calling stack
- addu %r4, %r31, 0 | saved registers
- addu %r3, %r31, (8 * 4) | return value
- or %r2, %r13, %r0 | closure
-#ifdef PIC
- bsr ffi_closure_OBSD_inner#plt
-#else
- bsr ffi_closure_OBSD_inner
-#endif
-
- | Figure out what to return as the function's return value
- bb0 0, %r2, 1f | CIF_FLAGS_INT
- ld %r2, %r31, (8 * 4)
- br 9f
-
-1:
- bb0 1, %r2, 1f | CIF_FLAGS_DINT
- ld.d %r2, %r31, (8 * 4)
- br 9f
-
-1:
-9:
- subu %r31, %r30, 16
- ld %r1, %r31, 0
- ld %r30, %r31, 4
- jmp.n %r1
- addu %r31, %r31, 16
- .size ffi_closure_OBSD,.-ffi_closure_OBSD
-
-/*
- * ffi_closure_struct_OBSD(ffi_closure *closure); %r13
- */
- .align 4
- .globl ffi_closure_struct_OBSD
- .type ffi_closure_struct_OBSD, @function
-ffi_closure_struct_OBSD:
- subu %r31, %r31, 16
- st %r30, %r31, 4
- st %r1, %r31, 0
- addu %r30, %r31, 16
-
- | Make room on the stack for saved register arguments
- subu %r31, %r31, (8 * 4)
- st.d %r2, %r31, (0 * 4)
- st.d %r4, %r31, (2 * 4)
- st.d %r6, %r31, (4 * 4)
- st.d %r8, %r31, (6 * 4)
-
- | Invoke the closure function
- or %r5, %r30, 0 | calling stack
- addu %r4, %r31, 0 | saved registers
- or %r3, %r12, 0 | return value
- or %r2, %r13, %r0 | closure
-#ifdef PIC
- bsr ffi_closure_OBSD_inner#plt
-#else
- bsr ffi_closure_OBSD_inner
-#endif
-
- subu %r31, %r30, 16
- ld %r1, %r31, 0
- ld %r30, %r31, 4
- jmp.n %r1
- addu %r31, %r31, 16
- .size ffi_closure_struct_OBSD,.-ffi_closure_struct_OBSD
diff --git a/Modules/_ctypes/libffi/src/metag/ffi.c b/Modules/_ctypes/libffi/src/metag/ffi.c
deleted file mode 100644
index 46b383e7a3..0000000000
--- a/Modules/_ctypes/libffi/src/metag/ffi.c
+++ /dev/null
@@ -1,330 +0,0 @@
-/* ----------------------------------------------------------------------
- ffi.c - Copyright (c) 2013 Imagination Technologies
-
- Meta Foreign Function Interface
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- `Software''), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to
- permit persons to whom the Software is furnished to do so, subject to
- the following conditions:
-
- The above copyright notice and this permission notice shall be included
- in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED `AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS
- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- IN NO EVENT SHALL SIMON POSNJAK BE LIABLE FOR ANY CLAIM, DAMAGES OR
- OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- OTHER DEALINGS IN THE SOFTWARE.
------------------------------------------------------------------------ */
-
-#include <ffi.h>
-#include <ffi_common.h>
-
-#include <stdlib.h>
-
-#define MIN(a,b) (((a) < (b)) ? (a) : (b))
-
-/*
- * ffi_prep_args is called by the assembly routine once stack space has been
- * allocated for the function's arguments
- */
-
-unsigned int ffi_prep_args(char *stack, extended_cif *ecif)
-{
- register unsigned int i;
- register void **p_argv;
- register char *argp;
- register ffi_type **p_arg;
-
- argp = stack;
-
- /* Store return value */
- if ( ecif->cif->flags == FFI_TYPE_STRUCT ) {
- argp -= 4;
- *(void **) argp = ecif->rvalue;
- }
-
- p_argv = ecif->avalue;
-
- /* point to next location */
- for (i = ecif->cif->nargs, p_arg = ecif->cif->arg_types; (i != 0); i--, p_arg++, p_argv++)
- {
- size_t z;
-
- /* Move argp to address of argument */
- z = (*p_arg)->size;
- argp -= z;
-
- /* Align if necessary */
- argp = (char *) ALIGN_DOWN(ALIGN_DOWN(argp, (*p_arg)->alignment), 4);
-
- if (z < sizeof(int)) {
- z = sizeof(int);
- switch ((*p_arg)->type)
- {
- case FFI_TYPE_SINT8:
- *(signed int *) argp = (signed int)*(SINT8 *)(* p_argv);
- break;
- case FFI_TYPE_UINT8:
- *(unsigned int *) argp = (unsigned int)*(UINT8 *)(* p_argv);
- break;
- case FFI_TYPE_SINT16:
- *(signed int *) argp = (signed int)*(SINT16 *)(* p_argv);
- break;
- case FFI_TYPE_UINT16:
- *(unsigned int *) argp = (unsigned int)*(UINT16 *)(* p_argv);
- case FFI_TYPE_STRUCT:
- memcpy(argp, *p_argv, (*p_arg)->size);
- break;
- default:
- FFI_ASSERT(0);
- }
- } else if ( z == sizeof(int)) {
- *(unsigned int *) argp = (unsigned int)*(UINT32 *)(* p_argv);
- } else {
- memcpy(argp, *p_argv, z);
- }
- }
-
- /* return the size of the arguments to be passed in registers,
- padded to an 8 byte boundary to preserve stack alignment */
- return ALIGN(MIN(stack - argp, 6*4), 8);
-}
-
-/* Perform machine dependent cif processing */
-ffi_status ffi_prep_cif_machdep(ffi_cif *cif)
-{
- ffi_type **ptr;
- unsigned i, bytes = 0;
-
- for (ptr = cif->arg_types, i = cif->nargs; i > 0; i--, ptr++) {
- if ((*ptr)->size == 0)
- return FFI_BAD_TYPEDEF;
-
- /* Perform a sanity check on the argument type, do this
- check after the initialization. */
- FFI_ASSERT_VALID_TYPE(*ptr);
-
- /* Add any padding if necessary */
- if (((*ptr)->alignment - 1) & bytes)
- bytes = ALIGN(bytes, (*ptr)->alignment);
-
- bytes += ALIGN((*ptr)->size, 4);
- }
-
- /* Ensure arg space is aligned to an 8-byte boundary */
- bytes = ALIGN(bytes, 8);
-
- /* Make space for the return structure pointer */
- if (cif->rtype->type == FFI_TYPE_STRUCT) {
- bytes += sizeof(void*);
-
- /* Ensure stack is aligned to an 8-byte boundary */
- bytes = ALIGN(bytes, 8);
- }
-
- cif->bytes = bytes;
-
- /* Set the return type flag */
- switch (cif->rtype->type) {
- case FFI_TYPE_VOID:
- case FFI_TYPE_FLOAT:
- case FFI_TYPE_DOUBLE:
- cif->flags = (unsigned) cif->rtype->type;
- break;
- case FFI_TYPE_SINT64:
- case FFI_TYPE_UINT64:
- cif->flags = (unsigned) FFI_TYPE_SINT64;
- break;
- case FFI_TYPE_STRUCT:
- /* Meta can store return values which are <= 64 bits */
- if (cif->rtype->size <= 4)
- /* Returned to D0Re0 as 32-bit value */
- cif->flags = (unsigned)FFI_TYPE_INT;
- else if ((cif->rtype->size > 4) && (cif->rtype->size <= 8))
- /* Returned valued is stored to D1Re0|R0Re0 */
- cif->flags = (unsigned)FFI_TYPE_DOUBLE;
- else
- /* value stored in memory */
- cif->flags = (unsigned)FFI_TYPE_STRUCT;
- break;
- default:
- cif->flags = (unsigned)FFI_TYPE_INT;
- break;
- }
- return FFI_OK;
-}
-
-extern void ffi_call_SYSV(void (*fn)(void), extended_cif *, unsigned, unsigned, double *);
-
-/*
- * Exported in API. Entry point
- * cif -> ffi_cif object
- * fn -> function pointer
- * rvalue -> pointer to return value
- * avalue -> vector of void * pointers pointing to memory locations holding the
- * arguments
- */
-void ffi_call(ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue)
-{
- extended_cif ecif;
-
- int small_struct = (((cif->flags == FFI_TYPE_INT) || (cif->flags == FFI_TYPE_DOUBLE)) && (cif->rtype->type == FFI_TYPE_STRUCT));
- ecif.cif = cif;
- ecif.avalue = avalue;
-
- double temp;
-
- /*
- * If the return value is a struct and we don't have a return value address
- * then we need to make one
- */
-
- if ((rvalue == NULL ) && (cif->flags == FFI_TYPE_STRUCT))
- ecif.rvalue = alloca(cif->rtype->size);
- else if (small_struct)
- ecif.rvalue = &temp;
- else
- ecif.rvalue = rvalue;
-
- switch (cif->abi) {
- case FFI_SYSV:
- ffi_call_SYSV(fn, &ecif, cif->bytes, cif->flags, ecif.rvalue);
- break;
- default:
- FFI_ASSERT(0);
- break;
- }
-
- if (small_struct)
- memcpy (rvalue, &temp, cif->rtype->size);
-}
-
-/* private members */
-
-static void ffi_prep_incoming_args_SYSV (char *, void **, void **,
- ffi_cif*, float *);
-
-void ffi_closure_SYSV (ffi_closure *);
-
-/* Do NOT change that without changing the FFI_TRAMPOLINE_SIZE */
-extern unsigned int ffi_metag_trampoline[10]; /* 10 instructions */
-
-/* end of private members */
-
-/*
- * __tramp: trampoline memory location
- * __fun: assembly routine
- * __ctx: memory location for wrapper
- *
- * At this point, tramp[0] == __ctx !
- */
-void ffi_init_trampoline(unsigned char *__tramp, unsigned int __fun, unsigned int __ctx) {
- memcpy (__tramp, ffi_metag_trampoline, sizeof(ffi_metag_trampoline));
- *(unsigned int*) &__tramp[40] = __ctx;
- *(unsigned int*) &__tramp[44] = __fun;
- /* This will flush the instruction cache */
- __builtin_meta2_cachewd(&__tramp[0], 1);
- __builtin_meta2_cachewd(&__tramp[47], 1);
-}
-
-
-
-/* the cif must already be prepared */
-
-ffi_status
-ffi_prep_closure_loc (ffi_closure *closure,
- ffi_cif* cif,
- void (*fun)(ffi_cif*,void*,void**,void*),
- void *user_data,
- void *codeloc)
-{
- void (*closure_func)(ffi_closure*) = NULL;
-
- if (cif->abi == FFI_SYSV)
- closure_func = &ffi_closure_SYSV;
- else
- return FFI_BAD_ABI;
-
- ffi_init_trampoline(
- (unsigned char*)&closure->tramp[0],
- (unsigned int)closure_func,
- (unsigned int)codeloc);
-
- closure->cif = cif;
- closure->user_data = user_data;
- closure->fun = fun;
-
- return FFI_OK;
-}
-
-
-/* This function is jumped to by the trampoline */
-unsigned int ffi_closure_SYSV_inner (closure, respp, args, vfp_args)
- ffi_closure *closure;
- void **respp;
- void *args;
- void *vfp_args;
-{
- ffi_cif *cif;
- void **arg_area;
-
- cif = closure->cif;
- arg_area = (void**) alloca (cif->nargs * sizeof (void*));
-
- /*
- * This call will initialize ARG_AREA, such that each
- * element in that array points to the corresponding
- * value on the stack; and if the function returns
- * a structure, it will re-set RESP to point to the
- * structure return address.
- */
- ffi_prep_incoming_args_SYSV(args, respp, arg_area, cif, vfp_args);
-
- (closure->fun) ( cif, *respp, arg_area, closure->user_data);
-
- return cif->flags;
-}
-
-static void ffi_prep_incoming_args_SYSV(char *stack, void **rvalue,
- void **avalue, ffi_cif *cif,
- float *vfp_stack)
-{
- register unsigned int i;
- register void **p_argv;
- register char *argp;
- register ffi_type **p_arg;
-
- /* stack points to original arguments */
- argp = stack;
-
- /* Store return value */
- if ( cif->flags == FFI_TYPE_STRUCT ) {
- argp -= 4;
- *rvalue = *(void **) argp;
- }
-
- p_argv = avalue;
-
- for (i = cif->nargs, p_arg = cif->arg_types; (i != 0); i--, p_arg++) {
- size_t z;
- size_t alignment;
-
- alignment = (*p_arg)->alignment;
- if (alignment < 4)
- alignment = 4;
- if ((alignment - 1) & (unsigned)argp)
- argp = (char *) ALIGN(argp, alignment);
-
- z = (*p_arg)->size;
- *p_argv = (void*) argp;
- p_argv++;
- argp -= z;
- }
- return;
-}
diff --git a/Modules/_ctypes/libffi/src/metag/ffitarget.h b/Modules/_ctypes/libffi/src/metag/ffitarget.h
deleted file mode 100644
index 7b9dbebca8..0000000000
--- a/Modules/_ctypes/libffi/src/metag/ffitarget.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/* -----------------------------------------------------------------*-C-*-
- ffitarget.h - Copyright (c) 2013 Imagination Technologies Ltd.
- Target configuration macros for Meta
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- ``Software''), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to
- permit persons to whom the Software is furnished to do so, subject to
- the following conditions:
-
- The above copyright notice and this permission notice shall be included
- in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- DEALINGS IN THE SOFTWARE.
-
- ----------------------------------------------------------------------- */
-
-#ifndef LIBFFI_TARGET_H
-#define LIBFFI_TARGET_H
-
-#ifndef LIBFFI_H
-#error "Please do not include ffitarget.h directly into your source. Use ffi.h instead."
-#endif
-
-#ifndef LIBFFI_ASM
-typedef unsigned long ffi_arg;
-typedef signed long ffi_sarg;
-
-typedef enum ffi_abi {
- FFI_FIRST_ABI = 0,
- FFI_SYSV,
- FFI_DEFAULT_ABI = FFI_SYSV,
- FFI_LAST_ABI = FFI_DEFAULT_ABI + 1,
-} ffi_abi;
-#endif
-
-/* ---- Definitions for closures ----------------------------------------- */
-
-#define FFI_CLOSURES 1
-#define FFI_TRAMPOLINE_SIZE 48
-#define FFI_NATIVE_RAW_API 0
-
-#endif
-
diff --git a/Modules/_ctypes/libffi/src/metag/sysv.S b/Modules/_ctypes/libffi/src/metag/sysv.S
deleted file mode 100644
index b4b2a3b26b..0000000000
--- a/Modules/_ctypes/libffi/src/metag/sysv.S
+++ /dev/null
@@ -1,311 +0,0 @@
-/* -----------------------------------------------------------------------
- sysv.S - Copyright (c) 2013 Imagination Technologies Ltd.
-
- Meta Foreign Function Interface
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- ``Software''), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to
- permit persons to whom the Software is furnished to do so, subject to
- the following conditions:
-
- The above copyright notice and this permission notice shall be included
- in all copies or substantial portions of the Software.
-
-
- THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- DEALINGS IN THE SOFTWARE.
- ----------------------------------------------------------------------- */
-
-#define LIBFFI_ASM
-#include <fficonfig.h>
-#include <ffi.h>
-#ifdef HAVE_MACHINE_ASM_H
-#include <machine/asm.h>
-#else
-#ifdef __USER_LABEL_PREFIX__
-#define CONCAT1(a, b) CONCAT2(a, b)
-#define CONCAT2(a, b) a ## b
-
-/* Use the right prefix for global labels. */
-#define CNAME(x) CONCAT1 (__USER_LABEL_PREFIX__, x)
-#else
-#define CNAME(x) x
-#endif
-#define ENTRY(x) .globl CNAME(x); .type CNAME(x), %function; CNAME(x):
-#endif
-
-#ifdef __ELF__
-#define LSYM(x) .x
-#else
-#define LSYM(x) x
-#endif
-
-.macro call_reg x=
- .text
- .balign 4
- mov D1RtP, \x
- swap D1RtP, PC
-.endm
-
-! Save register arguments
-.macro SAVE_ARGS
- .text
- .balign 4
- setl [A0StP++], D0Ar6, D1Ar5
- setl [A0StP++], D0Ar4, D1Ar3
- setl [A0StP++], D0Ar2, D1Ar1
-.endm
-
-! Save retrun, frame pointer and other regs
-.macro SAVE_REGS regs=
- .text
- .balign 4
- setl [A0StP++], D0FrT, D1RtP
- ! Needs to be a pair of regs
- .ifnc "\regs",""
- setl [A0StP++], \regs
- .endif
-.endm
-
-! Declare a global function
-.macro METAG_FUNC_START name
- .text
- .balign 4
- ENTRY(\name)
-.endm
-
-! Return registers from the stack. Reverse SAVE_REGS operation
-.macro RET_REGS regs=, cond=
- .ifnc "\regs", ""
- getl \regs, [--A0StP]
- .endif
- getl D0FrT, D1RtP, [--A0StP]
-.endm
-
-! Return arguments
-.macro RET_ARGS
- getl D0Ar2, D1Ar1, [--A0StP]
- getl D0Ar4, D1Ar3, [--A0StP]
- getl D0Ar6, D1Ar5, [--A0StP]
-.endm
-
-
- ! D1Ar1: fn
- ! D0Ar2: &ecif
- ! D1Ar3: cif->bytes
- ! D0Ar4: fig->flags
- ! D1Ar5: ecif.rvalue
-
- ! This assumes we are using GNU as
-METAG_FUNC_START ffi_call_SYSV
- ! Save argument registers
-
- SAVE_ARGS
-
- ! new frame
- mov D0FrT, A0FrP
- add A0FrP, A0StP, #0
-
- ! Preserve the old frame pointer
- SAVE_REGS "D1.5, D0.5"
-
- ! Make room for new args. cifs->bytes is the total space for input
- ! and return arguments
-
- add A0StP, A0StP, D1Ar3
-
- ! Preserve cifs->bytes & fn
- mov D0.5, D1Ar3
- mov D1.5, D1Ar1
-
- ! Place all of the ffi_prep_args in position
- mov D1Ar1, A0StP
-
- ! Call ffi_prep_args(stack, &ecif)
-#ifdef __PIC__
- callr D1RtP, CNAME(ffi_prep_args@PLT)
-#else
- callr D1RtP, CNAME(ffi_prep_args)
-#endif
-
- ! Restore fn pointer
-
- ! The foreign stack should look like this
- ! XXXXX XXXXXX <--- stack pointer
- ! FnArgN rvalue
- ! FnArgN+2 FnArgN+1
- ! FnArgN+4 FnArgN+3
- ! ....
- !
-
- ! A0StP now points to the first (or return) argument + 4
-
- ! Preserve cif->bytes
- getl D0Ar2, D1Ar1, [--A0StP]
- getl D0Ar4, D1Ar3, [--A0StP]
- getl D0Ar6, D1Ar5, [--A0StP]
-
- ! Place A0StP to the first argument again
- add A0StP, A0StP, #24 ! That's because we loaded 6 regs x 4 byte each
-
- ! A0FrP points to the initial stack without the reserved space for the
- ! cifs->bytes, whilst A0StP points to the stack after the space allocation
-
- ! fn was the first argument of ffi_call_SYSV.
- ! The stack at this point looks like this:
- !
- ! A0StP(on entry to _SYSV) -> Arg6 Arg5 | low
- ! Arg4 Arg3 |
- ! Arg2 Arg1 |
- ! A0FrP ----> D0FrtP D1RtP |
- ! D1.5 D0.5 |
- ! A0StP(bf prep_args) -> FnArgn FnArgn-1 |
- ! FnArgn-2FnArgn-3 |
- ! ................ | <= cifs->bytes
- ! FnArg4 FnArg3 |
- ! A0StP (prv_A0StP+cifs->bytes) FnArg2 FnArg1 | high
- !
- ! fn was in Arg1 so it's located in in A0FrP+#-0xC
- !
-
- ! D0Re0 contains the size of arguments stored in registers
- sub A0StP, A0StP, D0Re0
-
- ! Arg1 is the function pointer for the foreign call. This has been
- ! preserved in D1.5
-
- ! Time to call (fn). Arguments should be like this:
- ! Arg1-Arg6 are loaded to regs
- ! The rest of the arguments are stored in stack pointed by A0StP
-
- call_reg D1.5
-
- ! Reset stack.
-
- mov A0StP, A0FrP
-
- ! Load Arg1 with the pointer to storage for the return type
- ! This was stored in Arg5
-
- getd D1Ar1, [A0FrP+#-20]
-
- ! Load D0Ar2 with the return type code. This was stored in Arg4 (flags)
-
- getd D0Ar2, [A0FrP+#-16]
-
- ! We are ready to start processing the return value
- ! D0Re0 (and D1Re0) hold the return value
-
- ! If the return value is NULL, assume no return value
- cmp D1Ar1, #0
- beq LSYM(Lepilogue)
-
- ! return INT
- cmp D0Ar2, #FFI_TYPE_INT
- ! Sadly, there is no setd{cc} instruction so we need to workaround that
- bne .INT64
- setd [D1Ar1], D0Re0
- b LSYM(Lepilogue)
-
- ! return INT64
-.INT64:
- cmp D0Ar2, #FFI_TYPE_SINT64
- setleq [D1Ar1], D0Re0, D1Re0
-
- ! return DOUBLE
- cmp D0Ar2, #FFI_TYPE_DOUBLE
- setl [D1AR1++], D0Re0, D1Re0
-
-LSYM(Lepilogue):
- ! At this point, the stack pointer points right after the argument
- ! saved area. We need to restore 4 regs, therefore we need to move
- ! 16 bytes ahead.
- add A0StP, A0StP, #16
- RET_REGS "D1.5, D0.5"
- RET_ARGS
- getd D0Re0, [A0StP]
- mov A0FrP, D0FrT
- swap D1RtP, PC
-
-.ffi_call_SYSV_end:
- .size CNAME(ffi_call_SYSV),.ffi_call_SYSV_end-CNAME(ffi_call_SYSV)
-
-
-/*
- (called by ffi_metag_trampoline)
- void ffi_closure_SYSV (ffi_closure*)
-
- (called by ffi_closure_SYSV)
- unsigned int FFI_HIDDEN
- ffi_closure_SYSV_inner (closure,respp, args)
- ffi_closure *closure;
- void **respp;
- void *args;
-*/
-
-METAG_FUNC_START ffi_closure_SYSV
- ! We assume that D1Ar1 holds the address of the
- ! ffi_closure struct. We will use that to fetch the
- ! arguments. The stack pointer points to an empty space
- ! and it is ready to store more data.
-
- ! D1Ar1 is ready
- ! Allocate stack space for return value
- add A0StP, A0StP, #8
- ! Store it to D0Ar2
- sub D0Ar2, A0StP, #8
-
- sub D1Ar3, A0FrP, #4
-
- ! D1Ar3 contains the address of the original D1Ar1 argument
- ! We need to subtract #4 later on
-
- ! Preverve D0Ar2
- mov D0.5, D0Ar2
-
-#ifdef __PIC__
- callr D1RtP, CNAME(ffi_closure_SYSV_inner@PLT)
-#else
- callr D1RtP, CNAME(ffi_closure_SYSV_inner)
-#endif
-
- ! Check the return value and store it to D0.5
- cmp D0Re0, #FFI_TYPE_INT
- beq .Lretint
- cmp D0Re0, #FFI_TYPE_DOUBLE
- beq .Lretdouble
-.Lclosure_epilogue:
- sub A0StP, A0StP, #8
- RET_REGS "D1.5, D0.5"
- RET_ARGS
- swap D1RtP, PC
-
-.Lretint:
- setd [D0.5], D0Re0
- b .Lclosure_epilogue
-.Lretdouble:
- setl [D0.5++], D0Re0, D1Re0
- b .Lclosure_epilogue
-.ffi_closure_SYSV_end:
-.size CNAME(ffi_closure_SYSV),.ffi_closure_SYSV_end-CNAME(ffi_closure_SYSV)
-
-
-ENTRY(ffi_metag_trampoline)
- SAVE_ARGS
- ! New frame
- mov A0FrP, A0StP
- SAVE_REGS "D1.5, D0.5"
- mov D0.5, PC
- ! Load D1Ar1 the value of ffi_metag_trampoline
- getd D1Ar1, [D0.5 + #8]
- ! Jump to ffi_closure_SYSV
- getd PC, [D0.5 + #12]
diff --git a/Modules/_ctypes/libffi/src/microblaze/ffi.c b/Modules/_ctypes/libffi/src/microblaze/ffi.c
deleted file mode 100644
index ea962ea483..0000000000
--- a/Modules/_ctypes/libffi/src/microblaze/ffi.c
+++ /dev/null
@@ -1,321 +0,0 @@
-/* -----------------------------------------------------------------------
- ffi.c - Copyright (c) 2012, 2013 Xilinx, Inc
-
- MicroBlaze Foreign Function Interface
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- ``Software''), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to
- permit persons to whom the Software is furnished to do so, subject to
- the following conditions:
-
- The above copyright notice and this permission notice shall be included
- in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- DEALINGS IN THE SOFTWARE.
- ----------------------------------------------------------------------- */
-
-#include <ffi.h>
-#include <ffi_common.h>
-
-extern void ffi_call_SYSV(void (*)(void*, extended_cif*), extended_cif*,
- unsigned int, unsigned int, unsigned int*, void (*fn)(void),
- unsigned int, unsigned int);
-
-extern void ffi_closure_SYSV(void);
-
-#define WORD_SIZE sizeof(unsigned int)
-#define ARGS_REGISTER_SIZE (WORD_SIZE * 6)
-#define WORD_ALIGN(x) ALIGN(x, WORD_SIZE)
-
-/* ffi_prep_args is called by the assembly routine once stack space
- has been allocated for the function's arguments */
-void ffi_prep_args(void* stack, extended_cif* ecif)
-{
- unsigned int i;
- ffi_type** p_arg;
- void** p_argv;
- void* stack_args_p = stack;
-
- p_argv = ecif->avalue;
-
- if (ecif == NULL || ecif->cif == NULL) {
- return; /* no description to prepare */
- }
-
- if ((ecif->cif->rtype != NULL) &&
- (ecif->cif->rtype->type == FFI_TYPE_STRUCT))
- {
- /* if return type is a struct which is referenced on the stack/reg5,
- * by a pointer. Stored the return value pointer in r5.
- */
- char* addr = stack_args_p;
- memcpy(addr, &(ecif->rvalue), WORD_SIZE);
- stack_args_p += WORD_SIZE;
- }
-
- if (ecif->avalue == NULL) {
- return; /* no arguments to prepare */
- }
-
- for (i = 0, p_arg = ecif->cif->arg_types; i < ecif->cif->nargs;
- i++, p_arg++)
- {
- size_t size = (*p_arg)->size;
- int type = (*p_arg)->type;
- void* value = p_argv[i];
- char* addr = stack_args_p;
- int aligned_size = WORD_ALIGN(size);
-
- /* force word alignment on the stack */
- stack_args_p += aligned_size;
-
- switch (type)
- {
- case FFI_TYPE_UINT8:
- *(unsigned int *)addr = (unsigned int)*(UINT8*)(value);
- break;
- case FFI_TYPE_SINT8:
- *(signed int *)addr = (signed int)*(SINT8*)(value);
- break;
- case FFI_TYPE_UINT16:
- *(unsigned int *)addr = (unsigned int)*(UINT16*)(value);
- break;
- case FFI_TYPE_SINT16:
- *(signed int *)addr = (signed int)*(SINT16*)(value);
- break;
- case FFI_TYPE_STRUCT:
-#if __BIG_ENDIAN__
- /*
- * MicroBlaze toolchain appears to emit:
- * bsrli r5, r5, 8 (caller)
- * ...
- * <branch to callee>
- * ...
- * bslli r5, r5, 8 (callee)
- *
- * For structs like "struct a { uint8_t a[3]; };", when passed
- * by value.
- *
- * Structs like "struct b { uint16_t a; };" are also expected
- * to be packed strangely in registers.
- *
- * This appears to be because the microblaze toolchain expects
- * "struct b == uint16_t", which is only any issue for big
- * endian.
- *
- * The following is a work around for big-endian only, for the
- * above mentioned case, it will re-align the contents of a
- * <= 3-byte struct value.
- */
- if (size < WORD_SIZE)
- {
- memcpy (addr + (WORD_SIZE - size), value, size);
- break;
- }
-#endif
- case FFI_TYPE_SINT32:
- case FFI_TYPE_UINT32:
- case FFI_TYPE_FLOAT:
- case FFI_TYPE_SINT64:
- case FFI_TYPE_UINT64:
- case FFI_TYPE_DOUBLE:
- default:
- memcpy(addr, value, aligned_size);
- }
- }
-}
-
-ffi_status ffi_prep_cif_machdep(ffi_cif* cif)
-{
- /* check ABI */
- switch (cif->abi)
- {
- case FFI_SYSV:
- break;
- default:
- return FFI_BAD_ABI;
- }
- return FFI_OK;
-}
-
-void ffi_call(ffi_cif* cif, void (*fn)(void), void* rvalue, void** avalue)
-{
- extended_cif ecif;
- ecif.cif = cif;
- ecif.avalue = avalue;
-
- /* If the return value is a struct and we don't have a return */
- /* value address then we need to make one */
- if ((rvalue == NULL) && (cif->rtype->type == FFI_TYPE_STRUCT)) {
- ecif.rvalue = alloca(cif->rtype->size);
- } else {
- ecif.rvalue = rvalue;
- }
-
- switch (cif->abi)
- {
- case FFI_SYSV:
- ffi_call_SYSV(ffi_prep_args, &ecif, cif->bytes, cif->flags,
- ecif.rvalue, fn, cif->rtype->type, cif->rtype->size);
- break;
- default:
- FFI_ASSERT(0);
- break;
- }
-}
-
-void ffi_closure_call_SYSV(void* register_args, void* stack_args,
- ffi_closure* closure, void* rvalue,
- unsigned int* rtype, unsigned int* rsize)
-{
- /* prepare arguments for closure call */
- ffi_cif* cif = closure->cif;
- ffi_type** arg_types = cif->arg_types;
-
- /* re-allocate data for the args. This needs to be done in order to keep
- * multi-word objects (e.g. structs) in contiguous memory. Callers are not
- * required to store the value of args in the lower 6 words in the stack
- * (although they are allocated in the stack).
- */
- char* stackclone = alloca(cif->bytes);
- void** avalue = alloca(cif->nargs * sizeof(void*));
- void* struct_rvalue = NULL;
- char* ptr = stackclone;
- int i;
-
- /* copy registers into stack clone */
- int registers_used = cif->bytes;
- if (registers_used > ARGS_REGISTER_SIZE) {
- registers_used = ARGS_REGISTER_SIZE;
- }
- memcpy(stackclone, register_args, registers_used);
-
- /* copy stack allocated args into stack clone */
- if (cif->bytes > ARGS_REGISTER_SIZE) {
- int stack_used = cif->bytes - ARGS_REGISTER_SIZE;
- memcpy(stackclone + ARGS_REGISTER_SIZE, stack_args, stack_used);
- }
-
- /* preserve struct type return pointer passing */
- if ((cif->rtype != NULL) && (cif->rtype->type == FFI_TYPE_STRUCT)) {
- struct_rvalue = *((void**)ptr);
- ptr += WORD_SIZE;
- }
-
- /* populate arg pointer list */
- for (i = 0; i < cif->nargs; i++)
- {
- switch (arg_types[i]->type)
- {
- case FFI_TYPE_SINT8:
- case FFI_TYPE_UINT8:
-#ifdef __BIG_ENDIAN__
- avalue[i] = ptr + 3;
-#else
- avalue[i] = ptr;
-#endif
- break;
- case FFI_TYPE_SINT16:
- case FFI_TYPE_UINT16:
-#ifdef __BIG_ENDIAN__
- avalue[i] = ptr + 2;
-#else
- avalue[i] = ptr;
-#endif
- break;
- case FFI_TYPE_STRUCT:
-#if __BIG_ENDIAN__
- /*
- * Work around strange ABI behaviour.
- * (see info in ffi_prep_args)
- */
- if (arg_types[i]->size < WORD_SIZE)
- {
- memcpy (ptr, ptr + (WORD_SIZE - arg_types[i]->size), arg_types[i]->size);
- }
-#endif
- avalue[i] = (void*)ptr;
- break;
- case FFI_TYPE_UINT64:
- case FFI_TYPE_SINT64:
- case FFI_TYPE_DOUBLE:
- avalue[i] = ptr;
- break;
- case FFI_TYPE_SINT32:
- case FFI_TYPE_UINT32:
- case FFI_TYPE_FLOAT:
- default:
- /* default 4-byte argument */
- avalue[i] = ptr;
- break;
- }
- ptr += WORD_ALIGN(arg_types[i]->size);
- }
-
- /* set the return type info passed back to the wrapper */
- *rsize = cif->rtype->size;
- *rtype = cif->rtype->type;
- if (struct_rvalue != NULL) {
- closure->fun(cif, struct_rvalue, avalue, closure->user_data);
- /* copy struct return pointer value into function return value */
- *((void**)rvalue) = struct_rvalue;
- } else {
- closure->fun(cif, rvalue, avalue, closure->user_data);
- }
-}
-
-ffi_status ffi_prep_closure_loc(
- ffi_closure* closure, ffi_cif* cif,
- void (*fun)(ffi_cif*, void*, void**, void*),
- void* user_data, void* codeloc)
-{
- unsigned long* tramp = (unsigned long*)&(closure->tramp[0]);
- unsigned long cls = (unsigned long)codeloc;
- unsigned long fn = 0;
- unsigned long fn_closure_call_sysv = (unsigned long)ffi_closure_call_SYSV;
-
- closure->cif = cif;
- closure->fun = fun;
- closure->user_data = user_data;
-
- switch (cif->abi)
- {
- case FFI_SYSV:
- fn = (unsigned long)ffi_closure_SYSV;
-
- /* load r11 (temp) with fn */
- /* imm fn(upper) */
- tramp[0] = 0xb0000000 | ((fn >> 16) & 0xffff);
- /* addik r11, r0, fn(lower) */
- tramp[1] = 0x31600000 | (fn & 0xffff);
-
- /* load r12 (temp) with cls */
- /* imm cls(upper) */
- tramp[2] = 0xb0000000 | ((cls >> 16) & 0xffff);
- /* addik r12, r0, cls(lower) */
- tramp[3] = 0x31800000 | (cls & 0xffff);
-
- /* load r3 (temp) with ffi_closure_call_SYSV */
- /* imm fn_closure_call_sysv(upper) */
- tramp[4] = 0xb0000000 | ((fn_closure_call_sysv >> 16) & 0xffff);
- /* addik r3, r0, fn_closure_call_sysv(lower) */
- tramp[5] = 0x30600000 | (fn_closure_call_sysv & 0xffff);
- /* branch/jump to address stored in r11 (fn) */
- tramp[6] = 0x98085800; /* bra r11 */
-
- break;
- default:
- return FFI_BAD_ABI;
- }
- return FFI_OK;
-}
diff --git a/Modules/_ctypes/libffi/src/microblaze/ffitarget.h b/Modules/_ctypes/libffi/src/microblaze/ffitarget.h
deleted file mode 100644
index c6fa5a4115..0000000000
--- a/Modules/_ctypes/libffi/src/microblaze/ffitarget.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/* -----------------------------------------------------------------------
- ffitarget.h - Copyright (c) 2012, 2013 Xilinx, Inc
-
- Target configuration macros for MicroBlaze.
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- ``Software''), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to
- permit persons to whom the Software is furnished to do so, subject to
- the following conditions:
-
- The above copyright notice and this permission notice shall be included
- in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- DEALINGS IN THE SOFTWARE.
- ----------------------------------------------------------------------- */
-
-#ifndef LIBFFI_TARGET_H
-#define LIBFFI_TARGET_H
-
-#ifndef LIBFFI_H
-#error "Please do not include ffitarget.h directly into your source. Use ffi.h instead."
-#endif
-
-#ifndef LIBFFI_ASM
-typedef unsigned long ffi_arg;
-typedef signed long ffi_sarg;
-
-typedef enum ffi_abi {
- FFI_FIRST_ABI = 0,
- FFI_SYSV,
- FFI_LAST_ABI,
- FFI_DEFAULT_ABI = FFI_SYSV
-} ffi_abi;
-#endif
-
-/* Definitions for closures */
-
-#define FFI_CLOSURES 1
-#define FFI_NATIVE_RAW_API 0
-
-#define FFI_TRAMPOLINE_SIZE (4*8)
-
-#endif
diff --git a/Modules/_ctypes/libffi/src/microblaze/sysv.S b/Modules/_ctypes/libffi/src/microblaze/sysv.S
deleted file mode 100644
index ea43e9d545..0000000000
--- a/Modules/_ctypes/libffi/src/microblaze/sysv.S
+++ /dev/null
@@ -1,302 +0,0 @@
-/* -----------------------------------------------------------------------
- sysv.S - Copyright (c) 2012, 2013 Xilinx, Inc
-
- MicroBlaze Foreign Function Interface
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- ``Software''), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to
- permit persons to whom the Software is furnished to do so, subject to
- the following conditions:
-
- The above copyright notice and this permission notice shall be included
- in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- DEALINGS IN THE SOFTWARE.
- ----------------------------------------------------------------------- */
-
-#define LIBFFI_ASM
-#include <fficonfig.h>
-#include <ffi.h>
-
- /*
- * arg[0] (r5) = ffi_prep_args,
- * arg[1] (r6) = &ecif,
- * arg[2] (r7) = cif->bytes,
- * arg[3] (r8) = cif->flags,
- * arg[4] (r9) = ecif.rvalue,
- * arg[5] (r10) = fn
- * arg[6] (sp[0]) = cif->rtype->type
- * arg[7] (sp[4]) = cif->rtype->size
- */
- .text
- .globl ffi_call_SYSV
- .type ffi_call_SYSV, @function
-ffi_call_SYSV:
- /* push callee saves */
- addik r1, r1, -20
- swi r19, r1, 0 /* Frame Pointer */
- swi r20, r1, 4 /* PIC register */
- swi r21, r1, 8 /* PIC register */
- swi r22, r1, 12 /* save for locals */
- swi r23, r1, 16 /* save for locals */
-
- /* save the r5-r10 registers in the stack */
- addik r1, r1, -24 /* increment sp to store 6x 32-bit words */
- swi r5, r1, 0
- swi r6, r1, 4
- swi r7, r1, 8
- swi r8, r1, 12
- swi r9, r1, 16
- swi r10, r1, 20
-
- /* save function pointer */
- addik r3, r5, 0 /* copy ffi_prep_args into r3 */
- addik r22, r1, 0 /* save sp for unallocated args into r22 (callee-saved) */
- addik r23, r10, 0 /* save function address into r23 (callee-saved) */
-
- /* prepare stack with allocation for n (bytes = r7) args */
- rsub r1, r7, r1 /* subtract bytes from sp */
-
- /* prep args for ffi_prep_args call */
- addik r5, r1, 0 /* store stack pointer into arg[0] */
- /* r6 still holds ecif for arg[1] */
-
- /* Call ffi_prep_args(stack, &ecif). */
- addik r1, r1, -4
- swi r15, r1, 0 /* store the link register in the frame */
- brald r15, r3
- nop /* branch has delay slot */
- lwi r15, r1, 0
- addik r1, r1, 4 /* restore the link register from the frame */
- /* returns calling stack pointer location */
-
- /* prepare args for fn call, prep_args populates them onto the stack */
- lwi r5, r1, 0 /* arg[0] */
- lwi r6, r1, 4 /* arg[1] */
- lwi r7, r1, 8 /* arg[2] */
- lwi r8, r1, 12 /* arg[3] */
- lwi r9, r1, 16 /* arg[4] */
- lwi r10, r1, 20 /* arg[5] */
-
- /* call (fn) (...). */
- addik r1, r1, -4
- swi r15, r1, 0 /* store the link register in the frame */
- brald r15, r23
- nop /* branch has delay slot */
- lwi r15, r1, 0
- addik r1, r1, 4 /* restore the link register from the frame */
-
- /* Remove the space we pushed for the args. */
- addik r1, r22, 0 /* restore old SP */
-
- /* restore this functions parameters */
- lwi r5, r1, 0 /* arg[0] */
- lwi r6, r1, 4 /* arg[1] */
- lwi r7, r1, 8 /* arg[2] */
- lwi r8, r1, 12 /* arg[3] */
- lwi r9, r1, 16 /* arg[4] */
- lwi r10, r1, 20 /* arg[5] */
- addik r1, r1, 24 /* decrement sp to de-allocate 6x 32-bit words */
-
- /* If the return value pointer is NULL, assume no return value. */
- beqi r9, ffi_call_SYSV_end
-
- lwi r22, r1, 48 /* get return type (20 for locals + 28 for arg[6]) */
- lwi r23, r1, 52 /* get return size (20 for locals + 32 for arg[7]) */
-
- /* Check if return type is actually a struct, do nothing */
- rsubi r11, r22, FFI_TYPE_STRUCT
- beqi r11, ffi_call_SYSV_end
-
- /* Return 8bit */
- rsubi r11, r23, 1
- beqi r11, ffi_call_SYSV_store8
-
- /* Return 16bit */
- rsubi r11, r23, 2
- beqi r11, ffi_call_SYSV_store16
-
- /* Return 32bit */
- rsubi r11, r23, 4
- beqi r11, ffi_call_SYSV_store32
-
- /* Return 64bit */
- rsubi r11, r23, 8
- beqi r11, ffi_call_SYSV_store64
-
- /* Didn't match anything */
- bri ffi_call_SYSV_end
-
-ffi_call_SYSV_store64:
- swi r3, r9, 0 /* store word r3 into return value */
- swi r4, r9, 4 /* store word r4 into return value */
- bri ffi_call_SYSV_end
-
-ffi_call_SYSV_store32:
- swi r3, r9, 0 /* store word r3 into return value */
- bri ffi_call_SYSV_end
-
-ffi_call_SYSV_store16:
-#ifdef __BIG_ENDIAN__
- shi r3, r9, 2 /* store half-word r3 into return value */
-#else
- shi r3, r9, 0 /* store half-word r3 into return value */
-#endif
- bri ffi_call_SYSV_end
-
-ffi_call_SYSV_store8:
-#ifdef __BIG_ENDIAN__
- sbi r3, r9, 3 /* store byte r3 into return value */
-#else
- sbi r3, r9, 0 /* store byte r3 into return value */
-#endif
- bri ffi_call_SYSV_end
-
-ffi_call_SYSV_end:
- /* callee restores */
- lwi r19, r1, 0 /* frame pointer */
- lwi r20, r1, 4 /* PIC register */
- lwi r21, r1, 8 /* PIC register */
- lwi r22, r1, 12
- lwi r23, r1, 16
- addik r1, r1, 20
-
- /* return from sub-routine (with delay slot) */
- rtsd r15, 8
- nop
-
- .size ffi_call_SYSV, . - ffi_call_SYSV
-
-/* ------------------------------------------------------------------------- */
-
- /*
- * args passed into this function, are passed down to the callee.
- * this function is the target of the closure trampoline, as such r12 is
- * a pointer to the closure object.
- */
- .text
- .globl ffi_closure_SYSV
- .type ffi_closure_SYSV, @function
-ffi_closure_SYSV:
- /* push callee saves */
- addik r11, r1, 28 /* save stack args start location (excluding regs/link) */
- addik r1, r1, -12
- swi r19, r1, 0 /* Frame Pointer */
- swi r20, r1, 4 /* PIC register */
- swi r21, r1, 8 /* PIC register */
-
- /* store register args on stack */
- addik r1, r1, -24
- swi r5, r1, 0
- swi r6, r1, 4
- swi r7, r1, 8
- swi r8, r1, 12
- swi r9, r1, 16
- swi r10, r1, 20
-
- /* setup args */
- addik r5, r1, 0 /* register_args */
- addik r6, r11, 0 /* stack_args */
- addik r7, r12, 0 /* closure object */
- addik r1, r1, -8 /* allocate return value */
- addik r8, r1, 0 /* void* rvalue */
- addik r1, r1, -8 /* allocate for return type/size values */
- addik r9, r1, 0 /* void* rtype */
- addik r10, r1, 4 /* void* rsize */
-
- /* call the wrap_call function */
- addik r1, r1, -28 /* allocate args + link reg */
- swi r15, r1, 0 /* store the link register in the frame */
- brald r15, r3
- nop /* branch has delay slot */
- lwi r15, r1, 0
- addik r1, r1, 28 /* restore the link register from the frame */
-
-ffi_closure_SYSV_prepare_return:
- lwi r9, r1, 0 /* rtype */
- lwi r10, r1, 4 /* rsize */
- addik r1, r1, 8 /* de-allocate return info values */
-
- /* Check if return type is actually a struct, store 4 bytes */
- rsubi r11, r9, FFI_TYPE_STRUCT
- beqi r11, ffi_closure_SYSV_store32
-
- /* Return 8bit */
- rsubi r11, r10, 1
- beqi r11, ffi_closure_SYSV_store8
-
- /* Return 16bit */
- rsubi r11, r10, 2
- beqi r11, ffi_closure_SYSV_store16
-
- /* Return 32bit */
- rsubi r11, r10, 4
- beqi r11, ffi_closure_SYSV_store32
-
- /* Return 64bit */
- rsubi r11, r10, 8
- beqi r11, ffi_closure_SYSV_store64
-
- /* Didn't match anything */
- bri ffi_closure_SYSV_end
-
-ffi_closure_SYSV_store64:
- lwi r3, r1, 0 /* store word r3 into return value */
- lwi r4, r1, 4 /* store word r4 into return value */
- /* 64 bits == 2 words, no sign extend occurs */
- bri ffi_closure_SYSV_end
-
-ffi_closure_SYSV_store32:
- lwi r3, r1, 0 /* store word r3 into return value */
- /* 32 bits == 1 word, no sign extend occurs */
- bri ffi_closure_SYSV_end
-
-ffi_closure_SYSV_store16:
-#ifdef __BIG_ENDIAN__
- lhui r3, r1, 2 /* store half-word r3 into return value */
-#else
- lhui r3, r1, 0 /* store half-word r3 into return value */
-#endif
- rsubi r11, r9, FFI_TYPE_SINT16
- bnei r11, ffi_closure_SYSV_end
- sext16 r3, r3 /* fix sign extend of sint8 */
- bri ffi_closure_SYSV_end
-
-ffi_closure_SYSV_store8:
-#ifdef __BIG_ENDIAN__
- lbui r3, r1, 3 /* store byte r3 into return value */
-#else
- lbui r3, r1, 0 /* store byte r3 into return value */
-#endif
- rsubi r11, r9, FFI_TYPE_SINT8
- bnei r11, ffi_closure_SYSV_end
- sext8 r3, r3 /* fix sign extend of sint8 */
- bri ffi_closure_SYSV_end
-
-ffi_closure_SYSV_end:
- addik r1, r1, 8 /* de-allocate return value */
-
- /* de-allocate stored args */
- addik r1, r1, 24
-
- /* callee restores */
- lwi r19, r1, 0 /* frame pointer */
- lwi r20, r1, 4 /* PIC register */
- lwi r21, r1, 8 /* PIC register */
- addik r1, r1, 12
-
- /* return from sub-routine (with delay slot) */
- rtsd r15, 8
- nop
-
- .size ffi_closure_SYSV, . - ffi_closure_SYSV
diff --git a/Modules/_ctypes/libffi/src/mips/ffi.c b/Modules/_ctypes/libffi/src/mips/ffi.c
deleted file mode 100644
index 5d0dd70cb3..0000000000
--- a/Modules/_ctypes/libffi/src/mips/ffi.c
+++ /dev/null
@@ -1,1050 +0,0 @@
-/* -----------------------------------------------------------------------
- ffi.c - Copyright (c) 2011 Anthony Green
- Copyright (c) 2008 David Daney
- Copyright (c) 1996, 2007, 2008, 2011 Red Hat, Inc.
-
- MIPS Foreign Function Interface
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- ``Software''), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to
- permit persons to whom the Software is furnished to do so, subject to
- the following conditions:
-
- The above copyright notice and this permission notice shall be included
- in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- DEALINGS IN THE SOFTWARE.
- ----------------------------------------------------------------------- */
-
-#include <ffi.h>
-#include <ffi_common.h>
-
-#include <stdlib.h>
-
-#ifdef __GNUC__
-# if (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3))
-# define USE__BUILTIN___CLEAR_CACHE 1
-# endif
-#endif
-
-#ifndef USE__BUILTIN___CLEAR_CACHE
-# if defined(__OpenBSD__)
-# include <mips64/sysarch.h>
-# else
-# include <sys/cachectl.h>
-# endif
-#endif
-
-#ifdef FFI_DEBUG
-# define FFI_MIPS_STOP_HERE() ffi_stop_here()
-#else
-# define FFI_MIPS_STOP_HERE() do {} while(0)
-#endif
-
-#ifdef FFI_MIPS_N32
-#define FIX_ARGP \
-FFI_ASSERT(argp <= &stack[bytes]); \
-if (argp == &stack[bytes]) \
-{ \
- argp = stack; \
- FFI_MIPS_STOP_HERE(); \
-}
-#else
-#define FIX_ARGP
-#endif
-
-
-/* ffi_prep_args is called by the assembly routine once stack space
- has been allocated for the function's arguments */
-
-static void ffi_prep_args(char *stack,
- extended_cif *ecif,
- int bytes,
- int flags)
-{
- int i;
- void **p_argv;
- char *argp;
- ffi_type **p_arg;
-
-#ifdef FFI_MIPS_N32
- /* If more than 8 double words are used, the remainder go
- on the stack. We reorder stuff on the stack here to
- support this easily. */
- if (bytes > 8 * sizeof(ffi_arg))
- argp = &stack[bytes - (8 * sizeof(ffi_arg))];
- else
- argp = stack;
-#else
- argp = stack;
-#endif
-
- memset(stack, 0, bytes);
-
-#ifdef FFI_MIPS_N32
- if ( ecif->cif->rstruct_flag != 0 )
-#else
- if ( ecif->cif->rtype->type == FFI_TYPE_STRUCT )
-#endif
- {
- *(ffi_arg *) argp = (ffi_arg) ecif->rvalue;
- argp += sizeof(ffi_arg);
- FIX_ARGP;
- }
-
- p_argv = ecif->avalue;
-
- for (i = 0, p_arg = ecif->cif->arg_types; i < ecif->cif->nargs; i++, p_arg++)
- {
- size_t z;
- unsigned int a;
-
- /* Align if necessary. */
- a = (*p_arg)->alignment;
- if (a < sizeof(ffi_arg))
- a = sizeof(ffi_arg);
-
- if ((a - 1) & (unsigned long) argp)
- {
- argp = (char *) ALIGN(argp, a);
- FIX_ARGP;
- }
-
- z = (*p_arg)->size;
- if (z <= sizeof(ffi_arg))
- {
- int type = (*p_arg)->type;
- z = sizeof(ffi_arg);
-
- /* The size of a pointer depends on the ABI */
- if (type == FFI_TYPE_POINTER)
- type = (ecif->cif->abi == FFI_N64
- || ecif->cif->abi == FFI_N64_SOFT_FLOAT)
- ? FFI_TYPE_SINT64 : FFI_TYPE_SINT32;
-
- if (i < 8 && (ecif->cif->abi == FFI_N32_SOFT_FLOAT
- || ecif->cif->abi == FFI_N64_SOFT_FLOAT))
- {
- switch (type)
- {
- case FFI_TYPE_FLOAT:
- type = FFI_TYPE_UINT32;
- break;
- case FFI_TYPE_DOUBLE:
- type = FFI_TYPE_UINT64;
- break;
- default:
- break;
- }
- }
- switch (type)
- {
- case FFI_TYPE_SINT8:
- *(ffi_arg *)argp = *(SINT8 *)(* p_argv);
- break;
-
- case FFI_TYPE_UINT8:
- *(ffi_arg *)argp = *(UINT8 *)(* p_argv);
- break;
-
- case FFI_TYPE_SINT16:
- *(ffi_arg *)argp = *(SINT16 *)(* p_argv);
- break;
-
- case FFI_TYPE_UINT16:
- *(ffi_arg *)argp = *(UINT16 *)(* p_argv);
- break;
-
- case FFI_TYPE_SINT32:
- *(ffi_arg *)argp = *(SINT32 *)(* p_argv);
- break;
-
- case FFI_TYPE_UINT32:
-#ifdef FFI_MIPS_N32
- /* The N32 ABI requires that 32-bit integers
- be sign-extended to 64-bits, regardless of
- whether they are signed or unsigned. */
- *(ffi_arg *)argp = *(SINT32 *)(* p_argv);
-#else
- *(ffi_arg *)argp = *(UINT32 *)(* p_argv);
-#endif
- break;
-
- /* This can only happen with 64bit slots. */
- case FFI_TYPE_FLOAT:
- *(float *) argp = *(float *)(* p_argv);
- break;
-
- /* Handle structures. */
- default:
- memcpy(argp, *p_argv, (*p_arg)->size);
- break;
- }
- }
- else
- {
-#ifdef FFI_MIPS_O32
- memcpy(argp, *p_argv, z);
-#else
- {
- unsigned long end = (unsigned long) argp + z;
- unsigned long cap = (unsigned long) stack + bytes;
-
- /* Check if the data will fit within the register space.
- Handle it if it doesn't. */
-
- if (end <= cap)
- memcpy(argp, *p_argv, z);
- else
- {
- unsigned long portion = cap - (unsigned long)argp;
-
- memcpy(argp, *p_argv, portion);
- argp = stack;
- z -= portion;
- memcpy(argp, (void*)((unsigned long)(*p_argv) + portion),
- z);
- }
- }
-#endif
- }
- p_argv++;
- argp += z;
- FIX_ARGP;
- }
-}
-
-#ifdef FFI_MIPS_N32
-
-/* The n32 spec says that if "a chunk consists solely of a double
- float field (but not a double, which is part of a union), it
- is passed in a floating point register. Any other chunk is
- passed in an integer register". This code traverses structure
- definitions and generates the appropriate flags. */
-
-static unsigned
-calc_n32_struct_flags(int soft_float, ffi_type *arg,
- unsigned *loc, unsigned *arg_reg)
-{
- unsigned flags = 0;
- unsigned index = 0;
-
- ffi_type *e;
-
- if (soft_float)
- return 0;
-
- while ((e = arg->elements[index]))
- {
- /* Align this object. */
- *loc = ALIGN(*loc, e->alignment);
- if (e->type == FFI_TYPE_DOUBLE)
- {
- /* Already aligned to FFI_SIZEOF_ARG. */
- *arg_reg = *loc / FFI_SIZEOF_ARG;
- if (*arg_reg > 7)
- break;
- flags += (FFI_TYPE_DOUBLE << (*arg_reg * FFI_FLAG_BITS));
- *loc += e->size;
- }
- else
- *loc += e->size;
- index++;
- }
- /* Next Argument register at alignment of FFI_SIZEOF_ARG. */
- *arg_reg = ALIGN(*loc, FFI_SIZEOF_ARG) / FFI_SIZEOF_ARG;
-
- return flags;
-}
-
-static unsigned
-calc_n32_return_struct_flags(int soft_float, ffi_type *arg)
-{
- unsigned flags = 0;
- unsigned small = FFI_TYPE_SMALLSTRUCT;
- ffi_type *e;
-
- /* Returning structures under n32 is a tricky thing.
- A struct with only one or two floating point fields
- is returned in $f0 (and $f2 if necessary). Any other
- struct results at most 128 bits are returned in $2
- (the first 64 bits) and $3 (remainder, if necessary).
- Larger structs are handled normally. */
-
- if (arg->size > 16)
- return 0;
-
- if (arg->size > 8)
- small = FFI_TYPE_SMALLSTRUCT2;
-
- e = arg->elements[0];
-
- if (e->type == FFI_TYPE_DOUBLE)
- flags = FFI_TYPE_DOUBLE;
- else if (e->type == FFI_TYPE_FLOAT)
- flags = FFI_TYPE_FLOAT;
-
- if (flags && (e = arg->elements[1]))
- {
- if (e->type == FFI_TYPE_DOUBLE)
- flags += FFI_TYPE_DOUBLE << FFI_FLAG_BITS;
- else if (e->type == FFI_TYPE_FLOAT)
- flags += FFI_TYPE_FLOAT << FFI_FLAG_BITS;
- else
- return small;
-
- if (flags && (arg->elements[2]))
- {
- /* There are three arguments and the first two are
- floats! This must be passed the old way. */
- return small;
- }
- if (soft_float)
- flags += FFI_TYPE_STRUCT_SOFT;
- }
- else
- if (!flags)
- return small;
-
- return flags;
-}
-
-#endif
-
-/* Perform machine dependent cif processing */
-ffi_status ffi_prep_cif_machdep(ffi_cif *cif)
-{
- cif->flags = 0;
-
-#ifdef FFI_MIPS_O32
- /* Set the flags necessary for O32 processing. FFI_O32_SOFT_FLOAT
- * does not have special handling for floating point args.
- */
-
- if (cif->rtype->type != FFI_TYPE_STRUCT && cif->abi == FFI_O32)
- {
- if (cif->nargs > 0)
- {
- switch ((cif->arg_types)[0]->type)
- {
- case FFI_TYPE_FLOAT:
- case FFI_TYPE_DOUBLE:
- cif->flags += (cif->arg_types)[0]->type;
- break;
-
- default:
- break;
- }
-
- if (cif->nargs > 1)
- {
- /* Only handle the second argument if the first
- is a float or double. */
- if (cif->flags)
- {
- switch ((cif->arg_types)[1]->type)
- {
- case FFI_TYPE_FLOAT:
- case FFI_TYPE_DOUBLE:
- cif->flags += (cif->arg_types)[1]->type << FFI_FLAG_BITS;
- break;
-
- default:
- break;
- }
- }
- }
- }
- }
-
- /* Set the return type flag */
-
- if (cif->abi == FFI_O32_SOFT_FLOAT)
- {
- switch (cif->rtype->type)
- {
- case FFI_TYPE_VOID:
- case FFI_TYPE_STRUCT:
- cif->flags += cif->rtype->type << (FFI_FLAG_BITS * 2);
- break;
-
- case FFI_TYPE_SINT64:
- case FFI_TYPE_UINT64:
- case FFI_TYPE_DOUBLE:
- cif->flags += FFI_TYPE_UINT64 << (FFI_FLAG_BITS * 2);
- break;
-
- case FFI_TYPE_FLOAT:
- default:
- cif->flags += FFI_TYPE_INT << (FFI_FLAG_BITS * 2);
- break;
- }
- }
- else
- {
- /* FFI_O32 */
- switch (cif->rtype->type)
- {
- case FFI_TYPE_VOID:
- case FFI_TYPE_STRUCT:
- case FFI_TYPE_FLOAT:
- case FFI_TYPE_DOUBLE:
- cif->flags += cif->rtype->type << (FFI_FLAG_BITS * 2);
- break;
-
- case FFI_TYPE_SINT64:
- case FFI_TYPE_UINT64:
- cif->flags += FFI_TYPE_UINT64 << (FFI_FLAG_BITS * 2);
- break;
-
- default:
- cif->flags += FFI_TYPE_INT << (FFI_FLAG_BITS * 2);
- break;
- }
- }
-#endif
-
-#ifdef FFI_MIPS_N32
- /* Set the flags necessary for N32 processing */
- {
- int type;
- unsigned arg_reg = 0;
- unsigned loc = 0;
- unsigned count = (cif->nargs < 8) ? cif->nargs : 8;
- unsigned index = 0;
-
- unsigned struct_flags = 0;
- int soft_float = (cif->abi == FFI_N32_SOFT_FLOAT
- || cif->abi == FFI_N64_SOFT_FLOAT);
-
- if (cif->rtype->type == FFI_TYPE_STRUCT)
- {
- struct_flags = calc_n32_return_struct_flags(soft_float, cif->rtype);
-
- if (struct_flags == 0)
- {
- /* This means that the structure is being passed as
- a hidden argument */
-
- arg_reg = 1;
- count = (cif->nargs < 7) ? cif->nargs : 7;
-
- cif->rstruct_flag = !0;
- }
- else
- cif->rstruct_flag = 0;
- }
- else
- cif->rstruct_flag = 0;
-
- while (count-- > 0 && arg_reg < 8)
- {
- type = (cif->arg_types)[index]->type;
- if (soft_float)
- {
- switch (type)
- {
- case FFI_TYPE_FLOAT:
- type = FFI_TYPE_UINT32;
- break;
- case FFI_TYPE_DOUBLE:
- type = FFI_TYPE_UINT64;
- break;
- default:
- break;
- }
- }
- switch (type)
- {
- case FFI_TYPE_FLOAT:
- case FFI_TYPE_DOUBLE:
- cif->flags +=
- ((cif->arg_types)[index]->type << (arg_reg * FFI_FLAG_BITS));
- arg_reg++;
- break;
- case FFI_TYPE_LONGDOUBLE:
- /* Align it. */
- arg_reg = ALIGN(arg_reg, 2);
- /* Treat it as two adjacent doubles. */
- if (soft_float)
- {
- arg_reg += 2;
- }
- else
- {
- cif->flags +=
- (FFI_TYPE_DOUBLE << (arg_reg * FFI_FLAG_BITS));
- arg_reg++;
- cif->flags +=
- (FFI_TYPE_DOUBLE << (arg_reg * FFI_FLAG_BITS));
- arg_reg++;
- }
- break;
-
- case FFI_TYPE_STRUCT:
- loc = arg_reg * FFI_SIZEOF_ARG;
- cif->flags += calc_n32_struct_flags(soft_float,
- (cif->arg_types)[index],
- &loc, &arg_reg);
- break;
-
- default:
- arg_reg++;
- break;
- }
-
- index++;
- }
-
- /* Set the return type flag */
- switch (cif->rtype->type)
- {
- case FFI_TYPE_STRUCT:
- {
- if (struct_flags == 0)
- {
- /* The structure is returned through a hidden
- first argument. Do nothing, 'cause FFI_TYPE_VOID
- is 0 */
- }
- else
- {
- /* The structure is returned via some tricky
- mechanism */
- cif->flags += FFI_TYPE_STRUCT << (FFI_FLAG_BITS * 8);
- cif->flags += struct_flags << (4 + (FFI_FLAG_BITS * 8));
- }
- break;
- }
-
- case FFI_TYPE_VOID:
- /* Do nothing, 'cause FFI_TYPE_VOID is 0 */
- break;
-
- case FFI_TYPE_POINTER:
- if (cif->abi == FFI_N32_SOFT_FLOAT || cif->abi == FFI_N32)
- cif->flags += FFI_TYPE_SINT32 << (FFI_FLAG_BITS * 8);
- else
- cif->flags += FFI_TYPE_INT << (FFI_FLAG_BITS * 8);
- break;
-
- case FFI_TYPE_FLOAT:
- if (soft_float)
- {
- cif->flags += FFI_TYPE_SINT32 << (FFI_FLAG_BITS * 8);
- break;
- }
- /* else fall through */
- case FFI_TYPE_DOUBLE:
- if (soft_float)
- cif->flags += FFI_TYPE_INT << (FFI_FLAG_BITS * 8);
- else
- cif->flags += cif->rtype->type << (FFI_FLAG_BITS * 8);
- break;
-
- case FFI_TYPE_LONGDOUBLE:
- /* Long double is returned as if it were a struct containing
- two doubles. */
- if (soft_float)
- {
- cif->flags += FFI_TYPE_STRUCT << (FFI_FLAG_BITS * 8);
- cif->flags += FFI_TYPE_SMALLSTRUCT2 << (4 + (FFI_FLAG_BITS * 8));
- }
- else
- {
- cif->flags += FFI_TYPE_STRUCT << (FFI_FLAG_BITS * 8);
- cif->flags += (FFI_TYPE_DOUBLE
- + (FFI_TYPE_DOUBLE << FFI_FLAG_BITS))
- << (4 + (FFI_FLAG_BITS * 8));
- }
- break;
- default:
- cif->flags += FFI_TYPE_INT << (FFI_FLAG_BITS * 8);
- break;
- }
- }
-#endif
-
- return FFI_OK;
-}
-
-/* Low level routine for calling O32 functions */
-extern int ffi_call_O32(void (*)(char *, extended_cif *, int, int),
- extended_cif *, unsigned,
- unsigned, unsigned *, void (*)(void));
-
-/* Low level routine for calling N32 functions */
-extern int ffi_call_N32(void (*)(char *, extended_cif *, int, int),
- extended_cif *, unsigned,
- unsigned, void *, void (*)(void));
-
-void ffi_call(ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue)
-{
- extended_cif ecif;
-
- ecif.cif = cif;
- ecif.avalue = avalue;
-
- /* If the return value is a struct and we don't have a return */
- /* value address then we need to make one */
-
- if ((rvalue == NULL) &&
- (cif->rtype->type == FFI_TYPE_STRUCT))
- ecif.rvalue = alloca(cif->rtype->size);
- else
- ecif.rvalue = rvalue;
-
- switch (cif->abi)
- {
-#ifdef FFI_MIPS_O32
- case FFI_O32:
- case FFI_O32_SOFT_FLOAT:
- ffi_call_O32(ffi_prep_args, &ecif, cif->bytes,
- cif->flags, ecif.rvalue, fn);
- break;
-#endif
-
-#ifdef FFI_MIPS_N32
- case FFI_N32:
- case FFI_N32_SOFT_FLOAT:
- case FFI_N64:
- case FFI_N64_SOFT_FLOAT:
- {
- int copy_rvalue = 0;
- int copy_offset = 0;
- char *rvalue_copy = ecif.rvalue;
- if (cif->rtype->type == FFI_TYPE_STRUCT && cif->rtype->size < 16)
- {
- /* For structures smaller than 16 bytes we clobber memory
- in 8 byte increments. Make a copy so we don't clobber
- the callers memory outside of the struct bounds. */
- rvalue_copy = alloca(16);
- copy_rvalue = 1;
- }
- else if (cif->rtype->type == FFI_TYPE_FLOAT
- && (cif->abi == FFI_N64_SOFT_FLOAT
- || cif->abi == FFI_N32_SOFT_FLOAT))
- {
- rvalue_copy = alloca (8);
- copy_rvalue = 1;
-#if defined(__MIPSEB__) || defined(_MIPSEB)
- copy_offset = 4;
-#endif
- }
- ffi_call_N32(ffi_prep_args, &ecif, cif->bytes,
- cif->flags, rvalue_copy, fn);
- if (copy_rvalue)
- memcpy(ecif.rvalue, rvalue_copy + copy_offset, cif->rtype->size);
- }
- break;
-#endif
-
- default:
- FFI_ASSERT(0);
- break;
- }
-}
-
-#if FFI_CLOSURES
-#if defined(FFI_MIPS_O32)
-extern void ffi_closure_O32(void);
-#else
-extern void ffi_closure_N32(void);
-#endif /* FFI_MIPS_O32 */
-
-ffi_status
-ffi_prep_closure_loc (ffi_closure *closure,
- ffi_cif *cif,
- void (*fun)(ffi_cif*,void*,void**,void*),
- void *user_data,
- void *codeloc)
-{
- unsigned int *tramp = (unsigned int *) &closure->tramp[0];
- void * fn;
- char *clear_location = (char *) codeloc;
-
-#if defined(FFI_MIPS_O32)
- if (cif->abi != FFI_O32 && cif->abi != FFI_O32_SOFT_FLOAT)
- return FFI_BAD_ABI;
- fn = ffi_closure_O32;
-#else
-#if _MIPS_SIM ==_ABIN32
- if (cif->abi != FFI_N32
- && cif->abi != FFI_N32_SOFT_FLOAT)
- return FFI_BAD_ABI;
-#else
- if (cif->abi != FFI_N64
- && cif->abi != FFI_N64_SOFT_FLOAT)
- return FFI_BAD_ABI;
-#endif
- fn = ffi_closure_N32;
-#endif /* FFI_MIPS_O32 */
-
-#if defined(FFI_MIPS_O32) || (_MIPS_SIM ==_ABIN32)
- /* lui $25,high(fn) */
- tramp[0] = 0x3c190000 | ((unsigned)fn >> 16);
- /* ori $25,low(fn) */
- tramp[1] = 0x37390000 | ((unsigned)fn & 0xffff);
- /* lui $12,high(codeloc) */
- tramp[2] = 0x3c0c0000 | ((unsigned)codeloc >> 16);
- /* jr $25 */
- tramp[3] = 0x03200008;
- /* ori $12,low(codeloc) */
- tramp[4] = 0x358c0000 | ((unsigned)codeloc & 0xffff);
-#else
- /* N64 has a somewhat larger trampoline. */
- /* lui $25,high(fn) */
- tramp[0] = 0x3c190000 | ((unsigned long)fn >> 48);
- /* lui $12,high(codeloc) */
- tramp[1] = 0x3c0c0000 | ((unsigned long)codeloc >> 48);
- /* ori $25,mid-high(fn) */
- tramp[2] = 0x37390000 | (((unsigned long)fn >> 32 ) & 0xffff);
- /* ori $12,mid-high(codeloc) */
- tramp[3] = 0x358c0000 | (((unsigned long)codeloc >> 32) & 0xffff);
- /* dsll $25,$25,16 */
- tramp[4] = 0x0019cc38;
- /* dsll $12,$12,16 */
- tramp[5] = 0x000c6438;
- /* ori $25,mid-low(fn) */
- tramp[6] = 0x37390000 | (((unsigned long)fn >> 16 ) & 0xffff);
- /* ori $12,mid-low(codeloc) */
- tramp[7] = 0x358c0000 | (((unsigned long)codeloc >> 16) & 0xffff);
- /* dsll $25,$25,16 */
- tramp[8] = 0x0019cc38;
- /* dsll $12,$12,16 */
- tramp[9] = 0x000c6438;
- /* ori $25,low(fn) */
- tramp[10] = 0x37390000 | ((unsigned long)fn & 0xffff);
- /* jr $25 */
- tramp[11] = 0x03200008;
- /* ori $12,low(codeloc) */
- tramp[12] = 0x358c0000 | ((unsigned long)codeloc & 0xffff);
-
-#endif
-
- closure->cif = cif;
- closure->fun = fun;
- closure->user_data = user_data;
-
-#ifdef USE__BUILTIN___CLEAR_CACHE
- __builtin___clear_cache(clear_location, clear_location + FFI_TRAMPOLINE_SIZE);
-#else
- cacheflush (clear_location, FFI_TRAMPOLINE_SIZE, ICACHE);
-#endif
- return FFI_OK;
-}
-
-/*
- * Decodes the arguments to a function, which will be stored on the
- * stack. AR is the pointer to the beginning of the integer arguments
- * (and, depending upon the arguments, some floating-point arguments
- * as well). FPR is a pointer to the area where floating point
- * registers have been saved, if any.
- *
- * RVALUE is the location where the function return value will be
- * stored. CLOSURE is the prepared closure to invoke.
- *
- * This function should only be called from assembly, which is in
- * turn called from a trampoline.
- *
- * Returns the function return type.
- *
- * Based on the similar routine for sparc.
- */
-int
-ffi_closure_mips_inner_O32 (ffi_closure *closure,
- void *rvalue, ffi_arg *ar,
- double *fpr)
-{
- ffi_cif *cif;
- void **avaluep;
- ffi_arg *avalue;
- ffi_type **arg_types;
- int i, avn, argn, seen_int;
-
- cif = closure->cif;
- avalue = alloca (cif->nargs * sizeof (ffi_arg));
- avaluep = alloca (cif->nargs * sizeof (ffi_arg));
-
- seen_int = (cif->abi == FFI_O32_SOFT_FLOAT);
- argn = 0;
-
- if ((cif->flags >> (FFI_FLAG_BITS * 2)) == FFI_TYPE_STRUCT)
- {
- rvalue = (void *)(UINT32)ar[0];
- argn = 1;
- }
-
- i = 0;
- avn = cif->nargs;
- arg_types = cif->arg_types;
-
- while (i < avn)
- {
- if (i < 2 && !seen_int &&
- (arg_types[i]->type == FFI_TYPE_FLOAT ||
- arg_types[i]->type == FFI_TYPE_DOUBLE ||
- arg_types[i]->type == FFI_TYPE_LONGDOUBLE))
- {
-#if defined(__MIPSEB__) || defined(_MIPSEB)
- if (arg_types[i]->type == FFI_TYPE_FLOAT)
- avaluep[i] = ((char *) &fpr[i]) + sizeof (float);
- else
-#endif
- avaluep[i] = (char *) &fpr[i];
- }
- else
- {
- if (arg_types[i]->alignment == 8 && (argn & 0x1))
- argn++;
- switch (arg_types[i]->type)
- {
- case FFI_TYPE_SINT8:
- avaluep[i] = &avalue[i];
- *(SINT8 *) &avalue[i] = (SINT8) ar[argn];
- break;
-
- case FFI_TYPE_UINT8:
- avaluep[i] = &avalue[i];
- *(UINT8 *) &avalue[i] = (UINT8) ar[argn];
- break;
-
- case FFI_TYPE_SINT16:
- avaluep[i] = &avalue[i];
- *(SINT16 *) &avalue[i] = (SINT16) ar[argn];
- break;
-
- case FFI_TYPE_UINT16:
- avaluep[i] = &avalue[i];
- *(UINT16 *) &avalue[i] = (UINT16) ar[argn];
- break;
-
- default:
- avaluep[i] = (char *) &ar[argn];
- break;
- }
- seen_int = 1;
- }
- argn += ALIGN(arg_types[i]->size, FFI_SIZEOF_ARG) / FFI_SIZEOF_ARG;
- i++;
- }
-
- /* Invoke the closure. */
- (closure->fun) (cif, rvalue, avaluep, closure->user_data);
-
- if (cif->abi == FFI_O32_SOFT_FLOAT)
- {
- switch (cif->rtype->type)
- {
- case FFI_TYPE_FLOAT:
- return FFI_TYPE_INT;
- case FFI_TYPE_DOUBLE:
- return FFI_TYPE_UINT64;
- default:
- return cif->rtype->type;
- }
- }
- else
- {
- return cif->rtype->type;
- }
-}
-
-#if defined(FFI_MIPS_N32)
-
-static void
-copy_struct_N32(char *target, unsigned offset, ffi_abi abi, ffi_type *type,
- int argn, unsigned arg_offset, ffi_arg *ar,
- ffi_arg *fpr, int soft_float)
-{
- ffi_type **elt_typep = type->elements;
- while(*elt_typep)
- {
- ffi_type *elt_type = *elt_typep;
- unsigned o;
- char *tp;
- char *argp;
- char *fpp;
-
- o = ALIGN(offset, elt_type->alignment);
- arg_offset += o - offset;
- offset = o;
- argn += arg_offset / sizeof(ffi_arg);
- arg_offset = arg_offset % sizeof(ffi_arg);
-
- argp = (char *)(ar + argn);
- fpp = (char *)(argn >= 8 ? ar + argn : fpr + argn);
-
- tp = target + offset;
-
- if (elt_type->type == FFI_TYPE_DOUBLE && !soft_float)
- *(double *)tp = *(double *)fpp;
- else
- memcpy(tp, argp + arg_offset, elt_type->size);
-
- offset += elt_type->size;
- arg_offset += elt_type->size;
- elt_typep++;
- argn += arg_offset / sizeof(ffi_arg);
- arg_offset = arg_offset % sizeof(ffi_arg);
- }
-}
-
-/*
- * Decodes the arguments to a function, which will be stored on the
- * stack. AR is the pointer to the beginning of the integer
- * arguments. FPR is a pointer to the area where floating point
- * registers have been saved.
- *
- * RVALUE is the location where the function return value will be
- * stored. CLOSURE is the prepared closure to invoke.
- *
- * This function should only be called from assembly, which is in
- * turn called from a trampoline.
- *
- * Returns the function return flags.
- *
- */
-int
-ffi_closure_mips_inner_N32 (ffi_closure *closure,
- void *rvalue, ffi_arg *ar,
- ffi_arg *fpr)
-{
- ffi_cif *cif;
- void **avaluep;
- ffi_arg *avalue;
- ffi_type **arg_types;
- int i, avn, argn;
- int soft_float;
- ffi_arg *argp;
-
- cif = closure->cif;
- soft_float = cif->abi == FFI_N64_SOFT_FLOAT
- || cif->abi == FFI_N32_SOFT_FLOAT;
- avalue = alloca (cif->nargs * sizeof (ffi_arg));
- avaluep = alloca (cif->nargs * sizeof (ffi_arg));
-
- argn = 0;
-
- if (cif->rstruct_flag)
- {
-#if _MIPS_SIM==_ABIN32
- rvalue = (void *)(UINT32)ar[0];
-#else /* N64 */
- rvalue = (void *)ar[0];
-#endif
- argn = 1;
- }
-
- i = 0;
- avn = cif->nargs;
- arg_types = cif->arg_types;
-
- while (i < avn)
- {
- if (arg_types[i]->type == FFI_TYPE_FLOAT
- || arg_types[i]->type == FFI_TYPE_DOUBLE
- || arg_types[i]->type == FFI_TYPE_LONGDOUBLE)
- {
- argp = (argn >= 8 || soft_float) ? ar + argn : fpr + argn;
- if ((arg_types[i]->type == FFI_TYPE_LONGDOUBLE) && ((unsigned)argp & (arg_types[i]->alignment-1)))
- {
- argp=(ffi_arg*)ALIGN(argp,arg_types[i]->alignment);
- argn++;
- }
-#if defined(__MIPSEB__) || defined(_MIPSEB)
- if (arg_types[i]->type == FFI_TYPE_FLOAT && argn < 8)
- avaluep[i] = ((char *) argp) + sizeof (float);
- else
-#endif
- avaluep[i] = (char *) argp;
- }
- else
- {
- unsigned type = arg_types[i]->type;
-
- if (arg_types[i]->alignment > sizeof(ffi_arg))
- argn = ALIGN(argn, arg_types[i]->alignment / sizeof(ffi_arg));
-
- argp = ar + argn;
-
- /* The size of a pointer depends on the ABI */
- if (type == FFI_TYPE_POINTER)
- type = (cif->abi == FFI_N64 || cif->abi == FFI_N64_SOFT_FLOAT)
- ? FFI_TYPE_SINT64 : FFI_TYPE_SINT32;
-
- if (soft_float && type == FFI_TYPE_FLOAT)
- type = FFI_TYPE_UINT32;
-
- switch (type)
- {
- case FFI_TYPE_SINT8:
- avaluep[i] = &avalue[i];
- *(SINT8 *) &avalue[i] = (SINT8) *argp;
- break;
-
- case FFI_TYPE_UINT8:
- avaluep[i] = &avalue[i];
- *(UINT8 *) &avalue[i] = (UINT8) *argp;
- break;
-
- case FFI_TYPE_SINT16:
- avaluep[i] = &avalue[i];
- *(SINT16 *) &avalue[i] = (SINT16) *argp;
- break;
-
- case FFI_TYPE_UINT16:
- avaluep[i] = &avalue[i];
- *(UINT16 *) &avalue[i] = (UINT16) *argp;
- break;
-
- case FFI_TYPE_SINT32:
- avaluep[i] = &avalue[i];
- *(SINT32 *) &avalue[i] = (SINT32) *argp;
- break;
-
- case FFI_TYPE_UINT32:
- avaluep[i] = &avalue[i];
- *(UINT32 *) &avalue[i] = (UINT32) *argp;
- break;
-
- case FFI_TYPE_STRUCT:
- if (argn < 8)
- {
- /* Allocate space for the struct as at least part of
- it was passed in registers. */
- avaluep[i] = alloca(arg_types[i]->size);
- copy_struct_N32(avaluep[i], 0, cif->abi, arg_types[i],
- argn, 0, ar, fpr, soft_float);
-
- break;
- }
- /* Else fall through. */
- default:
- avaluep[i] = (char *) argp;
- break;
- }
- }
- argn += ALIGN(arg_types[i]->size, sizeof(ffi_arg)) / sizeof(ffi_arg);
- i++;
- }
-
- /* Invoke the closure. */
- (closure->fun) (cif, rvalue, avaluep, closure->user_data);
-
- return cif->flags >> (FFI_FLAG_BITS * 8);
-}
-
-#endif /* FFI_MIPS_N32 */
-
-#endif /* FFI_CLOSURES */
diff --git a/Modules/_ctypes/libffi/src/mips/ffitarget.h b/Modules/_ctypes/libffi/src/mips/ffitarget.h
deleted file mode 100644
index 717d65951c..0000000000
--- a/Modules/_ctypes/libffi/src/mips/ffitarget.h
+++ /dev/null
@@ -1,247 +0,0 @@
-/* -----------------------------------------------------------------*-C-*-
- ffitarget.h - Copyright (c) 2012 Anthony Green
- Copyright (c) 1996-2003 Red Hat, Inc.
- Target configuration macros for MIPS.
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- ``Software''), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to
- permit persons to whom the Software is furnished to do so, subject to
- the following conditions:
-
- The above copyright notice and this permission notice shall be included
- in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- DEALINGS IN THE SOFTWARE.
-
- ----------------------------------------------------------------------- */
-
-#ifndef LIBFFI_TARGET_H
-#define LIBFFI_TARGET_H
-
-#ifndef LIBFFI_H
-#error "Please do not include ffitarget.h directly into your source. Use ffi.h instead."
-#endif
-
-#ifdef linux
-# include <asm/sgidefs.h>
-#elif defined(__rtems__)
-/*
- * Subprogram calling convention - copied from sgidefs.h
- */
-#define _MIPS_SIM_ABI32 1
-#define _MIPS_SIM_NABI32 2
-#define _MIPS_SIM_ABI64 3
-#elif !defined(__OpenBSD__)
-# include <sgidefs.h>
-#endif
-
-# ifndef _ABIN32
-# define _ABIN32 _MIPS_SIM_NABI32
-# endif
-# ifndef _ABI64
-# define _ABI64 _MIPS_SIM_ABI64
-# endif
-# ifndef _ABIO32
-# define _ABIO32 _MIPS_SIM_ABI32
-# endif
-
-#if !defined(_MIPS_SIM)
-# error -- something is very wrong --
-#else
-# if (_MIPS_SIM==_ABIN32 && defined(_ABIN32)) || (_MIPS_SIM==_ABI64 && defined(_ABI64))
-# define FFI_MIPS_N32
-# else
-# if (_MIPS_SIM==_ABIO32 && defined(_ABIO32))
-# define FFI_MIPS_O32
-# else
-# error -- this is an unsupported platform --
-# endif
-# endif
-#endif
-
-#ifdef FFI_MIPS_O32
-/* O32 stack frames have 32bit integer args */
-# define FFI_SIZEOF_ARG 4
-#else
-/* N32 and N64 frames have 64bit integer args */
-# define FFI_SIZEOF_ARG 8
-# if _MIPS_SIM == _ABIN32
-# define FFI_SIZEOF_JAVA_RAW 4
-# endif
-#endif
-
-#define FFI_FLAG_BITS 2
-
-/* SGI's strange assembler requires that we multiply by 4 rather
- than shift left by FFI_FLAG_BITS */
-
-#define FFI_ARGS_D FFI_TYPE_DOUBLE
-#define FFI_ARGS_F FFI_TYPE_FLOAT
-#define FFI_ARGS_DD FFI_TYPE_DOUBLE * 4 + FFI_TYPE_DOUBLE
-#define FFI_ARGS_FF FFI_TYPE_FLOAT * 4 + FFI_TYPE_FLOAT
-#define FFI_ARGS_FD FFI_TYPE_DOUBLE * 4 + FFI_TYPE_FLOAT
-#define FFI_ARGS_DF FFI_TYPE_FLOAT * 4 + FFI_TYPE_DOUBLE
-
-/* Needed for N32 structure returns */
-#define FFI_TYPE_SMALLSTRUCT FFI_TYPE_UINT8
-#define FFI_TYPE_SMALLSTRUCT2 FFI_TYPE_SINT8
-
-#if 0
-/* The SGI assembler can't handle this.. */
-#define FFI_TYPE_STRUCT_DD (( FFI_ARGS_DD ) << 4) + FFI_TYPE_STRUCT
-/* (and so on) */
-#else
-/* ...so we calculate these by hand! */
-#define FFI_TYPE_STRUCT_D 61
-#define FFI_TYPE_STRUCT_F 45
-#define FFI_TYPE_STRUCT_DD 253
-#define FFI_TYPE_STRUCT_FF 173
-#define FFI_TYPE_STRUCT_FD 237
-#define FFI_TYPE_STRUCT_DF 189
-#define FFI_TYPE_STRUCT_SMALL 93
-#define FFI_TYPE_STRUCT_SMALL2 109
-
-/* and for n32 soft float, add 16 * 2^4 */
-#define FFI_TYPE_STRUCT_D_SOFT 317
-#define FFI_TYPE_STRUCT_F_SOFT 301
-#define FFI_TYPE_STRUCT_DD_SOFT 509
-#define FFI_TYPE_STRUCT_FF_SOFT 429
-#define FFI_TYPE_STRUCT_FD_SOFT 493
-#define FFI_TYPE_STRUCT_DF_SOFT 445
-#define FFI_TYPE_STRUCT_SOFT 16
-#endif
-
-#ifdef LIBFFI_ASM
-#define v0 $2
-#define v1 $3
-#define a0 $4
-#define a1 $5
-#define a2 $6
-#define a3 $7
-#define a4 $8
-#define a5 $9
-#define a6 $10
-#define a7 $11
-#define t0 $8
-#define t1 $9
-#define t2 $10
-#define t3 $11
-#define t4 $12
-#define t5 $13
-#define t6 $14
-#define t7 $15
-#define t8 $24
-#define t9 $25
-#define ra $31
-
-#ifdef FFI_MIPS_O32
-# define REG_L lw
-# define REG_S sw
-# define SUBU subu
-# define ADDU addu
-# define SRL srl
-# define LI li
-#else /* !FFI_MIPS_O32 */
-# define REG_L ld
-# define REG_S sd
-# define SUBU dsubu
-# define ADDU daddu
-# define SRL dsrl
-# define LI dli
-# if (_MIPS_SIM==_ABI64)
-# define LA dla
-# define EH_FRAME_ALIGN 3
-# define FDE_ADDR_BYTES .8byte
-# else
-# define LA la
-# define EH_FRAME_ALIGN 2
-# define FDE_ADDR_BYTES .4byte
-# endif /* _MIPS_SIM==_ABI64 */
-#endif /* !FFI_MIPS_O32 */
-#else /* !LIBFFI_ASM */
-# ifdef __GNUC__
-# ifdef FFI_MIPS_O32
-/* O32 stack frames have 32bit integer args */
-typedef unsigned int ffi_arg __attribute__((__mode__(__SI__)));
-typedef signed int ffi_sarg __attribute__((__mode__(__SI__)));
-#else
-/* N32 and N64 frames have 64bit integer args */
-typedef unsigned int ffi_arg __attribute__((__mode__(__DI__)));
-typedef signed int ffi_sarg __attribute__((__mode__(__DI__)));
-# endif
-# else
-# ifdef FFI_MIPS_O32
-/* O32 stack frames have 32bit integer args */
-typedef __uint32_t ffi_arg;
-typedef __int32_t ffi_sarg;
-# else
-/* N32 and N64 frames have 64bit integer args */
-typedef __uint64_t ffi_arg;
-typedef __int64_t ffi_sarg;
-# endif
-# endif /* __GNUC__ */
-
-typedef enum ffi_abi {
- FFI_FIRST_ABI = 0,
- FFI_O32,
- FFI_N32,
- FFI_N64,
- FFI_O32_SOFT_FLOAT,
- FFI_N32_SOFT_FLOAT,
- FFI_N64_SOFT_FLOAT,
- FFI_LAST_ABI,
-
-#ifdef FFI_MIPS_O32
-#ifdef __mips_soft_float
- FFI_DEFAULT_ABI = FFI_O32_SOFT_FLOAT
-#else
- FFI_DEFAULT_ABI = FFI_O32
-#endif
-#else
-# if _MIPS_SIM==_ABI64
-# ifdef __mips_soft_float
- FFI_DEFAULT_ABI = FFI_N64_SOFT_FLOAT
-# else
- FFI_DEFAULT_ABI = FFI_N64
-# endif
-# else
-# ifdef __mips_soft_float
- FFI_DEFAULT_ABI = FFI_N32_SOFT_FLOAT
-# else
- FFI_DEFAULT_ABI = FFI_N32
-# endif
-# endif
-#endif
-} ffi_abi;
-
-#define FFI_EXTRA_CIF_FIELDS unsigned rstruct_flag
-#endif /* !LIBFFI_ASM */
-
-/* ---- Definitions for closures ----------------------------------------- */
-
-#if defined(FFI_MIPS_O32)
-#define FFI_CLOSURES 1
-#define FFI_TRAMPOLINE_SIZE 20
-#else
-/* N32/N64. */
-# define FFI_CLOSURES 1
-#if _MIPS_SIM==_ABI64
-#define FFI_TRAMPOLINE_SIZE 52
-#else
-#define FFI_TRAMPOLINE_SIZE 20
-#endif
-#endif /* FFI_MIPS_O32 */
-#define FFI_NATIVE_RAW_API 0
-
-#endif
-
diff --git a/Modules/_ctypes/libffi/src/mips/n32.S b/Modules/_ctypes/libffi/src/mips/n32.S
deleted file mode 100644
index c6985d30a6..0000000000
--- a/Modules/_ctypes/libffi/src/mips/n32.S
+++ /dev/null
@@ -1,576 +0,0 @@
-/* -----------------------------------------------------------------------
- n32.S - Copyright (c) 1996, 1998, 2005, 2007, 2009, 2010 Red Hat, Inc.
-
- MIPS Foreign Function Interface
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- ``Software''), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to
- permit persons to whom the Software is furnished to do so, subject to
- the following conditions:
-
- The above copyright notice and this permission notice shall be included
- in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- DEALINGS IN THE SOFTWARE.
- ----------------------------------------------------------------------- */
-
-#define LIBFFI_ASM
-#include <fficonfig.h>
-#include <ffi.h>
-
-/* Only build this code if we are compiling for n32 */
-
-#if defined(FFI_MIPS_N32)
-
-#define callback a0
-#define bytes a2
-#define flags a3
-#define raddr a4
-#define fn a5
-
-#define SIZEOF_FRAME ( 8 * FFI_SIZEOF_ARG )
-
-#ifdef __GNUC__
- .abicalls
-#endif
- .set mips4
- .text
- .align 2
- .globl ffi_call_N32
- .ent ffi_call_N32
-ffi_call_N32:
-.LFB3:
- .frame $fp, SIZEOF_FRAME, ra
- .mask 0xc0000000,-FFI_SIZEOF_ARG
- .fmask 0x00000000,0
-
- # Prologue
- SUBU $sp, SIZEOF_FRAME # Frame size
-.LCFI0:
- REG_S $fp, SIZEOF_FRAME - 2*FFI_SIZEOF_ARG($sp) # Save frame pointer
- REG_S ra, SIZEOF_FRAME - 1*FFI_SIZEOF_ARG($sp) # Save return address
-.LCFI1:
- move $fp, $sp
-.LCFI3:
- move t9, callback # callback function pointer
- REG_S bytes, 2*FFI_SIZEOF_ARG($fp) # bytes
- REG_S flags, 3*FFI_SIZEOF_ARG($fp) # flags
- REG_S raddr, 4*FFI_SIZEOF_ARG($fp) # raddr
- REG_S fn, 5*FFI_SIZEOF_ARG($fp) # fn
-
- # Allocate at least 4 words in the argstack
- move v0, bytes
- bge bytes, 4 * FFI_SIZEOF_ARG, bigger
- LI v0, 4 * FFI_SIZEOF_ARG
- b sixteen
-
- bigger:
- ADDU t4, v0, 2 * FFI_SIZEOF_ARG -1 # make sure it is aligned
- and v0, t4, -2 * FFI_SIZEOF_ARG # to a proper boundry.
-
-sixteen:
- SUBU $sp, $sp, v0 # move the stack pointer to reflect the
- # arg space
-
- move a0, $sp # 4 * FFI_SIZEOF_ARG
- ADDU a3, $fp, 3 * FFI_SIZEOF_ARG
-
- # Call ffi_prep_args
- jal t9
-
- # Copy the stack pointer to t9
- move t9, $sp
-
- # Fix the stack if there are more than 8 64bit slots worth
- # of arguments.
-
- # Load the number of bytes
- REG_L t6, 2*FFI_SIZEOF_ARG($fp)
-
- # Is it bigger than 8 * FFI_SIZEOF_ARG?
- daddiu t8, t6, -(8 * FFI_SIZEOF_ARG)
- bltz t8, loadregs
-
- ADDU t9, t9, t8
-
-loadregs:
-
- REG_L t6, 3*FFI_SIZEOF_ARG($fp) # load the flags word into t6.
-
- and t4, t6, ((1<<FFI_FLAG_BITS)-1)
- REG_L a0, 0*FFI_SIZEOF_ARG(t9)
- beqz t4, arg1_next
- bne t4, FFI_TYPE_FLOAT, arg1_doublep
- l.s $f12, 0*FFI_SIZEOF_ARG(t9)
- b arg1_next
-arg1_doublep:
- l.d $f12, 0*FFI_SIZEOF_ARG(t9)
-arg1_next:
-
- SRL t4, t6, 1*FFI_FLAG_BITS
- and t4, ((1<<FFI_FLAG_BITS)-1)
- REG_L a1, 1*FFI_SIZEOF_ARG(t9)
- beqz t4, arg2_next
- bne t4, FFI_TYPE_FLOAT, arg2_doublep
- l.s $f13, 1*FFI_SIZEOF_ARG(t9)
- b arg2_next
-arg2_doublep:
- l.d $f13, 1*FFI_SIZEOF_ARG(t9)
-arg2_next:
-
- SRL t4, t6, 2*FFI_FLAG_BITS
- and t4, ((1<<FFI_FLAG_BITS)-1)
- REG_L a2, 2*FFI_SIZEOF_ARG(t9)
- beqz t4, arg3_next
- bne t4, FFI_TYPE_FLOAT, arg3_doublep
- l.s $f14, 2*FFI_SIZEOF_ARG(t9)
- b arg3_next
-arg3_doublep:
- l.d $f14, 2*FFI_SIZEOF_ARG(t9)
-arg3_next:
-
- SRL t4, t6, 3*FFI_FLAG_BITS
- and t4, ((1<<FFI_FLAG_BITS)-1)
- REG_L a3, 3*FFI_SIZEOF_ARG(t9)
- beqz t4, arg4_next
- bne t4, FFI_TYPE_FLOAT, arg4_doublep
- l.s $f15, 3*FFI_SIZEOF_ARG(t9)
- b arg4_next
-arg4_doublep:
- l.d $f15, 3*FFI_SIZEOF_ARG(t9)
-arg4_next:
-
- SRL t4, t6, 4*FFI_FLAG_BITS
- and t4, ((1<<FFI_FLAG_BITS)-1)
- REG_L a4, 4*FFI_SIZEOF_ARG(t9)
- beqz t4, arg5_next
- bne t4, FFI_TYPE_FLOAT, arg5_doublep
- l.s $f16, 4*FFI_SIZEOF_ARG(t9)
- b arg5_next
-arg5_doublep:
- l.d $f16, 4*FFI_SIZEOF_ARG(t9)
-arg5_next:
-
- SRL t4, t6, 5*FFI_FLAG_BITS
- and t4, ((1<<FFI_FLAG_BITS)-1)
- REG_L a5, 5*FFI_SIZEOF_ARG(t9)
- beqz t4, arg6_next
- bne t4, FFI_TYPE_FLOAT, arg6_doublep
- l.s $f17, 5*FFI_SIZEOF_ARG(t9)
- b arg6_next
-arg6_doublep:
- l.d $f17, 5*FFI_SIZEOF_ARG(t9)
-arg6_next:
-
- SRL t4, t6, 6*FFI_FLAG_BITS
- and t4, ((1<<FFI_FLAG_BITS)-1)
- REG_L a6, 6*FFI_SIZEOF_ARG(t9)
- beqz t4, arg7_next
- bne t4, FFI_TYPE_FLOAT, arg7_doublep
- l.s $f18, 6*FFI_SIZEOF_ARG(t9)
- b arg7_next
-arg7_doublep:
- l.d $f18, 6*FFI_SIZEOF_ARG(t9)
-arg7_next:
-
- SRL t4, t6, 7*FFI_FLAG_BITS
- and t4, ((1<<FFI_FLAG_BITS)-1)
- REG_L a7, 7*FFI_SIZEOF_ARG(t9)
- beqz t4, arg8_next
- bne t4, FFI_TYPE_FLOAT, arg8_doublep
- l.s $f19, 7*FFI_SIZEOF_ARG(t9)
- b arg8_next
-arg8_doublep:
- l.d $f19, 7*FFI_SIZEOF_ARG(t9)
-arg8_next:
-
-callit:
- # Load the function pointer
- REG_L t9, 5*FFI_SIZEOF_ARG($fp)
-
- # If the return value pointer is NULL, assume no return value.
- REG_L t5, 4*FFI_SIZEOF_ARG($fp)
- beqz t5, noretval
-
- # Shift the return type flag over
- SRL t6, 8*FFI_FLAG_BITS
-
- beq t6, FFI_TYPE_SINT32, retint
- bne t6, FFI_TYPE_INT, retfloat
-retint:
- jal t9
- REG_L t4, 4*FFI_SIZEOF_ARG($fp)
- REG_S v0, 0(t4)
- b epilogue
-
-retfloat:
- bne t6, FFI_TYPE_FLOAT, retdouble
- jal t9
- REG_L t4, 4*FFI_SIZEOF_ARG($fp)
- s.s $f0, 0(t4)
- b epilogue
-
-retdouble:
- bne t6, FFI_TYPE_DOUBLE, retstruct_d
- jal t9
- REG_L t4, 4*FFI_SIZEOF_ARG($fp)
- s.d $f0, 0(t4)
- b epilogue
-
-retstruct_d:
- bne t6, FFI_TYPE_STRUCT_D, retstruct_f
- jal t9
- REG_L t4, 4*FFI_SIZEOF_ARG($fp)
- s.d $f0, 0(t4)
- b epilogue
-
-retstruct_f:
- bne t6, FFI_TYPE_STRUCT_F, retstruct_d_d
- jal t9
- REG_L t4, 4*FFI_SIZEOF_ARG($fp)
- s.s $f0, 0(t4)
- b epilogue
-
-retstruct_d_d:
- bne t6, FFI_TYPE_STRUCT_DD, retstruct_f_f
- jal t9
- REG_L t4, 4*FFI_SIZEOF_ARG($fp)
- s.d $f0, 0(t4)
- s.d $f2, 8(t4)
- b epilogue
-
-retstruct_f_f:
- bne t6, FFI_TYPE_STRUCT_FF, retstruct_d_f
- jal t9
- REG_L t4, 4*FFI_SIZEOF_ARG($fp)
- s.s $f0, 0(t4)
- s.s $f2, 4(t4)
- b epilogue
-
-retstruct_d_f:
- bne t6, FFI_TYPE_STRUCT_DF, retstruct_f_d
- jal t9
- REG_L t4, 4*FFI_SIZEOF_ARG($fp)
- s.d $f0, 0(t4)
- s.s $f2, 8(t4)
- b epilogue
-
-retstruct_f_d:
- bne t6, FFI_TYPE_STRUCT_FD, retstruct_d_soft
- jal t9
- REG_L t4, 4*FFI_SIZEOF_ARG($fp)
- s.s $f0, 0(t4)
- s.d $f2, 8(t4)
- b epilogue
-
-retstruct_d_soft:
- bne t6, FFI_TYPE_STRUCT_D_SOFT, retstruct_f_soft
- jal t9
- REG_L t4, 4*FFI_SIZEOF_ARG($fp)
- sd v0, 0(t4)
- b epilogue
-
-retstruct_f_soft:
- bne t6, FFI_TYPE_STRUCT_F_SOFT, retstruct_d_d_soft
- jal t9
- REG_L t4, 4*FFI_SIZEOF_ARG($fp)
- sw v0, 0(t4)
- b epilogue
-
-retstruct_d_d_soft:
- bne t6, FFI_TYPE_STRUCT_DD_SOFT, retstruct_f_f_soft
- jal t9
- REG_L t4, 4*FFI_SIZEOF_ARG($fp)
- sd v0, 0(t4)
- sd v1, 8(t4)
- b epilogue
-
-retstruct_f_f_soft:
- bne t6, FFI_TYPE_STRUCT_FF_SOFT, retstruct_d_f_soft
- jal t9
- REG_L t4, 4*FFI_SIZEOF_ARG($fp)
- sw v0, 0(t4)
- sw v1, 4(t4)
- b epilogue
-
-retstruct_d_f_soft:
- bne t6, FFI_TYPE_STRUCT_DF_SOFT, retstruct_f_d_soft
- jal t9
- REG_L t4, 4*FFI_SIZEOF_ARG($fp)
- sd v0, 0(t4)
- sw v1, 8(t4)
- b epilogue
-
-retstruct_f_d_soft:
- bne t6, FFI_TYPE_STRUCT_FD_SOFT, retstruct_small
- jal t9
- REG_L t4, 4*FFI_SIZEOF_ARG($fp)
- sw v0, 0(t4)
- sd v1, 8(t4)
- b epilogue
-
-retstruct_small:
- bne t6, FFI_TYPE_STRUCT_SMALL, retstruct_small2
- jal t9
- REG_L t4, 4*FFI_SIZEOF_ARG($fp)
- REG_S v0, 0(t4)
- b epilogue
-
-retstruct_small2:
- bne t6, FFI_TYPE_STRUCT_SMALL2, retstruct
- jal t9
- REG_L t4, 4*FFI_SIZEOF_ARG($fp)
- REG_S v0, 0(t4)
- REG_S v1, 8(t4)
- b epilogue
-
-retstruct:
-noretval:
- jal t9
-
- # Epilogue
-epilogue:
- move $sp, $fp
- REG_L $fp, SIZEOF_FRAME - 2*FFI_SIZEOF_ARG($sp) # Restore frame pointer
- REG_L ra, SIZEOF_FRAME - 1*FFI_SIZEOF_ARG($sp) # Restore return address
- ADDU $sp, SIZEOF_FRAME # Fix stack pointer
- j ra
-
-.LFE3:
- .end ffi_call_N32
-
-/* ffi_closure_N32. Expects address of the passed-in ffi_closure in t0
- ($12). Stores any arguments passed in registers onto the stack,
- then calls ffi_closure_mips_inner_N32, which then decodes
- them.
-
- Stack layout:
-
- 20 - Start of parameters, original sp
- 19 - Called function a7 save
- 18 - Called function a6 save
- 17 - Called function a5 save
- 16 - Called function a4 save
- 15 - Called function a3 save
- 14 - Called function a2 save
- 13 - Called function a1 save
- 12 - Called function a0 save
- 11 - Called function f19
- 10 - Called function f18
- 9 - Called function f17
- 8 - Called function f16
- 7 - Called function f15
- 6 - Called function f14
- 5 - Called function f13
- 4 - Called function f12
- 3 - return value high (v1 or $f2)
- 2 - return value low (v0 or $f0)
- 1 - ra save
- 0 - gp save our sp points here
- */
-
-#define SIZEOF_FRAME2 (20 * FFI_SIZEOF_ARG)
-
-#define A7_OFF2 (19 * FFI_SIZEOF_ARG)
-#define A6_OFF2 (18 * FFI_SIZEOF_ARG)
-#define A5_OFF2 (17 * FFI_SIZEOF_ARG)
-#define A4_OFF2 (16 * FFI_SIZEOF_ARG)
-#define A3_OFF2 (15 * FFI_SIZEOF_ARG)
-#define A2_OFF2 (14 * FFI_SIZEOF_ARG)
-#define A1_OFF2 (13 * FFI_SIZEOF_ARG)
-#define A0_OFF2 (12 * FFI_SIZEOF_ARG)
-
-#define F19_OFF2 (11 * FFI_SIZEOF_ARG)
-#define F18_OFF2 (10 * FFI_SIZEOF_ARG)
-#define F17_OFF2 (9 * FFI_SIZEOF_ARG)
-#define F16_OFF2 (8 * FFI_SIZEOF_ARG)
-#define F15_OFF2 (7 * FFI_SIZEOF_ARG)
-#define F14_OFF2 (6 * FFI_SIZEOF_ARG)
-#define F13_OFF2 (5 * FFI_SIZEOF_ARG)
-#define F12_OFF2 (4 * FFI_SIZEOF_ARG)
-
-#define V1_OFF2 (3 * FFI_SIZEOF_ARG)
-#define V0_OFF2 (2 * FFI_SIZEOF_ARG)
-
-#define RA_OFF2 (1 * FFI_SIZEOF_ARG)
-#define GP_OFF2 (0 * FFI_SIZEOF_ARG)
-
- .align 2
- .globl ffi_closure_N32
- .ent ffi_closure_N32
-ffi_closure_N32:
-.LFB2:
- .frame $sp, SIZEOF_FRAME2, ra
- .mask 0x90000000,-(SIZEOF_FRAME2 - RA_OFF2)
- .fmask 0x00000000,0
- SUBU $sp, SIZEOF_FRAME2
-.LCFI5:
- .cpsetup t9, GP_OFF2, ffi_closure_N32
- REG_S ra, RA_OFF2($sp) # Save return address
-.LCFI6:
- # Store all possible argument registers. If there are more than
- # fit in registers, then they were stored on the stack.
- REG_S a0, A0_OFF2($sp)
- REG_S a1, A1_OFF2($sp)
- REG_S a2, A2_OFF2($sp)
- REG_S a3, A3_OFF2($sp)
- REG_S a4, A4_OFF2($sp)
- REG_S a5, A5_OFF2($sp)
- REG_S a6, A6_OFF2($sp)
- REG_S a7, A7_OFF2($sp)
-
- # Store all possible float/double registers.
- s.d $f12, F12_OFF2($sp)
- s.d $f13, F13_OFF2($sp)
- s.d $f14, F14_OFF2($sp)
- s.d $f15, F15_OFF2($sp)
- s.d $f16, F16_OFF2($sp)
- s.d $f17, F17_OFF2($sp)
- s.d $f18, F18_OFF2($sp)
- s.d $f19, F19_OFF2($sp)
-
- # Call ffi_closure_mips_inner_N32 to do the real work.
- LA t9, ffi_closure_mips_inner_N32
- move a0, $12 # Pointer to the ffi_closure
- ADDU a1, $sp, V0_OFF2
- ADDU a2, $sp, A0_OFF2
- ADDU a3, $sp, F12_OFF2
- jalr t9
-
- # Return flags are in v0
- bne v0, FFI_TYPE_SINT32, cls_retint
- lw v0, V0_OFF2($sp)
- b cls_epilogue
-
-cls_retint:
- bne v0, FFI_TYPE_INT, cls_retfloat
- REG_L v0, V0_OFF2($sp)
- b cls_epilogue
-
-cls_retfloat:
- bne v0, FFI_TYPE_FLOAT, cls_retdouble
- l.s $f0, V0_OFF2($sp)
- b cls_epilogue
-
-cls_retdouble:
- bne v0, FFI_TYPE_DOUBLE, cls_retstruct_d
- l.d $f0, V0_OFF2($sp)
- b cls_epilogue
-
-cls_retstruct_d:
- bne v0, FFI_TYPE_STRUCT_D, cls_retstruct_f
- l.d $f0, V0_OFF2($sp)
- b cls_epilogue
-
-cls_retstruct_f:
- bne v0, FFI_TYPE_STRUCT_F, cls_retstruct_d_d
- l.s $f0, V0_OFF2($sp)
- b cls_epilogue
-
-cls_retstruct_d_d:
- bne v0, FFI_TYPE_STRUCT_DD, cls_retstruct_f_f
- l.d $f0, V0_OFF2($sp)
- l.d $f2, V1_OFF2($sp)
- b cls_epilogue
-
-cls_retstruct_f_f:
- bne v0, FFI_TYPE_STRUCT_FF, cls_retstruct_d_f
- l.s $f0, V0_OFF2($sp)
- l.s $f2, V1_OFF2($sp)
- b cls_epilogue
-
-cls_retstruct_d_f:
- bne v0, FFI_TYPE_STRUCT_DF, cls_retstruct_f_d
- l.d $f0, V0_OFF2($sp)
- l.s $f2, V1_OFF2($sp)
- b cls_epilogue
-
-cls_retstruct_f_d:
- bne v0, FFI_TYPE_STRUCT_FD, cls_retstruct_small2
- l.s $f0, V0_OFF2($sp)
- l.d $f2, V1_OFF2($sp)
- b cls_epilogue
-
-cls_retstruct_small2:
- REG_L v0, V0_OFF2($sp)
- REG_L v1, V1_OFF2($sp)
-
- # Epilogue
-cls_epilogue:
- REG_L ra, RA_OFF2($sp) # Restore return address
- .cpreturn
- ADDU $sp, SIZEOF_FRAME2
- j ra
-.LFE2:
- .end ffi_closure_N32
-
-#ifdef __GNUC__
- .section .eh_frame,"aw",@progbits
-.Lframe1:
- .4byte .LECIE1-.LSCIE1 # length
-.LSCIE1:
- .4byte 0x0 # CIE
- .byte 0x1 # Version 1
- .ascii "\000" # Augmentation
- .uleb128 0x1 # Code alignment 1
- .sleb128 -4 # Data alignment -4
- .byte 0x1f # Return Address $31
- .byte 0xc # DW_CFA_def_cfa
- .uleb128 0x1d # in $sp
- .uleb128 0x0 # offset 0
- .align EH_FRAME_ALIGN
-.LECIE1:
-
-.LSFDE1:
- .4byte .LEFDE1-.LASFDE1 # length.
-.LASFDE1:
- .4byte .LASFDE1-.Lframe1 # CIE_pointer.
- FDE_ADDR_BYTES .LFB3 # initial_location.
- FDE_ADDR_BYTES .LFE3-.LFB3 # address_range.
- .byte 0x4 # DW_CFA_advance_loc4
- .4byte .LCFI0-.LFB3 # to .LCFI0
- .byte 0xe # DW_CFA_def_cfa_offset
- .uleb128 SIZEOF_FRAME # adjust stack.by SIZEOF_FRAME
- .byte 0x4 # DW_CFA_advance_loc4
- .4byte .LCFI1-.LCFI0 # to .LCFI1
- .byte 0x9e # DW_CFA_offset of $fp
- .uleb128 2*FFI_SIZEOF_ARG/4 #
- .byte 0x9f # DW_CFA_offset of ra
- .uleb128 1*FFI_SIZEOF_ARG/4 #
- .byte 0x4 # DW_CFA_advance_loc4
- .4byte .LCFI3-.LCFI1 # to .LCFI3
- .byte 0xd # DW_CFA_def_cfa_register
- .uleb128 0x1e # in $fp
- .align EH_FRAME_ALIGN
-.LEFDE1:
-.LSFDE3:
- .4byte .LEFDE3-.LASFDE3 # length
-.LASFDE3:
- .4byte .LASFDE3-.Lframe1 # CIE_pointer.
- FDE_ADDR_BYTES .LFB2 # initial_location.
- FDE_ADDR_BYTES .LFE2-.LFB2 # address_range.
- .byte 0x4 # DW_CFA_advance_loc4
- .4byte .LCFI5-.LFB2 # to .LCFI5
- .byte 0xe # DW_CFA_def_cfa_offset
- .uleb128 SIZEOF_FRAME2 # adjust stack.by SIZEOF_FRAME
- .byte 0x4 # DW_CFA_advance_loc4
- .4byte .LCFI6-.LCFI5 # to .LCFI6
- .byte 0x9c # DW_CFA_offset of $gp ($28)
- .uleb128 (SIZEOF_FRAME2 - GP_OFF2)/4
- .byte 0x9f # DW_CFA_offset of ra ($31)
- .uleb128 (SIZEOF_FRAME2 - RA_OFF2)/4
- .align EH_FRAME_ALIGN
-.LEFDE3:
-#endif /* __GNUC__ */
-
-#endif
diff --git a/Modules/_ctypes/libffi/src/mips/o32.S b/Modules/_ctypes/libffi/src/mips/o32.S
deleted file mode 100644
index eb279813a7..0000000000
--- a/Modules/_ctypes/libffi/src/mips/o32.S
+++ /dev/null
@@ -1,381 +0,0 @@
-/* -----------------------------------------------------------------------
- o32.S - Copyright (c) 1996, 1998, 2005 Red Hat, Inc.
-
- MIPS Foreign Function Interface
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- ``Software''), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to
- permit persons to whom the Software is furnished to do so, subject to
- the following conditions:
-
- The above copyright notice and this permission notice shall be included
- in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- DEALINGS IN THE SOFTWARE.
- ----------------------------------------------------------------------- */
-
-#define LIBFFI_ASM
-#include <fficonfig.h>
-#include <ffi.h>
-
-/* Only build this code if we are compiling for o32 */
-
-#if defined(FFI_MIPS_O32)
-
-#define callback a0
-#define bytes a2
-#define flags a3
-
-#define SIZEOF_FRAME (4 * FFI_SIZEOF_ARG + 2 * FFI_SIZEOF_ARG)
-#define A3_OFF (SIZEOF_FRAME + 3 * FFI_SIZEOF_ARG)
-#define FP_OFF (SIZEOF_FRAME - 2 * FFI_SIZEOF_ARG)
-#define RA_OFF (SIZEOF_FRAME - 1 * FFI_SIZEOF_ARG)
-
- .abicalls
- .text
- .align 2
- .globl ffi_call_O32
- .ent ffi_call_O32
-ffi_call_O32:
-$LFB0:
- # Prologue
- SUBU $sp, SIZEOF_FRAME # Frame size
-$LCFI0:
- REG_S $fp, FP_OFF($sp) # Save frame pointer
-$LCFI1:
- REG_S ra, RA_OFF($sp) # Save return address
-$LCFI2:
- move $fp, $sp
-
-$LCFI3:
- move t9, callback # callback function pointer
- REG_S flags, A3_OFF($fp) # flags
-
- # Allocate at least 4 words in the argstack
- LI v0, 4 * FFI_SIZEOF_ARG
- blt bytes, v0, sixteen
-
- ADDU v0, bytes, 7 # make sure it is aligned
- and v0, -8 # to an 8 byte boundry
-
-sixteen:
- SUBU $sp, v0 # move the stack pointer to reflect the
- # arg space
-
- ADDU a0, $sp, 4 * FFI_SIZEOF_ARG
-
- jalr t9
-
- REG_L t0, A3_OFF($fp) # load the flags word
- SRL t2, t0, 4 # shift our arg info
- and t0, ((1<<4)-1) # mask out the return type
-
- ADDU $sp, 4 * FFI_SIZEOF_ARG # adjust $sp to new args
-
- bnez t0, pass_d # make it quick for int
- REG_L a0, 0*FFI_SIZEOF_ARG($sp) # just go ahead and load the
- REG_L a1, 1*FFI_SIZEOF_ARG($sp) # four regs.
- REG_L a2, 2*FFI_SIZEOF_ARG($sp)
- REG_L a3, 3*FFI_SIZEOF_ARG($sp)
- b call_it
-
-pass_d:
- bne t0, FFI_ARGS_D, pass_f
- l.d $f12, 0*FFI_SIZEOF_ARG($sp) # load $fp regs from args
- REG_L a2, 2*FFI_SIZEOF_ARG($sp) # passing a double
- REG_L a3, 3*FFI_SIZEOF_ARG($sp)
- b call_it
-
-pass_f:
- bne t0, FFI_ARGS_F, pass_d_d
- l.s $f12, 0*FFI_SIZEOF_ARG($sp) # load $fp regs from args
- REG_L a1, 1*FFI_SIZEOF_ARG($sp) # passing a float
- REG_L a2, 2*FFI_SIZEOF_ARG($sp)
- REG_L a3, 3*FFI_SIZEOF_ARG($sp)
- b call_it
-
-pass_d_d:
- bne t0, FFI_ARGS_DD, pass_f_f
- l.d $f12, 0*FFI_SIZEOF_ARG($sp) # load $fp regs from args
- l.d $f14, 2*FFI_SIZEOF_ARG($sp) # passing two doubles
- b call_it
-
-pass_f_f:
- bne t0, FFI_ARGS_FF, pass_d_f
- l.s $f12, 0*FFI_SIZEOF_ARG($sp) # load $fp regs from args
- l.s $f14, 1*FFI_SIZEOF_ARG($sp) # passing two floats
- REG_L a2, 2*FFI_SIZEOF_ARG($sp)
- REG_L a3, 3*FFI_SIZEOF_ARG($sp)
- b call_it
-
-pass_d_f:
- bne t0, FFI_ARGS_DF, pass_f_d
- l.d $f12, 0*FFI_SIZEOF_ARG($sp) # load $fp regs from args
- l.s $f14, 2*FFI_SIZEOF_ARG($sp) # passing double and float
- REG_L a3, 3*FFI_SIZEOF_ARG($sp)
- b call_it
-
-pass_f_d:
- # assume that the only other combination must be float then double
- # bne t0, FFI_ARGS_F_D, call_it
- l.s $f12, 0*FFI_SIZEOF_ARG($sp) # load $fp regs from args
- l.d $f14, 2*FFI_SIZEOF_ARG($sp) # passing double and float
-
-call_it:
- # Load the function pointer
- REG_L t9, SIZEOF_FRAME + 5*FFI_SIZEOF_ARG($fp)
-
- # If the return value pointer is NULL, assume no return value.
- REG_L t1, SIZEOF_FRAME + 4*FFI_SIZEOF_ARG($fp)
- beqz t1, noretval
-
- bne t2, FFI_TYPE_INT, retlonglong
- jalr t9
- REG_L t0, SIZEOF_FRAME + 4*FFI_SIZEOF_ARG($fp)
- REG_S v0, 0(t0)
- b epilogue
-
-retlonglong:
- # Really any 64-bit int, signed or not.
- bne t2, FFI_TYPE_UINT64, retfloat
- jalr t9
- REG_L t0, SIZEOF_FRAME + 4*FFI_SIZEOF_ARG($fp)
- REG_S v1, 4(t0)
- REG_S v0, 0(t0)
- b epilogue
-
-retfloat:
- bne t2, FFI_TYPE_FLOAT, retdouble
- jalr t9
- REG_L t0, SIZEOF_FRAME + 4*FFI_SIZEOF_ARG($fp)
- s.s $f0, 0(t0)
- b epilogue
-
-retdouble:
- bne t2, FFI_TYPE_DOUBLE, noretval
- jalr t9
- REG_L t0, SIZEOF_FRAME + 4*FFI_SIZEOF_ARG($fp)
- s.d $f0, 0(t0)
- b epilogue
-
-noretval:
- jalr t9
-
- # Epilogue
-epilogue:
- move $sp, $fp
- REG_L $fp, FP_OFF($sp) # Restore frame pointer
- REG_L ra, RA_OFF($sp) # Restore return address
- ADDU $sp, SIZEOF_FRAME # Fix stack pointer
- j ra
-
-$LFE0:
- .end ffi_call_O32
-
-
-/* ffi_closure_O32. Expects address of the passed-in ffi_closure
- in t4 ($12). Stores any arguments passed in registers onto the
- stack, then calls ffi_closure_mips_inner_O32, which
- then decodes them.
-
- Stack layout:
-
- 3 - a3 save
- 2 - a2 save
- 1 - a1 save
- 0 - a0 save, original sp
- -1 - ra save
- -2 - fp save
- -3 - $16 (s0) save
- -4 - cprestore
- -5 - return value high (v1)
- -6 - return value low (v0)
- -7 - f14 (le high, be low)
- -8 - f14 (le low, be high)
- -9 - f12 (le high, be low)
- -10 - f12 (le low, be high)
- -11 - Called function a3 save
- -12 - Called function a2 save
- -13 - Called function a1 save
- -14 - Called function a0 save, our sp and fp point here
- */
-
-#define SIZEOF_FRAME2 (14 * FFI_SIZEOF_ARG)
-#define A3_OFF2 (SIZEOF_FRAME2 + 3 * FFI_SIZEOF_ARG)
-#define A2_OFF2 (SIZEOF_FRAME2 + 2 * FFI_SIZEOF_ARG)
-#define A1_OFF2 (SIZEOF_FRAME2 + 1 * FFI_SIZEOF_ARG)
-#define A0_OFF2 (SIZEOF_FRAME2 + 0 * FFI_SIZEOF_ARG)
-#define RA_OFF2 (SIZEOF_FRAME2 - 1 * FFI_SIZEOF_ARG)
-#define FP_OFF2 (SIZEOF_FRAME2 - 2 * FFI_SIZEOF_ARG)
-#define S0_OFF2 (SIZEOF_FRAME2 - 3 * FFI_SIZEOF_ARG)
-#define GP_OFF2 (SIZEOF_FRAME2 - 4 * FFI_SIZEOF_ARG)
-#define V1_OFF2 (SIZEOF_FRAME2 - 5 * FFI_SIZEOF_ARG)
-#define V0_OFF2 (SIZEOF_FRAME2 - 6 * FFI_SIZEOF_ARG)
-#define FA_1_1_OFF2 (SIZEOF_FRAME2 - 7 * FFI_SIZEOF_ARG)
-#define FA_1_0_OFF2 (SIZEOF_FRAME2 - 8 * FFI_SIZEOF_ARG)
-#define FA_0_1_OFF2 (SIZEOF_FRAME2 - 9 * FFI_SIZEOF_ARG)
-#define FA_0_0_OFF2 (SIZEOF_FRAME2 - 10 * FFI_SIZEOF_ARG)
-
- .text
- .align 2
- .globl ffi_closure_O32
- .ent ffi_closure_O32
-ffi_closure_O32:
-$LFB1:
- # Prologue
- .frame $fp, SIZEOF_FRAME2, ra
- .set noreorder
- .cpload t9
- .set reorder
- SUBU $sp, SIZEOF_FRAME2
- .cprestore GP_OFF2
-$LCFI4:
- REG_S $16, S0_OFF2($sp) # Save s0
- REG_S $fp, FP_OFF2($sp) # Save frame pointer
- REG_S ra, RA_OFF2($sp) # Save return address
-$LCFI6:
- move $fp, $sp
-
-$LCFI7:
- # Store all possible argument registers. If there are more than
- # four arguments, then they are stored above where we put a3.
- REG_S a0, A0_OFF2($fp)
- REG_S a1, A1_OFF2($fp)
- REG_S a2, A2_OFF2($fp)
- REG_S a3, A3_OFF2($fp)
-
- # Load ABI enum to s0
- REG_L $16, 20($12) # cif pointer follows tramp.
- REG_L $16, 0($16) # abi is first member.
-
- li $13, 1 # FFI_O32
- bne $16, $13, 1f # Skip fp save if FFI_O32_SOFT_FLOAT
-
- # Store all possible float/double registers.
- s.d $f12, FA_0_0_OFF2($fp)
- s.d $f14, FA_1_0_OFF2($fp)
-1:
- # Call ffi_closure_mips_inner_O32 to do the work.
- la t9, ffi_closure_mips_inner_O32
- move a0, $12 # Pointer to the ffi_closure
- addu a1, $fp, V0_OFF2
- addu a2, $fp, A0_OFF2
- addu a3, $fp, FA_0_0_OFF2
- jalr t9
-
- # Load the return value into the appropriate register.
- move $8, $2
- li $9, FFI_TYPE_VOID
- beq $8, $9, closure_done
-
- li $13, 1 # FFI_O32
- bne $16, $13, 1f # Skip fp restore if FFI_O32_SOFT_FLOAT
-
- li $9, FFI_TYPE_FLOAT
- l.s $f0, V0_OFF2($fp)
- beq $8, $9, closure_done
-
- li $9, FFI_TYPE_DOUBLE
- l.d $f0, V0_OFF2($fp)
- beq $8, $9, closure_done
-1:
- REG_L $3, V1_OFF2($fp)
- REG_L $2, V0_OFF2($fp)
-
-closure_done:
- # Epilogue
- move $sp, $fp
- REG_L $16, S0_OFF2($sp) # Restore s0
- REG_L $fp, FP_OFF2($sp) # Restore frame pointer
- REG_L ra, RA_OFF2($sp) # Restore return address
- ADDU $sp, SIZEOF_FRAME2
- j ra
-$LFE1:
- .end ffi_closure_O32
-
-/* DWARF-2 unwind info. */
-
- .section .eh_frame,"a",@progbits
-$Lframe0:
- .4byte $LECIE0-$LSCIE0 # Length of Common Information Entry
-$LSCIE0:
- .4byte 0x0 # CIE Identifier Tag
- .byte 0x1 # CIE Version
- .ascii "zR\0" # CIE Augmentation
- .uleb128 0x1 # CIE Code Alignment Factor
- .sleb128 4 # CIE Data Alignment Factor
- .byte 0x1f # CIE RA Column
- .uleb128 0x1 # Augmentation size
- .byte 0x00 # FDE Encoding (absptr)
- .byte 0xc # DW_CFA_def_cfa
- .uleb128 0x1d
- .uleb128 0x0
- .align 2
-$LECIE0:
-$LSFDE0:
- .4byte $LEFDE0-$LASFDE0 # FDE Length
-$LASFDE0:
- .4byte $LASFDE0-$Lframe0 # FDE CIE offset
- .4byte $LFB0 # FDE initial location
- .4byte $LFE0-$LFB0 # FDE address range
- .uleb128 0x0 # Augmentation size
- .byte 0x4 # DW_CFA_advance_loc4
- .4byte $LCFI0-$LFB0
- .byte 0xe # DW_CFA_def_cfa_offset
- .uleb128 0x18
- .byte 0x4 # DW_CFA_advance_loc4
- .4byte $LCFI2-$LCFI0
- .byte 0x11 # DW_CFA_offset_extended_sf
- .uleb128 0x1e # $fp
- .sleb128 -2 # SIZEOF_FRAME2 - 2*FFI_SIZEOF_ARG($sp)
- .byte 0x11 # DW_CFA_offset_extended_sf
- .uleb128 0x1f # $ra
- .sleb128 -1 # SIZEOF_FRAME2 - 1*FFI_SIZEOF_ARG($sp)
- .byte 0x4 # DW_CFA_advance_loc4
- .4byte $LCFI3-$LCFI2
- .byte 0xc # DW_CFA_def_cfa
- .uleb128 0x1e
- .uleb128 0x18
- .align 2
-$LEFDE0:
-$LSFDE1:
- .4byte $LEFDE1-$LASFDE1 # FDE Length
-$LASFDE1:
- .4byte $LASFDE1-$Lframe0 # FDE CIE offset
- .4byte $LFB1 # FDE initial location
- .4byte $LFE1-$LFB1 # FDE address range
- .uleb128 0x0 # Augmentation size
- .byte 0x4 # DW_CFA_advance_loc4
- .4byte $LCFI4-$LFB1
- .byte 0xe # DW_CFA_def_cfa_offset
- .uleb128 0x38
- .byte 0x4 # DW_CFA_advance_loc4
- .4byte $LCFI6-$LCFI4
- .byte 0x11 # DW_CFA_offset_extended_sf
- .uleb128 0x10 # $16
- .sleb128 -3 # SIZEOF_FRAME2 - 3*FFI_SIZEOF_ARG($sp)
- .byte 0x11 # DW_CFA_offset_extended_sf
- .uleb128 0x1e # $fp
- .sleb128 -2 # SIZEOF_FRAME2 - 2*FFI_SIZEOF_ARG($sp)
- .byte 0x11 # DW_CFA_offset_extended_sf
- .uleb128 0x1f # $ra
- .sleb128 -1 # SIZEOF_FRAME2 - 1*FFI_SIZEOF_ARG($sp)
- .byte 0x4 # DW_CFA_advance_loc4
- .4byte $LCFI7-$LCFI6
- .byte 0xc # DW_CFA_def_cfa
- .uleb128 0x1e
- .uleb128 0x38
- .align 2
-$LEFDE1:
-
-#endif
diff --git a/Modules/_ctypes/libffi/src/moxie/eabi.S b/Modules/_ctypes/libffi/src/moxie/eabi.S
deleted file mode 100644
index ac7aceb1a6..0000000000
--- a/Modules/_ctypes/libffi/src/moxie/eabi.S
+++ /dev/null
@@ -1,101 +0,0 @@
-/* -----------------------------------------------------------------------
- eabi.S - Copyright (c) 2012, 2013 Anthony Green
-
- Moxie Assembly glue.
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- ``Software''), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to
- permit persons to whom the Software is furnished to do so, subject to
- the following conditions:
-
- The above copyright notice and this permission notice shall be included
- in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS
- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR
- OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- OTHER DEALINGS IN THE SOFTWARE.
- ----------------------------------------------------------------------- */
-
-#define LIBFFI_ASM
-#include <fficonfig.h>
-#include <ffi.h>
-
- .globl ffi_prep_args_EABI
-
- .text
- .p2align 4
- .globl ffi_call_EABI
- .type ffi_call_EABI, @function
-
- # $r0 : ffi_prep_args
- # $r1 : &ecif
- # $r2 : cif->bytes
- # $r3 : fig->flags
- # $r4 : ecif.rvalue
- # $r5 : fn
-
-ffi_call_EABI:
- push $sp, $r6
- push $sp, $r7
- push $sp, $r8
- dec $sp, 24
-
- /* Store incoming args on stack. */
- sto.l 0($sp), $r0 /* ffi_prep_args */
- sto.l 4($sp), $r1 /* ecif */
- sto.l 8($sp), $r2 /* bytes */
- sto.l 12($sp), $r3 /* flags */
- sto.l 16($sp), $r4 /* &rvalue */
- sto.l 20($sp), $r5 /* fn */
-
- /* Call ffi_prep_args. */
- mov $r6, $r4 /* Save result buffer */
- mov $r7, $r5 /* Save the target fn */
- mov $r8, $r3 /* Save the flags */
- sub.l $sp, $r2 /* Allocate stack space */
- mov $r0, $sp /* We can stomp over $r0 */
- /* $r1 is already set up */
- jsra ffi_prep_args
-
- /* Load register arguments. */
- ldo.l $r0, 0($sp)
- ldo.l $r1, 4($sp)
- ldo.l $r2, 8($sp)
- ldo.l $r3, 12($sp)
- ldo.l $r4, 16($sp)
- ldo.l $r5, 20($sp)
-
- /* Call the target function. */
- jsr $r7
-
- ldi.l $r7, 0xffffffff
- cmp $r8, $r7
- beq retstruct
-
- ldi.l $r7, 4
- cmp $r8, $r7
- bgt ret2reg
-
- st.l ($r6), $r0
- jmpa retdone
-
-ret2reg:
- st.l ($r6), $r0
- sto.l 4($r6), $r1
-
-retstruct:
-retdone:
- /* Return. */
- ldo.l $r6, -4($fp)
- ldo.l $r7, -8($fp)
- ldo.l $r8, -12($fp)
- ret
- .size ffi_call_EABI, .-ffi_call_EABI
-
diff --git a/Modules/_ctypes/libffi/src/moxie/ffi.c b/Modules/_ctypes/libffi/src/moxie/ffi.c
deleted file mode 100644
index 540a042996..0000000000
--- a/Modules/_ctypes/libffi/src/moxie/ffi.c
+++ /dev/null
@@ -1,272 +0,0 @@
-/* -----------------------------------------------------------------------
- ffi.c - Copyright (C) 2012, 2013 Anthony Green
-
- Moxie Foreign Function Interface
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- ``Software''), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to
- permit persons to whom the Software is furnished to do so, subject to
- the following conditions:
-
- The above copyright notice and this permission notice shall be included
- in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- DEALINGS IN THE SOFTWARE.
- ----------------------------------------------------------------------- */
-
-#include <ffi.h>
-#include <ffi_common.h>
-
-#include <stdlib.h>
-
-/* ffi_prep_args is called by the assembly routine once stack space
- has been allocated for the function's arguments */
-
-void *ffi_prep_args(char *stack, extended_cif *ecif)
-{
- register unsigned int i;
- register void **p_argv;
- register char *argp;
- register ffi_type **p_arg;
- register int count = 0;
-
- p_argv = ecif->avalue;
- argp = stack;
-
- if (ecif->cif->rtype->type == FFI_TYPE_STRUCT)
- {
- *(void **) argp = ecif->rvalue;
- argp += 4;
- }
-
- for (i = ecif->cif->nargs, p_arg = ecif->cif->arg_types;
- (i != 0);
- i--, p_arg++)
- {
- size_t z;
-
- z = (*p_arg)->size;
-
- if ((*p_arg)->type == FFI_TYPE_STRUCT)
- {
- z = sizeof(void*);
- *(void **) argp = *p_argv;
- }
- else if (z < sizeof(int))
- {
- z = sizeof(int);
- switch ((*p_arg)->type)
- {
- case FFI_TYPE_SINT8:
- *(signed int *) argp = (signed int)*(SINT8 *)(* p_argv);
- break;
-
- case FFI_TYPE_UINT8:
- *(unsigned int *) argp = (unsigned int)*(UINT8 *)(* p_argv);
- break;
-
- case FFI_TYPE_SINT16:
- *(signed int *) argp = (signed int)*(SINT16 *)(* p_argv);
- break;
-
- case FFI_TYPE_UINT16:
- *(unsigned int *) argp = (unsigned int)*(UINT16 *)(* p_argv);
- break;
-
- default:
- FFI_ASSERT(0);
- }
- }
- else if (z == sizeof(int))
- {
- *(unsigned int *) argp = (unsigned int)*(UINT32 *)(* p_argv);
- }
- else
- {
- memcpy(argp, *p_argv, z);
- }
- p_argv++;
- argp += z;
- count += z;
- }
-
- return (stack + ((count > 24) ? 24 : ALIGN_DOWN(count, 8)));
-}
-
-/* Perform machine dependent cif processing */
-ffi_status ffi_prep_cif_machdep(ffi_cif *cif)
-{
- if (cif->rtype->type == FFI_TYPE_STRUCT)
- cif->flags = -1;
- else
- cif->flags = cif->rtype->size;
-
- cif->bytes = ALIGN (cif->bytes, 8);
-
- return FFI_OK;
-}
-
-extern void ffi_call_EABI(void *(*)(char *, extended_cif *),
- extended_cif *,
- unsigned, unsigned,
- unsigned *,
- void (*fn)(void));
-
-void ffi_call(ffi_cif *cif,
- void (*fn)(void),
- void *rvalue,
- void **avalue)
-{
- extended_cif ecif;
-
- ecif.cif = cif;
- ecif.avalue = avalue;
-
- /* If the return value is a struct and we don't have a return */
- /* value address then we need to make one */
-
- if ((rvalue == NULL) &&
- (cif->rtype->type == FFI_TYPE_STRUCT))
- {
- ecif.rvalue = alloca(cif->rtype->size);
- }
- else
- ecif.rvalue = rvalue;
-
- switch (cif->abi)
- {
- case FFI_EABI:
- ffi_call_EABI(ffi_prep_args, &ecif, cif->bytes,
- cif->flags, ecif.rvalue, fn);
- break;
- default:
- FFI_ASSERT(0);
- break;
- }
-}
-
-void ffi_closure_eabi (unsigned arg1, unsigned arg2, unsigned arg3,
- unsigned arg4, unsigned arg5, unsigned arg6)
-{
- /* This function is called by a trampoline. The trampoline stows a
- pointer to the ffi_closure object in $r7. We must save this
- pointer in a place that will persist while we do our work. */
- register ffi_closure *creg __asm__ ("$r12");
- ffi_closure *closure = creg;
-
- /* Arguments that don't fit in registers are found on the stack
- at a fixed offset above the current frame pointer. */
- register char *frame_pointer __asm__ ("$fp");
-
- /* Pointer to a struct return value. */
- void *struct_rvalue = (void *) arg1;
-
- /* 6 words reserved for register args + 3 words from jsr */
- char *stack_args = frame_pointer + 9*4;
-
- /* Lay the register arguments down in a continuous chunk of memory. */
- unsigned register_args[6] =
- { arg1, arg2, arg3, arg4, arg5, arg6 };
- char *register_args_ptr = (char *) register_args;
-
- ffi_cif *cif = closure->cif;
- ffi_type **arg_types = cif->arg_types;
- void **avalue = alloca (cif->nargs * sizeof(void *));
- char *ptr = (char *) register_args;
- int i;
-
- /* preserve struct type return pointer passing */
- if ((cif->rtype != NULL) && (cif->rtype->type == FFI_TYPE_STRUCT)) {
- ptr += 4;
- register_args_ptr = (char *)&register_args[1];
- }
-
- /* Find the address of each argument. */
- for (i = 0; i < cif->nargs; i++)
- {
- switch (arg_types[i]->type)
- {
- case FFI_TYPE_SINT8:
- case FFI_TYPE_UINT8:
- avalue[i] = ptr + 3;
- break;
- case FFI_TYPE_SINT16:
- case FFI_TYPE_UINT16:
- avalue[i] = ptr + 2;
- break;
- case FFI_TYPE_SINT32:
- case FFI_TYPE_UINT32:
- case FFI_TYPE_FLOAT:
- case FFI_TYPE_POINTER:
- avalue[i] = ptr;
- break;
- case FFI_TYPE_STRUCT:
- avalue[i] = *(void**)ptr;
- break;
- default:
- /* This is an 8-byte value. */
- avalue[i] = ptr;
- ptr += 4;
- break;
- }
- ptr += 4;
-
- /* If we've handled more arguments than fit in registers,
- start looking at the those passed on the stack. */
- if (ptr == &register_args[6])
- ptr = stack_args;
- }
-
- /* Invoke the closure. */
- if (cif->rtype && (cif->rtype->type == FFI_TYPE_STRUCT))
- {
- (closure->fun) (cif, struct_rvalue, avalue, closure->user_data);
- }
- else
- {
- /* Allocate space for the return value and call the function. */
- long long rvalue;
- (closure->fun) (cif, &rvalue, avalue, closure->user_data);
- asm ("mov $r12, %0\n ld.l $r0, ($r12)\n ldo.l $r1, 4($r12)" : : "r" (&rvalue));
- }
-}
-
-ffi_status
-ffi_prep_closure_loc (ffi_closure* closure,
- ffi_cif* cif,
- void (*fun)(ffi_cif*, void*, void**, void*),
- void *user_data,
- void *codeloc)
-{
- unsigned short *tramp = (unsigned short *) &closure->tramp[0];
- unsigned long fn = (long) ffi_closure_eabi;
- unsigned long cls = (long) codeloc;
-
- if (cif->abi != FFI_EABI)
- return FFI_BAD_ABI;
-
- fn = (unsigned long) ffi_closure_eabi;
-
- tramp[0] = 0x01e0; /* ldi.l $r7, .... */
- tramp[1] = cls >> 16;
- tramp[2] = cls & 0xffff;
- tramp[3] = 0x1a00; /* jmpa .... */
- tramp[4] = fn >> 16;
- tramp[5] = fn & 0xffff;
-
- closure->cif = cif;
- closure->fun = fun;
- closure->user_data = user_data;
-
- return FFI_OK;
-}
diff --git a/Modules/_ctypes/libffi/src/moxie/ffitarget.h b/Modules/_ctypes/libffi/src/moxie/ffitarget.h
deleted file mode 100644
index 623e3ece57..0000000000
--- a/Modules/_ctypes/libffi/src/moxie/ffitarget.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/* -----------------------------------------------------------------*-C-*-
- ffitarget.h - Copyright (c) 2012, 2013 Anthony Green
- Target configuration macros for Moxie
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- ``Software''), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to
- permit persons to whom the Software is furnished to do so, subject to
- the following conditions:
-
- The above copyright notice and this permission notice shall be included
- in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- DEALINGS IN THE SOFTWARE.
-
- ----------------------------------------------------------------------- */
-
-#ifndef LIBFFI_TARGET_H
-#define LIBFFI_TARGET_H
-
-/* ---- System specific configurations ----------------------------------- */
-
-#ifndef LIBFFI_ASM
-typedef unsigned long ffi_arg;
-typedef signed long ffi_sarg;
-
-typedef enum ffi_abi {
- FFI_FIRST_ABI = 0,
- FFI_EABI,
- FFI_DEFAULT_ABI = FFI_EABI,
- FFI_LAST_ABI = FFI_DEFAULT_ABI + 1
-} ffi_abi;
-#endif
-
-/* ---- Definitions for closures ----------------------------------------- */
-
-#define FFI_CLOSURES 1
-#define FFI_NATIVE_RAW_API 0
-
-/* Trampolines are 12-bytes long. See ffi_prep_closure_loc. */
-#define FFI_TRAMPOLINE_SIZE (12)
-
-#endif
diff --git a/Modules/_ctypes/libffi/src/nios2/ffi.c b/Modules/_ctypes/libffi/src/nios2/ffi.c
deleted file mode 100644
index 2efa033f9c..0000000000
--- a/Modules/_ctypes/libffi/src/nios2/ffi.c
+++ /dev/null
@@ -1,304 +0,0 @@
-/* libffi support for Altera Nios II.
-
- Copyright (c) 2013 Mentor Graphics.
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- ``Software''), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to
- permit persons to whom the Software is furnished to do so, subject to
- the following conditions:
-
- The above copyright notice and this permission notice shall be
- included in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
- CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
-
-
-#include <ffi.h>
-#include <ffi_common.h>
-
-#include <stdlib.h>
-
-/* The Nios II Processor Reference Handbook defines the procedure call
- ABI as follows.
-
- Arguments are passed as if a structure containing the types of
- the arguments were constructed. The first 16 bytes are passed in r4
- through r7, the remainder on the stack. The first 16 bytes of a function
- taking variable arguments are passed in r4-r7 in the same way.
-
- Return values of types up to 8 bytes are returned in r2 and r3. For
- return values greater than 8 bytes, the caller must allocate memory for
- the result and pass the address as if it were argument 0.
-
- While this isn't specified explicitly in the ABI documentation, GCC
- promotes integral arguments smaller than int size to 32 bits.
-
- Also of note, the ABI specifies that all structure objects are
- aligned to 32 bits even if all their fields have a smaller natural
- alignment. See FFI_AGGREGATE_ALIGNMENT. */
-
-
-/* Declare the assembly language hooks. */
-
-extern UINT64 ffi_call_sysv (void (*) (char *, extended_cif *),
- extended_cif *,
- unsigned,
- void (*fn) (void));
-extern void ffi_closure_sysv (void);
-
-/* Perform machine-dependent cif processing. */
-
-ffi_status ffi_prep_cif_machdep (ffi_cif *cif)
-{
- /* We always want at least 16 bytes in the parameter block since it
- simplifies the low-level call function. Also round the parameter
- block size up to a multiple of 4 bytes to preserve
- 32-bit alignment of the stack pointer. */
- if (cif->bytes < 16)
- cif->bytes = 16;
- else
- cif->bytes = (cif->bytes + 3) & ~3;
-
- return FFI_OK;
-}
-
-
-/* ffi_prep_args is called by the assembly routine to transfer arguments
- to the stack using the pointers in the ecif array.
- Note that the stack buffer is big enough to fit all the arguments,
- but the first 16 bytes will be copied to registers for the actual
- call. */
-
-void ffi_prep_args (char *stack, extended_cif *ecif)
-{
- char *argp = stack;
- unsigned int i;
-
- /* The implicit return value pointer is passed as if it were a hidden
- first argument. */
- if (ecif->cif->rtype->type == FFI_TYPE_STRUCT
- && ecif->cif->rtype->size > 8)
- {
- (*(void **) argp) = ecif->rvalue;
- argp += 4;
- }
-
- for (i = 0; i < ecif->cif->nargs; i++)
- {
- void *avalue = ecif->avalue[i];
- ffi_type *atype = ecif->cif->arg_types[i];
- size_t size = atype->size;
- size_t alignment = atype->alignment;
-
- /* Align argp as appropriate for the argument type. */
- if ((alignment - 1) & (unsigned) argp)
- argp = (char *) ALIGN (argp, alignment);
-
- /* Copy the argument, promoting integral types smaller than a
- word to word size. */
- if (size < sizeof (int))
- {
- size = sizeof (int);
- switch (atype->type)
- {
- case FFI_TYPE_SINT8:
- *(signed int *) argp = (signed int) *(SINT8 *) avalue;
- break;
-
- case FFI_TYPE_UINT8:
- *(unsigned int *) argp = (unsigned int) *(UINT8 *) avalue;
- break;
-
- case FFI_TYPE_SINT16:
- *(signed int *) argp = (signed int) *(SINT16 *) avalue;
- break;
-
- case FFI_TYPE_UINT16:
- *(unsigned int *) argp = (unsigned int) *(UINT16 *) avalue;
- break;
-
- case FFI_TYPE_STRUCT:
- memcpy (argp, avalue, atype->size);
- break;
-
- default:
- FFI_ASSERT(0);
- }
- }
- else if (size == sizeof (int))
- *(unsigned int *) argp = (unsigned int) *(UINT32 *) avalue;
- else
- memcpy (argp, avalue, size);
- argp += size;
- }
-}
-
-
-/* Call FN using the prepared CIF. RVALUE points to space allocated by
- the caller for the return value, and AVALUE is an array of argument
- pointers. */
-
-void ffi_call (ffi_cif *cif, void (*fn) (void), void *rvalue, void **avalue)
-{
-
- extended_cif ecif;
- UINT64 result;
-
- /* If bigret is true, this is the case where a return value of larger
- than 8 bytes is handled by being passed by reference as an implicit
- argument. */
- int bigret = (cif->rtype->type == FFI_TYPE_STRUCT
- && cif->rtype->size > 8);
-
- ecif.cif = cif;
- ecif.avalue = avalue;
-
- /* Allocate space for return value if this is the pass-by-reference case
- and the caller did not provide a buffer. */
- if (rvalue == NULL && bigret)
- ecif.rvalue = alloca (cif->rtype->size);
- else
- ecif.rvalue = rvalue;
-
- result = ffi_call_sysv (ffi_prep_args, &ecif, cif->bytes, fn);
-
- /* Now result contains the 64 bit contents returned from fn in
- r2 and r3. Copy the value of the appropriate size to the user-provided
- rvalue buffer. */
- if (rvalue && !bigret)
- switch (cif->rtype->size)
- {
- case 1:
- *(UINT8 *)rvalue = (UINT8) result;
- break;
- case 2:
- *(UINT16 *)rvalue = (UINT16) result;
- break;
- case 4:
- *(UINT32 *)rvalue = (UINT32) result;
- break;
- case 8:
- *(UINT64 *)rvalue = (UINT64) result;
- break;
- default:
- memcpy (rvalue, (void *)&result, cif->rtype->size);
- break;
- }
-}
-
-/* This function is invoked from the closure trampoline to invoke
- CLOSURE with argument block ARGS. Parse ARGS according to
- CLOSURE->cfi and invoke CLOSURE->fun. */
-
-static UINT64
-ffi_closure_helper (unsigned char *args,
- ffi_closure *closure)
-{
- ffi_cif *cif = closure->cif;
- unsigned char *argp = args;
- void **parsed_args = alloca (cif->nargs * sizeof (void *));
- UINT64 result;
- void *retptr;
- unsigned int i;
-
- /* First figure out what to do about the return type. If this is the
- big-structure-return case, the first arg is the hidden return buffer
- allocated by the caller. */
- if (cif->rtype->type == FFI_TYPE_STRUCT
- && cif->rtype->size > 8)
- {
- retptr = *((void **) argp);
- argp += 4;
- }
- else
- retptr = (void *) &result;
-
- /* Fill in the array of argument pointers. */
- for (i = 0; i < cif->nargs; i++)
- {
- size_t size = cif->arg_types[i]->size;
- size_t alignment = cif->arg_types[i]->alignment;
-
- /* Align argp as appropriate for the argument type. */
- if ((alignment - 1) & (unsigned) argp)
- argp = (char *) ALIGN (argp, alignment);
-
- /* Arguments smaller than an int are promoted to int. */
- if (size < sizeof (int))
- size = sizeof (int);
-
- /* Store the pointer. */
- parsed_args[i] = argp;
- argp += size;
- }
-
- /* Call the user-supplied function. */
- (closure->fun) (cif, retptr, parsed_args, closure->user_data);
- return result;
-}
-
-
-/* Initialize CLOSURE with a trampoline to call FUN with
- CIF and USER_DATA. */
-ffi_status
-ffi_prep_closure_loc (ffi_closure* closure,
- ffi_cif* cif,
- void (*fun) (ffi_cif*, void*, void**, void*),
- void *user_data,
- void *codeloc)
-{
- unsigned int *tramp = (unsigned int *) &closure->tramp[0];
- int i;
-
- if (cif->abi != FFI_SYSV)
- return FFI_BAD_ABI;
-
- /* The trampoline looks like:
- movhi r8, %hi(ffi_closure_sysv)
- ori r8, r8, %lo(ffi_closure_sysv)
- movhi r9, %hi(ffi_closure_helper)
- ori r0, r9, %lo(ffi_closure_helper)
- movhi r10, %hi(closure)
- ori r10, r10, %lo(closure)
- jmp r8
- and then ffi_closure_sysv retrieves the closure pointer out of r10
- in addition to the arguments passed in the normal way for the call,
- and invokes ffi_closure_helper. We encode the pointer to
- ffi_closure_helper in the trampoline because making a PIC call
- to it in ffi_closure_sysv would be messy (it would have to indirect
- through the GOT). */
-
-#define HI(x) ((((unsigned int) (x)) >> 16) & 0xffff)
-#define LO(x) (((unsigned int) (x)) & 0xffff)
- tramp[0] = (0 << 27) | (8 << 22) | (HI (ffi_closure_sysv) << 6) | 0x34;
- tramp[1] = (8 << 27) | (8 << 22) | (LO (ffi_closure_sysv) << 6) | 0x14;
- tramp[2] = (0 << 27) | (9 << 22) | (HI (ffi_closure_helper) << 6) | 0x34;
- tramp[3] = (9 << 27) | (9 << 22) | (LO (ffi_closure_helper) << 6) | 0x14;
- tramp[4] = (0 << 27) | (10 << 22) | (HI (closure) << 6) | 0x34;
- tramp[5] = (10 << 27) | (10 << 22) | (LO (closure) << 6) | 0x14;
- tramp[6] = (8 << 27) | (0x0d << 11) | 0x3a;
-#undef HI
-#undef LO
-
- /* Flush the caches.
- See Example 9-4 in the Nios II Software Developer's Handbook. */
- for (i = 0; i < 7; i++)
- asm volatile ("flushd 0(%0); flushi %0" :: "r"(tramp + i) : "memory");
- asm volatile ("flushp" ::: "memory");
-
- closure->cif = cif;
- closure->fun = fun;
- closure->user_data = user_data;
-
- return FFI_OK;
-}
-
diff --git a/Modules/_ctypes/libffi/src/nios2/ffitarget.h b/Modules/_ctypes/libffi/src/nios2/ffitarget.h
deleted file mode 100644
index 134d118c12..0000000000
--- a/Modules/_ctypes/libffi/src/nios2/ffitarget.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/* libffi target includes for Altera Nios II.
-
- Copyright (c) 2013 Mentor Graphics.
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- ``Software''), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to
- permit persons to whom the Software is furnished to do so, subject to
- the following conditions:
-
- The above copyright notice and this permission notice shall be
- included in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
- CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
-
-
-#ifndef LIBFFI_TARGET_H
-#define LIBFFI_TARGET_H
-
-#ifndef LIBFFI_H
-#error "Please do not include ffitarget.h directly into your source. Use ffi.h instead."
-#endif
-
-#ifndef LIBFFI_ASM
-typedef unsigned long ffi_arg;
-typedef signed long ffi_sarg;
-
-typedef enum ffi_abi {
- FFI_FIRST_ABI = 0,
- FFI_SYSV,
- FFI_LAST_ABI,
- FFI_DEFAULT_ABI = FFI_SYSV
-} ffi_abi;
-#endif
-
-/* Structures have a 4-byte alignment even if all the fields have lesser
- alignment requirements. */
-#define FFI_AGGREGATE_ALIGNMENT 4
-
-#define FFI_CLOSURES 1
-#define FFI_TRAMPOLINE_SIZE 28 /* 7 instructions */
-#define FFI_NATIVE_RAW_API 0
-
-#endif
diff --git a/Modules/_ctypes/libffi/src/nios2/sysv.S b/Modules/_ctypes/libffi/src/nios2/sysv.S
deleted file mode 100644
index 75f442bbee..0000000000
--- a/Modules/_ctypes/libffi/src/nios2/sysv.S
+++ /dev/null
@@ -1,136 +0,0 @@
-/* Low-level libffi support for Altera Nios II.
-
- Copyright (c) 2013 Mentor Graphics.
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- ``Software''), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to
- permit persons to whom the Software is furnished to do so, subject to
- the following conditions:
-
- The above copyright notice and this permission notice shall be
- included in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
- CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
-
-/* This function is declared on the C side as
-
- extern UINT64 ffi_call_sysv (void (*arghook) (char *, extended_cif *),
- extended_cif *ecif,
- unsigned nbytes,
- void (*fn) (void));
-
- On input, the arguments appear as
- r4 = arghook
- r5 = ecif
- r6 = nbytes
- r7 = fn
-*/
-
- .section .text
- .align 2
- .global ffi_call_sysv
- .type ffi_call_sysv, @function
-
-ffi_call_sysv:
- .cfi_startproc
-
- /* Create the stack frame, saving r16 so we can use it locally. */
- addi sp, sp, -12
- .cfi_def_cfa_offset 12
- stw ra, 8(sp)
- stw fp, 4(sp)
- stw r16, 0(sp)
- .cfi_offset 31, -4
- .cfi_offset 28, -8
- .cfi_offset 16, -12
- mov fp, sp
- .cfi_def_cfa_register 28
- mov r16, r7
-
- /* Adjust the stack pointer to create the argument buffer
- nbytes long. */
- sub sp, sp, r6
-
- /* Call the arghook function. */
- mov r2, r4 /* fn */
- mov r4, sp /* argbuffer */
- callr r2 /* r5 already contains ecif */
-
- /* Pop off the first 16 bytes of the argument buffer on the stack,
- transferring the contents to the argument registers. */
- ldw r4, 0(sp)
- ldw r5, 4(sp)
- ldw r6, 8(sp)
- ldw r7, 12(sp)
- addi sp, sp, 16
-
- /* Call the user function, which leaves its result in r2 and r3. */
- callr r16
-
- /* Pop off the stack frame. */
- mov sp, fp
- ldw ra, 8(sp)
- ldw fp, 4(sp)
- ldw r16, 0(sp)
- addi sp, sp, 12
- ret
- .cfi_endproc
- .size ffi_call_sysv, .-ffi_call_sysv
-
-
-/* Closure trampolines jump here after putting the C helper address
- in r9 and the closure pointer in r10. The user-supplied arguments
- to the closure are in the normal places, in r4-r7 and on the
- stack. Push the register arguments on the stack too and then call the
- C helper function to deal with them. */
-
- .section .text
- .align 2
- .global ffi_closure_sysv
- .type ffi_closure_sysv, @function
-
-ffi_closure_sysv:
- .cfi_startproc
-
- /* Create the stack frame, pushing the register args on the stack
- just below the stack args. This is the same trick illustrated
- in Figure 7-3 in the Nios II Processor Reference Handbook, used
- for variable arguments and structures passed by value. */
- addi sp, sp, -20
- .cfi_def_cfa_offset 20
- stw ra, 0(sp)
- .cfi_offset 31, -20
- stw r4, 4(sp)
- .cfi_offset 4, -16
- stw r5, 8(sp)
- .cfi_offset 5, -12
- stw r6, 12(sp)
- .cfi_offset 6, -8
- stw r7, 16(sp)
- .cfi_offset 7, -4
-
- /* Call the helper.
- r4 = pointer to arguments on stack
- r5 = closure pointer (loaded in r10 by the trampoline)
- r9 = address of helper function (loaded by trampoline) */
- addi r4, sp, 4
- mov r5, r10
- callr r9
-
- /* Pop the stack and return. */
- ldw ra, 0(sp)
- addi sp, sp, 20
- .cfi_def_cfa_offset -20
- ret
- .cfi_endproc
- .size ffi_closure_sysv, .-ffi_closure_sysv
-
diff --git a/Modules/_ctypes/libffi/src/pa/ffi.c b/Modules/_ctypes/libffi/src/pa/ffi.c
deleted file mode 100644
index 4ce2bc6f0e..0000000000
--- a/Modules/_ctypes/libffi/src/pa/ffi.c
+++ /dev/null
@@ -1,719 +0,0 @@
-/* -----------------------------------------------------------------------
- ffi.c - (c) 2011 Anthony Green
- (c) 2008 Red Hat, Inc.
- (c) 2006 Free Software Foundation, Inc.
- (c) 2003-2004 Randolph Chung <tausq@debian.org>
-
- HPPA Foreign Function Interface
- HP-UX PA ABI support
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- ``Software''), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to
- permit persons to whom the Software is furnished to do so, subject to
- the following conditions:
-
- The above copyright notice and this permission notice shall be included
- in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- DEALINGS IN THE SOFTWARE.
- ----------------------------------------------------------------------- */
-
-#include <ffi.h>
-#include <ffi_common.h>
-
-#include <stdlib.h>
-#include <stdio.h>
-
-#define ROUND_UP(v, a) (((size_t)(v) + (a) - 1) & ~((a) - 1))
-
-#define MIN_STACK_SIZE 64
-#define FIRST_ARG_SLOT 9
-#define DEBUG_LEVEL 0
-
-#define fldw(addr, fpreg) \
- __asm__ volatile ("fldw 0(%0), %%" #fpreg "L" : : "r"(addr) : #fpreg)
-#define fstw(fpreg, addr) \
- __asm__ volatile ("fstw %%" #fpreg "L, 0(%0)" : : "r"(addr))
-#define fldd(addr, fpreg) \
- __asm__ volatile ("fldd 0(%0), %%" #fpreg : : "r"(addr) : #fpreg)
-#define fstd(fpreg, addr) \
- __asm__ volatile ("fstd %%" #fpreg "L, 0(%0)" : : "r"(addr))
-
-#define debug(lvl, x...) do { if (lvl <= DEBUG_LEVEL) { printf(x); } } while (0)
-
-static inline int ffi_struct_type(ffi_type *t)
-{
- size_t sz = t->size;
-
- /* Small structure results are passed in registers,
- larger ones are passed by pointer. Note that
- small structures of size 2, 4 and 8 differ from
- the corresponding integer types in that they have
- different alignment requirements. */
-
- if (sz <= 1)
- return FFI_TYPE_UINT8;
- else if (sz == 2)
- return FFI_TYPE_SMALL_STRUCT2;
- else if (sz == 3)
- return FFI_TYPE_SMALL_STRUCT3;
- else if (sz == 4)
- return FFI_TYPE_SMALL_STRUCT4;
- else if (sz == 5)
- return FFI_TYPE_SMALL_STRUCT5;
- else if (sz == 6)
- return FFI_TYPE_SMALL_STRUCT6;
- else if (sz == 7)
- return FFI_TYPE_SMALL_STRUCT7;
- else if (sz <= 8)
- return FFI_TYPE_SMALL_STRUCT8;
- else
- return FFI_TYPE_STRUCT; /* else, we pass it by pointer. */
-}
-
-/* PA has a downward growing stack, which looks like this:
-
- Offset
- [ Variable args ]
- SP = (4*(n+9)) arg word N
- ...
- SP-52 arg word 4
- [ Fixed args ]
- SP-48 arg word 3
- SP-44 arg word 2
- SP-40 arg word 1
- SP-36 arg word 0
- [ Frame marker ]
- ...
- SP-20 RP
- SP-4 previous SP
-
- The first four argument words on the stack are reserved for use by
- the callee. Instead, the general and floating registers replace
- the first four argument slots. Non FP arguments are passed solely
- in the general registers. FP arguments are passed in both general
- and floating registers when using libffi.
-
- Non-FP 32-bit args are passed in gr26, gr25, gr24 and gr23.
- Non-FP 64-bit args are passed in register pairs, starting
- on an odd numbered register (i.e. r25+r26 and r23+r24).
- FP 32-bit arguments are passed in fr4L, fr5L, fr6L and fr7L.
- FP 64-bit arguments are passed in fr5 and fr7.
-
- The registers are allocated in the same manner as stack slots.
- This allows the callee to save its arguments on the stack if
- necessary:
-
- arg word 3 -> gr23 or fr7L
- arg word 2 -> gr24 or fr6L or fr7R
- arg word 1 -> gr25 or fr5L
- arg word 0 -> gr26 or fr4L or fr5R
-
- Note that fr4R and fr6R are never used for arguments (i.e.,
- doubles are not passed in fr4 or fr6).
-
- The rest of the arguments are passed on the stack starting at SP-52,
- but 64-bit arguments need to be aligned to an 8-byte boundary
-
- This means we can have holes either in the register allocation,
- or in the stack. */
-
-/* ffi_prep_args is called by the assembly routine once stack space
- has been allocated for the function's arguments
-
- The following code will put everything into the stack frame
- (which was allocated by the asm routine), and on return
- the asm routine will load the arguments that should be
- passed by register into the appropriate registers
-
- NOTE: We load floating point args in this function... that means we
- assume gcc will not mess with fp regs in here. */
-
-void ffi_prep_args_pa32(UINT32 *stack, extended_cif *ecif, unsigned bytes)
-{
- register unsigned int i;
- register ffi_type **p_arg;
- register void **p_argv;
- unsigned int slot = FIRST_ARG_SLOT;
- char *dest_cpy;
- size_t len;
-
- debug(1, "%s: stack = %p, ecif = %p, bytes = %u\n", __FUNCTION__, stack,
- ecif, bytes);
-
- p_arg = ecif->cif->arg_types;
- p_argv = ecif->avalue;
-
- for (i = 0; i < ecif->cif->nargs; i++)
- {
- int type = (*p_arg)->type;
-
- switch (type)
- {
- case FFI_TYPE_SINT8:
- *(SINT32 *)(stack - slot) = *(SINT8 *)(*p_argv);
- break;
-
- case FFI_TYPE_UINT8:
- *(UINT32 *)(stack - slot) = *(UINT8 *)(*p_argv);
- break;
-
- case FFI_TYPE_SINT16:
- *(SINT32 *)(stack - slot) = *(SINT16 *)(*p_argv);
- break;
-
- case FFI_TYPE_UINT16:
- *(UINT32 *)(stack - slot) = *(UINT16 *)(*p_argv);
- break;
-
- case FFI_TYPE_UINT32:
- case FFI_TYPE_SINT32:
- case FFI_TYPE_POINTER:
- debug(3, "Storing UINT32 %u in slot %u\n", *(UINT32 *)(*p_argv),
- slot);
- *(UINT32 *)(stack - slot) = *(UINT32 *)(*p_argv);
- break;
-
- case FFI_TYPE_UINT64:
- case FFI_TYPE_SINT64:
- /* Align slot for 64-bit type. */
- slot += (slot & 1) ? 1 : 2;
- *(UINT64 *)(stack - slot) = *(UINT64 *)(*p_argv);
- break;
-
- case FFI_TYPE_FLOAT:
- /* First 4 args go in fr4L - fr7L. */
- debug(3, "Storing UINT32(float) in slot %u\n", slot);
- *(UINT32 *)(stack - slot) = *(UINT32 *)(*p_argv);
- switch (slot - FIRST_ARG_SLOT)
- {
- /* First 4 args go in fr4L - fr7L. */
- case 0: fldw(stack - slot, fr4); break;
- case 1: fldw(stack - slot, fr5); break;
- case 2: fldw(stack - slot, fr6); break;
- case 3: fldw(stack - slot, fr7); break;
- }
- break;
-
- case FFI_TYPE_DOUBLE:
- /* Align slot for 64-bit type. */
- slot += (slot & 1) ? 1 : 2;
- debug(3, "Storing UINT64(double) at slot %u\n", slot);
- *(UINT64 *)(stack - slot) = *(UINT64 *)(*p_argv);
- switch (slot - FIRST_ARG_SLOT)
- {
- /* First 2 args go in fr5, fr7. */
- case 1: fldd(stack - slot, fr5); break;
- case 3: fldd(stack - slot, fr7); break;
- }
- break;
-
-#ifdef PA_HPUX
- case FFI_TYPE_LONGDOUBLE:
- /* Long doubles are passed in the same manner as structures
- larger than 8 bytes. */
- *(UINT32 *)(stack - slot) = (UINT32)(*p_argv);
- break;
-#endif
-
- case FFI_TYPE_STRUCT:
-
- /* Structs smaller or equal than 4 bytes are passed in one
- register. Structs smaller or equal 8 bytes are passed in two
- registers. Larger structures are passed by pointer. */
-
- len = (*p_arg)->size;
- if (len <= 4)
- {
- dest_cpy = (char *)(stack - slot) + 4 - len;
- memcpy(dest_cpy, (char *)*p_argv, len);
- }
- else if (len <= 8)
- {
- slot += (slot & 1) ? 1 : 2;
- dest_cpy = (char *)(stack - slot) + 8 - len;
- memcpy(dest_cpy, (char *)*p_argv, len);
- }
- else
- *(UINT32 *)(stack - slot) = (UINT32)(*p_argv);
- break;
-
- default:
- FFI_ASSERT(0);
- }
-
- slot++;
- p_arg++;
- p_argv++;
- }
-
- /* Make sure we didn't mess up and scribble on the stack. */
- {
- unsigned int n;
-
- debug(5, "Stack setup:\n");
- for (n = 0; n < (bytes + 3) / 4; n++)
- {
- if ((n%4) == 0) { debug(5, "\n%08x: ", (unsigned int)(stack - n)); }
- debug(5, "%08x ", *(stack - n));
- }
- debug(5, "\n");
- }
-
- FFI_ASSERT(slot * 4 <= bytes);
-
- return;
-}
-
-static void ffi_size_stack_pa32(ffi_cif *cif)
-{
- ffi_type **ptr;
- int i;
- int z = 0; /* # stack slots */
-
- for (ptr = cif->arg_types, i = 0; i < cif->nargs; ptr++, i++)
- {
- int type = (*ptr)->type;
-
- switch (type)
- {
- case FFI_TYPE_DOUBLE:
- case FFI_TYPE_UINT64:
- case FFI_TYPE_SINT64:
- z += 2 + (z & 1); /* must start on even regs, so we may waste one */
- break;
-
-#ifdef PA_HPUX
- case FFI_TYPE_LONGDOUBLE:
-#endif
- case FFI_TYPE_STRUCT:
- z += 1; /* pass by ptr, callee will copy */
- break;
-
- default: /* <= 32-bit values */
- z++;
- }
- }
-
- /* We can fit up to 6 args in the default 64-byte stack frame,
- if we need more, we need more stack. */
- if (z <= 6)
- cif->bytes = MIN_STACK_SIZE; /* min stack size */
- else
- cif->bytes = 64 + ROUND_UP((z - 6) * sizeof(UINT32), MIN_STACK_SIZE);
-
- debug(3, "Calculated stack size is %u bytes\n", cif->bytes);
-}
-
-/* Perform machine dependent cif processing. */
-ffi_status ffi_prep_cif_machdep(ffi_cif *cif)
-{
- /* Set the return type flag */
- switch (cif->rtype->type)
- {
- case FFI_TYPE_VOID:
- case FFI_TYPE_FLOAT:
- case FFI_TYPE_DOUBLE:
- cif->flags = (unsigned) cif->rtype->type;
- break;
-
-#ifdef PA_HPUX
- case FFI_TYPE_LONGDOUBLE:
- /* Long doubles are treated like a structure. */
- cif->flags = FFI_TYPE_STRUCT;
- break;
-#endif
-
- case FFI_TYPE_STRUCT:
- /* For the return type we have to check the size of the structures.
- If the size is smaller or equal 4 bytes, the result is given back
- in one register. If the size is smaller or equal 8 bytes than we
- return the result in two registers. But if the size is bigger than
- 8 bytes, we work with pointers. */
- cif->flags = ffi_struct_type(cif->rtype);
- break;
-
- case FFI_TYPE_UINT64:
- case FFI_TYPE_SINT64:
- cif->flags = FFI_TYPE_UINT64;
- break;
-
- default:
- cif->flags = FFI_TYPE_INT;
- break;
- }
-
- /* Lucky us, because of the unique PA ABI we get to do our
- own stack sizing. */
- switch (cif->abi)
- {
- case FFI_PA32:
- ffi_size_stack_pa32(cif);
- break;
-
- default:
- FFI_ASSERT(0);
- break;
- }
-
- return FFI_OK;
-}
-
-extern void ffi_call_pa32(void (*)(UINT32 *, extended_cif *, unsigned),
- extended_cif *, unsigned, unsigned, unsigned *,
- void (*fn)(void));
-
-void ffi_call(ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue)
-{
- extended_cif ecif;
-
- ecif.cif = cif;
- ecif.avalue = avalue;
-
- /* If the return value is a struct and we don't have a return
- value address then we need to make one. */
-
- if (rvalue == NULL
-#ifdef PA_HPUX
- && (cif->rtype->type == FFI_TYPE_STRUCT
- || cif->rtype->type == FFI_TYPE_LONGDOUBLE))
-#else
- && cif->rtype->type == FFI_TYPE_STRUCT)
-#endif
- {
- ecif.rvalue = alloca(cif->rtype->size);
- }
- else
- ecif.rvalue = rvalue;
-
-
- switch (cif->abi)
- {
- case FFI_PA32:
- debug(3, "Calling ffi_call_pa32: ecif=%p, bytes=%u, flags=%u, rvalue=%p, fn=%p\n", &ecif, cif->bytes, cif->flags, ecif.rvalue, (void *)fn);
- ffi_call_pa32(ffi_prep_args_pa32, &ecif, cif->bytes,
- cif->flags, ecif.rvalue, fn);
- break;
-
- default:
- FFI_ASSERT(0);
- break;
- }
-}
-
-#if FFI_CLOSURES
-/* This is more-or-less an inverse of ffi_call -- we have arguments on
- the stack, and we need to fill them into a cif structure and invoke
- the user function. This really ought to be in asm to make sure
- the compiler doesn't do things we don't expect. */
-ffi_status ffi_closure_inner_pa32(ffi_closure *closure, UINT32 *stack)
-{
- ffi_cif *cif;
- void **avalue;
- void *rvalue;
- UINT32 ret[2]; /* function can return up to 64-bits in registers */
- ffi_type **p_arg;
- char *tmp;
- int i, avn;
- unsigned int slot = FIRST_ARG_SLOT;
- register UINT32 r28 asm("r28");
-
- cif = closure->cif;
-
- /* If returning via structure, callee will write to our pointer. */
- if (cif->flags == FFI_TYPE_STRUCT)
- rvalue = (void *)r28;
- else
- rvalue = &ret[0];
-
- avalue = (void **)alloca(cif->nargs * FFI_SIZEOF_ARG);
- avn = cif->nargs;
- p_arg = cif->arg_types;
-
- for (i = 0; i < avn; i++)
- {
- int type = (*p_arg)->type;
-
- switch (type)
- {
- case FFI_TYPE_SINT8:
- case FFI_TYPE_UINT8:
- case FFI_TYPE_SINT16:
- case FFI_TYPE_UINT16:
- case FFI_TYPE_SINT32:
- case FFI_TYPE_UINT32:
- case FFI_TYPE_POINTER:
- avalue[i] = (char *)(stack - slot) + sizeof(UINT32) - (*p_arg)->size;
- break;
-
- case FFI_TYPE_SINT64:
- case FFI_TYPE_UINT64:
- slot += (slot & 1) ? 1 : 2;
- avalue[i] = (void *)(stack - slot);
- break;
-
- case FFI_TYPE_FLOAT:
-#ifdef PA_LINUX
- /* The closure call is indirect. In Linux, floating point
- arguments in indirect calls with a prototype are passed
- in the floating point registers instead of the general
- registers. So, we need to replace what was previously
- stored in the current slot with the value in the
- corresponding floating point register. */
- switch (slot - FIRST_ARG_SLOT)
- {
- case 0: fstw(fr4, (void *)(stack - slot)); break;
- case 1: fstw(fr5, (void *)(stack - slot)); break;
- case 2: fstw(fr6, (void *)(stack - slot)); break;
- case 3: fstw(fr7, (void *)(stack - slot)); break;
- }
-#endif
- avalue[i] = (void *)(stack - slot);
- break;
-
- case FFI_TYPE_DOUBLE:
- slot += (slot & 1) ? 1 : 2;
-#ifdef PA_LINUX
- /* See previous comment for FFI_TYPE_FLOAT. */
- switch (slot - FIRST_ARG_SLOT)
- {
- case 1: fstd(fr5, (void *)(stack - slot)); break;
- case 3: fstd(fr7, (void *)(stack - slot)); break;
- }
-#endif
- avalue[i] = (void *)(stack - slot);
- break;
-
-#ifdef PA_HPUX
- case FFI_TYPE_LONGDOUBLE:
- /* Long doubles are treated like a big structure. */
- avalue[i] = (void *) *(stack - slot);
- break;
-#endif
-
- case FFI_TYPE_STRUCT:
- /* Structs smaller or equal than 4 bytes are passed in one
- register. Structs smaller or equal 8 bytes are passed in two
- registers. Larger structures are passed by pointer. */
- if((*p_arg)->size <= 4)
- {
- avalue[i] = (void *)(stack - slot) + sizeof(UINT32) -
- (*p_arg)->size;
- }
- else if ((*p_arg)->size <= 8)
- {
- slot += (slot & 1) ? 1 : 2;
- avalue[i] = (void *)(stack - slot) + sizeof(UINT64) -
- (*p_arg)->size;
- }
- else
- avalue[i] = (void *) *(stack - slot);
- break;
-
- default:
- FFI_ASSERT(0);
- }
-
- slot++;
- p_arg++;
- }
-
- /* Invoke the closure. */
- (closure->fun) (cif, rvalue, avalue, closure->user_data);
-
- debug(3, "after calling function, ret[0] = %08x, ret[1] = %08x\n", ret[0],
- ret[1]);
-
- /* Store the result using the lower 2 bytes of the flags. */
- switch (cif->flags)
- {
- case FFI_TYPE_UINT8:
- *(stack - FIRST_ARG_SLOT) = (UINT8)(ret[0] >> 24);
- break;
- case FFI_TYPE_SINT8:
- *(stack - FIRST_ARG_SLOT) = (SINT8)(ret[0] >> 24);
- break;
- case FFI_TYPE_UINT16:
- *(stack - FIRST_ARG_SLOT) = (UINT16)(ret[0] >> 16);
- break;
- case FFI_TYPE_SINT16:
- *(stack - FIRST_ARG_SLOT) = (SINT16)(ret[0] >> 16);
- break;
- case FFI_TYPE_INT:
- case FFI_TYPE_SINT32:
- case FFI_TYPE_UINT32:
- *(stack - FIRST_ARG_SLOT) = ret[0];
- break;
- case FFI_TYPE_SINT64:
- case FFI_TYPE_UINT64:
- *(stack - FIRST_ARG_SLOT) = ret[0];
- *(stack - FIRST_ARG_SLOT - 1) = ret[1];
- break;
-
- case FFI_TYPE_DOUBLE:
- fldd(rvalue, fr4);
- break;
-
- case FFI_TYPE_FLOAT:
- fldw(rvalue, fr4);
- break;
-
- case FFI_TYPE_STRUCT:
- /* Don't need a return value, done by caller. */
- break;
-
- case FFI_TYPE_SMALL_STRUCT2:
- case FFI_TYPE_SMALL_STRUCT3:
- case FFI_TYPE_SMALL_STRUCT4:
- tmp = (void*)(stack - FIRST_ARG_SLOT);
- tmp += 4 - cif->rtype->size;
- memcpy((void*)tmp, &ret[0], cif->rtype->size);
- break;
-
- case FFI_TYPE_SMALL_STRUCT5:
- case FFI_TYPE_SMALL_STRUCT6:
- case FFI_TYPE_SMALL_STRUCT7:
- case FFI_TYPE_SMALL_STRUCT8:
- {
- unsigned int ret2[2];
- int off;
-
- /* Right justify ret[0] and ret[1] */
- switch (cif->flags)
- {
- case FFI_TYPE_SMALL_STRUCT5: off = 3; break;
- case FFI_TYPE_SMALL_STRUCT6: off = 2; break;
- case FFI_TYPE_SMALL_STRUCT7: off = 1; break;
- default: off = 0; break;
- }
-
- memset (ret2, 0, sizeof (ret2));
- memcpy ((char *)ret2 + off, ret, 8 - off);
-
- *(stack - FIRST_ARG_SLOT) = ret2[0];
- *(stack - FIRST_ARG_SLOT - 1) = ret2[1];
- }
- break;
-
- case FFI_TYPE_POINTER:
- case FFI_TYPE_VOID:
- break;
-
- default:
- debug(0, "assert with cif->flags: %d\n",cif->flags);
- FFI_ASSERT(0);
- break;
- }
- return FFI_OK;
-}
-
-/* Fill in a closure to refer to the specified fun and user_data.
- cif specifies the argument and result types for fun.
- The cif must already be prep'ed. */
-
-extern void ffi_closure_pa32(void);
-
-ffi_status
-ffi_prep_closure_loc (ffi_closure* closure,
- ffi_cif* cif,
- void (*fun)(ffi_cif*,void*,void**,void*),
- void *user_data,
- void *codeloc)
-{
- UINT32 *tramp = (UINT32 *)(closure->tramp);
-#ifdef PA_HPUX
- UINT32 *tmp;
-#endif
-
- if (cif->abi != FFI_PA32)
- return FFI_BAD_ABI;
-
- /* Make a small trampoline that will branch to our
- handler function. Use PC-relative addressing. */
-
-#ifdef PA_LINUX
- tramp[0] = 0xeaa00000; /* b,l .+8,%r21 ; %r21 <- pc+8 */
- tramp[1] = 0xd6a01c1e; /* depi 0,31,2,%r21 ; mask priv bits */
- tramp[2] = 0x4aa10028; /* ldw 20(%r21),%r1 ; load plabel */
- tramp[3] = 0x36b53ff1; /* ldo -8(%r21),%r21 ; get closure addr */
- tramp[4] = 0x0c201096; /* ldw 0(%r1),%r22 ; address of handler */
- tramp[5] = 0xeac0c000; /* bv%r0(%r22) ; branch to handler */
- tramp[6] = 0x0c281093; /* ldw 4(%r1),%r19 ; GP of handler */
- tramp[7] = ((UINT32)(ffi_closure_pa32) & ~2);
-
- /* Flush d/icache -- have to flush up 2 two lines because of
- alignment. */
- __asm__ volatile(
- "fdc 0(%0)\n\t"
- "fdc %1(%0)\n\t"
- "fic 0(%%sr4, %0)\n\t"
- "fic %1(%%sr4, %0)\n\t"
- "sync\n\t"
- "nop\n\t"
- "nop\n\t"
- "nop\n\t"
- "nop\n\t"
- "nop\n\t"
- "nop\n\t"
- "nop\n"
- :
- : "r"((unsigned long)tramp & ~31),
- "r"(32 /* stride */)
- : "memory");
-#endif
-
-#ifdef PA_HPUX
- tramp[0] = 0xeaa00000; /* b,l .+8,%r21 ; %r21 <- pc+8 */
- tramp[1] = 0xd6a01c1e; /* depi 0,31,2,%r21 ; mask priv bits */
- tramp[2] = 0x4aa10038; /* ldw 28(%r21),%r1 ; load plabel */
- tramp[3] = 0x36b53ff1; /* ldo -8(%r21),%r21 ; get closure addr */
- tramp[4] = 0x0c201096; /* ldw 0(%r1),%r22 ; address of handler */
- tramp[5] = 0x02c010b4; /* ldsid (%r22),%r20 ; load space id */
- tramp[6] = 0x00141820; /* mtsp %r20,%sr0 ; into %sr0 */
- tramp[7] = 0xe2c00000; /* be 0(%sr0,%r22) ; branch to handler */
- tramp[8] = 0x0c281093; /* ldw 4(%r1),%r19 ; GP of handler */
- tramp[9] = ((UINT32)(ffi_closure_pa32) & ~2);
-
- /* Flush d/icache -- have to flush three lines because of alignment. */
- __asm__ volatile(
- "copy %1,%0\n\t"
- "fdc,m %2(%0)\n\t"
- "fdc,m %2(%0)\n\t"
- "fdc,m %2(%0)\n\t"
- "ldsid (%1),%0\n\t"
- "mtsp %0,%%sr0\n\t"
- "copy %1,%0\n\t"
- "fic,m %2(%%sr0,%0)\n\t"
- "fic,m %2(%%sr0,%0)\n\t"
- "fic,m %2(%%sr0,%0)\n\t"
- "sync\n\t"
- "nop\n\t"
- "nop\n\t"
- "nop\n\t"
- "nop\n\t"
- "nop\n\t"
- "nop\n\t"
- "nop\n"
- : "=&r" ((unsigned long)tmp)
- : "r" ((unsigned long)tramp & ~31),
- "r" (32/* stride */)
- : "memory");
-#endif
-
- closure->cif = cif;
- closure->user_data = user_data;
- closure->fun = fun;
-
- return FFI_OK;
-}
-#endif
diff --git a/Modules/_ctypes/libffi/src/pa/ffitarget.h b/Modules/_ctypes/libffi/src/pa/ffitarget.h
deleted file mode 100644
index 5e364d38f8..0000000000
--- a/Modules/_ctypes/libffi/src/pa/ffitarget.h
+++ /dev/null
@@ -1,83 +0,0 @@
-/* -----------------------------------------------------------------*-C-*-
- ffitarget.h - Copyright (c) 2012 Anthony Green
- Copyright (c) 1996-2003 Red Hat, Inc.
- Target configuration macros for hppa.
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- ``Software''), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to
- permit persons to whom the Software is furnished to do so, subject to
- the following conditions:
-
- The above copyright notice and this permission notice shall be included
- in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- DEALINGS IN THE SOFTWARE.
-
- ----------------------------------------------------------------------- */
-
-#ifndef LIBFFI_TARGET_H
-#define LIBFFI_TARGET_H
-
-#ifndef LIBFFI_H
-#error "Please do not include ffitarget.h directly into your source. Use ffi.h instead."
-#endif
-
-/* ---- System specific configurations ----------------------------------- */
-
-#ifndef LIBFFI_ASM
-typedef unsigned long ffi_arg;
-typedef signed long ffi_sarg;
-
-typedef enum ffi_abi {
- FFI_FIRST_ABI = 0,
-
-#ifdef PA_LINUX
- FFI_PA32,
- FFI_LAST_ABI,
- FFI_DEFAULT_ABI = FFI_PA32
-#endif
-
-#ifdef PA_HPUX
- FFI_PA32,
- FFI_LAST_ABI,
- FFI_DEFAULT_ABI = FFI_PA32
-#endif
-
-#ifdef PA64_HPUX
-#error "PA64_HPUX FFI is not yet implemented"
- FFI_PA64,
- FFI_LAST_ABI,
- FFI_DEFAULT_ABI = FFI_PA64
-#endif
-} ffi_abi;
-#endif
-
-/* ---- Definitions for closures ----------------------------------------- */
-
-#define FFI_CLOSURES 1
-#define FFI_NATIVE_RAW_API 0
-
-#ifdef PA_LINUX
-#define FFI_TRAMPOLINE_SIZE 32
-#else
-#define FFI_TRAMPOLINE_SIZE 40
-#endif
-
-#define FFI_TYPE_SMALL_STRUCT2 -1
-#define FFI_TYPE_SMALL_STRUCT3 -2
-#define FFI_TYPE_SMALL_STRUCT4 -3
-#define FFI_TYPE_SMALL_STRUCT5 -4
-#define FFI_TYPE_SMALL_STRUCT6 -5
-#define FFI_TYPE_SMALL_STRUCT7 -6
-#define FFI_TYPE_SMALL_STRUCT8 -7
-#endif
diff --git a/Modules/_ctypes/libffi/src/pa/hpux32.S b/Modules/_ctypes/libffi/src/pa/hpux32.S
deleted file mode 100644
index 40528bad75..0000000000
--- a/Modules/_ctypes/libffi/src/pa/hpux32.S
+++ /dev/null
@@ -1,368 +0,0 @@
-/* -----------------------------------------------------------------------
- hpux32.S - Copyright (c) 2006 Free Software Foundation, Inc.
- (c) 2008 Red Hat, Inc.
- based on src/pa/linux.S
-
- HP-UX PA Foreign Function Interface
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- ``Software''), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to
- permit persons to whom the Software is furnished to do so, subject to
- the following conditions:
-
- The above copyright notice and this permission notice shall be included
- in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS
- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR
- OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- OTHER DEALINGS IN THE SOFTWARE.
- ----------------------------------------------------------------------- */
-
-#define LIBFFI_ASM
-#include <fficonfig.h>
-#include <ffi.h>
-
- .LEVEL 1.1
- .SPACE $PRIVATE$
- .IMPORT $global$,DATA
- .IMPORT $$dyncall,MILLICODE
- .SUBSPA $DATA$
- .align 4
-
- /* void ffi_call_pa32(void (*)(char *, extended_cif *),
- extended_cif *ecif,
- unsigned bytes,
- unsigned flags,
- unsigned *rvalue,
- void (*fn)(void));
- */
-
- .export ffi_call_pa32,ENTRY,PRIV_LEV=3
- .import ffi_prep_args_pa32,CODE
-
- .SPACE $TEXT$
- .SUBSPA $CODE$
- .align 4
-
-L$FB1
-ffi_call_pa32
- .proc
- .callinfo FRAME=64,CALLS,SAVE_RP,SAVE_SP,ENTRY_GR=4
- .entry
- stw %rp, -20(%sp)
- copy %r3, %r1
-L$CFI11
- copy %sp, %r3
-L$CFI12
-
- /* Setup the stack for calling prep_args...
- We want the stack to look like this:
-
- [ Previous stack ] <- %r3
-
- [ 64-bytes register save area ] <- %r4
-
- [ Stack space for actual call, passed as ] <- %arg0
- [ arg0 to ffi_prep_args_pa32 ]
-
- [ Stack for calling prep_args ] <- %sp
- */
-
- stwm %r1, 64(%sp)
- stw %r4, 12(%r3)
-L$CFI13
- copy %sp, %r4
-
- addl %arg2, %r4, %arg0 ; arg stack
- stw %arg3, -48(%r3) ; save flags we need it later
-
- /* Call prep_args:
- %arg0(stack) -- set up above
- %arg1(ecif) -- same as incoming param
- %arg2(bytes) -- same as incoming param */
- bl ffi_prep_args_pa32,%r2
- ldo 64(%arg0), %sp
- ldo -64(%sp), %sp
-
- /* now %sp should point where %arg0 was pointing. */
-
- /* Load the arguments that should be passed in registers
- The fp args are loaded by the prep_args function. */
- ldw -36(%sp), %arg0
- ldw -40(%sp), %arg1
- ldw -44(%sp), %arg2
- ldw -48(%sp), %arg3
-
- /* in case the function is going to return a structure
- we need to give it a place to put the result. */
- ldw -52(%r3), %ret0 ; %ret0 <- rvalue
- ldw -56(%r3), %r22 ; %r22 <- function to call
- bl $$dyncall, %r31 ; Call the user function
- copy %r31, %rp
-
- /* Prepare to store the result; we need to recover flags and rvalue. */
- ldw -48(%r3), %r21 ; r21 <- flags
- ldw -52(%r3), %r20 ; r20 <- rvalue
-
- /* Store the result according to the return type. The most
- likely types should come first. */
-
-L$checkint
- comib,<>,n FFI_TYPE_INT, %r21, L$checkint8
- b L$done
- stw %ret0, 0(%r20)
-
-L$checkint8
- comib,<>,n FFI_TYPE_UINT8, %r21, L$checkint16
- b L$done
- stb %ret0, 0(%r20)
-
-L$checkint16
- comib,<>,n FFI_TYPE_UINT16, %r21, L$checkdbl
- b L$done
- sth %ret0, 0(%r20)
-
-L$checkdbl
- comib,<>,n FFI_TYPE_DOUBLE, %r21, L$checkfloat
- b L$done
- fstd %fr4,0(%r20)
-
-L$checkfloat
- comib,<>,n FFI_TYPE_FLOAT, %r21, L$checkll
- b L$done
- fstw %fr4L,0(%r20)
-
-L$checkll
- comib,<>,n FFI_TYPE_UINT64, %r21, L$checksmst2
- stw %ret0, 0(%r20)
- b L$done
- stw %ret1, 4(%r20)
-
-L$checksmst2
- comib,<>,n FFI_TYPE_SMALL_STRUCT2, %r21, L$checksmst3
- /* 2-byte structs are returned in ret0 as ????xxyy. */
- extru %ret0, 23, 8, %r22
- stbs,ma %r22, 1(%r20)
- b L$done
- stb %ret0, 0(%r20)
-
-L$checksmst3
- comib,<>,n FFI_TYPE_SMALL_STRUCT3, %r21, L$checksmst4
- /* 3-byte structs are returned in ret0 as ??xxyyzz. */
- extru %ret0, 15, 8, %r22
- stbs,ma %r22, 1(%r20)
- extru %ret0, 23, 8, %r22
- stbs,ma %r22, 1(%r20)
- b L$done
- stb %ret0, 0(%r20)
-
-L$checksmst4
- comib,<>,n FFI_TYPE_SMALL_STRUCT4, %r21, L$checksmst5
- /* 4-byte structs are returned in ret0 as wwxxyyzz. */
- extru %ret0, 7, 8, %r22
- stbs,ma %r22, 1(%r20)
- extru %ret0, 15, 8, %r22
- stbs,ma %r22, 1(%r20)
- extru %ret0, 23, 8, %r22
- stbs,ma %r22, 1(%r20)
- b L$done
- stb %ret0, 0(%r20)
-
-L$checksmst5
- comib,<>,n FFI_TYPE_SMALL_STRUCT5, %r21, L$checksmst6
- /* 5 byte values are returned right justified:
- ret0 ret1
- 5: ??????aa bbccddee */
- stbs,ma %ret0, 1(%r20)
- extru %ret1, 7, 8, %r22
- stbs,ma %r22, 1(%r20)
- extru %ret1, 15, 8, %r22
- stbs,ma %r22, 1(%r20)
- extru %ret1, 23, 8, %r22
- stbs,ma %r22, 1(%r20)
- b L$done
- stb %ret1, 0(%r20)
-
-L$checksmst6
- comib,<>,n FFI_TYPE_SMALL_STRUCT6, %r21, L$checksmst7
- /* 6 byte values are returned right justified:
- ret0 ret1
- 6: ????aabb ccddeeff */
- extru %ret0, 23, 8, %r22
- stbs,ma %r22, 1(%r20)
- stbs,ma %ret0, 1(%r20)
- extru %ret1, 7, 8, %r22
- stbs,ma %r22, 1(%r20)
- extru %ret1, 15, 8, %r22
- stbs,ma %r22, 1(%r20)
- extru %ret1, 23, 8, %r22
- stbs,ma %r22, 1(%r20)
- b L$done
- stb %ret1, 0(%r20)
-
-L$checksmst7
- comib,<>,n FFI_TYPE_SMALL_STRUCT7, %r21, L$checksmst8
- /* 7 byte values are returned right justified:
- ret0 ret1
- 7: ??aabbcc ddeeffgg */
- extru %ret0, 15, 8, %r22
- stbs,ma %r22, 1(%r20)
- extru %ret0, 23, 8, %r22
- stbs,ma %r22, 1(%r20)
- stbs,ma %ret0, 1(%r20)
- extru %ret1, 7, 8, %r22
- stbs,ma %r22, 1(%r20)
- extru %ret1, 15, 8, %r22
- stbs,ma %r22, 1(%r20)
- extru %ret1, 23, 8, %r22
- stbs,ma %r22, 1(%r20)
- b L$done
- stb %ret1, 0(%r20)
-
-L$checksmst8
- comib,<>,n FFI_TYPE_SMALL_STRUCT8, %r21, L$done
- /* 8 byte values are returned right justified:
- ret0 ret1
- 8: aabbccdd eeffgghh */
- extru %ret0, 7, 8, %r22
- stbs,ma %r22, 1(%r20)
- extru %ret0, 15, 8, %r22
- stbs,ma %r22, 1(%r20)
- extru %ret0, 23, 8, %r22
- stbs,ma %r22, 1(%r20)
- stbs,ma %ret0, 1(%r20)
- extru %ret1, 7, 8, %r22
- stbs,ma %r22, 1(%r20)
- extru %ret1, 15, 8, %r22
- stbs,ma %r22, 1(%r20)
- extru %ret1, 23, 8, %r22
- stbs,ma %r22, 1(%r20)
- stb %ret1, 0(%r20)
-
-L$done
- /* all done, return */
- copy %r4, %sp ; pop arg stack
- ldw 12(%r3), %r4
- ldwm -64(%sp), %r3 ; .. and pop stack
- ldw -20(%sp), %rp
- bv %r0(%rp)
- nop
- .exit
- .procend
-L$FE1
-
- /* void ffi_closure_pa32(void);
- Called with closure argument in %r21 */
-
- .SPACE $TEXT$
- .SUBSPA $CODE$
- .export ffi_closure_pa32,ENTRY,PRIV_LEV=3,RTNVAL=GR
- .import ffi_closure_inner_pa32,CODE
- .align 4
-L$FB2
-ffi_closure_pa32
- .proc
- .callinfo FRAME=64,CALLS,SAVE_RP,SAVE_SP,ENTRY_GR=3
- .entry
-
- stw %rp, -20(%sp)
- copy %r3, %r1
-L$CFI21
- copy %sp, %r3
-L$CFI22
- stwm %r1, 64(%sp)
-
- /* Put arguments onto the stack and call ffi_closure_inner. */
- stw %arg0, -36(%r3)
- stw %arg1, -40(%r3)
- stw %arg2, -44(%r3)
- stw %arg3, -48(%r3)
-
- copy %r21, %arg0
- bl ffi_closure_inner_pa32, %r2
- copy %r3, %arg1
- ldwm -64(%sp), %r3
- ldw -20(%sp), %rp
- ldw -36(%sp), %ret0
- bv %r0(%rp)
- ldw -40(%sp), %ret1
- .exit
- .procend
-L$FE2:
-
- .SPACE $PRIVATE$
- .SUBSPA $DATA$
-
- .align 4
- .EXPORT _GLOBAL__F_ffi_call_pa32,DATA
-_GLOBAL__F_ffi_call_pa32
-L$frame1:
- .word L$ECIE1-L$SCIE1 ;# Length of Common Information Entry
-L$SCIE1:
- .word 0x0 ;# CIE Identifier Tag
- .byte 0x1 ;# CIE Version
- .ascii "\0" ;# CIE Augmentation
- .uleb128 0x1 ;# CIE Code Alignment Factor
- .sleb128 4 ;# CIE Data Alignment Factor
- .byte 0x2 ;# CIE RA Column
- .byte 0xc ;# DW_CFA_def_cfa
- .uleb128 0x1e
- .uleb128 0x0
- .align 4
-L$ECIE1:
-L$SFDE1:
- .word L$EFDE1-L$ASFDE1 ;# FDE Length
-L$ASFDE1:
- .word L$ASFDE1-L$frame1 ;# FDE CIE offset
- .word L$FB1 ;# FDE initial location
- .word L$FE1-L$FB1 ;# FDE address range
-
- .byte 0x4 ;# DW_CFA_advance_loc4
- .word L$CFI11-L$FB1
- .byte 0x83 ;# DW_CFA_offset, column 0x3
- .uleb128 0x0
- .byte 0x11 ;# DW_CFA_offset_extended_sf; save r2 at [r30-20]
- .uleb128 0x2
- .sleb128 -5
-
- .byte 0x4 ;# DW_CFA_advance_loc4
- .word L$CFI12-L$CFI11
- .byte 0xd ;# DW_CFA_def_cfa_register = r3
- .uleb128 0x3
-
- .byte 0x4 ;# DW_CFA_advance_loc4
- .word L$CFI13-L$CFI12
- .byte 0x84 ;# DW_CFA_offset, column 0x4
- .uleb128 0x3
-
- .align 4
-L$EFDE1:
-
-L$SFDE2:
- .word L$EFDE2-L$ASFDE2 ;# FDE Length
-L$ASFDE2:
- .word L$ASFDE2-L$frame1 ;# FDE CIE offset
- .word L$FB2 ;# FDE initial location
- .word L$FE2-L$FB2 ;# FDE address range
- .byte 0x4 ;# DW_CFA_advance_loc4
- .word L$CFI21-L$FB2
- .byte 0x83 ;# DW_CFA_offset, column 0x3
- .uleb128 0x0
- .byte 0x11 ;# DW_CFA_offset_extended_sf
- .uleb128 0x2
- .sleb128 -5
-
- .byte 0x4 ;# DW_CFA_advance_loc4
- .word L$CFI22-L$CFI21
- .byte 0xd ;# DW_CFA_def_cfa_register = r3
- .uleb128 0x3
-
- .align 4
-L$EFDE2:
diff --git a/Modules/_ctypes/libffi/src/pa/linux.S b/Modules/_ctypes/libffi/src/pa/linux.S
deleted file mode 100644
index f11ae76807..0000000000
--- a/Modules/_ctypes/libffi/src/pa/linux.S
+++ /dev/null
@@ -1,357 +0,0 @@
-/* -----------------------------------------------------------------------
- linux.S - (c) 2003-2004 Randolph Chung <tausq@debian.org>
- (c) 2008 Red Hat, Inc.
-
- HPPA Foreign Function Interface
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- ``Software''), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to
- permit persons to whom the Software is furnished to do so, subject to
- the following conditions:
-
- The above copyright notice and this permission notice shall be included
- in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS
- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- IN NO EVENT SHALL RENESAS TECHNOLOGY BE LIABLE FOR ANY CLAIM, DAMAGES OR
- OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- OTHER DEALINGS IN THE SOFTWARE.
- ----------------------------------------------------------------------- */
-
-#define LIBFFI_ASM
-#include <fficonfig.h>
-#include <ffi.h>
-
- .text
- .level 1.1
- .align 4
-
- /* void ffi_call_pa32(void (*)(char *, extended_cif *),
- extended_cif *ecif,
- unsigned bytes,
- unsigned flags,
- unsigned *rvalue,
- void (*fn)(void));
- */
-
- .export ffi_call_pa32,code
- .import ffi_prep_args_pa32,code
-
- .type ffi_call_pa32, @function
-.LFB1:
-ffi_call_pa32:
- .proc
- .callinfo FRAME=64,CALLS,SAVE_RP,SAVE_SP,ENTRY_GR=4
- .entry
- stw %rp, -20(%sp)
- copy %r3, %r1
-.LCFI11:
-
- copy %sp, %r3
-.LCFI12:
-
- /* Setup the stack for calling prep_args...
- We want the stack to look like this:
-
- [ Previous stack ] <- %r3
-
- [ 64-bytes register save area ] <- %r4
-
- [ Stack space for actual call, passed as ] <- %arg0
- [ arg0 to ffi_prep_args_pa32 ]
-
- [ Stack for calling prep_args ] <- %sp
- */
-
- stwm %r1, 64(%sp)
- stw %r4, 12(%r3)
-.LCFI13:
- copy %sp, %r4
-
- addl %arg2, %r4, %arg0 /* arg stack */
- stw %arg3, -48(%r3) /* save flags; we need it later */
-
- /* Call prep_args:
- %arg0(stack) -- set up above
- %arg1(ecif) -- same as incoming param
- %arg2(bytes) -- same as incoming param */
- bl ffi_prep_args_pa32,%r2
- ldo 64(%arg0), %sp
- ldo -64(%sp), %sp
-
- /* now %sp should point where %arg0 was pointing. */
-
- /* Load the arguments that should be passed in registers
- The fp args were loaded by the prep_args function. */
- ldw -36(%sp), %arg0
- ldw -40(%sp), %arg1
- ldw -44(%sp), %arg2
- ldw -48(%sp), %arg3
-
- /* in case the function is going to return a structure
- we need to give it a place to put the result. */
- ldw -52(%r3), %ret0 /* %ret0 <- rvalue */
- ldw -56(%r3), %r22 /* %r22 <- function to call */
- bl $$dyncall, %r31 /* Call the user function */
- copy %r31, %rp
-
- /* Prepare to store the result; we need to recover flags and rvalue. */
- ldw -48(%r3), %r21 /* r21 <- flags */
- ldw -52(%r3), %r20 /* r20 <- rvalue */
-
- /* Store the result according to the return type. */
-
-.Lcheckint:
- comib,<>,n FFI_TYPE_INT, %r21, .Lcheckint8
- b .Ldone
- stw %ret0, 0(%r20)
-
-.Lcheckint8:
- comib,<>,n FFI_TYPE_UINT8, %r21, .Lcheckint16
- b .Ldone
- stb %ret0, 0(%r20)
-
-.Lcheckint16:
- comib,<>,n FFI_TYPE_UINT16, %r21, .Lcheckdbl
- b .Ldone
- sth %ret0, 0(%r20)
-
-.Lcheckdbl:
- comib,<>,n FFI_TYPE_DOUBLE, %r21, .Lcheckfloat
- b .Ldone
- fstd %fr4,0(%r20)
-
-.Lcheckfloat:
- comib,<>,n FFI_TYPE_FLOAT, %r21, .Lcheckll
- b .Ldone
- fstw %fr4L,0(%r20)
-
-.Lcheckll:
- comib,<>,n FFI_TYPE_UINT64, %r21, .Lchecksmst2
- stw %ret0, 0(%r20)
- b .Ldone
- stw %ret1, 4(%r20)
-
-.Lchecksmst2:
- comib,<>,n FFI_TYPE_SMALL_STRUCT2, %r21, .Lchecksmst3
- /* 2-byte structs are returned in ret0 as ????xxyy. */
- extru %ret0, 23, 8, %r22
- stbs,ma %r22, 1(%r20)
- b .Ldone
- stb %ret0, 0(%r20)
-
-.Lchecksmst3:
- comib,<>,n FFI_TYPE_SMALL_STRUCT3, %r21, .Lchecksmst4
- /* 3-byte structs are returned in ret0 as ??xxyyzz. */
- extru %ret0, 15, 8, %r22
- stbs,ma %r22, 1(%r20)
- extru %ret0, 23, 8, %r22
- stbs,ma %r22, 1(%r20)
- b .Ldone
- stb %ret0, 0(%r20)
-
-.Lchecksmst4:
- comib,<>,n FFI_TYPE_SMALL_STRUCT4, %r21, .Lchecksmst5
- /* 4-byte structs are returned in ret0 as wwxxyyzz. */
- extru %ret0, 7, 8, %r22
- stbs,ma %r22, 1(%r20)
- extru %ret0, 15, 8, %r22
- stbs,ma %r22, 1(%r20)
- extru %ret0, 23, 8, %r22
- stbs,ma %r22, 1(%r20)
- b .Ldone
- stb %ret0, 0(%r20)
-
-.Lchecksmst5:
- comib,<>,n FFI_TYPE_SMALL_STRUCT5, %r21, .Lchecksmst6
- /* 5 byte values are returned right justified:
- ret0 ret1
- 5: ??????aa bbccddee */
- stbs,ma %ret0, 1(%r20)
- extru %ret1, 7, 8, %r22
- stbs,ma %r22, 1(%r20)
- extru %ret1, 15, 8, %r22
- stbs,ma %r22, 1(%r20)
- extru %ret1, 23, 8, %r22
- stbs,ma %r22, 1(%r20)
- b .Ldone
- stb %ret1, 0(%r20)
-
-.Lchecksmst6:
- comib,<>,n FFI_TYPE_SMALL_STRUCT6, %r21, .Lchecksmst7
- /* 6 byte values are returned right justified:
- ret0 ret1
- 6: ????aabb ccddeeff */
- extru %ret0, 23, 8, %r22
- stbs,ma %r22, 1(%r20)
- stbs,ma %ret0, 1(%r20)
- extru %ret1, 7, 8, %r22
- stbs,ma %r22, 1(%r20)
- extru %ret1, 15, 8, %r22
- stbs,ma %r22, 1(%r20)
- extru %ret1, 23, 8, %r22
- stbs,ma %r22, 1(%r20)
- b .Ldone
- stb %ret1, 0(%r20)
-
-.Lchecksmst7:
- comib,<>,n FFI_TYPE_SMALL_STRUCT7, %r21, .Lchecksmst8
- /* 7 byte values are returned right justified:
- ret0 ret1
- 7: ??aabbcc ddeeffgg */
- extru %ret0, 15, 8, %r22
- stbs,ma %r22, 1(%r20)
- extru %ret0, 23, 8, %r22
- stbs,ma %r22, 1(%r20)
- stbs,ma %ret0, 1(%r20)
- extru %ret1, 7, 8, %r22
- stbs,ma %r22, 1(%r20)
- extru %ret1, 15, 8, %r22
- stbs,ma %r22, 1(%r20)
- extru %ret1, 23, 8, %r22
- stbs,ma %r22, 1(%r20)
- b .Ldone
- stb %ret1, 0(%r20)
-
-.Lchecksmst8:
- comib,<>,n FFI_TYPE_SMALL_STRUCT8, %r21, .Ldone
- /* 8 byte values are returned right justified:
- ret0 ret1
- 8: aabbccdd eeffgghh */
- extru %ret0, 7, 8, %r22
- stbs,ma %r22, 1(%r20)
- extru %ret0, 15, 8, %r22
- stbs,ma %r22, 1(%r20)
- extru %ret0, 23, 8, %r22
- stbs,ma %r22, 1(%r20)
- stbs,ma %ret0, 1(%r20)
- extru %ret1, 7, 8, %r22
- stbs,ma %r22, 1(%r20)
- extru %ret1, 15, 8, %r22
- stbs,ma %r22, 1(%r20)
- extru %ret1, 23, 8, %r22
- stbs,ma %r22, 1(%r20)
- stb %ret1, 0(%r20)
-
-.Ldone:
- /* all done, return */
- copy %r4, %sp /* pop arg stack */
- ldw 12(%r3), %r4
- ldwm -64(%sp), %r3 /* .. and pop stack */
- ldw -20(%sp), %rp
- bv %r0(%rp)
- nop
- .exit
- .procend
-.LFE1:
-
- /* void ffi_closure_pa32(void);
- Called with closure argument in %r21 */
- .export ffi_closure_pa32,code
- .import ffi_closure_inner_pa32,code
-
- .type ffi_closure_pa32, @function
-.LFB2:
-ffi_closure_pa32:
- .proc
- .callinfo FRAME=64,CALLS,SAVE_RP,SAVE_SP,ENTRY_GR=3
- .entry
-
- stw %rp, -20(%sp)
-.LCFI20:
- copy %r3, %r1
-.LCFI21:
- copy %sp, %r3
-.LCFI22:
- stwm %r1, 64(%sp)
-
- /* Put arguments onto the stack and call ffi_closure_inner. */
- stw %arg0, -36(%r3)
- stw %arg1, -40(%r3)
- stw %arg2, -44(%r3)
- stw %arg3, -48(%r3)
-
- copy %r21, %arg0
- bl ffi_closure_inner_pa32, %r2
- copy %r3, %arg1
-
- ldwm -64(%sp), %r3
- ldw -20(%sp), %rp
- ldw -36(%sp), %ret0
- bv %r0(%r2)
- ldw -40(%sp), %ret1
-
- .exit
- .procend
-.LFE2:
-
- .section ".eh_frame",EH_FRAME_FLAGS,@progbits
-.Lframe1:
- .word .LECIE1-.LSCIE1 ;# Length of Common Information Entry
-.LSCIE1:
- .word 0x0 ;# CIE Identifier Tag
- .byte 0x1 ;# CIE Version
- .ascii "\0" ;# CIE Augmentation
- .uleb128 0x1 ;# CIE Code Alignment Factor
- .sleb128 4 ;# CIE Data Alignment Factor
- .byte 0x2 ;# CIE RA Column
- .byte 0xc ;# DW_CFA_def_cfa
- .uleb128 0x1e
- .uleb128 0x0
- .align 4
-.LECIE1:
-.LSFDE1:
- .word .LEFDE1-.LASFDE1 ;# FDE Length
-.LASFDE1:
- .word .LASFDE1-.Lframe1 ;# FDE CIE offset
- .word .LFB1 ;# FDE initial location
- .word .LFE1-.LFB1 ;# FDE address range
-
- .byte 0x4 ;# DW_CFA_advance_loc4
- .word .LCFI11-.LFB1
- .byte 0x83 ;# DW_CFA_offset, column 0x3
- .uleb128 0x0
- .byte 0x11 ;# DW_CFA_offset_extended_sf; save r2 at [r30-20]
- .uleb128 0x2
- .sleb128 -5
-
- .byte 0x4 ;# DW_CFA_advance_loc4
- .word .LCFI12-.LCFI11
- .byte 0xd ;# DW_CFA_def_cfa_register = r3
- .uleb128 0x3
-
- .byte 0x4 ;# DW_CFA_advance_loc4
- .word .LCFI13-.LCFI12
- .byte 0x84 ;# DW_CFA_offset, column 0x4
- .uleb128 0x3
-
- .align 4
-.LEFDE1:
-
-.LSFDE2:
- .word .LEFDE2-.LASFDE2 ;# FDE Length
-.LASFDE2:
- .word .LASFDE2-.Lframe1 ;# FDE CIE offset
- .word .LFB2 ;# FDE initial location
- .word .LFE2-.LFB2 ;# FDE address range
- .byte 0x4 ;# DW_CFA_advance_loc4
- .word .LCFI21-.LFB2
- .byte 0x83 ;# DW_CFA_offset, column 0x3
- .uleb128 0x0
- .byte 0x11 ;# DW_CFA_offset_extended_sf
- .uleb128 0x2
- .sleb128 -5
-
- .byte 0x4 ;# DW_CFA_advance_loc4
- .word .LCFI22-.LCFI21
- .byte 0xd ;# DW_CFA_def_cfa_register = r3
- .uleb128 0x3
-
- .align 4
-.LEFDE2:
diff --git a/Modules/_ctypes/libffi/src/powerpc/aix.S b/Modules/_ctypes/libffi/src/powerpc/aix.S
deleted file mode 100644
index 349e78c266..0000000000
--- a/Modules/_ctypes/libffi/src/powerpc/aix.S
+++ /dev/null
@@ -1,328 +0,0 @@
-/* -----------------------------------------------------------------------
- aix.S - Copyright (c) 2002, 2009 Free Software Foundation, Inc.
- based on darwin.S by John Hornkvist
-
- PowerPC Assembly glue.
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- ``Software''), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to
- permit persons to whom the Software is furnished to do so, subject to
- the following conditions:
-
- The above copyright notice and this permission notice shall be included
- in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS
- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR
- OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- OTHER DEALINGS IN THE SOFTWARE.
- ----------------------------------------------------------------------- */
-
- .set r0,0
- .set r1,1
- .set r2,2
- .set r3,3
- .set r4,4
- .set r5,5
- .set r6,6
- .set r7,7
- .set r8,8
- .set r9,9
- .set r10,10
- .set r11,11
- .set r12,12
- .set r13,13
- .set r14,14
- .set r15,15
- .set r16,16
- .set r17,17
- .set r18,18
- .set r19,19
- .set r20,20
- .set r21,21
- .set r22,22
- .set r23,23
- .set r24,24
- .set r25,25
- .set r26,26
- .set r27,27
- .set r28,28
- .set r29,29
- .set r30,30
- .set r31,31
- .set f0,0
- .set f1,1
- .set f2,2
- .set f3,3
- .set f4,4
- .set f5,5
- .set f6,6
- .set f7,7
- .set f8,8
- .set f9,9
- .set f10,10
- .set f11,11
- .set f12,12
- .set f13,13
- .set f14,14
- .set f15,15
- .set f16,16
- .set f17,17
- .set f18,18
- .set f19,19
- .set f20,20
- .set f21,21
-
- .extern .ffi_prep_args
-
-#define LIBFFI_ASM
-#include <fficonfig.h>
-#include <ffi.h>
-#define JUMPTARGET(name) name
-#define L(x) x
- .file "aix.S"
- .toc
-
- /* void ffi_call_AIX(extended_cif *ecif, unsigned long bytes,
- * unsigned int flags, unsigned int *rvalue,
- * void (*fn)(),
- * void (*prep_args)(extended_cif*, unsigned *const));
- * r3=ecif, r4=bytes, r5=flags, r6=rvalue, r7=fn, r8=prep_args
- */
-
-.csect .text[PR]
- .align 2
- .globl ffi_call_AIX
- .globl .ffi_call_AIX
-.csect ffi_call_AIX[DS]
-ffi_call_AIX:
-#ifdef __64BIT__
- .llong .ffi_call_AIX, TOC[tc0], 0
- .csect .text[PR]
-.ffi_call_AIX:
- /* Save registers we use. */
- mflr r0
-
- std r28,-32(r1)
- std r29,-24(r1)
- std r30,-16(r1)
- std r31, -8(r1)
-
- std r0, 16(r1)
- mr r28, r1 /* our AP. */
- stdux r1, r1, r4
-
- /* Save arguments over call... */
- mr r31, r5 /* flags, */
- mr r30, r6 /* rvalue, */
- mr r29, r7 /* function address. */
- std r2, 40(r1)
-
- /* Call ffi_prep_args. */
- mr r4, r1
- bl .ffi_prep_args
- nop
-
- /* Now do the call. */
- ld r0, 0(r29)
- ld r2, 8(r29)
- ld r11, 16(r29)
- /* Set up cr1 with bits 4-7 of the flags. */
- mtcrf 0x40, r31
- mtctr r0
- /* Load all those argument registers. */
- /* We have set up a nice stack frame, just load it into registers. */
- ld r3, 40+(1*8)(r1)
- ld r4, 40+(2*8)(r1)
- ld r5, 40+(3*8)(r1)
- ld r6, 40+(4*8)(r1)
- nop
- ld r7, 40+(5*8)(r1)
- ld r8, 40+(6*8)(r1)
- ld r9, 40+(7*8)(r1)
- ld r10,40+(8*8)(r1)
-
-L1:
- /* Load all the FP registers. */
- bf 6,L2 /* 2f + 0x18 */
- lfd f1,-32-(13*8)(r28)
- lfd f2,-32-(12*8)(r28)
- lfd f3,-32-(11*8)(r28)
- lfd f4,-32-(10*8)(r28)
- nop
- lfd f5,-32-(9*8)(r28)
- lfd f6,-32-(8*8)(r28)
- lfd f7,-32-(7*8)(r28)
- lfd f8,-32-(6*8)(r28)
- nop
- lfd f9,-32-(5*8)(r28)
- lfd f10,-32-(4*8)(r28)
- lfd f11,-32-(3*8)(r28)
- lfd f12,-32-(2*8)(r28)
- nop
- lfd f13,-32-(1*8)(r28)
-
-L2:
- /* Make the call. */
- bctrl
- ld r2, 40(r1)
-
- /* Now, deal with the return value. */
- mtcrf 0x01, r31
-
- bt 30, L(done_return_value)
- bt 29, L(fp_return_value)
- std r3, 0(r30)
-
- /* Fall through... */
-
-L(done_return_value):
- /* Restore the registers we used and return. */
- mr r1, r28
- ld r0, 16(r28)
- ld r28, -32(r1)
- mtlr r0
- ld r29, -24(r1)
- ld r30, -16(r1)
- ld r31, -8(r1)
- blr
-
-L(fp_return_value):
- bf 28, L(float_return_value)
- stfd f1, 0(r30)
- bf 31, L(done_return_value)
- stfd f2, 8(r30)
- b L(done_return_value)
-L(float_return_value):
- stfs f1, 0(r30)
- b L(done_return_value)
-
-#else /* ! __64BIT__ */
-
- .long .ffi_call_AIX, TOC[tc0], 0
- .csect .text[PR]
-.ffi_call_AIX:
- /* Save registers we use. */
- mflr r0
-
- stw r28,-16(r1)
- stw r29,-12(r1)
- stw r30, -8(r1)
- stw r31, -4(r1)
-
- stw r0, 8(r1)
- mr r28, r1 /* out AP. */
- stwux r1, r1, r4
-
- /* Save arguments over call... */
- mr r31, r5 /* flags, */
- mr r30, r6 /* rvalue, */
- mr r29, r7 /* function address, */
- stw r2, 20(r1)
-
- /* Call ffi_prep_args. */
- mr r4, r1
- bl .ffi_prep_args
- nop
-
- /* Now do the call. */
- lwz r0, 0(r29)
- lwz r2, 4(r29)
- lwz r11, 8(r29)
- /* Set up cr1 with bits 4-7 of the flags. */
- mtcrf 0x40, r31
- mtctr r0
- /* Load all those argument registers. */
- /* We have set up a nice stack frame, just load it into registers. */
- lwz r3, 20+(1*4)(r1)
- lwz r4, 20+(2*4)(r1)
- lwz r5, 20+(3*4)(r1)
- lwz r6, 20+(4*4)(r1)
- nop
- lwz r7, 20+(5*4)(r1)
- lwz r8, 20+(6*4)(r1)
- lwz r9, 20+(7*4)(r1)
- lwz r10,20+(8*4)(r1)
-
-L1:
- /* Load all the FP registers. */
- bf 6,L2 /* 2f + 0x18 */
- lfd f1,-16-(13*8)(r28)
- lfd f2,-16-(12*8)(r28)
- lfd f3,-16-(11*8)(r28)
- lfd f4,-16-(10*8)(r28)
- nop
- lfd f5,-16-(9*8)(r28)
- lfd f6,-16-(8*8)(r28)
- lfd f7,-16-(7*8)(r28)
- lfd f8,-16-(6*8)(r28)
- nop
- lfd f9,-16-(5*8)(r28)
- lfd f10,-16-(4*8)(r28)
- lfd f11,-16-(3*8)(r28)
- lfd f12,-16-(2*8)(r28)
- nop
- lfd f13,-16-(1*8)(r28)
-
-L2:
- /* Make the call. */
- bctrl
- lwz r2, 20(r1)
-
- /* Now, deal with the return value. */
- mtcrf 0x01, r31
-
- bt 30, L(done_return_value)
- bt 29, L(fp_return_value)
- stw r3, 0(r30)
- bf 28, L(done_return_value)
- stw r4, 4(r30)
-
- /* Fall through... */
-
-L(done_return_value):
- /* Restore the registers we used and return. */
- mr r1, r28
- lwz r0, 8(r28)
- lwz r28,-16(r1)
- mtlr r0
- lwz r29,-12(r1)
- lwz r30, -8(r1)
- lwz r31, -4(r1)
- blr
-
-L(fp_return_value):
- bf 28, L(float_return_value)
- stfd f1, 0(r30)
- b L(done_return_value)
-L(float_return_value):
- stfs f1, 0(r30)
- b L(done_return_value)
-#endif
- .long 0
- .byte 0,0,0,1,128,4,0,0
-/* END(ffi_call_AIX) */
-
-.csect .text[PR]
- .align 2
- .globl ffi_call_DARWIN
- .globl .ffi_call_DARWIN
-.csect ffi_call_DARWIN[DS]
-ffi_call_DARWIN:
-#ifdef __64BIT__
- .llong .ffi_call_DARWIN, TOC[tc0], 0
-#else
- .long .ffi_call_DARWIN, TOC[tc0], 0
-#endif
- .csect .text[PR]
-.ffi_call_DARWIN:
- blr
- .long 0
- .byte 0,0,0,0,0,0,0,0
-/* END(ffi_call_DARWIN) */
diff --git a/Modules/_ctypes/libffi/src/powerpc/aix_closure.S b/Modules/_ctypes/libffi/src/powerpc/aix_closure.S
deleted file mode 100644
index aabd3c3c1e..0000000000
--- a/Modules/_ctypes/libffi/src/powerpc/aix_closure.S
+++ /dev/null
@@ -1,447 +0,0 @@
-/* -----------------------------------------------------------------------
- aix_closure.S - Copyright (c) 2002, 2003, 2009 Free Software Foundation, Inc.
- based on darwin_closure.S
-
- PowerPC Assembly glue.
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- ``Software''), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to
- permit persons to whom the Software is furnished to do so, subject to
- the following conditions:
-
- The above copyright notice and this permission notice shall be included
- in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS
- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR
- OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- OTHER DEALINGS IN THE SOFTWARE.
- ----------------------------------------------------------------------- */
-
- .set r0,0
- .set r1,1
- .set r2,2
- .set r3,3
- .set r4,4
- .set r5,5
- .set r6,6
- .set r7,7
- .set r8,8
- .set r9,9
- .set r10,10
- .set r11,11
- .set r12,12
- .set r13,13
- .set r14,14
- .set r15,15
- .set r16,16
- .set r17,17
- .set r18,18
- .set r19,19
- .set r20,20
- .set r21,21
- .set r22,22
- .set r23,23
- .set r24,24
- .set r25,25
- .set r26,26
- .set r27,27
- .set r28,28
- .set r29,29
- .set r30,30
- .set r31,31
- .set f0,0
- .set f1,1
- .set f2,2
- .set f3,3
- .set f4,4
- .set f5,5
- .set f6,6
- .set f7,7
- .set f8,8
- .set f9,9
- .set f10,10
- .set f11,11
- .set f12,12
- .set f13,13
- .set f14,14
- .set f15,15
- .set f16,16
- .set f17,17
- .set f18,18
- .set f19,19
- .set f20,20
- .set f21,21
-
- .extern .ffi_closure_helper_DARWIN
-
-#define LIBFFI_ASM
-#define JUMPTARGET(name) name
-#define L(x) x
- .file "aix_closure.S"
- .toc
-LC..60:
- .tc L..60[TC],L..60
- .csect .text[PR]
- .align 2
-
-.csect .text[PR]
- .align 2
- .globl ffi_closure_ASM
- .globl .ffi_closure_ASM
-.csect ffi_closure_ASM[DS]
-ffi_closure_ASM:
-#ifdef __64BIT__
- .llong .ffi_closure_ASM, TOC[tc0], 0
- .csect .text[PR]
-.ffi_closure_ASM:
-/* we want to build up an area for the parameters passed */
-/* in registers (both floating point and integer) */
-
- /* we store gpr 3 to gpr 10 (aligned to 4)
- in the parents outgoing area */
- std r3, 48+(0*8)(r1)
- std r4, 48+(1*8)(r1)
- std r5, 48+(2*8)(r1)
- std r6, 48+(3*8)(r1)
- mflr r0
-
- std r7, 48+(4*8)(r1)
- std r8, 48+(5*8)(r1)
- std r9, 48+(6*8)(r1)
- std r10, 48+(7*8)(r1)
- std r0, 16(r1) /* save the return address */
-
-
- /* 48 Bytes (Linkage Area) */
- /* 64 Bytes (params) */
- /* 16 Bytes (result) */
- /* 104 Bytes (13*8 from FPR) */
- /* 8 Bytes (alignment) */
- /* 240 Bytes */
-
- stdu r1, -240(r1) /* skip over caller save area
- keep stack aligned to 16 */
-
- /* next save fpr 1 to fpr 13 (aligned to 8) */
- stfd f1, 128+(0*8)(r1)
- stfd f2, 128+(1*8)(r1)
- stfd f3, 128+(2*8)(r1)
- stfd f4, 128+(3*8)(r1)
- stfd f5, 128+(4*8)(r1)
- stfd f6, 128+(5*8)(r1)
- stfd f7, 128+(6*8)(r1)
- stfd f8, 128+(7*8)(r1)
- stfd f9, 128+(8*8)(r1)
- stfd f10, 128+(9*8)(r1)
- stfd f11, 128+(10*8)(r1)
- stfd f12, 128+(11*8)(r1)
- stfd f13, 128+(12*8)(r1)
-
- /* set up registers for the routine that actually does the work */
- /* get the context pointer from the trampoline */
- mr r3, r11
-
- /* now load up the pointer to the result storage */
- addi r4, r1, 112
-
- /* now load up the pointer to the saved gpr registers */
- addi r5, r1, 288
-
- /* now load up the pointer to the saved fpr registers */
- addi r6, r1, 128
-
- /* make the call */
- bl .ffi_closure_helper_DARWIN
- nop
-
- /* now r3 contains the return type */
- /* so use it to look up in a table */
- /* so we know how to deal with each type */
-
- /* look up the proper starting point in table */
- /* by using return type as offset */
- lhz r3, 10(r3) /* load type from return type */
- ld r4, LC..60(2) /* get address of jump table */
- sldi r3, r3, 4 /* now multiply return type by 16 */
- ld r0, 240+16(r1) /* load return address */
- add r3, r3, r4 /* add contents of table to table address */
- mtctr r3
- bctr /* jump to it */
-
-/* Each fragment must be exactly 16 bytes long (4 instructions).
- Align to 16 byte boundary for cache and dispatch efficiency. */
- .align 4
-
-L..60:
-/* case FFI_TYPE_VOID */
- mtlr r0
- addi r1, r1, 240
- blr
- nop
-
-/* case FFI_TYPE_INT */
- lwa r3, 112+4(r1)
- mtlr r0
- addi r1, r1, 240
- blr
-
-/* case FFI_TYPE_FLOAT */
- lfs f1, 112+0(r1)
- mtlr r0
- addi r1, r1, 240
- blr
-
-/* case FFI_TYPE_DOUBLE */
- lfd f1, 112+0(r1)
- mtlr r0
- addi r1, r1, 240
- blr
-
-/* case FFI_TYPE_LONGDOUBLE */
- lfd f1, 112+0(r1)
- mtlr r0
- lfd f2, 112+8(r1)
- b L..finish
-
-/* case FFI_TYPE_UINT8 */
- lbz r3, 112+7(r1)
- mtlr r0
- addi r1, r1, 240
- blr
-
-/* case FFI_TYPE_SINT8 */
- lbz r3, 112+7(r1)
- mtlr r0
- extsb r3, r3
- b L..finish
-
-/* case FFI_TYPE_UINT16 */
- lhz r3, 112+6(r1)
- mtlr r0
-L..finish:
- addi r1, r1, 240
- blr
-
-/* case FFI_TYPE_SINT16 */
- lha r3, 112+6(r1)
- mtlr r0
- addi r1, r1, 240
- blr
-
-/* case FFI_TYPE_UINT32 */
- lwz r3, 112+4(r1)
- mtlr r0
- addi r1, r1, 240
- blr
-
-/* case FFI_TYPE_SINT32 */
- lwa r3, 112+4(r1)
- mtlr r0
- addi r1, r1, 240
- blr
-
-/* case FFI_TYPE_UINT64 */
- ld r3, 112+0(r1)
- mtlr r0
- addi r1, r1, 240
- blr
-
-/* case FFI_TYPE_SINT64 */
- ld r3, 112+0(r1)
- mtlr r0
- addi r1, r1, 240
- blr
-
-/* case FFI_TYPE_STRUCT */
- mtlr r0
- addi r1, r1, 240
- blr
- nop
-
-/* case FFI_TYPE_POINTER */
- ld r3, 112+0(r1)
- mtlr r0
- addi r1, r1, 240
- blr
-
-#else /* ! __64BIT__ */
-
- .long .ffi_closure_ASM, TOC[tc0], 0
- .csect .text[PR]
-.ffi_closure_ASM:
-/* we want to build up an area for the parameters passed */
-/* in registers (both floating point and integer) */
-
- /* we store gpr 3 to gpr 10 (aligned to 4)
- in the parents outgoing area */
- stw r3, 24+(0*4)(r1)
- stw r4, 24+(1*4)(r1)
- stw r5, 24+(2*4)(r1)
- stw r6, 24+(3*4)(r1)
- mflr r0
-
- stw r7, 24+(4*4)(r1)
- stw r8, 24+(5*4)(r1)
- stw r9, 24+(6*4)(r1)
- stw r10, 24+(7*4)(r1)
- stw r0, 8(r1)
-
- /* 24 Bytes (Linkage Area) */
- /* 32 Bytes (params) */
- /* 16 Bytes (result) */
- /* 104 Bytes (13*8 from FPR) */
- /* 176 Bytes */
-
- stwu r1, -176(r1) /* skip over caller save area
- keep stack aligned to 16 */
-
- /* next save fpr 1 to fpr 13 (aligned to 8) */
- stfd f1, 72+(0*8)(r1)
- stfd f2, 72+(1*8)(r1)
- stfd f3, 72+(2*8)(r1)
- stfd f4, 72+(3*8)(r1)
- stfd f5, 72+(4*8)(r1)
- stfd f6, 72+(5*8)(r1)
- stfd f7, 72+(6*8)(r1)
- stfd f8, 72+(7*8)(r1)
- stfd f9, 72+(8*8)(r1)
- stfd f10, 72+(9*8)(r1)
- stfd f11, 72+(10*8)(r1)
- stfd f12, 72+(11*8)(r1)
- stfd f13, 72+(12*8)(r1)
-
- /* set up registers for the routine that actually does the work */
- /* get the context pointer from the trampoline */
- mr r3, r11
-
- /* now load up the pointer to the result storage */
- addi r4, r1, 56
-
- /* now load up the pointer to the saved gpr registers */
- addi r5, r1, 200
-
- /* now load up the pointer to the saved fpr registers */
- addi r6, r1, 72
-
- /* make the call */
- bl .ffi_closure_helper_DARWIN
- nop
-
- /* now r3 contains the return type */
- /* so use it to look up in a table */
- /* so we know how to deal with each type */
-
- /* look up the proper starting point in table */
- /* by using return type as offset */
- lhz r3, 6(r3) /* load type from return type */
- lwz r4, LC..60(2) /* get address of jump table */
- slwi r3, r3, 4 /* now multiply return type by 16 */
- lwz r0, 176+8(r1) /* load return address */
- add r3, r3, r4 /* add contents of table to table address */
- mtctr r3
- bctr /* jump to it */
-
-/* Each fragment must be exactly 16 bytes long (4 instructions).
- Align to 16 byte boundary for cache and dispatch efficiency. */
- .align 4
-
-L..60:
-/* case FFI_TYPE_VOID */
- mtlr r0
- addi r1, r1, 176
- blr
- nop
-
-/* case FFI_TYPE_INT */
- lwz r3, 56+0(r1)
- mtlr r0
- addi r1, r1, 176
- blr
-
-/* case FFI_TYPE_FLOAT */
- lfs f1, 56+0(r1)
- mtlr r0
- addi r1, r1, 176
- blr
-
-/* case FFI_TYPE_DOUBLE */
- lfd f1, 56+0(r1)
- mtlr r0
- addi r1, r1, 176
- blr
-
-/* case FFI_TYPE_LONGDOUBLE */
- lfd f1, 56+0(r1)
- mtlr r0
- lfd f2, 56+8(r1)
- b L..finish
-
-/* case FFI_TYPE_UINT8 */
- lbz r3, 56+3(r1)
- mtlr r0
- addi r1, r1, 176
- blr
-
-/* case FFI_TYPE_SINT8 */
- lbz r3, 56+3(r1)
- mtlr r0
- extsb r3, r3
- b L..finish
-
-/* case FFI_TYPE_UINT16 */
- lhz r3, 56+2(r1)
- mtlr r0
- addi r1, r1, 176
- blr
-
-/* case FFI_TYPE_SINT16 */
- lha r3, 56+2(r1)
- mtlr r0
- addi r1, r1, 176
- blr
-
-/* case FFI_TYPE_UINT32 */
- lwz r3, 56+0(r1)
- mtlr r0
- addi r1, r1, 176
- blr
-
-/* case FFI_TYPE_SINT32 */
- lwz r3, 56+0(r1)
- mtlr r0
- addi r1, r1, 176
- blr
-
-/* case FFI_TYPE_UINT64 */
- lwz r3, 56+0(r1)
- mtlr r0
- lwz r4, 56+4(r1)
- b L..finish
-
-/* case FFI_TYPE_SINT64 */
- lwz r3, 56+0(r1)
- mtlr r0
- lwz r4, 56+4(r1)
- b L..finish
-
-/* case FFI_TYPE_STRUCT */
- mtlr r0
- addi r1, r1, 176
- blr
- nop
-
-/* case FFI_TYPE_POINTER */
- lwz r3, 56+0(r1)
- mtlr r0
-L..finish:
- addi r1, r1, 176
- blr
-#endif
-/* END(ffi_closure_ASM) */
diff --git a/Modules/_ctypes/libffi/src/powerpc/asm.h b/Modules/_ctypes/libffi/src/powerpc/asm.h
deleted file mode 100644
index 994f62d079..0000000000
--- a/Modules/_ctypes/libffi/src/powerpc/asm.h
+++ /dev/null
@@ -1,125 +0,0 @@
-/* -----------------------------------------------------------------------
- asm.h - Copyright (c) 1998 Geoffrey Keating
-
- PowerPC Assembly glue.
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- ``Software''), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to
- permit persons to whom the Software is furnished to do so, subject to
- the following conditions:
-
- The above copyright notice and this permission notice shall be included
- in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS
- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR
- OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- OTHER DEALINGS IN THE SOFTWARE.
- ----------------------------------------------------------------------- */
-
-#define ASM_GLOBAL_DIRECTIVE .globl
-
-
-#define C_SYMBOL_NAME(name) name
-/* Macro for a label. */
-#ifdef __STDC__
-#define C_LABEL(name) name##:
-#else
-#define C_LABEL(name) name/**/:
-#endif
-
-/* This seems to always be the case on PPC. */
-#define ALIGNARG(log2) log2
-/* For ELF we need the `.type' directive to make shared libs work right. */
-#define ASM_TYPE_DIRECTIVE(name,typearg) .type name,typearg;
-#define ASM_SIZE_DIRECTIVE(name) .size name,.-name
-
-/* If compiled for profiling, call `_mcount' at the start of each function. */
-#ifdef PROF
-/* The mcount code relies on the return address being on the stack
- to locate our caller and so it can restore it; so store one just
- for its benefit. */
-#ifdef PIC
-#define CALL_MCOUNT \
- .pushsection; \
- .section ".data"; \
- .align ALIGNARG(2); \
-0:.long 0; \
- .previous; \
- mflr %r0; \
- stw %r0,4(%r1); \
- bl _GLOBAL_OFFSET_TABLE_@local-4; \
- mflr %r11; \
- lwz %r0,0b@got(%r11); \
- bl JUMPTARGET(_mcount);
-#else /* PIC */
-#define CALL_MCOUNT \
- .section ".data"; \
- .align ALIGNARG(2); \
-0:.long 0; \
- .previous; \
- mflr %r0; \
- lis %r11,0b@ha; \
- stw %r0,4(%r1); \
- addi %r0,%r11,0b@l; \
- bl JUMPTARGET(_mcount);
-#endif /* PIC */
-#else /* PROF */
-#define CALL_MCOUNT /* Do nothing. */
-#endif /* PROF */
-
-#define ENTRY(name) \
- ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME(name); \
- ASM_TYPE_DIRECTIVE (C_SYMBOL_NAME(name),@function) \
- .align ALIGNARG(2); \
- C_LABEL(name) \
- CALL_MCOUNT
-
-#define EALIGN_W_0 /* No words to insert. */
-#define EALIGN_W_1 nop
-#define EALIGN_W_2 nop;nop
-#define EALIGN_W_3 nop;nop;nop
-#define EALIGN_W_4 EALIGN_W_3;nop
-#define EALIGN_W_5 EALIGN_W_4;nop
-#define EALIGN_W_6 EALIGN_W_5;nop
-#define EALIGN_W_7 EALIGN_W_6;nop
-
-/* EALIGN is like ENTRY, but does alignment to 'words'*4 bytes
- past a 2^align boundary. */
-#ifdef PROF
-#define EALIGN(name, alignt, words) \
- ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME(name); \
- ASM_TYPE_DIRECTIVE (C_SYMBOL_NAME(name),@function) \
- .align ALIGNARG(2); \
- C_LABEL(name) \
- CALL_MCOUNT \
- b 0f; \
- .align ALIGNARG(alignt); \
- EALIGN_W_##words; \
- 0:
-#else /* PROF */
-#define EALIGN(name, alignt, words) \
- ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME(name); \
- ASM_TYPE_DIRECTIVE (C_SYMBOL_NAME(name),@function) \
- .align ALIGNARG(alignt); \
- EALIGN_W_##words; \
- C_LABEL(name)
-#endif
-
-#define END(name) \
- ASM_SIZE_DIRECTIVE(name)
-
-#ifdef PIC
-#define JUMPTARGET(name) name##@plt
-#else
-#define JUMPTARGET(name) name
-#endif
-
-/* Local labels stripped out by the linker. */
-#define L(x) .L##x
diff --git a/Modules/_ctypes/libffi/src/powerpc/darwin.S b/Modules/_ctypes/libffi/src/powerpc/darwin.S
deleted file mode 100644
index 066eb82efe..0000000000
--- a/Modules/_ctypes/libffi/src/powerpc/darwin.S
+++ /dev/null
@@ -1,378 +0,0 @@
-/* -----------------------------------------------------------------------
- darwin.S - Copyright (c) 2000 John Hornkvist
- Copyright (c) 2004, 2010 Free Software Foundation, Inc.
-
- PowerPC Assembly glue.
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- ``Software''), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to
- permit persons to whom the Software is furnished to do so, subject to
- the following conditions:
-
- The above copyright notice and this permission notice shall be included
- in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS
- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR
- OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- OTHER DEALINGS IN THE SOFTWARE.
- ----------------------------------------------------------------------- */
-
-#define LIBFFI_ASM
-#if defined(__ppc64__)
-#define MODE_CHOICE(x, y) y
-#else
-#define MODE_CHOICE(x, y) x
-#endif
-
-#define machine_choice MODE_CHOICE(ppc7400,ppc64)
-
-; Define some pseudo-opcodes for size-independent load & store of GPRs ...
-#define lgu MODE_CHOICE(lwzu, ldu)
-#define lg MODE_CHOICE(lwz,ld)
-#define sg MODE_CHOICE(stw,std)
-#define sgu MODE_CHOICE(stwu,stdu)
-#define sgux MODE_CHOICE(stwux,stdux)
-
-; ... and the size of GPRs and their storage indicator.
-#define GPR_BYTES MODE_CHOICE(4,8)
-#define LOG2_GPR_BYTES MODE_CHOICE(2,3) /* log2(GPR_BYTES) */
-#define g_long MODE_CHOICE(long, quad) /* usage is ".g_long" */
-
-; From the ABI doc: "Mac OS X ABI Function Call Guide" Version 2009-02-04.
-#define LINKAGE_SIZE MODE_CHOICE(24,48)
-#define PARAM_AREA MODE_CHOICE(32,64)
-#define SAVED_LR_OFFSET MODE_CHOICE(8,16) /* save position for lr */
-
-/* If there is any FP stuff we make space for all of the regs. */
-#define SAVED_FPR_COUNT 13
-#define FPR_SIZE 8
-#define RESULT_BYTES 16
-
-/* This should be kept in step with the same value in ffi_darwin.c. */
-#define ASM_NEEDS_REGISTERS 4
-#define SAVE_REGS_SIZE (ASM_NEEDS_REGISTERS * GPR_BYTES)
-
-#include <fficonfig.h>
-#include <ffi.h>
-
-#define JUMPTARGET(name) name
-#define L(x) x
-
- .text
- .align 2
- .globl _ffi_prep_args
-
- .align 2
- .globl _ffi_call_DARWIN
-
- /* We arrive here with:
- r3 = ptr to extended cif.
- r4 = -bytes.
- r5 = cif flags.
- r6 = ptr to return value.
- r7 = fn pointer (user func).
- r8 = fn pointer (ffi_prep_args).
- r9 = ffi_type* for the ret val. */
-
-_ffi_call_DARWIN:
-Lstartcode:
- mr r12,r8 /* We only need r12 until the call,
- so it does not have to be saved. */
-LFB1:
- /* Save the old stack pointer as AP. */
- mr r8,r1
-LCFI0:
-
- /* Save the retval type in parents frame. */
- sg r9,(LINKAGE_SIZE+6*GPR_BYTES)(r8)
-
- /* Allocate the stack space we need. */
- sgux r1,r1,r4
-
- /* Save registers we use. */
- mflr r9
- sg r9,SAVED_LR_OFFSET(r8)
-
- sg r28,-(4 * GPR_BYTES)(r8)
- sg r29,-(3 * GPR_BYTES)(r8)
- sg r30,-(2 * GPR_BYTES)(r8)
- sg r31,-( GPR_BYTES)(r8)
-
-#if !defined(POWERPC_DARWIN)
- /* The TOC slot is reserved in the Darwin ABI and r2 is volatile. */
- sg r2,(5 * GPR_BYTES)(r1)
-#endif
-
-LCFI1:
-
- /* Save arguments over call. */
- mr r31,r5 /* flags, */
- mr r30,r6 /* rvalue, */
- mr r29,r7 /* function address, */
- mr r28,r8 /* our AP. */
-LCFI2:
- /* Call ffi_prep_args. r3 = extended cif, r4 = stack ptr copy. */
- mr r4,r1
- li r9,0
-
- mtctr r12 /* r12 holds address of _ffi_prep_args. */
- bctrl
-
-#if !defined(POWERPC_DARWIN)
- /* The TOC slot is reserved in the Darwin ABI and r2 is volatile. */
- lg r2,(5 * GPR_BYTES)(r1)
-#endif
- /* Now do the call.
- Set up cr1 with bits 4-7 of the flags. */
- mtcrf 0x40,r31
- /* Get the address to call into CTR. */
- mtctr r29
- /* Load all those argument registers.
- We have set up a nice stack frame, just load it into registers. */
- lg r3, (LINKAGE_SIZE )(r1)
- lg r4, (LINKAGE_SIZE + GPR_BYTES)(r1)
- lg r5, (LINKAGE_SIZE + 2 * GPR_BYTES)(r1)
- lg r6, (LINKAGE_SIZE + 3 * GPR_BYTES)(r1)
- nop
- lg r7, (LINKAGE_SIZE + 4 * GPR_BYTES)(r1)
- lg r8, (LINKAGE_SIZE + 5 * GPR_BYTES)(r1)
- lg r9, (LINKAGE_SIZE + 6 * GPR_BYTES)(r1)
- lg r10,(LINKAGE_SIZE + 7 * GPR_BYTES)(r1)
-
-L1:
- /* ... Load all the FP registers. */
- bf 6,L2 /* No floats to load. */
- lfd f1, -SAVE_REGS_SIZE-(13*FPR_SIZE)(r28)
- lfd f2, -SAVE_REGS_SIZE-(12*FPR_SIZE)(r28)
- lfd f3, -SAVE_REGS_SIZE-(11*FPR_SIZE)(r28)
- lfd f4, -SAVE_REGS_SIZE-(10*FPR_SIZE)(r28)
- nop
- lfd f5, -SAVE_REGS_SIZE-( 9*FPR_SIZE)(r28)
- lfd f6, -SAVE_REGS_SIZE-( 8*FPR_SIZE)(r28)
- lfd f7, -SAVE_REGS_SIZE-( 7*FPR_SIZE)(r28)
- lfd f8, -SAVE_REGS_SIZE-( 6*FPR_SIZE)(r28)
- nop
- lfd f9, -SAVE_REGS_SIZE-( 5*FPR_SIZE)(r28)
- lfd f10,-SAVE_REGS_SIZE-( 4*FPR_SIZE)(r28)
- lfd f11,-SAVE_REGS_SIZE-( 3*FPR_SIZE)(r28)
- lfd f12,-SAVE_REGS_SIZE-( 2*FPR_SIZE)(r28)
- nop
- lfd f13,-SAVE_REGS_SIZE-( 1*FPR_SIZE)(r28)
-
-L2:
- mr r12,r29 /* Put the target address in r12 as specified. */
- mtctr r12
- nop
- nop
-
- /* Make the call. */
- bctrl
-
- /* Now, deal with the return value. */
-
- /* m64 structure returns can occupy the same set of registers as
- would be used to pass such a structure as arg0 - so take care
- not to step on any possibly hot regs. */
-
- /* Get the flags.. */
- mtcrf 0x03,r31 ; we need c6 & cr7 now.
- ; FLAG_RETURNS_NOTHING also covers struct ret-by-ref.
- bt 30,L(done_return_value) ; FLAG_RETURNS_NOTHING
- bf 27,L(scalar_return_value) ; not FLAG_RETURNS_STRUCT
-
- /* OK, so we have a struct. */
-#if defined(__ppc64__)
- bt 31,L(maybe_return_128) ; FLAG_RETURNS_128BITS, special case
-
- /* OK, we have to map the return back to a mem struct.
- We are about to trample the parents param area, so recover the
- return type. r29 is free, since the call is done. */
- lg r29,(LINKAGE_SIZE + 6 * GPR_BYTES)(r28)
-
- sg r3, (LINKAGE_SIZE )(r28)
- sg r4, (LINKAGE_SIZE + GPR_BYTES)(r28)
- sg r5, (LINKAGE_SIZE + 2 * GPR_BYTES)(r28)
- sg r6, (LINKAGE_SIZE + 3 * GPR_BYTES)(r28)
- nop
- sg r7, (LINKAGE_SIZE + 4 * GPR_BYTES)(r28)
- sg r8, (LINKAGE_SIZE + 5 * GPR_BYTES)(r28)
- sg r9, (LINKAGE_SIZE + 6 * GPR_BYTES)(r28)
- sg r10,(LINKAGE_SIZE + 7 * GPR_BYTES)(r28)
- /* OK, so do the block move - we trust that memcpy will not trample
- the fprs... */
- mr r3,r30 ; dest
- addi r4,r28,LINKAGE_SIZE ; source
- /* The size is a size_t, should be long. */
- lg r5,0(r29)
- /* Figure out small structs */
- cmpi 0,r5,4
- bgt L3 ; 1, 2 and 4 bytes have special rules.
- cmpi 0,r5,3
- beq L3 ; not 3
- addi r4,r4,8
- subf r4,r5,r4
-L3:
- bl _memcpy
-
- /* ... do we need the FP registers? - recover the flags.. */
- mtcrf 0x03,r31 ; we need c6 & cr7 now.
- bf 29,L(done_return_value) /* No floats in the struct. */
- stfd f1, -SAVE_REGS_SIZE-(13*FPR_SIZE)(r28)
- stfd f2, -SAVE_REGS_SIZE-(12*FPR_SIZE)(r28)
- stfd f3, -SAVE_REGS_SIZE-(11*FPR_SIZE)(r28)
- stfd f4, -SAVE_REGS_SIZE-(10*FPR_SIZE)(r28)
- nop
- stfd f5, -SAVE_REGS_SIZE-( 9*FPR_SIZE)(r28)
- stfd f6, -SAVE_REGS_SIZE-( 8*FPR_SIZE)(r28)
- stfd f7, -SAVE_REGS_SIZE-( 7*FPR_SIZE)(r28)
- stfd f8, -SAVE_REGS_SIZE-( 6*FPR_SIZE)(r28)
- nop
- stfd f9, -SAVE_REGS_SIZE-( 5*FPR_SIZE)(r28)
- stfd f10,-SAVE_REGS_SIZE-( 4*FPR_SIZE)(r28)
- stfd f11,-SAVE_REGS_SIZE-( 3*FPR_SIZE)(r28)
- stfd f12,-SAVE_REGS_SIZE-( 2*FPR_SIZE)(r28)
- nop
- stfd f13,-SAVE_REGS_SIZE-( 1*FPR_SIZE)(r28)
-
- mr r3,r29 ; ffi_type *
- mr r4,r30 ; dest
- addi r5,r28,-SAVE_REGS_SIZE-(13*FPR_SIZE) ; fprs
- xor r6,r6,r6
- sg r6,(LINKAGE_SIZE + 7 * GPR_BYTES)(r28)
- addi r6,r28,(LINKAGE_SIZE + 7 * GPR_BYTES) ; point to a zeroed counter.
- bl _darwin64_struct_floats_to_mem
-
- b L(done_return_value)
-#else
- stw r3,0(r30) ; m32 the only struct return in reg is 4 bytes.
-#endif
- b L(done_return_value)
-
-L(fp_return_value):
- /* Do we have long double to store? */
- bf 31,L(fd_return_value) ; FLAG_RETURNS_128BITS
- stfd f1,0(r30)
- stfd f2,FPR_SIZE(r30)
- b L(done_return_value)
-
-L(fd_return_value):
- /* Do we have double to store? */
- bf 28,L(float_return_value)
- stfd f1,0(r30)
- b L(done_return_value)
-
-L(float_return_value):
- /* We only have a float to store. */
- stfs f1,0(r30)
- b L(done_return_value)
-
-L(scalar_return_value):
- bt 29,L(fp_return_value) ; FLAG_RETURNS_FP
- ; ffi_arg is defined as unsigned long.
- sg r3,0(r30) ; Save the reg.
- bf 28,L(done_return_value) ; not FLAG_RETURNS_64BITS
-
-#if defined(__ppc64__)
-L(maybe_return_128):
- std r3,0(r30)
- bf 31,L(done_return_value) ; not FLAG_RETURNS_128BITS
- std r4,8(r30)
-#else
- stw r4,4(r30)
-#endif
-
- /* Fall through. */
- /* We want this at the end to simplify eh epilog computation. */
-
-L(done_return_value):
- /* Restore the registers we used and return. */
- lg r29,SAVED_LR_OFFSET(r28)
- ; epilog
- lg r31,-(1 * GPR_BYTES)(r28)
- mtlr r29
- lg r30,-(2 * GPR_BYTES)(r28)
- lg r29,-(3 * GPR_BYTES)(r28)
- lg r28,-(4 * GPR_BYTES)(r28)
- lg r1,0(r1)
- blr
-LFE1:
- .align 1
-/* END(_ffi_call_DARWIN) */
-
-/* Provide a null definition of _ffi_call_AIX. */
- .text
- .globl _ffi_call_AIX
- .align 2
-_ffi_call_AIX:
- blr
-/* END(_ffi_call_AIX) */
-
-/* EH stuff. */
-
-#define EH_DATA_ALIGN_FACT MODE_CHOICE(0x7c,0x78)
-
- .section __TEXT,__eh_frame,coalesced,no_toc+strip_static_syms+live_support
-EH_frame1:
- .set L$set$0,LECIE1-LSCIE1
- .long L$set$0 ; Length of Common Information Entry
-LSCIE1:
- .long 0x0 ; CIE Identifier Tag
- .byte 0x1 ; CIE Version
- .ascii "zR\0" ; CIE Augmentation
- .byte 0x1 ; uleb128 0x1; CIE Code Alignment Factor
- .byte EH_DATA_ALIGN_FACT ; sleb128 -4; CIE Data Alignment Factor
- .byte 0x41 ; CIE RA Column
- .byte 0x1 ; uleb128 0x1; Augmentation size
- .byte 0x10 ; FDE Encoding (pcrel)
- .byte 0xc ; DW_CFA_def_cfa
- .byte 0x1 ; uleb128 0x1
- .byte 0x0 ; uleb128 0x0
- .align LOG2_GPR_BYTES
-LECIE1:
-
- .globl _ffi_call_DARWIN.eh
-_ffi_call_DARWIN.eh:
-LSFDE1:
- .set L$set$1,LEFDE1-LASFDE1
- .long L$set$1 ; FDE Length
-LASFDE1:
- .long LASFDE1-EH_frame1 ; FDE CIE offset
- .g_long Lstartcode-. ; FDE initial location
- .set L$set$3,LFE1-Lstartcode
- .g_long L$set$3 ; FDE address range
- .byte 0x0 ; uleb128 0x0; Augmentation size
- .byte 0x4 ; DW_CFA_advance_loc4
- .set L$set$4,LCFI0-Lstartcode
- .long L$set$4
- .byte 0xd ; DW_CFA_def_cfa_register
- .byte 0x08 ; uleb128 0x08
- .byte 0x4 ; DW_CFA_advance_loc4
- .set L$set$5,LCFI1-LCFI0
- .long L$set$5
- .byte 0x11 ; DW_CFA_offset_extended_sf
- .byte 0x41 ; uleb128 0x41
- .byte 0x7e ; sleb128 -2
- .byte 0x9f ; DW_CFA_offset, column 0x1f
- .byte 0x1 ; uleb128 0x1
- .byte 0x9e ; DW_CFA_offset, column 0x1e
- .byte 0x2 ; uleb128 0x2
- .byte 0x9d ; DW_CFA_offset, column 0x1d
- .byte 0x3 ; uleb128 0x3
- .byte 0x9c ; DW_CFA_offset, column 0x1c
- .byte 0x4 ; uleb128 0x4
- .byte 0x4 ; DW_CFA_advance_loc4
- .set L$set$6,LCFI2-LCFI1
- .long L$set$6
- .byte 0xd ; DW_CFA_def_cfa_register
- .byte 0x1c ; uleb128 0x1c
- .align LOG2_GPR_BYTES
-LEFDE1:
- .align 1
-
diff --git a/Modules/_ctypes/libffi/src/powerpc/darwin_closure.S b/Modules/_ctypes/libffi/src/powerpc/darwin_closure.S
deleted file mode 100644
index c7734d4198..0000000000
--- a/Modules/_ctypes/libffi/src/powerpc/darwin_closure.S
+++ /dev/null
@@ -1,571 +0,0 @@
-/* -----------------------------------------------------------------------
- darwin_closure.S - Copyright (c) 2002, 2003, 2004, 2010,
- Free Software Foundation, Inc.
- based on ppc_closure.S
-
- PowerPC Assembly glue.
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- ``Software''), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to
- permit persons to whom the Software is furnished to do so, subject to
- the following conditions:
-
- The above copyright notice and this permission notice shall be included
- in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS
- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR
- OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- OTHER DEALINGS IN THE SOFTWARE.
- ----------------------------------------------------------------------- */
-
-#define LIBFFI_ASM
-#define L(x) x
-
-#if defined(__ppc64__)
-#define MODE_CHOICE(x, y) y
-#else
-#define MODE_CHOICE(x, y) x
-#endif
-
-#define machine_choice MODE_CHOICE(ppc7400,ppc64)
-
-; Define some pseudo-opcodes for size-independent load & store of GPRs ...
-#define lgu MODE_CHOICE(lwzu, ldu)
-#define lg MODE_CHOICE(lwz,ld)
-#define sg MODE_CHOICE(stw,std)
-#define sgu MODE_CHOICE(stwu,stdu)
-
-; ... and the size of GPRs and their storage indicator.
-#define GPR_BYTES MODE_CHOICE(4,8)
-#define LOG2_GPR_BYTES MODE_CHOICE(2,3) /* log2(GPR_BYTES) */
-#define g_long MODE_CHOICE(long, quad) /* usage is ".g_long" */
-
-; From the ABI doc: "Mac OS X ABI Function Call Guide" Version 2009-02-04.
-#define LINKAGE_SIZE MODE_CHOICE(24,48)
-#define PARAM_AREA MODE_CHOICE(32,64)
-
-#define SAVED_CR_OFFSET MODE_CHOICE(4,8) /* save position for CR */
-#define SAVED_LR_OFFSET MODE_CHOICE(8,16) /* save position for lr */
-
-/* WARNING: if ffi_type is changed... here be monsters.
- Offsets of items within the result type. */
-#define FFI_TYPE_TYPE MODE_CHOICE(6,10)
-#define FFI_TYPE_ELEM MODE_CHOICE(8,16)
-
-#define SAVED_FPR_COUNT 13
-#define FPR_SIZE 8
-/* biggest m64 struct ret is 8GPRS + 13FPRS = 168 bytes - rounded to 16bytes = 176. */
-#define RESULT_BYTES MODE_CHOICE(16,176)
-
-; The whole stack frame **MUST** be 16byte-aligned.
-#define SAVE_SIZE (((LINKAGE_SIZE+PARAM_AREA+SAVED_FPR_COUNT*FPR_SIZE+RESULT_BYTES)+15) & -16LL)
-#define PAD_SIZE (SAVE_SIZE-(LINKAGE_SIZE+PARAM_AREA+SAVED_FPR_COUNT*FPR_SIZE+RESULT_BYTES))
-
-#define PARENT_PARM_BASE (SAVE_SIZE+LINKAGE_SIZE)
-#define FP_SAVE_BASE (LINKAGE_SIZE+PARAM_AREA)
-
-#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 1050
-; We no longer need the pic symbol stub for Darwin >= 9.
-#define BLCLS_HELP _ffi_closure_helper_DARWIN
-#define STRUCT_RETVALUE_P _darwin64_struct_ret_by_value_p
-#define PASS_STR_FLOATS _darwin64_pass_struct_floats
-#undef WANT_STUB
-#else
-#define BLCLS_HELP L_ffi_closure_helper_DARWIN$stub
-#define STRUCT_RETVALUE_P L_darwin64_struct_ret_by_value_p$stub
-#define PASS_STR_FLOATS L_darwin64_pass_struct_floats$stub
-#define WANT_STUB
-#endif
-
-/* m32/m64
-
- The stack layout looks like this:
-
- | Additional params... | | Higher address
- ~ ~ ~
- | Parameters (at least 8*4/8=32/64) | | NUM_GPR_ARG_REGISTERS
- |--------------------------------------------| |
- | TOC=R2 (AIX) Reserved (Darwin) 4/8 | |
- |--------------------------------------------| |
- | Reserved 2*4/8 | |
- |--------------------------------------------| |
- | Space for callee`s LR 4/8 | |
- |--------------------------------------------| |
- | Saved CR [low word for m64] 4/8 | |
- |--------------------------------------------| |
- | Current backchain pointer 4/8 |-/ Parent`s frame.
- |--------------------------------------------| <+ <<< on entry to
- | Result Bytes 16/176 | |
- |--------------------------------------------| |
- ~ padding to 16-byte alignment ~ ~
- |--------------------------------------------| |
- | NUM_FPR_ARG_REGISTERS slots | |
- | here fp13 .. fp1 13*8 | |
- |--------------------------------------------| |
- | R3..R10 8*4/8=32/64 | | NUM_GPR_ARG_REGISTERS
- |--------------------------------------------| |
- | TOC=R2 (AIX) Reserved (Darwin) 4/8 | |
- |--------------------------------------------| | stack |
- | Reserved [compiler,binder] 2*4/8 | | grows |
- |--------------------------------------------| | down V
- | Space for callees LR 4/8 | |
- |--------------------------------------------| | lower addresses
- | Saved CR [low word for m64] 4/8 | |
- |--------------------------------------------| | stack pointer here
- | Current backchain pointer 4/8 |-/ during
- |--------------------------------------------| <<< call.
-
-*/
-
- .file "darwin_closure.S"
-
- .machine machine_choice
-
- .text
- .globl _ffi_closure_ASM
- .align LOG2_GPR_BYTES
-_ffi_closure_ASM:
-LFB1:
-Lstartcode:
- mflr r0 /* extract return address */
- sg r0,SAVED_LR_OFFSET(r1) /* save the return address */
-LCFI0:
- sgu r1,-SAVE_SIZE(r1) /* skip over caller save area
- keep stack aligned to 16. */
-LCFI1:
- /* We want to build up an area for the parameters passed
- in registers. (both floating point and integer) */
-
- /* Put gpr 3 to gpr 10 in the parents outgoing area...
- ... the remainder of any params that overflowed the regs will
- follow here. */
- sg r3, (PARENT_PARM_BASE )(r1)
- sg r4, (PARENT_PARM_BASE + GPR_BYTES )(r1)
- sg r5, (PARENT_PARM_BASE + GPR_BYTES * 2)(r1)
- sg r6, (PARENT_PARM_BASE + GPR_BYTES * 3)(r1)
- sg r7, (PARENT_PARM_BASE + GPR_BYTES * 4)(r1)
- sg r8, (PARENT_PARM_BASE + GPR_BYTES * 5)(r1)
- sg r9, (PARENT_PARM_BASE + GPR_BYTES * 6)(r1)
- sg r10,(PARENT_PARM_BASE + GPR_BYTES * 7)(r1)
-
- /* We save fpr 1 to fpr 14 in our own save frame. */
- stfd f1, (FP_SAVE_BASE )(r1)
- stfd f2, (FP_SAVE_BASE + FPR_SIZE )(r1)
- stfd f3, (FP_SAVE_BASE + FPR_SIZE * 2 )(r1)
- stfd f4, (FP_SAVE_BASE + FPR_SIZE * 3 )(r1)
- stfd f5, (FP_SAVE_BASE + FPR_SIZE * 4 )(r1)
- stfd f6, (FP_SAVE_BASE + FPR_SIZE * 5 )(r1)
- stfd f7, (FP_SAVE_BASE + FPR_SIZE * 6 )(r1)
- stfd f8, (FP_SAVE_BASE + FPR_SIZE * 7 )(r1)
- stfd f9, (FP_SAVE_BASE + FPR_SIZE * 8 )(r1)
- stfd f10,(FP_SAVE_BASE + FPR_SIZE * 9 )(r1)
- stfd f11,(FP_SAVE_BASE + FPR_SIZE * 10)(r1)
- stfd f12,(FP_SAVE_BASE + FPR_SIZE * 11)(r1)
- stfd f13,(FP_SAVE_BASE + FPR_SIZE * 12)(r1)
-
- /* Set up registers for the routine that actually does the work
- get the context pointer from the trampoline. */
- mr r3,r11
-
- /* Now load up the pointer to the result storage. */
- addi r4,r1,(SAVE_SIZE-RESULT_BYTES)
-
- /* Now load up the pointer to the saved gpr registers. */
- addi r5,r1,PARENT_PARM_BASE
-
- /* Now load up the pointer to the saved fpr registers. */
- addi r6,r1,FP_SAVE_BASE
-
- /* Make the call. */
- bl BLCLS_HELP
-
- /* r3 contains the rtype pointer... save it since we will need
- it later. */
- sg r3,LINKAGE_SIZE(r1) ; ffi_type * result_type
- lg r0,0(r3) ; size => r0
- lhz r3,FFI_TYPE_TYPE(r3) ; type => r3
-
- /* The helper will have intercepted structure returns and inserted
- the caller`s destination address for structs returned by ref. */
-
- /* r3 contains the return type so use it to look up in a table
- so we know how to deal with each type. */
-
- addi r5,r1,(SAVE_SIZE-RESULT_BYTES) /* Otherwise, our return is here. */
- bl Lget_ret_type0_addr /* Get pointer to Lret_type0 into LR. */
- mflr r4 /* Move to r4. */
- slwi r3,r3,4 /* Now multiply return type by 16. */
- add r3,r3,r4 /* Add contents of table to table address. */
- mtctr r3
- bctr /* Jump to it. */
-LFE1:
-/* Each of the ret_typeX code fragments has to be exactly 16 bytes long
- (4 instructions). For cache effectiveness we align to a 16 byte boundary
- first. */
-
- .align 4
-
- nop
- nop
- nop
-Lget_ret_type0_addr:
- blrl
-
-/* case FFI_TYPE_VOID */
-Lret_type0:
- b Lfinish
- nop
- nop
- nop
-
-/* case FFI_TYPE_INT */
-Lret_type1:
- lg r3,0(r5)
- b Lfinish
- nop
- nop
-
-/* case FFI_TYPE_FLOAT */
-Lret_type2:
- lfs f1,0(r5)
- b Lfinish
- nop
- nop
-
-/* case FFI_TYPE_DOUBLE */
-Lret_type3:
- lfd f1,0(r5)
- b Lfinish
- nop
- nop
-
-/* case FFI_TYPE_LONGDOUBLE */
-Lret_type4:
- lfd f1,0(r5)
- lfd f2,8(r5)
- b Lfinish
- nop
-
-/* case FFI_TYPE_UINT8 */
-Lret_type5:
-#if defined(__ppc64__)
- lbz r3,7(r5)
-#else
- lbz r3,3(r5)
-#endif
- b Lfinish
- nop
- nop
-
-/* case FFI_TYPE_SINT8 */
-Lret_type6:
-#if defined(__ppc64__)
- lbz r3,7(r5)
-#else
- lbz r3,3(r5)
-#endif
- extsb r3,r3
- b Lfinish
- nop
-
-/* case FFI_TYPE_UINT16 */
-Lret_type7:
-#if defined(__ppc64__)
- lhz r3,6(r5)
-#else
- lhz r3,2(r5)
-#endif
- b Lfinish
- nop
- nop
-
-/* case FFI_TYPE_SINT16 */
-Lret_type8:
-#if defined(__ppc64__)
- lha r3,6(r5)
-#else
- lha r3,2(r5)
-#endif
- b Lfinish
- nop
- nop
-
-/* case FFI_TYPE_UINT32 */
-Lret_type9:
-#if defined(__ppc64__)
- lwz r3,4(r5)
-#else
- lwz r3,0(r5)
-#endif
- b Lfinish
- nop
- nop
-
-/* case FFI_TYPE_SINT32 */
-Lret_type10:
-#if defined(__ppc64__)
- lwz r3,4(r5)
-#else
- lwz r3,0(r5)
-#endif
- b Lfinish
- nop
- nop
-
-/* case FFI_TYPE_UINT64 */
-Lret_type11:
-#if defined(__ppc64__)
- lg r3,0(r5)
- b Lfinish
- nop
-#else
- lwz r3,0(r5)
- lwz r4,4(r5)
- b Lfinish
-#endif
- nop
-
-/* case FFI_TYPE_SINT64 */
-Lret_type12:
-#if defined(__ppc64__)
- lg r3,0(r5)
- b Lfinish
- nop
-#else
- lwz r3,0(r5)
- lwz r4,4(r5)
- b Lfinish
-#endif
- nop
-
-/* case FFI_TYPE_STRUCT */
-Lret_type13:
-#if defined(__ppc64__)
- lg r3,0(r5) ; we need at least this...
- cmpi 0,r0,4
- bgt Lstructend ; not a special small case
- b Lsmallstruct ; see if we need more.
-#else
- cmpi 0,r0,4
- bgt Lfinish ; not by value
- lg r3,0(r5)
- b Lfinish
-#endif
-/* case FFI_TYPE_POINTER */
-Lret_type14:
- lg r3,0(r5)
- b Lfinish
- nop
- nop
-
-#if defined(__ppc64__)
-Lsmallstruct:
- beq Lfour ; continuation of Lret13.
- cmpi 0,r0,3
- beq Lfinish ; don`t adjust this - can`t be any floats here...
- srdi r3,r3,48
- cmpi 0,r0,2
- beq Lfinish ; .. or here ..
- srdi r3,r3,8
- b Lfinish ; .. or here.
-
-Lfour:
- lg r6,LINKAGE_SIZE(r1) ; get the result type
- lg r6,FFI_TYPE_ELEM(r6) ; elements array pointer
- lg r6,0(r6) ; first element
- lhz r0,FFI_TYPE_TYPE(r6) ; OK go the type
- cmpi 0,r0,2 ; FFI_TYPE_FLOAT
- bne Lfourint
- lfs f1,0(r5) ; just one float in the struct.
- b Lfinish
-
-Lfourint:
- srdi r3,r3,32 ; four bytes.
- b Lfinish
-
-Lstructend:
- lg r3,LINKAGE_SIZE(r1) ; get the result type
- bl STRUCT_RETVALUE_P
- cmpi 0,r3,0
- beq Lfinish ; nope.
- /* Recover a pointer to the results. */
- addi r11,r1,(SAVE_SIZE-RESULT_BYTES)
- lg r3,0(r11) ; we need at least this...
- lg r4,8(r11)
- cmpi 0,r0,16
- beq Lfinish ; special case 16 bytes we don't consider floats.
-
- /* OK, frustratingly, the process of saving the struct to mem might have
- messed with the FPRs, so we have to re-load them :(.
- We`ll use our FPRs space again - calling:
- void darwin64_pass_struct_floats (ffi_type *s, char *src,
- unsigned *nfpr, double **fprs)
- We`ll temporarily pinch the first two slots of the param area for local
- vars used by the routine. */
- xor r6,r6,r6
- addi r5,r1,PARENT_PARM_BASE ; some space
- sg r6,0(r5) ; *nfpr zeroed.
- addi r6,r5,8 ; **fprs
- addi r3,r1,FP_SAVE_BASE ; pointer to FPRs space
- sg r3,0(r6)
- mr r4,r11 ; the struct is here...
- lg r3,LINKAGE_SIZE(r1) ; ffi_type * result_type.
- bl PASS_STR_FLOATS ; get struct floats into FPR save space.
- /* See if we used any floats */
- lwz r0,(SAVE_SIZE-RESULT_BYTES)(r1)
- cmpi 0,r0,0
- beq Lstructints ; nope.
- /* OK load `em up... */
- lfd f1, (FP_SAVE_BASE )(r1)
- lfd f2, (FP_SAVE_BASE + FPR_SIZE )(r1)
- lfd f3, (FP_SAVE_BASE + FPR_SIZE * 2 )(r1)
- lfd f4, (FP_SAVE_BASE + FPR_SIZE * 3 )(r1)
- lfd f5, (FP_SAVE_BASE + FPR_SIZE * 4 )(r1)
- lfd f6, (FP_SAVE_BASE + FPR_SIZE * 5 )(r1)
- lfd f7, (FP_SAVE_BASE + FPR_SIZE * 6 )(r1)
- lfd f8, (FP_SAVE_BASE + FPR_SIZE * 7 )(r1)
- lfd f9, (FP_SAVE_BASE + FPR_SIZE * 8 )(r1)
- lfd f10,(FP_SAVE_BASE + FPR_SIZE * 9 )(r1)
- lfd f11,(FP_SAVE_BASE + FPR_SIZE * 10)(r1)
- lfd f12,(FP_SAVE_BASE + FPR_SIZE * 11)(r1)
- lfd f13,(FP_SAVE_BASE + FPR_SIZE * 12)(r1)
-
- /* point back at our saved struct. */
-Lstructints:
- addi r11,r1,(SAVE_SIZE-RESULT_BYTES)
- lg r3,0(r11) ; we end up picking the
- lg r4,8(r11) ; first two again.
- lg r5,16(r11)
- lg r6,24(r11)
- lg r7,32(r11)
- lg r8,40(r11)
- lg r9,48(r11)
- lg r10,56(r11)
-#endif
-
-/* case done */
-Lfinish:
- addi r1,r1,SAVE_SIZE /* Restore stack pointer. */
- lg r0,SAVED_LR_OFFSET(r1) /* Get return address. */
- mtlr r0 /* Reset link register. */
- blr
-Lendcode:
- .align 1
-
-/* END(ffi_closure_ASM) */
-
-/* EH frame stuff. */
-#define EH_DATA_ALIGN_FACT MODE_CHOICE(0x7c,0x78)
-/* 176, 400 */
-#define EH_FRAME_OFFSETA MODE_CHOICE(176,0x90)
-#define EH_FRAME_OFFSETB MODE_CHOICE(1,3)
-
- .section __TEXT,__eh_frame,coalesced,no_toc+strip_static_syms+live_support
-EH_frame1:
- .set L$set$0,LECIE1-LSCIE1
- .long L$set$0 ; Length of Common Information Entry
-LSCIE1:
- .long 0x0 ; CIE Identifier Tag
- .byte 0x1 ; CIE Version
- .ascii "zR\0" ; CIE Augmentation
- .byte 0x1 ; uleb128 0x1; CIE Code Alignment Factor
- .byte EH_DATA_ALIGN_FACT ; sleb128 -4; CIE Data Alignment Factor
- .byte 0x41 ; CIE RA Column
- .byte 0x1 ; uleb128 0x1; Augmentation size
- .byte 0x10 ; FDE Encoding (pcrel)
- .byte 0xc ; DW_CFA_def_cfa
- .byte 0x1 ; uleb128 0x1
- .byte 0x0 ; uleb128 0x0
- .align LOG2_GPR_BYTES
-LECIE1:
- .globl _ffi_closure_ASM.eh
-_ffi_closure_ASM.eh:
-LSFDE1:
- .set L$set$1,LEFDE1-LASFDE1
- .long L$set$1 ; FDE Length
-
-LASFDE1:
- .long LASFDE1-EH_frame1 ; FDE CIE offset
- .g_long Lstartcode-. ; FDE initial location
- .set L$set$3,LFE1-Lstartcode
- .g_long L$set$3 ; FDE address range
- .byte 0x0 ; uleb128 0x0; Augmentation size
- .byte 0x4 ; DW_CFA_advance_loc4
- .set L$set$3,LCFI1-LCFI0
- .long L$set$3
- .byte 0xe ; DW_CFA_def_cfa_offset
- .byte EH_FRAME_OFFSETA,EH_FRAME_OFFSETB ; uleb128 176,1/190,3
- .byte 0x4 ; DW_CFA_advance_loc4
- .set L$set$4,LCFI0-Lstartcode
- .long L$set$4
- .byte 0x11 ; DW_CFA_offset_extended_sf
- .byte 0x41 ; uleb128 0x41
- .byte 0x7e ; sleb128 -2
- .align LOG2_GPR_BYTES
-LEFDE1:
- .align 1
-
-#ifdef WANT_STUB
- .section __TEXT,__picsymbolstub1,symbol_stubs,pure_instructions,32
- .align 5
-L_ffi_closure_helper_DARWIN$stub:
- .indirect_symbol _ffi_closure_helper_DARWIN
- mflr r0
- bcl 20,31,"L1$spb"
-"L1$spb":
- mflr r11
- addis r11,r11,ha16(L_ffi_closure_helper_DARWIN$lazy_ptr-"L1$spb")
- mtlr r0
- lwzu r12,lo16(L_ffi_closure_helper_DARWIN$lazy_ptr-"L1$spb")(r11)
- mtctr r12
- bctr
- .lazy_symbol_pointer
-L_ffi_closure_helper_DARWIN$lazy_ptr:
- .indirect_symbol _ffi_closure_helper_DARWIN
- .g_long dyld_stub_binding_helper
-
-#if defined(__ppc64__)
- .section __TEXT,__picsymbolstub1,symbol_stubs,pure_instructions,32
- .align 5
-L_darwin64_struct_ret_by_value_p$stub:
- .indirect_symbol _darwin64_struct_ret_by_value_p
- mflr r0
- bcl 20,31,"L2$spb"
-"L2$spb":
- mflr r11
- addis r11,r11,ha16(L_darwin64_struct_ret_by_value_p$lazy_ptr-"L2$spb")
- mtlr r0
- lwzu r12,lo16(L_darwin64_struct_ret_by_value_p$lazy_ptr-"L2$spb")(r11)
- mtctr r12
- bctr
- .lazy_symbol_pointer
-L_darwin64_struct_ret_by_value_p$lazy_ptr:
- .indirect_symbol _darwin64_struct_ret_by_value_p
- .g_long dyld_stub_binding_helper
-
- .section __TEXT,__picsymbolstub1,symbol_stubs,pure_instructions,32
- .align 5
-L_darwin64_pass_struct_floats$stub:
- .indirect_symbol _darwin64_pass_struct_floats
- mflr r0
- bcl 20,31,"L3$spb"
-"L3$spb":
- mflr r11
- addis r11,r11,ha16(L_darwin64_pass_struct_floats$lazy_ptr-"L3$spb")
- mtlr r0
- lwzu r12,lo16(L_darwin64_pass_struct_floats$lazy_ptr-"L3$spb")(r11)
- mtctr r12
- bctr
- .lazy_symbol_pointer
-L_darwin64_pass_struct_floats$lazy_ptr:
- .indirect_symbol _darwin64_pass_struct_floats
- .g_long dyld_stub_binding_helper
-# endif
-#endif
diff --git a/Modules/_ctypes/libffi/src/powerpc/ffi.c b/Modules/_ctypes/libffi/src/powerpc/ffi.c
deleted file mode 100644
index efb441bbfc..0000000000
--- a/Modules/_ctypes/libffi/src/powerpc/ffi.c
+++ /dev/null
@@ -1,141 +0,0 @@
-/* -----------------------------------------------------------------------
- ffi.c - Copyright (C) 2013 IBM
- Copyright (C) 2011 Anthony Green
- Copyright (C) 2011 Kyle Moffett
- Copyright (C) 2008 Red Hat, Inc
- Copyright (C) 2007, 2008 Free Software Foundation, Inc
- Copyright (c) 1998 Geoffrey Keating
-
- PowerPC Foreign Function Interface
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- ``Software''), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to
- permit persons to whom the Software is furnished to do so, subject to
- the following conditions:
-
- The above copyright notice and this permission notice shall be included
- in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS
- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR
- OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- OTHER DEALINGS IN THE SOFTWARE.
- ----------------------------------------------------------------------- */
-
-#include "ffi.h"
-#include "ffi_common.h"
-#include "ffi_powerpc.h"
-
-#if HAVE_LONG_DOUBLE_VARIANT
-/* Adjust ffi_type_longdouble. */
-void FFI_HIDDEN
-ffi_prep_types (ffi_abi abi)
-{
-# if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE
-# ifdef POWERPC64
- ffi_prep_types_linux64 (abi);
-# else
- ffi_prep_types_sysv (abi);
-# endif
-# endif
-}
-#endif
-
-/* Perform machine dependent cif processing */
-ffi_status FFI_HIDDEN
-ffi_prep_cif_machdep (ffi_cif *cif)
-{
-#ifdef POWERPC64
- return ffi_prep_cif_linux64 (cif);
-#else
- return ffi_prep_cif_sysv (cif);
-#endif
-}
-
-ffi_status FFI_HIDDEN
-ffi_prep_cif_machdep_var (ffi_cif *cif,
- unsigned int nfixedargs MAYBE_UNUSED,
- unsigned int ntotalargs MAYBE_UNUSED)
-{
-#ifdef POWERPC64
- return ffi_prep_cif_linux64_var (cif, nfixedargs, ntotalargs);
-#else
- return ffi_prep_cif_sysv (cif);
-#endif
-}
-
-void
-ffi_call(ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue)
-{
- /* The final SYSV ABI says that structures smaller or equal 8 bytes
- are returned in r3/r4. A draft ABI used by linux instead returns
- them in memory.
-
- We bounce-buffer SYSV small struct return values so that sysv.S
- can write r3 and r4 to memory without worrying about struct size.
-
- For ELFv2 ABI, use a bounce buffer for homogeneous structs too,
- for similar reasons. */
- unsigned long smst_buffer[8];
- extended_cif ecif;
-
- ecif.cif = cif;
- ecif.avalue = avalue;
-
- ecif.rvalue = rvalue;
- if ((cif->flags & FLAG_RETURNS_SMST) != 0)
- ecif.rvalue = smst_buffer;
- /* Ensure that we have a valid struct return value.
- FIXME: Isn't this just papering over a user problem? */
- else if (!rvalue && cif->rtype->type == FFI_TYPE_STRUCT)
- ecif.rvalue = alloca (cif->rtype->size);
-
-#ifdef POWERPC64
- ffi_call_LINUX64 (&ecif, -(long) cif->bytes, cif->flags, ecif.rvalue, fn);
-#else
- ffi_call_SYSV (&ecif, -cif->bytes, cif->flags, ecif.rvalue, fn);
-#endif
-
- /* Check for a bounce-buffered return value */
- if (rvalue && ecif.rvalue == smst_buffer)
- {
- unsigned int rsize = cif->rtype->size;
-#ifndef __LITTLE_ENDIAN__
- /* The SYSV ABI returns a structure of up to 4 bytes in size
- left-padded in r3. */
-# ifndef POWERPC64
- if (rsize <= 4)
- memcpy (rvalue, (char *) smst_buffer + 4 - rsize, rsize);
- else
-# endif
- /* The SYSV ABI returns a structure of up to 8 bytes in size
- left-padded in r3/r4, and the ELFv2 ABI similarly returns a
- structure of up to 8 bytes in size left-padded in r3. */
- if (rsize <= 8)
- memcpy (rvalue, (char *) smst_buffer + 8 - rsize, rsize);
- else
-#endif
- memcpy (rvalue, smst_buffer, rsize);
- }
-}
-
-
-ffi_status
-ffi_prep_closure_loc (ffi_closure *closure,
- ffi_cif *cif,
- void (*fun) (ffi_cif *, void *, void **, void *),
- void *user_data,
- void *codeloc)
-{
-#ifdef POWERPC64
- return ffi_prep_closure_loc_linux64 (closure, cif, fun, user_data, codeloc);
-#else
- return ffi_prep_closure_loc_sysv (closure, cif, fun, user_data, codeloc);
-#endif
-}
diff --git a/Modules/_ctypes/libffi/src/powerpc/ffi_darwin.c b/Modules/_ctypes/libffi/src/powerpc/ffi_darwin.c
deleted file mode 100644
index cf6fb6d4b7..0000000000
--- a/Modules/_ctypes/libffi/src/powerpc/ffi_darwin.c
+++ /dev/null
@@ -1,1359 +0,0 @@
-/* -----------------------------------------------------------------------
- ffi_darwin.c
-
- Copyright (C) 1998 Geoffrey Keating
- Copyright (C) 2001 John Hornkvist
- Copyright (C) 2002, 2006, 2007, 2009, 2010 Free Software Foundation, Inc.
-
- FFI support for Darwin and AIX.
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- ``Software''), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to
- permit persons to whom the Software is furnished to do so, subject to
- the following conditions:
-
- The above copyright notice and this permission notice shall be included
- in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS
- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR
- OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- OTHER DEALINGS IN THE SOFTWARE.
- ----------------------------------------------------------------------- */
-
-#include <ffi.h>
-#include <ffi_common.h>
-
-#include <stdlib.h>
-
-extern void ffi_closure_ASM (void);
-
-enum {
- /* The assembly depends on these exact flags.
- For Darwin64 (when FLAG_RETURNS_STRUCT is set):
- FLAG_RETURNS_FP indicates that the structure embeds FP data.
- FLAG_RETURNS_128BITS signals a special struct size that is not
- expanded for float content. */
- FLAG_RETURNS_128BITS = 1 << (31-31), /* These go in cr7 */
- FLAG_RETURNS_NOTHING = 1 << (31-30),
- FLAG_RETURNS_FP = 1 << (31-29),
- FLAG_RETURNS_64BITS = 1 << (31-28),
-
- FLAG_RETURNS_STRUCT = 1 << (31-27), /* This goes in cr6 */
-
- FLAG_ARG_NEEDS_COPY = 1 << (31- 7),
- FLAG_FP_ARGUMENTS = 1 << (31- 6), /* cr1.eq; specified by ABI */
- FLAG_4_GPR_ARGUMENTS = 1 << (31- 5),
- FLAG_RETVAL_REFERENCE = 1 << (31- 4)
-};
-
-/* About the DARWIN ABI. */
-enum {
- NUM_GPR_ARG_REGISTERS = 8,
- NUM_FPR_ARG_REGISTERS = 13,
- LINKAGE_AREA_GPRS = 6
-};
-
-enum { ASM_NEEDS_REGISTERS = 4 }; /* r28-r31 */
-
-/* ffi_prep_args is called by the assembly routine once stack space
- has been allocated for the function's arguments.
-
- m32/m64
-
- The stack layout we want looks like this:
-
- | Return address from ffi_call_DARWIN | higher addresses
- |--------------------------------------------|
- | Previous backchain pointer 4/8 | stack pointer here
- |--------------------------------------------|<+ <<< on entry to
- | ASM_NEEDS_REGISTERS=r28-r31 4*(4/8) | | ffi_call_DARWIN
- |--------------------------------------------| |
- | When we have any FP activity... the | |
- | FPRs occupy NUM_FPR_ARG_REGISTERS slots | |
- | here fp13 .. fp1 from high to low addr. | |
- ~ ~ ~
- | Parameters (at least 8*4/8=32/64) | | NUM_GPR_ARG_REGISTERS
- |--------------------------------------------| |
- | TOC=R2 (AIX) Reserved (Darwin) 4/8 | |
- |--------------------------------------------| | stack |
- | Reserved 2*4/8 | | grows |
- |--------------------------------------------| | down V
- | Space for callee's LR 4/8 | |
- |--------------------------------------------| | lower addresses
- | Saved CR [low word for m64] 4/8 | |
- |--------------------------------------------| | stack pointer here
- | Current backchain pointer 4/8 |-/ during
- |--------------------------------------------| <<< ffi_call_DARWIN
-
- */
-
-#if defined(POWERPC_DARWIN64)
-static void
-darwin64_pass_struct_by_value
- (ffi_type *, char *, unsigned, unsigned *, double **, unsigned long **);
-#endif
-
-/* This depends on GPR_SIZE = sizeof (unsigned long) */
-
-void
-ffi_prep_args (extended_cif *ecif, unsigned long *const stack)
-{
- const unsigned bytes = ecif->cif->bytes;
- const unsigned flags = ecif->cif->flags;
- const unsigned nargs = ecif->cif->nargs;
-#if !defined(POWERPC_DARWIN64)
- const ffi_abi abi = ecif->cif->abi;
-#endif
-
- /* 'stacktop' points at the previous backchain pointer. */
- unsigned long *const stacktop = stack + (bytes / sizeof(unsigned long));
-
- /* 'fpr_base' points at the space for fpr1, and grows upwards as
- we use FPR registers. */
- double *fpr_base = (double *) (stacktop - ASM_NEEDS_REGISTERS) - NUM_FPR_ARG_REGISTERS;
- int gp_count = 0, fparg_count = 0;
-
- /* 'next_arg' grows up as we put parameters in it. */
- unsigned long *next_arg = stack + LINKAGE_AREA_GPRS; /* 6 reserved positions. */
-
- int i;
- double double_tmp;
- void **p_argv = ecif->avalue;
- unsigned long gprvalue;
- ffi_type** ptr = ecif->cif->arg_types;
-#if !defined(POWERPC_DARWIN64)
- char *dest_cpy;
-#endif
- unsigned size_al = 0;
-
- /* Check that everything starts aligned properly. */
- FFI_ASSERT(((unsigned) (char *) stack & 0xF) == 0);
- FFI_ASSERT(((unsigned) (char *) stacktop & 0xF) == 0);
- FFI_ASSERT((bytes & 0xF) == 0);
-
- /* Deal with return values that are actually pass-by-reference.
- Rule:
- Return values are referenced by r3, so r4 is the first parameter. */
-
- if (flags & FLAG_RETVAL_REFERENCE)
- *next_arg++ = (unsigned long) (char *) ecif->rvalue;
-
- /* Now for the arguments. */
- for (i = nargs; i > 0; i--, ptr++, p_argv++)
- {
- switch ((*ptr)->type)
- {
- /* If a floating-point parameter appears before all of the general-
- purpose registers are filled, the corresponding GPRs that match
- the size of the floating-point parameter are skipped. */
- case FFI_TYPE_FLOAT:
- double_tmp = *(float *) *p_argv;
- if (fparg_count < NUM_FPR_ARG_REGISTERS)
- *fpr_base++ = double_tmp;
-#if defined(POWERPC_DARWIN)
- *(float *)next_arg = *(float *) *p_argv;
-#else
- *(double *)next_arg = double_tmp;
-#endif
- next_arg++;
- gp_count++;
- fparg_count++;
- FFI_ASSERT(flags & FLAG_FP_ARGUMENTS);
- break;
-
- case FFI_TYPE_DOUBLE:
- double_tmp = *(double *) *p_argv;
- if (fparg_count < NUM_FPR_ARG_REGISTERS)
- *fpr_base++ = double_tmp;
- *(double *)next_arg = double_tmp;
-#ifdef POWERPC64
- next_arg++;
- gp_count++;
-#else
- next_arg += 2;
- gp_count += 2;
-#endif
- fparg_count++;
- FFI_ASSERT(flags & FLAG_FP_ARGUMENTS);
- break;
-
-#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE
-
- case FFI_TYPE_LONGDOUBLE:
-# if defined(POWERPC64) && !defined(POWERPC_DARWIN64)
- /* ??? This will exceed the regs count when the value starts at fp13
- and it will not put the extra bit on the stack. */
- if (fparg_count < NUM_FPR_ARG_REGISTERS)
- *(long double *) fpr_base++ = *(long double *) *p_argv;
- else
- *(long double *) next_arg = *(long double *) *p_argv;
- next_arg += 2;
- fparg_count += 2;
-# else
- double_tmp = ((double *) *p_argv)[0];
- if (fparg_count < NUM_FPR_ARG_REGISTERS)
- *fpr_base++ = double_tmp;
- *(double *) next_arg = double_tmp;
-# if defined(POWERPC_DARWIN64)
- next_arg++;
- gp_count++;
-# else
- next_arg += 2;
- gp_count += 2;
-# endif
- fparg_count++;
- double_tmp = ((double *) *p_argv)[1];
- if (fparg_count < NUM_FPR_ARG_REGISTERS)
- *fpr_base++ = double_tmp;
- *(double *) next_arg = double_tmp;
-# if defined(POWERPC_DARWIN64)
- next_arg++;
- gp_count++;
-# else
- next_arg += 2;
- gp_count += 2;
-# endif
- fparg_count++;
-# endif
- FFI_ASSERT(flags & FLAG_FP_ARGUMENTS);
- break;
-#endif
- case FFI_TYPE_UINT64:
- case FFI_TYPE_SINT64:
-#ifdef POWERPC64
- gprvalue = *(long long *) *p_argv;
- goto putgpr;
-#else
- *(long long *) next_arg = *(long long *) *p_argv;
- next_arg += 2;
- gp_count += 2;
-#endif
- break;
- case FFI_TYPE_POINTER:
- gprvalue = *(unsigned long *) *p_argv;
- goto putgpr;
- case FFI_TYPE_UINT8:
- gprvalue = *(unsigned char *) *p_argv;
- goto putgpr;
- case FFI_TYPE_SINT8:
- gprvalue = *(signed char *) *p_argv;
- goto putgpr;
- case FFI_TYPE_UINT16:
- gprvalue = *(unsigned short *) *p_argv;
- goto putgpr;
- case FFI_TYPE_SINT16:
- gprvalue = *(signed short *) *p_argv;
- goto putgpr;
-
- case FFI_TYPE_STRUCT:
- size_al = (*ptr)->size;
-#if defined(POWERPC_DARWIN64)
- next_arg = (unsigned long *)ALIGN((char *)next_arg, (*ptr)->alignment);
- darwin64_pass_struct_by_value (*ptr, (char *) *p_argv,
- (unsigned) size_al,
- (unsigned int *) &fparg_count,
- &fpr_base, &next_arg);
-#else
- dest_cpy = (char *) next_arg;
-
- /* If the first member of the struct is a double, then include enough
- padding in the struct size to align it to double-word. */
- if ((*ptr)->elements[0]->type == FFI_TYPE_DOUBLE)
- size_al = ALIGN((*ptr)->size, 8);
-
-# if defined(POWERPC64)
- FFI_ASSERT (abi != FFI_DARWIN);
- memcpy ((char *) dest_cpy, (char *) *p_argv, size_al);
- next_arg += (size_al + 7) / 8;
-# else
- /* Structures that match the basic modes (QI 1 byte, HI 2 bytes,
- SI 4 bytes) are aligned as if they were those modes.
- Structures with 3 byte in size are padded upwards. */
- if (size_al < 3 && abi == FFI_DARWIN)
- dest_cpy += 4 - size_al;
-
- memcpy((char *) dest_cpy, (char *) *p_argv, size_al);
- next_arg += (size_al + 3) / 4;
-# endif
-#endif
- break;
-
- case FFI_TYPE_INT:
- case FFI_TYPE_SINT32:
- gprvalue = *(signed int *) *p_argv;
- goto putgpr;
-
- case FFI_TYPE_UINT32:
- gprvalue = *(unsigned int *) *p_argv;
- putgpr:
- *next_arg++ = gprvalue;
- gp_count++;
- break;
- default:
- break;
- }
- }
-
- /* Check that we didn't overrun the stack... */
- /* FFI_ASSERT(gpr_base <= stacktop - ASM_NEEDS_REGISTERS);
- FFI_ASSERT((unsigned *)fpr_base
- <= stacktop - ASM_NEEDS_REGISTERS - NUM_GPR_ARG_REGISTERS);
- FFI_ASSERT(flags & FLAG_4_GPR_ARGUMENTS || intarg_count <= 4); */
-}
-
-#if defined(POWERPC_DARWIN64)
-
-/* See if we can put some of the struct into fprs.
- This should not be called for structures of size 16 bytes, since these are not
- broken out this way. */
-static void
-darwin64_scan_struct_for_floats (ffi_type *s, unsigned *nfpr)
-{
- int i;
-
- FFI_ASSERT (s->type == FFI_TYPE_STRUCT)
-
- for (i = 0; s->elements[i] != NULL; i++)
- {
- ffi_type *p = s->elements[i];
- switch (p->type)
- {
- case FFI_TYPE_STRUCT:
- darwin64_scan_struct_for_floats (p, nfpr);
- break;
- case FFI_TYPE_LONGDOUBLE:
- (*nfpr) += 2;
- break;
- case FFI_TYPE_DOUBLE:
- case FFI_TYPE_FLOAT:
- (*nfpr) += 1;
- break;
- default:
- break;
- }
- }
-}
-
-static int
-darwin64_struct_size_exceeds_gprs_p (ffi_type *s, char *src, unsigned *nfpr)
-{
- unsigned struct_offset=0, i;
-
- for (i = 0; s->elements[i] != NULL; i++)
- {
- char *item_base;
- ffi_type *p = s->elements[i];
- /* Find the start of this item (0 for the first one). */
- if (i > 0)
- struct_offset = ALIGN(struct_offset, p->alignment);
-
- item_base = src + struct_offset;
-
- switch (p->type)
- {
- case FFI_TYPE_STRUCT:
- if (darwin64_struct_size_exceeds_gprs_p (p, item_base, nfpr))
- return 1;
- break;
- case FFI_TYPE_LONGDOUBLE:
- if (*nfpr >= NUM_FPR_ARG_REGISTERS)
- return 1;
- (*nfpr) += 1;
- item_base += 8;
- /* FALL THROUGH */
- case FFI_TYPE_DOUBLE:
- if (*nfpr >= NUM_FPR_ARG_REGISTERS)
- return 1;
- (*nfpr) += 1;
- break;
- case FFI_TYPE_FLOAT:
- if (*nfpr >= NUM_FPR_ARG_REGISTERS)
- return 1;
- (*nfpr) += 1;
- break;
- default:
- /* If we try and place any item, that is non-float, once we've
- exceeded the 8 GPR mark, then we can't fit the struct. */
- if ((unsigned long)item_base >= 8*8)
- return 1;
- break;
- }
- /* now count the size of what we just used. */
- struct_offset += p->size;
- }
- return 0;
-}
-
-/* Can this struct be returned by value? */
-int
-darwin64_struct_ret_by_value_p (ffi_type *s)
-{
- unsigned nfp = 0;
-
- FFI_ASSERT (s && s->type == FFI_TYPE_STRUCT);
-
- /* The largest structure we can return is 8long + 13 doubles. */
- if (s->size > 168)
- return 0;
-
- /* We can't pass more than 13 floats. */
- darwin64_scan_struct_for_floats (s, &nfp);
- if (nfp > 13)
- return 0;
-
- /* If there are not too many floats, and the struct is
- small enough to accommodate in the GPRs, then it must be OK. */
- if (s->size <= 64)
- return 1;
-
- /* Well, we have to look harder. */
- nfp = 0;
- if (darwin64_struct_size_exceeds_gprs_p (s, NULL, &nfp))
- return 0;
-
- return 1;
-}
-
-void
-darwin64_pass_struct_floats (ffi_type *s, char *src,
- unsigned *nfpr, double **fprs)
-{
- int i;
- double *fpr_base = *fprs;
- unsigned struct_offset = 0;
-
- /* We don't assume anything about the alignment of the source. */
- for (i = 0; s->elements[i] != NULL; i++)
- {
- char *item_base;
- ffi_type *p = s->elements[i];
- /* Find the start of this item (0 for the first one). */
- if (i > 0)
- struct_offset = ALIGN(struct_offset, p->alignment);
- item_base = src + struct_offset;
-
- switch (p->type)
- {
- case FFI_TYPE_STRUCT:
- darwin64_pass_struct_floats (p, item_base, nfpr,
- &fpr_base);
- break;
- case FFI_TYPE_LONGDOUBLE:
- if (*nfpr < NUM_FPR_ARG_REGISTERS)
- *fpr_base++ = *(double *)item_base;
- (*nfpr) += 1;
- item_base += 8;
- /* FALL THROUGH */
- case FFI_TYPE_DOUBLE:
- if (*nfpr < NUM_FPR_ARG_REGISTERS)
- *fpr_base++ = *(double *)item_base;
- (*nfpr) += 1;
- break;
- case FFI_TYPE_FLOAT:
- if (*nfpr < NUM_FPR_ARG_REGISTERS)
- *fpr_base++ = (double) *(float *)item_base;
- (*nfpr) += 1;
- break;
- default:
- break;
- }
- /* now count the size of what we just used. */
- struct_offset += p->size;
- }
- /* Update the scores. */
- *fprs = fpr_base;
-}
-
-/* Darwin64 special rules.
- Break out a struct into params and float registers. */
-static void
-darwin64_pass_struct_by_value (ffi_type *s, char *src, unsigned size,
- unsigned *nfpr, double **fprs, unsigned long **arg)
-{
- unsigned long *next_arg = *arg;
- char *dest_cpy = (char *)next_arg;
-
- FFI_ASSERT (s->type == FFI_TYPE_STRUCT)
-
- if (!size)
- return;
-
- /* First... special cases. */
- if (size < 3
- || (size == 4
- && s->elements[0]
- && s->elements[0]->type != FFI_TYPE_FLOAT))
- {
- /* Must be at least one GPR, padding is unspecified in value,
- let's make it zero. */
- *next_arg = 0UL;
- dest_cpy += 8 - size;
- memcpy ((char *) dest_cpy, src, size);
- next_arg++;
- }
- else if (size == 16)
- {
- memcpy ((char *) dest_cpy, src, size);
- next_arg += 2;
- }
- else
- {
- /* now the general case, we consider embedded floats. */
- memcpy ((char *) dest_cpy, src, size);
- darwin64_pass_struct_floats (s, src, nfpr, fprs);
- next_arg += (size+7)/8;
- }
-
- *arg = next_arg;
-}
-
-double *
-darwin64_struct_floats_to_mem (ffi_type *s, char *dest, double *fprs, unsigned *nf)
-{
- int i;
- unsigned struct_offset = 0;
-
- /* We don't assume anything about the alignment of the source. */
- for (i = 0; s->elements[i] != NULL; i++)
- {
- char *item_base;
- ffi_type *p = s->elements[i];
- /* Find the start of this item (0 for the first one). */
- if (i > 0)
- struct_offset = ALIGN(struct_offset, p->alignment);
- item_base = dest + struct_offset;
-
- switch (p->type)
- {
- case FFI_TYPE_STRUCT:
- fprs = darwin64_struct_floats_to_mem (p, item_base, fprs, nf);
- break;
- case FFI_TYPE_LONGDOUBLE:
- if (*nf < NUM_FPR_ARG_REGISTERS)
- {
- *(double *)item_base = *fprs++ ;
- (*nf) += 1;
- }
- item_base += 8;
- /* FALL THROUGH */
- case FFI_TYPE_DOUBLE:
- if (*nf < NUM_FPR_ARG_REGISTERS)
- {
- *(double *)item_base = *fprs++ ;
- (*nf) += 1;
- }
- break;
- case FFI_TYPE_FLOAT:
- if (*nf < NUM_FPR_ARG_REGISTERS)
- {
- *(float *)item_base = (float) *fprs++ ;
- (*nf) += 1;
- }
- break;
- default:
- break;
- }
- /* now count the size of what we just used. */
- struct_offset += p->size;
- }
- return fprs;
-}
-
-#endif
-
-/* Adjust the size of S to be correct for Darwin.
- On Darwin m32, the first field of a structure has natural alignment.
- On Darwin m64, all fields have natural alignment. */
-
-static void
-darwin_adjust_aggregate_sizes (ffi_type *s)
-{
- int i;
-
- if (s->type != FFI_TYPE_STRUCT)
- return;
-
- s->size = 0;
- for (i = 0; s->elements[i] != NULL; i++)
- {
- ffi_type *p;
- int align;
-
- p = s->elements[i];
- if (p->type == FFI_TYPE_STRUCT)
- darwin_adjust_aggregate_sizes (p);
-#if defined(POWERPC_DARWIN64)
- /* Natural alignment for all items. */
- align = p->alignment;
-#else
- /* Natural alignment for the first item... */
- if (i == 0)
- align = p->alignment;
- else if (p->alignment == 16 || p->alignment < 4)
- /* .. subsequent items with vector or align < 4 have natural align. */
- align = p->alignment;
- else
- /* .. or align is 4. */
- align = 4;
-#endif
- /* Pad, if necessary, before adding the current item. */
- s->size = ALIGN(s->size, align) + p->size;
- }
-
- s->size = ALIGN(s->size, s->alignment);
-
- /* This should not be necessary on m64, but harmless. */
- if (s->elements[0]->type == FFI_TYPE_UINT64
- || s->elements[0]->type == FFI_TYPE_SINT64
- || s->elements[0]->type == FFI_TYPE_DOUBLE
- || s->elements[0]->alignment == 8)
- s->alignment = s->alignment > 8 ? s->alignment : 8;
- /* Do not add additional tail padding. */
-}
-
-/* Adjust the size of S to be correct for AIX.
- Word-align double unless it is the first member of a structure. */
-
-static void
-aix_adjust_aggregate_sizes (ffi_type *s)
-{
- int i;
-
- if (s->type != FFI_TYPE_STRUCT)
- return;
-
- s->size = 0;
- for (i = 0; s->elements[i] != NULL; i++)
- {
- ffi_type *p;
- int align;
-
- p = s->elements[i];
- aix_adjust_aggregate_sizes (p);
- align = p->alignment;
- if (i != 0 && p->type == FFI_TYPE_DOUBLE)
- align = 4;
- s->size = ALIGN(s->size, align) + p->size;
- }
-
- s->size = ALIGN(s->size, s->alignment);
-
- if (s->elements[0]->type == FFI_TYPE_UINT64
- || s->elements[0]->type == FFI_TYPE_SINT64
- || s->elements[0]->type == FFI_TYPE_DOUBLE
- || s->elements[0]->alignment == 8)
- s->alignment = s->alignment > 8 ? s->alignment : 8;
- /* Do not add additional tail padding. */
-}
-
-/* Perform machine dependent cif processing. */
-ffi_status
-ffi_prep_cif_machdep (ffi_cif *cif)
-{
- /* All this is for the DARWIN ABI. */
- unsigned i;
- ffi_type **ptr;
- unsigned bytes;
- unsigned fparg_count = 0, intarg_count = 0;
- unsigned flags = 0;
- unsigned size_al = 0;
-
- /* All the machine-independent calculation of cif->bytes will be wrong.
- All the calculation of structure sizes will also be wrong.
- Redo the calculation for DARWIN. */
-
- if (cif->abi == FFI_DARWIN)
- {
- darwin_adjust_aggregate_sizes (cif->rtype);
- for (i = 0; i < cif->nargs; i++)
- darwin_adjust_aggregate_sizes (cif->arg_types[i]);
- }
-
- if (cif->abi == FFI_AIX)
- {
- aix_adjust_aggregate_sizes (cif->rtype);
- for (i = 0; i < cif->nargs; i++)
- aix_adjust_aggregate_sizes (cif->arg_types[i]);
- }
-
- /* Space for the frame pointer, callee's LR, CR, etc, and for
- the asm's temp regs. */
-
- bytes = (LINKAGE_AREA_GPRS + ASM_NEEDS_REGISTERS) * sizeof(unsigned long);
-
- /* Return value handling.
- The rules m32 are as follows:
- - 32-bit (or less) integer values are returned in gpr3;
- - structures of size <= 4 bytes also returned in gpr3;
- - 64-bit integer values [??? and structures between 5 and 8 bytes] are
- returned in gpr3 and gpr4;
- - Single/double FP values are returned in fpr1;
- - Long double FP (if not equivalent to double) values are returned in
- fpr1 and fpr2;
- m64:
- - 64-bit or smaller integral values are returned in GPR3
- - Single/double FP values are returned in fpr1;
- - Long double FP values are returned in fpr1 and fpr2;
- m64 Structures:
- - If the structure could be accommodated in registers were it to be the
- first argument to a routine, then it is returned in those registers.
- m32/m64 structures otherwise:
- - Larger structures values are allocated space and a pointer is passed
- as the first argument. */
- switch (cif->rtype->type)
- {
-
-#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE
- case FFI_TYPE_LONGDOUBLE:
- flags |= FLAG_RETURNS_128BITS;
- flags |= FLAG_RETURNS_FP;
- break;
-#endif
-
- case FFI_TYPE_DOUBLE:
- flags |= FLAG_RETURNS_64BITS;
- /* Fall through. */
- case FFI_TYPE_FLOAT:
- flags |= FLAG_RETURNS_FP;
- break;
-
- case FFI_TYPE_UINT64:
- case FFI_TYPE_SINT64:
-#ifdef POWERPC64
- case FFI_TYPE_POINTER:
-#endif
- flags |= FLAG_RETURNS_64BITS;
- break;
-
- case FFI_TYPE_STRUCT:
-#if defined(POWERPC_DARWIN64)
- {
- /* Can we fit the struct into regs? */
- if (darwin64_struct_ret_by_value_p (cif->rtype))
- {
- unsigned nfpr = 0;
- flags |= FLAG_RETURNS_STRUCT;
- if (cif->rtype->size != 16)
- darwin64_scan_struct_for_floats (cif->rtype, &nfpr) ;
- else
- flags |= FLAG_RETURNS_128BITS;
- /* Will be 0 for 16byte struct. */
- if (nfpr)
- flags |= FLAG_RETURNS_FP;
- }
- else /* By ref. */
- {
- flags |= FLAG_RETVAL_REFERENCE;
- flags |= FLAG_RETURNS_NOTHING;
- intarg_count++;
- }
- }
-#elif defined(DARWIN_PPC)
- if (cif->rtype->size <= 4)
- flags |= FLAG_RETURNS_STRUCT;
- else /* else by reference. */
- {
- flags |= FLAG_RETVAL_REFERENCE;
- flags |= FLAG_RETURNS_NOTHING;
- intarg_count++;
- }
-#else /* assume we pass by ref. */
- flags |= FLAG_RETVAL_REFERENCE;
- flags |= FLAG_RETURNS_NOTHING;
- intarg_count++;
-#endif
- break;
- case FFI_TYPE_VOID:
- flags |= FLAG_RETURNS_NOTHING;
- break;
-
- default:
- /* Returns 32-bit integer, or similar. Nothing to do here. */
- break;
- }
-
- /* The first NUM_GPR_ARG_REGISTERS words of integer arguments, and the
- first NUM_FPR_ARG_REGISTERS fp arguments, go in registers; the rest
- goes on the stack.
- ??? Structures are passed as a pointer to a copy of the structure.
- Stuff on the stack needs to keep proper alignment.
- For m64 the count is effectively of half-GPRs. */
- for (ptr = cif->arg_types, i = cif->nargs; i > 0; i--, ptr++)
- {
- unsigned align_words;
- switch ((*ptr)->type)
- {
- case FFI_TYPE_FLOAT:
- case FFI_TYPE_DOUBLE:
- fparg_count++;
-#if !defined(POWERPC_DARWIN64)
- /* If this FP arg is going on the stack, it must be
- 8-byte-aligned. */
- if (fparg_count > NUM_FPR_ARG_REGISTERS
- && (intarg_count & 0x01) != 0)
- intarg_count++;
-#endif
- break;
-
-#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE
- case FFI_TYPE_LONGDOUBLE:
- fparg_count += 2;
- /* If this FP arg is going on the stack, it must be
- 16-byte-aligned. */
- if (fparg_count >= NUM_FPR_ARG_REGISTERS)
-#if defined (POWERPC64)
- intarg_count = ALIGN(intarg_count, 2);
-#else
- intarg_count = ALIGN(intarg_count, 4);
-#endif
- break;
-#endif
-
- case FFI_TYPE_UINT64:
- case FFI_TYPE_SINT64:
-#if defined(POWERPC64)
- intarg_count++;
-#else
- /* 'long long' arguments are passed as two words, but
- either both words must fit in registers or both go
- on the stack. If they go on the stack, they must
- be 8-byte-aligned. */
- if (intarg_count == NUM_GPR_ARG_REGISTERS-1
- || (intarg_count >= NUM_GPR_ARG_REGISTERS
- && (intarg_count & 0x01) != 0))
- intarg_count++;
- intarg_count += 2;
-#endif
- break;
-
- case FFI_TYPE_STRUCT:
- size_al = (*ptr)->size;
-#if defined(POWERPC_DARWIN64)
- align_words = (*ptr)->alignment >> 3;
- if (align_words)
- intarg_count = ALIGN(intarg_count, align_words);
- /* Base size of the struct. */
- intarg_count += (size_al + 7) / 8;
- /* If 16 bytes then don't worry about floats. */
- if (size_al != 16)
- /* Scan through for floats to be placed in regs. */
- darwin64_scan_struct_for_floats (*ptr, &fparg_count) ;
-#else
- align_words = (*ptr)->alignment >> 2;
- if (align_words)
- intarg_count = ALIGN(intarg_count, align_words);
- /* If the first member of the struct is a double, then align
- the struct to double-word.
- if ((*ptr)->elements[0]->type == FFI_TYPE_DOUBLE)
- size_al = ALIGN((*ptr)->size, 8); */
-# ifdef POWERPC64
- intarg_count += (size_al + 7) / 8;
-# else
- intarg_count += (size_al + 3) / 4;
-# endif
-#endif
- break;
-
- default:
- /* Everything else is passed as a 4-byte word in a GPR, either
- the object itself or a pointer to it. */
- intarg_count++;
- break;
- }
- }
-
- if (fparg_count != 0)
- flags |= FLAG_FP_ARGUMENTS;
-
-#if defined(POWERPC_DARWIN64)
- /* Space to image the FPR registers, if needed - which includes when they might be
- used in a struct return. */
- if (fparg_count != 0
- || ((flags & FLAG_RETURNS_STRUCT)
- && (flags & FLAG_RETURNS_FP)))
- bytes += NUM_FPR_ARG_REGISTERS * sizeof(double);
-#else
- /* Space for the FPR registers, if needed. */
- if (fparg_count != 0)
- bytes += NUM_FPR_ARG_REGISTERS * sizeof(double);
-#endif
-
- /* Stack space. */
-#ifdef POWERPC64
- if ((intarg_count + fparg_count) > NUM_GPR_ARG_REGISTERS)
- bytes += (intarg_count + fparg_count) * sizeof(long);
-#else
- if ((intarg_count + 2 * fparg_count) > NUM_GPR_ARG_REGISTERS)
- bytes += (intarg_count + 2 * fparg_count) * sizeof(long);
-#endif
- else
- bytes += NUM_GPR_ARG_REGISTERS * sizeof(long);
-
- /* The stack space allocated needs to be a multiple of 16 bytes. */
- bytes = ALIGN(bytes, 16) ;
-
- cif->flags = flags;
- cif->bytes = bytes;
-
- return FFI_OK;
-}
-
-extern void ffi_call_AIX(extended_cif *, long, unsigned, unsigned *,
- void (*fn)(void), void (*fn2)(void));
-
-extern void ffi_call_DARWIN(extended_cif *, long, unsigned, unsigned *,
- void (*fn)(void), void (*fn2)(void), ffi_type*);
-
-void
-ffi_call (ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue)
-{
- extended_cif ecif;
-
- ecif.cif = cif;
- ecif.avalue = avalue;
-
- /* If the return value is a struct and we don't have a return
- value address then we need to make one. */
-
- if ((rvalue == NULL) &&
- (cif->rtype->type == FFI_TYPE_STRUCT))
- {
- ecif.rvalue = alloca (cif->rtype->size);
- }
- else
- ecif.rvalue = rvalue;
-
- switch (cif->abi)
- {
- case FFI_AIX:
- ffi_call_AIX(&ecif, -(long)cif->bytes, cif->flags, ecif.rvalue, fn,
- FFI_FN(ffi_prep_args));
- break;
- case FFI_DARWIN:
- ffi_call_DARWIN(&ecif, -(long)cif->bytes, cif->flags, ecif.rvalue, fn,
- FFI_FN(ffi_prep_args), cif->rtype);
- break;
- default:
- FFI_ASSERT(0);
- break;
- }
-}
-
-static void flush_icache(char *);
-static void flush_range(char *, int);
-
-/* The layout of a function descriptor. A C function pointer really
- points to one of these. */
-
-typedef struct aix_fd_struct {
- void *code_pointer;
- void *toc;
-} aix_fd;
-
-/* here I'd like to add the stack frame layout we use in darwin_closure.S
- and aix_closure.S
-
- m32/m64
-
- The stack layout looks like this:
-
- | Additional params... | | Higher address
- ~ ~ ~
- | Parameters (at least 8*4/8=32/64) | | NUM_GPR_ARG_REGISTERS
- |--------------------------------------------| |
- | TOC=R2 (AIX) Reserved (Darwin) 4/8 | |
- |--------------------------------------------| |
- | Reserved 2*4/8 | |
- |--------------------------------------------| |
- | Space for callee's LR 4/8 | |
- |--------------------------------------------| |
- | Saved CR [low word for m64] 4/8 | |
- |--------------------------------------------| |
- | Current backchain pointer 4/8 |-/ Parent's frame.
- |--------------------------------------------| <+ <<< on entry to ffi_closure_ASM
- | Result Bytes 16 | |
- |--------------------------------------------| |
- ~ padding to 16-byte alignment ~ ~
- |--------------------------------------------| |
- | NUM_FPR_ARG_REGISTERS slots | |
- | here fp13 .. fp1 13*8 | |
- |--------------------------------------------| |
- | R3..R10 8*4/8=32/64 | | NUM_GPR_ARG_REGISTERS
- |--------------------------------------------| |
- | TOC=R2 (AIX) Reserved (Darwin) 4/8 | |
- |--------------------------------------------| | stack |
- | Reserved [compiler,binder] 2*4/8 | | grows |
- |--------------------------------------------| | down V
- | Space for callee's LR 4/8 | |
- |--------------------------------------------| | lower addresses
- | Saved CR [low word for m64] 4/8 | |
- |--------------------------------------------| | stack pointer here
- | Current backchain pointer 4/8 |-/ during
- |--------------------------------------------| <<< ffi_closure_ASM.
-
-*/
-
-ffi_status
-ffi_prep_closure_loc (ffi_closure* closure,
- ffi_cif* cif,
- void (*fun)(ffi_cif*, void*, void**, void*),
- void *user_data,
- void *codeloc)
-{
- unsigned int *tramp;
- struct ffi_aix_trampoline_struct *tramp_aix;
- aix_fd *fd;
-
- switch (cif->abi)
- {
- case FFI_DARWIN:
-
- FFI_ASSERT (cif->abi == FFI_DARWIN);
-
- tramp = (unsigned int *) &closure->tramp[0];
-#if defined(POWERPC_DARWIN64)
- tramp[0] = 0x7c0802a6; /* mflr r0 */
- tramp[1] = 0x429f0015; /* bcl- 20,4*cr7+so, +0x18 (L1) */
- /* We put the addresses here. */
- tramp[6] = 0x7d6802a6; /*L1: mflr r11 */
- tramp[7] = 0xe98b0000; /* ld r12,0(r11) function address */
- tramp[8] = 0x7c0803a6; /* mtlr r0 */
- tramp[9] = 0x7d8903a6; /* mtctr r12 */
- tramp[10] = 0xe96b0008; /* lwz r11,8(r11) static chain */
- tramp[11] = 0x4e800420; /* bctr */
-
- *((unsigned long *)&tramp[2]) = (unsigned long) ffi_closure_ASM; /* function */
- *((unsigned long *)&tramp[4]) = (unsigned long) codeloc; /* context */
-#else
- tramp[0] = 0x7c0802a6; /* mflr r0 */
- tramp[1] = 0x429f000d; /* bcl- 20,4*cr7+so,0x10 */
- tramp[4] = 0x7d6802a6; /* mflr r11 */
- tramp[5] = 0x818b0000; /* lwz r12,0(r11) function address */
- tramp[6] = 0x7c0803a6; /* mtlr r0 */
- tramp[7] = 0x7d8903a6; /* mtctr r12 */
- tramp[8] = 0x816b0004; /* lwz r11,4(r11) static chain */
- tramp[9] = 0x4e800420; /* bctr */
- tramp[2] = (unsigned long) ffi_closure_ASM; /* function */
- tramp[3] = (unsigned long) codeloc; /* context */
-#endif
- closure->cif = cif;
- closure->fun = fun;
- closure->user_data = user_data;
-
- /* Flush the icache. Only necessary on Darwin. */
- flush_range(codeloc, FFI_TRAMPOLINE_SIZE);
-
- break;
-
- case FFI_AIX:
-
- tramp_aix = (struct ffi_aix_trampoline_struct *) (closure->tramp);
- fd = (aix_fd *)(void *)ffi_closure_ASM;
-
- FFI_ASSERT (cif->abi == FFI_AIX);
-
- tramp_aix->code_pointer = fd->code_pointer;
- tramp_aix->toc = fd->toc;
- tramp_aix->static_chain = codeloc;
- closure->cif = cif;
- closure->fun = fun;
- closure->user_data = user_data;
- break;
-
- default:
- return FFI_BAD_ABI;
- break;
- }
- return FFI_OK;
-}
-
-static void
-flush_icache(char *addr)
-{
-#ifndef _AIX
- __asm__ volatile (
- "dcbf 0,%0\n"
- "\tsync\n"
- "\ticbi 0,%0\n"
- "\tsync\n"
- "\tisync"
- : : "r"(addr) : "memory");
-#endif
-}
-
-static void
-flush_range(char * addr1, int size)
-{
-#define MIN_LINE_SIZE 32
- int i;
- for (i = 0; i < size; i += MIN_LINE_SIZE)
- flush_icache(addr1+i);
- flush_icache(addr1+size-1);
-}
-
-typedef union
-{
- float f;
- double d;
-} ffi_dblfl;
-
-ffi_type *
-ffi_closure_helper_DARWIN (ffi_closure *, void *,
- unsigned long *, ffi_dblfl *);
-
-/* Basically the trampoline invokes ffi_closure_ASM, and on
- entry, r11 holds the address of the closure.
- After storing the registers that could possibly contain
- parameters to be passed into the stack frame and setting
- up space for a return value, ffi_closure_ASM invokes the
- following helper function to do most of the work. */
-
-ffi_type *
-ffi_closure_helper_DARWIN (ffi_closure *closure, void *rvalue,
- unsigned long *pgr, ffi_dblfl *pfr)
-{
- /* rvalue is the pointer to space for return value in closure assembly
- pgr is the pointer to where r3-r10 are stored in ffi_closure_ASM
- pfr is the pointer to where f1-f13 are stored in ffi_closure_ASM. */
-
- typedef double ldbits[2];
-
- union ldu
- {
- ldbits lb;
- long double ld;
- };
-
- void ** avalue;
- ffi_type ** arg_types;
- long i, avn;
- ffi_cif * cif;
- ffi_dblfl * end_pfr = pfr + NUM_FPR_ARG_REGISTERS;
- unsigned size_al;
-#if defined(POWERPC_DARWIN64)
- unsigned fpsused = 0;
-#endif
-
- cif = closure->cif;
- avalue = alloca (cif->nargs * sizeof(void *));
-
- if (cif->rtype->type == FFI_TYPE_STRUCT)
- {
-#if defined(POWERPC_DARWIN64)
- if (!darwin64_struct_ret_by_value_p (cif->rtype))
- {
- /* Won't fit into the regs - return by ref. */
- rvalue = (void *) *pgr;
- pgr++;
- }
-#elif defined(DARWIN_PPC)
- if (cif->rtype->size > 4)
- {
- rvalue = (void *) *pgr;
- pgr++;
- }
-#else /* assume we return by ref. */
- rvalue = (void *) *pgr;
- pgr++;
-#endif
- }
-
- i = 0;
- avn = cif->nargs;
- arg_types = cif->arg_types;
-
- /* Grab the addresses of the arguments from the stack frame. */
- while (i < avn)
- {
- switch (arg_types[i]->type)
- {
- case FFI_TYPE_SINT8:
- case FFI_TYPE_UINT8:
-#if defined(POWERPC64)
- avalue[i] = (char *) pgr + 7;
-#else
- avalue[i] = (char *) pgr + 3;
-#endif
- pgr++;
- break;
-
- case FFI_TYPE_SINT16:
- case FFI_TYPE_UINT16:
-#if defined(POWERPC64)
- avalue[i] = (char *) pgr + 6;
-#else
- avalue[i] = (char *) pgr + 2;
-#endif
- pgr++;
- break;
-
- case FFI_TYPE_SINT32:
- case FFI_TYPE_UINT32:
-#if defined(POWERPC64)
- avalue[i] = (char *) pgr + 4;
-#else
- case FFI_TYPE_POINTER:
- avalue[i] = pgr;
-#endif
- pgr++;
- break;
-
- case FFI_TYPE_STRUCT:
- size_al = arg_types[i]->size;
-#if defined(POWERPC_DARWIN64)
- pgr = (unsigned long *)ALIGN((char *)pgr, arg_types[i]->alignment);
- if (size_al < 3 || size_al == 4)
- {
- avalue[i] = ((char *)pgr)+8-size_al;
- if (arg_types[i]->elements[0]->type == FFI_TYPE_FLOAT
- && fpsused < NUM_FPR_ARG_REGISTERS)
- {
- *(float *)pgr = (float) *(double *)pfr;
- pfr++;
- fpsused++;
- }
- }
- else
- {
- if (size_al != 16)
- pfr = (ffi_dblfl *)
- darwin64_struct_floats_to_mem (arg_types[i], (char *)pgr,
- (double *)pfr, &fpsused);
- avalue[i] = pgr;
- }
- pgr += (size_al + 7) / 8;
-#else
- /* If the first member of the struct is a double, then align
- the struct to double-word. */
- if (arg_types[i]->elements[0]->type == FFI_TYPE_DOUBLE)
- size_al = ALIGN(arg_types[i]->size, 8);
-# if defined(POWERPC64)
- FFI_ASSERT (cif->abi != FFI_DARWIN);
- avalue[i] = pgr;
- pgr += (size_al + 7) / 8;
-# else
- /* Structures that match the basic modes (QI 1 byte, HI 2 bytes,
- SI 4 bytes) are aligned as if they were those modes. */
- if (size_al < 3 && cif->abi == FFI_DARWIN)
- avalue[i] = (char*) pgr + 4 - size_al;
- else
- avalue[i] = pgr;
- pgr += (size_al + 3) / 4;
-# endif
-#endif
- break;
-
- case FFI_TYPE_SINT64:
- case FFI_TYPE_UINT64:
-#if defined(POWERPC64)
- case FFI_TYPE_POINTER:
- avalue[i] = pgr;
- pgr++;
- break;
-#else
- /* Long long ints are passed in two gpr's. */
- avalue[i] = pgr;
- pgr += 2;
- break;
-#endif
-
- case FFI_TYPE_FLOAT:
- /* A float value consumes a GPR.
- There are 13 64bit floating point registers. */
- if (pfr < end_pfr)
- {
- double temp = pfr->d;
- pfr->f = (float) temp;
- avalue[i] = pfr;
- pfr++;
- }
- else
- {
- avalue[i] = pgr;
- }
- pgr++;
- break;
-
- case FFI_TYPE_DOUBLE:
- /* A double value consumes two GPRs.
- There are 13 64bit floating point registers. */
- if (pfr < end_pfr)
- {
- avalue[i] = pfr;
- pfr++;
- }
- else
- {
- avalue[i] = pgr;
- }
-#ifdef POWERPC64
- pgr++;
-#else
- pgr += 2;
-#endif
- break;
-
-#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE
-
- case FFI_TYPE_LONGDOUBLE:
-#ifdef POWERPC64
- if (pfr + 1 < end_pfr)
- {
- avalue[i] = pfr;
- pfr += 2;
- }
- else
- {
- if (pfr < end_pfr)
- {
- *pgr = *(unsigned long *) pfr;
- pfr++;
- }
- avalue[i] = pgr;
- }
- pgr += 2;
-#else /* POWERPC64 */
- /* A long double value consumes four GPRs and two FPRs.
- There are 13 64bit floating point registers. */
- if (pfr + 1 < end_pfr)
- {
- avalue[i] = pfr;
- pfr += 2;
- }
- /* Here we have the situation where one part of the long double
- is stored in fpr13 and the other part is already on the stack.
- We use a union to pass the long double to avalue[i]. */
- else if (pfr + 1 == end_pfr)
- {
- union ldu temp_ld;
- memcpy (&temp_ld.lb[0], pfr, sizeof(ldbits));
- memcpy (&temp_ld.lb[1], pgr + 2, sizeof(ldbits));
- avalue[i] = &temp_ld.ld;
- pfr++;
- }
- else
- {
- avalue[i] = pgr;
- }
- pgr += 4;
-#endif /* POWERPC64 */
- break;
-#endif
- default:
- FFI_ASSERT(0);
- }
- i++;
- }
-
- (closure->fun) (cif, rvalue, avalue, closure->user_data);
-
- /* Tell ffi_closure_ASM to perform return type promotions. */
- return cif->rtype;
-}
diff --git a/Modules/_ctypes/libffi/src/powerpc/ffi_linux64.c b/Modules/_ctypes/libffi/src/powerpc/ffi_linux64.c
deleted file mode 100644
index b087af8c60..0000000000
--- a/Modules/_ctypes/libffi/src/powerpc/ffi_linux64.c
+++ /dev/null
@@ -1,943 +0,0 @@
-/* -----------------------------------------------------------------------
- ffi_linux64.c - Copyright (C) 2013 IBM
- Copyright (C) 2011 Anthony Green
- Copyright (C) 2011 Kyle Moffett
- Copyright (C) 2008 Red Hat, Inc
- Copyright (C) 2007, 2008 Free Software Foundation, Inc
- Copyright (c) 1998 Geoffrey Keating
-
- PowerPC Foreign Function Interface
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- ``Software''), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to
- permit persons to whom the Software is furnished to do so, subject to
- the following conditions:
-
- The above copyright notice and this permission notice shall be included
- in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS
- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR
- OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- OTHER DEALINGS IN THE SOFTWARE.
- ----------------------------------------------------------------------- */
-
-#include "ffi.h"
-
-#ifdef POWERPC64
-#include "ffi_common.h"
-#include "ffi_powerpc.h"
-
-
-/* About the LINUX64 ABI. */
-enum {
- NUM_GPR_ARG_REGISTERS64 = 8,
- NUM_FPR_ARG_REGISTERS64 = 13
-};
-enum { ASM_NEEDS_REGISTERS64 = 4 };
-
-
-#if HAVE_LONG_DOUBLE_VARIANT && FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE
-/* Adjust size of ffi_type_longdouble. */
-void FFI_HIDDEN
-ffi_prep_types_linux64 (ffi_abi abi)
-{
- if ((abi & (FFI_LINUX | FFI_LINUX_LONG_DOUBLE_128)) == FFI_LINUX)
- {
- ffi_type_longdouble.size = 8;
- ffi_type_longdouble.alignment = 8;
- }
- else
- {
- ffi_type_longdouble.size = 16;
- ffi_type_longdouble.alignment = 16;
- }
-}
-#endif
-
-
-#if _CALL_ELF == 2
-static unsigned int
-discover_homogeneous_aggregate (const ffi_type *t, unsigned int *elnum)
-{
- switch (t->type)
- {
- case FFI_TYPE_FLOAT:
- case FFI_TYPE_DOUBLE:
- *elnum = 1;
- return (int) t->type;
-
- case FFI_TYPE_STRUCT:;
- {
- unsigned int base_elt = 0, total_elnum = 0;
- ffi_type **el = t->elements;
- while (*el)
- {
- unsigned int el_elt, el_elnum = 0;
- el_elt = discover_homogeneous_aggregate (*el, &el_elnum);
- if (el_elt == 0
- || (base_elt && base_elt != el_elt))
- return 0;
- base_elt = el_elt;
- total_elnum += el_elnum;
- if (total_elnum > 8)
- return 0;
- el++;
- }
- *elnum = total_elnum;
- return base_elt;
- }
-
- default:
- return 0;
- }
-}
-#endif
-
-
-/* Perform machine dependent cif processing */
-static ffi_status
-ffi_prep_cif_linux64_core (ffi_cif *cif)
-{
- ffi_type **ptr;
- unsigned bytes;
- unsigned i, fparg_count = 0, intarg_count = 0;
- unsigned flags = cif->flags;
-#if _CALL_ELF == 2
- unsigned int elt, elnum;
-#endif
-
-#if FFI_TYPE_LONGDOUBLE == FFI_TYPE_DOUBLE
- /* If compiled without long double support.. */
- if ((cif->abi & FFI_LINUX_LONG_DOUBLE_128) != 0)
- return FFI_BAD_ABI;
-#endif
-
- /* The machine-independent calculation of cif->bytes doesn't work
- for us. Redo the calculation. */
-#if _CALL_ELF == 2
- /* Space for backchain, CR, LR, TOC and the asm's temp regs. */
- bytes = (4 + ASM_NEEDS_REGISTERS64) * sizeof (long);
-
- /* Space for the general registers. */
- bytes += NUM_GPR_ARG_REGISTERS64 * sizeof (long);
-#else
- /* Space for backchain, CR, LR, cc/ld doubleword, TOC and the asm's temp
- regs. */
- bytes = (6 + ASM_NEEDS_REGISTERS64) * sizeof (long);
-
- /* Space for the mandatory parm save area and general registers. */
- bytes += 2 * NUM_GPR_ARG_REGISTERS64 * sizeof (long);
-#endif
-
- /* Return value handling. */
- switch (cif->rtype->type)
- {
-#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE
- case FFI_TYPE_LONGDOUBLE:
- if ((cif->abi & FFI_LINUX_LONG_DOUBLE_128) != 0)
- flags |= FLAG_RETURNS_128BITS;
- /* Fall through. */
-#endif
- case FFI_TYPE_DOUBLE:
- flags |= FLAG_RETURNS_64BITS;
- /* Fall through. */
- case FFI_TYPE_FLOAT:
- flags |= FLAG_RETURNS_FP;
- break;
-
- case FFI_TYPE_UINT128:
- flags |= FLAG_RETURNS_128BITS;
- /* Fall through. */
- case FFI_TYPE_UINT64:
- case FFI_TYPE_SINT64:
- flags |= FLAG_RETURNS_64BITS;
- break;
-
- case FFI_TYPE_STRUCT:
-#if _CALL_ELF == 2
- elt = discover_homogeneous_aggregate (cif->rtype, &elnum);
- if (elt)
- {
- if (elt == FFI_TYPE_DOUBLE)
- flags |= FLAG_RETURNS_64BITS;
- flags |= FLAG_RETURNS_FP | FLAG_RETURNS_SMST;
- break;
- }
- if (cif->rtype->size <= 16)
- {
- flags |= FLAG_RETURNS_SMST;
- break;
- }
-#endif
- intarg_count++;
- flags |= FLAG_RETVAL_REFERENCE;
- /* Fall through. */
- case FFI_TYPE_VOID:
- flags |= FLAG_RETURNS_NOTHING;
- break;
-
- default:
- /* Returns 32-bit integer, or similar. Nothing to do here. */
- break;
- }
-
- for (ptr = cif->arg_types, i = cif->nargs; i > 0; i--, ptr++)
- {
- unsigned int align;
-
- switch ((*ptr)->type)
- {
-#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE
- case FFI_TYPE_LONGDOUBLE:
- if ((cif->abi & FFI_LINUX_LONG_DOUBLE_128) != 0)
- {
- fparg_count++;
- intarg_count++;
- }
- /* Fall through. */
-#endif
- case FFI_TYPE_DOUBLE:
- case FFI_TYPE_FLOAT:
- fparg_count++;
- intarg_count++;
- if (fparg_count > NUM_FPR_ARG_REGISTERS64)
- flags |= FLAG_ARG_NEEDS_PSAVE;
- break;
-
- case FFI_TYPE_STRUCT:
- if ((cif->abi & FFI_LINUX_STRUCT_ALIGN) != 0)
- {
- align = (*ptr)->alignment;
- if (align > 16)
- align = 16;
- align = align / 8;
- if (align > 1)
- intarg_count = ALIGN (intarg_count, align);
- }
- intarg_count += ((*ptr)->size + 7) / 8;
-#if _CALL_ELF == 2
- elt = discover_homogeneous_aggregate (*ptr, &elnum);
- if (elt)
- {
- fparg_count += elnum;
- if (fparg_count > NUM_FPR_ARG_REGISTERS64)
- flags |= FLAG_ARG_NEEDS_PSAVE;
- }
- else
-#endif
- {
- if (intarg_count > NUM_GPR_ARG_REGISTERS64)
- flags |= FLAG_ARG_NEEDS_PSAVE;
- }
- break;
-
- case FFI_TYPE_POINTER:
- case FFI_TYPE_UINT64:
- case FFI_TYPE_SINT64:
- case FFI_TYPE_INT:
- case FFI_TYPE_UINT32:
- case FFI_TYPE_SINT32:
- case FFI_TYPE_UINT16:
- case FFI_TYPE_SINT16:
- case FFI_TYPE_UINT8:
- case FFI_TYPE_SINT8:
- /* Everything else is passed as a 8-byte word in a GPR, either
- the object itself or a pointer to it. */
- intarg_count++;
- if (intarg_count > NUM_GPR_ARG_REGISTERS64)
- flags |= FLAG_ARG_NEEDS_PSAVE;
- break;
- default:
- FFI_ASSERT (0);
- }
- }
-
- if (fparg_count != 0)
- flags |= FLAG_FP_ARGUMENTS;
- if (intarg_count > 4)
- flags |= FLAG_4_GPR_ARGUMENTS;
-
- /* Space for the FPR registers, if needed. */
- if (fparg_count != 0)
- bytes += NUM_FPR_ARG_REGISTERS64 * sizeof (double);
-
- /* Stack space. */
-#if _CALL_ELF == 2
- if ((flags & FLAG_ARG_NEEDS_PSAVE) != 0)
- bytes += intarg_count * sizeof (long);
-#else
- if (intarg_count > NUM_GPR_ARG_REGISTERS64)
- bytes += (intarg_count - NUM_GPR_ARG_REGISTERS64) * sizeof (long);
-#endif
-
- /* The stack space allocated needs to be a multiple of 16 bytes. */
- bytes = (bytes + 15) & ~0xF;
-
- cif->flags = flags;
- cif->bytes = bytes;
-
- return FFI_OK;
-}
-
-ffi_status FFI_HIDDEN
-ffi_prep_cif_linux64 (ffi_cif *cif)
-{
- if ((cif->abi & FFI_LINUX) != 0)
- cif->nfixedargs = cif->nargs;
-#if _CALL_ELF != 2
- else if (cif->abi == FFI_COMPAT_LINUX64)
- {
- /* This call is from old code. Don't touch cif->nfixedargs
- since old code will be using a smaller cif. */
- cif->flags |= FLAG_COMPAT;
- /* Translate to new abi value. */
- cif->abi = FFI_LINUX | FFI_LINUX_LONG_DOUBLE_128;
- }
-#endif
- else
- return FFI_BAD_ABI;
- return ffi_prep_cif_linux64_core (cif);
-}
-
-ffi_status FFI_HIDDEN
-ffi_prep_cif_linux64_var (ffi_cif *cif,
- unsigned int nfixedargs,
- unsigned int ntotalargs MAYBE_UNUSED)
-{
- if ((cif->abi & FFI_LINUX) != 0)
- cif->nfixedargs = nfixedargs;
-#if _CALL_ELF != 2
- else if (cif->abi == FFI_COMPAT_LINUX64)
- {
- /* This call is from old code. Don't touch cif->nfixedargs
- since old code will be using a smaller cif. */
- cif->flags |= FLAG_COMPAT;
- /* Translate to new abi value. */
- cif->abi = FFI_LINUX | FFI_LINUX_LONG_DOUBLE_128;
- }
-#endif
- else
- return FFI_BAD_ABI;
-#if _CALL_ELF == 2
- cif->flags |= FLAG_ARG_NEEDS_PSAVE;
-#endif
- return ffi_prep_cif_linux64_core (cif);
-}
-
-
-/* ffi_prep_args64 is called by the assembly routine once stack space
- has been allocated for the function's arguments.
-
- The stack layout we want looks like this:
-
- | Ret addr from ffi_call_LINUX64 8bytes | higher addresses
- |--------------------------------------------|
- | CR save area 8bytes |
- |--------------------------------------------|
- | Previous backchain pointer 8 | stack pointer here
- |--------------------------------------------|<+ <<< on entry to
- | Saved r28-r31 4*8 | | ffi_call_LINUX64
- |--------------------------------------------| |
- | GPR registers r3-r10 8*8 | |
- |--------------------------------------------| |
- | FPR registers f1-f13 (optional) 13*8 | |
- |--------------------------------------------| |
- | Parameter save area | |
- |--------------------------------------------| |
- | TOC save area 8 | |
- |--------------------------------------------| | stack |
- | Linker doubleword 8 | | grows |
- |--------------------------------------------| | down V
- | Compiler doubleword 8 | |
- |--------------------------------------------| | lower addresses
- | Space for callee's LR 8 | |
- |--------------------------------------------| |
- | CR save area 8 | |
- |--------------------------------------------| | stack pointer here
- | Current backchain pointer 8 |-/ during
- |--------------------------------------------| <<< ffi_call_LINUX64
-
-*/
-
-void FFI_HIDDEN
-ffi_prep_args64 (extended_cif *ecif, unsigned long *const stack)
-{
- const unsigned long bytes = ecif->cif->bytes;
- const unsigned long flags = ecif->cif->flags;
-
- typedef union
- {
- char *c;
- unsigned long *ul;
- float *f;
- double *d;
- size_t p;
- } valp;
-
- /* 'stacktop' points at the previous backchain pointer. */
- valp stacktop;
-
- /* 'next_arg' points at the space for gpr3, and grows upwards as
- we use GPR registers, then continues at rest. */
- valp gpr_base;
- valp gpr_end;
- valp rest;
- valp next_arg;
-
- /* 'fpr_base' points at the space for fpr3, and grows upwards as
- we use FPR registers. */
- valp fpr_base;
- unsigned int fparg_count;
-
- unsigned int i, words, nargs, nfixedargs;
- ffi_type **ptr;
- double double_tmp;
- union
- {
- void **v;
- char **c;
- signed char **sc;
- unsigned char **uc;
- signed short **ss;
- unsigned short **us;
- signed int **si;
- unsigned int **ui;
- unsigned long **ul;
- float **f;
- double **d;
- } p_argv;
- unsigned long gprvalue;
- unsigned long align;
-
- stacktop.c = (char *) stack + bytes;
- gpr_base.ul = stacktop.ul - ASM_NEEDS_REGISTERS64 - NUM_GPR_ARG_REGISTERS64;
- gpr_end.ul = gpr_base.ul + NUM_GPR_ARG_REGISTERS64;
-#if _CALL_ELF == 2
- rest.ul = stack + 4 + NUM_GPR_ARG_REGISTERS64;
-#else
- rest.ul = stack + 6 + NUM_GPR_ARG_REGISTERS64;
-#endif
- fpr_base.d = gpr_base.d - NUM_FPR_ARG_REGISTERS64;
- fparg_count = 0;
- next_arg.ul = gpr_base.ul;
-
- /* Check that everything starts aligned properly. */
- FFI_ASSERT (((unsigned long) (char *) stack & 0xF) == 0);
- FFI_ASSERT (((unsigned long) stacktop.c & 0xF) == 0);
- FFI_ASSERT ((bytes & 0xF) == 0);
-
- /* Deal with return values that are actually pass-by-reference. */
- if (flags & FLAG_RETVAL_REFERENCE)
- *next_arg.ul++ = (unsigned long) (char *) ecif->rvalue;
-
- /* Now for the arguments. */
- p_argv.v = ecif->avalue;
- nargs = ecif->cif->nargs;
-#if _CALL_ELF != 2
- nfixedargs = (unsigned) -1;
- if ((flags & FLAG_COMPAT) == 0)
-#endif
- nfixedargs = ecif->cif->nfixedargs;
- for (ptr = ecif->cif->arg_types, i = 0;
- i < nargs;
- i++, ptr++, p_argv.v++)
- {
-#if _CALL_ELF == 2
- unsigned int elt, elnum;
-#endif
-
- switch ((*ptr)->type)
- {
-#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE
- case FFI_TYPE_LONGDOUBLE:
- if ((ecif->cif->abi & FFI_LINUX_LONG_DOUBLE_128) != 0)
- {
- double_tmp = (*p_argv.d)[0];
- if (fparg_count < NUM_FPR_ARG_REGISTERS64 && i < nfixedargs)
- {
- *fpr_base.d++ = double_tmp;
-# if _CALL_ELF != 2
- if ((flags & FLAG_COMPAT) != 0)
- *next_arg.d = double_tmp;
-# endif
- }
- else
- *next_arg.d = double_tmp;
- if (++next_arg.ul == gpr_end.ul)
- next_arg.ul = rest.ul;
- fparg_count++;
- double_tmp = (*p_argv.d)[1];
- if (fparg_count < NUM_FPR_ARG_REGISTERS64 && i < nfixedargs)
- {
- *fpr_base.d++ = double_tmp;
-# if _CALL_ELF != 2
- if ((flags & FLAG_COMPAT) != 0)
- *next_arg.d = double_tmp;
-# endif
- }
- else
- *next_arg.d = double_tmp;
- if (++next_arg.ul == gpr_end.ul)
- next_arg.ul = rest.ul;
- fparg_count++;
- FFI_ASSERT (__LDBL_MANT_DIG__ == 106);
- FFI_ASSERT (flags & FLAG_FP_ARGUMENTS);
- break;
- }
- /* Fall through. */
-#endif
- case FFI_TYPE_DOUBLE:
- double_tmp = **p_argv.d;
- if (fparg_count < NUM_FPR_ARG_REGISTERS64 && i < nfixedargs)
- {
- *fpr_base.d++ = double_tmp;
-#if _CALL_ELF != 2
- if ((flags & FLAG_COMPAT) != 0)
- *next_arg.d = double_tmp;
-#endif
- }
- else
- *next_arg.d = double_tmp;
- if (++next_arg.ul == gpr_end.ul)
- next_arg.ul = rest.ul;
- fparg_count++;
- FFI_ASSERT (flags & FLAG_FP_ARGUMENTS);
- break;
-
- case FFI_TYPE_FLOAT:
- double_tmp = **p_argv.f;
- if (fparg_count < NUM_FPR_ARG_REGISTERS64 && i < nfixedargs)
- {
- *fpr_base.d++ = double_tmp;
-#if _CALL_ELF != 2
- if ((flags & FLAG_COMPAT) != 0)
- *next_arg.f = (float) double_tmp;
-#endif
- }
- else
- *next_arg.f = (float) double_tmp;
- if (++next_arg.ul == gpr_end.ul)
- next_arg.ul = rest.ul;
- fparg_count++;
- FFI_ASSERT (flags & FLAG_FP_ARGUMENTS);
- break;
-
- case FFI_TYPE_STRUCT:
- if ((ecif->cif->abi & FFI_LINUX_STRUCT_ALIGN) != 0)
- {
- align = (*ptr)->alignment;
- if (align > 16)
- align = 16;
- if (align > 1)
- next_arg.p = ALIGN (next_arg.p, align);
- }
-#if _CALL_ELF == 2
- elt = discover_homogeneous_aggregate (*ptr, &elnum);
- if (elt)
- {
- union {
- void *v;
- float *f;
- double *d;
- } arg;
-
- arg.v = *p_argv.v;
- if (elt == FFI_TYPE_FLOAT)
- {
- do
- {
- double_tmp = *arg.f++;
- if (fparg_count < NUM_FPR_ARG_REGISTERS64
- && i < nfixedargs)
- *fpr_base.d++ = double_tmp;
- else
- *next_arg.f = (float) double_tmp;
- if (++next_arg.f == gpr_end.f)
- next_arg.f = rest.f;
- fparg_count++;
- }
- while (--elnum != 0);
- if ((next_arg.p & 3) != 0)
- {
- if (++next_arg.f == gpr_end.f)
- next_arg.f = rest.f;
- }
- }
- else
- do
- {
- double_tmp = *arg.d++;
- if (fparg_count < NUM_FPR_ARG_REGISTERS64 && i < nfixedargs)
- *fpr_base.d++ = double_tmp;
- else
- *next_arg.d = double_tmp;
- if (++next_arg.d == gpr_end.d)
- next_arg.d = rest.d;
- fparg_count++;
- }
- while (--elnum != 0);
- }
- else
-#endif
- {
- words = ((*ptr)->size + 7) / 8;
- if (next_arg.ul >= gpr_base.ul && next_arg.ul + words > gpr_end.ul)
- {
- size_t first = gpr_end.c - next_arg.c;
- memcpy (next_arg.c, *p_argv.c, first);
- memcpy (rest.c, *p_argv.c + first, (*ptr)->size - first);
- next_arg.c = rest.c + words * 8 - first;
- }
- else
- {
- char *where = next_arg.c;
-
-#ifndef __LITTLE_ENDIAN__
- /* Structures with size less than eight bytes are passed
- left-padded. */
- if ((*ptr)->size < 8)
- where += 8 - (*ptr)->size;
-#endif
- memcpy (where, *p_argv.c, (*ptr)->size);
- next_arg.ul += words;
- if (next_arg.ul == gpr_end.ul)
- next_arg.ul = rest.ul;
- }
- }
- break;
-
- case FFI_TYPE_UINT8:
- gprvalue = **p_argv.uc;
- goto putgpr;
- case FFI_TYPE_SINT8:
- gprvalue = **p_argv.sc;
- goto putgpr;
- case FFI_TYPE_UINT16:
- gprvalue = **p_argv.us;
- goto putgpr;
- case FFI_TYPE_SINT16:
- gprvalue = **p_argv.ss;
- goto putgpr;
- case FFI_TYPE_UINT32:
- gprvalue = **p_argv.ui;
- goto putgpr;
- case FFI_TYPE_INT:
- case FFI_TYPE_SINT32:
- gprvalue = **p_argv.si;
- goto putgpr;
-
- case FFI_TYPE_UINT64:
- case FFI_TYPE_SINT64:
- case FFI_TYPE_POINTER:
- gprvalue = **p_argv.ul;
- putgpr:
- *next_arg.ul++ = gprvalue;
- if (next_arg.ul == gpr_end.ul)
- next_arg.ul = rest.ul;
- break;
- }
- }
-
- FFI_ASSERT (flags & FLAG_4_GPR_ARGUMENTS
- || (next_arg.ul >= gpr_base.ul
- && next_arg.ul <= gpr_base.ul + 4));
-}
-
-
-#if _CALL_ELF == 2
-#define MIN_CACHE_LINE_SIZE 8
-
-static void
-flush_icache (char *wraddr, char *xaddr, int size)
-{
- int i;
- for (i = 0; i < size; i += MIN_CACHE_LINE_SIZE)
- __asm__ volatile ("icbi 0,%0;" "dcbf 0,%1;"
- : : "r" (xaddr + i), "r" (wraddr + i) : "memory");
- __asm__ volatile ("icbi 0,%0;" "dcbf 0,%1;" "sync;" "isync;"
- : : "r"(xaddr + size - 1), "r"(wraddr + size - 1)
- : "memory");
-}
-#endif
-
-ffi_status
-ffi_prep_closure_loc_linux64 (ffi_closure *closure,
- ffi_cif *cif,
- void (*fun) (ffi_cif *, void *, void **, void *),
- void *user_data,
- void *codeloc)
-{
-#if _CALL_ELF == 2
- unsigned int *tramp = (unsigned int *) &closure->tramp[0];
-
- if (cif->abi < FFI_LINUX || cif->abi >= FFI_LAST_ABI)
- return FFI_BAD_ABI;
-
- tramp[0] = 0xe96c0018; /* 0: ld 11,2f-0b(12) */
- tramp[1] = 0xe98c0010; /* ld 12,1f-0b(12) */
- tramp[2] = 0x7d8903a6; /* mtctr 12 */
- tramp[3] = 0x4e800420; /* bctr */
- /* 1: .quad function_addr */
- /* 2: .quad context */
- *(void **) &tramp[4] = (void *) ffi_closure_LINUX64;
- *(void **) &tramp[6] = codeloc;
- flush_icache ((char *)tramp, (char *)codeloc, FFI_TRAMPOLINE_SIZE);
-#else
- void **tramp = (void **) &closure->tramp[0];
-
- if (cif->abi < FFI_LINUX || cif->abi >= FFI_LAST_ABI)
- return FFI_BAD_ABI;
-
- /* Copy function address and TOC from ffi_closure_LINUX64. */
- memcpy (tramp, (char *) ffi_closure_LINUX64, 16);
- tramp[2] = tramp[1];
- tramp[1] = codeloc;
-#endif
-
- closure->cif = cif;
- closure->fun = fun;
- closure->user_data = user_data;
-
- return FFI_OK;
-}
-
-
-int FFI_HIDDEN
-ffi_closure_helper_LINUX64 (ffi_closure *closure, void *rvalue,
- unsigned long *pst, ffi_dblfl *pfr)
-{
- /* rvalue is the pointer to space for return value in closure assembly */
- /* pst is the pointer to parameter save area
- (r3-r10 are stored into its first 8 slots by ffi_closure_LINUX64) */
- /* pfr is the pointer to where f1-f13 are stored in ffi_closure_LINUX64 */
-
- void **avalue;
- ffi_type **arg_types;
- unsigned long i, avn, nfixedargs;
- ffi_cif *cif;
- ffi_dblfl *end_pfr = pfr + NUM_FPR_ARG_REGISTERS64;
- unsigned long align;
-
- cif = closure->cif;
- avalue = alloca (cif->nargs * sizeof (void *));
-
- /* Copy the caller's structure return value address so that the
- closure returns the data directly to the caller. */
- if (cif->rtype->type == FFI_TYPE_STRUCT
- && (cif->flags & FLAG_RETURNS_SMST) == 0)
- {
- rvalue = (void *) *pst;
- pst++;
- }
-
- i = 0;
- avn = cif->nargs;
-#if _CALL_ELF != 2
- nfixedargs = (unsigned) -1;
- if ((cif->flags & FLAG_COMPAT) == 0)
-#endif
- nfixedargs = cif->nfixedargs;
- arg_types = cif->arg_types;
-
- /* Grab the addresses of the arguments from the stack frame. */
- while (i < avn)
- {
- unsigned int elt, elnum;
-
- switch (arg_types[i]->type)
- {
- case FFI_TYPE_SINT8:
- case FFI_TYPE_UINT8:
-#ifndef __LITTLE_ENDIAN__
- avalue[i] = (char *) pst + 7;
- pst++;
- break;
-#endif
-
- case FFI_TYPE_SINT16:
- case FFI_TYPE_UINT16:
-#ifndef __LITTLE_ENDIAN__
- avalue[i] = (char *) pst + 6;
- pst++;
- break;
-#endif
-
- case FFI_TYPE_SINT32:
- case FFI_TYPE_UINT32:
-#ifndef __LITTLE_ENDIAN__
- avalue[i] = (char *) pst + 4;
- pst++;
- break;
-#endif
-
- case FFI_TYPE_SINT64:
- case FFI_TYPE_UINT64:
- case FFI_TYPE_POINTER:
- avalue[i] = pst;
- pst++;
- break;
-
- case FFI_TYPE_STRUCT:
- if ((cif->abi & FFI_LINUX_STRUCT_ALIGN) != 0)
- {
- align = arg_types[i]->alignment;
- if (align > 16)
- align = 16;
- if (align > 1)
- pst = (unsigned long *) ALIGN ((size_t) pst, align);
- }
- elt = 0;
-#if _CALL_ELF == 2
- elt = discover_homogeneous_aggregate (arg_types[i], &elnum);
-#endif
- if (elt)
- {
- union {
- void *v;
- unsigned long *ul;
- float *f;
- double *d;
- size_t p;
- } to, from;
-
- /* Repackage the aggregate from its parts. The
- aggregate size is not greater than the space taken by
- the registers so store back to the register/parameter
- save arrays. */
- if (pfr + elnum <= end_pfr)
- to.v = pfr;
- else
- to.v = pst;
-
- avalue[i] = to.v;
- from.ul = pst;
- if (elt == FFI_TYPE_FLOAT)
- {
- do
- {
- if (pfr < end_pfr && i < nfixedargs)
- {
- *to.f = (float) pfr->d;
- pfr++;
- }
- else
- *to.f = *from.f;
- to.f++;
- from.f++;
- }
- while (--elnum != 0);
- }
- else
- {
- do
- {
- if (pfr < end_pfr && i < nfixedargs)
- {
- *to.d = pfr->d;
- pfr++;
- }
- else
- *to.d = *from.d;
- to.d++;
- from.d++;
- }
- while (--elnum != 0);
- }
- }
- else
- {
-#ifndef __LITTLE_ENDIAN__
- /* Structures with size less than eight bytes are passed
- left-padded. */
- if (arg_types[i]->size < 8)
- avalue[i] = (char *) pst + 8 - arg_types[i]->size;
- else
-#endif
- avalue[i] = pst;
- }
- pst += (arg_types[i]->size + 7) / 8;
- break;
-
-#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE
- case FFI_TYPE_LONGDOUBLE:
- if ((cif->abi & FFI_LINUX_LONG_DOUBLE_128) != 0)
- {
- if (pfr + 1 < end_pfr && i + 1 < nfixedargs)
- {
- avalue[i] = pfr;
- pfr += 2;
- }
- else
- {
- if (pfr < end_pfr && i < nfixedargs)
- {
- /* Passed partly in f13 and partly on the stack.
- Move it all to the stack. */
- *pst = *(unsigned long *) pfr;
- pfr++;
- }
- avalue[i] = pst;
- }
- pst += 2;
- break;
- }
- /* Fall through. */
-#endif
- case FFI_TYPE_DOUBLE:
- /* On the outgoing stack all values are aligned to 8 */
- /* there are 13 64bit floating point registers */
-
- if (pfr < end_pfr && i < nfixedargs)
- {
- avalue[i] = pfr;
- pfr++;
- }
- else
- avalue[i] = pst;
- pst++;
- break;
-
- case FFI_TYPE_FLOAT:
- if (pfr < end_pfr && i < nfixedargs)
- {
- /* Float values are stored as doubles in the
- ffi_closure_LINUX64 code. Fix them here. */
- pfr->f = (float) pfr->d;
- avalue[i] = pfr;
- pfr++;
- }
- else
- avalue[i] = pst;
- pst++;
- break;
-
- default:
- FFI_ASSERT (0);
- }
-
- i++;
- }
-
-
- (closure->fun) (cif, rvalue, avalue, closure->user_data);
-
- /* Tell ffi_closure_LINUX64 how to perform return type promotions. */
- if ((cif->flags & FLAG_RETURNS_SMST) != 0)
- {
- if ((cif->flags & FLAG_RETURNS_FP) == 0)
- return FFI_V2_TYPE_SMALL_STRUCT + cif->rtype->size - 1;
- else if ((cif->flags & FLAG_RETURNS_64BITS) != 0)
- return FFI_V2_TYPE_DOUBLE_HOMOG;
- else
- return FFI_V2_TYPE_FLOAT_HOMOG;
- }
- return cif->rtype->type;
-}
-#endif
diff --git a/Modules/_ctypes/libffi/src/powerpc/ffi_powerpc.h b/Modules/_ctypes/libffi/src/powerpc/ffi_powerpc.h
deleted file mode 100644
index 2e61653d1a..0000000000
--- a/Modules/_ctypes/libffi/src/powerpc/ffi_powerpc.h
+++ /dev/null
@@ -1,77 +0,0 @@
-/* -----------------------------------------------------------------------
- ffi_powerpc.h - Copyright (C) 2013 IBM
- Copyright (C) 2011 Anthony Green
- Copyright (C) 2011 Kyle Moffett
- Copyright (C) 2008 Red Hat, Inc
- Copyright (C) 2007, 2008 Free Software Foundation, Inc
- Copyright (c) 1998 Geoffrey Keating
-
- PowerPC Foreign Function Interface
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- ``Software''), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to
- permit persons to whom the Software is furnished to do so, subject to
- the following conditions:
-
- The above copyright notice and this permission notice shall be included
- in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS
- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR
- OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- OTHER DEALINGS IN THE SOFTWARE.
- ----------------------------------------------------------------------- */
-
-enum {
- /* The assembly depends on these exact flags. */
- /* These go in cr7 */
- FLAG_RETURNS_SMST = 1 << (31-31), /* Used for FFI_SYSV small structs. */
- FLAG_RETURNS_NOTHING = 1 << (31-30),
- FLAG_RETURNS_FP = 1 << (31-29),
- FLAG_RETURNS_64BITS = 1 << (31-28),
-
- /* This goes in cr6 */
- FLAG_RETURNS_128BITS = 1 << (31-27),
-
- FLAG_COMPAT = 1 << (31- 8), /* Not used by assembly */
-
- /* These go in cr1 */
- FLAG_ARG_NEEDS_COPY = 1 << (31- 7), /* Used by sysv code */
- FLAG_ARG_NEEDS_PSAVE = FLAG_ARG_NEEDS_COPY, /* Used by linux64 code */
- FLAG_FP_ARGUMENTS = 1 << (31- 6), /* cr1.eq; specified by ABI */
- FLAG_4_GPR_ARGUMENTS = 1 << (31- 5),
- FLAG_RETVAL_REFERENCE = 1 << (31- 4)
-};
-
-typedef union
-{
- float f;
- double d;
-} ffi_dblfl;
-
-void FFI_HIDDEN ffi_closure_SYSV (void);
-void FFI_HIDDEN ffi_call_SYSV(extended_cif *, unsigned, unsigned, unsigned *,
- void (*)(void));
-
-void FFI_HIDDEN ffi_prep_types_sysv (ffi_abi);
-ffi_status FFI_HIDDEN ffi_prep_cif_sysv (ffi_cif *);
-int FFI_HIDDEN ffi_closure_helper_SYSV (ffi_closure *, void *, unsigned long *,
- ffi_dblfl *, unsigned long *);
-
-void FFI_HIDDEN ffi_call_LINUX64(extended_cif *, unsigned long, unsigned long,
- unsigned long *, void (*)(void));
-void FFI_HIDDEN ffi_closure_LINUX64 (void);
-
-void FFI_HIDDEN ffi_prep_types_linux64 (ffi_abi);
-ffi_status FFI_HIDDEN ffi_prep_cif_linux64 (ffi_cif *);
-ffi_status FFI_HIDDEN ffi_prep_cif_linux64_var (ffi_cif *, unsigned int,
- unsigned int);
-void FFI_HIDDEN ffi_prep_args64 (extended_cif *, unsigned long *const);
-int FFI_HIDDEN ffi_closure_helper_LINUX64 (ffi_closure *, void *,
- unsigned long *, ffi_dblfl *);
diff --git a/Modules/_ctypes/libffi/src/powerpc/ffi_sysv.c b/Modules/_ctypes/libffi/src/powerpc/ffi_sysv.c
deleted file mode 100644
index fbe85fe914..0000000000
--- a/Modules/_ctypes/libffi/src/powerpc/ffi_sysv.c
+++ /dev/null
@@ -1,931 +0,0 @@
-/* -----------------------------------------------------------------------
- ffi_sysv.c - Copyright (C) 2013 IBM
- Copyright (C) 2011 Anthony Green
- Copyright (C) 2011 Kyle Moffett
- Copyright (C) 2008 Red Hat, Inc
- Copyright (C) 2007, 2008 Free Software Foundation, Inc
- Copyright (c) 1998 Geoffrey Keating
-
- PowerPC Foreign Function Interface
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- ``Software''), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to
- permit persons to whom the Software is furnished to do so, subject to
- the following conditions:
-
- The above copyright notice and this permission notice shall be included
- in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS
- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR
- OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- OTHER DEALINGS IN THE SOFTWARE.
- ----------------------------------------------------------------------- */
-
-#include "ffi.h"
-
-#ifndef POWERPC64
-#include "ffi_common.h"
-#include "ffi_powerpc.h"
-
-
-/* About the SYSV ABI. */
-#define ASM_NEEDS_REGISTERS 4
-#define NUM_GPR_ARG_REGISTERS 8
-#define NUM_FPR_ARG_REGISTERS 8
-
-
-#if HAVE_LONG_DOUBLE_VARIANT && FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE
-/* Adjust size of ffi_type_longdouble. */
-void FFI_HIDDEN
-ffi_prep_types_sysv (ffi_abi abi)
-{
- if ((abi & (FFI_SYSV | FFI_SYSV_LONG_DOUBLE_128)) == FFI_SYSV)
- {
- ffi_type_longdouble.size = 8;
- ffi_type_longdouble.alignment = 8;
- }
- else
- {
- ffi_type_longdouble.size = 16;
- ffi_type_longdouble.alignment = 16;
- }
-}
-#endif
-
-/* Transform long double, double and float to other types as per abi. */
-static int
-translate_float (int abi, int type)
-{
-#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE
- if (type == FFI_TYPE_LONGDOUBLE
- && (abi & FFI_SYSV_LONG_DOUBLE_128) == 0)
- type = FFI_TYPE_DOUBLE;
-#endif
- if ((abi & FFI_SYSV_SOFT_FLOAT) != 0)
- {
- if (type == FFI_TYPE_FLOAT)
- type = FFI_TYPE_UINT32;
- else if (type == FFI_TYPE_DOUBLE)
- type = FFI_TYPE_UINT64;
-#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE
- else if (type == FFI_TYPE_LONGDOUBLE)
- type = FFI_TYPE_UINT128;
- }
- else if ((abi & FFI_SYSV_IBM_LONG_DOUBLE) == 0)
- {
- if (type == FFI_TYPE_LONGDOUBLE)
- type = FFI_TYPE_STRUCT;
-#endif
- }
- return type;
-}
-
-/* Perform machine dependent cif processing */
-static ffi_status
-ffi_prep_cif_sysv_core (ffi_cif *cif)
-{
- ffi_type **ptr;
- unsigned bytes;
- unsigned i, fparg_count = 0, intarg_count = 0;
- unsigned flags = cif->flags;
- unsigned struct_copy_size = 0;
- unsigned type = cif->rtype->type;
- unsigned size = cif->rtype->size;
-
- /* The machine-independent calculation of cif->bytes doesn't work
- for us. Redo the calculation. */
-
- /* Space for the frame pointer, callee's LR, and the asm's temp regs. */
- bytes = (2 + ASM_NEEDS_REGISTERS) * sizeof (int);
-
- /* Space for the GPR registers. */
- bytes += NUM_GPR_ARG_REGISTERS * sizeof (int);
-
- /* Return value handling. The rules for SYSV are as follows:
- - 32-bit (or less) integer values are returned in gpr3;
- - Structures of size <= 4 bytes also returned in gpr3;
- - 64-bit integer values and structures between 5 and 8 bytes are returned
- in gpr3 and gpr4;
- - Larger structures are allocated space and a pointer is passed as
- the first argument.
- - Single/double FP values are returned in fpr1;
- - long doubles (if not equivalent to double) are returned in
- fpr1,fpr2 for Linux and as for large structs for SysV. */
-
- type = translate_float (cif->abi, type);
-
- switch (type)
- {
-#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE
- case FFI_TYPE_LONGDOUBLE:
- flags |= FLAG_RETURNS_128BITS;
- /* Fall through. */
-#endif
- case FFI_TYPE_DOUBLE:
- flags |= FLAG_RETURNS_64BITS;
- /* Fall through. */
- case FFI_TYPE_FLOAT:
- flags |= FLAG_RETURNS_FP;
-#ifdef __NO_FPRS__
- return FFI_BAD_ABI;
-#endif
- break;
-
- case FFI_TYPE_UINT128:
- flags |= FLAG_RETURNS_128BITS;
- /* Fall through. */
- case FFI_TYPE_UINT64:
- case FFI_TYPE_SINT64:
- flags |= FLAG_RETURNS_64BITS;
- break;
-
- case FFI_TYPE_STRUCT:
- /* The final SYSV ABI says that structures smaller or equal 8 bytes
- are returned in r3/r4. A draft ABI used by linux instead
- returns them in memory. */
- if ((cif->abi & FFI_SYSV_STRUCT_RET) != 0 && size <= 8)
- {
- flags |= FLAG_RETURNS_SMST;
- break;
- }
- intarg_count++;
- flags |= FLAG_RETVAL_REFERENCE;
- /* Fall through. */
- case FFI_TYPE_VOID:
- flags |= FLAG_RETURNS_NOTHING;
- break;
-
- default:
- /* Returns 32-bit integer, or similar. Nothing to do here. */
- break;
- }
-
- /* The first NUM_GPR_ARG_REGISTERS words of integer arguments, and the
- first NUM_FPR_ARG_REGISTERS fp arguments, go in registers; the rest
- goes on the stack. Structures and long doubles (if not equivalent
- to double) are passed as a pointer to a copy of the structure.
- Stuff on the stack needs to keep proper alignment. */
- for (ptr = cif->arg_types, i = cif->nargs; i > 0; i--, ptr++)
- {
- unsigned short typenum = (*ptr)->type;
-
- typenum = translate_float (cif->abi, typenum);
-
- switch (typenum)
- {
-#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE
- case FFI_TYPE_LONGDOUBLE:
- fparg_count++;
- /* Fall thru */
-#endif
- case FFI_TYPE_DOUBLE:
- fparg_count++;
- /* If this FP arg is going on the stack, it must be
- 8-byte-aligned. */
- if (fparg_count > NUM_FPR_ARG_REGISTERS
- && intarg_count >= NUM_GPR_ARG_REGISTERS
- && intarg_count % 2 != 0)
- intarg_count++;
-#ifdef __NO_FPRS__
- return FFI_BAD_ABI;
-#endif
- break;
-
- case FFI_TYPE_FLOAT:
- fparg_count++;
-#ifdef __NO_FPRS__
- return FFI_BAD_ABI;
-#endif
- break;
-
- case FFI_TYPE_UINT128:
- /* A long double in FFI_LINUX_SOFT_FLOAT can use only a set
- of four consecutive gprs. If we do not have enough, we
- have to adjust the intarg_count value. */
- if (intarg_count >= NUM_GPR_ARG_REGISTERS - 3
- && intarg_count < NUM_GPR_ARG_REGISTERS)
- intarg_count = NUM_GPR_ARG_REGISTERS;
- intarg_count += 4;
- break;
-
- case FFI_TYPE_UINT64:
- case FFI_TYPE_SINT64:
- /* 'long long' arguments are passed as two words, but
- either both words must fit in registers or both go
- on the stack. If they go on the stack, they must
- be 8-byte-aligned.
-
- Also, only certain register pairs can be used for
- passing long long int -- specifically (r3,r4), (r5,r6),
- (r7,r8), (r9,r10). */
- if (intarg_count == NUM_GPR_ARG_REGISTERS-1
- || intarg_count % 2 != 0)
- intarg_count++;
- intarg_count += 2;
- break;
-
- case FFI_TYPE_STRUCT:
- /* We must allocate space for a copy of these to enforce
- pass-by-value. Pad the space up to a multiple of 16
- bytes (the maximum alignment required for anything under
- the SYSV ABI). */
- struct_copy_size += ((*ptr)->size + 15) & ~0xF;
- /* Fall through (allocate space for the pointer). */
-
- case FFI_TYPE_POINTER:
- case FFI_TYPE_INT:
- case FFI_TYPE_UINT32:
- case FFI_TYPE_SINT32:
- case FFI_TYPE_UINT16:
- case FFI_TYPE_SINT16:
- case FFI_TYPE_UINT8:
- case FFI_TYPE_SINT8:
- /* Everything else is passed as a 4-byte word in a GPR, either
- the object itself or a pointer to it. */
- intarg_count++;
- break;
-
- default:
- FFI_ASSERT (0);
- }
- }
-
- if (fparg_count != 0)
- flags |= FLAG_FP_ARGUMENTS;
- if (intarg_count > 4)
- flags |= FLAG_4_GPR_ARGUMENTS;
- if (struct_copy_size != 0)
- flags |= FLAG_ARG_NEEDS_COPY;
-
- /* Space for the FPR registers, if needed. */
- if (fparg_count != 0)
- bytes += NUM_FPR_ARG_REGISTERS * sizeof (double);
-
- /* Stack space. */
- if (intarg_count > NUM_GPR_ARG_REGISTERS)
- bytes += (intarg_count - NUM_GPR_ARG_REGISTERS) * sizeof (int);
- if (fparg_count > NUM_FPR_ARG_REGISTERS)
- bytes += (fparg_count - NUM_FPR_ARG_REGISTERS) * sizeof (double);
-
- /* The stack space allocated needs to be a multiple of 16 bytes. */
- bytes = (bytes + 15) & ~0xF;
-
- /* Add in the space for the copied structures. */
- bytes += struct_copy_size;
-
- cif->flags = flags;
- cif->bytes = bytes;
-
- return FFI_OK;
-}
-
-ffi_status FFI_HIDDEN
-ffi_prep_cif_sysv (ffi_cif *cif)
-{
- if ((cif->abi & FFI_SYSV) == 0)
- {
- /* This call is from old code. Translate to new ABI values. */
- cif->flags |= FLAG_COMPAT;
- switch (cif->abi)
- {
- default:
- return FFI_BAD_ABI;
-
- case FFI_COMPAT_SYSV:
- cif->abi = FFI_SYSV | FFI_SYSV_STRUCT_RET | FFI_SYSV_LONG_DOUBLE_128;
- break;
-
- case FFI_COMPAT_GCC_SYSV:
- cif->abi = FFI_SYSV | FFI_SYSV_LONG_DOUBLE_128;
- break;
-
- case FFI_COMPAT_LINUX:
- cif->abi = (FFI_SYSV | FFI_SYSV_IBM_LONG_DOUBLE
- | FFI_SYSV_LONG_DOUBLE_128);
- break;
-
- case FFI_COMPAT_LINUX_SOFT_FLOAT:
- cif->abi = (FFI_SYSV | FFI_SYSV_SOFT_FLOAT | FFI_SYSV_IBM_LONG_DOUBLE
- | FFI_SYSV_LONG_DOUBLE_128);
- break;
- }
- }
- return ffi_prep_cif_sysv_core (cif);
-}
-
-/* ffi_prep_args_SYSV is called by the assembly routine once stack space
- has been allocated for the function's arguments.
-
- The stack layout we want looks like this:
-
- | Return address from ffi_call_SYSV 4bytes | higher addresses
- |--------------------------------------------|
- | Previous backchain pointer 4 | stack pointer here
- |--------------------------------------------|<+ <<< on entry to
- | Saved r28-r31 4*4 | | ffi_call_SYSV
- |--------------------------------------------| |
- | GPR registers r3-r10 8*4 | | ffi_call_SYSV
- |--------------------------------------------| |
- | FPR registers f1-f8 (optional) 8*8 | |
- |--------------------------------------------| | stack |
- | Space for copied structures | | grows |
- |--------------------------------------------| | down V
- | Parameters that didn't fit in registers | |
- |--------------------------------------------| | lower addresses
- | Space for callee's LR 4 | |
- |--------------------------------------------| | stack pointer here
- | Current backchain pointer 4 |-/ during
- |--------------------------------------------| <<< ffi_call_SYSV
-
-*/
-
-void FFI_HIDDEN
-ffi_prep_args_SYSV (extended_cif *ecif, unsigned *const stack)
-{
- const unsigned bytes = ecif->cif->bytes;
- const unsigned flags = ecif->cif->flags;
-
- typedef union
- {
- char *c;
- unsigned *u;
- long long *ll;
- float *f;
- double *d;
- } valp;
-
- /* 'stacktop' points at the previous backchain pointer. */
- valp stacktop;
-
- /* 'gpr_base' points at the space for gpr3, and grows upwards as
- we use GPR registers. */
- valp gpr_base;
- int intarg_count;
-
-#ifndef __NO_FPRS__
- /* 'fpr_base' points at the space for fpr1, and grows upwards as
- we use FPR registers. */
- valp fpr_base;
- int fparg_count;
-#endif
-
- /* 'copy_space' grows down as we put structures in it. It should
- stay 16-byte aligned. */
- valp copy_space;
-
- /* 'next_arg' grows up as we put parameters in it. */
- valp next_arg;
-
- int i;
- ffi_type **ptr;
-#ifndef __NO_FPRS__
- double double_tmp;
-#endif
- union
- {
- void **v;
- char **c;
- signed char **sc;
- unsigned char **uc;
- signed short **ss;
- unsigned short **us;
- unsigned int **ui;
- long long **ll;
- float **f;
- double **d;
- } p_argv;
- size_t struct_copy_size;
- unsigned gprvalue;
-
- stacktop.c = (char *) stack + bytes;
- gpr_base.u = stacktop.u - ASM_NEEDS_REGISTERS - NUM_GPR_ARG_REGISTERS;
- intarg_count = 0;
-#ifndef __NO_FPRS__
- fpr_base.d = gpr_base.d - NUM_FPR_ARG_REGISTERS;
- fparg_count = 0;
- copy_space.c = ((flags & FLAG_FP_ARGUMENTS) ? fpr_base.c : gpr_base.c);
-#else
- copy_space.c = gpr_base.c;
-#endif
- next_arg.u = stack + 2;
-
- /* Check that everything starts aligned properly. */
- FFI_ASSERT (((unsigned long) (char *) stack & 0xF) == 0);
- FFI_ASSERT (((unsigned long) copy_space.c & 0xF) == 0);
- FFI_ASSERT (((unsigned long) stacktop.c & 0xF) == 0);
- FFI_ASSERT ((bytes & 0xF) == 0);
- FFI_ASSERT (copy_space.c >= next_arg.c);
-
- /* Deal with return values that are actually pass-by-reference. */
- if (flags & FLAG_RETVAL_REFERENCE)
- {
- *gpr_base.u++ = (unsigned long) (char *) ecif->rvalue;
- intarg_count++;
- }
-
- /* Now for the arguments. */
- p_argv.v = ecif->avalue;
- for (ptr = ecif->cif->arg_types, i = ecif->cif->nargs;
- i > 0;
- i--, ptr++, p_argv.v++)
- {
- unsigned int typenum = (*ptr)->type;
-
- typenum = translate_float (ecif->cif->abi, typenum);
-
- /* Now test the translated value */
- switch (typenum)
- {
-#ifndef __NO_FPRS__
-# if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE
- case FFI_TYPE_LONGDOUBLE:
- double_tmp = (*p_argv.d)[0];
-
- if (fparg_count >= NUM_FPR_ARG_REGISTERS - 1)
- {
- if (intarg_count >= NUM_GPR_ARG_REGISTERS
- && intarg_count % 2 != 0)
- {
- intarg_count++;
- next_arg.u++;
- }
- *next_arg.d = double_tmp;
- next_arg.u += 2;
- double_tmp = (*p_argv.d)[1];
- *next_arg.d = double_tmp;
- next_arg.u += 2;
- }
- else
- {
- *fpr_base.d++ = double_tmp;
- double_tmp = (*p_argv.d)[1];
- *fpr_base.d++ = double_tmp;
- }
-
- fparg_count += 2;
- FFI_ASSERT (flags & FLAG_FP_ARGUMENTS);
- break;
-# endif
- case FFI_TYPE_DOUBLE:
- double_tmp = **p_argv.d;
-
- if (fparg_count >= NUM_FPR_ARG_REGISTERS)
- {
- if (intarg_count >= NUM_GPR_ARG_REGISTERS
- && intarg_count % 2 != 0)
- {
- intarg_count++;
- next_arg.u++;
- }
- *next_arg.d = double_tmp;
- next_arg.u += 2;
- }
- else
- *fpr_base.d++ = double_tmp;
- fparg_count++;
- FFI_ASSERT (flags & FLAG_FP_ARGUMENTS);
- break;
-
- case FFI_TYPE_FLOAT:
- double_tmp = **p_argv.f;
- if (fparg_count >= NUM_FPR_ARG_REGISTERS)
- {
- *next_arg.f = (float) double_tmp;
- next_arg.u += 1;
- intarg_count++;
- }
- else
- *fpr_base.d++ = double_tmp;
- fparg_count++;
- FFI_ASSERT (flags & FLAG_FP_ARGUMENTS);
- break;
-#endif /* have FPRs */
-
- case FFI_TYPE_UINT128:
- /* The soft float ABI for long doubles works like this, a long double
- is passed in four consecutive GPRs if available. A maximum of 2
- long doubles can be passed in gprs. If we do not have 4 GPRs
- left, the long double is passed on the stack, 4-byte aligned. */
- {
- unsigned int int_tmp;
- unsigned int ii;
- if (intarg_count >= NUM_GPR_ARG_REGISTERS - 3)
- {
- if (intarg_count < NUM_GPR_ARG_REGISTERS)
- intarg_count = NUM_GPR_ARG_REGISTERS;
- for (ii = 0; ii < 4; ii++)
- {
- int_tmp = (*p_argv.ui)[ii];
- *next_arg.u++ = int_tmp;
- }
- }
- else
- {
- for (ii = 0; ii < 4; ii++)
- {
- int_tmp = (*p_argv.ui)[ii];
- *gpr_base.u++ = int_tmp;
- }
- }
- intarg_count += 4;
- break;
- }
-
- case FFI_TYPE_UINT64:
- case FFI_TYPE_SINT64:
- if (intarg_count == NUM_GPR_ARG_REGISTERS-1)
- intarg_count++;
- if (intarg_count >= NUM_GPR_ARG_REGISTERS)
- {
- if (intarg_count % 2 != 0)
- {
- intarg_count++;
- next_arg.u++;
- }
- *next_arg.ll = **p_argv.ll;
- next_arg.u += 2;
- }
- else
- {
- /* The abi states only certain register pairs can be
- used for passing long long int specifically (r3,r4),
- (r5,r6), (r7,r8), (r9,r10). If next arg is long long
- but not correct starting register of pair then skip
- until the proper starting register. */
- if (intarg_count % 2 != 0)
- {
- intarg_count ++;
- gpr_base.u++;
- }
- *gpr_base.ll++ = **p_argv.ll;
- }
- intarg_count += 2;
- break;
-
- case FFI_TYPE_STRUCT:
- struct_copy_size = ((*ptr)->size + 15) & ~0xF;
- copy_space.c -= struct_copy_size;
- memcpy (copy_space.c, *p_argv.c, (*ptr)->size);
-
- gprvalue = (unsigned long) copy_space.c;
-
- FFI_ASSERT (copy_space.c > next_arg.c);
- FFI_ASSERT (flags & FLAG_ARG_NEEDS_COPY);
- goto putgpr;
-
- case FFI_TYPE_UINT8:
- gprvalue = **p_argv.uc;
- goto putgpr;
- case FFI_TYPE_SINT8:
- gprvalue = **p_argv.sc;
- goto putgpr;
- case FFI_TYPE_UINT16:
- gprvalue = **p_argv.us;
- goto putgpr;
- case FFI_TYPE_SINT16:
- gprvalue = **p_argv.ss;
- goto putgpr;
-
- case FFI_TYPE_INT:
- case FFI_TYPE_UINT32:
- case FFI_TYPE_SINT32:
- case FFI_TYPE_POINTER:
-
- gprvalue = **p_argv.ui;
-
- putgpr:
- if (intarg_count >= NUM_GPR_ARG_REGISTERS)
- *next_arg.u++ = gprvalue;
- else
- *gpr_base.u++ = gprvalue;
- intarg_count++;
- break;
- }
- }
-
- /* Check that we didn't overrun the stack... */
- FFI_ASSERT (copy_space.c >= next_arg.c);
- FFI_ASSERT (gpr_base.u <= stacktop.u - ASM_NEEDS_REGISTERS);
- /* The assert below is testing that the number of integer arguments agrees
- with the number found in ffi_prep_cif_machdep(). However, intarg_count
- is incremented whenever we place an FP arg on the stack, so account for
- that before our assert test. */
-#ifndef __NO_FPRS__
- if (fparg_count > NUM_FPR_ARG_REGISTERS)
- intarg_count -= fparg_count - NUM_FPR_ARG_REGISTERS;
- FFI_ASSERT (fpr_base.u
- <= stacktop.u - ASM_NEEDS_REGISTERS - NUM_GPR_ARG_REGISTERS);
-#endif
- FFI_ASSERT (flags & FLAG_4_GPR_ARGUMENTS || intarg_count <= 4);
-}
-
-#define MIN_CACHE_LINE_SIZE 8
-
-static void
-flush_icache (char *wraddr, char *xaddr, int size)
-{
- int i;
- for (i = 0; i < size; i += MIN_CACHE_LINE_SIZE)
- __asm__ volatile ("icbi 0,%0;" "dcbf 0,%1;"
- : : "r" (xaddr + i), "r" (wraddr + i) : "memory");
- __asm__ volatile ("icbi 0,%0;" "dcbf 0,%1;" "sync;" "isync;"
- : : "r"(xaddr + size - 1), "r"(wraddr + size - 1)
- : "memory");
-}
-
-ffi_status FFI_HIDDEN
-ffi_prep_closure_loc_sysv (ffi_closure *closure,
- ffi_cif *cif,
- void (*fun) (ffi_cif *, void *, void **, void *),
- void *user_data,
- void *codeloc)
-{
- unsigned int *tramp;
-
- if (cif->abi < FFI_SYSV || cif->abi >= FFI_LAST_ABI)
- return FFI_BAD_ABI;
-
- tramp = (unsigned int *) &closure->tramp[0];
- tramp[0] = 0x7c0802a6; /* mflr r0 */
- tramp[1] = 0x4800000d; /* bl 10 <trampoline_initial+0x10> */
- tramp[4] = 0x7d6802a6; /* mflr r11 */
- tramp[5] = 0x7c0803a6; /* mtlr r0 */
- tramp[6] = 0x800b0000; /* lwz r0,0(r11) */
- tramp[7] = 0x816b0004; /* lwz r11,4(r11) */
- tramp[8] = 0x7c0903a6; /* mtctr r0 */
- tramp[9] = 0x4e800420; /* bctr */
- *(void **) &tramp[2] = (void *) ffi_closure_SYSV; /* function */
- *(void **) &tramp[3] = codeloc; /* context */
-
- /* Flush the icache. */
- flush_icache ((char *)tramp, (char *)codeloc, FFI_TRAMPOLINE_SIZE);
-
- closure->cif = cif;
- closure->fun = fun;
- closure->user_data = user_data;
-
- return FFI_OK;
-}
-
-/* Basically the trampoline invokes ffi_closure_SYSV, and on
- entry, r11 holds the address of the closure.
- After storing the registers that could possibly contain
- parameters to be passed into the stack frame and setting
- up space for a return value, ffi_closure_SYSV invokes the
- following helper function to do most of the work. */
-
-int
-ffi_closure_helper_SYSV (ffi_closure *closure, void *rvalue,
- unsigned long *pgr, ffi_dblfl *pfr,
- unsigned long *pst)
-{
- /* rvalue is the pointer to space for return value in closure assembly */
- /* pgr is the pointer to where r3-r10 are stored in ffi_closure_SYSV */
- /* pfr is the pointer to where f1-f8 are stored in ffi_closure_SYSV */
- /* pst is the pointer to outgoing parameter stack in original caller */
-
- void ** avalue;
- ffi_type ** arg_types;
- long i, avn;
-#ifndef __NO_FPRS__
- long nf = 0; /* number of floating registers already used */
-#endif
- long ng = 0; /* number of general registers already used */
-
- ffi_cif *cif = closure->cif;
- unsigned size = cif->rtype->size;
- unsigned short rtypenum = cif->rtype->type;
-
- avalue = alloca (cif->nargs * sizeof (void *));
-
- /* First translate for softfloat/nonlinux */
- rtypenum = translate_float (cif->abi, rtypenum);
-
- /* Copy the caller's structure return value address so that the closure
- returns the data directly to the caller.
- For FFI_SYSV the result is passed in r3/r4 if the struct size is less
- or equal 8 bytes. */
- if (rtypenum == FFI_TYPE_STRUCT
- && !((cif->abi & FFI_SYSV_STRUCT_RET) != 0 && size <= 8))
- {
- rvalue = (void *) *pgr;
- ng++;
- pgr++;
- }
-
- i = 0;
- avn = cif->nargs;
- arg_types = cif->arg_types;
-
- /* Grab the addresses of the arguments from the stack frame. */
- while (i < avn) {
- unsigned short typenum = arg_types[i]->type;
-
- /* We may need to handle some values depending on ABI. */
- typenum = translate_float (cif->abi, typenum);
-
- switch (typenum)
- {
-#ifndef __NO_FPRS__
- case FFI_TYPE_FLOAT:
- /* Unfortunately float values are stored as doubles
- in the ffi_closure_SYSV code (since we don't check
- the type in that routine). */
- if (nf < NUM_FPR_ARG_REGISTERS)
- {
- /* FIXME? here we are really changing the values
- stored in the original calling routines outgoing
- parameter stack. This is probably a really
- naughty thing to do but... */
- double temp = pfr->d;
- pfr->f = (float) temp;
- avalue[i] = pfr;
- nf++;
- pfr++;
- }
- else
- {
- avalue[i] = pst;
- pst += 1;
- }
- break;
-
- case FFI_TYPE_DOUBLE:
- if (nf < NUM_FPR_ARG_REGISTERS)
- {
- avalue[i] = pfr;
- nf++;
- pfr++;
- }
- else
- {
- if (((long) pst) & 4)
- pst++;
- avalue[i] = pst;
- pst += 2;
- }
- break;
-
-# if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE
- case FFI_TYPE_LONGDOUBLE:
- if (nf < NUM_FPR_ARG_REGISTERS - 1)
- {
- avalue[i] = pfr;
- pfr += 2;
- nf += 2;
- }
- else
- {
- if (((long) pst) & 4)
- pst++;
- avalue[i] = pst;
- pst += 4;
- nf = 8;
- }
- break;
-# endif
-#endif
-
- case FFI_TYPE_UINT128:
- /* Test if for the whole long double, 4 gprs are available.
- otherwise the stuff ends up on the stack. */
- if (ng < NUM_GPR_ARG_REGISTERS - 3)
- {
- avalue[i] = pgr;
- pgr += 4;
- ng += 4;
- }
- else
- {
- avalue[i] = pst;
- pst += 4;
- ng = 8+4;
- }
- break;
-
- case FFI_TYPE_SINT8:
- case FFI_TYPE_UINT8:
-#ifndef __LITTLE_ENDIAN__
- if (ng < NUM_GPR_ARG_REGISTERS)
- {
- avalue[i] = (char *) pgr + 3;
- ng++;
- pgr++;
- }
- else
- {
- avalue[i] = (char *) pst + 3;
- pst++;
- }
- break;
-#endif
-
- case FFI_TYPE_SINT16:
- case FFI_TYPE_UINT16:
-#ifndef __LITTLE_ENDIAN__
- if (ng < NUM_GPR_ARG_REGISTERS)
- {
- avalue[i] = (char *) pgr + 2;
- ng++;
- pgr++;
- }
- else
- {
- avalue[i] = (char *) pst + 2;
- pst++;
- }
- break;
-#endif
-
- case FFI_TYPE_SINT32:
- case FFI_TYPE_UINT32:
- case FFI_TYPE_POINTER:
- if (ng < NUM_GPR_ARG_REGISTERS)
- {
- avalue[i] = pgr;
- ng++;
- pgr++;
- }
- else
- {
- avalue[i] = pst;
- pst++;
- }
- break;
-
- case FFI_TYPE_STRUCT:
- /* Structs are passed by reference. The address will appear in a
- gpr if it is one of the first 8 arguments. */
- if (ng < NUM_GPR_ARG_REGISTERS)
- {
- avalue[i] = (void *) *pgr;
- ng++;
- pgr++;
- }
- else
- {
- avalue[i] = (void *) *pst;
- pst++;
- }
- break;
-
- case FFI_TYPE_SINT64:
- case FFI_TYPE_UINT64:
- /* Passing long long ints are complex, they must
- be passed in suitable register pairs such as
- (r3,r4) or (r5,r6) or (r6,r7), or (r7,r8) or (r9,r10)
- and if the entire pair aren't available then the outgoing
- parameter stack is used for both but an alignment of 8
- must will be kept. So we must either look in pgr
- or pst to find the correct address for this type
- of parameter. */
- if (ng < NUM_GPR_ARG_REGISTERS - 1)
- {
- if (ng & 1)
- {
- /* skip r4, r6, r8 as starting points */
- ng++;
- pgr++;
- }
- avalue[i] = pgr;
- ng += 2;
- pgr += 2;
- }
- else
- {
- if (((long) pst) & 4)
- pst++;
- avalue[i] = pst;
- pst += 2;
- ng = NUM_GPR_ARG_REGISTERS;
- }
- break;
-
- default:
- FFI_ASSERT (0);
- }
-
- i++;
- }
-
- (closure->fun) (cif, rvalue, avalue, closure->user_data);
-
- /* Tell ffi_closure_SYSV how to perform return type promotions.
- Because the FFI_SYSV ABI returns the structures <= 8 bytes in
- r3/r4 we have to tell ffi_closure_SYSV how to treat them. We
- combine the base type FFI_SYSV_TYPE_SMALL_STRUCT with the size of
- the struct less one. We never have a struct with size zero.
- See the comment in ffitarget.h about ordering. */
- if (rtypenum == FFI_TYPE_STRUCT
- && (cif->abi & FFI_SYSV_STRUCT_RET) != 0 && size <= 8)
- return FFI_SYSV_TYPE_SMALL_STRUCT - 1 + size;
- return rtypenum;
-}
-#endif
diff --git a/Modules/_ctypes/libffi/src/powerpc/ffitarget.h b/Modules/_ctypes/libffi/src/powerpc/ffitarget.h
deleted file mode 100644
index b47b0f5d3a..0000000000
--- a/Modules/_ctypes/libffi/src/powerpc/ffitarget.h
+++ /dev/null
@@ -1,183 +0,0 @@
-/* -----------------------------------------------------------------*-C-*-
- ffitarget.h - Copyright (c) 2012 Anthony Green
- Copyright (C) 2007, 2008, 2010 Free Software Foundation, Inc
- Copyright (c) 1996-2003 Red Hat, Inc.
-
- Target configuration macros for PowerPC.
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- ``Software''), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to
- permit persons to whom the Software is furnished to do so, subject to
- the following conditions:
-
- The above copyright notice and this permission notice shall be included
- in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- DEALINGS IN THE SOFTWARE.
-
- ----------------------------------------------------------------------- */
-
-#ifndef LIBFFI_TARGET_H
-#define LIBFFI_TARGET_H
-
-#ifndef LIBFFI_H
-#error "Please do not include ffitarget.h directly into your source. Use ffi.h instead."
-#endif
-
-/* ---- System specific configurations ----------------------------------- */
-
-#if defined (POWERPC) && defined (__powerpc64__) /* linux64 */
-#ifndef POWERPC64
-#define POWERPC64
-#endif
-#elif defined (POWERPC_DARWIN) && defined (__ppc64__) /* Darwin64 */
-#ifndef POWERPC64
-#define POWERPC64
-#endif
-#ifndef POWERPC_DARWIN64
-#define POWERPC_DARWIN64
-#endif
-#elif defined (POWERPC_AIX) && defined (__64BIT__) /* AIX64 */
-#ifndef POWERPC64
-#define POWERPC64
-#endif
-#endif
-
-#ifndef LIBFFI_ASM
-typedef unsigned long ffi_arg;
-typedef signed long ffi_sarg;
-
-typedef enum ffi_abi {
- FFI_FIRST_ABI = 0,
-
-#if defined (POWERPC_AIX)
- FFI_AIX,
- FFI_DARWIN,
- FFI_DEFAULT_ABI = FFI_AIX,
- FFI_LAST_ABI
-
-#elif defined (POWERPC_DARWIN)
- FFI_AIX,
- FFI_DARWIN,
- FFI_DEFAULT_ABI = FFI_DARWIN,
- FFI_LAST_ABI
-
-#else
- /* The FFI_COMPAT values are used by old code. Since libffi may be
- a shared library we have to support old values for backwards
- compatibility. */
- FFI_COMPAT_SYSV,
- FFI_COMPAT_GCC_SYSV,
- FFI_COMPAT_LINUX64,
- FFI_COMPAT_LINUX,
- FFI_COMPAT_LINUX_SOFT_FLOAT,
-
-# if defined (POWERPC64)
- /* This bit, always set in new code, must not be set in any of the
- old FFI_COMPAT values that might be used for 64-bit linux. We
- only need worry about FFI_COMPAT_LINUX64, but to be safe avoid
- all old values. */
- FFI_LINUX = 8,
- /* This and following bits can reuse FFI_COMPAT values. */
- FFI_LINUX_STRUCT_ALIGN = 1,
- FFI_LINUX_LONG_DOUBLE_128 = 2,
- FFI_DEFAULT_ABI = (FFI_LINUX
-# ifdef __STRUCT_PARM_ALIGN__
- | FFI_LINUX_STRUCT_ALIGN
-# endif
-# ifdef __LONG_DOUBLE_128__
- | FFI_LINUX_LONG_DOUBLE_128
-# endif
- ),
- FFI_LAST_ABI = 12
-
-# else
- /* This bit, always set in new code, must not be set in any of the
- old FFI_COMPAT values that might be used for 32-bit linux/sysv/bsd. */
- FFI_SYSV = 8,
- /* This and following bits can reuse FFI_COMPAT values. */
- FFI_SYSV_SOFT_FLOAT = 1,
- FFI_SYSV_STRUCT_RET = 2,
- FFI_SYSV_IBM_LONG_DOUBLE = 4,
- FFI_SYSV_LONG_DOUBLE_128 = 16,
-
- FFI_DEFAULT_ABI = (FFI_SYSV
-# ifdef __NO_FPRS__
- | FFI_SYSV_SOFT_FLOAT
-# endif
-# if (defined (__SVR4_STRUCT_RETURN) \
- || defined (POWERPC_FREEBSD) && !defined (__AIX_STRUCT_RETURN))
- | FFI_SYSV_STRUCT_RET
-# endif
-# if __LDBL_MANT_DIG__ == 106
- | FFI_SYSV_IBM_LONG_DOUBLE
-# endif
-# ifdef __LONG_DOUBLE_128__
- | FFI_SYSV_LONG_DOUBLE_128
-# endif
- ),
- FFI_LAST_ABI = 32
-# endif
-#endif
-
-} ffi_abi;
-#endif
-
-/* ---- Definitions for closures ----------------------------------------- */
-
-#define FFI_CLOSURES 1
-#define FFI_NATIVE_RAW_API 0
-#if defined (POWERPC) || defined (POWERPC_FREEBSD)
-# define FFI_TARGET_SPECIFIC_VARIADIC 1
-# define FFI_EXTRA_CIF_FIELDS unsigned nfixedargs
-#endif
-
-/* For additional types like the below, take care about the order in
- ppc_closures.S. They must follow after the FFI_TYPE_LAST. */
-
-/* Needed for soft-float long-double-128 support. */
-#define FFI_TYPE_UINT128 (FFI_TYPE_LAST + 1)
-
-/* Needed for FFI_SYSV small structure returns. */
-#define FFI_SYSV_TYPE_SMALL_STRUCT (FFI_TYPE_LAST + 2)
-
-/* Used by ELFv2 for homogenous structure returns. */
-#define FFI_V2_TYPE_FLOAT_HOMOG (FFI_TYPE_LAST + 1)
-#define FFI_V2_TYPE_DOUBLE_HOMOG (FFI_TYPE_LAST + 2)
-#define FFI_V2_TYPE_SMALL_STRUCT (FFI_TYPE_LAST + 3)
-
-#if _CALL_ELF == 2
-# define FFI_TRAMPOLINE_SIZE 32
-#else
-# if defined(POWERPC64) || defined(POWERPC_AIX)
-# if defined(POWERPC_DARWIN64)
-# define FFI_TRAMPOLINE_SIZE 48
-# else
-# define FFI_TRAMPOLINE_SIZE 24
-# endif
-# else /* POWERPC || POWERPC_AIX */
-# define FFI_TRAMPOLINE_SIZE 40
-# endif
-#endif
-
-#ifndef LIBFFI_ASM
-#if defined(POWERPC_DARWIN) || defined(POWERPC_AIX)
-struct ffi_aix_trampoline_struct {
- void * code_pointer; /* Pointer to ffi_closure_ASM */
- void * toc; /* TOC */
- void * static_chain; /* Pointer to closure */
-};
-#endif
-#endif
-
-#endif
diff --git a/Modules/_ctypes/libffi/src/powerpc/linux64.S b/Modules/_ctypes/libffi/src/powerpc/linux64.S
deleted file mode 100644
index c4d01d8e3f..0000000000
--- a/Modules/_ctypes/libffi/src/powerpc/linux64.S
+++ /dev/null
@@ -1,260 +0,0 @@
-/* -----------------------------------------------------------------------
- sysv.h - Copyright (c) 2003 Jakub Jelinek <jakub@redhat.com>
- Copyright (c) 2008 Red Hat, Inc.
-
- PowerPC64 Assembly glue.
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- ``Software''), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to
- permit persons to whom the Software is furnished to do so, subject to
- the following conditions:
-
- The above copyright notice and this permission notice shall be included
- in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- DEALINGS IN THE SOFTWARE.
- ----------------------------------------------------------------------- */
-
-#define LIBFFI_ASM
-#include <fficonfig.h>
-#include <ffi.h>
-
-#ifdef POWERPC64
- .hidden ffi_call_LINUX64
- .globl ffi_call_LINUX64
-# if _CALL_ELF == 2
- .text
-ffi_call_LINUX64:
- addis %r2, %r12, .TOC.-ffi_call_LINUX64@ha
- addi %r2, %r2, .TOC.-ffi_call_LINUX64@l
- .localentry ffi_call_LINUX64, . - ffi_call_LINUX64
-# else
- .section ".opd","aw"
- .align 3
-ffi_call_LINUX64:
-# ifdef _CALL_LINUX
- .quad .L.ffi_call_LINUX64,.TOC.@tocbase,0
- .type ffi_call_LINUX64,@function
- .text
-.L.ffi_call_LINUX64:
-# else
- .hidden .ffi_call_LINUX64
- .globl .ffi_call_LINUX64
- .quad .ffi_call_LINUX64,.TOC.@tocbase,0
- .size ffi_call_LINUX64,24
- .type .ffi_call_LINUX64,@function
- .text
-.ffi_call_LINUX64:
-# endif
-# endif
-.LFB1:
- mflr %r0
- std %r28, -32(%r1)
- std %r29, -24(%r1)
- std %r30, -16(%r1)
- std %r31, -8(%r1)
- std %r0, 16(%r1)
-
- mr %r28, %r1 /* our AP. */
-.LCFI0:
- stdux %r1, %r1, %r4
- mr %r31, %r5 /* flags, */
- mr %r30, %r6 /* rvalue, */
- mr %r29, %r7 /* function address. */
-/* Save toc pointer, not for the ffi_prep_args64 call, but for the later
- bctrl function call. */
-# if _CALL_ELF == 2
- std %r2, 24(%r1)
-# else
- std %r2, 40(%r1)
-# endif
-
- /* Call ffi_prep_args64. */
- mr %r4, %r1
-# if defined _CALL_LINUX || _CALL_ELF == 2
- bl ffi_prep_args64
-# else
- bl .ffi_prep_args64
-# endif
-
-# if _CALL_ELF == 2
- mr %r12, %r29
-# else
- ld %r12, 0(%r29)
- ld %r2, 8(%r29)
- ld %r11, 16(%r29)
-# endif
- /* Now do the call. */
- /* Set up cr1 with bits 4-7 of the flags. */
- mtcrf 0x40, %r31
-
- /* Get the address to call into CTR. */
- mtctr %r12
- /* Load all those argument registers. */
- ld %r3, -32-(8*8)(%r28)
- ld %r4, -32-(7*8)(%r28)
- ld %r5, -32-(6*8)(%r28)
- ld %r6, -32-(5*8)(%r28)
- bf- 5, 1f
- ld %r7, -32-(4*8)(%r28)
- ld %r8, -32-(3*8)(%r28)
- ld %r9, -32-(2*8)(%r28)
- ld %r10, -32-(1*8)(%r28)
-1:
-
- /* Load all the FP registers. */
- bf- 6, 2f
- lfd %f1, -32-(21*8)(%r28)
- lfd %f2, -32-(20*8)(%r28)
- lfd %f3, -32-(19*8)(%r28)
- lfd %f4, -32-(18*8)(%r28)
- lfd %f5, -32-(17*8)(%r28)
- lfd %f6, -32-(16*8)(%r28)
- lfd %f7, -32-(15*8)(%r28)
- lfd %f8, -32-(14*8)(%r28)
- lfd %f9, -32-(13*8)(%r28)
- lfd %f10, -32-(12*8)(%r28)
- lfd %f11, -32-(11*8)(%r28)
- lfd %f12, -32-(10*8)(%r28)
- lfd %f13, -32-(9*8)(%r28)
-2:
-
- /* Make the call. */
- bctrl
-
- /* This must follow the call immediately, the unwinder
- uses this to find out if r2 has been saved or not. */
-# if _CALL_ELF == 2
- ld %r2, 24(%r1)
-# else
- ld %r2, 40(%r1)
-# endif
-
- /* Now, deal with the return value. */
- mtcrf 0x01, %r31
- bt 31, .Lstruct_return_value
- bt 30, .Ldone_return_value
- bt 29, .Lfp_return_value
- std %r3, 0(%r30)
- /* Fall through... */
-
-.Ldone_return_value:
- /* Restore the registers we used and return. */
- mr %r1, %r28
- ld %r0, 16(%r28)
- ld %r28, -32(%r28)
- mtlr %r0
- ld %r29, -24(%r1)
- ld %r30, -16(%r1)
- ld %r31, -8(%r1)
- blr
-
-.Lfp_return_value:
- bf 28, .Lfloat_return_value
- stfd %f1, 0(%r30)
- mtcrf 0x02, %r31 /* cr6 */
- bf 27, .Ldone_return_value
- stfd %f2, 8(%r30)
- b .Ldone_return_value
-.Lfloat_return_value:
- stfs %f1, 0(%r30)
- b .Ldone_return_value
-
-.Lstruct_return_value:
- bf 29, .Lsmall_struct
- bf 28, .Lfloat_homog_return_value
- stfd %f1, 0(%r30)
- stfd %f2, 8(%r30)
- stfd %f3, 16(%r30)
- stfd %f4, 24(%r30)
- stfd %f5, 32(%r30)
- stfd %f6, 40(%r30)
- stfd %f7, 48(%r30)
- stfd %f8, 56(%r30)
- b .Ldone_return_value
-
-.Lfloat_homog_return_value:
- stfs %f1, 0(%r30)
- stfs %f2, 4(%r30)
- stfs %f3, 8(%r30)
- stfs %f4, 12(%r30)
- stfs %f5, 16(%r30)
- stfs %f6, 20(%r30)
- stfs %f7, 24(%r30)
- stfs %f8, 28(%r30)
- b .Ldone_return_value
-
-.Lsmall_struct:
- std %r3, 0(%r30)
- std %r4, 8(%r30)
- b .Ldone_return_value
-
-.LFE1:
- .long 0
- .byte 0,12,0,1,128,4,0,0
-# if _CALL_ELF == 2
- .size ffi_call_LINUX64,.-ffi_call_LINUX64
-# else
-# ifdef _CALL_LINUX
- .size ffi_call_LINUX64,.-.L.ffi_call_LINUX64
-# else
- .size .ffi_call_LINUX64,.-.ffi_call_LINUX64
-# endif
-# endif
-
- .section .eh_frame,EH_FRAME_FLAGS,@progbits
-.Lframe1:
- .4byte .LECIE1-.LSCIE1 # Length of Common Information Entry
-.LSCIE1:
- .4byte 0x0 # CIE Identifier Tag
- .byte 0x1 # CIE Version
- .ascii "zR\0" # CIE Augmentation
- .uleb128 0x1 # CIE Code Alignment Factor
- .sleb128 -8 # CIE Data Alignment Factor
- .byte 0x41 # CIE RA Column
- .uleb128 0x1 # Augmentation size
- .byte 0x14 # FDE Encoding (pcrel udata8)
- .byte 0xc # DW_CFA_def_cfa
- .uleb128 0x1
- .uleb128 0x0
- .align 3
-.LECIE1:
-.LSFDE1:
- .4byte .LEFDE1-.LASFDE1 # FDE Length
-.LASFDE1:
- .4byte .LASFDE1-.Lframe1 # FDE CIE offset
- .8byte .LFB1-. # FDE initial location
- .8byte .LFE1-.LFB1 # FDE address range
- .uleb128 0x0 # Augmentation size
- .byte 0x2 # DW_CFA_advance_loc1
- .byte .LCFI0-.LFB1
- .byte 0xd # DW_CFA_def_cfa_register
- .uleb128 0x1c
- .byte 0x11 # DW_CFA_offset_extended_sf
- .uleb128 0x41
- .sleb128 -2
- .byte 0x9f # DW_CFA_offset, column 0x1f
- .uleb128 0x1
- .byte 0x9e # DW_CFA_offset, column 0x1e
- .uleb128 0x2
- .byte 0x9d # DW_CFA_offset, column 0x1d
- .uleb128 0x3
- .byte 0x9c # DW_CFA_offset, column 0x1c
- .uleb128 0x4
- .align 3
-.LEFDE1:
-
-# if (defined __ELF__ && defined __linux__) || _CALL_ELF == 2
- .section .note.GNU-stack,"",@progbits
-# endif
-#endif
diff --git a/Modules/_ctypes/libffi/src/powerpc/linux64_closure.S b/Modules/_ctypes/libffi/src/powerpc/linux64_closure.S
deleted file mode 100644
index bc61b5ed94..0000000000
--- a/Modules/_ctypes/libffi/src/powerpc/linux64_closure.S
+++ /dev/null
@@ -1,391 +0,0 @@
-/* -----------------------------------------------------------------------
- sysv.h - Copyright (c) 2003 Jakub Jelinek <jakub@redhat.com>
- Copyright (c) 2008 Red Hat, Inc.
-
- PowerPC64 Assembly glue.
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- ``Software''), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to
- permit persons to whom the Software is furnished to do so, subject to
- the following conditions:
-
- The above copyright notice and this permission notice shall be included
- in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- DEALINGS IN THE SOFTWARE.
- ----------------------------------------------------------------------- */
-#define LIBFFI_ASM
-#include <fficonfig.h>
-#include <ffi.h>
-
- .file "linux64_closure.S"
-
-#ifdef POWERPC64
- FFI_HIDDEN (ffi_closure_LINUX64)
- .globl ffi_closure_LINUX64
-# if _CALL_ELF == 2
- .text
-ffi_closure_LINUX64:
- addis %r2, %r12, .TOC.-ffi_closure_LINUX64@ha
- addi %r2, %r2, .TOC.-ffi_closure_LINUX64@l
- .localentry ffi_closure_LINUX64, . - ffi_closure_LINUX64
-# else
- .section ".opd","aw"
- .align 3
-ffi_closure_LINUX64:
-# ifdef _CALL_LINUX
- .quad .L.ffi_closure_LINUX64,.TOC.@tocbase,0
- .type ffi_closure_LINUX64,@function
- .text
-.L.ffi_closure_LINUX64:
-# else
- FFI_HIDDEN (.ffi_closure_LINUX64)
- .globl .ffi_closure_LINUX64
- .quad .ffi_closure_LINUX64,.TOC.@tocbase,0
- .size ffi_closure_LINUX64,24
- .type .ffi_closure_LINUX64,@function
- .text
-.ffi_closure_LINUX64:
-# endif
-# endif
-
-# if _CALL_ELF == 2
-# 32 byte special reg save area + 64 byte parm save area
-# + 64 byte retval area + 13*8 fpr save area + round to 16
-# define STACKFRAME 272
-# define PARMSAVE 32
-# define RETVAL PARMSAVE+64
-# else
-# 48 bytes special reg save area + 64 bytes parm save area
-# + 16 bytes retval area + 13*8 bytes fpr save area + round to 16
-# define STACKFRAME 240
-# define PARMSAVE 48
-# define RETVAL PARMSAVE+64
-# endif
-
-.LFB1:
-# if _CALL_ELF == 2
- ld %r12, FFI_TRAMPOLINE_SIZE(%r11) # closure->cif
- mflr %r0
- lwz %r12, 28(%r12) # cif->flags
- mtcrf 0x40, %r12
- addi %r12, %r1, PARMSAVE
- bt 7, .Lparmsave
- # Our caller has not allocated a parameter save area.
- # We need to allocate one here and use it to pass gprs to
- # ffi_closure_helper_LINUX64.
- addi %r12, %r1, -STACKFRAME+PARMSAVE
-.Lparmsave:
- std %r0, 16(%r1)
- # Save general regs into parm save area
- std %r3, 0(%r12)
- std %r4, 8(%r12)
- std %r5, 16(%r12)
- std %r6, 24(%r12)
- std %r7, 32(%r12)
- std %r8, 40(%r12)
- std %r9, 48(%r12)
- std %r10, 56(%r12)
-
- # load up the pointer to the parm save area
- mr %r5, %r12
-# else
- # copy r2 to r11 and load TOC into r2
- mr %r11, %r2
- ld %r2, 16(%r11)
-
- mflr %r0
- # Save general regs into parm save area
- # This is the parameter save area set up by our caller.
- std %r3, PARMSAVE+0(%r1)
- std %r4, PARMSAVE+8(%r1)
- std %r5, PARMSAVE+16(%r1)
- std %r6, PARMSAVE+24(%r1)
- std %r7, PARMSAVE+32(%r1)
- std %r8, PARMSAVE+40(%r1)
- std %r9, PARMSAVE+48(%r1)
- std %r10, PARMSAVE+56(%r1)
-
- std %r0, 16(%r1)
-
- # load up the pointer to the parm save area
- addi %r5, %r1, PARMSAVE
-# endif
-
- # next save fpr 1 to fpr 13
- stfd %f1, -104+(0*8)(%r1)
- stfd %f2, -104+(1*8)(%r1)
- stfd %f3, -104+(2*8)(%r1)
- stfd %f4, -104+(3*8)(%r1)
- stfd %f5, -104+(4*8)(%r1)
- stfd %f6, -104+(5*8)(%r1)
- stfd %f7, -104+(6*8)(%r1)
- stfd %f8, -104+(7*8)(%r1)
- stfd %f9, -104+(8*8)(%r1)
- stfd %f10, -104+(9*8)(%r1)
- stfd %f11, -104+(10*8)(%r1)
- stfd %f12, -104+(11*8)(%r1)
- stfd %f13, -104+(12*8)(%r1)
-
- # load up the pointer to the saved fpr registers */
- addi %r6, %r1, -104
-
- # load up the pointer to the result storage
- addi %r4, %r1, -STACKFRAME+RETVAL
-
- stdu %r1, -STACKFRAME(%r1)
-.LCFI0:
-
- # get the context pointer from the trampoline
- mr %r3, %r11
-
- # make the call
-# if defined _CALL_LINUX || _CALL_ELF == 2
- bl ffi_closure_helper_LINUX64
-# else
- bl .ffi_closure_helper_LINUX64
-# endif
-.Lret:
-
- # now r3 contains the return type
- # so use it to look up in a table
- # so we know how to deal with each type
-
- # look up the proper starting point in table
- # by using return type as offset
- ld %r0, STACKFRAME+16(%r1)
- cmpldi %r3, FFI_V2_TYPE_SMALL_STRUCT
- bge .Lsmall
- mflr %r4 # move address of .Lret to r4
- sldi %r3, %r3, 4 # now multiply return type by 16
- addi %r4, %r4, .Lret_type0 - .Lret
- add %r3, %r3, %r4 # add contents of table to table address
- mtctr %r3
- bctr # jump to it
-
-# Each of the ret_typeX code fragments has to be exactly 16 bytes long
-# (4 instructions). For cache effectiveness we align to a 16 byte boundary
-# first.
- .align 4
-
-.Lret_type0:
-# case FFI_TYPE_VOID
- mtlr %r0
- addi %r1, %r1, STACKFRAME
- blr
- nop
-# case FFI_TYPE_INT
-# ifdef __LITTLE_ENDIAN__
- lwa %r3, RETVAL+0(%r1)
-# else
- lwa %r3, RETVAL+4(%r1)
-# endif
- mtlr %r0
- addi %r1, %r1, STACKFRAME
- blr
-# case FFI_TYPE_FLOAT
- lfs %f1, RETVAL+0(%r1)
- mtlr %r0
- addi %r1, %r1, STACKFRAME
- blr
-# case FFI_TYPE_DOUBLE
- lfd %f1, RETVAL+0(%r1)
- mtlr %r0
- addi %r1, %r1, STACKFRAME
- blr
-# case FFI_TYPE_LONGDOUBLE
- lfd %f1, RETVAL+0(%r1)
- mtlr %r0
- lfd %f2, RETVAL+8(%r1)
- b .Lfinish
-# case FFI_TYPE_UINT8
-# ifdef __LITTLE_ENDIAN__
- lbz %r3, RETVAL+0(%r1)
-# else
- lbz %r3, RETVAL+7(%r1)
-# endif
- mtlr %r0
- addi %r1, %r1, STACKFRAME
- blr
-# case FFI_TYPE_SINT8
-# ifdef __LITTLE_ENDIAN__
- lbz %r3, RETVAL+0(%r1)
-# else
- lbz %r3, RETVAL+7(%r1)
-# endif
- extsb %r3,%r3
- mtlr %r0
- b .Lfinish
-# case FFI_TYPE_UINT16
-# ifdef __LITTLE_ENDIAN__
- lhz %r3, RETVAL+0(%r1)
-# else
- lhz %r3, RETVAL+6(%r1)
-# endif
- mtlr %r0
-.Lfinish:
- addi %r1, %r1, STACKFRAME
- blr
-# case FFI_TYPE_SINT16
-# ifdef __LITTLE_ENDIAN__
- lha %r3, RETVAL+0(%r1)
-# else
- lha %r3, RETVAL+6(%r1)
-# endif
- mtlr %r0
- addi %r1, %r1, STACKFRAME
- blr
-# case FFI_TYPE_UINT32
-# ifdef __LITTLE_ENDIAN__
- lwz %r3, RETVAL+0(%r1)
-# else
- lwz %r3, RETVAL+4(%r1)
-# endif
- mtlr %r0
- addi %r1, %r1, STACKFRAME
- blr
-# case FFI_TYPE_SINT32
-# ifdef __LITTLE_ENDIAN__
- lwa %r3, RETVAL+0(%r1)
-# else
- lwa %r3, RETVAL+4(%r1)
-# endif
- mtlr %r0
- addi %r1, %r1, STACKFRAME
- blr
-# case FFI_TYPE_UINT64
- ld %r3, RETVAL+0(%r1)
- mtlr %r0
- addi %r1, %r1, STACKFRAME
- blr
-# case FFI_TYPE_SINT64
- ld %r3, RETVAL+0(%r1)
- mtlr %r0
- addi %r1, %r1, STACKFRAME
- blr
-# case FFI_TYPE_STRUCT
- mtlr %r0
- addi %r1, %r1, STACKFRAME
- blr
- nop
-# case FFI_TYPE_POINTER
- ld %r3, RETVAL+0(%r1)
- mtlr %r0
- addi %r1, %r1, STACKFRAME
- blr
-# case FFI_V2_TYPE_FLOAT_HOMOG
- lfs %f1, RETVAL+0(%r1)
- lfs %f2, RETVAL+4(%r1)
- lfs %f3, RETVAL+8(%r1)
- b .Lmorefloat
-# case FFI_V2_TYPE_DOUBLE_HOMOG
- lfd %f1, RETVAL+0(%r1)
- lfd %f2, RETVAL+8(%r1)
- lfd %f3, RETVAL+16(%r1)
- lfd %f4, RETVAL+24(%r1)
- mtlr %r0
- lfd %f5, RETVAL+32(%r1)
- lfd %f6, RETVAL+40(%r1)
- lfd %f7, RETVAL+48(%r1)
- lfd %f8, RETVAL+56(%r1)
- addi %r1, %r1, STACKFRAME
- blr
-.Lmorefloat:
- lfs %f4, RETVAL+12(%r1)
- mtlr %r0
- lfs %f5, RETVAL+16(%r1)
- lfs %f6, RETVAL+20(%r1)
- lfs %f7, RETVAL+24(%r1)
- lfs %f8, RETVAL+28(%r1)
- addi %r1, %r1, STACKFRAME
- blr
-.Lsmall:
-# ifdef __LITTLE_ENDIAN__
- ld %r3,RETVAL+0(%r1)
- mtlr %r0
- ld %r4,RETVAL+8(%r1)
- addi %r1, %r1, STACKFRAME
- blr
-# else
- # A struct smaller than a dword is returned in the low bits of r3
- # ie. right justified. Larger structs are passed left justified
- # in r3 and r4. The return value area on the stack will have
- # the structs as they are usually stored in memory.
- cmpldi %r3, FFI_V2_TYPE_SMALL_STRUCT + 7 # size 8 bytes?
- neg %r5, %r3
- ld %r3,RETVAL+0(%r1)
- blt .Lsmalldown
- mtlr %r0
- ld %r4,RETVAL+8(%r1)
- addi %r1, %r1, STACKFRAME
- blr
-.Lsmalldown:
- addi %r5, %r5, FFI_V2_TYPE_SMALL_STRUCT + 7
- mtlr %r0
- sldi %r5, %r5, 3
- addi %r1, %r1, STACKFRAME
- srd %r3, %r3, %r5
- blr
-# endif
-
-.LFE1:
- .long 0
- .byte 0,12,0,1,128,0,0,0
-# if _CALL_ELF == 2
- .size ffi_closure_LINUX64,.-ffi_closure_LINUX64
-# else
-# ifdef _CALL_LINUX
- .size ffi_closure_LINUX64,.-.L.ffi_closure_LINUX64
-# else
- .size .ffi_closure_LINUX64,.-.ffi_closure_LINUX64
-# endif
-# endif
-
- .section .eh_frame,EH_FRAME_FLAGS,@progbits
-.Lframe1:
- .4byte .LECIE1-.LSCIE1 # Length of Common Information Entry
-.LSCIE1:
- .4byte 0x0 # CIE Identifier Tag
- .byte 0x1 # CIE Version
- .ascii "zR\0" # CIE Augmentation
- .uleb128 0x1 # CIE Code Alignment Factor
- .sleb128 -8 # CIE Data Alignment Factor
- .byte 0x41 # CIE RA Column
- .uleb128 0x1 # Augmentation size
- .byte 0x14 # FDE Encoding (pcrel udata8)
- .byte 0xc # DW_CFA_def_cfa
- .uleb128 0x1
- .uleb128 0x0
- .align 3
-.LECIE1:
-.LSFDE1:
- .4byte .LEFDE1-.LASFDE1 # FDE Length
-.LASFDE1:
- .4byte .LASFDE1-.Lframe1 # FDE CIE offset
- .8byte .LFB1-. # FDE initial location
- .8byte .LFE1-.LFB1 # FDE address range
- .uleb128 0x0 # Augmentation size
- .byte 0x2 # DW_CFA_advance_loc1
- .byte .LCFI0-.LFB1
- .byte 0xe # DW_CFA_def_cfa_offset
- .uleb128 STACKFRAME
- .byte 0x11 # DW_CFA_offset_extended_sf
- .uleb128 0x41
- .sleb128 -2
- .align 3
-.LEFDE1:
-
-# if defined __ELF__ && defined __linux__
- .section .note.GNU-stack,"",@progbits
-# endif
-#endif
diff --git a/Modules/_ctypes/libffi/src/powerpc/ppc_closure.S b/Modules/_ctypes/libffi/src/powerpc/ppc_closure.S
deleted file mode 100644
index 075922cbb0..0000000000
--- a/Modules/_ctypes/libffi/src/powerpc/ppc_closure.S
+++ /dev/null
@@ -1,384 +0,0 @@
-/* -----------------------------------------------------------------------
- sysv.h - Copyright (c) 2003 Jakub Jelinek <jakub@redhat.com>
- Copyright (c) 2008 Red Hat, Inc.
-
- PowerPC Assembly glue.
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- ``Software''), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to
- permit persons to whom the Software is furnished to do so, subject to
- the following conditions:
-
- The above copyright notice and this permission notice shall be included
- in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- DEALINGS IN THE SOFTWARE.
- ----------------------------------------------------------------------- */
-#define LIBFFI_ASM
-#include <fficonfig.h>
-#include <ffi.h>
-#include <powerpc/asm.h>
-
- .file "ppc_closure.S"
-
-#ifndef POWERPC64
-
-ENTRY(ffi_closure_SYSV)
-.LFB1:
- stwu %r1,-144(%r1)
-.LCFI0:
- mflr %r0
-.LCFI1:
- stw %r0,148(%r1)
-
-# we want to build up an areas for the parameters passed
-# in registers (both floating point and integer)
-
- # so first save gpr 3 to gpr 10 (aligned to 4)
- stw %r3, 16(%r1)
- stw %r4, 20(%r1)
- stw %r5, 24(%r1)
- stw %r6, 28(%r1)
- stw %r7, 32(%r1)
- stw %r8, 36(%r1)
- stw %r9, 40(%r1)
- stw %r10,44(%r1)
-
-#ifndef __NO_FPRS__
- # next save fpr 1 to fpr 8 (aligned to 8)
- stfd %f1, 48(%r1)
- stfd %f2, 56(%r1)
- stfd %f3, 64(%r1)
- stfd %f4, 72(%r1)
- stfd %f5, 80(%r1)
- stfd %f6, 88(%r1)
- stfd %f7, 96(%r1)
- stfd %f8, 104(%r1)
-#endif
-
- # set up registers for the routine that actually does the work
- # get the context pointer from the trampoline
- mr %r3,%r11
-
- # now load up the pointer to the result storage
- addi %r4,%r1,112
-
- # now load up the pointer to the saved gpr registers
- addi %r5,%r1,16
-
- # now load up the pointer to the saved fpr registers */
- addi %r6,%r1,48
-
- # now load up the pointer to the outgoing parameter
- # stack in the previous frame
- # i.e. the previous frame pointer + 8
- addi %r7,%r1,152
-
- # make the call
- bl ffi_closure_helper_SYSV@local
-.Lret:
- # now r3 contains the return type
- # so use it to look up in a table
- # so we know how to deal with each type
-
- # look up the proper starting point in table
- # by using return type as offset
-
- mflr %r4 # move address of .Lret to r4
- slwi %r3,%r3,4 # now multiply return type by 16
- addi %r4, %r4, .Lret_type0 - .Lret
- lwz %r0,148(%r1)
- add %r3,%r3,%r4 # add contents of table to table address
- mtctr %r3
- bctr # jump to it
-.LFE1:
-
-# Each of the ret_typeX code fragments has to be exactly 16 bytes long
-# (4 instructions). For cache effectiveness we align to a 16 byte boundary
-# first.
- .align 4
-# case FFI_TYPE_VOID
-.Lret_type0:
- mtlr %r0
- addi %r1,%r1,144
- blr
- nop
-
-# case FFI_TYPE_INT
- lwz %r3,112+0(%r1)
- mtlr %r0
-.Lfinish:
- addi %r1,%r1,144
- blr
-
-# case FFI_TYPE_FLOAT
-#ifndef __NO_FPRS__
- lfs %f1,112+0(%r1)
- mtlr %r0
- addi %r1,%r1,144
-#else
- nop
- nop
- nop
-#endif
- blr
-
-# case FFI_TYPE_DOUBLE
-#ifndef __NO_FPRS__
- lfd %f1,112+0(%r1)
- mtlr %r0
- addi %r1,%r1,144
-#else
- nop
- nop
- nop
-#endif
- blr
-
-# case FFI_TYPE_LONGDOUBLE
-#ifndef __NO_FPRS__
- lfd %f1,112+0(%r1)
- lfd %f2,112+8(%r1)
- mtlr %r0
- b .Lfinish
-#else
- nop
- nop
- nop
- blr
-#endif
-
-# case FFI_TYPE_UINT8
-#ifdef __LITTLE_ENDIAN__
- lbz %r3,112+0(%r1)
-#else
- lbz %r3,112+3(%r1)
-#endif
- mtlr %r0
- addi %r1,%r1,144
- blr
-
-# case FFI_TYPE_SINT8
-#ifdef __LITTLE_ENDIAN__
- lbz %r3,112+0(%r1)
-#else
- lbz %r3,112+3(%r1)
-#endif
- extsb %r3,%r3
- mtlr %r0
- b .Lfinish
-
-# case FFI_TYPE_UINT16
-#ifdef __LITTLE_ENDIAN__
- lhz %r3,112+0(%r1)
-#else
- lhz %r3,112+2(%r1)
-#endif
- mtlr %r0
- addi %r1,%r1,144
- blr
-
-# case FFI_TYPE_SINT16
-#ifdef __LITTLE_ENDIAN__
- lha %r3,112+0(%r1)
-#else
- lha %r3,112+2(%r1)
-#endif
- mtlr %r0
- addi %r1,%r1,144
- blr
-
-# case FFI_TYPE_UINT32
- lwz %r3,112+0(%r1)
- mtlr %r0
- addi %r1,%r1,144
- blr
-
-# case FFI_TYPE_SINT32
- lwz %r3,112+0(%r1)
- mtlr %r0
- addi %r1,%r1,144
- blr
-
-# case FFI_TYPE_UINT64
- lwz %r3,112+0(%r1)
- lwz %r4,112+4(%r1)
- mtlr %r0
- b .Lfinish
-
-# case FFI_TYPE_SINT64
- lwz %r3,112+0(%r1)
- lwz %r4,112+4(%r1)
- mtlr %r0
- b .Lfinish
-
-# case FFI_TYPE_STRUCT
- mtlr %r0
- addi %r1,%r1,144
- blr
- nop
-
-# case FFI_TYPE_POINTER
- lwz %r3,112+0(%r1)
- mtlr %r0
- addi %r1,%r1,144
- blr
-
-# case FFI_TYPE_UINT128
- lwz %r3,112+0(%r1)
- lwz %r4,112+4(%r1)
- lwz %r5,112+8(%r1)
- b .Luint128
-
-# The return types below are only used when the ABI type is FFI_SYSV.
-# case FFI_SYSV_TYPE_SMALL_STRUCT + 1. One byte struct.
- lbz %r3,112+0(%r1)
- mtlr %r0
- addi %r1,%r1,144
- blr
-
-# case FFI_SYSV_TYPE_SMALL_STRUCT + 2. Two byte struct.
- lhz %r3,112+0(%r1)
- mtlr %r0
- addi %r1,%r1,144
- blr
-
-# case FFI_SYSV_TYPE_SMALL_STRUCT + 3. Three byte struct.
- lwz %r3,112+0(%r1)
-#ifdef __LITTLE_ENDIAN__
- mtlr %r0
- addi %r1,%r1,144
- blr
-#else
- srwi %r3,%r3,8
- mtlr %r0
- b .Lfinish
-#endif
-
-# case FFI_SYSV_TYPE_SMALL_STRUCT + 4. Four byte struct.
- lwz %r3,112+0(%r1)
- mtlr %r0
- addi %r1,%r1,144
- blr
-
-# case FFI_SYSV_TYPE_SMALL_STRUCT + 5. Five byte struct.
- lwz %r3,112+0(%r1)
- lwz %r4,112+4(%r1)
-#ifdef __LITTLE_ENDIAN__
- mtlr %r0
- b .Lfinish
-#else
- li %r5,24
- b .Lstruct567
-#endif
-
-# case FFI_SYSV_TYPE_SMALL_STRUCT + 6. Six byte struct.
- lwz %r3,112+0(%r1)
- lwz %r4,112+4(%r1)
-#ifdef __LITTLE_ENDIAN__
- mtlr %r0
- b .Lfinish
-#else
- li %r5,16
- b .Lstruct567
-#endif
-
-# case FFI_SYSV_TYPE_SMALL_STRUCT + 7. Seven byte struct.
- lwz %r3,112+0(%r1)
- lwz %r4,112+4(%r1)
-#ifdef __LITTLE_ENDIAN__
- mtlr %r0
- b .Lfinish
-#else
- li %r5,8
- b .Lstruct567
-#endif
-
-# case FFI_SYSV_TYPE_SMALL_STRUCT + 8. Eight byte struct.
- lwz %r3,112+0(%r1)
- lwz %r4,112+4(%r1)
- mtlr %r0
- b .Lfinish
-
-#ifndef __LITTLE_ENDIAN__
-.Lstruct567:
- subfic %r6,%r5,32
- srw %r4,%r4,%r5
- slw %r6,%r3,%r6
- srw %r3,%r3,%r5
- or %r4,%r6,%r4
- mtlr %r0
- addi %r1,%r1,144
- blr
-#endif
-
-.Luint128:
- lwz %r6,112+12(%r1)
- mtlr %r0
- addi %r1,%r1,144
- blr
-
-END(ffi_closure_SYSV)
-
- .section ".eh_frame",EH_FRAME_FLAGS,@progbits
-.Lframe1:
- .4byte .LECIE1-.LSCIE1 # Length of Common Information Entry
-.LSCIE1:
- .4byte 0x0 # CIE Identifier Tag
- .byte 0x1 # CIE Version
-#if defined _RELOCATABLE || defined __PIC__
- .ascii "zR\0" # CIE Augmentation
-#else
- .ascii "\0" # CIE Augmentation
-#endif
- .uleb128 0x1 # CIE Code Alignment Factor
- .sleb128 -4 # CIE Data Alignment Factor
- .byte 0x41 # CIE RA Column
-#if defined _RELOCATABLE || defined __PIC__
- .uleb128 0x1 # Augmentation size
- .byte 0x1b # FDE Encoding (pcrel sdata4)
-#endif
- .byte 0xc # DW_CFA_def_cfa
- .uleb128 0x1
- .uleb128 0x0
- .align 2
-.LECIE1:
-.LSFDE1:
- .4byte .LEFDE1-.LASFDE1 # FDE Length
-.LASFDE1:
- .4byte .LASFDE1-.Lframe1 # FDE CIE offset
-#if defined _RELOCATABLE || defined __PIC__
- .4byte .LFB1-. # FDE initial location
-#else
- .4byte .LFB1 # FDE initial location
-#endif
- .4byte .LFE1-.LFB1 # FDE address range
-#if defined _RELOCATABLE || defined __PIC__
- .uleb128 0x0 # Augmentation size
-#endif
- .byte 0x4 # DW_CFA_advance_loc4
- .4byte .LCFI0-.LFB1
- .byte 0xe # DW_CFA_def_cfa_offset
- .uleb128 144
- .byte 0x4 # DW_CFA_advance_loc4
- .4byte .LCFI1-.LCFI0
- .byte 0x11 # DW_CFA_offset_extended_sf
- .uleb128 0x41
- .sleb128 -1
- .align 2
-.LEFDE1:
-
-#if defined __ELF__ && defined __linux__
- .section .note.GNU-stack,"",@progbits
-#endif
-#endif
diff --git a/Modules/_ctypes/libffi/src/powerpc/sysv.S b/Modules/_ctypes/libffi/src/powerpc/sysv.S
deleted file mode 100644
index fed2380c9f..0000000000
--- a/Modules/_ctypes/libffi/src/powerpc/sysv.S
+++ /dev/null
@@ -1,220 +0,0 @@
-/* -----------------------------------------------------------------------
- sysv.S - Copyright (c) 1998 Geoffrey Keating
- Copyright (C) 2007 Free Software Foundation, Inc
-
- PowerPC Assembly glue.
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- ``Software''), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to
- permit persons to whom the Software is furnished to do so, subject to
- the following conditions:
-
- The above copyright notice and this permission notice shall be included
- in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- DEALINGS IN THE SOFTWARE.
- ----------------------------------------------------------------------- */
-
-#define LIBFFI_ASM
-#include <fficonfig.h>
-#include <ffi.h>
-#include <powerpc/asm.h>
-
-#ifndef POWERPC64
- .globl ffi_prep_args_SYSV
-ENTRY(ffi_call_SYSV)
-.LFB1:
- /* Save the old stack pointer as AP. */
- mr %r8,%r1
-
-.LCFI0:
- /* Allocate the stack space we need. */
- stwux %r1,%r1,%r4
- /* Save registers we use. */
- mflr %r9
- stw %r28,-16(%r8)
-.LCFI1:
- stw %r29,-12(%r8)
-.LCFI2:
- stw %r30, -8(%r8)
-.LCFI3:
- stw %r31, -4(%r8)
-.LCFI4:
- stw %r9, 4(%r8)
-.LCFI5:
-
- /* Save arguments over call... */
- mr %r31,%r5 /* flags, */
- mr %r30,%r6 /* rvalue, */
- mr %r29,%r7 /* function address, */
- mr %r28,%r8 /* our AP. */
-.LCFI6:
-
- /* Call ffi_prep_args_SYSV. */
- mr %r4,%r1
- bl ffi_prep_args_SYSV@local
-
- /* Now do the call. */
- /* Set up cr1 with bits 4-7 of the flags. */
- mtcrf 0x40,%r31
- /* Get the address to call into CTR. */
- mtctr %r29
- /* Load all those argument registers. */
- lwz %r3,-16-(8*4)(%r28)
- lwz %r4,-16-(7*4)(%r28)
- lwz %r5,-16-(6*4)(%r28)
- lwz %r6,-16-(5*4)(%r28)
- bf- 5,1f
- nop
- lwz %r7,-16-(4*4)(%r28)
- lwz %r8,-16-(3*4)(%r28)
- lwz %r9,-16-(2*4)(%r28)
- lwz %r10,-16-(1*4)(%r28)
- nop
-1:
-
-#ifndef __NO_FPRS__
- /* Load all the FP registers. */
- bf- 6,2f
- lfd %f1,-16-(8*4)-(8*8)(%r28)
- lfd %f2,-16-(8*4)-(7*8)(%r28)
- lfd %f3,-16-(8*4)-(6*8)(%r28)
- lfd %f4,-16-(8*4)-(5*8)(%r28)
- nop
- lfd %f5,-16-(8*4)-(4*8)(%r28)
- lfd %f6,-16-(8*4)-(3*8)(%r28)
- lfd %f7,-16-(8*4)-(2*8)(%r28)
- lfd %f8,-16-(8*4)-(1*8)(%r28)
-#endif
-2:
-
- /* Make the call. */
- bctrl
-
- /* Now, deal with the return value. */
- mtcrf 0x01,%r31 /* cr7 */
- bt- 31,L(small_struct_return_value)
- bt- 30,L(done_return_value)
-#ifndef __NO_FPRS__
- bt- 29,L(fp_return_value)
-#endif
- stw %r3,0(%r30)
- bf+ 28,L(done_return_value)
- stw %r4,4(%r30)
- mtcrf 0x02,%r31 /* cr6 */
- bf 27,L(done_return_value)
- stw %r5,8(%r30)
- stw %r6,12(%r30)
- /* Fall through... */
-
-L(done_return_value):
- /* Restore the registers we used and return. */
- lwz %r9, 4(%r28)
- lwz %r31, -4(%r28)
- mtlr %r9
- lwz %r30, -8(%r28)
- lwz %r29,-12(%r28)
- lwz %r28,-16(%r28)
- lwz %r1,0(%r1)
- blr
-
-#ifndef __NO_FPRS__
-L(fp_return_value):
- bf 28,L(float_return_value)
- stfd %f1,0(%r30)
- mtcrf 0x02,%r31 /* cr6 */
- bf 27,L(done_return_value)
- stfd %f2,8(%r30)
- b L(done_return_value)
-L(float_return_value):
- stfs %f1,0(%r30)
- b L(done_return_value)
-#endif
-
-L(small_struct_return_value):
- /*
- * The C code always allocates a properly-aligned 8-byte bounce
- * buffer to make this assembly code very simple. Just write out
- * r3 and r4 to the buffer to allow the C code to handle the rest.
- */
- stw %r3, 0(%r30)
- stw %r4, 4(%r30)
- b L(done_return_value)
-
-.LFE1:
-END(ffi_call_SYSV)
-
- .section ".eh_frame",EH_FRAME_FLAGS,@progbits
-.Lframe1:
- .4byte .LECIE1-.LSCIE1 /* Length of Common Information Entry */
-.LSCIE1:
- .4byte 0x0 /* CIE Identifier Tag */
- .byte 0x1 /* CIE Version */
-#if defined _RELOCATABLE || defined __PIC__
- .ascii "zR\0" /* CIE Augmentation */
-#else
- .ascii "\0" /* CIE Augmentation */
-#endif
- .uleb128 0x1 /* CIE Code Alignment Factor */
- .sleb128 -4 /* CIE Data Alignment Factor */
- .byte 0x41 /* CIE RA Column */
-#if defined _RELOCATABLE || defined __PIC__
- .uleb128 0x1 /* Augmentation size */
- .byte 0x1b /* FDE Encoding (pcrel sdata4) */
-#endif
- .byte 0xc /* DW_CFA_def_cfa */
- .uleb128 0x1
- .uleb128 0x0
- .align 2
-.LECIE1:
-.LSFDE1:
- .4byte .LEFDE1-.LASFDE1 /* FDE Length */
-.LASFDE1:
- .4byte .LASFDE1-.Lframe1 /* FDE CIE offset */
-#if defined _RELOCATABLE || defined __PIC__
- .4byte .LFB1-. /* FDE initial location */
-#else
- .4byte .LFB1 /* FDE initial location */
-#endif
- .4byte .LFE1-.LFB1 /* FDE address range */
-#if defined _RELOCATABLE || defined __PIC__
- .uleb128 0x0 /* Augmentation size */
-#endif
- .byte 0x4 /* DW_CFA_advance_loc4 */
- .4byte .LCFI0-.LFB1
- .byte 0xd /* DW_CFA_def_cfa_register */
- .uleb128 0x08
- .byte 0x4 /* DW_CFA_advance_loc4 */
- .4byte .LCFI5-.LCFI0
- .byte 0x11 /* DW_CFA_offset_extended_sf */
- .uleb128 0x41
- .sleb128 -1
- .byte 0x9f /* DW_CFA_offset, column 0x1f */
- .uleb128 0x1
- .byte 0x9e /* DW_CFA_offset, column 0x1e */
- .uleb128 0x2
- .byte 0x9d /* DW_CFA_offset, column 0x1d */
- .uleb128 0x3
- .byte 0x9c /* DW_CFA_offset, column 0x1c */
- .uleb128 0x4
- .byte 0x4 /* DW_CFA_advance_loc4 */
- .4byte .LCFI6-.LCFI5
- .byte 0xd /* DW_CFA_def_cfa_register */
- .uleb128 0x1c
- .align 2
-.LEFDE1:
-
-#if defined __ELF__ && defined __linux__
- .section .note.GNU-stack,"",@progbits
-#endif
-#endif
diff --git a/Modules/_ctypes/libffi/src/prep_cif.c b/Modules/_ctypes/libffi/src/prep_cif.c
deleted file mode 100644
index 55ceed8c5e..0000000000
--- a/Modules/_ctypes/libffi/src/prep_cif.c
+++ /dev/null
@@ -1,245 +0,0 @@
-/* -----------------------------------------------------------------------
- prep_cif.c - Copyright (c) 2011, 2012 Anthony Green
- Copyright (c) 1996, 1998, 2007 Red Hat, Inc.
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- ``Software''), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to
- permit persons to whom the Software is furnished to do so, subject to
- the following conditions:
-
- The above copyright notice and this permission notice shall be included
- in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- DEALINGS IN THE SOFTWARE.
- ----------------------------------------------------------------------- */
-
-#include <ffi.h>
-#include <ffi_common.h>
-#include <stdlib.h>
-
-/* Round up to FFI_SIZEOF_ARG. */
-
-#define STACK_ARG_SIZE(x) ALIGN(x, FFI_SIZEOF_ARG)
-
-/* Perform machine independent initialization of aggregate type
- specifications. */
-
-static ffi_status initialize_aggregate(ffi_type *arg)
-{
- ffi_type **ptr;
-
- if (UNLIKELY(arg == NULL || arg->elements == NULL))
- return FFI_BAD_TYPEDEF;
-
- arg->size = 0;
- arg->alignment = 0;
-
- ptr = &(arg->elements[0]);
-
- if (UNLIKELY(ptr == 0))
- return FFI_BAD_TYPEDEF;
-
- while ((*ptr) != NULL)
- {
- if (UNLIKELY(((*ptr)->size == 0)
- && (initialize_aggregate((*ptr)) != FFI_OK)))
- return FFI_BAD_TYPEDEF;
-
- /* Perform a sanity check on the argument type */
- FFI_ASSERT_VALID_TYPE(*ptr);
-
- arg->size = ALIGN(arg->size, (*ptr)->alignment);
- arg->size += (*ptr)->size;
-
- arg->alignment = (arg->alignment > (*ptr)->alignment) ?
- arg->alignment : (*ptr)->alignment;
-
- ptr++;
- }
-
- /* Structure size includes tail padding. This is important for
- structures that fit in one register on ABIs like the PowerPC64
- Linux ABI that right justify small structs in a register.
- It's also needed for nested structure layout, for example
- struct A { long a; char b; }; struct B { struct A x; char y; };
- should find y at an offset of 2*sizeof(long) and result in a
- total size of 3*sizeof(long). */
- arg->size = ALIGN (arg->size, arg->alignment);
-
- /* On some targets, the ABI defines that structures have an additional
- alignment beyond the "natural" one based on their elements. */
-#ifdef FFI_AGGREGATE_ALIGNMENT
- if (FFI_AGGREGATE_ALIGNMENT > arg->alignment)
- arg->alignment = FFI_AGGREGATE_ALIGNMENT;
-#endif
-
- if (arg->size == 0)
- return FFI_BAD_TYPEDEF;
- else
- return FFI_OK;
-}
-
-#ifndef __CRIS__
-/* The CRIS ABI specifies structure elements to have byte
- alignment only, so it completely overrides this functions,
- which assumes "natural" alignment and padding. */
-
-/* Perform machine independent ffi_cif preparation, then call
- machine dependent routine. */
-
-/* For non variadic functions isvariadic should be 0 and
- nfixedargs==ntotalargs.
-
- For variadic calls, isvariadic should be 1 and nfixedargs
- and ntotalargs set as appropriate. nfixedargs must always be >=1 */
-
-
-ffi_status FFI_HIDDEN ffi_prep_cif_core(ffi_cif *cif, ffi_abi abi,
- unsigned int isvariadic,
- unsigned int nfixedargs,
- unsigned int ntotalargs,
- ffi_type *rtype, ffi_type **atypes)
-{
- unsigned bytes = 0;
- unsigned int i;
- ffi_type **ptr;
-
- FFI_ASSERT(cif != NULL);
- FFI_ASSERT((!isvariadic) || (nfixedargs >= 1));
- FFI_ASSERT(nfixedargs <= ntotalargs);
-
- if (! (abi > FFI_FIRST_ABI && abi < FFI_LAST_ABI))
- return FFI_BAD_ABI;
-
- cif->abi = abi;
- cif->arg_types = atypes;
- cif->nargs = ntotalargs;
- cif->rtype = rtype;
-
- cif->flags = 0;
-
-#if HAVE_LONG_DOUBLE_VARIANT
- ffi_prep_types (abi);
-#endif
-
- /* Initialize the return type if necessary */
- if ((cif->rtype->size == 0) && (initialize_aggregate(cif->rtype) != FFI_OK))
- return FFI_BAD_TYPEDEF;
-
- /* Perform a sanity check on the return type */
- FFI_ASSERT_VALID_TYPE(cif->rtype);
-
- /* x86, x86-64 and s390 stack space allocation is handled in prep_machdep. */
-#if !defined M68K && !defined X86_ANY && !defined S390 && !defined PA
- /* Make space for the return structure pointer */
- if (cif->rtype->type == FFI_TYPE_STRUCT
-#ifdef SPARC
- && (cif->abi != FFI_V9 || cif->rtype->size > 32)
-#endif
-#ifdef TILE
- && (cif->rtype->size > 10 * FFI_SIZEOF_ARG)
-#endif
-#ifdef XTENSA
- && (cif->rtype->size > 16)
-#endif
-#ifdef NIOS2
- && (cif->rtype->size > 8)
-#endif
- )
- bytes = STACK_ARG_SIZE(sizeof(void*));
-#endif
-
- for (ptr = cif->arg_types, i = cif->nargs; i > 0; i--, ptr++)
- {
-
- /* Initialize any uninitialized aggregate type definitions */
- if (((*ptr)->size == 0) && (initialize_aggregate((*ptr)) != FFI_OK))
- return FFI_BAD_TYPEDEF;
-
- /* Perform a sanity check on the argument type, do this
- check after the initialization. */
- FFI_ASSERT_VALID_TYPE(*ptr);
-
-#if !defined X86_ANY && !defined S390 && !defined PA
-#ifdef SPARC
- if (((*ptr)->type == FFI_TYPE_STRUCT
- && ((*ptr)->size > 16 || cif->abi != FFI_V9))
- || ((*ptr)->type == FFI_TYPE_LONGDOUBLE
- && cif->abi != FFI_V9))
- bytes += sizeof(void*);
- else
-#endif
- {
- /* Add any padding if necessary */
- if (((*ptr)->alignment - 1) & bytes)
- bytes = (unsigned)ALIGN(bytes, (*ptr)->alignment);
-
-#ifdef TILE
- if (bytes < 10 * FFI_SIZEOF_ARG &&
- bytes + STACK_ARG_SIZE((*ptr)->size) > 10 * FFI_SIZEOF_ARG)
- {
- /* An argument is never split between the 10 parameter
- registers and the stack. */
- bytes = 10 * FFI_SIZEOF_ARG;
- }
-#endif
-#ifdef XTENSA
- if (bytes <= 6*4 && bytes + STACK_ARG_SIZE((*ptr)->size) > 6*4)
- bytes = 6*4;
-#endif
-
- bytes += STACK_ARG_SIZE((*ptr)->size);
- }
-#endif
- }
-
- cif->bytes = bytes;
-
- /* Perform machine dependent cif processing */
-#ifdef FFI_TARGET_SPECIFIC_VARIADIC
- if (isvariadic)
- return ffi_prep_cif_machdep_var(cif, nfixedargs, ntotalargs);
-#endif
-
- return ffi_prep_cif_machdep(cif);
-}
-#endif /* not __CRIS__ */
-
-ffi_status ffi_prep_cif(ffi_cif *cif, ffi_abi abi, unsigned int nargs,
- ffi_type *rtype, ffi_type **atypes)
-{
- return ffi_prep_cif_core(cif, abi, 0, nargs, nargs, rtype, atypes);
-}
-
-ffi_status ffi_prep_cif_var(ffi_cif *cif,
- ffi_abi abi,
- unsigned int nfixedargs,
- unsigned int ntotalargs,
- ffi_type *rtype,
- ffi_type **atypes)
-{
- return ffi_prep_cif_core(cif, abi, 1, nfixedargs, ntotalargs, rtype, atypes);
-}
-
-#if FFI_CLOSURES
-
-ffi_status
-ffi_prep_closure (ffi_closure* closure,
- ffi_cif* cif,
- void (*fun)(ffi_cif*,void*,void**,void*),
- void *user_data)
-{
- return ffi_prep_closure_loc (closure, cif, fun, user_data, closure);
-}
-
-#endif
diff --git a/Modules/_ctypes/libffi/src/raw_api.c b/Modules/_ctypes/libffi/src/raw_api.c
deleted file mode 100644
index ce21372e29..0000000000
--- a/Modules/_ctypes/libffi/src/raw_api.c
+++ /dev/null
@@ -1,254 +0,0 @@
-/* -----------------------------------------------------------------------
- raw_api.c - Copyright (c) 1999, 2008 Red Hat, Inc.
-
- Author: Kresten Krab Thorup <krab@gnu.org>
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- ``Software''), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to
- permit persons to whom the Software is furnished to do so, subject to
- the following conditions:
-
- The above copyright notice and this permission notice shall be included
- in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- DEALINGS IN THE SOFTWARE.
- ----------------------------------------------------------------------- */
-
-/* This file defines generic functions for use with the raw api. */
-
-#include <ffi.h>
-#include <ffi_common.h>
-
-#if !FFI_NO_RAW_API
-
-size_t
-ffi_raw_size (ffi_cif *cif)
-{
- size_t result = 0;
- int i;
-
- ffi_type **at = cif->arg_types;
-
- for (i = cif->nargs-1; i >= 0; i--, at++)
- {
-#if !FFI_NO_STRUCTS
- if ((*at)->type == FFI_TYPE_STRUCT)
- result += ALIGN (sizeof (void*), FFI_SIZEOF_ARG);
- else
-#endif
- result += ALIGN ((*at)->size, FFI_SIZEOF_ARG);
- }
-
- return result;
-}
-
-
-void
-ffi_raw_to_ptrarray (ffi_cif *cif, ffi_raw *raw, void **args)
-{
- unsigned i;
- ffi_type **tp = cif->arg_types;
-
-#if WORDS_BIGENDIAN
-
- for (i = 0; i < cif->nargs; i++, tp++, args++)
- {
- switch ((*tp)->type)
- {
- case FFI_TYPE_UINT8:
- case FFI_TYPE_SINT8:
- *args = (void*) ((char*)(raw++) + FFI_SIZEOF_ARG - 1);
- break;
-
- case FFI_TYPE_UINT16:
- case FFI_TYPE_SINT16:
- *args = (void*) ((char*)(raw++) + FFI_SIZEOF_ARG - 2);
- break;
-
-#if FFI_SIZEOF_ARG >= 4
- case FFI_TYPE_UINT32:
- case FFI_TYPE_SINT32:
- *args = (void*) ((char*)(raw++) + FFI_SIZEOF_ARG - 4);
- break;
-#endif
-
-#if !FFI_NO_STRUCTS
- case FFI_TYPE_STRUCT:
- *args = (raw++)->ptr;
- break;
-#endif
-
- case FFI_TYPE_POINTER:
- *args = (void*) &(raw++)->ptr;
- break;
-
- default:
- *args = raw;
- raw += ALIGN ((*tp)->size, FFI_SIZEOF_ARG) / FFI_SIZEOF_ARG;
- }
- }
-
-#else /* WORDS_BIGENDIAN */
-
-#if !PDP
-
- /* then assume little endian */
- for (i = 0; i < cif->nargs; i++, tp++, args++)
- {
-#if !FFI_NO_STRUCTS
- if ((*tp)->type == FFI_TYPE_STRUCT)
- {
- *args = (raw++)->ptr;
- }
- else
-#endif
- {
- *args = (void*) raw;
- raw += ALIGN ((*tp)->size, sizeof (void*)) / sizeof (void*);
- }
- }
-
-#else
-#error "pdp endian not supported"
-#endif /* ! PDP */
-
-#endif /* WORDS_BIGENDIAN */
-}
-
-void
-ffi_ptrarray_to_raw (ffi_cif *cif, void **args, ffi_raw *raw)
-{
- unsigned i;
- ffi_type **tp = cif->arg_types;
-
- for (i = 0; i < cif->nargs; i++, tp++, args++)
- {
- switch ((*tp)->type)
- {
- case FFI_TYPE_UINT8:
- (raw++)->uint = *(UINT8*) (*args);
- break;
-
- case FFI_TYPE_SINT8:
- (raw++)->sint = *(SINT8*) (*args);
- break;
-
- case FFI_TYPE_UINT16:
- (raw++)->uint = *(UINT16*) (*args);
- break;
-
- case FFI_TYPE_SINT16:
- (raw++)->sint = *(SINT16*) (*args);
- break;
-
-#if FFI_SIZEOF_ARG >= 4
- case FFI_TYPE_UINT32:
- (raw++)->uint = *(UINT32*) (*args);
- break;
-
- case FFI_TYPE_SINT32:
- (raw++)->sint = *(SINT32*) (*args);
- break;
-#endif
-
-#if !FFI_NO_STRUCTS
- case FFI_TYPE_STRUCT:
- (raw++)->ptr = *args;
- break;
-#endif
-
- case FFI_TYPE_POINTER:
- (raw++)->ptr = **(void***) args;
- break;
-
- default:
- memcpy ((void*) raw->data, (void*)*args, (*tp)->size);
- raw += ALIGN ((*tp)->size, FFI_SIZEOF_ARG) / FFI_SIZEOF_ARG;
- }
- }
-}
-
-#if !FFI_NATIVE_RAW_API
-
-
-/* This is a generic definition of ffi_raw_call, to be used if the
- * native system does not provide a machine-specific implementation.
- * Having this, allows code to be written for the raw API, without
- * the need for system-specific code to handle input in that format;
- * these following couple of functions will handle the translation forth
- * and back automatically. */
-
-void ffi_raw_call (ffi_cif *cif, void (*fn)(void), void *rvalue, ffi_raw *raw)
-{
- void **avalue = (void**) alloca (cif->nargs * sizeof (void*));
- ffi_raw_to_ptrarray (cif, raw, avalue);
- ffi_call (cif, fn, rvalue, avalue);
-}
-
-#if FFI_CLOSURES /* base system provides closures */
-
-static void
-ffi_translate_args (ffi_cif *cif, void *rvalue,
- void **avalue, void *user_data)
-{
- ffi_raw *raw = (ffi_raw*)alloca (ffi_raw_size (cif));
- ffi_raw_closure *cl = (ffi_raw_closure*)user_data;
-
- ffi_ptrarray_to_raw (cif, avalue, raw);
- (*cl->fun) (cif, rvalue, raw, cl->user_data);
-}
-
-ffi_status
-ffi_prep_raw_closure_loc (ffi_raw_closure* cl,
- ffi_cif *cif,
- void (*fun)(ffi_cif*,void*,ffi_raw*,void*),
- void *user_data,
- void *codeloc)
-{
- ffi_status status;
-
- status = ffi_prep_closure_loc ((ffi_closure*) cl,
- cif,
- &ffi_translate_args,
- codeloc,
- codeloc);
- if (status == FFI_OK)
- {
- cl->fun = fun;
- cl->user_data = user_data;
- }
-
- return status;
-}
-
-#endif /* FFI_CLOSURES */
-#endif /* !FFI_NATIVE_RAW_API */
-
-#if FFI_CLOSURES
-
-/* Again, here is the generic version of ffi_prep_raw_closure, which
- * will install an intermediate "hub" for translation of arguments from
- * the pointer-array format, to the raw format */
-
-ffi_status
-ffi_prep_raw_closure (ffi_raw_closure* cl,
- ffi_cif *cif,
- void (*fun)(ffi_cif*,void*,ffi_raw*,void*),
- void *user_data)
-{
- return ffi_prep_raw_closure_loc (cl, cif, fun, user_data, cl);
-}
-
-#endif /* FFI_CLOSURES */
-
-#endif /* !FFI_NO_RAW_API */
diff --git a/Modules/_ctypes/libffi/src/s390/ffi.c b/Modules/_ctypes/libffi/src/s390/ffi.c
deleted file mode 100644
index 8adb5bc0ba..0000000000
--- a/Modules/_ctypes/libffi/src/s390/ffi.c
+++ /dev/null
@@ -1,781 +0,0 @@
-/* -----------------------------------------------------------------------
- ffi.c - Copyright (c) 2000, 2007 Software AG
- Copyright (c) 2008 Red Hat, Inc
-
- S390 Foreign Function Interface
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- ``Software''), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to
- permit persons to whom the Software is furnished to do so, subject to
- the following conditions:
-
- The above copyright notice and this permission notice shall be included
- in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS
- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR
- OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- OTHER DEALINGS IN THE SOFTWARE.
- ----------------------------------------------------------------------- */
-/*====================================================================*/
-/* Includes */
-/* -------- */
-/*====================================================================*/
-
-#include <ffi.h>
-#include <ffi_common.h>
-
-#include <stdlib.h>
-#include <stdio.h>
-
-/*====================== End of Includes =============================*/
-
-/*====================================================================*/
-/* Defines */
-/* ------- */
-/*====================================================================*/
-
-/* Maximum number of GPRs available for argument passing. */
-#define MAX_GPRARGS 5
-
-/* Maximum number of FPRs available for argument passing. */
-#ifdef __s390x__
-#define MAX_FPRARGS 4
-#else
-#define MAX_FPRARGS 2
-#endif
-
-/* Round to multiple of 16. */
-#define ROUND_SIZE(size) (((size) + 15) & ~15)
-
-/* If these values change, sysv.S must be adapted! */
-#define FFI390_RET_VOID 0
-#define FFI390_RET_STRUCT 1
-#define FFI390_RET_FLOAT 2
-#define FFI390_RET_DOUBLE 3
-#define FFI390_RET_INT32 4
-#define FFI390_RET_INT64 5
-
-/*===================== End of Defines ===============================*/
-
-/*====================================================================*/
-/* Prototypes */
-/* ---------- */
-/*====================================================================*/
-
-static void ffi_prep_args (unsigned char *, extended_cif *);
-void
-#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 2)
-__attribute__ ((visibility ("hidden")))
-#endif
-ffi_closure_helper_SYSV (ffi_closure *, unsigned long *,
- unsigned long long *, unsigned long *);
-
-/*====================== End of Prototypes ===========================*/
-
-/*====================================================================*/
-/* Externals */
-/* --------- */
-/*====================================================================*/
-
-extern void ffi_call_SYSV(unsigned,
- extended_cif *,
- void (*)(unsigned char *, extended_cif *),
- unsigned,
- void *,
- void (*fn)(void));
-
-extern void ffi_closure_SYSV(void);
-
-/*====================== End of Externals ============================*/
-
-/*====================================================================*/
-/* */
-/* Name - ffi_check_struct_type. */
-/* */
-/* Function - Determine if a structure can be passed within a */
-/* general purpose or floating point register. */
-/* */
-/*====================================================================*/
-
-static int
-ffi_check_struct_type (ffi_type *arg)
-{
- size_t size = arg->size;
-
- /* If the struct has just one element, look at that element
- to find out whether to consider the struct as floating point. */
- while (arg->type == FFI_TYPE_STRUCT
- && arg->elements[0] && !arg->elements[1])
- arg = arg->elements[0];
-
- /* Structs of size 1, 2, 4, and 8 are passed in registers,
- just like the corresponding int/float types. */
- switch (size)
- {
- case 1:
- return FFI_TYPE_UINT8;
-
- case 2:
- return FFI_TYPE_UINT16;
-
- case 4:
- if (arg->type == FFI_TYPE_FLOAT)
- return FFI_TYPE_FLOAT;
- else
- return FFI_TYPE_UINT32;
-
- case 8:
- if (arg->type == FFI_TYPE_DOUBLE)
- return FFI_TYPE_DOUBLE;
- else
- return FFI_TYPE_UINT64;
-
- default:
- break;
- }
-
- /* Other structs are passed via a pointer to the data. */
- return FFI_TYPE_POINTER;
-}
-
-/*======================== End of Routine ============================*/
-
-/*====================================================================*/
-/* */
-/* Name - ffi_prep_args. */
-/* */
-/* Function - Prepare parameters for call to function. */
-/* */
-/* ffi_prep_args is called by the assembly routine once stack space */
-/* has been allocated for the function's arguments. */
-/* */
-/*====================================================================*/
-
-static void
-ffi_prep_args (unsigned char *stack, extended_cif *ecif)
-{
- /* The stack space will be filled with those areas:
-
- FPR argument register save area (highest addresses)
- GPR argument register save area
- temporary struct copies
- overflow argument area (lowest addresses)
-
- We set up the following pointers:
-
- p_fpr: bottom of the FPR area (growing upwards)
- p_gpr: bottom of the GPR area (growing upwards)
- p_ov: bottom of the overflow area (growing upwards)
- p_struct: top of the struct copy area (growing downwards)
-
- All areas are kept aligned to twice the word size. */
-
- int gpr_off = ecif->cif->bytes;
- int fpr_off = gpr_off + ROUND_SIZE (MAX_GPRARGS * sizeof (long));
-
- unsigned long long *p_fpr = (unsigned long long *)(stack + fpr_off);
- unsigned long *p_gpr = (unsigned long *)(stack + gpr_off);
- unsigned char *p_struct = (unsigned char *)p_gpr;
- unsigned long *p_ov = (unsigned long *)stack;
-
- int n_fpr = 0;
- int n_gpr = 0;
- int n_ov = 0;
-
- ffi_type **ptr;
- void **p_argv = ecif->avalue;
- int i;
-
- /* If we returning a structure then we set the first parameter register
- to the address of where we are returning this structure. */
-
- if (ecif->cif->flags == FFI390_RET_STRUCT)
- p_gpr[n_gpr++] = (unsigned long) ecif->rvalue;
-
- /* Now for the arguments. */
-
- for (ptr = ecif->cif->arg_types, i = ecif->cif->nargs;
- i > 0;
- i--, ptr++, p_argv++)
- {
- void *arg = *p_argv;
- int type = (*ptr)->type;
-
-#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE
- /* 16-byte long double is passed like a struct. */
- if (type == FFI_TYPE_LONGDOUBLE)
- type = FFI_TYPE_STRUCT;
-#endif
-
- /* Check how a structure type is passed. */
- if (type == FFI_TYPE_STRUCT)
- {
- type = ffi_check_struct_type (*ptr);
-
- /* If we pass the struct via pointer, copy the data. */
- if (type == FFI_TYPE_POINTER)
- {
- p_struct -= ROUND_SIZE ((*ptr)->size);
- memcpy (p_struct, (char *)arg, (*ptr)->size);
- arg = &p_struct;
- }
- }
-
- /* Now handle all primitive int/pointer/float data types. */
- switch (type)
- {
- case FFI_TYPE_DOUBLE:
- if (n_fpr < MAX_FPRARGS)
- p_fpr[n_fpr++] = *(unsigned long long *) arg;
- else
-#ifdef __s390x__
- p_ov[n_ov++] = *(unsigned long *) arg;
-#else
- p_ov[n_ov++] = ((unsigned long *) arg)[0],
- p_ov[n_ov++] = ((unsigned long *) arg)[1];
-#endif
- break;
-
- case FFI_TYPE_FLOAT:
- if (n_fpr < MAX_FPRARGS)
- p_fpr[n_fpr++] = (long long) *(unsigned int *) arg << 32;
- else
- p_ov[n_ov++] = *(unsigned int *) arg;
- break;
-
- case FFI_TYPE_POINTER:
- if (n_gpr < MAX_GPRARGS)
- p_gpr[n_gpr++] = (unsigned long)*(unsigned char **) arg;
- else
- p_ov[n_ov++] = (unsigned long)*(unsigned char **) arg;
- break;
-
- case FFI_TYPE_UINT64:
- case FFI_TYPE_SINT64:
-#ifdef __s390x__
- if (n_gpr < MAX_GPRARGS)
- p_gpr[n_gpr++] = *(unsigned long *) arg;
- else
- p_ov[n_ov++] = *(unsigned long *) arg;
-#else
- if (n_gpr == MAX_GPRARGS-1)
- n_gpr = MAX_GPRARGS;
- if (n_gpr < MAX_GPRARGS)
- p_gpr[n_gpr++] = ((unsigned long *) arg)[0],
- p_gpr[n_gpr++] = ((unsigned long *) arg)[1];
- else
- p_ov[n_ov++] = ((unsigned long *) arg)[0],
- p_ov[n_ov++] = ((unsigned long *) arg)[1];
-#endif
- break;
-
- case FFI_TYPE_UINT32:
- if (n_gpr < MAX_GPRARGS)
- p_gpr[n_gpr++] = *(unsigned int *) arg;
- else
- p_ov[n_ov++] = *(unsigned int *) arg;
- break;
-
- case FFI_TYPE_INT:
- case FFI_TYPE_SINT32:
- if (n_gpr < MAX_GPRARGS)
- p_gpr[n_gpr++] = *(signed int *) arg;
- else
- p_ov[n_ov++] = *(signed int *) arg;
- break;
-
- case FFI_TYPE_UINT16:
- if (n_gpr < MAX_GPRARGS)
- p_gpr[n_gpr++] = *(unsigned short *) arg;
- else
- p_ov[n_ov++] = *(unsigned short *) arg;
- break;
-
- case FFI_TYPE_SINT16:
- if (n_gpr < MAX_GPRARGS)
- p_gpr[n_gpr++] = *(signed short *) arg;
- else
- p_ov[n_ov++] = *(signed short *) arg;
- break;
-
- case FFI_TYPE_UINT8:
- if (n_gpr < MAX_GPRARGS)
- p_gpr[n_gpr++] = *(unsigned char *) arg;
- else
- p_ov[n_ov++] = *(unsigned char *) arg;
- break;
-
- case FFI_TYPE_SINT8:
- if (n_gpr < MAX_GPRARGS)
- p_gpr[n_gpr++] = *(signed char *) arg;
- else
- p_ov[n_ov++] = *(signed char *) arg;
- break;
-
- default:
- FFI_ASSERT (0);
- break;
- }
- }
-}
-
-/*======================== End of Routine ============================*/
-
-/*====================================================================*/
-/* */
-/* Name - ffi_prep_cif_machdep. */
-/* */
-/* Function - Perform machine dependent CIF processing. */
-/* */
-/*====================================================================*/
-
-ffi_status
-ffi_prep_cif_machdep(ffi_cif *cif)
-{
- size_t struct_size = 0;
- int n_gpr = 0;
- int n_fpr = 0;
- int n_ov = 0;
-
- ffi_type **ptr;
- int i;
-
- /* Determine return value handling. */
-
- switch (cif->rtype->type)
- {
- /* Void is easy. */
- case FFI_TYPE_VOID:
- cif->flags = FFI390_RET_VOID;
- break;
-
- /* Structures are returned via a hidden pointer. */
- case FFI_TYPE_STRUCT:
- cif->flags = FFI390_RET_STRUCT;
- n_gpr++; /* We need one GPR to pass the pointer. */
- break;
-
- /* Floating point values are returned in fpr 0. */
- case FFI_TYPE_FLOAT:
- cif->flags = FFI390_RET_FLOAT;
- break;
-
- case FFI_TYPE_DOUBLE:
- cif->flags = FFI390_RET_DOUBLE;
- break;
-
-#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE
- case FFI_TYPE_LONGDOUBLE:
- cif->flags = FFI390_RET_STRUCT;
- n_gpr++;
- break;
-#endif
- /* Integer values are returned in gpr 2 (and gpr 3
- for 64-bit values on 31-bit machines). */
- case FFI_TYPE_UINT64:
- case FFI_TYPE_SINT64:
- cif->flags = FFI390_RET_INT64;
- break;
-
- case FFI_TYPE_POINTER:
- case FFI_TYPE_INT:
- case FFI_TYPE_UINT32:
- case FFI_TYPE_SINT32:
- case FFI_TYPE_UINT16:
- case FFI_TYPE_SINT16:
- case FFI_TYPE_UINT8:
- case FFI_TYPE_SINT8:
- /* These are to be extended to word size. */
-#ifdef __s390x__
- cif->flags = FFI390_RET_INT64;
-#else
- cif->flags = FFI390_RET_INT32;
-#endif
- break;
-
- default:
- FFI_ASSERT (0);
- break;
- }
-
- /* Now for the arguments. */
-
- for (ptr = cif->arg_types, i = cif->nargs;
- i > 0;
- i--, ptr++)
- {
- int type = (*ptr)->type;
-
-#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE
- /* 16-byte long double is passed like a struct. */
- if (type == FFI_TYPE_LONGDOUBLE)
- type = FFI_TYPE_STRUCT;
-#endif
-
- /* Check how a structure type is passed. */
- if (type == FFI_TYPE_STRUCT)
- {
- type = ffi_check_struct_type (*ptr);
-
- /* If we pass the struct via pointer, we must reserve space
- to copy its data for proper call-by-value semantics. */
- if (type == FFI_TYPE_POINTER)
- struct_size += ROUND_SIZE ((*ptr)->size);
- }
-
- /* Now handle all primitive int/float data types. */
- switch (type)
- {
- /* The first MAX_FPRARGS floating point arguments
- go in FPRs, the rest overflow to the stack. */
-
- case FFI_TYPE_DOUBLE:
- if (n_fpr < MAX_FPRARGS)
- n_fpr++;
- else
- n_ov += sizeof (double) / sizeof (long);
- break;
-
- case FFI_TYPE_FLOAT:
- if (n_fpr < MAX_FPRARGS)
- n_fpr++;
- else
- n_ov++;
- break;
-
- /* On 31-bit machines, 64-bit integers are passed in GPR pairs,
- if one is still available, or else on the stack. If only one
- register is free, skip the register (it won't be used for any
- subsequent argument either). */
-
-#ifndef __s390x__
- case FFI_TYPE_UINT64:
- case FFI_TYPE_SINT64:
- if (n_gpr == MAX_GPRARGS-1)
- n_gpr = MAX_GPRARGS;
- if (n_gpr < MAX_GPRARGS)
- n_gpr += 2;
- else
- n_ov += 2;
- break;
-#endif
-
- /* Everything else is passed in GPRs (until MAX_GPRARGS
- have been used) or overflows to the stack. */
-
- default:
- if (n_gpr < MAX_GPRARGS)
- n_gpr++;
- else
- n_ov++;
- break;
- }
- }
-
- /* Total stack space as required for overflow arguments
- and temporary structure copies. */
-
- cif->bytes = ROUND_SIZE (n_ov * sizeof (long)) + struct_size;
-
- return FFI_OK;
-}
-
-/*======================== End of Routine ============================*/
-
-/*====================================================================*/
-/* */
-/* Name - ffi_call. */
-/* */
-/* Function - Call the FFI routine. */
-/* */
-/*====================================================================*/
-
-void
-ffi_call(ffi_cif *cif,
- void (*fn)(void),
- void *rvalue,
- void **avalue)
-{
- int ret_type = cif->flags;
- extended_cif ecif;
-
- ecif.cif = cif;
- ecif.avalue = avalue;
- ecif.rvalue = rvalue;
-
- /* If we don't have a return value, we need to fake one. */
- if (rvalue == NULL)
- {
- if (ret_type == FFI390_RET_STRUCT)
- ecif.rvalue = alloca (cif->rtype->size);
- else
- ret_type = FFI390_RET_VOID;
- }
-
- switch (cif->abi)
- {
- case FFI_SYSV:
- ffi_call_SYSV (cif->bytes, &ecif, ffi_prep_args,
- ret_type, ecif.rvalue, fn);
- break;
-
- default:
- FFI_ASSERT (0);
- break;
- }
-}
-
-/*======================== End of Routine ============================*/
-
-/*====================================================================*/
-/* */
-/* Name - ffi_closure_helper_SYSV. */
-/* */
-/* Function - Call a FFI closure target function. */
-/* */
-/*====================================================================*/
-
-void
-ffi_closure_helper_SYSV (ffi_closure *closure,
- unsigned long *p_gpr,
- unsigned long long *p_fpr,
- unsigned long *p_ov)
-{
- unsigned long long ret_buffer;
-
- void *rvalue = &ret_buffer;
- void **avalue;
- void **p_arg;
-
- int n_gpr = 0;
- int n_fpr = 0;
- int n_ov = 0;
-
- ffi_type **ptr;
- int i;
-
- /* Allocate buffer for argument list pointers. */
-
- p_arg = avalue = alloca (closure->cif->nargs * sizeof (void *));
-
- /* If we returning a structure, pass the structure address
- directly to the target function. Otherwise, have the target
- function store the return value to the GPR save area. */
-
- if (closure->cif->flags == FFI390_RET_STRUCT)
- rvalue = (void *) p_gpr[n_gpr++];
-
- /* Now for the arguments. */
-
- for (ptr = closure->cif->arg_types, i = closure->cif->nargs;
- i > 0;
- i--, p_arg++, ptr++)
- {
- int deref_struct_pointer = 0;
- int type = (*ptr)->type;
-
-#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE
- /* 16-byte long double is passed like a struct. */
- if (type == FFI_TYPE_LONGDOUBLE)
- type = FFI_TYPE_STRUCT;
-#endif
-
- /* Check how a structure type is passed. */
- if (type == FFI_TYPE_STRUCT)
- {
- type = ffi_check_struct_type (*ptr);
-
- /* If we pass the struct via pointer, remember to
- retrieve the pointer later. */
- if (type == FFI_TYPE_POINTER)
- deref_struct_pointer = 1;
- }
-
- /* Pointers are passed like UINTs of the same size. */
- if (type == FFI_TYPE_POINTER)
-#ifdef __s390x__
- type = FFI_TYPE_UINT64;
-#else
- type = FFI_TYPE_UINT32;
-#endif
-
- /* Now handle all primitive int/float data types. */
- switch (type)
- {
- case FFI_TYPE_DOUBLE:
- if (n_fpr < MAX_FPRARGS)
- *p_arg = &p_fpr[n_fpr++];
- else
- *p_arg = &p_ov[n_ov],
- n_ov += sizeof (double) / sizeof (long);
- break;
-
- case FFI_TYPE_FLOAT:
- if (n_fpr < MAX_FPRARGS)
- *p_arg = &p_fpr[n_fpr++];
- else
- *p_arg = (char *)&p_ov[n_ov++] + sizeof (long) - 4;
- break;
-
- case FFI_TYPE_UINT64:
- case FFI_TYPE_SINT64:
-#ifdef __s390x__
- if (n_gpr < MAX_GPRARGS)
- *p_arg = &p_gpr[n_gpr++];
- else
- *p_arg = &p_ov[n_ov++];
-#else
- if (n_gpr == MAX_GPRARGS-1)
- n_gpr = MAX_GPRARGS;
- if (n_gpr < MAX_GPRARGS)
- *p_arg = &p_gpr[n_gpr], n_gpr += 2;
- else
- *p_arg = &p_ov[n_ov], n_ov += 2;
-#endif
- break;
-
- case FFI_TYPE_INT:
- case FFI_TYPE_UINT32:
- case FFI_TYPE_SINT32:
- if (n_gpr < MAX_GPRARGS)
- *p_arg = (char *)&p_gpr[n_gpr++] + sizeof (long) - 4;
- else
- *p_arg = (char *)&p_ov[n_ov++] + sizeof (long) - 4;
- break;
-
- case FFI_TYPE_UINT16:
- case FFI_TYPE_SINT16:
- if (n_gpr < MAX_GPRARGS)
- *p_arg = (char *)&p_gpr[n_gpr++] + sizeof (long) - 2;
- else
- *p_arg = (char *)&p_ov[n_ov++] + sizeof (long) - 2;
- break;
-
- case FFI_TYPE_UINT8:
- case FFI_TYPE_SINT8:
- if (n_gpr < MAX_GPRARGS)
- *p_arg = (char *)&p_gpr[n_gpr++] + sizeof (long) - 1;
- else
- *p_arg = (char *)&p_ov[n_ov++] + sizeof (long) - 1;
- break;
-
- default:
- FFI_ASSERT (0);
- break;
- }
-
- /* If this is a struct passed via pointer, we need to
- actually retrieve that pointer. */
- if (deref_struct_pointer)
- *p_arg = *(void **)*p_arg;
- }
-
-
- /* Call the target function. */
- (closure->fun) (closure->cif, rvalue, avalue, closure->user_data);
-
- /* Convert the return value. */
- switch (closure->cif->rtype->type)
- {
- /* Void is easy, and so is struct. */
- case FFI_TYPE_VOID:
- case FFI_TYPE_STRUCT:
-#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE
- case FFI_TYPE_LONGDOUBLE:
-#endif
- break;
-
- /* Floating point values are returned in fpr 0. */
- case FFI_TYPE_FLOAT:
- p_fpr[0] = (long long) *(unsigned int *) rvalue << 32;
- break;
-
- case FFI_TYPE_DOUBLE:
- p_fpr[0] = *(unsigned long long *) rvalue;
- break;
-
- /* Integer values are returned in gpr 2 (and gpr 3
- for 64-bit values on 31-bit machines). */
- case FFI_TYPE_UINT64:
- case FFI_TYPE_SINT64:
-#ifdef __s390x__
- p_gpr[0] = *(unsigned long *) rvalue;
-#else
- p_gpr[0] = ((unsigned long *) rvalue)[0],
- p_gpr[1] = ((unsigned long *) rvalue)[1];
-#endif
- break;
-
- case FFI_TYPE_POINTER:
- case FFI_TYPE_UINT32:
- case FFI_TYPE_UINT16:
- case FFI_TYPE_UINT8:
- p_gpr[0] = *(unsigned long *) rvalue;
- break;
-
- case FFI_TYPE_INT:
- case FFI_TYPE_SINT32:
- case FFI_TYPE_SINT16:
- case FFI_TYPE_SINT8:
- p_gpr[0] = *(signed long *) rvalue;
- break;
-
- default:
- FFI_ASSERT (0);
- break;
- }
-}
-
-/*======================== End of Routine ============================*/
-
-/*====================================================================*/
-/* */
-/* Name - ffi_prep_closure_loc. */
-/* */
-/* Function - Prepare a FFI closure. */
-/* */
-/*====================================================================*/
-
-ffi_status
-ffi_prep_closure_loc (ffi_closure *closure,
- ffi_cif *cif,
- void (*fun) (ffi_cif *, void *, void **, void *),
- void *user_data,
- void *codeloc)
-{
- if (cif->abi != FFI_SYSV)
- return FFI_BAD_ABI;
-
-#ifndef __s390x__
- *(short *)&closure->tramp [0] = 0x0d10; /* basr %r1,0 */
- *(short *)&closure->tramp [2] = 0x9801; /* lm %r0,%r1,6(%r1) */
- *(short *)&closure->tramp [4] = 0x1006;
- *(short *)&closure->tramp [6] = 0x07f1; /* br %r1 */
- *(long *)&closure->tramp [8] = (long)codeloc;
- *(long *)&closure->tramp[12] = (long)&ffi_closure_SYSV;
-#else
- *(short *)&closure->tramp [0] = 0x0d10; /* basr %r1,0 */
- *(short *)&closure->tramp [2] = 0xeb01; /* lmg %r0,%r1,14(%r1) */
- *(short *)&closure->tramp [4] = 0x100e;
- *(short *)&closure->tramp [6] = 0x0004;
- *(short *)&closure->tramp [8] = 0x07f1; /* br %r1 */
- *(long *)&closure->tramp[16] = (long)codeloc;
- *(long *)&closure->tramp[24] = (long)&ffi_closure_SYSV;
-#endif
-
- closure->cif = cif;
- closure->user_data = user_data;
- closure->fun = fun;
-
- return FFI_OK;
-}
-
-/*======================== End of Routine ============================*/
-
diff --git a/Modules/_ctypes/libffi/src/s390/ffitarget.h b/Modules/_ctypes/libffi/src/s390/ffitarget.h
deleted file mode 100644
index 97fa5c4b67..0000000000
--- a/Modules/_ctypes/libffi/src/s390/ffitarget.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/* -----------------------------------------------------------------*-C-*-
- ffitarget.h - Copyright (c) 2012 Anthony Green
- Copyright (c) 1996-2003 Red Hat, Inc.
- Target configuration macros for S390.
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- ``Software''), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to
- permit persons to whom the Software is furnished to do so, subject to
- the following conditions:
-
- The above copyright notice and this permission notice shall be included
- in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- DEALINGS IN THE SOFTWARE.
-
- ----------------------------------------------------------------------- */
-
-#ifndef LIBFFI_TARGET_H
-#define LIBFFI_TARGET_H
-
-#ifndef LIBFFI_H
-#error "Please do not include ffitarget.h directly into your source. Use ffi.h instead."
-#endif
-
-#if defined (__s390x__)
-#ifndef S390X
-#define S390X
-#endif
-#endif
-
-/* ---- System specific configurations ----------------------------------- */
-
-#ifndef LIBFFI_ASM
-typedef unsigned long ffi_arg;
-typedef signed long ffi_sarg;
-
-typedef enum ffi_abi {
- FFI_FIRST_ABI = 0,
- FFI_SYSV,
- FFI_LAST_ABI,
- FFI_DEFAULT_ABI = FFI_SYSV
-} ffi_abi;
-#endif
-
-
-/* ---- Definitions for closures ----------------------------------------- */
-
-#define FFI_CLOSURES 1
-#ifdef S390X
-#define FFI_TRAMPOLINE_SIZE 32
-#else
-#define FFI_TRAMPOLINE_SIZE 16
-#endif
-#define FFI_NATIVE_RAW_API 0
-
-#endif
-
diff --git a/Modules/_ctypes/libffi/src/s390/sysv.S b/Modules/_ctypes/libffi/src/s390/sysv.S
deleted file mode 100644
index 4731a3177b..0000000000
--- a/Modules/_ctypes/libffi/src/s390/sysv.S
+++ /dev/null
@@ -1,434 +0,0 @@
-/* -----------------------------------------------------------------------
- sysv.S - Copyright (c) 2000 Software AG
- Copyright (c) 2008 Red Hat, Inc.
-
- S390 Foreign Function Interface
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- ``Software''), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to
- permit persons to whom the Software is furnished to do so, subject to
- the following conditions:
-
- The above copyright notice and this permission notice shall be included
- in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- DEALINGS IN THE SOFTWARE.
- ----------------------------------------------------------------------- */
-
-#define LIBFFI_ASM
-#include <fficonfig.h>
-#include <ffi.h>
-
-#ifndef __s390x__
-
-.text
-
- # r2: cif->bytes
- # r3: &ecif
- # r4: ffi_prep_args
- # r5: ret_type
- # r6: ecif.rvalue
- # ov: fn
-
- # This assumes we are using gas.
- .globl ffi_call_SYSV
- .type ffi_call_SYSV,%function
-ffi_call_SYSV:
-.LFB1:
- stm %r6,%r15,24(%r15) # Save registers
-.LCFI0:
- basr %r13,0 # Set up base register
-.Lbase:
- lr %r11,%r15 # Set up frame pointer
-.LCFI1:
- sr %r15,%r2
- ahi %r15,-96-48 # Allocate stack
- lr %r8,%r6 # Save ecif.rvalue
- sr %r9,%r9
- ic %r9,.Ltable-.Lbase(%r13,%r5) # Load epilog address
- l %r7,96(%r11) # Load function address
- st %r11,0(%r15) # Set up back chain
- ahi %r11,-48 # Register save area
-.LCFI2:
-
- la %r2,96(%r15) # Save area
- # r3 already holds &ecif
- basr %r14,%r4 # Call ffi_prep_args
-
- lm %r2,%r6,0(%r11) # Load arguments
- ld %f0,32(%r11)
- ld %f2,40(%r11)
- la %r14,0(%r13,%r9) # Set return address
- br %r7 # ... and call function
-
-.LretNone: # Return void
- l %r4,48+56(%r11)
- lm %r6,%r15,48+24(%r11)
- br %r4
-
-.LretFloat:
- l %r4,48+56(%r11)
- ste %f0,0(%r8) # Return float
- lm %r6,%r15,48+24(%r11)
- br %r4
-
-.LretDouble:
- l %r4,48+56(%r11)
- std %f0,0(%r8) # Return double
- lm %r6,%r15,48+24(%r11)
- br %r4
-
-.LretInt32:
- l %r4,48+56(%r11)
- st %r2,0(%r8) # Return int
- lm %r6,%r15,48+24(%r11)
- br %r4
-
-.LretInt64:
- l %r4,48+56(%r11)
- stm %r2,%r3,0(%r8) # Return long long
- lm %r6,%r15,48+24(%r11)
- br %r4
-
-.Ltable:
- .byte .LretNone-.Lbase # FFI390_RET_VOID
- .byte .LretNone-.Lbase # FFI390_RET_STRUCT
- .byte .LretFloat-.Lbase # FFI390_RET_FLOAT
- .byte .LretDouble-.Lbase # FFI390_RET_DOUBLE
- .byte .LretInt32-.Lbase # FFI390_RET_INT32
- .byte .LretInt64-.Lbase # FFI390_RET_INT64
-
-.LFE1:
-.ffi_call_SYSV_end:
- .size ffi_call_SYSV,.ffi_call_SYSV_end-ffi_call_SYSV
-
-
- .globl ffi_closure_SYSV
- .type ffi_closure_SYSV,%function
-ffi_closure_SYSV:
-.LFB2:
- stm %r12,%r15,48(%r15) # Save registers
-.LCFI10:
- basr %r13,0 # Set up base register
-.Lcbase:
- stm %r2,%r6,8(%r15) # Save arguments
- std %f0,64(%r15)
- std %f2,72(%r15)
- lr %r1,%r15 # Set up stack frame
- ahi %r15,-96
-.LCFI11:
- l %r12,.Lchelper-.Lcbase(%r13) # Get helper function
- lr %r2,%r0 # Closure
- la %r3,8(%r1) # GPRs
- la %r4,64(%r1) # FPRs
- la %r5,96(%r1) # Overflow
- st %r1,0(%r15) # Set up back chain
-
- bas %r14,0(%r12,%r13) # Call helper
-
- l %r4,96+56(%r15)
- ld %f0,96+64(%r15) # Load return registers
- lm %r2,%r3,96+8(%r15)
- lm %r12,%r15,96+48(%r15)
- br %r4
-
- .align 4
-.Lchelper:
- .long ffi_closure_helper_SYSV-.Lcbase
-
-.LFE2:
-
-.ffi_closure_SYSV_end:
- .size ffi_closure_SYSV,.ffi_closure_SYSV_end-ffi_closure_SYSV
-
-
- .section .eh_frame,EH_FRAME_FLAGS,@progbits
-.Lframe1:
- .4byte .LECIE1-.LSCIE1 # Length of Common Information Entry
-.LSCIE1:
- .4byte 0x0 # CIE Identifier Tag
- .byte 0x1 # CIE Version
- .ascii "zR\0" # CIE Augmentation
- .uleb128 0x1 # CIE Code Alignment Factor
- .sleb128 -4 # CIE Data Alignment Factor
- .byte 0xe # CIE RA Column
- .uleb128 0x1 # Augmentation size
- .byte 0x1b # FDE Encoding (pcrel sdata4)
- .byte 0xc # DW_CFA_def_cfa
- .uleb128 0xf
- .uleb128 0x60
- .align 4
-.LECIE1:
-.LSFDE1:
- .4byte .LEFDE1-.LASFDE1 # FDE Length
-.LASFDE1:
- .4byte .LASFDE1-.Lframe1 # FDE CIE offset
- .4byte .LFB1-. # FDE initial location
- .4byte .LFE1-.LFB1 # FDE address range
- .uleb128 0x0 # Augmentation size
- .byte 0x4 # DW_CFA_advance_loc4
- .4byte .LCFI0-.LFB1
- .byte 0x8f # DW_CFA_offset, column 0xf
- .uleb128 0x9
- .byte 0x8e # DW_CFA_offset, column 0xe
- .uleb128 0xa
- .byte 0x8d # DW_CFA_offset, column 0xd
- .uleb128 0xb
- .byte 0x8c # DW_CFA_offset, column 0xc
- .uleb128 0xc
- .byte 0x8b # DW_CFA_offset, column 0xb
- .uleb128 0xd
- .byte 0x8a # DW_CFA_offset, column 0xa
- .uleb128 0xe
- .byte 0x89 # DW_CFA_offset, column 0x9
- .uleb128 0xf
- .byte 0x88 # DW_CFA_offset, column 0x8
- .uleb128 0x10
- .byte 0x87 # DW_CFA_offset, column 0x7
- .uleb128 0x11
- .byte 0x86 # DW_CFA_offset, column 0x6
- .uleb128 0x12
- .byte 0x4 # DW_CFA_advance_loc4
- .4byte .LCFI1-.LCFI0
- .byte 0xd # DW_CFA_def_cfa_register
- .uleb128 0xb
- .byte 0x4 # DW_CFA_advance_loc4
- .4byte .LCFI2-.LCFI1
- .byte 0xe # DW_CFA_def_cfa_offset
- .uleb128 0x90
- .align 4
-.LEFDE1:
-.LSFDE2:
- .4byte .LEFDE2-.LASFDE2 # FDE Length
-.LASFDE2:
- .4byte .LASFDE2-.Lframe1 # FDE CIE offset
- .4byte .LFB2-. # FDE initial location
- .4byte .LFE2-.LFB2 # FDE address range
- .uleb128 0x0 # Augmentation size
- .byte 0x4 # DW_CFA_advance_loc4
- .4byte .LCFI10-.LFB2
- .byte 0x8f # DW_CFA_offset, column 0xf
- .uleb128 0x9
- .byte 0x8e # DW_CFA_offset, column 0xe
- .uleb128 0xa
- .byte 0x8d # DW_CFA_offset, column 0xd
- .uleb128 0xb
- .byte 0x8c # DW_CFA_offset, column 0xc
- .uleb128 0xc
- .byte 0x4 # DW_CFA_advance_loc4
- .4byte .LCFI11-.LCFI10
- .byte 0xe # DW_CFA_def_cfa_offset
- .uleb128 0xc0
- .align 4
-.LEFDE2:
-
-#else
-
-.text
-
- # r2: cif->bytes
- # r3: &ecif
- # r4: ffi_prep_args
- # r5: ret_type
- # r6: ecif.rvalue
- # ov: fn
-
- # This assumes we are using gas.
- .globl ffi_call_SYSV
- .type ffi_call_SYSV,%function
-ffi_call_SYSV:
-.LFB1:
- stmg %r6,%r15,48(%r15) # Save registers
-.LCFI0:
- larl %r13,.Lbase # Set up base register
- lgr %r11,%r15 # Set up frame pointer
-.LCFI1:
- sgr %r15,%r2
- aghi %r15,-160-80 # Allocate stack
- lgr %r8,%r6 # Save ecif.rvalue
- llgc %r9,.Ltable-.Lbase(%r13,%r5) # Load epilog address
- lg %r7,160(%r11) # Load function address
- stg %r11,0(%r15) # Set up back chain
- aghi %r11,-80 # Register save area
-.LCFI2:
-
- la %r2,160(%r15) # Save area
- # r3 already holds &ecif
- basr %r14,%r4 # Call ffi_prep_args
-
- lmg %r2,%r6,0(%r11) # Load arguments
- ld %f0,48(%r11)
- ld %f2,56(%r11)
- ld %f4,64(%r11)
- ld %f6,72(%r11)
- la %r14,0(%r13,%r9) # Set return address
- br %r7 # ... and call function
-
-.Lbase:
-.LretNone: # Return void
- lg %r4,80+112(%r11)
- lmg %r6,%r15,80+48(%r11)
- br %r4
-
-.LretFloat:
- lg %r4,80+112(%r11)
- ste %f0,0(%r8) # Return float
- lmg %r6,%r15,80+48(%r11)
- br %r4
-
-.LretDouble:
- lg %r4,80+112(%r11)
- std %f0,0(%r8) # Return double
- lmg %r6,%r15,80+48(%r11)
- br %r4
-
-.LretInt32:
- lg %r4,80+112(%r11)
- st %r2,0(%r8) # Return int
- lmg %r6,%r15,80+48(%r11)
- br %r4
-
-.LretInt64:
- lg %r4,80+112(%r11)
- stg %r2,0(%r8) # Return long
- lmg %r6,%r15,80+48(%r11)
- br %r4
-
-.Ltable:
- .byte .LretNone-.Lbase # FFI390_RET_VOID
- .byte .LretNone-.Lbase # FFI390_RET_STRUCT
- .byte .LretFloat-.Lbase # FFI390_RET_FLOAT
- .byte .LretDouble-.Lbase # FFI390_RET_DOUBLE
- .byte .LretInt32-.Lbase # FFI390_RET_INT32
- .byte .LretInt64-.Lbase # FFI390_RET_INT64
-
-.LFE1:
-.ffi_call_SYSV_end:
- .size ffi_call_SYSV,.ffi_call_SYSV_end-ffi_call_SYSV
-
-
- .globl ffi_closure_SYSV
- .type ffi_closure_SYSV,%function
-ffi_closure_SYSV:
-.LFB2:
- stmg %r14,%r15,112(%r15) # Save registers
-.LCFI10:
- stmg %r2,%r6,16(%r15) # Save arguments
- std %f0,128(%r15)
- std %f2,136(%r15)
- std %f4,144(%r15)
- std %f6,152(%r15)
- lgr %r1,%r15 # Set up stack frame
- aghi %r15,-160
-.LCFI11:
- lgr %r2,%r0 # Closure
- la %r3,16(%r1) # GPRs
- la %r4,128(%r1) # FPRs
- la %r5,160(%r1) # Overflow
- stg %r1,0(%r15) # Set up back chain
-
- brasl %r14,ffi_closure_helper_SYSV # Call helper
-
- lg %r14,160+112(%r15)
- ld %f0,160+128(%r15) # Load return registers
- lg %r2,160+16(%r15)
- la %r15,160(%r15)
- br %r14
-.LFE2:
-
-.ffi_closure_SYSV_end:
- .size ffi_closure_SYSV,.ffi_closure_SYSV_end-ffi_closure_SYSV
-
-
-
- .section .eh_frame,EH_FRAME_FLAGS,@progbits
-.Lframe1:
- .4byte .LECIE1-.LSCIE1 # Length of Common Information Entry
-.LSCIE1:
- .4byte 0x0 # CIE Identifier Tag
- .byte 0x1 # CIE Version
- .ascii "zR\0" # CIE Augmentation
- .uleb128 0x1 # CIE Code Alignment Factor
- .sleb128 -8 # CIE Data Alignment Factor
- .byte 0xe # CIE RA Column
- .uleb128 0x1 # Augmentation size
- .byte 0x1b # FDE Encoding (pcrel sdata4)
- .byte 0xc # DW_CFA_def_cfa
- .uleb128 0xf
- .uleb128 0xa0
- .align 8
-.LECIE1:
-.LSFDE1:
- .4byte .LEFDE1-.LASFDE1 # FDE Length
-.LASFDE1:
- .4byte .LASFDE1-.Lframe1 # FDE CIE offset
- .4byte .LFB1-. # FDE initial location
- .4byte .LFE1-.LFB1 # FDE address range
- .uleb128 0x0 # Augmentation size
- .byte 0x4 # DW_CFA_advance_loc4
- .4byte .LCFI0-.LFB1
- .byte 0x8f # DW_CFA_offset, column 0xf
- .uleb128 0x5
- .byte 0x8e # DW_CFA_offset, column 0xe
- .uleb128 0x6
- .byte 0x8d # DW_CFA_offset, column 0xd
- .uleb128 0x7
- .byte 0x8c # DW_CFA_offset, column 0xc
- .uleb128 0x8
- .byte 0x8b # DW_CFA_offset, column 0xb
- .uleb128 0x9
- .byte 0x8a # DW_CFA_offset, column 0xa
- .uleb128 0xa
- .byte 0x89 # DW_CFA_offset, column 0x9
- .uleb128 0xb
- .byte 0x88 # DW_CFA_offset, column 0x8
- .uleb128 0xc
- .byte 0x87 # DW_CFA_offset, column 0x7
- .uleb128 0xd
- .byte 0x86 # DW_CFA_offset, column 0x6
- .uleb128 0xe
- .byte 0x4 # DW_CFA_advance_loc4
- .4byte .LCFI1-.LCFI0
- .byte 0xd # DW_CFA_def_cfa_register
- .uleb128 0xb
- .byte 0x4 # DW_CFA_advance_loc4
- .4byte .LCFI2-.LCFI1
- .byte 0xe # DW_CFA_def_cfa_offset
- .uleb128 0xf0
- .align 8
-.LEFDE1:
-.LSFDE2:
- .4byte .LEFDE2-.LASFDE2 # FDE Length
-.LASFDE2:
- .4byte .LASFDE2-.Lframe1 # FDE CIE offset
- .4byte .LFB2-. # FDE initial location
- .4byte .LFE2-.LFB2 # FDE address range
- .uleb128 0x0 # Augmentation size
- .byte 0x4 # DW_CFA_advance_loc4
- .4byte .LCFI10-.LFB2
- .byte 0x8f # DW_CFA_offset, column 0xf
- .uleb128 0x5
- .byte 0x8e # DW_CFA_offset, column 0xe
- .uleb128 0x6
- .byte 0x4 # DW_CFA_advance_loc4
- .4byte .LCFI11-.LCFI10
- .byte 0xe # DW_CFA_def_cfa_offset
- .uleb128 0x140
- .align 8
-.LEFDE2:
-
-#endif
-
-#if defined __ELF__ && defined __linux__
- .section .note.GNU-stack,"",@progbits
-#endif
diff --git a/Modules/_ctypes/libffi/src/sh/ffi.c b/Modules/_ctypes/libffi/src/sh/ffi.c
deleted file mode 100644
index 9ec86bfb20..0000000000
--- a/Modules/_ctypes/libffi/src/sh/ffi.c
+++ /dev/null
@@ -1,717 +0,0 @@
-/* -----------------------------------------------------------------------
- ffi.c - Copyright (c) 2002-2008, 2012 Kaz Kojima
- Copyright (c) 2008 Red Hat, Inc.
-
- SuperH Foreign Function Interface
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- ``Software''), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to
- permit persons to whom the Software is furnished to do so, subject to
- the following conditions:
-
- The above copyright notice and this permission notice shall be included
- in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- DEALINGS IN THE SOFTWARE.
- ----------------------------------------------------------------------- */
-
-#include <ffi.h>
-#include <ffi_common.h>
-
-#include <stdlib.h>
-
-#define NGREGARG 4
-#if defined(__SH4__)
-#define NFREGARG 8
-#endif
-
-#if defined(__HITACHI__)
-#define STRUCT_VALUE_ADDRESS_WITH_ARG 1
-#else
-#define STRUCT_VALUE_ADDRESS_WITH_ARG 0
-#endif
-
-/* If the structure has essentially an unique element, return its type. */
-static int
-simple_type (ffi_type *arg)
-{
- if (arg->type != FFI_TYPE_STRUCT)
- return arg->type;
- else if (arg->elements[1])
- return FFI_TYPE_STRUCT;
-
- return simple_type (arg->elements[0]);
-}
-
-static int
-return_type (ffi_type *arg)
-{
- unsigned short type;
-
- if (arg->type != FFI_TYPE_STRUCT)
- return arg->type;
-
- type = simple_type (arg->elements[0]);
- if (! arg->elements[1])
- {
- switch (type)
- {
- case FFI_TYPE_SINT8:
- case FFI_TYPE_UINT8:
- case FFI_TYPE_SINT16:
- case FFI_TYPE_UINT16:
- case FFI_TYPE_SINT32:
- case FFI_TYPE_UINT32:
- return FFI_TYPE_INT;
-
- default:
- return type;
- }
- }
-
- /* gcc uses r0/r1 pair for some kind of structures. */
- if (arg->size <= 2 * sizeof (int))
- {
- int i = 0;
- ffi_type *e;
-
- while ((e = arg->elements[i++]))
- {
- type = simple_type (e);
- switch (type)
- {
- case FFI_TYPE_SINT32:
- case FFI_TYPE_UINT32:
- case FFI_TYPE_INT:
- case FFI_TYPE_FLOAT:
- return FFI_TYPE_UINT64;
-
- default:
- break;
- }
- }
- }
-
- return FFI_TYPE_STRUCT;
-}
-
-/* ffi_prep_args is called by the assembly routine once stack space
- has been allocated for the function's arguments */
-
-void ffi_prep_args(char *stack, extended_cif *ecif)
-{
- register unsigned int i;
- register int tmp;
- register unsigned int avn;
- register void **p_argv;
- register char *argp;
- register ffi_type **p_arg;
- int greg, ireg;
-#if defined(__SH4__)
- int freg = 0;
-#endif
-
- tmp = 0;
- argp = stack;
-
- if (return_type (ecif->cif->rtype) == FFI_TYPE_STRUCT)
- {
- *(void **) argp = ecif->rvalue;
- argp += 4;
- ireg = STRUCT_VALUE_ADDRESS_WITH_ARG ? 1 : 0;
- }
- else
- ireg = 0;
-
- /* Set arguments for registers. */
- greg = ireg;
- avn = ecif->cif->nargs;
- p_argv = ecif->avalue;
-
- for (i = 0, p_arg = ecif->cif->arg_types; i < avn; i++, p_arg++, p_argv++)
- {
- size_t z;
-
- z = (*p_arg)->size;
- if (z < sizeof(int))
- {
- if (greg++ >= NGREGARG)
- continue;
-
- z = sizeof(int);
- switch ((*p_arg)->type)
- {
- case FFI_TYPE_SINT8:
- *(signed int *) argp = (signed int)*(SINT8 *)(* p_argv);
- break;
-
- case FFI_TYPE_UINT8:
- *(unsigned int *) argp = (unsigned int)*(UINT8 *)(* p_argv);
- break;
-
- case FFI_TYPE_SINT16:
- *(signed int *) argp = (signed int)*(SINT16 *)(* p_argv);
- break;
-
- case FFI_TYPE_UINT16:
- *(unsigned int *) argp = (unsigned int)*(UINT16 *)(* p_argv);
- break;
-
- case FFI_TYPE_STRUCT:
- *(unsigned int *) argp = (unsigned int)*(UINT32 *)(* p_argv);
- break;
-
- default:
- FFI_ASSERT(0);
- }
- argp += z;
- }
- else if (z == sizeof(int))
- {
-#if defined(__SH4__)
- if ((*p_arg)->type == FFI_TYPE_FLOAT)
- {
- if (freg++ >= NFREGARG)
- continue;
- }
- else
-#endif
- {
- if (greg++ >= NGREGARG)
- continue;
- }
- *(unsigned int *) argp = (unsigned int)*(UINT32 *)(* p_argv);
- argp += z;
- }
-#if defined(__SH4__)
- else if ((*p_arg)->type == FFI_TYPE_DOUBLE)
- {
- if (freg + 1 >= NFREGARG)
- continue;
- freg = (freg + 1) & ~1;
- freg += 2;
- memcpy (argp, *p_argv, z);
- argp += z;
- }
-#endif
- else
- {
- int n = (z + sizeof (int) - 1) / sizeof (int);
-#if defined(__SH4__)
- if (greg + n - 1 >= NGREGARG)
- continue;
-#else
- if (greg >= NGREGARG)
- continue;
-#endif
- greg += n;
- memcpy (argp, *p_argv, z);
- argp += n * sizeof (int);
- }
- }
-
- /* Set arguments on stack. */
- greg = ireg;
-#if defined(__SH4__)
- freg = 0;
-#endif
- p_argv = ecif->avalue;
-
- for (i = 0, p_arg = ecif->cif->arg_types; i < avn; i++, p_arg++, p_argv++)
- {
- size_t z;
-
- z = (*p_arg)->size;
- if (z < sizeof(int))
- {
- if (greg++ < NGREGARG)
- continue;
-
- z = sizeof(int);
- switch ((*p_arg)->type)
- {
- case FFI_TYPE_SINT8:
- *(signed int *) argp = (signed int)*(SINT8 *)(* p_argv);
- break;
-
- case FFI_TYPE_UINT8:
- *(unsigned int *) argp = (unsigned int)*(UINT8 *)(* p_argv);
- break;
-
- case FFI_TYPE_SINT16:
- *(signed int *) argp = (signed int)*(SINT16 *)(* p_argv);
- break;
-
- case FFI_TYPE_UINT16:
- *(unsigned int *) argp = (unsigned int)*(UINT16 *)(* p_argv);
- break;
-
- case FFI_TYPE_STRUCT:
- *(unsigned int *) argp = (unsigned int)*(UINT32 *)(* p_argv);
- break;
-
- default:
- FFI_ASSERT(0);
- }
- argp += z;
- }
- else if (z == sizeof(int))
- {
-#if defined(__SH4__)
- if ((*p_arg)->type == FFI_TYPE_FLOAT)
- {
- if (freg++ < NFREGARG)
- continue;
- }
- else
-#endif
- {
- if (greg++ < NGREGARG)
- continue;
- }
- *(unsigned int *) argp = (unsigned int)*(UINT32 *)(* p_argv);
- argp += z;
- }
-#if defined(__SH4__)
- else if ((*p_arg)->type == FFI_TYPE_DOUBLE)
- {
- if (freg + 1 < NFREGARG)
- {
- freg = (freg + 1) & ~1;
- freg += 2;
- continue;
- }
- memcpy (argp, *p_argv, z);
- argp += z;
- }
-#endif
- else
- {
- int n = (z + sizeof (int) - 1) / sizeof (int);
- if (greg + n - 1 < NGREGARG)
- {
- greg += n;
- continue;
- }
-#if (! defined(__SH4__))
- else if (greg < NGREGARG)
- {
- greg = NGREGARG;
- continue;
- }
-#endif
- memcpy (argp, *p_argv, z);
- argp += n * sizeof (int);
- }
- }
-
- return;
-}
-
-/* Perform machine dependent cif processing */
-ffi_status ffi_prep_cif_machdep(ffi_cif *cif)
-{
- int i, j;
- int size, type;
- int n, m;
- int greg;
-#if defined(__SH4__)
- int freg = 0;
-#endif
-
- cif->flags = 0;
-
- greg = ((return_type (cif->rtype) == FFI_TYPE_STRUCT) &&
- STRUCT_VALUE_ADDRESS_WITH_ARG) ? 1 : 0;
-
-#if defined(__SH4__)
- for (i = j = 0; i < cif->nargs && j < 12; i++)
- {
- type = (cif->arg_types)[i]->type;
- switch (type)
- {
- case FFI_TYPE_FLOAT:
- if (freg >= NFREGARG)
- continue;
- freg++;
- cif->flags += ((cif->arg_types)[i]->type) << (2 * j);
- j++;
- break;
-
- case FFI_TYPE_DOUBLE:
- if ((freg + 1) >= NFREGARG)
- continue;
- freg = (freg + 1) & ~1;
- freg += 2;
- cif->flags += ((cif->arg_types)[i]->type) << (2 * j);
- j++;
- break;
-
- default:
- size = (cif->arg_types)[i]->size;
- n = (size + sizeof (int) - 1) / sizeof (int);
- if (greg + n - 1 >= NGREGARG)
- continue;
- greg += n;
- for (m = 0; m < n; m++)
- cif->flags += FFI_TYPE_INT << (2 * j++);
- break;
- }
- }
-#else
- for (i = j = 0; i < cif->nargs && j < 4; i++)
- {
- size = (cif->arg_types)[i]->size;
- n = (size + sizeof (int) - 1) / sizeof (int);
- if (greg >= NGREGARG)
- continue;
- else if (greg + n - 1 >= NGREGARG)
- n = NGREGARG - greg;
- greg += n;
- for (m = 0; m < n; m++)
- cif->flags += FFI_TYPE_INT << (2 * j++);
- }
-#endif
-
- /* Set the return type flag */
- switch (cif->rtype->type)
- {
- case FFI_TYPE_STRUCT:
- cif->flags += (unsigned) (return_type (cif->rtype)) << 24;
- break;
-
- case FFI_TYPE_VOID:
- case FFI_TYPE_FLOAT:
- case FFI_TYPE_DOUBLE:
- case FFI_TYPE_SINT64:
- case FFI_TYPE_UINT64:
- cif->flags += (unsigned) cif->rtype->type << 24;
- break;
-
- default:
- cif->flags += FFI_TYPE_INT << 24;
- break;
- }
-
- return FFI_OK;
-}
-
-extern void ffi_call_SYSV(void (*)(char *, extended_cif *), extended_cif *,
- unsigned, unsigned, unsigned *, void (*fn)(void));
-
-void ffi_call(ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue)
-{
- extended_cif ecif;
- UINT64 trvalue;
-
- ecif.cif = cif;
- ecif.avalue = avalue;
-
- /* If the return value is a struct and we don't have a return */
- /* value address then we need to make one */
-
- if (cif->rtype->type == FFI_TYPE_STRUCT
- && return_type (cif->rtype) != FFI_TYPE_STRUCT)
- ecif.rvalue = &trvalue;
- else if ((rvalue == NULL) &&
- (cif->rtype->type == FFI_TYPE_STRUCT))
- {
- ecif.rvalue = alloca(cif->rtype->size);
- }
- else
- ecif.rvalue = rvalue;
-
- switch (cif->abi)
- {
- case FFI_SYSV:
- ffi_call_SYSV(ffi_prep_args, &ecif, cif->bytes, cif->flags, ecif.rvalue,
- fn);
- break;
- default:
- FFI_ASSERT(0);
- break;
- }
-
- if (rvalue
- && cif->rtype->type == FFI_TYPE_STRUCT
- && return_type (cif->rtype) != FFI_TYPE_STRUCT)
- memcpy (rvalue, &trvalue, cif->rtype->size);
-}
-
-extern void ffi_closure_SYSV (void);
-#if defined(__SH4__)
-extern void __ic_invalidate (void *line);
-#endif
-
-ffi_status
-ffi_prep_closure_loc (ffi_closure* closure,
- ffi_cif* cif,
- void (*fun)(ffi_cif*, void*, void**, void*),
- void *user_data,
- void *codeloc)
-{
- unsigned int *tramp;
- unsigned int insn;
-
- if (cif->abi != FFI_SYSV)
- return FFI_BAD_ABI;
-
- tramp = (unsigned int *) &closure->tramp[0];
- /* Set T bit if the function returns a struct pointed with R2. */
- insn = (return_type (cif->rtype) == FFI_TYPE_STRUCT
- ? 0x0018 /* sett */
- : 0x0008 /* clrt */);
-
-#ifdef __LITTLE_ENDIAN__
- tramp[0] = 0xd301d102;
- tramp[1] = 0x0000412b | (insn << 16);
-#else
- tramp[0] = 0xd102d301;
- tramp[1] = 0x412b0000 | insn;
-#endif
- *(void **) &tramp[2] = (void *)codeloc; /* ctx */
- *(void **) &tramp[3] = (void *)ffi_closure_SYSV; /* funaddr */
-
- closure->cif = cif;
- closure->fun = fun;
- closure->user_data = user_data;
-
-#if defined(__SH4__)
- /* Flush the icache. */
- __ic_invalidate(codeloc);
-#endif
-
- return FFI_OK;
-}
-
-/* Basically the trampoline invokes ffi_closure_SYSV, and on
- * entry, r3 holds the address of the closure.
- * After storing the registers that could possibly contain
- * parameters to be passed into the stack frame and setting
- * up space for a return value, ffi_closure_SYSV invokes the
- * following helper function to do most of the work.
- */
-
-#ifdef __LITTLE_ENDIAN__
-#define OFS_INT8 0
-#define OFS_INT16 0
-#else
-#define OFS_INT8 3
-#define OFS_INT16 2
-#endif
-
-int
-ffi_closure_helper_SYSV (ffi_closure *closure, void *rvalue,
- unsigned long *pgr, unsigned long *pfr,
- unsigned long *pst)
-{
- void **avalue;
- ffi_type **p_arg;
- int i, avn;
- int ireg, greg = 0;
-#if defined(__SH4__)
- int freg = 0;
-#endif
- ffi_cif *cif;
-
- cif = closure->cif;
- avalue = alloca(cif->nargs * sizeof(void *));
-
- /* Copy the caller's structure return value address so that the closure
- returns the data directly to the caller. */
- if (cif->rtype->type == FFI_TYPE_STRUCT && STRUCT_VALUE_ADDRESS_WITH_ARG)
- {
- rvalue = (void *) *pgr++;
- ireg = 1;
- }
- else
- ireg = 0;
-
- cif = closure->cif;
- greg = ireg;
- avn = cif->nargs;
-
- /* Grab the addresses of the arguments from the stack frame. */
- for (i = 0, p_arg = cif->arg_types; i < avn; i++, p_arg++)
- {
- size_t z;
-
- z = (*p_arg)->size;
- if (z < sizeof(int))
- {
- if (greg++ >= NGREGARG)
- continue;
-
- z = sizeof(int);
- switch ((*p_arg)->type)
- {
- case FFI_TYPE_SINT8:
- case FFI_TYPE_UINT8:
- avalue[i] = (((char *)pgr) + OFS_INT8);
- break;
-
- case FFI_TYPE_SINT16:
- case FFI_TYPE_UINT16:
- avalue[i] = (((char *)pgr) + OFS_INT16);
- break;
-
- case FFI_TYPE_STRUCT:
- avalue[i] = pgr;
- break;
-
- default:
- FFI_ASSERT(0);
- }
- pgr++;
- }
- else if (z == sizeof(int))
- {
-#if defined(__SH4__)
- if ((*p_arg)->type == FFI_TYPE_FLOAT)
- {
- if (freg++ >= NFREGARG)
- continue;
- avalue[i] = pfr;
- pfr++;
- }
- else
-#endif
- {
- if (greg++ >= NGREGARG)
- continue;
- avalue[i] = pgr;
- pgr++;
- }
- }
-#if defined(__SH4__)
- else if ((*p_arg)->type == FFI_TYPE_DOUBLE)
- {
- if (freg + 1 >= NFREGARG)
- continue;
- if (freg & 1)
- pfr++;
- freg = (freg + 1) & ~1;
- freg += 2;
- avalue[i] = pfr;
- pfr += 2;
- }
-#endif
- else
- {
- int n = (z + sizeof (int) - 1) / sizeof (int);
-#if defined(__SH4__)
- if (greg + n - 1 >= NGREGARG)
- continue;
-#else
- if (greg >= NGREGARG)
- continue;
-#endif
- greg += n;
- avalue[i] = pgr;
- pgr += n;
- }
- }
-
- greg = ireg;
-#if defined(__SH4__)
- freg = 0;
-#endif
-
- for (i = 0, p_arg = cif->arg_types; i < avn; i++, p_arg++)
- {
- size_t z;
-
- z = (*p_arg)->size;
- if (z < sizeof(int))
- {
- if (greg++ < NGREGARG)
- continue;
-
- z = sizeof(int);
- switch ((*p_arg)->type)
- {
- case FFI_TYPE_SINT8:
- case FFI_TYPE_UINT8:
- avalue[i] = (((char *)pst) + OFS_INT8);
- break;
-
- case FFI_TYPE_SINT16:
- case FFI_TYPE_UINT16:
- avalue[i] = (((char *)pst) + OFS_INT16);
- break;
-
- case FFI_TYPE_STRUCT:
- avalue[i] = pst;
- break;
-
- default:
- FFI_ASSERT(0);
- }
- pst++;
- }
- else if (z == sizeof(int))
- {
-#if defined(__SH4__)
- if ((*p_arg)->type == FFI_TYPE_FLOAT)
- {
- if (freg++ < NFREGARG)
- continue;
- }
- else
-#endif
- {
- if (greg++ < NGREGARG)
- continue;
- }
- avalue[i] = pst;
- pst++;
- }
-#if defined(__SH4__)
- else if ((*p_arg)->type == FFI_TYPE_DOUBLE)
- {
- if (freg + 1 < NFREGARG)
- {
- freg = (freg + 1) & ~1;
- freg += 2;
- continue;
- }
- avalue[i] = pst;
- pst += 2;
- }
-#endif
- else
- {
- int n = (z + sizeof (int) - 1) / sizeof (int);
- if (greg + n - 1 < NGREGARG)
- {
- greg += n;
- continue;
- }
-#if (! defined(__SH4__))
- else if (greg < NGREGARG)
- {
- greg += n;
- pst += greg - NGREGARG;
- continue;
- }
-#endif
- avalue[i] = pst;
- pst += n;
- }
- }
-
- (closure->fun) (cif, rvalue, avalue, closure->user_data);
-
- /* Tell ffi_closure_SYSV how to perform return type promotions. */
- return return_type (cif->rtype);
-}
diff --git a/Modules/_ctypes/libffi/src/sh/ffitarget.h b/Modules/_ctypes/libffi/src/sh/ffitarget.h
deleted file mode 100644
index a36bf42070..0000000000
--- a/Modules/_ctypes/libffi/src/sh/ffitarget.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/* -----------------------------------------------------------------*-C-*-
- ffitarget.h - Copyright (c) 2012 Anthony Green
- Copyright (c) 1996-2003 Red Hat, Inc.
- Target configuration macros for SuperH.
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- ``Software''), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to
- permit persons to whom the Software is furnished to do so, subject to
- the following conditions:
-
- The above copyright notice and this permission notice shall be included
- in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- DEALINGS IN THE SOFTWARE.
-
- ----------------------------------------------------------------------- */
-
-#ifndef LIBFFI_TARGET_H
-#define LIBFFI_TARGET_H
-
-#ifndef LIBFFI_H
-#error "Please do not include ffitarget.h directly into your source. Use ffi.h instead."
-#endif
-
-/* ---- Generic type definitions ----------------------------------------- */
-
-#ifndef LIBFFI_ASM
-typedef unsigned long ffi_arg;
-typedef signed long ffi_sarg;
-
-typedef enum ffi_abi {
- FFI_FIRST_ABI = 0,
- FFI_SYSV,
- FFI_LAST_ABI,
- FFI_DEFAULT_ABI = FFI_SYSV
-} ffi_abi;
-#endif
-
-#define FFI_CLOSURES 1
-#define FFI_TRAMPOLINE_SIZE 16
-#define FFI_NATIVE_RAW_API 0
-
-#endif
-
diff --git a/Modules/_ctypes/libffi/src/sh/sysv.S b/Modules/_ctypes/libffi/src/sh/sysv.S
deleted file mode 100644
index 5be7516d65..0000000000
--- a/Modules/_ctypes/libffi/src/sh/sysv.S
+++ /dev/null
@@ -1,850 +0,0 @@
-/* -----------------------------------------------------------------------
- sysv.S - Copyright (c) 2002, 2003, 2004, 2006, 2008 Kaz Kojima
-
- SuperH Foreign Function Interface
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- ``Software''), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to
- permit persons to whom the Software is furnished to do so, subject to
- the following conditions:
-
- The above copyright notice and this permission notice shall be included
- in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- DEALINGS IN THE SOFTWARE.
- ----------------------------------------------------------------------- */
-
-#define LIBFFI_ASM
-#include <fficonfig.h>
-#include <ffi.h>
-#ifdef HAVE_MACHINE_ASM_H
-#include <machine/asm.h>
-#else
-/* XXX these lose for some platforms, I'm sure. */
-#define CNAME(x) x
-#define ENTRY(x) .globl CNAME(x); .type CNAME(x),%function; CNAME(x):
-#endif
-
-#if defined(__HITACHI__)
-#define STRUCT_VALUE_ADDRESS_WITH_ARG 1
-#else
-#define STRUCT_VALUE_ADDRESS_WITH_ARG 0
-#endif
-
-.text
-
- # r4: ffi_prep_args
- # r5: &ecif
- # r6: bytes
- # r7: flags
- # sp+0: rvalue
- # sp+4: fn
-
- # This assumes we are using gas.
-ENTRY(ffi_call_SYSV)
- # Save registers
-.LFB1:
- mov.l r8,@-r15
-.LCFI0:
- mov.l r9,@-r15
-.LCFI1:
- mov.l r10,@-r15
-.LCFI2:
- mov.l r12,@-r15
-.LCFI3:
- mov.l r14,@-r15
-.LCFI4:
- sts.l pr,@-r15
-.LCFI5:
- mov r15,r14
-.LCFI6:
-#if defined(__SH4__)
- mov r6,r8
- mov r7,r9
-
- sub r6,r15
- add #-16,r15
- mov #~7,r0
- and r0,r15
-
- mov r4,r0
- jsr @r0
- mov r15,r4
-
- mov r9,r1
- shlr8 r9
- shlr8 r9
- shlr8 r9
-
- mov #FFI_TYPE_STRUCT,r2
- cmp/eq r2,r9
- bf 1f
-#if STRUCT_VALUE_ADDRESS_WITH_ARG
- mov.l @r15+,r4
- bra 2f
- mov #5,r2
-#else
- mov.l @r15+,r10
-#endif
-1:
- mov #4,r2
-2:
- mov #4,r3
-
-L_pass:
- cmp/pl r8
- bf L_call_it
-
- mov r1,r0
- and #3,r0
-
-L_pass_d:
- cmp/eq #FFI_TYPE_DOUBLE,r0
- bf L_pass_f
-
- mov r3,r0
- and #1,r0
- tst r0,r0
- bt 1f
- add #1,r3
-1:
- mov #12,r0
- cmp/hs r0,r3
- bt/s 3f
- shlr2 r1
- bsr L_pop_d
- nop
-3:
- add #2,r3
- bra L_pass
- add #-8,r8
-
-L_pop_d:
- mov r3,r0
- add r0,r0
- add r3,r0
- add #-12,r0
- braf r0
- nop
-#ifdef __LITTLE_ENDIAN__
- fmov.s @r15+,fr5
- rts
- fmov.s @r15+,fr4
- fmov.s @r15+,fr7
- rts
- fmov.s @r15+,fr6
- fmov.s @r15+,fr9
- rts
- fmov.s @r15+,fr8
- fmov.s @r15+,fr11
- rts
- fmov.s @r15+,fr10
-#else
- fmov.s @r15+,fr4
- rts
- fmov.s @r15+,fr5
- fmov.s @r15+,fr6
- rts
- fmov.s @r15+,fr7
- fmov.s @r15+,fr8
- rts
- fmov.s @r15+,fr9
- fmov.s @r15+,fr10
- rts
- fmov.s @r15+,fr11
-#endif
-
-L_pass_f:
- cmp/eq #FFI_TYPE_FLOAT,r0
- bf L_pass_i
-
- mov #12,r0
- cmp/hs r0,r3
- bt/s 2f
- shlr2 r1
- bsr L_pop_f
- nop
-2:
- add #1,r3
- bra L_pass
- add #-4,r8
-
-L_pop_f:
- mov r3,r0
- shll2 r0
- add #-16,r0
- braf r0
- nop
-#ifdef __LITTLE_ENDIAN__
- rts
- fmov.s @r15+,fr5
- rts
- fmov.s @r15+,fr4
- rts
- fmov.s @r15+,fr7
- rts
- fmov.s @r15+,fr6
- rts
- fmov.s @r15+,fr9
- rts
- fmov.s @r15+,fr8
- rts
- fmov.s @r15+,fr11
- rts
- fmov.s @r15+,fr10
-#else
- rts
- fmov.s @r15+,fr4
- rts
- fmov.s @r15+,fr5
- rts
- fmov.s @r15+,fr6
- rts
- fmov.s @r15+,fr7
- rts
- fmov.s @r15+,fr8
- rts
- fmov.s @r15+,fr9
- rts
- fmov.s @r15+,fr10
- rts
- fmov.s @r15+,fr11
-#endif
-
-L_pass_i:
- cmp/eq #FFI_TYPE_INT,r0
- bf L_call_it
-
- mov #8,r0
- cmp/hs r0,r2
- bt/s 2f
- shlr2 r1
- bsr L_pop_i
- nop
-2:
- add #1,r2
- bra L_pass
- add #-4,r8
-
-L_pop_i:
- mov r2,r0
- shll2 r0
- add #-16,r0
- braf r0
- nop
- rts
- mov.l @r15+,r4
- rts
- mov.l @r15+,r5
- rts
- mov.l @r15+,r6
- rts
- mov.l @r15+,r7
-
-L_call_it:
- # call function
-#if (! STRUCT_VALUE_ADDRESS_WITH_ARG)
- mov r10, r2
-#endif
- mov.l @(28,r14),r1
- jsr @r1
- nop
-
-L_ret_d:
- mov #FFI_TYPE_DOUBLE,r2
- cmp/eq r2,r9
- bf L_ret_ll
-
- mov.l @(24,r14),r1
-#ifdef __LITTLE_ENDIAN__
- fmov.s fr1,@r1
- add #4,r1
- bra L_epilogue
- fmov.s fr0,@r1
-#else
- fmov.s fr0,@r1
- add #4,r1
- bra L_epilogue
- fmov.s fr1,@r1
-#endif
-
-L_ret_ll:
- mov #FFI_TYPE_SINT64,r2
- cmp/eq r2,r9
- bt/s 1f
- mov #FFI_TYPE_UINT64,r2
- cmp/eq r2,r9
- bf L_ret_f
-
-1:
- mov.l @(24,r14),r2
- mov.l r0,@r2
- bra L_epilogue
- mov.l r1,@(4,r2)
-
-L_ret_f:
- mov #FFI_TYPE_FLOAT,r2
- cmp/eq r2,r9
- bf L_ret_i
-
- mov.l @(24,r14),r1
- bra L_epilogue
- fmov.s fr0,@r1
-
-L_ret_i:
- mov #FFI_TYPE_INT,r2
- cmp/eq r2,r9
- bf L_epilogue
-
- mov.l @(24,r14),r1
- bra L_epilogue
- mov.l r0,@r1
-
-L_epilogue:
- # Remove the space we pushed for the args
- mov r14,r15
-
- lds.l @r15+,pr
- mov.l @r15+,r14
- mov.l @r15+,r12
- mov.l @r15+,r10
- mov.l @r15+,r9
- rts
- mov.l @r15+,r8
-#else
- mov r6,r8
- mov r7,r9
-
- sub r6,r15
- add #-16,r15
- mov #~7,r0
- and r0,r15
-
- mov r4,r0
- jsr @r0
- mov r15,r4
-
- mov r9,r3
- shlr8 r9
- shlr8 r9
- shlr8 r9
-
- mov #FFI_TYPE_STRUCT,r2
- cmp/eq r2,r9
- bf 1f
-#if STRUCT_VALUE_ADDRESS_WITH_ARG
- mov.l @r15+,r4
- bra 2f
- mov #5,r2
-#else
- mov.l @r15+,r10
-#endif
-1:
- mov #4,r2
-2:
-
-L_pass:
- cmp/pl r8
- bf L_call_it
-
- mov r3,r0
- and #3,r0
-
-L_pass_d:
- cmp/eq #FFI_TYPE_DOUBLE,r0
- bf L_pass_i
-
- mov r15,r0
- and #7,r0
- tst r0,r0
- bt 1f
- add #4,r15
-1:
- mov #8,r0
- cmp/hs r0,r2
- bt/s 2f
- shlr2 r3
- bsr L_pop_d
- nop
-2:
- add #2,r2
- bra L_pass
- add #-8,r8
-
-L_pop_d:
- mov r2,r0
- add r0,r0
- add r2,r0
- add #-12,r0
- add r0,r0
- braf r0
- nop
- mov.l @r15+,r4
- rts
- mov.l @r15+,r5
- mov.l @r15+,r5
- rts
- mov.l @r15+,r6
- mov.l @r15+,r6
- rts
- mov.l @r15+,r7
- rts
- mov.l @r15+,r7
-
-L_pass_i:
- cmp/eq #FFI_TYPE_INT,r0
- bf L_call_it
-
- mov #8,r0
- cmp/hs r0,r2
- bt/s 2f
- shlr2 r3
- bsr L_pop_i
- nop
-2:
- add #1,r2
- bra L_pass
- add #-4,r8
-
-L_pop_i:
- mov r2,r0
- shll2 r0
- add #-16,r0
- braf r0
- nop
- rts
- mov.l @r15+,r4
- rts
- mov.l @r15+,r5
- rts
- mov.l @r15+,r6
- rts
- mov.l @r15+,r7
-
-L_call_it:
- # call function
-#if (! STRUCT_VALUE_ADDRESS_WITH_ARG)
- mov r10, r2
-#endif
- mov.l @(28,r14),r1
- jsr @r1
- nop
-
-L_ret_d:
- mov #FFI_TYPE_DOUBLE,r2
- cmp/eq r2,r9
- bf L_ret_ll
-
- mov.l @(24,r14),r2
- mov.l r0,@r2
- bra L_epilogue
- mov.l r1,@(4,r2)
-
-L_ret_ll:
- mov #FFI_TYPE_SINT64,r2
- cmp/eq r2,r9
- bt/s 1f
- mov #FFI_TYPE_UINT64,r2
- cmp/eq r2,r9
- bf L_ret_i
-
-1:
- mov.l @(24,r14),r2
- mov.l r0,@r2
- bra L_epilogue
- mov.l r1,@(4,r2)
-
-L_ret_i:
- mov #FFI_TYPE_FLOAT,r2
- cmp/eq r2,r9
- bt 1f
- mov #FFI_TYPE_INT,r2
- cmp/eq r2,r9
- bf L_epilogue
-1:
- mov.l @(24,r14),r1
- bra L_epilogue
- mov.l r0,@r1
-
-L_epilogue:
- # Remove the space we pushed for the args
- mov r14,r15
-
- lds.l @r15+,pr
- mov.l @r15+,r14
- mov.l @r15+,r12
- mov.l @r15+,r10
- mov.l @r15+,r9
- rts
- mov.l @r15+,r8
-#endif
-.LFE1:
-.ffi_call_SYSV_end:
- .size CNAME(ffi_call_SYSV),.ffi_call_SYSV_end-CNAME(ffi_call_SYSV)
-
-.globl ffi_closure_helper_SYSV
-
-ENTRY(ffi_closure_SYSV)
-.LFB2:
- mov.l r7,@-r15
-.LCFI7:
- mov.l r6,@-r15
-.LCFI8:
- mov.l r5,@-r15
-.LCFI9:
- mov.l r4,@-r15
-.LCFIA:
- mov.l r14,@-r15
-.LCFIB:
- sts.l pr,@-r15
-
- /* Stack layout:
- xx bytes (on stack parameters)
- 16 bytes (register parameters)
- 4 bytes (saved frame pointer)
- 4 bytes (saved return address)
- 32 bytes (floating register parameters, SH-4 only)
- 8 bytes (result)
- 4 bytes (pad)
- 4 bytes (5th arg)
- <- new stack pointer
- */
-.LCFIC:
-#if defined(__SH4__)
- add #-48,r15
-#else
- add #-16,r15
-#endif
-.LCFID:
- mov r15,r14
-.LCFIE:
-
-#if defined(__SH4__)
- mov r14,r1
- add #48,r1
-#ifdef __LITTLE_ENDIAN__
- fmov.s fr10,@-r1
- fmov.s fr11,@-r1
- fmov.s fr8,@-r1
- fmov.s fr9,@-r1
- fmov.s fr6,@-r1
- fmov.s fr7,@-r1
- fmov.s fr4,@-r1
- fmov.s fr5,@-r1
-#else
- fmov.s fr11,@-r1
- fmov.s fr10,@-r1
- fmov.s fr9,@-r1
- fmov.s fr8,@-r1
- fmov.s fr7,@-r1
- fmov.s fr6,@-r1
- fmov.s fr5,@-r1
- fmov.s fr4,@-r1
-#endif
- mov r1,r7
- mov r14,r6
- add #56,r6
-#else
- mov r14,r6
- add #24,r6
-#endif
-
- bt/s 10f
- mov r2, r5
- mov r14,r1
- add #8,r1
- mov r1,r5
-10:
-
- mov r14,r1
-#if defined(__SH4__)
- add #72,r1
-#else
- add #40,r1
-#endif
- mov.l r1,@r14
-
-#ifdef PIC
- mov.l L_got,r1
- mova L_got,r0
- add r0,r1
- mov.l L_helper,r0
- add r1,r0
-#else
- mov.l L_helper,r0
-#endif
- jsr @r0
- mov r3,r4
-
- shll r0
- mov r0,r1
- mova L_table,r0
- add r1,r0
- mov.w @r0,r0
- mov r14,r2
- braf r0
- add #8,r2
-0:
- .align 2
-#ifdef PIC
-L_got:
- .long _GLOBAL_OFFSET_TABLE_
-L_helper:
- .long ffi_closure_helper_SYSV@GOTOFF
-#else
-L_helper:
- .long ffi_closure_helper_SYSV
-#endif
-L_table:
- .short L_case_v - 0b /* FFI_TYPE_VOID */
- .short L_case_i - 0b /* FFI_TYPE_INT */
-#if defined(__SH4__)
- .short L_case_f - 0b /* FFI_TYPE_FLOAT */
- .short L_case_d - 0b /* FFI_TYPE_DOUBLE */
- .short L_case_d - 0b /* FFI_TYPE_LONGDOUBLE */
-#else
- .short L_case_i - 0b /* FFI_TYPE_FLOAT */
- .short L_case_ll - 0b /* FFI_TYPE_DOUBLE */
- .short L_case_ll - 0b /* FFI_TYPE_LONGDOUBLE */
-#endif
- .short L_case_uq - 0b /* FFI_TYPE_UINT8 */
- .short L_case_q - 0b /* FFI_TYPE_SINT8 */
- .short L_case_uh - 0b /* FFI_TYPE_UINT16 */
- .short L_case_h - 0b /* FFI_TYPE_SINT16 */
- .short L_case_i - 0b /* FFI_TYPE_UINT32 */
- .short L_case_i - 0b /* FFI_TYPE_SINT32 */
- .short L_case_ll - 0b /* FFI_TYPE_UINT64 */
- .short L_case_ll - 0b /* FFI_TYPE_SINT64 */
- .short L_case_v - 0b /* FFI_TYPE_STRUCT */
- .short L_case_i - 0b /* FFI_TYPE_POINTER */
-
-#if defined(__SH4__)
-L_case_d:
-#ifdef __LITTLE_ENDIAN__
- fmov.s @r2+,fr1
- bra L_case_v
- fmov.s @r2,fr0
-#else
- fmov.s @r2+,fr0
- bra L_case_v
- fmov.s @r2,fr1
-#endif
-
-L_case_f:
- bra L_case_v
- fmov.s @r2,fr0
-#endif
-
-L_case_ll:
- mov.l @r2+,r0
- bra L_case_v
- mov.l @r2,r1
-
-L_case_i:
- bra L_case_v
- mov.l @r2,r0
-
-L_case_q:
-#ifdef __LITTLE_ENDIAN__
-#else
- add #3,r2
-#endif
- bra L_case_v
- mov.b @r2,r0
-
-L_case_uq:
-#ifdef __LITTLE_ENDIAN__
-#else
- add #3,r2
-#endif
- mov.b @r2,r0
- bra L_case_v
- extu.b r0,r0
-
-L_case_h:
-#ifdef __LITTLE_ENDIAN__
-#else
- add #2,r2
-#endif
- bra L_case_v
- mov.w @r2,r0
-
-L_case_uh:
-#ifdef __LITTLE_ENDIAN__
-#else
- add #2,r2
-#endif
- mov.w @r2,r0
- extu.w r0,r0
- /* fall through */
-
-L_case_v:
-#if defined(__SH4__)
- add #48,r15
-#else
- add #16,r15
-#endif
- lds.l @r15+,pr
- mov.l @r15+,r14
- rts
- add #16,r15
-.LFE2:
-.ffi_closure_SYSV_end:
- .size CNAME(ffi_closure_SYSV),.ffi_closure_SYSV_end-CNAME(ffi_closure_SYSV)
-
-#if defined __ELF__ && defined __linux__
- .section .note.GNU-stack,"",@progbits
-#endif
-
- .section ".eh_frame","aw",@progbits
-__FRAME_BEGIN__:
- .4byte .LECIE1-.LSCIE1 /* Length of Common Information Entry */
-.LSCIE1:
- .4byte 0x0 /* CIE Identifier Tag */
- .byte 0x1 /* CIE Version */
-#ifdef PIC
- .ascii "zR\0" /* CIE Augmentation */
-#else
- .byte 0x0 /* CIE Augmentation */
-#endif
- .byte 0x1 /* uleb128 0x1; CIE Code Alignment Factor */
- .byte 0x7c /* sleb128 -4; CIE Data Alignment Factor */
- .byte 0x11 /* CIE RA Column */
-#ifdef PIC
- .uleb128 0x1 /* Augmentation size */
- .byte 0x10 /* FDE Encoding (pcrel) */
-#endif
- .byte 0xc /* DW_CFA_def_cfa */
- .byte 0xf /* uleb128 0xf */
- .byte 0x0 /* uleb128 0x0 */
- .align 2
-.LECIE1:
-.LSFDE1:
- .4byte .LEFDE1-.LASFDE1 /* FDE Length */
-.LASFDE1:
- .4byte .LASFDE1-__FRAME_BEGIN__ /* FDE CIE offset */
-#ifdef PIC
- .4byte .LFB1-. /* FDE initial location */
-#else
- .4byte .LFB1 /* FDE initial location */
-#endif
- .4byte .LFE1-.LFB1 /* FDE address range */
-#ifdef PIC
- .uleb128 0x0 /* Augmentation size */
-#endif
- .byte 0x4 /* DW_CFA_advance_loc4 */
- .4byte .LCFI0-.LFB1
- .byte 0xe /* DW_CFA_def_cfa_offset */
- .byte 0x4 /* uleb128 0x4 */
- .byte 0x4 /* DW_CFA_advance_loc4 */
- .4byte .LCFI1-.LCFI0
- .byte 0xe /* DW_CFA_def_cfa_offset */
- .byte 0x8 /* uleb128 0x4 */
- .byte 0x4 /* DW_CFA_advance_loc4 */
- .4byte .LCFI2-.LCFI1
- .byte 0xe /* DW_CFA_def_cfa_offset */
- .byte 0xc /* uleb128 0x4 */
- .byte 0x4 /* DW_CFA_advance_loc4 */
- .4byte .LCFI3-.LCFI2
- .byte 0xe /* DW_CFA_def_cfa_offset */
- .byte 0x10 /* uleb128 0x4 */
- .byte 0x4 /* DW_CFA_advance_loc4 */
- .4byte .LCFI4-.LCFI3
- .byte 0xe /* DW_CFA_def_cfa_offset */
- .byte 0x14 /* uleb128 0x4 */
- .byte 0x4 /* DW_CFA_advance_loc4 */
- .4byte .LCFI5-.LCFI4
- .byte 0xe /* DW_CFA_def_cfa_offset */
- .byte 0x18 /* uleb128 0x4 */
- .byte 0x91 /* DW_CFA_offset, column 0x11 */
- .byte 0x6 /* uleb128 0x6 */
- .byte 0x8e /* DW_CFA_offset, column 0xe */
- .byte 0x5 /* uleb128 0x5 */
- .byte 0x8c /* DW_CFA_offset, column 0xc */
- .byte 0x4 /* uleb128 0x4 */
- .byte 0x8a /* DW_CFA_offset, column 0xa */
- .byte 0x3 /* uleb128 0x3 */
- .byte 0x89 /* DW_CFA_offset, column 0x9 */
- .byte 0x2 /* uleb128 0x2 */
- .byte 0x88 /* DW_CFA_offset, column 0x8 */
- .byte 0x1 /* uleb128 0x1 */
- .byte 0x4 /* DW_CFA_advance_loc4 */
- .4byte .LCFI6-.LCFI5
- .byte 0xd /* DW_CFA_def_cfa_register */
- .byte 0xe /* uleb128 0xe */
- .align 2
-.LEFDE1:
-
-.LSFDE3:
- .4byte .LEFDE3-.LASFDE3 /* FDE Length */
-.LASFDE3:
- .4byte .LASFDE3-__FRAME_BEGIN__ /* FDE CIE offset */
-#ifdef PIC
- .4byte .LFB2-. /* FDE initial location */
-#else
- .4byte .LFB2 /* FDE initial location */
-#endif
- .4byte .LFE2-.LFB2 /* FDE address range */
-#ifdef PIC
- .uleb128 0x0 /* Augmentation size */
-#endif
- .byte 0x4 /* DW_CFA_advance_loc4 */
- .4byte .LCFI7-.LFB2
- .byte 0xe /* DW_CFA_def_cfa_offset */
- .byte 0x4 /* uleb128 0x4 */
- .byte 0x4 /* DW_CFA_advance_loc4 */
- .4byte .LCFI8-.LCFI7
- .byte 0xe /* DW_CFA_def_cfa_offset */
- .byte 0x8 /* uleb128 0x4 */
- .byte 0x4 /* DW_CFA_advance_loc4 */
- .4byte .LCFI9-.LCFI8
- .byte 0xe /* DW_CFA_def_cfa_offset */
- .byte 0xc /* uleb128 0x4 */
- .byte 0x4 /* DW_CFA_advance_loc4 */
- .4byte .LCFIA-.LCFI9
- .byte 0xe /* DW_CFA_def_cfa_offset */
- .byte 0x10 /* uleb128 0x4 */
- .byte 0x4 /* DW_CFA_advance_loc4 */
- .4byte .LCFIB-.LCFIA
- .byte 0xe /* DW_CFA_def_cfa_offset */
- .byte 0x14 /* uleb128 0x4 */
- .byte 0x4 /* DW_CFA_advance_loc4 */
- .4byte .LCFIC-.LCFIB
- .byte 0xe /* DW_CFA_def_cfa_offset */
- .byte 0x18 /* uleb128 0x4 */
- .byte 0x4 /* DW_CFA_advance_loc4 */
- .4byte .LCFID-.LCFIC
- .byte 0xe /* DW_CFA_def_cfa_offset */
-#if defined(__SH4__)
- .byte 24+48 /* uleb128 24+48 */
-#else
- .byte 24+16 /* uleb128 24+16 */
-#endif
- .byte 0x91 /* DW_CFA_offset, column 0x11 */
- .byte 0x6 /* uleb128 0x6 */
- .byte 0x8e /* DW_CFA_offset, column 0xe */
- .byte 0x5 /* uleb128 0x5 */
- .byte 0x84 /* DW_CFA_offset, column 0x4 */
- .byte 0x4 /* uleb128 0x4 */
- .byte 0x85 /* DW_CFA_offset, column 0x5 */
- .byte 0x3 /* uleb128 0x3 */
- .byte 0x86 /* DW_CFA_offset, column 0x6 */
- .byte 0x2 /* uleb128 0x2 */
- .byte 0x87 /* DW_CFA_offset, column 0x7 */
- .byte 0x1 /* uleb128 0x1 */
- .byte 0x4 /* DW_CFA_advance_loc4 */
- .4byte .LCFIE-.LCFID
- .byte 0xd /* DW_CFA_def_cfa_register */
- .byte 0xe /* uleb128 0xe */
- .align 2
-.LEFDE3:
diff --git a/Modules/_ctypes/libffi/src/sh64/ffi.c b/Modules/_ctypes/libffi/src/sh64/ffi.c
deleted file mode 100644
index 123b87ace9..0000000000
--- a/Modules/_ctypes/libffi/src/sh64/ffi.c
+++ /dev/null
@@ -1,469 +0,0 @@
-/* -----------------------------------------------------------------------
- ffi.c - Copyright (c) 2003, 2004, 2006, 2007, 2012 Kaz Kojima
- Copyright (c) 2008 Anthony Green
-
- SuperH SHmedia Foreign Function Interface
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- ``Software''), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to
- permit persons to whom the Software is furnished to do so, subject to
- the following conditions:
-
- The above copyright notice and this permission notice shall be included
- in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- DEALINGS IN THE SOFTWARE.
- ----------------------------------------------------------------------- */
-
-#include <ffi.h>
-#include <ffi_common.h>
-
-#include <stdlib.h>
-
-#define NGREGARG 8
-#define NFREGARG 12
-
-static int
-return_type (ffi_type *arg)
-{
-
- if (arg->type != FFI_TYPE_STRUCT)
- return arg->type;
-
- /* gcc uses r2 if the result can be packed in on register. */
- if (arg->size <= sizeof (UINT8))
- return FFI_TYPE_UINT8;
- else if (arg->size <= sizeof (UINT16))
- return FFI_TYPE_UINT16;
- else if (arg->size <= sizeof (UINT32))
- return FFI_TYPE_UINT32;
- else if (arg->size <= sizeof (UINT64))
- return FFI_TYPE_UINT64;
-
- return FFI_TYPE_STRUCT;
-}
-
-/* ffi_prep_args is called by the assembly routine once stack space
- has been allocated for the function's arguments */
-
-void ffi_prep_args(char *stack, extended_cif *ecif)
-{
- register unsigned int i;
- register unsigned int avn;
- register void **p_argv;
- register char *argp;
- register ffi_type **p_arg;
-
- argp = stack;
-
- if (return_type (ecif->cif->rtype) == FFI_TYPE_STRUCT)
- {
- *(void **) argp = ecif->rvalue;
- argp += sizeof (UINT64);
- }
-
- avn = ecif->cif->nargs;
- p_argv = ecif->avalue;
-
- for (i = 0, p_arg = ecif->cif->arg_types; i < avn; i++, p_arg++, p_argv++)
- {
- size_t z;
- int align;
-
- z = (*p_arg)->size;
- align = (*p_arg)->alignment;
- if (z < sizeof (UINT32))
- {
- switch ((*p_arg)->type)
- {
- case FFI_TYPE_SINT8:
- *(SINT64 *) argp = (SINT64) *(SINT8 *)(*p_argv);
- break;
-
- case FFI_TYPE_UINT8:
- *(UINT64 *) argp = (UINT64) *(UINT8 *)(*p_argv);
- break;
-
- case FFI_TYPE_SINT16:
- *(SINT64 *) argp = (SINT64) *(SINT16 *)(*p_argv);
- break;
-
- case FFI_TYPE_UINT16:
- *(UINT64 *) argp = (UINT64) *(UINT16 *)(*p_argv);
- break;
-
- case FFI_TYPE_STRUCT:
- memcpy (argp, *p_argv, z);
- break;
-
- default:
- FFI_ASSERT(0);
- }
- argp += sizeof (UINT64);
- }
- else if (z == sizeof (UINT32) && align == sizeof (UINT32))
- {
- switch ((*p_arg)->type)
- {
- case FFI_TYPE_INT:
- case FFI_TYPE_SINT32:
- *(SINT64 *) argp = (SINT64) *(SINT32 *) (*p_argv);
- break;
-
- case FFI_TYPE_FLOAT:
- case FFI_TYPE_POINTER:
- case FFI_TYPE_UINT32:
- case FFI_TYPE_STRUCT:
- *(UINT64 *) argp = (UINT64) *(UINT32 *) (*p_argv);
- break;
-
- default:
- FFI_ASSERT(0);
- break;
- }
- argp += sizeof (UINT64);
- }
- else if (z == sizeof (UINT64)
- && align == sizeof (UINT64)
- && ((int) *p_argv & (sizeof (UINT64) - 1)) == 0)
- {
- *(UINT64 *) argp = *(UINT64 *) (*p_argv);
- argp += sizeof (UINT64);
- }
- else
- {
- int n = (z + sizeof (UINT64) - 1) / sizeof (UINT64);
-
- memcpy (argp, *p_argv, z);
- argp += n * sizeof (UINT64);
- }
- }
-
- return;
-}
-
-/* Perform machine dependent cif processing */
-ffi_status ffi_prep_cif_machdep(ffi_cif *cif)
-{
- int i, j;
- int size, type;
- int n, m;
- int greg;
- int freg;
- int fpair = -1;
-
- greg = (return_type (cif->rtype) == FFI_TYPE_STRUCT ? 1 : 0);
- freg = 0;
- cif->flags2 = 0;
-
- for (i = j = 0; i < cif->nargs; i++)
- {
- type = (cif->arg_types)[i]->type;
- switch (type)
- {
- case FFI_TYPE_FLOAT:
- greg++;
- cif->bytes += sizeof (UINT64) - sizeof (float);
- if (freg >= NFREGARG - 1)
- continue;
- if (fpair < 0)
- {
- fpair = freg;
- freg += 2;
- }
- else
- fpair = -1;
- cif->flags2 += ((cif->arg_types)[i]->type) << (2 * j++);
- break;
-
- case FFI_TYPE_DOUBLE:
- if (greg++ >= NGREGARG && (freg + 1) >= NFREGARG)
- continue;
- if ((freg + 1) < NFREGARG)
- {
- freg += 2;
- cif->flags2 += ((cif->arg_types)[i]->type) << (2 * j++);
- }
- else
- cif->flags2 += FFI_TYPE_INT << (2 * j++);
- break;
-
- default:
- size = (cif->arg_types)[i]->size;
- if (size < sizeof (UINT64))
- cif->bytes += sizeof (UINT64) - size;
- n = (size + sizeof (UINT64) - 1) / sizeof (UINT64);
- if (greg >= NGREGARG)
- continue;
- else if (greg + n - 1 >= NGREGARG)
- greg = NGREGARG;
- else
- greg += n;
- for (m = 0; m < n; m++)
- cif->flags2 += FFI_TYPE_INT << (2 * j++);
- break;
- }
- }
-
- /* Set the return type flag */
- switch (cif->rtype->type)
- {
- case FFI_TYPE_STRUCT:
- cif->flags = return_type (cif->rtype);
- break;
-
- case FFI_TYPE_VOID:
- case FFI_TYPE_FLOAT:
- case FFI_TYPE_DOUBLE:
- case FFI_TYPE_SINT64:
- case FFI_TYPE_UINT64:
- cif->flags = cif->rtype->type;
- break;
-
- default:
- cif->flags = FFI_TYPE_INT;
- break;
- }
-
- return FFI_OK;
-}
-
-/*@-declundef@*/
-/*@-exportheader@*/
-extern void ffi_call_SYSV(void (*)(char *, extended_cif *),
- /*@out@*/ extended_cif *,
- unsigned, unsigned, long long,
- /*@out@*/ unsigned *,
- void (*fn)(void));
-/*@=declundef@*/
-/*@=exportheader@*/
-
-void ffi_call(/*@dependent@*/ ffi_cif *cif,
- void (*fn)(void),
- /*@out@*/ void *rvalue,
- /*@dependent@*/ void **avalue)
-{
- extended_cif ecif;
- UINT64 trvalue;
-
- ecif.cif = cif;
- ecif.avalue = avalue;
-
- /* If the return value is a struct and we don't have a return */
- /* value address then we need to make one */
-
- if (cif->rtype->type == FFI_TYPE_STRUCT
- && return_type (cif->rtype) != FFI_TYPE_STRUCT)
- ecif.rvalue = &trvalue;
- else if ((rvalue == NULL) &&
- (cif->rtype->type == FFI_TYPE_STRUCT))
- {
- ecif.rvalue = alloca(cif->rtype->size);
- }
- else
- ecif.rvalue = rvalue;
-
- switch (cif->abi)
- {
- case FFI_SYSV:
- ffi_call_SYSV(ffi_prep_args, &ecif, cif->bytes, cif->flags, cif->flags2,
- ecif.rvalue, fn);
- break;
- default:
- FFI_ASSERT(0);
- break;
- }
-
- if (rvalue
- && cif->rtype->type == FFI_TYPE_STRUCT
- && return_type (cif->rtype) != FFI_TYPE_STRUCT)
- memcpy (rvalue, &trvalue, cif->rtype->size);
-}
-
-extern void ffi_closure_SYSV (void);
-extern void __ic_invalidate (void *line);
-
-ffi_status
-ffi_prep_closure_loc (ffi_closure *closure,
- ffi_cif *cif,
- void (*fun)(ffi_cif*, void*, void**, void*),
- void *user_data,
- void *codeloc)
-{
- unsigned int *tramp;
-
- if (cif->abi != FFI_SYSV)
- return FFI_BAD_ABI;
-
- tramp = (unsigned int *) &closure->tramp[0];
- /* Since ffi_closure is an aligned object, the ffi trampoline is
- called as an SHcompact code. Sigh.
- SHcompact part:
- mova @(1,pc),r0; add #1,r0; jmp @r0; nop;
- SHmedia part:
- movi fnaddr >> 16,r1; shori fnaddr,r1; ptabs/l r1,tr0
- movi cxt >> 16,r1; shori cxt,r1; blink tr0,r63 */
-#ifdef __LITTLE_ENDIAN__
- tramp[0] = 0x7001c701;
- tramp[1] = 0x0009402b;
-#else
- tramp[0] = 0xc7017001;
- tramp[1] = 0x402b0009;
-#endif
- tramp[2] = 0xcc000010 | (((UINT32) ffi_closure_SYSV) >> 16) << 10;
- tramp[3] = 0xc8000010 | (((UINT32) ffi_closure_SYSV) & 0xffff) << 10;
- tramp[4] = 0x6bf10600;
- tramp[5] = 0xcc000010 | (((UINT32) codeloc) >> 16) << 10;
- tramp[6] = 0xc8000010 | (((UINT32) codeloc) & 0xffff) << 10;
- tramp[7] = 0x4401fff0;
-
- closure->cif = cif;
- closure->fun = fun;
- closure->user_data = user_data;
-
- /* Flush the icache. */
- asm volatile ("ocbwb %0,0; synco; icbi %1,0; synci" : : "r" (tramp),
- "r"(codeloc));
-
- return FFI_OK;
-}
-
-/* Basically the trampoline invokes ffi_closure_SYSV, and on
- * entry, r3 holds the address of the closure.
- * After storing the registers that could possibly contain
- * parameters to be passed into the stack frame and setting
- * up space for a return value, ffi_closure_SYSV invokes the
- * following helper function to do most of the work.
- */
-
-int
-ffi_closure_helper_SYSV (ffi_closure *closure, UINT64 *rvalue,
- UINT64 *pgr, UINT64 *pfr, UINT64 *pst)
-{
- void **avalue;
- ffi_type **p_arg;
- int i, avn;
- int greg, freg;
- ffi_cif *cif;
- int fpair = -1;
-
- cif = closure->cif;
- avalue = alloca (cif->nargs * sizeof (void *));
-
- /* Copy the caller's structure return value address so that the closure
- returns the data directly to the caller. */
- if (return_type (cif->rtype) == FFI_TYPE_STRUCT)
- {
- rvalue = (UINT64 *) *pgr;
- greg = 1;
- }
- else
- greg = 0;
-
- freg = 0;
- cif = closure->cif;
- avn = cif->nargs;
-
- /* Grab the addresses of the arguments from the stack frame. */
- for (i = 0, p_arg = cif->arg_types; i < avn; i++, p_arg++)
- {
- size_t z;
- void *p;
-
- z = (*p_arg)->size;
- if (z < sizeof (UINT32))
- {
- p = pgr + greg++;
-
- switch ((*p_arg)->type)
- {
- case FFI_TYPE_SINT8:
- case FFI_TYPE_UINT8:
- case FFI_TYPE_SINT16:
- case FFI_TYPE_UINT16:
- case FFI_TYPE_STRUCT:
-#ifdef __LITTLE_ENDIAN__
- avalue[i] = p;
-#else
- avalue[i] = ((char *) p) + sizeof (UINT32) - z;
-#endif
- break;
-
- default:
- FFI_ASSERT(0);
- }
- }
- else if (z == sizeof (UINT32))
- {
- if ((*p_arg)->type == FFI_TYPE_FLOAT)
- {
- if (freg < NFREGARG - 1)
- {
- if (fpair >= 0)
- {
- avalue[i] = (UINT32 *) pfr + fpair;
- fpair = -1;
- }
- else
- {
-#ifdef __LITTLE_ENDIAN__
- fpair = freg;
- avalue[i] = (UINT32 *) pfr + (1 ^ freg);
-#else
- fpair = 1 ^ freg;
- avalue[i] = (UINT32 *) pfr + freg;
-#endif
- freg += 2;
- }
- }
- else
-#ifdef __LITTLE_ENDIAN__
- avalue[i] = pgr + greg;
-#else
- avalue[i] = (UINT32 *) (pgr + greg) + 1;
-#endif
- }
- else
-#ifdef __LITTLE_ENDIAN__
- avalue[i] = pgr + greg;
-#else
- avalue[i] = (UINT32 *) (pgr + greg) + 1;
-#endif
- greg++;
- }
- else if ((*p_arg)->type == FFI_TYPE_DOUBLE)
- {
- if (freg + 1 >= NFREGARG)
- avalue[i] = pgr + greg;
- else
- {
- avalue[i] = pfr + (freg >> 1);
- freg += 2;
- }
- greg++;
- }
- else
- {
- int n = (z + sizeof (UINT64) - 1) / sizeof (UINT64);
-
- avalue[i] = pgr + greg;
- greg += n;
- }
- }
-
- (closure->fun) (cif, rvalue, avalue, closure->user_data);
-
- /* Tell ffi_closure_SYSV how to perform return type promotions. */
- return return_type (cif->rtype);
-}
-
diff --git a/Modules/_ctypes/libffi/src/sh64/ffitarget.h b/Modules/_ctypes/libffi/src/sh64/ffitarget.h
deleted file mode 100644
index 08a6fe96cc..0000000000
--- a/Modules/_ctypes/libffi/src/sh64/ffitarget.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/* -----------------------------------------------------------------*-C-*-
- ffitarget.h - Copyright (c) 2012 Anthony Green
- Copyright (c) 1996-2003 Red Hat, Inc.
- Target configuration macros for SuperH - SHmedia.
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- ``Software''), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to
- permit persons to whom the Software is furnished to do so, subject to
- the following conditions:
-
- The above copyright notice and this permission notice shall be included
- in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- DEALINGS IN THE SOFTWARE.
-
- ----------------------------------------------------------------------- */
-
-#ifndef LIBFFI_TARGET_H
-#define LIBFFI_TARGET_H
-
-#ifndef LIBFFI_H
-#error "Please do not include ffitarget.h directly into your source. Use ffi.h instead."
-#endif
-
-/* ---- Generic type definitions ----------------------------------------- */
-
-#ifndef LIBFFI_ASM
-typedef unsigned long ffi_arg;
-typedef signed long ffi_sarg;
-
-typedef enum ffi_abi {
- FFI_FIRST_ABI = 0,
- FFI_SYSV,
- FFI_LAST_ABI,
- FFI_DEFAULT_ABI = FFI_SYSV
-} ffi_abi;
-
-#define FFI_EXTRA_CIF_FIELDS long long flags2
-#endif
-
-/* ---- Definitions for closures ----------------------------------------- */
-
-#define FFI_CLOSURES 1
-#define FFI_TRAMPOLINE_SIZE 32
-#define FFI_NATIVE_RAW_API 0
-
-#endif
-
diff --git a/Modules/_ctypes/libffi/src/sh64/sysv.S b/Modules/_ctypes/libffi/src/sh64/sysv.S
deleted file mode 100644
index c4587d5f3e..0000000000
--- a/Modules/_ctypes/libffi/src/sh64/sysv.S
+++ /dev/null
@@ -1,539 +0,0 @@
-/* -----------------------------------------------------------------------
- sysv.S - Copyright (c) 2003, 2004, 2006, 2008 Kaz Kojima
-
- SuperH SHmedia Foreign Function Interface
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- ``Software''), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to
- permit persons to whom the Software is furnished to do so, subject to
- the following conditions:
-
- The above copyright notice and this permission notice shall be included
- in all copies or substantial portions of the Software.
-
-
- THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- DEALINGS IN THE SOFTWARE.
- ----------------------------------------------------------------------- */
-
-#define LIBFFI_ASM
-#include <fficonfig.h>
-#include <ffi.h>
-#ifdef HAVE_MACHINE_ASM_H
-#include <machine/asm.h>
-#else
-/* XXX these lose for some platforms, I'm sure. */
-#define CNAME(x) x
-#define ENTRY(x) .globl CNAME(x); .type CNAME(x),%function; CNAME(x):
-#endif
-
-#ifdef __LITTLE_ENDIAN__
-#define OFS_FLT 0
-#else
-#define OFS_FLT 4
-#endif
-
- .section .text..SHmedia32,"ax"
-
- # r2: ffi_prep_args
- # r3: &ecif
- # r4: bytes
- # r5: flags
- # r6: flags2
- # r7: rvalue
- # r8: fn
-
- # This assumes we are using gas.
- .align 5
-ENTRY(ffi_call_SYSV)
- # Save registers
-.LFB1:
- addi.l r15, -48, r15
-.LCFI0:
- st.q r15, 40, r32
- st.q r15, 32, r31
- st.q r15, 24, r30
- st.q r15, 16, r29
- st.q r15, 8, r28
- st.l r15, 4, r18
- st.l r15, 0, r14
-.LCFI1:
- add.l r15, r63, r14
-.LCFI2:
-# add r4, r63, r28
- add r5, r63, r29
- add r6, r63, r30
- add r7, r63, r31
- add r8, r63, r32
-
- addi r4, (64 + 7), r4
- andi r4, ~7, r4
- sub.l r15, r4, r15
-
- ptabs/l r2, tr0
- add r15, r63, r2
- blink tr0, r18
-
- addi r15, 64, r22
- movi 0, r0
- movi 0, r1
- movi -1, r23
-
- pt/l 1f, tr1
- bnei/l r29, FFI_TYPE_STRUCT, tr1
- ld.l r15, 0, r19
- addi r15, 8, r15
- addi r0, 1, r0
-1:
-
-.L_pass:
- andi r30, 3, r20
- shlri r30, 2, r30
-
- pt/l .L_call_it, tr0
- pt/l .L_pass_i, tr1
- pt/l .L_pass_f, tr2
-
- beqi/l r20, FFI_TYPE_VOID, tr0
- beqi/l r20, FFI_TYPE_INT, tr1
- beqi/l r20, FFI_TYPE_FLOAT, tr2
-
-.L_pass_d:
- addi r0, 1, r0
- pt/l 3f, tr0
- movi 12, r20
- bge/l r1, r20, tr0
-
- pt/l .L_pop_d, tr1
- pt/l 2f, tr0
- blink tr1, r63
-2:
- addi.l r15, 8, r15
-3:
- pt/l .L_pass, tr0
- addi r1, 2, r1
- blink tr0, r63
-
-.L_pop_d:
- pt/l .L_pop_d_tbl, tr1
- gettr tr1, r20
- shlli r1, 2, r21
- add r20, r21, r20
- ptabs/l r20, tr1
- blink tr1, r63
-
-.L_pop_d_tbl:
- fld.d r15, 0, dr0
- blink tr0, r63
- fld.d r15, 0, dr2
- blink tr0, r63
- fld.d r15, 0, dr4
- blink tr0, r63
- fld.d r15, 0, dr6
- blink tr0, r63
- fld.d r15, 0, dr8
- blink tr0, r63
- fld.d r15, 0, dr10
- blink tr0, r63
-
-.L_pass_f:
- addi r0, 1, r0
- pt/l 3f, tr0
- movi 12, r20
- bge/l r1, r20, tr0
-
- pt/l .L_pop_f, tr1
- pt/l 2f, tr0
- blink tr1, r63
-2:
- addi.l r15, 8, r15
-3:
- pt/l .L_pass, tr0
- blink tr0, r63
-
-.L_pop_f:
- pt/l .L_pop_f_tbl, tr1
- pt/l 5f, tr2
- gettr tr1, r20
- bge/l r23, r63, tr2
- add r1, r63, r23
- shlli r1, 3, r21
- addi r1, 2, r1
- add r20, r21, r20
- ptabs/l r20, tr1
- blink tr1, r63
-5:
- addi r23, 1, r21
- movi -1, r23
- shlli r21, 3, r21
- add r20, r21, r20
- ptabs/l r20, tr1
- blink tr1, r63
-
-.L_pop_f_tbl:
- fld.s r15, OFS_FLT, fr0
- blink tr0, r63
- fld.s r15, OFS_FLT, fr1
- blink tr0, r63
- fld.s r15, OFS_FLT, fr2
- blink tr0, r63
- fld.s r15, OFS_FLT, fr3
- blink tr0, r63
- fld.s r15, OFS_FLT, fr4
- blink tr0, r63
- fld.s r15, OFS_FLT, fr5
- blink tr0, r63
- fld.s r15, OFS_FLT, fr6
- blink tr0, r63
- fld.s r15, OFS_FLT, fr7
- blink tr0, r63
- fld.s r15, OFS_FLT, fr8
- blink tr0, r63
- fld.s r15, OFS_FLT, fr9
- blink tr0, r63
- fld.s r15, OFS_FLT, fr10
- blink tr0, r63
- fld.s r15, OFS_FLT, fr11
- blink tr0, r63
-
-.L_pass_i:
- pt/l 3f, tr0
- movi 8, r20
- bge/l r0, r20, tr0
-
- pt/l .L_pop_i, tr1
- pt/l 2f, tr0
- blink tr1, r63
-2:
- addi.l r15, 8, r15
-3:
- pt/l .L_pass, tr0
- addi r0, 1, r0
- blink tr0, r63
-
-.L_pop_i:
- pt/l .L_pop_i_tbl, tr1
- gettr tr1, r20
- shlli r0, 3, r21
- add r20, r21, r20
- ptabs/l r20, tr1
- blink tr1, r63
-
-.L_pop_i_tbl:
- ld.q r15, 0, r2
- blink tr0, r63
- ld.q r15, 0, r3
- blink tr0, r63
- ld.q r15, 0, r4
- blink tr0, r63
- ld.q r15, 0, r5
- blink tr0, r63
- ld.q r15, 0, r6
- blink tr0, r63
- ld.q r15, 0, r7
- blink tr0, r63
- ld.q r15, 0, r8
- blink tr0, r63
- ld.q r15, 0, r9
- blink tr0, r63
-
-.L_call_it:
- # call function
- pt/l 1f, tr1
- bnei/l r29, FFI_TYPE_STRUCT, tr1
- add r19, r63, r2
-1:
- add r22, r63, r15
- ptabs/l r32, tr0
- blink tr0, r18
-
- pt/l .L_ret_i, tr0
- pt/l .L_ret_ll, tr1
- pt/l .L_ret_d, tr2
- pt/l .L_ret_f, tr3
- pt/l .L_epilogue, tr4
-
- beqi/l r29, FFI_TYPE_INT, tr0
- beqi/l r29, FFI_TYPE_UINT32, tr0
- beqi/l r29, FFI_TYPE_SINT64, tr1
- beqi/l r29, FFI_TYPE_UINT64, tr1
- beqi/l r29, FFI_TYPE_DOUBLE, tr2
- beqi/l r29, FFI_TYPE_FLOAT, tr3
-
- pt/l .L_ret_q, tr0
- pt/l .L_ret_h, tr1
-
- beqi/l r29, FFI_TYPE_UINT8, tr0
- beqi/l r29, FFI_TYPE_UINT16, tr1
- blink tr4, r63
-
-.L_ret_d:
- fst.d r31, 0, dr0
- blink tr4, r63
-
-.L_ret_ll:
- st.q r31, 0, r2
- blink tr4, r63
-
-.L_ret_f:
- fst.s r31, OFS_FLT, fr0
- blink tr4, r63
-
-.L_ret_q:
- st.b r31, 0, r2
- blink tr4, r63
-
-.L_ret_h:
- st.w r31, 0, r2
- blink tr4, r63
-
-.L_ret_i:
- st.l r31, 0, r2
- # Fall
-
-.L_epilogue:
- # Remove the space we pushed for the args
- add r14, r63, r15
-
- ld.l r15, 0, r14
- ld.l r15, 4, r18
- ld.q r15, 8, r28
- ld.q r15, 16, r29
- ld.q r15, 24, r30
- ld.q r15, 32, r31
- ld.q r15, 40, r32
- addi.l r15, 48, r15
- ptabs r18, tr0
- blink tr0, r63
-
-.LFE1:
-.ffi_call_SYSV_end:
- .size CNAME(ffi_call_SYSV),.ffi_call_SYSV_end-CNAME(ffi_call_SYSV)
-
- .align 5
-ENTRY(ffi_closure_SYSV)
-.LFB2:
- addi.l r15, -136, r15
-.LCFI3:
- st.l r15, 12, r18
- st.l r15, 8, r14
- st.l r15, 4, r12
-.LCFI4:
- add r15, r63, r14
-.LCFI5:
- /* Stack layout:
- ...
- 64 bytes (register parameters)
- 48 bytes (floating register parameters)
- 8 bytes (result)
- 4 bytes (r18)
- 4 bytes (r14)
- 4 bytes (r12)
- 4 bytes (for align)
- <- new stack pointer
- */
- fst.d r14, 24, dr0
- fst.d r14, 32, dr2
- fst.d r14, 40, dr4
- fst.d r14, 48, dr6
- fst.d r14, 56, dr8
- fst.d r14, 64, dr10
- st.q r14, 72, r2
- st.q r14, 80, r3
- st.q r14, 88, r4
- st.q r14, 96, r5
- st.q r14, 104, r6
- st.q r14, 112, r7
- st.q r14, 120, r8
- st.q r14, 128, r9
-
- add r1, r63, r2
- addi r14, 16, r3
- addi r14, 72, r4
- addi r14, 24, r5
- addi r14, 136, r6
-#ifdef PIC
- movi (((datalabel _GLOBAL_OFFSET_TABLE_-(.LPCS0-.)) >> 16) & 65535), r12
- shori ((datalabel _GLOBAL_OFFSET_TABLE_-(.LPCS0-.)) & 65535), r12
-.LPCS0: ptrel/u r12, tr0
- movi ((ffi_closure_helper_SYSV@GOTPLT) & 65535), r1
- gettr tr0, r12
- ldx.l r1, r12, r1
- ptabs r1, tr0
-#else
- pt/l ffi_closure_helper_SYSV, tr0
-#endif
- blink tr0, r18
-
- shlli r2, 1, r1
- movi (((datalabel .L_table) >> 16) & 65535), r2
- shori ((datalabel .L_table) & 65535), r2
- ldx.w r2, r1, r1
- add r1, r2, r1
- pt/l .L_case_v, tr1
- ptabs r1, tr0
- blink tr0, r63
-
- .align 2
-.L_table:
- .word .L_case_v - datalabel .L_table /* FFI_TYPE_VOID */
- .word .L_case_i - datalabel .L_table /* FFI_TYPE_INT */
- .word .L_case_f - datalabel .L_table /* FFI_TYPE_FLOAT */
- .word .L_case_d - datalabel .L_table /* FFI_TYPE_DOUBLE */
- .word .L_case_d - datalabel .L_table /* FFI_TYPE_LONGDOUBLE */
- .word .L_case_uq - datalabel .L_table /* FFI_TYPE_UINT8 */
- .word .L_case_q - datalabel .L_table /* FFI_TYPE_SINT8 */
- .word .L_case_uh - datalabel .L_table /* FFI_TYPE_UINT16 */
- .word .L_case_h - datalabel .L_table /* FFI_TYPE_SINT16 */
- .word .L_case_i - datalabel .L_table /* FFI_TYPE_UINT32 */
- .word .L_case_i - datalabel .L_table /* FFI_TYPE_SINT32 */
- .word .L_case_ll - datalabel .L_table /* FFI_TYPE_UINT64 */
- .word .L_case_ll - datalabel .L_table /* FFI_TYPE_SINT64 */
- .word .L_case_v - datalabel .L_table /* FFI_TYPE_STRUCT */
- .word .L_case_i - datalabel .L_table /* FFI_TYPE_POINTER */
-
- .align 2
-.L_case_d:
- fld.d r14, 16, dr0
- blink tr1, r63
-.L_case_f:
- fld.s r14, 16, fr0
- blink tr1, r63
-.L_case_ll:
- ld.q r14, 16, r2
- blink tr1, r63
-.L_case_i:
- ld.l r14, 16, r2
- blink tr1, r63
-.L_case_q:
- ld.b r14, 16, r2
- blink tr1, r63
-.L_case_uq:
- ld.ub r14, 16, r2
- blink tr1, r63
-.L_case_h:
- ld.w r14, 16, r2
- blink tr1, r63
-.L_case_uh:
- ld.uw r14, 16, r2
- blink tr1, r63
-.L_case_v:
- add.l r14, r63, r15
- ld.l r15, 4, r12
- ld.l r15, 8, r14
- ld.l r15, 12, r18
- addi.l r15, 136, r15
- ptabs r18, tr0
- blink tr0, r63
-
-.LFE2:
-.ffi_closure_SYSV_end:
- .size CNAME(ffi_closure_SYSV),.ffi_closure_SYSV_end-CNAME(ffi_closure_SYSV)
-
-#if defined __ELF__ && defined __linux__
- .section .note.GNU-stack,"",@progbits
-#endif
-
- .section ".eh_frame","aw",@progbits
-__FRAME_BEGIN__:
- .4byte .LECIE1-.LSCIE1 /* Length of Common Information Entry */
-.LSCIE1:
- .4byte 0x0 /* CIE Identifier Tag */
- .byte 0x1 /* CIE Version */
-#ifdef PIC
- .ascii "zR\0" /* CIE Augmentation */
-#else
- .byte 0x0 /* CIE Augmentation */
-#endif
- .uleb128 0x1 /* CIE Code Alignment Factor */
- .sleb128 -4 /* CIE Data Alignment Factor */
- .byte 0x12 /* CIE RA Column */
-#ifdef PIC
- .uleb128 0x1 /* Augmentation size */
- .byte 0x10 /* FDE Encoding (pcrel) */
-#endif
- .byte 0xc /* DW_CFA_def_cfa */
- .uleb128 0xf
- .uleb128 0x0
- .align 2
-.LECIE1:
-.LSFDE1:
- .4byte datalabel .LEFDE1-datalabel .LASFDE1 /* FDE Length */
-.LASFDE1:
- .4byte datalabel .LASFDE1-datalabel __FRAME_BEGIN__
-#ifdef PIC
- .4byte .LFB1-. /* FDE initial location */
-#else
- .4byte .LFB1 /* FDE initial location */
-#endif
- .4byte datalabel .LFE1-datalabel .LFB1 /* FDE address range */
-#ifdef PIC
- .uleb128 0x0 /* Augmentation size */
-#endif
- .byte 0x4 /* DW_CFA_advance_loc4 */
- .4byte datalabel .LCFI0-datalabel .LFB1
- .byte 0xe /* DW_CFA_def_cfa_offset */
- .uleb128 0x30
- .byte 0x4 /* DW_CFA_advance_loc4 */
- .4byte datalabel .LCFI1-datalabel .LCFI0
- .byte 0x8e /* DW_CFA_offset, column 0xe */
- .uleb128 0xc
- .byte 0x92 /* DW_CFA_offset, column 0x12 */
- .uleb128 0xb
- .byte 0x9c /* DW_CFA_offset, column 0x1c */
- .uleb128 0xa
- .byte 0x9d /* DW_CFA_offset, column 0x1d */
- .uleb128 0x8
- .byte 0x9e /* DW_CFA_offset, column 0x1e */
- .uleb128 0x6
- .byte 0x9f /* DW_CFA_offset, column 0x1f */
- .uleb128 0x4
- .byte 0xa0 /* DW_CFA_offset, column 0x20 */
- .uleb128 0x2
- .byte 0x4 /* DW_CFA_advance_loc4 */
- .4byte datalabel .LCFI2-datalabel .LCFI1
- .byte 0xd /* DW_CFA_def_cfa_register */
- .uleb128 0xe
- .align 2
-.LEFDE1:
-
-.LSFDE3:
- .4byte datalabel .LEFDE3-datalabel .LASFDE3 /* FDE Length */
-.LASFDE3:
- .4byte datalabel .LASFDE3-datalabel __FRAME_BEGIN__
-#ifdef PIC
- .4byte .LFB2-. /* FDE initial location */
-#else
- .4byte .LFB2 /* FDE initial location */
-#endif
- .4byte datalabel .LFE2-datalabel .LFB2 /* FDE address range */
-#ifdef PIC
- .uleb128 0x0 /* Augmentation size */
-#endif
- .byte 0x4 /* DW_CFA_advance_loc4 */
- .4byte datalabel .LCFI3-datalabel .LFB2
- .byte 0xe /* DW_CFA_def_cfa_offset */
- .uleb128 0x88
- .byte 0x4 /* DW_CFA_advance_loc4 */
- .4byte datalabel .LCFI4-datalabel .LCFI3
- .byte 0x8c /* DW_CFA_offset, column 0xc */
- .uleb128 0x21
- .byte 0x8e /* DW_CFA_offset, column 0xe */
- .uleb128 0x20
- .byte 0x92 /* DW_CFA_offset, column 0x12 */
- .uleb128 0x1f
- .byte 0x4 /* DW_CFA_advance_loc4 */
- .4byte datalabel .LCFI5-datalabel .LCFI4
- .byte 0xd /* DW_CFA_def_cfa_register */
- .uleb128 0xe
- .align 2
-.LEFDE3:
diff --git a/Modules/_ctypes/libffi/src/sparc/ffi.c b/Modules/_ctypes/libffi/src/sparc/ffi.c
deleted file mode 100644
index 9f0fded489..0000000000
--- a/Modules/_ctypes/libffi/src/sparc/ffi.c
+++ /dev/null
@@ -1,681 +0,0 @@
-/* -----------------------------------------------------------------------
- ffi.c - Copyright (c) 2011, 2013 Anthony Green
- Copyright (c) 1996, 2003-2004, 2007-2008 Red Hat, Inc.
-
- SPARC Foreign Function Interface
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- ``Software''), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to
- permit persons to whom the Software is furnished to do so, subject to
- the following conditions:
-
- The above copyright notice and this permission notice shall be included
- in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- DEALINGS IN THE SOFTWARE.
- ----------------------------------------------------------------------- */
-
-#include <ffi.h>
-#include <ffi_common.h>
-
-#include <stdlib.h>
-
-
-/* ffi_prep_args is called by the assembly routine once stack space
- has been allocated for the function's arguments */
-
-void ffi_prep_args_v8(char *stack, extended_cif *ecif)
-{
- int i;
- void **p_argv;
- char *argp;
- ffi_type **p_arg;
-
- /* Skip 16 words for the window save area */
- argp = stack + 16*sizeof(int);
-
- /* This should only really be done when we are returning a structure,
- however, it's faster just to do it all the time...
-
- if ( ecif->cif->rtype->type == FFI_TYPE_STRUCT ) */
- *(int *) argp = (long)ecif->rvalue;
-
- /* And 1 word for the structure return value. */
- argp += sizeof(int);
-
-#ifdef USING_PURIFY
- /* Purify will probably complain in our assembly routine, unless we
- zero out this memory. */
-
- ((int*)argp)[0] = 0;
- ((int*)argp)[1] = 0;
- ((int*)argp)[2] = 0;
- ((int*)argp)[3] = 0;
- ((int*)argp)[4] = 0;
- ((int*)argp)[5] = 0;
-#endif
-
- p_argv = ecif->avalue;
-
- for (i = ecif->cif->nargs, p_arg = ecif->cif->arg_types; i; i--, p_arg++)
- {
- size_t z;
-
- if ((*p_arg)->type == FFI_TYPE_STRUCT
-#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE
- || (*p_arg)->type == FFI_TYPE_LONGDOUBLE
-#endif
- )
- {
- *(unsigned int *) argp = (unsigned long)(* p_argv);
- z = sizeof(int);
- }
- else
- {
- z = (*p_arg)->size;
- if (z < sizeof(int))
- {
- z = sizeof(int);
- switch ((*p_arg)->type)
- {
- case FFI_TYPE_SINT8:
- *(signed int *) argp = *(SINT8 *)(* p_argv);
- break;
-
- case FFI_TYPE_UINT8:
- *(unsigned int *) argp = *(UINT8 *)(* p_argv);
- break;
-
- case FFI_TYPE_SINT16:
- *(signed int *) argp = *(SINT16 *)(* p_argv);
- break;
-
- case FFI_TYPE_UINT16:
- *(unsigned int *) argp = *(UINT16 *)(* p_argv);
- break;
-
- default:
- FFI_ASSERT(0);
- }
- }
- else
- {
- memcpy(argp, *p_argv, z);
- }
- }
- p_argv++;
- argp += z;
- }
-
- return;
-}
-
-int ffi_prep_args_v9(char *stack, extended_cif *ecif)
-{
- int i, ret = 0;
- int tmp;
- void **p_argv;
- char *argp;
- ffi_type **p_arg;
-
- tmp = 0;
-
- /* Skip 16 words for the window save area */
- argp = stack + 16*sizeof(long long);
-
-#ifdef USING_PURIFY
- /* Purify will probably complain in our assembly routine, unless we
- zero out this memory. */
-
- ((long long*)argp)[0] = 0;
- ((long long*)argp)[1] = 0;
- ((long long*)argp)[2] = 0;
- ((long long*)argp)[3] = 0;
- ((long long*)argp)[4] = 0;
- ((long long*)argp)[5] = 0;
-#endif
-
- p_argv = ecif->avalue;
-
- if (ecif->cif->rtype->type == FFI_TYPE_STRUCT &&
- ecif->cif->rtype->size > 32)
- {
- *(unsigned long long *) argp = (unsigned long)ecif->rvalue;
- argp += sizeof(long long);
- tmp = 1;
- }
-
- for (i = 0, p_arg = ecif->cif->arg_types; i < ecif->cif->nargs;
- i++, p_arg++)
- {
- size_t z;
-
- z = (*p_arg)->size;
- switch ((*p_arg)->type)
- {
- case FFI_TYPE_STRUCT:
- if (z > 16)
- {
- /* For structures larger than 16 bytes we pass reference. */
- *(unsigned long long *) argp = (unsigned long)* p_argv;
- argp += sizeof(long long);
- tmp++;
- p_argv++;
- continue;
- }
- /* FALLTHROUGH */
- case FFI_TYPE_FLOAT:
- case FFI_TYPE_DOUBLE:
-#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE
- case FFI_TYPE_LONGDOUBLE:
-#endif
- ret = 1; /* We should promote into FP regs as well as integer. */
- break;
- }
- if (z < sizeof(long long))
- {
- switch ((*p_arg)->type)
- {
- case FFI_TYPE_SINT8:
- *(signed long long *) argp = *(SINT8 *)(* p_argv);
- break;
-
- case FFI_TYPE_UINT8:
- *(unsigned long long *) argp = *(UINT8 *)(* p_argv);
- break;
-
- case FFI_TYPE_SINT16:
- *(signed long long *) argp = *(SINT16 *)(* p_argv);
- break;
-
- case FFI_TYPE_UINT16:
- *(unsigned long long *) argp = *(UINT16 *)(* p_argv);
- break;
-
- case FFI_TYPE_SINT32:
- *(signed long long *) argp = *(SINT32 *)(* p_argv);
- break;
-
- case FFI_TYPE_UINT32:
- *(unsigned long long *) argp = *(UINT32 *)(* p_argv);
- break;
-
- case FFI_TYPE_FLOAT:
- *(float *) (argp + 4) = *(FLOAT32 *)(* p_argv); /* Right justify */
- break;
-
- case FFI_TYPE_STRUCT:
- memcpy(argp, *p_argv, z);
- break;
-
- default:
- FFI_ASSERT(0);
- }
- z = sizeof(long long);
- tmp++;
- }
- else if (z == sizeof(long long))
- {
- memcpy(argp, *p_argv, z);
- z = sizeof(long long);
- tmp++;
- }
- else
- {
- if ((tmp & 1) && (*p_arg)->alignment > 8)
- {
- tmp++;
- argp += sizeof(long long);
- }
- memcpy(argp, *p_argv, z);
- z = 2 * sizeof(long long);
- tmp += 2;
- }
- p_argv++;
- argp += z;
- }
-
- return ret;
-}
-
-/* Perform machine dependent cif processing */
-ffi_status ffi_prep_cif_machdep(ffi_cif *cif)
-{
- int wordsize;
-
- if (cif->abi != FFI_V9)
- {
- wordsize = 4;
-
- /* If we are returning a struct, this will already have been added.
- Otherwise we need to add it because it's always got to be there! */
-
- if (cif->rtype->type != FFI_TYPE_STRUCT)
- cif->bytes += wordsize;
-
- /* sparc call frames require that space is allocated for 6 args,
- even if they aren't used. Make that space if necessary. */
-
- if (cif->bytes < 4*6+4)
- cif->bytes = 4*6+4;
- }
- else
- {
- wordsize = 8;
-
- /* sparc call frames require that space is allocated for 6 args,
- even if they aren't used. Make that space if necessary. */
-
- if (cif->bytes < 8*6)
- cif->bytes = 8*6;
- }
-
- /* Adjust cif->bytes. to include 16 words for the window save area,
- and maybe the struct/union return pointer area, */
-
- cif->bytes += 16 * wordsize;
-
- /* The stack must be 2 word aligned, so round bytes up
- appropriately. */
-
- cif->bytes = ALIGN(cif->bytes, 2 * wordsize);
-
- /* Set the return type flag */
- switch (cif->rtype->type)
- {
- case FFI_TYPE_VOID:
- case FFI_TYPE_FLOAT:
- case FFI_TYPE_DOUBLE:
-#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE
- case FFI_TYPE_LONGDOUBLE:
-#endif
- cif->flags = cif->rtype->type;
- break;
-
- case FFI_TYPE_STRUCT:
- if (cif->abi == FFI_V9 && cif->rtype->size > 32)
- cif->flags = FFI_TYPE_VOID;
- else
- cif->flags = FFI_TYPE_STRUCT;
- break;
-
- case FFI_TYPE_SINT8:
- case FFI_TYPE_UINT8:
- case FFI_TYPE_SINT16:
- case FFI_TYPE_UINT16:
- if (cif->abi == FFI_V9)
- cif->flags = FFI_TYPE_INT;
- else
- cif->flags = cif->rtype->type;
- break;
-
- case FFI_TYPE_SINT64:
- case FFI_TYPE_UINT64:
- if (cif->abi == FFI_V9)
- cif->flags = FFI_TYPE_INT;
- else
- cif->flags = FFI_TYPE_SINT64;
- break;
-
- default:
- cif->flags = FFI_TYPE_INT;
- break;
- }
- return FFI_OK;
-}
-
-int ffi_v9_layout_struct(ffi_type *arg, int off, char *ret, char *intg, char *flt)
-{
- ffi_type **ptr = &arg->elements[0];
-
- while (*ptr != NULL)
- {
- if (off & ((*ptr)->alignment - 1))
- off = ALIGN(off, (*ptr)->alignment);
-
- switch ((*ptr)->type)
- {
- case FFI_TYPE_STRUCT:
- off = ffi_v9_layout_struct(*ptr, off, ret, intg, flt);
- off = ALIGN(off, FFI_SIZEOF_ARG);
- break;
- case FFI_TYPE_FLOAT:
- case FFI_TYPE_DOUBLE:
-#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE
- case FFI_TYPE_LONGDOUBLE:
-#endif
- memmove(ret + off, flt + off, (*ptr)->size);
- off += (*ptr)->size;
- break;
- default:
- memmove(ret + off, intg + off, (*ptr)->size);
- off += (*ptr)->size;
- break;
- }
- ptr++;
- }
- return off;
-}
-
-
-#ifdef SPARC64
-extern int ffi_call_v9(void *, extended_cif *, unsigned,
- unsigned, unsigned *, void (*fn)(void));
-#else
-extern int ffi_call_v8(void *, extended_cif *, unsigned,
- unsigned, unsigned *, void (*fn)(void));
-#endif
-
-#ifndef __GNUC__
-void ffi_flush_icache (void *, size_t);
-#endif
-
-void ffi_call(ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue)
-{
- extended_cif ecif;
- void *rval = rvalue;
-
- ecif.cif = cif;
- ecif.avalue = avalue;
-
- /* If the return value is a struct and we don't have a return */
- /* value address then we need to make one */
-
- ecif.rvalue = rvalue;
- if (cif->rtype->type == FFI_TYPE_STRUCT)
- {
- if (cif->rtype->size <= 32)
- rval = alloca(64);
- else
- {
- rval = NULL;
- if (rvalue == NULL)
- ecif.rvalue = alloca(cif->rtype->size);
- }
- }
-
- switch (cif->abi)
- {
- case FFI_V8:
-#ifdef SPARC64
- /* We don't yet support calling 32bit code from 64bit */
- FFI_ASSERT(0);
-#else
- if (rvalue && (cif->rtype->type == FFI_TYPE_STRUCT
-#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE
- || cif->flags == FFI_TYPE_LONGDOUBLE
-#endif
- ))
- {
- /* For v8, we need an "unimp" with size of returning struct */
- /* behind "call", so we alloc some executable space for it. */
- /* l7 is used, we need to make sure v8.S doesn't use %l7. */
- unsigned int *call_struct = NULL;
- ffi_closure_alloc(32, (void **)&call_struct);
- if (call_struct)
- {
- unsigned long f = (unsigned long)fn;
- call_struct[0] = 0xae10001f; /* mov %i7, %l7 */
- call_struct[1] = 0xbe10000f; /* mov %o7, %i7 */
- call_struct[2] = 0x03000000 | f >> 10; /* sethi %hi(fn), %g1 */
- call_struct[3] = 0x9fc06000 | (f & 0x3ff); /* jmp %g1+%lo(fn), %o7 */
- call_struct[4] = 0x01000000; /* nop */
- if (cif->rtype->size < 0x7f)
- call_struct[5] = cif->rtype->size; /* unimp */
- else
- call_struct[5] = 0x01000000; /* nop */
- call_struct[6] = 0x81c7e008; /* ret */
- call_struct[7] = 0xbe100017; /* mov %l7, %i7 */
-#ifdef __GNUC__
- asm volatile ("iflush %0; iflush %0+8; iflush %0+16; iflush %0+24" : :
- "r" (call_struct) : "memory");
- /* SPARC v8 requires 5 instructions for flush to be visible */
- asm volatile ("nop; nop; nop; nop; nop");
-#else
- ffi_flush_icache (call_struct, 32);
-#endif
- ffi_call_v8(ffi_prep_args_v8, &ecif, cif->bytes,
- cif->flags, rvalue, call_struct);
- ffi_closure_free(call_struct);
- }
- else
- {
- ffi_call_v8(ffi_prep_args_v8, &ecif, cif->bytes,
- cif->flags, rvalue, fn);
- }
- }
- else
- {
- ffi_call_v8(ffi_prep_args_v8, &ecif, cif->bytes,
- cif->flags, rvalue, fn);
- }
-#endif
- break;
- case FFI_V9:
-#ifdef SPARC64
- ffi_call_v9(ffi_prep_args_v9, &ecif, cif->bytes,
- cif->flags, rval, fn);
- if (rvalue && rval && cif->rtype->type == FFI_TYPE_STRUCT)
- ffi_v9_layout_struct(cif->rtype, 0, (char *)rvalue, (char *)rval, ((char *)rval)+32);
-#else
- /* And vice versa */
- FFI_ASSERT(0);
-#endif
- break;
- default:
- FFI_ASSERT(0);
- break;
- }
-}
-
-
-#ifdef SPARC64
-extern void ffi_closure_v9(void);
-#else
-extern void ffi_closure_v8(void);
-#endif
-
-ffi_status
-ffi_prep_closure_loc (ffi_closure* closure,
- ffi_cif* cif,
- void (*fun)(ffi_cif*, void*, void**, void*),
- void *user_data,
- void *codeloc)
-{
- unsigned int *tramp = (unsigned int *) &closure->tramp[0];
- unsigned long fn;
-#ifdef SPARC64
- /* Trampoline address is equal to the closure address. We take advantage
- of that to reduce the trampoline size by 8 bytes. */
- if (cif->abi != FFI_V9)
- return FFI_BAD_ABI;
- fn = (unsigned long) ffi_closure_v9;
- tramp[0] = 0x83414000; /* rd %pc, %g1 */
- tramp[1] = 0xca586010; /* ldx [%g1+16], %g5 */
- tramp[2] = 0x81c14000; /* jmp %g5 */
- tramp[3] = 0x01000000; /* nop */
- *((unsigned long *) &tramp[4]) = fn;
-#else
- unsigned long ctx = (unsigned long) codeloc;
- if (cif->abi != FFI_V8)
- return FFI_BAD_ABI;
- fn = (unsigned long) ffi_closure_v8;
- tramp[0] = 0x03000000 | fn >> 10; /* sethi %hi(fn), %g1 */
- tramp[1] = 0x05000000 | ctx >> 10; /* sethi %hi(ctx), %g2 */
- tramp[2] = 0x81c06000 | (fn & 0x3ff); /* jmp %g1+%lo(fn) */
- tramp[3] = 0x8410a000 | (ctx & 0x3ff);/* or %g2, %lo(ctx) */
-#endif
-
- closure->cif = cif;
- closure->fun = fun;
- closure->user_data = user_data;
-
- /* Flush the Icache. closure is 8 bytes aligned. */
-#ifdef __GNUC__
-#ifdef SPARC64
- asm volatile ("flush %0; flush %0+8" : : "r" (closure) : "memory");
-#else
- asm volatile ("iflush %0; iflush %0+8" : : "r" (closure) : "memory");
- /* SPARC v8 requires 5 instructions for flush to be visible */
- asm volatile ("nop; nop; nop; nop; nop");
-#endif
-#else
- ffi_flush_icache (closure, 16);
-#endif
-
- return FFI_OK;
-}
-
-int
-ffi_closure_sparc_inner_v8(ffi_closure *closure,
- void *rvalue, unsigned long *gpr, unsigned long *scratch)
-{
- ffi_cif *cif;
- ffi_type **arg_types;
- void **avalue;
- int i, argn;
-
- cif = closure->cif;
- arg_types = cif->arg_types;
- avalue = alloca(cif->nargs * sizeof(void *));
-
- /* Copy the caller's structure return address so that the closure
- returns the data directly to the caller. */
- if (cif->flags == FFI_TYPE_STRUCT
-#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE
- || cif->flags == FFI_TYPE_LONGDOUBLE
-#endif
- )
- rvalue = (void *) gpr[0];
-
- /* Always skip the structure return address. */
- argn = 1;
-
- /* Grab the addresses of the arguments from the stack frame. */
- for (i = 0; i < cif->nargs; i++)
- {
- if (arg_types[i]->type == FFI_TYPE_STRUCT
-#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE
- || arg_types[i]->type == FFI_TYPE_LONGDOUBLE
-#endif
- )
- {
- /* Straight copy of invisible reference. */
- avalue[i] = (void *)gpr[argn++];
- }
- else if ((arg_types[i]->type == FFI_TYPE_DOUBLE
- || arg_types[i]->type == FFI_TYPE_SINT64
- || arg_types[i]->type == FFI_TYPE_UINT64)
- /* gpr is 8-byte aligned. */
- && (argn % 2) != 0)
- {
- /* Align on a 8-byte boundary. */
- scratch[0] = gpr[argn];
- scratch[1] = gpr[argn+1];
- avalue[i] = scratch;
- scratch -= 2;
- argn += 2;
- }
- else
- {
- /* Always right-justify. */
- argn += ALIGN(arg_types[i]->size, FFI_SIZEOF_ARG) / FFI_SIZEOF_ARG;
- avalue[i] = ((char *) &gpr[argn]) - arg_types[i]->size;
- }
- }
-
- /* Invoke the closure. */
- (closure->fun) (cif, rvalue, avalue, closure->user_data);
-
- /* Tell ffi_closure_sparc how to perform return type promotions. */
- return cif->rtype->type;
-}
-
-int
-ffi_closure_sparc_inner_v9(ffi_closure *closure,
- void *rvalue, unsigned long *gpr, double *fpr)
-{
- ffi_cif *cif;
- ffi_type **arg_types;
- void **avalue;
- int i, argn, fp_slot_max;
-
- cif = closure->cif;
- arg_types = cif->arg_types;
- avalue = alloca(cif->nargs * sizeof(void *));
-
- /* Copy the caller's structure return address so that the closure
- returns the data directly to the caller. */
- if (cif->flags == FFI_TYPE_VOID
- && cif->rtype->type == FFI_TYPE_STRUCT)
- {
- rvalue = (void *) gpr[0];
- /* Skip the structure return address. */
- argn = 1;
- }
- else
- argn = 0;
-
- fp_slot_max = 16 - argn;
-
- /* Grab the addresses of the arguments from the stack frame. */
- for (i = 0; i < cif->nargs; i++)
- {
- if (arg_types[i]->type == FFI_TYPE_STRUCT)
- {
- if (arg_types[i]->size > 16)
- {
- /* Straight copy of invisible reference. */
- avalue[i] = (void *)gpr[argn++];
- }
- else
- {
- /* Left-justify. */
- ffi_v9_layout_struct(arg_types[i],
- 0,
- (char *) &gpr[argn],
- (char *) &gpr[argn],
- (char *) &fpr[argn]);
- avalue[i] = &gpr[argn];
- argn += ALIGN(arg_types[i]->size, FFI_SIZEOF_ARG) / FFI_SIZEOF_ARG;
- }
- }
- else
- {
- /* Right-justify. */
- argn += ALIGN(arg_types[i]->size, FFI_SIZEOF_ARG) / FFI_SIZEOF_ARG;
-
- /* Align on a 16-byte boundary. */
-#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE
- if (arg_types[i]->type == FFI_TYPE_LONGDOUBLE && (argn % 2) != 0)
- argn++;
-#endif
- if (i < fp_slot_max
- && (arg_types[i]->type == FFI_TYPE_FLOAT
- || arg_types[i]->type == FFI_TYPE_DOUBLE
-#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE
- || arg_types[i]->type == FFI_TYPE_LONGDOUBLE
-#endif
- ))
- avalue[i] = ((char *) &fpr[argn]) - arg_types[i]->size;
- else
- avalue[i] = ((char *) &gpr[argn]) - arg_types[i]->size;
- }
- }
-
- /* Invoke the closure. */
- (closure->fun) (cif, rvalue, avalue, closure->user_data);
-
- /* Tell ffi_closure_sparc how to perform return type promotions. */
- return cif->rtype->type;
-}
diff --git a/Modules/_ctypes/libffi/src/sparc/ffitarget.h b/Modules/_ctypes/libffi/src/sparc/ffitarget.h
deleted file mode 100644
index d89f7877a8..0000000000
--- a/Modules/_ctypes/libffi/src/sparc/ffitarget.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/* -----------------------------------------------------------------*-C-*-
- ffitarget.h - Copyright (c) 2012 Anthony Green
- Copyright (c) 1996-2003 Red Hat, Inc.
- Target configuration macros for SPARC.
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- ``Software''), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to
- permit persons to whom the Software is furnished to do so, subject to
- the following conditions:
-
- The above copyright notice and this permission notice shall be included
- in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- DEALINGS IN THE SOFTWARE.
-
- ----------------------------------------------------------------------- */
-
-#ifndef LIBFFI_TARGET_H
-#define LIBFFI_TARGET_H
-
-#ifndef LIBFFI_H
-#error "Please do not include ffitarget.h directly into your source. Use ffi.h instead."
-#endif
-
-/* ---- System specific configurations ----------------------------------- */
-
-#if defined(__arch64__) || defined(__sparcv9)
-#ifndef SPARC64
-#define SPARC64
-#endif
-#endif
-
-#ifndef LIBFFI_ASM
-typedef unsigned long ffi_arg;
-typedef signed long ffi_sarg;
-
-typedef enum ffi_abi {
- FFI_FIRST_ABI = 0,
- FFI_V8,
- FFI_V8PLUS,
- FFI_V9,
- FFI_LAST_ABI,
-#ifdef SPARC64
- FFI_DEFAULT_ABI = FFI_V9
-#else
- FFI_DEFAULT_ABI = FFI_V8
-#endif
-} ffi_abi;
-#endif
-
-/* ---- Definitions for closures ----------------------------------------- */
-
-#define FFI_CLOSURES 1
-#define FFI_NATIVE_RAW_API 0
-
-#ifdef SPARC64
-#define FFI_TRAMPOLINE_SIZE 24
-#else
-#define FFI_TRAMPOLINE_SIZE 16
-#endif
-
-#endif
-
diff --git a/Modules/_ctypes/libffi/src/sparc/v8.S b/Modules/_ctypes/libffi/src/sparc/v8.S
deleted file mode 100644
index 6bf7ac056e..0000000000
--- a/Modules/_ctypes/libffi/src/sparc/v8.S
+++ /dev/null
@@ -1,346 +0,0 @@
-/* -----------------------------------------------------------------------
- v8.S - Copyright (c) 2013 The Written Word, Inc.
- Copyright (c) 1996, 1997, 2003, 2004, 2008 Red Hat, Inc.
-
- SPARC Foreign Function Interface
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- ``Software''), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to
- permit persons to whom the Software is furnished to do so, subject to
- the following conditions:
-
- The above copyright notice and this permission notice shall be included
- in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- DEALINGS IN THE SOFTWARE.
- ----------------------------------------------------------------------- */
-
-#define LIBFFI_ASM
-#include <fficonfig.h>
-#include <ffi.h>
-
-#define STACKFRAME 96 /* Minimum stack framesize for SPARC */
-#define ARGS (64+4) /* Offset of register area in frame */
-
-#ifndef __GNUC__
- .text
- .align 8
-.globl ffi_flush_icache
-.globl _ffi_flush_icache
-
-ffi_flush_icache:
-_ffi_flush_icache:
- add %o0, %o1, %o2
-#ifdef SPARC64
-1: flush %o0
-#else
-1: iflush %o0
-#endif
- add %o0, 8, %o0
- cmp %o0, %o2
- blt 1b
- nop
- nop
- nop
- nop
- nop
- retl
- nop
-.ffi_flush_icache_end:
- .size ffi_flush_icache,.ffi_flush_icache_end-ffi_flush_icache
-#endif
-
- .text
- .align 8
-.globl ffi_call_v8
-.globl _ffi_call_v8
-
-ffi_call_v8:
-_ffi_call_v8:
-.LLFB1:
- save %sp, -STACKFRAME, %sp
-.LLCFI0:
-
- sub %sp, %i2, %sp ! alloca() space in stack for frame to set up
- add %sp, STACKFRAME, %l0 ! %l0 has start of
- ! frame to set up
-
- mov %l0, %o0 ! call routine to set up frame
- call %i0
- mov %i1, %o1 ! (delay)
-
- ld [%l0+ARGS], %o0 ! call foreign function
- ld [%l0+ARGS+4], %o1
- ld [%l0+ARGS+8], %o2
- ld [%l0+ARGS+12], %o3
- ld [%l0+ARGS+16], %o4
- ld [%l0+ARGS+20], %o5
- call %i5
- mov %l0, %sp ! (delay) switch to frame
- nop ! STRUCT returning functions skip 12 instead of 8 bytes
-
- ! If the return value pointer is NULL, assume no return value.
- tst %i4
- bz done
- nop
-
- cmp %i3, FFI_TYPE_INT
- be,a done
- st %o0, [%i4] ! (delay)
-
- cmp %i3, FFI_TYPE_FLOAT
- be,a done
- st %f0, [%i4+0] ! (delay)
-
- cmp %i3, FFI_TYPE_DOUBLE
- be,a double
- st %f0, [%i4+0] ! (delay)
-
- cmp %i3, FFI_TYPE_SINT8
- be,a sint8
- sll %o0, 24, %o0 ! (delay)
-
- cmp %i3, FFI_TYPE_UINT8
- be,a uint8
- sll %o0, 24, %o0 ! (delay)
-
- cmp %i3, FFI_TYPE_SINT16
- be,a sint16
- sll %o0, 16, %o0 ! (delay)
-
- cmp %i3, FFI_TYPE_UINT16
- be,a uint16
- sll %o0, 16, %o0 ! (delay)
-
- cmp %i3, FFI_TYPE_SINT64
- be,a longlong
- st %o0, [%i4+0] ! (delay)
-done:
- ret
- restore
-
-double:
- st %f1, [%i4+4]
- ret
- restore
-
-sint8:
- sra %o0, 24, %o0
- st %o0, [%i4+0]
- ret
- restore
-
-uint8:
- srl %o0, 24, %o0
- st %o0, [%i4+0]
- ret
- restore
-
-sint16:
- sra %o0, 16, %o0
- st %o0, [%i4+0]
- ret
- restore
-
-uint16:
- srl %o0, 16, %o0
- st %o0, [%i4+0]
- ret
- restore
-
-longlong:
- st %o1, [%i4+4]
- ret
- restore
-.LLFE1:
-
-.ffi_call_v8_end:
- .size ffi_call_v8,.ffi_call_v8_end-ffi_call_v8
-
-
-#undef STACKFRAME
-#define STACKFRAME 104 /* 16*4 register window +
- 1*4 struct return +
- 6*4 args backing store +
- 3*4 locals */
-
-/* ffi_closure_v8(...)
-
- Receives the closure argument in %g2. */
-
- .text
- .align 8
- .globl ffi_closure_v8
-
-ffi_closure_v8:
-#ifdef HAVE_AS_REGISTER_PSEUDO_OP
- .register %g2, #scratch
-#endif
-.LLFB2:
- ! Reserve frame space for all arguments in case
- ! we need to align them on a 8-byte boundary.
- ld [%g2+FFI_TRAMPOLINE_SIZE], %g1
- ld [%g1+4], %g1
- sll %g1, 3, %g1
- add %g1, STACKFRAME, %g1
- ! %g1 == STACKFRAME + 8*nargs
- neg %g1
- save %sp, %g1, %sp
-.LLCFI1:
-
- ! Store all of the potential argument registers in va_list format.
- st %i0, [%fp+68+0]
- st %i1, [%fp+68+4]
- st %i2, [%fp+68+8]
- st %i3, [%fp+68+12]
- st %i4, [%fp+68+16]
- st %i5, [%fp+68+20]
-
- ! Call ffi_closure_sparc_inner to do the bulk of the work.
- mov %g2, %o0
- add %fp, -8, %o1
- add %fp, 64, %o2
- call ffi_closure_sparc_inner_v8
- add %fp, -16, %o3
-
- ! Load up the return value in the proper type.
- ! See ffi_prep_cif_machdep for the list of cases.
- cmp %o0, FFI_TYPE_VOID
- be done1
-
- cmp %o0, FFI_TYPE_INT
- be done1
- ld [%fp-8], %i0
-
- cmp %o0, FFI_TYPE_FLOAT
- be,a done1
- ld [%fp-8], %f0
-
- cmp %o0, FFI_TYPE_DOUBLE
- be,a done1
- ldd [%fp-8], %f0
-
-#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE
- cmp %o0, FFI_TYPE_LONGDOUBLE
- be done2
-#endif
-
- cmp %o0, FFI_TYPE_STRUCT
- be done2
-
- cmp %o0, FFI_TYPE_SINT64
- be,a done1
- ldd [%fp-8], %i0
-
- cmp %o0, FFI_TYPE_UINT64
- be,a done1
- ldd [%fp-8], %i0
-
- ld [%fp-8], %i0
-done1:
- jmp %i7+8
- restore
-done2:
- ! Skip 'unimp'.
- jmp %i7+12
- restore
-.LLFE2:
-
-.ffi_closure_v8_end:
- .size ffi_closure_v8,.ffi_closure_v8_end-ffi_closure_v8
-
-#ifdef SPARC64
-#define WS 8
-#define nword xword
-#define uanword uaxword
-#else
-#define WS 4
-#define nword long
-#define uanword uaword
-#endif
-
-#ifdef HAVE_RO_EH_FRAME
- .section ".eh_frame",#alloc
-#else
- .section ".eh_frame",#alloc,#write
-#endif
-.LLframe1:
- .uaword .LLECIE1-.LLSCIE1 ! Length of Common Information Entry
-.LLSCIE1:
- .uaword 0x0 ! CIE Identifier Tag
- .byte 0x1 ! CIE Version
- .ascii "zR\0" ! CIE Augmentation
- .byte 0x1 ! uleb128 0x1; CIE Code Alignment Factor
- .byte 0x80-WS ! sleb128 -WS; CIE Data Alignment Factor
- .byte 0xf ! CIE RA Column
- .byte 0x1 ! uleb128 0x1; Augmentation size
-#ifdef HAVE_AS_SPARC_UA_PCREL
- .byte 0x1b ! FDE Encoding (pcrel sdata4)
-#else
- .byte 0x50 ! FDE Encoding (aligned absolute)
-#endif
- .byte 0xc ! DW_CFA_def_cfa
- .byte 0xe ! uleb128 0xe
- .byte 0x0 ! uleb128 0x0
- .align WS
-.LLECIE1:
-.LLSFDE1:
- .uaword .LLEFDE1-.LLASFDE1 ! FDE Length
-.LLASFDE1:
- .uaword .LLASFDE1-.LLframe1 ! FDE CIE offset
-#ifdef HAVE_AS_SPARC_UA_PCREL
- .uaword %r_disp32(.LLFB1)
- .uaword .LLFE1-.LLFB1 ! FDE address range
-#else
- .align WS
- .nword .LLFB1
- .uanword .LLFE1-.LLFB1 ! FDE address range
-#endif
- .byte 0x0 ! uleb128 0x0; Augmentation size
- .byte 0x4 ! DW_CFA_advance_loc4
- .uaword .LLCFI0-.LLFB1
- .byte 0xd ! DW_CFA_def_cfa_register
- .byte 0x1e ! uleb128 0x1e
- .byte 0x2d ! DW_CFA_GNU_window_save
- .byte 0x9 ! DW_CFA_register
- .byte 0xf ! uleb128 0xf
- .byte 0x1f ! uleb128 0x1f
- .align WS
-.LLEFDE1:
-.LLSFDE2:
- .uaword .LLEFDE2-.LLASFDE2 ! FDE Length
-.LLASFDE2:
- .uaword .LLASFDE2-.LLframe1 ! FDE CIE offset
-#ifdef HAVE_AS_SPARC_UA_PCREL
- .uaword %r_disp32(.LLFB2)
- .uaword .LLFE2-.LLFB2 ! FDE address range
-#else
- .align WS
- .nword .LLFB2
- .uanword .LLFE2-.LLFB2 ! FDE address range
-#endif
- .byte 0x0 ! uleb128 0x0; Augmentation size
- .byte 0x4 ! DW_CFA_advance_loc4
- .uaword .LLCFI1-.LLFB2
- .byte 0xd ! DW_CFA_def_cfa_register
- .byte 0x1e ! uleb128 0x1e
- .byte 0x2d ! DW_CFA_GNU_window_save
- .byte 0x9 ! DW_CFA_register
- .byte 0xf ! uleb128 0xf
- .byte 0x1f ! uleb128 0x1f
- .align WS
-.LLEFDE2:
-
-#if defined __ELF__ && defined __linux__
- .section .note.GNU-stack,"",@progbits
-#endif
diff --git a/Modules/_ctypes/libffi/src/sparc/v9.S b/Modules/_ctypes/libffi/src/sparc/v9.S
deleted file mode 100644
index bf31a2b511..0000000000
--- a/Modules/_ctypes/libffi/src/sparc/v9.S
+++ /dev/null
@@ -1,307 +0,0 @@
-/* -----------------------------------------------------------------------
- v9.S - Copyright (c) 2000, 2003, 2004, 2008 Red Hat, Inc.
-
- SPARC 64-bit Foreign Function Interface
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- ``Software''), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to
- permit persons to whom the Software is furnished to do so, subject to
- the following conditions:
-
- The above copyright notice and this permission notice shall be included
- in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- DEALINGS IN THE SOFTWARE.
- ----------------------------------------------------------------------- */
-
-#define LIBFFI_ASM
-#include <fficonfig.h>
-#include <ffi.h>
-
-#ifdef SPARC64
-/* Only compile this in for 64bit builds, because otherwise the object file
- will have inproper architecture due to used instructions. */
-
-#define STACKFRAME 176 /* Minimum stack framesize for SPARC 64-bit */
-#define STACK_BIAS 2047
-#define ARGS (128) /* Offset of register area in frame */
-
-.text
- .align 8
-.globl ffi_call_v9
-.globl _ffi_call_v9
-
-ffi_call_v9:
-_ffi_call_v9:
-.LLFB1:
- save %sp, -STACKFRAME, %sp
-.LLCFI0:
-
- sub %sp, %i2, %sp ! alloca() space in stack for frame to set up
- add %sp, STACKFRAME+STACK_BIAS, %l0 ! %l0 has start of
- ! frame to set up
-
- mov %l0, %o0 ! call routine to set up frame
- call %i0
- mov %i1, %o1 ! (delay)
- brz,pt %o0, 1f
- ldx [%l0+ARGS], %o0 ! call foreign function
-
- ldd [%l0+ARGS], %f0
- ldd [%l0+ARGS+8], %f2
- ldd [%l0+ARGS+16], %f4
- ldd [%l0+ARGS+24], %f6
- ldd [%l0+ARGS+32], %f8
- ldd [%l0+ARGS+40], %f10
- ldd [%l0+ARGS+48], %f12
- ldd [%l0+ARGS+56], %f14
- ldd [%l0+ARGS+64], %f16
- ldd [%l0+ARGS+72], %f18
- ldd [%l0+ARGS+80], %f20
- ldd [%l0+ARGS+88], %f22
- ldd [%l0+ARGS+96], %f24
- ldd [%l0+ARGS+104], %f26
- ldd [%l0+ARGS+112], %f28
- ldd [%l0+ARGS+120], %f30
-
-1: ldx [%l0+ARGS+8], %o1
- ldx [%l0+ARGS+16], %o2
- ldx [%l0+ARGS+24], %o3
- ldx [%l0+ARGS+32], %o4
- ldx [%l0+ARGS+40], %o5
- call %i5
- sub %l0, STACK_BIAS, %sp ! (delay) switch to frame
-
- ! If the return value pointer is NULL, assume no return value.
- brz,pn %i4, done
- nop
-
- cmp %i3, FFI_TYPE_INT
- be,a,pt %icc, done
- stx %o0, [%i4+0] ! (delay)
-
- cmp %i3, FFI_TYPE_FLOAT
- be,a,pn %icc, done
- st %f0, [%i4+0] ! (delay)
-
- cmp %i3, FFI_TYPE_DOUBLE
- be,a,pn %icc, done
- std %f0, [%i4+0] ! (delay)
-
- cmp %i3, FFI_TYPE_STRUCT
- be,pn %icc, dostruct
-
- cmp %i3, FFI_TYPE_LONGDOUBLE
- bne,pt %icc, done
- nop
- std %f0, [%i4+0]
- std %f2, [%i4+8]
-
-done: ret
- restore
-
-dostruct:
- /* This will not work correctly for unions. */
- stx %o0, [%i4+0]
- stx %o1, [%i4+8]
- stx %o2, [%i4+16]
- stx %o3, [%i4+24]
- std %f0, [%i4+32]
- std %f2, [%i4+40]
- std %f4, [%i4+48]
- std %f6, [%i4+56]
- ret
- restore
-.LLFE1:
-
-.ffi_call_v9_end:
- .size ffi_call_v9,.ffi_call_v9_end-ffi_call_v9
-
-
-#undef STACKFRAME
-#define STACKFRAME 336 /* 16*8 register window +
- 6*8 args backing store +
- 20*8 locals */
-#define FP %fp+STACK_BIAS
-
-/* ffi_closure_v9(...)
-
- Receives the closure argument in %g1. */
-
- .text
- .align 8
- .globl ffi_closure_v9
-
-ffi_closure_v9:
-.LLFB2:
- save %sp, -STACKFRAME, %sp
-.LLCFI1:
-
- ! Store all of the potential argument registers in va_list format.
- stx %i0, [FP+128+0]
- stx %i1, [FP+128+8]
- stx %i2, [FP+128+16]
- stx %i3, [FP+128+24]
- stx %i4, [FP+128+32]
- stx %i5, [FP+128+40]
-
- ! Store possible floating point argument registers too.
- std %f0, [FP-128]
- std %f2, [FP-120]
- std %f4, [FP-112]
- std %f6, [FP-104]
- std %f8, [FP-96]
- std %f10, [FP-88]
- std %f12, [FP-80]
- std %f14, [FP-72]
- std %f16, [FP-64]
- std %f18, [FP-56]
- std %f20, [FP-48]
- std %f22, [FP-40]
- std %f24, [FP-32]
- std %f26, [FP-24]
- std %f28, [FP-16]
- std %f30, [FP-8]
-
- ! Call ffi_closure_sparc_inner to do the bulk of the work.
- mov %g1, %o0
- add %fp, STACK_BIAS-160, %o1
- add %fp, STACK_BIAS+128, %o2
- call ffi_closure_sparc_inner_v9
- add %fp, STACK_BIAS-128, %o3
-
- ! Load up the return value in the proper type.
- ! See ffi_prep_cif_machdep for the list of cases.
- cmp %o0, FFI_TYPE_VOID
- be,pn %icc, done1
-
- cmp %o0, FFI_TYPE_INT
- be,pn %icc, integer
-
- cmp %o0, FFI_TYPE_FLOAT
- be,a,pn %icc, done1
- ld [FP-160], %f0
-
- cmp %o0, FFI_TYPE_DOUBLE
- be,a,pn %icc, done1
- ldd [FP-160], %f0
-
-#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE
- cmp %o0, FFI_TYPE_LONGDOUBLE
- be,a,pn %icc, longdouble1
- ldd [FP-160], %f0
-#endif
-
- ! FFI_TYPE_STRUCT
- ldx [FP-152], %i1
- ldx [FP-144], %i2
- ldx [FP-136], %i3
- ldd [FP-160], %f0
- ldd [FP-152], %f2
- ldd [FP-144], %f4
- ldd [FP-136], %f6
-
-integer:
- ldx [FP-160], %i0
-
-done1:
- ret
- restore
-
-#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE
-longdouble1:
- ldd [FP-152], %f2
- ret
- restore
-#endif
-.LLFE2:
-
-.ffi_closure_v9_end:
- .size ffi_closure_v9,.ffi_closure_v9_end-ffi_closure_v9
-
-#ifdef HAVE_RO_EH_FRAME
- .section ".eh_frame",#alloc
-#else
- .section ".eh_frame",#alloc,#write
-#endif
-.LLframe1:
- .uaword .LLECIE1-.LLSCIE1 ! Length of Common Information Entry
-.LLSCIE1:
- .uaword 0x0 ! CIE Identifier Tag
- .byte 0x1 ! CIE Version
- .ascii "zR\0" ! CIE Augmentation
- .byte 0x1 ! uleb128 0x1; CIE Code Alignment Factor
- .byte 0x78 ! sleb128 -8; CIE Data Alignment Factor
- .byte 0xf ! CIE RA Column
- .byte 0x1 ! uleb128 0x1; Augmentation size
-#ifdef HAVE_AS_SPARC_UA_PCREL
- .byte 0x1b ! FDE Encoding (pcrel sdata4)
-#else
- .byte 0x50 ! FDE Encoding (aligned absolute)
-#endif
- .byte 0xc ! DW_CFA_def_cfa
- .byte 0xe ! uleb128 0xe
- .byte 0xff,0xf ! uleb128 0x7ff
- .align 8
-.LLECIE1:
-.LLSFDE1:
- .uaword .LLEFDE1-.LLASFDE1 ! FDE Length
-.LLASFDE1:
- .uaword .LLASFDE1-.LLframe1 ! FDE CIE offset
-#ifdef HAVE_AS_SPARC_UA_PCREL
- .uaword %r_disp32(.LLFB1)
- .uaword .LLFE1-.LLFB1 ! FDE address range
-#else
- .align 8
- .xword .LLFB1
- .uaxword .LLFE1-.LLFB1 ! FDE address range
-#endif
- .byte 0x0 ! uleb128 0x0; Augmentation size
- .byte 0x4 ! DW_CFA_advance_loc4
- .uaword .LLCFI0-.LLFB1
- .byte 0xd ! DW_CFA_def_cfa_register
- .byte 0x1e ! uleb128 0x1e
- .byte 0x2d ! DW_CFA_GNU_window_save
- .byte 0x9 ! DW_CFA_register
- .byte 0xf ! uleb128 0xf
- .byte 0x1f ! uleb128 0x1f
- .align 8
-.LLEFDE1:
-.LLSFDE2:
- .uaword .LLEFDE2-.LLASFDE2 ! FDE Length
-.LLASFDE2:
- .uaword .LLASFDE2-.LLframe1 ! FDE CIE offset
-#ifdef HAVE_AS_SPARC_UA_PCREL
- .uaword %r_disp32(.LLFB2)
- .uaword .LLFE2-.LLFB2 ! FDE address range
-#else
- .align 8
- .xword .LLFB2
- .uaxword .LLFE2-.LLFB2 ! FDE address range
-#endif
- .byte 0x0 ! uleb128 0x0; Augmentation size
- .byte 0x4 ! DW_CFA_advance_loc4
- .uaword .LLCFI1-.LLFB2
- .byte 0xd ! DW_CFA_def_cfa_register
- .byte 0x1e ! uleb128 0x1e
- .byte 0x2d ! DW_CFA_GNU_window_save
- .byte 0x9 ! DW_CFA_register
- .byte 0xf ! uleb128 0xf
- .byte 0x1f ! uleb128 0x1f
- .align 8
-.LLEFDE2:
-#endif
-
-#ifdef __linux__
- .section .note.GNU-stack,"",@progbits
-#endif
diff --git a/Modules/_ctypes/libffi/src/tile/ffi.c b/Modules/_ctypes/libffi/src/tile/ffi.c
deleted file mode 100644
index 3a94469c7f..0000000000
--- a/Modules/_ctypes/libffi/src/tile/ffi.c
+++ /dev/null
@@ -1,355 +0,0 @@
-/* -----------------------------------------------------------------------
- ffi.c - Copyright (c) 2012 Tilera Corp.
-
- TILE Foreign Function Interface
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- ``Software''), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to
- permit persons to whom the Software is furnished to do so, subject to
- the following conditions:
-
- The above copyright notice and this permission notice shall be included
- in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- DEALINGS IN THE SOFTWARE.
- ----------------------------------------------------------------------- */
-
-#include <ffi.h>
-#include <ffi_common.h>
-#include <stdlib.h>
-#include <stdint.h>
-#include <unistd.h>
-#include <arch/abi.h>
-#include <arch/icache.h>
-#include <arch/opcode.h>
-
-
-/* The first 10 registers are used to pass arguments and return values. */
-#define NUM_ARG_REGS 10
-
-/* Performs a raw function call with the given NUM_ARG_REGS register arguments
- and the specified additional stack arguments (if any). */
-extern void ffi_call_tile(ffi_sarg reg_args[NUM_ARG_REGS],
- const ffi_sarg *stack_args,
- size_t stack_args_bytes,
- void (*fnaddr)(void))
- FFI_HIDDEN;
-
-/* This handles the raw call from the closure stub, cleaning up the
- parameters and delegating to ffi_closure_tile_inner. */
-extern void ffi_closure_tile(void) FFI_HIDDEN;
-
-
-ffi_status
-ffi_prep_cif_machdep(ffi_cif *cif)
-{
- /* We always allocate room for all registers. Even if we don't
- use them as parameters, they get returned in the same array
- as struct return values so we need to make room. */
- if (cif->bytes < NUM_ARG_REGS * FFI_SIZEOF_ARG)
- cif->bytes = NUM_ARG_REGS * FFI_SIZEOF_ARG;
-
- if (cif->rtype->size > NUM_ARG_REGS * FFI_SIZEOF_ARG)
- cif->flags = FFI_TYPE_STRUCT;
- else
- cif->flags = FFI_TYPE_INT;
-
- /* Nothing to do. */
- return FFI_OK;
-}
-
-
-static long
-assign_to_ffi_arg(ffi_sarg *out, void *in, const ffi_type *type,
- int write_to_reg)
-{
- switch (type->type)
- {
- case FFI_TYPE_SINT8:
- *out = *(SINT8 *)in;
- return 1;
-
- case FFI_TYPE_UINT8:
- *out = *(UINT8 *)in;
- return 1;
-
- case FFI_TYPE_SINT16:
- *out = *(SINT16 *)in;
- return 1;
-
- case FFI_TYPE_UINT16:
- *out = *(UINT16 *)in;
- return 1;
-
- case FFI_TYPE_SINT32:
- case FFI_TYPE_UINT32:
-#ifndef __LP64__
- case FFI_TYPE_POINTER:
-#endif
- /* Note that even unsigned 32-bit quantities are sign extended
- on tilegx when stored in a register. */
- *out = *(SINT32 *)in;
- return 1;
-
- case FFI_TYPE_FLOAT:
-#ifdef __tilegx__
- if (write_to_reg)
- {
- /* Properly sign extend the value. */
- union { float f; SINT32 s32; } val;
- val.f = *(float *)in;
- *out = val.s32;
- }
- else
-#endif
- {
- *(float *)out = *(float *)in;
- }
- return 1;
-
- case FFI_TYPE_SINT64:
- case FFI_TYPE_UINT64:
- case FFI_TYPE_DOUBLE:
-#ifdef __LP64__
- case FFI_TYPE_POINTER:
-#endif
- *(UINT64 *)out = *(UINT64 *)in;
- return sizeof(UINT64) / FFI_SIZEOF_ARG;
-
- case FFI_TYPE_STRUCT:
- memcpy(out, in, type->size);
- return (type->size + FFI_SIZEOF_ARG - 1) / FFI_SIZEOF_ARG;
-
- case FFI_TYPE_VOID:
- /* Must be a return type. Nothing to do. */
- return 0;
-
- default:
- FFI_ASSERT(0);
- return -1;
- }
-}
-
-
-void
-ffi_call(ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue)
-{
- ffi_sarg * const arg_mem = alloca(cif->bytes);
- ffi_sarg * const reg_args = arg_mem;
- ffi_sarg * const stack_args = &reg_args[NUM_ARG_REGS];
- ffi_sarg *argp = arg_mem;
- ffi_type ** const arg_types = cif->arg_types;
- const long num_args = cif->nargs;
- long i;
-
- if (cif->flags == FFI_TYPE_STRUCT)
- {
- /* Pass a hidden pointer to the return value. We make sure there
- is scratch space for the callee to store the return value even if
- our caller doesn't care about it. */
- *argp++ = (intptr_t)(rvalue ? rvalue : alloca(cif->rtype->size));
-
- /* No more work needed to return anything. */
- rvalue = NULL;
- }
-
- for (i = 0; i < num_args; i++)
- {
- ffi_type *type = arg_types[i];
- void * const arg_in = avalue[i];
- ptrdiff_t arg_word = argp - arg_mem;
-
-#ifndef __tilegx__
- /* Doubleword-aligned values are always in an even-number register
- pair, or doubleword-aligned stack slot if out of registers. */
- long align = arg_word & (type->alignment > FFI_SIZEOF_ARG);
- argp += align;
- arg_word += align;
-#endif
-
- if (type->type == FFI_TYPE_STRUCT)
- {
- const size_t arg_size_in_words =
- (type->size + FFI_SIZEOF_ARG - 1) / FFI_SIZEOF_ARG;
-
- if (arg_word < NUM_ARG_REGS &&
- arg_word + arg_size_in_words > NUM_ARG_REGS)
- {
- /* Args are not allowed to span registers and the stack. */
- argp = stack_args;
- }
-
- memcpy(argp, arg_in, type->size);
- argp += arg_size_in_words;
- }
- else
- {
- argp += assign_to_ffi_arg(argp, arg_in, arg_types[i], 1);
- }
- }
-
- /* Actually do the call. */
- ffi_call_tile(reg_args, stack_args,
- cif->bytes - (NUM_ARG_REGS * FFI_SIZEOF_ARG), fn);
-
- if (rvalue != NULL)
- assign_to_ffi_arg(rvalue, reg_args, cif->rtype, 0);
-}
-
-
-/* Template code for closure. */
-extern const UINT64 ffi_template_tramp_tile[] FFI_HIDDEN;
-
-
-ffi_status
-ffi_prep_closure_loc (ffi_closure *closure,
- ffi_cif *cif,
- void (*fun)(ffi_cif*, void*, void**, void*),
- void *user_data,
- void *codeloc)
-{
-#ifdef __tilegx__
- /* TILE-Gx */
- SINT64 c;
- SINT64 h;
- int s;
- UINT64 *out;
-
- if (cif->abi != FFI_UNIX)
- return FFI_BAD_ABI;
-
- out = (UINT64 *)closure->tramp;
-
- c = (intptr_t)closure;
- h = (intptr_t)ffi_closure_tile;
- s = 0;
-
- /* Find the smallest shift count that doesn't lose information
- (i.e. no need to explicitly insert high bits of the address that
- are just the sign extension of the low bits). */
- while ((c >> s) != (SINT16)(c >> s) || (h >> s) != (SINT16)(h >> s))
- s += 16;
-
-#define OPS(a, b, shift) \
- (create_Imm16_X0((a) >> (shift)) | create_Imm16_X1((b) >> (shift)))
-
- /* Emit the moveli. */
- *out++ = ffi_template_tramp_tile[0] | OPS(c, h, s);
- for (s -= 16; s >= 0; s -= 16)
- *out++ = ffi_template_tramp_tile[1] | OPS(c, h, s);
-
-#undef OPS
-
- *out++ = ffi_template_tramp_tile[2];
-
-#else
- /* TILEPro */
- UINT64 *out;
- intptr_t delta;
-
- if (cif->abi != FFI_UNIX)
- return FFI_BAD_ABI;
-
- out = (UINT64 *)closure->tramp;
- delta = (intptr_t)ffi_closure_tile - (intptr_t)codeloc;
-
- *out++ = ffi_template_tramp_tile[0] | create_JOffLong_X1(delta >> 3);
-#endif
-
- closure->cif = cif;
- closure->fun = fun;
- closure->user_data = user_data;
-
- invalidate_icache(closure->tramp, (char *)out - closure->tramp,
- getpagesize());
-
- return FFI_OK;
-}
-
-
-/* This is called by the assembly wrapper for closures. This does
- all of the work. On entry reg_args[0] holds the values the registers
- had when the closure was invoked. On return reg_args[1] holds the register
- values to be returned to the caller (many of which may be garbage). */
-void FFI_HIDDEN
-ffi_closure_tile_inner(ffi_closure *closure,
- ffi_sarg reg_args[2][NUM_ARG_REGS],
- ffi_sarg *stack_args)
-{
- ffi_cif * const cif = closure->cif;
- void ** const avalue = alloca(cif->nargs * sizeof(void *));
- void *rvalue;
- ffi_type ** const arg_types = cif->arg_types;
- ffi_sarg * const reg_args_in = reg_args[0];
- ffi_sarg * const reg_args_out = reg_args[1];
- ffi_sarg * argp;
- long i, arg_word, nargs = cif->nargs;
- /* Use a union to guarantee proper alignment for double. */
- union { ffi_sarg arg[NUM_ARG_REGS]; double d; UINT64 u64; } closure_ret;
-
- /* Start out reading register arguments. */
- argp = reg_args_in;
-
- /* Copy the caller's structure return address to that the closure
- returns the data directly to the caller. */
- if (cif->flags == FFI_TYPE_STRUCT)
- {
- /* Return by reference via hidden pointer. */
- rvalue = (void *)(intptr_t)*argp++;
- arg_word = 1;
- }
- else
- {
- /* Return the value in registers. */
- rvalue = &closure_ret;
- arg_word = 0;
- }
-
- /* Grab the addresses of the arguments. */
- for (i = 0; i < nargs; i++)
- {
- ffi_type * const type = arg_types[i];
- const size_t arg_size_in_words =
- (type->size + FFI_SIZEOF_ARG - 1) / FFI_SIZEOF_ARG;
-
-#ifndef __tilegx__
- /* Doubleword-aligned values are always in an even-number register
- pair, or doubleword-aligned stack slot if out of registers. */
- long align = arg_word & (type->alignment > FFI_SIZEOF_ARG);
- argp += align;
- arg_word += align;
-#endif
-
- if (arg_word == NUM_ARG_REGS ||
- (arg_word < NUM_ARG_REGS &&
- arg_word + arg_size_in_words > NUM_ARG_REGS))
- {
- /* Switch to reading arguments from the stack. */
- argp = stack_args;
- arg_word = NUM_ARG_REGS;
- }
-
- avalue[i] = argp;
- argp += arg_size_in_words;
- arg_word += arg_size_in_words;
- }
-
- /* Invoke the closure. */
- closure->fun(cif, rvalue, avalue, closure->user_data);
-
- if (cif->flags != FFI_TYPE_STRUCT)
- {
- /* Canonicalize for register representation. */
- assign_to_ffi_arg(reg_args_out, &closure_ret, cif->rtype, 1);
- }
-}
diff --git a/Modules/_ctypes/libffi/src/tile/ffitarget.h b/Modules/_ctypes/libffi/src/tile/ffitarget.h
deleted file mode 100644
index 679fb5d904..0000000000
--- a/Modules/_ctypes/libffi/src/tile/ffitarget.h
+++ /dev/null
@@ -1,65 +0,0 @@
-/* -----------------------------------------------------------------*-C-*-
- ffitarget.h - Copyright (c) 2012 Tilera Corp.
- Target configuration macros for TILE.
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- ``Software''), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to
- permit persons to whom the Software is furnished to do so, subject to
- the following conditions:
-
- The above copyright notice and this permission notice shall be included
- in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- DEALINGS IN THE SOFTWARE.
- ----------------------------------------------------------------------- */
-
-#ifndef LIBFFI_TARGET_H
-#define LIBFFI_TARGET_H
-
-#ifndef LIBFFI_H
-#error "Please do not include ffitarget.h directly into your source. Use ffi.h instead."
-#endif
-
-#ifndef LIBFFI_ASM
-
-#include <arch/abi.h>
-
-typedef uint_reg_t ffi_arg;
-typedef int_reg_t ffi_sarg;
-
-typedef enum ffi_abi {
- FFI_FIRST_ABI = 0,
- FFI_UNIX,
- FFI_LAST_ABI,
- FFI_DEFAULT_ABI = FFI_UNIX
-} ffi_abi;
-#endif
-
-/* ---- Definitions for closures ----------------------------------------- */
-#define FFI_CLOSURES 1
-
-#ifdef __tilegx__
-/* We always pass 8-byte values, even in -m32 mode. */
-# define FFI_SIZEOF_ARG 8
-# ifdef __LP64__
-# define FFI_TRAMPOLINE_SIZE (8 * 5) /* 5 bundles */
-# else
-# define FFI_TRAMPOLINE_SIZE (8 * 3) /* 3 bundles */
-# endif
-#else
-# define FFI_SIZEOF_ARG 4
-# define FFI_TRAMPOLINE_SIZE 8 /* 1 bundle */
-#endif
-#define FFI_NATIVE_RAW_API 0
-
-#endif
diff --git a/Modules/_ctypes/libffi/src/tile/tile.S b/Modules/_ctypes/libffi/src/tile/tile.S
deleted file mode 100644
index d1f82cb3db..0000000000
--- a/Modules/_ctypes/libffi/src/tile/tile.S
+++ /dev/null
@@ -1,360 +0,0 @@
-/* -----------------------------------------------------------------------
- tile.S - Copyright (c) 2011 Tilera Corp.
-
- Tilera TILEPro and TILE-Gx Foreign Function Interface
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- ``Software''), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to
- permit persons to whom the Software is furnished to do so, subject to
- the following conditions:
-
- The above copyright notice and this permission notice shall be included
- in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- DEALINGS IN THE SOFTWARE.
- ----------------------------------------------------------------------- */
-
-#define LIBFFI_ASM
-#include <fficonfig.h>
-#include <ffi.h>
-
-/* Number of bytes in a register. */
-#define REG_SIZE FFI_SIZEOF_ARG
-
-/* Number of bytes in stack linkage area for backtracing.
-
- A note about the ABI: on entry to a procedure, sp points to a stack
- slot where it must spill the return address if it's not a leaf.
- REG_SIZE bytes beyond that is a slot owned by the caller which
- contains the sp value that the caller had when it was originally
- entered (i.e. the caller's frame pointer). */
-#define LINKAGE_SIZE (2 * REG_SIZE)
-
-/* The first 10 registers are used to pass arguments and return values. */
-#define NUM_ARG_REGS 10
-
-#ifdef __tilegx__
-#define SW st
-#define LW ld
-#define BGZT bgtzt
-#else
-#define SW sw
-#define LW lw
-#define BGZT bgzt
-#endif
-
-
-/* void ffi_call_tile (int_reg_t reg_args[NUM_ARG_REGS],
- const int_reg_t *stack_args,
- unsigned long stack_args_bytes,
- void (*fnaddr)(void));
-
- On entry, REG_ARGS contain the outgoing register values,
- and STACK_ARGS contains STACK_ARG_BYTES of additional values
- to be passed on the stack. If STACK_ARG_BYTES is zero, then
- STACK_ARGS is ignored.
-
- When the invoked function returns, the values of r0-r9 are
- blindly stored back into REG_ARGS for the caller to examine. */
-
- .section .text.ffi_call_tile, "ax", @progbits
- .align 8
- .globl ffi_call_tile
- FFI_HIDDEN(ffi_call_tile)
-ffi_call_tile:
-
-/* Incoming arguments. */
-#define REG_ARGS r0
-#define INCOMING_STACK_ARGS r1
-#define STACK_ARG_BYTES r2
-#define ORIG_FNADDR r3
-
-/* Temporary values. */
-#define FRAME_SIZE r10
-#define TMP r11
-#define TMP2 r12
-#define OUTGOING_STACK_ARGS r13
-#define REG_ADDR_PTR r14
-#define RETURN_REG_ADDR r15
-#define FNADDR r16
-
- .cfi_startproc
- {
- /* Save return address. */
- SW sp, lr
- .cfi_offset lr, 0
- /* Prepare to spill incoming r52. */
- addi TMP, sp, -REG_SIZE
- /* Increase frame size to have room to spill r52 and REG_ARGS.
- The +7 is to round up mod 8. */
- addi FRAME_SIZE, STACK_ARG_BYTES, \
- REG_SIZE + REG_SIZE + LINKAGE_SIZE + 7
- }
- {
- /* Round stack frame size to a multiple of 8 to satisfy ABI. */
- andi FRAME_SIZE, FRAME_SIZE, -8
- /* Compute where to spill REG_ARGS value. */
- addi TMP2, sp, -(REG_SIZE * 2)
- }
- {
- /* Spill incoming r52. */
- SW TMP, r52
- .cfi_offset r52, -REG_SIZE
- /* Set up our frame pointer. */
- move r52, sp
- .cfi_def_cfa_register r52
- /* Push stack frame. */
- sub sp, sp, FRAME_SIZE
- }
- {
- /* Prepare to set up stack linkage. */
- addi TMP, sp, REG_SIZE
- /* Prepare to memcpy stack args. */
- addi OUTGOING_STACK_ARGS, sp, LINKAGE_SIZE
- /* Save REG_ARGS which we will need after we call the subroutine. */
- SW TMP2, REG_ARGS
- }
- {
- /* Set up linkage info to hold incoming stack pointer. */
- SW TMP, r52
- }
- {
- /* Skip stack args memcpy if we don't have any stack args (common). */
- blezt STACK_ARG_BYTES, .Ldone_stack_args_memcpy
- }
-
-.Lmemcpy_stack_args:
- {
- /* Load incoming argument from stack_args. */
- LW TMP, INCOMING_STACK_ARGS
- addi INCOMING_STACK_ARGS, INCOMING_STACK_ARGS, REG_SIZE
- }
- {
- /* Store stack argument into outgoing stack argument area. */
- SW OUTGOING_STACK_ARGS, TMP
- addi OUTGOING_STACK_ARGS, OUTGOING_STACK_ARGS, REG_SIZE
- addi STACK_ARG_BYTES, STACK_ARG_BYTES, -REG_SIZE
- }
- {
- BGZT STACK_ARG_BYTES, .Lmemcpy_stack_args
- }
-.Ldone_stack_args_memcpy:
-
- {
- /* Copy aside ORIG_FNADDR so we can overwrite its register. */
- move FNADDR, ORIG_FNADDR
- /* Prepare to load argument registers. */
- addi REG_ADDR_PTR, r0, REG_SIZE
- /* Load outgoing r0. */
- LW r0, r0
- }
-
- /* Load up argument registers from the REG_ARGS array. */
-#define LOAD_REG(REG, PTR) \
- { \
- LW REG, PTR ; \
- addi PTR, PTR, REG_SIZE \
- }
-
- LOAD_REG(r1, REG_ADDR_PTR)
- LOAD_REG(r2, REG_ADDR_PTR)
- LOAD_REG(r3, REG_ADDR_PTR)
- LOAD_REG(r4, REG_ADDR_PTR)
- LOAD_REG(r5, REG_ADDR_PTR)
- LOAD_REG(r6, REG_ADDR_PTR)
- LOAD_REG(r7, REG_ADDR_PTR)
- LOAD_REG(r8, REG_ADDR_PTR)
- LOAD_REG(r9, REG_ADDR_PTR)
-
- {
- /* Call the subroutine. */
- jalr FNADDR
- }
-
- {
- /* Restore original lr. */
- LW lr, r52
- /* Prepare to recover ARGS, which we spilled earlier. */
- addi TMP, r52, -(2 * REG_SIZE)
- }
- {
- /* Restore ARGS, so we can fill it in with the return regs r0-r9. */
- LW RETURN_REG_ADDR, TMP
- /* Prepare to restore original r52. */
- addi TMP, r52, -REG_SIZE
- }
-
- {
- /* Pop stack frame. */
- move sp, r52
- /* Restore original r52. */
- LW r52, TMP
- }
-
-#define STORE_REG(REG, PTR) \
- { \
- SW PTR, REG ; \
- addi PTR, PTR, REG_SIZE \
- }
-
- /* Return all register values by reference. */
- STORE_REG(r0, RETURN_REG_ADDR)
- STORE_REG(r1, RETURN_REG_ADDR)
- STORE_REG(r2, RETURN_REG_ADDR)
- STORE_REG(r3, RETURN_REG_ADDR)
- STORE_REG(r4, RETURN_REG_ADDR)
- STORE_REG(r5, RETURN_REG_ADDR)
- STORE_REG(r6, RETURN_REG_ADDR)
- STORE_REG(r7, RETURN_REG_ADDR)
- STORE_REG(r8, RETURN_REG_ADDR)
- STORE_REG(r9, RETURN_REG_ADDR)
-
- {
- jrp lr
- }
-
- .cfi_endproc
- .size ffi_call_tile, .-ffi_call_tile
-
-/* ffi_closure_tile(...)
-
- On entry, lr points to the closure plus 8 bytes, and r10
- contains the actual return address.
-
- This function simply dumps all register parameters into a stack array
- and passes the closure, the registers array, and the stack arguments
- to C code that does all of the actual closure processing. */
-
- .section .text.ffi_closure_tile, "ax", @progbits
- .align 8
- .globl ffi_closure_tile
- FFI_HIDDEN(ffi_closure_tile)
-
- .cfi_startproc
-/* Room to spill all NUM_ARG_REGS incoming registers, plus frame linkage. */
-#define CLOSURE_FRAME_SIZE (((NUM_ARG_REGS * REG_SIZE * 2 + LINKAGE_SIZE) + 7) & -8)
-ffi_closure_tile:
- {
-#ifdef __tilegx__
- st sp, lr
- .cfi_offset lr, 0
-#else
- /* Save return address (in r10 due to closure stub wrapper). */
- SW sp, r10
- .cfi_return_column r10
- .cfi_offset r10, 0
-#endif
- /* Compute address for stack frame linkage. */
- addli r10, sp, -(CLOSURE_FRAME_SIZE - REG_SIZE)
- }
- {
- /* Save incoming stack pointer in linkage area. */
- SW r10, sp
- .cfi_offset sp, -(CLOSURE_FRAME_SIZE - REG_SIZE)
- /* Push a new stack frame. */
- addli sp, sp, -CLOSURE_FRAME_SIZE
- .cfi_adjust_cfa_offset CLOSURE_FRAME_SIZE
- }
-
- {
- /* Create pointer to where to start spilling registers. */
- addi r10, sp, LINKAGE_SIZE
- }
-
- /* Spill all the incoming registers. */
- STORE_REG(r0, r10)
- STORE_REG(r1, r10)
- STORE_REG(r2, r10)
- STORE_REG(r3, r10)
- STORE_REG(r4, r10)
- STORE_REG(r5, r10)
- STORE_REG(r6, r10)
- STORE_REG(r7, r10)
- STORE_REG(r8, r10)
- {
- /* Save r9. */
- SW r10, r9
-#ifdef __tilegx__
- /* Pointer to closure is passed in r11. */
- move r0, r11
-#else
- /* Compute pointer to the closure object. Because the closure
- starts with a "jal ffi_closure_tile", we can just take the
- value of lr (a phony return address pointing into the closure)
- and subtract 8. */
- addi r0, lr, -8
-#endif
- /* Compute a pointer to the register arguments we just spilled. */
- addi r1, sp, LINKAGE_SIZE
- }
- {
- /* Compute a pointer to the extra stack arguments (if any). */
- addli r2, sp, CLOSURE_FRAME_SIZE + LINKAGE_SIZE
- /* Call C code to deal with all of the grotty details. */
- jal ffi_closure_tile_inner
- }
- {
- addli r10, sp, CLOSURE_FRAME_SIZE
- }
- {
- /* Restore the return address. */
- LW lr, r10
- /* Compute pointer to registers array. */
- addli r10, sp, LINKAGE_SIZE + (NUM_ARG_REGS * REG_SIZE)
- }
- /* Return all the register values, which C code may have set. */
- LOAD_REG(r0, r10)
- LOAD_REG(r1, r10)
- LOAD_REG(r2, r10)
- LOAD_REG(r3, r10)
- LOAD_REG(r4, r10)
- LOAD_REG(r5, r10)
- LOAD_REG(r6, r10)
- LOAD_REG(r7, r10)
- LOAD_REG(r8, r10)
- LOAD_REG(r9, r10)
- {
- /* Pop the frame. */
- addli sp, sp, CLOSURE_FRAME_SIZE
- jrp lr
- }
-
- .cfi_endproc
- .size ffi_closure_tile, . - ffi_closure_tile
-
-
-/* What follows are code template instructions that get copied to the
- closure trampoline by ffi_prep_closure_loc. The zeroed operands
- get replaced by their proper values at runtime. */
-
- .section .text.ffi_template_tramp_tile, "ax", @progbits
- .align 8
- .globl ffi_template_tramp_tile
- FFI_HIDDEN(ffi_template_tramp_tile)
-ffi_template_tramp_tile:
-#ifdef __tilegx__
- {
- moveli r11, 0 /* backpatched to address of containing closure. */
- moveli r10, 0 /* backpatched to ffi_closure_tile. */
- }
- /* Note: the following bundle gets generated multiple times
- depending on the pointer value (esp. useful for -m32 mode). */
- { shl16insli r11, r11, 0 ; shl16insli r10, r10, 0 }
- { info 2+8 /* for backtracer: -> pc in lr, frame size 0 */ ; jr r10 }
-#else
- /* 'jal .' yields a PC-relative offset of zero so we can OR in the
- right offset at runtime. */
- { move r10, lr ; jal . /* ffi_closure_tile */ }
-#endif
-
- .size ffi_template_tramp_tile, . - ffi_template_tramp_tile
diff --git a/Modules/_ctypes/libffi/src/types.c b/Modules/_ctypes/libffi/src/types.c
deleted file mode 100644
index 0de5994239..0000000000
--- a/Modules/_ctypes/libffi/src/types.c
+++ /dev/null
@@ -1,92 +0,0 @@
-/* -----------------------------------------------------------------------
- types.c - Copyright (c) 1996, 1998 Red Hat, Inc.
-
- Predefined ffi_types needed by libffi.
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- ``Software''), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to
- permit persons to whom the Software is furnished to do so, subject to
- the following conditions:
-
- The above copyright notice and this permission notice shall be included
- in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- DEALINGS IN THE SOFTWARE.
- ----------------------------------------------------------------------- */
-
-/* Hide the basic type definitions from the header file, so that we
- can redefine them here as "const". */
-#define LIBFFI_HIDE_BASIC_TYPES
-
-#include <ffi.h>
-#include <ffi_common.h>
-
-/* Type definitions */
-
-#define FFI_TYPEDEF(name, type, id) \
-struct struct_align_##name { \
- char c; \
- type x; \
-}; \
-const ffi_type ffi_type_##name = { \
- sizeof(type), \
- offsetof(struct struct_align_##name, x), \
- id, NULL \
-}
-
-#define FFI_NONCONST_TYPEDEF(name, type, id) \
-struct struct_align_##name { \
- char c; \
- type x; \
-}; \
-ffi_type ffi_type_##name = { \
- sizeof(type), \
- offsetof(struct struct_align_##name, x), \
- id, NULL \
-}
-
-/* Size and alignment are fake here. They must not be 0. */
-const ffi_type ffi_type_void = {
- 1, 1, FFI_TYPE_VOID, NULL
-};
-
-FFI_TYPEDEF(uint8, UINT8, FFI_TYPE_UINT8);
-FFI_TYPEDEF(sint8, SINT8, FFI_TYPE_SINT8);
-FFI_TYPEDEF(uint16, UINT16, FFI_TYPE_UINT16);
-FFI_TYPEDEF(sint16, SINT16, FFI_TYPE_SINT16);
-FFI_TYPEDEF(uint32, UINT32, FFI_TYPE_UINT32);
-FFI_TYPEDEF(sint32, SINT32, FFI_TYPE_SINT32);
-FFI_TYPEDEF(uint64, UINT64, FFI_TYPE_UINT64);
-FFI_TYPEDEF(sint64, SINT64, FFI_TYPE_SINT64);
-
-FFI_TYPEDEF(pointer, void*, FFI_TYPE_POINTER);
-
-FFI_TYPEDEF(float, float, FFI_TYPE_FLOAT);
-FFI_TYPEDEF(double, double, FFI_TYPE_DOUBLE);
-
-#ifdef __alpha__
-/* Even if we're not configured to default to 128-bit long double,
- maintain binary compatibility, as -mlong-double-128 can be used
- at any time. */
-/* Validate the hard-coded number below. */
-# if defined(__LONG_DOUBLE_128__) && FFI_TYPE_LONGDOUBLE != 4
-# error FFI_TYPE_LONGDOUBLE out of date
-# endif
-const ffi_type ffi_type_longdouble = { 16, 16, 4, NULL };
-#elif FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE
-# if HAVE_LONG_DOUBLE_VARIANT
-FFI_NONCONST_TYPEDEF(longdouble, long double, FFI_TYPE_LONGDOUBLE);
-# else
-FFI_TYPEDEF(longdouble, long double, FFI_TYPE_LONGDOUBLE);
-# endif
-#endif
diff --git a/Modules/_ctypes/libffi/src/vax/elfbsd.S b/Modules/_ctypes/libffi/src/vax/elfbsd.S
deleted file mode 100644
index 01ca313402..0000000000
--- a/Modules/_ctypes/libffi/src/vax/elfbsd.S
+++ /dev/null
@@ -1,195 +0,0 @@
-/*
- * Copyright (c) 2013 Miodrag Vallat. <miod@openbsd.org>
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- * ``Software''), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
- * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-/*
- * vax Foreign Function Interface
- */
-
-#define LIBFFI_ASM
-#include <fficonfig.h>
-#include <ffi.h>
-
- .text
-
-/*
- * void * %r0
- * ffi_call_elfbsd(extended_cif *ecif, 4(%ap)
- * unsigned bytes, 8(%ap)
- * unsigned flags, 12(%ap)
- * void *rvalue, 16(%ap)
- * void (*fn)()); 20(%ap)
- */
- .globl ffi_call_elfbsd
- .type ffi_call_elfbsd,@function
- .align 2
-ffi_call_elfbsd:
- .word 0x00c # save R2 and R3
-
- # Allocate stack space for the args
- subl2 8(%ap), %sp
-
- # Call ffi_prep_args
- pushl %sp
- pushl 4(%ap)
- calls $2, ffi_prep_args
-
- # Get function pointer
- movl 20(%ap), %r1
-
- # Build a CALLS frame
- ashl $-2, 8(%ap), %r0
- pushl %r0 # argument stack usage
- movl %sp, %r0 # future %ap
- # saved registers
- bbc $11, 0(%r1), 1f
- pushl %r11
-1: bbc $10, 0(%r1), 1f
- pushl %r10
-1: bbc $9, 0(%r1), 1f
- pushl %r9
-1: bbc $8, 0(%r1), 1f
- pushl %r8
-1: bbc $7, 0(%r1), 1f
- pushl %r7
-1: bbc $6, 0(%r1), 1f
- pushl %r6
-1: bbc $5, 0(%r1), 1f
- pushl %r5
-1: bbc $4, 0(%r1), 1f
- pushl %r4
-1: bbc $3, 0(%r1), 1f
- pushl %r3
-1: bbc $2, 0(%r1), 1f
- pushl %r2
-1:
- pushal 9f
- pushl %fp
- pushl %ap
- movl 16(%ap), %r3 # struct return address, if needed
- movl %r0, %ap
- movzwl 4(%fp), %r0 # previous PSW, without the saved registers mask
- bisl2 $0x20000000, %r0 # calls frame
- movzwl 0(%r1), %r2
- bicw2 $0xf003, %r2 # only keep R11-R2
- ashl $16, %r2, %r2
- bisl2 %r2, %r0 # saved register mask of the called function
- pushl %r0
- pushl $0
- movl %sp, %fp
-
- # Invoke the function
- pushal 2(%r1) # skip procedure entry mask
- movl %r3, %r1
- bicpsw $0x000f
- rsb
-
-9:
- # Copy return value if necessary
- tstl 16(%ap)
- jeql 9f
- movl 16(%ap), %r2
-
- bbc $0, 12(%ap), 1f # CIF_FLAGS_CHAR
- movb %r0, 0(%r2)
- brb 9f
-1:
- bbc $1, 12(%ap), 1f # CIF_FLAGS_SHORT
- movw %r0, 0(%r2)
- brb 9f
-1:
- bbc $2, 12(%ap), 1f # CIF_FLAGS_INT
- movl %r0, 0(%r2)
- brb 9f
-1:
- bbc $3, 12(%ap), 1f # CIF_FLAGS_DINT
- movq %r0, 0(%r2)
- brb 9f
-1:
- movl %r1, %r0 # might have been a struct
- #brb 9f
-
-9:
- ret
-
-/*
- * ffi_closure_elfbsd(void);
- * invoked with %r0: ffi_closure *closure
- */
- .globl ffi_closure_elfbsd
- .type ffi_closure_elfbsd, @function
- .align 2
-ffi_closure_elfbsd:
- .word 0
-
- # Allocate room on stack for return value
- subl2 $8, %sp
-
- # Invoke the closure function
- pushal 4(%ap) # calling stack
- pushal 4(%sp) # return value
- pushl %r0 # closure
- calls $3, ffi_closure_elfbsd_inner
-
- # Copy return value if necessary
- bitb $1, %r0 # CIF_FLAGS_CHAR
- beql 1f
- movb 0(%sp), %r0
- brb 9f
-1:
- bitb $2, %r0 # CIF_FLAGS_SHORT
- beql 1f
- movw 0(%sp), %r0
- brb 9f
-1:
- bitb $4, %r0 # CIF_FLAGS_INT
- beql 1f
- movl 0(%sp), %r0
- brb 9f
-1:
- bitb $8, %r0 # CIF_FLAGS_DINT
- beql 1f
- movq 0(%sp), %r0
- #brb 9f
-1:
-
-9:
- ret
-
-/*
- * ffi_closure_struct_elfbsd(void);
- * invoked with %r0: ffi_closure *closure
- * %r1: struct return address
- */
- .globl ffi_closure_struct_elfbsd
- .type ffi_closure_struct_elfbsd, @function
- .align 2
-ffi_closure_struct_elfbsd:
- .word 0
-
- # Invoke the closure function
- pushal 4(%ap) # calling stack
- pushl %r1 # return value
- pushl %r0 # closure
- calls $3, ffi_closure_elfbsd_inner
-
- ret
diff --git a/Modules/_ctypes/libffi/src/vax/ffi.c b/Modules/_ctypes/libffi/src/vax/ffi.c
deleted file mode 100644
index f4d6bbb4f4..0000000000
--- a/Modules/_ctypes/libffi/src/vax/ffi.c
+++ /dev/null
@@ -1,276 +0,0 @@
-/*
- * Copyright (c) 2013 Miodrag Vallat. <miod@openbsd.org>
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- * ``Software''), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
- * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-/*
- * vax Foreign Function Interface
- *
- * This file attempts to provide all the FFI entry points which can reliably
- * be implemented in C.
- */
-
-#include <ffi.h>
-#include <ffi_common.h>
-
-#include <stdlib.h>
-#include <unistd.h>
-
-#define CIF_FLAGS_CHAR 1 /* for struct only */
-#define CIF_FLAGS_SHORT 2 /* for struct only */
-#define CIF_FLAGS_INT 4
-#define CIF_FLAGS_DINT 8
-
-/*
- * Foreign Function Interface API
- */
-
-void ffi_call_elfbsd (extended_cif *, unsigned, unsigned, void *,
- void (*) ());
-void *ffi_prep_args (extended_cif *ecif, void *stack);
-
-void *
-ffi_prep_args (extended_cif *ecif, void *stack)
-{
- unsigned int i;
- void **p_argv;
- char *argp;
- ffi_type **p_arg;
- void *struct_value_ptr;
-
- argp = stack;
-
- if (ecif->cif->rtype->type == FFI_TYPE_STRUCT
- && !ecif->cif->flags)
- struct_value_ptr = ecif->rvalue;
- else
- struct_value_ptr = NULL;
-
- p_argv = ecif->avalue;
-
- for (i = ecif->cif->nargs, p_arg = ecif->cif->arg_types;
- i != 0;
- i--, p_arg++)
- {
- size_t z;
-
- z = (*p_arg)->size;
- if (z < sizeof (int))
- {
- switch ((*p_arg)->type)
- {
- case FFI_TYPE_SINT8:
- *(signed int *) argp = (signed int) *(SINT8 *) *p_argv;
- break;
-
- case FFI_TYPE_UINT8:
- *(unsigned int *) argp = (unsigned int) *(UINT8 *) *p_argv;
- break;
-
- case FFI_TYPE_SINT16:
- *(signed int *) argp = (signed int) *(SINT16 *) *p_argv;
- break;
-
- case FFI_TYPE_UINT16:
- *(unsigned int *) argp = (unsigned int) *(UINT16 *) *p_argv;
- break;
-
- case FFI_TYPE_STRUCT:
- memcpy (argp, *p_argv, z);
- break;
-
- default:
- FFI_ASSERT (0);
- }
- z = sizeof (int);
- }
- else
- {
- memcpy (argp, *p_argv, z);
-
- /* Align if necessary. */
- if ((sizeof(int) - 1) & z)
- z = ALIGN(z, sizeof(int));
- }
-
- p_argv++;
- argp += z;
- }
-
- return struct_value_ptr;
-}
-
-ffi_status
-ffi_prep_cif_machdep (ffi_cif *cif)
-{
- /* Set the return type flag */
- switch (cif->rtype->type)
- {
- case FFI_TYPE_VOID:
- cif->flags = 0;
- break;
-
- case FFI_TYPE_STRUCT:
- if (cif->rtype->elements[0]->type == FFI_TYPE_STRUCT &&
- cif->rtype->elements[1])
- {
- cif->flags = 0;
- break;
- }
-
- if (cif->rtype->size == sizeof (char))
- cif->flags = CIF_FLAGS_CHAR;
- else if (cif->rtype->size == sizeof (short))
- cif->flags = CIF_FLAGS_SHORT;
- else if (cif->rtype->size == sizeof (int))
- cif->flags = CIF_FLAGS_INT;
- else if (cif->rtype->size == 2 * sizeof (int))
- cif->flags = CIF_FLAGS_DINT;
- else
- cif->flags = 0;
- break;
-
- default:
- if (cif->rtype->size <= sizeof (int))
- cif->flags = CIF_FLAGS_INT;
- else
- cif->flags = CIF_FLAGS_DINT;
- break;
- }
-
- return FFI_OK;
-}
-
-void
-ffi_call (ffi_cif *cif, void (*fn) (), void *rvalue, void **avalue)
-{
- extended_cif ecif;
-
- ecif.cif = cif;
- ecif.avalue = avalue;
-
- /* If the return value is a struct and we don't have a return value
- address then we need to make one. */
-
- if (rvalue == NULL
- && cif->rtype->type == FFI_TYPE_STRUCT
- && cif->flags == 0)
- ecif.rvalue = alloca (cif->rtype->size);
- else
- ecif.rvalue = rvalue;
-
- switch (cif->abi)
- {
- case FFI_ELFBSD:
- ffi_call_elfbsd (&ecif, cif->bytes, cif->flags, ecif.rvalue, fn);
- break;
-
- default:
- FFI_ASSERT (0);
- break;
- }
-}
-
-/*
- * Closure API
- */
-
-void ffi_closure_elfbsd (void);
-void ffi_closure_struct_elfbsd (void);
-unsigned int ffi_closure_elfbsd_inner (ffi_closure *, void *, char *);
-
-static void
-ffi_prep_closure_elfbsd (ffi_cif *cif, void **avalue, char *stackp)
-{
- unsigned int i;
- void **p_argv;
- ffi_type **p_arg;
-
- p_argv = avalue;
-
- for (i = cif->nargs, p_arg = cif->arg_types; i != 0; i--, p_arg++)
- {
- size_t z;
-
- z = (*p_arg)->size;
- *p_argv = stackp;
-
- /* Align if necessary */
- if ((sizeof (int) - 1) & z)
- z = ALIGN(z, sizeof (int));
-
- p_argv++;
- stackp += z;
- }
-}
-
-unsigned int
-ffi_closure_elfbsd_inner (ffi_closure *closure, void *resp, char *stack)
-{
- ffi_cif *cif;
- void **arg_area;
-
- cif = closure->cif;
- arg_area = (void **) alloca (cif->nargs * sizeof (void *));
-
- ffi_prep_closure_elfbsd (cif, arg_area, stack);
-
- (closure->fun) (cif, resp, arg_area, closure->user_data);
-
- return cif->flags;
-}
-
-ffi_status
-ffi_prep_closure_loc (ffi_closure *closure, ffi_cif *cif,
- void (*fun)(ffi_cif *, void *, void **, void *),
- void *user_data, void *codeloc)
-{
- char *tramp = (char *) codeloc;
- void *fn;
-
- FFI_ASSERT (cif->abi == FFI_ELFBSD);
-
- /* entry mask */
- *(unsigned short *)(tramp + 0) = 0x0000;
- /* movl #closure, r0 */
- tramp[2] = 0xd0;
- tramp[3] = 0x8f;
- *(unsigned int *)(tramp + 4) = (unsigned int) closure;
- tramp[8] = 0x50;
-
- if (cif->rtype->type == FFI_TYPE_STRUCT
- && !cif->flags)
- fn = &ffi_closure_struct_elfbsd;
- else
- fn = &ffi_closure_elfbsd;
-
- /* jmpl #fn */
- tramp[9] = 0x17;
- tramp[10] = 0xef;
- *(unsigned int *)(tramp + 11) = (unsigned int)fn + 2 -
- (unsigned int)tramp - 9 - 6;
-
- closure->cif = cif;
- closure->user_data = user_data;
- closure->fun = fun;
-
- return FFI_OK;
-}
diff --git a/Modules/_ctypes/libffi/src/vax/ffitarget.h b/Modules/_ctypes/libffi/src/vax/ffitarget.h
deleted file mode 100644
index 2fc94881ab..0000000000
--- a/Modules/_ctypes/libffi/src/vax/ffitarget.h
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Copyright (c) 2013 Miodrag Vallat. <miod@openbsd.org>
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- * ``Software''), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
- * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-/*
- * vax Foreign Function Interface
- */
-
-#ifndef LIBFFI_TARGET_H
-#define LIBFFI_TARGET_H
-
-#ifndef LIBFFI_ASM
-typedef unsigned long ffi_arg;
-typedef signed long ffi_sarg;
-
-typedef enum ffi_abi {
- FFI_FIRST_ABI = 0,
- FFI_ELFBSD,
- FFI_DEFAULT_ABI = FFI_ELFBSD,
- FFI_LAST_ABI = FFI_DEFAULT_ABI + 1
-} ffi_abi;
-#endif
-
-/* ---- Definitions for closures ----------------------------------------- */
-
-#define FFI_CLOSURES 1
-#define FFI_TRAMPOLINE_SIZE 15
-#define FFI_NATIVE_RAW_API 0
-
-#endif
diff --git a/Modules/_ctypes/libffi/src/x86/darwin.S b/Modules/_ctypes/libffi/src/x86/darwin.S
deleted file mode 100644
index 8f0f0707aa..0000000000
--- a/Modules/_ctypes/libffi/src/x86/darwin.S
+++ /dev/null
@@ -1,444 +0,0 @@
-/* -----------------------------------------------------------------------
- darwin.S - Copyright (c) 1996, 1998, 2001, 2002, 2003, 2005 Red Hat, Inc.
- Copyright (C) 2008 Free Software Foundation, Inc.
-
- X86 Foreign Function Interface
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- ``Software''), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to
- permit persons to whom the Software is furnished to do so, subject to
- the following conditions:
-
- The above copyright notice and this permission notice shall be included
- in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- DEALINGS IN THE SOFTWARE.
- -----------------------------------------------------------------------
- */
-
-#ifndef __x86_64__
-
-#define LIBFFI_ASM
-#include <fficonfig.h>
-#include <ffi.h>
-
-.text
-
-.globl _ffi_prep_args
-
- .align 4
-.globl _ffi_call_SYSV
-
-_ffi_call_SYSV:
-.LFB1:
- pushl %ebp
-.LCFI0:
- movl %esp,%ebp
-.LCFI1:
- subl $8,%esp
- /* Make room for all of the new args. */
- movl 16(%ebp),%ecx
- subl %ecx,%esp
-
- movl %esp,%eax
-
- /* Place all of the ffi_prep_args in position */
- subl $8,%esp
- pushl 12(%ebp)
- pushl %eax
- call *8(%ebp)
-
- /* Return stack to previous state and call the function */
- addl $16,%esp
-
- call *28(%ebp)
-
- /* Load %ecx with the return type code */
- movl 20(%ebp),%ecx
-
- /* Protect %esi. We're going to pop it in the epilogue. */
- pushl %esi
-
- /* If the return value pointer is NULL, assume no return value. */
- cmpl $0,24(%ebp)
- jne 0f
-
- /* Even if there is no space for the return value, we are
- obliged to handle floating-point values. */
- cmpl $FFI_TYPE_FLOAT,%ecx
- jne noretval
- fstp %st(0)
-
- jmp epilogue
-0:
- .align 4
- call 1f
-.Lstore_table:
- .long noretval-.Lstore_table /* FFI_TYPE_VOID */
- .long retint-.Lstore_table /* FFI_TYPE_INT */
- .long retfloat-.Lstore_table /* FFI_TYPE_FLOAT */
- .long retdouble-.Lstore_table /* FFI_TYPE_DOUBLE */
- .long retlongdouble-.Lstore_table /* FFI_TYPE_LONGDOUBLE */
- .long retuint8-.Lstore_table /* FFI_TYPE_UINT8 */
- .long retsint8-.Lstore_table /* FFI_TYPE_SINT8 */
- .long retuint16-.Lstore_table /* FFI_TYPE_UINT16 */
- .long retsint16-.Lstore_table /* FFI_TYPE_SINT16 */
- .long retint-.Lstore_table /* FFI_TYPE_UINT32 */
- .long retint-.Lstore_table /* FFI_TYPE_SINT32 */
- .long retint64-.Lstore_table /* FFI_TYPE_UINT64 */
- .long retint64-.Lstore_table /* FFI_TYPE_SINT64 */
- .long retstruct-.Lstore_table /* FFI_TYPE_STRUCT */
- .long retint-.Lstore_table /* FFI_TYPE_POINTER */
- .long retstruct1b-.Lstore_table /* FFI_TYPE_SMALL_STRUCT_1B */
- .long retstruct2b-.Lstore_table /* FFI_TYPE_SMALL_STRUCT_2B */
-1:
- pop %esi
- add (%esi, %ecx, 4), %esi
- jmp *%esi
-
- /* Sign/zero extend as appropriate. */
-retsint8:
- movsbl %al, %eax
- jmp retint
-
-retsint16:
- movswl %ax, %eax
- jmp retint
-
-retuint8:
- movzbl %al, %eax
- jmp retint
-
-retuint16:
- movzwl %ax, %eax
- jmp retint
-
-retfloat:
- /* Load %ecx with the pointer to storage for the return value */
- movl 24(%ebp),%ecx
- fstps (%ecx)
- jmp epilogue
-
-retdouble:
- /* Load %ecx with the pointer to storage for the return value */
- movl 24(%ebp),%ecx
- fstpl (%ecx)
- jmp epilogue
-
-retlongdouble:
- /* Load %ecx with the pointer to storage for the return value */
- movl 24(%ebp),%ecx
- fstpt (%ecx)
- jmp epilogue
-
-retint64:
- /* Load %ecx with the pointer to storage for the return value */
- movl 24(%ebp),%ecx
- movl %eax,0(%ecx)
- movl %edx,4(%ecx)
- jmp epilogue
-
-retstruct1b:
- /* Load %ecx with the pointer to storage for the return value */
- movl 24(%ebp),%ecx
- movb %al,0(%ecx)
- jmp epilogue
-
-retstruct2b:
- /* Load %ecx with the pointer to storage for the return value */
- movl 24(%ebp),%ecx
- movw %ax,0(%ecx)
- jmp epilogue
-
-retint:
- /* Load %ecx with the pointer to storage for the return value */
- movl 24(%ebp),%ecx
- movl %eax,0(%ecx)
-
-retstruct:
- /* Nothing to do! */
-
-noretval:
-epilogue:
- popl %esi
- movl %ebp,%esp
- popl %ebp
- ret
-
-.LFE1:
-.ffi_call_SYSV_end:
-
- .align 4
-FFI_HIDDEN (ffi_closure_SYSV)
-.globl _ffi_closure_SYSV
-
-_ffi_closure_SYSV:
-.LFB2:
- pushl %ebp
-.LCFI2:
- movl %esp, %ebp
-.LCFI3:
- subl $40, %esp
- leal -24(%ebp), %edx
- movl %edx, -12(%ebp) /* resp */
- leal 8(%ebp), %edx
- movl %edx, 4(%esp) /* args = __builtin_dwarf_cfa () */
- leal -12(%ebp), %edx
- movl %edx, (%esp) /* &resp */
- movl %ebx, 8(%esp)
-.LCFI7:
- call L_ffi_closure_SYSV_inner$stub
- movl 8(%esp), %ebx
- movl -12(%ebp), %ecx
- cmpl $FFI_TYPE_INT, %eax
- je .Lcls_retint
-
- /* Handle FFI_TYPE_UINT8, FFI_TYPE_SINT8, FFI_TYPE_UINT16,
- FFI_TYPE_SINT16, FFI_TYPE_UINT32, FFI_TYPE_SINT32. */
- cmpl $FFI_TYPE_UINT64, %eax
- jge 0f
- cmpl $FFI_TYPE_UINT8, %eax
- jge .Lcls_retint
-
-0: cmpl $FFI_TYPE_FLOAT, %eax
- je .Lcls_retfloat
- cmpl $FFI_TYPE_DOUBLE, %eax
- je .Lcls_retdouble
- cmpl $FFI_TYPE_LONGDOUBLE, %eax
- je .Lcls_retldouble
- cmpl $FFI_TYPE_SINT64, %eax
- je .Lcls_retllong
- cmpl $FFI_TYPE_SMALL_STRUCT_1B, %eax
- je .Lcls_retstruct1b
- cmpl $FFI_TYPE_SMALL_STRUCT_2B, %eax
- je .Lcls_retstruct2b
- cmpl $FFI_TYPE_STRUCT, %eax
- je .Lcls_retstruct
-.Lcls_epilogue:
- movl %ebp, %esp
- popl %ebp
- ret
-.Lcls_retint:
- movl (%ecx), %eax
- jmp .Lcls_epilogue
-.Lcls_retfloat:
- flds (%ecx)
- jmp .Lcls_epilogue
-.Lcls_retdouble:
- fldl (%ecx)
- jmp .Lcls_epilogue
-.Lcls_retldouble:
- fldt (%ecx)
- jmp .Lcls_epilogue
-.Lcls_retllong:
- movl (%ecx), %eax
- movl 4(%ecx), %edx
- jmp .Lcls_epilogue
-.Lcls_retstruct1b:
- movsbl (%ecx), %eax
- jmp .Lcls_epilogue
-.Lcls_retstruct2b:
- movswl (%ecx), %eax
- jmp .Lcls_epilogue
-.Lcls_retstruct:
- lea -8(%ebp),%esp
- movl %ebp, %esp
- popl %ebp
- ret $4
-.LFE2:
-
-#if !FFI_NO_RAW_API
-
-#define RAW_CLOSURE_CIF_OFFSET ((FFI_TRAMPOLINE_SIZE + 3) & ~3)
-#define RAW_CLOSURE_FUN_OFFSET (RAW_CLOSURE_CIF_OFFSET + 4)
-#define RAW_CLOSURE_USER_DATA_OFFSET (RAW_CLOSURE_FUN_OFFSET + 4)
-#define CIF_FLAGS_OFFSET 20
-
- .align 4
-FFI_HIDDEN (ffi_closure_raw_SYSV)
-.globl _ffi_closure_raw_SYSV
-
-_ffi_closure_raw_SYSV:
-.LFB3:
- pushl %ebp
-.LCFI4:
- movl %esp, %ebp
-.LCFI5:
- pushl %esi
-.LCFI6:
- subl $36, %esp
- movl RAW_CLOSURE_CIF_OFFSET(%eax), %esi /* closure->cif */
- movl RAW_CLOSURE_USER_DATA_OFFSET(%eax), %edx /* closure->user_data */
- movl %edx, 12(%esp) /* user_data */
- leal 8(%ebp), %edx /* __builtin_dwarf_cfa () */
- movl %edx, 8(%esp) /* raw_args */
- leal -24(%ebp), %edx
- movl %edx, 4(%esp) /* &res */
- movl %esi, (%esp) /* cif */
- call *RAW_CLOSURE_FUN_OFFSET(%eax) /* closure->fun */
- movl CIF_FLAGS_OFFSET(%esi), %eax /* rtype */
- cmpl $FFI_TYPE_INT, %eax
- je .Lrcls_retint
-
- /* Handle FFI_TYPE_UINT8, FFI_TYPE_SINT8, FFI_TYPE_UINT16,
- FFI_TYPE_SINT16, FFI_TYPE_UINT32, FFI_TYPE_SINT32. */
- cmpl $FFI_TYPE_UINT64, %eax
- jge 0f
- cmpl $FFI_TYPE_UINT8, %eax
- jge .Lrcls_retint
-0:
- cmpl $FFI_TYPE_FLOAT, %eax
- je .Lrcls_retfloat
- cmpl $FFI_TYPE_DOUBLE, %eax
- je .Lrcls_retdouble
- cmpl $FFI_TYPE_LONGDOUBLE, %eax
- je .Lrcls_retldouble
- cmpl $FFI_TYPE_SINT64, %eax
- je .Lrcls_retllong
-.Lrcls_epilogue:
- addl $36, %esp
- popl %esi
- popl %ebp
- ret
-.Lrcls_retint:
- movl -24(%ebp), %eax
- jmp .Lrcls_epilogue
-.Lrcls_retfloat:
- flds -24(%ebp)
- jmp .Lrcls_epilogue
-.Lrcls_retdouble:
- fldl -24(%ebp)
- jmp .Lrcls_epilogue
-.Lrcls_retldouble:
- fldt -24(%ebp)
- jmp .Lrcls_epilogue
-.Lrcls_retllong:
- movl -24(%ebp), %eax
- movl -20(%ebp), %edx
- jmp .Lrcls_epilogue
-.LFE3:
-#endif
-
-.section __IMPORT,__jump_table,symbol_stubs,self_modifying_code+pure_instructions,5
-L_ffi_closure_SYSV_inner$stub:
- .indirect_symbol _ffi_closure_SYSV_inner
- hlt ; hlt ; hlt ; hlt ; hlt
-
-
-.section __TEXT,__eh_frame,coalesced,no_toc+strip_static_syms+live_support
-EH_frame1:
- .set L$set$0,LECIE1-LSCIE1
- .long L$set$0
-LSCIE1:
- .long 0x0
- .byte 0x1
- .ascii "zR\0"
- .byte 0x1
- .byte 0x7c
- .byte 0x8
- .byte 0x1
- .byte 0x10
- .byte 0xc
- .byte 0x5
- .byte 0x4
- .byte 0x88
- .byte 0x1
- .align 2
-LECIE1:
-.globl _ffi_call_SYSV.eh
-_ffi_call_SYSV.eh:
-LSFDE1:
- .set L$set$1,LEFDE1-LASFDE1
- .long L$set$1
-LASFDE1:
- .long LASFDE1-EH_frame1
- .long .LFB1-.
- .set L$set$2,.LFE1-.LFB1
- .long L$set$2
- .byte 0x0
- .byte 0x4
- .set L$set$3,.LCFI0-.LFB1
- .long L$set$3
- .byte 0xe
- .byte 0x8
- .byte 0x84
- .byte 0x2
- .byte 0x4
- .set L$set$4,.LCFI1-.LCFI0
- .long L$set$4
- .byte 0xd
- .byte 0x4
- .align 2
-LEFDE1:
-.globl _ffi_closure_SYSV.eh
-_ffi_closure_SYSV.eh:
-LSFDE2:
- .set L$set$5,LEFDE2-LASFDE2
- .long L$set$5
-LASFDE2:
- .long LASFDE2-EH_frame1
- .long .LFB2-.
- .set L$set$6,.LFE2-.LFB2
- .long L$set$6
- .byte 0x0
- .byte 0x4
- .set L$set$7,.LCFI2-.LFB2
- .long L$set$7
- .byte 0xe
- .byte 0x8
- .byte 0x84
- .byte 0x2
- .byte 0x4
- .set L$set$8,.LCFI3-.LCFI2
- .long L$set$8
- .byte 0xd
- .byte 0x4
- .align 2
-LEFDE2:
-
-#if !FFI_NO_RAW_API
-
-.globl _ffi_closure_raw_SYSV.eh
-_ffi_closure_raw_SYSV.eh:
-LSFDE3:
- .set L$set$10,LEFDE3-LASFDE3
- .long L$set$10
-LASFDE3:
- .long LASFDE3-EH_frame1
- .long .LFB3-.
- .set L$set$11,.LFE3-.LFB3
- .long L$set$11
- .byte 0x0
- .byte 0x4
- .set L$set$12,.LCFI4-.LFB3
- .long L$set$12
- .byte 0xe
- .byte 0x8
- .byte 0x84
- .byte 0x2
- .byte 0x4
- .set L$set$13,.LCFI5-.LCFI4
- .long L$set$13
- .byte 0xd
- .byte 0x4
- .byte 0x4
- .set L$set$14,.LCFI6-.LCFI5
- .long L$set$14
- .byte 0x85
- .byte 0x3
- .align 2
-LEFDE3:
-
-#endif
-
-#endif /* ifndef __x86_64__ */
diff --git a/Modules/_ctypes/libffi/src/x86/darwin64.S b/Modules/_ctypes/libffi/src/x86/darwin64.S
deleted file mode 100644
index 0c72ed2921..0000000000
--- a/Modules/_ctypes/libffi/src/x86/darwin64.S
+++ /dev/null
@@ -1,416 +0,0 @@
-/* -----------------------------------------------------------------------
- darwin64.S - Copyright (c) 2006 Free Software Foundation, Inc.
- Copyright (c) 2008 Red Hat, Inc.
- derived from unix64.S
-
- x86-64 Foreign Function Interface for Darwin.
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- ``Software''), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to
- permit persons to whom the Software is furnished to do so, subject to
- the following conditions:
-
- The above copyright notice and this permission notice shall be included
- in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS
- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR
- OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- OTHER DEALINGS IN THE SOFTWARE.
- ----------------------------------------------------------------------- */
-
-#ifdef __x86_64__
-#define LIBFFI_ASM
-#include <fficonfig.h>
-#include <ffi.h>
-
- .file "darwin64.S"
-.text
-
-/* ffi_call_unix64 (void *args, unsigned long bytes, unsigned flags,
- void *raddr, void (*fnaddr)(void));
-
- Bit o trickiness here -- ARGS+BYTES is the base of the stack frame
- for this function. This has been allocated by ffi_call. We also
- deallocate some of the stack that has been alloca'd. */
-
- .align 3
- .globl _ffi_call_unix64
-
-_ffi_call_unix64:
-LUW0:
- movq (%rsp), %r10 /* Load return address. */
- leaq (%rdi, %rsi), %rax /* Find local stack base. */
- movq %rdx, (%rax) /* Save flags. */
- movq %rcx, 8(%rax) /* Save raddr. */
- movq %rbp, 16(%rax) /* Save old frame pointer. */
- movq %r10, 24(%rax) /* Relocate return address. */
- movq %rax, %rbp /* Finalize local stack frame. */
-LUW1:
- movq %rdi, %r10 /* Save a copy of the register area. */
- movq %r8, %r11 /* Save a copy of the target fn. */
- movl %r9d, %eax /* Set number of SSE registers. */
-
- /* Load up all argument registers. */
- movq (%r10), %rdi
- movq 8(%r10), %rsi
- movq 16(%r10), %rdx
- movq 24(%r10), %rcx
- movq 32(%r10), %r8
- movq 40(%r10), %r9
- testl %eax, %eax
- jnz Lload_sse
-Lret_from_load_sse:
-
- /* Deallocate the reg arg area. */
- leaq 176(%r10), %rsp
-
- /* Call the user function. */
- call *%r11
-
- /* Deallocate stack arg area; local stack frame in redzone. */
- leaq 24(%rbp), %rsp
-
- movq 0(%rbp), %rcx /* Reload flags. */
- movq 8(%rbp), %rdi /* Reload raddr. */
- movq 16(%rbp), %rbp /* Reload old frame pointer. */
-LUW2:
-
- /* The first byte of the flags contains the FFI_TYPE. */
- movzbl %cl, %r10d
- leaq Lstore_table(%rip), %r11
- movslq (%r11, %r10, 4), %r10
- addq %r11, %r10
- jmp *%r10
-
-Lstore_table:
- .long Lst_void-Lstore_table /* FFI_TYPE_VOID */
- .long Lst_sint32-Lstore_table /* FFI_TYPE_INT */
- .long Lst_float-Lstore_table /* FFI_TYPE_FLOAT */
- .long Lst_double-Lstore_table /* FFI_TYPE_DOUBLE */
- .long Lst_ldouble-Lstore_table /* FFI_TYPE_LONGDOUBLE */
- .long Lst_uint8-Lstore_table /* FFI_TYPE_UINT8 */
- .long Lst_sint8-Lstore_table /* FFI_TYPE_SINT8 */
- .long Lst_uint16-Lstore_table /* FFI_TYPE_UINT16 */
- .long Lst_sint16-Lstore_table /* FFI_TYPE_SINT16 */
- .long Lst_uint32-Lstore_table /* FFI_TYPE_UINT32 */
- .long Lst_sint32-Lstore_table /* FFI_TYPE_SINT32 */
- .long Lst_int64-Lstore_table /* FFI_TYPE_UINT64 */
- .long Lst_int64-Lstore_table /* FFI_TYPE_SINT64 */
- .long Lst_struct-Lstore_table /* FFI_TYPE_STRUCT */
- .long Lst_int64-Lstore_table /* FFI_TYPE_POINTER */
-
- .text
- .align 3
-Lst_void:
- ret
- .align 3
-Lst_uint8:
- movzbq %al, %rax
- movq %rax, (%rdi)
- ret
- .align 3
-Lst_sint8:
- movsbq %al, %rax
- movq %rax, (%rdi)
- ret
- .align 3
-Lst_uint16:
- movzwq %ax, %rax
- movq %rax, (%rdi)
- .align 3
-Lst_sint16:
- movswq %ax, %rax
- movq %rax, (%rdi)
- ret
- .align 3
-Lst_uint32:
- movl %eax, %eax
- movq %rax, (%rdi)
- .align 3
-Lst_sint32:
- cltq
- movq %rax, (%rdi)
- ret
- .align 3
-Lst_int64:
- movq %rax, (%rdi)
- ret
- .align 3
-Lst_float:
- movss %xmm0, (%rdi)
- ret
- .align 3
-Lst_double:
- movsd %xmm0, (%rdi)
- ret
-Lst_ldouble:
- fstpt (%rdi)
- ret
- .align 3
-Lst_struct:
- leaq -20(%rsp), %rsi /* Scratch area in redzone. */
-
- /* We have to locate the values now, and since we don't want to
- write too much data into the user's return value, we spill the
- value to a 16 byte scratch area first. Bits 8, 9, and 10
- control where the values are located. Only one of the three
- bits will be set; see ffi_prep_cif_machdep for the pattern. */
- movd %xmm0, %r10
- movd %xmm1, %r11
- testl $0x100, %ecx
- cmovnz %rax, %rdx
- cmovnz %r10, %rax
- testl $0x200, %ecx
- cmovnz %r10, %rdx
- testl $0x400, %ecx
- cmovnz %r10, %rax
- cmovnz %r11, %rdx
- movq %rax, (%rsi)
- movq %rdx, 8(%rsi)
-
- /* Bits 12-31 contain the true size of the structure. Copy from
- the scratch area to the true destination. */
- shrl $12, %ecx
- rep movsb
- ret
-
- /* Many times we can avoid loading any SSE registers at all.
- It's not worth an indirect jump to load the exact set of
- SSE registers needed; zero or all is a good compromise. */
- .align 3
-LUW3:
-Lload_sse:
- movdqa 48(%r10), %xmm0
- movdqa 64(%r10), %xmm1
- movdqa 80(%r10), %xmm2
- movdqa 96(%r10), %xmm3
- movdqa 112(%r10), %xmm4
- movdqa 128(%r10), %xmm5
- movdqa 144(%r10), %xmm6
- movdqa 160(%r10), %xmm7
- jmp Lret_from_load_sse
-
-LUW4:
- .align 3
- .globl _ffi_closure_unix64
-
-_ffi_closure_unix64:
-LUW5:
- /* The carry flag is set by the trampoline iff SSE registers
- are used. Don't clobber it before the branch instruction. */
- leaq -200(%rsp), %rsp
-LUW6:
- movq %rdi, (%rsp)
- movq %rsi, 8(%rsp)
- movq %rdx, 16(%rsp)
- movq %rcx, 24(%rsp)
- movq %r8, 32(%rsp)
- movq %r9, 40(%rsp)
- jc Lsave_sse
-Lret_from_save_sse:
-
- movq %r10, %rdi
- leaq 176(%rsp), %rsi
- movq %rsp, %rdx
- leaq 208(%rsp), %rcx
- call _ffi_closure_unix64_inner
-
- /* Deallocate stack frame early; return value is now in redzone. */
- addq $200, %rsp
-LUW7:
-
- /* The first byte of the return value contains the FFI_TYPE. */
- movzbl %al, %r10d
- leaq Lload_table(%rip), %r11
- movslq (%r11, %r10, 4), %r10
- addq %r11, %r10
- jmp *%r10
-
-Lload_table:
- .long Lld_void-Lload_table /* FFI_TYPE_VOID */
- .long Lld_int32-Lload_table /* FFI_TYPE_INT */
- .long Lld_float-Lload_table /* FFI_TYPE_FLOAT */
- .long Lld_double-Lload_table /* FFI_TYPE_DOUBLE */
- .long Lld_ldouble-Lload_table /* FFI_TYPE_LONGDOUBLE */
- .long Lld_int8-Lload_table /* FFI_TYPE_UINT8 */
- .long Lld_int8-Lload_table /* FFI_TYPE_SINT8 */
- .long Lld_int16-Lload_table /* FFI_TYPE_UINT16 */
- .long Lld_int16-Lload_table /* FFI_TYPE_SINT16 */
- .long Lld_int32-Lload_table /* FFI_TYPE_UINT32 */
- .long Lld_int32-Lload_table /* FFI_TYPE_SINT32 */
- .long Lld_int64-Lload_table /* FFI_TYPE_UINT64 */
- .long Lld_int64-Lload_table /* FFI_TYPE_SINT64 */
- .long Lld_struct-Lload_table /* FFI_TYPE_STRUCT */
- .long Lld_int64-Lload_table /* FFI_TYPE_POINTER */
-
- .text
- .align 3
-Lld_void:
- ret
- .align 3
-Lld_int8:
- movzbl -24(%rsp), %eax
- ret
- .align 3
-Lld_int16:
- movzwl -24(%rsp), %eax
- ret
- .align 3
-Lld_int32:
- movl -24(%rsp), %eax
- ret
- .align 3
-Lld_int64:
- movq -24(%rsp), %rax
- ret
- .align 3
-Lld_float:
- movss -24(%rsp), %xmm0
- ret
- .align 3
-Lld_double:
- movsd -24(%rsp), %xmm0
- ret
- .align 3
-Lld_ldouble:
- fldt -24(%rsp)
- ret
- .align 3
-Lld_struct:
- /* There are four possibilities here, %rax/%rdx, %xmm0/%rax,
- %rax/%xmm0, %xmm0/%xmm1. We collapse two by always loading
- both rdx and xmm1 with the second word. For the remaining,
- bit 8 set means xmm0 gets the second word, and bit 9 means
- that rax gets the second word. */
- movq -24(%rsp), %rcx
- movq -16(%rsp), %rdx
- movq -16(%rsp), %xmm1
- testl $0x100, %eax
- cmovnz %rdx, %rcx
- movd %rcx, %xmm0
- testl $0x200, %eax
- movq -24(%rsp), %rax
- cmovnz %rdx, %rax
- ret
-
- /* See the comment above Lload_sse; the same logic applies here. */
- .align 3
-LUW8:
-Lsave_sse:
- movdqa %xmm0, 48(%rsp)
- movdqa %xmm1, 64(%rsp)
- movdqa %xmm2, 80(%rsp)
- movdqa %xmm3, 96(%rsp)
- movdqa %xmm4, 112(%rsp)
- movdqa %xmm5, 128(%rsp)
- movdqa %xmm6, 144(%rsp)
- movdqa %xmm7, 160(%rsp)
- jmp Lret_from_save_sse
-
-LUW9:
-.section __TEXT,__eh_frame,coalesced,no_toc+strip_static_syms+live_support
-EH_frame1:
- .set L$set$0,LECIE1-LSCIE1 /* CIE Length */
- .long L$set$0
-LSCIE1:
- .long 0x0 /* CIE Identifier Tag */
- .byte 0x1 /* CIE Version */
- .ascii "zR\0" /* CIE Augmentation */
- .byte 0x1 /* uleb128 0x1; CIE Code Alignment Factor */
- .byte 0x78 /* sleb128 -8; CIE Data Alignment Factor */
- .byte 0x10 /* CIE RA Column */
- .byte 0x1 /* uleb128 0x1; Augmentation size */
- .byte 0x10 /* FDE Encoding (pcrel sdata4) */
- .byte 0xc /* DW_CFA_def_cfa, %rsp offset 8 */
- .byte 0x7 /* uleb128 0x7 */
- .byte 0x8 /* uleb128 0x8 */
- .byte 0x90 /* DW_CFA_offset, column 0x10 */
- .byte 0x1
- .align 3
-LECIE1:
- .globl _ffi_call_unix64.eh
-_ffi_call_unix64.eh:
-LSFDE1:
- .set L$set$1,LEFDE1-LASFDE1 /* FDE Length */
- .long L$set$1
-LASFDE1:
- .long LASFDE1-EH_frame1 /* FDE CIE offset */
- .quad LUW0-. /* FDE initial location */
- .set L$set$2,LUW4-LUW0 /* FDE address range */
- .quad L$set$2
- .byte 0x0 /* Augmentation size */
- .byte 0x4 /* DW_CFA_advance_loc4 */
- .set L$set$3,LUW1-LUW0
- .long L$set$3
-
- /* New stack frame based off rbp. This is an itty bit of unwind
- trickery in that the CFA *has* changed. There is no easy way
- to describe it correctly on entry to the function. Fortunately,
- it doesn't matter too much since at all points we can correctly
- unwind back to ffi_call. Note that the location to which we
- moved the return address is (the new) CFA-8, so from the
- perspective of the unwind info, it hasn't moved. */
- .byte 0xc /* DW_CFA_def_cfa, %rbp offset 32 */
- .byte 0x6
- .byte 0x20
- .byte 0x80+6 /* DW_CFA_offset, %rbp offset 2*-8 */
- .byte 0x2
- .byte 0xa /* DW_CFA_remember_state */
-
- .byte 0x4 /* DW_CFA_advance_loc4 */
- .set L$set$4,LUW2-LUW1
- .long L$set$4
- .byte 0xc /* DW_CFA_def_cfa, %rsp offset 8 */
- .byte 0x7
- .byte 0x8
- .byte 0xc0+6 /* DW_CFA_restore, %rbp */
-
- .byte 0x4 /* DW_CFA_advance_loc4 */
- .set L$set$5,LUW3-LUW2
- .long L$set$5
- .byte 0xb /* DW_CFA_restore_state */
-
- .align 3
-LEFDE1:
- .globl _ffi_closure_unix64.eh
-_ffi_closure_unix64.eh:
-LSFDE3:
- .set L$set$6,LEFDE3-LASFDE3 /* FDE Length */
- .long L$set$6
-LASFDE3:
- .long LASFDE3-EH_frame1 /* FDE CIE offset */
- .quad LUW5-. /* FDE initial location */
- .set L$set$7,LUW9-LUW5 /* FDE address range */
- .quad L$set$7
- .byte 0x0 /* Augmentation size */
-
- .byte 0x4 /* DW_CFA_advance_loc4 */
- .set L$set$8,LUW6-LUW5
- .long L$set$8
- .byte 0xe /* DW_CFA_def_cfa_offset */
- .byte 208,1 /* uleb128 208 */
- .byte 0xa /* DW_CFA_remember_state */
-
- .byte 0x4 /* DW_CFA_advance_loc4 */
- .set L$set$9,LUW7-LUW6
- .long L$set$9
- .byte 0xe /* DW_CFA_def_cfa_offset */
- .byte 0x8
-
- .byte 0x4 /* DW_CFA_advance_loc4 */
- .set L$set$10,LUW8-LUW7
- .long L$set$10
- .byte 0xb /* DW_CFA_restore_state */
-
- .align 3
-LEFDE3:
- .subsections_via_symbols
-
-#endif /* __x86_64__ */
diff --git a/Modules/_ctypes/libffi/src/x86/ffi.c b/Modules/_ctypes/libffi/src/x86/ffi.c
deleted file mode 100644
index dbf9c8e326..0000000000
--- a/Modules/_ctypes/libffi/src/x86/ffi.c
+++ /dev/null
@@ -1,867 +0,0 @@
-/* -----------------------------------------------------------------------
- ffi.c - Copyright (c) 1996, 1998, 1999, 2001, 2007, 2008 Red Hat, Inc.
- Copyright (c) 2002 Ranjit Mathew
- Copyright (c) 2002 Bo Thorsen
- Copyright (c) 2002 Roger Sayle
- Copyright (C) 2008, 2010 Free Software Foundation, Inc.
-
- x86 Foreign Function Interface
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- ``Software''), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to
- permit persons to whom the Software is furnished to do so, subject to
- the following conditions:
-
- The above copyright notice and this permission notice shall be included
- in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- DEALINGS IN THE SOFTWARE.
- ----------------------------------------------------------------------- */
-
-#if !defined(__x86_64__) || defined(_WIN64)
-
-#ifdef _WIN64
-#include <windows.h>
-#endif
-
-#include <ffi.h>
-#include <ffi_common.h>
-
-#include <stdlib.h>
-
-
-/* ffi_prep_args is called by the assembly routine once stack space
- has been allocated for the function's arguments */
-
-void ffi_prep_args(char *stack, extended_cif *ecif);
-void ffi_prep_args(char *stack, extended_cif *ecif)
-{
- register unsigned int i;
- register void **p_argv;
- register char *argp;
- register ffi_type **p_arg;
-#ifndef X86_WIN64
- size_t p_stack_args[2];
- void *p_stack_data[2];
- char *argp2 = stack;
- int stack_args_count = 0;
- int cabi = ecif->cif->abi;
-#endif
-
- argp = stack;
-
- if ((ecif->cif->flags == FFI_TYPE_STRUCT
- || ecif->cif->flags == FFI_TYPE_MS_STRUCT)
-#ifdef X86_WIN64
- && (ecif->cif->rtype->size != 1 && ecif->cif->rtype->size != 2
- && ecif->cif->rtype->size != 4 && ecif->cif->rtype->size != 8)
-#endif
- )
- {
- *(void **) argp = ecif->rvalue;
-#ifndef X86_WIN64
- /* For fastcall/thiscall this is first register-passed
- argument. */
- if (cabi == FFI_THISCALL || cabi == FFI_FASTCALL)
- {
- p_stack_args[stack_args_count] = sizeof (void*);
- p_stack_data[stack_args_count] = argp;
- ++stack_args_count;
- }
-#endif
- argp += sizeof(void*);
- }
-
- p_argv = ecif->avalue;
-
- for (i = ecif->cif->nargs, p_arg = ecif->cif->arg_types;
- i != 0;
- i--, p_arg++)
- {
- size_t z;
-
- /* Align if necessary */
- if ((sizeof(void*) - 1) & (size_t) argp)
- argp = (char *) ALIGN(argp, sizeof(void*));
-
- z = (*p_arg)->size;
-#ifdef X86_WIN64
- if (z > sizeof(ffi_arg)
- || ((*p_arg)->type == FFI_TYPE_STRUCT
- && (z != 1 && z != 2 && z != 4 && z != 8))
-#if FFI_TYPE_DOUBLE != FFI_TYPE_LONGDOUBLE
- || ((*p_arg)->type == FFI_TYPE_LONGDOUBLE)
-#endif
- )
- {
- z = sizeof(ffi_arg);
- *(void **)argp = *p_argv;
- }
- else if ((*p_arg)->type == FFI_TYPE_FLOAT)
- {
- memcpy(argp, *p_argv, z);
- }
- else
-#endif
- if (z < sizeof(ffi_arg))
- {
- z = sizeof(ffi_arg);
- switch ((*p_arg)->type)
- {
- case FFI_TYPE_SINT8:
- *(ffi_sarg *) argp = (ffi_sarg)*(SINT8 *)(* p_argv);
- break;
-
- case FFI_TYPE_UINT8:
- *(ffi_arg *) argp = (ffi_arg)*(UINT8 *)(* p_argv);
- break;
-
- case FFI_TYPE_SINT16:
- *(ffi_sarg *) argp = (ffi_sarg)*(SINT16 *)(* p_argv);
- break;
-
- case FFI_TYPE_UINT16:
- *(ffi_arg *) argp = (ffi_arg)*(UINT16 *)(* p_argv);
- break;
-
- case FFI_TYPE_SINT32:
- *(ffi_sarg *) argp = (ffi_sarg)*(SINT32 *)(* p_argv);
- break;
-
- case FFI_TYPE_UINT32:
- *(ffi_arg *) argp = (ffi_arg)*(UINT32 *)(* p_argv);
- break;
-
- case FFI_TYPE_STRUCT:
- *(ffi_arg *) argp = *(ffi_arg *)(* p_argv);
- break;
-
- default:
- FFI_ASSERT(0);
- }
- }
- else
- {
- memcpy(argp, *p_argv, z);
- }
-
-#ifndef X86_WIN64
- /* For thiscall/fastcall convention register-passed arguments
- are the first two none-floating-point arguments with a size
- smaller or equal to sizeof (void*). */
- if ((cabi == FFI_THISCALL && stack_args_count < 1)
- || (cabi == FFI_FASTCALL && stack_args_count < 2))
- {
- if (z <= 4
- && ((*p_arg)->type != FFI_TYPE_FLOAT
- && (*p_arg)->type != FFI_TYPE_STRUCT))
- {
- p_stack_args[stack_args_count] = z;
- p_stack_data[stack_args_count] = argp;
- ++stack_args_count;
- }
- }
-#endif
- p_argv++;
-#ifdef X86_WIN64
- argp += (z + sizeof(void*) - 1) & ~(sizeof(void*) - 1);
-#else
- argp += z;
-#endif
- }
-
-#ifndef X86_WIN64
- /* We need to move the register-passed arguments for thiscall/fastcall
- on top of stack, so that those can be moved to registers ecx/edx by
- call-handler. */
- if (stack_args_count > 0)
- {
- size_t zz = (p_stack_args[0] + 3) & ~3;
- char *h;
-
- /* Move first argument to top-stack position. */
- if (p_stack_data[0] != argp2)
- {
- h = alloca (zz + 1);
- memcpy (h, p_stack_data[0], zz);
- memmove (argp2 + zz, argp2,
- (size_t) ((char *) p_stack_data[0] - (char*)argp2));
- memcpy (argp2, h, zz);
- }
-
- argp2 += zz;
- --stack_args_count;
- if (zz > 4)
- stack_args_count = 0;
-
- /* If we have a second argument, then move it on top
- after the first one. */
- if (stack_args_count > 0 && p_stack_data[1] != argp2)
- {
- zz = p_stack_args[1];
- zz = (zz + 3) & ~3;
- h = alloca (zz + 1);
- h = alloca (zz + 1);
- memcpy (h, p_stack_data[1], zz);
- memmove (argp2 + zz, argp2, (size_t) ((char*) p_stack_data[1] - (char*)argp2));
- memcpy (argp2, h, zz);
- }
- }
-#endif
- return;
-}
-
-/* Perform machine dependent cif processing */
-ffi_status ffi_prep_cif_machdep(ffi_cif *cif)
-{
- unsigned int i;
- ffi_type **ptr;
-
- /* Set the return type flag */
- switch (cif->rtype->type)
- {
- case FFI_TYPE_VOID:
- case FFI_TYPE_UINT8:
- case FFI_TYPE_UINT16:
- case FFI_TYPE_SINT8:
- case FFI_TYPE_SINT16:
-#ifdef X86_WIN64
- case FFI_TYPE_UINT32:
- case FFI_TYPE_SINT32:
-#endif
- case FFI_TYPE_SINT64:
- case FFI_TYPE_FLOAT:
- case FFI_TYPE_DOUBLE:
-#ifndef X86_WIN64
-#if FFI_TYPE_DOUBLE != FFI_TYPE_LONGDOUBLE
- case FFI_TYPE_LONGDOUBLE:
-#endif
-#endif
- cif->flags = (unsigned) cif->rtype->type;
- break;
-
- case FFI_TYPE_UINT64:
-#ifdef X86_WIN64
- case FFI_TYPE_POINTER:
-#endif
- cif->flags = FFI_TYPE_SINT64;
- break;
-
- case FFI_TYPE_STRUCT:
-#ifndef X86
- if (cif->rtype->size == 1)
- {
- cif->flags = FFI_TYPE_SMALL_STRUCT_1B; /* same as char size */
- }
- else if (cif->rtype->size == 2)
- {
- cif->flags = FFI_TYPE_SMALL_STRUCT_2B; /* same as short size */
- }
- else if (cif->rtype->size == 4)
- {
-#ifdef X86_WIN64
- cif->flags = FFI_TYPE_SMALL_STRUCT_4B;
-#else
- cif->flags = FFI_TYPE_INT; /* same as int type */
-#endif
- }
- else if (cif->rtype->size == 8)
- {
- cif->flags = FFI_TYPE_SINT64; /* same as int64 type */
- }
- else
-#endif
- {
-#ifdef X86_WIN32
- if (cif->abi == FFI_MS_CDECL)
- cif->flags = FFI_TYPE_MS_STRUCT;
- else
-#endif
- cif->flags = FFI_TYPE_STRUCT;
- /* allocate space for return value pointer */
- cif->bytes += ALIGN(sizeof(void*), FFI_SIZEOF_ARG);
- }
- break;
-
- default:
-#ifdef X86_WIN64
- cif->flags = FFI_TYPE_SINT64;
- break;
- case FFI_TYPE_INT:
- cif->flags = FFI_TYPE_SINT32;
-#else
- cif->flags = FFI_TYPE_INT;
-#endif
- break;
- }
-
- for (ptr = cif->arg_types, i = cif->nargs; i > 0; i--, ptr++)
- {
- if (((*ptr)->alignment - 1) & cif->bytes)
- cif->bytes = ALIGN(cif->bytes, (*ptr)->alignment);
- cif->bytes += (unsigned)ALIGN((*ptr)->size, FFI_SIZEOF_ARG);
- }
-
-#ifdef X86_WIN64
- /* ensure space for storing four registers */
- cif->bytes += 4 * sizeof(ffi_arg);
-#endif
-
-#ifndef X86_WIN32
-#ifndef X86_WIN64
- if (cif->abi != FFI_STDCALL && cif->abi != FFI_THISCALL && cif->abi != FFI_FASTCALL)
-#endif
- cif->bytes = (cif->bytes + 15) & ~0xF;
-#endif
-
- return FFI_OK;
-}
-
-#ifdef X86_WIN64
-extern int
-ffi_call_win64(void (*)(char *, extended_cif *), extended_cif *,
- unsigned, unsigned, unsigned *, void (*fn)(void));
-#elif defined(X86_WIN32)
-extern void
-ffi_call_win32(void (*)(char *, extended_cif *), extended_cif *,
- unsigned, unsigned, unsigned, unsigned *, void (*fn)(void));
-#else
-extern void ffi_call_SYSV(void (*)(char *, extended_cif *), extended_cif *,
- unsigned, unsigned, unsigned *, void (*fn)(void));
-#endif
-
-void ffi_call(ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue)
-{
- extended_cif ecif;
-
- ecif.cif = cif;
- ecif.avalue = avalue;
-
- /* If the return value is a struct and we don't have a return */
- /* value address then we need to make one */
-
-#ifdef X86_WIN64
- if (rvalue == NULL
- && cif->flags == FFI_TYPE_STRUCT
- && cif->rtype->size != 1 && cif->rtype->size != 2
- && cif->rtype->size != 4 && cif->rtype->size != 8)
- {
- ecif.rvalue = alloca((cif->rtype->size + 0xF) & ~0xF);
- }
-#else
- if (rvalue == NULL
- && (cif->flags == FFI_TYPE_STRUCT
- || cif->flags == FFI_TYPE_MS_STRUCT))
- {
- ecif.rvalue = alloca(cif->rtype->size);
- }
-#endif
- else
- ecif.rvalue = rvalue;
-
-
- switch (cif->abi)
- {
-#ifdef X86_WIN64
- case FFI_WIN64:
- ffi_call_win64(ffi_prep_args, &ecif, cif->bytes,
- cif->flags, ecif.rvalue, fn);
- break;
-#elif defined(X86_WIN32)
- case FFI_SYSV:
- case FFI_MS_CDECL:
- case FFI_STDCALL:
- ffi_call_win32(ffi_prep_args, &ecif, cif->abi, cif->bytes, cif->flags,
- ecif.rvalue, fn);
- break;
- case FFI_THISCALL:
- case FFI_FASTCALL:
- {
- unsigned int abi = cif->abi;
- unsigned int i, passed_regs = 0;
-
- if (cif->flags == FFI_TYPE_STRUCT)
- ++passed_regs;
-
- for (i=0; i < cif->nargs && passed_regs < 2;i++)
- {
- size_t sz;
-
- if (cif->arg_types[i]->type == FFI_TYPE_FLOAT
- || cif->arg_types[i]->type == FFI_TYPE_STRUCT)
- continue;
- sz = (cif->arg_types[i]->size + 3) & ~3;
- if (sz == 0 || sz > 4)
- continue;
- ++passed_regs;
- }
- if (passed_regs < 2 && abi == FFI_FASTCALL)
- abi = FFI_THISCALL;
- if (passed_regs < 1 && abi == FFI_THISCALL)
- abi = FFI_STDCALL;
- ffi_call_win32(ffi_prep_args, &ecif, abi, cif->bytes, cif->flags,
- ecif.rvalue, fn);
- }
- break;
-#else
- case FFI_SYSV:
- ffi_call_SYSV(ffi_prep_args, &ecif, cif->bytes, cif->flags, ecif.rvalue,
- fn);
- break;
-#endif
- default:
- FFI_ASSERT(0);
- break;
- }
-}
-
-
-/** private members **/
-
-/* The following __attribute__((regparm(1))) decorations will have no effect
- on MSVC or SUNPRO_C -- standard conventions apply. */
-static void ffi_prep_incoming_args_SYSV (char *stack, void **ret,
- void** args, ffi_cif* cif);
-void FFI_HIDDEN ffi_closure_SYSV (ffi_closure *)
- __attribute__ ((regparm(1)));
-unsigned int FFI_HIDDEN ffi_closure_SYSV_inner (ffi_closure *, void **, void *)
- __attribute__ ((regparm(1)));
-void FFI_HIDDEN ffi_closure_raw_SYSV (ffi_raw_closure *)
- __attribute__ ((regparm(1)));
-#ifdef X86_WIN32
-void FFI_HIDDEN ffi_closure_raw_THISCALL (ffi_raw_closure *)
- __attribute__ ((regparm(1)));
-#endif
-#ifndef X86_WIN64
-void FFI_HIDDEN ffi_closure_STDCALL (ffi_closure *)
- __attribute__ ((regparm(1)));
-void FFI_HIDDEN ffi_closure_THISCALL (ffi_closure *)
- __attribute__ ((regparm(1)));
-void FFI_HIDDEN ffi_closure_FASTCALL (ffi_closure *)
- __attribute__ ((regparm(1)));
-#else
-void FFI_HIDDEN ffi_closure_win64 (ffi_closure *);
-#endif
-
-/* This function is jumped to by the trampoline */
-
-#ifdef X86_WIN64
-void * FFI_HIDDEN
-ffi_closure_win64_inner (ffi_closure *closure, void *args) {
- ffi_cif *cif;
- void **arg_area;
- void *result;
- void *resp = &result;
-
- cif = closure->cif;
- arg_area = (void**) alloca (cif->nargs * sizeof (void*));
-
- /* this call will initialize ARG_AREA, such that each
- * element in that array points to the corresponding
- * value on the stack; and if the function returns
- * a structure, it will change RESP to point to the
- * structure return address. */
-
- ffi_prep_incoming_args_SYSV(args, &resp, arg_area, cif);
-
- (closure->fun) (cif, resp, arg_area, closure->user_data);
-
- /* The result is returned in rax. This does the right thing for
- result types except for floats; we have to 'mov xmm0, rax' in the
- caller to correct this.
- TODO: structure sizes of 3 5 6 7 are returned by reference, too!!!
- */
- return cif->rtype->size > sizeof(void *) ? resp : *(void **)resp;
-}
-
-#else
-unsigned int FFI_HIDDEN __attribute__ ((regparm(1)))
-ffi_closure_SYSV_inner (ffi_closure *closure, void **respp, void *args)
-{
- /* our various things... */
- ffi_cif *cif;
- void **arg_area;
-
- cif = closure->cif;
- arg_area = (void**) alloca (cif->nargs * sizeof (void*));
-
- /* this call will initialize ARG_AREA, such that each
- * element in that array points to the corresponding
- * value on the stack; and if the function returns
- * a structure, it will change RESP to point to the
- * structure return address. */
-
- ffi_prep_incoming_args_SYSV(args, respp, arg_area, cif);
-
- (closure->fun) (cif, *respp, arg_area, closure->user_data);
-
- return cif->flags;
-}
-#endif /* !X86_WIN64 */
-
-static void
-ffi_prep_incoming_args_SYSV(char *stack, void **rvalue, void **avalue,
- ffi_cif *cif)
-{
- register unsigned int i;
- register void **p_argv;
- register char *argp;
- register ffi_type **p_arg;
-
- argp = stack;
-
-#ifdef X86_WIN64
- if (cif->rtype->size > sizeof(ffi_arg)
- || (cif->flags == FFI_TYPE_STRUCT
- && (cif->rtype->size != 1 && cif->rtype->size != 2
- && cif->rtype->size != 4 && cif->rtype->size != 8))) {
- *rvalue = *(void **) argp;
- argp += sizeof(void *);
- }
-#else
- if ( cif->flags == FFI_TYPE_STRUCT
- || cif->flags == FFI_TYPE_MS_STRUCT ) {
- *rvalue = *(void **) argp;
- argp += sizeof(void *);
- }
-#endif
-
- p_argv = avalue;
-
- for (i = cif->nargs, p_arg = cif->arg_types; (i != 0); i--, p_arg++)
- {
- size_t z;
-
- /* Align if necessary */
- if ((sizeof(void*) - 1) & (size_t) argp) {
- argp = (char *) ALIGN(argp, sizeof(void*));
- }
-
-#ifdef X86_WIN64
- if ((*p_arg)->size > sizeof(ffi_arg)
- || ((*p_arg)->type == FFI_TYPE_STRUCT
- && ((*p_arg)->size != 1 && (*p_arg)->size != 2
- && (*p_arg)->size != 4 && (*p_arg)->size != 8)))
- {
- z = sizeof(void *);
- *p_argv = *(void **)argp;
- }
- else
-#endif
- {
- z = (*p_arg)->size;
-
- /* because we're little endian, this is what it turns into. */
-
- *p_argv = (void*) argp;
- }
-
- p_argv++;
-#ifdef X86_WIN64
- argp += (z + sizeof(void*) - 1) & ~(sizeof(void*) - 1);
-#else
- argp += z;
-#endif
- }
-
- return;
-}
-
-#define FFI_INIT_TRAMPOLINE_WIN64(TRAMP,FUN,CTX,MASK) \
-{ unsigned char *__tramp = (unsigned char*)(TRAMP); \
- void* __fun = (void*)(FUN); \
- void* __ctx = (void*)(CTX); \
- *(unsigned char*) &__tramp[0] = 0x41; \
- *(unsigned char*) &__tramp[1] = 0xbb; \
- *(unsigned int*) &__tramp[2] = MASK; /* mov $mask, %r11 */ \
- *(unsigned char*) &__tramp[6] = 0x48; \
- *(unsigned char*) &__tramp[7] = 0xb8; \
- *(void**) &__tramp[8] = __ctx; /* mov __ctx, %rax */ \
- *(unsigned char *) &__tramp[16] = 0x49; \
- *(unsigned char *) &__tramp[17] = 0xba; \
- *(void**) &__tramp[18] = __fun; /* mov __fun, %r10 */ \
- *(unsigned char *) &__tramp[26] = 0x41; \
- *(unsigned char *) &__tramp[27] = 0xff; \
- *(unsigned char *) &__tramp[28] = 0xe2; /* jmp %r10 */ \
- }
-
-/* How to make a trampoline. Derived from gcc/config/i386/i386.c. */
-
-#define FFI_INIT_TRAMPOLINE(TRAMP,FUN,CTX) \
-{ unsigned char *__tramp = (unsigned char*)(TRAMP); \
- unsigned int __fun = (unsigned int)(FUN); \
- unsigned int __ctx = (unsigned int)(CTX); \
- unsigned int __dis = __fun - (__ctx + 10); \
- *(unsigned char*) &__tramp[0] = 0xb8; \
- *(unsigned int*) &__tramp[1] = __ctx; /* movl __ctx, %eax */ \
- *(unsigned char *) &__tramp[5] = 0xe9; \
- *(unsigned int*) &__tramp[6] = __dis; /* jmp __fun */ \
- }
-
-#define FFI_INIT_TRAMPOLINE_RAW_THISCALL(TRAMP,FUN,CTX,SIZE) \
-{ unsigned char *__tramp = (unsigned char*)(TRAMP); \
- unsigned int __fun = (unsigned int)(FUN); \
- unsigned int __ctx = (unsigned int)(CTX); \
- unsigned int __dis = __fun - (__ctx + 49); \
- unsigned short __size = (unsigned short)(SIZE); \
- *(unsigned int *) &__tramp[0] = 0x8324048b; /* mov (%esp), %eax */ \
- *(unsigned int *) &__tramp[4] = 0x4c890cec; /* sub $12, %esp */ \
- *(unsigned int *) &__tramp[8] = 0x04890424; /* mov %ecx, 4(%esp) */ \
- *(unsigned char*) &__tramp[12] = 0x24; /* mov %eax, (%esp) */ \
- *(unsigned char*) &__tramp[13] = 0xb8; \
- *(unsigned int *) &__tramp[14] = __size; /* mov __size, %eax */ \
- *(unsigned int *) &__tramp[18] = 0x08244c8d; /* lea 8(%esp), %ecx */ \
- *(unsigned int *) &__tramp[22] = 0x4802e8c1; /* shr $2, %eax ; dec %eax */ \
- *(unsigned short*) &__tramp[26] = 0x0b74; /* jz 1f */ \
- *(unsigned int *) &__tramp[28] = 0x8908518b; /* 2b: mov 8(%ecx), %edx */ \
- *(unsigned int *) &__tramp[32] = 0x04c18311; /* mov %edx, (%ecx) ; add $4, %ecx */ \
- *(unsigned char*) &__tramp[36] = 0x48; /* dec %eax */ \
- *(unsigned short*) &__tramp[37] = 0xf575; /* jnz 2b ; 1f: */ \
- *(unsigned char*) &__tramp[39] = 0xb8; \
- *(unsigned int*) &__tramp[40] = __ctx; /* movl __ctx, %eax */ \
- *(unsigned char *) &__tramp[44] = 0xe8; \
- *(unsigned int*) &__tramp[45] = __dis; /* call __fun */ \
- *(unsigned char*) &__tramp[49] = 0xc2; /* ret */ \
- *(unsigned short*) &__tramp[50] = (__size + 8); /* ret (__size + 8) */ \
- }
-
-#define FFI_INIT_TRAMPOLINE_STDCALL(TRAMP,FUN,CTX) \
-{ unsigned char *__tramp = (unsigned char*)(TRAMP); \
- unsigned int __fun = (unsigned int)(FUN); \
- unsigned int __ctx = (unsigned int)(CTX); \
- unsigned int __dis = __fun - (__ctx + 10); \
- *(unsigned char*) &__tramp[0] = 0xb8; \
- *(unsigned int*) &__tramp[1] = __ctx; /* movl __ctx, %eax */ \
- *(unsigned char *) &__tramp[5] = 0xe8; \
- *(unsigned int*) &__tramp[6] = __dis; /* call __fun */ \
- }
-
-/* the cif must already be prep'ed */
-
-ffi_status
-ffi_prep_closure_loc (ffi_closure* closure,
- ffi_cif* cif,
- void (*fun)(ffi_cif*,void*,void**,void*),
- void *user_data,
- void *codeloc)
-{
-#ifdef X86_WIN64
-#define ISFLOAT(IDX) (cif->arg_types[IDX]->type == FFI_TYPE_FLOAT || cif->arg_types[IDX]->type == FFI_TYPE_DOUBLE)
-#define FLAG(IDX) (cif->nargs>(IDX)&&ISFLOAT(IDX)?(1<<(IDX)):0)
- if (cif->abi == FFI_WIN64)
- {
- int mask = FLAG(0)|FLAG(1)|FLAG(2)|FLAG(3);
- FFI_INIT_TRAMPOLINE_WIN64 (&closure->tramp[0],
- &ffi_closure_win64,
- codeloc, mask);
- /* make sure we can execute here */
- }
-#else
- if (cif->abi == FFI_SYSV)
- {
- FFI_INIT_TRAMPOLINE (&closure->tramp[0],
- &ffi_closure_SYSV,
- (void*)codeloc);
- }
- else if (cif->abi == FFI_FASTCALL)
- {
- FFI_INIT_TRAMPOLINE_STDCALL (&closure->tramp[0],
- &ffi_closure_FASTCALL,
- (void*)codeloc);
- }
- else if (cif->abi == FFI_THISCALL)
- {
- FFI_INIT_TRAMPOLINE_STDCALL (&closure->tramp[0],
- &ffi_closure_THISCALL,
- (void*)codeloc);
- }
- else if (cif->abi == FFI_STDCALL)
- {
- FFI_INIT_TRAMPOLINE_STDCALL (&closure->tramp[0],
- &ffi_closure_STDCALL,
- (void*)codeloc);
- }
-#ifdef X86_WIN32
- else if (cif->abi == FFI_MS_CDECL)
- {
- FFI_INIT_TRAMPOLINE (&closure->tramp[0],
- &ffi_closure_SYSV,
- (void*)codeloc);
- }
-#endif /* X86_WIN32 */
-#endif /* !X86_WIN64 */
- else
- {
- return FFI_BAD_ABI;
- }
-
- closure->cif = cif;
- closure->user_data = user_data;
- closure->fun = fun;
-
- return FFI_OK;
-}
-
-/* ------- Native raw API support -------------------------------- */
-
-#if !FFI_NO_RAW_API
-
-ffi_status
-ffi_prep_raw_closure_loc (ffi_raw_closure* closure,
- ffi_cif* cif,
- void (*fun)(ffi_cif*,void*,ffi_raw*,void*),
- void *user_data,
- void *codeloc)
-{
- int i;
-
- if (cif->abi != FFI_SYSV
-#ifdef X86_WIN32
- && cif->abi != FFI_THISCALL
-#endif
- )
- return FFI_BAD_ABI;
-
- /* we currently don't support certain kinds of arguments for raw
- closures. This should be implemented by a separate assembly
- language routine, since it would require argument processing,
- something we don't do now for performance. */
-
- for (i = cif->nargs-1; i >= 0; i--)
- {
- FFI_ASSERT (cif->arg_types[i]->type != FFI_TYPE_STRUCT);
- FFI_ASSERT (cif->arg_types[i]->type != FFI_TYPE_LONGDOUBLE);
- }
-
-#ifdef X86_WIN32
- if (cif->abi == FFI_SYSV)
- {
-#endif
- FFI_INIT_TRAMPOLINE (&closure->tramp[0], &ffi_closure_raw_SYSV,
- codeloc);
-#ifdef X86_WIN32
- }
- else if (cif->abi == FFI_THISCALL)
- {
- FFI_INIT_TRAMPOLINE_RAW_THISCALL (&closure->tramp[0], &ffi_closure_raw_THISCALL, codeloc, cif->bytes);
- }
-#endif
- closure->cif = cif;
- closure->user_data = user_data;
- closure->fun = fun;
-
- return FFI_OK;
-}
-
-static void
-ffi_prep_args_raw(char *stack, extended_cif *ecif)
-{
- memcpy (stack, ecif->avalue, ecif->cif->bytes);
-}
-
-/* we borrow this routine from libffi (it must be changed, though, to
- * actually call the function passed in the first argument. as of
- * libffi-1.20, this is not the case.)
- */
-
-void
-ffi_raw_call(ffi_cif *cif, void (*fn)(void), void *rvalue, ffi_raw *fake_avalue)
-{
- extended_cif ecif;
- void **avalue = (void **)fake_avalue;
-
- ecif.cif = cif;
- ecif.avalue = avalue;
-
- /* If the return value is a struct and we don't have a return */
- /* value address then we need to make one */
-
-#ifdef X86_WIN64
- if (rvalue == NULL
- && cif->flags == FFI_TYPE_STRUCT
- && cif->rtype->size != 1 && cif->rtype->size != 2
- && cif->rtype->size != 4 && cif->rtype->size != 8)
- {
- ecif.rvalue = alloca((cif->rtype->size + 0xF) & ~0xF);
- }
-#else
- if (rvalue == NULL
- && (cif->flags == FFI_TYPE_STRUCT
- || cif->flags == FFI_TYPE_MS_STRUCT))
- {
- ecif.rvalue = alloca(cif->rtype->size);
- }
-#endif
- else
- ecif.rvalue = rvalue;
-
-
- switch (cif->abi)
- {
-#ifdef X86_WIN64
- case FFI_WIN64:
- ffi_call_win64(ffi_prep_args_raw, &ecif, cif->bytes,
- cif->flags, ecif.rvalue, fn);
- break;
-#elif defined(X86_WIN32)
- case FFI_SYSV:
- case FFI_MS_CDECL:
- case FFI_STDCALL:
- ffi_call_win32(ffi_prep_args_raw, &ecif, cif->abi, cif->bytes, cif->flags,
- ecif.rvalue, fn);
- break;
- case FFI_THISCALL:
- case FFI_FASTCALL:
- {
- unsigned int abi = cif->abi;
- unsigned int i, passed_regs = 0;
-
- if (cif->flags == FFI_TYPE_STRUCT)
- ++passed_regs;
-
- for (i=0; i < cif->nargs && passed_regs < 2;i++)
- {
- size_t sz;
-
- if (cif->arg_types[i]->type == FFI_TYPE_FLOAT
- || cif->arg_types[i]->type == FFI_TYPE_STRUCT)
- continue;
- sz = (cif->arg_types[i]->size + 3) & ~3;
- if (sz == 0 || sz > 4)
- continue;
- ++passed_regs;
- }
- if (passed_regs < 2 && abi == FFI_FASTCALL)
- abi = FFI_THISCALL;
- if (passed_regs < 1 && abi == FFI_THISCALL)
- abi = FFI_STDCALL;
- ffi_call_win32(ffi_prep_args_raw, &ecif, abi, cif->bytes, cif->flags,
- ecif.rvalue, fn);
- }
- break;
-#else
- case FFI_SYSV:
- ffi_call_SYSV(ffi_prep_args_raw, &ecif, cif->bytes, cif->flags, ecif.rvalue,
- fn);
- break;
-#endif
- default:
- FFI_ASSERT(0);
- break;
- }
-}
-
-#endif
-
-#endif /* !__x86_64__ || X86_WIN64 */
-
diff --git a/Modules/_ctypes/libffi/src/x86/ffi64.c b/Modules/_ctypes/libffi/src/x86/ffi64.c
deleted file mode 100644
index 5a5e043835..0000000000
--- a/Modules/_ctypes/libffi/src/x86/ffi64.c
+++ /dev/null
@@ -1,676 +0,0 @@
-/* -----------------------------------------------------------------------
- ffi64.c - Copyright (c) 2013 The Written Word, Inc.
- Copyright (c) 2011 Anthony Green
- Copyright (c) 2008, 2010 Red Hat, Inc.
- Copyright (c) 2002, 2007 Bo Thorsen <bo@suse.de>
-
- x86-64 Foreign Function Interface
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- ``Software''), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to
- permit persons to whom the Software is furnished to do so, subject to
- the following conditions:
-
- The above copyright notice and this permission notice shall be included
- in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- DEALINGS IN THE SOFTWARE.
- ----------------------------------------------------------------------- */
-
-#include <ffi.h>
-#include <ffi_common.h>
-
-#include <stdlib.h>
-#include <stdarg.h>
-
-#ifdef __x86_64__
-
-#define MAX_GPR_REGS 6
-#define MAX_SSE_REGS 8
-
-#if defined(__INTEL_COMPILER)
-#include "xmmintrin.h"
-#define UINT128 __m128
-#else
-#if defined(__SUNPRO_C)
-#include <sunmedia_types.h>
-#define UINT128 __m128i
-#else
-#define UINT128 __int128_t
-#endif
-#endif
-
-union big_int_union
-{
- UINT32 i32;
- UINT64 i64;
- UINT128 i128;
-};
-
-struct register_args
-{
- /* Registers for argument passing. */
- UINT64 gpr[MAX_GPR_REGS];
- union big_int_union sse[MAX_SSE_REGS];
-};
-
-extern void ffi_call_unix64 (void *args, unsigned long bytes, unsigned flags,
- void *raddr, void (*fnaddr)(void), unsigned ssecount);
-
-/* All reference to register classes here is identical to the code in
- gcc/config/i386/i386.c. Do *not* change one without the other. */
-
-/* Register class used for passing given 64bit part of the argument.
- These represent classes as documented by the PS ABI, with the
- exception of SSESF, SSEDF classes, that are basically SSE class,
- just gcc will use SF or DFmode move instead of DImode to avoid
- reformatting penalties.
-
- Similary we play games with INTEGERSI_CLASS to use cheaper SImode moves
- whenever possible (upper half does contain padding). */
-enum x86_64_reg_class
- {
- X86_64_NO_CLASS,
- X86_64_INTEGER_CLASS,
- X86_64_INTEGERSI_CLASS,
- X86_64_SSE_CLASS,
- X86_64_SSESF_CLASS,
- X86_64_SSEDF_CLASS,
- X86_64_SSEUP_CLASS,
- X86_64_X87_CLASS,
- X86_64_X87UP_CLASS,
- X86_64_COMPLEX_X87_CLASS,
- X86_64_MEMORY_CLASS
- };
-
-#define MAX_CLASSES 4
-
-#define SSE_CLASS_P(X) ((X) >= X86_64_SSE_CLASS && X <= X86_64_SSEUP_CLASS)
-
-/* x86-64 register passing implementation. See x86-64 ABI for details. Goal
- of this code is to classify each 8bytes of incoming argument by the register
- class and assign registers accordingly. */
-
-/* Return the union class of CLASS1 and CLASS2.
- See the x86-64 PS ABI for details. */
-
-static enum x86_64_reg_class
-merge_classes (enum x86_64_reg_class class1, enum x86_64_reg_class class2)
-{
- /* Rule #1: If both classes are equal, this is the resulting class. */
- if (class1 == class2)
- return class1;
-
- /* Rule #2: If one of the classes is NO_CLASS, the resulting class is
- the other class. */
- if (class1 == X86_64_NO_CLASS)
- return class2;
- if (class2 == X86_64_NO_CLASS)
- return class1;
-
- /* Rule #3: If one of the classes is MEMORY, the result is MEMORY. */
- if (class1 == X86_64_MEMORY_CLASS || class2 == X86_64_MEMORY_CLASS)
- return X86_64_MEMORY_CLASS;
-
- /* Rule #4: If one of the classes is INTEGER, the result is INTEGER. */
- if ((class1 == X86_64_INTEGERSI_CLASS && class2 == X86_64_SSESF_CLASS)
- || (class2 == X86_64_INTEGERSI_CLASS && class1 == X86_64_SSESF_CLASS))
- return X86_64_INTEGERSI_CLASS;
- if (class1 == X86_64_INTEGER_CLASS || class1 == X86_64_INTEGERSI_CLASS
- || class2 == X86_64_INTEGER_CLASS || class2 == X86_64_INTEGERSI_CLASS)
- return X86_64_INTEGER_CLASS;
-
- /* Rule #5: If one of the classes is X87, X87UP, or COMPLEX_X87 class,
- MEMORY is used. */
- if (class1 == X86_64_X87_CLASS
- || class1 == X86_64_X87UP_CLASS
- || class1 == X86_64_COMPLEX_X87_CLASS
- || class2 == X86_64_X87_CLASS
- || class2 == X86_64_X87UP_CLASS
- || class2 == X86_64_COMPLEX_X87_CLASS)
- return X86_64_MEMORY_CLASS;
-
- /* Rule #6: Otherwise class SSE is used. */
- return X86_64_SSE_CLASS;
-}
-
-/* Classify the argument of type TYPE and mode MODE.
- CLASSES will be filled by the register class used to pass each word
- of the operand. The number of words is returned. In case the parameter
- should be passed in memory, 0 is returned. As a special case for zero
- sized containers, classes[0] will be NO_CLASS and 1 is returned.
-
- See the x86-64 PS ABI for details.
-*/
-static size_t
-classify_argument (ffi_type *type, enum x86_64_reg_class classes[],
- size_t byte_offset)
-{
- switch (type->type)
- {
- case FFI_TYPE_UINT8:
- case FFI_TYPE_SINT8:
- case FFI_TYPE_UINT16:
- case FFI_TYPE_SINT16:
- case FFI_TYPE_UINT32:
- case FFI_TYPE_SINT32:
- case FFI_TYPE_UINT64:
- case FFI_TYPE_SINT64:
- case FFI_TYPE_POINTER:
- {
- size_t size = byte_offset + type->size;
-
- if (size <= 4)
- {
- classes[0] = X86_64_INTEGERSI_CLASS;
- return 1;
- }
- else if (size <= 8)
- {
- classes[0] = X86_64_INTEGER_CLASS;
- return 1;
- }
- else if (size <= 12)
- {
- classes[0] = X86_64_INTEGER_CLASS;
- classes[1] = X86_64_INTEGERSI_CLASS;
- return 2;
- }
- else if (size <= 16)
- {
- classes[0] = classes[1] = X86_64_INTEGERSI_CLASS;
- return 2;
- }
- else
- FFI_ASSERT (0);
- }
- case FFI_TYPE_FLOAT:
- if (!(byte_offset % 8))
- classes[0] = X86_64_SSESF_CLASS;
- else
- classes[0] = X86_64_SSE_CLASS;
- return 1;
- case FFI_TYPE_DOUBLE:
- classes[0] = X86_64_SSEDF_CLASS;
- return 1;
-#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE
- case FFI_TYPE_LONGDOUBLE:
- classes[0] = X86_64_X87_CLASS;
- classes[1] = X86_64_X87UP_CLASS;
- return 2;
-#endif
- case FFI_TYPE_STRUCT:
- {
- const size_t UNITS_PER_WORD = 8;
- size_t words = (type->size + UNITS_PER_WORD - 1) / UNITS_PER_WORD;
- ffi_type **ptr;
- int i;
- enum x86_64_reg_class subclasses[MAX_CLASSES];
-
- /* If the struct is larger than 32 bytes, pass it on the stack. */
- if (type->size > 32)
- return 0;
-
- for (i = 0; i < words; i++)
- classes[i] = X86_64_NO_CLASS;
-
- /* Zero sized arrays or structures are NO_CLASS. We return 0 to
- signalize memory class, so handle it as special case. */
- if (!words)
- {
- classes[0] = X86_64_NO_CLASS;
- return 1;
- }
-
- /* Merge the fields of structure. */
- for (ptr = type->elements; *ptr != NULL; ptr++)
- {
- size_t num;
-
- byte_offset = ALIGN (byte_offset, (*ptr)->alignment);
-
- num = classify_argument (*ptr, subclasses, byte_offset % 8);
- if (num == 0)
- return 0;
- for (i = 0; i < num; i++)
- {
- size_t pos = byte_offset / 8;
- classes[i + pos] =
- merge_classes (subclasses[i], classes[i + pos]);
- }
-
- byte_offset += (*ptr)->size;
- }
-
- if (words > 2)
- {
- /* When size > 16 bytes, if the first one isn't
- X86_64_SSE_CLASS or any other ones aren't
- X86_64_SSEUP_CLASS, everything should be passed in
- memory. */
- if (classes[0] != X86_64_SSE_CLASS)
- return 0;
-
- for (i = 1; i < words; i++)
- if (classes[i] != X86_64_SSEUP_CLASS)
- return 0;
- }
-
- /* Final merger cleanup. */
- for (i = 0; i < words; i++)
- {
- /* If one class is MEMORY, everything should be passed in
- memory. */
- if (classes[i] == X86_64_MEMORY_CLASS)
- return 0;
-
- /* The X86_64_SSEUP_CLASS should be always preceded by
- X86_64_SSE_CLASS or X86_64_SSEUP_CLASS. */
- if (classes[i] == X86_64_SSEUP_CLASS
- && classes[i - 1] != X86_64_SSE_CLASS
- && classes[i - 1] != X86_64_SSEUP_CLASS)
- {
- /* The first one should never be X86_64_SSEUP_CLASS. */
- FFI_ASSERT (i != 0);
- classes[i] = X86_64_SSE_CLASS;
- }
-
- /* If X86_64_X87UP_CLASS isn't preceded by X86_64_X87_CLASS,
- everything should be passed in memory. */
- if (classes[i] == X86_64_X87UP_CLASS
- && (classes[i - 1] != X86_64_X87_CLASS))
- {
- /* The first one should never be X86_64_X87UP_CLASS. */
- FFI_ASSERT (i != 0);
- return 0;
- }
- }
- return words;
- }
-
- default:
- FFI_ASSERT(0);
- }
- return 0; /* Never reached. */
-}
-
-/* Examine the argument and return set number of register required in each
- class. Return zero iff parameter should be passed in memory, otherwise
- the number of registers. */
-
-static size_t
-examine_argument (ffi_type *type, enum x86_64_reg_class classes[MAX_CLASSES],
- _Bool in_return, int *pngpr, int *pnsse)
-{
- size_t n;
- int i, ngpr, nsse;
-
- n = classify_argument (type, classes, 0);
- if (n == 0)
- return 0;
-
- ngpr = nsse = 0;
- for (i = 0; i < n; ++i)
- switch (classes[i])
- {
- case X86_64_INTEGER_CLASS:
- case X86_64_INTEGERSI_CLASS:
- ngpr++;
- break;
- case X86_64_SSE_CLASS:
- case X86_64_SSESF_CLASS:
- case X86_64_SSEDF_CLASS:
- nsse++;
- break;
- case X86_64_NO_CLASS:
- case X86_64_SSEUP_CLASS:
- break;
- case X86_64_X87_CLASS:
- case X86_64_X87UP_CLASS:
- case X86_64_COMPLEX_X87_CLASS:
- return in_return != 0;
- default:
- abort ();
- }
-
- *pngpr = ngpr;
- *pnsse = nsse;
-
- return n;
-}
-
-/* Perform machine dependent cif processing. */
-
-ffi_status
-ffi_prep_cif_machdep (ffi_cif *cif)
-{
- int gprcount, ssecount, i, avn, ngpr, nsse, flags;
- enum x86_64_reg_class classes[MAX_CLASSES];
- size_t bytes, n;
-
- gprcount = ssecount = 0;
-
- flags = cif->rtype->type;
- if (flags != FFI_TYPE_VOID)
- {
- n = examine_argument (cif->rtype, classes, 1, &ngpr, &nsse);
- if (n == 0)
- {
- /* The return value is passed in memory. A pointer to that
- memory is the first argument. Allocate a register for it. */
- gprcount++;
- /* We don't have to do anything in asm for the return. */
- flags = FFI_TYPE_VOID;
- }
- else if (flags == FFI_TYPE_STRUCT)
- {
- /* Mark which registers the result appears in. */
- _Bool sse0 = SSE_CLASS_P (classes[0]);
- _Bool sse1 = n == 2 && SSE_CLASS_P (classes[1]);
- if (sse0 && !sse1)
- flags |= 1 << 8;
- else if (!sse0 && sse1)
- flags |= 1 << 9;
- else if (sse0 && sse1)
- flags |= 1 << 10;
- /* Mark the true size of the structure. */
- flags |= cif->rtype->size << 12;
- }
- }
-
- /* Go over all arguments and determine the way they should be passed.
- If it's in a register and there is space for it, let that be so. If
- not, add it's size to the stack byte count. */
- for (bytes = 0, i = 0, avn = cif->nargs; i < avn; i++)
- {
- if (examine_argument (cif->arg_types[i], classes, 0, &ngpr, &nsse) == 0
- || gprcount + ngpr > MAX_GPR_REGS
- || ssecount + nsse > MAX_SSE_REGS)
- {
- long align = cif->arg_types[i]->alignment;
-
- if (align < 8)
- align = 8;
-
- bytes = ALIGN (bytes, align);
- bytes += cif->arg_types[i]->size;
- }
- else
- {
- gprcount += ngpr;
- ssecount += nsse;
- }
- }
- if (ssecount)
- flags |= 1 << 11;
- cif->flags = flags;
- cif->bytes = (unsigned)ALIGN (bytes, 8);
-
- return FFI_OK;
-}
-
-void
-ffi_call (ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue)
-{
- enum x86_64_reg_class classes[MAX_CLASSES];
- char *stack, *argp;
- ffi_type **arg_types;
- int gprcount, ssecount, ngpr, nsse, i, avn;
- _Bool ret_in_memory;
- struct register_args *reg_args;
-
- /* Can't call 32-bit mode from 64-bit mode. */
- FFI_ASSERT (cif->abi == FFI_UNIX64);
-
- /* If the return value is a struct and we don't have a return value
- address then we need to make one. Note the setting of flags to
- VOID above in ffi_prep_cif_machdep. */
- ret_in_memory = (cif->rtype->type == FFI_TYPE_STRUCT
- && (cif->flags & 0xff) == FFI_TYPE_VOID);
- if (rvalue == NULL && ret_in_memory)
- rvalue = alloca (cif->rtype->size);
-
- /* Allocate the space for the arguments, plus 4 words of temp space. */
- stack = alloca (sizeof (struct register_args) + cif->bytes + 4*8);
- reg_args = (struct register_args *) stack;
- argp = stack + sizeof (struct register_args);
-
- gprcount = ssecount = 0;
-
- /* If the return value is passed in memory, add the pointer as the
- first integer argument. */
- if (ret_in_memory)
- reg_args->gpr[gprcount++] = (unsigned long) rvalue;
-
- avn = cif->nargs;
- arg_types = cif->arg_types;
-
- for (i = 0; i < avn; ++i)
- {
- size_t n, size = arg_types[i]->size;
-
- n = examine_argument (arg_types[i], classes, 0, &ngpr, &nsse);
- if (n == 0
- || gprcount + ngpr > MAX_GPR_REGS
- || ssecount + nsse > MAX_SSE_REGS)
- {
- long align = arg_types[i]->alignment;
-
- /* Stack arguments are *always* at least 8 byte aligned. */
- if (align < 8)
- align = 8;
-
- /* Pass this argument in memory. */
- argp = (void *) ALIGN (argp, align);
- memcpy (argp, avalue[i], size);
- argp += size;
- }
- else
- {
- /* The argument is passed entirely in registers. */
- char *a = (char *) avalue[i];
- int j;
-
- for (j = 0; j < n; j++, a += 8, size -= 8)
- {
- switch (classes[j])
- {
- case X86_64_INTEGER_CLASS:
- case X86_64_INTEGERSI_CLASS:
- /* Sign-extend integer arguments passed in general
- purpose registers, to cope with the fact that
- LLVM incorrectly assumes that this will be done
- (the x86-64 PS ABI does not specify this). */
- switch (arg_types[i]->type)
- {
- case FFI_TYPE_SINT8:
- *(SINT64 *)&reg_args->gpr[gprcount] = (SINT64) *((SINT8 *) a);
- break;
- case FFI_TYPE_SINT16:
- *(SINT64 *)&reg_args->gpr[gprcount] = (SINT64) *((SINT16 *) a);
- break;
- case FFI_TYPE_SINT32:
- *(SINT64 *)&reg_args->gpr[gprcount] = (SINT64) *((SINT32 *) a);
- break;
- default:
- reg_args->gpr[gprcount] = 0;
- memcpy (&reg_args->gpr[gprcount], a, size < 8 ? size : 8);
- }
- gprcount++;
- break;
- case X86_64_SSE_CLASS:
- case X86_64_SSEDF_CLASS:
- reg_args->sse[ssecount++].i64 = *(UINT64 *) a;
- break;
- case X86_64_SSESF_CLASS:
- reg_args->sse[ssecount++].i32 = *(UINT32 *) a;
- break;
- default:
- abort();
- }
- }
- }
- }
-
- ffi_call_unix64 (stack, cif->bytes + sizeof (struct register_args),
- cif->flags, rvalue, fn, ssecount);
-}
-
-
-extern void ffi_closure_unix64(void);
-
-ffi_status
-ffi_prep_closure_loc (ffi_closure* closure,
- ffi_cif* cif,
- void (*fun)(ffi_cif*, void*, void**, void*),
- void *user_data,
- void *codeloc)
-{
- volatile unsigned short *tramp;
-
- /* Sanity check on the cif ABI. */
- {
- int abi = cif->abi;
- if (UNLIKELY (! (abi > FFI_FIRST_ABI && abi < FFI_LAST_ABI)))
- return FFI_BAD_ABI;
- }
-
- tramp = (volatile unsigned short *) &closure->tramp[0];
-
- tramp[0] = 0xbb49; /* mov <code>, %r11 */
- *((unsigned long long * volatile) &tramp[1])
- = (unsigned long) ffi_closure_unix64;
- tramp[5] = 0xba49; /* mov <data>, %r10 */
- *((unsigned long long * volatile) &tramp[6])
- = (unsigned long) codeloc;
-
- /* Set the carry bit iff the function uses any sse registers.
- This is clc or stc, together with the first byte of the jmp. */
- tramp[10] = cif->flags & (1 << 11) ? 0x49f9 : 0x49f8;
-
- tramp[11] = 0xe3ff; /* jmp *%r11 */
-
- closure->cif = cif;
- closure->fun = fun;
- closure->user_data = user_data;
-
- return FFI_OK;
-}
-
-int
-ffi_closure_unix64_inner(ffi_closure *closure, void *rvalue,
- struct register_args *reg_args, char *argp)
-{
- ffi_cif *cif;
- void **avalue;
- ffi_type **arg_types;
- long i, avn;
- int gprcount, ssecount, ngpr, nsse;
- int ret;
-
- cif = closure->cif;
- avalue = alloca(cif->nargs * sizeof(void *));
- gprcount = ssecount = 0;
-
- ret = cif->rtype->type;
- if (ret != FFI_TYPE_VOID)
- {
- enum x86_64_reg_class classes[MAX_CLASSES];
- size_t n = examine_argument (cif->rtype, classes, 1, &ngpr, &nsse);
- if (n == 0)
- {
- /* The return value goes in memory. Arrange for the closure
- return value to go directly back to the original caller. */
- rvalue = (void *) (unsigned long) reg_args->gpr[gprcount++];
- /* We don't have to do anything in asm for the return. */
- ret = FFI_TYPE_VOID;
- }
- else if (ret == FFI_TYPE_STRUCT && n == 2)
- {
- /* Mark which register the second word of the structure goes in. */
- _Bool sse0 = SSE_CLASS_P (classes[0]);
- _Bool sse1 = SSE_CLASS_P (classes[1]);
- if (!sse0 && sse1)
- ret |= 1 << 8;
- else if (sse0 && !sse1)
- ret |= 1 << 9;
- }
- }
-
- avn = cif->nargs;
- arg_types = cif->arg_types;
-
- for (i = 0; i < avn; ++i)
- {
- enum x86_64_reg_class classes[MAX_CLASSES];
- size_t n;
-
- n = examine_argument (arg_types[i], classes, 0, &ngpr, &nsse);
- if (n == 0
- || gprcount + ngpr > MAX_GPR_REGS
- || ssecount + nsse > MAX_SSE_REGS)
- {
- long align = arg_types[i]->alignment;
-
- /* Stack arguments are *always* at least 8 byte aligned. */
- if (align < 8)
- align = 8;
-
- /* Pass this argument in memory. */
- argp = (void *) ALIGN (argp, align);
- avalue[i] = argp;
- argp += arg_types[i]->size;
- }
- /* If the argument is in a single register, or two consecutive
- integer registers, then we can use that address directly. */
- else if (n == 1
- || (n == 2 && !(SSE_CLASS_P (classes[0])
- || SSE_CLASS_P (classes[1]))))
- {
- /* The argument is in a single register. */
- if (SSE_CLASS_P (classes[0]))
- {
- avalue[i] = &reg_args->sse[ssecount];
- ssecount += n;
- }
- else
- {
- avalue[i] = &reg_args->gpr[gprcount];
- gprcount += n;
- }
- }
- /* Otherwise, allocate space to make them consecutive. */
- else
- {
- char *a = alloca (16);
- int j;
-
- avalue[i] = a;
- for (j = 0; j < n; j++, a += 8)
- {
- if (SSE_CLASS_P (classes[j]))
- memcpy (a, &reg_args->sse[ssecount++], 8);
- else
- memcpy (a, &reg_args->gpr[gprcount++], 8);
- }
- }
- }
-
- /* Invoke the closure. */
- closure->fun (cif, rvalue, avalue, closure->user_data);
-
- /* Tell assembly how to perform return type promotions. */
- return ret;
-}
-
-#endif /* __x86_64__ */
diff --git a/Modules/_ctypes/libffi/src/x86/ffitarget.h b/Modules/_ctypes/libffi/src/x86/ffitarget.h
deleted file mode 100644
index b2afe91123..0000000000
--- a/Modules/_ctypes/libffi/src/x86/ffitarget.h
+++ /dev/null
@@ -1,143 +0,0 @@
-/* -----------------------------------------------------------------*-C-*-
- ffitarget.h - Copyright (c) 2012 Anthony Green
- Copyright (c) 1996-2003, 2010 Red Hat, Inc.
- Copyright (C) 2008 Free Software Foundation, Inc.
-
- Target configuration macros for x86 and x86-64.
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- ``Software''), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to
- permit persons to whom the Software is furnished to do so, subject to
- the following conditions:
-
- The above copyright notice and this permission notice shall be included
- in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- DEALINGS IN THE SOFTWARE.
-
- ----------------------------------------------------------------------- */
-
-#ifndef LIBFFI_TARGET_H
-#define LIBFFI_TARGET_H
-
-#ifndef LIBFFI_H
-#error "Please do not include ffitarget.h directly into your source. Use ffi.h instead."
-#endif
-
-/* ---- System specific configurations ----------------------------------- */
-
-/* For code common to all platforms on x86 and x86_64. */
-#define X86_ANY
-
-#if defined (X86_64) && defined (__i386__)
-#undef X86_64
-#define X86
-#endif
-
-#ifdef X86_WIN64
-#define FFI_SIZEOF_ARG 8
-#define USE_BUILTIN_FFS 0 /* not yet implemented in mingw-64 */
-#endif
-
-/* ---- Generic type definitions ----------------------------------------- */
-
-#ifndef LIBFFI_ASM
-#ifdef X86_WIN64
-#ifdef _MSC_VER
-typedef unsigned __int64 ffi_arg;
-typedef __int64 ffi_sarg;
-#else
-typedef unsigned long long ffi_arg;
-typedef long long ffi_sarg;
-#endif
-#else
-#if defined __x86_64__ && defined __ILP32__
-#define FFI_SIZEOF_ARG 8
-#define FFI_SIZEOF_JAVA_RAW 4
-typedef unsigned long long ffi_arg;
-typedef long long ffi_sarg;
-#else
-typedef unsigned long ffi_arg;
-typedef signed long ffi_sarg;
-#endif
-#endif
-
-typedef enum ffi_abi {
- FFI_FIRST_ABI = 0,
-
- /* ---- Intel x86 Win32 ---------- */
-#ifdef X86_WIN32
- FFI_SYSV,
- FFI_STDCALL,
- FFI_THISCALL,
- FFI_FASTCALL,
- FFI_MS_CDECL,
- FFI_LAST_ABI,
-#ifdef _MSC_VER
- FFI_DEFAULT_ABI = FFI_MS_CDECL
-#else
- FFI_DEFAULT_ABI = FFI_SYSV
-#endif
-
-#elif defined(X86_WIN64)
- FFI_WIN64,
- FFI_LAST_ABI,
- FFI_DEFAULT_ABI = FFI_WIN64
-
-#else
- /* ---- Intel x86 and AMD x86-64 - */
- FFI_SYSV,
- FFI_UNIX64, /* Unix variants all use the same ABI for x86-64 */
- FFI_THISCALL,
- FFI_FASTCALL,
- FFI_STDCALL,
- FFI_LAST_ABI,
-#if defined(__i386__) || defined(__i386)
- FFI_DEFAULT_ABI = FFI_SYSV
-#else
- FFI_DEFAULT_ABI = FFI_UNIX64
-#endif
-#endif
-} ffi_abi;
-#endif
-
-/* ---- Definitions for closures ----------------------------------------- */
-
-#define FFI_CLOSURES 1
-#define FFI_TYPE_SMALL_STRUCT_1B (FFI_TYPE_LAST + 1)
-#define FFI_TYPE_SMALL_STRUCT_2B (FFI_TYPE_LAST + 2)
-#define FFI_TYPE_SMALL_STRUCT_4B (FFI_TYPE_LAST + 3)
-#define FFI_TYPE_MS_STRUCT (FFI_TYPE_LAST + 4)
-
-#if defined (X86_64) || (defined (__x86_64__) && defined (X86_DARWIN))
-#define FFI_TRAMPOLINE_SIZE 24
-#define FFI_NATIVE_RAW_API 0
-#else
-#ifdef X86_WIN32
-#define FFI_TRAMPOLINE_SIZE 52
-#else
-#ifdef X86_WIN64
-#define FFI_TRAMPOLINE_SIZE 29
-#define FFI_NATIVE_RAW_API 0
-#define FFI_NO_RAW_API 1
-#else
-#define FFI_TRAMPOLINE_SIZE 10
-#endif
-#endif
-#ifndef X86_WIN64
-#define FFI_NATIVE_RAW_API 1 /* x86 has native raw api support */
-#endif
-#endif
-
-#endif
-
diff --git a/Modules/_ctypes/libffi/src/x86/freebsd.S b/Modules/_ctypes/libffi/src/x86/freebsd.S
deleted file mode 100644
index 97e0b4eb81..0000000000
--- a/Modules/_ctypes/libffi/src/x86/freebsd.S
+++ /dev/null
@@ -1,463 +0,0 @@
-/* -----------------------------------------------------------------------
- freebsd.S - Copyright (c) 1996, 1998, 2001, 2002, 2003, 2005 Red Hat, Inc.
- Copyright (c) 2008 Björn König
-
- X86 Foreign Function Interface for FreeBSD
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- ``Software''), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to
- permit persons to whom the Software is furnished to do so, subject to
- the following conditions:
-
- The above copyright notice and this permission notice shall be included
- in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- DEALINGS IN THE SOFTWARE.
------------------------------------------------------------------------ */
-
-#ifndef __x86_64__
-
-#define LIBFFI_ASM
-#include <fficonfig.h>
-#include <ffi.h>
-
-.text
-
-.globl ffi_prep_args
-
- .align 4
-.globl ffi_call_SYSV
- .type ffi_call_SYSV,@function
-
-ffi_call_SYSV:
-.LFB1:
- pushl %ebp
-.LCFI0:
- movl %esp,%ebp
-.LCFI1:
- /* Make room for all of the new args. */
- movl 16(%ebp),%ecx
- subl %ecx,%esp
-
- /* Align the stack pointer to 16-bytes */
- andl $0xfffffff0, %esp
-
- movl %esp,%eax
-
- /* Place all of the ffi_prep_args in position */
- pushl 12(%ebp)
- pushl %eax
- call *8(%ebp)
-
- /* Return stack to previous state and call the function */
- addl $8,%esp
-
- call *28(%ebp)
-
- /* Load %ecx with the return type code */
- movl 20(%ebp),%ecx
-
- /* Protect %esi. We're going to pop it in the epilogue. */
- pushl %esi
-
- /* If the return value pointer is NULL, assume no return value. */
- cmpl $0,24(%ebp)
- jne 0f
-
- /* Even if there is no space for the return value, we are
- obliged to handle floating-point values. */
- cmpl $FFI_TYPE_FLOAT,%ecx
- jne noretval
- fstp %st(0)
-
- jmp epilogue
-
-0:
- call 1f
-
-.Lstore_table:
- .long noretval-.Lstore_table /* FFI_TYPE_VOID */
- .long retint-.Lstore_table /* FFI_TYPE_INT */
- .long retfloat-.Lstore_table /* FFI_TYPE_FLOAT */
- .long retdouble-.Lstore_table /* FFI_TYPE_DOUBLE */
- .long retlongdouble-.Lstore_table /* FFI_TYPE_LONGDOUBLE */
- .long retuint8-.Lstore_table /* FFI_TYPE_UINT8 */
- .long retsint8-.Lstore_table /* FFI_TYPE_SINT8 */
- .long retuint16-.Lstore_table /* FFI_TYPE_UINT16 */
- .long retsint16-.Lstore_table /* FFI_TYPE_SINT16 */
- .long retint-.Lstore_table /* FFI_TYPE_UINT32 */
- .long retint-.Lstore_table /* FFI_TYPE_SINT32 */
- .long retint64-.Lstore_table /* FFI_TYPE_UINT64 */
- .long retint64-.Lstore_table /* FFI_TYPE_SINT64 */
- .long retstruct-.Lstore_table /* FFI_TYPE_STRUCT */
- .long retint-.Lstore_table /* FFI_TYPE_POINTER */
- .long retstruct1b-.Lstore_table /* FFI_TYPE_SMALL_STRUCT_1B */
- .long retstruct2b-.Lstore_table /* FFI_TYPE_SMALL_STRUCT_2B */
-
-1:
- pop %esi
- add (%esi, %ecx, 4), %esi
- jmp *%esi
-
- /* Sign/zero extend as appropriate. */
-retsint8:
- movsbl %al, %eax
- jmp retint
-
-retsint16:
- movswl %ax, %eax
- jmp retint
-
-retuint8:
- movzbl %al, %eax
- jmp retint
-
-retuint16:
- movzwl %ax, %eax
- jmp retint
-
-retfloat:
- /* Load %ecx with the pointer to storage for the return value */
- movl 24(%ebp),%ecx
- fstps (%ecx)
- jmp epilogue
-
-retdouble:
- /* Load %ecx with the pointer to storage for the return value */
- movl 24(%ebp),%ecx
- fstpl (%ecx)
- jmp epilogue
-
-retlongdouble:
- /* Load %ecx with the pointer to storage for the return value */
- movl 24(%ebp),%ecx
- fstpt (%ecx)
- jmp epilogue
-
-retint64:
- /* Load %ecx with the pointer to storage for the return value */
- movl 24(%ebp),%ecx
- movl %eax,0(%ecx)
- movl %edx,4(%ecx)
- jmp epilogue
-
-retstruct1b:
- /* Load %ecx with the pointer to storage for the return value */
- movl 24(%ebp),%ecx
- movb %al,0(%ecx)
- jmp epilogue
-
-retstruct2b:
- /* Load %ecx with the pointer to storage for the return value */
- movl 24(%ebp),%ecx
- movw %ax,0(%ecx)
- jmp epilogue
-
-retint:
- /* Load %ecx with the pointer to storage for the return value */
- movl 24(%ebp),%ecx
- movl %eax,0(%ecx)
-
-retstruct:
- /* Nothing to do! */
-
-noretval:
-epilogue:
- popl %esi
- movl %ebp,%esp
- popl %ebp
- ret
-.LFE1:
-.ffi_call_SYSV_end:
- .size ffi_call_SYSV,.ffi_call_SYSV_end-ffi_call_SYSV
-
- .align 4
-FFI_HIDDEN (ffi_closure_SYSV)
-.globl ffi_closure_SYSV
- .type ffi_closure_SYSV, @function
-
-ffi_closure_SYSV:
-.LFB2:
- pushl %ebp
-.LCFI2:
- movl %esp, %ebp
-.LCFI3:
- subl $40, %esp
- leal -24(%ebp), %edx
- movl %edx, -12(%ebp) /* resp */
- leal 8(%ebp), %edx
- movl %edx, 4(%esp) /* args = __builtin_dwarf_cfa () */
- leal -12(%ebp), %edx
- movl %edx, (%esp) /* &resp */
-#if defined HAVE_HIDDEN_VISIBILITY_ATTRIBUTE || !defined __PIC__
- call ffi_closure_SYSV_inner
-#else
- movl %ebx, 8(%esp)
-.LCFI7:
- call 1f
-1: popl %ebx
- addl $_GLOBAL_OFFSET_TABLE_+[.-1b], %ebx
- call ffi_closure_SYSV_inner@PLT
- movl 8(%esp), %ebx
-#endif
- movl -12(%ebp), %ecx
- cmpl $FFI_TYPE_INT, %eax
- je .Lcls_retint
-
- /* Handle FFI_TYPE_UINT8, FFI_TYPE_SINT8, FFI_TYPE_UINT16,
- FFI_TYPE_SINT16, FFI_TYPE_UINT32, FFI_TYPE_SINT32. */
- cmpl $FFI_TYPE_UINT64, %eax
- jge 0f
- cmpl $FFI_TYPE_UINT8, %eax
- jge .Lcls_retint
-
-0: cmpl $FFI_TYPE_FLOAT, %eax
- je .Lcls_retfloat
- cmpl $FFI_TYPE_DOUBLE, %eax
- je .Lcls_retdouble
- cmpl $FFI_TYPE_LONGDOUBLE, %eax
- je .Lcls_retldouble
- cmpl $FFI_TYPE_SINT64, %eax
- je .Lcls_retllong
- cmpl $FFI_TYPE_SMALL_STRUCT_1B, %eax
- je .Lcls_retstruct1b
- cmpl $FFI_TYPE_SMALL_STRUCT_2B, %eax
- je .Lcls_retstruct2b
- cmpl $FFI_TYPE_STRUCT, %eax
- je .Lcls_retstruct
-.Lcls_epilogue:
- movl %ebp, %esp
- popl %ebp
- ret
-.Lcls_retint:
- movl (%ecx), %eax
- jmp .Lcls_epilogue
-.Lcls_retfloat:
- flds (%ecx)
- jmp .Lcls_epilogue
-.Lcls_retdouble:
- fldl (%ecx)
- jmp .Lcls_epilogue
-.Lcls_retldouble:
- fldt (%ecx)
- jmp .Lcls_epilogue
-.Lcls_retllong:
- movl (%ecx), %eax
- movl 4(%ecx), %edx
- jmp .Lcls_epilogue
-.Lcls_retstruct1b:
- movsbl (%ecx), %eax
- jmp .Lcls_epilogue
-.Lcls_retstruct2b:
- movswl (%ecx), %eax
- jmp .Lcls_epilogue
-.Lcls_retstruct:
- movl %ebp, %esp
- popl %ebp
- ret $4
-.LFE2:
- .size ffi_closure_SYSV, .-ffi_closure_SYSV
-
-#if !FFI_NO_RAW_API
-
-#define RAW_CLOSURE_CIF_OFFSET ((FFI_TRAMPOLINE_SIZE + 3) & ~3)
-#define RAW_CLOSURE_FUN_OFFSET (RAW_CLOSURE_CIF_OFFSET + 4)
-#define RAW_CLOSURE_USER_DATA_OFFSET (RAW_CLOSURE_FUN_OFFSET + 4)
-#define CIF_FLAGS_OFFSET 20
-
- .align 4
-FFI_HIDDEN (ffi_closure_raw_SYSV)
-.globl ffi_closure_raw_SYSV
- .type ffi_closure_raw_SYSV, @function
-
-ffi_closure_raw_SYSV:
-.LFB3:
- pushl %ebp
-.LCFI4:
- movl %esp, %ebp
-.LCFI5:
- pushl %esi
-.LCFI6:
- subl $36, %esp
- movl RAW_CLOSURE_CIF_OFFSET(%eax), %esi /* closure->cif */
- movl RAW_CLOSURE_USER_DATA_OFFSET(%eax), %edx /* closure->user_data */
- movl %edx, 12(%esp) /* user_data */
- leal 8(%ebp), %edx /* __builtin_dwarf_cfa () */
- movl %edx, 8(%esp) /* raw_args */
- leal -24(%ebp), %edx
- movl %edx, 4(%esp) /* &res */
- movl %esi, (%esp) /* cif */
- call *RAW_CLOSURE_FUN_OFFSET(%eax) /* closure->fun */
- movl CIF_FLAGS_OFFSET(%esi), %eax /* rtype */
- cmpl $FFI_TYPE_INT, %eax
- je .Lrcls_retint
-
- /* Handle FFI_TYPE_UINT8, FFI_TYPE_SINT8, FFI_TYPE_UINT16,
- FFI_TYPE_SINT16, FFI_TYPE_UINT32, FFI_TYPE_SINT32. */
- cmpl $FFI_TYPE_UINT64, %eax
- jge 0f
- cmpl $FFI_TYPE_UINT8, %eax
- jge .Lrcls_retint
-0:
- cmpl $FFI_TYPE_FLOAT, %eax
- je .Lrcls_retfloat
- cmpl $FFI_TYPE_DOUBLE, %eax
- je .Lrcls_retdouble
- cmpl $FFI_TYPE_LONGDOUBLE, %eax
- je .Lrcls_retldouble
- cmpl $FFI_TYPE_SINT64, %eax
- je .Lrcls_retllong
-.Lrcls_epilogue:
- addl $36, %esp
- popl %esi
- popl %ebp
- ret
-.Lrcls_retint:
- movl -24(%ebp), %eax
- jmp .Lrcls_epilogue
-.Lrcls_retfloat:
- flds -24(%ebp)
- jmp .Lrcls_epilogue
-.Lrcls_retdouble:
- fldl -24(%ebp)
- jmp .Lrcls_epilogue
-.Lrcls_retldouble:
- fldt -24(%ebp)
- jmp .Lrcls_epilogue
-.Lrcls_retllong:
- movl -24(%ebp), %eax
- movl -20(%ebp), %edx
- jmp .Lrcls_epilogue
-.LFE3:
- .size ffi_closure_raw_SYSV, .-ffi_closure_raw_SYSV
-#endif
-
- .section .eh_frame,EH_FRAME_FLAGS,@progbits
-.Lframe1:
- .long .LECIE1-.LSCIE1 /* Length of Common Information Entry */
-.LSCIE1:
- .long 0x0 /* CIE Identifier Tag */
- .byte 0x1 /* CIE Version */
-#ifdef __PIC__
- .ascii "zR\0" /* CIE Augmentation */
-#else
- .ascii "\0" /* CIE Augmentation */
-#endif
- .byte 0x1 /* .uleb128 0x1; CIE Code Alignment Factor */
- .byte 0x7c /* .sleb128 -4; CIE Data Alignment Factor */
- .byte 0x8 /* CIE RA Column */
-#ifdef __PIC__
- .byte 0x1 /* .uleb128 0x1; Augmentation size */
- .byte 0x1b /* FDE Encoding (pcrel sdata4) */
-#endif
- .byte 0xc /* DW_CFA_def_cfa */
- .byte 0x4 /* .uleb128 0x4 */
- .byte 0x4 /* .uleb128 0x4 */
- .byte 0x88 /* DW_CFA_offset, column 0x8 */
- .byte 0x1 /* .uleb128 0x1 */
- .align 4
-.LECIE1:
-.LSFDE1:
- .long .LEFDE1-.LASFDE1 /* FDE Length */
-.LASFDE1:
- .long .LASFDE1-.Lframe1 /* FDE CIE offset */
-#ifdef __PIC__
- .long .LFB1-. /* FDE initial location */
-#else
- .long .LFB1 /* FDE initial location */
-#endif
- .long .LFE1-.LFB1 /* FDE address range */
-#ifdef __PIC__
- .byte 0x0 /* .uleb128 0x0; Augmentation size */
-#endif
- .byte 0x4 /* DW_CFA_advance_loc4 */
- .long .LCFI0-.LFB1
- .byte 0xe /* DW_CFA_def_cfa_offset */
- .byte 0x8 /* .uleb128 0x8 */
- .byte 0x85 /* DW_CFA_offset, column 0x5 */
- .byte 0x2 /* .uleb128 0x2 */
- .byte 0x4 /* DW_CFA_advance_loc4 */
- .long .LCFI1-.LCFI0
- .byte 0xd /* DW_CFA_def_cfa_register */
- .byte 0x5 /* .uleb128 0x5 */
- .align 4
-.LEFDE1:
-.LSFDE2:
- .long .LEFDE2-.LASFDE2 /* FDE Length */
-.LASFDE2:
- .long .LASFDE2-.Lframe1 /* FDE CIE offset */
-#ifdef __PIC__
- .long .LFB2-. /* FDE initial location */
-#else
- .long .LFB2
-#endif
- .long .LFE2-.LFB2 /* FDE address range */
-#ifdef __PIC__
- .byte 0x0 /* .uleb128 0x0; Augmentation size */
-#endif
- .byte 0x4 /* DW_CFA_advance_loc4 */
- .long .LCFI2-.LFB2
- .byte 0xe /* DW_CFA_def_cfa_offset */
- .byte 0x8 /* .uleb128 0x8 */
- .byte 0x85 /* DW_CFA_offset, column 0x5 */
- .byte 0x2 /* .uleb128 0x2 */
- .byte 0x4 /* DW_CFA_advance_loc4 */
- .long .LCFI3-.LCFI2
- .byte 0xd /* DW_CFA_def_cfa_register */
- .byte 0x5 /* .uleb128 0x5 */
-#if !defined HAVE_HIDDEN_VISIBILITY_ATTRIBUTE && defined __PIC__
- .byte 0x4 /* DW_CFA_advance_loc4 */
- .long .LCFI7-.LCFI3
- .byte 0x83 /* DW_CFA_offset, column 0x3 */
- .byte 0xa /* .uleb128 0xa */
-#endif
- .align 4
-.LEFDE2:
-
-#if !FFI_NO_RAW_API
-
-.LSFDE3:
- .long .LEFDE3-.LASFDE3 /* FDE Length */
-.LASFDE3:
- .long .LASFDE3-.Lframe1 /* FDE CIE offset */
-#ifdef __PIC__
- .long .LFB3-. /* FDE initial location */
-#else
- .long .LFB3
-#endif
- .long .LFE3-.LFB3 /* FDE address range */
-#ifdef __PIC__
- .byte 0x0 /* .uleb128 0x0; Augmentation size */
-#endif
- .byte 0x4 /* DW_CFA_advance_loc4 */
- .long .LCFI4-.LFB3
- .byte 0xe /* DW_CFA_def_cfa_offset */
- .byte 0x8 /* .uleb128 0x8 */
- .byte 0x85 /* DW_CFA_offset, column 0x5 */
- .byte 0x2 /* .uleb128 0x2 */
- .byte 0x4 /* DW_CFA_advance_loc4 */
- .long .LCFI5-.LCFI4
- .byte 0xd /* DW_CFA_def_cfa_register */
- .byte 0x5 /* .uleb128 0x5 */
- .byte 0x4 /* DW_CFA_advance_loc4 */
- .long .LCFI6-.LCFI5
- .byte 0x86 /* DW_CFA_offset, column 0x6 */
- .byte 0x3 /* .uleb128 0x3 */
- .align 4
-.LEFDE3:
-
-#endif
-
-#endif /* ifndef __x86_64__ */
-
- .section .note.GNU-stack,"",%progbits
diff --git a/Modules/_ctypes/libffi/src/x86/sysv.S b/Modules/_ctypes/libffi/src/x86/sysv.S
deleted file mode 100644
index 3bd5477e47..0000000000
--- a/Modules/_ctypes/libffi/src/x86/sysv.S
+++ /dev/null
@@ -1,483 +0,0 @@
-/* -----------------------------------------------------------------------
- sysv.S - Copyright (c) 2013 The Written Word, Inc.
- - Copyright (c) 1996,1998,2001-2003,2005,2008,2010 Red Hat, Inc.
-
- X86 Foreign Function Interface
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- ``Software''), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to
- permit persons to whom the Software is furnished to do so, subject to
- the following conditions:
-
- The above copyright notice and this permission notice shall be included
- in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- DEALINGS IN THE SOFTWARE.
- ----------------------------------------------------------------------- */
-
-#ifndef __x86_64__
-
-#define LIBFFI_ASM
-#include <fficonfig.h>
-#include <ffi.h>
-
-.text
-
-.globl ffi_prep_args
-
- .align 4
-.globl ffi_call_SYSV
- .type ffi_call_SYSV,@function
-
-ffi_call_SYSV:
-.LFB1:
- pushl %ebp
-.LCFI0:
- movl %esp,%ebp
-.LCFI1:
- /* Make room for all of the new args. */
- movl 16(%ebp),%ecx
- subl %ecx,%esp
-
- /* Align the stack pointer to 16-bytes */
- andl $0xfffffff0, %esp
-
- movl %esp,%eax
-
- /* Place all of the ffi_prep_args in position */
- pushl 12(%ebp)
- pushl %eax
- call *8(%ebp)
-
- /* Return stack to previous state and call the function */
- addl $8,%esp
-
- call *28(%ebp)
-
- /* Load %ecx with the return type code */
- movl 20(%ebp),%ecx
-
- /* Protect %esi. We're going to pop it in the epilogue. */
- pushl %esi
-
- /* If the return value pointer is NULL, assume no return value. */
- cmpl $0,24(%ebp)
- jne 0f
-
- /* Even if there is no space for the return value, we are
- obliged to handle floating-point values. */
- cmpl $FFI_TYPE_FLOAT,%ecx
- jne noretval
- fstp %st(0)
-
- jmp epilogue
-
-0:
- call 1f
-
-.Lstore_table:
- .long noretval-.Lstore_table /* FFI_TYPE_VOID */
- .long retint-.Lstore_table /* FFI_TYPE_INT */
- .long retfloat-.Lstore_table /* FFI_TYPE_FLOAT */
- .long retdouble-.Lstore_table /* FFI_TYPE_DOUBLE */
- .long retlongdouble-.Lstore_table /* FFI_TYPE_LONGDOUBLE */
- .long retuint8-.Lstore_table /* FFI_TYPE_UINT8 */
- .long retsint8-.Lstore_table /* FFI_TYPE_SINT8 */
- .long retuint16-.Lstore_table /* FFI_TYPE_UINT16 */
- .long retsint16-.Lstore_table /* FFI_TYPE_SINT16 */
- .long retint-.Lstore_table /* FFI_TYPE_UINT32 */
- .long retint-.Lstore_table /* FFI_TYPE_SINT32 */
- .long retint64-.Lstore_table /* FFI_TYPE_UINT64 */
- .long retint64-.Lstore_table /* FFI_TYPE_SINT64 */
- .long retstruct-.Lstore_table /* FFI_TYPE_STRUCT */
- .long retint-.Lstore_table /* FFI_TYPE_POINTER */
-
-1:
- pop %esi
- add (%esi, %ecx, 4), %esi
- jmp *%esi
-
- /* Sign/zero extend as appropriate. */
-retsint8:
- movsbl %al, %eax
- jmp retint
-
-retsint16:
- movswl %ax, %eax
- jmp retint
-
-retuint8:
- movzbl %al, %eax
- jmp retint
-
-retuint16:
- movzwl %ax, %eax
- jmp retint
-
-retfloat:
- /* Load %ecx with the pointer to storage for the return value */
- movl 24(%ebp),%ecx
- fstps (%ecx)
- jmp epilogue
-
-retdouble:
- /* Load %ecx with the pointer to storage for the return value */
- movl 24(%ebp),%ecx
- fstpl (%ecx)
- jmp epilogue
-
-retlongdouble:
- /* Load %ecx with the pointer to storage for the return value */
- movl 24(%ebp),%ecx
- fstpt (%ecx)
- jmp epilogue
-
-retint64:
- /* Load %ecx with the pointer to storage for the return value */
- movl 24(%ebp),%ecx
- movl %eax,0(%ecx)
- movl %edx,4(%ecx)
- jmp epilogue
-
-retint:
- /* Load %ecx with the pointer to storage for the return value */
- movl 24(%ebp),%ecx
- movl %eax,0(%ecx)
-
-retstruct:
- /* Nothing to do! */
-
-noretval:
-epilogue:
- popl %esi
- movl %ebp,%esp
- popl %ebp
- ret
-.LFE1:
-.ffi_call_SYSV_end:
- .size ffi_call_SYSV,.ffi_call_SYSV_end-ffi_call_SYSV
-
- .align 4
-FFI_HIDDEN (ffi_closure_SYSV)
-.globl ffi_closure_SYSV
- .type ffi_closure_SYSV, @function
-
-ffi_closure_SYSV:
-.LFB2:
- pushl %ebp
-.LCFI2:
- movl %esp, %ebp
-.LCFI3:
- subl $40, %esp
- leal -24(%ebp), %edx
- movl %edx, -12(%ebp) /* resp */
- leal 8(%ebp), %edx
-#ifdef __SUNPRO_C
- /* The SUNPRO compiler doesn't support GCC's regparm function
- attribute, so we have to pass all three arguments to
- ffi_closure_SYSV_inner on the stack. */
- movl %edx, 8(%esp) /* args = __builtin_dwarf_cfa () */
- leal -12(%ebp), %edx
- movl %edx, 4(%esp) /* &resp */
- movl %eax, (%esp) /* closure */
-#else
- movl %edx, 4(%esp) /* args = __builtin_dwarf_cfa () */
- leal -12(%ebp), %edx
- movl %edx, (%esp) /* &resp */
-#endif
-#if defined HAVE_HIDDEN_VISIBILITY_ATTRIBUTE || !defined __PIC__
- call ffi_closure_SYSV_inner
-#else
- movl %ebx, 8(%esp)
-.LCFI7:
- call 1f
-1: popl %ebx
- addl $_GLOBAL_OFFSET_TABLE_+[.-1b], %ebx
- call ffi_closure_SYSV_inner@PLT
- movl 8(%esp), %ebx
-#endif
- movl -12(%ebp), %ecx
- cmpl $FFI_TYPE_INT, %eax
- je .Lcls_retint
-
- /* Handle FFI_TYPE_UINT8, FFI_TYPE_SINT8, FFI_TYPE_UINT16,
- FFI_TYPE_SINT16, FFI_TYPE_UINT32, FFI_TYPE_SINT32. */
- cmpl $FFI_TYPE_UINT64, %eax
- jge 0f
- cmpl $FFI_TYPE_UINT8, %eax
- jge .Lcls_retint
-
-0: cmpl $FFI_TYPE_FLOAT, %eax
- je .Lcls_retfloat
- cmpl $FFI_TYPE_DOUBLE, %eax
- je .Lcls_retdouble
- cmpl $FFI_TYPE_LONGDOUBLE, %eax
- je .Lcls_retldouble
- cmpl $FFI_TYPE_SINT64, %eax
- je .Lcls_retllong
- cmpl $FFI_TYPE_STRUCT, %eax
- je .Lcls_retstruct
-.Lcls_epilogue:
- movl %ebp, %esp
- popl %ebp
- ret
-.Lcls_retint:
- movl (%ecx), %eax
- jmp .Lcls_epilogue
-.Lcls_retfloat:
- flds (%ecx)
- jmp .Lcls_epilogue
-.Lcls_retdouble:
- fldl (%ecx)
- jmp .Lcls_epilogue
-.Lcls_retldouble:
- fldt (%ecx)
- jmp .Lcls_epilogue
-.Lcls_retllong:
- movl (%ecx), %eax
- movl 4(%ecx), %edx
- jmp .Lcls_epilogue
-.Lcls_retstruct:
- movl %ebp, %esp
- popl %ebp
- ret $4
-.LFE2:
- .size ffi_closure_SYSV, .-ffi_closure_SYSV
-
-#if !FFI_NO_RAW_API
-
-/* Precalculate for e.g. the Solaris 10/x86 assembler. */
-#if FFI_TRAMPOLINE_SIZE == 10
-#define RAW_CLOSURE_CIF_OFFSET 12
-#define RAW_CLOSURE_FUN_OFFSET 16
-#define RAW_CLOSURE_USER_DATA_OFFSET 20
-#elif FFI_TRAMPOLINE_SIZE == 24
-#define RAW_CLOSURE_CIF_OFFSET 24
-#define RAW_CLOSURE_FUN_OFFSET 28
-#define RAW_CLOSURE_USER_DATA_OFFSET 32
-#else
-#define RAW_CLOSURE_CIF_OFFSET ((FFI_TRAMPOLINE_SIZE + 3) & ~3)
-#define RAW_CLOSURE_FUN_OFFSET (RAW_CLOSURE_CIF_OFFSET + 4)
-#define RAW_CLOSURE_USER_DATA_OFFSET (RAW_CLOSURE_FUN_OFFSET + 4)
-#endif
-#define CIF_FLAGS_OFFSET 20
-
- .align 4
-FFI_HIDDEN (ffi_closure_raw_SYSV)
-.globl ffi_closure_raw_SYSV
- .type ffi_closure_raw_SYSV, @function
-
-ffi_closure_raw_SYSV:
-.LFB3:
- pushl %ebp
-.LCFI4:
- movl %esp, %ebp
-.LCFI5:
- pushl %esi
-.LCFI6:
- subl $36, %esp
- movl RAW_CLOSURE_CIF_OFFSET(%eax), %esi /* closure->cif */
- movl RAW_CLOSURE_USER_DATA_OFFSET(%eax), %edx /* closure->user_data */
- movl %edx, 12(%esp) /* user_data */
- leal 8(%ebp), %edx /* __builtin_dwarf_cfa () */
- movl %edx, 8(%esp) /* raw_args */
- leal -24(%ebp), %edx
- movl %edx, 4(%esp) /* &res */
- movl %esi, (%esp) /* cif */
- call *RAW_CLOSURE_FUN_OFFSET(%eax) /* closure->fun */
- movl CIF_FLAGS_OFFSET(%esi), %eax /* rtype */
- cmpl $FFI_TYPE_INT, %eax
- je .Lrcls_retint
-
- /* Handle FFI_TYPE_UINT8, FFI_TYPE_SINT8, FFI_TYPE_UINT16,
- FFI_TYPE_SINT16, FFI_TYPE_UINT32, FFI_TYPE_SINT32. */
- cmpl $FFI_TYPE_UINT64, %eax
- jge 0f
- cmpl $FFI_TYPE_UINT8, %eax
- jge .Lrcls_retint
-0:
- cmpl $FFI_TYPE_FLOAT, %eax
- je .Lrcls_retfloat
- cmpl $FFI_TYPE_DOUBLE, %eax
- je .Lrcls_retdouble
- cmpl $FFI_TYPE_LONGDOUBLE, %eax
- je .Lrcls_retldouble
- cmpl $FFI_TYPE_SINT64, %eax
- je .Lrcls_retllong
-.Lrcls_epilogue:
- addl $36, %esp
- popl %esi
- popl %ebp
- ret
-.Lrcls_retint:
- movl -24(%ebp), %eax
- jmp .Lrcls_epilogue
-.Lrcls_retfloat:
- flds -24(%ebp)
- jmp .Lrcls_epilogue
-.Lrcls_retdouble:
- fldl -24(%ebp)
- jmp .Lrcls_epilogue
-.Lrcls_retldouble:
- fldt -24(%ebp)
- jmp .Lrcls_epilogue
-.Lrcls_retllong:
- movl -24(%ebp), %eax
- movl -20(%ebp), %edx
- jmp .Lrcls_epilogue
-.LFE3:
- .size ffi_closure_raw_SYSV, .-ffi_closure_raw_SYSV
-#endif
-
-#if defined __GNUC__
-/* Only emit dwarf unwind info when building with GNU toolchain. */
-
-#if defined __PIC__
-# if defined __sun__ && defined __svr4__
-/* 32-bit Solaris 2/x86 uses datarel encoding for PIC. GNU ld before 2.22
- doesn't correctly sort .eh_frame_hdr with mixed encodings, so match this. */
-# define FDE_ENCODING 0x30 /* datarel */
-# define FDE_ENCODE(X) X@GOTOFF
-# else
-# define FDE_ENCODING 0x1b /* pcrel sdata4 */
-# if defined HAVE_AS_X86_PCREL
-# define FDE_ENCODE(X) X-.
-# else
-# define FDE_ENCODE(X) X@rel
-# endif
-# endif
-#else
-# define FDE_ENCODING 0 /* absolute */
-# define FDE_ENCODE(X) X
-#endif
-
- .section .eh_frame,EH_FRAME_FLAGS,@progbits
-.Lframe1:
- .long .LECIE1-.LSCIE1 /* Length of Common Information Entry */
-.LSCIE1:
- .long 0x0 /* CIE Identifier Tag */
- .byte 0x1 /* CIE Version */
-#ifdef HAVE_AS_ASCII_PSEUDO_OP
-#ifdef __PIC__
- .ascii "zR\0" /* CIE Augmentation */
-#else
- .ascii "\0" /* CIE Augmentation */
-#endif
-#elif defined HAVE_AS_STRING_PSEUDO_OP
-#ifdef __PIC__
- .string "zR" /* CIE Augmentation */
-#else
- .string "" /* CIE Augmentation */
-#endif
-#else
-#error missing .ascii/.string
-#endif
- .byte 0x1 /* .uleb128 0x1; CIE Code Alignment Factor */
- .byte 0x7c /* .sleb128 -4; CIE Data Alignment Factor */
- .byte 0x8 /* CIE RA Column */
-#ifdef __PIC__
- .byte 0x1 /* .uleb128 0x1; Augmentation size */
- .byte FDE_ENCODING
-#endif
- .byte 0xc /* DW_CFA_def_cfa */
- .byte 0x4 /* .uleb128 0x4 */
- .byte 0x4 /* .uleb128 0x4 */
- .byte 0x88 /* DW_CFA_offset, column 0x8 */
- .byte 0x1 /* .uleb128 0x1 */
- .align 4
-.LECIE1:
-.LSFDE1:
- .long .LEFDE1-.LASFDE1 /* FDE Length */
-.LASFDE1:
- .long .LASFDE1-.Lframe1 /* FDE CIE offset */
- .long FDE_ENCODE(.LFB1) /* FDE initial location */
- .long .LFE1-.LFB1 /* FDE address range */
-#ifdef __PIC__
- .byte 0x0 /* .uleb128 0x0; Augmentation size */
-#endif
- .byte 0x4 /* DW_CFA_advance_loc4 */
- .long .LCFI0-.LFB1
- .byte 0xe /* DW_CFA_def_cfa_offset */
- .byte 0x8 /* .uleb128 0x8 */
- .byte 0x85 /* DW_CFA_offset, column 0x5 */
- .byte 0x2 /* .uleb128 0x2 */
- .byte 0x4 /* DW_CFA_advance_loc4 */
- .long .LCFI1-.LCFI0
- .byte 0xd /* DW_CFA_def_cfa_register */
- .byte 0x5 /* .uleb128 0x5 */
- .align 4
-.LEFDE1:
-.LSFDE2:
- .long .LEFDE2-.LASFDE2 /* FDE Length */
-.LASFDE2:
- .long .LASFDE2-.Lframe1 /* FDE CIE offset */
- .long FDE_ENCODE(.LFB2) /* FDE initial location */
- .long .LFE2-.LFB2 /* FDE address range */
-#ifdef __PIC__
- .byte 0x0 /* .uleb128 0x0; Augmentation size */
-#endif
- .byte 0x4 /* DW_CFA_advance_loc4 */
- .long .LCFI2-.LFB2
- .byte 0xe /* DW_CFA_def_cfa_offset */
- .byte 0x8 /* .uleb128 0x8 */
- .byte 0x85 /* DW_CFA_offset, column 0x5 */
- .byte 0x2 /* .uleb128 0x2 */
- .byte 0x4 /* DW_CFA_advance_loc4 */
- .long .LCFI3-.LCFI2
- .byte 0xd /* DW_CFA_def_cfa_register */
- .byte 0x5 /* .uleb128 0x5 */
-#if !defined HAVE_HIDDEN_VISIBILITY_ATTRIBUTE && defined __PIC__
- .byte 0x4 /* DW_CFA_advance_loc4 */
- .long .LCFI7-.LCFI3
- .byte 0x83 /* DW_CFA_offset, column 0x3 */
- .byte 0xa /* .uleb128 0xa */
-#endif
- .align 4
-.LEFDE2:
-
-#if !FFI_NO_RAW_API
-
-.LSFDE3:
- .long .LEFDE3-.LASFDE3 /* FDE Length */
-.LASFDE3:
- .long .LASFDE3-.Lframe1 /* FDE CIE offset */
- .long FDE_ENCODE(.LFB3) /* FDE initial location */
- .long .LFE3-.LFB3 /* FDE address range */
-#ifdef __PIC__
- .byte 0x0 /* .uleb128 0x0; Augmentation size */
-#endif
- .byte 0x4 /* DW_CFA_advance_loc4 */
- .long .LCFI4-.LFB3
- .byte 0xe /* DW_CFA_def_cfa_offset */
- .byte 0x8 /* .uleb128 0x8 */
- .byte 0x85 /* DW_CFA_offset, column 0x5 */
- .byte 0x2 /* .uleb128 0x2 */
- .byte 0x4 /* DW_CFA_advance_loc4 */
- .long .LCFI5-.LCFI4
- .byte 0xd /* DW_CFA_def_cfa_register */
- .byte 0x5 /* .uleb128 0x5 */
- .byte 0x4 /* DW_CFA_advance_loc4 */
- .long .LCFI6-.LCFI5
- .byte 0x86 /* DW_CFA_offset, column 0x6 */
- .byte 0x3 /* .uleb128 0x3 */
- .align 4
-.LEFDE3:
-
-#endif
-#endif
-
-#endif /* ifndef __x86_64__ */
-
-#if defined __ELF__ && defined __linux__
- .section .note.GNU-stack,"",@progbits
-#endif
diff --git a/Modules/_ctypes/libffi/src/x86/unix64.S b/Modules/_ctypes/libffi/src/x86/unix64.S
deleted file mode 100644
index 45a0ed7463..0000000000
--- a/Modules/_ctypes/libffi/src/x86/unix64.S
+++ /dev/null
@@ -1,432 +0,0 @@
-/* -----------------------------------------------------------------------
- unix64.S - Copyright (c) 2013 The Written Word, Inc.
- - Copyright (c) 2008 Red Hat, Inc
- - Copyright (c) 2002 Bo Thorsen <bo@suse.de>
-
- x86-64 Foreign Function Interface
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- ``Software''), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to
- permit persons to whom the Software is furnished to do so, subject to
- the following conditions:
-
- The above copyright notice and this permission notice shall be included
- in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- DEALINGS IN THE SOFTWARE.
- ----------------------------------------------------------------------- */
-
-#ifdef __x86_64__
-#define LIBFFI_ASM
-#include <fficonfig.h>
-#include <ffi.h>
-
-.text
-
-/* ffi_call_unix64 (void *args, unsigned long bytes, unsigned flags,
- void *raddr, void (*fnaddr)(void));
-
- Bit o trickiness here -- ARGS+BYTES is the base of the stack frame
- for this function. This has been allocated by ffi_call. We also
- deallocate some of the stack that has been alloca'd. */
-
- .align 2
- .globl ffi_call_unix64
- .type ffi_call_unix64,@function
-
-ffi_call_unix64:
-.LUW0:
- movq (%rsp), %r10 /* Load return address. */
- leaq (%rdi, %rsi), %rax /* Find local stack base. */
- movq %rdx, (%rax) /* Save flags. */
- movq %rcx, 8(%rax) /* Save raddr. */
- movq %rbp, 16(%rax) /* Save old frame pointer. */
- movq %r10, 24(%rax) /* Relocate return address. */
- movq %rax, %rbp /* Finalize local stack frame. */
-.LUW1:
- movq %rdi, %r10 /* Save a copy of the register area. */
- movq %r8, %r11 /* Save a copy of the target fn. */
- movl %r9d, %eax /* Set number of SSE registers. */
-
- /* Load up all argument registers. */
- movq (%r10), %rdi
- movq 8(%r10), %rsi
- movq 16(%r10), %rdx
- movq 24(%r10), %rcx
- movq 32(%r10), %r8
- movq 40(%r10), %r9
- testl %eax, %eax
- jnz .Lload_sse
-.Lret_from_load_sse:
-
- /* Deallocate the reg arg area. */
- leaq 176(%r10), %rsp
-
- /* Call the user function. */
- call *%r11
-
- /* Deallocate stack arg area; local stack frame in redzone. */
- leaq 24(%rbp), %rsp
-
- movq 0(%rbp), %rcx /* Reload flags. */
- movq 8(%rbp), %rdi /* Reload raddr. */
- movq 16(%rbp), %rbp /* Reload old frame pointer. */
-.LUW2:
-
- /* The first byte of the flags contains the FFI_TYPE. */
- movzbl %cl, %r10d
- leaq .Lstore_table(%rip), %r11
- movslq (%r11, %r10, 4), %r10
- addq %r11, %r10
- jmp *%r10
-
-.Lstore_table:
- .long .Lst_void-.Lstore_table /* FFI_TYPE_VOID */
- .long .Lst_sint32-.Lstore_table /* FFI_TYPE_INT */
- .long .Lst_float-.Lstore_table /* FFI_TYPE_FLOAT */
- .long .Lst_double-.Lstore_table /* FFI_TYPE_DOUBLE */
- .long .Lst_ldouble-.Lstore_table /* FFI_TYPE_LONGDOUBLE */
- .long .Lst_uint8-.Lstore_table /* FFI_TYPE_UINT8 */
- .long .Lst_sint8-.Lstore_table /* FFI_TYPE_SINT8 */
- .long .Lst_uint16-.Lstore_table /* FFI_TYPE_UINT16 */
- .long .Lst_sint16-.Lstore_table /* FFI_TYPE_SINT16 */
- .long .Lst_uint32-.Lstore_table /* FFI_TYPE_UINT32 */
- .long .Lst_sint32-.Lstore_table /* FFI_TYPE_SINT32 */
- .long .Lst_int64-.Lstore_table /* FFI_TYPE_UINT64 */
- .long .Lst_int64-.Lstore_table /* FFI_TYPE_SINT64 */
- .long .Lst_struct-.Lstore_table /* FFI_TYPE_STRUCT */
- .long .Lst_int64-.Lstore_table /* FFI_TYPE_POINTER */
-
- .align 2
-.Lst_void:
- ret
- .align 2
-
-.Lst_uint8:
- movzbq %al, %rax
- movq %rax, (%rdi)
- ret
- .align 2
-.Lst_sint8:
- movsbq %al, %rax
- movq %rax, (%rdi)
- ret
- .align 2
-.Lst_uint16:
- movzwq %ax, %rax
- movq %rax, (%rdi)
- .align 2
-.Lst_sint16:
- movswq %ax, %rax
- movq %rax, (%rdi)
- ret
- .align 2
-.Lst_uint32:
- movl %eax, %eax
- movq %rax, (%rdi)
- .align 2
-.Lst_sint32:
- cltq
- movq %rax, (%rdi)
- ret
- .align 2
-.Lst_int64:
- movq %rax, (%rdi)
- ret
-
- .align 2
-.Lst_float:
- movss %xmm0, (%rdi)
- ret
- .align 2
-.Lst_double:
- movsd %xmm0, (%rdi)
- ret
-.Lst_ldouble:
- fstpt (%rdi)
- ret
-
- .align 2
-.Lst_struct:
- leaq -20(%rsp), %rsi /* Scratch area in redzone. */
-
- /* We have to locate the values now, and since we don't want to
- write too much data into the user's return value, we spill the
- value to a 16 byte scratch area first. Bits 8, 9, and 10
- control where the values are located. Only one of the three
- bits will be set; see ffi_prep_cif_machdep for the pattern. */
- movd %xmm0, %r10
- movd %xmm1, %r11
- testl $0x100, %ecx
- cmovnz %rax, %rdx
- cmovnz %r10, %rax
- testl $0x200, %ecx
- cmovnz %r10, %rdx
- testl $0x400, %ecx
- cmovnz %r10, %rax
- cmovnz %r11, %rdx
- movq %rax, (%rsi)
- movq %rdx, 8(%rsi)
-
- /* Bits 12-31 contain the true size of the structure. Copy from
- the scratch area to the true destination. */
- shrl $12, %ecx
- rep movsb
- ret
-
- /* Many times we can avoid loading any SSE registers at all.
- It's not worth an indirect jump to load the exact set of
- SSE registers needed; zero or all is a good compromise. */
- .align 2
-.LUW3:
-.Lload_sse:
- movdqa 48(%r10), %xmm0
- movdqa 64(%r10), %xmm1
- movdqa 80(%r10), %xmm2
- movdqa 96(%r10), %xmm3
- movdqa 112(%r10), %xmm4
- movdqa 128(%r10), %xmm5
- movdqa 144(%r10), %xmm6
- movdqa 160(%r10), %xmm7
- jmp .Lret_from_load_sse
-
-.LUW4:
- .size ffi_call_unix64,.-ffi_call_unix64
-
- .align 2
- .globl ffi_closure_unix64
- .type ffi_closure_unix64,@function
-
-ffi_closure_unix64:
-.LUW5:
- /* The carry flag is set by the trampoline iff SSE registers
- are used. Don't clobber it before the branch instruction. */
- leaq -200(%rsp), %rsp
-.LUW6:
- movq %rdi, (%rsp)
- movq %rsi, 8(%rsp)
- movq %rdx, 16(%rsp)
- movq %rcx, 24(%rsp)
- movq %r8, 32(%rsp)
- movq %r9, 40(%rsp)
- jc .Lsave_sse
-.Lret_from_save_sse:
-
- movq %r10, %rdi
- leaq 176(%rsp), %rsi
- movq %rsp, %rdx
- leaq 208(%rsp), %rcx
- call ffi_closure_unix64_inner@PLT
-
- /* Deallocate stack frame early; return value is now in redzone. */
- addq $200, %rsp
-.LUW7:
-
- /* The first byte of the return value contains the FFI_TYPE. */
- movzbl %al, %r10d
- leaq .Lload_table(%rip), %r11
- movslq (%r11, %r10, 4), %r10
- addq %r11, %r10
- jmp *%r10
-
-.Lload_table:
- .long .Lld_void-.Lload_table /* FFI_TYPE_VOID */
- .long .Lld_int32-.Lload_table /* FFI_TYPE_INT */
- .long .Lld_float-.Lload_table /* FFI_TYPE_FLOAT */
- .long .Lld_double-.Lload_table /* FFI_TYPE_DOUBLE */
- .long .Lld_ldouble-.Lload_table /* FFI_TYPE_LONGDOUBLE */
- .long .Lld_int8-.Lload_table /* FFI_TYPE_UINT8 */
- .long .Lld_int8-.Lload_table /* FFI_TYPE_SINT8 */
- .long .Lld_int16-.Lload_table /* FFI_TYPE_UINT16 */
- .long .Lld_int16-.Lload_table /* FFI_TYPE_SINT16 */
- .long .Lld_int32-.Lload_table /* FFI_TYPE_UINT32 */
- .long .Lld_int32-.Lload_table /* FFI_TYPE_SINT32 */
- .long .Lld_int64-.Lload_table /* FFI_TYPE_UINT64 */
- .long .Lld_int64-.Lload_table /* FFI_TYPE_SINT64 */
- .long .Lld_struct-.Lload_table /* FFI_TYPE_STRUCT */
- .long .Lld_int64-.Lload_table /* FFI_TYPE_POINTER */
-
- .align 2
-.Lld_void:
- ret
-
- .align 2
-.Lld_int8:
- movzbl -24(%rsp), %eax
- ret
- .align 2
-.Lld_int16:
- movzwl -24(%rsp), %eax
- ret
- .align 2
-.Lld_int32:
- movl -24(%rsp), %eax
- ret
- .align 2
-.Lld_int64:
- movq -24(%rsp), %rax
- ret
-
- .align 2
-.Lld_float:
- movss -24(%rsp), %xmm0
- ret
- .align 2
-.Lld_double:
- movsd -24(%rsp), %xmm0
- ret
- .align 2
-.Lld_ldouble:
- fldt -24(%rsp)
- ret
-
- .align 2
-.Lld_struct:
- /* There are four possibilities here, %rax/%rdx, %xmm0/%rax,
- %rax/%xmm0, %xmm0/%xmm1. We collapse two by always loading
- both rdx and xmm1 with the second word. For the remaining,
- bit 8 set means xmm0 gets the second word, and bit 9 means
- that rax gets the second word. */
- movq -24(%rsp), %rcx
- movq -16(%rsp), %rdx
- movq -16(%rsp), %xmm1
- testl $0x100, %eax
- cmovnz %rdx, %rcx
- movd %rcx, %xmm0
- testl $0x200, %eax
- movq -24(%rsp), %rax
- cmovnz %rdx, %rax
- ret
-
- /* See the comment above .Lload_sse; the same logic applies here. */
- .align 2
-.LUW8:
-.Lsave_sse:
- movdqa %xmm0, 48(%rsp)
- movdqa %xmm1, 64(%rsp)
- movdqa %xmm2, 80(%rsp)
- movdqa %xmm3, 96(%rsp)
- movdqa %xmm4, 112(%rsp)
- movdqa %xmm5, 128(%rsp)
- movdqa %xmm6, 144(%rsp)
- movdqa %xmm7, 160(%rsp)
- jmp .Lret_from_save_sse
-
-.LUW9:
- .size ffi_closure_unix64,.-ffi_closure_unix64
-
-#ifdef __GNUC__
-/* Only emit DWARF unwind info when building with the GNU toolchain. */
-
-#ifdef HAVE_AS_X86_64_UNWIND_SECTION_TYPE
- .section .eh_frame,"a",@unwind
-#else
- .section .eh_frame,"a",@progbits
-#endif
-.Lframe1:
- .long .LECIE1-.LSCIE1 /* CIE Length */
-.LSCIE1:
- .long 0 /* CIE Identifier Tag */
- .byte 1 /* CIE Version */
- .ascii "zR\0" /* CIE Augmentation */
- .uleb128 1 /* CIE Code Alignment Factor */
- .sleb128 -8 /* CIE Data Alignment Factor */
- .byte 0x10 /* CIE RA Column */
- .uleb128 1 /* Augmentation size */
- .byte 0x1b /* FDE Encoding (pcrel sdata4) */
- .byte 0xc /* DW_CFA_def_cfa, %rsp offset 8 */
- .uleb128 7
- .uleb128 8
- .byte 0x80+16 /* DW_CFA_offset, %rip offset 1*-8 */
- .uleb128 1
- .align 8
-.LECIE1:
-.LSFDE1:
- .long .LEFDE1-.LASFDE1 /* FDE Length */
-.LASFDE1:
- .long .LASFDE1-.Lframe1 /* FDE CIE offset */
-#if HAVE_AS_X86_PCREL
- .long .LUW0-. /* FDE initial location */
-#else
- .long .LUW0@rel
-#endif
- .long .LUW4-.LUW0 /* FDE address range */
- .uleb128 0x0 /* Augmentation size */
-
- .byte 0x4 /* DW_CFA_advance_loc4 */
- .long .LUW1-.LUW0
-
- /* New stack frame based off rbp. This is an itty bit of unwind
- trickery in that the CFA *has* changed. There is no easy way
- to describe it correctly on entry to the function. Fortunately,
- it doesn't matter too much since at all points we can correctly
- unwind back to ffi_call. Note that the location to which we
- moved the return address is (the new) CFA-8, so from the
- perspective of the unwind info, it hasn't moved. */
- .byte 0xc /* DW_CFA_def_cfa, %rbp offset 32 */
- .uleb128 6
- .uleb128 32
- .byte 0x80+6 /* DW_CFA_offset, %rbp offset 2*-8 */
- .uleb128 2
- .byte 0xa /* DW_CFA_remember_state */
-
- .byte 0x4 /* DW_CFA_advance_loc4 */
- .long .LUW2-.LUW1
- .byte 0xc /* DW_CFA_def_cfa, %rsp offset 8 */
- .uleb128 7
- .uleb128 8
- .byte 0xc0+6 /* DW_CFA_restore, %rbp */
-
- .byte 0x4 /* DW_CFA_advance_loc4 */
- .long .LUW3-.LUW2
- .byte 0xb /* DW_CFA_restore_state */
-
- .align 8
-.LEFDE1:
-.LSFDE3:
- .long .LEFDE3-.LASFDE3 /* FDE Length */
-.LASFDE3:
- .long .LASFDE3-.Lframe1 /* FDE CIE offset */
-#if HAVE_AS_X86_PCREL
- .long .LUW5-. /* FDE initial location */
-#else
- .long .LUW5@rel
-#endif
- .long .LUW9-.LUW5 /* FDE address range */
- .uleb128 0x0 /* Augmentation size */
-
- .byte 0x4 /* DW_CFA_advance_loc4 */
- .long .LUW6-.LUW5
- .byte 0xe /* DW_CFA_def_cfa_offset */
- .uleb128 208
- .byte 0xa /* DW_CFA_remember_state */
-
- .byte 0x4 /* DW_CFA_advance_loc4 */
- .long .LUW7-.LUW6
- .byte 0xe /* DW_CFA_def_cfa_offset */
- .uleb128 8
-
- .byte 0x4 /* DW_CFA_advance_loc4 */
- .long .LUW8-.LUW7
- .byte 0xb /* DW_CFA_restore_state */
-
- .align 8
-.LEFDE3:
-
-#endif /* __GNUC__ */
-
-#endif /* __x86_64__ */
-
-#if defined __ELF__ && defined __linux__
- .section .note.GNU-stack,"",@progbits
-#endif
diff --git a/Modules/_ctypes/libffi/src/x86/win32.S b/Modules/_ctypes/libffi/src/x86/win32.S
deleted file mode 100644
index daf0e799ca..0000000000
--- a/Modules/_ctypes/libffi/src/x86/win32.S
+++ /dev/null
@@ -1,1306 +0,0 @@
-/* -----------------------------------------------------------------------
- win32.S - Copyright (c) 1996, 1998, 2001, 2002, 2009 Red Hat, Inc.
- Copyright (c) 2001 John Beniton
- Copyright (c) 2002 Ranjit Mathew
- Copyright (c) 2009 Daniel Witte
-
-
- X86 Foreign Function Interface
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- ``Software''), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to
- permit persons to whom the Software is furnished to do so, subject to
- the following conditions:
-
- The above copyright notice and this permission notice shall be included
- in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- DEALINGS IN THE SOFTWARE.
- -----------------------------------------------------------------------
- */
-
-#define LIBFFI_ASM
-#include <fficonfig.h>
-#include <ffi.h>
-
-#define CIF_ABI_OFFSET 0
-#define CIF_BYTES_OFFSET 16
-
-#ifdef _MSC_VER
-
-#define CLOSURE_CIF_OFFSET ((FFI_TRAMPOLINE_SIZE + 3) AND NOT 3)
-
-.386
-.MODEL FLAT, C
-
-EXTRN ffi_closure_SYSV_inner:NEAR
-
-_TEXT SEGMENT
-
-ffi_call_win32 PROC NEAR,
- ffi_prep_args : NEAR PTR DWORD,
- ecif : NEAR PTR DWORD,
- cif_abi : DWORD,
- cif_bytes : DWORD,
- cif_flags : DWORD,
- rvalue : NEAR PTR DWORD,
- fn : NEAR PTR DWORD
-
- ;; Make room for all of the new args.
- mov ecx, cif_bytes
- sub esp, ecx
-
- mov eax, esp
-
- ;; Place all of the ffi_prep_args in position
- push ecif
- push eax
- call ffi_prep_args
-
- ;; Return stack to previous state and call the function
- add esp, 8
-
- ;; Handle thiscall and fastcall
- cmp cif_abi, 3 ;; FFI_THISCALL
- jz do_thiscall
- cmp cif_abi, 4 ;; FFI_FASTCALL
- jnz do_stdcall
- mov ecx, DWORD PTR [esp]
- mov edx, DWORD PTR [esp+4]
- add esp, 8
- jmp do_stdcall
-do_thiscall:
- mov ecx, DWORD PTR [esp]
- add esp, 4
-do_stdcall:
- call fn
-
- ;; cdecl: we restore esp in the epilogue, so there's no need to
- ;; remove the space we pushed for the args.
- ;; stdcall: the callee has already cleaned the stack.
-
- ;; Load ecx with the return type code
- mov ecx, cif_flags
-
- ;; If the return value pointer is NULL, assume no return value.
- cmp rvalue, 0
- jne ca_jumptable
-
- ;; Even if there is no space for the return value, we are
- ;; obliged to handle floating-point values.
- cmp ecx, FFI_TYPE_FLOAT
- jne ca_epilogue
- fstp st(0)
-
- jmp ca_epilogue
-
-ca_jumptable:
- jmp [ca_jumpdata + 4 * ecx]
-ca_jumpdata:
- ;; Do not insert anything here between label and jump table.
- dd offset ca_epilogue ;; FFI_TYPE_VOID
- dd offset ca_retint ;; FFI_TYPE_INT
- dd offset ca_retfloat ;; FFI_TYPE_FLOAT
- dd offset ca_retdouble ;; FFI_TYPE_DOUBLE
- dd offset ca_retlongdouble ;; FFI_TYPE_LONGDOUBLE
- dd offset ca_retuint8 ;; FFI_TYPE_UINT8
- dd offset ca_retsint8 ;; FFI_TYPE_SINT8
- dd offset ca_retuint16 ;; FFI_TYPE_UINT16
- dd offset ca_retsint16 ;; FFI_TYPE_SINT16
- dd offset ca_retint ;; FFI_TYPE_UINT32
- dd offset ca_retint ;; FFI_TYPE_SINT32
- dd offset ca_retint64 ;; FFI_TYPE_UINT64
- dd offset ca_retint64 ;; FFI_TYPE_SINT64
- dd offset ca_epilogue ;; FFI_TYPE_STRUCT
- dd offset ca_retint ;; FFI_TYPE_POINTER
- dd offset ca_retstruct1b ;; FFI_TYPE_SMALL_STRUCT_1B
- dd offset ca_retstruct2b ;; FFI_TYPE_SMALL_STRUCT_2B
- dd offset ca_retint ;; FFI_TYPE_SMALL_STRUCT_4B
- dd offset ca_epilogue ;; FFI_TYPE_MS_STRUCT
-
- /* Sign/zero extend as appropriate. */
-ca_retuint8:
- movzx eax, al
- jmp ca_retint
-
-ca_retsint8:
- movsx eax, al
- jmp ca_retint
-
-ca_retuint16:
- movzx eax, ax
- jmp ca_retint
-
-ca_retsint16:
- movsx eax, ax
- jmp ca_retint
-
-ca_retint:
- ;; Load %ecx with the pointer to storage for the return value
- mov ecx, rvalue
- mov [ecx + 0], eax
- jmp ca_epilogue
-
-ca_retint64:
- ;; Load %ecx with the pointer to storage for the return value
- mov ecx, rvalue
- mov [ecx + 0], eax
- mov [ecx + 4], edx
- jmp ca_epilogue
-
-ca_retfloat:
- ;; Load %ecx with the pointer to storage for the return value
- mov ecx, rvalue
- fstp DWORD PTR [ecx]
- jmp ca_epilogue
-
-ca_retdouble:
- ;; Load %ecx with the pointer to storage for the return value
- mov ecx, rvalue
- fstp QWORD PTR [ecx]
- jmp ca_epilogue
-
-ca_retlongdouble:
- ;; Load %ecx with the pointer to storage for the return value
- mov ecx, rvalue
- fstp TBYTE PTR [ecx]
- jmp ca_epilogue
-
-ca_retstruct1b:
- ;; Load %ecx with the pointer to storage for the return value
- mov ecx, rvalue
- mov [ecx + 0], al
- jmp ca_epilogue
-
-ca_retstruct2b:
- ;; Load %ecx with the pointer to storage for the return value
- mov ecx, rvalue
- mov [ecx + 0], ax
- jmp ca_epilogue
-
-ca_epilogue:
- ;; Epilogue code is autogenerated.
- ret
-ffi_call_win32 ENDP
-
-ffi_closure_THISCALL PROC NEAR
- ;; Insert the register argument on the stack as the first argument
- xchg DWORD PTR [esp+4], ecx
- xchg DWORD PTR [esp], ecx
- push ecx
- jmp ffi_closure_STDCALL
-ffi_closure_THISCALL ENDP
-
-ffi_closure_FASTCALL PROC NEAR
- ;; Insert the register argument on the stack as the first argument
- xchg DWORD PTR [esp+4], edx
- xchg DWORD PTR [esp], ecx
- push edx
- push ecx
- jmp ffi_closure_STDCALL
-ffi_closure_FASTCALL ENDP
-
-ffi_closure_SYSV PROC NEAR FORCEFRAME
- ;; the ffi_closure ctx is passed in eax by the trampoline.
-
- sub esp, 40
- lea edx, [ebp - 24]
- mov [ebp - 12], edx ;; resp
- lea edx, [ebp + 8]
-stub::
- mov [esp + 8], edx ;; args
- lea edx, [ebp - 12]
- mov [esp + 4], edx ;; &resp
- mov [esp], eax ;; closure
- call ffi_closure_SYSV_inner
- mov ecx, [ebp - 12]
-
-cs_jumptable:
- jmp [cs_jumpdata + 4 * eax]
-cs_jumpdata:
- ;; Do not insert anything here between the label and jump table.
- dd offset cs_epilogue ;; FFI_TYPE_VOID
- dd offset cs_retint ;; FFI_TYPE_INT
- dd offset cs_retfloat ;; FFI_TYPE_FLOAT
- dd offset cs_retdouble ;; FFI_TYPE_DOUBLE
- dd offset cs_retlongdouble ;; FFI_TYPE_LONGDOUBLE
- dd offset cs_retuint8 ;; FFI_TYPE_UINT8
- dd offset cs_retsint8 ;; FFI_TYPE_SINT8
- dd offset cs_retuint16 ;; FFI_TYPE_UINT16
- dd offset cs_retsint16 ;; FFI_TYPE_SINT16
- dd offset cs_retint ;; FFI_TYPE_UINT32
- dd offset cs_retint ;; FFI_TYPE_SINT32
- dd offset cs_retint64 ;; FFI_TYPE_UINT64
- dd offset cs_retint64 ;; FFI_TYPE_SINT64
- dd offset cs_retstruct ;; FFI_TYPE_STRUCT
- dd offset cs_retint ;; FFI_TYPE_POINTER
- dd offset cs_retsint8 ;; FFI_TYPE_SMALL_STRUCT_1B
- dd offset cs_retsint16 ;; FFI_TYPE_SMALL_STRUCT_2B
- dd offset cs_retint ;; FFI_TYPE_SMALL_STRUCT_4B
- dd offset cs_retmsstruct ;; FFI_TYPE_MS_STRUCT
-
-cs_retuint8:
- movzx eax, BYTE PTR [ecx]
- jmp cs_epilogue
-
-cs_retsint8:
- movsx eax, BYTE PTR [ecx]
- jmp cs_epilogue
-
-cs_retuint16:
- movzx eax, WORD PTR [ecx]
- jmp cs_epilogue
-
-cs_retsint16:
- movsx eax, WORD PTR [ecx]
- jmp cs_epilogue
-
-cs_retint:
- mov eax, [ecx]
- jmp cs_epilogue
-
-cs_retint64:
- mov eax, [ecx + 0]
- mov edx, [ecx + 4]
- jmp cs_epilogue
-
-cs_retfloat:
- fld DWORD PTR [ecx]
- jmp cs_epilogue
-
-cs_retdouble:
- fld QWORD PTR [ecx]
- jmp cs_epilogue
-
-cs_retlongdouble:
- fld TBYTE PTR [ecx]
- jmp cs_epilogue
-
-cs_retstruct:
- ;; Caller expects us to pop struct return value pointer hidden arg.
- ;; Epilogue code is autogenerated.
- ret 4
-
-cs_retmsstruct:
- ;; Caller expects us to return a pointer to the real return value.
- mov eax, ecx
- ;; Caller doesn't expects us to pop struct return value pointer hidden arg.
- jmp cs_epilogue
-
-cs_epilogue:
- ;; Epilogue code is autogenerated.
- ret
-ffi_closure_SYSV ENDP
-
-#if !FFI_NO_RAW_API
-
-#define RAW_CLOSURE_CIF_OFFSET ((FFI_TRAMPOLINE_SIZE + 3) AND NOT 3)
-#define RAW_CLOSURE_FUN_OFFSET (RAW_CLOSURE_CIF_OFFSET + 4)
-#define RAW_CLOSURE_USER_DATA_OFFSET (RAW_CLOSURE_FUN_OFFSET + 4)
-#define CIF_FLAGS_OFFSET 20
-
-ffi_closure_raw_THISCALL PROC NEAR USES esi FORCEFRAME
- sub esp, 36
- mov esi, [eax + RAW_CLOSURE_CIF_OFFSET] ;; closure->cif
- mov edx, [eax + RAW_CLOSURE_USER_DATA_OFFSET] ;; closure->user_data
- mov [esp + 12], edx
- lea edx, [ebp + 12]
- jmp stubraw
-ffi_closure_raw_THISCALL ENDP
-
-ffi_closure_raw_SYSV PROC NEAR USES esi FORCEFRAME
- ;; the ffi_closure ctx is passed in eax by the trampoline.
-
- sub esp, 40
- mov esi, [eax + RAW_CLOSURE_CIF_OFFSET] ;; closure->cif
- mov edx, [eax + RAW_CLOSURE_USER_DATA_OFFSET] ;; closure->user_data
- mov [esp + 12], edx ;; user_data
- lea edx, [ebp + 8]
-stubraw::
- mov [esp + 8], edx ;; raw_args
- lea edx, [ebp - 24]
- mov [esp + 4], edx ;; &res
- mov [esp], esi ;; cif
- call DWORD PTR [eax + RAW_CLOSURE_FUN_OFFSET] ;; closure->fun
- mov eax, [esi + CIF_FLAGS_OFFSET] ;; cif->flags
- lea ecx, [ebp - 24]
-
-cr_jumptable:
- jmp [cr_jumpdata + 4 * eax]
-cr_jumpdata:
- ;; Do not insert anything here between the label and jump table.
- dd offset cr_epilogue ;; FFI_TYPE_VOID
- dd offset cr_retint ;; FFI_TYPE_INT
- dd offset cr_retfloat ;; FFI_TYPE_FLOAT
- dd offset cr_retdouble ;; FFI_TYPE_DOUBLE
- dd offset cr_retlongdouble ;; FFI_TYPE_LONGDOUBLE
- dd offset cr_retuint8 ;; FFI_TYPE_UINT8
- dd offset cr_retsint8 ;; FFI_TYPE_SINT8
- dd offset cr_retuint16 ;; FFI_TYPE_UINT16
- dd offset cr_retsint16 ;; FFI_TYPE_SINT16
- dd offset cr_retint ;; FFI_TYPE_UINT32
- dd offset cr_retint ;; FFI_TYPE_SINT32
- dd offset cr_retint64 ;; FFI_TYPE_UINT64
- dd offset cr_retint64 ;; FFI_TYPE_SINT64
- dd offset cr_epilogue ;; FFI_TYPE_STRUCT
- dd offset cr_retint ;; FFI_TYPE_POINTER
- dd offset cr_retsint8 ;; FFI_TYPE_SMALL_STRUCT_1B
- dd offset cr_retsint16 ;; FFI_TYPE_SMALL_STRUCT_2B
- dd offset cr_retint ;; FFI_TYPE_SMALL_STRUCT_4B
- dd offset cr_epilogue ;; FFI_TYPE_MS_STRUCT
-
-cr_retuint8:
- movzx eax, BYTE PTR [ecx]
- jmp cr_epilogue
-
-cr_retsint8:
- movsx eax, BYTE PTR [ecx]
- jmp cr_epilogue
-
-cr_retuint16:
- movzx eax, WORD PTR [ecx]
- jmp cr_epilogue
-
-cr_retsint16:
- movsx eax, WORD PTR [ecx]
- jmp cr_epilogue
-
-cr_retint:
- mov eax, [ecx]
- jmp cr_epilogue
-
-cr_retint64:
- mov eax, [ecx + 0]
- mov edx, [ecx + 4]
- jmp cr_epilogue
-
-cr_retfloat:
- fld DWORD PTR [ecx]
- jmp cr_epilogue
-
-cr_retdouble:
- fld QWORD PTR [ecx]
- jmp cr_epilogue
-
-cr_retlongdouble:
- fld TBYTE PTR [ecx]
- jmp cr_epilogue
-
-cr_epilogue:
- ;; Epilogue code is autogenerated.
- ret
-ffi_closure_raw_SYSV ENDP
-
-#endif /* !FFI_NO_RAW_API */
-
-ffi_closure_STDCALL PROC NEAR FORCEFRAME
- ;; the ffi_closure ctx is passed in eax by the trampoline.
-
- sub esp, 40
- lea edx, [ebp - 24]
- mov [ebp - 12], edx ;; resp
- lea edx, [ebp + 12] ;; account for stub return address on stack
- mov [esp + 8], edx ;; args
- lea edx, [ebp - 12]
- mov [esp + 4], edx ;; &resp
- mov [esp], eax ;; closure
- call ffi_closure_SYSV_inner
- mov ecx, [ebp - 12]
-
-cd_jumptable:
- jmp [cd_jumpdata + 4 * eax]
-cd_jumpdata:
- ;; Do not insert anything here between the label and jump table.
- dd offset cd_epilogue ;; FFI_TYPE_VOID
- dd offset cd_retint ;; FFI_TYPE_INT
- dd offset cd_retfloat ;; FFI_TYPE_FLOAT
- dd offset cd_retdouble ;; FFI_TYPE_DOUBLE
- dd offset cd_retlongdouble ;; FFI_TYPE_LONGDOUBLE
- dd offset cd_retuint8 ;; FFI_TYPE_UINT8
- dd offset cd_retsint8 ;; FFI_TYPE_SINT8
- dd offset cd_retuint16 ;; FFI_TYPE_UINT16
- dd offset cd_retsint16 ;; FFI_TYPE_SINT16
- dd offset cd_retint ;; FFI_TYPE_UINT32
- dd offset cd_retint ;; FFI_TYPE_SINT32
- dd offset cd_retint64 ;; FFI_TYPE_UINT64
- dd offset cd_retint64 ;; FFI_TYPE_SINT64
- dd offset cd_epilogue ;; FFI_TYPE_STRUCT
- dd offset cd_retint ;; FFI_TYPE_POINTER
- dd offset cd_retsint8 ;; FFI_TYPE_SMALL_STRUCT_1B
- dd offset cd_retsint16 ;; FFI_TYPE_SMALL_STRUCT_2B
- dd offset cd_retint ;; FFI_TYPE_SMALL_STRUCT_4B
-
-cd_retuint8:
- movzx eax, BYTE PTR [ecx]
- jmp cd_epilogue
-
-cd_retsint8:
- movsx eax, BYTE PTR [ecx]
- jmp cd_epilogue
-
-cd_retuint16:
- movzx eax, WORD PTR [ecx]
- jmp cd_epilogue
-
-cd_retsint16:
- movsx eax, WORD PTR [ecx]
- jmp cd_epilogue
-
-cd_retint:
- mov eax, [ecx]
- jmp cd_epilogue
-
-cd_retint64:
- mov eax, [ecx + 0]
- mov edx, [ecx + 4]
- jmp cd_epilogue
-
-cd_retfloat:
- fld DWORD PTR [ecx]
- jmp cd_epilogue
-
-cd_retdouble:
- fld QWORD PTR [ecx]
- jmp cd_epilogue
-
-cd_retlongdouble:
- fld TBYTE PTR [ecx]
- jmp cd_epilogue
-
-cd_epilogue:
- mov esp, ebp
- pop ebp
- pop ecx
- pop edx
- mov ecx, DWORD PTR [ecx + (CLOSURE_CIF_OFFSET-10)]
- add esp, DWORD PTR [ecx + CIF_BYTES_OFFSET]
- mov ecx, DWORD PTR [ecx + CIF_ABI_OFFSET]
- cmp ecx, 3
- je cd_thiscall
- cmp ecx, 4
- jne cd_not_fastcall
-
- add esp, 4
-cd_thiscall:
- add esp, 4
-cd_not_fastcall:
- jmp edx
-ffi_closure_STDCALL ENDP
-
-_TEXT ENDS
-END
-
-#else
-
-#define CLOSURE_CIF_OFFSET ((FFI_TRAMPOLINE_SIZE + 3) & ~3)
-
-#if defined(SYMBOL_UNDERSCORE)
-#define USCORE_SYMBOL(x) _##x
-#else
-#define USCORE_SYMBOL(x) x
-#endif
- .text
-
- # This assumes we are using gas.
- .balign 16
-FFI_HIDDEN(ffi_call_win32)
- .globl USCORE_SYMBOL(ffi_call_win32)
-#if defined(X86_WIN32) && !defined(__OS2__)
- .def _ffi_call_win32; .scl 2; .type 32; .endef
-#endif
-USCORE_SYMBOL(ffi_call_win32):
-.LFB1:
- pushl %ebp
-.LCFI0:
- movl %esp,%ebp
-.LCFI1:
- # Make room for all of the new args.
- movl 20(%ebp),%ecx
- subl %ecx,%esp
-
- movl %esp,%eax
-
- # Place all of the ffi_prep_args in position
- pushl 12(%ebp)
- pushl %eax
- call *8(%ebp)
-
- # Return stack to previous state and call the function
- addl $8,%esp
-
- # Handle fastcall and thiscall
- cmpl $3, 16(%ebp) # FFI_THISCALL
- jz .do_thiscall
- cmpl $4, 16(%ebp) # FFI_FASTCALL
- jnz .do_fncall
- movl (%esp), %ecx
- movl 4(%esp), %edx
- addl $8, %esp
- jmp .do_fncall
-.do_thiscall:
- movl (%esp), %ecx
- addl $4, %esp
-
-.do_fncall:
-
- # FIXME: Align the stack to a 128-bit boundary to avoid
- # potential performance hits.
-
- call *32(%ebp)
-
- # stdcall functions pop arguments off the stack themselves
-
- # Load %ecx with the return type code
- movl 24(%ebp),%ecx
-
- # If the return value pointer is NULL, assume no return value.
- cmpl $0,28(%ebp)
- jne 0f
-
- # Even if there is no space for the return value, we are
- # obliged to handle floating-point values.
- cmpl $FFI_TYPE_FLOAT,%ecx
- jne .Lnoretval
- fstp %st(0)
-
- jmp .Lepilogue
-
-0:
- call 1f
- # Do not insert anything here between the call and the jump table.
-.Lstore_table:
- .long .Lnoretval-.Lstore_table /* FFI_TYPE_VOID */
- .long .Lretint-.Lstore_table /* FFI_TYPE_INT */
- .long .Lretfloat-.Lstore_table /* FFI_TYPE_FLOAT */
- .long .Lretdouble-.Lstore_table /* FFI_TYPE_DOUBLE */
- .long .Lretlongdouble-.Lstore_table /* FFI_TYPE_LONGDOUBLE */
- .long .Lretuint8-.Lstore_table /* FFI_TYPE_UINT8 */
- .long .Lretsint8-.Lstore_table /* FFI_TYPE_SINT8 */
- .long .Lretuint16-.Lstore_table /* FFI_TYPE_UINT16 */
- .long .Lretsint16-.Lstore_table /* FFI_TYPE_SINT16 */
- .long .Lretint-.Lstore_table /* FFI_TYPE_UINT32 */
- .long .Lretint-.Lstore_table /* FFI_TYPE_SINT32 */
- .long .Lretint64-.Lstore_table /* FFI_TYPE_UINT64 */
- .long .Lretint64-.Lstore_table /* FFI_TYPE_SINT64 */
- .long .Lretstruct-.Lstore_table /* FFI_TYPE_STRUCT */
- .long .Lretint-.Lstore_table /* FFI_TYPE_POINTER */
- .long .Lretstruct1b-.Lstore_table /* FFI_TYPE_SMALL_STRUCT_1B */
- .long .Lretstruct2b-.Lstore_table /* FFI_TYPE_SMALL_STRUCT_2B */
- .long .Lretstruct4b-.Lstore_table /* FFI_TYPE_SMALL_STRUCT_4B */
- .long .Lretstruct-.Lstore_table /* FFI_TYPE_MS_STRUCT */
-1:
- shl $2, %ecx
- add (%esp),%ecx
- mov (%ecx),%ecx
- add (%esp),%ecx
- add $4, %esp
- jmp *%ecx
-
- /* Sign/zero extend as appropriate. */
-.Lretsint8:
- movsbl %al, %eax
- jmp .Lretint
-
-.Lretsint16:
- movswl %ax, %eax
- jmp .Lretint
-
-.Lretuint8:
- movzbl %al, %eax
- jmp .Lretint
-
-.Lretuint16:
- movzwl %ax, %eax
- jmp .Lretint
-
-.Lretint:
- # Load %ecx with the pointer to storage for the return value
- movl 28(%ebp),%ecx
- movl %eax,0(%ecx)
- jmp .Lepilogue
-
-.Lretfloat:
- # Load %ecx with the pointer to storage for the return value
- movl 28(%ebp),%ecx
- fstps (%ecx)
- jmp .Lepilogue
-
-.Lretdouble:
- # Load %ecx with the pointer to storage for the return value
- movl 28(%ebp),%ecx
- fstpl (%ecx)
- jmp .Lepilogue
-
-.Lretlongdouble:
- # Load %ecx with the pointer to storage for the return value
- movl 28(%ebp),%ecx
- fstpt (%ecx)
- jmp .Lepilogue
-
-.Lretint64:
- # Load %ecx with the pointer to storage for the return value
- movl 28(%ebp),%ecx
- movl %eax,0(%ecx)
- movl %edx,4(%ecx)
- jmp .Lepilogue
-
-.Lretstruct1b:
- # Load %ecx with the pointer to storage for the return value
- movl 28(%ebp),%ecx
- movb %al,0(%ecx)
- jmp .Lepilogue
-
-.Lretstruct2b:
- # Load %ecx with the pointer to storage for the return value
- movl 28(%ebp),%ecx
- movw %ax,0(%ecx)
- jmp .Lepilogue
-
-.Lretstruct4b:
- # Load %ecx with the pointer to storage for the return value
- movl 28(%ebp),%ecx
- movl %eax,0(%ecx)
- jmp .Lepilogue
-
-.Lretstruct:
- # Nothing to do!
-
-.Lnoretval:
-.Lepilogue:
- movl %ebp,%esp
- popl %ebp
- ret
-.ffi_call_win32_end:
- .balign 16
-FFI_HIDDEN(ffi_closure_THISCALL)
- .globl USCORE_SYMBOL(ffi_closure_THISCALL)
-#if defined(X86_WIN32) && !defined(__OS2__)
- .def _ffi_closure_THISCALL; .scl 2; .type 32; .endef
-#endif
-USCORE_SYMBOL(ffi_closure_THISCALL):
- /* Insert the register argument on the stack as the first argument */
- xchg %ecx, 4(%esp)
- xchg %ecx, (%esp)
- push %ecx
- jmp .ffi_closure_STDCALL_internal
-
- .balign 16
-FFI_HIDDEN(ffi_closure_FASTCALL)
- .globl USCORE_SYMBOL(ffi_closure_FASTCALL)
-#if defined(X86_WIN32) && !defined(__OS2__)
- .def _ffi_closure_FASTCALL; .scl 2; .type 32; .endef
-#endif
-USCORE_SYMBOL(ffi_closure_FASTCALL):
- /* Insert the register arguments on the stack as the first two arguments */
- xchg %edx, 4(%esp)
- xchg %ecx, (%esp)
- push %edx
- push %ecx
- jmp .ffi_closure_STDCALL_internal
-.LFE1:
-
- # This assumes we are using gas.
- .balign 16
-FFI_HIDDEN(ffi_closure_SYSV)
-#if defined(X86_WIN32)
- .globl USCORE_SYMBOL(ffi_closure_SYSV)
-#if defined(X86_WIN32) && !defined(__OS2__)
- .def _ffi_closure_SYSV; .scl 2; .type 32; .endef
-#endif
-USCORE_SYMBOL(ffi_closure_SYSV):
-#endif
-.LFB3:
- pushl %ebp
-.LCFI4:
- movl %esp, %ebp
-.LCFI5:
- subl $40, %esp
- leal -24(%ebp), %edx
- movl %edx, -12(%ebp) /* resp */
- leal 8(%ebp), %edx
- movl %edx, 4(%esp) /* args = __builtin_dwarf_cfa () */
- leal -12(%ebp), %edx
- movl %edx, (%esp) /* &resp */
-#if defined(HAVE_HIDDEN_VISIBILITY_ATTRIBUTE) || !defined(__PIC__)
- call USCORE_SYMBOL(ffi_closure_SYSV_inner)
-#elif defined(X86_DARWIN)
- calll L_ffi_closure_SYSV_inner$stub
-#else
- movl %ebx, 8(%esp)
- call 1f
-1: popl %ebx
- addl $_GLOBAL_OFFSET_TABLE_+[.-1b], %ebx
- call ffi_closure_SYSV_inner@PLT
- movl 8(%esp), %ebx
-#endif
- movl -12(%ebp), %ecx
-
-0:
- call 1f
- # Do not insert anything here between the call and the jump table.
-.Lcls_store_table:
- .long .Lcls_noretval-.Lcls_store_table /* FFI_TYPE_VOID */
- .long .Lcls_retint-.Lcls_store_table /* FFI_TYPE_INT */
- .long .Lcls_retfloat-.Lcls_store_table /* FFI_TYPE_FLOAT */
- .long .Lcls_retdouble-.Lcls_store_table /* FFI_TYPE_DOUBLE */
- .long .Lcls_retldouble-.Lcls_store_table /* FFI_TYPE_LONGDOUBLE */
- .long .Lcls_retuint8-.Lcls_store_table /* FFI_TYPE_UINT8 */
- .long .Lcls_retsint8-.Lcls_store_table /* FFI_TYPE_SINT8 */
- .long .Lcls_retuint16-.Lcls_store_table /* FFI_TYPE_UINT16 */
- .long .Lcls_retsint16-.Lcls_store_table /* FFI_TYPE_SINT16 */
- .long .Lcls_retint-.Lcls_store_table /* FFI_TYPE_UINT32 */
- .long .Lcls_retint-.Lcls_store_table /* FFI_TYPE_SINT32 */
- .long .Lcls_retllong-.Lcls_store_table /* FFI_TYPE_UINT64 */
- .long .Lcls_retllong-.Lcls_store_table /* FFI_TYPE_SINT64 */
- .long .Lcls_retstruct-.Lcls_store_table /* FFI_TYPE_STRUCT */
- .long .Lcls_retint-.Lcls_store_table /* FFI_TYPE_POINTER */
- .long .Lcls_retstruct1-.Lcls_store_table /* FFI_TYPE_SMALL_STRUCT_1B */
- .long .Lcls_retstruct2-.Lcls_store_table /* FFI_TYPE_SMALL_STRUCT_2B */
- .long .Lcls_retstruct4-.Lcls_store_table /* FFI_TYPE_SMALL_STRUCT_4B */
- .long .Lcls_retmsstruct-.Lcls_store_table /* FFI_TYPE_MS_STRUCT */
-
-1:
- shl $2, %eax
- add (%esp),%eax
- mov (%eax),%eax
- add (%esp),%eax
- add $4, %esp
- jmp *%eax
-
- /* Sign/zero extend as appropriate. */
-.Lcls_retsint8:
- movsbl (%ecx), %eax
- jmp .Lcls_epilogue
-
-.Lcls_retsint16:
- movswl (%ecx), %eax
- jmp .Lcls_epilogue
-
-.Lcls_retuint8:
- movzbl (%ecx), %eax
- jmp .Lcls_epilogue
-
-.Lcls_retuint16:
- movzwl (%ecx), %eax
- jmp .Lcls_epilogue
-
-.Lcls_retint:
- movl (%ecx), %eax
- jmp .Lcls_epilogue
-
-.Lcls_retfloat:
- flds (%ecx)
- jmp .Lcls_epilogue
-
-.Lcls_retdouble:
- fldl (%ecx)
- jmp .Lcls_epilogue
-
-.Lcls_retldouble:
- fldt (%ecx)
- jmp .Lcls_epilogue
-
-.Lcls_retllong:
- movl (%ecx), %eax
- movl 4(%ecx), %edx
- jmp .Lcls_epilogue
-
-.Lcls_retstruct1:
- movsbl (%ecx), %eax
- jmp .Lcls_epilogue
-
-.Lcls_retstruct2:
- movswl (%ecx), %eax
- jmp .Lcls_epilogue
-
-.Lcls_retstruct4:
- movl (%ecx), %eax
- jmp .Lcls_epilogue
-
-.Lcls_retstruct:
- # Caller expects us to pop struct return value pointer hidden arg.
- movl %ebp, %esp
- popl %ebp
- ret $0x4
-
-.Lcls_retmsstruct:
- # Caller expects us to return a pointer to the real return value.
- mov %ecx, %eax
- # Caller doesn't expects us to pop struct return value pointer hidden arg.
- jmp .Lcls_epilogue
-
-.Lcls_noretval:
-.Lcls_epilogue:
- movl %ebp, %esp
- popl %ebp
- ret
-.ffi_closure_SYSV_end:
-.LFE3:
-
-#if !FFI_NO_RAW_API
-
-#define RAW_CLOSURE_CIF_OFFSET ((FFI_TRAMPOLINE_SIZE + 3) & ~3)
-#define RAW_CLOSURE_FUN_OFFSET (RAW_CLOSURE_CIF_OFFSET + 4)
-#define RAW_CLOSURE_USER_DATA_OFFSET (RAW_CLOSURE_FUN_OFFSET + 4)
-#define CIF_FLAGS_OFFSET 20
-
-#ifdef X86_WIN32
- .balign 16
-FFI_HIDDEN(ffi_closure_raw_THISCALL)
- .globl USCORE_SYMBOL(ffi_closure_raw_THISCALL)
-#if defined(X86_WIN32) && !defined(__OS2__)
- .def _ffi_closure_raw_THISCALL; .scl 2; .type 32; .endef
-#endif
-USCORE_SYMBOL(ffi_closure_raw_THISCALL):
- pushl %ebp
- movl %esp, %ebp
- pushl %esi
- subl $36, %esp
- movl RAW_CLOSURE_CIF_OFFSET(%eax), %esi /* closure->cif */
- movl RAW_CLOSURE_USER_DATA_OFFSET(%eax), %edx /* closure->user_data */
- movl %edx, 12(%esp) /* user_data */
- leal 12(%ebp), %edx /* __builtin_dwarf_cfa () */
- jmp .stubraw
-#endif /* X86_WIN32 */
-
- # This assumes we are using gas.
- .balign 16
-#if defined(X86_WIN32)
- .globl USCORE_SYMBOL(ffi_closure_raw_SYSV)
-#if defined(X86_WIN32) && !defined(__OS2__)
- .def _ffi_closure_raw_SYSV; .scl 2; .type 32; .endef
-#endif
-USCORE_SYMBOL(ffi_closure_raw_SYSV):
-#endif /* defined(X86_WIN32) */
-.LFB4:
- pushl %ebp
-.LCFI6:
- movl %esp, %ebp
-.LCFI7:
- pushl %esi
-.LCFI8:
- subl $36, %esp
- movl RAW_CLOSURE_CIF_OFFSET(%eax), %esi /* closure->cif */
- movl RAW_CLOSURE_USER_DATA_OFFSET(%eax), %edx /* closure->user_data */
- movl %edx, 12(%esp) /* user_data */
- leal 8(%ebp), %edx /* __builtin_dwarf_cfa () */
-.stubraw:
- movl %edx, 8(%esp) /* raw_args */
- leal -24(%ebp), %edx
- movl %edx, 4(%esp) /* &res */
- movl %esi, (%esp) /* cif */
- call *RAW_CLOSURE_FUN_OFFSET(%eax) /* closure->fun */
- movl CIF_FLAGS_OFFSET(%esi), %eax /* rtype */
-0:
- call 1f
- # Do not insert anything here between the call and the jump table.
-.Lrcls_store_table:
- .long .Lrcls_noretval-.Lrcls_store_table /* FFI_TYPE_VOID */
- .long .Lrcls_retint-.Lrcls_store_table /* FFI_TYPE_INT */
- .long .Lrcls_retfloat-.Lrcls_store_table /* FFI_TYPE_FLOAT */
- .long .Lrcls_retdouble-.Lrcls_store_table /* FFI_TYPE_DOUBLE */
- .long .Lrcls_retldouble-.Lrcls_store_table /* FFI_TYPE_LONGDOUBLE */
- .long .Lrcls_retuint8-.Lrcls_store_table /* FFI_TYPE_UINT8 */
- .long .Lrcls_retsint8-.Lrcls_store_table /* FFI_TYPE_SINT8 */
- .long .Lrcls_retuint16-.Lrcls_store_table /* FFI_TYPE_UINT16 */
- .long .Lrcls_retsint16-.Lrcls_store_table /* FFI_TYPE_SINT16 */
- .long .Lrcls_retint-.Lrcls_store_table /* FFI_TYPE_UINT32 */
- .long .Lrcls_retint-.Lrcls_store_table /* FFI_TYPE_SINT32 */
- .long .Lrcls_retllong-.Lrcls_store_table /* FFI_TYPE_UINT64 */
- .long .Lrcls_retllong-.Lrcls_store_table /* FFI_TYPE_SINT64 */
- .long .Lrcls_retstruct-.Lrcls_store_table /* FFI_TYPE_STRUCT */
- .long .Lrcls_retint-.Lrcls_store_table /* FFI_TYPE_POINTER */
- .long .Lrcls_retstruct1-.Lrcls_store_table /* FFI_TYPE_SMALL_STRUCT_1B */
- .long .Lrcls_retstruct2-.Lrcls_store_table /* FFI_TYPE_SMALL_STRUCT_2B */
- .long .Lrcls_retstruct4-.Lrcls_store_table /* FFI_TYPE_SMALL_STRUCT_4B */
- .long .Lrcls_retstruct-.Lrcls_store_table /* FFI_TYPE_MS_STRUCT */
-1:
- shl $2, %eax
- add (%esp),%eax
- mov (%eax),%eax
- add (%esp),%eax
- add $4, %esp
- jmp *%eax
-
- /* Sign/zero extend as appropriate. */
-.Lrcls_retsint8:
- movsbl -24(%ebp), %eax
- jmp .Lrcls_epilogue
-
-.Lrcls_retsint16:
- movswl -24(%ebp), %eax
- jmp .Lrcls_epilogue
-
-.Lrcls_retuint8:
- movzbl -24(%ebp), %eax
- jmp .Lrcls_epilogue
-
-.Lrcls_retuint16:
- movzwl -24(%ebp), %eax
- jmp .Lrcls_epilogue
-
-.Lrcls_retint:
- movl -24(%ebp), %eax
- jmp .Lrcls_epilogue
-
-.Lrcls_retfloat:
- flds -24(%ebp)
- jmp .Lrcls_epilogue
-
-.Lrcls_retdouble:
- fldl -24(%ebp)
- jmp .Lrcls_epilogue
-
-.Lrcls_retldouble:
- fldt -24(%ebp)
- jmp .Lrcls_epilogue
-
-.Lrcls_retllong:
- movl -24(%ebp), %eax
- movl -20(%ebp), %edx
- jmp .Lrcls_epilogue
-
-.Lrcls_retstruct1:
- movsbl -24(%ebp), %eax
- jmp .Lrcls_epilogue
-
-.Lrcls_retstruct2:
- movswl -24(%ebp), %eax
- jmp .Lrcls_epilogue
-
-.Lrcls_retstruct4:
- movl -24(%ebp), %eax
- jmp .Lrcls_epilogue
-
-.Lrcls_retstruct:
- # Nothing to do!
-
-.Lrcls_noretval:
-.Lrcls_epilogue:
- addl $36, %esp
- popl %esi
- popl %ebp
- ret
-.ffi_closure_raw_SYSV_end:
-.LFE4:
-
-#endif /* !FFI_NO_RAW_API */
-
- # This assumes we are using gas.
- .balign 16
-FFI_HIDDEN(ffi_closure_STDCALL)
- .globl USCORE_SYMBOL(ffi_closure_STDCALL)
-#if defined(X86_WIN32) && !defined(__OS2__)
- .def _ffi_closure_STDCALL; .scl 2; .type 32; .endef
-#endif
-USCORE_SYMBOL(ffi_closure_STDCALL):
-.ffi_closure_STDCALL_internal:
-.LFB5:
- pushl %ebp
-.LCFI9:
- movl %esp, %ebp
-.LCFI10:
- subl $40, %esp
- leal -24(%ebp), %edx
- movl %edx, -12(%ebp) /* resp */
- leal 12(%ebp), %edx /* account for stub return address on stack */
- movl %edx, 4(%esp) /* args */
- leal -12(%ebp), %edx
- movl %edx, (%esp) /* &resp */
-#if defined(HAVE_HIDDEN_VISIBILITY_ATTRIBUTE) || !defined(__PIC__)
- call USCORE_SYMBOL(ffi_closure_SYSV_inner)
-#elif defined(X86_DARWIN)
- calll L_ffi_closure_SYSV_inner$stub
-#else
- movl %ebx, 8(%esp)
- call 1f
-1: popl %ebx
- addl $_GLOBAL_OFFSET_TABLE_+[.-1b], %ebx
- call ffi_closure_SYSV_inner@PLT
- movl 8(%esp), %ebx
-#endif
- movl -12(%ebp), %ecx
-0:
- call 1f
- # Do not insert anything here between the call and the jump table.
-.Lscls_store_table:
- .long .Lscls_noretval-.Lscls_store_table /* FFI_TYPE_VOID */
- .long .Lscls_retint-.Lscls_store_table /* FFI_TYPE_INT */
- .long .Lscls_retfloat-.Lscls_store_table /* FFI_TYPE_FLOAT */
- .long .Lscls_retdouble-.Lscls_store_table /* FFI_TYPE_DOUBLE */
- .long .Lscls_retldouble-.Lscls_store_table /* FFI_TYPE_LONGDOUBLE */
- .long .Lscls_retuint8-.Lscls_store_table /* FFI_TYPE_UINT8 */
- .long .Lscls_retsint8-.Lscls_store_table /* FFI_TYPE_SINT8 */
- .long .Lscls_retuint16-.Lscls_store_table /* FFI_TYPE_UINT16 */
- .long .Lscls_retsint16-.Lscls_store_table /* FFI_TYPE_SINT16 */
- .long .Lscls_retint-.Lscls_store_table /* FFI_TYPE_UINT32 */
- .long .Lscls_retint-.Lscls_store_table /* FFI_TYPE_SINT32 */
- .long .Lscls_retllong-.Lscls_store_table /* FFI_TYPE_UINT64 */
- .long .Lscls_retllong-.Lscls_store_table /* FFI_TYPE_SINT64 */
- .long .Lscls_retstruct-.Lscls_store_table /* FFI_TYPE_STRUCT */
- .long .Lscls_retint-.Lscls_store_table /* FFI_TYPE_POINTER */
- .long .Lscls_retstruct1-.Lscls_store_table /* FFI_TYPE_SMALL_STRUCT_1B */
- .long .Lscls_retstruct2-.Lscls_store_table /* FFI_TYPE_SMALL_STRUCT_2B */
- .long .Lscls_retstruct4-.Lscls_store_table /* FFI_TYPE_SMALL_STRUCT_4B */
-1:
- shl $2, %eax
- add (%esp),%eax
- mov (%eax),%eax
- add (%esp),%eax
- add $4, %esp
- jmp *%eax
-
- /* Sign/zero extend as appropriate. */
-.Lscls_retsint8:
- movsbl (%ecx), %eax
- jmp .Lscls_epilogue
-
-.Lscls_retsint16:
- movswl (%ecx), %eax
- jmp .Lscls_epilogue
-
-.Lscls_retuint8:
- movzbl (%ecx), %eax
- jmp .Lscls_epilogue
-
-.Lscls_retuint16:
- movzwl (%ecx), %eax
- jmp .Lscls_epilogue
-
-.Lscls_retint:
- movl (%ecx), %eax
- jmp .Lscls_epilogue
-
-.Lscls_retfloat:
- flds (%ecx)
- jmp .Lscls_epilogue
-
-.Lscls_retdouble:
- fldl (%ecx)
- jmp .Lscls_epilogue
-
-.Lscls_retldouble:
- fldt (%ecx)
- jmp .Lscls_epilogue
-
-.Lscls_retllong:
- movl (%ecx), %eax
- movl 4(%ecx), %edx
- jmp .Lscls_epilogue
-
-.Lscls_retstruct1:
- movsbl (%ecx), %eax
- jmp .Lscls_epilogue
-
-.Lscls_retstruct2:
- movswl (%ecx), %eax
- jmp .Lscls_epilogue
-
-.Lscls_retstruct4:
- movl (%ecx), %eax
- jmp .Lscls_epilogue
-
-.Lscls_retstruct:
- # Nothing to do!
-
-.Lscls_noretval:
-.Lscls_epilogue:
- movl %ebp, %esp
- popl %ebp
- popl %ecx
- popl %edx
- movl (CLOSURE_CIF_OFFSET-10)(%ecx), %ecx
- addl CIF_BYTES_OFFSET(%ecx), %esp
- movl CIF_ABI_OFFSET(%ecx), %ecx
- cmpl $3, %ecx /* FFI_THISCALL */
- je 1f
- cmpl $4, %ecx /* FFI_FASTCALL */
- jne 2f
-
- addl $4, %esp
-1: addl $4, %esp
-2: jmp *%edx
-.ffi_closure_STDCALL_end:
-.LFE5:
-
-#if defined(X86_DARWIN)
-.section __IMPORT,__jump_table,symbol_stubs,self_modifying_code+pure_instructions,5
-L_ffi_closure_SYSV_inner$stub:
- .indirect_symbol _ffi_closure_SYSV_inner
- hlt ; hlt ; hlt ; hlt ; hlt
-#endif
-
-#if defined(X86_WIN32) && !defined(__OS2__)
- .section .eh_frame,"w"
-#endif
-.Lframe1:
-.LSCIE1:
- .long .LECIE1-.LASCIE1 /* Length of Common Information Entry */
-.LASCIE1:
- .long 0x0 /* CIE Identifier Tag */
- .byte 0x1 /* CIE Version */
-#ifdef __PIC__
- .ascii "zR\0" /* CIE Augmentation */
-#else
- .ascii "\0" /* CIE Augmentation */
-#endif
- .byte 0x1 /* .uleb128 0x1; CIE Code Alignment Factor */
- .byte 0x7c /* .sleb128 -4; CIE Data Alignment Factor */
- .byte 0x8 /* CIE RA Column */
-#ifdef __PIC__
- .byte 0x1 /* .uleb128 0x1; Augmentation size */
- .byte 0x1b /* FDE Encoding (pcrel sdata4) */
-#endif
- .byte 0xc /* DW_CFA_def_cfa CFA = r4 + 4 = 4(%esp) */
- .byte 0x4 /* .uleb128 0x4 */
- .byte 0x4 /* .uleb128 0x4 */
- .byte 0x88 /* DW_CFA_offset, column 0x8 %eip at CFA + 1 * -4 */
- .byte 0x1 /* .uleb128 0x1 */
- .align 4
-.LECIE1:
-
-.LSFDE1:
- .long .LEFDE1-.LASFDE1 /* FDE Length */
-.LASFDE1:
- .long .LASFDE1-.Lframe1 /* FDE CIE offset */
-#if defined __PIC__ && defined HAVE_AS_X86_PCREL
- .long .LFB1-. /* FDE initial location */
-#else
- .long .LFB1
-#endif
- .long .LFE1-.LFB1 /* FDE address range */
-#ifdef __PIC__
- .byte 0x0 /* .uleb128 0x0; Augmentation size */
-#endif
- /* DW_CFA_xxx CFI instructions go here. */
-
- .byte 0x4 /* DW_CFA_advance_loc4 */
- .long .LCFI0-.LFB1
- .byte 0xe /* DW_CFA_def_cfa_offset CFA = r4 + 8 = 8(%esp) */
- .byte 0x8 /* .uleb128 0x8 */
- .byte 0x85 /* DW_CFA_offset, column 0x5 %ebp at CFA + 2 * -4 */
- .byte 0x2 /* .uleb128 0x2 */
-
- .byte 0x4 /* DW_CFA_advance_loc4 */
- .long .LCFI1-.LCFI0
- .byte 0xd /* DW_CFA_def_cfa_register CFA = r5 = %ebp */
- .byte 0x5 /* .uleb128 0x5 */
-
- /* End of DW_CFA_xxx CFI instructions. */
- .align 4
-.LEFDE1:
-
-.LSFDE3:
- .long .LEFDE3-.LASFDE3 /* FDE Length */
-.LASFDE3:
- .long .LASFDE3-.Lframe1 /* FDE CIE offset */
-#if defined __PIC__ && defined HAVE_AS_X86_PCREL
- .long .LFB3-. /* FDE initial location */
-#else
- .long .LFB3
-#endif
- .long .LFE3-.LFB3 /* FDE address range */
-#ifdef __PIC__
- .byte 0x0 /* .uleb128 0x0; Augmentation size */
-#endif
- /* DW_CFA_xxx CFI instructions go here. */
-
- .byte 0x4 /* DW_CFA_advance_loc4 */
- .long .LCFI4-.LFB3
- .byte 0xe /* DW_CFA_def_cfa_offset CFA = r4 + 8 = 8(%esp) */
- .byte 0x8 /* .uleb128 0x8 */
- .byte 0x85 /* DW_CFA_offset, column 0x5 %ebp at CFA + 2 * -4 */
- .byte 0x2 /* .uleb128 0x2 */
-
- .byte 0x4 /* DW_CFA_advance_loc4 */
- .long .LCFI5-.LCFI4
- .byte 0xd /* DW_CFA_def_cfa_register CFA = r5 = %ebp */
- .byte 0x5 /* .uleb128 0x5 */
-
- /* End of DW_CFA_xxx CFI instructions. */
- .align 4
-.LEFDE3:
-
-#if !FFI_NO_RAW_API
-
-.LSFDE4:
- .long .LEFDE4-.LASFDE4 /* FDE Length */
-.LASFDE4:
- .long .LASFDE4-.Lframe1 /* FDE CIE offset */
-#if defined __PIC__ && defined HAVE_AS_X86_PCREL
- .long .LFB4-. /* FDE initial location */
-#else
- .long .LFB4
-#endif
- .long .LFE4-.LFB4 /* FDE address range */
-#ifdef __PIC__
- .byte 0x0 /* .uleb128 0x0; Augmentation size */
-#endif
- /* DW_CFA_xxx CFI instructions go here. */
-
- .byte 0x4 /* DW_CFA_advance_loc4 */
- .long .LCFI6-.LFB4
- .byte 0xe /* DW_CFA_def_cfa_offset CFA = r4 + 8 = 8(%esp) */
- .byte 0x8 /* .uleb128 0x8 */
- .byte 0x85 /* DW_CFA_offset, column 0x5 %ebp at CFA + 2 * -4 */
- .byte 0x2 /* .uleb128 0x2 */
-
- .byte 0x4 /* DW_CFA_advance_loc4 */
- .long .LCFI7-.LCFI6
- .byte 0xd /* DW_CFA_def_cfa_register CFA = r5 = %ebp */
- .byte 0x5 /* .uleb128 0x5 */
-
- .byte 0x4 /* DW_CFA_advance_loc4 */
- .long .LCFI8-.LCFI7
- .byte 0x86 /* DW_CFA_offset, column 0x6 %esi at CFA + 3 * -4 */
- .byte 0x3 /* .uleb128 0x3 */
-
- /* End of DW_CFA_xxx CFI instructions. */
- .align 4
-.LEFDE4:
-
-#endif /* !FFI_NO_RAW_API */
-
-.LSFDE5:
- .long .LEFDE5-.LASFDE5 /* FDE Length */
-.LASFDE5:
- .long .LASFDE5-.Lframe1 /* FDE CIE offset */
-#if defined __PIC__ && defined HAVE_AS_X86_PCREL
- .long .LFB5-. /* FDE initial location */
-#else
- .long .LFB5
-#endif
- .long .LFE5-.LFB5 /* FDE address range */
-#ifdef __PIC__
- .byte 0x0 /* .uleb128 0x0; Augmentation size */
-#endif
- /* DW_CFA_xxx CFI instructions go here. */
-
- .byte 0x4 /* DW_CFA_advance_loc4 */
- .long .LCFI9-.LFB5
- .byte 0xe /* DW_CFA_def_cfa_offset CFA = r4 + 8 = 8(%esp) */
- .byte 0x8 /* .uleb128 0x8 */
- .byte 0x85 /* DW_CFA_offset, column 0x5 %ebp at CFA + 2 * -4 */
- .byte 0x2 /* .uleb128 0x2 */
-
- .byte 0x4 /* DW_CFA_advance_loc4 */
- .long .LCFI10-.LCFI9
- .byte 0xd /* DW_CFA_def_cfa_register CFA = r5 = %ebp */
- .byte 0x5 /* .uleb128 0x5 */
-
- /* End of DW_CFA_xxx CFI instructions. */
- .align 4
-.LEFDE5:
-
-#endif /* !_MSC_VER */
-
diff --git a/Modules/_ctypes/libffi/src/x86/win64.S b/Modules/_ctypes/libffi/src/x86/win64.S
deleted file mode 100644
index fcdb270faf..0000000000
--- a/Modules/_ctypes/libffi/src/x86/win64.S
+++ /dev/null
@@ -1,468 +0,0 @@
-#define LIBFFI_ASM
-#include <fficonfig.h>
-#include <ffi.h>
-
-/* Constants for ffi_call_win64 */
-#define STACK 0
-#define PREP_ARGS_FN 32
-#define ECIF 40
-#define CIF_BYTES 48
-#define CIF_FLAGS 56
-#define RVALUE 64
-#define FN 72
-
-/* ffi_call_win64 (void (*prep_args_fn)(char *, extended_cif *),
- extended_cif *ecif, unsigned bytes, unsigned flags,
- unsigned *rvalue, void (*fn)());
- */
-
-#ifdef _MSC_VER
-PUBLIC ffi_call_win64
-
-EXTRN __chkstk:NEAR
-EXTRN ffi_closure_win64_inner:NEAR
-
-_TEXT SEGMENT
-
-;;; ffi_closure_win64 will be called with these registers set:
-;;; rax points to 'closure'
-;;; r11 contains a bit mask that specifies which of the
-;;; first four parameters are float or double
-;;;
-;;; It must move the parameters passed in registers to their stack location,
-;;; call ffi_closure_win64_inner for the actual work, then return the result.
-;;;
-ffi_closure_win64 PROC FRAME
- ;; copy register arguments onto stack
- test r11, 1
- jne first_is_float
- mov QWORD PTR [rsp+8], rcx
- jmp second
-first_is_float:
- movlpd QWORD PTR [rsp+8], xmm0
-
-second:
- test r11, 2
- jne second_is_float
- mov QWORD PTR [rsp+16], rdx
- jmp third
-second_is_float:
- movlpd QWORD PTR [rsp+16], xmm1
-
-third:
- test r11, 4
- jne third_is_float
- mov QWORD PTR [rsp+24], r8
- jmp fourth
-third_is_float:
- movlpd QWORD PTR [rsp+24], xmm2
-
-fourth:
- test r11, 8
- jne fourth_is_float
- mov QWORD PTR [rsp+32], r9
- jmp done
-fourth_is_float:
- movlpd QWORD PTR [rsp+32], xmm3
-
-done:
- .ALLOCSTACK 40
- sub rsp, 40
- .ENDPROLOG
- mov rcx, rax ; context is first parameter
- mov rdx, rsp ; stack is second parameter
- add rdx, 48 ; point to start of arguments
- mov rax, ffi_closure_win64_inner
- call rax ; call the real closure function
- add rsp, 40
- movd xmm0, rax ; If the closure returned a float,
- ; ffi_closure_win64_inner wrote it to rax
- ret 0
-ffi_closure_win64 ENDP
-
-ffi_call_win64 PROC FRAME
- ;; copy registers onto stack
- mov QWORD PTR [rsp+32], r9
- mov QWORD PTR [rsp+24], r8
- mov QWORD PTR [rsp+16], rdx
- mov QWORD PTR [rsp+8], rcx
- .PUSHREG rbp
- push rbp
- .ALLOCSTACK 48
- sub rsp, 48 ; 00000030H
- .SETFRAME rbp, 32
- lea rbp, QWORD PTR [rsp+32]
- .ENDPROLOG
-
- mov eax, DWORD PTR CIF_BYTES[rbp]
- add rax, 15
- and rax, -16
- call __chkstk
- sub rsp, rax
- lea rax, QWORD PTR [rsp+32]
- mov QWORD PTR STACK[rbp], rax
-
- mov rdx, QWORD PTR ECIF[rbp]
- mov rcx, QWORD PTR STACK[rbp]
- call QWORD PTR PREP_ARGS_FN[rbp]
-
- mov rsp, QWORD PTR STACK[rbp]
-
- movlpd xmm3, QWORD PTR [rsp+24]
- movd r9, xmm3
-
- movlpd xmm2, QWORD PTR [rsp+16]
- movd r8, xmm2
-
- movlpd xmm1, QWORD PTR [rsp+8]
- movd rdx, xmm1
-
- movlpd xmm0, QWORD PTR [rsp]
- movd rcx, xmm0
-
- call QWORD PTR FN[rbp]
-ret_struct4b$:
- cmp DWORD PTR CIF_FLAGS[rbp], FFI_TYPE_SMALL_STRUCT_4B
- jne ret_struct2b$
-
- mov rcx, QWORD PTR RVALUE[rbp]
- mov DWORD PTR [rcx], eax
- jmp ret_void$
-
-ret_struct2b$:
- cmp DWORD PTR CIF_FLAGS[rbp], FFI_TYPE_SMALL_STRUCT_2B
- jne ret_struct1b$
-
- mov rcx, QWORD PTR RVALUE[rbp]
- mov WORD PTR [rcx], ax
- jmp ret_void$
-
-ret_struct1b$:
- cmp DWORD PTR CIF_FLAGS[rbp], FFI_TYPE_SMALL_STRUCT_1B
- jne ret_uint8$
-
- mov rcx, QWORD PTR RVALUE[rbp]
- mov BYTE PTR [rcx], al
- jmp ret_void$
-
-ret_uint8$:
- cmp DWORD PTR CIF_FLAGS[rbp], FFI_TYPE_UINT8
- jne ret_sint8$
-
- mov rcx, QWORD PTR RVALUE[rbp]
- movzx rax, al
- mov QWORD PTR [rcx], rax
- jmp ret_void$
-
-ret_sint8$:
- cmp DWORD PTR CIF_FLAGS[rbp], FFI_TYPE_SINT8
- jne ret_uint16$
-
- mov rcx, QWORD PTR RVALUE[rbp]
- movsx rax, al
- mov QWORD PTR [rcx], rax
- jmp ret_void$
-
-ret_uint16$:
- cmp DWORD PTR CIF_FLAGS[rbp], FFI_TYPE_UINT16
- jne ret_sint16$
-
- mov rcx, QWORD PTR RVALUE[rbp]
- movzx rax, ax
- mov QWORD PTR [rcx], rax
- jmp SHORT ret_void$
-
-ret_sint16$:
- cmp DWORD PTR CIF_FLAGS[rbp], FFI_TYPE_SINT16
- jne ret_uint32$
-
- mov rcx, QWORD PTR RVALUE[rbp]
- movsx rax, ax
- mov QWORD PTR [rcx], rax
- jmp SHORT ret_void$
-
-ret_uint32$:
- cmp DWORD PTR CIF_FLAGS[rbp], FFI_TYPE_UINT32
- jne ret_sint32$
-
- mov rcx, QWORD PTR RVALUE[rbp]
- mov eax, eax
- mov QWORD PTR [rcx], rax
- jmp SHORT ret_void$
-
-ret_sint32$:
- cmp DWORD PTR CIF_FLAGS[rbp], FFI_TYPE_SINT32
- jne ret_float$
-
- mov rcx, QWORD PTR RVALUE[rbp]
- cdqe
- mov QWORD PTR [rcx], rax
- jmp SHORT ret_void$
-
-ret_float$:
- cmp DWORD PTR CIF_FLAGS[rbp], FFI_TYPE_FLOAT
- jne SHORT ret_double$
-
- mov rax, QWORD PTR RVALUE[rbp]
- movss DWORD PTR [rax], xmm0
- jmp SHORT ret_void$
-
-ret_double$:
- cmp DWORD PTR CIF_FLAGS[rbp], FFI_TYPE_DOUBLE
- jne SHORT ret_sint64$
-
- mov rax, QWORD PTR RVALUE[rbp]
- movlpd QWORD PTR [rax], xmm0
- jmp SHORT ret_void$
-
-ret_sint64$:
- cmp DWORD PTR CIF_FLAGS[rbp], FFI_TYPE_SINT64
- jne ret_void$
-
- mov rcx, QWORD PTR RVALUE[rbp]
- mov QWORD PTR [rcx], rax
- jmp SHORT ret_void$
-
-ret_void$:
- xor rax, rax
-
- lea rsp, QWORD PTR [rbp+16]
- pop rbp
- ret 0
-ffi_call_win64 ENDP
-_TEXT ENDS
-END
-
-#else
-
-#ifdef SYMBOL_UNDERSCORE
-#define SYMBOL_NAME(name) _##name
-#else
-#define SYMBOL_NAME(name) name
-#endif
-
-.text
-
-.extern SYMBOL_NAME(ffi_closure_win64_inner)
-
-# ffi_closure_win64 will be called with these registers set:
-# rax points to 'closure'
-# r11 contains a bit mask that specifies which of the
-# first four parameters are float or double
-#
-# It must move the parameters passed in registers to their stack location,
-# call ffi_closure_win64_inner for the actual work, then return the result.
-#
- .balign 16
- .globl SYMBOL_NAME(ffi_closure_win64)
-SYMBOL_NAME(ffi_closure_win64):
- # copy register arguments onto stack
- test $1,%r11
- jne .Lfirst_is_float
- mov %rcx, 8(%rsp)
- jmp .Lsecond
-.Lfirst_is_float:
- movlpd %xmm0, 8(%rsp)
-
-.Lsecond:
- test $2, %r11
- jne .Lsecond_is_float
- mov %rdx, 16(%rsp)
- jmp .Lthird
-.Lsecond_is_float:
- movlpd %xmm1, 16(%rsp)
-
-.Lthird:
- test $4, %r11
- jne .Lthird_is_float
- mov %r8,24(%rsp)
- jmp .Lfourth
-.Lthird_is_float:
- movlpd %xmm2, 24(%rsp)
-
-.Lfourth:
- test $8, %r11
- jne .Lfourth_is_float
- mov %r9, 32(%rsp)
- jmp .Ldone
-.Lfourth_is_float:
- movlpd %xmm3, 32(%rsp)
-
-.Ldone:
-#.ALLOCSTACK 40
- sub $40, %rsp
-#.ENDPROLOG
- mov %rax, %rcx # context is first parameter
- mov %rsp, %rdx # stack is second parameter
- add $48, %rdx # point to start of arguments
- mov $SYMBOL_NAME(ffi_closure_win64_inner), %rax
- callq *%rax # call the real closure function
- add $40, %rsp
- movq %rax, %xmm0 # If the closure returned a float,
- # ffi_closure_win64_inner wrote it to rax
- retq
-.ffi_closure_win64_end:
-
- .balign 16
- .globl SYMBOL_NAME(ffi_call_win64)
-SYMBOL_NAME(ffi_call_win64):
- # copy registers onto stack
- mov %r9,32(%rsp)
- mov %r8,24(%rsp)
- mov %rdx,16(%rsp)
- mov %rcx,8(%rsp)
- #.PUSHREG rbp
- push %rbp
- #.ALLOCSTACK 48
- sub $48,%rsp
- #.SETFRAME rbp, 32
- lea 32(%rsp),%rbp
- #.ENDPROLOG
-
- mov CIF_BYTES(%rbp),%eax
- add $15, %rax
- and $-16, %rax
- cmpq $0x1000, %rax
- jb Lch_done
-Lch_probe:
- subq $0x1000,%rsp
- orl $0x0, (%rsp)
- subq $0x1000,%rax
- cmpq $0x1000,%rax
- ja Lch_probe
-Lch_done:
- subq %rax, %rsp
- orl $0x0, (%rsp)
- lea 32(%rsp), %rax
- mov %rax, STACK(%rbp)
-
- mov ECIF(%rbp), %rdx
- mov STACK(%rbp), %rcx
- callq *PREP_ARGS_FN(%rbp)
-
- mov STACK(%rbp), %rsp
-
- movlpd 24(%rsp), %xmm3
- movd %xmm3, %r9
-
- movlpd 16(%rsp), %xmm2
- movd %xmm2, %r8
-
- movlpd 8(%rsp), %xmm1
- movd %xmm1, %rdx
-
- movlpd (%rsp), %xmm0
- movd %xmm0, %rcx
-
- callq *FN(%rbp)
-.Lret_struct4b:
- cmpl $FFI_TYPE_SMALL_STRUCT_4B, CIF_FLAGS(%rbp)
- jne .Lret_struct2b
-
- mov RVALUE(%rbp), %rcx
- mov %eax, (%rcx)
- jmp .Lret_void
-
-.Lret_struct2b:
- cmpl $FFI_TYPE_SMALL_STRUCT_2B, CIF_FLAGS(%rbp)
- jne .Lret_struct1b
-
- mov RVALUE(%rbp), %rcx
- mov %ax, (%rcx)
- jmp .Lret_void
-
-.Lret_struct1b:
- cmpl $FFI_TYPE_SMALL_STRUCT_1B, CIF_FLAGS(%rbp)
- jne .Lret_uint8
-
- mov RVALUE(%rbp), %rcx
- mov %al, (%rcx)
- jmp .Lret_void
-
-.Lret_uint8:
- cmpl $FFI_TYPE_UINT8, CIF_FLAGS(%rbp)
- jne .Lret_sint8
-
- mov RVALUE(%rbp), %rcx
- movzbq %al, %rax
- movq %rax, (%rcx)
- jmp .Lret_void
-
-.Lret_sint8:
- cmpl $FFI_TYPE_SINT8, CIF_FLAGS(%rbp)
- jne .Lret_uint16
-
- mov RVALUE(%rbp), %rcx
- movsbq %al, %rax
- movq %rax, (%rcx)
- jmp .Lret_void
-
-.Lret_uint16:
- cmpl $FFI_TYPE_UINT16, CIF_FLAGS(%rbp)
- jne .Lret_sint16
-
- mov RVALUE(%rbp), %rcx
- movzwq %ax, %rax
- movq %rax, (%rcx)
- jmp .Lret_void
-
-.Lret_sint16:
- cmpl $FFI_TYPE_SINT16, CIF_FLAGS(%rbp)
- jne .Lret_uint32
-
- mov RVALUE(%rbp), %rcx
- movswq %ax, %rax
- movq %rax, (%rcx)
- jmp .Lret_void
-
-.Lret_uint32:
- cmpl $FFI_TYPE_UINT32, CIF_FLAGS(%rbp)
- jne .Lret_sint32
-
- mov RVALUE(%rbp), %rcx
- movl %eax, %eax
- movq %rax, (%rcx)
- jmp .Lret_void
-
-.Lret_sint32:
- cmpl $FFI_TYPE_SINT32, CIF_FLAGS(%rbp)
- jne .Lret_float
-
- mov RVALUE(%rbp), %rcx
- cltq
- movq %rax, (%rcx)
- jmp .Lret_void
-
-.Lret_float:
- cmpl $FFI_TYPE_FLOAT, CIF_FLAGS(%rbp)
- jne .Lret_double
-
- mov RVALUE(%rbp), %rax
- movss %xmm0, (%rax)
- jmp .Lret_void
-
-.Lret_double:
- cmpl $FFI_TYPE_DOUBLE, CIF_FLAGS(%rbp)
- jne .Lret_sint64
-
- mov RVALUE(%rbp), %rax
- movlpd %xmm0, (%rax)
- jmp .Lret_void
-
-.Lret_sint64:
- cmpl $FFI_TYPE_SINT64, CIF_FLAGS(%rbp)
- jne .Lret_void
-
- mov RVALUE(%rbp), %rcx
- mov %rax, (%rcx)
- jmp .Lret_void
-
-.Lret_void:
- xor %rax, %rax
-
- lea 16(%rbp), %rsp
- pop %rbp
- retq
-.ffi_call_win64_end:
-#endif /* !_MSC_VER */
-
diff --git a/Modules/_ctypes/libffi/src/xtensa/ffi.c b/Modules/_ctypes/libffi/src/xtensa/ffi.c
deleted file mode 100644
index fd94dafbe3..0000000000
--- a/Modules/_ctypes/libffi/src/xtensa/ffi.c
+++ /dev/null
@@ -1,298 +0,0 @@
-/* -----------------------------------------------------------------------
- ffi.c - Copyright (c) 2013 Tensilica, Inc.
-
- XTENSA Foreign Function Interface
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- ``Software''), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to
- permit persons to whom the Software is furnished to do so, subject to
- the following conditions:
-
- The above copyright notice and this permission notice shall be included
- in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- DEALINGS IN THE SOFTWARE.
- ----------------------------------------------------------------------- */
-
-#include <ffi.h>
-#include <ffi_common.h>
-
-/*
- |----------------------------------------|
- | |
- on entry to ffi_call ----> |----------------------------------------|
- | caller stack frame for registers a0-a3 |
- |----------------------------------------|
- | |
- | additional arguments |
- entry of the function ---> |----------------------------------------|
- | copy of function arguments a2-a7 |
- | - - - - - - - - - - - - - |
- | |
-
- The area below the entry line becomes the new stack frame for the function.
-
-*/
-
-
-#define FFI_TYPE_STRUCT_REGS FFI_TYPE_LAST
-
-
-extern void ffi_call_SYSV(void *rvalue, unsigned rsize, unsigned flags,
- void(*fn)(void), unsigned nbytes, extended_cif*);
-extern void ffi_closure_SYSV(void) FFI_HIDDEN;
-
-ffi_status ffi_prep_cif_machdep(ffi_cif *cif)
-{
- switch(cif->rtype->type) {
- case FFI_TYPE_SINT8:
- case FFI_TYPE_UINT8:
- case FFI_TYPE_SINT16:
- case FFI_TYPE_UINT16:
- cif->flags = cif->rtype->type;
- break;
- case FFI_TYPE_VOID:
- case FFI_TYPE_FLOAT:
- cif->flags = FFI_TYPE_UINT32;
- break;
- case FFI_TYPE_DOUBLE:
- case FFI_TYPE_UINT64:
- case FFI_TYPE_SINT64:
- cif->flags = FFI_TYPE_UINT64; // cif->rtype->type;
- break;
- case FFI_TYPE_STRUCT:
- cif->flags = FFI_TYPE_STRUCT; //_REGS;
- /* Up to 16 bytes are returned in registers */
- if (cif->rtype->size > 4 * 4) {
- /* returned structure is referenced by a register; use 8 bytes
- (including 4 bytes for potential additional alignment) */
- cif->flags = FFI_TYPE_STRUCT;
- cif->bytes += 8;
- }
- break;
-
- default:
- cif->flags = FFI_TYPE_UINT32;
- break;
- }
-
- /* Round the stack up to a full 4 register frame, just in case
- (we use this size in movsp). This way, it's also a multiple of
- 8 bytes for 64-bit arguments. */
- cif->bytes = ALIGN(cif->bytes, 16);
-
- return FFI_OK;
-}
-
-void ffi_prep_args(extended_cif *ecif, unsigned char* stack)
-{
- unsigned int i;
- unsigned long *addr;
- ffi_type **ptr;
-
- union {
- void **v;
- char **c;
- signed char **sc;
- unsigned char **uc;
- signed short **ss;
- unsigned short **us;
- unsigned int **i;
- long long **ll;
- float **f;
- double **d;
- } p_argv;
-
- /* Verify that everything is aligned up properly */
- FFI_ASSERT (((unsigned long) stack & 0x7) == 0);
-
- p_argv.v = ecif->avalue;
- addr = (unsigned long*)stack;
-
- /* structures with a size greater than 16 bytes are passed in memory */
- if (ecif->cif->rtype->type == FFI_TYPE_STRUCT && ecif->cif->rtype->size > 16)
- {
- *addr++ = (unsigned long)ecif->rvalue;
- }
-
- for (i = ecif->cif->nargs, ptr = ecif->cif->arg_types;
- i > 0;
- i--, ptr++, p_argv.v++)
- {
- switch ((*ptr)->type)
- {
- case FFI_TYPE_SINT8:
- *addr++ = **p_argv.sc;
- break;
- case FFI_TYPE_UINT8:
- *addr++ = **p_argv.uc;
- break;
- case FFI_TYPE_SINT16:
- *addr++ = **p_argv.ss;
- break;
- case FFI_TYPE_UINT16:
- *addr++ = **p_argv.us;
- break;
- case FFI_TYPE_FLOAT:
- case FFI_TYPE_INT:
- case FFI_TYPE_UINT32:
- case FFI_TYPE_SINT32:
- case FFI_TYPE_POINTER:
- *addr++ = **p_argv.i;
- break;
- case FFI_TYPE_DOUBLE:
- case FFI_TYPE_UINT64:
- case FFI_TYPE_SINT64:
- if (((unsigned long)addr & 4) != 0)
- addr++;
- *(unsigned long long*)addr = **p_argv.ll;
- addr += sizeof(unsigned long long) / sizeof (addr);
- break;
-
- case FFI_TYPE_STRUCT:
- {
- unsigned long offs;
- unsigned long size;
-
- if (((unsigned long)addr & 4) != 0 && (*ptr)->alignment > 4)
- addr++;
-
- offs = (unsigned long) addr - (unsigned long) stack;
- size = (*ptr)->size;
-
- /* Entire structure must fit the argument registers or referenced */
- if (offs < FFI_REGISTER_NARGS * 4
- && offs + size > FFI_REGISTER_NARGS * 4)
- addr = (unsigned long*) (stack + FFI_REGISTER_NARGS * 4);
-
- memcpy((char*) addr, *p_argv.c, size);
- addr += (size + 3) / 4;
- break;
- }
-
- default:
- FFI_ASSERT(0);
- }
- }
-}
-
-
-void ffi_call(ffi_cif* cif, void(*fn)(void), void *rvalue, void **avalue)
-{
- extended_cif ecif;
- unsigned long rsize = cif->rtype->size;
- int flags = cif->flags;
- void *alloc = NULL;
-
- ecif.cif = cif;
- ecif.avalue = avalue;
-
- /* Note that for structures that are returned in registers (size <= 16 bytes)
- we allocate a temporary buffer and use memcpy to copy it to the final
- destination. The reason is that the target address might be misaligned or
- the length not a multiple of 4 bytes. Handling all those cases would be
- very complex. */
-
- if (flags == FFI_TYPE_STRUCT && (rsize <= 16 || rvalue == NULL))
- {
- alloc = alloca(ALIGN(rsize, 4));
- ecif.rvalue = alloc;
- }
- else
- {
- ecif.rvalue = rvalue;
- }
-
- if (cif->abi != FFI_SYSV)
- FFI_ASSERT(0);
-
- ffi_call_SYSV (ecif.rvalue, rsize, cif->flags, fn, cif->bytes, &ecif);
-
- if (alloc != NULL && rvalue != NULL)
- memcpy(rvalue, alloc, rsize);
-}
-
-extern void ffi_trampoline();
-extern void ffi_cacheflush(void* start, void* end);
-
-ffi_status
-ffi_prep_closure_loc (ffi_closure* closure,
- ffi_cif* cif,
- void (*fun)(ffi_cif*, void*, void**, void*),
- void *user_data,
- void *codeloc)
-{
- /* copye trampoline to stack and patch 'ffi_closure_SYSV' pointer */
- memcpy(closure->tramp, ffi_trampoline, FFI_TRAMPOLINE_SIZE);
- *(unsigned int*)(&closure->tramp[8]) = (unsigned int)ffi_closure_SYSV;
-
- // Do we have this function?
- // __builtin___clear_cache(closer->tramp, closer->tramp + FFI_TRAMPOLINE_SIZE)
- ffi_cacheflush(closure->tramp, closure->tramp + FFI_TRAMPOLINE_SIZE);
-
- closure->cif = cif;
- closure->fun = fun;
- closure->user_data = user_data;
- return FFI_OK;
-}
-
-
-long FFI_HIDDEN
-ffi_closure_SYSV_inner(ffi_closure *closure, void **values, void *rvalue)
-{
- ffi_cif *cif;
- ffi_type **arg_types;
- void **avalue;
- int i, areg;
-
- cif = closure->cif;
- if (cif->abi != FFI_SYSV)
- return FFI_BAD_ABI;
-
- areg = 0;
-
- int rtype = cif->rtype->type;
- if (rtype == FFI_TYPE_STRUCT && cif->rtype->size > 4 * 4)
- {
- rvalue = *values;
- areg++;
- }
-
- cif = closure->cif;
- arg_types = cif->arg_types;
- avalue = alloca(cif->nargs * sizeof(void *));
-
- for (i = 0; i < cif->nargs; i++)
- {
- if (arg_types[i]->alignment == 8 && (areg & 1) != 0)
- areg++;
-
- // skip the entry 16,a1 framework, add 16 bytes (4 registers)
- if (areg == FFI_REGISTER_NARGS)
- areg += 4;
-
- if (arg_types[i]->type == FFI_TYPE_STRUCT)
- {
- int numregs = ((arg_types[i]->size + 3) & ~3) / 4;
- if (areg < FFI_REGISTER_NARGS && areg + numregs > FFI_REGISTER_NARGS)
- areg = FFI_REGISTER_NARGS + 4;
- }
-
- avalue[i] = &values[areg];
- areg += (arg_types[i]->size + 3) / 4;
- }
-
- (closure->fun)(cif, rvalue, avalue, closure->user_data);
-
- return rtype;
-}
diff --git a/Modules/_ctypes/libffi/src/xtensa/ffitarget.h b/Modules/_ctypes/libffi/src/xtensa/ffitarget.h
deleted file mode 100644
index 0ba728bc94..0000000000
--- a/Modules/_ctypes/libffi/src/xtensa/ffitarget.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/* -----------------------------------------------------------------*-C-*-
- ffitarget.h - Copyright (c) 2013 Tensilica, Inc.
- Target configuration macros for XTENSA.
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- ``Software''), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to
- permit persons to whom the Software is furnished to do so, subject to
- the following conditions:
-
- The above copyright notice and this permission notice shall be included
- in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- DEALINGS IN THE SOFTWARE.
- ----------------------------------------------------------------------- */
-
-#ifndef LIBFFI_TARGET_H
-#define LIBFFI_TARGET_H
-
-#ifndef LIBFFI_H
-#error "Please do not include ffitarget.h directly into your source. Use ffi.h instead."
-#endif
-
-#ifndef LIBFFI_ASM
-typedef unsigned long ffi_arg;
-typedef signed long ffi_sarg;
-
-typedef enum ffi_abi {
- FFI_FIRST_ABI = 0,
- FFI_SYSV,
- FFI_LAST_ABI,
- FFI_DEFAULT_ABI = FFI_SYSV
-} ffi_abi;
-#endif
-
-#define FFI_REGISTER_NARGS 6
-
-/* ---- Definitions for closures ----------------------------------------- */
-
-#define FFI_CLOSURES 1
-#define FFI_NATIVE_RAW_API 0
-#define FFI_TRAMPOLINE_SIZE 24
-
-#endif
diff --git a/Modules/_ctypes/libffi/src/xtensa/sysv.S b/Modules/_ctypes/libffi/src/xtensa/sysv.S
deleted file mode 100644
index 64e6a0918d..0000000000
--- a/Modules/_ctypes/libffi/src/xtensa/sysv.S
+++ /dev/null
@@ -1,253 +0,0 @@
-/* -----------------------------------------------------------------------
- sysv.S - Copyright (c) 2013 Tensilica, Inc.
-
- XTENSA Foreign Function Interface
-
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- ``Software''), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to
- permit persons to whom the Software is furnished to do so, subject to
- the following conditions:
-
- The above copyright notice and this permission notice shall be included
- in all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- DEALINGS IN THE SOFTWARE.
- ----------------------------------------------------------------------- */
-
-#define LIBFFI_ASM
-#include <fficonfig.h>
-#include <ffi.h>
-
-#define ENTRY(name) .text; .globl name; .type name,@function; .align 4; name:
-#define END(name) .size name , . - name
-
-/* Assert that the table below is in sync with ffi.h. */
-
-#if FFI_TYPE_UINT8 != 5 \
- || FFI_TYPE_SINT8 != 6 \
- || FFI_TYPE_UINT16 != 7 \
- || FFI_TYPE_SINT16 != 8 \
- || FFI_TYPE_UINT32 != 9 \
- || FFI_TYPE_SINT32 != 10 \
- || FFI_TYPE_UINT64 != 11
-#error "xtensa/sysv.S out of sync with ffi.h"
-#endif
-
-
-/* ffi_call_SYSV (rvalue, rbytes, flags, (*fnaddr)(), bytes, ecif)
- void *rvalue; a2
- unsigned long rbytes; a3
- unsigned flags; a4
- void (*fnaddr)(); a5
- unsigned long bytes; a6
- extended_cif* ecif) a7
-*/
-
-ENTRY(ffi_call_SYSV)
-
- entry a1, 32 # 32 byte frame for using call8 below
-
- mov a10, a7 # a10(->arg0): ecif
- sub a11, a1, a6 # a11(->arg1): stack pointer
- mov a7, a1 # fp
- movsp a1, a11 # set new sp = old_sp - bytes
-
- movi a8, ffi_prep_args
- callx8 a8 # ffi_prep_args(ecif, stack)
-
- # prepare to move stack pointer back up to 6 arguments
- # note that 'bytes' is already aligned
-
- movi a10, 6*4
- sub a11, a6, a10
- movgez a6, a10, a11
- add a6, a1, a6
-
-
- # we can pass up to 6 arguments in registers
- # for simplicity, just load 6 arguments
- # (the stack size is at least 32 bytes, so no risk to cross boundaries)
-
- l32i a10, a1, 0
- l32i a11, a1, 4
- l32i a12, a1, 8
- l32i a13, a1, 12
- l32i a14, a1, 16
- l32i a15, a1, 20
-
- # move stack pointer
-
- movsp a1, a6
-
- callx8 a5 # (*fn)(args...)
-
- # Handle return value(s)
-
- beqz a2, .Lexit
-
- movi a5, FFI_TYPE_STRUCT
- bne a4, a5, .Lstore
- movi a5, 16
- blt a5, a3, .Lexit
-
- s32i a10, a2, 0
- blti a3, 5, .Lexit
- addi a3, a3, -1
- s32i a11, a2, 4
- blti a3, 8, .Lexit
- s32i a12, a2, 8
- blti a3, 12, .Lexit
- s32i a13, a2, 12
-
-.Lexit: retw
-
-.Lstore:
- addi a4, a4, -FFI_TYPE_UINT8
- bgei a4, 7, .Lexit # should never happen
- movi a6, store_calls
- add a4, a4, a4
- addx4 a6, a4, a6 # store_table + idx * 8
- jx a6
-
- .align 8
-store_calls:
- # UINT8
- s8i a10, a2, 0
- retw
-
- # SINT8
- .align 8
- s8i a10, a2, 0
- retw
-
- # UINT16
- .align 8
- s16i a10, a2, 0
- retw
-
- # SINT16
- .align 8
- s16i a10, a2, 0
- retw
-
- # UINT32
- .align 8
- s32i a10, a2, 0
- retw
-
- # SINT32
- .align 8
- s32i a10, a2, 0
- retw
-
- # UINT64
- .align 8
- s32i a10, a2, 0
- s32i a11, a2, 4
- retw
-
-END(ffi_call_SYSV)
-
-
-/*
- * void ffi_cacheflush (unsigned long start, unsigned long end)
- */
-
-#define EXTRA_ARGS_SIZE 24
-
-ENTRY(ffi_cacheflush)
-
- entry a1, 16
-
-1: dhwbi a2, 0
- ihi a2, 0
- addi a2, a2, 4
- blt a2, a3, 1b
-
- retw
-
-END(ffi_cacheflush)
-
-/* ffi_trampoline is copied to the stack */
-
-ENTRY(ffi_trampoline)
-
- entry a1, 16 + (FFI_REGISTER_NARGS * 4) + (4 * 4) # [ 0]
- j 2f # [ 3]
- .align 4 # [ 6]
-1: .long 0 # [ 8]
-2: l32r a15, 1b # [12]
- _mov a14, a0 # [15]
- callx0 a15 # [18]
- # [21]
-END(ffi_trampoline)
-
-/*
- * ffi_closure()
- *
- * a0: closure + 21
- * a14: return address (a0)
- */
-
-ENTRY(ffi_closure_SYSV)
-
- /* intentionally omitting entry here */
-
- # restore return address (a0) and move pointer to closure to a10
- addi a10, a0, -21
- mov a0, a14
-
- # allow up to 4 arguments as return values
- addi a11, a1, 4 * 4
-
- # save up to 6 arguments to stack (allocated by entry below)
- s32i a2, a11, 0
- s32i a3, a11, 4
- s32i a4, a11, 8
- s32i a5, a11, 12
- s32i a6, a11, 16
- s32i a7, a11, 20
-
- movi a8, ffi_closure_SYSV_inner
- mov a12, a1
- callx8 a8 # .._inner(*closure, **avalue, *rvalue)
-
- # load up to four return arguments
- l32i a2, a1, 0
- l32i a3, a1, 4
- l32i a4, a1, 8
- l32i a5, a1, 12
-
- # (sign-)extend return value
- movi a11, FFI_TYPE_UINT8
- bne a10, a11, 1f
- extui a2, a2, 0, 8
- retw
-
-1: movi a11, FFI_TYPE_SINT8
- bne a10, a11, 1f
- sext a2, a2, 7
- retw
-
-1: movi a11, FFI_TYPE_UINT16
- bne a10, a11, 1f
- extui a2, a2, 0, 16
- retw
-
-1: movi a11, FFI_TYPE_SINT16
- bne a10, a11, 1f
- sext a2, a2, 15
-
-1: retw
-
-END(ffi_closure_SYSV)
diff --git a/Modules/_ctypes/libffi/testsuite/Makefile.am b/Modules/_ctypes/libffi/testsuite/Makefile.am
deleted file mode 100644
index da10465d28..0000000000
--- a/Modules/_ctypes/libffi/testsuite/Makefile.am
+++ /dev/null
@@ -1,85 +0,0 @@
-## Process this file with automake to produce Makefile.in.
-
-AUTOMAKE_OPTIONS = foreign dejagnu
-
-EXTRA_DEJAGNU_SITE_CONFIG=../local.exp
-
-CLEANFILES = *.exe core* *.log *.sum
-
-EXTRA_DIST = config/default.exp libffi.call/cls_19byte.c \
-libffi.call/cls_align_longdouble_split.c \
-libffi.call/closure_loc_fn0.c libffi.call/cls_schar.c \
-libffi.call/closure_fn1.c \
-libffi.call/return_ul.c libffi.call/cls_align_double.c \
-libffi.call/return_fl2.c libffi.call/cls_1_1byte.c \
-libffi.call/cls_64byte.c libffi.call/nested_struct7.c \
-libffi.call/cls_align_sint32.c libffi.call/nested_struct2.c \
-libffi.call/ffitest.h libffi.call/nested_struct4.c \
-libffi.call/cls_multi_ushort.c libffi.call/struct3.c \
-libffi.call/cls_3byte1.c libffi.call/cls_16byte.c \
-libffi.call/struct8.c libffi.call/nested_struct8.c \
-libffi.call/cls_multi_sshort.c libffi.call/cls_3byte2.c \
-libffi.call/cls_pointer.c \
-libffi.call/err_bad_typedef.c libffi.call/cls_4_1byte.c \
-libffi.call/cls_9byte2.c libffi.call/cls_multi_schar.c \
-libffi.call/stret_medium2.c libffi.call/cls_5_1_byte.c \
-libffi.call/call.exp libffi.call/cls_double.c \
-libffi.call/cls_align_sint16.c libffi.call/cls_uint.c \
-libffi.call/return_ll1.c libffi.call/nested_struct3.c \
-libffi.call/cls_20byte1.c libffi.call/closure_fn4.c \
-libffi.call/cls_uchar.c libffi.call/struct2.c libffi.call/cls_7byte.c \
-libffi.call/strlen.c libffi.call/many.c libffi.call/testclosure.c \
-libffi.call/return_fl.c libffi.call/struct5.c \
-libffi.call/cls_12byte.c libffi.call/cls_multi_sshortchar.c \
-libffi.call/cls_align_longdouble_split2.c libffi.call/return_dbl2.c \
-libffi.call/return_fl3.c libffi.call/stret_medium.c \
-libffi.call/nested_struct6.c libffi.call/closure_fn3.c \
-libffi.call/float3.c libffi.call/many2.c \
-libffi.call/closure_simple.c libffi.call/cls_align_uint16.c \
-libffi.call/cls_9byte1.c libffi.call/closure_fn6.c \
-libffi.call/cls_double_va.c libffi.call/cls_align_pointer.c \
-libffi.call/cls_align_longdouble.c libffi.call/closure_fn2.c \
-libffi.call/cls_sshort.c \
-libffi.call/nested_struct.c libffi.call/cls_20byte.c \
-libffi.call/cls_longdouble.c libffi.call/cls_multi_uchar.c \
-libffi.call/return_uc.c \
-libffi.call/cls_18byte.c libffi.call/cls_8byte.c \
-libffi.call/promotion.c \
-libffi.call/return_dbl.c libffi.call/cls_24byte.c \
-libffi.call/struct4.c libffi.call/cls_6byte.c \
-libffi.call/cls_align_uint32.c libffi.call/float.c \
-libffi.call/float1.c libffi.call/float_va.c libffi.call/negint.c \
-libffi.call/return_dbl1.c libffi.call/cls_3_1byte.c \
-libffi.call/cls_align_float.c libffi.call/return_fl1.c \
-libffi.call/nested_struct10.c libffi.call/nested_struct5.c \
-libffi.call/cls_align_sint64.c \
-libffi.call/stret_large2.c libffi.call/return_sl.c \
-libffi.call/closure_fn0.c libffi.call/cls_5byte.c \
-libffi.call/cls_2byte.c libffi.call/float2.c \
-libffi.call/cls_dbls_struct.c libffi.call/cls_sint.c \
-libffi.call/stret_large.c libffi.call/cls_ulonglong.c \
-libffi.call/cls_ushort.c libffi.call/nested_struct1.c \
-libffi.call/err_bad_abi.c libffi.call/cls_longdouble_va.c \
-libffi.call/cls_float.c libffi.call/cls_pointer_stack.c \
-libffi.call/pyobjc-tc.c libffi.call/cls_multi_ushortchar.c \
-libffi.call/struct1.c libffi.call/nested_struct9.c \
-libffi.call/huge_struct.c libffi.call/problem1.c \
-libffi.call/float4.c \
-libffi.call/return_ldl.c \
-libffi.call/closure_fn5.c \
-libffi.call/struct6.c libffi.call/return_ll.c libffi.call/struct9.c \
-libffi.call/return_sc.c libffi.call/struct7.c \
-libffi.call/cls_align_uint64.c libffi.call/cls_4byte.c \
-libffi.call/cls_6_1_byte.c \
-libffi.call/cls_7_1_byte.c libffi.call/unwindtest.cc \
-libffi.call/unwindtest_ffi_call.cc \
-lib/wrapper.exp lib/target-libpath.exp \
-lib/libffi.exp libffi.call/cls_struct_va1.c \
-libffi.call/cls_uchar_va.c libffi.call/cls_uint_va.c \
-libffi.call/cls_ulong_va.c libffi.call/cls_ushort_va.c \
-libffi.call/nested_struct11.c libffi.call/uninitialized.c \
-libffi.call/va_1.c libffi.call/va_struct1.c libffi.call/va_struct2.c \
-libffi.call/va_struct3.c \
-libffi.call/strlen2.c \
-libffi.call/strlen3.c \
-libffi.call/strlen4.c
diff --git a/Modules/_ctypes/libffi/testsuite/Makefile.in b/Modules/_ctypes/libffi/testsuite/Makefile.in
deleted file mode 100644
index 99e226c409..0000000000
--- a/Modules/_ctypes/libffi/testsuite/Makefile.in
+++ /dev/null
@@ -1,590 +0,0 @@
-# Makefile.in generated by automake 1.13.4 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
-
-# This Makefile.in 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.
-
-@SET_MAKE@
-VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
-am__make_running_with_option = \
- case $${target_option-} in \
- ?) ;; \
- *) echo "am__make_running_with_option: internal error: invalid" \
- "target option '$${target_option-}' specified" >&2; \
- exit 1;; \
- esac; \
- has_opt=no; \
- sane_makeflags=$$MAKEFLAGS; \
- if $(am__is_gnu_make); then \
- sane_makeflags=$$MFLAGS; \
- else \
- case $$MAKEFLAGS in \
- *\\[\ \ ]*) \
- bs=\\; \
- sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
- | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
- esac; \
- fi; \
- skip_next=no; \
- strip_trailopt () \
- { \
- flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
- }; \
- for flg in $$sane_makeflags; do \
- test $$skip_next = yes && { skip_next=no; continue; }; \
- case $$flg in \
- *=*|--*) continue;; \
- -*I) strip_trailopt 'I'; skip_next=yes;; \
- -*I?*) strip_trailopt 'I';; \
- -*O) strip_trailopt 'O'; skip_next=yes;; \
- -*O?*) strip_trailopt 'O';; \
- -*l) strip_trailopt 'l'; skip_next=yes;; \
- -*l?*) strip_trailopt 'l';; \
- -[dEDm]) skip_next=yes;; \
- -[JT]) skip_next=yes;; \
- esac; \
- case $$flg in \
- *$$target_option*) has_opt=yes; break;; \
- esac; \
- done; \
- test $$has_opt = yes
-am__make_dryrun = (target_option=n; $(am__make_running_with_option))
-am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-target_triplet = @target@
-subdir = testsuite
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/asmcfi.m4 \
- $(top_srcdir)/m4/ax_append_flag.m4 \
- $(top_srcdir)/m4/ax_cc_maxopt.m4 \
- $(top_srcdir)/m4/ax_cflags_warn_all.m4 \
- $(top_srcdir)/m4/ax_check_compile_flag.m4 \
- $(top_srcdir)/m4/ax_compiler_vendor.m4 \
- $(top_srcdir)/m4/ax_configure_args.m4 \
- $(top_srcdir)/m4/ax_enable_builddir.m4 \
- $(top_srcdir)/m4/ax_gcc_archflag.m4 \
- $(top_srcdir)/m4/ax_gcc_x86_cpuid.m4 \
- $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
- $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
- $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/acinclude.m4 \
- $(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
- $(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/fficonfig.h
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-AM_V_P = $(am__v_P_@AM_V@)
-am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
-am__v_P_0 = false
-am__v_P_1 = :
-AM_V_GEN = $(am__v_GEN_@AM_V@)
-am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
-am__v_GEN_0 = @echo " GEN " $@;
-am__v_GEN_1 =
-AM_V_at = $(am__v_at_@AM_V@)
-am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
-am__v_at_0 = @
-am__v_at_1 =
-SOURCES =
-DIST_SOURCES =
-am__can_run_installinfo = \
- case $$AM_UPDATE_INFO_DIR in \
- n|no|NO) false;; \
- *) (install-info --version) >/dev/null 2>&1;; \
- esac
-am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
-DEJATOOL = $(PACKAGE)
-RUNTESTDEFAULTFLAGS = --tool $$tool --srcdir $$srcdir
-EXPECT = expect
-RUNTEST = runtest
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = @ACLOCAL@
-ALLOCA = @ALLOCA@
-AMTAR = @AMTAR@
-AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
-AM_LTLDFLAGS = @AM_LTLDFLAGS@
-AM_RUNTESTFLAGS = @AM_RUNTESTFLAGS@
-AR = @AR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-CC = @CC@
-CCAS = @CCAS@
-CCASDEPMODE = @CCASDEPMODE@
-CCASFLAGS = @CCASFLAGS@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DLLTOOL = @DLLTOOL@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-FFI_EXEC_TRAMPOLINE_TABLE = @FFI_EXEC_TRAMPOLINE_TABLE@
-FGREP = @FGREP@
-GREP = @GREP@
-HAVE_LONG_DOUBLE = @HAVE_LONG_DOUBLE@
-HAVE_LONG_DOUBLE_VARIANT = @HAVE_LONG_DOUBLE_VARIANT@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LTLIBOBJS = @LTLIBOBJS@
-MAINT = @MAINT@
-MAKEINFO = @MAKEINFO@
-MANIFEST_TOOL = @MANIFEST_TOOL@
-MKDIR_P = @MKDIR_P@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_URL = @PACKAGE_URL@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PRTDIAG = @PRTDIAG@
-RANLIB = @RANLIB@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-TARGET = @TARGET@
-TARGETDIR = @TARGETDIR@
-VERSION = @VERSION@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_AR = @ac_ct_AR@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-ax_enable_builddir_sed = @ax_enable_builddir_sed@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sys_symbol_underscore = @sys_symbol_underscore@
-sysconfdir = @sysconfdir@
-target = @target@
-target_alias = @target_alias@
-target_cpu = @target_cpu@
-target_os = @target_os@
-target_vendor = @target_vendor@
-toolexecdir = @toolexecdir@
-toolexeclibdir = @toolexeclibdir@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-AUTOMAKE_OPTIONS = foreign dejagnu
-EXTRA_DEJAGNU_SITE_CONFIG = ../local.exp
-CLEANFILES = *.exe core* *.log *.sum
-EXTRA_DIST = config/default.exp libffi.call/cls_19byte.c \
-libffi.call/cls_align_longdouble_split.c \
-libffi.call/closure_loc_fn0.c libffi.call/cls_schar.c \
-libffi.call/closure_fn1.c \
-libffi.call/return_ul.c libffi.call/cls_align_double.c \
-libffi.call/return_fl2.c libffi.call/cls_1_1byte.c \
-libffi.call/cls_64byte.c libffi.call/nested_struct7.c \
-libffi.call/cls_align_sint32.c libffi.call/nested_struct2.c \
-libffi.call/ffitest.h libffi.call/nested_struct4.c \
-libffi.call/cls_multi_ushort.c libffi.call/struct3.c \
-libffi.call/cls_3byte1.c libffi.call/cls_16byte.c \
-libffi.call/struct8.c libffi.call/nested_struct8.c \
-libffi.call/cls_multi_sshort.c libffi.call/cls_3byte2.c \
-libffi.call/cls_pointer.c \
-libffi.call/err_bad_typedef.c libffi.call/cls_4_1byte.c \
-libffi.call/cls_9byte2.c libffi.call/cls_multi_schar.c \
-libffi.call/stret_medium2.c libffi.call/cls_5_1_byte.c \
-libffi.call/call.exp libffi.call/cls_double.c \
-libffi.call/cls_align_sint16.c libffi.call/cls_uint.c \
-libffi.call/return_ll1.c libffi.call/nested_struct3.c \
-libffi.call/cls_20byte1.c libffi.call/closure_fn4.c \
-libffi.call/cls_uchar.c libffi.call/struct2.c libffi.call/cls_7byte.c \
-libffi.call/strlen.c libffi.call/many.c libffi.call/testclosure.c \
-libffi.call/return_fl.c libffi.call/struct5.c \
-libffi.call/cls_12byte.c libffi.call/cls_multi_sshortchar.c \
-libffi.call/cls_align_longdouble_split2.c libffi.call/return_dbl2.c \
-libffi.call/return_fl3.c libffi.call/stret_medium.c \
-libffi.call/nested_struct6.c libffi.call/closure_fn3.c \
-libffi.call/float3.c libffi.call/many2.c \
-libffi.call/closure_simple.c libffi.call/cls_align_uint16.c \
-libffi.call/cls_9byte1.c libffi.call/closure_fn6.c \
-libffi.call/cls_double_va.c libffi.call/cls_align_pointer.c \
-libffi.call/cls_align_longdouble.c libffi.call/closure_fn2.c \
-libffi.call/cls_sshort.c \
-libffi.call/nested_struct.c libffi.call/cls_20byte.c \
-libffi.call/cls_longdouble.c libffi.call/cls_multi_uchar.c \
-libffi.call/return_uc.c \
-libffi.call/cls_18byte.c libffi.call/cls_8byte.c \
-libffi.call/promotion.c \
-libffi.call/return_dbl.c libffi.call/cls_24byte.c \
-libffi.call/struct4.c libffi.call/cls_6byte.c \
-libffi.call/cls_align_uint32.c libffi.call/float.c \
-libffi.call/float1.c libffi.call/float_va.c libffi.call/negint.c \
-libffi.call/return_dbl1.c libffi.call/cls_3_1byte.c \
-libffi.call/cls_align_float.c libffi.call/return_fl1.c \
-libffi.call/nested_struct10.c libffi.call/nested_struct5.c \
-libffi.call/cls_align_sint64.c \
-libffi.call/stret_large2.c libffi.call/return_sl.c \
-libffi.call/closure_fn0.c libffi.call/cls_5byte.c \
-libffi.call/cls_2byte.c libffi.call/float2.c \
-libffi.call/cls_dbls_struct.c libffi.call/cls_sint.c \
-libffi.call/stret_large.c libffi.call/cls_ulonglong.c \
-libffi.call/cls_ushort.c libffi.call/nested_struct1.c \
-libffi.call/err_bad_abi.c libffi.call/cls_longdouble_va.c \
-libffi.call/cls_float.c libffi.call/cls_pointer_stack.c \
-libffi.call/pyobjc-tc.c libffi.call/cls_multi_ushortchar.c \
-libffi.call/struct1.c libffi.call/nested_struct9.c \
-libffi.call/huge_struct.c libffi.call/problem1.c \
-libffi.call/float4.c \
-libffi.call/return_ldl.c \
-libffi.call/closure_fn5.c \
-libffi.call/struct6.c libffi.call/return_ll.c libffi.call/struct9.c \
-libffi.call/return_sc.c libffi.call/struct7.c \
-libffi.call/cls_align_uint64.c libffi.call/cls_4byte.c \
-libffi.call/cls_6_1_byte.c \
-libffi.call/cls_7_1_byte.c libffi.call/unwindtest.cc \
-libffi.call/unwindtest_ffi_call.cc \
-lib/wrapper.exp lib/target-libpath.exp \
-lib/libffi.exp libffi.call/cls_struct_va1.c \
-libffi.call/cls_uchar_va.c libffi.call/cls_uint_va.c \
-libffi.call/cls_ulong_va.c libffi.call/cls_ushort_va.c \
-libffi.call/nested_struct11.c libffi.call/uninitialized.c \
-libffi.call/va_1.c libffi.call/va_struct1.c libffi.call/va_struct2.c \
-libffi.call/va_struct3.c \
-libffi.call/strlen2.c \
-libffi.call/strlen3.c \
-libffi.call/strlen4.c
-
-all: all-am
-
-.SUFFIXES:
-$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
- @for dep in $?; do \
- case '$(am__configure_deps)' in \
- *$$dep*) \
- ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
- && { if test -f $@; then exit 0; else break; fi; }; \
- exit 1;; \
- esac; \
- done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign testsuite/Makefile'; \
- $(am__cd) $(top_srcdir) && \
- $(AUTOMAKE) --foreign testsuite/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
- @case '$?' in \
- *config.status*) \
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
- *) \
- echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
- esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-
-mostlyclean-libtool:
- -rm -f *.lo
-
-clean-libtool:
- -rm -rf .libs _libs
-tags TAGS:
-
-ctags CTAGS:
-
-cscope cscopelist:
-
-
-check-DEJAGNU: site.exp
- srcdir='$(srcdir)'; export srcdir; \
- EXPECT=$(EXPECT); export EXPECT; \
- if $(SHELL) -c "$(RUNTEST) --version" > /dev/null 2>&1; then \
- exit_status=0; l='$(DEJATOOL)'; for tool in $$l; do \
- if $(RUNTEST) $(AM_RUNTESTFLAGS) $(RUNTESTDEFAULTFLAGS) $(RUNTESTFLAGS); \
- then :; else exit_status=1; fi; \
- done; \
- else echo "WARNING: could not find '$(RUNTEST)'" 1>&2; :;\
- fi; \
- exit $$exit_status
-site.exp: Makefile $(EXTRA_DEJAGNU_SITE_CONFIG)
- @echo 'Making a new site.exp file ...'
- @echo '## these variables are automatically generated by make ##' >site.tmp
- @echo '# Do not edit here. If you wish to override these values' >>site.tmp
- @echo '# edit the last section' >>site.tmp
- @echo 'set srcdir "$(srcdir)"' >>site.tmp
- @echo "set objdir `pwd`" >>site.tmp
- @echo 'set build_alias "$(build_alias)"' >>site.tmp
- @echo 'set build_triplet $(build_triplet)' >>site.tmp
- @echo 'set host_alias "$(host_alias)"' >>site.tmp
- @echo 'set host_triplet $(host_triplet)' >>site.tmp
- @echo 'set target_alias "$(target_alias)"' >>site.tmp
- @echo 'set target_triplet $(target_triplet)' >>site.tmp
- @list='$(EXTRA_DEJAGNU_SITE_CONFIG)'; for f in $$list; do \
- echo "## Begin content included from file $$f. Do not modify. ##" \
- && cat `test -f "$$f" || echo '$(srcdir)/'`$$f \
- && echo "## End content included from file $$f. ##" \
- || exit 1; \
- done >> site.tmp
- @echo "## End of auto-generated content; you can edit from here. ##" >> site.tmp
- @if test -f site.exp; then \
- sed -e '1,/^## End of auto-generated content.*##/d' site.exp >> site.tmp; \
- fi
- @-rm -f site.bak
- @test ! -f site.exp || mv site.exp site.bak
- @mv site.tmp site.exp
-
-distclean-DEJAGNU:
- -rm -f site.exp site.bak
- -l='$(DEJATOOL)'; for tool in $$l; do \
- rm -f $$tool.sum $$tool.log; \
- done
-
-distdir: $(DISTFILES)
- @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
- topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
- list='$(DISTFILES)'; \
- dist_files=`for file in $$list; do echo $$file; done | \
- sed -e "s|^$$srcdirstrip/||;t" \
- -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
- case $$dist_files in \
- */*) $(MKDIR_P) `echo "$$dist_files" | \
- sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
- sort -u` ;; \
- esac; \
- for file in $$dist_files; do \
- if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
- if test -d $$d/$$file; then \
- dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
- if test -d "$(distdir)/$$file"; then \
- find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
- fi; \
- if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
- cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
- find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
- fi; \
- cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
- else \
- test -f "$(distdir)/$$file" \
- || cp -p $$d/$$file "$(distdir)/$$file" \
- || exit 1; \
- fi; \
- done
-check-am: all-am
- $(MAKE) $(AM_MAKEFLAGS) check-DEJAGNU
-check: check-am
-all-am: Makefile
-installdirs:
-install: install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
- @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
- if test -z '$(STRIP)'; then \
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- install; \
- else \
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
- fi
-mostlyclean-generic:
-
-clean-generic:
- -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
-
-distclean-generic:
- -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
- -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
- @echo "This command is intended for maintainers to use"
- @echo "it deletes files that may require special tools to rebuild."
-clean: clean-am
-
-clean-am: clean-generic clean-libtool mostlyclean-am
-
-distclean: distclean-am
- -rm -f Makefile
-distclean-am: clean-am distclean-DEJAGNU distclean-generic
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-html-am:
-
-info: info-am
-
-info-am:
-
-install-data-am:
-
-install-dvi: install-dvi-am
-
-install-dvi-am:
-
-install-exec-am:
-
-install-html: install-html-am
-
-install-html-am:
-
-install-info: install-info-am
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-am
-
-install-pdf-am:
-
-install-ps: install-ps-am
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
- -rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-generic mostlyclean-libtool
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am:
-
-.MAKE: check-am install-am install-strip
-
-.PHONY: all all-am check check-DEJAGNU check-am clean clean-generic \
- clean-libtool cscopelist-am ctags-am distclean \
- distclean-DEJAGNU distclean-generic distclean-libtool distdir \
- dvi dvi-am html html-am info info-am install install-am \
- install-data install-data-am install-dvi install-dvi-am \
- install-exec install-exec-am install-html install-html-am \
- install-info install-info-am install-man install-pdf \
- install-pdf-am install-ps install-ps-am install-strip \
- installcheck installcheck-am installdirs maintainer-clean \
- maintainer-clean-generic mostlyclean mostlyclean-generic \
- mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \
- uninstall-am
-
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/Modules/_ctypes/libffi/testsuite/config/default.exp b/Modules/_ctypes/libffi/testsuite/config/default.exp
deleted file mode 100644
index 90967cccc1..0000000000
--- a/Modules/_ctypes/libffi/testsuite/config/default.exp
+++ /dev/null
@@ -1 +0,0 @@
-load_lib "standard.exp"
diff --git a/Modules/_ctypes/libffi/testsuite/lib/libffi.exp b/Modules/_ctypes/libffi/testsuite/lib/libffi.exp
deleted file mode 100644
index dbdd1a2f27..0000000000
--- a/Modules/_ctypes/libffi/testsuite/lib/libffi.exp
+++ /dev/null
@@ -1,413 +0,0 @@
-# Copyright (C) 2003, 2005, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
-
-# 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 3 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; see the file COPYING3. If not see
-# <http://www.gnu.org/licenses/>.
-
-proc load_gcc_lib { filename } {
- global srcdir
- load_file $srcdir/lib/$filename
-}
-
-load_lib dg.exp
-load_lib libgloss.exp
-load_gcc_lib target-libpath.exp
-load_gcc_lib wrapper.exp
-
-
-# Define libffi callbacks for dg.exp.
-
-proc libffi-dg-test-1 { target_compile prog do_what extra_tool_flags } {
-
- # To get all \n in dg-output test strings to match printf output
- # in a system that outputs it as \015\012 (i.e. not just \012), we
- # need to change all \n into \r?\n. As there is no dejagnu flag
- # or hook to do that, we simply change the text being tested.
- # Unfortunately, we have to know that the variable is called
- # dg-output-text and lives in the caller of libffi-dg-test, which
- # is two calls up. Overriding proc dg-output would be longer and
- # would necessarily have the same assumption.
- upvar 2 dg-output-text output_match
-
- if { [llength $output_match] > 1 } {
- regsub -all "\n" [lindex $output_match 1] "\r?\n" x
- set output_match [lreplace $output_match 1 1 $x]
- }
-
- # Set up the compiler flags, based on what we're going to do.
-
- set options [list]
- switch $do_what {
- "compile" {
- set compile_type "assembly"
- set output_file "[file rootname [file tail $prog]].s"
- }
- "link" {
- set compile_type "executable"
- set output_file "[file rootname [file tail $prog]].exe"
- # The following line is needed for targets like the i960 where
- # the default output file is b.out. Sigh.
- }
- "run" {
- set compile_type "executable"
- # FIXME: "./" is to cope with "." not being in $PATH.
- # Should this be handled elsewhere?
- # YES.
- set output_file "./[file rootname [file tail $prog]].exe"
- # This is the only place where we care if an executable was
- # created or not. If it was, dg.exp will try to run it.
- remote_file build delete $output_file;
- }
- default {
- perror "$do_what: not a valid dg-do keyword"
- return ""
- }
- }
-
- if { $extra_tool_flags != "" } {
- lappend options "additional_flags=$extra_tool_flags"
- }
-
- set comp_output [libffi_target_compile "$prog" "$output_file" "$compile_type" $options];
-
-
- return [list $comp_output $output_file]
-}
-
-
-proc libffi-dg-test { prog do_what extra_tool_flags } {
- return [libffi-dg-test-1 target_compile $prog $do_what $extra_tool_flags]
-}
-
-proc libffi-init { args } {
- global gluefile wrap_flags;
- global srcdir
- global blddirffi
- global objdir
- global TOOL_OPTIONS
- global tool
- global libffi_include
- global libffi_link_flags
- global tool_root_dir
- global ld_library_path
-
- global using_gcc
-
- set blddirffi [pwd]/..
- verbose "libffi $blddirffi"
-
- # Are we building with GCC?
- set tmp [grep ../config.status "GCC='yes'"]
- if { [string match $tmp "GCC='yes'"] } {
-
- set using_gcc "yes"
-
- set gccdir [lookfor_file $tool_root_dir gcc/libgcc.a]
- if {$gccdir != ""} {
- set gccdir [file dirname $gccdir]
- }
- verbose "gccdir $gccdir"
-
- set ld_library_path "."
- append ld_library_path ":${gccdir}"
-
- set compiler "${gccdir}/xgcc"
- if { [is_remote host] == 0 && [which $compiler] != 0 } {
- foreach i "[exec $compiler --print-multi-lib]" {
- set mldir ""
- regexp -- "\[a-z0-9=_/\.-\]*;" $i mldir
- set mldir [string trimright $mldir "\;@"]
- if { "$mldir" == "." } {
- continue
- }
- if { [llength [glob -nocomplain ${gccdir}/${mldir}/libgcc_s*.so.*]] >= 1 } {
- append ld_library_path ":${gccdir}/${mldir}"
- }
- }
- }
-
- } else {
-
- set using_gcc "no"
-
- }
-
- # add the library path for libffi.
- append ld_library_path ":${blddirffi}/.libs"
-
- verbose "ld_library_path: $ld_library_path"
-
- # Point to the Libffi headers in libffi.
- set libffi_include "${blddirffi}/include"
- verbose "libffi_include $libffi_include"
-
- set libffi_dir "${blddirffi}/.libs"
- verbose "libffi_dir $libffi_dir"
- if { $libffi_dir != "" } {
- set libffi_dir [file dirname ${libffi_dir}]
- set libffi_link_flags "-L${libffi_dir}/.libs"
- }
-
- set_ld_library_path_env_vars
- libffi_maybe_build_wrapper "${objdir}/testglue.o"
-}
-
-proc libffi_exit { } {
- global gluefile;
-
- if [info exists gluefile] {
- file_on_build delete $gluefile;
- unset gluefile;
- }
-}
-
-proc libffi_target_compile { source dest type options } {
- global gluefile wrap_flags;
- global srcdir
- global blddirffi
- global TOOL_OPTIONS
- global libffi_link_flags
- global libffi_include
- global target_triplet
-
-
- if { [target_info needs_status_wrapper]!="" && [info exists gluefile] } {
- lappend options "libs=${gluefile}"
- lappend options "ldflags=$wrap_flags"
- }
-
- # TOOL_OPTIONS must come first, so that it doesn't override testcase
- # specific options.
- if [info exists TOOL_OPTIONS] {
- lappend options [concat "additional_flags=$TOOL_OPTIONS" $options];
- }
-
- # search for ffi_mips.h in srcdir, too
- lappend options "additional_flags=-I${libffi_include} -I${srcdir}/../include -I${libffi_include}/.."
- lappend options "additional_flags=${libffi_link_flags}"
-
- # Darwin needs a stack execution allowed flag.
-
- if { [istarget "*-*-darwin9*"] || [istarget "*-*-darwin1*"]
- || [istarget "*-*-darwin2*"] } {
- lappend options "additional_flags=-Wl,-allow_stack_execute"
- }
-
- # If you're building the compiler with --prefix set to a place
- # where it's not yet installed, then the linker won't be able to
- # find the libgcc used by libffi.dylib. We could pass the
- # -dylib_file option, but that's complicated, and it's much easier
- # to just make the linker find libgcc using -L options.
- if { [string match "*-*-darwin*" $target_triplet] } {
- lappend options "libs= -shared-libgcc"
- }
-
- if { [string match "*-*-openbsd*" $target_triplet] } {
- lappend options "libs= -lpthread"
- }
-
- lappend options "libs= -lffi"
-
- if { [string match "aarch64*-*-linux*" $target_triplet] } {
- lappend options "libs= -lpthread"
- }
-
- if { [string match "*.cc" $source] } {
- lappend options "c++"
- }
-
- verbose "options: $options"
- return [target_compile $source $dest $type $options]
-}
-
-# Utility routines.
-
-#
-# search_for -- looks for a string match in a file
-#
-proc search_for { file pattern } {
- set fd [open $file r]
- while { [gets $fd cur_line]>=0 } {
- if [string match "*$pattern*" $cur_line] then {
- close $fd
- return 1
- }
- }
- close $fd
- return 0
-}
-
-# Modified dg-runtest that can cycle through a list of optimization options
-# as c-torture does.
-proc libffi-dg-runtest { testcases default-extra-flags } {
- global runtests
-
- foreach test $testcases {
- # If we're only testing specific files and this isn't one of
- # them, skip it.
- if ![runtest_file_p $runtests $test] {
- continue
- }
-
- # Look for a loop within the source code - if we don't find one,
- # don't pass -funroll[-all]-loops.
- global torture_with_loops torture_without_loops
- if [expr [search_for $test "for*("]+[search_for $test "while*("]] {
- set option_list $torture_with_loops
- } else {
- set option_list $torture_without_loops
- }
-
- set nshort [file tail [file dirname $test]]/[file tail $test]
-
- foreach flags $option_list {
- verbose "Testing $nshort, $flags" 1
- dg-test $test $flags ${default-extra-flags}
- }
- }
-}
-
-proc run-many-tests { testcases extra_flags } {
- global using_gcc
- if { [string match $using_gcc "yes"] } {
- set common "-W -Wall"
- set optimizations { "-O0" "-O2" "-O3" "-Os" "-O2 -fomit-frame-pointer" }
- } else {
- # Assume we are using the vendor compiler.
- set common ""
- set optimizations { "" }
- }
-
- set targetabis { "" }
- if [string match $using_gcc "yes"] {
- if [istarget "i?86-*-*"] {
- set targetabis {
- ""
- "-DABI_NUM=FFI_STDCALL -DABI_ATTR=__STDCALL__"
- "-DABI_NUM=FFI_THISCALL -DABI_ATTR=__THISCALL__"
- "-DABI_NUM=FFI_FASTCALL -DABI_ATTR=__FASTCALL__"
- }
- }
- }
-
- set common [ concat $common $extra_flags ]
- foreach test $testcases {
- set testname [file tail $test]
- if [search_for $test "ABI_NUM"] {
- set abis $targetabis
- } else {
- set abis { "" }
- }
- foreach opt $optimizations {
- foreach abi $abis {
- set options [concat $common $opt $abi]
- verbose "Testing $testname, $options" 1
- dg-test $test $options ""
- }
- }
- }
-}
-
-# Like check_conditional_xfail, but callable from a dg test.
-
-proc dg-xfail-if { args } {
- set args [lreplace $args 0 0]
- set selector "target [join [lindex $args 1]]"
- if { [dg-process-target $selector] == "S" } {
- global compiler_conditional_xfail_data
- set compiler_conditional_xfail_data $args
- }
-}
-
-proc check-flags { args } {
-
- # The args are within another list; pull them out.
- set args [lindex $args 0]
-
- # The next two arguments are optional. If they were not specified,
- # use the defaults.
- if { [llength $args] == 2 } {
- lappend $args [list "*"]
- }
- if { [llength $args] == 3 } {
- lappend $args [list ""]
- }
-
- # If the option strings are the defaults, or the same as the
- # defaults, there is no need to call check_conditional_xfail to
- # compare them to the actual options.
- if { [string compare [lindex $args 2] "*"] == 0
- && [string compare [lindex $args 3] "" ] == 0 } {
- set result 1
- } else {
- # The target list might be an effective-target keyword, so replace
- # the original list with "*-*-*", since we already know it matches.
- set result [check_conditional_xfail [lreplace $args 1 1 "*-*-*"]]
- }
-
- return $result
-}
-
-proc dg-skip-if { args } {
- # Verify the number of arguments. The last two are optional.
- set args [lreplace $args 0 0]
- if { [llength $args] < 2 || [llength $args] > 4 } {
- error "dg-skip-if 2: need 2, 3, or 4 arguments"
- }
-
- # Don't bother if we're already skipping the test.
- upvar dg-do-what dg-do-what
- if { [lindex ${dg-do-what} 1] == "N" } {
- return
- }
-
- set selector [list target [lindex $args 1]]
- if { [dg-process-target $selector] == "S" } {
- if [check-flags $args] {
- upvar dg-do-what dg-do-what
- set dg-do-what [list [lindex ${dg-do-what} 0] "N" "P"]
- }
- }
-}
-
-# We need to make sure that additional_files and additional_sources
-# are both cleared out after every test. It is not enough to clear
-# them out *before* the next test run because gcc-target-compile gets
-# run directly from some .exp files (outside of any test). (Those
-# uses should eventually be eliminated.)
-
-# Because the DG framework doesn't provide a hook that is run at the
-# end of a test, we must replace dg-test with a wrapper.
-
-if { [info procs saved-dg-test] == [list] } {
- rename dg-test saved-dg-test
-
- proc dg-test { args } {
- global additional_files
- global additional_sources
- global errorInfo
-
- if { [ catch { eval saved-dg-test $args } errmsg ] } {
- set saved_info $errorInfo
- set additional_files ""
- set additional_sources ""
- error $errmsg $saved_info
- }
- set additional_files ""
- set additional_sources ""
- }
-}
-
-# Local Variables:
-# tcl-indent-level:4
-# End:
diff --git a/Modules/_ctypes/libffi/testsuite/lib/target-libpath.exp b/Modules/_ctypes/libffi/testsuite/lib/target-libpath.exp
deleted file mode 100644
index 6b7beba935..0000000000
--- a/Modules/_ctypes/libffi/testsuite/lib/target-libpath.exp
+++ /dev/null
@@ -1,283 +0,0 @@
-# Copyright (C) 2004, 2005, 2007 Free Software Foundation, Inc.
-
-# 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 3 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 GCC; see the file COPYING3. If not see
-# <http://www.gnu.org/licenses/>.
-
-# This file was contributed by John David Anglin (dave.anglin@nrc-cnrc.gc.ca)
-
-set orig_environment_saved 0
-set orig_ld_library_path_saved 0
-set orig_ld_run_path_saved 0
-set orig_shlib_path_saved 0
-set orig_ld_libraryn32_path_saved 0
-set orig_ld_library64_path_saved 0
-set orig_ld_library_path_32_saved 0
-set orig_ld_library_path_64_saved 0
-set orig_dyld_library_path_saved 0
-set orig_path_saved 0
-
-#######################################
-# proc set_ld_library_path_env_vars { }
-#######################################
-
-proc set_ld_library_path_env_vars { } {
- global ld_library_path
- global orig_environment_saved
- global orig_ld_library_path_saved
- global orig_ld_run_path_saved
- global orig_shlib_path_saved
- global orig_ld_libraryn32_path_saved
- global orig_ld_library64_path_saved
- global orig_ld_library_path_32_saved
- global orig_ld_library_path_64_saved
- global orig_dyld_library_path_saved
- global orig_path_saved
- global orig_ld_library_path
- global orig_ld_run_path
- global orig_shlib_path
- global orig_ld_libraryn32_path
- global orig_ld_library64_path
- global orig_ld_library_path_32
- global orig_ld_library_path_64
- global orig_dyld_library_path
- global orig_path
- global GCC_EXEC_PREFIX
-
- # Set the relocated compiler prefix, but only if the user hasn't specified one.
- if { [info exists GCC_EXEC_PREFIX] && ![info exists env(GCC_EXEC_PREFIX)] } {
- setenv GCC_EXEC_PREFIX "$GCC_EXEC_PREFIX"
- }
-
- # Setting the ld library path causes trouble when testing cross-compilers.
- if { [is_remote target] } {
- return
- }
-
- if { $orig_environment_saved == 0 } {
- global env
-
- set orig_environment_saved 1
-
- # Save the original environment.
- if [info exists env(LD_LIBRARY_PATH)] {
- set orig_ld_library_path "$env(LD_LIBRARY_PATH)"
- set orig_ld_library_path_saved 1
- }
- if [info exists env(LD_RUN_PATH)] {
- set orig_ld_run_path "$env(LD_RUN_PATH)"
- set orig_ld_run_path_saved 1
- }
- if [info exists env(SHLIB_PATH)] {
- set orig_shlib_path "$env(SHLIB_PATH)"
- set orig_shlib_path_saved 1
- }
- if [info exists env(LD_LIBRARYN32_PATH)] {
- set orig_ld_libraryn32_path "$env(LD_LIBRARYN32_PATH)"
- set orig_ld_libraryn32_path_saved 1
- }
- if [info exists env(LD_LIBRARY64_PATH)] {
- set orig_ld_library64_path "$env(LD_LIBRARY64_PATH)"
- set orig_ld_library64_path_saved 1
- }
- if [info exists env(LD_LIBRARY_PATH_32)] {
- set orig_ld_library_path_32 "$env(LD_LIBRARY_PATH_32)"
- set orig_ld_library_path_32_saved 1
- }
- if [info exists env(LD_LIBRARY_PATH_64)] {
- set orig_ld_library_path_64 "$env(LD_LIBRARY_PATH_64)"
- set orig_ld_library_path_64_saved 1
- }
- if [info exists env(DYLD_LIBRARY_PATH)] {
- set orig_dyld_library_path "$env(DYLD_LIBRARY_PATH)"
- set orig_dyld_library_path_saved 1
- }
- if [info exists env(PATH)] {
- set orig_path "$env(PATH)"
- set orig_path_saved 1
- }
- }
-
- # We need to set ld library path in the environment. Currently,
- # unix.exp doesn't set the environment correctly for all systems.
- # It only sets SHLIB_PATH and LD_LIBRARY_PATH when it executes a
- # program. We also need the environment set for compilations, etc.
- #
- # On IRIX 6, we have to set variables akin to LD_LIBRARY_PATH, but
- # called LD_LIBRARYN32_PATH (for the N32 ABI) and LD_LIBRARY64_PATH
- # (for the 64-bit ABI). The same applies to Darwin (DYLD_LIBRARY_PATH),
- # Solaris 32 bit (LD_LIBRARY_PATH_32), Solaris 64 bit (LD_LIBRARY_PATH_64),
- # and HP-UX (SHLIB_PATH). In some cases, the variables are independent
- # of LD_LIBRARY_PATH, and in other cases LD_LIBRARY_PATH is used if the
- # variable is not defined.
- #
- # Doing this is somewhat of a hack as ld_library_path gets repeated in
- # SHLIB_PATH and LD_LIBRARY_PATH when unix_load sets these variables.
- if { $orig_ld_library_path_saved } {
- setenv LD_LIBRARY_PATH "$ld_library_path:$orig_ld_library_path"
- } else {
- setenv LD_LIBRARY_PATH "$ld_library_path"
- }
- if { $orig_ld_run_path_saved } {
- setenv LD_RUN_PATH "$ld_library_path:$orig_ld_run_path"
- } else {
- setenv LD_RUN_PATH "$ld_library_path"
- }
- # The default shared library dynamic path search for 64-bit
- # HP-UX executables searches LD_LIBRARY_PATH before SHLIB_PATH.
- # LD_LIBRARY_PATH isn't used for 32-bit executables. Thus, we
- # set LD_LIBRARY_PATH and SHLIB_PATH as if they were independent.
- if { $orig_shlib_path_saved } {
- setenv SHLIB_PATH "$ld_library_path:$orig_shlib_path"
- } else {
- setenv SHLIB_PATH "$ld_library_path"
- }
- if { $orig_ld_libraryn32_path_saved } {
- setenv LD_LIBRARYN32_PATH "$ld_library_path:$orig_ld_libraryn32_path"
- } elseif { $orig_ld_library_path_saved } {
- setenv LD_LIBRARYN32_PATH "$ld_library_path:$orig_ld_library_path"
- } else {
- setenv LD_LIBRARYN32_PATH "$ld_library_path"
- }
- if { $orig_ld_library64_path_saved } {
- setenv LD_LIBRARY64_PATH "$ld_library_path:$orig_ld_library64_path"
- } elseif { $orig_ld_library_path_saved } {
- setenv LD_LIBRARY64_PATH "$ld_library_path:$orig_ld_library_path"
- } else {
- setenv LD_LIBRARY64_PATH "$ld_library_path"
- }
- if { $orig_ld_library_path_32_saved } {
- setenv LD_LIBRARY_PATH_32 "$ld_library_path:$orig_ld_library_path_32"
- } elseif { $orig_ld_library_path_saved } {
- setenv LD_LIBRARY_PATH_32 "$ld_library_path:$orig_ld_library_path"
- } else {
- setenv LD_LIBRARY_PATH_32 "$ld_library_path"
- }
- if { $orig_ld_library_path_64_saved } {
- setenv LD_LIBRARY_PATH_64 "$ld_library_path:$orig_ld_library_path_64"
- } elseif { $orig_ld_library_path_saved } {
- setenv LD_LIBRARY_PATH_64 "$ld_library_path:$orig_ld_library_path"
- } else {
- setenv LD_LIBRARY_PATH_64 "$ld_library_path"
- }
- if { $orig_dyld_library_path_saved } {
- setenv DYLD_LIBRARY_PATH "$ld_library_path:$orig_dyld_library_path"
- } else {
- setenv DYLD_LIBRARY_PATH "$ld_library_path"
- }
- if { [istarget *-*-cygwin*] || [istarget *-*-mingw*] } {
- if { $orig_path_saved } {
- setenv PATH "$ld_library_path:$orig_path"
- } else {
- setenv PATH "$ld_library_path"
- }
- }
-
- verbose -log "set_ld_library_path_env_vars: ld_library_path=$ld_library_path"
-}
-
-#######################################
-# proc restore_ld_library_path_env_vars { }
-#######################################
-
-proc restore_ld_library_path_env_vars { } {
- global orig_environment_saved
- global orig_ld_library_path_saved
- global orig_ld_run_path_saved
- global orig_shlib_path_saved
- global orig_ld_libraryn32_path_saved
- global orig_ld_library64_path_saved
- global orig_ld_library_path_32_saved
- global orig_ld_library_path_64_saved
- global orig_dyld_library_path_saved
- global orig_path_saved
- global orig_ld_library_path
- global orig_ld_run_path
- global orig_shlib_path
- global orig_ld_libraryn32_path
- global orig_ld_library64_path
- global orig_ld_library_path_32
- global orig_ld_library_path_64
- global orig_dyld_library_path
- global orig_path
-
- if { $orig_environment_saved == 0 } {
- return
- }
-
- if { $orig_ld_library_path_saved } {
- setenv LD_LIBRARY_PATH "$orig_ld_library_path"
- } elseif [info exists env(LD_LIBRARY_PATH)] {
- unsetenv LD_LIBRARY_PATH
- }
- if { $orig_ld_run_path_saved } {
- setenv LD_RUN_PATH "$orig_ld_run_path"
- } elseif [info exists env(LD_RUN_PATH)] {
- unsetenv LD_RUN_PATH
- }
- if { $orig_shlib_path_saved } {
- setenv SHLIB_PATH "$orig_shlib_path"
- } elseif [info exists env(SHLIB_PATH)] {
- unsetenv SHLIB_PATH
- }
- if { $orig_ld_libraryn32_path_saved } {
- setenv LD_LIBRARYN32_PATH "$orig_ld_libraryn32_path"
- } elseif [info exists env(LD_LIBRARYN32_PATH)] {
- unsetenv LD_LIBRARYN32_PATH
- }
- if { $orig_ld_library64_path_saved } {
- setenv LD_LIBRARY64_PATH "$orig_ld_library64_path"
- } elseif [info exists env(LD_LIBRARY64_PATH)] {
- unsetenv LD_LIBRARY64_PATH
- }
- if { $orig_ld_library_path_32_saved } {
- setenv LD_LIBRARY_PATH_32 "$orig_ld_library_path_32"
- } elseif [info exists env(LD_LIBRARY_PATH_32)] {
- unsetenv LD_LIBRARY_PATH_32
- }
- if { $orig_ld_library_path_64_saved } {
- setenv LD_LIBRARY_PATH_64 "$orig_ld_library_path_64"
- } elseif [info exists env(LD_LIBRARY_PATH_64)] {
- unsetenv LD_LIBRARY_PATH_64
- }
- if { $orig_dyld_library_path_saved } {
- setenv DYLD_LIBRARY_PATH "$orig_dyld_library_path"
- } elseif [info exists env(DYLD_LIBRARY_PATH)] {
- unsetenv DYLD_LIBRARY_PATH
- }
- if { $orig_path_saved } {
- setenv PATH "$orig_path"
- } elseif [info exists env(PATH)] {
- unsetenv PATH
- }
-}
-
-#######################################
-# proc get_shlib_extension { }
-#######################################
-
-proc get_shlib_extension { } {
- global shlib_ext
-
- if { [ istarget *-*-darwin* ] } {
- set shlib_ext "dylib"
- } elseif { [ istarget *-*-cygwin* ] || [ istarget *-*-mingw* ] } {
- set shlib_ext "dll"
- } elseif { [ istarget hppa*-*-hpux* ] } {
- set shlib_ext "sl"
- } else {
- set shlib_ext "so"
- }
- return $shlib_ext
-}
-
diff --git a/Modules/_ctypes/libffi/testsuite/lib/wrapper.exp b/Modules/_ctypes/libffi/testsuite/lib/wrapper.exp
deleted file mode 100644
index 4e5ae435a1..0000000000
--- a/Modules/_ctypes/libffi/testsuite/lib/wrapper.exp
+++ /dev/null
@@ -1,45 +0,0 @@
-# Copyright (C) 2004, 2007 Free Software Foundation, Inc.
-
-# 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 3 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 GCC; see the file COPYING3. If not see
-# <http://www.gnu.org/licenses/>.
-
-# This file contains GCC-specifics for status wrappers for test programs.
-
-# ${tool}_maybe_build_wrapper -- Build wrapper object if the target
-# needs it. FILENAME is the path to the wrapper file. If there are
-# additional arguments, they are command-line options to provide to
-# the compiler when compiling FILENAME.
-
-proc ${tool}_maybe_build_wrapper { filename args } {
- global gluefile wrap_flags
-
- if { [target_info needs_status_wrapper] != "" \
- && [target_info needs_status_wrapper] != "0" \
- && ![info exists gluefile] } {
- set saved_wrap_compile_flags [target_info wrap_compile_flags]
- set flags [join $args " "]
- # The wrapper code may contain code that gcc objects on. This
- # became true for dejagnu-1.4.4. The set of warnings and code
- # that gcc objects on may change, so just make sure -w is always
- # passed to turn off all warnings.
- set_currtarget_info wrap_compile_flags \
- "$saved_wrap_compile_flags -w $flags"
- set result [build_wrapper $filename]
- set_currtarget_info wrap_compile_flags "$saved_wrap_compile_flags"
- if { $result != "" } {
- set gluefile [lindex $result 0]
- set wrap_flags [lindex $result 1]
- }
- }
-}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/call.exp b/Modules/_ctypes/libffi/testsuite/libffi.call/call.exp
deleted file mode 100644
index 36d13d8e08..0000000000
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/call.exp
+++ /dev/null
@@ -1,28 +0,0 @@
-# Copyright (C) 2003, 2006, 2009, 2010 Free Software Foundation, Inc.
-
-# 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 3 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; see the file COPYING3. If not see
-# <http://www.gnu.org/licenses/>.
-
-dg-init
-libffi-init
-
-global srcdir subdir
-
-run-many-tests [lsort [glob -nocomplain -- $srcdir/$subdir/*.{c,cc}]] ""
-
-dg-finish
-
-# Local Variables:
-# tcl-indent-level:4
-# End:
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/closure_fn0.c b/Modules/_ctypes/libffi/testsuite/libffi.call/closure_fn0.c
deleted file mode 100644
index a579ff6c97..0000000000
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/closure_fn0.c
+++ /dev/null
@@ -1,89 +0,0 @@
-/* Area: closure_call
- Purpose: Check multiple values passing from different type.
- Also, exceed the limit of gpr and fpr registers on PowerPC
- Darwin.
- Limitations: none.
- PR: none.
- Originator: <andreast@gcc.gnu.org> 20030828 */
-
-
-
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-static void
-closure_test_fn0(ffi_cif* cif __UNUSED__, void* resp, void** args,
- void* userdata)
-{
- *(ffi_arg*)resp =
- (int)*(unsigned long long *)args[0] + (int)(*(int *)args[1]) +
- (int)(*(unsigned long long *)args[2]) + (int)*(int *)args[3] +
- (int)(*(signed short *)args[4]) +
- (int)(*(unsigned long long *)args[5]) +
- (int)*(int *)args[6] + (int)(*(int *)args[7]) +
- (int)(*(double *)args[8]) + (int)*(int *)args[9] +
- (int)(*(int *)args[10]) + (int)(*(float *)args[11]) +
- (int)*(int *)args[12] + (int)(*(int *)args[13]) +
- (int)(*(int *)args[14]) + *(int *)args[15] + (intptr_t)userdata;
-
- printf("%d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d: %d\n",
- (int)*(unsigned long long *)args[0], (int)(*(int *)args[1]),
- (int)(*(unsigned long long *)args[2]),
- (int)*(int *)args[3], (int)(*(signed short *)args[4]),
- (int)(*(unsigned long long *)args[5]),
- (int)*(int *)args[6], (int)(*(int *)args[7]),
- (int)(*(double *)args[8]), (int)*(int *)args[9],
- (int)(*(int *)args[10]), (int)(*(float *)args[11]),
- (int)*(int *)args[12], (int)(*(int *)args[13]),
- (int)(*(int *)args[14]),*(int *)args[15],
- (int)(intptr_t)userdata, (int)*(ffi_arg *)resp);
-
-}
-
-typedef int (*closure_test_type0)(unsigned long long, int, unsigned long long,
- int, signed short, unsigned long long, int,
- int, double, int, int, float, int, int,
- int, int);
-
-int main (void)
-{
- ffi_cif cif;
- void * code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- ffi_type * cl_arg_types[17];
- int res;
-
- cl_arg_types[0] = &ffi_type_uint64;
- cl_arg_types[1] = &ffi_type_sint;
- cl_arg_types[2] = &ffi_type_uint64;
- cl_arg_types[3] = &ffi_type_sint;
- cl_arg_types[4] = &ffi_type_sshort;
- cl_arg_types[5] = &ffi_type_uint64;
- cl_arg_types[6] = &ffi_type_sint;
- cl_arg_types[7] = &ffi_type_sint;
- cl_arg_types[8] = &ffi_type_double;
- cl_arg_types[9] = &ffi_type_sint;
- cl_arg_types[10] = &ffi_type_sint;
- cl_arg_types[11] = &ffi_type_float;
- cl_arg_types[12] = &ffi_type_sint;
- cl_arg_types[13] = &ffi_type_sint;
- cl_arg_types[14] = &ffi_type_sint;
- cl_arg_types[15] = &ffi_type_sint;
- cl_arg_types[16] = NULL;
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 16,
- &ffi_type_sint, cl_arg_types) == FFI_OK);
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, closure_test_fn0,
- (void *) 3 /* userdata */, code) == FFI_OK);
-
- res = (*((closure_test_type0)code))
- (1LL, 2, 3LL, 4, 127, 429LL, 7, 8, 9.5, 10, 11, 12, 13,
- 19, 21, 1);
- /* { dg-output "1 2 3 4 127 429 7 8 9 10 11 12 13 19 21 1 3: 680" } */
- printf("res: %d\n",res);
- /* { dg-output "\nres: 680" } */
- exit(0);
-}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/closure_fn1.c b/Modules/_ctypes/libffi/testsuite/libffi.call/closure_fn1.c
deleted file mode 100644
index 91231738c1..0000000000
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/closure_fn1.c
+++ /dev/null
@@ -1,81 +0,0 @@
-/* Area: closure_call.
- Purpose: Check multiple values passing from different type.
- Also, exceed the limit of gpr and fpr registers on PowerPC
- Darwin.
- Limitations: none.
- PR: none.
- Originator: <andreast@gcc.gnu.org> 20030828 */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-
-static void closure_test_fn1(ffi_cif* cif __UNUSED__, void* resp, void** args,
- void* userdata)
-{
- *(ffi_arg*)resp =
- (int)*(float *)args[0] +(int)(*(float *)args[1]) +
- (int)(*(float *)args[2]) + (int)*(float *)args[3] +
- (int)(*(signed short *)args[4]) + (int)(*(float *)args[5]) +
- (int)*(float *)args[6] + (int)(*(int *)args[7]) +
- (int)(*(double*)args[8]) + (int)*(int *)args[9] +
- (int)(*(int *)args[10]) + (int)(*(float *)args[11]) +
- (int)*(int *)args[12] + (int)(*(int *)args[13]) +
- (int)(*(int *)args[14]) + *(int *)args[15] + (intptr_t)userdata;
-
- printf("%d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d: %d\n",
- (int)*(float *)args[0], (int)(*(float *)args[1]),
- (int)(*(float *)args[2]), (int)*(float *)args[3],
- (int)(*(signed short *)args[4]), (int)(*(float *)args[5]),
- (int)*(float *)args[6], (int)(*(int *)args[7]),
- (int)(*(double *)args[8]), (int)*(int *)args[9],
- (int)(*(int *)args[10]), (int)(*(float *)args[11]),
- (int)*(int *)args[12], (int)(*(int *)args[13]),
- (int)(*(int *)args[14]), *(int *)args[15],
- (int)(intptr_t)userdata, (int)*(ffi_arg *)resp);
-}
-
-typedef int (*closure_test_type1)(float, float, float, float, signed short,
- float, float, int, double, int, int, float,
- int, int, int, int);
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- ffi_type * cl_arg_types[17];
- int res;
-
- cl_arg_types[0] = &ffi_type_float;
- cl_arg_types[1] = &ffi_type_float;
- cl_arg_types[2] = &ffi_type_float;
- cl_arg_types[3] = &ffi_type_float;
- cl_arg_types[4] = &ffi_type_sshort;
- cl_arg_types[5] = &ffi_type_float;
- cl_arg_types[6] = &ffi_type_float;
- cl_arg_types[7] = &ffi_type_sint;
- cl_arg_types[8] = &ffi_type_double;
- cl_arg_types[9] = &ffi_type_sint;
- cl_arg_types[10] = &ffi_type_sint;
- cl_arg_types[11] = &ffi_type_float;
- cl_arg_types[12] = &ffi_type_sint;
- cl_arg_types[13] = &ffi_type_sint;
- cl_arg_types[14] = &ffi_type_sint;
- cl_arg_types[15] = &ffi_type_sint;
- cl_arg_types[16] = NULL;
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 16,
- &ffi_type_sint, cl_arg_types) == FFI_OK);
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, closure_test_fn1,
- (void *) 3 /* userdata */, code) == FFI_OK);
-
- res = (*((closure_test_type1)code))
- (1.1, 2.2, 3.3, 4.4, 127, 5.5, 6.6, 8, 9, 10, 11, 12.0, 13,
- 19, 21, 1);
- /* { dg-output "1 2 3 4 127 5 6 8 9 10 11 12 13 19 21 1 3: 255" } */
- printf("res: %d\n",res);
- /* { dg-output "\nres: 255" } */
- exit(0);
-}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/closure_fn2.c b/Modules/_ctypes/libffi/testsuite/libffi.call/closure_fn2.c
deleted file mode 100644
index 08ff9d9227..0000000000
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/closure_fn2.c
+++ /dev/null
@@ -1,81 +0,0 @@
-/* Area: closure_call
- Purpose: Check multiple values passing from different type.
- Also, exceed the limit of gpr and fpr registers on PowerPC
- Darwin.
- Limitations: none.
- PR: none.
- Originator: <andreast@gcc.gnu.org> 20030828 */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-static void closure_test_fn2(ffi_cif* cif __UNUSED__, void* resp, void** args,
- void* userdata)
-{
- *(ffi_arg*)resp =
- (int)*(double *)args[0] +(int)(*(double *)args[1]) +
- (int)(*(double *)args[2]) + (int)*(double *)args[3] +
- (int)(*(signed short *)args[4]) + (int)(*(double *)args[5]) +
- (int)*(double *)args[6] + (int)(*(int *)args[7]) +
- (int)(*(double *)args[8]) + (int)*(int *)args[9] +
- (int)(*(int *)args[10]) + (int)(*(float *)args[11]) +
- (int)*(int *)args[12] + (int)(*(float *)args[13]) +
- (int)(*(int *)args[14]) + *(int *)args[15] + (intptr_t)userdata;
-
- printf("%d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d: %d\n",
- (int)*(double *)args[0], (int)(*(double *)args[1]),
- (int)(*(double *)args[2]), (int)*(double *)args[3],
- (int)(*(signed short *)args[4]), (int)(*(double *)args[5]),
- (int)*(double *)args[6], (int)(*(int *)args[7]),
- (int)(*(double*)args[8]), (int)*(int *)args[9],
- (int)(*(int *)args[10]), (int)(*(float *)args[11]),
- (int)*(int *)args[12], (int)(*(float *)args[13]),
- (int)(*(int *)args[14]), *(int *)args[15], (int)(intptr_t)userdata,
- (int)*(ffi_arg *)resp);
-}
-
-typedef int (*closure_test_type2)(double, double, double, double, signed short,
- double, double, int, double, int, int, float,
- int, float, int, int);
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- ffi_type * cl_arg_types[17];
- int res;
-
- cl_arg_types[0] = &ffi_type_double;
- cl_arg_types[1] = &ffi_type_double;
- cl_arg_types[2] = &ffi_type_double;
- cl_arg_types[3] = &ffi_type_double;
- cl_arg_types[4] = &ffi_type_sshort;
- cl_arg_types[5] = &ffi_type_double;
- cl_arg_types[6] = &ffi_type_double;
- cl_arg_types[7] = &ffi_type_sint;
- cl_arg_types[8] = &ffi_type_double;
- cl_arg_types[9] = &ffi_type_sint;
- cl_arg_types[10] = &ffi_type_sint;
- cl_arg_types[11] = &ffi_type_float;
- cl_arg_types[12] = &ffi_type_sint;
- cl_arg_types[13] = &ffi_type_float;
- cl_arg_types[14] = &ffi_type_sint;
- cl_arg_types[15] = &ffi_type_sint;
- cl_arg_types[16] = NULL;
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 16,
- &ffi_type_sint, cl_arg_types) == FFI_OK);
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, closure_test_fn2,
- (void *) 3 /* userdata */, code) == FFI_OK);
-
- res = (*((closure_test_type2)code))
- (1, 2, 3, 4, 127, 5, 6, 8, 9, 10, 11, 12.0, 13,
- 19.0, 21, 1);
- /* { dg-output "1 2 3 4 127 5 6 8 9 10 11 12 13 19 21 1 3: 255" } */
- printf("res: %d\n",res);
- /* { dg-output "\nres: 255" } */
- exit(0);
-}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/closure_fn3.c b/Modules/_ctypes/libffi/testsuite/libffi.call/closure_fn3.c
deleted file mode 100644
index 9b54d805c8..0000000000
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/closure_fn3.c
+++ /dev/null
@@ -1,82 +0,0 @@
-/* Area: closure_call
- Purpose: Check multiple values passing from different type.
- Also, exceed the limit of gpr and fpr registers on PowerPC
- Darwin.
- Limitations: none.
- PR: none.
- Originator: <andreast@gcc.gnu.org> 20030828 */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-static void closure_test_fn3(ffi_cif* cif __UNUSED__, void* resp, void** args,
- void* userdata)
- {
- *(ffi_arg*)resp =
- (int)*(float *)args[0] +(int)(*(float *)args[1]) +
- (int)(*(float *)args[2]) + (int)*(float *)args[3] +
- (int)(*(float *)args[4]) + (int)(*(float *)args[5]) +
- (int)*(float *)args[6] + (int)(*(float *)args[7]) +
- (int)(*(double *)args[8]) + (int)*(int *)args[9] +
- (int)(*(float *)args[10]) + (int)(*(float *)args[11]) +
- (int)*(int *)args[12] + (int)(*(float *)args[13]) +
- (int)(*(float *)args[14]) + *(int *)args[15] + (intptr_t)userdata;
-
- printf("%d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d: %d\n",
- (int)*(float *)args[0], (int)(*(float *)args[1]),
- (int)(*(float *)args[2]), (int)*(float *)args[3],
- (int)(*(float *)args[4]), (int)(*(float *)args[5]),
- (int)*(float *)args[6], (int)(*(float *)args[7]),
- (int)(*(double *)args[8]), (int)*(int *)args[9],
- (int)(*(float *)args[10]), (int)(*(float *)args[11]),
- (int)*(int *)args[12], (int)(*(float *)args[13]),
- (int)(*(float *)args[14]), *(int *)args[15], (int)(intptr_t)userdata,
- (int)*(ffi_arg *)resp);
-
- }
-
-typedef int (*closure_test_type3)(float, float, float, float, float, float,
- float, float, double, int, float, float, int,
- float, float, int);
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- ffi_type * cl_arg_types[17];
- int res;
-
- cl_arg_types[0] = &ffi_type_float;
- cl_arg_types[1] = &ffi_type_float;
- cl_arg_types[2] = &ffi_type_float;
- cl_arg_types[3] = &ffi_type_float;
- cl_arg_types[4] = &ffi_type_float;
- cl_arg_types[5] = &ffi_type_float;
- cl_arg_types[6] = &ffi_type_float;
- cl_arg_types[7] = &ffi_type_float;
- cl_arg_types[8] = &ffi_type_double;
- cl_arg_types[9] = &ffi_type_sint;
- cl_arg_types[10] = &ffi_type_float;
- cl_arg_types[11] = &ffi_type_float;
- cl_arg_types[12] = &ffi_type_sint;
- cl_arg_types[13] = &ffi_type_float;
- cl_arg_types[14] = &ffi_type_float;
- cl_arg_types[15] = &ffi_type_sint;
- cl_arg_types[16] = NULL;
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 16,
- &ffi_type_sint, cl_arg_types) == FFI_OK);
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, closure_test_fn3,
- (void *) 3 /* userdata */, code) == FFI_OK);
-
- res = (*((closure_test_type3)code))
- (1.1, 2.2, 3.3, 4.4, 5.5, 6.6, 7.7, 8.8, 9, 10, 11.11, 12.0, 13,
- 19.19, 21.21, 1);
- /* { dg-output "1 2 3 4 5 6 7 8 9 10 11 12 13 19 21 1 3: 135" } */
- printf("res: %d\n",res);
- /* { dg-output "\nres: 135" } */
- exit(0);
-}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/closure_fn4.c b/Modules/_ctypes/libffi/testsuite/libffi.call/closure_fn4.c
deleted file mode 100644
index d4a1530b06..0000000000
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/closure_fn4.c
+++ /dev/null
@@ -1,89 +0,0 @@
-/* Area: closure_call
- Purpose: Check multiple long long values passing.
- Also, exceed the limit of gpr and fpr registers on PowerPC
- Darwin.
- Limitations: none.
- PR: none.
- Originator: <andreast@gcc.gnu.org> 20031026 */
-
-/* { dg-do run } */
-
-#include "ffitest.h"
-
-static void
-closure_test_fn0(ffi_cif* cif __UNUSED__, void* resp, void** args,
- void* userdata)
-{
- *(ffi_arg*)resp =
- (int)*(unsigned long long *)args[0] + (int)*(unsigned long long *)args[1] +
- (int)*(unsigned long long *)args[2] + (int)*(unsigned long long *)args[3] +
- (int)*(unsigned long long *)args[4] + (int)*(unsigned long long *)args[5] +
- (int)*(unsigned long long *)args[6] + (int)*(unsigned long long *)args[7] +
- (int)*(unsigned long long *)args[8] + (int)*(unsigned long long *)args[9] +
- (int)*(unsigned long long *)args[10] +
- (int)*(unsigned long long *)args[11] +
- (int)*(unsigned long long *)args[12] +
- (int)*(unsigned long long *)args[13] +
- (int)*(unsigned long long *)args[14] +
- *(int *)args[15] + (intptr_t)userdata;
-
- printf("%d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d: %d\n",
- (int)*(unsigned long long *)args[0],
- (int)*(unsigned long long *)args[1],
- (int)*(unsigned long long *)args[2],
- (int)*(unsigned long long *)args[3],
- (int)*(unsigned long long *)args[4],
- (int)*(unsigned long long *)args[5],
- (int)*(unsigned long long *)args[6],
- (int)*(unsigned long long *)args[7],
- (int)*(unsigned long long *)args[8],
- (int)*(unsigned long long *)args[9],
- (int)*(unsigned long long *)args[10],
- (int)*(unsigned long long *)args[11],
- (int)*(unsigned long long *)args[12],
- (int)*(unsigned long long *)args[13],
- (int)*(unsigned long long *)args[14],
- *(int *)args[15],
- (int)(intptr_t)userdata, (int)*(ffi_arg *)resp);
-
-}
-
-typedef int (*closure_test_type0)(unsigned long long, unsigned long long,
- unsigned long long, unsigned long long,
- unsigned long long, unsigned long long,
- unsigned long long, unsigned long long,
- unsigned long long, unsigned long long,
- unsigned long long, unsigned long long,
- unsigned long long, unsigned long long,
- unsigned long long, int);
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- ffi_type * cl_arg_types[17];
- int i, res;
-
- for (i = 0; i < 15; i++) {
- cl_arg_types[i] = &ffi_type_uint64;
- }
- cl_arg_types[15] = &ffi_type_sint;
- cl_arg_types[16] = NULL;
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 16,
- &ffi_type_sint, cl_arg_types) == FFI_OK);
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, closure_test_fn0,
- (void *) 3 /* userdata */, code) == FFI_OK);
-
- res = (*((closure_test_type0)code))
- (1LL, 2LL, 3LL, 4LL, 127LL, 429LL, 7LL, 8LL, 9LL, 10LL, 11LL, 12LL,
- 13LL, 19LL, 21LL, 1);
- /* { dg-output "1 2 3 4 127 429 7 8 9 10 11 12 13 19 21 1 3: 680" } */
- printf("res: %d\n",res);
- /* { dg-output "\nres: 680" } */
-
- exit(0);
-}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/closure_fn5.c b/Modules/_ctypes/libffi/testsuite/libffi.call/closure_fn5.c
deleted file mode 100644
index 99074426c6..0000000000
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/closure_fn5.c
+++ /dev/null
@@ -1,92 +0,0 @@
-/* Area: closure_call
- Purpose: Check multiple long long values passing.
- Exceed the limit of gpr registers on PowerPC
- Darwin.
- Limitations: none.
- PR: none.
- Originator: <andreast@gcc.gnu.org> 20031026 */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-static void
-closure_test_fn5(ffi_cif* cif __UNUSED__, void* resp, void** args,
- void* userdata)
-{
- *(ffi_arg*)resp =
- (int)*(unsigned long long *)args[0] + (int)*(unsigned long long *)args[1] +
- (int)*(unsigned long long *)args[2] + (int)*(unsigned long long *)args[3] +
- (int)*(unsigned long long *)args[4] + (int)*(unsigned long long *)args[5] +
- (int)*(unsigned long long *)args[6] + (int)*(unsigned long long *)args[7] +
- (int)*(unsigned long long *)args[8] + (int)*(unsigned long long *)args[9] +
- (int)*(int *)args[10] +
- (int)*(unsigned long long *)args[11] +
- (int)*(unsigned long long *)args[12] +
- (int)*(unsigned long long *)args[13] +
- (int)*(unsigned long long *)args[14] +
- *(int *)args[15] + (intptr_t)userdata;
-
- printf("%d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d: %d\n",
- (int)*(unsigned long long *)args[0],
- (int)*(unsigned long long *)args[1],
- (int)*(unsigned long long *)args[2],
- (int)*(unsigned long long *)args[3],
- (int)*(unsigned long long *)args[4],
- (int)*(unsigned long long *)args[5],
- (int)*(unsigned long long *)args[6],
- (int)*(unsigned long long *)args[7],
- (int)*(unsigned long long *)args[8],
- (int)*(unsigned long long *)args[9],
- (int)*(int *)args[10],
- (int)*(unsigned long long *)args[11],
- (int)*(unsigned long long *)args[12],
- (int)*(unsigned long long *)args[13],
- (int)*(unsigned long long *)args[14],
- *(int *)args[15],
- (int)(intptr_t)userdata, (int)*(ffi_arg *)resp);
-
-}
-
-typedef int (*closure_test_type0)(unsigned long long, unsigned long long,
- unsigned long long, unsigned long long,
- unsigned long long, unsigned long long,
- unsigned long long, unsigned long long,
- unsigned long long, unsigned long long,
- int, unsigned long long,
- unsigned long long, unsigned long long,
- unsigned long long, int);
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- ffi_type * cl_arg_types[17];
- int i, res;
-
- for (i = 0; i < 10; i++) {
- cl_arg_types[i] = &ffi_type_uint64;
- }
- cl_arg_types[10] = &ffi_type_sint;
- for (i = 11; i < 15; i++) {
- cl_arg_types[i] = &ffi_type_uint64;
- }
- cl_arg_types[15] = &ffi_type_sint;
- cl_arg_types[16] = NULL;
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 16,
- &ffi_type_sint, cl_arg_types) == FFI_OK);
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, closure_test_fn5,
- (void *) 3 /* userdata */, code) == FFI_OK);
-
- res = (*((closure_test_type0)code))
- (1LL, 2LL, 3LL, 4LL, 127LL, 429LL, 7LL, 8LL, 9LL, 10LL, 11, 12LL,
- 13LL, 19LL, 21LL, 1);
- /* { dg-output "1 2 3 4 127 429 7 8 9 10 11 12 13 19 21 1 3: 680" } */
- printf("res: %d\n",res);
- /* { dg-output "\nres: 680" } */
-
- exit(0);
-}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/closure_fn6.c b/Modules/_ctypes/libffi/testsuite/libffi.call/closure_fn6.c
deleted file mode 100644
index 73c54fd6b1..0000000000
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/closure_fn6.c
+++ /dev/null
@@ -1,90 +0,0 @@
-/* Area: closure_call
- Purpose: Check multiple values passing from different type.
- Also, exceed the limit of gpr and fpr registers on PowerPC.
- Limitations: none.
- PR: PR23404
- Originator: <andreast@gcc.gnu.org> 20050830 */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-static void
-closure_test_fn0(ffi_cif* cif __UNUSED__, void* resp, void** args,
- void* userdata)
-{
- *(ffi_arg*)resp =
- (int)*(unsigned long long *)args[0] +
- (int)(*(unsigned long long *)args[1]) +
- (int)(*(unsigned long long *)args[2]) +
- (int)*(unsigned long long *)args[3] +
- (int)(*(int *)args[4]) + (int)(*(double *)args[5]) +
- (int)*(double *)args[6] + (int)(*(float *)args[7]) +
- (int)(*(double *)args[8]) + (int)*(double *)args[9] +
- (int)(*(int *)args[10]) + (int)(*(float *)args[11]) +
- (int)*(int *)args[12] + (int)(*(int *)args[13]) +
- (int)(*(double *)args[14]) + (int)*(double *)args[15] +
- (intptr_t)userdata;
-
- printf("%d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d: %d\n",
- (int)*(unsigned long long *)args[0],
- (int)(*(unsigned long long *)args[1]),
- (int)(*(unsigned long long *)args[2]),
- (int)*(unsigned long long *)args[3],
- (int)(*(int *)args[4]), (int)(*(double *)args[5]),
- (int)*(double *)args[6], (int)(*(float *)args[7]),
- (int)(*(double *)args[8]), (int)*(double *)args[9],
- (int)(*(int *)args[10]), (int)(*(float *)args[11]),
- (int)*(int *)args[12], (int)(*(int *)args[13]),
- (int)(*(double *)args[14]), (int)(*(double *)args[15]),
- (int)(intptr_t)userdata, (int)*(ffi_arg *)resp);
-
-}
-
-typedef int (*closure_test_type0)(unsigned long long,
- unsigned long long,
- unsigned long long,
- unsigned long long,
- int, double, double, float, double, double,
- int, float, int, int, double, double);
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- ffi_type * cl_arg_types[17];
- int res;
-
- cl_arg_types[0] = &ffi_type_uint64;
- cl_arg_types[1] = &ffi_type_uint64;
- cl_arg_types[2] = &ffi_type_uint64;
- cl_arg_types[3] = &ffi_type_uint64;
- cl_arg_types[4] = &ffi_type_sint;
- cl_arg_types[5] = &ffi_type_double;
- cl_arg_types[6] = &ffi_type_double;
- cl_arg_types[7] = &ffi_type_float;
- cl_arg_types[8] = &ffi_type_double;
- cl_arg_types[9] = &ffi_type_double;
- cl_arg_types[10] = &ffi_type_sint;
- cl_arg_types[11] = &ffi_type_float;
- cl_arg_types[12] = &ffi_type_sint;
- cl_arg_types[13] = &ffi_type_sint;
- cl_arg_types[14] = &ffi_type_double;
- cl_arg_types[15] = &ffi_type_double;
- cl_arg_types[16] = NULL;
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 16,
- &ffi_type_sint, cl_arg_types) == FFI_OK);
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, closure_test_fn0,
- (void *) 3 /* userdata */, code) == FFI_OK);
-
- res = (*((closure_test_type0)code))
- (1, 2, 3, 4, 127, 429., 7., 8., 9.5, 10., 11, 12., 13,
- 19, 21., 1.);
- /* { dg-output "1 2 3 4 127 429 7 8 9 10 11 12 13 19 21 1 3: 680" } */
- printf("res: %d\n",res);
- /* { dg-output "\nres: 680" } */
- exit(0);
-}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/closure_loc_fn0.c b/Modules/_ctypes/libffi/testsuite/libffi.call/closure_loc_fn0.c
deleted file mode 100644
index b3afa0bbdf..0000000000
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/closure_loc_fn0.c
+++ /dev/null
@@ -1,95 +0,0 @@
-/* Area: closure_call
- Purpose: Check multiple values passing from different type.
- Also, exceed the limit of gpr and fpr registers on PowerPC
- Darwin.
- Limitations: none.
- PR: none.
- Originator: <andreast@gcc.gnu.org> 20030828 */
-
-
-
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-static void
-closure_loc_test_fn0(ffi_cif* cif __UNUSED__, void* resp, void** args,
- void* userdata)
-{
- *(ffi_arg*)resp =
- (int)*(unsigned long long *)args[0] + (int)(*(int *)args[1]) +
- (int)(*(unsigned long long *)args[2]) + (int)*(int *)args[3] +
- (int)(*(signed short *)args[4]) +
- (int)(*(unsigned long long *)args[5]) +
- (int)*(int *)args[6] + (int)(*(int *)args[7]) +
- (int)(*(double *)args[8]) + (int)*(int *)args[9] +
- (int)(*(int *)args[10]) + (int)(*(float *)args[11]) +
- (int)*(int *)args[12] + (int)(*(int *)args[13]) +
- (int)(*(int *)args[14]) + *(int *)args[15] + (intptr_t)userdata;
-
- printf("%d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d: %d\n",
- (int)*(unsigned long long *)args[0], (int)(*(int *)args[1]),
- (int)(*(unsigned long long *)args[2]),
- (int)*(int *)args[3], (int)(*(signed short *)args[4]),
- (int)(*(unsigned long long *)args[5]),
- (int)*(int *)args[6], (int)(*(int *)args[7]),
- (int)(*(double *)args[8]), (int)*(int *)args[9],
- (int)(*(int *)args[10]), (int)(*(float *)args[11]),
- (int)*(int *)args[12], (int)(*(int *)args[13]),
- (int)(*(int *)args[14]),*(int *)args[15],
- (int)(intptr_t)userdata, (int)*(ffi_arg *)resp);
-
-}
-
-typedef int (*closure_loc_test_type0)(unsigned long long, int, unsigned long long,
- int, signed short, unsigned long long, int,
- int, double, int, int, float, int, int,
- int, int);
-
-int main (void)
-{
- ffi_cif cif;
- ffi_closure *pcl;
- ffi_type * cl_arg_types[17];
- int res;
- void *codeloc;
-
- cl_arg_types[0] = &ffi_type_uint64;
- cl_arg_types[1] = &ffi_type_sint;
- cl_arg_types[2] = &ffi_type_uint64;
- cl_arg_types[3] = &ffi_type_sint;
- cl_arg_types[4] = &ffi_type_sshort;
- cl_arg_types[5] = &ffi_type_uint64;
- cl_arg_types[6] = &ffi_type_sint;
- cl_arg_types[7] = &ffi_type_sint;
- cl_arg_types[8] = &ffi_type_double;
- cl_arg_types[9] = &ffi_type_sint;
- cl_arg_types[10] = &ffi_type_sint;
- cl_arg_types[11] = &ffi_type_float;
- cl_arg_types[12] = &ffi_type_sint;
- cl_arg_types[13] = &ffi_type_sint;
- cl_arg_types[14] = &ffi_type_sint;
- cl_arg_types[15] = &ffi_type_sint;
- cl_arg_types[16] = NULL;
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 16,
- &ffi_type_sint, cl_arg_types) == FFI_OK);
-
- pcl = ffi_closure_alloc(sizeof(ffi_closure), &codeloc);
- CHECK(pcl != NULL);
- CHECK(codeloc != NULL);
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, closure_loc_test_fn0,
- (void *) 3 /* userdata */, codeloc) == FFI_OK);
-
- CHECK(memcmp(pcl, codeloc, sizeof(*pcl)) == 0);
-
- res = (*((closure_loc_test_type0)codeloc))
- (1LL, 2, 3LL, 4, 127, 429LL, 7, 8, 9.5, 10, 11, 12, 13,
- 19, 21, 1);
- /* { dg-output "1 2 3 4 127 429 7 8 9 10 11 12 13 19 21 1 3: 680" } */
- printf("res: %d\n",res);
- /* { dg-output "\nres: 680" } */
- exit(0);
-}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/closure_simple.c b/Modules/_ctypes/libffi/testsuite/libffi.call/closure_simple.c
deleted file mode 100644
index 5a4e728d4a..0000000000
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/closure_simple.c
+++ /dev/null
@@ -1,55 +0,0 @@
-/* Area: closure_call
- Purpose: Check simple closure handling with all ABIs
- Limitations: none.
- PR: none.
- Originator: <twalljava@dev.java.net> */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-static void
-closure_test(ffi_cif* cif __UNUSED__, void* resp, void** args, void* userdata)
-{
- *(ffi_arg*)resp =
- (int)*(int *)args[0] + (int)(*(int *)args[1])
- + (int)(*(int *)args[2]) + (int)(*(int *)args[3])
- + (int)(intptr_t)userdata;
-
- printf("%d %d %d %d: %d\n",
- (int)*(int *)args[0], (int)(*(int *)args[1]),
- (int)(*(int *)args[2]), (int)(*(int *)args[3]),
- (int)*(ffi_arg *)resp);
-
-}
-
-typedef int (ABI_ATTR *closure_test_type0)(int, int, int, int);
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- ffi_type * cl_arg_types[17];
- int res;
-
- cl_arg_types[0] = &ffi_type_uint;
- cl_arg_types[1] = &ffi_type_uint;
- cl_arg_types[2] = &ffi_type_uint;
- cl_arg_types[3] = &ffi_type_uint;
- cl_arg_types[4] = NULL;
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, ABI_NUM, 4,
- &ffi_type_sint, cl_arg_types) == FFI_OK);
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, closure_test,
- (void *) 3 /* userdata */, code) == FFI_OK);
-
- res = (*(closure_test_type0)code)(0, 1, 2, 3);
- /* { dg-output "0 1 2 3: 9" } */
-
- printf("res: %d\n",res);
- /* { dg-output "\nres: 9" } */
-
- exit(0);
-}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_12byte.c b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_12byte.c
deleted file mode 100644
index ea0825d175..0000000000
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_12byte.c
+++ /dev/null
@@ -1,94 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Check structure passing with different structure size.
- Limitations: none.
- PR: none.
- Originator: <andreast@gcc.gnu.org> 20030828 */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-typedef struct cls_struct_12byte {
- int a;
- int b;
- int c;
-} cls_struct_12byte;
-
-cls_struct_12byte cls_struct_12byte_fn(struct cls_struct_12byte b1,
- struct cls_struct_12byte b2)
-{
- struct cls_struct_12byte result;
-
- result.a = b1.a + b2.a;
- result.b = b1.b + b2.b;
- result.c = b1.c + b2.c;
-
- printf("%d %d %d %d %d %d: %d %d %d\n", b1.a, b1.b, b1.c, b2.a, b2.b, b2.c,
- result.a, result.b, result.c);
-
- return result;
-}
-
-static void cls_struct_12byte_gn(ffi_cif* cif __UNUSED__, void* resp,
- void** args , void* userdata __UNUSED__)
-{
- struct cls_struct_12byte b1, b2;
-
- b1 = *(struct cls_struct_12byte*)(args[0]);
- b2 = *(struct cls_struct_12byte*)(args[1]);
-
- *(cls_struct_12byte*)resp = cls_struct_12byte_fn(b1, b2);
-}
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- void* args_dbl[5];
- ffi_type* cls_struct_fields[4];
- ffi_type cls_struct_type;
- ffi_type* dbl_arg_types[5];
-
- struct cls_struct_12byte h_dbl = { 7, 4, 9 };
- struct cls_struct_12byte j_dbl = { 1, 5, 3 };
- struct cls_struct_12byte res_dbl;
-
- cls_struct_type.size = 0;
- cls_struct_type.alignment = 0;
- cls_struct_type.type = FFI_TYPE_STRUCT;
- cls_struct_type.elements = cls_struct_fields;
-
- cls_struct_fields[0] = &ffi_type_sint;
- cls_struct_fields[1] = &ffi_type_sint;
- cls_struct_fields[2] = &ffi_type_sint;
- cls_struct_fields[3] = NULL;
-
- dbl_arg_types[0] = &cls_struct_type;
- dbl_arg_types[1] = &cls_struct_type;
- dbl_arg_types[2] = NULL;
-
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type,
- dbl_arg_types) == FFI_OK);
-
- args_dbl[0] = &h_dbl;
- args_dbl[1] = &j_dbl;
- args_dbl[2] = NULL;
-
- ffi_call(&cif, FFI_FN(cls_struct_12byte_fn), &res_dbl, args_dbl);
- /* { dg-output "7 4 9 1 5 3: 8 9 12" } */
- printf("res: %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c);
- /* { dg-output "\nres: 8 9 12" } */
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_12byte_gn, NULL, code) == FFI_OK);
-
- res_dbl.a = 0;
- res_dbl.b = 0;
- res_dbl.c = 0;
-
- res_dbl = ((cls_struct_12byte(*)(cls_struct_12byte, cls_struct_12byte))(code))(h_dbl, j_dbl);
- /* { dg-output "\n7 4 9 1 5 3: 8 9 12" } */
- printf("res: %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c);
- /* { dg-output "\nres: 8 9 12" } */
-
- exit(0);
-}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_16byte.c b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_16byte.c
deleted file mode 100644
index 89a08a2d97..0000000000
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_16byte.c
+++ /dev/null
@@ -1,95 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Check structure passing with different structure size.
- Depending on the ABI. Check overlapping.
- Limitations: none.
- PR: none.
- Originator: <andreast@gcc.gnu.org> 20030828 */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-typedef struct cls_struct_16byte {
- int a;
- double b;
- int c;
-} cls_struct_16byte;
-
-cls_struct_16byte cls_struct_16byte_fn(struct cls_struct_16byte b1,
- struct cls_struct_16byte b2)
-{
- struct cls_struct_16byte result;
-
- result.a = b1.a + b2.a;
- result.b = b1.b + b2.b;
- result.c = b1.c + b2.c;
-
- printf("%d %g %d %d %g %d: %d %g %d\n", b1.a, b1.b, b1.c, b2.a, b2.b, b2.c,
- result.a, result.b, result.c);
-
- return result;
-}
-
-static void cls_struct_16byte_gn(ffi_cif* cif __UNUSED__, void* resp,
- void** args, void* userdata __UNUSED__)
-{
- struct cls_struct_16byte b1, b2;
-
- b1 = *(struct cls_struct_16byte*)(args[0]);
- b2 = *(struct cls_struct_16byte*)(args[1]);
-
- *(cls_struct_16byte*)resp = cls_struct_16byte_fn(b1, b2);
-}
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- void* args_dbl[5];
- ffi_type* cls_struct_fields[4];
- ffi_type cls_struct_type;
- ffi_type* dbl_arg_types[5];
-
- struct cls_struct_16byte h_dbl = { 7, 8.0, 9 };
- struct cls_struct_16byte j_dbl = { 1, 9.0, 3 };
- struct cls_struct_16byte res_dbl;
-
- cls_struct_type.size = 0;
- cls_struct_type.alignment = 0;
- cls_struct_type.type = FFI_TYPE_STRUCT;
- cls_struct_type.elements = cls_struct_fields;
-
- cls_struct_fields[0] = &ffi_type_sint;
- cls_struct_fields[1] = &ffi_type_double;
- cls_struct_fields[2] = &ffi_type_sint;
- cls_struct_fields[3] = NULL;
-
- dbl_arg_types[0] = &cls_struct_type;
- dbl_arg_types[1] = &cls_struct_type;
- dbl_arg_types[2] = NULL;
-
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type,
- dbl_arg_types) == FFI_OK);
-
- args_dbl[0] = &h_dbl;
- args_dbl[1] = &j_dbl;
- args_dbl[2] = NULL;
-
- ffi_call(&cif, FFI_FN(cls_struct_16byte_fn), &res_dbl, args_dbl);
- /* { dg-output "7 8 9 1 9 3: 8 17 12" } */
- printf("res: %d %g %d\n", res_dbl.a, res_dbl.b, res_dbl.c);
- /* { dg-output "\nres: 8 17 12" } */
-
- res_dbl.a = 0;
- res_dbl.b = 0.0;
- res_dbl.c = 0;
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_16byte_gn, NULL, code) == FFI_OK);
-
- res_dbl = ((cls_struct_16byte(*)(cls_struct_16byte, cls_struct_16byte))(code))(h_dbl, j_dbl);
- /* { dg-output "\n7 8 9 1 9 3: 8 17 12" } */
- printf("res: %d %g %d\n", res_dbl.a, res_dbl.b, res_dbl.c);
- /* { dg-output "\nres: 8 17 12" } */
-
- exit(0);
-}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_18byte.c b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_18byte.c
deleted file mode 100644
index 9f75da80aa..0000000000
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_18byte.c
+++ /dev/null
@@ -1,96 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Check structure passing with different structure size.
- Depending on the ABI. Double alignment check on darwin.
- Limitations: none.
- PR: none.
- Originator: <andreast@gcc.gnu.org> 20030915 */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-typedef struct cls_struct_18byte {
- double a;
- unsigned char b;
- unsigned char c;
- double d;
-} cls_struct_18byte;
-
-cls_struct_18byte cls_struct_18byte_fn(struct cls_struct_18byte a1,
- struct cls_struct_18byte a2)
-{
- struct cls_struct_18byte result;
-
- result.a = a1.a + a2.a;
- result.b = a1.b + a2.b;
- result.c = a1.c + a2.c;
- result.d = a1.d + a2.d;
-
-
- printf("%g %d %d %g %g %d %d %g: %g %d %d %g\n", a1.a, a1.b, a1.c, a1.d,
- a2.a, a2.b, a2.c, a2.d,
- result.a, result.b, result.c, result.d);
- return result;
-}
-
-static void
-cls_struct_18byte_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
- void* userdata __UNUSED__)
-{
- struct cls_struct_18byte a1, a2;
-
- a1 = *(struct cls_struct_18byte*)(args[0]);
- a2 = *(struct cls_struct_18byte*)(args[1]);
-
- *(cls_struct_18byte*)resp = cls_struct_18byte_fn(a1, a2);
-}
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- void* args_dbl[3];
- ffi_type* cls_struct_fields[5];
- ffi_type cls_struct_type;
- ffi_type* dbl_arg_types[3];
-
- struct cls_struct_18byte g_dbl = { 1.0, 127, 126, 3.0 };
- struct cls_struct_18byte f_dbl = { 4.0, 125, 124, 5.0 };
- struct cls_struct_18byte res_dbl;
-
- cls_struct_type.size = 0;
- cls_struct_type.alignment = 0;
- cls_struct_type.type = FFI_TYPE_STRUCT;
- cls_struct_type.elements = cls_struct_fields;
-
- cls_struct_fields[0] = &ffi_type_double;
- cls_struct_fields[1] = &ffi_type_uchar;
- cls_struct_fields[2] = &ffi_type_uchar;
- cls_struct_fields[3] = &ffi_type_double;
- cls_struct_fields[4] = NULL;
-
- dbl_arg_types[0] = &cls_struct_type;
- dbl_arg_types[1] = &cls_struct_type;
- dbl_arg_types[2] = NULL;
-
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type,
- dbl_arg_types) == FFI_OK);
-
- args_dbl[0] = &g_dbl;
- args_dbl[1] = &f_dbl;
- args_dbl[2] = NULL;
-
- ffi_call(&cif, FFI_FN(cls_struct_18byte_fn), &res_dbl, args_dbl);
- /* { dg-output "1 127 126 3 4 125 124 5: 5 252 250 8" } */
- printf("res: %g %d %d %g\n", res_dbl.a, res_dbl.b, res_dbl.c, res_dbl.d);
- /* { dg-output "\nres: 5 252 250 8" } */
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_18byte_gn, NULL, code) == FFI_OK);
-
- res_dbl = ((cls_struct_18byte(*)(cls_struct_18byte, cls_struct_18byte))(code))(g_dbl, f_dbl);
- /* { dg-output "\n1 127 126 3 4 125 124 5: 5 252 250 8" } */
- printf("res: %g %d %d %g\n", res_dbl.a, res_dbl.b, res_dbl.c, res_dbl.d);
- /* { dg-output "\nres: 5 252 250 8" } */
-
- exit(0);
-}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_19byte.c b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_19byte.c
deleted file mode 100644
index 278794b5b8..0000000000
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_19byte.c
+++ /dev/null
@@ -1,102 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Check structure passing with different structure size.
- Depending on the ABI. Double alignment check on darwin.
- Limitations: none.
- PR: none.
- Originator: <andreast@gcc.gnu.org> 20030915 */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-typedef struct cls_struct_19byte {
- double a;
- unsigned char b;
- unsigned char c;
- double d;
- unsigned char e;
-} cls_struct_19byte;
-
-cls_struct_19byte cls_struct_19byte_fn(struct cls_struct_19byte a1,
- struct cls_struct_19byte a2)
-{
- struct cls_struct_19byte result;
-
- result.a = a1.a + a2.a;
- result.b = a1.b + a2.b;
- result.c = a1.c + a2.c;
- result.d = a1.d + a2.d;
- result.e = a1.e + a2.e;
-
-
- printf("%g %d %d %g %d %g %d %d %g %d: %g %d %d %g %d\n",
- a1.a, a1.b, a1.c, a1.d, a1.e,
- a2.a, a2.b, a2.c, a2.d, a2.e,
- result.a, result.b, result.c, result.d, result.e);
- return result;
-}
-
-static void
-cls_struct_19byte_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
- void* userdata __UNUSED__)
-{
- struct cls_struct_19byte a1, a2;
-
- a1 = *(struct cls_struct_19byte*)(args[0]);
- a2 = *(struct cls_struct_19byte*)(args[1]);
-
- *(cls_struct_19byte*)resp = cls_struct_19byte_fn(a1, a2);
-}
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- void* args_dbl[3];
- ffi_type* cls_struct_fields[6];
- ffi_type cls_struct_type;
- ffi_type* dbl_arg_types[3];
-
- struct cls_struct_19byte g_dbl = { 1.0, 127, 126, 3.0, 120 };
- struct cls_struct_19byte f_dbl = { 4.0, 125, 124, 5.0, 119 };
- struct cls_struct_19byte res_dbl;
-
- cls_struct_type.size = 0;
- cls_struct_type.alignment = 0;
- cls_struct_type.type = FFI_TYPE_STRUCT;
- cls_struct_type.elements = cls_struct_fields;
-
- cls_struct_fields[0] = &ffi_type_double;
- cls_struct_fields[1] = &ffi_type_uchar;
- cls_struct_fields[2] = &ffi_type_uchar;
- cls_struct_fields[3] = &ffi_type_double;
- cls_struct_fields[4] = &ffi_type_uchar;
- cls_struct_fields[5] = NULL;
-
- dbl_arg_types[0] = &cls_struct_type;
- dbl_arg_types[1] = &cls_struct_type;
- dbl_arg_types[2] = NULL;
-
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type,
- dbl_arg_types) == FFI_OK);
-
- args_dbl[0] = &g_dbl;
- args_dbl[1] = &f_dbl;
- args_dbl[2] = NULL;
-
- ffi_call(&cif, FFI_FN(cls_struct_19byte_fn), &res_dbl, args_dbl);
- /* { dg-output "1 127 126 3 120 4 125 124 5 119: 5 252 250 8 239" } */
- printf("res: %g %d %d %g %d\n", res_dbl.a, res_dbl.b, res_dbl.c,
- res_dbl.d, res_dbl.e);
- /* { dg-output "\nres: 5 252 250 8 239" } */
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_19byte_gn, NULL, code) == FFI_OK);
-
- res_dbl = ((cls_struct_19byte(*)(cls_struct_19byte, cls_struct_19byte))(code))(g_dbl, f_dbl);
- /* { dg-output "\n1 127 126 3 120 4 125 124 5 119: 5 252 250 8 239" } */
- printf("res: %g %d %d %g %d\n", res_dbl.a, res_dbl.b, res_dbl.c,
- res_dbl.d, res_dbl.e);
- /* { dg-output "\nres: 5 252 250 8 239" } */
-
- exit(0);
-}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_1_1byte.c b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_1_1byte.c
deleted file mode 100644
index 82492c020e..0000000000
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_1_1byte.c
+++ /dev/null
@@ -1,89 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Check structure passing with different structure size.
- Especially with small structures which may fit in one
- register. Depending on the ABI.
- Limitations: none.
- PR: none.
- Originator: <andreast@gcc.gnu.org> 20030902 */
-
-
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-typedef struct cls_struct_1_1byte {
- unsigned char a;
-} cls_struct_1_1byte;
-
-cls_struct_1_1byte cls_struct_1_1byte_fn(struct cls_struct_1_1byte a1,
- struct cls_struct_1_1byte a2)
-{
- struct cls_struct_1_1byte result;
-
- result.a = a1.a + a2.a;
-
- printf("%d %d: %d\n", a1.a, a2.a, result.a);
-
- return result;
-}
-
-static void
-cls_struct_1_1byte_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
- void* userdata __UNUSED__)
-{
-
- struct cls_struct_1_1byte a1, a2;
-
- a1 = *(struct cls_struct_1_1byte*)(args[0]);
- a2 = *(struct cls_struct_1_1byte*)(args[1]);
-
- *(cls_struct_1_1byte*)resp = cls_struct_1_1byte_fn(a1, a2);
-}
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- void* args_dbl[5];
- ffi_type* cls_struct_fields[2];
- ffi_type cls_struct_type;
- ffi_type* dbl_arg_types[5];
-
- struct cls_struct_1_1byte g_dbl = { 12 };
- struct cls_struct_1_1byte f_dbl = { 178 };
- struct cls_struct_1_1byte res_dbl;
-
- cls_struct_type.size = 0;
- cls_struct_type.alignment = 0;
- cls_struct_type.type = FFI_TYPE_STRUCT;
- cls_struct_type.elements = cls_struct_fields;
-
- cls_struct_fields[0] = &ffi_type_uchar;
- cls_struct_fields[1] = NULL;
-
- dbl_arg_types[0] = &cls_struct_type;
- dbl_arg_types[1] = &cls_struct_type;
- dbl_arg_types[2] = NULL;
-
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type,
- dbl_arg_types) == FFI_OK);
-
- args_dbl[0] = &g_dbl;
- args_dbl[1] = &f_dbl;
- args_dbl[2] = NULL;
-
- ffi_call(&cif, FFI_FN(cls_struct_1_1byte_fn), &res_dbl, args_dbl);
- /* { dg-output "12 178: 190" } */
- printf("res: %d\n", res_dbl.a);
- /* { dg-output "\nres: 190" } */
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_1_1byte_gn, NULL, code) == FFI_OK);
-
- res_dbl = ((cls_struct_1_1byte(*)(cls_struct_1_1byte, cls_struct_1_1byte))(code))(g_dbl, f_dbl);
- /* { dg-output "\n12 178: 190" } */
- printf("res: %d\n", res_dbl.a);
- /* { dg-output "\nres: 190" } */
-
- exit(0);
-}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_20byte.c b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_20byte.c
deleted file mode 100644
index 3f8bb28ad2..0000000000
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_20byte.c
+++ /dev/null
@@ -1,91 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Check structure passing with different structure size.
- Depending on the ABI. Check overlapping.
- Limitations: none.
- PR: none.
- Originator: <andreast@gcc.gnu.org> 20030828 */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-typedef struct cls_struct_20byte {
- double a;
- double b;
- int c;
-} cls_struct_20byte;
-
-cls_struct_20byte cls_struct_20byte_fn(struct cls_struct_20byte a1,
- struct cls_struct_20byte a2)
-{
- struct cls_struct_20byte result;
-
- result.a = a1.a + a2.a;
- result.b = a1.b + a2.b;
- result.c = a1.c + a2.c;
-
- printf("%g %g %d %g %g %d: %g %g %d\n", a1.a, a1.b, a1.c, a2.a, a2.b, a2.c,
- result.a, result.b, result.c);
- return result;
-}
-
-static void
-cls_struct_20byte_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
- void* userdata __UNUSED__)
-{
- struct cls_struct_20byte a1, a2;
-
- a1 = *(struct cls_struct_20byte*)(args[0]);
- a2 = *(struct cls_struct_20byte*)(args[1]);
-
- *(cls_struct_20byte*)resp = cls_struct_20byte_fn(a1, a2);
-}
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- void* args_dbl[5];
- ffi_type* cls_struct_fields[4];
- ffi_type cls_struct_type;
- ffi_type* dbl_arg_types[5];
-
- struct cls_struct_20byte g_dbl = { 1.0, 2.0, 3 };
- struct cls_struct_20byte f_dbl = { 4.0, 5.0, 7 };
- struct cls_struct_20byte res_dbl;
-
- cls_struct_type.size = 0;
- cls_struct_type.alignment = 0;
- cls_struct_type.type = FFI_TYPE_STRUCT;
- cls_struct_type.elements = cls_struct_fields;
-
- cls_struct_fields[0] = &ffi_type_double;
- cls_struct_fields[1] = &ffi_type_double;
- cls_struct_fields[2] = &ffi_type_sint;
- cls_struct_fields[3] = NULL;
-
- dbl_arg_types[0] = &cls_struct_type;
- dbl_arg_types[1] = &cls_struct_type;
- dbl_arg_types[2] = NULL;
-
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type,
- dbl_arg_types) == FFI_OK);
-
- args_dbl[0] = &g_dbl;
- args_dbl[1] = &f_dbl;
- args_dbl[2] = NULL;
-
- ffi_call(&cif, FFI_FN(cls_struct_20byte_fn), &res_dbl, args_dbl);
- /* { dg-output "1 2 3 4 5 7: 5 7 10" } */
- printf("res: %g %g %d\n", res_dbl.a, res_dbl.b, res_dbl.c);
- /* { dg-output "\nres: 5 7 10" } */
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_20byte_gn, NULL, code) == FFI_OK);
-
- res_dbl = ((cls_struct_20byte(*)(cls_struct_20byte, cls_struct_20byte))(code))(g_dbl, f_dbl);
- /* { dg-output "\n1 2 3 4 5 7: 5 7 10" } */
- printf("res: %g %g %d\n", res_dbl.a, res_dbl.b, res_dbl.c);
- /* { dg-output "\nres: 5 7 10" } */
-
- exit(0);
-}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_20byte1.c b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_20byte1.c
deleted file mode 100644
index 65627273c8..0000000000
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_20byte1.c
+++ /dev/null
@@ -1,93 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Check structure passing with different structure size.
- Depending on the ABI. Check overlapping.
- Limitations: none.
- PR: none.
- Originator: <andreast@gcc.gnu.org> 20030828 */
-
-
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-typedef struct cls_struct_20byte {
- int a;
- double b;
- double c;
-} cls_struct_20byte;
-
-cls_struct_20byte cls_struct_20byte_fn(struct cls_struct_20byte a1,
- struct cls_struct_20byte a2)
-{
- struct cls_struct_20byte result;
-
- result.a = a1.a + a2.a;
- result.b = a1.b + a2.b;
- result.c = a1.c + a2.c;
-
- printf("%d %g %g %d %g %g: %d %g %g\n", a1.a, a1.b, a1.c, a2.a, a2.b, a2.c,
- result.a, result.b, result.c);
- return result;
-}
-
-static void
-cls_struct_20byte_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
- void* userdata __UNUSED__)
-{
- struct cls_struct_20byte a1, a2;
-
- a1 = *(struct cls_struct_20byte*)(args[0]);
- a2 = *(struct cls_struct_20byte*)(args[1]);
-
- *(cls_struct_20byte*)resp = cls_struct_20byte_fn(a1, a2);
-}
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- void* args_dbl[3];
- ffi_type* cls_struct_fields[4];
- ffi_type cls_struct_type;
- ffi_type* dbl_arg_types[3];
-
- struct cls_struct_20byte g_dbl = { 1, 2.0, 3.0 };
- struct cls_struct_20byte f_dbl = { 4, 5.0, 7.0 };
- struct cls_struct_20byte res_dbl;
-
- cls_struct_type.size = 0;
- cls_struct_type.alignment = 0;
- cls_struct_type.type = FFI_TYPE_STRUCT;
- cls_struct_type.elements = cls_struct_fields;
-
- cls_struct_fields[0] = &ffi_type_sint;
- cls_struct_fields[1] = &ffi_type_double;
- cls_struct_fields[2] = &ffi_type_double;
- cls_struct_fields[3] = NULL;
-
- dbl_arg_types[0] = &cls_struct_type;
- dbl_arg_types[1] = &cls_struct_type;
- dbl_arg_types[2] = NULL;
-
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type,
- dbl_arg_types) == FFI_OK);
-
- args_dbl[0] = &g_dbl;
- args_dbl[1] = &f_dbl;
- args_dbl[2] = NULL;
-
- ffi_call(&cif, FFI_FN(cls_struct_20byte_fn), &res_dbl, args_dbl);
- /* { dg-output "1 2 3 4 5 7: 5 7 10" } */
- printf("res: %d %g %g\n", res_dbl.a, res_dbl.b, res_dbl.c);
- /* { dg-output "\nres: 5 7 10" } */
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_20byte_gn, NULL, code) == FFI_OK);
-
- res_dbl = ((cls_struct_20byte(*)(cls_struct_20byte, cls_struct_20byte))(code))(g_dbl, f_dbl);
- /* { dg-output "\n1 2 3 4 5 7: 5 7 10" } */
- printf("res: %d %g %g\n", res_dbl.a, res_dbl.b, res_dbl.c);
- /* { dg-output "\nres: 5 7 10" } */
-
- exit(0);
-}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_24byte.c b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_24byte.c
deleted file mode 100644
index 1d82f6e4a4..0000000000
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_24byte.c
+++ /dev/null
@@ -1,113 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Check structure passing with different structure size.
- Depending on the ABI. Check overlapping.
- Limitations: none.
- PR: none.
- Originator: <andreast@gcc.gnu.org> 20030828 */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-typedef struct cls_struct_24byte {
- double a;
- double b;
- int c;
- float d;
-} cls_struct_24byte;
-
-cls_struct_24byte cls_struct_24byte_fn(struct cls_struct_24byte b0,
- struct cls_struct_24byte b1,
- struct cls_struct_24byte b2,
- struct cls_struct_24byte b3)
-{
- struct cls_struct_24byte result;
-
- result.a = b0.a + b1.a + b2.a + b3.a;
- result.b = b0.b + b1.b + b2.b + b3.b;
- result.c = b0.c + b1.c + b2.c + b3.c;
- result.d = b0.d + b1.d + b2.d + b3.d;
-
- printf("%g %g %d %g %g %g %d %g %g %g %d %g %g %g %d %g: %g %g %d %g\n",
- b0.a, b0.b, b0.c, b0.d,
- b1.a, b1.b, b1.c, b1.d,
- b2.a, b2.b, b2.c, b2.d,
- b3.a, b3.b, b3.c, b2.d,
- result.a, result.b, result.c, result.d);
-
- return result;
-}
-
-static void
-cls_struct_24byte_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
- void* userdata __UNUSED__)
-{
- struct cls_struct_24byte b0, b1, b2, b3;
-
- b0 = *(struct cls_struct_24byte*)(args[0]);
- b1 = *(struct cls_struct_24byte*)(args[1]);
- b2 = *(struct cls_struct_24byte*)(args[2]);
- b3 = *(struct cls_struct_24byte*)(args[3]);
-
- *(cls_struct_24byte*)resp = cls_struct_24byte_fn(b0, b1, b2, b3);
-}
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- void* args_dbl[5];
- ffi_type* cls_struct_fields[5];
- ffi_type cls_struct_type;
- ffi_type* dbl_arg_types[5];
-
- struct cls_struct_24byte e_dbl = { 9.0, 2.0, 6, 5.0 };
- struct cls_struct_24byte f_dbl = { 1.0, 2.0, 3, 7.0 };
- struct cls_struct_24byte g_dbl = { 4.0, 5.0, 7, 9.0 };
- struct cls_struct_24byte h_dbl = { 8.0, 6.0, 1, 4.0 };
- struct cls_struct_24byte res_dbl;
-
- cls_struct_type.size = 0;
- cls_struct_type.alignment = 0;
- cls_struct_type.type = FFI_TYPE_STRUCT;
- cls_struct_type.elements = cls_struct_fields;
-
- cls_struct_fields[0] = &ffi_type_double;
- cls_struct_fields[1] = &ffi_type_double;
- cls_struct_fields[2] = &ffi_type_sint;
- cls_struct_fields[3] = &ffi_type_float;
- cls_struct_fields[4] = NULL;
-
- dbl_arg_types[0] = &cls_struct_type;
- dbl_arg_types[1] = &cls_struct_type;
- dbl_arg_types[2] = &cls_struct_type;
- dbl_arg_types[3] = &cls_struct_type;
- dbl_arg_types[4] = NULL;
-
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 4, &cls_struct_type,
- dbl_arg_types) == FFI_OK);
-
- args_dbl[0] = &e_dbl;
- args_dbl[1] = &f_dbl;
- args_dbl[2] = &g_dbl;
- args_dbl[3] = &h_dbl;
- args_dbl[4] = NULL;
-
- ffi_call(&cif, FFI_FN(cls_struct_24byte_fn), &res_dbl, args_dbl);
- /* { dg-output "9 2 6 5 1 2 3 7 4 5 7 9 8 6 1 9: 22 15 17 25" } */
- printf("res: %g %g %d %g\n", res_dbl.a, res_dbl.b, res_dbl.c, res_dbl.d);
- /* { dg-output "\nres: 22 15 17 25" } */
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_24byte_gn, NULL, code) == FFI_OK);
-
- res_dbl = ((cls_struct_24byte(*)(cls_struct_24byte,
- cls_struct_24byte,
- cls_struct_24byte,
- cls_struct_24byte))
- (code))(e_dbl, f_dbl, g_dbl, h_dbl);
- /* { dg-output "\n9 2 6 5 1 2 3 7 4 5 7 9 8 6 1 9: 22 15 17 25" } */
- printf("res: %g %g %d %g\n", res_dbl.a, res_dbl.b, res_dbl.c, res_dbl.d);
- /* { dg-output "\nres: 22 15 17 25" } */
-
- exit(0);
-}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_2byte.c b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_2byte.c
deleted file mode 100644
index 81bb0a64a3..0000000000
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_2byte.c
+++ /dev/null
@@ -1,90 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Check structure passing with different structure size.
- Especially with small structures which may fit in one
- register. Depending on the ABI.
- Limitations: none.
- PR: none.
- Originator: <andreast@gcc.gnu.org> 20030828 */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-typedef struct cls_struct_2byte {
- unsigned char a;
- unsigned char b;
-} cls_struct_2byte;
-
-cls_struct_2byte cls_struct_2byte_fn(struct cls_struct_2byte a1,
- struct cls_struct_2byte a2)
-{
- struct cls_struct_2byte result;
-
- result.a = a1.a + a2.a;
- result.b = a1.b + a2.b;
-
- printf("%d %d %d %d: %d %d\n", a1.a, a1.b, a2.a, a2.b, result.a, result.b);
-
- return result;
-}
-
-static void
-cls_struct_2byte_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
- void* userdata __UNUSED__)
-{
-
- struct cls_struct_2byte a1, a2;
-
- a1 = *(struct cls_struct_2byte*)(args[0]);
- a2 = *(struct cls_struct_2byte*)(args[1]);
-
- *(cls_struct_2byte*)resp = cls_struct_2byte_fn(a1, a2);
-}
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- void* args_dbl[5];
- ffi_type* cls_struct_fields[4];
- ffi_type cls_struct_type;
- ffi_type* dbl_arg_types[5];
-
- struct cls_struct_2byte g_dbl = { 12, 127 };
- struct cls_struct_2byte f_dbl = { 1, 13 };
- struct cls_struct_2byte res_dbl;
-
- cls_struct_type.size = 0;
- cls_struct_type.alignment = 0;
- cls_struct_type.type = FFI_TYPE_STRUCT;
- cls_struct_type.elements = cls_struct_fields;
-
- cls_struct_fields[0] = &ffi_type_uchar;
- cls_struct_fields[1] = &ffi_type_uchar;
- cls_struct_fields[2] = NULL;
-
- dbl_arg_types[0] = &cls_struct_type;
- dbl_arg_types[1] = &cls_struct_type;
- dbl_arg_types[2] = NULL;
-
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type,
- dbl_arg_types) == FFI_OK);
-
- args_dbl[0] = &g_dbl;
- args_dbl[1] = &f_dbl;
- args_dbl[2] = NULL;
-
- ffi_call(&cif, FFI_FN(cls_struct_2byte_fn), &res_dbl, args_dbl);
- /* { dg-output "12 127 1 13: 13 140" } */
- printf("res: %d %d\n", res_dbl.a, res_dbl.b);
- /* { dg-output "\nres: 13 140" } */
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_2byte_gn, NULL, code) == FFI_OK);
-
- res_dbl = ((cls_struct_2byte(*)(cls_struct_2byte, cls_struct_2byte))(code))(g_dbl, f_dbl);
- /* { dg-output "\n12 127 1 13: 13 140" } */
- printf("res: %d %d\n", res_dbl.a, res_dbl.b);
- /* { dg-output "\nres: 13 140" } */
-
- exit(0);
-}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_3_1byte.c b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_3_1byte.c
deleted file mode 100644
index b7827466f6..0000000000
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_3_1byte.c
+++ /dev/null
@@ -1,95 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Check structure passing with different structure size.
- Especially with small structures which may fit in one
- register. Depending on the ABI.
- Limitations: none.
- PR: none.
- Originator: <andreast@gcc.gnu.org> 20030902 */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-typedef struct cls_struct_3_1byte {
- unsigned char a;
- unsigned char b;
- unsigned char c;
-} cls_struct_3_1byte;
-
-cls_struct_3_1byte cls_struct_3_1byte_fn(struct cls_struct_3_1byte a1,
- struct cls_struct_3_1byte a2)
-{
- struct cls_struct_3_1byte result;
-
- result.a = a1.a + a2.a;
- result.b = a1.b + a2.b;
- result.c = a1.c + a2.c;
-
- printf("%d %d %d %d %d %d: %d %d %d\n", a1.a, a1.b, a1.c,
- a2.a, a2.b, a2.c,
- result.a, result.b, result.c);
-
- return result;
-}
-
-static void
-cls_struct_3_1byte_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
- void* userdata __UNUSED__)
-{
-
- struct cls_struct_3_1byte a1, a2;
-
- a1 = *(struct cls_struct_3_1byte*)(args[0]);
- a2 = *(struct cls_struct_3_1byte*)(args[1]);
-
- *(cls_struct_3_1byte*)resp = cls_struct_3_1byte_fn(a1, a2);
-}
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- void* args_dbl[5];
- ffi_type* cls_struct_fields[4];
- ffi_type cls_struct_type;
- ffi_type* dbl_arg_types[5];
-
- struct cls_struct_3_1byte g_dbl = { 12, 13, 14 };
- struct cls_struct_3_1byte f_dbl = { 178, 179, 180 };
- struct cls_struct_3_1byte res_dbl;
-
- cls_struct_type.size = 0;
- cls_struct_type.alignment = 0;
- cls_struct_type.type = FFI_TYPE_STRUCT;
- cls_struct_type.elements = cls_struct_fields;
-
- cls_struct_fields[0] = &ffi_type_uchar;
- cls_struct_fields[1] = &ffi_type_uchar;
- cls_struct_fields[2] = &ffi_type_uchar;
- cls_struct_fields[3] = NULL;
-
- dbl_arg_types[0] = &cls_struct_type;
- dbl_arg_types[1] = &cls_struct_type;
- dbl_arg_types[2] = NULL;
-
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type,
- dbl_arg_types) == FFI_OK);
-
- args_dbl[0] = &g_dbl;
- args_dbl[1] = &f_dbl;
- args_dbl[2] = NULL;
-
- ffi_call(&cif, FFI_FN(cls_struct_3_1byte_fn), &res_dbl, args_dbl);
- /* { dg-output "12 13 14 178 179 180: 190 192 194" } */
- printf("res: %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c);
- /* { dg-output "\nres: 190 192 194" } */
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_3_1byte_gn, NULL, code) == FFI_OK);
-
- res_dbl = ((cls_struct_3_1byte(*)(cls_struct_3_1byte, cls_struct_3_1byte))(code))(g_dbl, f_dbl);
- /* { dg-output "\n12 13 14 178 179 180: 190 192 194" } */
- printf("res: %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c);
- /* { dg-output "\nres: 190 192 194" } */
-
- exit(0);
-}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_3byte1.c b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_3byte1.c
deleted file mode 100644
index a02c463af9..0000000000
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_3byte1.c
+++ /dev/null
@@ -1,90 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Check structure passing with different structure size.
- Especially with small structures which may fit in one
- register. Depending on the ABI. Check overlapping.
- Limitations: none.
- PR: none.
- Originator: <andreast@gcc.gnu.org> 20030828 */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-typedef struct cls_struct_3byte {
- unsigned short a;
- unsigned char b;
-} cls_struct_3byte;
-
-cls_struct_3byte cls_struct_3byte_fn(struct cls_struct_3byte a1,
- struct cls_struct_3byte a2)
-{
- struct cls_struct_3byte result;
-
- result.a = a1.a + a2.a;
- result.b = a1.b + a2.b;
-
- printf("%d %d %d %d: %d %d\n", a1.a, a1.b, a2.a, a2.b, result.a, result.b);
-
- return result;
-}
-
-static void
-cls_struct_3byte_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
- void* userdata __UNUSED__)
-{
-
- struct cls_struct_3byte a1, a2;
-
- a1 = *(struct cls_struct_3byte*)(args[0]);
- a2 = *(struct cls_struct_3byte*)(args[1]);
-
- *(cls_struct_3byte*)resp = cls_struct_3byte_fn(a1, a2);
-}
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- void* args_dbl[5];
- ffi_type* cls_struct_fields[4];
- ffi_type cls_struct_type;
- ffi_type* dbl_arg_types[5];
-
- struct cls_struct_3byte g_dbl = { 12, 119 };
- struct cls_struct_3byte f_dbl = { 1, 15 };
- struct cls_struct_3byte res_dbl;
-
- cls_struct_type.size = 0;
- cls_struct_type.alignment = 0;
- cls_struct_type.type = FFI_TYPE_STRUCT;
- cls_struct_type.elements = cls_struct_fields;
-
- cls_struct_fields[0] = &ffi_type_ushort;
- cls_struct_fields[1] = &ffi_type_uchar;
- cls_struct_fields[2] = NULL;
-
- dbl_arg_types[0] = &cls_struct_type;
- dbl_arg_types[1] = &cls_struct_type;
- dbl_arg_types[2] = NULL;
-
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type,
- dbl_arg_types) == FFI_OK);
-
- args_dbl[0] = &g_dbl;
- args_dbl[1] = &f_dbl;
- args_dbl[2] = NULL;
-
- ffi_call(&cif, FFI_FN(cls_struct_3byte_fn), &res_dbl, args_dbl);
- /* { dg-output "12 119 1 15: 13 134" } */
- printf("res: %d %d\n", res_dbl.a, res_dbl.b);
- /* { dg-output "\nres: 13 134" } */
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_3byte_gn, NULL, code) == FFI_OK);
-
- res_dbl = ((cls_struct_3byte(*)(cls_struct_3byte, cls_struct_3byte))(code))(g_dbl, f_dbl);
- /* { dg-output "\n12 119 1 15: 13 134" } */
- printf("res: %d %d\n", res_dbl.a, res_dbl.b);
- /* { dg-output "\nres: 13 134" } */
-
- exit(0);
-}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_3byte2.c b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_3byte2.c
deleted file mode 100644
index c7251cead6..0000000000
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_3byte2.c
+++ /dev/null
@@ -1,90 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Check structure passing with different structure size.
- Especially with small structures which may fit in one
- register. Depending on the ABI. Check overlapping.
- Limitations: none.
- PR: none.
- Originator: <andreast@gcc.gnu.org> 20030828 */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-typedef struct cls_struct_3byte_1 {
- unsigned char a;
- unsigned short b;
-} cls_struct_3byte_1;
-
-cls_struct_3byte_1 cls_struct_3byte_fn1(struct cls_struct_3byte_1 a1,
- struct cls_struct_3byte_1 a2)
-{
- struct cls_struct_3byte_1 result;
-
- result.a = a1.a + a2.a;
- result.b = a1.b + a2.b;
-
- printf("%d %d %d %d: %d %d\n", a1.a, a1.b, a2.a, a2.b, result.a, result.b);
-
- return result;
-}
-
-static void
-cls_struct_3byte_gn1(ffi_cif* cif __UNUSED__, void* resp, void** args,
- void* userdata __UNUSED__)
-{
-
- struct cls_struct_3byte_1 a1, a2;
-
- a1 = *(struct cls_struct_3byte_1*)(args[0]);
- a2 = *(struct cls_struct_3byte_1*)(args[1]);
-
- *(cls_struct_3byte_1*)resp = cls_struct_3byte_fn1(a1, a2);
-}
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- void* args_dbl[5];
- ffi_type* cls_struct_fields[4];
- ffi_type cls_struct_type;
- ffi_type* dbl_arg_types[5];
-
- struct cls_struct_3byte_1 g_dbl = { 15, 125 };
- struct cls_struct_3byte_1 f_dbl = { 9, 19 };
- struct cls_struct_3byte_1 res_dbl;
-
- cls_struct_type.size = 0;
- cls_struct_type.alignment = 0;
- cls_struct_type.type = FFI_TYPE_STRUCT;
- cls_struct_type.elements = cls_struct_fields;
-
- cls_struct_fields[0] = &ffi_type_uchar;
- cls_struct_fields[1] = &ffi_type_ushort;
- cls_struct_fields[2] = NULL;
-
- dbl_arg_types[0] = &cls_struct_type;
- dbl_arg_types[1] = &cls_struct_type;
- dbl_arg_types[2] = NULL;
-
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type,
- dbl_arg_types) == FFI_OK);
-
- args_dbl[0] = &g_dbl;
- args_dbl[1] = &f_dbl;
- args_dbl[2] = NULL;
-
- ffi_call(&cif, FFI_FN(cls_struct_3byte_fn1), &res_dbl, args_dbl);
- /* { dg-output "15 125 9 19: 24 144" } */
- printf("res: %d %d\n", res_dbl.a, res_dbl.b);
- /* { dg-output "\nres: 24 144" } */
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_3byte_gn1, NULL, code) == FFI_OK);
-
- res_dbl = ((cls_struct_3byte_1(*)(cls_struct_3byte_1, cls_struct_3byte_1))(code))(g_dbl, f_dbl);
- /* { dg-output "\n15 125 9 19: 24 144" } */
- printf("res: %d %d\n", res_dbl.a, res_dbl.b);
- /* { dg-output "\nres: 24 144" } */
-
- exit(0);
-}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_4_1byte.c b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_4_1byte.c
deleted file mode 100644
index 2d6d8b622c..0000000000
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_4_1byte.c
+++ /dev/null
@@ -1,98 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Check structure passing with different structure size.
- Especially with small structures which may fit in one
- register. Depending on the ABI.
- Limitations: none.
- PR: none.
- Originator: <andreast@gcc.gnu.org> 20030902 */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-typedef struct cls_struct_4_1byte {
- unsigned char a;
- unsigned char b;
- unsigned char c;
- unsigned char d;
-} cls_struct_4_1byte;
-
-cls_struct_4_1byte cls_struct_4_1byte_fn(struct cls_struct_4_1byte a1,
- struct cls_struct_4_1byte a2)
-{
- struct cls_struct_4_1byte result;
-
- result.a = a1.a + a2.a;
- result.b = a1.b + a2.b;
- result.c = a1.c + a2.c;
- result.d = a1.d + a2.d;
-
- printf("%d %d %d %d %d %d %d %d: %d %d %d %d\n", a1.a, a1.b, a1.c, a1.d,
- a2.a, a2.b, a2.c, a2.d,
- result.a, result.b, result.c, result.d);
-
- return result;
-}
-
-static void
-cls_struct_4_1byte_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
- void* userdata __UNUSED__)
-{
-
- struct cls_struct_4_1byte a1, a2;
-
- a1 = *(struct cls_struct_4_1byte*)(args[0]);
- a2 = *(struct cls_struct_4_1byte*)(args[1]);
-
- *(cls_struct_4_1byte*)resp = cls_struct_4_1byte_fn(a1, a2);
-}
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- void* args_dbl[5];
- ffi_type* cls_struct_fields[5];
- ffi_type cls_struct_type;
- ffi_type* dbl_arg_types[5];
-
- struct cls_struct_4_1byte g_dbl = { 12, 13, 14, 15 };
- struct cls_struct_4_1byte f_dbl = { 178, 179, 180, 181 };
- struct cls_struct_4_1byte res_dbl;
-
- cls_struct_type.size = 0;
- cls_struct_type.alignment = 0;
- cls_struct_type.type = FFI_TYPE_STRUCT;
- cls_struct_type.elements = cls_struct_fields;
-
- cls_struct_fields[0] = &ffi_type_uchar;
- cls_struct_fields[1] = &ffi_type_uchar;
- cls_struct_fields[2] = &ffi_type_uchar;
- cls_struct_fields[3] = &ffi_type_uchar;
- cls_struct_fields[4] = NULL;
-
- dbl_arg_types[0] = &cls_struct_type;
- dbl_arg_types[1] = &cls_struct_type;
- dbl_arg_types[2] = NULL;
-
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type,
- dbl_arg_types) == FFI_OK);
-
- args_dbl[0] = &g_dbl;
- args_dbl[1] = &f_dbl;
- args_dbl[2] = NULL;
-
- ffi_call(&cif, FFI_FN(cls_struct_4_1byte_fn), &res_dbl, args_dbl);
- /* { dg-output "12 13 14 15 178 179 180 181: 190 192 194 196" } */
- printf("res: %d %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c, res_dbl.d);
- /* { dg-output "\nres: 190 192 194 196" } */
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_4_1byte_gn, NULL, code) == FFI_OK);
-
- res_dbl = ((cls_struct_4_1byte(*)(cls_struct_4_1byte, cls_struct_4_1byte))(code))(g_dbl, f_dbl);
- /* { dg-output "\n12 13 14 15 178 179 180 181: 190 192 194 196" } */
- printf("res: %d %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c, res_dbl.d);
- /* { dg-output "\nres: 190 192 194 196" } */
-
- exit(0);
-}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_4byte.c b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_4byte.c
deleted file mode 100644
index 4ac378776b..0000000000
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_4byte.c
+++ /dev/null
@@ -1,90 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Check structure passing with different structure size.
- Depending on the ABI. Check overlapping.
- Limitations: none.
- PR: none.
- Originator: <andreast@gcc.gnu.org> 20030828 */
-
-/* { dg-do run } */
-
-#include "ffitest.h"
-
-typedef struct cls_struct_4byte {
- unsigned short a;
- unsigned short b;
-} cls_struct_4byte;
-
-cls_struct_4byte cls_struct_4byte_fn(struct cls_struct_4byte a1,
- struct cls_struct_4byte a2)
-{
- struct cls_struct_4byte result;
-
- result.a = a1.a + a2.a;
- result.b = a1.b + a2.b;
-
- printf("%d %d %d %d: %d %d\n", a1.a, a1.b, a2.a, a2.b, result.a, result.b);
-
- return result;
-}
-
-static void
-cls_struct_4byte_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
- void* userdata __UNUSED__)
-{
-
- struct cls_struct_4byte a1, a2;
-
- a1 = *(struct cls_struct_4byte*)(args[0]);
- a2 = *(struct cls_struct_4byte*)(args[1]);
-
- *(cls_struct_4byte*)resp = cls_struct_4byte_fn(a1, a2);
-}
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- void* args_dbl[5];
- ffi_type* cls_struct_fields[4];
- ffi_type cls_struct_type;
- ffi_type* dbl_arg_types[5];
-
- struct cls_struct_4byte g_dbl = { 127, 120 };
- struct cls_struct_4byte f_dbl = { 12, 128 };
- struct cls_struct_4byte res_dbl;
-
- cls_struct_type.size = 0;
- cls_struct_type.alignment = 0;
- cls_struct_type.type = FFI_TYPE_STRUCT;
- cls_struct_type.elements = cls_struct_fields;
-
- cls_struct_fields[0] = &ffi_type_ushort;
- cls_struct_fields[1] = &ffi_type_ushort;
- cls_struct_fields[2] = NULL;
-
- dbl_arg_types[0] = &cls_struct_type;
- dbl_arg_types[1] = &cls_struct_type;
- dbl_arg_types[2] = NULL;
-
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type,
- dbl_arg_types) == FFI_OK);
-
- args_dbl[0] = &g_dbl;
- args_dbl[1] = &f_dbl;
- args_dbl[2] = NULL;
-
- ffi_call(&cif, FFI_FN(cls_struct_4byte_fn), &res_dbl, args_dbl);
- /* { dg-output "127 120 12 128: 139 248" } */
- printf("res: %d %d\n", res_dbl.a, res_dbl.b);
- /* { dg-output "\nres: 139 248" } */
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_4byte_gn, NULL, code) == FFI_OK);
-
- res_dbl = ((cls_struct_4byte(*)(cls_struct_4byte, cls_struct_4byte))(code))(g_dbl, f_dbl);
- /* { dg-output "\n127 120 12 128: 139 248" } */
- printf("res: %d %d\n", res_dbl.a, res_dbl.b);
- /* { dg-output "\nres: 139 248" } */
-
- exit(0);
-}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_5_1_byte.c b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_5_1_byte.c
deleted file mode 100644
index ad9d51c248..0000000000
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_5_1_byte.c
+++ /dev/null
@@ -1,109 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Check structure passing with different structure size.
- Depending on the ABI. Check overlapping.
- Limitations: none.
- PR: none.
- Originator: <andreast@gcc.gnu.org> 20050708 */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-typedef struct cls_struct_5byte {
- unsigned char a;
- unsigned char b;
- unsigned char c;
- unsigned char d;
- unsigned char e;
-} cls_struct_5byte;
-
-cls_struct_5byte cls_struct_5byte_fn(struct cls_struct_5byte a1,
- struct cls_struct_5byte a2)
-{
- struct cls_struct_5byte result;
-
- result.a = a1.a + a2.a;
- result.b = a1.b + a2.b;
- result.c = a1.c + a2.c;
- result.d = a1.d + a2.d;
- result.e = a1.e + a2.e;
-
- printf("%d %d %d %d %d %d %d %d %d %d: %d %d %d %d %d\n",
- a1.a, a1.b, a1.c, a1.d, a1.e,
- a2.a, a2.b, a2.c, a2.d, a2.e,
- result.a, result.b, result.c, result.d, result.e);
-
- return result;
-}
-
-static void
-cls_struct_5byte_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
- void* userdata __UNUSED__)
-{
-
- struct cls_struct_5byte a1, a2;
-
- a1 = *(struct cls_struct_5byte*)(args[0]);
- a2 = *(struct cls_struct_5byte*)(args[1]);
-
- *(cls_struct_5byte*)resp = cls_struct_5byte_fn(a1, a2);
-}
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- void* args_dbl[5];
- ffi_type* cls_struct_fields[6];
- ffi_type cls_struct_type;
- ffi_type* dbl_arg_types[5];
-
- struct cls_struct_5byte g_dbl = { 127, 120, 1, 3, 4 };
- struct cls_struct_5byte f_dbl = { 12, 128, 9, 3, 4 };
- struct cls_struct_5byte res_dbl = { 0, 0, 0, 0, 0 };
-
- cls_struct_type.size = 0;
- cls_struct_type.alignment = 0;
- cls_struct_type.type = FFI_TYPE_STRUCT;
- cls_struct_type.elements = cls_struct_fields;
-
- cls_struct_fields[0] = &ffi_type_uchar;
- cls_struct_fields[1] = &ffi_type_uchar;
- cls_struct_fields[2] = &ffi_type_uchar;
- cls_struct_fields[3] = &ffi_type_uchar;
- cls_struct_fields[4] = &ffi_type_uchar;
- cls_struct_fields[5] = NULL;
-
- dbl_arg_types[0] = &cls_struct_type;
- dbl_arg_types[1] = &cls_struct_type;
- dbl_arg_types[2] = NULL;
-
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type,
- dbl_arg_types) == FFI_OK);
-
- args_dbl[0] = &g_dbl;
- args_dbl[1] = &f_dbl;
- args_dbl[2] = NULL;
-
- ffi_call(&cif, FFI_FN(cls_struct_5byte_fn), &res_dbl, args_dbl);
- /* { dg-output "127 120 1 3 4 12 128 9 3 4: 139 248 10 6 8" } */
- printf("res: %d %d %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c,
- res_dbl.d, res_dbl.e);
- /* { dg-output "\nres: 139 248 10 6 8" } */
-
- res_dbl.a = 0;
- res_dbl.b = 0;
- res_dbl.c = 0;
- res_dbl.d = 0;
- res_dbl.e = 0;
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_5byte_gn, NULL, code) == FFI_OK);
-
- res_dbl = ((cls_struct_5byte(*)(cls_struct_5byte, cls_struct_5byte))(code))(g_dbl, f_dbl);
- /* { dg-output "\n127 120 1 3 4 12 128 9 3 4: 139 248 10 6 8" } */
- printf("res: %d %d %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c,
- res_dbl.d, res_dbl.e);
- /* { dg-output "\nres: 139 248 10 6 8" } */
-
- exit(0);
-}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_5byte.c b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_5byte.c
deleted file mode 100644
index 4e0c0003c0..0000000000
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_5byte.c
+++ /dev/null
@@ -1,98 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Check structure passing with different structure size.
- Depending on the ABI. Check overlapping.
- Limitations: none.
- PR: none.
- Originator: <andreast@gcc.gnu.org> 20030828 */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-typedef struct cls_struct_5byte {
- unsigned short a;
- unsigned short b;
- unsigned char c;
-} cls_struct_5byte;
-
-cls_struct_5byte cls_struct_5byte_fn(struct cls_struct_5byte a1,
- struct cls_struct_5byte a2)
-{
- struct cls_struct_5byte result;
-
- result.a = a1.a + a2.a;
- result.b = a1.b + a2.b;
- result.c = a1.c + a2.c;
-
- printf("%d %d %d %d %d %d: %d %d %d\n", a1.a, a1.b, a1.c,
- a2.a, a2.b, a2.c,
- result.a, result.b, result.c);
-
- return result;
-}
-
-static void
-cls_struct_5byte_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
- void* userdata __UNUSED__)
-{
-
- struct cls_struct_5byte a1, a2;
-
- a1 = *(struct cls_struct_5byte*)(args[0]);
- a2 = *(struct cls_struct_5byte*)(args[1]);
-
- *(cls_struct_5byte*)resp = cls_struct_5byte_fn(a1, a2);
-}
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- void* args_dbl[5];
- ffi_type* cls_struct_fields[4];
- ffi_type cls_struct_type;
- ffi_type* dbl_arg_types[5];
-
- struct cls_struct_5byte g_dbl = { 127, 120, 1 };
- struct cls_struct_5byte f_dbl = { 12, 128, 9 };
- struct cls_struct_5byte res_dbl = { 0, 0, 0 };
-
- cls_struct_type.size = 0;
- cls_struct_type.alignment = 0;
- cls_struct_type.type = FFI_TYPE_STRUCT;
- cls_struct_type.elements = cls_struct_fields;
-
- cls_struct_fields[0] = &ffi_type_ushort;
- cls_struct_fields[1] = &ffi_type_ushort;
- cls_struct_fields[2] = &ffi_type_uchar;
- cls_struct_fields[3] = NULL;
-
- dbl_arg_types[0] = &cls_struct_type;
- dbl_arg_types[1] = &cls_struct_type;
- dbl_arg_types[2] = NULL;
-
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type,
- dbl_arg_types) == FFI_OK);
-
- args_dbl[0] = &g_dbl;
- args_dbl[1] = &f_dbl;
- args_dbl[2] = NULL;
-
- ffi_call(&cif, FFI_FN(cls_struct_5byte_fn), &res_dbl, args_dbl);
- /* { dg-output "127 120 1 12 128 9: 139 248 10" } */
- printf("res: %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c);
- /* { dg-output "\nres: 139 248 10" } */
-
- res_dbl.a = 0;
- res_dbl.b = 0;
- res_dbl.c = 0;
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_5byte_gn, NULL, code) == FFI_OK);
-
- res_dbl = ((cls_struct_5byte(*)(cls_struct_5byte, cls_struct_5byte))(code))(g_dbl, f_dbl);
- /* { dg-output "\n127 120 1 12 128 9: 139 248 10" } */
- printf("res: %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c);
- /* { dg-output "\nres: 139 248 10" } */
-
- exit(0);
-}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_64byte.c b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_64byte.c
deleted file mode 100644
index a55edc2c7b..0000000000
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_64byte.c
+++ /dev/null
@@ -1,124 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Check structure passing with different structure size.
- Depending on the ABI. Check bigger struct which overlaps
- the gp and fp register count on Darwin/AIX/ppc64.
- Limitations: none.
- PR: none.
- Originator: <andreast@gcc.gnu.org> 20030828 */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-typedef struct cls_struct_64byte {
- double a;
- double b;
- double c;
- double d;
- double e;
- double f;
- double g;
- double h;
-} cls_struct_64byte;
-
-cls_struct_64byte cls_struct_64byte_fn(struct cls_struct_64byte b0,
- struct cls_struct_64byte b1,
- struct cls_struct_64byte b2,
- struct cls_struct_64byte b3)
-{
- struct cls_struct_64byte result;
-
- result.a = b0.a + b1.a + b2.a + b3.a;
- result.b = b0.b + b1.b + b2.b + b3.b;
- result.c = b0.c + b1.c + b2.c + b3.c;
- result.d = b0.d + b1.d + b2.d + b3.d;
- result.e = b0.e + b1.e + b2.e + b3.e;
- result.f = b0.f + b1.f + b2.f + b3.f;
- result.g = b0.g + b1.g + b2.g + b3.g;
- result.h = b0.h + b1.h + b2.h + b3.h;
-
- printf("%g %g %g %g %g %g %g %g\n", result.a, result.b, result.c,
- result.d, result.e, result.f, result.g, result.h);
-
- return result;
-}
-
-static void
-cls_struct_64byte_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
- void* userdata __UNUSED__)
-{
- struct cls_struct_64byte b0, b1, b2, b3;
-
- b0 = *(struct cls_struct_64byte*)(args[0]);
- b1 = *(struct cls_struct_64byte*)(args[1]);
- b2 = *(struct cls_struct_64byte*)(args[2]);
- b3 = *(struct cls_struct_64byte*)(args[3]);
-
- *(cls_struct_64byte*)resp = cls_struct_64byte_fn(b0, b1, b2, b3);
-}
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- void* args_dbl[5];
- ffi_type* cls_struct_fields[9];
- ffi_type cls_struct_type;
- ffi_type* dbl_arg_types[5];
-
- struct cls_struct_64byte e_dbl = { 9.0, 2.0, 6.0, 5.0, 3.0, 4.0, 8.0, 1.0 };
- struct cls_struct_64byte f_dbl = { 1.0, 2.0, 3.0, 7.0, 2.0, 5.0, 6.0, 7.0 };
- struct cls_struct_64byte g_dbl = { 4.0, 5.0, 7.0, 9.0, 1.0, 1.0, 2.0, 9.0 };
- struct cls_struct_64byte h_dbl = { 8.0, 6.0, 1.0, 4.0, 0.0, 3.0, 3.0, 1.0 };
- struct cls_struct_64byte res_dbl;
-
- cls_struct_type.size = 0;
- cls_struct_type.alignment = 0;
- cls_struct_type.type = FFI_TYPE_STRUCT;
- cls_struct_type.elements = cls_struct_fields;
-
- cls_struct_fields[0] = &ffi_type_double;
- cls_struct_fields[1] = &ffi_type_double;
- cls_struct_fields[2] = &ffi_type_double;
- cls_struct_fields[3] = &ffi_type_double;
- cls_struct_fields[4] = &ffi_type_double;
- cls_struct_fields[5] = &ffi_type_double;
- cls_struct_fields[6] = &ffi_type_double;
- cls_struct_fields[7] = &ffi_type_double;
- cls_struct_fields[8] = NULL;
-
- dbl_arg_types[0] = &cls_struct_type;
- dbl_arg_types[1] = &cls_struct_type;
- dbl_arg_types[2] = &cls_struct_type;
- dbl_arg_types[3] = &cls_struct_type;
- dbl_arg_types[4] = NULL;
-
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 4, &cls_struct_type,
- dbl_arg_types) == FFI_OK);
-
- args_dbl[0] = &e_dbl;
- args_dbl[1] = &f_dbl;
- args_dbl[2] = &g_dbl;
- args_dbl[3] = &h_dbl;
- args_dbl[4] = NULL;
-
- ffi_call(&cif, FFI_FN(cls_struct_64byte_fn), &res_dbl, args_dbl);
- /* { dg-output "22 15 17 25 6 13 19 18" } */
- printf("res: %g %g %g %g %g %g %g %g\n", res_dbl.a, res_dbl.b, res_dbl.c,
- res_dbl.d, res_dbl.e, res_dbl.f, res_dbl.g, res_dbl.h);
- /* { dg-output "\nres: 22 15 17 25 6 13 19 18" } */
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_64byte_gn, NULL, code) == FFI_OK);
-
- res_dbl = ((cls_struct_64byte(*)(cls_struct_64byte,
- cls_struct_64byte,
- cls_struct_64byte,
- cls_struct_64byte))
- (code))(e_dbl, f_dbl, g_dbl, h_dbl);
- /* { dg-output "\n22 15 17 25 6 13 19 18" } */
- printf("res: %g %g %g %g %g %g %g %g\n", res_dbl.a, res_dbl.b, res_dbl.c,
- res_dbl.d, res_dbl.e, res_dbl.f, res_dbl.g, res_dbl.h);
- /* { dg-output "\nres: 22 15 17 25 6 13 19 18" } */
-
- exit(0);
-}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_6_1_byte.c b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_6_1_byte.c
deleted file mode 100644
index b4dcdba472..0000000000
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_6_1_byte.c
+++ /dev/null
@@ -1,113 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Check structure passing with different structure size.
- Depending on the ABI. Check overlapping.
- Limitations: none.
- PR: none.
- Originator: <andreast@gcc.gnu.org> 20050708 */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-typedef struct cls_struct_6byte {
- unsigned char a;
- unsigned char b;
- unsigned char c;
- unsigned char d;
- unsigned char e;
- unsigned char f;
-} cls_struct_6byte;
-
-cls_struct_6byte cls_struct_6byte_fn(struct cls_struct_6byte a1,
- struct cls_struct_6byte a2)
-{
- struct cls_struct_6byte result;
-
- result.a = a1.a + a2.a;
- result.b = a1.b + a2.b;
- result.c = a1.c + a2.c;
- result.d = a1.d + a2.d;
- result.e = a1.e + a2.e;
- result.f = a1.f + a2.f;
-
- printf("%d %d %d %d %d %d %d %d %d %d %d %d: %d %d %d %d %d %d\n",
- a1.a, a1.b, a1.c, a1.d, a1.e, a1.f,
- a2.a, a2.b, a2.c, a2.d, a2.e, a2.f,
- result.a, result.b, result.c, result.d, result.e, result.f);
-
- return result;
-}
-
-static void
-cls_struct_6byte_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
- void* userdata __UNUSED__)
-{
-
- struct cls_struct_6byte a1, a2;
-
- a1 = *(struct cls_struct_6byte*)(args[0]);
- a2 = *(struct cls_struct_6byte*)(args[1]);
-
- *(cls_struct_6byte*)resp = cls_struct_6byte_fn(a1, a2);
-}
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- void* args_dbl[5];
- ffi_type* cls_struct_fields[7];
- ffi_type cls_struct_type;
- ffi_type* dbl_arg_types[5];
-
- struct cls_struct_6byte g_dbl = { 127, 120, 1, 3, 4, 5 };
- struct cls_struct_6byte f_dbl = { 12, 128, 9, 3, 4, 5 };
- struct cls_struct_6byte res_dbl = { 0, 0, 0, 0, 0, 0 };
-
- cls_struct_type.size = 0;
- cls_struct_type.alignment = 0;
- cls_struct_type.type = FFI_TYPE_STRUCT;
- cls_struct_type.elements = cls_struct_fields;
-
- cls_struct_fields[0] = &ffi_type_uchar;
- cls_struct_fields[1] = &ffi_type_uchar;
- cls_struct_fields[2] = &ffi_type_uchar;
- cls_struct_fields[3] = &ffi_type_uchar;
- cls_struct_fields[4] = &ffi_type_uchar;
- cls_struct_fields[5] = &ffi_type_uchar;
- cls_struct_fields[6] = NULL;
-
- dbl_arg_types[0] = &cls_struct_type;
- dbl_arg_types[1] = &cls_struct_type;
- dbl_arg_types[2] = NULL;
-
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type,
- dbl_arg_types) == FFI_OK);
-
- args_dbl[0] = &g_dbl;
- args_dbl[1] = &f_dbl;
- args_dbl[2] = NULL;
-
- ffi_call(&cif, FFI_FN(cls_struct_6byte_fn), &res_dbl, args_dbl);
- /* { dg-output "127 120 1 3 4 5 12 128 9 3 4 5: 139 248 10 6 8 10" } */
- printf("res: %d %d %d %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c,
- res_dbl.d, res_dbl.e, res_dbl.f);
- /* { dg-output "\nres: 139 248 10 6 8 10" } */
-
- res_dbl.a = 0;
- res_dbl.b = 0;
- res_dbl.c = 0;
- res_dbl.d = 0;
- res_dbl.e = 0;
- res_dbl.f = 0;
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_6byte_gn, NULL, code) == FFI_OK);
-
- res_dbl = ((cls_struct_6byte(*)(cls_struct_6byte, cls_struct_6byte))(code))(g_dbl, f_dbl);
- /* { dg-output "\n127 120 1 3 4 5 12 128 9 3 4 5: 139 248 10 6 8 10" } */
- printf("res: %d %d %d %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c,
- res_dbl.d, res_dbl.e, res_dbl.f);
- /* { dg-output "\nres: 139 248 10 6 8 10" } */
-
- exit(0);
-}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_6byte.c b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_6byte.c
deleted file mode 100644
index 740678017b..0000000000
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_6byte.c
+++ /dev/null
@@ -1,99 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Check structure passing with different structure size.
- Depending on the ABI. Check overlapping.
- Limitations: none.
- PR: none.
- Originator: <andreast@gcc.gnu.org> 20030828 */
-
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-typedef struct cls_struct_6byte {
- unsigned short a;
- unsigned short b;
- unsigned char c;
- unsigned char d;
-} cls_struct_6byte;
-
-cls_struct_6byte cls_struct_6byte_fn(struct cls_struct_6byte a1,
- struct cls_struct_6byte a2)
-{
- struct cls_struct_6byte result;
-
- result.a = a1.a + a2.a;
- result.b = a1.b + a2.b;
- result.c = a1.c + a2.c;
- result.d = a1.d + a2.d;
-
- printf("%d %d %d %d %d %d %d %d: %d %d %d %d\n", a1.a, a1.b, a1.c, a1.d,
- a2.a, a2.b, a2.c, a2.d,
- result.a, result.b, result.c, result.d);
-
- return result;
-}
-
-static void
-cls_struct_6byte_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
- void* userdata __UNUSED__)
-{
-
- struct cls_struct_6byte a1, a2;
-
- a1 = *(struct cls_struct_6byte*)(args[0]);
- a2 = *(struct cls_struct_6byte*)(args[1]);
-
- *(cls_struct_6byte*)resp = cls_struct_6byte_fn(a1, a2);
-}
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- void* args_dbl[5];
- ffi_type* cls_struct_fields[5];
- ffi_type cls_struct_type;
- ffi_type* dbl_arg_types[5];
-
- struct cls_struct_6byte g_dbl = { 127, 120, 1, 128 };
- struct cls_struct_6byte f_dbl = { 12, 128, 9, 127 };
- struct cls_struct_6byte res_dbl;
-
- cls_struct_type.size = 0;
- cls_struct_type.alignment = 0;
- cls_struct_type.type = FFI_TYPE_STRUCT;
- cls_struct_type.elements = cls_struct_fields;
-
- cls_struct_fields[0] = &ffi_type_ushort;
- cls_struct_fields[1] = &ffi_type_ushort;
- cls_struct_fields[2] = &ffi_type_uchar;
- cls_struct_fields[3] = &ffi_type_uchar;
- cls_struct_fields[4] = NULL;
-
- dbl_arg_types[0] = &cls_struct_type;
- dbl_arg_types[1] = &cls_struct_type;
- dbl_arg_types[2] = NULL;
-
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type,
- dbl_arg_types) == FFI_OK);
-
- args_dbl[0] = &g_dbl;
- args_dbl[1] = &f_dbl;
- args_dbl[2] = NULL;
-
- ffi_call(&cif, FFI_FN(cls_struct_6byte_fn), &res_dbl, args_dbl);
- /* { dg-output "127 120 1 128 12 128 9 127: 139 248 10 255" } */
- printf("res: %d %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c, res_dbl.d);
- /* { dg-output "\nres: 139 248 10 255" } */
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_6byte_gn, NULL, code) == FFI_OK);
-
- res_dbl = ((cls_struct_6byte(*)(cls_struct_6byte, cls_struct_6byte))(code))(g_dbl, f_dbl);
- /* { dg-output "\n127 120 1 128 12 128 9 127: 139 248 10 255" } */
- printf("res: %d %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c, res_dbl.d);
- /* { dg-output "\nres: 139 248 10 255" } */
-
-
- exit(0);
-}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_7_1_byte.c b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_7_1_byte.c
deleted file mode 100644
index 14a7e96f9d..0000000000
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_7_1_byte.c
+++ /dev/null
@@ -1,117 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Check structure passing with different structure size.
- Depending on the ABI. Check overlapping.
- Limitations: none.
- PR: none.
- Originator: <andreast@gcc.gnu.org> 20050708 */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-typedef struct cls_struct_7byte {
- unsigned char a;
- unsigned char b;
- unsigned char c;
- unsigned char d;
- unsigned char e;
- unsigned char f;
- unsigned char g;
-} cls_struct_7byte;
-
-cls_struct_7byte cls_struct_7byte_fn(struct cls_struct_7byte a1,
- struct cls_struct_7byte a2)
-{
- struct cls_struct_7byte result;
-
- result.a = a1.a + a2.a;
- result.b = a1.b + a2.b;
- result.c = a1.c + a2.c;
- result.d = a1.d + a2.d;
- result.e = a1.e + a2.e;
- result.f = a1.f + a2.f;
- result.g = a1.g + a2.g;
-
- printf("%d %d %d %d %d %d %d %d %d %d %d %d %d %d: %d %d %d %d %d %d %d\n",
- a1.a, a1.b, a1.c, a1.d, a1.e, a1.f, a1.g,
- a2.a, a2.b, a2.c, a2.d, a2.e, a2.f, a2.g,
- result.a, result.b, result.c, result.d, result.e, result.f, result.g);
-
- return result;
-}
-
-static void
-cls_struct_7byte_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
- void* userdata __UNUSED__)
-{
-
- struct cls_struct_7byte a1, a2;
-
- a1 = *(struct cls_struct_7byte*)(args[0]);
- a2 = *(struct cls_struct_7byte*)(args[1]);
-
- *(cls_struct_7byte*)resp = cls_struct_7byte_fn(a1, a2);
-}
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- void* args_dbl[5];
- ffi_type* cls_struct_fields[8];
- ffi_type cls_struct_type;
- ffi_type* dbl_arg_types[5];
-
- struct cls_struct_7byte g_dbl = { 127, 120, 1, 3, 4, 5, 6 };
- struct cls_struct_7byte f_dbl = { 12, 128, 9, 3, 4, 5, 6 };
- struct cls_struct_7byte res_dbl = { 0, 0, 0, 0, 0, 0, 0 };
-
- cls_struct_type.size = 0;
- cls_struct_type.alignment = 0;
- cls_struct_type.type = FFI_TYPE_STRUCT;
- cls_struct_type.elements = cls_struct_fields;
-
- cls_struct_fields[0] = &ffi_type_uchar;
- cls_struct_fields[1] = &ffi_type_uchar;
- cls_struct_fields[2] = &ffi_type_uchar;
- cls_struct_fields[3] = &ffi_type_uchar;
- cls_struct_fields[4] = &ffi_type_uchar;
- cls_struct_fields[5] = &ffi_type_uchar;
- cls_struct_fields[6] = &ffi_type_uchar;
- cls_struct_fields[7] = NULL;
-
- dbl_arg_types[0] = &cls_struct_type;
- dbl_arg_types[1] = &cls_struct_type;
- dbl_arg_types[2] = NULL;
-
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type,
- dbl_arg_types) == FFI_OK);
-
- args_dbl[0] = &g_dbl;
- args_dbl[1] = &f_dbl;
- args_dbl[2] = NULL;
-
- ffi_call(&cif, FFI_FN(cls_struct_7byte_fn), &res_dbl, args_dbl);
- /* { dg-output "127 120 1 3 4 5 6 12 128 9 3 4 5 6: 139 248 10 6 8 10 12" } */
- printf("res: %d %d %d %d %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c,
- res_dbl.d, res_dbl.e, res_dbl.f, res_dbl.g);
- /* { dg-output "\nres: 139 248 10 6 8 10 12" } */
-
- res_dbl.a = 0;
- res_dbl.b = 0;
- res_dbl.c = 0;
- res_dbl.d = 0;
- res_dbl.e = 0;
- res_dbl.f = 0;
- res_dbl.g = 0;
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_7byte_gn, NULL, code) == FFI_OK);
-
- res_dbl = ((cls_struct_7byte(*)(cls_struct_7byte, cls_struct_7byte))(code))(g_dbl, f_dbl);
- /* { dg-output "\n127 120 1 3 4 5 6 12 128 9 3 4 5 6: 139 248 10 6 8 10 12" } */
- printf("res: %d %d %d %d %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c,
- res_dbl.d, res_dbl.e, res_dbl.f, res_dbl.g);
- /* { dg-output "\nres: 139 248 10 6 8 10 12" } */
-
- exit(0);
-}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_7byte.c b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_7byte.c
deleted file mode 100644
index 1645cc635f..0000000000
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_7byte.c
+++ /dev/null
@@ -1,97 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Check structure passing with different structure size.
- Depending on the ABI. Check overlapping.
- Limitations: none.
- PR: none.
- Originator: <andreast@gcc.gnu.org> 20030828 */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-typedef struct cls_struct_7byte {
- unsigned short a;
- unsigned short b;
- unsigned char c;
- unsigned short d;
-} cls_struct_7byte;
-
-cls_struct_7byte cls_struct_7byte_fn(struct cls_struct_7byte a1,
- struct cls_struct_7byte a2)
-{
- struct cls_struct_7byte result;
-
- result.a = a1.a + a2.a;
- result.b = a1.b + a2.b;
- result.c = a1.c + a2.c;
- result.d = a1.d + a2.d;
-
- printf("%d %d %d %d %d %d %d %d: %d %d %d %d\n", a1.a, a1.b, a1.c, a1.d,
- a2.a, a2.b, a2.c, a2.d,
- result.a, result.b, result.c, result.d);
-
- return result;
-}
-
-static void
-cls_struct_7byte_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
- void* userdata __UNUSED__)
-{
-
- struct cls_struct_7byte a1, a2;
-
- a1 = *(struct cls_struct_7byte*)(args[0]);
- a2 = *(struct cls_struct_7byte*)(args[1]);
-
- *(cls_struct_7byte*)resp = cls_struct_7byte_fn(a1, a2);
-}
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- void* args_dbl[5];
- ffi_type* cls_struct_fields[5];
- ffi_type cls_struct_type;
- ffi_type* dbl_arg_types[5];
-
- struct cls_struct_7byte g_dbl = { 127, 120, 1, 254 };
- struct cls_struct_7byte f_dbl = { 12, 128, 9, 255 };
- struct cls_struct_7byte res_dbl;
-
- cls_struct_type.size = 0;
- cls_struct_type.alignment = 0;
- cls_struct_type.type = FFI_TYPE_STRUCT;
- cls_struct_type.elements = cls_struct_fields;
-
- cls_struct_fields[0] = &ffi_type_ushort;
- cls_struct_fields[1] = &ffi_type_ushort;
- cls_struct_fields[2] = &ffi_type_uchar;
- cls_struct_fields[3] = &ffi_type_ushort;
- cls_struct_fields[4] = NULL;
-
- dbl_arg_types[0] = &cls_struct_type;
- dbl_arg_types[1] = &cls_struct_type;
- dbl_arg_types[2] = NULL;
-
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type,
- dbl_arg_types) == FFI_OK);
-
- args_dbl[0] = &g_dbl;
- args_dbl[1] = &f_dbl;
- args_dbl[2] = NULL;
-
- ffi_call(&cif, FFI_FN(cls_struct_7byte_fn), &res_dbl, args_dbl);
- /* { dg-output "127 120 1 254 12 128 9 255: 139 248 10 509" } */
- printf("res: %d %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c, res_dbl.d);
- /* { dg-output "\nres: 139 248 10 509" } */
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_7byte_gn, NULL, code) == FFI_OK);
-
- res_dbl = ((cls_struct_7byte(*)(cls_struct_7byte, cls_struct_7byte))(code))(g_dbl, f_dbl);
- /* { dg-output "\n127 120 1 254 12 128 9 255: 139 248 10 509" } */
- printf("res: %d %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c, res_dbl.d);
- /* { dg-output "\nres: 139 248 10 509" } */
-
- exit(0);
-}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_8byte.c b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_8byte.c
deleted file mode 100644
index f6c1ea570a..0000000000
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_8byte.c
+++ /dev/null
@@ -1,88 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Check structure passing with different structure size.
- Depending on the ABI. Check overlapping.
- Limitations: none.
- PR: none.
- Originator: <andreast@gcc.gnu.org> 20030828 */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-typedef struct cls_struct_8byte {
- int a;
- float b;
-} cls_struct_8byte;
-
-cls_struct_8byte cls_struct_8byte_fn(struct cls_struct_8byte a1,
- struct cls_struct_8byte a2)
-{
- struct cls_struct_8byte result;
-
- result.a = a1.a + a2.a;
- result.b = a1.b + a2.b;
-
- printf("%d %g %d %g: %d %g\n", a1.a, a1.b, a2.a, a2.b, result.a, result.b);
-
- return result;
-}
-
-static void
-cls_struct_8byte_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
- void* userdata __UNUSED__)
-{
-
- struct cls_struct_8byte a1, a2;
-
- a1 = *(struct cls_struct_8byte*)(args[0]);
- a2 = *(struct cls_struct_8byte*)(args[1]);
-
- *(cls_struct_8byte*)resp = cls_struct_8byte_fn(a1, a2);
-}
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- void* args_dbl[5];
- ffi_type* cls_struct_fields[4];
- ffi_type cls_struct_type;
- ffi_type* dbl_arg_types[5];
-
- struct cls_struct_8byte g_dbl = { 1, 2.0 };
- struct cls_struct_8byte f_dbl = { 4, 5.0 };
- struct cls_struct_8byte res_dbl;
-
- cls_struct_type.size = 0;
- cls_struct_type.alignment = 0;
- cls_struct_type.type = FFI_TYPE_STRUCT;
- cls_struct_type.elements = cls_struct_fields;
-
- cls_struct_fields[0] = &ffi_type_sint;
- cls_struct_fields[1] = &ffi_type_float;
- cls_struct_fields[2] = NULL;
-
- dbl_arg_types[0] = &cls_struct_type;
- dbl_arg_types[1] = &cls_struct_type;
- dbl_arg_types[2] = NULL;
-
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type,
- dbl_arg_types) == FFI_OK);
-
- args_dbl[0] = &g_dbl;
- args_dbl[1] = &f_dbl;
- args_dbl[2] = NULL;
-
- ffi_call(&cif, FFI_FN(cls_struct_8byte_fn), &res_dbl, args_dbl);
- /* { dg-output "1 2 4 5: 5 7" } */
- printf("res: %d %g\n", res_dbl.a, res_dbl.b);
- /* { dg-output "\nres: 5 7" } */
- CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_8byte_gn, NULL, code) == FFI_OK);
-
- res_dbl = ((cls_struct_8byte(*)(cls_struct_8byte, cls_struct_8byte))(code))(g_dbl, f_dbl);
- /* { dg-output "\n1 2 4 5: 5 7" } */
- printf("res: %d %g\n", res_dbl.a, res_dbl.b);
- /* { dg-output "\nres: 5 7" } */
-
- exit(0);
-}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_9byte1.c b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_9byte1.c
deleted file mode 100644
index 0b8572223c..0000000000
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_9byte1.c
+++ /dev/null
@@ -1,90 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Check structure passing with different structure size.
- Depending on the ABI. Darwin/AIX do double-word
- alignment of the struct if the first element is a double.
- Check that it does not here.
- Limitations: none.
- PR: none.
- Originator: <andreast@gcc.gnu.org> 20030914 */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-typedef struct cls_struct_9byte {
- int a;
- double b;
-} cls_struct_9byte;
-
-cls_struct_9byte cls_struct_9byte_fn(struct cls_struct_9byte b1,
- struct cls_struct_9byte b2)
-{
- struct cls_struct_9byte result;
-
- result.a = b1.a + b2.a;
- result.b = b1.b + b2.b;
-
- printf("%d %g %d %g: %d %g\n", b1.a, b1.b, b2.a, b2.b,
- result.a, result.b);
-
- return result;
-}
-
-static void cls_struct_9byte_gn(ffi_cif* cif __UNUSED__, void* resp,
- void** args, void* userdata __UNUSED__)
-{
- struct cls_struct_9byte b1, b2;
-
- b1 = *(struct cls_struct_9byte*)(args[0]);
- b2 = *(struct cls_struct_9byte*)(args[1]);
-
- *(cls_struct_9byte*)resp = cls_struct_9byte_fn(b1, b2);
-}
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- void* args_dbl[3];
- ffi_type* cls_struct_fields[3];
- ffi_type cls_struct_type;
- ffi_type* dbl_arg_types[3];
-
- struct cls_struct_9byte h_dbl = { 7, 8.0};
- struct cls_struct_9byte j_dbl = { 1, 9.0};
- struct cls_struct_9byte res_dbl;
-
- cls_struct_type.size = 0;
- cls_struct_type.alignment = 0;
- cls_struct_type.type = FFI_TYPE_STRUCT;
- cls_struct_type.elements = cls_struct_fields;
-
- cls_struct_fields[0] = &ffi_type_sint;
- cls_struct_fields[1] = &ffi_type_double;
- cls_struct_fields[2] = NULL;
-
- dbl_arg_types[0] = &cls_struct_type;
- dbl_arg_types[1] = &cls_struct_type;
- dbl_arg_types[2] = NULL;
-
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type,
- dbl_arg_types) == FFI_OK);
-
- args_dbl[0] = &h_dbl;
- args_dbl[1] = &j_dbl;
- args_dbl[2] = NULL;
-
- ffi_call(&cif, FFI_FN(cls_struct_9byte_fn), &res_dbl, args_dbl);
- /* { dg-output "7 8 1 9: 8 17" } */
- printf("res: %d %g\n", res_dbl.a, res_dbl.b);
- /* { dg-output "\nres: 8 17" } */
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_9byte_gn, NULL, code) == FFI_OK);
-
- res_dbl = ((cls_struct_9byte(*)(cls_struct_9byte, cls_struct_9byte))(code))(h_dbl, j_dbl);
- /* { dg-output "\n7 8 1 9: 8 17" } */
- printf("res: %d %g\n", res_dbl.a, res_dbl.b);
- /* { dg-output "\nres: 8 17" } */
-
- exit(0);
-}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_9byte2.c b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_9byte2.c
deleted file mode 100644
index edf991de73..0000000000
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_9byte2.c
+++ /dev/null
@@ -1,91 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Check structure passing with different structure size.
- Depending on the ABI. Darwin/AIX do double-word
- alignment of the struct if the first element is a double.
- Check that it does here.
- Limitations: none.
- PR: none.
- Originator: <andreast@gcc.gnu.org> 20030914 */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-typedef struct cls_struct_9byte {
- double a;
- int b;
-} cls_struct_9byte;
-
-cls_struct_9byte cls_struct_9byte_fn(struct cls_struct_9byte b1,
- struct cls_struct_9byte b2)
-{
- struct cls_struct_9byte result;
-
- result.a = b1.a + b2.a;
- result.b = b1.b + b2.b;
-
- printf("%g %d %g %d: %g %d\n", b1.a, b1.b, b2.a, b2.b,
- result.a, result.b);
-
- return result;
-}
-
-static void cls_struct_9byte_gn(ffi_cif* cif __UNUSED__, void* resp,
- void** args, void* userdata __UNUSED__)
-{
- struct cls_struct_9byte b1, b2;
-
- b1 = *(struct cls_struct_9byte*)(args[0]);
- b2 = *(struct cls_struct_9byte*)(args[1]);
-
- *(cls_struct_9byte*)resp = cls_struct_9byte_fn(b1, b2);
-}
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- void* args_dbl[3];
- ffi_type* cls_struct_fields[3];
- ffi_type cls_struct_type;
- ffi_type* dbl_arg_types[3];
-
- struct cls_struct_9byte h_dbl = { 7.0, 8};
- struct cls_struct_9byte j_dbl = { 1.0, 9};
- struct cls_struct_9byte res_dbl;
-
- cls_struct_type.size = 0;
- cls_struct_type.alignment = 0;
- cls_struct_type.type = FFI_TYPE_STRUCT;
- cls_struct_type.elements = cls_struct_fields;
-
- cls_struct_fields[0] = &ffi_type_double;
- cls_struct_fields[1] = &ffi_type_sint;
- cls_struct_fields[2] = NULL;
-
- dbl_arg_types[0] = &cls_struct_type;
- dbl_arg_types[1] = &cls_struct_type;
- dbl_arg_types[2] = NULL;
-
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type,
- dbl_arg_types) == FFI_OK);
-
- args_dbl[0] = &h_dbl;
- args_dbl[1] = &j_dbl;
- args_dbl[2] = NULL;
-
- ffi_call(&cif, FFI_FN(cls_struct_9byte_fn), &res_dbl, args_dbl);
- /* { dg-output "7 8 1 9: 8 17" } */
- printf("res: %g %d\n", res_dbl.a, res_dbl.b);
- /* { dg-output "\nres: 8 17" } */
-
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_9byte_gn, NULL, code) == FFI_OK);
-
- res_dbl = ((cls_struct_9byte(*)(cls_struct_9byte, cls_struct_9byte))(code))(h_dbl, j_dbl);
- /* { dg-output "\n7 8 1 9: 8 17" } */
- printf("res: %g %d\n", res_dbl.a, res_dbl.b);
- /* { dg-output "\nres: 8 17" } */
-
- exit(0);
-}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_align_double.c b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_align_double.c
deleted file mode 100644
index aad5f3ced6..0000000000
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_align_double.c
+++ /dev/null
@@ -1,93 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Check structure alignment of double.
- Limitations: none.
- PR: none.
- Originator: <hos@tamanegi.org> 20031203 */
-
-
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-typedef struct cls_struct_align {
- unsigned char a;
- double b;
- unsigned char c;
-} cls_struct_align;
-
-cls_struct_align cls_struct_align_fn(struct cls_struct_align a1,
- struct cls_struct_align a2)
-{
- struct cls_struct_align result;
-
- result.a = a1.a + a2.a;
- result.b = a1.b + a2.b;
- result.c = a1.c + a2.c;
-
- printf("%d %g %d %d %g %d: %d %g %d\n", a1.a, a1.b, a1.c, a2.a, a2.b, a2.c, result.a, result.b, result.c);
-
- return result;
-}
-
-static void
-cls_struct_align_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
- void* userdata __UNUSED__)
-{
-
- struct cls_struct_align a1, a2;
-
- a1 = *(struct cls_struct_align*)(args[0]);
- a2 = *(struct cls_struct_align*)(args[1]);
-
- *(cls_struct_align*)resp = cls_struct_align_fn(a1, a2);
-}
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- void* args_dbl[5];
- ffi_type* cls_struct_fields[4];
- ffi_type cls_struct_type;
- ffi_type* dbl_arg_types[5];
-
- struct cls_struct_align g_dbl = { 12, 4951, 127 };
- struct cls_struct_align f_dbl = { 1, 9320, 13 };
- struct cls_struct_align res_dbl;
-
- cls_struct_type.size = 0;
- cls_struct_type.alignment = 0;
- cls_struct_type.type = FFI_TYPE_STRUCT;
- cls_struct_type.elements = cls_struct_fields;
-
- cls_struct_fields[0] = &ffi_type_uchar;
- cls_struct_fields[1] = &ffi_type_double;
- cls_struct_fields[2] = &ffi_type_uchar;
- cls_struct_fields[3] = NULL;
-
- dbl_arg_types[0] = &cls_struct_type;
- dbl_arg_types[1] = &cls_struct_type;
- dbl_arg_types[2] = NULL;
-
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type,
- dbl_arg_types) == FFI_OK);
-
- args_dbl[0] = &g_dbl;
- args_dbl[1] = &f_dbl;
- args_dbl[2] = NULL;
-
- ffi_call(&cif, FFI_FN(cls_struct_align_fn), &res_dbl, args_dbl);
- /* { dg-output "12 4951 127 1 9320 13: 13 14271 140" } */
- printf("res: %d %g %d\n", res_dbl.a, res_dbl.b, res_dbl.c);
- /* { dg-output "\nres: 13 14271 140" } */
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_align_gn, NULL, code) == FFI_OK);
-
- res_dbl = ((cls_struct_align(*)(cls_struct_align, cls_struct_align))(code))(g_dbl, f_dbl);
- /* { dg-output "\n12 4951 127 1 9320 13: 13 14271 140" } */
- printf("res: %d %g %d\n", res_dbl.a, res_dbl.b, res_dbl.c);
- /* { dg-output "\nres: 13 14271 140" } */
-
- exit(0);
-}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_align_float.c b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_align_float.c
deleted file mode 100644
index 37e085529e..0000000000
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_align_float.c
+++ /dev/null
@@ -1,91 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Check structure alignment of float.
- Limitations: none.
- PR: none.
- Originator: <hos@tamanegi.org> 20031203 */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-typedef struct cls_struct_align {
- unsigned char a;
- float b;
- unsigned char c;
-} cls_struct_align;
-
-cls_struct_align cls_struct_align_fn(struct cls_struct_align a1,
- struct cls_struct_align a2)
-{
- struct cls_struct_align result;
-
- result.a = a1.a + a2.a;
- result.b = a1.b + a2.b;
- result.c = a1.c + a2.c;
-
- printf("%d %g %d %d %g %d: %d %g %d\n", a1.a, (double)a1.b, a1.c, a2.a, (double)a2.b, a2.c, result.a, (double)result.b, result.c);
-
- return result;
-}
-
-static void
-cls_struct_align_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
- void* userdata __UNUSED__)
-{
-
- struct cls_struct_align a1, a2;
-
- a1 = *(struct cls_struct_align*)(args[0]);
- a2 = *(struct cls_struct_align*)(args[1]);
-
- *(cls_struct_align*)resp = cls_struct_align_fn(a1, a2);
-}
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- void* args_dbl[5];
- ffi_type* cls_struct_fields[4];
- ffi_type cls_struct_type;
- ffi_type* dbl_arg_types[5];
-
- struct cls_struct_align g_dbl = { 12, 4951, 127 };
- struct cls_struct_align f_dbl = { 1, 9320, 13 };
- struct cls_struct_align res_dbl;
-
- cls_struct_type.size = 0;
- cls_struct_type.alignment = 0;
- cls_struct_type.type = FFI_TYPE_STRUCT;
- cls_struct_type.elements = cls_struct_fields;
-
- cls_struct_fields[0] = &ffi_type_uchar;
- cls_struct_fields[1] = &ffi_type_float;
- cls_struct_fields[2] = &ffi_type_uchar;
- cls_struct_fields[3] = NULL;
-
- dbl_arg_types[0] = &cls_struct_type;
- dbl_arg_types[1] = &cls_struct_type;
- dbl_arg_types[2] = NULL;
-
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type,
- dbl_arg_types) == FFI_OK);
-
- args_dbl[0] = &g_dbl;
- args_dbl[1] = &f_dbl;
- args_dbl[2] = NULL;
-
- ffi_call(&cif, FFI_FN(cls_struct_align_fn), &res_dbl, args_dbl);
- /* { dg-output "12 4951 127 1 9320 13: 13 14271 140" } */
- printf("res: %d %g %d\n", res_dbl.a, (double)res_dbl.b, res_dbl.c);
- /* { dg-output "\nres: 13 14271 140" } */
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_align_gn, NULL, code) == FFI_OK);
-
- res_dbl = ((cls_struct_align(*)(cls_struct_align, cls_struct_align))(code))(g_dbl, f_dbl);
- /* { dg-output "\n12 4951 127 1 9320 13: 13 14271 140" } */
- printf("res: %d %g %d\n", res_dbl.a, (double)res_dbl.b, res_dbl.c);
- /* { dg-output "\nres: 13 14271 140" } */
-
- exit(0);
-}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_align_longdouble.c b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_align_longdouble.c
deleted file mode 100644
index b3322d8615..0000000000
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_align_longdouble.c
+++ /dev/null
@@ -1,92 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Check structure alignment of long double.
- Limitations: none.
- PR: none.
- Originator: <hos@tamanegi.org> 20031203 */
-
-/* { dg-do run } */
-
-#include "ffitest.h"
-
-typedef struct cls_struct_align {
- unsigned char a;
- long double b;
- unsigned char c;
-} cls_struct_align;
-
-cls_struct_align cls_struct_align_fn(struct cls_struct_align a1,
- struct cls_struct_align a2)
-{
- struct cls_struct_align result;
-
- result.a = a1.a + a2.a;
- result.b = a1.b + a2.b;
- result.c = a1.c + a2.c;
-
- printf("%d %g %d %d %g %d: %d %g %d\n", a1.a, (double)a1.b, a1.c, a2.a, (double)a2.b, a2.c, result.a, (double)result.b, result.c);
-
- return result;
-}
-
-static void
-cls_struct_align_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
- void* userdata __UNUSED__)
-{
-
- struct cls_struct_align a1, a2;
-
- a1 = *(struct cls_struct_align*)(args[0]);
- a2 = *(struct cls_struct_align*)(args[1]);
-
- *(cls_struct_align*)resp = cls_struct_align_fn(a1, a2);
-}
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- void* args_dbl[5];
- ffi_type* cls_struct_fields[4];
- ffi_type cls_struct_type;
- ffi_type* dbl_arg_types[5];
-
- struct cls_struct_align g_dbl = { 12, 4951, 127 };
- struct cls_struct_align f_dbl = { 1, 9320, 13 };
- struct cls_struct_align res_dbl;
-
- cls_struct_type.size = 0;
- cls_struct_type.alignment = 0;
- cls_struct_type.type = FFI_TYPE_STRUCT;
- cls_struct_type.elements = cls_struct_fields;
-
- cls_struct_fields[0] = &ffi_type_uchar;
- cls_struct_fields[1] = &ffi_type_longdouble;
- cls_struct_fields[2] = &ffi_type_uchar;
- cls_struct_fields[3] = NULL;
-
- dbl_arg_types[0] = &cls_struct_type;
- dbl_arg_types[1] = &cls_struct_type;
- dbl_arg_types[2] = NULL;
-
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type,
- dbl_arg_types) == FFI_OK);
-
- args_dbl[0] = &g_dbl;
- args_dbl[1] = &f_dbl;
- args_dbl[2] = NULL;
-
- ffi_call(&cif, FFI_FN(cls_struct_align_fn), &res_dbl, args_dbl);
- /* { dg-output "12 4951 127 1 9320 13: 13 14271 140" } */
- printf("res: %d %g %d\n", res_dbl.a, (double)res_dbl.b, res_dbl.c);
- /* { dg-output "\nres: 13 14271 140" } */
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_align_gn, NULL, code) == FFI_OK);
-
- res_dbl = ((cls_struct_align(*)(cls_struct_align, cls_struct_align))(code))(g_dbl, f_dbl);
- /* { dg-output "\n12 4951 127 1 9320 13: 13 14271 140" } */
- printf("res: %d %g %d\n", res_dbl.a, (double)res_dbl.b, res_dbl.c);
- /* { dg-output "\nres: 13 14271 140" } */
-
- exit(0);
-}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_align_longdouble_split.c b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_align_longdouble_split.c
deleted file mode 100644
index 15f9365465..0000000000
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_align_longdouble_split.c
+++ /dev/null
@@ -1,134 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Check structure alignment of long double.
- Limitations: none.
- PR: none.
- Originator: <hos@tamanegi.org> 20031203 */
-
-/* { dg-excess-errors "no long double format" { xfail x86_64-*-mingw* x86_64-*-cygwin* } } */
-/* { dg-do run { xfail strongarm*-*-* xscale*-*-* } } */
-/* { dg-options -mlong-double-128 { target powerpc64*-*-linux* } } */
-/* { dg-output "" { xfail x86_64-*-mingw* x86_64-*-cygwin* } } */
-
-#include "ffitest.h"
-
-typedef struct cls_struct_align {
- long double a;
- long double b;
- long double c;
- long double d;
- long double e;
- long double f;
- long double g;
-} cls_struct_align;
-
-cls_struct_align cls_struct_align_fn(
- cls_struct_align a1,
- cls_struct_align a2)
-{
- struct cls_struct_align r;
-
- r.a = a1.a + a2.a;
- r.b = a1.b + a2.b;
- r.c = a1.c + a2.c;
- r.d = a1.d + a2.d;
- r.e = a1.e + a2.e;
- r.f = a1.f + a2.f;
- r.g = a1.g + a2.g;
-
- printf("%Lg %Lg %Lg %Lg %Lg %Lg %Lg %Lg %Lg %Lg %Lg %Lg %Lg %Lg: "
- "%Lg %Lg %Lg %Lg %Lg %Lg %Lg\n",
- a1.a, a1.b, a1.c, a1.d, a1.e, a1.f, a1.g,
- a2.a, a2.b, a2.c, a2.d, a2.e, a2.f, a2.g,
- r.a, r.b, r.c, r.d, r.e, r.f, r.g);
-
- return r;
-}
-
-cls_struct_align cls_struct_align_fn2(
- cls_struct_align a1)
-{
- struct cls_struct_align r;
-
- r.a = a1.a + 1;
- r.b = a1.b + 1;
- r.c = a1.c + 1;
- r.d = a1.d + 1;
- r.e = a1.e + 1;
- r.f = a1.f + 1;
- r.g = a1.g + 1;
-
- printf("%Lg %Lg %Lg %Lg %Lg %Lg %Lg: "
- "%Lg %Lg %Lg %Lg %Lg %Lg %Lg\n",
- a1.a, a1.b, a1.c, a1.d, a1.e, a1.f, a1.g,
- r.a, r.b, r.c, r.d, r.e, r.f, r.g);
-
- return r;
-}
-
-static void
-cls_struct_align_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
- void* userdata __UNUSED__)
-{
- struct cls_struct_align a1, a2;
-
- a1 = *(struct cls_struct_align*)(args[0]);
- a2 = *(struct cls_struct_align*)(args[1]);
-
- *(cls_struct_align*)resp = cls_struct_align_fn(a1, a2);
-}
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- void* args_dbl[3];
- ffi_type* cls_struct_fields[8];
- ffi_type cls_struct_type;
- ffi_type* dbl_arg_types[3];
-
- struct cls_struct_align g_dbl = { 1, 2, 3, 4, 5, 6, 7 };
- struct cls_struct_align f_dbl = { 8, 9, 10, 11, 12, 13, 14 };
- struct cls_struct_align res_dbl;
-
- cls_struct_type.size = 0;
- cls_struct_type.alignment = 0;
- cls_struct_type.type = FFI_TYPE_STRUCT;
- cls_struct_type.elements = cls_struct_fields;
-
- cls_struct_fields[0] = &ffi_type_longdouble;
- cls_struct_fields[1] = &ffi_type_longdouble;
- cls_struct_fields[2] = &ffi_type_longdouble;
- cls_struct_fields[3] = &ffi_type_longdouble;
- cls_struct_fields[4] = &ffi_type_longdouble;
- cls_struct_fields[5] = &ffi_type_longdouble;
- cls_struct_fields[6] = &ffi_type_longdouble;
- cls_struct_fields[7] = NULL;
-
- dbl_arg_types[0] = &cls_struct_type;
- dbl_arg_types[1] = &cls_struct_type;
- dbl_arg_types[2] = NULL;
-
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type,
- dbl_arg_types) == FFI_OK);
-
- args_dbl[0] = &g_dbl;
- args_dbl[1] = &f_dbl;
- args_dbl[2] = NULL;
-
- ffi_call(&cif, FFI_FN(cls_struct_align_fn), &res_dbl, args_dbl);
- /* { dg-output "1 2 3 4 5 6 7 8 9 10 11 12 13 14: 9 11 13 15 17 19 21" } */
- printf("res: %Lg %Lg %Lg %Lg %Lg %Lg %Lg\n", res_dbl.a, res_dbl.b,
- res_dbl.c, res_dbl.d, res_dbl.e, res_dbl.f, res_dbl.g);
- /* { dg-output "\nres: 9 11 13 15 17 19 21" } */
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_align_gn, NULL, code) == FFI_OK);
-
- res_dbl = ((cls_struct_align(*)(cls_struct_align, cls_struct_align))(code))(g_dbl, f_dbl);
- /* { dg-output "\n1 2 3 4 5 6 7 8 9 10 11 12 13 14: 9 11 13 15 17 19 21" } */
- printf("res: %Lg %Lg %Lg %Lg %Lg %Lg %Lg\n", res_dbl.a, res_dbl.b,
- res_dbl.c, res_dbl.d, res_dbl.e, res_dbl.f, res_dbl.g);
- /* { dg-output "\nres: 9 11 13 15 17 19 21" } */
-
- exit(0);
-}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_align_longdouble_split2.c b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_align_longdouble_split2.c
deleted file mode 100644
index ca1c356cbe..0000000000
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_align_longdouble_split2.c
+++ /dev/null
@@ -1,117 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Check structure alignment of long double.
- Limitations: none.
- PR: none.
- Originator: Blake Chaffin 6/18/2007
-*/
-
-/* { dg-excess-errors "no long double format" { xfail x86_64-*-mingw* x86_64-*-cygwin* } } */
-/* { dg-do run { xfail strongarm*-*-* } } */
-/* { dg-options -mlong-double-128 { target powerpc64*-*-linux* } } */
-/* { dg-output "" { xfail x86_64-*-mingw* x86_64-*-cygwin* } } */
-
-#include "ffitest.h"
-
-typedef struct cls_struct_align {
- long double a;
- long double b;
- long double c;
- long double d;
- long double e;
- double f;
- long double g;
-} cls_struct_align;
-
-cls_struct_align cls_struct_align_fn(
- cls_struct_align a1,
- cls_struct_align a2)
-{
- struct cls_struct_align r;
-
- r.a = a1.a + a2.a;
- r.b = a1.b + a2.b;
- r.c = a1.c + a2.c;
- r.d = a1.d + a2.d;
- r.e = a1.e + a2.e;
- r.f = a1.f + a2.f;
- r.g = a1.g + a2.g;
-
- printf("%Lg %Lg %Lg %Lg %Lg %g %Lg %Lg %Lg %Lg %Lg %Lg %g %Lg: "
- "%Lg %Lg %Lg %Lg %Lg %g %Lg\n",
- a1.a, a1.b, a1.c, a1.d, a1.e, a1.f, a1.g,
- a2.a, a2.b, a2.c, a2.d, a2.e, a2.f, a2.g,
- r.a, r.b, r.c, r.d, r.e, r.f, r.g);
-
- return r;
-}
-
-static void
-cls_struct_align_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
- void* userdata __UNUSED__)
-{
- struct cls_struct_align a1, a2;
-
- a1 = *(struct cls_struct_align*)(args[0]);
- a2 = *(struct cls_struct_align*)(args[1]);
-
- *(cls_struct_align*)resp = cls_struct_align_fn(a1, a2);
-}
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- void* args_dbl[3];
- ffi_type* cls_struct_fields[8];
- ffi_type cls_struct_type;
- ffi_type* dbl_arg_types[3];
-
- struct cls_struct_align g_dbl = { 1, 2, 3, 4, 5, 6, 7 };
- struct cls_struct_align f_dbl = { 8, 9, 10, 11, 12, 13, 14 };
- struct cls_struct_align res_dbl;
-
- cls_struct_type.size = 0;
- cls_struct_type.alignment = 0;
- cls_struct_type.type = FFI_TYPE_STRUCT;
- cls_struct_type.elements = cls_struct_fields;
-
- cls_struct_fields[0] = &ffi_type_longdouble;
- cls_struct_fields[1] = &ffi_type_longdouble;
- cls_struct_fields[2] = &ffi_type_longdouble;
- cls_struct_fields[3] = &ffi_type_longdouble;
- cls_struct_fields[4] = &ffi_type_longdouble;
- cls_struct_fields[5] = &ffi_type_double;
- cls_struct_fields[6] = &ffi_type_longdouble;
- cls_struct_fields[7] = NULL;
-
- dbl_arg_types[0] = &cls_struct_type;
- dbl_arg_types[1] = &cls_struct_type;
- dbl_arg_types[2] = NULL;
-
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type,
- dbl_arg_types) == FFI_OK);
-
- args_dbl[0] = &g_dbl;
- args_dbl[1] = &f_dbl;
- args_dbl[2] = NULL;
-
- ffi_call(&cif, FFI_FN(cls_struct_align_fn), &res_dbl, args_dbl);
- /* { dg-output "1 2 3 4 5 6 7 8 9 10 11 12 13 14: 9 11 13 15 17 19 21" } */
- printf("res: %Lg %Lg %Lg %Lg %Lg %g %Lg\n", res_dbl.a, res_dbl.b,
- res_dbl.c, res_dbl.d, res_dbl.e, res_dbl.f, res_dbl.g);
- /* { dg-output "\nres: 9 11 13 15 17 19 21" } */
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_align_gn, NULL, code) == FFI_OK);
-
- res_dbl = ((cls_struct_align(*)(cls_struct_align, cls_struct_align))(code))(g_dbl, f_dbl);
- /* { dg-output "\n1 2 3 4 5 6 7 8 9 10 11 12 13 14: 9 11 13 15 17 19 21" } */
- printf("res: %Lg %Lg %Lg %Lg %Lg %g %Lg\n", res_dbl.a, res_dbl.b,
- res_dbl.c, res_dbl.d, res_dbl.e, res_dbl.f, res_dbl.g);
- /* { dg-output "\nres: 9 11 13 15 17 19 21" } */
-
- exit(0);
-}
-
-
-
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_align_pointer.c b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_align_pointer.c
deleted file mode 100644
index 8fbf36a5c1..0000000000
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_align_pointer.c
+++ /dev/null
@@ -1,95 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Check structure alignment of pointer.
- Limitations: none.
- PR: none.
- Originator: <hos@tamanegi.org> 20031203 */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-typedef struct cls_struct_align {
- unsigned char a;
- void *b;
- unsigned char c;
-} cls_struct_align;
-
-cls_struct_align cls_struct_align_fn(struct cls_struct_align a1,
- struct cls_struct_align a2)
-{
- struct cls_struct_align result;
-
- result.a = a1.a + a2.a;
- result.b = (void *)((uintptr_t)a1.b + (uintptr_t)a2.b);
- result.c = a1.c + a2.c;
-
- printf("%d %" PRIuPTR " %d %d %" PRIuPTR " %d: %d %" PRIuPTR " %d\n",
- a1.a, (uintptr_t)a1.b, a1.c,
- a2.a, (uintptr_t)a2.b, a2.c,
- result.a, (uintptr_t)result.b,
- result.c);
-
- return result;
-}
-
-static void
-cls_struct_align_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
- void* userdata __UNUSED__)
-{
-
- struct cls_struct_align a1, a2;
-
- a1 = *(struct cls_struct_align*)(args[0]);
- a2 = *(struct cls_struct_align*)(args[1]);
-
- *(cls_struct_align*)resp = cls_struct_align_fn(a1, a2);
-}
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- void* args_dbl[5];
- ffi_type* cls_struct_fields[4];
- ffi_type cls_struct_type;
- ffi_type* dbl_arg_types[5];
-
- struct cls_struct_align g_dbl = { 12, (void *)4951, 127 };
- struct cls_struct_align f_dbl = { 1, (void *)9320, 13 };
- struct cls_struct_align res_dbl;
-
- cls_struct_type.size = 0;
- cls_struct_type.alignment = 0;
- cls_struct_type.type = FFI_TYPE_STRUCT;
- cls_struct_type.elements = cls_struct_fields;
-
- cls_struct_fields[0] = &ffi_type_uchar;
- cls_struct_fields[1] = &ffi_type_pointer;
- cls_struct_fields[2] = &ffi_type_uchar;
- cls_struct_fields[3] = NULL;
-
- dbl_arg_types[0] = &cls_struct_type;
- dbl_arg_types[1] = &cls_struct_type;
- dbl_arg_types[2] = NULL;
-
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type,
- dbl_arg_types) == FFI_OK);
-
- args_dbl[0] = &g_dbl;
- args_dbl[1] = &f_dbl;
- args_dbl[2] = NULL;
-
- ffi_call(&cif, FFI_FN(cls_struct_align_fn), &res_dbl, args_dbl);
- /* { dg-output "12 4951 127 1 9320 13: 13 14271 140" } */
- printf("res: %d %" PRIuPTR " %d\n", res_dbl.a, (uintptr_t)res_dbl.b, res_dbl.c);
- /* { dg-output "\nres: 13 14271 140" } */
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_align_gn, NULL, code) == FFI_OK);
-
- res_dbl = ((cls_struct_align(*)(cls_struct_align, cls_struct_align))(code))(g_dbl, f_dbl);
- /* { dg-output "\n12 4951 127 1 9320 13: 13 14271 140" } */
- printf("res: %d %" PRIuPTR " %d\n", res_dbl.a, (uintptr_t)res_dbl.b, res_dbl.c);
- /* { dg-output "\nres: 13 14271 140" } */
-
- exit(0);
-}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_align_sint16.c b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_align_sint16.c
deleted file mode 100644
index 039b874732..0000000000
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_align_sint16.c
+++ /dev/null
@@ -1,91 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Check structure alignment of sint16.
- Limitations: none.
- PR: none.
- Originator: <hos@tamanegi.org> 20031203 */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-typedef struct cls_struct_align {
- unsigned char a;
- signed short b;
- unsigned char c;
-} cls_struct_align;
-
-cls_struct_align cls_struct_align_fn(struct cls_struct_align a1,
- struct cls_struct_align a2)
-{
- struct cls_struct_align result;
-
- result.a = a1.a + a2.a;
- result.b = a1.b + a2.b;
- result.c = a1.c + a2.c;
-
- printf("%d %d %d %d %d %d: %d %d %d\n", a1.a, a1.b, a1.c, a2.a, a2.b, a2.c, result.a, result.b, result.c);
-
- return result;
-}
-
-static void
-cls_struct_align_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
- void* userdata __UNUSED__)
-{
-
- struct cls_struct_align a1, a2;
-
- a1 = *(struct cls_struct_align*)(args[0]);
- a2 = *(struct cls_struct_align*)(args[1]);
-
- *(cls_struct_align*)resp = cls_struct_align_fn(a1, a2);
-}
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- void* args_dbl[5];
- ffi_type* cls_struct_fields[4];
- ffi_type cls_struct_type;
- ffi_type* dbl_arg_types[5];
-
- struct cls_struct_align g_dbl = { 12, 4951, 127 };
- struct cls_struct_align f_dbl = { 1, 9320, 13 };
- struct cls_struct_align res_dbl;
-
- cls_struct_type.size = 0;
- cls_struct_type.alignment = 0;
- cls_struct_type.type = FFI_TYPE_STRUCT;
- cls_struct_type.elements = cls_struct_fields;
-
- cls_struct_fields[0] = &ffi_type_uchar;
- cls_struct_fields[1] = &ffi_type_sshort;
- cls_struct_fields[2] = &ffi_type_uchar;
- cls_struct_fields[3] = NULL;
-
- dbl_arg_types[0] = &cls_struct_type;
- dbl_arg_types[1] = &cls_struct_type;
- dbl_arg_types[2] = NULL;
-
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type,
- dbl_arg_types) == FFI_OK);
-
- args_dbl[0] = &g_dbl;
- args_dbl[1] = &f_dbl;
- args_dbl[2] = NULL;
-
- ffi_call(&cif, FFI_FN(cls_struct_align_fn), &res_dbl, args_dbl);
- /* { dg-output "12 4951 127 1 9320 13: 13 14271 140" } */
- printf("res: %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c);
- /* { dg-output "\nres: 13 14271 140" } */
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_align_gn, NULL, code) == FFI_OK);
-
- res_dbl = ((cls_struct_align(*)(cls_struct_align, cls_struct_align))(code))(g_dbl, f_dbl);
- /* { dg-output "\n12 4951 127 1 9320 13: 13 14271 140" } */
- printf("res: %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c);
- /* { dg-output "\nres: 13 14271 140" } */
-
- exit(0);
-}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_align_sint32.c b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_align_sint32.c
deleted file mode 100644
index c96c6d136d..0000000000
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_align_sint32.c
+++ /dev/null
@@ -1,91 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Check structure alignment of sint32.
- Limitations: none.
- PR: none.
- Originator: <hos@tamanegi.org> 20031203 */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-typedef struct cls_struct_align {
- unsigned char a;
- signed int b;
- unsigned char c;
-} cls_struct_align;
-
-cls_struct_align cls_struct_align_fn(struct cls_struct_align a1,
- struct cls_struct_align a2)
-{
- struct cls_struct_align result;
-
- result.a = a1.a + a2.a;
- result.b = a1.b + a2.b;
- result.c = a1.c + a2.c;
-
- printf("%d %d %d %d %d %d: %d %d %d\n", a1.a, a1.b, a1.c, a2.a, a2.b, a2.c, result.a, result.b, result.c);
-
- return result;
-}
-
-static void
-cls_struct_align_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
- void* userdata __UNUSED__)
-{
-
- struct cls_struct_align a1, a2;
-
- a1 = *(struct cls_struct_align*)(args[0]);
- a2 = *(struct cls_struct_align*)(args[1]);
-
- *(cls_struct_align*)resp = cls_struct_align_fn(a1, a2);
-}
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- void* args_dbl[5];
- ffi_type* cls_struct_fields[4];
- ffi_type cls_struct_type;
- ffi_type* dbl_arg_types[5];
-
- struct cls_struct_align g_dbl = { 12, 4951, 127 };
- struct cls_struct_align f_dbl = { 1, 9320, 13 };
- struct cls_struct_align res_dbl;
-
- cls_struct_type.size = 0;
- cls_struct_type.alignment = 0;
- cls_struct_type.type = FFI_TYPE_STRUCT;
- cls_struct_type.elements = cls_struct_fields;
-
- cls_struct_fields[0] = &ffi_type_uchar;
- cls_struct_fields[1] = &ffi_type_sint;
- cls_struct_fields[2] = &ffi_type_uchar;
- cls_struct_fields[3] = NULL;
-
- dbl_arg_types[0] = &cls_struct_type;
- dbl_arg_types[1] = &cls_struct_type;
- dbl_arg_types[2] = NULL;
-
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type,
- dbl_arg_types) == FFI_OK);
-
- args_dbl[0] = &g_dbl;
- args_dbl[1] = &f_dbl;
- args_dbl[2] = NULL;
-
- ffi_call(&cif, FFI_FN(cls_struct_align_fn), &res_dbl, args_dbl);
- /* { dg-output "12 4951 127 1 9320 13: 13 14271 140" } */
- printf("res: %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c);
- /* { dg-output "\nres: 13 14271 140" } */
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_align_gn, NULL, code) == FFI_OK);
-
- res_dbl = ((cls_struct_align(*)(cls_struct_align, cls_struct_align))(code))(g_dbl, f_dbl);
- /* { dg-output "\n12 4951 127 1 9320 13: 13 14271 140" } */
- printf("res: %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c);
- /* { dg-output "\nres: 13 14271 140" } */
-
- exit(0);
-}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_align_sint64.c b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_align_sint64.c
deleted file mode 100644
index 9aa7bdddff..0000000000
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_align_sint64.c
+++ /dev/null
@@ -1,92 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Check structure alignment of sint64.
- Limitations: none.
- PR: none.
- Originator: <hos@tamanegi.org> 20031203 */
-
-/* { dg-do run } */
-/* { dg-options "-Wno-format" { target alpha*-dec-osf* } } */
-#include "ffitest.h"
-
-typedef struct cls_struct_align {
- unsigned char a;
- signed long long b;
- unsigned char c;
-} cls_struct_align;
-
-cls_struct_align cls_struct_align_fn(struct cls_struct_align a1,
- struct cls_struct_align a2)
-{
- struct cls_struct_align result;
-
- result.a = a1.a + a2.a;
- result.b = a1.b + a2.b;
- result.c = a1.c + a2.c;
-
- printf("%d %" PRIdLL " %d %d %" PRIdLL " %d: %d %" PRIdLL " %d\n", a1.a, a1.b, a1.c, a2.a, a2.b, a2.c, result.a, result.b, result.c);
-
- return result;
-}
-
-static void
-cls_struct_align_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
- void* userdata __UNUSED__)
-{
-
- struct cls_struct_align a1, a2;
-
- a1 = *(struct cls_struct_align*)(args[0]);
- a2 = *(struct cls_struct_align*)(args[1]);
-
- *(cls_struct_align*)resp = cls_struct_align_fn(a1, a2);
-}
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- void* args_dbl[5];
- ffi_type* cls_struct_fields[4];
- ffi_type cls_struct_type;
- ffi_type* dbl_arg_types[5];
-
- struct cls_struct_align g_dbl = { 12, 4951, 127 };
- struct cls_struct_align f_dbl = { 1, 9320, 13 };
- struct cls_struct_align res_dbl;
-
- cls_struct_type.size = 0;
- cls_struct_type.alignment = 0;
- cls_struct_type.type = FFI_TYPE_STRUCT;
- cls_struct_type.elements = cls_struct_fields;
-
- cls_struct_fields[0] = &ffi_type_uchar;
- cls_struct_fields[1] = &ffi_type_sint64;
- cls_struct_fields[2] = &ffi_type_uchar;
- cls_struct_fields[3] = NULL;
-
- dbl_arg_types[0] = &cls_struct_type;
- dbl_arg_types[1] = &cls_struct_type;
- dbl_arg_types[2] = NULL;
-
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type,
- dbl_arg_types) == FFI_OK);
-
- args_dbl[0] = &g_dbl;
- args_dbl[1] = &f_dbl;
- args_dbl[2] = NULL;
-
- ffi_call(&cif, FFI_FN(cls_struct_align_fn), &res_dbl, args_dbl);
- /* { dg-output "12 4951 127 1 9320 13: 13 14271 140" } */
- printf("res: %d %" PRIdLL " %d\n", res_dbl.a, res_dbl.b, res_dbl.c);
- /* { dg-output "\nres: 13 14271 140" } */
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_align_gn, NULL, code) == FFI_OK);
-
- res_dbl = ((cls_struct_align(*)(cls_struct_align, cls_struct_align))(code))(g_dbl, f_dbl);
- /* { dg-output "\n12 4951 127 1 9320 13: 13 14271 140" } */
- printf("res: %d %" PRIdLL " %d\n", res_dbl.a, res_dbl.b, res_dbl.c);
- /* { dg-output "\nres: 13 14271 140" } */
-
- exit(0);
-}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_align_uint16.c b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_align_uint16.c
deleted file mode 100644
index 97620b79d1..0000000000
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_align_uint16.c
+++ /dev/null
@@ -1,91 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Check structure alignment of uint16.
- Limitations: none.
- PR: none.
- Originator: <hos@tamanegi.org> 20031203 */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-typedef struct cls_struct_align {
- unsigned char a;
- unsigned short b;
- unsigned char c;
-} cls_struct_align;
-
-cls_struct_align cls_struct_align_fn(struct cls_struct_align a1,
- struct cls_struct_align a2)
-{
- struct cls_struct_align result;
-
- result.a = a1.a + a2.a;
- result.b = a1.b + a2.b;
- result.c = a1.c + a2.c;
-
- printf("%d %d %d %d %d %d: %d %d %d\n", a1.a, a1.b, a1.c, a2.a, a2.b, a2.c, result.a, result.b, result.c);
-
- return result;
-}
-
-static void
-cls_struct_align_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
- void* userdata __UNUSED__)
-{
-
- struct cls_struct_align a1, a2;
-
- a1 = *(struct cls_struct_align*)(args[0]);
- a2 = *(struct cls_struct_align*)(args[1]);
-
- *(cls_struct_align*)resp = cls_struct_align_fn(a1, a2);
-}
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- void* args_dbl[5];
- ffi_type* cls_struct_fields[4];
- ffi_type cls_struct_type;
- ffi_type* dbl_arg_types[5];
-
- struct cls_struct_align g_dbl = { 12, 4951, 127 };
- struct cls_struct_align f_dbl = { 1, 9320, 13 };
- struct cls_struct_align res_dbl;
-
- cls_struct_type.size = 0;
- cls_struct_type.alignment = 0;
- cls_struct_type.type = FFI_TYPE_STRUCT;
- cls_struct_type.elements = cls_struct_fields;
-
- cls_struct_fields[0] = &ffi_type_uchar;
- cls_struct_fields[1] = &ffi_type_ushort;
- cls_struct_fields[2] = &ffi_type_uchar;
- cls_struct_fields[3] = NULL;
-
- dbl_arg_types[0] = &cls_struct_type;
- dbl_arg_types[1] = &cls_struct_type;
- dbl_arg_types[2] = NULL;
-
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type,
- dbl_arg_types) == FFI_OK);
-
- args_dbl[0] = &g_dbl;
- args_dbl[1] = &f_dbl;
- args_dbl[2] = NULL;
-
- ffi_call(&cif, FFI_FN(cls_struct_align_fn), &res_dbl, args_dbl);
- /* { dg-output "12 4951 127 1 9320 13: 13 14271 140" } */
- printf("res: %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c);
- /* { dg-output "\nres: 13 14271 140" } */
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_align_gn, NULL, code) == FFI_OK);
-
- res_dbl = ((cls_struct_align(*)(cls_struct_align, cls_struct_align))(code))(g_dbl, f_dbl);
- /* { dg-output "\n12 4951 127 1 9320 13: 13 14271 140" } */
- printf("res: %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c);
- /* { dg-output "\nres: 13 14271 140" } */
-
- exit(0);
-}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_align_uint32.c b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_align_uint32.c
deleted file mode 100644
index 5766fadf0d..0000000000
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_align_uint32.c
+++ /dev/null
@@ -1,91 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Check structure alignment of uint32.
- Limitations: none.
- PR: none.
- Originator: <hos@tamanegi.org> 20031203 */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-typedef struct cls_struct_align {
- unsigned char a;
- unsigned int b;
- unsigned char c;
-} cls_struct_align;
-
-cls_struct_align cls_struct_align_fn(struct cls_struct_align a1,
- struct cls_struct_align a2)
-{
- struct cls_struct_align result;
-
- result.a = a1.a + a2.a;
- result.b = a1.b + a2.b;
- result.c = a1.c + a2.c;
-
- printf("%d %d %d %d %d %d: %d %d %d\n", a1.a, a1.b, a1.c, a2.a, a2.b, a2.c, result.a, result.b, result.c);
-
- return result;
-}
-
-static void
-cls_struct_align_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
- void* userdata __UNUSED__)
-{
-
- struct cls_struct_align a1, a2;
-
- a1 = *(struct cls_struct_align*)(args[0]);
- a2 = *(struct cls_struct_align*)(args[1]);
-
- *(cls_struct_align*)resp = cls_struct_align_fn(a1, a2);
-}
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- void* args_dbl[5];
- ffi_type* cls_struct_fields[4];
- ffi_type cls_struct_type;
- ffi_type* dbl_arg_types[5];
-
- struct cls_struct_align g_dbl = { 12, 4951, 127 };
- struct cls_struct_align f_dbl = { 1, 9320, 13 };
- struct cls_struct_align res_dbl;
-
- cls_struct_type.size = 0;
- cls_struct_type.alignment = 0;
- cls_struct_type.type = FFI_TYPE_STRUCT;
- cls_struct_type.elements = cls_struct_fields;
-
- cls_struct_fields[0] = &ffi_type_uchar;
- cls_struct_fields[1] = &ffi_type_uint;
- cls_struct_fields[2] = &ffi_type_uchar;
- cls_struct_fields[3] = NULL;
-
- dbl_arg_types[0] = &cls_struct_type;
- dbl_arg_types[1] = &cls_struct_type;
- dbl_arg_types[2] = NULL;
-
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type,
- dbl_arg_types) == FFI_OK);
-
- args_dbl[0] = &g_dbl;
- args_dbl[1] = &f_dbl;
- args_dbl[2] = NULL;
-
- ffi_call(&cif, FFI_FN(cls_struct_align_fn), &res_dbl, args_dbl);
- /* { dg-output "12 4951 127 1 9320 13: 13 14271 140" } */
- printf("res: %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c);
- /* { dg-output "\nres: 13 14271 140" } */
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_align_gn, NULL, code) == FFI_OK);
-
- res_dbl = ((cls_struct_align(*)(cls_struct_align, cls_struct_align))(code))(g_dbl, f_dbl);
- /* { dg-output "\n12 4951 127 1 9320 13: 13 14271 140" } */
- printf("res: %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c);
- /* { dg-output "\nres: 13 14271 140" } */
-
- exit(0);
-}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_align_uint64.c b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_align_uint64.c
deleted file mode 100644
index a52cb8939c..0000000000
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_align_uint64.c
+++ /dev/null
@@ -1,93 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Check structure alignment of uint64.
- Limitations: none.
- PR: none.
- Originator: <hos@tamanegi.org> 20031203 */
-
-
-/* { dg-do run } */
-/* { dg-options "-Wno-format" { target alpha*-dec-osf* } } */
-#include "ffitest.h"
-
-typedef struct cls_struct_align {
- unsigned char a;
- unsigned long long b;
- unsigned char c;
-} cls_struct_align;
-
-cls_struct_align cls_struct_align_fn(struct cls_struct_align a1,
- struct cls_struct_align a2)
-{
- struct cls_struct_align result;
-
- result.a = a1.a + a2.a;
- result.b = a1.b + a2.b;
- result.c = a1.c + a2.c;
-
- printf("%d %" PRIdLL " %d %d %" PRIdLL " %d: %d %" PRIdLL " %d\n", a1.a, a1.b, a1.c, a2.a, a2.b, a2.c, result.a, result.b, result.c);
-
- return result;
-}
-
-static void
-cls_struct_align_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
- void* userdata __UNUSED__)
-{
-
- struct cls_struct_align a1, a2;
-
- a1 = *(struct cls_struct_align*)(args[0]);
- a2 = *(struct cls_struct_align*)(args[1]);
-
- *(cls_struct_align*)resp = cls_struct_align_fn(a1, a2);
-}
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- void* args_dbl[5];
- ffi_type* cls_struct_fields[4];
- ffi_type cls_struct_type;
- ffi_type* dbl_arg_types[5];
-
- struct cls_struct_align g_dbl = { 12, 4951, 127 };
- struct cls_struct_align f_dbl = { 1, 9320, 13 };
- struct cls_struct_align res_dbl;
-
- cls_struct_type.size = 0;
- cls_struct_type.alignment = 0;
- cls_struct_type.type = FFI_TYPE_STRUCT;
- cls_struct_type.elements = cls_struct_fields;
-
- cls_struct_fields[0] = &ffi_type_uchar;
- cls_struct_fields[1] = &ffi_type_uint64;
- cls_struct_fields[2] = &ffi_type_uchar;
- cls_struct_fields[3] = NULL;
-
- dbl_arg_types[0] = &cls_struct_type;
- dbl_arg_types[1] = &cls_struct_type;
- dbl_arg_types[2] = NULL;
-
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type,
- dbl_arg_types) == FFI_OK);
-
- args_dbl[0] = &g_dbl;
- args_dbl[1] = &f_dbl;
- args_dbl[2] = NULL;
-
- ffi_call(&cif, FFI_FN(cls_struct_align_fn), &res_dbl, args_dbl);
- /* { dg-output "12 4951 127 1 9320 13: 13 14271 140" } */
- printf("res: %d %" PRIdLL " %d\n", res_dbl.a, res_dbl.b, res_dbl.c);
- /* { dg-output "\nres: 13 14271 140" } */
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_align_gn, NULL, code) == FFI_OK);
-
- res_dbl = ((cls_struct_align(*)(cls_struct_align, cls_struct_align))(code))(g_dbl, f_dbl);
- /* { dg-output "\n12 4951 127 1 9320 13: 13 14271 140" } */
- printf("res: %d %" PRIdLL " %d\n", res_dbl.a, res_dbl.b, res_dbl.c);
- /* { dg-output "\nres: 13 14271 140" } */
-
- exit(0);
-}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_dbls_struct.c b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_dbls_struct.c
deleted file mode 100644
index d6637911e5..0000000000
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_dbls_struct.c
+++ /dev/null
@@ -1,66 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Check double arguments in structs.
- Limitations: none.
- PR: none.
- Originator: Blake Chaffin 6/23/2007 */
-
-/* { dg-do run } */
-
-#include "ffitest.h"
-
-typedef struct Dbls {
- double x;
- double y;
-} Dbls;
-
-void
-closure_test_fn(Dbls p)
-{
- printf("%.1f %.1f\n", p.x, p.y);
-}
-
-void
-closure_test_gn(ffi_cif* cif __UNUSED__, void* resp __UNUSED__,
- void** args, void* userdata __UNUSED__)
-{
- closure_test_fn(*(Dbls*)args[0]);
-}
-
-int main(int argc __UNUSED__, char** argv __UNUSED__)
-{
- ffi_cif cif;
-
- void *code;
- ffi_closure* pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- ffi_type* cl_arg_types[1];
-
- ffi_type ts1_type;
- ffi_type* ts1_type_elements[4];
-
- Dbls arg = { 1.0, 2.0 };
-
- ts1_type.size = 0;
- ts1_type.alignment = 0;
- ts1_type.type = FFI_TYPE_STRUCT;
- ts1_type.elements = ts1_type_elements;
-
- ts1_type_elements[0] = &ffi_type_double;
- ts1_type_elements[1] = &ffi_type_double;
- ts1_type_elements[2] = NULL;
-
- cl_arg_types[0] = &ts1_type;
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1,
- &ffi_type_void, cl_arg_types) == FFI_OK);
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, closure_test_gn, NULL, code) == FFI_OK);
-
- ((void*(*)(Dbls))(code))(arg);
- /* { dg-output "1.0 2.0\n" } */
-
- closure_test_fn(arg);
- /* { dg-output "1.0 2.0\n" } */
-
- return 0;
-}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_double.c b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_double.c
deleted file mode 100644
index 84ad4cb7d9..0000000000
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_double.c
+++ /dev/null
@@ -1,43 +0,0 @@
-/* Area: closure_call
- Purpose: Check return value double.
- Limitations: none.
- PR: none.
- Originator: <andreast@gcc.gnu.org> 20030828 */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-static void cls_ret_double_fn(ffi_cif* cif __UNUSED__, void* resp, void** args,
- void* userdata __UNUSED__)
- {
- *(double *)resp = *(double *)args[0];
-
- printf("%f: %f\n",*(double *)args[0],
- *(double *)resp);
- }
-typedef double (*cls_ret_double)(double);
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- ffi_type * cl_arg_types[2];
- double res;
-
- cl_arg_types[0] = &ffi_type_double;
- cl_arg_types[1] = NULL;
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1,
- &ffi_type_double, cl_arg_types) == FFI_OK);
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, cls_ret_double_fn, NULL, code) == FFI_OK);
-
- res = (*((cls_ret_double)code))(21474.789);
- /* { dg-output "21474.789000: 21474.789000" } */
- printf("res: %.6f\n", res);
- /* { dg-output "\nres: 21474.789000" } */
-
- exit(0);
-}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_double_va.c b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_double_va.c
deleted file mode 100644
index e077f92b86..0000000000
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_double_va.c
+++ /dev/null
@@ -1,61 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Test doubles passed in variable argument lists.
- Limitations: none.
- PR: none.
- Originator: Blake Chaffin 6/6/2007 */
-
-/* { dg-do run { xfail strongarm*-*-* xscale*-*-* } } */
-/* { dg-output "" { xfail avr32*-*-* } } */
-/* { dg-output "" { xfail mips-sgi-irix6* } } PR libffi/46660 */
-
-#include "ffitest.h"
-
-static void
-cls_double_va_fn(ffi_cif* cif __UNUSED__, void* resp,
- void** args, void* userdata __UNUSED__)
-{
- char* format = *(char**)args[0];
- double doubleValue = *(double*)args[1];
-
- *(ffi_arg*)resp = printf(format, doubleValue);
-}
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- void* args[3];
- ffi_type* arg_types[3];
-
- char* format = "%.1f\n";
- double doubleArg = 7;
- ffi_arg res = 0;
-
- arg_types[0] = &ffi_type_pointer;
- arg_types[1] = &ffi_type_double;
- arg_types[2] = NULL;
-
- /* This printf call is variadic */
- CHECK(ffi_prep_cif_var(&cif, FFI_DEFAULT_ABI, 1, 2, &ffi_type_sint,
- arg_types) == FFI_OK);
-
- args[0] = &format;
- args[1] = &doubleArg;
- args[2] = NULL;
-
- ffi_call(&cif, FFI_FN(printf), &res, args);
- /* { dg-output "7.0" } */
- printf("res: %d\n", (int) res);
- /* { dg-output "\nres: 4" } */
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, cls_double_va_fn, NULL,
- code) == FFI_OK);
-
- res = ((int(*)(char*, ...))(code))(format, doubleArg);
- /* { dg-output "\n7.0" } */
- printf("res: %d\n", (int) res);
- /* { dg-output "\nres: 4" } */
-
- exit(0);
-}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_float.c b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_float.c
deleted file mode 100644
index 0090fed906..0000000000
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_float.c
+++ /dev/null
@@ -1,42 +0,0 @@
-/* Area: closure_call
- Purpose: Check return value float.
- Limitations: none.
- PR: none.
- Originator: <andreast@gcc.gnu.org> 20030828 */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-static void cls_ret_float_fn(ffi_cif* cif __UNUSED__, void* resp, void** args,
- void* userdata __UNUSED__)
- {
- *(float *)resp = *(float *)args[0];
-
- printf("%g: %g\n",*(float *)args[0],
- *(float *)resp);
- }
-
-typedef float (*cls_ret_float)(float);
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- ffi_type * cl_arg_types[2];
- float res;
-
- cl_arg_types[0] = &ffi_type_float;
- cl_arg_types[1] = NULL;
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1,
- &ffi_type_float, cl_arg_types) == FFI_OK);
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, cls_ret_float_fn, NULL, code) == FFI_OK);
- res = ((((cls_ret_float)code)(-2122.12)));
- /* { dg-output "\\-2122.12: \\-2122.12" } */
- printf("res: %.6f\n", res);
- /* { dg-output "\nres: \-2122.120117" } */
- exit(0);
-}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_longdouble.c b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_longdouble.c
deleted file mode 100644
index 5dc9ac7685..0000000000
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_longdouble.c
+++ /dev/null
@@ -1,107 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Check long double arguments.
- Limitations: none.
- PR: none.
- Originator: Blake Chaffin */
-
-/* { dg-excess-errors "no long double format" { xfail x86_64-*-mingw* x86_64-*-cygwin* } } */
-/* This test is known to PASS on armv7l-unknown-linux-gnueabihf, so I have
- remove the xfail for arm*-*-* below, until we know more. */
-/* { dg-do run { xfail strongarm*-*-* xscale*-*-* } } */
-/* { dg-options -mlong-double-128 { target powerpc64*-*-linux* } } */
-/* { dg-output "" { xfail x86_64-*-mingw* x86_64-*-cygwin* } } */
-
-#include "ffitest.h"
-
-long double cls_ldouble_fn(
- long double a1,
- long double a2,
- long double a3,
- long double a4,
- long double a5,
- long double a6,
- long double a7,
- long double a8)
-{
- long double r = a1 + a2 + a3 + a4 + a5 + a6 + a7 + a8;
-
- printf("%Lg %Lg %Lg %Lg %Lg %Lg %Lg %Lg: %Lg\n",
- a1, a2, a3, a4, a5, a6, a7, a8, r);
-
- return r;
-}
-
-static void
-cls_ldouble_gn(ffi_cif* cif __UNUSED__, void* resp,
- void** args, void* userdata __UNUSED__)
-{
- long double a1 = *(long double*)args[0];
- long double a2 = *(long double*)args[1];
- long double a3 = *(long double*)args[2];
- long double a4 = *(long double*)args[3];
- long double a5 = *(long double*)args[4];
- long double a6 = *(long double*)args[5];
- long double a7 = *(long double*)args[6];
- long double a8 = *(long double*)args[7];
-
- *(long double*)resp = cls_ldouble_fn(
- a1, a2, a3, a4, a5, a6, a7, a8);
-}
-
-int main(void)
-{
- ffi_cif cif;
- void* code;
- ffi_closure* pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- void* args[9];
- ffi_type* arg_types[9];
- long double res = 0;
-
- long double arg1 = 1;
- long double arg2 = 2;
- long double arg3 = 3;
- long double arg4 = 4;
- long double arg5 = 5;
- long double arg6 = 6;
- long double arg7 = 7;
- long double arg8 = 8;
-
- arg_types[0] = &ffi_type_longdouble;
- arg_types[1] = &ffi_type_longdouble;
- arg_types[2] = &ffi_type_longdouble;
- arg_types[3] = &ffi_type_longdouble;
- arg_types[4] = &ffi_type_longdouble;
- arg_types[5] = &ffi_type_longdouble;
- arg_types[6] = &ffi_type_longdouble;
- arg_types[7] = &ffi_type_longdouble;
- arg_types[8] = NULL;
-
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 8, &ffi_type_longdouble,
- arg_types) == FFI_OK);
-
- args[0] = &arg1;
- args[1] = &arg2;
- args[2] = &arg3;
- args[3] = &arg4;
- args[4] = &arg5;
- args[5] = &arg6;
- args[6] = &arg7;
- args[7] = &arg8;
- args[8] = NULL;
-
- ffi_call(&cif, FFI_FN(cls_ldouble_fn), &res, args);
- /* { dg-output "1 2 3 4 5 6 7 8: 36" } */
- printf("res: %Lg\n", res);
- /* { dg-output "\nres: 36" } */
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, cls_ldouble_gn, NULL, code) == FFI_OK);
-
- res = ((long double(*)(long double, long double, long double, long double,
- long double, long double, long double, long double))(code))(arg1, arg2,
- arg3, arg4, arg5, arg6, arg7, arg8);
- /* { dg-output "\n1 2 3 4 5 6 7 8: 36" } */
- printf("res: %Lg\n", res);
- /* { dg-output "\nres: 36" } */
-
- return 0;
-}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_longdouble_va.c b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_longdouble_va.c
deleted file mode 100644
index 39b438b289..0000000000
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_longdouble_va.c
+++ /dev/null
@@ -1,61 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Test long doubles passed in variable argument lists.
- Limitations: none.
- PR: none.
- Originator: Blake Chaffin 6/6/2007 */
-
-/* { dg-do run { xfail strongarm*-*-* xscale*-*-* } } */
-/* { dg-output "" { xfail avr32*-*-* x86_64-*-mingw* } } */
-/* { dg-output "" { xfail mips-sgi-irix6* } } PR libffi/46660 */
-
-#include "ffitest.h"
-
-static void
-cls_longdouble_va_fn(ffi_cif* cif __UNUSED__, void* resp,
- void** args, void* userdata __UNUSED__)
-{
- char* format = *(char**)args[0];
- long double ldValue = *(long double*)args[1];
-
- *(ffi_arg*)resp = printf(format, ldValue);
-}
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- void* args[3];
- ffi_type* arg_types[3];
-
- char* format = "%.1Lf\n";
- long double ldArg = 7;
- ffi_arg res = 0;
-
- arg_types[0] = &ffi_type_pointer;
- arg_types[1] = &ffi_type_longdouble;
- arg_types[2] = NULL;
-
- /* This printf call is variadic */
- CHECK(ffi_prep_cif_var(&cif, FFI_DEFAULT_ABI, 1, 2, &ffi_type_sint,
- arg_types) == FFI_OK);
-
- args[0] = &format;
- args[1] = &ldArg;
- args[2] = NULL;
-
- ffi_call(&cif, FFI_FN(printf), &res, args);
- /* { dg-output "7.0" } */
- printf("res: %d\n", (int) res);
- /* { dg-output "\nres: 4" } */
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, cls_longdouble_va_fn, NULL,
- code) == FFI_OK);
-
- res = ((int(*)(char*, ...))(code))(format, ldArg);
- /* { dg-output "\n7.0" } */
- printf("res: %d\n", (int) res);
- /* { dg-output "\nres: 4" } */
-
- exit(0);
-}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_multi_schar.c b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_multi_schar.c
deleted file mode 100644
index 71df7b6516..0000000000
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_multi_schar.c
+++ /dev/null
@@ -1,74 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Check passing of multiple signed char values.
- Limitations: none.
- PR: PR13221.
- Originator: <hos@tamanegi.org> 20031129 */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-signed char test_func_fn(signed char a1, signed char a2)
-{
- signed char result;
-
- result = a1 + a2;
-
- printf("%d %d: %d\n", a1, a2, result);
-
- return result;
-
-}
-
-static void test_func_gn(ffi_cif *cif __UNUSED__, void *rval, void **avals,
- void *data __UNUSED__)
-{
- signed char a1, a2;
-
- a1 = *(signed char *)avals[0];
- a2 = *(signed char *)avals[1];
-
- *(ffi_arg *)rval = test_func_fn(a1, a2);
-
-}
-
-typedef signed char (*test_type)(signed char, signed char);
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- void * args_dbl[3];
- ffi_type * cl_arg_types[3];
- ffi_arg res_call;
- signed char a, b, res_closure;
-
- a = 2;
- b = 125;
-
- args_dbl[0] = &a;
- args_dbl[1] = &b;
- args_dbl[2] = NULL;
-
- cl_arg_types[0] = &ffi_type_schar;
- cl_arg_types[1] = &ffi_type_schar;
- cl_arg_types[2] = NULL;
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2,
- &ffi_type_schar, cl_arg_types) == FFI_OK);
-
- ffi_call(&cif, FFI_FN(test_func_fn), &res_call, args_dbl);
- /* { dg-output "2 125: 127" } */
- printf("res: %d\n", (signed char)res_call);
- /* { dg-output "\nres: 127" } */
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, test_func_gn, NULL, code) == FFI_OK);
-
- res_closure = (*((test_type)code))(2, 125);
- /* { dg-output "\n2 125: 127" } */
- printf("res: %d\n", res_closure);
- /* { dg-output "\nres: 127" } */
-
- exit(0);
-}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_multi_sshort.c b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_multi_sshort.c
deleted file mode 100644
index 4c39153266..0000000000
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_multi_sshort.c
+++ /dev/null
@@ -1,74 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Check passing of multiple signed short values.
- Limitations: none.
- PR: PR13221.
- Originator: <andreast@gcc.gnu.org> 20031129 */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-signed short test_func_fn(signed short a1, signed short a2)
-{
- signed short result;
-
- result = a1 + a2;
-
- printf("%d %d: %d\n", a1, a2, result);
-
- return result;
-
-}
-
-static void test_func_gn(ffi_cif *cif __UNUSED__, void *rval, void **avals,
- void *data __UNUSED__)
-{
- signed short a1, a2;
-
- a1 = *(signed short *)avals[0];
- a2 = *(signed short *)avals[1];
-
- *(ffi_arg *)rval = test_func_fn(a1, a2);
-
-}
-
-typedef signed short (*test_type)(signed short, signed short);
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- void * args_dbl[3];
- ffi_type * cl_arg_types[3];
- ffi_arg res_call;
- unsigned short a, b, res_closure;
-
- a = 2;
- b = 32765;
-
- args_dbl[0] = &a;
- args_dbl[1] = &b;
- args_dbl[2] = NULL;
-
- cl_arg_types[0] = &ffi_type_sshort;
- cl_arg_types[1] = &ffi_type_sshort;
- cl_arg_types[2] = NULL;
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2,
- &ffi_type_sshort, cl_arg_types) == FFI_OK);
-
- ffi_call(&cif, FFI_FN(test_func_fn), &res_call, args_dbl);
- /* { dg-output "2 32765: 32767" } */
- printf("res: %d\n", (unsigned short)res_call);
- /* { dg-output "\nres: 32767" } */
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, test_func_gn, NULL, code) == FFI_OK);
-
- res_closure = (*((test_type)code))(2, 32765);
- /* { dg-output "\n2 32765: 32767" } */
- printf("res: %d\n", res_closure);
- /* { dg-output "\nres: 32767" } */
-
- exit(0);
-}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_multi_sshortchar.c b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_multi_sshortchar.c
deleted file mode 100644
index 1c3aeb5a66..0000000000
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_multi_sshortchar.c
+++ /dev/null
@@ -1,86 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Check passing of multiple signed short/char values.
- Limitations: none.
- PR: PR13221.
- Originator: <andreast@gcc.gnu.org> 20031129 */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-signed short test_func_fn(signed char a1, signed short a2,
- signed char a3, signed short a4)
-{
- signed short result;
-
- result = a1 + a2 + a3 + a4;
-
- printf("%d %d %d %d: %d\n", a1, a2, a3, a4, result);
-
- return result;
-
-}
-
-static void test_func_gn(ffi_cif *cif __UNUSED__, void *rval, void **avals,
- void *data __UNUSED__)
-{
- signed char a1, a3;
- signed short a2, a4;
-
- a1 = *(signed char *)avals[0];
- a2 = *(signed short *)avals[1];
- a3 = *(signed char *)avals[2];
- a4 = *(signed short *)avals[3];
-
- *(ffi_arg *)rval = test_func_fn(a1, a2, a3, a4);
-
-}
-
-typedef signed short (*test_type)(signed char, signed short,
- signed char, signed short);
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- void * args_dbl[5];
- ffi_type * cl_arg_types[5];
- ffi_arg res_call;
- signed char a, c;
- signed short b, d, res_closure;
-
- a = 1;
- b = 32765;
- c = 127;
- d = -128;
-
- args_dbl[0] = &a;
- args_dbl[1] = &b;
- args_dbl[2] = &c;
- args_dbl[3] = &d;
- args_dbl[4] = NULL;
-
- cl_arg_types[0] = &ffi_type_schar;
- cl_arg_types[1] = &ffi_type_sshort;
- cl_arg_types[2] = &ffi_type_schar;
- cl_arg_types[3] = &ffi_type_sshort;
- cl_arg_types[4] = NULL;
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 4,
- &ffi_type_sshort, cl_arg_types) == FFI_OK);
-
- ffi_call(&cif, FFI_FN(test_func_fn), &res_call, args_dbl);
- /* { dg-output "1 32765 127 -128: 32765" } */
- printf("res: %d\n", (signed short)res_call);
- /* { dg-output "\nres: 32765" } */
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, test_func_gn, NULL, code) == FFI_OK);
-
- res_closure = (*((test_type)code))(1, 32765, 127, -128);
- /* { dg-output "\n1 32765 127 -128: 32765" } */
- printf("res: %d\n", res_closure);
- /* { dg-output "\nres: 32765" } */
-
- exit(0);
-}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_multi_uchar.c b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_multi_uchar.c
deleted file mode 100644
index 009c02c72b..0000000000
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_multi_uchar.c
+++ /dev/null
@@ -1,91 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Check passing of multiple unsigned char values.
- Limitations: none.
- PR: PR13221.
- Originator: <andreast@gcc.gnu.org> 20031129 */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-unsigned char test_func_fn(unsigned char a1, unsigned char a2,
- unsigned char a3, unsigned char a4)
-{
- unsigned char result;
-
- result = a1 + a2 + a3 + a4;
-
- printf("%d %d %d %d: %d\n", a1, a2, a3, a4, result);
-
- return result;
-
-}
-
-static void test_func_gn(ffi_cif *cif __UNUSED__, void *rval, void **avals,
- void *data __UNUSED__)
-{
- unsigned char a1, a2, a3, a4;
-
- a1 = *(unsigned char *)avals[0];
- a2 = *(unsigned char *)avals[1];
- a3 = *(unsigned char *)avals[2];
- a4 = *(unsigned char *)avals[3];
-
- *(ffi_arg *)rval = test_func_fn(a1, a2, a3, a4);
-
-}
-
-typedef unsigned char (*test_type)(unsigned char, unsigned char,
- unsigned char, unsigned char);
-
-void test_func(ffi_cif *cif __UNUSED__, void *rval __UNUSED__, void **avals,
- void *data __UNUSED__)
-{
- printf("%d %d %d %d\n", *(unsigned char *)avals[0],
- *(unsigned char *)avals[1], *(unsigned char *)avals[2],
- *(unsigned char *)avals[3]);
-}
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- void * args_dbl[5];
- ffi_type * cl_arg_types[5];
- ffi_arg res_call;
- unsigned char a, b, c, d, res_closure;
-
- a = 1;
- b = 2;
- c = 127;
- d = 125;
-
- args_dbl[0] = &a;
- args_dbl[1] = &b;
- args_dbl[2] = &c;
- args_dbl[3] = &d;
- args_dbl[4] = NULL;
-
- cl_arg_types[0] = &ffi_type_uchar;
- cl_arg_types[1] = &ffi_type_uchar;
- cl_arg_types[2] = &ffi_type_uchar;
- cl_arg_types[3] = &ffi_type_uchar;
- cl_arg_types[4] = NULL;
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 4,
- &ffi_type_uchar, cl_arg_types) == FFI_OK);
-
- ffi_call(&cif, FFI_FN(test_func_fn), &res_call, args_dbl);
- /* { dg-output "1 2 127 125: 255" } */
- printf("res: %d\n", (unsigned char)res_call);
- /* { dg-output "\nres: 255" } */
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, test_func_gn, NULL, code) == FFI_OK);
-
- res_closure = (*((test_type)code))(1, 2, 127, 125);
- /* { dg-output "\n1 2 127 125: 255" } */
- printf("res: %d\n", res_closure);
- /* { dg-output "\nres: 255" } */
-
- exit(0);
-}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_multi_ushort.c b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_multi_ushort.c
deleted file mode 100644
index dd10ca7346..0000000000
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_multi_ushort.c
+++ /dev/null
@@ -1,74 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Check passing of multiple unsigned short values.
- Limitations: none.
- PR: PR13221.
- Originator: <andreast@gcc.gnu.org> 20031129 */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-unsigned short test_func_fn(unsigned short a1, unsigned short a2)
-{
- unsigned short result;
-
- result = a1 + a2;
-
- printf("%d %d: %d\n", a1, a2, result);
-
- return result;
-
-}
-
-static void test_func_gn(ffi_cif *cif __UNUSED__, void *rval, void **avals,
- void *data __UNUSED__)
-{
- unsigned short a1, a2;
-
- a1 = *(unsigned short *)avals[0];
- a2 = *(unsigned short *)avals[1];
-
- *(ffi_arg *)rval = test_func_fn(a1, a2);
-
-}
-
-typedef unsigned short (*test_type)(unsigned short, unsigned short);
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- void * args_dbl[3];
- ffi_type * cl_arg_types[3];
- ffi_arg res_call;
- unsigned short a, b, res_closure;
-
- a = 2;
- b = 32765;
-
- args_dbl[0] = &a;
- args_dbl[1] = &b;
- args_dbl[2] = NULL;
-
- cl_arg_types[0] = &ffi_type_ushort;
- cl_arg_types[1] = &ffi_type_ushort;
- cl_arg_types[2] = NULL;
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2,
- &ffi_type_ushort, cl_arg_types) == FFI_OK);
-
- ffi_call(&cif, FFI_FN(test_func_fn), &res_call, args_dbl);
- /* { dg-output "2 32765: 32767" } */
- printf("res: %d\n", (unsigned short)res_call);
- /* { dg-output "\nres: 32767" } */
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, test_func_gn, NULL, code) == FFI_OK);
-
- res_closure = (*((test_type)code))(2, 32765);
- /* { dg-output "\n2 32765: 32767" } */
- printf("res: %d\n", res_closure);
- /* { dg-output "\nres: 32767" } */
-
- exit(0);
-}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_multi_ushortchar.c b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_multi_ushortchar.c
deleted file mode 100644
index 2588e97f98..0000000000
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_multi_ushortchar.c
+++ /dev/null
@@ -1,86 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Check passing of multiple unsigned short/char values.
- Limitations: none.
- PR: PR13221.
- Originator: <andreast@gcc.gnu.org> 20031129 */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-unsigned short test_func_fn(unsigned char a1, unsigned short a2,
- unsigned char a3, unsigned short a4)
-{
- unsigned short result;
-
- result = a1 + a2 + a3 + a4;
-
- printf("%d %d %d %d: %d\n", a1, a2, a3, a4, result);
-
- return result;
-
-}
-
-static void test_func_gn(ffi_cif *cif __UNUSED__, void *rval, void **avals,
- void *data __UNUSED__)
-{
- unsigned char a1, a3;
- unsigned short a2, a4;
-
- a1 = *(unsigned char *)avals[0];
- a2 = *(unsigned short *)avals[1];
- a3 = *(unsigned char *)avals[2];
- a4 = *(unsigned short *)avals[3];
-
- *(ffi_arg *)rval = test_func_fn(a1, a2, a3, a4);
-
-}
-
-typedef unsigned short (*test_type)(unsigned char, unsigned short,
- unsigned char, unsigned short);
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- void * args_dbl[5];
- ffi_type * cl_arg_types[5];
- ffi_arg res_call;
- unsigned char a, c;
- unsigned short b, d, res_closure;
-
- a = 1;
- b = 2;
- c = 127;
- d = 128;
-
- args_dbl[0] = &a;
- args_dbl[1] = &b;
- args_dbl[2] = &c;
- args_dbl[3] = &d;
- args_dbl[4] = NULL;
-
- cl_arg_types[0] = &ffi_type_uchar;
- cl_arg_types[1] = &ffi_type_ushort;
- cl_arg_types[2] = &ffi_type_uchar;
- cl_arg_types[3] = &ffi_type_ushort;
- cl_arg_types[4] = NULL;
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 4,
- &ffi_type_ushort, cl_arg_types) == FFI_OK);
-
- ffi_call(&cif, FFI_FN(test_func_fn), &res_call, args_dbl);
- /* { dg-output "1 2 127 128: 258" } */
- printf("res: %d\n", (unsigned short)res_call);
- /* { dg-output "\nres: 258" } */
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, test_func_gn, NULL, code) == FFI_OK);
-
- res_closure = (*((test_type)code))(1, 2, 127, 128);
- /* { dg-output "\n1 2 127 128: 258" } */
- printf("res: %d\n", res_closure);
- /* { dg-output "\nres: 258" } */
-
- exit(0);
-}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_pointer.c b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_pointer.c
deleted file mode 100644
index d82a87a71b..0000000000
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_pointer.c
+++ /dev/null
@@ -1,74 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Check pointer arguments.
- Limitations: none.
- PR: none.
- Originator: Blake Chaffin 6/6/2007 */
-
-/* { dg-do run { xfail strongarm*-*-* xscale*-*-* } } */
-#include "ffitest.h"
-
-void* cls_pointer_fn(void* a1, void* a2)
-{
- void* result = (void*)((intptr_t)a1 + (intptr_t)a2);
-
- printf("0x%08x 0x%08x: 0x%08x\n",
- (unsigned int)(uintptr_t) a1,
- (unsigned int)(uintptr_t) a2,
- (unsigned int)(uintptr_t) result);
-
- return result;
-}
-
-static void
-cls_pointer_gn(ffi_cif* cif __UNUSED__, void* resp,
- void** args, void* userdata __UNUSED__)
-{
- void* a1 = *(void**)(args[0]);
- void* a2 = *(void**)(args[1]);
-
- *(void**)resp = cls_pointer_fn(a1, a2);
-}
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure* pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- void* args[3];
- /* ffi_type cls_pointer_type; */
- ffi_type* arg_types[3];
-
-/* cls_pointer_type.size = sizeof(void*);
- cls_pointer_type.alignment = 0;
- cls_pointer_type.type = FFI_TYPE_POINTER;
- cls_pointer_type.elements = NULL;*/
-
- void* arg1 = (void*)0x12345678;
- void* arg2 = (void*)0x89abcdef;
- ffi_arg res = 0;
-
- arg_types[0] = &ffi_type_pointer;
- arg_types[1] = &ffi_type_pointer;
- arg_types[2] = NULL;
-
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &ffi_type_pointer,
- arg_types) == FFI_OK);
-
- args[0] = &arg1;
- args[1] = &arg2;
- args[2] = NULL;
-
- ffi_call(&cif, FFI_FN(cls_pointer_fn), &res, args);
- /* { dg-output "0x12345678 0x89abcdef: 0x9be02467" } */
- printf("res: 0x%08x\n", (unsigned int) res);
- /* { dg-output "\nres: 0x9be02467" } */
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, cls_pointer_gn, NULL, code) == FFI_OK);
-
- res = (ffi_arg)(uintptr_t)((void*(*)(void*, void*))(code))(arg1, arg2);
- /* { dg-output "\n0x12345678 0x89abcdef: 0x9be02467" } */
- printf("res: 0x%08x\n", (unsigned int) res);
- /* { dg-output "\nres: 0x9be02467" } */
-
- exit(0);
-}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_pointer_stack.c b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_pointer_stack.c
deleted file mode 100644
index 1f1d9157b9..0000000000
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_pointer_stack.c
+++ /dev/null
@@ -1,142 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Check pointer arguments across multiple hideous stack frames.
- Limitations: none.
- PR: none.
- Originator: Blake Chaffin 6/7/2007 */
-
-/* { dg-do run { xfail strongarm*-*-* xscale*-*-* } } */
-#include "ffitest.h"
-
-static long dummyVar;
-
-long dummy_func(
- long double a1, char b1,
- long double a2, char b2,
- long double a3, char b3,
- long double a4, char b4)
-{
- return a1 + b1 + a2 + b2 + a3 + b3 + a4 + b4;
-}
-
-void* cls_pointer_fn2(void* a1, void* a2)
-{
- long double trample1 = (intptr_t)a1 + (intptr_t)a2;
- char trample2 = ((char*)&a1)[0] + ((char*)&a2)[0];
- long double trample3 = (intptr_t)trample1 + (intptr_t)a1;
- char trample4 = trample2 + ((char*)&a1)[1];
- long double trample5 = (intptr_t)trample3 + (intptr_t)a2;
- char trample6 = trample4 + ((char*)&a2)[1];
- long double trample7 = (intptr_t)trample5 + (intptr_t)trample1;
- char trample8 = trample6 + trample2;
- void* result;
-
- dummyVar = dummy_func(trample1, trample2, trample3, trample4,
- trample5, trample6, trample7, trample8);
-
- result = (void*)((intptr_t)a1 + (intptr_t)a2);
-
- printf("0x%08x 0x%08x: 0x%08x\n",
- (unsigned int)(uintptr_t) a1,
- (unsigned int)(uintptr_t) a2,
- (unsigned int)(uintptr_t) result);
-
- return result;
-}
-
-void* cls_pointer_fn1(void* a1, void* a2)
-{
- long double trample1 = (intptr_t)a1 + (intptr_t)a2;
- char trample2 = ((char*)&a1)[0] + ((char*)&a2)[0];
- long double trample3 = (intptr_t)trample1 + (intptr_t)a1;
- char trample4 = trample2 + ((char*)&a1)[1];
- long double trample5 = (intptr_t)trample3 + (intptr_t)a2;
- char trample6 = trample4 + ((char*)&a2)[1];
- long double trample7 = (intptr_t)trample5 + (intptr_t)trample1;
- char trample8 = trample6 + trample2;
- void* result;
-
- dummyVar = dummy_func(trample1, trample2, trample3, trample4,
- trample5, trample6, trample7, trample8);
-
- result = (void*)((intptr_t)a1 + (intptr_t)a2);
-
- printf("0x%08x 0x%08x: 0x%08x\n",
- (unsigned int)(intptr_t) a1,
- (unsigned int)(intptr_t) a2,
- (unsigned int)(intptr_t) result);
-
- result = cls_pointer_fn2(result, a1);
-
- return result;
-}
-
-static void
-cls_pointer_gn(ffi_cif* cif __UNUSED__, void* resp,
- void** args, void* userdata __UNUSED__)
-{
- void* a1 = *(void**)(args[0]);
- void* a2 = *(void**)(args[1]);
-
- long double trample1 = (intptr_t)a1 + (intptr_t)a2;
- char trample2 = ((char*)&a1)[0] + ((char*)&a2)[0];
- long double trample3 = (intptr_t)trample1 + (intptr_t)a1;
- char trample4 = trample2 + ((char*)&a1)[1];
- long double trample5 = (intptr_t)trample3 + (intptr_t)a2;
- char trample6 = trample4 + ((char*)&a2)[1];
- long double trample7 = (intptr_t)trample5 + (intptr_t)trample1;
- char trample8 = trample6 + trample2;
-
- dummyVar = dummy_func(trample1, trample2, trample3, trample4,
- trample5, trample6, trample7, trample8);
-
- *(void**)resp = cls_pointer_fn1(a1, a2);
-}
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure* pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- void* args[3];
- /* ffi_type cls_pointer_type; */
- ffi_type* arg_types[3];
-
-/* cls_pointer_type.size = sizeof(void*);
- cls_pointer_type.alignment = 0;
- cls_pointer_type.type = FFI_TYPE_POINTER;
- cls_pointer_type.elements = NULL;*/
-
- void* arg1 = (void*)0x01234567;
- void* arg2 = (void*)0x89abcdef;
- ffi_arg res = 0;
-
- arg_types[0] = &ffi_type_pointer;
- arg_types[1] = &ffi_type_pointer;
- arg_types[2] = NULL;
-
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &ffi_type_pointer,
- arg_types) == FFI_OK);
-
- args[0] = &arg1;
- args[1] = &arg2;
- args[2] = NULL;
-
- printf("\n");
- ffi_call(&cif, FFI_FN(cls_pointer_fn1), &res, args);
-
- printf("res: 0x%08x\n", (unsigned int) res);
- /* { dg-output "\n0x01234567 0x89abcdef: 0x8acf1356" } */
- /* { dg-output "\n0x8acf1356 0x01234567: 0x8bf258bd" } */
- /* { dg-output "\nres: 0x8bf258bd" } */
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, cls_pointer_gn, NULL, code) == FFI_OK);
-
- res = (ffi_arg)(uintptr_t)((void*(*)(void*, void*))(code))(arg1, arg2);
-
- printf("res: 0x%08x\n", (unsigned int) res);
- /* { dg-output "\n0x01234567 0x89abcdef: 0x8acf1356" } */
- /* { dg-output "\n0x8acf1356 0x01234567: 0x8bf258bd" } */
- /* { dg-output "\nres: 0x8bf258bd" } */
-
- exit(0);
-}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_schar.c b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_schar.c
deleted file mode 100644
index 82986b172c..0000000000
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_schar.c
+++ /dev/null
@@ -1,44 +0,0 @@
-/* Area: closure_call
- Purpose: Check return value schar.
- Limitations: none.
- PR: none.
- Originator: <andreast@gcc.gnu.org> 20031108 */
-
-
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-static void cls_ret_schar_fn(ffi_cif* cif __UNUSED__, void* resp, void** args,
- void* userdata __UNUSED__)
-{
- *(ffi_arg*)resp = *(signed char *)args[0];
- printf("%d: %d\n",*(signed char *)args[0],
- (int)*(ffi_arg *)(resp));
-}
-typedef signed char (*cls_ret_schar)(signed char);
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- ffi_type * cl_arg_types[2];
- signed char res;
-
- cl_arg_types[0] = &ffi_type_schar;
- cl_arg_types[1] = NULL;
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1,
- &ffi_type_schar, cl_arg_types) == FFI_OK);
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, cls_ret_schar_fn, NULL, code) == FFI_OK);
-
- res = (*((cls_ret_schar)code))(127);
- /* { dg-output "127: 127" } */
- printf("res: %d\n", res);
- /* { dg-output "\nres: 127" } */
-
- exit(0);
-}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_sint.c b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_sint.c
deleted file mode 100644
index c7e13b73a3..0000000000
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_sint.c
+++ /dev/null
@@ -1,42 +0,0 @@
-/* Area: closure_call
- Purpose: Check return value sint32.
- Limitations: none.
- PR: none.
- Originator: <andreast@gcc.gnu.org> 20031108 */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-static void cls_ret_sint_fn(ffi_cif* cif __UNUSED__, void* resp, void** args,
- void* userdata __UNUSED__)
-{
- *(ffi_arg*)resp = *(signed int *)args[0];
- printf("%d: %d\n",*(signed int *)args[0],
- (int)*(ffi_arg *)(resp));
-}
-typedef signed int (*cls_ret_sint)(signed int);
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- ffi_type * cl_arg_types[2];
- signed int res;
-
- cl_arg_types[0] = &ffi_type_sint;
- cl_arg_types[1] = NULL;
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1,
- &ffi_type_sint, cl_arg_types) == FFI_OK);
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, cls_ret_sint_fn, NULL, code) == FFI_OK);
-
- res = (*((cls_ret_sint)code))(65534);
- /* { dg-output "65534: 65534" } */
- printf("res: %d\n",res);
- /* { dg-output "\nres: 65534" } */
-
- exit(0);
-}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_sshort.c b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_sshort.c
deleted file mode 100644
index 846d57ed1b..0000000000
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_sshort.c
+++ /dev/null
@@ -1,42 +0,0 @@
-/* Area: closure_call
- Purpose: Check return value sshort.
- Limitations: none.
- PR: none.
- Originator: <andreast@gcc.gnu.org> 20031108 */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-static void cls_ret_sshort_fn(ffi_cif* cif __UNUSED__, void* resp, void** args,
- void* userdata __UNUSED__)
-{
- *(ffi_arg*)resp = *(signed short *)args[0];
- printf("%d: %d\n",*(signed short *)args[0],
- (int)*(ffi_arg *)(resp));
-}
-typedef signed short (*cls_ret_sshort)(signed short);
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- ffi_type * cl_arg_types[2];
- signed short res;
-
- cl_arg_types[0] = &ffi_type_sshort;
- cl_arg_types[1] = NULL;
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1,
- &ffi_type_sshort, cl_arg_types) == FFI_OK);
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, cls_ret_sshort_fn, NULL, code) == FFI_OK);
-
- res = (*((cls_ret_sshort)code))(255);
- /* { dg-output "255: 255" } */
- printf("res: %d\n",res);
- /* { dg-output "\nres: 255" } */
-
- exit(0);
-}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_struct_va1.c b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_struct_va1.c
deleted file mode 100644
index 6d1fdaeb60..0000000000
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_struct_va1.c
+++ /dev/null
@@ -1,114 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Test doubles passed in variable argument lists.
- Limitations: none.
- PR: none.
- Originator: Blake Chaffin 6/6/2007 */
-
-/* { dg-do run } */
-/* { dg-output "" { xfail avr32*-*-* } } */
-#include "ffitest.h"
-
-struct small_tag
-{
- unsigned char a;
- unsigned char b;
-};
-
-struct large_tag
-{
- unsigned a;
- unsigned b;
- unsigned c;
- unsigned d;
- unsigned e;
-};
-
-static void
-test_fn (ffi_cif* cif __UNUSED__, void* resp,
- void** args, void* userdata __UNUSED__)
-{
- int n = *(int*)args[0];
- struct small_tag s1 = * (struct small_tag *) args[1];
- struct large_tag l1 = * (struct large_tag *) args[2];
- struct small_tag s2 = * (struct small_tag *) args[3];
-
- printf ("%d %d %d %d %d %d %d %d %d %d\n", n, s1.a, s1.b,
- l1.a, l1.b, l1.c, l1.d, l1.e,
- s2.a, s2.b);
- * (ffi_arg*) resp = 42;
-}
-
-int
-main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc (sizeof (ffi_closure), &code);
- ffi_type* arg_types[5];
-
- ffi_arg res = 0;
-
- ffi_type s_type;
- ffi_type *s_type_elements[3];
-
- ffi_type l_type;
- ffi_type *l_type_elements[6];
-
- struct small_tag s1;
- struct small_tag s2;
- struct large_tag l1;
-
- int si;
-
- s_type.size = 0;
- s_type.alignment = 0;
- s_type.type = FFI_TYPE_STRUCT;
- s_type.elements = s_type_elements;
-
- s_type_elements[0] = &ffi_type_uchar;
- s_type_elements[1] = &ffi_type_uchar;
- s_type_elements[2] = NULL;
-
- l_type.size = 0;
- l_type.alignment = 0;
- l_type.type = FFI_TYPE_STRUCT;
- l_type.elements = l_type_elements;
-
- l_type_elements[0] = &ffi_type_uint;
- l_type_elements[1] = &ffi_type_uint;
- l_type_elements[2] = &ffi_type_uint;
- l_type_elements[3] = &ffi_type_uint;
- l_type_elements[4] = &ffi_type_uint;
- l_type_elements[5] = NULL;
-
- arg_types[0] = &ffi_type_sint;
- arg_types[1] = &s_type;
- arg_types[2] = &l_type;
- arg_types[3] = &s_type;
- arg_types[4] = NULL;
-
- CHECK(ffi_prep_cif_var(&cif, FFI_DEFAULT_ABI, 1, 4, &ffi_type_sint,
- arg_types) == FFI_OK);
-
- si = 4;
- s1.a = 5;
- s1.b = 6;
-
- s2.a = 20;
- s2.b = 21;
-
- l1.a = 10;
- l1.b = 11;
- l1.c = 12;
- l1.d = 13;
- l1.e = 14;
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, test_fn, NULL, code) == FFI_OK);
-
- res = ((int (*)(int, ...))(code))(si, s1, l1, s2);
- /* { dg-output "4 5 6 10 11 12 13 14 20 21" } */
- printf("res: %d\n", (int) res);
- /* { dg-output "\nres: 42" } */
-
- exit(0);
-}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_uchar.c b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_uchar.c
deleted file mode 100644
index c1317e795f..0000000000
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_uchar.c
+++ /dev/null
@@ -1,42 +0,0 @@
-/* Area: closure_call
- Purpose: Check return value uchar.
- Limitations: none.
- PR: none.
- Originator: <andreast@gcc.gnu.org> 20030828 */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-static void cls_ret_uchar_fn(ffi_cif* cif __UNUSED__, void* resp, void** args,
- void* userdata __UNUSED__)
-{
- *(ffi_arg*)resp = *(unsigned char *)args[0];
- printf("%d: %d\n",*(unsigned char *)args[0],
- (int)*(ffi_arg *)(resp));
-}
-typedef unsigned char (*cls_ret_uchar)(unsigned char);
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- ffi_type * cl_arg_types[2];
- unsigned char res;
-
- cl_arg_types[0] = &ffi_type_uchar;
- cl_arg_types[1] = NULL;
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1,
- &ffi_type_uchar, cl_arg_types) == FFI_OK);
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, cls_ret_uchar_fn, NULL, code) == FFI_OK);
-
- res = (*((cls_ret_uchar)code))(127);
- /* { dg-output "127: 127" } */
- printf("res: %d\n",res);
- /* { dg-output "\nres: 127" } */
-
- exit(0);
-}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_uchar_va.c b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_uchar_va.c
deleted file mode 100644
index 6491c5b3df..0000000000
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_uchar_va.c
+++ /dev/null
@@ -1,44 +0,0 @@
-/* Area: closure_call
- Purpose: Test anonymous unsigned char argument.
- Limitations: none.
- PR: none.
- Originator: ARM Ltd. */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-typedef unsigned char T;
-
-static void cls_ret_T_fn(ffi_cif* cif __UNUSED__, void* resp, void** args,
- void* userdata __UNUSED__)
- {
- *(ffi_arg *)resp = *(T *)args[0];
-
- printf("%d: %d %d\n", (int)(*(ffi_arg *)resp), *(T *)args[0], *(T *)args[1]);
- }
-
-typedef T (*cls_ret_T)(T, ...);
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- ffi_type * cl_arg_types[3];
- T res;
-
- cl_arg_types[0] = &ffi_type_uchar;
- cl_arg_types[1] = &ffi_type_uchar;
- cl_arg_types[2] = NULL;
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif_var(&cif, FFI_DEFAULT_ABI, 1, 2,
- &ffi_type_uchar, cl_arg_types) == FFI_OK);
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, cls_ret_T_fn, NULL, code) == FFI_OK);
- res = ((((cls_ret_T)code)(67, 4)));
- /* { dg-output "67: 67 4" } */
- printf("res: %d\n", res);
- /* { dg-output "\nres: 67" } */
- exit(0);
-}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_uint.c b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_uint.c
deleted file mode 100644
index 885cff5c31..0000000000
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_uint.c
+++ /dev/null
@@ -1,43 +0,0 @@
-/* Area: closure_call
- Purpose: Check return value uint.
- Limitations: none.
- PR: none.
- Originator: <andreast@gcc.gnu.org> 20030828 */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-static void cls_ret_uint_fn(ffi_cif* cif __UNUSED__, void* resp, void** args,
- void* userdata __UNUSED__)
-{
- *(ffi_arg *)resp = *(unsigned int *)args[0];
-
- printf("%d: %d\n",*(unsigned int *)args[0],
- (int)*(ffi_arg *)(resp));
-}
-typedef unsigned int (*cls_ret_uint)(unsigned int);
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- ffi_type * cl_arg_types[2];
- unsigned int res;
-
- cl_arg_types[0] = &ffi_type_uint;
- cl_arg_types[1] = NULL;
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1,
- &ffi_type_uint, cl_arg_types) == FFI_OK);
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, cls_ret_uint_fn, NULL, code) == FFI_OK);
-
- res = (*((cls_ret_uint)code))(2147483647);
- /* { dg-output "2147483647: 2147483647" } */
- printf("res: %d\n",res);
- /* { dg-output "\nres: 2147483647" } */
-
- exit(0);
-}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_uint_va.c b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_uint_va.c
deleted file mode 100644
index b04cfd19c2..0000000000
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_uint_va.c
+++ /dev/null
@@ -1,45 +0,0 @@
-/* Area: closure_call
- Purpose: Test anonymous unsigned int argument.
- Limitations: none.
- PR: none.
- Originator: ARM Ltd. */
-
-/* { dg-do run } */
-
-#include "ffitest.h"
-
-typedef unsigned int T;
-
-static void cls_ret_T_fn(ffi_cif* cif __UNUSED__, void* resp, void** args,
- void* userdata __UNUSED__)
- {
- *(ffi_arg *)resp = *(T *)args[0];
-
- printf("%d: %d %d\n", (int)*(ffi_arg *)resp, *(T *)args[0], *(T *)args[1]);
- }
-
-typedef T (*cls_ret_T)(T, ...);
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- ffi_type * cl_arg_types[3];
- T res;
-
- cl_arg_types[0] = &ffi_type_uint;
- cl_arg_types[1] = &ffi_type_uint;
- cl_arg_types[2] = NULL;
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif_var(&cif, FFI_DEFAULT_ABI, 1, 2,
- &ffi_type_uint, cl_arg_types) == FFI_OK);
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, cls_ret_T_fn, NULL, code) == FFI_OK);
- res = ((((cls_ret_T)code)(67, 4)));
- /* { dg-output "67: 67 4" } */
- printf("res: %d\n", res);
- /* { dg-output "\nres: 67" } */
- exit(0);
-}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_ulong_va.c b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_ulong_va.c
deleted file mode 100644
index 0315082e09..0000000000
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_ulong_va.c
+++ /dev/null
@@ -1,45 +0,0 @@
-/* Area: closure_call
- Purpose: Test anonymous unsigned long argument.
- Limitations: none.
- PR: none.
- Originator: ARM Ltd. */
-
-/* { dg-do run } */
-
-#include "ffitest.h"
-
-typedef unsigned long T;
-
-static void cls_ret_T_fn(ffi_cif* cif __UNUSED__, void* resp, void** args,
- void* userdata __UNUSED__)
- {
- *(T *)resp = *(T *)args[0];
-
- printf("%ld: %ld %ld\n", *(T *)resp, *(T *)args[0], *(T *)args[1]);
- }
-
-typedef T (*cls_ret_T)(T, ...);
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- ffi_type * cl_arg_types[3];
- T res;
-
- cl_arg_types[0] = &ffi_type_ulong;
- cl_arg_types[1] = &ffi_type_ulong;
- cl_arg_types[2] = NULL;
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif_var(&cif, FFI_DEFAULT_ABI, 1, 2,
- &ffi_type_ulong, cl_arg_types) == FFI_OK);
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, cls_ret_T_fn, NULL, code) == FFI_OK);
- res = ((((cls_ret_T)code)(67, 4)));
- /* { dg-output "67: 67 4" } */
- printf("res: %ld\n", res);
- /* { dg-output "\nres: 67" } */
- exit(0);
-}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_ulonglong.c b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_ulonglong.c
deleted file mode 100644
index 62f2cae63a..0000000000
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_ulonglong.c
+++ /dev/null
@@ -1,47 +0,0 @@
-/* Area: closure_call
- Purpose: Check return value long long.
- Limitations: none.
- PR: none.
- Originator: <andreast@gcc.gnu.org> 20030828 */
-
-/* { dg-do run } */
-/* { dg-options "-Wno-format" { target alpha*-dec-osf* } } */
-#include "ffitest.h"
-
-static void cls_ret_ulonglong_fn(ffi_cif* cif __UNUSED__, void* resp,
- void** args, void* userdata __UNUSED__)
-{
- *(unsigned long long *)resp= 0xfffffffffffffffLL ^ *(unsigned long long *)args[0];
-
- printf("%" PRIuLL ": %" PRIuLL "\n",*(unsigned long long *)args[0],
- *(unsigned long long *)(resp));
-}
-typedef unsigned long long (*cls_ret_ulonglong)(unsigned long long);
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- ffi_type * cl_arg_types[2];
- unsigned long long res;
-
- cl_arg_types[0] = &ffi_type_uint64;
- cl_arg_types[1] = NULL;
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1,
- &ffi_type_uint64, cl_arg_types) == FFI_OK);
- CHECK(ffi_prep_closure_loc(pcl, &cif, cls_ret_ulonglong_fn, NULL, code) == FFI_OK);
- res = (*((cls_ret_ulonglong)code))(214LL);
- /* { dg-output "214: 1152921504606846761" } */
- printf("res: %" PRIdLL "\n", res);
- /* { dg-output "\nres: 1152921504606846761" } */
-
- res = (*((cls_ret_ulonglong)code))(9223372035854775808LL);
- /* { dg-output "\n9223372035854775808: 8070450533247928831" } */
- printf("res: %" PRIdLL "\n", res);
- /* { dg-output "\nres: 8070450533247928831" } */
-
- exit(0);
-}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_ushort.c b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_ushort.c
deleted file mode 100644
index a00100e07f..0000000000
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_ushort.c
+++ /dev/null
@@ -1,43 +0,0 @@
-/* Area: closure_call
- Purpose: Check return value ushort.
- Limitations: none.
- PR: none.
- Originator: <andreast@gcc.gnu.org> 20030828 */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-static void cls_ret_ushort_fn(ffi_cif* cif __UNUSED__, void* resp, void** args,
- void* userdata __UNUSED__)
-{
- *(ffi_arg*)resp = *(unsigned short *)args[0];
-
- printf("%d: %d\n",*(unsigned short *)args[0],
- (int)*(ffi_arg *)(resp));
-}
-typedef unsigned short (*cls_ret_ushort)(unsigned short);
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- ffi_type * cl_arg_types[2];
- unsigned short res;
-
- cl_arg_types[0] = &ffi_type_ushort;
- cl_arg_types[1] = NULL;
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1,
- &ffi_type_ushort, cl_arg_types) == FFI_OK);
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, cls_ret_ushort_fn, NULL, code) == FFI_OK);
-
- res = (*((cls_ret_ushort)code))(65535);
- /* { dg-output "65535: 65535" } */
- printf("res: %d\n",res);
- /* { dg-output "\nres: 65535" } */
-
- exit(0);
-}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_ushort_va.c b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_ushort_va.c
deleted file mode 100644
index 37aa1064ea..0000000000
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_ushort_va.c
+++ /dev/null
@@ -1,44 +0,0 @@
-/* Area: closure_call
- Purpose: Test anonymous unsigned short argument.
- Limitations: none.
- PR: none.
- Originator: ARM Ltd. */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-typedef unsigned short T;
-
-static void cls_ret_T_fn(ffi_cif* cif __UNUSED__, void* resp, void** args,
- void* userdata __UNUSED__)
- {
- *(ffi_arg *)resp = *(T *)args[0];
-
- printf("%d: %d %d\n", (int)(*(ffi_arg *)resp), *(T *)args[0], *(T *)args[1]);
- }
-
-typedef T (*cls_ret_T)(T, ...);
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- ffi_type * cl_arg_types[3];
- T res;
-
- cl_arg_types[0] = &ffi_type_ushort;
- cl_arg_types[1] = &ffi_type_ushort;
- cl_arg_types[2] = NULL;
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif_var(&cif, FFI_DEFAULT_ABI, 1, 2,
- &ffi_type_ushort, cl_arg_types) == FFI_OK);
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, cls_ret_T_fn, NULL, code) == FFI_OK);
- res = ((((cls_ret_T)code)(67, 4)));
- /* { dg-output "67: 67 4" } */
- printf("res: %d\n", res);
- /* { dg-output "\nres: 67" } */
- exit(0);
-}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/err_bad_abi.c b/Modules/_ctypes/libffi/testsuite/libffi.call/err_bad_abi.c
deleted file mode 100644
index f5a73179ec..0000000000
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/err_bad_abi.c
+++ /dev/null
@@ -1,36 +0,0 @@
-/* Area: ffi_prep_cif, ffi_prep_closure
- Purpose: Test error return for bad ABIs.
- Limitations: none.
- PR: none.
- Originator: Blake Chaffin 6/6/2007 */
-
-/* { dg-do run } */
-
-#include "ffitest.h"
-
-static void
-dummy_fn(ffi_cif* cif __UNUSED__, void* resp __UNUSED__,
- void** args __UNUSED__, void* userdata __UNUSED__)
-{}
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- ffi_type* arg_types[1];
-
- arg_types[0] = NULL;
-
- CHECK(ffi_prep_cif(&cif, 255, 0, &ffi_type_void,
- arg_types) == FFI_BAD_ABI);
-
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 0, &ffi_type_void,
- arg_types) == FFI_OK);
-
- cif.abi= 255;
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, dummy_fn, NULL, code) == FFI_BAD_ABI);
-
- exit(0);
-}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/err_bad_typedef.c b/Modules/_ctypes/libffi/testsuite/libffi.call/err_bad_typedef.c
deleted file mode 100644
index bf60161861..0000000000
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/err_bad_typedef.c
+++ /dev/null
@@ -1,26 +0,0 @@
-/* Area: ffi_prep_cif
- Purpose: Test error return for bad typedefs.
- Limitations: none.
- PR: none.
- Originator: Blake Chaffin 6/6/2007 */
-
-/* { dg-do run } */
-
-#include "ffitest.h"
-
-int main (void)
-{
- ffi_cif cif;
- ffi_type* arg_types[1];
-
- ffi_type badType = ffi_type_void;
-
- arg_types[0] = NULL;
-
- badType.size = 0;
-
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 0, &badType,
- arg_types) == FFI_BAD_TYPEDEF);
-
- exit(0);
-}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/ffitest.h b/Modules/_ctypes/libffi/testsuite/libffi.call/ffitest.h
deleted file mode 100644
index 15d5e44123..0000000000
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/ffitest.h
+++ /dev/null
@@ -1,135 +0,0 @@
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <fcntl.h>
-#include <ffi.h>
-#include "fficonfig.h"
-
-#if defined HAVE_STDINT_H
-#include <stdint.h>
-#endif
-
-#if defined HAVE_INTTYPES_H
-#include <inttypes.h>
-#endif
-
-#define MAX_ARGS 256
-
-#define CHECK(x) (void)(!(x) ? (abort(), 1) : 0)
-
-/* Define macros so that compilers other than gcc can run the tests. */
-#undef __UNUSED__
-#if defined(__GNUC__)
-#define __UNUSED__ __attribute__((__unused__))
-#define __STDCALL__ __attribute__((stdcall))
-#define __THISCALL__ __attribute__((thiscall))
-#define __FASTCALL__ __attribute__((fastcall))
-#else
-#define __UNUSED__
-#define __STDCALL__ __stdcall
-#define __THISCALL__ __thiscall
-#define __FASTCALL__ __fastcall
-#endif
-
-#ifndef ABI_NUM
-#define ABI_NUM FFI_DEFAULT_ABI
-#define ABI_ATTR
-#endif
-
-/* Prefer MAP_ANON(YMOUS) to /dev/zero, since we don't need to keep a
- file open. */
-#ifdef HAVE_MMAP_ANON
-# undef HAVE_MMAP_DEV_ZERO
-
-# include <sys/mman.h>
-# ifndef MAP_FAILED
-# define MAP_FAILED -1
-# endif
-# if !defined (MAP_ANONYMOUS) && defined (MAP_ANON)
-# define MAP_ANONYMOUS MAP_ANON
-# endif
-# define USING_MMAP
-
-#endif
-
-#ifdef HAVE_MMAP_DEV_ZERO
-
-# include <sys/mman.h>
-# ifndef MAP_FAILED
-# define MAP_FAILED -1
-# endif
-# define USING_MMAP
-
-#endif
-
-/* MinGW kludge. */
-#ifdef _WIN64
-#define PRIdLL "I64d"
-#define PRIuLL "I64u"
-#else
-#define PRIdLL "lld"
-#define PRIuLL "llu"
-#endif
-
-/* Tru64 UNIX kludge. */
-#if defined(__alpha__) && defined(__osf__)
-/* Tru64 UNIX V4.0 doesn't support %lld/%lld, but long is 64-bit. */
-#undef PRIdLL
-#define PRIdLL "ld"
-#undef PRIuLL
-#define PRIuLL "lu"
-#define PRId8 "hd"
-#define PRIu8 "hu"
-#define PRId64 "ld"
-#define PRIu64 "lu"
-#define PRIuPTR "lu"
-#endif
-
-/* PA HP-UX kludge. */
-#if defined(__hppa__) && defined(__hpux__) && !defined(PRIuPTR)
-#define PRIuPTR "lu"
-#endif
-
-/* IRIX kludge. */
-#if defined(__sgi)
-/* IRIX 6.5 <inttypes.h> provides all definitions, but only for C99
- compilations. */
-#define PRId8 "hhd"
-#define PRIu8 "hhu"
-#if (_MIPS_SZLONG == 32)
-#define PRId64 "lld"
-#define PRIu64 "llu"
-#endif
-/* This doesn't match <inttypes.h>, which always has "lld" here, but the
- arguments are uint64_t, int64_t, which are unsigned long, long for
- 64-bit in <sgidefs.h>. */
-#if (_MIPS_SZLONG == 64)
-#define PRId64 "ld"
-#define PRIu64 "lu"
-#endif
-/* This doesn't match <inttypes.h>, which has "u" here, but the arguments
- are uintptr_t, which is always unsigned long. */
-#define PRIuPTR "lu"
-#endif
-
-/* Solaris < 10 kludge. */
-#if defined(__sun__) && defined(__svr4__) && !defined(PRIuPTR)
-#if defined(__arch64__) || defined (__x86_64__)
-#define PRIuPTR "lu"
-#else
-#define PRIuPTR "u"
-#endif
-#endif
-
-/* MSVC kludge. */
-#if defined _MSC_VER
-#define PRIuPTR "lu"
-#define PRIu8 "u"
-#define PRId8 "d"
-#define PRIu64 "I64u"
-#define PRId64 "I64d"
-#endif
-
-#ifndef PRIuPTR
-#define PRIuPTR "u"
-#endif
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/float.c b/Modules/_ctypes/libffi/testsuite/libffi.call/float.c
deleted file mode 100644
index fbc272d84f..0000000000
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/float.c
+++ /dev/null
@@ -1,59 +0,0 @@
-/* Area: ffi_call
- Purpose: Check return value float.
- Limitations: none.
- PR: none.
- Originator: From the original ffitest.c */
-
-/* { dg-do run } */
-
-#include "ffitest.h"
-
-static int floating(int a, float b, double c, long double d)
-{
- int i;
-
- i = (int) ((float)a/b + ((float)c/(float)d));
-
- return i;
-}
-
-int main (void)
-{
- ffi_cif cif;
- ffi_type *args[MAX_ARGS];
- void *values[MAX_ARGS];
- ffi_arg rint;
-
- float f;
- signed int si1;
- double d;
- long double ld;
-
- args[0] = &ffi_type_sint;
- values[0] = &si1;
- args[1] = &ffi_type_float;
- values[1] = &f;
- args[2] = &ffi_type_double;
- values[2] = &d;
- args[3] = &ffi_type_longdouble;
- values[3] = &ld;
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 4,
- &ffi_type_sint, args) == FFI_OK);
-
- si1 = 6;
- f = 3.14159;
- d = (double)1.0/(double)3.0;
- ld = 2.71828182846L;
-
- floating (si1, f, d, ld);
-
- ffi_call(&cif, FFI_FN(floating), &rint, values);
-
- printf ("%d vs %d\n", (int)rint, floating (si1, f, d, ld));
-
- CHECK((int)rint == floating(si1, f, d, ld));
-
- exit (0);
-}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/float1.c b/Modules/_ctypes/libffi/testsuite/libffi.call/float1.c
deleted file mode 100644
index 991d059fe4..0000000000
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/float1.c
+++ /dev/null
@@ -1,58 +0,0 @@
-/* Area: ffi_call
- Purpose: Check return value double.
- Limitations: none.
- PR: none.
- Originator: From the original ffitest.c */
-
-/* { dg-do run } */
-#include "ffitest.h"
-#include "float.h"
-
-typedef union
-{
- double d;
- unsigned char c[sizeof (double)];
-} value_type;
-
-#define CANARY 0xba
-
-static double dblit(float f)
-{
- return f/3.0;
-}
-
-int main (void)
-{
- ffi_cif cif;
- ffi_type *args[MAX_ARGS];
- void *values[MAX_ARGS];
- float f;
- value_type result[2];
- unsigned int i;
-
- args[0] = &ffi_type_float;
- values[0] = &f;
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1,
- &ffi_type_double, args) == FFI_OK);
-
- f = 3.14159;
-
- /* Put a canary in the return array. This is a regression test for
- a buffer overrun. */
- memset(result[1].c, CANARY, sizeof (double));
-
- ffi_call(&cif, FFI_FN(dblit), &result[0].d, values);
-
- /* These are not always the same!! Check for a reasonable delta */
-
- CHECK(result[0].d - dblit(f) < DBL_EPSILON);
-
- /* Check the canary. */
- for (i = 0; i < sizeof (double); ++i)
- CHECK(result[1].c[i] == CANARY);
-
- exit(0);
-
-}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/float2.c b/Modules/_ctypes/libffi/testsuite/libffi.call/float2.c
deleted file mode 100644
index a0b296cf4b..0000000000
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/float2.c
+++ /dev/null
@@ -1,58 +0,0 @@
-/* Area: ffi_call
- Purpose: Check return value long double.
- Limitations: none.
- PR: none.
- Originator: From the original ffitest.c */
-
-/* { dg-excess-errors "fails" { target x86_64-*-mingw* x86_64-*-cygwin* } } */
-/* { dg-do run { xfail x86_64-*-mingw* x86_64-*-cygwin* } } */
-
-#include "ffitest.h"
-#include "float.h"
-
-static long double ldblit(float f)
-{
- return (long double) (((long double) f)/ (long double) 3.0);
-}
-
-int main (void)
-{
- ffi_cif cif;
- ffi_type *args[MAX_ARGS];
- void *values[MAX_ARGS];
- float f;
- long double ld;
-
- args[0] = &ffi_type_float;
- values[0] = &f;
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1,
- &ffi_type_longdouble, args) == FFI_OK);
-
- f = 3.14159;
-
-#if 1
- /* This is ifdef'd out for now. long double support under SunOS/gcc
- is pretty much non-existent. You'll get the odd bus error in library
- routines like printf(). */
- printf ("%Lf\n", ldblit(f));
-#endif
- ld = 666;
- ffi_call(&cif, FFI_FN(ldblit), &ld, values);
-
-#if 1
- /* This is ifdef'd out for now. long double support under SunOS/gcc
- is pretty much non-existent. You'll get the odd bus error in library
- routines like printf(). */
- printf ("%Lf, %Lf, %Lf, %Lf\n", ld, ldblit(f), ld - ldblit(f), LDBL_EPSILON);
-#endif
-
- /* These are not always the same!! Check for a reasonable delta */
- if (ld - ldblit(f) < LDBL_EPSILON)
- puts("long double return value tests ok!");
- else
- CHECK(0);
-
- exit(0);
-}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/float3.c b/Modules/_ctypes/libffi/testsuite/libffi.call/float3.c
deleted file mode 100644
index 76bd5f287c..0000000000
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/float3.c
+++ /dev/null
@@ -1,72 +0,0 @@
-/* Area: ffi_call
- Purpose: Check float arguments with different orders.
- Limitations: none.
- PR: none.
- Originator: From the original ffitest.c */
-
-/* { dg-do run } */
-
-#include "ffitest.h"
-#include "float.h"
-
-static double floating_1(float a, double b, long double c)
-{
- return (double) a + b + (double) c;
-}
-
-static double floating_2(long double a, double b, float c)
-{
- return (double) a + b + (double) c;
-}
-
-int main (void)
-{
- ffi_cif cif;
- ffi_type *args[MAX_ARGS];
- void *values[MAX_ARGS];
- double rd;
-
- float f;
- double d;
- long double ld;
-
- args[0] = &ffi_type_float;
- values[0] = &f;
- args[1] = &ffi_type_double;
- values[1] = &d;
- args[2] = &ffi_type_longdouble;
- values[2] = &ld;
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 3,
- &ffi_type_double, args) == FFI_OK);
-
- f = 3.14159;
- d = (double)1.0/(double)3.0;
- ld = 2.71828182846L;
-
- floating_1 (f, d, ld);
-
- ffi_call(&cif, FFI_FN(floating_1), &rd, values);
-
- CHECK(rd - floating_1(f, d, ld) < DBL_EPSILON);
-
- args[0] = &ffi_type_longdouble;
- values[0] = &ld;
- args[1] = &ffi_type_double;
- values[1] = &d;
- args[2] = &ffi_type_float;
- values[2] = &f;
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 3,
- &ffi_type_double, args) == FFI_OK);
-
- floating_2 (ld, d, f);
-
- ffi_call(&cif, FFI_FN(floating_2), &rd, values);
-
- CHECK(rd - floating_2(ld, d, f) < DBL_EPSILON);
-
- exit (0);
-}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/float4.c b/Modules/_ctypes/libffi/testsuite/libffi.call/float4.c
deleted file mode 100644
index 0dd6d85e7a..0000000000
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/float4.c
+++ /dev/null
@@ -1,62 +0,0 @@
-/* Area: ffi_call
- Purpose: Check denorm double value.
- Limitations: none.
- PR: PR26483.
- Originator: From the original ffitest.c */
-
-/* { dg-do run } */
-/* { dg-options "-mieee" { target alpha*-*-* } } */
-
-#include "ffitest.h"
-#include "float.h"
-
-typedef union
-{
- double d;
- unsigned char c[sizeof (double)];
-} value_type;
-
-#define CANARY 0xba
-
-static double dblit(double d)
-{
- return d;
-}
-
-int main (void)
-{
- ffi_cif cif;
- ffi_type *args[MAX_ARGS];
- void *values[MAX_ARGS];
- double d;
- value_type result[2];
- unsigned int i;
-
- args[0] = &ffi_type_double;
- values[0] = &d;
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1,
- &ffi_type_double, args) == FFI_OK);
-
- d = DBL_MIN / 2;
-
- /* Put a canary in the return array. This is a regression test for
- a buffer overrun. */
- memset(result[1].c, CANARY, sizeof (double));
-
- ffi_call(&cif, FFI_FN(dblit), &result[0].d, values);
-
- /* The standard delta check doesn't work for denorms. Since we didn't do
- any arithmetic, we should get the original result back, and hence an
- exact check should be OK here. */
-
- CHECK(result[0].d == dblit(d));
-
- /* Check the canary. */
- for (i = 0; i < sizeof (double); ++i)
- CHECK(result[1].c[i] == CANARY);
-
- exit(0);
-
-}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/float_va.c b/Modules/_ctypes/libffi/testsuite/libffi.call/float_va.c
deleted file mode 100644
index 5acff91f66..0000000000
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/float_va.c
+++ /dev/null
@@ -1,107 +0,0 @@
-/* Area: fp and variadics
- Purpose: check fp inputs and returns work on variadics, even the fixed params
- Limitations: None
- PR: none
- Originator: <david.gilbert@linaro.org> 2011-01-25
-
- Intended to stress the difference in ABI on ARM vfp
-*/
-
-/* { dg-do run } */
-
-#include <stdarg.h>
-
-#include "ffitest.h"
-
-/* prints out all the parameters, and returns the sum of them all.
- * 'x' is the number of variadic parameters all of which are double in this test
- */
-double float_va_fn(unsigned int x, double y,...)
-{
- double total=0.0;
- va_list ap;
- unsigned int i;
-
- total+=(double)x;
- total+=y;
-
- printf("%u: %.1f :", x, y);
-
- va_start(ap, y);
- for(i=0;i<x;i++)
- {
- double arg=va_arg(ap, double);
- total+=arg;
- printf(" %d:%.1f ", i, arg);
- }
- va_end(ap);
-
- printf(" total: %.1f\n", total);
-
- return total;
-}
-
-int main (void)
-{
- ffi_cif cif;
-
- ffi_type *arg_types[5];
- void *values[5];
- double doubles[5];
- unsigned int firstarg;
- double resfp;
-
- /* First test, pass float_va_fn(0,2.0) - note there are no actual
- * variadic parameters, but it's declared variadic so the ABI may be
- * different. */
- /* Call it statically and then via ffi */
- resfp=float_va_fn(0,2.0);
- /* { dg-output "0: 2.0 : total: 2.0" } */
- printf("compiled: %.1f\n", resfp);
- /* { dg-output "\ncompiled: 2.0" } */
-
- arg_types[0] = &ffi_type_uint;
- arg_types[1] = &ffi_type_double;
- arg_types[2] = NULL;
- CHECK(ffi_prep_cif_var(&cif, FFI_DEFAULT_ABI, 2, 2,
- &ffi_type_double, arg_types) == FFI_OK);
-
- firstarg = 0;
- doubles[0] = 2.0;
- values[0] = &firstarg;
- values[1] = &doubles[0];
- ffi_call(&cif, FFI_FN(float_va_fn), &resfp, values);
- /* { dg-output "\n0: 2.0 : total: 2.0" } */
- printf("ffi: %.1f\n", resfp);
- /* { dg-output "\nffi: 2.0" } */
-
- /* Second test, float_va_fn(2,2.0,3.0,4.0), now with variadic params */
- /* Call it statically and then via ffi */
- resfp=float_va_fn(2,2.0,3.0,4.0);
- /* { dg-output "\n2: 2.0 : 0:3.0 1:4.0 total: 11.0" } */
- printf("compiled: %.1f\n", resfp);
- /* { dg-output "\ncompiled: 11.0" } */
-
- arg_types[0] = &ffi_type_uint;
- arg_types[1] = &ffi_type_double;
- arg_types[2] = &ffi_type_double;
- arg_types[3] = &ffi_type_double;
- arg_types[4] = NULL;
- CHECK(ffi_prep_cif_var(&cif, FFI_DEFAULT_ABI, 2, 4,
- &ffi_type_double, arg_types) == FFI_OK);
-
- firstarg = 2;
- doubles[0] = 2.0;
- doubles[1] = 3.0;
- doubles[2] = 4.0;
- values[0] = &firstarg;
- values[1] = &doubles[0];
- values[2] = &doubles[1];
- values[3] = &doubles[2];
- ffi_call(&cif, FFI_FN(float_va_fn), &resfp, values);
- /* { dg-output "\n2: 2.0 : 0:3.0 1:4.0 total: 11.0" } */
- printf("ffi: %.1f\n", resfp);
- /* { dg-output "\nffi: 11.0" } */
-
- exit(0);
-}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/huge_struct.c b/Modules/_ctypes/libffi/testsuite/libffi.call/huge_struct.c
deleted file mode 100644
index 657fe54148..0000000000
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/huge_struct.c
+++ /dev/null
@@ -1,343 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Check large structure returns.
- Limitations: none.
- PR: none.
- Originator: Blake Chaffin 6/18/2007
-*/
-
-/* { dg-excess-errors "" { target x86_64-*-mingw* x86_64-*-cygwin* } } */
-/* { dg-do run { xfail strongarm*-*-* xscale*-*-* } } */
-/* { dg-options -mlong-double-128 { target powerpc64*-*-linux* } } */
-/* { dg-options -Wformat=0 { target moxie*-*-elf } } */
-/* { dg-output "" { xfail x86_64-*-mingw* x86_64-*-cygwin* } } */
-
-#include "ffitest.h"
-
-typedef struct BigStruct{
- uint8_t a;
- int8_t b;
- uint16_t c;
- int16_t d;
- uint32_t e;
- int32_t f;
- uint64_t g;
- int64_t h;
- float i;
- double j;
- long double k;
- char* l;
- uint8_t m;
- int8_t n;
- uint16_t o;
- int16_t p;
- uint32_t q;
- int32_t r;
- uint64_t s;
- int64_t t;
- float u;
- double v;
- long double w;
- char* x;
- uint8_t y;
- int8_t z;
- uint16_t aa;
- int16_t bb;
- uint32_t cc;
- int32_t dd;
- uint64_t ee;
- int64_t ff;
- float gg;
- double hh;
- long double ii;
- char* jj;
- uint8_t kk;
- int8_t ll;
- uint16_t mm;
- int16_t nn;
- uint32_t oo;
- int32_t pp;
- uint64_t qq;
- int64_t rr;
- float ss;
- double tt;
- long double uu;
- char* vv;
- uint8_t ww;
- int8_t xx;
-} BigStruct;
-
-BigStruct
-test_large_fn(
- uint8_t ui8_1,
- int8_t si8_1,
- uint16_t ui16_1,
- int16_t si16_1,
- uint32_t ui32_1,
- int32_t si32_1,
- uint64_t ui64_1,
- int64_t si64_1,
- float f_1,
- double d_1,
- long double ld_1,
- char* p_1,
- uint8_t ui8_2,
- int8_t si8_2,
- uint16_t ui16_2,
- int16_t si16_2,
- uint32_t ui32_2,
- int32_t si32_2,
- uint64_t ui64_2,
- int64_t si64_2,
- float f_2,
- double d_2,
- long double ld_2,
- char* p_2,
- uint8_t ui8_3,
- int8_t si8_3,
- uint16_t ui16_3,
- int16_t si16_3,
- uint32_t ui32_3,
- int32_t si32_3,
- uint64_t ui64_3,
- int64_t si64_3,
- float f_3,
- double d_3,
- long double ld_3,
- char* p_3,
- uint8_t ui8_4,
- int8_t si8_4,
- uint16_t ui16_4,
- int16_t si16_4,
- uint32_t ui32_4,
- int32_t si32_4,
- uint64_t ui64_4,
- int64_t si64_4,
- float f_4,
- double d_4,
- long double ld_4,
- char* p_4,
- uint8_t ui8_5,
- int8_t si8_5)
-{
- BigStruct retVal = {
- ui8_1 + 1, si8_1 + 1, ui16_1 + 1, si16_1 + 1, ui32_1 + 1, si32_1 + 1,
- ui64_1 + 1, si64_1 + 1, f_1 + 1, d_1 + 1, ld_1 + 1, (char*)((intptr_t)p_1 + 1),
- ui8_2 + 2, si8_2 + 2, ui16_2 + 2, si16_2 + 2, ui32_2 + 2, si32_2 + 2,
- ui64_2 + 2, si64_2 + 2, f_2 + 2, d_2 + 2, ld_2 + 2, (char*)((intptr_t)p_2 + 2),
- ui8_3 + 3, si8_3 + 3, ui16_3 + 3, si16_3 + 3, ui32_3 + 3, si32_3 + 3,
- ui64_3 + 3, si64_3 + 3, f_3 + 3, d_3 + 3, ld_3 + 3, (char*)((intptr_t)p_3 + 3),
- ui8_4 + 4, si8_4 + 4, ui16_4 + 4, si16_4 + 4, ui32_4 + 4, si32_4 + 4,
- ui64_4 + 4, si64_4 + 4, f_4 + 4, d_4 + 4, ld_4 + 4, (char*)((intptr_t)p_4 + 4),
- ui8_5 + 5, si8_5 + 5};
-
- printf("%" PRIu8 " %" PRId8 " %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %.0Lf %#lx "
- "%" PRIu8 " %" PRId8 " %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %.0Lf %#lx "
- "%" PRIu8 " %" PRId8 " %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %.0Lf %#lx "
- "%" PRIu8 " %" PRId8 " %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %.0Lf %#lx %" PRIu8 " %" PRId8 ": "
- "%" PRIu8 " %" PRId8 " %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %.0Lf %#lx "
- "%" PRIu8 " %" PRId8 " %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %.0Lf %#lx "
- "%" PRIu8 " %" PRId8 " %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %.0Lf %#lx "
- "%" PRIu8 " %" PRId8 " %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %.0Lf %#lx %" PRIu8 " %" PRId8 "\n",
- ui8_1, si8_1, ui16_1, si16_1, ui32_1, si32_1, ui64_1, si64_1, f_1, d_1, ld_1, (unsigned long)p_1,
- ui8_2, si8_2, ui16_2, si16_2, ui32_2, si32_2, ui64_2, si64_2, f_2, d_2, ld_2, (unsigned long)p_2,
- ui8_3, si8_3, ui16_3, si16_3, ui32_3, si32_3, ui64_3, si64_3, f_3, d_3, ld_3, (unsigned long)p_3,
- ui8_4, si8_4, ui16_4, si16_4, ui32_4, si32_4, ui64_4, si64_4, f_4, d_4, ld_4, (unsigned long)p_4, ui8_5, si8_5,
- retVal.a, retVal.b, retVal.c, retVal.d, retVal.e, retVal.f,
- retVal.g, retVal.h, retVal.i, retVal.j, retVal.k, (unsigned long)retVal.l,
- retVal.m, retVal.n, retVal.o, retVal.p, retVal.q, retVal.r,
- retVal.s, retVal.t, retVal.u, retVal.v, retVal.w, (unsigned long)retVal.x,
- retVal.y, retVal.z, retVal.aa, retVal.bb, retVal.cc, retVal.dd,
- retVal.ee, retVal.ff, retVal.gg, retVal.hh, retVal.ii, (unsigned long)retVal.jj,
- retVal.kk, retVal.ll, retVal.mm, retVal.nn, retVal.oo, retVal.pp,
- retVal.qq, retVal.rr, retVal.ss, retVal.tt, retVal.uu, (unsigned long)retVal.vv, retVal.ww, retVal.xx);
-
- return retVal;
-}
-
-static void
-cls_large_fn(ffi_cif* cif __UNUSED__, void* resp, void** args, void* userdata __UNUSED__)
-{
- uint8_t ui8_1 = *(uint8_t*)args[0];
- int8_t si8_1 = *(int8_t*)args[1];
- uint16_t ui16_1 = *(uint16_t*)args[2];
- int16_t si16_1 = *(int16_t*)args[3];
- uint32_t ui32_1 = *(uint32_t*)args[4];
- int32_t si32_1 = *(int32_t*)args[5];
- uint64_t ui64_1 = *(uint64_t*)args[6];
- int64_t si64_1 = *(int64_t*)args[7];
- float f_1 = *(float*)args[8];
- double d_1 = *(double*)args[9];
- long double ld_1 = *(long double*)args[10];
- char* p_1 = *(char**)args[11];
- uint8_t ui8_2 = *(uint8_t*)args[12];
- int8_t si8_2 = *(int8_t*)args[13];
- uint16_t ui16_2 = *(uint16_t*)args[14];
- int16_t si16_2 = *(int16_t*)args[15];
- uint32_t ui32_2 = *(uint32_t*)args[16];
- int32_t si32_2 = *(int32_t*)args[17];
- uint64_t ui64_2 = *(uint64_t*)args[18];
- int64_t si64_2 = *(int64_t*)args[19];
- float f_2 = *(float*)args[20];
- double d_2 = *(double*)args[21];
- long double ld_2 = *(long double*)args[22];
- char* p_2 = *(char**)args[23];
- uint8_t ui8_3 = *(uint8_t*)args[24];
- int8_t si8_3 = *(int8_t*)args[25];
- uint16_t ui16_3 = *(uint16_t*)args[26];
- int16_t si16_3 = *(int16_t*)args[27];
- uint32_t ui32_3 = *(uint32_t*)args[28];
- int32_t si32_3 = *(int32_t*)args[29];
- uint64_t ui64_3 = *(uint64_t*)args[30];
- int64_t si64_3 = *(int64_t*)args[31];
- float f_3 = *(float*)args[32];
- double d_3 = *(double*)args[33];
- long double ld_3 = *(long double*)args[34];
- char* p_3 = *(char**)args[35];
- uint8_t ui8_4 = *(uint8_t*)args[36];
- int8_t si8_4 = *(int8_t*)args[37];
- uint16_t ui16_4 = *(uint16_t*)args[38];
- int16_t si16_4 = *(int16_t*)args[39];
- uint32_t ui32_4 = *(uint32_t*)args[40];
- int32_t si32_4 = *(int32_t*)args[41];
- uint64_t ui64_4 = *(uint64_t*)args[42];
- int64_t si64_4 = *(int64_t*)args[43];
- float f_4 = *(float*)args[44];
- double d_4 = *(double*)args[45];
- long double ld_4 = *(long double*)args[46];
- char* p_4 = *(char**)args[47];
- uint8_t ui8_5 = *(uint8_t*)args[48];
- int8_t si8_5 = *(int8_t*)args[49];
-
- *(BigStruct*)resp = test_large_fn(
- ui8_1, si8_1, ui16_1, si16_1, ui32_1, si32_1, ui64_1, si64_1, f_1, d_1, ld_1, p_1,
- ui8_2, si8_2, ui16_2, si16_2, ui32_2, si32_2, ui64_2, si64_2, f_2, d_2, ld_2, p_2,
- ui8_3, si8_3, ui16_3, si16_3, ui32_3, si32_3, ui64_3, si64_3, f_3, d_3, ld_3, p_3,
- ui8_4, si8_4, ui16_4, si16_4, ui32_4, si32_4, ui64_4, si64_4, f_4, d_4, ld_4, p_4,
- ui8_5, si8_5);
-}
-
-int
-main(int argc __UNUSED__, const char** argv __UNUSED__)
-{
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
-
- ffi_cif cif;
- ffi_type* argTypes[51];
- void* argValues[51];
-
- ffi_type ret_struct_type;
- ffi_type* st_fields[51];
- BigStruct retVal;
-
- uint8_t ui8 = 1;
- int8_t si8 = 2;
- uint16_t ui16 = 3;
- int16_t si16 = 4;
- uint32_t ui32 = 5;
- int32_t si32 = 6;
- uint64_t ui64 = 7;
- int64_t si64 = 8;
- float f = 9;
- double d = 10;
- long double ld = 11;
- char* p = (char*)0x12345678;
-
- memset (&retVal, 0, sizeof(retVal));
-
- ret_struct_type.size = 0;
- ret_struct_type.alignment = 0;
- ret_struct_type.type = FFI_TYPE_STRUCT;
- ret_struct_type.elements = st_fields;
-
- st_fields[0] = st_fields[12] = st_fields[24] = st_fields[36] = st_fields[48] = &ffi_type_uint8;
- st_fields[1] = st_fields[13] = st_fields[25] = st_fields[37] = st_fields[49] = &ffi_type_sint8;
- st_fields[2] = st_fields[14] = st_fields[26] = st_fields[38] = &ffi_type_uint16;
- st_fields[3] = st_fields[15] = st_fields[27] = st_fields[39] = &ffi_type_sint16;
- st_fields[4] = st_fields[16] = st_fields[28] = st_fields[40] = &ffi_type_uint32;
- st_fields[5] = st_fields[17] = st_fields[29] = st_fields[41] = &ffi_type_sint32;
- st_fields[6] = st_fields[18] = st_fields[30] = st_fields[42] = &ffi_type_uint64;
- st_fields[7] = st_fields[19] = st_fields[31] = st_fields[43] = &ffi_type_sint64;
- st_fields[8] = st_fields[20] = st_fields[32] = st_fields[44] = &ffi_type_float;
- st_fields[9] = st_fields[21] = st_fields[33] = st_fields[45] = &ffi_type_double;
- st_fields[10] = st_fields[22] = st_fields[34] = st_fields[46] = &ffi_type_longdouble;
- st_fields[11] = st_fields[23] = st_fields[35] = st_fields[47] = &ffi_type_pointer;
-
- st_fields[50] = NULL;
-
- argTypes[0] = argTypes[12] = argTypes[24] = argTypes[36] = argTypes[48] = &ffi_type_uint8;
- argValues[0] = argValues[12] = argValues[24] = argValues[36] = argValues[48] = &ui8;
- argTypes[1] = argTypes[13] = argTypes[25] = argTypes[37] = argTypes[49] = &ffi_type_sint8;
- argValues[1] = argValues[13] = argValues[25] = argValues[37] = argValues[49] = &si8;
- argTypes[2] = argTypes[14] = argTypes[26] = argTypes[38] = &ffi_type_uint16;
- argValues[2] = argValues[14] = argValues[26] = argValues[38] = &ui16;
- argTypes[3] = argTypes[15] = argTypes[27] = argTypes[39] = &ffi_type_sint16;
- argValues[3] = argValues[15] = argValues[27] = argValues[39] = &si16;
- argTypes[4] = argTypes[16] = argTypes[28] = argTypes[40] = &ffi_type_uint32;
- argValues[4] = argValues[16] = argValues[28] = argValues[40] = &ui32;
- argTypes[5] = argTypes[17] = argTypes[29] = argTypes[41] = &ffi_type_sint32;
- argValues[5] = argValues[17] = argValues[29] = argValues[41] = &si32;
- argTypes[6] = argTypes[18] = argTypes[30] = argTypes[42] = &ffi_type_uint64;
- argValues[6] = argValues[18] = argValues[30] = argValues[42] = &ui64;
- argTypes[7] = argTypes[19] = argTypes[31] = argTypes[43] = &ffi_type_sint64;
- argValues[7] = argValues[19] = argValues[31] = argValues[43] = &si64;
- argTypes[8] = argTypes[20] = argTypes[32] = argTypes[44] = &ffi_type_float;
- argValues[8] = argValues[20] = argValues[32] = argValues[44] = &f;
- argTypes[9] = argTypes[21] = argTypes[33] = argTypes[45] = &ffi_type_double;
- argValues[9] = argValues[21] = argValues[33] = argValues[45] = &d;
- argTypes[10] = argTypes[22] = argTypes[34] = argTypes[46] = &ffi_type_longdouble;
- argValues[10] = argValues[22] = argValues[34] = argValues[46] = &ld;
- argTypes[11] = argTypes[23] = argTypes[35] = argTypes[47] = &ffi_type_pointer;
- argValues[11] = argValues[23] = argValues[35] = argValues[47] = &p;
-
- argTypes[50] = NULL;
- argValues[50] = NULL;
-
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 50, &ret_struct_type, argTypes) == FFI_OK);
-
- ffi_call(&cif, FFI_FN(test_large_fn), &retVal, argValues);
- /* { dg-output "1 2 3 4 5 6 7 8 9 10 11 0x12345678 1 2 3 4 5 6 7 8 9 10 11 0x12345678 1 2 3 4 5 6 7 8 9 10 11 0x12345678 1 2 3 4 5 6 7 8 9 10 11 0x12345678 1 2: 2 3 4 5 6 7 8 9 10 11 12 0x12345679 3 4 5 6 7 8 9 10 11 12 13 0x1234567a 4 5 6 7 8 9 10 11 12 13 14 0x1234567b 5 6 7 8 9 10 11 12 13 14 15 0x1234567c 6 7" } */
- printf("res: %" PRIu8 " %" PRId8 " %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %.0Lf %#lx "
- "%" PRIu8 " %" PRId8 " %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %.0Lf %#lx "
- "%" PRIu8 " %" PRId8 " %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %.0Lf %#lx "
- "%" PRIu8 " %" PRId8 " %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %.0Lf %#lx %" PRIu8 " %" PRId8 "\n",
- retVal.a, retVal.b, retVal.c, retVal.d, retVal.e, retVal.f,
- retVal.g, retVal.h, retVal.i, retVal.j, retVal.k, (unsigned long)retVal.l,
- retVal.m, retVal.n, retVal.o, retVal.p, retVal.q, retVal.r,
- retVal.s, retVal.t, retVal.u, retVal.v, retVal.w, (unsigned long)retVal.x,
- retVal.y, retVal.z, retVal.aa, retVal.bb, retVal.cc, retVal.dd,
- retVal.ee, retVal.ff, retVal.gg, retVal.hh, retVal.ii, (unsigned long)retVal.jj,
- retVal.kk, retVal.ll, retVal.mm, retVal.nn, retVal.oo, retVal.pp,
- retVal.qq, retVal.rr, retVal.ss, retVal.tt, retVal.uu, (unsigned long)retVal.vv, retVal.ww, retVal.xx);
- /* { dg-output "\nres: 2 3 4 5 6 7 8 9 10 11 12 0x12345679 3 4 5 6 7 8 9 10 11 12 13 0x1234567a 4 5 6 7 8 9 10 11 12 13 14 0x1234567b 5 6 7 8 9 10 11 12 13 14 15 0x1234567c 6 7" } */
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, cls_large_fn, NULL, code) == FFI_OK);
-
- retVal = ((BigStruct(*)(
- uint8_t, int8_t, uint16_t, int16_t, uint32_t, int32_t, uint64_t, int64_t, float, double, long double, char*,
- uint8_t, int8_t, uint16_t, int16_t, uint32_t, int32_t, uint64_t, int64_t, float, double, long double, char*,
- uint8_t, int8_t, uint16_t, int16_t, uint32_t, int32_t, uint64_t, int64_t, float, double, long double, char*,
- uint8_t, int8_t, uint16_t, int16_t, uint32_t, int32_t, uint64_t, int64_t, float, double, long double, char*,
- uint8_t, int8_t))(code))(
- ui8, si8, ui16, si16, ui32, si32, ui64, si64, f, d, ld, p,
- ui8, si8, ui16, si16, ui32, si32, ui64, si64, f, d, ld, p,
- ui8, si8, ui16, si16, ui32, si32, ui64, si64, f, d, ld, p,
- ui8, si8, ui16, si16, ui32, si32, ui64, si64, f, d, ld, p,
- ui8, si8);
- /* { dg-output "\n1 2 3 4 5 6 7 8 9 10 11 0x12345678 1 2 3 4 5 6 7 8 9 10 11 0x12345678 1 2 3 4 5 6 7 8 9 10 11 0x12345678 1 2 3 4 5 6 7 8 9 10 11 0x12345678 1 2: 2 3 4 5 6 7 8 9 10 11 12 0x12345679 3 4 5 6 7 8 9 10 11 12 13 0x1234567a 4 5 6 7 8 9 10 11 12 13 14 0x1234567b 5 6 7 8 9 10 11 12 13 14 15 0x1234567c 6 7" } */
- printf("res: %" PRIu8 " %" PRId8 " %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %.0Lf %#lx "
- "%" PRIu8 " %" PRId8 " %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %.0Lf %#lx "
- "%" PRIu8 " %" PRId8 " %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %.0Lf %#lx "
- "%" PRIu8 " %" PRId8 " %hu %hd %u %d %" PRIu64 " %" PRId64 " %.0f %.0f %.0Lf %#lx %" PRIu8 " %" PRId8 "\n",
- retVal.a, retVal.b, retVal.c, retVal.d, retVal.e, retVal.f,
- retVal.g, retVal.h, retVal.i, retVal.j, retVal.k, (unsigned long)retVal.l,
- retVal.m, retVal.n, retVal.o, retVal.p, retVal.q, retVal.r,
- retVal.s, retVal.t, retVal.u, retVal.v, retVal.w, (unsigned long)retVal.x,
- retVal.y, retVal.z, retVal.aa, retVal.bb, retVal.cc, retVal.dd,
- retVal.ee, retVal.ff, retVal.gg, retVal.hh, retVal.ii, (unsigned long)retVal.jj,
- retVal.kk, retVal.ll, retVal.mm, retVal.nn, retVal.oo, retVal.pp,
- retVal.qq, retVal.rr, retVal.ss, retVal.tt, retVal.uu, (unsigned long)retVal.vv, retVal.ww, retVal.xx);
- /* { dg-output "\nres: 2 3 4 5 6 7 8 9 10 11 12 0x12345679 3 4 5 6 7 8 9 10 11 12 13 0x1234567a 4 5 6 7 8 9 10 11 12 13 14 0x1234567b 5 6 7 8 9 10 11 12 13 14 15 0x1234567c 6 7" } */
-
- return 0;
-}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/many.c b/Modules/_ctypes/libffi/testsuite/libffi.call/many.c
deleted file mode 100644
index 336968c77a..0000000000
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/many.c
+++ /dev/null
@@ -1,59 +0,0 @@
-/* Area: ffi_call
- Purpose: Check return value float, with many arguments
- Limitations: none.
- PR: none.
- Originator: From the original ffitest.c */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-#include <stdlib.h>
-#include <float.h>
-#include <math.h>
-
-static float ABI_ATTR many(float f1, float f2, float f3, float f4, float f5, float f6, float f7, float f8, float f9, float f10, float f11, float f12, float f13)
-{
-#if 0
- printf("%f %f %f %f %f %f %f %f %f %f %f %f %f\n",
- (double) f1, (double) f2, (double) f3, (double) f4, (double) f5,
- (double) f6, (double) f7, (double) f8, (double) f9, (double) f10,
- (double) f11, (double) f12, (double) f13);
-#endif
-
- return f1+f2+f3+f4+f5+f6+f7+f8+f9+f10+f11+f12+f13;
-}
-
-int main (void)
-{
- ffi_cif cif;
- ffi_type *args[13];
- void *values[13];
- float fa[13];
- float f, ff;
- int i;
-
- for (i = 0; i < 13; i++)
- {
- args[i] = &ffi_type_float;
- values[i] = &fa[i];
- fa[i] = (float) i;
- }
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, ABI_NUM, 13,
- &ffi_type_float, args) == FFI_OK);
-
- ffi_call(&cif, FFI_FN(many), &f, values);
-
- ff = many(fa[0], fa[1],
- fa[2], fa[3],
- fa[4], fa[5],
- fa[6], fa[7],
- fa[8], fa[9],
- fa[10],fa[11],fa[12]);
-
- if (fabs(f - ff) < FLT_EPSILON)
- exit(0);
- else
- abort();
-}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/many2.c b/Modules/_ctypes/libffi/testsuite/libffi.call/many2.c
deleted file mode 100644
index 1c85746e4c..0000000000
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/many2.c
+++ /dev/null
@@ -1,57 +0,0 @@
-/* Area: ffi_call
- Purpose: Check uint8_t arguments.
- Limitations: none.
- PR: PR45677.
- Originator: Dan Witte <dwitte@gmail.com> 20100916 */
-
-/* { dg-do run } */
-
-#include "ffitest.h"
-
-#define NARGS 7
-
-typedef unsigned char u8;
-
-#ifdef __GNUC__
-__attribute__((noinline))
-#endif
-uint8_t
-foo (uint8_t a, uint8_t b, uint8_t c, uint8_t d,
- uint8_t e, uint8_t f, uint8_t g)
-{
- return a + b + c + d + e + f + g;
-}
-
-uint8_t ABI_ATTR
-bar (uint8_t a, uint8_t b, uint8_t c, uint8_t d,
- uint8_t e, uint8_t f, uint8_t g)
-{
- return foo (a, b, c, d, e, f, g);
-}
-
-int
-main (void)
-{
- ffi_type *ffitypes[NARGS];
- int i;
- ffi_cif cif;
- ffi_arg result = 0;
- uint8_t args[NARGS];
- void *argptrs[NARGS];
-
- for (i = 0; i < NARGS; ++i)
- ffitypes[i] = &ffi_type_uint8;
-
- CHECK (ffi_prep_cif (&cif, ABI_NUM, NARGS,
- &ffi_type_uint8, ffitypes) == FFI_OK);
-
- for (i = 0; i < NARGS; ++i)
- {
- args[i] = i;
- argptrs[i] = &args[i];
- }
- ffi_call (&cif, FFI_FN (bar), &result, argptrs);
-
- CHECK (result == 21);
- return 0;
-}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/negint.c b/Modules/_ctypes/libffi/testsuite/libffi.call/negint.c
deleted file mode 100644
index 6e2f26fc10..0000000000
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/negint.c
+++ /dev/null
@@ -1,52 +0,0 @@
-/* Area: ffi_call
- Purpose: Check that negative integers are passed correctly.
- Limitations: none.
- PR: none.
- Originator: From the original ffitest.c */
-
-/* { dg-do run } */
-
-#include "ffitest.h"
-
-static int checking(int a, short b, signed char c)
-{
-
- return (a < 0 && b < 0 && c < 0);
-}
-
-int main (void)
-{
- ffi_cif cif;
- ffi_type *args[MAX_ARGS];
- void *values[MAX_ARGS];
- ffi_arg rint;
-
- signed int si;
- signed short ss;
- signed char sc;
-
- args[0] = &ffi_type_sint;
- values[0] = &si;
- args[1] = &ffi_type_sshort;
- values[1] = &ss;
- args[2] = &ffi_type_schar;
- values[2] = &sc;
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 3,
- &ffi_type_sint, args) == FFI_OK);
-
- si = -6;
- ss = -12;
- sc = -1;
-
- checking (si, ss, sc);
-
- ffi_call(&cif, FFI_FN(checking), &rint, values);
-
- printf ("%d vs %d\n", (int)rint, checking (si, ss, sc));
-
- CHECK(rint != 0);
-
- exit (0);
-}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/nested_struct.c b/Modules/_ctypes/libffi/testsuite/libffi.call/nested_struct.c
deleted file mode 100644
index c15e3a0338..0000000000
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/nested_struct.c
+++ /dev/null
@@ -1,152 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Check structure passing with different structure size.
- Contains structs as parameter of the struct itself.
- Limitations: none.
- PR: none.
- Originator: <andreast@gcc.gnu.org> 20030828 */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-typedef struct cls_struct_16byte1 {
- double a;
- float b;
- int c;
-} cls_struct_16byte1;
-
-typedef struct cls_struct_16byte2 {
- int ii;
- double dd;
- float ff;
-} cls_struct_16byte2;
-
-typedef struct cls_struct_combined {
- cls_struct_16byte1 d;
- cls_struct_16byte2 e;
-} cls_struct_combined;
-
-cls_struct_combined cls_struct_combined_fn(struct cls_struct_16byte1 b0,
- struct cls_struct_16byte2 b1,
- struct cls_struct_combined b2)
-{
- struct cls_struct_combined result;
-
- result.d.a = b0.a + b1.dd + b2.d.a;
- result.d.b = b0.b + b1.ff + b2.d.b;
- result.d.c = b0.c + b1.ii + b2.d.c;
- result.e.ii = b0.c + b1.ii + b2.e.ii;
- result.e.dd = b0.a + b1.dd + b2.e.dd;
- result.e.ff = b0.b + b1.ff + b2.e.ff;
-
- printf("%g %g %d %d %g %g %g %g %d %d %g %g: %g %g %d %d %g %g\n",
- b0.a, b0.b, b0.c,
- b1.ii, b1.dd, b1.ff,
- b2.d.a, b2.d.b, b2.d.c,
- b2.e.ii, b2.e.dd, b2.e.ff,
- result.d.a, result.d.b, result.d.c,
- result.e.ii, result.e.dd, result.e.ff);
-
- return result;
-}
-
-static void
-cls_struct_combined_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
- void* userdata __UNUSED__)
-{
- struct cls_struct_16byte1 b0;
- struct cls_struct_16byte2 b1;
- struct cls_struct_combined b2;
-
- b0 = *(struct cls_struct_16byte1*)(args[0]);
- b1 = *(struct cls_struct_16byte2*)(args[1]);
- b2 = *(struct cls_struct_combined*)(args[2]);
-
-
- *(cls_struct_combined*)resp = cls_struct_combined_fn(b0, b1, b2);
-}
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- void* args_dbl[5];
- ffi_type* cls_struct_fields[5];
- ffi_type* cls_struct_fields1[5];
- ffi_type* cls_struct_fields2[5];
- ffi_type cls_struct_type, cls_struct_type1, cls_struct_type2;
- ffi_type* dbl_arg_types[5];
-
- struct cls_struct_16byte1 e_dbl = { 9.0, 2.0, 6};
- struct cls_struct_16byte2 f_dbl = { 1, 2.0, 3.0};
- struct cls_struct_combined g_dbl = {{4.0, 5.0, 6},
- {3, 1.0, 8.0}};
- struct cls_struct_combined res_dbl;
-
- cls_struct_type.size = 0;
- cls_struct_type.alignment = 0;
- cls_struct_type.type = FFI_TYPE_STRUCT;
- cls_struct_type.elements = cls_struct_fields;
-
- cls_struct_type1.size = 0;
- cls_struct_type1.alignment = 0;
- cls_struct_type1.type = FFI_TYPE_STRUCT;
- cls_struct_type1.elements = cls_struct_fields1;
-
- cls_struct_type2.size = 0;
- cls_struct_type2.alignment = 0;
- cls_struct_type2.type = FFI_TYPE_STRUCT;
- cls_struct_type2.elements = cls_struct_fields2;
-
- cls_struct_fields[0] = &ffi_type_double;
- cls_struct_fields[1] = &ffi_type_float;
- cls_struct_fields[2] = &ffi_type_sint;
- cls_struct_fields[3] = NULL;
-
- cls_struct_fields1[0] = &ffi_type_sint;
- cls_struct_fields1[1] = &ffi_type_double;
- cls_struct_fields1[2] = &ffi_type_float;
- cls_struct_fields1[3] = NULL;
-
- cls_struct_fields2[0] = &cls_struct_type;
- cls_struct_fields2[1] = &cls_struct_type1;
- cls_struct_fields2[2] = NULL;
-
-
- dbl_arg_types[0] = &cls_struct_type;
- dbl_arg_types[1] = &cls_struct_type1;
- dbl_arg_types[2] = &cls_struct_type2;
- dbl_arg_types[3] = NULL;
-
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 3, &cls_struct_type2,
- dbl_arg_types) == FFI_OK);
-
- args_dbl[0] = &e_dbl;
- args_dbl[1] = &f_dbl;
- args_dbl[2] = &g_dbl;
- args_dbl[3] = NULL;
-
- ffi_call(&cif, FFI_FN(cls_struct_combined_fn), &res_dbl, args_dbl);
- /* { dg-output "9 2 6 1 2 3 4 5 6 3 1 8: 15 10 13 10 12 13" } */
- CHECK( res_dbl.d.a == (e_dbl.a + f_dbl.dd + g_dbl.d.a));
- CHECK( res_dbl.d.b == (e_dbl.b + f_dbl.ff + g_dbl.d.b));
- CHECK( res_dbl.d.c == (e_dbl.c + f_dbl.ii + g_dbl.d.c));
- CHECK( res_dbl.e.ii == (e_dbl.c + f_dbl.ii + g_dbl.e.ii));
- CHECK( res_dbl.e.dd == (e_dbl.a + f_dbl.dd + g_dbl.e.dd));
- CHECK( res_dbl.e.ff == (e_dbl.b + f_dbl.ff + g_dbl.e.ff));
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_combined_gn, NULL, code) == FFI_OK);
-
- res_dbl = ((cls_struct_combined(*)(cls_struct_16byte1,
- cls_struct_16byte2,
- cls_struct_combined))
- (code))(e_dbl, f_dbl, g_dbl);
- /* { dg-output "\n9 2 6 1 2 3 4 5 6 3 1 8: 15 10 13 10 12 13" } */
- CHECK( res_dbl.d.a == (e_dbl.a + f_dbl.dd + g_dbl.d.a));
- CHECK( res_dbl.d.b == (e_dbl.b + f_dbl.ff + g_dbl.d.b));
- CHECK( res_dbl.d.c == (e_dbl.c + f_dbl.ii + g_dbl.d.c));
- CHECK( res_dbl.e.ii == (e_dbl.c + f_dbl.ii + g_dbl.e.ii));
- CHECK( res_dbl.e.dd == (e_dbl.a + f_dbl.dd + g_dbl.e.dd));
- CHECK( res_dbl.e.ff == (e_dbl.b + f_dbl.ff + g_dbl.e.ff));
- exit(0);
-}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/nested_struct1.c b/Modules/_ctypes/libffi/testsuite/libffi.call/nested_struct1.c
deleted file mode 100644
index 477a6b9bde..0000000000
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/nested_struct1.c
+++ /dev/null
@@ -1,161 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Check structure passing with different structure size.
- Contains structs as parameter of the struct itself.
- Limitations: none.
- PR: none.
- Originator: <andreast@gcc.gnu.org> 20030828 */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-typedef struct cls_struct_16byte1 {
- double a;
- float b;
- int c;
-} cls_struct_16byte1;
-
-typedef struct cls_struct_16byte2 {
- int ii;
- double dd;
- float ff;
-} cls_struct_16byte2;
-
-typedef struct cls_struct_combined {
- cls_struct_16byte1 d;
- cls_struct_16byte2 e;
-} cls_struct_combined;
-
-cls_struct_combined cls_struct_combined_fn(struct cls_struct_16byte1 b0,
- struct cls_struct_16byte2 b1,
- struct cls_struct_combined b2,
- struct cls_struct_16byte1 b3)
-{
- struct cls_struct_combined result;
-
- result.d.a = b0.a + b1.dd + b2.d.a;
- result.d.b = b0.b + b1.ff + b2.d.b;
- result.d.c = b0.c + b1.ii + b2.d.c;
- result.e.ii = b0.c + b1.ii + b2.e.ii;
- result.e.dd = b0.a + b1.dd + b2.e.dd;
- result.e.ff = b0.b + b1.ff + b2.e.ff;
-
- printf("%g %g %d %d %g %g %g %g %d %d %g %g %g %g %d: %g %g %d %d %g %g\n",
- b0.a, b0.b, b0.c,
- b1.ii, b1.dd, b1.ff,
- b2.d.a, b2.d.b, b2.d.c,
- b2.e.ii, b2.e.dd, b2.e.ff,
- b3.a, b3.b, b3.c,
- result.d.a, result.d.b, result.d.c,
- result.e.ii, result.e.dd, result.e.ff);
-
- return result;
-}
-
-static void
-cls_struct_combined_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
- void* userdata __UNUSED__)
-{
- struct cls_struct_16byte1 b0;
- struct cls_struct_16byte2 b1;
- struct cls_struct_combined b2;
- struct cls_struct_16byte1 b3;
-
- b0 = *(struct cls_struct_16byte1*)(args[0]);
- b1 = *(struct cls_struct_16byte2*)(args[1]);
- b2 = *(struct cls_struct_combined*)(args[2]);
- b3 = *(struct cls_struct_16byte1*)(args[3]);
-
-
- *(cls_struct_combined*)resp = cls_struct_combined_fn(b0, b1, b2, b3);
-}
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- void* args_dbl[5];
- ffi_type* cls_struct_fields[5];
- ffi_type* cls_struct_fields1[5];
- ffi_type* cls_struct_fields2[5];
- ffi_type cls_struct_type, cls_struct_type1, cls_struct_type2;
- ffi_type* dbl_arg_types[5];
-
- struct cls_struct_16byte1 e_dbl = { 9.0, 2.0, 6};
- struct cls_struct_16byte2 f_dbl = { 1, 2.0, 3.0};
- struct cls_struct_combined g_dbl = {{4.0, 5.0, 6},
- {3, 1.0, 8.0}};
- struct cls_struct_16byte1 h_dbl = { 3.0, 2.0, 4};
- struct cls_struct_combined res_dbl;
-
- cls_struct_type.size = 0;
- cls_struct_type.alignment = 0;
- cls_struct_type.type = FFI_TYPE_STRUCT;
- cls_struct_type.elements = cls_struct_fields;
-
- cls_struct_type1.size = 0;
- cls_struct_type1.alignment = 0;
- cls_struct_type1.type = FFI_TYPE_STRUCT;
- cls_struct_type1.elements = cls_struct_fields1;
-
- cls_struct_type2.size = 0;
- cls_struct_type2.alignment = 0;
- cls_struct_type2.type = FFI_TYPE_STRUCT;
- cls_struct_type2.elements = cls_struct_fields2;
-
- cls_struct_fields[0] = &ffi_type_double;
- cls_struct_fields[1] = &ffi_type_float;
- cls_struct_fields[2] = &ffi_type_sint;
- cls_struct_fields[3] = NULL;
-
- cls_struct_fields1[0] = &ffi_type_sint;
- cls_struct_fields1[1] = &ffi_type_double;
- cls_struct_fields1[2] = &ffi_type_float;
- cls_struct_fields1[3] = NULL;
-
- cls_struct_fields2[0] = &cls_struct_type;
- cls_struct_fields2[1] = &cls_struct_type1;
- cls_struct_fields2[2] = NULL;
-
-
- dbl_arg_types[0] = &cls_struct_type;
- dbl_arg_types[1] = &cls_struct_type1;
- dbl_arg_types[2] = &cls_struct_type2;
- dbl_arg_types[3] = &cls_struct_type;
- dbl_arg_types[4] = NULL;
-
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 4, &cls_struct_type2,
- dbl_arg_types) == FFI_OK);
-
- args_dbl[0] = &e_dbl;
- args_dbl[1] = &f_dbl;
- args_dbl[2] = &g_dbl;
- args_dbl[3] = &h_dbl;
- args_dbl[4] = NULL;
-
- ffi_call(&cif, FFI_FN(cls_struct_combined_fn), &res_dbl, args_dbl);
- /* { dg-output "9 2 6 1 2 3 4 5 6 3 1 8 3 2 4: 15 10 13 10 12 13" } */
- CHECK( res_dbl.d.a == (e_dbl.a + f_dbl.dd + g_dbl.d.a));
- CHECK( res_dbl.d.b == (e_dbl.b + f_dbl.ff + g_dbl.d.b));
- CHECK( res_dbl.d.c == (e_dbl.c + f_dbl.ii + g_dbl.d.c));
- CHECK( res_dbl.e.ii == (e_dbl.c + f_dbl.ii + g_dbl.e.ii));
- CHECK( res_dbl.e.dd == (e_dbl.a + f_dbl.dd + g_dbl.e.dd));
- CHECK( res_dbl.e.ff == (e_dbl.b + f_dbl.ff + g_dbl.e.ff));
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_combined_gn, NULL, code) == FFI_OK);
-
- res_dbl = ((cls_struct_combined(*)(cls_struct_16byte1,
- cls_struct_16byte2,
- cls_struct_combined,
- cls_struct_16byte1))
- (code))(e_dbl, f_dbl, g_dbl, h_dbl);
- /* { dg-output "\n9 2 6 1 2 3 4 5 6 3 1 8 3 2 4: 15 10 13 10 12 13" } */
- CHECK( res_dbl.d.a == (e_dbl.a + f_dbl.dd + g_dbl.d.a));
- CHECK( res_dbl.d.b == (e_dbl.b + f_dbl.ff + g_dbl.d.b));
- CHECK( res_dbl.d.c == (e_dbl.c + f_dbl.ii + g_dbl.d.c));
- CHECK( res_dbl.e.ii == (e_dbl.c + f_dbl.ii + g_dbl.e.ii));
- CHECK( res_dbl.e.dd == (e_dbl.a + f_dbl.dd + g_dbl.e.dd));
- CHECK( res_dbl.e.ff == (e_dbl.b + f_dbl.ff + g_dbl.e.ff));
- /* CHECK( 1 == 0); */
- exit(0);
-}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/nested_struct10.c b/Modules/_ctypes/libffi/testsuite/libffi.call/nested_struct10.c
deleted file mode 100644
index 34a74e7187..0000000000
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/nested_struct10.c
+++ /dev/null
@@ -1,133 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Check structure passing with different structure size.
- Contains structs as parameter of the struct itself.
- Sample taken from Alan Modras patch to src/prep_cif.c.
- Limitations: none.
- PR: none.
- Originator: <andreast@gcc.gnu.org> 20051010 */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-typedef struct A {
- unsigned long long a;
- unsigned char b;
-} A;
-
-typedef struct B {
- unsigned char y;
- struct A x;
- unsigned int z;
-} B;
-
-typedef struct C {
- unsigned long long d;
- unsigned char e;
-} C;
-
-static B B_fn(struct A b2, struct B b3, struct C b4)
-{
- struct B result;
-
- result.x.a = b2.a + b3.x.a + b3.z + b4.d;
- result.x.b = b2.b + b3.x.b + b3.y + b4.e;
- result.y = b2.b + b3.x.b + b4.e;
-
- printf("%d %d %d %d %d %d %d %d: %d %d %d\n", (int)b2.a, b2.b,
- (int)b3.x.a, b3.x.b, b3.y, b3.z, (int)b4.d, b4.e,
- (int)result.x.a, result.x.b, result.y);
-
- return result;
-}
-
-static void
-B_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
- void* userdata __UNUSED__)
-{
- struct A b0;
- struct B b1;
- struct C b2;
-
- b0 = *(struct A*)(args[0]);
- b1 = *(struct B*)(args[1]);
- b2 = *(struct C*)(args[2]);
-
- *(B*)resp = B_fn(b0, b1, b2);
-}
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- void* args_dbl[4];
- ffi_type* cls_struct_fields[3];
- ffi_type* cls_struct_fields1[4];
- ffi_type* cls_struct_fields2[3];
- ffi_type cls_struct_type, cls_struct_type1, cls_struct_type2;
- ffi_type* dbl_arg_types[4];
-
- struct A e_dbl = { 1LL, 7};
- struct B f_dbl = { 99, {12LL , 127}, 255};
- struct C g_dbl = { 2LL, 9};
-
- struct B res_dbl;
-
- cls_struct_type.size = 0;
- cls_struct_type.alignment = 0;
- cls_struct_type.type = FFI_TYPE_STRUCT;
- cls_struct_type.elements = cls_struct_fields;
-
- cls_struct_type1.size = 0;
- cls_struct_type1.alignment = 0;
- cls_struct_type1.type = FFI_TYPE_STRUCT;
- cls_struct_type1.elements = cls_struct_fields1;
-
- cls_struct_type2.size = 0;
- cls_struct_type2.alignment = 0;
- cls_struct_type2.type = FFI_TYPE_STRUCT;
- cls_struct_type2.elements = cls_struct_fields2;
-
- cls_struct_fields[0] = &ffi_type_uint64;
- cls_struct_fields[1] = &ffi_type_uchar;
- cls_struct_fields[2] = NULL;
-
- cls_struct_fields1[0] = &ffi_type_uchar;
- cls_struct_fields1[1] = &cls_struct_type;
- cls_struct_fields1[2] = &ffi_type_uint;
- cls_struct_fields1[3] = NULL;
-
- cls_struct_fields2[0] = &ffi_type_uint64;
- cls_struct_fields2[1] = &ffi_type_uchar;
- cls_struct_fields2[2] = NULL;
-
-
- dbl_arg_types[0] = &cls_struct_type;
- dbl_arg_types[1] = &cls_struct_type1;
- dbl_arg_types[2] = &cls_struct_type2;
- dbl_arg_types[3] = NULL;
-
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 3, &cls_struct_type1,
- dbl_arg_types) == FFI_OK);
-
- args_dbl[0] = &e_dbl;
- args_dbl[1] = &f_dbl;
- args_dbl[2] = &g_dbl;
- args_dbl[3] = NULL;
-
- ffi_call(&cif, FFI_FN(B_fn), &res_dbl, args_dbl);
- /* { dg-output "1 7 12 127 99 255 2 9: 270 242 143" } */
- CHECK( res_dbl.x.a == (e_dbl.a + f_dbl.x.a + f_dbl.z + g_dbl.d));
- CHECK( res_dbl.x.b == (e_dbl.b + f_dbl.x.b + f_dbl.y + g_dbl.e));
- CHECK( res_dbl.y == (e_dbl.b + f_dbl.x.b + g_dbl.e));
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, B_gn, NULL, code) == FFI_OK);
-
- res_dbl = ((B(*)(A, B, C))(code))(e_dbl, f_dbl, g_dbl);
- /* { dg-output "\n1 7 12 127 99 255 2 9: 270 242 143" } */
- CHECK( res_dbl.x.a == (e_dbl.a + f_dbl.x.a + f_dbl.z + g_dbl.d));
- CHECK( res_dbl.x.b == (e_dbl.b + f_dbl.x.b + f_dbl.y + g_dbl.e));
- CHECK( res_dbl.y == (e_dbl.b + f_dbl.x.b + g_dbl.e));
-
- exit(0);
-}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/nested_struct11.c b/Modules/_ctypes/libffi/testsuite/libffi.call/nested_struct11.c
deleted file mode 100644
index 351049382c..0000000000
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/nested_struct11.c
+++ /dev/null
@@ -1,121 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Check parameter passing with nested structs
- of a single type. This tests the special cases
- for homogeneous floating-point aggregates in the
- AArch64 PCS.
- Limitations: none.
- PR: none.
- Originator: ARM Ltd. */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-typedef struct A {
- float a_x;
- float a_y;
-} A;
-
-typedef struct B {
- float b_x;
- float b_y;
-} B;
-
-typedef struct C {
- A a;
- B b;
-} C;
-
-static C C_fn (int x, int y, int z, C source, int i, int j, int k)
-{
- C result;
- result.a.a_x = source.a.a_x;
- result.a.a_y = source.a.a_y;
- result.b.b_x = source.b.b_x;
- result.b.b_y = source.b.b_y;
-
- printf ("%d, %d, %d, %d, %d, %d\n", x, y, z, i, j, k);
-
- printf ("%.1f, %.1f, %.1f, %.1f, "
- "%.1f, %.1f, %.1f, %.1f\n",
- source.a.a_x, source.a.a_y,
- source.b.b_x, source.b.b_y,
- result.a.a_x, result.a.a_y,
- result.b.b_x, result.b.b_y);
-
- return result;
-}
-
-int main (void)
-{
- ffi_cif cif;
-
- ffi_type* struct_fields_source_a[3];
- ffi_type* struct_fields_source_b[3];
- ffi_type* struct_fields_source_c[3];
- ffi_type* arg_types[8];
-
- ffi_type struct_type_a, struct_type_b, struct_type_c;
-
- struct A source_fld_a = {1.0, 2.0};
- struct B source_fld_b = {4.0, 8.0};
- int k = 1;
-
- struct C result;
- struct C source = {source_fld_a, source_fld_b};
-
- struct_type_a.size = 0;
- struct_type_a.alignment = 0;
- struct_type_a.type = FFI_TYPE_STRUCT;
- struct_type_a.elements = struct_fields_source_a;
-
- struct_type_b.size = 0;
- struct_type_b.alignment = 0;
- struct_type_b.type = FFI_TYPE_STRUCT;
- struct_type_b.elements = struct_fields_source_b;
-
- struct_type_c.size = 0;
- struct_type_c.alignment = 0;
- struct_type_c.type = FFI_TYPE_STRUCT;
- struct_type_c.elements = struct_fields_source_c;
-
- struct_fields_source_a[0] = &ffi_type_float;
- struct_fields_source_a[1] = &ffi_type_float;
- struct_fields_source_a[2] = NULL;
-
- struct_fields_source_b[0] = &ffi_type_float;
- struct_fields_source_b[1] = &ffi_type_float;
- struct_fields_source_b[2] = NULL;
-
- struct_fields_source_c[0] = &struct_type_a;
- struct_fields_source_c[1] = &struct_type_b;
- struct_fields_source_c[2] = NULL;
-
- arg_types[0] = &ffi_type_sint32;
- arg_types[1] = &ffi_type_sint32;
- arg_types[2] = &ffi_type_sint32;
- arg_types[3] = &struct_type_c;
- arg_types[4] = &ffi_type_sint32;
- arg_types[5] = &ffi_type_sint32;
- arg_types[6] = &ffi_type_sint32;
- arg_types[7] = NULL;
-
- void *args[7];
- args[0] = &k;
- args[1] = &k;
- args[2] = &k;
- args[3] = &source;
- args[4] = &k;
- args[5] = &k;
- args[6] = &k;
- CHECK (ffi_prep_cif (&cif, FFI_DEFAULT_ABI, 7, &struct_type_c,
- arg_types) == FFI_OK);
-
- ffi_call (&cif, FFI_FN (C_fn), &result, args);
- /* { dg-output "1, 1, 1, 1, 1, 1\n" } */
- /* { dg-output "1.0, 2.0, 4.0, 8.0, 1.0, 2.0, 4.0, 8.0" } */
- CHECK (result.a.a_x == source.a.a_x);
- CHECK (result.a.a_y == source.a.a_y);
- CHECK (result.b.b_x == source.b.b_x);
- CHECK (result.b.b_y == source.b.b_y);
- exit (0);
-}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/nested_struct2.c b/Modules/_ctypes/libffi/testsuite/libffi.call/nested_struct2.c
deleted file mode 100644
index 69268cdb8a..0000000000
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/nested_struct2.c
+++ /dev/null
@@ -1,110 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Check structure passing with different structure size.
- Contains structs as parameter of the struct itself.
- Sample taken from Alan Modras patch to src/prep_cif.c.
- Limitations: none.
- PR: none.
- Originator: <andreast@gcc.gnu.org> 20030911 */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-typedef struct A {
- unsigned long a;
- unsigned char b;
-} A;
-
-typedef struct B {
- struct A x;
- unsigned char y;
-} B;
-
-B B_fn(struct A b0, struct B b1)
-{
- struct B result;
-
- result.x.a = b0.a + b1.x.a;
- result.x.b = b0.b + b1.x.b + b1.y;
- result.y = b0.b + b1.x.b;
-
- printf("%lu %d %lu %d %d: %lu %d %d\n", b0.a, b0.b, b1.x.a, b1.x.b, b1.y,
- result.x.a, result.x.b, result.y);
-
- return result;
-}
-
-static void
-B_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
- void* userdata __UNUSED__)
-{
- struct A b0;
- struct B b1;
-
- b0 = *(struct A*)(args[0]);
- b1 = *(struct B*)(args[1]);
-
- *(B*)resp = B_fn(b0, b1);
-}
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- void* args_dbl[3];
- ffi_type* cls_struct_fields[3];
- ffi_type* cls_struct_fields1[3];
- ffi_type cls_struct_type, cls_struct_type1;
- ffi_type* dbl_arg_types[3];
-
- struct A e_dbl = { 1, 7};
- struct B f_dbl = {{12 , 127}, 99};
-
- struct B res_dbl;
-
- cls_struct_type.size = 0;
- cls_struct_type.alignment = 0;
- cls_struct_type.type = FFI_TYPE_STRUCT;
- cls_struct_type.elements = cls_struct_fields;
-
- cls_struct_type1.size = 0;
- cls_struct_type1.alignment = 0;
- cls_struct_type1.type = FFI_TYPE_STRUCT;
- cls_struct_type1.elements = cls_struct_fields1;
-
- cls_struct_fields[0] = &ffi_type_ulong;
- cls_struct_fields[1] = &ffi_type_uchar;
- cls_struct_fields[2] = NULL;
-
- cls_struct_fields1[0] = &cls_struct_type;
- cls_struct_fields1[1] = &ffi_type_uchar;
- cls_struct_fields1[2] = NULL;
-
-
- dbl_arg_types[0] = &cls_struct_type;
- dbl_arg_types[1] = &cls_struct_type1;
- dbl_arg_types[2] = NULL;
-
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type1,
- dbl_arg_types) == FFI_OK);
-
- args_dbl[0] = &e_dbl;
- args_dbl[1] = &f_dbl;
- args_dbl[2] = NULL;
-
- ffi_call(&cif, FFI_FN(B_fn), &res_dbl, args_dbl);
- /* { dg-output "1 7 12 127 99: 13 233 134" } */
- CHECK( res_dbl.x.a == (e_dbl.a + f_dbl.x.a));
- CHECK( res_dbl.x.b == (e_dbl.b + f_dbl.x.b + f_dbl.y));
- CHECK( res_dbl.y == (e_dbl.b + f_dbl.x.b));
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, B_gn, NULL, code) == FFI_OK);
-
- res_dbl = ((B(*)(A, B))(code))(e_dbl, f_dbl);
- /* { dg-output "\n1 7 12 127 99: 13 233 134" } */
- CHECK( res_dbl.x.a == (e_dbl.a + f_dbl.x.a));
- CHECK( res_dbl.x.b == (e_dbl.b + f_dbl.x.b + f_dbl.y));
- CHECK( res_dbl.y == (e_dbl.b + f_dbl.x.b));
-
- exit(0);
-}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/nested_struct3.c b/Modules/_ctypes/libffi/testsuite/libffi.call/nested_struct3.c
deleted file mode 100644
index ab18cad733..0000000000
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/nested_struct3.c
+++ /dev/null
@@ -1,111 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Check structure passing with different structure size.
- Contains structs as parameter of the struct itself.
- Sample taken from Alan Modras patch to src/prep_cif.c.
- Limitations: none.
- PR: none.
- Originator: <andreast@gcc.gnu.org> 20030911 */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-typedef struct A {
- unsigned long long a;
- unsigned char b;
-} A;
-
-typedef struct B {
- struct A x;
- unsigned char y;
-} B;
-
-B B_fn(struct A b0, struct B b1)
-{
- struct B result;
-
- result.x.a = b0.a + b1.x.a;
- result.x.b = b0.b + b1.x.b + b1.y;
- result.y = b0.b + b1.x.b;
-
- printf("%d %d %d %d %d: %d %d %d\n", (int)b0.a, b0.b,
- (int)b1.x.a, b1.x.b, b1.y,
- (int)result.x.a, result.x.b, result.y);
-
- return result;
-}
-
-static void
-B_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
- void* userdata __UNUSED__)
-{
- struct A b0;
- struct B b1;
-
- b0 = *(struct A*)(args[0]);
- b1 = *(struct B*)(args[1]);
-
- *(B*)resp = B_fn(b0, b1);
-}
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- void* args_dbl[3];
- ffi_type* cls_struct_fields[3];
- ffi_type* cls_struct_fields1[3];
- ffi_type cls_struct_type, cls_struct_type1;
- ffi_type* dbl_arg_types[3];
-
- struct A e_dbl = { 1LL, 7};
- struct B f_dbl = {{12LL , 127}, 99};
-
- struct B res_dbl;
-
- cls_struct_type.size = 0;
- cls_struct_type.alignment = 0;
- cls_struct_type.type = FFI_TYPE_STRUCT;
- cls_struct_type.elements = cls_struct_fields;
-
- cls_struct_type1.size = 0;
- cls_struct_type1.alignment = 0;
- cls_struct_type1.type = FFI_TYPE_STRUCT;
- cls_struct_type1.elements = cls_struct_fields1;
-
- cls_struct_fields[0] = &ffi_type_uint64;
- cls_struct_fields[1] = &ffi_type_uchar;
- cls_struct_fields[2] = NULL;
-
- cls_struct_fields1[0] = &cls_struct_type;
- cls_struct_fields1[1] = &ffi_type_uchar;
- cls_struct_fields1[2] = NULL;
-
-
- dbl_arg_types[0] = &cls_struct_type;
- dbl_arg_types[1] = &cls_struct_type1;
- dbl_arg_types[2] = NULL;
-
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type1,
- dbl_arg_types) == FFI_OK);
-
- args_dbl[0] = &e_dbl;
- args_dbl[1] = &f_dbl;
- args_dbl[2] = NULL;
-
- ffi_call(&cif, FFI_FN(B_fn), &res_dbl, args_dbl);
- /* { dg-output "1 7 12 127 99: 13 233 134" } */
- CHECK( res_dbl.x.a == (e_dbl.a + f_dbl.x.a));
- CHECK( res_dbl.x.b == (e_dbl.b + f_dbl.x.b + f_dbl.y));
- CHECK( res_dbl.y == (e_dbl.b + f_dbl.x.b));
-
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, B_gn, NULL, code) == FFI_OK);
-
- res_dbl = ((B(*)(A, B))(code))(e_dbl, f_dbl);
- /* { dg-output "\n1 7 12 127 99: 13 233 134" } */
- CHECK( res_dbl.x.a == (e_dbl.a + f_dbl.x.a));
- CHECK( res_dbl.x.b == (e_dbl.b + f_dbl.x.b + f_dbl.y));
- CHECK( res_dbl.y == (e_dbl.b + f_dbl.x.b));
- exit(0);
-}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/nested_struct4.c b/Modules/_ctypes/libffi/testsuite/libffi.call/nested_struct4.c
deleted file mode 100644
index 2ffb4d65a0..0000000000
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/nested_struct4.c
+++ /dev/null
@@ -1,111 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Check structure passing with different structure size.
- Contains structs as parameter of the struct itself.
- Sample taken from Alan Modras patch to src/prep_cif.c.
- Limitations: none.
- PR: PR 25630.
- Originator: <andreast@gcc.gnu.org> 20051010 */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-typedef struct A {
- double a;
- unsigned char b;
-} A;
-
-typedef struct B {
- struct A x;
- unsigned char y;
-} B;
-
-static B B_fn(struct A b2, struct B b3)
-{
- struct B result;
-
- result.x.a = b2.a + b3.x.a;
- result.x.b = b2.b + b3.x.b + b3.y;
- result.y = b2.b + b3.x.b;
-
- printf("%d %d %d %d %d: %d %d %d\n", (int)b2.a, b2.b,
- (int)b3.x.a, b3.x.b, b3.y,
- (int)result.x.a, result.x.b, result.y);
-
- return result;
-}
-
-static void
-B_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
- void* userdata __UNUSED__)
-{
- struct A b0;
- struct B b1;
-
- b0 = *(struct A*)(args[0]);
- b1 = *(struct B*)(args[1]);
-
- *(B*)resp = B_fn(b0, b1);
-}
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- void* args_dbl[3];
- ffi_type* cls_struct_fields[3];
- ffi_type* cls_struct_fields1[3];
- ffi_type cls_struct_type, cls_struct_type1;
- ffi_type* dbl_arg_types[3];
-
- struct A e_dbl = { 1.0, 7};
- struct B f_dbl = {{12.0 , 127}, 99};
-
- struct B res_dbl;
-
- cls_struct_type.size = 0;
- cls_struct_type.alignment = 0;
- cls_struct_type.type = FFI_TYPE_STRUCT;
- cls_struct_type.elements = cls_struct_fields;
-
- cls_struct_type1.size = 0;
- cls_struct_type1.alignment = 0;
- cls_struct_type1.type = FFI_TYPE_STRUCT;
- cls_struct_type1.elements = cls_struct_fields1;
-
- cls_struct_fields[0] = &ffi_type_double;
- cls_struct_fields[1] = &ffi_type_uchar;
- cls_struct_fields[2] = NULL;
-
- cls_struct_fields1[0] = &cls_struct_type;
- cls_struct_fields1[1] = &ffi_type_uchar;
- cls_struct_fields1[2] = NULL;
-
-
- dbl_arg_types[0] = &cls_struct_type;
- dbl_arg_types[1] = &cls_struct_type1;
- dbl_arg_types[2] = NULL;
-
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type1,
- dbl_arg_types) == FFI_OK);
-
- args_dbl[0] = &e_dbl;
- args_dbl[1] = &f_dbl;
- args_dbl[2] = NULL;
-
- ffi_call(&cif, FFI_FN(B_fn), &res_dbl, args_dbl);
- /* { dg-output "1 7 12 127 99: 13 233 134" } */
- CHECK( res_dbl.x.a == (e_dbl.a + f_dbl.x.a));
- CHECK( res_dbl.x.b == (e_dbl.b + f_dbl.x.b + f_dbl.y));
- CHECK( res_dbl.y == (e_dbl.b + f_dbl.x.b));
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, B_gn, NULL, code) == FFI_OK);
-
- res_dbl = ((B(*)(A, B))(code))(e_dbl, f_dbl);
- /* { dg-output "\n1 7 12 127 99: 13 233 134" } */
- CHECK( res_dbl.x.a == (e_dbl.a + f_dbl.x.a));
- CHECK( res_dbl.x.b == (e_dbl.b + f_dbl.x.b + f_dbl.y));
- CHECK( res_dbl.y == (e_dbl.b + f_dbl.x.b));
-
- exit(0);
-}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/nested_struct5.c b/Modules/_ctypes/libffi/testsuite/libffi.call/nested_struct5.c
deleted file mode 100644
index 6c79845d98..0000000000
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/nested_struct5.c
+++ /dev/null
@@ -1,112 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Check structure passing with different structure size.
- Contains structs as parameter of the struct itself.
- Sample taken from Alan Modras patch to src/prep_cif.c.
- Limitations: none.
- PR: none.
- Originator: <andreast@gcc.gnu.org> 20051010 */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-typedef struct A {
- long double a;
- unsigned char b;
-} A;
-
-typedef struct B {
- struct A x;
- unsigned char y;
-} B;
-
-static B B_fn(struct A b2, struct B b3)
-{
- struct B result;
-
- result.x.a = b2.a + b3.x.a;
- result.x.b = b2.b + b3.x.b + b3.y;
- result.y = b2.b + b3.x.b;
-
- printf("%d %d %d %d %d: %d %d %d\n", (int)b2.a, b2.b,
- (int)b3.x.a, b3.x.b, b3.y,
- (int)result.x.a, result.x.b, result.y);
-
- return result;
-}
-
-static void
-B_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
- void* userdata __UNUSED__)
-{
- struct A b0;
- struct B b1;
-
- b0 = *(struct A*)(args[0]);
- b1 = *(struct B*)(args[1]);
-
- *(B*)resp = B_fn(b0, b1);
-}
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- void* args_dbl[3];
- ffi_type* cls_struct_fields[3];
- ffi_type* cls_struct_fields1[3];
- ffi_type cls_struct_type, cls_struct_type1;
- ffi_type* dbl_arg_types[3];
-
- struct A e_dbl = { 1.0, 7};
- struct B f_dbl = {{12.0 , 127}, 99};
-
- struct B res_dbl;
-
- cls_struct_type.size = 0;
- cls_struct_type.alignment = 0;
- cls_struct_type.type = FFI_TYPE_STRUCT;
- cls_struct_type.elements = cls_struct_fields;
-
- cls_struct_type1.size = 0;
- cls_struct_type1.alignment = 0;
- cls_struct_type1.type = FFI_TYPE_STRUCT;
- cls_struct_type1.elements = cls_struct_fields1;
-
- cls_struct_fields[0] = &ffi_type_longdouble;
- cls_struct_fields[1] = &ffi_type_uchar;
- cls_struct_fields[2] = NULL;
-
- cls_struct_fields1[0] = &cls_struct_type;
- cls_struct_fields1[1] = &ffi_type_uchar;
- cls_struct_fields1[2] = NULL;
-
-
- dbl_arg_types[0] = &cls_struct_type;
- dbl_arg_types[1] = &cls_struct_type1;
- dbl_arg_types[2] = NULL;
-
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type1,
- dbl_arg_types) == FFI_OK);
-
- args_dbl[0] = &e_dbl;
- args_dbl[1] = &f_dbl;
- args_dbl[2] = NULL;
-
- ffi_call(&cif, FFI_FN(B_fn), &res_dbl, args_dbl);
- /* { dg-output "1 7 12 127 99: 13 233 134" } */
- CHECK( res_dbl.x.a == (e_dbl.a + f_dbl.x.a));
- CHECK( res_dbl.x.b == (e_dbl.b + f_dbl.x.b + f_dbl.y));
- CHECK( res_dbl.y == (e_dbl.b + f_dbl.x.b));
-
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, B_gn, NULL, code) == FFI_OK);
-
- res_dbl = ((B(*)(A, B))(code))(e_dbl, f_dbl);
- /* { dg-output "\n1 7 12 127 99: 13 233 134" } */
- CHECK( res_dbl.x.a == (e_dbl.a + f_dbl.x.a));
- CHECK( res_dbl.x.b == (e_dbl.b + f_dbl.x.b + f_dbl.y));
- CHECK( res_dbl.y == (e_dbl.b + f_dbl.x.b));
-
- exit(0);
-}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/nested_struct6.c b/Modules/_ctypes/libffi/testsuite/libffi.call/nested_struct6.c
deleted file mode 100644
index 59d35796f8..0000000000
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/nested_struct6.c
+++ /dev/null
@@ -1,131 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Check structure passing with different structure size.
- Contains structs as parameter of the struct itself.
- Sample taken from Alan Modras patch to src/prep_cif.c.
- Limitations: none.
- PR: PR 25630.
- Originator: <andreast@gcc.gnu.org> 20051010 */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-typedef struct A {
- double a;
- unsigned char b;
-} A;
-
-typedef struct B {
- struct A x;
- unsigned char y;
-} B;
-
-typedef struct C {
- long d;
- unsigned char e;
-} C;
-
-static B B_fn(struct A b2, struct B b3, struct C b4)
-{
- struct B result;
-
- result.x.a = b2.a + b3.x.a + b4.d;
- result.x.b = b2.b + b3.x.b + b3.y + b4.e;
- result.y = b2.b + b3.x.b + b4.e;
-
- printf("%d %d %d %d %d %d %d: %d %d %d\n", (int)b2.a, b2.b,
- (int)b3.x.a, b3.x.b, b3.y, (int)b4.d, b4.e,
- (int)result.x.a, result.x.b, result.y);
-
- return result;
-}
-
-static void
-B_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
- void* userdata __UNUSED__)
-{
- struct A b0;
- struct B b1;
- struct C b2;
-
- b0 = *(struct A*)(args[0]);
- b1 = *(struct B*)(args[1]);
- b2 = *(struct C*)(args[2]);
-
- *(B*)resp = B_fn(b0, b1, b2);
-}
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- void* args_dbl[4];
- ffi_type* cls_struct_fields[3];
- ffi_type* cls_struct_fields1[3];
- ffi_type* cls_struct_fields2[3];
- ffi_type cls_struct_type, cls_struct_type1, cls_struct_type2;
- ffi_type* dbl_arg_types[4];
-
- struct A e_dbl = { 1.0, 7};
- struct B f_dbl = {{12.0 , 127}, 99};
- struct C g_dbl = { 2, 9};
-
- struct B res_dbl;
-
- cls_struct_type.size = 0;
- cls_struct_type.alignment = 0;
- cls_struct_type.type = FFI_TYPE_STRUCT;
- cls_struct_type.elements = cls_struct_fields;
-
- cls_struct_type1.size = 0;
- cls_struct_type1.alignment = 0;
- cls_struct_type1.type = FFI_TYPE_STRUCT;
- cls_struct_type1.elements = cls_struct_fields1;
-
- cls_struct_type2.size = 0;
- cls_struct_type2.alignment = 0;
- cls_struct_type2.type = FFI_TYPE_STRUCT;
- cls_struct_type2.elements = cls_struct_fields2;
-
- cls_struct_fields[0] = &ffi_type_double;
- cls_struct_fields[1] = &ffi_type_uchar;
- cls_struct_fields[2] = NULL;
-
- cls_struct_fields1[0] = &cls_struct_type;
- cls_struct_fields1[1] = &ffi_type_uchar;
- cls_struct_fields1[2] = NULL;
-
- cls_struct_fields2[0] = &ffi_type_slong;
- cls_struct_fields2[1] = &ffi_type_uchar;
- cls_struct_fields2[2] = NULL;
-
-
- dbl_arg_types[0] = &cls_struct_type;
- dbl_arg_types[1] = &cls_struct_type1;
- dbl_arg_types[2] = &cls_struct_type2;
- dbl_arg_types[3] = NULL;
-
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 3, &cls_struct_type1,
- dbl_arg_types) == FFI_OK);
-
- args_dbl[0] = &e_dbl;
- args_dbl[1] = &f_dbl;
- args_dbl[2] = &g_dbl;
- args_dbl[3] = NULL;
-
- ffi_call(&cif, FFI_FN(B_fn), &res_dbl, args_dbl);
- /* { dg-output "1 7 12 127 99 2 9: 15 242 143" } */
- CHECK( res_dbl.x.a == (e_dbl.a + f_dbl.x.a + g_dbl.d));
- CHECK( res_dbl.x.b == (e_dbl.b + f_dbl.x.b + f_dbl.y + g_dbl.e));
- CHECK( res_dbl.y == (e_dbl.b + f_dbl.x.b + g_dbl.e));
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, B_gn, NULL, code) == FFI_OK);
-
- res_dbl = ((B(*)(A, B, C))(code))(e_dbl, f_dbl, g_dbl);
- /* { dg-output "\n1 7 12 127 99 2 9: 15 242 143" } */
- CHECK( res_dbl.x.a == (e_dbl.a + f_dbl.x.a + g_dbl.d));
- CHECK( res_dbl.x.b == (e_dbl.b + f_dbl.x.b + f_dbl.y + g_dbl.e));
- CHECK( res_dbl.y == (e_dbl.b + f_dbl.x.b + g_dbl.e));
-
- exit(0);
-}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/nested_struct7.c b/Modules/_ctypes/libffi/testsuite/libffi.call/nested_struct7.c
deleted file mode 100644
index 27595e6f5c..0000000000
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/nested_struct7.c
+++ /dev/null
@@ -1,111 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Check structure passing with different structure size.
- Contains structs as parameter of the struct itself.
- Sample taken from Alan Modras patch to src/prep_cif.c.
- Limitations: none.
- PR: none.
- Originator: <andreast@gcc.gnu.org> 20051010 */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-typedef struct A {
- unsigned long long a;
- unsigned char b;
-} A;
-
-typedef struct B {
- struct A x;
- unsigned char y;
-} B;
-
-static B B_fn(struct A b2, struct B b3)
-{
- struct B result;
-
- result.x.a = b2.a + b3.x.a;
- result.x.b = b2.b + b3.x.b + b3.y;
- result.y = b2.b + b3.x.b;
-
- printf("%d %d %d %d %d: %d %d %d\n", (int)b2.a, b2.b,
- (int)b3.x.a, b3.x.b, b3.y,
- (int)result.x.a, result.x.b, result.y);
-
- return result;
-}
-
-static void
-B_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
- void* userdata __UNUSED__)
-{
- struct A b0;
- struct B b1;
-
- b0 = *(struct A*)(args[0]);
- b1 = *(struct B*)(args[1]);
-
- *(B*)resp = B_fn(b0, b1);
-}
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- void* args_dbl[3];
- ffi_type* cls_struct_fields[3];
- ffi_type* cls_struct_fields1[3];
- ffi_type cls_struct_type, cls_struct_type1;
- ffi_type* dbl_arg_types[3];
-
- struct A e_dbl = { 1LL, 7};
- struct B f_dbl = {{12.0 , 127}, 99};
-
- struct B res_dbl;
-
- cls_struct_type.size = 0;
- cls_struct_type.alignment = 0;
- cls_struct_type.type = FFI_TYPE_STRUCT;
- cls_struct_type.elements = cls_struct_fields;
-
- cls_struct_type1.size = 0;
- cls_struct_type1.alignment = 0;
- cls_struct_type1.type = FFI_TYPE_STRUCT;
- cls_struct_type1.elements = cls_struct_fields1;
-
- cls_struct_fields[0] = &ffi_type_uint64;
- cls_struct_fields[1] = &ffi_type_uchar;
- cls_struct_fields[2] = NULL;
-
- cls_struct_fields1[0] = &cls_struct_type;
- cls_struct_fields1[1] = &ffi_type_uchar;
- cls_struct_fields1[2] = NULL;
-
-
- dbl_arg_types[0] = &cls_struct_type;
- dbl_arg_types[1] = &cls_struct_type1;
- dbl_arg_types[2] = NULL;
-
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type1,
- dbl_arg_types) == FFI_OK);
-
- args_dbl[0] = &e_dbl;
- args_dbl[1] = &f_dbl;
- args_dbl[2] = NULL;
-
- ffi_call(&cif, FFI_FN(B_fn), &res_dbl, args_dbl);
- /* { dg-output "1 7 12 127 99: 13 233 134" } */
- CHECK( res_dbl.x.a == (e_dbl.a + f_dbl.x.a));
- CHECK( res_dbl.x.b == (e_dbl.b + f_dbl.x.b + f_dbl.y));
- CHECK( res_dbl.y == (e_dbl.b + f_dbl.x.b));
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, B_gn, NULL, code) == FFI_OK);
-
- res_dbl = ((B(*)(A, B))(code))(e_dbl, f_dbl);
- /* { dg-output "\n1 7 12 127 99: 13 233 134" } */
- CHECK( res_dbl.x.a == (e_dbl.a + f_dbl.x.a));
- CHECK( res_dbl.x.b == (e_dbl.b + f_dbl.x.b + f_dbl.y));
- CHECK( res_dbl.y == (e_dbl.b + f_dbl.x.b));
-
- exit(0);
-}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/nested_struct8.c b/Modules/_ctypes/libffi/testsuite/libffi.call/nested_struct8.c
deleted file mode 100644
index 0e6c68281e..0000000000
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/nested_struct8.c
+++ /dev/null
@@ -1,131 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Check structure passing with different structure size.
- Contains structs as parameter of the struct itself.
- Sample taken from Alan Modras patch to src/prep_cif.c.
- Limitations: none.
- PR: none.
- Originator: <andreast@gcc.gnu.org> 20051010 */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-typedef struct A {
- unsigned long long a;
- unsigned char b;
-} A;
-
-typedef struct B {
- struct A x;
- unsigned char y;
-} B;
-
-typedef struct C {
- unsigned long long d;
- unsigned char e;
-} C;
-
-static B B_fn(struct A b2, struct B b3, struct C b4)
-{
- struct B result;
-
- result.x.a = b2.a + b3.x.a + b4.d;
- result.x.b = b2.b + b3.x.b + b3.y + b4.e;
- result.y = b2.b + b3.x.b + b4.e;
-
- printf("%d %d %d %d %d %d %d: %d %d %d\n", (int)b2.a, b2.b,
- (int)b3.x.a, b3.x.b, b3.y, (int)b4.d, b4.e,
- (int)result.x.a, result.x.b, result.y);
-
- return result;
-}
-
-static void
-B_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
- void* userdata __UNUSED__)
-{
- struct A b0;
- struct B b1;
- struct C b2;
-
- b0 = *(struct A*)(args[0]);
- b1 = *(struct B*)(args[1]);
- b2 = *(struct C*)(args[2]);
-
- *(B*)resp = B_fn(b0, b1, b2);
-}
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- void* args_dbl[4];
- ffi_type* cls_struct_fields[3];
- ffi_type* cls_struct_fields1[3];
- ffi_type* cls_struct_fields2[3];
- ffi_type cls_struct_type, cls_struct_type1, cls_struct_type2;
- ffi_type* dbl_arg_types[4];
-
- struct A e_dbl = { 1LL, 7};
- struct B f_dbl = {{12LL , 127}, 99};
- struct C g_dbl = { 2LL, 9};
-
- struct B res_dbl;
-
- cls_struct_type.size = 0;
- cls_struct_type.alignment = 0;
- cls_struct_type.type = FFI_TYPE_STRUCT;
- cls_struct_type.elements = cls_struct_fields;
-
- cls_struct_type1.size = 0;
- cls_struct_type1.alignment = 0;
- cls_struct_type1.type = FFI_TYPE_STRUCT;
- cls_struct_type1.elements = cls_struct_fields1;
-
- cls_struct_type2.size = 0;
- cls_struct_type2.alignment = 0;
- cls_struct_type2.type = FFI_TYPE_STRUCT;
- cls_struct_type2.elements = cls_struct_fields2;
-
- cls_struct_fields[0] = &ffi_type_uint64;
- cls_struct_fields[1] = &ffi_type_uchar;
- cls_struct_fields[2] = NULL;
-
- cls_struct_fields1[0] = &cls_struct_type;
- cls_struct_fields1[1] = &ffi_type_uchar;
- cls_struct_fields1[2] = NULL;
-
- cls_struct_fields2[0] = &ffi_type_uint64;
- cls_struct_fields2[1] = &ffi_type_uchar;
- cls_struct_fields2[2] = NULL;
-
-
- dbl_arg_types[0] = &cls_struct_type;
- dbl_arg_types[1] = &cls_struct_type1;
- dbl_arg_types[2] = &cls_struct_type2;
- dbl_arg_types[3] = NULL;
-
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 3, &cls_struct_type1,
- dbl_arg_types) == FFI_OK);
-
- args_dbl[0] = &e_dbl;
- args_dbl[1] = &f_dbl;
- args_dbl[2] = &g_dbl;
- args_dbl[3] = NULL;
-
- ffi_call(&cif, FFI_FN(B_fn), &res_dbl, args_dbl);
- /* { dg-output "1 7 12 127 99 2 9: 15 242 143" } */
- CHECK( res_dbl.x.a == (e_dbl.a + f_dbl.x.a + g_dbl.d));
- CHECK( res_dbl.x.b == (e_dbl.b + f_dbl.x.b + f_dbl.y + g_dbl.e));
- CHECK( res_dbl.y == (e_dbl.b + f_dbl.x.b + g_dbl.e));
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, B_gn, NULL, code) == FFI_OK);
-
- res_dbl = ((B(*)(A, B, C))(code))(e_dbl, f_dbl, g_dbl);
- /* { dg-output "\n1 7 12 127 99 2 9: 15 242 143" } */
- CHECK( res_dbl.x.a == (e_dbl.a + f_dbl.x.a + g_dbl.d));
- CHECK( res_dbl.x.b == (e_dbl.b + f_dbl.x.b + f_dbl.y + g_dbl.e));
- CHECK( res_dbl.y == (e_dbl.b + f_dbl.x.b + g_dbl.e));
-
- exit(0);
-}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/nested_struct9.c b/Modules/_ctypes/libffi/testsuite/libffi.call/nested_struct9.c
deleted file mode 100644
index 5f7ac67752..0000000000
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/nested_struct9.c
+++ /dev/null
@@ -1,131 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Check structure passing with different structure size.
- Contains structs as parameter of the struct itself.
- Sample taken from Alan Modras patch to src/prep_cif.c.
- Limitations: none.
- PR: none.
- Originator: <andreast@gcc.gnu.org> 20051010 */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-typedef struct A {
- unsigned char a;
- unsigned long long b;
-} A;
-
-typedef struct B {
- struct A x;
- unsigned char y;
-} B;
-
-typedef struct C {
- unsigned long d;
- unsigned char e;
-} C;
-
-static B B_fn(struct A b2, struct B b3, struct C b4)
-{
- struct B result;
-
- result.x.a = b2.a + b3.x.a + b4.d;
- result.x.b = b2.b + b3.x.b + b3.y + b4.e;
- result.y = b2.b + b3.x.b + b4.e;
-
- printf("%d %d %d %d %d %d %d: %d %d %d\n", b2.a, (int)b2.b,
- b3.x.a, (int)b3.x.b, b3.y, (int)b4.d, b4.e,
- result.x.a, (int)result.x.b, result.y);
-
- return result;
-}
-
-static void
-B_gn(ffi_cif* cif __UNUSED__, void* resp, void** args,
- void* userdata __UNUSED__)
-{
- struct A b0;
- struct B b1;
- struct C b2;
-
- b0 = *(struct A*)(args[0]);
- b1 = *(struct B*)(args[1]);
- b2 = *(struct C*)(args[2]);
-
- *(B*)resp = B_fn(b0, b1, b2);
-}
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- void* args_dbl[4];
- ffi_type* cls_struct_fields[3];
- ffi_type* cls_struct_fields1[3];
- ffi_type* cls_struct_fields2[3];
- ffi_type cls_struct_type, cls_struct_type1, cls_struct_type2;
- ffi_type* dbl_arg_types[4];
-
- struct A e_dbl = { 1, 7LL};
- struct B f_dbl = {{12.0 , 127}, 99};
- struct C g_dbl = { 2, 9};
-
- struct B res_dbl;
-
- cls_struct_type.size = 0;
- cls_struct_type.alignment = 0;
- cls_struct_type.type = FFI_TYPE_STRUCT;
- cls_struct_type.elements = cls_struct_fields;
-
- cls_struct_type1.size = 0;
- cls_struct_type1.alignment = 0;
- cls_struct_type1.type = FFI_TYPE_STRUCT;
- cls_struct_type1.elements = cls_struct_fields1;
-
- cls_struct_type2.size = 0;
- cls_struct_type2.alignment = 0;
- cls_struct_type2.type = FFI_TYPE_STRUCT;
- cls_struct_type2.elements = cls_struct_fields2;
-
- cls_struct_fields[0] = &ffi_type_uchar;
- cls_struct_fields[1] = &ffi_type_uint64;
- cls_struct_fields[2] = NULL;
-
- cls_struct_fields1[0] = &cls_struct_type;
- cls_struct_fields1[1] = &ffi_type_uchar;
- cls_struct_fields1[2] = NULL;
-
- cls_struct_fields2[0] = &ffi_type_ulong;
- cls_struct_fields2[1] = &ffi_type_uchar;
- cls_struct_fields2[2] = NULL;
-
-
- dbl_arg_types[0] = &cls_struct_type;
- dbl_arg_types[1] = &cls_struct_type1;
- dbl_arg_types[2] = &cls_struct_type2;
- dbl_arg_types[3] = NULL;
-
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 3, &cls_struct_type1,
- dbl_arg_types) == FFI_OK);
-
- args_dbl[0] = &e_dbl;
- args_dbl[1] = &f_dbl;
- args_dbl[2] = &g_dbl;
- args_dbl[3] = NULL;
-
- ffi_call(&cif, FFI_FN(B_fn), &res_dbl, args_dbl);
- /* { dg-output "1 7 12 127 99 2 9: 15 242 143" } */
- CHECK( res_dbl.x.a == (e_dbl.a + f_dbl.x.a + g_dbl.d));
- CHECK( res_dbl.x.b == (e_dbl.b + f_dbl.x.b + f_dbl.y + g_dbl.e));
- CHECK( res_dbl.y == (e_dbl.b + f_dbl.x.b + g_dbl.e));
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, B_gn, NULL, code) == FFI_OK);
-
- res_dbl = ((B(*)(A, B, C))(code))(e_dbl, f_dbl, g_dbl);
- /* { dg-output "\n1 7 12 127 99 2 9: 15 242 143" } */
- CHECK( res_dbl.x.a == (e_dbl.a + f_dbl.x.a + g_dbl.d));
- CHECK( res_dbl.x.b == (e_dbl.b + f_dbl.x.b + f_dbl.y + g_dbl.e));
- CHECK( res_dbl.y == (e_dbl.b + f_dbl.x.b + g_dbl.e));
-
- exit(0);
-}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/problem1.c b/Modules/_ctypes/libffi/testsuite/libffi.call/problem1.c
deleted file mode 100644
index 6a91555a1f..0000000000
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/problem1.c
+++ /dev/null
@@ -1,90 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Check structure passing with different structure size.
- Limitations: none.
- PR: none.
- Originator: <andreast@gcc.gnu.org> 20030828 */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-typedef struct my_ffi_struct {
- double a;
- double b;
- double c;
-} my_ffi_struct;
-
-my_ffi_struct callee(struct my_ffi_struct a1, struct my_ffi_struct a2)
-{
- struct my_ffi_struct result;
- result.a = a1.a + a2.a;
- result.b = a1.b + a2.b;
- result.c = a1.c + a2.c;
-
-
- printf("%g %g %g %g %g %g: %g %g %g\n", a1.a, a1.b, a1.c,
- a2.a, a2.b, a2.c, result.a, result.b, result.c);
-
- return result;
-}
-
-void stub(ffi_cif* cif __UNUSED__, void* resp, void** args,
- void* userdata __UNUSED__)
-{
- struct my_ffi_struct a1;
- struct my_ffi_struct a2;
-
- a1 = *(struct my_ffi_struct*)(args[0]);
- a2 = *(struct my_ffi_struct*)(args[1]);
-
- *(my_ffi_struct *)resp = callee(a1, a2);
-}
-
-
-int main(void)
-{
- ffi_type* my_ffi_struct_fields[4];
- ffi_type my_ffi_struct_type;
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- void* args[4];
- ffi_type* arg_types[3];
-
- struct my_ffi_struct g = { 1.0, 2.0, 3.0 };
- struct my_ffi_struct f = { 1.0, 2.0, 3.0 };
- struct my_ffi_struct res;
-
- my_ffi_struct_type.size = 0;
- my_ffi_struct_type.alignment = 0;
- my_ffi_struct_type.type = FFI_TYPE_STRUCT;
- my_ffi_struct_type.elements = my_ffi_struct_fields;
-
- my_ffi_struct_fields[0] = &ffi_type_double;
- my_ffi_struct_fields[1] = &ffi_type_double;
- my_ffi_struct_fields[2] = &ffi_type_double;
- my_ffi_struct_fields[3] = NULL;
-
- arg_types[0] = &my_ffi_struct_type;
- arg_types[1] = &my_ffi_struct_type;
- arg_types[2] = NULL;
-
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &my_ffi_struct_type,
- arg_types) == FFI_OK);
-
- args[0] = &g;
- args[1] = &f;
- args[2] = NULL;
- ffi_call(&cif, FFI_FN(callee), &res, args);
- /* { dg-output "1 2 3 1 2 3: 2 4 6" } */
- printf("res: %g %g %g\n", res.a, res.b, res.c);
- /* { dg-output "\nres: 2 4 6" } */
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, stub, NULL, code) == FFI_OK);
-
- res = ((my_ffi_struct(*)(struct my_ffi_struct, struct my_ffi_struct))(code))(g, f);
- /* { dg-output "\n1 2 3 1 2 3: 2 4 6" } */
- printf("res: %g %g %g\n", res.a, res.b, res.c);
- /* { dg-output "\nres: 2 4 6" } */
-
- exit(0);;
-}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/promotion.c b/Modules/_ctypes/libffi/testsuite/libffi.call/promotion.c
deleted file mode 100644
index 44561615dd..0000000000
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/promotion.c
+++ /dev/null
@@ -1,59 +0,0 @@
-/* Area: ffi_call
- Purpose: Promotion test.
- Limitations: none.
- PR: none.
- Originator: From the original ffitest.c */
-
-/* { dg-do run } */
-#include "ffitest.h"
-static int promotion(signed char sc, signed short ss,
- unsigned char uc, unsigned short us)
-{
- int r = (int) sc + (int) ss + (int) uc + (int) us;
-
- return r;
-}
-
-int main (void)
-{
- ffi_cif cif;
- ffi_type *args[MAX_ARGS];
- void *values[MAX_ARGS];
- ffi_arg rint;
- signed char sc;
- unsigned char uc;
- signed short ss;
- unsigned short us;
- unsigned long ul;
-
- args[0] = &ffi_type_schar;
- args[1] = &ffi_type_sshort;
- args[2] = &ffi_type_uchar;
- args[3] = &ffi_type_ushort;
- values[0] = &sc;
- values[1] = &ss;
- values[2] = &uc;
- values[3] = &us;
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 4,
- &ffi_type_sint, args) == FFI_OK);
-
- us = 0;
- ul = 0;
-
- for (sc = (signed char) -127;
- sc <= (signed char) 120; sc += 1)
- for (ss = -30000; ss <= 30000; ss += 10000)
- for (uc = (unsigned char) 0;
- uc <= (unsigned char) 200; uc += 20)
- for (us = 0; us <= 60000; us += 10000)
- {
- ul++;
- ffi_call(&cif, FFI_FN(promotion), &rint, values);
- CHECK((int)rint == (signed char) sc + (signed short) ss +
- (unsigned char) uc + (unsigned short) us);
- }
- printf("%lu promotion tests run\n", ul);
- exit(0);
-}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/pyobjc-tc.c b/Modules/_ctypes/libffi/testsuite/libffi.call/pyobjc-tc.c
deleted file mode 100644
index e29bd6c283..0000000000
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/pyobjc-tc.c
+++ /dev/null
@@ -1,114 +0,0 @@
-/* Area: ffi_call
- Purpose: Check different structures.
- Limitations: none.
- PR: none.
- Originator: Ronald Oussoren <oussoren@cistron.nl> 20030824 */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-typedef struct Point {
- float x;
- float y;
-} Point;
-
-typedef struct Size {
- float h;
- float w;
-} Size;
-
-typedef struct Rect {
- Point o;
- Size s;
-} Rect;
-
-int doit(int o, char* s, Point p, Rect r, int last)
-{
- printf("CALLED WITH %d %s {%f %f} {{%f %f} {%f %f}} %d\n",
- o, s, p.x, p.y, r.o.x, r.o.y, r.s.h, r.s.w, last);
- return 42;
-}
-
-
-int main(void)
-{
- ffi_type point_type;
- ffi_type size_type;
- ffi_type rect_type;
- ffi_cif cif;
- ffi_type* arglist[6];
- void* values[6];
- int r;
-
- /*
- * First set up FFI types for the 3 struct types
- */
-
- point_type.size = 0; /*sizeof(Point);*/
- point_type.alignment = 0; /*__alignof__(Point);*/
- point_type.type = FFI_TYPE_STRUCT;
- point_type.elements = malloc(3 * sizeof(ffi_type*));
- point_type.elements[0] = &ffi_type_float;
- point_type.elements[1] = &ffi_type_float;
- point_type.elements[2] = NULL;
-
- size_type.size = 0;/* sizeof(Size);*/
- size_type.alignment = 0;/* __alignof__(Size);*/
- size_type.type = FFI_TYPE_STRUCT;
- size_type.elements = malloc(3 * sizeof(ffi_type*));
- size_type.elements[0] = &ffi_type_float;
- size_type.elements[1] = &ffi_type_float;
- size_type.elements[2] = NULL;
-
- rect_type.size = 0;/*sizeof(Rect);*/
- rect_type.alignment =0;/* __alignof__(Rect);*/
- rect_type.type = FFI_TYPE_STRUCT;
- rect_type.elements = malloc(3 * sizeof(ffi_type*));
- rect_type.elements[0] = &point_type;
- rect_type.elements[1] = &size_type;
- rect_type.elements[2] = NULL;
-
- /*
- * Create a CIF
- */
- arglist[0] = &ffi_type_sint;
- arglist[1] = &ffi_type_pointer;
- arglist[2] = &point_type;
- arglist[3] = &rect_type;
- arglist[4] = &ffi_type_sint;
- arglist[5] = NULL;
-
- r = ffi_prep_cif(&cif, FFI_DEFAULT_ABI,
- 5, &ffi_type_sint, arglist);
- if (r != FFI_OK) {
- abort();
- }
-
-
- /* And call the function through the CIF */
-
- {
- Point p = { 1.0, 2.0 };
- Rect r = { { 9.0, 10.0}, { -1.0, -2.0 } };
- int o = 0;
- int l = 42;
- char* m = "myMethod";
- ffi_arg result;
-
- values[0] = &o;
- values[1] = &m;
- values[2] = &p;
- values[3] = &r;
- values[4] = &l;
- values[5] = NULL;
-
- printf("CALLING WITH %d %s {%f %f} {{%f %f} {%f %f}} %d\n",
- o, m, p.x, p.y, r.o.x, r.o.y, r.s.h, r.s.w, l);
-
- ffi_call(&cif, FFI_FN(doit), &result, values);
-
- printf ("The result is %d\n", (int)result);
-
- }
- exit(0);
-}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/return_dbl.c b/Modules/_ctypes/libffi/testsuite/libffi.call/return_dbl.c
deleted file mode 100644
index fd07e50179..0000000000
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/return_dbl.c
+++ /dev/null
@@ -1,36 +0,0 @@
-/* Area: ffi_call
- Purpose: Check return value double.
- Limitations: none.
- PR: none.
- Originator: <andreast@gcc.gnu.org> 20050212 */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-static double return_dbl(double dbl)
-{
- printf ("%f\n", dbl);
- return 2 * dbl;
-}
-int main (void)
-{
- ffi_cif cif;
- ffi_type *args[MAX_ARGS];
- void *values[MAX_ARGS];
- double dbl, rdbl;
-
- args[0] = &ffi_type_double;
- values[0] = &dbl;
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1,
- &ffi_type_double, args) == FFI_OK);
-
- for (dbl = -127.3; dbl < 127; dbl++)
- {
- ffi_call(&cif, FFI_FN(return_dbl), &rdbl, values);
- printf ("%f vs %f\n", rdbl, return_dbl(dbl));
- CHECK(rdbl == 2 * dbl);
- }
- exit(0);
-}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/return_dbl1.c b/Modules/_ctypes/libffi/testsuite/libffi.call/return_dbl1.c
deleted file mode 100644
index 0ea5d50551..0000000000
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/return_dbl1.c
+++ /dev/null
@@ -1,43 +0,0 @@
-/* Area: ffi_call
- Purpose: Check return value double.
- Limitations: none.
- PR: none.
- Originator: <andreast@gcc.gnu.org> 20050212 */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-static double return_dbl(double dbl1, float fl2, unsigned int in3, double dbl4)
-{
- return dbl1 + fl2 + in3 + dbl4;
-}
-int main (void)
-{
- ffi_cif cif;
- ffi_type *args[MAX_ARGS];
- void *values[MAX_ARGS];
- double dbl1, dbl4, rdbl;
- float fl2;
- unsigned int in3;
- args[0] = &ffi_type_double;
- args[1] = &ffi_type_float;
- args[2] = &ffi_type_uint;
- args[3] = &ffi_type_double;
- values[0] = &dbl1;
- values[1] = &fl2;
- values[2] = &in3;
- values[3] = &dbl4;
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 4,
- &ffi_type_double, args) == FFI_OK);
- dbl1 = 127.0;
- fl2 = 128.0;
- in3 = 255;
- dbl4 = 512.7;
-
- ffi_call(&cif, FFI_FN(return_dbl), &rdbl, values);
- printf ("%f vs %f\n", rdbl, return_dbl(dbl1, fl2, in3, dbl4));
- CHECK(rdbl == dbl1 + fl2 + in3 + dbl4);
- exit(0);
-}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/return_dbl2.c b/Modules/_ctypes/libffi/testsuite/libffi.call/return_dbl2.c
deleted file mode 100644
index b3818f866b..0000000000
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/return_dbl2.c
+++ /dev/null
@@ -1,42 +0,0 @@
-/* Area: ffi_call
- Purpose: Check return value double.
- Limitations: none.
- PR: none.
- Originator: <andreast@gcc.gnu.org> 20050212 */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-static double return_dbl(double dbl1, double dbl2, unsigned int in3, double dbl4)
-{
- return dbl1 + dbl2 + in3 + dbl4;
-}
-int main (void)
-{
- ffi_cif cif;
- ffi_type *args[MAX_ARGS];
- void *values[MAX_ARGS];
- double dbl1, dbl2, dbl4, rdbl;
- unsigned int in3;
- args[0] = &ffi_type_double;
- args[1] = &ffi_type_double;
- args[2] = &ffi_type_uint;
- args[3] = &ffi_type_double;
- values[0] = &dbl1;
- values[1] = &dbl2;
- values[2] = &in3;
- values[3] = &dbl4;
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 4,
- &ffi_type_double, args) == FFI_OK);
- dbl1 = 127.0;
- dbl2 = 128.0;
- in3 = 255;
- dbl4 = 512.7;
-
- ffi_call(&cif, FFI_FN(return_dbl), &rdbl, values);
- printf ("%f vs %f\n", rdbl, return_dbl(dbl1, dbl2, in3, dbl4));
- CHECK(rdbl == dbl1 + dbl2 + in3 + dbl4);
- exit(0);
-}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/return_fl.c b/Modules/_ctypes/libffi/testsuite/libffi.call/return_fl.c
deleted file mode 100644
index fb8a09e32a..0000000000
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/return_fl.c
+++ /dev/null
@@ -1,35 +0,0 @@
-/* Area: ffi_call
- Purpose: Check return value float.
- Limitations: none.
- PR: none.
- Originator: <andreast@gcc.gnu.org> 20050212 */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-static float return_fl(float fl)
-{
- return 2 * fl;
-}
-int main (void)
-{
- ffi_cif cif;
- ffi_type *args[MAX_ARGS];
- void *values[MAX_ARGS];
- float fl, rfl;
-
- args[0] = &ffi_type_float;
- values[0] = &fl;
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1,
- &ffi_type_float, args) == FFI_OK);
-
- for (fl = -127.0; fl < 127; fl++)
- {
- ffi_call(&cif, FFI_FN(return_fl), &rfl, values);
- printf ("%f vs %f\n", rfl, return_fl(fl));
- CHECK(rfl == 2 * fl);
- }
- exit(0);
-}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/return_fl1.c b/Modules/_ctypes/libffi/testsuite/libffi.call/return_fl1.c
deleted file mode 100644
index c3d92c283d..0000000000
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/return_fl1.c
+++ /dev/null
@@ -1,36 +0,0 @@
-/* Area: ffi_call
- Purpose: Check return value float.
- Limitations: none.
- PR: none.
- Originator: <andreast@gcc.gnu.org> 20050212 */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-static float return_fl(float fl1, float fl2)
-{
- return fl1 + fl2;
-}
-int main (void)
-{
- ffi_cif cif;
- ffi_type *args[MAX_ARGS];
- void *values[MAX_ARGS];
- float fl1, fl2, rfl;
-
- args[0] = &ffi_type_float;
- args[1] = &ffi_type_float;
- values[0] = &fl1;
- values[1] = &fl2;
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2,
- &ffi_type_float, args) == FFI_OK);
- fl1 = 127.0;
- fl2 = 128.0;
-
- ffi_call(&cif, FFI_FN(return_fl), &rfl, values);
- printf ("%f vs %f\n", rfl, return_fl(fl1, fl2));
- CHECK(rfl == fl1 + fl2);
- exit(0);
-}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/return_fl2.c b/Modules/_ctypes/libffi/testsuite/libffi.call/return_fl2.c
deleted file mode 100644
index ddb976cc2b..0000000000
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/return_fl2.c
+++ /dev/null
@@ -1,49 +0,0 @@
-/* Area: ffi_call
- Purpose: Check return value float.
- Limitations: none.
- PR: none.
- Originator: <andreast@gcc.gnu.org> 20050212 */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-/* Use volatile float to avoid false negative on ix86. See PR target/323. */
-static float return_fl(float fl1, float fl2, float fl3, float fl4)
-{
- volatile float sum;
-
- sum = fl1 + fl2 + fl3 + fl4;
- return sum;
-}
-int main (void)
-{
- ffi_cif cif;
- ffi_type *args[MAX_ARGS];
- void *values[MAX_ARGS];
- float fl1, fl2, fl3, fl4, rfl;
- volatile float sum;
-
- args[0] = &ffi_type_float;
- args[1] = &ffi_type_float;
- args[2] = &ffi_type_float;
- args[3] = &ffi_type_float;
- values[0] = &fl1;
- values[1] = &fl2;
- values[2] = &fl3;
- values[3] = &fl4;
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 4,
- &ffi_type_float, args) == FFI_OK);
- fl1 = 127.0;
- fl2 = 128.0;
- fl3 = 255.1;
- fl4 = 512.7;
-
- ffi_call(&cif, FFI_FN(return_fl), &rfl, values);
- printf ("%f vs %f\n", rfl, return_fl(fl1, fl2, fl3, fl4));
-
- sum = fl1 + fl2 + fl3 + fl4;
- CHECK(rfl == sum);
- exit(0);
-}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/return_fl3.c b/Modules/_ctypes/libffi/testsuite/libffi.call/return_fl3.c
deleted file mode 100644
index c37877b18e..0000000000
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/return_fl3.c
+++ /dev/null
@@ -1,42 +0,0 @@
-/* Area: ffi_call
- Purpose: Check return value float.
- Limitations: none.
- PR: none.
- Originator: <andreast@gcc.gnu.org> 20050212 */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-static float return_fl(float fl1, float fl2, unsigned int in3, float fl4)
-{
- return fl1 + fl2 + in3 + fl4;
-}
-int main (void)
-{
- ffi_cif cif;
- ffi_type *args[MAX_ARGS];
- void *values[MAX_ARGS];
- float fl1, fl2, fl4, rfl;
- unsigned int in3;
- args[0] = &ffi_type_float;
- args[1] = &ffi_type_float;
- args[2] = &ffi_type_uint;
- args[3] = &ffi_type_float;
- values[0] = &fl1;
- values[1] = &fl2;
- values[2] = &in3;
- values[3] = &fl4;
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 4,
- &ffi_type_float, args) == FFI_OK);
- fl1 = 127.0;
- fl2 = 128.0;
- in3 = 255;
- fl4 = 512.7;
-
- ffi_call(&cif, FFI_FN(return_fl), &rfl, values);
- printf ("%f vs %f\n", rfl, return_fl(fl1, fl2, in3, fl4));
- CHECK(rfl == fl1 + fl2 + in3 + fl4);
- exit(0);
-}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/return_ldl.c b/Modules/_ctypes/libffi/testsuite/libffi.call/return_ldl.c
deleted file mode 100644
index 5c2fe65aec..0000000000
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/return_ldl.c
+++ /dev/null
@@ -1,34 +0,0 @@
-/* Area: ffi_call
- Purpose: Check return value long double.
- Limitations: none.
- PR: none.
- Originator: <andreast@gcc.gnu.org> 20071113 */
-
-/* { dg-do run { xfail x86_64-*-mingw* x86_64-*-cygwin* } } */
-#include "ffitest.h"
-
-static long double return_ldl(long double ldl)
-{
- return 2*ldl;
-}
-int main (void)
-{
- ffi_cif cif;
- ffi_type *args[MAX_ARGS];
- void *values[MAX_ARGS];
- long double ldl, rldl;
-
- args[0] = &ffi_type_longdouble;
- values[0] = &ldl;
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1,
- &ffi_type_longdouble, args) == FFI_OK);
-
- for (ldl = -127.0; ldl < 127.0; ldl++)
- {
- ffi_call(&cif, FFI_FN(return_ldl), &rldl, values);
- CHECK(rldl == 2 * ldl);
- }
- exit(0);
-}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/return_ll.c b/Modules/_ctypes/libffi/testsuite/libffi.call/return_ll.c
deleted file mode 100644
index ea4a1e4478..0000000000
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/return_ll.c
+++ /dev/null
@@ -1,41 +0,0 @@
-/* Area: ffi_call
- Purpose: Check return value long long.
- Limitations: none.
- PR: none.
- Originator: From the original ffitest.c */
-
-/* { dg-do run } */
-#include "ffitest.h"
-static long long return_ll(long long ll)
-{
- return ll;
-}
-
-int main (void)
-{
- ffi_cif cif;
- ffi_type *args[MAX_ARGS];
- void *values[MAX_ARGS];
- long long rlonglong;
- long long ll;
-
- args[0] = &ffi_type_sint64;
- values[0] = &ll;
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1,
- &ffi_type_sint64, args) == FFI_OK);
-
- for (ll = 0LL; ll < 100LL; ll++)
- {
- ffi_call(&cif, FFI_FN(return_ll), &rlonglong, values);
- CHECK(rlonglong == ll);
- }
-
- for (ll = 55555555555000LL; ll < 55555555555100LL; ll++)
- {
- ffi_call(&cif, FFI_FN(return_ll), &rlonglong, values);
- CHECK(rlonglong == ll);
- }
- exit(0);
-}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/return_ll1.c b/Modules/_ctypes/libffi/testsuite/libffi.call/return_ll1.c
deleted file mode 100644
index 593e8a307c..0000000000
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/return_ll1.c
+++ /dev/null
@@ -1,43 +0,0 @@
-/* Area: ffi_call
- Purpose: Check if long long are passed in the corresponding regs on ppc.
- Limitations: none.
- PR: 20104.
- Originator: <andreast@gcc.gnu.org> 20050222 */
-
-/* { dg-do run } */
-/* { dg-options "-Wno-format" { target alpha*-dec-osf* } } */
-#include "ffitest.h"
-static long long return_ll(int ll0, long long ll1, int ll2)
-{
- return ll0 + ll1 + ll2;
-}
-
-int main (void)
-{
- ffi_cif cif;
- ffi_type *args[MAX_ARGS];
- void *values[MAX_ARGS];
- long long rlonglong;
- long long ll1;
- unsigned ll0, ll2;
-
- args[0] = &ffi_type_sint;
- args[1] = &ffi_type_sint64;
- args[2] = &ffi_type_sint;
- values[0] = &ll0;
- values[1] = &ll1;
- values[2] = &ll2;
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 3,
- &ffi_type_sint64, args) == FFI_OK);
-
- ll0 = 11111111;
- ll1 = 11111111111000LL;
- ll2 = 11111111;
-
- ffi_call(&cif, FFI_FN(return_ll), &rlonglong, values);
- printf("res: %" PRIdLL ", %" PRIdLL "\n", rlonglong, ll0 + ll1 + ll2);
- /* { dg-output "res: 11111133333222, 11111133333222" } */
- exit(0);
-}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/return_sc.c b/Modules/_ctypes/libffi/testsuite/libffi.call/return_sc.c
deleted file mode 100644
index a36cf3eb88..0000000000
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/return_sc.c
+++ /dev/null
@@ -1,36 +0,0 @@
-/* Area: ffi_call
- Purpose: Check return value signed char.
- Limitations: none.
- PR: none.
- Originator: From the original ffitest.c */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-static signed char return_sc(signed char sc)
-{
- return sc;
-}
-int main (void)
-{
- ffi_cif cif;
- ffi_type *args[MAX_ARGS];
- void *values[MAX_ARGS];
- ffi_arg rint;
- signed char sc;
-
- args[0] = &ffi_type_schar;
- values[0] = &sc;
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1,
- &ffi_type_schar, args) == FFI_OK);
-
- for (sc = (signed char) -127;
- sc < (signed char) 127; sc++)
- {
- ffi_call(&cif, FFI_FN(return_sc), &rint, values);
- CHECK((signed char)rint == sc);
- }
- exit(0);
-}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/return_sl.c b/Modules/_ctypes/libffi/testsuite/libffi.call/return_sl.c
deleted file mode 100644
index f0fd345f7a..0000000000
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/return_sl.c
+++ /dev/null
@@ -1,38 +0,0 @@
-/* Area: ffi_call
- Purpose: Check if long as return type is handled correctly.
- Limitations: none.
- PR: none.
- */
-
-/* { dg-do run } */
-#include "ffitest.h"
-static long return_sl(long l1, long l2)
-{
- return l1 - l2;
-}
-
-int main (void)
-{
- ffi_cif cif;
- ffi_type *args[MAX_ARGS];
- void *values[MAX_ARGS];
- ffi_arg res;
- unsigned long l1, l2;
-
- args[0] = &ffi_type_slong;
- args[1] = &ffi_type_slong;
- values[0] = &l1;
- values[1] = &l2;
-
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2,
- &ffi_type_slong, args) == FFI_OK);
-
- l1 = 1073741823L;
- l2 = 1073741824L;
-
- ffi_call(&cif, FFI_FN(return_sl), &res, values);
- printf("res: %ld, %ld\n", (long)res, l1 - l2);
- /* { dg-output "res: -1, -1" } */
-
- exit(0);
-}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/return_uc.c b/Modules/_ctypes/libffi/testsuite/libffi.call/return_uc.c
deleted file mode 100644
index 6fe554619d..0000000000
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/return_uc.c
+++ /dev/null
@@ -1,38 +0,0 @@
-/* Area: ffi_call
- Purpose: Check return value unsigned char.
- Limitations: none.
- PR: none.
- Originator: From the original ffitest.c */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-static unsigned char return_uc(unsigned char uc)
-{
- return uc;
-}
-
-int main (void)
-{
- ffi_cif cif;
- ffi_type *args[MAX_ARGS];
- void *values[MAX_ARGS];
- ffi_arg rint;
-
- unsigned char uc;
-
- args[0] = &ffi_type_uchar;
- values[0] = &uc;
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1,
- &ffi_type_uchar, args) == FFI_OK);
-
- for (uc = (unsigned char) '\x00';
- uc < (unsigned char) '\xff'; uc++)
- {
- ffi_call(&cif, FFI_FN(return_uc), &rint, values);
- CHECK((unsigned char)rint == uc);
- }
- exit(0);
-}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/return_ul.c b/Modules/_ctypes/libffi/testsuite/libffi.call/return_ul.c
deleted file mode 100644
index 12b266f037..0000000000
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/return_ul.c
+++ /dev/null
@@ -1,38 +0,0 @@
-/* Area: ffi_call
- Purpose: Check if unsigned long as return type is handled correctly.
- Limitations: none.
- PR: none.
- Originator: <kaffeetisch at gmx dot de> 20060724 */
-
-/* { dg-do run } */
-#include "ffitest.h"
-static unsigned long return_ul(unsigned long ul1, unsigned long ul2)
-{
- return ul1 + ul2;
-}
-
-int main (void)
-{
- ffi_cif cif;
- ffi_type *args[MAX_ARGS];
- void *values[MAX_ARGS];
- ffi_arg res;
- unsigned long ul1, ul2;
-
- args[0] = &ffi_type_ulong;
- args[1] = &ffi_type_ulong;
- values[0] = &ul1;
- values[1] = &ul2;
-
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2,
- &ffi_type_ulong, args) == FFI_OK);
-
- ul1 = 1073741823L;
- ul2 = 1073741824L;
-
- ffi_call(&cif, FFI_FN(return_ul), &res, values);
- printf("res: %lu, %lu\n", (unsigned long)res, ul1 + ul2);
- /* { dg-output "res: 2147483647, 2147483647" } */
-
- exit(0);
-}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/stret_large.c b/Modules/_ctypes/libffi/testsuite/libffi.call/stret_large.c
deleted file mode 100644
index 71c2469e1c..0000000000
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/stret_large.c
+++ /dev/null
@@ -1,145 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Check structure returning with different structure size.
- Depending on the ABI. Check bigger struct which overlaps
- the gp and fp register count on Darwin/AIX/ppc64.
- Limitations: none.
- PR: none.
- Originator: Blake Chaffin 6/21/2007 */
-
-/* { dg-do run { xfail strongarm*-*-* xscale*-*-* } } */
-#include "ffitest.h"
-
-/* 13 FPRs: 104 bytes */
-/* 14 FPRs: 112 bytes */
-
-typedef struct struct_108byte {
- double a;
- double b;
- double c;
- double d;
- double e;
- double f;
- double g;
- double h;
- double i;
- double j;
- double k;
- double l;
- double m;
- int n;
-} struct_108byte;
-
-struct_108byte cls_struct_108byte_fn(
- struct_108byte b0,
- struct_108byte b1,
- struct_108byte b2,
- struct_108byte b3)
-{
- struct_108byte result;
-
- result.a = b0.a + b1.a + b2.a + b3.a;
- result.b = b0.b + b1.b + b2.b + b3.b;
- result.c = b0.c + b1.c + b2.c + b3.c;
- result.d = b0.d + b1.d + b2.d + b3.d;
- result.e = b0.e + b1.e + b2.e + b3.e;
- result.f = b0.f + b1.f + b2.f + b3.f;
- result.g = b0.g + b1.g + b2.g + b3.g;
- result.h = b0.h + b1.h + b2.h + b3.h;
- result.i = b0.i + b1.i + b2.i + b3.i;
- result.j = b0.j + b1.j + b2.j + b3.j;
- result.k = b0.k + b1.k + b2.k + b3.k;
- result.l = b0.l + b1.l + b2.l + b3.l;
- result.m = b0.m + b1.m + b2.m + b3.m;
- result.n = b0.n + b1.n + b2.n + b3.n;
-
- printf("%g %g %g %g %g %g %g %g %g %g %g %g %g %d\n", result.a, result.b, result.c,
- result.d, result.e, result.f, result.g, result.h, result.i,
- result.j, result.k, result.l, result.m, result.n);
-
- return result;
-}
-
-static void
-cls_struct_108byte_gn(ffi_cif* cif __UNUSED__, void* resp, void** args, void* userdata __UNUSED__)
-{
- struct_108byte b0, b1, b2, b3;
-
- b0 = *(struct_108byte*)(args[0]);
- b1 = *(struct_108byte*)(args[1]);
- b2 = *(struct_108byte*)(args[2]);
- b3 = *(struct_108byte*)(args[3]);
-
- *(struct_108byte*)resp = cls_struct_108byte_fn(b0, b1, b2, b3);
-}
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- void* args_dbl[5];
- ffi_type* cls_struct_fields[15];
- ffi_type cls_struct_type;
- ffi_type* dbl_arg_types[5];
-
- struct_108byte e_dbl = { 9.0, 2.0, 6.0, 5.0, 3.0, 4.0, 8.0, 1.0, 1.0, 2.0, 3.0, 7.0, 2.0, 7 };
- struct_108byte f_dbl = { 1.0, 2.0, 3.0, 7.0, 2.0, 5.0, 6.0, 7.0, 4.0, 5.0, 7.0, 9.0, 1.0, 4 };
- struct_108byte g_dbl = { 4.0, 5.0, 7.0, 9.0, 1.0, 1.0, 2.0, 9.0, 8.0, 6.0, 1.0, 4.0, 0.0, 3 };
- struct_108byte h_dbl = { 8.0, 6.0, 1.0, 4.0, 0.0, 3.0, 3.0, 1.0, 9.0, 2.0, 6.0, 5.0, 3.0, 2 };
- struct_108byte res_dbl;
-
- cls_struct_type.size = 0;
- cls_struct_type.alignment = 0;
- cls_struct_type.type = FFI_TYPE_STRUCT;
- cls_struct_type.elements = cls_struct_fields;
-
- cls_struct_fields[0] = &ffi_type_double;
- cls_struct_fields[1] = &ffi_type_double;
- cls_struct_fields[2] = &ffi_type_double;
- cls_struct_fields[3] = &ffi_type_double;
- cls_struct_fields[4] = &ffi_type_double;
- cls_struct_fields[5] = &ffi_type_double;
- cls_struct_fields[6] = &ffi_type_double;
- cls_struct_fields[7] = &ffi_type_double;
- cls_struct_fields[8] = &ffi_type_double;
- cls_struct_fields[9] = &ffi_type_double;
- cls_struct_fields[10] = &ffi_type_double;
- cls_struct_fields[11] = &ffi_type_double;
- cls_struct_fields[12] = &ffi_type_double;
- cls_struct_fields[13] = &ffi_type_sint32;
- cls_struct_fields[14] = NULL;
-
- dbl_arg_types[0] = &cls_struct_type;
- dbl_arg_types[1] = &cls_struct_type;
- dbl_arg_types[2] = &cls_struct_type;
- dbl_arg_types[3] = &cls_struct_type;
- dbl_arg_types[4] = NULL;
-
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 4, &cls_struct_type,
- dbl_arg_types) == FFI_OK);
-
- args_dbl[0] = &e_dbl;
- args_dbl[1] = &f_dbl;
- args_dbl[2] = &g_dbl;
- args_dbl[3] = &h_dbl;
- args_dbl[4] = NULL;
-
- ffi_call(&cif, FFI_FN(cls_struct_108byte_fn), &res_dbl, args_dbl);
- /* { dg-output "22 15 17 25 6 13 19 18 22 15 17 25 6 16" } */
- printf("res: %g %g %g %g %g %g %g %g %g %g %g %g %g %d\n", res_dbl.a, res_dbl.b,
- res_dbl.c, res_dbl.d, res_dbl.e, res_dbl.f, res_dbl.g, res_dbl.h, res_dbl.i,
- res_dbl.j, res_dbl.k, res_dbl.l, res_dbl.m, res_dbl.n);
- /* { dg-output "\nres: 22 15 17 25 6 13 19 18 22 15 17 25 6 16" } */
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_108byte_gn, NULL, code) == FFI_OK);
-
- res_dbl = ((struct_108byte(*)(struct_108byte, struct_108byte,
- struct_108byte, struct_108byte))(code))(e_dbl, f_dbl, g_dbl, h_dbl);
- /* { dg-output "\n22 15 17 25 6 13 19 18 22 15 17 25 6 16" } */
- printf("res: %g %g %g %g %g %g %g %g %g %g %g %g %g %d\n", res_dbl.a, res_dbl.b,
- res_dbl.c, res_dbl.d, res_dbl.e, res_dbl.f, res_dbl.g, res_dbl.h, res_dbl.i,
- res_dbl.j, res_dbl.k, res_dbl.l, res_dbl.m, res_dbl.n);
- /* { dg-output "\nres: 22 15 17 25 6 13 19 18 22 15 17 25 6 16" } */
-
- exit(0);
-}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/stret_large2.c b/Modules/_ctypes/libffi/testsuite/libffi.call/stret_large2.c
deleted file mode 100644
index d9c750ee1c..0000000000
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/stret_large2.c
+++ /dev/null
@@ -1,148 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Check structure returning with different structure size.
- Depending on the ABI. Check bigger struct which overlaps
- the gp and fp register count on Darwin/AIX/ppc64.
- Limitations: none.
- PR: none.
- Originator: Blake Chaffin 6/21/2007 */
-
-/* { dg-do run { xfail strongarm*-*-* xscale*-*-* } } */
-#include "ffitest.h"
-
-/* 13 FPRs: 104 bytes */
-/* 14 FPRs: 112 bytes */
-
-typedef struct struct_116byte {
- double a;
- double b;
- double c;
- double d;
- double e;
- double f;
- double g;
- double h;
- double i;
- double j;
- double k;
- double l;
- double m;
- double n;
- int o;
-} struct_116byte;
-
-struct_116byte cls_struct_116byte_fn(
- struct_116byte b0,
- struct_116byte b1,
- struct_116byte b2,
- struct_116byte b3)
-{
- struct_116byte result;
-
- result.a = b0.a + b1.a + b2.a + b3.a;
- result.b = b0.b + b1.b + b2.b + b3.b;
- result.c = b0.c + b1.c + b2.c + b3.c;
- result.d = b0.d + b1.d + b2.d + b3.d;
- result.e = b0.e + b1.e + b2.e + b3.e;
- result.f = b0.f + b1.f + b2.f + b3.f;
- result.g = b0.g + b1.g + b2.g + b3.g;
- result.h = b0.h + b1.h + b2.h + b3.h;
- result.i = b0.i + b1.i + b2.i + b3.i;
- result.j = b0.j + b1.j + b2.j + b3.j;
- result.k = b0.k + b1.k + b2.k + b3.k;
- result.l = b0.l + b1.l + b2.l + b3.l;
- result.m = b0.m + b1.m + b2.m + b3.m;
- result.n = b0.n + b1.n + b2.n + b3.n;
- result.o = b0.o + b1.o + b2.o + b3.o;
-
- printf("%g %g %g %g %g %g %g %g %g %g %g %g %g %g %d\n", result.a, result.b, result.c,
- result.d, result.e, result.f, result.g, result.h, result.i,
- result.j, result.k, result.l, result.m, result.n, result.o);
-
- return result;
-}
-
-static void
-cls_struct_116byte_gn(ffi_cif* cif __UNUSED__, void* resp, void** args, void* userdata __UNUSED__)
-{
- struct_116byte b0, b1, b2, b3;
-
- b0 = *(struct_116byte*)(args[0]);
- b1 = *(struct_116byte*)(args[1]);
- b2 = *(struct_116byte*)(args[2]);
- b3 = *(struct_116byte*)(args[3]);
-
- *(struct_116byte*)resp = cls_struct_116byte_fn(b0, b1, b2, b3);
-}
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- void* args_dbl[5];
- ffi_type* cls_struct_fields[16];
- ffi_type cls_struct_type;
- ffi_type* dbl_arg_types[5];
-
- struct_116byte e_dbl = { 9.0, 2.0, 6.0, 5.0, 3.0, 4.0, 8.0, 1.0, 1.0, 2.0, 3.0, 7.0, 2.0, 5.0, 7 };
- struct_116byte f_dbl = { 1.0, 2.0, 3.0, 7.0, 2.0, 5.0, 6.0, 7.0, 4.0, 5.0, 7.0, 9.0, 1.0, 6.0, 4 };
- struct_116byte g_dbl = { 4.0, 5.0, 7.0, 9.0, 1.0, 1.0, 2.0, 9.0, 8.0, 6.0, 1.0, 4.0, 0.0, 7.0, 3 };
- struct_116byte h_dbl = { 8.0, 6.0, 1.0, 4.0, 0.0, 3.0, 3.0, 1.0, 9.0, 2.0, 6.0, 5.0, 3.0, 8.0, 2 };
- struct_116byte res_dbl;
-
- cls_struct_type.size = 0;
- cls_struct_type.alignment = 0;
- cls_struct_type.type = FFI_TYPE_STRUCT;
- cls_struct_type.elements = cls_struct_fields;
-
- cls_struct_fields[0] = &ffi_type_double;
- cls_struct_fields[1] = &ffi_type_double;
- cls_struct_fields[2] = &ffi_type_double;
- cls_struct_fields[3] = &ffi_type_double;
- cls_struct_fields[4] = &ffi_type_double;
- cls_struct_fields[5] = &ffi_type_double;
- cls_struct_fields[6] = &ffi_type_double;
- cls_struct_fields[7] = &ffi_type_double;
- cls_struct_fields[8] = &ffi_type_double;
- cls_struct_fields[9] = &ffi_type_double;
- cls_struct_fields[10] = &ffi_type_double;
- cls_struct_fields[11] = &ffi_type_double;
- cls_struct_fields[12] = &ffi_type_double;
- cls_struct_fields[13] = &ffi_type_double;
- cls_struct_fields[14] = &ffi_type_sint32;
- cls_struct_fields[15] = NULL;
-
- dbl_arg_types[0] = &cls_struct_type;
- dbl_arg_types[1] = &cls_struct_type;
- dbl_arg_types[2] = &cls_struct_type;
- dbl_arg_types[3] = &cls_struct_type;
- dbl_arg_types[4] = NULL;
-
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 4, &cls_struct_type,
- dbl_arg_types) == FFI_OK);
-
- args_dbl[0] = &e_dbl;
- args_dbl[1] = &f_dbl;
- args_dbl[2] = &g_dbl;
- args_dbl[3] = &h_dbl;
- args_dbl[4] = NULL;
-
- ffi_call(&cif, FFI_FN(cls_struct_116byte_fn), &res_dbl, args_dbl);
- /* { dg-output "22 15 17 25 6 13 19 18 22 15 17 25 6 26 16" } */
- printf("res: %g %g %g %g %g %g %g %g %g %g %g %g %g %g %d\n", res_dbl.a, res_dbl.b,
- res_dbl.c, res_dbl.d, res_dbl.e, res_dbl.f, res_dbl.g, res_dbl.h, res_dbl.i,
- res_dbl.j, res_dbl.k, res_dbl.l, res_dbl.m, res_dbl.n, res_dbl.o);
- /* { dg-output "\nres: 22 15 17 25 6 13 19 18 22 15 17 25 6 26 16" } */
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_116byte_gn, NULL, code) == FFI_OK);
-
- res_dbl = ((struct_116byte(*)(struct_116byte, struct_116byte,
- struct_116byte, struct_116byte))(code))(e_dbl, f_dbl, g_dbl, h_dbl);
- /* { dg-output "\n22 15 17 25 6 13 19 18 22 15 17 25 6 26 16" } */
- printf("res: %g %g %g %g %g %g %g %g %g %g %g %g %g %g %d\n", res_dbl.a, res_dbl.b,
- res_dbl.c, res_dbl.d, res_dbl.e, res_dbl.f, res_dbl.g, res_dbl.h, res_dbl.i,
- res_dbl.j, res_dbl.k, res_dbl.l, res_dbl.m, res_dbl.n, res_dbl.o);
- /* { dg-output "\nres: 22 15 17 25 6 13 19 18 22 15 17 25 6 26 16" } */
-
- exit(0);
-}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/stret_medium.c b/Modules/_ctypes/libffi/testsuite/libffi.call/stret_medium.c
deleted file mode 100644
index 973ee02ede..0000000000
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/stret_medium.c
+++ /dev/null
@@ -1,124 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Check structure returning with different structure size.
- Depending on the ABI. Check bigger struct which overlaps
- the gp and fp register count on Darwin/AIX/ppc64.
- Limitations: none.
- PR: none.
- Originator: Blake Chaffin 6/21/2007 */
-
-/* { dg-do run { xfail strongarm*-*-* xscale*-*-* } } */
-#include "ffitest.h"
-
-typedef struct struct_72byte {
- double a;
- double b;
- double c;
- double d;
- double e;
- double f;
- double g;
- double h;
- double i;
-} struct_72byte;
-
-struct_72byte cls_struct_72byte_fn(
- struct_72byte b0,
- struct_72byte b1,
- struct_72byte b2,
- struct_72byte b3)
-{
- struct_72byte result;
-
- result.a = b0.a + b1.a + b2.a + b3.a;
- result.b = b0.b + b1.b + b2.b + b3.b;
- result.c = b0.c + b1.c + b2.c + b3.c;
- result.d = b0.d + b1.d + b2.d + b3.d;
- result.e = b0.e + b1.e + b2.e + b3.e;
- result.f = b0.f + b1.f + b2.f + b3.f;
- result.g = b0.g + b1.g + b2.g + b3.g;
- result.h = b0.h + b1.h + b2.h + b3.h;
- result.i = b0.i + b1.i + b2.i + b3.i;
-
- printf("%g %g %g %g %g %g %g %g %g\n", result.a, result.b, result.c,
- result.d, result.e, result.f, result.g, result.h, result.i);
-
- return result;
-}
-
-static void
-cls_struct_72byte_gn(ffi_cif* cif __UNUSED__, void* resp, void** args, void* userdata __UNUSED__)
-{
- struct_72byte b0, b1, b2, b3;
-
- b0 = *(struct_72byte*)(args[0]);
- b1 = *(struct_72byte*)(args[1]);
- b2 = *(struct_72byte*)(args[2]);
- b3 = *(struct_72byte*)(args[3]);
-
- *(struct_72byte*)resp = cls_struct_72byte_fn(b0, b1, b2, b3);
-}
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- void* args_dbl[5];
- ffi_type* cls_struct_fields[10];
- ffi_type cls_struct_type;
- ffi_type* dbl_arg_types[5];
-
- struct_72byte e_dbl = { 9.0, 2.0, 6.0, 5.0, 3.0, 4.0, 8.0, 1.0, 7.0 };
- struct_72byte f_dbl = { 1.0, 2.0, 3.0, 7.0, 2.0, 5.0, 6.0, 7.0, 4.0 };
- struct_72byte g_dbl = { 4.0, 5.0, 7.0, 9.0, 1.0, 1.0, 2.0, 9.0, 3.0 };
- struct_72byte h_dbl = { 8.0, 6.0, 1.0, 4.0, 0.0, 3.0, 3.0, 1.0, 2.0 };
- struct_72byte res_dbl;
-
- cls_struct_type.size = 0;
- cls_struct_type.alignment = 0;
- cls_struct_type.type = FFI_TYPE_STRUCT;
- cls_struct_type.elements = cls_struct_fields;
-
- cls_struct_fields[0] = &ffi_type_double;
- cls_struct_fields[1] = &ffi_type_double;
- cls_struct_fields[2] = &ffi_type_double;
- cls_struct_fields[3] = &ffi_type_double;
- cls_struct_fields[4] = &ffi_type_double;
- cls_struct_fields[5] = &ffi_type_double;
- cls_struct_fields[6] = &ffi_type_double;
- cls_struct_fields[7] = &ffi_type_double;
- cls_struct_fields[8] = &ffi_type_double;
- cls_struct_fields[9] = NULL;
-
- dbl_arg_types[0] = &cls_struct_type;
- dbl_arg_types[1] = &cls_struct_type;
- dbl_arg_types[2] = &cls_struct_type;
- dbl_arg_types[3] = &cls_struct_type;
- dbl_arg_types[4] = NULL;
-
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 4, &cls_struct_type,
- dbl_arg_types) == FFI_OK);
-
- args_dbl[0] = &e_dbl;
- args_dbl[1] = &f_dbl;
- args_dbl[2] = &g_dbl;
- args_dbl[3] = &h_dbl;
- args_dbl[4] = NULL;
-
- ffi_call(&cif, FFI_FN(cls_struct_72byte_fn), &res_dbl, args_dbl);
- /* { dg-output "22 15 17 25 6 13 19 18 16" } */
- printf("res: %g %g %g %g %g %g %g %g %g\n", res_dbl.a, res_dbl.b, res_dbl.c,
- res_dbl.d, res_dbl.e, res_dbl.f, res_dbl.g, res_dbl.h, res_dbl.i);
- /* { dg-output "\nres: 22 15 17 25 6 13 19 18 16" } */
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_72byte_gn, NULL, code) == FFI_OK);
-
- res_dbl = ((struct_72byte(*)(struct_72byte, struct_72byte,
- struct_72byte, struct_72byte))(code))(e_dbl, f_dbl, g_dbl, h_dbl);
- /* { dg-output "\n22 15 17 25 6 13 19 18 16" } */
- printf("res: %g %g %g %g %g %g %g %g %g\n", res_dbl.a, res_dbl.b, res_dbl.c,
- res_dbl.d, res_dbl.e, res_dbl.f, res_dbl.g, res_dbl.h, res_dbl.i);
- /* { dg-output "\nres: 22 15 17 25 6 13 19 18 16" } */
-
- exit(0);
-}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/stret_medium2.c b/Modules/_ctypes/libffi/testsuite/libffi.call/stret_medium2.c
deleted file mode 100644
index 84323d16a9..0000000000
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/stret_medium2.c
+++ /dev/null
@@ -1,125 +0,0 @@
-/* Area: ffi_call, closure_call
- Purpose: Check structure returning with different structure size.
- Depending on the ABI. Check bigger struct which overlaps
- the gp and fp register count on Darwin/AIX/ppc64.
- Limitations: none.
- PR: none.
- Originator: Blake Chaffin 6/21/2007 */
-
-/* { dg-do run { xfail strongarm*-*-* xscale*-*-* } } */
-/* { dg-options "-Wno-format" { target alpha*-dec-osf* } } */
-#include "ffitest.h"
-
-typedef struct struct_72byte {
- double a;
- double b;
- double c;
- double d;
- double e;
- double f;
- double g;
- double h;
- long long i;
-} struct_72byte;
-
-struct_72byte cls_struct_72byte_fn(
- struct_72byte b0,
- struct_72byte b1,
- struct_72byte b2,
- struct_72byte b3)
-{
- struct_72byte result;
-
- result.a = b0.a + b1.a + b2.a + b3.a;
- result.b = b0.b + b1.b + b2.b + b3.b;
- result.c = b0.c + b1.c + b2.c + b3.c;
- result.d = b0.d + b1.d + b2.d + b3.d;
- result.e = b0.e + b1.e + b2.e + b3.e;
- result.f = b0.f + b1.f + b2.f + b3.f;
- result.g = b0.g + b1.g + b2.g + b3.g;
- result.h = b0.h + b1.h + b2.h + b3.h;
- result.i = b0.i + b1.i + b2.i + b3.i;
-
- printf("%g %g %g %g %g %g %g %g %" PRIdLL "\n", result.a, result.b, result.c,
- result.d, result.e, result.f, result.g, result.h, result.i);
-
- return result;
-}
-
-static void
-cls_struct_72byte_gn(ffi_cif* cif __UNUSED__, void* resp, void** args, void* userdata __UNUSED__)
-{
- struct_72byte b0, b1, b2, b3;
-
- b0 = *(struct_72byte*)(args[0]);
- b1 = *(struct_72byte*)(args[1]);
- b2 = *(struct_72byte*)(args[2]);
- b3 = *(struct_72byte*)(args[3]);
-
- *(struct_72byte*)resp = cls_struct_72byte_fn(b0, b1, b2, b3);
-}
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- void* args_dbl[5];
- ffi_type* cls_struct_fields[10];
- ffi_type cls_struct_type;
- ffi_type* dbl_arg_types[5];
-
- struct_72byte e_dbl = { 9.0, 2.0, 6.0, 5.0, 3.0, 4.0, 8.0, 1.0, 7 };
- struct_72byte f_dbl = { 1.0, 2.0, 3.0, 7.0, 2.0, 5.0, 6.0, 7.0, 4 };
- struct_72byte g_dbl = { 4.0, 5.0, 7.0, 9.0, 1.0, 1.0, 2.0, 9.0, 3 };
- struct_72byte h_dbl = { 8.0, 6.0, 1.0, 4.0, 0.0, 3.0, 3.0, 1.0, 2 };
- struct_72byte res_dbl;
-
- cls_struct_type.size = 0;
- cls_struct_type.alignment = 0;
- cls_struct_type.type = FFI_TYPE_STRUCT;
- cls_struct_type.elements = cls_struct_fields;
-
- cls_struct_fields[0] = &ffi_type_double;
- cls_struct_fields[1] = &ffi_type_double;
- cls_struct_fields[2] = &ffi_type_double;
- cls_struct_fields[3] = &ffi_type_double;
- cls_struct_fields[4] = &ffi_type_double;
- cls_struct_fields[5] = &ffi_type_double;
- cls_struct_fields[6] = &ffi_type_double;
- cls_struct_fields[7] = &ffi_type_double;
- cls_struct_fields[8] = &ffi_type_sint64;
- cls_struct_fields[9] = NULL;
-
- dbl_arg_types[0] = &cls_struct_type;
- dbl_arg_types[1] = &cls_struct_type;
- dbl_arg_types[2] = &cls_struct_type;
- dbl_arg_types[3] = &cls_struct_type;
- dbl_arg_types[4] = NULL;
-
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 4, &cls_struct_type,
- dbl_arg_types) == FFI_OK);
-
- args_dbl[0] = &e_dbl;
- args_dbl[1] = &f_dbl;
- args_dbl[2] = &g_dbl;
- args_dbl[3] = &h_dbl;
- args_dbl[4] = NULL;
-
- ffi_call(&cif, FFI_FN(cls_struct_72byte_fn), &res_dbl, args_dbl);
- /* { dg-output "22 15 17 25 6 13 19 18 16" } */
- printf("res: %g %g %g %g %g %g %g %g %" PRIdLL "\n", res_dbl.a, res_dbl.b, res_dbl.c,
- res_dbl.d, res_dbl.e, res_dbl.f, res_dbl.g, res_dbl.h, res_dbl.i);
- /* { dg-output "\nres: 22 15 17 25 6 13 19 18 16" } */
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_72byte_gn, NULL, code) == FFI_OK);
-
- res_dbl = ((struct_72byte(*)(struct_72byte, struct_72byte,
- struct_72byte, struct_72byte))(code))(e_dbl, f_dbl, g_dbl, h_dbl);
- /* { dg-output "\n22 15 17 25 6 13 19 18 16" } */
- printf("res: %g %g %g %g %g %g %g %g %" PRIdLL "\n", res_dbl.a, res_dbl.b, res_dbl.c,
- res_dbl.d, res_dbl.e, res_dbl.f, res_dbl.g, res_dbl.h, res_dbl.i);
- /* { dg-output "\nres: 22 15 17 25 6 13 19 18 16" } */
-
- exit(0);
-}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/strlen.c b/Modules/_ctypes/libffi/testsuite/libffi.call/strlen.c
deleted file mode 100644
index 35b70ea4e2..0000000000
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/strlen.c
+++ /dev/null
@@ -1,44 +0,0 @@
-/* Area: ffi_call
- Purpose: Check strlen function call.
- Limitations: none.
- PR: none.
- Originator: From the original ffitest.c */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-static size_t ABI_ATTR my_strlen(char *s)
-{
- return (strlen(s));
-}
-
-int main (void)
-{
- ffi_cif cif;
- ffi_type *args[MAX_ARGS];
- void *values[MAX_ARGS];
- ffi_arg rint;
- char *s;
-
- args[0] = &ffi_type_pointer;
- values[0] = (void*) &s;
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, ABI_NUM, 1,
- &ffi_type_sint, args) == FFI_OK);
-
- s = "a";
- ffi_call(&cif, FFI_FN(my_strlen), &rint, values);
- CHECK(rint == 1);
-
- s = "1234567";
- ffi_call(&cif, FFI_FN(my_strlen), &rint, values);
- CHECK(rint == 7);
-
- s = "1234567890123456789012345";
- ffi_call(&cif, FFI_FN(my_strlen), &rint, values);
- CHECK(rint == 25);
-
- exit (0);
-}
-
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/strlen2.c b/Modules/_ctypes/libffi/testsuite/libffi.call/strlen2.c
deleted file mode 100644
index 96282bc0a1..0000000000
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/strlen2.c
+++ /dev/null
@@ -1,49 +0,0 @@
-/* Area: ffi_call
- Purpose: Check strlen function call with additional arguments.
- Limitations: none.
- PR: none.
- Originator: From the original ffitest.c */
-
-/* { dg-do run } */
-
-#include "ffitest.h"
-
-static size_t ABI_ATTR my_f(char *s, float a)
-{
- return (size_t) ((int) strlen(s) + (int) a);
-}
-
-int main (void)
-{
- ffi_cif cif;
- ffi_type *args[MAX_ARGS];
- void *values[MAX_ARGS];
- ffi_arg rint;
- char *s;
- float v2;
- args[0] = &ffi_type_pointer;
- args[1] = &ffi_type_float;
- values[0] = (void*) &s;
- values[1] = (void*) &v2;
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, ABI_NUM, 2,
- &ffi_type_sint, args) == FFI_OK);
-
- s = "a";
- v2 = 0.0;
- ffi_call(&cif, FFI_FN(my_f), &rint, values);
- CHECK(rint == 1);
-
- s = "1234567";
- v2 = -1.0;
- ffi_call(&cif, FFI_FN(my_f), &rint, values);
- CHECK(rint == 6);
-
- s = "1234567890123456789012345";
- v2 = 1.0;
- ffi_call(&cif, FFI_FN(my_f), &rint, values);
- CHECK(rint == 26);
-
- exit(0);
-}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/strlen3.c b/Modules/_ctypes/libffi/testsuite/libffi.call/strlen3.c
deleted file mode 100644
index beba86e9ea..0000000000
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/strlen3.c
+++ /dev/null
@@ -1,49 +0,0 @@
-/* Area: ffi_call
- Purpose: Check strlen function call with additional arguments.
- Limitations: none.
- PR: none.
- Originator: From the original ffitest.c */
-
-/* { dg-do run } */
-
-#include "ffitest.h"
-
-static size_t ABI_ATTR my_f(float a, char *s)
-{
- return (size_t) ((int) strlen(s) + (int) a);
-}
-
-int main (void)
-{
- ffi_cif cif;
- ffi_type *args[MAX_ARGS];
- void *values[MAX_ARGS];
- ffi_arg rint;
- char *s;
- float v2;
- args[1] = &ffi_type_pointer;
- args[0] = &ffi_type_float;
- values[1] = (void*) &s;
- values[0] = (void*) &v2;
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, ABI_NUM, 2,
- &ffi_type_sint, args) == FFI_OK);
-
- s = "a";
- v2 = 0.0;
- ffi_call(&cif, FFI_FN(my_f), &rint, values);
- CHECK(rint == 1);
-
- s = "1234567";
- v2 = -1.0;
- ffi_call(&cif, FFI_FN(my_f), &rint, values);
- CHECK(rint == 6);
-
- s = "1234567890123456789012345";
- v2 = 1.0;
- ffi_call(&cif, FFI_FN(my_f), &rint, values);
- CHECK(rint == 26);
-
- exit(0);
-}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/strlen4.c b/Modules/_ctypes/libffi/testsuite/libffi.call/strlen4.c
deleted file mode 100644
index d5d42b4f6d..0000000000
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/strlen4.c
+++ /dev/null
@@ -1,55 +0,0 @@
-/* Area: ffi_call
- Purpose: Check strlen function call with additional arguments.
- Limitations: none.
- PR: none.
- Originator: From the original ffitest.c */
-
-/* { dg-do run } */
-
-#include "ffitest.h"
-
-static size_t ABI_ATTR my_f(float a, char *s, int i)
-{
- return (size_t) ((int) strlen(s) + (int) a + i);
-}
-
-int main (void)
-{
- ffi_cif cif;
- ffi_type *args[MAX_ARGS];
- void *values[MAX_ARGS];
- ffi_arg rint;
- char *s;
- int v1;
- float v2;
- args[2] = &ffi_type_sint;
- args[1] = &ffi_type_pointer;
- args[0] = &ffi_type_float;
- values[2] = (void*) &v1;
- values[1] = (void*) &s;
- values[0] = (void*) &v2;
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, ABI_NUM, 3,
- &ffi_type_sint, args) == FFI_OK);
-
- s = "a";
- v1 = 1;
- v2 = 0.0;
- ffi_call(&cif, FFI_FN(my_f), &rint, values);
- CHECK(rint == 2);
-
- s = "1234567";
- v2 = -1.0;
- v1 = -2;
- ffi_call(&cif, FFI_FN(my_f), &rint, values);
- CHECK(rint == 4);
-
- s = "1234567890123456789012345";
- v2 = 1.0;
- v1 = 2;
- ffi_call(&cif, FFI_FN(my_f), &rint, values);
- CHECK(rint == 28);
-
- exit(0);
-}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/struct1.c b/Modules/_ctypes/libffi/testsuite/libffi.call/struct1.c
deleted file mode 100644
index c13e23f872..0000000000
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/struct1.c
+++ /dev/null
@@ -1,67 +0,0 @@
-/* Area: ffi_call
- Purpose: Check structures.
- Limitations: none.
- PR: none.
- Originator: From the original ffitest.c */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-typedef struct
-{
- unsigned char uc;
- double d;
- unsigned int ui;
-} test_structure_1;
-
-static test_structure_1 ABI_ATTR struct1(test_structure_1 ts)
-{
- ts.uc++;
- ts.d--;
- ts.ui++;
-
- return ts;
-}
-
-int main (void)
-{
- ffi_cif cif;
- ffi_type *args[MAX_ARGS];
- void *values[MAX_ARGS];
- ffi_type ts1_type;
- ffi_type *ts1_type_elements[4];
-
- test_structure_1 ts1_arg;
-
- /* This is a hack to get a properly aligned result buffer */
- test_structure_1 *ts1_result =
- (test_structure_1 *) malloc (sizeof(test_structure_1));
-
- ts1_type.size = 0;
- ts1_type.alignment = 0;
- ts1_type.type = FFI_TYPE_STRUCT;
- ts1_type.elements = ts1_type_elements;
- ts1_type_elements[0] = &ffi_type_uchar;
- ts1_type_elements[1] = &ffi_type_double;
- ts1_type_elements[2] = &ffi_type_uint;
- ts1_type_elements[3] = NULL;
-
- args[0] = &ts1_type;
- values[0] = &ts1_arg;
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, ABI_NUM, 1,
- &ts1_type, args) == FFI_OK);
-
- ts1_arg.uc = '\x01';
- ts1_arg.d = 3.14159;
- ts1_arg.ui = 555;
-
- ffi_call(&cif, FFI_FN(struct1), ts1_result, values);
-
- CHECK(ts1_result->ui == 556);
- CHECK(ts1_result->d == 3.14159 - 1);
-
- free (ts1_result);
- exit(0);
-}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/struct2.c b/Modules/_ctypes/libffi/testsuite/libffi.call/struct2.c
deleted file mode 100644
index 5077a5ee45..0000000000
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/struct2.c
+++ /dev/null
@@ -1,67 +0,0 @@
-/* Area: ffi_call
- Purpose: Check structures.
- Limitations: none.
- PR: none.
- Originator: From the original ffitest.c */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-typedef struct
-{
- double d1;
- double d2;
-} test_structure_2;
-
-static test_structure_2 ABI_ATTR struct2(test_structure_2 ts)
-{
- ts.d1--;
- ts.d2--;
-
- return ts;
-}
-
-int main (void)
-{
- ffi_cif cif;
- ffi_type *args[MAX_ARGS];
- void *values[MAX_ARGS];
- test_structure_2 ts2_arg;
- ffi_type ts2_type;
- ffi_type *ts2_type_elements[3];
-
- /* This is a hack to get a properly aligned result buffer */
- test_structure_2 *ts2_result =
- (test_structure_2 *) malloc (sizeof(test_structure_2));
-
- ts2_type.size = 0;
- ts2_type.alignment = 0;
- ts2_type.type = FFI_TYPE_STRUCT;
- ts2_type.elements = ts2_type_elements;
- ts2_type_elements[0] = &ffi_type_double;
- ts2_type_elements[1] = &ffi_type_double;
- ts2_type_elements[2] = NULL;
-
- args[0] = &ts2_type;
- values[0] = &ts2_arg;
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, ABI_NUM, 1, &ts2_type, args) == FFI_OK);
-
- ts2_arg.d1 = 5.55;
- ts2_arg.d2 = 6.66;
-
- printf ("%g\n", ts2_arg.d1);
- printf ("%g\n", ts2_arg.d2);
-
- ffi_call(&cif, FFI_FN(struct2), ts2_result, values);
-
- printf ("%g\n", ts2_result->d1);
- printf ("%g\n", ts2_result->d2);
-
- CHECK(ts2_result->d1 == 5.55 - 1);
- CHECK(ts2_result->d2 == 6.66 - 1);
-
- free (ts2_result);
- exit(0);
-}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/struct3.c b/Modules/_ctypes/libffi/testsuite/libffi.call/struct3.c
deleted file mode 100644
index 7eba0ead6d..0000000000
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/struct3.c
+++ /dev/null
@@ -1,60 +0,0 @@
-/* Area: ffi_call
- Purpose: Check structures.
- Limitations: none.
- PR: none.
- Originator: From the original ffitest.c */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-typedef struct
-{
- int si;
-} test_structure_3;
-
-static test_structure_3 ABI_ATTR struct3(test_structure_3 ts)
-{
- ts.si = -(ts.si*2);
-
- return ts;
-}
-
-int main (void)
-{
- ffi_cif cif;
- ffi_type *args[MAX_ARGS];
- void *values[MAX_ARGS];
- int compare_value;
- ffi_type ts3_type;
- ffi_type *ts3_type_elements[2];
-
- test_structure_3 ts3_arg;
- test_structure_3 *ts3_result =
- (test_structure_3 *) malloc (sizeof(test_structure_3));
-
- ts3_type.size = 0;
- ts3_type.alignment = 0;
- ts3_type.type = FFI_TYPE_STRUCT;
- ts3_type.elements = ts3_type_elements;
- ts3_type_elements[0] = &ffi_type_sint;
- ts3_type_elements[1] = NULL;
-
- args[0] = &ts3_type;
- values[0] = &ts3_arg;
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, ABI_NUM, 1,
- &ts3_type, args) == FFI_OK);
-
- ts3_arg.si = -123;
- compare_value = ts3_arg.si;
-
- ffi_call(&cif, FFI_FN(struct3), ts3_result, values);
-
- printf ("%d %d\n", ts3_result->si, -(compare_value*2));
-
- CHECK(ts3_result->si == -(compare_value*2));
-
- free (ts3_result);
- exit(0);
-}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/struct4.c b/Modules/_ctypes/libffi/testsuite/libffi.call/struct4.c
deleted file mode 100644
index 66a9551dd6..0000000000
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/struct4.c
+++ /dev/null
@@ -1,64 +0,0 @@
-/* Area: ffi_call
- Purpose: Check structures.
- Limitations: none.
- PR: none.
- Originator: From the original ffitest.c */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-typedef struct
-{
- unsigned ui1;
- unsigned ui2;
- unsigned ui3;
-} test_structure_4;
-
-static test_structure_4 ABI_ATTR struct4(test_structure_4 ts)
-{
- ts.ui3 = ts.ui1 * ts.ui2 * ts.ui3;
-
- return ts;
-}
-
-int main (void)
-{
- ffi_cif cif;
- ffi_type *args[MAX_ARGS];
- void *values[MAX_ARGS];
- ffi_type ts4_type;
- ffi_type *ts4_type_elements[4];
-
- test_structure_4 ts4_arg;
-
- /* This is a hack to get a properly aligned result buffer */
- test_structure_4 *ts4_result =
- (test_structure_4 *) malloc (sizeof(test_structure_4));
-
- ts4_type.size = 0;
- ts4_type.alignment = 0;
- ts4_type.type = FFI_TYPE_STRUCT;
- ts4_type.elements = ts4_type_elements;
- ts4_type_elements[0] = &ffi_type_uint;
- ts4_type_elements[1] = &ffi_type_uint;
- ts4_type_elements[2] = &ffi_type_uint;
- ts4_type_elements[3] = NULL;
-
- args[0] = &ts4_type;
- values[0] = &ts4_arg;
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, ABI_NUM, 1, &ts4_type, args) == FFI_OK);
-
- ts4_arg.ui1 = 2;
- ts4_arg.ui2 = 3;
- ts4_arg.ui3 = 4;
-
- ffi_call (&cif, FFI_FN(struct4), ts4_result, values);
-
- CHECK(ts4_result->ui3 == 2U * 3U * 4U);
-
-
- free (ts4_result);
- exit(0);
-}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/struct5.c b/Modules/_ctypes/libffi/testsuite/libffi.call/struct5.c
deleted file mode 100644
index 23e2a3f745..0000000000
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/struct5.c
+++ /dev/null
@@ -1,66 +0,0 @@
-/* Area: ffi_call
- Purpose: Check structures.
- Limitations: none.
- PR: none.
- Originator: From the original ffitest.c */
-
-/* { dg-do run } */
-#include "ffitest.h"
-typedef struct
-{
- char c1;
- char c2;
-} test_structure_5;
-
-static test_structure_5 ABI_ATTR struct5(test_structure_5 ts1, test_structure_5 ts2)
-{
- ts1.c1 += ts2.c1;
- ts1.c2 -= ts2.c2;
-
- return ts1;
-}
-
-int main (void)
-{
- ffi_cif cif;
- ffi_type *args[MAX_ARGS];
- void *values[MAX_ARGS];
- ffi_type ts5_type;
- ffi_type *ts5_type_elements[3];
-
- test_structure_5 ts5_arg1, ts5_arg2;
-
- /* This is a hack to get a properly aligned result buffer */
- test_structure_5 *ts5_result =
- (test_structure_5 *) malloc (sizeof(test_structure_5));
-
- ts5_type.size = 0;
- ts5_type.alignment = 0;
- ts5_type.type = FFI_TYPE_STRUCT;
- ts5_type.elements = ts5_type_elements;
- ts5_type_elements[0] = &ffi_type_schar;
- ts5_type_elements[1] = &ffi_type_schar;
- ts5_type_elements[2] = NULL;
-
- args[0] = &ts5_type;
- args[1] = &ts5_type;
- values[0] = &ts5_arg1;
- values[1] = &ts5_arg2;
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, ABI_NUM, 2, &ts5_type, args) == FFI_OK);
-
- ts5_arg1.c1 = 2;
- ts5_arg1.c2 = 6;
- ts5_arg2.c1 = 5;
- ts5_arg2.c2 = 3;
-
- ffi_call (&cif, FFI_FN(struct5), ts5_result, values);
-
- CHECK(ts5_result->c1 == 7);
- CHECK(ts5_result->c2 == 3);
-
-
- free (ts5_result);
- exit(0);
-}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/struct6.c b/Modules/_ctypes/libffi/testsuite/libffi.call/struct6.c
deleted file mode 100644
index 173c66eb4d..0000000000
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/struct6.c
+++ /dev/null
@@ -1,64 +0,0 @@
-/* Area: ffi_call
- Purpose: Check structures.
- Limitations: none.
- PR: none.
- Originator: From the original ffitest.c */
-
-/* { dg-do run } */
-#include "ffitest.h"
-typedef struct
-{
- float f;
- double d;
-} test_structure_6;
-
-static test_structure_6 ABI_ATTR struct6 (test_structure_6 ts)
-{
- ts.f += 1;
- ts.d += 1;
-
- return ts;
-}
-
-int main (void)
-{
- ffi_cif cif;
- ffi_type *args[MAX_ARGS];
- void *values[MAX_ARGS];
- ffi_type ts6_type;
- ffi_type *ts6_type_elements[3];
-
- test_structure_6 ts6_arg;
-
- /* This is a hack to get a properly aligned result buffer */
- test_structure_6 *ts6_result =
- (test_structure_6 *) malloc (sizeof(test_structure_6));
-
- ts6_type.size = 0;
- ts6_type.alignment = 0;
- ts6_type.type = FFI_TYPE_STRUCT;
- ts6_type.elements = ts6_type_elements;
- ts6_type_elements[0] = &ffi_type_float;
- ts6_type_elements[1] = &ffi_type_double;
- ts6_type_elements[2] = NULL;
-
- args[0] = &ts6_type;
- values[0] = &ts6_arg;
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, ABI_NUM, 1, &ts6_type, args) == FFI_OK);
-
- ts6_arg.f = 5.55f;
- ts6_arg.d = 6.66;
-
- printf ("%g\n", ts6_arg.f);
- printf ("%g\n", ts6_arg.d);
-
- ffi_call(&cif, FFI_FN(struct6), ts6_result, values);
-
- CHECK(ts6_result->f == 5.55f + 1);
- CHECK(ts6_result->d == 6.66 + 1);
-
- free (ts6_result);
- exit(0);
-}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/struct7.c b/Modules/_ctypes/libffi/testsuite/libffi.call/struct7.c
deleted file mode 100644
index badc7e0556..0000000000
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/struct7.c
+++ /dev/null
@@ -1,74 +0,0 @@
-/* Area: ffi_call
- Purpose: Check structures.
- Limitations: none.
- PR: none.
- Originator: From the original ffitest.c */
-
-/* { dg-do run } */
-#include "ffitest.h"
-typedef struct
-{
- float f1;
- float f2;
- double d;
-} test_structure_7;
-
-static test_structure_7 ABI_ATTR struct7 (test_structure_7 ts)
-{
- ts.f1 += 1;
- ts.f2 += 1;
- ts.d += 1;
-
- return ts;
-}
-
-int main (void)
-{
- ffi_cif cif;
- ffi_type *args[MAX_ARGS];
- void *values[MAX_ARGS];
- ffi_type ts7_type;
- ffi_type *ts7_type_elements[4];
-
- test_structure_7 ts7_arg;
-
- /* This is a hack to get a properly aligned result buffer */
- test_structure_7 *ts7_result =
- (test_structure_7 *) malloc (sizeof(test_structure_7));
-
- ts7_type.size = 0;
- ts7_type.alignment = 0;
- ts7_type.type = FFI_TYPE_STRUCT;
- ts7_type.elements = ts7_type_elements;
- ts7_type_elements[0] = &ffi_type_float;
- ts7_type_elements[1] = &ffi_type_float;
- ts7_type_elements[2] = &ffi_type_double;
- ts7_type_elements[3] = NULL;
-
- args[0] = &ts7_type;
- values[0] = &ts7_arg;
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, ABI_NUM, 1, &ts7_type, args) == FFI_OK);
-
- ts7_arg.f1 = 5.55f;
- ts7_arg.f2 = 55.5f;
- ts7_arg.d = 6.66;
-
- printf ("%g\n", ts7_arg.f1);
- printf ("%g\n", ts7_arg.f2);
- printf ("%g\n", ts7_arg.d);
-
- ffi_call(&cif, FFI_FN(struct7), ts7_result, values);
-
- printf ("%g\n", ts7_result->f1);
- printf ("%g\n", ts7_result->f2);
- printf ("%g\n", ts7_result->d);
-
- CHECK(ts7_result->f1 == 5.55f + 1);
- CHECK(ts7_result->f2 == 55.5f + 1);
- CHECK(ts7_result->d == 6.66 + 1);
-
- free (ts7_result);
- exit(0);
-}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/struct8.c b/Modules/_ctypes/libffi/testsuite/libffi.call/struct8.c
deleted file mode 100644
index ef204ecbbc..0000000000
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/struct8.c
+++ /dev/null
@@ -1,81 +0,0 @@
-/* Area: ffi_call
- Purpose: Check structures.
- Limitations: none.
- PR: none.
- Originator: From the original ffitest.c */
-
-/* { dg-do run } */
-#include "ffitest.h"
-typedef struct
-{
- float f1;
- float f2;
- float f3;
- float f4;
-} test_structure_8;
-
-static test_structure_8 ABI_ATTR struct8 (test_structure_8 ts)
-{
- ts.f1 += 1;
- ts.f2 += 1;
- ts.f3 += 1;
- ts.f4 += 1;
-
- return ts;
-}
-
-int main (void)
-{
- ffi_cif cif;
- ffi_type *args[MAX_ARGS];
- void *values[MAX_ARGS];
- ffi_type ts8_type;
- ffi_type *ts8_type_elements[5];
-
- test_structure_8 ts8_arg;
-
- /* This is a hack to get a properly aligned result buffer */
- test_structure_8 *ts8_result =
- (test_structure_8 *) malloc (sizeof(test_structure_8));
-
- ts8_type.size = 0;
- ts8_type.alignment = 0;
- ts8_type.type = FFI_TYPE_STRUCT;
- ts8_type.elements = ts8_type_elements;
- ts8_type_elements[0] = &ffi_type_float;
- ts8_type_elements[1] = &ffi_type_float;
- ts8_type_elements[2] = &ffi_type_float;
- ts8_type_elements[3] = &ffi_type_float;
- ts8_type_elements[4] = NULL;
-
- args[0] = &ts8_type;
- values[0] = &ts8_arg;
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, ABI_NUM, 1, &ts8_type, args) == FFI_OK);
-
- ts8_arg.f1 = 5.55f;
- ts8_arg.f2 = 55.5f;
- ts8_arg.f3 = -5.55f;
- ts8_arg.f4 = -55.5f;
-
- printf ("%g\n", ts8_arg.f1);
- printf ("%g\n", ts8_arg.f2);
- printf ("%g\n", ts8_arg.f3);
- printf ("%g\n", ts8_arg.f4);
-
- ffi_call(&cif, FFI_FN(struct8), ts8_result, values);
-
- printf ("%g\n", ts8_result->f1);
- printf ("%g\n", ts8_result->f2);
- printf ("%g\n", ts8_result->f3);
- printf ("%g\n", ts8_result->f4);
-
- CHECK(ts8_result->f1 == 5.55f + 1);
- CHECK(ts8_result->f2 == 55.5f + 1);
- CHECK(ts8_result->f3 == -5.55f + 1);
- CHECK(ts8_result->f4 == -55.5f + 1);
-
- free (ts8_result);
- exit(0);
-}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/struct9.c b/Modules/_ctypes/libffi/testsuite/libffi.call/struct9.c
deleted file mode 100644
index 4a13b818c4..0000000000
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/struct9.c
+++ /dev/null
@@ -1,68 +0,0 @@
-/* Area: ffi_call
- Purpose: Check structures.
- Limitations: none.
- PR: none.
- Originator: From the original ffitest.c */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-typedef struct
-{
- float f;
- int i;
-} test_structure_9;
-
-static test_structure_9 ABI_ATTR struct9 (test_structure_9 ts)
-{
- ts.f += 1;
- ts.i += 1;
-
- return ts;
-}
-
-int main (void)
-{
- ffi_cif cif;
- ffi_type *args[MAX_ARGS];
- void *values[MAX_ARGS];
- ffi_type ts9_type;
- ffi_type *ts9_type_elements[3];
-
- test_structure_9 ts9_arg;
-
- /* This is a hack to get a properly aligned result buffer */
- test_structure_9 *ts9_result =
- (test_structure_9 *) malloc (sizeof(test_structure_9));
-
- ts9_type.size = 0;
- ts9_type.alignment = 0;
- ts9_type.type = FFI_TYPE_STRUCT;
- ts9_type.elements = ts9_type_elements;
- ts9_type_elements[0] = &ffi_type_float;
- ts9_type_elements[1] = &ffi_type_sint;
- ts9_type_elements[2] = NULL;
-
- args[0] = &ts9_type;
- values[0] = &ts9_arg;
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, ABI_NUM, 1, &ts9_type, args) == FFI_OK);
-
- ts9_arg.f = 5.55f;
- ts9_arg.i = 5;
-
- printf ("%g\n", ts9_arg.f);
- printf ("%d\n", ts9_arg.i);
-
- ffi_call(&cif, FFI_FN(struct9), ts9_result, values);
-
- printf ("%g\n", ts9_result->f);
- printf ("%d\n", ts9_result->i);
-
- CHECK(ts9_result->f == 5.55f + 1);
- CHECK(ts9_result->i == 5 + 1);
-
- free (ts9_result);
- exit(0);
-}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/testclosure.c b/Modules/_ctypes/libffi/testsuite/libffi.call/testclosure.c
deleted file mode 100644
index ca31056d8c..0000000000
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/testclosure.c
+++ /dev/null
@@ -1,70 +0,0 @@
-/* Area: closure_call
- Purpose: Check return value float.
- Limitations: none.
- PR: 41908.
- Originator: <rfm@gnu.org> 20091102 */
-
-/* { dg-do run } */
-#include "ffitest.h"
-
-typedef struct cls_struct_combined {
- float a;
- float b;
- float c;
- float d;
-} cls_struct_combined;
-
-void cls_struct_combined_fn(struct cls_struct_combined arg)
-{
- printf("%g %g %g %g\n",
- arg.a, arg.b,
- arg.c, arg.d);
- fflush(stdout);
-}
-
-static void
-cls_struct_combined_gn(ffi_cif* cif __UNUSED__, void* resp __UNUSED__,
- void** args, void* userdata __UNUSED__)
-{
- struct cls_struct_combined a0;
-
- a0 = *(struct cls_struct_combined*)(args[0]);
-
- cls_struct_combined_fn(a0);
-}
-
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code);
- ffi_type* cls_struct_fields0[5];
- ffi_type cls_struct_type0;
- ffi_type* dbl_arg_types[5];
-
- struct cls_struct_combined g_dbl = {4.0, 5.0, 1.0, 8.0};
-
- cls_struct_type0.size = 0;
- cls_struct_type0.alignment = 0;
- cls_struct_type0.type = FFI_TYPE_STRUCT;
- cls_struct_type0.elements = cls_struct_fields0;
-
- cls_struct_fields0[0] = &ffi_type_float;
- cls_struct_fields0[1] = &ffi_type_float;
- cls_struct_fields0[2] = &ffi_type_float;
- cls_struct_fields0[3] = &ffi_type_float;
- cls_struct_fields0[4] = NULL;
-
- dbl_arg_types[0] = &cls_struct_type0;
- dbl_arg_types[1] = NULL;
-
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1, &ffi_type_void,
- dbl_arg_types) == FFI_OK);
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, cls_struct_combined_gn, NULL, code) == FFI_OK);
-
- ((void(*)(cls_struct_combined)) (code))(g_dbl);
- /* { dg-output "4 5 1 8" } */
- exit(0);
-}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/uninitialized.c b/Modules/_ctypes/libffi/testsuite/libffi.call/uninitialized.c
deleted file mode 100644
index f00d830234..0000000000
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/uninitialized.c
+++ /dev/null
@@ -1,61 +0,0 @@
-/* { dg-do run } */
-#include "ffitest.h"
-
-typedef struct
-{
- unsigned char uc;
- double d;
- unsigned int ui;
-} test_structure_1;
-
-static test_structure_1 struct1(test_structure_1 ts)
-{
- ts.uc++;
- ts.d--;
- ts.ui++;
-
- return ts;
-}
-
-int main (void)
-{
- ffi_cif cif;
- ffi_type *args[MAX_ARGS];
- void *values[MAX_ARGS];
- ffi_type ts1_type;
- ffi_type *ts1_type_elements[4];
-
- memset(&cif, 1, sizeof(cif));
- ts1_type.size = 0;
- ts1_type.alignment = 0;
- ts1_type.type = FFI_TYPE_STRUCT;
- ts1_type.elements = ts1_type_elements;
- ts1_type_elements[0] = &ffi_type_uchar;
- ts1_type_elements[1] = &ffi_type_double;
- ts1_type_elements[2] = &ffi_type_uint;
- ts1_type_elements[3] = NULL;
-
- test_structure_1 ts1_arg;
- /* This is a hack to get a properly aligned result buffer */
- test_structure_1 *ts1_result =
- (test_structure_1 *) malloc (sizeof(test_structure_1));
-
- args[0] = &ts1_type;
- values[0] = &ts1_arg;
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1,
- &ts1_type, args) == FFI_OK);
-
- ts1_arg.uc = '\x01';
- ts1_arg.d = 3.14159;
- ts1_arg.ui = 555;
-
- ffi_call(&cif, FFI_FN(struct1), ts1_result, values);
-
- CHECK(ts1_result->ui == 556);
- CHECK(ts1_result->d == 3.14159 - 1);
-
- free (ts1_result);
- exit(0);
-}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/unwindtest.cc b/Modules/_ctypes/libffi/testsuite/libffi.call/unwindtest.cc
deleted file mode 100644
index 67cfefeca6..0000000000
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/unwindtest.cc
+++ /dev/null
@@ -1,117 +0,0 @@
-/* Area: ffi_closure, unwind info
- Purpose: Check if the unwind information is passed correctly.
- Limitations: none.
- PR: none.
- Originator: Jeff Sturm <jsturm@one-point.com> */
-
-/* { dg-do run } */
-
-#include "ffitest.h"
-
-void ABI_ATTR
-closure_test_fn(ffi_cif* cif __UNUSED__, void* resp __UNUSED__,
- void** args __UNUSED__, void* userdata __UNUSED__)
-{
- throw 9;
-}
-
-typedef void (*closure_test_type)();
-
-void closure_test_fn1(ffi_cif* cif __UNUSED__, void* resp,
- void** args, void* userdata __UNUSED__)
- {
- *(ffi_arg*)resp =
- (int)*(float *)args[0] +(int)(*(float *)args[1]) +
- (int)(*(float *)args[2]) + (int)*(float *)args[3] +
- (int)(*(signed short *)args[4]) + (int)(*(float *)args[5]) +
- (int)*(float *)args[6] + (int)(*(int *)args[7]) +
- (int)(*(double*)args[8]) + (int)*(int *)args[9] +
- (int)(*(int *)args[10]) + (int)(*(float *)args[11]) +
- (int)*(int *)args[12] + (int)(*(int *)args[13]) +
- (int)(*(int *)args[14]) + *(int *)args[15] + (int)(intptr_t)userdata;
-
- printf("%d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d: %d\n",
- (int)*(float *)args[0], (int)(*(float *)args[1]),
- (int)(*(float *)args[2]), (int)*(float *)args[3],
- (int)(*(signed short *)args[4]), (int)(*(float *)args[5]),
- (int)*(float *)args[6], (int)(*(int *)args[7]),
- (int)(*(double *)args[8]), (int)*(int *)args[9],
- (int)(*(int *)args[10]), (int)(*(float *)args[11]),
- (int)*(int *)args[12], (int)(*(int *)args[13]),
- (int)(*(int *)args[14]), *(int *)args[15],
- (int)(intptr_t)userdata, (int)*(ffi_arg*)resp);
-
- throw (int)*(ffi_arg*)resp;
-}
-
-typedef int (*closure_test_type1)(float, float, float, float, signed short,
- float, float, int, double, int, int, float,
- int, int, int, int);
-
-int main (void)
-{
- ffi_cif cif;
- void *code;
- ffi_closure *pcl = (ffi_closure *)ffi_closure_alloc(sizeof(ffi_closure), &code);
- ffi_type * cl_arg_types[17];
-
- {
- cl_arg_types[1] = NULL;
-
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 0,
- &ffi_type_void, cl_arg_types) == FFI_OK);
- CHECK(ffi_prep_closure_loc(pcl, &cif, closure_test_fn, NULL, code) == FFI_OK);
-
- try
- {
- (*((closure_test_type)(code)))();
- } catch (int exception_code)
- {
- CHECK(exception_code == 9);
- }
-
- printf("part one OK\n");
- /* { dg-output "part one OK" } */
- }
-
- {
-
- cl_arg_types[0] = &ffi_type_float;
- cl_arg_types[1] = &ffi_type_float;
- cl_arg_types[2] = &ffi_type_float;
- cl_arg_types[3] = &ffi_type_float;
- cl_arg_types[4] = &ffi_type_sshort;
- cl_arg_types[5] = &ffi_type_float;
- cl_arg_types[6] = &ffi_type_float;
- cl_arg_types[7] = &ffi_type_uint;
- cl_arg_types[8] = &ffi_type_double;
- cl_arg_types[9] = &ffi_type_uint;
- cl_arg_types[10] = &ffi_type_uint;
- cl_arg_types[11] = &ffi_type_float;
- cl_arg_types[12] = &ffi_type_uint;
- cl_arg_types[13] = &ffi_type_uint;
- cl_arg_types[14] = &ffi_type_uint;
- cl_arg_types[15] = &ffi_type_uint;
- cl_arg_types[16] = NULL;
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 16,
- &ffi_type_sint, cl_arg_types) == FFI_OK);
-
- CHECK(ffi_prep_closure_loc(pcl, &cif, closure_test_fn1,
- (void *) 3 /* userdata */, code) == FFI_OK);
- try
- {
- (*((closure_test_type1)code))
- (1.1, 2.2, 3.3, 4.4, 127, 5.5, 6.6, 8, 9, 10, 11, 12.0, 13,
- 19, 21, 1);
- /* { dg-output "\n1 2 3 4 127 5 6 8 9 10 11 12 13 19 21 1 3: 255" } */
- } catch (int exception_code)
- {
- CHECK(exception_code == 255);
- }
- printf("part two OK\n");
- /* { dg-output "\npart two OK" } */
- }
- exit(0);
-}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/unwindtest_ffi_call.cc b/Modules/_ctypes/libffi/testsuite/libffi.call/unwindtest_ffi_call.cc
deleted file mode 100644
index ec611647e3..0000000000
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/unwindtest_ffi_call.cc
+++ /dev/null
@@ -1,54 +0,0 @@
-/* Area: ffi_call, unwind info
- Purpose: Check if the unwind information is passed correctly.
- Limitations: none.
- PR: none.
- Originator: Andreas Tobler <andreast@gcc.gnu.org> 20061213 */
-
-/* { dg-do run } */
-
-#include "ffitest.h"
-
-static int checking(int a __UNUSED__, short b __UNUSED__,
- signed char c __UNUSED__)
-{
- throw 9;
-}
-
-int main (void)
-{
- ffi_cif cif;
- ffi_type *args[MAX_ARGS];
- void *values[MAX_ARGS];
- ffi_arg rint;
-
- signed int si;
- signed short ss;
- signed char sc;
-
- args[0] = &ffi_type_sint;
- values[0] = &si;
- args[1] = &ffi_type_sshort;
- values[1] = &ss;
- args[2] = &ffi_type_schar;
- values[2] = &sc;
-
- /* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 3,
- &ffi_type_sint, args) == FFI_OK);
-
- si = -6;
- ss = -12;
- sc = -1;
- {
- try
- {
- ffi_call(&cif, FFI_FN(checking), &rint, values);
- } catch (int exception_code)
- {
- CHECK(exception_code == 9);
- }
- printf("part one OK\n");
- /* { dg-output "part one OK" } */
- }
- exit(0);
-}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/va_1.c b/Modules/_ctypes/libffi/testsuite/libffi.call/va_1.c
deleted file mode 100644
index 7f96809ea9..0000000000
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/va_1.c
+++ /dev/null
@@ -1,196 +0,0 @@
-/* Area: ffi_call
- Purpose: Test passing struct in variable argument lists.
- Limitations: none.
- PR: none.
- Originator: ARM Ltd. */
-
-/* { dg-do run } */
-/* { dg-output "" { xfail avr32*-*-* } } */
-
-#include "ffitest.h"
-#include <stdarg.h>
-
-struct small_tag
-{
- unsigned char a;
- unsigned char b;
-};
-
-struct large_tag
-{
- unsigned a;
- unsigned b;
- unsigned c;
- unsigned d;
- unsigned e;
-};
-
-static int
-test_fn (int n, ...)
-{
- va_list ap;
- struct small_tag s1;
- struct small_tag s2;
- struct large_tag l;
- unsigned char uc;
- signed char sc;
- unsigned short us;
- signed short ss;
- unsigned int ui;
- signed int si;
- unsigned long ul;
- signed long sl;
- float f;
- double d;
-
- va_start (ap, n);
- s1 = va_arg (ap, struct small_tag);
- l = va_arg (ap, struct large_tag);
- s2 = va_arg (ap, struct small_tag);
-
- uc = va_arg (ap, unsigned);
- sc = va_arg (ap, signed);
-
- us = va_arg (ap, unsigned);
- ss = va_arg (ap, signed);
-
- ui = va_arg (ap, unsigned int);
- si = va_arg (ap, signed int);
-
- ul = va_arg (ap, unsigned long);
- sl = va_arg (ap, signed long);
-
- f = va_arg (ap, double); /* C standard promotes float->double
- when anonymous */
- d = va_arg (ap, double);
-
- printf ("%u %u %u %u %u %u %u %u %u uc=%u sc=%d %u %d %u %d %lu %ld %f %f\n",
- s1.a, s1.b, l.a, l.b, l.c, l.d, l.e,
- s2.a, s2.b,
- uc, sc,
- us, ss,
- ui, si,
- ul, sl,
- f, d);
- va_end (ap);
- return n + 1;
-}
-
-int
-main (void)
-{
- ffi_cif cif;
- void* args[15];
- ffi_type* arg_types[15];
-
- ffi_type s_type;
- ffi_type *s_type_elements[3];
-
- ffi_type l_type;
- ffi_type *l_type_elements[6];
-
- struct small_tag s1;
- struct small_tag s2;
- struct large_tag l1;
-
- int n;
- ffi_arg res;
-
- unsigned char uc;
- signed char sc;
- unsigned short us;
- signed short ss;
- unsigned int ui;
- signed int si;
- unsigned long ul;
- signed long sl;
- double d1;
- double f1;
-
- s_type.size = 0;
- s_type.alignment = 0;
- s_type.type = FFI_TYPE_STRUCT;
- s_type.elements = s_type_elements;
-
- s_type_elements[0] = &ffi_type_uchar;
- s_type_elements[1] = &ffi_type_uchar;
- s_type_elements[2] = NULL;
-
- l_type.size = 0;
- l_type.alignment = 0;
- l_type.type = FFI_TYPE_STRUCT;
- l_type.elements = l_type_elements;
-
- l_type_elements[0] = &ffi_type_uint;
- l_type_elements[1] = &ffi_type_uint;
- l_type_elements[2] = &ffi_type_uint;
- l_type_elements[3] = &ffi_type_uint;
- l_type_elements[4] = &ffi_type_uint;
- l_type_elements[5] = NULL;
-
- arg_types[0] = &ffi_type_sint;
- arg_types[1] = &s_type;
- arg_types[2] = &l_type;
- arg_types[3] = &s_type;
- arg_types[4] = &ffi_type_uchar;
- arg_types[5] = &ffi_type_schar;
- arg_types[6] = &ffi_type_ushort;
- arg_types[7] = &ffi_type_sshort;
- arg_types[8] = &ffi_type_uint;
- arg_types[9] = &ffi_type_sint;
- arg_types[10] = &ffi_type_ulong;
- arg_types[11] = &ffi_type_slong;
- arg_types[12] = &ffi_type_double;
- arg_types[13] = &ffi_type_double;
- arg_types[14] = NULL;
-
- CHECK(ffi_prep_cif_var(&cif, FFI_DEFAULT_ABI, 1, 14, &ffi_type_sint, arg_types) == FFI_OK);
-
- s1.a = 5;
- s1.b = 6;
-
- l1.a = 10;
- l1.b = 11;
- l1.c = 12;
- l1.d = 13;
- l1.e = 14;
-
- s2.a = 7;
- s2.b = 8;
-
- n = 41;
-
- uc = 9;
- sc = 10;
- us = 11;
- ss = 12;
- ui = 13;
- si = 14;
- ul = 15;
- sl = 16;
- f1 = 2.12;
- d1 = 3.13;
-
- args[0] = &n;
- args[1] = &s1;
- args[2] = &l1;
- args[3] = &s2;
- args[4] = &uc;
- args[5] = &sc;
- args[6] = &us;
- args[7] = &ss;
- args[8] = &ui;
- args[9] = &si;
- args[10] = &ul;
- args[11] = &sl;
- args[12] = &f1;
- args[13] = &d1;
- args[14] = NULL;
-
- ffi_call(&cif, FFI_FN(test_fn), &res, args);
- /* { dg-output "5 6 10 11 12 13 14 7 8 uc=9 sc=10 11 12 13 14 15 16 2.120000 3.130000" } */
- printf("res: %d\n", (int) res);
- /* { dg-output "\nres: 42" } */
-
- return 0;
-}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/va_struct1.c b/Modules/_ctypes/libffi/testsuite/libffi.call/va_struct1.c
deleted file mode 100644
index e6452061c1..0000000000
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/va_struct1.c
+++ /dev/null
@@ -1,121 +0,0 @@
-/* Area: ffi_call
- Purpose: Test passing struct in variable argument lists.
- Limitations: none.
- PR: none.
- Originator: ARM Ltd. */
-
-/* { dg-do run } */
-/* { dg-output "" { xfail avr32*-*-* } } */
-
-#include "ffitest.h"
-#include <stdarg.h>
-
-struct small_tag
-{
- unsigned char a;
- unsigned char b;
-};
-
-struct large_tag
-{
- unsigned a;
- unsigned b;
- unsigned c;
- unsigned d;
- unsigned e;
-};
-
-static int
-test_fn (int n, ...)
-{
- va_list ap;
- struct small_tag s1;
- struct small_tag s2;
- struct large_tag l;
-
- va_start (ap, n);
- s1 = va_arg (ap, struct small_tag);
- l = va_arg (ap, struct large_tag);
- s2 = va_arg (ap, struct small_tag);
- printf ("%u %u %u %u %u %u %u %u %u\n", s1.a, s1.b, l.a, l.b, l.c, l.d, l.e,
- s2.a, s2.b);
- va_end (ap);
- return n + 1;
-}
-
-int
-main (void)
-{
- ffi_cif cif;
- void* args[5];
- ffi_type* arg_types[5];
-
- ffi_type s_type;
- ffi_type *s_type_elements[3];
-
- ffi_type l_type;
- ffi_type *l_type_elements[6];
-
- struct small_tag s1;
- struct small_tag s2;
- struct large_tag l1;
-
- int n;
- ffi_arg res;
-
- s_type.size = 0;
- s_type.alignment = 0;
- s_type.type = FFI_TYPE_STRUCT;
- s_type.elements = s_type_elements;
-
- s_type_elements[0] = &ffi_type_uchar;
- s_type_elements[1] = &ffi_type_uchar;
- s_type_elements[2] = NULL;
-
- l_type.size = 0;
- l_type.alignment = 0;
- l_type.type = FFI_TYPE_STRUCT;
- l_type.elements = l_type_elements;
-
- l_type_elements[0] = &ffi_type_uint;
- l_type_elements[1] = &ffi_type_uint;
- l_type_elements[2] = &ffi_type_uint;
- l_type_elements[3] = &ffi_type_uint;
- l_type_elements[4] = &ffi_type_uint;
- l_type_elements[5] = NULL;
-
- arg_types[0] = &ffi_type_sint;
- arg_types[1] = &s_type;
- arg_types[2] = &l_type;
- arg_types[3] = &s_type;
- arg_types[4] = NULL;
-
- CHECK(ffi_prep_cif_var(&cif, FFI_DEFAULT_ABI, 1, 4, &ffi_type_sint, arg_types) == FFI_OK);
-
- s1.a = 5;
- s1.b = 6;
-
- l1.a = 10;
- l1.b = 11;
- l1.c = 12;
- l1.d = 13;
- l1.e = 14;
-
- s2.a = 7;
- s2.b = 8;
-
- n = 41;
-
- args[0] = &n;
- args[1] = &s1;
- args[2] = &l1;
- args[3] = &s2;
- args[4] = NULL;
-
- ffi_call(&cif, FFI_FN(test_fn), &res, args);
- /* { dg-output "5 6 10 11 12 13 14 7 8" } */
- printf("res: %d\n", (int) res);
- /* { dg-output "\nres: 42" } */
-
- return 0;
-}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/va_struct2.c b/Modules/_ctypes/libffi/testsuite/libffi.call/va_struct2.c
deleted file mode 100644
index 56f5b9c75f..0000000000
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/va_struct2.c
+++ /dev/null
@@ -1,123 +0,0 @@
-/* Area: ffi_call
- Purpose: Test passing struct in variable argument lists.
- Limitations: none.
- PR: none.
- Originator: ARM Ltd. */
-
-/* { dg-do run } */
-/* { dg-output "" { xfail avr32*-*-* } } */
-
-#include "ffitest.h"
-#include <stdarg.h>
-
-struct small_tag
-{
- unsigned char a;
- unsigned char b;
-};
-
-struct large_tag
-{
- unsigned a;
- unsigned b;
- unsigned c;
- unsigned d;
- unsigned e;
-};
-
-static struct small_tag
-test_fn (int n, ...)
-{
- va_list ap;
- struct small_tag s1;
- struct small_tag s2;
- struct large_tag l;
-
- va_start (ap, n);
- s1 = va_arg (ap, struct small_tag);
- l = va_arg (ap, struct large_tag);
- s2 = va_arg (ap, struct small_tag);
- printf ("%u %u %u %u %u %u %u %u %u\n", s1.a, s1.b, l.a, l.b, l.c, l.d, l.e,
- s2.a, s2.b);
- va_end (ap);
- s1.a += s2.a;
- s1.b += s2.b;
- return s1;
-}
-
-int
-main (void)
-{
- ffi_cif cif;
- void* args[5];
- ffi_type* arg_types[5];
-
- ffi_type s_type;
- ffi_type *s_type_elements[3];
-
- ffi_type l_type;
- ffi_type *l_type_elements[6];
-
- struct small_tag s1;
- struct small_tag s2;
- struct large_tag l1;
-
- int n;
- struct small_tag res;
-
- s_type.size = 0;
- s_type.alignment = 0;
- s_type.type = FFI_TYPE_STRUCT;
- s_type.elements = s_type_elements;
-
- s_type_elements[0] = &ffi_type_uchar;
- s_type_elements[1] = &ffi_type_uchar;
- s_type_elements[2] = NULL;
-
- l_type.size = 0;
- l_type.alignment = 0;
- l_type.type = FFI_TYPE_STRUCT;
- l_type.elements = l_type_elements;
-
- l_type_elements[0] = &ffi_type_uint;
- l_type_elements[1] = &ffi_type_uint;
- l_type_elements[2] = &ffi_type_uint;
- l_type_elements[3] = &ffi_type_uint;
- l_type_elements[4] = &ffi_type_uint;
- l_type_elements[5] = NULL;
-
- arg_types[0] = &ffi_type_sint;
- arg_types[1] = &s_type;
- arg_types[2] = &l_type;
- arg_types[3] = &s_type;
- arg_types[4] = NULL;
-
- CHECK(ffi_prep_cif_var(&cif, FFI_DEFAULT_ABI, 1, 4, &s_type, arg_types) == FFI_OK);
-
- s1.a = 5;
- s1.b = 6;
-
- l1.a = 10;
- l1.b = 11;
- l1.c = 12;
- l1.d = 13;
- l1.e = 14;
-
- s2.a = 7;
- s2.b = 8;
-
- n = 41;
-
- args[0] = &n;
- args[1] = &s1;
- args[2] = &l1;
- args[3] = &s2;
- args[4] = NULL;
-
- ffi_call(&cif, FFI_FN(test_fn), &res, args);
- /* { dg-output "5 6 10 11 12 13 14 7 8" } */
- printf("res: %d %d\n", res.a, res.b);
- /* { dg-output "\nres: 12 14" } */
-
- return 0;
-}
diff --git a/Modules/_ctypes/libffi/testsuite/libffi.call/va_struct3.c b/Modules/_ctypes/libffi/testsuite/libffi.call/va_struct3.c
deleted file mode 100644
index 9a27e7fd4a..0000000000
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/va_struct3.c
+++ /dev/null
@@ -1,125 +0,0 @@
-/* Area: ffi_call
- Purpose: Test passing struct in variable argument lists.
- Limitations: none.
- PR: none.
- Originator: ARM Ltd. */
-
-/* { dg-do run } */
-/* { dg-output "" { xfail avr32*-*-* } } */
-
-#include "ffitest.h"
-#include <stdarg.h>
-
-struct small_tag
-{
- unsigned char a;
- unsigned char b;
-};
-
-struct large_tag
-{
- unsigned a;
- unsigned b;
- unsigned c;
- unsigned d;
- unsigned e;
-};
-
-static struct large_tag
-test_fn (int n, ...)
-{
- va_list ap;
- struct small_tag s1;
- struct small_tag s2;
- struct large_tag l;
-
- va_start (ap, n);
- s1 = va_arg (ap, struct small_tag);
- l = va_arg (ap, struct large_tag);
- s2 = va_arg (ap, struct small_tag);
- printf ("%u %u %u %u %u %u %u %u %u\n", s1.a, s1.b, l.a, l.b, l.c, l.d, l.e,
- s2.a, s2.b);
- va_end (ap);
- l.a += s1.a;
- l.b += s1.b;
- l.c += s2.a;
- l.d += s2.b;
- return l;
-}
-
-int
-main (void)
-{
- ffi_cif cif;
- void* args[5];
- ffi_type* arg_types[5];
-
- ffi_type s_type;
- ffi_type *s_type_elements[3];
-
- ffi_type l_type;
- ffi_type *l_type_elements[6];
-
- struct small_tag s1;
- struct small_tag s2;
- struct large_tag l1;
-
- int n;
- struct large_tag res;
-
- s_type.size = 0;
- s_type.alignment = 0;
- s_type.type = FFI_TYPE_STRUCT;
- s_type.elements = s_type_elements;
-
- s_type_elements[0] = &ffi_type_uchar;
- s_type_elements[1] = &ffi_type_uchar;
- s_type_elements[2] = NULL;
-
- l_type.size = 0;
- l_type.alignment = 0;
- l_type.type = FFI_TYPE_STRUCT;
- l_type.elements = l_type_elements;
-
- l_type_elements[0] = &ffi_type_uint;
- l_type_elements[1] = &ffi_type_uint;
- l_type_elements[2] = &ffi_type_uint;
- l_type_elements[3] = &ffi_type_uint;
- l_type_elements[4] = &ffi_type_uint;
- l_type_elements[5] = NULL;
-
- arg_types[0] = &ffi_type_sint;
- arg_types[1] = &s_type;
- arg_types[2] = &l_type;
- arg_types[3] = &s_type;
- arg_types[4] = NULL;
-
- CHECK(ffi_prep_cif_var(&cif, FFI_DEFAULT_ABI, 1, 4, &l_type, arg_types) == FFI_OK);
-
- s1.a = 5;
- s1.b = 6;
-
- l1.a = 10;
- l1.b = 11;
- l1.c = 12;
- l1.d = 13;
- l1.e = 14;
-
- s2.a = 7;
- s2.b = 8;
-
- n = 41;
-
- args[0] = &n;
- args[1] = &s1;
- args[2] = &l1;
- args[3] = &s2;
- args[4] = NULL;
-
- ffi_call(&cif, FFI_FN(test_fn), &res, args);
- /* { dg-output "5 6 10 11 12 13 14 7 8" } */
- printf("res: %d %d %d %d %d\n", res.a, res.b, res.c, res.d, res.e);
- /* { dg-output "\nres: 15 17 19 21 14" } */
-
- return 0;
-}
diff --git a/Modules/_ctypes/libffi/texinfo.tex b/Modules/_ctypes/libffi/texinfo.tex
deleted file mode 100644
index 85f184cc4c..0000000000
--- a/Modules/_ctypes/libffi/texinfo.tex
+++ /dev/null
@@ -1,10079 +0,0 @@
-% texinfo.tex -- TeX macros to handle Texinfo files.
-%
-% Load plain if necessary, i.e., if running under initex.
-\expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi
-%
-\def\texinfoversion{2013-02-01.11}
-%
-% Copyright 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995,
-% 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
-% 2007, 2008, 2009, 2010, 2011, 2012, 2013 Free Software Foundation, Inc.
-%
-% This texinfo.tex 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 3 of the
-% License, or (at your option) any later version.
-%
-% This texinfo.tex file 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, see <http://www.gnu.org/licenses/>.
-%
-% As a special exception, when this file is read by TeX when processing
-% a Texinfo source document, you may use the result without
-% restriction. This Exception is an additional permission under section 7
-% of the GNU General Public License, version 3 ("GPLv3").
-%
-% Please try the latest version of texinfo.tex before submitting bug
-% reports; you can get the latest version from:
-% http://ftp.gnu.org/gnu/texinfo/ (the Texinfo release area), or
-% http://ftpmirror.gnu.org/texinfo/ (same, via a mirror), or
-% http://www.gnu.org/software/texinfo/ (the Texinfo home page)
-% The texinfo.tex in any given distribution could well be out
-% of date, so if that's what you're using, please check.
-%
-% Send bug reports to bug-texinfo@gnu.org. Please include including a
-% complete document in each bug report with which we can reproduce the
-% problem. Patches are, of course, greatly appreciated.
-%
-% To process a Texinfo manual with TeX, it's most reliable to use the
-% texi2dvi shell script that comes with the distribution. For a simple
-% manual foo.texi, however, you can get away with this:
-% tex foo.texi
-% texindex foo.??
-% tex foo.texi
-% tex foo.texi
-% dvips foo.dvi -o # or whatever; this makes foo.ps.
-% The extra TeX runs get the cross-reference information correct.
-% Sometimes one run after texindex suffices, and sometimes you need more
-% than two; texi2dvi does it as many times as necessary.
-%
-% It is possible to adapt texinfo.tex for other languages, to some
-% extent. You can get the existing language-specific files from the
-% full Texinfo distribution.
-%
-% The GNU Texinfo home page is http://www.gnu.org/software/texinfo.
-
-
-\message{Loading texinfo [version \texinfoversion]:}
-
-% If in a .fmt file, print the version number
-% and turn on active characters that we couldn't do earlier because
-% they might have appeared in the input file name.
-\everyjob{\message{[Texinfo version \texinfoversion]}%
- \catcode`+=\active \catcode`\_=\active}
-
-\chardef\other=12
-
-% We never want plain's \outer definition of \+ in Texinfo.
-% For @tex, we can use \tabalign.
-\let\+ = \relax
-
-% Save some plain tex macros whose names we will redefine.
-\let\ptexb=\b
-\let\ptexbullet=\bullet
-\let\ptexc=\c
-\let\ptexcomma=\,
-\let\ptexdot=\.
-\let\ptexdots=\dots
-\let\ptexend=\end
-\let\ptexequiv=\equiv
-\let\ptexexclam=\!
-\let\ptexfootnote=\footnote
-\let\ptexgtr=>
-\let\ptexhat=^
-\let\ptexi=\i
-\let\ptexindent=\indent
-\let\ptexinsert=\insert
-\let\ptexlbrace=\{
-\let\ptexless=<
-\let\ptexnewwrite\newwrite
-\let\ptexnoindent=\noindent
-\let\ptexplus=+
-\let\ptexraggedright=\raggedright
-\let\ptexrbrace=\}
-\let\ptexslash=\/
-\let\ptexstar=\*
-\let\ptext=\t
-\let\ptextop=\top
-{\catcode`\'=\active \global\let\ptexquoteright'}% active in plain's math mode
-
-% If this character appears in an error message or help string, it
-% starts a new line in the output.
-\newlinechar = `^^J
-
-% Use TeX 3.0's \inputlineno to get the line number, for better error
-% messages, but if we're using an old version of TeX, don't do anything.
-%
-\ifx\inputlineno\thisisundefined
- \let\linenumber = \empty % Pre-3.0.
-\else
- \def\linenumber{l.\the\inputlineno:\space}
-\fi
-
-% Set up fixed words for English if not already set.
-\ifx\putwordAppendix\undefined \gdef\putwordAppendix{Appendix}\fi
-\ifx\putwordChapter\undefined \gdef\putwordChapter{Chapter}\fi
-\ifx\putworderror\undefined \gdef\putworderror{error}\fi
-\ifx\putwordfile\undefined \gdef\putwordfile{file}\fi
-\ifx\putwordin\undefined \gdef\putwordin{in}\fi
-\ifx\putwordIndexIsEmpty\undefined \gdef\putwordIndexIsEmpty{(Index is empty)}\fi
-\ifx\putwordIndexNonexistent\undefined \gdef\putwordIndexNonexistent{(Index is nonexistent)}\fi
-\ifx\putwordInfo\undefined \gdef\putwordInfo{Info}\fi
-\ifx\putwordInstanceVariableof\undefined \gdef\putwordInstanceVariableof{Instance Variable of}\fi
-\ifx\putwordMethodon\undefined \gdef\putwordMethodon{Method on}\fi
-\ifx\putwordNoTitle\undefined \gdef\putwordNoTitle{No Title}\fi
-\ifx\putwordof\undefined \gdef\putwordof{of}\fi
-\ifx\putwordon\undefined \gdef\putwordon{on}\fi
-\ifx\putwordpage\undefined \gdef\putwordpage{page}\fi
-\ifx\putwordsection\undefined \gdef\putwordsection{section}\fi
-\ifx\putwordSection\undefined \gdef\putwordSection{Section}\fi
-\ifx\putwordsee\undefined \gdef\putwordsee{see}\fi
-\ifx\putwordSee\undefined \gdef\putwordSee{See}\fi
-\ifx\putwordShortTOC\undefined \gdef\putwordShortTOC{Short Contents}\fi
-\ifx\putwordTOC\undefined \gdef\putwordTOC{Table of Contents}\fi
-%
-\ifx\putwordMJan\undefined \gdef\putwordMJan{January}\fi
-\ifx\putwordMFeb\undefined \gdef\putwordMFeb{February}\fi
-\ifx\putwordMMar\undefined \gdef\putwordMMar{March}\fi
-\ifx\putwordMApr\undefined \gdef\putwordMApr{April}\fi
-\ifx\putwordMMay\undefined \gdef\putwordMMay{May}\fi
-\ifx\putwordMJun\undefined \gdef\putwordMJun{June}\fi
-\ifx\putwordMJul\undefined \gdef\putwordMJul{July}\fi
-\ifx\putwordMAug\undefined \gdef\putwordMAug{August}\fi
-\ifx\putwordMSep\undefined \gdef\putwordMSep{September}\fi
-\ifx\putwordMOct\undefined \gdef\putwordMOct{October}\fi
-\ifx\putwordMNov\undefined \gdef\putwordMNov{November}\fi
-\ifx\putwordMDec\undefined \gdef\putwordMDec{December}\fi
-%
-\ifx\putwordDefmac\undefined \gdef\putwordDefmac{Macro}\fi
-\ifx\putwordDefspec\undefined \gdef\putwordDefspec{Special Form}\fi
-\ifx\putwordDefvar\undefined \gdef\putwordDefvar{Variable}\fi
-\ifx\putwordDefopt\undefined \gdef\putwordDefopt{User Option}\fi
-\ifx\putwordDeffunc\undefined \gdef\putwordDeffunc{Function}\fi
-
-% Since the category of space is not known, we have to be careful.
-\chardef\spacecat = 10
-\def\spaceisspace{\catcode`\ =\spacecat}
-
-% sometimes characters are active, so we need control sequences.
-\chardef\ampChar = `\&
-\chardef\colonChar = `\:
-\chardef\commaChar = `\,
-\chardef\dashChar = `\-
-\chardef\dotChar = `\.
-\chardef\exclamChar= `\!
-\chardef\hashChar = `\#
-\chardef\lquoteChar= `\`
-\chardef\questChar = `\?
-\chardef\rquoteChar= `\'
-\chardef\semiChar = `\;
-\chardef\slashChar = `\/
-\chardef\underChar = `\_
-
-% Ignore a token.
-%
-\def\gobble#1{}
-
-% The following is used inside several \edef's.
-\def\makecsname#1{\expandafter\noexpand\csname#1\endcsname}
-
-% Hyphenation fixes.
-\hyphenation{
- Flor-i-da Ghost-script Ghost-view Mac-OS Post-Script
- ap-pen-dix bit-map bit-maps
- data-base data-bases eshell fall-ing half-way long-est man-u-script
- man-u-scripts mini-buf-fer mini-buf-fers over-view par-a-digm
- par-a-digms rath-er rec-tan-gu-lar ro-bot-ics se-vere-ly set-up spa-ces
- spell-ing spell-ings
- stand-alone strong-est time-stamp time-stamps which-ever white-space
- wide-spread wrap-around
-}
-
-% Margin to add to right of even pages, to left of odd pages.
-\newdimen\bindingoffset
-\newdimen\normaloffset
-\newdimen\pagewidth \newdimen\pageheight
-
-% For a final copy, take out the rectangles
-% that mark overfull boxes (in case you have decided
-% that the text looks ok even though it passes the margin).
-%
-\def\finalout{\overfullrule=0pt }
-
-% Sometimes it is convenient to have everything in the transcript file
-% and nothing on the terminal. We don't just call \tracingall here,
-% since that produces some useless output on the terminal. We also make
-% some effort to order the tracing commands to reduce output in the log
-% file; cf. trace.sty in LaTeX.
-%
-\def\gloggingall{\begingroup \globaldefs = 1 \loggingall \endgroup}%
-\def\loggingall{%
- \tracingstats2
- \tracingpages1
- \tracinglostchars2 % 2 gives us more in etex
- \tracingparagraphs1
- \tracingoutput1
- \tracingmacros2
- \tracingrestores1
- \showboxbreadth\maxdimen \showboxdepth\maxdimen
- \ifx\eTeXversion\thisisundefined\else % etex gives us more logging
- \tracingscantokens1
- \tracingifs1
- \tracinggroups1
- \tracingnesting2
- \tracingassigns1
- \fi
- \tracingcommands3 % 3 gives us more in etex
- \errorcontextlines16
-}%
-
-% @errormsg{MSG}. Do the index-like expansions on MSG, but if things
-% aren't perfect, it's not the end of the world, being an error message,
-% after all.
-%
-\def\errormsg{\begingroup \indexnofonts \doerrormsg}
-\def\doerrormsg#1{\errmessage{#1}}
-
-% add check for \lastpenalty to plain's definitions. If the last thing
-% we did was a \nobreak, we don't want to insert more space.
-%
-\def\smallbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\smallskipamount
- \removelastskip\penalty-50\smallskip\fi\fi}
-\def\medbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\medskipamount
- \removelastskip\penalty-100\medskip\fi\fi}
-\def\bigbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\bigskipamount
- \removelastskip\penalty-200\bigskip\fi\fi}
-
-% Do @cropmarks to get crop marks.
-%
-\newif\ifcropmarks
-\let\cropmarks = \cropmarkstrue
-%
-% Dimensions to add cropmarks at corners.
-% Added by P. A. MacKay, 12 Nov. 1986
-%
-\newdimen\outerhsize \newdimen\outervsize % set by the paper size routines
-\newdimen\cornerlong \cornerlong=1pc
-\newdimen\cornerthick \cornerthick=.3pt
-\newdimen\topandbottommargin \topandbottommargin=.75in
-
-% Output a mark which sets \thischapter, \thissection and \thiscolor.
-% We dump everything together because we only have one kind of mark.
-% This works because we only use \botmark / \topmark, not \firstmark.
-%
-% A mark contains a subexpression of the \ifcase ... \fi construct.
-% \get*marks macros below extract the needed part using \ifcase.
-%
-% Another complication is to let the user choose whether \thischapter
-% (\thissection) refers to the chapter (section) in effect at the top
-% of a page, or that at the bottom of a page. The solution is
-% described on page 260 of The TeXbook. It involves outputting two
-% marks for the sectioning macros, one before the section break, and
-% one after. I won't pretend I can describe this better than DEK...
-\def\domark{%
- \toks0=\expandafter{\lastchapterdefs}%
- \toks2=\expandafter{\lastsectiondefs}%
- \toks4=\expandafter{\prevchapterdefs}%
- \toks6=\expandafter{\prevsectiondefs}%
- \toks8=\expandafter{\lastcolordefs}%
- \mark{%
- \the\toks0 \the\toks2
- \noexpand\or \the\toks4 \the\toks6
- \noexpand\else \the\toks8
- }%
-}
-% \topmark doesn't work for the very first chapter (after the title
-% page or the contents), so we use \firstmark there -- this gets us
-% the mark with the chapter defs, unless the user sneaks in, e.g.,
-% @setcolor (or @url, or @link, etc.) between @contents and the very
-% first @chapter.
-\def\gettopheadingmarks{%
- \ifcase0\topmark\fi
- \ifx\thischapter\empty \ifcase0\firstmark\fi \fi
-}
-\def\getbottomheadingmarks{\ifcase1\botmark\fi}
-\def\getcolormarks{\ifcase2\topmark\fi}
-
-% Avoid "undefined control sequence" errors.
-\def\lastchapterdefs{}
-\def\lastsectiondefs{}
-\def\prevchapterdefs{}
-\def\prevsectiondefs{}
-\def\lastcolordefs{}
-
-% Main output routine.
-\chardef\PAGE = 255
-\output = {\onepageout{\pagecontents\PAGE}}
-
-\newbox\headlinebox
-\newbox\footlinebox
-
-% \onepageout takes a vbox as an argument. Note that \pagecontents
-% does insertions, but you have to call it yourself.
-\def\onepageout#1{%
- \ifcropmarks \hoffset=0pt \else \hoffset=\normaloffset \fi
- %
- \ifodd\pageno \advance\hoffset by \bindingoffset
- \else \advance\hoffset by -\bindingoffset\fi
- %
- % Do this outside of the \shipout so @code etc. will be expanded in
- % the headline as they should be, not taken literally (outputting ''code).
- \ifodd\pageno \getoddheadingmarks \else \getevenheadingmarks \fi
- \setbox\headlinebox = \vbox{\let\hsize=\pagewidth \makeheadline}%
- \ifodd\pageno \getoddfootingmarks \else \getevenfootingmarks \fi
- \setbox\footlinebox = \vbox{\let\hsize=\pagewidth \makefootline}%
- %
- {%
- % Have to do this stuff outside the \shipout because we want it to
- % take effect in \write's, yet the group defined by the \vbox ends
- % before the \shipout runs.
- %
- \indexdummies % don't expand commands in the output.
- \normalturnoffactive % \ in index entries must not stay \, e.g., if
- % the page break happens to be in the middle of an example.
- % We don't want .vr (or whatever) entries like this:
- % \entry{{\tt \indexbackslash }acronym}{32}{\code {\acronym}}
- % "\acronym" won't work when it's read back in;
- % it needs to be
- % {\code {{\tt \backslashcurfont }acronym}
- \shipout\vbox{%
- % Do this early so pdf references go to the beginning of the page.
- \ifpdfmakepagedest \pdfdest name{\the\pageno} xyz\fi
- %
- \ifcropmarks \vbox to \outervsize\bgroup
- \hsize = \outerhsize
- \vskip-\topandbottommargin
- \vtop to0pt{%
- \line{\ewtop\hfil\ewtop}%
- \nointerlineskip
- \line{%
- \vbox{\moveleft\cornerthick\nstop}%
- \hfill
- \vbox{\moveright\cornerthick\nstop}%
- }%
- \vss}%
- \vskip\topandbottommargin
- \line\bgroup
- \hfil % center the page within the outer (page) hsize.
- \ifodd\pageno\hskip\bindingoffset\fi
- \vbox\bgroup
- \fi
- %
- \unvbox\headlinebox
- \pagebody{#1}%
- \ifdim\ht\footlinebox > 0pt
- % Only leave this space if the footline is nonempty.
- % (We lessened \vsize for it in \oddfootingyyy.)
- % The \baselineskip=24pt in plain's \makefootline has no effect.
- \vskip 24pt
- \unvbox\footlinebox
- \fi
- %
- \ifcropmarks
- \egroup % end of \vbox\bgroup
- \hfil\egroup % end of (centering) \line\bgroup
- \vskip\topandbottommargin plus1fill minus1fill
- \boxmaxdepth = \cornerthick
- \vbox to0pt{\vss
- \line{%
- \vbox{\moveleft\cornerthick\nsbot}%
- \hfill
- \vbox{\moveright\cornerthick\nsbot}%
- }%
- \nointerlineskip
- \line{\ewbot\hfil\ewbot}%
- }%
- \egroup % \vbox from first cropmarks clause
- \fi
- }% end of \shipout\vbox
- }% end of group with \indexdummies
- \advancepageno
- \ifnum\outputpenalty>-20000 \else\dosupereject\fi
-}
-
-\newinsert\margin \dimen\margin=\maxdimen
-
-\def\pagebody#1{\vbox to\pageheight{\boxmaxdepth=\maxdepth #1}}
-{\catcode`\@ =11
-\gdef\pagecontents#1{\ifvoid\topins\else\unvbox\topins\fi
-% marginal hacks, juha@viisa.uucp (Juha Takala)
-\ifvoid\margin\else % marginal info is present
- \rlap{\kern\hsize\vbox to\z@{\kern1pt\box\margin \vss}}\fi
-\dimen@=\dp#1\relax \unvbox#1\relax
-\ifvoid\footins\else\vskip\skip\footins\footnoterule \unvbox\footins\fi
-\ifr@ggedbottom \kern-\dimen@ \vfil \fi}
-}
-
-% Here are the rules for the cropmarks. Note that they are
-% offset so that the space between them is truly \outerhsize or \outervsize
-% (P. A. MacKay, 12 November, 1986)
-%
-\def\ewtop{\vrule height\cornerthick depth0pt width\cornerlong}
-\def\nstop{\vbox
- {\hrule height\cornerthick depth\cornerlong width\cornerthick}}
-\def\ewbot{\vrule height0pt depth\cornerthick width\cornerlong}
-\def\nsbot{\vbox
- {\hrule height\cornerlong depth\cornerthick width\cornerthick}}
-
-% Parse an argument, then pass it to #1. The argument is the rest of
-% the input line (except we remove a trailing comment). #1 should be a
-% macro which expects an ordinary undelimited TeX argument.
-%
-\def\parsearg{\parseargusing{}}
-\def\parseargusing#1#2{%
- \def\argtorun{#2}%
- \begingroup
- \obeylines
- \spaceisspace
- #1%
- \parseargline\empty% Insert the \empty token, see \finishparsearg below.
-}
-
-{\obeylines %
- \gdef\parseargline#1^^M{%
- \endgroup % End of the group started in \parsearg.
- \argremovecomment #1\comment\ArgTerm%
- }%
-}
-
-% First remove any @comment, then any @c comment.
-\def\argremovecomment#1\comment#2\ArgTerm{\argremovec #1\c\ArgTerm}
-\def\argremovec#1\c#2\ArgTerm{\argcheckspaces#1\^^M\ArgTerm}
-
-% Each occurrence of `\^^M' or `<space>\^^M' is replaced by a single space.
-%
-% \argremovec might leave us with trailing space, e.g.,
-% @end itemize @c foo
-% This space token undergoes the same procedure and is eventually removed
-% by \finishparsearg.
-%
-\def\argcheckspaces#1\^^M{\argcheckspacesX#1\^^M \^^M}
-\def\argcheckspacesX#1 \^^M{\argcheckspacesY#1\^^M}
-\def\argcheckspacesY#1\^^M#2\^^M#3\ArgTerm{%
- \def\temp{#3}%
- \ifx\temp\empty
- % Do not use \next, perhaps the caller of \parsearg uses it; reuse \temp:
- \let\temp\finishparsearg
- \else
- \let\temp\argcheckspaces
- \fi
- % Put the space token in:
- \temp#1 #3\ArgTerm
-}
-
-% If a _delimited_ argument is enclosed in braces, they get stripped; so
-% to get _exactly_ the rest of the line, we had to prevent such situation.
-% We prepended an \empty token at the very beginning and we expand it now,
-% just before passing the control to \argtorun.
-% (Similarly, we have to think about #3 of \argcheckspacesY above: it is
-% either the null string, or it ends with \^^M---thus there is no danger
-% that a pair of braces would be stripped.
-%
-% But first, we have to remove the trailing space token.
-%
-\def\finishparsearg#1 \ArgTerm{\expandafter\argtorun\expandafter{#1}}
-
-% \parseargdef\foo{...}
-% is roughly equivalent to
-% \def\foo{\parsearg\Xfoo}
-% \def\Xfoo#1{...}
-%
-% Actually, I use \csname\string\foo\endcsname, ie. \\foo, as it is my
-% favourite TeX trick. --kasal, 16nov03
-
-\def\parseargdef#1{%
- \expandafter \doparseargdef \csname\string#1\endcsname #1%
-}
-\def\doparseargdef#1#2{%
- \def#2{\parsearg#1}%
- \def#1##1%
-}
-
-% Several utility definitions with active space:
-{
- \obeyspaces
- \gdef\obeyedspace{ }
-
- % Make each space character in the input produce a normal interword
- % space in the output. Don't allow a line break at this space, as this
- % is used only in environments like @example, where each line of input
- % should produce a line of output anyway.
- %
- \gdef\sepspaces{\obeyspaces\let =\tie}
-
- % If an index command is used in an @example environment, any spaces
- % therein should become regular spaces in the raw index file, not the
- % expansion of \tie (\leavevmode \penalty \@M \ ).
- \gdef\unsepspaces{\let =\space}
-}
-
-
-\def\flushcr{\ifx\par\lisppar \def\next##1{}\else \let\next=\relax \fi \next}
-
-% Define the framework for environments in texinfo.tex. It's used like this:
-%
-% \envdef\foo{...}
-% \def\Efoo{...}
-%
-% It's the responsibility of \envdef to insert \begingroup before the
-% actual body; @end closes the group after calling \Efoo. \envdef also
-% defines \thisenv, so the current environment is known; @end checks
-% whether the environment name matches. The \checkenv macro can also be
-% used to check whether the current environment is the one expected.
-%
-% Non-false conditionals (@iftex, @ifset) don't fit into this, so they
-% are not treated as environments; they don't open a group. (The
-% implementation of @end takes care not to call \endgroup in this
-% special case.)
-
-
-% At run-time, environments start with this:
-\def\startenvironment#1{\begingroup\def\thisenv{#1}}
-% initialize
-\let\thisenv\empty
-
-% ... but they get defined via ``\envdef\foo{...}'':
-\long\def\envdef#1#2{\def#1{\startenvironment#1#2}}
-\def\envparseargdef#1#2{\parseargdef#1{\startenvironment#1#2}}
-
-% Check whether we're in the right environment:
-\def\checkenv#1{%
- \def\temp{#1}%
- \ifx\thisenv\temp
- \else
- \badenverr
- \fi
-}
-
-% Environment mismatch, #1 expected:
-\def\badenverr{%
- \errhelp = \EMsimple
- \errmessage{This command can appear only \inenvironment\temp,
- not \inenvironment\thisenv}%
-}
-\def\inenvironment#1{%
- \ifx#1\empty
- outside of any environment%
- \else
- in environment \expandafter\string#1%
- \fi
-}
-
-% @end foo executes the definition of \Efoo.
-% But first, it executes a specialized version of \checkenv
-%
-\parseargdef\end{%
- \if 1\csname iscond.#1\endcsname
- \else
- % The general wording of \badenverr may not be ideal.
- \expandafter\checkenv\csname#1\endcsname
- \csname E#1\endcsname
- \endgroup
- \fi
-}
-
-\newhelp\EMsimple{Press RETURN to continue.}
-
-
-% Be sure we're in horizontal mode when doing a tie, since we make space
-% equivalent to this in @example-like environments. Otherwise, a space
-% at the beginning of a line will start with \penalty -- and
-% since \penalty is valid in vertical mode, we'd end up putting the
-% penalty on the vertical list instead of in the new paragraph.
-{\catcode`@ = 11
- % Avoid using \@M directly, because that causes trouble
- % if the definition is written into an index file.
- \global\let\tiepenalty = \@M
- \gdef\tie{\leavevmode\penalty\tiepenalty\ }
-}
-
-% @: forces normal size whitespace following.
-\def\:{\spacefactor=1000 }
-
-% @* forces a line break.
-\def\*{\unskip\hfil\break\hbox{}\ignorespaces}
-
-% @/ allows a line break.
-\let\/=\allowbreak
-
-% @. is an end-of-sentence period.
-\def\.{.\spacefactor=\endofsentencespacefactor\space}
-
-% @! is an end-of-sentence bang.
-\def\!{!\spacefactor=\endofsentencespacefactor\space}
-
-% @? is an end-of-sentence query.
-\def\?{?\spacefactor=\endofsentencespacefactor\space}
-
-% @frenchspacing on|off says whether to put extra space after punctuation.
-%
-\def\onword{on}
-\def\offword{off}
-%
-\parseargdef\frenchspacing{%
- \def\temp{#1}%
- \ifx\temp\onword \plainfrenchspacing
- \else\ifx\temp\offword \plainnonfrenchspacing
- \else
- \errhelp = \EMsimple
- \errmessage{Unknown @frenchspacing option `\temp', must be on|off}%
- \fi\fi
-}
-
-% @w prevents a word break. Without the \leavevmode, @w at the
-% beginning of a paragraph, when TeX is still in vertical mode, would
-% produce a whole line of output instead of starting the paragraph.
-\def\w#1{\leavevmode\hbox{#1}}
-
-% @group ... @end group forces ... to be all on one page, by enclosing
-% it in a TeX vbox. We use \vtop instead of \vbox to construct the box
-% to keep its height that of a normal line. According to the rules for
-% \topskip (p.114 of the TeXbook), the glue inserted is
-% max (\topskip - \ht (first item), 0). If that height is large,
-% therefore, no glue is inserted, and the space between the headline and
-% the text is small, which looks bad.
-%
-% Another complication is that the group might be very large. This can
-% cause the glue on the previous page to be unduly stretched, because it
-% does not have much material. In this case, it's better to add an
-% explicit \vfill so that the extra space is at the bottom. The
-% threshold for doing this is if the group is more than \vfilllimit
-% percent of a page (\vfilllimit can be changed inside of @tex).
-%
-\newbox\groupbox
-\def\vfilllimit{0.7}
-%
-\envdef\group{%
- \ifnum\catcode`\^^M=\active \else
- \errhelp = \groupinvalidhelp
- \errmessage{@group invalid in context where filling is enabled}%
- \fi
- \startsavinginserts
- %
- \setbox\groupbox = \vtop\bgroup
- % Do @comment since we are called inside an environment such as
- % @example, where each end-of-line in the input causes an
- % end-of-line in the output. We don't want the end-of-line after
- % the `@group' to put extra space in the output. Since @group
- % should appear on a line by itself (according to the Texinfo
- % manual), we don't worry about eating any user text.
- \comment
-}
-%
-% The \vtop produces a box with normal height and large depth; thus, TeX puts
-% \baselineskip glue before it, and (when the next line of text is done)
-% \lineskip glue after it. Thus, space below is not quite equal to space
-% above. But it's pretty close.
-\def\Egroup{%
- % To get correct interline space between the last line of the group
- % and the first line afterwards, we have to propagate \prevdepth.
- \endgraf % Not \par, as it may have been set to \lisppar.
- \global\dimen1 = \prevdepth
- \egroup % End the \vtop.
- % \dimen0 is the vertical size of the group's box.
- \dimen0 = \ht\groupbox \advance\dimen0 by \dp\groupbox
- % \dimen2 is how much space is left on the page (more or less).
- \dimen2 = \pageheight \advance\dimen2 by -\pagetotal
- % if the group doesn't fit on the current page, and it's a big big
- % group, force a page break.
- \ifdim \dimen0 > \dimen2
- \ifdim \pagetotal < \vfilllimit\pageheight
- \page
- \fi
- \fi
- \box\groupbox
- \prevdepth = \dimen1
- \checkinserts
-}
-%
-% TeX puts in an \escapechar (i.e., `@') at the beginning of the help
-% message, so this ends up printing `@group can only ...'.
-%
-\newhelp\groupinvalidhelp{%
-group can only be used in environments such as @example,^^J%
-where each line of input produces a line of output.}
-
-% @need space-in-mils
-% forces a page break if there is not space-in-mils remaining.
-
-\newdimen\mil \mil=0.001in
-
-\parseargdef\need{%
- % Ensure vertical mode, so we don't make a big box in the middle of a
- % paragraph.
- \par
- %
- % If the @need value is less than one line space, it's useless.
- \dimen0 = #1\mil
- \dimen2 = \ht\strutbox
- \advance\dimen2 by \dp\strutbox
- \ifdim\dimen0 > \dimen2
- %
- % Do a \strut just to make the height of this box be normal, so the
- % normal leading is inserted relative to the preceding line.
- % And a page break here is fine.
- \vtop to #1\mil{\strut\vfil}%
- %
- % TeX does not even consider page breaks if a penalty added to the
- % main vertical list is 10000 or more. But in order to see if the
- % empty box we just added fits on the page, we must make it consider
- % page breaks. On the other hand, we don't want to actually break the
- % page after the empty box. So we use a penalty of 9999.
- %
- % There is an extremely small chance that TeX will actually break the
- % page at this \penalty, if there are no other feasible breakpoints in
- % sight. (If the user is using lots of big @group commands, which
- % almost-but-not-quite fill up a page, TeX will have a hard time doing
- % good page breaking, for example.) However, I could not construct an
- % example where a page broke at this \penalty; if it happens in a real
- % document, then we can reconsider our strategy.
- \penalty9999
- %
- % Back up by the size of the box, whether we did a page break or not.
- \kern -#1\mil
- %
- % Do not allow a page break right after this kern.
- \nobreak
- \fi
-}
-
-% @br forces paragraph break (and is undocumented).
-
-\let\br = \par
-
-% @page forces the start of a new page.
-%
-\def\page{\par\vfill\supereject}
-
-% @exdent text....
-% outputs text on separate line in roman font, starting at standard page margin
-
-% This records the amount of indent in the innermost environment.
-% That's how much \exdent should take out.
-\newskip\exdentamount
-
-% This defn is used inside fill environments such as @defun.
-\parseargdef\exdent{\hfil\break\hbox{\kern -\exdentamount{\rm#1}}\hfil\break}
-
-% This defn is used inside nofill environments such as @example.
-\parseargdef\nofillexdent{{\advance \leftskip by -\exdentamount
- \leftline{\hskip\leftskip{\rm#1}}}}
-
-% @inmargin{WHICH}{TEXT} puts TEXT in the WHICH margin next to the current
-% paragraph. For more general purposes, use the \margin insertion
-% class. WHICH is `l' or `r'. Not documented, written for gawk manual.
-%
-\newskip\inmarginspacing \inmarginspacing=1cm
-\def\strutdepth{\dp\strutbox}
-%
-\def\doinmargin#1#2{\strut\vadjust{%
- \nobreak
- \kern-\strutdepth
- \vtop to \strutdepth{%
- \baselineskip=\strutdepth
- \vss
- % if you have multiple lines of stuff to put here, you'll need to
- % make the vbox yourself of the appropriate size.
- \ifx#1l%
- \llap{\ignorespaces #2\hskip\inmarginspacing}%
- \else
- \rlap{\hskip\hsize \hskip\inmarginspacing \ignorespaces #2}%
- \fi
- \null
- }%
-}}
-\def\inleftmargin{\doinmargin l}
-\def\inrightmargin{\doinmargin r}
-%
-% @inmargin{TEXT [, RIGHT-TEXT]}
-% (if RIGHT-TEXT is given, use TEXT for left page, RIGHT-TEXT for right;
-% else use TEXT for both).
-%
-\def\inmargin#1{\parseinmargin #1,,\finish}
-\def\parseinmargin#1,#2,#3\finish{% not perfect, but better than nothing.
- \setbox0 = \hbox{\ignorespaces #2}%
- \ifdim\wd0 > 0pt
- \def\lefttext{#1}% have both texts
- \def\righttext{#2}%
- \else
- \def\lefttext{#1}% have only one text
- \def\righttext{#1}%
- \fi
- %
- \ifodd\pageno
- \def\temp{\inrightmargin\righttext}% odd page -> outside is right margin
- \else
- \def\temp{\inleftmargin\lefttext}%
- \fi
- \temp
-}
-
-% @| inserts a changebar to the left of the current line. It should
-% surround any changed text. This approach does *not* work if the
-% change spans more than two lines of output. To handle that, we would
-% have adopt a much more difficult approach (putting marks into the main
-% vertical list for the beginning and end of each change). This command
-% is not documented, not supported, and doesn't work.
-%
-\def\|{%
- % \vadjust can only be used in horizontal mode.
- \leavevmode
- %
- % Append this vertical mode material after the current line in the output.
- \vadjust{%
- % We want to insert a rule with the height and depth of the current
- % leading; that is exactly what \strutbox is supposed to record.
- \vskip-\baselineskip
- %
- % \vadjust-items are inserted at the left edge of the type. So
- % the \llap here moves out into the left-hand margin.
- \llap{%
- %
- % For a thicker or thinner bar, change the `1pt'.
- \vrule height\baselineskip width1pt
- %
- % This is the space between the bar and the text.
- \hskip 12pt
- }%
- }%
-}
-
-% @include FILE -- \input text of FILE.
-%
-\def\include{\parseargusing\filenamecatcodes\includezzz}
-\def\includezzz#1{%
- \pushthisfilestack
- \def\thisfile{#1}%
- {%
- \makevalueexpandable % we want to expand any @value in FILE.
- \turnoffactive % and allow special characters in the expansion
- \indexnofonts % Allow `@@' and other weird things in file names.
- \wlog{texinfo.tex: doing @include of #1^^J}%
- \edef\temp{\noexpand\input #1 }%
- %
- % This trickery is to read FILE outside of a group, in case it makes
- % definitions, etc.
- \expandafter
- }\temp
- \popthisfilestack
-}
-\def\filenamecatcodes{%
- \catcode`\\=\other
- \catcode`~=\other
- \catcode`^=\other
- \catcode`_=\other
- \catcode`|=\other
- \catcode`<=\other
- \catcode`>=\other
- \catcode`+=\other
- \catcode`-=\other
- \catcode`\`=\other
- \catcode`\'=\other
-}
-
-\def\pushthisfilestack{%
- \expandafter\pushthisfilestackX\popthisfilestack\StackTerm
-}
-\def\pushthisfilestackX{%
- \expandafter\pushthisfilestackY\thisfile\StackTerm
-}
-\def\pushthisfilestackY #1\StackTerm #2\StackTerm {%
- \gdef\popthisfilestack{\gdef\thisfile{#1}\gdef\popthisfilestack{#2}}%
-}
-
-\def\popthisfilestack{\errthisfilestackempty}
-\def\errthisfilestackempty{\errmessage{Internal error:
- the stack of filenames is empty.}}
-%
-\def\thisfile{}
-
-% @center line
-% outputs that line, centered.
-%
-\parseargdef\center{%
- \ifhmode
- \let\centersub\centerH
- \else
- \let\centersub\centerV
- \fi
- \centersub{\hfil \ignorespaces#1\unskip \hfil}%
- \let\centersub\relax % don't let the definition persist, just in case
-}
-\def\centerH#1{{%
- \hfil\break
- \advance\hsize by -\leftskip
- \advance\hsize by -\rightskip
- \line{#1}%
- \break
-}}
-%
-\newcount\centerpenalty
-\def\centerV#1{%
- % The idea here is the same as in \startdefun, \cartouche, etc.: if
- % @center is the first thing after a section heading, we need to wipe
- % out the negative parskip inserted by \sectionheading, but still
- % prevent a page break here.
- \centerpenalty = \lastpenalty
- \ifnum\centerpenalty>10000 \vskip\parskip \fi
- \ifnum\centerpenalty>9999 \penalty\centerpenalty \fi
- \line{\kern\leftskip #1\kern\rightskip}%
-}
-
-% @sp n outputs n lines of vertical space
-%
-\parseargdef\sp{\vskip #1\baselineskip}
-
-% @comment ...line which is ignored...
-% @c is the same as @comment
-% @ignore ... @end ignore is another way to write a comment
-%
-\def\comment{\begingroup \catcode`\^^M=\other%
-\catcode`\@=\other \catcode`\{=\other \catcode`\}=\other%
-\commentxxx}
-{\catcode`\^^M=\other \gdef\commentxxx#1^^M{\endgroup}}
-%
-\let\c=\comment
-
-% @paragraphindent NCHARS
-% We'll use ems for NCHARS, close enough.
-% NCHARS can also be the word `asis' or `none'.
-% We cannot feasibly implement @paragraphindent asis, though.
-%
-\def\asisword{asis} % no translation, these are keywords
-\def\noneword{none}
-%
-\parseargdef\paragraphindent{%
- \def\temp{#1}%
- \ifx\temp\asisword
- \else
- \ifx\temp\noneword
- \defaultparindent = 0pt
- \else
- \defaultparindent = #1em
- \fi
- \fi
- \parindent = \defaultparindent
-}
-
-% @exampleindent NCHARS
-% We'll use ems for NCHARS like @paragraphindent.
-% It seems @exampleindent asis isn't necessary, but
-% I preserve it to make it similar to @paragraphindent.
-\parseargdef\exampleindent{%
- \def\temp{#1}%
- \ifx\temp\asisword
- \else
- \ifx\temp\noneword
- \lispnarrowing = 0pt
- \else
- \lispnarrowing = #1em
- \fi
- \fi
-}
-
-% @firstparagraphindent WORD
-% If WORD is `none', then suppress indentation of the first paragraph
-% after a section heading. If WORD is `insert', then do indent at such
-% paragraphs.
-%
-% The paragraph indentation is suppressed or not by calling
-% \suppressfirstparagraphindent, which the sectioning commands do.
-% We switch the definition of this back and forth according to WORD.
-% By default, we suppress indentation.
-%
-\def\suppressfirstparagraphindent{\dosuppressfirstparagraphindent}
-\def\insertword{insert}
-%
-\parseargdef\firstparagraphindent{%
- \def\temp{#1}%
- \ifx\temp\noneword
- \let\suppressfirstparagraphindent = \dosuppressfirstparagraphindent
- \else\ifx\temp\insertword
- \let\suppressfirstparagraphindent = \relax
- \else
- \errhelp = \EMsimple
- \errmessage{Unknown @firstparagraphindent option `\temp'}%
- \fi\fi
-}
-
-% Here is how we actually suppress indentation. Redefine \everypar to
-% \kern backwards by \parindent, and then reset itself to empty.
-%
-% We also make \indent itself not actually do anything until the next
-% paragraph.
-%
-\gdef\dosuppressfirstparagraphindent{%
- \gdef\indent{%
- \restorefirstparagraphindent
- \indent
- }%
- \gdef\noindent{%
- \restorefirstparagraphindent
- \noindent
- }%
- \global\everypar = {%
- \kern -\parindent
- \restorefirstparagraphindent
- }%
-}
-
-\gdef\restorefirstparagraphindent{%
- \global \let \indent = \ptexindent
- \global \let \noindent = \ptexnoindent
- \global \everypar = {}%
-}
-
-
-% @refill is a no-op.
-\let\refill=\relax
-
-% If working on a large document in chapters, it is convenient to
-% be able to disable indexing, cross-referencing, and contents, for test runs.
-% This is done with @novalidate (before @setfilename).
-%
-\newif\iflinks \linkstrue % by default we want the aux files.
-\let\novalidate = \linksfalse
-
-% @setfilename is done at the beginning of every texinfo file.
-% So open here the files we need to have open while reading the input.
-% This makes it possible to make a .fmt file for texinfo.
-\def\setfilename{%
- \fixbackslash % Turn off hack to swallow `\input texinfo'.
- \iflinks
- \tryauxfile
- % Open the new aux file. TeX will close it automatically at exit.
- \immediate\openout\auxfile=\jobname.aux
- \fi % \openindices needs to do some work in any case.
- \openindices
- \let\setfilename=\comment % Ignore extra @setfilename cmds.
- %
- % If texinfo.cnf is present on the system, read it.
- % Useful for site-wide @afourpaper, etc.
- \openin 1 texinfo.cnf
- \ifeof 1 \else \input texinfo.cnf \fi
- \closein 1
- %
- \comment % Ignore the actual filename.
-}
-
-% Called from \setfilename.
-%
-\def\openindices{%
- \newindex{cp}%
- \newcodeindex{fn}%
- \newcodeindex{vr}%
- \newcodeindex{tp}%
- \newcodeindex{ky}%
- \newcodeindex{pg}%
-}
-
-% @bye.
-\outer\def\bye{\pagealignmacro\tracingstats=1\ptexend}
-
-
-\message{pdf,}
-% adobe `portable' document format
-\newcount\tempnum
-\newcount\lnkcount
-\newtoks\filename
-\newcount\filenamelength
-\newcount\pgn
-\newtoks\toksA
-\newtoks\toksB
-\newtoks\toksC
-\newtoks\toksD
-\newbox\boxA
-\newcount\countA
-\newif\ifpdf
-\newif\ifpdfmakepagedest
-
-% when pdftex is run in dvi mode, \pdfoutput is defined (so \pdfoutput=1
-% can be set). So we test for \relax and 0 as well as being undefined.
-\ifx\pdfoutput\thisisundefined
-\else
- \ifx\pdfoutput\relax
- \else
- \ifcase\pdfoutput
- \else
- \pdftrue
- \fi
- \fi
-\fi
-
-% PDF uses PostScript string constants for the names of xref targets,
-% for display in the outlines, and in other places. Thus, we have to
-% double any backslashes. Otherwise, a name like "\node" will be
-% interpreted as a newline (\n), followed by o, d, e. Not good.
-%
-% See http://www.ntg.nl/pipermail/ntg-pdftex/2004-July/000654.html and
-% related messages. The final outcome is that it is up to the TeX user
-% to double the backslashes and otherwise make the string valid, so
-% that's what we do. pdftex 1.30.0 (ca.2005) introduced a primitive to
-% do this reliably, so we use it.
-
-% #1 is a control sequence in which to do the replacements,
-% which we \xdef.
-\def\txiescapepdf#1{%
- \ifx\pdfescapestring\thisisundefined
- % No primitive available; should we give a warning or log?
- % Many times it won't matter.
- \else
- % The expandable \pdfescapestring primitive escapes parentheses,
- % backslashes, and other special chars.
- \xdef#1{\pdfescapestring{#1}}%
- \fi
-}
-
-\newhelp\nopdfimagehelp{Texinfo supports .png, .jpg, .jpeg, and .pdf images
-with PDF output, and none of those formats could be found. (.eps cannot
-be supported due to the design of the PDF format; use regular TeX (DVI
-output) for that.)}
-
-\ifpdf
- %
- % Color manipulation macros based on pdfcolor.tex,
- % except using rgb instead of cmyk; the latter is said to render as a
- % very dark gray on-screen and a very dark halftone in print, instead
- % of actual black.
- \def\rgbDarkRed{0.50 0.09 0.12}
- \def\rgbBlack{0 0 0}
- %
- % k sets the color for filling (usual text, etc.);
- % K sets the color for stroking (thin rules, e.g., normal _'s).
- \def\pdfsetcolor#1{\pdfliteral{#1 rg #1 RG}}
- %
- % Set color, and create a mark which defines \thiscolor accordingly,
- % so that \makeheadline knows which color to restore.
- \def\setcolor#1{%
- \xdef\lastcolordefs{\gdef\noexpand\thiscolor{#1}}%
- \domark
- \pdfsetcolor{#1}%
- }
- %
- \def\maincolor{\rgbBlack}
- \pdfsetcolor{\maincolor}
- \edef\thiscolor{\maincolor}
- \def\lastcolordefs{}
- %
- \def\makefootline{%
- \baselineskip24pt
- \line{\pdfsetcolor{\maincolor}\the\footline}%
- }
- %
- \def\makeheadline{%
- \vbox to 0pt{%
- \vskip-22.5pt
- \line{%
- \vbox to8.5pt{}%
- % Extract \thiscolor definition from the marks.
- \getcolormarks
- % Typeset the headline with \maincolor, then restore the color.
- \pdfsetcolor{\maincolor}\the\headline\pdfsetcolor{\thiscolor}%
- }%
- \vss
- }%
- \nointerlineskip
- }
- %
- %
- \pdfcatalog{/PageMode /UseOutlines}
- %
- % #1 is image name, #2 width (might be empty/whitespace), #3 height (ditto).
- \def\dopdfimage#1#2#3{%
- \def\pdfimagewidth{#2}\setbox0 = \hbox{\ignorespaces #2}%
- \def\pdfimageheight{#3}\setbox2 = \hbox{\ignorespaces #3}%
- %
- % pdftex (and the PDF format) support .pdf, .png, .jpg (among
- % others). Let's try in that order, PDF first since if
- % someone has a scalable image, presumably better to use that than a
- % bitmap.
- \let\pdfimgext=\empty
- \begingroup
- \openin 1 #1.pdf \ifeof 1
- \openin 1 #1.PDF \ifeof 1
- \openin 1 #1.png \ifeof 1
- \openin 1 #1.jpg \ifeof 1
- \openin 1 #1.jpeg \ifeof 1
- \openin 1 #1.JPG \ifeof 1
- \errhelp = \nopdfimagehelp
- \errmessage{Could not find image file #1 for pdf}%
- \else \gdef\pdfimgext{JPG}%
- \fi
- \else \gdef\pdfimgext{jpeg}%
- \fi
- \else \gdef\pdfimgext{jpg}%
- \fi
- \else \gdef\pdfimgext{png}%
- \fi
- \else \gdef\pdfimgext{PDF}%
- \fi
- \else \gdef\pdfimgext{pdf}%
- \fi
- \closein 1
- \endgroup
- %
- % without \immediate, ancient pdftex seg faults when the same image is
- % included twice. (Version 3.14159-pre-1.0-unofficial-20010704.)
- \ifnum\pdftexversion < 14
- \immediate\pdfimage
- \else
- \immediate\pdfximage
- \fi
- \ifdim \wd0 >0pt width \pdfimagewidth \fi
- \ifdim \wd2 >0pt height \pdfimageheight \fi
- \ifnum\pdftexversion<13
- #1.\pdfimgext
- \else
- {#1.\pdfimgext}%
- \fi
- \ifnum\pdftexversion < 14 \else
- \pdfrefximage \pdflastximage
- \fi}
- %
- \def\pdfmkdest#1{{%
- % We have to set dummies so commands such as @code, and characters
- % such as \, aren't expanded when present in a section title.
- \indexnofonts
- \turnoffactive
- \makevalueexpandable
- \def\pdfdestname{#1}%
- \txiescapepdf\pdfdestname
- \safewhatsit{\pdfdest name{\pdfdestname} xyz}%
- }}
- %
- % used to mark target names; must be expandable.
- \def\pdfmkpgn#1{#1}
- %
- % by default, use a color that is dark enough to print on paper as
- % nearly black, but still distinguishable for online viewing.
- \def\urlcolor{\rgbDarkRed}
- \def\linkcolor{\rgbDarkRed}
- \def\endlink{\setcolor{\maincolor}\pdfendlink}
- %
- % Adding outlines to PDF; macros for calculating structure of outlines
- % come from Petr Olsak
- \def\expnumber#1{\expandafter\ifx\csname#1\endcsname\relax 0%
- \else \csname#1\endcsname \fi}
- \def\advancenumber#1{\tempnum=\expnumber{#1}\relax
- \advance\tempnum by 1
- \expandafter\xdef\csname#1\endcsname{\the\tempnum}}
- %
- % #1 is the section text, which is what will be displayed in the
- % outline by the pdf viewer. #2 is the pdf expression for the number
- % of subentries (or empty, for subsubsections). #3 is the node text,
- % which might be empty if this toc entry had no corresponding node.
- % #4 is the page number
- %
- \def\dopdfoutline#1#2#3#4{%
- % Generate a link to the node text if that exists; else, use the
- % page number. We could generate a destination for the section
- % text in the case where a section has no node, but it doesn't
- % seem worth the trouble, since most documents are normally structured.
- \edef\pdfoutlinedest{#3}%
- \ifx\pdfoutlinedest\empty
- \def\pdfoutlinedest{#4}%
- \else
- \txiescapepdf\pdfoutlinedest
- \fi
- %
- % Also escape PDF chars in the display string.
- \edef\pdfoutlinetext{#1}%
- \txiescapepdf\pdfoutlinetext
- %
- \pdfoutline goto name{\pdfmkpgn{\pdfoutlinedest}}#2{\pdfoutlinetext}%
- }
- %
- \def\pdfmakeoutlines{%
- \begingroup
- % Read toc silently, to get counts of subentries for \pdfoutline.
- \def\partentry##1##2##3##4{}% ignore parts in the outlines
- \def\numchapentry##1##2##3##4{%
- \def\thischapnum{##2}%
- \def\thissecnum{0}%
- \def\thissubsecnum{0}%
- }%
- \def\numsecentry##1##2##3##4{%
- \advancenumber{chap\thischapnum}%
- \def\thissecnum{##2}%
- \def\thissubsecnum{0}%
- }%
- \def\numsubsecentry##1##2##3##4{%
- \advancenumber{sec\thissecnum}%
- \def\thissubsecnum{##2}%
- }%
- \def\numsubsubsecentry##1##2##3##4{%
- \advancenumber{subsec\thissubsecnum}%
- }%
- \def\thischapnum{0}%
- \def\thissecnum{0}%
- \def\thissubsecnum{0}%
- %
- % use \def rather than \let here because we redefine \chapentry et
- % al. a second time, below.
- \def\appentry{\numchapentry}%
- \def\appsecentry{\numsecentry}%
- \def\appsubsecentry{\numsubsecentry}%
- \def\appsubsubsecentry{\numsubsubsecentry}%
- \def\unnchapentry{\numchapentry}%
- \def\unnsecentry{\numsecentry}%
- \def\unnsubsecentry{\numsubsecentry}%
- \def\unnsubsubsecentry{\numsubsubsecentry}%
- \readdatafile{toc}%
- %
- % Read toc second time, this time actually producing the outlines.
- % The `-' means take the \expnumber as the absolute number of
- % subentries, which we calculated on our first read of the .toc above.
- %
- % We use the node names as the destinations.
- \def\numchapentry##1##2##3##4{%
- \dopdfoutline{##1}{count-\expnumber{chap##2}}{##3}{##4}}%
- \def\numsecentry##1##2##3##4{%
- \dopdfoutline{##1}{count-\expnumber{sec##2}}{##3}{##4}}%
- \def\numsubsecentry##1##2##3##4{%
- \dopdfoutline{##1}{count-\expnumber{subsec##2}}{##3}{##4}}%
- \def\numsubsubsecentry##1##2##3##4{% count is always zero
- \dopdfoutline{##1}{}{##3}{##4}}%
- %
- % PDF outlines are displayed using system fonts, instead of
- % document fonts. Therefore we cannot use special characters,
- % since the encoding is unknown. For example, the eogonek from
- % Latin 2 (0xea) gets translated to a | character. Info from
- % Staszek Wawrykiewicz, 19 Jan 2004 04:09:24 +0100.
- %
- % TODO this right, we have to translate 8-bit characters to
- % their "best" equivalent, based on the @documentencoding. Too
- % much work for too little return. Just use the ASCII equivalents
- % we use for the index sort strings.
- %
- \indexnofonts
- \setupdatafile
- % We can have normal brace characters in the PDF outlines, unlike
- % Texinfo index files. So set that up.
- \def\{{\lbracecharliteral}%
- \def\}{\rbracecharliteral}%
- \catcode`\\=\active \otherbackslash
- \input \tocreadfilename
- \endgroup
- }
- {\catcode`[=1 \catcode`]=2
- \catcode`{=\other \catcode`}=\other
- \gdef\lbracecharliteral[{]%
- \gdef\rbracecharliteral[}]%
- ]
- %
- \def\skipspaces#1{\def\PP{#1}\def\D{|}%
- \ifx\PP\D\let\nextsp\relax
- \else\let\nextsp\skipspaces
- \addtokens{\filename}{\PP}%
- \advance\filenamelength by 1
- \fi
- \nextsp}
- \def\getfilename#1{%
- \filenamelength=0
- % If we don't expand the argument now, \skipspaces will get
- % snagged on things like "@value{foo}".
- \edef\temp{#1}%
- \expandafter\skipspaces\temp|\relax
- }
- \ifnum\pdftexversion < 14
- \let \startlink \pdfannotlink
- \else
- \let \startlink \pdfstartlink
- \fi
- % make a live url in pdf output.
- \def\pdfurl#1{%
- \begingroup
- % it seems we really need yet another set of dummies; have not
- % tried to figure out what each command should do in the context
- % of @url. for now, just make @/ a no-op, that's the only one
- % people have actually reported a problem with.
- %
- \normalturnoffactive
- \def\@{@}%
- \let\/=\empty
- \makevalueexpandable
- % do we want to go so far as to use \indexnofonts instead of just
- % special-casing \var here?
- \def\var##1{##1}%
- %
- \leavevmode\setcolor{\urlcolor}%
- \startlink attr{/Border [0 0 0]}%
- user{/Subtype /Link /A << /S /URI /URI (#1) >>}%
- \endgroup}
- \def\pdfgettoks#1.{\setbox\boxA=\hbox{\toksA={#1.}\toksB={}\maketoks}}
- \def\addtokens#1#2{\edef\addtoks{\noexpand#1={\the#1#2}}\addtoks}
- \def\adn#1{\addtokens{\toksC}{#1}\global\countA=1\let\next=\maketoks}
- \def\poptoks#1#2|ENDTOKS|{\let\first=#1\toksD={#1}\toksA={#2}}
- \def\maketoks{%
- \expandafter\poptoks\the\toksA|ENDTOKS|\relax
- \ifx\first0\adn0
- \else\ifx\first1\adn1 \else\ifx\first2\adn2 \else\ifx\first3\adn3
- \else\ifx\first4\adn4 \else\ifx\first5\adn5 \else\ifx\first6\adn6
- \else\ifx\first7\adn7 \else\ifx\first8\adn8 \else\ifx\first9\adn9
- \else
- \ifnum0=\countA\else\makelink\fi
- \ifx\first.\let\next=\done\else
- \let\next=\maketoks
- \addtokens{\toksB}{\the\toksD}
- \ifx\first,\addtokens{\toksB}{\space}\fi
- \fi
- \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
- \next}
- \def\makelink{\addtokens{\toksB}%
- {\noexpand\pdflink{\the\toksC}}\toksC={}\global\countA=0}
- \def\pdflink#1{%
- \startlink attr{/Border [0 0 0]} goto name{\pdfmkpgn{#1}}
- \setcolor{\linkcolor}#1\endlink}
- \def\done{\edef\st{\global\noexpand\toksA={\the\toksB}}\st}
-\else
- % non-pdf mode
- \let\pdfmkdest = \gobble
- \let\pdfurl = \gobble
- \let\endlink = \relax
- \let\setcolor = \gobble
- \let\pdfsetcolor = \gobble
- \let\pdfmakeoutlines = \relax
-\fi % \ifx\pdfoutput
-
-
-\message{fonts,}
-
-% Change the current font style to #1, remembering it in \curfontstyle.
-% For now, we do not accumulate font styles: @b{@i{foo}} prints foo in
-% italics, not bold italics.
-%
-\def\setfontstyle#1{%
- \def\curfontstyle{#1}% not as a control sequence, because we are \edef'd.
- \csname ten#1\endcsname % change the current font
-}
-
-% Select #1 fonts with the current style.
-%
-\def\selectfonts#1{\csname #1fonts\endcsname \csname\curfontstyle\endcsname}
-
-\def\rm{\fam=0 \setfontstyle{rm}}
-\def\it{\fam=\itfam \setfontstyle{it}}
-\def\sl{\fam=\slfam \setfontstyle{sl}}
-\def\bf{\fam=\bffam \setfontstyle{bf}}\def\bfstylename{bf}
-\def\tt{\fam=\ttfam \setfontstyle{tt}}
-
-% Unfortunately, we have to override this for titles and the like, since
-% in those cases "rm" is bold. Sigh.
-\def\rmisbold{\rm\def\curfontstyle{bf}}
-
-% Texinfo sort of supports the sans serif font style, which plain TeX does not.
-% So we set up a \sf.
-\newfam\sffam
-\def\sf{\fam=\sffam \setfontstyle{sf}}
-\let\li = \sf % Sometimes we call it \li, not \sf.
-
-% We don't need math for this font style.
-\def\ttsl{\setfontstyle{ttsl}}
-
-
-% Set the baselineskip to #1, and the lineskip and strut size
-% correspondingly. There is no deep meaning behind these magic numbers
-% used as factors; they just match (closely enough) what Knuth defined.
-%
-\def\lineskipfactor{.08333}
-\def\strutheightpercent{.70833}
-\def\strutdepthpercent {.29167}
-%
-% can get a sort of poor man's double spacing by redefining this.
-\def\baselinefactor{1}
-%
-\newdimen\textleading
-\def\setleading#1{%
- \dimen0 = #1\relax
- \normalbaselineskip = \baselinefactor\dimen0
- \normallineskip = \lineskipfactor\normalbaselineskip
- \normalbaselines
- \setbox\strutbox =\hbox{%
- \vrule width0pt height\strutheightpercent\baselineskip
- depth \strutdepthpercent \baselineskip
- }%
-}
-
-% PDF CMaps. See also LaTeX's t1.cmap.
-%
-% do nothing with this by default.
-\expandafter\let\csname cmapOT1\endcsname\gobble
-\expandafter\let\csname cmapOT1IT\endcsname\gobble
-\expandafter\let\csname cmapOT1TT\endcsname\gobble
-
-% if we are producing pdf, and we have \pdffontattr, then define cmaps.
-% (\pdffontattr was introduced many years ago, but people still run
-% older pdftex's; it's easy to conditionalize, so we do.)
-\ifpdf \ifx\pdffontattr\thisisundefined \else
- \begingroup
- \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char.
- \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap
-%%DocumentNeededResources: ProcSet (CIDInit)
-%%IncludeResource: ProcSet (CIDInit)
-%%BeginResource: CMap (TeX-OT1-0)
-%%Title: (TeX-OT1-0 TeX OT1 0)
-%%Version: 1.000
-%%EndComments
-/CIDInit /ProcSet findresource begin
-12 dict begin
-begincmap
-/CIDSystemInfo
-<< /Registry (TeX)
-/Ordering (OT1)
-/Supplement 0
->> def
-/CMapName /TeX-OT1-0 def
-/CMapType 2 def
-1 begincodespacerange
-<00> <7F>
-endcodespacerange
-8 beginbfrange
-<00> <01> <0393>
-<09> <0A> <03A8>
-<23> <26> <0023>
-<28> <3B> <0028>
-<3F> <5B> <003F>
-<5D> <5E> <005D>
-<61> <7A> <0061>
-<7B> <7C> <2013>
-endbfrange
-40 beginbfchar
-<02> <0398>
-<03> <039B>
-<04> <039E>
-<05> <03A0>
-<06> <03A3>
-<07> <03D2>
-<08> <03A6>
-<0B> <00660066>
-<0C> <00660069>
-<0D> <0066006C>
-<0E> <006600660069>
-<0F> <00660066006C>
-<10> <0131>
-<11> <0237>
-<12> <0060>
-<13> <00B4>
-<14> <02C7>
-<15> <02D8>
-<16> <00AF>
-<17> <02DA>
-<18> <00B8>
-<19> <00DF>
-<1A> <00E6>
-<1B> <0153>
-<1C> <00F8>
-<1D> <00C6>
-<1E> <0152>
-<1F> <00D8>
-<21> <0021>
-<22> <201D>
-<27> <2019>
-<3C> <00A1>
-<3D> <003D>
-<3E> <00BF>
-<5C> <201C>
-<5F> <02D9>
-<60> <2018>
-<7D> <02DD>
-<7E> <007E>
-<7F> <00A8>
-endbfchar
-endcmap
-CMapName currentdict /CMap defineresource pop
-end
-end
-%%EndResource
-%%EOF
- }\endgroup
- \expandafter\edef\csname cmapOT1\endcsname#1{%
- \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}%
- }%
-%
-% \cmapOT1IT
- \begingroup
- \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char.
- \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap
-%%DocumentNeededResources: ProcSet (CIDInit)
-%%IncludeResource: ProcSet (CIDInit)
-%%BeginResource: CMap (TeX-OT1IT-0)
-%%Title: (TeX-OT1IT-0 TeX OT1IT 0)
-%%Version: 1.000
-%%EndComments
-/CIDInit /ProcSet findresource begin
-12 dict begin
-begincmap
-/CIDSystemInfo
-<< /Registry (TeX)
-/Ordering (OT1IT)
-/Supplement 0
->> def
-/CMapName /TeX-OT1IT-0 def
-/CMapType 2 def
-1 begincodespacerange
-<00> <7F>
-endcodespacerange
-8 beginbfrange
-<00> <01> <0393>
-<09> <0A> <03A8>
-<25> <26> <0025>
-<28> <3B> <0028>
-<3F> <5B> <003F>
-<5D> <5E> <005D>
-<61> <7A> <0061>
-<7B> <7C> <2013>
-endbfrange
-42 beginbfchar
-<02> <0398>
-<03> <039B>
-<04> <039E>
-<05> <03A0>
-<06> <03A3>
-<07> <03D2>
-<08> <03A6>
-<0B> <00660066>
-<0C> <00660069>
-<0D> <0066006C>
-<0E> <006600660069>
-<0F> <00660066006C>
-<10> <0131>
-<11> <0237>
-<12> <0060>
-<13> <00B4>
-<14> <02C7>
-<15> <02D8>
-<16> <00AF>
-<17> <02DA>
-<18> <00B8>
-<19> <00DF>
-<1A> <00E6>
-<1B> <0153>
-<1C> <00F8>
-<1D> <00C6>
-<1E> <0152>
-<1F> <00D8>
-<21> <0021>
-<22> <201D>
-<23> <0023>
-<24> <00A3>
-<27> <2019>
-<3C> <00A1>
-<3D> <003D>
-<3E> <00BF>
-<5C> <201C>
-<5F> <02D9>
-<60> <2018>
-<7D> <02DD>
-<7E> <007E>
-<7F> <00A8>
-endbfchar
-endcmap
-CMapName currentdict /CMap defineresource pop
-end
-end
-%%EndResource
-%%EOF
- }\endgroup
- \expandafter\edef\csname cmapOT1IT\endcsname#1{%
- \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}%
- }%
-%
-% \cmapOT1TT
- \begingroup
- \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char.
- \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap
-%%DocumentNeededResources: ProcSet (CIDInit)
-%%IncludeResource: ProcSet (CIDInit)
-%%BeginResource: CMap (TeX-OT1TT-0)
-%%Title: (TeX-OT1TT-0 TeX OT1TT 0)
-%%Version: 1.000
-%%EndComments
-/CIDInit /ProcSet findresource begin
-12 dict begin
-begincmap
-/CIDSystemInfo
-<< /Registry (TeX)
-/Ordering (OT1TT)
-/Supplement 0
->> def
-/CMapName /TeX-OT1TT-0 def
-/CMapType 2 def
-1 begincodespacerange
-<00> <7F>
-endcodespacerange
-5 beginbfrange
-<00> <01> <0393>
-<09> <0A> <03A8>
-<21> <26> <0021>
-<28> <5F> <0028>
-<61> <7E> <0061>
-endbfrange
-32 beginbfchar
-<02> <0398>
-<03> <039B>
-<04> <039E>
-<05> <03A0>
-<06> <03A3>
-<07> <03D2>
-<08> <03A6>
-<0B> <2191>
-<0C> <2193>
-<0D> <0027>
-<0E> <00A1>
-<0F> <00BF>
-<10> <0131>
-<11> <0237>
-<12> <0060>
-<13> <00B4>
-<14> <02C7>
-<15> <02D8>
-<16> <00AF>
-<17> <02DA>
-<18> <00B8>
-<19> <00DF>
-<1A> <00E6>
-<1B> <0153>
-<1C> <00F8>
-<1D> <00C6>
-<1E> <0152>
-<1F> <00D8>
-<20> <2423>
-<27> <2019>
-<60> <2018>
-<7F> <00A8>
-endbfchar
-endcmap
-CMapName currentdict /CMap defineresource pop
-end
-end
-%%EndResource
-%%EOF
- }\endgroup
- \expandafter\edef\csname cmapOT1TT\endcsname#1{%
- \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}%
- }%
-\fi\fi
-
-
-% Set the font macro #1 to the font named \fontprefix#2.
-% #3 is the font's design size, #4 is a scale factor, #5 is the CMap
-% encoding (only OT1, OT1IT and OT1TT are allowed, or empty to omit).
-% Example:
-% #1 = \textrm
-% #2 = \rmshape
-% #3 = 10
-% #4 = \mainmagstep
-% #5 = OT1
-%
-\def\setfont#1#2#3#4#5{%
- \font#1=\fontprefix#2#3 scaled #4
- \csname cmap#5\endcsname#1%
-}
-% This is what gets called when #5 of \setfont is empty.
-\let\cmap\gobble
-%
-% (end of cmaps)
-
-% Use cm as the default font prefix.
-% To specify the font prefix, you must define \fontprefix
-% before you read in texinfo.tex.
-\ifx\fontprefix\thisisundefined
-\def\fontprefix{cm}
-\fi
-% Support font families that don't use the same naming scheme as CM.
-\def\rmshape{r}
-\def\rmbshape{bx} % where the normal face is bold
-\def\bfshape{b}
-\def\bxshape{bx}
-\def\ttshape{tt}
-\def\ttbshape{tt}
-\def\ttslshape{sltt}
-\def\itshape{ti}
-\def\itbshape{bxti}
-\def\slshape{sl}
-\def\slbshape{bxsl}
-\def\sfshape{ss}
-\def\sfbshape{ss}
-\def\scshape{csc}
-\def\scbshape{csc}
-
-% Definitions for a main text size of 11pt. (The default in Texinfo.)
-%
-\def\definetextfontsizexi{%
-% Text fonts (11.2pt, magstep1).
-\def\textnominalsize{11pt}
-\edef\mainmagstep{\magstephalf}
-\setfont\textrm\rmshape{10}{\mainmagstep}{OT1}
-\setfont\texttt\ttshape{10}{\mainmagstep}{OT1TT}
-\setfont\textbf\bfshape{10}{\mainmagstep}{OT1}
-\setfont\textit\itshape{10}{\mainmagstep}{OT1IT}
-\setfont\textsl\slshape{10}{\mainmagstep}{OT1}
-\setfont\textsf\sfshape{10}{\mainmagstep}{OT1}
-\setfont\textsc\scshape{10}{\mainmagstep}{OT1}
-\setfont\textttsl\ttslshape{10}{\mainmagstep}{OT1TT}
-\font\texti=cmmi10 scaled \mainmagstep
-\font\textsy=cmsy10 scaled \mainmagstep
-\def\textecsize{1095}
-
-% A few fonts for @defun names and args.
-\setfont\defbf\bfshape{10}{\magstep1}{OT1}
-\setfont\deftt\ttshape{10}{\magstep1}{OT1TT}
-\setfont\defttsl\ttslshape{10}{\magstep1}{OT1TT}
-\def\df{\let\tentt=\deftt \let\tenbf = \defbf \let\tenttsl=\defttsl \bf}
-
-% Fonts for indices, footnotes, small examples (9pt).
-\def\smallnominalsize{9pt}
-\setfont\smallrm\rmshape{9}{1000}{OT1}
-\setfont\smalltt\ttshape{9}{1000}{OT1TT}
-\setfont\smallbf\bfshape{10}{900}{OT1}
-\setfont\smallit\itshape{9}{1000}{OT1IT}
-\setfont\smallsl\slshape{9}{1000}{OT1}
-\setfont\smallsf\sfshape{9}{1000}{OT1}
-\setfont\smallsc\scshape{10}{900}{OT1}
-\setfont\smallttsl\ttslshape{10}{900}{OT1TT}
-\font\smalli=cmmi9
-\font\smallsy=cmsy9
-\def\smallecsize{0900}
-
-% Fonts for small examples (8pt).
-\def\smallernominalsize{8pt}
-\setfont\smallerrm\rmshape{8}{1000}{OT1}
-\setfont\smallertt\ttshape{8}{1000}{OT1TT}
-\setfont\smallerbf\bfshape{10}{800}{OT1}
-\setfont\smallerit\itshape{8}{1000}{OT1IT}
-\setfont\smallersl\slshape{8}{1000}{OT1}
-\setfont\smallersf\sfshape{8}{1000}{OT1}
-\setfont\smallersc\scshape{10}{800}{OT1}
-\setfont\smallerttsl\ttslshape{10}{800}{OT1TT}
-\font\smalleri=cmmi8
-\font\smallersy=cmsy8
-\def\smallerecsize{0800}
-
-% Fonts for title page (20.4pt):
-\def\titlenominalsize{20pt}
-\setfont\titlerm\rmbshape{12}{\magstep3}{OT1}
-\setfont\titleit\itbshape{10}{\magstep4}{OT1IT}
-\setfont\titlesl\slbshape{10}{\magstep4}{OT1}
-\setfont\titlett\ttbshape{12}{\magstep3}{OT1TT}
-\setfont\titlettsl\ttslshape{10}{\magstep4}{OT1TT}
-\setfont\titlesf\sfbshape{17}{\magstep1}{OT1}
-\let\titlebf=\titlerm
-\setfont\titlesc\scbshape{10}{\magstep4}{OT1}
-\font\titlei=cmmi12 scaled \magstep3
-\font\titlesy=cmsy10 scaled \magstep4
-\def\titleecsize{2074}
-
-% Chapter (and unnumbered) fonts (17.28pt).
-\def\chapnominalsize{17pt}
-\setfont\chaprm\rmbshape{12}{\magstep2}{OT1}
-\setfont\chapit\itbshape{10}{\magstep3}{OT1IT}
-\setfont\chapsl\slbshape{10}{\magstep3}{OT1}
-\setfont\chaptt\ttbshape{12}{\magstep2}{OT1TT}
-\setfont\chapttsl\ttslshape{10}{\magstep3}{OT1TT}
-\setfont\chapsf\sfbshape{17}{1000}{OT1}
-\let\chapbf=\chaprm
-\setfont\chapsc\scbshape{10}{\magstep3}{OT1}
-\font\chapi=cmmi12 scaled \magstep2
-\font\chapsy=cmsy10 scaled \magstep3
-\def\chapecsize{1728}
-
-% Section fonts (14.4pt).
-\def\secnominalsize{14pt}
-\setfont\secrm\rmbshape{12}{\magstep1}{OT1}
-\setfont\secit\itbshape{10}{\magstep2}{OT1IT}
-\setfont\secsl\slbshape{10}{\magstep2}{OT1}
-\setfont\sectt\ttbshape{12}{\magstep1}{OT1TT}
-\setfont\secttsl\ttslshape{10}{\magstep2}{OT1TT}
-\setfont\secsf\sfbshape{12}{\magstep1}{OT1}
-\let\secbf\secrm
-\setfont\secsc\scbshape{10}{\magstep2}{OT1}
-\font\seci=cmmi12 scaled \magstep1
-\font\secsy=cmsy10 scaled \magstep2
-\def\sececsize{1440}
-
-% Subsection fonts (13.15pt).
-\def\ssecnominalsize{13pt}
-\setfont\ssecrm\rmbshape{12}{\magstephalf}{OT1}
-\setfont\ssecit\itbshape{10}{1315}{OT1IT}
-\setfont\ssecsl\slbshape{10}{1315}{OT1}
-\setfont\ssectt\ttbshape{12}{\magstephalf}{OT1TT}
-\setfont\ssecttsl\ttslshape{10}{1315}{OT1TT}
-\setfont\ssecsf\sfbshape{12}{\magstephalf}{OT1}
-\let\ssecbf\ssecrm
-\setfont\ssecsc\scbshape{10}{1315}{OT1}
-\font\sseci=cmmi12 scaled \magstephalf
-\font\ssecsy=cmsy10 scaled 1315
-\def\ssececsize{1200}
-
-% Reduced fonts for @acro in text (10pt).
-\def\reducednominalsize{10pt}
-\setfont\reducedrm\rmshape{10}{1000}{OT1}
-\setfont\reducedtt\ttshape{10}{1000}{OT1TT}
-\setfont\reducedbf\bfshape{10}{1000}{OT1}
-\setfont\reducedit\itshape{10}{1000}{OT1IT}
-\setfont\reducedsl\slshape{10}{1000}{OT1}
-\setfont\reducedsf\sfshape{10}{1000}{OT1}
-\setfont\reducedsc\scshape{10}{1000}{OT1}
-\setfont\reducedttsl\ttslshape{10}{1000}{OT1TT}
-\font\reducedi=cmmi10
-\font\reducedsy=cmsy10
-\def\reducedecsize{1000}
-
-\textleading = 13.2pt % line spacing for 11pt CM
-\textfonts % reset the current fonts
-\rm
-} % end of 11pt text font size definitions, \definetextfontsizexi
-
-
-% Definitions to make the main text be 10pt Computer Modern, with
-% section, chapter, etc., sizes following suit. This is for the GNU
-% Press printing of the Emacs 22 manual. Maybe other manuals in the
-% future. Used with @smallbook, which sets the leading to 12pt.
-%
-\def\definetextfontsizex{%
-% Text fonts (10pt).
-\def\textnominalsize{10pt}
-\edef\mainmagstep{1000}
-\setfont\textrm\rmshape{10}{\mainmagstep}{OT1}
-\setfont\texttt\ttshape{10}{\mainmagstep}{OT1TT}
-\setfont\textbf\bfshape{10}{\mainmagstep}{OT1}
-\setfont\textit\itshape{10}{\mainmagstep}{OT1IT}
-\setfont\textsl\slshape{10}{\mainmagstep}{OT1}
-\setfont\textsf\sfshape{10}{\mainmagstep}{OT1}
-\setfont\textsc\scshape{10}{\mainmagstep}{OT1}
-\setfont\textttsl\ttslshape{10}{\mainmagstep}{OT1TT}
-\font\texti=cmmi10 scaled \mainmagstep
-\font\textsy=cmsy10 scaled \mainmagstep
-\def\textecsize{1000}
-
-% A few fonts for @defun names and args.
-\setfont\defbf\bfshape{10}{\magstephalf}{OT1}
-\setfont\deftt\ttshape{10}{\magstephalf}{OT1TT}
-\setfont\defttsl\ttslshape{10}{\magstephalf}{OT1TT}
-\def\df{\let\tentt=\deftt \let\tenbf = \defbf \let\tenttsl=\defttsl \bf}
-
-% Fonts for indices, footnotes, small examples (9pt).
-\def\smallnominalsize{9pt}
-\setfont\smallrm\rmshape{9}{1000}{OT1}
-\setfont\smalltt\ttshape{9}{1000}{OT1TT}
-\setfont\smallbf\bfshape{10}{900}{OT1}
-\setfont\smallit\itshape{9}{1000}{OT1IT}
-\setfont\smallsl\slshape{9}{1000}{OT1}
-\setfont\smallsf\sfshape{9}{1000}{OT1}
-\setfont\smallsc\scshape{10}{900}{OT1}
-\setfont\smallttsl\ttslshape{10}{900}{OT1TT}
-\font\smalli=cmmi9
-\font\smallsy=cmsy9
-\def\smallecsize{0900}
-
-% Fonts for small examples (8pt).
-\def\smallernominalsize{8pt}
-\setfont\smallerrm\rmshape{8}{1000}{OT1}
-\setfont\smallertt\ttshape{8}{1000}{OT1TT}
-\setfont\smallerbf\bfshape{10}{800}{OT1}
-\setfont\smallerit\itshape{8}{1000}{OT1IT}
-\setfont\smallersl\slshape{8}{1000}{OT1}
-\setfont\smallersf\sfshape{8}{1000}{OT1}
-\setfont\smallersc\scshape{10}{800}{OT1}
-\setfont\smallerttsl\ttslshape{10}{800}{OT1TT}
-\font\smalleri=cmmi8
-\font\smallersy=cmsy8
-\def\smallerecsize{0800}
-
-% Fonts for title page (20.4pt):
-\def\titlenominalsize{20pt}
-\setfont\titlerm\rmbshape{12}{\magstep3}{OT1}
-\setfont\titleit\itbshape{10}{\magstep4}{OT1IT}
-\setfont\titlesl\slbshape{10}{\magstep4}{OT1}
-\setfont\titlett\ttbshape{12}{\magstep3}{OT1TT}
-\setfont\titlettsl\ttslshape{10}{\magstep4}{OT1TT}
-\setfont\titlesf\sfbshape{17}{\magstep1}{OT1}
-\let\titlebf=\titlerm
-\setfont\titlesc\scbshape{10}{\magstep4}{OT1}
-\font\titlei=cmmi12 scaled \magstep3
-\font\titlesy=cmsy10 scaled \magstep4
-\def\titleecsize{2074}
-
-% Chapter fonts (14.4pt).
-\def\chapnominalsize{14pt}
-\setfont\chaprm\rmbshape{12}{\magstep1}{OT1}
-\setfont\chapit\itbshape{10}{\magstep2}{OT1IT}
-\setfont\chapsl\slbshape{10}{\magstep2}{OT1}
-\setfont\chaptt\ttbshape{12}{\magstep1}{OT1TT}
-\setfont\chapttsl\ttslshape{10}{\magstep2}{OT1TT}
-\setfont\chapsf\sfbshape{12}{\magstep1}{OT1}
-\let\chapbf\chaprm
-\setfont\chapsc\scbshape{10}{\magstep2}{OT1}
-\font\chapi=cmmi12 scaled \magstep1
-\font\chapsy=cmsy10 scaled \magstep2
-\def\chapecsize{1440}
-
-% Section fonts (12pt).
-\def\secnominalsize{12pt}
-\setfont\secrm\rmbshape{12}{1000}{OT1}
-\setfont\secit\itbshape{10}{\magstep1}{OT1IT}
-\setfont\secsl\slbshape{10}{\magstep1}{OT1}
-\setfont\sectt\ttbshape{12}{1000}{OT1TT}
-\setfont\secttsl\ttslshape{10}{\magstep1}{OT1TT}
-\setfont\secsf\sfbshape{12}{1000}{OT1}
-\let\secbf\secrm
-\setfont\secsc\scbshape{10}{\magstep1}{OT1}
-\font\seci=cmmi12
-\font\secsy=cmsy10 scaled \magstep1
-\def\sececsize{1200}
-
-% Subsection fonts (10pt).
-\def\ssecnominalsize{10pt}
-\setfont\ssecrm\rmbshape{10}{1000}{OT1}
-\setfont\ssecit\itbshape{10}{1000}{OT1IT}
-\setfont\ssecsl\slbshape{10}{1000}{OT1}
-\setfont\ssectt\ttbshape{10}{1000}{OT1TT}
-\setfont\ssecttsl\ttslshape{10}{1000}{OT1TT}
-\setfont\ssecsf\sfbshape{10}{1000}{OT1}
-\let\ssecbf\ssecrm
-\setfont\ssecsc\scbshape{10}{1000}{OT1}
-\font\sseci=cmmi10
-\font\ssecsy=cmsy10
-\def\ssececsize{1000}
-
-% Reduced fonts for @acro in text (9pt).
-\def\reducednominalsize{9pt}
-\setfont\reducedrm\rmshape{9}{1000}{OT1}
-\setfont\reducedtt\ttshape{9}{1000}{OT1TT}
-\setfont\reducedbf\bfshape{10}{900}{OT1}
-\setfont\reducedit\itshape{9}{1000}{OT1IT}
-\setfont\reducedsl\slshape{9}{1000}{OT1}
-\setfont\reducedsf\sfshape{9}{1000}{OT1}
-\setfont\reducedsc\scshape{10}{900}{OT1}
-\setfont\reducedttsl\ttslshape{10}{900}{OT1TT}
-\font\reducedi=cmmi9
-\font\reducedsy=cmsy9
-\def\reducedecsize{0900}
-
-\divide\parskip by 2 % reduce space between paragraphs
-\textleading = 12pt % line spacing for 10pt CM
-\textfonts % reset the current fonts
-\rm
-} % end of 10pt text font size definitions, \definetextfontsizex
-
-
-% We provide the user-level command
-% @fonttextsize 10
-% (or 11) to redefine the text font size. pt is assumed.
-%
-\def\xiword{11}
-\def\xword{10}
-\def\xwordpt{10pt}
-%
-\parseargdef\fonttextsize{%
- \def\textsizearg{#1}%
- %\wlog{doing @fonttextsize \textsizearg}%
- %
- % Set \globaldefs so that documents can use this inside @tex, since
- % makeinfo 4.8 does not support it, but we need it nonetheless.
- %
- \begingroup \globaldefs=1
- \ifx\textsizearg\xword \definetextfontsizex
- \else \ifx\textsizearg\xiword \definetextfontsizexi
- \else
- \errhelp=\EMsimple
- \errmessage{@fonttextsize only supports `10' or `11', not `\textsizearg'}
- \fi\fi
- \endgroup
-}
-
-
-% In order for the font changes to affect most math symbols and letters,
-% we have to define the \textfont of the standard families. Since
-% texinfo doesn't allow for producing subscripts and superscripts except
-% in the main text, we don't bother to reset \scriptfont and
-% \scriptscriptfont (which would also require loading a lot more fonts).
-%
-\def\resetmathfonts{%
- \textfont0=\tenrm \textfont1=\teni \textfont2=\tensy
- \textfont\itfam=\tenit \textfont\slfam=\tensl \textfont\bffam=\tenbf
- \textfont\ttfam=\tentt \textfont\sffam=\tensf
-}
-
-% The font-changing commands redefine the meanings of \tenSTYLE, instead
-% of just \STYLE. We do this because \STYLE needs to also set the
-% current \fam for math mode. Our \STYLE (e.g., \rm) commands hardwire
-% \tenSTYLE to set the current font.
-%
-% Each font-changing command also sets the names \lsize (one size lower)
-% and \lllsize (three sizes lower). These relative commands are used in
-% the LaTeX logo and acronyms.
-%
-% This all needs generalizing, badly.
-%
-\def\textfonts{%
- \let\tenrm=\textrm \let\tenit=\textit \let\tensl=\textsl
- \let\tenbf=\textbf \let\tentt=\texttt \let\smallcaps=\textsc
- \let\tensf=\textsf \let\teni=\texti \let\tensy=\textsy
- \let\tenttsl=\textttsl
- \def\curfontsize{text}%
- \def\lsize{reduced}\def\lllsize{smaller}%
- \resetmathfonts \setleading{\textleading}}
-\def\titlefonts{%
- \let\tenrm=\titlerm \let\tenit=\titleit \let\tensl=\titlesl
- \let\tenbf=\titlebf \let\tentt=\titlett \let\smallcaps=\titlesc
- \let\tensf=\titlesf \let\teni=\titlei \let\tensy=\titlesy
- \let\tenttsl=\titlettsl
- \def\curfontsize{title}%
- \def\lsize{chap}\def\lllsize{subsec}%
- \resetmathfonts \setleading{27pt}}
-\def\titlefont#1{{\titlefonts\rmisbold #1}}
-\def\chapfonts{%
- \let\tenrm=\chaprm \let\tenit=\chapit \let\tensl=\chapsl
- \let\tenbf=\chapbf \let\tentt=\chaptt \let\smallcaps=\chapsc
- \let\tensf=\chapsf \let\teni=\chapi \let\tensy=\chapsy
- \let\tenttsl=\chapttsl
- \def\curfontsize{chap}%
- \def\lsize{sec}\def\lllsize{text}%
- \resetmathfonts \setleading{19pt}}
-\def\secfonts{%
- \let\tenrm=\secrm \let\tenit=\secit \let\tensl=\secsl
- \let\tenbf=\secbf \let\tentt=\sectt \let\smallcaps=\secsc
- \let\tensf=\secsf \let\teni=\seci \let\tensy=\secsy
- \let\tenttsl=\secttsl
- \def\curfontsize{sec}%
- \def\lsize{subsec}\def\lllsize{reduced}%
- \resetmathfonts \setleading{16pt}}
-\def\subsecfonts{%
- \let\tenrm=\ssecrm \let\tenit=\ssecit \let\tensl=\ssecsl
- \let\tenbf=\ssecbf \let\tentt=\ssectt \let\smallcaps=\ssecsc
- \let\tensf=\ssecsf \let\teni=\sseci \let\tensy=\ssecsy
- \let\tenttsl=\ssecttsl
- \def\curfontsize{ssec}%
- \def\lsize{text}\def\lllsize{small}%
- \resetmathfonts \setleading{15pt}}
-\let\subsubsecfonts = \subsecfonts
-\def\reducedfonts{%
- \let\tenrm=\reducedrm \let\tenit=\reducedit \let\tensl=\reducedsl
- \let\tenbf=\reducedbf \let\tentt=\reducedtt \let\reducedcaps=\reducedsc
- \let\tensf=\reducedsf \let\teni=\reducedi \let\tensy=\reducedsy
- \let\tenttsl=\reducedttsl
- \def\curfontsize{reduced}%
- \def\lsize{small}\def\lllsize{smaller}%
- \resetmathfonts \setleading{10.5pt}}
-\def\smallfonts{%
- \let\tenrm=\smallrm \let\tenit=\smallit \let\tensl=\smallsl
- \let\tenbf=\smallbf \let\tentt=\smalltt \let\smallcaps=\smallsc
- \let\tensf=\smallsf \let\teni=\smalli \let\tensy=\smallsy
- \let\tenttsl=\smallttsl
- \def\curfontsize{small}%
- \def\lsize{smaller}\def\lllsize{smaller}%
- \resetmathfonts \setleading{10.5pt}}
-\def\smallerfonts{%
- \let\tenrm=\smallerrm \let\tenit=\smallerit \let\tensl=\smallersl
- \let\tenbf=\smallerbf \let\tentt=\smallertt \let\smallcaps=\smallersc
- \let\tensf=\smallersf \let\teni=\smalleri \let\tensy=\smallersy
- \let\tenttsl=\smallerttsl
- \def\curfontsize{smaller}%
- \def\lsize{smaller}\def\lllsize{smaller}%
- \resetmathfonts \setleading{9.5pt}}
-
-% Fonts for short table of contents.
-\setfont\shortcontrm\rmshape{12}{1000}{OT1}
-\setfont\shortcontbf\bfshape{10}{\magstep1}{OT1} % no cmb12
-\setfont\shortcontsl\slshape{12}{1000}{OT1}
-\setfont\shortconttt\ttshape{12}{1000}{OT1TT}
-
-% Define these just so they can be easily changed for other fonts.
-\def\angleleft{$\langle$}
-\def\angleright{$\rangle$}
-
-% Set the fonts to use with the @small... environments.
-\let\smallexamplefonts = \smallfonts
-
-% About \smallexamplefonts. If we use \smallfonts (9pt), @smallexample
-% can fit this many characters:
-% 8.5x11=86 smallbook=72 a4=90 a5=69
-% If we use \scriptfonts (8pt), then we can fit this many characters:
-% 8.5x11=90+ smallbook=80 a4=90+ a5=77
-% For me, subjectively, the few extra characters that fit aren't worth
-% the additional smallness of 8pt. So I'm making the default 9pt.
-%
-% By the way, for comparison, here's what fits with @example (10pt):
-% 8.5x11=71 smallbook=60 a4=75 a5=58
-% --karl, 24jan03.
-
-% Set up the default fonts, so we can use them for creating boxes.
-%
-\definetextfontsizexi
-
-
-\message{markup,}
-
-% Check if we are currently using a typewriter font. Since all the
-% Computer Modern typewriter fonts have zero interword stretch (and
-% shrink), and it is reasonable to expect all typewriter fonts to have
-% this property, we can check that font parameter.
-%
-\def\ifmonospace{\ifdim\fontdimen3\font=0pt }
-
-% Markup style infrastructure. \defmarkupstylesetup\INITMACRO will
-% define and register \INITMACRO to be called on markup style changes.
-% \INITMACRO can check \currentmarkupstyle for the innermost
-% style and the set of \ifmarkupSTYLE switches for all styles
-% currently in effect.
-\newif\ifmarkupvar
-\newif\ifmarkupsamp
-\newif\ifmarkupkey
-%\newif\ifmarkupfile % @file == @samp.
-%\newif\ifmarkupoption % @option == @samp.
-\newif\ifmarkupcode
-\newif\ifmarkupkbd
-%\newif\ifmarkupenv % @env == @code.
-%\newif\ifmarkupcommand % @command == @code.
-\newif\ifmarkuptex % @tex (and part of @math, for now).
-\newif\ifmarkupexample
-\newif\ifmarkupverb
-\newif\ifmarkupverbatim
-
-\let\currentmarkupstyle\empty
-
-\def\setupmarkupstyle#1{%
- \csname markup#1true\endcsname
- \def\currentmarkupstyle{#1}%
- \markupstylesetup
-}
-
-\let\markupstylesetup\empty
-
-\def\defmarkupstylesetup#1{%
- \expandafter\def\expandafter\markupstylesetup
- \expandafter{\markupstylesetup #1}%
- \def#1%
-}
-
-% Markup style setup for left and right quotes.
-\defmarkupstylesetup\markupsetuplq{%
- \expandafter\let\expandafter \temp
- \csname markupsetuplq\currentmarkupstyle\endcsname
- \ifx\temp\relax \markupsetuplqdefault \else \temp \fi
-}
-
-\defmarkupstylesetup\markupsetuprq{%
- \expandafter\let\expandafter \temp
- \csname markupsetuprq\currentmarkupstyle\endcsname
- \ifx\temp\relax \markupsetuprqdefault \else \temp \fi
-}
-
-{
-\catcode`\'=\active
-\catcode`\`=\active
-
-\gdef\markupsetuplqdefault{\let`\lq}
-\gdef\markupsetuprqdefault{\let'\rq}
-
-\gdef\markupsetcodequoteleft{\let`\codequoteleft}
-\gdef\markupsetcodequoteright{\let'\codequoteright}
-}
-
-\let\markupsetuplqcode \markupsetcodequoteleft
-\let\markupsetuprqcode \markupsetcodequoteright
-%
-\let\markupsetuplqexample \markupsetcodequoteleft
-\let\markupsetuprqexample \markupsetcodequoteright
-%
-\let\markupsetuplqkbd \markupsetcodequoteleft
-\let\markupsetuprqkbd \markupsetcodequoteright
-%
-\let\markupsetuplqsamp \markupsetcodequoteleft
-\let\markupsetuprqsamp \markupsetcodequoteright
-%
-\let\markupsetuplqverb \markupsetcodequoteleft
-\let\markupsetuprqverb \markupsetcodequoteright
-%
-\let\markupsetuplqverbatim \markupsetcodequoteleft
-\let\markupsetuprqverbatim \markupsetcodequoteright
-
-% Allow an option to not use regular directed right quote/apostrophe
-% (char 0x27), but instead the undirected quote from cmtt (char 0x0d).
-% The undirected quote is ugly, so don't make it the default, but it
-% works for pasting with more pdf viewers (at least evince), the
-% lilypond developers report. xpdf does work with the regular 0x27.
-%
-\def\codequoteright{%
- \expandafter\ifx\csname SETtxicodequoteundirected\endcsname\relax
- \expandafter\ifx\csname SETcodequoteundirected\endcsname\relax
- '%
- \else \char'15 \fi
- \else \char'15 \fi
-}
-%
-% and a similar option for the left quote char vs. a grave accent.
-% Modern fonts display ASCII 0x60 as a grave accent, so some people like
-% the code environments to do likewise.
-%
-\def\codequoteleft{%
- \expandafter\ifx\csname SETtxicodequotebacktick\endcsname\relax
- \expandafter\ifx\csname SETcodequotebacktick\endcsname\relax
- % [Knuth] pp. 380,381,391
- % \relax disables Spanish ligatures ?` and !` of \tt font.
- \relax`%
- \else \char'22 \fi
- \else \char'22 \fi
-}
-
-% Commands to set the quote options.
-%
-\parseargdef\codequoteundirected{%
- \def\temp{#1}%
- \ifx\temp\onword
- \expandafter\let\csname SETtxicodequoteundirected\endcsname
- = t%
- \else\ifx\temp\offword
- \expandafter\let\csname SETtxicodequoteundirected\endcsname
- = \relax
- \else
- \errhelp = \EMsimple
- \errmessage{Unknown @codequoteundirected value `\temp', must be on|off}%
- \fi\fi
-}
-%
-\parseargdef\codequotebacktick{%
- \def\temp{#1}%
- \ifx\temp\onword
- \expandafter\let\csname SETtxicodequotebacktick\endcsname
- = t%
- \else\ifx\temp\offword
- \expandafter\let\csname SETtxicodequotebacktick\endcsname
- = \relax
- \else
- \errhelp = \EMsimple
- \errmessage{Unknown @codequotebacktick value `\temp', must be on|off}%
- \fi\fi
-}
-
-% [Knuth] pp. 380,381,391, disable Spanish ligatures ?` and !` of \tt font.
-\def\noligaturesquoteleft{\relax\lq}
-
-% Count depth in font-changes, for error checks
-\newcount\fontdepth \fontdepth=0
-
-% Font commands.
-
-% #1 is the font command (\sl or \it), #2 is the text to slant.
-% If we are in a monospaced environment, however, 1) always use \ttsl,
-% and 2) do not add an italic correction.
-\def\dosmartslant#1#2{%
- \ifusingtt
- {{\ttsl #2}\let\next=\relax}%
- {\def\next{{#1#2}\futurelet\next\smartitaliccorrection}}%
- \next
-}
-\def\smartslanted{\dosmartslant\sl}
-\def\smartitalic{\dosmartslant\it}
-
-% Output an italic correction unless \next (presumed to be the following
-% character) is such as not to need one.
-\def\smartitaliccorrection{%
- \ifx\next,%
- \else\ifx\next-%
- \else\ifx\next.%
- \else\ptexslash
- \fi\fi\fi
- \aftersmartic
-}
-
-% Unconditional use \ttsl, and no ic. @var is set to this for defuns.
-\def\ttslanted#1{{\ttsl #1}}
-
-% @cite is like \smartslanted except unconditionally use \sl. We never want
-% ttsl for book titles, do we?
-\def\cite#1{{\sl #1}\futurelet\next\smartitaliccorrection}
-
-\def\aftersmartic{}
-\def\var#1{%
- \let\saveaftersmartic = \aftersmartic
- \def\aftersmartic{\null\let\aftersmartic=\saveaftersmartic}%
- \smartslanted{#1}%
-}
-
-\let\i=\smartitalic
-\let\slanted=\smartslanted
-\let\dfn=\smartslanted
-\let\emph=\smartitalic
-
-% Explicit font changes: @r, @sc, undocumented @ii.
-\def\r#1{{\rm #1}} % roman font
-\def\sc#1{{\smallcaps#1}} % smallcaps font
-\def\ii#1{{\it #1}} % italic font
-
-% @b, explicit bold. Also @strong.
-\def\b#1{{\bf #1}}
-\let\strong=\b
-
-% @sansserif, explicit sans.
-\def\sansserif#1{{\sf #1}}
-
-% We can't just use \exhyphenpenalty, because that only has effect at
-% the end of a paragraph. Restore normal hyphenation at the end of the
-% group within which \nohyphenation is presumably called.
-%
-\def\nohyphenation{\hyphenchar\font = -1 \aftergroup\restorehyphenation}
-\def\restorehyphenation{\hyphenchar\font = `- }
-
-% Set sfcode to normal for the chars that usually have another value.
-% Can't use plain's \frenchspacing because it uses the `\x notation, and
-% sometimes \x has an active definition that messes things up.
-%
-\catcode`@=11
- \def\plainfrenchspacing{%
- \sfcode\dotChar =\@m \sfcode\questChar=\@m \sfcode\exclamChar=\@m
- \sfcode\colonChar=\@m \sfcode\semiChar =\@m \sfcode\commaChar =\@m
- \def\endofsentencespacefactor{1000}% for @. and friends
- }
- \def\plainnonfrenchspacing{%
- \sfcode`\.3000\sfcode`\?3000\sfcode`\!3000
- \sfcode`\:2000\sfcode`\;1500\sfcode`\,1250
- \def\endofsentencespacefactor{3000}% for @. and friends
- }
-\catcode`@=\other
-\def\endofsentencespacefactor{3000}% default
-
-% @t, explicit typewriter.
-\def\t#1{%
- {\tt \rawbackslash \plainfrenchspacing #1}%
- \null
-}
-
-% @samp.
-\def\samp#1{{\setupmarkupstyle{samp}\lq\tclose{#1}\rq\null}}
-
-% @indicateurl is \samp, that is, with quotes.
-\let\indicateurl=\samp
-
-% @code (and similar) prints in typewriter, but with spaces the same
-% size as normal in the surrounding text, without hyphenation, etc.
-% This is a subroutine for that.
-\def\tclose#1{%
- {%
- % Change normal interword space to be same as for the current font.
- \spaceskip = \fontdimen2\font
- %
- % Switch to typewriter.
- \tt
- %
- % But `\ ' produces the large typewriter interword space.
- \def\ {{\spaceskip = 0pt{} }}%
- %
- % Turn off hyphenation.
- \nohyphenation
- %
- \rawbackslash
- \plainfrenchspacing
- #1%
- }%
- \null % reset spacefactor to 1000
-}
-
-% We *must* turn on hyphenation at `-' and `_' in @code.
-% Otherwise, it is too hard to avoid overfull hboxes
-% in the Emacs manual, the Library manual, etc.
-%
-% Unfortunately, TeX uses one parameter (\hyphenchar) to control
-% both hyphenation at - and hyphenation within words.
-% We must therefore turn them both off (\tclose does that)
-% and arrange explicitly to hyphenate at a dash.
-% -- rms.
-{
- \catcode`\-=\active \catcode`\_=\active
- \catcode`\'=\active \catcode`\`=\active
- \global\let'=\rq \global\let`=\lq % default definitions
- %
- \global\def\code{\begingroup
- \setupmarkupstyle{code}%
- % The following should really be moved into \setupmarkupstyle handlers.
- \catcode\dashChar=\active \catcode\underChar=\active
- \ifallowcodebreaks
- \let-\codedash
- \let_\codeunder
- \else
- \let-\normaldash
- \let_\realunder
- \fi
- \codex
- }
-}
-
-\def\codex #1{\tclose{#1}\endgroup}
-
-\def\normaldash{-}
-\def\codedash{-\discretionary{}{}{}}
-\def\codeunder{%
- % this is all so @math{@code{var_name}+1} can work. In math mode, _
- % is "active" (mathcode"8000) and \normalunderscore (or \char95, etc.)
- % will therefore expand the active definition of _, which is us
- % (inside @code that is), therefore an endless loop.
- \ifusingtt{\ifmmode
- \mathchar"075F % class 0=ordinary, family 7=ttfam, pos 0x5F=_.
- \else\normalunderscore \fi
- \discretionary{}{}{}}%
- {\_}%
-}
-
-% An additional complication: the above will allow breaks after, e.g.,
-% each of the four underscores in __typeof__. This is bad.
-% @allowcodebreaks provides a document-level way to turn breaking at -
-% and _ on and off.
-%
-\newif\ifallowcodebreaks \allowcodebreakstrue
-
-\def\keywordtrue{true}
-\def\keywordfalse{false}
-
-\parseargdef\allowcodebreaks{%
- \def\txiarg{#1}%
- \ifx\txiarg\keywordtrue
- \allowcodebreakstrue
- \else\ifx\txiarg\keywordfalse
- \allowcodebreaksfalse
- \else
- \errhelp = \EMsimple
- \errmessage{Unknown @allowcodebreaks option `\txiarg', must be true|false}%
- \fi\fi
-}
-
-% For @command, @env, @file, @option quotes seem unnecessary,
-% so use \code rather than \samp.
-\let\command=\code
-\let\env=\code
-\let\file=\code
-\let\option=\code
-
-% @uref (abbreviation for `urlref') takes an optional (comma-separated)
-% second argument specifying the text to display and an optional third
-% arg as text to display instead of (rather than in addition to) the url
-% itself. First (mandatory) arg is the url.
-% (This \urefnobreak definition isn't used now, leaving it for a while
-% for comparison.)
-\def\urefnobreak#1{\dourefnobreak #1,,,\finish}
-\def\dourefnobreak#1,#2,#3,#4\finish{\begingroup
- \unsepspaces
- \pdfurl{#1}%
- \setbox0 = \hbox{\ignorespaces #3}%
- \ifdim\wd0 > 0pt
- \unhbox0 % third arg given, show only that
- \else
- \setbox0 = \hbox{\ignorespaces #2}%
- \ifdim\wd0 > 0pt
- \ifpdf
- \unhbox0 % PDF: 2nd arg given, show only it
- \else
- \unhbox0\ (\code{#1})% DVI: 2nd arg given, show both it and url
- \fi
- \else
- \code{#1}% only url given, so show it
- \fi
- \fi
- \endlink
-\endgroup}
-
-% This \urefbreak definition is the active one.
-\def\urefbreak{\begingroup \urefcatcodes \dourefbreak}
-\let\uref=\urefbreak
-\def\dourefbreak#1{\urefbreakfinish #1,,,\finish}
-\def\urefbreakfinish#1,#2,#3,#4\finish{% doesn't work in @example
- \unsepspaces
- \pdfurl{#1}%
- \setbox0 = \hbox{\ignorespaces #3}%
- \ifdim\wd0 > 0pt
- \unhbox0 % third arg given, show only that
- \else
- \setbox0 = \hbox{\ignorespaces #2}%
- \ifdim\wd0 > 0pt
- \ifpdf
- \unhbox0 % PDF: 2nd arg given, show only it
- \else
- \unhbox0\ (\urefcode{#1})% DVI: 2nd arg given, show both it and url
- \fi
- \else
- \urefcode{#1}% only url given, so show it
- \fi
- \fi
- \endlink
-\endgroup}
-
-% Allow line breaks around only a few characters (only).
-\def\urefcatcodes{%
- \catcode\ampChar=\active \catcode\dotChar=\active
- \catcode\hashChar=\active \catcode\questChar=\active
- \catcode\slashChar=\active
-}
-{
- \urefcatcodes
- %
- \global\def\urefcode{\begingroup
- \setupmarkupstyle{code}%
- \urefcatcodes
- \let&\urefcodeamp
- \let.\urefcodedot
- \let#\urefcodehash
- \let?\urefcodequest
- \let/\urefcodeslash
- \codex
- }
- %
- % By default, they are just regular characters.
- \global\def&{\normalamp}
- \global\def.{\normaldot}
- \global\def#{\normalhash}
- \global\def?{\normalquest}
- \global\def/{\normalslash}
-}
-
-% we put a little stretch before and after the breakable chars, to help
-% line breaking of long url's. The unequal skips make look better in
-% cmtt at least, especially for dots.
-\def\urefprestretch{\urefprebreak \hskip0pt plus.13em }
-\def\urefpoststretch{\urefpostbreak \hskip0pt plus.1em }
-%
-\def\urefcodeamp{\urefprestretch \&\urefpoststretch}
-\def\urefcodedot{\urefprestretch .\urefpoststretch}
-\def\urefcodehash{\urefprestretch \#\urefpoststretch}
-\def\urefcodequest{\urefprestretch ?\urefpoststretch}
-\def\urefcodeslash{\futurelet\next\urefcodeslashfinish}
-{
- \catcode`\/=\active
- \global\def\urefcodeslashfinish{%
- \urefprestretch \slashChar
- % Allow line break only after the final / in a sequence of
- % slashes, to avoid line break between the slashes in http://.
- \ifx\next/\else \urefpoststretch \fi
- }
-}
-
-% One more complication: by default we'll break after the special
-% characters, but some people like to break before the special chars, so
-% allow that. Also allow no breaking at all, for manual control.
-%
-\parseargdef\urefbreakstyle{%
- \def\txiarg{#1}%
- \ifx\txiarg\wordnone
- \def\urefprebreak{\nobreak}\def\urefpostbreak{\nobreak}
- \else\ifx\txiarg\wordbefore
- \def\urefprebreak{\allowbreak}\def\urefpostbreak{\nobreak}
- \else\ifx\txiarg\wordafter
- \def\urefprebreak{\nobreak}\def\urefpostbreak{\allowbreak}
- \else
- \errhelp = \EMsimple
- \errmessage{Unknown @urefbreakstyle setting `\txiarg'}%
- \fi\fi\fi
-}
-\def\wordafter{after}
-\def\wordbefore{before}
-\def\wordnone{none}
-
-\urefbreakstyle after
-
-% @url synonym for @uref, since that's how everyone uses it.
-%
-\let\url=\uref
-
-% rms does not like angle brackets --karl, 17may97.
-% So now @email is just like @uref, unless we are pdf.
-%
-%\def\email#1{\angleleft{\tt #1}\angleright}
-\ifpdf
- \def\email#1{\doemail#1,,\finish}
- \def\doemail#1,#2,#3\finish{\begingroup
- \unsepspaces
- \pdfurl{mailto:#1}%
- \setbox0 = \hbox{\ignorespaces #2}%
- \ifdim\wd0>0pt\unhbox0\else\code{#1}\fi
- \endlink
- \endgroup}
-\else
- \let\email=\uref
-\fi
-
-% @kbdinputstyle -- arg is `distinct' (@kbd uses slanted tty font always),
-% `example' (@kbd uses ttsl only inside of @example and friends),
-% or `code' (@kbd uses normal tty font always).
-\parseargdef\kbdinputstyle{%
- \def\txiarg{#1}%
- \ifx\txiarg\worddistinct
- \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\ttsl}%
- \else\ifx\txiarg\wordexample
- \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\tt}%
- \else\ifx\txiarg\wordcode
- \gdef\kbdexamplefont{\tt}\gdef\kbdfont{\tt}%
- \else
- \errhelp = \EMsimple
- \errmessage{Unknown @kbdinputstyle setting `\txiarg'}%
- \fi\fi\fi
-}
-\def\worddistinct{distinct}
-\def\wordexample{example}
-\def\wordcode{code}
-
-% Default is `distinct'.
-\kbdinputstyle distinct
-
-% @kbd is like @code, except that if the argument is just one @key command,
-% then @kbd has no effect.
-\def\kbd#1{{\def\look{#1}\expandafter\kbdsub\look??\par}}
-
-\def\xkey{\key}
-\def\kbdsub#1#2#3\par{%
- \def\one{#1}\def\three{#3}\def\threex{??}%
- \ifx\one\xkey\ifx\threex\three \key{#2}%
- \else{\tclose{\kbdfont\setupmarkupstyle{kbd}\look}}\fi
- \else{\tclose{\kbdfont\setupmarkupstyle{kbd}\look}}\fi
-}
-
-% definition of @key that produces a lozenge. Doesn't adjust to text size.
-%\setfont\keyrm\rmshape{8}{1000}{OT1}
-%\font\keysy=cmsy9
-%\def\key#1{{\keyrm\textfont2=\keysy \leavevmode\hbox{%
-% \raise0.4pt\hbox{\angleleft}\kern-.08em\vtop{%
-% \vbox{\hrule\kern-0.4pt
-% \hbox{\raise0.4pt\hbox{\vphantom{\angleleft}}#1}}%
-% \kern-0.4pt\hrule}%
-% \kern-.06em\raise0.4pt\hbox{\angleright}}}}
-
-% definition of @key with no lozenge. If the current font is already
-% monospace, don't change it; that way, we respect @kbdinputstyle. But
-% if it isn't monospace, then use \tt.
-%
-\def\key#1{{\setupmarkupstyle{key}%
- \nohyphenation
- \ifmonospace\else\tt\fi
- #1}\null}
-
-% @clicksequence{File @click{} Open ...}
-\def\clicksequence#1{\begingroup #1\endgroup}
-
-% @clickstyle @arrow (by default)
-\parseargdef\clickstyle{\def\click{#1}}
-\def\click{\arrow}
-
-% Typeset a dimension, e.g., `in' or `pt'. The only reason for the
-% argument is to make the input look right: @dmn{pt} instead of @dmn{}pt.
-%
-\def\dmn#1{\thinspace #1}
-
-% @l was never documented to mean ``switch to the Lisp font'',
-% and it is not used as such in any manual I can find. We need it for
-% Polish suppressed-l. --karl, 22sep96.
-%\def\l#1{{\li #1}\null}
-
-% @acronym for "FBI", "NATO", and the like.
-% We print this one point size smaller, since it's intended for
-% all-uppercase.
-%
-\def\acronym#1{\doacronym #1,,\finish}
-\def\doacronym#1,#2,#3\finish{%
- {\selectfonts\lsize #1}%
- \def\temp{#2}%
- \ifx\temp\empty \else
- \space ({\unsepspaces \ignorespaces \temp \unskip})%
- \fi
- \null % reset \spacefactor=1000
-}
-
-% @abbr for "Comput. J." and the like.
-% No font change, but don't do end-of-sentence spacing.
-%
-\def\abbr#1{\doabbr #1,,\finish}
-\def\doabbr#1,#2,#3\finish{%
- {\plainfrenchspacing #1}%
- \def\temp{#2}%
- \ifx\temp\empty \else
- \space ({\unsepspaces \ignorespaces \temp \unskip})%
- \fi
- \null % reset \spacefactor=1000
-}
-
-% @asis just yields its argument. Used with @table, for example.
-%
-\def\asis#1{#1}
-
-% @math outputs its argument in math mode.
-%
-% One complication: _ usually means subscripts, but it could also mean
-% an actual _ character, as in @math{@var{some_variable} + 1}. So make
-% _ active, and distinguish by seeing if the current family is \slfam,
-% which is what @var uses.
-{
- \catcode`\_ = \active
- \gdef\mathunderscore{%
- \catcode`\_=\active
- \def_{\ifnum\fam=\slfam \_\else\sb\fi}%
- }
-}
-% Another complication: we want \\ (and @\) to output a math (or tt) \.
-% FYI, plain.tex uses \\ as a temporary control sequence (for no
-% particular reason), but this is not advertised and we don't care.
-%
-% The \mathchar is class=0=ordinary, family=7=ttfam, position=5C=\.
-\def\mathbackslash{\ifnum\fam=\ttfam \mathchar"075C \else\backslash \fi}
-%
-\def\math{%
- \tex
- \mathunderscore
- \let\\ = \mathbackslash
- \mathactive
- % make the texinfo accent commands work in math mode
- \let\"=\ddot
- \let\'=\acute
- \let\==\bar
- \let\^=\hat
- \let\`=\grave
- \let\u=\breve
- \let\v=\check
- \let\~=\tilde
- \let\dotaccent=\dot
- $\finishmath
-}
-\def\finishmath#1{#1$\endgroup} % Close the group opened by \tex.
-
-% Some active characters (such as <) are spaced differently in math.
-% We have to reset their definitions in case the @math was an argument
-% to a command which sets the catcodes (such as @item or @section).
-%
-{
- \catcode`^ = \active
- \catcode`< = \active
- \catcode`> = \active
- \catcode`+ = \active
- \catcode`' = \active
- \gdef\mathactive{%
- \let^ = \ptexhat
- \let< = \ptexless
- \let> = \ptexgtr
- \let+ = \ptexplus
- \let' = \ptexquoteright
- }
-}
-
-% ctrl is no longer a Texinfo command, but leave this definition for fun.
-\def\ctrl #1{{\tt \rawbackslash \hat}#1}
-
-% @inlinefmt{FMTNAME,PROCESSED-TEXT} and @inlineraw{FMTNAME,RAW-TEXT}.
-% Ignore unless FMTNAME == tex; then it is like @iftex and @tex,
-% except specified as a normal braced arg, so no newlines to worry about.
-%
-\def\outfmtnametex{tex}
-%
-\long\def\inlinefmt#1{\doinlinefmt #1,\finish}
-\long\def\doinlinefmt#1,#2,\finish{%
- \def\inlinefmtname{#1}%
- \ifx\inlinefmtname\outfmtnametex \ignorespaces #2\fi
-}
-% For raw, must switch into @tex before parsing the argument, to avoid
-% setting catcodes prematurely. Doing it this way means that, for
-% example, @inlineraw{html, foo{bar} gets a parse error instead of being
-% ignored. But this isn't important because if people want a literal
-% *right* brace they would have to use a command anyway, so they may as
-% well use a command to get a left brace too. We could re-use the
-% delimiter character idea from \verb, but it seems like overkill.
-%
-\long\def\inlineraw{\tex \doinlineraw}
-\long\def\doinlineraw#1{\doinlinerawtwo #1,\finish}
-\def\doinlinerawtwo#1,#2,\finish{%
- \def\inlinerawname{#1}%
- \ifx\inlinerawname\outfmtnametex \ignorespaces #2\fi
- \endgroup % close group opened by \tex.
-}
-
-
-\message{glyphs,}
-% and logos.
-
-% @@ prints an @, as does @atchar{}.
-\def\@{\char64 }
-\let\atchar=\@
-
-% @{ @} @lbracechar{} @rbracechar{} all generate brace characters.
-% Unless we're in typewriter, use \ecfont because the CM text fonts do
-% not have braces, and we don't want to switch into math.
-\def\mylbrace{{\ifmonospace\else\ecfont\fi \char123}}
-\def\myrbrace{{\ifmonospace\else\ecfont\fi \char125}}
-\let\{=\mylbrace \let\lbracechar=\{
-\let\}=\myrbrace \let\rbracechar=\}
-\begingroup
- % Definitions to produce \{ and \} commands for indices,
- % and @{ and @} for the aux/toc files.
- \catcode`\{ = \other \catcode`\} = \other
- \catcode`\[ = 1 \catcode`\] = 2
- \catcode`\! = 0 \catcode`\\ = \other
- !gdef!lbracecmd[\{]%
- !gdef!rbracecmd[\}]%
- !gdef!lbraceatcmd[@{]%
- !gdef!rbraceatcmd[@}]%
-!endgroup
-
-% @comma{} to avoid , parsing problems.
-\let\comma = ,
-
-% Accents: @, @dotaccent @ringaccent @ubaraccent @udotaccent
-% Others are defined by plain TeX: @` @' @" @^ @~ @= @u @v @H.
-\let\, = \ptexc
-\let\dotaccent = \ptexdot
-\def\ringaccent#1{{\accent23 #1}}
-\let\tieaccent = \ptext
-\let\ubaraccent = \ptexb
-\let\udotaccent = \d
-
-% Other special characters: @questiondown @exclamdown @ordf @ordm
-% Plain TeX defines: @AA @AE @O @OE @L (plus lowercase versions) @ss.
-\def\questiondown{?`}
-\def\exclamdown{!`}
-\def\ordf{\leavevmode\raise1ex\hbox{\selectfonts\lllsize \underbar{a}}}
-\def\ordm{\leavevmode\raise1ex\hbox{\selectfonts\lllsize \underbar{o}}}
-
-% Dotless i and dotless j, used for accents.
-\def\imacro{i}
-\def\jmacro{j}
-\def\dotless#1{%
- \def\temp{#1}%
- \ifx\temp\imacro \ifmmode\imath \else\ptexi \fi
- \else\ifx\temp\jmacro \ifmmode\jmath \else\j \fi
- \else \errmessage{@dotless can be used only with i or j}%
- \fi\fi
-}
-
-% The \TeX{} logo, as in plain, but resetting the spacing so that a
-% period following counts as ending a sentence. (Idea found in latex.)
-%
-\edef\TeX{\TeX \spacefactor=1000 }
-
-% @LaTeX{} logo. Not quite the same results as the definition in
-% latex.ltx, since we use a different font for the raised A; it's most
-% convenient for us to use an explicitly smaller font, rather than using
-% the \scriptstyle font (since we don't reset \scriptstyle and
-% \scriptscriptstyle).
-%
-\def\LaTeX{%
- L\kern-.36em
- {\setbox0=\hbox{T}%
- \vbox to \ht0{\hbox{%
- \ifx\textnominalsize\xwordpt
- % for 10pt running text, \lllsize (8pt) is too small for the A in LaTeX.
- % Revert to plain's \scriptsize, which is 7pt.
- \count255=\the\fam $\fam\count255 \scriptstyle A$%
- \else
- % For 11pt, we can use our lllsize.
- \selectfonts\lllsize A%
- \fi
- }%
- \vss
- }}%
- \kern-.15em
- \TeX
-}
-
-% Some math mode symbols.
-\def\bullet{$\ptexbullet$}
-\def\geq{\ifmmode \ge\else $\ge$\fi}
-\def\leq{\ifmmode \le\else $\le$\fi}
-\def\minus{\ifmmode -\else $-$\fi}
-
-% @dots{} outputs an ellipsis using the current font.
-% We do .5em per period so that it has the same spacing in the cm
-% typewriter fonts as three actual period characters; on the other hand,
-% in other typewriter fonts three periods are wider than 1.5em. So do
-% whichever is larger.
-%
-\def\dots{%
- \leavevmode
- \setbox0=\hbox{...}% get width of three periods
- \ifdim\wd0 > 1.5em
- \dimen0 = \wd0
- \else
- \dimen0 = 1.5em
- \fi
- \hbox to \dimen0{%
- \hskip 0pt plus.25fil
- .\hskip 0pt plus1fil
- .\hskip 0pt plus1fil
- .\hskip 0pt plus.5fil
- }%
-}
-
-% @enddots{} is an end-of-sentence ellipsis.
-%
-\def\enddots{%
- \dots
- \spacefactor=\endofsentencespacefactor
-}
-
-% @point{}, @result{}, @expansion{}, @print{}, @equiv{}.
-%
-% Since these characters are used in examples, they should be an even number of
-% \tt widths. Each \tt character is 1en, so two makes it 1em.
-%
-\def\point{$\star$}
-\def\arrow{\leavevmode\raise.05ex\hbox to 1em{\hfil$\rightarrow$\hfil}}
-\def\result{\leavevmode\raise.05ex\hbox to 1em{\hfil$\Rightarrow$\hfil}}
-\def\expansion{\leavevmode\hbox to 1em{\hfil$\mapsto$\hfil}}
-\def\print{\leavevmode\lower.1ex\hbox to 1em{\hfil$\dashv$\hfil}}
-\def\equiv{\leavevmode\hbox to 1em{\hfil$\ptexequiv$\hfil}}
-
-% The @error{} command.
-% Adapted from the TeXbook's \boxit.
-%
-\newbox\errorbox
-%
-{\tentt \global\dimen0 = 3em}% Width of the box.
-\dimen2 = .55pt % Thickness of rules
-% The text. (`r' is open on the right, `e' somewhat less so on the left.)
-\setbox0 = \hbox{\kern-.75pt \reducedsf \putworderror\kern-1.5pt}
-%
-\setbox\errorbox=\hbox to \dimen0{\hfil
- \hsize = \dimen0 \advance\hsize by -5.8pt % Space to left+right.
- \advance\hsize by -2\dimen2 % Rules.
- \vbox{%
- \hrule height\dimen2
- \hbox{\vrule width\dimen2 \kern3pt % Space to left of text.
- \vtop{\kern2.4pt \box0 \kern2.4pt}% Space above/below.
- \kern3pt\vrule width\dimen2}% Space to right.
- \hrule height\dimen2}
- \hfil}
-%
-\def\error{\leavevmode\lower.7ex\copy\errorbox}
-
-% @pounds{} is a sterling sign, which Knuth put in the CM italic font.
-%
-\def\pounds{{\it\$}}
-
-% @euro{} comes from a separate font, depending on the current style.
-% We use the free feym* fonts from the eurosym package by Henrik
-% Theiling, which support regular, slanted, bold and bold slanted (and
-% "outlined" (blackboard board, sort of) versions, which we don't need).
-% It is available from http://www.ctan.org/tex-archive/fonts/eurosym.
-%
-% Although only regular is the truly official Euro symbol, we ignore
-% that. The Euro is designed to be slightly taller than the regular
-% font height.
-%
-% feymr - regular
-% feymo - slanted
-% feybr - bold
-% feybo - bold slanted
-%
-% There is no good (free) typewriter version, to my knowledge.
-% A feymr10 euro is ~7.3pt wide, while a normal cmtt10 char is ~5.25pt wide.
-% Hmm.
-%
-% Also doesn't work in math. Do we need to do math with euro symbols?
-% Hope not.
-%
-%
-\def\euro{{\eurofont e}}
-\def\eurofont{%
- % We set the font at each command, rather than predefining it in
- % \textfonts and the other font-switching commands, so that
- % installations which never need the symbol don't have to have the
- % font installed.
- %
- % There is only one designed size (nominal 10pt), so we always scale
- % that to the current nominal size.
- %
- % By the way, simply using "at 1em" works for cmr10 and the like, but
- % does not work for cmbx10 and other extended/shrunken fonts.
- %
- \def\eurosize{\csname\curfontsize nominalsize\endcsname}%
- %
- \ifx\curfontstyle\bfstylename
- % bold:
- \font\thiseurofont = \ifusingit{feybo10}{feybr10} at \eurosize
- \else
- % regular:
- \font\thiseurofont = \ifusingit{feymo10}{feymr10} at \eurosize
- \fi
- \thiseurofont
-}
-
-% Glyphs from the EC fonts. We don't use \let for the aliases, because
-% sometimes we redefine the original macro, and the alias should reflect
-% the redefinition.
-%
-% Use LaTeX names for the Icelandic letters.
-\def\DH{{\ecfont \char"D0}} % Eth
-\def\dh{{\ecfont \char"F0}} % eth
-\def\TH{{\ecfont \char"DE}} % Thorn
-\def\th{{\ecfont \char"FE}} % thorn
-%
-\def\guillemetleft{{\ecfont \char"13}}
-\def\guillemotleft{\guillemetleft}
-\def\guillemetright{{\ecfont \char"14}}
-\def\guillemotright{\guillemetright}
-\def\guilsinglleft{{\ecfont \char"0E}}
-\def\guilsinglright{{\ecfont \char"0F}}
-\def\quotedblbase{{\ecfont \char"12}}
-\def\quotesinglbase{{\ecfont \char"0D}}
-%
-% This positioning is not perfect (see the ogonek LaTeX package), but
-% we have the precomposed glyphs for the most common cases. We put the
-% tests to use those glyphs in the single \ogonek macro so we have fewer
-% dummy definitions to worry about for index entries, etc.
-%
-% ogonek is also used with other letters in Lithuanian (IOU), but using
-% the precomposed glyphs for those is not so easy since they aren't in
-% the same EC font.
-\def\ogonek#1{{%
- \def\temp{#1}%
- \ifx\temp\macrocharA\Aogonek
- \else\ifx\temp\macrochara\aogonek
- \else\ifx\temp\macrocharE\Eogonek
- \else\ifx\temp\macrochare\eogonek
- \else
- \ecfont \setbox0=\hbox{#1}%
- \ifdim\ht0=1ex\accent"0C #1%
- \else\ooalign{\unhbox0\crcr\hidewidth\char"0C \hidewidth}%
- \fi
- \fi\fi\fi\fi
- }%
-}
-\def\Aogonek{{\ecfont \char"81}}\def\macrocharA{A}
-\def\aogonek{{\ecfont \char"A1}}\def\macrochara{a}
-\def\Eogonek{{\ecfont \char"86}}\def\macrocharE{E}
-\def\eogonek{{\ecfont \char"A6}}\def\macrochare{e}
-%
-% Use the ec* fonts (cm-super in outline format) for non-CM glyphs.
-\def\ecfont{%
- % We can't distinguish serif/sans and italic/slanted, but this
- % is used for crude hacks anyway (like adding French and German
- % quotes to documents typeset with CM, where we lose kerning), so
- % hopefully nobody will notice/care.
- \edef\ecsize{\csname\curfontsize ecsize\endcsname}%
- \edef\nominalsize{\csname\curfontsize nominalsize\endcsname}%
- \ifmonospace
- % typewriter:
- \font\thisecfont = ectt\ecsize \space at \nominalsize
- \else
- \ifx\curfontstyle\bfstylename
- % bold:
- \font\thisecfont = ecb\ifusingit{i}{x}\ecsize \space at \nominalsize
- \else
- % regular:
- \font\thisecfont = ec\ifusingit{ti}{rm}\ecsize \space at \nominalsize
- \fi
- \fi
- \thisecfont
-}
-
-% @registeredsymbol - R in a circle. The font for the R should really
-% be smaller yet, but lllsize is the best we can do for now.
-% Adapted from the plain.tex definition of \copyright.
-%
-\def\registeredsymbol{%
- $^{{\ooalign{\hfil\raise.07ex\hbox{\selectfonts\lllsize R}%
- \hfil\crcr\Orb}}%
- }$%
-}
-
-% @textdegree - the normal degrees sign.
-%
-\def\textdegree{$^\circ$}
-
-% Laurent Siebenmann reports \Orb undefined with:
-% Textures 1.7.7 (preloaded format=plain 93.10.14) (68K) 16 APR 2004 02:38
-% so we'll define it if necessary.
-%
-\ifx\Orb\thisisundefined
-\def\Orb{\mathhexbox20D}
-\fi
-
-% Quotes.
-\chardef\quotedblleft="5C
-\chardef\quotedblright=`\"
-\chardef\quoteleft=`\`
-\chardef\quoteright=`\'
-
-
-\message{page headings,}
-
-\newskip\titlepagetopglue \titlepagetopglue = 1.5in
-\newskip\titlepagebottomglue \titlepagebottomglue = 2pc
-
-% First the title page. Must do @settitle before @titlepage.
-\newif\ifseenauthor
-\newif\iffinishedtitlepage
-
-% Do an implicit @contents or @shortcontents after @end titlepage if the
-% user says @setcontentsaftertitlepage or @setshortcontentsaftertitlepage.
-%
-\newif\ifsetcontentsaftertitlepage
- \let\setcontentsaftertitlepage = \setcontentsaftertitlepagetrue
-\newif\ifsetshortcontentsaftertitlepage
- \let\setshortcontentsaftertitlepage = \setshortcontentsaftertitlepagetrue
-
-\parseargdef\shorttitlepage{%
- \begingroup \hbox{}\vskip 1.5in \chaprm \centerline{#1}%
- \endgroup\page\hbox{}\page}
-
-\envdef\titlepage{%
- % Open one extra group, as we want to close it in the middle of \Etitlepage.
- \begingroup
- \parindent=0pt \textfonts
- % Leave some space at the very top of the page.
- \vglue\titlepagetopglue
- % No rule at page bottom unless we print one at the top with @title.
- \finishedtitlepagetrue
- %
- % Most title ``pages'' are actually two pages long, with space
- % at the top of the second. We don't want the ragged left on the second.
- \let\oldpage = \page
- \def\page{%
- \iffinishedtitlepage\else
- \finishtitlepage
- \fi
- \let\page = \oldpage
- \page
- \null
- }%
-}
-
-\def\Etitlepage{%
- \iffinishedtitlepage\else
- \finishtitlepage
- \fi
- % It is important to do the page break before ending the group,
- % because the headline and footline are only empty inside the group.
- % If we use the new definition of \page, we always get a blank page
- % after the title page, which we certainly don't want.
- \oldpage
- \endgroup
- %
- % Need this before the \...aftertitlepage checks so that if they are
- % in effect the toc pages will come out with page numbers.
- \HEADINGSon
- %
- % If they want short, they certainly want long too.
- \ifsetshortcontentsaftertitlepage
- \shortcontents
- \contents
- \global\let\shortcontents = \relax
- \global\let\contents = \relax
- \fi
- %
- \ifsetcontentsaftertitlepage
- \contents
- \global\let\contents = \relax
- \global\let\shortcontents = \relax
- \fi
-}
-
-\def\finishtitlepage{%
- \vskip4pt \hrule height 2pt width \hsize
- \vskip\titlepagebottomglue
- \finishedtitlepagetrue
-}
-
-% Settings used for typesetting titles: no hyphenation, no indentation,
-% don't worry much about spacing, ragged right. This should be used
-% inside a \vbox, and fonts need to be set appropriately first. Because
-% it is always used for titles, nothing else, we call \rmisbold. \par
-% should be specified before the end of the \vbox, since a vbox is a group.
-%
-\def\raggedtitlesettings{%
- \rmisbold
- \hyphenpenalty=10000
- \parindent=0pt
- \tolerance=5000
- \ptexraggedright
-}
-
-% Macros to be used within @titlepage:
-
-\let\subtitlerm=\tenrm
-\def\subtitlefont{\subtitlerm \normalbaselineskip = 13pt \normalbaselines}
-
-\parseargdef\title{%
- \checkenv\titlepage
- \vbox{\titlefonts \raggedtitlesettings #1\par}%
- % print a rule at the page bottom also.
- \finishedtitlepagefalse
- \vskip4pt \hrule height 4pt width \hsize \vskip4pt
-}
-
-\parseargdef\subtitle{%
- \checkenv\titlepage
- {\subtitlefont \rightline{#1}}%
-}
-
-% @author should come last, but may come many times.
-% It can also be used inside @quotation.
-%
-\parseargdef\author{%
- \def\temp{\quotation}%
- \ifx\thisenv\temp
- \def\quotationauthor{#1}% printed in \Equotation.
- \else
- \checkenv\titlepage
- \ifseenauthor\else \vskip 0pt plus 1filll \seenauthortrue \fi
- {\secfonts\rmisbold \leftline{#1}}%
- \fi
-}
-
-
-% Set up page headings and footings.
-
-\let\thispage=\folio
-
-\newtoks\evenheadline % headline on even pages
-\newtoks\oddheadline % headline on odd pages
-\newtoks\evenfootline % footline on even pages
-\newtoks\oddfootline % footline on odd pages
-
-% Now make TeX use those variables
-\headline={{\textfonts\rm \ifodd\pageno \the\oddheadline
- \else \the\evenheadline \fi}}
-\footline={{\textfonts\rm \ifodd\pageno \the\oddfootline
- \else \the\evenfootline \fi}\HEADINGShook}
-\let\HEADINGShook=\relax
-
-% Commands to set those variables.
-% For example, this is what @headings on does
-% @evenheading @thistitle|@thispage|@thischapter
-% @oddheading @thischapter|@thispage|@thistitle
-% @evenfooting @thisfile||
-% @oddfooting ||@thisfile
-
-
-\def\evenheading{\parsearg\evenheadingxxx}
-\def\evenheadingxxx #1{\evenheadingyyy #1\|\|\|\|\finish}
-\def\evenheadingyyy #1\|#2\|#3\|#4\finish{%
-\global\evenheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
-
-\def\oddheading{\parsearg\oddheadingxxx}
-\def\oddheadingxxx #1{\oddheadingyyy #1\|\|\|\|\finish}
-\def\oddheadingyyy #1\|#2\|#3\|#4\finish{%
-\global\oddheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
-
-\parseargdef\everyheading{\oddheadingxxx{#1}\evenheadingxxx{#1}}%
-
-\def\evenfooting{\parsearg\evenfootingxxx}
-\def\evenfootingxxx #1{\evenfootingyyy #1\|\|\|\|\finish}
-\def\evenfootingyyy #1\|#2\|#3\|#4\finish{%
-\global\evenfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
-
-\def\oddfooting{\parsearg\oddfootingxxx}
-\def\oddfootingxxx #1{\oddfootingyyy #1\|\|\|\|\finish}
-\def\oddfootingyyy #1\|#2\|#3\|#4\finish{%
- \global\oddfootline = {\rlap{\centerline{#2}}\line{#1\hfil#3}}%
- %
- % Leave some space for the footline. Hopefully ok to assume
- % @evenfooting will not be used by itself.
- \global\advance\pageheight by -12pt
- \global\advance\vsize by -12pt
-}
-
-\parseargdef\everyfooting{\oddfootingxxx{#1}\evenfootingxxx{#1}}
-
-% @evenheadingmarks top \thischapter <- chapter at the top of a page
-% @evenheadingmarks bottom \thischapter <- chapter at the bottom of a page
-%
-% The same set of arguments for:
-%
-% @oddheadingmarks
-% @evenfootingmarks
-% @oddfootingmarks
-% @everyheadingmarks
-% @everyfootingmarks
-
-\def\evenheadingmarks{\headingmarks{even}{heading}}
-\def\oddheadingmarks{\headingmarks{odd}{heading}}
-\def\evenfootingmarks{\headingmarks{even}{footing}}
-\def\oddfootingmarks{\headingmarks{odd}{footing}}
-\def\everyheadingmarks#1 {\headingmarks{even}{heading}{#1}
- \headingmarks{odd}{heading}{#1} }
-\def\everyfootingmarks#1 {\headingmarks{even}{footing}{#1}
- \headingmarks{odd}{footing}{#1} }
-% #1 = even/odd, #2 = heading/footing, #3 = top/bottom.
-\def\headingmarks#1#2#3 {%
- \expandafter\let\expandafter\temp \csname get#3headingmarks\endcsname
- \global\expandafter\let\csname get#1#2marks\endcsname \temp
-}
-
-\everyheadingmarks bottom
-\everyfootingmarks bottom
-
-% @headings double turns headings on for double-sided printing.
-% @headings single turns headings on for single-sided printing.
-% @headings off turns them off.
-% @headings on same as @headings double, retained for compatibility.
-% @headings after turns on double-sided headings after this page.
-% @headings doubleafter turns on double-sided headings after this page.
-% @headings singleafter turns on single-sided headings after this page.
-% By default, they are off at the start of a document,
-% and turned `on' after @end titlepage.
-
-\def\headings #1 {\csname HEADINGS#1\endcsname}
-
-\def\headingsoff{% non-global headings elimination
- \evenheadline={\hfil}\evenfootline={\hfil}%
- \oddheadline={\hfil}\oddfootline={\hfil}%
-}
-
-\def\HEADINGSoff{{\globaldefs=1 \headingsoff}} % global setting
-\HEADINGSoff % it's the default
-
-% When we turn headings on, set the page number to 1.
-% For double-sided printing, put current file name in lower left corner,
-% chapter name on inside top of right hand pages, document
-% title on inside top of left hand pages, and page numbers on outside top
-% edge of all pages.
-\def\HEADINGSdouble{%
-\global\pageno=1
-\global\evenfootline={\hfil}
-\global\oddfootline={\hfil}
-\global\evenheadline={\line{\folio\hfil\thistitle}}
-\global\oddheadline={\line{\thischapter\hfil\folio}}
-\global\let\contentsalignmacro = \chapoddpage
-}
-\let\contentsalignmacro = \chappager
-
-% For single-sided printing, chapter title goes across top left of page,
-% page number on top right.
-\def\HEADINGSsingle{%
-\global\pageno=1
-\global\evenfootline={\hfil}
-\global\oddfootline={\hfil}
-\global\evenheadline={\line{\thischapter\hfil\folio}}
-\global\oddheadline={\line{\thischapter\hfil\folio}}
-\global\let\contentsalignmacro = \chappager
-}
-\def\HEADINGSon{\HEADINGSdouble}
-
-\def\HEADINGSafter{\let\HEADINGShook=\HEADINGSdoublex}
-\let\HEADINGSdoubleafter=\HEADINGSafter
-\def\HEADINGSdoublex{%
-\global\evenfootline={\hfil}
-\global\oddfootline={\hfil}
-\global\evenheadline={\line{\folio\hfil\thistitle}}
-\global\oddheadline={\line{\thischapter\hfil\folio}}
-\global\let\contentsalignmacro = \chapoddpage
-}
-
-\def\HEADINGSsingleafter{\let\HEADINGShook=\HEADINGSsinglex}
-\def\HEADINGSsinglex{%
-\global\evenfootline={\hfil}
-\global\oddfootline={\hfil}
-\global\evenheadline={\line{\thischapter\hfil\folio}}
-\global\oddheadline={\line{\thischapter\hfil\folio}}
-\global\let\contentsalignmacro = \chappager
-}
-
-% Subroutines used in generating headings
-% This produces Day Month Year style of output.
-% Only define if not already defined, in case a txi-??.tex file has set
-% up a different format (e.g., txi-cs.tex does this).
-\ifx\today\thisisundefined
-\def\today{%
- \number\day\space
- \ifcase\month
- \or\putwordMJan\or\putwordMFeb\or\putwordMMar\or\putwordMApr
- \or\putwordMMay\or\putwordMJun\or\putwordMJul\or\putwordMAug
- \or\putwordMSep\or\putwordMOct\or\putwordMNov\or\putwordMDec
- \fi
- \space\number\year}
-\fi
-
-% @settitle line... specifies the title of the document, for headings.
-% It generates no output of its own.
-\def\thistitle{\putwordNoTitle}
-\def\settitle{\parsearg{\gdef\thistitle}}
-
-
-\message{tables,}
-% Tables -- @table, @ftable, @vtable, @item(x).
-
-% default indentation of table text
-\newdimen\tableindent \tableindent=.8in
-% default indentation of @itemize and @enumerate text
-\newdimen\itemindent \itemindent=.3in
-% margin between end of table item and start of table text.
-\newdimen\itemmargin \itemmargin=.1in
-
-% used internally for \itemindent minus \itemmargin
-\newdimen\itemmax
-
-% Note @table, @ftable, and @vtable define @item, @itemx, etc., with
-% these defs.
-% They also define \itemindex
-% to index the item name in whatever manner is desired (perhaps none).
-
-\newif\ifitemxneedsnegativevskip
-
-\def\itemxpar{\par\ifitemxneedsnegativevskip\nobreak\vskip-\parskip\nobreak\fi}
-
-\def\internalBitem{\smallbreak \parsearg\itemzzz}
-\def\internalBitemx{\itemxpar \parsearg\itemzzz}
-
-\def\itemzzz #1{\begingroup %
- \advance\hsize by -\rightskip
- \advance\hsize by -\tableindent
- \setbox0=\hbox{\itemindicate{#1}}%
- \itemindex{#1}%
- \nobreak % This prevents a break before @itemx.
- %
- % If the item text does not fit in the space we have, put it on a line
- % by itself, and do not allow a page break either before or after that
- % line. We do not start a paragraph here because then if the next
- % command is, e.g., @kindex, the whatsit would get put into the
- % horizontal list on a line by itself, resulting in extra blank space.
- \ifdim \wd0>\itemmax
- %
- % Make this a paragraph so we get the \parskip glue and wrapping,
- % but leave it ragged-right.
- \begingroup
- \advance\leftskip by-\tableindent
- \advance\hsize by\tableindent
- \advance\rightskip by0pt plus1fil\relax
- \leavevmode\unhbox0\par
- \endgroup
- %
- % We're going to be starting a paragraph, but we don't want the
- % \parskip glue -- logically it's part of the @item we just started.
- \nobreak \vskip-\parskip
- %
- % Stop a page break at the \parskip glue coming up. However, if
- % what follows is an environment such as @example, there will be no
- % \parskip glue; then the negative vskip we just inserted would
- % cause the example and the item to crash together. So we use this
- % bizarre value of 10001 as a signal to \aboveenvbreak to insert
- % \parskip glue after all. Section titles are handled this way also.
- %
- \penalty 10001
- \endgroup
- \itemxneedsnegativevskipfalse
- \else
- % The item text fits into the space. Start a paragraph, so that the
- % following text (if any) will end up on the same line.
- \noindent
- % Do this with kerns and \unhbox so that if there is a footnote in
- % the item text, it can migrate to the main vertical list and
- % eventually be printed.
- \nobreak\kern-\tableindent
- \dimen0 = \itemmax \advance\dimen0 by \itemmargin \advance\dimen0 by -\wd0
- \unhbox0
- \nobreak\kern\dimen0
- \endgroup
- \itemxneedsnegativevskiptrue
- \fi
-}
-
-\def\item{\errmessage{@item while not in a list environment}}
-\def\itemx{\errmessage{@itemx while not in a list environment}}
-
-% @table, @ftable, @vtable.
-\envdef\table{%
- \let\itemindex\gobble
- \tablecheck{table}%
-}
-\envdef\ftable{%
- \def\itemindex ##1{\doind {fn}{\code{##1}}}%
- \tablecheck{ftable}%
-}
-\envdef\vtable{%
- \def\itemindex ##1{\doind {vr}{\code{##1}}}%
- \tablecheck{vtable}%
-}
-\def\tablecheck#1{%
- \ifnum \the\catcode`\^^M=\active
- \endgroup
- \errmessage{This command won't work in this context; perhaps the problem is
- that we are \inenvironment\thisenv}%
- \def\next{\doignore{#1}}%
- \else
- \let\next\tablex
- \fi
- \next
-}
-\def\tablex#1{%
- \def\itemindicate{#1}%
- \parsearg\tabley
-}
-\def\tabley#1{%
- {%
- \makevalueexpandable
- \edef\temp{\noexpand\tablez #1\space\space\space}%
- \expandafter
- }\temp \endtablez
-}
-\def\tablez #1 #2 #3 #4\endtablez{%
- \aboveenvbreak
- \ifnum 0#1>0 \advance \leftskip by #1\mil \fi
- \ifnum 0#2>0 \tableindent=#2\mil \fi
- \ifnum 0#3>0 \advance \rightskip by #3\mil \fi
- \itemmax=\tableindent
- \advance \itemmax by -\itemmargin
- \advance \leftskip by \tableindent
- \exdentamount=\tableindent
- \parindent = 0pt
- \parskip = \smallskipamount
- \ifdim \parskip=0pt \parskip=2pt \fi
- \let\item = \internalBitem
- \let\itemx = \internalBitemx
-}
-\def\Etable{\endgraf\afterenvbreak}
-\let\Eftable\Etable
-\let\Evtable\Etable
-\let\Eitemize\Etable
-\let\Eenumerate\Etable
-
-% This is the counter used by @enumerate, which is really @itemize
-
-\newcount \itemno
-
-\envdef\itemize{\parsearg\doitemize}
-
-\def\doitemize#1{%
- \aboveenvbreak
- \itemmax=\itemindent
- \advance\itemmax by -\itemmargin
- \advance\leftskip by \itemindent
- \exdentamount=\itemindent
- \parindent=0pt
- \parskip=\smallskipamount
- \ifdim\parskip=0pt \parskip=2pt \fi
- %
- % Try typesetting the item mark that if the document erroneously says
- % something like @itemize @samp (intending @table), there's an error
- % right away at the @itemize. It's not the best error message in the
- % world, but it's better than leaving it to the @item. This means if
- % the user wants an empty mark, they have to say @w{} not just @w.
- \def\itemcontents{#1}%
- \setbox0 = \hbox{\itemcontents}%
- %
- % @itemize with no arg is equivalent to @itemize @bullet.
- \ifx\itemcontents\empty\def\itemcontents{\bullet}\fi
- %
- \let\item=\itemizeitem
-}
-
-% Definition of @item while inside @itemize and @enumerate.
-%
-\def\itemizeitem{%
- \advance\itemno by 1 % for enumerations
- {\let\par=\endgraf \smallbreak}% reasonable place to break
- {%
- % If the document has an @itemize directly after a section title, a
- % \nobreak will be last on the list, and \sectionheading will have
- % done a \vskip-\parskip. In that case, we don't want to zero
- % parskip, or the item text will crash with the heading. On the
- % other hand, when there is normal text preceding the item (as there
- % usually is), we do want to zero parskip, or there would be too much
- % space. In that case, we won't have a \nobreak before. At least
- % that's the theory.
- \ifnum\lastpenalty<10000 \parskip=0in \fi
- \noindent
- \hbox to 0pt{\hss \itemcontents \kern\itemmargin}%
- %
- \vadjust{\penalty 1200}}% not good to break after first line of item.
- \flushcr
-}
-
-% \splitoff TOKENS\endmark defines \first to be the first token in
-% TOKENS, and \rest to be the remainder.
-%
-\def\splitoff#1#2\endmark{\def\first{#1}\def\rest{#2}}%
-
-% Allow an optional argument of an uppercase letter, lowercase letter,
-% or number, to specify the first label in the enumerated list. No
-% argument is the same as `1'.
-%
-\envparseargdef\enumerate{\enumeratey #1 \endenumeratey}
-\def\enumeratey #1 #2\endenumeratey{%
- % If we were given no argument, pretend we were given `1'.
- \def\thearg{#1}%
- \ifx\thearg\empty \def\thearg{1}\fi
- %
- % Detect if the argument is a single token. If so, it might be a
- % letter. Otherwise, the only valid thing it can be is a number.
- % (We will always have one token, because of the test we just made.
- % This is a good thing, since \splitoff doesn't work given nothing at
- % all -- the first parameter is undelimited.)
- \expandafter\splitoff\thearg\endmark
- \ifx\rest\empty
- % Only one token in the argument. It could still be anything.
- % A ``lowercase letter'' is one whose \lccode is nonzero.
- % An ``uppercase letter'' is one whose \lccode is both nonzero, and
- % not equal to itself.
- % Otherwise, we assume it's a number.
- %
- % We need the \relax at the end of the \ifnum lines to stop TeX from
- % continuing to look for a <number>.
- %
- \ifnum\lccode\expandafter`\thearg=0\relax
- \numericenumerate % a number (we hope)
- \else
- % It's a letter.
- \ifnum\lccode\expandafter`\thearg=\expandafter`\thearg\relax
- \lowercaseenumerate % lowercase letter
- \else
- \uppercaseenumerate % uppercase letter
- \fi
- \fi
- \else
- % Multiple tokens in the argument. We hope it's a number.
- \numericenumerate
- \fi
-}
-
-% An @enumerate whose labels are integers. The starting integer is
-% given in \thearg.
-%
-\def\numericenumerate{%
- \itemno = \thearg
- \startenumeration{\the\itemno}%
-}
-
-% The starting (lowercase) letter is in \thearg.
-\def\lowercaseenumerate{%
- \itemno = \expandafter`\thearg
- \startenumeration{%
- % Be sure we're not beyond the end of the alphabet.
- \ifnum\itemno=0
- \errmessage{No more lowercase letters in @enumerate; get a bigger
- alphabet}%
- \fi
- \char\lccode\itemno
- }%
-}
-
-% The starting (uppercase) letter is in \thearg.
-\def\uppercaseenumerate{%
- \itemno = \expandafter`\thearg
- \startenumeration{%
- % Be sure we're not beyond the end of the alphabet.
- \ifnum\itemno=0
- \errmessage{No more uppercase letters in @enumerate; get a bigger
- alphabet}
- \fi
- \char\uccode\itemno
- }%
-}
-
-% Call \doitemize, adding a period to the first argument and supplying the
-% common last two arguments. Also subtract one from the initial value in
-% \itemno, since @item increments \itemno.
-%
-\def\startenumeration#1{%
- \advance\itemno by -1
- \doitemize{#1.}\flushcr
-}
-
-% @alphaenumerate and @capsenumerate are abbreviations for giving an arg
-% to @enumerate.
-%
-\def\alphaenumerate{\enumerate{a}}
-\def\capsenumerate{\enumerate{A}}
-\def\Ealphaenumerate{\Eenumerate}
-\def\Ecapsenumerate{\Eenumerate}
-
-
-% @multitable macros
-% Amy Hendrickson, 8/18/94, 3/6/96
-%
-% @multitable ... @end multitable will make as many columns as desired.
-% Contents of each column will wrap at width given in preamble. Width
-% can be specified either with sample text given in a template line,
-% or in percent of \hsize, the current width of text on page.
-
-% Table can continue over pages but will only break between lines.
-
-% To make preamble:
-%
-% Either define widths of columns in terms of percent of \hsize:
-% @multitable @columnfractions .25 .3 .45
-% @item ...
-%
-% Numbers following @columnfractions are the percent of the total
-% current hsize to be used for each column. You may use as many
-% columns as desired.
-
-
-% Or use a template:
-% @multitable {Column 1 template} {Column 2 template} {Column 3 template}
-% @item ...
-% using the widest term desired in each column.
-
-% Each new table line starts with @item, each subsequent new column
-% starts with @tab. Empty columns may be produced by supplying @tab's
-% with nothing between them for as many times as empty columns are needed,
-% ie, @tab@tab@tab will produce two empty columns.
-
-% @item, @tab do not need to be on their own lines, but it will not hurt
-% if they are.
-
-% Sample multitable:
-
-% @multitable {Column 1 template} {Column 2 template} {Column 3 template}
-% @item first col stuff @tab second col stuff @tab third col
-% @item
-% first col stuff
-% @tab
-% second col stuff
-% @tab
-% third col
-% @item first col stuff @tab second col stuff
-% @tab Many paragraphs of text may be used in any column.
-%
-% They will wrap at the width determined by the template.
-% @item@tab@tab This will be in third column.
-% @end multitable
-
-% Default dimensions may be reset by user.
-% @multitableparskip is vertical space between paragraphs in table.
-% @multitableparindent is paragraph indent in table.
-% @multitablecolmargin is horizontal space to be left between columns.
-% @multitablelinespace is space to leave between table items, baseline
-% to baseline.
-% 0pt means it depends on current normal line spacing.
-%
-\newskip\multitableparskip
-\newskip\multitableparindent
-\newdimen\multitablecolspace
-\newskip\multitablelinespace
-\multitableparskip=0pt
-\multitableparindent=6pt
-\multitablecolspace=12pt
-\multitablelinespace=0pt
-
-% Macros used to set up halign preamble:
-%
-\let\endsetuptable\relax
-\def\xendsetuptable{\endsetuptable}
-\let\columnfractions\relax
-\def\xcolumnfractions{\columnfractions}
-\newif\ifsetpercent
-
-% #1 is the @columnfraction, usually a decimal number like .5, but might
-% be just 1. We just use it, whatever it is.
-%
-\def\pickupwholefraction#1 {%
- \global\advance\colcount by 1
- \expandafter\xdef\csname col\the\colcount\endcsname{#1\hsize}%
- \setuptable
-}
-
-\newcount\colcount
-\def\setuptable#1{%
- \def\firstarg{#1}%
- \ifx\firstarg\xendsetuptable
- \let\go = \relax
- \else
- \ifx\firstarg\xcolumnfractions
- \global\setpercenttrue
- \else
- \ifsetpercent
- \let\go\pickupwholefraction
- \else
- \global\advance\colcount by 1
- \setbox0=\hbox{#1\unskip\space}% Add a normal word space as a
- % separator; typically that is always in the input, anyway.
- \expandafter\xdef\csname col\the\colcount\endcsname{\the\wd0}%
- \fi
- \fi
- \ifx\go\pickupwholefraction
- % Put the argument back for the \pickupwholefraction call, so
- % we'll always have a period there to be parsed.
- \def\go{\pickupwholefraction#1}%
- \else
- \let\go = \setuptable
- \fi%
- \fi
- \go
-}
-
-% multitable-only commands.
-%
-% @headitem starts a heading row, which we typeset in bold.
-% Assignments have to be global since we are inside the implicit group
-% of an alignment entry. \everycr resets \everytab so we don't have to
-% undo it ourselves.
-\def\headitemfont{\b}% for people to use in the template row; not changeable
-\def\headitem{%
- \checkenv\multitable
- \crcr
- \global\everytab={\bf}% can't use \headitemfont since the parsing differs
- \the\everytab % for the first item
-}%
-%
-% A \tab used to include \hskip1sp. But then the space in a template
-% line is not enough. That is bad. So let's go back to just `&' until
-% we again encounter the problem the 1sp was intended to solve.
-% --karl, nathan@acm.org, 20apr99.
-\def\tab{\checkenv\multitable &\the\everytab}%
-
-% @multitable ... @end multitable definitions:
-%
-\newtoks\everytab % insert after every tab.
-%
-\envdef\multitable{%
- \vskip\parskip
- \startsavinginserts
- %
- % @item within a multitable starts a normal row.
- % We use \def instead of \let so that if one of the multitable entries
- % contains an @itemize, we don't choke on the \item (seen as \crcr aka
- % \endtemplate) expanding \doitemize.
- \def\item{\crcr}%
- %
- \tolerance=9500
- \hbadness=9500
- \setmultitablespacing
- \parskip=\multitableparskip
- \parindent=\multitableparindent
- \overfullrule=0pt
- \global\colcount=0
- %
- \everycr = {%
- \noalign{%
- \global\everytab={}%
- \global\colcount=0 % Reset the column counter.
- % Check for saved footnotes, etc.
- \checkinserts
- % Keeps underfull box messages off when table breaks over pages.
- %\filbreak
- % Maybe so, but it also creates really weird page breaks when the
- % table breaks over pages. Wouldn't \vfil be better? Wait until the
- % problem manifests itself, so it can be fixed for real --karl.
- }%
- }%
- %
- \parsearg\domultitable
-}
-\def\domultitable#1{%
- % To parse everything between @multitable and @item:
- \setuptable#1 \endsetuptable
- %
- % This preamble sets up a generic column definition, which will
- % be used as many times as user calls for columns.
- % \vtop will set a single line and will also let text wrap and
- % continue for many paragraphs if desired.
- \halign\bgroup &%
- \global\advance\colcount by 1
- \multistrut
- \vtop{%
- % Use the current \colcount to find the correct column width:
- \hsize=\expandafter\csname col\the\colcount\endcsname
- %
- % In order to keep entries from bumping into each other
- % we will add a \leftskip of \multitablecolspace to all columns after
- % the first one.
- %
- % If a template has been used, we will add \multitablecolspace
- % to the width of each template entry.
- %
- % If the user has set preamble in terms of percent of \hsize we will
- % use that dimension as the width of the column, and the \leftskip
- % will keep entries from bumping into each other. Table will start at
- % left margin and final column will justify at right margin.
- %
- % Make sure we don't inherit \rightskip from the outer environment.
- \rightskip=0pt
- \ifnum\colcount=1
- % The first column will be indented with the surrounding text.
- \advance\hsize by\leftskip
- \else
- \ifsetpercent \else
- % If user has not set preamble in terms of percent of \hsize
- % we will advance \hsize by \multitablecolspace.
- \advance\hsize by \multitablecolspace
- \fi
- % In either case we will make \leftskip=\multitablecolspace:
- \leftskip=\multitablecolspace
- \fi
- % Ignoring space at the beginning and end avoids an occasional spurious
- % blank line, when TeX decides to break the line at the space before the
- % box from the multistrut, so the strut ends up on a line by itself.
- % For example:
- % @multitable @columnfractions .11 .89
- % @item @code{#}
- % @tab Legal holiday which is valid in major parts of the whole country.
- % Is automatically provided with highlighting sequences respectively
- % marking characters.
- \noindent\ignorespaces##\unskip\multistrut
- }\cr
-}
-\def\Emultitable{%
- \crcr
- \egroup % end the \halign
- \global\setpercentfalse
-}
-
-\def\setmultitablespacing{%
- \def\multistrut{\strut}% just use the standard line spacing
- %
- % Compute \multitablelinespace (if not defined by user) for use in
- % \multitableparskip calculation. We used define \multistrut based on
- % this, but (ironically) that caused the spacing to be off.
- % See bug-texinfo report from Werner Lemberg, 31 Oct 2004 12:52:20 +0100.
-\ifdim\multitablelinespace=0pt
-\setbox0=\vbox{X}\global\multitablelinespace=\the\baselineskip
-\global\advance\multitablelinespace by-\ht0
-\fi
-% Test to see if parskip is larger than space between lines of
-% table. If not, do nothing.
-% If so, set to same dimension as multitablelinespace.
-\ifdim\multitableparskip>\multitablelinespace
-\global\multitableparskip=\multitablelinespace
-\global\advance\multitableparskip-7pt % to keep parskip somewhat smaller
- % than skip between lines in the table.
-\fi%
-\ifdim\multitableparskip=0pt
-\global\multitableparskip=\multitablelinespace
-\global\advance\multitableparskip-7pt % to keep parskip somewhat smaller
- % than skip between lines in the table.
-\fi}
-
-
-\message{conditionals,}
-
-% @iftex, @ifnotdocbook, @ifnothtml, @ifnotinfo, @ifnotplaintext,
-% @ifnotxml always succeed. They currently do nothing; we don't
-% attempt to check whether the conditionals are properly nested. But we
-% have to remember that they are conditionals, so that @end doesn't
-% attempt to close an environment group.
-%
-\def\makecond#1{%
- \expandafter\let\csname #1\endcsname = \relax
- \expandafter\let\csname iscond.#1\endcsname = 1
-}
-\makecond{iftex}
-\makecond{ifnotdocbook}
-\makecond{ifnothtml}
-\makecond{ifnotinfo}
-\makecond{ifnotplaintext}
-\makecond{ifnotxml}
-
-% Ignore @ignore, @ifhtml, @ifinfo, and the like.
-%
-\def\direntry{\doignore{direntry}}
-\def\documentdescription{\doignore{documentdescription}}
-\def\docbook{\doignore{docbook}}
-\def\html{\doignore{html}}
-\def\ifdocbook{\doignore{ifdocbook}}
-\def\ifhtml{\doignore{ifhtml}}
-\def\ifinfo{\doignore{ifinfo}}
-\def\ifnottex{\doignore{ifnottex}}
-\def\ifplaintext{\doignore{ifplaintext}}
-\def\ifxml{\doignore{ifxml}}
-\def\ignore{\doignore{ignore}}
-\def\menu{\doignore{menu}}
-\def\xml{\doignore{xml}}
-
-% Ignore text until a line `@end #1', keeping track of nested conditionals.
-%
-% A count to remember the depth of nesting.
-\newcount\doignorecount
-
-\def\doignore#1{\begingroup
- % Scan in ``verbatim'' mode:
- \obeylines
- \catcode`\@ = \other
- \catcode`\{ = \other
- \catcode`\} = \other
- %
- % Make sure that spaces turn into tokens that match what \doignoretext wants.
- \spaceisspace
- %
- % Count number of #1's that we've seen.
- \doignorecount = 0
- %
- % Swallow text until we reach the matching `@end #1'.
- \dodoignore{#1}%
-}
-
-{ \catcode`_=11 % We want to use \_STOP_ which cannot appear in texinfo source.
- \obeylines %
- %
- \gdef\dodoignore#1{%
- % #1 contains the command name as a string, e.g., `ifinfo'.
- %
- % Define a command to find the next `@end #1'.
- \long\def\doignoretext##1^^M@end #1{%
- \doignoretextyyy##1^^M@#1\_STOP_}%
- %
- % And this command to find another #1 command, at the beginning of a
- % line. (Otherwise, we would consider a line `@c @ifset', for
- % example, to count as an @ifset for nesting.)
- \long\def\doignoretextyyy##1^^M@#1##2\_STOP_{\doignoreyyy{##2}\_STOP_}%
- %
- % And now expand that command.
- \doignoretext ^^M%
- }%
-}
-
-\def\doignoreyyy#1{%
- \def\temp{#1}%
- \ifx\temp\empty % Nothing found.
- \let\next\doignoretextzzz
- \else % Found a nested condition, ...
- \advance\doignorecount by 1
- \let\next\doignoretextyyy % ..., look for another.
- % If we're here, #1 ends with ^^M\ifinfo (for example).
- \fi
- \next #1% the token \_STOP_ is present just after this macro.
-}
-
-% We have to swallow the remaining "\_STOP_".
-%
-\def\doignoretextzzz#1{%
- \ifnum\doignorecount = 0 % We have just found the outermost @end.
- \let\next\enddoignore
- \else % Still inside a nested condition.
- \advance\doignorecount by -1
- \let\next\doignoretext % Look for the next @end.
- \fi
- \next
-}
-
-% Finish off ignored text.
-{ \obeylines%
- % Ignore anything after the last `@end #1'; this matters in verbatim
- % environments, where otherwise the newline after an ignored conditional
- % would result in a blank line in the output.
- \gdef\enddoignore#1^^M{\endgroup\ignorespaces}%
-}
-
-
-% @set VAR sets the variable VAR to an empty value.
-% @set VAR REST-OF-LINE sets VAR to the value REST-OF-LINE.
-%
-% Since we want to separate VAR from REST-OF-LINE (which might be
-% empty), we can't just use \parsearg; we have to insert a space of our
-% own to delimit the rest of the line, and then take it out again if we
-% didn't need it.
-% We rely on the fact that \parsearg sets \catcode`\ =10.
-%
-\parseargdef\set{\setyyy#1 \endsetyyy}
-\def\setyyy#1 #2\endsetyyy{%
- {%
- \makevalueexpandable
- \def\temp{#2}%
- \edef\next{\gdef\makecsname{SET#1}}%
- \ifx\temp\empty
- \next{}%
- \else
- \setzzz#2\endsetzzz
- \fi
- }%
-}
-% Remove the trailing space \setxxx inserted.
-\def\setzzz#1 \endsetzzz{\next{#1}}
-
-% @clear VAR clears (i.e., unsets) the variable VAR.
-%
-\parseargdef\clear{%
- {%
- \makevalueexpandable
- \global\expandafter\let\csname SET#1\endcsname=\relax
- }%
-}
-
-% @value{foo} gets the text saved in variable foo.
-\def\value{\begingroup\makevalueexpandable\valuexxx}
-\def\valuexxx#1{\expandablevalue{#1}\endgroup}
-{
- \catcode`\- = \active \catcode`\_ = \active
- %
- \gdef\makevalueexpandable{%
- \let\value = \expandablevalue
- % We don't want these characters active, ...
- \catcode`\-=\other \catcode`\_=\other
- % ..., but we might end up with active ones in the argument if
- % we're called from @code, as @code{@value{foo-bar_}}, though.
- % So \let them to their normal equivalents.
- \let-\normaldash \let_\normalunderscore
- }
-}
-
-% We have this subroutine so that we can handle at least some @value's
-% properly in indexes (we call \makevalueexpandable in \indexdummies).
-% The command has to be fully expandable (if the variable is set), since
-% the result winds up in the index file. This means that if the
-% variable's value contains other Texinfo commands, it's almost certain
-% it will fail (although perhaps we could fix that with sufficient work
-% to do a one-level expansion on the result, instead of complete).
-%
-\def\expandablevalue#1{%
- \expandafter\ifx\csname SET#1\endcsname\relax
- {[No value for ``#1'']}%
- \message{Variable `#1', used in @value, is not set.}%
- \else
- \csname SET#1\endcsname
- \fi
-}
-
-% @ifset VAR ... @end ifset reads the `...' iff VAR has been defined
-% with @set.
-%
-% To get special treatment of `@end ifset,' call \makeond and the redefine.
-%
-\makecond{ifset}
-\def\ifset{\parsearg{\doifset{\let\next=\ifsetfail}}}
-\def\doifset#1#2{%
- {%
- \makevalueexpandable
- \let\next=\empty
- \expandafter\ifx\csname SET#2\endcsname\relax
- #1% If not set, redefine \next.
- \fi
- \expandafter
- }\next
-}
-\def\ifsetfail{\doignore{ifset}}
-
-% @ifclear VAR ... @end executes the `...' iff VAR has never been
-% defined with @set, or has been undefined with @clear.
-%
-% The `\else' inside the `\doifset' parameter is a trick to reuse the
-% above code: if the variable is not set, do nothing, if it is set,
-% then redefine \next to \ifclearfail.
-%
-\makecond{ifclear}
-\def\ifclear{\parsearg{\doifset{\else \let\next=\ifclearfail}}}
-\def\ifclearfail{\doignore{ifclear}}
-
-% @ifcommandisdefined CMD ... @end executes the `...' if CMD (written
-% without the @) is in fact defined. We can only feasibly check at the
-% TeX level, so something like `mathcode' is going to considered
-% defined even though it is not a Texinfo command.
-%
-\makecond{ifcommanddefined}
-\def\ifcommanddefined{\parsearg{\doifcmddefined{\let\next=\ifcmddefinedfail}}}
-%
-\def\doifcmddefined#1#2{{%
- \makevalueexpandable
- \let\next=\empty
- \expandafter\ifx\csname #2\endcsname\relax
- #1% If not defined, \let\next as above.
- \fi
- \expandafter
- }\next
-}
-\def\ifcmddefinedfail{\doignore{ifcommanddefined}}
-
-% @ifcommandnotdefined CMD ... handled similar to @ifclear above.
-\makecond{ifcommandnotdefined}
-\def\ifcommandnotdefined{%
- \parsearg{\doifcmddefined{\else \let\next=\ifcmdnotdefinedfail}}}
-\def\ifcmdnotdefinedfail{\doignore{ifcommandnotdefined}}
-
-% Set the `txicommandconditionals' variable, so documents have a way to
-% test if the @ifcommand...defined conditionals are available.
-\set txicommandconditionals
-
-% @dircategory CATEGORY -- specify a category of the dir file
-% which this file should belong to. Ignore this in TeX.
-\let\dircategory=\comment
-
-% @defininfoenclose.
-\let\definfoenclose=\comment
-
-
-\message{indexing,}
-% Index generation facilities
-
-% Define \newwrite to be identical to plain tex's \newwrite
-% except not \outer, so it can be used within macros and \if's.
-\edef\newwrite{\makecsname{ptexnewwrite}}
-
-% \newindex {foo} defines an index named foo.
-% It automatically defines \fooindex such that
-% \fooindex ...rest of line... puts an entry in the index foo.
-% It also defines \fooindfile to be the number of the output channel for
-% the file that accumulates this index. The file's extension is foo.
-% The name of an index should be no more than 2 characters long
-% for the sake of vms.
-%
-\def\newindex#1{%
- \iflinks
- \expandafter\newwrite \csname#1indfile\endcsname
- \openout \csname#1indfile\endcsname \jobname.#1 % Open the file
- \fi
- \expandafter\xdef\csname#1index\endcsname{% % Define @#1index
- \noexpand\doindex{#1}}
-}
-
-% @defindex foo == \newindex{foo}
-%
-\def\defindex{\parsearg\newindex}
-
-% Define @defcodeindex, like @defindex except put all entries in @code.
-%
-\def\defcodeindex{\parsearg\newcodeindex}
-%
-\def\newcodeindex#1{%
- \iflinks
- \expandafter\newwrite \csname#1indfile\endcsname
- \openout \csname#1indfile\endcsname \jobname.#1
- \fi
- \expandafter\xdef\csname#1index\endcsname{%
- \noexpand\docodeindex{#1}}%
-}
-
-
-% @synindex foo bar makes index foo feed into index bar.
-% Do this instead of @defindex foo if you don't want it as a separate index.
-%
-% @syncodeindex foo bar similar, but put all entries made for index foo
-% inside @code.
-%
-\def\synindex#1 #2 {\dosynindex\doindex{#1}{#2}}
-\def\syncodeindex#1 #2 {\dosynindex\docodeindex{#1}{#2}}
-
-% #1 is \doindex or \docodeindex, #2 the index getting redefined (foo),
-% #3 the target index (bar).
-\def\dosynindex#1#2#3{%
- % Only do \closeout if we haven't already done it, else we'll end up
- % closing the target index.
- \expandafter \ifx\csname donesynindex#2\endcsname \relax
- % The \closeout helps reduce unnecessary open files; the limit on the
- % Acorn RISC OS is a mere 16 files.
- \expandafter\closeout\csname#2indfile\endcsname
- \expandafter\let\csname donesynindex#2\endcsname = 1
- \fi
- % redefine \fooindfile:
- \expandafter\let\expandafter\temp\expandafter=\csname#3indfile\endcsname
- \expandafter\let\csname#2indfile\endcsname=\temp
- % redefine \fooindex:
- \expandafter\xdef\csname#2index\endcsname{\noexpand#1{#3}}%
-}
-
-% Define \doindex, the driver for all \fooindex macros.
-% Argument #1 is generated by the calling \fooindex macro,
-% and it is "foo", the name of the index.
-
-% \doindex just uses \parsearg; it calls \doind for the actual work.
-% This is because \doind is more useful to call from other macros.
-
-% There is also \dosubind {index}{topic}{subtopic}
-% which makes an entry in a two-level index such as the operation index.
-
-\def\doindex#1{\edef\indexname{#1}\parsearg\singleindexer}
-\def\singleindexer #1{\doind{\indexname}{#1}}
-
-% like the previous two, but they put @code around the argument.
-\def\docodeindex#1{\edef\indexname{#1}\parsearg\singlecodeindexer}
-\def\singlecodeindexer #1{\doind{\indexname}{\code{#1}}}
-
-% Take care of Texinfo commands that can appear in an index entry.
-% Since there are some commands we want to expand, and others we don't,
-% we have to laboriously prevent expansion for those that we don't.
-%
-\def\indexdummies{%
- \escapechar = `\\ % use backslash in output files.
- \def\@{@}% change to @@ when we switch to @ as escape char in index files.
- \def\ {\realbackslash\space }%
- %
- % Need these unexpandable (because we define \tt as a dummy)
- % definitions when @{ or @} appear in index entry text. Also, more
- % complicated, when \tex is in effect and \{ is a \delimiter again.
- % We can't use \lbracecmd and \rbracecmd because texindex assumes
- % braces and backslashes are used only as delimiters. Perhaps we
- % should define @lbrace and @rbrace commands a la @comma.
- \def\{{{\tt\char123}}%
- \def\}{{\tt\char125}}%
- %
- % I don't entirely understand this, but when an index entry is
- % generated from a macro call, the \endinput which \scanmacro inserts
- % causes processing to be prematurely terminated. This is,
- % apparently, because \indexsorttmp is fully expanded, and \endinput
- % is an expandable command. The redefinition below makes \endinput
- % disappear altogether for that purpose -- although logging shows that
- % processing continues to some further point. On the other hand, it
- % seems \endinput does not hurt in the printed index arg, since that
- % is still getting written without apparent harm.
- %
- % Sample source (mac-idx3.tex, reported by Graham Percival to
- % help-texinfo, 22may06):
- % @macro funindex {WORD}
- % @findex xyz
- % @end macro
- % ...
- % @funindex commtest
- %
- % The above is not enough to reproduce the bug, but it gives the flavor.
- %
- % Sample whatsit resulting:
- % .@write3{\entry{xyz}{@folio }{@code {xyz@endinput }}}
- %
- % So:
- \let\endinput = \empty
- %
- % Do the redefinitions.
- \commondummies
-}
-
-% For the aux and toc files, @ is the escape character. So we want to
-% redefine everything using @ as the escape character (instead of
-% \realbackslash, still used for index files). When everything uses @,
-% this will be simpler.
-%
-\def\atdummies{%
- \def\@{@@}%
- \def\ {@ }%
- \let\{ = \lbraceatcmd
- \let\} = \rbraceatcmd
- %
- % Do the redefinitions.
- \commondummies
- \otherbackslash
-}
-
-% Called from \indexdummies and \atdummies.
-%
-\def\commondummies{%
- %
- % \definedummyword defines \#1 as \string\#1\space, thus effectively
- % preventing its expansion. This is used only for control words,
- % not control letters, because the \space would be incorrect for
- % control characters, but is needed to separate the control word
- % from whatever follows.
- %
- % For control letters, we have \definedummyletter, which omits the
- % space.
- %
- % These can be used both for control words that take an argument and
- % those that do not. If it is followed by {arg} in the input, then
- % that will dutifully get written to the index (or wherever).
- %
- \def\definedummyword ##1{\def##1{\string##1\space}}%
- \def\definedummyletter##1{\def##1{\string##1}}%
- \let\definedummyaccent\definedummyletter
- %
- \commondummiesnofonts
- %
- \definedummyletter\_%
- \definedummyletter\-%
- %
- % Non-English letters.
- \definedummyword\AA
- \definedummyword\AE
- \definedummyword\DH
- \definedummyword\L
- \definedummyword\O
- \definedummyword\OE
- \definedummyword\TH
- \definedummyword\aa
- \definedummyword\ae
- \definedummyword\dh
- \definedummyword\exclamdown
- \definedummyword\l
- \definedummyword\o
- \definedummyword\oe
- \definedummyword\ordf
- \definedummyword\ordm
- \definedummyword\questiondown
- \definedummyword\ss
- \definedummyword\th
- %
- % Although these internal commands shouldn't show up, sometimes they do.
- \definedummyword\bf
- \definedummyword\gtr
- \definedummyword\hat
- \definedummyword\less
- \definedummyword\sf
- \definedummyword\sl
- \definedummyword\tclose
- \definedummyword\tt
- %
- \definedummyword\LaTeX
- \definedummyword\TeX
- %
- % Assorted special characters.
- \definedummyword\arrow
- \definedummyword\bullet
- \definedummyword\comma
- \definedummyword\copyright
- \definedummyword\registeredsymbol
- \definedummyword\dots
- \definedummyword\enddots
- \definedummyword\entrybreak
- \definedummyword\equiv
- \definedummyword\error
- \definedummyword\euro
- \definedummyword\expansion
- \definedummyword\geq
- \definedummyword\guillemetleft
- \definedummyword\guillemetright
- \definedummyword\guilsinglleft
- \definedummyword\guilsinglright
- \definedummyword\lbracechar
- \definedummyword\leq
- \definedummyword\minus
- \definedummyword\ogonek
- \definedummyword\pounds
- \definedummyword\point
- \definedummyword\print
- \definedummyword\quotedblbase
- \definedummyword\quotedblleft
- \definedummyword\quotedblright
- \definedummyword\quoteleft
- \definedummyword\quoteright
- \definedummyword\quotesinglbase
- \definedummyword\rbracechar
- \definedummyword\result
- \definedummyword\textdegree
- %
- % We want to disable all macros so that they are not expanded by \write.
- \macrolist
- %
- \normalturnoffactive
- %
- % Handle some cases of @value -- where it does not contain any
- % (non-fully-expandable) commands.
- \makevalueexpandable
-}
-
-% \commondummiesnofonts: common to \commondummies and \indexnofonts.
-%
-\def\commondummiesnofonts{%
- % Control letters and accents.
- \definedummyletter\!%
- \definedummyaccent\"%
- \definedummyaccent\'%
- \definedummyletter\*%
- \definedummyaccent\,%
- \definedummyletter\.%
- \definedummyletter\/%
- \definedummyletter\:%
- \definedummyaccent\=%
- \definedummyletter\?%
- \definedummyaccent\^%
- \definedummyaccent\`%
- \definedummyaccent\~%
- \definedummyword\u
- \definedummyword\v
- \definedummyword\H
- \definedummyword\dotaccent
- \definedummyword\ogonek
- \definedummyword\ringaccent
- \definedummyword\tieaccent
- \definedummyword\ubaraccent
- \definedummyword\udotaccent
- \definedummyword\dotless
- %
- % Texinfo font commands.
- \definedummyword\b
- \definedummyword\i
- \definedummyword\r
- \definedummyword\sansserif
- \definedummyword\sc
- \definedummyword\slanted
- \definedummyword\t
- %
- % Commands that take arguments.
- \definedummyword\abbr
- \definedummyword\acronym
- \definedummyword\anchor
- \definedummyword\cite
- \definedummyword\code
- \definedummyword\command
- \definedummyword\dfn
- \definedummyword\dmn
- \definedummyword\email
- \definedummyword\emph
- \definedummyword\env
- \definedummyword\file
- \definedummyword\image
- \definedummyword\indicateurl
- \definedummyword\inforef
- \definedummyword\kbd
- \definedummyword\key
- \definedummyword\math
- \definedummyword\option
- \definedummyword\pxref
- \definedummyword\ref
- \definedummyword\samp
- \definedummyword\strong
- \definedummyword\tie
- \definedummyword\uref
- \definedummyword\url
- \definedummyword\var
- \definedummyword\verb
- \definedummyword\w
- \definedummyword\xref
-}
-
-% \indexnofonts is used when outputting the strings to sort the index
-% by, and when constructing control sequence names. It eliminates all
-% control sequences and just writes whatever the best ASCII sort string
-% would be for a given command (usually its argument).
-%
-\def\indexnofonts{%
- % Accent commands should become @asis.
- \def\definedummyaccent##1{\let##1\asis}%
- % We can just ignore other control letters.
- \def\definedummyletter##1{\let##1\empty}%
- % All control words become @asis by default; overrides below.
- \let\definedummyword\definedummyaccent
- %
- \commondummiesnofonts
- %
- % Don't no-op \tt, since it isn't a user-level command
- % and is used in the definitions of the active chars like <, >, |, etc.
- % Likewise with the other plain tex font commands.
- %\let\tt=\asis
- %
- \def\ { }%
- \def\@{@}%
- \def\_{\normalunderscore}%
- \def\-{}% @- shouldn't affect sorting
- %
- % Unfortunately, texindex is not prepared to handle braces in the
- % content at all. So for index sorting, we map @{ and @} to strings
- % starting with |, since that ASCII character is between ASCII { and }.
- \def\{{|a}%
- \def\lbracechar{|a}%
- %
- \def\}{|b}%
- \def\rbracechar{|b}%
- %
- % Non-English letters.
- \def\AA{AA}%
- \def\AE{AE}%
- \def\DH{DZZ}%
- \def\L{L}%
- \def\OE{OE}%
- \def\O{O}%
- \def\TH{ZZZ}%
- \def\aa{aa}%
- \def\ae{ae}%
- \def\dh{dzz}%
- \def\exclamdown{!}%
- \def\l{l}%
- \def\oe{oe}%
- \def\ordf{a}%
- \def\ordm{o}%
- \def\o{o}%
- \def\questiondown{?}%
- \def\ss{ss}%
- \def\th{zzz}%
- %
- \def\LaTeX{LaTeX}%
- \def\TeX{TeX}%
- %
- % Assorted special characters.
- % (The following {} will end up in the sort string, but that's ok.)
- \def\arrow{->}%
- \def\bullet{bullet}%
- \def\comma{,}%
- \def\copyright{copyright}%
- \def\dots{...}%
- \def\enddots{...}%
- \def\equiv{==}%
- \def\error{error}%
- \def\euro{euro}%
- \def\expansion{==>}%
- \def\geq{>=}%
- \def\guillemetleft{<<}%
- \def\guillemetright{>>}%
- \def\guilsinglleft{<}%
- \def\guilsinglright{>}%
- \def\leq{<=}%
- \def\minus{-}%
- \def\point{.}%
- \def\pounds{pounds}%
- \def\print{-|}%
- \def\quotedblbase{"}%
- \def\quotedblleft{"}%
- \def\quotedblright{"}%
- \def\quoteleft{`}%
- \def\quoteright{'}%
- \def\quotesinglbase{,}%
- \def\registeredsymbol{R}%
- \def\result{=>}%
- \def\textdegree{o}%
- %
- \expandafter\ifx\csname SETtxiindexlquoteignore\endcsname\relax
- \else \indexlquoteignore \fi
- %
- % We need to get rid of all macros, leaving only the arguments (if present).
- % Of course this is not nearly correct, but it is the best we can do for now.
- % makeinfo does not expand macros in the argument to @deffn, which ends up
- % writing an index entry, and texindex isn't prepared for an index sort entry
- % that starts with \.
- %
- % Since macro invocations are followed by braces, we can just redefine them
- % to take a single TeX argument. The case of a macro invocation that
- % goes to end-of-line is not handled.
- %
- \macrolist
-}
-
-% Undocumented (for FSFS 2nd ed.): @set txiindexlquoteignore makes us
-% ignore left quotes in the sort term.
-{\catcode`\`=\active
- \gdef\indexlquoteignore{\let`=\empty}}
-
-\let\indexbackslash=0 %overridden during \printindex.
-\let\SETmarginindex=\relax % put index entries in margin (undocumented)?
-
-% Most index entries go through here, but \dosubind is the general case.
-% #1 is the index name, #2 is the entry text.
-\def\doind#1#2{\dosubind{#1}{#2}{}}
-
-% Workhorse for all \fooindexes.
-% #1 is name of index, #2 is stuff to put there, #3 is subentry --
-% empty if called from \doind, as we usually are (the main exception
-% is with most defuns, which call us directly).
-%
-\def\dosubind#1#2#3{%
- \iflinks
- {%
- % Store the main index entry text (including the third arg).
- \toks0 = {#2}%
- % If third arg is present, precede it with a space.
- \def\thirdarg{#3}%
- \ifx\thirdarg\empty \else
- \toks0 = \expandafter{\the\toks0 \space #3}%
- \fi
- %
- \edef\writeto{\csname#1indfile\endcsname}%
- %
- \safewhatsit\dosubindwrite
- }%
- \fi
-}
-
-% Write the entry in \toks0 to the index file:
-%
-\def\dosubindwrite{%
- % Put the index entry in the margin if desired.
- \ifx\SETmarginindex\relax\else
- \insert\margin{\hbox{\vrule height8pt depth3pt width0pt \the\toks0}}%
- \fi
- %
- % Remember, we are within a group.
- \indexdummies % Must do this here, since \bf, etc expand at this stage
- \def\backslashcurfont{\indexbackslash}% \indexbackslash isn't defined now
- % so it will be output as is; and it will print as backslash.
- %
- % Process the index entry with all font commands turned off, to
- % get the string to sort by.
- {\indexnofonts
- \edef\temp{\the\toks0}% need full expansion
- \xdef\indexsorttmp{\temp}%
- }%
- %
- % Set up the complete index entry, with both the sort key and
- % the original text, including any font commands. We write
- % three arguments to \entry to the .?? file (four in the
- % subentry case), texindex reduces to two when writing the .??s
- % sorted result.
- \edef\temp{%
- \write\writeto{%
- \string\entry{\indexsorttmp}{\noexpand\folio}{\the\toks0}}%
- }%
- \temp
-}
-
-% Take care of unwanted page breaks/skips around a whatsit:
-%
-% If a skip is the last thing on the list now, preserve it
-% by backing up by \lastskip, doing the \write, then inserting
-% the skip again. Otherwise, the whatsit generated by the
-% \write or \pdfdest will make \lastskip zero. The result is that
-% sequences like this:
-% @end defun
-% @tindex whatever
-% @defun ...
-% will have extra space inserted, because the \medbreak in the
-% start of the @defun won't see the skip inserted by the @end of
-% the previous defun.
-%
-% But don't do any of this if we're not in vertical mode. We
-% don't want to do a \vskip and prematurely end a paragraph.
-%
-% Avoid page breaks due to these extra skips, too.
-%
-% But wait, there is a catch there:
-% We'll have to check whether \lastskip is zero skip. \ifdim is not
-% sufficient for this purpose, as it ignores stretch and shrink parts
-% of the skip. The only way seems to be to check the textual
-% representation of the skip.
-%
-% The following is almost like \def\zeroskipmacro{0.0pt} except that
-% the ``p'' and ``t'' characters have catcode \other, not 11 (letter).
-%
-\edef\zeroskipmacro{\expandafter\the\csname z@skip\endcsname}
-%
-\newskip\whatsitskip
-\newcount\whatsitpenalty
-%
-% ..., ready, GO:
-%
-\def\safewhatsit#1{\ifhmode
- #1%
- \else
- % \lastskip and \lastpenalty cannot both be nonzero simultaneously.
- \whatsitskip = \lastskip
- \edef\lastskipmacro{\the\lastskip}%
- \whatsitpenalty = \lastpenalty
- %
- % If \lastskip is nonzero, that means the last item was a
- % skip. And since a skip is discardable, that means this
- % -\whatsitskip glue we're inserting is preceded by a
- % non-discardable item, therefore it is not a potential
- % breakpoint, therefore no \nobreak needed.
- \ifx\lastskipmacro\zeroskipmacro
- \else
- \vskip-\whatsitskip
- \fi
- %
- #1%
- %
- \ifx\lastskipmacro\zeroskipmacro
- % If \lastskip was zero, perhaps the last item was a penalty, and
- % perhaps it was >=10000, e.g., a \nobreak. In that case, we want
- % to re-insert the same penalty (values >10000 are used for various
- % signals); since we just inserted a non-discardable item, any
- % following glue (such as a \parskip) would be a breakpoint. For example:
- % @deffn deffn-whatever
- % @vindex index-whatever
- % Description.
- % would allow a break between the index-whatever whatsit
- % and the "Description." paragraph.
- \ifnum\whatsitpenalty>9999 \penalty\whatsitpenalty \fi
- \else
- % On the other hand, if we had a nonzero \lastskip,
- % this make-up glue would be preceded by a non-discardable item
- % (the whatsit from the \write), so we must insert a \nobreak.
- \nobreak\vskip\whatsitskip
- \fi
-\fi}
-
-% The index entry written in the file actually looks like
-% \entry {sortstring}{page}{topic}
-% or
-% \entry {sortstring}{page}{topic}{subtopic}
-% The texindex program reads in these files and writes files
-% containing these kinds of lines:
-% \initial {c}
-% before the first topic whose initial is c
-% \entry {topic}{pagelist}
-% for a topic that is used without subtopics
-% \primary {topic}
-% for the beginning of a topic that is used with subtopics
-% \secondary {subtopic}{pagelist}
-% for each subtopic.
-
-% Define the user-accessible indexing commands
-% @findex, @vindex, @kindex, @cindex.
-
-\def\findex {\fnindex}
-\def\kindex {\kyindex}
-\def\cindex {\cpindex}
-\def\vindex {\vrindex}
-\def\tindex {\tpindex}
-\def\pindex {\pgindex}
-
-\def\cindexsub {\begingroup\obeylines\cindexsub}
-{\obeylines %
-\gdef\cindexsub "#1" #2^^M{\endgroup %
-\dosubind{cp}{#2}{#1}}}
-
-% Define the macros used in formatting output of the sorted index material.
-
-% @printindex causes a particular index (the ??s file) to get printed.
-% It does not print any chapter heading (usually an @unnumbered).
-%
-\parseargdef\printindex{\begingroup
- \dobreak \chapheadingskip{10000}%
- %
- \smallfonts \rm
- \tolerance = 9500
- \plainfrenchspacing
- \everypar = {}% don't want the \kern\-parindent from indentation suppression.
- %
- % See if the index file exists and is nonempty.
- % Change catcode of @ here so that if the index file contains
- % \initial {@}
- % as its first line, TeX doesn't complain about mismatched braces
- % (because it thinks @} is a control sequence).
- \catcode`\@ = 11
- \openin 1 \jobname.#1s
- \ifeof 1
- % \enddoublecolumns gets confused if there is no text in the index,
- % and it loses the chapter title and the aux file entries for the
- % index. The easiest way to prevent this problem is to make sure
- % there is some text.
- \putwordIndexNonexistent
- \else
- %
- % If the index file exists but is empty, then \openin leaves \ifeof
- % false. We have to make TeX try to read something from the file, so
- % it can discover if there is anything in it.
- \read 1 to \temp
- \ifeof 1
- \putwordIndexIsEmpty
- \else
- % Index files are almost Texinfo source, but we use \ as the escape
- % character. It would be better to use @, but that's too big a change
- % to make right now.
- \def\indexbackslash{\backslashcurfont}%
- \catcode`\\ = 0
- \escapechar = `\\
- \begindoublecolumns
- \input \jobname.#1s
- \enddoublecolumns
- \fi
- \fi
- \closein 1
-\endgroup}
-
-% These macros are used by the sorted index file itself.
-% Change them to control the appearance of the index.
-
-\def\initial#1{{%
- % Some minor font changes for the special characters.
- \let\tentt=\sectt \let\tt=\sectt \let\sf=\sectt
- %
- % Remove any glue we may have, we'll be inserting our own.
- \removelastskip
- %
- % We like breaks before the index initials, so insert a bonus.
- \nobreak
- \vskip 0pt plus 3\baselineskip
- \penalty 0
- \vskip 0pt plus -3\baselineskip
- %
- % Typeset the initial. Making this add up to a whole number of
- % baselineskips increases the chance of the dots lining up from column
- % to column. It still won't often be perfect, because of the stretch
- % we need before each entry, but it's better.
- %
- % No shrink because it confuses \balancecolumns.
- \vskip 1.67\baselineskip plus .5\baselineskip
- \leftline{\secbf #1}%
- % Do our best not to break after the initial.
- \nobreak
- \vskip .33\baselineskip plus .1\baselineskip
-}}
-
-% \entry typesets a paragraph consisting of the text (#1), dot leaders, and
-% then page number (#2) flushed to the right margin. It is used for index
-% and table of contents entries. The paragraph is indented by \leftskip.
-%
-% A straightforward implementation would start like this:
-% \def\entry#1#2{...
-% But this freezes the catcodes in the argument, and can cause problems to
-% @code, which sets - active. This problem was fixed by a kludge---
-% ``-'' was active throughout whole index, but this isn't really right.
-% The right solution is to prevent \entry from swallowing the whole text.
-% --kasal, 21nov03
-\def\entry{%
- \begingroup
- %
- % Start a new paragraph if necessary, so our assignments below can't
- % affect previous text.
- \par
- %
- % Do not fill out the last line with white space.
- \parfillskip = 0in
- %
- % No extra space above this paragraph.
- \parskip = 0in
- %
- % Do not prefer a separate line ending with a hyphen to fewer lines.
- \finalhyphendemerits = 0
- %
- % \hangindent is only relevant when the entry text and page number
- % don't both fit on one line. In that case, bob suggests starting the
- % dots pretty far over on the line. Unfortunately, a large
- % indentation looks wrong when the entry text itself is broken across
- % lines. So we use a small indentation and put up with long leaders.
- %
- % \hangafter is reset to 1 (which is the value we want) at the start
- % of each paragraph, so we need not do anything with that.
- \hangindent = 2em
- %
- % When the entry text needs to be broken, just fill out the first line
- % with blank space.
- \rightskip = 0pt plus1fil
- %
- % A bit of stretch before each entry for the benefit of balancing
- % columns.
- \vskip 0pt plus1pt
- %
- % When reading the text of entry, convert explicit line breaks
- % from @* into spaces. The user might give these in long section
- % titles, for instance.
- \def\*{\unskip\space\ignorespaces}%
- \def\entrybreak{\hfil\break}%
- %
- % Swallow the left brace of the text (first parameter):
- \afterassignment\doentry
- \let\temp =
-}
-\def\entrybreak{\unskip\space\ignorespaces}%
-\def\doentry{%
- \bgroup % Instead of the swallowed brace.
- \noindent
- \aftergroup\finishentry
- % And now comes the text of the entry.
-}
-\def\finishentry#1{%
- % #1 is the page number.
- %
- % The following is kludged to not output a line of dots in the index if
- % there are no page numbers. The next person who breaks this will be
- % cursed by a Unix daemon.
- \setbox\boxA = \hbox{#1}%
- \ifdim\wd\boxA = 0pt
- \ %
- \else
- %
- % If we must, put the page number on a line of its own, and fill out
- % this line with blank space. (The \hfil is overwhelmed with the
- % fill leaders glue in \indexdotfill if the page number does fit.)
- \hfil\penalty50
- \null\nobreak\indexdotfill % Have leaders before the page number.
- %
- % The `\ ' here is removed by the implicit \unskip that TeX does as
- % part of (the primitive) \par. Without it, a spurious underfull
- % \hbox ensues.
- \ifpdf
- \pdfgettoks#1.%
- \ \the\toksA
- \else
- \ #1%
- \fi
- \fi
- \par
- \endgroup
-}
-
-% Like plain.tex's \dotfill, except uses up at least 1 em.
-\def\indexdotfill{\cleaders
- \hbox{$\mathsurround=0pt \mkern1.5mu.\mkern1.5mu$}\hskip 1em plus 1fill}
-
-\def\primary #1{\line{#1\hfil}}
-
-\newskip\secondaryindent \secondaryindent=0.5cm
-\def\secondary#1#2{{%
- \parfillskip=0in
- \parskip=0in
- \hangindent=1in
- \hangafter=1
- \noindent\hskip\secondaryindent\hbox{#1}\indexdotfill
- \ifpdf
- \pdfgettoks#2.\ \the\toksA % The page number ends the paragraph.
- \else
- #2
- \fi
- \par
-}}
-
-% Define two-column mode, which we use to typeset indexes.
-% Adapted from the TeXbook, page 416, which is to say,
-% the manmac.tex format used to print the TeXbook itself.
-\catcode`\@=11
-
-\newbox\partialpage
-\newdimen\doublecolumnhsize
-
-\def\begindoublecolumns{\begingroup % ended by \enddoublecolumns
- % Grab any single-column material above us.
- \output = {%
- %
- % Here is a possibility not foreseen in manmac: if we accumulate a
- % whole lot of material, we might end up calling this \output
- % routine twice in a row (see the doublecol-lose test, which is
- % essentially a couple of indexes with @setchapternewpage off). In
- % that case we just ship out what is in \partialpage with the normal
- % output routine. Generally, \partialpage will be empty when this
- % runs and this will be a no-op. See the indexspread.tex test case.
- \ifvoid\partialpage \else
- \onepageout{\pagecontents\partialpage}%
- \fi
- %
- \global\setbox\partialpage = \vbox{%
- % Unvbox the main output page.
- \unvbox\PAGE
- \kern-\topskip \kern\baselineskip
- }%
- }%
- \eject % run that output routine to set \partialpage
- %
- % Use the double-column output routine for subsequent pages.
- \output = {\doublecolumnout}%
- %
- % Change the page size parameters. We could do this once outside this
- % routine, in each of @smallbook, @afourpaper, and the default 8.5x11
- % format, but then we repeat the same computation. Repeating a couple
- % of assignments once per index is clearly meaningless for the
- % execution time, so we may as well do it in one place.
- %
- % First we halve the line length, less a little for the gutter between
- % the columns. We compute the gutter based on the line length, so it
- % changes automatically with the paper format. The magic constant
- % below is chosen so that the gutter has the same value (well, +-<1pt)
- % as it did when we hard-coded it.
- %
- % We put the result in a separate register, \doublecolumhsize, so we
- % can restore it in \pagesofar, after \hsize itself has (potentially)
- % been clobbered.
- %
- \doublecolumnhsize = \hsize
- \advance\doublecolumnhsize by -.04154\hsize
- \divide\doublecolumnhsize by 2
- \hsize = \doublecolumnhsize
- %
- % Double the \vsize as well. (We don't need a separate register here,
- % since nobody clobbers \vsize.)
- \vsize = 2\vsize
-}
-
-% The double-column output routine for all double-column pages except
-% the last.
-%
-\def\doublecolumnout{%
- \splittopskip=\topskip \splitmaxdepth=\maxdepth
- % Get the available space for the double columns -- the normal
- % (undoubled) page height minus any material left over from the
- % previous page.
- \dimen@ = \vsize
- \divide\dimen@ by 2
- \advance\dimen@ by -\ht\partialpage
- %
- % box0 will be the left-hand column, box2 the right.
- \setbox0=\vsplit255 to\dimen@ \setbox2=\vsplit255 to\dimen@
- \onepageout\pagesofar
- \unvbox255
- \penalty\outputpenalty
-}
-%
-% Re-output the contents of the output page -- any previous material,
-% followed by the two boxes we just split, in box0 and box2.
-\def\pagesofar{%
- \unvbox\partialpage
- %
- \hsize = \doublecolumnhsize
- \wd0=\hsize \wd2=\hsize
- \hbox to\pagewidth{\box0\hfil\box2}%
-}
-%
-% All done with double columns.
-\def\enddoublecolumns{%
- % The following penalty ensures that the page builder is exercised
- % _before_ we change the output routine. This is necessary in the
- % following situation:
- %
- % The last section of the index consists only of a single entry.
- % Before this section, \pagetotal is less than \pagegoal, so no
- % break occurs before the last section starts. However, the last
- % section, consisting of \initial and the single \entry, does not
- % fit on the page and has to be broken off. Without the following
- % penalty the page builder will not be exercised until \eject
- % below, and by that time we'll already have changed the output
- % routine to the \balancecolumns version, so the next-to-last
- % double-column page will be processed with \balancecolumns, which
- % is wrong: The two columns will go to the main vertical list, with
- % the broken-off section in the recent contributions. As soon as
- % the output routine finishes, TeX starts reconsidering the page
- % break. The two columns and the broken-off section both fit on the
- % page, because the two columns now take up only half of the page
- % goal. When TeX sees \eject from below which follows the final
- % section, it invokes the new output routine that we've set after
- % \balancecolumns below; \onepageout will try to fit the two columns
- % and the final section into the vbox of \pageheight (see
- % \pagebody), causing an overfull box.
- %
- % Note that glue won't work here, because glue does not exercise the
- % page builder, unlike penalties (see The TeXbook, pp. 280-281).
- \penalty0
- %
- \output = {%
- % Split the last of the double-column material. Leave it on the
- % current page, no automatic page break.
- \balancecolumns
- %
- % If we end up splitting too much material for the current page,
- % though, there will be another page break right after this \output
- % invocation ends. Having called \balancecolumns once, we do not
- % want to call it again. Therefore, reset \output to its normal
- % definition right away. (We hope \balancecolumns will never be
- % called on to balance too much material, but if it is, this makes
- % the output somewhat more palatable.)
- \global\output = {\onepageout{\pagecontents\PAGE}}%
- }%
- \eject
- \endgroup % started in \begindoublecolumns
- %
- % \pagegoal was set to the doubled \vsize above, since we restarted
- % the current page. We're now back to normal single-column
- % typesetting, so reset \pagegoal to the normal \vsize (after the
- % \endgroup where \vsize got restored).
- \pagegoal = \vsize
-}
-%
-% Called at the end of the double column material.
-\def\balancecolumns{%
- \setbox0 = \vbox{\unvbox255}% like \box255 but more efficient, see p.120.
- \dimen@ = \ht0
- \advance\dimen@ by \topskip
- \advance\dimen@ by-\baselineskip
- \divide\dimen@ by 2 % target to split to
- %debug\message{final 2-column material height=\the\ht0, target=\the\dimen@.}%
- \splittopskip = \topskip
- % Loop until we get a decent breakpoint.
- {%
- \vbadness = 10000
- \loop
- \global\setbox3 = \copy0
- \global\setbox1 = \vsplit3 to \dimen@
- \ifdim\ht3>\dimen@
- \global\advance\dimen@ by 1pt
- \repeat
- }%
- %debug\message{split to \the\dimen@, column heights: \the\ht1, \the\ht3.}%
- \setbox0=\vbox to\dimen@{\unvbox1}%
- \setbox2=\vbox to\dimen@{\unvbox3}%
- %
- \pagesofar
-}
-\catcode`\@ = \other
-
-
-\message{sectioning,}
-% Chapters, sections, etc.
-
-% Let's start with @part.
-\outer\parseargdef\part{\partzzz{#1}}
-\def\partzzz#1{%
- \chapoddpage
- \null
- \vskip.3\vsize % move it down on the page a bit
- \begingroup
- \noindent \titlefonts\rmisbold #1\par % the text
- \let\lastnode=\empty % no node to associate with
- \writetocentry{part}{#1}{}% but put it in the toc
- \headingsoff % no headline or footline on the part page
- \chapoddpage
- \endgroup
-}
-
-% \unnumberedno is an oxymoron. But we count the unnumbered
-% sections so that we can refer to them unambiguously in the pdf
-% outlines by their "section number". We avoid collisions with chapter
-% numbers by starting them at 10000. (If a document ever has 10000
-% chapters, we're in trouble anyway, I'm sure.)
-\newcount\unnumberedno \unnumberedno = 10000
-\newcount\chapno
-\newcount\secno \secno=0
-\newcount\subsecno \subsecno=0
-\newcount\subsubsecno \subsubsecno=0
-
-% This counter is funny since it counts through charcodes of letters A, B, ...
-\newcount\appendixno \appendixno = `\@
-%
-% \def\appendixletter{\char\the\appendixno}
-% We do the following ugly conditional instead of the above simple
-% construct for the sake of pdftex, which needs the actual
-% letter in the expansion, not just typeset.
-%
-\def\appendixletter{%
- \ifnum\appendixno=`A A%
- \else\ifnum\appendixno=`B B%
- \else\ifnum\appendixno=`C C%
- \else\ifnum\appendixno=`D D%
- \else\ifnum\appendixno=`E E%
- \else\ifnum\appendixno=`F F%
- \else\ifnum\appendixno=`G G%
- \else\ifnum\appendixno=`H H%
- \else\ifnum\appendixno=`I I%
- \else\ifnum\appendixno=`J J%
- \else\ifnum\appendixno=`K K%
- \else\ifnum\appendixno=`L L%
- \else\ifnum\appendixno=`M M%
- \else\ifnum\appendixno=`N N%
- \else\ifnum\appendixno=`O O%
- \else\ifnum\appendixno=`P P%
- \else\ifnum\appendixno=`Q Q%
- \else\ifnum\appendixno=`R R%
- \else\ifnum\appendixno=`S S%
- \else\ifnum\appendixno=`T T%
- \else\ifnum\appendixno=`U U%
- \else\ifnum\appendixno=`V V%
- \else\ifnum\appendixno=`W W%
- \else\ifnum\appendixno=`X X%
- \else\ifnum\appendixno=`Y Y%
- \else\ifnum\appendixno=`Z Z%
- % The \the is necessary, despite appearances, because \appendixletter is
- % expanded while writing the .toc file. \char\appendixno is not
- % expandable, thus it is written literally, thus all appendixes come out
- % with the same letter (or @) in the toc without it.
- \else\char\the\appendixno
- \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
- \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi}
-
-% Each @chapter defines these (using marks) as the number+name, number
-% and name of the chapter. Page headings and footings can use
-% these. @section does likewise.
-\def\thischapter{}
-\def\thischapternum{}
-\def\thischaptername{}
-\def\thissection{}
-\def\thissectionnum{}
-\def\thissectionname{}
-
-\newcount\absseclevel % used to calculate proper heading level
-\newcount\secbase\secbase=0 % @raisesections/@lowersections modify this count
-
-% @raisesections: treat @section as chapter, @subsection as section, etc.
-\def\raisesections{\global\advance\secbase by -1}
-\let\up=\raisesections % original BFox name
-
-% @lowersections: treat @chapter as section, @section as subsection, etc.
-\def\lowersections{\global\advance\secbase by 1}
-\let\down=\lowersections % original BFox name
-
-% we only have subsub.
-\chardef\maxseclevel = 3
-%
-% A numbered section within an unnumbered changes to unnumbered too.
-% To achieve this, remember the "biggest" unnum. sec. we are currently in:
-\chardef\unnlevel = \maxseclevel
-%
-% Trace whether the current chapter is an appendix or not:
-% \chapheadtype is "N" or "A", unnumbered chapters are ignored.
-\def\chapheadtype{N}
-
-% Choose a heading macro
-% #1 is heading type
-% #2 is heading level
-% #3 is text for heading
-\def\genhead#1#2#3{%
- % Compute the abs. sec. level:
- \absseclevel=#2
- \advance\absseclevel by \secbase
- % Make sure \absseclevel doesn't fall outside the range:
- \ifnum \absseclevel < 0
- \absseclevel = 0
- \else
- \ifnum \absseclevel > 3
- \absseclevel = 3
- \fi
- \fi
- % The heading type:
- \def\headtype{#1}%
- \if \headtype U%
- \ifnum \absseclevel < \unnlevel
- \chardef\unnlevel = \absseclevel
- \fi
- \else
- % Check for appendix sections:
- \ifnum \absseclevel = 0
- \edef\chapheadtype{\headtype}%
- \else
- \if \headtype A\if \chapheadtype N%
- \errmessage{@appendix... within a non-appendix chapter}%
- \fi\fi
- \fi
- % Check for numbered within unnumbered:
- \ifnum \absseclevel > \unnlevel
- \def\headtype{U}%
- \else
- \chardef\unnlevel = 3
- \fi
- \fi
- % Now print the heading:
- \if \headtype U%
- \ifcase\absseclevel
- \unnumberedzzz{#3}%
- \or \unnumberedseczzz{#3}%
- \or \unnumberedsubseczzz{#3}%
- \or \unnumberedsubsubseczzz{#3}%
- \fi
- \else
- \if \headtype A%
- \ifcase\absseclevel
- \appendixzzz{#3}%
- \or \appendixsectionzzz{#3}%
- \or \appendixsubseczzz{#3}%
- \or \appendixsubsubseczzz{#3}%
- \fi
- \else
- \ifcase\absseclevel
- \chapterzzz{#3}%
- \or \seczzz{#3}%
- \or \numberedsubseczzz{#3}%
- \or \numberedsubsubseczzz{#3}%
- \fi
- \fi
- \fi
- \suppressfirstparagraphindent
-}
-
-% an interface:
-\def\numhead{\genhead N}
-\def\apphead{\genhead A}
-\def\unnmhead{\genhead U}
-
-% @chapter, @appendix, @unnumbered. Increment top-level counter, reset
-% all lower-level sectioning counters to zero.
-%
-% Also set \chaplevelprefix, which we prepend to @float sequence numbers
-% (e.g., figures), q.v. By default (before any chapter), that is empty.
-\let\chaplevelprefix = \empty
-%
-\outer\parseargdef\chapter{\numhead0{#1}} % normally numhead0 calls chapterzzz
-\def\chapterzzz#1{%
- % section resetting is \global in case the chapter is in a group, such
- % as an @include file.
- \global\secno=0 \global\subsecno=0 \global\subsubsecno=0
- \global\advance\chapno by 1
- %
- % Used for \float.
- \gdef\chaplevelprefix{\the\chapno.}%
- \resetallfloatnos
- %
- % \putwordChapter can contain complex things in translations.
- \toks0=\expandafter{\putwordChapter}%
- \message{\the\toks0 \space \the\chapno}%
- %
- % Write the actual heading.
- \chapmacro{#1}{Ynumbered}{\the\chapno}%
- %
- % So @section and the like are numbered underneath this chapter.
- \global\let\section = \numberedsec
- \global\let\subsection = \numberedsubsec
- \global\let\subsubsection = \numberedsubsubsec
-}
-
-\outer\parseargdef\appendix{\apphead0{#1}} % normally calls appendixzzz
-%
-\def\appendixzzz#1{%
- \global\secno=0 \global\subsecno=0 \global\subsubsecno=0
- \global\advance\appendixno by 1
- \gdef\chaplevelprefix{\appendixletter.}%
- \resetallfloatnos
- %
- % \putwordAppendix can contain complex things in translations.
- \toks0=\expandafter{\putwordAppendix}%
- \message{\the\toks0 \space \appendixletter}%
- %
- \chapmacro{#1}{Yappendix}{\appendixletter}%
- %
- \global\let\section = \appendixsec
- \global\let\subsection = \appendixsubsec
- \global\let\subsubsection = \appendixsubsubsec
-}
-
-% normally unnmhead0 calls unnumberedzzz:
-\outer\parseargdef\unnumbered{\unnmhead0{#1}}
-\def\unnumberedzzz#1{%
- \global\secno=0 \global\subsecno=0 \global\subsubsecno=0
- \global\advance\unnumberedno by 1
- %
- % Since an unnumbered has no number, no prefix for figures.
- \global\let\chaplevelprefix = \empty
- \resetallfloatnos
- %
- % This used to be simply \message{#1}, but TeX fully expands the
- % argument to \message. Therefore, if #1 contained @-commands, TeX
- % expanded them. For example, in `@unnumbered The @cite{Book}', TeX
- % expanded @cite (which turns out to cause errors because \cite is meant
- % to be executed, not expanded).
- %
- % Anyway, we don't want the fully-expanded definition of @cite to appear
- % as a result of the \message, we just want `@cite' itself. We use
- % \the<toks register> to achieve this: TeX expands \the<toks> only once,
- % simply yielding the contents of <toks register>. (We also do this for
- % the toc entries.)
- \toks0 = {#1}%
- \message{(\the\toks0)}%
- %
- \chapmacro{#1}{Ynothing}{\the\unnumberedno}%
- %
- \global\let\section = \unnumberedsec
- \global\let\subsection = \unnumberedsubsec
- \global\let\subsubsection = \unnumberedsubsubsec
-}
-
-% @centerchap is like @unnumbered, but the heading is centered.
-\outer\parseargdef\centerchap{%
- % Well, we could do the following in a group, but that would break
- % an assumption that \chapmacro is called at the outermost level.
- % Thus we are safer this way: --kasal, 24feb04
- \let\centerparametersmaybe = \centerparameters
- \unnmhead0{#1}%
- \let\centerparametersmaybe = \relax
-}
-
-% @top is like @unnumbered.
-\let\top\unnumbered
-
-% Sections.
-%
-\outer\parseargdef\numberedsec{\numhead1{#1}} % normally calls seczzz
-\def\seczzz#1{%
- \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1
- \sectionheading{#1}{sec}{Ynumbered}{\the\chapno.\the\secno}%
-}
-
-% normally calls appendixsectionzzz:
-\outer\parseargdef\appendixsection{\apphead1{#1}}
-\def\appendixsectionzzz#1{%
- \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1
- \sectionheading{#1}{sec}{Yappendix}{\appendixletter.\the\secno}%
-}
-\let\appendixsec\appendixsection
-
-% normally calls unnumberedseczzz:
-\outer\parseargdef\unnumberedsec{\unnmhead1{#1}}
-\def\unnumberedseczzz#1{%
- \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1
- \sectionheading{#1}{sec}{Ynothing}{\the\unnumberedno.\the\secno}%
-}
-
-% Subsections.
-%
-% normally calls numberedsubseczzz:
-\outer\parseargdef\numberedsubsec{\numhead2{#1}}
-\def\numberedsubseczzz#1{%
- \global\subsubsecno=0 \global\advance\subsecno by 1
- \sectionheading{#1}{subsec}{Ynumbered}{\the\chapno.\the\secno.\the\subsecno}%
-}
-
-% normally calls appendixsubseczzz:
-\outer\parseargdef\appendixsubsec{\apphead2{#1}}
-\def\appendixsubseczzz#1{%
- \global\subsubsecno=0 \global\advance\subsecno by 1
- \sectionheading{#1}{subsec}{Yappendix}%
- {\appendixletter.\the\secno.\the\subsecno}%
-}
-
-% normally calls unnumberedsubseczzz:
-\outer\parseargdef\unnumberedsubsec{\unnmhead2{#1}}
-\def\unnumberedsubseczzz#1{%
- \global\subsubsecno=0 \global\advance\subsecno by 1
- \sectionheading{#1}{subsec}{Ynothing}%
- {\the\unnumberedno.\the\secno.\the\subsecno}%
-}
-
-% Subsubsections.
-%
-% normally numberedsubsubseczzz:
-\outer\parseargdef\numberedsubsubsec{\numhead3{#1}}
-\def\numberedsubsubseczzz#1{%
- \global\advance\subsubsecno by 1
- \sectionheading{#1}{subsubsec}{Ynumbered}%
- {\the\chapno.\the\secno.\the\subsecno.\the\subsubsecno}%
-}
-
-% normally appendixsubsubseczzz:
-\outer\parseargdef\appendixsubsubsec{\apphead3{#1}}
-\def\appendixsubsubseczzz#1{%
- \global\advance\subsubsecno by 1
- \sectionheading{#1}{subsubsec}{Yappendix}%
- {\appendixletter.\the\secno.\the\subsecno.\the\subsubsecno}%
-}
-
-% normally unnumberedsubsubseczzz:
-\outer\parseargdef\unnumberedsubsubsec{\unnmhead3{#1}}
-\def\unnumberedsubsubseczzz#1{%
- \global\advance\subsubsecno by 1
- \sectionheading{#1}{subsubsec}{Ynothing}%
- {\the\unnumberedno.\the\secno.\the\subsecno.\the\subsubsecno}%
-}
-
-% These macros control what the section commands do, according
-% to what kind of chapter we are in (ordinary, appendix, or unnumbered).
-% Define them by default for a numbered chapter.
-\let\section = \numberedsec
-\let\subsection = \numberedsubsec
-\let\subsubsection = \numberedsubsubsec
-
-% Define @majorheading, @heading and @subheading
-
-\def\majorheading{%
- {\advance\chapheadingskip by 10pt \chapbreak }%
- \parsearg\chapheadingzzz
-}
-
-\def\chapheading{\chapbreak \parsearg\chapheadingzzz}
-\def\chapheadingzzz#1{%
- \vbox{\chapfonts \raggedtitlesettings #1\par}%
- \nobreak\bigskip \nobreak
- \suppressfirstparagraphindent
-}
-
-% @heading, @subheading, @subsubheading.
-\parseargdef\heading{\sectionheading{#1}{sec}{Yomitfromtoc}{}
- \suppressfirstparagraphindent}
-\parseargdef\subheading{\sectionheading{#1}{subsec}{Yomitfromtoc}{}
- \suppressfirstparagraphindent}
-\parseargdef\subsubheading{\sectionheading{#1}{subsubsec}{Yomitfromtoc}{}
- \suppressfirstparagraphindent}
-
-% These macros generate a chapter, section, etc. heading only
-% (including whitespace, linebreaking, etc. around it),
-% given all the information in convenient, parsed form.
-
-% Args are the skip and penalty (usually negative)
-\def\dobreak#1#2{\par\ifdim\lastskip<#1\removelastskip\penalty#2\vskip#1\fi}
-
-% Parameter controlling skip before chapter headings (if needed)
-\newskip\chapheadingskip
-
-% Define plain chapter starts, and page on/off switching for it.
-\def\chapbreak{\dobreak \chapheadingskip {-4000}}
-\def\chappager{\par\vfill\supereject}
-% Because \domark is called before \chapoddpage, the filler page will
-% get the headings for the next chapter, which is wrong. But we don't
-% care -- we just disable all headings on the filler page.
-\def\chapoddpage{%
- \chappager
- \ifodd\pageno \else
- \begingroup
- \headingsoff
- \null
- \chappager
- \endgroup
- \fi
-}
-
-\def\setchapternewpage #1 {\csname CHAPPAG#1\endcsname}
-
-\def\CHAPPAGoff{%
-\global\let\contentsalignmacro = \chappager
-\global\let\pchapsepmacro=\chapbreak
-\global\let\pagealignmacro=\chappager}
-
-\def\CHAPPAGon{%
-\global\let\contentsalignmacro = \chappager
-\global\let\pchapsepmacro=\chappager
-\global\let\pagealignmacro=\chappager
-\global\def\HEADINGSon{\HEADINGSsingle}}
-
-\def\CHAPPAGodd{%
-\global\let\contentsalignmacro = \chapoddpage
-\global\let\pchapsepmacro=\chapoddpage
-\global\let\pagealignmacro=\chapoddpage
-\global\def\HEADINGSon{\HEADINGSdouble}}
-
-\CHAPPAGon
-
-% Chapter opening.
-%
-% #1 is the text, #2 is the section type (Ynumbered, Ynothing,
-% Yappendix, Yomitfromtoc), #3 the chapter number.
-%
-% To test against our argument.
-\def\Ynothingkeyword{Ynothing}
-\def\Yomitfromtockeyword{Yomitfromtoc}
-\def\Yappendixkeyword{Yappendix}
-%
-\def\chapmacro#1#2#3{%
- % Insert the first mark before the heading break (see notes for \domark).
- \let\prevchapterdefs=\lastchapterdefs
- \let\prevsectiondefs=\lastsectiondefs
- \gdef\lastsectiondefs{\gdef\thissectionname{}\gdef\thissectionnum{}%
- \gdef\thissection{}}%
- %
- \def\temptype{#2}%
- \ifx\temptype\Ynothingkeyword
- \gdef\lastchapterdefs{\gdef\thischaptername{#1}\gdef\thischapternum{}%
- \gdef\thischapter{\thischaptername}}%
- \else\ifx\temptype\Yomitfromtockeyword
- \gdef\lastchapterdefs{\gdef\thischaptername{#1}\gdef\thischapternum{}%
- \gdef\thischapter{}}%
- \else\ifx\temptype\Yappendixkeyword
- \toks0={#1}%
- \xdef\lastchapterdefs{%
- \gdef\noexpand\thischaptername{\the\toks0}%
- \gdef\noexpand\thischapternum{\appendixletter}%
- % \noexpand\putwordAppendix avoids expanding indigestible
- % commands in some of the translations.
- \gdef\noexpand\thischapter{\noexpand\putwordAppendix{}
- \noexpand\thischapternum:
- \noexpand\thischaptername}%
- }%
- \else
- \toks0={#1}%
- \xdef\lastchapterdefs{%
- \gdef\noexpand\thischaptername{\the\toks0}%
- \gdef\noexpand\thischapternum{\the\chapno}%
- % \noexpand\putwordChapter avoids expanding indigestible
- % commands in some of the translations.
- \gdef\noexpand\thischapter{\noexpand\putwordChapter{}
- \noexpand\thischapternum:
- \noexpand\thischaptername}%
- }%
- \fi\fi\fi
- %
- % Output the mark. Pass it through \safewhatsit, to take care of
- % the preceding space.
- \safewhatsit\domark
- %
- % Insert the chapter heading break.
- \pchapsepmacro
- %
- % Now the second mark, after the heading break. No break points
- % between here and the heading.
- \let\prevchapterdefs=\lastchapterdefs
- \let\prevsectiondefs=\lastsectiondefs
- \domark
- %
- {%
- \chapfonts \rmisbold
- %
- % Have to define \lastsection before calling \donoderef, because the
- % xref code eventually uses it. On the other hand, it has to be called
- % after \pchapsepmacro, or the headline will change too soon.
- \gdef\lastsection{#1}%
- %
- % Only insert the separating space if we have a chapter/appendix
- % number, and don't print the unnumbered ``number''.
- \ifx\temptype\Ynothingkeyword
- \setbox0 = \hbox{}%
- \def\toctype{unnchap}%
- \else\ifx\temptype\Yomitfromtockeyword
- \setbox0 = \hbox{}% contents like unnumbered, but no toc entry
- \def\toctype{omit}%
- \else\ifx\temptype\Yappendixkeyword
- \setbox0 = \hbox{\putwordAppendix{} #3\enspace}%
- \def\toctype{app}%
- \else
- \setbox0 = \hbox{#3\enspace}%
- \def\toctype{numchap}%
- \fi\fi\fi
- %
- % Write the toc entry for this chapter. Must come before the
- % \donoderef, because we include the current node name in the toc
- % entry, and \donoderef resets it to empty.
- \writetocentry{\toctype}{#1}{#3}%
- %
- % For pdftex, we have to write out the node definition (aka, make
- % the pdfdest) after any page break, but before the actual text has
- % been typeset. If the destination for the pdf outline is after the
- % text, then jumping from the outline may wind up with the text not
- % being visible, for instance under high magnification.
- \donoderef{#2}%
- %
- % Typeset the actual heading.
- \nobreak % Avoid page breaks at the interline glue.
- \vbox{\raggedtitlesettings \hangindent=\wd0 \centerparametersmaybe
- \unhbox0 #1\par}%
- }%
- \nobreak\bigskip % no page break after a chapter title
- \nobreak
-}
-
-% @centerchap -- centered and unnumbered.
-\let\centerparametersmaybe = \relax
-\def\centerparameters{%
- \advance\rightskip by 3\rightskip
- \leftskip = \rightskip
- \parfillskip = 0pt
-}
-
-
-% I don't think this chapter style is supported any more, so I'm not
-% updating it with the new noderef stuff. We'll see. --karl, 11aug03.
-%
-\def\setchapterstyle #1 {\csname CHAPF#1\endcsname}
-%
-\def\unnchfopen #1{%
- \chapoddpage
- \vbox{\chapfonts \raggedtitlesettings #1\par}%
- \nobreak\bigskip\nobreak
-}
-\def\chfopen #1#2{\chapoddpage {\chapfonts
-\vbox to 3in{\vfil \hbox to\hsize{\hfil #2} \hbox to\hsize{\hfil #1} \vfil}}%
-\par\penalty 5000 %
-}
-\def\centerchfopen #1{%
- \chapoddpage
- \vbox{\chapfonts \raggedtitlesettings \hfill #1\hfill}%
- \nobreak\bigskip \nobreak
-}
-\def\CHAPFopen{%
- \global\let\chapmacro=\chfopen
- \global\let\centerchapmacro=\centerchfopen}
-
-
-% Section titles. These macros combine the section number parts and
-% call the generic \sectionheading to do the printing.
-%
-\newskip\secheadingskip
-\def\secheadingbreak{\dobreak \secheadingskip{-1000}}
-
-% Subsection titles.
-\newskip\subsecheadingskip
-\def\subsecheadingbreak{\dobreak \subsecheadingskip{-500}}
-
-% Subsubsection titles.
-\def\subsubsecheadingskip{\subsecheadingskip}
-\def\subsubsecheadingbreak{\subsecheadingbreak}
-
-
-% Print any size, any type, section title.
-%
-% #1 is the text, #2 is the section level (sec/subsec/subsubsec), #3 is
-% the section type for xrefs (Ynumbered, Ynothing, Yappendix), #4 is the
-% section number.
-%
-\def\seckeyword{sec}
-%
-\def\sectionheading#1#2#3#4{%
- {%
- \checkenv{}% should not be in an environment.
- %
- % Switch to the right set of fonts.
- \csname #2fonts\endcsname \rmisbold
- %
- \def\sectionlevel{#2}%
- \def\temptype{#3}%
- %
- % Insert first mark before the heading break (see notes for \domark).
- \let\prevsectiondefs=\lastsectiondefs
- \ifx\temptype\Ynothingkeyword
- \ifx\sectionlevel\seckeyword
- \gdef\lastsectiondefs{\gdef\thissectionname{#1}\gdef\thissectionnum{}%
- \gdef\thissection{\thissectionname}}%
- \fi
- \else\ifx\temptype\Yomitfromtockeyword
- % Don't redefine \thissection.
- \else\ifx\temptype\Yappendixkeyword
- \ifx\sectionlevel\seckeyword
- \toks0={#1}%
- \xdef\lastsectiondefs{%
- \gdef\noexpand\thissectionname{\the\toks0}%
- \gdef\noexpand\thissectionnum{#4}%
- % \noexpand\putwordSection avoids expanding indigestible
- % commands in some of the translations.
- \gdef\noexpand\thissection{\noexpand\putwordSection{}
- \noexpand\thissectionnum:
- \noexpand\thissectionname}%
- }%
- \fi
- \else
- \ifx\sectionlevel\seckeyword
- \toks0={#1}%
- \xdef\lastsectiondefs{%
- \gdef\noexpand\thissectionname{\the\toks0}%
- \gdef\noexpand\thissectionnum{#4}%
- % \noexpand\putwordSection avoids expanding indigestible
- % commands in some of the translations.
- \gdef\noexpand\thissection{\noexpand\putwordSection{}
- \noexpand\thissectionnum:
- \noexpand\thissectionname}%
- }%
- \fi
- \fi\fi\fi
- %
- % Go into vertical mode. Usually we'll already be there, but we
- % don't want the following whatsit to end up in a preceding paragraph
- % if the document didn't happen to have a blank line.
- \par
- %
- % Output the mark. Pass it through \safewhatsit, to take care of
- % the preceding space.
- \safewhatsit\domark
- %
- % Insert space above the heading.
- \csname #2headingbreak\endcsname
- %
- % Now the second mark, after the heading break. No break points
- % between here and the heading.
- \let\prevsectiondefs=\lastsectiondefs
- \domark
- %
- % Only insert the space after the number if we have a section number.
- \ifx\temptype\Ynothingkeyword
- \setbox0 = \hbox{}%
- \def\toctype{unn}%
- \gdef\lastsection{#1}%
- \else\ifx\temptype\Yomitfromtockeyword
- % for @headings -- no section number, don't include in toc,
- % and don't redefine \lastsection.
- \setbox0 = \hbox{}%
- \def\toctype{omit}%
- \let\sectionlevel=\empty
- \else\ifx\temptype\Yappendixkeyword
- \setbox0 = \hbox{#4\enspace}%
- \def\toctype{app}%
- \gdef\lastsection{#1}%
- \else
- \setbox0 = \hbox{#4\enspace}%
- \def\toctype{num}%
- \gdef\lastsection{#1}%
- \fi\fi\fi
- %
- % Write the toc entry (before \donoderef). See comments in \chapmacro.
- \writetocentry{\toctype\sectionlevel}{#1}{#4}%
- %
- % Write the node reference (= pdf destination for pdftex).
- % Again, see comments in \chapmacro.
- \donoderef{#3}%
- %
- % Interline glue will be inserted when the vbox is completed.
- % That glue will be a valid breakpoint for the page, since it'll be
- % preceded by a whatsit (usually from the \donoderef, or from the
- % \writetocentry if there was no node). We don't want to allow that
- % break, since then the whatsits could end up on page n while the
- % section is on page n+1, thus toc/etc. are wrong. Debian bug 276000.
- \nobreak
- %
- % Output the actual section heading.
- \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \ptexraggedright
- \hangindent=\wd0 % zero if no section number
- \unhbox0 #1}%
- }%
- % Add extra space after the heading -- half of whatever came above it.
- % Don't allow stretch, though.
- \kern .5 \csname #2headingskip\endcsname
- %
- % Do not let the kern be a potential breakpoint, as it would be if it
- % was followed by glue.
- \nobreak
- %
- % We'll almost certainly start a paragraph next, so don't let that
- % glue accumulate. (Not a breakpoint because it's preceded by a
- % discardable item.) However, when a paragraph is not started next
- % (\startdefun, \cartouche, \center, etc.), this needs to be wiped out
- % or the negative glue will cause weirdly wrong output, typically
- % obscuring the section heading with something else.
- \vskip-\parskip
- %
- % This is so the last item on the main vertical list is a known
- % \penalty > 10000, so \startdefun, etc., can recognize the situation
- % and do the needful.
- \penalty 10001
-}
-
-
-\message{toc,}
-% Table of contents.
-\newwrite\tocfile
-
-% Write an entry to the toc file, opening it if necessary.
-% Called from @chapter, etc.
-%
-% Example usage: \writetocentry{sec}{Section Name}{\the\chapno.\the\secno}
-% We append the current node name (if any) and page number as additional
-% arguments for the \{chap,sec,...}entry macros which will eventually
-% read this. The node name is used in the pdf outlines as the
-% destination to jump to.
-%
-% We open the .toc file for writing here instead of at @setfilename (or
-% any other fixed time) so that @contents can be anywhere in the document.
-% But if #1 is `omit', then we don't do anything. This is used for the
-% table of contents chapter openings themselves.
-%
-\newif\iftocfileopened
-\def\omitkeyword{omit}%
-%
-\def\writetocentry#1#2#3{%
- \edef\writetoctype{#1}%
- \ifx\writetoctype\omitkeyword \else
- \iftocfileopened\else
- \immediate\openout\tocfile = \jobname.toc
- \global\tocfileopenedtrue
- \fi
- %
- \iflinks
- {\atdummies
- \edef\temp{%
- \write\tocfile{@#1entry{#2}{#3}{\lastnode}{\noexpand\folio}}}%
- \temp
- }%
- \fi
- \fi
- %
- % Tell \shipout to create a pdf destination on each page, if we're
- % writing pdf. These are used in the table of contents. We can't
- % just write one on every page because the title pages are numbered
- % 1 and 2 (the page numbers aren't printed), and so are the first
- % two pages of the document. Thus, we'd have two destinations named
- % `1', and two named `2'.
- \ifpdf \global\pdfmakepagedesttrue \fi
-}
-
-
-% These characters do not print properly in the Computer Modern roman
-% fonts, so we must take special care. This is more or less redundant
-% with the Texinfo input format setup at the end of this file.
-%
-\def\activecatcodes{%
- \catcode`\"=\active
- \catcode`\$=\active
- \catcode`\<=\active
- \catcode`\>=\active
- \catcode`\\=\active
- \catcode`\^=\active
- \catcode`\_=\active
- \catcode`\|=\active
- \catcode`\~=\active
-}
-
-
-% Read the toc file, which is essentially Texinfo input.
-\def\readtocfile{%
- \setupdatafile
- \activecatcodes
- \input \tocreadfilename
-}
-
-\newskip\contentsrightmargin \contentsrightmargin=1in
-\newcount\savepageno
-\newcount\lastnegativepageno \lastnegativepageno = -1
-
-% Prepare to read what we've written to \tocfile.
-%
-\def\startcontents#1{%
- % If @setchapternewpage on, and @headings double, the contents should
- % start on an odd page, unlike chapters. Thus, we maintain
- % \contentsalignmacro in parallel with \pagealignmacro.
- % From: Torbjorn Granlund <tege@matematik.su.se>
- \contentsalignmacro
- \immediate\closeout\tocfile
- %
- % Don't need to put `Contents' or `Short Contents' in the headline.
- % It is abundantly clear what they are.
- \chapmacro{#1}{Yomitfromtoc}{}%
- %
- \savepageno = \pageno
- \begingroup % Set up to handle contents files properly.
- \raggedbottom % Worry more about breakpoints than the bottom.
- \advance\hsize by -\contentsrightmargin % Don't use the full line length.
- %
- % Roman numerals for page numbers.
- \ifnum \pageno>0 \global\pageno = \lastnegativepageno \fi
-}
-
-% redefined for the two-volume lispref. We always output on
-% \jobname.toc even if this is redefined.
-%
-\def\tocreadfilename{\jobname.toc}
-
-% Normal (long) toc.
-%
-\def\contents{%
- \startcontents{\putwordTOC}%
- \openin 1 \tocreadfilename\space
- \ifeof 1 \else
- \readtocfile
- \fi
- \vfill \eject
- \contentsalignmacro % in case @setchapternewpage odd is in effect
- \ifeof 1 \else
- \pdfmakeoutlines
- \fi
- \closein 1
- \endgroup
- \lastnegativepageno = \pageno
- \global\pageno = \savepageno
-}
-
-% And just the chapters.
-\def\summarycontents{%
- \startcontents{\putwordShortTOC}%
- %
- \let\partentry = \shortpartentry
- \let\numchapentry = \shortchapentry
- \let\appentry = \shortchapentry
- \let\unnchapentry = \shortunnchapentry
- % We want a true roman here for the page numbers.
- \secfonts
- \let\rm=\shortcontrm \let\bf=\shortcontbf
- \let\sl=\shortcontsl \let\tt=\shortconttt
- \rm
- \hyphenpenalty = 10000
- \advance\baselineskip by 1pt % Open it up a little.
- \def\numsecentry##1##2##3##4{}
- \let\appsecentry = \numsecentry
- \let\unnsecentry = \numsecentry
- \let\numsubsecentry = \numsecentry
- \let\appsubsecentry = \numsecentry
- \let\unnsubsecentry = \numsecentry
- \let\numsubsubsecentry = \numsecentry
- \let\appsubsubsecentry = \numsecentry
- \let\unnsubsubsecentry = \numsecentry
- \openin 1 \tocreadfilename\space
- \ifeof 1 \else
- \readtocfile
- \fi
- \closein 1
- \vfill \eject
- \contentsalignmacro % in case @setchapternewpage odd is in effect
- \endgroup
- \lastnegativepageno = \pageno
- \global\pageno = \savepageno
-}
-\let\shortcontents = \summarycontents
-
-% Typeset the label for a chapter or appendix for the short contents.
-% The arg is, e.g., `A' for an appendix, or `3' for a chapter.
-%
-\def\shortchaplabel#1{%
- % This space should be enough, since a single number is .5em, and the
- % widest letter (M) is 1em, at least in the Computer Modern fonts.
- % But use \hss just in case.
- % (This space doesn't include the extra space that gets added after
- % the label; that gets put in by \shortchapentry above.)
- %
- % We'd like to right-justify chapter numbers, but that looks strange
- % with appendix letters. And right-justifying numbers and
- % left-justifying letters looks strange when there is less than 10
- % chapters. Have to read the whole toc once to know how many chapters
- % there are before deciding ...
- \hbox to 1em{#1\hss}%
-}
-
-% These macros generate individual entries in the table of contents.
-% The first argument is the chapter or section name.
-% The last argument is the page number.
-% The arguments in between are the chapter number, section number, ...
-
-% Parts, in the main contents. Replace the part number, which doesn't
-% exist, with an empty box. Let's hope all the numbers have the same width.
-% Also ignore the page number, which is conventionally not printed.
-\def\numeralbox{\setbox0=\hbox{8}\hbox to \wd0{\hfil}}
-\def\partentry#1#2#3#4{\dochapentry{\numeralbox\labelspace#1}{}}
-%
-% Parts, in the short toc.
-\def\shortpartentry#1#2#3#4{%
- \penalty-300
- \vskip.5\baselineskip plus.15\baselineskip minus.1\baselineskip
- \shortchapentry{{\bf #1}}{\numeralbox}{}{}%
-}
-
-% Chapters, in the main contents.
-\def\numchapentry#1#2#3#4{\dochapentry{#2\labelspace#1}{#4}}
-%
-% Chapters, in the short toc.
-% See comments in \dochapentry re vbox and related settings.
-\def\shortchapentry#1#2#3#4{%
- \tocentry{\shortchaplabel{#2}\labelspace #1}{\doshortpageno\bgroup#4\egroup}%
-}
-
-% Appendices, in the main contents.
-% Need the word Appendix, and a fixed-size box.
-%
-\def\appendixbox#1{%
- % We use M since it's probably the widest letter.
- \setbox0 = \hbox{\putwordAppendix{} M}%
- \hbox to \wd0{\putwordAppendix{} #1\hss}}
-%
-\def\appentry#1#2#3#4{\dochapentry{\appendixbox{#2}\labelspace#1}{#4}}
-
-% Unnumbered chapters.
-\def\unnchapentry#1#2#3#4{\dochapentry{#1}{#4}}
-\def\shortunnchapentry#1#2#3#4{\tocentry{#1}{\doshortpageno\bgroup#4\egroup}}
-
-% Sections.
-\def\numsecentry#1#2#3#4{\dosecentry{#2\labelspace#1}{#4}}
-\let\appsecentry=\numsecentry
-\def\unnsecentry#1#2#3#4{\dosecentry{#1}{#4}}
-
-% Subsections.
-\def\numsubsecentry#1#2#3#4{\dosubsecentry{#2\labelspace#1}{#4}}
-\let\appsubsecentry=\numsubsecentry
-\def\unnsubsecentry#1#2#3#4{\dosubsecentry{#1}{#4}}
-
-% And subsubsections.
-\def\numsubsubsecentry#1#2#3#4{\dosubsubsecentry{#2\labelspace#1}{#4}}
-\let\appsubsubsecentry=\numsubsubsecentry
-\def\unnsubsubsecentry#1#2#3#4{\dosubsubsecentry{#1}{#4}}
-
-% This parameter controls the indentation of the various levels.
-% Same as \defaultparindent.
-\newdimen\tocindent \tocindent = 15pt
-
-% Now for the actual typesetting. In all these, #1 is the text and #2 is the
-% page number.
-%
-% If the toc has to be broken over pages, we want it to be at chapters
-% if at all possible; hence the \penalty.
-\def\dochapentry#1#2{%
- \penalty-300 \vskip1\baselineskip plus.33\baselineskip minus.25\baselineskip
- \begingroup
- \chapentryfonts
- \tocentry{#1}{\dopageno\bgroup#2\egroup}%
- \endgroup
- \nobreak\vskip .25\baselineskip plus.1\baselineskip
-}
-
-\def\dosecentry#1#2{\begingroup
- \secentryfonts \leftskip=\tocindent
- \tocentry{#1}{\dopageno\bgroup#2\egroup}%
-\endgroup}
-
-\def\dosubsecentry#1#2{\begingroup
- \subsecentryfonts \leftskip=2\tocindent
- \tocentry{#1}{\dopageno\bgroup#2\egroup}%
-\endgroup}
-
-\def\dosubsubsecentry#1#2{\begingroup
- \subsubsecentryfonts \leftskip=3\tocindent
- \tocentry{#1}{\dopageno\bgroup#2\egroup}%
-\endgroup}
-
-% We use the same \entry macro as for the index entries.
-\let\tocentry = \entry
-
-% Space between chapter (or whatever) number and the title.
-\def\labelspace{\hskip1em \relax}
-
-\def\dopageno#1{{\rm #1}}
-\def\doshortpageno#1{{\rm #1}}
-
-\def\chapentryfonts{\secfonts \rm}
-\def\secentryfonts{\textfonts}
-\def\subsecentryfonts{\textfonts}
-\def\subsubsecentryfonts{\textfonts}
-
-
-\message{environments,}
-% @foo ... @end foo.
-
-% @tex ... @end tex escapes into raw TeX temporarily.
-% One exception: @ is still an escape character, so that @end tex works.
-% But \@ or @@ will get a plain @ character.
-
-\envdef\tex{%
- \setupmarkupstyle{tex}%
- \catcode `\\=0 \catcode `\{=1 \catcode `\}=2
- \catcode `\$=3 \catcode `\&=4 \catcode `\#=6
- \catcode `\^=7 \catcode `\_=8 \catcode `\~=\active \let~=\tie
- \catcode `\%=14
- \catcode `\+=\other
- \catcode `\"=\other
- \catcode `\|=\other
- \catcode `\<=\other
- \catcode `\>=\other
- \catcode`\`=\other
- \catcode`\'=\other
- \escapechar=`\\
- %
- % ' is active in math mode (mathcode"8000). So reset it, and all our
- % other math active characters (just in case), to plain's definitions.
- \mathactive
- %
- \let\b=\ptexb
- \let\bullet=\ptexbullet
- \let\c=\ptexc
- \let\,=\ptexcomma
- \let\.=\ptexdot
- \let\dots=\ptexdots
- \let\equiv=\ptexequiv
- \let\!=\ptexexclam
- \let\i=\ptexi
- \let\indent=\ptexindent
- \let\noindent=\ptexnoindent
- \let\{=\ptexlbrace
- \let\+=\tabalign
- \let\}=\ptexrbrace
- \let\/=\ptexslash
- \let\*=\ptexstar
- \let\t=\ptext
- \expandafter \let\csname top\endcsname=\ptextop % outer
- \let\frenchspacing=\plainfrenchspacing
- %
- \def\endldots{\mathinner{\ldots\ldots\ldots\ldots}}%
- \def\enddots{\relax\ifmmode\endldots\else$\mathsurround=0pt \endldots\,$\fi}%
- \def\@{@}%
-}
-% There is no need to define \Etex.
-
-% Define @lisp ... @end lisp.
-% @lisp environment forms a group so it can rebind things,
-% including the definition of @end lisp (which normally is erroneous).
-
-% Amount to narrow the margins by for @lisp.
-\newskip\lispnarrowing \lispnarrowing=0.4in
-
-% This is the definition that ^^M gets inside @lisp, @example, and other
-% such environments. \null is better than a space, since it doesn't
-% have any width.
-\def\lisppar{\null\endgraf}
-
-% This space is always present above and below environments.
-\newskip\envskipamount \envskipamount = 0pt
-
-% Make spacing and below environment symmetrical. We use \parskip here
-% to help in doing that, since in @example-like environments \parskip
-% is reset to zero; thus the \afterenvbreak inserts no space -- but the
-% start of the next paragraph will insert \parskip.
-%
-\def\aboveenvbreak{{%
- % =10000 instead of <10000 because of a special case in \itemzzz and
- % \sectionheading, q.v.
- \ifnum \lastpenalty=10000 \else
- \advance\envskipamount by \parskip
- \endgraf
- \ifdim\lastskip<\envskipamount
- \removelastskip
- % it's not a good place to break if the last penalty was \nobreak
- % or better ...
- \ifnum\lastpenalty<10000 \penalty-50 \fi
- \vskip\envskipamount
- \fi
- \fi
-}}
-
-\let\afterenvbreak = \aboveenvbreak
-
-% \nonarrowing is a flag. If "set", @lisp etc don't narrow margins; it will
-% also clear it, so that its embedded environments do the narrowing again.
-\let\nonarrowing=\relax
-
-% @cartouche ... @end cartouche: draw rectangle w/rounded corners around
-% environment contents.
-\font\circle=lcircle10
-\newdimen\circthick
-\newdimen\cartouter\newdimen\cartinner
-\newskip\normbskip\newskip\normpskip\newskip\normlskip
-\circthick=\fontdimen8\circle
-%
-\def\ctl{{\circle\char'013\hskip -6pt}}% 6pt from pl file: 1/2charwidth
-\def\ctr{{\hskip 6pt\circle\char'010}}
-\def\cbl{{\circle\char'012\hskip -6pt}}
-\def\cbr{{\hskip 6pt\circle\char'011}}
-\def\carttop{\hbox to \cartouter{\hskip\lskip
- \ctl\leaders\hrule height\circthick\hfil\ctr
- \hskip\rskip}}
-\def\cartbot{\hbox to \cartouter{\hskip\lskip
- \cbl\leaders\hrule height\circthick\hfil\cbr
- \hskip\rskip}}
-%
-\newskip\lskip\newskip\rskip
-
-\envdef\cartouche{%
- \ifhmode\par\fi % can't be in the midst of a paragraph.
- \startsavinginserts
- \lskip=\leftskip \rskip=\rightskip
- \leftskip=0pt\rightskip=0pt % we want these *outside*.
- \cartinner=\hsize \advance\cartinner by-\lskip
- \advance\cartinner by-\rskip
- \cartouter=\hsize
- \advance\cartouter by 18.4pt % allow for 3pt kerns on either
- % side, and for 6pt waste from
- % each corner char, and rule thickness
- \normbskip=\baselineskip \normpskip=\parskip \normlskip=\lineskip
- % Flag to tell @lisp, etc., not to narrow margin.
- \let\nonarrowing = t%
- %
- % If this cartouche directly follows a sectioning command, we need the
- % \parskip glue (backspaced over by default) or the cartouche can
- % collide with the section heading.
- \ifnum\lastpenalty>10000 \vskip\parskip \penalty\lastpenalty \fi
- %
- \vbox\bgroup
- \baselineskip=0pt\parskip=0pt\lineskip=0pt
- \carttop
- \hbox\bgroup
- \hskip\lskip
- \vrule\kern3pt
- \vbox\bgroup
- \kern3pt
- \hsize=\cartinner
- \baselineskip=\normbskip
- \lineskip=\normlskip
- \parskip=\normpskip
- \vskip -\parskip
- \comment % For explanation, see the end of def\group.
-}
-\def\Ecartouche{%
- \ifhmode\par\fi
- \kern3pt
- \egroup
- \kern3pt\vrule
- \hskip\rskip
- \egroup
- \cartbot
- \egroup
- \checkinserts
-}
-
-
-% This macro is called at the beginning of all the @example variants,
-% inside a group.
-\newdimen\nonfillparindent
-\def\nonfillstart{%
- \aboveenvbreak
- \hfuzz = 12pt % Don't be fussy
- \sepspaces % Make spaces be word-separators rather than space tokens.
- \let\par = \lisppar % don't ignore blank lines
- \obeylines % each line of input is a line of output
- \parskip = 0pt
- % Turn off paragraph indentation but redefine \indent to emulate
- % the normal \indent.
- \nonfillparindent=\parindent
- \parindent = 0pt
- \let\indent\nonfillindent
- %
- \emergencystretch = 0pt % don't try to avoid overfull boxes
- \ifx\nonarrowing\relax
- \advance \leftskip by \lispnarrowing
- \exdentamount=\lispnarrowing
- \else
- \let\nonarrowing = \relax
- \fi
- \let\exdent=\nofillexdent
-}
-
-\begingroup
-\obeyspaces
-% We want to swallow spaces (but not other tokens) after the fake
-% @indent in our nonfill-environments, where spaces are normally
-% active and set to @tie, resulting in them not being ignored after
-% @indent.
-\gdef\nonfillindent{\futurelet\temp\nonfillindentcheck}%
-\gdef\nonfillindentcheck{%
-\ifx\temp %
-\expandafter\nonfillindentgobble%
-\else%
-\leavevmode\nonfillindentbox%
-\fi%
-}%
-\endgroup
-\def\nonfillindentgobble#1{\nonfillindent}
-\def\nonfillindentbox{\hbox to \nonfillparindent{\hss}}
-
-% If you want all examples etc. small: @set dispenvsize small.
-% If you want even small examples the full size: @set dispenvsize nosmall.
-% This affects the following displayed environments:
-% @example, @display, @format, @lisp
-%
-\def\smallword{small}
-\def\nosmallword{nosmall}
-\let\SETdispenvsize\relax
-\def\setnormaldispenv{%
- \ifx\SETdispenvsize\smallword
- % end paragraph for sake of leading, in case document has no blank
- % line. This is redundant with what happens in \aboveenvbreak, but
- % we need to do it before changing the fonts, and it's inconvenient
- % to change the fonts afterward.
- \ifnum \lastpenalty=10000 \else \endgraf \fi
- \smallexamplefonts \rm
- \fi
-}
-\def\setsmalldispenv{%
- \ifx\SETdispenvsize\nosmallword
- \else
- \ifnum \lastpenalty=10000 \else \endgraf \fi
- \smallexamplefonts \rm
- \fi
-}
-
-% We often define two environments, @foo and @smallfoo.
-% Let's do it in one command. #1 is the env name, #2 the definition.
-\def\makedispenvdef#1#2{%
- \expandafter\envdef\csname#1\endcsname {\setnormaldispenv #2}%
- \expandafter\envdef\csname small#1\endcsname {\setsmalldispenv #2}%
- \expandafter\let\csname E#1\endcsname \afterenvbreak
- \expandafter\let\csname Esmall#1\endcsname \afterenvbreak
-}
-
-% Define two environment synonyms (#1 and #2) for an environment.
-\def\maketwodispenvdef#1#2#3{%
- \makedispenvdef{#1}{#3}%
- \makedispenvdef{#2}{#3}%
-}
-%
-% @lisp: indented, narrowed, typewriter font;
-% @example: same as @lisp.
-%
-% @smallexample and @smalllisp: use smaller fonts.
-% Originally contributed by Pavel@xerox.
-%
-\maketwodispenvdef{lisp}{example}{%
- \nonfillstart
- \tt\setupmarkupstyle{example}%
- \let\kbdfont = \kbdexamplefont % Allow @kbd to do something special.
- \gobble % eat return
-}
-% @display/@smalldisplay: same as @lisp except keep current font.
-%
-\makedispenvdef{display}{%
- \nonfillstart
- \gobble
-}
-
-% @format/@smallformat: same as @display except don't narrow margins.
-%
-\makedispenvdef{format}{%
- \let\nonarrowing = t%
- \nonfillstart
- \gobble
-}
-
-% @flushleft: same as @format, but doesn't obey \SETdispenvsize.
-\envdef\flushleft{%
- \let\nonarrowing = t%
- \nonfillstart
- \gobble
-}
-\let\Eflushleft = \afterenvbreak
-
-% @flushright.
-%
-\envdef\flushright{%
- \let\nonarrowing = t%
- \nonfillstart
- \advance\leftskip by 0pt plus 1fill\relax
- \gobble
-}
-\let\Eflushright = \afterenvbreak
-
-
-% @raggedright does more-or-less normal line breaking but no right
-% justification. From plain.tex.
-\envdef\raggedright{%
- \rightskip0pt plus2em \spaceskip.3333em \xspaceskip.5em\relax
-}
-\let\Eraggedright\par
-
-\envdef\raggedleft{%
- \parindent=0pt \leftskip0pt plus2em
- \spaceskip.3333em \xspaceskip.5em \parfillskip=0pt
- \hbadness=10000 % Last line will usually be underfull, so turn off
- % badness reporting.
-}
-\let\Eraggedleft\par
-
-\envdef\raggedcenter{%
- \parindent=0pt \rightskip0pt plus1em \leftskip0pt plus1em
- \spaceskip.3333em \xspaceskip.5em \parfillskip=0pt
- \hbadness=10000 % Last line will usually be underfull, so turn off
- % badness reporting.
-}
-\let\Eraggedcenter\par
-
-
-% @quotation does normal linebreaking (hence we can't use \nonfillstart)
-% and narrows the margins. We keep \parskip nonzero in general, since
-% we're doing normal filling. So, when using \aboveenvbreak and
-% \afterenvbreak, temporarily make \parskip 0.
-%
-\makedispenvdef{quotation}{\quotationstart}
-%
-\def\quotationstart{%
- \indentedblockstart % same as \indentedblock, but increase right margin too.
- \ifx\nonarrowing\relax
- \advance\rightskip by \lispnarrowing
- \fi
- \parsearg\quotationlabel
-}
-
-% We have retained a nonzero parskip for the environment, since we're
-% doing normal filling.
-%
-\def\Equotation{%
- \par
- \ifx\quotationauthor\thisisundefined\else
- % indent a bit.
- \leftline{\kern 2\leftskip \sl ---\quotationauthor}%
- \fi
- {\parskip=0pt \afterenvbreak}%
-}
-\def\Esmallquotation{\Equotation}
-
-% If we're given an argument, typeset it in bold with a colon after.
-\def\quotationlabel#1{%
- \def\temp{#1}%
- \ifx\temp\empty \else
- {\bf #1: }%
- \fi
-}
-
-% @indentedblock is like @quotation, but indents only on the left and
-% has no optional argument.
-%
-\makedispenvdef{indentedblock}{\indentedblockstart}
-%
-\def\indentedblockstart{%
- {\parskip=0pt \aboveenvbreak}% because \aboveenvbreak inserts \parskip
- \parindent=0pt
- %
- % @cartouche defines \nonarrowing to inhibit narrowing at next level down.
- \ifx\nonarrowing\relax
- \advance\leftskip by \lispnarrowing
- \exdentamount = \lispnarrowing
- \else
- \let\nonarrowing = \relax
- \fi
-}
-
-% Keep a nonzero parskip for the environment, since we're doing normal filling.
-%
-\def\Eindentedblock{%
- \par
- {\parskip=0pt \afterenvbreak}%
-}
-\def\Esmallindentedblock{\Eindentedblock}
-
-
-% LaTeX-like @verbatim...@end verbatim and @verb{<char>...<char>}
-% If we want to allow any <char> as delimiter,
-% we need the curly braces so that makeinfo sees the @verb command, eg:
-% `@verbx...x' would look like the '@verbx' command. --janneke@gnu.org
-%
-% [Knuth]: Donald Ervin Knuth, 1996. The TeXbook.
-%
-% [Knuth] p.344; only we need to do the other characters Texinfo sets
-% active too. Otherwise, they get lost as the first character on a
-% verbatim line.
-\def\dospecials{%
- \do\ \do\\\do\{\do\}\do\$\do\&%
- \do\#\do\^\do\^^K\do\_\do\^^A\do\%\do\~%
- \do\<\do\>\do\|\do\@\do+\do\"%
- % Don't do the quotes -- if we do, @set txicodequoteundirected and
- % @set txicodequotebacktick will not have effect on @verb and
- % @verbatim, and ?` and !` ligatures won't get disabled.
- %\do\`\do\'%
-}
-%
-% [Knuth] p. 380
-\def\uncatcodespecials{%
- \def\do##1{\catcode`##1=\other}\dospecials}
-%
-% Setup for the @verb command.
-%
-% Eight spaces for a tab
-\begingroup
- \catcode`\^^I=\active
- \gdef\tabeightspaces{\catcode`\^^I=\active\def^^I{\ \ \ \ \ \ \ \ }}
-\endgroup
-%
-\def\setupverb{%
- \tt % easiest (and conventionally used) font for verbatim
- \def\par{\leavevmode\endgraf}%
- \setupmarkupstyle{verb}%
- \tabeightspaces
- % Respect line breaks,
- % print special symbols as themselves, and
- % make each space count
- % must do in this order:
- \obeylines \uncatcodespecials \sepspaces
-}
-
-% Setup for the @verbatim environment
-%
-% Real tab expansion.
-\newdimen\tabw \setbox0=\hbox{\tt\space} \tabw=8\wd0 % tab amount
-%
-% We typeset each line of the verbatim in an \hbox, so we can handle
-% tabs. The \global is in case the verbatim line starts with an accent,
-% or some other command that starts with a begin-group. Otherwise, the
-% entire \verbbox would disappear at the corresponding end-group, before
-% it is typeset. Meanwhile, we can't have nested verbatim commands
-% (can we?), so the \global won't be overwriting itself.
-\newbox\verbbox
-\def\starttabbox{\global\setbox\verbbox=\hbox\bgroup}
-%
-\begingroup
- \catcode`\^^I=\active
- \gdef\tabexpand{%
- \catcode`\^^I=\active
- \def^^I{\leavevmode\egroup
- \dimen\verbbox=\wd\verbbox % the width so far, or since the previous tab
- \divide\dimen\verbbox by\tabw
- \multiply\dimen\verbbox by\tabw % compute previous multiple of \tabw
- \advance\dimen\verbbox by\tabw % advance to next multiple of \tabw
- \wd\verbbox=\dimen\verbbox \box\verbbox \starttabbox
- }%
- }
-\endgroup
-
-% start the verbatim environment.
-\def\setupverbatim{%
- \let\nonarrowing = t%
- \nonfillstart
- \tt % easiest (and conventionally used) font for verbatim
- % The \leavevmode here is for blank lines. Otherwise, we would
- % never \starttabox and the \egroup would end verbatim mode.
- \def\par{\leavevmode\egroup\box\verbbox\endgraf}%
- \tabexpand
- \setupmarkupstyle{verbatim}%
- % Respect line breaks,
- % print special symbols as themselves, and
- % make each space count.
- % Must do in this order:
- \obeylines \uncatcodespecials \sepspaces
- \everypar{\starttabbox}%
-}
-
-% Do the @verb magic: verbatim text is quoted by unique
-% delimiter characters. Before first delimiter expect a
-% right brace, after last delimiter expect closing brace:
-%
-% \def\doverb'{'<char>#1<char>'}'{#1}
-%
-% [Knuth] p. 382; only eat outer {}
-\begingroup
- \catcode`[=1\catcode`]=2\catcode`\{=\other\catcode`\}=\other
- \gdef\doverb{#1[\def\next##1#1}[##1\endgroup]\next]
-\endgroup
-%
-\def\verb{\begingroup\setupverb\doverb}
-%
-%
-% Do the @verbatim magic: define the macro \doverbatim so that
-% the (first) argument ends when '@end verbatim' is reached, ie:
-%
-% \def\doverbatim#1@end verbatim{#1}
-%
-% For Texinfo it's a lot easier than for LaTeX,
-% because texinfo's \verbatim doesn't stop at '\end{verbatim}':
-% we need not redefine '\', '{' and '}'.
-%
-% Inspired by LaTeX's verbatim command set [latex.ltx]
-%
-\begingroup
- \catcode`\ =\active
- \obeylines %
- % ignore everything up to the first ^^M, that's the newline at the end
- % of the @verbatim input line itself. Otherwise we get an extra blank
- % line in the output.
- \xdef\doverbatim#1^^M#2@end verbatim{#2\noexpand\end\gobble verbatim}%
- % We really want {...\end verbatim} in the body of the macro, but
- % without the active space; thus we have to use \xdef and \gobble.
-\endgroup
-%
-\envdef\verbatim{%
- \setupverbatim\doverbatim
-}
-\let\Everbatim = \afterenvbreak
-
-
-% @verbatiminclude FILE - insert text of file in verbatim environment.
-%
-\def\verbatiminclude{\parseargusing\filenamecatcodes\doverbatiminclude}
-%
-\def\doverbatiminclude#1{%
- {%
- \makevalueexpandable
- \setupverbatim
- \indexnofonts % Allow `@@' and other weird things in file names.
- \wlog{texinfo.tex: doing @verbatiminclude of #1^^J}%
- \input #1
- \afterenvbreak
- }%
-}
-
-% @copying ... @end copying.
-% Save the text away for @insertcopying later.
-%
-% We save the uninterpreted tokens, rather than creating a box.
-% Saving the text in a box would be much easier, but then all the
-% typesetting commands (@smallbook, font changes, etc.) have to be done
-% beforehand -- and a) we want @copying to be done first in the source
-% file; b) letting users define the frontmatter in as flexible order as
-% possible is very desirable.
-%
-\def\copying{\checkenv{}\begingroup\scanargctxt\docopying}
-\def\docopying#1@end copying{\endgroup\def\copyingtext{#1}}
-%
-\def\insertcopying{%
- \begingroup
- \parindent = 0pt % paragraph indentation looks wrong on title page
- \scanexp\copyingtext
- \endgroup
-}
-
-
-\message{defuns,}
-% @defun etc.
-
-\newskip\defbodyindent \defbodyindent=.4in
-\newskip\defargsindent \defargsindent=50pt
-\newskip\deflastargmargin \deflastargmargin=18pt
-\newcount\defunpenalty
-
-% Start the processing of @deffn:
-\def\startdefun{%
- \ifnum\lastpenalty<10000
- \medbreak
- \defunpenalty=10003 % Will keep this @deffn together with the
- % following @def command, see below.
- \else
- % If there are two @def commands in a row, we'll have a \nobreak,
- % which is there to keep the function description together with its
- % header. But if there's nothing but headers, we need to allow a
- % break somewhere. Check specifically for penalty 10002, inserted
- % by \printdefunline, instead of 10000, since the sectioning
- % commands also insert a nobreak penalty, and we don't want to allow
- % a break between a section heading and a defun.
- %
- % As a further refinement, we avoid "club" headers by signalling
- % with penalty of 10003 after the very first @deffn in the
- % sequence (see above), and penalty of 10002 after any following
- % @def command.
- \ifnum\lastpenalty=10002 \penalty2000 \else \defunpenalty=10002 \fi
- %
- % Similarly, after a section heading, do not allow a break.
- % But do insert the glue.
- \medskip % preceded by discardable penalty, so not a breakpoint
- \fi
- %
- \parindent=0in
- \advance\leftskip by \defbodyindent
- \exdentamount=\defbodyindent
-}
-
-\def\dodefunx#1{%
- % First, check whether we are in the right environment:
- \checkenv#1%
- %
- % As above, allow line break if we have multiple x headers in a row.
- % It's not a great place, though.
- \ifnum\lastpenalty=10002 \penalty3000 \else \defunpenalty=10002 \fi
- %
- % And now, it's time to reuse the body of the original defun:
- \expandafter\gobbledefun#1%
-}
-\def\gobbledefun#1\startdefun{}
-
-% \printdefunline \deffnheader{text}
-%
-\def\printdefunline#1#2{%
- \begingroup
- % call \deffnheader:
- #1#2 \endheader
- % common ending:
- \interlinepenalty = 10000
- \advance\rightskip by 0pt plus 1fil\relax
- \endgraf
- \nobreak\vskip -\parskip
- \penalty\defunpenalty % signal to \startdefun and \dodefunx
- % Some of the @defun-type tags do not enable magic parentheses,
- % rendering the following check redundant. But we don't optimize.
- \checkparencounts
- \endgroup
-}
-
-\def\Edefun{\endgraf\medbreak}
-
-% \makedefun{deffn} creates \deffn, \deffnx and \Edeffn;
-% the only thing remaining is to define \deffnheader.
-%
-\def\makedefun#1{%
- \expandafter\let\csname E#1\endcsname = \Edefun
- \edef\temp{\noexpand\domakedefun
- \makecsname{#1}\makecsname{#1x}\makecsname{#1header}}%
- \temp
-}
-
-% \domakedefun \deffn \deffnx \deffnheader
-%
-% Define \deffn and \deffnx, without parameters.
-% \deffnheader has to be defined explicitly.
-%
-\def\domakedefun#1#2#3{%
- \envdef#1{%
- \startdefun
- \doingtypefnfalse % distinguish typed functions from all else
- \parseargusing\activeparens{\printdefunline#3}%
- }%
- \def#2{\dodefunx#1}%
- \def#3%
-}
-
-\newif\ifdoingtypefn % doing typed function?
-\newif\ifrettypeownline % typeset return type on its own line?
-
-% @deftypefnnewline on|off says whether the return type of typed functions
-% are printed on their own line. This affects @deftypefn, @deftypefun,
-% @deftypeop, and @deftypemethod.
-%
-\parseargdef\deftypefnnewline{%
- \def\temp{#1}%
- \ifx\temp\onword
- \expandafter\let\csname SETtxideftypefnnl\endcsname
- = \empty
- \else\ifx\temp\offword
- \expandafter\let\csname SETtxideftypefnnl\endcsname
- = \relax
- \else
- \errhelp = \EMsimple
- \errmessage{Unknown @txideftypefnnl value `\temp',
- must be on|off}%
- \fi\fi
-}
-
-% Untyped functions:
-
-% @deffn category name args
-\makedefun{deffn}{\deffngeneral{}}
-
-% @deffn category class name args
-\makedefun{defop}#1 {\defopon{#1\ \putwordon}}
-
-% \defopon {category on}class name args
-\def\defopon#1#2 {\deffngeneral{\putwordon\ \code{#2}}{#1\ \code{#2}} }
-
-% \deffngeneral {subind}category name args
-%
-\def\deffngeneral#1#2 #3 #4\endheader{%
- % Remember that \dosubind{fn}{foo}{} is equivalent to \doind{fn}{foo}.
- \dosubind{fn}{\code{#3}}{#1}%
- \defname{#2}{}{#3}\magicamp\defunargs{#4\unskip}%
-}
-
-% Typed functions:
-
-% @deftypefn category type name args
-\makedefun{deftypefn}{\deftypefngeneral{}}
-
-% @deftypeop category class type name args
-\makedefun{deftypeop}#1 {\deftypeopon{#1\ \putwordon}}
-
-% \deftypeopon {category on}class type name args
-\def\deftypeopon#1#2 {\deftypefngeneral{\putwordon\ \code{#2}}{#1\ \code{#2}} }
-
-% \deftypefngeneral {subind}category type name args
-%
-\def\deftypefngeneral#1#2 #3 #4 #5\endheader{%
- \dosubind{fn}{\code{#4}}{#1}%
- \doingtypefntrue
- \defname{#2}{#3}{#4}\defunargs{#5\unskip}%
-}
-
-% Typed variables:
-
-% @deftypevr category type var args
-\makedefun{deftypevr}{\deftypecvgeneral{}}
-
-% @deftypecv category class type var args
-\makedefun{deftypecv}#1 {\deftypecvof{#1\ \putwordof}}
-
-% \deftypecvof {category of}class type var args
-\def\deftypecvof#1#2 {\deftypecvgeneral{\putwordof\ \code{#2}}{#1\ \code{#2}} }
-
-% \deftypecvgeneral {subind}category type var args
-%
-\def\deftypecvgeneral#1#2 #3 #4 #5\endheader{%
- \dosubind{vr}{\code{#4}}{#1}%
- \defname{#2}{#3}{#4}\defunargs{#5\unskip}%
-}
-
-% Untyped variables:
-
-% @defvr category var args
-\makedefun{defvr}#1 {\deftypevrheader{#1} {} }
-
-% @defcv category class var args
-\makedefun{defcv}#1 {\defcvof{#1\ \putwordof}}
-
-% \defcvof {category of}class var args
-\def\defcvof#1#2 {\deftypecvof{#1}#2 {} }
-
-% Types:
-
-% @deftp category name args
-\makedefun{deftp}#1 #2 #3\endheader{%
- \doind{tp}{\code{#2}}%
- \defname{#1}{}{#2}\defunargs{#3\unskip}%
-}
-
-% Remaining @defun-like shortcuts:
-\makedefun{defun}{\deffnheader{\putwordDeffunc} }
-\makedefun{defmac}{\deffnheader{\putwordDefmac} }
-\makedefun{defspec}{\deffnheader{\putwordDefspec} }
-\makedefun{deftypefun}{\deftypefnheader{\putwordDeffunc} }
-\makedefun{defvar}{\defvrheader{\putwordDefvar} }
-\makedefun{defopt}{\defvrheader{\putwordDefopt} }
-\makedefun{deftypevar}{\deftypevrheader{\putwordDefvar} }
-\makedefun{defmethod}{\defopon\putwordMethodon}
-\makedefun{deftypemethod}{\deftypeopon\putwordMethodon}
-\makedefun{defivar}{\defcvof\putwordInstanceVariableof}
-\makedefun{deftypeivar}{\deftypecvof\putwordInstanceVariableof}
-
-% \defname, which formats the name of the @def (not the args).
-% #1 is the category, such as "Function".
-% #2 is the return type, if any.
-% #3 is the function name.
-%
-% We are followed by (but not passed) the arguments, if any.
-%
-\def\defname#1#2#3{%
- \par
- % Get the values of \leftskip and \rightskip as they were outside the @def...
- \advance\leftskip by -\defbodyindent
- %
- % Determine if we are typesetting the return type of a typed function
- % on a line by itself.
- \rettypeownlinefalse
- \ifdoingtypefn % doing a typed function specifically?
- % then check user option for putting return type on its own line:
- \expandafter\ifx\csname SETtxideftypefnnl\endcsname\relax \else
- \rettypeownlinetrue
- \fi
- \fi
- %
- % How we'll format the category name. Putting it in brackets helps
- % distinguish it from the body text that may end up on the next line
- % just below it.
- \def\temp{#1}%
- \setbox0=\hbox{\kern\deflastargmargin \ifx\temp\empty\else [\rm\temp]\fi}
- %
- % Figure out line sizes for the paragraph shape. We'll always have at
- % least two.
- \tempnum = 2
- %
- % The first line needs space for \box0; but if \rightskip is nonzero,
- % we need only space for the part of \box0 which exceeds it:
- \dimen0=\hsize \advance\dimen0 by -\wd0 \advance\dimen0 by \rightskip
- %
- % If doing a return type on its own line, we'll have another line.
- \ifrettypeownline
- \advance\tempnum by 1
- \def\maybeshapeline{0in \hsize}%
- \else
- \def\maybeshapeline{}%
- \fi
- %
- % The continuations:
- \dimen2=\hsize \advance\dimen2 by -\defargsindent
- %
- % The final paragraph shape:
- \parshape \tempnum 0in \dimen0 \maybeshapeline \defargsindent \dimen2
- %
- % Put the category name at the right margin.
- \noindent
- \hbox to 0pt{%
- \hfil\box0 \kern-\hsize
- % \hsize has to be shortened this way:
- \kern\leftskip
- % Intentionally do not respect \rightskip, since we need the space.
- }%
- %
- % Allow all lines to be underfull without complaint:
- \tolerance=10000 \hbadness=10000
- \exdentamount=\defbodyindent
- {%
- % defun fonts. We use typewriter by default (used to be bold) because:
- % . we're printing identifiers, they should be in tt in principle.
- % . in languages with many accents, such as Czech or French, it's
- % common to leave accents off identifiers. The result looks ok in
- % tt, but exceedingly strange in rm.
- % . we don't want -- and --- to be treated as ligatures.
- % . this still does not fix the ?` and !` ligatures, but so far no
- % one has made identifiers using them :).
- \df \tt
- \def\temp{#2}% text of the return type
- \ifx\temp\empty\else
- \tclose{\temp}% typeset the return type
- \ifrettypeownline
- % put return type on its own line; prohibit line break following:
- \hfil\vadjust{\nobreak}\break
- \else
- \space % type on same line, so just followed by a space
- \fi
- \fi % no return type
- #3% output function name
- }%
- {\rm\enskip}% hskip 0.5 em of \tenrm
- %
- \boldbrax
- % arguments will be output next, if any.
-}
-
-% Print arguments in slanted roman (not ttsl), inconsistently with using
-% tt for the name. This is because literal text is sometimes needed in
-% the argument list (groff manual), and ttsl and tt are not very
-% distinguishable. Prevent hyphenation at `-' chars.
-%
-\def\defunargs#1{%
- % use sl by default (not ttsl),
- % tt for the names.
- \df \sl \hyphenchar\font=0
- %
- % On the other hand, if an argument has two dashes (for instance), we
- % want a way to get ttsl. We used to recommend @var for that, so
- % leave the code in, but it's strange for @var to lead to typewriter.
- % Nowadays we recommend @code, since the difference between a ttsl hyphen
- % and a tt hyphen is pretty tiny. @code also disables ?` !`.
- \def\var##1{{\setupmarkupstyle{var}\ttslanted{##1}}}%
- #1%
- \sl\hyphenchar\font=45
-}
-
-% We want ()&[] to print specially on the defun line.
-%
-\def\activeparens{%
- \catcode`\(=\active \catcode`\)=\active
- \catcode`\[=\active \catcode`\]=\active
- \catcode`\&=\active
-}
-
-% Make control sequences which act like normal parenthesis chars.
-\let\lparen = ( \let\rparen = )
-
-% Be sure that we always have a definition for `(', etc. For example,
-% if the fn name has parens in it, \boldbrax will not be in effect yet,
-% so TeX would otherwise complain about undefined control sequence.
-{
- \activeparens
- \global\let(=\lparen \global\let)=\rparen
- \global\let[=\lbrack \global\let]=\rbrack
- \global\let& = \&
-
- \gdef\boldbrax{\let(=\opnr\let)=\clnr\let[=\lbrb\let]=\rbrb}
- \gdef\magicamp{\let&=\amprm}
-}
-
-\newcount\parencount
-
-% If we encounter &foo, then turn on ()-hacking afterwards
-\newif\ifampseen
-\def\amprm#1 {\ampseentrue{\bf\&#1 }}
-
-\def\parenfont{%
- \ifampseen
- % At the first level, print parens in roman,
- % otherwise use the default font.
- \ifnum \parencount=1 \rm \fi
- \else
- % The \sf parens (in \boldbrax) actually are a little bolder than
- % the contained text. This is especially needed for [ and ] .
- \sf
- \fi
-}
-\def\infirstlevel#1{%
- \ifampseen
- \ifnum\parencount=1
- #1%
- \fi
- \fi
-}
-\def\bfafterword#1 {#1 \bf}
-
-\def\opnr{%
- \global\advance\parencount by 1
- {\parenfont(}%
- \infirstlevel \bfafterword
-}
-\def\clnr{%
- {\parenfont)}%
- \infirstlevel \sl
- \global\advance\parencount by -1
-}
-
-\newcount\brackcount
-\def\lbrb{%
- \global\advance\brackcount by 1
- {\bf[}%
-}
-\def\rbrb{%
- {\bf]}%
- \global\advance\brackcount by -1
-}
-
-\def\checkparencounts{%
- \ifnum\parencount=0 \else \badparencount \fi
- \ifnum\brackcount=0 \else \badbrackcount \fi
-}
-% these should not use \errmessage; the glibc manual, at least, actually
-% has such constructs (when documenting function pointers).
-\def\badparencount{%
- \message{Warning: unbalanced parentheses in @def...}%
- \global\parencount=0
-}
-\def\badbrackcount{%
- \message{Warning: unbalanced square brackets in @def...}%
- \global\brackcount=0
-}
-
-
-\message{macros,}
-% @macro.
-
-% To do this right we need a feature of e-TeX, \scantokens,
-% which we arrange to emulate with a temporary file in ordinary TeX.
-\ifx\eTeXversion\thisisundefined
- \newwrite\macscribble
- \def\scantokens#1{%
- \toks0={#1}%
- \immediate\openout\macscribble=\jobname.tmp
- \immediate\write\macscribble{\the\toks0}%
- \immediate\closeout\macscribble
- \input \jobname.tmp
- }
-\fi
-
-\def\scanmacro#1{\begingroup
- \newlinechar`\^^M
- \let\xeatspaces\eatspaces
- %
- % Undo catcode changes of \startcontents and \doprintindex
- % When called from @insertcopying or (short)caption, we need active
- % backslash to get it printed correctly. Previously, we had
- % \catcode`\\=\other instead. We'll see whether a problem appears
- % with macro expansion. --kasal, 19aug04
- \catcode`\@=0 \catcode`\\=\active \escapechar=`\@
- %
- % ... and for \example:
- \spaceisspace
- %
- % The \empty here causes a following catcode 5 newline to be eaten as
- % part of reading whitespace after a control sequence. It does not
- % eat a catcode 13 newline. There's no good way to handle the two
- % cases (untried: maybe e-TeX's \everyeof could help, though plain TeX
- % would then have different behavior). See the Macro Details node in
- % the manual for the workaround we recommend for macros and
- % line-oriented commands.
- %
- \scantokens{#1\empty}%
-\endgroup}
-
-\def\scanexp#1{%
- \edef\temp{\noexpand\scanmacro{#1}}%
- \temp
-}
-
-\newcount\paramno % Count of parameters
-\newtoks\macname % Macro name
-\newif\ifrecursive % Is it recursive?
-
-% List of all defined macros in the form
-% \definedummyword\macro1\definedummyword\macro2...
-% Currently is also contains all @aliases; the list can be split
-% if there is a need.
-\def\macrolist{}
-
-% Add the macro to \macrolist
-\def\addtomacrolist#1{\expandafter \addtomacrolistxxx \csname#1\endcsname}
-\def\addtomacrolistxxx#1{%
- \toks0 = \expandafter{\macrolist\definedummyword#1}%
- \xdef\macrolist{\the\toks0}%
-}
-
-% Utility routines.
-% This does \let #1 = #2, with \csnames; that is,
-% \let \csname#1\endcsname = \csname#2\endcsname
-% (except of course we have to play expansion games).
-%
-\def\cslet#1#2{%
- \expandafter\let
- \csname#1\expandafter\endcsname
- \csname#2\endcsname
-}
-
-% Trim leading and trailing spaces off a string.
-% Concepts from aro-bend problem 15 (see CTAN).
-{\catcode`\@=11
-\gdef\eatspaces #1{\expandafter\trim@\expandafter{#1 }}
-\gdef\trim@ #1{\trim@@ @#1 @ #1 @ @@}
-\gdef\trim@@ #1@ #2@ #3@@{\trim@@@\empty #2 @}
-\def\unbrace#1{#1}
-\unbrace{\gdef\trim@@@ #1 } #2@{#1}
-}
-
-% Trim a single trailing ^^M off a string.
-{\catcode`\^^M=\other \catcode`\Q=3%
-\gdef\eatcr #1{\eatcra #1Q^^MQ}%
-\gdef\eatcra#1^^MQ{\eatcrb#1Q}%
-\gdef\eatcrb#1Q#2Q{#1}%
-}
-
-% Macro bodies are absorbed as an argument in a context where
-% all characters are catcode 10, 11 or 12, except \ which is active
-% (as in normal texinfo). It is necessary to change the definition of \
-% to recognize macro arguments; this is the job of \mbodybackslash.
-%
-% Non-ASCII encodings make 8-bit characters active, so un-activate
-% them to avoid their expansion. Must do this non-globally, to
-% confine the change to the current group.
-%
-% It's necessary to have hard CRs when the macro is executed. This is
-% done by making ^^M (\endlinechar) catcode 12 when reading the macro
-% body, and then making it the \newlinechar in \scanmacro.
-%
-\def\scanctxt{% used as subroutine
- \catcode`\"=\other
- \catcode`\+=\other
- \catcode`\<=\other
- \catcode`\>=\other
- \catcode`\@=\other
- \catcode`\^=\other
- \catcode`\_=\other
- \catcode`\|=\other
- \catcode`\~=\other
- \ifx\declaredencoding\ascii \else \setnonasciicharscatcodenonglobal\other \fi
-}
-
-\def\scanargctxt{% used for copying and captions, not macros.
- \scanctxt
- \catcode`\\=\other
- \catcode`\^^M=\other
-}
-
-\def\macrobodyctxt{% used for @macro definitions
- \scanctxt
- \catcode`\{=\other
- \catcode`\}=\other
- \catcode`\^^M=\other
- \usembodybackslash
-}
-
-\def\macroargctxt{% used when scanning invocations
- \scanctxt
- \catcode`\\=0
-}
-% why catcode 0 for \ in the above? To recognize \\ \{ \} as "escapes"
-% for the single characters \ { }. Thus, we end up with the "commands"
-% that would be written @\ @{ @} in a Texinfo document.
-%
-% We already have @{ and @}. For @\, we define it here, and only for
-% this purpose, to produce a typewriter backslash (so, the @\ that we
-% define for @math can't be used with @macro calls):
-%
-\def\\{\normalbackslash}%
-%
-% We would like to do this for \, too, since that is what makeinfo does.
-% But it is not possible, because Texinfo already has a command @, for a
-% cedilla accent. Documents must use @comma{} instead.
-%
-% \anythingelse will almost certainly be an error of some kind.
-
-
-% \mbodybackslash is the definition of \ in @macro bodies.
-% It maps \foo\ => \csname macarg.foo\endcsname => #N
-% where N is the macro parameter number.
-% We define \csname macarg.\endcsname to be \realbackslash, so
-% \\ in macro replacement text gets you a backslash.
-%
-{\catcode`@=0 @catcode`@\=@active
- @gdef@usembodybackslash{@let\=@mbodybackslash}
- @gdef@mbodybackslash#1\{@csname macarg.#1@endcsname}
-}
-\expandafter\def\csname macarg.\endcsname{\realbackslash}
-
-\def\margbackslash#1{\char`\#1 }
-
-\def\macro{\recursivefalse\parsearg\macroxxx}
-\def\rmacro{\recursivetrue\parsearg\macroxxx}
-
-\def\macroxxx#1{%
- \getargs{#1}% now \macname is the macname and \argl the arglist
- \ifx\argl\empty % no arguments
- \paramno=0\relax
- \else
- \expandafter\parsemargdef \argl;%
- \if\paramno>256\relax
- \ifx\eTeXversion\thisisundefined
- \errhelp = \EMsimple
- \errmessage{You need eTeX to compile a file with macros with more than 256 arguments}
- \fi
- \fi
- \fi
- \if1\csname ismacro.\the\macname\endcsname
- \message{Warning: redefining \the\macname}%
- \else
- \expandafter\ifx\csname \the\macname\endcsname \relax
- \else \errmessage{Macro name \the\macname\space already defined}\fi
- \global\cslet{macsave.\the\macname}{\the\macname}%
- \global\expandafter\let\csname ismacro.\the\macname\endcsname=1%
- \addtomacrolist{\the\macname}%
- \fi
- \begingroup \macrobodyctxt
- \ifrecursive \expandafter\parsermacbody
- \else \expandafter\parsemacbody
- \fi}
-
-\parseargdef\unmacro{%
- \if1\csname ismacro.#1\endcsname
- \global\cslet{#1}{macsave.#1}%
- \global\expandafter\let \csname ismacro.#1\endcsname=0%
- % Remove the macro name from \macrolist:
- \begingroup
- \expandafter\let\csname#1\endcsname \relax
- \let\definedummyword\unmacrodo
- \xdef\macrolist{\macrolist}%
- \endgroup
- \else
- \errmessage{Macro #1 not defined}%
- \fi
-}
-
-% Called by \do from \dounmacro on each macro. The idea is to omit any
-% macro definitions that have been changed to \relax.
-%
-\def\unmacrodo#1{%
- \ifx #1\relax
- % remove this
- \else
- \noexpand\definedummyword \noexpand#1%
- \fi
-}
-
-% This makes use of the obscure feature that if the last token of a
-% <parameter list> is #, then the preceding argument is delimited by
-% an opening brace, and that opening brace is not consumed.
-\def\getargs#1{\getargsxxx#1{}}
-\def\getargsxxx#1#{\getmacname #1 \relax\getmacargs}
-\def\getmacname#1 #2\relax{\macname={#1}}
-\def\getmacargs#1{\def\argl{#1}}
-
-% For macro processing make @ a letter so that we can make Texinfo private macro names.
-\edef\texiatcatcode{\the\catcode`\@}
-\catcode `@=11\relax
-
-% Parse the optional {params} list. Set up \paramno and \paramlist
-% so \defmacro knows what to do. Define \macarg.BLAH for each BLAH
-% in the params list to some hook where the argument si to be expanded. If
-% there are less than 10 arguments that hook is to be replaced by ##N where N
-% is the position in that list, that is to say the macro arguments are to be
-% defined `a la TeX in the macro body.
-%
-% That gets used by \mbodybackslash (above).
-%
-% We need to get `macro parameter char #' into several definitions.
-% The technique used is stolen from LaTeX: let \hash be something
-% unexpandable, insert that wherever you need a #, and then redefine
-% it to # just before using the token list produced.
-%
-% The same technique is used to protect \eatspaces till just before
-% the macro is used.
-%
-% If there are 10 or more arguments, a different technique is used, where the
-% hook remains in the body, and when macro is to be expanded the body is
-% processed again to replace the arguments.
-%
-% In that case, the hook is \the\toks N-1, and we simply set \toks N-1 to the
-% argument N value and then \edef the body (nothing else will expand because of
-% the catcode regime underwhich the body was input).
-%
-% If you compile with TeX (not eTeX), and you have macros with 10 or more
-% arguments, you need that no macro has more than 256 arguments, otherwise an
-% error is produced.
-\def\parsemargdef#1;{%
- \paramno=0\def\paramlist{}%
- \let\hash\relax
- \let\xeatspaces\relax
- \parsemargdefxxx#1,;,%
- % In case that there are 10 or more arguments we parse again the arguments
- % list to set new definitions for the \macarg.BLAH macros corresponding to
- % each BLAH argument. It was anyhow needed to parse already once this list
- % in order to count the arguments, and as macros with at most 9 arguments
- % are by far more frequent than macro with 10 or more arguments, defining
- % twice the \macarg.BLAH macros does not cost too much processing power.
- \ifnum\paramno<10\relax\else
- \paramno0\relax
- \parsemmanyargdef@@#1,;,% 10 or more arguments
- \fi
-}
-\def\parsemargdefxxx#1,{%
- \if#1;\let\next=\relax
- \else \let\next=\parsemargdefxxx
- \advance\paramno by 1
- \expandafter\edef\csname macarg.\eatspaces{#1}\endcsname
- {\xeatspaces{\hash\the\paramno}}%
- \edef\paramlist{\paramlist\hash\the\paramno,}%
- \fi\next}
-
-\def\parsemmanyargdef@@#1,{%
- \if#1;\let\next=\relax
- \else
- \let\next=\parsemmanyargdef@@
- \edef\tempb{\eatspaces{#1}}%
- \expandafter\def\expandafter\tempa
- \expandafter{\csname macarg.\tempb\endcsname}%
- % Note that we need some extra \noexpand\noexpand, this is because we
- % don't want \the to be expanded in the \parsermacbody as it uses an
- % \xdef .
- \expandafter\edef\tempa
- {\noexpand\noexpand\noexpand\the\toks\the\paramno}%
- \advance\paramno by 1\relax
- \fi\next}
-
-% These two commands read recursive and nonrecursive macro bodies.
-% (They're different since rec and nonrec macros end differently.)
-%
-
-\catcode `\@\texiatcatcode
-\long\def\parsemacbody#1@end macro%
-{\xdef\temp{\eatcr{#1}}\endgroup\defmacro}%
-\long\def\parsermacbody#1@end rmacro%
-{\xdef\temp{\eatcr{#1}}\endgroup\defmacro}%
-\catcode `\@=11\relax
-
-\let\endargs@\relax
-\let\nil@\relax
-\def\nilm@{\nil@}%
-\long\def\nillm@{\nil@}%
-
-% This macro is expanded during the Texinfo macro expansion, not during its
-% definition. It gets all the arguments values and assigns them to macros
-% macarg.ARGNAME
-%
-% #1 is the macro name
-% #2 is the list of argument names
-% #3 is the list of argument values
-\def\getargvals@#1#2#3{%
- \def\macargdeflist@{}%
- \def\saveparamlist@{#2}% Need to keep a copy for parameter expansion.
- \def\paramlist{#2,\nil@}%
- \def\macroname{#1}%
- \begingroup
- \macroargctxt
- \def\argvaluelist{#3,\nil@}%
- \def\@tempa{#3}%
- \ifx\@tempa\empty
- \setemptyargvalues@
- \else
- \getargvals@@
- \fi
-}
-
-%
-\def\getargvals@@{%
- \ifx\paramlist\nilm@
- % Some sanity check needed here that \argvaluelist is also empty.
- \ifx\argvaluelist\nillm@
- \else
- \errhelp = \EMsimple
- \errmessage{Too many arguments in macro `\macroname'!}%
- \fi
- \let\next\macargexpandinbody@
- \else
- \ifx\argvaluelist\nillm@
- % No more arguments values passed to macro. Set remaining named-arg
- % macros to empty.
- \let\next\setemptyargvalues@
- \else
- % pop current arg name into \@tempb
- \def\@tempa##1{\pop@{\@tempb}{\paramlist}##1\endargs@}%
- \expandafter\@tempa\expandafter{\paramlist}%
- % pop current argument value into \@tempc
- \def\@tempa##1{\longpop@{\@tempc}{\argvaluelist}##1\endargs@}%
- \expandafter\@tempa\expandafter{\argvaluelist}%
- % Here \@tempb is the current arg name and \@tempc is the current arg value.
- % First place the new argument macro definition into \@tempd
- \expandafter\macname\expandafter{\@tempc}%
- \expandafter\let\csname macarg.\@tempb\endcsname\relax
- \expandafter\def\expandafter\@tempe\expandafter{%
- \csname macarg.\@tempb\endcsname}%
- \edef\@tempd{\long\def\@tempe{\the\macname}}%
- \push@\@tempd\macargdeflist@
- \let\next\getargvals@@
- \fi
- \fi
- \next
-}
-
-\def\push@#1#2{%
- \expandafter\expandafter\expandafter\def
- \expandafter\expandafter\expandafter#2%
- \expandafter\expandafter\expandafter{%
- \expandafter#1#2}%
-}
-
-% Replace arguments by their values in the macro body, and place the result
-% in macro \@tempa
-\def\macvalstoargs@{%
- % To do this we use the property that token registers that are \the'ed
- % within an \edef expand only once. So we are going to place all argument
- % values into respective token registers.
- %
- % First we save the token context, and initialize argument numbering.
- \begingroup
- \paramno0\relax
- % Then, for each argument number #N, we place the corresponding argument
- % value into a new token list register \toks#N
- \expandafter\putargsintokens@\saveparamlist@,;,%
- % Then, we expand the body so that argument are replaced by their
- % values. The trick for values not to be expanded themselves is that they
- % are within tokens and that tokens expand only once in an \edef .
- \edef\@tempc{\csname mac.\macroname .body\endcsname}%
- % Now we restore the token stack pointer to free the token list registers
- % which we have used, but we make sure that expanded body is saved after
- % group.
- \expandafter
- \endgroup
- \expandafter\def\expandafter\@tempa\expandafter{\@tempc}%
- }
-
-\def\macargexpandinbody@{%
- %% Define the named-macro outside of this group and then close this group.
- \expandafter
- \endgroup
- \macargdeflist@
- % First the replace in body the macro arguments by their values, the result
- % is in \@tempa .
- \macvalstoargs@
- % Then we point at the \norecurse or \gobble (for recursive) macro value
- % with \@tempb .
- \expandafter\let\expandafter\@tempb\csname mac.\macroname .recurse\endcsname
- % Depending on whether it is recursive or not, we need some tailing
- % \egroup .
- \ifx\@tempb\gobble
- \let\@tempc\relax
- \else
- \let\@tempc\egroup
- \fi
- % And now we do the real job:
- \edef\@tempd{\noexpand\@tempb{\macroname}\noexpand\scanmacro{\@tempa}\@tempc}%
- \@tempd
-}
-
-\def\putargsintokens@#1,{%
- \if#1;\let\next\relax
- \else
- \let\next\putargsintokens@
- % First we allocate the new token list register, and give it a temporary
- % alias \@tempb .
- \toksdef\@tempb\the\paramno
- % Then we place the argument value into that token list register.
- \expandafter\let\expandafter\@tempa\csname macarg.#1\endcsname
- \expandafter\@tempb\expandafter{\@tempa}%
- \advance\paramno by 1\relax
- \fi
- \next
-}
-
-% Save the token stack pointer into macro #1
-\def\texisavetoksstackpoint#1{\edef#1{\the\@cclvi}}
-% Restore the token stack pointer from number in macro #1
-\def\texirestoretoksstackpoint#1{\expandafter\mathchardef\expandafter\@cclvi#1\relax}
-% newtoks that can be used non \outer .
-\def\texinonouternewtoks{\alloc@ 5\toks \toksdef \@cclvi}
-
-% Tailing missing arguments are set to empty
-\def\setemptyargvalues@{%
- \ifx\paramlist\nilm@
- \let\next\macargexpandinbody@
- \else
- \expandafter\setemptyargvaluesparser@\paramlist\endargs@
- \let\next\setemptyargvalues@
- \fi
- \next
-}
-
-\def\setemptyargvaluesparser@#1,#2\endargs@{%
- \expandafter\def\expandafter\@tempa\expandafter{%
- \expandafter\def\csname macarg.#1\endcsname{}}%
- \push@\@tempa\macargdeflist@
- \def\paramlist{#2}%
-}
-
-% #1 is the element target macro
-% #2 is the list macro
-% #3,#4\endargs@ is the list value
-\def\pop@#1#2#3,#4\endargs@{%
- \def#1{#3}%
- \def#2{#4}%
-}
-\long\def\longpop@#1#2#3,#4\endargs@{%
- \long\def#1{#3}%
- \long\def#2{#4}%
-}
-
-% This defines a Texinfo @macro. There are eight cases: recursive and
-% nonrecursive macros of zero, one, up to nine, and many arguments.
-% Much magic with \expandafter here.
-% \xdef is used so that macro definitions will survive the file
-% they're defined in; @include reads the file inside a group.
-%
-\def\defmacro{%
- \let\hash=##% convert placeholders to macro parameter chars
- \ifrecursive
- \ifcase\paramno
- % 0
- \expandafter\xdef\csname\the\macname\endcsname{%
- \noexpand\scanmacro{\temp}}%
- \or % 1
- \expandafter\xdef\csname\the\macname\endcsname{%
- \bgroup\noexpand\macroargctxt
- \noexpand\braceorline
- \expandafter\noexpand\csname\the\macname xxx\endcsname}%
- \expandafter\xdef\csname\the\macname xxx\endcsname##1{%
- \egroup\noexpand\scanmacro{\temp}}%
- \else
- \ifnum\paramno<10\relax % at most 9
- \expandafter\xdef\csname\the\macname\endcsname{%
- \bgroup\noexpand\macroargctxt
- \noexpand\csname\the\macname xx\endcsname}%
- \expandafter\xdef\csname\the\macname xx\endcsname##1{%
- \expandafter\noexpand\csname\the\macname xxx\endcsname ##1,}%
- \expandafter\expandafter
- \expandafter\xdef
- \expandafter\expandafter
- \csname\the\macname xxx\endcsname
- \paramlist{\egroup\noexpand\scanmacro{\temp}}%
- \else % 10 or more
- \expandafter\xdef\csname\the\macname\endcsname{%
- \noexpand\getargvals@{\the\macname}{\argl}%
- }%
- \global\expandafter\let\csname mac.\the\macname .body\endcsname\temp
- \global\expandafter\let\csname mac.\the\macname .recurse\endcsname\gobble
- \fi
- \fi
- \else
- \ifcase\paramno
- % 0
- \expandafter\xdef\csname\the\macname\endcsname{%
- \noexpand\norecurse{\the\macname}%
- \noexpand\scanmacro{\temp}\egroup}%
- \or % 1
- \expandafter\xdef\csname\the\macname\endcsname{%
- \bgroup\noexpand\macroargctxt
- \noexpand\braceorline
- \expandafter\noexpand\csname\the\macname xxx\endcsname}%
- \expandafter\xdef\csname\the\macname xxx\endcsname##1{%
- \egroup
- \noexpand\norecurse{\the\macname}%
- \noexpand\scanmacro{\temp}\egroup}%
- \else % at most 9
- \ifnum\paramno<10\relax
- \expandafter\xdef\csname\the\macname\endcsname{%
- \bgroup\noexpand\macroargctxt
- \expandafter\noexpand\csname\the\macname xx\endcsname}%
- \expandafter\xdef\csname\the\macname xx\endcsname##1{%
- \expandafter\noexpand\csname\the\macname xxx\endcsname ##1,}%
- \expandafter\expandafter
- \expandafter\xdef
- \expandafter\expandafter
- \csname\the\macname xxx\endcsname
- \paramlist{%
- \egroup
- \noexpand\norecurse{\the\macname}%
- \noexpand\scanmacro{\temp}\egroup}%
- \else % 10 or more:
- \expandafter\xdef\csname\the\macname\endcsname{%
- \noexpand\getargvals@{\the\macname}{\argl}%
- }%
- \global\expandafter\let\csname mac.\the\macname .body\endcsname\temp
- \global\expandafter\let\csname mac.\the\macname .recurse\endcsname\norecurse
- \fi
- \fi
- \fi}
-
-\catcode `\@\texiatcatcode\relax
-
-\def\norecurse#1{\bgroup\cslet{#1}{macsave.#1}}
-
-% \braceorline decides whether the next nonwhitespace character is a
-% {. If so it reads up to the closing }, if not, it reads the whole
-% line. Whatever was read is then fed to the next control sequence
-% as an argument (by \parsebrace or \parsearg).
-%
-\def\braceorline#1{\let\macnamexxx=#1\futurelet\nchar\braceorlinexxx}
-\def\braceorlinexxx{%
- \ifx\nchar\bgroup\else
- \expandafter\parsearg
- \fi \macnamexxx}
-
-
-% @alias.
-% We need some trickery to remove the optional spaces around the equal
-% sign. Make them active and then expand them all to nothing.
-%
-\def\alias{\parseargusing\obeyspaces\aliasxxx}
-\def\aliasxxx #1{\aliasyyy#1\relax}
-\def\aliasyyy #1=#2\relax{%
- {%
- \expandafter\let\obeyedspace=\empty
- \addtomacrolist{#1}%
- \xdef\next{\global\let\makecsname{#1}=\makecsname{#2}}%
- }%
- \next
-}
-
-
-\message{cross references,}
-
-\newwrite\auxfile
-\newif\ifhavexrefs % True if xref values are known.
-\newif\ifwarnedxrefs % True if we warned once that they aren't known.
-
-% @inforef is relatively simple.
-\def\inforef #1{\inforefzzz #1,,,,**}
-\def\inforefzzz #1,#2,#3,#4**{%
- \putwordSee{} \putwordInfo{} \putwordfile{} \file{\ignorespaces #3{}},
- node \samp{\ignorespaces#1{}}}
-
-% @node's only job in TeX is to define \lastnode, which is used in
-% cross-references. The @node line might or might not have commas, and
-% might or might not have spaces before the first comma, like:
-% @node foo , bar , ...
-% We don't want such trailing spaces in the node name.
-%
-\parseargdef\node{\checkenv{}\donode #1 ,\finishnodeparse}
-%
-% also remove a trailing comma, in case of something like this:
-% @node Help-Cross, , , Cross-refs
-\def\donode#1 ,#2\finishnodeparse{\dodonode #1,\finishnodeparse}
-\def\dodonode#1,#2\finishnodeparse{\gdef\lastnode{#1}}
-
-\let\nwnode=\node
-\let\lastnode=\empty
-
-% Write a cross-reference definition for the current node. #1 is the
-% type (Ynumbered, Yappendix, Ynothing).
-%
-\def\donoderef#1{%
- \ifx\lastnode\empty\else
- \setref{\lastnode}{#1}%
- \global\let\lastnode=\empty
- \fi
-}
-
-% @anchor{NAME} -- define xref target at arbitrary point.
-%
-\newcount\savesfregister
-%
-\def\savesf{\relax \ifhmode \savesfregister=\spacefactor \fi}
-\def\restoresf{\relax \ifhmode \spacefactor=\savesfregister \fi}
-\def\anchor#1{\savesf \setref{#1}{Ynothing}\restoresf \ignorespaces}
-
-% \setref{NAME}{SNT} defines a cross-reference point NAME (a node or an
-% anchor), which consists of three parts:
-% 1) NAME-title - the current sectioning name taken from \lastsection,
-% or the anchor name.
-% 2) NAME-snt - section number and type, passed as the SNT arg, or
-% empty for anchors.
-% 3) NAME-pg - the page number.
-%
-% This is called from \donoderef, \anchor, and \dofloat. In the case of
-% floats, there is an additional part, which is not written here:
-% 4) NAME-lof - the text as it should appear in a @listoffloats.
-%
-\def\setref#1#2{%
- \pdfmkdest{#1}%
- \iflinks
- {%
- \atdummies % preserve commands, but don't expand them
- \edef\writexrdef##1##2{%
- \write\auxfile{@xrdef{#1-% #1 of \setref, expanded by the \edef
- ##1}{##2}}% these are parameters of \writexrdef
- }%
- \toks0 = \expandafter{\lastsection}%
- \immediate \writexrdef{title}{\the\toks0 }%
- \immediate \writexrdef{snt}{\csname #2\endcsname}% \Ynumbered etc.
- \safewhatsit{\writexrdef{pg}{\folio}}% will be written later, at \shipout
- }%
- \fi
-}
-
-% @xrefautosectiontitle on|off says whether @section(ing) names are used
-% automatically in xrefs, if the third arg is not explicitly specified.
-% This was provided as a "secret" @set xref-automatic-section-title
-% variable, now it's official.
-%
-\parseargdef\xrefautomaticsectiontitle{%
- \def\temp{#1}%
- \ifx\temp\onword
- \expandafter\let\csname SETxref-automatic-section-title\endcsname
- = \empty
- \else\ifx\temp\offword
- \expandafter\let\csname SETxref-automatic-section-title\endcsname
- = \relax
- \else
- \errhelp = \EMsimple
- \errmessage{Unknown @xrefautomaticsectiontitle value `\temp',
- must be on|off}%
- \fi\fi
-}
-
-%
-% @xref, @pxref, and @ref generate cross-references. For \xrefX, #1 is
-% the node name, #2 the name of the Info cross-reference, #3 the printed
-% node name, #4 the name of the Info file, #5 the name of the printed
-% manual. All but the node name can be omitted.
-%
-\def\pxref#1{\putwordsee{} \xrefX[#1,,,,,,,]}
-\def\xref#1{\putwordSee{} \xrefX[#1,,,,,,,]}
-\def\ref#1{\xrefX[#1,,,,,,,]}
-%
-\newbox\toprefbox
-\newbox\printedrefnamebox
-\newbox\infofilenamebox
-\newbox\printedmanualbox
-%
-\def\xrefX[#1,#2,#3,#4,#5,#6]{\begingroup
- \unsepspaces
- %
- % Get args without leading/trailing spaces.
- \def\printedrefname{\ignorespaces #3}%
- \setbox\printedrefnamebox = \hbox{\printedrefname\unskip}%
- %
- \def\infofilename{\ignorespaces #4}%
- \setbox\infofilenamebox = \hbox{\infofilename\unskip}%
- %
- \def\printedmanual{\ignorespaces #5}%
- \setbox\printedmanualbox = \hbox{\printedmanual\unskip}%
- %
- % If the printed reference name (arg #3) was not explicitly given in
- % the @xref, figure out what we want to use.
- \ifdim \wd\printedrefnamebox = 0pt
- % No printed node name was explicitly given.
- \expandafter\ifx\csname SETxref-automatic-section-title\endcsname \relax
- % Not auto section-title: use node name inside the square brackets.
- \def\printedrefname{\ignorespaces #1}%
- \else
- % Auto section-title: use chapter/section title inside
- % the square brackets if we have it.
- \ifdim \wd\printedmanualbox > 0pt
- % It is in another manual, so we don't have it; use node name.
- \def\printedrefname{\ignorespaces #1}%
- \else
- \ifhavexrefs
- % We (should) know the real title if we have the xref values.
- \def\printedrefname{\refx{#1-title}{}}%
- \else
- % Otherwise just copy the Info node name.
- \def\printedrefname{\ignorespaces #1}%
- \fi%
- \fi
- \fi
- \fi
- %
- % Make link in pdf output.
- \ifpdf
- {\indexnofonts
- \turnoffactive
- \makevalueexpandable
- % This expands tokens, so do it after making catcode changes, so _
- % etc. don't get their TeX definitions. This ignores all spaces in
- % #4, including (wrongly) those in the middle of the filename.
- \getfilename{#4}%
- %
- % This (wrongly) does not take account of leading or trailing
- % spaces in #1, which should be ignored.
- \edef\pdfxrefdest{#1}%
- \ifx\pdfxrefdest\empty
- \def\pdfxrefdest{Top}% no empty targets
- \else
- \txiescapepdf\pdfxrefdest % escape PDF special chars
- \fi
- %
- \leavevmode
- \startlink attr{/Border [0 0 0]}%
- \ifnum\filenamelength>0
- goto file{\the\filename.pdf} name{\pdfxrefdest}%
- \else
- goto name{\pdfmkpgn{\pdfxrefdest}}%
- \fi
- }%
- \setcolor{\linkcolor}%
- \fi
- %
- % Float references are printed completely differently: "Figure 1.2"
- % instead of "[somenode], p.3". We distinguish them by the
- % LABEL-title being set to a magic string.
- {%
- % Have to otherify everything special to allow the \csname to
- % include an _ in the xref name, etc.
- \indexnofonts
- \turnoffactive
- \expandafter\global\expandafter\let\expandafter\Xthisreftitle
- \csname XR#1-title\endcsname
- }%
- \iffloat\Xthisreftitle
- % If the user specified the print name (third arg) to the ref,
- % print it instead of our usual "Figure 1.2".
- \ifdim\wd\printedrefnamebox = 0pt
- \refx{#1-snt}{}%
- \else
- \printedrefname
- \fi
- %
- % If the user also gave the printed manual name (fifth arg), append
- % "in MANUALNAME".
- \ifdim \wd\printedmanualbox > 0pt
- \space \putwordin{} \cite{\printedmanual}%
- \fi
- \else
- % node/anchor (non-float) references.
- %
- % If we use \unhbox to print the node names, TeX does not insert
- % empty discretionaries after hyphens, which means that it will not
- % find a line break at a hyphen in a node names. Since some manuals
- % are best written with fairly long node names, containing hyphens,
- % this is a loss. Therefore, we give the text of the node name
- % again, so it is as if TeX is seeing it for the first time.
- %
- \ifdim \wd\printedmanualbox > 0pt
- % Cross-manual reference with a printed manual name.
- %
- \crossmanualxref{\cite{\printedmanual\unskip}}%
- %
- \else\ifdim \wd\infofilenamebox > 0pt
- % Cross-manual reference with only an info filename (arg 4), no
- % printed manual name (arg 5). This is essentially the same as
- % the case above; we output the filename, since we have nothing else.
- %
- \crossmanualxref{\code{\infofilename\unskip}}%
- %
- \else
- % Reference within this manual.
- %
- % _ (for example) has to be the character _ for the purposes of the
- % control sequence corresponding to the node, but it has to expand
- % into the usual \leavevmode...\vrule stuff for purposes of
- % printing. So we \turnoffactive for the \refx-snt, back on for the
- % printing, back off for the \refx-pg.
- {\turnoffactive
- % Only output a following space if the -snt ref is nonempty; for
- % @unnumbered and @anchor, it won't be.
- \setbox2 = \hbox{\ignorespaces \refx{#1-snt}{}}%
- \ifdim \wd2 > 0pt \refx{#1-snt}\space\fi
- }%
- % output the `[mynode]' via the macro below so it can be overridden.
- \xrefprintnodename\printedrefname
- %
- % But we always want a comma and a space:
- ,\space
- %
- % output the `page 3'.
- \turnoffactive \putwordpage\tie\refx{#1-pg}{}%
- \fi\fi
- \fi
- \endlink
-\endgroup}
-
-% Output a cross-manual xref to #1. Used just above (twice).
-%
-% Only include the text "Section ``foo'' in" if the foo is neither
-% missing or Top. Thus, @xref{,,,foo,The Foo Manual} outputs simply
-% "see The Foo Manual", the idea being to refer to the whole manual.
-%
-% But, this being TeX, we can't easily compare our node name against the
-% string "Top" while ignoring the possible spaces before and after in
-% the input. By adding the arbitrary 7sp below, we make it much less
-% likely that a real node name would have the same width as "Top" (e.g.,
-% in a monospaced font). Hopefully it will never happen in practice.
-%
-% For the same basic reason, we retypeset the "Top" at every
-% reference, since the current font is indeterminate.
-%
-\def\crossmanualxref#1{%
- \setbox\toprefbox = \hbox{Top\kern7sp}%
- \setbox2 = \hbox{\ignorespaces \printedrefname \unskip \kern7sp}%
- \ifdim \wd2 > 7sp % nonempty?
- \ifdim \wd2 = \wd\toprefbox \else % same as Top?
- \putwordSection{} ``\printedrefname'' \putwordin{}\space
- \fi
- \fi
- #1%
-}
-
-% This macro is called from \xrefX for the `[nodename]' part of xref
-% output. It's a separate macro only so it can be changed more easily,
-% since square brackets don't work well in some documents. Particularly
-% one that Bob is working on :).
-%
-\def\xrefprintnodename#1{[#1]}
-
-% Things referred to by \setref.
-%
-\def\Ynothing{}
-\def\Yomitfromtoc{}
-\def\Ynumbered{%
- \ifnum\secno=0
- \putwordChapter@tie \the\chapno
- \else \ifnum\subsecno=0
- \putwordSection@tie \the\chapno.\the\secno
- \else \ifnum\subsubsecno=0
- \putwordSection@tie \the\chapno.\the\secno.\the\subsecno
- \else
- \putwordSection@tie \the\chapno.\the\secno.\the\subsecno.\the\subsubsecno
- \fi\fi\fi
-}
-\def\Yappendix{%
- \ifnum\secno=0
- \putwordAppendix@tie @char\the\appendixno{}%
- \else \ifnum\subsecno=0
- \putwordSection@tie @char\the\appendixno.\the\secno
- \else \ifnum\subsubsecno=0
- \putwordSection@tie @char\the\appendixno.\the\secno.\the\subsecno
- \else
- \putwordSection@tie
- @char\the\appendixno.\the\secno.\the\subsecno.\the\subsubsecno
- \fi\fi\fi
-}
-
-% Define \refx{NAME}{SUFFIX} to reference a cross-reference string named NAME.
-% If its value is nonempty, SUFFIX is output afterward.
-%
-\def\refx#1#2{%
- {%
- \indexnofonts
- \otherbackslash
- \expandafter\global\expandafter\let\expandafter\thisrefX
- \csname XR#1\endcsname
- }%
- \ifx\thisrefX\relax
- % If not defined, say something at least.
- \angleleft un\-de\-fined\angleright
- \iflinks
- \ifhavexrefs
- {\toks0 = {#1}% avoid expansion of possibly-complex value
- \message{\linenumber Undefined cross reference `\the\toks0'.}}%
- \else
- \ifwarnedxrefs\else
- \global\warnedxrefstrue
- \message{Cross reference values unknown; you must run TeX again.}%
- \fi
- \fi
- \fi
- \else
- % It's defined, so just use it.
- \thisrefX
- \fi
- #2% Output the suffix in any case.
-}
-
-% This is the macro invoked by entries in the aux file. Usually it's
-% just a \def (we prepend XR to the control sequence name to avoid
-% collisions). But if this is a float type, we have more work to do.
-%
-\def\xrdef#1#2{%
- {% The node name might contain 8-bit characters, which in our current
- % implementation are changed to commands like @'e. Don't let these
- % mess up the control sequence name.
- \indexnofonts
- \turnoffactive
- \xdef\safexrefname{#1}%
- }%
- %
- \expandafter\gdef\csname XR\safexrefname\endcsname{#2}% remember this xref
- %
- % Was that xref control sequence that we just defined for a float?
- \expandafter\iffloat\csname XR\safexrefname\endcsname
- % it was a float, and we have the (safe) float type in \iffloattype.
- \expandafter\let\expandafter\floatlist
- \csname floatlist\iffloattype\endcsname
- %
- % Is this the first time we've seen this float type?
- \expandafter\ifx\floatlist\relax
- \toks0 = {\do}% yes, so just \do
- \else
- % had it before, so preserve previous elements in list.
- \toks0 = \expandafter{\floatlist\do}%
- \fi
- %
- % Remember this xref in the control sequence \floatlistFLOATTYPE,
- % for later use in \listoffloats.
- \expandafter\xdef\csname floatlist\iffloattype\endcsname{\the\toks0
- {\safexrefname}}%
- \fi
-}
-
-% Read the last existing aux file, if any. No error if none exists.
-%
-\def\tryauxfile{%
- \openin 1 \jobname.aux
- \ifeof 1 \else
- \readdatafile{aux}%
- \global\havexrefstrue
- \fi
- \closein 1
-}
-
-\def\setupdatafile{%
- \catcode`\^^@=\other
- \catcode`\^^A=\other
- \catcode`\^^B=\other
- \catcode`\^^C=\other
- \catcode`\^^D=\other
- \catcode`\^^E=\other
- \catcode`\^^F=\other
- \catcode`\^^G=\other
- \catcode`\^^H=\other
- \catcode`\^^K=\other
- \catcode`\^^L=\other
- \catcode`\^^N=\other
- \catcode`\^^P=\other
- \catcode`\^^Q=\other
- \catcode`\^^R=\other
- \catcode`\^^S=\other
- \catcode`\^^T=\other
- \catcode`\^^U=\other
- \catcode`\^^V=\other
- \catcode`\^^W=\other
- \catcode`\^^X=\other
- \catcode`\^^Z=\other
- \catcode`\^^[=\other
- \catcode`\^^\=\other
- \catcode`\^^]=\other
- \catcode`\^^^=\other
- \catcode`\^^_=\other
- % It was suggested to set the catcode of ^ to 7, which would allow ^^e4 etc.
- % in xref tags, i.e., node names. But since ^^e4 notation isn't
- % supported in the main text, it doesn't seem desirable. Furthermore,
- % that is not enough: for node names that actually contain a ^
- % character, we would end up writing a line like this: 'xrdef {'hat
- % b-title}{'hat b} and \xrdef does a \csname...\endcsname on the first
- % argument, and \hat is not an expandable control sequence. It could
- % all be worked out, but why? Either we support ^^ or we don't.
- %
- % The other change necessary for this was to define \auxhat:
- % \def\auxhat{\def^{'hat }}% extra space so ok if followed by letter
- % and then to call \auxhat in \setq.
- %
- \catcode`\^=\other
- %
- % Special characters. Should be turned off anyway, but...
- \catcode`\~=\other
- \catcode`\[=\other
- \catcode`\]=\other
- \catcode`\"=\other
- \catcode`\_=\other
- \catcode`\|=\other
- \catcode`\<=\other
- \catcode`\>=\other
- \catcode`\$=\other
- \catcode`\#=\other
- \catcode`\&=\other
- \catcode`\%=\other
- \catcode`+=\other % avoid \+ for paranoia even though we've turned it off
- %
- % This is to support \ in node names and titles, since the \
- % characters end up in a \csname. It's easier than
- % leaving it active and making its active definition an actual \
- % character. What I don't understand is why it works in the *value*
- % of the xrdef. Seems like it should be a catcode12 \, and that
- % should not typeset properly. But it works, so I'm moving on for
- % now. --karl, 15jan04.
- \catcode`\\=\other
- %
- % Make the characters 128-255 be printing characters.
- {%
- \count1=128
- \def\loop{%
- \catcode\count1=\other
- \advance\count1 by 1
- \ifnum \count1<256 \loop \fi
- }%
- }%
- %
- % @ is our escape character in .aux files, and we need braces.
- \catcode`\{=1
- \catcode`\}=2
- \catcode`\@=0
-}
-
-\def\readdatafile#1{%
-\begingroup
- \setupdatafile
- \input\jobname.#1
-\endgroup}
-
-
-\message{insertions,}
-% including footnotes.
-
-\newcount \footnoteno
-
-% The trailing space in the following definition for supereject is
-% vital for proper filling; pages come out unaligned when you do a
-% pagealignmacro call if that space before the closing brace is
-% removed. (Generally, numeric constants should always be followed by a
-% space to prevent strange expansion errors.)
-\def\supereject{\par\penalty -20000\footnoteno =0 }
-
-% @footnotestyle is meaningful for Info output only.
-\let\footnotestyle=\comment
-
-{\catcode `\@=11
-%
-% Auto-number footnotes. Otherwise like plain.
-\gdef\footnote{%
- \let\indent=\ptexindent
- \let\noindent=\ptexnoindent
- \global\advance\footnoteno by \@ne
- \edef\thisfootno{$^{\the\footnoteno}$}%
- %
- % In case the footnote comes at the end of a sentence, preserve the
- % extra spacing after we do the footnote number.
- \let\@sf\empty
- \ifhmode\edef\@sf{\spacefactor\the\spacefactor}\ptexslash\fi
- %
- % Remove inadvertent blank space before typesetting the footnote number.
- \unskip
- \thisfootno\@sf
- \dofootnote
-}%
-
-% Don't bother with the trickery in plain.tex to not require the
-% footnote text as a parameter. Our footnotes don't need to be so general.
-%
-% Oh yes, they do; otherwise, @ifset (and anything else that uses
-% \parseargline) fails inside footnotes because the tokens are fixed when
-% the footnote is read. --karl, 16nov96.
-%
-\gdef\dofootnote{%
- \insert\footins\bgroup
- % We want to typeset this text as a normal paragraph, even if the
- % footnote reference occurs in (for example) a display environment.
- % So reset some parameters.
- \hsize=\pagewidth
- \interlinepenalty\interfootnotelinepenalty
- \splittopskip\ht\strutbox % top baseline for broken footnotes
- \splitmaxdepth\dp\strutbox
- \floatingpenalty\@MM
- \leftskip\z@skip
- \rightskip\z@skip
- \spaceskip\z@skip
- \xspaceskip\z@skip
- \parindent\defaultparindent
- %
- \smallfonts \rm
- %
- % Because we use hanging indentation in footnotes, a @noindent appears
- % to exdent this text, so make it be a no-op. makeinfo does not use
- % hanging indentation so @noindent can still be needed within footnote
- % text after an @example or the like (not that this is good style).
- \let\noindent = \relax
- %
- % Hang the footnote text off the number. Use \everypar in case the
- % footnote extends for more than one paragraph.
- \everypar = {\hang}%
- \textindent{\thisfootno}%
- %
- % Don't crash into the line above the footnote text. Since this
- % expands into a box, it must come within the paragraph, lest it
- % provide a place where TeX can split the footnote.
- \footstrut
- %
- % Invoke rest of plain TeX footnote routine.
- \futurelet\next\fo@t
-}
-}%end \catcode `\@=11
-
-% In case a @footnote appears in a vbox, save the footnote text and create
-% the real \insert just after the vbox finished. Otherwise, the insertion
-% would be lost.
-% Similarly, if a @footnote appears inside an alignment, save the footnote
-% text to a box and make the \insert when a row of the table is finished.
-% And the same can be done for other insert classes. --kasal, 16nov03.
-
-% Replace the \insert primitive by a cheating macro.
-% Deeper inside, just make sure that the saved insertions are not spilled
-% out prematurely.
-%
-\def\startsavinginserts{%
- \ifx \insert\ptexinsert
- \let\insert\saveinsert
- \else
- \let\checkinserts\relax
- \fi
-}
-
-% This \insert replacement works for both \insert\footins{foo} and
-% \insert\footins\bgroup foo\egroup, but it doesn't work for \insert27{foo}.
-%
-\def\saveinsert#1{%
- \edef\next{\noexpand\savetobox \makeSAVEname#1}%
- \afterassignment\next
- % swallow the left brace
- \let\temp =
-}
-\def\makeSAVEname#1{\makecsname{SAVE\expandafter\gobble\string#1}}
-\def\savetobox#1{\global\setbox#1 = \vbox\bgroup \unvbox#1}
-
-\def\checksaveins#1{\ifvoid#1\else \placesaveins#1\fi}
-
-\def\placesaveins#1{%
- \ptexinsert \csname\expandafter\gobblesave\string#1\endcsname
- {\box#1}%
-}
-
-% eat @SAVE -- beware, all of them have catcode \other:
-{
- \def\dospecials{\do S\do A\do V\do E} \uncatcodespecials % ;-)
- \gdef\gobblesave @SAVE{}
-}
-
-% initialization:
-\def\newsaveins #1{%
- \edef\next{\noexpand\newsaveinsX \makeSAVEname#1}%
- \next
-}
-\def\newsaveinsX #1{%
- \csname newbox\endcsname #1%
- \expandafter\def\expandafter\checkinserts\expandafter{\checkinserts
- \checksaveins #1}%
-}
-
-% initialize:
-\let\checkinserts\empty
-\newsaveins\footins
-\newsaveins\margin
-
-
-% @image. We use the macros from epsf.tex to support this.
-% If epsf.tex is not installed and @image is used, we complain.
-%
-% Check for and read epsf.tex up front. If we read it only at @image
-% time, we might be inside a group, and then its definitions would get
-% undone and the next image would fail.
-\openin 1 = epsf.tex
-\ifeof 1 \else
- % Do not bother showing banner with epsf.tex v2.7k (available in
- % doc/epsf.tex and on ctan).
- \def\epsfannounce{\toks0 = }%
- \input epsf.tex
-\fi
-\closein 1
-%
-% We will only complain once about lack of epsf.tex.
-\newif\ifwarnednoepsf
-\newhelp\noepsfhelp{epsf.tex must be installed for images to
- work. It is also included in the Texinfo distribution, or you can get
- it from ftp://tug.org/tex/epsf.tex.}
-%
-\def\image#1{%
- \ifx\epsfbox\thisisundefined
- \ifwarnednoepsf \else
- \errhelp = \noepsfhelp
- \errmessage{epsf.tex not found, images will be ignored}%
- \global\warnednoepsftrue
- \fi
- \else
- \imagexxx #1,,,,,\finish
- \fi
-}
-%
-% Arguments to @image:
-% #1 is (mandatory) image filename; we tack on .eps extension.
-% #2 is (optional) width, #3 is (optional) height.
-% #4 is (ignored optional) html alt text.
-% #5 is (ignored optional) extension.
-% #6 is just the usual extra ignored arg for parsing stuff.
-\newif\ifimagevmode
-\def\imagexxx#1,#2,#3,#4,#5,#6\finish{\begingroup
- \catcode`\^^M = 5 % in case we're inside an example
- \normalturnoffactive % allow _ et al. in names
- % If the image is by itself, center it.
- \ifvmode
- \imagevmodetrue
- \else \ifx\centersub\centerV
- % for @center @image, we need a vbox so we can have our vertical space
- \imagevmodetrue
- \vbox\bgroup % vbox has better behavior than vtop herev
- \fi\fi
- %
- \ifimagevmode
- \nobreak\medskip
- % Usually we'll have text after the image which will insert
- % \parskip glue, so insert it here too to equalize the space
- % above and below.
- \nobreak\vskip\parskip
- \nobreak
- \fi
- %
- % Leave vertical mode so that indentation from an enclosing
- % environment such as @quotation is respected.
- % However, if we're at the top level, we don't want the
- % normal paragraph indentation.
- % On the other hand, if we are in the case of @center @image, we don't
- % want to start a paragraph, which will create a hsize-width box and
- % eradicate the centering.
- \ifx\centersub\centerV\else \noindent \fi
- %
- % Output the image.
- \ifpdf
- \dopdfimage{#1}{#2}{#3}%
- \else
- % \epsfbox itself resets \epsf?size at each figure.
- \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \epsfxsize=#2\relax \fi
- \setbox0 = \hbox{\ignorespaces #3}\ifdim\wd0 > 0pt \epsfysize=#3\relax \fi
- \epsfbox{#1.eps}%
- \fi
- %
- \ifimagevmode
- \medskip % space after a standalone image
- \fi
- \ifx\centersub\centerV \egroup \fi
-\endgroup}
-
-
-% @float FLOATTYPE,LABEL,LOC ... @end float for displayed figures, tables,
-% etc. We don't actually implement floating yet, we always include the
-% float "here". But it seemed the best name for the future.
-%
-\envparseargdef\float{\eatcommaspace\eatcommaspace\dofloat#1, , ,\finish}
-
-% There may be a space before second and/or third parameter; delete it.
-\def\eatcommaspace#1, {#1,}
-
-% #1 is the optional FLOATTYPE, the text label for this float, typically
-% "Figure", "Table", "Example", etc. Can't contain commas. If omitted,
-% this float will not be numbered and cannot be referred to.
-%
-% #2 is the optional xref label. Also must be present for the float to
-% be referable.
-%
-% #3 is the optional positioning argument; for now, it is ignored. It
-% will somehow specify the positions allowed to float to (here, top, bottom).
-%
-% We keep a separate counter for each FLOATTYPE, which we reset at each
-% chapter-level command.
-\let\resetallfloatnos=\empty
-%
-\def\dofloat#1,#2,#3,#4\finish{%
- \let\thiscaption=\empty
- \let\thisshortcaption=\empty
- %
- % don't lose footnotes inside @float.
- %
- % BEWARE: when the floats start float, we have to issue warning whenever an
- % insert appears inside a float which could possibly float. --kasal, 26may04
- %
- \startsavinginserts
- %
- % We can't be used inside a paragraph.
- \par
- %
- \vtop\bgroup
- \def\floattype{#1}%
- \def\floatlabel{#2}%
- \def\floatloc{#3}% we do nothing with this yet.
- %
- \ifx\floattype\empty
- \let\safefloattype=\empty
- \else
- {%
- % the floattype might have accents or other special characters,
- % but we need to use it in a control sequence name.
- \indexnofonts
- \turnoffactive
- \xdef\safefloattype{\floattype}%
- }%
- \fi
- %
- % If label is given but no type, we handle that as the empty type.
- \ifx\floatlabel\empty \else
- % We want each FLOATTYPE to be numbered separately (Figure 1,
- % Table 1, Figure 2, ...). (And if no label, no number.)
- %
- \expandafter\getfloatno\csname\safefloattype floatno\endcsname
- \global\advance\floatno by 1
- %
- {%
- % This magic value for \lastsection is output by \setref as the
- % XREFLABEL-title value. \xrefX uses it to distinguish float
- % labels (which have a completely different output format) from
- % node and anchor labels. And \xrdef uses it to construct the
- % lists of floats.
- %
- \edef\lastsection{\floatmagic=\safefloattype}%
- \setref{\floatlabel}{Yfloat}%
- }%
- \fi
- %
- % start with \parskip glue, I guess.
- \vskip\parskip
- %
- % Don't suppress indentation if a float happens to start a section.
- \restorefirstparagraphindent
-}
-
-% we have these possibilities:
-% @float Foo,lbl & @caption{Cap}: Foo 1.1: Cap
-% @float Foo,lbl & no caption: Foo 1.1
-% @float Foo & @caption{Cap}: Foo: Cap
-% @float Foo & no caption: Foo
-% @float ,lbl & Caption{Cap}: 1.1: Cap
-% @float ,lbl & no caption: 1.1
-% @float & @caption{Cap}: Cap
-% @float & no caption:
-%
-\def\Efloat{%
- \let\floatident = \empty
- %
- % In all cases, if we have a float type, it comes first.
- \ifx\floattype\empty \else \def\floatident{\floattype}\fi
- %
- % If we have an xref label, the number comes next.
- \ifx\floatlabel\empty \else
- \ifx\floattype\empty \else % if also had float type, need tie first.
- \appendtomacro\floatident{\tie}%
- \fi
- % the number.
- \appendtomacro\floatident{\chaplevelprefix\the\floatno}%
- \fi
- %
- % Start the printed caption with what we've constructed in
- % \floatident, but keep it separate; we need \floatident again.
- \let\captionline = \floatident
- %
- \ifx\thiscaption\empty \else
- \ifx\floatident\empty \else
- \appendtomacro\captionline{: }% had ident, so need a colon between
- \fi
- %
- % caption text.
- \appendtomacro\captionline{\scanexp\thiscaption}%
- \fi
- %
- % If we have anything to print, print it, with space before.
- % Eventually this needs to become an \insert.
- \ifx\captionline\empty \else
- \vskip.5\parskip
- \captionline
- %
- % Space below caption.
- \vskip\parskip
- \fi
- %
- % If have an xref label, write the list of floats info. Do this
- % after the caption, to avoid chance of it being a breakpoint.
- \ifx\floatlabel\empty \else
- % Write the text that goes in the lof to the aux file as
- % \floatlabel-lof. Besides \floatident, we include the short
- % caption if specified, else the full caption if specified, else nothing.
- {%
- \atdummies
- %
- % since we read the caption text in the macro world, where ^^M
- % is turned into a normal character, we have to scan it back, so
- % we don't write the literal three characters "^^M" into the aux file.
- \scanexp{%
- \xdef\noexpand\gtemp{%
- \ifx\thisshortcaption\empty
- \thiscaption
- \else
- \thisshortcaption
- \fi
- }%
- }%
- \immediate\write\auxfile{@xrdef{\floatlabel-lof}{\floatident
- \ifx\gtemp\empty \else : \gtemp \fi}}%
- }%
- \fi
- \egroup % end of \vtop
- %
- % place the captured inserts
- %
- % BEWARE: when the floats start floating, we have to issue warning
- % whenever an insert appears inside a float which could possibly
- % float. --kasal, 26may04
- %
- \checkinserts
-}
-
-% Append the tokens #2 to the definition of macro #1, not expanding either.
-%
-\def\appendtomacro#1#2{%
- \expandafter\def\expandafter#1\expandafter{#1#2}%
-}
-
-% @caption, @shortcaption
-%
-\def\caption{\docaption\thiscaption}
-\def\shortcaption{\docaption\thisshortcaption}
-\def\docaption{\checkenv\float \bgroup\scanargctxt\defcaption}
-\def\defcaption#1#2{\egroup \def#1{#2}}
-
-% The parameter is the control sequence identifying the counter we are
-% going to use. Create it if it doesn't exist and assign it to \floatno.
-\def\getfloatno#1{%
- \ifx#1\relax
- % Haven't seen this figure type before.
- \csname newcount\endcsname #1%
- %
- % Remember to reset this floatno at the next chap.
- \expandafter\gdef\expandafter\resetallfloatnos
- \expandafter{\resetallfloatnos #1=0 }%
- \fi
- \let\floatno#1%
-}
-
-% \setref calls this to get the XREFLABEL-snt value. We want an @xref
-% to the FLOATLABEL to expand to "Figure 3.1". We call \setref when we
-% first read the @float command.
-%
-\def\Yfloat{\floattype@tie \chaplevelprefix\the\floatno}%
-
-% Magic string used for the XREFLABEL-title value, so \xrefX can
-% distinguish floats from other xref types.
-\def\floatmagic{!!float!!}
-
-% #1 is the control sequence we are passed; we expand into a conditional
-% which is true if #1 represents a float ref. That is, the magic
-% \lastsection value which we \setref above.
-%
-\def\iffloat#1{\expandafter\doiffloat#1==\finish}
-%
-% #1 is (maybe) the \floatmagic string. If so, #2 will be the
-% (safe) float type for this float. We set \iffloattype to #2.
-%
-\def\doiffloat#1=#2=#3\finish{%
- \def\temp{#1}%
- \def\iffloattype{#2}%
- \ifx\temp\floatmagic
-}
-
-% @listoffloats FLOATTYPE - print a list of floats like a table of contents.
-%
-\parseargdef\listoffloats{%
- \def\floattype{#1}% floattype
- {%
- % the floattype might have accents or other special characters,
- % but we need to use it in a control sequence name.
- \indexnofonts
- \turnoffactive
- \xdef\safefloattype{\floattype}%
- }%
- %
- % \xrdef saves the floats as a \do-list in \floatlistSAFEFLOATTYPE.
- \expandafter\ifx\csname floatlist\safefloattype\endcsname \relax
- \ifhavexrefs
- % if the user said @listoffloats foo but never @float foo.
- \message{\linenumber No `\safefloattype' floats to list.}%
- \fi
- \else
- \begingroup
- \leftskip=\tocindent % indent these entries like a toc
- \let\do=\listoffloatsdo
- \csname floatlist\safefloattype\endcsname
- \endgroup
- \fi
-}
-
-% This is called on each entry in a list of floats. We're passed the
-% xref label, in the form LABEL-title, which is how we save it in the
-% aux file. We strip off the -title and look up \XRLABEL-lof, which
-% has the text we're supposed to typeset here.
-%
-% Figures without xref labels will not be included in the list (since
-% they won't appear in the aux file).
-%
-\def\listoffloatsdo#1{\listoffloatsdoentry#1\finish}
-\def\listoffloatsdoentry#1-title\finish{{%
- % Can't fully expand XR#1-lof because it can contain anything. Just
- % pass the control sequence. On the other hand, XR#1-pg is just the
- % page number, and we want to fully expand that so we can get a link
- % in pdf output.
- \toksA = \expandafter{\csname XR#1-lof\endcsname}%
- %
- % use the same \entry macro we use to generate the TOC and index.
- \edef\writeentry{\noexpand\entry{\the\toksA}{\csname XR#1-pg\endcsname}}%
- \writeentry
-}}
-
-
-\message{localization,}
-
-% For single-language documents, @documentlanguage is usually given very
-% early, just after @documentencoding. Single argument is the language
-% (de) or locale (de_DE) abbreviation.
-%
-{
- \catcode`\_ = \active
- \globaldefs=1
-\parseargdef\documentlanguage{\begingroup
- \let_=\normalunderscore % normal _ character for filenames
- \tex % read txi-??.tex file in plain TeX.
- % Read the file by the name they passed if it exists.
- \openin 1 txi-#1.tex
- \ifeof 1
- \documentlanguagetrywithoutunderscore{#1_\finish}%
- \else
- \globaldefs = 1 % everything in the txi-LL files needs to persist
- \input txi-#1.tex
- \fi
- \closein 1
- \endgroup % end raw TeX
-\endgroup}
-%
-% If they passed de_DE, and txi-de_DE.tex doesn't exist,
-% try txi-de.tex.
-%
-\gdef\documentlanguagetrywithoutunderscore#1_#2\finish{%
- \openin 1 txi-#1.tex
- \ifeof 1
- \errhelp = \nolanghelp
- \errmessage{Cannot read language file txi-#1.tex}%
- \else
- \globaldefs = 1 % everything in the txi-LL files needs to persist
- \input txi-#1.tex
- \fi
- \closein 1
-}
-}% end of special _ catcode
-%
-\newhelp\nolanghelp{The given language definition file cannot be found or
-is empty. Maybe you need to install it? Putting it in the current
-directory should work if nowhere else does.}
-
-% This macro is called from txi-??.tex files; the first argument is the
-% \language name to set (without the "\lang@" prefix), the second and
-% third args are \{left,right}hyphenmin.
-%
-% The language names to pass are determined when the format is built.
-% See the etex.log file created at that time, e.g.,
-% /usr/local/texlive/2008/texmf-var/web2c/pdftex/etex.log.
-%
-% With TeX Live 2008, etex now includes hyphenation patterns for all
-% available languages. This means we can support hyphenation in
-% Texinfo, at least to some extent. (This still doesn't solve the
-% accented characters problem.)
-%
-\catcode`@=11
-\def\txisetlanguage#1#2#3{%
- % do not set the language if the name is undefined in the current TeX.
- \expandafter\ifx\csname lang@#1\endcsname \relax
- \message{no patterns for #1}%
- \else
- \global\language = \csname lang@#1\endcsname
- \fi
- % but there is no harm in adjusting the hyphenmin values regardless.
- \global\lefthyphenmin = #2\relax
- \global\righthyphenmin = #3\relax
-}
-
-% Helpers for encodings.
-% Set the catcode of characters 128 through 255 to the specified number.
-%
-\def\setnonasciicharscatcode#1{%
- \count255=128
- \loop\ifnum\count255<256
- \global\catcode\count255=#1\relax
- \advance\count255 by 1
- \repeat
-}
-
-\def\setnonasciicharscatcodenonglobal#1{%
- \count255=128
- \loop\ifnum\count255<256
- \catcode\count255=#1\relax
- \advance\count255 by 1
- \repeat
-}
-
-% @documentencoding sets the definition of non-ASCII characters
-% according to the specified encoding.
-%
-\parseargdef\documentencoding{%
- % Encoding being declared for the document.
- \def\declaredencoding{\csname #1.enc\endcsname}%
- %
- % Supported encodings: names converted to tokens in order to be able
- % to compare them with \ifx.
- \def\ascii{\csname US-ASCII.enc\endcsname}%
- \def\latnine{\csname ISO-8859-15.enc\endcsname}%
- \def\latone{\csname ISO-8859-1.enc\endcsname}%
- \def\lattwo{\csname ISO-8859-2.enc\endcsname}%
- \def\utfeight{\csname UTF-8.enc\endcsname}%
- %
- \ifx \declaredencoding \ascii
- \asciichardefs
- %
- \else \ifx \declaredencoding \lattwo
- \setnonasciicharscatcode\active
- \lattwochardefs
- %
- \else \ifx \declaredencoding \latone
- \setnonasciicharscatcode\active
- \latonechardefs
- %
- \else \ifx \declaredencoding \latnine
- \setnonasciicharscatcode\active
- \latninechardefs
- %
- \else \ifx \declaredencoding \utfeight
- \setnonasciicharscatcode\active
- \utfeightchardefs
- %
- \else
- \message{Unknown document encoding #1, ignoring.}%
- %
- \fi % utfeight
- \fi % latnine
- \fi % latone
- \fi % lattwo
- \fi % ascii
-}
-
-% A message to be logged when using a character that isn't available
-% the default font encoding (OT1).
-%
-\def\missingcharmsg#1{\message{Character missing in OT1 encoding: #1.}}
-
-% Take account of \c (plain) vs. \, (Texinfo) difference.
-\def\cedilla#1{\ifx\c\ptexc\c{#1}\else\,{#1}\fi}
-
-% First, make active non-ASCII characters in order for them to be
-% correctly categorized when TeX reads the replacement text of
-% macros containing the character definitions.
-\setnonasciicharscatcode\active
-%
-% Latin1 (ISO-8859-1) character definitions.
-\def\latonechardefs{%
- \gdef^^a0{\tie}
- \gdef^^a1{\exclamdown}
- \gdef^^a2{\missingcharmsg{CENT SIGN}}
- \gdef^^a3{{\pounds}}
- \gdef^^a4{\missingcharmsg{CURRENCY SIGN}}
- \gdef^^a5{\missingcharmsg{YEN SIGN}}
- \gdef^^a6{\missingcharmsg{BROKEN BAR}}
- \gdef^^a7{\S}
- \gdef^^a8{\"{}}
- \gdef^^a9{\copyright}
- \gdef^^aa{\ordf}
- \gdef^^ab{\guillemetleft}
- \gdef^^ac{$\lnot$}
- \gdef^^ad{\-}
- \gdef^^ae{\registeredsymbol}
- \gdef^^af{\={}}
- %
- \gdef^^b0{\textdegree}
- \gdef^^b1{$\pm$}
- \gdef^^b2{$^2$}
- \gdef^^b3{$^3$}
- \gdef^^b4{\'{}}
- \gdef^^b5{$\mu$}
- \gdef^^b6{\P}
- %
- \gdef^^b7{$^.$}
- \gdef^^b8{\cedilla\ }
- \gdef^^b9{$^1$}
- \gdef^^ba{\ordm}
- %
- \gdef^^bb{\guillemetright}
- \gdef^^bc{$1\over4$}
- \gdef^^bd{$1\over2$}
- \gdef^^be{$3\over4$}
- \gdef^^bf{\questiondown}
- %
- \gdef^^c0{\`A}
- \gdef^^c1{\'A}
- \gdef^^c2{\^A}
- \gdef^^c3{\~A}
- \gdef^^c4{\"A}
- \gdef^^c5{\ringaccent A}
- \gdef^^c6{\AE}
- \gdef^^c7{\cedilla C}
- \gdef^^c8{\`E}
- \gdef^^c9{\'E}
- \gdef^^ca{\^E}
- \gdef^^cb{\"E}
- \gdef^^cc{\`I}
- \gdef^^cd{\'I}
- \gdef^^ce{\^I}
- \gdef^^cf{\"I}
- %
- \gdef^^d0{\DH}
- \gdef^^d1{\~N}
- \gdef^^d2{\`O}
- \gdef^^d3{\'O}
- \gdef^^d4{\^O}
- \gdef^^d5{\~O}
- \gdef^^d6{\"O}
- \gdef^^d7{$\times$}
- \gdef^^d8{\O}
- \gdef^^d9{\`U}
- \gdef^^da{\'U}
- \gdef^^db{\^U}
- \gdef^^dc{\"U}
- \gdef^^dd{\'Y}
- \gdef^^de{\TH}
- \gdef^^df{\ss}
- %
- \gdef^^e0{\`a}
- \gdef^^e1{\'a}
- \gdef^^e2{\^a}
- \gdef^^e3{\~a}
- \gdef^^e4{\"a}
- \gdef^^e5{\ringaccent a}
- \gdef^^e6{\ae}
- \gdef^^e7{\cedilla c}
- \gdef^^e8{\`e}
- \gdef^^e9{\'e}
- \gdef^^ea{\^e}
- \gdef^^eb{\"e}
- \gdef^^ec{\`{\dotless i}}
- \gdef^^ed{\'{\dotless i}}
- \gdef^^ee{\^{\dotless i}}
- \gdef^^ef{\"{\dotless i}}
- %
- \gdef^^f0{\dh}
- \gdef^^f1{\~n}
- \gdef^^f2{\`o}
- \gdef^^f3{\'o}
- \gdef^^f4{\^o}
- \gdef^^f5{\~o}
- \gdef^^f6{\"o}
- \gdef^^f7{$\div$}
- \gdef^^f8{\o}
- \gdef^^f9{\`u}
- \gdef^^fa{\'u}
- \gdef^^fb{\^u}
- \gdef^^fc{\"u}
- \gdef^^fd{\'y}
- \gdef^^fe{\th}
- \gdef^^ff{\"y}
-}
-
-% Latin9 (ISO-8859-15) encoding character definitions.
-\def\latninechardefs{%
- % Encoding is almost identical to Latin1.
- \latonechardefs
- %
- \gdef^^a4{\euro}
- \gdef^^a6{\v S}
- \gdef^^a8{\v s}
- \gdef^^b4{\v Z}
- \gdef^^b8{\v z}
- \gdef^^bc{\OE}
- \gdef^^bd{\oe}
- \gdef^^be{\"Y}
-}
-
-% Latin2 (ISO-8859-2) character definitions.
-\def\lattwochardefs{%
- \gdef^^a0{\tie}
- \gdef^^a1{\ogonek{A}}
- \gdef^^a2{\u{}}
- \gdef^^a3{\L}
- \gdef^^a4{\missingcharmsg{CURRENCY SIGN}}
- \gdef^^a5{\v L}
- \gdef^^a6{\'S}
- \gdef^^a7{\S}
- \gdef^^a8{\"{}}
- \gdef^^a9{\v S}
- \gdef^^aa{\cedilla S}
- \gdef^^ab{\v T}
- \gdef^^ac{\'Z}
- \gdef^^ad{\-}
- \gdef^^ae{\v Z}
- \gdef^^af{\dotaccent Z}
- %
- \gdef^^b0{\textdegree}
- \gdef^^b1{\ogonek{a}}
- \gdef^^b2{\ogonek{ }}
- \gdef^^b3{\l}
- \gdef^^b4{\'{}}
- \gdef^^b5{\v l}
- \gdef^^b6{\'s}
- \gdef^^b7{\v{}}
- \gdef^^b8{\cedilla\ }
- \gdef^^b9{\v s}
- \gdef^^ba{\cedilla s}
- \gdef^^bb{\v t}
- \gdef^^bc{\'z}
- \gdef^^bd{\H{}}
- \gdef^^be{\v z}
- \gdef^^bf{\dotaccent z}
- %
- \gdef^^c0{\'R}
- \gdef^^c1{\'A}
- \gdef^^c2{\^A}
- \gdef^^c3{\u A}
- \gdef^^c4{\"A}
- \gdef^^c5{\'L}
- \gdef^^c6{\'C}
- \gdef^^c7{\cedilla C}
- \gdef^^c8{\v C}
- \gdef^^c9{\'E}
- \gdef^^ca{\ogonek{E}}
- \gdef^^cb{\"E}
- \gdef^^cc{\v E}
- \gdef^^cd{\'I}
- \gdef^^ce{\^I}
- \gdef^^cf{\v D}
- %
- \gdef^^d0{\DH}
- \gdef^^d1{\'N}
- \gdef^^d2{\v N}
- \gdef^^d3{\'O}
- \gdef^^d4{\^O}
- \gdef^^d5{\H O}
- \gdef^^d6{\"O}
- \gdef^^d7{$\times$}
- \gdef^^d8{\v R}
- \gdef^^d9{\ringaccent U}
- \gdef^^da{\'U}
- \gdef^^db{\H U}
- \gdef^^dc{\"U}
- \gdef^^dd{\'Y}
- \gdef^^de{\cedilla T}
- \gdef^^df{\ss}
- %
- \gdef^^e0{\'r}
- \gdef^^e1{\'a}
- \gdef^^e2{\^a}
- \gdef^^e3{\u a}
- \gdef^^e4{\"a}
- \gdef^^e5{\'l}
- \gdef^^e6{\'c}
- \gdef^^e7{\cedilla c}
- \gdef^^e8{\v c}
- \gdef^^e9{\'e}
- \gdef^^ea{\ogonek{e}}
- \gdef^^eb{\"e}
- \gdef^^ec{\v e}
- \gdef^^ed{\'{\dotless{i}}}
- \gdef^^ee{\^{\dotless{i}}}
- \gdef^^ef{\v d}
- %
- \gdef^^f0{\dh}
- \gdef^^f1{\'n}
- \gdef^^f2{\v n}
- \gdef^^f3{\'o}
- \gdef^^f4{\^o}
- \gdef^^f5{\H o}
- \gdef^^f6{\"o}
- \gdef^^f7{$\div$}
- \gdef^^f8{\v r}
- \gdef^^f9{\ringaccent u}
- \gdef^^fa{\'u}
- \gdef^^fb{\H u}
- \gdef^^fc{\"u}
- \gdef^^fd{\'y}
- \gdef^^fe{\cedilla t}
- \gdef^^ff{\dotaccent{}}
-}
-
-% UTF-8 character definitions.
-%
-% This code to support UTF-8 is based on LaTeX's utf8.def, with some
-% changes for Texinfo conventions. It is included here under the GPL by
-% permission from Frank Mittelbach and the LaTeX team.
-%
-\newcount\countUTFx
-\newcount\countUTFy
-\newcount\countUTFz
-
-\gdef\UTFviiiTwoOctets#1#2{\expandafter
- \UTFviiiDefined\csname u8:#1\string #2\endcsname}
-%
-\gdef\UTFviiiThreeOctets#1#2#3{\expandafter
- \UTFviiiDefined\csname u8:#1\string #2\string #3\endcsname}
-%
-\gdef\UTFviiiFourOctets#1#2#3#4{\expandafter
- \UTFviiiDefined\csname u8:#1\string #2\string #3\string #4\endcsname}
-
-\gdef\UTFviiiDefined#1{%
- \ifx #1\relax
- \message{\linenumber Unicode char \string #1 not defined for Texinfo}%
- \else
- \expandafter #1%
- \fi
-}
-
-\begingroup
- \catcode`\~13
- \catcode`\"12
-
- \def\UTFviiiLoop{%
- \global\catcode\countUTFx\active
- \uccode`\~\countUTFx
- \uppercase\expandafter{\UTFviiiTmp}%
- \advance\countUTFx by 1
- \ifnum\countUTFx < \countUTFy
- \expandafter\UTFviiiLoop
- \fi}
-
- \countUTFx = "C2
- \countUTFy = "E0
- \def\UTFviiiTmp{%
- \xdef~{\noexpand\UTFviiiTwoOctets\string~}}
- \UTFviiiLoop
-
- \countUTFx = "E0
- \countUTFy = "F0
- \def\UTFviiiTmp{%
- \xdef~{\noexpand\UTFviiiThreeOctets\string~}}
- \UTFviiiLoop
-
- \countUTFx = "F0
- \countUTFy = "F4
- \def\UTFviiiTmp{%
- \xdef~{\noexpand\UTFviiiFourOctets\string~}}
- \UTFviiiLoop
-\endgroup
-
-\begingroup
- \catcode`\"=12
- \catcode`\<=12
- \catcode`\.=12
- \catcode`\,=12
- \catcode`\;=12
- \catcode`\!=12
- \catcode`\~=13
-
- \gdef\DeclareUnicodeCharacter#1#2{%
- \countUTFz = "#1\relax
- %\wlog{\space\space defining Unicode char U+#1 (decimal \the\countUTFz)}%
- \begingroup
- \parseXMLCharref
- \def\UTFviiiTwoOctets##1##2{%
- \csname u8:##1\string ##2\endcsname}%
- \def\UTFviiiThreeOctets##1##2##3{%
- \csname u8:##1\string ##2\string ##3\endcsname}%
- \def\UTFviiiFourOctets##1##2##3##4{%
- \csname u8:##1\string ##2\string ##3\string ##4\endcsname}%
- \expandafter\expandafter\expandafter\expandafter
- \expandafter\expandafter\expandafter
- \gdef\UTFviiiTmp{#2}%
- \endgroup}
-
- \gdef\parseXMLCharref{%
- \ifnum\countUTFz < "A0\relax
- \errhelp = \EMsimple
- \errmessage{Cannot define Unicode char value < 00A0}%
- \else\ifnum\countUTFz < "800\relax
- \parseUTFviiiA,%
- \parseUTFviiiB C\UTFviiiTwoOctets.,%
- \else\ifnum\countUTFz < "10000\relax
- \parseUTFviiiA;%
- \parseUTFviiiA,%
- \parseUTFviiiB E\UTFviiiThreeOctets.{,;}%
- \else
- \parseUTFviiiA;%
- \parseUTFviiiA,%
- \parseUTFviiiA!%
- \parseUTFviiiB F\UTFviiiFourOctets.{!,;}%
- \fi\fi\fi
- }
-
- \gdef\parseUTFviiiA#1{%
- \countUTFx = \countUTFz
- \divide\countUTFz by 64
- \countUTFy = \countUTFz
- \multiply\countUTFz by 64
- \advance\countUTFx by -\countUTFz
- \advance\countUTFx by 128
- \uccode `#1\countUTFx
- \countUTFz = \countUTFy}
-
- \gdef\parseUTFviiiB#1#2#3#4{%
- \advance\countUTFz by "#10\relax
- \uccode `#3\countUTFz
- \uppercase{\gdef\UTFviiiTmp{#2#3#4}}}
-\endgroup
-
-\def\utfeightchardefs{%
- \DeclareUnicodeCharacter{00A0}{\tie}
- \DeclareUnicodeCharacter{00A1}{\exclamdown}
- \DeclareUnicodeCharacter{00A3}{\pounds}
- \DeclareUnicodeCharacter{00A8}{\"{ }}
- \DeclareUnicodeCharacter{00A9}{\copyright}
- \DeclareUnicodeCharacter{00AA}{\ordf}
- \DeclareUnicodeCharacter{00AB}{\guillemetleft}
- \DeclareUnicodeCharacter{00AD}{\-}
- \DeclareUnicodeCharacter{00AE}{\registeredsymbol}
- \DeclareUnicodeCharacter{00AF}{\={ }}
-
- \DeclareUnicodeCharacter{00B0}{\ringaccent{ }}
- \DeclareUnicodeCharacter{00B4}{\'{ }}
- \DeclareUnicodeCharacter{00B8}{\cedilla{ }}
- \DeclareUnicodeCharacter{00BA}{\ordm}
- \DeclareUnicodeCharacter{00BB}{\guillemetright}
- \DeclareUnicodeCharacter{00BF}{\questiondown}
-
- \DeclareUnicodeCharacter{00C0}{\`A}
- \DeclareUnicodeCharacter{00C1}{\'A}
- \DeclareUnicodeCharacter{00C2}{\^A}
- \DeclareUnicodeCharacter{00C3}{\~A}
- \DeclareUnicodeCharacter{00C4}{\"A}
- \DeclareUnicodeCharacter{00C5}{\AA}
- \DeclareUnicodeCharacter{00C6}{\AE}
- \DeclareUnicodeCharacter{00C7}{\cedilla{C}}
- \DeclareUnicodeCharacter{00C8}{\`E}
- \DeclareUnicodeCharacter{00C9}{\'E}
- \DeclareUnicodeCharacter{00CA}{\^E}
- \DeclareUnicodeCharacter{00CB}{\"E}
- \DeclareUnicodeCharacter{00CC}{\`I}
- \DeclareUnicodeCharacter{00CD}{\'I}
- \DeclareUnicodeCharacter{00CE}{\^I}
- \DeclareUnicodeCharacter{00CF}{\"I}
-
- \DeclareUnicodeCharacter{00D0}{\DH}
- \DeclareUnicodeCharacter{00D1}{\~N}
- \DeclareUnicodeCharacter{00D2}{\`O}
- \DeclareUnicodeCharacter{00D3}{\'O}
- \DeclareUnicodeCharacter{00D4}{\^O}
- \DeclareUnicodeCharacter{00D5}{\~O}
- \DeclareUnicodeCharacter{00D6}{\"O}
- \DeclareUnicodeCharacter{00D8}{\O}
- \DeclareUnicodeCharacter{00D9}{\`U}
- \DeclareUnicodeCharacter{00DA}{\'U}
- \DeclareUnicodeCharacter{00DB}{\^U}
- \DeclareUnicodeCharacter{00DC}{\"U}
- \DeclareUnicodeCharacter{00DD}{\'Y}
- \DeclareUnicodeCharacter{00DE}{\TH}
- \DeclareUnicodeCharacter{00DF}{\ss}
-
- \DeclareUnicodeCharacter{00E0}{\`a}
- \DeclareUnicodeCharacter{00E1}{\'a}
- \DeclareUnicodeCharacter{00E2}{\^a}
- \DeclareUnicodeCharacter{00E3}{\~a}
- \DeclareUnicodeCharacter{00E4}{\"a}
- \DeclareUnicodeCharacter{00E5}{\aa}
- \DeclareUnicodeCharacter{00E6}{\ae}
- \DeclareUnicodeCharacter{00E7}{\cedilla{c}}
- \DeclareUnicodeCharacter{00E8}{\`e}
- \DeclareUnicodeCharacter{00E9}{\'e}
- \DeclareUnicodeCharacter{00EA}{\^e}
- \DeclareUnicodeCharacter{00EB}{\"e}
- \DeclareUnicodeCharacter{00EC}{\`{\dotless{i}}}
- \DeclareUnicodeCharacter{00ED}{\'{\dotless{i}}}
- \DeclareUnicodeCharacter{00EE}{\^{\dotless{i}}}
- \DeclareUnicodeCharacter{00EF}{\"{\dotless{i}}}
-
- \DeclareUnicodeCharacter{00F0}{\dh}
- \DeclareUnicodeCharacter{00F1}{\~n}
- \DeclareUnicodeCharacter{00F2}{\`o}
- \DeclareUnicodeCharacter{00F3}{\'o}
- \DeclareUnicodeCharacter{00F4}{\^o}
- \DeclareUnicodeCharacter{00F5}{\~o}
- \DeclareUnicodeCharacter{00F6}{\"o}
- \DeclareUnicodeCharacter{00F8}{\o}
- \DeclareUnicodeCharacter{00F9}{\`u}
- \DeclareUnicodeCharacter{00FA}{\'u}
- \DeclareUnicodeCharacter{00FB}{\^u}
- \DeclareUnicodeCharacter{00FC}{\"u}
- \DeclareUnicodeCharacter{00FD}{\'y}
- \DeclareUnicodeCharacter{00FE}{\th}
- \DeclareUnicodeCharacter{00FF}{\"y}
-
- \DeclareUnicodeCharacter{0100}{\=A}
- \DeclareUnicodeCharacter{0101}{\=a}
- \DeclareUnicodeCharacter{0102}{\u{A}}
- \DeclareUnicodeCharacter{0103}{\u{a}}
- \DeclareUnicodeCharacter{0104}{\ogonek{A}}
- \DeclareUnicodeCharacter{0105}{\ogonek{a}}
- \DeclareUnicodeCharacter{0106}{\'C}
- \DeclareUnicodeCharacter{0107}{\'c}
- \DeclareUnicodeCharacter{0108}{\^C}
- \DeclareUnicodeCharacter{0109}{\^c}
- \DeclareUnicodeCharacter{0118}{\ogonek{E}}
- \DeclareUnicodeCharacter{0119}{\ogonek{e}}
- \DeclareUnicodeCharacter{010A}{\dotaccent{C}}
- \DeclareUnicodeCharacter{010B}{\dotaccent{c}}
- \DeclareUnicodeCharacter{010C}{\v{C}}
- \DeclareUnicodeCharacter{010D}{\v{c}}
- \DeclareUnicodeCharacter{010E}{\v{D}}
-
- \DeclareUnicodeCharacter{0112}{\=E}
- \DeclareUnicodeCharacter{0113}{\=e}
- \DeclareUnicodeCharacter{0114}{\u{E}}
- \DeclareUnicodeCharacter{0115}{\u{e}}
- \DeclareUnicodeCharacter{0116}{\dotaccent{E}}
- \DeclareUnicodeCharacter{0117}{\dotaccent{e}}
- \DeclareUnicodeCharacter{011A}{\v{E}}
- \DeclareUnicodeCharacter{011B}{\v{e}}
- \DeclareUnicodeCharacter{011C}{\^G}
- \DeclareUnicodeCharacter{011D}{\^g}
- \DeclareUnicodeCharacter{011E}{\u{G}}
- \DeclareUnicodeCharacter{011F}{\u{g}}
-
- \DeclareUnicodeCharacter{0120}{\dotaccent{G}}
- \DeclareUnicodeCharacter{0121}{\dotaccent{g}}
- \DeclareUnicodeCharacter{0124}{\^H}
- \DeclareUnicodeCharacter{0125}{\^h}
- \DeclareUnicodeCharacter{0128}{\~I}
- \DeclareUnicodeCharacter{0129}{\~{\dotless{i}}}
- \DeclareUnicodeCharacter{012A}{\=I}
- \DeclareUnicodeCharacter{012B}{\={\dotless{i}}}
- \DeclareUnicodeCharacter{012C}{\u{I}}
- \DeclareUnicodeCharacter{012D}{\u{\dotless{i}}}
-
- \DeclareUnicodeCharacter{0130}{\dotaccent{I}}
- \DeclareUnicodeCharacter{0131}{\dotless{i}}
- \DeclareUnicodeCharacter{0132}{IJ}
- \DeclareUnicodeCharacter{0133}{ij}
- \DeclareUnicodeCharacter{0134}{\^J}
- \DeclareUnicodeCharacter{0135}{\^{\dotless{j}}}
- \DeclareUnicodeCharacter{0139}{\'L}
- \DeclareUnicodeCharacter{013A}{\'l}
-
- \DeclareUnicodeCharacter{0141}{\L}
- \DeclareUnicodeCharacter{0142}{\l}
- \DeclareUnicodeCharacter{0143}{\'N}
- \DeclareUnicodeCharacter{0144}{\'n}
- \DeclareUnicodeCharacter{0147}{\v{N}}
- \DeclareUnicodeCharacter{0148}{\v{n}}
- \DeclareUnicodeCharacter{014C}{\=O}
- \DeclareUnicodeCharacter{014D}{\=o}
- \DeclareUnicodeCharacter{014E}{\u{O}}
- \DeclareUnicodeCharacter{014F}{\u{o}}
-
- \DeclareUnicodeCharacter{0150}{\H{O}}
- \DeclareUnicodeCharacter{0151}{\H{o}}
- \DeclareUnicodeCharacter{0152}{\OE}
- \DeclareUnicodeCharacter{0153}{\oe}
- \DeclareUnicodeCharacter{0154}{\'R}
- \DeclareUnicodeCharacter{0155}{\'r}
- \DeclareUnicodeCharacter{0158}{\v{R}}
- \DeclareUnicodeCharacter{0159}{\v{r}}
- \DeclareUnicodeCharacter{015A}{\'S}
- \DeclareUnicodeCharacter{015B}{\'s}
- \DeclareUnicodeCharacter{015C}{\^S}
- \DeclareUnicodeCharacter{015D}{\^s}
- \DeclareUnicodeCharacter{015E}{\cedilla{S}}
- \DeclareUnicodeCharacter{015F}{\cedilla{s}}
-
- \DeclareUnicodeCharacter{0160}{\v{S}}
- \DeclareUnicodeCharacter{0161}{\v{s}}
- \DeclareUnicodeCharacter{0162}{\cedilla{t}}
- \DeclareUnicodeCharacter{0163}{\cedilla{T}}
- \DeclareUnicodeCharacter{0164}{\v{T}}
-
- \DeclareUnicodeCharacter{0168}{\~U}
- \DeclareUnicodeCharacter{0169}{\~u}
- \DeclareUnicodeCharacter{016A}{\=U}
- \DeclareUnicodeCharacter{016B}{\=u}
- \DeclareUnicodeCharacter{016C}{\u{U}}
- \DeclareUnicodeCharacter{016D}{\u{u}}
- \DeclareUnicodeCharacter{016E}{\ringaccent{U}}
- \DeclareUnicodeCharacter{016F}{\ringaccent{u}}
-
- \DeclareUnicodeCharacter{0170}{\H{U}}
- \DeclareUnicodeCharacter{0171}{\H{u}}
- \DeclareUnicodeCharacter{0174}{\^W}
- \DeclareUnicodeCharacter{0175}{\^w}
- \DeclareUnicodeCharacter{0176}{\^Y}
- \DeclareUnicodeCharacter{0177}{\^y}
- \DeclareUnicodeCharacter{0178}{\"Y}
- \DeclareUnicodeCharacter{0179}{\'Z}
- \DeclareUnicodeCharacter{017A}{\'z}
- \DeclareUnicodeCharacter{017B}{\dotaccent{Z}}
- \DeclareUnicodeCharacter{017C}{\dotaccent{z}}
- \DeclareUnicodeCharacter{017D}{\v{Z}}
- \DeclareUnicodeCharacter{017E}{\v{z}}
-
- \DeclareUnicodeCharacter{01C4}{D\v{Z}}
- \DeclareUnicodeCharacter{01C5}{D\v{z}}
- \DeclareUnicodeCharacter{01C6}{d\v{z}}
- \DeclareUnicodeCharacter{01C7}{LJ}
- \DeclareUnicodeCharacter{01C8}{Lj}
- \DeclareUnicodeCharacter{01C9}{lj}
- \DeclareUnicodeCharacter{01CA}{NJ}
- \DeclareUnicodeCharacter{01CB}{Nj}
- \DeclareUnicodeCharacter{01CC}{nj}
- \DeclareUnicodeCharacter{01CD}{\v{A}}
- \DeclareUnicodeCharacter{01CE}{\v{a}}
- \DeclareUnicodeCharacter{01CF}{\v{I}}
-
- \DeclareUnicodeCharacter{01D0}{\v{\dotless{i}}}
- \DeclareUnicodeCharacter{01D1}{\v{O}}
- \DeclareUnicodeCharacter{01D2}{\v{o}}
- \DeclareUnicodeCharacter{01D3}{\v{U}}
- \DeclareUnicodeCharacter{01D4}{\v{u}}
-
- \DeclareUnicodeCharacter{01E2}{\={\AE}}
- \DeclareUnicodeCharacter{01E3}{\={\ae}}
- \DeclareUnicodeCharacter{01E6}{\v{G}}
- \DeclareUnicodeCharacter{01E7}{\v{g}}
- \DeclareUnicodeCharacter{01E8}{\v{K}}
- \DeclareUnicodeCharacter{01E9}{\v{k}}
-
- \DeclareUnicodeCharacter{01F0}{\v{\dotless{j}}}
- \DeclareUnicodeCharacter{01F1}{DZ}
- \DeclareUnicodeCharacter{01F2}{Dz}
- \DeclareUnicodeCharacter{01F3}{dz}
- \DeclareUnicodeCharacter{01F4}{\'G}
- \DeclareUnicodeCharacter{01F5}{\'g}
- \DeclareUnicodeCharacter{01F8}{\`N}
- \DeclareUnicodeCharacter{01F9}{\`n}
- \DeclareUnicodeCharacter{01FC}{\'{\AE}}
- \DeclareUnicodeCharacter{01FD}{\'{\ae}}
- \DeclareUnicodeCharacter{01FE}{\'{\O}}
- \DeclareUnicodeCharacter{01FF}{\'{\o}}
-
- \DeclareUnicodeCharacter{021E}{\v{H}}
- \DeclareUnicodeCharacter{021F}{\v{h}}
-
- \DeclareUnicodeCharacter{0226}{\dotaccent{A}}
- \DeclareUnicodeCharacter{0227}{\dotaccent{a}}
- \DeclareUnicodeCharacter{0228}{\cedilla{E}}
- \DeclareUnicodeCharacter{0229}{\cedilla{e}}
- \DeclareUnicodeCharacter{022E}{\dotaccent{O}}
- \DeclareUnicodeCharacter{022F}{\dotaccent{o}}
-
- \DeclareUnicodeCharacter{0232}{\=Y}
- \DeclareUnicodeCharacter{0233}{\=y}
- \DeclareUnicodeCharacter{0237}{\dotless{j}}
-
- \DeclareUnicodeCharacter{02DB}{\ogonek{ }}
-
- \DeclareUnicodeCharacter{1E02}{\dotaccent{B}}
- \DeclareUnicodeCharacter{1E03}{\dotaccent{b}}
- \DeclareUnicodeCharacter{1E04}{\udotaccent{B}}
- \DeclareUnicodeCharacter{1E05}{\udotaccent{b}}
- \DeclareUnicodeCharacter{1E06}{\ubaraccent{B}}
- \DeclareUnicodeCharacter{1E07}{\ubaraccent{b}}
- \DeclareUnicodeCharacter{1E0A}{\dotaccent{D}}
- \DeclareUnicodeCharacter{1E0B}{\dotaccent{d}}
- \DeclareUnicodeCharacter{1E0C}{\udotaccent{D}}
- \DeclareUnicodeCharacter{1E0D}{\udotaccent{d}}
- \DeclareUnicodeCharacter{1E0E}{\ubaraccent{D}}
- \DeclareUnicodeCharacter{1E0F}{\ubaraccent{d}}
-
- \DeclareUnicodeCharacter{1E1E}{\dotaccent{F}}
- \DeclareUnicodeCharacter{1E1F}{\dotaccent{f}}
-
- \DeclareUnicodeCharacter{1E20}{\=G}
- \DeclareUnicodeCharacter{1E21}{\=g}
- \DeclareUnicodeCharacter{1E22}{\dotaccent{H}}
- \DeclareUnicodeCharacter{1E23}{\dotaccent{h}}
- \DeclareUnicodeCharacter{1E24}{\udotaccent{H}}
- \DeclareUnicodeCharacter{1E25}{\udotaccent{h}}
- \DeclareUnicodeCharacter{1E26}{\"H}
- \DeclareUnicodeCharacter{1E27}{\"h}
-
- \DeclareUnicodeCharacter{1E30}{\'K}
- \DeclareUnicodeCharacter{1E31}{\'k}
- \DeclareUnicodeCharacter{1E32}{\udotaccent{K}}
- \DeclareUnicodeCharacter{1E33}{\udotaccent{k}}
- \DeclareUnicodeCharacter{1E34}{\ubaraccent{K}}
- \DeclareUnicodeCharacter{1E35}{\ubaraccent{k}}
- \DeclareUnicodeCharacter{1E36}{\udotaccent{L}}
- \DeclareUnicodeCharacter{1E37}{\udotaccent{l}}
- \DeclareUnicodeCharacter{1E3A}{\ubaraccent{L}}
- \DeclareUnicodeCharacter{1E3B}{\ubaraccent{l}}
- \DeclareUnicodeCharacter{1E3E}{\'M}
- \DeclareUnicodeCharacter{1E3F}{\'m}
-
- \DeclareUnicodeCharacter{1E40}{\dotaccent{M}}
- \DeclareUnicodeCharacter{1E41}{\dotaccent{m}}
- \DeclareUnicodeCharacter{1E42}{\udotaccent{M}}
- \DeclareUnicodeCharacter{1E43}{\udotaccent{m}}
- \DeclareUnicodeCharacter{1E44}{\dotaccent{N}}
- \DeclareUnicodeCharacter{1E45}{\dotaccent{n}}
- \DeclareUnicodeCharacter{1E46}{\udotaccent{N}}
- \DeclareUnicodeCharacter{1E47}{\udotaccent{n}}
- \DeclareUnicodeCharacter{1E48}{\ubaraccent{N}}
- \DeclareUnicodeCharacter{1E49}{\ubaraccent{n}}
-
- \DeclareUnicodeCharacter{1E54}{\'P}
- \DeclareUnicodeCharacter{1E55}{\'p}
- \DeclareUnicodeCharacter{1E56}{\dotaccent{P}}
- \DeclareUnicodeCharacter{1E57}{\dotaccent{p}}
- \DeclareUnicodeCharacter{1E58}{\dotaccent{R}}
- \DeclareUnicodeCharacter{1E59}{\dotaccent{r}}
- \DeclareUnicodeCharacter{1E5A}{\udotaccent{R}}
- \DeclareUnicodeCharacter{1E5B}{\udotaccent{r}}
- \DeclareUnicodeCharacter{1E5E}{\ubaraccent{R}}
- \DeclareUnicodeCharacter{1E5F}{\ubaraccent{r}}
-
- \DeclareUnicodeCharacter{1E60}{\dotaccent{S}}
- \DeclareUnicodeCharacter{1E61}{\dotaccent{s}}
- \DeclareUnicodeCharacter{1E62}{\udotaccent{S}}
- \DeclareUnicodeCharacter{1E63}{\udotaccent{s}}
- \DeclareUnicodeCharacter{1E6A}{\dotaccent{T}}
- \DeclareUnicodeCharacter{1E6B}{\dotaccent{t}}
- \DeclareUnicodeCharacter{1E6C}{\udotaccent{T}}
- \DeclareUnicodeCharacter{1E6D}{\udotaccent{t}}
- \DeclareUnicodeCharacter{1E6E}{\ubaraccent{T}}
- \DeclareUnicodeCharacter{1E6F}{\ubaraccent{t}}
-
- \DeclareUnicodeCharacter{1E7C}{\~V}
- \DeclareUnicodeCharacter{1E7D}{\~v}
- \DeclareUnicodeCharacter{1E7E}{\udotaccent{V}}
- \DeclareUnicodeCharacter{1E7F}{\udotaccent{v}}
-
- \DeclareUnicodeCharacter{1E80}{\`W}
- \DeclareUnicodeCharacter{1E81}{\`w}
- \DeclareUnicodeCharacter{1E82}{\'W}
- \DeclareUnicodeCharacter{1E83}{\'w}
- \DeclareUnicodeCharacter{1E84}{\"W}
- \DeclareUnicodeCharacter{1E85}{\"w}
- \DeclareUnicodeCharacter{1E86}{\dotaccent{W}}
- \DeclareUnicodeCharacter{1E87}{\dotaccent{w}}
- \DeclareUnicodeCharacter{1E88}{\udotaccent{W}}
- \DeclareUnicodeCharacter{1E89}{\udotaccent{w}}
- \DeclareUnicodeCharacter{1E8A}{\dotaccent{X}}
- \DeclareUnicodeCharacter{1E8B}{\dotaccent{x}}
- \DeclareUnicodeCharacter{1E8C}{\"X}
- \DeclareUnicodeCharacter{1E8D}{\"x}
- \DeclareUnicodeCharacter{1E8E}{\dotaccent{Y}}
- \DeclareUnicodeCharacter{1E8F}{\dotaccent{y}}
-
- \DeclareUnicodeCharacter{1E90}{\^Z}
- \DeclareUnicodeCharacter{1E91}{\^z}
- \DeclareUnicodeCharacter{1E92}{\udotaccent{Z}}
- \DeclareUnicodeCharacter{1E93}{\udotaccent{z}}
- \DeclareUnicodeCharacter{1E94}{\ubaraccent{Z}}
- \DeclareUnicodeCharacter{1E95}{\ubaraccent{z}}
- \DeclareUnicodeCharacter{1E96}{\ubaraccent{h}}
- \DeclareUnicodeCharacter{1E97}{\"t}
- \DeclareUnicodeCharacter{1E98}{\ringaccent{w}}
- \DeclareUnicodeCharacter{1E99}{\ringaccent{y}}
-
- \DeclareUnicodeCharacter{1EA0}{\udotaccent{A}}
- \DeclareUnicodeCharacter{1EA1}{\udotaccent{a}}
-
- \DeclareUnicodeCharacter{1EB8}{\udotaccent{E}}
- \DeclareUnicodeCharacter{1EB9}{\udotaccent{e}}
- \DeclareUnicodeCharacter{1EBC}{\~E}
- \DeclareUnicodeCharacter{1EBD}{\~e}
-
- \DeclareUnicodeCharacter{1ECA}{\udotaccent{I}}
- \DeclareUnicodeCharacter{1ECB}{\udotaccent{i}}
- \DeclareUnicodeCharacter{1ECC}{\udotaccent{O}}
- \DeclareUnicodeCharacter{1ECD}{\udotaccent{o}}
-
- \DeclareUnicodeCharacter{1EE4}{\udotaccent{U}}
- \DeclareUnicodeCharacter{1EE5}{\udotaccent{u}}
-
- \DeclareUnicodeCharacter{1EF2}{\`Y}
- \DeclareUnicodeCharacter{1EF3}{\`y}
- \DeclareUnicodeCharacter{1EF4}{\udotaccent{Y}}
-
- \DeclareUnicodeCharacter{1EF8}{\~Y}
- \DeclareUnicodeCharacter{1EF9}{\~y}
-
- \DeclareUnicodeCharacter{2013}{--}
- \DeclareUnicodeCharacter{2014}{---}
- \DeclareUnicodeCharacter{2018}{\quoteleft}
- \DeclareUnicodeCharacter{2019}{\quoteright}
- \DeclareUnicodeCharacter{201A}{\quotesinglbase}
- \DeclareUnicodeCharacter{201C}{\quotedblleft}
- \DeclareUnicodeCharacter{201D}{\quotedblright}
- \DeclareUnicodeCharacter{201E}{\quotedblbase}
- \DeclareUnicodeCharacter{2022}{\bullet}
- \DeclareUnicodeCharacter{2026}{\dots}
- \DeclareUnicodeCharacter{2039}{\guilsinglleft}
- \DeclareUnicodeCharacter{203A}{\guilsinglright}
- \DeclareUnicodeCharacter{20AC}{\euro}
-
- \DeclareUnicodeCharacter{2192}{\expansion}
- \DeclareUnicodeCharacter{21D2}{\result}
-
- \DeclareUnicodeCharacter{2212}{\minus}
- \DeclareUnicodeCharacter{2217}{\point}
- \DeclareUnicodeCharacter{2261}{\equiv}
-}% end of \utfeightchardefs
-
-
-% US-ASCII character definitions.
-\def\asciichardefs{% nothing need be done
- \relax
-}
-
-% Make non-ASCII characters printable again for compatibility with
-% existing Texinfo documents that may use them, even without declaring a
-% document encoding.
-%
-\setnonasciicharscatcode \other
-
-
-\message{formatting,}
-
-\newdimen\defaultparindent \defaultparindent = 15pt
-
-\chapheadingskip = 15pt plus 4pt minus 2pt
-\secheadingskip = 12pt plus 3pt minus 2pt
-\subsecheadingskip = 9pt plus 2pt minus 2pt
-
-% Prevent underfull vbox error messages.
-\vbadness = 10000
-
-% Don't be very finicky about underfull hboxes, either.
-\hbadness = 6666
-
-% Following George Bush, get rid of widows and orphans.
-\widowpenalty=10000
-\clubpenalty=10000
-
-% Use TeX 3.0's \emergencystretch to help line breaking, but if we're
-% using an old version of TeX, don't do anything. We want the amount of
-% stretch added to depend on the line length, hence the dependence on
-% \hsize. We call this whenever the paper size is set.
-%
-\def\setemergencystretch{%
- \ifx\emergencystretch\thisisundefined
- % Allow us to assign to \emergencystretch anyway.
- \def\emergencystretch{\dimen0}%
- \else
- \emergencystretch = .15\hsize
- \fi
-}
-
-% Parameters in order: 1) textheight; 2) textwidth;
-% 3) voffset; 4) hoffset; 5) binding offset; 6) topskip;
-% 7) physical page height; 8) physical page width.
-%
-% We also call \setleading{\textleading}, so the caller should define
-% \textleading. The caller should also set \parskip.
-%
-\def\internalpagesizes#1#2#3#4#5#6#7#8{%
- \voffset = #3\relax
- \topskip = #6\relax
- \splittopskip = \topskip
- %
- \vsize = #1\relax
- \advance\vsize by \topskip
- \outervsize = \vsize
- \advance\outervsize by 2\topandbottommargin
- \pageheight = \vsize
- %
- \hsize = #2\relax
- \outerhsize = \hsize
- \advance\outerhsize by 0.5in
- \pagewidth = \hsize
- %
- \normaloffset = #4\relax
- \bindingoffset = #5\relax
- %
- \ifpdf
- \pdfpageheight #7\relax
- \pdfpagewidth #8\relax
- % if we don't reset these, they will remain at "1 true in" of
- % whatever layout pdftex was dumped with.
- \pdfhorigin = 1 true in
- \pdfvorigin = 1 true in
- \fi
- %
- \setleading{\textleading}
- %
- \parindent = \defaultparindent
- \setemergencystretch
-}
-
-% @letterpaper (the default).
-\def\letterpaper{{\globaldefs = 1
- \parskip = 3pt plus 2pt minus 1pt
- \textleading = 13.2pt
- %
- % If page is nothing but text, make it come out even.
- \internalpagesizes{607.2pt}{6in}% that's 46 lines
- {\voffset}{.25in}%
- {\bindingoffset}{36pt}%
- {11in}{8.5in}%
-}}
-
-% Use @smallbook to reset parameters for 7x9.25 trim size.
-\def\smallbook{{\globaldefs = 1
- \parskip = 2pt plus 1pt
- \textleading = 12pt
- %
- \internalpagesizes{7.5in}{5in}%
- {-.2in}{0in}%
- {\bindingoffset}{16pt}%
- {9.25in}{7in}%
- %
- \lispnarrowing = 0.3in
- \tolerance = 700
- \hfuzz = 1pt
- \contentsrightmargin = 0pt
- \defbodyindent = .5cm
-}}
-
-% Use @smallerbook to reset parameters for 6x9 trim size.
-% (Just testing, parameters still in flux.)
-\def\smallerbook{{\globaldefs = 1
- \parskip = 1.5pt plus 1pt
- \textleading = 12pt
- %
- \internalpagesizes{7.4in}{4.8in}%
- {-.2in}{-.4in}%
- {0pt}{14pt}%
- {9in}{6in}%
- %
- \lispnarrowing = 0.25in
- \tolerance = 700
- \hfuzz = 1pt
- \contentsrightmargin = 0pt
- \defbodyindent = .4cm
-}}
-
-% Use @afourpaper to print on European A4 paper.
-\def\afourpaper{{\globaldefs = 1
- \parskip = 3pt plus 2pt minus 1pt
- \textleading = 13.2pt
- %
- % Double-side printing via postscript on Laserjet 4050
- % prints double-sided nicely when \bindingoffset=10mm and \hoffset=-6mm.
- % To change the settings for a different printer or situation, adjust
- % \normaloffset until the front-side and back-side texts align. Then
- % do the same for \bindingoffset. You can set these for testing in
- % your texinfo source file like this:
- % @tex
- % \global\normaloffset = -6mm
- % \global\bindingoffset = 10mm
- % @end tex
- \internalpagesizes{673.2pt}{160mm}% that's 51 lines
- {\voffset}{\hoffset}%
- {\bindingoffset}{44pt}%
- {297mm}{210mm}%
- %
- \tolerance = 700
- \hfuzz = 1pt
- \contentsrightmargin = 0pt
- \defbodyindent = 5mm
-}}
-
-% Use @afivepaper to print on European A5 paper.
-% From romildo@urano.iceb.ufop.br, 2 July 2000.
-% He also recommends making @example and @lisp be small.
-\def\afivepaper{{\globaldefs = 1
- \parskip = 2pt plus 1pt minus 0.1pt
- \textleading = 12.5pt
- %
- \internalpagesizes{160mm}{120mm}%
- {\voffset}{\hoffset}%
- {\bindingoffset}{8pt}%
- {210mm}{148mm}%
- %
- \lispnarrowing = 0.2in
- \tolerance = 800
- \hfuzz = 1.2pt
- \contentsrightmargin = 0pt
- \defbodyindent = 2mm
- \tableindent = 12mm
-}}
-
-% A specific text layout, 24x15cm overall, intended for A4 paper.
-\def\afourlatex{{\globaldefs = 1
- \afourpaper
- \internalpagesizes{237mm}{150mm}%
- {\voffset}{4.6mm}%
- {\bindingoffset}{7mm}%
- {297mm}{210mm}%
- %
- % Must explicitly reset to 0 because we call \afourpaper.
- \globaldefs = 0
-}}
-
-% Use @afourwide to print on A4 paper in landscape format.
-\def\afourwide{{\globaldefs = 1
- \afourpaper
- \internalpagesizes{241mm}{165mm}%
- {\voffset}{-2.95mm}%
- {\bindingoffset}{7mm}%
- {297mm}{210mm}%
- \globaldefs = 0
-}}
-
-% @pagesizes TEXTHEIGHT[,TEXTWIDTH]
-% Perhaps we should allow setting the margins, \topskip, \parskip,
-% and/or leading, also. Or perhaps we should compute them somehow.
-%
-\parseargdef\pagesizes{\pagesizesyyy #1,,\finish}
-\def\pagesizesyyy#1,#2,#3\finish{{%
- \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \hsize=#2\relax \fi
- \globaldefs = 1
- %
- \parskip = 3pt plus 2pt minus 1pt
- \setleading{\textleading}%
- %
- \dimen0 = #1\relax
- \advance\dimen0 by \voffset
- %
- \dimen2 = \hsize
- \advance\dimen2 by \normaloffset
- %
- \internalpagesizes{#1}{\hsize}%
- {\voffset}{\normaloffset}%
- {\bindingoffset}{44pt}%
- {\dimen0}{\dimen2}%
-}}
-
-% Set default to letter.
-%
-\letterpaper
-
-
-\message{and turning on texinfo input format.}
-
-\def^^L{\par} % remove \outer, so ^L can appear in an @comment
-
-% DEL is a comment character, in case @c does not suffice.
-\catcode`\^^? = 14
-
-% Define macros to output various characters with catcode for normal text.
-\catcode`\"=\other \def\normaldoublequote{"}
-\catcode`\$=\other \def\normaldollar{$}%$ font-lock fix
-\catcode`\+=\other \def\normalplus{+}
-\catcode`\<=\other \def\normalless{<}
-\catcode`\>=\other \def\normalgreater{>}
-\catcode`\^=\other \def\normalcaret{^}
-\catcode`\_=\other \def\normalunderscore{_}
-\catcode`\|=\other \def\normalverticalbar{|}
-\catcode`\~=\other \def\normaltilde{~}
-
-% This macro is used to make a character print one way in \tt
-% (where it can probably be output as-is), and another way in other fonts,
-% where something hairier probably needs to be done.
-%
-% #1 is what to print if we are indeed using \tt; #2 is what to print
-% otherwise. Since all the Computer Modern typewriter fonts have zero
-% interword stretch (and shrink), and it is reasonable to expect all
-% typewriter fonts to have this, we can check that font parameter.
-%
-\def\ifusingtt#1#2{\ifdim \fontdimen3\font=0pt #1\else #2\fi}
-
-% Same as above, but check for italic font. Actually this also catches
-% non-italic slanted fonts since it is impossible to distinguish them from
-% italic fonts. But since this is only used by $ and it uses \sl anyway
-% this is not a problem.
-\def\ifusingit#1#2{\ifdim \fontdimen1\font>0pt #1\else #2\fi}
-
-% Turn off all special characters except @
-% (and those which the user can use as if they were ordinary).
-% Most of these we simply print from the \tt font, but for some, we can
-% use math or other variants that look better in normal text.
-
-\catcode`\"=\active
-\def\activedoublequote{{\tt\char34}}
-\let"=\activedoublequote
-\catcode`\~=\active
-\def~{{\tt\char126}}
-\chardef\hat=`\^
-\catcode`\^=\active
-\def^{{\tt \hat}}
-
-\catcode`\_=\active
-\def_{\ifusingtt\normalunderscore\_}
-\let\realunder=_
-% Subroutine for the previous macro.
-\def\_{\leavevmode \kern.07em \vbox{\hrule width.3em height.1ex}\kern .07em }
-
-\catcode`\|=\active
-\def|{{\tt\char124}}
-\chardef \less=`\<
-\catcode`\<=\active
-\def<{{\tt \less}}
-\chardef \gtr=`\>
-\catcode`\>=\active
-\def>{{\tt \gtr}}
-\catcode`\+=\active
-\def+{{\tt \char 43}}
-\catcode`\$=\active
-\def${\ifusingit{{\sl\$}}\normaldollar}%$ font-lock fix
-
-% If a .fmt file is being used, characters that might appear in a file
-% name cannot be active until we have parsed the command line.
-% So turn them off again, and have \everyjob (or @setfilename) turn them on.
-% \otherifyactive is called near the end of this file.
-\def\otherifyactive{\catcode`+=\other \catcode`\_=\other}
-
-% Used sometimes to turn off (effectively) the active characters even after
-% parsing them.
-\def\turnoffactive{%
- \normalturnoffactive
- \otherbackslash
-}
-
-\catcode`\@=0
-
-% \backslashcurfont outputs one backslash character in current font,
-% as in \char`\\.
-\global\chardef\backslashcurfont=`\\
-\global\let\rawbackslashxx=\backslashcurfont % let existing .??s files work
-
-% \realbackslash is an actual character `\' with catcode other, and
-% \doublebackslash is two of them (for the pdf outlines).
-{\catcode`\\=\other @gdef@realbackslash{\} @gdef@doublebackslash{\\}}
-
-% In texinfo, backslash is an active character; it prints the backslash
-% in fixed width font.
-\catcode`\\=\active % @ for escape char from now on.
-
-% The story here is that in math mode, the \char of \backslashcurfont
-% ends up printing the roman \ from the math symbol font (because \char
-% in math mode uses the \mathcode, and plain.tex sets
-% \mathcode`\\="026E). It seems better for @backslashchar{} to always
-% print a typewriter backslash, hence we use an explicit \mathchar,
-% which is the decimal equivalent of "715c (class 7, e.g., use \fam;
-% ignored family value; char position "5C). We can't use " for the
-% usual hex value because it has already been made active.
-@def@normalbackslash{{@tt @ifmmode @mathchar29020 @else @backslashcurfont @fi}}
-@let@backslashchar = @normalbackslash % @backslashchar{} is for user documents.
-
-% On startup, @fixbackslash assigns:
-% @let \ = @normalbackslash
-% \rawbackslash defines an active \ to do \backslashcurfont.
-% \otherbackslash defines an active \ to be a literal `\' character with
-% catcode other. We switch back and forth between these.
-@gdef@rawbackslash{@let\=@backslashcurfont}
-@gdef@otherbackslash{@let\=@realbackslash}
-
-% Same as @turnoffactive except outputs \ as {\tt\char`\\} instead of
-% the literal character `\'. Also revert - to its normal character, in
-% case the active - from code has slipped in.
-%
-{@catcode`- = @active
- @gdef@normalturnoffactive{%
- @let-=@normaldash
- @let"=@normaldoublequote
- @let$=@normaldollar %$ font-lock fix
- @let+=@normalplus
- @let<=@normalless
- @let>=@normalgreater
- @let\=@normalbackslash
- @let^=@normalcaret
- @let_=@normalunderscore
- @let|=@normalverticalbar
- @let~=@normaltilde
- @markupsetuplqdefault
- @markupsetuprqdefault
- @unsepspaces
- }
-}
-
-% Make _ and + \other characters, temporarily.
-% This is canceled by @fixbackslash.
-@otherifyactive
-
-% If a .fmt file is being used, we don't want the `\input texinfo' to show up.
-% That is what \eatinput is for; after that, the `\' should revert to printing
-% a backslash.
-%
-@gdef@eatinput input texinfo{@fixbackslash}
-@global@let\ = @eatinput
-
-% On the other hand, perhaps the file did not have a `\input texinfo'. Then
-% the first `\' in the file would cause an error. This macro tries to fix
-% that, assuming it is called before the first `\' could plausibly occur.
-% Also turn back on active characters that might appear in the input
-% file name, in case not using a pre-dumped format.
-%
-@gdef@fixbackslash{%
- @ifx\@eatinput @let\ = @normalbackslash @fi
- @catcode`+=@active
- @catcode`@_=@active
-}
-
-% Say @foo, not \foo, in error messages.
-@escapechar = `@@
-
-% These (along with & and #) are made active for url-breaking, so need
-% active definitions as the normal characters.
-@def@normaldot{.}
-@def@normalquest{?}
-@def@normalslash{/}
-
-% These look ok in all fonts, so just make them not special.
-% @hashchar{} gets its own user-level command, because of #line.
-@catcode`@& = @other @def@normalamp{&}
-@catcode`@# = @other @def@normalhash{#}
-@catcode`@% = @other @def@normalpercent{%}
-
-@let @hashchar = @normalhash
-
-@c Finally, make ` and ' active, so that txicodequoteundirected and
-@c txicodequotebacktick work right in, e.g., @w{@code{`foo'}}. If we
-@c don't make ` and ' active, @code will not get them as active chars.
-@c Do this last of all since we use ` in the previous @catcode assignments.
-@catcode`@'=@active
-@catcode`@`=@active
-@markupsetuplqdefault
-@markupsetuprqdefault
-
-@c Local variables:
-@c eval: (add-hook 'write-file-hooks 'time-stamp)
-@c page-delimiter: "^\\\\message"
-@c time-stamp-start: "def\\\\texinfoversion{"
-@c time-stamp-format: "%:y-%02m-%02d.%02H"
-@c time-stamp-end: "}"
-@c End:
-
-@c vim:sw=2:
-
-@ignore
- arch-tag: e1b36e32-c96e-4135-a41a-0b2efa2ea115
-@end ignore
diff --git a/Modules/_ctypes/stgdict.c b/Modules/_ctypes/stgdict.c
index 716d1e9e8e..1ccaf2fd9b 100644
--- a/Modules/_ctypes/stgdict.c
+++ b/Modules/_ctypes/stgdict.c
@@ -228,7 +228,7 @@ MakeFields(PyObject *type, CFieldObject *descr,
}
continue;
}
- new_descr = (CFieldObject *)PyObject_CallObject((PyObject *)&PyCField_Type, NULL);
+ new_descr = (CFieldObject *)_PyObject_CallNoArg((PyObject *)&PyCField_Type);
if (new_descr == NULL) {
Py_DECREF(fdescr);
Py_DECREF(fieldlist);
@@ -488,8 +488,8 @@ PyCStructUnionType_update_stgdict(PyObject *type, PyObject *fields, int isStruct
bitsize = 0;
if (isStruct && !isPacked) {
- char *fieldfmt = dict->format ? dict->format : "B";
- char *fieldname = PyUnicode_AsUTF8(name);
+ const char *fieldfmt = dict->format ? dict->format : "B";
+ const char *fieldname = PyUnicode_AsUTF8(name);
char *ptr;
Py_ssize_t len;
char *buf;
diff --git a/Modules/_curses_panel.c b/Modules/_curses_panel.c
index 18ef335b82..a98d2bf3f8 100644
--- a/Modules/_curses_panel.c
+++ b/Modules/_curses_panel.c
@@ -59,8 +59,7 @@ static PyObject *
PyCursesCheckERR(int code, const char *fname)
{
if (code != ERR) {
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
} else {
if (fname == NULL) {
PyErr_SetString(_curses_panelstate_global->PyCursesError, catchall_ERR);
@@ -177,8 +176,8 @@ static PyObject *PyCursesPanel_##X(PyCursesPanelObject *self) \
#define Panel_NoArgTrueFalseFunction(X) \
static PyObject *PyCursesPanel_##X(PyCursesPanelObject *self) \
{ \
- if (X (self->pan) == FALSE) { Py_INCREF(Py_False); return Py_False; } \
- else { Py_INCREF(Py_True); return Py_True; } }
+ if (X (self->pan) == FALSE) { Py_RETURN_FALSE; } \
+ else { Py_RETURN_TRUE; } }
#define Panel_TwoArgNoReturnFunction(X, TYPE, PARSESTR) \
static PyObject *PyCursesPanel_##X(PyCursesPanelObject *self, PyObject *args) \
@@ -245,8 +244,7 @@ PyCursesPanel_above(PyCursesPanelObject *self)
if (pan == NULL) { /* valid output, it means the calling panel
is on top of the stack */
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
po = find_po(pan);
if (po == NULL) {
@@ -270,8 +268,7 @@ PyCursesPanel_below(PyCursesPanelObject *self)
if (pan == NULL) { /* valid output, it means the calling panel
is on the bottom of the stack */
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
po = find_po(pan);
if (po == NULL) {
@@ -319,8 +316,7 @@ PyCursesPanel_replace_panel(PyCursesPanelObject *self, PyObject *args)
}
Py_INCREF(temp);
Py_SETREF(po->wo, temp);
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
static PyObject *
@@ -406,8 +402,7 @@ PyCurses_bottom_panel(PyObject *self)
if (pan == NULL) { /* valid output, it means
there's no panel at all */
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
po = find_po(pan);
if (po == NULL) {
@@ -452,8 +447,7 @@ PyCurses_top_panel(PyObject *self)
if (pan == NULL) { /* valid output, it means
there's no panel at all */
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
po = find_po(pan);
if (po == NULL) {
@@ -469,8 +463,7 @@ static PyObject *PyCurses_update_panels(PyObject *self)
{
PyCursesInitialised;
update_panels();
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
diff --git a/Modules/_cursesmodule.c b/Modules/_cursesmodule.c
index 3bf2ca7ce1..e6a2f25121 100644
--- a/Modules/_cursesmodule.c
+++ b/Modules/_cursesmodule.c
@@ -188,8 +188,7 @@ static PyObject *
PyCursesCheckERR(int code, const char *fname)
{
if (code != ERR) {
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
} else {
if (fname == NULL) {
PyErr_SetString(PyCursesError, catchall_ERR);
@@ -414,14 +413,14 @@ PyTypeObject PyCursesWindow_Type;
static PyObject * PyCursesWindow_ ## X \
(PyCursesWindowObject *self) \
{ \
- if (X (self->win) == FALSE) { Py_INCREF(Py_False); return Py_False; } \
- else { Py_INCREF(Py_True); return Py_True; } }
+ if (X (self->win) == FALSE) { Py_RETURN_FALSE; } \
+ else { Py_RETURN_TRUE; } }
#define Window_NoArgNoReturnVoidFunction(X) \
static PyObject * PyCursesWindow_ ## X \
(PyCursesWindowObject *self) \
{ \
- X(self->win); Py_INCREF(Py_None); return Py_None; }
+ X(self->win); Py_RETURN_NONE; }
#define Window_NoArg2TupleReturnFunction(X, TYPE, ERGSTR) \
static PyObject * PyCursesWindow_ ## X \
@@ -436,7 +435,7 @@ PyTypeObject PyCursesWindow_Type;
{ \
TYPE arg1; \
if (!PyArg_ParseTuple(args, PARSESTR, &arg1)) return NULL; \
- X(self->win,arg1); Py_INCREF(Py_None); return Py_None; }
+ X(self->win,arg1); Py_RETURN_NONE; }
#define Window_OneArgNoReturnFunction(X, TYPE, PARSESTR) \
static PyObject * PyCursesWindow_ ## X \
@@ -594,7 +593,7 @@ curses_window_addch_impl(PyCursesWindowObject *self, int group_left_1, int y,
int attr_group = group_right_1;
int rtn;
int type;
- chtype cch;
+ chtype cch = 0;
#ifdef HAVE_NCURSESW
wchar_t wstr[2];
cchar_t wcval;
@@ -900,8 +899,7 @@ PyCursesWindow_Border(PyCursesWindowObject *self, PyObject *args)
wborder(self->win,
ch[0], ch[1], ch[2], ch[3],
ch[4], ch[5], ch[6], ch[7]);
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
static PyObject *
@@ -915,8 +913,7 @@ PyCursesWindow_Box(PyCursesWindowObject *self, PyObject *args)
return NULL;
}
box(self->win,ch1,ch2);
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
#if defined(HAVE_NCURSES_H) || defined(MVWDELCH_IS_EXPRESSION)
@@ -1593,11 +1590,9 @@ PyCursesWindow_Is_LineTouched(PyCursesWindowObject *self, PyObject *args)
return NULL;
} else
if (erg == FALSE) {
- Py_INCREF(Py_False);
- return Py_False;
+ Py_RETURN_FALSE;
} else {
- Py_INCREF(Py_True);
- return Py_True;
+ Py_RETURN_TRUE;
}
}
@@ -2158,8 +2153,7 @@ PyCurses_filter(PyObject *self)
/* not checking for PyCursesInitialised here since filter() must
be called before initscr() */
filter();
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
static PyObject *
@@ -2365,11 +2359,9 @@ static PyObject * PyCurses_has_key(PyObject *self, PyObject *args)
if (!PyArg_ParseTuple(args,"i",&ch)) return NULL;
if (has_key(ch) == FALSE) {
- Py_INCREF(Py_False);
- return Py_False;
+ Py_RETURN_FALSE;
}
- Py_INCREF(Py_True);
- return Py_True;
+ Py_RETURN_TRUE;
}
#endif /* STRICT_SYSV_CURSES */
@@ -2566,8 +2558,7 @@ PyCurses_setupterm(PyObject* self, PyObject *args, PyObject* keywds)
initialised_setupterm = TRUE;
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
static PyObject *
@@ -2603,11 +2594,9 @@ PyCurses_Is_Term_Resized(PyObject *self, PyObject *args)
return NULL;
result = is_term_resized(lines, columns);
if (result == TRUE) {
- Py_INCREF(Py_True);
- return Py_True;
+ Py_RETURN_TRUE;
} else {
- Py_INCREF(Py_False);
- return Py_False;
+ Py_RETURN_FALSE;
}
}
#endif /* HAVE_CURSES_IS_TERM_RESIZED */
@@ -2819,14 +2808,12 @@ PyCurses_QiFlush(PyObject *self, PyObject *args)
switch(PyTuple_Size(args)) {
case 0:
qiflush();
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
case 1:
if (!PyArg_ParseTuple(args, "i;True(1) or False(0)", &flag)) return NULL;
if (flag) qiflush();
else noqiflush();
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
default:
PyErr_SetString(PyExc_TypeError, "qiflush requires 0 or 1 arguments");
return NULL;
@@ -2954,8 +2941,7 @@ PyCurses_setsyx(PyObject *self, PyObject *args)
setsyx(y,x);
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
static PyObject *
@@ -2979,8 +2965,7 @@ PyCurses_Start_Color(PyObject *self)
return NULL;
PyDict_SetItemString(ModDict, "COLOR_PAIRS", cp);
Py_DECREF(cp);
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
} else {
PyErr_SetString(PyCursesError, "start_color() returned ERR");
return NULL;
@@ -3025,8 +3010,7 @@ PyCurses_tigetstr(PyObject *self, PyObject *args)
capname = tigetstr( capname );
if (capname == 0 || capname == (char*) -1) {
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
return PyBytes_FromString( capname );
}
@@ -3180,8 +3164,7 @@ PyCurses_Use_Env(PyObject *self, PyObject *args)
return NULL;
}
use_env(flag);
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
#ifndef STRICT_SYSV_CURSES
@@ -3195,8 +3178,7 @@ PyCurses_Use_Default_Colors(PyObject *self)
code = use_default_colors();
if (code != ERR) {
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
} else {
PyErr_SetString(PyCursesError, "use_default_colors() returned ERR");
return NULL;
diff --git a/Modules/_datetimemodule.c b/Modules/_datetimemodule.c
index 291920dc0f..205b15bb18 100644
--- a/Modules/_datetimemodule.c
+++ b/Modules/_datetimemodule.c
@@ -987,7 +987,8 @@ call_tzname(PyObject *tzinfo, PyObject *tzinfoarg)
if (tzinfo == Py_None)
Py_RETURN_NONE;
- result = _PyObject_CallMethodId(tzinfo, &PyId_tzname, "O", tzinfoarg);
+ result = _PyObject_CallMethodIdObjArgs(tzinfo, &PyId_tzname,
+ tzinfoarg, NULL);
if (result == NULL || result == Py_None)
return result;
@@ -1343,8 +1344,8 @@ wrap_strftime(PyObject *object, PyObject *format, PyObject *timetuple,
goto Done;
format = PyUnicode_FromString(PyBytes_AS_STRING(newfmt));
if (format != NULL) {
- result = _PyObject_CallMethodId(time, &PyId_strftime, "OO",
- format, timetuple, NULL);
+ result = _PyObject_CallMethodIdObjArgs(time, &PyId_strftime,
+ format, timetuple, NULL);
Py_DECREF(format);
}
Py_DECREF(time);
@@ -1385,21 +1386,31 @@ static PyObject *
build_struct_time(int y, int m, int d, int hh, int mm, int ss, int dstflag)
{
PyObject *time;
- PyObject *result = NULL;
+ PyObject *result;
+ _Py_IDENTIFIER(struct_time);
+ PyObject *args;
+
time = PyImport_ImportModuleNoBlock("time");
- if (time != NULL) {
- _Py_IDENTIFIER(struct_time);
-
- result = _PyObject_CallMethodId(time, &PyId_struct_time,
- "((iiiiiiiii))",
- y, m, d,
- hh, mm, ss,
- weekday(y, m, d),
- days_before_month(y, m) + d,
- dstflag);
+ if (time == NULL) {
+ return NULL;
+ }
+
+ args = Py_BuildValue("iiiiiiiii",
+ y, m, d,
+ hh, mm, ss,
+ weekday(y, m, d),
+ days_before_month(y, m) + d,
+ dstflag);
+ if (args == NULL) {
Py_DECREF(time);
+ return NULL;
}
+
+ result = _PyObject_CallMethodIdObjArgs(time, &PyId_struct_time,
+ args, NULL);
+ Py_DECREF(time);
+ Py_DECREF(args);
return result;
}
@@ -2548,7 +2559,8 @@ date_today(PyObject *cls, PyObject *dummy)
* time.time() delivers; if someone were gonzo about optimization,
* date.today() could get away with plain C time().
*/
- result = _PyObject_CallMethodId(cls, &PyId_fromtimestamp, "O", time);
+ result = _PyObject_CallMethodIdObjArgs(cls, &PyId_fromtimestamp,
+ time, NULL);
Py_DECREF(time);
return result;
}
@@ -2736,7 +2748,8 @@ date_format(PyDateTime_Date *self, PyObject *args)
if (PyUnicode_GetLength(format) == 0)
return PyObject_Str((PyObject *)self);
- return _PyObject_CallMethodId((PyObject *)self, &PyId_strftime, "O", format);
+ return _PyObject_CallMethodIdObjArgs((PyObject *)self, &PyId_strftime,
+ format, NULL);
}
/* ISO methods. */
@@ -3156,7 +3169,7 @@ tzinfo_reduce(PyObject *self)
PyErr_Clear();
state = Py_None;
dictptr = _PyObject_GetDictPtr(self);
- if (dictptr && *dictptr && PyDict_Size(*dictptr)) {
+ if (dictptr && *dictptr && PyDict_GET_SIZE(*dictptr)) {
state = *dictptr;
}
Py_INCREF(state);
@@ -3243,9 +3256,8 @@ timezone_new(PyTypeObject *type, PyObject *args, PyObject *kw)
{
PyObject *offset;
PyObject *name = NULL;
- if (PyArg_ParseTupleAndKeywords(args, kw, "O!|O!:timezone", timezone_kws,
- &PyDateTime_DeltaType, &offset,
- &PyUnicode_Type, &name))
+ if (PyArg_ParseTupleAndKeywords(args, kw, "O!|U:timezone", timezone_kws,
+ &PyDateTime_DeltaType, &offset, &name))
return new_timezone(offset, name);
return NULL;
@@ -4420,8 +4432,8 @@ datetime_strptime(PyObject *cls, PyObject *args)
if (module == NULL)
return NULL;
}
- return _PyObject_CallMethodId(module, &PyId__strptime_datetime, "OOO",
- cls, string, format);
+ return _PyObject_CallMethodIdObjArgs(module, &PyId__strptime_datetime,
+ cls, string, format, NULL);
}
/* Return new datetime from date/datetime and time arguments. */
@@ -4674,7 +4686,7 @@ datetime_repr(PyDateTime_DateTime *self)
static PyObject *
datetime_str(PyDateTime_DateTime *self)
{
- return _PyObject_CallMethodId((PyObject *)self, &PyId_isoformat, "(s)", " ");
+ return _PyObject_CallMethodId((PyObject *)self, &PyId_isoformat, "s", " ");
}
static PyObject *
@@ -5218,7 +5230,7 @@ datetime_astimezone(PyDateTime_DateTime *self, PyObject *args, PyObject *kw)
temp = (PyObject *)result;
result = (PyDateTime_DateTime *)
- _PyObject_CallMethodId(tzinfo, &PyId_fromutc, "O", temp);
+ _PyObject_CallMethodIdObjArgs(tzinfo, &PyId_fromutc, temp, NULL);
Py_DECREF(temp);
return result;
diff --git a/Modules/_dbmmodule.c b/Modules/_dbmmodule.c
index 804978a6ac..4b3fac4032 100644
--- a/Modules/_dbmmodule.c
+++ b/Modules/_dbmmodule.c
@@ -187,8 +187,7 @@ _dbm_dbm_close_impl(dbmobject *self)
if (self->di_dbm)
dbm_close(self->di_dbm);
self->di_dbm = NULL;
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
/*[clinic input]
@@ -239,7 +238,7 @@ dbm_contains(PyObject *self, PyObject *arg)
return -1;
}
if (PyUnicode_Check(arg)) {
- key.dptr = PyUnicode_AsUTF8AndSize(arg, &size);
+ key.dptr = (char *)PyUnicode_AsUTF8AndSize(arg, &size);
key.dsize = size;
if (key.dptr == NULL)
return -1;
diff --git a/Modules/_decimal/_decimal.c b/Modules/_decimal/_decimal.c
index fcc1f151cf..933b3f575a 100644
--- a/Modules/_decimal/_decimal.c
+++ b/Modules/_decimal/_decimal.c
@@ -3199,7 +3199,7 @@ dec_format(PyObject *dec, PyObject *args)
}
if (PyUnicode_Check(fmtarg)) {
- fmt = PyUnicode_AsUTF8AndSize(fmtarg, &size);
+ fmt = (char *)PyUnicode_AsUTF8AndSize(fmtarg, &size);
if (fmt == NULL) {
return NULL;
}
diff --git a/Modules/_elementtree.c b/Modules/_elementtree.c
index 2cda98e611..2d623dc262 100644
--- a/Modules/_elementtree.c
+++ b/Modules/_elementtree.c
@@ -150,7 +150,7 @@ list_join(PyObject* list)
static int
is_empty_dict(PyObject *obj)
{
- return PyDict_CheckExact(obj) && PyDict_Size(obj) == 0;
+ return PyDict_CheckExact(obj) && PyDict_GET_SIZE(obj) == 0;
}
@@ -1173,8 +1173,8 @@ _elementtree_Element_find_impl(ElementObject *self, PyObject *path,
if (checkpath(path) || namespaces != Py_None) {
_Py_IDENTIFIER(find);
- return _PyObject_CallMethodId(
- st->elementpath_obj, &PyId_find, "OOO", self, path, namespaces
+ return _PyObject_CallMethodIdObjArgs(
+ st->elementpath_obj, &PyId_find, self, path, namespaces, NULL
);
}
@@ -1218,8 +1218,9 @@ _elementtree_Element_findtext_impl(ElementObject *self, PyObject *path,
elementtreestate *st = ET_STATE_GLOBAL;
if (checkpath(path) || namespaces != Py_None)
- return _PyObject_CallMethodId(
- st->elementpath_obj, &PyId_findtext, "OOOO", self, path, default_value, namespaces
+ return _PyObject_CallMethodIdObjArgs(
+ st->elementpath_obj, &PyId_findtext,
+ self, path, default_value, namespaces, NULL
);
if (!self->extra) {
@@ -1273,8 +1274,8 @@ _elementtree_Element_findall_impl(ElementObject *self, PyObject *path,
if (checkpath(tag) || namespaces != Py_None) {
_Py_IDENTIFIER(findall);
- return _PyObject_CallMethodId(
- st->elementpath_obj, &PyId_findall, "OOO", self, tag, namespaces
+ return _PyObject_CallMethodIdObjArgs(
+ st->elementpath_obj, &PyId_findall, self, tag, namespaces, NULL
);
}
@@ -1320,8 +1321,8 @@ _elementtree_Element_iterfind_impl(ElementObject *self, PyObject *path,
_Py_IDENTIFIER(iterfind);
elementtreestate *st = ET_STATE_GLOBAL;
- return _PyObject_CallMethodId(
- st->elementpath_obj, &PyId_iterfind, "OOO", self, tag, namespaces);
+ return _PyObject_CallMethodIdObjArgs(
+ st->elementpath_obj, &PyId_iterfind, self, tag, namespaces, NULL);
}
/*[clinic input]
@@ -2442,7 +2443,7 @@ treebuilder_add_subelement(PyObject *element, PyObject *child)
}
else {
PyObject *res;
- res = _PyObject_CallMethodId(element, &PyId_append, "O", child);
+ res = _PyObject_CallMethodIdObjArgs(element, &PyId_append, child, NULL);
if (res == NULL)
return -1;
Py_DECREF(res);
@@ -2497,11 +2498,13 @@ treebuilder_handle_start(TreeBuilderObject* self, PyObject* tag,
attrib = PyDict_New();
if (!attrib)
return NULL;
- node = PyObject_CallFunction(self->element_factory, "OO", tag, attrib);
+ node = PyObject_CallFunctionObjArgs(self->element_factory,
+ tag, attrib, NULL);
Py_DECREF(attrib);
}
else {
- node = PyObject_CallFunction(self->element_factory, "OO", tag, attrib);
+ node = PyObject_CallFunctionObjArgs(self->element_factory,
+ tag, attrib, NULL);
}
if (!node) {
return NULL;
@@ -2740,7 +2743,7 @@ typedef struct {
} XMLParserObject;
static PyObject*
-_elementtree_XMLParser_doctype(XMLParserObject* self, PyObject* args);
+_elementtree_XMLParser_doctype(XMLParserObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames);
static PyObject *
_elementtree_XMLParser_doctype_impl(XMLParserObject *self, PyObject *name,
PyObject *pubid, PyObject *system);
@@ -2833,7 +2836,7 @@ expat_set_error(enum XML_Error error_code, Py_ssize_t line, Py_ssize_t column,
if (errmsg == NULL)
return;
- error = PyObject_CallFunction(st->parseerror_obj, "O", errmsg);
+ error = PyObject_CallFunctionObjArgs(st->parseerror_obj, errmsg, NULL);
Py_DECREF(errmsg);
if (!error)
return;
@@ -2896,7 +2899,7 @@ expat_default_handler(XMLParserObject* self, const XML_Char* data_in,
(TreeBuilderObject*) self->target, value
);
else if (self->handle_data)
- res = PyObject_CallFunction(self->handle_data, "O", value);
+ res = PyObject_CallFunctionObjArgs(self->handle_data, value, NULL);
else
res = NULL;
Py_XDECREF(res);
@@ -2978,7 +2981,8 @@ expat_start_handler(XMLParserObject* self, const XML_Char* tag_in,
return;
}
}
- res = PyObject_CallFunction(self->handle_start, "OO", tag, attrib);
+ res = PyObject_CallFunctionObjArgs(self->handle_start,
+ tag, attrib, NULL);
} else
res = NULL;
@@ -3006,7 +3010,7 @@ expat_data_handler(XMLParserObject* self, const XML_Char* data_in,
/* shortcut */
res = treebuilder_handle_data((TreeBuilderObject*) self->target, data);
else if (self->handle_data)
- res = PyObject_CallFunction(self->handle_data, "O", data);
+ res = PyObject_CallFunctionObjArgs(self->handle_data, data, NULL);
else
res = NULL;
@@ -3033,7 +3037,7 @@ expat_end_handler(XMLParserObject* self, const XML_Char* tag_in)
else if (self->handle_end) {
tag = makeuniversal(self, tag_in);
if (tag) {
- res = PyObject_CallFunction(self->handle_end, "O", tag);
+ res = PyObject_CallFunctionObjArgs(self->handle_end, tag, NULL);
Py_DECREF(tag);
}
}
@@ -3092,7 +3096,8 @@ expat_comment_handler(XMLParserObject* self, const XML_Char* comment_in)
if (self->handle_comment) {
comment = PyUnicode_DecodeUTF8(comment_in, strlen(comment_in), "strict");
if (comment) {
- res = PyObject_CallFunction(self->handle_comment, "O", comment);
+ res = PyObject_CallFunctionObjArgs(self->handle_comment,
+ comment, NULL);
Py_XDECREF(res);
Py_DECREF(comment);
}
@@ -3143,8 +3148,9 @@ expat_start_doctype_handler(XMLParserObject *self,
/* If the target has a handler for doctype, call it. */
if (self->handle_doctype) {
- res = PyObject_CallFunction(self->handle_doctype, "OOO",
- doctype_name_obj, pubid_obj, sysid_obj);
+ res = PyObject_CallFunctionObjArgs(self->handle_doctype,
+ doctype_name_obj, pubid_obj,
+ sysid_obj, NULL);
Py_CLEAR(res);
}
else {
@@ -3163,8 +3169,9 @@ expat_start_doctype_handler(XMLParserObject *self,
if (!res)
goto clear;
Py_DECREF(res);
- res = PyObject_CallFunction(parser_doctype, "OOO",
- doctype_name_obj, pubid_obj, sysid_obj);
+ res = PyObject_CallFunctionObjArgs(parser_doctype,
+ doctype_name_obj, pubid_obj,
+ sysid_obj, NULL);
Py_CLEAR(res);
}
}
@@ -3191,7 +3198,8 @@ expat_pi_handler(XMLParserObject* self, const XML_Char* target_in,
target = PyUnicode_DecodeUTF8(target_in, strlen(target_in), "strict");
data = PyUnicode_DecodeUTF8(data_in, strlen(data_in), "strict");
if (target && data) {
- res = PyObject_CallFunction(self->handle_pi, "OO", target, data);
+ res = PyObject_CallFunctionObjArgs(self->handle_pi,
+ target, data, NULL);
Py_XDECREF(res);
Py_DECREF(data);
Py_DECREF(target);
@@ -3615,7 +3623,7 @@ _elementtree_XMLParser__setevents_impl(XMLParserObject *self,
for (i = 0; i < PySequence_Size(events_seq); ++i) {
PyObject *event_name_obj = PySequence_Fast_GET_ITEM(events_seq, i);
- char *event_name = NULL;
+ const char *event_name = NULL;
if (PyUnicode_Check(event_name_obj)) {
event_name = PyUnicode_AsUTF8(event_name_obj);
} else if (PyBytes_Check(event_name_obj)) {
diff --git a/Modules/_functoolsmodule.c b/Modules/_functoolsmodule.c
index f785a7260e..4170883368 100644
--- a/Modules/_functoolsmodule.c
+++ b/Modules/_functoolsmodule.c
@@ -84,7 +84,7 @@ partial_new(PyTypeObject *type, PyObject *args, PyObject *kw)
}
Py_DECREF(nargs);
- if (pkw == NULL || PyDict_Size(pkw) == 0) {
+ if (pkw == NULL || PyDict_GET_SIZE(pkw) == 0) {
if (kw == NULL) {
pto->kw = PyDict_New();
}
@@ -155,7 +155,7 @@ partial_call(partialobject *pto, PyObject *args, PyObject *kw)
assert(PyTuple_Check(argappl));
}
- if (PyDict_Size(pto->kw) == 0) {
+ if (PyDict_GET_SIZE(pto->kw) == 0) {
kwappl = kw;
Py_XINCREF(kwappl);
}
@@ -713,7 +713,7 @@ lru_cache_make_key(PyObject *args, PyObject *kwds, int typed)
return args;
}
- kwds_size = kwds ? PyDict_Size(kwds) : 0;
+ kwds_size = kwds ? PyDict_GET_SIZE(kwds) : 0;
assert(kwds_size >= 0);
key_size = PyTuple_GET_SIZE(args);
@@ -934,7 +934,7 @@ bounded_lru_cache_wrapper(lru_cache_object *self, PyObject *args, PyObject *kwds
}
lru_cache_append_link(self, link);
Py_INCREF(result); /* for return */
- self->full = (PyDict_Size(self->cache) >= self->maxsize);
+ self->full = (PyDict_GET_SIZE(self->cache) >= self->maxsize);
}
self->misses++;
return result;
@@ -1063,7 +1063,7 @@ lru_cache_cache_info(lru_cache_object *self, PyObject *unused)
{
return PyObject_CallFunction(self->cache_info_type, "nnOn",
self->hits, self->misses, self->maxsize_O,
- PyDict_Size(self->cache));
+ PyDict_GET_SIZE(self->cache));
}
static PyObject *
@@ -1247,7 +1247,7 @@ PyInit__functools(void)
if (m == NULL)
return NULL;
- kwd_mark = PyObject_CallObject((PyObject *)&PyBaseObject_Type, NULL);
+ kwd_mark = _PyObject_CallNoArg((PyObject *)&PyBaseObject_Type);
if (!kwd_mark) {
Py_DECREF(m);
return NULL;
diff --git a/Modules/_gdbmmodule.c b/Modules/_gdbmmodule.c
index daae71dc8d..54a6566422 100644
--- a/Modules/_gdbmmodule.c
+++ b/Modules/_gdbmmodule.c
@@ -255,8 +255,7 @@ _gdbm_gdbm_close_impl(dbmobject *self)
if (self->di_dbm)
gdbm_close(self->di_dbm);
self->di_dbm = NULL;
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
/* XXX Should return a set or a set view */
@@ -319,7 +318,7 @@ dbm_contains(PyObject *self, PyObject *arg)
return -1;
}
if (PyUnicode_Check(arg)) {
- key.dptr = PyUnicode_AsUTF8AndSize(arg, &size);
+ key.dptr = (char *)PyUnicode_AsUTF8AndSize(arg, &size);
key.dsize = size;
if (key.dptr == NULL)
return -1;
@@ -375,8 +374,7 @@ _gdbm_gdbm_firstkey_impl(dbmobject *self)
return v;
}
else {
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
}
@@ -415,8 +413,7 @@ _gdbm_gdbm_nextkey_impl(dbmobject *self, const char *key,
return v;
}
else {
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
}
@@ -445,8 +442,7 @@ _gdbm_gdbm_reorganize_impl(dbmobject *self)
PyErr_SetString(DbmError, gdbm_strerror(gdbm_errno));
return NULL;
}
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
/*[clinic input]
@@ -464,8 +460,7 @@ _gdbm_gdbm_sync_impl(dbmobject *self)
{
check_dbmobject_open(self);
gdbm_sync(self->di_dbm);
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
static PyObject *
diff --git a/Modules/_hashopenssl.c b/Modules/_hashopenssl.c
index daa4f3db2e..49952947cb 100644
--- a/Modules/_hashopenssl.c
+++ b/Modules/_hashopenssl.c
@@ -905,13 +905,17 @@ generate_hash_name_list(void)
*/
#define GEN_CONSTRUCTOR(NAME) \
static PyObject * \
- EVP_new_ ## NAME (PyObject *self, PyObject *args) \
+ EVP_new_ ## NAME (PyObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) \
{ \
PyObject *data_obj = NULL; \
Py_buffer view = { 0 }; \
PyObject *ret_obj; \
\
- if (!PyArg_ParseTuple(args, "|O:" #NAME , &data_obj)) { \
+ if (!_PyArg_ParseStack(args, nargs, "|O:" #NAME , &data_obj)) { \
+ return NULL; \
+ } \
+ \
+ if (!_PyArg_NoStackKeywords(#NAME, kwnames)) { \
return NULL; \
} \
\
@@ -932,7 +936,7 @@ generate_hash_name_list(void)
/* a PyMethodDef structure for the constructor */
#define CONSTRUCTOR_METH_DEF(NAME) \
- {"openssl_" #NAME, (PyCFunction)EVP_new_ ## NAME, METH_VARARGS, \
+ {"openssl_" #NAME, (PyCFunction)EVP_new_ ## NAME, METH_FASTCALL, \
PyDoc_STR("Returns a " #NAME \
" hash object; optionally initialized with a string") \
}
diff --git a/Modules/_io/bufferedio.c b/Modules/_io/bufferedio.c
index cbe7425eae..6c88bbb2b0 100644
--- a/Modules/_io/bufferedio.c
+++ b/Modules/_io/bufferedio.c
@@ -305,7 +305,7 @@ _enter_buffered_busy(buffered *self)
"could not acquire lock for %A at interpreter "
"shutdown, possibly due to daemon threads",
(PyObject *) self);
- char *msg = PyUnicode_AsUTF8(msgobj);
+ const char *msg = PyUnicode_AsUTF8(msgobj);
Py_FatalError(msg);
}
return 1;
@@ -454,7 +454,8 @@ buffered_dealloc_warn(buffered *self, PyObject *source)
{
if (self->ok && self->raw) {
PyObject *r;
- r = _PyObject_CallMethodId(self->raw, &PyId__dealloc_warn, "O", source);
+ r = _PyObject_CallMethodIdObjArgs(self->raw, &PyId__dealloc_warn,
+ source, NULL);
if (r)
Py_DECREF(r);
else
@@ -904,7 +905,7 @@ _io__Buffered_read_impl(buffered *self, Py_ssize_t n)
CHECK_INITIALIZED(self)
if (n < -1) {
PyErr_SetString(PyExc_ValueError,
- "read length must be positive or -1");
+ "read length must be non-negative or -1");
return NULL;
}
@@ -932,22 +933,20 @@ _io__Buffered_read_impl(buffered *self, Py_ssize_t n)
/*[clinic input]
_io._Buffered.read1
- size as n: Py_ssize_t
+ size as n: Py_ssize_t = -1
/
[clinic start generated code]*/
static PyObject *
_io__Buffered_read1_impl(buffered *self, Py_ssize_t n)
-/*[clinic end generated code: output=bcc4fb4e54d103a3 input=8d2869c18b983184]*/
+/*[clinic end generated code: output=bcc4fb4e54d103a3 input=7d22de9630b61774]*/
{
Py_ssize_t have, r;
PyObject *res = NULL;
CHECK_INITIALIZED(self)
if (n < 0) {
- PyErr_SetString(PyExc_ValueError,
- "read length must be positive");
- return NULL;
+ n = self->buffer_size;
}
CHECK_CLOSED(self, "read of closed file")
@@ -1690,8 +1689,7 @@ _bufferedreader_read_generic(buffered *self, Py_ssize_t n)
return res;
}
Py_DECREF(res);
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
remaining -= r;
written += r;
@@ -1715,8 +1713,7 @@ _bufferedreader_read_generic(buffered *self, Py_ssize_t n)
return res;
}
Py_DECREF(res);
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
if (remaining > r) {
memcpy(out + written, self->buffer + self->pos, r);
diff --git a/Modules/_io/bytesio.c b/Modules/_io/bytesio.c
index a1ba121e26..96be0f4541 100644
--- a/Modules/_io/bytesio.c
+++ b/Modules/_io/bytesio.c
@@ -420,7 +420,7 @@ _io_BytesIO_read_impl(bytesio *self, PyObject *arg)
/*[clinic input]
_io.BytesIO.read1
- size: object
+ size: object(c_default="Py_None") = -1
/
Read at most size bytes, returned as a bytes object.
@@ -430,8 +430,8 @@ Return an empty bytes object at EOF.
[clinic start generated code]*/
static PyObject *
-_io_BytesIO_read1(bytesio *self, PyObject *size)
-/*[clinic end generated code: output=16021f5d0ac3d4e2 input=d4f40bb8f2f99418]*/
+_io_BytesIO_read1_impl(bytesio *self, PyObject *size)
+/*[clinic end generated code: output=a60d80c84c81a6b8 input=0951874bafee8e80]*/
{
return _io_BytesIO_read_impl(self, size);
}
diff --git a/Modules/_io/clinic/_iomodule.c.h b/Modules/_io/clinic/_iomodule.c.h
index f2e91a9fe6..a1ba869a04 100644
--- a/Modules/_io/clinic/_iomodule.c.h
+++ b/Modules/_io/clinic/_iomodule.c.h
@@ -149,7 +149,7 @@ _io_open(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
int closefd = 1;
PyObject *opener = Py_None;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
&file, &mode, &buffering, &encoding, &errors, &newline, &closefd, &opener)) {
goto exit;
}
@@ -158,4 +158,4 @@ _io_open(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
exit:
return return_value;
}
-/*[clinic end generated code: output=c5b8fc8b83102bbf input=a9049054013a1b77]*/
+/*[clinic end generated code: output=79fd04d9c9d8f28f input=a9049054013a1b77]*/
diff --git a/Modules/_io/clinic/bufferedio.c.h b/Modules/_io/clinic/bufferedio.c.h
index 58144a4015..4337ecfaa9 100644
--- a/Modules/_io/clinic/bufferedio.c.h
+++ b/Modules/_io/clinic/bufferedio.c.h
@@ -91,21 +91,25 @@ PyDoc_STRVAR(_io__Buffered_peek__doc__,
"\n");
#define _IO__BUFFERED_PEEK_METHODDEF \
- {"peek", (PyCFunction)_io__Buffered_peek, METH_VARARGS, _io__Buffered_peek__doc__},
+ {"peek", (PyCFunction)_io__Buffered_peek, METH_FASTCALL, _io__Buffered_peek__doc__},
static PyObject *
_io__Buffered_peek_impl(buffered *self, Py_ssize_t size);
static PyObject *
-_io__Buffered_peek(buffered *self, PyObject *args)
+_io__Buffered_peek(buffered *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
Py_ssize_t size = 0;
- if (!PyArg_ParseTuple(args, "|n:peek",
+ if (!_PyArg_ParseStack(args, nargs, "|n:peek",
&size)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("peek", kwnames)) {
+ goto exit;
+ }
return_value = _io__Buffered_peek_impl(self, size);
exit:
@@ -118,21 +122,25 @@ PyDoc_STRVAR(_io__Buffered_read__doc__,
"\n");
#define _IO__BUFFERED_READ_METHODDEF \
- {"read", (PyCFunction)_io__Buffered_read, METH_VARARGS, _io__Buffered_read__doc__},
+ {"read", (PyCFunction)_io__Buffered_read, METH_FASTCALL, _io__Buffered_read__doc__},
static PyObject *
_io__Buffered_read_impl(buffered *self, Py_ssize_t n);
static PyObject *
-_io__Buffered_read(buffered *self, PyObject *args)
+_io__Buffered_read(buffered *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
Py_ssize_t n = -1;
- if (!PyArg_ParseTuple(args, "|O&:read",
+ if (!_PyArg_ParseStack(args, nargs, "|O&:read",
_PyIO_ConvertSsize_t, &n)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("read", kwnames)) {
+ goto exit;
+ }
return_value = _io__Buffered_read_impl(self, n);
exit:
@@ -140,23 +148,28 @@ exit:
}
PyDoc_STRVAR(_io__Buffered_read1__doc__,
-"read1($self, size, /)\n"
+"read1($self, size=-1, /)\n"
"--\n"
"\n");
#define _IO__BUFFERED_READ1_METHODDEF \
- {"read1", (PyCFunction)_io__Buffered_read1, METH_O, _io__Buffered_read1__doc__},
+ {"read1", (PyCFunction)_io__Buffered_read1, METH_FASTCALL, _io__Buffered_read1__doc__},
static PyObject *
_io__Buffered_read1_impl(buffered *self, Py_ssize_t n);
static PyObject *
-_io__Buffered_read1(buffered *self, PyObject *arg)
+_io__Buffered_read1(buffered *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
- Py_ssize_t n;
+ Py_ssize_t n = -1;
+
+ if (!_PyArg_ParseStack(args, nargs, "|n:read1",
+ &n)) {
+ goto exit;
+ }
- if (!PyArg_Parse(arg, "n:read1", &n)) {
+ if (!_PyArg_NoStackKeywords("read1", kwnames)) {
goto exit;
}
return_value = _io__Buffered_read1_impl(self, n);
@@ -233,21 +246,25 @@ PyDoc_STRVAR(_io__Buffered_readline__doc__,
"\n");
#define _IO__BUFFERED_READLINE_METHODDEF \
- {"readline", (PyCFunction)_io__Buffered_readline, METH_VARARGS, _io__Buffered_readline__doc__},
+ {"readline", (PyCFunction)_io__Buffered_readline, METH_FASTCALL, _io__Buffered_readline__doc__},
static PyObject *
_io__Buffered_readline_impl(buffered *self, Py_ssize_t size);
static PyObject *
-_io__Buffered_readline(buffered *self, PyObject *args)
+_io__Buffered_readline(buffered *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
Py_ssize_t size = -1;
- if (!PyArg_ParseTuple(args, "|O&:readline",
+ if (!_PyArg_ParseStack(args, nargs, "|O&:readline",
_PyIO_ConvertSsize_t, &size)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("readline", kwnames)) {
+ goto exit;
+ }
return_value = _io__Buffered_readline_impl(self, size);
exit:
@@ -260,22 +277,26 @@ PyDoc_STRVAR(_io__Buffered_seek__doc__,
"\n");
#define _IO__BUFFERED_SEEK_METHODDEF \
- {"seek", (PyCFunction)_io__Buffered_seek, METH_VARARGS, _io__Buffered_seek__doc__},
+ {"seek", (PyCFunction)_io__Buffered_seek, METH_FASTCALL, _io__Buffered_seek__doc__},
static PyObject *
_io__Buffered_seek_impl(buffered *self, PyObject *targetobj, int whence);
static PyObject *
-_io__Buffered_seek(buffered *self, PyObject *args)
+_io__Buffered_seek(buffered *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
PyObject *targetobj;
int whence = 0;
- if (!PyArg_ParseTuple(args, "O|i:seek",
+ if (!_PyArg_ParseStack(args, nargs, "O|i:seek",
&targetobj, &whence)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("seek", kwnames)) {
+ goto exit;
+ }
return_value = _io__Buffered_seek_impl(self, targetobj, whence);
exit:
@@ -288,22 +309,26 @@ PyDoc_STRVAR(_io__Buffered_truncate__doc__,
"\n");
#define _IO__BUFFERED_TRUNCATE_METHODDEF \
- {"truncate", (PyCFunction)_io__Buffered_truncate, METH_VARARGS, _io__Buffered_truncate__doc__},
+ {"truncate", (PyCFunction)_io__Buffered_truncate, METH_FASTCALL, _io__Buffered_truncate__doc__},
static PyObject *
_io__Buffered_truncate_impl(buffered *self, PyObject *pos);
static PyObject *
-_io__Buffered_truncate(buffered *self, PyObject *args)
+_io__Buffered_truncate(buffered *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
PyObject *pos = Py_None;
- if (!PyArg_UnpackTuple(args, "truncate",
+ if (!_PyArg_UnpackStack(args, nargs, "truncate",
0, 1,
&pos)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("truncate", kwnames)) {
+ goto exit;
+ }
return_value = _io__Buffered_truncate_impl(self, pos);
exit:
@@ -475,4 +500,4 @@ _io_BufferedRandom___init__(PyObject *self, PyObject *args, PyObject *kwargs)
exit:
return return_value;
}
-/*[clinic end generated code: output=a956f394ecde4cf9 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=e37b969b1acaa09c input=a9049054013a1b77]*/
diff --git a/Modules/_io/clinic/bytesio.c.h b/Modules/_io/clinic/bytesio.c.h
index c64ce5c77c..656e7ecd13 100644
--- a/Modules/_io/clinic/bytesio.c.h
+++ b/Modules/_io/clinic/bytesio.c.h
@@ -158,22 +158,26 @@ PyDoc_STRVAR(_io_BytesIO_read__doc__,
"Return an empty bytes object at EOF.");
#define _IO_BYTESIO_READ_METHODDEF \
- {"read", (PyCFunction)_io_BytesIO_read, METH_VARARGS, _io_BytesIO_read__doc__},
+ {"read", (PyCFunction)_io_BytesIO_read, METH_FASTCALL, _io_BytesIO_read__doc__},
static PyObject *
_io_BytesIO_read_impl(bytesio *self, PyObject *arg);
static PyObject *
-_io_BytesIO_read(bytesio *self, PyObject *args)
+_io_BytesIO_read(bytesio *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
PyObject *arg = Py_None;
- if (!PyArg_UnpackTuple(args, "read",
+ if (!_PyArg_UnpackStack(args, nargs, "read",
0, 1,
&arg)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("read", kwnames)) {
+ goto exit;
+ }
return_value = _io_BytesIO_read_impl(self, arg);
exit:
@@ -181,7 +185,7 @@ exit:
}
PyDoc_STRVAR(_io_BytesIO_read1__doc__,
-"read1($self, size, /)\n"
+"read1($self, size=-1, /)\n"
"--\n"
"\n"
"Read at most size bytes, returned as a bytes object.\n"
@@ -190,7 +194,31 @@ PyDoc_STRVAR(_io_BytesIO_read1__doc__,
"Return an empty bytes object at EOF.");
#define _IO_BYTESIO_READ1_METHODDEF \
- {"read1", (PyCFunction)_io_BytesIO_read1, METH_O, _io_BytesIO_read1__doc__},
+ {"read1", (PyCFunction)_io_BytesIO_read1, METH_FASTCALL, _io_BytesIO_read1__doc__},
+
+static PyObject *
+_io_BytesIO_read1_impl(bytesio *self, PyObject *size);
+
+static PyObject *
+_io_BytesIO_read1(bytesio *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ PyObject *size = Py_None;
+
+ if (!_PyArg_UnpackStack(args, nargs, "read1",
+ 0, 1,
+ &size)) {
+ goto exit;
+ }
+
+ if (!_PyArg_NoStackKeywords("read1", kwnames)) {
+ goto exit;
+ }
+ return_value = _io_BytesIO_read1_impl(self, size);
+
+exit:
+ return return_value;
+}
PyDoc_STRVAR(_io_BytesIO_readline__doc__,
"readline($self, size=None, /)\n"
@@ -203,22 +231,26 @@ PyDoc_STRVAR(_io_BytesIO_readline__doc__,
"Return an empty bytes object at EOF.");
#define _IO_BYTESIO_READLINE_METHODDEF \
- {"readline", (PyCFunction)_io_BytesIO_readline, METH_VARARGS, _io_BytesIO_readline__doc__},
+ {"readline", (PyCFunction)_io_BytesIO_readline, METH_FASTCALL, _io_BytesIO_readline__doc__},
static PyObject *
_io_BytesIO_readline_impl(bytesio *self, PyObject *arg);
static PyObject *
-_io_BytesIO_readline(bytesio *self, PyObject *args)
+_io_BytesIO_readline(bytesio *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
PyObject *arg = Py_None;
- if (!PyArg_UnpackTuple(args, "readline",
+ if (!_PyArg_UnpackStack(args, nargs, "readline",
0, 1,
&arg)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("readline", kwnames)) {
+ goto exit;
+ }
return_value = _io_BytesIO_readline_impl(self, arg);
exit:
@@ -236,22 +268,26 @@ PyDoc_STRVAR(_io_BytesIO_readlines__doc__,
"total number of bytes in the lines returned.");
#define _IO_BYTESIO_READLINES_METHODDEF \
- {"readlines", (PyCFunction)_io_BytesIO_readlines, METH_VARARGS, _io_BytesIO_readlines__doc__},
+ {"readlines", (PyCFunction)_io_BytesIO_readlines, METH_FASTCALL, _io_BytesIO_readlines__doc__},
static PyObject *
_io_BytesIO_readlines_impl(bytesio *self, PyObject *arg);
static PyObject *
-_io_BytesIO_readlines(bytesio *self, PyObject *args)
+_io_BytesIO_readlines(bytesio *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
PyObject *arg = Py_None;
- if (!PyArg_UnpackTuple(args, "readlines",
+ if (!_PyArg_UnpackStack(args, nargs, "readlines",
0, 1,
&arg)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("readlines", kwnames)) {
+ goto exit;
+ }
return_value = _io_BytesIO_readlines_impl(self, arg);
exit:
@@ -303,22 +339,26 @@ PyDoc_STRVAR(_io_BytesIO_truncate__doc__,
"The current file position is unchanged. Returns the new size.");
#define _IO_BYTESIO_TRUNCATE_METHODDEF \
- {"truncate", (PyCFunction)_io_BytesIO_truncate, METH_VARARGS, _io_BytesIO_truncate__doc__},
+ {"truncate", (PyCFunction)_io_BytesIO_truncate, METH_FASTCALL, _io_BytesIO_truncate__doc__},
static PyObject *
_io_BytesIO_truncate_impl(bytesio *self, PyObject *arg);
static PyObject *
-_io_BytesIO_truncate(bytesio *self, PyObject *args)
+_io_BytesIO_truncate(bytesio *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
PyObject *arg = Py_None;
- if (!PyArg_UnpackTuple(args, "truncate",
+ if (!_PyArg_UnpackStack(args, nargs, "truncate",
0, 1,
&arg)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("truncate", kwnames)) {
+ goto exit;
+ }
return_value = _io_BytesIO_truncate_impl(self, arg);
exit:
@@ -338,22 +378,26 @@ PyDoc_STRVAR(_io_BytesIO_seek__doc__,
"Returns the new absolute position.");
#define _IO_BYTESIO_SEEK_METHODDEF \
- {"seek", (PyCFunction)_io_BytesIO_seek, METH_VARARGS, _io_BytesIO_seek__doc__},
+ {"seek", (PyCFunction)_io_BytesIO_seek, METH_FASTCALL, _io_BytesIO_seek__doc__},
static PyObject *
_io_BytesIO_seek_impl(bytesio *self, Py_ssize_t pos, int whence);
static PyObject *
-_io_BytesIO_seek(bytesio *self, PyObject *args)
+_io_BytesIO_seek(bytesio *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
Py_ssize_t pos;
int whence = 0;
- if (!PyArg_ParseTuple(args, "n|i:seek",
+ if (!_PyArg_ParseStack(args, nargs, "n|i:seek",
&pos, &whence)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("seek", kwnames)) {
+ goto exit;
+ }
return_value = _io_BytesIO_seek_impl(self, pos, whence);
exit:
@@ -428,4 +472,4 @@ _io_BytesIO___init__(PyObject *self, PyObject *args, PyObject *kwargs)
exit:
return return_value;
}
-/*[clinic end generated code: output=6382e8eb578eea64 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=138ee6ad6951bc84 input=a9049054013a1b77]*/
diff --git a/Modules/_io/clinic/fileio.c.h b/Modules/_io/clinic/fileio.c.h
index 908fe0f8c8..7a8e2c64c3 100644
--- a/Modules/_io/clinic/fileio.c.h
+++ b/Modules/_io/clinic/fileio.c.h
@@ -202,21 +202,25 @@ PyDoc_STRVAR(_io_FileIO_read__doc__,
"Return an empty bytes object at EOF.");
#define _IO_FILEIO_READ_METHODDEF \
- {"read", (PyCFunction)_io_FileIO_read, METH_VARARGS, _io_FileIO_read__doc__},
+ {"read", (PyCFunction)_io_FileIO_read, METH_FASTCALL, _io_FileIO_read__doc__},
static PyObject *
_io_FileIO_read_impl(fileio *self, Py_ssize_t size);
static PyObject *
-_io_FileIO_read(fileio *self, PyObject *args)
+_io_FileIO_read(fileio *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
Py_ssize_t size = -1;
- if (!PyArg_ParseTuple(args, "|O&:read",
+ if (!_PyArg_ParseStack(args, nargs, "|O&:read",
_PyIO_ConvertSsize_t, &size)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("read", kwnames)) {
+ goto exit;
+ }
return_value = _io_FileIO_read_impl(self, size);
exit:
@@ -274,22 +278,26 @@ PyDoc_STRVAR(_io_FileIO_seek__doc__,
"Note that not all file objects are seekable.");
#define _IO_FILEIO_SEEK_METHODDEF \
- {"seek", (PyCFunction)_io_FileIO_seek, METH_VARARGS, _io_FileIO_seek__doc__},
+ {"seek", (PyCFunction)_io_FileIO_seek, METH_FASTCALL, _io_FileIO_seek__doc__},
static PyObject *
_io_FileIO_seek_impl(fileio *self, PyObject *pos, int whence);
static PyObject *
-_io_FileIO_seek(fileio *self, PyObject *args)
+_io_FileIO_seek(fileio *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
PyObject *pos;
int whence = 0;
- if (!PyArg_ParseTuple(args, "O|i:seek",
+ if (!_PyArg_ParseStack(args, nargs, "O|i:seek",
&pos, &whence)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("seek", kwnames)) {
+ goto exit;
+ }
return_value = _io_FileIO_seek_impl(self, pos, whence);
exit:
@@ -328,22 +336,26 @@ PyDoc_STRVAR(_io_FileIO_truncate__doc__,
"The current file position is changed to the value of size.");
#define _IO_FILEIO_TRUNCATE_METHODDEF \
- {"truncate", (PyCFunction)_io_FileIO_truncate, METH_VARARGS, _io_FileIO_truncate__doc__},
+ {"truncate", (PyCFunction)_io_FileIO_truncate, METH_FASTCALL, _io_FileIO_truncate__doc__},
static PyObject *
_io_FileIO_truncate_impl(fileio *self, PyObject *posobj);
static PyObject *
-_io_FileIO_truncate(fileio *self, PyObject *args)
+_io_FileIO_truncate(fileio *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
PyObject *posobj = NULL;
- if (!PyArg_UnpackTuple(args, "truncate",
+ if (!_PyArg_UnpackStack(args, nargs, "truncate",
0, 1,
&posobj)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("truncate", kwnames)) {
+ goto exit;
+ }
return_value = _io_FileIO_truncate_impl(self, posobj);
exit:
@@ -373,4 +385,4 @@ _io_FileIO_isatty(fileio *self, PyObject *Py_UNUSED(ignored))
#ifndef _IO_FILEIO_TRUNCATE_METHODDEF
#define _IO_FILEIO_TRUNCATE_METHODDEF
#endif /* !defined(_IO_FILEIO_TRUNCATE_METHODDEF) */
-/*[clinic end generated code: output=51924bc0ee11d58e input=a9049054013a1b77]*/
+/*[clinic end generated code: output=034d782a0daa82bd input=a9049054013a1b77]*/
diff --git a/Modules/_io/clinic/iobase.c.h b/Modules/_io/clinic/iobase.c.h
index edbf73a40b..045bb3b699 100644
--- a/Modules/_io/clinic/iobase.c.h
+++ b/Modules/_io/clinic/iobase.c.h
@@ -174,21 +174,25 @@ PyDoc_STRVAR(_io__IOBase_readline__doc__,
"terminator(s) recognized.");
#define _IO__IOBASE_READLINE_METHODDEF \
- {"readline", (PyCFunction)_io__IOBase_readline, METH_VARARGS, _io__IOBase_readline__doc__},
+ {"readline", (PyCFunction)_io__IOBase_readline, METH_FASTCALL, _io__IOBase_readline__doc__},
static PyObject *
_io__IOBase_readline_impl(PyObject *self, Py_ssize_t limit);
static PyObject *
-_io__IOBase_readline(PyObject *self, PyObject *args)
+_io__IOBase_readline(PyObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
Py_ssize_t limit = -1;
- if (!PyArg_ParseTuple(args, "|O&:readline",
+ if (!_PyArg_ParseStack(args, nargs, "|O&:readline",
_PyIO_ConvertSsize_t, &limit)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("readline", kwnames)) {
+ goto exit;
+ }
return_value = _io__IOBase_readline_impl(self, limit);
exit:
@@ -206,21 +210,25 @@ PyDoc_STRVAR(_io__IOBase_readlines__doc__,
"lines so far exceeds hint.");
#define _IO__IOBASE_READLINES_METHODDEF \
- {"readlines", (PyCFunction)_io__IOBase_readlines, METH_VARARGS, _io__IOBase_readlines__doc__},
+ {"readlines", (PyCFunction)_io__IOBase_readlines, METH_FASTCALL, _io__IOBase_readlines__doc__},
static PyObject *
_io__IOBase_readlines_impl(PyObject *self, Py_ssize_t hint);
static PyObject *
-_io__IOBase_readlines(PyObject *self, PyObject *args)
+_io__IOBase_readlines(PyObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
Py_ssize_t hint = -1;
- if (!PyArg_ParseTuple(args, "|O&:readlines",
+ if (!_PyArg_ParseStack(args, nargs, "|O&:readlines",
_PyIO_ConvertSsize_t, &hint)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("readlines", kwnames)) {
+ goto exit;
+ }
return_value = _io__IOBase_readlines_impl(self, hint);
exit:
@@ -241,21 +249,25 @@ PyDoc_STRVAR(_io__RawIOBase_read__doc__,
"\n");
#define _IO__RAWIOBASE_READ_METHODDEF \
- {"read", (PyCFunction)_io__RawIOBase_read, METH_VARARGS, _io__RawIOBase_read__doc__},
+ {"read", (PyCFunction)_io__RawIOBase_read, METH_FASTCALL, _io__RawIOBase_read__doc__},
static PyObject *
_io__RawIOBase_read_impl(PyObject *self, Py_ssize_t n);
static PyObject *
-_io__RawIOBase_read(PyObject *self, PyObject *args)
+_io__RawIOBase_read(PyObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
Py_ssize_t n = -1;
- if (!PyArg_ParseTuple(args, "|n:read",
+ if (!_PyArg_ParseStack(args, nargs, "|n:read",
&n)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("read", kwnames)) {
+ goto exit;
+ }
return_value = _io__RawIOBase_read_impl(self, n);
exit:
@@ -279,4 +291,4 @@ _io__RawIOBase_readall(PyObject *self, PyObject *Py_UNUSED(ignored))
{
return _io__RawIOBase_readall_impl(self);
}
-/*[clinic end generated code: output=0f53fed928d8e02f input=a9049054013a1b77]*/
+/*[clinic end generated code: output=1bcece367fc7b0cd input=a9049054013a1b77]*/
diff --git a/Modules/_io/clinic/stringio.c.h b/Modules/_io/clinic/stringio.c.h
index d2c05d7cb1..af467d687f 100644
--- a/Modules/_io/clinic/stringio.c.h
+++ b/Modules/_io/clinic/stringio.c.h
@@ -48,22 +48,26 @@ PyDoc_STRVAR(_io_StringIO_read__doc__,
"is reached. Return an empty string at EOF.");
#define _IO_STRINGIO_READ_METHODDEF \
- {"read", (PyCFunction)_io_StringIO_read, METH_VARARGS, _io_StringIO_read__doc__},
+ {"read", (PyCFunction)_io_StringIO_read, METH_FASTCALL, _io_StringIO_read__doc__},
static PyObject *
_io_StringIO_read_impl(stringio *self, PyObject *arg);
static PyObject *
-_io_StringIO_read(stringio *self, PyObject *args)
+_io_StringIO_read(stringio *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
PyObject *arg = Py_None;
- if (!PyArg_UnpackTuple(args, "read",
+ if (!_PyArg_UnpackStack(args, nargs, "read",
0, 1,
&arg)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("read", kwnames)) {
+ goto exit;
+ }
return_value = _io_StringIO_read_impl(self, arg);
exit:
@@ -79,22 +83,26 @@ PyDoc_STRVAR(_io_StringIO_readline__doc__,
"Returns an empty string if EOF is hit immediately.");
#define _IO_STRINGIO_READLINE_METHODDEF \
- {"readline", (PyCFunction)_io_StringIO_readline, METH_VARARGS, _io_StringIO_readline__doc__},
+ {"readline", (PyCFunction)_io_StringIO_readline, METH_FASTCALL, _io_StringIO_readline__doc__},
static PyObject *
_io_StringIO_readline_impl(stringio *self, PyObject *arg);
static PyObject *
-_io_StringIO_readline(stringio *self, PyObject *args)
+_io_StringIO_readline(stringio *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
PyObject *arg = Py_None;
- if (!PyArg_UnpackTuple(args, "readline",
+ if (!_PyArg_UnpackStack(args, nargs, "readline",
0, 1,
&arg)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("readline", kwnames)) {
+ goto exit;
+ }
return_value = _io_StringIO_readline_impl(self, arg);
exit:
@@ -112,22 +120,26 @@ PyDoc_STRVAR(_io_StringIO_truncate__doc__,
"Returns the new absolute position.");
#define _IO_STRINGIO_TRUNCATE_METHODDEF \
- {"truncate", (PyCFunction)_io_StringIO_truncate, METH_VARARGS, _io_StringIO_truncate__doc__},
+ {"truncate", (PyCFunction)_io_StringIO_truncate, METH_FASTCALL, _io_StringIO_truncate__doc__},
static PyObject *
_io_StringIO_truncate_impl(stringio *self, PyObject *arg);
static PyObject *
-_io_StringIO_truncate(stringio *self, PyObject *args)
+_io_StringIO_truncate(stringio *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
PyObject *arg = Py_None;
- if (!PyArg_UnpackTuple(args, "truncate",
+ if (!_PyArg_UnpackStack(args, nargs, "truncate",
0, 1,
&arg)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("truncate", kwnames)) {
+ goto exit;
+ }
return_value = _io_StringIO_truncate_impl(self, arg);
exit:
@@ -147,22 +159,26 @@ PyDoc_STRVAR(_io_StringIO_seek__doc__,
"Returns the new absolute position.");
#define _IO_STRINGIO_SEEK_METHODDEF \
- {"seek", (PyCFunction)_io_StringIO_seek, METH_VARARGS, _io_StringIO_seek__doc__},
+ {"seek", (PyCFunction)_io_StringIO_seek, METH_FASTCALL, _io_StringIO_seek__doc__},
static PyObject *
_io_StringIO_seek_impl(stringio *self, Py_ssize_t pos, int whence);
static PyObject *
-_io_StringIO_seek(stringio *self, PyObject *args)
+_io_StringIO_seek(stringio *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
Py_ssize_t pos;
int whence = 0;
- if (!PyArg_ParseTuple(args, "n|i:seek",
+ if (!_PyArg_ParseStack(args, nargs, "n|i:seek",
&pos, &whence)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("seek", kwnames)) {
+ goto exit;
+ }
return_value = _io_StringIO_seek_impl(self, pos, whence);
exit:
@@ -289,4 +305,4 @@ _io_StringIO_seekable(stringio *self, PyObject *Py_UNUSED(ignored))
{
return _io_StringIO_seekable_impl(self);
}
-/*[clinic end generated code: output=5dd5c2a213e75405 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=ce8018ec29def422 input=a9049054013a1b77]*/
diff --git a/Modules/_io/clinic/textio.c.h b/Modules/_io/clinic/textio.c.h
index f39c35581e..46b3edafa9 100644
--- a/Modules/_io/clinic/textio.c.h
+++ b/Modules/_io/clinic/textio.c.h
@@ -61,7 +61,7 @@ _io_IncrementalNewlineDecoder_decode(nldecoder_object *self, PyObject **args, Py
PyObject *input;
int final = 0;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
&input, &final)) {
goto exit;
}
@@ -225,21 +225,25 @@ PyDoc_STRVAR(_io_TextIOWrapper_read__doc__,
"\n");
#define _IO_TEXTIOWRAPPER_READ_METHODDEF \
- {"read", (PyCFunction)_io_TextIOWrapper_read, METH_VARARGS, _io_TextIOWrapper_read__doc__},
+ {"read", (PyCFunction)_io_TextIOWrapper_read, METH_FASTCALL, _io_TextIOWrapper_read__doc__},
static PyObject *
_io_TextIOWrapper_read_impl(textio *self, Py_ssize_t n);
static PyObject *
-_io_TextIOWrapper_read(textio *self, PyObject *args)
+_io_TextIOWrapper_read(textio *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
Py_ssize_t n = -1;
- if (!PyArg_ParseTuple(args, "|O&:read",
+ if (!_PyArg_ParseStack(args, nargs, "|O&:read",
_PyIO_ConvertSsize_t, &n)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("read", kwnames)) {
+ goto exit;
+ }
return_value = _io_TextIOWrapper_read_impl(self, n);
exit:
@@ -252,21 +256,25 @@ PyDoc_STRVAR(_io_TextIOWrapper_readline__doc__,
"\n");
#define _IO_TEXTIOWRAPPER_READLINE_METHODDEF \
- {"readline", (PyCFunction)_io_TextIOWrapper_readline, METH_VARARGS, _io_TextIOWrapper_readline__doc__},
+ {"readline", (PyCFunction)_io_TextIOWrapper_readline, METH_FASTCALL, _io_TextIOWrapper_readline__doc__},
static PyObject *
_io_TextIOWrapper_readline_impl(textio *self, Py_ssize_t size);
static PyObject *
-_io_TextIOWrapper_readline(textio *self, PyObject *args)
+_io_TextIOWrapper_readline(textio *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
Py_ssize_t size = -1;
- if (!PyArg_ParseTuple(args, "|n:readline",
+ if (!_PyArg_ParseStack(args, nargs, "|n:readline",
&size)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("readline", kwnames)) {
+ goto exit;
+ }
return_value = _io_TextIOWrapper_readline_impl(self, size);
exit:
@@ -279,22 +287,26 @@ PyDoc_STRVAR(_io_TextIOWrapper_seek__doc__,
"\n");
#define _IO_TEXTIOWRAPPER_SEEK_METHODDEF \
- {"seek", (PyCFunction)_io_TextIOWrapper_seek, METH_VARARGS, _io_TextIOWrapper_seek__doc__},
+ {"seek", (PyCFunction)_io_TextIOWrapper_seek, METH_FASTCALL, _io_TextIOWrapper_seek__doc__},
static PyObject *
_io_TextIOWrapper_seek_impl(textio *self, PyObject *cookieObj, int whence);
static PyObject *
-_io_TextIOWrapper_seek(textio *self, PyObject *args)
+_io_TextIOWrapper_seek(textio *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
PyObject *cookieObj;
int whence = 0;
- if (!PyArg_ParseTuple(args, "O|i:seek",
+ if (!_PyArg_ParseStack(args, nargs, "O|i:seek",
&cookieObj, &whence)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("seek", kwnames)) {
+ goto exit;
+ }
return_value = _io_TextIOWrapper_seek_impl(self, cookieObj, whence);
exit:
@@ -324,22 +336,26 @@ PyDoc_STRVAR(_io_TextIOWrapper_truncate__doc__,
"\n");
#define _IO_TEXTIOWRAPPER_TRUNCATE_METHODDEF \
- {"truncate", (PyCFunction)_io_TextIOWrapper_truncate, METH_VARARGS, _io_TextIOWrapper_truncate__doc__},
+ {"truncate", (PyCFunction)_io_TextIOWrapper_truncate, METH_FASTCALL, _io_TextIOWrapper_truncate__doc__},
static PyObject *
_io_TextIOWrapper_truncate_impl(textio *self, PyObject *pos);
static PyObject *
-_io_TextIOWrapper_truncate(textio *self, PyObject *args)
+_io_TextIOWrapper_truncate(textio *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
PyObject *pos = Py_None;
- if (!PyArg_UnpackTuple(args, "truncate",
+ if (!_PyArg_UnpackStack(args, nargs, "truncate",
0, 1,
&pos)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("truncate", kwnames)) {
+ goto exit;
+ }
return_value = _io_TextIOWrapper_truncate_impl(self, pos);
exit:
@@ -464,4 +480,4 @@ _io_TextIOWrapper_close(textio *self, PyObject *Py_UNUSED(ignored))
{
return _io_TextIOWrapper_close_impl(self);
}
-/*[clinic end generated code: output=78ad14eba1667254 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=67eba50449900a96 input=a9049054013a1b77]*/
diff --git a/Modules/_io/clinic/winconsoleio.c.h b/Modules/_io/clinic/winconsoleio.c.h
index e44fcbb7a1..f568053d63 100644
--- a/Modules/_io/clinic/winconsoleio.c.h
+++ b/Modules/_io/clinic/winconsoleio.c.h
@@ -209,21 +209,25 @@ PyDoc_STRVAR(_io__WindowsConsoleIO_read__doc__,
"Return an empty bytes object at EOF.");
#define _IO__WINDOWSCONSOLEIO_READ_METHODDEF \
- {"read", (PyCFunction)_io__WindowsConsoleIO_read, METH_VARARGS, _io__WindowsConsoleIO_read__doc__},
+ {"read", (PyCFunction)_io__WindowsConsoleIO_read, METH_FASTCALL, _io__WindowsConsoleIO_read__doc__},
static PyObject *
_io__WindowsConsoleIO_read_impl(winconsoleio *self, Py_ssize_t size);
static PyObject *
-_io__WindowsConsoleIO_read(winconsoleio *self, PyObject *args)
+_io__WindowsConsoleIO_read(winconsoleio *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
Py_ssize_t size = -1;
- if (!PyArg_ParseTuple(args, "|O&:read",
+ if (!_PyArg_ParseStack(args, nargs, "|O&:read",
_PyIO_ConvertSsize_t, &size)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("read", kwnames)) {
+ goto exit;
+ }
return_value = _io__WindowsConsoleIO_read_impl(self, size);
exit:
@@ -328,4 +332,4 @@ _io__WindowsConsoleIO_isatty(winconsoleio *self, PyObject *Py_UNUSED(ignored))
#ifndef _IO__WINDOWSCONSOLEIO_ISATTY_METHODDEF
#define _IO__WINDOWSCONSOLEIO_ISATTY_METHODDEF
#endif /* !defined(_IO__WINDOWSCONSOLEIO_ISATTY_METHODDEF) */
-/*[clinic end generated code: output=9eba916f8537fff7 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=04dab03363f5e304 input=a9049054013a1b77]*/
diff --git a/Modules/_io/fileio.c b/Modules/_io/fileio.c
index 7f3bcab962..67d5e3eec9 100644
--- a/Modules/_io/fileio.c
+++ b/Modules/_io/fileio.c
@@ -153,8 +153,8 @@ _io_FileIO_close_impl(fileio *self)
PyObject *exc, *val, *tb;
int rc;
_Py_IDENTIFIER(close);
- res = _PyObject_CallMethodId((PyObject*)&PyRawIOBase_Type,
- &PyId_close, "O", self);
+ res = _PyObject_CallMethodIdObjArgs((PyObject*)&PyRawIOBase_Type,
+ &PyId_close, self, NULL);
if (!self->closefd) {
self->fd = -1;
return res;
diff --git a/Modules/_io/iobase.c b/Modules/_io/iobase.c
index 472ef3b97c..ee6ad474b5 100644
--- a/Modules/_io/iobase.c
+++ b/Modules/_io/iobase.c
@@ -661,7 +661,8 @@ _io__IOBase_readlines_impl(PyObject *self, Py_ssize_t hint)
to remove the bytecode interpretation overhead, but it could
probably be removed here. */
_Py_IDENTIFIER(extend);
- PyObject *ret = _PyObject_CallMethodId(result, &PyId_extend, "O", self);
+ PyObject *ret = _PyObject_CallMethodIdObjArgs(result, &PyId_extend,
+ self, NULL);
if (ret == NULL) {
Py_DECREF(result);
diff --git a/Modules/_io/stringio.c b/Modules/_io/stringio.c
index 8542efd972..93c8b47de3 100644
--- a/Modules/_io/stringio.c
+++ b/Modules/_io/stringio.c
@@ -693,7 +693,7 @@ _io_StringIO___init___impl(stringio *self, PyObject *value,
PyObject *newline_obj)
/*[clinic end generated code: output=a421ea023b22ef4e input=cee2d9181b2577a3]*/
{
- char *newline = "\n";
+ const char *newline = "\n";
Py_ssize_t value_len;
/* Parse the newline argument. We only want to allow unicode objects or
diff --git a/Modules/_io/textio.c b/Modules/_io/textio.c
index 4df55626d4..1d32d5320a 100644
--- a/Modules/_io/textio.c
+++ b/Modules/_io/textio.c
@@ -899,8 +899,8 @@ _io_TextIOWrapper___init___impl(textio *self, PyObject *buffer,
PyObject *locale_module = _PyIO_get_locale_module(state);
if (locale_module == NULL)
goto catch_ImportError;
- self->encoding = _PyObject_CallMethodId(
- locale_module, &PyId_getpreferredencoding, "O", Py_False);
+ self->encoding = _PyObject_CallMethodIdObjArgs(
+ locale_module, &PyId_getpreferredencoding, Py_False, NULL);
Py_DECREF(locale_module);
if (self->encoding == NULL) {
catch_ImportError:
@@ -2435,7 +2435,7 @@ _io_TextIOWrapper_tell_impl(textio *self)
}
finally:
- res = _PyObject_CallMethodId(self->decoder, &PyId_setstate, "(O)", saved_state);
+ res = _PyObject_CallMethodIdObjArgs(self->decoder, &PyId_setstate, saved_state, NULL);
Py_DECREF(saved_state);
if (res == NULL)
return NULL;
@@ -2449,7 +2449,7 @@ fail:
if (saved_state) {
PyObject *type, *value, *traceback;
PyErr_Fetch(&type, &value, &traceback);
- res = _PyObject_CallMethodId(self->decoder, &PyId_setstate, "(O)", saved_state);
+ res = _PyObject_CallMethodIdObjArgs(self->decoder, &PyId_setstate, saved_state, NULL);
_PyErr_ChainExceptions(type, value, traceback);
Py_DECREF(saved_state);
Py_XDECREF(res);
@@ -2644,7 +2644,9 @@ _io_TextIOWrapper_close_impl(textio *self)
else {
PyObject *exc = NULL, *val, *tb;
if (self->finalizing) {
- res = _PyObject_CallMethodId(self->buffer, &PyId__dealloc_warn, "O", self);
+ res = _PyObject_CallMethodIdObjArgs(self->buffer,
+ &PyId__dealloc_warn,
+ self, NULL);
if (res)
Py_DECREF(res);
else
diff --git a/Modules/_io/winconsoleio.c b/Modules/_io/winconsoleio.c
index 1d169e2764..4d36bb5d2f 100644
--- a/Modules/_io/winconsoleio.c
+++ b/Modules/_io/winconsoleio.c
@@ -210,8 +210,8 @@ _io__WindowsConsoleIO_close_impl(winconsoleio *self)
PyObject *exc, *val, *tb;
int rc;
_Py_IDENTIFIER(close);
- res = _PyObject_CallMethodId((PyObject*)&PyRawIOBase_Type,
- &PyId_close, "O", self);
+ res = _PyObject_CallMethodIdObjArgs((PyObject*)&PyRawIOBase_Type,
+ &PyId_close, self, NULL);
if (!self->closehandle) {
self->handle = INVALID_HANDLE_VALUE;
return res;
@@ -318,11 +318,6 @@ _io__WindowsConsoleIO___init___impl(winconsoleio *self, PyObject *nameobj,
Py_CLEAR(decodedname);
if (name == NULL)
return -1;
- if (console_type == '\0') {
- PyErr_SetString(PyExc_ValueError,
- "Cannot open non-console file");
- return -1;
- }
if (wcslen(name) != length) {
PyMem_Free(name);
@@ -404,11 +399,6 @@ _io__WindowsConsoleIO___init___impl(winconsoleio *self, PyObject *nameobj,
if (console_type == '\0')
console_type = _get_console_type(self->handle);
- if (console_type == '\0') {
- PyErr_SetString(PyExc_ValueError,
- "Cannot open non-console file");
- goto error;
- }
if (self->writable && console_type != 'w') {
PyErr_SetString(PyExc_ValueError,
"Cannot open console input buffer for writing");
diff --git a/Modules/_json.c b/Modules/_json.c
index faa213491b..f4000f83a5 100644
--- a/Modules/_json.c
+++ b/Modules/_json.c
@@ -335,7 +335,7 @@ raise_errmsg(const char *msg, PyObject *s, Py_ssize_t end)
if (JSONDecodeError == NULL)
return;
}
- exc = PyObject_CallFunction(JSONDecodeError, "(zOn)", msg, s, end);
+ exc = PyObject_CallFunction(JSONDecodeError, "zOn", msg, s, end);
if (exc) {
PyErr_SetObject(JSONDecodeError, exc);
Py_DECREF(exc);
@@ -1108,17 +1108,15 @@ scan_once_unicode(PyScannerObject *s, PyObject *pystr, Py_ssize_t idx, Py_ssize_
case 'n':
/* null */
if ((idx + 3 < length) && PyUnicode_READ(kind, str, idx + 1) == 'u' && PyUnicode_READ(kind, str, idx + 2) == 'l' && PyUnicode_READ(kind, str, idx + 3) == 'l') {
- Py_INCREF(Py_None);
*next_idx_ptr = idx + 4;
- return Py_None;
+ Py_RETURN_NONE;
}
break;
case 't':
/* true */
if ((idx + 3 < length) && PyUnicode_READ(kind, str, idx + 1) == 'r' && PyUnicode_READ(kind, str, idx + 2) == 'u' && PyUnicode_READ(kind, str, idx + 3) == 'e') {
- Py_INCREF(Py_True);
*next_idx_ptr = idx + 4;
- return Py_True;
+ Py_RETURN_TRUE;
}
break;
case 'f':
@@ -1127,9 +1125,8 @@ scan_once_unicode(PyScannerObject *s, PyObject *pystr, Py_ssize_t idx, Py_ssize_
PyUnicode_READ(kind, str, idx + 2) == 'l' &&
PyUnicode_READ(kind, str, idx + 3) == 's' &&
PyUnicode_READ(kind, str, idx + 4) == 'e') {
- Py_INCREF(Py_False);
*next_idx_ptr = idx + 5;
- return Py_False;
+ Py_RETURN_FALSE;
}
break;
case 'N':
@@ -1609,7 +1606,7 @@ encoder_listencode_dict(PyEncoderObject *s, _PyAccu *acc,
if (open_dict == NULL || close_dict == NULL || empty_dict == NULL)
return -1;
}
- if (PyDict_Size(dct) == 0) /* Fast path */
+ if (PyDict_GET_SIZE(dct) == 0) /* Fast path */
return _PyAccu_Accumulate(acc, empty_dict);
if (s->markers != Py_None) {
diff --git a/Modules/_lsprof.c b/Modules/_lsprof.c
index 0e7623ddbc..602747098b 100644
--- a/Modules/_lsprof.c
+++ b/Modules/_lsprof.c
@@ -692,8 +692,7 @@ profiler_enable(ProfilerObject *self, PyObject *args, PyObject *kwds)
return NULL;
PyEval_SetProfile(profiler_callback, (PyObject*)self);
self->flags |= POF_ENABLED;
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
static void
@@ -726,8 +725,7 @@ profiler_disable(ProfilerObject *self, PyObject* noarg)
flush_unmatched(self);
if (pending_exception(self))
return NULL;
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
PyDoc_STRVAR(clear_doc, "\
@@ -740,8 +738,7 @@ static PyObject*
profiler_clear(ProfilerObject *pObj, PyObject* noarg)
{
clearEntries(pObj);
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
static void
diff --git a/Modules/_math.c b/Modules/_math.c
index a002208290..02d8f1c43c 100644
--- a/Modules/_math.c
+++ b/Modules/_math.c
@@ -19,13 +19,19 @@
* ====================================================
*/
+#if !defined(HAVE_ACOSH) || !defined(HAVE_ASINH)
static const double ln2 = 6.93147180559945286227E-01;
-static const double two_pow_m28 = 3.7252902984619141E-09; /* 2**-28 */
static const double two_pow_p28 = 268435456.0; /* 2**28 */
-#ifndef Py_NAN
+#endif
+#if !defined(HAVE_ASINH) || !defined(HAVE_ATANH)
+static const double two_pow_m28 = 3.7252902984619141E-09; /* 2**-28 */
+#endif
+#if !defined(HAVE_ATANH) && !defined(Py_NAN)
static const double zero = 0.0;
#endif
+
+#ifndef HAVE_ACOSH
/* acosh(x)
* Method :
* Based on
@@ -59,23 +65,25 @@ _Py_acosh(double x)
return x+x;
}
else {
- return log(x)+ln2; /* acosh(huge)=log(2x) */
+ return log(x) + ln2; /* acosh(huge)=log(2x) */
}
}
else if (x == 1.) {
return 0.0; /* acosh(1) = 0 */
}
else if (x > 2.) { /* 2 < x < 2**28 */
- double t = x*x;
- return log(2.0*x - 1.0 / (x + sqrt(t - 1.0)));
+ double t = x * x;
+ return log(2.0 * x - 1.0 / (x + sqrt(t - 1.0)));
}
else { /* 1 < x <= 2 */
double t = x - 1.0;
- return m_log1p(t + sqrt(2.0*t + t*t));
+ return m_log1p(t + sqrt(2.0 * t + t * t));
}
}
+#endif /* HAVE_ACOSH */
+#ifndef HAVE_ASINH
/* asinh(x)
* Method :
* Based on
@@ -100,10 +108,10 @@ _Py_asinh(double x)
return x; /* return x inexact except 0 */
}
if (absx > two_pow_p28) { /* |x| > 2**28 */
- w = log(absx)+ln2;
+ w = log(absx) + ln2;
}
else if (absx > 2.0) { /* 2 < |x| < 2**28 */
- w = log(2.0*absx + 1.0 / (sqrt(x*x + 1.0) + absx));
+ w = log(2.0 * absx + 1.0 / (sqrt(x * x + 1.0) + absx));
}
else { /* 2**-28 <= |x| < 2= */
double t = x*x;
@@ -112,7 +120,10 @@ _Py_asinh(double x)
return copysign(w, x);
}
+#endif /* HAVE_ASINH */
+
+#ifndef HAVE_ATANH
/* atanh(x)
* Method :
* 1.Reduced x to positive by atanh(-x) = -atanh(x)
@@ -145,7 +156,7 @@ _Py_atanh(double x)
#ifdef Py_NAN
return Py_NAN;
#else
- return x/zero;
+ return x / zero;
#endif
}
if (absx < two_pow_m28) { /* |x| < 2**-28 */
@@ -160,7 +171,10 @@ _Py_atanh(double x)
}
return copysign(t, x);
}
+#endif /* HAVE_ATANH */
+
+#ifndef HAVE_EXPM1
/* Mathematically, expm1(x) = exp(x) - 1. The expm1 function is designed
to avoid the significant loss of precision that arises from direct
evaluation of the expression exp(x) - 1, for x near 0. */
@@ -186,16 +200,17 @@ _Py_expm1(double x)
else
return exp(x) - 1.0;
}
+#endif /* HAVE_EXPM1 */
+
/* log1p(x) = log(1+x). The log1p function is designed to avoid the
significant loss of precision that arises from direct evaluation when x is
small. */
-#ifdef HAVE_LOG1P
-
double
_Py_log1p(double x)
{
+#ifdef HAVE_LOG1P
/* Some platforms supply a log1p function but don't respect the sign of
zero: log1p(-0.0) gives 0.0 instead of the correct result of -0.0.
@@ -208,13 +223,7 @@ _Py_log1p(double x)
else {
return log1p(x);
}
-}
-
#else
-
-double
-_Py_log1p(double x)
-{
/* For x small, we use the following approach. Let y be the nearest float
to 1+x, then
@@ -236,7 +245,7 @@ _Py_log1p(double x)
*/
double y;
- if (fabs(x) < DBL_EPSILON/2.) {
+ if (fabs(x) < DBL_EPSILON / 2.) {
return x;
}
else if (-0.5 <= x && x <= 1.) {
@@ -246,12 +255,12 @@ _Py_log1p(double x)
happens, then results from log1p will be inaccurate
for small x. */
y = 1.+x;
- return log(y)-((y-1.)-x)/y;
+ return log(y) - ((y - 1.) - x) / y;
}
else {
/* NaNs and infinities should end up here */
return log(1.+x);
}
+#endif /* ifdef HAVE_LOG1P */
}
-#endif /* ifdef HAVE_LOG1P */
diff --git a/Modules/_math.h b/Modules/_math.h
index cf079ad770..398b7e8874 100644
--- a/Modules/_math.h
+++ b/Modules/_math.h
@@ -1,41 +1,41 @@
-double _Py_acosh(double x);
-double _Py_asinh(double x);
-double _Py_atanh(double x);
-double _Py_expm1(double x);
-double _Py_log1p(double x);
-
#ifdef HAVE_ACOSH
-#define m_acosh acosh
+# define m_acosh acosh
#else
/* if the system doesn't have acosh, use the substitute
function defined in Modules/_math.c. */
-#define m_acosh _Py_acosh
+double _Py_acosh(double x);
+# define m_acosh _Py_acosh
#endif
#ifdef HAVE_ASINH
-#define m_asinh asinh
+# define m_asinh asinh
#else
/* if the system doesn't have asinh, use the substitute
function defined in Modules/_math.c. */
-#define m_asinh _Py_asinh
+double _Py_asinh(double x);
+# define m_asinh _Py_asinh
#endif
#ifdef HAVE_ATANH
-#define m_atanh atanh
+# define m_atanh atanh
#else
/* if the system doesn't have atanh, use the substitute
function defined in Modules/_math.c. */
+double _Py_atanh(double x);
#define m_atanh _Py_atanh
#endif
#ifdef HAVE_EXPM1
-#define m_expm1 expm1
+# define m_expm1 expm1
#else
/* if the system doesn't have expm1, use the substitute
function defined in Modules/_math.c. */
+double _Py_expm1(double x);
#define m_expm1 _Py_expm1
#endif
+double _Py_log1p(double x);
+
/* Use the substitute from _math.c on all platforms:
it includes workarounds for buggy handling of zeros. */
#define m_log1p _Py_log1p
diff --git a/Modules/_multiprocessing/multiprocessing.c b/Modules/_multiprocessing/multiprocessing.c
index d92a8bf21c..bb65b3b088 100644
--- a/Modules/_multiprocessing/multiprocessing.c
+++ b/Modules/_multiprocessing/multiprocessing.c
@@ -171,8 +171,11 @@ PyInit__multiprocessing(void)
{
PyObject *py_sem_value_max;
/* Some systems define SEM_VALUE_MAX as an unsigned value that
- * causes it to be negative when used as an int (NetBSD). */
- if ((int)(SEM_VALUE_MAX) < 0)
+ * causes it to be negative when used as an int (NetBSD).
+ *
+ * Issue #28152: Use (0) instead of 0 to fix a warning on dead code
+ * when using clang -Wunreachable-code. */
+ if ((int)(SEM_VALUE_MAX) < (0))
py_sem_value_max = PyLong_FromLong(INT_MAX);
else
py_sem_value_max = PyLong_FromLong(SEM_VALUE_MAX);
diff --git a/Modules/_operator.c b/Modules/_operator.c
index fb8eafc679..10d7874579 100644
--- a/Modules/_operator.c
+++ b/Modules/_operator.c
@@ -1,6 +1,13 @@
#include "Python.h"
+#include "clinic/_operator.c.h"
+
+/*[clinic input]
+module _operator
+[clinic start generated code]*/
+/*[clinic end generated code: output=da39a3ee5e6b4b0d input=672ecf48487521e7]*/
+
PyDoc_STRVAR(operator_doc,
"Operator interface.\n\
\n\
@@ -10,158 +17,702 @@ is equivalent to the expression x+y. The function names are those\n\
used for special methods; variants without leading and trailing\n\
'__' are also provided for convenience.");
-#define spam1(OP,AOP) static PyObject *OP(PyObject *s, PyObject *a1) { \
- return AOP(a1); }
-
-#define spam2(OP,AOP) static PyObject *OP(PyObject *s, PyObject *a) { \
- PyObject *a1, *a2; \
- if(! PyArg_UnpackTuple(a,#OP,2,2,&a1,&a2)) return NULL; \
- return AOP(a1,a2); }
-
-#define spamoi(OP,AOP) static PyObject *OP(PyObject *s, PyObject *a) { \
- PyObject *a1; int a2; \
- if(! PyArg_ParseTuple(a,"Oi:" #OP,&a1,&a2)) return NULL; \
- return AOP(a1,a2); }
-
-#define spam2n(OP,AOP) static PyObject *OP(PyObject *s, PyObject *a) { \
- PyObject *a1, *a2; \
- if(! PyArg_UnpackTuple(a,#OP,2,2,&a1,&a2)) return NULL; \
- if(-1 == AOP(a1,a2)) return NULL; \
- Py_INCREF(Py_None); \
- return Py_None; }
-
-#define spam3n(OP,AOP) static PyObject *OP(PyObject *s, PyObject *a) { \
- PyObject *a1, *a2, *a3; \
- if(! PyArg_UnpackTuple(a,#OP,3,3,&a1,&a2,&a3)) return NULL; \
- if(-1 == AOP(a1,a2,a3)) return NULL; \
- Py_INCREF(Py_None); \
- return Py_None; }
-
-#define spami(OP,AOP) static PyObject *OP(PyObject *s, PyObject *a1) { \
- long r; \
- if(-1 == (r=AOP(a1))) return NULL; \
- return PyBool_FromLong(r); }
-
-#define spami2(OP,AOP) static PyObject *OP(PyObject *s, PyObject *a) { \
- PyObject *a1, *a2; long r; \
- if(! PyArg_UnpackTuple(a,#OP,2,2,&a1,&a2)) return NULL; \
- if(-1 == (r=AOP(a1,a2))) return NULL; \
- return PyLong_FromLong(r); }
-
-#define spamn2(OP,AOP) static PyObject *OP(PyObject *s, PyObject *a) { \
- PyObject *a1, *a2; Py_ssize_t r; \
- if(! PyArg_UnpackTuple(a,#OP,2,2,&a1,&a2)) return NULL; \
- if(-1 == (r=AOP(a1,a2))) return NULL; \
- return PyLong_FromSsize_t(r); }
-
-#define spami2b(OP,AOP) static PyObject *OP(PyObject *s, PyObject *a) { \
- PyObject *a1, *a2; long r; \
- if(! PyArg_UnpackTuple(a,#OP,2,2,&a1,&a2)) return NULL; \
- if(-1 == (r=AOP(a1,a2))) return NULL; \
- return PyBool_FromLong(r); }
-
-#define spamrc(OP,A) static PyObject *OP(PyObject *s, PyObject *a) { \
- PyObject *a1, *a2; \
- if(! PyArg_UnpackTuple(a,#OP,2,2,&a1,&a2)) return NULL; \
- return PyObject_RichCompare(a1,a2,A); }
-
-spami(truth , PyObject_IsTrue)
-spam2(op_add , PyNumber_Add)
-spam2(op_sub , PyNumber_Subtract)
-spam2(op_mul , PyNumber_Multiply)
-spam2(op_matmul , PyNumber_MatrixMultiply)
-spam2(op_floordiv , PyNumber_FloorDivide)
-spam2(op_truediv , PyNumber_TrueDivide)
-spam2(op_mod , PyNumber_Remainder)
-spam1(op_neg , PyNumber_Negative)
-spam1(op_pos , PyNumber_Positive)
-spam1(op_abs , PyNumber_Absolute)
-spam1(op_inv , PyNumber_Invert)
-spam1(op_invert , PyNumber_Invert)
-spam2(op_lshift , PyNumber_Lshift)
-spam2(op_rshift , PyNumber_Rshift)
-spami(op_not_ , PyObject_Not)
-spam2(op_and_ , PyNumber_And)
-spam2(op_xor , PyNumber_Xor)
-spam2(op_or_ , PyNumber_Or)
-spam2(op_iadd , PyNumber_InPlaceAdd)
-spam2(op_isub , PyNumber_InPlaceSubtract)
-spam2(op_imul , PyNumber_InPlaceMultiply)
-spam2(op_imatmul , PyNumber_InPlaceMatrixMultiply)
-spam2(op_ifloordiv , PyNumber_InPlaceFloorDivide)
-spam2(op_itruediv , PyNumber_InPlaceTrueDivide)
-spam2(op_imod , PyNumber_InPlaceRemainder)
-spam2(op_ilshift , PyNumber_InPlaceLshift)
-spam2(op_irshift , PyNumber_InPlaceRshift)
-spam2(op_iand , PyNumber_InPlaceAnd)
-spam2(op_ixor , PyNumber_InPlaceXor)
-spam2(op_ior , PyNumber_InPlaceOr)
-spam2(op_concat , PySequence_Concat)
-spam2(op_iconcat , PySequence_InPlaceConcat)
-spami2b(op_contains , PySequence_Contains)
-spamn2(indexOf , PySequence_Index)
-spamn2(countOf , PySequence_Count)
-spam2(op_getitem , PyObject_GetItem)
-spam2n(op_delitem , PyObject_DelItem)
-spam3n(op_setitem , PyObject_SetItem)
-spamrc(op_lt , Py_LT)
-spamrc(op_le , Py_LE)
-spamrc(op_eq , Py_EQ)
-spamrc(op_ne , Py_NE)
-spamrc(op_gt , Py_GT)
-spamrc(op_ge , Py_GE)
-
-static PyObject*
-op_pow(PyObject *s, PyObject *a)
-{
- PyObject *a1, *a2;
- if (PyArg_UnpackTuple(a,"pow", 2, 2, &a1, &a2))
- return PyNumber_Power(a1, a2, Py_None);
- return NULL;
-}
-
-static PyObject*
-op_ipow(PyObject *s, PyObject *a)
-{
- PyObject *a1, *a2;
- if (PyArg_UnpackTuple(a,"ipow", 2, 2, &a1, &a2))
- return PyNumber_InPlacePower(a1, a2, Py_None);
- return NULL;
+
+/*[clinic input]
+_operator.truth -> bool
+
+ a: object
+ /
+
+Return True if a is true, False otherwise.
+[clinic start generated code]*/
+
+static int
+_operator_truth_impl(PyObject *module, PyObject *a)
+/*[clinic end generated code: output=eaf87767234fa5d7 input=bc74a4cd90235875]*/
+{
+ return PyObject_IsTrue(a);
+}
+
+/*[clinic input]
+_operator.add
+
+ a: object
+ b: object
+ /
+
+Same as a + b.
+[clinic start generated code]*/
+
+static PyObject *
+_operator_add_impl(PyObject *module, PyObject *a, PyObject *b)
+/*[clinic end generated code: output=8292984204f45164 input=5efe3bff856ac215]*/
+{
+ return PyNumber_Add(a, b);
+}
+
+/*[clinic input]
+_operator.sub = _operator.add
+
+Same as a - b.
+[clinic start generated code]*/
+
+static PyObject *
+_operator_sub_impl(PyObject *module, PyObject *a, PyObject *b)
+/*[clinic end generated code: output=4adfc3b888c1ee2e input=6494c6b100b8e795]*/
+{
+ return PyNumber_Subtract(a, b);
+}
+
+/*[clinic input]
+_operator.mul = _operator.add
+
+Same as a * b.
+[clinic start generated code]*/
+
+static PyObject *
+_operator_mul_impl(PyObject *module, PyObject *a, PyObject *b)
+/*[clinic end generated code: output=d24d66f55a01944c input=2368615b4358b70d]*/
+{
+ return PyNumber_Multiply(a, b);
+}
+
+/*[clinic input]
+_operator.matmul = _operator.add
+
+Same as a @ b.
+[clinic start generated code]*/
+
+static PyObject *
+_operator_matmul_impl(PyObject *module, PyObject *a, PyObject *b)
+/*[clinic end generated code: output=a20d917eb35d0101 input=9ab304e37fb42dd4]*/
+{
+ return PyNumber_MatrixMultiply(a, b);
+}
+
+/*[clinic input]
+_operator.floordiv = _operator.add
+
+Same as a // b.
+[clinic start generated code]*/
+
+static PyObject *
+_operator_floordiv_impl(PyObject *module, PyObject *a, PyObject *b)
+/*[clinic end generated code: output=df26b71a60589f99 input=bb2e88ba446c612c]*/
+{
+ return PyNumber_FloorDivide(a, b);
+}
+
+/*[clinic input]
+_operator.truediv = _operator.add
+
+Same as a / b.
+[clinic start generated code]*/
+
+static PyObject *
+_operator_truediv_impl(PyObject *module, PyObject *a, PyObject *b)
+/*[clinic end generated code: output=0e6a959944d77719 input=ecbb947673f4eb1f]*/
+{
+ return PyNumber_TrueDivide(a, b);
+}
+
+/*[clinic input]
+_operator.mod = _operator.add
+
+Same as a % b.
+[clinic start generated code]*/
+
+static PyObject *
+_operator_mod_impl(PyObject *module, PyObject *a, PyObject *b)
+/*[clinic end generated code: output=9519822f0bbec166 input=102e19b422342ac1]*/
+{
+ return PyNumber_Remainder(a, b);
+}
+
+/*[clinic input]
+_operator.neg
+
+ a: object
+ /
+
+Same as -a.
+[clinic start generated code]*/
+
+static PyObject *
+_operator_neg(PyObject *module, PyObject *a)
+/*[clinic end generated code: output=36e08ecfc6a1c08c input=84f09bdcf27c96ec]*/
+{
+ return PyNumber_Negative(a);
+}
+
+/*[clinic input]
+_operator.pos = _operator.neg
+
+Same as +a.
+[clinic start generated code]*/
+
+static PyObject *
+_operator_pos(PyObject *module, PyObject *a)
+/*[clinic end generated code: output=dad7a126221dd091 input=b6445b63fddb8772]*/
+{
+ return PyNumber_Positive(a);
+}
+
+/*[clinic input]
+_operator.abs = _operator.neg
+
+Same as abs(a).
+[clinic start generated code]*/
+
+static PyObject *
+_operator_abs(PyObject *module, PyObject *a)
+/*[clinic end generated code: output=1389a93ba053ea3e input=341d07ba86f58039]*/
+{
+ return PyNumber_Absolute(a);
+}
+
+/*[clinic input]
+_operator.inv = _operator.neg
+
+Same as ~a.
+[clinic start generated code]*/
+
+static PyObject *
+_operator_inv(PyObject *module, PyObject *a)
+/*[clinic end generated code: output=a56875ba075ee06d input=b01a4677739f6eb2]*/
+{
+ return PyNumber_Invert(a);
+}
+
+/*[clinic input]
+_operator.invert = _operator.neg
+
+Same as ~a.
+[clinic start generated code]*/
+
+static PyObject *
+_operator_invert(PyObject *module, PyObject *a)
+/*[clinic end generated code: output=406b5aa030545fcc input=7f2d607176672e55]*/
+{
+ return PyNumber_Invert(a);
+}
+
+/*[clinic input]
+_operator.lshift = _operator.add
+
+Same as a << b.
+[clinic start generated code]*/
+
+static PyObject *
+_operator_lshift_impl(PyObject *module, PyObject *a, PyObject *b)
+/*[clinic end generated code: output=37f7e52c41435bd8 input=746e8a160cbbc9eb]*/
+{
+ return PyNumber_Lshift(a, b);
+}
+
+/*[clinic input]
+_operator.rshift = _operator.add
+
+Same as a >> b.
+[clinic start generated code]*/
+
+static PyObject *
+_operator_rshift_impl(PyObject *module, PyObject *a, PyObject *b)
+/*[clinic end generated code: output=4593c7ef30ec2ee3 input=d2c85bb5a64504c2]*/
+{
+ return PyNumber_Rshift(a, b);
+}
+
+/*[clinic input]
+_operator.not_ = _operator.truth
+
+Same as not a.
+[clinic start generated code]*/
+
+static int
+_operator_not__impl(PyObject *module, PyObject *a)
+/*[clinic end generated code: output=743f9c24a09759ef input=854156d50804d9b8]*/
+{
+ return PyObject_Not(a);
+}
+
+/*[clinic input]
+_operator.and_ = _operator.add
+
+Same as a & b.
+[clinic start generated code]*/
+
+static PyObject *
+_operator_and__impl(PyObject *module, PyObject *a, PyObject *b)
+/*[clinic end generated code: output=93c4fe88f7b76d9e input=4f3057c90ec4c99f]*/
+{
+ return PyNumber_And(a, b);
+}
+
+/*[clinic input]
+_operator.xor = _operator.add
+
+Same as a ^ b.
+[clinic start generated code]*/
+
+static PyObject *
+_operator_xor_impl(PyObject *module, PyObject *a, PyObject *b)
+/*[clinic end generated code: output=b24cd8b79fde0004 input=3c5cfa7253d808dd]*/
+{
+ return PyNumber_Xor(a, b);
+}
+
+/*[clinic input]
+_operator.or_ = _operator.add
+
+Same as a | b.
+[clinic start generated code]*/
+
+static PyObject *
+_operator_or__impl(PyObject *module, PyObject *a, PyObject *b)
+/*[clinic end generated code: output=58024867b8d90461 input=b40c6c44f7c79c09]*/
+{
+ return PyNumber_Or(a, b);
+}
+
+/*[clinic input]
+_operator.iadd = _operator.add
+
+Same as a += b.
+[clinic start generated code]*/
+
+static PyObject *
+_operator_iadd_impl(PyObject *module, PyObject *a, PyObject *b)
+/*[clinic end generated code: output=07dc627832526eb5 input=d22a91c07ac69227]*/
+{
+ return PyNumber_InPlaceAdd(a, b);
+}
+
+/*[clinic input]
+_operator.isub = _operator.add
+
+Same as a -= b.
+[clinic start generated code]*/
+
+static PyObject *
+_operator_isub_impl(PyObject *module, PyObject *a, PyObject *b)
+/*[clinic end generated code: output=4513467d23b5e0b1 input=4591b00d0a0ccafd]*/
+{
+ return PyNumber_InPlaceSubtract(a, b);
+}
+
+/*[clinic input]
+_operator.imul = _operator.add
+
+Same as a *= b.
+[clinic start generated code]*/
+
+static PyObject *
+_operator_imul_impl(PyObject *module, PyObject *a, PyObject *b)
+/*[clinic end generated code: output=5e87dacd19a71eab input=0e01fb8631e1b76f]*/
+{
+ return PyNumber_InPlaceMultiply(a, b);
+}
+
+/*[clinic input]
+_operator.imatmul = _operator.add
+
+Same as a @= b.
+[clinic start generated code]*/
+
+static PyObject *
+_operator_imatmul_impl(PyObject *module, PyObject *a, PyObject *b)
+/*[clinic end generated code: output=d603cbdf716ce519 input=bb614026372cd542]*/
+{
+ return PyNumber_InPlaceMatrixMultiply(a, b);
+}
+
+/*[clinic input]
+_operator.ifloordiv = _operator.add
+
+Same as a //= b.
+[clinic start generated code]*/
+
+static PyObject *
+_operator_ifloordiv_impl(PyObject *module, PyObject *a, PyObject *b)
+/*[clinic end generated code: output=535336048c681794 input=9df3b5021cff4ca1]*/
+{
+ return PyNumber_InPlaceFloorDivide(a, b);
+}
+
+/*[clinic input]
+_operator.itruediv = _operator.add
+
+Same as a /= b.
+[clinic start generated code]*/
+
+static PyObject *
+_operator_itruediv_impl(PyObject *module, PyObject *a, PyObject *b)
+/*[clinic end generated code: output=28017fbd3563952f input=9a1ee01608f5f590]*/
+{
+ return PyNumber_InPlaceTrueDivide(a, b);
+}
+
+/*[clinic input]
+_operator.imod = _operator.add
+
+Same as a %= b.
+[clinic start generated code]*/
+
+static PyObject *
+_operator_imod_impl(PyObject *module, PyObject *a, PyObject *b)
+/*[clinic end generated code: output=f7c540ae0fc70904 input=d0c384a3ce38e1dd]*/
+{
+ return PyNumber_InPlaceRemainder(a, b);
+}
+
+/*[clinic input]
+_operator.ilshift = _operator.add
+
+Same as a <<= b.
+[clinic start generated code]*/
+
+static PyObject *
+_operator_ilshift_impl(PyObject *module, PyObject *a, PyObject *b)
+/*[clinic end generated code: output=e73a8fee1ac18749 input=e21b6b310f54572e]*/
+{
+ return PyNumber_InPlaceLshift(a, b);
+}
+
+/*[clinic input]
+_operator.irshift = _operator.add
+
+Same as a >>= b.
+[clinic start generated code]*/
+
+static PyObject *
+_operator_irshift_impl(PyObject *module, PyObject *a, PyObject *b)
+/*[clinic end generated code: output=97f2af6b5ff2ed81 input=6778dbd0f6e1ec16]*/
+{
+ return PyNumber_InPlaceRshift(a, b);
+}
+
+/*[clinic input]
+_operator.iand = _operator.add
+
+Same as a &= b.
+[clinic start generated code]*/
+
+static PyObject *
+_operator_iand_impl(PyObject *module, PyObject *a, PyObject *b)
+/*[clinic end generated code: output=4599e9d40cbf7d00 input=71dfd8e70c156a7b]*/
+{
+ return PyNumber_InPlaceAnd(a, b);
+}
+
+/*[clinic input]
+_operator.ixor = _operator.add
+
+Same as a ^= b.
+[clinic start generated code]*/
+
+static PyObject *
+_operator_ixor_impl(PyObject *module, PyObject *a, PyObject *b)
+/*[clinic end generated code: output=5ff881766872be03 input=695c32bec0604d86]*/
+{
+ return PyNumber_InPlaceXor(a, b);
+}
+
+/*[clinic input]
+_operator.ior = _operator.add
+
+Same as a |= b.
+[clinic start generated code]*/
+
+static PyObject *
+_operator_ior_impl(PyObject *module, PyObject *a, PyObject *b)
+/*[clinic end generated code: output=48aac319445bf759 input=8f01d03eda9920cf]*/
+{
+ return PyNumber_InPlaceOr(a, b);
+}
+
+/*[clinic input]
+_operator.concat = _operator.add
+
+Same as a + b, for a and b sequences.
+[clinic start generated code]*/
+
+static PyObject *
+_operator_concat_impl(PyObject *module, PyObject *a, PyObject *b)
+/*[clinic end generated code: output=80028390942c5f11 input=8544ccd5341a3658]*/
+{
+ return PySequence_Concat(a, b);
+}
+
+/*[clinic input]
+_operator.iconcat = _operator.add
+
+Same as a += b, for a and b sequences.
+[clinic start generated code]*/
+
+static PyObject *
+_operator_iconcat_impl(PyObject *module, PyObject *a, PyObject *b)
+/*[clinic end generated code: output=3ea0a162ebb2e26d input=8f5fe5722fcd837e]*/
+{
+ return PySequence_InPlaceConcat(a, b);
+}
+
+/*[clinic input]
+_operator.contains -> bool
+
+ a: object
+ b: object
+ /
+
+Same as b in a (note reversed operands).
+[clinic start generated code]*/
+
+static int
+_operator_contains_impl(PyObject *module, PyObject *a, PyObject *b)
+/*[clinic end generated code: output=413b4dbe82b6ffc1 input=9122a69b505fde13]*/
+{
+ return PySequence_Contains(a, b);
+}
+
+/*[clinic input]
+_operator.indexOf -> Py_ssize_t
+
+ a: object
+ b: object
+ /
+
+Return the first index of b in a.
+[clinic start generated code]*/
+
+static Py_ssize_t
+_operator_indexOf_impl(PyObject *module, PyObject *a, PyObject *b)
+/*[clinic end generated code: output=c6226d8e0fb60fa6 input=8be2e43b6a6fffe3]*/
+{
+ return PySequence_Index(a, b);
+}
+
+/*[clinic input]
+_operator.countOf = _operator.indexOf
+
+Return the number of times b occurs in a.
+[clinic start generated code]*/
+
+static Py_ssize_t
+_operator_countOf_impl(PyObject *module, PyObject *a, PyObject *b)
+/*[clinic end generated code: output=9e1623197daf3382 input=0c3a2656add252db]*/
+{
+ return PySequence_Count(a, b);
+}
+
+/*[clinic input]
+_operator.getitem
+
+ a: object
+ b: object
+ /
+
+Same as a[b].
+[clinic start generated code]*/
+
+static PyObject *
+_operator_getitem_impl(PyObject *module, PyObject *a, PyObject *b)
+/*[clinic end generated code: output=6c8d8101a676e594 input=6682797320e48845]*/
+{
+ return PyObject_GetItem(a, b);
+}
+
+/*[clinic input]
+_operator.setitem
+
+ a: object
+ b: object
+ c: object
+ /
+
+Same as a[b] = c.
+[clinic start generated code]*/
+
+static PyObject *
+_operator_setitem_impl(PyObject *module, PyObject *a, PyObject *b,
+ PyObject *c)
+/*[clinic end generated code: output=1324f9061ae99e25 input=ceaf453c4d3a58df]*/
+{
+ if (-1 == PyObject_SetItem(a, b, c))
+ return NULL;
+ Py_RETURN_NONE;
+}
+
+/*[clinic input]
+_operator.delitem = _operator.getitem
+
+Same as del a[b].
+[clinic start generated code]*/
+
+static PyObject *
+_operator_delitem_impl(PyObject *module, PyObject *a, PyObject *b)
+/*[clinic end generated code: output=db18f61506295799 input=991bec56a0d3ec7f]*/
+{
+ if (-1 == PyObject_DelItem(a, b))
+ return NULL;
+ Py_RETURN_NONE;
+}
+
+/*[clinic input]
+_operator.eq
+
+ a: object
+ b: object
+ /
+
+Same as a == b.
+[clinic start generated code]*/
+
+static PyObject *
+_operator_eq_impl(PyObject *module, PyObject *a, PyObject *b)
+/*[clinic end generated code: output=8d7d46ed4135677c input=586fca687a95a83f]*/
+{
+ return PyObject_RichCompare(a, b, Py_EQ);
}
+/*[clinic input]
+_operator.ne = _operator.eq
+
+Same as a != b.
+[clinic start generated code]*/
+
static PyObject *
-op_index(PyObject *s, PyObject *a)
+_operator_ne_impl(PyObject *module, PyObject *a, PyObject *b)
+/*[clinic end generated code: output=c99bd0c3a4c01297 input=5d88f23d35e9abac]*/
+{
+ return PyObject_RichCompare(a, b, Py_NE);
+}
+
+/*[clinic input]
+_operator.lt = _operator.eq
+
+Same as a < b.
+[clinic start generated code]*/
+
+static PyObject *
+_operator_lt_impl(PyObject *module, PyObject *a, PyObject *b)
+/*[clinic end generated code: output=082d7c45c440e535 input=34a59ad6d39d3a2b]*/
+{
+ return PyObject_RichCompare(a, b, Py_LT);
+}
+
+/*[clinic input]
+_operator.le = _operator.eq
+
+Same as a <= b.
+[clinic start generated code]*/
+
+static PyObject *
+_operator_le_impl(PyObject *module, PyObject *a, PyObject *b)
+/*[clinic end generated code: output=00970a2923d0ae17 input=b812a7860a0bef44]*/
+{
+ return PyObject_RichCompare(a, b, Py_LE);
+}
+
+/*[clinic input]
+_operator.gt = _operator.eq
+
+Same as a > b.
+[clinic start generated code]*/
+
+static PyObject *
+_operator_gt_impl(PyObject *module, PyObject *a, PyObject *b)
+/*[clinic end generated code: output=8d373349ecf25641 input=9bdb45b995ada35b]*/
+{
+ return PyObject_RichCompare(a, b, Py_GT);
+}
+
+/*[clinic input]
+_operator.ge = _operator.eq
+
+Same as a >= b.
+[clinic start generated code]*/
+
+static PyObject *
+_operator_ge_impl(PyObject *module, PyObject *a, PyObject *b)
+/*[clinic end generated code: output=7ce3882256d4b137 input=cf1dc4a5ca9c35f5]*/
+{
+ return PyObject_RichCompare(a, b, Py_GE);
+}
+
+/*[clinic input]
+_operator.pow = _operator.add
+
+Same as a ** b.
+[clinic start generated code]*/
+
+static PyObject *
+_operator_pow_impl(PyObject *module, PyObject *a, PyObject *b)
+/*[clinic end generated code: output=09e668ad50036120 input=690b40f097ab1637]*/
+{
+ return PyNumber_Power(a, b, Py_None);
+}
+
+/*[clinic input]
+_operator.ipow = _operator.add
+
+Same as a **= b.
+[clinic start generated code]*/
+
+static PyObject *
+_operator_ipow_impl(PyObject *module, PyObject *a, PyObject *b)
+/*[clinic end generated code: output=7189ff4d4367c808 input=f00623899d07499a]*/
+{
+ return PyNumber_InPlacePower(a, b, Py_None);
+}
+
+/*[clinic input]
+_operator.index
+
+ a: object
+ /
+
+Same as a.__index__()
+[clinic start generated code]*/
+
+static PyObject *
+_operator_index(PyObject *module, PyObject *a)
+/*[clinic end generated code: output=d972b0764ac305fc input=6f54d50ea64a579c]*/
{
return PyNumber_Index(a);
}
-static PyObject*
-is_(PyObject *s, PyObject *a)
+/*[clinic input]
+_operator.is_ = _operator.add
+
+Same as a is b.
+[clinic start generated code]*/
+
+static PyObject *
+_operator_is__impl(PyObject *module, PyObject *a, PyObject *b)
+/*[clinic end generated code: output=bcd47a402e482e1d input=5fa9b97df03c427f]*/
{
- PyObject *a1, *a2, *result = NULL;
- if (PyArg_UnpackTuple(a,"is_", 2, 2, &a1, &a2)) {
- result = (a1 == a2) ? Py_True : Py_False;
- Py_INCREF(result);
- }
+ PyObject *result;
+ result = (a == b) ? Py_True : Py_False;
+ Py_INCREF(result);
return result;
}
-static PyObject*
-is_not(PyObject *s, PyObject *a)
+/*[clinic input]
+_operator.is_not = _operator.add
+
+Same as a is not b.
+[clinic start generated code]*/
+
+static PyObject *
+_operator_is_not_impl(PyObject *module, PyObject *a, PyObject *b)
+/*[clinic end generated code: output=491a1f2f81f6c7f9 input=5a93f7e1a93535f1]*/
{
- PyObject *a1, *a2, *result = NULL;
- if (PyArg_UnpackTuple(a,"is_not", 2, 2, &a1, &a2)) {
- result = (a1 != a2) ? Py_True : Py_False;
- Py_INCREF(result);
- }
+ PyObject *result;
+ result = (a != b) ? Py_True : Py_False;
+ Py_INCREF(result);
return result;
}
-#undef spam1
-#undef spam2
-#undef spam1o
-#undef spam1o
-
/* compare_digest **********************************************************/
/*
@@ -210,53 +761,52 @@ _tscmp(const unsigned char *a, const unsigned char *b,
return (result == 0);
}
-PyDoc_STRVAR(length_hint__doc__,
-"length_hint(obj, default=0) -> int\n"
-"Return an estimate of the number of items in obj.\n"
-"This is useful for presizing containers when building from an\n"
-"iterable.\n"
-"\n"
-"If the object supports len(), the result will be\n"
-"exact. Otherwise, it may over- or under-estimate by an\n"
-"arbitrary amount. The result will be an integer >= 0.");
+/*[clinic input]
+_operator.length_hint -> Py_ssize_t
+
+ obj: object
+ default: Py_ssize_t = 0
+ /
-static PyObject *length_hint(PyObject *self, PyObject *args)
+Return an estimate of the number of items in obj.
+
+This is useful for presizing containers when building from an iterable.
+
+If the object supports len(), the result will be exact.
+Otherwise, it may over- or under-estimate by an arbitrary amount.
+The result will be an integer >= 0.
+[clinic start generated code]*/
+
+static Py_ssize_t
+_operator_length_hint_impl(PyObject *module, PyObject *obj,
+ Py_ssize_t default_value)
+/*[clinic end generated code: output=01d469edc1d612ad input=65ed29f04401e96a]*/
{
- PyObject *obj;
- Py_ssize_t defaultvalue = 0, res;
- if (!PyArg_ParseTuple(args, "O|n:length_hint", &obj, &defaultvalue)) {
- return NULL;
- }
- res = PyObject_LengthHint(obj, defaultvalue);
- if (res == -1 && PyErr_Occurred()) {
- return NULL;
- }
- return PyLong_FromSsize_t(res);
+ return PyObject_LengthHint(obj, default_value);
}
+/*[clinic input]
+_operator._compare_digest = _operator.eq
+
+Return 'a == b'.
+
+This function uses an approach designed to prevent
+timing analysis, making it appropriate for cryptography.
+
+a and b must both be of the same type: either str (ASCII only),
+or any bytes-like object.
-PyDoc_STRVAR(compare_digest__doc__,
-"compare_digest(a, b) -> bool\n"
-"\n"
-"Return 'a == b'. This function uses an approach designed to prevent\n"
-"timing analysis, making it appropriate for cryptography.\n"
-"a and b must both be of the same type: either str (ASCII only),\n"
-"or any bytes-like object.\n"
-"\n"
-"Note: If a and b are of different lengths, or if an error occurs,\n"
-"a timing attack could theoretically reveal information about the\n"
-"types and lengths of a and b--but not their values.\n");
+Note: If a and b are of different lengths, or if an error occurs,
+a timing attack could theoretically reveal information about the
+types and lengths of a and b--but not their values.
+[clinic start generated code]*/
-static PyObject*
-compare_digest(PyObject *self, PyObject *args)
+static PyObject *
+_operator__compare_digest_impl(PyObject *module, PyObject *a, PyObject *b)
+/*[clinic end generated code: output=11d452bdd3a23cbc input=9ac7e2c4e30bc356]*/
{
- PyObject *a, *b;
int rc;
- if (!PyArg_ParseTuple(args, "OO:compare_digest", &a, &b)) {
- return NULL;
- }
-
/* ASCII unicode string */
if(PyUnicode_Check(a) && PyUnicode_Check(b)) {
if (PyUnicode_READY(a) == -1 || PyUnicode_READY(b) == -1) {
@@ -323,78 +873,60 @@ compare_digest(PyObject *self, PyObject *args)
/* operator methods **********************************************************/
-#define spam1(OP,DOC) {#OP, OP, METH_VARARGS, PyDoc_STR(DOC)},
-#define spam2(OP,DOC) {#OP, op_##OP, METH_VARARGS, PyDoc_STR(DOC)},
-#define spam1o(OP,DOC) {#OP, OP, METH_O, PyDoc_STR(DOC)},
-#define spam2o(OP,DOC) {#OP, op_##OP, METH_O, PyDoc_STR(DOC)},
-
static struct PyMethodDef operator_methods[] = {
-spam1o(truth,
- "truth(a) -- Return True if a is true, False otherwise.")
-spam2(contains,
- "contains(a, b) -- Same as b in a (note reversed operands).")
-spam1(indexOf,
- "indexOf(a, b) -- Return the first index of b in a.")
-spam1(countOf,
- "countOf(a, b) -- Return the number of times b occurs in a.")
-
-spam1(is_, "is_(a, b) -- Same as a is b.")
-spam1(is_not, "is_not(a, b) -- Same as a is not b.")
-spam2o(index, "index(a) -- Same as a.__index__()")
-spam2(add, "add(a, b) -- Same as a + b.")
-spam2(sub, "sub(a, b) -- Same as a - b.")
-spam2(mul, "mul(a, b) -- Same as a * b.")
-spam2(matmul, "matmul(a, b) -- Same as a @ b.")
-spam2(floordiv, "floordiv(a, b) -- Same as a // b.")
-spam2(truediv, "truediv(a, b) -- Same as a / b.")
-spam2(mod, "mod(a, b) -- Same as a % b.")
-spam2o(neg, "neg(a) -- Same as -a.")
-spam2o(pos, "pos(a) -- Same as +a.")
-spam2o(abs, "abs(a) -- Same as abs(a).")
-spam2o(inv, "inv(a) -- Same as ~a.")
-spam2o(invert, "invert(a) -- Same as ~a.")
-spam2(lshift, "lshift(a, b) -- Same as a << b.")
-spam2(rshift, "rshift(a, b) -- Same as a >> b.")
-spam2o(not_, "not_(a) -- Same as not a.")
-spam2(and_, "and_(a, b) -- Same as a & b.")
-spam2(xor, "xor(a, b) -- Same as a ^ b.")
-spam2(or_, "or_(a, b) -- Same as a | b.")
-spam2(iadd, "a = iadd(a, b) -- Same as a += b.")
-spam2(isub, "a = isub(a, b) -- Same as a -= b.")
-spam2(imul, "a = imul(a, b) -- Same as a *= b.")
-spam2(imatmul, "a = imatmul(a, b) -- Same as a @= b.")
-spam2(ifloordiv, "a = ifloordiv(a, b) -- Same as a //= b.")
-spam2(itruediv, "a = itruediv(a, b) -- Same as a /= b")
-spam2(imod, "a = imod(a, b) -- Same as a %= b.")
-spam2(ilshift, "a = ilshift(a, b) -- Same as a <<= b.")
-spam2(irshift, "a = irshift(a, b) -- Same as a >>= b.")
-spam2(iand, "a = iand(a, b) -- Same as a &= b.")
-spam2(ixor, "a = ixor(a, b) -- Same as a ^= b.")
-spam2(ior, "a = ior(a, b) -- Same as a |= b.")
-spam2(concat,
- "concat(a, b) -- Same as a + b, for a and b sequences.")
-spam2(iconcat,
- "a = iconcat(a, b) -- Same as a += b, for a and b sequences.")
-spam2(getitem,
- "getitem(a, b) -- Same as a[b].")
-spam2(setitem,
- "setitem(a, b, c) -- Same as a[b] = c.")
-spam2(delitem,
- "delitem(a, b) -- Same as del a[b].")
-spam2(pow, "pow(a, b) -- Same as a ** b.")
-spam2(ipow, "a = ipow(a, b) -- Same as a **= b.")
-spam2(lt, "lt(a, b) -- Same as a<b.")
-spam2(le, "le(a, b) -- Same as a<=b.")
-spam2(eq, "eq(a, b) -- Same as a==b.")
-spam2(ne, "ne(a, b) -- Same as a!=b.")
-spam2(gt, "gt(a, b) -- Same as a>b.")
-spam2(ge, "ge(a, b) -- Same as a>=b.")
-
- {"_compare_digest", (PyCFunction)compare_digest, METH_VARARGS,
- compare_digest__doc__},
- {"length_hint", (PyCFunction)length_hint, METH_VARARGS,
- length_hint__doc__},
+ _OPERATOR_TRUTH_METHODDEF
+ _OPERATOR_CONTAINS_METHODDEF
+ _OPERATOR_INDEXOF_METHODDEF
+ _OPERATOR_COUNTOF_METHODDEF
+ _OPERATOR_IS__METHODDEF
+ _OPERATOR_IS_NOT_METHODDEF
+ _OPERATOR_INDEX_METHODDEF
+ _OPERATOR_ADD_METHODDEF
+ _OPERATOR_SUB_METHODDEF
+ _OPERATOR_MUL_METHODDEF
+ _OPERATOR_MATMUL_METHODDEF
+ _OPERATOR_FLOORDIV_METHODDEF
+ _OPERATOR_TRUEDIV_METHODDEF
+ _OPERATOR_MOD_METHODDEF
+ _OPERATOR_NEG_METHODDEF
+ _OPERATOR_POS_METHODDEF
+ _OPERATOR_ABS_METHODDEF
+ _OPERATOR_INV_METHODDEF
+ _OPERATOR_INVERT_METHODDEF
+ _OPERATOR_LSHIFT_METHODDEF
+ _OPERATOR_RSHIFT_METHODDEF
+ _OPERATOR_NOT__METHODDEF
+ _OPERATOR_AND__METHODDEF
+ _OPERATOR_XOR_METHODDEF
+ _OPERATOR_OR__METHODDEF
+ _OPERATOR_IADD_METHODDEF
+ _OPERATOR_ISUB_METHODDEF
+ _OPERATOR_IMUL_METHODDEF
+ _OPERATOR_IMATMUL_METHODDEF
+ _OPERATOR_IFLOORDIV_METHODDEF
+ _OPERATOR_ITRUEDIV_METHODDEF
+ _OPERATOR_IMOD_METHODDEF
+ _OPERATOR_ILSHIFT_METHODDEF
+ _OPERATOR_IRSHIFT_METHODDEF
+ _OPERATOR_IAND_METHODDEF
+ _OPERATOR_IXOR_METHODDEF
+ _OPERATOR_IOR_METHODDEF
+ _OPERATOR_CONCAT_METHODDEF
+ _OPERATOR_ICONCAT_METHODDEF
+ _OPERATOR_GETITEM_METHODDEF
+ _OPERATOR_SETITEM_METHODDEF
+ _OPERATOR_DELITEM_METHODDEF
+ _OPERATOR_POW_METHODDEF
+ _OPERATOR_IPOW_METHODDEF
+ _OPERATOR_EQ_METHODDEF
+ _OPERATOR_NE_METHODDEF
+ _OPERATOR_LT_METHODDEF
+ _OPERATOR_LE_METHODDEF
+ _OPERATOR_GT_METHODDEF
+ _OPERATOR_GE_METHODDEF
+ _OPERATOR__COMPARE_DIGEST_METHODDEF
+ _OPERATOR_LENGTH_HINT_METHODDEF
{NULL, NULL} /* sentinel */
};
@@ -409,6 +941,7 @@ typedef struct {
static PyTypeObject itemgetter_type;
+/* AC 3.5: treats first argument as an iterable, otherwise uses *args */
static PyObject *
itemgetter_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
{
@@ -460,7 +993,7 @@ itemgetter_call(itemgetterobject *ig, PyObject *args, PyObject *kw)
PyObject *obj, *result;
Py_ssize_t i, nitems=ig->nitems;
- if (kw != NULL && !_PyArg_NoKeywords("itemgetter", kw))
+ if (!_PyArg_NoKeywords("itemgetter", kw))
return NULL;
if (!PyArg_UnpackTuple(args, "itemgetter", 1, 1, &obj))
return NULL;
@@ -583,6 +1116,7 @@ typedef struct {
static PyTypeObject attrgetter_type;
+/* AC 3.5: treats first argument as an iterable, otherwise uses *args */
static PyObject *
attrgetter_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
{
@@ -749,7 +1283,7 @@ attrgetter_call(attrgetterobject *ag, PyObject *args, PyObject *kw)
PyObject *obj, *result;
Py_ssize_t i, nattrs=ag->nattrs;
- if (kw != NULL && !_PyArg_NoKeywords("attrgetter", kw))
+ if (!_PyArg_NoKeywords("attrgetter", kw))
return NULL;
if (!PyArg_UnpackTuple(args, "attrgetter", 1, 1, &obj))
return NULL;
@@ -927,6 +1461,7 @@ typedef struct {
static PyTypeObject methodcaller_type;
+/* AC 3.5: variable number of arguments, not currently support by AC */
static PyObject *
methodcaller_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
{
@@ -992,7 +1527,7 @@ methodcaller_call(methodcallerobject *mc, PyObject *args, PyObject *kw)
{
PyObject *method, *obj, *result;
- if (kw != NULL && !_PyArg_NoKeywords("methodcaller", kw))
+ if (!_PyArg_NoKeywords("methodcaller", kw))
return NULL;
if (!PyArg_UnpackTuple(args, "methodcaller", 1, 1, &obj))
return NULL;
@@ -1016,16 +1551,7 @@ methodcaller_repr(methodcallerobject *mc)
return PyUnicode_FromFormat("%s(...)", Py_TYPE(mc)->tp_name);
}
- if (mc->kwds != NULL) {
- numkwdargs = PyDict_Size(mc->kwds);
- if (numkwdargs < 0) {
- Py_ReprLeave((PyObject *)mc);
- return NULL;
- }
- } else {
- numkwdargs = 0;
- }
-
+ numkwdargs = mc->kwds != NULL ? PyDict_GET_SIZE(mc->kwds) : 0;
numposargs = PyTuple_GET_SIZE(mc->args);
numtotalargs = numposargs + numkwdargs;
@@ -1092,7 +1618,7 @@ static PyObject *
methodcaller_reduce(methodcallerobject *mc)
{
PyObject *newargs;
- if (!mc->kwds || PyDict_Size(mc->kwds) == 0) {
+ if (!mc->kwds || PyDict_GET_SIZE(mc->kwds) == 0) {
Py_ssize_t i;
Py_ssize_t callargcount = PyTuple_GET_SIZE(mc->args);
newargs = PyTuple_New(1 + callargcount);
diff --git a/Modules/_pickle.c b/Modules/_pickle.c
index 920b46fc28..e65b88e9c0 100644
--- a/Modules/_pickle.c
+++ b/Modules/_pickle.c
@@ -346,7 +346,7 @@ _Pickle_FastCall(PyObject *func, PyObject *obj)
{
PyObject *result;
- result = _PyObject_CallArg1(func, obj);
+ result = PyObject_CallFunctionObjArgs(func, obj, NULL);
Py_DECREF(obj);
return result;
}
@@ -1936,7 +1936,7 @@ save_long(PicklerObject *self, PyObject *obj)
goto error;
}
else {
- char *string;
+ const char *string;
/* proto < 2: write the repr and newline. This is quadratic-time (in
the number of digits), in both directions. We add a trailing 'L'
@@ -2213,7 +2213,7 @@ write_unicode_binary(PicklerObject *self, PyObject *obj)
{
PyObject *encoded = NULL;
Py_ssize_t size;
- char *data;
+ const char *data;
int r;
if (PyUnicode_READY(obj))
@@ -2782,10 +2782,10 @@ batch_dict_exact(PicklerObject *self, PyObject *obj)
const char setitem_op = SETITEM;
const char setitems_op = SETITEMS;
- assert(obj != NULL);
+ assert(obj != NULL && PyDict_CheckExact(obj));
assert(self->proto > 0);
- dict_size = PyDict_Size(obj);
+ dict_size = PyDict_GET_SIZE(obj);
/* Special-case len(d) == 1 to save space. */
if (dict_size == 1) {
@@ -2814,7 +2814,7 @@ batch_dict_exact(PicklerObject *self, PyObject *obj)
}
if (_Pickler_Write(self, &setitems_op, 1) < 0)
return -1;
- if (PyDict_Size(obj) != dict_size) {
+ if (PyDict_GET_SIZE(obj) != dict_size) {
PyErr_Format(
PyExc_RuntimeError,
"dictionary changed size during iteration");
@@ -2832,6 +2832,7 @@ save_dict(PicklerObject *self, PyObject *obj)
char header[3];
Py_ssize_t len;
int status = 0;
+ assert(PyDict_Check(obj));
if (self->fast && !fast_save_enter(self, obj))
goto error;
@@ -2850,14 +2851,10 @@ save_dict(PicklerObject *self, PyObject *obj)
if (_Pickler_Write(self, header, len) < 0)
goto error;
- /* Get dict size, and bow out early if empty. */
- if ((len = PyDict_Size(obj)) < 0)
- goto error;
-
if (memo_put(self, obj) < 0)
goto error;
- if (len != 0) {
+ if (PyDict_GET_SIZE(obj)) {
/* Save the dict items. */
if (PyDict_CheckExact(obj) && self->proto > 0) {
/* We can take certain shortcuts if we know this is a dict and
@@ -4565,8 +4562,8 @@ find_class(UnpicklerObject *self, PyObject *module_name, PyObject *global_name)
{
_Py_IDENTIFIER(find_class);
- return _PyObject_CallMethodId((PyObject *)self, &PyId_find_class, "OO",
- module_name, global_name);
+ return _PyObject_CallMethodIdObjArgs((PyObject *)self, &PyId_find_class,
+ module_name, global_name, NULL);
}
static Py_ssize_t
@@ -4756,7 +4753,7 @@ static int
load_long(UnpicklerObject *self)
{
PyObject *value;
- char *s;
+ char *s = NULL;
Py_ssize_t len;
if ((len = _Unpickler_Readline(self, &s)) < 0)
@@ -4987,7 +4984,7 @@ load_unicode(UnpicklerObject *self)
{
PyObject *str;
Py_ssize_t len;
- char *s;
+ char *s = NULL;
if ((len = _Unpickler_Readline(self, &s)) < 0)
return -1;
@@ -5178,7 +5175,7 @@ instantiate(PyObject *cls, PyObject *args)
else {
_Py_IDENTIFIER(__new__);
- result = _PyObject_CallMethodId(cls, &PyId___new__, "O", cls);
+ result = _PyObject_CallMethodIdObjArgs(cls, &PyId___new__, cls, NULL);
}
return result;
}
@@ -5726,7 +5723,7 @@ load_put(UnpicklerObject *self)
PyObject *key, *value;
Py_ssize_t idx;
Py_ssize_t len;
- char *s;
+ char *s = NULL;
if ((len = _Unpickler_Readline(self, &s)) < 0)
return -1;
@@ -5810,7 +5807,9 @@ static int
do_append(UnpicklerObject *self, Py_ssize_t x)
{
PyObject *value;
+ PyObject *slice;
PyObject *list;
+ PyObject *result;
Py_ssize_t len, i;
len = Py_SIZE(self->stack);
@@ -5821,8 +5820,7 @@ do_append(UnpicklerObject *self, Py_ssize_t x)
list = self->stack->data[x - 1];
- if (PyList_Check(list)) {
- PyObject *slice;
+ if (PyList_CheckExact(list)) {
Py_ssize_t list_len;
int ret;
@@ -5835,27 +5833,47 @@ do_append(UnpicklerObject *self, Py_ssize_t x)
return ret;
}
else {
- PyObject *append_func;
- _Py_IDENTIFIER(append);
-
- append_func = _PyObject_GetAttrId(list, &PyId_append);
- if (append_func == NULL)
- return -1;
- for (i = x; i < len; i++) {
- PyObject *result;
-
- value = self->stack->data[i];
- result = _Pickle_FastCall(append_func, value);
- if (result == NULL) {
- Pdata_clear(self->stack, i + 1);
- Py_SIZE(self->stack) = x;
- Py_DECREF(append_func);
+ PyObject *extend_func;
+ _Py_IDENTIFIER(extend);
+
+ extend_func = _PyObject_GetAttrId(list, &PyId_extend);
+ if (extend_func != NULL) {
+ slice = Pdata_poplist(self->stack, x);
+ if (!slice) {
+ Py_DECREF(extend_func);
return -1;
}
+ result = _Pickle_FastCall(extend_func, slice);
+ Py_DECREF(extend_func);
+ if (result == NULL)
+ return -1;
Py_DECREF(result);
}
- Py_SIZE(self->stack) = x;
- Py_DECREF(append_func);
+ else {
+ PyObject *append_func;
+ _Py_IDENTIFIER(append);
+
+ /* Even if the PEP 307 requires extend() and append() methods,
+ fall back on append() if the object has no extend() method
+ for backward compatibility. */
+ PyErr_Clear();
+ append_func = _PyObject_GetAttrId(list, &PyId_append);
+ if (append_func == NULL)
+ return -1;
+ for (i = x; i < len; i++) {
+ value = self->stack->data[i];
+ result = _Pickle_FastCall(append_func, value);
+ if (result == NULL) {
+ Pdata_clear(self->stack, i + 1);
+ Py_SIZE(self->stack) = x;
+ Py_DECREF(append_func);
+ return -1;
+ }
+ Py_DECREF(result);
+ }
+ Py_SIZE(self->stack) = x;
+ Py_DECREF(append_func);
+ }
}
return 0;
@@ -6872,7 +6890,7 @@ Unpickler_set_memo(UnpicklerObject *self, PyObject *obj)
Py_ssize_t i = 0;
PyObject *key, *value;
- new_memo_size = PyDict_Size(obj);
+ new_memo_size = PyDict_GET_SIZE(obj);
new_memo = _Unpickler_NewMemo(new_memo_size);
if (new_memo == NULL)
return -1;
diff --git a/Modules/_randommodule.c b/Modules/_randommodule.c
index 0d3282db8f..976054cd9b 100644
--- a/Modules/_randommodule.c
+++ b/Modules/_randommodule.c
@@ -376,8 +376,7 @@ random_setstate(RandomObject *self, PyObject *state)
}
self->index = (int)index;
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
static PyObject *
diff --git a/Modules/_scproxy.c b/Modules/_scproxy.c
index 1ce4b776f3..0e3b02879b 100644
--- a/Modules/_scproxy.c
+++ b/Modules/_scproxy.c
@@ -64,8 +64,7 @@ get_proxy_settings(PyObject* mod __attribute__((__unused__)))
proxyDict = SCDynamicStoreCopyProxies(NULL);
if (!proxyDict) {
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
result = PyDict_New();
diff --git a/Modules/_sha3/clinic/sha3module.c.h b/Modules/_sha3/clinic/sha3module.c.h
index 7688e7de29..33ff4b0d4f 100644
--- a/Modules/_sha3/clinic/sha3module.c.h
+++ b/Modules/_sha3/clinic/sha3module.c.h
@@ -112,7 +112,7 @@ _sha3_shake_128_digest(SHA3object *self, PyObject **args, Py_ssize_t nargs, PyOb
static _PyArg_Parser _parser = {"k:digest", _keywords, 0};
unsigned long length;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
&length)) {
goto exit;
}
@@ -142,7 +142,7 @@ _sha3_shake_128_hexdigest(SHA3object *self, PyObject **args, Py_ssize_t nargs, P
static _PyArg_Parser _parser = {"k:hexdigest", _keywords, 0};
unsigned long length;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
&length)) {
goto exit;
}
@@ -151,4 +151,4 @@ _sha3_shake_128_hexdigest(SHA3object *self, PyObject **args, Py_ssize_t nargs, P
exit:
return return_value;
}
-/*[clinic end generated code: output=9888beab45136a56 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=f2278bf0852a7850 input=a9049054013a1b77]*/
diff --git a/Modules/_sha3/sha3module.c b/Modules/_sha3/sha3module.c
index 11aaa1f6b0..33b77b15bd 100644
--- a/Modules/_sha3/sha3module.c
+++ b/Modules/_sha3/sha3module.c
@@ -403,8 +403,7 @@ _sha3_sha3_224_update(SHA3object *self, PyObject *obj)
}
PyBuffer_Release(&buf);
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
diff --git a/Modules/_sqlite/cache.c b/Modules/_sqlite/cache.c
index 62c58931fa..72b1f2c561 100644
--- a/Modules/_sqlite/cache.c
+++ b/Modules/_sqlite/cache.c
@@ -162,7 +162,7 @@ PyObject* pysqlite_cache_get(pysqlite_Cache* self, PyObject* args)
* entry in the cache, and make space if necessary by throwing the
* least used item out of the cache. */
- if (PyDict_Size(self->mapping) == self->size) {
+ if (PyDict_GET_SIZE(self->mapping) == self->size) {
if (self->last) {
node = self->last;
diff --git a/Modules/_sqlite/connection.c b/Modules/_sqlite/connection.c
index 1c6aa54c22..37b45f330b 100644
--- a/Modules/_sqlite/connection.c
+++ b/Modules/_sqlite/connection.c
@@ -400,8 +400,7 @@ error:
if (PyErr_Occurred()) {
return NULL;
} else {
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
}
@@ -443,8 +442,7 @@ error:
if (PyErr_Occurred()) {
return NULL;
} else {
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
}
@@ -487,8 +485,7 @@ error:
if (PyErr_Occurred()) {
return NULL;
} else {
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
}
@@ -645,7 +642,7 @@ static void _pysqlite_step_callback(sqlite3_context *context, int argc, sqlite3_
aggregate_instance = (PyObject**)sqlite3_aggregate_context(context, sizeof(PyObject*));
if (*aggregate_instance == 0) {
- *aggregate_instance = PyObject_CallFunction(aggregate_class, NULL);
+ *aggregate_instance = _PyObject_CallNoArg(aggregate_class);
if (PyErr_Occurred()) {
*aggregate_instance = 0;
@@ -933,7 +930,7 @@ static int _progress_handler(void* user_arg)
gilstate = PyGILState_Ensure();
#endif
- ret = PyObject_CallFunction((PyObject*)user_arg, NULL);
+ ret = _PyObject_CallNoArg((PyObject*)user_arg);
if (!ret) {
if (_enable_callback_tracebacks) {
@@ -1489,7 +1486,7 @@ pysqlite_connection_create_collation(pysqlite_Connection* self, PyObject* args)
PyObject* retval;
Py_ssize_t i, len;
_Py_IDENTIFIER(upper);
- char *uppercase_name_str;
+ const char *uppercase_name_str;
int rc;
unsigned int kind;
void *data;
diff --git a/Modules/_sqlite/module.c b/Modules/_sqlite/module.c
index cc45331ab5..72c3a7f34f 100644
--- a/Modules/_sqlite/module.c
+++ b/Modules/_sqlite/module.c
@@ -303,6 +303,19 @@ static const IntConstantPair _int_constants[] = {
#if SQLITE_VERSION_NUMBER >= 3003000
{"SQLITE_ANALYZE", SQLITE_ANALYZE},
#endif
+#if SQLITE_VERSION_NUMBER >= 3003007
+ {"SQLITE_CREATE_VTABLE", SQLITE_CREATE_VTABLE},
+ {"SQLITE_DROP_VTABLE", SQLITE_DROP_VTABLE},
+#endif
+#if SQLITE_VERSION_NUMBER >= 3003008
+ {"SQLITE_FUNCTION", SQLITE_FUNCTION},
+#endif
+#if SQLITE_VERSION_NUMBER >= 3006008
+ {"SQLITE_SAVEPOINT", SQLITE_SAVEPOINT},
+#endif
+#if SQLITE_VERSION_NUMBER >= 3008003
+ {"SQLITE_RECURSIVE", SQLITE_RECURSIVE},
+#endif
{(char*)NULL, 0}
};
diff --git a/Modules/_sqlite/row.c b/Modules/_sqlite/row.c
index 53342f3444..c6c3e98bb2 100644
--- a/Modules/_sqlite/row.c
+++ b/Modules/_sqlite/row.c
@@ -79,12 +79,12 @@ PyObject* pysqlite_row_item(pysqlite_Row* self, Py_ssize_t idx)
PyObject* pysqlite_row_subscript(pysqlite_Row* self, PyObject* idx)
{
Py_ssize_t _idx;
- char* key;
+ const char *key;
Py_ssize_t nitems, i;
- char* compare_key;
+ const char *compare_key;
- char* p1;
- char* p2;
+ const char *p1;
+ const char *p2;
PyObject* item;
diff --git a/Modules/_sqlite/statement.c b/Modules/_sqlite/statement.c
index 0df661b9c7..8b45a03320 100644
--- a/Modules/_sqlite/statement.c
+++ b/Modules/_sqlite/statement.c
@@ -112,7 +112,7 @@ int pysqlite_statement_create(pysqlite_Statement* self, pysqlite_Connection* con
int pysqlite_statement_bind_parameter(pysqlite_Statement* self, int pos, PyObject* parameter)
{
int rc = SQLITE_OK;
- char* string;
+ const char *string;
Py_ssize_t buflen;
parameter_type paramtype;
diff --git a/Modules/_sre.c b/Modules/_sre.c
index d09249672f..2a2fd272c4 100644
--- a/Modules/_sre.c
+++ b/Modules/_sre.c
@@ -481,8 +481,7 @@ state_getslice(SRE_STATE* state, Py_ssize_t index, PyObject* string, int empty)
/* want empty string */
i = j = 0;
else {
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
} else {
i = STATE_OFFSET(state, state->mark[index]);
@@ -551,55 +550,25 @@ sre_search(SRE_STATE* state, SRE_CODE* pattern)
return sre_ucs4_search(state, pattern);
}
-static PyObject *
-fix_string_param(PyObject *string, PyObject *string2, const char *oldname)
-{
- if (string2 != NULL) {
- if (string != NULL) {
- PyErr_Format(PyExc_TypeError,
- "Argument given by name ('%s') and position (1)",
- oldname);
- return NULL;
- }
- if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
- "The '%s' keyword parameter name is deprecated. "
- "Use 'string' instead.", oldname) < 0)
- return NULL;
- return string2;
- }
- if (string == NULL) {
- PyErr_SetString(PyExc_TypeError,
- "Required argument 'string' (pos 1) not found");
- return NULL;
- }
- return string;
-}
-
/*[clinic input]
_sre.SRE_Pattern.match
- string: object = NULL
+ string: object
pos: Py_ssize_t = 0
endpos: Py_ssize_t(c_default="PY_SSIZE_T_MAX") = sys.maxsize
- *
- pattern: object = NULL
Matches zero or more characters at the beginning of the string.
[clinic start generated code]*/
static PyObject *
_sre_SRE_Pattern_match_impl(PatternObject *self, PyObject *string,
- Py_ssize_t pos, Py_ssize_t endpos,
- PyObject *pattern)
-/*[clinic end generated code: output=74b4b1da3bb2d84e input=3d079aa99979b81d]*/
+ Py_ssize_t pos, Py_ssize_t endpos)
+/*[clinic end generated code: output=ea2d838888510661 input=a2ba191647abebe5]*/
{
SRE_STATE state;
Py_ssize_t status;
PyObject *match;
- string = fix_string_param(string, pattern, "pattern");
- if (!string)
- return NULL;
if (!state_init(&state, (PatternObject *)self, string, pos, endpos))
return NULL;
@@ -623,29 +592,22 @@ _sre_SRE_Pattern_match_impl(PatternObject *self, PyObject *string,
/*[clinic input]
_sre.SRE_Pattern.fullmatch
- string: object = NULL
+ string: object
pos: Py_ssize_t = 0
endpos: Py_ssize_t(c_default="PY_SSIZE_T_MAX") = sys.maxsize
- *
- pattern: object = NULL
Matches against all of the string
[clinic start generated code]*/
static PyObject *
_sre_SRE_Pattern_fullmatch_impl(PatternObject *self, PyObject *string,
- Py_ssize_t pos, Py_ssize_t endpos,
- PyObject *pattern)
-/*[clinic end generated code: output=1c98bc5da744ea94 input=d4228606cc12580f]*/
+ Py_ssize_t pos, Py_ssize_t endpos)
+/*[clinic end generated code: output=5833c47782a35f4a input=a6f640614aaefceb]*/
{
SRE_STATE state;
Py_ssize_t status;
PyObject *match;
- string = fix_string_param(string, pattern, "pattern");
- if (!string)
- return NULL;
-
if (!state_init(&state, self, string, pos, endpos))
return NULL;
@@ -669,11 +631,9 @@ _sre_SRE_Pattern_fullmatch_impl(PatternObject *self, PyObject *string,
/*[clinic input]
_sre.SRE_Pattern.search
- string: object = NULL
+ string: object
pos: Py_ssize_t = 0
endpos: Py_ssize_t(c_default="PY_SSIZE_T_MAX") = sys.maxsize
- *
- pattern: object = NULL
Scan through string looking for a match, and return a corresponding match object instance.
@@ -682,18 +642,13 @@ Return None if no position in the string matches.
static PyObject *
_sre_SRE_Pattern_search_impl(PatternObject *self, PyObject *string,
- Py_ssize_t pos, Py_ssize_t endpos,
- PyObject *pattern)
-/*[clinic end generated code: output=3839394a18e5ea4f input=dab42720f4be3a4b]*/
+ Py_ssize_t pos, Py_ssize_t endpos)
+/*[clinic end generated code: output=25f302a644e951e8 input=4ae5cb7dc38fed1b]*/
{
SRE_STATE state;
Py_ssize_t status;
PyObject *match;
- string = fix_string_param(string, pattern, "pattern");
- if (!string)
- return NULL;
-
if (!state_init(&state, self, string, pos, endpos))
return NULL;
@@ -762,30 +717,23 @@ deepcopy(PyObject** object, PyObject* memo)
/*[clinic input]
_sre.SRE_Pattern.findall
- string: object = NULL
+ string: object
pos: Py_ssize_t = 0
endpos: Py_ssize_t(c_default="PY_SSIZE_T_MAX") = sys.maxsize
- *
- source: object = NULL
Return a list of all non-overlapping matches of pattern in string.
[clinic start generated code]*/
static PyObject *
_sre_SRE_Pattern_findall_impl(PatternObject *self, PyObject *string,
- Py_ssize_t pos, Py_ssize_t endpos,
- PyObject *source)
-/*[clinic end generated code: output=51295498b300639d input=df688355c056b9de]*/
+ Py_ssize_t pos, Py_ssize_t endpos)
+/*[clinic end generated code: output=f4966baceea60aca input=5b6a4ee799741563]*/
{
SRE_STATE state;
PyObject* list;
Py_ssize_t status;
Py_ssize_t i, b, e;
- string = fix_string_param(string, source, "source");
- if (!string)
- return NULL;
-
if (!state_init(&state, self, string, pos, endpos))
return NULL;
@@ -922,18 +870,16 @@ _sre_SRE_Pattern_scanner_impl(PatternObject *self, PyObject *string,
/*[clinic input]
_sre.SRE_Pattern.split
- string: object = NULL
+ string: object
maxsplit: Py_ssize_t = 0
- *
- source: object = NULL
Split string by the occurrences of pattern.
[clinic start generated code]*/
static PyObject *
_sre_SRE_Pattern_split_impl(PatternObject *self, PyObject *string,
- Py_ssize_t maxsplit, PyObject *source)
-/*[clinic end generated code: output=20bac2ff55b9f84c input=41e0b2e35e599d7b]*/
+ Py_ssize_t maxsplit)
+/*[clinic end generated code: output=7ac66f381c45e0be input=1eeeb10dafc9947a]*/
{
SRE_STATE state;
PyObject* list;
@@ -943,10 +889,6 @@ _sre_SRE_Pattern_split_impl(PatternObject *self, PyObject *string,
Py_ssize_t i;
void* last;
- string = fix_string_param(string, source, "source");
- if (!string)
- return NULL;
-
assert(self->codesize != 0);
if (self->code[0] != SRE_OP_INFO || self->code[3] == 0) {
if (self->code[0] == SRE_OP_INFO && self->code[4] == 0) {
@@ -1157,7 +1099,7 @@ pattern_subx(PatternObject* self, PyObject* ptemplate, PyObject* string,
match = pattern_new_match(self, &state, 1);
if (!match)
goto error;
- item = _PyObject_CallArg1(filter, match);
+ item = PyObject_CallFunctionObjArgs(filter, match, NULL);
Py_DECREF(match);
if (!item)
goto error;
@@ -1438,8 +1380,8 @@ _sre.compile
flags: int
code: object(subclass_of='&PyList_Type')
groups: Py_ssize_t
- groupindex: object
- indexgroup: object
+ groupindex: object(subclass_of='&PyDict_Type')
+ indexgroup: object(subclass_of='&PyTuple_Type')
[clinic start generated code]*/
@@ -1447,7 +1389,7 @@ static PyObject *
_sre_compile_impl(PyObject *module, PyObject *pattern, int flags,
PyObject *code, Py_ssize_t groups, PyObject *groupindex,
PyObject *indexgroup)
-/*[clinic end generated code: output=ef9c2b3693776404 input=7d059ec8ae1edb85]*/
+/*[clinic end generated code: output=ef9c2b3693776404 input=0a68476dbbe5db30]*/
{
/* "compile" pattern descriptor to pattern object */
@@ -2430,8 +2372,7 @@ match_lastindex_get(MatchObject *self)
{
if (self->lastindex >= 0)
return PyLong_FromSsize_t(self->lastindex);
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
static PyObject *
@@ -2445,8 +2386,7 @@ match_lastgroup_get(MatchObject *self)
return result;
PyErr_Clear();
}
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
static PyObject *
@@ -2528,8 +2468,7 @@ pattern_new_match(PatternObject* pattern, SRE_STATE* state, Py_ssize_t status)
} else if (status == 0) {
/* no match */
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
diff --git a/Modules/_ssl.c b/Modules/_ssl.c
index b198857060..1e9a707648 100644
--- a/Modules/_ssl.c
+++ b/Modules/_ssl.c
@@ -755,8 +755,7 @@ _ssl__SSLSocket_do_handshake_impl(PySSLSocket *self)
PySSL_END_ALLOW_THREADS
self->handshake_done = 1;
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
error:
Py_XDECREF(sock);
@@ -3197,7 +3196,7 @@ _password_callback(char *buf, int size, int rwflag, void *userdata)
PySSL_END_ALLOW_THREADS_S(pw_info->thread_state);
if (pw_info->callable) {
- fn_ret = PyObject_CallFunctionObjArgs(pw_info->callable, NULL);
+ fn_ret = _PyObject_CallNoArg(pw_info->callable);
if (!fn_ret) {
/* TODO: It would be nice to move _ctypes_add_traceback() into the
core python API, so we could use it to add a frame here */
@@ -4500,8 +4499,7 @@ _ssl_RAND_add_impl(PyObject *module, Py_buffer *view, double entropy)
buf += written;
len -= written;
} while (len);
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
static PyObject *
diff --git a/Modules/_struct.c b/Modules/_struct.c
index 796d1682f0..f66ee18bc4 100644
--- a/Modules/_struct.c
+++ b/Modules/_struct.c
@@ -9,6 +9,11 @@
#include "structmember.h"
#include <ctype.h>
+/*[clinic input]
+class Struct "PyStructObject *" "&PyStructType"
+[clinic start generated code]*/
+/*[clinic end generated code: output=da39a3ee5e6b4b0d input=9b032058a83ed7c3]*/
+
static PyTypeObject PyStructType;
/* The translation function for each format character is table driven */
@@ -80,6 +85,21 @@ typedef struct { char c; long long x; } s_long_long;
#pragma options align=reset
#endif
+/*[python input]
+class cache_struct_converter(CConverter):
+ type = 'PyStructObject *'
+ converter = 'cache_struct_converter'
+ c_default = "NULL"
+
+ def cleanup(self):
+ return "Py_XDECREF(%s);\n" % self.name
+[python start generated code]*/
+/*[python end generated code: output=da39a3ee5e6b4b0d input=49957cca130ffb63]*/
+
+static int cache_struct_converter(PyObject *, PyObject **);
+
+#include "clinic/_struct.c.h"
+
/* Helper for integer format codes: converts an arbitrary Python object to a
PyLongObject if possible, otherwise fails. Caller should decref. */
@@ -1429,41 +1449,46 @@ s_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
return self;
}
+/*[clinic input]
+Struct.__init__
+
+ format: object
+
+Create a compiled struct object.
+
+Return a new Struct object which writes and reads binary data according to
+the format string.
+
+See help(struct) for more on format strings.
+[clinic start generated code]*/
+
static int
-s_init(PyObject *self, PyObject *args, PyObject *kwds)
+Struct___init___impl(PyStructObject *self, PyObject *format)
+/*[clinic end generated code: output=b8e80862444e92d0 input=192a4575a3dde802]*/
{
- PyStructObject *soself = (PyStructObject *)self;
- PyObject *o_format = NULL;
int ret = 0;
- static char *kwlist[] = {"format", 0};
-
- assert(PyStruct_Check(self));
-
- if (!PyArg_ParseTupleAndKeywords(args, kwds, "O:Struct", kwlist,
- &o_format))
- return -1;
- if (PyUnicode_Check(o_format)) {
- o_format = PyUnicode_AsASCIIString(o_format);
- if (o_format == NULL)
+ if (PyUnicode_Check(format)) {
+ format = PyUnicode_AsASCIIString(format);
+ if (format == NULL)
return -1;
}
/* XXX support buffer interface, too */
else {
- Py_INCREF(o_format);
+ Py_INCREF(format);
}
- if (!PyBytes_Check(o_format)) {
- Py_DECREF(o_format);
+ if (!PyBytes_Check(format)) {
+ Py_DECREF(format);
PyErr_Format(PyExc_TypeError,
"Struct() argument 1 must be a bytes object, not %.200s",
- Py_TYPE(o_format)->tp_name);
+ Py_TYPE(format)->tp_name);
return -1;
}
- Py_XSETREF(soself->s_format, o_format);
+ Py_XSETREF(self->s_format, format);
- ret = prepare_s(soself);
+ ret = prepare_s(self);
return ret;
}
@@ -1517,78 +1542,69 @@ fail:
}
-PyDoc_STRVAR(s_unpack__doc__,
-"S.unpack(buffer) -> (v1, v2, ...)\n\
-\n\
-Return a tuple containing values unpacked according to the format\n\
-string S.format. The buffer's size in bytes must be S.size. See\n\
-help(struct) for more on format strings.");
+/*[clinic input]
+Struct.unpack
+
+ buffer: Py_buffer
+ /
+
+Return a tuple containing unpacked values.
+
+Unpack according to the format string Struct.format. The buffer's size
+in bytes must be Struct.size.
+
+See help(struct) for more on format strings.
+[clinic start generated code]*/
static PyObject *
-s_unpack(PyObject *self, PyObject *input)
+Struct_unpack_impl(PyStructObject *self, Py_buffer *buffer)
+/*[clinic end generated code: output=873a24faf02e848a input=3113f8e7038b2f6c]*/
{
- Py_buffer vbuf;
- PyObject *result;
- PyStructObject *soself = (PyStructObject *)self;
-
- assert(PyStruct_Check(self));
- assert(soself->s_codes != NULL);
- if (PyObject_GetBuffer(input, &vbuf, PyBUF_SIMPLE) < 0)
- return NULL;
- if (vbuf.len != soself->s_size) {
+ assert(self->s_codes != NULL);
+ if (buffer->len != self->s_size) {
PyErr_Format(StructError,
"unpack requires a bytes object of length %zd",
- soself->s_size);
- PyBuffer_Release(&vbuf);
+ self->s_size);
return NULL;
}
- result = s_unpack_internal(soself, vbuf.buf);
- PyBuffer_Release(&vbuf);
- return result;
+ return s_unpack_internal(self, buffer->buf);
}
-PyDoc_STRVAR(s_unpack_from__doc__,
-"S.unpack_from(buffer, offset=0) -> (v1, v2, ...)\n\
-\n\
-Return a tuple containing values unpacked according to the format\n\
-string S.format. The buffer's size in bytes, minus offset, must be at\n\
-least S.size. See help(struct) for more on format strings.");
+/*[clinic input]
+Struct.unpack_from
-static PyObject *
-s_unpack_from(PyObject *self, PyObject *args, PyObject *kwds)
-{
- static char *kwlist[] = {"buffer", "offset", 0};
+ buffer: Py_buffer
+ offset: Py_ssize_t = 0
- PyObject *input;
- Py_ssize_t offset = 0;
- Py_buffer vbuf;
- PyObject *result;
- PyStructObject *soself = (PyStructObject *)self;
+Return a tuple containing unpacked values.
- assert(PyStruct_Check(self));
- assert(soself->s_codes != NULL);
+Values are unpacked according to the format string Struct.format.
+
+The buffer's size in bytes, minus offset, must be at least Struct.size.
+
+See help(struct) for more on format strings.
+[clinic start generated code]*/
+
+static PyObject *
+Struct_unpack_from_impl(PyStructObject *self, Py_buffer *buffer,
+ Py_ssize_t offset)
+/*[clinic end generated code: output=57fac875e0977316 input=97ade52422f8962f]*/
+{
+ assert(self->s_codes != NULL);
- if (!PyArg_ParseTupleAndKeywords(args, kwds,
- "O|n:unpack_from", kwlist,
- &input, &offset))
- return NULL;
- if (PyObject_GetBuffer(input, &vbuf, PyBUF_SIMPLE) < 0)
- return NULL;
if (offset < 0)
- offset += vbuf.len;
- if (offset < 0 || vbuf.len - offset < soself->s_size) {
+ offset += buffer->len;
+ if (offset < 0 || buffer->len - offset < self->s_size) {
PyErr_Format(StructError,
"unpack_from requires a buffer of at least %zd bytes",
- soself->s_size);
- PyBuffer_Release(&vbuf);
+ self->s_size);
return NULL;
}
- result = s_unpack_internal(soself, (char*)vbuf.buf + offset);
- PyBuffer_Release(&vbuf);
- return result;
+ return s_unpack_internal(self, (char*)buffer->buf + offset);
}
+
/* Unpack iterator type */
typedef struct {
@@ -1650,7 +1666,7 @@ unpackiter_iternext(unpackiterobject *self)
}
static PyTypeObject unpackiter_type = {
- PyVarObject_HEAD_INIT(&PyType_Type, 0)
+ PyVarObject_HEAD_INIT(NULL, 0)
"unpack_iterator", /* tp_name */
sizeof(unpackiterobject), /* tp_basicsize */
0, /* tp_itemsize */
@@ -1680,48 +1696,54 @@ static PyTypeObject unpackiter_type = {
unpackiter_methods /* tp_methods */
};
-PyDoc_STRVAR(s_iter_unpack__doc__,
-"S.iter_unpack(buffer) -> iterator(v1, v2, ...)\n\
-\n\
-Return an iterator yielding tuples unpacked from the given bytes\n\
-source, like a repeated invocation of unpack_from(). Requires\n\
-that the bytes length be a multiple of the struct size.");
+/*[clinic input]
+Struct.iter_unpack
+
+ buffer: object
+ /
+
+Return an iterator yielding tuples.
+
+Tuples are unpacked from the given bytes source, like a repeated
+invocation of unpack_from().
+
+Requires that the bytes length be a multiple of the struct size.
+[clinic start generated code]*/
static PyObject *
-s_iter_unpack(PyObject *_so, PyObject *input)
+Struct_iter_unpack(PyStructObject *self, PyObject *buffer)
+/*[clinic end generated code: output=172d83d0cd15dbab input=6d65b3f3107dbc99]*/
{
- PyStructObject *so = (PyStructObject *) _so;
- unpackiterobject *self;
+ unpackiterobject *iter;
- assert(PyStruct_Check(_so));
- assert(so->s_codes != NULL);
+ assert(self->s_codes != NULL);
- if (so->s_size == 0) {
+ if (self->s_size == 0) {
PyErr_Format(StructError,
"cannot iteratively unpack with a struct of length 0");
return NULL;
}
- self = (unpackiterobject *) PyType_GenericAlloc(&unpackiter_type, 0);
- if (self == NULL)
+ iter = (unpackiterobject *) PyType_GenericAlloc(&unpackiter_type, 0);
+ if (iter == NULL)
return NULL;
- if (PyObject_GetBuffer(input, &self->buf, PyBUF_SIMPLE) < 0) {
- Py_DECREF(self);
+ if (PyObject_GetBuffer(buffer, &iter->buf, PyBUF_SIMPLE) < 0) {
+ Py_DECREF(iter);
return NULL;
}
- if (self->buf.len % so->s_size != 0) {
+ if (iter->buf.len % self->s_size != 0) {
PyErr_Format(StructError,
"iterative unpacking requires a bytes length "
"multiple of %zd",
- so->s_size);
- Py_DECREF(self);
+ self->s_size);
+ Py_DECREF(iter);
return NULL;
}
- Py_INCREF(so);
- self->so = so;
- self->index = 0;
- return (PyObject *) self;
+ Py_INCREF(self);
+ iter->so = self;
+ iter->index = 0;
+ return (PyObject *)iter;
}
@@ -1736,7 +1758,7 @@ s_iter_unpack(PyObject *_so, PyObject *input)
*
*/
static int
-s_pack_internal(PyStructObject *soself, PyObject *args, int offset, char* buf)
+s_pack_internal(PyStructObject *soself, PyObject **args, int offset, char* buf)
{
formatcode *code;
/* XXX(nnorwitz): why does i need to be a local? can we use
@@ -1750,7 +1772,7 @@ s_pack_internal(PyStructObject *soself, PyObject *args, int offset, char* buf)
char *res = buf + code->offset;
Py_ssize_t j = code->repeat;
while (j--) {
- PyObject *v = PyTuple_GET_ITEM(args, i++);
+ PyObject *v = args[i++];
if (e->format == 's') {
Py_ssize_t n;
int isstring;
@@ -1823,7 +1845,7 @@ to the format string S.format. See help(struct) for more on format\n\
strings.");
static PyObject *
-s_pack(PyObject *self, PyObject *args)
+s_pack(PyObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyStructObject *soself;
PyObject *result;
@@ -1832,10 +1854,13 @@ s_pack(PyObject *self, PyObject *args)
soself = (PyStructObject *)self;
assert(PyStruct_Check(self));
assert(soself->s_codes != NULL);
- if (PyTuple_GET_SIZE(args) != soself->s_len)
+ if (nargs != soself->s_len)
{
PyErr_Format(StructError,
- "pack expected %zd items for packing (got %zd)", soself->s_len, PyTuple_GET_SIZE(args));
+ "pack expected %zd items for packing (got %zd)", soself->s_len, nargs);
+ return NULL;
+ }
+ if (!_PyArg_NoStackKeywords("pack", kwnames)) {
return NULL;
}
@@ -1862,7 +1887,7 @@ offset. Note that the offset is a required argument. See\n\
help(struct) for more on format strings.");
static PyObject *
-s_pack_into(PyObject *self, PyObject *args)
+s_pack_into(PyObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyStructObject *soself;
Py_buffer buffer;
@@ -1872,31 +1897,34 @@ s_pack_into(PyObject *self, PyObject *args)
soself = (PyStructObject *)self;
assert(PyStruct_Check(self));
assert(soself->s_codes != NULL);
- if (PyTuple_GET_SIZE(args) != (soself->s_len + 2))
+ if (nargs != (soself->s_len + 2))
{
- if (PyTuple_GET_SIZE(args) == 0) {
+ if (nargs == 0) {
PyErr_Format(StructError,
"pack_into expected buffer argument");
}
- else if (PyTuple_GET_SIZE(args) == 1) {
+ else if (nargs == 1) {
PyErr_Format(StructError,
"pack_into expected offset argument");
}
else {
PyErr_Format(StructError,
"pack_into expected %zd items for packing (got %zd)",
- soself->s_len, (PyTuple_GET_SIZE(args) - 2));
+ soself->s_len, (nargs - 2));
}
return NULL;
}
+ if (!_PyArg_NoStackKeywords("pack_into", kwnames)) {
+ return NULL;
+ }
/* Extract a writable memory buffer from the first argument */
- if (!PyArg_Parse(PyTuple_GET_ITEM(args, 0), "w*", &buffer))
+ if (!PyArg_Parse(args[0], "w*", &buffer))
return NULL;
assert(buffer.len >= 0);
/* Extract the offset from the first argument */
- offset = PyNumber_AsSsize_t(PyTuple_GET_ITEM(args, 1), PyExc_IndexError);
+ offset = PyNumber_AsSsize_t(args[1], PyExc_IndexError);
if (offset == -1 && PyErr_Occurred()) {
PyBuffer_Release(&buffer);
return NULL;
@@ -1956,22 +1984,15 @@ s_sizeof(PyStructObject *self, void *unused)
/* List of functions */
static struct PyMethodDef s_methods[] = {
- {"iter_unpack", s_iter_unpack, METH_O, s_iter_unpack__doc__},
- {"pack", s_pack, METH_VARARGS, s_pack__doc__},
- {"pack_into", s_pack_into, METH_VARARGS, s_pack_into__doc__},
- {"unpack", s_unpack, METH_O, s_unpack__doc__},
- {"unpack_from", (PyCFunction)s_unpack_from, METH_VARARGS|METH_KEYWORDS,
- s_unpack_from__doc__},
+ STRUCT_ITER_UNPACK_METHODDEF
+ {"pack", (PyCFunction)s_pack, METH_FASTCALL, s_pack__doc__},
+ {"pack_into", (PyCFunction)s_pack_into, METH_FASTCALL, s_pack_into__doc__},
+ STRUCT_UNPACK_METHODDEF
+ STRUCT_UNPACK_FROM_METHODDEF
{"__sizeof__", (PyCFunction)s_sizeof, METH_NOARGS, s_sizeof__doc__},
{NULL, NULL} /* sentinel */
};
-PyDoc_STRVAR(s__doc__,
-"Struct(fmt) --> compiled struct object\n"
-"\n"
-"Return a new Struct object which writes and reads binary data according to\n"
-"the format string fmt. See help(struct) for more on format strings.");
-
#define OFF(x) offsetof(PyStructObject, x)
static PyGetSetDef s_getsetlist[] = {
@@ -1998,29 +2019,29 @@ PyTypeObject PyStructType = {
0, /* tp_hash */
0, /* tp_call */
0, /* tp_str */
- PyObject_GenericGetAttr, /* tp_getattro */
- PyObject_GenericSetAttr, /* tp_setattro */
+ PyObject_GenericGetAttr, /* tp_getattro */
+ PyObject_GenericSetAttr, /* tp_setattro */
0, /* tp_as_buffer */
- Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */
- s__doc__, /* tp_doc */
+ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */
+ Struct___init____doc__, /* tp_doc */
0, /* tp_traverse */
0, /* tp_clear */
0, /* tp_richcompare */
offsetof(PyStructObject, weakreflist), /* tp_weaklistoffset */
0, /* tp_iter */
0, /* tp_iternext */
- s_methods, /* tp_methods */
- NULL, /* tp_members */
- s_getsetlist, /* tp_getset */
+ s_methods, /* tp_methods */
+ NULL, /* tp_members */
+ s_getsetlist, /* tp_getset */
0, /* tp_base */
0, /* tp_dict */
0, /* tp_descr_get */
0, /* tp_descr_set */
0, /* tp_dictoffset */
- s_init, /* tp_init */
- PyType_GenericAlloc,/* tp_alloc */
- s_new, /* tp_new */
- PyObject_Del, /* tp_free */
+ Struct___init__, /* tp_init */
+ PyType_GenericAlloc, /* tp_alloc */
+ s_new, /* tp_new */
+ PyObject_Del, /* tp_free */
};
@@ -2029,216 +2050,202 @@ PyTypeObject PyStructType = {
#define MAXCACHE 100
static PyObject *cache = NULL;
-static PyObject *
-cache_struct(PyObject *fmt)
+static int
+cache_struct_converter(PyObject *fmt, PyObject **ptr)
{
PyObject * s_object;
+ if (fmt == NULL) {
+ Py_DECREF(*ptr);
+ return 1;
+ }
+
if (cache == NULL) {
cache = PyDict_New();
if (cache == NULL)
- return NULL;
+ return 0;
}
s_object = PyDict_GetItem(cache, fmt);
if (s_object != NULL) {
Py_INCREF(s_object);
- return s_object;
+ *ptr = s_object;
+ return Py_CLEANUP_SUPPORTED;
}
s_object = PyObject_CallFunctionObjArgs((PyObject *)(&PyStructType), fmt, NULL);
if (s_object != NULL) {
- if (PyDict_Size(cache) >= MAXCACHE)
+ if (PyDict_GET_SIZE(cache) >= MAXCACHE)
PyDict_Clear(cache);
/* Attempt to cache the result */
if (PyDict_SetItem(cache, fmt, s_object) == -1)
PyErr_Clear();
+ *ptr = s_object;
+ return Py_CLEANUP_SUPPORTED;
}
- return s_object;
+ return 0;
}
-PyDoc_STRVAR(clearcache_doc,
-"Clear the internal cache.");
+/*[clinic input]
+_clearcache
+
+Clear the internal cache.
+[clinic start generated code]*/
static PyObject *
-clearcache(PyObject *self)
+_clearcache_impl(PyObject *module)
+/*[clinic end generated code: output=ce4fb8a7bf7cb523 input=463eaae04bab3211]*/
{
Py_CLEAR(cache);
Py_RETURN_NONE;
}
-PyDoc_STRVAR(calcsize_doc,
-"calcsize(fmt) -> integer\n\
-\n\
-Return size in bytes of the struct described by the format string fmt.");
-static PyObject *
-calcsize(PyObject *self, PyObject *fmt)
+/*[clinic input]
+calcsize -> Py_ssize_t
+
+ format as s_object: cache_struct
+ /
+
+Return size in bytes of the struct described by the format string.
+[clinic start generated code]*/
+
+static Py_ssize_t
+calcsize_impl(PyObject *module, PyStructObject *s_object)
+/*[clinic end generated code: output=db7d23d09c6932c4 input=96a6a590c7717ecd]*/
{
- Py_ssize_t n;
- PyObject *s_object = cache_struct(fmt);
- if (s_object == NULL)
- return NULL;
- n = ((PyStructObject *)s_object)->s_size;
- Py_DECREF(s_object);
- return PyLong_FromSsize_t(n);
+ return s_object->s_size;
}
PyDoc_STRVAR(pack_doc,
-"pack(fmt, v1, v2, ...) -> bytes\n\
+"pack(format, v1, v2, ...) -> bytes\n\
\n\
Return a bytes object containing the values v1, v2, ... packed according\n\
-to the format string fmt. See help(struct) for more on format strings.");
+to the format string. See help(struct) for more on format strings.");
static PyObject *
-pack(PyObject *self, PyObject *args)
+pack(PyObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
- PyObject *s_object, *fmt, *newargs, *result;
- Py_ssize_t n = PyTuple_GET_SIZE(args);
+ PyObject *s_object = NULL;
+ PyObject *format, *result;
- if (n == 0) {
+ if (nargs == 0) {
PyErr_SetString(PyExc_TypeError, "missing format argument");
return NULL;
}
- fmt = PyTuple_GET_ITEM(args, 0);
- newargs = PyTuple_GetSlice(args, 1, n);
- if (newargs == NULL)
- return NULL;
+ format = args[0];
- s_object = cache_struct(fmt);
- if (s_object == NULL) {
- Py_DECREF(newargs);
+ if (!cache_struct_converter(format, &s_object)) {
return NULL;
}
- result = s_pack(s_object, newargs);
- Py_DECREF(newargs);
+ result = s_pack(s_object, args + 1, nargs - 1, kwnames);
Py_DECREF(s_object);
return result;
}
PyDoc_STRVAR(pack_into_doc,
-"pack_into(fmt, buffer, offset, v1, v2, ...)\n\
+"pack_into(format, buffer, offset, v1, v2, ...)\n\
\n\
-Pack the values v1, v2, ... according to the format string fmt and write\n\
+Pack the values v1, v2, ... according to the format string and write\n\
the packed bytes into the writable buffer buf starting at offset. Note\n\
that the offset is a required argument. See help(struct) for more\n\
on format strings.");
static PyObject *
-pack_into(PyObject *self, PyObject *args)
+pack_into(PyObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
- PyObject *s_object, *fmt, *newargs, *result;
- Py_ssize_t n = PyTuple_GET_SIZE(args);
+ PyObject *s_object = NULL;
+ PyObject *format, *result;
- if (n == 0) {
+ if (nargs == 0) {
PyErr_SetString(PyExc_TypeError, "missing format argument");
return NULL;
}
- fmt = PyTuple_GET_ITEM(args, 0);
- newargs = PyTuple_GetSlice(args, 1, n);
- if (newargs == NULL)
- return NULL;
+ format = args[0];
- s_object = cache_struct(fmt);
- if (s_object == NULL) {
- Py_DECREF(newargs);
+ if (!cache_struct_converter(format, &s_object)) {
return NULL;
}
- result = s_pack_into(s_object, newargs);
- Py_DECREF(newargs);
+ result = s_pack_into(s_object, args + 1, nargs - 1, kwnames);
Py_DECREF(s_object);
return result;
}
-PyDoc_STRVAR(unpack_doc,
-"unpack(fmt, buffer) -> (v1, v2, ...)\n\
-\n\
-Return a tuple containing values unpacked according to the format string\n\
-fmt. The buffer's size in bytes must be calcsize(fmt). See help(struct)\n\
-for more on format strings.");
+/*[clinic input]
+unpack
-static PyObject *
-unpack(PyObject *self, PyObject *args)
-{
- PyObject *s_object, *fmt, *inputstr, *result;
+ format as s_object: cache_struct
+ buffer: Py_buffer
+ /
- if (!PyArg_UnpackTuple(args, "unpack", 2, 2, &fmt, &inputstr))
- return NULL;
+Return a tuple containing values unpacked according to the format string.
- s_object = cache_struct(fmt);
- if (s_object == NULL)
- return NULL;
- result = s_unpack(s_object, inputstr);
- Py_DECREF(s_object);
- return result;
-}
+The buffer's size in bytes must be calcsize(format).
-PyDoc_STRVAR(unpack_from_doc,
-"unpack_from(fmt, buffer, offset=0) -> (v1, v2, ...)\n\
-\n\
-Return a tuple containing values unpacked according to the format string\n\
-fmt. The buffer's size, minus offset, must be at least calcsize(fmt).\n\
-See help(struct) for more on format strings.");
+See help(struct) for more on format strings.
+[clinic start generated code]*/
static PyObject *
-unpack_from(PyObject *self, PyObject *args, PyObject *kwds)
+unpack_impl(PyObject *module, PyStructObject *s_object, Py_buffer *buffer)
+/*[clinic end generated code: output=48ddd4d88eca8551 input=05fa3b91678da727]*/
{
- PyObject *s_object, *fmt, *newargs, *result;
- Py_ssize_t n = PyTuple_GET_SIZE(args);
+ return Struct_unpack_impl(s_object, buffer);
+}
- if (n == 0) {
- PyErr_SetString(PyExc_TypeError, "missing format argument");
- return NULL;
- }
- fmt = PyTuple_GET_ITEM(args, 0);
- newargs = PyTuple_GetSlice(args, 1, n);
- if (newargs == NULL)
- return NULL;
+/*[clinic input]
+unpack_from
- s_object = cache_struct(fmt);
- if (s_object == NULL) {
- Py_DECREF(newargs);
- return NULL;
- }
- result = s_unpack_from(s_object, newargs, kwds);
- Py_DECREF(newargs);
- Py_DECREF(s_object);
- return result;
-}
+ format as s_object: cache_struct
+ /
+ buffer: Py_buffer
+ offset: Py_ssize_t = 0
-PyDoc_STRVAR(iter_unpack_doc,
-"iter_unpack(fmt, buffer) -> iterator(v1, v2, ...)\n\
-\n\
-Return an iterator yielding tuples unpacked from the given bytes\n\
-source according to the format string, like a repeated invocation of\n\
-unpack_from(). Requires that the bytes length be a multiple of the\n\
-format struct size.");
+Return a tuple containing values unpacked according to the format string.
+
+The buffer's size, minus offset, must be at least calcsize(format).
+
+See help(struct) for more on format strings.
+[clinic start generated code]*/
static PyObject *
-iter_unpack(PyObject *self, PyObject *args)
+unpack_from_impl(PyObject *module, PyStructObject *s_object,
+ Py_buffer *buffer, Py_ssize_t offset)
+/*[clinic end generated code: output=1042631674c6e0d3 input=6e80a5398e985025]*/
{
- PyObject *s_object, *fmt, *input, *result;
+ return Struct_unpack_from_impl(s_object, buffer, offset);
+}
- if (!PyArg_ParseTuple(args, "OO:iter_unpack", &fmt, &input))
- return NULL;
+/*[clinic input]
+iter_unpack
- s_object = cache_struct(fmt);
- if (s_object == NULL)
- return NULL;
- result = s_iter_unpack(s_object, input);
- Py_DECREF(s_object);
- return result;
+ format as s_object: cache_struct
+ buffer: object
+ /
+
+Return an iterator yielding tuples unpacked from the given bytes.
+
+The bytes are unpacked according to the format string, like
+a repeated invocation of unpack_from().
+
+Requires that the bytes length be a multiple of the format struct size.
+[clinic start generated code]*/
+
+static PyObject *
+iter_unpack_impl(PyObject *module, PyStructObject *s_object,
+ PyObject *buffer)
+/*[clinic end generated code: output=0ae50e250d20e74d input=b214a58869a3c98d]*/
+{
+ return Struct_iter_unpack(s_object, buffer);
}
static struct PyMethodDef module_functions[] = {
- {"_clearcache", (PyCFunction)clearcache, METH_NOARGS, clearcache_doc},
- {"calcsize", calcsize, METH_O, calcsize_doc},
- {"iter_unpack", iter_unpack, METH_VARARGS, iter_unpack_doc},
- {"pack", pack, METH_VARARGS, pack_doc},
- {"pack_into", pack_into, METH_VARARGS, pack_into_doc},
- {"unpack", unpack, METH_VARARGS, unpack_doc},
- {"unpack_from", (PyCFunction)unpack_from,
- METH_VARARGS|METH_KEYWORDS, unpack_from_doc},
+ _CLEARCACHE_METHODDEF
+ CALCSIZE_METHODDEF
+ ITER_UNPACK_METHODDEF
+ {"pack", (PyCFunction)pack, METH_FASTCALL, pack_doc},
+ {"pack_into", (PyCFunction)pack_into, METH_FASTCALL, pack_into_doc},
+ UNPACK_METHODDEF
+ UNPACK_FROM_METHODDEF
{NULL, NULL} /* sentinel */
};
@@ -2301,6 +2308,9 @@ PyInit__struct(void)
if (PyType_Ready(&PyStructType) < 0)
return NULL;
+ if (PyType_Ready(&unpackiter_type) < 0)
+ return NULL;
+
/* Check endian and swap in faster functions */
{
const formatdef *native = native_table;
diff --git a/Modules/_testcapimodule.c b/Modules/_testcapimodule.c
index f09205f63c..03a4acbc79 100644
--- a/Modules/_testcapimodule.c
+++ b/Modules/_testcapimodule.c
@@ -64,8 +64,7 @@ test_config(PyObject *self)
#undef CHECK_SIZEOF
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
static PyObject*
@@ -118,8 +117,7 @@ test_sizeof_c_types(PyObject *self)
CHECK_SIZEOF(intptr_t, sizeof(void *));
CHECK_SIGNNESS(intptr_t, 1);
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
#undef IS_SIGNED
#undef CHECK_SIGNESS
@@ -169,8 +167,7 @@ test_list_api(PyObject *self)
Py_DECREF(list);
#undef NLIST
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
static int
@@ -234,8 +231,7 @@ test_dict_iteration(PyObject* self)
}
}
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
static PyObject*
@@ -614,8 +610,7 @@ test_long_and_overflow(PyObject *self)
return raiseTestError("test_long_and_overflow",
"overflow was not cleared");
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
/* Test the PyLong_AsLongLongAndOverflow API. General conversion to
@@ -779,8 +774,7 @@ test_long_long_and_overflow(PyObject *self)
return raiseTestError("test_long_long_and_overflow",
"overflow was not cleared");
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
/* Test the PyLong_As{Size,Ssize}_t API. At present this just tests that
@@ -887,8 +881,7 @@ test_L_code(PyObject *self)
"L code returned wrong value for int 42");
Py_DECREF(tuple);
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
static PyObject *
@@ -1224,8 +1217,7 @@ test_k_code(PyObject *self)
"k code returned wrong value for long -0xFFF..000042");
Py_DECREF(tuple);
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
static PyObject *
@@ -1411,11 +1403,9 @@ static PyObject *
getargs_u(PyObject *self, PyObject *args)
{
Py_UNICODE *str;
- Py_ssize_t size;
if (!PyArg_ParseTuple(args, "u", &str))
return NULL;
- size = Py_UNICODE_strlen(str);
- return PyUnicode_FromUnicode(str, size);
+ return PyUnicode_FromWideChar(str, -1);
}
static PyObject *
@@ -1425,19 +1415,17 @@ getargs_u_hash(PyObject *self, PyObject *args)
Py_ssize_t size;
if (!PyArg_ParseTuple(args, "u#", &str, &size))
return NULL;
- return PyUnicode_FromUnicode(str, size);
+ return PyUnicode_FromWideChar(str, size);
}
static PyObject *
getargs_Z(PyObject *self, PyObject *args)
{
Py_UNICODE *str;
- Py_ssize_t size;
if (!PyArg_ParseTuple(args, "Z", &str))
return NULL;
if (str != NULL) {
- size = Py_UNICODE_strlen(str);
- return PyUnicode_FromUnicode(str, size);
+ return PyUnicode_FromWideChar(str, -1);
} else
Py_RETURN_NONE;
}
@@ -1450,7 +1438,7 @@ getargs_Z_hash(PyObject *self, PyObject *args)
if (!PyArg_ParseTuple(args, "Z#", &str, &size))
return NULL;
if (str != NULL)
- return PyUnicode_FromUnicode(str, size);
+ return PyUnicode_FromWideChar(str, size);
else
Py_RETURN_NONE;
}
@@ -1676,8 +1664,7 @@ test_u_code(PyObject *self)
"u# code returned wrong values for u'test'");
Py_DECREF(tuple);
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
/* Test Z and Z# codes for PyArg_ParseTuple */
@@ -1892,6 +1879,27 @@ unicode_asucs4(PyObject *self, PyObject *args)
}
static PyObject *
+unicode_findchar(PyObject *self, PyObject *args)
+{
+ PyObject *str;
+ int direction;
+ unsigned int ch;
+ Py_ssize_t result;
+ Py_ssize_t start, end;
+
+ if (!PyArg_ParseTuple(args, "UInni:unicode_findchar", &str, &ch,
+ &start, &end, &direction)) {
+ return NULL;
+ }
+
+ result = PyUnicode_FindChar(str, (Py_UCS4)ch, start, end, direction);
+ if (result == -2)
+ return NULL;
+ else
+ return PyLong_FromSsize_t(result);
+}
+
+static PyObject *
unicode_copycharacters(PyObject *self, PyObject *args)
{
PyObject *from, *to, *to_copy;
@@ -1902,10 +1910,6 @@ unicode_copycharacters(PyObject *self, PyObject *args)
return NULL;
}
- if (PyUnicode_READY(to) < 0) {
- return NULL;
- }
-
if (!(to_copy = PyUnicode_New(PyUnicode_GET_LENGTH(to),
PyUnicode_MAX_CHAR_VALUE(to)))) {
return NULL;
@@ -2105,8 +2109,7 @@ test_long_numbits(PyObject *self)
return raiseTestError("test_long_numbits",
"wrong result for _PyLong_Sign");
}
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
/* Example passing NULLs to PyObject_Str(NULL). */
@@ -2298,7 +2301,7 @@ static int _pending_callback(void *arg)
{
/* we assume the argument is callable object to which we own a reference */
PyObject *callable = (PyObject *)arg;
- PyObject *r = PyObject_CallObject(callable, NULL);
+ PyObject *r = _PyObject_CallNoArg(callable);
Py_DECREF(callable);
Py_XDECREF(r);
return r != NULL ? 0 : -1;
@@ -2323,11 +2326,9 @@ PyObject *pending_threadfunc(PyObject *self, PyObject *arg)
if (r<0) {
Py_DECREF(callable); /* unsuccessful add, destroy the extra reference */
- Py_INCREF(Py_False);
- return Py_False;
+ Py_RETURN_FALSE;
}
- Py_INCREF(Py_True);
- return Py_True;
+ Py_RETURN_TRUE;
}
#endif
@@ -2713,8 +2714,7 @@ profile_int(PyObject *self, PyObject* args)
Py_DECREF(op1);
print_delta(7, &start, &stop);
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
#endif
@@ -4129,6 +4129,7 @@ static PyMethodDef TestMethods[] = {
{"unicode_aswidechar", unicode_aswidechar, METH_VARARGS},
{"unicode_aswidecharstring",unicode_aswidecharstring, METH_VARARGS},
{"unicode_asucs4", unicode_asucs4, METH_VARARGS},
+ {"unicode_findchar", unicode_findchar, METH_VARARGS},
{"unicode_copycharacters", unicode_copycharacters, METH_VARARGS},
{"unicode_encodedecimal", unicode_encodedecimal, METH_VARARGS},
{"unicode_transformdecimaltoascii", unicode_transformdecimaltoascii, METH_VARARGS},
diff --git a/Modules/_testmultiphase.c b/Modules/_testmultiphase.c
index 4daa34e106..9b04ebf155 100644
--- a/Modules/_testmultiphase.c
+++ b/Modules/_testmultiphase.c
@@ -36,8 +36,7 @@ Example_demo(ExampleObject *self, PyObject *args)
Py_INCREF(o);
return o;
}
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
diff --git a/Modules/_threadmodule.c b/Modules/_threadmodule.c
index 0219559609..8be9306d6a 100644
--- a/Modules/_threadmodule.c
+++ b/Modules/_threadmodule.c
@@ -180,8 +180,7 @@ lock_PyThread_release_lock(lockobject *self)
PyThread_release_lock(self->lock_lock);
self->locked = 0;
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
PyDoc_STRVAR(release_doc,
@@ -1111,8 +1110,7 @@ static PyObject *
thread_PyThread_interrupt_main(PyObject * self)
{
PyErr_SetInterrupt();
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
PyDoc_STRVAR(interrupt_doc,
diff --git a/Modules/_tkinter.c b/Modules/_tkinter.c
index 3e96aa0cd5..f69a4dfed9 100644
--- a/Modules/_tkinter.c
+++ b/Modules/_tkinter.c
@@ -536,7 +536,7 @@ SplitObj(PyObject *arg)
else if (PyUnicode_Check(arg)) {
int argc;
const char **argv;
- char *list = PyUnicode_AsUTF8(arg);
+ const char *list = PyUnicode_AsUTF8(arg);
if (list == NULL ||
Tcl_SplitList((Tcl_Interp *)NULL, list, &argc, &argv) != TCL_OK) {
@@ -993,7 +993,7 @@ asBignumObj(PyObject *value)
Tcl_Obj *result;
int neg;
PyObject *hexstr;
- char *hexchars;
+ const char *hexchars;
mp_int bigValue;
neg = Py_SIZE(value) < 0;
@@ -1723,7 +1723,7 @@ class varname_converter(CConverter):
static int
varname_converter(PyObject *in, void *_out)
{
- char *s;
+ const char *s;
const char **out = (const char**)_out;
if (PyBytes_Check(in)) {
if (PyBytes_GET_SIZE(in) > INT_MAX) {
diff --git a/Modules/_tracemalloc.c b/Modules/_tracemalloc.c
index ec8bd960a7..950789ba53 100644
--- a/Modules/_tracemalloc.c
+++ b/Modules/_tracemalloc.c
@@ -4,6 +4,12 @@
#include "pythread.h"
#include "osdefs.h"
+#include "clinic/_tracemalloc.c.h"
+/*[clinic input]
+module _tracemalloc
+[clinic start generated code]*/
+/*[clinic end generated code: output=da39a3ee5e6b4b0d input=708a98302fc46e5f]*/
+
/* Trace memory blocks allocated by PyMem_RawMalloc() */
#define TRACE_RAW_MALLOC
@@ -1161,27 +1167,31 @@ tracemalloc_stop(void)
tracemalloc_traceback = NULL;
}
-PyDoc_STRVAR(tracemalloc_is_tracing_doc,
- "is_tracing()->bool\n"
- "\n"
- "True if the tracemalloc module is tracing Python memory allocations,\n"
- "False otherwise.");
-static PyObject*
-py_tracemalloc_is_tracing(PyObject *self)
+/*[clinic input]
+_tracemalloc.is_tracing
+
+Return True if the tracemalloc module is tracing Python memory allocations.
+[clinic start generated code]*/
+
+static PyObject *
+_tracemalloc_is_tracing_impl(PyObject *module)
+/*[clinic end generated code: output=2d763b42601cd3ef input=af104b0a00192f63]*/
{
return PyBool_FromLong(tracemalloc_config.tracing);
}
-PyDoc_STRVAR(tracemalloc_clear_traces_doc,
- "clear_traces()\n"
- "\n"
- "Clear traces of memory blocks allocated by Python.");
+/*[clinic input]
+_tracemalloc.clear_traces
-static PyObject*
-py_tracemalloc_clear_traces(PyObject *self)
+Clear traces of memory blocks allocated by Python.
+[clinic start generated code]*/
+
+static PyObject *
+_tracemalloc_clear_traces_impl(PyObject *module)
+/*[clinic end generated code: output=a86080ee41b84197 input=0dab5b6c785183a5]*/
{
if (!tracemalloc_config.tracing)
Py_RETURN_NONE;
@@ -1343,17 +1353,21 @@ tracemalloc_pyobject_decref_cb(_Py_hashtable_t *tracebacks,
}
-PyDoc_STRVAR(tracemalloc_get_traces_doc,
- "_get_traces() -> list\n"
- "\n"
- "Get traces of all memory blocks allocated by Python.\n"
- "Return a list of (size: int, traceback: tuple) tuples.\n"
- "traceback is a tuple of (filename: str, lineno: int) tuples.\n"
- "\n"
- "Return an empty list if the tracemalloc module is disabled.");
-static PyObject*
-py_tracemalloc_get_traces(PyObject *self, PyObject *obj)
+/*[clinic input]
+_tracemalloc._get_traces
+
+Get traces of all memory blocks allocated by Python.
+
+Return a list of (size: int, traceback: tuple) tuples.
+traceback is a tuple of (filename: str, lineno: int) tuples.
+
+Return an empty list if the tracemalloc module is disabled.
+[clinic start generated code]*/
+
+static PyObject *
+_tracemalloc__get_traces_impl(PyObject *module)
+/*[clinic end generated code: output=e9929876ced4b5cc input=6c7d2230b24255aa]*/
{
get_traces_t get_traces;
int err;
@@ -1439,17 +1453,23 @@ tracemalloc_get_traceback(_PyTraceMalloc_domain_t domain, uintptr_t ptr)
}
-PyDoc_STRVAR(tracemalloc_get_object_traceback_doc,
- "_get_object_traceback(obj)\n"
- "\n"
- "Get the traceback where the Python object obj was allocated.\n"
- "Return a tuple of (filename: str, lineno: int) tuples.\n"
- "\n"
- "Return None if the tracemalloc module is disabled or did not\n"
- "trace the allocation of the object.");
-static PyObject*
-py_tracemalloc_get_object_traceback(PyObject *self, PyObject *obj)
+/*[clinic input]
+_tracemalloc._get_object_traceback
+
+ obj: object
+ /
+
+Get the traceback where the Python object obj was allocated.
+
+Return a tuple of (filename: str, lineno: int) tuples.
+Return None if the tracemalloc module is disabled or did not
+trace the allocation of the object.
+[clinic start generated code]*/
+
+static PyObject *
+_tracemalloc__get_object_traceback(PyObject *module, PyObject *obj)
+/*[clinic end generated code: output=41ee0553a658b0aa input=29495f1b21c53212]*/
{
PyTypeObject *type;
void *ptr;
@@ -1503,25 +1523,29 @@ _PyMem_DumpTraceback(int fd, const void *ptr)
#undef PUTS
-PyDoc_STRVAR(tracemalloc_start_doc,
- "start(nframe: int=1)\n"
- "\n"
- "Start tracing Python memory allocations. Set also the maximum number \n"
- "of frames stored in the traceback of a trace to nframe.");
-static PyObject*
-py_tracemalloc_start(PyObject *self, PyObject *args)
+/*[clinic input]
+_tracemalloc.start
+
+ nframe: Py_ssize_t = 1
+ /
+
+Start tracing Python memory allocations.
+
+Also set the maximum number of frames stored in the traceback of a
+trace to nframe.
+[clinic start generated code]*/
+
+static PyObject *
+_tracemalloc_start_impl(PyObject *module, Py_ssize_t nframe)
+/*[clinic end generated code: output=0f558d2079511553 input=997841629cc441cb]*/
{
- Py_ssize_t nframe = 1;
int nframe_int;
- if (!PyArg_ParseTuple(args, "|n:start", &nframe))
- return NULL;
-
if (nframe < 1 || nframe > MAX_NFRAME) {
PyErr_Format(PyExc_ValueError,
"the number of frames must be in range [1; %i]",
- MAX_NFRAME);
+ (int)MAX_NFRAME);
return NULL;
}
nframe_int = Py_SAFE_DOWNCAST(nframe, Py_ssize_t, int);
@@ -1532,48 +1556,55 @@ py_tracemalloc_start(PyObject *self, PyObject *args)
Py_RETURN_NONE;
}
-PyDoc_STRVAR(tracemalloc_stop_doc,
- "stop()\n"
- "\n"
- "Stop tracing Python memory allocations and clear traces\n"
- "of memory blocks allocated by Python.");
+/*[clinic input]
+_tracemalloc.stop
-static PyObject*
-py_tracemalloc_stop(PyObject *self)
+Stop tracing Python memory allocations.
+
+Also clear traces of memory blocks allocated by Python.
+[clinic start generated code]*/
+
+static PyObject *
+_tracemalloc_stop_impl(PyObject *module)
+/*[clinic end generated code: output=c3c42ae03e3955cd input=7478f075e51dae18]*/
{
tracemalloc_stop();
Py_RETURN_NONE;
}
-PyDoc_STRVAR(tracemalloc_get_traceback_limit_doc,
- "get_traceback_limit() -> int\n"
- "\n"
- "Get the maximum number of frames stored in the traceback\n"
- "of a trace.\n"
- "\n"
- "By default, a trace of an allocated memory block only stores\n"
- "the most recent frame: the limit is 1.");
+/*[clinic input]
+_tracemalloc.get_traceback_limit
-static PyObject*
-py_tracemalloc_get_traceback_limit(PyObject *self)
+Get the maximum number of frames stored in the traceback of a trace.
+
+By default, a trace of an allocated memory block only stores
+the most recent frame: the limit is 1.
+[clinic start generated code]*/
+
+static PyObject *
+_tracemalloc_get_traceback_limit_impl(PyObject *module)
+/*[clinic end generated code: output=d556d9306ba95567 input=da3cd977fc68ae3b]*/
{
return PyLong_FromLong(tracemalloc_config.max_nframe);
}
-PyDoc_STRVAR(tracemalloc_get_tracemalloc_memory_doc,
- "get_tracemalloc_memory() -> int\n"
- "\n"
- "Get the memory usage in bytes of the tracemalloc module\n"
- "used internally to trace memory allocations.");
-static PyObject*
-tracemalloc_get_tracemalloc_memory(PyObject *self)
+/*[clinic input]
+_tracemalloc.get_tracemalloc_memory
+
+Get the memory usage in bytes of the tracemalloc module.
+
+This memory is used internally to trace memory allocations.
+[clinic start generated code]*/
+
+static PyObject *
+_tracemalloc_get_tracemalloc_memory_impl(PyObject *module)
+/*[clinic end generated code: output=e3f14e280a55f5aa input=5d919c0f4d5132ad]*/
{
size_t size;
- PyObject *size_obj;
size = _Py_hashtable_size(tracemalloc_tracebacks);
size += _Py_hashtable_size(tracemalloc_filenames);
@@ -1582,22 +1613,24 @@ tracemalloc_get_tracemalloc_memory(PyObject *self)
size += _Py_hashtable_size(tracemalloc_traces);
TABLES_UNLOCK();
- size_obj = PyLong_FromSize_t(size);
- return Py_BuildValue("N", size_obj);
+ return PyLong_FromSize_t(size);
}
-PyDoc_STRVAR(tracemalloc_get_traced_memory_doc,
- "get_traced_memory() -> (int, int)\n"
- "\n"
- "Get the current size and peak size of memory blocks traced\n"
- "by the tracemalloc module as a tuple: (current: int, peak: int).");
-static PyObject*
-tracemalloc_get_traced_memory(PyObject *self)
+/*[clinic input]
+_tracemalloc.get_traced_memory
+
+Get the current size and peak size of memory blocks traced by tracemalloc.
+
+Returns a tuple: (current: int, peak: int).
+[clinic start generated code]*/
+
+static PyObject *
+_tracemalloc_get_traced_memory_impl(PyObject *module)
+/*[clinic end generated code: output=5b167189adb9e782 input=61ddb5478400ff66]*/
{
Py_ssize_t size, peak_size;
- PyObject *size_obj, *peak_size_obj;
if (!tracemalloc_config.tracing)
return Py_BuildValue("ii", 0, 0);
@@ -1607,32 +1640,20 @@ tracemalloc_get_traced_memory(PyObject *self)
peak_size = tracemalloc_peak_traced_memory;
TABLES_UNLOCK();
- size_obj = PyLong_FromSize_t(size);
- peak_size_obj = PyLong_FromSize_t(peak_size);
- return Py_BuildValue("NN", size_obj, peak_size_obj);
+ return Py_BuildValue("nn", size, peak_size);
}
static PyMethodDef module_methods[] = {
- {"is_tracing", (PyCFunction)py_tracemalloc_is_tracing,
- METH_NOARGS, tracemalloc_is_tracing_doc},
- {"clear_traces", (PyCFunction)py_tracemalloc_clear_traces,
- METH_NOARGS, tracemalloc_clear_traces_doc},
- {"_get_traces", (PyCFunction)py_tracemalloc_get_traces,
- METH_NOARGS, tracemalloc_get_traces_doc},
- {"_get_object_traceback", (PyCFunction)py_tracemalloc_get_object_traceback,
- METH_O, tracemalloc_get_object_traceback_doc},
- {"start", (PyCFunction)py_tracemalloc_start,
- METH_VARARGS, tracemalloc_start_doc},
- {"stop", (PyCFunction)py_tracemalloc_stop,
- METH_NOARGS, tracemalloc_stop_doc},
- {"get_traceback_limit", (PyCFunction)py_tracemalloc_get_traceback_limit,
- METH_NOARGS, tracemalloc_get_traceback_limit_doc},
- {"get_tracemalloc_memory", (PyCFunction)tracemalloc_get_tracemalloc_memory,
- METH_NOARGS, tracemalloc_get_tracemalloc_memory_doc},
- {"get_traced_memory", (PyCFunction)tracemalloc_get_traced_memory,
- METH_NOARGS, tracemalloc_get_traced_memory_doc},
-
+ _TRACEMALLOC_IS_TRACING_METHODDEF
+ _TRACEMALLOC_CLEAR_TRACES_METHODDEF
+ _TRACEMALLOC__GET_TRACES_METHODDEF
+ _TRACEMALLOC__GET_OBJECT_TRACEBACK_METHODDEF
+ _TRACEMALLOC_START_METHODDEF
+ _TRACEMALLOC_STOP_METHODDEF
+ _TRACEMALLOC_GET_TRACEBACK_LIMIT_METHODDEF
+ _TRACEMALLOC_GET_TRACEMALLOC_MEMORY_METHODDEF
+ _TRACEMALLOC_GET_TRACED_MEMORY_METHODDEF
/* sentinel */
{NULL, NULL}
};
diff --git a/Modules/ar_beos b/Modules/ar_beos
deleted file mode 100755
index e7efa75401..0000000000
--- a/Modules/ar_beos
+++ /dev/null
@@ -1,73 +0,0 @@
-#!/bin/sh
-#
-# Truly fake ar, using a directory to store object files.
-#
-# Donn Cave, donn@oz.net
-
-usage='Usage: ar-fake cr libpython.dir obj.o ...
- ar-fake d libpython.dir obj.o ...
- ar-fake so libpython.dir libpython.so'
-
-case $# in
-0|1|2)
- echo "$usage" >&2
- exit 1
- ;;
-esac
-
-command=$1
-library=$2
-shift 2
-
-case $command in
-cr)
- if test -d $library
- then :
- else
- mkdir $library
- fi
- if cp -p $* $library
- then
- # To force directory modify date, create or delete a file.
- if test -e $library/.tch
- then rm $library/.tch
- else echo tch > $library/.tch
- fi
- exit 0
- fi
- ;;
-d)
- if test -d $library
- then
- cd $library
- rm -f $*
- fi
- ;;
-so)
- case $BE_HOST_CPU in
- ppc)
- # In case your libpython.a refers to any exotic libraries,
- # mwld needs to know that here. The following hack makes
- # a couple of assumptions about Modules/Makefile. If it
- # doesn't work, you may as well add the necessary libraries
- # here explicitly instead.
- extralibs=$(
- (cd Modules; make -f Makefile -n link) |
- sed -n 's/.*\.so \(.*\) -o python.*/\1/p'
- )
- mwld -xms -export pragma -nodup -o $1 $library/* $extralibs
- ;;
- x86)
- ld -shared -soname $(basename $1) -o $1 $library/*
- ;;
- esac
- status=$?
- cd $(dirname $1)
- ln -sf $PWD lib
- exit $status
- ;;
-*)
- echo "$usage" >&2
- exit 1
- ;;
-esac
diff --git a/Modules/arraymodule.c b/Modules/arraymodule.c
index 2caa8ee5a8..464820d2af 100644
--- a/Modules/arraymodule.c
+++ b/Modules/arraymodule.c
@@ -236,7 +236,7 @@ BB_setitem(arrayobject *ap, Py_ssize_t i, PyObject *v)
static PyObject *
u_getitem(arrayobject *ap, Py_ssize_t i)
{
- return PyUnicode_FromUnicode(&((Py_UNICODE *) ap->ob_item)[i], 1);
+ return PyUnicode_FromOrdinal(((Py_UNICODE *) ap->ob_item)[i]);
}
static int
@@ -1007,8 +1007,7 @@ ins(arrayobject *self, Py_ssize_t where, PyObject *v)
{
if (ins1(self, where, v) != 0)
return NULL;
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
/*[clinic input]
@@ -1122,8 +1121,7 @@ array_array_remove(arrayobject *self, PyObject *v)
if (cmp > 0) {
if (array_del_slice(self, i, i+1) != 0)
return NULL;
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
else if (cmp < 0)
return NULL;
@@ -1185,8 +1183,7 @@ array_array_extend(arrayobject *self, PyObject *bb)
{
if (array_do_extend(self, bb) == -1)
return NULL;
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
/*[clinic input]
@@ -1315,8 +1312,7 @@ array_array_byteswap_impl(arrayobject *self)
"don't know how to byteswap this array type");
return NULL;
}
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
/*[clinic input]
@@ -1349,8 +1345,7 @@ array_array_reverse_impl(arrayobject *self)
}
}
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
/*[clinic input]
@@ -1445,7 +1440,7 @@ array_array_tofile(arrayobject *self, PyObject *f)
bytes = PyBytes_FromStringAndSize(ptr, size);
if (bytes == NULL)
return NULL;
- res = _PyObject_CallMethodId(f, &PyId_write, "O", bytes);
+ res = _PyObject_CallMethodIdObjArgs(f, &PyId_write, bytes, NULL);
Py_DECREF(bytes);
if (res == NULL)
return NULL;
@@ -1453,8 +1448,7 @@ array_array_tofile(arrayobject *self, PyObject *f)
}
done:
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
/*[clinic input]
@@ -1491,8 +1485,7 @@ array_array_fromlist(arrayobject *self, PyObject *list)
}
}
}
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
/*[clinic input]
@@ -1557,8 +1550,7 @@ frombytes(arrayobject *self, Py_buffer *buffer)
buffer->buf, n * itemsize);
}
PyBuffer_Release(buffer);
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
/*[clinic input]
@@ -1693,7 +1685,7 @@ array_array_tounicode_impl(arrayobject *self)
"tounicode() may only be called on unicode type arrays");
return NULL;
}
- return PyUnicode_FromUnicode((Py_UNICODE *) self->ob_item, Py_SIZE(self));
+ return PyUnicode_FromWideChar((Py_UNICODE *) self->ob_item, Py_SIZE(self));
}
/*[clinic input]
diff --git a/Modules/cjkcodecs/clinic/multibytecodec.c.h b/Modules/cjkcodecs/clinic/multibytecodec.c.h
index 84ffd12c63..4be06bbd66 100644
--- a/Modules/cjkcodecs/clinic/multibytecodec.c.h
+++ b/Modules/cjkcodecs/clinic/multibytecodec.c.h
@@ -30,7 +30,7 @@ _multibytecodec_MultibyteCodec_encode(MultibyteCodecObject *self, PyObject **arg
PyObject *input;
const char *errors = NULL;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
&input, &errors)) {
goto exit;
}
@@ -68,7 +68,7 @@ _multibytecodec_MultibyteCodec_decode(MultibyteCodecObject *self, PyObject **arg
Py_buffer input = {NULL, NULL};
const char *errors = NULL;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
&input, &errors)) {
goto exit;
}
@@ -105,7 +105,7 @@ _multibytecodec_MultibyteIncrementalEncoder_encode(MultibyteIncrementalEncoderOb
PyObject *input;
int final = 0;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
&input, &final)) {
goto exit;
}
@@ -154,7 +154,7 @@ _multibytecodec_MultibyteIncrementalDecoder_decode(MultibyteIncrementalDecoderOb
Py_buffer input = {NULL, NULL};
int final = 0;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
&input, &final)) {
goto exit;
}
@@ -192,23 +192,27 @@ PyDoc_STRVAR(_multibytecodec_MultibyteStreamReader_read__doc__,
"\n");
#define _MULTIBYTECODEC_MULTIBYTESTREAMREADER_READ_METHODDEF \
- {"read", (PyCFunction)_multibytecodec_MultibyteStreamReader_read, METH_VARARGS, _multibytecodec_MultibyteStreamReader_read__doc__},
+ {"read", (PyCFunction)_multibytecodec_MultibyteStreamReader_read, METH_FASTCALL, _multibytecodec_MultibyteStreamReader_read__doc__},
static PyObject *
_multibytecodec_MultibyteStreamReader_read_impl(MultibyteStreamReaderObject *self,
PyObject *sizeobj);
static PyObject *
-_multibytecodec_MultibyteStreamReader_read(MultibyteStreamReaderObject *self, PyObject *args)
+_multibytecodec_MultibyteStreamReader_read(MultibyteStreamReaderObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
PyObject *sizeobj = Py_None;
- if (!PyArg_UnpackTuple(args, "read",
+ if (!_PyArg_UnpackStack(args, nargs, "read",
0, 1,
&sizeobj)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("read", kwnames)) {
+ goto exit;
+ }
return_value = _multibytecodec_MultibyteStreamReader_read_impl(self, sizeobj);
exit:
@@ -221,23 +225,27 @@ PyDoc_STRVAR(_multibytecodec_MultibyteStreamReader_readline__doc__,
"\n");
#define _MULTIBYTECODEC_MULTIBYTESTREAMREADER_READLINE_METHODDEF \
- {"readline", (PyCFunction)_multibytecodec_MultibyteStreamReader_readline, METH_VARARGS, _multibytecodec_MultibyteStreamReader_readline__doc__},
+ {"readline", (PyCFunction)_multibytecodec_MultibyteStreamReader_readline, METH_FASTCALL, _multibytecodec_MultibyteStreamReader_readline__doc__},
static PyObject *
_multibytecodec_MultibyteStreamReader_readline_impl(MultibyteStreamReaderObject *self,
PyObject *sizeobj);
static PyObject *
-_multibytecodec_MultibyteStreamReader_readline(MultibyteStreamReaderObject *self, PyObject *args)
+_multibytecodec_MultibyteStreamReader_readline(MultibyteStreamReaderObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
PyObject *sizeobj = Py_None;
- if (!PyArg_UnpackTuple(args, "readline",
+ if (!_PyArg_UnpackStack(args, nargs, "readline",
0, 1,
&sizeobj)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("readline", kwnames)) {
+ goto exit;
+ }
return_value = _multibytecodec_MultibyteStreamReader_readline_impl(self, sizeobj);
exit:
@@ -250,23 +258,27 @@ PyDoc_STRVAR(_multibytecodec_MultibyteStreamReader_readlines__doc__,
"\n");
#define _MULTIBYTECODEC_MULTIBYTESTREAMREADER_READLINES_METHODDEF \
- {"readlines", (PyCFunction)_multibytecodec_MultibyteStreamReader_readlines, METH_VARARGS, _multibytecodec_MultibyteStreamReader_readlines__doc__},
+ {"readlines", (PyCFunction)_multibytecodec_MultibyteStreamReader_readlines, METH_FASTCALL, _multibytecodec_MultibyteStreamReader_readlines__doc__},
static PyObject *
_multibytecodec_MultibyteStreamReader_readlines_impl(MultibyteStreamReaderObject *self,
PyObject *sizehintobj);
static PyObject *
-_multibytecodec_MultibyteStreamReader_readlines(MultibyteStreamReaderObject *self, PyObject *args)
+_multibytecodec_MultibyteStreamReader_readlines(MultibyteStreamReaderObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
PyObject *sizehintobj = Py_None;
- if (!PyArg_UnpackTuple(args, "readlines",
+ if (!_PyArg_UnpackStack(args, nargs, "readlines",
0, 1,
&sizehintobj)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("readlines", kwnames)) {
+ goto exit;
+ }
return_value = _multibytecodec_MultibyteStreamReader_readlines_impl(self, sizehintobj);
exit:
@@ -330,4 +342,4 @@ PyDoc_STRVAR(_multibytecodec___create_codec__doc__,
#define _MULTIBYTECODEC___CREATE_CODEC_METHODDEF \
{"__create_codec", (PyCFunction)_multibytecodec___create_codec, METH_O, _multibytecodec___create_codec__doc__},
-/*[clinic end generated code: output=134b9e36cb985939 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=26710ffd4b3c7d7e input=a9049054013a1b77]*/
diff --git a/Modules/cjkcodecs/multibytecodec.c b/Modules/cjkcodecs/multibytecodec.c
index d1da189ddd..15c89696ee 100644
--- a/Modules/cjkcodecs/multibytecodec.c
+++ b/Modules/cjkcodecs/multibytecodec.c
@@ -1611,7 +1611,7 @@ mbstreamwriter_iwrite(MultibyteStreamWriterObject *self,
if (str == NULL)
return -1;
- wr = _PyObject_CallMethodId(self->stream, &PyId_write, "O", str);
+ wr = _PyObject_CallMethodIdObjArgs(self->stream, &PyId_write, str, NULL);
Py_DECREF(str);
if (wr == NULL)
return -1;
@@ -1702,7 +1702,7 @@ _multibytecodec_MultibyteStreamWriter_reset_impl(MultibyteStreamWriterObject *se
if (PyBytes_Size(pwrt) > 0) {
PyObject *wr;
- wr = _PyObject_CallMethodId(self->stream, &PyId_write, "O", pwrt);
+ wr = _PyObject_CallMethodIdObjArgs(self->stream, &PyId_write, pwrt);
if (wr == NULL) {
Py_DECREF(pwrt);
return NULL;
diff --git a/Modules/clinic/_asynciomodule.c.h b/Modules/clinic/_asynciomodule.c.h
index 052d252331..f3204fb9a9 100644
--- a/Modules/clinic/_asynciomodule.c.h
+++ b/Modules/clinic/_asynciomodule.c.h
@@ -280,7 +280,7 @@ _asyncio_Task_current_task(PyTypeObject *type, PyObject **args, Py_ssize_t nargs
static _PyArg_Parser _parser = {"|O:current_task", _keywords, 0};
PyObject *loop = NULL;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
&loop)) {
goto exit;
}
@@ -312,7 +312,7 @@ _asyncio_Task_all_tasks(PyTypeObject *type, PyObject **args, Py_ssize_t nargs, P
static _PyArg_Parser _parser = {"|O:all_tasks", _keywords, 0};
PyObject *loop = NULL;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
&loop)) {
goto exit;
}
@@ -412,7 +412,7 @@ _asyncio_Task_get_stack(TaskObj *self, PyObject **args, Py_ssize_t nargs, PyObje
static _PyArg_Parser _parser = {"|$O:get_stack", _keywords, 0};
PyObject *limit = Py_None;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
&limit)) {
goto exit;
}
@@ -450,7 +450,7 @@ _asyncio_Task_print_stack(TaskObj *self, PyObject **args, Py_ssize_t nargs, PyOb
PyObject *limit = Py_None;
PyObject *file = Py_None;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
&limit, &file)) {
goto exit;
}
@@ -479,7 +479,7 @@ _asyncio_Task__step(TaskObj *self, PyObject **args, Py_ssize_t nargs, PyObject *
static _PyArg_Parser _parser = {"|O:_step", _keywords, 0};
PyObject *exc = NULL;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
&exc)) {
goto exit;
}
@@ -508,7 +508,7 @@ _asyncio_Task__wakeup(TaskObj *self, PyObject **args, Py_ssize_t nargs, PyObject
static _PyArg_Parser _parser = {"O:_wakeup", _keywords, 0};
PyObject *fut;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
&fut)) {
goto exit;
}
@@ -517,4 +517,4 @@ _asyncio_Task__wakeup(TaskObj *self, PyObject **args, Py_ssize_t nargs, PyObject
exit:
return return_value;
}
-/*[clinic end generated code: output=8f036321bb083066 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=07a15bbb28d03edc input=a9049054013a1b77]*/
diff --git a/Modules/clinic/_bz2module.c.h b/Modules/clinic/_bz2module.c.h
index 1ca810c9e7..b791f28b67 100644
--- a/Modules/clinic/_bz2module.c.h
+++ b/Modules/clinic/_bz2module.c.h
@@ -130,7 +130,7 @@ _bz2_BZ2Decompressor_decompress(BZ2Decompressor *self, PyObject **args, Py_ssize
Py_buffer data = {NULL, NULL};
Py_ssize_t max_length = -1;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
&data, &max_length)) {
goto exit;
}
@@ -174,4 +174,4 @@ _bz2_BZ2Decompressor___init__(PyObject *self, PyObject *args, PyObject *kwargs)
exit:
return return_value;
}
-/*[clinic end generated code: output=7e57af0b368d3e55 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=0e97a1d716b35a14 input=a9049054013a1b77]*/
diff --git a/Modules/clinic/_codecsmodule.c.h b/Modules/clinic/_codecsmodule.c.h
index 056287d06a..982fc766c7 100644
--- a/Modules/clinic/_codecsmodule.c.h
+++ b/Modules/clinic/_codecsmodule.c.h
@@ -71,7 +71,7 @@ _codecs_encode(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kw
const char *encoding = NULL;
const char *errors = NULL;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
&obj, &encoding, &errors)) {
goto exit;
}
@@ -110,7 +110,7 @@ _codecs_decode(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kw
const char *encoding = NULL;
const char *errors = NULL;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
&obj, &encoding, &errors)) {
goto exit;
}
@@ -153,23 +153,27 @@ PyDoc_STRVAR(_codecs_escape_decode__doc__,
"\n");
#define _CODECS_ESCAPE_DECODE_METHODDEF \
- {"escape_decode", (PyCFunction)_codecs_escape_decode, METH_VARARGS, _codecs_escape_decode__doc__},
+ {"escape_decode", (PyCFunction)_codecs_escape_decode, METH_FASTCALL, _codecs_escape_decode__doc__},
static PyObject *
_codecs_escape_decode_impl(PyObject *module, Py_buffer *data,
const char *errors);
static PyObject *
-_codecs_escape_decode(PyObject *module, PyObject *args)
+_codecs_escape_decode(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
Py_buffer data = {NULL, NULL};
const char *errors = NULL;
- if (!PyArg_ParseTuple(args, "s*|z:escape_decode",
+ if (!_PyArg_ParseStack(args, nargs, "s*|z:escape_decode",
&data, &errors)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("escape_decode", kwnames)) {
+ goto exit;
+ }
return_value = _codecs_escape_decode_impl(module, &data, errors);
exit:
@@ -187,23 +191,27 @@ PyDoc_STRVAR(_codecs_escape_encode__doc__,
"\n");
#define _CODECS_ESCAPE_ENCODE_METHODDEF \
- {"escape_encode", (PyCFunction)_codecs_escape_encode, METH_VARARGS, _codecs_escape_encode__doc__},
+ {"escape_encode", (PyCFunction)_codecs_escape_encode, METH_FASTCALL, _codecs_escape_encode__doc__},
static PyObject *
_codecs_escape_encode_impl(PyObject *module, PyObject *data,
const char *errors);
static PyObject *
-_codecs_escape_encode(PyObject *module, PyObject *args)
+_codecs_escape_encode(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
PyObject *data;
const char *errors = NULL;
- if (!PyArg_ParseTuple(args, "O!|z:escape_encode",
+ if (!_PyArg_ParseStack(args, nargs, "O!|z:escape_encode",
&PyBytes_Type, &data, &errors)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("escape_encode", kwnames)) {
+ goto exit;
+ }
return_value = _codecs_escape_encode_impl(module, data, errors);
exit:
@@ -216,23 +224,27 @@ PyDoc_STRVAR(_codecs_unicode_internal_decode__doc__,
"\n");
#define _CODECS_UNICODE_INTERNAL_DECODE_METHODDEF \
- {"unicode_internal_decode", (PyCFunction)_codecs_unicode_internal_decode, METH_VARARGS, _codecs_unicode_internal_decode__doc__},
+ {"unicode_internal_decode", (PyCFunction)_codecs_unicode_internal_decode, METH_FASTCALL, _codecs_unicode_internal_decode__doc__},
static PyObject *
_codecs_unicode_internal_decode_impl(PyObject *module, PyObject *obj,
const char *errors);
static PyObject *
-_codecs_unicode_internal_decode(PyObject *module, PyObject *args)
+_codecs_unicode_internal_decode(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
PyObject *obj;
const char *errors = NULL;
- if (!PyArg_ParseTuple(args, "O|z:unicode_internal_decode",
+ if (!_PyArg_ParseStack(args, nargs, "O|z:unicode_internal_decode",
&obj, &errors)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("unicode_internal_decode", kwnames)) {
+ goto exit;
+ }
return_value = _codecs_unicode_internal_decode_impl(module, obj, errors);
exit:
@@ -245,24 +257,28 @@ PyDoc_STRVAR(_codecs_utf_7_decode__doc__,
"\n");
#define _CODECS_UTF_7_DECODE_METHODDEF \
- {"utf_7_decode", (PyCFunction)_codecs_utf_7_decode, METH_VARARGS, _codecs_utf_7_decode__doc__},
+ {"utf_7_decode", (PyCFunction)_codecs_utf_7_decode, METH_FASTCALL, _codecs_utf_7_decode__doc__},
static PyObject *
_codecs_utf_7_decode_impl(PyObject *module, Py_buffer *data,
const char *errors, int final);
static PyObject *
-_codecs_utf_7_decode(PyObject *module, PyObject *args)
+_codecs_utf_7_decode(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
Py_buffer data = {NULL, NULL};
const char *errors = NULL;
int final = 0;
- if (!PyArg_ParseTuple(args, "y*|zi:utf_7_decode",
+ if (!_PyArg_ParseStack(args, nargs, "y*|zi:utf_7_decode",
&data, &errors, &final)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("utf_7_decode", kwnames)) {
+ goto exit;
+ }
return_value = _codecs_utf_7_decode_impl(module, &data, errors, final);
exit:
@@ -280,24 +296,28 @@ PyDoc_STRVAR(_codecs_utf_8_decode__doc__,
"\n");
#define _CODECS_UTF_8_DECODE_METHODDEF \
- {"utf_8_decode", (PyCFunction)_codecs_utf_8_decode, METH_VARARGS, _codecs_utf_8_decode__doc__},
+ {"utf_8_decode", (PyCFunction)_codecs_utf_8_decode, METH_FASTCALL, _codecs_utf_8_decode__doc__},
static PyObject *
_codecs_utf_8_decode_impl(PyObject *module, Py_buffer *data,
const char *errors, int final);
static PyObject *
-_codecs_utf_8_decode(PyObject *module, PyObject *args)
+_codecs_utf_8_decode(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
Py_buffer data = {NULL, NULL};
const char *errors = NULL;
int final = 0;
- if (!PyArg_ParseTuple(args, "y*|zi:utf_8_decode",
+ if (!_PyArg_ParseStack(args, nargs, "y*|zi:utf_8_decode",
&data, &errors, &final)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("utf_8_decode", kwnames)) {
+ goto exit;
+ }
return_value = _codecs_utf_8_decode_impl(module, &data, errors, final);
exit:
@@ -315,24 +335,28 @@ PyDoc_STRVAR(_codecs_utf_16_decode__doc__,
"\n");
#define _CODECS_UTF_16_DECODE_METHODDEF \
- {"utf_16_decode", (PyCFunction)_codecs_utf_16_decode, METH_VARARGS, _codecs_utf_16_decode__doc__},
+ {"utf_16_decode", (PyCFunction)_codecs_utf_16_decode, METH_FASTCALL, _codecs_utf_16_decode__doc__},
static PyObject *
_codecs_utf_16_decode_impl(PyObject *module, Py_buffer *data,
const char *errors, int final);
static PyObject *
-_codecs_utf_16_decode(PyObject *module, PyObject *args)
+_codecs_utf_16_decode(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
Py_buffer data = {NULL, NULL};
const char *errors = NULL;
int final = 0;
- if (!PyArg_ParseTuple(args, "y*|zi:utf_16_decode",
+ if (!_PyArg_ParseStack(args, nargs, "y*|zi:utf_16_decode",
&data, &errors, &final)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("utf_16_decode", kwnames)) {
+ goto exit;
+ }
return_value = _codecs_utf_16_decode_impl(module, &data, errors, final);
exit:
@@ -350,24 +374,28 @@ PyDoc_STRVAR(_codecs_utf_16_le_decode__doc__,
"\n");
#define _CODECS_UTF_16_LE_DECODE_METHODDEF \
- {"utf_16_le_decode", (PyCFunction)_codecs_utf_16_le_decode, METH_VARARGS, _codecs_utf_16_le_decode__doc__},
+ {"utf_16_le_decode", (PyCFunction)_codecs_utf_16_le_decode, METH_FASTCALL, _codecs_utf_16_le_decode__doc__},
static PyObject *
_codecs_utf_16_le_decode_impl(PyObject *module, Py_buffer *data,
const char *errors, int final);
static PyObject *
-_codecs_utf_16_le_decode(PyObject *module, PyObject *args)
+_codecs_utf_16_le_decode(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
Py_buffer data = {NULL, NULL};
const char *errors = NULL;
int final = 0;
- if (!PyArg_ParseTuple(args, "y*|zi:utf_16_le_decode",
+ if (!_PyArg_ParseStack(args, nargs, "y*|zi:utf_16_le_decode",
&data, &errors, &final)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("utf_16_le_decode", kwnames)) {
+ goto exit;
+ }
return_value = _codecs_utf_16_le_decode_impl(module, &data, errors, final);
exit:
@@ -385,24 +413,28 @@ PyDoc_STRVAR(_codecs_utf_16_be_decode__doc__,
"\n");
#define _CODECS_UTF_16_BE_DECODE_METHODDEF \
- {"utf_16_be_decode", (PyCFunction)_codecs_utf_16_be_decode, METH_VARARGS, _codecs_utf_16_be_decode__doc__},
+ {"utf_16_be_decode", (PyCFunction)_codecs_utf_16_be_decode, METH_FASTCALL, _codecs_utf_16_be_decode__doc__},
static PyObject *
_codecs_utf_16_be_decode_impl(PyObject *module, Py_buffer *data,
const char *errors, int final);
static PyObject *
-_codecs_utf_16_be_decode(PyObject *module, PyObject *args)
+_codecs_utf_16_be_decode(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
Py_buffer data = {NULL, NULL};
const char *errors = NULL;
int final = 0;
- if (!PyArg_ParseTuple(args, "y*|zi:utf_16_be_decode",
+ if (!_PyArg_ParseStack(args, nargs, "y*|zi:utf_16_be_decode",
&data, &errors, &final)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("utf_16_be_decode", kwnames)) {
+ goto exit;
+ }
return_value = _codecs_utf_16_be_decode_impl(module, &data, errors, final);
exit:
@@ -421,14 +453,14 @@ PyDoc_STRVAR(_codecs_utf_16_ex_decode__doc__,
"\n");
#define _CODECS_UTF_16_EX_DECODE_METHODDEF \
- {"utf_16_ex_decode", (PyCFunction)_codecs_utf_16_ex_decode, METH_VARARGS, _codecs_utf_16_ex_decode__doc__},
+ {"utf_16_ex_decode", (PyCFunction)_codecs_utf_16_ex_decode, METH_FASTCALL, _codecs_utf_16_ex_decode__doc__},
static PyObject *
_codecs_utf_16_ex_decode_impl(PyObject *module, Py_buffer *data,
const char *errors, int byteorder, int final);
static PyObject *
-_codecs_utf_16_ex_decode(PyObject *module, PyObject *args)
+_codecs_utf_16_ex_decode(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
Py_buffer data = {NULL, NULL};
@@ -436,10 +468,14 @@ _codecs_utf_16_ex_decode(PyObject *module, PyObject *args)
int byteorder = 0;
int final = 0;
- if (!PyArg_ParseTuple(args, "y*|zii:utf_16_ex_decode",
+ if (!_PyArg_ParseStack(args, nargs, "y*|zii:utf_16_ex_decode",
&data, &errors, &byteorder, &final)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("utf_16_ex_decode", kwnames)) {
+ goto exit;
+ }
return_value = _codecs_utf_16_ex_decode_impl(module, &data, errors, byteorder, final);
exit:
@@ -457,24 +493,28 @@ PyDoc_STRVAR(_codecs_utf_32_decode__doc__,
"\n");
#define _CODECS_UTF_32_DECODE_METHODDEF \
- {"utf_32_decode", (PyCFunction)_codecs_utf_32_decode, METH_VARARGS, _codecs_utf_32_decode__doc__},
+ {"utf_32_decode", (PyCFunction)_codecs_utf_32_decode, METH_FASTCALL, _codecs_utf_32_decode__doc__},
static PyObject *
_codecs_utf_32_decode_impl(PyObject *module, Py_buffer *data,
const char *errors, int final);
static PyObject *
-_codecs_utf_32_decode(PyObject *module, PyObject *args)
+_codecs_utf_32_decode(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
Py_buffer data = {NULL, NULL};
const char *errors = NULL;
int final = 0;
- if (!PyArg_ParseTuple(args, "y*|zi:utf_32_decode",
+ if (!_PyArg_ParseStack(args, nargs, "y*|zi:utf_32_decode",
&data, &errors, &final)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("utf_32_decode", kwnames)) {
+ goto exit;
+ }
return_value = _codecs_utf_32_decode_impl(module, &data, errors, final);
exit:
@@ -492,24 +532,28 @@ PyDoc_STRVAR(_codecs_utf_32_le_decode__doc__,
"\n");
#define _CODECS_UTF_32_LE_DECODE_METHODDEF \
- {"utf_32_le_decode", (PyCFunction)_codecs_utf_32_le_decode, METH_VARARGS, _codecs_utf_32_le_decode__doc__},
+ {"utf_32_le_decode", (PyCFunction)_codecs_utf_32_le_decode, METH_FASTCALL, _codecs_utf_32_le_decode__doc__},
static PyObject *
_codecs_utf_32_le_decode_impl(PyObject *module, Py_buffer *data,
const char *errors, int final);
static PyObject *
-_codecs_utf_32_le_decode(PyObject *module, PyObject *args)
+_codecs_utf_32_le_decode(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
Py_buffer data = {NULL, NULL};
const char *errors = NULL;
int final = 0;
- if (!PyArg_ParseTuple(args, "y*|zi:utf_32_le_decode",
+ if (!_PyArg_ParseStack(args, nargs, "y*|zi:utf_32_le_decode",
&data, &errors, &final)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("utf_32_le_decode", kwnames)) {
+ goto exit;
+ }
return_value = _codecs_utf_32_le_decode_impl(module, &data, errors, final);
exit:
@@ -527,24 +571,28 @@ PyDoc_STRVAR(_codecs_utf_32_be_decode__doc__,
"\n");
#define _CODECS_UTF_32_BE_DECODE_METHODDEF \
- {"utf_32_be_decode", (PyCFunction)_codecs_utf_32_be_decode, METH_VARARGS, _codecs_utf_32_be_decode__doc__},
+ {"utf_32_be_decode", (PyCFunction)_codecs_utf_32_be_decode, METH_FASTCALL, _codecs_utf_32_be_decode__doc__},
static PyObject *
_codecs_utf_32_be_decode_impl(PyObject *module, Py_buffer *data,
const char *errors, int final);
static PyObject *
-_codecs_utf_32_be_decode(PyObject *module, PyObject *args)
+_codecs_utf_32_be_decode(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
Py_buffer data = {NULL, NULL};
const char *errors = NULL;
int final = 0;
- if (!PyArg_ParseTuple(args, "y*|zi:utf_32_be_decode",
+ if (!_PyArg_ParseStack(args, nargs, "y*|zi:utf_32_be_decode",
&data, &errors, &final)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("utf_32_be_decode", kwnames)) {
+ goto exit;
+ }
return_value = _codecs_utf_32_be_decode_impl(module, &data, errors, final);
exit:
@@ -563,14 +611,14 @@ PyDoc_STRVAR(_codecs_utf_32_ex_decode__doc__,
"\n");
#define _CODECS_UTF_32_EX_DECODE_METHODDEF \
- {"utf_32_ex_decode", (PyCFunction)_codecs_utf_32_ex_decode, METH_VARARGS, _codecs_utf_32_ex_decode__doc__},
+ {"utf_32_ex_decode", (PyCFunction)_codecs_utf_32_ex_decode, METH_FASTCALL, _codecs_utf_32_ex_decode__doc__},
static PyObject *
_codecs_utf_32_ex_decode_impl(PyObject *module, Py_buffer *data,
const char *errors, int byteorder, int final);
static PyObject *
-_codecs_utf_32_ex_decode(PyObject *module, PyObject *args)
+_codecs_utf_32_ex_decode(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
Py_buffer data = {NULL, NULL};
@@ -578,10 +626,14 @@ _codecs_utf_32_ex_decode(PyObject *module, PyObject *args)
int byteorder = 0;
int final = 0;
- if (!PyArg_ParseTuple(args, "y*|zii:utf_32_ex_decode",
+ if (!_PyArg_ParseStack(args, nargs, "y*|zii:utf_32_ex_decode",
&data, &errors, &byteorder, &final)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("utf_32_ex_decode", kwnames)) {
+ goto exit;
+ }
return_value = _codecs_utf_32_ex_decode_impl(module, &data, errors, byteorder, final);
exit:
@@ -599,23 +651,27 @@ PyDoc_STRVAR(_codecs_unicode_escape_decode__doc__,
"\n");
#define _CODECS_UNICODE_ESCAPE_DECODE_METHODDEF \
- {"unicode_escape_decode", (PyCFunction)_codecs_unicode_escape_decode, METH_VARARGS, _codecs_unicode_escape_decode__doc__},
+ {"unicode_escape_decode", (PyCFunction)_codecs_unicode_escape_decode, METH_FASTCALL, _codecs_unicode_escape_decode__doc__},
static PyObject *
_codecs_unicode_escape_decode_impl(PyObject *module, Py_buffer *data,
const char *errors);
static PyObject *
-_codecs_unicode_escape_decode(PyObject *module, PyObject *args)
+_codecs_unicode_escape_decode(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
Py_buffer data = {NULL, NULL};
const char *errors = NULL;
- if (!PyArg_ParseTuple(args, "s*|z:unicode_escape_decode",
+ if (!_PyArg_ParseStack(args, nargs, "s*|z:unicode_escape_decode",
&data, &errors)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("unicode_escape_decode", kwnames)) {
+ goto exit;
+ }
return_value = _codecs_unicode_escape_decode_impl(module, &data, errors);
exit:
@@ -633,23 +689,27 @@ PyDoc_STRVAR(_codecs_raw_unicode_escape_decode__doc__,
"\n");
#define _CODECS_RAW_UNICODE_ESCAPE_DECODE_METHODDEF \
- {"raw_unicode_escape_decode", (PyCFunction)_codecs_raw_unicode_escape_decode, METH_VARARGS, _codecs_raw_unicode_escape_decode__doc__},
+ {"raw_unicode_escape_decode", (PyCFunction)_codecs_raw_unicode_escape_decode, METH_FASTCALL, _codecs_raw_unicode_escape_decode__doc__},
static PyObject *
_codecs_raw_unicode_escape_decode_impl(PyObject *module, Py_buffer *data,
const char *errors);
static PyObject *
-_codecs_raw_unicode_escape_decode(PyObject *module, PyObject *args)
+_codecs_raw_unicode_escape_decode(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
Py_buffer data = {NULL, NULL};
const char *errors = NULL;
- if (!PyArg_ParseTuple(args, "s*|z:raw_unicode_escape_decode",
+ if (!_PyArg_ParseStack(args, nargs, "s*|z:raw_unicode_escape_decode",
&data, &errors)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("raw_unicode_escape_decode", kwnames)) {
+ goto exit;
+ }
return_value = _codecs_raw_unicode_escape_decode_impl(module, &data, errors);
exit:
@@ -667,23 +727,27 @@ PyDoc_STRVAR(_codecs_latin_1_decode__doc__,
"\n");
#define _CODECS_LATIN_1_DECODE_METHODDEF \
- {"latin_1_decode", (PyCFunction)_codecs_latin_1_decode, METH_VARARGS, _codecs_latin_1_decode__doc__},
+ {"latin_1_decode", (PyCFunction)_codecs_latin_1_decode, METH_FASTCALL, _codecs_latin_1_decode__doc__},
static PyObject *
_codecs_latin_1_decode_impl(PyObject *module, Py_buffer *data,
const char *errors);
static PyObject *
-_codecs_latin_1_decode(PyObject *module, PyObject *args)
+_codecs_latin_1_decode(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
Py_buffer data = {NULL, NULL};
const char *errors = NULL;
- if (!PyArg_ParseTuple(args, "y*|z:latin_1_decode",
+ if (!_PyArg_ParseStack(args, nargs, "y*|z:latin_1_decode",
&data, &errors)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("latin_1_decode", kwnames)) {
+ goto exit;
+ }
return_value = _codecs_latin_1_decode_impl(module, &data, errors);
exit:
@@ -701,23 +765,27 @@ PyDoc_STRVAR(_codecs_ascii_decode__doc__,
"\n");
#define _CODECS_ASCII_DECODE_METHODDEF \
- {"ascii_decode", (PyCFunction)_codecs_ascii_decode, METH_VARARGS, _codecs_ascii_decode__doc__},
+ {"ascii_decode", (PyCFunction)_codecs_ascii_decode, METH_FASTCALL, _codecs_ascii_decode__doc__},
static PyObject *
_codecs_ascii_decode_impl(PyObject *module, Py_buffer *data,
const char *errors);
static PyObject *
-_codecs_ascii_decode(PyObject *module, PyObject *args)
+_codecs_ascii_decode(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
Py_buffer data = {NULL, NULL};
const char *errors = NULL;
- if (!PyArg_ParseTuple(args, "y*|z:ascii_decode",
+ if (!_PyArg_ParseStack(args, nargs, "y*|z:ascii_decode",
&data, &errors)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("ascii_decode", kwnames)) {
+ goto exit;
+ }
return_value = _codecs_ascii_decode_impl(module, &data, errors);
exit:
@@ -735,24 +803,28 @@ PyDoc_STRVAR(_codecs_charmap_decode__doc__,
"\n");
#define _CODECS_CHARMAP_DECODE_METHODDEF \
- {"charmap_decode", (PyCFunction)_codecs_charmap_decode, METH_VARARGS, _codecs_charmap_decode__doc__},
+ {"charmap_decode", (PyCFunction)_codecs_charmap_decode, METH_FASTCALL, _codecs_charmap_decode__doc__},
static PyObject *
_codecs_charmap_decode_impl(PyObject *module, Py_buffer *data,
const char *errors, PyObject *mapping);
static PyObject *
-_codecs_charmap_decode(PyObject *module, PyObject *args)
+_codecs_charmap_decode(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
Py_buffer data = {NULL, NULL};
const char *errors = NULL;
PyObject *mapping = NULL;
- if (!PyArg_ParseTuple(args, "y*|zO:charmap_decode",
+ if (!_PyArg_ParseStack(args, nargs, "y*|zO:charmap_decode",
&data, &errors, &mapping)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("charmap_decode", kwnames)) {
+ goto exit;
+ }
return_value = _codecs_charmap_decode_impl(module, &data, errors, mapping);
exit:
@@ -772,24 +844,28 @@ PyDoc_STRVAR(_codecs_mbcs_decode__doc__,
"\n");
#define _CODECS_MBCS_DECODE_METHODDEF \
- {"mbcs_decode", (PyCFunction)_codecs_mbcs_decode, METH_VARARGS, _codecs_mbcs_decode__doc__},
+ {"mbcs_decode", (PyCFunction)_codecs_mbcs_decode, METH_FASTCALL, _codecs_mbcs_decode__doc__},
static PyObject *
_codecs_mbcs_decode_impl(PyObject *module, Py_buffer *data,
const char *errors, int final);
static PyObject *
-_codecs_mbcs_decode(PyObject *module, PyObject *args)
+_codecs_mbcs_decode(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
Py_buffer data = {NULL, NULL};
const char *errors = NULL;
int final = 0;
- if (!PyArg_ParseTuple(args, "y*|zi:mbcs_decode",
+ if (!_PyArg_ParseStack(args, nargs, "y*|zi:mbcs_decode",
&data, &errors, &final)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("mbcs_decode", kwnames)) {
+ goto exit;
+ }
return_value = _codecs_mbcs_decode_impl(module, &data, errors, final);
exit:
@@ -811,24 +887,28 @@ PyDoc_STRVAR(_codecs_oem_decode__doc__,
"\n");
#define _CODECS_OEM_DECODE_METHODDEF \
- {"oem_decode", (PyCFunction)_codecs_oem_decode, METH_VARARGS, _codecs_oem_decode__doc__},
+ {"oem_decode", (PyCFunction)_codecs_oem_decode, METH_FASTCALL, _codecs_oem_decode__doc__},
static PyObject *
_codecs_oem_decode_impl(PyObject *module, Py_buffer *data,
const char *errors, int final);
static PyObject *
-_codecs_oem_decode(PyObject *module, PyObject *args)
+_codecs_oem_decode(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
Py_buffer data = {NULL, NULL};
const char *errors = NULL;
int final = 0;
- if (!PyArg_ParseTuple(args, "y*|zi:oem_decode",
+ if (!_PyArg_ParseStack(args, nargs, "y*|zi:oem_decode",
&data, &errors, &final)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("oem_decode", kwnames)) {
+ goto exit;
+ }
return_value = _codecs_oem_decode_impl(module, &data, errors, final);
exit:
@@ -850,14 +930,14 @@ PyDoc_STRVAR(_codecs_code_page_decode__doc__,
"\n");
#define _CODECS_CODE_PAGE_DECODE_METHODDEF \
- {"code_page_decode", (PyCFunction)_codecs_code_page_decode, METH_VARARGS, _codecs_code_page_decode__doc__},
+ {"code_page_decode", (PyCFunction)_codecs_code_page_decode, METH_FASTCALL, _codecs_code_page_decode__doc__},
static PyObject *
_codecs_code_page_decode_impl(PyObject *module, int codepage,
Py_buffer *data, const char *errors, int final);
static PyObject *
-_codecs_code_page_decode(PyObject *module, PyObject *args)
+_codecs_code_page_decode(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
int codepage;
@@ -865,10 +945,14 @@ _codecs_code_page_decode(PyObject *module, PyObject *args)
const char *errors = NULL;
int final = 0;
- if (!PyArg_ParseTuple(args, "iy*|zi:code_page_decode",
+ if (!_PyArg_ParseStack(args, nargs, "iy*|zi:code_page_decode",
&codepage, &data, &errors, &final)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("code_page_decode", kwnames)) {
+ goto exit;
+ }
return_value = _codecs_code_page_decode_impl(module, codepage, &data, errors, final);
exit:
@@ -888,23 +972,27 @@ PyDoc_STRVAR(_codecs_readbuffer_encode__doc__,
"\n");
#define _CODECS_READBUFFER_ENCODE_METHODDEF \
- {"readbuffer_encode", (PyCFunction)_codecs_readbuffer_encode, METH_VARARGS, _codecs_readbuffer_encode__doc__},
+ {"readbuffer_encode", (PyCFunction)_codecs_readbuffer_encode, METH_FASTCALL, _codecs_readbuffer_encode__doc__},
static PyObject *
_codecs_readbuffer_encode_impl(PyObject *module, Py_buffer *data,
const char *errors);
static PyObject *
-_codecs_readbuffer_encode(PyObject *module, PyObject *args)
+_codecs_readbuffer_encode(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
Py_buffer data = {NULL, NULL};
const char *errors = NULL;
- if (!PyArg_ParseTuple(args, "s*|z:readbuffer_encode",
+ if (!_PyArg_ParseStack(args, nargs, "s*|z:readbuffer_encode",
&data, &errors)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("readbuffer_encode", kwnames)) {
+ goto exit;
+ }
return_value = _codecs_readbuffer_encode_impl(module, &data, errors);
exit:
@@ -922,23 +1010,27 @@ PyDoc_STRVAR(_codecs_unicode_internal_encode__doc__,
"\n");
#define _CODECS_UNICODE_INTERNAL_ENCODE_METHODDEF \
- {"unicode_internal_encode", (PyCFunction)_codecs_unicode_internal_encode, METH_VARARGS, _codecs_unicode_internal_encode__doc__},
+ {"unicode_internal_encode", (PyCFunction)_codecs_unicode_internal_encode, METH_FASTCALL, _codecs_unicode_internal_encode__doc__},
static PyObject *
_codecs_unicode_internal_encode_impl(PyObject *module, PyObject *obj,
const char *errors);
static PyObject *
-_codecs_unicode_internal_encode(PyObject *module, PyObject *args)
+_codecs_unicode_internal_encode(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
PyObject *obj;
const char *errors = NULL;
- if (!PyArg_ParseTuple(args, "O|z:unicode_internal_encode",
+ if (!_PyArg_ParseStack(args, nargs, "O|z:unicode_internal_encode",
&obj, &errors)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("unicode_internal_encode", kwnames)) {
+ goto exit;
+ }
return_value = _codecs_unicode_internal_encode_impl(module, obj, errors);
exit:
@@ -951,23 +1043,27 @@ PyDoc_STRVAR(_codecs_utf_7_encode__doc__,
"\n");
#define _CODECS_UTF_7_ENCODE_METHODDEF \
- {"utf_7_encode", (PyCFunction)_codecs_utf_7_encode, METH_VARARGS, _codecs_utf_7_encode__doc__},
+ {"utf_7_encode", (PyCFunction)_codecs_utf_7_encode, METH_FASTCALL, _codecs_utf_7_encode__doc__},
static PyObject *
_codecs_utf_7_encode_impl(PyObject *module, PyObject *str,
const char *errors);
static PyObject *
-_codecs_utf_7_encode(PyObject *module, PyObject *args)
+_codecs_utf_7_encode(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
PyObject *str;
const char *errors = NULL;
- if (!PyArg_ParseTuple(args, "U|z:utf_7_encode",
+ if (!_PyArg_ParseStack(args, nargs, "U|z:utf_7_encode",
&str, &errors)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("utf_7_encode", kwnames)) {
+ goto exit;
+ }
return_value = _codecs_utf_7_encode_impl(module, str, errors);
exit:
@@ -980,23 +1076,27 @@ PyDoc_STRVAR(_codecs_utf_8_encode__doc__,
"\n");
#define _CODECS_UTF_8_ENCODE_METHODDEF \
- {"utf_8_encode", (PyCFunction)_codecs_utf_8_encode, METH_VARARGS, _codecs_utf_8_encode__doc__},
+ {"utf_8_encode", (PyCFunction)_codecs_utf_8_encode, METH_FASTCALL, _codecs_utf_8_encode__doc__},
static PyObject *
_codecs_utf_8_encode_impl(PyObject *module, PyObject *str,
const char *errors);
static PyObject *
-_codecs_utf_8_encode(PyObject *module, PyObject *args)
+_codecs_utf_8_encode(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
PyObject *str;
const char *errors = NULL;
- if (!PyArg_ParseTuple(args, "U|z:utf_8_encode",
+ if (!_PyArg_ParseStack(args, nargs, "U|z:utf_8_encode",
&str, &errors)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("utf_8_encode", kwnames)) {
+ goto exit;
+ }
return_value = _codecs_utf_8_encode_impl(module, str, errors);
exit:
@@ -1009,24 +1109,28 @@ PyDoc_STRVAR(_codecs_utf_16_encode__doc__,
"\n");
#define _CODECS_UTF_16_ENCODE_METHODDEF \
- {"utf_16_encode", (PyCFunction)_codecs_utf_16_encode, METH_VARARGS, _codecs_utf_16_encode__doc__},
+ {"utf_16_encode", (PyCFunction)_codecs_utf_16_encode, METH_FASTCALL, _codecs_utf_16_encode__doc__},
static PyObject *
_codecs_utf_16_encode_impl(PyObject *module, PyObject *str,
const char *errors, int byteorder);
static PyObject *
-_codecs_utf_16_encode(PyObject *module, PyObject *args)
+_codecs_utf_16_encode(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
PyObject *str;
const char *errors = NULL;
int byteorder = 0;
- if (!PyArg_ParseTuple(args, "U|zi:utf_16_encode",
+ if (!_PyArg_ParseStack(args, nargs, "U|zi:utf_16_encode",
&str, &errors, &byteorder)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("utf_16_encode", kwnames)) {
+ goto exit;
+ }
return_value = _codecs_utf_16_encode_impl(module, str, errors, byteorder);
exit:
@@ -1039,23 +1143,27 @@ PyDoc_STRVAR(_codecs_utf_16_le_encode__doc__,
"\n");
#define _CODECS_UTF_16_LE_ENCODE_METHODDEF \
- {"utf_16_le_encode", (PyCFunction)_codecs_utf_16_le_encode, METH_VARARGS, _codecs_utf_16_le_encode__doc__},
+ {"utf_16_le_encode", (PyCFunction)_codecs_utf_16_le_encode, METH_FASTCALL, _codecs_utf_16_le_encode__doc__},
static PyObject *
_codecs_utf_16_le_encode_impl(PyObject *module, PyObject *str,
const char *errors);
static PyObject *
-_codecs_utf_16_le_encode(PyObject *module, PyObject *args)
+_codecs_utf_16_le_encode(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
PyObject *str;
const char *errors = NULL;
- if (!PyArg_ParseTuple(args, "U|z:utf_16_le_encode",
+ if (!_PyArg_ParseStack(args, nargs, "U|z:utf_16_le_encode",
&str, &errors)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("utf_16_le_encode", kwnames)) {
+ goto exit;
+ }
return_value = _codecs_utf_16_le_encode_impl(module, str, errors);
exit:
@@ -1068,23 +1176,27 @@ PyDoc_STRVAR(_codecs_utf_16_be_encode__doc__,
"\n");
#define _CODECS_UTF_16_BE_ENCODE_METHODDEF \
- {"utf_16_be_encode", (PyCFunction)_codecs_utf_16_be_encode, METH_VARARGS, _codecs_utf_16_be_encode__doc__},
+ {"utf_16_be_encode", (PyCFunction)_codecs_utf_16_be_encode, METH_FASTCALL, _codecs_utf_16_be_encode__doc__},
static PyObject *
_codecs_utf_16_be_encode_impl(PyObject *module, PyObject *str,
const char *errors);
static PyObject *
-_codecs_utf_16_be_encode(PyObject *module, PyObject *args)
+_codecs_utf_16_be_encode(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
PyObject *str;
const char *errors = NULL;
- if (!PyArg_ParseTuple(args, "U|z:utf_16_be_encode",
+ if (!_PyArg_ParseStack(args, nargs, "U|z:utf_16_be_encode",
&str, &errors)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("utf_16_be_encode", kwnames)) {
+ goto exit;
+ }
return_value = _codecs_utf_16_be_encode_impl(module, str, errors);
exit:
@@ -1097,24 +1209,28 @@ PyDoc_STRVAR(_codecs_utf_32_encode__doc__,
"\n");
#define _CODECS_UTF_32_ENCODE_METHODDEF \
- {"utf_32_encode", (PyCFunction)_codecs_utf_32_encode, METH_VARARGS, _codecs_utf_32_encode__doc__},
+ {"utf_32_encode", (PyCFunction)_codecs_utf_32_encode, METH_FASTCALL, _codecs_utf_32_encode__doc__},
static PyObject *
_codecs_utf_32_encode_impl(PyObject *module, PyObject *str,
const char *errors, int byteorder);
static PyObject *
-_codecs_utf_32_encode(PyObject *module, PyObject *args)
+_codecs_utf_32_encode(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
PyObject *str;
const char *errors = NULL;
int byteorder = 0;
- if (!PyArg_ParseTuple(args, "U|zi:utf_32_encode",
+ if (!_PyArg_ParseStack(args, nargs, "U|zi:utf_32_encode",
&str, &errors, &byteorder)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("utf_32_encode", kwnames)) {
+ goto exit;
+ }
return_value = _codecs_utf_32_encode_impl(module, str, errors, byteorder);
exit:
@@ -1127,23 +1243,27 @@ PyDoc_STRVAR(_codecs_utf_32_le_encode__doc__,
"\n");
#define _CODECS_UTF_32_LE_ENCODE_METHODDEF \
- {"utf_32_le_encode", (PyCFunction)_codecs_utf_32_le_encode, METH_VARARGS, _codecs_utf_32_le_encode__doc__},
+ {"utf_32_le_encode", (PyCFunction)_codecs_utf_32_le_encode, METH_FASTCALL, _codecs_utf_32_le_encode__doc__},
static PyObject *
_codecs_utf_32_le_encode_impl(PyObject *module, PyObject *str,
const char *errors);
static PyObject *
-_codecs_utf_32_le_encode(PyObject *module, PyObject *args)
+_codecs_utf_32_le_encode(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
PyObject *str;
const char *errors = NULL;
- if (!PyArg_ParseTuple(args, "U|z:utf_32_le_encode",
+ if (!_PyArg_ParseStack(args, nargs, "U|z:utf_32_le_encode",
&str, &errors)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("utf_32_le_encode", kwnames)) {
+ goto exit;
+ }
return_value = _codecs_utf_32_le_encode_impl(module, str, errors);
exit:
@@ -1156,23 +1276,27 @@ PyDoc_STRVAR(_codecs_utf_32_be_encode__doc__,
"\n");
#define _CODECS_UTF_32_BE_ENCODE_METHODDEF \
- {"utf_32_be_encode", (PyCFunction)_codecs_utf_32_be_encode, METH_VARARGS, _codecs_utf_32_be_encode__doc__},
+ {"utf_32_be_encode", (PyCFunction)_codecs_utf_32_be_encode, METH_FASTCALL, _codecs_utf_32_be_encode__doc__},
static PyObject *
_codecs_utf_32_be_encode_impl(PyObject *module, PyObject *str,
const char *errors);
static PyObject *
-_codecs_utf_32_be_encode(PyObject *module, PyObject *args)
+_codecs_utf_32_be_encode(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
PyObject *str;
const char *errors = NULL;
- if (!PyArg_ParseTuple(args, "U|z:utf_32_be_encode",
+ if (!_PyArg_ParseStack(args, nargs, "U|z:utf_32_be_encode",
&str, &errors)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("utf_32_be_encode", kwnames)) {
+ goto exit;
+ }
return_value = _codecs_utf_32_be_encode_impl(module, str, errors);
exit:
@@ -1185,23 +1309,27 @@ PyDoc_STRVAR(_codecs_unicode_escape_encode__doc__,
"\n");
#define _CODECS_UNICODE_ESCAPE_ENCODE_METHODDEF \
- {"unicode_escape_encode", (PyCFunction)_codecs_unicode_escape_encode, METH_VARARGS, _codecs_unicode_escape_encode__doc__},
+ {"unicode_escape_encode", (PyCFunction)_codecs_unicode_escape_encode, METH_FASTCALL, _codecs_unicode_escape_encode__doc__},
static PyObject *
_codecs_unicode_escape_encode_impl(PyObject *module, PyObject *str,
const char *errors);
static PyObject *
-_codecs_unicode_escape_encode(PyObject *module, PyObject *args)
+_codecs_unicode_escape_encode(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
PyObject *str;
const char *errors = NULL;
- if (!PyArg_ParseTuple(args, "U|z:unicode_escape_encode",
+ if (!_PyArg_ParseStack(args, nargs, "U|z:unicode_escape_encode",
&str, &errors)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("unicode_escape_encode", kwnames)) {
+ goto exit;
+ }
return_value = _codecs_unicode_escape_encode_impl(module, str, errors);
exit:
@@ -1214,23 +1342,27 @@ PyDoc_STRVAR(_codecs_raw_unicode_escape_encode__doc__,
"\n");
#define _CODECS_RAW_UNICODE_ESCAPE_ENCODE_METHODDEF \
- {"raw_unicode_escape_encode", (PyCFunction)_codecs_raw_unicode_escape_encode, METH_VARARGS, _codecs_raw_unicode_escape_encode__doc__},
+ {"raw_unicode_escape_encode", (PyCFunction)_codecs_raw_unicode_escape_encode, METH_FASTCALL, _codecs_raw_unicode_escape_encode__doc__},
static PyObject *
_codecs_raw_unicode_escape_encode_impl(PyObject *module, PyObject *str,
const char *errors);
static PyObject *
-_codecs_raw_unicode_escape_encode(PyObject *module, PyObject *args)
+_codecs_raw_unicode_escape_encode(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
PyObject *str;
const char *errors = NULL;
- if (!PyArg_ParseTuple(args, "U|z:raw_unicode_escape_encode",
+ if (!_PyArg_ParseStack(args, nargs, "U|z:raw_unicode_escape_encode",
&str, &errors)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("raw_unicode_escape_encode", kwnames)) {
+ goto exit;
+ }
return_value = _codecs_raw_unicode_escape_encode_impl(module, str, errors);
exit:
@@ -1243,23 +1375,27 @@ PyDoc_STRVAR(_codecs_latin_1_encode__doc__,
"\n");
#define _CODECS_LATIN_1_ENCODE_METHODDEF \
- {"latin_1_encode", (PyCFunction)_codecs_latin_1_encode, METH_VARARGS, _codecs_latin_1_encode__doc__},
+ {"latin_1_encode", (PyCFunction)_codecs_latin_1_encode, METH_FASTCALL, _codecs_latin_1_encode__doc__},
static PyObject *
_codecs_latin_1_encode_impl(PyObject *module, PyObject *str,
const char *errors);
static PyObject *
-_codecs_latin_1_encode(PyObject *module, PyObject *args)
+_codecs_latin_1_encode(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
PyObject *str;
const char *errors = NULL;
- if (!PyArg_ParseTuple(args, "U|z:latin_1_encode",
+ if (!_PyArg_ParseStack(args, nargs, "U|z:latin_1_encode",
&str, &errors)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("latin_1_encode", kwnames)) {
+ goto exit;
+ }
return_value = _codecs_latin_1_encode_impl(module, str, errors);
exit:
@@ -1272,23 +1408,27 @@ PyDoc_STRVAR(_codecs_ascii_encode__doc__,
"\n");
#define _CODECS_ASCII_ENCODE_METHODDEF \
- {"ascii_encode", (PyCFunction)_codecs_ascii_encode, METH_VARARGS, _codecs_ascii_encode__doc__},
+ {"ascii_encode", (PyCFunction)_codecs_ascii_encode, METH_FASTCALL, _codecs_ascii_encode__doc__},
static PyObject *
_codecs_ascii_encode_impl(PyObject *module, PyObject *str,
const char *errors);
static PyObject *
-_codecs_ascii_encode(PyObject *module, PyObject *args)
+_codecs_ascii_encode(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
PyObject *str;
const char *errors = NULL;
- if (!PyArg_ParseTuple(args, "U|z:ascii_encode",
+ if (!_PyArg_ParseStack(args, nargs, "U|z:ascii_encode",
&str, &errors)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("ascii_encode", kwnames)) {
+ goto exit;
+ }
return_value = _codecs_ascii_encode_impl(module, str, errors);
exit:
@@ -1301,24 +1441,28 @@ PyDoc_STRVAR(_codecs_charmap_encode__doc__,
"\n");
#define _CODECS_CHARMAP_ENCODE_METHODDEF \
- {"charmap_encode", (PyCFunction)_codecs_charmap_encode, METH_VARARGS, _codecs_charmap_encode__doc__},
+ {"charmap_encode", (PyCFunction)_codecs_charmap_encode, METH_FASTCALL, _codecs_charmap_encode__doc__},
static PyObject *
_codecs_charmap_encode_impl(PyObject *module, PyObject *str,
const char *errors, PyObject *mapping);
static PyObject *
-_codecs_charmap_encode(PyObject *module, PyObject *args)
+_codecs_charmap_encode(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
PyObject *str;
const char *errors = NULL;
PyObject *mapping = NULL;
- if (!PyArg_ParseTuple(args, "U|zO:charmap_encode",
+ if (!_PyArg_ParseStack(args, nargs, "U|zO:charmap_encode",
&str, &errors, &mapping)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("charmap_encode", kwnames)) {
+ goto exit;
+ }
return_value = _codecs_charmap_encode_impl(module, str, errors, mapping);
exit:
@@ -1359,22 +1503,26 @@ PyDoc_STRVAR(_codecs_mbcs_encode__doc__,
"\n");
#define _CODECS_MBCS_ENCODE_METHODDEF \
- {"mbcs_encode", (PyCFunction)_codecs_mbcs_encode, METH_VARARGS, _codecs_mbcs_encode__doc__},
+ {"mbcs_encode", (PyCFunction)_codecs_mbcs_encode, METH_FASTCALL, _codecs_mbcs_encode__doc__},
static PyObject *
_codecs_mbcs_encode_impl(PyObject *module, PyObject *str, const char *errors);
static PyObject *
-_codecs_mbcs_encode(PyObject *module, PyObject *args)
+_codecs_mbcs_encode(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
PyObject *str;
const char *errors = NULL;
- if (!PyArg_ParseTuple(args, "U|z:mbcs_encode",
+ if (!_PyArg_ParseStack(args, nargs, "U|z:mbcs_encode",
&str, &errors)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("mbcs_encode", kwnames)) {
+ goto exit;
+ }
return_value = _codecs_mbcs_encode_impl(module, str, errors);
exit:
@@ -1391,22 +1539,26 @@ PyDoc_STRVAR(_codecs_oem_encode__doc__,
"\n");
#define _CODECS_OEM_ENCODE_METHODDEF \
- {"oem_encode", (PyCFunction)_codecs_oem_encode, METH_VARARGS, _codecs_oem_encode__doc__},
+ {"oem_encode", (PyCFunction)_codecs_oem_encode, METH_FASTCALL, _codecs_oem_encode__doc__},
static PyObject *
_codecs_oem_encode_impl(PyObject *module, PyObject *str, const char *errors);
static PyObject *
-_codecs_oem_encode(PyObject *module, PyObject *args)
+_codecs_oem_encode(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
PyObject *str;
const char *errors = NULL;
- if (!PyArg_ParseTuple(args, "U|z:oem_encode",
+ if (!_PyArg_ParseStack(args, nargs, "U|z:oem_encode",
&str, &errors)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("oem_encode", kwnames)) {
+ goto exit;
+ }
return_value = _codecs_oem_encode_impl(module, str, errors);
exit:
@@ -1423,24 +1575,28 @@ PyDoc_STRVAR(_codecs_code_page_encode__doc__,
"\n");
#define _CODECS_CODE_PAGE_ENCODE_METHODDEF \
- {"code_page_encode", (PyCFunction)_codecs_code_page_encode, METH_VARARGS, _codecs_code_page_encode__doc__},
+ {"code_page_encode", (PyCFunction)_codecs_code_page_encode, METH_FASTCALL, _codecs_code_page_encode__doc__},
static PyObject *
_codecs_code_page_encode_impl(PyObject *module, int code_page, PyObject *str,
const char *errors);
static PyObject *
-_codecs_code_page_encode(PyObject *module, PyObject *args)
+_codecs_code_page_encode(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
int code_page;
PyObject *str;
const char *errors = NULL;
- if (!PyArg_ParseTuple(args, "iU|z:code_page_encode",
+ if (!_PyArg_ParseStack(args, nargs, "iU|z:code_page_encode",
&code_page, &str, &errors)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("code_page_encode", kwnames)) {
+ goto exit;
+ }
return_value = _codecs_code_page_encode_impl(module, code_page, str, errors);
exit:
@@ -1460,23 +1616,27 @@ PyDoc_STRVAR(_codecs_register_error__doc__,
"error and must return a (replacement, new position) tuple.");
#define _CODECS_REGISTER_ERROR_METHODDEF \
- {"register_error", (PyCFunction)_codecs_register_error, METH_VARARGS, _codecs_register_error__doc__},
+ {"register_error", (PyCFunction)_codecs_register_error, METH_FASTCALL, _codecs_register_error__doc__},
static PyObject *
_codecs_register_error_impl(PyObject *module, const char *errors,
PyObject *handler);
static PyObject *
-_codecs_register_error(PyObject *module, PyObject *args)
+_codecs_register_error(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
const char *errors;
PyObject *handler;
- if (!PyArg_ParseTuple(args, "sO:register_error",
+ if (!_PyArg_ParseStack(args, nargs, "sO:register_error",
&errors, &handler)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("register_error", kwnames)) {
+ goto exit;
+ }
return_value = _codecs_register_error_impl(module, errors, handler);
exit:
@@ -1536,4 +1696,4 @@ exit:
#ifndef _CODECS_CODE_PAGE_ENCODE_METHODDEF
#define _CODECS_CODE_PAGE_ENCODE_METHODDEF
#endif /* !defined(_CODECS_CODE_PAGE_ENCODE_METHODDEF) */
-/*[clinic end generated code: output=6d6afcabde10ed79 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=36fb42f450a3b4dc input=a9049054013a1b77]*/
diff --git a/Modules/clinic/_cryptmodule.c.h b/Modules/clinic/_cryptmodule.c.h
index 412c6fe8a1..3e536c1709 100644
--- a/Modules/clinic/_cryptmodule.c.h
+++ b/Modules/clinic/_cryptmodule.c.h
@@ -14,25 +14,29 @@ PyDoc_STRVAR(crypt_crypt__doc__,
"results for a given *word*.");
#define CRYPT_CRYPT_METHODDEF \
- {"crypt", (PyCFunction)crypt_crypt, METH_VARARGS, crypt_crypt__doc__},
+ {"crypt", (PyCFunction)crypt_crypt, METH_FASTCALL, crypt_crypt__doc__},
static PyObject *
crypt_crypt_impl(PyObject *module, const char *word, const char *salt);
static PyObject *
-crypt_crypt(PyObject *module, PyObject *args)
+crypt_crypt(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
const char *word;
const char *salt;
- if (!PyArg_ParseTuple(args, "ss:crypt",
+ if (!_PyArg_ParseStack(args, nargs, "ss:crypt",
&word, &salt)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("crypt", kwnames)) {
+ goto exit;
+ }
return_value = crypt_crypt_impl(module, word, salt);
exit:
return return_value;
}
-/*[clinic end generated code: output=8dfc88264e662df4 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=3fd5d3625a6f32fe input=a9049054013a1b77]*/
diff --git a/Modules/clinic/_datetimemodule.c.h b/Modules/clinic/_datetimemodule.c.h
index dcb992b1af..1ffe1337a6 100644
--- a/Modules/clinic/_datetimemodule.c.h
+++ b/Modules/clinic/_datetimemodule.c.h
@@ -27,7 +27,7 @@ datetime_datetime_now(PyTypeObject *type, PyObject **args, Py_ssize_t nargs, PyO
static _PyArg_Parser _parser = {"|O:now", _keywords, 0};
PyObject *tz = Py_None;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
&tz)) {
goto exit;
}
@@ -36,4 +36,4 @@ datetime_datetime_now(PyTypeObject *type, PyObject **args, Py_ssize_t nargs, PyO
exit:
return return_value;
}
-/*[clinic end generated code: output=8aaac0705add61ca input=a9049054013a1b77]*/
+/*[clinic end generated code: output=ff78f2f51687e9a9 input=a9049054013a1b77]*/
diff --git a/Modules/clinic/_dbmmodule.c.h b/Modules/clinic/_dbmmodule.c.h
index 06cf7e6741..06f0b04977 100644
--- a/Modules/clinic/_dbmmodule.c.h
+++ b/Modules/clinic/_dbmmodule.c.h
@@ -45,24 +45,28 @@ PyDoc_STRVAR(_dbm_dbm_get__doc__,
"Return the value for key if present, otherwise default.");
#define _DBM_DBM_GET_METHODDEF \
- {"get", (PyCFunction)_dbm_dbm_get, METH_VARARGS, _dbm_dbm_get__doc__},
+ {"get", (PyCFunction)_dbm_dbm_get, METH_FASTCALL, _dbm_dbm_get__doc__},
static PyObject *
_dbm_dbm_get_impl(dbmobject *self, const char *key,
Py_ssize_clean_t key_length, PyObject *default_value);
static PyObject *
-_dbm_dbm_get(dbmobject *self, PyObject *args)
+_dbm_dbm_get(dbmobject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
const char *key;
Py_ssize_clean_t key_length;
PyObject *default_value = NULL;
- if (!PyArg_ParseTuple(args, "s#|O:get",
+ if (!_PyArg_ParseStack(args, nargs, "s#|O:get",
&key, &key_length, &default_value)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("get", kwnames)) {
+ goto exit;
+ }
return_value = _dbm_dbm_get_impl(self, key, key_length, default_value);
exit:
@@ -78,7 +82,7 @@ PyDoc_STRVAR(_dbm_dbm_setdefault__doc__,
"If key is not in the database, it is inserted with default as the value.");
#define _DBM_DBM_SETDEFAULT_METHODDEF \
- {"setdefault", (PyCFunction)_dbm_dbm_setdefault, METH_VARARGS, _dbm_dbm_setdefault__doc__},
+ {"setdefault", (PyCFunction)_dbm_dbm_setdefault, METH_FASTCALL, _dbm_dbm_setdefault__doc__},
static PyObject *
_dbm_dbm_setdefault_impl(dbmobject *self, const char *key,
@@ -86,17 +90,21 @@ _dbm_dbm_setdefault_impl(dbmobject *self, const char *key,
PyObject *default_value);
static PyObject *
-_dbm_dbm_setdefault(dbmobject *self, PyObject *args)
+_dbm_dbm_setdefault(dbmobject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
const char *key;
Py_ssize_clean_t key_length;
PyObject *default_value = NULL;
- if (!PyArg_ParseTuple(args, "s#|O:setdefault",
+ if (!_PyArg_ParseStack(args, nargs, "s#|O:setdefault",
&key, &key_length, &default_value)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("setdefault", kwnames)) {
+ goto exit;
+ }
return_value = _dbm_dbm_setdefault_impl(self, key, key_length, default_value);
exit:
@@ -118,27 +126,31 @@ PyDoc_STRVAR(dbmopen__doc__,
" (e.g. os.O_RDWR).");
#define DBMOPEN_METHODDEF \
- {"open", (PyCFunction)dbmopen, METH_VARARGS, dbmopen__doc__},
+ {"open", (PyCFunction)dbmopen, METH_FASTCALL, dbmopen__doc__},
static PyObject *
dbmopen_impl(PyObject *module, const char *filename, const char *flags,
int mode);
static PyObject *
-dbmopen(PyObject *module, PyObject *args)
+dbmopen(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
const char *filename;
const char *flags = "r";
int mode = 438;
- if (!PyArg_ParseTuple(args, "s|si:open",
+ if (!_PyArg_ParseStack(args, nargs, "s|si:open",
&filename, &flags, &mode)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("open", kwnames)) {
+ goto exit;
+ }
return_value = dbmopen_impl(module, filename, flags, mode);
exit:
return return_value;
}
-/*[clinic end generated code: output=99adf966ef0475ff input=a9049054013a1b77]*/
+/*[clinic end generated code: output=4fdb7be8bd03cbce input=a9049054013a1b77]*/
diff --git a/Modules/clinic/_elementtree.c.h b/Modules/clinic/_elementtree.c.h
index 1b309cd88c..c13cb35c70 100644
--- a/Modules/clinic/_elementtree.c.h
+++ b/Modules/clinic/_elementtree.c.h
@@ -151,7 +151,7 @@ _elementtree_Element_find(ElementObject *self, PyObject **args, Py_ssize_t nargs
PyObject *path;
PyObject *namespaces = Py_None;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
&path, &namespaces)) {
goto exit;
}
@@ -184,7 +184,7 @@ _elementtree_Element_findtext(ElementObject *self, PyObject **args, Py_ssize_t n
PyObject *default_value = Py_None;
PyObject *namespaces = Py_None;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
&path, &default_value, &namespaces)) {
goto exit;
}
@@ -215,7 +215,7 @@ _elementtree_Element_findall(ElementObject *self, PyObject **args, Py_ssize_t na
PyObject *path;
PyObject *namespaces = Py_None;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
&path, &namespaces)) {
goto exit;
}
@@ -246,7 +246,7 @@ _elementtree_Element_iterfind(ElementObject *self, PyObject **args, Py_ssize_t n
PyObject *path;
PyObject *namespaces = Py_None;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
&path, &namespaces)) {
goto exit;
}
@@ -277,7 +277,7 @@ _elementtree_Element_get(ElementObject *self, PyObject **args, Py_ssize_t nargs,
PyObject *key;
PyObject *default_value = Py_None;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
&key, &default_value)) {
goto exit;
}
@@ -323,7 +323,7 @@ _elementtree_Element_iter(ElementObject *self, PyObject **args, Py_ssize_t nargs
static _PyArg_Parser _parser = {"|O:iter", _keywords, 0};
PyObject *tag = Py_None;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
&tag)) {
goto exit;
}
@@ -356,23 +356,27 @@ PyDoc_STRVAR(_elementtree_Element_insert__doc__,
"\n");
#define _ELEMENTTREE_ELEMENT_INSERT_METHODDEF \
- {"insert", (PyCFunction)_elementtree_Element_insert, METH_VARARGS, _elementtree_Element_insert__doc__},
+ {"insert", (PyCFunction)_elementtree_Element_insert, METH_FASTCALL, _elementtree_Element_insert__doc__},
static PyObject *
_elementtree_Element_insert_impl(ElementObject *self, Py_ssize_t index,
PyObject *subelement);
static PyObject *
-_elementtree_Element_insert(ElementObject *self, PyObject *args)
+_elementtree_Element_insert(ElementObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
Py_ssize_t index;
PyObject *subelement;
- if (!PyArg_ParseTuple(args, "nO!:insert",
+ if (!_PyArg_ParseStack(args, nargs, "nO!:insert",
&index, &Element_Type, &subelement)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("insert", kwnames)) {
+ goto exit;
+ }
return_value = _elementtree_Element_insert_impl(self, index, subelement);
exit:
@@ -419,24 +423,28 @@ PyDoc_STRVAR(_elementtree_Element_makeelement__doc__,
"\n");
#define _ELEMENTTREE_ELEMENT_MAKEELEMENT_METHODDEF \
- {"makeelement", (PyCFunction)_elementtree_Element_makeelement, METH_VARARGS, _elementtree_Element_makeelement__doc__},
+ {"makeelement", (PyCFunction)_elementtree_Element_makeelement, METH_FASTCALL, _elementtree_Element_makeelement__doc__},
static PyObject *
_elementtree_Element_makeelement_impl(ElementObject *self, PyObject *tag,
PyObject *attrib);
static PyObject *
-_elementtree_Element_makeelement(ElementObject *self, PyObject *args)
+_elementtree_Element_makeelement(ElementObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
PyObject *tag;
PyObject *attrib;
- if (!PyArg_UnpackTuple(args, "makeelement",
+ if (!_PyArg_UnpackStack(args, nargs, "makeelement",
2, 2,
&tag, &attrib)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("makeelement", kwnames)) {
+ goto exit;
+ }
return_value = _elementtree_Element_makeelement_impl(self, tag, attrib);
exit:
@@ -475,24 +483,28 @@ PyDoc_STRVAR(_elementtree_Element_set__doc__,
"\n");
#define _ELEMENTTREE_ELEMENT_SET_METHODDEF \
- {"set", (PyCFunction)_elementtree_Element_set, METH_VARARGS, _elementtree_Element_set__doc__},
+ {"set", (PyCFunction)_elementtree_Element_set, METH_FASTCALL, _elementtree_Element_set__doc__},
static PyObject *
_elementtree_Element_set_impl(ElementObject *self, PyObject *key,
PyObject *value);
static PyObject *
-_elementtree_Element_set(ElementObject *self, PyObject *args)
+_elementtree_Element_set(ElementObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
PyObject *key;
PyObject *value;
- if (!PyArg_UnpackTuple(args, "set",
+ if (!_PyArg_UnpackStack(args, nargs, "set",
2, 2,
&key, &value)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("set", kwnames)) {
+ goto exit;
+ }
return_value = _elementtree_Element_set_impl(self, key, value);
exit:
@@ -560,24 +572,28 @@ PyDoc_STRVAR(_elementtree_TreeBuilder_start__doc__,
"\n");
#define _ELEMENTTREE_TREEBUILDER_START_METHODDEF \
- {"start", (PyCFunction)_elementtree_TreeBuilder_start, METH_VARARGS, _elementtree_TreeBuilder_start__doc__},
+ {"start", (PyCFunction)_elementtree_TreeBuilder_start, METH_FASTCALL, _elementtree_TreeBuilder_start__doc__},
static PyObject *
_elementtree_TreeBuilder_start_impl(TreeBuilderObject *self, PyObject *tag,
PyObject *attrs);
static PyObject *
-_elementtree_TreeBuilder_start(TreeBuilderObject *self, PyObject *args)
+_elementtree_TreeBuilder_start(TreeBuilderObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
PyObject *tag;
PyObject *attrs = Py_None;
- if (!PyArg_UnpackTuple(args, "start",
+ if (!_PyArg_UnpackStack(args, nargs, "start",
1, 2,
&tag, &attrs)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("start", kwnames)) {
+ goto exit;
+ }
return_value = _elementtree_TreeBuilder_start_impl(self, tag, attrs);
exit:
@@ -647,25 +663,29 @@ PyDoc_STRVAR(_elementtree_XMLParser_doctype__doc__,
"\n");
#define _ELEMENTTREE_XMLPARSER_DOCTYPE_METHODDEF \
- {"doctype", (PyCFunction)_elementtree_XMLParser_doctype, METH_VARARGS, _elementtree_XMLParser_doctype__doc__},
+ {"doctype", (PyCFunction)_elementtree_XMLParser_doctype, METH_FASTCALL, _elementtree_XMLParser_doctype__doc__},
static PyObject *
_elementtree_XMLParser_doctype_impl(XMLParserObject *self, PyObject *name,
PyObject *pubid, PyObject *system);
static PyObject *
-_elementtree_XMLParser_doctype(XMLParserObject *self, PyObject *args)
+_elementtree_XMLParser_doctype(XMLParserObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
PyObject *name;
PyObject *pubid;
PyObject *system;
- if (!PyArg_UnpackTuple(args, "doctype",
+ if (!_PyArg_UnpackStack(args, nargs, "doctype",
3, 3,
&name, &pubid, &system)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("doctype", kwnames)) {
+ goto exit;
+ }
return_value = _elementtree_XMLParser_doctype_impl(self, name, pubid, system);
exit:
@@ -678,7 +698,7 @@ PyDoc_STRVAR(_elementtree_XMLParser__setevents__doc__,
"\n");
#define _ELEMENTTREE_XMLPARSER__SETEVENTS_METHODDEF \
- {"_setevents", (PyCFunction)_elementtree_XMLParser__setevents, METH_VARARGS, _elementtree_XMLParser__setevents__doc__},
+ {"_setevents", (PyCFunction)_elementtree_XMLParser__setevents, METH_FASTCALL, _elementtree_XMLParser__setevents__doc__},
static PyObject *
_elementtree_XMLParser__setevents_impl(XMLParserObject *self,
@@ -686,20 +706,24 @@ _elementtree_XMLParser__setevents_impl(XMLParserObject *self,
PyObject *events_to_report);
static PyObject *
-_elementtree_XMLParser__setevents(XMLParserObject *self, PyObject *args)
+_elementtree_XMLParser__setevents(XMLParserObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
PyObject *events_queue;
PyObject *events_to_report = Py_None;
- if (!PyArg_UnpackTuple(args, "_setevents",
+ if (!_PyArg_UnpackStack(args, nargs, "_setevents",
1, 2,
&events_queue, &events_to_report)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("_setevents", kwnames)) {
+ goto exit;
+ }
return_value = _elementtree_XMLParser__setevents_impl(self, events_queue, events_to_report);
exit:
return return_value;
}
-/*[clinic end generated code: output=b4a571a98ced3163 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=b69fa98c40917f58 input=a9049054013a1b77]*/
diff --git a/Modules/clinic/_gdbmmodule.c.h b/Modules/clinic/_gdbmmodule.c.h
index fdd589c07a..b91cea109f 100644
--- a/Modules/clinic/_gdbmmodule.c.h
+++ b/Modules/clinic/_gdbmmodule.c.h
@@ -9,23 +9,27 @@ PyDoc_STRVAR(_gdbm_gdbm_get__doc__,
"Get the value for key, or default if not present.");
#define _GDBM_GDBM_GET_METHODDEF \
- {"get", (PyCFunction)_gdbm_gdbm_get, METH_VARARGS, _gdbm_gdbm_get__doc__},
+ {"get", (PyCFunction)_gdbm_gdbm_get, METH_FASTCALL, _gdbm_gdbm_get__doc__},
static PyObject *
_gdbm_gdbm_get_impl(dbmobject *self, PyObject *key, PyObject *default_value);
static PyObject *
-_gdbm_gdbm_get(dbmobject *self, PyObject *args)
+_gdbm_gdbm_get(dbmobject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
PyObject *key;
PyObject *default_value = Py_None;
- if (!PyArg_UnpackTuple(args, "get",
+ if (!_PyArg_UnpackStack(args, nargs, "get",
1, 2,
&key, &default_value)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("get", kwnames)) {
+ goto exit;
+ }
return_value = _gdbm_gdbm_get_impl(self, key, default_value);
exit:
@@ -39,24 +43,28 @@ PyDoc_STRVAR(_gdbm_gdbm_setdefault__doc__,
"Get value for key, or set it to default and return default if not present.");
#define _GDBM_GDBM_SETDEFAULT_METHODDEF \
- {"setdefault", (PyCFunction)_gdbm_gdbm_setdefault, METH_VARARGS, _gdbm_gdbm_setdefault__doc__},
+ {"setdefault", (PyCFunction)_gdbm_gdbm_setdefault, METH_FASTCALL, _gdbm_gdbm_setdefault__doc__},
static PyObject *
_gdbm_gdbm_setdefault_impl(dbmobject *self, PyObject *key,
PyObject *default_value);
static PyObject *
-_gdbm_gdbm_setdefault(dbmobject *self, PyObject *args)
+_gdbm_gdbm_setdefault(dbmobject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
PyObject *key;
PyObject *default_value = Py_None;
- if (!PyArg_UnpackTuple(args, "setdefault",
+ if (!_PyArg_UnpackStack(args, nargs, "setdefault",
1, 2,
&key, &default_value)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("setdefault", kwnames)) {
+ goto exit;
+ }
return_value = _gdbm_gdbm_setdefault_impl(self, key, default_value);
exit:
@@ -231,26 +239,30 @@ PyDoc_STRVAR(dbmopen__doc__,
"when the database has to be created. It defaults to octal 0o666.");
#define DBMOPEN_METHODDEF \
- {"open", (PyCFunction)dbmopen, METH_VARARGS, dbmopen__doc__},
+ {"open", (PyCFunction)dbmopen, METH_FASTCALL, dbmopen__doc__},
static PyObject *
dbmopen_impl(PyObject *module, const char *name, const char *flags, int mode);
static PyObject *
-dbmopen(PyObject *module, PyObject *args)
+dbmopen(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
const char *name;
const char *flags = "r";
int mode = 438;
- if (!PyArg_ParseTuple(args, "s|si:open",
+ if (!_PyArg_ParseStack(args, nargs, "s|si:open",
&name, &flags, &mode)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("open", kwnames)) {
+ goto exit;
+ }
return_value = dbmopen_impl(module, name, flags, mode);
exit:
return return_value;
}
-/*[clinic end generated code: output=ed0f5d4e3d79b80c input=a9049054013a1b77]*/
+/*[clinic end generated code: output=03a3a63a814ada93 input=a9049054013a1b77]*/
diff --git a/Modules/clinic/_hashopenssl.c.h b/Modules/clinic/_hashopenssl.c.h
index 0445352604..572600a224 100644
--- a/Modules/clinic/_hashopenssl.c.h
+++ b/Modules/clinic/_hashopenssl.c.h
@@ -33,7 +33,7 @@ _hashlib_scrypt(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *k
long maxmem = 0;
long dklen = 64;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
&password, &salt, &PyLong_Type, &n_obj, &PyLong_Type, &r_obj, &PyLong_Type, &p_obj, &maxmem, &dklen)) {
goto exit;
}
@@ -57,4 +57,4 @@ exit:
#ifndef _HASHLIB_SCRYPT_METHODDEF
#define _HASHLIB_SCRYPT_METHODDEF
#endif /* !defined(_HASHLIB_SCRYPT_METHODDEF) */
-/*[clinic end generated code: output=118cd7036fa0fb52 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=71f1e033efe4ac9a input=a9049054013a1b77]*/
diff --git a/Modules/clinic/_lzmamodule.c.h b/Modules/clinic/_lzmamodule.c.h
index 9e6075954a..a3b1ad5c6c 100644
--- a/Modules/clinic/_lzmamodule.c.h
+++ b/Modules/clinic/_lzmamodule.c.h
@@ -96,7 +96,7 @@ _lzma_LZMADecompressor_decompress(Decompressor *self, PyObject **args, Py_ssize_
Py_buffer data = {NULL, NULL};
Py_ssize_t max_length = -1;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
&data, &max_length)) {
goto exit;
}
@@ -229,23 +229,27 @@ PyDoc_STRVAR(_lzma__decode_filter_properties__doc__,
"The result does not include the filter ID itself, only the options.");
#define _LZMA__DECODE_FILTER_PROPERTIES_METHODDEF \
- {"_decode_filter_properties", (PyCFunction)_lzma__decode_filter_properties, METH_VARARGS, _lzma__decode_filter_properties__doc__},
+ {"_decode_filter_properties", (PyCFunction)_lzma__decode_filter_properties, METH_FASTCALL, _lzma__decode_filter_properties__doc__},
static PyObject *
_lzma__decode_filter_properties_impl(PyObject *module, lzma_vli filter_id,
Py_buffer *encoded_props);
static PyObject *
-_lzma__decode_filter_properties(PyObject *module, PyObject *args)
+_lzma__decode_filter_properties(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
lzma_vli filter_id;
Py_buffer encoded_props = {NULL, NULL};
- if (!PyArg_ParseTuple(args, "O&y*:_decode_filter_properties",
+ if (!_PyArg_ParseStack(args, nargs, "O&y*:_decode_filter_properties",
lzma_vli_converter, &filter_id, &encoded_props)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("_decode_filter_properties", kwnames)) {
+ goto exit;
+ }
return_value = _lzma__decode_filter_properties_impl(module, filter_id, &encoded_props);
exit:
@@ -256,4 +260,4 @@ exit:
return return_value;
}
-/*[clinic end generated code: output=f27abae460122706 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=5f7a915fb7e41453 input=a9049054013a1b77]*/
diff --git a/Modules/clinic/_opcode.c.h b/Modules/clinic/_opcode.c.h
index 513cbfdad8..77f31d9b5f 100644
--- a/Modules/clinic/_opcode.c.h
+++ b/Modules/clinic/_opcode.c.h
@@ -9,23 +9,27 @@ PyDoc_STRVAR(_opcode_stack_effect__doc__,
"Compute the stack effect of the opcode.");
#define _OPCODE_STACK_EFFECT_METHODDEF \
- {"stack_effect", (PyCFunction)_opcode_stack_effect, METH_VARARGS, _opcode_stack_effect__doc__},
+ {"stack_effect", (PyCFunction)_opcode_stack_effect, METH_FASTCALL, _opcode_stack_effect__doc__},
static int
_opcode_stack_effect_impl(PyObject *module, int opcode, PyObject *oparg);
static PyObject *
-_opcode_stack_effect(PyObject *module, PyObject *args)
+_opcode_stack_effect(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
int opcode;
PyObject *oparg = Py_None;
int _return_value;
- if (!PyArg_ParseTuple(args, "i|O:stack_effect",
+ if (!_PyArg_ParseStack(args, nargs, "i|O:stack_effect",
&opcode, &oparg)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("stack_effect", kwnames)) {
+ goto exit;
+ }
_return_value = _opcode_stack_effect_impl(module, opcode, oparg);
if ((_return_value == -1) && PyErr_Occurred()) {
goto exit;
@@ -35,4 +39,4 @@ _opcode_stack_effect(PyObject *module, PyObject *args)
exit:
return return_value;
}
-/*[clinic end generated code: output=4d91c6a765097853 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=62858005ac85baa9 input=a9049054013a1b77]*/
diff --git a/Modules/clinic/_operator.c.h b/Modules/clinic/_operator.c.h
new file mode 100644
index 0000000000..318d233784
--- /dev/null
+++ b/Modules/clinic/_operator.c.h
@@ -0,0 +1,1648 @@
+/*[clinic input]
+preserve
+[clinic start generated code]*/
+
+PyDoc_STRVAR(_operator_truth__doc__,
+"truth($module, a, /)\n"
+"--\n"
+"\n"
+"Return True if a is true, False otherwise.");
+
+#define _OPERATOR_TRUTH_METHODDEF \
+ {"truth", (PyCFunction)_operator_truth, METH_O, _operator_truth__doc__},
+
+static int
+_operator_truth_impl(PyObject *module, PyObject *a);
+
+static PyObject *
+_operator_truth(PyObject *module, PyObject *a)
+{
+ PyObject *return_value = NULL;
+ int _return_value;
+
+ _return_value = _operator_truth_impl(module, a);
+ if ((_return_value == -1) && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = PyBool_FromLong((long)_return_value);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_operator_add__doc__,
+"add($module, a, b, /)\n"
+"--\n"
+"\n"
+"Same as a + b.");
+
+#define _OPERATOR_ADD_METHODDEF \
+ {"add", (PyCFunction)_operator_add, METH_FASTCALL, _operator_add__doc__},
+
+static PyObject *
+_operator_add_impl(PyObject *module, PyObject *a, PyObject *b);
+
+static PyObject *
+_operator_add(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ PyObject *a;
+ PyObject *b;
+
+ if (!_PyArg_UnpackStack(args, nargs, "add",
+ 2, 2,
+ &a, &b)) {
+ goto exit;
+ }
+
+ if (!_PyArg_NoStackKeywords("add", kwnames)) {
+ goto exit;
+ }
+ return_value = _operator_add_impl(module, a, b);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_operator_sub__doc__,
+"sub($module, a, b, /)\n"
+"--\n"
+"\n"
+"Same as a - b.");
+
+#define _OPERATOR_SUB_METHODDEF \
+ {"sub", (PyCFunction)_operator_sub, METH_FASTCALL, _operator_sub__doc__},
+
+static PyObject *
+_operator_sub_impl(PyObject *module, PyObject *a, PyObject *b);
+
+static PyObject *
+_operator_sub(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ PyObject *a;
+ PyObject *b;
+
+ if (!_PyArg_UnpackStack(args, nargs, "sub",
+ 2, 2,
+ &a, &b)) {
+ goto exit;
+ }
+
+ if (!_PyArg_NoStackKeywords("sub", kwnames)) {
+ goto exit;
+ }
+ return_value = _operator_sub_impl(module, a, b);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_operator_mul__doc__,
+"mul($module, a, b, /)\n"
+"--\n"
+"\n"
+"Same as a * b.");
+
+#define _OPERATOR_MUL_METHODDEF \
+ {"mul", (PyCFunction)_operator_mul, METH_FASTCALL, _operator_mul__doc__},
+
+static PyObject *
+_operator_mul_impl(PyObject *module, PyObject *a, PyObject *b);
+
+static PyObject *
+_operator_mul(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ PyObject *a;
+ PyObject *b;
+
+ if (!_PyArg_UnpackStack(args, nargs, "mul",
+ 2, 2,
+ &a, &b)) {
+ goto exit;
+ }
+
+ if (!_PyArg_NoStackKeywords("mul", kwnames)) {
+ goto exit;
+ }
+ return_value = _operator_mul_impl(module, a, b);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_operator_matmul__doc__,
+"matmul($module, a, b, /)\n"
+"--\n"
+"\n"
+"Same as a @ b.");
+
+#define _OPERATOR_MATMUL_METHODDEF \
+ {"matmul", (PyCFunction)_operator_matmul, METH_FASTCALL, _operator_matmul__doc__},
+
+static PyObject *
+_operator_matmul_impl(PyObject *module, PyObject *a, PyObject *b);
+
+static PyObject *
+_operator_matmul(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ PyObject *a;
+ PyObject *b;
+
+ if (!_PyArg_UnpackStack(args, nargs, "matmul",
+ 2, 2,
+ &a, &b)) {
+ goto exit;
+ }
+
+ if (!_PyArg_NoStackKeywords("matmul", kwnames)) {
+ goto exit;
+ }
+ return_value = _operator_matmul_impl(module, a, b);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_operator_floordiv__doc__,
+"floordiv($module, a, b, /)\n"
+"--\n"
+"\n"
+"Same as a // b.");
+
+#define _OPERATOR_FLOORDIV_METHODDEF \
+ {"floordiv", (PyCFunction)_operator_floordiv, METH_FASTCALL, _operator_floordiv__doc__},
+
+static PyObject *
+_operator_floordiv_impl(PyObject *module, PyObject *a, PyObject *b);
+
+static PyObject *
+_operator_floordiv(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ PyObject *a;
+ PyObject *b;
+
+ if (!_PyArg_UnpackStack(args, nargs, "floordiv",
+ 2, 2,
+ &a, &b)) {
+ goto exit;
+ }
+
+ if (!_PyArg_NoStackKeywords("floordiv", kwnames)) {
+ goto exit;
+ }
+ return_value = _operator_floordiv_impl(module, a, b);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_operator_truediv__doc__,
+"truediv($module, a, b, /)\n"
+"--\n"
+"\n"
+"Same as a / b.");
+
+#define _OPERATOR_TRUEDIV_METHODDEF \
+ {"truediv", (PyCFunction)_operator_truediv, METH_FASTCALL, _operator_truediv__doc__},
+
+static PyObject *
+_operator_truediv_impl(PyObject *module, PyObject *a, PyObject *b);
+
+static PyObject *
+_operator_truediv(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ PyObject *a;
+ PyObject *b;
+
+ if (!_PyArg_UnpackStack(args, nargs, "truediv",
+ 2, 2,
+ &a, &b)) {
+ goto exit;
+ }
+
+ if (!_PyArg_NoStackKeywords("truediv", kwnames)) {
+ goto exit;
+ }
+ return_value = _operator_truediv_impl(module, a, b);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_operator_mod__doc__,
+"mod($module, a, b, /)\n"
+"--\n"
+"\n"
+"Same as a % b.");
+
+#define _OPERATOR_MOD_METHODDEF \
+ {"mod", (PyCFunction)_operator_mod, METH_FASTCALL, _operator_mod__doc__},
+
+static PyObject *
+_operator_mod_impl(PyObject *module, PyObject *a, PyObject *b);
+
+static PyObject *
+_operator_mod(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ PyObject *a;
+ PyObject *b;
+
+ if (!_PyArg_UnpackStack(args, nargs, "mod",
+ 2, 2,
+ &a, &b)) {
+ goto exit;
+ }
+
+ if (!_PyArg_NoStackKeywords("mod", kwnames)) {
+ goto exit;
+ }
+ return_value = _operator_mod_impl(module, a, b);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_operator_neg__doc__,
+"neg($module, a, /)\n"
+"--\n"
+"\n"
+"Same as -a.");
+
+#define _OPERATOR_NEG_METHODDEF \
+ {"neg", (PyCFunction)_operator_neg, METH_O, _operator_neg__doc__},
+
+PyDoc_STRVAR(_operator_pos__doc__,
+"pos($module, a, /)\n"
+"--\n"
+"\n"
+"Same as +a.");
+
+#define _OPERATOR_POS_METHODDEF \
+ {"pos", (PyCFunction)_operator_pos, METH_O, _operator_pos__doc__},
+
+PyDoc_STRVAR(_operator_abs__doc__,
+"abs($module, a, /)\n"
+"--\n"
+"\n"
+"Same as abs(a).");
+
+#define _OPERATOR_ABS_METHODDEF \
+ {"abs", (PyCFunction)_operator_abs, METH_O, _operator_abs__doc__},
+
+PyDoc_STRVAR(_operator_inv__doc__,
+"inv($module, a, /)\n"
+"--\n"
+"\n"
+"Same as ~a.");
+
+#define _OPERATOR_INV_METHODDEF \
+ {"inv", (PyCFunction)_operator_inv, METH_O, _operator_inv__doc__},
+
+PyDoc_STRVAR(_operator_invert__doc__,
+"invert($module, a, /)\n"
+"--\n"
+"\n"
+"Same as ~a.");
+
+#define _OPERATOR_INVERT_METHODDEF \
+ {"invert", (PyCFunction)_operator_invert, METH_O, _operator_invert__doc__},
+
+PyDoc_STRVAR(_operator_lshift__doc__,
+"lshift($module, a, b, /)\n"
+"--\n"
+"\n"
+"Same as a << b.");
+
+#define _OPERATOR_LSHIFT_METHODDEF \
+ {"lshift", (PyCFunction)_operator_lshift, METH_FASTCALL, _operator_lshift__doc__},
+
+static PyObject *
+_operator_lshift_impl(PyObject *module, PyObject *a, PyObject *b);
+
+static PyObject *
+_operator_lshift(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ PyObject *a;
+ PyObject *b;
+
+ if (!_PyArg_UnpackStack(args, nargs, "lshift",
+ 2, 2,
+ &a, &b)) {
+ goto exit;
+ }
+
+ if (!_PyArg_NoStackKeywords("lshift", kwnames)) {
+ goto exit;
+ }
+ return_value = _operator_lshift_impl(module, a, b);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_operator_rshift__doc__,
+"rshift($module, a, b, /)\n"
+"--\n"
+"\n"
+"Same as a >> b.");
+
+#define _OPERATOR_RSHIFT_METHODDEF \
+ {"rshift", (PyCFunction)_operator_rshift, METH_FASTCALL, _operator_rshift__doc__},
+
+static PyObject *
+_operator_rshift_impl(PyObject *module, PyObject *a, PyObject *b);
+
+static PyObject *
+_operator_rshift(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ PyObject *a;
+ PyObject *b;
+
+ if (!_PyArg_UnpackStack(args, nargs, "rshift",
+ 2, 2,
+ &a, &b)) {
+ goto exit;
+ }
+
+ if (!_PyArg_NoStackKeywords("rshift", kwnames)) {
+ goto exit;
+ }
+ return_value = _operator_rshift_impl(module, a, b);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_operator_not___doc__,
+"not_($module, a, /)\n"
+"--\n"
+"\n"
+"Same as not a.");
+
+#define _OPERATOR_NOT__METHODDEF \
+ {"not_", (PyCFunction)_operator_not_, METH_O, _operator_not___doc__},
+
+static int
+_operator_not__impl(PyObject *module, PyObject *a);
+
+static PyObject *
+_operator_not_(PyObject *module, PyObject *a)
+{
+ PyObject *return_value = NULL;
+ int _return_value;
+
+ _return_value = _operator_not__impl(module, a);
+ if ((_return_value == -1) && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = PyBool_FromLong((long)_return_value);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_operator_and___doc__,
+"and_($module, a, b, /)\n"
+"--\n"
+"\n"
+"Same as a & b.");
+
+#define _OPERATOR_AND__METHODDEF \
+ {"and_", (PyCFunction)_operator_and_, METH_FASTCALL, _operator_and___doc__},
+
+static PyObject *
+_operator_and__impl(PyObject *module, PyObject *a, PyObject *b);
+
+static PyObject *
+_operator_and_(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ PyObject *a;
+ PyObject *b;
+
+ if (!_PyArg_UnpackStack(args, nargs, "and_",
+ 2, 2,
+ &a, &b)) {
+ goto exit;
+ }
+
+ if (!_PyArg_NoStackKeywords("and_", kwnames)) {
+ goto exit;
+ }
+ return_value = _operator_and__impl(module, a, b);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_operator_xor__doc__,
+"xor($module, a, b, /)\n"
+"--\n"
+"\n"
+"Same as a ^ b.");
+
+#define _OPERATOR_XOR_METHODDEF \
+ {"xor", (PyCFunction)_operator_xor, METH_FASTCALL, _operator_xor__doc__},
+
+static PyObject *
+_operator_xor_impl(PyObject *module, PyObject *a, PyObject *b);
+
+static PyObject *
+_operator_xor(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ PyObject *a;
+ PyObject *b;
+
+ if (!_PyArg_UnpackStack(args, nargs, "xor",
+ 2, 2,
+ &a, &b)) {
+ goto exit;
+ }
+
+ if (!_PyArg_NoStackKeywords("xor", kwnames)) {
+ goto exit;
+ }
+ return_value = _operator_xor_impl(module, a, b);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_operator_or___doc__,
+"or_($module, a, b, /)\n"
+"--\n"
+"\n"
+"Same as a | b.");
+
+#define _OPERATOR_OR__METHODDEF \
+ {"or_", (PyCFunction)_operator_or_, METH_FASTCALL, _operator_or___doc__},
+
+static PyObject *
+_operator_or__impl(PyObject *module, PyObject *a, PyObject *b);
+
+static PyObject *
+_operator_or_(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ PyObject *a;
+ PyObject *b;
+
+ if (!_PyArg_UnpackStack(args, nargs, "or_",
+ 2, 2,
+ &a, &b)) {
+ goto exit;
+ }
+
+ if (!_PyArg_NoStackKeywords("or_", kwnames)) {
+ goto exit;
+ }
+ return_value = _operator_or__impl(module, a, b);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_operator_iadd__doc__,
+"iadd($module, a, b, /)\n"
+"--\n"
+"\n"
+"Same as a += b.");
+
+#define _OPERATOR_IADD_METHODDEF \
+ {"iadd", (PyCFunction)_operator_iadd, METH_FASTCALL, _operator_iadd__doc__},
+
+static PyObject *
+_operator_iadd_impl(PyObject *module, PyObject *a, PyObject *b);
+
+static PyObject *
+_operator_iadd(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ PyObject *a;
+ PyObject *b;
+
+ if (!_PyArg_UnpackStack(args, nargs, "iadd",
+ 2, 2,
+ &a, &b)) {
+ goto exit;
+ }
+
+ if (!_PyArg_NoStackKeywords("iadd", kwnames)) {
+ goto exit;
+ }
+ return_value = _operator_iadd_impl(module, a, b);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_operator_isub__doc__,
+"isub($module, a, b, /)\n"
+"--\n"
+"\n"
+"Same as a -= b.");
+
+#define _OPERATOR_ISUB_METHODDEF \
+ {"isub", (PyCFunction)_operator_isub, METH_FASTCALL, _operator_isub__doc__},
+
+static PyObject *
+_operator_isub_impl(PyObject *module, PyObject *a, PyObject *b);
+
+static PyObject *
+_operator_isub(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ PyObject *a;
+ PyObject *b;
+
+ if (!_PyArg_UnpackStack(args, nargs, "isub",
+ 2, 2,
+ &a, &b)) {
+ goto exit;
+ }
+
+ if (!_PyArg_NoStackKeywords("isub", kwnames)) {
+ goto exit;
+ }
+ return_value = _operator_isub_impl(module, a, b);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_operator_imul__doc__,
+"imul($module, a, b, /)\n"
+"--\n"
+"\n"
+"Same as a *= b.");
+
+#define _OPERATOR_IMUL_METHODDEF \
+ {"imul", (PyCFunction)_operator_imul, METH_FASTCALL, _operator_imul__doc__},
+
+static PyObject *
+_operator_imul_impl(PyObject *module, PyObject *a, PyObject *b);
+
+static PyObject *
+_operator_imul(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ PyObject *a;
+ PyObject *b;
+
+ if (!_PyArg_UnpackStack(args, nargs, "imul",
+ 2, 2,
+ &a, &b)) {
+ goto exit;
+ }
+
+ if (!_PyArg_NoStackKeywords("imul", kwnames)) {
+ goto exit;
+ }
+ return_value = _operator_imul_impl(module, a, b);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_operator_imatmul__doc__,
+"imatmul($module, a, b, /)\n"
+"--\n"
+"\n"
+"Same as a @= b.");
+
+#define _OPERATOR_IMATMUL_METHODDEF \
+ {"imatmul", (PyCFunction)_operator_imatmul, METH_FASTCALL, _operator_imatmul__doc__},
+
+static PyObject *
+_operator_imatmul_impl(PyObject *module, PyObject *a, PyObject *b);
+
+static PyObject *
+_operator_imatmul(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ PyObject *a;
+ PyObject *b;
+
+ if (!_PyArg_UnpackStack(args, nargs, "imatmul",
+ 2, 2,
+ &a, &b)) {
+ goto exit;
+ }
+
+ if (!_PyArg_NoStackKeywords("imatmul", kwnames)) {
+ goto exit;
+ }
+ return_value = _operator_imatmul_impl(module, a, b);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_operator_ifloordiv__doc__,
+"ifloordiv($module, a, b, /)\n"
+"--\n"
+"\n"
+"Same as a //= b.");
+
+#define _OPERATOR_IFLOORDIV_METHODDEF \
+ {"ifloordiv", (PyCFunction)_operator_ifloordiv, METH_FASTCALL, _operator_ifloordiv__doc__},
+
+static PyObject *
+_operator_ifloordiv_impl(PyObject *module, PyObject *a, PyObject *b);
+
+static PyObject *
+_operator_ifloordiv(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ PyObject *a;
+ PyObject *b;
+
+ if (!_PyArg_UnpackStack(args, nargs, "ifloordiv",
+ 2, 2,
+ &a, &b)) {
+ goto exit;
+ }
+
+ if (!_PyArg_NoStackKeywords("ifloordiv", kwnames)) {
+ goto exit;
+ }
+ return_value = _operator_ifloordiv_impl(module, a, b);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_operator_itruediv__doc__,
+"itruediv($module, a, b, /)\n"
+"--\n"
+"\n"
+"Same as a /= b.");
+
+#define _OPERATOR_ITRUEDIV_METHODDEF \
+ {"itruediv", (PyCFunction)_operator_itruediv, METH_FASTCALL, _operator_itruediv__doc__},
+
+static PyObject *
+_operator_itruediv_impl(PyObject *module, PyObject *a, PyObject *b);
+
+static PyObject *
+_operator_itruediv(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ PyObject *a;
+ PyObject *b;
+
+ if (!_PyArg_UnpackStack(args, nargs, "itruediv",
+ 2, 2,
+ &a, &b)) {
+ goto exit;
+ }
+
+ if (!_PyArg_NoStackKeywords("itruediv", kwnames)) {
+ goto exit;
+ }
+ return_value = _operator_itruediv_impl(module, a, b);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_operator_imod__doc__,
+"imod($module, a, b, /)\n"
+"--\n"
+"\n"
+"Same as a %= b.");
+
+#define _OPERATOR_IMOD_METHODDEF \
+ {"imod", (PyCFunction)_operator_imod, METH_FASTCALL, _operator_imod__doc__},
+
+static PyObject *
+_operator_imod_impl(PyObject *module, PyObject *a, PyObject *b);
+
+static PyObject *
+_operator_imod(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ PyObject *a;
+ PyObject *b;
+
+ if (!_PyArg_UnpackStack(args, nargs, "imod",
+ 2, 2,
+ &a, &b)) {
+ goto exit;
+ }
+
+ if (!_PyArg_NoStackKeywords("imod", kwnames)) {
+ goto exit;
+ }
+ return_value = _operator_imod_impl(module, a, b);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_operator_ilshift__doc__,
+"ilshift($module, a, b, /)\n"
+"--\n"
+"\n"
+"Same as a <<= b.");
+
+#define _OPERATOR_ILSHIFT_METHODDEF \
+ {"ilshift", (PyCFunction)_operator_ilshift, METH_FASTCALL, _operator_ilshift__doc__},
+
+static PyObject *
+_operator_ilshift_impl(PyObject *module, PyObject *a, PyObject *b);
+
+static PyObject *
+_operator_ilshift(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ PyObject *a;
+ PyObject *b;
+
+ if (!_PyArg_UnpackStack(args, nargs, "ilshift",
+ 2, 2,
+ &a, &b)) {
+ goto exit;
+ }
+
+ if (!_PyArg_NoStackKeywords("ilshift", kwnames)) {
+ goto exit;
+ }
+ return_value = _operator_ilshift_impl(module, a, b);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_operator_irshift__doc__,
+"irshift($module, a, b, /)\n"
+"--\n"
+"\n"
+"Same as a >>= b.");
+
+#define _OPERATOR_IRSHIFT_METHODDEF \
+ {"irshift", (PyCFunction)_operator_irshift, METH_FASTCALL, _operator_irshift__doc__},
+
+static PyObject *
+_operator_irshift_impl(PyObject *module, PyObject *a, PyObject *b);
+
+static PyObject *
+_operator_irshift(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ PyObject *a;
+ PyObject *b;
+
+ if (!_PyArg_UnpackStack(args, nargs, "irshift",
+ 2, 2,
+ &a, &b)) {
+ goto exit;
+ }
+
+ if (!_PyArg_NoStackKeywords("irshift", kwnames)) {
+ goto exit;
+ }
+ return_value = _operator_irshift_impl(module, a, b);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_operator_iand__doc__,
+"iand($module, a, b, /)\n"
+"--\n"
+"\n"
+"Same as a &= b.");
+
+#define _OPERATOR_IAND_METHODDEF \
+ {"iand", (PyCFunction)_operator_iand, METH_FASTCALL, _operator_iand__doc__},
+
+static PyObject *
+_operator_iand_impl(PyObject *module, PyObject *a, PyObject *b);
+
+static PyObject *
+_operator_iand(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ PyObject *a;
+ PyObject *b;
+
+ if (!_PyArg_UnpackStack(args, nargs, "iand",
+ 2, 2,
+ &a, &b)) {
+ goto exit;
+ }
+
+ if (!_PyArg_NoStackKeywords("iand", kwnames)) {
+ goto exit;
+ }
+ return_value = _operator_iand_impl(module, a, b);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_operator_ixor__doc__,
+"ixor($module, a, b, /)\n"
+"--\n"
+"\n"
+"Same as a ^= b.");
+
+#define _OPERATOR_IXOR_METHODDEF \
+ {"ixor", (PyCFunction)_operator_ixor, METH_FASTCALL, _operator_ixor__doc__},
+
+static PyObject *
+_operator_ixor_impl(PyObject *module, PyObject *a, PyObject *b);
+
+static PyObject *
+_operator_ixor(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ PyObject *a;
+ PyObject *b;
+
+ if (!_PyArg_UnpackStack(args, nargs, "ixor",
+ 2, 2,
+ &a, &b)) {
+ goto exit;
+ }
+
+ if (!_PyArg_NoStackKeywords("ixor", kwnames)) {
+ goto exit;
+ }
+ return_value = _operator_ixor_impl(module, a, b);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_operator_ior__doc__,
+"ior($module, a, b, /)\n"
+"--\n"
+"\n"
+"Same as a |= b.");
+
+#define _OPERATOR_IOR_METHODDEF \
+ {"ior", (PyCFunction)_operator_ior, METH_FASTCALL, _operator_ior__doc__},
+
+static PyObject *
+_operator_ior_impl(PyObject *module, PyObject *a, PyObject *b);
+
+static PyObject *
+_operator_ior(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ PyObject *a;
+ PyObject *b;
+
+ if (!_PyArg_UnpackStack(args, nargs, "ior",
+ 2, 2,
+ &a, &b)) {
+ goto exit;
+ }
+
+ if (!_PyArg_NoStackKeywords("ior", kwnames)) {
+ goto exit;
+ }
+ return_value = _operator_ior_impl(module, a, b);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_operator_concat__doc__,
+"concat($module, a, b, /)\n"
+"--\n"
+"\n"
+"Same as a + b, for a and b sequences.");
+
+#define _OPERATOR_CONCAT_METHODDEF \
+ {"concat", (PyCFunction)_operator_concat, METH_FASTCALL, _operator_concat__doc__},
+
+static PyObject *
+_operator_concat_impl(PyObject *module, PyObject *a, PyObject *b);
+
+static PyObject *
+_operator_concat(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ PyObject *a;
+ PyObject *b;
+
+ if (!_PyArg_UnpackStack(args, nargs, "concat",
+ 2, 2,
+ &a, &b)) {
+ goto exit;
+ }
+
+ if (!_PyArg_NoStackKeywords("concat", kwnames)) {
+ goto exit;
+ }
+ return_value = _operator_concat_impl(module, a, b);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_operator_iconcat__doc__,
+"iconcat($module, a, b, /)\n"
+"--\n"
+"\n"
+"Same as a += b, for a and b sequences.");
+
+#define _OPERATOR_ICONCAT_METHODDEF \
+ {"iconcat", (PyCFunction)_operator_iconcat, METH_FASTCALL, _operator_iconcat__doc__},
+
+static PyObject *
+_operator_iconcat_impl(PyObject *module, PyObject *a, PyObject *b);
+
+static PyObject *
+_operator_iconcat(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ PyObject *a;
+ PyObject *b;
+
+ if (!_PyArg_UnpackStack(args, nargs, "iconcat",
+ 2, 2,
+ &a, &b)) {
+ goto exit;
+ }
+
+ if (!_PyArg_NoStackKeywords("iconcat", kwnames)) {
+ goto exit;
+ }
+ return_value = _operator_iconcat_impl(module, a, b);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_operator_contains__doc__,
+"contains($module, a, b, /)\n"
+"--\n"
+"\n"
+"Same as b in a (note reversed operands).");
+
+#define _OPERATOR_CONTAINS_METHODDEF \
+ {"contains", (PyCFunction)_operator_contains, METH_FASTCALL, _operator_contains__doc__},
+
+static int
+_operator_contains_impl(PyObject *module, PyObject *a, PyObject *b);
+
+static PyObject *
+_operator_contains(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ PyObject *a;
+ PyObject *b;
+ int _return_value;
+
+ if (!_PyArg_UnpackStack(args, nargs, "contains",
+ 2, 2,
+ &a, &b)) {
+ goto exit;
+ }
+
+ if (!_PyArg_NoStackKeywords("contains", kwnames)) {
+ goto exit;
+ }
+ _return_value = _operator_contains_impl(module, a, b);
+ if ((_return_value == -1) && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = PyBool_FromLong((long)_return_value);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_operator_indexOf__doc__,
+"indexOf($module, a, b, /)\n"
+"--\n"
+"\n"
+"Return the first index of b in a.");
+
+#define _OPERATOR_INDEXOF_METHODDEF \
+ {"indexOf", (PyCFunction)_operator_indexOf, METH_FASTCALL, _operator_indexOf__doc__},
+
+static Py_ssize_t
+_operator_indexOf_impl(PyObject *module, PyObject *a, PyObject *b);
+
+static PyObject *
+_operator_indexOf(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ PyObject *a;
+ PyObject *b;
+ Py_ssize_t _return_value;
+
+ if (!_PyArg_UnpackStack(args, nargs, "indexOf",
+ 2, 2,
+ &a, &b)) {
+ goto exit;
+ }
+
+ if (!_PyArg_NoStackKeywords("indexOf", kwnames)) {
+ goto exit;
+ }
+ _return_value = _operator_indexOf_impl(module, a, b);
+ if ((_return_value == -1) && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = PyLong_FromSsize_t(_return_value);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_operator_countOf__doc__,
+"countOf($module, a, b, /)\n"
+"--\n"
+"\n"
+"Return the number of times b occurs in a.");
+
+#define _OPERATOR_COUNTOF_METHODDEF \
+ {"countOf", (PyCFunction)_operator_countOf, METH_FASTCALL, _operator_countOf__doc__},
+
+static Py_ssize_t
+_operator_countOf_impl(PyObject *module, PyObject *a, PyObject *b);
+
+static PyObject *
+_operator_countOf(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ PyObject *a;
+ PyObject *b;
+ Py_ssize_t _return_value;
+
+ if (!_PyArg_UnpackStack(args, nargs, "countOf",
+ 2, 2,
+ &a, &b)) {
+ goto exit;
+ }
+
+ if (!_PyArg_NoStackKeywords("countOf", kwnames)) {
+ goto exit;
+ }
+ _return_value = _operator_countOf_impl(module, a, b);
+ if ((_return_value == -1) && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = PyLong_FromSsize_t(_return_value);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_operator_getitem__doc__,
+"getitem($module, a, b, /)\n"
+"--\n"
+"\n"
+"Same as a[b].");
+
+#define _OPERATOR_GETITEM_METHODDEF \
+ {"getitem", (PyCFunction)_operator_getitem, METH_FASTCALL, _operator_getitem__doc__},
+
+static PyObject *
+_operator_getitem_impl(PyObject *module, PyObject *a, PyObject *b);
+
+static PyObject *
+_operator_getitem(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ PyObject *a;
+ PyObject *b;
+
+ if (!_PyArg_UnpackStack(args, nargs, "getitem",
+ 2, 2,
+ &a, &b)) {
+ goto exit;
+ }
+
+ if (!_PyArg_NoStackKeywords("getitem", kwnames)) {
+ goto exit;
+ }
+ return_value = _operator_getitem_impl(module, a, b);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_operator_setitem__doc__,
+"setitem($module, a, b, c, /)\n"
+"--\n"
+"\n"
+"Same as a[b] = c.");
+
+#define _OPERATOR_SETITEM_METHODDEF \
+ {"setitem", (PyCFunction)_operator_setitem, METH_FASTCALL, _operator_setitem__doc__},
+
+static PyObject *
+_operator_setitem_impl(PyObject *module, PyObject *a, PyObject *b,
+ PyObject *c);
+
+static PyObject *
+_operator_setitem(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ PyObject *a;
+ PyObject *b;
+ PyObject *c;
+
+ if (!_PyArg_UnpackStack(args, nargs, "setitem",
+ 3, 3,
+ &a, &b, &c)) {
+ goto exit;
+ }
+
+ if (!_PyArg_NoStackKeywords("setitem", kwnames)) {
+ goto exit;
+ }
+ return_value = _operator_setitem_impl(module, a, b, c);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_operator_delitem__doc__,
+"delitem($module, a, b, /)\n"
+"--\n"
+"\n"
+"Same as del a[b].");
+
+#define _OPERATOR_DELITEM_METHODDEF \
+ {"delitem", (PyCFunction)_operator_delitem, METH_FASTCALL, _operator_delitem__doc__},
+
+static PyObject *
+_operator_delitem_impl(PyObject *module, PyObject *a, PyObject *b);
+
+static PyObject *
+_operator_delitem(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ PyObject *a;
+ PyObject *b;
+
+ if (!_PyArg_UnpackStack(args, nargs, "delitem",
+ 2, 2,
+ &a, &b)) {
+ goto exit;
+ }
+
+ if (!_PyArg_NoStackKeywords("delitem", kwnames)) {
+ goto exit;
+ }
+ return_value = _operator_delitem_impl(module, a, b);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_operator_eq__doc__,
+"eq($module, a, b, /)\n"
+"--\n"
+"\n"
+"Same as a == b.");
+
+#define _OPERATOR_EQ_METHODDEF \
+ {"eq", (PyCFunction)_operator_eq, METH_FASTCALL, _operator_eq__doc__},
+
+static PyObject *
+_operator_eq_impl(PyObject *module, PyObject *a, PyObject *b);
+
+static PyObject *
+_operator_eq(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ PyObject *a;
+ PyObject *b;
+
+ if (!_PyArg_UnpackStack(args, nargs, "eq",
+ 2, 2,
+ &a, &b)) {
+ goto exit;
+ }
+
+ if (!_PyArg_NoStackKeywords("eq", kwnames)) {
+ goto exit;
+ }
+ return_value = _operator_eq_impl(module, a, b);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_operator_ne__doc__,
+"ne($module, a, b, /)\n"
+"--\n"
+"\n"
+"Same as a != b.");
+
+#define _OPERATOR_NE_METHODDEF \
+ {"ne", (PyCFunction)_operator_ne, METH_FASTCALL, _operator_ne__doc__},
+
+static PyObject *
+_operator_ne_impl(PyObject *module, PyObject *a, PyObject *b);
+
+static PyObject *
+_operator_ne(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ PyObject *a;
+ PyObject *b;
+
+ if (!_PyArg_UnpackStack(args, nargs, "ne",
+ 2, 2,
+ &a, &b)) {
+ goto exit;
+ }
+
+ if (!_PyArg_NoStackKeywords("ne", kwnames)) {
+ goto exit;
+ }
+ return_value = _operator_ne_impl(module, a, b);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_operator_lt__doc__,
+"lt($module, a, b, /)\n"
+"--\n"
+"\n"
+"Same as a < b.");
+
+#define _OPERATOR_LT_METHODDEF \
+ {"lt", (PyCFunction)_operator_lt, METH_FASTCALL, _operator_lt__doc__},
+
+static PyObject *
+_operator_lt_impl(PyObject *module, PyObject *a, PyObject *b);
+
+static PyObject *
+_operator_lt(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ PyObject *a;
+ PyObject *b;
+
+ if (!_PyArg_UnpackStack(args, nargs, "lt",
+ 2, 2,
+ &a, &b)) {
+ goto exit;
+ }
+
+ if (!_PyArg_NoStackKeywords("lt", kwnames)) {
+ goto exit;
+ }
+ return_value = _operator_lt_impl(module, a, b);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_operator_le__doc__,
+"le($module, a, b, /)\n"
+"--\n"
+"\n"
+"Same as a <= b.");
+
+#define _OPERATOR_LE_METHODDEF \
+ {"le", (PyCFunction)_operator_le, METH_FASTCALL, _operator_le__doc__},
+
+static PyObject *
+_operator_le_impl(PyObject *module, PyObject *a, PyObject *b);
+
+static PyObject *
+_operator_le(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ PyObject *a;
+ PyObject *b;
+
+ if (!_PyArg_UnpackStack(args, nargs, "le",
+ 2, 2,
+ &a, &b)) {
+ goto exit;
+ }
+
+ if (!_PyArg_NoStackKeywords("le", kwnames)) {
+ goto exit;
+ }
+ return_value = _operator_le_impl(module, a, b);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_operator_gt__doc__,
+"gt($module, a, b, /)\n"
+"--\n"
+"\n"
+"Same as a > b.");
+
+#define _OPERATOR_GT_METHODDEF \
+ {"gt", (PyCFunction)_operator_gt, METH_FASTCALL, _operator_gt__doc__},
+
+static PyObject *
+_operator_gt_impl(PyObject *module, PyObject *a, PyObject *b);
+
+static PyObject *
+_operator_gt(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ PyObject *a;
+ PyObject *b;
+
+ if (!_PyArg_UnpackStack(args, nargs, "gt",
+ 2, 2,
+ &a, &b)) {
+ goto exit;
+ }
+
+ if (!_PyArg_NoStackKeywords("gt", kwnames)) {
+ goto exit;
+ }
+ return_value = _operator_gt_impl(module, a, b);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_operator_ge__doc__,
+"ge($module, a, b, /)\n"
+"--\n"
+"\n"
+"Same as a >= b.");
+
+#define _OPERATOR_GE_METHODDEF \
+ {"ge", (PyCFunction)_operator_ge, METH_FASTCALL, _operator_ge__doc__},
+
+static PyObject *
+_operator_ge_impl(PyObject *module, PyObject *a, PyObject *b);
+
+static PyObject *
+_operator_ge(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ PyObject *a;
+ PyObject *b;
+
+ if (!_PyArg_UnpackStack(args, nargs, "ge",
+ 2, 2,
+ &a, &b)) {
+ goto exit;
+ }
+
+ if (!_PyArg_NoStackKeywords("ge", kwnames)) {
+ goto exit;
+ }
+ return_value = _operator_ge_impl(module, a, b);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_operator_pow__doc__,
+"pow($module, a, b, /)\n"
+"--\n"
+"\n"
+"Same as a ** b.");
+
+#define _OPERATOR_POW_METHODDEF \
+ {"pow", (PyCFunction)_operator_pow, METH_FASTCALL, _operator_pow__doc__},
+
+static PyObject *
+_operator_pow_impl(PyObject *module, PyObject *a, PyObject *b);
+
+static PyObject *
+_operator_pow(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ PyObject *a;
+ PyObject *b;
+
+ if (!_PyArg_UnpackStack(args, nargs, "pow",
+ 2, 2,
+ &a, &b)) {
+ goto exit;
+ }
+
+ if (!_PyArg_NoStackKeywords("pow", kwnames)) {
+ goto exit;
+ }
+ return_value = _operator_pow_impl(module, a, b);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_operator_ipow__doc__,
+"ipow($module, a, b, /)\n"
+"--\n"
+"\n"
+"Same as a **= b.");
+
+#define _OPERATOR_IPOW_METHODDEF \
+ {"ipow", (PyCFunction)_operator_ipow, METH_FASTCALL, _operator_ipow__doc__},
+
+static PyObject *
+_operator_ipow_impl(PyObject *module, PyObject *a, PyObject *b);
+
+static PyObject *
+_operator_ipow(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ PyObject *a;
+ PyObject *b;
+
+ if (!_PyArg_UnpackStack(args, nargs, "ipow",
+ 2, 2,
+ &a, &b)) {
+ goto exit;
+ }
+
+ if (!_PyArg_NoStackKeywords("ipow", kwnames)) {
+ goto exit;
+ }
+ return_value = _operator_ipow_impl(module, a, b);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_operator_index__doc__,
+"index($module, a, /)\n"
+"--\n"
+"\n"
+"Same as a.__index__()");
+
+#define _OPERATOR_INDEX_METHODDEF \
+ {"index", (PyCFunction)_operator_index, METH_O, _operator_index__doc__},
+
+PyDoc_STRVAR(_operator_is___doc__,
+"is_($module, a, b, /)\n"
+"--\n"
+"\n"
+"Same as a is b.");
+
+#define _OPERATOR_IS__METHODDEF \
+ {"is_", (PyCFunction)_operator_is_, METH_FASTCALL, _operator_is___doc__},
+
+static PyObject *
+_operator_is__impl(PyObject *module, PyObject *a, PyObject *b);
+
+static PyObject *
+_operator_is_(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ PyObject *a;
+ PyObject *b;
+
+ if (!_PyArg_UnpackStack(args, nargs, "is_",
+ 2, 2,
+ &a, &b)) {
+ goto exit;
+ }
+
+ if (!_PyArg_NoStackKeywords("is_", kwnames)) {
+ goto exit;
+ }
+ return_value = _operator_is__impl(module, a, b);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_operator_is_not__doc__,
+"is_not($module, a, b, /)\n"
+"--\n"
+"\n"
+"Same as a is not b.");
+
+#define _OPERATOR_IS_NOT_METHODDEF \
+ {"is_not", (PyCFunction)_operator_is_not, METH_FASTCALL, _operator_is_not__doc__},
+
+static PyObject *
+_operator_is_not_impl(PyObject *module, PyObject *a, PyObject *b);
+
+static PyObject *
+_operator_is_not(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ PyObject *a;
+ PyObject *b;
+
+ if (!_PyArg_UnpackStack(args, nargs, "is_not",
+ 2, 2,
+ &a, &b)) {
+ goto exit;
+ }
+
+ if (!_PyArg_NoStackKeywords("is_not", kwnames)) {
+ goto exit;
+ }
+ return_value = _operator_is_not_impl(module, a, b);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_operator_length_hint__doc__,
+"length_hint($module, obj, default=0, /)\n"
+"--\n"
+"\n"
+"Return an estimate of the number of items in obj.\n"
+"\n"
+"This is useful for presizing containers when building from an iterable.\n"
+"\n"
+"If the object supports len(), the result will be exact.\n"
+"Otherwise, it may over- or under-estimate by an arbitrary amount.\n"
+"The result will be an integer >= 0.");
+
+#define _OPERATOR_LENGTH_HINT_METHODDEF \
+ {"length_hint", (PyCFunction)_operator_length_hint, METH_FASTCALL, _operator_length_hint__doc__},
+
+static Py_ssize_t
+_operator_length_hint_impl(PyObject *module, PyObject *obj,
+ Py_ssize_t default_value);
+
+static PyObject *
+_operator_length_hint(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ PyObject *obj;
+ Py_ssize_t default_value = 0;
+ Py_ssize_t _return_value;
+
+ if (!_PyArg_ParseStack(args, nargs, "O|n:length_hint",
+ &obj, &default_value)) {
+ goto exit;
+ }
+
+ if (!_PyArg_NoStackKeywords("length_hint", kwnames)) {
+ goto exit;
+ }
+ _return_value = _operator_length_hint_impl(module, obj, default_value);
+ if ((_return_value == -1) && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = PyLong_FromSsize_t(_return_value);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_operator__compare_digest__doc__,
+"_compare_digest($module, a, b, /)\n"
+"--\n"
+"\n"
+"Return \'a == b\'.\n"
+"\n"
+"This function uses an approach designed to prevent\n"
+"timing analysis, making it appropriate for cryptography.\n"
+"\n"
+"a and b must both be of the same type: either str (ASCII only),\n"
+"or any bytes-like object.\n"
+"\n"
+"Note: If a and b are of different lengths, or if an error occurs,\n"
+"a timing attack could theoretically reveal information about the\n"
+"types and lengths of a and b--but not their values.");
+
+#define _OPERATOR__COMPARE_DIGEST_METHODDEF \
+ {"_compare_digest", (PyCFunction)_operator__compare_digest, METH_FASTCALL, _operator__compare_digest__doc__},
+
+static PyObject *
+_operator__compare_digest_impl(PyObject *module, PyObject *a, PyObject *b);
+
+static PyObject *
+_operator__compare_digest(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ PyObject *a;
+ PyObject *b;
+
+ if (!_PyArg_UnpackStack(args, nargs, "_compare_digest",
+ 2, 2,
+ &a, &b)) {
+ goto exit;
+ }
+
+ if (!_PyArg_NoStackKeywords("_compare_digest", kwnames)) {
+ goto exit;
+ }
+ return_value = _operator__compare_digest_impl(module, a, b);
+
+exit:
+ return return_value;
+}
+/*[clinic end generated code: output=c030b6747fddd9c6 input=a9049054013a1b77]*/
diff --git a/Modules/clinic/_pickle.c.h b/Modules/clinic/_pickle.c.h
index 9ad4c37f47..e10730a6de 100644
--- a/Modules/clinic/_pickle.c.h
+++ b/Modules/clinic/_pickle.c.h
@@ -199,7 +199,7 @@ PyDoc_STRVAR(_pickle_Unpickler_find_class__doc__,
"needed. Both arguments passed are str objects.");
#define _PICKLE_UNPICKLER_FIND_CLASS_METHODDEF \
- {"find_class", (PyCFunction)_pickle_Unpickler_find_class, METH_VARARGS, _pickle_Unpickler_find_class__doc__},
+ {"find_class", (PyCFunction)_pickle_Unpickler_find_class, METH_FASTCALL, _pickle_Unpickler_find_class__doc__},
static PyObject *
_pickle_Unpickler_find_class_impl(UnpicklerObject *self,
@@ -207,17 +207,21 @@ _pickle_Unpickler_find_class_impl(UnpicklerObject *self,
PyObject *global_name);
static PyObject *
-_pickle_Unpickler_find_class(UnpicklerObject *self, PyObject *args)
+_pickle_Unpickler_find_class(UnpicklerObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
PyObject *module_name;
PyObject *global_name;
- if (!PyArg_UnpackTuple(args, "find_class",
+ if (!_PyArg_UnpackStack(args, nargs, "find_class",
2, 2,
&module_name, &global_name)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("find_class", kwnames)) {
+ goto exit;
+ }
return_value = _pickle_Unpickler_find_class_impl(self, module_name, global_name);
exit:
@@ -401,7 +405,7 @@ _pickle_dump(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwna
PyObject *protocol = NULL;
int fix_imports = 1;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
&obj, &file, &protocol, &fix_imports)) {
goto exit;
}
@@ -446,7 +450,7 @@ _pickle_dumps(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwn
PyObject *protocol = NULL;
int fix_imports = 1;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
&obj, &protocol, &fix_imports)) {
goto exit;
}
@@ -503,7 +507,7 @@ _pickle_load(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwna
const char *encoding = "ASCII";
const char *errors = "strict";
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
&file, &fix_imports, &encoding, &errors)) {
goto exit;
}
@@ -551,7 +555,7 @@ _pickle_loads(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwn
const char *encoding = "ASCII";
const char *errors = "strict";
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
&data, &fix_imports, &encoding, &errors)) {
goto exit;
}
@@ -560,4 +564,4 @@ _pickle_loads(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwn
exit:
return return_value;
}
-/*[clinic end generated code: output=82be137b3c09cb9f input=a9049054013a1b77]*/
+/*[clinic end generated code: output=b921d325b2f7a096 input=a9049054013a1b77]*/
diff --git a/Modules/clinic/_sre.c.h b/Modules/clinic/_sre.c.h
index 0612005d1e..fcb23e8919 100644
--- a/Modules/clinic/_sre.c.h
+++ b/Modules/clinic/_sre.c.h
@@ -35,23 +35,27 @@ PyDoc_STRVAR(_sre_getlower__doc__,
"\n");
#define _SRE_GETLOWER_METHODDEF \
- {"getlower", (PyCFunction)_sre_getlower, METH_VARARGS, _sre_getlower__doc__},
+ {"getlower", (PyCFunction)_sre_getlower, METH_FASTCALL, _sre_getlower__doc__},
static int
_sre_getlower_impl(PyObject *module, int character, int flags);
static PyObject *
-_sre_getlower(PyObject *module, PyObject *args)
+_sre_getlower(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
int character;
int flags;
int _return_value;
- if (!PyArg_ParseTuple(args, "ii:getlower",
+ if (!_PyArg_ParseStack(args, nargs, "ii:getlower",
&character, &flags)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("getlower", kwnames)) {
+ goto exit;
+ }
_return_value = _sre_getlower_impl(module, character, flags);
if ((_return_value == -1) && PyErr_Occurred()) {
goto exit;
@@ -63,7 +67,7 @@ exit:
}
PyDoc_STRVAR(_sre_SRE_Pattern_match__doc__,
-"match($self, /, string=None, pos=0, endpos=sys.maxsize, *, pattern=None)\n"
+"match($self, /, string, pos=0, endpos=sys.maxsize)\n"
"--\n"
"\n"
"Matches zero or more characters at the beginning of the string.");
@@ -73,33 +77,30 @@ PyDoc_STRVAR(_sre_SRE_Pattern_match__doc__,
static PyObject *
_sre_SRE_Pattern_match_impl(PatternObject *self, PyObject *string,
- Py_ssize_t pos, Py_ssize_t endpos,
- PyObject *pattern);
+ Py_ssize_t pos, Py_ssize_t endpos);
static PyObject *
_sre_SRE_Pattern_match(PatternObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
- static const char * const _keywords[] = {"string", "pos", "endpos", "pattern", NULL};
- static _PyArg_Parser _parser = {"|Onn$O:match", _keywords, 0};
- PyObject *string = NULL;
+ static const char * const _keywords[] = {"string", "pos", "endpos", NULL};
+ static _PyArg_Parser _parser = {"O|nn:match", _keywords, 0};
+ PyObject *string;
Py_ssize_t pos = 0;
Py_ssize_t endpos = PY_SSIZE_T_MAX;
- PyObject *pattern = NULL;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
- &string, &pos, &endpos, &pattern)) {
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
+ &string, &pos, &endpos)) {
goto exit;
}
- return_value = _sre_SRE_Pattern_match_impl(self, string, pos, endpos, pattern);
+ return_value = _sre_SRE_Pattern_match_impl(self, string, pos, endpos);
exit:
return return_value;
}
PyDoc_STRVAR(_sre_SRE_Pattern_fullmatch__doc__,
-"fullmatch($self, /, string=None, pos=0, endpos=sys.maxsize, *,\n"
-" pattern=None)\n"
+"fullmatch($self, /, string, pos=0, endpos=sys.maxsize)\n"
"--\n"
"\n"
"Matches against all of the string");
@@ -109,33 +110,30 @@ PyDoc_STRVAR(_sre_SRE_Pattern_fullmatch__doc__,
static PyObject *
_sre_SRE_Pattern_fullmatch_impl(PatternObject *self, PyObject *string,
- Py_ssize_t pos, Py_ssize_t endpos,
- PyObject *pattern);
+ Py_ssize_t pos, Py_ssize_t endpos);
static PyObject *
_sre_SRE_Pattern_fullmatch(PatternObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
- static const char * const _keywords[] = {"string", "pos", "endpos", "pattern", NULL};
- static _PyArg_Parser _parser = {"|Onn$O:fullmatch", _keywords, 0};
- PyObject *string = NULL;
+ static const char * const _keywords[] = {"string", "pos", "endpos", NULL};
+ static _PyArg_Parser _parser = {"O|nn:fullmatch", _keywords, 0};
+ PyObject *string;
Py_ssize_t pos = 0;
Py_ssize_t endpos = PY_SSIZE_T_MAX;
- PyObject *pattern = NULL;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
- &string, &pos, &endpos, &pattern)) {
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
+ &string, &pos, &endpos)) {
goto exit;
}
- return_value = _sre_SRE_Pattern_fullmatch_impl(self, string, pos, endpos, pattern);
+ return_value = _sre_SRE_Pattern_fullmatch_impl(self, string, pos, endpos);
exit:
return return_value;
}
PyDoc_STRVAR(_sre_SRE_Pattern_search__doc__,
-"search($self, /, string=None, pos=0, endpos=sys.maxsize, *,\n"
-" pattern=None)\n"
+"search($self, /, string, pos=0, endpos=sys.maxsize)\n"
"--\n"
"\n"
"Scan through string looking for a match, and return a corresponding match object instance.\n"
@@ -147,33 +145,30 @@ PyDoc_STRVAR(_sre_SRE_Pattern_search__doc__,
static PyObject *
_sre_SRE_Pattern_search_impl(PatternObject *self, PyObject *string,
- Py_ssize_t pos, Py_ssize_t endpos,
- PyObject *pattern);
+ Py_ssize_t pos, Py_ssize_t endpos);
static PyObject *
_sre_SRE_Pattern_search(PatternObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
- static const char * const _keywords[] = {"string", "pos", "endpos", "pattern", NULL};
- static _PyArg_Parser _parser = {"|Onn$O:search", _keywords, 0};
- PyObject *string = NULL;
+ static const char * const _keywords[] = {"string", "pos", "endpos", NULL};
+ static _PyArg_Parser _parser = {"O|nn:search", _keywords, 0};
+ PyObject *string;
Py_ssize_t pos = 0;
Py_ssize_t endpos = PY_SSIZE_T_MAX;
- PyObject *pattern = NULL;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
- &string, &pos, &endpos, &pattern)) {
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
+ &string, &pos, &endpos)) {
goto exit;
}
- return_value = _sre_SRE_Pattern_search_impl(self, string, pos, endpos, pattern);
+ return_value = _sre_SRE_Pattern_search_impl(self, string, pos, endpos);
exit:
return return_value;
}
PyDoc_STRVAR(_sre_SRE_Pattern_findall__doc__,
-"findall($self, /, string=None, pos=0, endpos=sys.maxsize, *,\n"
-" source=None)\n"
+"findall($self, /, string, pos=0, endpos=sys.maxsize)\n"
"--\n"
"\n"
"Return a list of all non-overlapping matches of pattern in string.");
@@ -183,25 +178,23 @@ PyDoc_STRVAR(_sre_SRE_Pattern_findall__doc__,
static PyObject *
_sre_SRE_Pattern_findall_impl(PatternObject *self, PyObject *string,
- Py_ssize_t pos, Py_ssize_t endpos,
- PyObject *source);
+ Py_ssize_t pos, Py_ssize_t endpos);
static PyObject *
_sre_SRE_Pattern_findall(PatternObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
- static const char * const _keywords[] = {"string", "pos", "endpos", "source", NULL};
- static _PyArg_Parser _parser = {"|Onn$O:findall", _keywords, 0};
- PyObject *string = NULL;
+ static const char * const _keywords[] = {"string", "pos", "endpos", NULL};
+ static _PyArg_Parser _parser = {"O|nn:findall", _keywords, 0};
+ PyObject *string;
Py_ssize_t pos = 0;
Py_ssize_t endpos = PY_SSIZE_T_MAX;
- PyObject *source = NULL;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
- &string, &pos, &endpos, &source)) {
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
+ &string, &pos, &endpos)) {
goto exit;
}
- return_value = _sre_SRE_Pattern_findall_impl(self, string, pos, endpos, source);
+ return_value = _sre_SRE_Pattern_findall_impl(self, string, pos, endpos);
exit:
return return_value;
@@ -232,7 +225,7 @@ _sre_SRE_Pattern_finditer(PatternObject *self, PyObject **args, Py_ssize_t nargs
Py_ssize_t pos = 0;
Py_ssize_t endpos = PY_SSIZE_T_MAX;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
&string, &pos, &endpos)) {
goto exit;
}
@@ -264,7 +257,7 @@ _sre_SRE_Pattern_scanner(PatternObject *self, PyObject **args, Py_ssize_t nargs,
Py_ssize_t pos = 0;
Py_ssize_t endpos = PY_SSIZE_T_MAX;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
&string, &pos, &endpos)) {
goto exit;
}
@@ -275,7 +268,7 @@ exit:
}
PyDoc_STRVAR(_sre_SRE_Pattern_split__doc__,
-"split($self, /, string=None, maxsplit=0, *, source=None)\n"
+"split($self, /, string, maxsplit=0)\n"
"--\n"
"\n"
"Split string by the occurrences of pattern.");
@@ -285,23 +278,22 @@ PyDoc_STRVAR(_sre_SRE_Pattern_split__doc__,
static PyObject *
_sre_SRE_Pattern_split_impl(PatternObject *self, PyObject *string,
- Py_ssize_t maxsplit, PyObject *source);
+ Py_ssize_t maxsplit);
static PyObject *
_sre_SRE_Pattern_split(PatternObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
- static const char * const _keywords[] = {"string", "maxsplit", "source", NULL};
- static _PyArg_Parser _parser = {"|On$O:split", _keywords, 0};
- PyObject *string = NULL;
+ static const char * const _keywords[] = {"string", "maxsplit", NULL};
+ static _PyArg_Parser _parser = {"O|n:split", _keywords, 0};
+ PyObject *string;
Py_ssize_t maxsplit = 0;
- PyObject *source = NULL;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
- &string, &maxsplit, &source)) {
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
+ &string, &maxsplit)) {
goto exit;
}
- return_value = _sre_SRE_Pattern_split_impl(self, string, maxsplit, source);
+ return_value = _sre_SRE_Pattern_split_impl(self, string, maxsplit);
exit:
return return_value;
@@ -330,7 +322,7 @@ _sre_SRE_Pattern_sub(PatternObject *self, PyObject **args, Py_ssize_t nargs, PyO
PyObject *string;
Py_ssize_t count = 0;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
&repl, &string, &count)) {
goto exit;
}
@@ -363,7 +355,7 @@ _sre_SRE_Pattern_subn(PatternObject *self, PyObject **args, Py_ssize_t nargs, Py
PyObject *string;
Py_ssize_t count = 0;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
&repl, &string, &count)) {
goto exit;
}
@@ -409,7 +401,7 @@ _sre_SRE_Pattern___deepcopy__(PatternObject *self, PyObject **args, Py_ssize_t n
static _PyArg_Parser _parser = {"O:__deepcopy__", _keywords, 0};
PyObject *memo;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
&memo)) {
goto exit;
}
@@ -438,7 +430,7 @@ _sre_compile(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwna
{
PyObject *return_value = NULL;
static const char * const _keywords[] = {"pattern", "flags", "code", "groups", "groupindex", "indexgroup", NULL};
- static _PyArg_Parser _parser = {"OiO!nOO:compile", _keywords, 0};
+ static _PyArg_Parser _parser = {"OiO!nO!O!:compile", _keywords, 0};
PyObject *pattern;
int flags;
PyObject *code;
@@ -446,8 +438,8 @@ _sre_compile(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwna
PyObject *groupindex;
PyObject *indexgroup;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
- &pattern, &flags, &PyList_Type, &code, &groups, &groupindex, &indexgroup)) {
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
+ &pattern, &flags, &PyList_Type, &code, &groups, &PyDict_Type, &groupindex, &PyTuple_Type, &indexgroup)) {
goto exit;
}
return_value = _sre_compile_impl(module, pattern, flags, code, groups, groupindex, indexgroup);
@@ -476,7 +468,7 @@ _sre_SRE_Match_expand(MatchObject *self, PyObject **args, Py_ssize_t nargs, PyOb
static _PyArg_Parser _parser = {"O:expand", _keywords, 0};
PyObject *template;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
&template)) {
goto exit;
}
@@ -509,7 +501,7 @@ _sre_SRE_Match_groups(MatchObject *self, PyObject **args, Py_ssize_t nargs, PyOb
static _PyArg_Parser _parser = {"|O:groups", _keywords, 0};
PyObject *default_value = Py_None;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
&default_value)) {
goto exit;
}
@@ -542,7 +534,7 @@ _sre_SRE_Match_groupdict(MatchObject *self, PyObject **args, Py_ssize_t nargs, P
static _PyArg_Parser _parser = {"|O:groupdict", _keywords, 0};
PyObject *default_value = Py_None;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
&default_value)) {
goto exit;
}
@@ -559,23 +551,27 @@ PyDoc_STRVAR(_sre_SRE_Match_start__doc__,
"Return index of the start of the substring matched by group.");
#define _SRE_SRE_MATCH_START_METHODDEF \
- {"start", (PyCFunction)_sre_SRE_Match_start, METH_VARARGS, _sre_SRE_Match_start__doc__},
+ {"start", (PyCFunction)_sre_SRE_Match_start, METH_FASTCALL, _sre_SRE_Match_start__doc__},
static Py_ssize_t
_sre_SRE_Match_start_impl(MatchObject *self, PyObject *group);
static PyObject *
-_sre_SRE_Match_start(MatchObject *self, PyObject *args)
+_sre_SRE_Match_start(MatchObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
PyObject *group = NULL;
Py_ssize_t _return_value;
- if (!PyArg_UnpackTuple(args, "start",
+ if (!_PyArg_UnpackStack(args, nargs, "start",
0, 1,
&group)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("start", kwnames)) {
+ goto exit;
+ }
_return_value = _sre_SRE_Match_start_impl(self, group);
if ((_return_value == -1) && PyErr_Occurred()) {
goto exit;
@@ -593,23 +589,27 @@ PyDoc_STRVAR(_sre_SRE_Match_end__doc__,
"Return index of the end of the substring matched by group.");
#define _SRE_SRE_MATCH_END_METHODDEF \
- {"end", (PyCFunction)_sre_SRE_Match_end, METH_VARARGS, _sre_SRE_Match_end__doc__},
+ {"end", (PyCFunction)_sre_SRE_Match_end, METH_FASTCALL, _sre_SRE_Match_end__doc__},
static Py_ssize_t
_sre_SRE_Match_end_impl(MatchObject *self, PyObject *group);
static PyObject *
-_sre_SRE_Match_end(MatchObject *self, PyObject *args)
+_sre_SRE_Match_end(MatchObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
PyObject *group = NULL;
Py_ssize_t _return_value;
- if (!PyArg_UnpackTuple(args, "end",
+ if (!_PyArg_UnpackStack(args, nargs, "end",
0, 1,
&group)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("end", kwnames)) {
+ goto exit;
+ }
_return_value = _sre_SRE_Match_end_impl(self, group);
if ((_return_value == -1) && PyErr_Occurred()) {
goto exit;
@@ -627,22 +627,26 @@ PyDoc_STRVAR(_sre_SRE_Match_span__doc__,
"For MatchObject m, return the 2-tuple (m.start(group), m.end(group)).");
#define _SRE_SRE_MATCH_SPAN_METHODDEF \
- {"span", (PyCFunction)_sre_SRE_Match_span, METH_VARARGS, _sre_SRE_Match_span__doc__},
+ {"span", (PyCFunction)_sre_SRE_Match_span, METH_FASTCALL, _sre_SRE_Match_span__doc__},
static PyObject *
_sre_SRE_Match_span_impl(MatchObject *self, PyObject *group);
static PyObject *
-_sre_SRE_Match_span(MatchObject *self, PyObject *args)
+_sre_SRE_Match_span(MatchObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
PyObject *group = NULL;
- if (!PyArg_UnpackTuple(args, "span",
+ if (!_PyArg_UnpackStack(args, nargs, "span",
0, 1,
&group)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("span", kwnames)) {
+ goto exit;
+ }
return_value = _sre_SRE_Match_span_impl(self, group);
exit:
@@ -685,7 +689,7 @@ _sre_SRE_Match___deepcopy__(MatchObject *self, PyObject **args, Py_ssize_t nargs
static _PyArg_Parser _parser = {"O:__deepcopy__", _keywords, 0};
PyObject *memo;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
&memo)) {
goto exit;
}
@@ -728,4 +732,4 @@ _sre_SRE_Scanner_search(ScannerObject *self, PyObject *Py_UNUSED(ignored))
{
return _sre_SRE_Scanner_search_impl(self);
}
-/*[clinic end generated code: output=a4a246bca1963bc9 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=5df18da8e2dc762c input=a9049054013a1b77]*/
diff --git a/Modules/clinic/_ssl.c.h b/Modules/clinic/_ssl.c.h
index 29f5838439..905274fec9 100644
--- a/Modules/clinic/_ssl.c.h
+++ b/Modules/clinic/_ssl.c.h
@@ -60,21 +60,25 @@ PyDoc_STRVAR(_ssl__SSLSocket_peer_certificate__doc__,
"return the certificate even if it wasn\'t validated.");
#define _SSL__SSLSOCKET_PEER_CERTIFICATE_METHODDEF \
- {"peer_certificate", (PyCFunction)_ssl__SSLSocket_peer_certificate, METH_VARARGS, _ssl__SSLSocket_peer_certificate__doc__},
+ {"peer_certificate", (PyCFunction)_ssl__SSLSocket_peer_certificate, METH_FASTCALL, _ssl__SSLSocket_peer_certificate__doc__},
static PyObject *
_ssl__SSLSocket_peer_certificate_impl(PySSLSocket *self, int binary_mode);
static PyObject *
-_ssl__SSLSocket_peer_certificate(PySSLSocket *self, PyObject *args)
+_ssl__SSLSocket_peer_certificate(PySSLSocket *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
int binary_mode = 0;
- if (!PyArg_ParseTuple(args, "|p:peer_certificate",
+ if (!_PyArg_ParseStack(args, nargs, "|p:peer_certificate",
&binary_mode)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("peer_certificate", kwnames)) {
+ goto exit;
+ }
return_value = _ssl__SSLSocket_peer_certificate_impl(self, binary_mode);
exit:
@@ -485,7 +489,7 @@ _ssl__SSLContext_load_cert_chain(PySSLContext *self, PyObject **args, Py_ssize_t
PyObject *keyfile = NULL;
PyObject *password = NULL;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
&certfile, &keyfile, &password)) {
goto exit;
}
@@ -519,7 +523,7 @@ _ssl__SSLContext_load_verify_locations(PySSLContext *self, PyObject **args, Py_s
PyObject *capath = NULL;
PyObject *cadata = NULL;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
&cafile, &capath, &cadata)) {
goto exit;
}
@@ -559,7 +563,7 @@ _ssl__SSLContext__wrap_socket(PySSLContext *self, PyObject **args, Py_ssize_t na
int server_side;
PyObject *hostname_obj = Py_None;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
PySocketModule.Sock_Type, &sock, &server_side, &hostname_obj)) {
goto exit;
}
@@ -594,7 +598,7 @@ _ssl__SSLContext__wrap_bio(PySSLContext *self, PyObject **args, Py_ssize_t nargs
int server_side;
PyObject *hostname_obj = Py_None;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
&PySSLMemoryBIO_Type, &incoming, &PySSLMemoryBIO_Type, &outgoing, &server_side, &hostname_obj)) {
goto exit;
}
@@ -713,7 +717,7 @@ _ssl__SSLContext_get_ca_certs(PySSLContext *self, PyObject **args, Py_ssize_t na
static _PyArg_Parser _parser = {"|p:get_ca_certs", _keywords, 0};
int binary_form = 0;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
&binary_form)) {
goto exit;
}
@@ -757,21 +761,25 @@ PyDoc_STRVAR(_ssl_MemoryBIO_read__doc__,
"distinguish between the two.");
#define _SSL_MEMORYBIO_READ_METHODDEF \
- {"read", (PyCFunction)_ssl_MemoryBIO_read, METH_VARARGS, _ssl_MemoryBIO_read__doc__},
+ {"read", (PyCFunction)_ssl_MemoryBIO_read, METH_FASTCALL, _ssl_MemoryBIO_read__doc__},
static PyObject *
_ssl_MemoryBIO_read_impl(PySSLMemoryBIO *self, int len);
static PyObject *
-_ssl_MemoryBIO_read(PySSLMemoryBIO *self, PyObject *args)
+_ssl_MemoryBIO_read(PySSLMemoryBIO *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
int len = -1;
- if (!PyArg_ParseTuple(args, "|i:read",
+ if (!_PyArg_ParseStack(args, nargs, "|i:read",
&len)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("read", kwnames)) {
+ goto exit;
+ }
return_value = _ssl_MemoryBIO_read_impl(self, len);
exit:
@@ -842,22 +850,26 @@ PyDoc_STRVAR(_ssl_RAND_add__doc__,
"string. See RFC 1750.");
#define _SSL_RAND_ADD_METHODDEF \
- {"RAND_add", (PyCFunction)_ssl_RAND_add, METH_VARARGS, _ssl_RAND_add__doc__},
+ {"RAND_add", (PyCFunction)_ssl_RAND_add, METH_FASTCALL, _ssl_RAND_add__doc__},
static PyObject *
_ssl_RAND_add_impl(PyObject *module, Py_buffer *view, double entropy);
static PyObject *
-_ssl_RAND_add(PyObject *module, PyObject *args)
+_ssl_RAND_add(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
Py_buffer view = {NULL, NULL};
double entropy;
- if (!PyArg_ParseTuple(args, "s*d:RAND_add",
+ if (!_PyArg_ParseStack(args, nargs, "s*d:RAND_add",
&view, &entropy)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("RAND_add", kwnames)) {
+ goto exit;
+ }
return_value = _ssl_RAND_add_impl(module, &view, entropy);
exit:
@@ -1025,7 +1037,7 @@ _ssl_txt2obj(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwna
const char *txt;
int name = 0;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
&txt, &name)) {
goto exit;
}
@@ -1090,7 +1102,7 @@ _ssl_enum_certificates(PyObject *module, PyObject **args, Py_ssize_t nargs, PyOb
static _PyArg_Parser _parser = {"s:enum_certificates", _keywords, 0};
const char *store_name;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
&store_name)) {
goto exit;
}
@@ -1129,7 +1141,7 @@ _ssl_enum_crls(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kw
static _PyArg_Parser _parser = {"s:enum_crls", _keywords, 0};
const char *store_name;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
&store_name)) {
goto exit;
}
@@ -1168,4 +1180,4 @@ exit:
#ifndef _SSL_ENUM_CRLS_METHODDEF
#define _SSL_ENUM_CRLS_METHODDEF
#endif /* !defined(_SSL_ENUM_CRLS_METHODDEF) */
-/*[clinic end generated code: output=a859b21fe68a6115 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=53cd9100580b45a2 input=a9049054013a1b77]*/
diff --git a/Modules/clinic/_struct.c.h b/Modules/clinic/_struct.c.h
new file mode 100644
index 0000000000..71ac290164
--- /dev/null
+++ b/Modules/clinic/_struct.c.h
@@ -0,0 +1,313 @@
+/*[clinic input]
+preserve
+[clinic start generated code]*/
+
+PyDoc_STRVAR(Struct___init____doc__,
+"Struct(format)\n"
+"--\n"
+"\n"
+"Create a compiled struct object.\n"
+"\n"
+"Return a new Struct object which writes and reads binary data according to\n"
+"the format string.\n"
+"\n"
+"See help(struct) for more on format strings.");
+
+static int
+Struct___init___impl(PyStructObject *self, PyObject *format);
+
+static int
+Struct___init__(PyObject *self, PyObject *args, PyObject *kwargs)
+{
+ int return_value = -1;
+ static const char * const _keywords[] = {"format", NULL};
+ static _PyArg_Parser _parser = {"O:Struct", _keywords, 0};
+ PyObject *format;
+
+ if (!_PyArg_ParseTupleAndKeywordsFast(args, kwargs, &_parser,
+ &format)) {
+ goto exit;
+ }
+ return_value = Struct___init___impl((PyStructObject *)self, format);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(Struct_unpack__doc__,
+"unpack($self, buffer, /)\n"
+"--\n"
+"\n"
+"Return a tuple containing unpacked values.\n"
+"\n"
+"Unpack according to the format string Struct.format. The buffer\'s size\n"
+"in bytes must be Struct.size.\n"
+"\n"
+"See help(struct) for more on format strings.");
+
+#define STRUCT_UNPACK_METHODDEF \
+ {"unpack", (PyCFunction)Struct_unpack, METH_O, Struct_unpack__doc__},
+
+static PyObject *
+Struct_unpack_impl(PyStructObject *self, Py_buffer *buffer);
+
+static PyObject *
+Struct_unpack(PyStructObject *self, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ Py_buffer buffer = {NULL, NULL};
+
+ if (!PyArg_Parse(arg, "y*:unpack", &buffer)) {
+ goto exit;
+ }
+ return_value = Struct_unpack_impl(self, &buffer);
+
+exit:
+ /* Cleanup for buffer */
+ if (buffer.obj) {
+ PyBuffer_Release(&buffer);
+ }
+
+ return return_value;
+}
+
+PyDoc_STRVAR(Struct_unpack_from__doc__,
+"unpack_from($self, /, buffer, offset=0)\n"
+"--\n"
+"\n"
+"Return a tuple containing unpacked values.\n"
+"\n"
+"Values are unpacked according to the format string Struct.format.\n"
+"\n"
+"The buffer\'s size in bytes, minus offset, must be at least Struct.size.\n"
+"\n"
+"See help(struct) for more on format strings.");
+
+#define STRUCT_UNPACK_FROM_METHODDEF \
+ {"unpack_from", (PyCFunction)Struct_unpack_from, METH_FASTCALL, Struct_unpack_from__doc__},
+
+static PyObject *
+Struct_unpack_from_impl(PyStructObject *self, Py_buffer *buffer,
+ Py_ssize_t offset);
+
+static PyObject *
+Struct_unpack_from(PyStructObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ static const char * const _keywords[] = {"buffer", "offset", NULL};
+ static _PyArg_Parser _parser = {"y*|n:unpack_from", _keywords, 0};
+ Py_buffer buffer = {NULL, NULL};
+ Py_ssize_t offset = 0;
+
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
+ &buffer, &offset)) {
+ goto exit;
+ }
+ return_value = Struct_unpack_from_impl(self, &buffer, offset);
+
+exit:
+ /* Cleanup for buffer */
+ if (buffer.obj) {
+ PyBuffer_Release(&buffer);
+ }
+
+ return return_value;
+}
+
+PyDoc_STRVAR(Struct_iter_unpack__doc__,
+"iter_unpack($self, buffer, /)\n"
+"--\n"
+"\n"
+"Return an iterator yielding tuples.\n"
+"\n"
+"Tuples are unpacked from the given bytes source, like a repeated\n"
+"invocation of unpack_from().\n"
+"\n"
+"Requires that the bytes length be a multiple of the struct size.");
+
+#define STRUCT_ITER_UNPACK_METHODDEF \
+ {"iter_unpack", (PyCFunction)Struct_iter_unpack, METH_O, Struct_iter_unpack__doc__},
+
+PyDoc_STRVAR(_clearcache__doc__,
+"_clearcache($module, /)\n"
+"--\n"
+"\n"
+"Clear the internal cache.");
+
+#define _CLEARCACHE_METHODDEF \
+ {"_clearcache", (PyCFunction)_clearcache, METH_NOARGS, _clearcache__doc__},
+
+static PyObject *
+_clearcache_impl(PyObject *module);
+
+static PyObject *
+_clearcache(PyObject *module, PyObject *Py_UNUSED(ignored))
+{
+ return _clearcache_impl(module);
+}
+
+PyDoc_STRVAR(calcsize__doc__,
+"calcsize($module, format, /)\n"
+"--\n"
+"\n"
+"Return size in bytes of the struct described by the format string.");
+
+#define CALCSIZE_METHODDEF \
+ {"calcsize", (PyCFunction)calcsize, METH_O, calcsize__doc__},
+
+static Py_ssize_t
+calcsize_impl(PyObject *module, PyStructObject *s_object);
+
+static PyObject *
+calcsize(PyObject *module, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ PyStructObject *s_object = NULL;
+ Py_ssize_t _return_value;
+
+ if (!PyArg_Parse(arg, "O&:calcsize", cache_struct_converter, &s_object)) {
+ goto exit;
+ }
+ _return_value = calcsize_impl(module, s_object);
+ if ((_return_value == -1) && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = PyLong_FromSsize_t(_return_value);
+
+exit:
+ /* Cleanup for s_object */
+ Py_XDECREF(s_object);
+
+ return return_value;
+}
+
+PyDoc_STRVAR(unpack__doc__,
+"unpack($module, format, buffer, /)\n"
+"--\n"
+"\n"
+"Return a tuple containing values unpacked according to the format string.\n"
+"\n"
+"The buffer\'s size in bytes must be calcsize(format).\n"
+"\n"
+"See help(struct) for more on format strings.");
+
+#define UNPACK_METHODDEF \
+ {"unpack", (PyCFunction)unpack, METH_FASTCALL, unpack__doc__},
+
+static PyObject *
+unpack_impl(PyObject *module, PyStructObject *s_object, Py_buffer *buffer);
+
+static PyObject *
+unpack(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ PyStructObject *s_object = NULL;
+ Py_buffer buffer = {NULL, NULL};
+
+ if (!_PyArg_ParseStack(args, nargs, "O&y*:unpack",
+ cache_struct_converter, &s_object, &buffer)) {
+ goto exit;
+ }
+
+ if (!_PyArg_NoStackKeywords("unpack", kwnames)) {
+ goto exit;
+ }
+ return_value = unpack_impl(module, s_object, &buffer);
+
+exit:
+ /* Cleanup for s_object */
+ Py_XDECREF(s_object);
+ /* Cleanup for buffer */
+ if (buffer.obj) {
+ PyBuffer_Release(&buffer);
+ }
+
+ return return_value;
+}
+
+PyDoc_STRVAR(unpack_from__doc__,
+"unpack_from($module, format, /, buffer, offset=0)\n"
+"--\n"
+"\n"
+"Return a tuple containing values unpacked according to the format string.\n"
+"\n"
+"The buffer\'s size, minus offset, must be at least calcsize(format).\n"
+"\n"
+"See help(struct) for more on format strings.");
+
+#define UNPACK_FROM_METHODDEF \
+ {"unpack_from", (PyCFunction)unpack_from, METH_FASTCALL, unpack_from__doc__},
+
+static PyObject *
+unpack_from_impl(PyObject *module, PyStructObject *s_object,
+ Py_buffer *buffer, Py_ssize_t offset);
+
+static PyObject *
+unpack_from(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ static const char * const _keywords[] = {"", "buffer", "offset", NULL};
+ static _PyArg_Parser _parser = {"O&y*|n:unpack_from", _keywords, 0};
+ PyStructObject *s_object = NULL;
+ Py_buffer buffer = {NULL, NULL};
+ Py_ssize_t offset = 0;
+
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
+ cache_struct_converter, &s_object, &buffer, &offset)) {
+ goto exit;
+ }
+ return_value = unpack_from_impl(module, s_object, &buffer, offset);
+
+exit:
+ /* Cleanup for s_object */
+ Py_XDECREF(s_object);
+ /* Cleanup for buffer */
+ if (buffer.obj) {
+ PyBuffer_Release(&buffer);
+ }
+
+ return return_value;
+}
+
+PyDoc_STRVAR(iter_unpack__doc__,
+"iter_unpack($module, format, buffer, /)\n"
+"--\n"
+"\n"
+"Return an iterator yielding tuples unpacked from the given bytes.\n"
+"\n"
+"The bytes are unpacked according to the format string, like\n"
+"a repeated invocation of unpack_from().\n"
+"\n"
+"Requires that the bytes length be a multiple of the format struct size.");
+
+#define ITER_UNPACK_METHODDEF \
+ {"iter_unpack", (PyCFunction)iter_unpack, METH_FASTCALL, iter_unpack__doc__},
+
+static PyObject *
+iter_unpack_impl(PyObject *module, PyStructObject *s_object,
+ PyObject *buffer);
+
+static PyObject *
+iter_unpack(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ PyStructObject *s_object = NULL;
+ PyObject *buffer;
+
+ if (!_PyArg_ParseStack(args, nargs, "O&O:iter_unpack",
+ cache_struct_converter, &s_object, &buffer)) {
+ goto exit;
+ }
+
+ if (!_PyArg_NoStackKeywords("iter_unpack", kwnames)) {
+ goto exit;
+ }
+ return_value = iter_unpack_impl(module, s_object, buffer);
+
+exit:
+ /* Cleanup for s_object */
+ Py_XDECREF(s_object);
+
+ return return_value;
+}
+/*[clinic end generated code: output=03e0d193ab1983f9 input=a9049054013a1b77]*/
diff --git a/Modules/clinic/_tkinter.c.h b/Modules/clinic/_tkinter.c.h
index edd5380005..5d75ec33b5 100644
--- a/Modules/clinic/_tkinter.c.h
+++ b/Modules/clinic/_tkinter.c.h
@@ -256,23 +256,27 @@ PyDoc_STRVAR(_tkinter_tkapp_createcommand__doc__,
"\n");
#define _TKINTER_TKAPP_CREATECOMMAND_METHODDEF \
- {"createcommand", (PyCFunction)_tkinter_tkapp_createcommand, METH_VARARGS, _tkinter_tkapp_createcommand__doc__},
+ {"createcommand", (PyCFunction)_tkinter_tkapp_createcommand, METH_FASTCALL, _tkinter_tkapp_createcommand__doc__},
static PyObject *
_tkinter_tkapp_createcommand_impl(TkappObject *self, const char *name,
PyObject *func);
static PyObject *
-_tkinter_tkapp_createcommand(TkappObject *self, PyObject *args)
+_tkinter_tkapp_createcommand(TkappObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
const char *name;
PyObject *func;
- if (!PyArg_ParseTuple(args, "sO:createcommand",
+ if (!_PyArg_ParseStack(args, nargs, "sO:createcommand",
&name, &func)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("createcommand", kwnames)) {
+ goto exit;
+ }
return_value = _tkinter_tkapp_createcommand_impl(self, name, func);
exit:
@@ -313,24 +317,28 @@ PyDoc_STRVAR(_tkinter_tkapp_createfilehandler__doc__,
"\n");
#define _TKINTER_TKAPP_CREATEFILEHANDLER_METHODDEF \
- {"createfilehandler", (PyCFunction)_tkinter_tkapp_createfilehandler, METH_VARARGS, _tkinter_tkapp_createfilehandler__doc__},
+ {"createfilehandler", (PyCFunction)_tkinter_tkapp_createfilehandler, METH_FASTCALL, _tkinter_tkapp_createfilehandler__doc__},
static PyObject *
_tkinter_tkapp_createfilehandler_impl(TkappObject *self, PyObject *file,
int mask, PyObject *func);
static PyObject *
-_tkinter_tkapp_createfilehandler(TkappObject *self, PyObject *args)
+_tkinter_tkapp_createfilehandler(TkappObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
PyObject *file;
int mask;
PyObject *func;
- if (!PyArg_ParseTuple(args, "OiO:createfilehandler",
+ if (!_PyArg_ParseStack(args, nargs, "OiO:createfilehandler",
&file, &mask, &func)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("createfilehandler", kwnames)) {
+ goto exit;
+ }
return_value = _tkinter_tkapp_createfilehandler_impl(self, file, mask, func);
exit:
@@ -374,23 +382,27 @@ PyDoc_STRVAR(_tkinter_tkapp_createtimerhandler__doc__,
"\n");
#define _TKINTER_TKAPP_CREATETIMERHANDLER_METHODDEF \
- {"createtimerhandler", (PyCFunction)_tkinter_tkapp_createtimerhandler, METH_VARARGS, _tkinter_tkapp_createtimerhandler__doc__},
+ {"createtimerhandler", (PyCFunction)_tkinter_tkapp_createtimerhandler, METH_FASTCALL, _tkinter_tkapp_createtimerhandler__doc__},
static PyObject *
_tkinter_tkapp_createtimerhandler_impl(TkappObject *self, int milliseconds,
PyObject *func);
static PyObject *
-_tkinter_tkapp_createtimerhandler(TkappObject *self, PyObject *args)
+_tkinter_tkapp_createtimerhandler(TkappObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
int milliseconds;
PyObject *func;
- if (!PyArg_ParseTuple(args, "iO:createtimerhandler",
+ if (!_PyArg_ParseStack(args, nargs, "iO:createtimerhandler",
&milliseconds, &func)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("createtimerhandler", kwnames)) {
+ goto exit;
+ }
return_value = _tkinter_tkapp_createtimerhandler_impl(self, milliseconds, func);
exit:
@@ -403,21 +415,25 @@ PyDoc_STRVAR(_tkinter_tkapp_mainloop__doc__,
"\n");
#define _TKINTER_TKAPP_MAINLOOP_METHODDEF \
- {"mainloop", (PyCFunction)_tkinter_tkapp_mainloop, METH_VARARGS, _tkinter_tkapp_mainloop__doc__},
+ {"mainloop", (PyCFunction)_tkinter_tkapp_mainloop, METH_FASTCALL, _tkinter_tkapp_mainloop__doc__},
static PyObject *
_tkinter_tkapp_mainloop_impl(TkappObject *self, int threshold);
static PyObject *
-_tkinter_tkapp_mainloop(TkappObject *self, PyObject *args)
+_tkinter_tkapp_mainloop(TkappObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
int threshold = 0;
- if (!PyArg_ParseTuple(args, "|i:mainloop",
+ if (!_PyArg_ParseStack(args, nargs, "|i:mainloop",
&threshold)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("mainloop", kwnames)) {
+ goto exit;
+ }
return_value = _tkinter_tkapp_mainloop_impl(self, threshold);
exit:
@@ -430,21 +446,25 @@ PyDoc_STRVAR(_tkinter_tkapp_dooneevent__doc__,
"\n");
#define _TKINTER_TKAPP_DOONEEVENT_METHODDEF \
- {"dooneevent", (PyCFunction)_tkinter_tkapp_dooneevent, METH_VARARGS, _tkinter_tkapp_dooneevent__doc__},
+ {"dooneevent", (PyCFunction)_tkinter_tkapp_dooneevent, METH_FASTCALL, _tkinter_tkapp_dooneevent__doc__},
static PyObject *
_tkinter_tkapp_dooneevent_impl(TkappObject *self, int flags);
static PyObject *
-_tkinter_tkapp_dooneevent(TkappObject *self, PyObject *args)
+_tkinter_tkapp_dooneevent(TkappObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
int flags = 0;
- if (!PyArg_ParseTuple(args, "|i:dooneevent",
+ if (!_PyArg_ParseStack(args, nargs, "|i:dooneevent",
&flags)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("dooneevent", kwnames)) {
+ goto exit;
+ }
return_value = _tkinter_tkapp_dooneevent_impl(self, flags);
exit:
@@ -543,7 +563,7 @@ PyDoc_STRVAR(_tkinter_create__doc__,
" if not None, then pass -use to wish");
#define _TKINTER_CREATE_METHODDEF \
- {"create", (PyCFunction)_tkinter_create, METH_VARARGS, _tkinter_create__doc__},
+ {"create", (PyCFunction)_tkinter_create, METH_FASTCALL, _tkinter_create__doc__},
static PyObject *
_tkinter_create_impl(PyObject *module, const char *screenName,
@@ -552,7 +572,7 @@ _tkinter_create_impl(PyObject *module, const char *screenName,
const char *use);
static PyObject *
-_tkinter_create(PyObject *module, PyObject *args)
+_tkinter_create(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
const char *screenName = NULL;
@@ -564,10 +584,14 @@ _tkinter_create(PyObject *module, PyObject *args)
int sync = 0;
const char *use = NULL;
- if (!PyArg_ParseTuple(args, "|zssiiiiz:create",
+ if (!_PyArg_ParseStack(args, nargs, "|zssiiiiz:create",
&screenName, &baseName, &className, &interactive, &wantobjects, &wantTk, &sync, &use)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("create", kwnames)) {
+ goto exit;
+ }
return_value = _tkinter_create_impl(module, screenName, baseName, className, interactive, wantobjects, wantTk, sync, use);
exit:
@@ -638,4 +662,4 @@ exit:
#ifndef _TKINTER_TKAPP_DELETEFILEHANDLER_METHODDEF
#define _TKINTER_TKAPP_DELETEFILEHANDLER_METHODDEF
#endif /* !defined(_TKINTER_TKAPP_DELETEFILEHANDLER_METHODDEF) */
-/*[clinic end generated code: output=836c578b71d69097 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=328e29a146c4a63b input=a9049054013a1b77]*/
diff --git a/Modules/clinic/_tracemalloc.c.h b/Modules/clinic/_tracemalloc.c.h
new file mode 100644
index 0000000000..2950051b14
--- /dev/null
+++ b/Modules/clinic/_tracemalloc.c.h
@@ -0,0 +1,192 @@
+/*[clinic input]
+preserve
+[clinic start generated code]*/
+
+PyDoc_STRVAR(_tracemalloc_is_tracing__doc__,
+"is_tracing($module, /)\n"
+"--\n"
+"\n"
+"Return True if the tracemalloc module is tracing Python memory allocations.");
+
+#define _TRACEMALLOC_IS_TRACING_METHODDEF \
+ {"is_tracing", (PyCFunction)_tracemalloc_is_tracing, METH_NOARGS, _tracemalloc_is_tracing__doc__},
+
+static PyObject *
+_tracemalloc_is_tracing_impl(PyObject *module);
+
+static PyObject *
+_tracemalloc_is_tracing(PyObject *module, PyObject *Py_UNUSED(ignored))
+{
+ return _tracemalloc_is_tracing_impl(module);
+}
+
+PyDoc_STRVAR(_tracemalloc_clear_traces__doc__,
+"clear_traces($module, /)\n"
+"--\n"
+"\n"
+"Clear traces of memory blocks allocated by Python.");
+
+#define _TRACEMALLOC_CLEAR_TRACES_METHODDEF \
+ {"clear_traces", (PyCFunction)_tracemalloc_clear_traces, METH_NOARGS, _tracemalloc_clear_traces__doc__},
+
+static PyObject *
+_tracemalloc_clear_traces_impl(PyObject *module);
+
+static PyObject *
+_tracemalloc_clear_traces(PyObject *module, PyObject *Py_UNUSED(ignored))
+{
+ return _tracemalloc_clear_traces_impl(module);
+}
+
+PyDoc_STRVAR(_tracemalloc__get_traces__doc__,
+"_get_traces($module, /)\n"
+"--\n"
+"\n"
+"Get traces of all memory blocks allocated by Python.\n"
+"\n"
+"Return a list of (size: int, traceback: tuple) tuples.\n"
+"traceback is a tuple of (filename: str, lineno: int) tuples.\n"
+"\n"
+"Return an empty list if the tracemalloc module is disabled.");
+
+#define _TRACEMALLOC__GET_TRACES_METHODDEF \
+ {"_get_traces", (PyCFunction)_tracemalloc__get_traces, METH_NOARGS, _tracemalloc__get_traces__doc__},
+
+static PyObject *
+_tracemalloc__get_traces_impl(PyObject *module);
+
+static PyObject *
+_tracemalloc__get_traces(PyObject *module, PyObject *Py_UNUSED(ignored))
+{
+ return _tracemalloc__get_traces_impl(module);
+}
+
+PyDoc_STRVAR(_tracemalloc__get_object_traceback__doc__,
+"_get_object_traceback($module, obj, /)\n"
+"--\n"
+"\n"
+"Get the traceback where the Python object obj was allocated.\n"
+"\n"
+"Return a tuple of (filename: str, lineno: int) tuples.\n"
+"Return None if the tracemalloc module is disabled or did not\n"
+"trace the allocation of the object.");
+
+#define _TRACEMALLOC__GET_OBJECT_TRACEBACK_METHODDEF \
+ {"_get_object_traceback", (PyCFunction)_tracemalloc__get_object_traceback, METH_O, _tracemalloc__get_object_traceback__doc__},
+
+PyDoc_STRVAR(_tracemalloc_start__doc__,
+"start($module, nframe=1, /)\n"
+"--\n"
+"\n"
+"Start tracing Python memory allocations.\n"
+"\n"
+"Also set the maximum number of frames stored in the traceback of a\n"
+"trace to nframe.");
+
+#define _TRACEMALLOC_START_METHODDEF \
+ {"start", (PyCFunction)_tracemalloc_start, METH_FASTCALL, _tracemalloc_start__doc__},
+
+static PyObject *
+_tracemalloc_start_impl(PyObject *module, Py_ssize_t nframe);
+
+static PyObject *
+_tracemalloc_start(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ Py_ssize_t nframe = 1;
+
+ if (!_PyArg_ParseStack(args, nargs, "|n:start",
+ &nframe)) {
+ goto exit;
+ }
+
+ if (!_PyArg_NoStackKeywords("start", kwnames)) {
+ goto exit;
+ }
+ return_value = _tracemalloc_start_impl(module, nframe);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(_tracemalloc_stop__doc__,
+"stop($module, /)\n"
+"--\n"
+"\n"
+"Stop tracing Python memory allocations.\n"
+"\n"
+"Also clear traces of memory blocks allocated by Python.");
+
+#define _TRACEMALLOC_STOP_METHODDEF \
+ {"stop", (PyCFunction)_tracemalloc_stop, METH_NOARGS, _tracemalloc_stop__doc__},
+
+static PyObject *
+_tracemalloc_stop_impl(PyObject *module);
+
+static PyObject *
+_tracemalloc_stop(PyObject *module, PyObject *Py_UNUSED(ignored))
+{
+ return _tracemalloc_stop_impl(module);
+}
+
+PyDoc_STRVAR(_tracemalloc_get_traceback_limit__doc__,
+"get_traceback_limit($module, /)\n"
+"--\n"
+"\n"
+"Get the maximum number of frames stored in the traceback of a trace.\n"
+"\n"
+"By default, a trace of an allocated memory block only stores\n"
+"the most recent frame: the limit is 1.");
+
+#define _TRACEMALLOC_GET_TRACEBACK_LIMIT_METHODDEF \
+ {"get_traceback_limit", (PyCFunction)_tracemalloc_get_traceback_limit, METH_NOARGS, _tracemalloc_get_traceback_limit__doc__},
+
+static PyObject *
+_tracemalloc_get_traceback_limit_impl(PyObject *module);
+
+static PyObject *
+_tracemalloc_get_traceback_limit(PyObject *module, PyObject *Py_UNUSED(ignored))
+{
+ return _tracemalloc_get_traceback_limit_impl(module);
+}
+
+PyDoc_STRVAR(_tracemalloc_get_tracemalloc_memory__doc__,
+"get_tracemalloc_memory($module, /)\n"
+"--\n"
+"\n"
+"Get the memory usage in bytes of the tracemalloc module.\n"
+"\n"
+"This memory is used internally to trace memory allocations.");
+
+#define _TRACEMALLOC_GET_TRACEMALLOC_MEMORY_METHODDEF \
+ {"get_tracemalloc_memory", (PyCFunction)_tracemalloc_get_tracemalloc_memory, METH_NOARGS, _tracemalloc_get_tracemalloc_memory__doc__},
+
+static PyObject *
+_tracemalloc_get_tracemalloc_memory_impl(PyObject *module);
+
+static PyObject *
+_tracemalloc_get_tracemalloc_memory(PyObject *module, PyObject *Py_UNUSED(ignored))
+{
+ return _tracemalloc_get_tracemalloc_memory_impl(module);
+}
+
+PyDoc_STRVAR(_tracemalloc_get_traced_memory__doc__,
+"get_traced_memory($module, /)\n"
+"--\n"
+"\n"
+"Get the current size and peak size of memory blocks traced by tracemalloc.\n"
+"\n"
+"Returns a tuple: (current: int, peak: int).");
+
+#define _TRACEMALLOC_GET_TRACED_MEMORY_METHODDEF \
+ {"get_traced_memory", (PyCFunction)_tracemalloc_get_traced_memory, METH_NOARGS, _tracemalloc_get_traced_memory__doc__},
+
+static PyObject *
+_tracemalloc_get_traced_memory_impl(PyObject *module);
+
+static PyObject *
+_tracemalloc_get_traced_memory(PyObject *module, PyObject *Py_UNUSED(ignored))
+{
+ return _tracemalloc_get_traced_memory_impl(module);
+}
+/*[clinic end generated code: output=159ce5d627964f09 input=a9049054013a1b77]*/
diff --git a/Modules/clinic/_weakref.c.h b/Modules/clinic/_weakref.c.h
index ab84c304d9..d847867c4c 100644
--- a/Modules/clinic/_weakref.c.h
+++ b/Modules/clinic/_weakref.c.h
@@ -37,26 +37,30 @@ PyDoc_STRVAR(_weakref__remove_dead_weakref__doc__,
"Atomically remove key from dict if it points to a dead weakref.");
#define _WEAKREF__REMOVE_DEAD_WEAKREF_METHODDEF \
- {"_remove_dead_weakref", (PyCFunction)_weakref__remove_dead_weakref, METH_VARARGS, _weakref__remove_dead_weakref__doc__},
+ {"_remove_dead_weakref", (PyCFunction)_weakref__remove_dead_weakref, METH_FASTCALL, _weakref__remove_dead_weakref__doc__},
static PyObject *
_weakref__remove_dead_weakref_impl(PyObject *module, PyObject *dct,
PyObject *key);
static PyObject *
-_weakref__remove_dead_weakref(PyObject *module, PyObject *args)
+_weakref__remove_dead_weakref(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
PyObject *dct;
PyObject *key;
- if (!PyArg_ParseTuple(args, "O!O:_remove_dead_weakref",
+ if (!_PyArg_ParseStack(args, nargs, "O!O:_remove_dead_weakref",
&PyDict_Type, &dct, &key)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("_remove_dead_weakref", kwnames)) {
+ goto exit;
+ }
return_value = _weakref__remove_dead_weakref_impl(module, dct, key);
exit:
return return_value;
}
-/*[clinic end generated code: output=e860dd818a44bc9b input=a9049054013a1b77]*/
+/*[clinic end generated code: output=b686303486bdfefd input=a9049054013a1b77]*/
diff --git a/Modules/clinic/_winapi.c.h b/Modules/clinic/_winapi.c.h
index 5bfbaf0d56..431580293e 100644
--- a/Modules/clinic/_winapi.c.h
+++ b/Modules/clinic/_winapi.c.h
@@ -110,7 +110,7 @@ _winapi_ConnectNamedPipe(PyObject *module, PyObject **args, Py_ssize_t nargs, Py
HANDLE handle;
int use_overlapped = 0;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
&handle, &use_overlapped)) {
goto exit;
}
@@ -128,7 +128,7 @@ PyDoc_STRVAR(_winapi_CreateFile__doc__,
"\n");
#define _WINAPI_CREATEFILE_METHODDEF \
- {"CreateFile", (PyCFunction)_winapi_CreateFile, METH_VARARGS, _winapi_CreateFile__doc__},
+ {"CreateFile", (PyCFunction)_winapi_CreateFile, METH_FASTCALL, _winapi_CreateFile__doc__},
static HANDLE
_winapi_CreateFile_impl(PyObject *module, LPCTSTR file_name,
@@ -138,7 +138,7 @@ _winapi_CreateFile_impl(PyObject *module, LPCTSTR file_name,
DWORD flags_and_attributes, HANDLE template_file);
static PyObject *
-_winapi_CreateFile(PyObject *module, PyObject *args)
+_winapi_CreateFile(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
LPCTSTR file_name;
@@ -150,10 +150,14 @@ _winapi_CreateFile(PyObject *module, PyObject *args)
HANDLE template_file;
HANDLE _return_value;
- if (!PyArg_ParseTuple(args, "skk" F_POINTER "kk" F_HANDLE ":CreateFile",
+ if (!_PyArg_ParseStack(args, nargs, "skk" F_POINTER "kk" F_HANDLE ":CreateFile",
&file_name, &desired_access, &share_mode, &security_attributes, &creation_disposition, &flags_and_attributes, &template_file)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("CreateFile", kwnames)) {
+ goto exit;
+ }
_return_value = _winapi_CreateFile_impl(module, file_name, desired_access, share_mode, security_attributes, creation_disposition, flags_and_attributes, template_file);
if ((_return_value == INVALID_HANDLE_VALUE) && PyErr_Occurred()) {
goto exit;
@@ -173,23 +177,27 @@ PyDoc_STRVAR(_winapi_CreateJunction__doc__,
"\n");
#define _WINAPI_CREATEJUNCTION_METHODDEF \
- {"CreateJunction", (PyCFunction)_winapi_CreateJunction, METH_VARARGS, _winapi_CreateJunction__doc__},
+ {"CreateJunction", (PyCFunction)_winapi_CreateJunction, METH_FASTCALL, _winapi_CreateJunction__doc__},
static PyObject *
_winapi_CreateJunction_impl(PyObject *module, LPWSTR src_path,
LPWSTR dst_path);
static PyObject *
-_winapi_CreateJunction(PyObject *module, PyObject *args)
+_winapi_CreateJunction(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
LPWSTR src_path;
LPWSTR dst_path;
- if (!PyArg_ParseTuple(args, "uu:CreateJunction",
+ if (!_PyArg_ParseStack(args, nargs, "uu:CreateJunction",
&src_path, &dst_path)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("CreateJunction", kwnames)) {
+ goto exit;
+ }
return_value = _winapi_CreateJunction_impl(module, src_path, dst_path);
exit:
@@ -204,7 +212,7 @@ PyDoc_STRVAR(_winapi_CreateNamedPipe__doc__,
"\n");
#define _WINAPI_CREATENAMEDPIPE_METHODDEF \
- {"CreateNamedPipe", (PyCFunction)_winapi_CreateNamedPipe, METH_VARARGS, _winapi_CreateNamedPipe__doc__},
+ {"CreateNamedPipe", (PyCFunction)_winapi_CreateNamedPipe, METH_FASTCALL, _winapi_CreateNamedPipe__doc__},
static HANDLE
_winapi_CreateNamedPipe_impl(PyObject *module, LPCTSTR name, DWORD open_mode,
@@ -214,7 +222,7 @@ _winapi_CreateNamedPipe_impl(PyObject *module, LPCTSTR name, DWORD open_mode,
LPSECURITY_ATTRIBUTES security_attributes);
static PyObject *
-_winapi_CreateNamedPipe(PyObject *module, PyObject *args)
+_winapi_CreateNamedPipe(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
LPCTSTR name;
@@ -227,10 +235,14 @@ _winapi_CreateNamedPipe(PyObject *module, PyObject *args)
LPSECURITY_ATTRIBUTES security_attributes;
HANDLE _return_value;
- if (!PyArg_ParseTuple(args, "skkkkkk" F_POINTER ":CreateNamedPipe",
+ if (!_PyArg_ParseStack(args, nargs, "skkkkkk" F_POINTER ":CreateNamedPipe",
&name, &open_mode, &pipe_mode, &max_instances, &out_buffer_size, &in_buffer_size, &default_timeout, &security_attributes)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("CreateNamedPipe", kwnames)) {
+ goto exit;
+ }
_return_value = _winapi_CreateNamedPipe_impl(module, name, open_mode, pipe_mode, max_instances, out_buffer_size, in_buffer_size, default_timeout, security_attributes);
if ((_return_value == INVALID_HANDLE_VALUE) && PyErr_Occurred()) {
goto exit;
@@ -256,22 +268,26 @@ PyDoc_STRVAR(_winapi_CreatePipe__doc__,
"Returns a 2-tuple of handles, to the read and write ends of the pipe.");
#define _WINAPI_CREATEPIPE_METHODDEF \
- {"CreatePipe", (PyCFunction)_winapi_CreatePipe, METH_VARARGS, _winapi_CreatePipe__doc__},
+ {"CreatePipe", (PyCFunction)_winapi_CreatePipe, METH_FASTCALL, _winapi_CreatePipe__doc__},
static PyObject *
_winapi_CreatePipe_impl(PyObject *module, PyObject *pipe_attrs, DWORD size);
static PyObject *
-_winapi_CreatePipe(PyObject *module, PyObject *args)
+_winapi_CreatePipe(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
PyObject *pipe_attrs;
DWORD size;
- if (!PyArg_ParseTuple(args, "Ok:CreatePipe",
+ if (!_PyArg_ParseStack(args, nargs, "Ok:CreatePipe",
&pipe_attrs, &size)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("CreatePipe", kwnames)) {
+ goto exit;
+ }
return_value = _winapi_CreatePipe_impl(module, pipe_attrs, size);
exit:
@@ -295,7 +311,7 @@ PyDoc_STRVAR(_winapi_CreateProcess__doc__,
"process ID, and thread ID.");
#define _WINAPI_CREATEPROCESS_METHODDEF \
- {"CreateProcess", (PyCFunction)_winapi_CreateProcess, METH_VARARGS, _winapi_CreateProcess__doc__},
+ {"CreateProcess", (PyCFunction)_winapi_CreateProcess, METH_FASTCALL, _winapi_CreateProcess__doc__},
static PyObject *
_winapi_CreateProcess_impl(PyObject *module, Py_UNICODE *application_name,
@@ -306,7 +322,7 @@ _winapi_CreateProcess_impl(PyObject *module, Py_UNICODE *application_name,
PyObject *startup_info);
static PyObject *
-_winapi_CreateProcess(PyObject *module, PyObject *args)
+_winapi_CreateProcess(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
Py_UNICODE *application_name;
@@ -319,10 +335,14 @@ _winapi_CreateProcess(PyObject *module, PyObject *args)
Py_UNICODE *current_directory;
PyObject *startup_info;
- if (!PyArg_ParseTuple(args, "ZZOOikOZO:CreateProcess",
+ if (!_PyArg_ParseStack(args, nargs, "ZZOOikOZO:CreateProcess",
&application_name, &command_line, &proc_attrs, &thread_attrs, &inherit_handles, &creation_flags, &env_mapping, &current_directory, &startup_info)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("CreateProcess", kwnames)) {
+ goto exit;
+ }
return_value = _winapi_CreateProcess_impl(module, application_name, command_line, proc_attrs, thread_attrs, inherit_handles, creation_flags, env_mapping, current_directory, startup_info);
exit:
@@ -342,7 +362,7 @@ PyDoc_STRVAR(_winapi_DuplicateHandle__doc__,
"through both handles.");
#define _WINAPI_DUPLICATEHANDLE_METHODDEF \
- {"DuplicateHandle", (PyCFunction)_winapi_DuplicateHandle, METH_VARARGS, _winapi_DuplicateHandle__doc__},
+ {"DuplicateHandle", (PyCFunction)_winapi_DuplicateHandle, METH_FASTCALL, _winapi_DuplicateHandle__doc__},
static HANDLE
_winapi_DuplicateHandle_impl(PyObject *module, HANDLE source_process_handle,
@@ -352,7 +372,7 @@ _winapi_DuplicateHandle_impl(PyObject *module, HANDLE source_process_handle,
DWORD options);
static PyObject *
-_winapi_DuplicateHandle(PyObject *module, PyObject *args)
+_winapi_DuplicateHandle(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
HANDLE source_process_handle;
@@ -363,10 +383,14 @@ _winapi_DuplicateHandle(PyObject *module, PyObject *args)
DWORD options = 0;
HANDLE _return_value;
- if (!PyArg_ParseTuple(args, "" F_HANDLE "" F_HANDLE "" F_HANDLE "ki|k:DuplicateHandle",
+ if (!_PyArg_ParseStack(args, nargs, "" F_HANDLE "" F_HANDLE "" F_HANDLE "ki|k:DuplicateHandle",
&source_process_handle, &source_handle, &target_process_handle, &desired_access, &inherit_handle, &options)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("DuplicateHandle", kwnames)) {
+ goto exit;
+ }
_return_value = _winapi_DuplicateHandle_impl(module, source_process_handle, source_handle, target_process_handle, desired_access, inherit_handle, options);
if ((_return_value == INVALID_HANDLE_VALUE) && PyErr_Occurred()) {
goto exit;
@@ -604,14 +628,14 @@ PyDoc_STRVAR(_winapi_OpenProcess__doc__,
"\n");
#define _WINAPI_OPENPROCESS_METHODDEF \
- {"OpenProcess", (PyCFunction)_winapi_OpenProcess, METH_VARARGS, _winapi_OpenProcess__doc__},
+ {"OpenProcess", (PyCFunction)_winapi_OpenProcess, METH_FASTCALL, _winapi_OpenProcess__doc__},
static HANDLE
_winapi_OpenProcess_impl(PyObject *module, DWORD desired_access,
BOOL inherit_handle, DWORD process_id);
static PyObject *
-_winapi_OpenProcess(PyObject *module, PyObject *args)
+_winapi_OpenProcess(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
DWORD desired_access;
@@ -619,10 +643,14 @@ _winapi_OpenProcess(PyObject *module, PyObject *args)
DWORD process_id;
HANDLE _return_value;
- if (!PyArg_ParseTuple(args, "kik:OpenProcess",
+ if (!_PyArg_ParseStack(args, nargs, "kik:OpenProcess",
&desired_access, &inherit_handle, &process_id)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("OpenProcess", kwnames)) {
+ goto exit;
+ }
_return_value = _winapi_OpenProcess_impl(module, desired_access, inherit_handle, process_id);
if ((_return_value == INVALID_HANDLE_VALUE) && PyErr_Occurred()) {
goto exit;
@@ -642,22 +670,26 @@ PyDoc_STRVAR(_winapi_PeekNamedPipe__doc__,
"\n");
#define _WINAPI_PEEKNAMEDPIPE_METHODDEF \
- {"PeekNamedPipe", (PyCFunction)_winapi_PeekNamedPipe, METH_VARARGS, _winapi_PeekNamedPipe__doc__},
+ {"PeekNamedPipe", (PyCFunction)_winapi_PeekNamedPipe, METH_FASTCALL, _winapi_PeekNamedPipe__doc__},
static PyObject *
_winapi_PeekNamedPipe_impl(PyObject *module, HANDLE handle, int size);
static PyObject *
-_winapi_PeekNamedPipe(PyObject *module, PyObject *args)
+_winapi_PeekNamedPipe(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
HANDLE handle;
int size = 0;
- if (!PyArg_ParseTuple(args, "" F_HANDLE "|i:PeekNamedPipe",
+ if (!_PyArg_ParseStack(args, nargs, "" F_HANDLE "|i:PeekNamedPipe",
&handle, &size)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("PeekNamedPipe", kwnames)) {
+ goto exit;
+ }
return_value = _winapi_PeekNamedPipe_impl(module, handle, size);
exit:
@@ -686,7 +718,7 @@ _winapi_ReadFile(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *
int size;
int use_overlapped = 0;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
&handle, &size, &use_overlapped)) {
goto exit;
}
@@ -703,7 +735,7 @@ PyDoc_STRVAR(_winapi_SetNamedPipeHandleState__doc__,
"\n");
#define _WINAPI_SETNAMEDPIPEHANDLESTATE_METHODDEF \
- {"SetNamedPipeHandleState", (PyCFunction)_winapi_SetNamedPipeHandleState, METH_VARARGS, _winapi_SetNamedPipeHandleState__doc__},
+ {"SetNamedPipeHandleState", (PyCFunction)_winapi_SetNamedPipeHandleState, METH_FASTCALL, _winapi_SetNamedPipeHandleState__doc__},
static PyObject *
_winapi_SetNamedPipeHandleState_impl(PyObject *module, HANDLE named_pipe,
@@ -712,7 +744,7 @@ _winapi_SetNamedPipeHandleState_impl(PyObject *module, HANDLE named_pipe,
PyObject *collect_data_timeout);
static PyObject *
-_winapi_SetNamedPipeHandleState(PyObject *module, PyObject *args)
+_winapi_SetNamedPipeHandleState(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
HANDLE named_pipe;
@@ -720,10 +752,14 @@ _winapi_SetNamedPipeHandleState(PyObject *module, PyObject *args)
PyObject *max_collection_count;
PyObject *collect_data_timeout;
- if (!PyArg_ParseTuple(args, "" F_HANDLE "OOO:SetNamedPipeHandleState",
+ if (!_PyArg_ParseStack(args, nargs, "" F_HANDLE "OOO:SetNamedPipeHandleState",
&named_pipe, &mode, &max_collection_count, &collect_data_timeout)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("SetNamedPipeHandleState", kwnames)) {
+ goto exit;
+ }
return_value = _winapi_SetNamedPipeHandleState_impl(module, named_pipe, mode, max_collection_count, collect_data_timeout);
exit:
@@ -737,23 +773,27 @@ PyDoc_STRVAR(_winapi_TerminateProcess__doc__,
"Terminate the specified process and all of its threads.");
#define _WINAPI_TERMINATEPROCESS_METHODDEF \
- {"TerminateProcess", (PyCFunction)_winapi_TerminateProcess, METH_VARARGS, _winapi_TerminateProcess__doc__},
+ {"TerminateProcess", (PyCFunction)_winapi_TerminateProcess, METH_FASTCALL, _winapi_TerminateProcess__doc__},
static PyObject *
_winapi_TerminateProcess_impl(PyObject *module, HANDLE handle,
UINT exit_code);
static PyObject *
-_winapi_TerminateProcess(PyObject *module, PyObject *args)
+_winapi_TerminateProcess(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
HANDLE handle;
UINT exit_code;
- if (!PyArg_ParseTuple(args, "" F_HANDLE "I:TerminateProcess",
+ if (!_PyArg_ParseStack(args, nargs, "" F_HANDLE "I:TerminateProcess",
&handle, &exit_code)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("TerminateProcess", kwnames)) {
+ goto exit;
+ }
return_value = _winapi_TerminateProcess_impl(module, handle, exit_code);
exit:
@@ -766,22 +806,26 @@ PyDoc_STRVAR(_winapi_WaitNamedPipe__doc__,
"\n");
#define _WINAPI_WAITNAMEDPIPE_METHODDEF \
- {"WaitNamedPipe", (PyCFunction)_winapi_WaitNamedPipe, METH_VARARGS, _winapi_WaitNamedPipe__doc__},
+ {"WaitNamedPipe", (PyCFunction)_winapi_WaitNamedPipe, METH_FASTCALL, _winapi_WaitNamedPipe__doc__},
static PyObject *
_winapi_WaitNamedPipe_impl(PyObject *module, LPCTSTR name, DWORD timeout);
static PyObject *
-_winapi_WaitNamedPipe(PyObject *module, PyObject *args)
+_winapi_WaitNamedPipe(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
LPCTSTR name;
DWORD timeout;
- if (!PyArg_ParseTuple(args, "sk:WaitNamedPipe",
+ if (!_PyArg_ParseStack(args, nargs, "sk:WaitNamedPipe",
&name, &timeout)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("WaitNamedPipe", kwnames)) {
+ goto exit;
+ }
return_value = _winapi_WaitNamedPipe_impl(module, name, timeout);
exit:
@@ -795,24 +839,28 @@ PyDoc_STRVAR(_winapi_WaitForMultipleObjects__doc__,
"\n");
#define _WINAPI_WAITFORMULTIPLEOBJECTS_METHODDEF \
- {"WaitForMultipleObjects", (PyCFunction)_winapi_WaitForMultipleObjects, METH_VARARGS, _winapi_WaitForMultipleObjects__doc__},
+ {"WaitForMultipleObjects", (PyCFunction)_winapi_WaitForMultipleObjects, METH_FASTCALL, _winapi_WaitForMultipleObjects__doc__},
static PyObject *
_winapi_WaitForMultipleObjects_impl(PyObject *module, PyObject *handle_seq,
BOOL wait_flag, DWORD milliseconds);
static PyObject *
-_winapi_WaitForMultipleObjects(PyObject *module, PyObject *args)
+_winapi_WaitForMultipleObjects(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
PyObject *handle_seq;
BOOL wait_flag;
DWORD milliseconds = INFINITE;
- if (!PyArg_ParseTuple(args, "Oi|k:WaitForMultipleObjects",
+ if (!_PyArg_ParseStack(args, nargs, "Oi|k:WaitForMultipleObjects",
&handle_seq, &wait_flag, &milliseconds)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("WaitForMultipleObjects", kwnames)) {
+ goto exit;
+ }
return_value = _winapi_WaitForMultipleObjects_impl(module, handle_seq, wait_flag, milliseconds);
exit:
@@ -830,24 +878,28 @@ PyDoc_STRVAR(_winapi_WaitForSingleObject__doc__,
"in milliseconds.");
#define _WINAPI_WAITFORSINGLEOBJECT_METHODDEF \
- {"WaitForSingleObject", (PyCFunction)_winapi_WaitForSingleObject, METH_VARARGS, _winapi_WaitForSingleObject__doc__},
+ {"WaitForSingleObject", (PyCFunction)_winapi_WaitForSingleObject, METH_FASTCALL, _winapi_WaitForSingleObject__doc__},
static long
_winapi_WaitForSingleObject_impl(PyObject *module, HANDLE handle,
DWORD milliseconds);
static PyObject *
-_winapi_WaitForSingleObject(PyObject *module, PyObject *args)
+_winapi_WaitForSingleObject(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
HANDLE handle;
DWORD milliseconds;
long _return_value;
- if (!PyArg_ParseTuple(args, "" F_HANDLE "k:WaitForSingleObject",
+ if (!_PyArg_ParseStack(args, nargs, "" F_HANDLE "k:WaitForSingleObject",
&handle, &milliseconds)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("WaitForSingleObject", kwnames)) {
+ goto exit;
+ }
_return_value = _winapi_WaitForSingleObject_impl(module, handle, milliseconds);
if ((_return_value == -1) && PyErr_Occurred()) {
goto exit;
@@ -880,7 +932,7 @@ _winapi_WriteFile(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject
PyObject *buffer;
int use_overlapped = 0;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
&handle, &buffer, &use_overlapped)) {
goto exit;
}
@@ -889,4 +941,4 @@ _winapi_WriteFile(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject
exit:
return return_value;
}
-/*[clinic end generated code: output=46d6382a6662c4a9 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=2beb984508fb040a input=a9049054013a1b77]*/
diff --git a/Modules/clinic/arraymodule.c.h b/Modules/clinic/arraymodule.c.h
index 3b9fcdab0a..2a6767458e 100644
--- a/Modules/clinic/arraymodule.c.h
+++ b/Modules/clinic/arraymodule.c.h
@@ -65,21 +65,25 @@ PyDoc_STRVAR(array_array_pop__doc__,
"i defaults to -1.");
#define ARRAY_ARRAY_POP_METHODDEF \
- {"pop", (PyCFunction)array_array_pop, METH_VARARGS, array_array_pop__doc__},
+ {"pop", (PyCFunction)array_array_pop, METH_FASTCALL, array_array_pop__doc__},
static PyObject *
array_array_pop_impl(arrayobject *self, Py_ssize_t i);
static PyObject *
-array_array_pop(arrayobject *self, PyObject *args)
+array_array_pop(arrayobject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
Py_ssize_t i = -1;
- if (!PyArg_ParseTuple(args, "|n:pop",
+ if (!_PyArg_ParseStack(args, nargs, "|n:pop",
&i)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("pop", kwnames)) {
+ goto exit;
+ }
return_value = array_array_pop_impl(self, i);
exit:
@@ -102,22 +106,26 @@ PyDoc_STRVAR(array_array_insert__doc__,
"Insert a new item v into the array before position i.");
#define ARRAY_ARRAY_INSERT_METHODDEF \
- {"insert", (PyCFunction)array_array_insert, METH_VARARGS, array_array_insert__doc__},
+ {"insert", (PyCFunction)array_array_insert, METH_FASTCALL, array_array_insert__doc__},
static PyObject *
array_array_insert_impl(arrayobject *self, Py_ssize_t i, PyObject *v);
static PyObject *
-array_array_insert(arrayobject *self, PyObject *args)
+array_array_insert(arrayobject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
Py_ssize_t i;
PyObject *v;
- if (!PyArg_ParseTuple(args, "nO:insert",
+ if (!_PyArg_ParseStack(args, nargs, "nO:insert",
&i, &v)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("insert", kwnames)) {
+ goto exit;
+ }
return_value = array_array_insert_impl(self, i, v);
exit:
@@ -200,22 +208,26 @@ PyDoc_STRVAR(array_array_fromfile__doc__,
"Read n objects from the file object f and append them to the end of the array.");
#define ARRAY_ARRAY_FROMFILE_METHODDEF \
- {"fromfile", (PyCFunction)array_array_fromfile, METH_VARARGS, array_array_fromfile__doc__},
+ {"fromfile", (PyCFunction)array_array_fromfile, METH_FASTCALL, array_array_fromfile__doc__},
static PyObject *
array_array_fromfile_impl(arrayobject *self, PyObject *f, Py_ssize_t n);
static PyObject *
-array_array_fromfile(arrayobject *self, PyObject *args)
+array_array_fromfile(arrayobject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
PyObject *f;
Py_ssize_t n;
- if (!PyArg_ParseTuple(args, "On:fromfile",
+ if (!_PyArg_ParseStack(args, nargs, "On:fromfile",
&f, &n)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("fromfile", kwnames)) {
+ goto exit;
+ }
return_value = array_array_fromfile_impl(self, f, n);
exit:
@@ -443,7 +455,7 @@ PyDoc_STRVAR(array__array_reconstructor__doc__,
"Internal. Used for pickling support.");
#define ARRAY__ARRAY_RECONSTRUCTOR_METHODDEF \
- {"_array_reconstructor", (PyCFunction)array__array_reconstructor, METH_VARARGS, array__array_reconstructor__doc__},
+ {"_array_reconstructor", (PyCFunction)array__array_reconstructor, METH_FASTCALL, array__array_reconstructor__doc__},
static PyObject *
array__array_reconstructor_impl(PyObject *module, PyTypeObject *arraytype,
@@ -452,7 +464,7 @@ array__array_reconstructor_impl(PyObject *module, PyTypeObject *arraytype,
PyObject *items);
static PyObject *
-array__array_reconstructor(PyObject *module, PyObject *args)
+array__array_reconstructor(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
PyTypeObject *arraytype;
@@ -460,10 +472,14 @@ array__array_reconstructor(PyObject *module, PyObject *args)
enum machine_format_code mformat_code;
PyObject *items;
- if (!PyArg_ParseTuple(args, "OCiO:_array_reconstructor",
+ if (!_PyArg_ParseStack(args, nargs, "OCiO:_array_reconstructor",
&arraytype, &typecode, &mformat_code, &items)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("_array_reconstructor", kwnames)) {
+ goto exit;
+ }
return_value = array__array_reconstructor_impl(module, arraytype, typecode, mformat_code, items);
exit:
@@ -505,4 +521,4 @@ PyDoc_STRVAR(array_arrayiterator___setstate____doc__,
#define ARRAY_ARRAYITERATOR___SETSTATE___METHODDEF \
{"__setstate__", (PyCFunction)array_arrayiterator___setstate__, METH_O, array_arrayiterator___setstate____doc__},
-/*[clinic end generated code: output=b2054fb764c8cc64 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=d186a7553c1f1a41 input=a9049054013a1b77]*/
diff --git a/Modules/clinic/audioop.c.h b/Modules/clinic/audioop.c.h
index be4b718843..6ba1172e95 100644
--- a/Modules/clinic/audioop.c.h
+++ b/Modules/clinic/audioop.c.h
@@ -9,24 +9,28 @@ PyDoc_STRVAR(audioop_getsample__doc__,
"Return the value of sample index from the fragment.");
#define AUDIOOP_GETSAMPLE_METHODDEF \
- {"getsample", (PyCFunction)audioop_getsample, METH_VARARGS, audioop_getsample__doc__},
+ {"getsample", (PyCFunction)audioop_getsample, METH_FASTCALL, audioop_getsample__doc__},
static PyObject *
audioop_getsample_impl(PyObject *module, Py_buffer *fragment, int width,
Py_ssize_t index);
static PyObject *
-audioop_getsample(PyObject *module, PyObject *args)
+audioop_getsample(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
Py_buffer fragment = {NULL, NULL};
int width;
Py_ssize_t index;
- if (!PyArg_ParseTuple(args, "y*in:getsample",
+ if (!_PyArg_ParseStack(args, nargs, "y*in:getsample",
&fragment, &width, &index)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("getsample", kwnames)) {
+ goto exit;
+ }
return_value = audioop_getsample_impl(module, &fragment, width, index);
exit:
@@ -45,22 +49,26 @@ PyDoc_STRVAR(audioop_max__doc__,
"Return the maximum of the absolute value of all samples in a fragment.");
#define AUDIOOP_MAX_METHODDEF \
- {"max", (PyCFunction)audioop_max, METH_VARARGS, audioop_max__doc__},
+ {"max", (PyCFunction)audioop_max, METH_FASTCALL, audioop_max__doc__},
static PyObject *
audioop_max_impl(PyObject *module, Py_buffer *fragment, int width);
static PyObject *
-audioop_max(PyObject *module, PyObject *args)
+audioop_max(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
Py_buffer fragment = {NULL, NULL};
int width;
- if (!PyArg_ParseTuple(args, "y*i:max",
+ if (!_PyArg_ParseStack(args, nargs, "y*i:max",
&fragment, &width)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("max", kwnames)) {
+ goto exit;
+ }
return_value = audioop_max_impl(module, &fragment, width);
exit:
@@ -79,22 +87,26 @@ PyDoc_STRVAR(audioop_minmax__doc__,
"Return the minimum and maximum values of all samples in the sound fragment.");
#define AUDIOOP_MINMAX_METHODDEF \
- {"minmax", (PyCFunction)audioop_minmax, METH_VARARGS, audioop_minmax__doc__},
+ {"minmax", (PyCFunction)audioop_minmax, METH_FASTCALL, audioop_minmax__doc__},
static PyObject *
audioop_minmax_impl(PyObject *module, Py_buffer *fragment, int width);
static PyObject *
-audioop_minmax(PyObject *module, PyObject *args)
+audioop_minmax(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
Py_buffer fragment = {NULL, NULL};
int width;
- if (!PyArg_ParseTuple(args, "y*i:minmax",
+ if (!_PyArg_ParseStack(args, nargs, "y*i:minmax",
&fragment, &width)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("minmax", kwnames)) {
+ goto exit;
+ }
return_value = audioop_minmax_impl(module, &fragment, width);
exit:
@@ -113,22 +125,26 @@ PyDoc_STRVAR(audioop_avg__doc__,
"Return the average over all samples in the fragment.");
#define AUDIOOP_AVG_METHODDEF \
- {"avg", (PyCFunction)audioop_avg, METH_VARARGS, audioop_avg__doc__},
+ {"avg", (PyCFunction)audioop_avg, METH_FASTCALL, audioop_avg__doc__},
static PyObject *
audioop_avg_impl(PyObject *module, Py_buffer *fragment, int width);
static PyObject *
-audioop_avg(PyObject *module, PyObject *args)
+audioop_avg(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
Py_buffer fragment = {NULL, NULL};
int width;
- if (!PyArg_ParseTuple(args, "y*i:avg",
+ if (!_PyArg_ParseStack(args, nargs, "y*i:avg",
&fragment, &width)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("avg", kwnames)) {
+ goto exit;
+ }
return_value = audioop_avg_impl(module, &fragment, width);
exit:
@@ -147,22 +163,26 @@ PyDoc_STRVAR(audioop_rms__doc__,
"Return the root-mean-square of the fragment, i.e. sqrt(sum(S_i^2)/n).");
#define AUDIOOP_RMS_METHODDEF \
- {"rms", (PyCFunction)audioop_rms, METH_VARARGS, audioop_rms__doc__},
+ {"rms", (PyCFunction)audioop_rms, METH_FASTCALL, audioop_rms__doc__},
static PyObject *
audioop_rms_impl(PyObject *module, Py_buffer *fragment, int width);
static PyObject *
-audioop_rms(PyObject *module, PyObject *args)
+audioop_rms(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
Py_buffer fragment = {NULL, NULL};
int width;
- if (!PyArg_ParseTuple(args, "y*i:rms",
+ if (!_PyArg_ParseStack(args, nargs, "y*i:rms",
&fragment, &width)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("rms", kwnames)) {
+ goto exit;
+ }
return_value = audioop_rms_impl(module, &fragment, width);
exit:
@@ -181,23 +201,27 @@ PyDoc_STRVAR(audioop_findfit__doc__,
"Try to match reference as well as possible to a portion of fragment.");
#define AUDIOOP_FINDFIT_METHODDEF \
- {"findfit", (PyCFunction)audioop_findfit, METH_VARARGS, audioop_findfit__doc__},
+ {"findfit", (PyCFunction)audioop_findfit, METH_FASTCALL, audioop_findfit__doc__},
static PyObject *
audioop_findfit_impl(PyObject *module, Py_buffer *fragment,
Py_buffer *reference);
static PyObject *
-audioop_findfit(PyObject *module, PyObject *args)
+audioop_findfit(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
Py_buffer fragment = {NULL, NULL};
Py_buffer reference = {NULL, NULL};
- if (!PyArg_ParseTuple(args, "y*y*:findfit",
+ if (!_PyArg_ParseStack(args, nargs, "y*y*:findfit",
&fragment, &reference)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("findfit", kwnames)) {
+ goto exit;
+ }
return_value = audioop_findfit_impl(module, &fragment, &reference);
exit:
@@ -220,23 +244,27 @@ PyDoc_STRVAR(audioop_findfactor__doc__,
"Return a factor F such that rms(add(fragment, mul(reference, -F))) is minimal.");
#define AUDIOOP_FINDFACTOR_METHODDEF \
- {"findfactor", (PyCFunction)audioop_findfactor, METH_VARARGS, audioop_findfactor__doc__},
+ {"findfactor", (PyCFunction)audioop_findfactor, METH_FASTCALL, audioop_findfactor__doc__},
static PyObject *
audioop_findfactor_impl(PyObject *module, Py_buffer *fragment,
Py_buffer *reference);
static PyObject *
-audioop_findfactor(PyObject *module, PyObject *args)
+audioop_findfactor(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
Py_buffer fragment = {NULL, NULL};
Py_buffer reference = {NULL, NULL};
- if (!PyArg_ParseTuple(args, "y*y*:findfactor",
+ if (!_PyArg_ParseStack(args, nargs, "y*y*:findfactor",
&fragment, &reference)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("findfactor", kwnames)) {
+ goto exit;
+ }
return_value = audioop_findfactor_impl(module, &fragment, &reference);
exit:
@@ -259,23 +287,27 @@ PyDoc_STRVAR(audioop_findmax__doc__,
"Search fragment for a slice of specified number of samples with maximum energy.");
#define AUDIOOP_FINDMAX_METHODDEF \
- {"findmax", (PyCFunction)audioop_findmax, METH_VARARGS, audioop_findmax__doc__},
+ {"findmax", (PyCFunction)audioop_findmax, METH_FASTCALL, audioop_findmax__doc__},
static PyObject *
audioop_findmax_impl(PyObject *module, Py_buffer *fragment,
Py_ssize_t length);
static PyObject *
-audioop_findmax(PyObject *module, PyObject *args)
+audioop_findmax(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
Py_buffer fragment = {NULL, NULL};
Py_ssize_t length;
- if (!PyArg_ParseTuple(args, "y*n:findmax",
+ if (!_PyArg_ParseStack(args, nargs, "y*n:findmax",
&fragment, &length)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("findmax", kwnames)) {
+ goto exit;
+ }
return_value = audioop_findmax_impl(module, &fragment, length);
exit:
@@ -294,22 +326,26 @@ PyDoc_STRVAR(audioop_avgpp__doc__,
"Return the average peak-peak value over all samples in the fragment.");
#define AUDIOOP_AVGPP_METHODDEF \
- {"avgpp", (PyCFunction)audioop_avgpp, METH_VARARGS, audioop_avgpp__doc__},
+ {"avgpp", (PyCFunction)audioop_avgpp, METH_FASTCALL, audioop_avgpp__doc__},
static PyObject *
audioop_avgpp_impl(PyObject *module, Py_buffer *fragment, int width);
static PyObject *
-audioop_avgpp(PyObject *module, PyObject *args)
+audioop_avgpp(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
Py_buffer fragment = {NULL, NULL};
int width;
- if (!PyArg_ParseTuple(args, "y*i:avgpp",
+ if (!_PyArg_ParseStack(args, nargs, "y*i:avgpp",
&fragment, &width)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("avgpp", kwnames)) {
+ goto exit;
+ }
return_value = audioop_avgpp_impl(module, &fragment, width);
exit:
@@ -328,22 +364,26 @@ PyDoc_STRVAR(audioop_maxpp__doc__,
"Return the maximum peak-peak value in the sound fragment.");
#define AUDIOOP_MAXPP_METHODDEF \
- {"maxpp", (PyCFunction)audioop_maxpp, METH_VARARGS, audioop_maxpp__doc__},
+ {"maxpp", (PyCFunction)audioop_maxpp, METH_FASTCALL, audioop_maxpp__doc__},
static PyObject *
audioop_maxpp_impl(PyObject *module, Py_buffer *fragment, int width);
static PyObject *
-audioop_maxpp(PyObject *module, PyObject *args)
+audioop_maxpp(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
Py_buffer fragment = {NULL, NULL};
int width;
- if (!PyArg_ParseTuple(args, "y*i:maxpp",
+ if (!_PyArg_ParseStack(args, nargs, "y*i:maxpp",
&fragment, &width)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("maxpp", kwnames)) {
+ goto exit;
+ }
return_value = audioop_maxpp_impl(module, &fragment, width);
exit:
@@ -362,22 +402,26 @@ PyDoc_STRVAR(audioop_cross__doc__,
"Return the number of zero crossings in the fragment passed as an argument.");
#define AUDIOOP_CROSS_METHODDEF \
- {"cross", (PyCFunction)audioop_cross, METH_VARARGS, audioop_cross__doc__},
+ {"cross", (PyCFunction)audioop_cross, METH_FASTCALL, audioop_cross__doc__},
static PyObject *
audioop_cross_impl(PyObject *module, Py_buffer *fragment, int width);
static PyObject *
-audioop_cross(PyObject *module, PyObject *args)
+audioop_cross(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
Py_buffer fragment = {NULL, NULL};
int width;
- if (!PyArg_ParseTuple(args, "y*i:cross",
+ if (!_PyArg_ParseStack(args, nargs, "y*i:cross",
&fragment, &width)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("cross", kwnames)) {
+ goto exit;
+ }
return_value = audioop_cross_impl(module, &fragment, width);
exit:
@@ -396,24 +440,28 @@ PyDoc_STRVAR(audioop_mul__doc__,
"Return a fragment that has all samples in the original fragment multiplied by the floating-point value factor.");
#define AUDIOOP_MUL_METHODDEF \
- {"mul", (PyCFunction)audioop_mul, METH_VARARGS, audioop_mul__doc__},
+ {"mul", (PyCFunction)audioop_mul, METH_FASTCALL, audioop_mul__doc__},
static PyObject *
audioop_mul_impl(PyObject *module, Py_buffer *fragment, int width,
double factor);
static PyObject *
-audioop_mul(PyObject *module, PyObject *args)
+audioop_mul(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
Py_buffer fragment = {NULL, NULL};
int width;
double factor;
- if (!PyArg_ParseTuple(args, "y*id:mul",
+ if (!_PyArg_ParseStack(args, nargs, "y*id:mul",
&fragment, &width, &factor)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("mul", kwnames)) {
+ goto exit;
+ }
return_value = audioop_mul_impl(module, &fragment, width, factor);
exit:
@@ -432,14 +480,14 @@ PyDoc_STRVAR(audioop_tomono__doc__,
"Convert a stereo fragment to a mono fragment.");
#define AUDIOOP_TOMONO_METHODDEF \
- {"tomono", (PyCFunction)audioop_tomono, METH_VARARGS, audioop_tomono__doc__},
+ {"tomono", (PyCFunction)audioop_tomono, METH_FASTCALL, audioop_tomono__doc__},
static PyObject *
audioop_tomono_impl(PyObject *module, Py_buffer *fragment, int width,
double lfactor, double rfactor);
static PyObject *
-audioop_tomono(PyObject *module, PyObject *args)
+audioop_tomono(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
Py_buffer fragment = {NULL, NULL};
@@ -447,10 +495,14 @@ audioop_tomono(PyObject *module, PyObject *args)
double lfactor;
double rfactor;
- if (!PyArg_ParseTuple(args, "y*idd:tomono",
+ if (!_PyArg_ParseStack(args, nargs, "y*idd:tomono",
&fragment, &width, &lfactor, &rfactor)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("tomono", kwnames)) {
+ goto exit;
+ }
return_value = audioop_tomono_impl(module, &fragment, width, lfactor, rfactor);
exit:
@@ -469,14 +521,14 @@ PyDoc_STRVAR(audioop_tostereo__doc__,
"Generate a stereo fragment from a mono fragment.");
#define AUDIOOP_TOSTEREO_METHODDEF \
- {"tostereo", (PyCFunction)audioop_tostereo, METH_VARARGS, audioop_tostereo__doc__},
+ {"tostereo", (PyCFunction)audioop_tostereo, METH_FASTCALL, audioop_tostereo__doc__},
static PyObject *
audioop_tostereo_impl(PyObject *module, Py_buffer *fragment, int width,
double lfactor, double rfactor);
static PyObject *
-audioop_tostereo(PyObject *module, PyObject *args)
+audioop_tostereo(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
Py_buffer fragment = {NULL, NULL};
@@ -484,10 +536,14 @@ audioop_tostereo(PyObject *module, PyObject *args)
double lfactor;
double rfactor;
- if (!PyArg_ParseTuple(args, "y*idd:tostereo",
+ if (!_PyArg_ParseStack(args, nargs, "y*idd:tostereo",
&fragment, &width, &lfactor, &rfactor)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("tostereo", kwnames)) {
+ goto exit;
+ }
return_value = audioop_tostereo_impl(module, &fragment, width, lfactor, rfactor);
exit:
@@ -506,24 +562,28 @@ PyDoc_STRVAR(audioop_add__doc__,
"Return a fragment which is the addition of the two samples passed as parameters.");
#define AUDIOOP_ADD_METHODDEF \
- {"add", (PyCFunction)audioop_add, METH_VARARGS, audioop_add__doc__},
+ {"add", (PyCFunction)audioop_add, METH_FASTCALL, audioop_add__doc__},
static PyObject *
audioop_add_impl(PyObject *module, Py_buffer *fragment1,
Py_buffer *fragment2, int width);
static PyObject *
-audioop_add(PyObject *module, PyObject *args)
+audioop_add(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
Py_buffer fragment1 = {NULL, NULL};
Py_buffer fragment2 = {NULL, NULL};
int width;
- if (!PyArg_ParseTuple(args, "y*y*i:add",
+ if (!_PyArg_ParseStack(args, nargs, "y*y*i:add",
&fragment1, &fragment2, &width)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("add", kwnames)) {
+ goto exit;
+ }
return_value = audioop_add_impl(module, &fragment1, &fragment2, width);
exit:
@@ -546,23 +606,27 @@ PyDoc_STRVAR(audioop_bias__doc__,
"Return a fragment that is the original fragment with a bias added to each sample.");
#define AUDIOOP_BIAS_METHODDEF \
- {"bias", (PyCFunction)audioop_bias, METH_VARARGS, audioop_bias__doc__},
+ {"bias", (PyCFunction)audioop_bias, METH_FASTCALL, audioop_bias__doc__},
static PyObject *
audioop_bias_impl(PyObject *module, Py_buffer *fragment, int width, int bias);
static PyObject *
-audioop_bias(PyObject *module, PyObject *args)
+audioop_bias(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
Py_buffer fragment = {NULL, NULL};
int width;
int bias;
- if (!PyArg_ParseTuple(args, "y*ii:bias",
+ if (!_PyArg_ParseStack(args, nargs, "y*ii:bias",
&fragment, &width, &bias)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("bias", kwnames)) {
+ goto exit;
+ }
return_value = audioop_bias_impl(module, &fragment, width, bias);
exit:
@@ -581,22 +645,26 @@ PyDoc_STRVAR(audioop_reverse__doc__,
"Reverse the samples in a fragment and returns the modified fragment.");
#define AUDIOOP_REVERSE_METHODDEF \
- {"reverse", (PyCFunction)audioop_reverse, METH_VARARGS, audioop_reverse__doc__},
+ {"reverse", (PyCFunction)audioop_reverse, METH_FASTCALL, audioop_reverse__doc__},
static PyObject *
audioop_reverse_impl(PyObject *module, Py_buffer *fragment, int width);
static PyObject *
-audioop_reverse(PyObject *module, PyObject *args)
+audioop_reverse(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
Py_buffer fragment = {NULL, NULL};
int width;
- if (!PyArg_ParseTuple(args, "y*i:reverse",
+ if (!_PyArg_ParseStack(args, nargs, "y*i:reverse",
&fragment, &width)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("reverse", kwnames)) {
+ goto exit;
+ }
return_value = audioop_reverse_impl(module, &fragment, width);
exit:
@@ -615,22 +683,26 @@ PyDoc_STRVAR(audioop_byteswap__doc__,
"Convert big-endian samples to little-endian and vice versa.");
#define AUDIOOP_BYTESWAP_METHODDEF \
- {"byteswap", (PyCFunction)audioop_byteswap, METH_VARARGS, audioop_byteswap__doc__},
+ {"byteswap", (PyCFunction)audioop_byteswap, METH_FASTCALL, audioop_byteswap__doc__},
static PyObject *
audioop_byteswap_impl(PyObject *module, Py_buffer *fragment, int width);
static PyObject *
-audioop_byteswap(PyObject *module, PyObject *args)
+audioop_byteswap(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
Py_buffer fragment = {NULL, NULL};
int width;
- if (!PyArg_ParseTuple(args, "y*i:byteswap",
+ if (!_PyArg_ParseStack(args, nargs, "y*i:byteswap",
&fragment, &width)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("byteswap", kwnames)) {
+ goto exit;
+ }
return_value = audioop_byteswap_impl(module, &fragment, width);
exit:
@@ -649,24 +721,28 @@ PyDoc_STRVAR(audioop_lin2lin__doc__,
"Convert samples between 1-, 2-, 3- and 4-byte formats.");
#define AUDIOOP_LIN2LIN_METHODDEF \
- {"lin2lin", (PyCFunction)audioop_lin2lin, METH_VARARGS, audioop_lin2lin__doc__},
+ {"lin2lin", (PyCFunction)audioop_lin2lin, METH_FASTCALL, audioop_lin2lin__doc__},
static PyObject *
audioop_lin2lin_impl(PyObject *module, Py_buffer *fragment, int width,
int newwidth);
static PyObject *
-audioop_lin2lin(PyObject *module, PyObject *args)
+audioop_lin2lin(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
Py_buffer fragment = {NULL, NULL};
int width;
int newwidth;
- if (!PyArg_ParseTuple(args, "y*ii:lin2lin",
+ if (!_PyArg_ParseStack(args, nargs, "y*ii:lin2lin",
&fragment, &width, &newwidth)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("lin2lin", kwnames)) {
+ goto exit;
+ }
return_value = audioop_lin2lin_impl(module, &fragment, width, newwidth);
exit:
@@ -686,7 +762,7 @@ PyDoc_STRVAR(audioop_ratecv__doc__,
"Convert the frame rate of the input fragment.");
#define AUDIOOP_RATECV_METHODDEF \
- {"ratecv", (PyCFunction)audioop_ratecv, METH_VARARGS, audioop_ratecv__doc__},
+ {"ratecv", (PyCFunction)audioop_ratecv, METH_FASTCALL, audioop_ratecv__doc__},
static PyObject *
audioop_ratecv_impl(PyObject *module, Py_buffer *fragment, int width,
@@ -694,7 +770,7 @@ audioop_ratecv_impl(PyObject *module, Py_buffer *fragment, int width,
int weightA, int weightB);
static PyObject *
-audioop_ratecv(PyObject *module, PyObject *args)
+audioop_ratecv(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
Py_buffer fragment = {NULL, NULL};
@@ -706,10 +782,14 @@ audioop_ratecv(PyObject *module, PyObject *args)
int weightA = 1;
int weightB = 0;
- if (!PyArg_ParseTuple(args, "y*iiiiO|ii:ratecv",
+ if (!_PyArg_ParseStack(args, nargs, "y*iiiiO|ii:ratecv",
&fragment, &width, &nchannels, &inrate, &outrate, &state, &weightA, &weightB)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("ratecv", kwnames)) {
+ goto exit;
+ }
return_value = audioop_ratecv_impl(module, &fragment, width, nchannels, inrate, outrate, state, weightA, weightB);
exit:
@@ -728,22 +808,26 @@ PyDoc_STRVAR(audioop_lin2ulaw__doc__,
"Convert samples in the audio fragment to u-LAW encoding.");
#define AUDIOOP_LIN2ULAW_METHODDEF \
- {"lin2ulaw", (PyCFunction)audioop_lin2ulaw, METH_VARARGS, audioop_lin2ulaw__doc__},
+ {"lin2ulaw", (PyCFunction)audioop_lin2ulaw, METH_FASTCALL, audioop_lin2ulaw__doc__},
static PyObject *
audioop_lin2ulaw_impl(PyObject *module, Py_buffer *fragment, int width);
static PyObject *
-audioop_lin2ulaw(PyObject *module, PyObject *args)
+audioop_lin2ulaw(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
Py_buffer fragment = {NULL, NULL};
int width;
- if (!PyArg_ParseTuple(args, "y*i:lin2ulaw",
+ if (!_PyArg_ParseStack(args, nargs, "y*i:lin2ulaw",
&fragment, &width)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("lin2ulaw", kwnames)) {
+ goto exit;
+ }
return_value = audioop_lin2ulaw_impl(module, &fragment, width);
exit:
@@ -762,22 +846,26 @@ PyDoc_STRVAR(audioop_ulaw2lin__doc__,
"Convert sound fragments in u-LAW encoding to linearly encoded sound fragments.");
#define AUDIOOP_ULAW2LIN_METHODDEF \
- {"ulaw2lin", (PyCFunction)audioop_ulaw2lin, METH_VARARGS, audioop_ulaw2lin__doc__},
+ {"ulaw2lin", (PyCFunction)audioop_ulaw2lin, METH_FASTCALL, audioop_ulaw2lin__doc__},
static PyObject *
audioop_ulaw2lin_impl(PyObject *module, Py_buffer *fragment, int width);
static PyObject *
-audioop_ulaw2lin(PyObject *module, PyObject *args)
+audioop_ulaw2lin(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
Py_buffer fragment = {NULL, NULL};
int width;
- if (!PyArg_ParseTuple(args, "y*i:ulaw2lin",
+ if (!_PyArg_ParseStack(args, nargs, "y*i:ulaw2lin",
&fragment, &width)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("ulaw2lin", kwnames)) {
+ goto exit;
+ }
return_value = audioop_ulaw2lin_impl(module, &fragment, width);
exit:
@@ -796,22 +884,26 @@ PyDoc_STRVAR(audioop_lin2alaw__doc__,
"Convert samples in the audio fragment to a-LAW encoding.");
#define AUDIOOP_LIN2ALAW_METHODDEF \
- {"lin2alaw", (PyCFunction)audioop_lin2alaw, METH_VARARGS, audioop_lin2alaw__doc__},
+ {"lin2alaw", (PyCFunction)audioop_lin2alaw, METH_FASTCALL, audioop_lin2alaw__doc__},
static PyObject *
audioop_lin2alaw_impl(PyObject *module, Py_buffer *fragment, int width);
static PyObject *
-audioop_lin2alaw(PyObject *module, PyObject *args)
+audioop_lin2alaw(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
Py_buffer fragment = {NULL, NULL};
int width;
- if (!PyArg_ParseTuple(args, "y*i:lin2alaw",
+ if (!_PyArg_ParseStack(args, nargs, "y*i:lin2alaw",
&fragment, &width)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("lin2alaw", kwnames)) {
+ goto exit;
+ }
return_value = audioop_lin2alaw_impl(module, &fragment, width);
exit:
@@ -830,22 +922,26 @@ PyDoc_STRVAR(audioop_alaw2lin__doc__,
"Convert sound fragments in a-LAW encoding to linearly encoded sound fragments.");
#define AUDIOOP_ALAW2LIN_METHODDEF \
- {"alaw2lin", (PyCFunction)audioop_alaw2lin, METH_VARARGS, audioop_alaw2lin__doc__},
+ {"alaw2lin", (PyCFunction)audioop_alaw2lin, METH_FASTCALL, audioop_alaw2lin__doc__},
static PyObject *
audioop_alaw2lin_impl(PyObject *module, Py_buffer *fragment, int width);
static PyObject *
-audioop_alaw2lin(PyObject *module, PyObject *args)
+audioop_alaw2lin(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
Py_buffer fragment = {NULL, NULL};
int width;
- if (!PyArg_ParseTuple(args, "y*i:alaw2lin",
+ if (!_PyArg_ParseStack(args, nargs, "y*i:alaw2lin",
&fragment, &width)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("alaw2lin", kwnames)) {
+ goto exit;
+ }
return_value = audioop_alaw2lin_impl(module, &fragment, width);
exit:
@@ -864,24 +960,28 @@ PyDoc_STRVAR(audioop_lin2adpcm__doc__,
"Convert samples to 4 bit Intel/DVI ADPCM encoding.");
#define AUDIOOP_LIN2ADPCM_METHODDEF \
- {"lin2adpcm", (PyCFunction)audioop_lin2adpcm, METH_VARARGS, audioop_lin2adpcm__doc__},
+ {"lin2adpcm", (PyCFunction)audioop_lin2adpcm, METH_FASTCALL, audioop_lin2adpcm__doc__},
static PyObject *
audioop_lin2adpcm_impl(PyObject *module, Py_buffer *fragment, int width,
PyObject *state);
static PyObject *
-audioop_lin2adpcm(PyObject *module, PyObject *args)
+audioop_lin2adpcm(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
Py_buffer fragment = {NULL, NULL};
int width;
PyObject *state;
- if (!PyArg_ParseTuple(args, "y*iO:lin2adpcm",
+ if (!_PyArg_ParseStack(args, nargs, "y*iO:lin2adpcm",
&fragment, &width, &state)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("lin2adpcm", kwnames)) {
+ goto exit;
+ }
return_value = audioop_lin2adpcm_impl(module, &fragment, width, state);
exit:
@@ -900,24 +1000,28 @@ PyDoc_STRVAR(audioop_adpcm2lin__doc__,
"Decode an Intel/DVI ADPCM coded fragment to a linear fragment.");
#define AUDIOOP_ADPCM2LIN_METHODDEF \
- {"adpcm2lin", (PyCFunction)audioop_adpcm2lin, METH_VARARGS, audioop_adpcm2lin__doc__},
+ {"adpcm2lin", (PyCFunction)audioop_adpcm2lin, METH_FASTCALL, audioop_adpcm2lin__doc__},
static PyObject *
audioop_adpcm2lin_impl(PyObject *module, Py_buffer *fragment, int width,
PyObject *state);
static PyObject *
-audioop_adpcm2lin(PyObject *module, PyObject *args)
+audioop_adpcm2lin(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
Py_buffer fragment = {NULL, NULL};
int width;
PyObject *state;
- if (!PyArg_ParseTuple(args, "y*iO:adpcm2lin",
+ if (!_PyArg_ParseStack(args, nargs, "y*iO:adpcm2lin",
&fragment, &width, &state)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("adpcm2lin", kwnames)) {
+ goto exit;
+ }
return_value = audioop_adpcm2lin_impl(module, &fragment, width, state);
exit:
@@ -928,4 +1032,4 @@ exit:
return return_value;
}
-/*[clinic end generated code: output=e0ab74c3fa57c39c input=a9049054013a1b77]*/
+/*[clinic end generated code: output=ee7c63ec28a11b78 input=a9049054013a1b77]*/
diff --git a/Modules/clinic/binascii.c.h b/Modules/clinic/binascii.c.h
index 743bf46ea8..093d32bb23 100644
--- a/Modules/clinic/binascii.c.h
+++ b/Modules/clinic/binascii.c.h
@@ -117,7 +117,7 @@ binascii_b2a_base64(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObjec
Py_buffer data = {NULL, NULL};
int newline = 1;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
&data, &newline)) {
goto exit;
}
@@ -266,23 +266,27 @@ PyDoc_STRVAR(binascii_crc_hqx__doc__,
"Compute CRC-CCITT incrementally.");
#define BINASCII_CRC_HQX_METHODDEF \
- {"crc_hqx", (PyCFunction)binascii_crc_hqx, METH_VARARGS, binascii_crc_hqx__doc__},
+ {"crc_hqx", (PyCFunction)binascii_crc_hqx, METH_FASTCALL, binascii_crc_hqx__doc__},
static unsigned int
binascii_crc_hqx_impl(PyObject *module, Py_buffer *data, unsigned int crc);
static PyObject *
-binascii_crc_hqx(PyObject *module, PyObject *args)
+binascii_crc_hqx(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
Py_buffer data = {NULL, NULL};
unsigned int crc;
unsigned int _return_value;
- if (!PyArg_ParseTuple(args, "y*I:crc_hqx",
+ if (!_PyArg_ParseStack(args, nargs, "y*I:crc_hqx",
&data, &crc)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("crc_hqx", kwnames)) {
+ goto exit;
+ }
_return_value = binascii_crc_hqx_impl(module, &data, crc);
if ((_return_value == (unsigned int)-1) && PyErr_Occurred()) {
goto exit;
@@ -305,23 +309,27 @@ PyDoc_STRVAR(binascii_crc32__doc__,
"Compute CRC-32 incrementally.");
#define BINASCII_CRC32_METHODDEF \
- {"crc32", (PyCFunction)binascii_crc32, METH_VARARGS, binascii_crc32__doc__},
+ {"crc32", (PyCFunction)binascii_crc32, METH_FASTCALL, binascii_crc32__doc__},
static unsigned int
binascii_crc32_impl(PyObject *module, Py_buffer *data, unsigned int crc);
static PyObject *
-binascii_crc32(PyObject *module, PyObject *args)
+binascii_crc32(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
Py_buffer data = {NULL, NULL};
unsigned int crc = 0;
unsigned int _return_value;
- if (!PyArg_ParseTuple(args, "y*|I:crc32",
+ if (!_PyArg_ParseStack(args, nargs, "y*|I:crc32",
&data, &crc)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("crc32", kwnames)) {
+ goto exit;
+ }
_return_value = binascii_crc32_impl(module, &data, crc);
if ((_return_value == (unsigned int)-1) && PyErr_Occurred()) {
goto exit;
@@ -494,7 +502,7 @@ binascii_a2b_qp(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *k
Py_buffer data = {NULL, NULL};
int header = 0;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
ascii_buffer_converter, &data, &header)) {
goto exit;
}
@@ -536,7 +544,7 @@ binascii_b2a_qp(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *k
int istext = 1;
int header = 0;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
&data, &quotetabs, &istext, &header)) {
goto exit;
}
@@ -550,4 +558,4 @@ exit:
return return_value;
}
-/*[clinic end generated code: output=458eb09731cb7877 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=4a418f883ccc79fe input=a9049054013a1b77]*/
diff --git a/Modules/clinic/cmathmodule.c.h b/Modules/clinic/cmathmodule.c.h
index 05431fa7af..b7a37270df 100644
--- a/Modules/clinic/cmathmodule.c.h
+++ b/Modules/clinic/cmathmodule.c.h
@@ -641,22 +641,26 @@ PyDoc_STRVAR(cmath_log__doc__,
"If the base not specified, returns the natural logarithm (base e) of z.");
#define CMATH_LOG_METHODDEF \
- {"log", (PyCFunction)cmath_log, METH_VARARGS, cmath_log__doc__},
+ {"log", (PyCFunction)cmath_log, METH_FASTCALL, cmath_log__doc__},
static PyObject *
cmath_log_impl(PyObject *module, Py_complex x, PyObject *y_obj);
static PyObject *
-cmath_log(PyObject *module, PyObject *args)
+cmath_log(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
Py_complex x;
PyObject *y_obj = NULL;
- if (!PyArg_ParseTuple(args, "D|O:log",
+ if (!_PyArg_ParseStack(args, nargs, "D|O:log",
&x, &y_obj)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("log", kwnames)) {
+ goto exit;
+ }
return_value = cmath_log_impl(module, x, y_obj);
exit:
@@ -726,22 +730,26 @@ PyDoc_STRVAR(cmath_rect__doc__,
"Convert from polar coordinates to rectangular coordinates.");
#define CMATH_RECT_METHODDEF \
- {"rect", (PyCFunction)cmath_rect, METH_VARARGS, cmath_rect__doc__},
+ {"rect", (PyCFunction)cmath_rect, METH_FASTCALL, cmath_rect__doc__},
static PyObject *
cmath_rect_impl(PyObject *module, double r, double phi);
static PyObject *
-cmath_rect(PyObject *module, PyObject *args)
+cmath_rect(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
double r;
double phi;
- if (!PyArg_ParseTuple(args, "dd:rect",
+ if (!_PyArg_ParseStack(args, nargs, "dd:rect",
&r, &phi)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("rect", kwnames)) {
+ goto exit;
+ }
return_value = cmath_rect_impl(module, r, phi);
exit:
@@ -869,7 +877,7 @@ cmath_isclose(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwn
double abs_tol = 0.0;
int _return_value;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
&a, &b, &rel_tol, &abs_tol)) {
goto exit;
}
@@ -882,4 +890,4 @@ cmath_isclose(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwn
exit:
return return_value;
}
-/*[clinic end generated code: output=978f59702b41655f input=a9049054013a1b77]*/
+/*[clinic end generated code: output=93eff5d4c242ee57 input=a9049054013a1b77]*/
diff --git a/Modules/clinic/fcntlmodule.c.h b/Modules/clinic/fcntlmodule.c.h
index 84a004bb59..ed8d96a4a8 100644
--- a/Modules/clinic/fcntlmodule.c.h
+++ b/Modules/clinic/fcntlmodule.c.h
@@ -19,23 +19,27 @@ PyDoc_STRVAR(fcntl_fcntl__doc__,
"corresponding to the return value of the fcntl call in the C code.");
#define FCNTL_FCNTL_METHODDEF \
- {"fcntl", (PyCFunction)fcntl_fcntl, METH_VARARGS, fcntl_fcntl__doc__},
+ {"fcntl", (PyCFunction)fcntl_fcntl, METH_FASTCALL, fcntl_fcntl__doc__},
static PyObject *
fcntl_fcntl_impl(PyObject *module, int fd, int code, PyObject *arg);
static PyObject *
-fcntl_fcntl(PyObject *module, PyObject *args)
+fcntl_fcntl(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
int fd;
int code;
PyObject *arg = NULL;
- if (!PyArg_ParseTuple(args, "O&i|O:fcntl",
+ if (!_PyArg_ParseStack(args, nargs, "O&i|O:fcntl",
conv_descriptor, &fd, &code, &arg)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("fcntl", kwnames)) {
+ goto exit;
+ }
return_value = fcntl_fcntl_impl(module, fd, code, arg);
exit:
@@ -76,14 +80,14 @@ PyDoc_STRVAR(fcntl_ioctl__doc__,
"code.");
#define FCNTL_IOCTL_METHODDEF \
- {"ioctl", (PyCFunction)fcntl_ioctl, METH_VARARGS, fcntl_ioctl__doc__},
+ {"ioctl", (PyCFunction)fcntl_ioctl, METH_FASTCALL, fcntl_ioctl__doc__},
static PyObject *
fcntl_ioctl_impl(PyObject *module, int fd, unsigned int code,
PyObject *ob_arg, int mutate_arg);
static PyObject *
-fcntl_ioctl(PyObject *module, PyObject *args)
+fcntl_ioctl(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
int fd;
@@ -91,10 +95,14 @@ fcntl_ioctl(PyObject *module, PyObject *args)
PyObject *ob_arg = NULL;
int mutate_arg = 1;
- if (!PyArg_ParseTuple(args, "O&I|Op:ioctl",
+ if (!_PyArg_ParseStack(args, nargs, "O&I|Op:ioctl",
conv_descriptor, &fd, &code, &ob_arg, &mutate_arg)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("ioctl", kwnames)) {
+ goto exit;
+ }
return_value = fcntl_ioctl_impl(module, fd, code, ob_arg, mutate_arg);
exit:
@@ -111,22 +119,26 @@ PyDoc_STRVAR(fcntl_flock__doc__,
"function is emulated using fcntl()).");
#define FCNTL_FLOCK_METHODDEF \
- {"flock", (PyCFunction)fcntl_flock, METH_VARARGS, fcntl_flock__doc__},
+ {"flock", (PyCFunction)fcntl_flock, METH_FASTCALL, fcntl_flock__doc__},
static PyObject *
fcntl_flock_impl(PyObject *module, int fd, int code);
static PyObject *
-fcntl_flock(PyObject *module, PyObject *args)
+fcntl_flock(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
int fd;
int code;
- if (!PyArg_ParseTuple(args, "O&i:flock",
+ if (!_PyArg_ParseStack(args, nargs, "O&i:flock",
conv_descriptor, &fd, &code)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("flock", kwnames)) {
+ goto exit;
+ }
return_value = fcntl_flock_impl(module, fd, code);
exit:
@@ -161,14 +173,14 @@ PyDoc_STRVAR(fcntl_lockf__doc__,
" 2 - relative to the end of the file (SEEK_END)");
#define FCNTL_LOCKF_METHODDEF \
- {"lockf", (PyCFunction)fcntl_lockf, METH_VARARGS, fcntl_lockf__doc__},
+ {"lockf", (PyCFunction)fcntl_lockf, METH_FASTCALL, fcntl_lockf__doc__},
static PyObject *
fcntl_lockf_impl(PyObject *module, int fd, int code, PyObject *lenobj,
PyObject *startobj, int whence);
static PyObject *
-fcntl_lockf(PyObject *module, PyObject *args)
+fcntl_lockf(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
int fd;
@@ -177,13 +189,17 @@ fcntl_lockf(PyObject *module, PyObject *args)
PyObject *startobj = NULL;
int whence = 0;
- if (!PyArg_ParseTuple(args, "O&i|OOi:lockf",
+ if (!_PyArg_ParseStack(args, nargs, "O&i|OOi:lockf",
conv_descriptor, &fd, &code, &lenobj, &startobj, &whence)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("lockf", kwnames)) {
+ goto exit;
+ }
return_value = fcntl_lockf_impl(module, fd, code, lenobj, startobj, whence);
exit:
return return_value;
}
-/*[clinic end generated code: output=36cff76a8fb2c9a6 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=b67e9579722e6d4f input=a9049054013a1b77]*/
diff --git a/Modules/clinic/gcmodule.c.h b/Modules/clinic/gcmodule.c.h
new file mode 100644
index 0000000000..a769d1f56f
--- /dev/null
+++ b/Modules/clinic/gcmodule.c.h
@@ -0,0 +1,258 @@
+/*[clinic input]
+preserve
+[clinic start generated code]*/
+
+PyDoc_STRVAR(gc_enable__doc__,
+"enable($module, /)\n"
+"--\n"
+"\n"
+"Enable automatic garbage collection.");
+
+#define GC_ENABLE_METHODDEF \
+ {"enable", (PyCFunction)gc_enable, METH_NOARGS, gc_enable__doc__},
+
+static PyObject *
+gc_enable_impl(PyObject *module);
+
+static PyObject *
+gc_enable(PyObject *module, PyObject *Py_UNUSED(ignored))
+{
+ return gc_enable_impl(module);
+}
+
+PyDoc_STRVAR(gc_disable__doc__,
+"disable($module, /)\n"
+"--\n"
+"\n"
+"Disable automatic garbage collection.");
+
+#define GC_DISABLE_METHODDEF \
+ {"disable", (PyCFunction)gc_disable, METH_NOARGS, gc_disable__doc__},
+
+static PyObject *
+gc_disable_impl(PyObject *module);
+
+static PyObject *
+gc_disable(PyObject *module, PyObject *Py_UNUSED(ignored))
+{
+ return gc_disable_impl(module);
+}
+
+PyDoc_STRVAR(gc_isenabled__doc__,
+"isenabled($module, /)\n"
+"--\n"
+"\n"
+"Returns true if automatic garbage collection is enabled.");
+
+#define GC_ISENABLED_METHODDEF \
+ {"isenabled", (PyCFunction)gc_isenabled, METH_NOARGS, gc_isenabled__doc__},
+
+static int
+gc_isenabled_impl(PyObject *module);
+
+static PyObject *
+gc_isenabled(PyObject *module, PyObject *Py_UNUSED(ignored))
+{
+ PyObject *return_value = NULL;
+ int _return_value;
+
+ _return_value = gc_isenabled_impl(module);
+ if ((_return_value == -1) && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = PyBool_FromLong((long)_return_value);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(gc_collect__doc__,
+"collect($module, /, generation=2)\n"
+"--\n"
+"\n"
+"Run the garbage collector.\n"
+"\n"
+"With no arguments, run a full collection. The optional argument\n"
+"may be an integer specifying which generation to collect. A ValueError\n"
+"is raised if the generation number is invalid.\n"
+"\n"
+"The number of unreachable objects is returned.");
+
+#define GC_COLLECT_METHODDEF \
+ {"collect", (PyCFunction)gc_collect, METH_FASTCALL, gc_collect__doc__},
+
+static Py_ssize_t
+gc_collect_impl(PyObject *module, int generation);
+
+static PyObject *
+gc_collect(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ static const char * const _keywords[] = {"generation", NULL};
+ static _PyArg_Parser _parser = {"|i:collect", _keywords, 0};
+ int generation = NUM_GENERATIONS - 1;
+ Py_ssize_t _return_value;
+
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
+ &generation)) {
+ goto exit;
+ }
+ _return_value = gc_collect_impl(module, generation);
+ if ((_return_value == -1) && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = PyLong_FromSsize_t(_return_value);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(gc_set_debug__doc__,
+"set_debug($module, flags, /)\n"
+"--\n"
+"\n"
+"Set the garbage collection debugging flags.\n"
+"\n"
+" flags\n"
+" An integer that can have the following bits turned on:\n"
+" DEBUG_STATS - Print statistics during collection.\n"
+" DEBUG_COLLECTABLE - Print collectable objects found.\n"
+" DEBUG_UNCOLLECTABLE - Print unreachable but uncollectable objects\n"
+" found.\n"
+" DEBUG_SAVEALL - Save objects to gc.garbage rather than freeing them.\n"
+" DEBUG_LEAK - Debug leaking programs (everything but STATS).\n"
+"\n"
+"Debugging information is written to sys.stderr.");
+
+#define GC_SET_DEBUG_METHODDEF \
+ {"set_debug", (PyCFunction)gc_set_debug, METH_O, gc_set_debug__doc__},
+
+static PyObject *
+gc_set_debug_impl(PyObject *module, int flags);
+
+static PyObject *
+gc_set_debug(PyObject *module, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ int flags;
+
+ if (!PyArg_Parse(arg, "i:set_debug", &flags)) {
+ goto exit;
+ }
+ return_value = gc_set_debug_impl(module, flags);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(gc_get_debug__doc__,
+"get_debug($module, /)\n"
+"--\n"
+"\n"
+"Get the garbage collection debugging flags.");
+
+#define GC_GET_DEBUG_METHODDEF \
+ {"get_debug", (PyCFunction)gc_get_debug, METH_NOARGS, gc_get_debug__doc__},
+
+static int
+gc_get_debug_impl(PyObject *module);
+
+static PyObject *
+gc_get_debug(PyObject *module, PyObject *Py_UNUSED(ignored))
+{
+ PyObject *return_value = NULL;
+ int _return_value;
+
+ _return_value = gc_get_debug_impl(module);
+ if ((_return_value == -1) && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = PyLong_FromLong((long)_return_value);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(gc_get_threshold__doc__,
+"get_threshold($module, /)\n"
+"--\n"
+"\n"
+"Return the current collection thresholds.");
+
+#define GC_GET_THRESHOLD_METHODDEF \
+ {"get_threshold", (PyCFunction)gc_get_threshold, METH_NOARGS, gc_get_threshold__doc__},
+
+static PyObject *
+gc_get_threshold_impl(PyObject *module);
+
+static PyObject *
+gc_get_threshold(PyObject *module, PyObject *Py_UNUSED(ignored))
+{
+ return gc_get_threshold_impl(module);
+}
+
+PyDoc_STRVAR(gc_get_count__doc__,
+"get_count($module, /)\n"
+"--\n"
+"\n"
+"Return a three-tuple of the current collection counts.");
+
+#define GC_GET_COUNT_METHODDEF \
+ {"get_count", (PyCFunction)gc_get_count, METH_NOARGS, gc_get_count__doc__},
+
+static PyObject *
+gc_get_count_impl(PyObject *module);
+
+static PyObject *
+gc_get_count(PyObject *module, PyObject *Py_UNUSED(ignored))
+{
+ return gc_get_count_impl(module);
+}
+
+PyDoc_STRVAR(gc_get_objects__doc__,
+"get_objects($module, /)\n"
+"--\n"
+"\n"
+"Return a list of objects tracked by the collector (excluding the list returned).");
+
+#define GC_GET_OBJECTS_METHODDEF \
+ {"get_objects", (PyCFunction)gc_get_objects, METH_NOARGS, gc_get_objects__doc__},
+
+static PyObject *
+gc_get_objects_impl(PyObject *module);
+
+static PyObject *
+gc_get_objects(PyObject *module, PyObject *Py_UNUSED(ignored))
+{
+ return gc_get_objects_impl(module);
+}
+
+PyDoc_STRVAR(gc_get_stats__doc__,
+"get_stats($module, /)\n"
+"--\n"
+"\n"
+"Return a list of dictionaries containing per-generation statistics.");
+
+#define GC_GET_STATS_METHODDEF \
+ {"get_stats", (PyCFunction)gc_get_stats, METH_NOARGS, gc_get_stats__doc__},
+
+static PyObject *
+gc_get_stats_impl(PyObject *module);
+
+static PyObject *
+gc_get_stats(PyObject *module, PyObject *Py_UNUSED(ignored))
+{
+ return gc_get_stats_impl(module);
+}
+
+PyDoc_STRVAR(gc_is_tracked__doc__,
+"is_tracked($module, obj, /)\n"
+"--\n"
+"\n"
+"Returns true if the object is tracked by the garbage collector.\n"
+"\n"
+"Simple atomic objects will return false.");
+
+#define GC_IS_TRACKED_METHODDEF \
+ {"is_tracked", (PyCFunction)gc_is_tracked, METH_O, gc_is_tracked__doc__},
+/*[clinic end generated code: output=8f487abc53fe4161 input=a9049054013a1b77]*/
diff --git a/Modules/clinic/grpmodule.c.h b/Modules/clinic/grpmodule.c.h
index 0282b4e477..73af272ba9 100644
--- a/Modules/clinic/grpmodule.c.h
+++ b/Modules/clinic/grpmodule.c.h
@@ -24,7 +24,7 @@ grp_getgrgid(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwna
static _PyArg_Parser _parser = {"O:getgrgid", _keywords, 0};
PyObject *id;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
&id)) {
goto exit;
}
@@ -56,7 +56,7 @@ grp_getgrnam(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwna
static _PyArg_Parser _parser = {"U:getgrnam", _keywords, 0};
PyObject *name;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
&name)) {
goto exit;
}
@@ -86,4 +86,4 @@ grp_getgrall(PyObject *module, PyObject *Py_UNUSED(ignored))
{
return grp_getgrall_impl(module);
}
-/*[clinic end generated code: output=d6417ae0a7298e0e input=a9049054013a1b77]*/
+/*[clinic end generated code: output=fb690db5e676d378 input=a9049054013a1b77]*/
diff --git a/Modules/clinic/mathmodule.c.h b/Modules/clinic/mathmodule.c.h
new file mode 100644
index 0000000000..84a7a70cdc
--- /dev/null
+++ b/Modules/clinic/mathmodule.c.h
@@ -0,0 +1,539 @@
+/*[clinic input]
+preserve
+[clinic start generated code]*/
+
+PyDoc_STRVAR(math_gcd__doc__,
+"gcd($module, x, y, /)\n"
+"--\n"
+"\n"
+"greatest common divisor of x and y");
+
+#define MATH_GCD_METHODDEF \
+ {"gcd", (PyCFunction)math_gcd, METH_FASTCALL, math_gcd__doc__},
+
+static PyObject *
+math_gcd_impl(PyObject *module, PyObject *a, PyObject *b);
+
+static PyObject *
+math_gcd(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ PyObject *a;
+ PyObject *b;
+
+ if (!_PyArg_UnpackStack(args, nargs, "gcd",
+ 2, 2,
+ &a, &b)) {
+ goto exit;
+ }
+
+ if (!_PyArg_NoStackKeywords("gcd", kwnames)) {
+ goto exit;
+ }
+ return_value = math_gcd_impl(module, a, b);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(math_ceil__doc__,
+"ceil($module, x, /)\n"
+"--\n"
+"\n"
+"Return the ceiling of x as an Integral.\n"
+"\n"
+"This is the smallest integer >= x.");
+
+#define MATH_CEIL_METHODDEF \
+ {"ceil", (PyCFunction)math_ceil, METH_O, math_ceil__doc__},
+
+PyDoc_STRVAR(math_floor__doc__,
+"floor($module, x, /)\n"
+"--\n"
+"\n"
+"Return the floor of x as an Integral.\n"
+"\n"
+"This is the largest integer <= x.");
+
+#define MATH_FLOOR_METHODDEF \
+ {"floor", (PyCFunction)math_floor, METH_O, math_floor__doc__},
+
+PyDoc_STRVAR(math_fsum__doc__,
+"fsum($module, seq, /)\n"
+"--\n"
+"\n"
+"Return an accurate floating point sum of values in the iterable seq.\n"
+"\n"
+"Assumes IEEE-754 floating point arithmetic.");
+
+#define MATH_FSUM_METHODDEF \
+ {"fsum", (PyCFunction)math_fsum, METH_O, math_fsum__doc__},
+
+PyDoc_STRVAR(math_factorial__doc__,
+"factorial($module, x, /)\n"
+"--\n"
+"\n"
+"Find x!.\n"
+"\n"
+"Raise a ValueError if x is negative or non-integral.");
+
+#define MATH_FACTORIAL_METHODDEF \
+ {"factorial", (PyCFunction)math_factorial, METH_O, math_factorial__doc__},
+
+PyDoc_STRVAR(math_trunc__doc__,
+"trunc($module, x, /)\n"
+"--\n"
+"\n"
+"Truncates the Real x to the nearest Integral toward 0.\n"
+"\n"
+"Uses the __trunc__ magic method.");
+
+#define MATH_TRUNC_METHODDEF \
+ {"trunc", (PyCFunction)math_trunc, METH_O, math_trunc__doc__},
+
+PyDoc_STRVAR(math_frexp__doc__,
+"frexp($module, x, /)\n"
+"--\n"
+"\n"
+"Return the mantissa and exponent of x, as pair (m, e).\n"
+"\n"
+"m is a float and e is an int, such that x = m * 2.**e.\n"
+"If x is 0, m and e are both 0. Else 0.5 <= abs(m) < 1.0.");
+
+#define MATH_FREXP_METHODDEF \
+ {"frexp", (PyCFunction)math_frexp, METH_O, math_frexp__doc__},
+
+static PyObject *
+math_frexp_impl(PyObject *module, double x);
+
+static PyObject *
+math_frexp(PyObject *module, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ double x;
+
+ if (!PyArg_Parse(arg, "d:frexp", &x)) {
+ goto exit;
+ }
+ return_value = math_frexp_impl(module, x);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(math_ldexp__doc__,
+"ldexp($module, x, i, /)\n"
+"--\n"
+"\n"
+"Return x * (2**i).\n"
+"\n"
+"This is essentially the inverse of frexp().");
+
+#define MATH_LDEXP_METHODDEF \
+ {"ldexp", (PyCFunction)math_ldexp, METH_FASTCALL, math_ldexp__doc__},
+
+static PyObject *
+math_ldexp_impl(PyObject *module, double x, PyObject *i);
+
+static PyObject *
+math_ldexp(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ double x;
+ PyObject *i;
+
+ if (!_PyArg_ParseStack(args, nargs, "dO:ldexp",
+ &x, &i)) {
+ goto exit;
+ }
+
+ if (!_PyArg_NoStackKeywords("ldexp", kwnames)) {
+ goto exit;
+ }
+ return_value = math_ldexp_impl(module, x, i);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(math_modf__doc__,
+"modf($module, x, /)\n"
+"--\n"
+"\n"
+"Return the fractional and integer parts of x.\n"
+"\n"
+"Both results carry the sign of x and are floats.");
+
+#define MATH_MODF_METHODDEF \
+ {"modf", (PyCFunction)math_modf, METH_O, math_modf__doc__},
+
+static PyObject *
+math_modf_impl(PyObject *module, double x);
+
+static PyObject *
+math_modf(PyObject *module, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ double x;
+
+ if (!PyArg_Parse(arg, "d:modf", &x)) {
+ goto exit;
+ }
+ return_value = math_modf_impl(module, x);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(math_log__doc__,
+"log(x, [base=math.e])\n"
+"Return the logarithm of x to the given base.\n"
+"\n"
+"If the base not specified, returns the natural logarithm (base e) of x.");
+
+#define MATH_LOG_METHODDEF \
+ {"log", (PyCFunction)math_log, METH_VARARGS, math_log__doc__},
+
+static PyObject *
+math_log_impl(PyObject *module, PyObject *x, int group_right_1,
+ PyObject *base);
+
+static PyObject *
+math_log(PyObject *module, PyObject *args)
+{
+ PyObject *return_value = NULL;
+ PyObject *x;
+ int group_right_1 = 0;
+ PyObject *base = NULL;
+
+ switch (PyTuple_GET_SIZE(args)) {
+ case 1:
+ if (!PyArg_ParseTuple(args, "O:log", &x)) {
+ goto exit;
+ }
+ break;
+ case 2:
+ if (!PyArg_ParseTuple(args, "OO:log", &x, &base)) {
+ goto exit;
+ }
+ group_right_1 = 1;
+ break;
+ default:
+ PyErr_SetString(PyExc_TypeError, "math.log requires 1 to 2 arguments");
+ goto exit;
+ }
+ return_value = math_log_impl(module, x, group_right_1, base);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(math_log2__doc__,
+"log2($module, x, /)\n"
+"--\n"
+"\n"
+"Return the base 2 logarithm of x.");
+
+#define MATH_LOG2_METHODDEF \
+ {"log2", (PyCFunction)math_log2, METH_O, math_log2__doc__},
+
+PyDoc_STRVAR(math_log10__doc__,
+"log10($module, x, /)\n"
+"--\n"
+"\n"
+"Return the base 10 logarithm of x.");
+
+#define MATH_LOG10_METHODDEF \
+ {"log10", (PyCFunction)math_log10, METH_O, math_log10__doc__},
+
+PyDoc_STRVAR(math_fmod__doc__,
+"fmod($module, x, y, /)\n"
+"--\n"
+"\n"
+"Return fmod(x, y), according to platform C.\n"
+"\n"
+"x % y may differ.");
+
+#define MATH_FMOD_METHODDEF \
+ {"fmod", (PyCFunction)math_fmod, METH_FASTCALL, math_fmod__doc__},
+
+static PyObject *
+math_fmod_impl(PyObject *module, double x, double y);
+
+static PyObject *
+math_fmod(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ double x;
+ double y;
+
+ if (!_PyArg_ParseStack(args, nargs, "dd:fmod",
+ &x, &y)) {
+ goto exit;
+ }
+
+ if (!_PyArg_NoStackKeywords("fmod", kwnames)) {
+ goto exit;
+ }
+ return_value = math_fmod_impl(module, x, y);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(math_hypot__doc__,
+"hypot($module, x, y, /)\n"
+"--\n"
+"\n"
+"Return the Euclidean distance, sqrt(x*x + y*y).");
+
+#define MATH_HYPOT_METHODDEF \
+ {"hypot", (PyCFunction)math_hypot, METH_FASTCALL, math_hypot__doc__},
+
+static PyObject *
+math_hypot_impl(PyObject *module, double x, double y);
+
+static PyObject *
+math_hypot(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ double x;
+ double y;
+
+ if (!_PyArg_ParseStack(args, nargs, "dd:hypot",
+ &x, &y)) {
+ goto exit;
+ }
+
+ if (!_PyArg_NoStackKeywords("hypot", kwnames)) {
+ goto exit;
+ }
+ return_value = math_hypot_impl(module, x, y);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(math_pow__doc__,
+"pow($module, x, y, /)\n"
+"--\n"
+"\n"
+"Return x**y (x to the power of y).");
+
+#define MATH_POW_METHODDEF \
+ {"pow", (PyCFunction)math_pow, METH_FASTCALL, math_pow__doc__},
+
+static PyObject *
+math_pow_impl(PyObject *module, double x, double y);
+
+static PyObject *
+math_pow(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ double x;
+ double y;
+
+ if (!_PyArg_ParseStack(args, nargs, "dd:pow",
+ &x, &y)) {
+ goto exit;
+ }
+
+ if (!_PyArg_NoStackKeywords("pow", kwnames)) {
+ goto exit;
+ }
+ return_value = math_pow_impl(module, x, y);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(math_degrees__doc__,
+"degrees($module, x, /)\n"
+"--\n"
+"\n"
+"Convert angle x from radians to degrees.");
+
+#define MATH_DEGREES_METHODDEF \
+ {"degrees", (PyCFunction)math_degrees, METH_O, math_degrees__doc__},
+
+static PyObject *
+math_degrees_impl(PyObject *module, double x);
+
+static PyObject *
+math_degrees(PyObject *module, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ double x;
+
+ if (!PyArg_Parse(arg, "d:degrees", &x)) {
+ goto exit;
+ }
+ return_value = math_degrees_impl(module, x);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(math_radians__doc__,
+"radians($module, x, /)\n"
+"--\n"
+"\n"
+"Convert angle x from degrees to radians.");
+
+#define MATH_RADIANS_METHODDEF \
+ {"radians", (PyCFunction)math_radians, METH_O, math_radians__doc__},
+
+static PyObject *
+math_radians_impl(PyObject *module, double x);
+
+static PyObject *
+math_radians(PyObject *module, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ double x;
+
+ if (!PyArg_Parse(arg, "d:radians", &x)) {
+ goto exit;
+ }
+ return_value = math_radians_impl(module, x);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(math_isfinite__doc__,
+"isfinite($module, x, /)\n"
+"--\n"
+"\n"
+"Return True if x is neither an infinity nor a NaN, and False otherwise.");
+
+#define MATH_ISFINITE_METHODDEF \
+ {"isfinite", (PyCFunction)math_isfinite, METH_O, math_isfinite__doc__},
+
+static PyObject *
+math_isfinite_impl(PyObject *module, double x);
+
+static PyObject *
+math_isfinite(PyObject *module, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ double x;
+
+ if (!PyArg_Parse(arg, "d:isfinite", &x)) {
+ goto exit;
+ }
+ return_value = math_isfinite_impl(module, x);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(math_isnan__doc__,
+"isnan($module, x, /)\n"
+"--\n"
+"\n"
+"Return True if x is a NaN (not a number), and False otherwise.");
+
+#define MATH_ISNAN_METHODDEF \
+ {"isnan", (PyCFunction)math_isnan, METH_O, math_isnan__doc__},
+
+static PyObject *
+math_isnan_impl(PyObject *module, double x);
+
+static PyObject *
+math_isnan(PyObject *module, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ double x;
+
+ if (!PyArg_Parse(arg, "d:isnan", &x)) {
+ goto exit;
+ }
+ return_value = math_isnan_impl(module, x);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(math_isinf__doc__,
+"isinf($module, x, /)\n"
+"--\n"
+"\n"
+"Return True if x is a positive or negative infinity, and False otherwise.");
+
+#define MATH_ISINF_METHODDEF \
+ {"isinf", (PyCFunction)math_isinf, METH_O, math_isinf__doc__},
+
+static PyObject *
+math_isinf_impl(PyObject *module, double x);
+
+static PyObject *
+math_isinf(PyObject *module, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ double x;
+
+ if (!PyArg_Parse(arg, "d:isinf", &x)) {
+ goto exit;
+ }
+ return_value = math_isinf_impl(module, x);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(math_isclose__doc__,
+"isclose($module, /, a, b, *, rel_tol=1e-09, abs_tol=0.0)\n"
+"--\n"
+"\n"
+"Determine whether two floating point numbers are close in value.\n"
+"\n"
+" rel_tol\n"
+" maximum difference for being considered \"close\", relative to the\n"
+" magnitude of the input values\n"
+" abs_tol\n"
+" maximum difference for being considered \"close\", regardless of the\n"
+" magnitude of the input values\n"
+"\n"
+"Return True if a is close in value to b, and False otherwise.\n"
+"\n"
+"For the values to be considered close, the difference between them\n"
+"must be smaller than at least one of the tolerances.\n"
+"\n"
+"-inf, inf and NaN behave similarly to the IEEE 754 Standard. That\n"
+"is, NaN is not close to anything, even itself. inf and -inf are\n"
+"only close to themselves.");
+
+#define MATH_ISCLOSE_METHODDEF \
+ {"isclose", (PyCFunction)math_isclose, METH_FASTCALL, math_isclose__doc__},
+
+static int
+math_isclose_impl(PyObject *module, double a, double b, double rel_tol,
+ double abs_tol);
+
+static PyObject *
+math_isclose(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ static const char * const _keywords[] = {"a", "b", "rel_tol", "abs_tol", NULL};
+ static _PyArg_Parser _parser = {"dd|$dd:isclose", _keywords, 0};
+ double a;
+ double b;
+ double rel_tol = 1e-09;
+ double abs_tol = 0.0;
+ int _return_value;
+
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
+ &a, &b, &rel_tol, &abs_tol)) {
+ goto exit;
+ }
+ _return_value = math_isclose_impl(module, a, b, rel_tol, abs_tol);
+ if ((_return_value == -1) && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = PyBool_FromLong((long)_return_value);
+
+exit:
+ return return_value;
+}
+/*[clinic end generated code: output=71806f73a5c4bf0b input=a9049054013a1b77]*/
diff --git a/Modules/clinic/md5module.c.h b/Modules/clinic/md5module.c.h
index a841fe5786..3f80af4131 100644
--- a/Modules/clinic/md5module.c.h
+++ b/Modules/clinic/md5module.c.h
@@ -85,7 +85,7 @@ _md5_md5(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
static _PyArg_Parser _parser = {"|O:md5", _keywords, 0};
PyObject *string = NULL;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
&string)) {
goto exit;
}
@@ -94,4 +94,4 @@ _md5_md5(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
exit:
return return_value;
}
-/*[clinic end generated code: output=54cd50db050f2589 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=0a975e22cf33f833 input=a9049054013a1b77]*/
diff --git a/Modules/clinic/posixmodule.c.h b/Modules/clinic/posixmodule.c.h
index 0d3ce6eed6..39ac7fd54f 100644
--- a/Modules/clinic/posixmodule.c.h
+++ b/Modules/clinic/posixmodule.c.h
@@ -43,7 +43,7 @@ os_stat(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
int dir_fd = DEFAULT_DIR_FD;
int follow_symlinks = 1;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
path_converter, &path, FSTATAT_DIR_FD_CONVERTER, &dir_fd, &follow_symlinks)) {
goto exit;
}
@@ -80,7 +80,7 @@ os_lstat(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
path_t path = PATH_T_INITIALIZE("lstat", "path", 0, 0);
int dir_fd = DEFAULT_DIR_FD;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
path_converter, &path, FSTATAT_DIR_FD_CONVERTER, &dir_fd)) {
goto exit;
}
@@ -145,7 +145,7 @@ os_access(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames
int follow_symlinks = 1;
int _return_value;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
path_converter, &path, &mode, FACCESSAT_DIR_FD_CONVERTER, &dir_fd, &effective_ids, &follow_symlinks)) {
goto exit;
}
@@ -247,7 +247,7 @@ os_chdir(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
static _PyArg_Parser _parser = {"O&:chdir", _keywords, 0};
path_t path = PATH_T_INITIALIZE("chdir", "path", 0, PATH_HAVE_FCHDIR);
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
path_converter, &path)) {
goto exit;
}
@@ -285,7 +285,7 @@ os_fchdir(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames
static _PyArg_Parser _parser = {"O&:fchdir", _keywords, 0};
int fd;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
fildes_converter, &fd)) {
goto exit;
}
@@ -341,7 +341,7 @@ os_chmod(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
int dir_fd = DEFAULT_DIR_FD;
int follow_symlinks = 1;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
path_converter, &path, &mode, FCHMODAT_DIR_FD_CONVERTER, &dir_fd, &follow_symlinks)) {
goto exit;
}
@@ -379,7 +379,7 @@ os_fchmod(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames
int fd;
int mode;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
&fd, &mode)) {
goto exit;
}
@@ -417,7 +417,7 @@ os_lchmod(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames
path_t path = PATH_T_INITIALIZE("lchmod", "path", 0, 0);
int mode;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
path_converter, &path, &mode)) {
goto exit;
}
@@ -463,7 +463,7 @@ os_chflags(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwname
unsigned long flags;
int follow_symlinks = 1;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
path_converter, &path, &flags, &follow_symlinks)) {
goto exit;
}
@@ -504,7 +504,7 @@ os_lchflags(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnam
path_t path = PATH_T_INITIALIZE("lchflags", "path", 0, 0);
unsigned long flags;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
path_converter, &path, &flags)) {
goto exit;
}
@@ -541,7 +541,7 @@ os_chroot(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames
static _PyArg_Parser _parser = {"O&:chroot", _keywords, 0};
path_t path = PATH_T_INITIALIZE("chroot", "path", 0, 0);
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
path_converter, &path)) {
goto exit;
}
@@ -578,7 +578,7 @@ os_fsync(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
static _PyArg_Parser _parser = {"O&:fsync", _keywords, 0};
int fd;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
fildes_converter, &fd)) {
goto exit;
}
@@ -634,7 +634,7 @@ os_fdatasync(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwna
static _PyArg_Parser _parser = {"O&:fdatasync", _keywords, 0};
int fd;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
fildes_converter, &fd)) {
goto exit;
}
@@ -697,7 +697,7 @@ os_chown(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
int dir_fd = DEFAULT_DIR_FD;
int follow_symlinks = 1;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
path_converter, &path, _Py_Uid_Converter, &uid, _Py_Gid_Converter, &gid, FCHOWNAT_DIR_FD_CONVERTER, &dir_fd, &follow_symlinks)) {
goto exit;
}
@@ -738,7 +738,7 @@ os_fchown(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames
uid_t uid;
gid_t gid;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
&fd, _Py_Uid_Converter, &uid, _Py_Gid_Converter, &gid)) {
goto exit;
}
@@ -777,7 +777,7 @@ os_lchown(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames
uid_t uid;
gid_t gid;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
path_converter, &path, _Py_Uid_Converter, &uid, _Py_Gid_Converter, &gid)) {
goto exit;
}
@@ -866,7 +866,7 @@ os_link(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
int dst_dir_fd = DEFAULT_DIR_FD;
int follow_symlinks = 1;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
path_converter, &src, path_converter, &dst, dir_fd_converter, &src_dir_fd, dir_fd_converter, &dst_dir_fd, &follow_symlinks)) {
goto exit;
}
@@ -914,7 +914,7 @@ os_listdir(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwname
static _PyArg_Parser _parser = {"|O&:listdir", _keywords, 0};
path_t path = PATH_T_INITIALIZE("listdir", "path", 1, PATH_HAVE_FDOPENDIR);
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
path_converter, &path)) {
goto exit;
}
@@ -1047,7 +1047,7 @@ os__getvolumepathname(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObj
static _PyArg_Parser _parser = {"U:_getvolumepathname", _keywords, 0};
PyObject *path;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
&path)) {
goto exit;
}
@@ -1088,7 +1088,7 @@ os_mkdir(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
int mode = 511;
int dir_fd = DEFAULT_DIR_FD;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
path_converter, &path, &mode, MKDIRAT_DIR_FD_CONVERTER, &dir_fd)) {
goto exit;
}
@@ -1155,7 +1155,7 @@ os_getpriority(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kw
int which;
int who;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
&which, &who)) {
goto exit;
}
@@ -1191,7 +1191,7 @@ os_setpriority(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kw
int who;
int priority;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
&which, &who, &priority)) {
goto exit;
}
@@ -1233,7 +1233,7 @@ os_rename(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames
int src_dir_fd = DEFAULT_DIR_FD;
int dst_dir_fd = DEFAULT_DIR_FD;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
path_converter, &src, path_converter, &dst, dir_fd_converter, &src_dir_fd, dir_fd_converter, &dst_dir_fd)) {
goto exit;
}
@@ -1278,7 +1278,7 @@ os_replace(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwname
int src_dir_fd = DEFAULT_DIR_FD;
int dst_dir_fd = DEFAULT_DIR_FD;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
path_converter, &src, path_converter, &dst, dir_fd_converter, &src_dir_fd, dir_fd_converter, &dst_dir_fd)) {
goto exit;
}
@@ -1319,7 +1319,7 @@ os_rmdir(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
path_t path = PATH_T_INITIALIZE("rmdir", "path", 0, 0);
int dir_fd = DEFAULT_DIR_FD;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
path_converter, &path, UNLINKAT_DIR_FD_CONVERTER, &dir_fd)) {
goto exit;
}
@@ -1355,7 +1355,7 @@ os_system(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames
Py_UNICODE *command;
long _return_value;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
&command)) {
goto exit;
}
@@ -1394,7 +1394,7 @@ os_system(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames
PyObject *command = NULL;
long _return_value;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
PyUnicode_FSConverter, &command)) {
goto exit;
}
@@ -1466,7 +1466,7 @@ os_unlink(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames
path_t path = PATH_T_INITIALIZE("unlink", "path", 0, 0);
int dir_fd = DEFAULT_DIR_FD;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
path_converter, &path, UNLINKAT_DIR_FD_CONVERTER, &dir_fd)) {
goto exit;
}
@@ -1505,7 +1505,7 @@ os_remove(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames
path_t path = PATH_T_INITIALIZE("remove", "path", 0, 0);
int dir_fd = DEFAULT_DIR_FD;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
path_converter, &path, UNLINKAT_DIR_FD_CONVERTER, &dir_fd)) {
goto exit;
}
@@ -1591,7 +1591,7 @@ os_utime(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
int dir_fd = DEFAULT_DIR_FD;
int follow_symlinks = 1;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
path_converter, &path, &times, &ns, FUTIMENSAT_DIR_FD_CONVERTER, &dir_fd, &follow_symlinks)) {
goto exit;
}
@@ -1624,7 +1624,7 @@ os__exit(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
static _PyArg_Parser _parser = {"i:_exit", _keywords, 0};
int status;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
&status)) {
goto exit;
}
@@ -1648,22 +1648,26 @@ PyDoc_STRVAR(os_execv__doc__,
" Tuple or list of strings.");
#define OS_EXECV_METHODDEF \
- {"execv", (PyCFunction)os_execv, METH_VARARGS, os_execv__doc__},
+ {"execv", (PyCFunction)os_execv, METH_FASTCALL, os_execv__doc__},
static PyObject *
os_execv_impl(PyObject *module, path_t *path, PyObject *argv);
static PyObject *
-os_execv(PyObject *module, PyObject *args)
+os_execv(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
path_t path = PATH_T_INITIALIZE("execv", "path", 0, 0);
PyObject *argv;
- if (!PyArg_ParseTuple(args, "O&O:execv",
+ if (!_PyArg_ParseStack(args, nargs, "O&O:execv",
path_converter, &path, &argv)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("execv", kwnames)) {
+ goto exit;
+ }
return_value = os_execv_impl(module, &path, argv);
exit:
@@ -1706,7 +1710,7 @@ os_execve(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames
PyObject *argv;
PyObject *env;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
path_converter, &path, &argv, &env)) {
goto exit;
}
@@ -1737,23 +1741,27 @@ PyDoc_STRVAR(os_spawnv__doc__,
" Tuple or list of strings.");
#define OS_SPAWNV_METHODDEF \
- {"spawnv", (PyCFunction)os_spawnv, METH_VARARGS, os_spawnv__doc__},
+ {"spawnv", (PyCFunction)os_spawnv, METH_FASTCALL, os_spawnv__doc__},
static PyObject *
os_spawnv_impl(PyObject *module, int mode, path_t *path, PyObject *argv);
static PyObject *
-os_spawnv(PyObject *module, PyObject *args)
+os_spawnv(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
int mode;
path_t path = PATH_T_INITIALIZE("spawnv", "path", 0, 0);
PyObject *argv;
- if (!PyArg_ParseTuple(args, "iO&O:spawnv",
+ if (!_PyArg_ParseStack(args, nargs, "iO&O:spawnv",
&mode, path_converter, &path, &argv)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("spawnv", kwnames)) {
+ goto exit;
+ }
return_value = os_spawnv_impl(module, mode, &path, argv);
exit:
@@ -1783,14 +1791,14 @@ PyDoc_STRVAR(os_spawnve__doc__,
" Dictionary of strings mapping to strings.");
#define OS_SPAWNVE_METHODDEF \
- {"spawnve", (PyCFunction)os_spawnve, METH_VARARGS, os_spawnve__doc__},
+ {"spawnve", (PyCFunction)os_spawnve, METH_FASTCALL, os_spawnve__doc__},
static PyObject *
os_spawnve_impl(PyObject *module, int mode, path_t *path, PyObject *argv,
PyObject *env);
static PyObject *
-os_spawnve(PyObject *module, PyObject *args)
+os_spawnve(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
int mode;
@@ -1798,10 +1806,14 @@ os_spawnve(PyObject *module, PyObject *args)
PyObject *argv;
PyObject *env;
- if (!PyArg_ParseTuple(args, "iO&OO:spawnve",
+ if (!_PyArg_ParseStack(args, nargs, "iO&OO:spawnve",
&mode, path_converter, &path, &argv, &env)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("spawnve", kwnames)) {
+ goto exit;
+ }
return_value = os_spawnve_impl(module, mode, &path, argv, env);
exit:
@@ -1883,7 +1895,7 @@ os_sched_get_priority_max(PyObject *module, PyObject **args, Py_ssize_t nargs, P
static _PyArg_Parser _parser = {"i:sched_get_priority_max", _keywords, 0};
int policy;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
&policy)) {
goto exit;
}
@@ -1917,7 +1929,7 @@ os_sched_get_priority_min(PyObject *module, PyObject **args, Py_ssize_t nargs, P
static _PyArg_Parser _parser = {"i:sched_get_priority_min", _keywords, 0};
int policy;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
&policy)) {
goto exit;
}
@@ -2008,24 +2020,28 @@ PyDoc_STRVAR(os_sched_setscheduler__doc__,
"param is an instance of sched_param.");
#define OS_SCHED_SETSCHEDULER_METHODDEF \
- {"sched_setscheduler", (PyCFunction)os_sched_setscheduler, METH_VARARGS, os_sched_setscheduler__doc__},
+ {"sched_setscheduler", (PyCFunction)os_sched_setscheduler, METH_FASTCALL, os_sched_setscheduler__doc__},
static PyObject *
os_sched_setscheduler_impl(PyObject *module, pid_t pid, int policy,
struct sched_param *param);
static PyObject *
-os_sched_setscheduler(PyObject *module, PyObject *args)
+os_sched_setscheduler(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
pid_t pid;
int policy;
struct sched_param param;
- if (!PyArg_ParseTuple(args, "" _Py_PARSE_PID "iO&:sched_setscheduler",
+ if (!_PyArg_ParseStack(args, nargs, "" _Py_PARSE_PID "iO&:sched_setscheduler",
&pid, &policy, convert_sched_param, &param)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("sched_setscheduler", kwnames)) {
+ goto exit;
+ }
return_value = os_sched_setscheduler_impl(module, pid, policy, &param);
exit:
@@ -2080,23 +2096,27 @@ PyDoc_STRVAR(os_sched_setparam__doc__,
"param should be an instance of sched_param.");
#define OS_SCHED_SETPARAM_METHODDEF \
- {"sched_setparam", (PyCFunction)os_sched_setparam, METH_VARARGS, os_sched_setparam__doc__},
+ {"sched_setparam", (PyCFunction)os_sched_setparam, METH_FASTCALL, os_sched_setparam__doc__},
static PyObject *
os_sched_setparam_impl(PyObject *module, pid_t pid,
struct sched_param *param);
static PyObject *
-os_sched_setparam(PyObject *module, PyObject *args)
+os_sched_setparam(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
pid_t pid;
struct sched_param param;
- if (!PyArg_ParseTuple(args, "" _Py_PARSE_PID "O&:sched_setparam",
+ if (!_PyArg_ParseStack(args, nargs, "" _Py_PARSE_PID "O&:sched_setparam",
&pid, convert_sched_param, &param)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("sched_setparam", kwnames)) {
+ goto exit;
+ }
return_value = os_sched_setparam_impl(module, pid, &param);
exit:
@@ -2176,22 +2196,26 @@ PyDoc_STRVAR(os_sched_setaffinity__doc__,
"mask should be an iterable of integers identifying CPUs.");
#define OS_SCHED_SETAFFINITY_METHODDEF \
- {"sched_setaffinity", (PyCFunction)os_sched_setaffinity, METH_VARARGS, os_sched_setaffinity__doc__},
+ {"sched_setaffinity", (PyCFunction)os_sched_setaffinity, METH_FASTCALL, os_sched_setaffinity__doc__},
static PyObject *
os_sched_setaffinity_impl(PyObject *module, pid_t pid, PyObject *mask);
static PyObject *
-os_sched_setaffinity(PyObject *module, PyObject *args)
+os_sched_setaffinity(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
pid_t pid;
PyObject *mask;
- if (!PyArg_ParseTuple(args, "" _Py_PARSE_PID "O:sched_setaffinity",
+ if (!_PyArg_ParseStack(args, nargs, "" _Py_PARSE_PID "O:sched_setaffinity",
&pid, &mask)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("sched_setaffinity", kwnames)) {
+ goto exit;
+ }
return_value = os_sched_setaffinity_impl(module, pid, mask);
exit:
@@ -2417,7 +2441,7 @@ os_getpgid(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwname
static _PyArg_Parser _parser = {"" _Py_PARSE_PID ":getpgid", _keywords, 0};
pid_t pid;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
&pid)) {
goto exit;
}
@@ -2551,22 +2575,26 @@ PyDoc_STRVAR(os_kill__doc__,
"Kill a process with a signal.");
#define OS_KILL_METHODDEF \
- {"kill", (PyCFunction)os_kill, METH_VARARGS, os_kill__doc__},
+ {"kill", (PyCFunction)os_kill, METH_FASTCALL, os_kill__doc__},
static PyObject *
os_kill_impl(PyObject *module, pid_t pid, Py_ssize_t signal);
static PyObject *
-os_kill(PyObject *module, PyObject *args)
+os_kill(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
pid_t pid;
Py_ssize_t signal;
- if (!PyArg_ParseTuple(args, "" _Py_PARSE_PID "n:kill",
+ if (!_PyArg_ParseStack(args, nargs, "" _Py_PARSE_PID "n:kill",
&pid, &signal)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("kill", kwnames)) {
+ goto exit;
+ }
return_value = os_kill_impl(module, pid, signal);
exit:
@@ -2584,22 +2612,26 @@ PyDoc_STRVAR(os_killpg__doc__,
"Kill a process group with a signal.");
#define OS_KILLPG_METHODDEF \
- {"killpg", (PyCFunction)os_killpg, METH_VARARGS, os_killpg__doc__},
+ {"killpg", (PyCFunction)os_killpg, METH_FASTCALL, os_killpg__doc__},
static PyObject *
os_killpg_impl(PyObject *module, pid_t pgid, int signal);
static PyObject *
-os_killpg(PyObject *module, PyObject *args)
+os_killpg(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
pid_t pgid;
int signal;
- if (!PyArg_ParseTuple(args, "" _Py_PARSE_PID "i:killpg",
+ if (!_PyArg_ParseStack(args, nargs, "" _Py_PARSE_PID "i:killpg",
&pgid, &signal)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("killpg", kwnames)) {
+ goto exit;
+ }
return_value = os_killpg_impl(module, pgid, signal);
exit:
@@ -2741,22 +2773,26 @@ PyDoc_STRVAR(os_setreuid__doc__,
"Set the current process\'s real and effective user ids.");
#define OS_SETREUID_METHODDEF \
- {"setreuid", (PyCFunction)os_setreuid, METH_VARARGS, os_setreuid__doc__},
+ {"setreuid", (PyCFunction)os_setreuid, METH_FASTCALL, os_setreuid__doc__},
static PyObject *
os_setreuid_impl(PyObject *module, uid_t ruid, uid_t euid);
static PyObject *
-os_setreuid(PyObject *module, PyObject *args)
+os_setreuid(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
uid_t ruid;
uid_t euid;
- if (!PyArg_ParseTuple(args, "O&O&:setreuid",
+ if (!_PyArg_ParseStack(args, nargs, "O&O&:setreuid",
_Py_Uid_Converter, &ruid, _Py_Uid_Converter, &euid)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("setreuid", kwnames)) {
+ goto exit;
+ }
return_value = os_setreuid_impl(module, ruid, euid);
exit:
@@ -2774,22 +2810,26 @@ PyDoc_STRVAR(os_setregid__doc__,
"Set the current process\'s real and effective group ids.");
#define OS_SETREGID_METHODDEF \
- {"setregid", (PyCFunction)os_setregid, METH_VARARGS, os_setregid__doc__},
+ {"setregid", (PyCFunction)os_setregid, METH_FASTCALL, os_setregid__doc__},
static PyObject *
os_setregid_impl(PyObject *module, gid_t rgid, gid_t egid);
static PyObject *
-os_setregid(PyObject *module, PyObject *args)
+os_setregid(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
gid_t rgid;
gid_t egid;
- if (!PyArg_ParseTuple(args, "O&O&:setregid",
+ if (!_PyArg_ParseStack(args, nargs, "O&O&:setregid",
_Py_Gid_Converter, &rgid, _Py_Gid_Converter, &egid)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("setregid", kwnames)) {
+ goto exit;
+ }
return_value = os_setregid_impl(module, rgid, egid);
exit:
@@ -2867,7 +2907,7 @@ os_wait3(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
static _PyArg_Parser _parser = {"i:wait3", _keywords, 0};
int options;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
&options)) {
goto exit;
}
@@ -2905,7 +2945,7 @@ os_wait4(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
pid_t pid;
int options;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
&pid, &options)) {
goto exit;
}
@@ -2937,23 +2977,27 @@ PyDoc_STRVAR(os_waitid__doc__,
"no children in a waitable state.");
#define OS_WAITID_METHODDEF \
- {"waitid", (PyCFunction)os_waitid, METH_VARARGS, os_waitid__doc__},
+ {"waitid", (PyCFunction)os_waitid, METH_FASTCALL, os_waitid__doc__},
static PyObject *
os_waitid_impl(PyObject *module, idtype_t idtype, id_t id, int options);
static PyObject *
-os_waitid(PyObject *module, PyObject *args)
+os_waitid(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
idtype_t idtype;
id_t id;
int options;
- if (!PyArg_ParseTuple(args, "i" _Py_PARSE_PID "i:waitid",
+ if (!_PyArg_ParseStack(args, nargs, "i" _Py_PARSE_PID "i:waitid",
&idtype, &id, &options)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("waitid", kwnames)) {
+ goto exit;
+ }
return_value = os_waitid_impl(module, idtype, id, options);
exit:
@@ -2976,22 +3020,26 @@ PyDoc_STRVAR(os_waitpid__doc__,
"The options argument is ignored on Windows.");
#define OS_WAITPID_METHODDEF \
- {"waitpid", (PyCFunction)os_waitpid, METH_VARARGS, os_waitpid__doc__},
+ {"waitpid", (PyCFunction)os_waitpid, METH_FASTCALL, os_waitpid__doc__},
static PyObject *
os_waitpid_impl(PyObject *module, pid_t pid, int options);
static PyObject *
-os_waitpid(PyObject *module, PyObject *args)
+os_waitpid(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
pid_t pid;
int options;
- if (!PyArg_ParseTuple(args, "" _Py_PARSE_PID "i:waitpid",
+ if (!_PyArg_ParseStack(args, nargs, "" _Py_PARSE_PID "i:waitpid",
&pid, &options)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("waitpid", kwnames)) {
+ goto exit;
+ }
return_value = os_waitpid_impl(module, pid, options);
exit:
@@ -3014,22 +3062,26 @@ PyDoc_STRVAR(os_waitpid__doc__,
"The options argument is ignored on Windows.");
#define OS_WAITPID_METHODDEF \
- {"waitpid", (PyCFunction)os_waitpid, METH_VARARGS, os_waitpid__doc__},
+ {"waitpid", (PyCFunction)os_waitpid, METH_FASTCALL, os_waitpid__doc__},
static PyObject *
os_waitpid_impl(PyObject *module, intptr_t pid, int options);
static PyObject *
-os_waitpid(PyObject *module, PyObject *args)
+os_waitpid(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
intptr_t pid;
int options;
- if (!PyArg_ParseTuple(args, "" _Py_PARSE_INTPTR "i:waitpid",
+ if (!_PyArg_ParseStack(args, nargs, "" _Py_PARSE_INTPTR "i:waitpid",
&pid, &options)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("waitpid", kwnames)) {
+ goto exit;
+ }
return_value = os_waitpid_impl(module, pid, options);
exit:
@@ -3099,7 +3151,7 @@ os_symlink(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwname
int target_is_directory = 0;
int dir_fd = DEFAULT_DIR_FD;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
path_converter, &src, path_converter, &dst, &target_is_directory, SYMLINKAT_DIR_FD_CONVERTER, &dir_fd)) {
goto exit;
}
@@ -3204,22 +3256,26 @@ PyDoc_STRVAR(os_setpgid__doc__,
"Call the system call setpgid(pid, pgrp).");
#define OS_SETPGID_METHODDEF \
- {"setpgid", (PyCFunction)os_setpgid, METH_VARARGS, os_setpgid__doc__},
+ {"setpgid", (PyCFunction)os_setpgid, METH_FASTCALL, os_setpgid__doc__},
static PyObject *
os_setpgid_impl(PyObject *module, pid_t pid, pid_t pgrp);
static PyObject *
-os_setpgid(PyObject *module, PyObject *args)
+os_setpgid(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
pid_t pid;
pid_t pgrp;
- if (!PyArg_ParseTuple(args, "" _Py_PARSE_PID "" _Py_PARSE_PID ":setpgid",
+ if (!_PyArg_ParseStack(args, nargs, "" _Py_PARSE_PID "" _Py_PARSE_PID ":setpgid",
&pid, &pgrp)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("setpgid", kwnames)) {
+ goto exit;
+ }
return_value = os_setpgid_impl(module, pid, pgrp);
exit:
@@ -3268,22 +3324,26 @@ PyDoc_STRVAR(os_tcsetpgrp__doc__,
"Set the process group associated with the terminal specified by fd.");
#define OS_TCSETPGRP_METHODDEF \
- {"tcsetpgrp", (PyCFunction)os_tcsetpgrp, METH_VARARGS, os_tcsetpgrp__doc__},
+ {"tcsetpgrp", (PyCFunction)os_tcsetpgrp, METH_FASTCALL, os_tcsetpgrp__doc__},
static PyObject *
os_tcsetpgrp_impl(PyObject *module, int fd, pid_t pgid);
static PyObject *
-os_tcsetpgrp(PyObject *module, PyObject *args)
+os_tcsetpgrp(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
int fd;
pid_t pgid;
- if (!PyArg_ParseTuple(args, "i" _Py_PARSE_PID ":tcsetpgrp",
+ if (!_PyArg_ParseStack(args, nargs, "i" _Py_PARSE_PID ":tcsetpgrp",
&fd, &pgid)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("tcsetpgrp", kwnames)) {
+ goto exit;
+ }
return_value = os_tcsetpgrp_impl(module, fd, pgid);
exit:
@@ -3321,7 +3381,7 @@ os_open(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
int dir_fd = DEFAULT_DIR_FD;
int _return_value;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
path_converter, &path, &flags, &mode, OPENAT_DIR_FD_CONVERTER, &dir_fd)) {
goto exit;
}
@@ -3358,7 +3418,7 @@ os_close(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
static _PyArg_Parser _parser = {"i:close", _keywords, 0};
int fd;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
&fd)) {
goto exit;
}
@@ -3375,22 +3435,26 @@ PyDoc_STRVAR(os_closerange__doc__,
"Closes all file descriptors in [fd_low, fd_high), ignoring errors.");
#define OS_CLOSERANGE_METHODDEF \
- {"closerange", (PyCFunction)os_closerange, METH_VARARGS, os_closerange__doc__},
+ {"closerange", (PyCFunction)os_closerange, METH_FASTCALL, os_closerange__doc__},
static PyObject *
os_closerange_impl(PyObject *module, int fd_low, int fd_high);
static PyObject *
-os_closerange(PyObject *module, PyObject *args)
+os_closerange(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
int fd_low;
int fd_high;
- if (!PyArg_ParseTuple(args, "ii:closerange",
+ if (!_PyArg_ParseStack(args, nargs, "ii:closerange",
&fd_low, &fd_high)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("closerange", kwnames)) {
+ goto exit;
+ }
return_value = os_closerange_impl(module, fd_low, fd_high);
exit:
@@ -3451,7 +3515,7 @@ os_dup2(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
int fd2;
int inheritable = 1;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
&fd, &fd2, &inheritable)) {
goto exit;
}
@@ -3477,23 +3541,27 @@ PyDoc_STRVAR(os_lockf__doc__,
" The number of bytes to lock, starting at the current position.");
#define OS_LOCKF_METHODDEF \
- {"lockf", (PyCFunction)os_lockf, METH_VARARGS, os_lockf__doc__},
+ {"lockf", (PyCFunction)os_lockf, METH_FASTCALL, os_lockf__doc__},
static PyObject *
os_lockf_impl(PyObject *module, int fd, int command, Py_off_t length);
static PyObject *
-os_lockf(PyObject *module, PyObject *args)
+os_lockf(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
int fd;
int command;
Py_off_t length;
- if (!PyArg_ParseTuple(args, "iiO&:lockf",
+ if (!_PyArg_ParseStack(args, nargs, "iiO&:lockf",
&fd, &command, Py_off_t_converter, &length)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("lockf", kwnames)) {
+ goto exit;
+ }
return_value = os_lockf_impl(module, fd, command, length);
exit:
@@ -3512,13 +3580,13 @@ PyDoc_STRVAR(os_lseek__doc__,
"relative to the beginning of the file.");
#define OS_LSEEK_METHODDEF \
- {"lseek", (PyCFunction)os_lseek, METH_VARARGS, os_lseek__doc__},
+ {"lseek", (PyCFunction)os_lseek, METH_FASTCALL, os_lseek__doc__},
static Py_off_t
os_lseek_impl(PyObject *module, int fd, Py_off_t position, int how);
static PyObject *
-os_lseek(PyObject *module, PyObject *args)
+os_lseek(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
int fd;
@@ -3526,10 +3594,14 @@ os_lseek(PyObject *module, PyObject *args)
int how;
Py_off_t _return_value;
- if (!PyArg_ParseTuple(args, "iO&i:lseek",
+ if (!_PyArg_ParseStack(args, nargs, "iO&i:lseek",
&fd, Py_off_t_converter, &position, &how)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("lseek", kwnames)) {
+ goto exit;
+ }
_return_value = os_lseek_impl(module, fd, position, how);
if ((_return_value == -1) && PyErr_Occurred()) {
goto exit;
@@ -3547,22 +3619,26 @@ PyDoc_STRVAR(os_read__doc__,
"Read from a file descriptor. Returns a bytes object.");
#define OS_READ_METHODDEF \
- {"read", (PyCFunction)os_read, METH_VARARGS, os_read__doc__},
+ {"read", (PyCFunction)os_read, METH_FASTCALL, os_read__doc__},
static PyObject *
os_read_impl(PyObject *module, int fd, Py_ssize_t length);
static PyObject *
-os_read(PyObject *module, PyObject *args)
+os_read(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
int fd;
Py_ssize_t length;
- if (!PyArg_ParseTuple(args, "in:read",
+ if (!_PyArg_ParseStack(args, nargs, "in:read",
&fd, &length)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("read", kwnames)) {
+ goto exit;
+ }
return_value = os_read_impl(module, fd, length);
exit:
@@ -3586,23 +3662,27 @@ PyDoc_STRVAR(os_readv__doc__,
"which may be less than the total capacity of all the buffers.");
#define OS_READV_METHODDEF \
- {"readv", (PyCFunction)os_readv, METH_VARARGS, os_readv__doc__},
+ {"readv", (PyCFunction)os_readv, METH_FASTCALL, os_readv__doc__},
static Py_ssize_t
os_readv_impl(PyObject *module, int fd, PyObject *buffers);
static PyObject *
-os_readv(PyObject *module, PyObject *args)
+os_readv(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
int fd;
PyObject *buffers;
Py_ssize_t _return_value;
- if (!PyArg_ParseTuple(args, "iO:readv",
+ if (!_PyArg_ParseStack(args, nargs, "iO:readv",
&fd, &buffers)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("readv", kwnames)) {
+ goto exit;
+ }
_return_value = os_readv_impl(module, fd, buffers);
if ((_return_value == -1) && PyErr_Occurred()) {
goto exit;
@@ -3627,23 +3707,27 @@ PyDoc_STRVAR(os_pread__doc__,
"the beginning of the file. The file offset remains unchanged.");
#define OS_PREAD_METHODDEF \
- {"pread", (PyCFunction)os_pread, METH_VARARGS, os_pread__doc__},
+ {"pread", (PyCFunction)os_pread, METH_FASTCALL, os_pread__doc__},
static PyObject *
os_pread_impl(PyObject *module, int fd, int length, Py_off_t offset);
static PyObject *
-os_pread(PyObject *module, PyObject *args)
+os_pread(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
int fd;
int length;
Py_off_t offset;
- if (!PyArg_ParseTuple(args, "iiO&:pread",
+ if (!_PyArg_ParseStack(args, nargs, "iiO&:pread",
&fd, &length, Py_off_t_converter, &offset)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("pread", kwnames)) {
+ goto exit;
+ }
return_value = os_pread_impl(module, fd, length, offset);
exit:
@@ -3659,23 +3743,27 @@ PyDoc_STRVAR(os_write__doc__,
"Write a bytes object to a file descriptor.");
#define OS_WRITE_METHODDEF \
- {"write", (PyCFunction)os_write, METH_VARARGS, os_write__doc__},
+ {"write", (PyCFunction)os_write, METH_FASTCALL, os_write__doc__},
static Py_ssize_t
os_write_impl(PyObject *module, int fd, Py_buffer *data);
static PyObject *
-os_write(PyObject *module, PyObject *args)
+os_write(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
int fd;
Py_buffer data = {NULL, NULL};
Py_ssize_t _return_value;
- if (!PyArg_ParseTuple(args, "iy*:write",
+ if (!_PyArg_ParseStack(args, nargs, "iy*:write",
&fd, &data)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("write", kwnames)) {
+ goto exit;
+ }
_return_value = os_write_impl(module, fd, &data);
if ((_return_value == -1) && PyErr_Occurred()) {
goto exit;
@@ -3714,7 +3802,7 @@ os_fstat(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
static _PyArg_Parser _parser = {"i:fstat", _keywords, 0};
int fd;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
&fd)) {
goto exit;
}
@@ -3833,23 +3921,27 @@ PyDoc_STRVAR(os_writev__doc__,
"buffers must be a sequence of bytes-like objects.");
#define OS_WRITEV_METHODDEF \
- {"writev", (PyCFunction)os_writev, METH_VARARGS, os_writev__doc__},
+ {"writev", (PyCFunction)os_writev, METH_FASTCALL, os_writev__doc__},
static Py_ssize_t
os_writev_impl(PyObject *module, int fd, PyObject *buffers);
static PyObject *
-os_writev(PyObject *module, PyObject *args)
+os_writev(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
int fd;
PyObject *buffers;
Py_ssize_t _return_value;
- if (!PyArg_ParseTuple(args, "iO:writev",
+ if (!_PyArg_ParseStack(args, nargs, "iO:writev",
&fd, &buffers)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("writev", kwnames)) {
+ goto exit;
+ }
_return_value = os_writev_impl(module, fd, buffers);
if ((_return_value == -1) && PyErr_Occurred()) {
goto exit;
@@ -3875,13 +3967,13 @@ PyDoc_STRVAR(os_pwrite__doc__,
"current file offset.");
#define OS_PWRITE_METHODDEF \
- {"pwrite", (PyCFunction)os_pwrite, METH_VARARGS, os_pwrite__doc__},
+ {"pwrite", (PyCFunction)os_pwrite, METH_FASTCALL, os_pwrite__doc__},
static Py_ssize_t
os_pwrite_impl(PyObject *module, int fd, Py_buffer *buffer, Py_off_t offset);
static PyObject *
-os_pwrite(PyObject *module, PyObject *args)
+os_pwrite(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
int fd;
@@ -3889,10 +3981,14 @@ os_pwrite(PyObject *module, PyObject *args)
Py_off_t offset;
Py_ssize_t _return_value;
- if (!PyArg_ParseTuple(args, "iy*O&:pwrite",
+ if (!_PyArg_ParseStack(args, nargs, "iy*O&:pwrite",
&fd, &buffer, Py_off_t_converter, &offset)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("pwrite", kwnames)) {
+ goto exit;
+ }
_return_value = os_pwrite_impl(module, fd, &buffer, offset);
if ((_return_value == -1) && PyErr_Occurred()) {
goto exit;
@@ -3939,7 +4035,7 @@ os_mkfifo(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames
int mode = 438;
int dir_fd = DEFAULT_DIR_FD;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
path_converter, &path, &mode, MKFIFOAT_DIR_FD_CONVERTER, &dir_fd)) {
goto exit;
}
@@ -3992,7 +4088,7 @@ os_mknod(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
dev_t device = 0;
int dir_fd = DEFAULT_DIR_FD;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
path_converter, &path, &mode, _Py_Dev_Converter, &device, MKNODAT_DIR_FD_CONVERTER, &dir_fd)) {
goto exit;
}
@@ -4088,23 +4184,27 @@ PyDoc_STRVAR(os_makedev__doc__,
"Composes a raw device number from the major and minor device numbers.");
#define OS_MAKEDEV_METHODDEF \
- {"makedev", (PyCFunction)os_makedev, METH_VARARGS, os_makedev__doc__},
+ {"makedev", (PyCFunction)os_makedev, METH_FASTCALL, os_makedev__doc__},
static dev_t
os_makedev_impl(PyObject *module, int major, int minor);
static PyObject *
-os_makedev(PyObject *module, PyObject *args)
+os_makedev(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
int major;
int minor;
dev_t _return_value;
- if (!PyArg_ParseTuple(args, "ii:makedev",
+ if (!_PyArg_ParseStack(args, nargs, "ii:makedev",
&major, &minor)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("makedev", kwnames)) {
+ goto exit;
+ }
_return_value = os_makedev_impl(module, major, minor);
if ((_return_value == (dev_t)-1) && PyErr_Occurred()) {
goto exit;
@@ -4126,22 +4226,26 @@ PyDoc_STRVAR(os_ftruncate__doc__,
"Truncate a file, specified by file descriptor, to a specific length.");
#define OS_FTRUNCATE_METHODDEF \
- {"ftruncate", (PyCFunction)os_ftruncate, METH_VARARGS, os_ftruncate__doc__},
+ {"ftruncate", (PyCFunction)os_ftruncate, METH_FASTCALL, os_ftruncate__doc__},
static PyObject *
os_ftruncate_impl(PyObject *module, int fd, Py_off_t length);
static PyObject *
-os_ftruncate(PyObject *module, PyObject *args)
+os_ftruncate(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
int fd;
Py_off_t length;
- if (!PyArg_ParseTuple(args, "iO&:ftruncate",
+ if (!_PyArg_ParseStack(args, nargs, "iO&:ftruncate",
&fd, Py_off_t_converter, &length)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("ftruncate", kwnames)) {
+ goto exit;
+ }
return_value = os_ftruncate_impl(module, fd, length);
exit:
@@ -4176,7 +4280,7 @@ os_truncate(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnam
path_t path = PATH_T_INITIALIZE("truncate", "path", 0, PATH_HAVE_FTRUNCATE);
Py_off_t length;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
path_converter, &path, Py_off_t_converter, &length)) {
goto exit;
}
@@ -4203,24 +4307,28 @@ PyDoc_STRVAR(os_posix_fallocate__doc__,
"starting at offset bytes from the beginning and continuing for length bytes.");
#define OS_POSIX_FALLOCATE_METHODDEF \
- {"posix_fallocate", (PyCFunction)os_posix_fallocate, METH_VARARGS, os_posix_fallocate__doc__},
+ {"posix_fallocate", (PyCFunction)os_posix_fallocate, METH_FASTCALL, os_posix_fallocate__doc__},
static PyObject *
os_posix_fallocate_impl(PyObject *module, int fd, Py_off_t offset,
Py_off_t length);
static PyObject *
-os_posix_fallocate(PyObject *module, PyObject *args)
+os_posix_fallocate(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
int fd;
Py_off_t offset;
Py_off_t length;
- if (!PyArg_ParseTuple(args, "iO&O&:posix_fallocate",
+ if (!_PyArg_ParseStack(args, nargs, "iO&O&:posix_fallocate",
&fd, Py_off_t_converter, &offset, Py_off_t_converter, &length)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("posix_fallocate", kwnames)) {
+ goto exit;
+ }
return_value = os_posix_fallocate_impl(module, fd, offset, length);
exit:
@@ -4246,14 +4354,14 @@ PyDoc_STRVAR(os_posix_fadvise__doc__,
"POSIX_FADV_DONTNEED.");
#define OS_POSIX_FADVISE_METHODDEF \
- {"posix_fadvise", (PyCFunction)os_posix_fadvise, METH_VARARGS, os_posix_fadvise__doc__},
+ {"posix_fadvise", (PyCFunction)os_posix_fadvise, METH_FASTCALL, os_posix_fadvise__doc__},
static PyObject *
os_posix_fadvise_impl(PyObject *module, int fd, Py_off_t offset,
Py_off_t length, int advice);
static PyObject *
-os_posix_fadvise(PyObject *module, PyObject *args)
+os_posix_fadvise(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
int fd;
@@ -4261,10 +4369,14 @@ os_posix_fadvise(PyObject *module, PyObject *args)
Py_off_t length;
int advice;
- if (!PyArg_ParseTuple(args, "iO&O&i:posix_fadvise",
+ if (!_PyArg_ParseStack(args, nargs, "iO&O&i:posix_fadvise",
&fd, Py_off_t_converter, &offset, Py_off_t_converter, &length, &advice)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("posix_fadvise", kwnames)) {
+ goto exit;
+ }
return_value = os_posix_fadvise_impl(module, fd, offset, length, advice);
exit:
@@ -4282,22 +4394,26 @@ PyDoc_STRVAR(os_putenv__doc__,
"Change or add an environment variable.");
#define OS_PUTENV_METHODDEF \
- {"putenv", (PyCFunction)os_putenv, METH_VARARGS, os_putenv__doc__},
+ {"putenv", (PyCFunction)os_putenv, METH_FASTCALL, os_putenv__doc__},
static PyObject *
os_putenv_impl(PyObject *module, PyObject *name, PyObject *value);
static PyObject *
-os_putenv(PyObject *module, PyObject *args)
+os_putenv(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
PyObject *name;
PyObject *value;
- if (!PyArg_ParseTuple(args, "UU:putenv",
+ if (!_PyArg_ParseStack(args, nargs, "UU:putenv",
&name, &value)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("putenv", kwnames)) {
+ goto exit;
+ }
return_value = os_putenv_impl(module, name, value);
exit:
@@ -4315,22 +4431,26 @@ PyDoc_STRVAR(os_putenv__doc__,
"Change or add an environment variable.");
#define OS_PUTENV_METHODDEF \
- {"putenv", (PyCFunction)os_putenv, METH_VARARGS, os_putenv__doc__},
+ {"putenv", (PyCFunction)os_putenv, METH_FASTCALL, os_putenv__doc__},
static PyObject *
os_putenv_impl(PyObject *module, PyObject *name, PyObject *value);
static PyObject *
-os_putenv(PyObject *module, PyObject *args)
+os_putenv(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
PyObject *name = NULL;
PyObject *value = NULL;
- if (!PyArg_ParseTuple(args, "O&O&:putenv",
+ if (!_PyArg_ParseStack(args, nargs, "O&O&:putenv",
PyUnicode_FSConverter, &name, PyUnicode_FSConverter, &value)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("putenv", kwnames)) {
+ goto exit;
+ }
return_value = os_putenv_impl(module, name, value);
exit:
@@ -4467,7 +4587,7 @@ os_WIFCONTINUED(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *k
int status;
int _return_value;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
&status)) {
goto exit;
}
@@ -4506,7 +4626,7 @@ os_WIFSTOPPED(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwn
int status;
int _return_value;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
&status)) {
goto exit;
}
@@ -4545,7 +4665,7 @@ os_WIFSIGNALED(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kw
int status;
int _return_value;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
&status)) {
goto exit;
}
@@ -4584,7 +4704,7 @@ os_WIFEXITED(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwna
int status;
int _return_value;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
&status)) {
goto exit;
}
@@ -4623,7 +4743,7 @@ os_WEXITSTATUS(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kw
int status;
int _return_value;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
&status)) {
goto exit;
}
@@ -4662,7 +4782,7 @@ os_WTERMSIG(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnam
int status;
int _return_value;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
&status)) {
goto exit;
}
@@ -4701,7 +4821,7 @@ os_WSTOPSIG(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnam
int status;
int _return_value;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
&status)) {
goto exit;
}
@@ -4776,7 +4896,7 @@ os_statvfs(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwname
static _PyArg_Parser _parser = {"O&:statvfs", _keywords, 0};
path_t path = PATH_T_INITIALIZE("statvfs", "path", 0, PATH_HAVE_FSTATVFS);
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
path_converter, &path)) {
goto exit;
}
@@ -4813,7 +4933,7 @@ os__getdiskusage(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *
static _PyArg_Parser _parser = {"u:_getdiskusage", _keywords, 0};
Py_UNICODE *path;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
&path)) {
goto exit;
}
@@ -4836,23 +4956,27 @@ PyDoc_STRVAR(os_fpathconf__doc__,
"If there is no limit, return -1.");
#define OS_FPATHCONF_METHODDEF \
- {"fpathconf", (PyCFunction)os_fpathconf, METH_VARARGS, os_fpathconf__doc__},
+ {"fpathconf", (PyCFunction)os_fpathconf, METH_FASTCALL, os_fpathconf__doc__},
static long
os_fpathconf_impl(PyObject *module, int fd, int name);
static PyObject *
-os_fpathconf(PyObject *module, PyObject *args)
+os_fpathconf(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
int fd;
int name;
long _return_value;
- if (!PyArg_ParseTuple(args, "iO&:fpathconf",
+ if (!_PyArg_ParseStack(args, nargs, "iO&:fpathconf",
&fd, conv_path_confname, &name)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("fpathconf", kwnames)) {
+ goto exit;
+ }
_return_value = os_fpathconf_impl(module, fd, name);
if ((_return_value == -1) && PyErr_Occurred()) {
goto exit;
@@ -4893,7 +5017,7 @@ os_pathconf(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnam
int name;
long _return_value;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
path_converter, &path, conv_path_confname, &name)) {
goto exit;
}
@@ -5040,7 +5164,7 @@ os_startfile(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwna
path_t filepath = PATH_T_INITIALIZE("startfile", "filepath", 0, 0);
Py_UNICODE *operation = NULL;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
path_converter, &filepath, &operation)) {
goto exit;
}
@@ -5104,7 +5228,7 @@ os_device_encoding(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject
static _PyArg_Parser _parser = {"i:device_encoding", _keywords, 0};
int fd;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
&fd)) {
goto exit;
}
@@ -5123,23 +5247,27 @@ PyDoc_STRVAR(os_setresuid__doc__,
"Set the current process\'s real, effective, and saved user ids.");
#define OS_SETRESUID_METHODDEF \
- {"setresuid", (PyCFunction)os_setresuid, METH_VARARGS, os_setresuid__doc__},
+ {"setresuid", (PyCFunction)os_setresuid, METH_FASTCALL, os_setresuid__doc__},
static PyObject *
os_setresuid_impl(PyObject *module, uid_t ruid, uid_t euid, uid_t suid);
static PyObject *
-os_setresuid(PyObject *module, PyObject *args)
+os_setresuid(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
uid_t ruid;
uid_t euid;
uid_t suid;
- if (!PyArg_ParseTuple(args, "O&O&O&:setresuid",
+ if (!_PyArg_ParseStack(args, nargs, "O&O&O&:setresuid",
_Py_Uid_Converter, &ruid, _Py_Uid_Converter, &euid, _Py_Uid_Converter, &suid)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("setresuid", kwnames)) {
+ goto exit;
+ }
return_value = os_setresuid_impl(module, ruid, euid, suid);
exit:
@@ -5157,23 +5285,27 @@ PyDoc_STRVAR(os_setresgid__doc__,
"Set the current process\'s real, effective, and saved group ids.");
#define OS_SETRESGID_METHODDEF \
- {"setresgid", (PyCFunction)os_setresgid, METH_VARARGS, os_setresgid__doc__},
+ {"setresgid", (PyCFunction)os_setresgid, METH_FASTCALL, os_setresgid__doc__},
static PyObject *
os_setresgid_impl(PyObject *module, gid_t rgid, gid_t egid, gid_t sgid);
static PyObject *
-os_setresgid(PyObject *module, PyObject *args)
+os_setresgid(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
gid_t rgid;
gid_t egid;
gid_t sgid;
- if (!PyArg_ParseTuple(args, "O&O&O&:setresgid",
+ if (!_PyArg_ParseStack(args, nargs, "O&O&O&:setresgid",
_Py_Gid_Converter, &rgid, _Py_Gid_Converter, &egid, _Py_Gid_Converter, &sgid)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("setresgid", kwnames)) {
+ goto exit;
+ }
return_value = os_setresgid_impl(module, rgid, egid, sgid);
exit:
@@ -5256,7 +5388,7 @@ os_getxattr(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnam
path_t attribute = PATH_T_INITIALIZE("getxattr", "attribute", 0, 0);
int follow_symlinks = 1;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
path_converter, &path, path_converter, &attribute, &follow_symlinks)) {
goto exit;
}
@@ -5306,7 +5438,7 @@ os_setxattr(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnam
int flags = 0;
int follow_symlinks = 1;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
path_converter, &path, path_converter, &attribute, &value, &flags, &follow_symlinks)) {
goto exit;
}
@@ -5357,7 +5489,7 @@ os_removexattr(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kw
path_t attribute = PATH_T_INITIALIZE("removexattr", "attribute", 0, 0);
int follow_symlinks = 1;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
path_converter, &path, path_converter, &attribute, &follow_symlinks)) {
goto exit;
}
@@ -5403,7 +5535,7 @@ os_listxattr(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwna
path_t path = PATH_T_INITIALIZE("listxattr", "path", 1, 1);
int follow_symlinks = 1;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
path_converter, &path, &follow_symlinks)) {
goto exit;
}
@@ -5506,22 +5638,26 @@ PyDoc_STRVAR(os_set_inheritable__doc__,
"Set the inheritable flag of the specified file descriptor.");
#define OS_SET_INHERITABLE_METHODDEF \
- {"set_inheritable", (PyCFunction)os_set_inheritable, METH_VARARGS, os_set_inheritable__doc__},
+ {"set_inheritable", (PyCFunction)os_set_inheritable, METH_FASTCALL, os_set_inheritable__doc__},
static PyObject *
os_set_inheritable_impl(PyObject *module, int fd, int inheritable);
static PyObject *
-os_set_inheritable(PyObject *module, PyObject *args)
+os_set_inheritable(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
int fd;
int inheritable;
- if (!PyArg_ParseTuple(args, "ii:set_inheritable",
+ if (!_PyArg_ParseStack(args, nargs, "ii:set_inheritable",
&fd, &inheritable)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("set_inheritable", kwnames)) {
+ goto exit;
+ }
return_value = os_set_inheritable_impl(module, fd, inheritable);
exit:
@@ -5573,23 +5709,27 @@ PyDoc_STRVAR(os_set_handle_inheritable__doc__,
"Set the inheritable flag of the specified handle.");
#define OS_SET_HANDLE_INHERITABLE_METHODDEF \
- {"set_handle_inheritable", (PyCFunction)os_set_handle_inheritable, METH_VARARGS, os_set_handle_inheritable__doc__},
+ {"set_handle_inheritable", (PyCFunction)os_set_handle_inheritable, METH_FASTCALL, os_set_handle_inheritable__doc__},
static PyObject *
os_set_handle_inheritable_impl(PyObject *module, intptr_t handle,
int inheritable);
static PyObject *
-os_set_handle_inheritable(PyObject *module, PyObject *args)
+os_set_handle_inheritable(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
intptr_t handle;
int inheritable;
- if (!PyArg_ParseTuple(args, "" _Py_PARSE_INTPTR "p:set_handle_inheritable",
+ if (!_PyArg_ParseStack(args, nargs, "" _Py_PARSE_INTPTR "p:set_handle_inheritable",
&handle, &inheritable)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("set_handle_inheritable", kwnames)) {
+ goto exit;
+ }
return_value = os_set_handle_inheritable_impl(module, handle, inheritable);
exit:
@@ -5598,6 +5738,209 @@ exit:
#endif /* defined(MS_WINDOWS) */
+PyDoc_STRVAR(os_DirEntry_is_symlink__doc__,
+"is_symlink($self, /)\n"
+"--\n"
+"\n"
+"Return True if the entry is a symbolic link; cached per entry.");
+
+#define OS_DIRENTRY_IS_SYMLINK_METHODDEF \
+ {"is_symlink", (PyCFunction)os_DirEntry_is_symlink, METH_NOARGS, os_DirEntry_is_symlink__doc__},
+
+static int
+os_DirEntry_is_symlink_impl(DirEntry *self);
+
+static PyObject *
+os_DirEntry_is_symlink(DirEntry *self, PyObject *Py_UNUSED(ignored))
+{
+ PyObject *return_value = NULL;
+ int _return_value;
+
+ _return_value = os_DirEntry_is_symlink_impl(self);
+ if ((_return_value == -1) && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = PyBool_FromLong((long)_return_value);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(os_DirEntry_stat__doc__,
+"stat($self, /, *, follow_symlinks=True)\n"
+"--\n"
+"\n"
+"Return stat_result object for the entry; cached per entry.");
+
+#define OS_DIRENTRY_STAT_METHODDEF \
+ {"stat", (PyCFunction)os_DirEntry_stat, METH_FASTCALL, os_DirEntry_stat__doc__},
+
+static PyObject *
+os_DirEntry_stat_impl(DirEntry *self, int follow_symlinks);
+
+static PyObject *
+os_DirEntry_stat(DirEntry *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ static const char * const _keywords[] = {"follow_symlinks", NULL};
+ static _PyArg_Parser _parser = {"|$p:stat", _keywords, 0};
+ int follow_symlinks = 1;
+
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
+ &follow_symlinks)) {
+ goto exit;
+ }
+ return_value = os_DirEntry_stat_impl(self, follow_symlinks);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(os_DirEntry_is_dir__doc__,
+"is_dir($self, /, *, follow_symlinks=True)\n"
+"--\n"
+"\n"
+"Return True if the entry is a directory; cached per entry.");
+
+#define OS_DIRENTRY_IS_DIR_METHODDEF \
+ {"is_dir", (PyCFunction)os_DirEntry_is_dir, METH_FASTCALL, os_DirEntry_is_dir__doc__},
+
+static int
+os_DirEntry_is_dir_impl(DirEntry *self, int follow_symlinks);
+
+static PyObject *
+os_DirEntry_is_dir(DirEntry *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ static const char * const _keywords[] = {"follow_symlinks", NULL};
+ static _PyArg_Parser _parser = {"|$p:is_dir", _keywords, 0};
+ int follow_symlinks = 1;
+ int _return_value;
+
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
+ &follow_symlinks)) {
+ goto exit;
+ }
+ _return_value = os_DirEntry_is_dir_impl(self, follow_symlinks);
+ if ((_return_value == -1) && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = PyBool_FromLong((long)_return_value);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(os_DirEntry_is_file__doc__,
+"is_file($self, /, *, follow_symlinks=True)\n"
+"--\n"
+"\n"
+"Return True if the entry is a file; cached per entry.");
+
+#define OS_DIRENTRY_IS_FILE_METHODDEF \
+ {"is_file", (PyCFunction)os_DirEntry_is_file, METH_FASTCALL, os_DirEntry_is_file__doc__},
+
+static int
+os_DirEntry_is_file_impl(DirEntry *self, int follow_symlinks);
+
+static PyObject *
+os_DirEntry_is_file(DirEntry *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ static const char * const _keywords[] = {"follow_symlinks", NULL};
+ static _PyArg_Parser _parser = {"|$p:is_file", _keywords, 0};
+ int follow_symlinks = 1;
+ int _return_value;
+
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
+ &follow_symlinks)) {
+ goto exit;
+ }
+ _return_value = os_DirEntry_is_file_impl(self, follow_symlinks);
+ if ((_return_value == -1) && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = PyBool_FromLong((long)_return_value);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(os_DirEntry_inode__doc__,
+"inode($self, /)\n"
+"--\n"
+"\n"
+"Return inode of the entry; cached per entry.");
+
+#define OS_DIRENTRY_INODE_METHODDEF \
+ {"inode", (PyCFunction)os_DirEntry_inode, METH_NOARGS, os_DirEntry_inode__doc__},
+
+static PyObject *
+os_DirEntry_inode_impl(DirEntry *self);
+
+static PyObject *
+os_DirEntry_inode(DirEntry *self, PyObject *Py_UNUSED(ignored))
+{
+ return os_DirEntry_inode_impl(self);
+}
+
+PyDoc_STRVAR(os_DirEntry___fspath____doc__,
+"__fspath__($self, /)\n"
+"--\n"
+"\n"
+"Returns the path for the entry.");
+
+#define OS_DIRENTRY___FSPATH___METHODDEF \
+ {"__fspath__", (PyCFunction)os_DirEntry___fspath__, METH_NOARGS, os_DirEntry___fspath____doc__},
+
+static PyObject *
+os_DirEntry___fspath___impl(DirEntry *self);
+
+static PyObject *
+os_DirEntry___fspath__(DirEntry *self, PyObject *Py_UNUSED(ignored))
+{
+ return os_DirEntry___fspath___impl(self);
+}
+
+PyDoc_STRVAR(os_scandir__doc__,
+"scandir($module, /, path=None)\n"
+"--\n"
+"\n"
+"Return an iterator of DirEntry objects for given path.\n"
+"\n"
+"path can be specified as either str, bytes or path-like object. If path\n"
+"is bytes, the names of yielded DirEntry objects will also be bytes; in\n"
+"all other circumstances they will be str.\n"
+"\n"
+"If path is None, uses the path=\'.\'.");
+
+#define OS_SCANDIR_METHODDEF \
+ {"scandir", (PyCFunction)os_scandir, METH_FASTCALL, os_scandir__doc__},
+
+static PyObject *
+os_scandir_impl(PyObject *module, path_t *path);
+
+static PyObject *
+os_scandir(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ static const char * const _keywords[] = {"path", NULL};
+ static _PyArg_Parser _parser = {"|O&:scandir", _keywords, 0};
+ path_t path = PATH_T_INITIALIZE("scandir", "path", 1, 0);
+
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
+ path_converter, &path)) {
+ goto exit;
+ }
+ return_value = os_scandir_impl(module, &path);
+
+exit:
+ /* Cleanup for path */
+ path_cleanup(&path);
+
+ return return_value;
+}
+
PyDoc_STRVAR(os_fspath__doc__,
"fspath($module, /, path)\n"
"--\n"
@@ -5622,7 +5965,7 @@ os_fspath(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames
static _PyArg_Parser _parser = {"O:fspath", _keywords, 0};
PyObject *path;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
&path)) {
goto exit;
}
@@ -5655,7 +5998,7 @@ os_getrandom(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwna
Py_ssize_t size;
int flags = 0;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
&size, &flags)) {
goto exit;
}
@@ -6150,4 +6493,4 @@ exit:
#ifndef OS_GETRANDOM_METHODDEF
#define OS_GETRANDOM_METHODDEF
#endif /* !defined(OS_GETRANDOM_METHODDEF) */
-/*[clinic end generated code: output=455def991740915a input=a9049054013a1b77]*/
+/*[clinic end generated code: output=5a0be969e3f71660 input=a9049054013a1b77]*/
diff --git a/Modules/clinic/pyexpat.c.h b/Modules/clinic/pyexpat.c.h
index 75a096cdff..eb6e337c2d 100644
--- a/Modules/clinic/pyexpat.c.h
+++ b/Modules/clinic/pyexpat.c.h
@@ -11,23 +11,27 @@ PyDoc_STRVAR(pyexpat_xmlparser_Parse__doc__,
"`isfinal\' should be true at end of input.");
#define PYEXPAT_XMLPARSER_PARSE_METHODDEF \
- {"Parse", (PyCFunction)pyexpat_xmlparser_Parse, METH_VARARGS, pyexpat_xmlparser_Parse__doc__},
+ {"Parse", (PyCFunction)pyexpat_xmlparser_Parse, METH_FASTCALL, pyexpat_xmlparser_Parse__doc__},
static PyObject *
pyexpat_xmlparser_Parse_impl(xmlparseobject *self, PyObject *data,
int isfinal);
static PyObject *
-pyexpat_xmlparser_Parse(xmlparseobject *self, PyObject *args)
+pyexpat_xmlparser_Parse(xmlparseobject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
PyObject *data;
int isfinal = 0;
- if (!PyArg_ParseTuple(args, "O|i:Parse",
+ if (!_PyArg_ParseStack(args, nargs, "O|i:Parse",
&data, &isfinal)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("Parse", kwnames)) {
+ goto exit;
+ }
return_value = pyexpat_xmlparser_Parse_impl(self, data, isfinal);
exit:
@@ -116,7 +120,7 @@ PyDoc_STRVAR(pyexpat_xmlparser_ExternalEntityParserCreate__doc__,
"Create a parser for parsing an external entity based on the information passed to the ExternalEntityRefHandler.");
#define PYEXPAT_XMLPARSER_EXTERNALENTITYPARSERCREATE_METHODDEF \
- {"ExternalEntityParserCreate", (PyCFunction)pyexpat_xmlparser_ExternalEntityParserCreate, METH_VARARGS, pyexpat_xmlparser_ExternalEntityParserCreate__doc__},
+ {"ExternalEntityParserCreate", (PyCFunction)pyexpat_xmlparser_ExternalEntityParserCreate, METH_FASTCALL, pyexpat_xmlparser_ExternalEntityParserCreate__doc__},
static PyObject *
pyexpat_xmlparser_ExternalEntityParserCreate_impl(xmlparseobject *self,
@@ -124,16 +128,20 @@ pyexpat_xmlparser_ExternalEntityParserCreate_impl(xmlparseobject *self,
const char *encoding);
static PyObject *
-pyexpat_xmlparser_ExternalEntityParserCreate(xmlparseobject *self, PyObject *args)
+pyexpat_xmlparser_ExternalEntityParserCreate(xmlparseobject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
const char *context;
const char *encoding = NULL;
- if (!PyArg_ParseTuple(args, "z|s:ExternalEntityParserCreate",
+ if (!_PyArg_ParseStack(args, nargs, "z|s:ExternalEntityParserCreate",
&context, &encoding)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("ExternalEntityParserCreate", kwnames)) {
+ goto exit;
+ }
return_value = pyexpat_xmlparser_ExternalEntityParserCreate_impl(self, context, encoding);
exit:
@@ -185,21 +193,25 @@ PyDoc_STRVAR(pyexpat_xmlparser_UseForeignDTD__doc__,
"information to the parser. \'flag\' defaults to True if not provided.");
#define PYEXPAT_XMLPARSER_USEFOREIGNDTD_METHODDEF \
- {"UseForeignDTD", (PyCFunction)pyexpat_xmlparser_UseForeignDTD, METH_VARARGS, pyexpat_xmlparser_UseForeignDTD__doc__},
+ {"UseForeignDTD", (PyCFunction)pyexpat_xmlparser_UseForeignDTD, METH_FASTCALL, pyexpat_xmlparser_UseForeignDTD__doc__},
static PyObject *
pyexpat_xmlparser_UseForeignDTD_impl(xmlparseobject *self, int flag);
static PyObject *
-pyexpat_xmlparser_UseForeignDTD(xmlparseobject *self, PyObject *args)
+pyexpat_xmlparser_UseForeignDTD(xmlparseobject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
int flag = 1;
- if (!PyArg_ParseTuple(args, "|p:UseForeignDTD",
+ if (!_PyArg_ParseStack(args, nargs, "|p:UseForeignDTD",
&flag)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("UseForeignDTD", kwnames)) {
+ goto exit;
+ }
return_value = pyexpat_xmlparser_UseForeignDTD_impl(self, flag);
exit:
@@ -249,7 +261,7 @@ pyexpat_ParserCreate(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObje
const char *namespace_separator = NULL;
PyObject *intern = NULL;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
&encoding, &namespace_separator, &intern)) {
goto exit;
}
@@ -289,4 +301,4 @@ exit:
#ifndef PYEXPAT_XMLPARSER_USEFOREIGNDTD_METHODDEF
#define PYEXPAT_XMLPARSER_USEFOREIGNDTD_METHODDEF
#endif /* !defined(PYEXPAT_XMLPARSER_USEFOREIGNDTD_METHODDEF) */
-/*[clinic end generated code: output=e889f7c6af6cc42f input=a9049054013a1b77]*/
+/*[clinic end generated code: output=0548a6b12157e29b input=a9049054013a1b77]*/
diff --git a/Modules/clinic/sha1module.c.h b/Modules/clinic/sha1module.c.h
index b08e92d099..e2f5ac16a3 100644
--- a/Modules/clinic/sha1module.c.h
+++ b/Modules/clinic/sha1module.c.h
@@ -85,7 +85,7 @@ _sha1_sha1(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwname
static _PyArg_Parser _parser = {"|O:sha1", _keywords, 0};
PyObject *string = NULL;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
&string)) {
goto exit;
}
@@ -94,4 +94,4 @@ _sha1_sha1(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwname
exit:
return return_value;
}
-/*[clinic end generated code: output=1430450f3f806895 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=8e6b04c7e0407be2 input=a9049054013a1b77]*/
diff --git a/Modules/clinic/sha256module.c.h b/Modules/clinic/sha256module.c.h
index 115db500f4..e106e38da8 100644
--- a/Modules/clinic/sha256module.c.h
+++ b/Modules/clinic/sha256module.c.h
@@ -85,7 +85,7 @@ _sha256_sha256(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kw
static _PyArg_Parser _parser = {"|O:sha256", _keywords, 0};
PyObject *string = NULL;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
&string)) {
goto exit;
}
@@ -115,7 +115,7 @@ _sha256_sha224(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kw
static _PyArg_Parser _parser = {"|O:sha224", _keywords, 0};
PyObject *string = NULL;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
&string)) {
goto exit;
}
@@ -124,4 +124,4 @@ _sha256_sha224(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kw
exit:
return return_value;
}
-/*[clinic end generated code: output=19439d70db7ead5c input=a9049054013a1b77]*/
+/*[clinic end generated code: output=7ef4927ee2a3aac4 input=a9049054013a1b77]*/
diff --git a/Modules/clinic/sha512module.c.h b/Modules/clinic/sha512module.c.h
index a2b57f71b5..c91dfd27df 100644
--- a/Modules/clinic/sha512module.c.h
+++ b/Modules/clinic/sha512module.c.h
@@ -85,7 +85,7 @@ _sha512_sha512(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kw
static _PyArg_Parser _parser = {"|O:sha512", _keywords, 0};
PyObject *string = NULL;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
&string)) {
goto exit;
}
@@ -115,7 +115,7 @@ _sha512_sha384(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kw
static _PyArg_Parser _parser = {"|O:sha384", _keywords, 0};
PyObject *string = NULL;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
&string)) {
goto exit;
}
@@ -124,4 +124,4 @@ _sha512_sha384(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kw
exit:
return return_value;
}
-/*[clinic end generated code: output=18f15598c3487045 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=7bb7a49159e9b469 input=a9049054013a1b77]*/
diff --git a/Modules/clinic/signalmodule.c.h b/Modules/clinic/signalmodule.c.h
index f8d5bd942b..9e16f32291 100644
--- a/Modules/clinic/signalmodule.c.h
+++ b/Modules/clinic/signalmodule.c.h
@@ -74,22 +74,26 @@ PyDoc_STRVAR(signal_signal__doc__,
"the first is the signal number, the second is the interrupted stack frame.");
#define SIGNAL_SIGNAL_METHODDEF \
- {"signal", (PyCFunction)signal_signal, METH_VARARGS, signal_signal__doc__},
+ {"signal", (PyCFunction)signal_signal, METH_FASTCALL, signal_signal__doc__},
static PyObject *
signal_signal_impl(PyObject *module, int signalnum, PyObject *handler);
static PyObject *
-signal_signal(PyObject *module, PyObject *args)
+signal_signal(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
int signalnum;
PyObject *handler;
- if (!PyArg_ParseTuple(args, "iO:signal",
+ if (!_PyArg_ParseStack(args, nargs, "iO:signal",
&signalnum, &handler)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("signal", kwnames)) {
+ goto exit;
+ }
return_value = signal_signal_impl(module, signalnum, handler);
exit:
@@ -141,22 +145,26 @@ PyDoc_STRVAR(signal_siginterrupt__doc__,
"signal sig, else system calls will be interrupted.");
#define SIGNAL_SIGINTERRUPT_METHODDEF \
- {"siginterrupt", (PyCFunction)signal_siginterrupt, METH_VARARGS, signal_siginterrupt__doc__},
+ {"siginterrupt", (PyCFunction)signal_siginterrupt, METH_FASTCALL, signal_siginterrupt__doc__},
static PyObject *
signal_siginterrupt_impl(PyObject *module, int signalnum, int flag);
static PyObject *
-signal_siginterrupt(PyObject *module, PyObject *args)
+signal_siginterrupt(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
int signalnum;
int flag;
- if (!PyArg_ParseTuple(args, "ii:siginterrupt",
+ if (!_PyArg_ParseStack(args, nargs, "ii:siginterrupt",
&signalnum, &flag)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("siginterrupt", kwnames)) {
+ goto exit;
+ }
return_value = signal_siginterrupt_impl(module, signalnum, flag);
exit:
@@ -179,24 +187,28 @@ PyDoc_STRVAR(signal_setitimer__doc__,
"Returns old values as a tuple: (delay, interval).");
#define SIGNAL_SETITIMER_METHODDEF \
- {"setitimer", (PyCFunction)signal_setitimer, METH_VARARGS, signal_setitimer__doc__},
+ {"setitimer", (PyCFunction)signal_setitimer, METH_FASTCALL, signal_setitimer__doc__},
static PyObject *
signal_setitimer_impl(PyObject *module, int which, double seconds,
double interval);
static PyObject *
-signal_setitimer(PyObject *module, PyObject *args)
+signal_setitimer(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
int which;
double seconds;
double interval = 0.0;
- if (!PyArg_ParseTuple(args, "id|d:setitimer",
+ if (!_PyArg_ParseStack(args, nargs, "id|d:setitimer",
&which, &seconds, &interval)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("setitimer", kwnames)) {
+ goto exit;
+ }
return_value = signal_setitimer_impl(module, which, seconds, interval);
exit:
@@ -245,22 +257,26 @@ PyDoc_STRVAR(signal_pthread_sigmask__doc__,
"Fetch and/or change the signal mask of the calling thread.");
#define SIGNAL_PTHREAD_SIGMASK_METHODDEF \
- {"pthread_sigmask", (PyCFunction)signal_pthread_sigmask, METH_VARARGS, signal_pthread_sigmask__doc__},
+ {"pthread_sigmask", (PyCFunction)signal_pthread_sigmask, METH_FASTCALL, signal_pthread_sigmask__doc__},
static PyObject *
signal_pthread_sigmask_impl(PyObject *module, int how, PyObject *mask);
static PyObject *
-signal_pthread_sigmask(PyObject *module, PyObject *args)
+signal_pthread_sigmask(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
int how;
PyObject *mask;
- if (!PyArg_ParseTuple(args, "iO:pthread_sigmask",
+ if (!_PyArg_ParseStack(args, nargs, "iO:pthread_sigmask",
&how, &mask)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("pthread_sigmask", kwnames)) {
+ goto exit;
+ }
return_value = signal_pthread_sigmask_impl(module, how, mask);
exit:
@@ -337,24 +353,28 @@ PyDoc_STRVAR(signal_sigtimedwait__doc__,
"The timeout is specified in seconds, with floating point numbers allowed.");
#define SIGNAL_SIGTIMEDWAIT_METHODDEF \
- {"sigtimedwait", (PyCFunction)signal_sigtimedwait, METH_VARARGS, signal_sigtimedwait__doc__},
+ {"sigtimedwait", (PyCFunction)signal_sigtimedwait, METH_FASTCALL, signal_sigtimedwait__doc__},
static PyObject *
signal_sigtimedwait_impl(PyObject *module, PyObject *sigset,
PyObject *timeout_obj);
static PyObject *
-signal_sigtimedwait(PyObject *module, PyObject *args)
+signal_sigtimedwait(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
PyObject *sigset;
PyObject *timeout_obj;
- if (!PyArg_UnpackTuple(args, "sigtimedwait",
+ if (!_PyArg_UnpackStack(args, nargs, "sigtimedwait",
2, 2,
&sigset, &timeout_obj)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("sigtimedwait", kwnames)) {
+ goto exit;
+ }
return_value = signal_sigtimedwait_impl(module, sigset, timeout_obj);
exit:
@@ -372,22 +392,26 @@ PyDoc_STRVAR(signal_pthread_kill__doc__,
"Send a signal to a thread.");
#define SIGNAL_PTHREAD_KILL_METHODDEF \
- {"pthread_kill", (PyCFunction)signal_pthread_kill, METH_VARARGS, signal_pthread_kill__doc__},
+ {"pthread_kill", (PyCFunction)signal_pthread_kill, METH_FASTCALL, signal_pthread_kill__doc__},
static PyObject *
signal_pthread_kill_impl(PyObject *module, long thread_id, int signalnum);
static PyObject *
-signal_pthread_kill(PyObject *module, PyObject *args)
+signal_pthread_kill(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
long thread_id;
int signalnum;
- if (!PyArg_ParseTuple(args, "li:pthread_kill",
+ if (!_PyArg_ParseStack(args, nargs, "li:pthread_kill",
&thread_id, &signalnum)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("pthread_kill", kwnames)) {
+ goto exit;
+ }
return_value = signal_pthread_kill_impl(module, thread_id, signalnum);
exit:
@@ -439,4 +463,4 @@ exit:
#ifndef SIGNAL_PTHREAD_KILL_METHODDEF
#define SIGNAL_PTHREAD_KILL_METHODDEF
#endif /* !defined(SIGNAL_PTHREAD_KILL_METHODDEF) */
-/*[clinic end generated code: output=c6990ef0d0ba72b6 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=fab3dba32c058588 input=a9049054013a1b77]*/
diff --git a/Modules/clinic/symtablemodule.c.h b/Modules/clinic/symtablemodule.c.h
new file mode 100644
index 0000000000..126ee0b7f5
--- /dev/null
+++ b/Modules/clinic/symtablemodule.c.h
@@ -0,0 +1,39 @@
+/*[clinic input]
+preserve
+[clinic start generated code]*/
+
+PyDoc_STRVAR(_symtable_symtable__doc__,
+"symtable($module, str, filename, startstr, /)\n"
+"--\n"
+"\n"
+"Return symbol and scope dictionaries used internally by compiler.");
+
+#define _SYMTABLE_SYMTABLE_METHODDEF \
+ {"symtable", (PyCFunction)_symtable_symtable, METH_FASTCALL, _symtable_symtable__doc__},
+
+static PyObject *
+_symtable_symtable_impl(PyObject *module, const char *str,
+ PyObject *filename, const char *startstr);
+
+static PyObject *
+_symtable_symtable(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ const char *str;
+ PyObject *filename;
+ const char *startstr;
+
+ if (!_PyArg_ParseStack(args, nargs, "sO&s:symtable",
+ &str, PyUnicode_FSDecoder, &filename, &startstr)) {
+ goto exit;
+ }
+
+ if (!_PyArg_NoStackKeywords("symtable", kwnames)) {
+ goto exit;
+ }
+ return_value = _symtable_symtable_impl(module, str, filename, startstr);
+
+exit:
+ return return_value;
+}
+/*[clinic end generated code: output=071dee4d836e2cfd input=a9049054013a1b77]*/
diff --git a/Modules/clinic/unicodedata.c.h b/Modules/clinic/unicodedata.c.h
index d481ccbe64..c3a5910b49 100644
--- a/Modules/clinic/unicodedata.c.h
+++ b/Modules/clinic/unicodedata.c.h
@@ -13,23 +13,27 @@ PyDoc_STRVAR(unicodedata_UCD_decimal__doc__,
"ValueError is raised.");
#define UNICODEDATA_UCD_DECIMAL_METHODDEF \
- {"decimal", (PyCFunction)unicodedata_UCD_decimal, METH_VARARGS, unicodedata_UCD_decimal__doc__},
+ {"decimal", (PyCFunction)unicodedata_UCD_decimal, METH_FASTCALL, unicodedata_UCD_decimal__doc__},
static PyObject *
unicodedata_UCD_decimal_impl(PyObject *self, int chr,
PyObject *default_value);
static PyObject *
-unicodedata_UCD_decimal(PyObject *self, PyObject *args)
+unicodedata_UCD_decimal(PyObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
int chr;
PyObject *default_value = NULL;
- if (!PyArg_ParseTuple(args, "C|O:decimal",
+ if (!_PyArg_ParseStack(args, nargs, "C|O:decimal",
&chr, &default_value)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("decimal", kwnames)) {
+ goto exit;
+ }
return_value = unicodedata_UCD_decimal_impl(self, chr, default_value);
exit:
@@ -47,22 +51,26 @@ PyDoc_STRVAR(unicodedata_UCD_digit__doc__,
"ValueError is raised.");
#define UNICODEDATA_UCD_DIGIT_METHODDEF \
- {"digit", (PyCFunction)unicodedata_UCD_digit, METH_VARARGS, unicodedata_UCD_digit__doc__},
+ {"digit", (PyCFunction)unicodedata_UCD_digit, METH_FASTCALL, unicodedata_UCD_digit__doc__},
static PyObject *
unicodedata_UCD_digit_impl(PyObject *self, int chr, PyObject *default_value);
static PyObject *
-unicodedata_UCD_digit(PyObject *self, PyObject *args)
+unicodedata_UCD_digit(PyObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
int chr;
PyObject *default_value = NULL;
- if (!PyArg_ParseTuple(args, "C|O:digit",
+ if (!_PyArg_ParseStack(args, nargs, "C|O:digit",
&chr, &default_value)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("digit", kwnames)) {
+ goto exit;
+ }
return_value = unicodedata_UCD_digit_impl(self, chr, default_value);
exit:
@@ -80,23 +88,27 @@ PyDoc_STRVAR(unicodedata_UCD_numeric__doc__,
"ValueError is raised.");
#define UNICODEDATA_UCD_NUMERIC_METHODDEF \
- {"numeric", (PyCFunction)unicodedata_UCD_numeric, METH_VARARGS, unicodedata_UCD_numeric__doc__},
+ {"numeric", (PyCFunction)unicodedata_UCD_numeric, METH_FASTCALL, unicodedata_UCD_numeric__doc__},
static PyObject *
unicodedata_UCD_numeric_impl(PyObject *self, int chr,
PyObject *default_value);
static PyObject *
-unicodedata_UCD_numeric(PyObject *self, PyObject *args)
+unicodedata_UCD_numeric(PyObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
int chr;
PyObject *default_value = NULL;
- if (!PyArg_ParseTuple(args, "C|O:numeric",
+ if (!_PyArg_ParseStack(args, nargs, "C|O:numeric",
&chr, &default_value)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("numeric", kwnames)) {
+ goto exit;
+ }
return_value = unicodedata_UCD_numeric_impl(self, chr, default_value);
exit:
@@ -293,21 +305,25 @@ PyDoc_STRVAR(unicodedata_UCD_normalize__doc__,
"Valid values for form are \'NFC\', \'NFKC\', \'NFD\', and \'NFKD\'.");
#define UNICODEDATA_UCD_NORMALIZE_METHODDEF \
- {"normalize", (PyCFunction)unicodedata_UCD_normalize, METH_VARARGS, unicodedata_UCD_normalize__doc__},
+ {"normalize", (PyCFunction)unicodedata_UCD_normalize, METH_FASTCALL, unicodedata_UCD_normalize__doc__},
static PyObject *
unicodedata_UCD_normalize_impl(PyObject *self, const char *form,
PyObject *input);
static PyObject *
-unicodedata_UCD_normalize(PyObject *self, PyObject *args)
+unicodedata_UCD_normalize(PyObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
const char *form;
PyObject *input;
- if (!PyArg_ParseTuple(args, "sO!:normalize",
- &form, &PyUnicode_Type, &input)) {
+ if (!_PyArg_ParseStack(args, nargs, "sU:normalize",
+ &form, &input)) {
+ goto exit;
+ }
+
+ if (!_PyArg_NoStackKeywords("normalize", kwnames)) {
goto exit;
}
return_value = unicodedata_UCD_normalize_impl(self, form, input);
@@ -326,22 +342,26 @@ PyDoc_STRVAR(unicodedata_UCD_name__doc__,
"ValueError is raised.");
#define UNICODEDATA_UCD_NAME_METHODDEF \
- {"name", (PyCFunction)unicodedata_UCD_name, METH_VARARGS, unicodedata_UCD_name__doc__},
+ {"name", (PyCFunction)unicodedata_UCD_name, METH_FASTCALL, unicodedata_UCD_name__doc__},
static PyObject *
unicodedata_UCD_name_impl(PyObject *self, int chr, PyObject *default_value);
static PyObject *
-unicodedata_UCD_name(PyObject *self, PyObject *args)
+unicodedata_UCD_name(PyObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
int chr;
PyObject *default_value = NULL;
- if (!PyArg_ParseTuple(args, "C|O:name",
+ if (!_PyArg_ParseStack(args, nargs, "C|O:name",
&chr, &default_value)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("name", kwnames)) {
+ goto exit;
+ }
return_value = unicodedata_UCD_name_impl(self, chr, default_value);
exit:
@@ -379,4 +399,4 @@ unicodedata_UCD_lookup(PyObject *self, PyObject *arg)
exit:
return return_value;
}
-/*[clinic end generated code: output=5313ce129da87b2f input=a9049054013a1b77]*/
+/*[clinic end generated code: output=fcb86aaa3fa40876 input=a9049054013a1b77]*/
diff --git a/Modules/clinic/zlibmodule.c.h b/Modules/clinic/zlibmodule.c.h
index fda392a9cd..a9089ca7bb 100644
--- a/Modules/clinic/zlibmodule.c.h
+++ b/Modules/clinic/zlibmodule.c.h
@@ -28,7 +28,7 @@ zlib_compress(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwn
Py_buffer data = {NULL, NULL};
int level = Z_DEFAULT_COMPRESSION;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
&data, &level)) {
goto exit;
}
@@ -73,7 +73,7 @@ zlib_decompress(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *k
int wbits = MAX_WBITS;
Py_ssize_t bufsize = DEF_BUF_SIZE;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
&data, &wbits, ssize_t_converter, &bufsize)) {
goto exit;
}
@@ -138,7 +138,7 @@ zlib_compressobj(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *
int strategy = Z_DEFAULT_STRATEGY;
Py_buffer zdict = {NULL, NULL};
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
&level, &method, &wbits, &memLevel, &strategy, &zdict)) {
goto exit;
}
@@ -180,7 +180,7 @@ zlib_decompressobj(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject
int wbits = MAX_WBITS;
PyObject *zdict = NULL;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
&wbits, &zdict)) {
goto exit;
}
@@ -262,7 +262,7 @@ zlib_Decompress_decompress(compobject *self, PyObject **args, Py_ssize_t nargs,
Py_buffer data = {NULL, NULL};
Py_ssize_t max_length = 0;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
&data, ssize_t_converter, &max_length)) {
goto exit;
}
@@ -290,21 +290,25 @@ PyDoc_STRVAR(zlib_Compress_flush__doc__,
" can still be compressed.");
#define ZLIB_COMPRESS_FLUSH_METHODDEF \
- {"flush", (PyCFunction)zlib_Compress_flush, METH_VARARGS, zlib_Compress_flush__doc__},
+ {"flush", (PyCFunction)zlib_Compress_flush, METH_FASTCALL, zlib_Compress_flush__doc__},
static PyObject *
zlib_Compress_flush_impl(compobject *self, int mode);
static PyObject *
-zlib_Compress_flush(compobject *self, PyObject *args)
+zlib_Compress_flush(compobject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
int mode = Z_FINISH;
- if (!PyArg_ParseTuple(args, "|i:flush",
+ if (!_PyArg_ParseStack(args, nargs, "|i:flush",
&mode)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("flush", kwnames)) {
+ goto exit;
+ }
return_value = zlib_Compress_flush_impl(self, mode);
exit:
@@ -365,21 +369,25 @@ PyDoc_STRVAR(zlib_Decompress_flush__doc__,
" the initial size of the output buffer.");
#define ZLIB_DECOMPRESS_FLUSH_METHODDEF \
- {"flush", (PyCFunction)zlib_Decompress_flush, METH_VARARGS, zlib_Decompress_flush__doc__},
+ {"flush", (PyCFunction)zlib_Decompress_flush, METH_FASTCALL, zlib_Decompress_flush__doc__},
static PyObject *
zlib_Decompress_flush_impl(compobject *self, Py_ssize_t length);
static PyObject *
-zlib_Decompress_flush(compobject *self, PyObject *args)
+zlib_Decompress_flush(compobject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
Py_ssize_t length = DEF_BUF_SIZE;
- if (!PyArg_ParseTuple(args, "|O&:flush",
+ if (!_PyArg_ParseStack(args, nargs, "|O&:flush",
ssize_t_converter, &length)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("flush", kwnames)) {
+ goto exit;
+ }
return_value = zlib_Decompress_flush_impl(self, length);
exit:
@@ -398,22 +406,26 @@ PyDoc_STRVAR(zlib_adler32__doc__,
"The returned checksum is an integer.");
#define ZLIB_ADLER32_METHODDEF \
- {"adler32", (PyCFunction)zlib_adler32, METH_VARARGS, zlib_adler32__doc__},
+ {"adler32", (PyCFunction)zlib_adler32, METH_FASTCALL, zlib_adler32__doc__},
static PyObject *
zlib_adler32_impl(PyObject *module, Py_buffer *data, unsigned int value);
static PyObject *
-zlib_adler32(PyObject *module, PyObject *args)
+zlib_adler32(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
Py_buffer data = {NULL, NULL};
unsigned int value = 1;
- if (!PyArg_ParseTuple(args, "y*|I:adler32",
+ if (!_PyArg_ParseStack(args, nargs, "y*|I:adler32",
&data, &value)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("adler32", kwnames)) {
+ goto exit;
+ }
return_value = zlib_adler32_impl(module, &data, value);
exit:
@@ -437,22 +449,26 @@ PyDoc_STRVAR(zlib_crc32__doc__,
"The returned checksum is an integer.");
#define ZLIB_CRC32_METHODDEF \
- {"crc32", (PyCFunction)zlib_crc32, METH_VARARGS, zlib_crc32__doc__},
+ {"crc32", (PyCFunction)zlib_crc32, METH_FASTCALL, zlib_crc32__doc__},
static PyObject *
zlib_crc32_impl(PyObject *module, Py_buffer *data, unsigned int value);
static PyObject *
-zlib_crc32(PyObject *module, PyObject *args)
+zlib_crc32(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
Py_buffer data = {NULL, NULL};
unsigned int value = 0;
- if (!PyArg_ParseTuple(args, "y*|I:crc32",
+ if (!_PyArg_ParseStack(args, nargs, "y*|I:crc32",
&data, &value)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("crc32", kwnames)) {
+ goto exit;
+ }
return_value = zlib_crc32_impl(module, &data, value);
exit:
@@ -467,4 +483,4 @@ exit:
#ifndef ZLIB_COMPRESS_COPY_METHODDEF
#define ZLIB_COMPRESS_COPY_METHODDEF
#endif /* !defined(ZLIB_COMPRESS_COPY_METHODDEF) */
-/*[clinic end generated code: output=3a4e2bfe750423a3 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=fa1b5f4a6208c342 input=a9049054013a1b77]*/
diff --git a/Modules/faulthandler.c b/Modules/faulthandler.c
index 1c1e4fb7d1..4fc8ebd4e3 100644
--- a/Modules/faulthandler.c
+++ b/Modules/faulthandler.c
@@ -521,12 +521,10 @@ static PyObject*
faulthandler_disable_py(PyObject *self)
{
if (!fatal_error.enabled) {
- Py_INCREF(Py_False);
- return Py_False;
+ Py_RETURN_FALSE;
}
faulthandler_disable();
- Py_INCREF(Py_True);
- return Py_True;
+ Py_RETURN_TRUE;
}
static PyObject*
@@ -980,12 +978,21 @@ faulthandler_sigsegv(PyObject *self, PyObject *args)
static void
faulthandler_fatal_error_thread(void *plock)
{
+#ifndef __clang__
PyThread_type_lock *lock = (PyThread_type_lock *)plock;
+#endif
Py_FatalError("in new thread");
+#ifndef __clang__
+ /* Issue #28152: Py_FatalError() is declared with
+ __attribute__((__noreturn__)). GCC emits a warning without
+ "PyThread_release_lock()" (compiler bug?), but Clang is smarter and
+ emits a warning on the return. */
+
/* notify the caller that we are done */
PyThread_release_lock(lock);
+#endif
}
static PyObject *
diff --git a/Modules/fpectlmodule.c b/Modules/fpectlmodule.c
index 052b83480d..8e058037b0 100644
--- a/Modules/fpectlmodule.c
+++ b/Modules/fpectlmodule.c
@@ -102,8 +102,7 @@ static PyObject *turnon_sigfpe(PyObject *self,PyObject *args)
/* Do any architecture-specific one-time only initialization here. */
fpe_reset(sigfpe_handler);
- Py_INCREF (Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
static void fpe_reset(Sigfunc *handler)
@@ -233,8 +232,7 @@ static PyObject *turnoff_sigfpe(PyObject *self,PyObject *args)
#else
fputs("Operation not implemented\n", stderr);
#endif
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
static void sigfpe_handler(int signo)
diff --git a/Modules/fpetestmodule.c b/Modules/fpetestmodule.c
index 5b6c220d9b..1c232c9831 100644
--- a/Modules/fpetestmodule.c
+++ b/Modules/fpetestmodule.c
@@ -95,8 +95,7 @@ static PyObject *test(PyObject *self,PyObject *args)
r = nest2(2, 2.0);
printerr(r);
- Py_INCREF (Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
static void printerr(double r)
diff --git a/Modules/gcmodule.c b/Modules/gcmodule.c
index 754348e20a..4e5acf305b 100644
--- a/Modules/gcmodule.c
+++ b/Modules/gcmodule.c
@@ -28,6 +28,11 @@
#include "pydtrace.h"
#include "pytime.h" /* for _PyTime_GetMonotonicClock() */
+/*[clinic input]
+module gc
+[clinic start generated code]*/
+/*[clinic end generated code: output=da39a3ee5e6b4b0d input=b5c9690ecc842d79]*/
+
/* Get an object's GC head */
#define AS_GC(o) ((PyGC_Head *)(o)-1)
@@ -43,6 +48,8 @@ struct gc_generation {
generations */
};
+/* If we change this, we need to change the default value in the signature of
+ gc.collect. */
#define NUM_GENERATIONS 3
#define GEN_HEAD(n) (&generations[n].head)
@@ -1155,110 +1162,123 @@ collect_generations(void)
return n;
}
-PyDoc_STRVAR(gc_enable__doc__,
-"enable() -> None\n"
-"\n"
-"Enable automatic garbage collection.\n");
+#include "clinic/gcmodule.c.h"
+
+/*[clinic input]
+gc.enable
+
+Enable automatic garbage collection.
+[clinic start generated code]*/
static PyObject *
-gc_enable(PyObject *self, PyObject *noargs)
+gc_enable_impl(PyObject *module)
+/*[clinic end generated code: output=45a427e9dce9155c input=81ac4940ca579707]*/
{
enabled = 1;
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
-PyDoc_STRVAR(gc_disable__doc__,
-"disable() -> None\n"
-"\n"
-"Disable automatic garbage collection.\n");
+/*[clinic input]
+gc.disable
+
+Disable automatic garbage collection.
+[clinic start generated code]*/
static PyObject *
-gc_disable(PyObject *self, PyObject *noargs)
+gc_disable_impl(PyObject *module)
+/*[clinic end generated code: output=97d1030f7aa9d279 input=8c2e5a14e800d83b]*/
{
enabled = 0;
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
-PyDoc_STRVAR(gc_isenabled__doc__,
-"isenabled() -> status\n"
-"\n"
-"Returns true if automatic garbage collection is enabled.\n");
+/*[clinic input]
+gc.isenabled -> bool
-static PyObject *
-gc_isenabled(PyObject *self, PyObject *noargs)
+Returns true if automatic garbage collection is enabled.
+[clinic start generated code]*/
+
+static int
+gc_isenabled_impl(PyObject *module)
+/*[clinic end generated code: output=1874298331c49130 input=30005e0422373b31]*/
{
- return PyBool_FromLong((long)enabled);
+ return enabled;
}
-PyDoc_STRVAR(gc_collect__doc__,
-"collect([generation]) -> n\n"
-"\n"
-"With no arguments, run a full collection. The optional argument\n"
-"may be an integer specifying which generation to collect. A ValueError\n"
-"is raised if the generation number is invalid.\n\n"
-"The number of unreachable objects is returned.\n");
+/*[clinic input]
+gc.collect -> Py_ssize_t
-static PyObject *
-gc_collect(PyObject *self, PyObject *args, PyObject *kws)
+ generation: int(c_default="NUM_GENERATIONS - 1") = 2
+
+Run the garbage collector.
+
+With no arguments, run a full collection. The optional argument
+may be an integer specifying which generation to collect. A ValueError
+is raised if the generation number is invalid.
+
+The number of unreachable objects is returned.
+[clinic start generated code]*/
+
+static Py_ssize_t
+gc_collect_impl(PyObject *module, int generation)
+/*[clinic end generated code: output=b697e633043233c7 input=40720128b682d879]*/
{
- static char *keywords[] = {"generation", NULL};
- int genarg = NUM_GENERATIONS - 1;
Py_ssize_t n;
- if (!PyArg_ParseTupleAndKeywords(args, kws, "|i", keywords, &genarg))
- return NULL;
-
- else if (genarg < 0 || genarg >= NUM_GENERATIONS) {
+ if (generation < 0 || generation >= NUM_GENERATIONS) {
PyErr_SetString(PyExc_ValueError, "invalid generation");
- return NULL;
+ return -1;
}
if (collecting)
n = 0; /* already collecting, don't do anything */
else {
collecting = 1;
- n = collect_with_callback(genarg);
+ n = collect_with_callback(generation);
collecting = 0;
}
- return PyLong_FromSsize_t(n);
+ return n;
}
-PyDoc_STRVAR(gc_set_debug__doc__,
-"set_debug(flags) -> None\n"
-"\n"
-"Set the garbage collection debugging flags. Debugging information is\n"
-"written to sys.stderr.\n"
-"\n"
-"flags is an integer and can have the following bits turned on:\n"
-"\n"
-" DEBUG_STATS - Print statistics during collection.\n"
-" DEBUG_COLLECTABLE - Print collectable objects found.\n"
-" DEBUG_UNCOLLECTABLE - Print unreachable but uncollectable objects found.\n"
-" DEBUG_SAVEALL - Save objects to gc.garbage rather than freeing them.\n"
-" DEBUG_LEAK - Debug leaking programs (everything but STATS).\n");
+/*[clinic input]
+gc.set_debug
+
+ flags: int
+ An integer that can have the following bits turned on:
+ DEBUG_STATS - Print statistics during collection.
+ DEBUG_COLLECTABLE - Print collectable objects found.
+ DEBUG_UNCOLLECTABLE - Print unreachable but uncollectable objects
+ found.
+ DEBUG_SAVEALL - Save objects to gc.garbage rather than freeing them.
+ DEBUG_LEAK - Debug leaking programs (everything but STATS).
+ /
+
+Set the garbage collection debugging flags.
+
+Debugging information is written to sys.stderr.
+[clinic start generated code]*/
static PyObject *
-gc_set_debug(PyObject *self, PyObject *args)
+gc_set_debug_impl(PyObject *module, int flags)
+/*[clinic end generated code: output=7c8366575486b228 input=5e5ce15e84fbed15]*/
{
- if (!PyArg_ParseTuple(args, "i:set_debug", &debug))
- return NULL;
+ debug = flags;
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
-PyDoc_STRVAR(gc_get_debug__doc__,
-"get_debug() -> flags\n"
-"\n"
-"Get the garbage collection debugging flags.\n");
+/*[clinic input]
+gc.get_debug -> int
-static PyObject *
-gc_get_debug(PyObject *self, PyObject *noargs)
+Get the garbage collection debugging flags.
+[clinic start generated code]*/
+
+static int
+gc_get_debug_impl(PyObject *module)
+/*[clinic end generated code: output=91242f3506cd1e50 input=91a101e1c3b98366]*/
{
- return Py_BuildValue("i", debug);
+ return debug;
}
PyDoc_STRVAR(gc_set_thresh__doc__,
@@ -1281,17 +1301,18 @@ gc_set_thresh(PyObject *self, PyObject *args)
generations[i].threshold = generations[2].threshold;
}
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
-PyDoc_STRVAR(gc_get_thresh__doc__,
-"get_threshold() -> (threshold0, threshold1, threshold2)\n"
-"\n"
-"Return the current collection thresholds\n");
+/*[clinic input]
+gc.get_threshold
+
+Return the current collection thresholds.
+[clinic start generated code]*/
static PyObject *
-gc_get_thresh(PyObject *self, PyObject *noargs)
+gc_get_threshold_impl(PyObject *module)
+/*[clinic end generated code: output=7902bc9f41ecbbd8 input=286d79918034d6e6]*/
{
return Py_BuildValue("(iii)",
generations[0].threshold,
@@ -1299,13 +1320,15 @@ gc_get_thresh(PyObject *self, PyObject *noargs)
generations[2].threshold);
}
-PyDoc_STRVAR(gc_get_count__doc__,
-"get_count() -> (count0, count1, count2)\n"
-"\n"
-"Return the current collection counts\n");
+/*[clinic input]
+gc.get_count
+
+Return a three-tuple of the current collection counts.
+[clinic start generated code]*/
static PyObject *
-gc_get_count(PyObject *self, PyObject *noargs)
+gc_get_count_impl(PyObject *module)
+/*[clinic end generated code: output=354012e67b16398f input=a392794a08251751]*/
{
return Py_BuildValue("(iii)",
generations[0].count,
@@ -1399,14 +1422,15 @@ gc_get_referents(PyObject *self, PyObject *args)
return result;
}
-PyDoc_STRVAR(gc_get_objects__doc__,
-"get_objects() -> [...]\n"
-"\n"
-"Return a list of objects tracked by the collector (excluding the list\n"
-"returned).\n");
+/*[clinic input]
+gc.get_objects
+
+Return a list of objects tracked by the collector (excluding the list returned).
+[clinic start generated code]*/
static PyObject *
-gc_get_objects(PyObject *self, PyObject *noargs)
+gc_get_objects_impl(PyObject *module)
+/*[clinic end generated code: output=fcb95d2e23e1f750 input=9439fe8170bf35d8]*/
{
int i;
PyObject* result;
@@ -1423,13 +1447,15 @@ gc_get_objects(PyObject *self, PyObject *noargs)
return result;
}
-PyDoc_STRVAR(gc_get_stats__doc__,
-"get_stats() -> [...]\n"
-"\n"
-"Return a list of dictionaries containing per-generation statistics.\n");
+/*[clinic input]
+gc.get_stats
+
+Return a list of dictionaries containing per-generation statistics.
+[clinic start generated code]*/
static PyObject *
-gc_get_stats(PyObject *self, PyObject *noargs)
+gc_get_stats_impl(PyObject *module)
+/*[clinic end generated code: output=a8ab1d8a5d26f3ab input=1ef4ed9d17b1a470]*/
{
int i;
PyObject *result;
@@ -1469,15 +1495,20 @@ error:
}
-PyDoc_STRVAR(gc_is_tracked__doc__,
-"is_tracked(obj) -> bool\n"
-"\n"
-"Returns true if the object is tracked by the garbage collector.\n"
-"Simple atomic objects will return false.\n"
-);
+/*[clinic input]
+gc.is_tracked
+
+ obj: object
+ /
+
+Returns true if the object is tracked by the garbage collector.
+
+Simple atomic objects will return false.
+[clinic start generated code]*/
static PyObject *
-gc_is_tracked(PyObject *self, PyObject *obj)
+gc_is_tracked(PyObject *module, PyObject *obj)
+/*[clinic end generated code: output=14f0103423b28e31 input=d83057f170ea2723]*/
{
PyObject *result;
@@ -1509,19 +1540,18 @@ PyDoc_STRVAR(gc__doc__,
"get_referents() -- Return the list of objects that an object refers to.\n");
static PyMethodDef GcMethods[] = {
- {"enable", gc_enable, METH_NOARGS, gc_enable__doc__},
- {"disable", gc_disable, METH_NOARGS, gc_disable__doc__},
- {"isenabled", gc_isenabled, METH_NOARGS, gc_isenabled__doc__},
- {"set_debug", gc_set_debug, METH_VARARGS, gc_set_debug__doc__},
- {"get_debug", gc_get_debug, METH_NOARGS, gc_get_debug__doc__},
- {"get_count", gc_get_count, METH_NOARGS, gc_get_count__doc__},
+ GC_ENABLE_METHODDEF
+ GC_DISABLE_METHODDEF
+ GC_ISENABLED_METHODDEF
+ GC_SET_DEBUG_METHODDEF
+ GC_GET_DEBUG_METHODDEF
+ GC_GET_COUNT_METHODDEF
{"set_threshold", gc_set_thresh, METH_VARARGS, gc_set_thresh__doc__},
- {"get_threshold", gc_get_thresh, METH_NOARGS, gc_get_thresh__doc__},
- {"collect", (PyCFunction)gc_collect,
- METH_VARARGS | METH_KEYWORDS, gc_collect__doc__},
- {"get_objects", gc_get_objects,METH_NOARGS, gc_get_objects__doc__},
- {"get_stats", gc_get_stats, METH_NOARGS, gc_get_stats__doc__},
- {"is_tracked", gc_is_tracked, METH_O, gc_is_tracked__doc__},
+ GC_GET_THRESHOLD_METHODDEF
+ GC_COLLECT_METHODDEF
+ GC_GET_OBJECTS_METHODDEF
+ GC_GET_STATS_METHODDEF
+ GC_IS_TRACKED_METHODDEF
{"get_referrers", gc_get_referrers, METH_VARARGS,
gc_get_referrers__doc__},
{"get_referents", gc_get_referents, METH_VARARGS,
diff --git a/Modules/itertoolsmodule.c b/Modules/itertoolsmodule.c
index 6bf04cbee3..7cbee2b2fc 100644
--- a/Modules/itertoolsmodule.c
+++ b/Modules/itertoolsmodule.c
@@ -4180,7 +4180,7 @@ repeat_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
return NULL;
if (kwds != NULL)
- n_kwds = PyDict_Size(kwds);
+ n_kwds = PyDict_GET_SIZE(kwds);
/* Does user supply times argument? */
if ((PyTuple_Size(args) + n_kwds == 2) && cnt < 0)
cnt = 0;
@@ -4331,9 +4331,9 @@ zip_longest_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
PyObject *fillvalue = Py_None;
Py_ssize_t tuplesize = PySequence_Length(args);
- if (kwds != NULL && PyDict_CheckExact(kwds) && PyDict_Size(kwds) > 0) {
+ if (kwds != NULL && PyDict_CheckExact(kwds) && PyDict_GET_SIZE(kwds) > 0) {
fillvalue = PyDict_GetItemString(kwds, "fillvalue");
- if (fillvalue == NULL || PyDict_Size(kwds) > 1) {
+ if (fillvalue == NULL || PyDict_GET_SIZE(kwds) > 1) {
PyErr_SetString(PyExc_TypeError,
"zip_longest() got an unexpected keyword argument");
return NULL;
diff --git a/Modules/ld_so_beos b/Modules/ld_so_beos
deleted file mode 100755
index 0b867fbde0..0000000000
--- a/Modules/ld_so_beos
+++ /dev/null
@@ -1,78 +0,0 @@
-#! /bin/sh
-#
-# linkmodule for Python
-# Chris Herborth (chrish@qnx.com)
-#
-# This is covered by the same copyright/licensing terms as the rest of
-# Python.
-#
-# Shell script to build shared library versions of the modules; since
-# the change to the *ahem* "proper" import/export mechanism, this script
-# is much simpler. It handles PowerPC and x86, too.
-#
-# This is called by the Modules/Makefile as $(LDSHARED):
-#
-# $(LDSHARED) foomodule.o -o foomodule$(SO)
-#
-# Could also be called as:
-#
-# $(LDSHARED) readline.o -L/boot/home/config/lib -lreadline -ltermcap \
-# -o readline$(SO)
-#
-# so we need to preserve the arguments, sort of.
-
-# Make sure we got reasonable arguments.
-TARGET=""
-ARGS=""
-
-while [ "$#" != "0" ]; do
- case "$1" in
- -o) TARGET="$2"; shift; shift;;
- *) ARGS="$ARGS $1"; shift;;
- esac
-done
-
-if [ "$TARGET" = "" ] ; then
- echo "Usage:"
- echo
- echo " $0 [args] -o foomodule.so [args] foomodule.o [args]"
- echo
- echo "Where:"
- echo
- echo " [args] normal compiler arguments"
- exit 1
-fi
-
-# The shared libraries and glue objects we need to link against; these
-# libs are overkill for most of the standard modules, but it makes life
-# in this shell script easier.
-LIBS="-lbe -lnet -lroot"
-
-case $BE_HOST_CPU in
- ppc)
- # Boy, do we need a lot of crap...
- GLUE_LOC=/boot/develop/lib/ppc
- GLUE="${GLUE_LOC}/glue-noinit.a ${GLUE_LOC}/init_term_dyn.o"
- case $(uname -r) in
- 4.0*) CC="mwcc -xms -export pragma -nodup" ;;
- *) CC="mwcc -shared -export pragma -nodup" ;;
- esac
- ;;
-
- x86)
- # We don't need as much crap here...
- GLUE=""
- CC="gcc -nostart -Wl,-soname=${TARGET}"
- ;;
-
- *)
- # What the?!?
- echo "$0 doesn't support $BE_HOST_CPU systems..."
- echo "You're on your own... I'd be surprised if this works."
- GLUE=""
- CC="cc"
- ;;
-esac
-
-# Now link that shared lib...
-$CC -o $TARGET $ARGS $GLUE $LIBS
diff --git a/Modules/main.c b/Modules/main.c
index 2e6a60b167..633e757691 100644
--- a/Modules/main.c
+++ b/Modules/main.c
@@ -160,7 +160,7 @@ static void RunInteractiveHook(void)
if (hook == NULL)
PyErr_Clear();
else {
- result = PyObject_CallObject(hook, NULL);
+ result = _PyObject_CallNoArg(hook);
Py_DECREF(hook);
if (result == NULL)
goto error;
diff --git a/Modules/makesetup b/Modules/makesetup
index 8db8de80ad..d6f766e141 100755
--- a/Modules/makesetup
+++ b/Modules/makesetup
@@ -92,7 +92,7 @@ CYGWIN*) if test $libdir = .
else
ExtraLibDir='$(LIBPL)'
fi
- ExtraLibs="-L$ExtraLibDir -lpython\$(VERSION)";;
+ ExtraLibs="-L$ExtraLibDir -lpython\$(LDVERSION)";;
esac
# Main loop
diff --git a/Modules/mathmodule.c b/Modules/mathmodule.c
index 95ea4f7fef..8bd38d0eb8 100644
--- a/Modules/mathmodule.c
+++ b/Modules/mathmodule.c
@@ -55,6 +55,14 @@ raised for division by zero and mod by zero.
#include "Python.h"
#include "_math.h"
+#include "clinic/mathmodule.c.h"
+
+/*[clinic input]
+module math
+[clinic start generated code]*/
+/*[clinic end generated code: output=da39a3ee5e6b4b0d input=76bc7002685dd942]*/
+
+
/*
sin(pi*x), giving accurate results for all finite x (especially x
integral or close to an integer). This is here for use in the
@@ -684,13 +692,21 @@ m_log10(double x)
}
+/*[clinic input]
+math.gcd
+
+ x as a: object
+ y as b: object
+ /
+
+greatest common divisor of x and y
+[clinic start generated code]*/
+
static PyObject *
-math_gcd(PyObject *self, PyObject *args)
+math_gcd_impl(PyObject *module, PyObject *a, PyObject *b)
+/*[clinic end generated code: output=7b2e0c151bd7a5d8 input=c2691e57fb2a98fa]*/
{
- PyObject *a, *b, *g;
-
- if (!PyArg_ParseTuple(args, "OO:gcd", &a, &b))
- return NULL;
+ PyObject *g;
a = PyNumber_Index(a);
if (a == NULL)
@@ -706,10 +722,6 @@ math_gcd(PyObject *self, PyObject *args)
return g;
}
-PyDoc_STRVAR(math_gcd_doc,
-"gcd(x, y) -> int\n\
-greatest common divisor of x and y");
-
/* Call is_error when errno != 0, and where x is the result libm
* returned. is_error will usually set up an exception and return
@@ -753,7 +765,7 @@ is_error(double x)
/*
math_1 is used to wrap a libm function f that takes a double
- arguments and returns a double.
+ argument and returns a double.
The error reporting follows these rules, which are designed to do
the right thing on C89/C99 platforms and IEEE 754/non IEEE 754
@@ -926,22 +938,43 @@ math_2(PyObject *args, double (*func) (double, double), const char *funcname)
PyDoc_STRVAR(math_##funcname##_doc, docstring);
FUNC1(acos, acos, 0,
- "acos(x)\n\nReturn the arc cosine (measured in radians) of x.")
+ "acos($module, x, /)\n--\n\n"
+ "Return the arc cosine (measured in radians) of x.")
FUNC1(acosh, m_acosh, 0,
- "acosh(x)\n\nReturn the inverse hyperbolic cosine of x.")
+ "acosh($module, x, /)\n--\n\n"
+ "Return the inverse hyperbolic cosine of x.")
FUNC1(asin, asin, 0,
- "asin(x)\n\nReturn the arc sine (measured in radians) of x.")
+ "asin($module, x, /)\n--\n\n"
+ "Return the arc sine (measured in radians) of x.")
FUNC1(asinh, m_asinh, 0,
- "asinh(x)\n\nReturn the inverse hyperbolic sine of x.")
+ "asinh($module, x, /)\n--\n\n"
+ "Return the inverse hyperbolic sine of x.")
FUNC1(atan, atan, 0,
- "atan(x)\n\nReturn the arc tangent (measured in radians) of x.")
+ "atan($module, x, /)\n--\n\n"
+ "Return the arc tangent (measured in radians) of x.")
FUNC2(atan2, m_atan2,
- "atan2(y, x)\n\nReturn the arc tangent (measured in radians) of y/x.\n"
+ "atan2($module, y, x, /)\n--\n\n"
+ "Return the arc tangent (measured in radians) of y/x.\n\n"
"Unlike atan(y/x), the signs of both x and y are considered.")
FUNC1(atanh, m_atanh, 0,
- "atanh(x)\n\nReturn the inverse hyperbolic tangent of x.")
+ "atanh($module, x, /)\n--\n\n"
+ "Return the inverse hyperbolic tangent of x.")
+
+/*[clinic input]
+math.ceil
+
+ x as number: object
+ /
+
+Return the ceiling of x as an Integral.
+
+This is the smallest integer >= x.
+[clinic start generated code]*/
-static PyObject * math_ceil(PyObject *self, PyObject *number) {
+static PyObject *
+math_ceil(PyObject *module, PyObject *number)
+/*[clinic end generated code: output=6c3b8a78bc201c67 input=2725352806399cab]*/
+{
_Py_IDENTIFIER(__ceil__);
PyObject *method, *result;
@@ -951,37 +984,55 @@ static PyObject * math_ceil(PyObject *self, PyObject *number) {
return NULL;
return math_1_to_int(number, ceil, 0);
}
- result = PyObject_CallFunctionObjArgs(method, NULL);
+ result = _PyObject_CallNoArg(method);
Py_DECREF(method);
return result;
}
-PyDoc_STRVAR(math_ceil_doc,
- "ceil(x)\n\nReturn the ceiling of x as an Integral.\n"
- "This is the smallest integer >= x.");
-
FUNC2(copysign, copysign,
- "copysign(x, y)\n\nReturn a float with the magnitude (absolute value) "
- "of x but the sign \nof y. On platforms that support signed zeros, "
- "copysign(1.0, -0.0) \nreturns -1.0.\n")
+ "copysign($module, x, y, /)\n--\n\n"
+ "Return a float with the magnitude (absolute value) of x but the sign of y.\n\n"
+ "On platforms that support signed zeros, copysign(1.0, -0.0)\n"
+ "returns -1.0.\n")
FUNC1(cos, cos, 0,
- "cos(x)\n\nReturn the cosine of x (measured in radians).")
+ "cos($module, x, /)\n--\n\n"
+ "Return the cosine of x (measured in radians).")
FUNC1(cosh, cosh, 1,
- "cosh(x)\n\nReturn the hyperbolic cosine of x.")
+ "cosh($module, x, /)\n--\n\n"
+ "Return the hyperbolic cosine of x.")
FUNC1A(erf, m_erf,
- "erf(x)\n\nError function at x.")
+ "erf($module, x, /)\n--\n\n"
+ "Error function at x.")
FUNC1A(erfc, m_erfc,
- "erfc(x)\n\nComplementary error function at x.")
+ "erfc($module, x, /)\n--\n\n"
+ "Complementary error function at x.")
FUNC1(exp, exp, 1,
- "exp(x)\n\nReturn e raised to the power of x.")
+ "exp($module, x, /)\n--\n\n"
+ "Return e raised to the power of x.")
FUNC1(expm1, m_expm1, 1,
- "expm1(x)\n\nReturn exp(x)-1.\n"
+ "expm1($module, x, /)\n--\n\n"
+ "Return exp(x)-1.\n\n"
"This function avoids the loss of precision involved in the direct "
"evaluation of exp(x)-1 for small x.")
FUNC1(fabs, fabs, 0,
- "fabs(x)\n\nReturn the absolute value of the float x.")
+ "fabs($module, x, /)\n--\n\n"
+ "Return the absolute value of the float x.")
+
+/*[clinic input]
+math.floor
-static PyObject * math_floor(PyObject *self, PyObject *number) {
+ x as number: object
+ /
+
+Return the floor of x as an Integral.
+
+This is the largest integer <= x.
+[clinic start generated code]*/
+
+static PyObject *
+math_floor(PyObject *module, PyObject *number)
+/*[clinic end generated code: output=c6a65c4884884b8a input=63af6b5d7ebcc3d6]*/
+{
_Py_IDENTIFIER(__floor__);
PyObject *method, *result;
@@ -991,32 +1042,36 @@ static PyObject * math_floor(PyObject *self, PyObject *number) {
return NULL;
return math_1_to_int(number, floor, 0);
}
- result = PyObject_CallFunctionObjArgs(method, NULL);
+ result = _PyObject_CallNoArg(method);
Py_DECREF(method);
return result;
}
-PyDoc_STRVAR(math_floor_doc,
- "floor(x)\n\nReturn the floor of x as an Integral.\n"
- "This is the largest integer <= x.");
-
FUNC1A(gamma, m_tgamma,
- "gamma(x)\n\nGamma function at x.")
+ "gamma($module, x, /)\n--\n\n"
+ "Gamma function at x.")
FUNC1A(lgamma, m_lgamma,
- "lgamma(x)\n\nNatural logarithm of absolute value of Gamma function at x.")
+ "lgamma($module, x, /)\n--\n\n"
+ "Natural logarithm of absolute value of Gamma function at x.")
FUNC1(log1p, m_log1p, 0,
- "log1p(x)\n\nReturn the natural logarithm of 1+x (base e).\n"
+ "log1p($module, x, /)\n--\n\n"
+ "Return the natural logarithm of 1+x (base e).\n\n"
"The result is computed in a way which is accurate for x near zero.")
FUNC1(sin, sin, 0,
- "sin(x)\n\nReturn the sine of x (measured in radians).")
+ "sin($module, x, /)\n--\n\n"
+ "Return the sine of x (measured in radians).")
FUNC1(sinh, sinh, 1,
- "sinh(x)\n\nReturn the hyperbolic sine of x.")
+ "sinh($module, x, /)\n--\n\n"
+ "Return the hyperbolic sine of x.")
FUNC1(sqrt, sqrt, 0,
- "sqrt(x)\n\nReturn the square root of x.")
+ "sqrt($module, x, /)\n--\n\n"
+ "Return the square root of x.")
FUNC1(tan, tan, 0,
- "tan(x)\n\nReturn the tangent of x (measured in radians).")
+ "tan($module, x, /)\n--\n\n"
+ "Return the tangent of x (measured in radians).")
FUNC1(tanh, tanh, 0,
- "tanh(x)\n\nReturn the hyperbolic tangent of x.")
+ "tanh($module, x, /)\n--\n\n"
+ "Return the hyperbolic tangent of x.")
/* Precision summation function as msum() by Raymond Hettinger in
<http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/393090>,
@@ -1114,8 +1169,20 @@ _fsum_realloc(double **p_ptr, Py_ssize_t n,
Depends on IEEE 754 arithmetic guarantees and half-even rounding.
*/
-static PyObject*
-math_fsum(PyObject *self, PyObject *seq)
+/*[clinic input]
+math.fsum
+
+ seq: object
+ /
+
+Return an accurate floating point sum of values in the iterable seq.
+
+Assumes IEEE-754 floating point arithmetic.
+[clinic start generated code]*/
+
+static PyObject *
+math_fsum(PyObject *module, PyObject *seq)
+/*[clinic end generated code: output=ba5c672b87fe34fc input=c51b7d8caf6f6e82]*/
{
PyObject *item, *iter, *sum = NULL;
Py_ssize_t i, j, n = 0, m = NUM_PARTIALS;
@@ -1234,10 +1301,6 @@ _fsum_error:
#undef NUM_PARTIALS
-PyDoc_STRVAR(math_fsum_doc,
-"fsum(iterable)\n\n\
-Return an accurate floating point sum of values in the iterable.\n\
-Assumes IEEE-754 floating point arithmetic.");
/* Return the smallest integer k such that n < 2**k, or 0 if n == 0.
* Equivalent to floor(lg(x))+1. Also equivalent to: bitwidth_of_type -
@@ -1447,6 +1510,7 @@ factorial_odd_part(unsigned long n)
return NULL;
}
+
/* Lookup table for small factorial values */
static const unsigned long SmallFactorials[] = {
@@ -1459,8 +1523,20 @@ static const unsigned long SmallFactorials[] = {
#endif
};
+/*[clinic input]
+math.factorial
+
+ x as arg: object
+ /
+
+Find x!.
+
+Raise a ValueError if x is negative or non-integral.
+[clinic start generated code]*/
+
static PyObject *
-math_factorial(PyObject *self, PyObject *arg)
+math_factorial(PyObject *module, PyObject *arg)
+/*[clinic end generated code: output=6686f26fae00e9ca input=6d1c8105c0d91fb4]*/
{
long x;
int overflow;
@@ -1518,47 +1594,61 @@ math_factorial(PyObject *self, PyObject *arg)
return result;
}
-PyDoc_STRVAR(math_factorial_doc,
-"factorial(x) -> Integral\n"
-"\n"
-"Find x!. Raise a ValueError if x is negative or non-integral.");
+
+/*[clinic input]
+math.trunc
+
+ x: object
+ /
+
+Truncates the Real x to the nearest Integral toward 0.
+
+Uses the __trunc__ magic method.
+[clinic start generated code]*/
static PyObject *
-math_trunc(PyObject *self, PyObject *number)
+math_trunc(PyObject *module, PyObject *x)
+/*[clinic end generated code: output=34b9697b707e1031 input=2168b34e0a09134d]*/
{
_Py_IDENTIFIER(__trunc__);
PyObject *trunc, *result;
- if (Py_TYPE(number)->tp_dict == NULL) {
- if (PyType_Ready(Py_TYPE(number)) < 0)
+ if (Py_TYPE(x)->tp_dict == NULL) {
+ if (PyType_Ready(Py_TYPE(x)) < 0)
return NULL;
}
- trunc = _PyObject_LookupSpecial(number, &PyId___trunc__);
+ trunc = _PyObject_LookupSpecial(x, &PyId___trunc__);
if (trunc == NULL) {
if (!PyErr_Occurred())
PyErr_Format(PyExc_TypeError,
"type %.100s doesn't define __trunc__ method",
- Py_TYPE(number)->tp_name);
+ Py_TYPE(x)->tp_name);
return NULL;
}
- result = PyObject_CallFunctionObjArgs(trunc, NULL);
+ result = _PyObject_CallNoArg(trunc);
Py_DECREF(trunc);
return result;
}
-PyDoc_STRVAR(math_trunc_doc,
-"trunc(x:Real) -> Integral\n"
-"\n"
-"Truncates x to the nearest Integral toward 0. Uses the __trunc__ magic method.");
+
+/*[clinic input]
+math.frexp
+
+ x: double
+ /
+
+Return the mantissa and exponent of x, as pair (m, e).
+
+m is a float and e is an int, such that x = m * 2.**e.
+If x is 0, m and e are both 0. Else 0.5 <= abs(m) < 1.0.
+[clinic start generated code]*/
static PyObject *
-math_frexp(PyObject *self, PyObject *arg)
+math_frexp_impl(PyObject *module, double x)
+/*[clinic end generated code: output=03e30d252a15ad4a input=96251c9e208bc6e9]*/
{
int i;
- double x = PyFloat_AsDouble(arg);
- if (x == -1.0 && PyErr_Occurred())
- return NULL;
/* deal with special cases directly, to sidestep platform
differences */
if (Py_IS_NAN(x) || Py_IS_INFINITY(x) || !x) {
@@ -1572,27 +1662,31 @@ math_frexp(PyObject *self, PyObject *arg)
return Py_BuildValue("(di)", x, i);
}
-PyDoc_STRVAR(math_frexp_doc,
-"frexp(x)\n"
-"\n"
-"Return the mantissa and exponent of x, as pair (m, e).\n"
-"m is a float and e is an int, such that x = m * 2.**e.\n"
-"If x is 0, m and e are both 0. Else 0.5 <= abs(m) < 1.0.");
+
+/*[clinic input]
+math.ldexp
+
+ x: double
+ i: object
+ /
+
+Return x * (2**i).
+
+This is essentially the inverse of frexp().
+[clinic start generated code]*/
static PyObject *
-math_ldexp(PyObject *self, PyObject *args)
+math_ldexp_impl(PyObject *module, double x, PyObject *i)
+/*[clinic end generated code: output=b6892f3c2df9cc6a input=17d5970c1a40a8c1]*/
{
- double x, r;
- PyObject *oexp;
+ double r;
long exp;
int overflow;
- if (! PyArg_ParseTuple(args, "dO:ldexp", &x, &oexp))
- return NULL;
- if (PyLong_Check(oexp)) {
+ if (PyLong_Check(i)) {
/* on overflow, replace exponent with either LONG_MAX
or LONG_MIN, depending on the sign. */
- exp = PyLong_AsLongAndOverflow(oexp, &overflow);
+ exp = PyLong_AsLongAndOverflow(i, &overflow);
if (exp == -1 && PyErr_Occurred())
return NULL;
if (overflow)
@@ -1630,16 +1724,23 @@ math_ldexp(PyObject *self, PyObject *args)
return PyFloat_FromDouble(r);
}
-PyDoc_STRVAR(math_ldexp_doc,
-"ldexp(x, i)\n\n\
-Return x * (2**i).");
+
+/*[clinic input]
+math.modf
+
+ x: double
+ /
+
+Return the fractional and integer parts of x.
+
+Both results carry the sign of x and are floats.
+[clinic start generated code]*/
static PyObject *
-math_modf(PyObject *self, PyObject *arg)
+math_modf_impl(PyObject *module, double x)
+/*[clinic end generated code: output=90cee0260014c3c0 input=b4cfb6786afd9035]*/
{
- double y, x = PyFloat_AsDouble(arg);
- if (x == -1.0 && PyErr_Occurred())
- return NULL;
+ double y;
/* some platforms don't do the right thing for NaNs and
infinities, so we take care of special cases directly. */
if (!Py_IS_FINITE(x)) {
@@ -1656,11 +1757,6 @@ math_modf(PyObject *self, PyObject *arg)
return Py_BuildValue("(dd)", x, y);
}
-PyDoc_STRVAR(math_modf_doc,
-"modf(x)\n"
-"\n"
-"Return the fractional and integer parts of x. Both results carry the sign\n"
-"of x and are floats.");
/* A decent logarithm is easy to compute even for huge ints, but libm can't
do that by itself -- loghelper can. func is log or log10, and name is
@@ -1709,18 +1805,30 @@ loghelper(PyObject* arg, double (*func)(double), const char *funcname)
return math_1(arg, func, 0);
}
+
+/*[clinic input]
+math.log
+
+ x: object
+ [
+ base: object(c_default="NULL") = math.e
+ ]
+ /
+
+Return the logarithm of x to the given base.
+
+If the base not specified, returns the natural logarithm (base e) of x.
+[clinic start generated code]*/
+
static PyObject *
-math_log(PyObject *self, PyObject *args)
+math_log_impl(PyObject *module, PyObject *x, int group_right_1,
+ PyObject *base)
+/*[clinic end generated code: output=7b5a39e526b73fc9 input=0f62d5726cbfebbd]*/
{
- PyObject *arg;
- PyObject *base = NULL;
PyObject *num, *den;
PyObject *ans;
- if (!PyArg_UnpackTuple(args, "log", 1, 2, &arg, &base))
- return NULL;
-
- num = loghelper(arg, m_log, "log");
+ num = loghelper(x, m_log, "log");
if (num == NULL || base == NULL)
return num;
@@ -1736,40 +1844,58 @@ math_log(PyObject *self, PyObject *args)
return ans;
}
-PyDoc_STRVAR(math_log_doc,
-"log(x[, base])\n\n\
-Return the logarithm of x to the given base.\n\
-If the base not specified, returns the natural logarithm (base e) of x.");
+
+/*[clinic input]
+math.log2
+
+ x: object
+ /
+
+Return the base 2 logarithm of x.
+[clinic start generated code]*/
static PyObject *
-math_log2(PyObject *self, PyObject *arg)
+math_log2(PyObject *module, PyObject *x)
+/*[clinic end generated code: output=5425899a4d5d6acb input=08321262bae4f39b]*/
{
- return loghelper(arg, m_log2, "log2");
+ return loghelper(x, m_log2, "log2");
}
-PyDoc_STRVAR(math_log2_doc,
-"log2(x)\n\nReturn the base 2 logarithm of x.");
+
+/*[clinic input]
+math.log10
+
+ x: object
+ /
+
+Return the base 10 logarithm of x.
+[clinic start generated code]*/
static PyObject *
-math_log10(PyObject *self, PyObject *arg)
+math_log10(PyObject *module, PyObject *x)
+/*[clinic end generated code: output=be72a64617df9c6f input=b2469d02c6469e53]*/
{
- return loghelper(arg, m_log10, "log10");
+ return loghelper(x, m_log10, "log10");
}
-PyDoc_STRVAR(math_log10_doc,
-"log10(x)\n\nReturn the base 10 logarithm of x.");
+
+/*[clinic input]
+math.fmod
+
+ x: double
+ y: double
+ /
+
+Return fmod(x, y), according to platform C.
+
+x % y may differ.
+[clinic start generated code]*/
static PyObject *
-math_fmod(PyObject *self, PyObject *args)
+math_fmod_impl(PyObject *module, double x, double y)
+/*[clinic end generated code: output=7559d794343a27b5 input=4f84caa8cfc26a03]*/
{
- PyObject *ox, *oy;
- double r, x, y;
- if (! PyArg_UnpackTuple(args, "fmod", 2, 2, &ox, &oy))
- return NULL;
- x = PyFloat_AsDouble(ox);
- y = PyFloat_AsDouble(oy);
- if ((x == -1.0 || y == -1.0) && PyErr_Occurred())
- return NULL;
+ double r;
/* fmod(x, +/-Inf) returns x for finite x. */
if (Py_IS_INFINITY(y) && Py_IS_FINITE(x))
return PyFloat_FromDouble(x);
@@ -1789,21 +1915,22 @@ math_fmod(PyObject *self, PyObject *args)
return PyFloat_FromDouble(r);
}
-PyDoc_STRVAR(math_fmod_doc,
-"fmod(x, y)\n\nReturn fmod(x, y), according to platform C."
-" x % y may differ.");
+
+/*[clinic input]
+math.hypot
+
+ x: double
+ y: double
+ /
+
+Return the Euclidean distance, sqrt(x*x + y*y).
+[clinic start generated code]*/
static PyObject *
-math_hypot(PyObject *self, PyObject *args)
+math_hypot_impl(PyObject *module, double x, double y)
+/*[clinic end generated code: output=b7686e5be468ef87 input=7f8eea70406474aa]*/
{
- PyObject *ox, *oy;
- double r, x, y;
- if (! PyArg_UnpackTuple(args, "hypot", 2, 2, &ox, &oy))
- return NULL;
- x = PyFloat_AsDouble(ox);
- y = PyFloat_AsDouble(oy);
- if ((x == -1.0 || y == -1.0) && PyErr_Occurred())
- return NULL;
+ double r;
/* hypot(x, +/-Inf) returns Inf, even if x is a NaN. */
if (Py_IS_INFINITY(x))
return PyFloat_FromDouble(fabs(x));
@@ -1831,8 +1958,6 @@ math_hypot(PyObject *self, PyObject *args)
return PyFloat_FromDouble(r);
}
-PyDoc_STRVAR(math_hypot_doc,
-"hypot(x, y)\n\nReturn the Euclidean distance, sqrt(x*x + y*y).");
/* pow can't use math_2, but needs its own wrapper: the problem is
that an infinite result can arise either as a result of overflow
@@ -1840,20 +1965,23 @@ PyDoc_STRVAR(math_hypot_doc,
e.g. 0.**-5. (for which ValueError needs to be raised.)
*/
+/*[clinic input]
+math.pow
+
+ x: double
+ y: double
+ /
+
+Return x**y (x to the power of y).
+[clinic start generated code]*/
+
static PyObject *
-math_pow(PyObject *self, PyObject *args)
+math_pow_impl(PyObject *module, double x, double y)
+/*[clinic end generated code: output=fff93e65abccd6b0 input=c26f1f6075088bfd]*/
{
- PyObject *ox, *oy;
- double r, x, y;
+ double r;
int odd_y;
- if (! PyArg_UnpackTuple(args, "pow", 2, 2, &ox, &oy))
- return NULL;
- x = PyFloat_AsDouble(ox);
- y = PyFloat_AsDouble(oy);
- if ((x == -1.0 || y == -1.0) && PyErr_Occurred())
- return NULL;
-
/* deal directly with IEEE specials, to cope with problems on various
platforms whose semantics don't exactly match C99 */
r = 0.; /* silence compiler warning */
@@ -1918,107 +2046,139 @@ math_pow(PyObject *self, PyObject *args)
return PyFloat_FromDouble(r);
}
-PyDoc_STRVAR(math_pow_doc,
-"pow(x, y)\n\nReturn x**y (x to the power of y).");
static const double degToRad = Py_MATH_PI / 180.0;
static const double radToDeg = 180.0 / Py_MATH_PI;
+/*[clinic input]
+math.degrees
+
+ x: double
+ /
+
+Convert angle x from radians to degrees.
+[clinic start generated code]*/
+
static PyObject *
-math_degrees(PyObject *self, PyObject *arg)
+math_degrees_impl(PyObject *module, double x)
+/*[clinic end generated code: output=7fea78b294acd12f input=81e016555d6e3660]*/
{
- double x = PyFloat_AsDouble(arg);
- if (x == -1.0 && PyErr_Occurred())
- return NULL;
return PyFloat_FromDouble(x * radToDeg);
}
-PyDoc_STRVAR(math_degrees_doc,
-"degrees(x)\n\n\
-Convert angle x from radians to degrees.");
+
+/*[clinic input]
+math.radians
+
+ x: double
+ /
+
+Convert angle x from degrees to radians.
+[clinic start generated code]*/
static PyObject *
-math_radians(PyObject *self, PyObject *arg)
+math_radians_impl(PyObject *module, double x)
+/*[clinic end generated code: output=34daa47caf9b1590 input=91626fc489fe3d63]*/
{
- double x = PyFloat_AsDouble(arg);
- if (x == -1.0 && PyErr_Occurred())
- return NULL;
return PyFloat_FromDouble(x * degToRad);
}
-PyDoc_STRVAR(math_radians_doc,
-"radians(x)\n\n\
-Convert angle x from degrees to radians.");
+
+/*[clinic input]
+math.isfinite
+
+ x: double
+ /
+
+Return True if x is neither an infinity nor a NaN, and False otherwise.
+[clinic start generated code]*/
static PyObject *
-math_isfinite(PyObject *self, PyObject *arg)
+math_isfinite_impl(PyObject *module, double x)
+/*[clinic end generated code: output=8ba1f396440c9901 input=46967d254812e54a]*/
{
- double x = PyFloat_AsDouble(arg);
- if (x == -1.0 && PyErr_Occurred())
- return NULL;
return PyBool_FromLong((long)Py_IS_FINITE(x));
}
-PyDoc_STRVAR(math_isfinite_doc,
-"isfinite(x) -> bool\n\n\
-Return True if x is neither an infinity nor a NaN, and False otherwise.");
+
+/*[clinic input]
+math.isnan
+
+ x: double
+ /
+
+Return True if x is a NaN (not a number), and False otherwise.
+[clinic start generated code]*/
static PyObject *
-math_isnan(PyObject *self, PyObject *arg)
+math_isnan_impl(PyObject *module, double x)
+/*[clinic end generated code: output=f537b4d6df878c3e input=935891e66083f46a]*/
{
- double x = PyFloat_AsDouble(arg);
- if (x == -1.0 && PyErr_Occurred())
- return NULL;
return PyBool_FromLong((long)Py_IS_NAN(x));
}
-PyDoc_STRVAR(math_isnan_doc,
-"isnan(x) -> bool\n\n\
-Return True if x is a NaN (not a number), and False otherwise.");
+
+/*[clinic input]
+math.isinf
+
+ x: double
+ /
+
+Return True if x is a positive or negative infinity, and False otherwise.
+[clinic start generated code]*/
static PyObject *
-math_isinf(PyObject *self, PyObject *arg)
+math_isinf_impl(PyObject *module, double x)
+/*[clinic end generated code: output=9f00cbec4de7b06b input=32630e4212cf961f]*/
{
- double x = PyFloat_AsDouble(arg);
- if (x == -1.0 && PyErr_Occurred())
- return NULL;
return PyBool_FromLong((long)Py_IS_INFINITY(x));
}
-PyDoc_STRVAR(math_isinf_doc,
-"isinf(x) -> bool\n\n\
-Return True if x is a positive or negative infinity, and False otherwise.");
-static PyObject *
-math_isclose(PyObject *self, PyObject *args, PyObject *kwargs)
-{
- double a, b;
- double rel_tol = 1e-9;
- double abs_tol = 0.0;
- double diff = 0.0;
- long result = 0;
+/*[clinic input]
+math.isclose -> bool
- static char *keywords[] = {"a", "b", "rel_tol", "abs_tol", NULL};
+ a: double
+ b: double
+ *
+ rel_tol: double = 1e-09
+ maximum difference for being considered "close", relative to the
+ magnitude of the input values
+ abs_tol: double = 0.0
+ maximum difference for being considered "close", regardless of the
+ magnitude of the input values
+Determine whether two floating point numbers are close in value.
- if (!PyArg_ParseTupleAndKeywords(args, kwargs, "dd|$dd:isclose",
- keywords,
- &a, &b, &rel_tol, &abs_tol
- ))
- return NULL;
+Return True if a is close in value to b, and False otherwise.
+
+For the values to be considered close, the difference between them
+must be smaller than at least one of the tolerances.
+
+-inf, inf and NaN behave similarly to the IEEE 754 Standard. That
+is, NaN is not close to anything, even itself. inf and -inf are
+only close to themselves.
+[clinic start generated code]*/
+
+static int
+math_isclose_impl(PyObject *module, double a, double b, double rel_tol,
+ double abs_tol)
+/*[clinic end generated code: output=b73070207511952d input=f28671871ea5bfba]*/
+{
+ double diff = 0.0;
/* sanity check on the inputs */
if (rel_tol < 0.0 || abs_tol < 0.0 ) {
PyErr_SetString(PyExc_ValueError,
"tolerances must be non-negative");
- return NULL;
+ return -1;
}
if ( a == b ) {
/* short circuit exact equality -- needed to catch two infinities of
the same sign. And perhaps speeds things up a bit sometimes.
*/
- Py_RETURN_TRUE;
+ return 1;
}
/* This catches the case of two infinities of opposite sign, or
@@ -2029,7 +2189,7 @@ math_isclose(PyObject *self, PyObject *args, PyObject *kwargs)
*/
if (Py_IS_INFINITY(a) || Py_IS_INFINITY(b)) {
- Py_RETURN_FALSE;
+ return 0;
}
/* now do the regular computation
@@ -2038,33 +2198,11 @@ math_isclose(PyObject *self, PyObject *args, PyObject *kwargs)
diff = fabs(b - a);
- result = (((diff <= fabs(rel_tol * b)) ||
- (diff <= fabs(rel_tol * a))) ||
- (diff <= abs_tol));
-
- return PyBool_FromLong(result);
+ return (((diff <= fabs(rel_tol * b)) ||
+ (diff <= fabs(rel_tol * a))) ||
+ (diff <= abs_tol));
}
-PyDoc_STRVAR(math_isclose_doc,
-"isclose(a, b, *, rel_tol=1e-09, abs_tol=0.0) -> bool\n"
-"\n"
-"Determine whether two floating point numbers are close in value.\n"
-"\n"
-" rel_tol\n"
-" maximum difference for being considered \"close\", relative to the\n"
-" magnitude of the input values\n"
-" abs_tol\n"
-" maximum difference for being considered \"close\", regardless of the\n"
-" magnitude of the input values\n"
-"\n"
-"Return True if a is close in value to b, and False otherwise.\n"
-"\n"
-"For the values to be considered close, the difference between them\n"
-"must be smaller than at least one of the tolerances.\n"
-"\n"
-"-inf, inf and NaN behave similarly to the IEEE 754 Standard. That\n"
-"is, NaN is not close to anything, even itself. inf and -inf are\n"
-"only close to themselves.");
static PyMethodDef math_methods[] = {
{"acos", math_acos, METH_O, math_acos_doc},
@@ -2074,44 +2212,43 @@ static PyMethodDef math_methods[] = {
{"atan", math_atan, METH_O, math_atan_doc},
{"atan2", math_atan2, METH_VARARGS, math_atan2_doc},
{"atanh", math_atanh, METH_O, math_atanh_doc},
- {"ceil", math_ceil, METH_O, math_ceil_doc},
+ MATH_CEIL_METHODDEF
{"copysign", math_copysign, METH_VARARGS, math_copysign_doc},
{"cos", math_cos, METH_O, math_cos_doc},
{"cosh", math_cosh, METH_O, math_cosh_doc},
- {"degrees", math_degrees, METH_O, math_degrees_doc},
+ MATH_DEGREES_METHODDEF
{"erf", math_erf, METH_O, math_erf_doc},
{"erfc", math_erfc, METH_O, math_erfc_doc},
{"exp", math_exp, METH_O, math_exp_doc},
{"expm1", math_expm1, METH_O, math_expm1_doc},
{"fabs", math_fabs, METH_O, math_fabs_doc},
- {"factorial", math_factorial, METH_O, math_factorial_doc},
- {"floor", math_floor, METH_O, math_floor_doc},
- {"fmod", math_fmod, METH_VARARGS, math_fmod_doc},
- {"frexp", math_frexp, METH_O, math_frexp_doc},
- {"fsum", math_fsum, METH_O, math_fsum_doc},
+ MATH_FACTORIAL_METHODDEF
+ MATH_FLOOR_METHODDEF
+ MATH_FMOD_METHODDEF
+ MATH_FREXP_METHODDEF
+ MATH_FSUM_METHODDEF
{"gamma", math_gamma, METH_O, math_gamma_doc},
- {"gcd", math_gcd, METH_VARARGS, math_gcd_doc},
- {"hypot", math_hypot, METH_VARARGS, math_hypot_doc},
- {"isclose", (PyCFunction) math_isclose, METH_VARARGS | METH_KEYWORDS,
- math_isclose_doc},
- {"isfinite", math_isfinite, METH_O, math_isfinite_doc},
- {"isinf", math_isinf, METH_O, math_isinf_doc},
- {"isnan", math_isnan, METH_O, math_isnan_doc},
- {"ldexp", math_ldexp, METH_VARARGS, math_ldexp_doc},
+ MATH_GCD_METHODDEF
+ MATH_HYPOT_METHODDEF
+ MATH_ISCLOSE_METHODDEF
+ MATH_ISFINITE_METHODDEF
+ MATH_ISINF_METHODDEF
+ MATH_ISNAN_METHODDEF
+ MATH_LDEXP_METHODDEF
{"lgamma", math_lgamma, METH_O, math_lgamma_doc},
- {"log", math_log, METH_VARARGS, math_log_doc},
+ MATH_LOG_METHODDEF
{"log1p", math_log1p, METH_O, math_log1p_doc},
- {"log10", math_log10, METH_O, math_log10_doc},
- {"log2", math_log2, METH_O, math_log2_doc},
- {"modf", math_modf, METH_O, math_modf_doc},
- {"pow", math_pow, METH_VARARGS, math_pow_doc},
- {"radians", math_radians, METH_O, math_radians_doc},
+ MATH_LOG10_METHODDEF
+ MATH_LOG2_METHODDEF
+ MATH_MODF_METHODDEF
+ MATH_POW_METHODDEF
+ MATH_RADIANS_METHODDEF
{"sin", math_sin, METH_O, math_sin_doc},
{"sinh", math_sinh, METH_O, math_sinh_doc},
{"sqrt", math_sqrt, METH_O, math_sqrt_doc},
{"tan", math_tan, METH_O, math_tan_doc},
{"tanh", math_tanh, METH_O, math_tanh_doc},
- {"trunc", math_trunc, METH_O, math_trunc_doc},
+ MATH_TRUNC_METHODDEF
{NULL, NULL} /* sentinel */
};
diff --git a/Modules/md5module.c b/Modules/md5module.c
index 04bc06e4b7..6b11f0bc0e 100644
--- a/Modules/md5module.c
+++ b/Modules/md5module.c
@@ -416,8 +416,7 @@ MD5Type_update(MD5object *self, PyObject *obj)
md5_process(&self->hash_state, buf.buf, buf.len);
PyBuffer_Release(&buf);
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
static PyMethodDef MD5_methods[] = {
diff --git a/Modules/mmapmodule.c b/Modules/mmapmodule.c
index 5f1615ff82..7a94464e7b 100644
--- a/Modules/mmapmodule.c
+++ b/Modules/mmapmodule.c
@@ -181,8 +181,7 @@ mmap_close_method(mmap_object *self, PyObject *unused)
}
#endif
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
#ifdef MS_WINDOWS
@@ -415,8 +414,7 @@ mmap_write_byte_method(mmap_object *self,
if (self->pos < self->size) {
self->data[self->pos++] = value;
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
else {
PyErr_SetString(PyExc_ValueError, "write byte out of range");
@@ -524,8 +522,7 @@ mmap_resize_method(mmap_object *self,
new_size);
if (self->data != NULL) {
self->size = new_size;
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
} else {
dwErrCode = GetLastError();
CloseHandle(self->map_handle);
@@ -567,8 +564,7 @@ mmap_resize_method(mmap_object *self,
}
self->data = newmap;
self->size = new_size;
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
#endif /* HAVE_MREMAP */
#endif /* UNIX */
}
@@ -644,8 +640,7 @@ mmap_seek_method(mmap_object *self, PyObject *args)
if (where > self->size || where < 0)
goto onoutofrange;
self->pos = where;
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
onoutofrange:
@@ -670,8 +665,7 @@ mmap_move_method(mmap_object *self, PyObject *args)
memmove(&self->data[dest], &self->data[src], cnt);
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
bounds:
PyErr_SetString(PyExc_ValueError,
diff --git a/Modules/ossaudiodev.c b/Modules/ossaudiodev.c
index 5f0505c8a7..1cdbbae3f3 100644
--- a/Modules/ossaudiodev.c
+++ b/Modules/ossaudiodev.c
@@ -307,8 +307,7 @@ _do_ioctl_0(int fd, PyObject *args, char *fname, int cmd)
if (rv == -1)
return PyErr_SetFromErrno(PyExc_IOError);
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
@@ -326,8 +325,7 @@ oss_nonblock(oss_audio_t *self, PyObject *unused)
mode once we're in non-blocking mode! */
if (ioctl(self->fd, SNDCTL_DSP_NONBLOCK, NULL) == -1)
return PyErr_SetFromErrno(PyExc_IOError);
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
static PyObject *
@@ -514,8 +512,7 @@ oss_writeall(oss_audio_t *self, PyObject *args)
cp += rv;
}
PyBuffer_Release(&data);
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
static PyObject *
@@ -527,8 +524,7 @@ oss_close(oss_audio_t *self, PyObject *unused)
Py_END_ALLOW_THREADS
self->fd = -1;
}
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
static PyObject *
@@ -747,8 +743,7 @@ oss_mixer_close(oss_mixer_t *self, PyObject *unused)
close(self->fd);
self->fd = -1;
}
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
static PyObject *
diff --git a/Modules/parsermodule.c b/Modules/parsermodule.c
index b2566951d0..e5c4db3048 100644
--- a/Modules/parsermodule.c
+++ b/Modules/parsermodule.c
@@ -91,8 +91,7 @@ node2tuple(node *n, /* node to convert */
PyObject *result = NULL, *w;
if (n == NULL) {
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
if (ISNONTERMINAL(TYPE(n))) {
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c
index dc3fb94c87..48c3c7abb4 100644
--- a/Modules/posixmodule.c
+++ b/Modules/posixmodule.c
@@ -1871,8 +1871,7 @@ stat_float_times(PyObject* self, PyObject *args)
/* Return old value */
return PyBool_FromLong(_stat_float_times);
_stat_float_times = newval;
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
static PyObject *billion = NULL;
@@ -6194,8 +6193,7 @@ posix_initgroups(PyObject *self, PyObject *args)
if (res == -1)
return PyErr_SetFromErrno(PyExc_OSError);
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
#endif /* HAVE_INITGROUPS */
@@ -6258,8 +6256,7 @@ os_setpgrp_impl(PyObject *module)
if (setpgrp() < 0)
#endif /* SETPGRP_HAVE_ARG */
return posix_error();
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
#endif /* HAVE_SETPGRP */
@@ -6585,8 +6582,7 @@ os_setreuid_impl(PyObject *module, uid_t ruid, uid_t euid)
if (setreuid(ruid, euid) < 0) {
return posix_error();
} else {
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
}
#endif /* HAVE_SETREUID */
@@ -6681,8 +6677,7 @@ os_setgroups(PyObject *module, PyObject *groups)
if (setgroups(len, grouplist) < 0)
return posix_error();
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
#endif /* HAVE_SETGROUPS */
@@ -10341,8 +10336,13 @@ os_abort_impl(PyObject *module)
{
abort();
/*NOTREACHED*/
+#ifndef __clang__
+ /* Issue #28152: abort() is declared with __attribute__((__noreturn__)).
+ GCC emits a warning without "return NULL;" (compiler bug?), but Clang
+ is smarter and emits a warning on the return. */
Py_FatalError("abort() called from Python code didn't abort!");
return NULL;
+#endif
}
#ifdef MS_WINDOWS
@@ -11143,10 +11143,10 @@ posix_set_blocking(PyObject *self, PyObject *args)
#endif /* !MS_WINDOWS */
-PyDoc_STRVAR(posix_scandir__doc__,
-"scandir(path='.') -> iterator of DirEntry objects for given path");
-
-static char *follow_symlinks_keywords[] = {"follow_symlinks", NULL};
+/*[clinic input]
+class os.DirEntry "DirEntry *" "&DirEntryType"
+[clinic start generated code]*/
+/*[clinic end generated code: output=da39a3ee5e6b4b0d input=3138f09f7c683f1d]*/
typedef struct {
PyObject_HEAD
@@ -11180,9 +11180,15 @@ DirEntry_dealloc(DirEntry *entry)
static int
DirEntry_test_mode(DirEntry *self, int follow_symlinks, unsigned short mode_bits);
-/* Set exception and return -1 on error, 0 for False, 1 for True */
+/*[clinic input]
+os.DirEntry.is_symlink -> bool
+
+Return True if the entry is a symbolic link; cached per entry.
+[clinic start generated code]*/
+
static int
-DirEntry_is_symlink(DirEntry *self)
+os_DirEntry_is_symlink_impl(DirEntry *self)
+/*[clinic end generated code: output=42244667d7bcfc25 input=1605a1b4b96976c3]*/
{
#ifdef MS_WINDOWS
return (self->win32_lstat.st_mode & S_IFMT) == S_IFLNK;
@@ -11199,17 +11205,6 @@ DirEntry_is_symlink(DirEntry *self)
}
static PyObject *
-DirEntry_py_is_symlink(DirEntry *self)
-{
- int result;
-
- result = DirEntry_is_symlink(self);
- if (result == -1)
- return NULL;
- return PyBool_FromLong(result);
-}
-
-static PyObject *
DirEntry_fetch_stat(DirEntry *self, int follow_symlinks)
{
int result;
@@ -11251,14 +11246,23 @@ DirEntry_get_lstat(DirEntry *self)
return self->lstat;
}
+/*[clinic input]
+os.DirEntry.stat
+ *
+ follow_symlinks: bool = True
+
+Return stat_result object for the entry; cached per entry.
+[clinic start generated code]*/
+
static PyObject *
-DirEntry_get_stat(DirEntry *self, int follow_symlinks)
+os_DirEntry_stat_impl(DirEntry *self, int follow_symlinks)
+/*[clinic end generated code: output=008593b3a6d01305 input=280d14c1d6f1d00d]*/
{
if (!follow_symlinks)
return DirEntry_get_lstat(self);
if (!self->stat) {
- int result = DirEntry_is_symlink(self);
+ int result = os_DirEntry_is_symlink_impl(self);
if (result == -1)
return NULL;
else if (result)
@@ -11271,18 +11275,6 @@ DirEntry_get_stat(DirEntry *self, int follow_symlinks)
return self->stat;
}
-static PyObject *
-DirEntry_stat(DirEntry *self, PyObject *args, PyObject *kwargs)
-{
- int follow_symlinks = 1;
-
- if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|$p:DirEntry.stat",
- follow_symlinks_keywords, &follow_symlinks))
- return NULL;
-
- return DirEntry_get_stat(self, follow_symlinks);
-}
-
/* Set exception and return -1 on error, 0 for False, 1 for True */
static int
DirEntry_test_mode(DirEntry *self, int follow_symlinks, unsigned short mode_bits)
@@ -11311,7 +11303,7 @@ DirEntry_test_mode(DirEntry *self, int follow_symlinks, unsigned short mode_bits
#if defined(MS_WINDOWS) || defined(HAVE_DIRENT_D_TYPE)
if (need_stat) {
#endif
- stat = DirEntry_get_stat(self, follow_symlinks);
+ stat = os_DirEntry_stat_impl(self, follow_symlinks);
if (!stat) {
if (PyErr_ExceptionMatches(PyExc_FileNotFoundError)) {
/* If file doesn't exist (anymore), then return False
@@ -11362,43 +11354,45 @@ error:
return -1;
}
-static PyObject *
-DirEntry_py_test_mode(DirEntry *self, int follow_symlinks, unsigned short mode_bits)
-{
- int result;
+/*[clinic input]
+os.DirEntry.is_dir -> bool
+ *
+ follow_symlinks: bool = True
- result = DirEntry_test_mode(self, follow_symlinks, mode_bits);
- if (result == -1)
- return NULL;
- return PyBool_FromLong(result);
-}
+Return True if the entry is a directory; cached per entry.
+[clinic start generated code]*/
-static PyObject *
-DirEntry_is_dir(DirEntry *self, PyObject *args, PyObject *kwargs)
+static int
+os_DirEntry_is_dir_impl(DirEntry *self, int follow_symlinks)
+/*[clinic end generated code: output=ad2e8d54365da287 input=0135232766f53f58]*/
{
- int follow_symlinks = 1;
+ return DirEntry_test_mode(self, follow_symlinks, S_IFDIR);
+}
- if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|$p:DirEntry.is_dir",
- follow_symlinks_keywords, &follow_symlinks))
- return NULL;
+/*[clinic input]
+os.DirEntry.is_file -> bool
+ *
+ follow_symlinks: bool = True
- return DirEntry_py_test_mode(self, follow_symlinks, S_IFDIR);
-}
+Return True if the entry is a file; cached per entry.
+[clinic start generated code]*/
-static PyObject *
-DirEntry_is_file(DirEntry *self, PyObject *args, PyObject *kwargs)
+static int
+os_DirEntry_is_file_impl(DirEntry *self, int follow_symlinks)
+/*[clinic end generated code: output=8462ade481d8a476 input=0dc90be168b041ee]*/
{
- int follow_symlinks = 1;
+ return DirEntry_test_mode(self, follow_symlinks, S_IFREG);
+}
- if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|$p:DirEntry.is_file",
- follow_symlinks_keywords, &follow_symlinks))
- return NULL;
+/*[clinic input]
+os.DirEntry.inode
- return DirEntry_py_test_mode(self, follow_symlinks, S_IFREG);
-}
+Return inode of the entry; cached per entry.
+[clinic start generated code]*/
static PyObject *
-DirEntry_inode(DirEntry *self)
+os_DirEntry_inode_impl(DirEntry *self)
+/*[clinic end generated code: output=156bb3a72162440e input=3ee7b872ae8649f0]*/
{
#ifdef MS_WINDOWS
if (!self->got_file_index) {
@@ -11435,8 +11429,15 @@ DirEntry_repr(DirEntry *self)
return PyUnicode_FromFormat("<DirEntry %R>", self->name);
}
+/*[clinic input]
+os.DirEntry.__fspath__
+
+Returns the path for the entry.
+[clinic start generated code]*/
+
static PyObject *
-DirEntry_fspath(DirEntry *self)
+os_DirEntry___fspath___impl(DirEntry *self)
+/*[clinic end generated code: output=6dd7f7ef752e6f4f input=3c49d0cf38df4fac]*/
{
Py_INCREF(self->path);
return self->path;
@@ -11450,25 +11451,15 @@ static PyMemberDef DirEntry_members[] = {
{NULL}
};
+#include "clinic/posixmodule.c.h"
+
static PyMethodDef DirEntry_methods[] = {
- {"is_dir", (PyCFunction)DirEntry_is_dir, METH_VARARGS | METH_KEYWORDS,
- "return True if the entry is a directory; cached per entry"
- },
- {"is_file", (PyCFunction)DirEntry_is_file, METH_VARARGS | METH_KEYWORDS,
- "return True if the entry is a file; cached per entry"
- },
- {"is_symlink", (PyCFunction)DirEntry_py_is_symlink, METH_NOARGS,
- "return True if the entry is a symbolic link; cached per entry"
- },
- {"stat", (PyCFunction)DirEntry_stat, METH_VARARGS | METH_KEYWORDS,
- "return stat_result object for the entry; cached per entry"
- },
- {"inode", (PyCFunction)DirEntry_inode, METH_NOARGS,
- "return inode of the entry; cached per entry",
- },
- {"__fspath__", (PyCFunction)DirEntry_fspath, METH_NOARGS,
- "returns the path for the entry",
- },
+ OS_DIRENTRY_IS_DIR_METHODDEF
+ OS_DIRENTRY_IS_FILE_METHODDEF
+ OS_DIRENTRY_IS_SYMLINK_METHODDEF
+ OS_DIRENTRY_STAT_METHODDEF
+ OS_DIRENTRY_INODE_METHODDEF
+ OS_DIRENTRY___FSPATH___METHODDEF
{NULL}
};
@@ -11941,23 +11932,34 @@ static PyTypeObject ScandirIteratorType = {
(destructor)ScandirIterator_finalize, /* tp_finalize */
};
+/*[clinic input]
+os.scandir
+
+ path : path_t(nullable=True) = None
+
+Return an iterator of DirEntry objects for given path.
+
+path can be specified as either str, bytes or path-like object. If path
+is bytes, the names of yielded DirEntry objects will also be bytes; in
+all other circumstances they will be str.
+
+If path is None, uses the path='.'.
+[clinic start generated code]*/
+
static PyObject *
-posix_scandir(PyObject *self, PyObject *args, PyObject *kwargs)
+os_scandir_impl(PyObject *module, path_t *path)
+/*[clinic end generated code: output=6eb2668b675ca89e input=e62b08b3cd41f604]*/
{
ScandirIterator *iterator;
- static char *keywords[] = {"path", NULL};
#ifdef MS_WINDOWS
wchar_t *path_strW;
#else
- const char *path;
+ const char *path_str;
#endif
iterator = PyObject_New(ScandirIterator, &ScandirIteratorType);
if (!iterator)
return NULL;
- memset(&iterator->path, 0, sizeof(path_t));
- iterator->path.function_name = "scandir";
- iterator->path.nullable = 1;
#ifdef MS_WINDOWS
iterator->handle = INVALID_HANDLE_VALUE;
@@ -11965,15 +11967,13 @@ posix_scandir(PyObject *self, PyObject *args, PyObject *kwargs)
iterator->dirp = NULL;
#endif
- if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|O&:scandir", keywords,
- path_converter, &iterator->path))
- goto error;
-
+ memcpy(&iterator->path, path, sizeof(path_t));
/* path_converter doesn't keep path.object around, so do it
manually for the lifetime of the iterator here (the refcount
is decremented in ScandirIterator_dealloc)
*/
Py_XINCREF(iterator->path.object);
+ Py_XINCREF(iterator->path.cleanup);
#ifdef MS_WINDOWS
iterator->first_time = 1;
@@ -11994,13 +11994,13 @@ posix_scandir(PyObject *self, PyObject *args, PyObject *kwargs)
}
#else /* POSIX */
if (iterator->path.narrow)
- path = iterator->path.narrow;
+ path_str = iterator->path.narrow;
else
- path = ".";
+ path_str = ".";
errno = 0;
Py_BEGIN_ALLOW_THREADS
- iterator->dirp = opendir(path);
+ iterator->dirp = opendir(path_str);
Py_END_ALLOW_THREADS
if (!iterator->dirp) {
@@ -12045,7 +12045,7 @@ PyOS_FSPath(PyObject *path)
Py_TYPE(path)->tp_name);
}
- path_repr = PyObject_CallFunctionObjArgs(func, NULL);
+ path_repr = _PyObject_CallNoArg(func);
Py_DECREF(func);
if (NULL == path_repr) {
return NULL;
@@ -12143,13 +12143,6 @@ error:
}
#endif /* HAVE_GETRANDOM_SYSCALL */
-#include "clinic/posixmodule.c.h"
-
-/*[clinic input]
-dump buffer
-[clinic start generated code]*/
-/*[clinic end generated code: output=da39a3ee5e6b4b0d input=524ce2e021e4eba6]*/
-
static PyMethodDef posix_methods[] = {
@@ -12339,9 +12332,7 @@ static PyMethodDef posix_methods[] = {
{"get_blocking", posix_get_blocking, METH_VARARGS, get_blocking__doc__},
{"set_blocking", posix_set_blocking, METH_VARARGS, set_blocking__doc__},
#endif
- {"scandir", (PyCFunction)posix_scandir,
- METH_VARARGS | METH_KEYWORDS,
- posix_scandir__doc__},
+ OS_SCANDIR_METHODDEF
OS_FSPATH_METHODDEF
OS_GETRANDOM_METHODDEF
{NULL, NULL} /* Sentinel */
diff --git a/Modules/pyexpat.c b/Modules/pyexpat.c
index b3259d57aa..e0c9be732e 100644
--- a/Modules/pyexpat.c
+++ b/Modules/pyexpat.c
@@ -119,7 +119,7 @@ set_error(xmlparseobject *self, enum XML_Error code)
XML_ErrorString(code), lineno, column);
if (buffer == NULL)
return NULL;
- err = PyObject_CallFunction(ErrorObject, "O", buffer);
+ err = PyObject_CallFunctionObjArgs(ErrorObject, buffer, NULL);
Py_DECREF(buffer);
if ( err != NULL
&& set_error_attr(err, "code", code)
@@ -161,8 +161,7 @@ conv_string_to_unicode(const XML_Char *str)
and hence in UTF-8. */
/* UTF-8 from Expat, Unicode desired */
if (str == NULL) {
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
return PyUnicode_DecodeUTF8(str, strlen(str), "strict");
}
@@ -174,8 +173,7 @@ conv_string_len_to_unicode(const XML_Char *str, int len)
and hence in UTF-8. */
/* UTF-8 from Expat, Unicode desired */
if (str == NULL) {
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
return PyUnicode_DecodeUTF8((const char *)str, len, "strict");
}
@@ -1030,8 +1028,7 @@ pyexpat_xmlparser_UseForeignDTD_impl(xmlparseobject *self, int flag)
if (rc != XML_ERROR_NONE) {
return set_error(self, rc);
}
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
#endif
@@ -1322,8 +1319,7 @@ xmlparse_getattro(xmlparseobject *self, PyObject *nameobj)
return get_pybool((long) self->specified_attributes);
if (_PyUnicode_EqualToASCIIString(nameobj, "intern")) {
if (self->intern == NULL) {
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
else {
Py_INCREF(self->intern);
@@ -1984,8 +1980,3 @@ static struct HandlerInfo handler_info[] = {
{NULL, NULL, NULL} /* sentinel */
};
-
-/*[clinic input]
-dump buffer
-[clinic start generated code]*/
-/*[clinic end generated code: output=da39a3ee5e6b4b0d input=524ce2e021e4eba6]*/
diff --git a/Modules/readline.c b/Modules/readline.c
index 3b94d4a0d1..389954f087 100644
--- a/Modules/readline.c
+++ b/Modules/readline.c
@@ -868,7 +868,7 @@ on_hook(PyObject *func)
int result = 0;
if (func != NULL) {
PyObject *r;
- r = PyObject_CallFunction(func, NULL);
+ r = _PyObject_CallNoArg(func);
if (r == NULL)
goto error;
if (r == Py_None)
diff --git a/Modules/selectmodule.c b/Modules/selectmodule.c
index 47da49399f..8bdf3359d4 100644
--- a/Modules/selectmodule.c
+++ b/Modules/selectmodule.c
@@ -353,7 +353,7 @@ update_ufd_array(pollObject *self)
PyObject *key, *value;
struct pollfd *old_ufds = self->ufds;
- self->ufd_len = PyDict_Size(self->dict);
+ self->ufd_len = PyDict_GET_SIZE(self->dict);
PyMem_RESIZE(self->ufds, struct pollfd, self->ufd_len);
if (self->ufds == NULL) {
self->ufds = old_ufds;
@@ -431,8 +431,7 @@ poll_register(pollObject *self, PyObject *args)
self->ufd_uptodate = 0;
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
PyDoc_STRVAR(poll_modify_doc,
@@ -479,8 +478,7 @@ poll_modify(pollObject *self, PyObject *args)
self->ufd_uptodate = 0;
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
@@ -513,8 +511,7 @@ poll_unregister(pollObject *self, PyObject *o)
Py_DECREF(key);
self->ufd_uptodate = 0;
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
PyDoc_STRVAR(poll_poll_doc,
@@ -1252,7 +1249,7 @@ pyepoll_internal_close(pyEpoll_Object *self)
}
static PyObject *
-newPyEpoll_Object(PyTypeObject *type, int sizehint, int flags, SOCKET fd)
+newPyEpoll_Object(PyTypeObject *type, int sizehint, SOCKET fd)
{
pyEpoll_Object *self;
@@ -1264,12 +1261,10 @@ newPyEpoll_Object(PyTypeObject *type, int sizehint, int flags, SOCKET fd)
if (fd == -1) {
Py_BEGIN_ALLOW_THREADS
#ifdef HAVE_EPOLL_CREATE1
- flags |= EPOLL_CLOEXEC;
- if (flags)
- self->epfd = epoll_create1(flags);
- else
-#endif
+ self->epfd = epoll_create1(EPOLL_CLOEXEC);
+#else
self->epfd = epoll_create(sizehint);
+#endif
Py_END_ALLOW_THREADS
}
else {
@@ -1305,8 +1300,12 @@ pyepoll_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
PyErr_SetString(PyExc_ValueError, "negative sizehint");
return NULL;
}
+ if (flags && flags != EPOLL_CLOEXEC) {
+ PyErr_SetString(PyExc_OSError, "invalid flags");
+ return NULL;
+ }
- return newPyEpoll_Object(type, sizehint, flags, -1);
+ return newPyEpoll_Object(type, sizehint, -1);
}
@@ -1364,7 +1363,7 @@ pyepoll_fromfd(PyObject *cls, PyObject *args)
if (!PyArg_ParseTuple(args, "i:fromfd", &fd))
return NULL;
- return newPyEpoll_Object((PyTypeObject*)cls, FD_SETSIZE - 1, 0, fd);
+ return newPyEpoll_Object((PyTypeObject*)cls, FD_SETSIZE - 1, fd);
}
PyDoc_STRVAR(pyepoll_fromfd_doc,
diff --git a/Modules/sha1module.c b/Modules/sha1module.c
index d5065ce134..d39190b4d5 100644
--- a/Modules/sha1module.c
+++ b/Modules/sha1module.c
@@ -393,8 +393,7 @@ SHA1Type_update(SHA1object *self, PyObject *obj)
sha1_process(&self->hash_state, buf.buf, buf.len);
PyBuffer_Release(&buf);
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
static PyMethodDef SHA1_methods[] = {
diff --git a/Modules/sha256module.c b/Modules/sha256module.c
index 8f067f182c..e4cb3286ce 100644
--- a/Modules/sha256module.c
+++ b/Modules/sha256module.c
@@ -483,8 +483,7 @@ SHA256Type_update(SHAobject *self, PyObject *obj)
sha_update(self, buf.buf, buf.len);
PyBuffer_Release(&buf);
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
static PyMethodDef SHA_methods[] = {
diff --git a/Modules/sha512module.c b/Modules/sha512module.c
index 17775ae57b..5ac2a2a61c 100644
--- a/Modules/sha512module.c
+++ b/Modules/sha512module.c
@@ -548,13 +548,8 @@ SHA512Type_update(SHAobject *self, PyObject *obj)
sha512_update(self, buf.buf, buf.len);
PyBuffer_Release(&buf);
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
-/*[clinic input]
-dump buffer
-[clinic start generated code]*/
-/*[clinic end generated code: output=da39a3ee5e6b4b0d input=524ce2e021e4eba6]*/
static PyMethodDef SHA_methods[] = {
SHA512TYPE_COPY_METHODDEF
@@ -748,11 +743,6 @@ _sha512_sha384_impl(PyObject *module, PyObject *string)
}
-/*[clinic input]
-dump buffer
-[clinic start generated code]*/
-/*[clinic end generated code: output=da39a3ee5e6b4b0d input=524ce2e021e4eba6]*/
-
/* List of functions exported by this module */
static struct PyMethodDef SHA_functions[] = {
diff --git a/Modules/signalmodule.c b/Modules/signalmodule.c
index e27075b200..bc36d41648 100644
--- a/Modules/signalmodule.c
+++ b/Modules/signalmodule.c
@@ -957,7 +957,11 @@ fill_siginfo(siginfo_t *si)
PyStructSequence_SET_ITEM(result, 4, _PyLong_FromUid(si->si_uid));
PyStructSequence_SET_ITEM(result, 5,
PyLong_FromLong((long)(si->si_status)));
+#ifdef HAVE_SIGINFO_T_SI_BAND
PyStructSequence_SET_ITEM(result, 6, PyLong_FromLong(si->si_band));
+#else
+ PyStructSequence_SET_ITEM(result, 6, PyLong_FromLong(0L));
+#endif
if (PyErr_Occurred()) {
Py_DECREF(result);
return NULL;
diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c
index f4edc062fd..8d0f9e6df8 100644
--- a/Modules/socketmodule.c
+++ b/Modules/socketmodule.c
@@ -1218,8 +1218,7 @@ makesockaddr(SOCKET_T sockfd, struct sockaddr *addr, size_t addrlen, int proto)
{
if (addrlen == 0) {
/* No address -- may be recvfrom() from known socket */
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
switch (addr->sa_family) {
@@ -2540,8 +2539,7 @@ static PyObject *
sock_gettimeout(PySocketSockObject *s)
{
if (s->sock_timeout < 0) {
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
else {
double seconds = _PyTime_AsSecondsDouble(s->sock_timeout);
@@ -2701,8 +2699,7 @@ sock_bind(PySocketSockObject *s, PyObject *addro)
Py_END_ALLOW_THREADS
if (res < 0)
return s->errorhandler();
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
PyDoc_STRVAR(bind_doc,
@@ -2738,8 +2735,7 @@ sock_close(PySocketSockObject *s)
return s->errorhandler();
}
}
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
PyDoc_STRVAR(close_doc,
@@ -2996,8 +2992,7 @@ sock_listen(PySocketSockObject *s, PyObject *args)
Py_END_ALLOW_THREADS
if (res < 0)
return s->errorhandler();
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
PyDoc_STRVAR(listen_doc,
@@ -3863,11 +3858,15 @@ sock_sendto(PySocketSockObject *s, PyObject *args)
arglen = PyTuple_Size(args);
switch (arglen) {
case 2:
- PyArg_ParseTuple(args, "y*O:sendto", &pbuf, &addro);
+ if (!PyArg_ParseTuple(args, "y*O:sendto", &pbuf, &addro)) {
+ return NULL;
+ }
break;
case 3:
- PyArg_ParseTuple(args, "y*iO:sendto",
- &pbuf, &flags, &addro);
+ if (!PyArg_ParseTuple(args, "y*iO:sendto",
+ &pbuf, &flags, &addro)) {
+ return NULL;
+ }
break;
default:
PyErr_Format(PyExc_TypeError,
@@ -3875,8 +3874,6 @@ sock_sendto(PySocketSockObject *s, PyObject *args)
arglen);
return NULL;
}
- if (PyErr_Occurred())
- return NULL;
if (!IS_SELECTABLE(s)) {
PyBuffer_Release(&pbuf);
@@ -4361,8 +4358,7 @@ sock_shutdown(PySocketSockObject *s, PyObject *arg)
Py_END_ALLOW_THREADS
if (res < 0)
return s->errorhandler();
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
PyDoc_STRVAR(shutdown_doc,
@@ -5507,24 +5503,38 @@ AF_UNIX if defined on the platform; otherwise, the default is AF_INET.");
static PyObject *
socket_ntohs(PyObject *self, PyObject *args)
{
- int x1, x2;
+ int x;
- if (!PyArg_ParseTuple(args, "i:ntohs", &x1)) {
+ if (!PyArg_ParseTuple(args, "i:ntohs", &x)) {
return NULL;
}
- if (x1 < 0) {
+ if (x < 0) {
PyErr_SetString(PyExc_OverflowError,
- "can't convert negative number to unsigned long");
+ "ntohs: can't convert negative Python int to C "
+ "16-bit unsigned integer");
return NULL;
}
- x2 = (unsigned int)ntohs((unsigned short)x1);
- return PyLong_FromLong(x2);
+ if (x > 0xffff) {
+ if (PyErr_WarnEx(PyExc_DeprecationWarning,
+ "ntohs: Python int too large to convert to C "
+ "16-bit unsigned integer (The silent truncation "
+ "is deprecated)",
+ 1)) {
+ return NULL;
+ }
+ }
+ return PyLong_FromUnsignedLong(ntohs((unsigned short)x));
}
PyDoc_STRVAR(ntohs_doc,
"ntohs(integer) -> integer\n\
\n\
-Convert a 16-bit integer from network to host byte order.");
+Convert a 16-bit unsigned integer from network to host byte order.\n\
+Note that in case the received integer does not fit in 16-bit unsigned\n\
+integer, but does fit in a positive C int, it is silently truncated to\n\
+16-bit unsigned integer.\n\
+However, this silent truncation feature is deprecated, and will raise an \n\
+exception in future versions of Python.");
static PyObject *
@@ -5564,24 +5574,38 @@ Convert a 32-bit integer from network to host byte order.");
static PyObject *
socket_htons(PyObject *self, PyObject *args)
{
- int x1, x2;
+ int x;
- if (!PyArg_ParseTuple(args, "i:htons", &x1)) {
+ if (!PyArg_ParseTuple(args, "i:htons", &x)) {
return NULL;
}
- if (x1 < 0) {
+ if (x < 0) {
PyErr_SetString(PyExc_OverflowError,
- "can't convert negative number to unsigned long");
+ "htons: can't convert negative Python int to C "
+ "16-bit unsigned integer");
return NULL;
}
- x2 = (unsigned int)htons((unsigned short)x1);
- return PyLong_FromLong(x2);
+ if (x > 0xffff) {
+ if (PyErr_WarnEx(PyExc_DeprecationWarning,
+ "htons: Python int too large to convert to C "
+ "16-bit unsigned integer (The silent truncation "
+ "is deprecated)",
+ 1)) {
+ return NULL;
+ }
+ }
+ return PyLong_FromUnsignedLong(htons((unsigned short)x));
}
PyDoc_STRVAR(htons_doc,
"htons(integer) -> integer\n\
\n\
-Convert a 16-bit integer from host to network byte order.");
+Convert a 16-bit unsigned integer from host to network byte order.\n\
+Note that in case the received integer does not fit in 16-bit unsigned\n\
+integer, but does fit in a positive C int, it is silently truncated to\n\
+16-bit unsigned integer.\n\
+However, this silent truncation feature is deprecated, and will raise an \n\
+exception in future versions of Python.");
static PyObject *
@@ -5954,7 +5978,7 @@ socket_getaddrinfo(PyObject *self, PyObject *args, PyObject* kwargs)
PyObject *hobj = NULL;
PyObject *pobj = (PyObject *)NULL;
char pbuf[30];
- char *hptr, *pptr;
+ const char *hptr, *pptr;
int family, socktype, protocol, flags;
int error;
PyObject *all = (PyObject *)NULL;
@@ -6166,8 +6190,7 @@ static PyObject *
socket_getdefaulttimeout(PyObject *self)
{
if (defaulttimeout < 0) {
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
else {
double seconds = _PyTime_AsSecondsDouble(defaulttimeout);
@@ -6192,8 +6215,7 @@ socket_setdefaulttimeout(PyObject *self, PyObject *arg)
defaulttimeout = timeout;
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
PyDoc_STRVAR(setdefaulttimeout_doc,
diff --git a/Modules/sre.h b/Modules/sre.h
index b632165a1f..9af5e40574 100644
--- a/Modules/sre.h
+++ b/Modules/sre.h
@@ -27,8 +27,8 @@
typedef struct {
PyObject_VAR_HEAD
Py_ssize_t groups; /* must be first! */
- PyObject* groupindex;
- PyObject* indexgroup;
+ PyObject* groupindex; /* dict */
+ PyObject* indexgroup; /* tuple */
/* compatibility */
PyObject* pattern; /* pattern source (or None) */
int flags; /* flags used when compiling pattern source */
diff --git a/Modules/symtablemodule.c b/Modules/symtablemodule.c
index 34a6fc56f9..810f88da48 100644
--- a/Modules/symtablemodule.c
+++ b/Modules/symtablemodule.c
@@ -4,20 +4,33 @@
#include "Python-ast.h"
#include "symtable.h"
+#include "clinic/symtablemodule.c.h"
+/*[clinic input]
+module _symtable
+[clinic start generated code]*/
+/*[clinic end generated code: output=da39a3ee5e6b4b0d input=f4685845a7100605]*/
+
+
+/*[clinic input]
+_symtable.symtable
+
+ str: str
+ filename: object(converter='PyUnicode_FSDecoder')
+ startstr: str
+ /
+
+Return symbol and scope dictionaries used internally by compiler.
+[clinic start generated code]*/
+
static PyObject *
-symtable_symtable(PyObject *self, PyObject *args)
+_symtable_symtable_impl(PyObject *module, const char *str,
+ PyObject *filename, const char *startstr)
+/*[clinic end generated code: output=914b369c9b785956 input=6c615e84d5f408e3]*/
{
struct symtable *st;
PyObject *t;
-
- char *str;
- PyObject *filename;
- char *startstr;
int start;
- if (!PyArg_ParseTuple(args, "sO&s:symtable",
- &str, PyUnicode_FSDecoder, &filename, &startstr))
- return NULL;
if (strcmp(startstr, "exec") == 0)
start = Py_file_input;
else if (strcmp(startstr, "eval") == 0)
@@ -42,9 +55,7 @@ symtable_symtable(PyObject *self, PyObject *args)
}
static PyMethodDef symtable_methods[] = {
- {"symtable", symtable_symtable, METH_VARARGS,
- PyDoc_STR("Return symbol and scope dictionaries"
- " used internally by compiler.")},
+ _SYMTABLE_SYMTABLE_METHODDEF
{NULL, NULL} /* sentinel */
};
diff --git a/Modules/syslogmodule.c b/Modules/syslogmodule.c
index 7afca58d0e..a5807dcce9 100644
--- a/Modules/syslogmodule.c
+++ b/Modules/syslogmodule.c
@@ -116,7 +116,7 @@ syslog_openlog(PyObject * self, PyObject * args, PyObject *kwds)
long facility = LOG_USER;
PyObject *new_S_ident_o = NULL;
static char *keywords[] = {"ident", "logoption", "facility", 0};
- char *ident = NULL;
+ const char *ident = NULL;
if (!PyArg_ParseTupleAndKeywords(args, kwds,
"|Ull:openlog", keywords, &new_S_ident_o, &logopt, &facility))
@@ -147,8 +147,7 @@ syslog_openlog(PyObject * self, PyObject * args, PyObject *kwds)
openlog(ident, logopt, facility);
S_log_open = 1;
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
@@ -200,8 +199,7 @@ syslog_closelog(PyObject *self, PyObject *unused)
Py_CLEAR(S_ident_o);
S_log_open = 0;
}
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
static PyObject *
diff --git a/Modules/termios.c b/Modules/termios.c
index b78d33e688..6ed4395ae4 100644
--- a/Modules/termios.c
+++ b/Modules/termios.c
@@ -194,8 +194,7 @@ termios_tcsetattr(PyObject *self, PyObject *args)
if (tcsetattr(fd, when, &mode) == -1)
return PyErr_SetFromErrno(TermiosError);
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
PyDoc_STRVAR(termios_tcsendbreak__doc__,
@@ -216,8 +215,7 @@ termios_tcsendbreak(PyObject *self, PyObject *args)
if (tcsendbreak(fd, duration) == -1)
return PyErr_SetFromErrno(TermiosError);
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
PyDoc_STRVAR(termios_tcdrain__doc__,
@@ -236,8 +234,7 @@ termios_tcdrain(PyObject *self, PyObject *args)
if (tcdrain(fd) == -1)
return PyErr_SetFromErrno(TermiosError);
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
PyDoc_STRVAR(termios_tcflush__doc__,
@@ -259,8 +256,7 @@ termios_tcflush(PyObject *self, PyObject *args)
if (tcflush(fd, queue) == -1)
return PyErr_SetFromErrno(TermiosError);
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
PyDoc_STRVAR(termios_tcflow__doc__,
@@ -282,8 +278,7 @@ termios_tcflow(PyObject *self, PyObject *args)
if (tcflow(fd, action) == -1)
return PyErr_SetFromErrno(TermiosError);
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
static PyMethodDef termios_methods[] =
diff --git a/Modules/timemodule.c b/Modules/timemodule.c
index ebd44ad525..25eb92dada 100644
--- a/Modules/timemodule.c
+++ b/Modules/timemodule.c
@@ -234,8 +234,7 @@ time_sleep(PyObject *self, PyObject *obj)
}
if (pysleep(secs) != 0)
return NULL;
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
PyDoc_STRVAR(sleep_doc,
@@ -717,16 +716,22 @@ is not present, current time as returned by localtime() is used.\n\
static PyObject *
time_strptime(PyObject *self, PyObject *args)
{
- PyObject *strptime_module = PyImport_ImportModuleNoBlock("_strptime");
- PyObject *strptime_result;
+ PyObject *module, *func, *result;
_Py_IDENTIFIER(_strptime_time);
- if (!strptime_module)
+ module = PyImport_ImportModuleNoBlock("_strptime");
+ if (!module)
+ return NULL;
+
+ func = _PyObject_GetAttrId(module, &PyId__strptime_time);
+ Py_DECREF(module);
+ if (!func) {
return NULL;
- strptime_result = _PyObject_CallMethodId(strptime_module,
- &PyId__strptime_time, "O", args);
- Py_DECREF(strptime_module);
- return strptime_result;
+ }
+
+ result = PyObject_Call(func, args, NULL);
+ Py_DECREF(func);
+ return result;
}
@@ -873,8 +878,7 @@ time_tzset(PyObject *self, PyObject *unused)
if (PyErr_Occurred())
return NULL;
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
PyDoc_STRVAR(tzset_doc,
diff --git a/Modules/unicodedata.c b/Modules/unicodedata.c
index 9e71e018e2..fbe811e807 100644
--- a/Modules/unicodedata.c
+++ b/Modules/unicodedata.c
@@ -808,7 +808,7 @@ unicodedata.UCD.normalize
self: self
form: str
- unistr as input: object(subclass_of='&PyUnicode_Type')
+ unistr as input: unicode
/
Return the normal form 'form' for the Unicode string unistr.
@@ -819,11 +819,8 @@ Valid values for form are 'NFC', 'NFKC', 'NFD', and 'NFKD'.
static PyObject *
unicodedata_UCD_normalize_impl(PyObject *self, const char *form,
PyObject *input)
-/*[clinic end generated code: output=62d1f8870027efdc input=cd092e631cf11883]*/
+/*[clinic end generated code: output=62d1f8870027efdc input=1744c55f4ab79bf0]*/
{
- if (PyUnicode_READY(input) == -1)
- return NULL;
-
if (PyUnicode_GET_LENGTH(input) == 0) {
/* Special case empty input strings, since resizing
them later would cause internal errors. */
diff --git a/Modules/zipimport.c b/Modules/zipimport.c
index 59046aaae4..18777b2a1d 100644
--- a/Modules/zipimport.c
+++ b/Modules/zipimport.c
@@ -677,8 +677,7 @@ zipimporter_get_source(PyObject *obj, PyObject *args)
}
/* we have the module, but no source */
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
PyDoc_STRVAR(doc_find_module,
@@ -998,13 +997,13 @@ read_directory(PyObject *archive)
goto file_error;
}
name[name_size] = '\0'; /* Add terminating null byte */
- if (SEP != '/') {
- for (i = 0; i < name_size; i++) {
- if (name[i] == '/') {
- name[i] = SEP;
- }
+#if SEP != '/'
+ for (i = 0; i < name_size; i++) {
+ if (name[i] == '/') {
+ name[i] = SEP;
}
}
+#endif
/* Skip the rest of the header.
* On Windows, calling fseek to skip over the fields we don't use is
* slower than reading the data because fseek flushes stdio's
@@ -1284,8 +1283,7 @@ unmarshal_code(PyObject *pathname, PyObject *data, time_t mtime)
PySys_FormatStderr("# %R has bad magic\n",
pathname);
}
- Py_INCREF(Py_None);
- return Py_None; /* signal caller to try alternative */
+ Py_RETURN_NONE; /* signal caller to try alternative */
}
if (mtime != 0 && !eq_mtime(get_uint32(buf + 4), mtime)) {
@@ -1293,8 +1291,7 @@ unmarshal_code(PyObject *pathname, PyObject *data, time_t mtime)
PySys_FormatStderr("# %R has bad mtime\n",
pathname);
}
- Py_INCREF(Py_None);
- return Py_None; /* signal caller to try alternative */
+ Py_RETURN_NONE; /* signal caller to try alternative */
}
/* XXX the pyc's size field is ignored; timestamp collisions are probably
diff --git a/Objects/abstract.c b/Objects/abstract.c
index d838856d45..4d7f94ad87 100644
--- a/Objects/abstract.c
+++ b/Objects/abstract.c
@@ -103,7 +103,7 @@ PyObject_LengthHint(PyObject *o, Py_ssize_t defaultvalue)
}
return defaultvalue;
}
- result = PyObject_CallFunctionObjArgs(hint, NULL);
+ result = _PyObject_CallNoArg(hint);
Py_DECREF(hint);
if (result == NULL) {
if (PyErr_ExceptionMatches(PyExc_TypeError)) {
@@ -252,14 +252,6 @@ PyObject_DelItemString(PyObject *o, const char *key)
cause issues later on. Don't use these functions in new code.
*/
int
-PyObject_AsCharBuffer(PyObject *obj,
- const char **buffer,
- Py_ssize_t *buffer_len)
-{
- return PyObject_AsReadBuffer(obj, (const void **)buffer, buffer_len);
-}
-
-int
PyObject_CheckReadBuffer(PyObject *obj)
{
PyBufferProcs *pb = obj->ob_type->tp_as_buffer;
@@ -276,9 +268,8 @@ PyObject_CheckReadBuffer(PyObject *obj)
return 1;
}
-int PyObject_AsReadBuffer(PyObject *obj,
- const void **buffer,
- Py_ssize_t *buffer_len)
+static int
+as_read_buffer(PyObject *obj, const void **buffer, Py_ssize_t *buffer_len)
{
Py_buffer view;
@@ -295,6 +286,21 @@ int PyObject_AsReadBuffer(PyObject *obj,
return 0;
}
+int
+PyObject_AsCharBuffer(PyObject *obj,
+ const char **buffer,
+ Py_ssize_t *buffer_len)
+{
+ return as_read_buffer(obj, (const void **)buffer, buffer_len);
+}
+
+int PyObject_AsReadBuffer(PyObject *obj,
+ const void **buffer,
+ Py_ssize_t *buffer_len)
+{
+ return as_read_buffer(obj, buffer, buffer_len);
+}
+
int PyObject_AsWriteBuffer(PyObject *obj,
void **buffer,
Py_ssize_t *buffer_len)
@@ -2167,24 +2173,24 @@ PyMapping_Values(PyObject *o)
/* XXX PyCallable_Check() is in object.c */
PyObject *
-PyObject_CallObject(PyObject *o, PyObject *a)
+PyObject_CallObject(PyObject *callable, PyObject *args)
{
- return PyEval_CallObjectWithKeywords(o, a, NULL);
+ return PyEval_CallObjectWithKeywords(callable, args, NULL);
}
PyObject*
-_Py_CheckFunctionResult(PyObject *func, PyObject *result, const char *where)
+_Py_CheckFunctionResult(PyObject *callable, PyObject *result, const char *where)
{
int err_occurred = (PyErr_Occurred() != NULL);
- assert((func != NULL) ^ (where != NULL));
+ assert((callable != NULL) ^ (where != NULL));
if (result == NULL) {
if (!err_occurred) {
- if (func)
+ if (callable)
PyErr_Format(PyExc_SystemError,
"%R returned NULL without setting an error",
- func);
+ callable);
else
PyErr_Format(PyExc_SystemError,
"%s returned NULL without setting an error",
@@ -2200,10 +2206,10 @@ _Py_CheckFunctionResult(PyObject *func, PyObject *result, const char *where)
if (err_occurred) {
Py_DECREF(result);
- if (func) {
+ if (callable) {
_PyErr_FormatFromCause(PyExc_SystemError,
"%R returned a result with an error set",
- func);
+ callable);
}
else {
_PyErr_FormatFromCause(PyExc_SystemError,
@@ -2221,36 +2227,49 @@ _Py_CheckFunctionResult(PyObject *func, PyObject *result, const char *where)
}
PyObject *
-PyObject_Call(PyObject *func, PyObject *args, PyObject *kwargs)
+PyObject_Call(PyObject *callable, PyObject *args, PyObject *kwargs)
{
ternaryfunc call;
PyObject *result;
/* PyObject_Call() must not be called with an exception set,
- because it may clear it (directly or indirectly) and so the
+ because it can clear it (directly or indirectly) and so the
caller loses its exception */
assert(!PyErr_Occurred());
assert(PyTuple_Check(args));
assert(kwargs == NULL || PyDict_Check(kwargs));
- call = func->ob_type->tp_call;
- if (call == NULL) {
- PyErr_Format(PyExc_TypeError, "'%.200s' object is not callable",
- func->ob_type->tp_name);
- return NULL;
+ if (PyFunction_Check(callable)) {
+ return _PyFunction_FastCallDict(callable,
+ &PyTuple_GET_ITEM(args, 0),
+ PyTuple_GET_SIZE(args),
+ kwargs);
+ }
+ else if (PyCFunction_Check(callable)) {
+ return PyCFunction_Call(callable, args, kwargs);
}
+ else {
+ call = callable->ob_type->tp_call;
+ if (call == NULL) {
+ PyErr_Format(PyExc_TypeError, "'%.200s' object is not callable",
+ callable->ob_type->tp_name);
+ return NULL;
+ }
- if (Py_EnterRecursiveCall(" while calling a Python object"))
- return NULL;
+ if (Py_EnterRecursiveCall(" while calling a Python object"))
+ return NULL;
- result = (*call)(func, args, kwargs);
+ result = (*call)(callable, args, kwargs);
- Py_LeaveRecursiveCall();
+ Py_LeaveRecursiveCall();
- return _Py_CheckFunctionResult(func, result, NULL);
+ return _Py_CheckFunctionResult(callable, result, NULL);
+ }
}
-PyObject*
+/* Issue #29234: Inlining _PyStack_AsTuple() into callers increases their
+ stack consumption, Disable inlining to optimize the stack consumption. */
+PyObject* _Py_NO_INLINE
_PyStack_AsTuple(PyObject **stack, Py_ssize_t nargs)
{
PyObject *args;
@@ -2266,71 +2285,92 @@ _PyStack_AsTuple(PyObject **stack, Py_ssize_t nargs)
Py_INCREF(item);
PyTuple_SET_ITEM(args, i, item);
}
+ return args;
+}
+
+PyObject*
+_PyStack_AsTupleSlice(PyObject **stack, Py_ssize_t nargs,
+ Py_ssize_t start, Py_ssize_t end)
+{
+ PyObject *args;
+ Py_ssize_t i;
+ assert(0 <= start);
+ assert(end <= nargs);
+ assert(start <= end);
+
+ args = PyTuple_New(end - start);
+ if (args == NULL) {
+ return NULL;
+ }
+
+ for (i=start; i < end; i++) {
+ PyObject *item = stack[i];
+ Py_INCREF(item);
+ PyTuple_SET_ITEM(args, i - start, item);
+ }
return args;
}
PyObject *
-_PyObject_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs,
+_PyObject_FastCallDict(PyObject *callable, PyObject **args, Py_ssize_t nargs,
PyObject *kwargs)
{
- ternaryfunc call;
- PyObject *result = NULL;
-
/* _PyObject_FastCallDict() must not be called with an exception set,
- because it may clear it (directly or indirectly) and so the
+ because it can clear it (directly or indirectly) and so the
caller loses its exception */
assert(!PyErr_Occurred());
- assert(func != NULL);
+ assert(callable != NULL);
assert(nargs >= 0);
assert(nargs == 0 || args != NULL);
assert(kwargs == NULL || PyDict_Check(kwargs));
- if (Py_EnterRecursiveCall(" while calling a Python object")) {
- return NULL;
+ if (PyFunction_Check(callable)) {
+ return _PyFunction_FastCallDict(callable, args, nargs, kwargs);
}
-
- if (PyFunction_Check(func)) {
- result = _PyFunction_FastCallDict(func, args, nargs, kwargs);
- }
- else if (PyCFunction_Check(func)) {
- result = _PyCFunction_FastCallDict(func, args, nargs, kwargs);
+ else if (PyCFunction_Check(callable)) {
+ return _PyCFunction_FastCallDict(callable, args, nargs, kwargs);
}
else {
- PyObject *tuple;
+ PyObject *argstuple, *result;
+ ternaryfunc call;
/* Slow-path: build a temporary tuple */
- call = func->ob_type->tp_call;
+ call = callable->ob_type->tp_call;
if (call == NULL) {
PyErr_Format(PyExc_TypeError, "'%.200s' object is not callable",
- func->ob_type->tp_name);
- goto exit;
+ callable->ob_type->tp_name);
+ return NULL;
}
- tuple = _PyStack_AsTuple(args, nargs);
- if (tuple == NULL) {
- goto exit;
+ argstuple = _PyStack_AsTuple(args, nargs);
+ if (argstuple == NULL) {
+ return NULL;
}
- result = (*call)(func, tuple, kwargs);
- Py_DECREF(tuple);
+ if (Py_EnterRecursiveCall(" while calling a Python object")) {
+ Py_DECREF(argstuple);
+ return NULL;
+ }
- result = _Py_CheckFunctionResult(func, result, NULL);
- }
+ result = (*call)(callable, argstuple, kwargs);
-exit:
- Py_LeaveRecursiveCall();
+ Py_LeaveRecursiveCall();
+ Py_DECREF(argstuple);
- return result;
+ result = _Py_CheckFunctionResult(callable, result, NULL);
+ return result;
+ }
}
-/* Positional arguments are obj followed by args. */
+/* Positional arguments are obj followed by args:
+ call callable(obj, *args, **kwargs) */
PyObject *
-_PyObject_Call_Prepend(PyObject *func,
+_PyObject_Call_Prepend(PyObject *callable,
PyObject *obj, PyObject *args, PyObject *kwargs)
{
- PyObject *small_stack[8];
+ PyObject *small_stack[_PY_FASTCALL_SMALL_STACK];
PyObject **stack;
Py_ssize_t argcount;
PyObject *result;
@@ -2355,7 +2395,7 @@ _PyObject_Call_Prepend(PyObject *func,
&PyTuple_GET_ITEM(args, 0),
argcount * sizeof(PyObject *));
- result = _PyObject_FastCallDict(func,
+ result = _PyObject_FastCallDict(callable,
stack, argcount + 1,
kwargs);
if (stack != small_stack) {
@@ -2367,11 +2407,13 @@ _PyObject_Call_Prepend(PyObject *func,
PyObject *
_PyStack_AsDict(PyObject **values, PyObject *kwnames)
{
- Py_ssize_t nkwargs = PyTuple_GET_SIZE(kwnames);
+ Py_ssize_t nkwargs;
PyObject *kwdict;
Py_ssize_t i;
- kwdict = PyDict_New();
+ assert(kwnames != NULL);
+ nkwargs = PyTuple_GET_SIZE(kwnames);
+ kwdict = _PyDict_NewPresized(nkwargs);
if (kwdict == NULL) {
return NULL;
}
@@ -2379,8 +2421,7 @@ _PyStack_AsDict(PyObject **values, PyObject *kwnames)
for (i = 0; i < nkwargs; i++) {
PyObject *key = PyTuple_GET_ITEM(kwnames, i);
PyObject *value = *values++;
- assert(PyUnicode_CheckExact(key));
- assert(PyDict_GetItem(kwdict, key) == NULL);
+ /* If key already exists, replace it with the new value */
if (PyDict_SetItem(kwdict, key, value)) {
Py_DECREF(kwdict);
return NULL;
@@ -2389,9 +2430,9 @@ _PyStack_AsDict(PyObject **values, PyObject *kwnames)
return kwdict;
}
-PyObject **
+int
_PyStack_UnpackDict(PyObject **args, Py_ssize_t nargs, PyObject *kwargs,
- PyObject **p_kwnames, PyObject *func)
+ PyObject ***p_stack, PyObject **p_kwnames)
{
PyObject **stack, **kwstack;
Py_ssize_t nkwargs;
@@ -2402,27 +2443,27 @@ _PyStack_UnpackDict(PyObject **args, Py_ssize_t nargs, PyObject *kwargs,
assert(nargs >= 0);
assert(kwargs == NULL || PyDict_CheckExact(kwargs));
- nkwargs = (kwargs != NULL) ? PyDict_Size(kwargs) : 0;
- if (!nkwargs) {
+ if (kwargs == NULL || (nkwargs = PyDict_GET_SIZE(kwargs)) == 0) {
+ *p_stack = args;
*p_kwnames = NULL;
- return args;
+ return 0;
}
if ((size_t)nargs > PY_SSIZE_T_MAX / sizeof(stack[0]) - (size_t)nkwargs) {
PyErr_NoMemory();
- return NULL;
+ return -1;
}
stack = PyMem_Malloc((nargs + nkwargs) * sizeof(stack[0]));
if (stack == NULL) {
PyErr_NoMemory();
- return NULL;
+ return -1;
}
kwnames = PyTuple_New(nkwargs);
if (kwnames == NULL) {
PyMem_Free(stack);
- return NULL;
+ return -1;
}
/* Copy position arguments (borrowed references) */
@@ -2441,61 +2482,134 @@ _PyStack_UnpackDict(PyObject **args, Py_ssize_t nargs, PyObject *kwargs,
i++;
}
+ *p_stack = stack;
*p_kwnames = kwnames;
- return stack;
+ return 0;
}
PyObject *
-_PyObject_FastCallKeywords(PyObject *func, PyObject **stack, Py_ssize_t nargs,
+_PyObject_FastCallKeywords(PyObject *callable, PyObject **stack, Py_ssize_t nargs,
PyObject *kwnames)
{
- PyObject *kwdict, *result;
- Py_ssize_t nkwargs = (kwnames == NULL) ? 0 : PyTuple_GET_SIZE(kwnames);
+ /* _PyObject_FastCallKeywords() must not be called with an exception set,
+ because it can clear it (directly or indirectly) and so the
+ caller loses its exception */
+ assert(!PyErr_Occurred());
assert(nargs >= 0);
assert(kwnames == NULL || PyTuple_CheckExact(kwnames));
- assert((nargs == 0 && nkwargs == 0) || stack != NULL);
+
/* kwnames must only contains str strings, no subclass, and all keys must
- be unique: these are implemented in Python/ceval.c and
- _PyArg_ParseStack(). */
+ be unique: these checks are implemented in Python/ceval.c and
+ _PyArg_ParseStackAndKeywords(). */
- if (PyFunction_Check(func)) {
- return _PyFunction_FastCallKeywords(func, stack, nargs, kwnames);
+ if (PyFunction_Check(callable)) {
+ return _PyFunction_FastCallKeywords(callable, stack, nargs, kwnames);
}
-
- if (PyCFunction_Check(func)) {
- return _PyCFunction_FastCallKeywords(func, stack, nargs, kwnames);
+ if (PyCFunction_Check(callable)) {
+ return _PyCFunction_FastCallKeywords(callable, stack, nargs, kwnames);
}
+ else {
+ /* Slow-path: build a temporary tuple for positional arguments and a
+ temporary dictionary for keyword arguments (if any) */
+
+ ternaryfunc call;
+ PyObject *argstuple;
+ PyObject *kwdict, *result;
+ Py_ssize_t nkwargs;
- if (nkwargs > 0) {
- kwdict = _PyStack_AsDict(stack + nargs, kwnames);
- if (kwdict == NULL) {
+ nkwargs = (kwnames == NULL) ? 0 : PyTuple_GET_SIZE(kwnames);
+ assert((nargs == 0 && nkwargs == 0) || stack != NULL);
+
+ call = callable->ob_type->tp_call;
+ if (call == NULL) {
+ PyErr_Format(PyExc_TypeError, "'%.200s' object is not callable",
+ callable->ob_type->tp_name);
return NULL;
}
- }
- else {
- kwdict = NULL;
- }
- result = _PyObject_FastCallDict(func, stack, nargs, kwdict);
- Py_XDECREF(kwdict);
- return result;
+ argstuple = _PyStack_AsTuple(stack, nargs);
+ if (argstuple == NULL) {
+ return NULL;
+ }
+
+ if (nkwargs > 0) {
+ kwdict = _PyStack_AsDict(stack + nargs, kwnames);
+ if (kwdict == NULL) {
+ Py_DECREF(argstuple);
+ return NULL;
+ }
+ }
+ else {
+ kwdict = NULL;
+ }
+
+ if (Py_EnterRecursiveCall(" while calling a Python object")) {
+ Py_DECREF(argstuple);
+ Py_XDECREF(kwdict);
+ return NULL;
+ }
+
+ result = (*call)(callable, argstuple, kwdict);
+
+ Py_LeaveRecursiveCall();
+
+ Py_DECREF(argstuple);
+ Py_XDECREF(kwdict);
+
+ result = _Py_CheckFunctionResult(callable, result, NULL);
+ return result;
+ }
}
-static PyObject*
-call_function_tail(PyObject *callable, PyObject *args)
+static PyObject *
+_PyObject_CallFunctionVa(PyObject *callable, const char *format,
+ va_list va, int is_size_t)
{
+ PyObject* small_stack[_PY_FASTCALL_SMALL_STACK];
+ const Py_ssize_t small_stack_len = Py_ARRAY_LENGTH(small_stack);
+ PyObject **stack;
+ Py_ssize_t nargs, i;
PyObject *result;
- assert(args != NULL);
+ if (callable == NULL) {
+ return null_error();
+ }
+
+ if (!format || !*format) {
+ return _PyObject_CallNoArg(callable);
+ }
+
+ if (is_size_t) {
+ stack = _Py_VaBuildStack(small_stack, small_stack_len, format, va, &nargs);
+ }
+ else {
+ stack = _Py_VaBuildStack_SizeT(small_stack, small_stack_len, format, va, &nargs);
+ }
+ if (stack == NULL) {
+ return NULL;
+ }
- if (!PyTuple_Check(args)) {
- result = _PyObject_CallArg1(callable, args);
+ if (nargs == 1 && PyTuple_Check(stack[0])) {
+ /* Special cases for backward compatibility:
+ - PyObject_CallFunction(func, "O", tuple) calls func(*tuple)
+ - PyObject_CallFunction(func, "(OOO)", arg1, arg2, arg3) calls
+ func(*(arg1, arg2, arg3)): func(arg1, arg2, arg3) */
+ PyObject *args = stack[0];
+ result = _PyObject_FastCall(callable,
+ &PyTuple_GET_ITEM(args, 0),
+ PyTuple_GET_SIZE(args));
}
else {
- result = PyObject_Call(callable, args, NULL);
+ result = _PyObject_FastCall(callable, stack, nargs);
}
+ for (i = 0; i < nargs; ++i) {
+ Py_DECREF(stack[i]);
+ }
+ if (stack != small_stack) {
+ PyMem_Free(stack);
+ }
return result;
}
@@ -2503,25 +2617,12 @@ PyObject *
PyObject_CallFunction(PyObject *callable, const char *format, ...)
{
va_list va;
- PyObject *args, *result;
-
- if (callable == NULL) {
- return null_error();
- }
-
- if (!format || !*format) {
- return _PyObject_CallNoArg(callable);
- }
+ PyObject *result;
va_start(va, format);
- args = Py_VaBuildValue(format, va);
+ result = _PyObject_CallFunctionVa(callable, format, va, 0);
va_end(va);
- if (args == NULL) {
- return NULL;
- }
- result = call_function_tail(callable, args);
- Py_DECREF(args);
return result;
}
@@ -2529,289 +2630,227 @@ PyObject *
_PyObject_CallFunction_SizeT(PyObject *callable, const char *format, ...)
{
va_list va;
- PyObject *args, *result;
-
- if (callable == NULL) {
- return null_error();
- }
-
- if (!format || !*format) {
- return _PyObject_CallNoArg(callable);
- }
+ PyObject *result;
va_start(va, format);
- args = _Py_VaBuildValue_SizeT(format, va);
+ result = _PyObject_CallFunctionVa(callable, format, va, 1);
va_end(va);
- if (args == NULL) {
- return NULL;
- }
- result = call_function_tail(callable, args);
- Py_DECREF(args);
return result;
}
static PyObject*
-callmethod(PyObject* func, const char *format, va_list va, int is_size_t)
+callmethod(PyObject* callable, const char *format, va_list va, int is_size_t)
{
- PyObject *args, *result;
-
- assert(func != NULL);
-
- if (!PyCallable_Check(func)) {
- type_error("attribute of type '%.200s' is not callable", func);
- return NULL;
- }
-
- if (!format || !*format) {
- return _PyObject_CallNoArg(func);
- }
+ assert(callable != NULL);
- if (is_size_t) {
- args = _Py_VaBuildValue_SizeT(format, va);
- }
- else {
- args = Py_VaBuildValue(format, va);
- }
- if (args == NULL) {
+ if (!PyCallable_Check(callable)) {
+ type_error("attribute of type '%.200s' is not callable", callable);
return NULL;
}
- result = call_function_tail(func, args);
- Py_DECREF(args);
- return result;
+ return _PyObject_CallFunctionVa(callable, format, va, is_size_t);
}
PyObject *
-PyObject_CallMethod(PyObject *o, const char *name, const char *format, ...)
+PyObject_CallMethod(PyObject *obj, const char *name, const char *format, ...)
{
va_list va;
- PyObject *func = NULL;
- PyObject *retval = NULL;
+ PyObject *callable, *retval;
- if (o == NULL || name == NULL) {
+ if (obj == NULL || name == NULL) {
return null_error();
}
- func = PyObject_GetAttrString(o, name);
- if (func == NULL)
+ callable = PyObject_GetAttrString(obj, name);
+ if (callable == NULL)
return NULL;
va_start(va, format);
- retval = callmethod(func, format, va, 0);
+ retval = callmethod(callable, format, va, 0);
va_end(va);
- Py_DECREF(func);
+
+ Py_DECREF(callable);
return retval;
}
PyObject *
-_PyObject_CallMethodId(PyObject *o, _Py_Identifier *name,
+_PyObject_CallMethodId(PyObject *obj, _Py_Identifier *name,
const char *format, ...)
{
va_list va;
- PyObject *func = NULL;
- PyObject *retval = NULL;
+ PyObject *callable, *retval;
- if (o == NULL || name == NULL) {
+ if (obj == NULL || name == NULL) {
return null_error();
}
- func = _PyObject_GetAttrId(o, name);
- if (func == NULL)
+ callable = _PyObject_GetAttrId(obj, name);
+ if (callable == NULL)
return NULL;
va_start(va, format);
- retval = callmethod(func, format, va, 0);
+ retval = callmethod(callable, format, va, 0);
va_end(va);
- Py_DECREF(func);
+
+ Py_DECREF(callable);
return retval;
}
PyObject *
-_PyObject_CallMethod_SizeT(PyObject *o, const char *name,
+_PyObject_CallMethod_SizeT(PyObject *obj, const char *name,
const char *format, ...)
{
va_list va;
- PyObject *func = NULL;
- PyObject *retval;
+ PyObject *callable, *retval;
- if (o == NULL || name == NULL) {
+ if (obj == NULL || name == NULL) {
return null_error();
}
- func = PyObject_GetAttrString(o, name);
- if (func == NULL)
+ callable = PyObject_GetAttrString(obj, name);
+ if (callable == NULL)
return NULL;
+
va_start(va, format);
- retval = callmethod(func, format, va, 1);
+ retval = callmethod(callable, format, va, 1);
va_end(va);
- Py_DECREF(func);
+
+ Py_DECREF(callable);
return retval;
}
PyObject *
-_PyObject_CallMethodId_SizeT(PyObject *o, _Py_Identifier *name,
+_PyObject_CallMethodId_SizeT(PyObject *obj, _Py_Identifier *name,
const char *format, ...)
{
va_list va;
- PyObject *func = NULL;
- PyObject *retval;
+ PyObject *callable, *retval;
- if (o == NULL || name == NULL) {
+ if (obj == NULL || name == NULL) {
return null_error();
}
- func = _PyObject_GetAttrId(o, name);
- if (func == NULL) {
+ callable = _PyObject_GetAttrId(obj, name);
+ if (callable == NULL) {
return NULL;
}
+
va_start(va, format);
- retval = callmethod(func, format, va, 1);
+ retval = callmethod(callable, format, va, 1);
va_end(va);
- Py_DECREF(func);
+
+ Py_DECREF(callable);
return retval;
}
-static PyObject **
-objargs_mkstack(PyObject **small_stack, Py_ssize_t small_stack_size,
- va_list va, Py_ssize_t *p_nargs)
+static PyObject *
+object_vacall(PyObject *callable, va_list vargs)
{
- Py_ssize_t i, n;
- va_list countva;
+ PyObject *small_stack[_PY_FASTCALL_SMALL_STACK];
PyObject **stack;
+ Py_ssize_t nargs;
+ PyObject *result;
+ Py_ssize_t i;
+ va_list countva;
- /* Count the number of arguments */
- va_copy(countva, va);
+ if (callable == NULL) {
+ return null_error();
+ }
- n = 0;
+ /* Count the number of arguments */
+ va_copy(countva, vargs);
+ nargs = 0;
while (1) {
PyObject *arg = va_arg(countva, PyObject *);
if (arg == NULL) {
break;
}
- n++;
+ nargs++;
}
- *p_nargs = n;
+ va_end(countva);
/* Copy arguments */
- if (n <= small_stack_size) {
+ if (nargs <= (Py_ssize_t)Py_ARRAY_LENGTH(small_stack)) {
stack = small_stack;
}
else {
- stack = PyMem_Malloc(n * sizeof(stack[0]));
+ stack = PyMem_Malloc(nargs * sizeof(stack[0]));
if (stack == NULL) {
- va_end(countva);
PyErr_NoMemory();
return NULL;
}
}
- for (i = 0; i < n; ++i) {
- stack[i] = va_arg(va, PyObject *);
+ for (i = 0; i < nargs; ++i) {
+ stack[i] = va_arg(vargs, PyObject *);
}
- va_end(countva);
- return stack;
+
+ /* Call the function */
+ result = _PyObject_FastCall(callable, stack, nargs);
+
+ if (stack != small_stack) {
+ PyMem_Free(stack);
+ }
+ return result;
}
PyObject *
PyObject_CallMethodObjArgs(PyObject *callable, PyObject *name, ...)
{
- PyObject *small_stack[5];
- PyObject **stack;
- Py_ssize_t nargs;
- PyObject *result;
va_list vargs;
+ PyObject *result;
if (callable == NULL || name == NULL) {
return null_error();
}
callable = PyObject_GetAttr(callable, name);
- if (callable == NULL)
+ if (callable == NULL) {
return NULL;
+ }
- /* count the args */
va_start(vargs, name);
- stack = objargs_mkstack(small_stack, Py_ARRAY_LENGTH(small_stack),
- vargs, &nargs);
+ result = object_vacall(callable, vargs);
va_end(vargs);
- if (stack == NULL) {
- Py_DECREF(callable);
- return NULL;
- }
- result = _PyObject_FastCall(callable, stack, nargs);
Py_DECREF(callable);
- if (stack != small_stack) {
- PyMem_Free(stack);
- }
-
return result;
}
PyObject *
-_PyObject_CallMethodIdObjArgs(PyObject *callable,
- struct _Py_Identifier *name, ...)
+_PyObject_CallMethodIdObjArgs(PyObject *obj,
+ struct _Py_Identifier *name, ...)
{
- PyObject *small_stack[5];
- PyObject **stack;
- Py_ssize_t nargs;
- PyObject *result;
va_list vargs;
+ PyObject *callable, *result;
- if (callable == NULL || name == NULL) {
+ if (obj == NULL || name == NULL) {
return null_error();
}
- callable = _PyObject_GetAttrId(callable, name);
- if (callable == NULL)
+ callable = _PyObject_GetAttrId(obj, name);
+ if (callable == NULL) {
return NULL;
+ }
- /* count the args */
va_start(vargs, name);
- stack = objargs_mkstack(small_stack, Py_ARRAY_LENGTH(small_stack),
- vargs, &nargs);
+ result = object_vacall(callable, vargs);
va_end(vargs);
- if (stack == NULL) {
- Py_DECREF(callable);
- return NULL;
- }
- result = _PyObject_FastCall(callable, stack, nargs);
Py_DECREF(callable);
- if (stack != small_stack) {
- PyMem_Free(stack);
- }
-
return result;
}
PyObject *
PyObject_CallFunctionObjArgs(PyObject *callable, ...)
{
- PyObject *small_stack[5];
- PyObject **stack;
- Py_ssize_t nargs;
- PyObject *result;
va_list vargs;
+ PyObject *result;
- if (callable == NULL) {
- return null_error();
- }
-
- /* count the args */
va_start(vargs, callable);
- stack = objargs_mkstack(small_stack, Py_ARRAY_LENGTH(small_stack),
- vargs, &nargs);
+ result = object_vacall(callable, vargs);
va_end(vargs);
- if (stack == NULL) {
- return NULL;
- }
-
- result = _PyObject_FastCall(callable, stack, nargs);
- if (stack != small_stack) {
- PyMem_Free(stack);
- }
return result;
}
@@ -3111,7 +3150,8 @@ PyObject *
PyObject_GetIter(PyObject *o)
{
PyTypeObject *t = o->ob_type;
- getiterfunc f = NULL;
+ getiterfunc f;
+
f = t->tp_iter;
if (f == NULL) {
if (PySequence_Check(o))
diff --git a/Objects/bytearrayobject.c b/Objects/bytearrayobject.c
index a8d6980250..693da5cc28 100644
--- a/Objects/bytearrayobject.c
+++ b/Objects/bytearrayobject.c
@@ -2328,10 +2328,7 @@ bytearrayiter_reduce(bytesiterobject *it)
return Py_BuildValue("N(O)n", _PyObject_GetBuiltin("iter"),
it->it_seq, it->it_index);
} else {
- PyObject *u = PyUnicode_FromUnicode(NULL, 0);
- if (u == NULL)
- return NULL;
- return Py_BuildValue("N(N)", _PyObject_GetBuiltin("iter"), u);
+ return Py_BuildValue("N(())", _PyObject_GetBuiltin("iter"));
}
}
diff --git a/Objects/bytesobject.c b/Objects/bytesobject.c
index 5d48440960..a30ac0c379 100644
--- a/Objects/bytesobject.c
+++ b/Objects/bytesobject.c
@@ -549,7 +549,7 @@ format_obj(PyObject *v, const char **pbuf, Py_ssize_t *plen)
/* does it support __bytes__? */
func = _PyObject_LookupSpecial(v, &PyId___bytes__);
if (func != NULL) {
- result = PyObject_CallFunctionObjArgs(func, NULL);
+ result = _PyObject_CallNoArg(func);
Py_DECREF(func);
if (result == NULL)
return NULL;
@@ -2378,10 +2378,10 @@ _PyBytes_FromHex(PyObject *string, int use_bytearray)
end = str + hexlen;
while (str < end) {
/* skip over spaces in the input */
- if (*str == ' ') {
+ if (Py_ISSPACE(*str)) {
do {
str++;
- } while (*str == ' ');
+ } while (Py_ISSPACE(*str));
if (str >= end)
break;
}
@@ -2568,7 +2568,7 @@ bytes_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
PyObject_Bytes doesn't do. */
func = _PyObject_LookupSpecial(x, &PyId___bytes__);
if (func != NULL) {
- new = PyObject_CallFunctionObjArgs(func, NULL);
+ new = _PyObject_CallNoArg(func);
Py_DECREF(func);
if (new == NULL)
return NULL;
@@ -3051,10 +3051,7 @@ striter_reduce(striterobject *it)
return Py_BuildValue("N(O)n", _PyObject_GetBuiltin("iter"),
it->it_seq, it->it_index);
} else {
- PyObject *u = PyUnicode_FromUnicode(NULL, 0);
- if (u == NULL)
- return NULL;
- return Py_BuildValue("N(N)", _PyObject_GetBuiltin("iter"), u);
+ return Py_BuildValue("N(())", _PyObject_GetBuiltin("iter"));
}
}
diff --git a/Objects/clinic/bytearrayobject.c.h b/Objects/clinic/bytearrayobject.c.h
index c75acb75cf..a181d9a99b 100644
--- a/Objects/clinic/bytearrayobject.c.h
+++ b/Objects/clinic/bytearrayobject.c.h
@@ -66,7 +66,7 @@ bytearray_translate(PyByteArrayObject *self, PyObject **args, Py_ssize_t nargs,
PyObject *table;
PyObject *deletechars = NULL;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
&table, &deletechars)) {
goto exit;
}
@@ -88,22 +88,26 @@ PyDoc_STRVAR(bytearray_maketrans__doc__,
"The bytes objects frm and to must be of the same length.");
#define BYTEARRAY_MAKETRANS_METHODDEF \
- {"maketrans", (PyCFunction)bytearray_maketrans, METH_VARARGS|METH_STATIC, bytearray_maketrans__doc__},
+ {"maketrans", (PyCFunction)bytearray_maketrans, METH_FASTCALL|METH_STATIC, bytearray_maketrans__doc__},
static PyObject *
bytearray_maketrans_impl(Py_buffer *frm, Py_buffer *to);
static PyObject *
-bytearray_maketrans(void *null, PyObject *args)
+bytearray_maketrans(void *null, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
Py_buffer frm = {NULL, NULL};
Py_buffer to = {NULL, NULL};
- if (!PyArg_ParseTuple(args, "y*y*:maketrans",
+ if (!_PyArg_ParseStack(args, nargs, "y*y*:maketrans",
&frm, &to)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("maketrans", kwnames)) {
+ goto exit;
+ }
return_value = bytearray_maketrans_impl(&frm, &to);
exit:
@@ -133,24 +137,28 @@ PyDoc_STRVAR(bytearray_replace__doc__,
"replaced.");
#define BYTEARRAY_REPLACE_METHODDEF \
- {"replace", (PyCFunction)bytearray_replace, METH_VARARGS, bytearray_replace__doc__},
+ {"replace", (PyCFunction)bytearray_replace, METH_FASTCALL, bytearray_replace__doc__},
static PyObject *
bytearray_replace_impl(PyByteArrayObject *self, Py_buffer *old,
Py_buffer *new, Py_ssize_t count);
static PyObject *
-bytearray_replace(PyByteArrayObject *self, PyObject *args)
+bytearray_replace(PyByteArrayObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
Py_buffer old = {NULL, NULL};
Py_buffer new = {NULL, NULL};
Py_ssize_t count = -1;
- if (!PyArg_ParseTuple(args, "y*y*|n:replace",
+ if (!_PyArg_ParseStack(args, nargs, "y*y*|n:replace",
&old, &new, &count)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("replace", kwnames)) {
+ goto exit;
+ }
return_value = bytearray_replace_impl(self, &old, &new, count);
exit:
@@ -196,7 +204,7 @@ bytearray_split(PyByteArrayObject *self, PyObject **args, Py_ssize_t nargs, PyOb
PyObject *sep = Py_None;
Py_ssize_t maxsplit = -1;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
&sep, &maxsplit)) {
goto exit;
}
@@ -270,7 +278,7 @@ bytearray_rsplit(PyByteArrayObject *self, PyObject **args, Py_ssize_t nargs, PyO
PyObject *sep = Py_None;
Py_ssize_t maxsplit = -1;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
&sep, &maxsplit)) {
goto exit;
}
@@ -310,22 +318,26 @@ PyDoc_STRVAR(bytearray_insert__doc__,
" The item to be inserted.");
#define BYTEARRAY_INSERT_METHODDEF \
- {"insert", (PyCFunction)bytearray_insert, METH_VARARGS, bytearray_insert__doc__},
+ {"insert", (PyCFunction)bytearray_insert, METH_FASTCALL, bytearray_insert__doc__},
static PyObject *
bytearray_insert_impl(PyByteArrayObject *self, Py_ssize_t index, int item);
static PyObject *
-bytearray_insert(PyByteArrayObject *self, PyObject *args)
+bytearray_insert(PyByteArrayObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
Py_ssize_t index;
int item;
- if (!PyArg_ParseTuple(args, "nO&:insert",
+ if (!_PyArg_ParseStack(args, nargs, "nO&:insert",
&index, _getbytevalue, &item)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("insert", kwnames)) {
+ goto exit;
+ }
return_value = bytearray_insert_impl(self, index, item);
exit:
@@ -387,21 +399,25 @@ PyDoc_STRVAR(bytearray_pop__doc__,
"If no index argument is given, will pop the last item.");
#define BYTEARRAY_POP_METHODDEF \
- {"pop", (PyCFunction)bytearray_pop, METH_VARARGS, bytearray_pop__doc__},
+ {"pop", (PyCFunction)bytearray_pop, METH_FASTCALL, bytearray_pop__doc__},
static PyObject *
bytearray_pop_impl(PyByteArrayObject *self, Py_ssize_t index);
static PyObject *
-bytearray_pop(PyByteArrayObject *self, PyObject *args)
+bytearray_pop(PyByteArrayObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
Py_ssize_t index = -1;
- if (!PyArg_ParseTuple(args, "|n:pop",
+ if (!_PyArg_ParseStack(args, nargs, "|n:pop",
&index)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("pop", kwnames)) {
+ goto exit;
+ }
return_value = bytearray_pop_impl(self, index);
exit:
@@ -447,22 +463,26 @@ PyDoc_STRVAR(bytearray_strip__doc__,
"If the argument is omitted or None, strip leading and trailing ASCII whitespace.");
#define BYTEARRAY_STRIP_METHODDEF \
- {"strip", (PyCFunction)bytearray_strip, METH_VARARGS, bytearray_strip__doc__},
+ {"strip", (PyCFunction)bytearray_strip, METH_FASTCALL, bytearray_strip__doc__},
static PyObject *
bytearray_strip_impl(PyByteArrayObject *self, PyObject *bytes);
static PyObject *
-bytearray_strip(PyByteArrayObject *self, PyObject *args)
+bytearray_strip(PyByteArrayObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
PyObject *bytes = Py_None;
- if (!PyArg_UnpackTuple(args, "strip",
+ if (!_PyArg_UnpackStack(args, nargs, "strip",
0, 1,
&bytes)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("strip", kwnames)) {
+ goto exit;
+ }
return_value = bytearray_strip_impl(self, bytes);
exit:
@@ -478,22 +498,26 @@ PyDoc_STRVAR(bytearray_lstrip__doc__,
"If the argument is omitted or None, strip leading ASCII whitespace.");
#define BYTEARRAY_LSTRIP_METHODDEF \
- {"lstrip", (PyCFunction)bytearray_lstrip, METH_VARARGS, bytearray_lstrip__doc__},
+ {"lstrip", (PyCFunction)bytearray_lstrip, METH_FASTCALL, bytearray_lstrip__doc__},
static PyObject *
bytearray_lstrip_impl(PyByteArrayObject *self, PyObject *bytes);
static PyObject *
-bytearray_lstrip(PyByteArrayObject *self, PyObject *args)
+bytearray_lstrip(PyByteArrayObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
PyObject *bytes = Py_None;
- if (!PyArg_UnpackTuple(args, "lstrip",
+ if (!_PyArg_UnpackStack(args, nargs, "lstrip",
0, 1,
&bytes)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("lstrip", kwnames)) {
+ goto exit;
+ }
return_value = bytearray_lstrip_impl(self, bytes);
exit:
@@ -509,22 +533,26 @@ PyDoc_STRVAR(bytearray_rstrip__doc__,
"If the argument is omitted or None, strip trailing ASCII whitespace.");
#define BYTEARRAY_RSTRIP_METHODDEF \
- {"rstrip", (PyCFunction)bytearray_rstrip, METH_VARARGS, bytearray_rstrip__doc__},
+ {"rstrip", (PyCFunction)bytearray_rstrip, METH_FASTCALL, bytearray_rstrip__doc__},
static PyObject *
bytearray_rstrip_impl(PyByteArrayObject *self, PyObject *bytes);
static PyObject *
-bytearray_rstrip(PyByteArrayObject *self, PyObject *args)
+bytearray_rstrip(PyByteArrayObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
PyObject *bytes = Py_None;
- if (!PyArg_UnpackTuple(args, "rstrip",
+ if (!_PyArg_UnpackStack(args, nargs, "rstrip",
0, 1,
&bytes)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("rstrip", kwnames)) {
+ goto exit;
+ }
return_value = bytearray_rstrip_impl(self, bytes);
exit:
@@ -562,7 +590,7 @@ bytearray_decode(PyByteArrayObject *self, PyObject **args, Py_ssize_t nargs, PyO
const char *encoding = NULL;
const char *errors = NULL;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
&encoding, &errors)) {
goto exit;
}
@@ -608,7 +636,7 @@ bytearray_splitlines(PyByteArrayObject *self, PyObject **args, Py_ssize_t nargs,
static _PyArg_Parser _parser = {"|i:splitlines", _keywords, 0};
int keepends = 0;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
&keepends)) {
goto exit;
}
@@ -673,21 +701,25 @@ PyDoc_STRVAR(bytearray_reduce_ex__doc__,
"Return state information for pickling.");
#define BYTEARRAY_REDUCE_EX_METHODDEF \
- {"__reduce_ex__", (PyCFunction)bytearray_reduce_ex, METH_VARARGS, bytearray_reduce_ex__doc__},
+ {"__reduce_ex__", (PyCFunction)bytearray_reduce_ex, METH_FASTCALL, bytearray_reduce_ex__doc__},
static PyObject *
bytearray_reduce_ex_impl(PyByteArrayObject *self, int proto);
static PyObject *
-bytearray_reduce_ex(PyByteArrayObject *self, PyObject *args)
+bytearray_reduce_ex(PyByteArrayObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
int proto = 0;
- if (!PyArg_ParseTuple(args, "|i:__reduce_ex__",
+ if (!_PyArg_ParseStack(args, nargs, "|i:__reduce_ex__",
&proto)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("__reduce_ex__", kwnames)) {
+ goto exit;
+ }
return_value = bytearray_reduce_ex_impl(self, proto);
exit:
@@ -711,4 +743,4 @@ bytearray_sizeof(PyByteArrayObject *self, PyObject *Py_UNUSED(ignored))
{
return bytearray_sizeof_impl(self);
}
-/*[clinic end generated code: output=225342a680391b9c input=a9049054013a1b77]*/
+/*[clinic end generated code: output=f5c364927425fae8 input=a9049054013a1b77]*/
diff --git a/Objects/clinic/bytesobject.c.h b/Objects/clinic/bytesobject.c.h
index a11ebd2774..c73b56023d 100644
--- a/Objects/clinic/bytesobject.c.h
+++ b/Objects/clinic/bytesobject.c.h
@@ -31,7 +31,7 @@ bytes_split(PyBytesObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kw
PyObject *sep = Py_None;
Py_ssize_t maxsplit = -1;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
&sep, &maxsplit)) {
goto exit;
}
@@ -150,7 +150,7 @@ bytes_rsplit(PyBytesObject *self, PyObject **args, Py_ssize_t nargs, PyObject *k
PyObject *sep = Py_None;
Py_ssize_t maxsplit = -1;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
&sep, &maxsplit)) {
goto exit;
}
@@ -184,22 +184,26 @@ PyDoc_STRVAR(bytes_strip__doc__,
"If the argument is omitted or None, strip leading and trailing ASCII whitespace.");
#define BYTES_STRIP_METHODDEF \
- {"strip", (PyCFunction)bytes_strip, METH_VARARGS, bytes_strip__doc__},
+ {"strip", (PyCFunction)bytes_strip, METH_FASTCALL, bytes_strip__doc__},
static PyObject *
bytes_strip_impl(PyBytesObject *self, PyObject *bytes);
static PyObject *
-bytes_strip(PyBytesObject *self, PyObject *args)
+bytes_strip(PyBytesObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
PyObject *bytes = Py_None;
- if (!PyArg_UnpackTuple(args, "strip",
+ if (!_PyArg_UnpackStack(args, nargs, "strip",
0, 1,
&bytes)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("strip", kwnames)) {
+ goto exit;
+ }
return_value = bytes_strip_impl(self, bytes);
exit:
@@ -215,22 +219,26 @@ PyDoc_STRVAR(bytes_lstrip__doc__,
"If the argument is omitted or None, strip leading ASCII whitespace.");
#define BYTES_LSTRIP_METHODDEF \
- {"lstrip", (PyCFunction)bytes_lstrip, METH_VARARGS, bytes_lstrip__doc__},
+ {"lstrip", (PyCFunction)bytes_lstrip, METH_FASTCALL, bytes_lstrip__doc__},
static PyObject *
bytes_lstrip_impl(PyBytesObject *self, PyObject *bytes);
static PyObject *
-bytes_lstrip(PyBytesObject *self, PyObject *args)
+bytes_lstrip(PyBytesObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
PyObject *bytes = Py_None;
- if (!PyArg_UnpackTuple(args, "lstrip",
+ if (!_PyArg_UnpackStack(args, nargs, "lstrip",
0, 1,
&bytes)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("lstrip", kwnames)) {
+ goto exit;
+ }
return_value = bytes_lstrip_impl(self, bytes);
exit:
@@ -246,22 +254,26 @@ PyDoc_STRVAR(bytes_rstrip__doc__,
"If the argument is omitted or None, strip trailing ASCII whitespace.");
#define BYTES_RSTRIP_METHODDEF \
- {"rstrip", (PyCFunction)bytes_rstrip, METH_VARARGS, bytes_rstrip__doc__},
+ {"rstrip", (PyCFunction)bytes_rstrip, METH_FASTCALL, bytes_rstrip__doc__},
static PyObject *
bytes_rstrip_impl(PyBytesObject *self, PyObject *bytes);
static PyObject *
-bytes_rstrip(PyBytesObject *self, PyObject *args)
+bytes_rstrip(PyBytesObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
PyObject *bytes = Py_None;
- if (!PyArg_UnpackTuple(args, "rstrip",
+ if (!_PyArg_UnpackStack(args, nargs, "rstrip",
0, 1,
&bytes)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("rstrip", kwnames)) {
+ goto exit;
+ }
return_value = bytes_rstrip_impl(self, bytes);
exit:
@@ -296,7 +308,7 @@ bytes_translate(PyBytesObject *self, PyObject **args, Py_ssize_t nargs, PyObject
PyObject *table;
PyObject *deletechars = NULL;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
&table, &deletechars)) {
goto exit;
}
@@ -318,22 +330,26 @@ PyDoc_STRVAR(bytes_maketrans__doc__,
"The bytes objects frm and to must be of the same length.");
#define BYTES_MAKETRANS_METHODDEF \
- {"maketrans", (PyCFunction)bytes_maketrans, METH_VARARGS|METH_STATIC, bytes_maketrans__doc__},
+ {"maketrans", (PyCFunction)bytes_maketrans, METH_FASTCALL|METH_STATIC, bytes_maketrans__doc__},
static PyObject *
bytes_maketrans_impl(Py_buffer *frm, Py_buffer *to);
static PyObject *
-bytes_maketrans(void *null, PyObject *args)
+bytes_maketrans(void *null, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
Py_buffer frm = {NULL, NULL};
Py_buffer to = {NULL, NULL};
- if (!PyArg_ParseTuple(args, "y*y*:maketrans",
+ if (!_PyArg_ParseStack(args, nargs, "y*y*:maketrans",
&frm, &to)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("maketrans", kwnames)) {
+ goto exit;
+ }
return_value = bytes_maketrans_impl(&frm, &to);
exit:
@@ -363,24 +379,28 @@ PyDoc_STRVAR(bytes_replace__doc__,
"replaced.");
#define BYTES_REPLACE_METHODDEF \
- {"replace", (PyCFunction)bytes_replace, METH_VARARGS, bytes_replace__doc__},
+ {"replace", (PyCFunction)bytes_replace, METH_FASTCALL, bytes_replace__doc__},
static PyObject *
bytes_replace_impl(PyBytesObject *self, Py_buffer *old, Py_buffer *new,
Py_ssize_t count);
static PyObject *
-bytes_replace(PyBytesObject *self, PyObject *args)
+bytes_replace(PyBytesObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
Py_buffer old = {NULL, NULL};
Py_buffer new = {NULL, NULL};
Py_ssize_t count = -1;
- if (!PyArg_ParseTuple(args, "y*y*|n:replace",
+ if (!_PyArg_ParseStack(args, nargs, "y*y*|n:replace",
&old, &new, &count)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("replace", kwnames)) {
+ goto exit;
+ }
return_value = bytes_replace_impl(self, &old, &new, count);
exit:
@@ -427,7 +447,7 @@ bytes_decode(PyBytesObject *self, PyObject **args, Py_ssize_t nargs, PyObject *k
const char *encoding = NULL;
const char *errors = NULL;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
&encoding, &errors)) {
goto exit;
}
@@ -460,7 +480,7 @@ bytes_splitlines(PyBytesObject *self, PyObject **args, Py_ssize_t nargs, PyObjec
static _PyArg_Parser _parser = {"|i:splitlines", _keywords, 0};
int keepends = 0;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
&keepends)) {
goto exit;
}
@@ -499,4 +519,4 @@ bytes_fromhex(PyTypeObject *type, PyObject *arg)
exit:
return return_value;
}
-/*[clinic end generated code: output=2dc3c93cfd2dc440 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=2504c1225108d348 input=a9049054013a1b77]*/
diff --git a/Objects/clinic/dictobject.c.h b/Objects/clinic/dictobject.c.h
index d0cdfc3eda..fb1e797de1 100644
--- a/Objects/clinic/dictobject.c.h
+++ b/Objects/clinic/dictobject.c.h
@@ -6,26 +6,30 @@ PyDoc_STRVAR(dict_fromkeys__doc__,
"fromkeys($type, iterable, value=None, /)\n"
"--\n"
"\n"
-"Returns a new dict with keys from iterable and values equal to value.");
+"Create a new dictionary with keys from iterable and values set to value.");
#define DICT_FROMKEYS_METHODDEF \
- {"fromkeys", (PyCFunction)dict_fromkeys, METH_VARARGS|METH_CLASS, dict_fromkeys__doc__},
+ {"fromkeys", (PyCFunction)dict_fromkeys, METH_FASTCALL|METH_CLASS, dict_fromkeys__doc__},
static PyObject *
dict_fromkeys_impl(PyTypeObject *type, PyObject *iterable, PyObject *value);
static PyObject *
-dict_fromkeys(PyTypeObject *type, PyObject *args)
+dict_fromkeys(PyTypeObject *type, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
PyObject *iterable;
PyObject *value = Py_None;
- if (!PyArg_UnpackTuple(args, "fromkeys",
+ if (!_PyArg_UnpackStack(args, nargs, "fromkeys",
1, 2,
&iterable, &value)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("fromkeys", kwnames)) {
+ goto exit;
+ }
return_value = dict_fromkeys_impl(type, iterable, value);
exit:
@@ -36,8 +40,79 @@ PyDoc_STRVAR(dict___contains____doc__,
"__contains__($self, key, /)\n"
"--\n"
"\n"
-"True if D has a key k, else False.");
+"True if the dictionary has the specified key, else False.");
#define DICT___CONTAINS___METHODDEF \
{"__contains__", (PyCFunction)dict___contains__, METH_O|METH_COEXIST, dict___contains____doc__},
-/*[clinic end generated code: output=926326109e3d9839 input=a9049054013a1b77]*/
+
+PyDoc_STRVAR(dict_get__doc__,
+"get($self, key, default=None, /)\n"
+"--\n"
+"\n"
+"Return the value for key if key is in the dictionary, else default.");
+
+#define DICT_GET_METHODDEF \
+ {"get", (PyCFunction)dict_get, METH_FASTCALL, dict_get__doc__},
+
+static PyObject *
+dict_get_impl(PyDictObject *self, PyObject *key, PyObject *default_value);
+
+static PyObject *
+dict_get(PyDictObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ PyObject *key;
+ PyObject *default_value = Py_None;
+
+ if (!_PyArg_UnpackStack(args, nargs, "get",
+ 1, 2,
+ &key, &default_value)) {
+ goto exit;
+ }
+
+ if (!_PyArg_NoStackKeywords("get", kwnames)) {
+ goto exit;
+ }
+ return_value = dict_get_impl(self, key, default_value);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(dict_setdefault__doc__,
+"setdefault($self, key, default=None, /)\n"
+"--\n"
+"\n"
+"Insert key with a value of default if key is not in the dictionary.\n"
+"\n"
+"Return the value for key if key is in the dictionary, else default.");
+
+#define DICT_SETDEFAULT_METHODDEF \
+ {"setdefault", (PyCFunction)dict_setdefault, METH_FASTCALL, dict_setdefault__doc__},
+
+static PyObject *
+dict_setdefault_impl(PyDictObject *self, PyObject *key,
+ PyObject *default_value);
+
+static PyObject *
+dict_setdefault(PyDictObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ PyObject *key;
+ PyObject *default_value = Py_None;
+
+ if (!_PyArg_UnpackStack(args, nargs, "setdefault",
+ 1, 2,
+ &key, &default_value)) {
+ goto exit;
+ }
+
+ if (!_PyArg_NoStackKeywords("setdefault", kwnames)) {
+ goto exit;
+ }
+ return_value = dict_setdefault_impl(self, key, default_value);
+
+exit:
+ return return_value;
+}
+/*[clinic end generated code: output=4d57df133cf66e53 input=a9049054013a1b77]*/
diff --git a/Objects/clinic/enumobject.c.h b/Objects/clinic/enumobject.c.h
new file mode 100644
index 0000000000..0f05cf84cb
--- /dev/null
+++ b/Objects/clinic/enumobject.c.h
@@ -0,0 +1,71 @@
+/*[clinic input]
+preserve
+[clinic start generated code]*/
+
+PyDoc_STRVAR(enum_new__doc__,
+"enumerate(iterable, start=0)\n"
+"--\n"
+"\n"
+"Return an enumerate object.\n"
+"\n"
+" iterable\n"
+" an object supporting iteration\n"
+"\n"
+"The enumerate object yields pairs containing a count (from start, which\n"
+"defaults to zero) and a value yielded by the iterable argument.\n"
+"\n"
+"enumerate is useful for obtaining an indexed list:\n"
+" (0, seq[0]), (1, seq[1]), (2, seq[2]), ...");
+
+static PyObject *
+enum_new_impl(PyTypeObject *type, PyObject *iterable, PyObject *start);
+
+static PyObject *
+enum_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
+{
+ PyObject *return_value = NULL;
+ static const char * const _keywords[] = {"iterable", "start", NULL};
+ static _PyArg_Parser _parser = {"O|O:enumerate", _keywords, 0};
+ PyObject *iterable;
+ PyObject *start = 0;
+
+ if (!_PyArg_ParseTupleAndKeywordsFast(args, kwargs, &_parser,
+ &iterable, &start)) {
+ goto exit;
+ }
+ return_value = enum_new_impl(type, iterable, start);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(reversed_new__doc__,
+"reversed(sequence, /)\n"
+"--\n"
+"\n"
+"Return a reverse iterator over the values of the given sequence.");
+
+static PyObject *
+reversed_new_impl(PyTypeObject *type, PyObject *seq);
+
+static PyObject *
+reversed_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
+{
+ PyObject *return_value = NULL;
+ PyObject *seq;
+
+ if ((type == &PyReversed_Type) &&
+ !_PyArg_NoKeywords("reversed", kwargs)) {
+ goto exit;
+ }
+ if (!PyArg_UnpackTuple(args, "reversed",
+ 1, 1,
+ &seq)) {
+ goto exit;
+ }
+ return_value = reversed_new_impl(type, seq);
+
+exit:
+ return return_value;
+}
+/*[clinic end generated code: output=9008c36999c57218 input=a9049054013a1b77]*/
diff --git a/Objects/clinic/longobject.c.h b/Objects/clinic/longobject.c.h
new file mode 100644
index 0000000000..6a7b7debd2
--- /dev/null
+++ b/Objects/clinic/longobject.c.h
@@ -0,0 +1,192 @@
+/*[clinic input]
+preserve
+[clinic start generated code]*/
+
+PyDoc_STRVAR(int___getnewargs____doc__,
+"__getnewargs__($self, /)\n"
+"--\n"
+"\n");
+
+#define INT___GETNEWARGS___METHODDEF \
+ {"__getnewargs__", (PyCFunction)int___getnewargs__, METH_NOARGS, int___getnewargs____doc__},
+
+static PyObject *
+int___getnewargs___impl(PyObject *self);
+
+static PyObject *
+int___getnewargs__(PyObject *self, PyObject *Py_UNUSED(ignored))
+{
+ return int___getnewargs___impl(self);
+}
+
+PyDoc_STRVAR(int___format____doc__,
+"__format__($self, format_spec, /)\n"
+"--\n"
+"\n");
+
+#define INT___FORMAT___METHODDEF \
+ {"__format__", (PyCFunction)int___format__, METH_O, int___format____doc__},
+
+static PyObject *
+int___format___impl(PyObject *self, PyObject *format_spec);
+
+static PyObject *
+int___format__(PyObject *self, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ PyObject *format_spec;
+
+ if (!PyArg_Parse(arg, "U:__format__", &format_spec)) {
+ goto exit;
+ }
+ return_value = int___format___impl(self, format_spec);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(int___sizeof____doc__,
+"__sizeof__($self, /)\n"
+"--\n"
+"\n"
+"Returns size in memory, in bytes.");
+
+#define INT___SIZEOF___METHODDEF \
+ {"__sizeof__", (PyCFunction)int___sizeof__, METH_NOARGS, int___sizeof____doc__},
+
+static Py_ssize_t
+int___sizeof___impl(PyObject *self);
+
+static PyObject *
+int___sizeof__(PyObject *self, PyObject *Py_UNUSED(ignored))
+{
+ PyObject *return_value = NULL;
+ Py_ssize_t _return_value;
+
+ _return_value = int___sizeof___impl(self);
+ if ((_return_value == -1) && PyErr_Occurred()) {
+ goto exit;
+ }
+ return_value = PyLong_FromSsize_t(_return_value);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(int_bit_length__doc__,
+"bit_length($self, /)\n"
+"--\n"
+"\n"
+"Number of bits necessary to represent self in binary.\n"
+"\n"
+">>> bin(37)\n"
+"\'0b100101\'\n"
+">>> (37).bit_length()\n"
+"6");
+
+#define INT_BIT_LENGTH_METHODDEF \
+ {"bit_length", (PyCFunction)int_bit_length, METH_NOARGS, int_bit_length__doc__},
+
+static PyObject *
+int_bit_length_impl(PyObject *self);
+
+static PyObject *
+int_bit_length(PyObject *self, PyObject *Py_UNUSED(ignored))
+{
+ return int_bit_length_impl(self);
+}
+
+PyDoc_STRVAR(int_to_bytes__doc__,
+"to_bytes($self, /, length, byteorder, *, signed=False)\n"
+"--\n"
+"\n"
+"Return an array of bytes representing an integer.\n"
+"\n"
+" length\n"
+" Length of bytes object to use. An OverflowError is raised if the\n"
+" integer is not representable with the given number of bytes.\n"
+" byteorder\n"
+" The byte order used to represent the integer. If byteorder is \'big\',\n"
+" the most significant byte is at the beginning of the byte array. If\n"
+" byteorder is \'little\', the most significant byte is at the end of the\n"
+" byte array. To request the native byte order of the host system, use\n"
+" `sys.byteorder\' as the byte order value.\n"
+" signed\n"
+" Determines whether two\'s complement is used to represent the integer.\n"
+" If signed is False and a negative integer is given, an OverflowError\n"
+" is raised.");
+
+#define INT_TO_BYTES_METHODDEF \
+ {"to_bytes", (PyCFunction)int_to_bytes, METH_FASTCALL, int_to_bytes__doc__},
+
+static PyObject *
+int_to_bytes_impl(PyObject *self, Py_ssize_t length, PyObject *byteorder,
+ int is_signed);
+
+static PyObject *
+int_to_bytes(PyObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ static const char * const _keywords[] = {"length", "byteorder", "signed", NULL};
+ static _PyArg_Parser _parser = {"nU|$p:to_bytes", _keywords, 0};
+ Py_ssize_t length;
+ PyObject *byteorder;
+ int is_signed = 0;
+
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
+ &length, &byteorder, &is_signed)) {
+ goto exit;
+ }
+ return_value = int_to_bytes_impl(self, length, byteorder, is_signed);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(int_from_bytes__doc__,
+"from_bytes($type, /, bytes, byteorder, *, signed=False)\n"
+"--\n"
+"\n"
+"Return the integer represented by the given array of bytes.\n"
+"\n"
+" bytes\n"
+" Holds the array of bytes to convert. The argument must either\n"
+" support the buffer protocol or be an iterable object producing bytes.\n"
+" Bytes and bytearray are examples of built-in objects that support the\n"
+" buffer protocol.\n"
+" byteorder\n"
+" The byte order used to represent the integer. If byteorder is \'big\',\n"
+" the most significant byte is at the beginning of the byte array. If\n"
+" byteorder is \'little\', the most significant byte is at the end of the\n"
+" byte array. To request the native byte order of the host system, use\n"
+" `sys.byteorder\' as the byte order value.\n"
+" signed\n"
+" Indicates whether two\'s complement is used to represent the integer.");
+
+#define INT_FROM_BYTES_METHODDEF \
+ {"from_bytes", (PyCFunction)int_from_bytes, METH_FASTCALL|METH_CLASS, int_from_bytes__doc__},
+
+static PyObject *
+int_from_bytes_impl(PyTypeObject *type, PyObject *bytes_obj,
+ PyObject *byteorder, int is_signed);
+
+static PyObject *
+int_from_bytes(PyTypeObject *type, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ static const char * const _keywords[] = {"bytes", "byteorder", "signed", NULL};
+ static _PyArg_Parser _parser = {"OU|$p:from_bytes", _keywords, 0};
+ PyObject *bytes_obj;
+ PyObject *byteorder;
+ int is_signed = 0;
+
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
+ &bytes_obj, &byteorder, &is_signed)) {
+ goto exit;
+ }
+ return_value = int_from_bytes_impl(type, bytes_obj, byteorder, is_signed);
+
+exit:
+ return return_value;
+}
+/*[clinic end generated code: output=a9bae2fd016e7b85 input=a9049054013a1b77]*/
diff --git a/Objects/clinic/odictobject.c.h b/Objects/clinic/odictobject.c.h
new file mode 100644
index 0000000000..0e5092cf7a
--- /dev/null
+++ b/Objects/clinic/odictobject.c.h
@@ -0,0 +1,134 @@
+/*[clinic input]
+preserve
+[clinic start generated code]*/
+
+PyDoc_STRVAR(OrderedDict_fromkeys__doc__,
+"fromkeys($type, /, iterable, value=None)\n"
+"--\n"
+"\n"
+"Create a new ordered dictionary with keys from iterable and values set to value.");
+
+#define ORDEREDDICT_FROMKEYS_METHODDEF \
+ {"fromkeys", (PyCFunction)OrderedDict_fromkeys, METH_FASTCALL|METH_CLASS, OrderedDict_fromkeys__doc__},
+
+static PyObject *
+OrderedDict_fromkeys_impl(PyTypeObject *type, PyObject *seq, PyObject *value);
+
+static PyObject *
+OrderedDict_fromkeys(PyTypeObject *type, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ static const char * const _keywords[] = {"iterable", "value", NULL};
+ static _PyArg_Parser _parser = {"O|O:fromkeys", _keywords, 0};
+ PyObject *seq;
+ PyObject *value = Py_None;
+
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
+ &seq, &value)) {
+ goto exit;
+ }
+ return_value = OrderedDict_fromkeys_impl(type, seq, value);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(OrderedDict_setdefault__doc__,
+"setdefault($self, /, key, default=None)\n"
+"--\n"
+"\n"
+"Insert key with a value of default if key is not in the dictionary.\n"
+"\n"
+"Return the value for key if key is in the dictionary, else default.");
+
+#define ORDEREDDICT_SETDEFAULT_METHODDEF \
+ {"setdefault", (PyCFunction)OrderedDict_setdefault, METH_FASTCALL, OrderedDict_setdefault__doc__},
+
+static PyObject *
+OrderedDict_setdefault_impl(PyODictObject *self, PyObject *key,
+ PyObject *default_value);
+
+static PyObject *
+OrderedDict_setdefault(PyODictObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ static const char * const _keywords[] = {"key", "default", NULL};
+ static _PyArg_Parser _parser = {"O|O:setdefault", _keywords, 0};
+ PyObject *key;
+ PyObject *default_value = Py_None;
+
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
+ &key, &default_value)) {
+ goto exit;
+ }
+ return_value = OrderedDict_setdefault_impl(self, key, default_value);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(OrderedDict_popitem__doc__,
+"popitem($self, /, last=True)\n"
+"--\n"
+"\n"
+"Remove and return a (key, value) pair from the dictionary.\n"
+"\n"
+"Pairs are returned in LIFO order if last is true or FIFO order if false.");
+
+#define ORDEREDDICT_POPITEM_METHODDEF \
+ {"popitem", (PyCFunction)OrderedDict_popitem, METH_FASTCALL, OrderedDict_popitem__doc__},
+
+static PyObject *
+OrderedDict_popitem_impl(PyODictObject *self, int last);
+
+static PyObject *
+OrderedDict_popitem(PyODictObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ static const char * const _keywords[] = {"last", NULL};
+ static _PyArg_Parser _parser = {"|p:popitem", _keywords, 0};
+ int last = 1;
+
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
+ &last)) {
+ goto exit;
+ }
+ return_value = OrderedDict_popitem_impl(self, last);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(OrderedDict_move_to_end__doc__,
+"move_to_end($self, /, key, last=True)\n"
+"--\n"
+"\n"
+"Move an existing element to the end (or beginning if last is false).\n"
+"\n"
+"Raise KeyError if the element does not exist.");
+
+#define ORDEREDDICT_MOVE_TO_END_METHODDEF \
+ {"move_to_end", (PyCFunction)OrderedDict_move_to_end, METH_FASTCALL, OrderedDict_move_to_end__doc__},
+
+static PyObject *
+OrderedDict_move_to_end_impl(PyODictObject *self, PyObject *key, int last);
+
+static PyObject *
+OrderedDict_move_to_end(PyODictObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ static const char * const _keywords[] = {"key", "last", NULL};
+ static _PyArg_Parser _parser = {"O|p:move_to_end", _keywords, 0};
+ PyObject *key;
+ int last = 1;
+
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
+ &key, &last)) {
+ goto exit;
+ }
+ return_value = OrderedDict_move_to_end_impl(self, key, last);
+
+exit:
+ return return_value;
+}
+/*[clinic end generated code: output=a19a24ac37b42e5e input=a9049054013a1b77]*/
diff --git a/Objects/clinic/unicodeobject.c.h b/Objects/clinic/unicodeobject.c.h
index 891e90c312..509405e527 100644
--- a/Objects/clinic/unicodeobject.c.h
+++ b/Objects/clinic/unicodeobject.c.h
@@ -2,6 +2,816 @@
preserve
[clinic start generated code]*/
+PyDoc_STRVAR(unicode_title__doc__,
+"title($self, /)\n"
+"--\n"
+"\n"
+"Return a version of the string where each word is titlecased.\n"
+"\n"
+"More specifically, words start with uppercased characters and all remaining\n"
+"cased characters have lower case.");
+
+#define UNICODE_TITLE_METHODDEF \
+ {"title", (PyCFunction)unicode_title, METH_NOARGS, unicode_title__doc__},
+
+static PyObject *
+unicode_title_impl(PyObject *self);
+
+static PyObject *
+unicode_title(PyObject *self, PyObject *Py_UNUSED(ignored))
+{
+ return unicode_title_impl(self);
+}
+
+PyDoc_STRVAR(unicode_capitalize__doc__,
+"capitalize($self, /)\n"
+"--\n"
+"\n"
+"Return a capitalized version of the string.\n"
+"\n"
+"More specifically, make the first character have upper case and the rest lower\n"
+"case.");
+
+#define UNICODE_CAPITALIZE_METHODDEF \
+ {"capitalize", (PyCFunction)unicode_capitalize, METH_NOARGS, unicode_capitalize__doc__},
+
+static PyObject *
+unicode_capitalize_impl(PyObject *self);
+
+static PyObject *
+unicode_capitalize(PyObject *self, PyObject *Py_UNUSED(ignored))
+{
+ return unicode_capitalize_impl(self);
+}
+
+PyDoc_STRVAR(unicode_casefold__doc__,
+"casefold($self, /)\n"
+"--\n"
+"\n"
+"Return a version of the string suitable for caseless comparisons.");
+
+#define UNICODE_CASEFOLD_METHODDEF \
+ {"casefold", (PyCFunction)unicode_casefold, METH_NOARGS, unicode_casefold__doc__},
+
+static PyObject *
+unicode_casefold_impl(PyObject *self);
+
+static PyObject *
+unicode_casefold(PyObject *self, PyObject *Py_UNUSED(ignored))
+{
+ return unicode_casefold_impl(self);
+}
+
+PyDoc_STRVAR(unicode_center__doc__,
+"center($self, width, fillchar=\' \', /)\n"
+"--\n"
+"\n"
+"Return a centered string of length width.\n"
+"\n"
+"Padding is done using the specified fill character (default is a space).");
+
+#define UNICODE_CENTER_METHODDEF \
+ {"center", (PyCFunction)unicode_center, METH_FASTCALL, unicode_center__doc__},
+
+static PyObject *
+unicode_center_impl(PyObject *self, Py_ssize_t width, Py_UCS4 fillchar);
+
+static PyObject *
+unicode_center(PyObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ Py_ssize_t width;
+ Py_UCS4 fillchar = ' ';
+
+ if (!_PyArg_ParseStack(args, nargs, "n|O&:center",
+ &width, convert_uc, &fillchar)) {
+ goto exit;
+ }
+
+ if (!_PyArg_NoStackKeywords("center", kwnames)) {
+ goto exit;
+ }
+ return_value = unicode_center_impl(self, width, fillchar);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(unicode_encode__doc__,
+"encode($self, /, encoding=\'utf-8\', errors=\'strict\')\n"
+"--\n"
+"\n"
+"Encode the string using the codec registered for encoding.\n"
+"\n"
+" encoding\n"
+" The encoding in which to encode the string.\n"
+" errors\n"
+" The error handling scheme to use for encoding errors.\n"
+" The default is \'strict\' meaning that encoding errors raise a\n"
+" UnicodeEncodeError. Other possible values are \'ignore\', \'replace\' and\n"
+" \'xmlcharrefreplace\' as well as any other name registered with\n"
+" codecs.register_error that can handle UnicodeEncodeErrors.");
+
+#define UNICODE_ENCODE_METHODDEF \
+ {"encode", (PyCFunction)unicode_encode, METH_FASTCALL, unicode_encode__doc__},
+
+static PyObject *
+unicode_encode_impl(PyObject *self, const char *encoding, const char *errors);
+
+static PyObject *
+unicode_encode(PyObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ static const char * const _keywords[] = {"encoding", "errors", NULL};
+ static _PyArg_Parser _parser = {"|ss:encode", _keywords, 0};
+ const char *encoding = NULL;
+ const char *errors = NULL;
+
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
+ &encoding, &errors)) {
+ goto exit;
+ }
+ return_value = unicode_encode_impl(self, encoding, errors);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(unicode_expandtabs__doc__,
+"expandtabs($self, /, tabsize=8)\n"
+"--\n"
+"\n"
+"Return a copy where all tab characters are expanded using spaces.\n"
+"\n"
+"If tabsize is not given, a tab size of 8 characters is assumed.");
+
+#define UNICODE_EXPANDTABS_METHODDEF \
+ {"expandtabs", (PyCFunction)unicode_expandtabs, METH_FASTCALL, unicode_expandtabs__doc__},
+
+static PyObject *
+unicode_expandtabs_impl(PyObject *self, int tabsize);
+
+static PyObject *
+unicode_expandtabs(PyObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ static const char * const _keywords[] = {"tabsize", NULL};
+ static _PyArg_Parser _parser = {"|i:expandtabs", _keywords, 0};
+ int tabsize = 8;
+
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
+ &tabsize)) {
+ goto exit;
+ }
+ return_value = unicode_expandtabs_impl(self, tabsize);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(unicode_islower__doc__,
+"islower($self, /)\n"
+"--\n"
+"\n"
+"Return True if the string is a lowercase string, False otherwise.\n"
+"\n"
+"A string is lowercase if all cased characters in the string are lowercase and\n"
+"there is at least one cased character in the string.");
+
+#define UNICODE_ISLOWER_METHODDEF \
+ {"islower", (PyCFunction)unicode_islower, METH_NOARGS, unicode_islower__doc__},
+
+static PyObject *
+unicode_islower_impl(PyObject *self);
+
+static PyObject *
+unicode_islower(PyObject *self, PyObject *Py_UNUSED(ignored))
+{
+ return unicode_islower_impl(self);
+}
+
+PyDoc_STRVAR(unicode_isupper__doc__,
+"isupper($self, /)\n"
+"--\n"
+"\n"
+"Return True if the string is an uppercase string, False otherwise.\n"
+"\n"
+"A string is uppercase if all cased characters in the string are uppercase and\n"
+"there is at least one cased character in the string.");
+
+#define UNICODE_ISUPPER_METHODDEF \
+ {"isupper", (PyCFunction)unicode_isupper, METH_NOARGS, unicode_isupper__doc__},
+
+static PyObject *
+unicode_isupper_impl(PyObject *self);
+
+static PyObject *
+unicode_isupper(PyObject *self, PyObject *Py_UNUSED(ignored))
+{
+ return unicode_isupper_impl(self);
+}
+
+PyDoc_STRVAR(unicode_istitle__doc__,
+"istitle($self, /)\n"
+"--\n"
+"\n"
+"Return True if the string is a title-cased string, False otherwise.\n"
+"\n"
+"In a title-cased string, upper- and title-case characters may only\n"
+"follow uncased characters and lowercase characters only cased ones.");
+
+#define UNICODE_ISTITLE_METHODDEF \
+ {"istitle", (PyCFunction)unicode_istitle, METH_NOARGS, unicode_istitle__doc__},
+
+static PyObject *
+unicode_istitle_impl(PyObject *self);
+
+static PyObject *
+unicode_istitle(PyObject *self, PyObject *Py_UNUSED(ignored))
+{
+ return unicode_istitle_impl(self);
+}
+
+PyDoc_STRVAR(unicode_isspace__doc__,
+"isspace($self, /)\n"
+"--\n"
+"\n"
+"Return True if the string is a whitespace string, False otherwise.\n"
+"\n"
+"A string is whitespace if all characters in the string are whitespace and there\n"
+"is at least one character in the string.");
+
+#define UNICODE_ISSPACE_METHODDEF \
+ {"isspace", (PyCFunction)unicode_isspace, METH_NOARGS, unicode_isspace__doc__},
+
+static PyObject *
+unicode_isspace_impl(PyObject *self);
+
+static PyObject *
+unicode_isspace(PyObject *self, PyObject *Py_UNUSED(ignored))
+{
+ return unicode_isspace_impl(self);
+}
+
+PyDoc_STRVAR(unicode_isalpha__doc__,
+"isalpha($self, /)\n"
+"--\n"
+"\n"
+"Return True if the string is an alphabetic string, False otherwise.\n"
+"\n"
+"A string is alphabetic if all characters in the string are alphabetic and there\n"
+"is at least one character in the string.");
+
+#define UNICODE_ISALPHA_METHODDEF \
+ {"isalpha", (PyCFunction)unicode_isalpha, METH_NOARGS, unicode_isalpha__doc__},
+
+static PyObject *
+unicode_isalpha_impl(PyObject *self);
+
+static PyObject *
+unicode_isalpha(PyObject *self, PyObject *Py_UNUSED(ignored))
+{
+ return unicode_isalpha_impl(self);
+}
+
+PyDoc_STRVAR(unicode_isalnum__doc__,
+"isalnum($self, /)\n"
+"--\n"
+"\n"
+"Return True if the string is an alpha-numeric string, False otherwise.\n"
+"\n"
+"A string is alpha-numeric if all characters in the string are alpha-numeric and\n"
+"there is at least one character in the string.");
+
+#define UNICODE_ISALNUM_METHODDEF \
+ {"isalnum", (PyCFunction)unicode_isalnum, METH_NOARGS, unicode_isalnum__doc__},
+
+static PyObject *
+unicode_isalnum_impl(PyObject *self);
+
+static PyObject *
+unicode_isalnum(PyObject *self, PyObject *Py_UNUSED(ignored))
+{
+ return unicode_isalnum_impl(self);
+}
+
+PyDoc_STRVAR(unicode_isdecimal__doc__,
+"isdecimal($self, /)\n"
+"--\n"
+"\n"
+"Return True if the string is a decimal string, False otherwise.\n"
+"\n"
+"A string is a decimal string if all characters in the string are decimal and\n"
+"there is at least one character in the string.");
+
+#define UNICODE_ISDECIMAL_METHODDEF \
+ {"isdecimal", (PyCFunction)unicode_isdecimal, METH_NOARGS, unicode_isdecimal__doc__},
+
+static PyObject *
+unicode_isdecimal_impl(PyObject *self);
+
+static PyObject *
+unicode_isdecimal(PyObject *self, PyObject *Py_UNUSED(ignored))
+{
+ return unicode_isdecimal_impl(self);
+}
+
+PyDoc_STRVAR(unicode_isdigit__doc__,
+"isdigit($self, /)\n"
+"--\n"
+"\n"
+"Return True if the string is a digit string, False otherwise.\n"
+"\n"
+"A string is a digit string if all characters in the string are digits and there\n"
+"is at least one character in the string.");
+
+#define UNICODE_ISDIGIT_METHODDEF \
+ {"isdigit", (PyCFunction)unicode_isdigit, METH_NOARGS, unicode_isdigit__doc__},
+
+static PyObject *
+unicode_isdigit_impl(PyObject *self);
+
+static PyObject *
+unicode_isdigit(PyObject *self, PyObject *Py_UNUSED(ignored))
+{
+ return unicode_isdigit_impl(self);
+}
+
+PyDoc_STRVAR(unicode_isnumeric__doc__,
+"isnumeric($self, /)\n"
+"--\n"
+"\n"
+"Return True if the string is a numeric string, False otherwise.\n"
+"\n"
+"A string is numeric if all characters in the string are numeric and there is at\n"
+"least one character in the string.");
+
+#define UNICODE_ISNUMERIC_METHODDEF \
+ {"isnumeric", (PyCFunction)unicode_isnumeric, METH_NOARGS, unicode_isnumeric__doc__},
+
+static PyObject *
+unicode_isnumeric_impl(PyObject *self);
+
+static PyObject *
+unicode_isnumeric(PyObject *self, PyObject *Py_UNUSED(ignored))
+{
+ return unicode_isnumeric_impl(self);
+}
+
+PyDoc_STRVAR(unicode_isidentifier__doc__,
+"isidentifier($self, /)\n"
+"--\n"
+"\n"
+"Return True if the string is a valid Python identifier, False otherwise.\n"
+"\n"
+"Use keyword.iskeyword() to test for reserved identifiers such as \"def\" and\n"
+"\"class\".");
+
+#define UNICODE_ISIDENTIFIER_METHODDEF \
+ {"isidentifier", (PyCFunction)unicode_isidentifier, METH_NOARGS, unicode_isidentifier__doc__},
+
+static PyObject *
+unicode_isidentifier_impl(PyObject *self);
+
+static PyObject *
+unicode_isidentifier(PyObject *self, PyObject *Py_UNUSED(ignored))
+{
+ return unicode_isidentifier_impl(self);
+}
+
+PyDoc_STRVAR(unicode_isprintable__doc__,
+"isprintable($self, /)\n"
+"--\n"
+"\n"
+"Return True if the string is printable, False otherwise.\n"
+"\n"
+"A string is printable if all of its characters are considered printable in\n"
+"repr() or if it is empty.");
+
+#define UNICODE_ISPRINTABLE_METHODDEF \
+ {"isprintable", (PyCFunction)unicode_isprintable, METH_NOARGS, unicode_isprintable__doc__},
+
+static PyObject *
+unicode_isprintable_impl(PyObject *self);
+
+static PyObject *
+unicode_isprintable(PyObject *self, PyObject *Py_UNUSED(ignored))
+{
+ return unicode_isprintable_impl(self);
+}
+
+PyDoc_STRVAR(unicode_join__doc__,
+"join($self, iterable, /)\n"
+"--\n"
+"\n"
+"Concatenate any number of strings.\n"
+"\n"
+"The string whose method is called is inserted in between each given string.\n"
+"The result is returned as a new string.\n"
+"\n"
+"Example: \'.\'.join([\'ab\', \'pq\', \'rs\']) -> \'ab.pq.rs\'");
+
+#define UNICODE_JOIN_METHODDEF \
+ {"join", (PyCFunction)unicode_join, METH_O, unicode_join__doc__},
+
+PyDoc_STRVAR(unicode_ljust__doc__,
+"ljust($self, width, fillchar=\' \', /)\n"
+"--\n"
+"\n"
+"Return a left-justified string of length width.\n"
+"\n"
+"Padding is done using the specified fill character (default is a space).");
+
+#define UNICODE_LJUST_METHODDEF \
+ {"ljust", (PyCFunction)unicode_ljust, METH_FASTCALL, unicode_ljust__doc__},
+
+static PyObject *
+unicode_ljust_impl(PyObject *self, Py_ssize_t width, Py_UCS4 fillchar);
+
+static PyObject *
+unicode_ljust(PyObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ Py_ssize_t width;
+ Py_UCS4 fillchar = ' ';
+
+ if (!_PyArg_ParseStack(args, nargs, "n|O&:ljust",
+ &width, convert_uc, &fillchar)) {
+ goto exit;
+ }
+
+ if (!_PyArg_NoStackKeywords("ljust", kwnames)) {
+ goto exit;
+ }
+ return_value = unicode_ljust_impl(self, width, fillchar);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(unicode_lower__doc__,
+"lower($self, /)\n"
+"--\n"
+"\n"
+"Return a copy of the string converted to lowercase.");
+
+#define UNICODE_LOWER_METHODDEF \
+ {"lower", (PyCFunction)unicode_lower, METH_NOARGS, unicode_lower__doc__},
+
+static PyObject *
+unicode_lower_impl(PyObject *self);
+
+static PyObject *
+unicode_lower(PyObject *self, PyObject *Py_UNUSED(ignored))
+{
+ return unicode_lower_impl(self);
+}
+
+PyDoc_STRVAR(unicode_strip__doc__,
+"strip($self, chars=None, /)\n"
+"--\n"
+"\n"
+"Return a copy of the string with leading and trailing whitespace remove.\n"
+"\n"
+"If chars is given and not None, remove characters in chars instead.");
+
+#define UNICODE_STRIP_METHODDEF \
+ {"strip", (PyCFunction)unicode_strip, METH_FASTCALL, unicode_strip__doc__},
+
+static PyObject *
+unicode_strip_impl(PyObject *self, PyObject *chars);
+
+static PyObject *
+unicode_strip(PyObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ PyObject *chars = Py_None;
+
+ if (!_PyArg_UnpackStack(args, nargs, "strip",
+ 0, 1,
+ &chars)) {
+ goto exit;
+ }
+
+ if (!_PyArg_NoStackKeywords("strip", kwnames)) {
+ goto exit;
+ }
+ return_value = unicode_strip_impl(self, chars);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(unicode_lstrip__doc__,
+"lstrip($self, chars=None, /)\n"
+"--\n"
+"\n"
+"Return a copy of the string with leading whitespace removed.\n"
+"\n"
+"If chars is given and not None, remove characters in chars instead.");
+
+#define UNICODE_LSTRIP_METHODDEF \
+ {"lstrip", (PyCFunction)unicode_lstrip, METH_FASTCALL, unicode_lstrip__doc__},
+
+static PyObject *
+unicode_lstrip_impl(PyObject *self, PyObject *chars);
+
+static PyObject *
+unicode_lstrip(PyObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ PyObject *chars = NULL;
+
+ if (!_PyArg_UnpackStack(args, nargs, "lstrip",
+ 0, 1,
+ &chars)) {
+ goto exit;
+ }
+
+ if (!_PyArg_NoStackKeywords("lstrip", kwnames)) {
+ goto exit;
+ }
+ return_value = unicode_lstrip_impl(self, chars);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(unicode_rstrip__doc__,
+"rstrip($self, chars=None, /)\n"
+"--\n"
+"\n"
+"Return a copy of the string with trailing whitespace removed.\n"
+"\n"
+"If chars is given and not None, remove characters in chars instead.");
+
+#define UNICODE_RSTRIP_METHODDEF \
+ {"rstrip", (PyCFunction)unicode_rstrip, METH_FASTCALL, unicode_rstrip__doc__},
+
+static PyObject *
+unicode_rstrip_impl(PyObject *self, PyObject *chars);
+
+static PyObject *
+unicode_rstrip(PyObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ PyObject *chars = NULL;
+
+ if (!_PyArg_UnpackStack(args, nargs, "rstrip",
+ 0, 1,
+ &chars)) {
+ goto exit;
+ }
+
+ if (!_PyArg_NoStackKeywords("rstrip", kwnames)) {
+ goto exit;
+ }
+ return_value = unicode_rstrip_impl(self, chars);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(unicode_replace__doc__,
+"replace($self, old, new, count=-1, /)\n"
+"--\n"
+"\n"
+"Return a copy with all occurrences of substring old replaced by new.\n"
+"\n"
+" count\n"
+" Maximum number of occurrences to replace.\n"
+" -1 (the default value) means replace all occurrences.\n"
+"\n"
+"If the optional argument count is given, only the first count occurrences are\n"
+"replaced.");
+
+#define UNICODE_REPLACE_METHODDEF \
+ {"replace", (PyCFunction)unicode_replace, METH_FASTCALL, unicode_replace__doc__},
+
+static PyObject *
+unicode_replace_impl(PyObject *self, PyObject *old, PyObject *new,
+ Py_ssize_t count);
+
+static PyObject *
+unicode_replace(PyObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ PyObject *old;
+ PyObject *new;
+ Py_ssize_t count = -1;
+
+ if (!_PyArg_ParseStack(args, nargs, "UU|n:replace",
+ &old, &new, &count)) {
+ goto exit;
+ }
+
+ if (!_PyArg_NoStackKeywords("replace", kwnames)) {
+ goto exit;
+ }
+ return_value = unicode_replace_impl(self, old, new, count);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(unicode_rjust__doc__,
+"rjust($self, width, fillchar=\' \', /)\n"
+"--\n"
+"\n"
+"Return a right-justified string of length width.\n"
+"\n"
+"Padding is done using the specified fill character (default is a space).");
+
+#define UNICODE_RJUST_METHODDEF \
+ {"rjust", (PyCFunction)unicode_rjust, METH_FASTCALL, unicode_rjust__doc__},
+
+static PyObject *
+unicode_rjust_impl(PyObject *self, Py_ssize_t width, Py_UCS4 fillchar);
+
+static PyObject *
+unicode_rjust(PyObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ Py_ssize_t width;
+ Py_UCS4 fillchar = ' ';
+
+ if (!_PyArg_ParseStack(args, nargs, "n|O&:rjust",
+ &width, convert_uc, &fillchar)) {
+ goto exit;
+ }
+
+ if (!_PyArg_NoStackKeywords("rjust", kwnames)) {
+ goto exit;
+ }
+ return_value = unicode_rjust_impl(self, width, fillchar);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(unicode_split__doc__,
+"split($self, /, sep=None, maxsplit=-1)\n"
+"--\n"
+"\n"
+"Return a list of the words in the string, using sep as the delimiter string.\n"
+"\n"
+" sep\n"
+" The delimiter according which to split the string.\n"
+" None (the default value) means split according to any whitespace,\n"
+" and discard empty strings from the result.\n"
+" maxsplit\n"
+" Maximum number of splits to do.\n"
+" -1 (the default value) means no limit.");
+
+#define UNICODE_SPLIT_METHODDEF \
+ {"split", (PyCFunction)unicode_split, METH_FASTCALL, unicode_split__doc__},
+
+static PyObject *
+unicode_split_impl(PyObject *self, PyObject *sep, Py_ssize_t maxsplit);
+
+static PyObject *
+unicode_split(PyObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ static const char * const _keywords[] = {"sep", "maxsplit", NULL};
+ static _PyArg_Parser _parser = {"|On:split", _keywords, 0};
+ PyObject *sep = Py_None;
+ Py_ssize_t maxsplit = -1;
+
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
+ &sep, &maxsplit)) {
+ goto exit;
+ }
+ return_value = unicode_split_impl(self, sep, maxsplit);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(unicode_partition__doc__,
+"partition($self, sep, /)\n"
+"--\n"
+"\n"
+"Partition the string into three parts using the given separator.\n"
+"\n"
+"This will search for the separator in the string. If the separator is found,\n"
+"returns a 3-tuple containing the part before the separator, the separator\n"
+"itself, and the part after it.\n"
+"\n"
+"If the separator is not found, returns a 3-tuple containing the original string\n"
+"and two empty strings.");
+
+#define UNICODE_PARTITION_METHODDEF \
+ {"partition", (PyCFunction)unicode_partition, METH_O, unicode_partition__doc__},
+
+PyDoc_STRVAR(unicode_rpartition__doc__,
+"rpartition($self, sep, /)\n"
+"--\n"
+"\n"
+"Partition the string into three parts using the given separator.\n"
+"\n"
+"This will search for the separator in the string, starting and the end. If\n"
+"the separator is found, returns a 3-tuple containing the part before the\n"
+"separator, the separator itself, and the part after it.\n"
+"\n"
+"If the separator is not found, returns a 3-tuple containing two empty strings\n"
+"and the original string.");
+
+#define UNICODE_RPARTITION_METHODDEF \
+ {"rpartition", (PyCFunction)unicode_rpartition, METH_O, unicode_rpartition__doc__},
+
+PyDoc_STRVAR(unicode_rsplit__doc__,
+"rsplit($self, /, sep=None, maxsplit=-1)\n"
+"--\n"
+"\n"
+"Return a list of the words in the string, using sep as the delimiter string.\n"
+"\n"
+" sep\n"
+" The delimiter according which to split the string.\n"
+" None (the default value) means split according to any whitespace,\n"
+" and discard empty strings from the result.\n"
+" maxsplit\n"
+" Maximum number of splits to do.\n"
+" -1 (the default value) means no limit.\n"
+"\n"
+"Splits are done starting at the end of the string and working to the front.");
+
+#define UNICODE_RSPLIT_METHODDEF \
+ {"rsplit", (PyCFunction)unicode_rsplit, METH_FASTCALL, unicode_rsplit__doc__},
+
+static PyObject *
+unicode_rsplit_impl(PyObject *self, PyObject *sep, Py_ssize_t maxsplit);
+
+static PyObject *
+unicode_rsplit(PyObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ static const char * const _keywords[] = {"sep", "maxsplit", NULL};
+ static _PyArg_Parser _parser = {"|On:rsplit", _keywords, 0};
+ PyObject *sep = Py_None;
+ Py_ssize_t maxsplit = -1;
+
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
+ &sep, &maxsplit)) {
+ goto exit;
+ }
+ return_value = unicode_rsplit_impl(self, sep, maxsplit);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(unicode_splitlines__doc__,
+"splitlines($self, /, keepends=False)\n"
+"--\n"
+"\n"
+"Return a list of the lines in the string, breaking at line boundaries.\n"
+"\n"
+"Line breaks are not included in the resulting list unless keepends is given and\n"
+"true.");
+
+#define UNICODE_SPLITLINES_METHODDEF \
+ {"splitlines", (PyCFunction)unicode_splitlines, METH_FASTCALL, unicode_splitlines__doc__},
+
+static PyObject *
+unicode_splitlines_impl(PyObject *self, int keepends);
+
+static PyObject *
+unicode_splitlines(PyObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ static const char * const _keywords[] = {"keepends", NULL};
+ static _PyArg_Parser _parser = {"|i:splitlines", _keywords, 0};
+ int keepends = 0;
+
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
+ &keepends)) {
+ goto exit;
+ }
+ return_value = unicode_splitlines_impl(self, keepends);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(unicode_swapcase__doc__,
+"swapcase($self, /)\n"
+"--\n"
+"\n"
+"Convert uppercase characters to lowercase and lowercase characters to uppercase.");
+
+#define UNICODE_SWAPCASE_METHODDEF \
+ {"swapcase", (PyCFunction)unicode_swapcase, METH_NOARGS, unicode_swapcase__doc__},
+
+static PyObject *
+unicode_swapcase_impl(PyObject *self);
+
+static PyObject *
+unicode_swapcase(PyObject *self, PyObject *Py_UNUSED(ignored))
+{
+ return unicode_swapcase_impl(self);
+}
+
PyDoc_STRVAR(unicode_maketrans__doc__,
"maketrans(x, y=None, z=None, /)\n"
"--\n"
@@ -17,26 +827,139 @@ PyDoc_STRVAR(unicode_maketrans__doc__,
"must be a string, whose characters will be mapped to None in the result.");
#define UNICODE_MAKETRANS_METHODDEF \
- {"maketrans", (PyCFunction)unicode_maketrans, METH_VARARGS|METH_STATIC, unicode_maketrans__doc__},
+ {"maketrans", (PyCFunction)unicode_maketrans, METH_FASTCALL|METH_STATIC, unicode_maketrans__doc__},
static PyObject *
unicode_maketrans_impl(PyObject *x, PyObject *y, PyObject *z);
static PyObject *
-unicode_maketrans(void *null, PyObject *args)
+unicode_maketrans(void *null, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
PyObject *x;
PyObject *y = NULL;
PyObject *z = NULL;
- if (!PyArg_ParseTuple(args, "O|UU:maketrans",
+ if (!_PyArg_ParseStack(args, nargs, "O|UU:maketrans",
&x, &y, &z)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("maketrans", kwnames)) {
+ goto exit;
+ }
return_value = unicode_maketrans_impl(x, y, z);
exit:
return return_value;
}
-/*[clinic end generated code: output=4a86dd108d92d104 input=a9049054013a1b77]*/
+
+PyDoc_STRVAR(unicode_translate__doc__,
+"translate($self, table, /)\n"
+"--\n"
+"\n"
+"Replace each character in the string using the given translation table.\n"
+"\n"
+" table\n"
+" Translation table, which must be a mapping of Unicode ordinals to\n"
+" Unicode ordinals, strings, or None.\n"
+"\n"
+"The table must implement lookup/indexing via __getitem__, for instance a\n"
+"dictionary or list. If this operation raises LookupError, the character is\n"
+"left untouched. Characters mapped to None are deleted.");
+
+#define UNICODE_TRANSLATE_METHODDEF \
+ {"translate", (PyCFunction)unicode_translate, METH_O, unicode_translate__doc__},
+
+PyDoc_STRVAR(unicode_upper__doc__,
+"upper($self, /)\n"
+"--\n"
+"\n"
+"Return a copy of the string converted to uppercase.");
+
+#define UNICODE_UPPER_METHODDEF \
+ {"upper", (PyCFunction)unicode_upper, METH_NOARGS, unicode_upper__doc__},
+
+static PyObject *
+unicode_upper_impl(PyObject *self);
+
+static PyObject *
+unicode_upper(PyObject *self, PyObject *Py_UNUSED(ignored))
+{
+ return unicode_upper_impl(self);
+}
+
+PyDoc_STRVAR(unicode_zfill__doc__,
+"zfill($self, width, /)\n"
+"--\n"
+"\n"
+"Pad a numeric string with zeros on the left, to fill a field of the given width.\n"
+"\n"
+"The string is never truncated.");
+
+#define UNICODE_ZFILL_METHODDEF \
+ {"zfill", (PyCFunction)unicode_zfill, METH_O, unicode_zfill__doc__},
+
+static PyObject *
+unicode_zfill_impl(PyObject *self, Py_ssize_t width);
+
+static PyObject *
+unicode_zfill(PyObject *self, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ Py_ssize_t width;
+
+ if (!PyArg_Parse(arg, "n:zfill", &width)) {
+ goto exit;
+ }
+ return_value = unicode_zfill_impl(self, width);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(unicode___format____doc__,
+"__format__($self, format_spec, /)\n"
+"--\n"
+"\n"
+"Return a formatted version of the string as described by format_spec.");
+
+#define UNICODE___FORMAT___METHODDEF \
+ {"__format__", (PyCFunction)unicode___format__, METH_O, unicode___format____doc__},
+
+static PyObject *
+unicode___format___impl(PyObject *self, PyObject *format_spec);
+
+static PyObject *
+unicode___format__(PyObject *self, PyObject *arg)
+{
+ PyObject *return_value = NULL;
+ PyObject *format_spec;
+
+ if (!PyArg_Parse(arg, "U:__format__", &format_spec)) {
+ goto exit;
+ }
+ return_value = unicode___format___impl(self, format_spec);
+
+exit:
+ return return_value;
+}
+
+PyDoc_STRVAR(unicode_sizeof__doc__,
+"__sizeof__($self, /)\n"
+"--\n"
+"\n"
+"Return the size of the string in memory, in bytes.");
+
+#define UNICODE_SIZEOF_METHODDEF \
+ {"__sizeof__", (PyCFunction)unicode_sizeof, METH_NOARGS, unicode_sizeof__doc__},
+
+static PyObject *
+unicode_sizeof_impl(PyObject *self);
+
+static PyObject *
+unicode_sizeof(PyObject *self, PyObject *Py_UNUSED(ignored))
+{
+ return unicode_sizeof_impl(self);
+}
+/*[clinic end generated code: output=88b06f61edd282f9 input=a9049054013a1b77]*/
diff --git a/Objects/codeobject.c b/Objects/codeobject.c
index 0d8a675f9f..b1e8ec9f09 100644
--- a/Objects/codeobject.c
+++ b/Objects/codeobject.c
@@ -110,12 +110,12 @@ PyCode_New(int argcount, int kwonlyargcount,
PyObject *lnotab)
{
PyCodeObject *co;
- unsigned char *cell2arg = NULL;
+ Py_ssize_t *cell2arg = NULL;
Py_ssize_t i, n_cellvars;
/* Check argument types */
if (argcount < 0 || kwonlyargcount < 0 || nlocals < 0 ||
- code == NULL ||
+ code == NULL || !PyBytes_Check(code) ||
consts == NULL || !PyTuple_Check(consts) ||
names == NULL || !PyTuple_Check(names) ||
varnames == NULL || !PyTuple_Check(varnames) ||
@@ -123,8 +123,7 @@ PyCode_New(int argcount, int kwonlyargcount,
cellvars == NULL || !PyTuple_Check(cellvars) ||
name == NULL || !PyUnicode_Check(name) ||
filename == NULL || !PyUnicode_Check(filename) ||
- lnotab == NULL || !PyBytes_Check(lnotab) ||
- !PyObject_CheckReadBuffer(code)) {
+ lnotab == NULL || !PyBytes_Check(lnotab)) {
PyErr_BadInternalCall();
return NULL;
}
@@ -143,19 +142,25 @@ PyCode_New(int argcount, int kwonlyargcount,
if (n_cellvars) {
Py_ssize_t total_args = argcount + kwonlyargcount +
((flags & CO_VARARGS) != 0) + ((flags & CO_VARKEYWORDS) != 0);
- Py_ssize_t alloc_size = sizeof(unsigned char) * n_cellvars;
bool used_cell2arg = false;
- cell2arg = PyMem_MALLOC(alloc_size);
- if (cell2arg == NULL)
+ cell2arg = PyMem_NEW(Py_ssize_t, n_cellvars);
+ if (cell2arg == NULL) {
+ PyErr_NoMemory();
return NULL;
- memset(cell2arg, CO_CELL_NOT_AN_ARG, alloc_size);
+ }
/* Find cells which are also arguments. */
for (i = 0; i < n_cellvars; i++) {
Py_ssize_t j;
PyObject *cell = PyTuple_GET_ITEM(cellvars, i);
+ cell2arg[i] = CO_CELL_NOT_AN_ARG;
for (j = 0; j < total_args; j++) {
PyObject *arg = PyTuple_GET_ITEM(varnames, j);
- if (!PyUnicode_Compare(cell, arg)) {
+ int cmp = PyUnicode_Compare(cell, arg);
+ if (cmp == -1 && PyErr_Occurred()) {
+ PyMem_FREE(cell2arg);
+ return NULL;
+ }
+ if (cmp == 0) {
cell2arg[i] = j;
used_cell2arg = true;
break;
@@ -450,7 +455,7 @@ code_sizeof(PyCodeObject *co, void *unused)
res = _PyObject_SIZE(Py_TYPE(co));
if (co->co_cell2arg != NULL && co->co_cellvars != NULL)
- res += PyTuple_GET_SIZE(co->co_cellvars) * sizeof(unsigned char);
+ res += PyTuple_GET_SIZE(co->co_cellvars) * sizeof(Py_ssize_t);
return PyLong_FromSsize_t(res);
}
diff --git a/Objects/complexobject.c b/Objects/complexobject.c
index 31e12784cc..0d391e5208 100644
--- a/Objects/complexobject.c
+++ b/Objects/complexobject.c
@@ -273,7 +273,7 @@ try_complex_special_method(PyObject *op) {
f = _PyObject_LookupSpecial(op, &PyId___complex__);
if (f) {
- PyObject *res = PyObject_CallFunctionObjArgs(f, NULL);
+ PyObject *res = _PyObject_CallNoArg(f);
Py_DECREF(f);
if (res != NULL && !PyComplex_Check(res)) {
PyErr_SetString(PyExc_TypeError,
diff --git a/Objects/descrobject.c b/Objects/descrobject.c
index 076e741481..20c0d36eca 100644
--- a/Objects/descrobject.c
+++ b/Objects/descrobject.c
@@ -210,15 +210,15 @@ getset_set(PyGetSetDescrObject *descr, PyObject *obj, PyObject *value)
}
static PyObject *
-methoddescr_call(PyMethodDescrObject *descr, PyObject *args, PyObject *kwds)
+methoddescr_call(PyMethodDescrObject *descr, PyObject *args, PyObject *kwargs)
{
- Py_ssize_t argc;
- PyObject *self, *func, *result, **stack;
+ Py_ssize_t nargs;
+ PyObject *self, *result;
/* Make sure that the first argument is acceptable as 'self' */
assert(PyTuple_Check(args));
- argc = PyTuple_GET_SIZE(args);
- if (argc < 1) {
+ nargs = PyTuple_GET_SIZE(args);
+ if (nargs < 1) {
PyErr_Format(PyExc_TypeError,
"descriptor '%V' of '%.100s' "
"object needs an argument",
@@ -239,12 +239,48 @@ methoddescr_call(PyMethodDescrObject *descr, PyObject *args, PyObject *kwds)
return NULL;
}
- func = PyCFunction_NewEx(descr->d_method, self, NULL);
- if (func == NULL)
+ result = _PyMethodDef_RawFastCallDict(descr->d_method, self,
+ &PyTuple_GET_ITEM(args, 1), nargs - 1,
+ kwargs);
+ result = _Py_CheckFunctionResult((PyObject *)descr, result, NULL);
+ return result;
+}
+
+// same to methoddescr_call(), but use FASTCALL convention.
+PyObject *
+_PyMethodDescr_FastCallKeywords(PyObject *descrobj,
+ PyObject **args, Py_ssize_t nargs,
+ PyObject *kwnames)
+{
+ assert(Py_TYPE(descrobj) == &PyMethodDescr_Type);
+ PyMethodDescrObject *descr = (PyMethodDescrObject *)descrobj;
+ PyObject *self, *result;
+
+ /* Make sure that the first argument is acceptable as 'self' */
+ if (nargs < 1) {
+ PyErr_Format(PyExc_TypeError,
+ "descriptor '%V' of '%.100s' "
+ "object needs an argument",
+ descr_name((PyDescrObject *)descr), "?",
+ PyDescr_TYPE(descr)->tp_name);
return NULL;
- stack = &PyTuple_GET_ITEM(args, 1);
- result = _PyObject_FastCallDict(func, stack, argc - 1, kwds);
- Py_DECREF(func);
+ }
+ self = args[0];
+ if (!_PyObject_RealIsSubclass((PyObject *)Py_TYPE(self),
+ (PyObject *)PyDescr_TYPE(descr))) {
+ PyErr_Format(PyExc_TypeError,
+ "descriptor '%V' "
+ "requires a '%.100s' object "
+ "but received a '%.100s'",
+ descr_name((PyDescrObject *)descr), "?",
+ PyDescr_TYPE(descr)->tp_name,
+ self->ob_type->tp_name);
+ return NULL;
+ }
+
+ result = _PyMethodDef_RawFastCallKeywords(descr->d_method, self,
+ args+1, nargs-1, kwnames);
+ result = _Py_CheckFunctionResult((PyObject *)descr, result, NULL);
return result;
}
@@ -421,8 +457,7 @@ static PyObject *
member_get_doc(PyMemberDescrObject *descr, void *closure)
{
if (descr->d_member->doc == NULL) {
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
return PyUnicode_FromString(descr->d_member->doc);
}
@@ -437,8 +472,7 @@ static PyObject *
getset_get_doc(PyGetSetDescrObject *descr, void *closure)
{
if (descr->d_getset->doc == NULL) {
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
return PyUnicode_FromString(descr->d_getset->doc);
}
@@ -804,7 +838,8 @@ mappingproxy_get(mappingproxyobject *pp, PyObject *args)
if (!PyArg_UnpackTuple(args, "get", 1, 2, &key, &def))
return NULL;
- return _PyObject_CallMethodId(pp->mapping, &PyId_get, "(OO)", key, def);
+ return _PyObject_CallMethodIdObjArgs(pp->mapping, &PyId_get,
+ key, def, NULL);
}
static PyObject *
@@ -1172,7 +1207,7 @@ wrapper_call(wrapperobject *wp, PyObject *args, PyObject *kwds)
return (*wk)(self, args, wp->descr->d_wrapped, kwds);
}
- if (kwds != NULL && (!PyDict_Check(kwds) || PyDict_Size(kwds) != 0)) {
+ if (kwds != NULL && (!PyDict_Check(kwds) || PyDict_GET_SIZE(kwds) != 0)) {
PyErr_Format(PyExc_TypeError,
"wrapper %s doesn't take keyword arguments",
wp->descr->d_base->name);
@@ -1453,7 +1488,7 @@ property_copy(PyObject *old, PyObject *get, PyObject *set, PyObject *del)
doc = pold->prop_doc ? pold->prop_doc : Py_None;
}
- new = PyObject_CallFunction(type, "OOOO", get, set, del, doc);
+ new = PyObject_CallFunctionObjArgs(type, get, set, del, doc, NULL);
Py_DECREF(type);
if (new == NULL)
return NULL;
diff --git a/Objects/dict-common.h b/Objects/dict-common.h
index ce9edabd89..6218552734 100644
--- a/Objects/dict-common.h
+++ b/Objects/dict-common.h
@@ -12,7 +12,7 @@ typedef struct {
* -1 when no entry found, -3 when compare raises error.
*/
typedef Py_ssize_t (*dict_lookup_func)
-(PyDictObject *mp, PyObject *key, Py_hash_t hash, PyObject ***value_addr,
+(PyDictObject *mp, PyObject *key, Py_hash_t hash, PyObject **value_addr,
Py_ssize_t *hashpos);
#define DKIX_EMPTY (-1)
diff --git a/Objects/dictobject.c b/Objects/dictobject.c
index a7b403bcec..43584b7bb2 100644
--- a/Objects/dictobject.c
+++ b/Objects/dictobject.c
@@ -10,8 +10,9 @@
This implements the dictionary's hashtable.
-As of Python 3.6, this is compact and ordered. Basic idea is described here.
-https://morepypy.blogspot.com/2015/01/faster-more-memory-efficient-and-more.html
+As of Python 3.6, this is compact and ordered. Basic idea is described here:
+* https://mail.python.org/pipermail/python-dev/2012-December/123028.html
+* https://morepypy.blogspot.com/2015/01/faster-more-memory-efficient-and-more.html
layout:
@@ -222,17 +223,17 @@ equally good collision statistics, needed less code & used less memory.
/* forward declarations */
static Py_ssize_t lookdict(PyDictObject *mp, PyObject *key,
- Py_hash_t hash, PyObject ***value_addr,
+ Py_hash_t hash, PyObject **value_addr,
Py_ssize_t *hashpos);
static Py_ssize_t lookdict_unicode(PyDictObject *mp, PyObject *key,
- Py_hash_t hash, PyObject ***value_addr,
+ Py_hash_t hash, PyObject **value_addr,
Py_ssize_t *hashpos);
static Py_ssize_t
lookdict_unicode_nodummy(PyDictObject *mp, PyObject *key,
- Py_hash_t hash, PyObject ***value_addr,
+ Py_hash_t hash, PyObject **value_addr,
Py_ssize_t *hashpos);
static Py_ssize_t lookdict_split(PyDictObject *mp, PyObject *key,
- Py_hash_t hash, PyObject ***value_addr,
+ Py_hash_t hash, PyObject **value_addr,
Py_ssize_t *hashpos);
static int dictresize(PyDictObject *mp, Py_ssize_t minused);
@@ -682,9 +683,9 @@ the <dummy> value.
For both, when the key isn't found a DKIX_EMPTY is returned. hashpos returns
where the key index should be inserted.
*/
-static Py_ssize_t
+static Py_ssize_t _Py_HOT_FUNCTION
lookdict(PyDictObject *mp, PyObject *key,
- Py_hash_t hash, PyObject ***value_addr, Py_ssize_t *hashpos)
+ Py_hash_t hash, PyObject **value_addr, Py_ssize_t *hashpos)
{
size_t i, mask;
Py_ssize_t ix, freeslot;
@@ -713,7 +714,7 @@ top:
ep = &ep0[ix];
assert(ep->me_key != NULL);
if (ep->me_key == key) {
- *value_addr = &ep->me_value;
+ *value_addr = ep->me_value;
if (hashpos != NULL)
*hashpos = i;
return ix;
@@ -729,7 +730,7 @@ top:
}
if (dk == mp->ma_keys && ep->me_key == startkey) {
if (cmp > 0) {
- *value_addr = &ep->me_value;
+ *value_addr = ep->me_value;
if (hashpos != NULL)
*hashpos = i;
return ix;
@@ -765,7 +766,7 @@ top:
if (hashpos != NULL) {
*hashpos = i;
}
- *value_addr = &ep->me_value;
+ *value_addr = ep->me_value;
return ix;
}
if (ep->me_hash == hash) {
@@ -782,7 +783,7 @@ top:
if (hashpos != NULL) {
*hashpos = i;
}
- *value_addr = &ep->me_value;
+ *value_addr = ep->me_value;
return ix;
}
}
@@ -797,9 +798,9 @@ top:
}
/* Specialized version for string-only keys */
-static Py_ssize_t
+static Py_ssize_t _Py_HOT_FUNCTION
lookdict_unicode(PyDictObject *mp, PyObject *key,
- Py_hash_t hash, PyObject ***value_addr, Py_ssize_t *hashpos)
+ Py_hash_t hash, PyObject **value_addr, Py_ssize_t *hashpos)
{
size_t i;
size_t mask = DK_MASK(mp->ma_keys);
@@ -833,7 +834,7 @@ lookdict_unicode(PyDictObject *mp, PyObject *key,
|| (ep->me_hash == hash && unicode_eq(ep->me_key, key))) {
if (hashpos != NULL)
*hashpos = i;
- *value_addr = &ep->me_value;
+ *value_addr = ep->me_value;
return ix;
}
freeslot = -1;
@@ -859,7 +860,7 @@ lookdict_unicode(PyDictObject *mp, PyObject *key,
assert(ep->me_key != NULL);
if (ep->me_key == key
|| (ep->me_hash == hash && unicode_eq(ep->me_key, key))) {
- *value_addr = &ep->me_value;
+ *value_addr = ep->me_value;
if (hashpos != NULL) {
*hashpos = i;
}
@@ -872,9 +873,9 @@ lookdict_unicode(PyDictObject *mp, PyObject *key,
/* Faster version of lookdict_unicode when it is known that no <dummy> keys
* will be present. */
-static Py_ssize_t
+static Py_ssize_t _Py_HOT_FUNCTION
lookdict_unicode_nodummy(PyDictObject *mp, PyObject *key,
- Py_hash_t hash, PyObject ***value_addr,
+ Py_hash_t hash, PyObject **value_addr,
Py_ssize_t *hashpos)
{
size_t i;
@@ -907,7 +908,7 @@ lookdict_unicode_nodummy(PyDictObject *mp, PyObject *key,
(ep->me_hash == hash && unicode_eq(ep->me_key, key))) {
if (hashpos != NULL)
*hashpos = i;
- *value_addr = &ep->me_value;
+ *value_addr = ep->me_value;
return ix;
}
for (size_t perturb = hash;;) {
@@ -927,7 +928,7 @@ lookdict_unicode_nodummy(PyDictObject *mp, PyObject *key,
(ep->me_hash == hash && unicode_eq(ep->me_key, key))) {
if (hashpos != NULL)
*hashpos = i;
- *value_addr = &ep->me_value;
+ *value_addr = ep->me_value;
return ix;
}
}
@@ -940,9 +941,9 @@ lookdict_unicode_nodummy(PyDictObject *mp, PyObject *key,
* Split tables only contain unicode keys and no dummy keys,
* so algorithm is the same as lookdict_unicode_nodummy.
*/
-static Py_ssize_t
+static Py_ssize_t _Py_HOT_FUNCTION
lookdict_split(PyDictObject *mp, PyObject *key,
- Py_hash_t hash, PyObject ***value_addr, Py_ssize_t *hashpos)
+ Py_hash_t hash, PyObject **value_addr, Py_ssize_t *hashpos)
{
size_t i;
size_t mask = DK_MASK(mp->ma_keys);
@@ -954,7 +955,7 @@ lookdict_split(PyDictObject *mp, PyObject *key,
if (!PyUnicode_CheckExact(key)) {
ix = lookdict(mp, key, hash, value_addr, hashpos);
if (ix >= 0) {
- *value_addr = &mp->ma_values[ix];
+ *value_addr = mp->ma_values[ix];
}
return ix;
}
@@ -974,7 +975,7 @@ lookdict_split(PyDictObject *mp, PyObject *key,
(ep->me_hash == hash && unicode_eq(ep->me_key, key))) {
if (hashpos != NULL)
*hashpos = i;
- *value_addr = &mp->ma_values[ix];
+ *value_addr = mp->ma_values[ix];
return ix;
}
for (size_t perturb = hash;;) {
@@ -994,7 +995,7 @@ lookdict_split(PyDictObject *mp, PyObject *key,
(ep->me_hash == hash && unicode_eq(ep->me_key, key))) {
if (hashpos != NULL)
*hashpos = i;
- *value_addr = &mp->ma_values[ix];
+ *value_addr = mp->ma_values[ix];
return ix;
}
}
@@ -1067,32 +1068,24 @@ _PyDict_MaybeUntrack(PyObject *op)
when it is known that the key is not present in the dict.
The dict must be combined. */
-static void
-find_empty_slot(PyDictObject *mp, PyObject *key, Py_hash_t hash,
- PyObject ***value_addr, Py_ssize_t *hashpos)
+static Py_ssize_t
+find_empty_slot(PyDictKeysObject *keys, PyObject *key, Py_hash_t hash)
{
size_t i;
- size_t mask = DK_MASK(mp->ma_keys);
+ size_t mask = DK_MASK(keys);
Py_ssize_t ix;
- PyDictKeyEntry *ep, *ep0 = DK_ENTRIES(mp->ma_keys);
- assert(!_PyDict_HasSplitTable(mp));
- assert(hashpos != NULL);
assert(key != NULL);
- if (!PyUnicode_CheckExact(key))
- mp->ma_keys->dk_lookup = lookdict;
i = hash & mask;
- ix = dk_get_index(mp->ma_keys, i);
+ ix = dk_get_index(keys, i);
for (size_t perturb = hash; ix != DKIX_EMPTY;) {
perturb >>= PERTURB_SHIFT;
i = (i << 2) + i + perturb + 1;
- ix = dk_get_index(mp->ma_keys, i & mask);
+ ix = dk_get_index(keys, i & mask);
}
- ep = &ep0[mp->ma_keys->dk_nentries];
- *hashpos = i & mask;
- assert(ep->me_value == NULL);
- *value_addr = &ep->me_value;
+ assert(DK_ENTRIES(keys)[keys->dk_nentries].me_value == NULL);
+ return i & mask;
}
static int
@@ -1110,8 +1103,7 @@ static int
insertdict(PyDictObject *mp, PyObject *key, Py_hash_t hash, PyObject *value)
{
PyObject *old_value;
- PyObject **value_addr;
- PyDictKeyEntry *ep, *ep0;
+ PyDictKeyEntry *ep;
Py_ssize_t hashpos, ix;
if (mp->ma_values != NULL && !PyUnicode_CheckExact(key)) {
@@ -1119,7 +1111,7 @@ insertdict(PyDictObject *mp, PyObject *key, Py_hash_t hash, PyObject *value)
return -1;
}
- ix = mp->ma_keys->dk_lookup(mp, key, hash, &value_addr, &hashpos);
+ ix = mp->ma_keys->dk_lookup(mp, key, hash, &old_value, &hashpos);
if (ix == DKIX_ERROR) {
return -1;
}
@@ -1132,28 +1124,28 @@ insertdict(PyDictObject *mp, PyObject *key, Py_hash_t hash, PyObject *value)
* the key anymore. Convert this instance to combine table.
*/
if (_PyDict_HasSplitTable(mp) &&
- ((ix >= 0 && *value_addr == NULL && mp->ma_used != ix) ||
+ ((ix >= 0 && old_value == NULL && mp->ma_used != ix) ||
(ix == DKIX_EMPTY && mp->ma_used != mp->ma_keys->dk_nentries))) {
if (insertion_resize(mp) < 0) {
Py_DECREF(value);
return -1;
}
- find_empty_slot(mp, key, hash, &value_addr, &hashpos);
+ hashpos = find_empty_slot(mp->ma_keys, key, hash);
ix = DKIX_EMPTY;
}
if (ix == DKIX_EMPTY) {
/* Insert into new slot. */
+ assert(old_value == NULL);
if (mp->ma_keys->dk_usable <= 0) {
/* Need to resize. */
if (insertion_resize(mp) < 0) {
Py_DECREF(value);
return -1;
}
- find_empty_slot(mp, key, hash, &value_addr, &hashpos);
+ hashpos = find_empty_slot(mp->ma_keys, key, hash);
}
- ep0 = DK_ENTRIES(mp->ma_keys);
- ep = &ep0[mp->ma_keys->dk_nentries];
+ ep = &DK_ENTRIES(mp->ma_keys)[mp->ma_keys->dk_nentries];
dk_set_index(mp->ma_keys, hashpos, mp->ma_keys->dk_nentries);
Py_INCREF(key);
ep->me_key = key;
@@ -1174,64 +1166,41 @@ insertdict(PyDictObject *mp, PyObject *key, Py_hash_t hash, PyObject *value)
return 0;
}
- assert(value_addr != NULL);
-
- old_value = *value_addr;
- if (old_value != NULL) {
- *value_addr = value;
- mp->ma_version_tag = DICT_NEXT_VERSION();
- assert(_PyDict_CheckConsistency(mp));
-
- Py_DECREF(old_value); /* which **CAN** re-enter (see issue #22653) */
- return 0;
+ if (_PyDict_HasSplitTable(mp)) {
+ mp->ma_values[ix] = value;
+ if (old_value == NULL) {
+ /* pending state */
+ assert(ix == mp->ma_used);
+ mp->ma_used++;
+ }
+ }
+ else {
+ assert(old_value != NULL);
+ DK_ENTRIES(mp->ma_keys)[ix].me_value = value;
}
- /* pending state */
- assert(_PyDict_HasSplitTable(mp));
- assert(ix == mp->ma_used);
- *value_addr = value;
- mp->ma_used++;
mp->ma_version_tag = DICT_NEXT_VERSION();
+ Py_XDECREF(old_value); /* which **CAN** re-enter (see issue #22653) */
assert(_PyDict_CheckConsistency(mp));
return 0;
}
/*
-Internal routine used by dictresize() to insert an item which is
-known to be absent from the dict. This routine also assumes that
-the dict contains no deleted entries. Besides the performance benefit,
-using insertdict() in dictresize() is dangerous (SF bug #1456209).
-Note that no refcounts are changed by this routine; if needed, the caller
-is responsible for incref'ing `key` and `value`.
-Neither mp->ma_used nor k->dk_usable are modified by this routine; the caller
-must set them correctly
+Internal routine used by dictresize() to buid a hashtable of entries.
*/
static void
-insertdict_clean(PyDictObject *mp, PyObject *key, Py_hash_t hash,
- PyObject *value)
+build_indices(PyDictKeysObject *keys, PyDictKeyEntry *ep, Py_ssize_t n)
{
- size_t i;
- PyDictKeysObject *k = mp->ma_keys;
- size_t mask = (size_t)DK_SIZE(k)-1;
- PyDictKeyEntry *ep0 = DK_ENTRIES(mp->ma_keys);
- PyDictKeyEntry *ep;
-
- assert(k->dk_lookup != NULL);
- assert(value != NULL);
- assert(key != NULL);
- assert(PyUnicode_CheckExact(key) || k->dk_lookup == lookdict);
- i = hash & mask;
- for (size_t perturb = hash; dk_get_index(k, i) != DKIX_EMPTY;) {
- perturb >>= PERTURB_SHIFT;
- i = mask & ((i << 2) + i + perturb + 1);
+ size_t mask = (size_t)DK_SIZE(keys) - 1;
+ for (Py_ssize_t ix = 0; ix != n; ix++, ep++) {
+ Py_hash_t hash = ep->me_hash;
+ size_t i = hash & mask;
+ for (size_t perturb = hash; dk_get_index(keys, i) != DKIX_EMPTY;) {
+ perturb >>= PERTURB_SHIFT;
+ i = mask & ((i << 2) + i + perturb + 1);
+ }
+ dk_set_index(keys, i, ix);
}
- ep = &ep0[k->dk_nentries];
- assert(ep->me_value == NULL);
- dk_set_index(k, i, k->dk_nentries);
- k->dk_nentries++;
- ep->me_key = key;
- ep->me_hash = hash;
- ep->me_value = value;
}
/*
@@ -1247,10 +1216,10 @@ but can be resplit by make_keys_shared().
static int
dictresize(PyDictObject *mp, Py_ssize_t minsize)
{
- Py_ssize_t i, newsize;
+ Py_ssize_t newsize, numentries;
PyDictKeysObject *oldkeys;
PyObject **oldvalues;
- PyDictKeyEntry *ep0;
+ PyDictKeyEntry *oldentries, *newentries;
/* Find the smallest table size > minused. */
for (newsize = PyDict_MINSIZE;
@@ -1261,8 +1230,14 @@ dictresize(PyDictObject *mp, Py_ssize_t minsize)
PyErr_NoMemory();
return -1;
}
+
oldkeys = mp->ma_keys;
- oldvalues = mp->ma_values;
+
+ /* NOTE: Current odict checks mp->ma_keys to detect resize happen.
+ * So we can't reuse oldkeys even if oldkeys->dk_size == newsize.
+ * TODO: Try reusing oldkeys when reimplement odict.
+ */
+
/* Allocate a new table. */
mp->ma_keys = new_keys_object(newsize);
if (mp->ma_keys == NULL) {
@@ -1273,42 +1248,59 @@ dictresize(PyDictObject *mp, Py_ssize_t minsize)
assert(mp->ma_keys->dk_usable >= mp->ma_used);
if (oldkeys->dk_lookup == lookdict)
mp->ma_keys->dk_lookup = lookdict;
- mp->ma_values = NULL;
- ep0 = DK_ENTRIES(oldkeys);
- /* Main loop below assumes we can transfer refcount to new keys
- * and that value is stored in me_value.
- * Increment ref-counts and copy values here to compensate
- * This (resizing a split table) should be relatively rare */
+
+ numentries = mp->ma_used;
+ oldentries = DK_ENTRIES(oldkeys);
+ newentries = DK_ENTRIES(mp->ma_keys);
+ oldvalues = mp->ma_values;
if (oldvalues != NULL) {
- for (i = 0; i < oldkeys->dk_nentries; i++) {
- if (oldvalues[i] != NULL) {
- Py_INCREF(ep0[i].me_key);
- ep0[i].me_value = oldvalues[i];
- }
- }
- }
- /* Main loop */
- for (i = 0; i < oldkeys->dk_nentries; i++) {
- PyDictKeyEntry *ep = &ep0[i];
- if (ep->me_value != NULL) {
- insertdict_clean(mp, ep->me_key, ep->me_hash, ep->me_value);
+ /* Convert split table into new combined table.
+ * We must incref keys; we can transfer values.
+ * Note that values of split table is always dense.
+ */
+ for (Py_ssize_t i = 0; i < numentries; i++) {
+ assert(oldvalues[i] != NULL);
+ PyDictKeyEntry *ep = &oldentries[i];
+ PyObject *key = ep->me_key;
+ Py_INCREF(key);
+ newentries[i].me_key = key;
+ newentries[i].me_hash = ep->me_hash;
+ newentries[i].me_value = oldvalues[i];
}
- }
- mp->ma_keys->dk_usable -= mp->ma_used;
- if (oldvalues != NULL) {
- /* NULL out me_value slot in oldkeys, in case it was shared */
- for (i = 0; i < oldkeys->dk_nentries; i++)
- ep0[i].me_value = NULL;
+
DK_DECREF(oldkeys);
+ mp->ma_values = NULL;
if (oldvalues != empty_values) {
free_values(oldvalues);
}
}
- else {
+ else { // combined table.
+ if (oldkeys->dk_nentries == numentries) {
+ memcpy(newentries, oldentries, numentries * sizeof(PyDictKeyEntry));
+ }
+ else {
+ PyDictKeyEntry *ep = oldentries;
+ for (Py_ssize_t i = 0; i < numentries; i++) {
+ while (ep->me_value == NULL)
+ ep++;
+ newentries[i] = *ep++;
+ }
+ }
+
assert(oldkeys->dk_lookup != lookdict_split);
assert(oldkeys->dk_refcnt == 1);
- DK_DEBUG_DECREF PyObject_FREE(oldkeys);
+ if (oldkeys->dk_size == PyDict_MINSIZE &&
+ numfreekeys < PyDict_MAXFREELIST) {
+ DK_DEBUG_DECREF keys_free_list[numfreekeys++] = oldkeys;
+ }
+ else {
+ DK_DEBUG_DECREF PyObject_FREE(oldkeys);
+ }
}
+
+ build_indices(mp->ma_keys, newentries, numentries);
+ mp->ma_keys->dk_usable -= numentries;
+ mp->ma_keys->dk_nentries = numentries;
return 0;
}
@@ -1402,7 +1394,7 @@ PyDict_GetItem(PyObject *op, PyObject *key)
Py_ssize_t ix;
PyDictObject *mp = (PyDictObject *)op;
PyThreadState *tstate;
- PyObject **value_addr;
+ PyObject *value;
if (!PyDict_Check(op))
return NULL;
@@ -1421,25 +1413,25 @@ PyDict_GetItem(PyObject *op, PyObject *key)
Let's just hope that no exception occurs then... This must be
_PyThreadState_Current and not PyThreadState_GET() because in debug
mode, the latter complains if tstate is NULL. */
- tstate = _PyThreadState_UncheckedGet();
+ tstate = PyThreadState_GET();
if (tstate != NULL && tstate->curexc_type != NULL) {
/* preserve the existing exception */
PyObject *err_type, *err_value, *err_tb;
PyErr_Fetch(&err_type, &err_value, &err_tb);
- ix = (mp->ma_keys->dk_lookup)(mp, key, hash, &value_addr, NULL);
+ ix = (mp->ma_keys->dk_lookup)(mp, key, hash, &value, NULL);
/* ignore errors */
PyErr_Restore(err_type, err_value, err_tb);
if (ix < 0)
return NULL;
}
else {
- ix = (mp->ma_keys->dk_lookup)(mp, key, hash, &value_addr, NULL);
+ ix = (mp->ma_keys->dk_lookup)(mp, key, hash, &value, NULL);
if (ix < 0) {
PyErr_Clear();
return NULL;
}
}
- return *value_addr;
+ return value;
}
/* Same as PyDict_GetItemWithError() but with hash supplied by caller.
@@ -1451,18 +1443,18 @@ _PyDict_GetItem_KnownHash(PyObject *op, PyObject *key, Py_hash_t hash)
{
Py_ssize_t ix;
PyDictObject *mp = (PyDictObject *)op;
- PyObject **value_addr;
+ PyObject *value;
if (!PyDict_Check(op)) {
PyErr_BadInternalCall();
return NULL;
}
- ix = (mp->ma_keys->dk_lookup)(mp, key, hash, &value_addr, NULL);
+ ix = (mp->ma_keys->dk_lookup)(mp, key, hash, &value, NULL);
if (ix < 0) {
return NULL;
}
- return *value_addr;
+ return value;
}
/* Variant of PyDict_GetItem() that doesn't suppress exceptions.
@@ -1475,7 +1467,7 @@ PyDict_GetItemWithError(PyObject *op, PyObject *key)
Py_ssize_t ix;
Py_hash_t hash;
PyDictObject*mp = (PyDictObject *)op;
- PyObject **value_addr;
+ PyObject *value;
if (!PyDict_Check(op)) {
PyErr_BadInternalCall();
@@ -1490,10 +1482,10 @@ PyDict_GetItemWithError(PyObject *op, PyObject *key)
}
}
- ix = (mp->ma_keys->dk_lookup)(mp, key, hash, &value_addr, NULL);
+ ix = (mp->ma_keys->dk_lookup)(mp, key, hash, &value, NULL);
if (ix < 0)
return NULL;
- return *value_addr;
+ return value;
}
PyObject *
@@ -1518,7 +1510,7 @@ _PyDict_LoadGlobal(PyDictObject *globals, PyDictObject *builtins, PyObject *key)
{
Py_ssize_t ix;
Py_hash_t hash;
- PyObject **value_addr;
+ PyObject *value;
if (!PyUnicode_CheckExact(key) ||
(hash = ((PyASCIIObject *) key)->hash) == -1)
@@ -1529,17 +1521,17 @@ _PyDict_LoadGlobal(PyDictObject *globals, PyDictObject *builtins, PyObject *key)
}
/* namespace 1: globals */
- ix = globals->ma_keys->dk_lookup(globals, key, hash, &value_addr, NULL);
+ ix = globals->ma_keys->dk_lookup(globals, key, hash, &value, NULL);
if (ix == DKIX_ERROR)
return NULL;
- if (ix != DKIX_EMPTY && *value_addr != NULL)
- return *value_addr;
+ if (ix != DKIX_EMPTY && value != NULL)
+ return value;
/* namespace 2: builtins */
- ix = builtins->ma_keys->dk_lookup(builtins, key, hash, &value_addr, NULL);
+ ix = builtins->ma_keys->dk_lookup(builtins, key, hash, &value, NULL);
if (ix < 0)
return NULL;
- return *value_addr;
+ return value;
}
/* CAUTION: PyDict_SetItem() must guarantee that it won't resize the
@@ -1593,14 +1585,11 @@ _PyDict_SetItem_KnownHash(PyObject *op, PyObject *key, PyObject *value,
static int
delitem_common(PyDictObject *mp, Py_ssize_t hashpos, Py_ssize_t ix,
- PyObject **value_addr)
+ PyObject *old_value)
{
- PyObject *old_key, *old_value;
+ PyObject *old_key;
PyDictKeyEntry *ep;
- old_value = *value_addr;
- assert(old_value != NULL);
- *value_addr = NULL;
mp->ma_used--;
mp->ma_version_tag = DICT_NEXT_VERSION();
ep = &DK_ENTRIES(mp->ma_keys)[ix];
@@ -1608,6 +1597,7 @@ delitem_common(PyDictObject *mp, Py_ssize_t hashpos, Py_ssize_t ix,
ENSURE_ALLOWS_DELETIONS(mp);
old_key = ep->me_key;
ep->me_key = NULL;
+ ep->me_value = NULL;
Py_DECREF(old_key);
Py_DECREF(old_value);
@@ -1635,7 +1625,7 @@ _PyDict_DelItem_KnownHash(PyObject *op, PyObject *key, Py_hash_t hash)
{
Py_ssize_t hashpos, ix;
PyDictObject *mp;
- PyObject **value_addr;
+ PyObject *old_value;
if (!PyDict_Check(op)) {
PyErr_BadInternalCall();
@@ -1644,10 +1634,10 @@ _PyDict_DelItem_KnownHash(PyObject *op, PyObject *key, Py_hash_t hash)
assert(key);
assert(hash != -1);
mp = (PyDictObject *)op;
- ix = (mp->ma_keys->dk_lookup)(mp, key, hash, &value_addr, &hashpos);
+ ix = (mp->ma_keys->dk_lookup)(mp, key, hash, &old_value, &hashpos);
if (ix == DKIX_ERROR)
return -1;
- if (ix == DKIX_EMPTY || *value_addr == NULL) {
+ if (ix == DKIX_EMPTY || old_value == NULL) {
_PyErr_SetKeyError(key);
return -1;
}
@@ -1658,10 +1648,11 @@ _PyDict_DelItem_KnownHash(PyObject *op, PyObject *key, Py_hash_t hash)
if (dictresize(mp, DK_SIZE(mp->ma_keys))) {
return -1;
}
- ix = (mp->ma_keys->dk_lookup)(mp, key, hash, &value_addr, &hashpos);
+ ix = (mp->ma_keys->dk_lookup)(mp, key, hash, &old_value, &hashpos);
assert(ix >= 0);
}
- return delitem_common(mp, hashpos, ix, value_addr);
+
+ return delitem_common(mp, hashpos, ix, old_value);
}
/* This function promises that the predicate -> deletion sequence is atomic
@@ -1675,7 +1666,7 @@ _PyDict_DelItemIf(PyObject *op, PyObject *key,
Py_ssize_t hashpos, ix;
PyDictObject *mp;
Py_hash_t hash;
- PyObject **value_addr;
+ PyObject *old_value;
int res;
if (!PyDict_Check(op)) {
@@ -1687,10 +1678,10 @@ _PyDict_DelItemIf(PyObject *op, PyObject *key,
if (hash == -1)
return -1;
mp = (PyDictObject *)op;
- ix = (mp->ma_keys->dk_lookup)(mp, key, hash, &value_addr, &hashpos);
+ ix = (mp->ma_keys->dk_lookup)(mp, key, hash, &old_value, &hashpos);
if (ix == DKIX_ERROR)
return -1;
- if (ix == DKIX_EMPTY || *value_addr == NULL) {
+ if (ix == DKIX_EMPTY || old_value == NULL) {
_PyErr_SetKeyError(key);
return -1;
}
@@ -1701,15 +1692,15 @@ _PyDict_DelItemIf(PyObject *op, PyObject *key,
if (dictresize(mp, DK_SIZE(mp->ma_keys))) {
return -1;
}
- ix = (mp->ma_keys->dk_lookup)(mp, key, hash, &value_addr, &hashpos);
+ ix = (mp->ma_keys->dk_lookup)(mp, key, hash, &old_value, &hashpos);
assert(ix >= 0);
}
- res = predicate(*value_addr);
+ res = predicate(old_value);
if (res == -1)
return -1;
if (res > 0)
- return delitem_common(mp, hashpos, ix, value_addr);
+ return delitem_common(mp, hashpos, ix, old_value);
else
return 0;
}
@@ -1760,7 +1751,7 @@ int
_PyDict_Next(PyObject *op, Py_ssize_t *ppos, PyObject **pkey,
PyObject **pvalue, Py_hash_t *phash)
{
- Py_ssize_t i, n;
+ Py_ssize_t i;
PyDictObject *mp;
PyDictKeyEntry *entry_ptr;
PyObject *value;
@@ -1769,21 +1760,18 @@ _PyDict_Next(PyObject *op, Py_ssize_t *ppos, PyObject **pkey,
return 0;
mp = (PyDictObject *)op;
i = *ppos;
- n = mp->ma_keys->dk_nentries;
- if ((size_t)i >= (size_t)n)
- return 0;
if (mp->ma_values) {
- PyObject **value_ptr = &mp->ma_values[i];
- while (i < n && *value_ptr == NULL) {
- value_ptr++;
- i++;
- }
- if (i >= n)
+ if (i < 0 || i >= mp->ma_used)
return 0;
+ /* values of split table is always dense */
entry_ptr = &DK_ENTRIES(mp->ma_keys)[i];
- value = *value_ptr;
+ value = mp->ma_values[i];
+ assert(value != NULL);
}
else {
+ Py_ssize_t n = mp->ma_keys->dk_nentries;
+ if (i < 0 || i >= n)
+ return 0;
entry_ptr = &DK_ENTRIES(mp->ma_keys)[i];
while (i < n && entry_ptr->me_value == NULL) {
entry_ptr++;
@@ -1834,7 +1822,6 @@ _PyDict_Pop_KnownHash(PyObject *dict, PyObject *key, Py_hash_t hash, PyObject *d
Py_ssize_t ix, hashpos;
PyObject *old_value, *old_key;
PyDictKeyEntry *ep;
- PyObject **value_addr;
PyDictObject *mp;
assert(PyDict_Check(dict));
@@ -1848,10 +1835,10 @@ _PyDict_Pop_KnownHash(PyObject *dict, PyObject *key, Py_hash_t hash, PyObject *d
_PyErr_SetKeyError(key);
return NULL;
}
- ix = (mp->ma_keys->dk_lookup)(mp, key, hash, &value_addr, &hashpos);
+ ix = (mp->ma_keys->dk_lookup)(mp, key, hash, &old_value, &hashpos);
if (ix == DKIX_ERROR)
return NULL;
- if (ix == DKIX_EMPTY || *value_addr == NULL) {
+ if (ix == DKIX_EMPTY || old_value == NULL) {
if (deflt) {
Py_INCREF(deflt);
return deflt;
@@ -1865,13 +1852,11 @@ _PyDict_Pop_KnownHash(PyObject *dict, PyObject *key, Py_hash_t hash, PyObject *d
if (dictresize(mp, DK_SIZE(mp->ma_keys))) {
return NULL;
}
- ix = (mp->ma_keys->dk_lookup)(mp, key, hash, &value_addr, &hashpos);
+ ix = (mp->ma_keys->dk_lookup)(mp, key, hash, &old_value, &hashpos);
assert(ix >= 0);
}
- old_value = *value_addr;
assert(old_value != NULL);
- *value_addr = NULL;
mp->ma_used--;
mp->ma_version_tag = DICT_NEXT_VERSION();
dk_set_index(mp->ma_keys, hashpos, DKIX_DUMMY);
@@ -1879,6 +1864,7 @@ _PyDict_Pop_KnownHash(PyObject *dict, PyObject *key, Py_hash_t hash, PyObject *d
ENSURE_ALLOWS_DELETIONS(mp);
old_key = ep->me_key;
ep->me_key = NULL;
+ ep->me_value = NULL;
Py_DECREF(old_key);
assert(_PyDict_CheckConsistency(mp));
@@ -1916,7 +1902,7 @@ _PyDict_FromKeys(PyObject *cls, PyObject *iterable, PyObject *value)
PyObject *d;
int status;
- d = PyObject_CallObject(cls, NULL);
+ d = _PyObject_CallNoArg(cls);
if (d == NULL)
return NULL;
@@ -2118,10 +2104,9 @@ dict_length(PyDictObject *mp)
static PyObject *
dict_subscript(PyDictObject *mp, PyObject *key)
{
- PyObject *v;
Py_ssize_t ix;
Py_hash_t hash;
- PyObject **value_addr;
+ PyObject *value;
if (!PyUnicode_CheckExact(key) ||
(hash = ((PyASCIIObject *) key)->hash) == -1) {
@@ -2129,10 +2114,10 @@ dict_subscript(PyDictObject *mp, PyObject *key)
if (hash == -1)
return NULL;
}
- ix = (mp->ma_keys->dk_lookup)(mp, key, hash, &value_addr, NULL);
+ ix = (mp->ma_keys->dk_lookup)(mp, key, hash, &value, NULL);
if (ix == DKIX_ERROR)
return NULL;
- if (ix == DKIX_EMPTY || *value_addr == NULL) {
+ if (ix == DKIX_EMPTY || value == NULL) {
if (!PyDict_CheckExact(mp)) {
/* Look up __missing__ method if we're a subclass. */
PyObject *missing, *res;
@@ -2150,9 +2135,8 @@ dict_subscript(PyDictObject *mp, PyObject *key)
_PyErr_SetKeyError(key);
return NULL;
}
- v = *value_addr;
- Py_INCREF(v);
- return v;
+ Py_INCREF(value);
+ return value;
}
static int
@@ -2327,12 +2311,12 @@ dict.fromkeys
value: object=None
/
-Returns a new dict with keys from iterable and values equal to value.
+Create a new dictionary with keys from iterable and values set to value.
[clinic start generated code]*/
static PyObject *
dict_fromkeys_impl(PyTypeObject *type, PyObject *iterable, PyObject *value)
-/*[clinic end generated code: output=8fb98e4b10384999 input=b85a667f9bf4669d]*/
+/*[clinic end generated code: output=8fb98e4b10384999 input=382ba4855d0f74c3]*/
{
return _PyDict_FromKeys((PyObject *)type, iterable, value);
}
@@ -2363,6 +2347,9 @@ dict_update_common(PyObject *self, PyObject *args, PyObject *kwds,
return result;
}
+/* Note: dict.update() uses the METH_VARARGS|METH_KEYWORDS calling convention.
+ Using METH_FASTCALL would make dict.update(**dict2) calls slower, see the
+ issue #29312. */
static PyObject *
dict_update(PyObject *self, PyObject *args, PyObject *kwds)
{
@@ -2724,7 +2711,6 @@ dict_equal(PyDictObject *a, PyDictObject *b)
if (aval != NULL) {
int cmp;
PyObject *bval;
- PyObject **vaddr;
PyObject *key = ep->me_key;
/* temporarily bump aval's refcount to ensure it stays
alive until we're done with it */
@@ -2732,10 +2718,7 @@ dict_equal(PyDictObject *a, PyDictObject *b)
/* ditto for key */
Py_INCREF(key);
/* reuse the known hash value */
- if ((b->ma_keys->dk_lookup)(b, key, ep->me_hash, &vaddr, NULL) < 0)
- bval = NULL;
- else
- bval = *vaddr;
+ b->ma_keys->dk_lookup(b, key, ep->me_hash, &bval, NULL);
Py_DECREF(key);
if (bval == NULL) {
Py_DECREF(aval);
@@ -2781,17 +2764,17 @@ dict.__contains__
key: object
/
-True if D has a key k, else False.
+True if the dictionary has the specified key, else False.
[clinic start generated code]*/
static PyObject *
dict___contains__(PyDictObject *self, PyObject *key)
-/*[clinic end generated code: output=a3d03db709ed6e6b input=b852b2a19b51ab24]*/
+/*[clinic end generated code: output=a3d03db709ed6e6b input=fe1cb42ad831e820]*/
{
register PyDictObject *mp = self;
Py_hash_t hash;
Py_ssize_t ix;
- PyObject **value_addr;
+ PyObject *value;
if (!PyUnicode_CheckExact(key) ||
(hash = ((PyASCIIObject *) key)->hash) == -1) {
@@ -2799,26 +2782,31 @@ dict___contains__(PyDictObject *self, PyObject *key)
if (hash == -1)
return NULL;
}
- ix = (mp->ma_keys->dk_lookup)(mp, key, hash, &value_addr, NULL);
+ ix = (mp->ma_keys->dk_lookup)(mp, key, hash, &value, NULL);
if (ix == DKIX_ERROR)
return NULL;
- if (ix == DKIX_EMPTY || *value_addr == NULL)
+ if (ix == DKIX_EMPTY || value == NULL)
Py_RETURN_FALSE;
Py_RETURN_TRUE;
}
+/*[clinic input]
+dict.get
+
+ key: object
+ default: object = None
+ /
+
+Return the value for key if key is in the dictionary, else default.
+[clinic start generated code]*/
+
static PyObject *
-dict_get(PyDictObject *mp, PyObject *args)
+dict_get_impl(PyDictObject *self, PyObject *key, PyObject *default_value)
+/*[clinic end generated code: output=bba707729dee05bf input=279ddb5790b6b107]*/
{
- PyObject *key;
- PyObject *failobj = Py_None;
PyObject *val = NULL;
Py_hash_t hash;
Py_ssize_t ix;
- PyObject **value_addr;
-
- if (!PyArg_UnpackTuple(args, "get", 1, 2, &key, &failobj))
- return NULL;
if (!PyUnicode_CheckExact(key) ||
(hash = ((PyASCIIObject *) key)->hash) == -1) {
@@ -2826,13 +2814,12 @@ dict_get(PyDictObject *mp, PyObject *args)
if (hash == -1)
return NULL;
}
- ix = (mp->ma_keys->dk_lookup)(mp, key, hash, &value_addr, NULL);
+ ix = (self->ma_keys->dk_lookup) (self, key, hash, &val, NULL);
if (ix == DKIX_ERROR)
return NULL;
- if (ix == DKIX_EMPTY || *value_addr == NULL)
- val = failobj;
- else
- val = *value_addr;
+ if (ix == DKIX_EMPTY || val == NULL) {
+ val = default_value;
+ }
Py_INCREF(val);
return val;
}
@@ -2844,7 +2831,6 @@ PyDict_SetDefault(PyObject *d, PyObject *key, PyObject *defaultobj)
PyObject *value;
Py_hash_t hash;
Py_ssize_t hashpos, ix;
- PyObject **value_addr;
if (!PyDict_Check(d)) {
PyErr_BadInternalCall();
@@ -2863,17 +2849,17 @@ PyDict_SetDefault(PyObject *d, PyObject *key, PyObject *defaultobj)
return NULL;
}
- ix = (mp->ma_keys->dk_lookup)(mp, key, hash, &value_addr, &hashpos);
+ ix = (mp->ma_keys->dk_lookup)(mp, key, hash, &value, &hashpos);
if (ix == DKIX_ERROR)
return NULL;
if (_PyDict_HasSplitTable(mp) &&
- ((ix >= 0 && *value_addr == NULL && mp->ma_used != ix) ||
+ ((ix >= 0 && value == NULL && mp->ma_used != ix) ||
(ix == DKIX_EMPTY && mp->ma_used != mp->ma_keys->dk_nentries))) {
if (insertion_resize(mp) < 0) {
return NULL;
}
- find_empty_slot(mp, key, hash, &value_addr, &hashpos);
+ hashpos = find_empty_slot(mp->ma_keys, key, hash);
ix = DKIX_EMPTY;
}
@@ -2884,7 +2870,7 @@ PyDict_SetDefault(PyObject *d, PyObject *key, PyObject *defaultobj)
if (insertion_resize(mp) < 0) {
return NULL;
}
- find_empty_slot(mp, key, hash, &value_addr, &hashpos);
+ hashpos = find_empty_slot(mp->ma_keys, key, hash);
}
ep0 = DK_ENTRIES(mp->ma_keys);
ep = &ep0[mp->ma_keys->dk_nentries];
@@ -2894,7 +2880,7 @@ PyDict_SetDefault(PyObject *d, PyObject *key, PyObject *defaultobj)
MAINTAIN_TRACKING(mp, key, value);
ep->me_key = key;
ep->me_hash = hash;
- if (mp->ma_values) {
+ if (_PyDict_HasSplitTable(mp)) {
assert(mp->ma_values[mp->ma_keys->dk_nentries] == NULL);
mp->ma_values[mp->ma_keys->dk_nentries] = value;
}
@@ -2907,34 +2893,41 @@ PyDict_SetDefault(PyObject *d, PyObject *key, PyObject *defaultobj)
mp->ma_keys->dk_nentries++;
assert(mp->ma_keys->dk_usable >= 0);
}
- else if (*value_addr == NULL) {
+ else if (value == NULL) {
value = defaultobj;
assert(_PyDict_HasSplitTable(mp));
assert(ix == mp->ma_used);
Py_INCREF(value);
MAINTAIN_TRACKING(mp, key, value);
- *value_addr = value;
+ mp->ma_values[ix] = value;
mp->ma_used++;
mp->ma_version_tag = DICT_NEXT_VERSION();
}
- else {
- value = *value_addr;
- }
assert(_PyDict_CheckConsistency(mp));
return value;
}
+/*[clinic input]
+dict.setdefault
+
+ key: object
+ default: object = None
+ /
+
+Insert key with a value of default if key is not in the dictionary.
+
+Return the value for key if key is in the dictionary, else default.
+[clinic start generated code]*/
+
static PyObject *
-dict_setdefault(PyDictObject *mp, PyObject *args)
+dict_setdefault_impl(PyDictObject *self, PyObject *key,
+ PyObject *default_value)
+/*[clinic end generated code: output=f8c1101ebf69e220 input=0f063756e815fd9d]*/
{
- PyObject *key, *val;
- PyObject *defaultobj = Py_None;
+ PyObject *val;
- if (!PyArg_UnpackTuple(args, "setdefault", 1, 2, &key, &defaultobj))
- return NULL;
-
- val = PyDict_SetDefault((PyObject *)mp, key, defaultobj);
+ val = PyDict_SetDefault((PyObject *)self, key, default_value);
Py_XINCREF(val);
return val;
}
@@ -3098,12 +3091,6 @@ PyDoc_STRVAR(getitem__doc__, "x.__getitem__(y) <==> x[y]");
PyDoc_STRVAR(sizeof__doc__,
"D.__sizeof__() -> size of D in memory, in bytes");
-PyDoc_STRVAR(get__doc__,
-"D.get(k[,d]) -> D[k] if k in D, else d. d defaults to None.");
-
-PyDoc_STRVAR(setdefault_doc__,
-"D.setdefault(k[,d]) -> D.get(k,d), also set D[k]=d if k not in D");
-
PyDoc_STRVAR(pop__doc__,
"D.pop(k[,d]) -> v, remove specified key and return the corresponding value.\n\
If key is not found, d is returned if given, otherwise KeyError is raised");
@@ -3142,10 +3129,8 @@ static PyMethodDef mapp_methods[] = {
getitem__doc__},
{"__sizeof__", (PyCFunction)dict_sizeof, METH_NOARGS,
sizeof__doc__},
- {"get", (PyCFunction)dict_get, METH_VARARGS,
- get__doc__},
- {"setdefault", (PyCFunction)dict_setdefault, METH_VARARGS,
- setdefault_doc__},
+ DICT_GET_METHODDEF
+ DICT_SETDEFAULT_METHODDEF
{"pop", (PyCFunction)dict_pop, METH_VARARGS,
pop__doc__},
{"popitem", (PyCFunction)dict_popitem, METH_NOARGS,
@@ -3173,7 +3158,7 @@ PyDict_Contains(PyObject *op, PyObject *key)
Py_hash_t hash;
Py_ssize_t ix;
PyDictObject *mp = (PyDictObject *)op;
- PyObject **value_addr;
+ PyObject *value;
if (!PyUnicode_CheckExact(key) ||
(hash = ((PyASCIIObject *) key)->hash) == -1) {
@@ -3181,10 +3166,10 @@ PyDict_Contains(PyObject *op, PyObject *key)
if (hash == -1)
return -1;
}
- ix = (mp->ma_keys->dk_lookup)(mp, key, hash, &value_addr, NULL);
+ ix = (mp->ma_keys->dk_lookup)(mp, key, hash, &value, NULL);
if (ix == DKIX_ERROR)
return -1;
- return (ix != DKIX_EMPTY && *value_addr != NULL);
+ return (ix != DKIX_EMPTY && value != NULL);
}
/* Internal version of PyDict_Contains used when the hash value is already known */
@@ -3192,13 +3177,13 @@ int
_PyDict_Contains(PyObject *op, PyObject *key, Py_hash_t hash)
{
PyDictObject *mp = (PyDictObject *)op;
- PyObject **value_addr;
+ PyObject *value;
Py_ssize_t ix;
- ix = (mp->ma_keys->dk_lookup)(mp, key, hash, &value_addr, NULL);
+ ix = (mp->ma_keys->dk_lookup)(mp, key, hash, &value, NULL);
if (ix == DKIX_ERROR)
return -1;
- return (ix != DKIX_EMPTY && *value_addr != NULL);
+ return (ix != DKIX_EMPTY && value != NULL);
}
/* Hack to implement "key in dict" */
@@ -3463,7 +3448,7 @@ static PyObject*
dictiter_iternextkey(dictiterobject *di)
{
PyObject *key;
- Py_ssize_t i, n;
+ Py_ssize_t i;
PyDictKeysObject *k;
PyDictObject *d = di->di_dict;
@@ -3480,18 +3465,15 @@ dictiter_iternextkey(dictiterobject *di)
i = di->di_pos;
k = d->ma_keys;
- n = k->dk_nentries;
+ assert(i >= 0);
if (d->ma_values) {
- PyObject **value_ptr = &d->ma_values[i];
- while (i < n && *value_ptr == NULL) {
- value_ptr++;
- i++;
- }
- if (i >= n)
+ if (i >= d->ma_used)
goto fail;
key = DK_ENTRIES(k)[i].me_key;
+ assert(d->ma_values[i] != NULL);
}
else {
+ Py_ssize_t n = k->dk_nentries;
PyDictKeyEntry *entry_ptr = &DK_ENTRIES(k)[i];
while (i < n && entry_ptr->me_value == NULL) {
entry_ptr++;
@@ -3549,7 +3531,7 @@ static PyObject *
dictiter_iternextvalue(dictiterobject *di)
{
PyObject *value;
- Py_ssize_t i, n;
+ Py_ssize_t i;
PyDictObject *d = di->di_dict;
if (d == NULL)
@@ -3564,18 +3546,15 @@ dictiter_iternextvalue(dictiterobject *di)
}
i = di->di_pos;
- n = d->ma_keys->dk_nentries;
+ assert(i >= 0);
if (d->ma_values) {
- PyObject **value_ptr = &d->ma_values[i];
- while (i < n && *value_ptr == NULL) {
- value_ptr++;
- i++;
- }
- if (i >= n)
+ if (i >= d->ma_used)
goto fail;
- value = *value_ptr;
+ value = d->ma_values[i];
+ assert(value != NULL);
}
else {
+ Py_ssize_t n = d->ma_keys->dk_nentries;
PyDictKeyEntry *entry_ptr = &DK_ENTRIES(d->ma_keys)[i];
while (i < n && entry_ptr->me_value == NULL) {
entry_ptr++;
@@ -3633,7 +3612,7 @@ static PyObject *
dictiter_iternextitem(dictiterobject *di)
{
PyObject *key, *value, *result = di->di_result;
- Py_ssize_t i, n;
+ Py_ssize_t i;
PyDictObject *d = di->di_dict;
if (d == NULL)
@@ -3648,19 +3627,16 @@ dictiter_iternextitem(dictiterobject *di)
}
i = di->di_pos;
- n = d->ma_keys->dk_nentries;
+ assert(i >= 0);
if (d->ma_values) {
- PyObject **value_ptr = &d->ma_values[i];
- while (i < n && *value_ptr == NULL) {
- value_ptr++;
- i++;
- }
- if (i >= n)
+ if (i >= d->ma_used)
goto fail;
key = DK_ENTRIES(d->ma_keys)[i].me_key;
- value = *value_ptr;
+ value = d->ma_values[i];
+ assert(value != NULL);
}
else {
+ Py_ssize_t n = d->ma_keys->dk_nentries;
PyDictKeyEntry *entry_ptr = &DK_ENTRIES(d->ma_keys)[i];
while (i < n && entry_ptr->me_value == NULL) {
entry_ptr++;
diff --git a/Objects/enumobject.c b/Objects/enumobject.c
index dae166d5ad..480768fbde 100644
--- a/Objects/enumobject.c
+++ b/Objects/enumobject.c
@@ -2,6 +2,14 @@
#include "Python.h"
+#include "clinic/enumobject.c.h"
+
+/*[clinic input]
+class enumerate "enumobject *" "&PyEnum_Type"
+class reversed "reversedobject *" "&PyReversed_Type"
+[clinic start generated code]*/
+/*[clinic end generated code: output=da39a3ee5e6b4b0d input=d2dfdf1a88c88975]*/
+
typedef struct {
PyObject_HEAD
Py_ssize_t en_index; /* current index of enumeration */
@@ -10,17 +18,29 @@ typedef struct {
PyObject* en_longindex; /* index for sequences >= PY_SSIZE_T_MAX */
} enumobject;
+
+/*[clinic input]
+@classmethod
+enumerate.__new__ as enum_new
+
+ iterable: object
+ an object supporting iteration
+ start: object = 0
+
+Return an enumerate object.
+
+The enumerate object yields pairs containing a count (from start, which
+defaults to zero) and a value yielded by the iterable argument.
+
+enumerate is useful for obtaining an indexed list:
+ (0, seq[0]), (1, seq[1]), (2, seq[2]), ...
+[clinic start generated code]*/
+
static PyObject *
-enum_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+enum_new_impl(PyTypeObject *type, PyObject *iterable, PyObject *start)
+/*[clinic end generated code: output=e95e6e439f812c10 input=782e4911efcb8acf]*/
{
enumobject *en;
- PyObject *seq = NULL;
- PyObject *start = NULL;
- static char *kwlist[] = {"iterable", "start", 0};
-
- if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|O:enumerate", kwlist,
- &seq, &start))
- return NULL;
en = (enumobject *)type->tp_alloc(type, 0);
if (en == NULL)
@@ -45,7 +65,7 @@ enum_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
en->en_index = 0;
en->en_longindex = NULL;
}
- en->en_sit = PyObject_GetIter(seq);
+ en->en_sit = PyObject_GetIter(iterable);
if (en->en_sit == NULL) {
Py_DECREF(en);
return NULL;
@@ -174,15 +194,6 @@ static PyMethodDef enum_methods[] = {
{NULL, NULL} /* sentinel */
};
-PyDoc_STRVAR(enum_doc,
-"enumerate(iterable[, start]) -> iterator for index, value of iterable\n"
-"\n"
-"Return an enumerate object. iterable must be another object that supports\n"
-"iteration. The enumerate object yields pairs containing a count (from\n"
-"start, which defaults to zero) and a value yielded by the iterable argument.\n"
-"enumerate is useful for obtaining an indexed list:\n"
-" (0, seq[0]), (1, seq[1]), (2, seq[2]), ...");
-
PyTypeObject PyEnum_Type = {
PyVarObject_HEAD_INIT(&PyType_Type, 0)
"enumerate", /* tp_name */
@@ -205,13 +216,13 @@ PyTypeObject PyEnum_Type = {
0, /* tp_setattro */
0, /* tp_as_buffer */
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC |
- Py_TPFLAGS_BASETYPE, /* tp_flags */
- enum_doc, /* tp_doc */
+ Py_TPFLAGS_BASETYPE, /* tp_flags */
+ enum_new__doc__, /* tp_doc */
(traverseproc)enum_traverse, /* tp_traverse */
0, /* tp_clear */
0, /* tp_richcompare */
0, /* tp_weaklistoffset */
- PyObject_SelfIter, /* tp_iter */
+ PyObject_SelfIter, /* tp_iter */
(iternextfunc)enum_next, /* tp_iternext */
enum_methods, /* tp_methods */
0, /* tp_members */
@@ -235,20 +246,25 @@ typedef struct {
PyObject* seq;
} reversedobject;
+/*[clinic input]
+@classmethod
+reversed.__new__ as reversed_new
+
+ sequence as seq: object
+ /
+
+Return a reverse iterator over the values of the given sequence.
+[clinic start generated code]*/
+
static PyObject *
-reversed_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+reversed_new_impl(PyTypeObject *type, PyObject *seq)
+/*[clinic end generated code: output=f7854cc1df26f570 input=aeb720361e5e3f1d]*/
{
Py_ssize_t n;
- PyObject *seq, *reversed_meth;
+ PyObject *reversed_meth;
reversedobject *ro;
_Py_IDENTIFIER(__reversed__);
- if (type == &PyReversed_Type && !_PyArg_NoKeywords("reversed()", kwds))
- return NULL;
-
- if (!PyArg_UnpackTuple(args, "reversed", 1, 1, &seq) )
- return NULL;
-
reversed_meth = _PyObject_LookupSpecial(seq, &PyId___reversed__);
if (reversed_meth == Py_None) {
Py_DECREF(reversed_meth);
@@ -258,7 +274,7 @@ reversed_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
return NULL;
}
if (reversed_meth != NULL) {
- PyObject *res = PyObject_CallFunctionObjArgs(reversed_meth, NULL);
+ PyObject *res = _PyObject_CallNoArg(reversed_meth);
Py_DECREF(reversed_meth);
return res;
}
@@ -322,11 +338,6 @@ reversed_next(reversedobject *ro)
return NULL;
}
-PyDoc_STRVAR(reversed_doc,
-"reversed(sequence) -> reverse iterator over values of the sequence\n"
-"\n"
-"Return a reverse iterator");
-
static PyObject *
reversed_len(reversedobject *ro)
{
@@ -393,7 +404,7 @@ PyTypeObject PyReversed_Type = {
0, /* tp_reserved */
0, /* tp_repr */
0, /* tp_as_number */
- 0, /* tp_as_sequence */
+ 0, /* tp_as_sequence */
0, /* tp_as_mapping */
0, /* tp_hash */
0, /* tp_call */
@@ -402,15 +413,15 @@ PyTypeObject PyReversed_Type = {
0, /* tp_setattro */
0, /* tp_as_buffer */
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC |
- Py_TPFLAGS_BASETYPE, /* tp_flags */
- reversed_doc, /* tp_doc */
+ Py_TPFLAGS_BASETYPE, /* tp_flags */
+ reversed_new__doc__, /* tp_doc */
(traverseproc)reversed_traverse,/* tp_traverse */
0, /* tp_clear */
0, /* tp_richcompare */
0, /* tp_weaklistoffset */
- PyObject_SelfIter, /* tp_iter */
+ PyObject_SelfIter, /* tp_iter */
(iternextfunc)reversed_next, /* tp_iternext */
- reversediter_methods, /* tp_methods */
+ reversediter_methods, /* tp_methods */
0, /* tp_members */
0, /* tp_getset */
0, /* tp_base */
diff --git a/Objects/exceptions.c b/Objects/exceptions.c
index f63f06a145..35a8b66e01 100644
--- a/Objects/exceptions.c
+++ b/Objects/exceptions.c
@@ -184,8 +184,7 @@ static PyObject *
BaseException_get_args(PyBaseExceptionObject *self)
{
if (self->args == NULL) {
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
Py_INCREF(self->args);
return self->args;
@@ -210,8 +209,7 @@ static PyObject *
BaseException_get_tb(PyBaseExceptionObject *self)
{
if (self->traceback == NULL) {
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
Py_INCREF(self->traceback);
return self->traceback;
@@ -631,19 +629,17 @@ ImportError_init(PyImportErrorObject *self, PyObject *args, PyObject *kwds)
}
Py_DECREF(empty_tuple);
- if (name) {
- Py_INCREF(name);
- Py_XSETREF(self->name, name);
- }
- if (path) {
- Py_INCREF(path);
- Py_XSETREF(self->path, path);
- }
+ Py_XINCREF(name);
+ Py_XSETREF(self->name, name);
+
+ Py_XINCREF(path);
+ Py_XSETREF(self->path, path);
+
if (PyTuple_GET_SIZE(args) == 1) {
msg = PyTuple_GET_ITEM(args, 0);
Py_INCREF(msg);
- Py_XSETREF(self->msg, msg);
}
+ Py_XSETREF(self->msg, msg);
return 0;
}
@@ -1822,18 +1818,10 @@ UnicodeEncodeError_init(PyObject *self, PyObject *args, PyObject *kwds)
Py_CLEAR(err->object);
Py_CLEAR(err->reason);
- if (!PyArg_ParseTuple(args, "O!O!nnO!",
- &PyUnicode_Type, &err->encoding,
- &PyUnicode_Type, &err->object,
- &err->start,
- &err->end,
- &PyUnicode_Type, &err->reason)) {
- err->encoding = err->object = err->reason = NULL;
- return -1;
- }
-
- if (PyUnicode_READY(err->object) < -1) {
- err->encoding = NULL;
+ if (!PyArg_ParseTuple(args, "UUnnU",
+ &err->encoding, &err->object,
+ &err->start, &err->end, &err->reason)) {
+ err->encoding = err->object = err->reason = NULL;
return -1;
}
@@ -1937,12 +1925,9 @@ UnicodeDecodeError_init(PyObject *self, PyObject *args, PyObject *kwds)
Py_CLEAR(ude->object);
Py_CLEAR(ude->reason);
- if (!PyArg_ParseTuple(args, "O!OnnO!",
- &PyUnicode_Type, &ude->encoding,
- &ude->object,
- &ude->start,
- &ude->end,
- &PyUnicode_Type, &ude->reason)) {
+ if (!PyArg_ParseTuple(args, "UOnnU",
+ &ude->encoding, &ude->object,
+ &ude->start, &ude->end, &ude->reason)) {
ude->encoding = ude->object = ude->reason = NULL;
return -1;
}
@@ -2052,11 +2037,9 @@ UnicodeTranslateError_init(PyUnicodeErrorObject *self, PyObject *args,
Py_CLEAR(self->object);
Py_CLEAR(self->reason);
- if (!PyArg_ParseTuple(args, "O!nnO!",
- &PyUnicode_Type, &self->object,
- &self->start,
- &self->end,
- &PyUnicode_Type, &self->reason)) {
+ if (!PyArg_ParseTuple(args, "UnnU",
+ &self->object,
+ &self->start, &self->end, &self->reason)) {
self->object = self->reason = NULL;
return -1;
}
diff --git a/Objects/fileobject.c b/Objects/fileobject.c
index f4424184d2..3c3d46da51 100644
--- a/Objects/fileobject.c
+++ b/Objects/fileobject.c
@@ -146,7 +146,7 @@ PyFile_WriteObject(PyObject *v, PyObject *f, int flags)
Py_DECREF(writer);
return -1;
}
- result = _PyObject_CallArg1(writer, value);
+ result = PyObject_CallFunctionObjArgs(writer, value, NULL);
Py_DECREF(value);
Py_DECREF(writer);
if (result == NULL)
@@ -367,7 +367,7 @@ stdprinter_write(PyStdPrinter_Object *self, PyObject *args)
{
PyObject *unicode;
PyObject *bytes = NULL;
- char *str;
+ const char *str;
Py_ssize_t n;
int err;
@@ -389,10 +389,8 @@ stdprinter_write(PyStdPrinter_Object *self, PyObject *args)
bytes = _PyUnicode_AsUTF8String(unicode, "backslashreplace");
if (bytes == NULL)
return NULL;
- if (PyBytes_AsStringAndSize(bytes, &str, &n) < 0) {
- Py_DECREF(bytes);
- return NULL;
- }
+ str = PyBytes_AS_STRING(bytes);
+ n = PyBytes_GET_SIZE(bytes);
}
n = _Py_write(self->fd, str, n);
@@ -458,8 +456,7 @@ static PyMethodDef stdprinter_methods[] = {
static PyObject *
get_closed(PyStdPrinter_Object *self, void *closure)
{
- Py_INCREF(Py_False);
- return Py_False;
+ Py_RETURN_FALSE;
}
static PyObject *
diff --git a/Objects/floatobject.c b/Objects/floatobject.c
index 80bf71efd2..17a55dd114 100644
--- a/Objects/floatobject.c
+++ b/Objects/floatobject.c
@@ -1225,7 +1225,7 @@ float_fromhex(PyObject *cls, PyObject *arg)
PyObject *result;
double x;
long exp, top_exp, lsb, key_digit;
- char *s, *coeff_start, *s_store, *coeff_end, *exp_start, *s_end;
+ const char *s, *coeff_start, *s_store, *coeff_end, *exp_start, *s_end;
int half_eps, digit, round_up, negate=0;
Py_ssize_t length, ndigits, fdigits, i;
@@ -1288,7 +1288,7 @@ float_fromhex(PyObject *cls, PyObject *arg)
s++;
/* infinities and nans */
- x = _Py_parse_inf_or_nan(s, &coeff_end);
+ x = _Py_parse_inf_or_nan(s, (char **)&coeff_end);
if (coeff_end != s) {
s = coeff_end;
goto finished;
@@ -1619,7 +1619,7 @@ static float_format_type detected_double_format, detected_float_format;
static PyObject *
float_getformat(PyTypeObject *v, PyObject* arg)
{
- char* s;
+ const char *s;
float_format_type r;
if (!PyUnicode_Check(arg)) {
diff --git a/Objects/frameobject.c b/Objects/frameobject.c
index 62f9f34c8e..84483195ab 100644
--- a/Objects/frameobject.c
+++ b/Objects/frameobject.c
@@ -409,13 +409,15 @@ static int numfree = 0; /* number of frames currently in free_list */
/* max value for numfree */
#define PyFrame_MAXFREELIST 200
-static void
+static void _Py_HOT_FUNCTION
frame_dealloc(PyFrameObject *f)
{
PyObject **p, **valuestack;
PyCodeObject *co;
- PyObject_GC_UnTrack(f);
+ if (_PyObject_GC_IS_TRACKED(f))
+ _PyObject_GC_UNTRACK(f);
+
Py_TRASHCAN_SAFE_BEGIN(f)
/* Kill all local variables */
valuestack = f->f_valuestack;
@@ -605,9 +607,9 @@ int _PyFrame_Init()
return 1;
}
-PyFrameObject *
-PyFrame_New(PyThreadState *tstate, PyCodeObject *code, PyObject *globals,
- PyObject *locals)
+PyFrameObject* _Py_HOT_FUNCTION
+_PyFrame_New_NoTrack(PyThreadState *tstate, PyCodeObject *code,
+ PyObject *globals, PyObject *locals)
{
PyFrameObject *back = tstate->frame;
PyFrameObject *f;
@@ -727,10 +729,20 @@ PyFrame_New(PyThreadState *tstate, PyCodeObject *code, PyObject *globals,
f->f_executing = 0;
f->f_gen = NULL;
- _PyObject_GC_TRACK(f);
return f;
}
+PyFrameObject*
+PyFrame_New(PyThreadState *tstate, PyCodeObject *code,
+ PyObject *globals, PyObject *locals)
+{
+ PyFrameObject *f = _PyFrame_New_NoTrack(tstate, code, globals, locals);
+ if (f)
+ _PyObject_GC_TRACK(f);
+ return f;
+}
+
+
/* Block management */
void
diff --git a/Objects/funcobject.c b/Objects/funcobject.c
index 69cd973384..8ac88b15df 100644
--- a/Objects/funcobject.c
+++ b/Objects/funcobject.c
@@ -322,8 +322,7 @@ static PyObject *
func_get_defaults(PyFunctionObject *op)
{
if (op->func_defaults == NULL) {
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
Py_INCREF(op->func_defaults);
return op->func_defaults;
@@ -350,8 +349,7 @@ static PyObject *
func_get_kwdefaults(PyFunctionObject *op)
{
if (op->func_kwdefaults == NULL) {
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
Py_INCREF(op->func_kwdefaults);
return op->func_kwdefaults;
@@ -563,55 +561,14 @@ func_traverse(PyFunctionObject *f, visitproc visit, void *arg)
}
static PyObject *
-function_call(PyObject *func, PyObject *arg, PyObject *kw)
+function_call(PyObject *func, PyObject *args, PyObject *kwargs)
{
- PyObject *result;
- PyObject *argdefs;
- PyObject *kwtuple = NULL;
- PyObject **d, **k;
- Py_ssize_t nk, nd;
-
- argdefs = PyFunction_GET_DEFAULTS(func);
- if (argdefs != NULL && PyTuple_Check(argdefs)) {
- d = &PyTuple_GET_ITEM((PyTupleObject *)argdefs, 0);
- nd = PyTuple_GET_SIZE(argdefs);
- }
- else {
- d = NULL;
- nd = 0;
- }
-
- if (kw != NULL && PyDict_Check(kw)) {
- Py_ssize_t pos, i;
- nk = PyDict_Size(kw);
- kwtuple = PyTuple_New(2*nk);
- if (kwtuple == NULL)
- return NULL;
- k = &PyTuple_GET_ITEM(kwtuple, 0);
- pos = i = 0;
- while (PyDict_Next(kw, &pos, &k[i], &k[i+1])) {
- Py_INCREF(k[i]);
- Py_INCREF(k[i+1]);
- i += 2;
- }
- nk = i/2;
- }
- else {
- k = NULL;
- nk = 0;
- }
-
- result = PyEval_EvalCodeEx(
- PyFunction_GET_CODE(func),
- PyFunction_GET_GLOBALS(func), (PyObject *)NULL,
- &PyTuple_GET_ITEM(arg, 0), PyTuple_GET_SIZE(arg),
- k, nk, d, nd,
- PyFunction_GET_KW_DEFAULTS(func),
- PyFunction_GET_CLOSURE(func));
-
- Py_XDECREF(kwtuple);
+ PyObject **stack;
+ Py_ssize_t nargs;
- return result;
+ stack = &PyTuple_GET_ITEM(args, 0);
+ nargs = PyTuple_GET_SIZE(args);
+ return _PyFunction_FastCallDict(func, stack, nargs, kwargs);
}
/* Bind a function to an object */
diff --git a/Objects/genobject.c b/Objects/genobject.c
index 2680ab0e12..24a1da6f3e 100644
--- a/Objects/genobject.c
+++ b/Objects/genobject.c
@@ -402,8 +402,7 @@ gen_close(PyGenObject *gen, PyObject *args)
if (PyErr_ExceptionMatches(PyExc_StopIteration)
|| PyErr_ExceptionMatches(PyExc_GeneratorExit)) {
PyErr_Clear(); /* ignore these errors */
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
return NULL;
}
@@ -1341,7 +1340,7 @@ async_gen_init_hooks(PyAsyncGenObject *o)
PyObject *res;
Py_INCREF(firstiter);
- res = PyObject_CallFunction(firstiter, "O", o);
+ res = PyObject_CallFunctionObjArgs(firstiter, o, NULL);
Py_DECREF(firstiter);
if (res == NULL) {
return 1;
diff --git a/Objects/listobject.c b/Objects/listobject.c
index dcd7b5efe5..89941749d4 100644
--- a/Objects/listobject.c
+++ b/Objects/listobject.c
@@ -804,6 +804,9 @@ listextend(PyListObject *self, PyObject *b)
Py_RETURN_NONE;
}
m = Py_SIZE(self);
+ /* It should not be possible to allocate a list large enough to cause
+ an overflow on any relevant platform */
+ assert(m < PY_SSIZE_T_MAX - n);
if (list_resize(self, m + n) < 0) {
Py_DECREF(b);
return NULL;
@@ -1909,7 +1912,7 @@ reverse_sortslice(sortslice *s, Py_ssize_t n)
* duplicated).
*/
static PyObject *
-listsort(PyListObject *self, PyObject *args, PyObject *kwds)
+listsort_impl(PyListObject *self, PyObject *keyfunc, int reverse)
{
MergeState ms;
Py_ssize_t nremaining;
@@ -1919,24 +1922,11 @@ listsort(PyListObject *self, PyObject *args, PyObject *kwds)
PyObject **saved_ob_item;
PyObject **final_ob_item;
PyObject *result = NULL; /* guilty until proved innocent */
- int reverse = 0;
- PyObject *keyfunc = NULL;
Py_ssize_t i;
- static char *kwlist[] = {"key", "reverse", 0};
PyObject **keys;
assert(self != NULL);
assert (PyList_Check(self));
- if (args != NULL) {
- if (!PyArg_ParseTupleAndKeywords(args, kwds, "|Oi:sort",
- kwlist, &keyfunc, &reverse))
- return NULL;
- if (Py_SIZE(args) > 0) {
- PyErr_SetString(PyExc_TypeError,
- "must use keyword argument for key function");
- return NULL;
- }
- }
if (keyfunc == Py_None)
keyfunc = NULL;
@@ -2085,6 +2075,19 @@ keyfunc_fail:
#undef IFLT
#undef ISLT
+static PyObject *
+listsort(PyListObject *self, PyObject *args, PyObject *kwds)
+{
+ static char *kwlist[] = {"key", "reverse", 0};
+ PyObject *keyfunc = NULL;
+ int reverse = 0;
+
+ if (!PyArg_ParseTupleAndKeywords(args, kwds, "|$Oi:sort",
+ kwlist, &keyfunc, &reverse))
+ return NULL;
+ return listsort_impl(self, keyfunc, reverse);
+}
+
int
PyList_Sort(PyObject *v)
{
@@ -2092,7 +2095,7 @@ PyList_Sort(PyObject *v)
PyErr_BadInternalCall();
return -1;
}
- v = listsort((PyListObject *)v, (PyObject *)NULL, (PyObject *)NULL);
+ v = listsort_impl((PyListObject *)v, NULL, 0);
if (v == NULL)
return -1;
Py_DECREF(v);
@@ -2281,12 +2284,10 @@ list_richcompare(PyObject *v, PyObject *w, int op)
/* We have an item that differs -- shortcuts for EQ/NE */
if (op == Py_EQ) {
- Py_INCREF(Py_False);
- return Py_False;
+ Py_RETURN_FALSE;
}
if (op == Py_NE) {
- Py_INCREF(Py_True);
- return Py_True;
+ Py_RETURN_TRUE;
}
/* Compare the final item again using the proper operator */
diff --git a/Objects/longobject.c b/Objects/longobject.c
index ad239ce84e..0bf6cee6c1 100644
--- a/Objects/longobject.c
+++ b/Objects/longobject.c
@@ -9,6 +9,12 @@
#include <ctype.h>
#include <stddef.h>
+#include "clinic/longobject.c.h"
+/*[clinic input]
+class int "PyObject *" "&PyLong_Type"
+[clinic start generated code]*/
+/*[clinic end generated code: output=da39a3ee5e6b4b0d input=ec0275e3422a36e3]*/
+
#ifndef NSMALLPOSINTS
#define NSMALLPOSINTS 257
#endif
@@ -16,6 +22,9 @@
#define NSMALLNEGINTS 5
#endif
+_Py_IDENTIFIER(little);
+_Py_IDENTIFIER(big);
+
/* convert a PyLong of size 1, 0 or -1 to an sdigit */
#define MEDIUM_VALUE(x) (assert(-1 <= Py_SIZE(x) && Py_SIZE(x) <= 1), \
Py_SIZE(x) < 0 ? -(sdigit)(x)->ob_digit[0] : \
@@ -315,7 +324,6 @@ PyLong_FromUnsignedLong(unsigned long ival)
v = _PyLong_New(ndigits);
if (v != NULL) {
digit *p = v->ob_digit;
- Py_SIZE(v) = ndigits;
while (ival) {
*p++ = (digit)(ival & PyLong_MASK);
ival >>= PyLong_SHIFT;
@@ -709,12 +717,33 @@ _PyLong_Sign(PyObject *vv)
return Py_SIZE(v) == 0 ? 0 : (Py_SIZE(v) < 0 ? -1 : 1);
}
+/* bits_in_digit(d) returns the unique integer k such that 2**(k-1) <= d <
+ 2**k if d is nonzero, else 0. */
+
+static const unsigned char BitLengthTable[32] = {
+ 0, 1, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4,
+ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5
+};
+
+static int
+bits_in_digit(digit d)
+{
+ int d_bits = 0;
+ while (d >= 32) {
+ d_bits += 6;
+ d >>= 6;
+ }
+ d_bits += (int)BitLengthTable[d];
+ return d_bits;
+}
+
size_t
_PyLong_NumBits(PyObject *vv)
{
PyLongObject *v = (PyLongObject *)vv;
size_t result = 0;
Py_ssize_t ndigits;
+ int msd_bits;
assert(v != NULL);
assert(PyLong_Check(v));
@@ -725,12 +754,10 @@ _PyLong_NumBits(PyObject *vv)
if ((size_t)(ndigits - 1) > SIZE_MAX / (size_t)PyLong_SHIFT)
goto Overflow;
result = (size_t)(ndigits - 1) * (size_t)PyLong_SHIFT;
- do {
- ++result;
- if (result == 0)
- goto Overflow;
- msd >>= 1;
- } while (msd);
+ msd_bits = bits_in_digit(msd);
+ if (SIZE_MAX - msd_bits < result)
+ goto Overflow;
+ result += msd_bits;
}
return result;
@@ -1102,7 +1129,6 @@ PyLong_FromUnsignedLongLong(unsigned long long ival)
v = _PyLong_New(ndigits);
if (v != NULL) {
digit *p = v->ob_digit;
- Py_SIZE(v) = ndigits;
while (ival) {
*p++ = (digit)(ival & PyLong_MASK);
ival >>= PyLong_SHIFT;
@@ -1416,26 +1442,6 @@ PyLong_AsLongLongAndOverflow(PyObject *vv, int *overflow)
Py_RETURN_NOTIMPLEMENTED; \
} while(0)
-/* bits_in_digit(d) returns the unique integer k such that 2**(k-1) <= d <
- 2**k if d is nonzero, else 0. */
-
-static const unsigned char BitLengthTable[32] = {
- 0, 1, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5
-};
-
-static int
-bits_in_digit(digit d)
-{
- int d_bits = 0;
- while (d >= 32) {
- d_bits += 6;
- d >>= 6;
- }
- d_bits += (int)BitLengthTable[d];
- return d_bits;
-}
-
/* x[0:m] and y[0:n] are digit vectors, LSD first, m >= n required. x[0:n]
* is modified in place, by adding y to it. Carries are propagated as far as
* x[m-1], and the remaining carry (0 or 1) is returned.
@@ -2482,7 +2488,7 @@ _PyLong_FromBytes(const char *s, Py_ssize_t len, int base)
PyObject *
PyLong_FromUnicode(Py_UNICODE *u, Py_ssize_t length, int base)
{
- PyObject *v, *unicode = PyUnicode_FromUnicode(u, length);
+ PyObject *v, *unicode = PyUnicode_FromWideChar(u, length);
if (unicode == NULL)
return NULL;
v = PyLong_FromUnicodeObject(unicode, base);
@@ -2494,7 +2500,8 @@ PyObject *
PyLong_FromUnicodeObject(PyObject *u, int base)
{
PyObject *result, *asciidig;
- char *buffer, *end = NULL;
+ const char *buffer;
+ char *end = NULL;
Py_ssize_t buflen;
asciidig = _PyUnicode_TransformDecimalAndSpaceToASCII(u);
@@ -3105,9 +3112,7 @@ long_add(PyLongObject *a, PyLongObject *b)
CHECK_BINOP(a, b);
if (Py_ABS(Py_SIZE(a)) <= 1 && Py_ABS(Py_SIZE(b)) <= 1) {
- PyObject *result = PyLong_FromLong(MEDIUM_VALUE(a) +
- MEDIUM_VALUE(b));
- return result;
+ return PyLong_FromLong(MEDIUM_VALUE(a) + MEDIUM_VALUE(b));
}
if (Py_SIZE(a) < 0) {
if (Py_SIZE(b) < 0) {
@@ -3141,9 +3146,7 @@ long_sub(PyLongObject *a, PyLongObject *b)
CHECK_BINOP(a, b);
if (Py_ABS(Py_SIZE(a)) <= 1 && Py_ABS(Py_SIZE(b)) <= 1) {
- PyObject* r;
- r = PyLong_FromLong(MEDIUM_VALUE(a)-MEDIUM_VALUE(b));
- return r;
+ return PyLong_FromLong(MEDIUM_VALUE(a) - MEDIUM_VALUE(b));
}
if (Py_SIZE(a) < 0) {
if (Py_SIZE(b) < 0)
@@ -4296,22 +4299,22 @@ long_rshift(PyLongObject *a, PyLongObject *b)
PyLongObject *a1, *a2;
a1 = (PyLongObject *) long_invert(a);
if (a1 == NULL)
- goto rshift_error;
+ return NULL;
a2 = (PyLongObject *) long_rshift(a1, b);
Py_DECREF(a1);
if (a2 == NULL)
- goto rshift_error;
+ return NULL;
z = (PyLongObject *) long_invert(a2);
Py_DECREF(a2);
}
else {
shiftby = PyLong_AsSsize_t((PyObject *)b);
if (shiftby == -1L && PyErr_Occurred())
- goto rshift_error;
+ return NULL;
if (shiftby < 0) {
PyErr_SetString(PyExc_ValueError,
"negative shift count");
- goto rshift_error;
+ return NULL;
}
wordshift = shiftby / PyLong_SHIFT;
newsize = Py_ABS(Py_SIZE(a)) - wordshift;
@@ -4323,19 +4326,15 @@ long_rshift(PyLongObject *a, PyLongObject *b)
himask = PyLong_MASK ^ lomask;
z = _PyLong_New(newsize);
if (z == NULL)
- goto rshift_error;
- if (Py_SIZE(a) < 0)
- Py_SIZE(z) = -(Py_SIZE(z));
+ return NULL;
for (i = 0, j = wordshift; i < newsize; i++, j++) {
z->ob_digit[i] = (a->ob_digit[j] >> loshift) & lomask;
if (i+1 < newsize)
z->ob_digit[i] |= (a->ob_digit[j+1] << hishift) & himask;
}
- z = long_normalize(z);
+ z = maybe_small_long(long_normalize(z));
}
- rshift_error:
- return (PyObject *) maybe_small_long(z);
-
+ return (PyObject *)z;
}
static PyObject *
@@ -4873,10 +4872,15 @@ long_subtype_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
return (PyObject *)newobj;
}
+/*[clinic input]
+int.__getnewargs__
+[clinic start generated code]*/
+
static PyObject *
-long_getnewargs(PyLongObject *v)
+int___getnewargs___impl(PyObject *self)
+/*[clinic end generated code: output=839a49de3f00b61b input=5904770ab1fb8c75]*/
{
- return Py_BuildValue("(N)", _PyLong_Copy(v));
+ return Py_BuildValue("(N)", _PyLong_Copy((PyLongObject *)self));
}
static PyObject *
@@ -4889,16 +4893,20 @@ long_get1(PyLongObject *v, void *context) {
return PyLong_FromLong(1L);
}
+/*[clinic input]
+int.__format__
+
+ format_spec: unicode
+ /
+[clinic start generated code]*/
+
static PyObject *
-long__format__(PyObject *self, PyObject *args)
+int___format___impl(PyObject *self, PyObject *format_spec)
+/*[clinic end generated code: output=b4929dee9ae18689 input=e31944a9b3e428b7]*/
{
- PyObject *format_spec;
_PyUnicodeWriter writer;
int ret;
- if (!PyArg_ParseTuple(args, "U:__format__", &format_spec))
- return NULL;
-
_PyUnicodeWriter_Init(&writer);
ret = _PyLong_FormatAdvancedWriter(
&writer,
@@ -5076,35 +5084,51 @@ long_round(PyObject *self, PyObject *args)
return result;
}
-static PyObject *
-long_sizeof(PyLongObject *v)
+/*[clinic input]
+int.__sizeof__ -> Py_ssize_t
+
+Returns size in memory, in bytes.
+[clinic start generated code]*/
+
+static Py_ssize_t
+int___sizeof___impl(PyObject *self)
+/*[clinic end generated code: output=3303f008eaa6a0a5 input=9b51620c76fc4507]*/
{
Py_ssize_t res;
- res = offsetof(PyLongObject, ob_digit) + Py_ABS(Py_SIZE(v))*sizeof(digit);
- return PyLong_FromSsize_t(res);
+ res = offsetof(PyLongObject, ob_digit) + Py_ABS(Py_SIZE(self))*sizeof(digit);
+ return res;
}
+/*[clinic input]
+int.bit_length
+
+Number of bits necessary to represent self in binary.
+
+>>> bin(37)
+'0b100101'
+>>> (37).bit_length()
+6
+[clinic start generated code]*/
+
static PyObject *
-long_bit_length(PyLongObject *v)
+int_bit_length_impl(PyObject *self)
+/*[clinic end generated code: output=fc1977c9353d6a59 input=e4eb7a587e849a32]*/
{
PyLongObject *result, *x, *y;
- Py_ssize_t ndigits, msd_bits = 0;
+ Py_ssize_t ndigits;
+ int msd_bits;
digit msd;
- assert(v != NULL);
- assert(PyLong_Check(v));
+ assert(self != NULL);
+ assert(PyLong_Check(self));
- ndigits = Py_ABS(Py_SIZE(v));
+ ndigits = Py_ABS(Py_SIZE(self));
if (ndigits == 0)
return PyLong_FromLong(0);
- msd = v->ob_digit[ndigits-1];
- while (msd >= 32) {
- msd_bits += 6;
- msd >>= 6;
- }
- msd_bits += (long)(BitLengthTable[msd]);
+ msd = ((PyLongObject *)self)->ob_digit[ndigits-1];
+ msd_bits = bits_in_digit(msd);
if (ndigits <= PY_SSIZE_T_MAX/PyLong_SHIFT)
return PyLong_FromSsize_t((ndigits-1)*PyLong_SHIFT + msd_bits);
@@ -5140,15 +5164,6 @@ long_bit_length(PyLongObject *v)
return NULL;
}
-PyDoc_STRVAR(long_bit_length_doc,
-"int.bit_length() -> int\n\
-\n\
-Number of bits necessary to represent self in binary.\n\
->>> bin(37)\n\
-'0b100101'\n\
->>> (37).bit_length()\n\
-6");
-
#if 0
static PyObject *
long_is_finite(PyObject *v)
@@ -5157,32 +5172,38 @@ long_is_finite(PyObject *v)
}
#endif
+/*[clinic input]
+int.to_bytes
+
+ length: Py_ssize_t
+ Length of bytes object to use. An OverflowError is raised if the
+ integer is not representable with the given number of bytes.
+ byteorder: unicode
+ The byte order used to represent the integer. If byteorder is 'big',
+ the most significant byte is at the beginning of the byte array. If
+ byteorder is 'little', the most significant byte is at the end of the
+ byte array. To request the native byte order of the host system, use
+ `sys.byteorder' as the byte order value.
+ *
+ signed as is_signed: bool = False
+ Determines whether two's complement is used to represent the integer.
+ If signed is False and a negative integer is given, an OverflowError
+ is raised.
+
+Return an array of bytes representing an integer.
+[clinic start generated code]*/
static PyObject *
-long_to_bytes(PyLongObject *v, PyObject *args, PyObject *kwds)
+int_to_bytes_impl(PyObject *self, Py_ssize_t length, PyObject *byteorder,
+ int is_signed)
+/*[clinic end generated code: output=89c801df114050a3 input=ddac63f4c7bf414c]*/
{
- PyObject *byteorder_str;
- PyObject *is_signed_obj = NULL;
- Py_ssize_t length;
int little_endian;
- int is_signed;
PyObject *bytes;
- static char *kwlist[] = {"length", "byteorder", "signed", NULL};
-
- if (!PyArg_ParseTupleAndKeywords(args, kwds, "nU|O:to_bytes", kwlist,
- &length, &byteorder_str,
- &is_signed_obj))
- return NULL;
-
- if (args != NULL && Py_SIZE(args) > 2) {
- PyErr_SetString(PyExc_TypeError,
- "'signed' is a keyword-only argument");
- return NULL;
- }
- if (_PyUnicode_EqualToASCIIString(byteorder_str, "little"))
+ if (_PyUnicode_EqualToASCIIId(byteorder, &PyId_little))
little_endian = 1;
- else if (_PyUnicode_EqualToASCIIString(byteorder_str, "big"))
+ else if (_PyUnicode_EqualToASCIIId(byteorder, &PyId_big))
little_endian = 0;
else {
PyErr_SetString(PyExc_ValueError,
@@ -5190,18 +5211,6 @@ long_to_bytes(PyLongObject *v, PyObject *args, PyObject *kwds)
return NULL;
}
- if (is_signed_obj != NULL) {
- int cmp = PyObject_IsTrue(is_signed_obj);
- if (cmp < 0)
- return NULL;
- is_signed = cmp ? 1 : 0;
- }
- else {
- /* If the signed argument was omitted, use False as the
- default. */
- is_signed = 0;
- }
-
if (length < 0) {
PyErr_SetString(PyExc_ValueError,
"length argument must be non-negative");
@@ -5212,7 +5221,8 @@ long_to_bytes(PyLongObject *v, PyObject *args, PyObject *kwds)
if (bytes == NULL)
return NULL;
- if (_PyLong_AsByteArray(v, (unsigned char *)PyBytes_AS_STRING(bytes),
+ if (_PyLong_AsByteArray((PyLongObject *)self,
+ (unsigned char *)PyBytes_AS_STRING(bytes),
length, little_endian, is_signed) < 0) {
Py_DECREF(bytes);
return NULL;
@@ -5221,51 +5231,39 @@ long_to_bytes(PyLongObject *v, PyObject *args, PyObject *kwds)
return bytes;
}
-PyDoc_STRVAR(long_to_bytes_doc,
-"int.to_bytes(length, byteorder, *, signed=False) -> bytes\n\
-\n\
-Return an array of bytes representing an integer.\n\
-\n\
-The integer is represented using length bytes. An OverflowError is\n\
-raised if the integer is not representable with the given number of\n\
-bytes.\n\
-\n\
-The byteorder argument determines the byte order used to represent the\n\
-integer. If byteorder is 'big', the most significant byte is at the\n\
-beginning of the byte array. If byteorder is 'little', the most\n\
-significant byte is at the end of the byte array. To request the native\n\
-byte order of the host system, use `sys.byteorder' as the byte order value.\n\
-\n\
-The signed keyword-only argument determines whether two's complement is\n\
-used to represent the integer. If signed is False and a negative integer\n\
-is given, an OverflowError is raised.");
+/*[clinic input]
+@classmethod
+int.from_bytes
+
+ bytes as bytes_obj: object
+ Holds the array of bytes to convert. The argument must either
+ support the buffer protocol or be an iterable object producing bytes.
+ Bytes and bytearray are examples of built-in objects that support the
+ buffer protocol.
+ byteorder: unicode
+ The byte order used to represent the integer. If byteorder is 'big',
+ the most significant byte is at the beginning of the byte array. If
+ byteorder is 'little', the most significant byte is at the end of the
+ byte array. To request the native byte order of the host system, use
+ `sys.byteorder' as the byte order value.
+ *
+ signed as is_signed: bool = False
+ Indicates whether two's complement is used to represent the integer.
+
+Return the integer represented by the given array of bytes.
+[clinic start generated code]*/
static PyObject *
-long_from_bytes(PyTypeObject *type, PyObject *args, PyObject *kwds)
+int_from_bytes_impl(PyTypeObject *type, PyObject *bytes_obj,
+ PyObject *byteorder, int is_signed)
+/*[clinic end generated code: output=efc5d68e31f9314f input=cdf98332b6a821b0]*/
{
- PyObject *byteorder_str;
- PyObject *is_signed_obj = NULL;
int little_endian;
- int is_signed;
- PyObject *obj;
- PyObject *bytes;
- PyObject *long_obj;
- static char *kwlist[] = {"bytes", "byteorder", "signed", NULL};
+ PyObject *long_obj, *bytes;
- if (!PyArg_ParseTupleAndKeywords(args, kwds, "OU|O:from_bytes", kwlist,
- &obj, &byteorder_str,
- &is_signed_obj))
- return NULL;
-
- if (args != NULL && Py_SIZE(args) > 2) {
- PyErr_SetString(PyExc_TypeError,
- "'signed' is a keyword-only argument");
- return NULL;
- }
-
- if (_PyUnicode_EqualToASCIIString(byteorder_str, "little"))
+ if (_PyUnicode_EqualToASCIIId(byteorder, &PyId_little))
little_endian = 1;
- else if (_PyUnicode_EqualToASCIIString(byteorder_str, "big"))
+ else if (_PyUnicode_EqualToASCIIId(byteorder, &PyId_big))
little_endian = 0;
else {
PyErr_SetString(PyExc_ValueError,
@@ -5273,19 +5271,7 @@ long_from_bytes(PyTypeObject *type, PyObject *args, PyObject *kwds)
return NULL;
}
- if (is_signed_obj != NULL) {
- int cmp = PyObject_IsTrue(is_signed_obj);
- if (cmp < 0)
- return NULL;
- is_signed = cmp ? 1 : 0;
- }
- else {
- /* If the signed argument was omitted, use False as the
- default. */
- is_signed = 0;
- }
-
- bytes = PyObject_Bytes(obj);
+ bytes = PyObject_Bytes(bytes_obj);
if (bytes == NULL)
return NULL;
@@ -5302,35 +5288,16 @@ long_from_bytes(PyTypeObject *type, PyObject *args, PyObject *kwds)
return long_obj;
}
-PyDoc_STRVAR(long_from_bytes_doc,
-"int.from_bytes(bytes, byteorder, *, signed=False) -> int\n\
-\n\
-Return the integer represented by the given array of bytes.\n\
-\n\
-The bytes argument must be a bytes-like object (e.g. bytes or bytearray).\n\
-\n\
-The byteorder argument determines the byte order used to represent the\n\
-integer. If byteorder is 'big', the most significant byte is at the\n\
-beginning of the byte array. If byteorder is 'little', the most\n\
-significant byte is at the end of the byte array. To request the native\n\
-byte order of the host system, use `sys.byteorder' as the byte order value.\n\
-\n\
-The signed keyword-only argument indicates whether two's complement is\n\
-used to represent the integer.");
-
static PyMethodDef long_methods[] = {
{"conjugate", (PyCFunction)long_long, METH_NOARGS,
"Returns self, the complex conjugate of any int."},
- {"bit_length", (PyCFunction)long_bit_length, METH_NOARGS,
- long_bit_length_doc},
+ INT_BIT_LENGTH_METHODDEF
#if 0
{"is_finite", (PyCFunction)long_is_finite, METH_NOARGS,
"Returns always True."},
#endif
- {"to_bytes", (PyCFunction)long_to_bytes,
- METH_VARARGS|METH_KEYWORDS, long_to_bytes_doc},
- {"from_bytes", (PyCFunction)long_from_bytes,
- METH_VARARGS|METH_KEYWORDS|METH_CLASS, long_from_bytes_doc},
+ INT_TO_BYTES_METHODDEF
+ INT_FROM_BYTES_METHODDEF
{"__trunc__", (PyCFunction)long_long, METH_NOARGS,
"Truncating an Integral returns itself."},
{"__floor__", (PyCFunction)long_long, METH_NOARGS,
@@ -5340,10 +5307,9 @@ static PyMethodDef long_methods[] = {
{"__round__", (PyCFunction)long_round, METH_VARARGS,
"Rounding an Integral returns itself.\n"
"Rounding with an ndigits argument also returns an integer."},
- {"__getnewargs__", (PyCFunction)long_getnewargs, METH_NOARGS},
- {"__format__", (PyCFunction)long__format__, METH_VARARGS},
- {"__sizeof__", (PyCFunction)long_sizeof, METH_NOARGS,
- "Returns size in memory, in bytes"},
+ INT___GETNEWARGS___METHODDEF
+ INT___FORMAT___METHODDEF
+ INT___SIZEOF___METHODDEF
{NULL, NULL} /* sentinel */
};
diff --git a/Objects/methodobject.c b/Objects/methodobject.c
index c2001f0169..d0fbefd550 100644
--- a/Objects/methodobject.c
+++ b/Objects/methodobject.c
@@ -77,163 +77,137 @@ PyCFunction_GetFlags(PyObject *op)
return PyCFunction_GET_FLAGS(op);
}
-PyObject *
-PyCFunction_Call(PyObject *func, PyObject *args, PyObject *kwds)
+static PyObject *
+cfunction_call_varargs(PyObject *func, PyObject *args, PyObject *kwargs)
{
- PyCFunctionObject* f = (PyCFunctionObject*)func;
+ assert(!PyErr_Occurred());
+
PyCFunction meth = PyCFunction_GET_FUNCTION(func);
PyObject *self = PyCFunction_GET_SELF(func);
- PyObject *arg, *res;
- Py_ssize_t size;
- int flags;
+ PyObject *result;
- /* PyCFunction_Call() must not be called with an exception set,
- because it may clear it (directly or indirectly) and so the
- caller loses its exception */
- assert(!PyErr_Occurred());
+ if (PyCFunction_GET_FLAGS(func) & METH_KEYWORDS) {
+ if (Py_EnterRecursiveCall(" while calling a Python object")) {
+ return NULL;
+ }
- flags = PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST);
+ result = (*(PyCFunctionWithKeywords)meth)(self, args, kwargs);
- if (flags == (METH_VARARGS | METH_KEYWORDS)) {
- res = (*(PyCFunctionWithKeywords)meth)(self, args, kwds);
- }
- else if (flags == METH_FASTCALL) {
- PyObject **stack = &PyTuple_GET_ITEM(args, 0);
- Py_ssize_t nargs = PyTuple_GET_SIZE(args);
- res = _PyCFunction_FastCallDict(func, stack, nargs, kwds);
+ Py_LeaveRecursiveCall();
}
else {
- if (kwds != NULL && PyDict_Size(kwds) != 0) {
+ if (kwargs != NULL && PyDict_Size(kwargs) != 0) {
PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments",
- f->m_ml->ml_name);
+ ((PyCFunctionObject*)func)->m_ml->ml_name);
return NULL;
}
- switch (flags) {
- case METH_VARARGS:
- res = (*meth)(self, args);
- break;
-
- case METH_NOARGS:
- size = PyTuple_GET_SIZE(args);
- if (size != 0) {
- PyErr_Format(PyExc_TypeError,
- "%.200s() takes no arguments (%zd given)",
- f->m_ml->ml_name, size);
- return NULL;
- }
+ if (Py_EnterRecursiveCall(" while calling a Python object")) {
+ return NULL;
+ }
- res = (*meth)(self, NULL);
- break;
+ result = (*meth)(self, args);
- case METH_O:
- size = PyTuple_GET_SIZE(args);
- if (size != 1) {
- PyErr_Format(PyExc_TypeError,
- "%.200s() takes exactly one argument (%zd given)",
- f->m_ml->ml_name, size);
- return NULL;
- }
+ Py_LeaveRecursiveCall();
+ }
- arg = PyTuple_GET_ITEM(args, 0);
- res = (*meth)(self, arg);
- break;
+ return _Py_CheckFunctionResult(func, result, NULL);
+}
- default:
- PyErr_SetString(PyExc_SystemError,
- "Bad call flags in PyCFunction_Call. "
- "METH_OLDARGS is no longer supported!");
- return NULL;
- }
- }
- return _Py_CheckFunctionResult(func, res, NULL);
+PyObject *
+PyCFunction_Call(PyObject *func, PyObject *args, PyObject *kwargs)
+{
+ /* first try METH_VARARGS to pass directly args tuple unchanged.
+ _PyMethodDef_RawFastCallDict() creates a new temporary tuple
+ for METH_VARARGS. */
+ if (PyCFunction_GET_FLAGS(func) & METH_VARARGS) {
+ return cfunction_call_varargs(func, args, kwargs);
+ }
+ else {
+ return _PyCFunction_FastCallDict(func,
+ &PyTuple_GET_ITEM(args, 0),
+ PyTuple_GET_SIZE(args),
+ kwargs);
+ }
}
PyObject *
-_PyCFunction_FastCallDict(PyObject *func_obj, PyObject **args, Py_ssize_t nargs,
- PyObject *kwargs)
+_PyMethodDef_RawFastCallDict(PyMethodDef *method, PyObject *self, PyObject **args,
+ Py_ssize_t nargs, PyObject *kwargs)
{
- PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
- PyCFunction meth = PyCFunction_GET_FUNCTION(func);
- PyObject *self = PyCFunction_GET_SELF(func);
- PyObject *result;
- int flags;
+ /* _PyMethodDef_RawFastCallDict() must not be called with an exception set,
+ because it can clear it (directly or indirectly) and so the
+ caller loses its exception */
+ assert(!PyErr_Occurred());
- assert(PyCFunction_Check(func));
- assert(func != NULL);
+ assert(method != NULL);
assert(nargs >= 0);
assert(nargs == 0 || args != NULL);
assert(kwargs == NULL || PyDict_Check(kwargs));
- /* _PyCFunction_FastCallDict() must not be called with an exception set,
- because it may clear it (directly or indirectly) and so the
- caller loses its exception */
- assert(!PyErr_Occurred());
+ PyCFunction meth = method->ml_meth;
+ int flags = method->ml_flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST);
+ PyObject *result = NULL;
- flags = PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST);
+ if (Py_EnterRecursiveCall(" while calling a Python object")) {
+ return NULL;
+ }
switch (flags)
{
case METH_NOARGS:
- if (kwargs != NULL && PyDict_Size(kwargs) != 0) {
- PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments",
- func->m_ml->ml_name);
- return NULL;
- }
-
if (nargs != 0) {
PyErr_Format(PyExc_TypeError,
"%.200s() takes no arguments (%zd given)",
- func->m_ml->ml_name, nargs);
- return NULL;
+ method->ml_name, nargs);
+ goto exit;
+ }
+
+ if (kwargs != NULL && PyDict_GET_SIZE(kwargs) != 0) {
+ goto no_keyword_error;
}
result = (*meth) (self, NULL);
break;
case METH_O:
- if (kwargs != NULL && PyDict_Size(kwargs) != 0) {
- PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments",
- func->m_ml->ml_name);
- return NULL;
- }
-
if (nargs != 1) {
PyErr_Format(PyExc_TypeError,
"%.200s() takes exactly one argument (%zd given)",
- func->m_ml->ml_name, nargs);
- return NULL;
+ method->ml_name, nargs);
+ goto exit;
+ }
+
+ if (kwargs != NULL && PyDict_GET_SIZE(kwargs) != 0) {
+ goto no_keyword_error;
}
result = (*meth) (self, args[0]);
break;
case METH_VARARGS:
- case METH_VARARGS | METH_KEYWORDS:
- {
- /* Slow-path: create a temporary tuple */
- PyObject *tuple;
-
- if (!(flags & METH_KEYWORDS) && kwargs != NULL && PyDict_Size(kwargs) != 0) {
- PyErr_Format(PyExc_TypeError,
- "%.200s() takes no keyword arguments",
- func->m_ml->ml_name);
- return NULL;
+ if (!(flags & METH_KEYWORDS)
+ && kwargs != NULL && PyDict_GET_SIZE(kwargs) != 0) {
+ goto no_keyword_error;
}
+ /* fall through next case */
- tuple = _PyStack_AsTuple(args, nargs);
- if (tuple == NULL) {
- return NULL;
+ case METH_VARARGS | METH_KEYWORDS:
+ {
+ /* Slow-path: create a temporary tuple for positional arguments */
+ PyObject *argstuple = _PyStack_AsTuple(args, nargs);
+ if (argstuple == NULL) {
+ goto exit;
}
if (flags & METH_KEYWORDS) {
- result = (*(PyCFunctionWithKeywords)meth) (self, tuple, kwargs);
+ result = (*(PyCFunctionWithKeywords)meth) (self, argstuple, kwargs);
}
else {
- result = (*meth) (self, tuple);
+ result = (*meth) (self, argstuple);
}
- Py_DECREF(tuple);
+ Py_DECREF(argstuple);
break;
}
@@ -243,9 +217,8 @@ _PyCFunction_FastCallDict(PyObject *func_obj, PyObject **args, Py_ssize_t nargs,
PyObject *kwnames;
_PyCFunctionFast fastmeth = (_PyCFunctionFast)meth;
- stack = _PyStack_UnpackDict(args, nargs, kwargs, &kwnames, func_obj);
- if (stack == NULL) {
- return NULL;
+ if (_PyStack_UnpackDict(args, nargs, kwargs, &stack, &kwnames) < 0) {
+ goto exit;
}
result = (*fastmeth) (self, stack, nargs, kwnames);
@@ -258,42 +231,172 @@ _PyCFunction_FastCallDict(PyObject *func_obj, PyObject **args, Py_ssize_t nargs,
default:
PyErr_SetString(PyExc_SystemError,
- "Bad call flags in PyCFunction_Call. "
+ "Bad call flags in _PyMethodDef_RawFastCallDict. "
"METH_OLDARGS is no longer supported!");
- return NULL;
+ goto exit;
}
- result = _Py_CheckFunctionResult(func_obj, result, NULL);
+ goto exit;
+no_keyword_error:
+ PyErr_Format(PyExc_TypeError,
+ "%.200s() takes no keyword arguments",
+ method->ml_name, nargs);
+
+exit:
+ Py_LeaveRecursiveCall();
return result;
}
PyObject *
-_PyCFunction_FastCallKeywords(PyObject *func, PyObject **stack,
- Py_ssize_t nargs, PyObject *kwnames)
+_PyCFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs,
+ PyObject *kwargs)
{
- PyObject *kwdict, *result;
- Py_ssize_t nkwargs = (kwnames == NULL) ? 0 : PyTuple_GET_SIZE(kwnames);
+ PyObject *result;
+ assert(func != NULL);
assert(PyCFunction_Check(func));
+
+ result = _PyMethodDef_RawFastCallDict(((PyCFunctionObject*)func)->m_ml,
+ PyCFunction_GET_SELF(func),
+ args, nargs, kwargs);
+ result = _Py_CheckFunctionResult(func, result, NULL);
+ return result;
+}
+
+PyObject *
+_PyMethodDef_RawFastCallKeywords(PyMethodDef *method, PyObject *self, PyObject **args,
+ Py_ssize_t nargs, PyObject *kwnames)
+{
+ /* _PyMethodDef_RawFastCallKeywords() must not be called with an exception set,
+ because it can clear it (directly or indirectly) and so the
+ caller loses its exception */
+ assert(!PyErr_Occurred());
+
+ assert(method != NULL);
assert(nargs >= 0);
assert(kwnames == NULL || PyTuple_CheckExact(kwnames));
- assert((nargs == 0 && nkwargs == 0) || stack != NULL);
/* kwnames must only contains str strings, no subclass, and all keys must
be unique */
- if (nkwargs > 0) {
- kwdict = _PyStack_AsDict(stack + nargs, kwnames);
- if (kwdict == NULL) {
- return NULL;
+ PyCFunction meth = method->ml_meth;
+ int flags = method->ml_flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST);
+ Py_ssize_t nkwargs = kwnames == NULL ? 0 : PyTuple_Size(kwnames);
+ PyObject *result = NULL;
+
+ if (Py_EnterRecursiveCall(" while calling a Python object")) {
+ return NULL;
+ }
+
+ switch (flags)
+ {
+ case METH_NOARGS:
+ if (nargs != 0) {
+ PyErr_Format(PyExc_TypeError,
+ "%.200s() takes no arguments (%zd given)",
+ method->ml_name, nargs);
+ goto exit;
+ }
+
+ if (nkwargs) {
+ goto no_keyword_error;
+ }
+
+ result = (*meth) (self, NULL);
+ break;
+
+ case METH_O:
+ if (nargs != 1) {
+ PyErr_Format(PyExc_TypeError,
+ "%.200s() takes exactly one argument (%zd given)",
+ method->ml_name, nargs);
+ goto exit;
+ }
+
+ if (nkwargs) {
+ goto no_keyword_error;
}
+
+ result = (*meth) (self, args[0]);
+ break;
+
+ case METH_FASTCALL:
+ /* Fast-path: avoid temporary dict to pass keyword arguments */
+ result = ((_PyCFunctionFast)meth) (self, args, nargs, kwnames);
+ break;
+
+ case METH_VARARGS:
+ case METH_VARARGS | METH_KEYWORDS:
+ {
+ /* Slow-path: create a temporary tuple for positional arguments
+ and a temporary dict for keyword arguments */
+ PyObject *argtuple;
+
+ if (!(flags & METH_KEYWORDS) && nkwargs) {
+ goto no_keyword_error;
+ }
+
+ argtuple = _PyStack_AsTuple(args, nargs);
+ if (argtuple == NULL) {
+ goto exit;
+ }
+
+ if (flags & METH_KEYWORDS) {
+ PyObject *kwdict;
+
+ if (nkwargs > 0) {
+ kwdict = _PyStack_AsDict(args + nargs, kwnames);
+ if (kwdict == NULL) {
+ Py_DECREF(argtuple);
+ goto exit;
+ }
+ }
+ else {
+ kwdict = NULL;
+ }
+
+ result = (*(PyCFunctionWithKeywords)meth) (self, argtuple, kwdict);
+ Py_XDECREF(kwdict);
+ }
+ else {
+ result = (*meth) (self, argtuple);
+ }
+ Py_DECREF(argtuple);
+ break;
}
- else {
- kwdict = NULL;
+
+ default:
+ PyErr_SetString(PyExc_SystemError,
+ "Bad call flags in _PyCFunction_FastCallKeywords. "
+ "METH_OLDARGS is no longer supported!");
+ goto exit;
}
- result = _PyCFunction_FastCallDict(func, stack, nargs, kwdict);
- Py_XDECREF(kwdict);
+ goto exit;
+
+no_keyword_error:
+ PyErr_Format(PyExc_TypeError,
+ "%.200s() takes no keyword arguments",
+ method->ml_name);
+
+exit:
+ Py_LeaveRecursiveCall();
+ return result;
+}
+
+PyObject *
+_PyCFunction_FastCallKeywords(PyObject *func, PyObject **args,
+ Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *result;
+
+ assert(func != NULL);
+ assert(PyCFunction_Check(func));
+
+ result = _PyMethodDef_RawFastCallKeywords(((PyCFunctionObject*)func)->m_ml,
+ PyCFunction_GET_SELF(func),
+ args, nargs, kwnames);
+ result = _Py_CheckFunctionResult(func, result, NULL);
return result;
}
diff --git a/Objects/moduleobject.c b/Objects/moduleobject.c
index 79be51a806..350f3bfe3a 100644
--- a/Objects/moduleobject.c
+++ b/Objects/moduleobject.c
@@ -188,7 +188,7 @@ PyModule_Create2(struct PyModuleDef* module, int module_api_version)
(if the name actually matches).
*/
if (_Py_PackageContext != NULL) {
- char *p = strrchr(_Py_PackageContext, '.');
+ const char *p = strrchr(_Py_PackageContext, '.');
if (p != NULL && strcmp(module->m_name, p+1) == 0) {
name = _Py_PackageContext;
_Py_PackageContext = NULL;
@@ -231,7 +231,7 @@ PyModule_FromDefAndSpec2(struct PyModuleDef* def, PyObject *spec, int module_api
PyObject *nameobj;
PyObject *m = NULL;
int has_execution_slots = 0;
- char *name;
+ const char *name;
int ret;
PyModuleDef_Init(def);
@@ -512,7 +512,7 @@ const char *
PyModule_GetFilename(PyObject *m)
{
PyObject *fileobj;
- char *utf8;
+ const char *utf8;
fileobj = PyModule_GetFilenameObject(m);
if (fileobj == NULL)
return NULL;
diff --git a/Objects/object.c b/Objects/object.c
index d88ae3b94f..5da6cffdb9 100644
--- a/Objects/object.c
+++ b/Objects/object.c
@@ -477,7 +477,7 @@ PyObject_Repr(PyObject *v)
#ifdef Py_DEBUG
/* PyObject_Repr() must not be called with an exception set,
- because it may clear it (directly or indirectly) and so the
+ because it can clear it (directly or indirectly) and so the
caller loses its exception */
assert(!PyErr_Occurred());
#endif
@@ -526,7 +526,7 @@ PyObject_Str(PyObject *v)
#ifdef Py_DEBUG
/* PyObject_Str() must not be called with an exception set,
- because it may clear it (directly or indirectly) and so the
+ because it can clear it (directly or indirectly) and so the
caller loses its exception */
assert(!PyErr_Occurred());
#endif
@@ -596,7 +596,7 @@ PyObject_Bytes(PyObject *v)
func = _PyObject_LookupSpecial(v, &PyId___bytes__);
if (func != NULL) {
- result = PyObject_CallFunctionObjArgs(func, NULL);
+ result = _PyObject_CallNoArg(func);
Py_DECREF(func);
if (result == NULL)
return NULL;
@@ -890,10 +890,10 @@ PyObject_GetAttr(PyObject *v, PyObject *name)
if (tp->tp_getattro != NULL)
return (*tp->tp_getattro)(v, name);
if (tp->tp_getattr != NULL) {
- char *name_str = PyUnicode_AsUTF8(name);
+ const char *name_str = PyUnicode_AsUTF8(name);
if (name_str == NULL)
return NULL;
- return (*tp->tp_getattr)(v, name_str);
+ return (*tp->tp_getattr)(v, (char *)name_str);
}
PyErr_Format(PyExc_AttributeError,
"'%.50s' object has no attribute '%U'",
@@ -934,10 +934,10 @@ PyObject_SetAttr(PyObject *v, PyObject *name, PyObject *value)
return err;
}
if (tp->tp_setattr != NULL) {
- char *name_str = PyUnicode_AsUTF8(name);
+ const char *name_str = PyUnicode_AsUTF8(name);
if (name_str == NULL)
return -1;
- err = (*tp->tp_setattr)(v, name_str, value);
+ err = (*tp->tp_setattr)(v, (char *)name_str, value);
Py_DECREF(name);
return err;
}
@@ -1025,11 +1025,99 @@ _PyObject_NextNotImplemented(PyObject *self)
return NULL;
}
-/* Generic GetAttr functions - put these in your tp_[gs]etattro slot */
+
+/* Specialized version of _PyObject_GenericGetAttrWithDict
+ specifically for the LOAD_METHOD opcode.
+
+ Return 1 if a method is found, 0 if it's a regular attribute
+ from __dict__ or something returned by using a descriptor
+ protocol.
+
+ `method` will point to the resolved attribute or NULL. In the
+ latter case, an error will be set.
+*/
+int
+_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method)
+{
+ PyTypeObject *tp = Py_TYPE(obj);
+ PyObject *descr;
+ descrgetfunc f = NULL;
+ PyObject **dictptr, *dict;
+ PyObject *attr;
+ int meth_found = 0;
+
+ assert(*method == NULL);
+
+ if (Py_TYPE(obj)->tp_getattro != PyObject_GenericGetAttr
+ || !PyUnicode_Check(name)) {
+ *method = PyObject_GetAttr(obj, name);
+ return 0;
+ }
+
+ if (tp->tp_dict == NULL && PyType_Ready(tp) < 0)
+ return 0;
+
+ descr = _PyType_Lookup(tp, name);
+ if (descr != NULL) {
+ Py_INCREF(descr);
+ if (PyFunction_Check(descr) ||
+ (Py_TYPE(descr) == &PyMethodDescr_Type)) {
+ meth_found = 1;
+ } else {
+ f = descr->ob_type->tp_descr_get;
+ if (f != NULL && PyDescr_IsData(descr)) {
+ *method = f(descr, obj, (PyObject *)obj->ob_type);
+ Py_DECREF(descr);
+ return 0;
+ }
+ }
+ }
+
+ dictptr = _PyObject_GetDictPtr(obj);
+ if (dictptr != NULL && (dict = *dictptr) != NULL) {
+ Py_INCREF(dict);
+ attr = PyDict_GetItem(dict, name);
+ if (attr != NULL) {
+ Py_INCREF(attr);
+ *method = attr;
+ Py_DECREF(dict);
+ Py_XDECREF(descr);
+ return 0;
+ }
+ Py_DECREF(dict);
+ }
+
+ if (meth_found) {
+ *method = descr;
+ return 1;
+ }
+
+ if (f != NULL) {
+ *method = f(descr, obj, (PyObject *)Py_TYPE(obj));
+ Py_DECREF(descr);
+ return 0;
+ }
+
+ if (descr != NULL) {
+ *method = descr;
+ return 0;
+ }
+
+ PyErr_Format(PyExc_AttributeError,
+ "'%.50s' object has no attribute '%U'",
+ tp->tp_name, name);
+ return 0;
+}
+
+/* Generic GetAttr functions - put these in your tp_[gs]etattro slot. */
PyObject *
_PyObject_GenericGetAttrWithDict(PyObject *obj, PyObject *name, PyObject *dict)
{
+ /* Make sure the logic of _PyObject_GetMethod is in sync with
+ this method.
+ */
+
PyTypeObject *tp = Py_TYPE(obj);
PyObject *descr = NULL;
PyObject *res = NULL;
@@ -1314,7 +1402,7 @@ _dir_object(PyObject *obj)
return NULL;
}
/* use __dir__ */
- result = PyObject_CallFunctionObjArgs(dirfunc, NULL);
+ result = _PyObject_CallNoArg(dirfunc);
Py_DECREF(dirfunc);
if (result == NULL)
return NULL;
@@ -1366,7 +1454,7 @@ none_dealloc(PyObject* ignore)
static PyObject *
none_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
- if (PyTuple_GET_SIZE(args) || (kwargs && PyDict_Size(kwargs))) {
+ if (PyTuple_GET_SIZE(args) || (kwargs && PyDict_GET_SIZE(kwargs))) {
PyErr_SetString(PyExc_TypeError, "NoneType takes no arguments");
return NULL;
}
@@ -1485,7 +1573,7 @@ static PyMethodDef notimplemented_methods[] = {
static PyObject *
notimplemented_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
- if (PyTuple_GET_SIZE(args) || (kwargs && PyDict_Size(kwargs))) {
+ if (PyTuple_GET_SIZE(args) || (kwargs && PyDict_GET_SIZE(kwargs))) {
PyErr_SetString(PyExc_TypeError, "NotImplementedType takes no arguments");
return NULL;
}
diff --git a/Objects/odictobject.c b/Objects/odictobject.c
index f9f1bf362e..c2cef21b49 100644
--- a/Objects/odictobject.c
+++ b/Objects/odictobject.c
@@ -474,6 +474,13 @@ later:
#include "dict-common.h"
#include <stddef.h>
+#include "clinic/odictobject.c.h"
+
+/*[clinic input]
+class OrderedDict "PyODictObject *" "&PyODict_Type"
+[clinic start generated code]*/
+/*[clinic end generated code: output=da39a3ee5e6b4b0d input=ca0641cf6143d4af]*/
+
typedef struct _odictnode _ODictNode;
@@ -535,11 +542,11 @@ _odict_free_fast_nodes(PyODictObject *od) {
static Py_ssize_t
_odict_get_index_raw(PyODictObject *od, PyObject *key, Py_hash_t hash)
{
- PyObject **value_addr = NULL;
+ PyObject *value = NULL;
PyDictKeysObject *keys = ((PyDictObject *)od)->ma_keys;
Py_ssize_t ix;
- ix = (keys->dk_lookup)((PyDictObject *)od, key, hash, &value_addr, NULL);
+ ix = (keys->dk_lookup)((PyDictObject *)od, key, hash, &value, NULL);
if (ix == DKIX_EMPTY) {
return keys->dk_nentries; /* index of new entry */
}
@@ -912,25 +919,21 @@ PyDoc_STRVAR(odict_setitem__doc__, "od.__setitem__(i, y) <==> od[i]=y");
/* fromkeys() */
-PyDoc_STRVAR(odict_fromkeys__doc__,
-"OD.fromkeys(S[, v]) -> New ordered dictionary with keys from S.\n\
- If not specified, the value defaults to None.\n\
-\n\
- ");
+/*[clinic input]
+@classmethod
+OrderedDict.fromkeys
+
+ iterable as seq: object
+ value: object = None
+
+Create a new ordered dictionary with keys from iterable and values set to value.
+[clinic start generated code]*/
static PyObject *
-odict_fromkeys(PyObject *cls, PyObject *args, PyObject *kwargs)
+OrderedDict_fromkeys_impl(PyTypeObject *type, PyObject *seq, PyObject *value)
+/*[clinic end generated code: output=c10390d452d78d6d input=1a0476c229c597b3]*/
{
- static char *kwlist[] = {"iterable", "value", 0};
- PyObject *seq;
- PyObject *value = Py_None;
-
- /* both borrowed */
- if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O|O:fromkeys", kwlist,
- &seq, &value)) {
- return NULL;
- }
- return _PyDict_FromKeys(cls, seq, value);
+ return _PyDict_FromKeys((PyObject *)type, seq, value);
}
/* __sizeof__() */
@@ -1000,34 +1003,36 @@ Done:
return result;
}
-/* setdefault() */
+/* setdefault(): Skips __missing__() calls. */
-PyDoc_STRVAR(odict_setdefault__doc__,
- "od.setdefault(k[,d]) -> od.get(k,d), also set od[k]=d if k not in od");
-/* Skips __missing__() calls. */
+/*[clinic input]
+OrderedDict.setdefault
+
+ key: object
+ default: object = None
+
+Insert key with a value of default if key is not in the dictionary.
+
+Return the value for key if key is in the dictionary, else default.
+[clinic start generated code]*/
+
static PyObject *
-odict_setdefault(register PyODictObject *od, PyObject *args, PyObject *kwargs)
+OrderedDict_setdefault_impl(PyODictObject *self, PyObject *key,
+ PyObject *default_value)
+/*[clinic end generated code: output=97537cb7c28464b6 input=38e098381c1efbc6]*/
{
- static char *kwlist[] = {"key", "default", 0};
- PyObject *key, *result = NULL;
- PyObject *failobj = Py_None;
-
- /* both borrowed */
- if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O|O:setdefault", kwlist,
- &key, &failobj)) {
- return NULL;
- }
+ PyObject *result = NULL;
- if (PyODict_CheckExact(od)) {
- result = PyODict_GetItemWithError(od, key); /* borrowed */
+ if (PyODict_CheckExact(self)) {
+ result = PyODict_GetItemWithError(self, key); /* borrowed */
if (result == NULL) {
if (PyErr_Occurred())
return NULL;
- assert(_odict_find_node(od, key) == NULL);
- if (PyODict_SetItem((PyObject *)od, key, failobj) >= 0) {
- result = failobj;
- Py_INCREF(failobj);
+ assert(_odict_find_node(self, key) == NULL);
+ if (PyODict_SetItem((PyObject *)self, key, default_value) >= 0) {
+ result = default_value;
+ Py_INCREF(result);
}
}
else {
@@ -1035,16 +1040,16 @@ odict_setdefault(register PyODictObject *od, PyObject *args, PyObject *kwargs)
}
}
else {
- int exists = PySequence_Contains((PyObject *)od, key);
+ int exists = PySequence_Contains((PyObject *)self, key);
if (exists < 0) {
return NULL;
}
else if (exists) {
- result = PyObject_GetItem((PyObject *)od, key);
+ result = PyObject_GetItem((PyObject *)self, key);
}
- else if (PyObject_SetItem((PyObject *)od, key, failobj) >= 0) {
- result = failobj;
- Py_INCREF(failobj);
+ else if (PyObject_SetItem((PyObject *)self, key, default_value) >= 0) {
+ result = default_value;
+ Py_INCREF(result);
}
}
@@ -1152,39 +1157,37 @@ _odict_popkey(PyObject *od, PyObject *key, PyObject *failobj)
return _odict_popkey_hash(od, key, failobj, hash);
}
+
/* popitem() */
-PyDoc_STRVAR(odict_popitem__doc__,
-"od.popitem() -> (k, v), return and remove a (key, value) pair.\n\
- Pairs are returned in LIFO order if last is true or FIFO order if false.\n\
-\n\
- ");
+/*[clinic input]
+OrderedDict.popitem
+
+ last: bool = True
+
+Remove and return a (key, value) pair from the dictionary.
+
+Pairs are returned in LIFO order if last is true or FIFO order if false.
+[clinic start generated code]*/
static PyObject *
-odict_popitem(PyObject *od, PyObject *args, PyObject *kwargs)
+OrderedDict_popitem_impl(PyODictObject *self, int last)
+/*[clinic end generated code: output=98e7d986690d49eb input=d992ac5ee8305e1a]*/
{
- static char *kwlist[] = {"last", 0};
PyObject *key, *value, *item = NULL;
_ODictNode *node;
- int last = 1;
/* pull the item */
- /* borrowed */
- if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|p:popitem", kwlist,
- &last)) {
- return NULL;
- }
-
- if (_odict_EMPTY(od)) {
+ if (_odict_EMPTY(self)) {
PyErr_SetString(PyExc_KeyError, "dictionary is empty");
return NULL;
}
- node = last ? _odict_LAST(od) : _odict_FIRST(od);
+ node = last ? _odict_LAST(self) : _odict_FIRST(self);
key = _odictnode_KEY(node);
Py_INCREF(key);
- value = _odict_popkey_hash(od, key, NULL, _odictnode_HASH(node));
+ value = _odict_popkey_hash((PyObject *)self, key, NULL, _odictnode_HASH(node));
if (value == NULL)
return NULL;
item = PyTuple_Pack(2, key, value);
@@ -1256,7 +1259,7 @@ odict_copy(register PyODictObject *od)
if (PyODict_CheckExact(od))
od_copy = PyODict_New();
else
- od_copy = PyObject_CallFunctionObjArgs((PyObject *)Py_TYPE(od), NULL);
+ od_copy = _PyObject_CallNoArg((PyObject *)Py_TYPE(od));
if (od_copy == NULL)
return NULL;
@@ -1312,36 +1315,33 @@ odict_reversed(PyODictObject *od)
return odictiter_new(od, _odict_ITER_KEYS|_odict_ITER_REVERSED);
}
+
/* move_to_end() */
-PyDoc_STRVAR(odict_move_to_end__doc__,
-"Move an existing element to the end (or beginning if last==False).\n\
-\n\
- Raises KeyError if the element does not exist.\n\
- When last=True, acts like a fast version of self[key]=self.pop(key).\n\
-\n\
- ");
+/*[clinic input]
+OrderedDict.move_to_end
+
+ key: object
+ last: bool = True
+
+Move an existing element to the end (or beginning if last is false).
+
+Raise KeyError if the element does not exist.
+[clinic start generated code]*/
static PyObject *
-odict_move_to_end(PyODictObject *od, PyObject *args, PyObject *kwargs)
+OrderedDict_move_to_end_impl(PyODictObject *self, PyObject *key, int last)
+/*[clinic end generated code: output=fafa4c5cc9b92f20 input=d6ceff7132a2fcd7]*/
{
- static char *kwlist[] = {"key", "last", 0};
- PyObject *key;
- int last = 1;
_ODictNode *node;
- if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O|p:move_to_end", kwlist,
- &key, &last)) {
- return NULL;
- }
-
- if (_odict_EMPTY(od)) {
+ if (_odict_EMPTY(self)) {
PyErr_SetObject(PyExc_KeyError, key);
return NULL;
}
- node = last ? _odict_LAST(od) : _odict_FIRST(od);
+ node = last ? _odict_LAST(self) : _odict_FIRST(self);
if (key != _odictnode_KEY(node)) {
- node = _odict_find_node(od, key);
+ node = _odict_find_node(self, key);
if (node == NULL) {
if (!PyErr_Occurred())
PyErr_SetObject(PyExc_KeyError, key);
@@ -1349,16 +1349,16 @@ odict_move_to_end(PyODictObject *od, PyObject *args, PyObject *kwargs)
}
if (last) {
/* Only move if not already the last one. */
- if (node != _odict_LAST(od)) {
- _odict_remove_node(od, node);
- _odict_add_tail(od, node);
+ if (node != _odict_LAST(self)) {
+ _odict_remove_node(self, node);
+ _odict_add_tail(self, node);
}
}
else {
/* Only move if not already the first one. */
- if (node != _odict_FIRST(od)) {
- _odict_remove_node(od, node);
- _odict_add_head(od, node);
+ if (node != _odict_FIRST(self)) {
+ _odict_remove_node(self, node);
+ _odict_add_head(self, node);
}
}
}
@@ -1386,20 +1386,17 @@ static PyMethodDef odict_methods[] = {
odict_repr__doc__},
{"__setitem__", (PyCFunction)odict_mp_ass_sub, METH_NOARGS,
odict_setitem__doc__},
- {"fromkeys", (PyCFunction)odict_fromkeys,
- METH_VARARGS | METH_KEYWORDS | METH_CLASS, odict_fromkeys__doc__},
+ ORDEREDDICT_FROMKEYS_METHODDEF
/* overridden dict methods */
{"__sizeof__", (PyCFunction)odict_sizeof, METH_NOARGS,
odict_sizeof__doc__},
{"__reduce__", (PyCFunction)odict_reduce, METH_NOARGS,
odict_reduce__doc__},
- {"setdefault", (PyCFunction)odict_setdefault,
- METH_VARARGS | METH_KEYWORDS, odict_setdefault__doc__},
+ ORDEREDDICT_SETDEFAULT_METHODDEF
{"pop", (PyCFunction)odict_pop,
METH_VARARGS | METH_KEYWORDS, odict_pop__doc__},
- {"popitem", (PyCFunction)odict_popitem,
- METH_VARARGS | METH_KEYWORDS, odict_popitem__doc__},
+ ORDEREDDICT_POPITEM_METHODDEF
{"keys", (PyCFunction)odictkeys_new, METH_NOARGS,
odict_keys__doc__},
{"values", (PyCFunction)odictvalues_new, METH_NOARGS,
@@ -1416,8 +1413,7 @@ static PyMethodDef odict_methods[] = {
/* new methods */
{"__reversed__", (PyCFunction)odict_reversed, METH_NOARGS,
odict_reversed__doc__},
- {"move_to_end", (PyCFunction)odict_move_to_end,
- METH_VARARGS | METH_KEYWORDS, odict_move_to_end__doc__},
+ ORDEREDDICT_MOVE_TO_END_METHODDEF
{NULL, NULL} /* sentinel */
};
@@ -2423,8 +2419,7 @@ mutablemapping_update(PyObject *self, PyObject *args, PyObject *kwargs)
/* now handle kwargs */
assert(kwargs == NULL || PyDict_Check(kwargs));
- len = (kwargs != NULL) ? PyDict_Size(kwargs) : 0;
- if (len > 0) {
+ if (kwargs != NULL && PyDict_GET_SIZE(kwargs)) {
PyObject *items = PyDict_Items(kwargs);
if (items == NULL)
return NULL;
diff --git a/Objects/rangeobject.c b/Objects/rangeobject.c
index 8449fc7a24..45c557ff57 100644
--- a/Objects/rangeobject.c
+++ b/Objects/rangeobject.c
@@ -829,8 +829,6 @@ static PyMethodDef rangeiter_methods[] = {
{NULL, NULL} /* sentinel */
};
-static PyObject *rangeiter_new(PyTypeObject *, PyObject *args, PyObject *kw);
-
PyTypeObject PyRangeIter_Type = {
PyVarObject_HEAD_INIT(&PyType_Type, 0)
"range_iterator", /* tp_name */
@@ -862,15 +860,6 @@ PyTypeObject PyRangeIter_Type = {
(iternextfunc)rangeiter_next, /* tp_iternext */
rangeiter_methods, /* tp_methods */
0, /* tp_members */
- 0, /* tp_getset */
- 0, /* tp_base */
- 0, /* tp_dict */
- 0, /* tp_descr_get */
- 0, /* tp_descr_set */
- 0, /* tp_dictoffset */
- 0, /* tp_init */
- 0, /* tp_alloc */
- rangeiter_new, /* tp_new */
};
/* Return number of items in range (lo, hi, step). step != 0
@@ -925,36 +914,6 @@ fast_range_iter(long start, long stop, long step)
return (PyObject *)it;
}
-static PyObject *
-rangeiter_new(PyTypeObject *type, PyObject *args, PyObject *kw)
-{
- long start, stop, step;
-
- if (PyErr_WarnEx(PyExc_DeprecationWarning,
- "range_iterator(): creating instances of range_iterator "
- "by calling range_iterator type is deprecated",
- 1)) {
- return NULL;
- }
-
- if (!_PyArg_NoKeywords("range_iterator()", kw)) {
- return NULL;
- }
-
- if (!PyArg_ParseTuple(args,
- "lll;range_iterator() requires 3 int arguments",
- &start, &stop, &step)) {
- return NULL;
- }
- if (step == 0) {
- PyErr_SetString(PyExc_ValueError,
- "range_iterator() arg 3 must not be zero");
- return NULL;
- }
-
- return fast_range_iter(start, stop, step);
-}
-
typedef struct {
PyObject_HEAD
PyObject *index;
diff --git a/Objects/setobject.c b/Objects/setobject.c
index fdb9d3600d..2ccf183e3c 100644
--- a/Objects/setobject.c
+++ b/Objects/setobject.c
@@ -234,7 +234,7 @@ set_add_entry(PySetObject *so, PyObject *key, Py_hash_t hash)
so->used++;
entry->key = key;
entry->hash = hash;
- if ((size_t)so->fill*3 < mask*2)
+ if ((size_t)so->fill*5 < mask*3)
return 0;
return set_table_resize(so, so->used);
@@ -296,8 +296,6 @@ set_table_resize(PySetObject *so, Py_ssize_t minused)
{
Py_ssize_t newsize;
setentry *oldtable, *newtable, *entry;
- Py_ssize_t oldfill = so->fill;
- Py_ssize_t oldused = so->used;
Py_ssize_t oldmask = so->mask;
size_t newmask;
int is_oldtable_malloced;
@@ -352,21 +350,20 @@ set_table_resize(PySetObject *so, Py_ssize_t minused)
/* Make the set empty, using the new table. */
assert(newtable != oldtable);
memset(newtable, 0, sizeof(setentry) * newsize);
- so->fill = oldused;
- so->used = oldused;
so->mask = newsize - 1;
so->table = newtable;
/* Copy the data over; this is refcount-neutral for active entries;
dummy entries aren't copied over, of course */
newmask = (size_t)so->mask;
- if (oldfill == oldused) {
+ if (so->fill == so->used) {
for (entry = oldtable; entry <= oldtable + oldmask; entry++) {
if (entry->key != NULL) {
set_insert_clean(newtable, newmask, entry->key, entry->hash);
}
}
} else {
+ so->fill = so->used;
for (entry = oldtable; entry <= oldtable + oldmask; entry++) {
if (entry->key != NULL && entry->key != dummy) {
set_insert_clean(newtable, newmask, entry->key, entry->hash);
@@ -645,7 +642,7 @@ set_merge(PySetObject *so, PyObject *otherset)
* incrementally resizing as we insert new keys. Expect
* that there will be no (or few) overlapping keys.
*/
- if ((so->fill + other->used)*3 >= so->mask*2) {
+ if ((so->fill + other->used)*5 >= so->mask*3) {
if (set_table_resize(so, so->used + other->used) != 0)
return -1;
}
@@ -981,7 +978,7 @@ set_update_internal(PySetObject *so, PyObject *other)
PyObject *value;
Py_ssize_t pos = 0;
Py_hash_t hash;
- Py_ssize_t dictsize = PyDict_Size(other);
+ Py_ssize_t dictsize = PyDict_GET_SIZE(other);
/* Do one big resize at the start, rather than
* incrementally resizing as we insert new keys. Expect
@@ -989,7 +986,7 @@ set_update_internal(PySetObject *so, PyObject *other)
*/
if (dictsize < 0)
return -1;
- if ((so->fill + dictsize)*3 >= so->mask*2) {
+ if ((so->fill + dictsize)*5 >= so->mask*3) {
if (set_table_resize(so, so->used + dictsize) != 0)
return -1;
}
@@ -1087,8 +1084,7 @@ frozenset_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
{
PyObject *iterable = NULL, *result;
- if (kwds != NULL && type == &PyFrozenSet_Type
- && !_PyArg_NoKeywords("frozenset()", kwds))
+ if (type == &PyFrozenSet_Type && !_PyArg_NoKeywords("frozenset()", kwds))
return NULL;
if (!PyArg_UnpackTuple(args, type->tp_name, 0, 1, &iterable))
@@ -2005,7 +2001,7 @@ set_init(PySetObject *self, PyObject *args, PyObject *kwds)
{
PyObject *iterable = NULL;
- if (kwds != NULL && !_PyArg_NoKeywords("set()", kwds))
+ if (!_PyArg_NoKeywords("set()", kwds))
return -1;
if (!PyArg_UnpackTuple(args, Py_TYPE(self)->tp_name, 0, 1, &iterable))
return -1;
@@ -2398,7 +2394,7 @@ static PyObject *
test_c_api(PySetObject *so)
{
Py_ssize_t count;
- char *s;
+ const char *s;
Py_ssize_t i;
PyObject *elem=NULL, *dup=NULL, *t, *f, *dup2, *x=NULL;
PyObject *ob = (PyObject *)so;
diff --git a/Objects/sliceobject.c b/Objects/sliceobject.c
index 6a690213d1..d41ac105f6 100644
--- a/Objects/sliceobject.c
+++ b/Objects/sliceobject.c
@@ -19,7 +19,7 @@ this type and there is exactly one in existence.
static PyObject *
ellipsis_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
- if (PyTuple_GET_SIZE(args) || (kwargs && PyDict_Size(kwargs))) {
+ if (PyTuple_GET_SIZE(args) || (kwargs && PyDict_GET_SIZE(kwargs))) {
PyErr_SetString(PyExc_TypeError, "EllipsisType takes no arguments");
return NULL;
}
diff --git a/Objects/stringlib/transmogrify.h b/Objects/stringlib/transmogrify.h
index a314572a72..326ce14849 100644
--- a/Objects/stringlib/transmogrify.h
+++ b/Objects/stringlib/transmogrify.h
@@ -261,7 +261,7 @@ stringlib_replace_interleave(PyObject *self,
assert(count > 0);
if (to_len > (PY_SSIZE_T_MAX - self_len) / count) {
PyErr_SetString(PyExc_OverflowError,
- "replace bytes are too long");
+ "replace bytes is too long");
return NULL;
}
result_len = count * to_len + self_len;
diff --git a/Objects/stringlib/unicode_format.h b/Objects/stringlib/unicode_format.h
index 14fa28ea54..7ac0d75166 100644
--- a/Objects/stringlib/unicode_format.h
+++ b/Objects/stringlib/unicode_format.h
@@ -60,10 +60,8 @@ SubString_init(SubString *str, PyObject *s, Py_ssize_t start, Py_ssize_t end)
Py_LOCAL_INLINE(PyObject *)
SubString_new_object(SubString *str)
{
- if (str->str == NULL) {
- Py_INCREF(Py_None);
- return Py_None;
- }
+ if (str->str == NULL)
+ Py_RETURN_NONE;
return PyUnicode_Substring(str->str, str->start, str->end);
}
diff --git a/Objects/structseq.c b/Objects/structseq.c
index 5489aef6d0..c2ece5abb1 100644
--- a/Objects/structseq.c
+++ b/Objects/structseq.c
@@ -182,7 +182,7 @@ structseq_repr(PyStructSequence *obj)
for (i=0; i < VISIBLE_SIZE(obj); i++) {
PyObject *val, *repr;
- char *cname, *crepr;
+ const char *cname, *crepr;
cname = typ->tp_members[i].name;
if (cname == NULL) {
@@ -256,7 +256,7 @@ structseq_reduce(PyStructSequence* self)
}
for (; i < n_fields; i++) {
- char *n = Py_TYPE(self)->tp_members[i-n_unnamed_fields].name;
+ const char *n = Py_TYPE(self)->tp_members[i-n_unnamed_fields].name;
if (PyDict_SetItemString(dict, n, self->ob_item[i]) < 0)
goto error;
}
diff --git a/Objects/tupleobject.c b/Objects/tupleobject.c
index c0ff499e72..5bcadeb9f6 100644
--- a/Objects/tupleobject.c
+++ b/Objects/tupleobject.c
@@ -631,12 +631,10 @@ tuplerichcompare(PyObject *v, PyObject *w, int op)
/* We have an item that differs -- shortcuts for EQ/NE */
if (op == Py_EQ) {
- Py_INCREF(Py_False);
- return Py_False;
+ Py_RETURN_FALSE;
}
if (op == Py_NE) {
- Py_INCREF(Py_True);
- return Py_True;
+ Py_RETURN_TRUE;
}
/* Compare the final item again using the proper operator */
diff --git a/Objects/typeobject.c b/Objects/typeobject.c
index 329261b037..0193192102 100644
--- a/Objects/typeobject.c
+++ b/Objects/typeobject.c
@@ -121,6 +121,22 @@ skip_signature(const char *doc)
return NULL;
}
+#ifdef Py_DEBUG
+static int
+_PyType_CheckConsistency(PyTypeObject *type)
+{
+ if (!(type->tp_flags & Py_TPFLAGS_READY)) {
+ /* don't check types before PyType_Ready() */
+ return 1;
+ }
+
+ assert(!(type->tp_flags & Py_TPFLAGS_READYING));
+ assert(type->tp_mro != NULL && PyTuple_Check(type->tp_mro));
+ assert(type->tp_dict != NULL);
+ return 1;
+}
+#endif
+
static const char *
_PyType_DocWithoutSignature(const char *name, const char *internal_doc)
{
@@ -140,8 +156,7 @@ _PyType_GetDocFromInternalDoc(const char *name, const char *internal_doc)
const char *doc = _PyType_DocWithoutSignature(name, internal_doc);
if (!doc || *doc == '\0') {
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
return PyUnicode_FromString(doc);
@@ -158,8 +173,7 @@ _PyType_GetTextSignatureFromInternalDoc(const char *name, const char *internal_d
else
end = NULL;
if (!end) {
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
/* back "end" up until it points just past the final ')' */
@@ -721,6 +735,7 @@ type_set_bases(PyTypeObject *type, PyObject *new_bases, void *context)
Py_DECREF(old_bases);
Py_DECREF(old_base);
+ assert(_PyType_CheckConsistency(type));
return res;
undo:
@@ -754,6 +769,7 @@ type_set_bases(PyTypeObject *type, PyObject *new_bases, void *context)
Py_DECREF(old_base);
}
+ assert(_PyType_CheckConsistency(type));
return -1;
}
@@ -761,8 +777,7 @@ static PyObject *
type_dict(PyTypeObject *type, void *context)
{
if (type->tp_dict == NULL) {
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
return PyDictProxy_New(type->tp_dict);
}
@@ -887,7 +902,7 @@ type_call(PyTypeObject *type, PyObject *args, PyObject *kwds)
#ifdef Py_DEBUG
/* type_call() must not be called with an exception set,
- because it may clear it (directly or indirectly) and so the
+ because it can clear it (directly or indirectly) and so the
caller loses its exception */
assert(!PyErr_Occurred());
#endif
@@ -902,7 +917,7 @@ type_call(PyTypeObject *type, PyObject *args, PyObject *kwds)
if (type == &PyType_Type &&
PyTuple_Check(args) && PyTuple_GET_SIZE(args) == 1 &&
(kwds == NULL ||
- (PyDict_Check(kwds) && PyDict_Size(kwds) == 0)))
+ (PyDict_Check(kwds) && PyDict_GET_SIZE(kwds) == 0)))
return obj;
/* If the returned object is not an instance of type,
@@ -1420,43 +1435,24 @@ _PyObject_LookupSpecial(PyObject *self, _Py_Identifier *attrid)
return lookup_maybe(self, attrid);
}
-/* A variation of PyObject_CallMethod that uses lookup_method()
+/* A variation of PyObject_CallMethodObjArgs that uses lookup_method()
instead of PyObject_GetAttrString(). This uses the same convention
as lookup_method to cache the interned name string object. */
static PyObject *
-call_method(PyObject *o, _Py_Identifier *nameid, const char *format, ...)
+call_method(PyObject *obj, _Py_Identifier *name,
+ PyObject **args, Py_ssize_t nargs)
{
- va_list va;
- PyObject *func = NULL, *retval;
+ PyObject *func, *retval;
- func = lookup_maybe(o, nameid);
+ func = lookup_maybe(obj, name);
if (func == NULL) {
if (!PyErr_Occurred())
- PyErr_SetObject(PyExc_AttributeError, nameid->object);
+ PyErr_SetObject(PyExc_AttributeError, name->object);
return NULL;
}
- if (format && *format) {
- PyObject *args;
-
- va_start(va, format);
- args = Py_VaBuildValue(format, va);
- va_end(va);
-
- if (args == NULL) {
- Py_DECREF(func);
- return NULL;
- }
- assert(PyTuple_Check(args));
-
- retval = PyObject_Call(func, args, NULL);
- Py_DECREF(args);
- }
- else {
- retval = _PyObject_CallNoArg(func);
- }
-
+ retval = _PyObject_FastCall(func, args, nargs);
Py_DECREF(func);
return retval;
@@ -1465,38 +1461,19 @@ call_method(PyObject *o, _Py_Identifier *nameid, const char *format, ...)
/* Clone of call_method() that returns NotImplemented when the lookup fails. */
static PyObject *
-call_maybe(PyObject *o, _Py_Identifier *nameid, const char *format, ...)
+call_maybe(PyObject *obj, _Py_Identifier *name,
+ PyObject **args, Py_ssize_t nargs)
{
- va_list va;
- PyObject *func = NULL, *retval;
+ PyObject *func, *retval;
- func = lookup_maybe(o, nameid);
+ func = lookup_maybe(obj, name);
if (func == NULL) {
if (!PyErr_Occurred())
Py_RETURN_NOTIMPLEMENTED;
return NULL;
}
- if (format && *format) {
- PyObject *args;
-
- va_start(va, format);
- args = Py_VaBuildValue(format, va);
- va_end(va);
-
- if (args == NULL) {
- Py_DECREF(func);
- return NULL;
- }
- assert(PyTuple_Check(args));
-
- retval = PyObject_Call(func, args, NULL);
- Py_DECREF(args);
- }
- else {
- retval = _PyObject_CallNoArg(func);
- }
-
+ retval = _PyObject_FastCall(func, args, nargs);
Py_DECREF(func);
return retval;
@@ -1617,14 +1594,14 @@ set_mro_error(PyObject *to_merge, int *remain)
}
}
}
- n = PyDict_Size(set);
+ n = PyDict_GET_SIZE(set);
off = PyOS_snprintf(buf, sizeof(buf), "Cannot create a \
consistent method resolution\norder (MRO) for bases");
i = 0;
while (PyDict_Next(set, &i, &k, &v) && (size_t)off < sizeof(buf)) {
PyObject *name = class_name(k);
- char *name_str;
+ const char *name_str;
if (name != NULL) {
name_str = PyUnicode_AsUTF8(name);
if (name_str == NULL)
@@ -1856,7 +1833,7 @@ mro_invoke(PyTypeObject *type)
PyObject *mro_meth = lookup_method((PyObject *)type, &PyId_mro);
if (mro_meth == NULL)
return NULL;
- mro_result = PyObject_CallObject(mro_meth, NULL);
+ mro_result = _PyObject_CallNoArg(mro_meth);
Py_DECREF(mro_meth);
}
else {
@@ -2219,7 +2196,7 @@ type_init(PyObject *cls, PyObject *args, PyObject *kwds)
assert(kwds == NULL || PyDict_Check(kwds));
if (kwds != NULL && PyTuple_Check(args) && PyTuple_GET_SIZE(args) == 1 &&
- PyDict_Check(kwds) && PyDict_Size(kwds) != 0) {
+ PyDict_Check(kwds) && PyDict_GET_SIZE(kwds) != 0) {
PyErr_SetString(PyExc_TypeError,
"type.__init__() takes no keyword arguments");
return -1;
@@ -2304,7 +2281,7 @@ type_new(PyTypeObject *metatype, PyObject *args, PyObject *kwds)
Note: We don't call PyType_CheckExact as that also allows subclasses */
if (metatype == &PyType_Type) {
const Py_ssize_t nargs = PyTuple_GET_SIZE(args);
- const Py_ssize_t nkwds = kwds == NULL ? 0 : PyDict_Size(kwds);
+ const Py_ssize_t nkwds = kwds == NULL ? 0 : PyDict_GET_SIZE(kwds);
if (nargs == 1 && nkwds == 0) {
PyObject *x = PyTuple_GET_ITEM(args, 0);
@@ -2572,7 +2549,7 @@ type_new(PyTypeObject *metatype, PyObject *args, PyObject *kwds)
PyObject *doc = _PyDict_GetItemId(dict, &PyId___doc__);
if (doc != NULL && PyUnicode_Check(doc)) {
Py_ssize_t len;
- char *doc_str;
+ const char *doc_str;
char *tp_doc;
doc_str = PyUnicode_AsUTF8(doc);
@@ -3075,6 +3052,7 @@ type_getattro(PyTypeObject *type, PyObject *name)
static int
type_setattro(PyTypeObject *type, PyObject *name, PyObject *value)
{
+ int res;
if (!(type->tp_flags & Py_TPFLAGS_HEAPTYPE)) {
PyErr_Format(
PyExc_TypeError,
@@ -3082,9 +3060,11 @@ type_setattro(PyTypeObject *type, PyObject *name, PyObject *value)
type->tp_name);
return -1;
}
- if (PyObject_GenericSetAttr((PyObject *)type, name, value) < 0)
+ if (_PyObject_GenericSetAttrWithDict((PyObject *)type, name, value, NULL) < 0)
return -1;
- return update_slot(type, name);
+ res = update_slot(type, name);
+ assert(_PyType_CheckConsistency(type));
+ return res;
}
extern void
@@ -3150,7 +3130,8 @@ type_subclasses(PyTypeObject *type, PyObject *args_ignored)
}
static PyObject *
-type_prepare(PyObject *self, PyObject *args, PyObject *kwds)
+type_prepare(PyObject *self, PyObject **args, Py_ssize_t nargs,
+ PyObject *kwnames)
{
return PyDict_New();
}
@@ -3254,7 +3235,7 @@ static PyMethodDef type_methods[] = {
{"__subclasses__", (PyCFunction)type_subclasses, METH_NOARGS,
PyDoc_STR("__subclasses__() -> list of immediate subclasses")},
{"__prepare__", (PyCFunction)type_prepare,
- METH_VARARGS | METH_KEYWORDS | METH_CLASS,
+ METH_FASTCALL | METH_CLASS,
PyDoc_STR("__prepare__() -> dict\n"
"used to create the namespace for the class statement")},
{"__instancecheck__", type___instancecheck__, METH_O,
@@ -3448,7 +3429,7 @@ static int
excess_args(PyObject *args, PyObject *kwds)
{
return PyTuple_GET_SIZE(args) ||
- (kwds && PyDict_Check(kwds) && PyDict_Size(kwds));
+ (kwds && PyDict_Check(kwds) && PyDict_GET_SIZE(kwds));
}
static int
@@ -3926,7 +3907,7 @@ _PyObject_GetState(PyObject *obj, int required)
We also return None if the dict is empty to make the behavior
consistent regardless whether the dict was initialized or not.
This make unit testing easier. */
- if (dict != NULL && *dict != NULL && PyDict_Size(*dict) > 0) {
+ if (dict != NULL && *dict != NULL && PyDict_GET_SIZE(*dict)) {
state = *dict;
}
else {
@@ -4015,7 +3996,7 @@ _PyObject_GetState(PyObject *obj, int required)
/* If we found some slot attributes, pack them in a tuple along
the original attribute dictionary. */
- if (PyDict_Size(slots) > 0) {
+ if (PyDict_GET_SIZE(slots) > 0) {
PyObject *state2;
state2 = PyTuple_Pack(2, state, slots);
@@ -4032,7 +4013,7 @@ _PyObject_GetState(PyObject *obj, int required)
Py_DECREF(slotnames);
}
else { /* getstate != NULL */
- state = PyObject_CallObject(getstate, NULL);
+ state = _PyObject_CallNoArg(getstate);
Py_DECREF(getstate);
if (state == NULL)
return NULL;
@@ -4057,7 +4038,7 @@ _PyObject_GetNewArguments(PyObject *obj, PyObject **args, PyObject **kwargs)
__getnewargs_ex__ on the object. */
getnewargs_ex = _PyObject_LookupSpecial(obj, &PyId___getnewargs_ex__);
if (getnewargs_ex != NULL) {
- PyObject *newargs = PyObject_CallObject(getnewargs_ex, NULL);
+ PyObject *newargs = _PyObject_CallNoArg(getnewargs_ex);
Py_DECREF(getnewargs_ex);
if (newargs == NULL) {
return -1;
@@ -4110,7 +4091,7 @@ _PyObject_GetNewArguments(PyObject *obj, PyObject **args, PyObject **kwargs)
__getnewargs__ instead. */
getnewargs = _PyObject_LookupSpecial(obj, &PyId___getnewargs__);
if (getnewargs != NULL) {
- *args = PyObject_CallObject(getnewargs, NULL);
+ *args = _PyObject_CallNoArg(getnewargs);
Py_DECREF(getnewargs);
if (*args == NULL) {
return -1;
@@ -4207,7 +4188,7 @@ reduce_newobj(PyObject *obj)
return NULL;
}
hasargs = (args != NULL);
- if (kwargs == NULL || PyDict_Size(kwargs) == 0) {
+ if (kwargs == NULL || PyDict_GET_SIZE(kwargs) == 0) {
_Py_IDENTIFIER(__newobj__);
PyObject *cls;
Py_ssize_t i, n;
@@ -4362,7 +4343,7 @@ object_reduce_ex(PyObject *self, PyObject *args)
override = (clsreduce != objreduce);
Py_DECREF(clsreduce);
if (override) {
- res = PyObject_CallObject(reduce, NULL);
+ res = _PyObject_CallNoArg(reduce);
Py_DECREF(reduce);
return res;
}
@@ -4558,6 +4539,7 @@ add_methods(PyTypeObject *type, PyMethodDef *meth)
for (; meth->ml_name != NULL; meth++) {
PyObject *descr;
int err;
+ int isdescr = 1;
if (PyDict_GetItemString(dict, meth->ml_name) &&
!(meth->ml_flags & METH_COEXIST))
continue;
@@ -4574,6 +4556,7 @@ add_methods(PyTypeObject *type, PyMethodDef *meth)
if (cfunc == NULL)
return -1;
descr = PyStaticMethod_New(cfunc);
+ isdescr = 0; // PyStaticMethod is not PyDescrObject
Py_DECREF(cfunc);
}
else {
@@ -4581,7 +4564,12 @@ add_methods(PyTypeObject *type, PyMethodDef *meth)
}
if (descr == NULL)
return -1;
- err = PyDict_SetItemString(dict, meth->ml_name, descr);
+ if (isdescr) {
+ err = PyDict_SetItem(dict, PyDescr_NAME(descr), descr);
+ }
+ else {
+ err = PyDict_SetItemString(dict, meth->ml_name, descr);
+ }
Py_DECREF(descr);
if (err < 0)
return -1;
@@ -4601,7 +4589,7 @@ add_members(PyTypeObject *type, PyMemberDef *memb)
descr = PyDescr_NewMember(type, memb);
if (descr == NULL)
return -1;
- if (PyDict_SetItemString(dict, memb->name, descr) < 0) {
+ if (PyDict_SetItem(dict, PyDescr_NAME(descr), descr) < 0) {
Py_DECREF(descr);
return -1;
}
@@ -4623,7 +4611,7 @@ add_getset(PyTypeObject *type, PyGetSetDef *gsp)
if (descr == NULL)
return -1;
- if (PyDict_SetItemString(dict, gsp->name, descr) < 0) {
+ if (PyDict_SetItem(dict, PyDescr_NAME(descr), descr) < 0) {
Py_DECREF(descr);
return -1;
}
@@ -4891,7 +4879,7 @@ PyType_Ready(PyTypeObject *type)
Py_ssize_t i, n;
if (type->tp_flags & Py_TPFLAGS_READY) {
- assert(type->tp_dict != NULL);
+ assert(_PyType_CheckConsistency(type));
return 0;
}
assert((type->tp_flags & Py_TPFLAGS_READYING) == 0);
@@ -5085,9 +5073,9 @@ PyType_Ready(PyTypeObject *type)
}
/* All done -- set the ready flag */
- assert(type->tp_dict != NULL);
type->tp_flags =
(type->tp_flags & ~Py_TPFLAGS_READYING) | Py_TPFLAGS_READY;
+ assert(_PyType_CheckConsistency(type));
return 0;
error:
@@ -5367,8 +5355,7 @@ wrap_sq_setitem(PyObject *self, PyObject *args, void *wrapped)
res = (*func)(self, i, value);
if (res == -1 && PyErr_Occurred())
return NULL;
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
static PyObject *
@@ -5388,8 +5375,7 @@ wrap_sq_delitem(PyObject *self, PyObject *args, void *wrapped)
res = (*func)(self, i, NULL);
if (res == -1 && PyErr_Occurred())
return NULL;
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
/* XXX objobjproc is a misnomer; should be objargpred */
@@ -5422,8 +5408,7 @@ wrap_objobjargproc(PyObject *self, PyObject *args, void *wrapped)
res = (*func)(self, key, value);
if (res == -1 && PyErr_Occurred())
return NULL;
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
static PyObject *
@@ -5439,8 +5424,7 @@ wrap_delitem(PyObject *self, PyObject *args, void *wrapped)
res = (*func)(self, key, NULL);
if (res == -1 && PyErr_Occurred())
return NULL;
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
/* Helper to check for object.__setattr__ or __delattr__ applied to a type.
@@ -5477,8 +5461,7 @@ wrap_setattr(PyObject *self, PyObject *args, void *wrapped)
res = (*func)(self, name, value);
if (res < 0)
return NULL;
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
static PyObject *
@@ -5496,8 +5479,7 @@ wrap_delattr(PyObject *self, PyObject *args, void *wrapped)
res = (*func)(self, name, NULL);
if (res < 0)
return NULL;
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
static PyObject *
@@ -5608,8 +5590,7 @@ wrap_descr_set(PyObject *self, PyObject *args, void *wrapped)
ret = (*func)(self, obj, value);
if (ret < 0)
return NULL;
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
static PyObject *
@@ -5625,8 +5606,7 @@ wrap_descr_delete(PyObject *self, PyObject *args, void *wrapped)
ret = (*func)(self, obj, NULL);
if (ret < 0)
return NULL;
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
static PyObject *
@@ -5636,8 +5616,7 @@ wrap_init(PyObject *self, PyObject *args, void *wrapped, PyObject *kwds)
if (func(self, args, kwds) < 0)
return NULL;
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
static PyObject *
@@ -5733,15 +5712,16 @@ static PyObject * \
FUNCNAME(PyObject *self) \
{ \
_Py_static_string(id, OPSTR); \
- return call_method(self, &id, NULL); \
+ return call_method(self, &id, NULL, 0); \
}
-#define SLOT1(FUNCNAME, OPSTR, ARG1TYPE, ARGCODES) \
+#define SLOT1(FUNCNAME, OPSTR, ARG1TYPE) \
static PyObject * \
FUNCNAME(PyObject *self, ARG1TYPE arg1) \
{ \
+ PyObject* stack[1] = {arg1}; \
_Py_static_string(id, OPSTR); \
- return call_method(self, &id, "(" ARGCODES ")", arg1); \
+ return call_method(self, &id, stack, 1); \
}
/* Boolean helper for SLOT1BINFULL().
@@ -5783,6 +5763,7 @@ method_is_overloaded(PyObject *left, PyObject *right, struct _Py_Identifier *nam
static PyObject * \
FUNCNAME(PyObject *self, PyObject *other) \
{ \
+ PyObject* stack[1]; \
_Py_static_string(op_id, OPSTR); \
_Py_static_string(rop_id, ROPSTR); \
int do_other = Py_TYPE(self) != Py_TYPE(other) && \
@@ -5794,20 +5775,23 @@ FUNCNAME(PyObject *self, PyObject *other) \
if (do_other && \
PyType_IsSubtype(Py_TYPE(other), Py_TYPE(self)) && \
method_is_overloaded(self, other, &rop_id)) { \
- r = call_maybe(other, &rop_id, "(O)", self); \
+ stack[0] = self; \
+ r = call_maybe(other, &rop_id, stack, 1); \
if (r != Py_NotImplemented) \
return r; \
Py_DECREF(r); \
do_other = 0; \
} \
- r = call_maybe(self, &op_id, "(O)", other); \
+ stack[0] = other; \
+ r = call_maybe(self, &op_id, stack, 1); \
if (r != Py_NotImplemented || \
Py_TYPE(other) == Py_TYPE(self)) \
return r; \
Py_DECREF(r); \
} \
if (do_other) { \
- return call_maybe(other, &rop_id, "(O)", self); \
+ stack[0] = self; \
+ return call_maybe(other, &rop_id, stack, 1); \
} \
Py_RETURN_NOTIMPLEMENTED; \
}
@@ -5815,18 +5799,10 @@ FUNCNAME(PyObject *self, PyObject *other) \
#define SLOT1BIN(FUNCNAME, SLOTNAME, OPSTR, ROPSTR) \
SLOT1BINFULL(FUNCNAME, FUNCNAME, SLOTNAME, OPSTR, ROPSTR)
-#define SLOT2(FUNCNAME, OPSTR, ARG1TYPE, ARG2TYPE, ARGCODES) \
-static PyObject * \
-FUNCNAME(PyObject *self, ARG1TYPE arg1, ARG2TYPE arg2) \
-{ \
- _Py_static_string(id, #OPSTR); \
- return call_method(self, &id, "(" ARGCODES ")", arg1, arg2); \
-}
-
static Py_ssize_t
slot_sq_length(PyObject *self)
{
- PyObject *res = call_method(self, &PyId___len__, NULL);
+ PyObject *res = call_method(self, &PyId___len__, NULL, 0);
Py_ssize_t len;
if (res == NULL)
@@ -5873,7 +5849,7 @@ slot_sq_item(PyObject *self, Py_ssize_t i)
goto error;
}
- retval = _PyObject_CallArg1(func, ival);
+ retval = PyObject_CallFunctionObjArgs(func, ival, NULL);
Py_DECREF(func);
Py_DECREF(ival);
return retval;
@@ -5886,14 +5862,28 @@ error:
static int
slot_sq_ass_item(PyObject *self, Py_ssize_t index, PyObject *value)
{
+ PyObject *stack[2];
PyObject *res;
+ PyObject *index_obj;
- if (value == NULL)
- res = call_method(self, &PyId___delitem__, "(n)", index);
- else
- res = call_method(self, &PyId___setitem__, "(nO)", index, value);
- if (res == NULL)
+ index_obj = PyLong_FromSsize_t(index);
+ if (index_obj == NULL) {
+ return -1;
+ }
+
+ stack[0] = index_obj;
+ if (value == NULL) {
+ res = call_method(self, &PyId___delitem__, stack, 1);
+ }
+ else {
+ stack[1] = value;
+ res = call_method(self, &PyId___setitem__, stack, 2);
+ }
+ Py_DECREF(index_obj);
+
+ if (res == NULL) {
return -1;
+ }
Py_DECREF(res);
return 0;
}
@@ -5914,7 +5904,7 @@ slot_sq_contains(PyObject *self, PyObject *value)
return -1;
}
if (func != NULL) {
- res = _PyObject_CallArg1(func, value);
+ res = PyObject_CallFunctionObjArgs(func, value, NULL);
Py_DECREF(func);
if (res != NULL) {
result = PyObject_IsTrue(res);
@@ -5931,17 +5921,22 @@ slot_sq_contains(PyObject *self, PyObject *value)
#define slot_mp_length slot_sq_length
-SLOT1(slot_mp_subscript, "__getitem__", PyObject *, "O")
+SLOT1(slot_mp_subscript, "__getitem__", PyObject *)
static int
slot_mp_ass_subscript(PyObject *self, PyObject *key, PyObject *value)
{
+ PyObject *stack[2];
PyObject *res;
- if (value == NULL)
- res = call_method(self, &PyId___delitem__, "(O)", key);
- else
- res = call_method(self, &PyId___setitem__, "(OO)", key, value);
+ stack[0] = key;
+ if (value == NULL) {
+ res = call_method(self, &PyId___delitem__, stack, 1);
+ }
+ else {
+ stack[1] = value;
+ res = call_method(self, &PyId___setitem__, stack, 2);
+ }
if (res == NULL)
return -1;
@@ -5973,7 +5968,8 @@ slot_nb_power(PyObject *self, PyObject *other, PyObject *modulus)
slot_nb_power, so check before calling self.__pow__. */
if (Py_TYPE(self)->tp_as_number != NULL &&
Py_TYPE(self)->tp_as_number->nb_power == slot_nb_power) {
- return call_method(self, &PyId___pow__, "(OO)", other, modulus);
+ PyObject* stack[2] = {other, modulus};
+ return call_method(self, &PyId___pow__, stack, 2);
}
Py_RETURN_NOTIMPLEMENTED;
}
@@ -6040,7 +6036,7 @@ static PyObject *
slot_nb_index(PyObject *self)
{
_Py_IDENTIFIER(__index__);
- return call_method(self, &PyId___index__, NULL);
+ return call_method(self, &PyId___index__, NULL, 0);
}
@@ -6053,28 +6049,29 @@ SLOT1BIN(slot_nb_or, nb_or, "__or__", "__ror__")
SLOT0(slot_nb_int, "__int__")
SLOT0(slot_nb_float, "__float__")
-SLOT1(slot_nb_inplace_add, "__iadd__", PyObject *, "O")
-SLOT1(slot_nb_inplace_subtract, "__isub__", PyObject *, "O")
-SLOT1(slot_nb_inplace_multiply, "__imul__", PyObject *, "O")
-SLOT1(slot_nb_inplace_matrix_multiply, "__imatmul__", PyObject *, "O")
-SLOT1(slot_nb_inplace_remainder, "__imod__", PyObject *, "O")
+SLOT1(slot_nb_inplace_add, "__iadd__", PyObject *)
+SLOT1(slot_nb_inplace_subtract, "__isub__", PyObject *)
+SLOT1(slot_nb_inplace_multiply, "__imul__", PyObject *)
+SLOT1(slot_nb_inplace_matrix_multiply, "__imatmul__", PyObject *)
+SLOT1(slot_nb_inplace_remainder, "__imod__", PyObject *)
/* Can't use SLOT1 here, because nb_inplace_power is ternary */
static PyObject *
slot_nb_inplace_power(PyObject *self, PyObject * arg1, PyObject *arg2)
{
+ PyObject *stack[1] = {arg1};
_Py_IDENTIFIER(__ipow__);
- return call_method(self, &PyId___ipow__, "(" "O" ")", arg1);
+ return call_method(self, &PyId___ipow__, stack, 1);
}
-SLOT1(slot_nb_inplace_lshift, "__ilshift__", PyObject *, "O")
-SLOT1(slot_nb_inplace_rshift, "__irshift__", PyObject *, "O")
-SLOT1(slot_nb_inplace_and, "__iand__", PyObject *, "O")
-SLOT1(slot_nb_inplace_xor, "__ixor__", PyObject *, "O")
-SLOT1(slot_nb_inplace_or, "__ior__", PyObject *, "O")
+SLOT1(slot_nb_inplace_lshift, "__ilshift__", PyObject *)
+SLOT1(slot_nb_inplace_rshift, "__irshift__", PyObject *)
+SLOT1(slot_nb_inplace_and, "__iand__", PyObject *)
+SLOT1(slot_nb_inplace_xor, "__ixor__", PyObject *)
+SLOT1(slot_nb_inplace_or, "__ior__", PyObject *)
SLOT1BIN(slot_nb_floor_divide, nb_floor_divide,
"__floordiv__", "__rfloordiv__")
SLOT1BIN(slot_nb_true_divide, nb_true_divide, "__truediv__", "__rtruediv__")
-SLOT1(slot_nb_inplace_floor_divide, "__ifloordiv__", PyObject *, "O")
-SLOT1(slot_nb_inplace_true_divide, "__itruediv__", PyObject *, "O")
+SLOT1(slot_nb_inplace_floor_divide, "__ifloordiv__", PyObject *)
+SLOT1(slot_nb_inplace_true_divide, "__itruediv__", PyObject *)
static PyObject *
slot_tp_repr(PyObject *self)
@@ -6184,7 +6181,8 @@ slot_tp_call(PyObject *self, PyObject *args, PyObject *kwds)
static PyObject *
slot_tp_getattro(PyObject *self, PyObject *name)
{
- return call_method(self, &PyId___getattribute__, "(O)", name);
+ PyObject *stack[1] = {name};
+ return call_method(self, &PyId___getattribute__, stack, 1);
}
static PyObject *
@@ -6251,14 +6249,19 @@ slot_tp_getattr_hook(PyObject *self, PyObject *name)
static int
slot_tp_setattro(PyObject *self, PyObject *name, PyObject *value)
{
+ PyObject *stack[2];
PyObject *res;
_Py_IDENTIFIER(__delattr__);
_Py_IDENTIFIER(__setattr__);
- if (value == NULL)
- res = call_method(self, &PyId___delattr__, "(O)", name);
- else
- res = call_method(self, &PyId___setattr__, "(OO)", name, value);
+ stack[0] = name;
+ if (value == NULL) {
+ res = call_method(self, &PyId___delattr__, stack, 1);
+ }
+ else {
+ stack[1] = value;
+ res = call_method(self, &PyId___setattr__, stack, 2);
+ }
if (res == NULL)
return -1;
Py_DECREF(res);
@@ -6284,7 +6287,7 @@ slot_tp_richcompare(PyObject *self, PyObject *other, int op)
PyErr_Clear();
Py_RETURN_NOTIMPLEMENTED;
}
- res = _PyObject_CallArg1(func, other);
+ res = PyObject_CallFunctionObjArgs(func, other, NULL);
Py_DECREF(func);
return res;
}
@@ -6326,7 +6329,7 @@ static PyObject *
slot_tp_iternext(PyObject *self)
{
_Py_IDENTIFIER(__next__);
- return call_method(self, &PyId___next__, NULL);
+ return call_method(self, &PyId___next__, NULL, 0);
}
static PyObject *
@@ -6354,14 +6357,19 @@ slot_tp_descr_get(PyObject *self, PyObject *obj, PyObject *type)
static int
slot_tp_descr_set(PyObject *self, PyObject *target, PyObject *value)
{
+ PyObject* stack[2];
PyObject *res;
_Py_IDENTIFIER(__delete__);
_Py_IDENTIFIER(__set__);
- if (value == NULL)
- res = call_method(self, &PyId___delete__, "(O)", target);
- else
- res = call_method(self, &PyId___set__, "(OO)", target, value);
+ stack[0] = target;
+ if (value == NULL) {
+ res = call_method(self, &PyId___delete__, stack, 1);
+ }
+ else {
+ stack[1] = value;
+ res = call_method(self, &PyId___set__, stack, 2);
+ }
if (res == NULL)
return -1;
Py_DECREF(res);
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c
index a5ae454b49..d3516fa45f 100644
--- a/Objects/unicodeobject.c
+++ b/Objects/unicodeobject.c
@@ -49,9 +49,23 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#endif
/*[clinic input]
-class str "PyUnicodeObject *" "&PyUnicode_Type"
+class str "PyObject *" "&PyUnicode_Type"
[clinic start generated code]*/
-/*[clinic end generated code: output=da39a3ee5e6b4b0d input=604e916854800fa8]*/
+/*[clinic end generated code: output=da39a3ee5e6b4b0d input=4884c934de622cf6]*/
+
+/*[python input]
+class Py_UCS4_converter(CConverter):
+ type = 'Py_UCS4'
+ converter = 'convert_uc'
+
+ def converter_init(self):
+ if self.default is not unspecified:
+ self.c_default = ascii(self.default)
+ if len(self.c_default) > 4 or self.c_default[0] != "'":
+ self.c_default = hex(ord(self.default))
+
+[python start generated code]*/
+/*[python end generated code: output=da39a3ee5e6b4b0d input=88f5dd06cd8e7a61]*/
/* --- Globals ------------------------------------------------------------
@@ -299,6 +313,8 @@ static const unsigned char ascii_linebreak[] = {
0, 0, 0, 0, 0, 0, 0, 0
};
+static int convert_uc(PyObject *obj, void *addr);
+
#include "clinic/unicodeobject.c.h"
typedef enum {
@@ -1029,8 +1045,7 @@ resize_copy(PyObject *unicode, Py_ssize_t length)
if (_PyUnicode_KIND(unicode) != PyUnicode_WCHAR_KIND) {
PyObject *copy;
- if (PyUnicode_READY(unicode) == -1)
- return NULL;
+ assert(PyUnicode_IS_READY(unicode));
copy = PyUnicode_New(length, PyUnicode_MAX_CHAR_VALUE(unicode));
if (copy == NULL)
@@ -1974,14 +1989,11 @@ unicode_char(Py_UCS4 ch)
unicode = PyUnicode_New(1, ch);
if (unicode == NULL)
return NULL;
- switch (PyUnicode_KIND(unicode)) {
- case PyUnicode_1BYTE_KIND:
- PyUnicode_1BYTE_DATA(unicode)[0] = (Py_UCS1)ch;
- break;
- case PyUnicode_2BYTE_KIND:
+
+ assert(PyUnicode_KIND(unicode) != PyUnicode_1BYTE_KIND);
+ if (PyUnicode_KIND(unicode) == PyUnicode_2BYTE_KIND) {
PyUnicode_2BYTE_DATA(unicode)[0] = (Py_UCS2)ch;
- break;
- default:
+ } else {
assert(PyUnicode_KIND(unicode) == PyUnicode_4BYTE_KIND);
PyUnicode_4BYTE_DATA(unicode)[0] = ch;
}
@@ -1992,12 +2004,32 @@ unicode_char(Py_UCS4 ch)
PyObject *
PyUnicode_FromUnicode(const Py_UNICODE *u, Py_ssize_t size)
{
+ if (u == NULL)
+ return (PyObject*)_PyUnicode_New(size);
+
+ if (size < 0) {
+ PyErr_BadInternalCall();
+ return NULL;
+ }
+
+ return PyUnicode_FromWideChar(u, size);
+}
+
+PyObject *
+PyUnicode_FromWideChar(const wchar_t *u, Py_ssize_t size)
+{
PyObject *unicode;
Py_UCS4 maxchar = 0;
Py_ssize_t num_surrogates;
- if (u == NULL)
- return (PyObject*)_PyUnicode_New(size);
+ if (u == NULL && size != 0) {
+ PyErr_BadInternalCall();
+ return NULL;
+ }
+
+ if (size == -1) {
+ size = wcslen(u);
+ }
/* If the Unicode data is known at construction time, we can apply
some optimizations which share commonly used objects. */
@@ -2482,27 +2514,6 @@ PyUnicode_AsUCS4Copy(PyObject *string)
return as_ucs4(string, NULL, 0, 1);
}
-#ifdef HAVE_WCHAR_H
-
-PyObject *
-PyUnicode_FromWideChar(const wchar_t *w, Py_ssize_t size)
-{
- if (w == NULL) {
- if (size == 0)
- _Py_RETURN_UNICODE_EMPTY();
- PyErr_BadInternalCall();
- return NULL;
- }
-
- if (size == -1) {
- size = wcslen(w);
- }
-
- return PyUnicode_FromUnicode(w, size);
-}
-
-#endif /* HAVE_WCHAR_H */
-
/* maximum number of characters required for output of %lld or %p.
We need at most ceil(log10(256)*SIZEOF_LONG_LONG) digits,
plus 1 for the sign. 53/22 is an upper bound for log10(256). */
@@ -3300,7 +3311,7 @@ PyUnicode_Encode(const Py_UNICODE *s,
{
PyObject *v, *unicode;
- unicode = PyUnicode_FromUnicode(s, size);
+ unicode = PyUnicode_FromWideChar(s, size);
if (unicode == NULL)
return NULL;
v = PyUnicode_AsEncodedString(unicode, encoding, errors);
@@ -3412,11 +3423,9 @@ PyUnicode_EncodeLocale(PyObject *unicode, const char *errors)
{
Py_ssize_t wlen, wlen2;
wchar_t *wstr;
- PyObject *bytes = NULL;
char *errmsg;
- PyObject *reason = NULL;
- PyObject *exc;
- size_t error_pos;
+ PyObject *bytes, *reason, *exc;
+ size_t error_pos, errlen;
int surrogateescape;
if (locale_error_handler(errors, &surrogateescape) < 0)
@@ -3471,6 +3480,7 @@ PyUnicode_EncodeLocale(PyObject *unicode, const char *errors)
len2 = wcstombs(PyBytes_AS_STRING(bytes), wstr, len+1);
if (len2 == (size_t)-1 || len2 > len) {
+ Py_DECREF(bytes);
error_pos = (size_t)-1;
goto encode_error;
}
@@ -3486,17 +3496,15 @@ encode_error:
error_pos = wcstombs_errorpos(wstr);
PyMem_Free(wstr);
- Py_XDECREF(bytes);
-
- if (errmsg != NULL) {
- size_t errlen;
- wstr = Py_DecodeLocale(errmsg, &errlen);
- if (wstr != NULL) {
- reason = PyUnicode_FromWideChar(wstr, errlen);
- PyMem_RawFree(wstr);
- } else
- errmsg = NULL;
+
+ wstr = Py_DecodeLocale(errmsg, &errlen);
+ if (wstr != NULL) {
+ reason = PyUnicode_FromWideChar(wstr, errlen);
+ PyMem_RawFree(wstr);
+ } else {
+ errmsg = NULL;
}
+
if (errmsg == NULL)
reason = PyUnicode_FromString(
"wcstombs() encountered an unencodable "
@@ -3512,7 +3520,7 @@ encode_error:
Py_DECREF(reason);
if (exc != NULL) {
PyCodec_StrictErrors(exc);
- Py_XDECREF(exc);
+ Py_DECREF(exc);
}
return NULL;
}
@@ -3719,10 +3727,9 @@ PyUnicode_DecodeLocaleAndSize(const char *str, Py_ssize_t len,
size_t wlen, wlen2;
PyObject *unicode;
int surrogateescape;
- size_t error_pos;
+ size_t error_pos, errlen;
char *errmsg;
- PyObject *reason = NULL; /* initialize to prevent gcc warning */
- PyObject *exc;
+ PyObject *exc, *reason = NULL; /* initialize to prevent gcc warning */
if (locale_error_handler(errors, &surrogateescape) < 0)
return NULL;
@@ -3780,19 +3787,16 @@ PyUnicode_DecodeLocaleAndSize(const char *str, Py_ssize_t len,
return unicode;
decode_error:
- reason = NULL;
errmsg = strerror(errno);
assert(errmsg != NULL);
error_pos = mbstowcs_errorpos(str, len);
- if (errmsg != NULL) {
- size_t errlen;
- wstr = Py_DecodeLocale(errmsg, &errlen);
- if (wstr != NULL) {
- reason = PyUnicode_FromWideChar(wstr, errlen);
- PyMem_RawFree(wstr);
- }
+ wstr = Py_DecodeLocale(errmsg, &errlen);
+ if (wstr != NULL) {
+ reason = PyUnicode_FromWideChar(wstr, errlen);
+ PyMem_RawFree(wstr);
}
+
if (reason == NULL)
reason = PyUnicode_FromString(
"mbstowcs() encountered an invalid multibyte sequence");
@@ -3807,7 +3811,7 @@ decode_error:
Py_DECREF(reason);
if (exc != NULL) {
PyCodec_StrictErrors(exc);
- Py_XDECREF(exc);
+ Py_DECREF(exc);
}
return NULL;
}
@@ -3968,7 +3972,7 @@ PyUnicode_FSDecoder(PyObject* arg, void* addr)
}
-char*
+const char *
PyUnicode_AsUTF8AndSize(PyObject *unicode, Py_ssize_t *psize)
{
PyObject *bytes;
@@ -4003,7 +4007,7 @@ PyUnicode_AsUTF8AndSize(PyObject *unicode, Py_ssize_t *psize)
return PyUnicode_UTF8(unicode);
}
-char*
+const char *
PyUnicode_AsUTF8(PyObject *unicode)
{
return PyUnicode_AsUTF8AndSize(unicode, NULL);
@@ -4140,7 +4144,11 @@ PyUnicode_GetSize(PyObject *unicode)
PyErr_BadArgument();
goto onError;
}
- return PyUnicode_GET_SIZE(unicode);
+ if (_PyUnicode_WSTR(unicode) == NULL) {
+ if (PyUnicode_AsUnicode(unicode) == NULL)
+ goto onError;
+ }
+ return PyUnicode_WSTR_LENGTH(unicode);
onError:
return -1;
@@ -4248,7 +4256,7 @@ unicode_decode_call_errorhandler_wchar(
Py_ssize_t *endinpos, PyObject **exceptionObject, const char **inptr,
PyObject **output, Py_ssize_t *outpos)
{
- static const char *argparse = "O!n;decoding error handler must return (str, int) tuple";
+ static const char *argparse = "Un;decoding error handler must return (str, int) tuple";
PyObject *restuple = NULL;
PyObject *repunicode = NULL;
@@ -4281,10 +4289,10 @@ unicode_decode_call_errorhandler_wchar(
if (restuple == NULL)
goto onError;
if (!PyTuple_Check(restuple)) {
- PyErr_SetString(PyExc_TypeError, &argparse[4]);
+ PyErr_SetString(PyExc_TypeError, &argparse[3]);
goto onError;
}
- if (!PyArg_ParseTuple(restuple, argparse, &PyUnicode_Type, &repunicode, &newpos))
+ if (!PyArg_ParseTuple(restuple, argparse, &repunicode, &newpos))
goto onError;
/* Copy back the bytes variables, which might have been modified by the
@@ -4292,9 +4300,6 @@ unicode_decode_call_errorhandler_wchar(
inputobj = PyUnicodeDecodeError_GetObject(*exceptionObject);
if (!inputobj)
goto onError;
- if (!PyBytes_Check(inputobj)) {
- PyErr_Format(PyExc_TypeError, "exception attribute object must be bytes");
- }
*input = PyBytes_AS_STRING(inputobj);
insize = PyBytes_GET_SIZE(inputobj);
*inend = *input + insize;
@@ -4335,7 +4340,7 @@ unicode_decode_call_errorhandler_wchar(
*inptr = *input + newpos;
/* we made it! */
- Py_XDECREF(restuple);
+ Py_DECREF(restuple);
return 0;
overflow:
@@ -4356,7 +4361,7 @@ unicode_decode_call_errorhandler_writer(
Py_ssize_t *endinpos, PyObject **exceptionObject, const char **inptr,
_PyUnicodeWriter *writer /* PyObject **output, Py_ssize_t *outpos */)
{
- static const char *argparse = "O!n;decoding error handler must return (str, int) tuple";
+ static const char *argparse = "Un;decoding error handler must return (str, int) tuple";
PyObject *restuple = NULL;
PyObject *repunicode = NULL;
@@ -4383,10 +4388,10 @@ unicode_decode_call_errorhandler_writer(
if (restuple == NULL)
goto onError;
if (!PyTuple_Check(restuple)) {
- PyErr_SetString(PyExc_TypeError, &argparse[4]);
+ PyErr_SetString(PyExc_TypeError, &argparse[3]);
goto onError;
}
- if (!PyArg_ParseTuple(restuple, argparse, &PyUnicode_Type, &repunicode, &newpos))
+ if (!PyArg_ParseTuple(restuple, argparse, &repunicode, &newpos))
goto onError;
/* Copy back the bytes variables, which might have been modified by the
@@ -4394,9 +4399,6 @@ unicode_decode_call_errorhandler_writer(
inputobj = PyUnicodeDecodeError_GetObject(*exceptionObject);
if (!inputobj)
goto onError;
- if (!PyBytes_Check(inputobj)) {
- PyErr_Format(PyExc_TypeError, "exception attribute object must be bytes");
- }
*input = PyBytes_AS_STRING(inputobj);
insize = PyBytes_GET_SIZE(inputobj);
*inend = *input + insize;
@@ -4411,8 +4413,6 @@ unicode_decode_call_errorhandler_writer(
goto onError;
}
- if (PyUnicode_READY(repunicode) < 0)
- goto onError;
replen = PyUnicode_GET_LENGTH(repunicode);
if (replen > 1) {
writer->min_length += replen - 1;
@@ -4428,7 +4428,7 @@ unicode_decode_call_errorhandler_writer(
*inptr = *input + newpos;
/* we made it! */
- Py_XDECREF(restuple);
+ Py_DECREF(restuple);
return 0;
onError:
@@ -4834,7 +4834,7 @@ PyUnicode_EncodeUTF7(const Py_UNICODE *s,
const char *errors)
{
PyObject *result;
- PyObject *tmp = PyUnicode_FromUnicode(s, size);
+ PyObject *tmp = PyUnicode_FromWideChar(s, size);
if (tmp == NULL)
return NULL;
result = _PyUnicode_EncodeUTF7(tmp, base64SetO,
@@ -5190,7 +5190,7 @@ PyUnicode_EncodeUTF8(const Py_UNICODE *s,
{
PyObject *v, *unicode;
- unicode = PyUnicode_FromUnicode(s, size);
+ unicode = PyUnicode_FromWideChar(s, size);
if (unicode == NULL)
return NULL;
v = _PyUnicode_AsUTF8String(unicode, errors);
@@ -5515,7 +5515,7 @@ PyUnicode_EncodeUTF32(const Py_UNICODE *s,
int byteorder)
{
PyObject *result;
- PyObject *tmp = PyUnicode_FromUnicode(s, size);
+ PyObject *tmp = PyUnicode_FromWideChar(s, size);
if (tmp == NULL)
return NULL;
result = _PyUnicode_EncodeUTF32(tmp, errors, byteorder);
@@ -5868,7 +5868,7 @@ PyUnicode_EncodeUTF16(const Py_UNICODE *s,
int byteorder)
{
PyObject *result;
- PyObject *tmp = PyUnicode_FromUnicode(s, size);
+ PyObject *tmp = PyUnicode_FromWideChar(s, size);
if (tmp == NULL)
return NULL;
result = _PyUnicode_EncodeUTF16(tmp, errors, byteorder);
@@ -6259,7 +6259,7 @@ PyUnicode_EncodeUnicodeEscape(const Py_UNICODE *s,
Py_ssize_t size)
{
PyObject *result;
- PyObject *tmp = PyUnicode_FromUnicode(s, size);
+ PyObject *tmp = PyUnicode_FromWideChar(s, size);
if (tmp == NULL) {
return NULL;
}
@@ -6476,7 +6476,7 @@ PyUnicode_EncodeRawUnicodeEscape(const Py_UNICODE *s,
Py_ssize_t size)
{
PyObject *result;
- PyObject *tmp = PyUnicode_FromUnicode(s, size);
+ PyObject *tmp = PyUnicode_FromWideChar(s, size);
if (tmp == NULL)
return NULL;
result = PyUnicode_AsRawUnicodeEscapeString(tmp);
@@ -6814,7 +6814,7 @@ unicode_encode_ucs1(PyObject *unicode,
goto onError;
/* subtract preallocated bytes */
- writer.min_size -= 1;
+ writer.min_size -= newpos - collstart;
if (PyBytes_Check(rep)) {
/* Directly copy bytes result to output. */
@@ -6830,33 +6830,19 @@ unicode_encode_ucs1(PyObject *unicode,
if (PyUnicode_READY(rep) < 0)
goto onError;
- if (PyUnicode_IS_ASCII(rep)) {
- /* Fast path: all characters are smaller than limit */
- assert(limit >= 128);
- assert(PyUnicode_KIND(rep) == PyUnicode_1BYTE_KIND);
- str = _PyBytesWriter_WriteBytes(&writer, str,
- PyUnicode_DATA(rep),
- PyUnicode_GET_LENGTH(rep));
- }
- else {
- Py_ssize_t repsize = PyUnicode_GET_LENGTH(rep);
-
- str = _PyBytesWriter_Prepare(&writer, str, repsize);
- if (str == NULL)
- goto onError;
-
- /* check if there is anything unencodable in the
- replacement and copy it to the output */
- for (i = 0; repsize-->0; ++i, ++str) {
- ch = PyUnicode_READ_CHAR(rep, i);
- if (ch >= limit) {
- raise_encode_exception(&exc, encoding, unicode,
- pos, pos+1, reason);
- goto onError;
- }
- *str = (char)ch;
- }
+ if (limit == 256 ?
+ PyUnicode_KIND(rep) != PyUnicode_1BYTE_KIND :
+ !PyUnicode_IS_ASCII(rep))
+ {
+ /* Not all characters are smaller than limit */
+ raise_encode_exception(&exc, encoding, unicode,
+ collstart, collend, reason);
+ goto onError;
}
+ assert(PyUnicode_KIND(rep) == PyUnicode_1BYTE_KIND);
+ str = _PyBytesWriter_WriteBytes(&writer, str,
+ PyUnicode_DATA(rep),
+ PyUnicode_GET_LENGTH(rep));
}
pos = newpos;
Py_CLEAR(rep);
@@ -6887,7 +6873,7 @@ PyUnicode_EncodeLatin1(const Py_UNICODE *p,
const char *errors)
{
PyObject *result;
- PyObject *unicode = PyUnicode_FromUnicode(p, size);
+ PyObject *unicode = PyUnicode_FromWideChar(p, size);
if (unicode == NULL)
return NULL;
result = unicode_encode_ucs1(unicode, errors, 256);
@@ -7028,7 +7014,7 @@ PyUnicode_EncodeASCII(const Py_UNICODE *p,
const char *errors)
{
PyObject *result;
- PyObject *unicode = PyUnicode_FromUnicode(p, size);
+ PyObject *unicode = PyUnicode_FromWideChar(p, size);
if (unicode == NULL)
return NULL;
result = unicode_encode_ucs1(unicode, errors, 128);
@@ -7754,7 +7740,7 @@ PyUnicode_EncodeMBCS(const Py_UNICODE *p,
const char *errors)
{
PyObject *unicode, *res;
- unicode = PyUnicode_FromUnicode(p, size);
+ unicode = PyUnicode_FromWideChar(p, size);
if (unicode == NULL)
return NULL;
res = encode_code_page(CP_ACP, unicode, errors);
@@ -8268,9 +8254,7 @@ charmapencode_lookup(Py_UCS4 c, PyObject *mapping)
if (PyErr_ExceptionMatches(PyExc_LookupError)) {
/* No mapping found means: mapping is undefined. */
PyErr_Clear();
- x = Py_None;
- Py_INCREF(x);
- return x;
+ Py_RETURN_NONE;
} else
return NULL;
}
@@ -8602,7 +8586,7 @@ PyUnicode_EncodeCharmap(const Py_UNICODE *p,
const char *errors)
{
PyObject *result;
- PyObject *unicode = PyUnicode_FromUnicode(p, size);
+ PyObject *unicode = PyUnicode_FromWideChar(p, size);
if (unicode == NULL)
return NULL;
result = _PyUnicode_EncodeCharmap(unicode, mapping, errors);
@@ -8657,7 +8641,7 @@ unicode_translate_call_errorhandler(const char *errors,
Py_ssize_t startpos, Py_ssize_t endpos,
Py_ssize_t *newpos)
{
- static const char *argparse = "O!n;translating error handler must return (str, int) tuple";
+ static const char *argparse = "Un;translating error handler must return (str, int) tuple";
Py_ssize_t i_newpos;
PyObject *restuple;
@@ -8679,11 +8663,11 @@ unicode_translate_call_errorhandler(const char *errors,
if (restuple == NULL)
return NULL;
if (!PyTuple_Check(restuple)) {
- PyErr_SetString(PyExc_TypeError, &argparse[4]);
+ PyErr_SetString(PyExc_TypeError, &argparse[3]);
Py_DECREF(restuple);
return NULL;
}
- if (!PyArg_ParseTuple(restuple, argparse, &PyUnicode_Type,
+ if (!PyArg_ParseTuple(restuple, argparse,
&resunicode, &i_newpos)) {
Py_DECREF(restuple);
return NULL;
@@ -9042,7 +9026,7 @@ PyUnicode_TranslateCharmap(const Py_UNICODE *p,
const char *errors)
{
PyObject *result;
- PyObject *unicode = PyUnicode_FromUnicode(p, size);
+ PyObject *unicode = PyUnicode_FromWideChar(p, size);
if (!unicode)
return NULL;
result = _PyUnicode_TranslateCharmap(unicode, mapping, errors);
@@ -9170,14 +9154,10 @@ PyUnicode_EncodeDecimal(Py_UNICODE *s,
return -1;
}
- unicode = PyUnicode_FromUnicode(s, length);
+ unicode = PyUnicode_FromWideChar(s, length);
if (unicode == NULL)
return -1;
- if (PyUnicode_READY(unicode) == -1) {
- Py_DECREF(unicode);
- return -1;
- }
kind = PyUnicode_KIND(unicode);
data = PyUnicode_DATA(unicode);
@@ -9495,16 +9475,12 @@ PyUnicode_FindChar(PyObject *str, Py_UCS4 ch,
int direction)
{
int kind;
- Py_ssize_t result;
+ Py_ssize_t len, result;
if (PyUnicode_READY(str) == -1)
return -2;
- if (start < 0 || end < 0) {
- PyErr_SetString(PyExc_IndexError, "string index out of range");
- return -2;
- }
- if (end > PyUnicode_GET_LENGTH(str))
- end = PyUnicode_GET_LENGTH(str);
- if (start >= end)
+ len = PyUnicode_GET_LENGTH(str);
+ ADJUST_INDICES(start, end, len);
+ if (end - start < 1)
return -1;
kind = PyUnicode_KIND(str);
result = findchar(PyUnicode_1BYTE_DATA(str) + kind*start,
@@ -10748,28 +10724,36 @@ replace(PyObject *self, PyObject *str1,
/* --- Unicode Object Methods --------------------------------------------- */
-PyDoc_STRVAR(title__doc__,
- "S.title() -> str\n\
-\n\
-Return a titlecased version of S, i.e. words start with title case\n\
-characters, all remaining cased characters have lower case.");
+/*[clinic input]
+str.title as unicode_title
-static PyObject*
-unicode_title(PyObject *self)
+Return a version of the string where each word is titlecased.
+
+More specifically, words start with uppercased characters and all remaining
+cased characters have lower case.
+[clinic start generated code]*/
+
+static PyObject *
+unicode_title_impl(PyObject *self)
+/*[clinic end generated code: output=c75ae03809574902 input=fa945d669b26e683]*/
{
if (PyUnicode_READY(self) == -1)
return NULL;
return case_operation(self, do_title);
}
-PyDoc_STRVAR(capitalize__doc__,
- "S.capitalize() -> str\n\
-\n\
-Return a capitalized version of S, i.e. make the first character\n\
-have upper case and the rest lower case.");
+/*[clinic input]
+str.capitalize as unicode_capitalize
-static PyObject*
-unicode_capitalize(PyObject *self)
+Return a capitalized version of the string.
+
+More specifically, make the first character have upper case and the rest lower
+case.
+[clinic start generated code]*/
+
+static PyObject *
+unicode_capitalize_impl(PyObject *self)
+/*[clinic end generated code: output=e49a4c333cdb7667 input=f4cbf1016938da6d]*/
{
if (PyUnicode_READY(self) == -1)
return NULL;
@@ -10778,13 +10762,15 @@ unicode_capitalize(PyObject *self)
return case_operation(self, do_capitalize);
}
-PyDoc_STRVAR(casefold__doc__,
- "S.casefold() -> str\n\
-\n\
-Return a version of S suitable for caseless comparisons.");
+/*[clinic input]
+str.casefold as unicode_casefold
+
+Return a version of the string suitable for caseless comparisons.
+[clinic start generated code]*/
static PyObject *
-unicode_casefold(PyObject *self)
+unicode_casefold_impl(PyObject *self)
+/*[clinic end generated code: output=0120daf657ca40af input=384d66cc2ae30daf]*/
{
if (PyUnicode_READY(self) == -1)
return NULL;
@@ -10818,21 +10804,23 @@ convert_uc(PyObject *obj, void *addr)
return 1;
}
-PyDoc_STRVAR(center__doc__,
- "S.center(width[, fillchar]) -> str\n\
-\n\
-Return S centered in a string of length width. Padding is\n\
-done using the specified fill character (default is a space)");
+/*[clinic input]
+str.center as unicode_center
+
+ width: Py_ssize_t
+ fillchar: Py_UCS4 = ' '
+ /
+
+Return a centered string of length width.
+
+Padding is done using the specified fill character (default is a space).
+[clinic start generated code]*/
static PyObject *
-unicode_center(PyObject *self, PyObject *args)
+unicode_center_impl(PyObject *self, Py_ssize_t width, Py_UCS4 fillchar)
+/*[clinic end generated code: output=420c8859effc7c0c input=b42b247eb26e6519]*/
{
Py_ssize_t marg, left;
- Py_ssize_t width;
- Py_UCS4 fillchar = ' ';
-
- if (!PyArg_ParseTuple(args, "n|O&:center", &width, convert_uc, &fillchar))
- return NULL;
if (PyUnicode_READY(self) == -1)
return NULL;
@@ -11503,51 +11491,49 @@ unicode_count(PyObject *self, PyObject *args)
return result;
}
-PyDoc_STRVAR(encode__doc__,
- "S.encode(encoding='utf-8', errors='strict') -> bytes\n\
-\n\
-Encode S using the codec registered for encoding. Default encoding\n\
-is 'utf-8'. errors may be given to set a different error\n\
-handling scheme. Default is 'strict' meaning that encoding errors raise\n\
-a UnicodeEncodeError. Other possible values are 'ignore', 'replace' and\n\
-'xmlcharrefreplace' as well as any other name registered with\n\
-codecs.register_error that can handle UnicodeEncodeErrors.");
+/*[clinic input]
+str.encode as unicode_encode
+
+ encoding: str(c_default="NULL") = 'utf-8'
+ The encoding in which to encode the string.
+ errors: str(c_default="NULL") = 'strict'
+ The error handling scheme to use for encoding errors.
+ The default is 'strict' meaning that encoding errors raise a
+ UnicodeEncodeError. Other possible values are 'ignore', 'replace' and
+ 'xmlcharrefreplace' as well as any other name registered with
+ codecs.register_error that can handle UnicodeEncodeErrors.
+
+Encode the string using the codec registered for encoding.
+[clinic start generated code]*/
static PyObject *
-unicode_encode(PyObject *self, PyObject *args, PyObject *kwargs)
+unicode_encode_impl(PyObject *self, const char *encoding, const char *errors)
+/*[clinic end generated code: output=bf78b6e2a9470e3c input=f0a9eb293d08fe02]*/
{
- static char *kwlist[] = {"encoding", "errors", 0};
- char *encoding = NULL;
- char *errors = NULL;
-
- if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|ss:encode",
- kwlist, &encoding, &errors))
- return NULL;
return PyUnicode_AsEncodedString(self, encoding, errors);
}
-PyDoc_STRVAR(expandtabs__doc__,
- "S.expandtabs(tabsize=8) -> str\n\
-\n\
-Return a copy of S where all tab characters are expanded using spaces.\n\
-If tabsize is not given, a tab size of 8 characters is assumed.");
+/*[clinic input]
+str.expandtabs as unicode_expandtabs
-static PyObject*
-unicode_expandtabs(PyObject *self, PyObject *args, PyObject *kwds)
+ tabsize: int = 8
+
+Return a copy where all tab characters are expanded using spaces.
+
+If tabsize is not given, a tab size of 8 characters is assumed.
+[clinic start generated code]*/
+
+static PyObject *
+unicode_expandtabs_impl(PyObject *self, int tabsize)
+/*[clinic end generated code: output=3457c5dcee26928f input=8a01914034af4c85]*/
{
Py_ssize_t i, j, line_pos, src_len, incr;
Py_UCS4 ch;
PyObject *u;
void *src_data, *dest_data;
- static char *kwlist[] = {"tabsize", 0};
- int tabsize = 8;
int kind;
int found;
- if (!PyArg_ParseTupleAndKeywords(args, kwds, "|i:expandtabs",
- kwlist, &tabsize))
- return NULL;
-
if (PyUnicode_READY(self) == -1)
return NULL;
@@ -11731,14 +11717,18 @@ unicode_index(PyObject *self, PyObject *args)
return PyLong_FromSsize_t(result);
}
-PyDoc_STRVAR(islower__doc__,
- "S.islower() -> bool\n\
-\n\
-Return True if all cased characters in S are lowercase and there is\n\
-at least one cased character in S, False otherwise.");
+/*[clinic input]
+str.islower as unicode_islower
-static PyObject*
-unicode_islower(PyObject *self)
+Return True if the string is a lowercase string, False otherwise.
+
+A string is lowercase if all cased characters in the string are lowercase and
+there is at least one cased character in the string.
+[clinic start generated code]*/
+
+static PyObject *
+unicode_islower_impl(PyObject *self)
+/*[clinic end generated code: output=dbd41995bd005b81 input=acec65ac6821ae47]*/
{
Py_ssize_t i, length;
int kind;
@@ -11772,14 +11762,18 @@ unicode_islower(PyObject *self)
return PyBool_FromLong(cased);
}
-PyDoc_STRVAR(isupper__doc__,
- "S.isupper() -> bool\n\
-\n\
-Return True if all cased characters in S are uppercase and there is\n\
-at least one cased character in S, False otherwise.");
+/*[clinic input]
+str.isupper as unicode_isupper
-static PyObject*
-unicode_isupper(PyObject *self)
+Return True if the string is an uppercase string, False otherwise.
+
+A string is uppercase if all cased characters in the string are uppercase and
+there is at least one cased character in the string.
+[clinic start generated code]*/
+
+static PyObject *
+unicode_isupper_impl(PyObject *self)
+/*[clinic end generated code: output=049209c8e7f15f59 input=e9b1feda5d17f2d3]*/
{
Py_ssize_t i, length;
int kind;
@@ -11813,16 +11807,18 @@ unicode_isupper(PyObject *self)
return PyBool_FromLong(cased);
}
-PyDoc_STRVAR(istitle__doc__,
- "S.istitle() -> bool\n\
-\n\
-Return True if S is a titlecased string and there is at least one\n\
-character in S, i.e. upper- and titlecase characters may only\n\
-follow uncased characters and lowercase characters only cased ones.\n\
-Return False otherwise.");
+/*[clinic input]
+str.istitle as unicode_istitle
-static PyObject*
-unicode_istitle(PyObject *self)
+Return True if the string is a title-cased string, False otherwise.
+
+In a title-cased string, upper- and title-case characters may only
+follow uncased characters and lowercase characters only cased ones.
+[clinic start generated code]*/
+
+static PyObject *
+unicode_istitle_impl(PyObject *self)
+/*[clinic end generated code: output=e9bf6eb91f5d3f0e input=98d32bd2e1f06f8c]*/
{
Py_ssize_t i, length;
int kind;
@@ -11869,14 +11865,18 @@ unicode_istitle(PyObject *self)
return PyBool_FromLong(cased);
}
-PyDoc_STRVAR(isspace__doc__,
- "S.isspace() -> bool\n\
-\n\
-Return True if all characters in S are whitespace\n\
-and there is at least one character in S, False otherwise.");
+/*[clinic input]
+str.isspace as unicode_isspace
-static PyObject*
-unicode_isspace(PyObject *self)
+Return True if the string is a whitespace string, False otherwise.
+
+A string is whitespace if all characters in the string are whitespace and there
+is at least one character in the string.
+[clinic start generated code]*/
+
+static PyObject *
+unicode_isspace_impl(PyObject *self)
+/*[clinic end generated code: output=163a63bfa08ac2b9 input=fe462cb74f8437d8]*/
{
Py_ssize_t i, length;
int kind;
@@ -11905,14 +11905,18 @@ unicode_isspace(PyObject *self)
return PyBool_FromLong(1);
}
-PyDoc_STRVAR(isalpha__doc__,
- "S.isalpha() -> bool\n\
-\n\
-Return True if all characters in S are alphabetic\n\
-and there is at least one character in S, False otherwise.");
+/*[clinic input]
+str.isalpha as unicode_isalpha
-static PyObject*
-unicode_isalpha(PyObject *self)
+Return True if the string is an alphabetic string, False otherwise.
+
+A string is alphabetic if all characters in the string are alphabetic and there
+is at least one character in the string.
+[clinic start generated code]*/
+
+static PyObject *
+unicode_isalpha_impl(PyObject *self)
+/*[clinic end generated code: output=cc81b9ac3883ec4f input=d0fd18a96cbca5eb]*/
{
Py_ssize_t i, length;
int kind;
@@ -11940,14 +11944,18 @@ unicode_isalpha(PyObject *self)
return PyBool_FromLong(1);
}
-PyDoc_STRVAR(isalnum__doc__,
- "S.isalnum() -> bool\n\
-\n\
-Return True if all characters in S are alphanumeric\n\
-and there is at least one character in S, False otherwise.");
+/*[clinic input]
+str.isalnum as unicode_isalnum
-static PyObject*
-unicode_isalnum(PyObject *self)
+Return True if the string is an alpha-numeric string, False otherwise.
+
+A string is alpha-numeric if all characters in the string are alpha-numeric and
+there is at least one character in the string.
+[clinic start generated code]*/
+
+static PyObject *
+unicode_isalnum_impl(PyObject *self)
+/*[clinic end generated code: output=a5a23490ffc3660c input=5c6579bf2e04758c]*/
{
int kind;
void *data;
@@ -11978,14 +11986,18 @@ unicode_isalnum(PyObject *self)
return PyBool_FromLong(1);
}
-PyDoc_STRVAR(isdecimal__doc__,
- "S.isdecimal() -> bool\n\
-\n\
-Return True if there are only decimal characters in S,\n\
-False otherwise.");
+/*[clinic input]
+str.isdecimal as unicode_isdecimal
-static PyObject*
-unicode_isdecimal(PyObject *self)
+Return True if the string is a decimal string, False otherwise.
+
+A string is a decimal string if all characters in the string are decimal and
+there is at least one character in the string.
+[clinic start generated code]*/
+
+static PyObject *
+unicode_isdecimal_impl(PyObject *self)
+/*[clinic end generated code: output=fb2dcdb62d3fc548 input=336bc97ab4c8268f]*/
{
Py_ssize_t i, length;
int kind;
@@ -12013,14 +12025,18 @@ unicode_isdecimal(PyObject *self)
return PyBool_FromLong(1);
}
-PyDoc_STRVAR(isdigit__doc__,
- "S.isdigit() -> bool\n\
-\n\
-Return True if all characters in S are digits\n\
-and there is at least one character in S, False otherwise.");
+/*[clinic input]
+str.isdigit as unicode_isdigit
-static PyObject*
-unicode_isdigit(PyObject *self)
+Return True if the string is a digit string, False otherwise.
+
+A string is a digit string if all characters in the string are digits and there
+is at least one character in the string.
+[clinic start generated code]*/
+
+static PyObject *
+unicode_isdigit_impl(PyObject *self)
+/*[clinic end generated code: output=10a6985311da6858 input=901116c31deeea4c]*/
{
Py_ssize_t i, length;
int kind;
@@ -12049,14 +12065,18 @@ unicode_isdigit(PyObject *self)
return PyBool_FromLong(1);
}
-PyDoc_STRVAR(isnumeric__doc__,
- "S.isnumeric() -> bool\n\
-\n\
-Return True if there are only numeric characters in S,\n\
-False otherwise.");
+/*[clinic input]
+str.isnumeric as unicode_isnumeric
-static PyObject*
-unicode_isnumeric(PyObject *self)
+Return True if the string is a numeric string, False otherwise.
+
+A string is numeric if all characters in the string are numeric and there is at
+least one character in the string.
+[clinic start generated code]*/
+
+static PyObject *
+unicode_isnumeric_impl(PyObject *self)
+/*[clinic end generated code: output=9172a32d9013051a input=722507db976f826c]*/
{
Py_ssize_t i, length;
int kind;
@@ -12121,29 +12141,34 @@ PyUnicode_IsIdentifier(PyObject *self)
return 1;
}
-PyDoc_STRVAR(isidentifier__doc__,
- "S.isidentifier() -> bool\n\
-\n\
-Return True if S is a valid identifier according\n\
-to the language definition.\n\
-\n\
-Use keyword.iskeyword() to test for reserved identifiers\n\
-such as \"def\" and \"class\".\n");
+/*[clinic input]
+str.isidentifier as unicode_isidentifier
-static PyObject*
-unicode_isidentifier(PyObject *self)
+Return True if the string is a valid Python identifier, False otherwise.
+
+Use keyword.iskeyword() to test for reserved identifiers such as "def" and
+"class".
+[clinic start generated code]*/
+
+static PyObject *
+unicode_isidentifier_impl(PyObject *self)
+/*[clinic end generated code: output=fe585a9666572905 input=916b0a3c9f57e919]*/
{
return PyBool_FromLong(PyUnicode_IsIdentifier(self));
}
-PyDoc_STRVAR(isprintable__doc__,
- "S.isprintable() -> bool\n\
-\n\
-Return True if all characters in S are considered\n\
-printable in repr() or S is empty, False otherwise.");
+/*[clinic input]
+str.isprintable as unicode_isprintable
-static PyObject*
-unicode_isprintable(PyObject *self)
+Return True if the string is printable, False otherwise.
+
+A string is printable if all of its characters are considered printable in
+repr() or if it is empty.
+[clinic start generated code]*/
+
+static PyObject *
+unicode_isprintable_impl(PyObject *self)
+/*[clinic end generated code: output=3ab9626cd32dd1a0 input=98a0e1c2c1813209]*/
{
Py_ssize_t i, length;
int kind;
@@ -12168,16 +12193,25 @@ unicode_isprintable(PyObject *self)
Py_RETURN_TRUE;
}
-PyDoc_STRVAR(join__doc__,
- "S.join(iterable) -> str\n\
-\n\
-Return a string which is the concatenation of the strings in the\n\
-iterable. The separator between elements is S.");
+/*[clinic input]
+str.join as unicode_join
-static PyObject*
-unicode_join(PyObject *self, PyObject *data)
+ iterable: object
+ /
+
+Concatenate any number of strings.
+
+The string whose method is called is inserted in between each given string.
+The result is returned as a new string.
+
+Example: '.'.join(['ab', 'pq', 'rs']) -> 'ab.pq.rs'
+[clinic start generated code]*/
+
+static PyObject *
+unicode_join(PyObject *self, PyObject *iterable)
+/*[clinic end generated code: output=6857e7cecfe7bf98 input=2f70422bfb8fa189]*/
{
- return PyUnicode_Join(self, data);
+ return PyUnicode_Join(self, iterable);
}
static Py_ssize_t
@@ -12188,21 +12222,22 @@ unicode_length(PyObject *self)
return PyUnicode_GET_LENGTH(self);
}
-PyDoc_STRVAR(ljust__doc__,
- "S.ljust(width[, fillchar]) -> str\n\
-\n\
-Return S left-justified in a Unicode string of length width. Padding is\n\
-done using the specified fill character (default is a space).");
+/*[clinic input]
+str.ljust as unicode_ljust
-static PyObject *
-unicode_ljust(PyObject *self, PyObject *args)
-{
- Py_ssize_t width;
- Py_UCS4 fillchar = ' ';
+ width: Py_ssize_t
+ fillchar: Py_UCS4 = ' '
+ /
- if (!PyArg_ParseTuple(args, "n|O&:ljust", &width, convert_uc, &fillchar))
- return NULL;
+Return a left-justified string of length width.
+
+Padding is done using the specified fill character (default is a space).
+[clinic start generated code]*/
+static PyObject *
+unicode_ljust_impl(PyObject *self, Py_ssize_t width, Py_UCS4 fillchar)
+/*[clinic end generated code: output=1cce0e0e0a0b84b3 input=3ab599e335e60a32]*/
+{
if (PyUnicode_READY(self) == -1)
return NULL;
@@ -12212,13 +12247,15 @@ unicode_ljust(PyObject *self, PyObject *args)
return pad(self, 0, width - PyUnicode_GET_LENGTH(self), fillchar);
}
-PyDoc_STRVAR(lower__doc__,
- "S.lower() -> str\n\
-\n\
-Return a copy of the string S converted to lowercase.");
+/*[clinic input]
+str.lower as unicode_lower
-static PyObject*
-unicode_lower(PyObject *self)
+Return a copy of the string converted to lowercase.
+[clinic start generated code]*/
+
+static PyObject *
+unicode_lower_impl(PyObject *self)
+/*[clinic end generated code: output=84ef9ed42efad663 input=60a2984b8beff23a]*/
{
if (PyUnicode_READY(self) == -1)
return NULL;
@@ -12232,9 +12269,9 @@ unicode_lower(PyObject *self)
#define BOTHSTRIP 2
/* Arrays indexed by above */
-static const char * const stripformat[] = {"|O:lstrip", "|O:rstrip", "|O:strip"};
+static const char *stripfuncnames[] = {"lstrip", "rstrip", "strip"};
-#define STRIPNAME(i) (stripformat[i]+3)
+#define STRIPNAME(i) (stripfuncnames[i])
/* externally visible for str.strip(unicode) */
PyObject *
@@ -12391,13 +12428,8 @@ do_strip(PyObject *self, int striptype)
static PyObject *
-do_argstrip(PyObject *self, int striptype, PyObject *args)
+do_argstrip(PyObject *self, int striptype, PyObject *sep)
{
- PyObject *sep = NULL;
-
- if (!PyArg_ParseTuple(args, stripformat[striptype], &sep))
- return NULL;
-
if (sep != NULL && sep != Py_None) {
if (PyUnicode_Check(sep))
return _PyUnicode_XStrip(self, striptype, sep);
@@ -12413,52 +12445,60 @@ do_argstrip(PyObject *self, int striptype, PyObject *args)
}
-PyDoc_STRVAR(strip__doc__,
- "S.strip([chars]) -> str\n\
-\n\
-Return a copy of the string S with leading and trailing\n\
-whitespace removed.\n\
-If chars is given and not None, remove characters in chars instead.");
+/*[clinic input]
+str.strip as unicode_strip
+
+ chars: object = None
+ /
+
+Return a copy of the string with leading and trailing whitespace remove.
+
+If chars is given and not None, remove characters in chars instead.
+[clinic start generated code]*/
static PyObject *
-unicode_strip(PyObject *self, PyObject *args)
+unicode_strip_impl(PyObject *self, PyObject *chars)
+/*[clinic end generated code: output=ca19018454345d57 input=eefe24a1059c352b]*/
{
- if (PyTuple_GET_SIZE(args) == 0)
- return do_strip(self, BOTHSTRIP); /* Common case */
- else
- return do_argstrip(self, BOTHSTRIP, args);
+ return do_argstrip(self, BOTHSTRIP, chars);
}
-PyDoc_STRVAR(lstrip__doc__,
- "S.lstrip([chars]) -> str\n\
-\n\
-Return a copy of the string S with leading whitespace removed.\n\
-If chars is given and not None, remove characters in chars instead.");
+/*[clinic input]
+str.lstrip as unicode_lstrip
+
+ chars: object = NULL
+ /
+
+Return a copy of the string with leading whitespace removed.
+
+If chars is given and not None, remove characters in chars instead.
+[clinic start generated code]*/
static PyObject *
-unicode_lstrip(PyObject *self, PyObject *args)
+unicode_lstrip_impl(PyObject *self, PyObject *chars)
+/*[clinic end generated code: output=3b43683251f79ca7 input=9e56f3c45f5ff4c3]*/
{
- if (PyTuple_GET_SIZE(args) == 0)
- return do_strip(self, LEFTSTRIP); /* Common case */
- else
- return do_argstrip(self, LEFTSTRIP, args);
+ return do_argstrip(self, LEFTSTRIP, chars);
}
-PyDoc_STRVAR(rstrip__doc__,
- "S.rstrip([chars]) -> str\n\
-\n\
-Return a copy of the string S with trailing whitespace removed.\n\
-If chars is given and not None, remove characters in chars instead.");
+/*[clinic input]
+str.rstrip as unicode_rstrip
+
+ chars: object = NULL
+ /
+
+Return a copy of the string with trailing whitespace removed.
+
+If chars is given and not None, remove characters in chars instead.
+[clinic start generated code]*/
static PyObject *
-unicode_rstrip(PyObject *self, PyObject *args)
+unicode_rstrip_impl(PyObject *self, PyObject *chars)
+/*[clinic end generated code: output=4a59230017cc3b7a input=ac89d0219cb411ee]*/
{
- if (PyTuple_GET_SIZE(args) == 0)
- return do_strip(self, RIGHTSTRIP); /* Common case */
- else
- return do_argstrip(self, RIGHTSTRIP, args);
+ return do_argstrip(self, RIGHTSTRIP, chars);
}
@@ -12538,25 +12578,30 @@ PyUnicode_Replace(PyObject *str,
return replace(str, substr, replstr, maxcount);
}
-PyDoc_STRVAR(replace__doc__,
- "S.replace(old, new[, count]) -> str\n\
-\n\
-Return a copy of S with all occurrences of substring\n\
-old replaced by new. If the optional argument count is\n\
-given, only the first count occurrences are replaced.");
+/*[clinic input]
+str.replace as unicode_replace
-static PyObject*
-unicode_replace(PyObject *self, PyObject *args)
-{
- PyObject *str1;
- PyObject *str2;
- Py_ssize_t maxcount = -1;
+ old: unicode
+ new: unicode
+ count: Py_ssize_t = -1
+ Maximum number of occurrences to replace.
+ -1 (the default value) means replace all occurrences.
+ /
- if (!PyArg_ParseTuple(args, "UU|n:replace", &str1, &str2, &maxcount))
- return NULL;
+Return a copy with all occurrences of substring old replaced by new.
+
+If the optional argument count is given, only the first count occurrences are
+replaced.
+[clinic start generated code]*/
+
+static PyObject *
+unicode_replace_impl(PyObject *self, PyObject *old, PyObject *new,
+ Py_ssize_t count)
+/*[clinic end generated code: output=b63f1a8b5eebf448 input=147d12206276ebeb]*/
+{
if (PyUnicode_READY(self) == -1)
return NULL;
- return replace(self, str1, str2, maxcount);
+ return replace(self, old, new, count);
}
static PyObject *
@@ -12788,21 +12833,22 @@ unicode_rindex(PyObject *self, PyObject *args)
return PyLong_FromSsize_t(result);
}
-PyDoc_STRVAR(rjust__doc__,
- "S.rjust(width[, fillchar]) -> str\n\
-\n\
-Return S right-justified in a string of length width. Padding is\n\
-done using the specified fill character (default is a space).");
+/*[clinic input]
+str.rjust as unicode_rjust
-static PyObject *
-unicode_rjust(PyObject *self, PyObject *args)
-{
- Py_ssize_t width;
- Py_UCS4 fillchar = ' ';
+ width: Py_ssize_t
+ fillchar: Py_UCS4 = ' '
+ /
- if (!PyArg_ParseTuple(args, "n|O&:rjust", &width, convert_uc, &fillchar))
- return NULL;
+Return a right-justified string of length width.
+Padding is done using the specified fill character (default is a space).
+[clinic start generated code]*/
+
+static PyObject *
+unicode_rjust_impl(PyObject *self, Py_ssize_t width, Py_UCS4 fillchar)
+/*[clinic end generated code: output=804a1a57fbe8d5cf input=d05f550b5beb1f72]*/
+{
if (PyUnicode_READY(self) == -1)
return NULL;
@@ -12821,35 +12867,32 @@ PyUnicode_Split(PyObject *s, PyObject *sep, Py_ssize_t maxsplit)
return split(s, sep, maxsplit);
}
-PyDoc_STRVAR(split__doc__,
- "S.split(sep=None, maxsplit=-1) -> list of strings\n\
-\n\
-Return a list of the words in S, using sep as the\n\
-delimiter string. If maxsplit is given, at most maxsplit\n\
-splits are done. If sep is not specified or is None, any\n\
-whitespace string is a separator and empty strings are\n\
-removed from the result.");
-
-static PyObject*
-unicode_split(PyObject *self, PyObject *args, PyObject *kwds)
-{
- static char *kwlist[] = {"sep", "maxsplit", 0};
- PyObject *substring = Py_None;
- Py_ssize_t maxcount = -1;
+/*[clinic input]
+str.split as unicode_split
- if (!PyArg_ParseTupleAndKeywords(args, kwds, "|On:split",
- kwlist, &substring, &maxcount))
- return NULL;
+ sep: object = None
+ The delimiter according which to split the string.
+ None (the default value) means split according to any whitespace,
+ and discard empty strings from the result.
+ maxsplit: Py_ssize_t = -1
+ Maximum number of splits to do.
+ -1 (the default value) means no limit.
- if (substring == Py_None)
- return split(self, NULL, maxcount);
+Return a list of the words in the string, using sep as the delimiter string.
+[clinic start generated code]*/
- if (PyUnicode_Check(substring))
- return split(self, substring, maxcount);
+static PyObject *
+unicode_split_impl(PyObject *self, PyObject *sep, Py_ssize_t maxsplit)
+/*[clinic end generated code: output=3a65b1db356948dc input=606e750488a82359]*/
+{
+ if (sep == Py_None)
+ return split(self, NULL, maxsplit);
+ if (PyUnicode_Check(sep))
+ return split(self, sep, maxsplit);
PyErr_Format(PyExc_TypeError,
"must be str or None, not %.100s",
- Py_TYPE(substring)->tp_name);
+ Py_TYPE(sep)->tp_name);
return NULL;
}
@@ -12968,30 +13011,47 @@ PyUnicode_RPartition(PyObject *str_obj, PyObject *sep_obj)
return out;
}
-PyDoc_STRVAR(partition__doc__,
- "S.partition(sep) -> (head, sep, tail)\n\
-\n\
-Search for the separator sep in S, and return the part before it,\n\
-the separator itself, and the part after it. If the separator is not\n\
-found, return S and two empty strings.");
+/*[clinic input]
+str.partition as unicode_partition
-static PyObject*
-unicode_partition(PyObject *self, PyObject *separator)
+ sep: object
+ /
+
+Partition the string into three parts using the given separator.
+
+This will search for the separator in the string. If the separator is found,
+returns a 3-tuple containing the part before the separator, the separator
+itself, and the part after it.
+
+If the separator is not found, returns a 3-tuple containing the original string
+and two empty strings.
+[clinic start generated code]*/
+
+static PyObject *
+unicode_partition(PyObject *self, PyObject *sep)
+/*[clinic end generated code: output=e4ced7bd253ca3c4 input=f29b8d06c63e50be]*/
{
- return PyUnicode_Partition(self, separator);
+ return PyUnicode_Partition(self, sep);
}
-PyDoc_STRVAR(rpartition__doc__,
- "S.rpartition(sep) -> (head, sep, tail)\n\
-\n\
-Search for the separator sep in S, starting at the end of S, and return\n\
-the part before it, the separator itself, and the part after it. If the\n\
-separator is not found, return two empty strings and S.");
+/*[clinic input]
+str.rpartition as unicode_rpartition = str.partition
-static PyObject*
-unicode_rpartition(PyObject *self, PyObject *separator)
+Partition the string into three parts using the given separator.
+
+This will search for the separator in the string, starting and the end. If
+the separator is found, returns a 3-tuple containing the part before the
+separator, the separator itself, and the part after it.
+
+If the separator is not found, returns a 3-tuple containing two empty strings
+and the original string.
+[clinic start generated code]*/
+
+static PyObject *
+unicode_rpartition(PyObject *self, PyObject *sep)
+/*[clinic end generated code: output=1aa13cf1156572aa input=e77c7acb69bdfca6]*/
{
- return PyUnicode_RPartition(self, separator);
+ return PyUnicode_RPartition(self, sep);
}
PyObject *
@@ -13003,55 +13063,44 @@ PyUnicode_RSplit(PyObject *s, PyObject *sep, Py_ssize_t maxsplit)
return rsplit(s, sep, maxsplit);
}
-PyDoc_STRVAR(rsplit__doc__,
- "S.rsplit(sep=None, maxsplit=-1) -> list of strings\n\
-\n\
-Return a list of the words in S, using sep as the\n\
-delimiter string, starting at the end of the string and\n\
-working to the front. If maxsplit is given, at most maxsplit\n\
-splits are done. If sep is not specified, any whitespace string\n\
-is a separator.");
-
-static PyObject*
-unicode_rsplit(PyObject *self, PyObject *args, PyObject *kwds)
-{
- static char *kwlist[] = {"sep", "maxsplit", 0};
- PyObject *substring = Py_None;
- Py_ssize_t maxcount = -1;
+/*[clinic input]
+str.rsplit as unicode_rsplit = str.split
- if (!PyArg_ParseTupleAndKeywords(args, kwds, "|On:rsplit",
- kwlist, &substring, &maxcount))
- return NULL;
+Return a list of the words in the string, using sep as the delimiter string.
- if (substring == Py_None)
- return rsplit(self, NULL, maxcount);
+Splits are done starting at the end of the string and working to the front.
+[clinic start generated code]*/
- if (PyUnicode_Check(substring))
- return rsplit(self, substring, maxcount);
+static PyObject *
+unicode_rsplit_impl(PyObject *self, PyObject *sep, Py_ssize_t maxsplit)
+/*[clinic end generated code: output=c2b815c63bcabffc input=12ad4bf57dd35f15]*/
+{
+ if (sep == Py_None)
+ return rsplit(self, NULL, maxsplit);
+ if (PyUnicode_Check(sep))
+ return rsplit(self, sep, maxsplit);
PyErr_Format(PyExc_TypeError,
"must be str or None, not %.100s",
- Py_TYPE(substring)->tp_name);
+ Py_TYPE(sep)->tp_name);
return NULL;
}
-PyDoc_STRVAR(splitlines__doc__,
- "S.splitlines([keepends]) -> list of strings\n\
-\n\
-Return a list of the lines in S, breaking at line boundaries.\n\
-Line breaks are not included in the resulting list unless keepends\n\
-is given and true.");
+/*[clinic input]
+str.splitlines as unicode_splitlines
-static PyObject*
-unicode_splitlines(PyObject *self, PyObject *args, PyObject *kwds)
-{
- static char *kwlist[] = {"keepends", 0};
- int keepends = 0;
+ keepends: int(c_default="0") = False
- if (!PyArg_ParseTupleAndKeywords(args, kwds, "|i:splitlines",
- kwlist, &keepends))
- return NULL;
+Return a list of the lines in the string, breaking at line boundaries.
+Line breaks are not included in the resulting list unless keepends is given and
+true.
+[clinic start generated code]*/
+
+static PyObject *
+unicode_splitlines_impl(PyObject *self, int keepends)
+/*[clinic end generated code: output=f664dcdad153ec40 input=d6ff99fe43465b0f]*/
+{
return PyUnicode_Splitlines(self, keepends);
}
@@ -13061,14 +13110,15 @@ PyObject *unicode_str(PyObject *self)
return unicode_result_unchanged(self);
}
-PyDoc_STRVAR(swapcase__doc__,
- "S.swapcase() -> str\n\
-\n\
-Return a copy of S with uppercase characters converted to lowercase\n\
-and vice versa.");
+/*[clinic input]
+str.swapcase as unicode_swapcase
-static PyObject*
-unicode_swapcase(PyObject *self)
+Convert uppercase characters to lowercase and lowercase characters to uppercase.
+[clinic start generated code]*/
+
+static PyObject *
+unicode_swapcase_impl(PyObject *self)
+/*[clinic end generated code: output=5d28966bf6d7b2af input=3f3ef96d5798a7bb]*/
{
if (PyUnicode_READY(self) == -1)
return NULL;
@@ -13205,29 +13255,37 @@ unicode_maketrans_impl(PyObject *x, PyObject *y, PyObject *z)
return NULL;
}
-PyDoc_STRVAR(translate__doc__,
- "S.translate(table) -> str\n\
-\n\
-Return a copy of the string S in which each character has been mapped\n\
-through the given translation table. The table must implement\n\
-lookup/indexing via __getitem__, for instance a dictionary or list,\n\
-mapping Unicode ordinals to Unicode ordinals, strings, or None. If\n\
-this operation raises LookupError, the character is left untouched.\n\
-Characters mapped to None are deleted.");
+/*[clinic input]
+str.translate as unicode_translate
-static PyObject*
+ table: object
+ Translation table, which must be a mapping of Unicode ordinals to
+ Unicode ordinals, strings, or None.
+ /
+
+Replace each character in the string using the given translation table.
+
+The table must implement lookup/indexing via __getitem__, for instance a
+dictionary or list. If this operation raises LookupError, the character is
+left untouched. Characters mapped to None are deleted.
+[clinic start generated code]*/
+
+static PyObject *
unicode_translate(PyObject *self, PyObject *table)
+/*[clinic end generated code: output=3cb448ff2fd96bf3 input=6d38343db63d8eb0]*/
{
return _PyUnicode_TranslateCharmap(self, table, "ignore");
}
-PyDoc_STRVAR(upper__doc__,
- "S.upper() -> str\n\
-\n\
-Return a copy of S converted to uppercase.");
+/*[clinic input]
+str.upper as unicode_upper
-static PyObject*
-unicode_upper(PyObject *self)
+Return a copy of the string converted to uppercase.
+[clinic start generated code]*/
+
+static PyObject *
+unicode_upper_impl(PyObject *self)
+/*[clinic end generated code: output=1b7ddd16bbcdc092 input=db3d55682dfe2e6c]*/
{
if (PyUnicode_READY(self) == -1)
return NULL;
@@ -13236,25 +13294,27 @@ unicode_upper(PyObject *self)
return case_operation(self, do_upper);
}
-PyDoc_STRVAR(zfill__doc__,
- "S.zfill(width) -> str\n\
-\n\
-Pad a numeric string S with zeros on the left, to fill a field\n\
-of the specified width. The string S is never truncated.");
+/*[clinic input]
+str.zfill as unicode_zfill
+
+ width: Py_ssize_t
+ /
+
+Pad a numeric string with zeros on the left, to fill a field of the given width.
+
+The string is never truncated.
+[clinic start generated code]*/
static PyObject *
-unicode_zfill(PyObject *self, PyObject *args)
+unicode_zfill_impl(PyObject *self, Py_ssize_t width)
+/*[clinic end generated code: output=e13fb6bdf8e3b9df input=c6b2f772c6f27799]*/
{
Py_ssize_t fill;
PyObject *u;
- Py_ssize_t width;
int kind;
void *data;
Py_UCS4 chr;
- if (!PyArg_ParseTuple(args, "n:zfill", &width))
- return NULL;
-
if (PyUnicode_READY(self) == -1)
return NULL;
@@ -13741,16 +13801,22 @@ PyDoc_STRVAR(format_map__doc__,
Return a formatted version of S, using substitutions from mapping.\n\
The substitutions are identified by braces ('{' and '}').");
+/*[clinic input]
+str.__format__ as unicode___format__
+
+ format_spec: unicode
+ /
+
+Return a formatted version of the string as described by format_spec.
+[clinic start generated code]*/
+
static PyObject *
-unicode__format__(PyObject* self, PyObject* args)
+unicode___format___impl(PyObject *self, PyObject *format_spec)
+/*[clinic end generated code: output=45fceaca6d2ba4c8 input=5e135645d167a214]*/
{
- PyObject *format_spec;
_PyUnicodeWriter writer;
int ret;
- if (!PyArg_ParseTuple(args, "U:__format__", &format_spec))
- return NULL;
-
if (PyUnicode_READY(self) == -1)
return NULL;
_PyUnicodeWriter_Init(&writer);
@@ -13764,44 +13830,43 @@ unicode__format__(PyObject* self, PyObject* args)
return _PyUnicodeWriter_Finish(&writer);
}
-PyDoc_STRVAR(p_format__doc__,
- "S.__format__(format_spec) -> str\n\
-\n\
-Return a formatted version of S as described by format_spec.");
+/*[clinic input]
+str.__sizeof__ as unicode_sizeof
+
+Return the size of the string in memory, in bytes.
+[clinic start generated code]*/
static PyObject *
-unicode__sizeof__(PyObject *v)
+unicode_sizeof_impl(PyObject *self)
+/*[clinic end generated code: output=6dbc2f5a408b6d4f input=6dd011c108e33fb0]*/
{
Py_ssize_t size;
/* If it's a compact object, account for base structure +
character data. */
- if (PyUnicode_IS_COMPACT_ASCII(v))
- size = sizeof(PyASCIIObject) + PyUnicode_GET_LENGTH(v) + 1;
- else if (PyUnicode_IS_COMPACT(v))
+ if (PyUnicode_IS_COMPACT_ASCII(self))
+ size = sizeof(PyASCIIObject) + PyUnicode_GET_LENGTH(self) + 1;
+ else if (PyUnicode_IS_COMPACT(self))
size = sizeof(PyCompactUnicodeObject) +
- (PyUnicode_GET_LENGTH(v) + 1) * PyUnicode_KIND(v);
+ (PyUnicode_GET_LENGTH(self) + 1) * PyUnicode_KIND(self);
else {
/* If it is a two-block object, account for base object, and
for character block if present. */
size = sizeof(PyUnicodeObject);
- if (_PyUnicode_DATA_ANY(v))
- size += (PyUnicode_GET_LENGTH(v) + 1) *
- PyUnicode_KIND(v);
+ if (_PyUnicode_DATA_ANY(self))
+ size += (PyUnicode_GET_LENGTH(self) + 1) *
+ PyUnicode_KIND(self);
}
/* If the wstr pointer is present, account for it unless it is shared
with the data pointer. Check if the data is not shared. */
- if (_PyUnicode_HAS_WSTR_MEMORY(v))
- size += (PyUnicode_WSTR_LENGTH(v) + 1) * sizeof(wchar_t);
- if (_PyUnicode_HAS_UTF8_MEMORY(v))
- size += PyUnicode_UTF8_LENGTH(v) + 1;
+ if (_PyUnicode_HAS_WSTR_MEMORY(self))
+ size += (PyUnicode_WSTR_LENGTH(self) + 1) * sizeof(wchar_t);
+ if (_PyUnicode_HAS_UTF8_MEMORY(self))
+ size += PyUnicode_UTF8_LENGTH(self) + 1;
return PyLong_FromSsize_t(size);
}
-PyDoc_STRVAR(sizeof__doc__,
- "S.__sizeof__() -> size of S in memory, in bytes");
-
static PyObject *
unicode_getnewargs(PyObject *v)
{
@@ -13812,54 +13877,52 @@ unicode_getnewargs(PyObject *v)
}
static PyMethodDef unicode_methods[] = {
- {"encode", (PyCFunction) unicode_encode, METH_VARARGS | METH_KEYWORDS, encode__doc__},
- {"replace", (PyCFunction) unicode_replace, METH_VARARGS, replace__doc__},
- {"split", (PyCFunction) unicode_split, METH_VARARGS | METH_KEYWORDS, split__doc__},
- {"rsplit", (PyCFunction) unicode_rsplit, METH_VARARGS | METH_KEYWORDS, rsplit__doc__},
- {"join", (PyCFunction) unicode_join, METH_O, join__doc__},
- {"capitalize", (PyCFunction) unicode_capitalize, METH_NOARGS, capitalize__doc__},
- {"casefold", (PyCFunction) unicode_casefold, METH_NOARGS, casefold__doc__},
- {"title", (PyCFunction) unicode_title, METH_NOARGS, title__doc__},
- {"center", (PyCFunction) unicode_center, METH_VARARGS, center__doc__},
+ UNICODE_ENCODE_METHODDEF
+ UNICODE_REPLACE_METHODDEF
+ UNICODE_SPLIT_METHODDEF
+ UNICODE_RSPLIT_METHODDEF
+ UNICODE_JOIN_METHODDEF
+ UNICODE_CAPITALIZE_METHODDEF
+ UNICODE_CASEFOLD_METHODDEF
+ UNICODE_TITLE_METHODDEF
+ UNICODE_CENTER_METHODDEF
{"count", (PyCFunction) unicode_count, METH_VARARGS, count__doc__},
- {"expandtabs", (PyCFunction) unicode_expandtabs,
- METH_VARARGS | METH_KEYWORDS, expandtabs__doc__},
+ UNICODE_EXPANDTABS_METHODDEF
{"find", (PyCFunction) unicode_find, METH_VARARGS, find__doc__},
- {"partition", (PyCFunction) unicode_partition, METH_O, partition__doc__},
+ UNICODE_PARTITION_METHODDEF
{"index", (PyCFunction) unicode_index, METH_VARARGS, index__doc__},
- {"ljust", (PyCFunction) unicode_ljust, METH_VARARGS, ljust__doc__},
- {"lower", (PyCFunction) unicode_lower, METH_NOARGS, lower__doc__},
- {"lstrip", (PyCFunction) unicode_lstrip, METH_VARARGS, lstrip__doc__},
+ UNICODE_LJUST_METHODDEF
+ UNICODE_LOWER_METHODDEF
+ UNICODE_LSTRIP_METHODDEF
{"rfind", (PyCFunction) unicode_rfind, METH_VARARGS, rfind__doc__},
{"rindex", (PyCFunction) unicode_rindex, METH_VARARGS, rindex__doc__},
- {"rjust", (PyCFunction) unicode_rjust, METH_VARARGS, rjust__doc__},
- {"rstrip", (PyCFunction) unicode_rstrip, METH_VARARGS, rstrip__doc__},
- {"rpartition", (PyCFunction) unicode_rpartition, METH_O, rpartition__doc__},
- {"splitlines", (PyCFunction) unicode_splitlines,
- METH_VARARGS | METH_KEYWORDS, splitlines__doc__},
- {"strip", (PyCFunction) unicode_strip, METH_VARARGS, strip__doc__},
- {"swapcase", (PyCFunction) unicode_swapcase, METH_NOARGS, swapcase__doc__},
- {"translate", (PyCFunction) unicode_translate, METH_O, translate__doc__},
- {"upper", (PyCFunction) unicode_upper, METH_NOARGS, upper__doc__},
+ UNICODE_RJUST_METHODDEF
+ UNICODE_RSTRIP_METHODDEF
+ UNICODE_RPARTITION_METHODDEF
+ UNICODE_SPLITLINES_METHODDEF
+ UNICODE_STRIP_METHODDEF
+ UNICODE_SWAPCASE_METHODDEF
+ UNICODE_TRANSLATE_METHODDEF
+ UNICODE_UPPER_METHODDEF
{"startswith", (PyCFunction) unicode_startswith, METH_VARARGS, startswith__doc__},
{"endswith", (PyCFunction) unicode_endswith, METH_VARARGS, endswith__doc__},
- {"islower", (PyCFunction) unicode_islower, METH_NOARGS, islower__doc__},
- {"isupper", (PyCFunction) unicode_isupper, METH_NOARGS, isupper__doc__},
- {"istitle", (PyCFunction) unicode_istitle, METH_NOARGS, istitle__doc__},
- {"isspace", (PyCFunction) unicode_isspace, METH_NOARGS, isspace__doc__},
- {"isdecimal", (PyCFunction) unicode_isdecimal, METH_NOARGS, isdecimal__doc__},
- {"isdigit", (PyCFunction) unicode_isdigit, METH_NOARGS, isdigit__doc__},
- {"isnumeric", (PyCFunction) unicode_isnumeric, METH_NOARGS, isnumeric__doc__},
- {"isalpha", (PyCFunction) unicode_isalpha, METH_NOARGS, isalpha__doc__},
- {"isalnum", (PyCFunction) unicode_isalnum, METH_NOARGS, isalnum__doc__},
- {"isidentifier", (PyCFunction) unicode_isidentifier, METH_NOARGS, isidentifier__doc__},
- {"isprintable", (PyCFunction) unicode_isprintable, METH_NOARGS, isprintable__doc__},
- {"zfill", (PyCFunction) unicode_zfill, METH_VARARGS, zfill__doc__},
+ UNICODE_ISLOWER_METHODDEF
+ UNICODE_ISUPPER_METHODDEF
+ UNICODE_ISTITLE_METHODDEF
+ UNICODE_ISSPACE_METHODDEF
+ UNICODE_ISDECIMAL_METHODDEF
+ UNICODE_ISDIGIT_METHODDEF
+ UNICODE_ISNUMERIC_METHODDEF
+ UNICODE_ISALPHA_METHODDEF
+ UNICODE_ISALNUM_METHODDEF
+ UNICODE_ISIDENTIFIER_METHODDEF
+ UNICODE_ISPRINTABLE_METHODDEF
+ UNICODE_ZFILL_METHODDEF
{"format", (PyCFunction) do_string_format, METH_VARARGS | METH_KEYWORDS, format__doc__},
{"format_map", (PyCFunction) do_string_format_map, METH_O, format_map__doc__},
- {"__format__", (PyCFunction) unicode__format__, METH_VARARGS, p_format__doc__},
+ UNICODE___FORMAT___METHODDEF
UNICODE_MAKETRANS_METHODDEF
- {"__sizeof__", (PyCFunction) unicode__sizeof__, METH_NOARGS, sizeof__doc__},
+ UNICODE_SIZEOF_METHODDEF
#if 0
/* These methods are just used for debugging the implementation. */
{"_decimal2ascii", (PyCFunction) unicode__decimal2ascii, METH_NOARGS},
@@ -15362,7 +15425,7 @@ unicodeiter_reduce(unicodeiterobject *it)
return Py_BuildValue("N(O)n", _PyObject_GetBuiltin("iter"),
it->it_seq, it->it_index);
} else {
- PyObject *u = PyUnicode_FromUnicode(NULL, 0);
+ PyObject *u = (PyObject *)_PyUnicode_New(0);
if (u == NULL)
return NULL;
return Py_BuildValue("N(N)", _PyObject_GetBuiltin("iter"), u);
@@ -15457,10 +15520,7 @@ unicode_iter(PyObject *seq)
size_t
Py_UNICODE_strlen(const Py_UNICODE *u)
{
- int res = 0;
- while(*u++)
- res++;
- return res;
+ return wcslen(u);
}
Py_UNICODE*
@@ -15485,8 +15545,8 @@ Py_UNICODE*
Py_UNICODE_strcat(Py_UNICODE *s1, const Py_UNICODE *s2)
{
Py_UNICODE *u1 = s1;
- u1 += Py_UNICODE_strlen(u1);
- Py_UNICODE_strcpy(u1, s2);
+ u1 += wcslen(u1);
+ while ((*u1++ = *s2++));
return s1;
}
@@ -15535,7 +15595,7 @@ Py_UNICODE*
Py_UNICODE_strrchr(const Py_UNICODE *s, Py_UNICODE c)
{
const Py_UNICODE *p;
- p = s + Py_UNICODE_strlen(s);
+ p = s + wcslen(s);
while (p != s) {
p--;
if (*p == c)
diff --git a/PC/_msi.c b/PC/_msi.c
index 789b04f5a2..feb00882c0 100644
--- a/PC/_msi.c
+++ b/PC/_msi.c
@@ -262,8 +262,7 @@ static PyObject* fcicreate(PyObject* obj, PyObject* args)
if (!FCIDestroy(hfci))
goto err;
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
err:
if(erf.fError)
PyErr_Format(PyExc_ValueError, "FCI error %d", erf.erfOper); /* XXX better error type */
@@ -291,8 +290,7 @@ msiobj_close(msiobj* msidb, PyObject *args)
{
MsiCloseHandle(msidb->h);
msidb->h = 0;
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
static PyObject*
@@ -401,8 +399,7 @@ record_cleardata(msiobj* record, PyObject *args)
if (status != ERROR_SUCCESS)
return msierror(status);
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
static PyObject*
@@ -418,8 +415,7 @@ record_setstring(msiobj* record, PyObject *args)
if ((status = MsiRecordSetStringW(record->h, field, data)) != ERROR_SUCCESS)
return msierror(status);
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
static PyObject*
@@ -435,8 +431,7 @@ record_setstream(msiobj* record, PyObject *args)
if ((status = MsiRecordSetStreamW(record->h, field, data)) != ERROR_SUCCESS)
return msierror(status);
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
static PyObject*
@@ -452,8 +447,7 @@ record_setinteger(msiobj* record, PyObject *args)
if ((status = MsiRecordSetInteger(record->h, field, data)) != ERROR_SUCCESS)
return msierror(status);
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
@@ -617,8 +611,7 @@ summary_setproperty(msiobj* si, PyObject *args)
if (status != ERROR_SUCCESS)
return msierror(status);
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
@@ -630,8 +623,7 @@ summary_persist(msiobj* si, PyObject *args)
status = MsiSummaryInfoPersist(si->h);
if (status != ERROR_SUCCESS)
return msierror(status);
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
static PyMethodDef summary_methods[] = {
@@ -714,8 +706,7 @@ view_execute(msiobj *view, PyObject*args)
if (status != ERROR_SUCCESS)
return msierror(status);
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
static PyObject*
@@ -764,8 +755,7 @@ view_modify(msiobj *view, PyObject *args)
if ((status = MsiViewModify(view->h, kind, ((msiobj*)data)->h)) != ERROR_SUCCESS)
return msierror(status);
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
static PyObject*
@@ -776,8 +766,7 @@ view_close(msiobj *view, PyObject*args)
if ((status = MsiViewClose(view->h)) != ERROR_SUCCESS)
return msierror(status);
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
static PyMethodDef view_methods[] = {
@@ -872,8 +861,7 @@ msidb_commit(msiobj *msidb, PyObject *args)
if ((status = MsiDatabaseCommit(msidb->h)) != ERROR_SUCCESS)
return msierror(status);
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
static PyObject*
diff --git a/PC/clinic/_testconsole.c.h b/PC/clinic/_testconsole.c.h
index 93860cf5b2..2baf2baa26 100644
--- a/PC/clinic/_testconsole.c.h
+++ b/PC/clinic/_testconsole.c.h
@@ -26,7 +26,7 @@ _testconsole_write_input(PyObject *module, PyObject **args, Py_ssize_t nargs, Py
PyObject *file;
PyBytesObject *s;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
&file, &s)) {
goto exit;
}
@@ -60,7 +60,7 @@ _testconsole_read_output(PyObject *module, PyObject **args, Py_ssize_t nargs, Py
static _PyArg_Parser _parser = {"O:read_output", _keywords, 0};
PyObject *file;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
&file)) {
goto exit;
}
@@ -79,4 +79,4 @@ exit:
#ifndef _TESTCONSOLE_READ_OUTPUT_METHODDEF
#define _TESTCONSOLE_READ_OUTPUT_METHODDEF
#endif /* !defined(_TESTCONSOLE_READ_OUTPUT_METHODDEF) */
-/*[clinic end generated code: output=3a8dc0c421807c41 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=30d2a80143b65e6f input=a9049054013a1b77]*/
diff --git a/PC/clinic/msvcrtmodule.c.h b/PC/clinic/msvcrtmodule.c.h
index 6935cad7b0..db4f46ebce 100644
--- a/PC/clinic/msvcrtmodule.c.h
+++ b/PC/clinic/msvcrtmodule.c.h
@@ -37,23 +37,27 @@ PyDoc_STRVAR(msvcrt_locking__doc__,
"individually.");
#define MSVCRT_LOCKING_METHODDEF \
- {"locking", (PyCFunction)msvcrt_locking, METH_VARARGS, msvcrt_locking__doc__},
+ {"locking", (PyCFunction)msvcrt_locking, METH_FASTCALL, msvcrt_locking__doc__},
static PyObject *
msvcrt_locking_impl(PyObject *module, int fd, int mode, long nbytes);
static PyObject *
-msvcrt_locking(PyObject *module, PyObject *args)
+msvcrt_locking(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
int fd;
int mode;
long nbytes;
- if (!PyArg_ParseTuple(args, "iil:locking",
+ if (!_PyArg_ParseStack(args, nargs, "iil:locking",
&fd, &mode, &nbytes)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("locking", kwnames)) {
+ goto exit;
+ }
return_value = msvcrt_locking_impl(module, fd, mode, nbytes);
exit:
@@ -72,23 +76,27 @@ PyDoc_STRVAR(msvcrt_setmode__doc__,
"Return value is the previous mode.");
#define MSVCRT_SETMODE_METHODDEF \
- {"setmode", (PyCFunction)msvcrt_setmode, METH_VARARGS, msvcrt_setmode__doc__},
+ {"setmode", (PyCFunction)msvcrt_setmode, METH_FASTCALL, msvcrt_setmode__doc__},
static long
msvcrt_setmode_impl(PyObject *module, int fd, int flags);
static PyObject *
-msvcrt_setmode(PyObject *module, PyObject *args)
+msvcrt_setmode(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
int fd;
int flags;
long _return_value;
- if (!PyArg_ParseTuple(args, "ii:setmode",
+ if (!_PyArg_ParseStack(args, nargs, "ii:setmode",
&fd, &flags)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("setmode", kwnames)) {
+ goto exit;
+ }
_return_value = msvcrt_setmode_impl(module, fd, flags);
if ((_return_value == -1) && PyErr_Occurred()) {
goto exit;
@@ -110,23 +118,27 @@ PyDoc_STRVAR(msvcrt_open_osfhandle__doc__,
"to os.fdopen() to create a file object.");
#define MSVCRT_OPEN_OSFHANDLE_METHODDEF \
- {"open_osfhandle", (PyCFunction)msvcrt_open_osfhandle, METH_VARARGS, msvcrt_open_osfhandle__doc__},
+ {"open_osfhandle", (PyCFunction)msvcrt_open_osfhandle, METH_FASTCALL, msvcrt_open_osfhandle__doc__},
static long
msvcrt_open_osfhandle_impl(PyObject *module, intptr_t handle, int flags);
static PyObject *
-msvcrt_open_osfhandle(PyObject *module, PyObject *args)
+msvcrt_open_osfhandle(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
intptr_t handle;
int flags;
long _return_value;
- if (!PyArg_ParseTuple(args, ""_Py_PARSE_INTPTR"i:open_osfhandle",
+ if (!_PyArg_ParseStack(args, nargs, ""_Py_PARSE_INTPTR"i:open_osfhandle",
&handle, &flags)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("open_osfhandle", kwnames)) {
+ goto exit;
+ }
_return_value = msvcrt_open_osfhandle_impl(module, handle, flags);
if ((_return_value == -1) && PyErr_Occurred()) {
goto exit;
@@ -424,23 +436,27 @@ PyDoc_STRVAR(msvcrt_CrtSetReportFile__doc__,
"Only available on Debug builds.");
#define MSVCRT_CRTSETREPORTFILE_METHODDEF \
- {"CrtSetReportFile", (PyCFunction)msvcrt_CrtSetReportFile, METH_VARARGS, msvcrt_CrtSetReportFile__doc__},
+ {"CrtSetReportFile", (PyCFunction)msvcrt_CrtSetReportFile, METH_FASTCALL, msvcrt_CrtSetReportFile__doc__},
static long
msvcrt_CrtSetReportFile_impl(PyObject *module, int type, int file);
static PyObject *
-msvcrt_CrtSetReportFile(PyObject *module, PyObject *args)
+msvcrt_CrtSetReportFile(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
int type;
int file;
long _return_value;
- if (!PyArg_ParseTuple(args, "ii:CrtSetReportFile",
+ if (!_PyArg_ParseStack(args, nargs, "ii:CrtSetReportFile",
&type, &file)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("CrtSetReportFile", kwnames)) {
+ goto exit;
+ }
_return_value = msvcrt_CrtSetReportFile_impl(module, type, file);
if ((_return_value == -1) && PyErr_Occurred()) {
goto exit;
@@ -464,23 +480,27 @@ PyDoc_STRVAR(msvcrt_CrtSetReportMode__doc__,
"Only available on Debug builds.");
#define MSVCRT_CRTSETREPORTMODE_METHODDEF \
- {"CrtSetReportMode", (PyCFunction)msvcrt_CrtSetReportMode, METH_VARARGS, msvcrt_CrtSetReportMode__doc__},
+ {"CrtSetReportMode", (PyCFunction)msvcrt_CrtSetReportMode, METH_FASTCALL, msvcrt_CrtSetReportMode__doc__},
static long
msvcrt_CrtSetReportMode_impl(PyObject *module, int type, int mode);
static PyObject *
-msvcrt_CrtSetReportMode(PyObject *module, PyObject *args)
+msvcrt_CrtSetReportMode(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
int type;
int mode;
long _return_value;
- if (!PyArg_ParseTuple(args, "ii:CrtSetReportMode",
+ if (!_PyArg_ParseStack(args, nargs, "ii:CrtSetReportMode",
&type, &mode)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("CrtSetReportMode", kwnames)) {
+ goto exit;
+ }
_return_value = msvcrt_CrtSetReportMode_impl(module, type, mode);
if ((_return_value == -1) && PyErr_Occurred()) {
goto exit;
@@ -569,4 +589,4 @@ exit:
#ifndef MSVCRT_SET_ERROR_MODE_METHODDEF
#define MSVCRT_SET_ERROR_MODE_METHODDEF
#endif /* !defined(MSVCRT_SET_ERROR_MODE_METHODDEF) */
-/*[clinic end generated code: output=ae04e2b50eef8b63 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=36f1e78ca8bd3944 input=a9049054013a1b77]*/
diff --git a/PC/clinic/winreg.c.h b/PC/clinic/winreg.c.h
index c7d5b9e452..2ca47344c4 100644
--- a/PC/clinic/winreg.c.h
+++ b/PC/clinic/winreg.c.h
@@ -93,7 +93,7 @@ winreg_HKEYType___exit__(PyHKEYObject *self, PyObject **args, Py_ssize_t nargs,
PyObject *exc_value;
PyObject *traceback;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
&exc_type, &exc_value, &traceback)) {
goto exit;
}
@@ -134,24 +134,28 @@ PyDoc_STRVAR(winreg_ConnectRegistry__doc__,
"If the function fails, an OSError exception is raised.");
#define WINREG_CONNECTREGISTRY_METHODDEF \
- {"ConnectRegistry", (PyCFunction)winreg_ConnectRegistry, METH_VARARGS, winreg_ConnectRegistry__doc__},
+ {"ConnectRegistry", (PyCFunction)winreg_ConnectRegistry, METH_FASTCALL, winreg_ConnectRegistry__doc__},
static HKEY
winreg_ConnectRegistry_impl(PyObject *module, Py_UNICODE *computer_name,
HKEY key);
static PyObject *
-winreg_ConnectRegistry(PyObject *module, PyObject *args)
+winreg_ConnectRegistry(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
Py_UNICODE *computer_name;
HKEY key;
HKEY _return_value;
- if (!PyArg_ParseTuple(args, "ZO&:ConnectRegistry",
+ if (!_PyArg_ParseStack(args, nargs, "ZO&:ConnectRegistry",
&computer_name, clinic_HKEY_converter, &key)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("ConnectRegistry", kwnames)) {
+ goto exit;
+ }
_return_value = winreg_ConnectRegistry_impl(module, computer_name, key);
if (_return_value == NULL) {
goto exit;
@@ -182,23 +186,27 @@ PyDoc_STRVAR(winreg_CreateKey__doc__,
"If the function fails, an OSError exception is raised.");
#define WINREG_CREATEKEY_METHODDEF \
- {"CreateKey", (PyCFunction)winreg_CreateKey, METH_VARARGS, winreg_CreateKey__doc__},
+ {"CreateKey", (PyCFunction)winreg_CreateKey, METH_FASTCALL, winreg_CreateKey__doc__},
static HKEY
winreg_CreateKey_impl(PyObject *module, HKEY key, Py_UNICODE *sub_key);
static PyObject *
-winreg_CreateKey(PyObject *module, PyObject *args)
+winreg_CreateKey(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
HKEY key;
Py_UNICODE *sub_key;
HKEY _return_value;
- if (!PyArg_ParseTuple(args, "O&Z:CreateKey",
+ if (!_PyArg_ParseStack(args, nargs, "O&Z:CreateKey",
clinic_HKEY_converter, &key, &sub_key)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("CreateKey", kwnames)) {
+ goto exit;
+ }
_return_value = winreg_CreateKey_impl(module, key, sub_key);
if (_return_value == NULL) {
goto exit;
@@ -253,7 +261,7 @@ winreg_CreateKeyEx(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject
REGSAM access = KEY_WRITE;
HKEY _return_value;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
clinic_HKEY_converter, &key, &sub_key, &reserved, &access)) {
goto exit;
}
@@ -286,22 +294,26 @@ PyDoc_STRVAR(winreg_DeleteKey__doc__,
"is removed. If the function fails, an OSError exception is raised.");
#define WINREG_DELETEKEY_METHODDEF \
- {"DeleteKey", (PyCFunction)winreg_DeleteKey, METH_VARARGS, winreg_DeleteKey__doc__},
+ {"DeleteKey", (PyCFunction)winreg_DeleteKey, METH_FASTCALL, winreg_DeleteKey__doc__},
static PyObject *
winreg_DeleteKey_impl(PyObject *module, HKEY key, Py_UNICODE *sub_key);
static PyObject *
-winreg_DeleteKey(PyObject *module, PyObject *args)
+winreg_DeleteKey(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
HKEY key;
Py_UNICODE *sub_key;
- if (!PyArg_ParseTuple(args, "O&u:DeleteKey",
+ if (!_PyArg_ParseStack(args, nargs, "O&u:DeleteKey",
clinic_HKEY_converter, &key, &sub_key)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("DeleteKey", kwnames)) {
+ goto exit;
+ }
return_value = winreg_DeleteKey_impl(module, key, sub_key);
exit:
@@ -351,7 +363,7 @@ winreg_DeleteKeyEx(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject
REGSAM access = KEY_WOW64_64KEY;
int reserved = 0;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
clinic_HKEY_converter, &key, &sub_key, &access, &reserved)) {
goto exit;
}
@@ -373,22 +385,26 @@ PyDoc_STRVAR(winreg_DeleteValue__doc__,
" A string that identifies the value to remove.");
#define WINREG_DELETEVALUE_METHODDEF \
- {"DeleteValue", (PyCFunction)winreg_DeleteValue, METH_VARARGS, winreg_DeleteValue__doc__},
+ {"DeleteValue", (PyCFunction)winreg_DeleteValue, METH_FASTCALL, winreg_DeleteValue__doc__},
static PyObject *
winreg_DeleteValue_impl(PyObject *module, HKEY key, Py_UNICODE *value);
static PyObject *
-winreg_DeleteValue(PyObject *module, PyObject *args)
+winreg_DeleteValue(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
HKEY key;
Py_UNICODE *value;
- if (!PyArg_ParseTuple(args, "O&Z:DeleteValue",
+ if (!_PyArg_ParseStack(args, nargs, "O&Z:DeleteValue",
clinic_HKEY_converter, &key, &value)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("DeleteValue", kwnames)) {
+ goto exit;
+ }
return_value = winreg_DeleteValue_impl(module, key, value);
exit:
@@ -411,22 +427,26 @@ PyDoc_STRVAR(winreg_EnumKey__doc__,
"raised, indicating no more values are available.");
#define WINREG_ENUMKEY_METHODDEF \
- {"EnumKey", (PyCFunction)winreg_EnumKey, METH_VARARGS, winreg_EnumKey__doc__},
+ {"EnumKey", (PyCFunction)winreg_EnumKey, METH_FASTCALL, winreg_EnumKey__doc__},
static PyObject *
winreg_EnumKey_impl(PyObject *module, HKEY key, int index);
static PyObject *
-winreg_EnumKey(PyObject *module, PyObject *args)
+winreg_EnumKey(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
HKEY key;
int index;
- if (!PyArg_ParseTuple(args, "O&i:EnumKey",
+ if (!_PyArg_ParseStack(args, nargs, "O&i:EnumKey",
clinic_HKEY_converter, &key, &index)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("EnumKey", kwnames)) {
+ goto exit;
+ }
return_value = winreg_EnumKey_impl(module, key, index);
exit:
@@ -458,22 +478,26 @@ PyDoc_STRVAR(winreg_EnumValue__doc__,
" An integer that identifies the type of the value data.");
#define WINREG_ENUMVALUE_METHODDEF \
- {"EnumValue", (PyCFunction)winreg_EnumValue, METH_VARARGS, winreg_EnumValue__doc__},
+ {"EnumValue", (PyCFunction)winreg_EnumValue, METH_FASTCALL, winreg_EnumValue__doc__},
static PyObject *
winreg_EnumValue_impl(PyObject *module, HKEY key, int index);
static PyObject *
-winreg_EnumValue(PyObject *module, PyObject *args)
+winreg_EnumValue(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
HKEY key;
int index;
- if (!PyArg_ParseTuple(args, "O&i:EnumValue",
+ if (!_PyArg_ParseStack(args, nargs, "O&i:EnumValue",
clinic_HKEY_converter, &key, &index)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("EnumValue", kwnames)) {
+ goto exit;
+ }
return_value = winreg_EnumValue_impl(module, key, index);
exit:
@@ -576,24 +600,28 @@ PyDoc_STRVAR(winreg_LoadKey__doc__,
"tree.");
#define WINREG_LOADKEY_METHODDEF \
- {"LoadKey", (PyCFunction)winreg_LoadKey, METH_VARARGS, winreg_LoadKey__doc__},
+ {"LoadKey", (PyCFunction)winreg_LoadKey, METH_FASTCALL, winreg_LoadKey__doc__},
static PyObject *
winreg_LoadKey_impl(PyObject *module, HKEY key, Py_UNICODE *sub_key,
Py_UNICODE *file_name);
static PyObject *
-winreg_LoadKey(PyObject *module, PyObject *args)
+winreg_LoadKey(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
HKEY key;
Py_UNICODE *sub_key;
Py_UNICODE *file_name;
- if (!PyArg_ParseTuple(args, "O&uu:LoadKey",
+ if (!_PyArg_ParseStack(args, nargs, "O&uu:LoadKey",
clinic_HKEY_converter, &key, &sub_key, &file_name)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("LoadKey", kwnames)) {
+ goto exit;
+ }
return_value = winreg_LoadKey_impl(module, key, sub_key, file_name);
exit:
@@ -638,7 +666,7 @@ winreg_OpenKey(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kw
REGSAM access = KEY_READ;
HKEY _return_value;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
clinic_HKEY_converter, &key, &sub_key, &reserved, &access)) {
goto exit;
}
@@ -690,7 +718,7 @@ winreg_OpenKeyEx(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *
REGSAM access = KEY_READ;
HKEY _return_value;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
clinic_HKEY_converter, &key, &sub_key, &reserved, &access)) {
goto exit;
}
@@ -761,22 +789,26 @@ PyDoc_STRVAR(winreg_QueryValue__doc__,
"completeness.");
#define WINREG_QUERYVALUE_METHODDEF \
- {"QueryValue", (PyCFunction)winreg_QueryValue, METH_VARARGS, winreg_QueryValue__doc__},
+ {"QueryValue", (PyCFunction)winreg_QueryValue, METH_FASTCALL, winreg_QueryValue__doc__},
static PyObject *
winreg_QueryValue_impl(PyObject *module, HKEY key, Py_UNICODE *sub_key);
static PyObject *
-winreg_QueryValue(PyObject *module, PyObject *args)
+winreg_QueryValue(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
HKEY key;
Py_UNICODE *sub_key;
- if (!PyArg_ParseTuple(args, "O&Z:QueryValue",
+ if (!_PyArg_ParseStack(args, nargs, "O&Z:QueryValue",
clinic_HKEY_converter, &key, &sub_key)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("QueryValue", kwnames)) {
+ goto exit;
+ }
return_value = winreg_QueryValue_impl(module, key, sub_key);
exit:
@@ -800,22 +832,26 @@ PyDoc_STRVAR(winreg_QueryValueEx__doc__,
"The return value is a tuple of the value and the type_id.");
#define WINREG_QUERYVALUEEX_METHODDEF \
- {"QueryValueEx", (PyCFunction)winreg_QueryValueEx, METH_VARARGS, winreg_QueryValueEx__doc__},
+ {"QueryValueEx", (PyCFunction)winreg_QueryValueEx, METH_FASTCALL, winreg_QueryValueEx__doc__},
static PyObject *
winreg_QueryValueEx_impl(PyObject *module, HKEY key, Py_UNICODE *name);
static PyObject *
-winreg_QueryValueEx(PyObject *module, PyObject *args)
+winreg_QueryValueEx(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
HKEY key;
Py_UNICODE *name;
- if (!PyArg_ParseTuple(args, "O&Z:QueryValueEx",
+ if (!_PyArg_ParseStack(args, nargs, "O&Z:QueryValueEx",
clinic_HKEY_converter, &key, &name)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("QueryValueEx", kwnames)) {
+ goto exit;
+ }
return_value = winreg_QueryValueEx_impl(module, key, name);
exit:
@@ -844,22 +880,26 @@ PyDoc_STRVAR(winreg_SaveKey__doc__,
"to the API.");
#define WINREG_SAVEKEY_METHODDEF \
- {"SaveKey", (PyCFunction)winreg_SaveKey, METH_VARARGS, winreg_SaveKey__doc__},
+ {"SaveKey", (PyCFunction)winreg_SaveKey, METH_FASTCALL, winreg_SaveKey__doc__},
static PyObject *
winreg_SaveKey_impl(PyObject *module, HKEY key, Py_UNICODE *file_name);
static PyObject *
-winreg_SaveKey(PyObject *module, PyObject *args)
+winreg_SaveKey(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
HKEY key;
Py_UNICODE *file_name;
- if (!PyArg_ParseTuple(args, "O&u:SaveKey",
+ if (!_PyArg_ParseStack(args, nargs, "O&u:SaveKey",
clinic_HKEY_converter, &key, &file_name)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("SaveKey", kwnames)) {
+ goto exit;
+ }
return_value = winreg_SaveKey_impl(module, key, file_name);
exit:
@@ -893,7 +933,7 @@ PyDoc_STRVAR(winreg_SetValue__doc__,
"KEY_SET_VALUE access.");
#define WINREG_SETVALUE_METHODDEF \
- {"SetValue", (PyCFunction)winreg_SetValue, METH_VARARGS, winreg_SetValue__doc__},
+ {"SetValue", (PyCFunction)winreg_SetValue, METH_FASTCALL, winreg_SetValue__doc__},
static PyObject *
winreg_SetValue_impl(PyObject *module, HKEY key, Py_UNICODE *sub_key,
@@ -901,7 +941,7 @@ winreg_SetValue_impl(PyObject *module, HKEY key, Py_UNICODE *sub_key,
Py_ssize_clean_t value_length);
static PyObject *
-winreg_SetValue(PyObject *module, PyObject *args)
+winreg_SetValue(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
HKEY key;
@@ -910,10 +950,14 @@ winreg_SetValue(PyObject *module, PyObject *args)
Py_UNICODE *value;
Py_ssize_clean_t value_length;
- if (!PyArg_ParseTuple(args, "O&Zku#:SetValue",
+ if (!_PyArg_ParseStack(args, nargs, "O&Zku#:SetValue",
clinic_HKEY_converter, &key, &sub_key, &type, &value, &value_length)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("SetValue", kwnames)) {
+ goto exit;
+ }
return_value = winreg_SetValue_impl(module, key, sub_key, type, value, value_length);
exit:
@@ -964,14 +1008,14 @@ PyDoc_STRVAR(winreg_SetValueEx__doc__,
"the configuration registry to help the registry perform efficiently.");
#define WINREG_SETVALUEEX_METHODDEF \
- {"SetValueEx", (PyCFunction)winreg_SetValueEx, METH_VARARGS, winreg_SetValueEx__doc__},
+ {"SetValueEx", (PyCFunction)winreg_SetValueEx, METH_FASTCALL, winreg_SetValueEx__doc__},
static PyObject *
winreg_SetValueEx_impl(PyObject *module, HKEY key, Py_UNICODE *value_name,
PyObject *reserved, DWORD type, PyObject *value);
static PyObject *
-winreg_SetValueEx(PyObject *module, PyObject *args)
+winreg_SetValueEx(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
HKEY key;
@@ -980,10 +1024,14 @@ winreg_SetValueEx(PyObject *module, PyObject *args)
DWORD type;
PyObject *value;
- if (!PyArg_ParseTuple(args, "O&ZOkO:SetValueEx",
+ if (!_PyArg_ParseStack(args, nargs, "O&ZOkO:SetValueEx",
clinic_HKEY_converter, &key, &value_name, &reserved, &type, &value)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("SetValueEx", kwnames)) {
+ goto exit;
+ }
return_value = winreg_SetValueEx_impl(module, key, value_name, reserved, type, value);
exit:
@@ -1091,4 +1139,4 @@ winreg_QueryReflectionKey(PyObject *module, PyObject *arg)
exit:
return return_value;
}
-/*[clinic end generated code: output=16dd06be6e14b86e input=a9049054013a1b77]*/
+/*[clinic end generated code: output=ddc72b006143d33d input=a9049054013a1b77]*/
diff --git a/PC/clinic/winsound.c.h b/PC/clinic/winsound.c.h
index 52d25b2434..8fa37134fc 100644
--- a/PC/clinic/winsound.c.h
+++ b/PC/clinic/winsound.c.h
@@ -28,7 +28,7 @@ winsound_PlaySound(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject
PyObject *sound;
int flags;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
&sound, &flags)) {
goto exit;
}
@@ -65,7 +65,7 @@ winsound_Beep(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwn
int frequency;
int duration;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
&frequency, &duration)) {
goto exit;
}
@@ -97,7 +97,7 @@ winsound_MessageBeep(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObje
static _PyArg_Parser _parser = {"|i:MessageBeep", _keywords, 0};
int type = MB_OK;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
&type)) {
goto exit;
}
@@ -106,4 +106,4 @@ winsound_MessageBeep(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObje
exit:
return return_value;
}
-/*[clinic end generated code: output=bfe16b2b8b490cb1 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=102a556c665a277d input=a9049054013a1b77]*/
diff --git a/PC/launcher.c b/PC/launcher.c
index d11df437b9..e628845154 100644
--- a/PC/launcher.c
+++ b/PC/launcher.c
@@ -1090,6 +1090,7 @@ static PYC_MAGIC magic_values[] = {
{ 3250, 3310, L"3.4" },
{ 3320, 3351, L"3.5" },
{ 3360, 3379, L"3.6" },
+ { 3390, 3399, L"3.7" },
{ 0 }
};
diff --git a/PC/pyconfig.h b/PC/pyconfig.h
index 64e7aecb69..a4df5c4f6c 100644
--- a/PC/pyconfig.h
+++ b/PC/pyconfig.h
@@ -290,11 +290,11 @@ Py_NO_ENABLE_SHARED to find out. Also support MS_NO_COREDLL for b/w compat */
their Makefile (other compilers are generally
taken care of by distutils.) */
# if defined(_DEBUG)
-# pragma comment(lib,"python36_d.lib")
+# pragma comment(lib,"python37_d.lib")
# elif defined(Py_LIMITED_API)
# pragma comment(lib,"python3.lib")
# else
-# pragma comment(lib,"python36.lib")
+# pragma comment(lib,"python37.lib")
# endif /* _DEBUG */
# endif /* _MSC_VER */
# endif /* Py_BUILD_CORE */
diff --git a/PC/python3.def b/PC/python3.def
index ff70718fc3..bb3ca8814b 100644
--- a/PC/python3.def
+++ b/PC/python3.def
@@ -2,789 +2,789 @@
; It is used when building python3dll.vcxproj
LIBRARY "python3"
EXPORTS
- PyArg_Parse=python36.PyArg_Parse
- PyArg_ParseTuple=python36.PyArg_ParseTuple
- PyArg_ParseTupleAndKeywords=python36.PyArg_ParseTupleAndKeywords
- PyArg_UnpackTuple=python36.PyArg_UnpackTuple
- PyArg_VaParse=python36.PyArg_VaParse
- PyArg_VaParseTupleAndKeywords=python36.PyArg_VaParseTupleAndKeywords
- PyArg_ValidateKeywordArguments=python36.PyArg_ValidateKeywordArguments
- PyBaseObject_Type=python36.PyBaseObject_Type DATA
- PyBool_FromLong=python36.PyBool_FromLong
- PyBool_Type=python36.PyBool_Type DATA
- PyByteArrayIter_Type=python36.PyByteArrayIter_Type DATA
- PyByteArray_AsString=python36.PyByteArray_AsString
- PyByteArray_Concat=python36.PyByteArray_Concat
- PyByteArray_FromObject=python36.PyByteArray_FromObject
- PyByteArray_FromStringAndSize=python36.PyByteArray_FromStringAndSize
- PyByteArray_Resize=python36.PyByteArray_Resize
- PyByteArray_Size=python36.PyByteArray_Size
- PyByteArray_Type=python36.PyByteArray_Type DATA
- PyBytesIter_Type=python36.PyBytesIter_Type DATA
- PyBytes_AsString=python36.PyBytes_AsString
- PyBytes_AsStringAndSize=python36.PyBytes_AsStringAndSize
- PyBytes_Concat=python36.PyBytes_Concat
- PyBytes_ConcatAndDel=python36.PyBytes_ConcatAndDel
- PyBytes_DecodeEscape=python36.PyBytes_DecodeEscape
- PyBytes_FromFormat=python36.PyBytes_FromFormat
- PyBytes_FromFormatV=python36.PyBytes_FromFormatV
- PyBytes_FromObject=python36.PyBytes_FromObject
- PyBytes_FromString=python36.PyBytes_FromString
- PyBytes_FromStringAndSize=python36.PyBytes_FromStringAndSize
- PyBytes_Repr=python36.PyBytes_Repr
- PyBytes_Size=python36.PyBytes_Size
- PyBytes_Type=python36.PyBytes_Type DATA
- PyCFunction_Call=python36.PyCFunction_Call
- PyCFunction_ClearFreeList=python36.PyCFunction_ClearFreeList
- PyCFunction_GetFlags=python36.PyCFunction_GetFlags
- PyCFunction_GetFunction=python36.PyCFunction_GetFunction
- PyCFunction_GetSelf=python36.PyCFunction_GetSelf
- PyCFunction_New=python36.PyCFunction_New
- PyCFunction_NewEx=python36.PyCFunction_NewEx
- PyCFunction_Type=python36.PyCFunction_Type DATA
- PyCallIter_New=python36.PyCallIter_New
- PyCallIter_Type=python36.PyCallIter_Type DATA
- PyCallable_Check=python36.PyCallable_Check
- PyCapsule_GetContext=python36.PyCapsule_GetContext
- PyCapsule_GetDestructor=python36.PyCapsule_GetDestructor
- PyCapsule_GetName=python36.PyCapsule_GetName
- PyCapsule_GetPointer=python36.PyCapsule_GetPointer
- PyCapsule_Import=python36.PyCapsule_Import
- PyCapsule_IsValid=python36.PyCapsule_IsValid
- PyCapsule_New=python36.PyCapsule_New
- PyCapsule_SetContext=python36.PyCapsule_SetContext
- PyCapsule_SetDestructor=python36.PyCapsule_SetDestructor
- PyCapsule_SetName=python36.PyCapsule_SetName
- PyCapsule_SetPointer=python36.PyCapsule_SetPointer
- PyCapsule_Type=python36.PyCapsule_Type DATA
- PyClassMethodDescr_Type=python36.PyClassMethodDescr_Type DATA
- PyCodec_BackslashReplaceErrors=python36.PyCodec_BackslashReplaceErrors
- PyCodec_Decode=python36.PyCodec_Decode
- PyCodec_Decoder=python36.PyCodec_Decoder
- PyCodec_Encode=python36.PyCodec_Encode
- PyCodec_Encoder=python36.PyCodec_Encoder
- PyCodec_IgnoreErrors=python36.PyCodec_IgnoreErrors
- PyCodec_IncrementalDecoder=python36.PyCodec_IncrementalDecoder
- PyCodec_IncrementalEncoder=python36.PyCodec_IncrementalEncoder
- PyCodec_KnownEncoding=python36.PyCodec_KnownEncoding
- PyCodec_LookupError=python36.PyCodec_LookupError
- PyCodec_NameReplaceErrors=python36.PyCodec_NameReplaceErrors
- PyCodec_Register=python36.PyCodec_Register
- PyCodec_RegisterError=python36.PyCodec_RegisterError
- PyCodec_ReplaceErrors=python36.PyCodec_ReplaceErrors
- PyCodec_StreamReader=python36.PyCodec_StreamReader
- PyCodec_StreamWriter=python36.PyCodec_StreamWriter
- PyCodec_StrictErrors=python36.PyCodec_StrictErrors
- PyCodec_XMLCharRefReplaceErrors=python36.PyCodec_XMLCharRefReplaceErrors
- PyComplex_FromDoubles=python36.PyComplex_FromDoubles
- PyComplex_ImagAsDouble=python36.PyComplex_ImagAsDouble
- PyComplex_RealAsDouble=python36.PyComplex_RealAsDouble
- PyComplex_Type=python36.PyComplex_Type DATA
- PyDescr_NewClassMethod=python36.PyDescr_NewClassMethod
- PyDescr_NewGetSet=python36.PyDescr_NewGetSet
- PyDescr_NewMember=python36.PyDescr_NewMember
- PyDescr_NewMethod=python36.PyDescr_NewMethod
- PyDictItems_Type=python36.PyDictItems_Type DATA
- PyDictIterItem_Type=python36.PyDictIterItem_Type DATA
- PyDictIterKey_Type=python36.PyDictIterKey_Type DATA
- PyDictIterValue_Type=python36.PyDictIterValue_Type DATA
- PyDictKeys_Type=python36.PyDictKeys_Type DATA
- PyDictProxy_New=python36.PyDictProxy_New
- PyDictProxy_Type=python36.PyDictProxy_Type DATA
- PyDictValues_Type=python36.PyDictValues_Type DATA
- PyDict_Clear=python36.PyDict_Clear
- PyDict_Contains=python36.PyDict_Contains
- PyDict_Copy=python36.PyDict_Copy
- PyDict_DelItem=python36.PyDict_DelItem
- PyDict_DelItemString=python36.PyDict_DelItemString
- PyDict_GetItem=python36.PyDict_GetItem
- PyDict_GetItemString=python36.PyDict_GetItemString
- PyDict_GetItemWithError=python36.PyDict_GetItemWithError
- PyDict_Items=python36.PyDict_Items
- PyDict_Keys=python36.PyDict_Keys
- PyDict_Merge=python36.PyDict_Merge
- PyDict_MergeFromSeq2=python36.PyDict_MergeFromSeq2
- PyDict_New=python36.PyDict_New
- PyDict_Next=python36.PyDict_Next
- PyDict_SetItem=python36.PyDict_SetItem
- PyDict_SetItemString=python36.PyDict_SetItemString
- PyDict_Size=python36.PyDict_Size
- PyDict_Type=python36.PyDict_Type DATA
- PyDict_Update=python36.PyDict_Update
- PyDict_Values=python36.PyDict_Values
- PyEllipsis_Type=python36.PyEllipsis_Type DATA
- PyEnum_Type=python36.PyEnum_Type DATA
- PyErr_BadArgument=python36.PyErr_BadArgument
- PyErr_BadInternalCall=python36.PyErr_BadInternalCall
- PyErr_CheckSignals=python36.PyErr_CheckSignals
- PyErr_Clear=python36.PyErr_Clear
- PyErr_Display=python36.PyErr_Display
- PyErr_ExceptionMatches=python36.PyErr_ExceptionMatches
- PyErr_Fetch=python36.PyErr_Fetch
- PyErr_Format=python36.PyErr_Format
- PyErr_FormatV=python36.PyErr_FormatV
- PyErr_GetExcInfo=python36.PyErr_GetExcInfo
- PyErr_GivenExceptionMatches=python36.PyErr_GivenExceptionMatches
- PyErr_NewException=python36.PyErr_NewException
- PyErr_NewExceptionWithDoc=python36.PyErr_NewExceptionWithDoc
- PyErr_NoMemory=python36.PyErr_NoMemory
- PyErr_NormalizeException=python36.PyErr_NormalizeException
- PyErr_Occurred=python36.PyErr_Occurred
- PyErr_Print=python36.PyErr_Print
- PyErr_PrintEx=python36.PyErr_PrintEx
- PyErr_ProgramText=python36.PyErr_ProgramText
- PyErr_ResourceWarning=python36.PyErr_ResourceWarning
- PyErr_Restore=python36.PyErr_Restore
- PyErr_SetExcFromWindowsErr=python36.PyErr_SetExcFromWindowsErr
- PyErr_SetExcFromWindowsErrWithFilename=python36.PyErr_SetExcFromWindowsErrWithFilename
- PyErr_SetExcFromWindowsErrWithFilenameObject=python36.PyErr_SetExcFromWindowsErrWithFilenameObject
- PyErr_SetExcFromWindowsErrWithFilenameObjects=python36.PyErr_SetExcFromWindowsErrWithFilenameObjects
- PyErr_SetExcInfo=python36.PyErr_SetExcInfo
- PyErr_SetFromErrno=python36.PyErr_SetFromErrno
- PyErr_SetFromErrnoWithFilename=python36.PyErr_SetFromErrnoWithFilename
- PyErr_SetFromErrnoWithFilenameObject=python36.PyErr_SetFromErrnoWithFilenameObject
- PyErr_SetFromErrnoWithFilenameObjects=python36.PyErr_SetFromErrnoWithFilenameObjects
- PyErr_SetFromWindowsErr=python36.PyErr_SetFromWindowsErr
- PyErr_SetFromWindowsErrWithFilename=python36.PyErr_SetFromWindowsErrWithFilename
- PyErr_SetImportError=python36.PyErr_SetImportError
- PyErr_SetImportErrorSubclass=python36.PyErr_SetImportErrorSubclass
- PyErr_SetInterrupt=python36.PyErr_SetInterrupt
- PyErr_SetNone=python36.PyErr_SetNone
- PyErr_SetObject=python36.PyErr_SetObject
- PyErr_SetString=python36.PyErr_SetString
- PyErr_SyntaxLocation=python36.PyErr_SyntaxLocation
- PyErr_SyntaxLocationEx=python36.PyErr_SyntaxLocationEx
- PyErr_WarnEx=python36.PyErr_WarnEx
- PyErr_WarnExplicit=python36.PyErr_WarnExplicit
- PyErr_WarnFormat=python36.PyErr_WarnFormat
- PyErr_WriteUnraisable=python36.PyErr_WriteUnraisable
- PyEval_AcquireLock=python36.PyEval_AcquireLock
- PyEval_AcquireThread=python36.PyEval_AcquireThread
- PyEval_CallFunction=python36.PyEval_CallFunction
- PyEval_CallMethod=python36.PyEval_CallMethod
- PyEval_CallObjectWithKeywords=python36.PyEval_CallObjectWithKeywords
- PyEval_EvalCode=python36.PyEval_EvalCode
- PyEval_EvalCodeEx=python36.PyEval_EvalCodeEx
- PyEval_EvalFrame=python36.PyEval_EvalFrame
- PyEval_EvalFrameEx=python36.PyEval_EvalFrameEx
- PyEval_GetBuiltins=python36.PyEval_GetBuiltins
- PyEval_GetCallStats=python36.PyEval_GetCallStats
- PyEval_GetFrame=python36.PyEval_GetFrame
- PyEval_GetFuncDesc=python36.PyEval_GetFuncDesc
- PyEval_GetFuncName=python36.PyEval_GetFuncName
- PyEval_GetGlobals=python36.PyEval_GetGlobals
- PyEval_GetLocals=python36.PyEval_GetLocals
- PyEval_InitThreads=python36.PyEval_InitThreads
- PyEval_ReInitThreads=python36.PyEval_ReInitThreads
- PyEval_ReleaseLock=python36.PyEval_ReleaseLock
- PyEval_ReleaseThread=python36.PyEval_ReleaseThread
- PyEval_RestoreThread=python36.PyEval_RestoreThread
- PyEval_SaveThread=python36.PyEval_SaveThread
- PyEval_ThreadsInitialized=python36.PyEval_ThreadsInitialized
- PyExc_ArithmeticError=python36.PyExc_ArithmeticError DATA
- PyExc_AssertionError=python36.PyExc_AssertionError DATA
- PyExc_AttributeError=python36.PyExc_AttributeError DATA
- PyExc_BaseException=python36.PyExc_BaseException DATA
- PyExc_BlockingIOError=python36.PyExc_BlockingIOError DATA
- PyExc_BrokenPipeError=python36.PyExc_BrokenPipeError DATA
- PyExc_BufferError=python36.PyExc_BufferError DATA
- PyExc_BytesWarning=python36.PyExc_BytesWarning DATA
- PyExc_ChildProcessError=python36.PyExc_ChildProcessError DATA
- PyExc_ConnectionAbortedError=python36.PyExc_ConnectionAbortedError DATA
- PyExc_ConnectionError=python36.PyExc_ConnectionError DATA
- PyExc_ConnectionRefusedError=python36.PyExc_ConnectionRefusedError DATA
- PyExc_ConnectionResetError=python36.PyExc_ConnectionResetError DATA
- PyExc_DeprecationWarning=python36.PyExc_DeprecationWarning DATA
- PyExc_EOFError=python36.PyExc_EOFError DATA
- PyExc_EnvironmentError=python36.PyExc_EnvironmentError DATA
- PyExc_Exception=python36.PyExc_Exception DATA
- PyExc_FileExistsError=python36.PyExc_FileExistsError DATA
- PyExc_FileNotFoundError=python36.PyExc_FileNotFoundError DATA
- PyExc_FloatingPointError=python36.PyExc_FloatingPointError DATA
- PyExc_FutureWarning=python36.PyExc_FutureWarning DATA
- PyExc_GeneratorExit=python36.PyExc_GeneratorExit DATA
- PyExc_IOError=python36.PyExc_IOError DATA
- PyExc_ImportError=python36.PyExc_ImportError DATA
- PyExc_ImportWarning=python36.PyExc_ImportWarning DATA
- PyExc_IndentationError=python36.PyExc_IndentationError DATA
- PyExc_IndexError=python36.PyExc_IndexError DATA
- PyExc_InterruptedError=python36.PyExc_InterruptedError DATA
- PyExc_IsADirectoryError=python36.PyExc_IsADirectoryError DATA
- PyExc_KeyError=python36.PyExc_KeyError DATA
- PyExc_KeyboardInterrupt=python36.PyExc_KeyboardInterrupt DATA
- PyExc_LookupError=python36.PyExc_LookupError DATA
- PyExc_MemoryError=python36.PyExc_MemoryError DATA
- PyExc_ModuleNotFoundError=python36.PyExc_ModuleNotFoundError DATA
- PyExc_NameError=python36.PyExc_NameError DATA
- PyExc_NotADirectoryError=python36.PyExc_NotADirectoryError DATA
- PyExc_NotImplementedError=python36.PyExc_NotImplementedError DATA
- PyExc_OSError=python36.PyExc_OSError DATA
- PyExc_OverflowError=python36.PyExc_OverflowError DATA
- PyExc_PendingDeprecationWarning=python36.PyExc_PendingDeprecationWarning DATA
- PyExc_PermissionError=python36.PyExc_PermissionError DATA
- PyExc_ProcessLookupError=python36.PyExc_ProcessLookupError DATA
- PyExc_RecursionError=python36.PyExc_RecursionError DATA
- PyExc_RecursionErrorInst=python36.PyExc_RecursionErrorInst DATA
- PyExc_ReferenceError=python36.PyExc_ReferenceError DATA
- PyExc_ResourceWarning=python36.PyExc_ResourceWarning DATA
- PyExc_RuntimeError=python36.PyExc_RuntimeError DATA
- PyExc_RuntimeWarning=python36.PyExc_RuntimeWarning DATA
- PyExc_StopAsyncIteration=python36.PyExc_StopAsyncIteration DATA
- PyExc_StopIteration=python36.PyExc_StopIteration DATA
- PyExc_SyntaxError=python36.PyExc_SyntaxError DATA
- PyExc_SyntaxWarning=python36.PyExc_SyntaxWarning DATA
- PyExc_SystemError=python36.PyExc_SystemError DATA
- PyExc_SystemExit=python36.PyExc_SystemExit DATA
- PyExc_TabError=python36.PyExc_TabError DATA
- PyExc_TimeoutError=python36.PyExc_TimeoutError DATA
- PyExc_TypeError=python36.PyExc_TypeError DATA
- PyExc_UnboundLocalError=python36.PyExc_UnboundLocalError DATA
- PyExc_UnicodeDecodeError=python36.PyExc_UnicodeDecodeError DATA
- PyExc_UnicodeEncodeError=python36.PyExc_UnicodeEncodeError DATA
- PyExc_UnicodeError=python36.PyExc_UnicodeError DATA
- PyExc_UnicodeTranslateError=python36.PyExc_UnicodeTranslateError DATA
- PyExc_UnicodeWarning=python36.PyExc_UnicodeWarning DATA
- PyExc_UserWarning=python36.PyExc_UserWarning DATA
- PyExc_ValueError=python36.PyExc_ValueError DATA
- PyExc_Warning=python36.PyExc_Warning DATA
- PyExc_WindowsError=python36.PyExc_WindowsError DATA
- PyExc_ZeroDivisionError=python36.PyExc_ZeroDivisionError DATA
- PyException_GetCause=python36.PyException_GetCause
- PyException_GetContext=python36.PyException_GetContext
- PyException_GetTraceback=python36.PyException_GetTraceback
- PyException_SetCause=python36.PyException_SetCause
- PyException_SetContext=python36.PyException_SetContext
- PyException_SetTraceback=python36.PyException_SetTraceback
- PyFile_FromFd=python36.PyFile_FromFd
- PyFile_GetLine=python36.PyFile_GetLine
- PyFile_WriteObject=python36.PyFile_WriteObject
- PyFile_WriteString=python36.PyFile_WriteString
- PyFilter_Type=python36.PyFilter_Type DATA
- PyFloat_AsDouble=python36.PyFloat_AsDouble
- PyFloat_FromDouble=python36.PyFloat_FromDouble
- PyFloat_FromString=python36.PyFloat_FromString
- PyFloat_GetInfo=python36.PyFloat_GetInfo
- PyFloat_GetMax=python36.PyFloat_GetMax
- PyFloat_GetMin=python36.PyFloat_GetMin
- PyFloat_Type=python36.PyFloat_Type DATA
- PyFrozenSet_New=python36.PyFrozenSet_New
- PyFrozenSet_Type=python36.PyFrozenSet_Type DATA
- PyGC_Collect=python36.PyGC_Collect
- PyGILState_Ensure=python36.PyGILState_Ensure
- PyGILState_GetThisThreadState=python36.PyGILState_GetThisThreadState
- PyGILState_Release=python36.PyGILState_Release
- PyGetSetDescr_Type=python36.PyGetSetDescr_Type DATA
- PyImport_AddModule=python36.PyImport_AddModule
- PyImport_AddModuleObject=python36.PyImport_AddModuleObject
- PyImport_AppendInittab=python36.PyImport_AppendInittab
- PyImport_Cleanup=python36.PyImport_Cleanup
- PyImport_ExecCodeModule=python36.PyImport_ExecCodeModule
- PyImport_ExecCodeModuleEx=python36.PyImport_ExecCodeModuleEx
- PyImport_ExecCodeModuleObject=python36.PyImport_ExecCodeModuleObject
- PyImport_ExecCodeModuleWithPathnames=python36.PyImport_ExecCodeModuleWithPathnames
- PyImport_GetImporter=python36.PyImport_GetImporter
- PyImport_GetMagicNumber=python36.PyImport_GetMagicNumber
- PyImport_GetMagicTag=python36.PyImport_GetMagicTag
- PyImport_GetModuleDict=python36.PyImport_GetModuleDict
- PyImport_Import=python36.PyImport_Import
- PyImport_ImportFrozenModule=python36.PyImport_ImportFrozenModule
- PyImport_ImportFrozenModuleObject=python36.PyImport_ImportFrozenModuleObject
- PyImport_ImportModule=python36.PyImport_ImportModule
- PyImport_ImportModuleLevel=python36.PyImport_ImportModuleLevel
- PyImport_ImportModuleLevelObject=python36.PyImport_ImportModuleLevelObject
- PyImport_ImportModuleNoBlock=python36.PyImport_ImportModuleNoBlock
- PyImport_ReloadModule=python36.PyImport_ReloadModule
- PyInterpreterState_Clear=python36.PyInterpreterState_Clear
- PyInterpreterState_Delete=python36.PyInterpreterState_Delete
- PyInterpreterState_New=python36.PyInterpreterState_New
- PyIter_Next=python36.PyIter_Next
- PyListIter_Type=python36.PyListIter_Type DATA
- PyListRevIter_Type=python36.PyListRevIter_Type DATA
- PyList_Append=python36.PyList_Append
- PyList_AsTuple=python36.PyList_AsTuple
- PyList_GetItem=python36.PyList_GetItem
- PyList_GetSlice=python36.PyList_GetSlice
- PyList_Insert=python36.PyList_Insert
- PyList_New=python36.PyList_New
- PyList_Reverse=python36.PyList_Reverse
- PyList_SetItem=python36.PyList_SetItem
- PyList_SetSlice=python36.PyList_SetSlice
- PyList_Size=python36.PyList_Size
- PyList_Sort=python36.PyList_Sort
- PyList_Type=python36.PyList_Type DATA
- PyLongRangeIter_Type=python36.PyLongRangeIter_Type DATA
- PyLong_AsDouble=python36.PyLong_AsDouble
- PyLong_AsLong=python36.PyLong_AsLong
- PyLong_AsLongAndOverflow=python36.PyLong_AsLongAndOverflow
- PyLong_AsLongLong=python36.PyLong_AsLongLong
- PyLong_AsLongLongAndOverflow=python36.PyLong_AsLongLongAndOverflow
- PyLong_AsSize_t=python36.PyLong_AsSize_t
- PyLong_AsSsize_t=python36.PyLong_AsSsize_t
- PyLong_AsUnsignedLong=python36.PyLong_AsUnsignedLong
- PyLong_AsUnsignedLongLong=python36.PyLong_AsUnsignedLongLong
- PyLong_AsUnsignedLongLongMask=python36.PyLong_AsUnsignedLongLongMask
- PyLong_AsUnsignedLongMask=python36.PyLong_AsUnsignedLongMask
- PyLong_AsVoidPtr=python36.PyLong_AsVoidPtr
- PyLong_FromDouble=python36.PyLong_FromDouble
- PyLong_FromLong=python36.PyLong_FromLong
- PyLong_FromLongLong=python36.PyLong_FromLongLong
- PyLong_FromSize_t=python36.PyLong_FromSize_t
- PyLong_FromSsize_t=python36.PyLong_FromSsize_t
- PyLong_FromString=python36.PyLong_FromString
- PyLong_FromUnsignedLong=python36.PyLong_FromUnsignedLong
- PyLong_FromUnsignedLongLong=python36.PyLong_FromUnsignedLongLong
- PyLong_FromVoidPtr=python36.PyLong_FromVoidPtr
- PyLong_GetInfo=python36.PyLong_GetInfo
- PyLong_Type=python36.PyLong_Type DATA
- PyMap_Type=python36.PyMap_Type DATA
- PyMapping_Check=python36.PyMapping_Check
- PyMapping_GetItemString=python36.PyMapping_GetItemString
- PyMapping_HasKey=python36.PyMapping_HasKey
- PyMapping_HasKeyString=python36.PyMapping_HasKeyString
- PyMapping_Items=python36.PyMapping_Items
- PyMapping_Keys=python36.PyMapping_Keys
- PyMapping_Length=python36.PyMapping_Length
- PyMapping_SetItemString=python36.PyMapping_SetItemString
- PyMapping_Size=python36.PyMapping_Size
- PyMapping_Values=python36.PyMapping_Values
- PyMem_Calloc=python36.PyMem_Calloc
- PyMem_Free=python36.PyMem_Free
- PyMem_Malloc=python36.PyMem_Malloc
- PyMem_Realloc=python36.PyMem_Realloc
- PyMemberDescr_Type=python36.PyMemberDescr_Type DATA
- PyMemoryView_FromMemory=python36.PyMemoryView_FromMemory
- PyMemoryView_FromObject=python36.PyMemoryView_FromObject
- PyMemoryView_GetContiguous=python36.PyMemoryView_GetContiguous
- PyMemoryView_Type=python36.PyMemoryView_Type DATA
- PyMethodDescr_Type=python36.PyMethodDescr_Type DATA
- PyModuleDef_Init=python36.PyModuleDef_Init
- PyModuleDef_Type=python36.PyModuleDef_Type DATA
- PyModule_AddFunctions=python36.PyModule_AddFunctions
- PyModule_AddIntConstant=python36.PyModule_AddIntConstant
- PyModule_AddObject=python36.PyModule_AddObject
- PyModule_AddStringConstant=python36.PyModule_AddStringConstant
- PyModule_Create2=python36.PyModule_Create2
- PyModule_ExecDef=python36.PyModule_ExecDef
- PyModule_FromDefAndSpec2=python36.PyModule_FromDefAndSpec2
- PyModule_GetDef=python36.PyModule_GetDef
- PyModule_GetDict=python36.PyModule_GetDict
- PyModule_GetFilename=python36.PyModule_GetFilename
- PyModule_GetFilenameObject=python36.PyModule_GetFilenameObject
- PyModule_GetName=python36.PyModule_GetName
- PyModule_GetNameObject=python36.PyModule_GetNameObject
- PyModule_GetState=python36.PyModule_GetState
- PyModule_New=python36.PyModule_New
- PyModule_NewObject=python36.PyModule_NewObject
- PyModule_SetDocString=python36.PyModule_SetDocString
- PyModule_Type=python36.PyModule_Type DATA
- PyNullImporter_Type=python36.PyNullImporter_Type DATA
- PyNumber_Absolute=python36.PyNumber_Absolute
- PyNumber_Add=python36.PyNumber_Add
- PyNumber_And=python36.PyNumber_And
- PyNumber_AsSsize_t=python36.PyNumber_AsSsize_t
- PyNumber_Check=python36.PyNumber_Check
- PyNumber_Divmod=python36.PyNumber_Divmod
- PyNumber_Float=python36.PyNumber_Float
- PyNumber_FloorDivide=python36.PyNumber_FloorDivide
- PyNumber_InPlaceAdd=python36.PyNumber_InPlaceAdd
- PyNumber_InPlaceAnd=python36.PyNumber_InPlaceAnd
- PyNumber_InPlaceFloorDivide=python36.PyNumber_InPlaceFloorDivide
- PyNumber_InPlaceLshift=python36.PyNumber_InPlaceLshift
- PyNumber_InPlaceMatrixMultiply=python36.PyNumber_InPlaceMatrixMultiply
- PyNumber_InPlaceMultiply=python36.PyNumber_InPlaceMultiply
- PyNumber_InPlaceOr=python36.PyNumber_InPlaceOr
- PyNumber_InPlacePower=python36.PyNumber_InPlacePower
- PyNumber_InPlaceRemainder=python36.PyNumber_InPlaceRemainder
- PyNumber_InPlaceRshift=python36.PyNumber_InPlaceRshift
- PyNumber_InPlaceSubtract=python36.PyNumber_InPlaceSubtract
- PyNumber_InPlaceTrueDivide=python36.PyNumber_InPlaceTrueDivide
- PyNumber_InPlaceXor=python36.PyNumber_InPlaceXor
- PyNumber_Index=python36.PyNumber_Index
- PyNumber_Invert=python36.PyNumber_Invert
- PyNumber_Long=python36.PyNumber_Long
- PyNumber_Lshift=python36.PyNumber_Lshift
- PyNumber_MatrixMultiply=python36.PyNumber_MatrixMultiply
- PyNumber_Multiply=python36.PyNumber_Multiply
- PyNumber_Negative=python36.PyNumber_Negative
- PyNumber_Or=python36.PyNumber_Or
- PyNumber_Positive=python36.PyNumber_Positive
- PyNumber_Power=python36.PyNumber_Power
- PyNumber_Remainder=python36.PyNumber_Remainder
- PyNumber_Rshift=python36.PyNumber_Rshift
- PyNumber_Subtract=python36.PyNumber_Subtract
- PyNumber_ToBase=python36.PyNumber_ToBase
- PyNumber_TrueDivide=python36.PyNumber_TrueDivide
- PyNumber_Xor=python36.PyNumber_Xor
- PyODictItems_Type=python36.PyODictItems_Type DATA
- PyODictIter_Type=python36.PyODictIter_Type DATA
- PyODictKeys_Type=python36.PyODictKeys_Type DATA
- PyODictValues_Type=python36.PyODictValues_Type DATA
- PyODict_DelItem=python36.PyODict_DelItem
- PyODict_New=python36.PyODict_New
- PyODict_SetItem=python36.PyODict_SetItem
- PyODict_Type=python36.PyODict_Type DATA
- PyOS_AfterFork=python36.PyOS_AfterFork
- PyOS_CheckStack=python36.PyOS_CheckStack
- PyOS_FSPath=python36.PyOS_FSPath
- PyOS_InitInterrupts=python36.PyOS_InitInterrupts
- PyOS_InputHook=python36.PyOS_InputHook DATA
- PyOS_InterruptOccurred=python36.PyOS_InterruptOccurred
- PyOS_ReadlineFunctionPointer=python36.PyOS_ReadlineFunctionPointer DATA
- PyOS_double_to_string=python36.PyOS_double_to_string
- PyOS_getsig=python36.PyOS_getsig
- PyOS_mystricmp=python36.PyOS_mystricmp
- PyOS_mystrnicmp=python36.PyOS_mystrnicmp
- PyOS_setsig=python36.PyOS_setsig
- PyOS_snprintf=python36.PyOS_snprintf
- PyOS_string_to_double=python36.PyOS_string_to_double
- PyOS_strtol=python36.PyOS_strtol
- PyOS_strtoul=python36.PyOS_strtoul
- PyOS_vsnprintf=python36.PyOS_vsnprintf
- PyObject_ASCII=python36.PyObject_ASCII
- PyObject_AsCharBuffer=python36.PyObject_AsCharBuffer
- PyObject_AsFileDescriptor=python36.PyObject_AsFileDescriptor
- PyObject_AsReadBuffer=python36.PyObject_AsReadBuffer
- PyObject_AsWriteBuffer=python36.PyObject_AsWriteBuffer
- PyObject_Bytes=python36.PyObject_Bytes
- PyObject_Call=python36.PyObject_Call
- PyObject_CallFunction=python36.PyObject_CallFunction
- PyObject_CallFunctionObjArgs=python36.PyObject_CallFunctionObjArgs
- PyObject_CallMethod=python36.PyObject_CallMethod
- PyObject_CallMethodObjArgs=python36.PyObject_CallMethodObjArgs
- PyObject_CallObject=python36.PyObject_CallObject
- PyObject_Calloc=python36.PyObject_Calloc
- PyObject_CheckReadBuffer=python36.PyObject_CheckReadBuffer
- PyObject_ClearWeakRefs=python36.PyObject_ClearWeakRefs
- PyObject_DelItem=python36.PyObject_DelItem
- PyObject_DelItemString=python36.PyObject_DelItemString
- PyObject_Dir=python36.PyObject_Dir
- PyObject_Format=python36.PyObject_Format
- PyObject_Free=python36.PyObject_Free
- PyObject_GC_Del=python36.PyObject_GC_Del
- PyObject_GC_Track=python36.PyObject_GC_Track
- PyObject_GC_UnTrack=python36.PyObject_GC_UnTrack
- PyObject_GenericGetAttr=python36.PyObject_GenericGetAttr
- PyObject_GenericSetAttr=python36.PyObject_GenericSetAttr
- PyObject_GenericSetDict=python36.PyObject_GenericSetDict
- PyObject_GetAttr=python36.PyObject_GetAttr
- PyObject_GetAttrString=python36.PyObject_GetAttrString
- PyObject_GetItem=python36.PyObject_GetItem
- PyObject_GetIter=python36.PyObject_GetIter
- PyObject_HasAttr=python36.PyObject_HasAttr
- PyObject_HasAttrString=python36.PyObject_HasAttrString
- PyObject_Hash=python36.PyObject_Hash
- PyObject_HashNotImplemented=python36.PyObject_HashNotImplemented
- PyObject_Init=python36.PyObject_Init
- PyObject_InitVar=python36.PyObject_InitVar
- PyObject_IsInstance=python36.PyObject_IsInstance
- PyObject_IsSubclass=python36.PyObject_IsSubclass
- PyObject_IsTrue=python36.PyObject_IsTrue
- PyObject_Length=python36.PyObject_Length
- PyObject_Malloc=python36.PyObject_Malloc
- PyObject_Not=python36.PyObject_Not
- PyObject_Realloc=python36.PyObject_Realloc
- PyObject_Repr=python36.PyObject_Repr
- PyObject_RichCompare=python36.PyObject_RichCompare
- PyObject_RichCompareBool=python36.PyObject_RichCompareBool
- PyObject_SelfIter=python36.PyObject_SelfIter
- PyObject_SetAttr=python36.PyObject_SetAttr
- PyObject_SetAttrString=python36.PyObject_SetAttrString
- PyObject_SetItem=python36.PyObject_SetItem
- PyObject_Size=python36.PyObject_Size
- PyObject_Str=python36.PyObject_Str
- PyObject_Type=python36.PyObject_Type
- PyParser_SimpleParseFileFlags=python36.PyParser_SimpleParseFileFlags
- PyParser_SimpleParseStringFlags=python36.PyParser_SimpleParseStringFlags
- PyParser_SimpleParseStringFlagsFilename=python36.PyParser_SimpleParseStringFlagsFilename
- PyProperty_Type=python36.PyProperty_Type DATA
- PyRangeIter_Type=python36.PyRangeIter_Type DATA
- PyRange_Type=python36.PyRange_Type DATA
- PyReversed_Type=python36.PyReversed_Type DATA
- PySeqIter_New=python36.PySeqIter_New
- PySeqIter_Type=python36.PySeqIter_Type DATA
- PySequence_Check=python36.PySequence_Check
- PySequence_Concat=python36.PySequence_Concat
- PySequence_Contains=python36.PySequence_Contains
- PySequence_Count=python36.PySequence_Count
- PySequence_DelItem=python36.PySequence_DelItem
- PySequence_DelSlice=python36.PySequence_DelSlice
- PySequence_Fast=python36.PySequence_Fast
- PySequence_GetItem=python36.PySequence_GetItem
- PySequence_GetSlice=python36.PySequence_GetSlice
- PySequence_In=python36.PySequence_In
- PySequence_InPlaceConcat=python36.PySequence_InPlaceConcat
- PySequence_InPlaceRepeat=python36.PySequence_InPlaceRepeat
- PySequence_Index=python36.PySequence_Index
- PySequence_Length=python36.PySequence_Length
- PySequence_List=python36.PySequence_List
- PySequence_Repeat=python36.PySequence_Repeat
- PySequence_SetItem=python36.PySequence_SetItem
- PySequence_SetSlice=python36.PySequence_SetSlice
- PySequence_Size=python36.PySequence_Size
- PySequence_Tuple=python36.PySequence_Tuple
- PySetIter_Type=python36.PySetIter_Type DATA
- PySet_Add=python36.PySet_Add
- PySet_Clear=python36.PySet_Clear
- PySet_Contains=python36.PySet_Contains
- PySet_Discard=python36.PySet_Discard
- PySet_New=python36.PySet_New
- PySet_Pop=python36.PySet_Pop
- PySet_Size=python36.PySet_Size
- PySet_Type=python36.PySet_Type DATA
- PySlice_AdjustIndices=python36.PySlice_AdjustIndices
- PySlice_GetIndices=python36.PySlice_GetIndices
- PySlice_GetIndicesEx=python36.PySlice_GetIndicesEx
- PySlice_New=python36.PySlice_New
- PySlice_Type=python36.PySlice_Type DATA
- PySlice_Unpack=python36.PySlice_Unpack
- PySortWrapper_Type=python36.PySortWrapper_Type DATA
- PyState_AddModule=python36.PyState_AddModule
- PyState_FindModule=python36.PyState_FindModule
- PyState_RemoveModule=python36.PyState_RemoveModule
- PyStructSequence_GetItem=python36.PyStructSequence_GetItem
- PyStructSequence_New=python36.PyStructSequence_New
- PyStructSequence_NewType=python36.PyStructSequence_NewType
- PyStructSequence_SetItem=python36.PyStructSequence_SetItem
- PySuper_Type=python36.PySuper_Type DATA
- PySys_AddWarnOption=python36.PySys_AddWarnOption
- PySys_AddWarnOptionUnicode=python36.PySys_AddWarnOptionUnicode
- PySys_AddXOption=python36.PySys_AddXOption
- PySys_FormatStderr=python36.PySys_FormatStderr
- PySys_FormatStdout=python36.PySys_FormatStdout
- PySys_GetObject=python36.PySys_GetObject
- PySys_GetXOptions=python36.PySys_GetXOptions
- PySys_HasWarnOptions=python36.PySys_HasWarnOptions
- PySys_ResetWarnOptions=python36.PySys_ResetWarnOptions
- PySys_SetArgv=python36.PySys_SetArgv
- PySys_SetArgvEx=python36.PySys_SetArgvEx
- PySys_SetObject=python36.PySys_SetObject
- PySys_SetPath=python36.PySys_SetPath
- PySys_WriteStderr=python36.PySys_WriteStderr
- PySys_WriteStdout=python36.PySys_WriteStdout
- PyThreadState_Clear=python36.PyThreadState_Clear
- PyThreadState_Delete=python36.PyThreadState_Delete
- PyThreadState_DeleteCurrent=python36.PyThreadState_DeleteCurrent
- PyThreadState_Get=python36.PyThreadState_Get
- PyThreadState_GetDict=python36.PyThreadState_GetDict
- PyThreadState_New=python36.PyThreadState_New
- PyThreadState_SetAsyncExc=python36.PyThreadState_SetAsyncExc
- PyThreadState_Swap=python36.PyThreadState_Swap
- PyTraceBack_Here=python36.PyTraceBack_Here
- PyTraceBack_Print=python36.PyTraceBack_Print
- PyTraceBack_Type=python36.PyTraceBack_Type DATA
- PyTupleIter_Type=python36.PyTupleIter_Type DATA
- PyTuple_ClearFreeList=python36.PyTuple_ClearFreeList
- PyTuple_GetItem=python36.PyTuple_GetItem
- PyTuple_GetSlice=python36.PyTuple_GetSlice
- PyTuple_New=python36.PyTuple_New
- PyTuple_Pack=python36.PyTuple_Pack
- PyTuple_SetItem=python36.PyTuple_SetItem
- PyTuple_Size=python36.PyTuple_Size
- PyTuple_Type=python36.PyTuple_Type DATA
- PyType_ClearCache=python36.PyType_ClearCache
- PyType_FromSpec=python36.PyType_FromSpec
- PyType_FromSpecWithBases=python36.PyType_FromSpecWithBases
- PyType_GenericAlloc=python36.PyType_GenericAlloc
- PyType_GenericNew=python36.PyType_GenericNew
- PyType_GetFlags=python36.PyType_GetFlags
- PyType_GetSlot=python36.PyType_GetSlot
- PyType_IsSubtype=python36.PyType_IsSubtype
- PyType_Modified=python36.PyType_Modified
- PyType_Ready=python36.PyType_Ready
- PyType_Type=python36.PyType_Type DATA
- PyUnicodeDecodeError_Create=python36.PyUnicodeDecodeError_Create
- PyUnicodeDecodeError_GetEncoding=python36.PyUnicodeDecodeError_GetEncoding
- PyUnicodeDecodeError_GetEnd=python36.PyUnicodeDecodeError_GetEnd
- PyUnicodeDecodeError_GetObject=python36.PyUnicodeDecodeError_GetObject
- PyUnicodeDecodeError_GetReason=python36.PyUnicodeDecodeError_GetReason
- PyUnicodeDecodeError_GetStart=python36.PyUnicodeDecodeError_GetStart
- PyUnicodeDecodeError_SetEnd=python36.PyUnicodeDecodeError_SetEnd
- PyUnicodeDecodeError_SetReason=python36.PyUnicodeDecodeError_SetReason
- PyUnicodeDecodeError_SetStart=python36.PyUnicodeDecodeError_SetStart
- PyUnicodeEncodeError_GetEncoding=python36.PyUnicodeEncodeError_GetEncoding
- PyUnicodeEncodeError_GetEnd=python36.PyUnicodeEncodeError_GetEnd
- PyUnicodeEncodeError_GetObject=python36.PyUnicodeEncodeError_GetObject
- PyUnicodeEncodeError_GetReason=python36.PyUnicodeEncodeError_GetReason
- PyUnicodeEncodeError_GetStart=python36.PyUnicodeEncodeError_GetStart
- PyUnicodeEncodeError_SetEnd=python36.PyUnicodeEncodeError_SetEnd
- PyUnicodeEncodeError_SetReason=python36.PyUnicodeEncodeError_SetReason
- PyUnicodeEncodeError_SetStart=python36.PyUnicodeEncodeError_SetStart
- PyUnicodeIter_Type=python36.PyUnicodeIter_Type DATA
- PyUnicodeTranslateError_GetEnd=python36.PyUnicodeTranslateError_GetEnd
- PyUnicodeTranslateError_GetObject=python36.PyUnicodeTranslateError_GetObject
- PyUnicodeTranslateError_GetReason=python36.PyUnicodeTranslateError_GetReason
- PyUnicodeTranslateError_GetStart=python36.PyUnicodeTranslateError_GetStart
- PyUnicodeTranslateError_SetEnd=python36.PyUnicodeTranslateError_SetEnd
- PyUnicodeTranslateError_SetReason=python36.PyUnicodeTranslateError_SetReason
- PyUnicodeTranslateError_SetStart=python36.PyUnicodeTranslateError_SetStart
- PyUnicode_Append=python36.PyUnicode_Append
- PyUnicode_AppendAndDel=python36.PyUnicode_AppendAndDel
- PyUnicode_AsASCIIString=python36.PyUnicode_AsASCIIString
- PyUnicode_AsCharmapString=python36.PyUnicode_AsCharmapString
- PyUnicode_AsDecodedObject=python36.PyUnicode_AsDecodedObject
- PyUnicode_AsDecodedUnicode=python36.PyUnicode_AsDecodedUnicode
- PyUnicode_AsEncodedObject=python36.PyUnicode_AsEncodedObject
- PyUnicode_AsEncodedString=python36.PyUnicode_AsEncodedString
- PyUnicode_AsEncodedUnicode=python36.PyUnicode_AsEncodedUnicode
- PyUnicode_AsLatin1String=python36.PyUnicode_AsLatin1String
- PyUnicode_AsMBCSString=python36.PyUnicode_AsMBCSString
- PyUnicode_AsRawUnicodeEscapeString=python36.PyUnicode_AsRawUnicodeEscapeString
- PyUnicode_AsUCS4=python36.PyUnicode_AsUCS4
- PyUnicode_AsUCS4Copy=python36.PyUnicode_AsUCS4Copy
- PyUnicode_AsUTF16String=python36.PyUnicode_AsUTF16String
- PyUnicode_AsUTF32String=python36.PyUnicode_AsUTF32String
- PyUnicode_AsUTF8String=python36.PyUnicode_AsUTF8String
- PyUnicode_AsUnicodeEscapeString=python36.PyUnicode_AsUnicodeEscapeString
- PyUnicode_AsWideChar=python36.PyUnicode_AsWideChar
- PyUnicode_AsWideCharString=python36.PyUnicode_AsWideCharString
- PyUnicode_BuildEncodingMap=python36.PyUnicode_BuildEncodingMap
- PyUnicode_ClearFreeList=python36.PyUnicode_ClearFreeList
- PyUnicode_Compare=python36.PyUnicode_Compare
- PyUnicode_CompareWithASCIIString=python36.PyUnicode_CompareWithASCIIString
- PyUnicode_Concat=python36.PyUnicode_Concat
- PyUnicode_Contains=python36.PyUnicode_Contains
- PyUnicode_Count=python36.PyUnicode_Count
- PyUnicode_Decode=python36.PyUnicode_Decode
- PyUnicode_DecodeASCII=python36.PyUnicode_DecodeASCII
- PyUnicode_DecodeCharmap=python36.PyUnicode_DecodeCharmap
- PyUnicode_DecodeCodePageStateful=python36.PyUnicode_DecodeCodePageStateful
- PyUnicode_DecodeFSDefault=python36.PyUnicode_DecodeFSDefault
- PyUnicode_DecodeFSDefaultAndSize=python36.PyUnicode_DecodeFSDefaultAndSize
- PyUnicode_DecodeLatin1=python36.PyUnicode_DecodeLatin1
- PyUnicode_DecodeLocale=python36.PyUnicode_DecodeLocale
- PyUnicode_DecodeLocaleAndSize=python36.PyUnicode_DecodeLocaleAndSize
- PyUnicode_DecodeMBCS=python36.PyUnicode_DecodeMBCS
- PyUnicode_DecodeMBCSStateful=python36.PyUnicode_DecodeMBCSStateful
- PyUnicode_DecodeRawUnicodeEscape=python36.PyUnicode_DecodeRawUnicodeEscape
- PyUnicode_DecodeUTF16=python36.PyUnicode_DecodeUTF16
- PyUnicode_DecodeUTF16Stateful=python36.PyUnicode_DecodeUTF16Stateful
- PyUnicode_DecodeUTF32=python36.PyUnicode_DecodeUTF32
- PyUnicode_DecodeUTF32Stateful=python36.PyUnicode_DecodeUTF32Stateful
- PyUnicode_DecodeUTF7=python36.PyUnicode_DecodeUTF7
- PyUnicode_DecodeUTF7Stateful=python36.PyUnicode_DecodeUTF7Stateful
- PyUnicode_DecodeUTF8=python36.PyUnicode_DecodeUTF8
- PyUnicode_DecodeUTF8Stateful=python36.PyUnicode_DecodeUTF8Stateful
- PyUnicode_DecodeUnicodeEscape=python36.PyUnicode_DecodeUnicodeEscape
- PyUnicode_EncodeCodePage=python36.PyUnicode_EncodeCodePage
- PyUnicode_EncodeFSDefault=python36.PyUnicode_EncodeFSDefault
- PyUnicode_EncodeLocale=python36.PyUnicode_EncodeLocale
- PyUnicode_FSConverter=python36.PyUnicode_FSConverter
- PyUnicode_FSDecoder=python36.PyUnicode_FSDecoder
- PyUnicode_Find=python36.PyUnicode_Find
- PyUnicode_FindChar=python36.PyUnicode_FindChar
- PyUnicode_Format=python36.PyUnicode_Format
- PyUnicode_FromEncodedObject=python36.PyUnicode_FromEncodedObject
- PyUnicode_FromFormat=python36.PyUnicode_FromFormat
- PyUnicode_FromFormatV=python36.PyUnicode_FromFormatV
- PyUnicode_FromObject=python36.PyUnicode_FromObject
- PyUnicode_FromOrdinal=python36.PyUnicode_FromOrdinal
- PyUnicode_FromString=python36.PyUnicode_FromString
- PyUnicode_FromStringAndSize=python36.PyUnicode_FromStringAndSize
- PyUnicode_FromWideChar=python36.PyUnicode_FromWideChar
- PyUnicode_GetDefaultEncoding=python36.PyUnicode_GetDefaultEncoding
- PyUnicode_GetLength=python36.PyUnicode_GetLength
- PyUnicode_GetSize=python36.PyUnicode_GetSize
- PyUnicode_InternFromString=python36.PyUnicode_InternFromString
- PyUnicode_InternImmortal=python36.PyUnicode_InternImmortal
- PyUnicode_InternInPlace=python36.PyUnicode_InternInPlace
- PyUnicode_IsIdentifier=python36.PyUnicode_IsIdentifier
- PyUnicode_Join=python36.PyUnicode_Join
- PyUnicode_Partition=python36.PyUnicode_Partition
- PyUnicode_RPartition=python36.PyUnicode_RPartition
- PyUnicode_RSplit=python36.PyUnicode_RSplit
- PyUnicode_ReadChar=python36.PyUnicode_ReadChar
- PyUnicode_Replace=python36.PyUnicode_Replace
- PyUnicode_Resize=python36.PyUnicode_Resize
- PyUnicode_RichCompare=python36.PyUnicode_RichCompare
- PyUnicode_Split=python36.PyUnicode_Split
- PyUnicode_Splitlines=python36.PyUnicode_Splitlines
- PyUnicode_Substring=python36.PyUnicode_Substring
- PyUnicode_Tailmatch=python36.PyUnicode_Tailmatch
- PyUnicode_Translate=python36.PyUnicode_Translate
- PyUnicode_Type=python36.PyUnicode_Type DATA
- PyUnicode_WriteChar=python36.PyUnicode_WriteChar
- PyWeakref_GetObject=python36.PyWeakref_GetObject
- PyWeakref_NewProxy=python36.PyWeakref_NewProxy
- PyWeakref_NewRef=python36.PyWeakref_NewRef
- PyWrapperDescr_Type=python36.PyWrapperDescr_Type DATA
- PyWrapper_New=python36.PyWrapper_New
- PyZip_Type=python36.PyZip_Type DATA
- Py_AddPendingCall=python36.Py_AddPendingCall
- Py_AtExit=python36.Py_AtExit
- Py_BuildValue=python36.Py_BuildValue
- Py_CompileString=python36.Py_CompileString
- Py_DecRef=python36.Py_DecRef
- Py_DecodeLocale=python36.Py_DecodeLocale
- Py_EncodeLocale=python36.Py_EncodeLocale
- Py_EndInterpreter=python36.Py_EndInterpreter
- Py_Exit=python36.Py_Exit
- Py_FatalError=python36.Py_FatalError
- Py_FileSystemDefaultEncodeErrors=python36.Py_FileSystemDefaultEncodeErrors DATA
- Py_FileSystemDefaultEncoding=python36.Py_FileSystemDefaultEncoding DATA
- Py_Finalize=python36.Py_Finalize
- Py_FinalizeEx=python36.Py_FinalizeEx
- Py_GetBuildInfo=python36.Py_GetBuildInfo
- Py_GetCompiler=python36.Py_GetCompiler
- Py_GetCopyright=python36.Py_GetCopyright
- Py_GetExecPrefix=python36.Py_GetExecPrefix
- Py_GetPath=python36.Py_GetPath
- Py_GetPlatform=python36.Py_GetPlatform
- Py_GetPrefix=python36.Py_GetPrefix
- Py_GetProgramFullPath=python36.Py_GetProgramFullPath
- Py_GetProgramName=python36.Py_GetProgramName
- Py_GetPythonHome=python36.Py_GetPythonHome
- Py_GetRecursionLimit=python36.Py_GetRecursionLimit
- Py_GetVersion=python36.Py_GetVersion
- Py_HasFileSystemDefaultEncoding=python36.Py_HasFileSystemDefaultEncoding DATA
- Py_IncRef=python36.Py_IncRef
- Py_Initialize=python36.Py_Initialize
- Py_InitializeEx=python36.Py_InitializeEx
- Py_IsInitialized=python36.Py_IsInitialized
- Py_Main=python36.Py_Main
- Py_MakePendingCalls=python36.Py_MakePendingCalls
- Py_NewInterpreter=python36.Py_NewInterpreter
- Py_ReprEnter=python36.Py_ReprEnter
- Py_ReprLeave=python36.Py_ReprLeave
- Py_SetPath=python36.Py_SetPath
- Py_SetProgramName=python36.Py_SetProgramName
- Py_SetPythonHome=python36.Py_SetPythonHome
- Py_SetRecursionLimit=python36.Py_SetRecursionLimit
- Py_SymtableString=python36.Py_SymtableString
- Py_VaBuildValue=python36.Py_VaBuildValue
- _PyArg_ParseTupleAndKeywords_SizeT=python36._PyArg_ParseTupleAndKeywords_SizeT
- _PyArg_ParseTuple_SizeT=python36._PyArg_ParseTuple_SizeT
- _PyArg_Parse_SizeT=python36._PyArg_Parse_SizeT
- _PyArg_VaParseTupleAndKeywords_SizeT=python36._PyArg_VaParseTupleAndKeywords_SizeT
- _PyArg_VaParse_SizeT=python36._PyArg_VaParse_SizeT
- _PyErr_BadInternalCall=python36._PyErr_BadInternalCall
- _PyObject_CallFunction_SizeT=python36._PyObject_CallFunction_SizeT
- _PyObject_CallMethod_SizeT=python36._PyObject_CallMethod_SizeT
- _PyObject_GC_Malloc=python36._PyObject_GC_Malloc
- _PyObject_GC_New=python36._PyObject_GC_New
- _PyObject_GC_NewVar=python36._PyObject_GC_NewVar
- _PyObject_GC_Resize=python36._PyObject_GC_Resize
- _PyObject_New=python36._PyObject_New
- _PyObject_NewVar=python36._PyObject_NewVar
- _PyState_AddModule=python36._PyState_AddModule
- _PyThreadState_Init=python36._PyThreadState_Init
- _PyThreadState_Prealloc=python36._PyThreadState_Prealloc
- _PyTrash_delete_later=python36._PyTrash_delete_later DATA
- _PyTrash_delete_nesting=python36._PyTrash_delete_nesting DATA
- _PyTrash_deposit_object=python36._PyTrash_deposit_object
- _PyTrash_destroy_chain=python36._PyTrash_destroy_chain
- _PyTrash_thread_deposit_object=python36._PyTrash_thread_deposit_object
- _PyTrash_thread_destroy_chain=python36._PyTrash_thread_destroy_chain
- _PyWeakref_CallableProxyType=python36._PyWeakref_CallableProxyType DATA
- _PyWeakref_ProxyType=python36._PyWeakref_ProxyType DATA
- _PyWeakref_RefType=python36._PyWeakref_RefType DATA
- _Py_BuildValue_SizeT=python36._Py_BuildValue_SizeT
- _Py_CheckRecursionLimit=python36._Py_CheckRecursionLimit DATA
- _Py_CheckRecursiveCall=python36._Py_CheckRecursiveCall
- _Py_Dealloc=python36._Py_Dealloc
- _Py_EllipsisObject=python36._Py_EllipsisObject DATA
- _Py_FalseStruct=python36._Py_FalseStruct DATA
- _Py_NoneStruct=python36._Py_NoneStruct DATA
- _Py_NotImplementedStruct=python36._Py_NotImplementedStruct DATA
- _Py_SwappedOp=python36._Py_SwappedOp DATA
- _Py_TrueStruct=python36._Py_TrueStruct DATA
- _Py_VaBuildValue_SizeT=python36._Py_VaBuildValue_SizeT
+ PyArg_Parse=python37.PyArg_Parse
+ PyArg_ParseTuple=python37.PyArg_ParseTuple
+ PyArg_ParseTupleAndKeywords=python37.PyArg_ParseTupleAndKeywords
+ PyArg_UnpackTuple=python37.PyArg_UnpackTuple
+ PyArg_VaParse=python37.PyArg_VaParse
+ PyArg_VaParseTupleAndKeywords=python37.PyArg_VaParseTupleAndKeywords
+ PyArg_ValidateKeywordArguments=python37.PyArg_ValidateKeywordArguments
+ PyBaseObject_Type=python37.PyBaseObject_Type DATA
+ PyBool_FromLong=python37.PyBool_FromLong
+ PyBool_Type=python37.PyBool_Type DATA
+ PyByteArrayIter_Type=python37.PyByteArrayIter_Type DATA
+ PyByteArray_AsString=python37.PyByteArray_AsString
+ PyByteArray_Concat=python37.PyByteArray_Concat
+ PyByteArray_FromObject=python37.PyByteArray_FromObject
+ PyByteArray_FromStringAndSize=python37.PyByteArray_FromStringAndSize
+ PyByteArray_Resize=python37.PyByteArray_Resize
+ PyByteArray_Size=python37.PyByteArray_Size
+ PyByteArray_Type=python37.PyByteArray_Type DATA
+ PyBytesIter_Type=python37.PyBytesIter_Type DATA
+ PyBytes_AsString=python37.PyBytes_AsString
+ PyBytes_AsStringAndSize=python37.PyBytes_AsStringAndSize
+ PyBytes_Concat=python37.PyBytes_Concat
+ PyBytes_ConcatAndDel=python37.PyBytes_ConcatAndDel
+ PyBytes_DecodeEscape=python37.PyBytes_DecodeEscape
+ PyBytes_FromFormat=python37.PyBytes_FromFormat
+ PyBytes_FromFormatV=python37.PyBytes_FromFormatV
+ PyBytes_FromObject=python37.PyBytes_FromObject
+ PyBytes_FromString=python37.PyBytes_FromString
+ PyBytes_FromStringAndSize=python37.PyBytes_FromStringAndSize
+ PyBytes_Repr=python37.PyBytes_Repr
+ PyBytes_Size=python37.PyBytes_Size
+ PyBytes_Type=python37.PyBytes_Type DATA
+ PyCFunction_Call=python37.PyCFunction_Call
+ PyCFunction_ClearFreeList=python37.PyCFunction_ClearFreeList
+ PyCFunction_GetFlags=python37.PyCFunction_GetFlags
+ PyCFunction_GetFunction=python37.PyCFunction_GetFunction
+ PyCFunction_GetSelf=python37.PyCFunction_GetSelf
+ PyCFunction_New=python37.PyCFunction_New
+ PyCFunction_NewEx=python37.PyCFunction_NewEx
+ PyCFunction_Type=python37.PyCFunction_Type DATA
+ PyCallIter_New=python37.PyCallIter_New
+ PyCallIter_Type=python37.PyCallIter_Type DATA
+ PyCallable_Check=python37.PyCallable_Check
+ PyCapsule_GetContext=python37.PyCapsule_GetContext
+ PyCapsule_GetDestructor=python37.PyCapsule_GetDestructor
+ PyCapsule_GetName=python37.PyCapsule_GetName
+ PyCapsule_GetPointer=python37.PyCapsule_GetPointer
+ PyCapsule_Import=python37.PyCapsule_Import
+ PyCapsule_IsValid=python37.PyCapsule_IsValid
+ PyCapsule_New=python37.PyCapsule_New
+ PyCapsule_SetContext=python37.PyCapsule_SetContext
+ PyCapsule_SetDestructor=python37.PyCapsule_SetDestructor
+ PyCapsule_SetName=python37.PyCapsule_SetName
+ PyCapsule_SetPointer=python37.PyCapsule_SetPointer
+ PyCapsule_Type=python37.PyCapsule_Type DATA
+ PyClassMethodDescr_Type=python37.PyClassMethodDescr_Type DATA
+ PyCodec_BackslashReplaceErrors=python37.PyCodec_BackslashReplaceErrors
+ PyCodec_Decode=python37.PyCodec_Decode
+ PyCodec_Decoder=python37.PyCodec_Decoder
+ PyCodec_Encode=python37.PyCodec_Encode
+ PyCodec_Encoder=python37.PyCodec_Encoder
+ PyCodec_IgnoreErrors=python37.PyCodec_IgnoreErrors
+ PyCodec_IncrementalDecoder=python37.PyCodec_IncrementalDecoder
+ PyCodec_IncrementalEncoder=python37.PyCodec_IncrementalEncoder
+ PyCodec_KnownEncoding=python37.PyCodec_KnownEncoding
+ PyCodec_LookupError=python37.PyCodec_LookupError
+ PyCodec_NameReplaceErrors=python37.PyCodec_NameReplaceErrors
+ PyCodec_Register=python37.PyCodec_Register
+ PyCodec_RegisterError=python37.PyCodec_RegisterError
+ PyCodec_ReplaceErrors=python37.PyCodec_ReplaceErrors
+ PyCodec_StreamReader=python37.PyCodec_StreamReader
+ PyCodec_StreamWriter=python37.PyCodec_StreamWriter
+ PyCodec_StrictErrors=python37.PyCodec_StrictErrors
+ PyCodec_XMLCharRefReplaceErrors=python37.PyCodec_XMLCharRefReplaceErrors
+ PyComplex_FromDoubles=python37.PyComplex_FromDoubles
+ PyComplex_ImagAsDouble=python37.PyComplex_ImagAsDouble
+ PyComplex_RealAsDouble=python37.PyComplex_RealAsDouble
+ PyComplex_Type=python37.PyComplex_Type DATA
+ PyDescr_NewClassMethod=python37.PyDescr_NewClassMethod
+ PyDescr_NewGetSet=python37.PyDescr_NewGetSet
+ PyDescr_NewMember=python37.PyDescr_NewMember
+ PyDescr_NewMethod=python37.PyDescr_NewMethod
+ PyDictItems_Type=python37.PyDictItems_Type DATA
+ PyDictIterItem_Type=python37.PyDictIterItem_Type DATA
+ PyDictIterKey_Type=python37.PyDictIterKey_Type DATA
+ PyDictIterValue_Type=python37.PyDictIterValue_Type DATA
+ PyDictKeys_Type=python37.PyDictKeys_Type DATA
+ PyDictProxy_New=python37.PyDictProxy_New
+ PyDictProxy_Type=python37.PyDictProxy_Type DATA
+ PyDictValues_Type=python37.PyDictValues_Type DATA
+ PyDict_Clear=python37.PyDict_Clear
+ PyDict_Contains=python37.PyDict_Contains
+ PyDict_Copy=python37.PyDict_Copy
+ PyDict_DelItem=python37.PyDict_DelItem
+ PyDict_DelItemString=python37.PyDict_DelItemString
+ PyDict_GetItem=python37.PyDict_GetItem
+ PyDict_GetItemString=python37.PyDict_GetItemString
+ PyDict_GetItemWithError=python37.PyDict_GetItemWithError
+ PyDict_Items=python37.PyDict_Items
+ PyDict_Keys=python37.PyDict_Keys
+ PyDict_Merge=python37.PyDict_Merge
+ PyDict_MergeFromSeq2=python37.PyDict_MergeFromSeq2
+ PyDict_New=python37.PyDict_New
+ PyDict_Next=python37.PyDict_Next
+ PyDict_SetItem=python37.PyDict_SetItem
+ PyDict_SetItemString=python37.PyDict_SetItemString
+ PyDict_Size=python37.PyDict_Size
+ PyDict_Type=python37.PyDict_Type DATA
+ PyDict_Update=python37.PyDict_Update
+ PyDict_Values=python37.PyDict_Values
+ PyEllipsis_Type=python37.PyEllipsis_Type DATA
+ PyEnum_Type=python37.PyEnum_Type DATA
+ PyErr_BadArgument=python37.PyErr_BadArgument
+ PyErr_BadInternalCall=python37.PyErr_BadInternalCall
+ PyErr_CheckSignals=python37.PyErr_CheckSignals
+ PyErr_Clear=python37.PyErr_Clear
+ PyErr_Display=python37.PyErr_Display
+ PyErr_ExceptionMatches=python37.PyErr_ExceptionMatches
+ PyErr_Fetch=python37.PyErr_Fetch
+ PyErr_Format=python37.PyErr_Format
+ PyErr_FormatV=python37.PyErr_FormatV
+ PyErr_GetExcInfo=python37.PyErr_GetExcInfo
+ PyErr_GivenExceptionMatches=python37.PyErr_GivenExceptionMatches
+ PyErr_NewException=python37.PyErr_NewException
+ PyErr_NewExceptionWithDoc=python37.PyErr_NewExceptionWithDoc
+ PyErr_NoMemory=python37.PyErr_NoMemory
+ PyErr_NormalizeException=python37.PyErr_NormalizeException
+ PyErr_Occurred=python37.PyErr_Occurred
+ PyErr_Print=python37.PyErr_Print
+ PyErr_PrintEx=python37.PyErr_PrintEx
+ PyErr_ProgramText=python37.PyErr_ProgramText
+ PyErr_ResourceWarning=python37.PyErr_ResourceWarning
+ PyErr_Restore=python37.PyErr_Restore
+ PyErr_SetExcFromWindowsErr=python37.PyErr_SetExcFromWindowsErr
+ PyErr_SetExcFromWindowsErrWithFilename=python37.PyErr_SetExcFromWindowsErrWithFilename
+ PyErr_SetExcFromWindowsErrWithFilenameObject=python37.PyErr_SetExcFromWindowsErrWithFilenameObject
+ PyErr_SetExcFromWindowsErrWithFilenameObjects=python37.PyErr_SetExcFromWindowsErrWithFilenameObjects
+ PyErr_SetExcInfo=python37.PyErr_SetExcInfo
+ PyErr_SetFromErrno=python37.PyErr_SetFromErrno
+ PyErr_SetFromErrnoWithFilename=python37.PyErr_SetFromErrnoWithFilename
+ PyErr_SetFromErrnoWithFilenameObject=python37.PyErr_SetFromErrnoWithFilenameObject
+ PyErr_SetFromErrnoWithFilenameObjects=python37.PyErr_SetFromErrnoWithFilenameObjects
+ PyErr_SetFromWindowsErr=python37.PyErr_SetFromWindowsErr
+ PyErr_SetFromWindowsErrWithFilename=python37.PyErr_SetFromWindowsErrWithFilename
+ PyErr_SetImportError=python37.PyErr_SetImportError
+ PyErr_SetImportErrorSubclass=python37.PyErr_SetImportErrorSubclass
+ PyErr_SetInterrupt=python37.PyErr_SetInterrupt
+ PyErr_SetNone=python37.PyErr_SetNone
+ PyErr_SetObject=python37.PyErr_SetObject
+ PyErr_SetString=python37.PyErr_SetString
+ PyErr_SyntaxLocation=python37.PyErr_SyntaxLocation
+ PyErr_SyntaxLocationEx=python37.PyErr_SyntaxLocationEx
+ PyErr_WarnEx=python37.PyErr_WarnEx
+ PyErr_WarnExplicit=python37.PyErr_WarnExplicit
+ PyErr_WarnFormat=python37.PyErr_WarnFormat
+ PyErr_WriteUnraisable=python37.PyErr_WriteUnraisable
+ PyEval_AcquireLock=python37.PyEval_AcquireLock
+ PyEval_AcquireThread=python37.PyEval_AcquireThread
+ PyEval_CallFunction=python37.PyEval_CallFunction
+ PyEval_CallMethod=python37.PyEval_CallMethod
+ PyEval_CallObjectWithKeywords=python37.PyEval_CallObjectWithKeywords
+ PyEval_EvalCode=python37.PyEval_EvalCode
+ PyEval_EvalCodeEx=python37.PyEval_EvalCodeEx
+ PyEval_EvalFrame=python37.PyEval_EvalFrame
+ PyEval_EvalFrameEx=python37.PyEval_EvalFrameEx
+ PyEval_GetBuiltins=python37.PyEval_GetBuiltins
+ PyEval_GetCallStats=python37.PyEval_GetCallStats
+ PyEval_GetFrame=python37.PyEval_GetFrame
+ PyEval_GetFuncDesc=python37.PyEval_GetFuncDesc
+ PyEval_GetFuncName=python37.PyEval_GetFuncName
+ PyEval_GetGlobals=python37.PyEval_GetGlobals
+ PyEval_GetLocals=python37.PyEval_GetLocals
+ PyEval_InitThreads=python37.PyEval_InitThreads
+ PyEval_ReInitThreads=python37.PyEval_ReInitThreads
+ PyEval_ReleaseLock=python37.PyEval_ReleaseLock
+ PyEval_ReleaseThread=python37.PyEval_ReleaseThread
+ PyEval_RestoreThread=python37.PyEval_RestoreThread
+ PyEval_SaveThread=python37.PyEval_SaveThread
+ PyEval_ThreadsInitialized=python37.PyEval_ThreadsInitialized
+ PyExc_ArithmeticError=python37.PyExc_ArithmeticError DATA
+ PyExc_AssertionError=python37.PyExc_AssertionError DATA
+ PyExc_AttributeError=python37.PyExc_AttributeError DATA
+ PyExc_BaseException=python37.PyExc_BaseException DATA
+ PyExc_BlockingIOError=python37.PyExc_BlockingIOError DATA
+ PyExc_BrokenPipeError=python37.PyExc_BrokenPipeError DATA
+ PyExc_BufferError=python37.PyExc_BufferError DATA
+ PyExc_BytesWarning=python37.PyExc_BytesWarning DATA
+ PyExc_ChildProcessError=python37.PyExc_ChildProcessError DATA
+ PyExc_ConnectionAbortedError=python37.PyExc_ConnectionAbortedError DATA
+ PyExc_ConnectionError=python37.PyExc_ConnectionError DATA
+ PyExc_ConnectionRefusedError=python37.PyExc_ConnectionRefusedError DATA
+ PyExc_ConnectionResetError=python37.PyExc_ConnectionResetError DATA
+ PyExc_DeprecationWarning=python37.PyExc_DeprecationWarning DATA
+ PyExc_EOFError=python37.PyExc_EOFError DATA
+ PyExc_EnvironmentError=python37.PyExc_EnvironmentError DATA
+ PyExc_Exception=python37.PyExc_Exception DATA
+ PyExc_FileExistsError=python37.PyExc_FileExistsError DATA
+ PyExc_FileNotFoundError=python37.PyExc_FileNotFoundError DATA
+ PyExc_FloatingPointError=python37.PyExc_FloatingPointError DATA
+ PyExc_FutureWarning=python37.PyExc_FutureWarning DATA
+ PyExc_GeneratorExit=python37.PyExc_GeneratorExit DATA
+ PyExc_IOError=python37.PyExc_IOError DATA
+ PyExc_ImportError=python37.PyExc_ImportError DATA
+ PyExc_ImportWarning=python37.PyExc_ImportWarning DATA
+ PyExc_IndentationError=python37.PyExc_IndentationError DATA
+ PyExc_IndexError=python37.PyExc_IndexError DATA
+ PyExc_InterruptedError=python37.PyExc_InterruptedError DATA
+ PyExc_IsADirectoryError=python37.PyExc_IsADirectoryError DATA
+ PyExc_KeyError=python37.PyExc_KeyError DATA
+ PyExc_KeyboardInterrupt=python37.PyExc_KeyboardInterrupt DATA
+ PyExc_LookupError=python37.PyExc_LookupError DATA
+ PyExc_MemoryError=python37.PyExc_MemoryError DATA
+ PyExc_ModuleNotFoundError=python37.PyExc_ModuleNotFoundError DATA
+ PyExc_NameError=python37.PyExc_NameError DATA
+ PyExc_NotADirectoryError=python37.PyExc_NotADirectoryError DATA
+ PyExc_NotImplementedError=python37.PyExc_NotImplementedError DATA
+ PyExc_OSError=python37.PyExc_OSError DATA
+ PyExc_OverflowError=python37.PyExc_OverflowError DATA
+ PyExc_PendingDeprecationWarning=python37.PyExc_PendingDeprecationWarning DATA
+ PyExc_PermissionError=python37.PyExc_PermissionError DATA
+ PyExc_ProcessLookupError=python37.PyExc_ProcessLookupError DATA
+ PyExc_RecursionError=python37.PyExc_RecursionError DATA
+ PyExc_RecursionErrorInst=python37.PyExc_RecursionErrorInst DATA
+ PyExc_ReferenceError=python37.PyExc_ReferenceError DATA
+ PyExc_ResourceWarning=python37.PyExc_ResourceWarning DATA
+ PyExc_RuntimeError=python37.PyExc_RuntimeError DATA
+ PyExc_RuntimeWarning=python37.PyExc_RuntimeWarning DATA
+ PyExc_StopAsyncIteration=python37.PyExc_StopAsyncIteration DATA
+ PyExc_StopIteration=python37.PyExc_StopIteration DATA
+ PyExc_SyntaxError=python37.PyExc_SyntaxError DATA
+ PyExc_SyntaxWarning=python37.PyExc_SyntaxWarning DATA
+ PyExc_SystemError=python37.PyExc_SystemError DATA
+ PyExc_SystemExit=python37.PyExc_SystemExit DATA
+ PyExc_TabError=python37.PyExc_TabError DATA
+ PyExc_TimeoutError=python37.PyExc_TimeoutError DATA
+ PyExc_TypeError=python37.PyExc_TypeError DATA
+ PyExc_UnboundLocalError=python37.PyExc_UnboundLocalError DATA
+ PyExc_UnicodeDecodeError=python37.PyExc_UnicodeDecodeError DATA
+ PyExc_UnicodeEncodeError=python37.PyExc_UnicodeEncodeError DATA
+ PyExc_UnicodeError=python37.PyExc_UnicodeError DATA
+ PyExc_UnicodeTranslateError=python37.PyExc_UnicodeTranslateError DATA
+ PyExc_UnicodeWarning=python37.PyExc_UnicodeWarning DATA
+ PyExc_UserWarning=python37.PyExc_UserWarning DATA
+ PyExc_ValueError=python37.PyExc_ValueError DATA
+ PyExc_Warning=python37.PyExc_Warning DATA
+ PyExc_WindowsError=python37.PyExc_WindowsError DATA
+ PyExc_ZeroDivisionError=python37.PyExc_ZeroDivisionError DATA
+ PyException_GetCause=python37.PyException_GetCause
+ PyException_GetContext=python37.PyException_GetContext
+ PyException_GetTraceback=python37.PyException_GetTraceback
+ PyException_SetCause=python37.PyException_SetCause
+ PyException_SetContext=python37.PyException_SetContext
+ PyException_SetTraceback=python37.PyException_SetTraceback
+ PyFile_FromFd=python37.PyFile_FromFd
+ PyFile_GetLine=python37.PyFile_GetLine
+ PyFile_WriteObject=python37.PyFile_WriteObject
+ PyFile_WriteString=python37.PyFile_WriteString
+ PyFilter_Type=python37.PyFilter_Type DATA
+ PyFloat_AsDouble=python37.PyFloat_AsDouble
+ PyFloat_FromDouble=python37.PyFloat_FromDouble
+ PyFloat_FromString=python37.PyFloat_FromString
+ PyFloat_GetInfo=python37.PyFloat_GetInfo
+ PyFloat_GetMax=python37.PyFloat_GetMax
+ PyFloat_GetMin=python37.PyFloat_GetMin
+ PyFloat_Type=python37.PyFloat_Type DATA
+ PyFrozenSet_New=python37.PyFrozenSet_New
+ PyFrozenSet_Type=python37.PyFrozenSet_Type DATA
+ PyGC_Collect=python37.PyGC_Collect
+ PyGILState_Ensure=python37.PyGILState_Ensure
+ PyGILState_GetThisThreadState=python37.PyGILState_GetThisThreadState
+ PyGILState_Release=python37.PyGILState_Release
+ PyGetSetDescr_Type=python37.PyGetSetDescr_Type DATA
+ PyImport_AddModule=python37.PyImport_AddModule
+ PyImport_AddModuleObject=python37.PyImport_AddModuleObject
+ PyImport_AppendInittab=python37.PyImport_AppendInittab
+ PyImport_Cleanup=python37.PyImport_Cleanup
+ PyImport_ExecCodeModule=python37.PyImport_ExecCodeModule
+ PyImport_ExecCodeModuleEx=python37.PyImport_ExecCodeModuleEx
+ PyImport_ExecCodeModuleObject=python37.PyImport_ExecCodeModuleObject
+ PyImport_ExecCodeModuleWithPathnames=python37.PyImport_ExecCodeModuleWithPathnames
+ PyImport_GetImporter=python37.PyImport_GetImporter
+ PyImport_GetMagicNumber=python37.PyImport_GetMagicNumber
+ PyImport_GetMagicTag=python37.PyImport_GetMagicTag
+ PyImport_GetModuleDict=python37.PyImport_GetModuleDict
+ PyImport_Import=python37.PyImport_Import
+ PyImport_ImportFrozenModule=python37.PyImport_ImportFrozenModule
+ PyImport_ImportFrozenModuleObject=python37.PyImport_ImportFrozenModuleObject
+ PyImport_ImportModule=python37.PyImport_ImportModule
+ PyImport_ImportModuleLevel=python37.PyImport_ImportModuleLevel
+ PyImport_ImportModuleLevelObject=python37.PyImport_ImportModuleLevelObject
+ PyImport_ImportModuleNoBlock=python37.PyImport_ImportModuleNoBlock
+ PyImport_ReloadModule=python37.PyImport_ReloadModule
+ PyInterpreterState_Clear=python37.PyInterpreterState_Clear
+ PyInterpreterState_Delete=python37.PyInterpreterState_Delete
+ PyInterpreterState_New=python37.PyInterpreterState_New
+ PyIter_Next=python37.PyIter_Next
+ PyListIter_Type=python37.PyListIter_Type DATA
+ PyListRevIter_Type=python37.PyListRevIter_Type DATA
+ PyList_Append=python37.PyList_Append
+ PyList_AsTuple=python37.PyList_AsTuple
+ PyList_GetItem=python37.PyList_GetItem
+ PyList_GetSlice=python37.PyList_GetSlice
+ PyList_Insert=python37.PyList_Insert
+ PyList_New=python37.PyList_New
+ PyList_Reverse=python37.PyList_Reverse
+ PyList_SetItem=python37.PyList_SetItem
+ PyList_SetSlice=python37.PyList_SetSlice
+ PyList_Size=python37.PyList_Size
+ PyList_Sort=python37.PyList_Sort
+ PyList_Type=python37.PyList_Type DATA
+ PyLongRangeIter_Type=python37.PyLongRangeIter_Type DATA
+ PyLong_AsDouble=python37.PyLong_AsDouble
+ PyLong_AsLong=python37.PyLong_AsLong
+ PyLong_AsLongAndOverflow=python37.PyLong_AsLongAndOverflow
+ PyLong_AsLongLong=python37.PyLong_AsLongLong
+ PyLong_AsLongLongAndOverflow=python37.PyLong_AsLongLongAndOverflow
+ PyLong_AsSize_t=python37.PyLong_AsSize_t
+ PyLong_AsSsize_t=python37.PyLong_AsSsize_t
+ PyLong_AsUnsignedLong=python37.PyLong_AsUnsignedLong
+ PyLong_AsUnsignedLongLong=python37.PyLong_AsUnsignedLongLong
+ PyLong_AsUnsignedLongLongMask=python37.PyLong_AsUnsignedLongLongMask
+ PyLong_AsUnsignedLongMask=python37.PyLong_AsUnsignedLongMask
+ PyLong_AsVoidPtr=python37.PyLong_AsVoidPtr
+ PyLong_FromDouble=python37.PyLong_FromDouble
+ PyLong_FromLong=python37.PyLong_FromLong
+ PyLong_FromLongLong=python37.PyLong_FromLongLong
+ PyLong_FromSize_t=python37.PyLong_FromSize_t
+ PyLong_FromSsize_t=python37.PyLong_FromSsize_t
+ PyLong_FromString=python37.PyLong_FromString
+ PyLong_FromUnsignedLong=python37.PyLong_FromUnsignedLong
+ PyLong_FromUnsignedLongLong=python37.PyLong_FromUnsignedLongLong
+ PyLong_FromVoidPtr=python37.PyLong_FromVoidPtr
+ PyLong_GetInfo=python37.PyLong_GetInfo
+ PyLong_Type=python37.PyLong_Type DATA
+ PyMap_Type=python37.PyMap_Type DATA
+ PyMapping_Check=python37.PyMapping_Check
+ PyMapping_GetItemString=python37.PyMapping_GetItemString
+ PyMapping_HasKey=python37.PyMapping_HasKey
+ PyMapping_HasKeyString=python37.PyMapping_HasKeyString
+ PyMapping_Items=python37.PyMapping_Items
+ PyMapping_Keys=python37.PyMapping_Keys
+ PyMapping_Length=python37.PyMapping_Length
+ PyMapping_SetItemString=python37.PyMapping_SetItemString
+ PyMapping_Size=python37.PyMapping_Size
+ PyMapping_Values=python37.PyMapping_Values
+ PyMem_Calloc=python37.PyMem_Calloc
+ PyMem_Free=python37.PyMem_Free
+ PyMem_Malloc=python37.PyMem_Malloc
+ PyMem_Realloc=python37.PyMem_Realloc
+ PyMemberDescr_Type=python37.PyMemberDescr_Type DATA
+ PyMemoryView_FromMemory=python37.PyMemoryView_FromMemory
+ PyMemoryView_FromObject=python37.PyMemoryView_FromObject
+ PyMemoryView_GetContiguous=python37.PyMemoryView_GetContiguous
+ PyMemoryView_Type=python37.PyMemoryView_Type DATA
+ PyMethodDescr_Type=python37.PyMethodDescr_Type DATA
+ PyModuleDef_Init=python37.PyModuleDef_Init
+ PyModuleDef_Type=python37.PyModuleDef_Type DATA
+ PyModule_AddFunctions=python37.PyModule_AddFunctions
+ PyModule_AddIntConstant=python37.PyModule_AddIntConstant
+ PyModule_AddObject=python37.PyModule_AddObject
+ PyModule_AddStringConstant=python37.PyModule_AddStringConstant
+ PyModule_Create2=python37.PyModule_Create2
+ PyModule_ExecDef=python37.PyModule_ExecDef
+ PyModule_FromDefAndSpec2=python37.PyModule_FromDefAndSpec2
+ PyModule_GetDef=python37.PyModule_GetDef
+ PyModule_GetDict=python37.PyModule_GetDict
+ PyModule_GetFilename=python37.PyModule_GetFilename
+ PyModule_GetFilenameObject=python37.PyModule_GetFilenameObject
+ PyModule_GetName=python37.PyModule_GetName
+ PyModule_GetNameObject=python37.PyModule_GetNameObject
+ PyModule_GetState=python37.PyModule_GetState
+ PyModule_New=python37.PyModule_New
+ PyModule_NewObject=python37.PyModule_NewObject
+ PyModule_SetDocString=python37.PyModule_SetDocString
+ PyModule_Type=python37.PyModule_Type DATA
+ PyNullImporter_Type=python37.PyNullImporter_Type DATA
+ PyNumber_Absolute=python37.PyNumber_Absolute
+ PyNumber_Add=python37.PyNumber_Add
+ PyNumber_And=python37.PyNumber_And
+ PyNumber_AsSsize_t=python37.PyNumber_AsSsize_t
+ PyNumber_Check=python37.PyNumber_Check
+ PyNumber_Divmod=python37.PyNumber_Divmod
+ PyNumber_Float=python37.PyNumber_Float
+ PyNumber_FloorDivide=python37.PyNumber_FloorDivide
+ PyNumber_InPlaceAdd=python37.PyNumber_InPlaceAdd
+ PyNumber_InPlaceAnd=python37.PyNumber_InPlaceAnd
+ PyNumber_InPlaceFloorDivide=python37.PyNumber_InPlaceFloorDivide
+ PyNumber_InPlaceLshift=python37.PyNumber_InPlaceLshift
+ PyNumber_InPlaceMatrixMultiply=python37.PyNumber_InPlaceMatrixMultiply
+ PyNumber_InPlaceMultiply=python37.PyNumber_InPlaceMultiply
+ PyNumber_InPlaceOr=python37.PyNumber_InPlaceOr
+ PyNumber_InPlacePower=python37.PyNumber_InPlacePower
+ PyNumber_InPlaceRemainder=python37.PyNumber_InPlaceRemainder
+ PyNumber_InPlaceRshift=python37.PyNumber_InPlaceRshift
+ PyNumber_InPlaceSubtract=python37.PyNumber_InPlaceSubtract
+ PyNumber_InPlaceTrueDivide=python37.PyNumber_InPlaceTrueDivide
+ PyNumber_InPlaceXor=python37.PyNumber_InPlaceXor
+ PyNumber_Index=python37.PyNumber_Index
+ PyNumber_Invert=python37.PyNumber_Invert
+ PyNumber_Long=python37.PyNumber_Long
+ PyNumber_Lshift=python37.PyNumber_Lshift
+ PyNumber_MatrixMultiply=python37.PyNumber_MatrixMultiply
+ PyNumber_Multiply=python37.PyNumber_Multiply
+ PyNumber_Negative=python37.PyNumber_Negative
+ PyNumber_Or=python37.PyNumber_Or
+ PyNumber_Positive=python37.PyNumber_Positive
+ PyNumber_Power=python37.PyNumber_Power
+ PyNumber_Remainder=python37.PyNumber_Remainder
+ PyNumber_Rshift=python37.PyNumber_Rshift
+ PyNumber_Subtract=python37.PyNumber_Subtract
+ PyNumber_ToBase=python37.PyNumber_ToBase
+ PyNumber_TrueDivide=python37.PyNumber_TrueDivide
+ PyNumber_Xor=python37.PyNumber_Xor
+ PyODictItems_Type=python37.PyODictItems_Type DATA
+ PyODictIter_Type=python37.PyODictIter_Type DATA
+ PyODictKeys_Type=python37.PyODictKeys_Type DATA
+ PyODictValues_Type=python37.PyODictValues_Type DATA
+ PyODict_DelItem=python37.PyODict_DelItem
+ PyODict_New=python37.PyODict_New
+ PyODict_SetItem=python37.PyODict_SetItem
+ PyODict_Type=python37.PyODict_Type DATA
+ PyOS_AfterFork=python37.PyOS_AfterFork
+ PyOS_CheckStack=python37.PyOS_CheckStack
+ PyOS_FSPath=python37.PyOS_FSPath
+ PyOS_InitInterrupts=python37.PyOS_InitInterrupts
+ PyOS_InputHook=python37.PyOS_InputHook DATA
+ PyOS_InterruptOccurred=python37.PyOS_InterruptOccurred
+ PyOS_ReadlineFunctionPointer=python37.PyOS_ReadlineFunctionPointer DATA
+ PyOS_double_to_string=python37.PyOS_double_to_string
+ PyOS_getsig=python37.PyOS_getsig
+ PyOS_mystricmp=python37.PyOS_mystricmp
+ PyOS_mystrnicmp=python37.PyOS_mystrnicmp
+ PyOS_setsig=python37.PyOS_setsig
+ PyOS_snprintf=python37.PyOS_snprintf
+ PyOS_string_to_double=python37.PyOS_string_to_double
+ PyOS_strtol=python37.PyOS_strtol
+ PyOS_strtoul=python37.PyOS_strtoul
+ PyOS_vsnprintf=python37.PyOS_vsnprintf
+ PyObject_ASCII=python37.PyObject_ASCII
+ PyObject_AsCharBuffer=python37.PyObject_AsCharBuffer
+ PyObject_AsFileDescriptor=python37.PyObject_AsFileDescriptor
+ PyObject_AsReadBuffer=python37.PyObject_AsReadBuffer
+ PyObject_AsWriteBuffer=python37.PyObject_AsWriteBuffer
+ PyObject_Bytes=python37.PyObject_Bytes
+ PyObject_Call=python37.PyObject_Call
+ PyObject_CallFunction=python37.PyObject_CallFunction
+ PyObject_CallFunctionObjArgs=python37.PyObject_CallFunctionObjArgs
+ PyObject_CallMethod=python37.PyObject_CallMethod
+ PyObject_CallMethodObjArgs=python37.PyObject_CallMethodObjArgs
+ PyObject_CallObject=python37.PyObject_CallObject
+ PyObject_Calloc=python37.PyObject_Calloc
+ PyObject_CheckReadBuffer=python37.PyObject_CheckReadBuffer
+ PyObject_ClearWeakRefs=python37.PyObject_ClearWeakRefs
+ PyObject_DelItem=python37.PyObject_DelItem
+ PyObject_DelItemString=python37.PyObject_DelItemString
+ PyObject_Dir=python37.PyObject_Dir
+ PyObject_Format=python37.PyObject_Format
+ PyObject_Free=python37.PyObject_Free
+ PyObject_GC_Del=python37.PyObject_GC_Del
+ PyObject_GC_Track=python37.PyObject_GC_Track
+ PyObject_GC_UnTrack=python37.PyObject_GC_UnTrack
+ PyObject_GenericGetAttr=python37.PyObject_GenericGetAttr
+ PyObject_GenericSetAttr=python37.PyObject_GenericSetAttr
+ PyObject_GenericSetDict=python37.PyObject_GenericSetDict
+ PyObject_GetAttr=python37.PyObject_GetAttr
+ PyObject_GetAttrString=python37.PyObject_GetAttrString
+ PyObject_GetItem=python37.PyObject_GetItem
+ PyObject_GetIter=python37.PyObject_GetIter
+ PyObject_HasAttr=python37.PyObject_HasAttr
+ PyObject_HasAttrString=python37.PyObject_HasAttrString
+ PyObject_Hash=python37.PyObject_Hash
+ PyObject_HashNotImplemented=python37.PyObject_HashNotImplemented
+ PyObject_Init=python37.PyObject_Init
+ PyObject_InitVar=python37.PyObject_InitVar
+ PyObject_IsInstance=python37.PyObject_IsInstance
+ PyObject_IsSubclass=python37.PyObject_IsSubclass
+ PyObject_IsTrue=python37.PyObject_IsTrue
+ PyObject_Length=python37.PyObject_Length
+ PyObject_Malloc=python37.PyObject_Malloc
+ PyObject_Not=python37.PyObject_Not
+ PyObject_Realloc=python37.PyObject_Realloc
+ PyObject_Repr=python37.PyObject_Repr
+ PyObject_RichCompare=python37.PyObject_RichCompare
+ PyObject_RichCompareBool=python37.PyObject_RichCompareBool
+ PyObject_SelfIter=python37.PyObject_SelfIter
+ PyObject_SetAttr=python37.PyObject_SetAttr
+ PyObject_SetAttrString=python37.PyObject_SetAttrString
+ PyObject_SetItem=python37.PyObject_SetItem
+ PyObject_Size=python37.PyObject_Size
+ PyObject_Str=python37.PyObject_Str
+ PyObject_Type=python37.PyObject_Type
+ PyParser_SimpleParseFileFlags=python37.PyParser_SimpleParseFileFlags
+ PyParser_SimpleParseStringFlags=python37.PyParser_SimpleParseStringFlags
+ PyParser_SimpleParseStringFlagsFilename=python37.PyParser_SimpleParseStringFlagsFilename
+ PyProperty_Type=python37.PyProperty_Type DATA
+ PyRangeIter_Type=python37.PyRangeIter_Type DATA
+ PyRange_Type=python37.PyRange_Type DATA
+ PyReversed_Type=python37.PyReversed_Type DATA
+ PySeqIter_New=python37.PySeqIter_New
+ PySeqIter_Type=python37.PySeqIter_Type DATA
+ PySequence_Check=python37.PySequence_Check
+ PySequence_Concat=python37.PySequence_Concat
+ PySequence_Contains=python37.PySequence_Contains
+ PySequence_Count=python37.PySequence_Count
+ PySequence_DelItem=python37.PySequence_DelItem
+ PySequence_DelSlice=python37.PySequence_DelSlice
+ PySequence_Fast=python37.PySequence_Fast
+ PySequence_GetItem=python37.PySequence_GetItem
+ PySequence_GetSlice=python37.PySequence_GetSlice
+ PySequence_In=python37.PySequence_In
+ PySequence_InPlaceConcat=python37.PySequence_InPlaceConcat
+ PySequence_InPlaceRepeat=python37.PySequence_InPlaceRepeat
+ PySequence_Index=python37.PySequence_Index
+ PySequence_Length=python37.PySequence_Length
+ PySequence_List=python37.PySequence_List
+ PySequence_Repeat=python37.PySequence_Repeat
+ PySequence_SetItem=python37.PySequence_SetItem
+ PySequence_SetSlice=python37.PySequence_SetSlice
+ PySequence_Size=python37.PySequence_Size
+ PySequence_Tuple=python37.PySequence_Tuple
+ PySetIter_Type=python37.PySetIter_Type DATA
+ PySet_Add=python37.PySet_Add
+ PySet_Clear=python37.PySet_Clear
+ PySet_Contains=python37.PySet_Contains
+ PySet_Discard=python37.PySet_Discard
+ PySet_New=python37.PySet_New
+ PySet_Pop=python37.PySet_Pop
+ PySet_Size=python37.PySet_Size
+ PySet_Type=python37.PySet_Type DATA
+ PySlice_AdjustIndices=python37.PySlice_AdjustIndices
+ PySlice_GetIndices=python37.PySlice_GetIndices
+ PySlice_GetIndicesEx=python37.PySlice_GetIndicesEx
+ PySlice_New=python37.PySlice_New
+ PySlice_Type=python37.PySlice_Type DATA
+ PySlice_Unpack=python37.PySlice_Unpack
+ PySortWrapper_Type=python37.PySortWrapper_Type DATA
+ PyState_AddModule=python37.PyState_AddModule
+ PyState_FindModule=python37.PyState_FindModule
+ PyState_RemoveModule=python37.PyState_RemoveModule
+ PyStructSequence_GetItem=python37.PyStructSequence_GetItem
+ PyStructSequence_New=python37.PyStructSequence_New
+ PyStructSequence_NewType=python37.PyStructSequence_NewType
+ PyStructSequence_SetItem=python37.PyStructSequence_SetItem
+ PySuper_Type=python37.PySuper_Type DATA
+ PySys_AddWarnOption=python37.PySys_AddWarnOption
+ PySys_AddWarnOptionUnicode=python37.PySys_AddWarnOptionUnicode
+ PySys_AddXOption=python37.PySys_AddXOption
+ PySys_FormatStderr=python37.PySys_FormatStderr
+ PySys_FormatStdout=python37.PySys_FormatStdout
+ PySys_GetObject=python37.PySys_GetObject
+ PySys_GetXOptions=python37.PySys_GetXOptions
+ PySys_HasWarnOptions=python37.PySys_HasWarnOptions
+ PySys_ResetWarnOptions=python37.PySys_ResetWarnOptions
+ PySys_SetArgv=python37.PySys_SetArgv
+ PySys_SetArgvEx=python37.PySys_SetArgvEx
+ PySys_SetObject=python37.PySys_SetObject
+ PySys_SetPath=python37.PySys_SetPath
+ PySys_WriteStderr=python37.PySys_WriteStderr
+ PySys_WriteStdout=python37.PySys_WriteStdout
+ PyThreadState_Clear=python37.PyThreadState_Clear
+ PyThreadState_Delete=python37.PyThreadState_Delete
+ PyThreadState_DeleteCurrent=python37.PyThreadState_DeleteCurrent
+ PyThreadState_Get=python37.PyThreadState_Get
+ PyThreadState_GetDict=python37.PyThreadState_GetDict
+ PyThreadState_New=python37.PyThreadState_New
+ PyThreadState_SetAsyncExc=python37.PyThreadState_SetAsyncExc
+ PyThreadState_Swap=python37.PyThreadState_Swap
+ PyTraceBack_Here=python37.PyTraceBack_Here
+ PyTraceBack_Print=python37.PyTraceBack_Print
+ PyTraceBack_Type=python37.PyTraceBack_Type DATA
+ PyTupleIter_Type=python37.PyTupleIter_Type DATA
+ PyTuple_ClearFreeList=python37.PyTuple_ClearFreeList
+ PyTuple_GetItem=python37.PyTuple_GetItem
+ PyTuple_GetSlice=python37.PyTuple_GetSlice
+ PyTuple_New=python37.PyTuple_New
+ PyTuple_Pack=python37.PyTuple_Pack
+ PyTuple_SetItem=python37.PyTuple_SetItem
+ PyTuple_Size=python37.PyTuple_Size
+ PyTuple_Type=python37.PyTuple_Type DATA
+ PyType_ClearCache=python37.PyType_ClearCache
+ PyType_FromSpec=python37.PyType_FromSpec
+ PyType_FromSpecWithBases=python37.PyType_FromSpecWithBases
+ PyType_GenericAlloc=python37.PyType_GenericAlloc
+ PyType_GenericNew=python37.PyType_GenericNew
+ PyType_GetFlags=python37.PyType_GetFlags
+ PyType_GetSlot=python37.PyType_GetSlot
+ PyType_IsSubtype=python37.PyType_IsSubtype
+ PyType_Modified=python37.PyType_Modified
+ PyType_Ready=python37.PyType_Ready
+ PyType_Type=python37.PyType_Type DATA
+ PyUnicodeDecodeError_Create=python37.PyUnicodeDecodeError_Create
+ PyUnicodeDecodeError_GetEncoding=python37.PyUnicodeDecodeError_GetEncoding
+ PyUnicodeDecodeError_GetEnd=python37.PyUnicodeDecodeError_GetEnd
+ PyUnicodeDecodeError_GetObject=python37.PyUnicodeDecodeError_GetObject
+ PyUnicodeDecodeError_GetReason=python37.PyUnicodeDecodeError_GetReason
+ PyUnicodeDecodeError_GetStart=python37.PyUnicodeDecodeError_GetStart
+ PyUnicodeDecodeError_SetEnd=python37.PyUnicodeDecodeError_SetEnd
+ PyUnicodeDecodeError_SetReason=python37.PyUnicodeDecodeError_SetReason
+ PyUnicodeDecodeError_SetStart=python37.PyUnicodeDecodeError_SetStart
+ PyUnicodeEncodeError_GetEncoding=python37.PyUnicodeEncodeError_GetEncoding
+ PyUnicodeEncodeError_GetEnd=python37.PyUnicodeEncodeError_GetEnd
+ PyUnicodeEncodeError_GetObject=python37.PyUnicodeEncodeError_GetObject
+ PyUnicodeEncodeError_GetReason=python37.PyUnicodeEncodeError_GetReason
+ PyUnicodeEncodeError_GetStart=python37.PyUnicodeEncodeError_GetStart
+ PyUnicodeEncodeError_SetEnd=python37.PyUnicodeEncodeError_SetEnd
+ PyUnicodeEncodeError_SetReason=python37.PyUnicodeEncodeError_SetReason
+ PyUnicodeEncodeError_SetStart=python37.PyUnicodeEncodeError_SetStart
+ PyUnicodeIter_Type=python37.PyUnicodeIter_Type DATA
+ PyUnicodeTranslateError_GetEnd=python37.PyUnicodeTranslateError_GetEnd
+ PyUnicodeTranslateError_GetObject=python37.PyUnicodeTranslateError_GetObject
+ PyUnicodeTranslateError_GetReason=python37.PyUnicodeTranslateError_GetReason
+ PyUnicodeTranslateError_GetStart=python37.PyUnicodeTranslateError_GetStart
+ PyUnicodeTranslateError_SetEnd=python37.PyUnicodeTranslateError_SetEnd
+ PyUnicodeTranslateError_SetReason=python37.PyUnicodeTranslateError_SetReason
+ PyUnicodeTranslateError_SetStart=python37.PyUnicodeTranslateError_SetStart
+ PyUnicode_Append=python37.PyUnicode_Append
+ PyUnicode_AppendAndDel=python37.PyUnicode_AppendAndDel
+ PyUnicode_AsASCIIString=python37.PyUnicode_AsASCIIString
+ PyUnicode_AsCharmapString=python37.PyUnicode_AsCharmapString
+ PyUnicode_AsDecodedObject=python37.PyUnicode_AsDecodedObject
+ PyUnicode_AsDecodedUnicode=python37.PyUnicode_AsDecodedUnicode
+ PyUnicode_AsEncodedObject=python37.PyUnicode_AsEncodedObject
+ PyUnicode_AsEncodedString=python37.PyUnicode_AsEncodedString
+ PyUnicode_AsEncodedUnicode=python37.PyUnicode_AsEncodedUnicode
+ PyUnicode_AsLatin1String=python37.PyUnicode_AsLatin1String
+ PyUnicode_AsMBCSString=python37.PyUnicode_AsMBCSString
+ PyUnicode_AsRawUnicodeEscapeString=python37.PyUnicode_AsRawUnicodeEscapeString
+ PyUnicode_AsUCS4=python37.PyUnicode_AsUCS4
+ PyUnicode_AsUCS4Copy=python37.PyUnicode_AsUCS4Copy
+ PyUnicode_AsUTF16String=python37.PyUnicode_AsUTF16String
+ PyUnicode_AsUTF32String=python37.PyUnicode_AsUTF32String
+ PyUnicode_AsUTF8String=python37.PyUnicode_AsUTF8String
+ PyUnicode_AsUnicodeEscapeString=python37.PyUnicode_AsUnicodeEscapeString
+ PyUnicode_AsWideChar=python37.PyUnicode_AsWideChar
+ PyUnicode_AsWideCharString=python37.PyUnicode_AsWideCharString
+ PyUnicode_BuildEncodingMap=python37.PyUnicode_BuildEncodingMap
+ PyUnicode_ClearFreeList=python37.PyUnicode_ClearFreeList
+ PyUnicode_Compare=python37.PyUnicode_Compare
+ PyUnicode_CompareWithASCIIString=python37.PyUnicode_CompareWithASCIIString
+ PyUnicode_Concat=python37.PyUnicode_Concat
+ PyUnicode_Contains=python37.PyUnicode_Contains
+ PyUnicode_Count=python37.PyUnicode_Count
+ PyUnicode_Decode=python37.PyUnicode_Decode
+ PyUnicode_DecodeASCII=python37.PyUnicode_DecodeASCII
+ PyUnicode_DecodeCharmap=python37.PyUnicode_DecodeCharmap
+ PyUnicode_DecodeCodePageStateful=python37.PyUnicode_DecodeCodePageStateful
+ PyUnicode_DecodeFSDefault=python37.PyUnicode_DecodeFSDefault
+ PyUnicode_DecodeFSDefaultAndSize=python37.PyUnicode_DecodeFSDefaultAndSize
+ PyUnicode_DecodeLatin1=python37.PyUnicode_DecodeLatin1
+ PyUnicode_DecodeLocale=python37.PyUnicode_DecodeLocale
+ PyUnicode_DecodeLocaleAndSize=python37.PyUnicode_DecodeLocaleAndSize
+ PyUnicode_DecodeMBCS=python37.PyUnicode_DecodeMBCS
+ PyUnicode_DecodeMBCSStateful=python37.PyUnicode_DecodeMBCSStateful
+ PyUnicode_DecodeRawUnicodeEscape=python37.PyUnicode_DecodeRawUnicodeEscape
+ PyUnicode_DecodeUTF16=python37.PyUnicode_DecodeUTF16
+ PyUnicode_DecodeUTF16Stateful=python37.PyUnicode_DecodeUTF16Stateful
+ PyUnicode_DecodeUTF32=python37.PyUnicode_DecodeUTF32
+ PyUnicode_DecodeUTF32Stateful=python37.PyUnicode_DecodeUTF32Stateful
+ PyUnicode_DecodeUTF7=python37.PyUnicode_DecodeUTF7
+ PyUnicode_DecodeUTF7Stateful=python37.PyUnicode_DecodeUTF7Stateful
+ PyUnicode_DecodeUTF8=python37.PyUnicode_DecodeUTF8
+ PyUnicode_DecodeUTF8Stateful=python37.PyUnicode_DecodeUTF8Stateful
+ PyUnicode_DecodeUnicodeEscape=python37.PyUnicode_DecodeUnicodeEscape
+ PyUnicode_EncodeCodePage=python37.PyUnicode_EncodeCodePage
+ PyUnicode_EncodeFSDefault=python37.PyUnicode_EncodeFSDefault
+ PyUnicode_EncodeLocale=python37.PyUnicode_EncodeLocale
+ PyUnicode_FSConverter=python37.PyUnicode_FSConverter
+ PyUnicode_FSDecoder=python37.PyUnicode_FSDecoder
+ PyUnicode_Find=python37.PyUnicode_Find
+ PyUnicode_FindChar=python37.PyUnicode_FindChar
+ PyUnicode_Format=python37.PyUnicode_Format
+ PyUnicode_FromEncodedObject=python37.PyUnicode_FromEncodedObject
+ PyUnicode_FromFormat=python37.PyUnicode_FromFormat
+ PyUnicode_FromFormatV=python37.PyUnicode_FromFormatV
+ PyUnicode_FromObject=python37.PyUnicode_FromObject
+ PyUnicode_FromOrdinal=python37.PyUnicode_FromOrdinal
+ PyUnicode_FromString=python37.PyUnicode_FromString
+ PyUnicode_FromStringAndSize=python37.PyUnicode_FromStringAndSize
+ PyUnicode_FromWideChar=python37.PyUnicode_FromWideChar
+ PyUnicode_GetDefaultEncoding=python37.PyUnicode_GetDefaultEncoding
+ PyUnicode_GetLength=python37.PyUnicode_GetLength
+ PyUnicode_GetSize=python37.PyUnicode_GetSize
+ PyUnicode_InternFromString=python37.PyUnicode_InternFromString
+ PyUnicode_InternImmortal=python37.PyUnicode_InternImmortal
+ PyUnicode_InternInPlace=python37.PyUnicode_InternInPlace
+ PyUnicode_IsIdentifier=python37.PyUnicode_IsIdentifier
+ PyUnicode_Join=python37.PyUnicode_Join
+ PyUnicode_Partition=python37.PyUnicode_Partition
+ PyUnicode_RPartition=python37.PyUnicode_RPartition
+ PyUnicode_RSplit=python37.PyUnicode_RSplit
+ PyUnicode_ReadChar=python37.PyUnicode_ReadChar
+ PyUnicode_Replace=python37.PyUnicode_Replace
+ PyUnicode_Resize=python37.PyUnicode_Resize
+ PyUnicode_RichCompare=python37.PyUnicode_RichCompare
+ PyUnicode_Split=python37.PyUnicode_Split
+ PyUnicode_Splitlines=python37.PyUnicode_Splitlines
+ PyUnicode_Substring=python37.PyUnicode_Substring
+ PyUnicode_Tailmatch=python37.PyUnicode_Tailmatch
+ PyUnicode_Translate=python37.PyUnicode_Translate
+ PyUnicode_Type=python37.PyUnicode_Type DATA
+ PyUnicode_WriteChar=python37.PyUnicode_WriteChar
+ PyWeakref_GetObject=python37.PyWeakref_GetObject
+ PyWeakref_NewProxy=python37.PyWeakref_NewProxy
+ PyWeakref_NewRef=python37.PyWeakref_NewRef
+ PyWrapperDescr_Type=python37.PyWrapperDescr_Type DATA
+ PyWrapper_New=python37.PyWrapper_New
+ PyZip_Type=python37.PyZip_Type DATA
+ Py_AddPendingCall=python37.Py_AddPendingCall
+ Py_AtExit=python37.Py_AtExit
+ Py_BuildValue=python37.Py_BuildValue
+ Py_CompileString=python37.Py_CompileString
+ Py_DecRef=python37.Py_DecRef
+ Py_DecodeLocale=python37.Py_DecodeLocale
+ Py_EncodeLocale=python37.Py_EncodeLocale
+ Py_EndInterpreter=python37.Py_EndInterpreter
+ Py_Exit=python37.Py_Exit
+ Py_FatalError=python37.Py_FatalError
+ Py_FileSystemDefaultEncodeErrors=python37.Py_FileSystemDefaultEncodeErrors DATA
+ Py_FileSystemDefaultEncoding=python37.Py_FileSystemDefaultEncoding DATA
+ Py_Finalize=python37.Py_Finalize
+ Py_FinalizeEx=python37.Py_FinalizeEx
+ Py_GetBuildInfo=python37.Py_GetBuildInfo
+ Py_GetCompiler=python37.Py_GetCompiler
+ Py_GetCopyright=python37.Py_GetCopyright
+ Py_GetExecPrefix=python37.Py_GetExecPrefix
+ Py_GetPath=python37.Py_GetPath
+ Py_GetPlatform=python37.Py_GetPlatform
+ Py_GetPrefix=python37.Py_GetPrefix
+ Py_GetProgramFullPath=python37.Py_GetProgramFullPath
+ Py_GetProgramName=python37.Py_GetProgramName
+ Py_GetPythonHome=python37.Py_GetPythonHome
+ Py_GetRecursionLimit=python37.Py_GetRecursionLimit
+ Py_GetVersion=python37.Py_GetVersion
+ Py_HasFileSystemDefaultEncoding=python37.Py_HasFileSystemDefaultEncoding DATA
+ Py_IncRef=python37.Py_IncRef
+ Py_Initialize=python37.Py_Initialize
+ Py_InitializeEx=python37.Py_InitializeEx
+ Py_IsInitialized=python37.Py_IsInitialized
+ Py_Main=python37.Py_Main
+ Py_MakePendingCalls=python37.Py_MakePendingCalls
+ Py_NewInterpreter=python37.Py_NewInterpreter
+ Py_ReprEnter=python37.Py_ReprEnter
+ Py_ReprLeave=python37.Py_ReprLeave
+ Py_SetPath=python37.Py_SetPath
+ Py_SetProgramName=python37.Py_SetProgramName
+ Py_SetPythonHome=python37.Py_SetPythonHome
+ Py_SetRecursionLimit=python37.Py_SetRecursionLimit
+ Py_SymtableString=python37.Py_SymtableString
+ Py_VaBuildValue=python37.Py_VaBuildValue
+ _PyArg_ParseTupleAndKeywords_SizeT=python37._PyArg_ParseTupleAndKeywords_SizeT
+ _PyArg_ParseTuple_SizeT=python37._PyArg_ParseTuple_SizeT
+ _PyArg_Parse_SizeT=python37._PyArg_Parse_SizeT
+ _PyArg_VaParseTupleAndKeywords_SizeT=python37._PyArg_VaParseTupleAndKeywords_SizeT
+ _PyArg_VaParse_SizeT=python37._PyArg_VaParse_SizeT
+ _PyErr_BadInternalCall=python37._PyErr_BadInternalCall
+ _PyObject_CallFunction_SizeT=python37._PyObject_CallFunction_SizeT
+ _PyObject_CallMethod_SizeT=python37._PyObject_CallMethod_SizeT
+ _PyObject_GC_Malloc=python37._PyObject_GC_Malloc
+ _PyObject_GC_New=python37._PyObject_GC_New
+ _PyObject_GC_NewVar=python37._PyObject_GC_NewVar
+ _PyObject_GC_Resize=python37._PyObject_GC_Resize
+ _PyObject_New=python37._PyObject_New
+ _PyObject_NewVar=python37._PyObject_NewVar
+ _PyState_AddModule=python37._PyState_AddModule
+ _PyThreadState_Init=python37._PyThreadState_Init
+ _PyThreadState_Prealloc=python37._PyThreadState_Prealloc
+ _PyTrash_delete_later=python37._PyTrash_delete_later DATA
+ _PyTrash_delete_nesting=python37._PyTrash_delete_nesting DATA
+ _PyTrash_deposit_object=python37._PyTrash_deposit_object
+ _PyTrash_destroy_chain=python37._PyTrash_destroy_chain
+ _PyTrash_thread_deposit_object=python37._PyTrash_thread_deposit_object
+ _PyTrash_thread_destroy_chain=python37._PyTrash_thread_destroy_chain
+ _PyWeakref_CallableProxyType=python37._PyWeakref_CallableProxyType DATA
+ _PyWeakref_ProxyType=python37._PyWeakref_ProxyType DATA
+ _PyWeakref_RefType=python37._PyWeakref_RefType DATA
+ _Py_BuildValue_SizeT=python37._Py_BuildValue_SizeT
+ _Py_CheckRecursionLimit=python37._Py_CheckRecursionLimit DATA
+ _Py_CheckRecursiveCall=python37._Py_CheckRecursiveCall
+ _Py_Dealloc=python37._Py_Dealloc
+ _Py_EllipsisObject=python37._Py_EllipsisObject DATA
+ _Py_FalseStruct=python37._Py_FalseStruct DATA
+ _Py_NoneStruct=python37._Py_NoneStruct DATA
+ _Py_NotImplementedStruct=python37._Py_NotImplementedStruct DATA
+ _Py_SwappedOp=python37._Py_SwappedOp DATA
+ _Py_TrueStruct=python37._Py_TrueStruct DATA
+ _Py_VaBuildValue_SizeT=python37._Py_VaBuildValue_SizeT
diff --git a/PCbuild/prepare_ssl.bat b/PCbuild/prepare_ssl.bat
index 2f41ae847d..33f878e616 100644
--- a/PCbuild/prepare_ssl.bat
+++ b/PCbuild/prepare_ssl.bat
@@ -3,10 +3,10 @@ if not defined HOST_PYTHON (
if "%1" EQU "Debug" (
shift
set HOST_PYTHON=python_d.exe
- if not exist python36_d.dll exit 1
+ if not exist python37_d.dll exit 1
) ELSE (
set HOST_PYTHON=python.exe
- if not exist python36.dll exit 1
+ if not exist python37.dll exit 1
)
)
%HOST_PYTHON% "%~dp0prepare_ssl.py" %1
diff --git a/PCbuild/readme.txt b/PCbuild/readme.txt
index c04ba4e46b..00b50be017 100644
--- a/PCbuild/readme.txt
+++ b/PCbuild/readme.txt
@@ -48,7 +48,7 @@ Debug
Used to build Python with extra debugging capabilities, equivalent
to using ./configure --with-pydebug on UNIX. All binaries built
using this configuration have "_d" added to their name:
- python36_d.dll, python_d.exe, parser_d.pyd, and so on. Both the
+ python37_d.dll, python_d.exe, parser_d.pyd, and so on. Both the
build and rt (run test) batch files in this directory accept a -d
option for debug builds. If you are building Python to help with
development of CPython, you will most likely use this configuration.
diff --git a/PCbuild/rt.bat b/PCbuild/rt.bat
index 35826727f3..b418a8b7c2 100644
--- a/PCbuild/rt.bat
+++ b/PCbuild/rt.bat
@@ -42,7 +42,7 @@ if "%1"=="-x64" (set prefix=%pcbuild%amd64\) & shift & goto CheckOpts
if NOT "%1"=="" (set regrtestargs=%regrtestargs% %1) & shift & goto CheckOpts
set exe=%prefix%python%suffix%.exe
-set cmd="%exe%" %dashO% -Wd -E -bb -m test %regrtestargs%
+set cmd="%exe%" %dashO% -u -Wd -E -bb -m test %regrtestargs%
if defined qmode goto Qmode
echo Deleting .pyc/.pyo files ...
diff --git a/Parser/asdl_c.py b/Parser/asdl_c.py
index 725d73bad4..444cdea341 100644
--- a/Parser/asdl_c.py
+++ b/Parser/asdl_c.py
@@ -622,6 +622,9 @@ class PyTypesVisitor(PickleVisitor):
def visitModule(self, mod):
self.emit("""
+_Py_IDENTIFIER(_fields);
+_Py_IDENTIFIER(_attributes);
+
typedef struct {
PyObject_HEAD
PyObject *dict;
@@ -650,7 +653,6 @@ ast_clear(AST_object *self)
static int
ast_type_init(PyObject *self, PyObject *args, PyObject *kw)
{
- _Py_IDENTIFIER(_fields);
Py_ssize_t i, numfields = 0;
int res = -1;
PyObject *key, *value, *fields;
@@ -775,6 +777,8 @@ static PyTypeObject AST_type = {
static PyTypeObject* make_type(char *type, PyTypeObject* base, char**fields, int num_fields)
{
+ _Py_IDENTIFIER(__module__);
+ _Py_IDENTIFIER(_ast);
PyObject *fnames, *result;
int i;
fnames = PyTuple_New(num_fields);
@@ -787,8 +791,11 @@ static PyTypeObject* make_type(char *type, PyTypeObject* base, char**fields, int
}
PyTuple_SET_ITEM(fnames, i, field);
}
- result = PyObject_CallFunction((PyObject*)&PyType_Type, "s(O){sOss}",
- type, base, "_fields", fnames, "__module__", "_ast");
+ result = PyObject_CallFunction((PyObject*)&PyType_Type, "s(O){OOOO}",
+ type, base,
+ _PyUnicode_FromId(&PyId__fields), fnames,
+ _PyUnicode_FromId(&PyId___module__),
+ _PyUnicode_FromId(&PyId__ast));
Py_DECREF(fnames);
return (PyTypeObject*)result;
}
@@ -796,7 +803,6 @@ static PyTypeObject* make_type(char *type, PyTypeObject* base, char**fields, int
static int add_attributes(PyTypeObject* type, char**attrs, int num_fields)
{
int i, result;
- _Py_IDENTIFIER(_attributes);
PyObject *s, *l = PyTuple_New(num_fields);
if (!l)
return 0;
@@ -942,8 +948,8 @@ static int add_ast_fields(void)
d = AST_type.tp_dict;
empty_tuple = PyTuple_New(0);
if (!empty_tuple ||
- PyDict_SetItemString(d, "_fields", empty_tuple) < 0 ||
- PyDict_SetItemString(d, "_attributes", empty_tuple) < 0) {
+ _PyDict_SetItemId(d, &PyId__fields, empty_tuple) < 0 ||
+ _PyDict_SetItemId(d, &PyId__attributes, empty_tuple) < 0) {
Py_XDECREF(empty_tuple);
return -1;
}
@@ -1091,8 +1097,7 @@ class ObjVisitor(PickleVisitor):
self.emit("%s o = (%s)_o;" % (ctype, ctype), 1)
self.emit("PyObject *result = NULL, *value = NULL;", 1)
self.emit('if (!o) {', 1)
- self.emit("Py_INCREF(Py_None);", 2)
- self.emit('return Py_None;', 2)
+ self.emit("Py_RETURN_NONE;", 2)
self.emit("}", 1)
self.emit('', 0)
diff --git a/Parser/tokenizer.c b/Parser/tokenizer.c
index ff65f2a735..5cc9533c3c 100644
--- a/Parser/tokenizer.c
+++ b/Parser/tokenizer.c
@@ -440,7 +440,7 @@ fp_readl(char *s, int size, struct tok_state *tok)
}
else
{
- bufobj = PyObject_CallObject(tok->decoding_readline, NULL);
+ bufobj = _PyObject_CallNoArg(tok->decoding_readline);
if (bufobj == NULL)
goto error;
}
@@ -533,7 +533,7 @@ fp_setreadl(struct tok_state *tok, const char* enc)
Py_XSETREF(tok->decoding_readline, readline);
if (pos > 0) {
- PyObject *bufobj = PyObject_CallObject(readline, NULL);
+ PyObject *bufobj = _PyObject_CallNoArg(readline);
if (bufobj == NULL)
return 0;
Py_DECREF(bufobj);
@@ -650,7 +650,7 @@ decoding_feof(struct tok_state *tok)
} else {
PyObject* buf = tok->decoding_buffer;
if (buf == NULL) {
- buf = PyObject_CallObject(tok->decoding_readline, NULL);
+ buf = _PyObject_CallNoArg(tok->decoding_readline);
if (buf == NULL) {
error_ret(tok);
return 1;
diff --git a/Programs/_testembed.c b/Programs/_testembed.c
index 39683993ea..a68d4fa25f 100644
--- a/Programs/_testembed.c
+++ b/Programs/_testembed.c
@@ -33,7 +33,7 @@ static void print_subinterp(void)
);
}
-static void test_repeated_init_and_subinterpreters(void)
+static int test_repeated_init_and_subinterpreters(void)
{
PyThreadState *mainstate, *substate;
#ifdef WITH_THREAD
@@ -70,6 +70,7 @@ static void test_repeated_init_and_subinterpreters(void)
PyEval_RestoreThread(mainstate);
Py_Finalize();
}
+ return 0;
}
/*****************************************************
@@ -103,7 +104,7 @@ static void check_stdio_details(const char *encoding, const char * errors)
Py_Finalize();
}
-static void test_forced_io_encoding(void)
+static int test_forced_io_encoding(void)
{
/* Check various combinations */
printf("--- Use defaults ---\n");
@@ -122,19 +123,51 @@ static void test_forced_io_encoding(void)
printf("Unexpected success calling Py_SetStandardStreamEncoding");
}
Py_Finalize();
+ return 0;
}
-/* Different embedding tests */
-int main(int argc, char *argv[])
+/* *********************************************************
+ * List of test cases and the function that implements it.
+ *
+ * Names are compared case-sensitively with the first
+ * argument. If no match is found, or no first argument was
+ * provided, the names of all test cases are printed and
+ * the exit code will be -1.
+ *
+ * The int returned from test functions is used as the exit
+ * code, and test_capi treats all non-zero exit codes as a
+ * failed test.
+ *********************************************************/
+struct TestCase
{
+ const char *name;
+ int (*func)(void);
+};
+
+static struct TestCase TestCases[] = {
+ { "forced_io_encoding", test_forced_io_encoding },
+ { "repeated_init_and_subinterpreters", test_repeated_init_and_subinterpreters },
+ { NULL, NULL }
+};
- /* TODO: Check the argument string to allow for more test cases */
+int main(int argc, char *argv[])
+{
if (argc > 1) {
- /* For now: assume "forced_io_encoding */
- test_forced_io_encoding();
- } else {
- /* Run the original embedding test case by default */
- test_repeated_init_and_subinterpreters();
+ for (struct TestCase *tc = TestCases; tc && tc->name; tc++) {
+ if (strcmp(argv[1], tc->name) == 0)
+ return (*tc->func)();
+ }
}
- return 0;
+
+ /* No match found, or no test name provided, so display usage */
+ printf("Python " PY_VERSION " _testembed executable for embedded interpreter tests\n"
+ "Normally executed via 'EmbeddingTests' in Lib/test/test_capi.py\n\n"
+ "Usage: %s TESTNAME\n\nAll available tests:\n", argv[0]);
+ for (struct TestCase *tc = TestCases; tc && tc->name; tc++) {
+ printf(" %s\n", tc->name);
+ }
+
+ /* Non-zero exit code will cause test_capi.py tests to fail.
+ This is intentional. */
+ return -1;
}
diff --git a/Python/Python-ast.c b/Python/Python-ast.c
index e0607ba9ae..dcf24f0df3 100644
--- a/Python/Python-ast.c
+++ b/Python/Python-ast.c
@@ -504,6 +504,9 @@ static char *withitem_fields[]={
};
+_Py_IDENTIFIER(_fields);
+_Py_IDENTIFIER(_attributes);
+
typedef struct {
PyObject_HEAD
PyObject *dict;
@@ -532,7 +535,6 @@ ast_clear(AST_object *self)
static int
ast_type_init(PyObject *self, PyObject *args, PyObject *kw)
{
- _Py_IDENTIFIER(_fields);
Py_ssize_t i, numfields = 0;
int res = -1;
PyObject *key, *value, *fields;
@@ -657,6 +659,8 @@ static PyTypeObject AST_type = {
static PyTypeObject* make_type(char *type, PyTypeObject* base, char**fields, int num_fields)
{
+ _Py_IDENTIFIER(__module__);
+ _Py_IDENTIFIER(_ast);
PyObject *fnames, *result;
int i;
fnames = PyTuple_New(num_fields);
@@ -669,8 +673,11 @@ static PyTypeObject* make_type(char *type, PyTypeObject* base, char**fields, int
}
PyTuple_SET_ITEM(fnames, i, field);
}
- result = PyObject_CallFunction((PyObject*)&PyType_Type, "s(O){sOss}",
- type, base, "_fields", fnames, "__module__", "_ast");
+ result = PyObject_CallFunction((PyObject*)&PyType_Type, "s(O){OOOO}",
+ type, base,
+ _PyUnicode_FromId(&PyId__fields), fnames,
+ _PyUnicode_FromId(&PyId___module__),
+ _PyUnicode_FromId(&PyId__ast));
Py_DECREF(fnames);
return (PyTypeObject*)result;
}
@@ -678,7 +685,6 @@ static PyTypeObject* make_type(char *type, PyTypeObject* base, char**fields, int
static int add_attributes(PyTypeObject* type, char**attrs, int num_fields)
{
int i, result;
- _Py_IDENTIFIER(_attributes);
PyObject *s, *l = PyTuple_New(num_fields);
if (!l)
return 0;
@@ -824,8 +830,8 @@ static int add_ast_fields(void)
d = AST_type.tp_dict;
empty_tuple = PyTuple_New(0);
if (!empty_tuple ||
- PyDict_SetItemString(d, "_fields", empty_tuple) < 0 ||
- PyDict_SetItemString(d, "_attributes", empty_tuple) < 0) {
+ _PyDict_SetItemId(d, &PyId__fields, empty_tuple) < 0 ||
+ _PyDict_SetItemId(d, &PyId__attributes, empty_tuple) < 0) {
Py_XDECREF(empty_tuple);
return -1;
}
@@ -2583,8 +2589,7 @@ ast2obj_mod(void* _o)
mod_ty o = (mod_ty)_o;
PyObject *result = NULL, *value = NULL;
if (!o) {
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
switch (o->kind) {
@@ -2638,8 +2643,7 @@ ast2obj_stmt(void* _o)
stmt_ty o = (stmt_ty)_o;
PyObject *result = NULL, *value = NULL;
if (!o) {
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
switch (o->kind) {
@@ -3063,8 +3067,7 @@ ast2obj_expr(void* _o)
expr_ty o = (expr_ty)_o;
PyObject *result = NULL, *value = NULL;
if (!o) {
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
switch (o->kind) {
@@ -3526,8 +3529,7 @@ ast2obj_slice(void* _o)
slice_ty o = (slice_ty)_o;
PyObject *result = NULL, *value = NULL;
if (!o) {
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
switch (o->kind) {
@@ -3705,8 +3707,7 @@ ast2obj_comprehension(void* _o)
comprehension_ty o = (comprehension_ty)_o;
PyObject *result = NULL, *value = NULL;
if (!o) {
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
result = PyType_GenericNew(comprehension_type, NULL, NULL);
@@ -3744,8 +3745,7 @@ ast2obj_excepthandler(void* _o)
excepthandler_ty o = (excepthandler_ty)_o;
PyObject *result = NULL, *value = NULL;
if (!o) {
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
switch (o->kind) {
@@ -3792,8 +3792,7 @@ ast2obj_arguments(void* _o)
arguments_ty o = (arguments_ty)_o;
PyObject *result = NULL, *value = NULL;
if (!o) {
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
result = PyType_GenericNew(arguments_type, NULL, NULL);
@@ -3841,8 +3840,7 @@ ast2obj_arg(void* _o)
arg_ty o = (arg_ty)_o;
PyObject *result = NULL, *value = NULL;
if (!o) {
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
result = PyType_GenericNew(arg_type, NULL, NULL);
@@ -3880,8 +3878,7 @@ ast2obj_keyword(void* _o)
keyword_ty o = (keyword_ty)_o;
PyObject *result = NULL, *value = NULL;
if (!o) {
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
result = PyType_GenericNew(keyword_type, NULL, NULL);
@@ -3909,8 +3906,7 @@ ast2obj_alias(void* _o)
alias_ty o = (alias_ty)_o;
PyObject *result = NULL, *value = NULL;
if (!o) {
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
result = PyType_GenericNew(alias_type, NULL, NULL);
@@ -3938,8 +3934,7 @@ ast2obj_withitem(void* _o)
withitem_ty o = (withitem_ty)_o;
PyObject *result = NULL, *value = NULL;
if (!o) {
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
result = PyType_GenericNew(withitem_type, NULL, NULL);
diff --git a/Python/_warnings.c b/Python/_warnings.c
index 6cfae77f12..67f4c6bbe0 100644
--- a/Python/_warnings.c
+++ b/Python/_warnings.c
@@ -1,5 +1,6 @@
#include "Python.h"
#include "frameobject.h"
+#include "clinic/_warnings.c.h"
#define MODULE_NAME "_warnings"
@@ -26,7 +27,7 @@ check_matched(PyObject *obj, PyObject *arg)
if (obj == Py_None)
return 1;
- result = _PyObject_CallMethodId(obj, &PyId_match, "O", arg);
+ result = _PyObject_CallMethodIdObjArgs(obj, &PyId_match, arg, NULL);
if (result == NULL)
return -1;
@@ -476,7 +477,7 @@ warn_explicit(PyObject *category, PyObject *message,
}
else {
text = message;
- message = PyObject_CallFunction(category, "O", message);
+ message = PyObject_CallFunctionObjArgs(category, message, NULL);
if (message == NULL)
goto cleanup;
}
@@ -485,6 +486,10 @@ warn_explicit(PyObject *category, PyObject *message,
if (lineno_obj == NULL)
goto cleanup;
+ if (source == Py_None) {
+ source = NULL;
+ }
+
/* Create key. */
key = PyTuple_Pack(3, text, category, lineno_obj);
if (key == NULL)
@@ -805,22 +810,26 @@ do_warn(PyObject *message, PyObject *category, Py_ssize_t stack_level,
return res;
}
-static PyObject *
-warnings_warn(PyObject *self, PyObject *args, PyObject *kwds)
-{
- static char *kw_list[] = {"message", "category", "stacklevel",
- "source", NULL};
- PyObject *message, *category = NULL, *source = NULL;
- Py_ssize_t stack_level = 1;
+/*[clinic input]
+warn as warnings_warn
- if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|OnO:warn", kw_list,
- &message, &category, &stack_level, &source))
- return NULL;
+ message: object
+ category: object = None
+ stacklevel: Py_ssize_t = 1
+ source: object = None
+Issue a warning, or maybe ignore it or raise an exception.
+[clinic start generated code]*/
+
+static PyObject *
+warnings_warn_impl(PyObject *module, PyObject *message, PyObject *category,
+ Py_ssize_t stacklevel, PyObject *source)
+/*[clinic end generated code: output=31ed5ab7d8d760b2 input=bfdf5cf99f6c4edd]*/
+{
category = get_category(message, category);
if (category == NULL)
return NULL;
- return do_warn(message, category, stack_level, source);
+ return do_warn(message, category, stacklevel, source);
}
static PyObject *
@@ -1098,15 +1107,11 @@ exit:
}
-PyDoc_STRVAR(warn_doc,
-"Issue a warning, or maybe ignore it or raise an exception.");
-
PyDoc_STRVAR(warn_explicit_doc,
"Low-level inferface to warnings functionality.");
static PyMethodDef warnings_functions[] = {
- {"warn", (PyCFunction)warnings_warn, METH_VARARGS | METH_KEYWORDS,
- warn_doc},
+ WARNINGS_WARN_METHODDEF
{"warn_explicit", (PyCFunction)warnings_warn_explicit,
METH_VARARGS | METH_KEYWORDS, warn_explicit_doc},
{"_filters_mutated", (PyCFunction)warnings_filters_mutated, METH_NOARGS,
diff --git a/Python/ast.c b/Python/ast.c
index 217ea14bf3..5c5738f6ed 100644
--- a/Python/ast.c
+++ b/Python/ast.c
@@ -1411,11 +1411,6 @@ ast_for_arguments(struct compiling *c, const node *n)
if (!kwdefaults && nkwonlyargs)
return NULL;
- if (nposargs + nkwonlyargs > 255) {
- ast_error(c, n, "more than 255 arguments");
- return NULL;
- }
-
/* tfpdef: NAME [':' test]
vfpdef: NAME
*/
@@ -2738,11 +2733,6 @@ ast_for_call(struct compiling *c, const node *n, expr_ty func)
return NULL;
}
- if (nargs + nkeywords + ngens > 255) {
- ast_error(c, n, "more than 255 arguments");
- return NULL;
- }
-
args = _Py_asdl_seq_new(nargs + ngens, c->c_arena);
if (!args)
return NULL;
diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c
index ef5a34cae9..763c2a2bb8 100644
--- a/Python/bltinmodule.c
+++ b/Python/bltinmodule.c
@@ -52,51 +52,45 @@ _Py_IDENTIFIER(stderr);
/* AC: cannot convert yet, waiting for *args support */
static PyObject *
-builtin___build_class__(PyObject *self, PyObject *args, PyObject *kwds)
+builtin___build_class__(PyObject *self, PyObject **args, Py_ssize_t nargs,
+ PyObject *kwnames)
{
PyObject *func, *name, *bases, *mkw, *meta, *winner, *prep, *ns;
PyObject *cls = NULL, *cell = NULL;
- Py_ssize_t nargs;
int isclass = 0; /* initialize to prevent gcc warning */
- assert(args != NULL);
- if (!PyTuple_Check(args)) {
- PyErr_SetString(PyExc_TypeError,
- "__build_class__: args is not a tuple");
- return NULL;
- }
- nargs = PyTuple_GET_SIZE(args);
if (nargs < 2) {
PyErr_SetString(PyExc_TypeError,
"__build_class__: not enough arguments");
return NULL;
}
- func = PyTuple_GET_ITEM(args, 0); /* Better be callable */
+ func = args[0]; /* Better be callable */
if (!PyFunction_Check(func)) {
PyErr_SetString(PyExc_TypeError,
"__build_class__: func must be a function");
return NULL;
}
- name = PyTuple_GET_ITEM(args, 1);
+ name = args[1];
if (!PyUnicode_Check(name)) {
PyErr_SetString(PyExc_TypeError,
"__build_class__: name is not a string");
return NULL;
}
- bases = PyTuple_GetSlice(args, 2, nargs);
+ bases = _PyStack_AsTupleSlice(args, nargs, 2, nargs);
if (bases == NULL)
return NULL;
- if (kwds == NULL) {
+ if (kwnames == NULL) {
meta = NULL;
mkw = NULL;
}
else {
- mkw = PyDict_Copy(kwds); /* Don't modify kwds passed in! */
+ mkw = _PyStack_AsDict(args + nargs, kwnames);
if (mkw == NULL) {
Py_DECREF(bases);
return NULL;
}
+
meta = _PyDict_GetItemId(mkw, &PyId_metaclass);
if (meta != NULL) {
Py_INCREF(meta);
@@ -999,14 +993,19 @@ builtin_exec_impl(PyObject *module, PyObject *source, PyObject *globals,
/* AC: cannot convert yet, as needs PEP 457 group support in inspect */
static PyObject *
-builtin_getattr(PyObject *self, PyObject *args)
+builtin_getattr(PyObject *self, PyObject **args, Py_ssize_t nargs,
+ PyObject *kwnames)
{
PyObject *v, *result, *dflt = NULL;
PyObject *name;
- if (!PyArg_UnpackTuple(args, "getattr", 2, 3, &v, &name, &dflt))
+ if (!_PyArg_UnpackStack(args, nargs, "getattr", 2, 3, &v, &name, &dflt))
return NULL;
+ if (!_PyArg_NoStackKeywords("getattr", kwnames)) {
+ return NULL;
+ }
+
if (!PyUnicode_Check(name)) {
PyErr_SetString(PyExc_TypeError,
"getattr(): attribute name must be string");
@@ -1186,7 +1185,7 @@ map_traverse(mapobject *lz, visitproc visit, void *arg)
static PyObject *
map_next(mapobject *lz)
{
- PyObject *small_stack[5];
+ PyObject *small_stack[_PY_FASTCALL_SMALL_STACK];
PyObject **stack;
Py_ssize_t niters, nargs, i;
PyObject *result = NULL;
@@ -1304,13 +1303,19 @@ PyTypeObject PyMap_Type = {
/* AC: cannot convert yet, as needs PEP 457 group support in inspect */
static PyObject *
-builtin_next(PyObject *self, PyObject *args)
+builtin_next(PyObject *self, PyObject **args, Py_ssize_t nargs,
+ PyObject *kwnames)
{
PyObject *it, *res;
PyObject *def = NULL;
- if (!PyArg_UnpackTuple(args, "next", 1, 2, &it, &def))
+ if (!_PyArg_UnpackStack(args, nargs, "next", 1, 2, &it, &def))
+ return NULL;
+
+ if (!_PyArg_NoStackKeywords("next", kwnames)) {
return NULL;
+ }
+
if (!PyIter_Check(it)) {
PyErr_Format(PyExc_TypeError,
"'%.200s' object is not an iterator",
@@ -1364,8 +1369,7 @@ builtin_setattr_impl(PyObject *module, PyObject *obj, PyObject *name,
{
if (PyObject_SetAttr(obj, name, value) != 0)
return NULL;
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
@@ -1387,8 +1391,7 @@ builtin_delattr_impl(PyObject *module, PyObject *obj, PyObject *name)
{
if (PyObject_SetAttr(obj, name, (PyObject *)NULL) != 0)
return NULL;
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
@@ -1742,18 +1745,19 @@ builtin_pow_impl(PyObject *module, PyObject *x, PyObject *y, PyObject *z)
/* AC: cannot convert yet, waiting for *args support */
static PyObject *
-builtin_print(PyObject *self, PyObject *args, PyObject *kwds)
+builtin_print(PyObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
- static char *kwlist[] = {"sep", "end", "file", "flush", 0};
- static PyObject *dummy_args;
+ static const char * const _keywords[] = {"sep", "end", "file", "flush", 0};
+ static struct _PyArg_Parser _parser = {"|OOOO:print", _keywords, 0};
PyObject *sep = NULL, *end = NULL, *file = NULL, *flush = NULL;
int i, err;
- if (dummy_args == NULL && !(dummy_args = PyTuple_New(0)))
- return NULL;
- if (!PyArg_ParseTupleAndKeywords(dummy_args, kwds, "|OOOO:print",
- kwlist, &sep, &end, &file, &flush))
+ if (kwnames != NULL &&
+ !_PyArg_ParseStackAndKeywords(args + nargs, 0, kwnames, &_parser,
+ &sep, &end, &file, &flush)) {
return NULL;
+ }
+
if (file == NULL || file == Py_None) {
file = _PySys_GetObjectId(&PyId_stdout);
if (file == NULL) {
@@ -1785,7 +1789,7 @@ builtin_print(PyObject *self, PyObject *args, PyObject *kwds)
return NULL;
}
- for (i = 0; i < PyTuple_Size(args); i++) {
+ for (i = 0; i < nargs; i++) {
if (i > 0) {
if (sep == NULL)
err = PyFile_WriteString(" ", file);
@@ -1795,8 +1799,7 @@ builtin_print(PyObject *self, PyObject *args, PyObject *kwds)
if (err)
return NULL;
}
- err = PyFile_WriteObject(PyTuple_GetItem(args, i), file,
- Py_PRINT_RAW);
+ err = PyFile_WriteObject(args[i], file, Py_PRINT_RAW);
if (err)
return NULL;
}
@@ -1923,7 +1926,7 @@ builtin_input_impl(PyObject *module, PyObject *prompt)
char *s = NULL;
PyObject *stdin_encoding = NULL, *stdin_errors = NULL;
PyObject *stdout_encoding = NULL, *stdout_errors = NULL;
- char *stdin_encoding_str, *stdin_errors_str;
+ const char *stdin_encoding_str, *stdin_errors_str;
PyObject *result;
size_t len;
@@ -1944,7 +1947,7 @@ builtin_input_impl(PyObject *module, PyObject *prompt)
Py_DECREF(tmp);
if (prompt != NULL) {
/* We have a prompt, encode it as stdout would */
- char *stdout_encoding_str, *stdout_errors_str;
+ const char *stdout_encoding_str, *stdout_errors_str;
PyObject *stringpo;
stdout_encoding = _PyObject_GetAttrId(fout, &PyId_encoding);
stdout_errors = _PyObject_GetAttrId(fout, &PyId_errors);
@@ -2074,7 +2077,7 @@ builtin_round(PyObject *self, PyObject *args, PyObject *kwds)
}
if (ndigits == NULL || ndigits == Py_None)
- result = PyObject_CallFunctionObjArgs(round, NULL);
+ result = _PyObject_CallNoArg(round);
else
result = PyObject_CallFunctionObjArgs(round, ndigits, NULL);
Py_DECREF(round);
@@ -2116,20 +2119,16 @@ PyDoc_STRVAR(builtin_sorted__doc__,
"reverse flag can be set to request the result in descending order.");
#define BUILTIN_SORTED_METHODDEF \
- {"sorted", (PyCFunction)builtin_sorted, METH_VARARGS|METH_KEYWORDS, builtin_sorted__doc__},
+ {"sorted", (PyCFunction)builtin_sorted, METH_FASTCALL, builtin_sorted__doc__},
static PyObject *
-builtin_sorted(PyObject *self, PyObject *args, PyObject *kwds)
+builtin_sorted(PyObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
- PyObject *newlist, *v, *seq, *keyfunc=NULL, **newargs;
- PyObject *callable;
- static char *kwlist[] = {"", "key", "reverse", 0};
- int reverse;
- Py_ssize_t nargs;
+ PyObject *newlist, *v, *seq, *callable;
- /* args 1-3 should match listsort in Objects/listobject.c */
- if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|Oi:sorted",
- kwlist, &seq, &keyfunc, &reverse))
+ /* Keyword arguments are passed through list.sort() which will check
+ them. */
+ if (!_PyArg_UnpackStack(args, nargs, "sorted", 1, 1, &seq))
return NULL;
newlist = PySequence_List(seq);
@@ -2142,10 +2141,8 @@ builtin_sorted(PyObject *self, PyObject *args, PyObject *kwds)
return NULL;
}
- assert(PyTuple_GET_SIZE(args) >= 1);
- newargs = &PyTuple_GET_ITEM(args, 1);
- nargs = PyTuple_GET_SIZE(args) - 1;
- v = _PyObject_FastCallDict(callable, newargs, nargs, kwds);
+ assert(nargs >= 1);
+ v = _PyObject_FastCallKeywords(callable, args + 1, nargs - 1, kwnames);
Py_DECREF(callable);
if (v == NULL) {
Py_DECREF(newlist);
@@ -2613,7 +2610,7 @@ PyTypeObject PyZip_Type = {
static PyMethodDef builtin_methods[] = {
{"__build_class__", (PyCFunction)builtin___build_class__,
- METH_VARARGS | METH_KEYWORDS, build_class_doc},
+ METH_FASTCALL, build_class_doc},
{"__import__", (PyCFunction)builtin___import__, METH_VARARGS | METH_KEYWORDS, import_doc},
BUILTIN_ABS_METHODDEF
BUILTIN_ALL_METHODDEF
@@ -2629,7 +2626,7 @@ static PyMethodDef builtin_methods[] = {
BUILTIN_EVAL_METHODDEF
BUILTIN_EXEC_METHODDEF
BUILTIN_FORMAT_METHODDEF
- {"getattr", builtin_getattr, METH_VARARGS, getattr_doc},
+ {"getattr", (PyCFunction)builtin_getattr, METH_FASTCALL, getattr_doc},
BUILTIN_GLOBALS_METHODDEF
BUILTIN_HASATTR_METHODDEF
BUILTIN_HASH_METHODDEF
@@ -2643,11 +2640,11 @@ static PyMethodDef builtin_methods[] = {
BUILTIN_LOCALS_METHODDEF
{"max", (PyCFunction)builtin_max, METH_VARARGS | METH_KEYWORDS, max_doc},
{"min", (PyCFunction)builtin_min, METH_VARARGS | METH_KEYWORDS, min_doc},
- {"next", (PyCFunction)builtin_next, METH_VARARGS, next_doc},
+ {"next", (PyCFunction)builtin_next, METH_FASTCALL, next_doc},
BUILTIN_OCT_METHODDEF
BUILTIN_ORD_METHODDEF
BUILTIN_POW_METHODDEF
- {"print", (PyCFunction)builtin_print, METH_VARARGS | METH_KEYWORDS, print_doc},
+ {"print", (PyCFunction)builtin_print, METH_FASTCALL, print_doc},
BUILTIN_REPR_METHODDEF
{"round", (PyCFunction)builtin_round, METH_VARARGS | METH_KEYWORDS, round_doc},
BUILTIN_SETATTR_METHODDEF
diff --git a/Python/ceval.c b/Python/ceval.c
index d5172b9631..58007793bb 100644
--- a/Python/ceval.c
+++ b/Python/ceval.c
@@ -30,10 +30,13 @@
#define CHECKEXC 1 /* Double-check exception checking */
#endif
+/* Private API for the LOAD_METHOD opcode. */
+extern int _PyObject_GetMethod(PyObject *, PyObject *, PyObject **);
+
typedef PyObject *(*callproc)(PyObject *, PyObject *, PyObject *);
/* Forward declarations */
-static PyObject * call_function(PyObject ***, Py_ssize_t, PyObject *);
+Py_LOCAL_INLINE(PyObject *) call_function(PyObject ***, Py_ssize_t, PyObject *);
static PyObject * fast_function(PyObject *, PyObject **, Py_ssize_t, PyObject *);
static PyObject * do_call_core(PyObject *, PyObject *, PyObject *);
@@ -83,63 +86,6 @@ static long dxp[256];
#endif
#endif
-/* Function call profile */
-#ifdef CALL_PROFILE
-#define PCALL_NUM 11
-static int pcall[PCALL_NUM];
-
-#define PCALL_ALL 0
-#define PCALL_FUNCTION 1
-#define PCALL_FAST_FUNCTION 2
-#define PCALL_FASTER_FUNCTION 3
-#define PCALL_METHOD 4
-#define PCALL_BOUND_METHOD 5
-#define PCALL_CFUNCTION 6
-#define PCALL_TYPE 7
-#define PCALL_GENERATOR 8
-#define PCALL_OTHER 9
-#define PCALL_POP 10
-
-/* Notes about the statistics
-
- PCALL_FAST stats
-
- FAST_FUNCTION means no argument tuple needs to be created.
- FASTER_FUNCTION means that the fast-path frame setup code is used.
-
- If there is a method call where the call can be optimized by changing
- the argument tuple and calling the function directly, it gets recorded
- twice.
-
- As a result, the relationship among the statistics appears to be
- PCALL_ALL == PCALL_FUNCTION + PCALL_METHOD - PCALL_BOUND_METHOD +
- PCALL_CFUNCTION + PCALL_TYPE + PCALL_GENERATOR + PCALL_OTHER
- PCALL_FUNCTION > PCALL_FAST_FUNCTION > PCALL_FASTER_FUNCTION
- PCALL_METHOD > PCALL_BOUND_METHOD
-*/
-
-#define PCALL(POS) pcall[POS]++
-
-PyObject *
-PyEval_GetCallStats(PyObject *self)
-{
- return Py_BuildValue("iiiiiiiiiii",
- pcall[0], pcall[1], pcall[2], pcall[3],
- pcall[4], pcall[5], pcall[6], pcall[7],
- pcall[8], pcall[9], pcall[10]);
-}
-#else
-#define PCALL(O)
-
-PyObject *
-PyEval_GetCallStats(PyObject *self)
-{
- Py_INCREF(Py_None);
- return Py_None;
-}
-#endif
-
-
#ifdef WITH_THREAD
#define GIL_REQUEST _Py_atomic_load_relaxed(&gil_drop_request)
#else
@@ -718,7 +664,7 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
return tstate->interp->eval_frame(f, throwflag);
}
-PyObject *
+PyObject* _Py_HOT_FUNCTION
_PyEval_EvalFrameDefault(PyFrameObject *f, int throwflag)
{
#ifdef DXPAIRS
@@ -1100,7 +1046,7 @@ _PyEval_EvalFrameDefault(PyFrameObject *f, int throwflag)
#ifdef Py_DEBUG
/* PyEval_EvalFrameEx() must not be called with an exception set,
- because it may clear it (directly or indirectly) and so the
+ because it can clear it (directly or indirectly) and so the
caller loses its exception */
assert(!PyErr_Occurred());
#endif
@@ -1424,6 +1370,12 @@ _PyEval_EvalFrameDefault(PyFrameObject *f, int throwflag)
PyObject *right = POP();
PyObject *left = TOP();
PyObject *sum;
+ /* NOTE(haypo): Please don't try to micro-optimize int+int on
+ CPython using bytecode, it is simply worthless.
+ See http://bugs.python.org/issue21955 and
+ http://bugs.python.org/issue10044 for the discussion. In short,
+ no patch shown any impact on a realistic benchmark, only a minor
+ speedup on microbenchmarks. */
if (PyUnicode_CheckExact(left) &&
PyUnicode_CheckExact(right)) {
sum = unicode_concatenate(left, right, f, next_instr);
@@ -1538,7 +1490,7 @@ _PyEval_EvalFrameDefault(PyFrameObject *f, int throwflag)
TARGET(SET_ADD) {
PyObject *v = POP();
- PyObject *set = stack_pointer[-oparg];
+ PyObject *set = PEEK(oparg);
int err;
err = PySet_Add(set, v);
Py_DECREF(v);
@@ -2400,8 +2352,10 @@ _PyEval_EvalFrameDefault(PyFrameObject *f, int throwflag)
TARGET(DELETE_DEREF) {
PyObject *cell = freevars[oparg];
- if (PyCell_GET(cell) != NULL) {
- PyCell_Set(cell, NULL);
+ PyObject *oldobj = PyCell_GET(cell);
+ if (oldobj != NULL) {
+ PyCell_SET(cell, NULL);
+ Py_DECREF(oldobj);
DISPATCH();
}
format_exc_unbound(co, oparg);
@@ -2798,7 +2752,7 @@ _PyEval_EvalFrameDefault(PyFrameObject *f, int throwflag)
PyObject *map;
int err;
STACKADJ(-2);
- map = stack_pointer[-oparg]; /* dict */
+ map = PEEK(oparg); /* dict */
assert(PyDict_CheckExact(map));
err = PyDict_SetItem(map, key, value); /* map[key] = value */
Py_DECREF(value);
@@ -3111,7 +3065,7 @@ _PyEval_EvalFrameDefault(PyFrameObject *f, int throwflag)
Py_DECREF(mgr);
if (enter == NULL)
goto error;
- res = PyObject_CallFunctionObjArgs(enter, NULL);
+ res = _PyObject_CallNoArg(enter);
Py_DECREF(enter);
if (res == NULL)
goto error;
@@ -3145,7 +3099,7 @@ _PyEval_EvalFrameDefault(PyFrameObject *f, int throwflag)
}
SET_TOP(exit);
Py_DECREF(mgr);
- res = PyObject_CallFunctionObjArgs(enter, NULL);
+ res = _PyObject_CallNoArg(enter);
Py_DECREF(enter);
if (res == NULL)
goto error;
@@ -3184,8 +3138,12 @@ _PyEval_EvalFrameDefault(PyFrameObject *f, int throwflag)
gotos should still be resumed.)
*/
+ PyObject* stack[3];
PyObject *exit_func;
- PyObject *exc = TOP(), *val = Py_None, *tb = Py_None, *res;
+ PyObject *exc, *val, *tb, *res;
+
+ val = tb = Py_None;
+ exc = TOP();
if (exc == Py_None) {
(void)POP();
exit_func = TOP();
@@ -3229,8 +3187,11 @@ _PyEval_EvalFrameDefault(PyFrameObject *f, int throwflag)
assert(block->b_type == EXCEPT_HANDLER);
block->b_level--;
}
- /* XXX Not the fastest way to call it... */
- res = PyObject_CallFunctionObjArgs(exit_func, exc, val, tb, NULL);
+
+ stack[0] = exc;
+ stack[1] = val;
+ stack[2] = tb;
+ res = _PyObject_FastCall(exit_func, stack, 3);
Py_DECREF(exit_func);
if (res == NULL)
goto error;
@@ -3267,10 +3228,95 @@ _PyEval_EvalFrameDefault(PyFrameObject *f, int throwflag)
DISPATCH();
}
+ TARGET(LOAD_METHOD) {
+ /* Designed to work in tamdem with CALL_METHOD. */
+ PyObject *name = GETITEM(names, oparg);
+ PyObject *obj = TOP();
+ PyObject *meth = NULL;
+
+ int meth_found = _PyObject_GetMethod(obj, name, &meth);
+
+ if (meth == NULL) {
+ /* Most likely attribute wasn't found. */
+ goto error;
+ }
+
+ if (meth_found) {
+ /* We can bypass temporary bound method object.
+ meth is unbound method and obj is self.
+
+ meth | self | arg1 | ... | argN
+ */
+ SET_TOP(meth);
+ PUSH(obj); // self
+ }
+ else {
+ /* meth is not an unbound method (but a regular attr, or
+ something was returned by a descriptor protocol). Set
+ the second element of the stack to NULL, to signal
+ CALL_METHOD that it's not a method call.
+
+ NULL | meth | arg1 | ... | argN
+ */
+ SET_TOP(NULL);
+ Py_DECREF(obj);
+ PUSH(meth);
+ }
+ DISPATCH();
+ }
+
+ TARGET(CALL_METHOD) {
+ /* Designed to work in tamdem with LOAD_METHOD. */
+ PyObject **sp, *res, *meth;
+
+ sp = stack_pointer;
+
+ meth = PEEK(oparg + 2);
+ if (meth == NULL) {
+ /* `meth` is NULL when LOAD_METHOD thinks that it's not
+ a method call.
+
+ Stack layout:
+
+ ... | NULL | callable | arg1 | ... | argN
+ ^- TOP()
+ ^- (-oparg)
+ ^- (-oparg-1)
+ ^- (-oparg-2)
+
+ `callable` will be POPed by call_funtion.
+ NULL will will be POPed manually later.
+ */
+ res = call_function(&sp, oparg, NULL);
+ stack_pointer = sp;
+ (void)POP(); /* POP the NULL. */
+ }
+ else {
+ /* This is a method call. Stack layout:
+
+ ... | method | self | arg1 | ... | argN
+ ^- TOP()
+ ^- (-oparg)
+ ^- (-oparg-1)
+ ^- (-oparg-2)
+
+ `self` and `method` will be POPed by call_function.
+ We'll be passing `oparg + 1` to call_function, to
+ make it accept the `self` as a first argument.
+ */
+ res = call_function(&sp, oparg + 1, NULL);
+ stack_pointer = sp;
+ }
+
+ PUSH(res);
+ if (res == NULL)
+ goto error;
+ DISPATCH();
+ }
+
PREDICTED(CALL_FUNCTION);
TARGET(CALL_FUNCTION) {
PyObject **sp, *res;
- PCALL(PCALL_ALL);
sp = stack_pointer;
res = call_function(&sp, oparg, NULL);
stack_pointer = sp;
@@ -3286,7 +3332,6 @@ _PyEval_EvalFrameDefault(PyFrameObject *f, int throwflag)
names = POP();
assert(PyTuple_CheckExact(names) && PyTuple_GET_SIZE(names) <= oparg);
- PCALL(PCALL_ALL);
sp = stack_pointer;
res = call_function(&sp, oparg, names);
stack_pointer = sp;
@@ -3301,7 +3346,6 @@ _PyEval_EvalFrameDefault(PyFrameObject *f, int throwflag)
TARGET(CALL_FUNCTION_EX) {
PyObject *func, *callargs, *kwargs = NULL, *result;
- PCALL(PCALL_ALL);
if (oparg & 0x01) {
kwargs = POP();
if (!PyDict_CheckExact(kwargs)) {
@@ -3879,7 +3923,7 @@ _PyEval_EvalCodeWithName(PyObject *_co, PyObject *globals, PyObject *locals,
/* Create the frame */
tstate = PyThreadState_GET();
assert(tstate != NULL);
- f = PyFrame_New(tstate, co, globals, locals);
+ f = _PyFrame_New_NoTrack(tstate, co, globals, locals);
if (f == NULL) {
return NULL;
}
@@ -3965,7 +4009,8 @@ _PyEval_EvalCodeWithName(PyObject *_co, PyObject *globals, PyObject *locals,
}
}
- if (j >= total_args && kwdict == NULL) {
+ assert(j >= total_args);
+ if (kwdict == NULL) {
PyErr_Format(PyExc_TypeError,
"%U() got an unexpected keyword argument '%S'",
co->co_name, keyword);
@@ -4048,7 +4093,7 @@ _PyEval_EvalCodeWithName(PyObject *_co, PyObject *globals, PyObject *locals,
vars into frame. */
for (i = 0; i < PyTuple_GET_SIZE(co->co_cellvars); ++i) {
PyObject *c;
- int arg;
+ Py_ssize_t arg;
/* Possibly account for the cell variable being an argument. */
if (co->co_cell2arg != NULL &&
(arg = co->co_cell2arg[i]) != CO_CELL_NOT_AN_ARG) {
@@ -4091,8 +4136,6 @@ _PyEval_EvalCodeWithName(PyObject *_co, PyObject *globals, PyObject *locals,
* when the generator is resumed. */
Py_CLEAR(f->f_back);
- PCALL(PCALL_GENERATOR);
-
/* Create a new generator that owns the ready to run frame
* and return that as the value. */
if (is_coro) {
@@ -4102,8 +4145,11 @@ _PyEval_EvalCodeWithName(PyObject *_co, PyObject *globals, PyObject *locals,
} else {
gen = PyGen_NewWithQualName(f, name, qualname);
}
- if (gen == NULL)
+ if (gen == NULL) {
return NULL;
+ }
+
+ _PyObject_GC_TRACK(f);
if (is_coro && coro_wrapper != NULL) {
PyObject *wrapped;
@@ -4126,9 +4172,15 @@ fail: /* Jump here from prelude on failure */
so recursion_depth must be boosted for the duration.
*/
assert(tstate != NULL);
- ++tstate->recursion_depth;
- Py_DECREF(f);
- --tstate->recursion_depth;
+ if (Py_REFCNT(f) > 1) {
+ Py_DECREF(f);
+ _PyObject_GC_TRACK(f);
+ }
+ else {
+ ++tstate->recursion_depth;
+ Py_DECREF(f);
+ --tstate->recursion_depth;
+ }
return retval;
}
@@ -4245,7 +4297,7 @@ do_raise(PyObject *exc, PyObject *cause)
if (PyExceptionClass_Check(exc)) {
type = exc;
- value = PyObject_CallObject(exc, NULL);
+ value = _PyObject_CallNoArg(exc);
if (value == NULL)
goto raise_error;
if (!PyExceptionInstance_Check(value)) {
@@ -4270,10 +4322,13 @@ do_raise(PyObject *exc, PyObject *cause)
goto raise_error;
}
+ assert(type != NULL);
+ assert(value != NULL);
+
if (cause) {
PyObject *fixed_cause;
if (PyExceptionClass_Check(cause)) {
- fixed_cause = PyObject_CallObject(cause, NULL);
+ fixed_cause = _PyObject_CallNoArg(cause);
if (fixed_cause == NULL)
goto raise_error;
Py_DECREF(cause);
@@ -4296,8 +4351,8 @@ do_raise(PyObject *exc, PyObject *cause)
PyErr_SetObject(type, value);
/* PyErr_SetObject incref's its arguments */
- Py_XDECREF(value);
- Py_XDECREF(type);
+ Py_DECREF(value);
+ Py_DECREF(type);
return 0;
raise_error:
@@ -4681,7 +4736,8 @@ PyEval_MergeCompilerFlags(PyCompilerFlags *cf)
The arg must be a tuple or NULL. The kw must be a dict or NULL. */
PyObject *
-PyEval_CallObjectWithKeywords(PyObject *func, PyObject *args, PyObject *kwargs)
+PyEval_CallObjectWithKeywords(PyObject *callable,
+ PyObject *args, PyObject *kwargs)
{
#ifdef Py_DEBUG
/* PyEval_CallObjectWithKeywords() must not be called with an exception
@@ -4691,7 +4747,7 @@ PyEval_CallObjectWithKeywords(PyObject *func, PyObject *args, PyObject *kwargs)
#endif
if (args == NULL) {
- return _PyObject_FastCallDict(func, NULL, 0, kwargs);
+ return _PyObject_FastCallDict(callable, NULL, 0, kwargs);
}
if (!PyTuple_Check(args)) {
@@ -4706,7 +4762,7 @@ PyEval_CallObjectWithKeywords(PyObject *func, PyObject *args, PyObject *kwargs)
return NULL;
}
- return PyObject_Call(func, args, kwargs);
+ return PyObject_Call(callable, args, kwargs);
}
const char *
@@ -4766,7 +4822,9 @@ if (tstate->use_tracing && tstate->c_profilefunc) { \
x = call; \
}
-static PyObject *
+/* Issue #29227: Inline call_function() into _PyEval_EvalFrameDefault()
+ to reduce the stack consumption. */
+Py_LOCAL_INLINE(PyObject *) _Py_HOT_FUNCTION
call_function(PyObject ***pp_stack, Py_ssize_t oparg, PyObject *kwnames)
{
PyObject **pfunc = (*pp_stack) - oparg - 1;
@@ -4774,44 +4832,44 @@ call_function(PyObject ***pp_stack, Py_ssize_t oparg, PyObject *kwnames)
PyObject *x, *w;
Py_ssize_t nkwargs = (kwnames == NULL) ? 0 : PyTuple_GET_SIZE(kwnames);
Py_ssize_t nargs = oparg - nkwargs;
- PyObject **stack;
+ PyObject **stack = (*pp_stack) - nargs - nkwargs;
/* Always dispatch PyCFunction first, because these are
presumed to be the most frequent callable object.
*/
if (PyCFunction_Check(func)) {
PyThreadState *tstate = PyThreadState_GET();
-
- PCALL(PCALL_CFUNCTION);
-
- stack = (*pp_stack) - nargs - nkwargs;
C_TRACE(x, _PyCFunction_FastCallKeywords(func, stack, nargs, kwnames));
}
+ else if (Py_TYPE(func) == &PyMethodDescr_Type) {
+ PyThreadState *tstate = PyThreadState_GET();
+ C_TRACE(x, _PyMethodDescr_FastCallKeywords(func, stack, nargs, kwnames));
+ }
else {
if (PyMethod_Check(func) && PyMethod_GET_SELF(func) != NULL) {
- /* optimize access to bound methods */
+ /* Optimize access to bound methods. Reuse the Python stack
+ to pass 'self' as the first argument, replace 'func'
+ with 'self'. It avoids the creation of a new temporary tuple
+ for arguments (to replace func with self) when the method uses
+ FASTCALL. */
PyObject *self = PyMethod_GET_SELF(func);
- PCALL(PCALL_METHOD);
- PCALL(PCALL_BOUND_METHOD);
Py_INCREF(self);
func = PyMethod_GET_FUNCTION(func);
Py_INCREF(func);
Py_SETREF(*pfunc, self);
nargs++;
+ stack--;
}
else {
Py_INCREF(func);
}
- stack = (*pp_stack) - nargs - nkwargs;
-
if (PyFunction_Check(func)) {
x = fast_function(func, stack, nargs, kwnames);
}
else {
x = _PyObject_FastCallKeywords(func, stack, nargs, kwnames);
}
-
Py_DECREF(func);
}
@@ -4824,7 +4882,6 @@ call_function(PyObject ***pp_stack, Py_ssize_t oparg, PyObject *kwnames)
while ((*pp_stack) > pfunc) {
w = EXT_POP(*pp_stack);
Py_DECREF(w);
- PCALL(PCALL_POP);
}
return x;
@@ -4839,7 +4896,7 @@ call_function(PyObject ***pp_stack, Py_ssize_t oparg, PyObject *kwnames)
done before evaluating the frame.
*/
-static PyObject*
+static PyObject* _Py_HOT_FUNCTION
_PyFunction_FastCall(PyCodeObject *co, PyObject **args, Py_ssize_t nargs,
PyObject *globals)
{
@@ -4849,14 +4906,13 @@ _PyFunction_FastCall(PyCodeObject *co, PyObject **args, Py_ssize_t nargs,
Py_ssize_t i;
PyObject *result;
- PCALL(PCALL_FASTER_FUNCTION);
assert(globals != NULL);
/* XXX Perhaps we should create a specialized
- PyFrame_New() that doesn't take locals, but does
+ _PyFrame_New_NoTrack() that doesn't take locals, but does
take builtins without sanity checking them.
*/
assert(tstate != NULL);
- f = PyFrame_New(tstate, co, globals, NULL);
+ f = _PyFrame_New_NoTrack(tstate, co, globals, NULL);
if (f == NULL) {
return NULL;
}
@@ -4869,10 +4925,15 @@ _PyFunction_FastCall(PyCodeObject *co, PyObject **args, Py_ssize_t nargs,
}
result = PyEval_EvalFrameEx(f,0);
- ++tstate->recursion_depth;
- Py_DECREF(f);
- --tstate->recursion_depth;
-
+ if (Py_REFCNT(f) > 1) {
+ Py_DECREF(f);
+ _PyObject_GC_TRACK(f);
+ }
+ else {
+ ++tstate->recursion_depth;
+ Py_DECREF(f);
+ --tstate->recursion_depth;
+ }
return result;
}
@@ -4895,9 +4956,6 @@ fast_function(PyObject *func, PyObject **stack,
/* kwnames must only contains str strings, no subclass, and all keys must
be unique */
- PCALL(PCALL_FUNCTION);
- PCALL(PCALL_FAST_FUNCTION);
-
if (co->co_kwonlyargcount == 0 && nkwargs == 0 &&
co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE))
{
@@ -4960,11 +5018,8 @@ _PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs,
assert(nargs == 0 || args != NULL);
assert(kwargs == NULL || PyDict_Check(kwargs));
- PCALL(PCALL_FUNCTION);
- PCALL(PCALL_FAST_FUNCTION);
-
if (co->co_kwonlyargcount == 0 &&
- (kwargs == NULL || PyDict_Size(kwargs) == 0) &&
+ (kwargs == NULL || PyDict_GET_SIZE(kwargs) == 0) &&
co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE))
{
/* Fast paths */
@@ -4980,10 +5035,12 @@ _PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs,
}
}
- if (kwargs != NULL) {
+ nk = (kwargs != NULL) ? PyDict_GET_SIZE(kwargs) : 0;
+ if (nk != 0) {
Py_ssize_t pos, i;
- nk = PyDict_Size(kwargs);
+ /* Issue #29318: Caller and callee functions must not share the
+ dictionary: kwargs must be copied. */
kwtuple = PyTuple_New(2 * nk);
if (kwtuple == NULL) {
return NULL;
@@ -4992,6 +5049,9 @@ _PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs,
k = &PyTuple_GET_ITEM(kwtuple, 0);
pos = i = 0;
while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
+ /* We must hold strong references because keyword arguments can be
+ indirectly modified while the function is called:
+ see issue #2016 and test_extcall */
Py_INCREF(k[i]);
Py_INCREF(k[i+1]);
i += 2;
@@ -5001,7 +5061,6 @@ _PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs,
else {
kwtuple = NULL;
k = NULL;
- nk = 0;
}
kwdefs = PyFunction_GET_KW_DEFAULTS(func);
@@ -5030,23 +5089,6 @@ _PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs,
static PyObject *
do_call_core(PyObject *func, PyObject *callargs, PyObject *kwdict)
{
-#ifdef CALL_PROFILE
- /* At this point, we have to look at the type of func to
- update the call stats properly. Do it here so as to avoid
- exposing the call stats machinery outside ceval.c
- */
- if (PyFunction_Check(func))
- PCALL(PCALL_FUNCTION);
- else if (PyMethod_Check(func))
- PCALL(PCALL_METHOD);
- else if (PyType_Check(func))
- PCALL(PCALL_TYPE);
- else if (PyCFunction_Check(func))
- PCALL(PCALL_CFUNCTION);
- else
- PCALL(PCALL_OTHER);
-#endif
-
if (PyCFunction_Check(func)) {
PyObject *result;
PyThreadState *tstate = PyThreadState_GET();
@@ -5345,8 +5387,10 @@ unicode_concatenate(PyObject *v, PyObject *w,
PyObject **freevars = (f->f_localsplus +
f->f_code->co_nlocals);
PyObject *c = freevars[oparg];
- if (PyCell_GET(c) == v)
- PyCell_Set(c, NULL);
+ if (PyCell_GET(c) == v) {
+ PyCell_SET(c, NULL);
+ Py_DECREF(v);
+ }
break;
}
case STORE_NAME:
@@ -5430,8 +5474,8 @@ _PyEval_RequestCodeExtraIndex(freefunc free)
static void
dtrace_function_entry(PyFrameObject *f)
{
- char* filename;
- char* funcname;
+ const char *filename;
+ const char *funcname;
int lineno;
filename = PyUnicode_AsUTF8(f->f_code->co_filename);
@@ -5444,8 +5488,8 @@ dtrace_function_entry(PyFrameObject *f)
static void
dtrace_function_return(PyFrameObject *f)
{
- char* filename;
- char* funcname;
+ const char *filename;
+ const char *funcname;
int lineno;
filename = PyUnicode_AsUTF8(f->f_code->co_filename);
@@ -5461,7 +5505,7 @@ maybe_dtrace_line(PyFrameObject *frame,
int *instr_lb, int *instr_ub, int *instr_prev)
{
int line = frame->f_lineno;
- char *co_filename, *co_name;
+ const char *co_filename, *co_name;
/* If the last instruction executed isn't in the current
instruction window, reset the window.
diff --git a/Python/clinic/_warnings.c.h b/Python/clinic/_warnings.c.h
new file mode 100644
index 0000000000..550c73f952
--- /dev/null
+++ b/Python/clinic/_warnings.c.h
@@ -0,0 +1,38 @@
+/*[clinic input]
+preserve
+[clinic start generated code]*/
+
+PyDoc_STRVAR(warnings_warn__doc__,
+"warn($module, /, message, category=None, stacklevel=1, source=None)\n"
+"--\n"
+"\n"
+"Issue a warning, or maybe ignore it or raise an exception.");
+
+#define WARNINGS_WARN_METHODDEF \
+ {"warn", (PyCFunction)warnings_warn, METH_FASTCALL, warnings_warn__doc__},
+
+static PyObject *
+warnings_warn_impl(PyObject *module, PyObject *message, PyObject *category,
+ Py_ssize_t stacklevel, PyObject *source);
+
+static PyObject *
+warnings_warn(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ static const char * const _keywords[] = {"message", "category", "stacklevel", "source", NULL};
+ static _PyArg_Parser _parser = {"O|OnO:warn", _keywords, 0};
+ PyObject *message;
+ PyObject *category = Py_None;
+ Py_ssize_t stacklevel = 1;
+ PyObject *source = Py_None;
+
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
+ &message, &category, &stacklevel, &source)) {
+ goto exit;
+ }
+ return_value = warnings_warn_impl(module, message, category, stacklevel, source);
+
+exit:
+ return return_value;
+}
+/*[clinic end generated code: output=acadf1788059034c input=a9049054013a1b77]*/
diff --git a/Python/clinic/bltinmodule.c.h b/Python/clinic/bltinmodule.c.h
index c88deef33f..b52bde2612 100644
--- a/Python/clinic/bltinmodule.c.h
+++ b/Python/clinic/bltinmodule.c.h
@@ -80,22 +80,26 @@ PyDoc_STRVAR(builtin_format__doc__,
"format_spec defaults to the empty string");
#define BUILTIN_FORMAT_METHODDEF \
- {"format", (PyCFunction)builtin_format, METH_VARARGS, builtin_format__doc__},
+ {"format", (PyCFunction)builtin_format, METH_FASTCALL, builtin_format__doc__},
static PyObject *
builtin_format_impl(PyObject *module, PyObject *value, PyObject *format_spec);
static PyObject *
-builtin_format(PyObject *module, PyObject *args)
+builtin_format(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
PyObject *value;
PyObject *format_spec = NULL;
- if (!PyArg_ParseTuple(args, "O|U:format",
+ if (!_PyArg_ParseStack(args, nargs, "O|U:format",
&value, &format_spec)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("format", kwnames)) {
+ goto exit;
+ }
return_value = builtin_format_impl(module, value, format_spec);
exit:
@@ -168,7 +172,7 @@ builtin_compile(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *k
int dont_inherit = 0;
int optimize = -1;
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
&source, PyUnicode_FSDecoder, &filename, &mode, &flags, &dont_inherit, &optimize)) {
goto exit;
}
@@ -185,23 +189,27 @@ PyDoc_STRVAR(builtin_divmod__doc__,
"Return the tuple (x//y, x%y). Invariant: div*y + mod == x.");
#define BUILTIN_DIVMOD_METHODDEF \
- {"divmod", (PyCFunction)builtin_divmod, METH_VARARGS, builtin_divmod__doc__},
+ {"divmod", (PyCFunction)builtin_divmod, METH_FASTCALL, builtin_divmod__doc__},
static PyObject *
builtin_divmod_impl(PyObject *module, PyObject *x, PyObject *y);
static PyObject *
-builtin_divmod(PyObject *module, PyObject *args)
+builtin_divmod(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
PyObject *x;
PyObject *y;
- if (!PyArg_UnpackTuple(args, "divmod",
+ if (!_PyArg_UnpackStack(args, nargs, "divmod",
2, 2,
&x, &y)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("divmod", kwnames)) {
+ goto exit;
+ }
return_value = builtin_divmod_impl(module, x, y);
exit:
@@ -221,25 +229,29 @@ PyDoc_STRVAR(builtin_eval__doc__,
"If only globals is given, locals defaults to it.");
#define BUILTIN_EVAL_METHODDEF \
- {"eval", (PyCFunction)builtin_eval, METH_VARARGS, builtin_eval__doc__},
+ {"eval", (PyCFunction)builtin_eval, METH_FASTCALL, builtin_eval__doc__},
static PyObject *
builtin_eval_impl(PyObject *module, PyObject *source, PyObject *globals,
PyObject *locals);
static PyObject *
-builtin_eval(PyObject *module, PyObject *args)
+builtin_eval(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
PyObject *source;
PyObject *globals = Py_None;
PyObject *locals = Py_None;
- if (!PyArg_UnpackTuple(args, "eval",
+ if (!_PyArg_UnpackStack(args, nargs, "eval",
1, 3,
&source, &globals, &locals)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("eval", kwnames)) {
+ goto exit;
+ }
return_value = builtin_eval_impl(module, source, globals, locals);
exit:
@@ -259,25 +271,29 @@ PyDoc_STRVAR(builtin_exec__doc__,
"If only globals is given, locals defaults to it.");
#define BUILTIN_EXEC_METHODDEF \
- {"exec", (PyCFunction)builtin_exec, METH_VARARGS, builtin_exec__doc__},
+ {"exec", (PyCFunction)builtin_exec, METH_FASTCALL, builtin_exec__doc__},
static PyObject *
builtin_exec_impl(PyObject *module, PyObject *source, PyObject *globals,
PyObject *locals);
static PyObject *
-builtin_exec(PyObject *module, PyObject *args)
+builtin_exec(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
PyObject *source;
PyObject *globals = Py_None;
PyObject *locals = Py_None;
- if (!PyArg_UnpackTuple(args, "exec",
+ if (!_PyArg_UnpackStack(args, nargs, "exec",
1, 3,
&source, &globals, &locals)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("exec", kwnames)) {
+ goto exit;
+ }
return_value = builtin_exec_impl(module, source, globals, locals);
exit:
@@ -314,23 +330,27 @@ PyDoc_STRVAR(builtin_hasattr__doc__,
"This is done by calling getattr(obj, name) and catching AttributeError.");
#define BUILTIN_HASATTR_METHODDEF \
- {"hasattr", (PyCFunction)builtin_hasattr, METH_VARARGS, builtin_hasattr__doc__},
+ {"hasattr", (PyCFunction)builtin_hasattr, METH_FASTCALL, builtin_hasattr__doc__},
static PyObject *
builtin_hasattr_impl(PyObject *module, PyObject *obj, PyObject *name);
static PyObject *
-builtin_hasattr(PyObject *module, PyObject *args)
+builtin_hasattr(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
PyObject *obj;
PyObject *name;
- if (!PyArg_UnpackTuple(args, "hasattr",
+ if (!_PyArg_UnpackStack(args, nargs, "hasattr",
2, 2,
&obj, &name)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("hasattr", kwnames)) {
+ goto exit;
+ }
return_value = builtin_hasattr_impl(module, obj, name);
exit:
@@ -358,25 +378,29 @@ PyDoc_STRVAR(builtin_setattr__doc__,
"setattr(x, \'y\', v) is equivalent to ``x.y = v\'\'");
#define BUILTIN_SETATTR_METHODDEF \
- {"setattr", (PyCFunction)builtin_setattr, METH_VARARGS, builtin_setattr__doc__},
+ {"setattr", (PyCFunction)builtin_setattr, METH_FASTCALL, builtin_setattr__doc__},
static PyObject *
builtin_setattr_impl(PyObject *module, PyObject *obj, PyObject *name,
PyObject *value);
static PyObject *
-builtin_setattr(PyObject *module, PyObject *args)
+builtin_setattr(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
PyObject *obj;
PyObject *name;
PyObject *value;
- if (!PyArg_UnpackTuple(args, "setattr",
+ if (!_PyArg_UnpackStack(args, nargs, "setattr",
3, 3,
&obj, &name, &value)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("setattr", kwnames)) {
+ goto exit;
+ }
return_value = builtin_setattr_impl(module, obj, name, value);
exit:
@@ -392,23 +416,27 @@ PyDoc_STRVAR(builtin_delattr__doc__,
"delattr(x, \'y\') is equivalent to ``del x.y\'\'");
#define BUILTIN_DELATTR_METHODDEF \
- {"delattr", (PyCFunction)builtin_delattr, METH_VARARGS, builtin_delattr__doc__},
+ {"delattr", (PyCFunction)builtin_delattr, METH_FASTCALL, builtin_delattr__doc__},
static PyObject *
builtin_delattr_impl(PyObject *module, PyObject *obj, PyObject *name);
static PyObject *
-builtin_delattr(PyObject *module, PyObject *args)
+builtin_delattr(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
PyObject *obj;
PyObject *name;
- if (!PyArg_UnpackTuple(args, "delattr",
+ if (!_PyArg_UnpackStack(args, nargs, "delattr",
2, 2,
&obj, &name)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("delattr", kwnames)) {
+ goto exit;
+ }
return_value = builtin_delattr_impl(module, obj, name);
exit:
@@ -501,24 +529,28 @@ PyDoc_STRVAR(builtin_pow__doc__,
"invoked using the three argument form.");
#define BUILTIN_POW_METHODDEF \
- {"pow", (PyCFunction)builtin_pow, METH_VARARGS, builtin_pow__doc__},
+ {"pow", (PyCFunction)builtin_pow, METH_FASTCALL, builtin_pow__doc__},
static PyObject *
builtin_pow_impl(PyObject *module, PyObject *x, PyObject *y, PyObject *z);
static PyObject *
-builtin_pow(PyObject *module, PyObject *args)
+builtin_pow(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
PyObject *x;
PyObject *y;
PyObject *z = Py_None;
- if (!PyArg_UnpackTuple(args, "pow",
+ if (!_PyArg_UnpackStack(args, nargs, "pow",
2, 3,
&x, &y, &z)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("pow", kwnames)) {
+ goto exit;
+ }
return_value = builtin_pow_impl(module, x, y, z);
exit:
@@ -538,22 +570,26 @@ PyDoc_STRVAR(builtin_input__doc__,
"On *nix systems, readline is used if available.");
#define BUILTIN_INPUT_METHODDEF \
- {"input", (PyCFunction)builtin_input, METH_VARARGS, builtin_input__doc__},
+ {"input", (PyCFunction)builtin_input, METH_FASTCALL, builtin_input__doc__},
static PyObject *
builtin_input_impl(PyObject *module, PyObject *prompt);
static PyObject *
-builtin_input(PyObject *module, PyObject *args)
+builtin_input(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
PyObject *prompt = NULL;
- if (!PyArg_UnpackTuple(args, "input",
+ if (!_PyArg_UnpackStack(args, nargs, "input",
0, 1,
&prompt)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("input", kwnames)) {
+ goto exit;
+ }
return_value = builtin_input_impl(module, prompt);
exit:
@@ -582,23 +618,27 @@ PyDoc_STRVAR(builtin_sum__doc__,
"reject non-numeric types.");
#define BUILTIN_SUM_METHODDEF \
- {"sum", (PyCFunction)builtin_sum, METH_VARARGS, builtin_sum__doc__},
+ {"sum", (PyCFunction)builtin_sum, METH_FASTCALL, builtin_sum__doc__},
static PyObject *
builtin_sum_impl(PyObject *module, PyObject *iterable, PyObject *start);
static PyObject *
-builtin_sum(PyObject *module, PyObject *args)
+builtin_sum(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
PyObject *iterable;
PyObject *start = NULL;
- if (!PyArg_UnpackTuple(args, "sum",
+ if (!_PyArg_UnpackStack(args, nargs, "sum",
1, 2,
&iterable, &start)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("sum", kwnames)) {
+ goto exit;
+ }
return_value = builtin_sum_impl(module, iterable, start);
exit:
@@ -616,24 +656,28 @@ PyDoc_STRVAR(builtin_isinstance__doc__,
"or ...`` etc.");
#define BUILTIN_ISINSTANCE_METHODDEF \
- {"isinstance", (PyCFunction)builtin_isinstance, METH_VARARGS, builtin_isinstance__doc__},
+ {"isinstance", (PyCFunction)builtin_isinstance, METH_FASTCALL, builtin_isinstance__doc__},
static PyObject *
builtin_isinstance_impl(PyObject *module, PyObject *obj,
PyObject *class_or_tuple);
static PyObject *
-builtin_isinstance(PyObject *module, PyObject *args)
+builtin_isinstance(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
PyObject *obj;
PyObject *class_or_tuple;
- if (!PyArg_UnpackTuple(args, "isinstance",
+ if (!_PyArg_UnpackStack(args, nargs, "isinstance",
2, 2,
&obj, &class_or_tuple)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("isinstance", kwnames)) {
+ goto exit;
+ }
return_value = builtin_isinstance_impl(module, obj, class_or_tuple);
exit:
@@ -651,27 +695,31 @@ PyDoc_STRVAR(builtin_issubclass__doc__,
"or ...`` etc.");
#define BUILTIN_ISSUBCLASS_METHODDEF \
- {"issubclass", (PyCFunction)builtin_issubclass, METH_VARARGS, builtin_issubclass__doc__},
+ {"issubclass", (PyCFunction)builtin_issubclass, METH_FASTCALL, builtin_issubclass__doc__},
static PyObject *
builtin_issubclass_impl(PyObject *module, PyObject *cls,
PyObject *class_or_tuple);
static PyObject *
-builtin_issubclass(PyObject *module, PyObject *args)
+builtin_issubclass(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
PyObject *cls;
PyObject *class_or_tuple;
- if (!PyArg_UnpackTuple(args, "issubclass",
+ if (!_PyArg_UnpackStack(args, nargs, "issubclass",
2, 2,
&cls, &class_or_tuple)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("issubclass", kwnames)) {
+ goto exit;
+ }
return_value = builtin_issubclass_impl(module, cls, class_or_tuple);
exit:
return return_value;
}
-/*[clinic end generated code: output=63483deb75805f7c input=a9049054013a1b77]*/
+/*[clinic end generated code: output=3234725ef4d8bbf1 input=a9049054013a1b77]*/
diff --git a/Python/clinic/import.c.h b/Python/clinic/import.c.h
index b3460b061d..0165b7c4e1 100644
--- a/Python/clinic/import.c.h
+++ b/Python/clinic/import.c.h
@@ -75,23 +75,27 @@ PyDoc_STRVAR(_imp__fix_co_filename__doc__,
" File path to use.");
#define _IMP__FIX_CO_FILENAME_METHODDEF \
- {"_fix_co_filename", (PyCFunction)_imp__fix_co_filename, METH_VARARGS, _imp__fix_co_filename__doc__},
+ {"_fix_co_filename", (PyCFunction)_imp__fix_co_filename, METH_FASTCALL, _imp__fix_co_filename__doc__},
static PyObject *
_imp__fix_co_filename_impl(PyObject *module, PyCodeObject *code,
PyObject *path);
static PyObject *
-_imp__fix_co_filename(PyObject *module, PyObject *args)
+_imp__fix_co_filename(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
PyCodeObject *code;
PyObject *path;
- if (!PyArg_ParseTuple(args, "O!U:_fix_co_filename",
+ if (!_PyArg_ParseStack(args, nargs, "O!U:_fix_co_filename",
&PyCode_Type, &code, &path)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("_fix_co_filename", kwnames)) {
+ goto exit;
+ }
return_value = _imp__fix_co_filename_impl(module, code, path);
exit:
@@ -269,23 +273,27 @@ PyDoc_STRVAR(_imp_create_dynamic__doc__,
"Create an extension module.");
#define _IMP_CREATE_DYNAMIC_METHODDEF \
- {"create_dynamic", (PyCFunction)_imp_create_dynamic, METH_VARARGS, _imp_create_dynamic__doc__},
+ {"create_dynamic", (PyCFunction)_imp_create_dynamic, METH_FASTCALL, _imp_create_dynamic__doc__},
static PyObject *
_imp_create_dynamic_impl(PyObject *module, PyObject *spec, PyObject *file);
static PyObject *
-_imp_create_dynamic(PyObject *module, PyObject *args)
+_imp_create_dynamic(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *return_value = NULL;
PyObject *spec;
PyObject *file = NULL;
- if (!PyArg_UnpackTuple(args, "create_dynamic",
+ if (!_PyArg_UnpackStack(args, nargs, "create_dynamic",
1, 2,
&spec, &file)) {
goto exit;
}
+
+ if (!_PyArg_NoStackKeywords("create_dynamic", kwnames)) {
+ goto exit;
+ }
return_value = _imp_create_dynamic_impl(module, spec, file);
exit:
@@ -361,4 +369,4 @@ exit:
#ifndef _IMP_EXEC_DYNAMIC_METHODDEF
#define _IMP_EXEC_DYNAMIC_METHODDEF
#endif /* !defined(_IMP_EXEC_DYNAMIC_METHODDEF) */
-/*[clinic end generated code: output=d24d7f73702a907f input=a9049054013a1b77]*/
+/*[clinic end generated code: output=c1d0e65d04114958 input=a9049054013a1b77]*/
diff --git a/Python/codecs.c b/Python/codecs.c
index fe57d0dc42..688a40bd6f 100644
--- a/Python/codecs.c
+++ b/Python/codecs.c
@@ -284,7 +284,7 @@ PyObject *codec_makeincrementalcodec(PyObject *codec_info,
if (errors)
ret = PyObject_CallFunction(inccodec, "s", errors);
else
- ret = PyObject_CallFunction(inccodec, NULL);
+ ret = _PyObject_CallNoArg(inccodec);
Py_DECREF(inccodec);
return ret;
}
@@ -322,7 +322,7 @@ PyObject *codec_getstreamcodec(const char *encoding,
if (errors != NULL)
streamcodec = PyObject_CallFunction(codeccls, "Os", stream, errors);
else
- streamcodec = PyObject_CallFunction(codeccls, "O", stream);
+ streamcodec = PyObject_CallFunctionObjArgs(codeccls, stream, NULL);
Py_DECREF(codecs);
return streamcodec;
}
@@ -867,17 +867,14 @@ PyObject *PyCodec_BackslashReplaceErrors(PyObject *exc)
Py_UCS4 c;
if (PyObject_TypeCheck(exc, (PyTypeObject *)PyExc_UnicodeDecodeError)) {
- unsigned char *p;
+ const unsigned char *p;
if (PyUnicodeDecodeError_GetStart(exc, &start))
return NULL;
if (PyUnicodeDecodeError_GetEnd(exc, &end))
return NULL;
if (!(object = PyUnicodeDecodeError_GetObject(exc)))
return NULL;
- if (!(p = (unsigned char*)PyBytes_AsString(object))) {
- Py_DECREF(object);
- return NULL;
- }
+ p = (const unsigned char*)PyBytes_AS_STRING(object);
res = PyUnicode_New(4 * (end - start), 127);
if (res == NULL) {
Py_DECREF(object);
@@ -1134,7 +1131,7 @@ PyCodec_SurrogatePassErrors(PyObject *exc)
PyObject *restuple;
PyObject *object;
PyObject *encode;
- char *encoding;
+ const char *encoding;
int code;
int bytelength;
Py_ssize_t i;
@@ -1220,7 +1217,7 @@ PyCodec_SurrogatePassErrors(PyObject *exc)
return restuple;
}
else if (PyObject_TypeCheck(exc, (PyTypeObject *)PyExc_UnicodeDecodeError)) {
- unsigned char *p;
+ const unsigned char *p;
Py_UCS4 ch = 0;
if (PyUnicodeDecodeError_GetStart(exc, &start))
return NULL;
@@ -1228,10 +1225,7 @@ PyCodec_SurrogatePassErrors(PyObject *exc)
return NULL;
if (!(object = PyUnicodeDecodeError_GetObject(exc)))
return NULL;
- if (!(p = (unsigned char*)PyBytes_AsString(object))) {
- Py_DECREF(object);
- return NULL;
- }
+ p = (const unsigned char*)PyBytes_AS_STRING(object);
if (!(encode = PyUnicodeDecodeError_GetEncoding(exc))) {
Py_DECREF(object);
return NULL;
@@ -1338,7 +1332,7 @@ PyCodec_SurrogateEscapeErrors(PyObject *exc)
}
else if (PyObject_TypeCheck(exc, (PyTypeObject *)PyExc_UnicodeDecodeError)) {
PyObject *str;
- unsigned char *p;
+ const unsigned char *p;
Py_UCS2 ch[4]; /* decode up to 4 bad bytes. */
int consumed = 0;
if (PyUnicodeDecodeError_GetStart(exc, &start))
@@ -1347,10 +1341,7 @@ PyCodec_SurrogateEscapeErrors(PyObject *exc)
return NULL;
if (!(object = PyUnicodeDecodeError_GetObject(exc)))
return NULL;
- if (!(p = (unsigned char*)PyBytes_AsString(object))) {
- Py_DECREF(object);
- return NULL;
- }
+ p = (const unsigned char*)PyBytes_AS_STRING(object);
while (consumed < 4 && consumed < end-start) {
/* Refuse to escape ASCII bytes. */
if (p[start+consumed] < 128)
diff --git a/Python/compile.c b/Python/compile.c
index 0e16075852..17fef31482 100644
--- a/Python/compile.c
+++ b/Python/compile.c
@@ -564,7 +564,7 @@ compiler_enter_scope(struct compiler *c, identifier name,
PyObject *tuple, *name, *zero;
int res;
assert(u->u_scope_type == COMPILER_SCOPE_CLASS);
- assert(PyDict_Size(u->u_cellvars) == 0);
+ assert(PyDict_GET_SIZE(u->u_cellvars) == 0);
name = _PyUnicode_FromId(&PyId___class__);
if (!name) {
compiler_unit_free(u);
@@ -591,7 +591,7 @@ compiler_enter_scope(struct compiler *c, identifier name,
}
u->u_freevars = dictbytype(u->u_ste->ste_symbols, FREE, DEF_FREE_CLASS,
- PyDict_Size(u->u_cellvars));
+ PyDict_GET_SIZE(u->u_cellvars));
if (!u->u_freevars) {
compiler_unit_free(u);
return 0;
@@ -1040,6 +1040,8 @@ PyCompile_OpcodeStackEffect(int opcode, int oparg)
return -oparg;
case CALL_FUNCTION:
return -oparg;
+ case CALL_METHOD:
+ return -oparg-1;
case CALL_FUNCTION_KW:
return -oparg-1;
case CALL_FUNCTION_EX:
@@ -1078,6 +1080,8 @@ PyCompile_OpcodeStackEffect(int opcode, int oparg)
/* If there's a fmt_spec on the stack, we go from 2->1,
else 1->1. */
return (oparg & FVS_MASK) == FVS_HAVE_SPEC ? -1 : 0;
+ case LOAD_METHOD:
+ return 1;
default:
return PY_INVALID_STACK_EFFECT;
}
@@ -1124,7 +1128,7 @@ compiler_add_o(struct compiler *c, PyObject *dict, PyObject *o)
Py_DECREF(t);
return -1;
}
- arg = PyDict_Size(dict);
+ arg = PyDict_GET_SIZE(dict);
v = PyLong_FromSsize_t(arg);
if (!v) {
Py_DECREF(t);
@@ -1995,7 +1999,7 @@ compiler_class(struct compiler *c, stmt_ty s)
}
else {
/* No methods referenced __class__, so just return None */
- assert(PyDict_Size(c->u->u_cellvars) == 0);
+ assert(PyDict_GET_SIZE(c->u->u_cellvars) == 0);
ADDOP_O(c, LOAD_CONST, Py_None, consts);
}
ADDOP_IN_SCOPE(c, RETURN_VALUE);
@@ -3348,11 +3352,8 @@ compiler_dict(struct compiler *c, expr_ty e)
/* If there is more than one dict, they need to be merged into a new
* dict. If there is one dict and it's an unpacking, then it needs
* to be copied into a new dict." */
- while (containers > 1 || is_unpacking) {
- int oparg = containers < 255 ? containers : 255;
- ADDOP_I(c, BUILD_MAP_UNPACK, oparg);
- containers -= (oparg - 1);
- is_unpacking = 0;
+ if (containers > 1 || is_unpacking) {
+ ADDOP_I(c, BUILD_MAP_UNPACK, containers);
}
return 1;
}
@@ -3403,8 +3404,41 @@ compiler_compare(struct compiler *c, expr_ty e)
}
static int
+maybe_optimize_method_call(struct compiler *c, expr_ty e)
+{
+ Py_ssize_t argsl, i;
+ expr_ty meth = e->v.Call.func;
+ asdl_seq *args = e->v.Call.args;
+
+ /* Check that the call node is an attribute access, and that
+ the call doesn't have keyword parameters. */
+ if (meth->kind != Attribute_kind || meth->v.Attribute.ctx != Load ||
+ asdl_seq_LEN(e->v.Call.keywords))
+ return -1;
+
+ /* Check that there are no *varargs types of arguments. */
+ argsl = asdl_seq_LEN(args);
+ for (i = 0; i < argsl; i++) {
+ expr_ty elt = asdl_seq_GET(args, i);
+ if (elt->kind == Starred_kind) {
+ return -1;
+ }
+ }
+
+ /* Alright, we can optimize the code. */
+ VISIT(c, expr, meth->v.Attribute.value);
+ ADDOP_NAME(c, LOAD_METHOD, meth->v.Attribute.attr, names);
+ VISIT_SEQ(c, expr, e->v.Call.args);
+ ADDOP_I(c, CALL_METHOD, asdl_seq_LEN(e->v.Call.args));
+ return 1;
+}
+
+static int
compiler_call(struct compiler *c, expr_ty e)
{
+ if (maybe_optimize_method_call(c, e) > 0)
+ return 1;
+
VISIT(c, expr, e->v.Call.func);
return compiler_call_helper(c, 0,
e->v.Call.args,
@@ -4044,7 +4078,7 @@ compiler_visit_keyword(struct compiler *c, keyword_ty k)
static int
expr_constant(struct compiler *c, expr_ty e)
{
- char *id;
+ const char *id;
switch (e->kind) {
case Ellipsis_kind:
return 1;
@@ -5145,7 +5179,7 @@ static PyObject *
dict_keys_inorder(PyObject *dict, Py_ssize_t offset)
{
PyObject *tuple, *k, *v;
- Py_ssize_t i, pos = 0, size = PyDict_Size(dict);
+ Py_ssize_t i, pos = 0, size = PyDict_GET_SIZE(dict);
tuple = PyTuple_New(size);
if (tuple == NULL)
@@ -5169,7 +5203,6 @@ compute_code_flags(struct compiler *c)
{
PySTEntryObject *ste = c->u->u_ste;
int flags = 0;
- Py_ssize_t n;
if (ste->ste_type == FunctionBlock) {
flags |= CO_NEWLOCALS | CO_OPTIMIZED;
if (ste->ste_nested)
@@ -5189,16 +5222,9 @@ compute_code_flags(struct compiler *c)
/* (Only) inherit compilerflags in PyCF_MASK */
flags |= (c->c_flags->cf_flags & PyCF_MASK);
- n = PyDict_Size(c->u->u_freevars);
- if (n < 0)
- return -1;
- if (n == 0) {
- n = PyDict_Size(c->u->u_cellvars);
- if (n < 0)
- return -1;
- if (n == 0) {
- flags |= CO_NOFREE;
- }
+ if (!PyDict_GET_SIZE(c->u->u_freevars) &&
+ !PyDict_GET_SIZE(c->u->u_cellvars)) {
+ flags |= CO_NOFREE;
}
return flags;
@@ -5239,7 +5265,7 @@ makecode(struct compiler *c, struct assembler *a)
if (!freevars)
goto error;
- nlocals = PyDict_Size(c->u->u_varnames);
+ nlocals = PyDict_GET_SIZE(c->u->u_varnames);
assert(nlocals < INT_MAX);
nlocals_int = Py_SAFE_DOWNCAST(nlocals, Py_ssize_t, int);
diff --git a/Python/errors.c b/Python/errors.c
index 6095843815..3785e6981c 100644
--- a/Python/errors.c
+++ b/Python/errors.c
@@ -62,7 +62,7 @@ _PyErr_CreateException(PyObject *exception, PyObject *value)
return PyObject_Call(exception, value, NULL);
}
else {
- return _PyObject_CallArg1(exception, value);
+ return PyObject_CallFunctionObjArgs(exception, value, NULL);
}
}
@@ -158,10 +158,10 @@ PyErr_SetString(PyObject *exception, const char *string)
}
-PyObject *
+PyObject* _Py_HOT_FUNCTION
PyErr_Occurred(void)
{
- PyThreadState *tstate = _PyThreadState_UncheckedGet();
+ PyThreadState *tstate = PyThreadState_GET();
return tstate == NULL ? NULL : tstate->curexc_type;
}
@@ -582,9 +582,7 @@ PyErr_SetFromErrnoWithFilename(PyObject *exc, const char *filename)
PyObject *
PyErr_SetFromErrnoWithUnicodeFilename(PyObject *exc, const Py_UNICODE *filename)
{
- PyObject *name = filename ?
- PyUnicode_FromUnicode(filename, wcslen(filename)) :
- NULL;
+ PyObject *name = filename ? PyUnicode_FromWideChar(filename, -1) : NULL;
PyObject *result = PyErr_SetFromErrnoWithFilenameObjects(exc, name, NULL);
Py_XDECREF(name);
return result;
@@ -691,9 +689,7 @@ PyObject *PyErr_SetExcFromWindowsErrWithUnicodeFilename(
int ierr,
const Py_UNICODE *filename)
{
- PyObject *name = filename ?
- PyUnicode_FromUnicode(filename, wcslen(filename)) :
- NULL;
+ PyObject *name = filename ? PyUnicode_FromWideChar(filename, -1) : NULL;
PyObject *ret = PyErr_SetExcFromWindowsErrWithFilenameObjects(exc,
ierr,
name,
@@ -729,9 +725,7 @@ PyObject *PyErr_SetFromWindowsErrWithUnicodeFilename(
int ierr,
const Py_UNICODE *filename)
{
- PyObject *name = filename ?
- PyUnicode_FromUnicode(filename, wcslen(filename)) :
- NULL;
+ PyObject *name = filename ? PyUnicode_FromWideChar(filename, -1) : NULL;
PyObject *result = PyErr_SetExcFromWindowsErrWithFilenameObjects(
PyExc_OSError,
ierr, name, NULL);
diff --git a/Python/getargs.c b/Python/getargs.c
index 616c6eb107..8cb672d6ab 100644
--- a/Python/getargs.c
+++ b/Python/getargs.c
@@ -26,7 +26,9 @@ int _PyArg_VaParseTupleAndKeywordsFast(PyObject *, PyObject *,
#ifdef HAVE_DECLSPEC_DLL
/* Export functions */
PyAPI_FUNC(int) _PyArg_Parse_SizeT(PyObject *, const char *, ...);
-PyAPI_FUNC(int) _PyArg_ParseStack_SizeT(PyObject **args, Py_ssize_t nargs, PyObject *kwnames,
+PyAPI_FUNC(int) _PyArg_ParseStack_SizeT(PyObject **args, Py_ssize_t nargs,
+ const char *format, ...);
+PyAPI_FUNC(int) _PyArg_ParseStackAndKeywords_SizeT(PyObject **args, Py_ssize_t nargs, PyObject *kwnames,
struct _PyArg_Parser *parser, ...);
PyAPI_FUNC(int) _PyArg_ParseTuple_SizeT(PyObject *, const char *, ...);
PyAPI_FUNC(int) _PyArg_ParseTupleAndKeywords_SizeT(PyObject *, PyObject *,
@@ -66,6 +68,8 @@ typedef struct {
#define STATIC_FREELIST_ENTRIES 8
/* Forward */
+static int vgetargs1_impl(PyObject *args, PyObject **stack, Py_ssize_t nargs,
+ const char *format, va_list *p_va, int flags);
static int vgetargs1(PyObject *, const char *, va_list *, int);
static void seterror(Py_ssize_t, const char *, int *, const char *, const char *);
static const char *convertitem(PyObject *, const char **, va_list *, int, int *,
@@ -74,7 +78,7 @@ static const char *converttuple(PyObject *, const char **, va_list *, int,
int *, char *, size_t, int, freelist_t *);
static const char *convertsimple(PyObject *, const char **, va_list *, int,
char *, size_t, freelist_t *);
-static Py_ssize_t convertbuffer(PyObject *, void **p, const char **);
+static Py_ssize_t convertbuffer(PyObject *, const void **p, const char **);
static int getbuffer(PyObject *, Py_buffer *, const char**);
static int vgetargskeywords(PyObject *, PyObject *,
@@ -138,6 +142,31 @@ _PyArg_ParseTuple_SizeT(PyObject *args, const char *format, ...)
int
+_PyArg_ParseStack(PyObject **args, Py_ssize_t nargs, const char *format, ...)
+{
+ int retval;
+ va_list va;
+
+ va_start(va, format);
+ retval = vgetargs1_impl(NULL, args, nargs, format, &va, 0);
+ va_end(va);
+ return retval;
+}
+
+int
+_PyArg_ParseStack_SizeT(PyObject **args, Py_ssize_t nargs, const char *format, ...)
+{
+ int retval;
+ va_list va;
+
+ va_start(va, format);
+ retval = vgetargs1_impl(NULL, args, nargs, format, &va, FLAG_SIZE_T);
+ va_end(va);
+ return retval;
+}
+
+
+int
PyArg_VaParse(PyObject *args, const char *format, va_list va)
{
va_list lva;
@@ -220,7 +249,8 @@ cleanreturn(int retval, freelist_t *freelist)
static int
-vgetargs1(PyObject *args, const char *format, va_list *p_va, int flags)
+vgetargs1_impl(PyObject *compat_args, PyObject **stack, Py_ssize_t nargs, const char *format,
+ va_list *p_va, int flags)
{
char msgbuf[256];
int levels[32];
@@ -231,17 +261,18 @@ vgetargs1(PyObject *args, const char *format, va_list *p_va, int flags)
int level = 0;
int endfmt = 0;
const char *formatsave = format;
- Py_ssize_t i, len;
+ Py_ssize_t i;
const char *msg;
int compat = flags & FLAG_COMPAT;
freelistentry_t static_entries[STATIC_FREELIST_ENTRIES];
freelist_t freelist;
+ assert(nargs == 0 || stack != NULL);
+
freelist.entries = static_entries;
freelist.first_available = 0;
freelist.entries_malloced = 0;
- assert(compat || (args != (PyObject*)NULL));
flags = flags & ~FLAG_COMPAT;
while (endfmt == 0) {
@@ -305,7 +336,7 @@ vgetargs1(PyObject *args, const char *format, va_list *p_va, int flags)
if (compat) {
if (max == 0) {
- if (args == NULL)
+ if (compat_args == NULL)
return 1;
PyErr_Format(PyExc_TypeError,
"%.200s%s takes no arguments",
@@ -314,14 +345,14 @@ vgetargs1(PyObject *args, const char *format, va_list *p_va, int flags)
return cleanreturn(0, &freelist);
}
else if (min == 1 && max == 1) {
- if (args == NULL) {
+ if (compat_args == NULL) {
PyErr_Format(PyExc_TypeError,
"%.200s%s takes at least one argument",
fname==NULL ? "function" : fname,
fname==NULL ? "" : "()");
return cleanreturn(0, &freelist);
}
- msg = convertitem(args, &format, p_va, flags, levels,
+ msg = convertitem(compat_args, &format, p_va, flags, levels,
msgbuf, sizeof(msgbuf), &freelist);
if (msg == NULL)
return cleanreturn(1, &freelist);
@@ -335,34 +366,26 @@ vgetargs1(PyObject *args, const char *format, va_list *p_va, int flags)
}
}
- if (!PyTuple_Check(args)) {
- PyErr_SetString(PyExc_SystemError,
- "new style getargs format but argument is not a tuple");
- return cleanreturn(0, &freelist);
- }
-
- len = PyTuple_GET_SIZE(args);
-
- if (len < min || max < len) {
+ if (nargs < min || max < nargs) {
if (message == NULL)
PyErr_Format(PyExc_TypeError,
"%.150s%s takes %s %d argument%s (%ld given)",
fname==NULL ? "function" : fname,
fname==NULL ? "" : "()",
min==max ? "exactly"
- : len < min ? "at least" : "at most",
- len < min ? min : max,
- (len < min ? min : max) == 1 ? "" : "s",
- Py_SAFE_DOWNCAST(len, Py_ssize_t, long));
+ : nargs < min ? "at least" : "at most",
+ nargs < min ? min : max,
+ (nargs < min ? min : max) == 1 ? "" : "s",
+ Py_SAFE_DOWNCAST(nargs, Py_ssize_t, long));
else
PyErr_SetString(PyExc_TypeError, message);
return cleanreturn(0, &freelist);
}
- for (i = 0; i < len; i++) {
+ for (i = 0; i < nargs; i++) {
if (*format == '|')
format++;
- msg = convertitem(PyTuple_GET_ITEM(args, i), &format, p_va,
+ msg = convertitem(stack[i], &format, p_va,
flags, levels, msgbuf,
sizeof(msgbuf), &freelist);
if (msg) {
@@ -382,6 +405,31 @@ vgetargs1(PyObject *args, const char *format, va_list *p_va, int flags)
return cleanreturn(1, &freelist);
}
+static int
+vgetargs1(PyObject *args, const char *format, va_list *p_va, int flags)
+{
+ PyObject **stack;
+ Py_ssize_t nargs;
+
+ if (!(flags & FLAG_COMPAT)) {
+ assert(args != NULL);
+
+ if (!PyTuple_Check(args)) {
+ PyErr_SetString(PyExc_SystemError,
+ "new style getargs format but argument is not a tuple");
+ return 0;
+ }
+
+ stack = &PyTuple_GET_ITEM(args, 0);
+ nargs = PyTuple_GET_SIZE(args);
+ }
+ else {
+ stack = NULL;
+ nargs = 0;
+ }
+
+ return vgetargs1_impl(args, stack, nargs, format, p_va, flags);
+}
static void
@@ -625,7 +673,7 @@ convertsimple(PyObject *arg, const char **p_format, va_list *p_va, int flags,
const char *format = *p_format;
char c = *format++;
- char *sarg;
+ const char *sarg;
switch (c) {
@@ -897,7 +945,7 @@ convertsimple(PyObject *arg, const char **p_format, va_list *p_va, int flags,
}
break;
}
- count = convertbuffer(arg, p, &buf);
+ count = convertbuffer(arg, (const void **)p, &buf);
if (count < 0)
return converterr(buf, arg, msgbuf, bufsize);
if (*format == '#') {
@@ -928,7 +976,7 @@ convertsimple(PyObject *arg, const char **p_format, va_list *p_va, int flags,
if (sarg == NULL)
return converterr(CONV_UNICODE,
arg, msgbuf, bufsize);
- PyBuffer_FillInfo(p, arg, sarg, len, 1, 0);
+ PyBuffer_FillInfo(p, arg, (void *)sarg, len, 1, 0);
}
else { /* any bytes-like object */
const char *buf;
@@ -943,7 +991,7 @@ convertsimple(PyObject *arg, const char **p_format, va_list *p_va, int flags,
format++;
} else if (*format == '#') { /* a string or read-only bytes-like object */
/* "s#" or "z#" */
- void **p = (void **)va_arg(*p_va, char **);
+ const void **p = (const void **)va_arg(*p_va, const char **);
FETCH_SIZE;
if (c == 'z' && arg == Py_None) {
@@ -970,7 +1018,7 @@ convertsimple(PyObject *arg, const char **p_format, va_list *p_va, int flags,
format++;
} else {
/* "s" or "z" */
- char **p = va_arg(*p_va, char **);
+ const char **p = va_arg(*p_va, const char **);
Py_ssize_t len;
sarg = NULL;
@@ -1027,7 +1075,7 @@ convertsimple(PyObject *arg, const char **p_format, va_list *p_va, int flags,
*p = PyUnicode_AsUnicodeAndSize(arg, &len);
if (*p == NULL)
RETURN_ERR_OCCURRED;
- if (Py_UNICODE_strlen(*p) != (size_t)len) {
+ if (wcslen(*p) != (size_t)len) {
PyErr_SetString(PyExc_ValueError, "embedded null character");
RETURN_ERR_OCCURRED;
}
@@ -1074,9 +1122,14 @@ convertsimple(PyObject *arg, const char **p_format, va_list *p_va, int flags,
(PyBytes_Check(arg) || PyByteArray_Check(arg))) {
s = arg;
Py_INCREF(s);
- if (PyObject_AsCharBuffer(s, &ptr, &size) < 0)
- return converterr("(AsCharBuffer failed)",
- arg, msgbuf, bufsize);
+ if (PyBytes_Check(arg)) {
+ size = PyBytes_GET_SIZE(s);
+ ptr = PyBytes_AS_STRING(s);
+ }
+ else {
+ size = PyByteArray_GET_SIZE(s);
+ ptr = PyByteArray_AS_STRING(s);
+ }
}
else if (PyUnicode_Check(arg)) {
/* Encode object; use default error handling */
@@ -1300,7 +1353,7 @@ convertsimple(PyObject *arg, const char **p_format, va_list *p_va, int flags,
}
static Py_ssize_t
-convertbuffer(PyObject *arg, void **p, const char **errmsg)
+convertbuffer(PyObject *arg, const void **p, const char **errmsg)
{
PyBufferProcs *pb = Py_TYPE(arg)->tp_as_buffer;
Py_ssize_t count;
@@ -1448,14 +1501,6 @@ _PyArg_ParseTupleAndKeywordsFast(PyObject *args, PyObject *keywords,
int retval;
va_list va;
- if ((args == NULL || !PyTuple_Check(args)) ||
- (keywords != NULL && !PyDict_Check(keywords)) ||
- parser == NULL)
- {
- PyErr_BadInternalCall();
- return 0;
- }
-
va_start(va, parser);
retval = vgetargskeywordsfast(args, keywords, parser, &va, 0);
va_end(va);
@@ -1469,14 +1514,6 @@ _PyArg_ParseTupleAndKeywordsFast_SizeT(PyObject *args, PyObject *keywords,
int retval;
va_list va;
- if ((args == NULL || !PyTuple_Check(args)) ||
- (keywords != NULL && !PyDict_Check(keywords)) ||
- parser == NULL)
- {
- PyErr_BadInternalCall();
- return 0;
- }
-
va_start(va, parser);
retval = vgetargskeywordsfast(args, keywords, parser, &va, FLAG_SIZE_T);
va_end(va);
@@ -1484,19 +1521,12 @@ _PyArg_ParseTupleAndKeywordsFast_SizeT(PyObject *args, PyObject *keywords,
}
int
-_PyArg_ParseStack(PyObject **args, Py_ssize_t nargs, PyObject *kwnames,
+_PyArg_ParseStackAndKeywords(PyObject **args, Py_ssize_t nargs, PyObject *kwnames,
struct _PyArg_Parser *parser, ...)
{
int retval;
va_list va;
- if ((kwnames != NULL && !PyTuple_Check(kwnames)) ||
- parser == NULL)
- {
- PyErr_BadInternalCall();
- return 0;
- }
-
va_start(va, parser);
retval = vgetargskeywordsfast_impl(args, nargs, NULL, kwnames, parser, &va, 0);
va_end(va);
@@ -1504,19 +1534,12 @@ _PyArg_ParseStack(PyObject **args, Py_ssize_t nargs, PyObject *kwnames,
}
int
-_PyArg_ParseStack_SizeT(PyObject **args, Py_ssize_t nargs, PyObject *kwnames,
+_PyArg_ParseStackAndKeywords_SizeT(PyObject **args, Py_ssize_t nargs, PyObject *kwnames,
struct _PyArg_Parser *parser, ...)
{
int retval;
va_list va;
- if ((kwnames != NULL && !PyTuple_Check(kwnames)) ||
- parser == NULL)
- {
- PyErr_BadInternalCall();
- return 0;
- }
-
va_start(va, parser);
retval = vgetargskeywordsfast_impl(args, nargs, NULL, kwnames, parser, &va, FLAG_SIZE_T);
va_end(va);
@@ -1531,14 +1554,6 @@ _PyArg_VaParseTupleAndKeywordsFast(PyObject *args, PyObject *keywords,
int retval;
va_list lva;
- if ((args == NULL || !PyTuple_Check(args)) ||
- (keywords != NULL && !PyDict_Check(keywords)) ||
- parser == NULL)
- {
- PyErr_BadInternalCall();
- return 0;
- }
-
va_copy(lva, va);
retval = vgetargskeywordsfast(args, keywords, parser, &lva, 0);
@@ -1553,14 +1568,6 @@ _PyArg_VaParseTupleAndKeywordsFast_SizeT(PyObject *args, PyObject *keywords,
int retval;
va_list lva;
- if ((args == NULL || !PyTuple_Check(args)) ||
- (keywords != NULL && !PyDict_Check(keywords)) ||
- parser == NULL)
- {
- PyErr_BadInternalCall();
- return 0;
- }
-
va_copy(lva, va);
retval = vgetargskeywordsfast(args, keywords, parser, &lva, FLAG_SIZE_T);
@@ -1586,17 +1593,17 @@ PyArg_ValidateKeywordArguments(PyObject *kwargs)
#define IS_END_OF_FORMAT(c) (c == '\0' || c == ';' || c == ':')
static int
-vgetargskeywords(PyObject *args, PyObject *keywords, const char *format,
+vgetargskeywords(PyObject *args, PyObject *kwargs, const char *format,
char **kwlist, va_list *p_va, int flags)
{
char msgbuf[512];
int levels[32];
- const char *fname, *msg, *custom_msg, *keyword;
+ const char *fname, *msg, *custom_msg;
int min = INT_MAX;
int max = INT_MAX;
int i, pos, len;
int skip = 0;
- Py_ssize_t nargs, nkeywords;
+ Py_ssize_t nargs, nkwargs;
PyObject *current_arg;
freelistentry_t static_entries[STATIC_FREELIST_ENTRIES];
freelist_t freelist;
@@ -1606,7 +1613,7 @@ vgetargskeywords(PyObject *args, PyObject *keywords, const char *format,
freelist.entries_malloced = 0;
assert(args != NULL && PyTuple_Check(args));
- assert(keywords == NULL || PyDict_Check(keywords));
+ assert(kwargs == NULL || PyDict_Check(kwargs));
assert(format != NULL);
assert(kwlist != NULL);
assert(p_va != NULL);
@@ -1645,21 +1652,20 @@ vgetargskeywords(PyObject *args, PyObject *keywords, const char *format,
}
nargs = PyTuple_GET_SIZE(args);
- nkeywords = (keywords == NULL) ? 0 : PyDict_Size(keywords);
- if (nargs + nkeywords > len) {
+ nkwargs = (kwargs == NULL) ? 0 : PyDict_GET_SIZE(kwargs);
+ if (nargs + nkwargs > len) {
PyErr_Format(PyExc_TypeError,
"%s%s takes at most %d argument%s (%zd given)",
(fname == NULL) ? "function" : fname,
(fname == NULL) ? "" : "()",
len,
(len == 1) ? "" : "s",
- nargs + nkeywords);
+ nargs + nkwargs);
return cleanreturn(0, &freelist);
}
/* convert tuple args and keyword args in same loop, using kwlist to drive process */
for (i = 0; i < len; i++) {
- keyword = kwlist[i];
if (*format == '|') {
if (min != INT_MAX) {
PyErr_SetString(PyExc_SystemError,
@@ -1713,26 +1719,17 @@ vgetargskeywords(PyObject *args, PyObject *keywords, const char *format,
return cleanreturn(0, &freelist);
}
if (!skip) {
- current_arg = NULL;
- if (nkeywords && i >= pos) {
- current_arg = PyDict_GetItemString(keywords, keyword);
- if (!current_arg && PyErr_Occurred()) {
- return cleanreturn(0, &freelist);
- }
+ if (i < nargs) {
+ current_arg = PyTuple_GET_ITEM(args, i);
}
- if (current_arg) {
- --nkeywords;
- if (i < nargs) {
- /* arg present in tuple and in dict */
- PyErr_Format(PyExc_TypeError,
- "Argument given by name ('%s') "
- "and position (%d)",
- keyword, i+1);
- return cleanreturn(0, &freelist);
- }
+ else if (nkwargs && i >= pos) {
+ current_arg = PyDict_GetItemString(kwargs, kwlist[i]);
+ if (current_arg)
+ --nkwargs;
+ }
+ else {
+ current_arg = NULL;
}
- else if (i < nargs)
- current_arg = PyTuple_GET_ITEM(args, i);
if (current_arg) {
msg = convertitem(current_arg, &format, p_va, flags,
@@ -1756,8 +1753,8 @@ vgetargskeywords(PyObject *args, PyObject *keywords, const char *format,
}
else {
PyErr_Format(PyExc_TypeError, "Required argument "
- "'%s' (pos %d) not found",
- keyword, i+1);
+ "'%s' (pos %d) not found",
+ kwlist[i], i+1);
return cleanreturn(0, &freelist);
}
}
@@ -1765,7 +1762,7 @@ vgetargskeywords(PyObject *args, PyObject *keywords, const char *format,
* fulfilled and no keyword args left, with no further
* validation. XXX Maybe skip this in debug build ?
*/
- if (!nkeywords && !skip) {
+ if (!nkwargs && !skip) {
return cleanreturn(1, &freelist);
}
}
@@ -1796,19 +1793,32 @@ vgetargskeywords(PyObject *args, PyObject *keywords, const char *format,
return cleanreturn(0, &freelist);
}
- /* make sure there are no extraneous keyword arguments */
- if (nkeywords > 0) {
- PyObject *key, *value;
- Py_ssize_t pos = 0;
- while (PyDict_Next(keywords, &pos, &key, &value)) {
+ if (nkwargs > 0) {
+ PyObject *key;
+ Py_ssize_t j;
+ /* make sure there are no arguments given by name and position */
+ for (i = pos; i < nargs; i++) {
+ current_arg = PyDict_GetItemString(kwargs, kwlist[i]);
+ if (current_arg) {
+ /* arg present in tuple and in dict */
+ PyErr_Format(PyExc_TypeError,
+ "Argument given by name ('%s') "
+ "and position (%d)",
+ kwlist[i], i+1);
+ return cleanreturn(0, &freelist);
+ }
+ }
+ /* make sure there are no extraneous keyword arguments */
+ j = 0;
+ while (PyDict_Next(kwargs, &j, &key, NULL)) {
int match = 0;
if (!PyUnicode_Check(key)) {
PyErr_SetString(PyExc_TypeError,
"keywords must be strings");
return cleanreturn(0, &freelist);
}
- for (i = 0; i < len; i++) {
- if (*kwlist[i] && _PyUnicode_EqualToASCIIString(key, kwlist[i])) {
+ for (i = pos; i < len; i++) {
+ if (_PyUnicode_EqualToASCIIString(key, kwlist[i])) {
match = 1;
break;
}
@@ -1956,10 +1966,13 @@ parser_clear(struct _PyArg_Parser *parser)
}
static PyObject*
-find_keyword(PyObject *kwnames, PyObject **kwstack, PyObject *key)
+find_keyword(PyObject *kwargs, PyObject *kwnames, PyObject **kwstack, PyObject *key)
{
Py_ssize_t i, nkwargs;
+ if (kwargs != NULL) {
+ return PyDict_GetItem(kwargs, key);
+ }
nkwargs = PyTuple_GET_SIZE(kwnames);
for (i=0; i < nkwargs; i++) {
PyObject *kwname = PyTuple_GET_ITEM(kwnames, i);
@@ -1971,7 +1984,7 @@ find_keyword(PyObject *kwnames, PyObject **kwstack, PyObject *key)
}
if (!PyUnicode_Check(kwname)) {
/* ignore non-string keyword keys:
- an error will be raised above */
+ an error will be raised below */
continue;
}
if (_PyUnicode_EQ(kwname, key)) {
@@ -1983,7 +1996,7 @@ find_keyword(PyObject *kwnames, PyObject **kwstack, PyObject *key)
static int
vgetargskeywordsfast_impl(PyObject **args, Py_ssize_t nargs,
- PyObject *keywords, PyObject *kwnames,
+ PyObject *kwargs, PyObject *kwnames,
struct _PyArg_Parser *parser,
va_list *p_va, int flags)
{
@@ -1994,7 +2007,7 @@ vgetargskeywordsfast_impl(PyObject **args, Py_ssize_t nargs,
const char *msg;
PyObject *keyword;
int i, pos, len;
- Py_ssize_t nkeywords;
+ Py_ssize_t nkwargs;
PyObject *current_arg;
freelistentry_t static_entries[STATIC_FREELIST_ENTRIES];
freelist_t freelist;
@@ -2004,13 +2017,20 @@ vgetargskeywordsfast_impl(PyObject **args, Py_ssize_t nargs,
freelist.first_available = 0;
freelist.entries_malloced = 0;
- assert(keywords == NULL || PyDict_Check(keywords));
- assert(kwnames == NULL || PyTuple_Check(kwnames));
- assert((keywords != NULL || kwnames != NULL)
- || (keywords == NULL && kwnames == NULL));
- assert(parser != NULL);
+ assert(kwargs == NULL || PyDict_Check(kwargs));
+ assert(kwargs == NULL || kwnames == NULL);
assert(p_va != NULL);
+ if (parser == NULL) {
+ PyErr_BadInternalCall();
+ return 0;
+ }
+
+ if (kwnames != NULL && !PyTuple_Check(kwnames)) {
+ PyErr_BadInternalCall();
+ return 0;
+ }
+
if (!parser_init(parser)) {
return 0;
}
@@ -2028,24 +2048,24 @@ vgetargskeywordsfast_impl(PyObject **args, Py_ssize_t nargs,
freelist.entries_malloced = 1;
}
- if (keywords != NULL) {
- nkeywords = PyDict_Size(keywords);
+ if (kwargs != NULL) {
+ nkwargs = PyDict_GET_SIZE(kwargs);
}
else if (kwnames != NULL) {
- nkeywords = PyTuple_GET_SIZE(kwnames);
+ nkwargs = PyTuple_GET_SIZE(kwnames);
kwstack = args + nargs;
}
else {
- nkeywords = 0;
+ nkwargs = 0;
}
- if (nargs + nkeywords > len) {
+ if (nargs + nkwargs > len) {
PyErr_Format(PyExc_TypeError,
"%s%s takes at most %d argument%s (%zd given)",
(parser->fname == NULL) ? "function" : parser->fname,
(parser->fname == NULL) ? "" : "()",
len,
(len == 1) ? "" : "s",
- nargs + nkeywords);
+ nargs + nkwargs);
return cleanreturn(0, &freelist);
}
if (parser->max < nargs) {
@@ -2059,7 +2079,6 @@ vgetargskeywordsfast_impl(PyObject **args, Py_ssize_t nargs,
format = parser->format;
/* convert tuple args and keyword args in same loop, using kwtuple to drive process */
for (i = 0; i < len; i++) {
- keyword = (i >= pos) ? PyTuple_GET_ITEM(kwtuple, i - pos) : NULL;
if (*format == '|') {
format++;
}
@@ -2068,31 +2087,17 @@ vgetargskeywordsfast_impl(PyObject **args, Py_ssize_t nargs,
}
assert(!IS_END_OF_FORMAT(*format));
- current_arg = NULL;
- if (nkeywords && i >= pos) {
- if (keywords != NULL) {
- current_arg = PyDict_GetItem(keywords, keyword);
- if (!current_arg && PyErr_Occurred()) {
- return cleanreturn(0, &freelist);
- }
- }
- else {
- current_arg = find_keyword(kwnames, kwstack, keyword);
- }
+ if (i < nargs) {
+ current_arg = args[i];
}
- if (current_arg) {
- --nkeywords;
- if (i < nargs) {
- /* arg present in tuple and in dict */
- PyErr_Format(PyExc_TypeError,
- "Argument given by name ('%U') "
- "and position (%d)",
- keyword, i+1);
- return cleanreturn(0, &freelist);
- }
+ else if (nkwargs && i >= pos) {
+ keyword = PyTuple_GET_ITEM(kwtuple, i - pos);
+ current_arg = find_keyword(kwargs, kwnames, kwstack, keyword);
+ if (current_arg)
+ --nkwargs;
}
- else if (i < nargs) {
- current_arg = args[i];
+ else {
+ current_arg = NULL;
}
if (current_arg) {
@@ -2108,13 +2113,15 @@ vgetargskeywordsfast_impl(PyObject **args, Py_ssize_t nargs,
if (i < parser->min) {
/* Less arguments than required */
if (i < pos) {
+ Py_ssize_t min = Py_MIN(pos, parser->min);
PyErr_Format(PyExc_TypeError,
"Function takes %s %d positional arguments"
" (%d given)",
- (Py_MIN(pos, parser->min) < parser->max) ? "at least" : "exactly",
- Py_MIN(pos, parser->min), nargs);
+ min < parser->max ? "at least" : "exactly",
+ min, nargs);
}
else {
+ keyword = PyTuple_GET_ITEM(kwtuple, i - pos);
PyErr_Format(PyExc_TypeError, "Required argument "
"'%U' (pos %d) not found",
keyword, i+1);
@@ -2125,7 +2132,7 @@ vgetargskeywordsfast_impl(PyObject **args, Py_ssize_t nargs,
* fulfilled and no keyword args left, with no further
* validation. XXX Maybe skip this in debug build ?
*/
- if (!nkeywords) {
+ if (!nkwargs) {
return cleanreturn(1, &freelist);
}
@@ -2137,54 +2144,50 @@ vgetargskeywordsfast_impl(PyObject **args, Py_ssize_t nargs,
assert(IS_END_OF_FORMAT(*format) || (*format == '|') || (*format == '$'));
- /* make sure there are no extraneous keyword arguments */
- if (nkeywords > 0) {
- if (keywords != NULL) {
- PyObject *key, *value;
- Py_ssize_t pos = 0;
- while (PyDict_Next(keywords, &pos, &key, &value)) {
- int match;
- if (!PyUnicode_Check(key)) {
- PyErr_SetString(PyExc_TypeError,
- "keywords must be strings");
- return cleanreturn(0, &freelist);
- }
- match = PySequence_Contains(kwtuple, key);
- if (match <= 0) {
- if (!match) {
- PyErr_Format(PyExc_TypeError,
- "'%U' is an invalid keyword "
- "argument for this function",
- key);
- }
- return cleanreturn(0, &freelist);
- }
+ if (nkwargs > 0) {
+ Py_ssize_t j;
+ /* make sure there are no arguments given by name and position */
+ for (i = pos; i < nargs; i++) {
+ keyword = PyTuple_GET_ITEM(kwtuple, i - pos);
+ current_arg = find_keyword(kwargs, kwnames, kwstack, keyword);
+ if (current_arg) {
+ /* arg present in tuple and in dict */
+ PyErr_Format(PyExc_TypeError,
+ "Argument given by name ('%U') "
+ "and position (%d)",
+ keyword, i+1);
+ return cleanreturn(0, &freelist);
}
}
- else {
- Py_ssize_t j, nkwargs;
-
- nkwargs = PyTuple_GET_SIZE(kwnames);
- for (j=0; j < nkwargs; j++) {
- PyObject *key = PyTuple_GET_ITEM(kwnames, j);
- int match;
-
- if (!PyUnicode_Check(key)) {
- PyErr_SetString(PyExc_TypeError,
- "keywords must be strings");
- return cleanreturn(0, &freelist);
- }
+ /* make sure there are no extraneous keyword arguments */
+ j = 0;
+ while (1) {
+ int match;
+ if (kwargs != NULL) {
+ if (!PyDict_Next(kwargs, &j, &keyword, NULL))
+ break;
+ }
+ else {
+ if (j >= PyTuple_GET_SIZE(kwnames))
+ break;
+ keyword = PyTuple_GET_ITEM(kwnames, j);
+ j++;
+ }
- match = PySequence_Contains(kwtuple, key);
- if (match <= 0) {
- if (!match) {
- PyErr_Format(PyExc_TypeError,
- "'%U' is an invalid keyword "
- "argument for this function",
- key);
- }
- return cleanreturn(0, &freelist);
+ if (!PyUnicode_Check(keyword)) {
+ PyErr_SetString(PyExc_TypeError,
+ "keywords must be strings");
+ return cleanreturn(0, &freelist);
+ }
+ match = PySequence_Contains(kwtuple, keyword);
+ if (match <= 0) {
+ if (!match) {
+ PyErr_Format(PyExc_TypeError,
+ "'%U' is an invalid keyword "
+ "argument for this function",
+ keyword);
}
+ return cleanreturn(0, &freelist);
}
}
}
@@ -2199,7 +2202,13 @@ vgetargskeywordsfast(PyObject *args, PyObject *keywords,
PyObject **stack;
Py_ssize_t nargs;
- assert(args != NULL && PyTuple_Check(args));
+ if (args == NULL
+ || !PyTuple_Check(args)
+ || (keywords != NULL && !PyDict_Check(keywords)))
+ {
+ PyErr_BadInternalCall();
+ return 0;
+ }
stack = &PyTuple_GET_ITEM(args, 0);
nargs = PyTuple_GET_SIZE(args);
@@ -2342,65 +2351,104 @@ err:
}
-int
-PyArg_UnpackTuple(PyObject *args, const char *name, Py_ssize_t min, Py_ssize_t max, ...)
+static int
+unpack_stack(PyObject **args, Py_ssize_t nargs, const char *name,
+ Py_ssize_t min, Py_ssize_t max, va_list vargs)
{
- Py_ssize_t i, l;
+ Py_ssize_t i;
PyObject **o;
- va_list vargs;
assert(min >= 0);
assert(min <= max);
- if (!PyTuple_Check(args)) {
- PyErr_SetString(PyExc_SystemError,
- "PyArg_UnpackTuple() argument list is not a tuple");
- return 0;
- }
- l = PyTuple_GET_SIZE(args);
- if (l < min) {
+
+ if (nargs < min) {
if (name != NULL)
PyErr_Format(
PyExc_TypeError,
"%s expected %s%zd arguments, got %zd",
- name, (min == max ? "" : "at least "), min, l);
+ name, (min == max ? "" : "at least "), min, nargs);
else
PyErr_Format(
PyExc_TypeError,
"unpacked tuple should have %s%zd elements,"
" but has %zd",
- (min == max ? "" : "at least "), min, l);
+ (min == max ? "" : "at least "), min, nargs);
return 0;
}
- if (l == 0)
+
+ if (nargs == 0) {
return 1;
- if (l > max) {
+ }
+
+ if (nargs > max) {
if (name != NULL)
PyErr_Format(
PyExc_TypeError,
"%s expected %s%zd arguments, got %zd",
- name, (min == max ? "" : "at most "), max, l);
+ name, (min == max ? "" : "at most "), max, nargs);
else
PyErr_Format(
PyExc_TypeError,
"unpacked tuple should have %s%zd elements,"
" but has %zd",
- (min == max ? "" : "at most "), max, l);
+ (min == max ? "" : "at most "), max, nargs);
+ return 0;
+ }
+
+ for (i = 0; i < nargs; i++) {
+ o = va_arg(vargs, PyObject **);
+ *o = args[i];
+ }
+ return 1;
+}
+
+int
+PyArg_UnpackTuple(PyObject *args, const char *name, Py_ssize_t min, Py_ssize_t max, ...)
+{
+ PyObject **stack;
+ Py_ssize_t nargs;
+ int retval;
+ va_list vargs;
+
+ if (!PyTuple_Check(args)) {
+ PyErr_SetString(PyExc_SystemError,
+ "PyArg_UnpackTuple() argument list is not a tuple");
return 0;
}
+ stack = &PyTuple_GET_ITEM(args, 0);
+ nargs = PyTuple_GET_SIZE(args);
#ifdef HAVE_STDARG_PROTOTYPES
va_start(vargs, max);
#else
va_start(vargs);
#endif
- for (i = 0; i < l; i++) {
- o = va_arg(vargs, PyObject **);
- *o = PyTuple_GET_ITEM(args, i);
- }
+ retval = unpack_stack(stack, nargs, name, min, max, vargs);
va_end(vargs);
- return 1;
+ return retval;
}
+int
+_PyArg_UnpackStack(PyObject **args, Py_ssize_t nargs, const char *name,
+ Py_ssize_t min, Py_ssize_t max, ...)
+{
+ int retval;
+ va_list vargs;
+
+#ifdef HAVE_STDARG_PROTOTYPES
+ va_start(vargs, max);
+#else
+ va_start(vargs);
+#endif
+ retval = unpack_stack(args, nargs, name, min, max, vargs);
+ va_end(vargs);
+ return retval;
+}
+
+
+#undef _PyArg_NoKeywords
+#undef _PyArg_NoStackKeywords
+#undef _PyArg_NoPositional
/* For type constructors that don't take keyword args
*
@@ -2408,16 +2456,35 @@ PyArg_UnpackTuple(PyObject *args, const char *name, Py_ssize_t min, Py_ssize_t m
* not empty, returns 1 otherwise
*/
int
-_PyArg_NoKeywords(const char *funcname, PyObject *kw)
+_PyArg_NoKeywords(const char *funcname, PyObject *kwargs)
{
- if (kw == NULL)
+ if (kwargs == NULL) {
return 1;
- if (!PyDict_CheckExact(kw)) {
+ }
+ if (!PyDict_CheckExact(kwargs)) {
PyErr_BadInternalCall();
return 0;
}
- if (PyDict_Size(kw) == 0)
+ if (PyDict_GET_SIZE(kwargs) == 0) {
return 1;
+ }
+
+ PyErr_Format(PyExc_TypeError, "%s does not take keyword arguments",
+ funcname);
+ return 0;
+}
+
+
+int
+_PyArg_NoStackKeywords(const char *funcname, PyObject *kwnames)
+{
+ if (kwnames == NULL) {
+ return 1;
+ }
+ assert(PyTuple_CheckExact(kwnames));
+ if (PyTuple_GET_SIZE(kwnames) == 0) {
+ return 1;
+ }
PyErr_Format(PyExc_TypeError, "%s does not take keyword arguments",
funcname);
diff --git a/Python/import.c b/Python/import.c
index cd865a5423..53c0f4defb 100644
--- a/Python/import.c
+++ b/Python/import.c
@@ -260,8 +260,7 @@ _imp_acquire_lock_impl(PyObject *module)
#ifdef WITH_THREAD
_PyImport_AcquireLock();
#endif
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
/*[clinic input]
@@ -283,8 +282,7 @@ _imp_release_lock_impl(PyObject *module)
return NULL;
}
#endif
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
void
@@ -1035,7 +1033,7 @@ _imp_create_builtin(PyObject *module, PyObject *spec)
{
struct _inittab *p;
PyObject *name;
- char *namestr;
+ const char *namestr;
PyObject *mod;
name = PyObject_GetAttrString(spec, "name");
@@ -1705,7 +1703,7 @@ PyImport_ReloadModule(PyObject *m)
Py_INCREF(imp);
}
- reloaded_module = _PyObject_CallMethodId(imp, &PyId_reload, "O", m);
+ reloaded_module = _PyObject_CallMethodIdObjArgs(imp, &PyId_reload, m, NULL);
Py_DECREF(imp);
return reloaded_module;
}
@@ -1853,8 +1851,7 @@ _imp_init_frozen_impl(PyObject *module, PyObject *name)
if (ret < 0)
return NULL;
if (ret == 0) {
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
m = PyImport_AddModuleObject(name);
Py_XINCREF(m);
@@ -2045,11 +2042,6 @@ _imp_exec_builtin_impl(PyObject *module, PyObject *mod)
return exec_builtin_or_dynamic(mod);
}
-/*[clinic input]
-dump buffer
-[clinic start generated code]*/
-/*[clinic end generated code: output=da39a3ee5e6b4b0d input=524ce2e021e4eba6]*/
-
PyDoc_STRVAR(doc_imp,
"(Extremely) low-level import machinery bits as used by importlib and imp.");
diff --git a/Python/importdl.c b/Python/importdl.c
index f56fa94cc4..d8656b9433 100644
--- a/Python/importdl.c
+++ b/Python/importdl.c
@@ -94,7 +94,7 @@ _PyImport_LoadDynamicModuleWithSpec(PyObject *spec, FILE *fp)
#endif
PyObject *name_unicode = NULL, *name = NULL, *path = NULL, *m = NULL;
const char *name_buf, *hook_prefix;
- char *oldcontext;
+ const char *oldcontext;
dl_funcptr exportfunc;
PyModuleDef *def;
PyObject *(*p0)(void);
diff --git a/Python/importlib.h b/Python/importlib.h
index 195fbfd13b..0c1537e6b7 100644
--- a/Python/importlib.h
+++ b/Python/importlib.h
@@ -56,7 +56,7 @@ const unsigned char _Py_M__importlib[] = {
67,0,0,0,115,60,0,0,0,120,40,100,6,68,0,93,
32,125,2,116,0,124,1,124,2,131,2,114,6,116,1,124,
0,124,2,116,2,124,1,124,2,131,2,131,3,1,0,113,
- 6,87,0,124,0,106,3,106,4,124,1,106,3,131,1,1,
+ 6,87,0,124,0,106,3,160,4,124,1,106,3,161,1,1,
0,100,5,83,0,41,7,122,47,83,105,109,112,108,101,32,
115,117,98,115,116,105,116,117,116,101,32,102,111,114,32,102,
117,110,99,116,111,111,108,115,46,117,112,100,97,116,101,95,
@@ -105,8 +105,8 @@ const unsigned char _Py_M__importlib[] = {
32,32,116,97,107,101,32,108,111,99,107,115,32,66,32,116,
104,101,110,32,65,41,46,10,32,32,32,32,99,2,0,0,
0,0,0,0,0,2,0,0,0,2,0,0,0,67,0,0,
- 0,115,48,0,0,0,116,0,106,1,131,0,124,0,95,2,
- 116,0,106,1,131,0,124,0,95,3,124,1,124,0,95,4,
+ 0,115,48,0,0,0,116,0,160,1,161,0,124,0,95,2,
+ 116,0,160,1,161,0,124,0,95,3,124,1,124,0,95,4,
100,0,124,0,95,5,100,1,124,0,95,6,100,1,124,0,
95,7,100,0,83,0,41,2,78,233,0,0,0,0,41,8,
218,7,95,116,104,114,101,97,100,90,13,97,108,108,111,99,
@@ -119,9 +119,9 @@ const unsigned char _Py_M__importlib[] = {
0,0,1,10,1,10,1,6,1,6,1,6,1,122,20,95,
77,111,100,117,108,101,76,111,99,107,46,95,95,105,110,105,
116,95,95,99,1,0,0,0,0,0,0,0,4,0,0,0,
- 2,0,0,0,67,0,0,0,115,64,0,0,0,116,0,106,
- 1,131,0,125,1,124,0,106,2,125,2,120,44,116,3,106,
- 4,124,2,131,1,125,3,124,3,100,0,107,8,114,38,100,
+ 3,0,0,0,67,0,0,0,115,64,0,0,0,116,0,160,
+ 1,161,0,125,1,124,0,106,2,125,2,120,44,116,3,160,
+ 4,124,2,161,1,125,3,124,3,100,0,107,8,114,38,100,
1,83,0,124,3,106,2,125,2,124,2,124,1,107,2,114,
16,100,2,83,0,113,16,87,0,100,0,83,0,41,3,78,
70,84,41,5,114,20,0,0,0,218,9,103,101,116,95,105,
@@ -134,16 +134,16 @@ const unsigned char _Py_M__importlib[] = {
1,8,1,4,1,6,1,8,1,122,24,95,77,111,100,117,
108,101,76,111,99,107,46,104,97,115,95,100,101,97,100,108,
111,99,107,99,1,0,0,0,0,0,0,0,2,0,0,0,
- 16,0,0,0,67,0,0,0,115,168,0,0,0,116,0,106,
- 1,131,0,125,1,124,0,116,2,124,1,60,0,122,138,120,
+ 16,0,0,0,67,0,0,0,115,168,0,0,0,116,0,160,
+ 1,161,0,125,1,124,0,116,2,124,1,60,0,122,138,120,
132,124,0,106,3,143,96,1,0,124,0,106,4,100,1,107,
2,115,48,124,0,106,5,124,1,107,2,114,72,124,1,124,
0,95,5,124,0,4,0,106,4,100,2,55,0,2,0,95,
- 4,100,3,83,0,124,0,106,6,131,0,114,92,116,7,100,
- 4,124,0,22,0,131,1,130,1,124,0,106,8,106,9,100,
- 5,131,1,114,118,124,0,4,0,106,10,100,2,55,0,2,
+ 4,100,3,83,0,124,0,160,6,161,0,114,92,116,7,100,
+ 4,124,0,22,0,131,1,130,1,124,0,106,8,160,9,100,
+ 5,161,1,114,118,124,0,4,0,106,10,100,2,55,0,2,
0,95,10,87,0,100,6,81,0,82,0,88,0,124,0,106,
- 8,106,9,131,0,1,0,124,0,106,8,106,11,131,0,1,
+ 8,160,9,161,0,1,0,124,0,106,8,160,11,161,0,1,
0,113,20,87,0,87,0,100,6,116,2,124,1,61,0,88,
0,100,6,83,0,41,7,122,185,10,32,32,32,32,32,32,
32,32,65,99,113,117,105,114,101,32,116,104,101,32,109,111,
@@ -171,13 +171,13 @@ const unsigned char _Py_M__importlib[] = {
1,24,2,10,1,18,2,122,19,95,77,111,100,117,108,101,
76,111,99,107,46,97,99,113,117,105,114,101,99,1,0,0,
0,0,0,0,0,2,0,0,0,10,0,0,0,67,0,0,
- 0,115,122,0,0,0,116,0,106,1,131,0,125,1,124,0,
+ 0,115,122,0,0,0,116,0,160,1,161,0,125,1,124,0,
106,2,143,98,1,0,124,0,106,3,124,1,107,3,114,34,
116,4,100,1,131,1,130,1,124,0,106,5,100,2,107,4,
115,48,116,6,130,1,124,0,4,0,106,5,100,3,56,0,
2,0,95,5,124,0,106,5,100,2,107,2,114,108,100,0,
124,0,95,3,124,0,106,7,114,108,124,0,4,0,106,7,
- 100,3,56,0,2,0,95,7,124,0,106,8,106,9,131,0,
+ 100,3,56,0,2,0,95,7,124,0,106,8,160,9,161,0,
1,0,87,0,100,0,81,0,82,0,88,0,100,0,83,0,
41,4,78,122,31,99,97,110,110,111,116,32,114,101,108,101,
97,115,101,32,117,110,45,97,99,113,117,105,114,101,100,32,
@@ -192,9 +192,9 @@ const unsigned char _Py_M__importlib[] = {
1,8,1,8,1,10,1,8,1,14,1,14,1,10,1,6,
1,6,1,14,1,122,19,95,77,111,100,117,108,101,76,111,
99,107,46,114,101,108,101,97,115,101,99,1,0,0,0,0,
- 0,0,0,1,0,0,0,4,0,0,0,67,0,0,0,115,
- 18,0,0,0,100,1,106,0,124,0,106,1,116,2,124,0,
- 131,1,131,2,83,0,41,2,78,122,23,95,77,111,100,117,
+ 0,0,0,1,0,0,0,5,0,0,0,67,0,0,0,115,
+ 18,0,0,0,100,1,160,0,124,0,106,1,116,2,124,0,
+ 131,1,161,2,83,0,41,2,78,122,23,95,77,111,100,117,
108,101,76,111,99,107,40,123,33,114,125,41,32,97,116,32,
123,125,41,3,218,6,102,111,114,109,97,116,114,15,0,0,
0,218,2,105,100,41,1,114,26,0,0,0,114,10,0,0,
@@ -247,9 +247,9 @@ const unsigned char _Py_M__importlib[] = {
0,114,35,0,0,0,131,0,0,0,115,6,0,0,0,0,
1,10,1,8,1,122,24,95,68,117,109,109,121,77,111,100,
117,108,101,76,111,99,107,46,114,101,108,101,97,115,101,99,
- 1,0,0,0,0,0,0,0,1,0,0,0,4,0,0,0,
- 67,0,0,0,115,18,0,0,0,100,1,106,0,124,0,106,
- 1,116,2,124,0,131,1,131,2,83,0,41,2,78,122,28,
+ 1,0,0,0,0,0,0,0,1,0,0,0,5,0,0,0,
+ 67,0,0,0,115,18,0,0,0,100,1,160,0,124,0,106,
+ 1,116,2,124,0,131,1,161,2,83,0,41,2,78,122,28,
95,68,117,109,109,121,77,111,100,117,108,101,76,111,99,107,
40,123,33,114,125,41,32,97,116,32,123,125,41,3,114,38,
0,0,0,114,15,0,0,0,114,39,0,0,0,41,1,114,
@@ -277,10 +277,10 @@ const unsigned char _Py_M__importlib[] = {
4,0,0,0,0,1,6,1,122,27,95,77,111,100,117,108,
101,76,111,99,107,77,97,110,97,103,101,114,46,95,95,105,
110,105,116,95,95,99,1,0,0,0,0,0,0,0,1,0,
- 0,0,10,0,0,0,67,0,0,0,115,42,0,0,0,122,
+ 0,0,11,0,0,0,67,0,0,0,115,42,0,0,0,122,
16,116,0,124,0,106,1,131,1,124,0,95,2,87,0,100,
- 0,116,3,106,4,131,0,1,0,88,0,124,0,106,2,106,
- 5,131,0,1,0,100,0,83,0,41,1,78,41,6,218,16,
+ 0,116,3,160,4,161,0,1,0,88,0,124,0,106,2,160,
+ 5,161,0,1,0,100,0,83,0,41,1,78,41,6,218,16,
95,103,101,116,95,109,111,100,117,108,101,95,108,111,99,107,
114,43,0,0,0,114,44,0,0,0,218,4,95,105,109,112,
218,12,114,101,108,101,97,115,101,95,108,111,99,107,114,34,
@@ -290,8 +290,8 @@ const unsigned char _Py_M__importlib[] = {
1,16,2,10,1,122,28,95,77,111,100,117,108,101,76,111,
99,107,77,97,110,97,103,101,114,46,95,95,101,110,116,101,
114,95,95,99,1,0,0,0,0,0,0,0,3,0,0,0,
- 1,0,0,0,79,0,0,0,115,14,0,0,0,124,0,106,
- 0,106,1,131,0,1,0,100,0,83,0,41,1,78,41,2,
+ 2,0,0,0,79,0,0,0,115,14,0,0,0,124,0,106,
+ 0,160,1,161,0,1,0,100,0,83,0,41,1,78,41,2,
114,44,0,0,0,114,35,0,0,0,41,3,114,26,0,0,
0,218,4,97,114,103,115,90,6,107,119,97,114,103,115,114,
10,0,0,0,114,10,0,0,0,114,11,0,0,0,218,8,
@@ -303,14 +303,14 @@ const unsigned char _Py_M__importlib[] = {
0,114,10,0,0,0,114,10,0,0,0,114,10,0,0,0,
114,11,0,0,0,114,42,0,0,0,140,0,0,0,115,6,
0,0,0,8,2,8,4,8,7,114,42,0,0,0,99,1,
- 0,0,0,0,0,0,0,3,0,0,0,11,0,0,0,3,
+ 0,0,0,0,0,0,0,3,0,0,0,12,0,0,0,3,
0,0,0,115,106,0,0,0,100,1,125,1,121,14,116,0,
136,0,25,0,131,0,125,1,87,0,110,20,4,0,116,1,
107,10,114,38,1,0,1,0,1,0,89,0,110,2,88,0,
124,1,100,1,107,8,114,102,116,2,100,1,107,8,114,66,
116,3,136,0,131,1,125,1,110,8,116,4,136,0,131,1,
125,1,135,0,102,1,100,2,100,3,132,8,125,2,116,5,
- 106,6,124,1,124,2,131,2,116,0,136,0,60,0,124,1,
+ 160,6,124,1,124,2,161,2,116,0,136,0,60,0,124,1,
83,0,41,4,122,109,71,101,116,32,111,114,32,99,114,101,
97,116,101,32,116,104,101,32,109,111,100,117,108,101,32,108,
111,99,107,32,102,111,114,32,97,32,103,105,118,101,110,32,
@@ -335,10 +335,10 @@ const unsigned char _Py_M__importlib[] = {
4,1,2,1,14,1,14,1,6,1,8,1,8,1,10,2,
8,1,12,2,16,1,114,45,0,0,0,99,1,0,0,0,
0,0,0,0,2,0,0,0,11,0,0,0,67,0,0,0,
- 115,62,0,0,0,116,0,124,0,131,1,125,1,116,1,106,
- 2,131,0,1,0,121,12,124,1,106,3,131,0,1,0,87,
+ 115,62,0,0,0,116,0,124,0,131,1,125,1,116,1,160,
+ 2,161,0,1,0,121,12,124,1,160,3,161,0,1,0,87,
0,110,20,4,0,116,4,107,10,114,48,1,0,1,0,1,
- 0,89,0,110,10,88,0,124,1,106,5,131,0,1,0,100,
+ 0,89,0,110,10,88,0,124,1,160,5,161,0,1,0,100,
1,83,0,41,2,97,21,1,0,0,82,101,108,101,97,115,
101,32,116,104,101,32,103,108,111,98,97,108,32,105,109,112,
111,114,116,32,108,111,99,107,44,32,97,110,100,32,97,99,
@@ -393,8 +393,8 @@ const unsigned char _Py_M__importlib[] = {
58,0,0,0,114,33,0,0,0,41,1,218,9,118,101,114,
98,111,115,105,116,121,99,1,0,0,0,1,0,0,0,3,
0,0,0,5,0,0,0,71,0,0,0,115,54,0,0,0,
- 116,0,106,1,106,2,124,1,107,5,114,50,124,0,106,3,
- 100,6,131,1,115,30,100,3,124,0,23,0,125,0,116,4,
+ 116,0,106,1,106,2,124,1,107,5,114,50,124,0,160,3,
+ 100,6,161,1,115,30,100,3,124,0,23,0,125,0,116,4,
124,0,106,5,124,2,142,0,116,0,106,6,100,4,141,2,
1,0,100,5,83,0,41,7,122,61,80,114,105,110,116,32,
116,104,101,32,109,101,115,115,97,103,101,32,116,111,32,115,
@@ -420,7 +420,7 @@ const unsigned char _Py_M__importlib[] = {
117,105,108,116,45,105,110,46,99,2,0,0,0,0,0,0,
0,2,0,0,0,4,0,0,0,19,0,0,0,115,38,0,
0,0,124,1,116,0,106,1,107,7,114,28,116,2,100,1,
- 106,3,124,1,131,1,124,1,100,2,141,2,130,1,136,0,
+ 160,3,124,1,161,1,124,1,100,2,141,2,130,1,136,0,
124,0,124,1,131,2,83,0,41,3,78,122,29,123,33,114,
125,32,105,115,32,110,111,116,32,97,32,98,117,105,108,116,
45,105,110,32,109,111,100,117,108,101,41,1,114,15,0,0,
@@ -448,8 +448,8 @@ const unsigned char _Py_M__importlib[] = {
97,109,101,100,32,109,111,100,117,108,101,32,105,115,32,102,
114,111,122,101,110,46,99,2,0,0,0,0,0,0,0,2,
0,0,0,4,0,0,0,19,0,0,0,115,38,0,0,0,
- 116,0,106,1,124,1,131,1,115,28,116,2,100,1,106,3,
- 124,1,131,1,124,1,100,2,141,2,130,1,136,0,124,0,
+ 116,0,160,1,124,1,161,1,115,28,116,2,100,1,160,3,
+ 124,1,161,1,124,1,100,2,141,2,130,1,136,0,124,0,
124,1,131,2,83,0,41,3,78,122,27,123,33,114,125,32,
105,115,32,110,111,116,32,97,32,102,114,111,122,101,110,32,
109,111,100,117,108,101,41,1,114,15,0,0,0,41,4,114,
@@ -489,10 +489,10 @@ const unsigned char _Py_M__importlib[] = {
114,11,0,0,0,218,17,95,108,111,97,100,95,109,111,100,
117,108,101,95,115,104,105,109,239,0,0,0,115,12,0,0,
0,0,6,10,1,10,1,10,1,10,1,10,2,114,84,0,
- 0,0,99,1,0,0,0,0,0,0,0,5,0,0,0,35,
+ 0,0,99,1,0,0,0,0,0,0,0,5,0,0,0,36,
0,0,0,67,0,0,0,115,216,0,0,0,116,0,124,0,
100,1,100,0,131,3,125,1,116,1,124,1,100,2,131,2,
- 114,54,121,10,124,1,106,2,124,0,131,1,83,0,4,0,
+ 114,54,121,10,124,1,160,2,124,0,161,1,83,0,4,0,
116,3,107,10,114,52,1,0,1,0,1,0,89,0,110,2,
88,0,121,10,124,0,106,4,125,2,87,0,110,20,4,0,
116,5,107,10,114,84,1,0,1,0,1,0,89,0,110,18,
@@ -501,9 +501,9 @@ const unsigned char _Py_M__importlib[] = {
116,5,107,10,114,136,1,0,1,0,1,0,100,3,125,3,
89,0,110,2,88,0,121,10,124,0,106,8,125,4,87,0,
110,50,4,0,116,5,107,10,114,198,1,0,1,0,1,0,
- 124,1,100,0,107,8,114,182,100,4,106,9,124,3,131,1,
- 83,0,100,5,106,9,124,3,124,1,131,2,83,0,89,0,
- 110,14,88,0,100,6,106,9,124,3,124,4,131,2,83,0,
+ 124,1,100,0,107,8,114,182,100,4,160,9,124,3,161,1,
+ 83,0,100,5,160,9,124,3,124,1,161,2,83,0,89,0,
+ 110,14,88,0,100,6,160,9,124,3,124,4,161,2,83,0,
100,0,83,0,41,7,78,218,10,95,95,108,111,97,100,101,
114,95,95,218,11,109,111,100,117,108,101,95,114,101,112,114,
250,1,63,122,13,60,109,111,100,117,108,101,32,123,33,114,
@@ -702,14 +702,14 @@ const unsigned char _Py_M__importlib[] = {
27,0,0,0,99,1,0,0,115,14,0,0,0,0,2,6,
1,6,1,6,1,6,1,14,3,6,1,122,19,77,111,100,
117,108,101,83,112,101,99,46,95,95,105,110,105,116,95,95,
- 99,1,0,0,0,0,0,0,0,2,0,0,0,4,0,0,
- 0,67,0,0,0,115,102,0,0,0,100,1,106,0,124,0,
- 106,1,131,1,100,2,106,0,124,0,106,2,131,1,103,2,
- 125,1,124,0,106,3,100,0,107,9,114,52,124,1,106,4,
- 100,3,106,0,124,0,106,3,131,1,131,1,1,0,124,0,
- 106,5,100,0,107,9,114,80,124,1,106,4,100,4,106,0,
- 124,0,106,5,131,1,131,1,1,0,100,5,106,0,124,0,
- 106,6,106,7,100,6,106,8,124,1,131,1,131,2,83,0,
+ 99,1,0,0,0,0,0,0,0,2,0,0,0,6,0,0,
+ 0,67,0,0,0,115,102,0,0,0,100,1,160,0,124,0,
+ 106,1,161,1,100,2,160,0,124,0,106,2,161,1,103,2,
+ 125,1,124,0,106,3,100,0,107,9,114,52,124,1,160,4,
+ 100,3,160,0,124,0,106,3,161,1,161,1,1,0,124,0,
+ 106,5,100,0,107,9,114,80,124,1,160,4,100,4,160,0,
+ 124,0,106,5,161,1,161,1,1,0,100,5,160,0,124,0,
+ 106,6,106,7,100,6,160,8,124,1,161,1,161,2,83,0,
41,7,78,122,9,110,97,109,101,61,123,33,114,125,122,11,
108,111,97,100,101,114,61,123,33,114,125,122,11,111,114,105,
103,105,110,61,123,33,114,125,122,29,115,117,98,109,111,100,
@@ -741,11 +741,11 @@ const unsigned char _Py_M__importlib[] = {
0,0,0,0,1,6,1,2,1,12,1,12,1,12,1,10,
1,12,1,12,1,14,1,122,17,77,111,100,117,108,101,83,
112,101,99,46,95,95,101,113,95,95,99,1,0,0,0,0,
- 0,0,0,1,0,0,0,2,0,0,0,67,0,0,0,115,
+ 0,0,0,1,0,0,0,3,0,0,0,67,0,0,0,115,
58,0,0,0,124,0,106,0,100,0,107,8,114,52,124,0,
106,1,100,0,107,9,114,52,124,0,106,2,114,52,116,3,
- 100,0,107,8,114,38,116,4,130,1,116,3,106,5,124,0,
- 106,1,131,1,124,0,95,0,124,0,106,0,83,0,41,1,
+ 100,0,107,8,114,38,116,4,130,1,116,3,160,5,124,0,
+ 106,1,161,1,124,0,95,0,124,0,106,0,83,0,41,1,
78,41,6,114,108,0,0,0,114,103,0,0,0,114,107,0,
0,0,218,19,95,98,111,111,116,115,116,114,97,112,95,101,
120,116,101,114,110,97,108,218,19,78,111,116,73,109,112,108,
@@ -761,9 +761,9 @@ const unsigned char _Py_M__importlib[] = {
0,114,112,0,0,0,114,10,0,0,0,114,10,0,0,0,
114,11,0,0,0,114,112,0,0,0,142,1,0,0,115,2,
0,0,0,0,2,99,1,0,0,0,0,0,0,0,1,0,
- 0,0,2,0,0,0,67,0,0,0,115,36,0,0,0,124,
- 0,106,0,100,1,107,8,114,26,124,0,106,1,106,2,100,
- 2,131,1,100,3,25,0,83,0,124,0,106,1,83,0,100,
+ 0,0,3,0,0,0,67,0,0,0,115,36,0,0,0,124,
+ 0,106,0,100,1,107,8,114,26,124,0,106,1,160,2,100,
+ 2,161,1,100,3,25,0,83,0,124,0,106,1,83,0,100,
1,83,0,41,4,122,32,84,104,101,32,110,97,109,101,32,
111,102,32,116,104,101,32,109,111,100,117,108,101,39,115,32,
112,97,114,101,110,116,46,78,218,1,46,114,19,0,0,0,
@@ -801,8 +801,8 @@ const unsigned char _Py_M__importlib[] = {
48,124,4,124,0,124,1,100,3,141,2,83,0,124,3,114,
56,103,0,110,2,100,2,125,5,124,4,124,0,124,1,124,
5,100,4,141,3,83,0,124,3,100,2,107,8,114,138,116,
- 0,124,1,100,5,131,2,114,134,121,14,124,1,106,4,124,
- 0,131,1,125,3,87,0,113,138,4,0,116,5,107,10,114,
+ 0,124,1,100,5,131,2,114,134,121,14,124,1,160,4,124,
+ 0,161,1,125,3,87,0,113,138,4,0,116,5,107,10,114,
130,1,0,1,0,1,0,100,2,125,3,89,0,113,138,88,
0,110,4,100,6,125,3,116,6,124,0,124,1,124,2,124,
3,100,7,141,4,83,0,41,8,122,53,82,101,116,117,114,
@@ -869,7 +869,7 @@ const unsigned char _Py_M__importlib[] = {
124,1,100,2,100,0,131,3,100,0,107,8,114,166,124,0,
106,4,125,3,124,3,100,0,107,8,114,134,124,0,106,5,
100,0,107,9,114,134,116,6,100,0,107,8,114,110,116,7,
- 130,1,116,6,106,8,125,4,124,4,106,9,124,4,131,1,
+ 130,1,116,6,106,8,125,4,124,4,160,9,124,4,161,1,
125,3,124,0,106,5,124,3,95,10,121,10,124,3,124,1,
95,11,87,0,110,20,4,0,116,3,107,10,114,164,1,0,
1,0,1,0,89,0,110,2,88,0,124,2,115,186,116,0,
@@ -915,7 +915,7 @@ const unsigned char _Py_M__importlib[] = {
6,1,114,133,0,0,0,99,1,0,0,0,0,0,0,0,
2,0,0,0,3,0,0,0,67,0,0,0,115,82,0,0,
0,100,1,125,1,116,0,124,0,106,1,100,2,131,2,114,
- 30,124,0,106,1,106,2,124,0,131,1,125,1,110,20,116,
+ 30,124,0,106,1,160,2,124,0,161,1,125,1,110,20,116,
0,124,0,106,1,100,3,131,2,114,50,116,3,100,4,131,
1,130,1,124,1,100,1,107,8,114,68,116,4,124,0,106,
5,131,1,125,1,116,6,124,0,124,1,131,2,1,0,124,
@@ -936,14 +936,14 @@ const unsigned char _Py_M__importlib[] = {
95,115,112,101,99,41,2,0,0,115,18,0,0,0,0,3,
4,1,12,3,14,1,12,1,8,2,8,1,10,1,10,1,
114,136,0,0,0,99,1,0,0,0,0,0,0,0,2,0,
- 0,0,3,0,0,0,67,0,0,0,115,106,0,0,0,124,
+ 0,0,4,0,0,0,67,0,0,0,115,106,0,0,0,124,
0,106,0,100,1,107,8,114,14,100,2,110,4,124,0,106,
0,125,1,124,0,106,1,100,1,107,8,114,66,124,0,106,
- 2,100,1,107,8,114,50,100,3,106,3,124,1,131,1,83,
- 0,100,4,106,3,124,1,124,0,106,2,131,2,83,0,110,
- 36,124,0,106,4,114,86,100,5,106,3,124,1,124,0,106,
- 1,131,2,83,0,100,6,106,3,124,0,106,0,124,0,106,
- 1,131,2,83,0,100,1,83,0,41,7,122,38,82,101,116,
+ 2,100,1,107,8,114,50,100,3,160,3,124,1,161,1,83,
+ 0,100,4,160,3,124,1,124,0,106,2,161,2,83,0,110,
+ 36,124,0,106,4,114,86,100,5,160,3,124,1,124,0,106,
+ 1,161,2,83,0,100,6,160,3,124,0,106,0,124,0,106,
+ 1,161,2,83,0,100,1,83,0,41,7,122,38,82,101,116,
117,114,110,32,116,104,101,32,114,101,112,114,32,116,111,32,
117,115,101,32,102,111,114,32,116,104,101,32,109,111,100,117,
108,101,46,78,114,87,0,0,0,122,13,60,109,111,100,117,
@@ -959,17 +959,17 @@ const unsigned char _Py_M__importlib[] = {
3,20,1,10,1,10,1,10,2,16,2,6,1,14,2,114,
91,0,0,0,99,2,0,0,0,0,0,0,0,4,0,0,
0,12,0,0,0,67,0,0,0,115,186,0,0,0,124,0,
- 106,0,125,2,116,1,106,2,131,0,1,0,116,3,124,2,
- 131,1,143,148,1,0,116,4,106,5,106,6,124,2,131,1,
- 124,1,107,9,114,62,100,1,106,7,124,2,131,1,125,3,
+ 106,0,125,2,116,1,160,2,161,0,1,0,116,3,124,2,
+ 131,1,143,148,1,0,116,4,106,5,160,6,124,2,161,1,
+ 124,1,107,9,114,62,100,1,160,7,124,2,161,1,125,3,
116,8,124,3,124,2,100,2,141,2,130,1,124,0,106,9,
100,3,107,8,114,114,124,0,106,10,100,3,107,8,114,96,
116,8,100,4,124,0,106,0,100,2,141,2,130,1,116,11,
124,0,124,1,100,5,100,6,141,3,1,0,124,1,83,0,
116,11,124,0,124,1,100,5,100,6,141,3,1,0,116,12,
- 124,0,106,9,100,7,131,2,115,154,124,0,106,9,106,13,
- 124,2,131,1,1,0,110,12,124,0,106,9,106,14,124,1,
- 131,1,1,0,87,0,100,3,81,0,82,0,88,0,116,4,
+ 124,0,106,9,100,7,131,2,115,154,124,0,106,9,160,13,
+ 124,2,161,1,1,0,110,12,124,0,106,9,160,14,124,1,
+ 161,1,1,0,87,0,100,3,81,0,82,0,88,0,116,4,
106,5,124,2,25,0,83,0,41,8,122,70,69,120,101,99,
117,116,101,32,116,104,101,32,115,112,101,99,39,115,32,115,
112,101,99,105,102,105,101,100,32,109,111,100,117,108,101,32,
@@ -992,14 +992,14 @@ const unsigned char _Py_M__importlib[] = {
16,1,10,1,12,1,10,1,10,1,14,2,14,1,4,1,
14,1,12,4,14,2,22,1,114,80,0,0,0,99,1,0,
0,0,0,0,0,0,2,0,0,0,27,0,0,0,67,0,
- 0,0,115,206,0,0,0,124,0,106,0,106,1,124,0,106,
- 2,131,1,1,0,116,3,106,4,124,0,106,2,25,0,125,
+ 0,0,115,206,0,0,0,124,0,106,0,160,1,124,0,106,
+ 2,161,1,1,0,116,3,106,4,124,0,106,2,25,0,125,
1,116,5,124,1,100,1,100,0,131,3,100,0,107,8,114,
76,121,12,124,0,106,0,124,1,95,6,87,0,110,20,4,
0,116,7,107,10,114,74,1,0,1,0,1,0,89,0,110,
2,88,0,116,5,124,1,100,2,100,0,131,3,100,0,107,
8,114,154,121,40,124,1,106,8,124,1,95,9,116,10,124,
- 1,100,3,131,2,115,130,124,0,106,2,106,11,100,4,131,
+ 1,100,3,131,2,115,130,124,0,106,2,160,11,100,4,161,
1,100,5,25,0,124,1,95,9,87,0,110,20,4,0,116,
7,107,10,114,152,1,0,1,0,1,0,89,0,110,2,88,
0,116,5,124,1,100,6,100,0,131,3,100,0,107,8,114,
@@ -1025,7 +1025,7 @@ const unsigned char _Py_M__importlib[] = {
0,131,1,125,1,116,4,124,1,131,1,143,54,1,0,124,
0,106,0,100,0,107,8,114,84,124,0,106,5,100,0,107,
8,114,96,116,6,100,2,124,0,106,7,100,3,141,2,130,
- 1,110,12,124,0,106,0,106,8,124,1,131,1,1,0,87,
+ 1,110,12,124,0,106,0,160,8,124,1,161,1,1,0,87,
0,100,0,81,0,82,0,88,0,116,9,106,10,124,0,106,
7,25,0,83,0,41,4,78,114,135,0,0,0,122,14,109,
105,115,115,105,110,103,32,108,111,97,100,101,114,41,1,114,
@@ -1039,7 +1039,7 @@ const unsigned char _Py_M__importlib[] = {
0,0,2,10,2,12,1,8,2,8,1,10,1,10,1,10,
1,16,3,22,5,114,141,0,0,0,99,1,0,0,0,0,
0,0,0,1,0,0,0,9,0,0,0,67,0,0,0,115,
- 38,0,0,0,116,0,106,1,131,0,1,0,116,2,124,0,
+ 38,0,0,0,116,0,160,1,161,0,1,0,116,2,124,0,
106,3,131,1,143,10,1,0,116,4,124,0,131,1,83,0,
81,0,82,0,88,0,100,1,83,0,41,2,122,191,82,101,
116,117,114,110,32,97,32,110,101,119,32,109,111,100,117,108,
@@ -1079,9 +1079,9 @@ const unsigned char _Py_M__importlib[] = {
105,100,32,116,104,101,32,110,101,101,100,32,116,111,10,32,
32,32,32,105,110,115,116,97,110,116,105,97,116,101,32,116,
104,101,32,99,108,97,115,115,46,10,10,32,32,32,32,99,
- 1,0,0,0,0,0,0,0,1,0,0,0,2,0,0,0,
- 67,0,0,0,115,12,0,0,0,100,1,106,0,124,0,106,
- 1,131,1,83,0,41,2,122,115,82,101,116,117,114,110,32,
+ 1,0,0,0,0,0,0,0,1,0,0,0,3,0,0,0,
+ 67,0,0,0,115,12,0,0,0,100,1,160,0,124,0,106,
+ 1,161,1,83,0,41,2,122,115,82,101,116,117,114,110,32,
114,101,112,114,32,102,111,114,32,116,104,101,32,109,111,100,
117,108,101,46,10,10,32,32,32,32,32,32,32,32,84,104,
101,32,109,101,116,104,111,100,32,105,115,32,100,101,112,114,
@@ -1097,8 +1097,8 @@ const unsigned char _Py_M__importlib[] = {
110,73,109,112,111,114,116,101,114,46,109,111,100,117,108,101,
95,114,101,112,114,78,99,4,0,0,0,0,0,0,0,4,
0,0,0,5,0,0,0,67,0,0,0,115,44,0,0,0,
- 124,2,100,0,107,9,114,12,100,0,83,0,116,0,106,1,
- 124,1,131,1,114,36,116,2,124,1,124,0,100,1,100,2,
+ 124,2,100,0,107,9,114,12,100,0,83,0,116,0,160,1,
+ 124,1,161,1,114,36,116,2,124,1,124,0,100,1,100,2,
141,3,83,0,100,0,83,0,100,0,83,0,41,3,78,122,
8,98,117,105,108,116,45,105,110,41,1,114,103,0,0,0,
41,3,114,46,0,0,0,90,10,105,115,95,98,117,105,108,
@@ -1109,8 +1109,8 @@ const unsigned char _Py_M__importlib[] = {
115,10,0,0,0,0,2,8,1,4,1,10,1,14,2,122,
25,66,117,105,108,116,105,110,73,109,112,111,114,116,101,114,
46,102,105,110,100,95,115,112,101,99,99,3,0,0,0,0,
- 0,0,0,4,0,0,0,3,0,0,0,67,0,0,0,115,
- 30,0,0,0,124,0,106,0,124,1,124,2,131,2,125,3,
+ 0,0,0,4,0,0,0,4,0,0,0,67,0,0,0,115,
+ 30,0,0,0,124,0,160,0,124,1,124,2,161,2,125,3,
124,3,100,1,107,9,114,26,124,3,106,1,83,0,100,1,
83,0,41,2,122,175,70,105,110,100,32,116,104,101,32,98,
117,105,108,116,45,105,110,32,109,111,100,117,108,101,46,10,
@@ -1132,7 +1132,7 @@ const unsigned char _Py_M__importlib[] = {
101,114,46,102,105,110,100,95,109,111,100,117,108,101,99,2,
0,0,0,0,0,0,0,2,0,0,0,4,0,0,0,67,
0,0,0,115,46,0,0,0,124,1,106,0,116,1,106,2,
- 107,7,114,34,116,3,100,1,106,4,124,1,106,0,131,1,
+ 107,7,114,34,116,3,100,1,160,4,124,1,106,0,161,1,
124,1,106,0,100,2,141,2,130,1,116,5,116,6,106,7,
124,1,131,2,83,0,41,3,122,24,67,114,101,97,116,101,
32,97,32,98,117,105,108,116,45,105,110,32,109,111,100,117,
@@ -1221,8 +1221,8 @@ const unsigned char _Py_M__importlib[] = {
116,104,101,32,110,101,101,100,32,116,111,10,32,32,32,32,
105,110,115,116,97,110,116,105,97,116,101,32,116,104,101,32,
99,108,97,115,115,46,10,10,32,32,32,32,99,1,0,0,
- 0,0,0,0,0,1,0,0,0,2,0,0,0,67,0,0,
- 0,115,12,0,0,0,100,1,106,0,124,0,106,1,131,1,
+ 0,0,0,0,0,1,0,0,0,3,0,0,0,67,0,0,
+ 0,115,12,0,0,0,100,1,160,0,124,0,106,1,161,1,
83,0,41,2,122,115,82,101,116,117,114,110,32,114,101,112,
114,32,102,111,114,32,116,104,101,32,109,111,100,117,108,101,
46,10,10,32,32,32,32,32,32,32,32,84,104,101,32,109,
@@ -1238,7 +1238,7 @@ const unsigned char _Py_M__importlib[] = {
7,122,26,70,114,111,122,101,110,73,109,112,111,114,116,101,
114,46,109,111,100,117,108,101,95,114,101,112,114,78,99,4,
0,0,0,0,0,0,0,4,0,0,0,5,0,0,0,67,
- 0,0,0,115,32,0,0,0,116,0,106,1,124,1,131,1,
+ 0,0,0,115,32,0,0,0,116,0,160,1,124,1,161,1,
114,24,116,2,124,1,124,0,100,1,100,2,141,3,83,0,
100,0,83,0,100,0,83,0,41,3,78,90,6,102,114,111,
122,101,110,41,1,114,103,0,0,0,41,3,114,46,0,0,
@@ -1248,8 +1248,8 @@ const unsigned char _Py_M__importlib[] = {
114,146,0,0,0,3,3,0,0,115,6,0,0,0,0,2,
10,1,14,2,122,24,70,114,111,122,101,110,73,109,112,111,
114,116,101,114,46,102,105,110,100,95,115,112,101,99,99,3,
- 0,0,0,0,0,0,0,3,0,0,0,2,0,0,0,67,
- 0,0,0,115,18,0,0,0,116,0,106,1,124,1,131,1,
+ 0,0,0,0,0,0,0,3,0,0,0,3,0,0,0,67,
+ 0,0,0,115,18,0,0,0,116,0,160,1,124,1,161,1,
114,14,124,0,83,0,100,1,83,0,41,2,122,93,70,105,
110,100,32,97,32,102,114,111,122,101,110,32,109,111,100,117,
108,101,46,10,10,32,32,32,32,32,32,32,32,84,104,105,
@@ -1274,8 +1274,8 @@ const unsigned char _Py_M__importlib[] = {
99,114,101,97,116,101,95,109,111,100,117,108,101,99,1,0,
0,0,0,0,0,0,3,0,0,0,4,0,0,0,67,0,
0,0,115,64,0,0,0,124,0,106,0,106,1,125,1,116,
- 2,106,3,124,1,131,1,115,36,116,4,100,1,106,5,124,
- 1,131,1,124,1,100,2,141,2,130,1,116,6,116,2,106,
+ 2,160,3,124,1,161,1,115,36,116,4,100,1,160,5,124,
+ 1,161,1,124,1,100,2,141,2,130,1,116,6,116,2,106,
7,124,1,131,2,125,2,116,8,124,2,124,0,106,9,131,
2,1,0,100,0,83,0,41,3,78,122,27,123,33,114,125,
32,105,115,32,110,111,116,32,97,32,102,114,111,122,101,110,
@@ -1303,8 +1303,8 @@ const unsigned char _Py_M__importlib[] = {
0,114,138,0,0,0,32,3,0,0,115,2,0,0,0,0,
7,122,26,70,114,111,122,101,110,73,109,112,111,114,116,101,
114,46,108,111,97,100,95,109,111,100,117,108,101,99,2,0,
- 0,0,0,0,0,0,2,0,0,0,2,0,0,0,67,0,
- 0,0,115,10,0,0,0,116,0,106,1,124,1,131,1,83,
+ 0,0,0,0,0,0,2,0,0,0,3,0,0,0,67,0,
+ 0,0,115,10,0,0,0,116,0,160,1,124,1,161,1,83,
0,41,1,122,45,82,101,116,117,114,110,32,116,104,101,32,
99,111,100,101,32,111,98,106,101,99,116,32,102,111,114,32,
116,104,101,32,102,114,111,122,101,110,32,109,111,100,117,108,
@@ -1324,8 +1324,8 @@ const unsigned char _Py_M__importlib[] = {
47,3,0,0,115,2,0,0,0,0,4,122,25,70,114,111,
122,101,110,73,109,112,111,114,116,101,114,46,103,101,116,95,
115,111,117,114,99,101,99,2,0,0,0,0,0,0,0,2,
- 0,0,0,2,0,0,0,67,0,0,0,115,10,0,0,0,
- 116,0,106,1,124,1,131,1,83,0,41,1,122,46,82,101,
+ 0,0,0,3,0,0,0,67,0,0,0,115,10,0,0,0,
+ 116,0,160,1,124,1,161,1,83,0,41,1,122,46,82,101,
116,117,114,110,32,84,114,117,101,32,105,102,32,116,104,101,
32,102,114,111,122,101,110,32,109,111,100,117,108,101,32,105,
115,32,97,32,112,97,99,107,97,103,101,46,41,2,114,46,
@@ -1352,8 +1352,8 @@ const unsigned char _Py_M__importlib[] = {
111,99,107,67,111,110,116,101,120,116,122,36,67,111,110,116,
101,120,116,32,109,97,110,97,103,101,114,32,102,111,114,32,
116,104,101,32,105,109,112,111,114,116,32,108,111,99,107,46,
- 99,1,0,0,0,0,0,0,0,1,0,0,0,1,0,0,
- 0,67,0,0,0,115,12,0,0,0,116,0,106,1,131,0,
+ 99,1,0,0,0,0,0,0,0,1,0,0,0,2,0,0,
+ 0,67,0,0,0,115,12,0,0,0,116,0,160,1,161,0,
1,0,100,1,83,0,41,2,122,24,65,99,113,117,105,114,
101,32,116,104,101,32,105,109,112,111,114,116,32,108,111,99,
107,46,78,41,2,114,46,0,0,0,114,137,0,0,0,41,
@@ -1362,8 +1362,8 @@ const unsigned char _Py_M__importlib[] = {
0,0,0,0,2,122,28,95,73,109,112,111,114,116,76,111,
99,107,67,111,110,116,101,120,116,46,95,95,101,110,116,101,
114,95,95,99,4,0,0,0,0,0,0,0,4,0,0,0,
- 1,0,0,0,67,0,0,0,115,12,0,0,0,116,0,106,
- 1,131,0,1,0,100,1,83,0,41,2,122,60,82,101,108,
+ 2,0,0,0,67,0,0,0,115,12,0,0,0,116,0,160,
+ 1,161,0,1,0,100,1,83,0,41,2,122,60,82,101,108,
101,97,115,101,32,116,104,101,32,105,109,112,111,114,116,32,
108,111,99,107,32,114,101,103,97,114,100,108,101,115,115,32,
111,102,32,97,110,121,32,114,97,105,115,101,100,32,101,120,
@@ -1380,11 +1380,11 @@ const unsigned char _Py_M__importlib[] = {
0,0,0,114,10,0,0,0,114,10,0,0,0,114,11,0,
0,0,114,157,0,0,0,62,3,0,0,115,6,0,0,0,
8,2,4,2,8,4,114,157,0,0,0,99,3,0,0,0,
- 0,0,0,0,5,0,0,0,4,0,0,0,67,0,0,0,
- 115,64,0,0,0,124,1,106,0,100,1,124,2,100,2,24,
- 0,131,2,125,3,116,1,124,3,131,1,124,2,107,0,114,
+ 0,0,0,0,5,0,0,0,5,0,0,0,67,0,0,0,
+ 115,64,0,0,0,124,1,160,0,100,1,124,2,100,2,24,
+ 0,161,2,125,3,116,1,124,3,131,1,124,2,107,0,114,
36,116,2,100,3,131,1,130,1,124,3,100,4,25,0,125,
- 4,124,0,114,60,100,5,106,3,124,4,124,0,131,2,83,
+ 4,124,0,114,60,100,5,160,3,124,4,124,0,161,2,83,
0,124,4,83,0,41,6,122,50,82,101,115,111,108,118,101,
32,97,32,114,101,108,97,116,105,118,101,32,109,111,100,117,
108,101,32,110,97,109,101,32,116,111,32,97,110,32,97,98,
@@ -1401,9 +1401,9 @@ const unsigned char _Py_M__importlib[] = {
0,0,114,11,0,0,0,218,13,95,114,101,115,111,108,118,
101,95,110,97,109,101,75,3,0,0,115,10,0,0,0,0,
2,16,1,12,1,8,1,8,1,114,163,0,0,0,99,3,
- 0,0,0,0,0,0,0,4,0,0,0,3,0,0,0,67,
- 0,0,0,115,34,0,0,0,124,0,106,0,124,1,124,2,
- 131,2,125,3,124,3,100,0,107,8,114,24,100,0,83,0,
+ 0,0,0,0,0,0,0,4,0,0,0,4,0,0,0,67,
+ 0,0,0,115,34,0,0,0,124,0,160,0,124,1,124,2,
+ 161,2,125,3,124,3,100,0,107,8,114,24,100,0,83,0,
116,1,124,1,124,3,131,2,83,0,41,1,78,41,2,114,
147,0,0,0,114,78,0,0,0,41,4,218,6,102,105,110,
100,101,114,114,15,0,0,0,114,144,0,0,0,114,93,0,
@@ -1414,7 +1414,7 @@ const unsigned char _Py_M__importlib[] = {
0,0,0,10,0,0,0,27,0,0,0,67,0,0,0,115,
242,0,0,0,116,0,106,1,125,3,124,3,100,1,107,8,
114,22,116,2,100,2,131,1,130,1,124,3,115,38,116,3,
- 106,4,100,3,116,5,131,2,1,0,124,0,116,0,106,6,
+ 160,4,100,3,116,5,161,2,1,0,124,0,116,0,106,6,
107,6,125,4,120,188,124,3,68,0,93,176,125,5,116,7,
131,0,143,72,1,0,121,10,124,5,106,8,125,6,87,0,
110,42,4,0,116,9,107,10,114,118,1,0,1,0,1,0,
@@ -1449,15 +1449,15 @@ const unsigned char _Py_M__importlib[] = {
10,1,8,1,2,1,10,1,14,1,12,1,8,1,8,2,
22,1,8,2,16,1,10,1,2,1,10,1,14,4,6,2,
8,1,4,2,6,2,8,2,114,170,0,0,0,99,3,0,
- 0,0,0,0,0,0,4,0,0,0,4,0,0,0,67,0,
+ 0,0,0,0,0,0,4,0,0,0,5,0,0,0,67,0,
0,0,115,140,0,0,0,116,0,124,0,116,1,131,2,115,
- 28,116,2,100,1,106,3,116,4,124,0,131,1,131,1,131,
+ 28,116,2,100,1,160,3,116,4,124,0,131,1,161,1,131,
1,130,1,124,2,100,2,107,0,114,44,116,5,100,3,131,
1,130,1,124,2,100,2,107,4,114,114,116,0,124,1,116,
1,131,2,115,72,116,2,100,4,131,1,130,1,110,42,124,
1,115,86,116,6,100,5,131,1,130,1,110,28,124,1,116,
- 7,106,8,107,7,114,114,100,6,125,3,116,9,124,3,106,
- 3,124,1,131,1,131,1,130,1,124,0,12,0,114,136,124,
+ 7,106,8,107,7,114,114,100,6,125,3,116,9,124,3,160,
+ 3,124,1,161,1,131,1,130,1,124,0,12,0,114,136,124,
2,100,2,107,2,114,136,116,5,100,7,131,1,130,1,100,
8,83,0,41,9,122,28,86,101,114,105,102,121,32,97,114,
103,117,109,101,110,116,115,32,97,114,101,32,34,115,97,110,
@@ -1488,20 +1488,20 @@ const unsigned char _Py_M__importlib[] = {
1,10,2,10,1,4,2,14,1,14,1,114,175,0,0,0,
122,16,78,111,32,109,111,100,117,108,101,32,110,97,109,101,
100,32,122,4,123,33,114,125,99,2,0,0,0,0,0,0,
- 0,8,0,0,0,12,0,0,0,67,0,0,0,115,220,0,
- 0,0,100,0,125,2,124,0,106,0,100,1,131,1,100,2,
+ 0,8,0,0,0,13,0,0,0,67,0,0,0,115,220,0,
+ 0,0,100,0,125,2,124,0,160,0,100,1,161,1,100,2,
25,0,125,3,124,3,114,134,124,3,116,1,106,2,107,7,
114,42,116,3,124,1,124,3,131,2,1,0,124,0,116,1,
106,2,107,6,114,62,116,1,106,2,124,0,25,0,83,0,
116,1,106,2,124,3,25,0,125,4,121,10,124,4,106,4,
125,2,87,0,110,50,4,0,116,5,107,10,114,132,1,0,
- 1,0,1,0,116,6,100,3,23,0,106,7,124,0,124,3,
- 131,2,125,5,116,8,124,5,124,0,100,4,141,2,100,0,
+ 1,0,1,0,116,6,100,3,23,0,160,7,124,0,124,3,
+ 161,2,125,5,116,8,124,5,124,0,100,4,141,2,100,0,
130,2,89,0,110,2,88,0,116,9,124,0,124,2,131,2,
- 125,6,124,6,100,0,107,8,114,172,116,8,116,6,106,7,
- 124,0,131,1,124,0,100,4,141,2,130,1,110,8,116,10,
+ 125,6,124,6,100,0,107,8,114,172,116,8,116,6,160,7,
+ 124,0,161,1,124,0,100,4,141,2,130,1,110,8,116,10,
124,6,131,1,125,7,124,3,114,216,116,1,106,2,124,3,
- 25,0,125,4,116,11,124,4,124,0,106,0,100,1,131,1,
+ 25,0,125,4,116,11,124,4,124,0,160,0,100,1,161,1,
100,5,25,0,124,7,131,3,1,0,124,7,83,0,41,6,
78,114,117,0,0,0,114,19,0,0,0,122,23,59,32,123,
33,114,125,32,105,115,32,110,111,116,32,97,32,112,97,99,
@@ -1536,11 +1536,11 @@ const unsigned char _Py_M__importlib[] = {
0,0,0,0,0,5,0,0,0,4,0,0,0,67,0,0,
0,115,120,0,0,0,116,0,124,0,124,1,124,2,131,3,
1,0,124,2,100,1,107,4,114,32,116,1,124,0,124,1,
- 124,2,131,3,125,0,116,2,106,3,131,0,1,0,124,0,
+ 124,2,131,3,125,0,116,2,160,3,161,0,1,0,124,0,
116,4,106,5,107,7,114,60,116,6,124,0,116,7,131,2,
83,0,116,4,106,5,124,0,25,0,125,3,124,3,100,2,
- 107,8,114,108,116,2,106,8,131,0,1,0,100,3,106,9,
- 124,0,131,1,125,4,116,10,124,4,124,0,100,4,141,2,
+ 107,8,114,108,116,2,160,8,161,0,1,0,100,3,160,9,
+ 124,0,161,1,125,4,116,10,124,4,124,0,100,4,141,2,
130,1,116,11,124,0,131,1,1,0,124,3,83,0,41,5,
97,50,1,0,0,73,109,112,111,114,116,32,97,110,100,32,
114,101,116,117,114,110,32,116,104,101,32,109,111,100,117,108,
@@ -1578,10 +1578,10 @@ const unsigned char _Py_M__importlib[] = {
0,0,0,0,0,0,6,0,0,0,17,0,0,0,67,0,
0,0,115,164,0,0,0,116,0,124,0,100,1,131,2,114,
160,100,2,124,1,107,6,114,58,116,1,124,1,131,1,125,
- 1,124,1,106,2,100,2,131,1,1,0,116,0,124,0,100,
- 3,131,2,114,58,124,1,106,3,124,0,106,4,131,1,1,
+ 1,124,1,160,2,100,2,161,1,1,0,116,0,124,0,100,
+ 3,131,2,114,58,124,1,160,3,124,0,106,4,161,1,1,
0,120,100,124,1,68,0,93,92,125,3,116,0,124,0,124,
- 3,131,2,115,64,100,4,106,5,124,0,106,6,124,3,131,
+ 3,131,2,115,64,100,4,160,5,124,0,106,6,124,3,161,
2,125,4,121,14,116,7,124,2,124,4,131,2,1,0,87,
0,113,64,4,0,116,8,107,10,114,154,1,0,125,5,1,
0,122,20,124,5,106,9,124,4,107,2,114,136,119,64,130,
@@ -1616,15 +1616,15 @@ const unsigned char _Py_M__importlib[] = {
1,10,1,10,1,14,1,2,1,14,1,16,4,10,1,2,
1,24,1,114,189,0,0,0,99,1,0,0,0,0,0,0,
0,3,0,0,0,6,0,0,0,67,0,0,0,115,146,0,
- 0,0,124,0,106,0,100,1,131,1,125,1,124,0,106,0,
- 100,2,131,1,125,2,124,1,100,3,107,9,114,82,124,2,
+ 0,0,124,0,160,0,100,1,161,1,125,1,124,0,160,0,
+ 100,2,161,1,125,2,124,1,100,3,107,9,114,82,124,2,
100,3,107,9,114,78,124,1,124,2,106,1,107,3,114,78,
116,2,106,3,100,4,124,1,155,2,100,5,124,2,106,1,
155,2,100,6,157,5,116,4,100,7,100,8,141,3,1,0,
124,1,83,0,124,2,100,3,107,9,114,96,124,2,106,1,
83,0,116,2,106,3,100,9,116,4,100,7,100,8,141,3,
1,0,124,0,100,10,25,0,125,1,100,11,124,0,107,7,
- 114,142,124,1,106,5,100,12,131,1,100,13,25,0,125,1,
+ 114,142,124,1,160,5,100,12,161,1,100,13,25,0,125,1,
124,1,83,0,41,14,122,167,67,97,108,99,117,108,97,116,
101,32,119,104,97,116,32,95,95,112,97,99,107,97,103,101,
95,95,32,115,104,111,117,108,100,32,98,101,46,10,10,32,
@@ -1661,9 +1661,9 @@ const unsigned char _Py_M__importlib[] = {
131,1,125,5,110,36,124,1,100,2,107,9,114,30,124,1,
110,2,105,0,125,6,116,1,124,6,131,1,125,7,116,0,
124,0,124,7,124,4,131,3,125,5,124,3,115,150,124,4,
- 100,1,107,2,114,84,116,0,124,0,106,2,100,3,131,1,
+ 100,1,107,2,114,84,116,0,124,0,160,2,100,3,161,1,
100,1,25,0,131,1,83,0,124,0,115,92,124,5,83,0,
- 116,3,124,0,131,1,116,3,124,0,106,2,100,3,131,1,
+ 116,3,124,0,131,1,116,3,124,0,160,2,100,3,161,1,
100,1,25,0,131,1,24,0,125,8,116,4,106,5,124,5,
106,6,100,2,116,3,124,5,106,6,131,1,124,8,24,0,
133,2,25,0,25,0,83,0,110,12,116,7,124,5,124,3,
@@ -1710,8 +1710,8 @@ const unsigned char _Py_M__importlib[] = {
0,0,0,11,8,1,10,2,16,1,8,1,12,1,4,3,
8,1,18,1,4,1,4,4,26,3,32,2,114,196,0,0,
0,99,1,0,0,0,0,0,0,0,2,0,0,0,3,0,
- 0,0,67,0,0,0,115,38,0,0,0,116,0,106,1,124,
- 0,131,1,125,1,124,1,100,0,107,8,114,30,116,2,100,
+ 0,0,67,0,0,0,115,38,0,0,0,116,0,160,1,124,
+ 0,161,1,125,1,124,1,100,0,107,8,114,30,116,2,100,
1,124,0,23,0,131,1,130,1,116,3,124,1,131,1,83,
0,41,2,78,122,25,110,111,32,98,117,105,108,116,45,105,
110,32,109,111,100,117,108,101,32,110,97,109,101,100,32,41,
@@ -1723,10 +1723,10 @@ const unsigned char _Py_M__importlib[] = {
1,8,1,12,1,114,197,0,0,0,99,2,0,0,0,0,
0,0,0,12,0,0,0,12,0,0,0,67,0,0,0,115,
244,0,0,0,124,1,97,0,124,0,97,1,116,2,116,1,
- 131,1,125,2,120,86,116,1,106,3,106,4,131,0,68,0,
+ 131,1,125,2,120,86,116,1,106,3,160,4,161,0,68,0,
93,72,92,2,125,3,125,4,116,5,124,4,124,2,131,2,
114,28,124,3,116,1,106,6,107,6,114,62,116,7,125,5,
- 110,18,116,0,106,8,124,3,131,1,114,28,116,9,125,5,
+ 110,18,116,0,160,8,124,3,161,1,114,28,116,9,125,5,
110,2,113,28,116,10,124,4,124,5,131,2,125,6,116,11,
124,6,124,4,131,2,1,0,113,28,87,0,116,1,106,3,
116,12,25,0,125,7,120,54,100,5,68,0,93,46,125,8,
@@ -1774,12 +1774,12 @@ const unsigned char _Py_M__importlib[] = {
1,10,1,10,1,6,1,10,1,6,2,2,1,10,1,14,
3,10,1,10,1,10,1,10,2,10,1,16,3,2,1,12,
1,14,2,10,1,12,3,8,1,114,201,0,0,0,99,2,
- 0,0,0,0,0,0,0,3,0,0,0,3,0,0,0,67,
+ 0,0,0,0,0,0,0,3,0,0,0,4,0,0,0,67,
0,0,0,115,66,0,0,0,116,0,124,0,124,1,131,2,
- 1,0,116,1,106,2,106,3,116,4,131,1,1,0,116,1,
- 106,2,106,3,116,5,131,1,1,0,100,1,100,2,108,6,
- 125,2,124,2,97,7,124,2,106,8,116,1,106,9,116,10,
- 25,0,131,1,1,0,100,2,83,0,41,3,122,50,73,110,
+ 1,0,116,1,106,2,160,3,116,4,161,1,1,0,116,1,
+ 106,2,160,3,116,5,161,1,1,0,100,1,100,2,108,6,
+ 125,2,124,2,97,7,124,2,160,8,116,1,106,9,116,10,
+ 25,0,161,1,1,0,100,2,83,0,41,3,122,50,73,110,
115,116,97,108,108,32,105,109,112,111,114,116,108,105,98,32,
97,115,32,116,104,101,32,105,109,112,108,101,109,101,110,116,
97,116,105,111,110,32,111,102,32,105,109,112,111,114,116,46,
diff --git a/Python/importlib_external.h b/Python/importlib_external.h
index 2f40978fb7..c1beb70d4b 100644
--- a/Python/importlib_external.h
+++ b/Python/importlib_external.h
@@ -8,9 +8,9 @@ const unsigned char _Py_M__importlib_external[] = {
100,13,132,0,90,8,100,14,100,15,132,0,90,9,100,16,
100,17,132,0,90,10,100,18,100,19,132,0,90,11,100,20,
100,21,132,0,90,12,100,93,100,23,100,24,132,1,90,13,
- 101,14,101,13,106,15,131,1,90,16,100,25,106,17,100,26,
- 100,27,131,2,100,28,23,0,90,18,101,19,106,20,101,18,
- 100,27,131,2,90,21,100,29,90,22,100,30,90,23,100,31,
+ 101,14,101,13,106,15,131,1,90,16,100,25,160,17,100,26,
+ 100,27,161,2,100,28,23,0,90,18,101,19,160,20,101,18,
+ 100,27,161,2,90,21,100,29,90,22,100,30,90,23,100,31,
103,1,90,24,100,32,103,1,90,25,101,25,4,0,90,26,
90,27,100,94,100,33,100,34,156,1,100,35,100,36,132,3,
90,28,100,37,100,38,132,0,90,29,100,39,100,40,132,0,
@@ -58,8 +58,8 @@ const unsigned char _Py_M__importlib_external[] = {
100,117,108,101,46,10,10,218,3,119,105,110,218,6,99,121,
103,119,105,110,218,6,100,97,114,119,105,110,99,0,0,0,
0,0,0,0,0,1,0,0,0,3,0,0,0,3,0,0,
- 0,115,60,0,0,0,116,0,106,1,106,2,116,3,131,1,
- 114,48,116,0,106,1,106,2,116,4,131,1,114,30,100,1,
+ 0,115,60,0,0,0,116,0,106,1,160,2,116,3,161,1,
+ 114,48,116,0,106,1,160,2,116,4,161,1,114,30,100,1,
137,0,110,4,100,2,137,0,135,0,102,1,100,3,100,4,
132,8,125,0,110,8,100,5,100,4,132,0,125,0,124,0,
83,0,41,6,78,90,12,80,89,84,72,79,78,67,65,83,
@@ -97,9 +97,9 @@ const unsigned char _Py_M__importlib_external[] = {
95,109,97,107,101,95,114,101,108,97,120,95,99,97,115,101,
30,0,0,0,115,14,0,0,0,0,1,12,1,12,1,6,
2,4,2,14,4,8,3,114,13,0,0,0,99,1,0,0,
- 0,0,0,0,0,1,0,0,0,3,0,0,0,67,0,0,
+ 0,0,0,0,0,1,0,0,0,4,0,0,0,67,0,0,
0,115,20,0,0,0,116,0,124,0,131,1,100,1,64,0,
- 106,1,100,2,100,3,131,2,83,0,41,4,122,42,67,111,
+ 160,1,100,2,100,3,161,2,83,0,41,4,122,42,67,111,
110,118,101,114,116,32,97,32,51,50,45,98,105,116,32,105,
110,116,101,103,101,114,32,116,111,32,108,105,116,116,108,101,
45,101,110,100,105,97,110,46,108,3,0,0,0,255,127,255,
@@ -108,9 +108,9 @@ const unsigned char _Py_M__importlib_external[] = {
115,41,1,218,1,120,114,4,0,0,0,114,4,0,0,0,
114,6,0,0,0,218,7,95,119,95,108,111,110,103,47,0,
0,0,115,2,0,0,0,0,2,114,19,0,0,0,99,1,
- 0,0,0,0,0,0,0,1,0,0,0,3,0,0,0,67,
- 0,0,0,115,12,0,0,0,116,0,106,1,124,0,100,1,
- 131,2,83,0,41,2,122,47,67,111,110,118,101,114,116,32,
+ 0,0,0,0,0,0,0,1,0,0,0,4,0,0,0,67,
+ 0,0,0,115,12,0,0,0,116,0,160,1,124,0,100,1,
+ 161,2,83,0,41,2,122,47,67,111,110,118,101,114,116,32,
52,32,98,121,116,101,115,32,105,110,32,108,105,116,116,108,
101,45,101,110,100,105,97,110,32,116,111,32,97,110,32,105,
110,116,101,103,101,114,46,114,15,0,0,0,41,2,114,16,
@@ -119,14 +119,14 @@ const unsigned char _Py_M__importlib_external[] = {
0,114,4,0,0,0,114,6,0,0,0,218,7,95,114,95,
108,111,110,103,52,0,0,0,115,2,0,0,0,0,2,114,
21,0,0,0,99,0,0,0,0,0,0,0,0,1,0,0,
- 0,3,0,0,0,71,0,0,0,115,20,0,0,0,116,0,
- 106,1,100,1,100,2,132,0,124,0,68,0,131,1,131,1,
+ 0,4,0,0,0,71,0,0,0,115,20,0,0,0,116,0,
+ 160,1,100,1,100,2,132,0,124,0,68,0,131,1,161,1,
83,0,41,3,122,31,82,101,112,108,97,99,101,109,101,110,
116,32,102,111,114,32,111,115,46,112,97,116,104,46,106,111,
105,110,40,41,46,99,1,0,0,0,0,0,0,0,2,0,
- 0,0,4,0,0,0,83,0,0,0,115,26,0,0,0,103,
- 0,124,0,93,18,125,1,124,1,114,4,124,1,106,0,116,
- 1,131,1,145,2,113,4,83,0,114,4,0,0,0,41,2,
+ 0,0,5,0,0,0,83,0,0,0,115,26,0,0,0,103,
+ 0,124,0,93,18,125,1,124,1,114,4,124,1,160,0,116,
+ 1,161,1,145,2,113,4,83,0,114,4,0,0,0,41,2,
218,6,114,115,116,114,105,112,218,15,112,97,116,104,95,115,
101,112,97,114,97,116,111,114,115,41,2,218,2,46,48,218,
4,112,97,114,116,114,4,0,0,0,114,4,0,0,0,114,
@@ -141,7 +141,7 @@ const unsigned char _Py_M__importlib_external[] = {
2,10,1,114,30,0,0,0,99,1,0,0,0,0,0,0,
0,5,0,0,0,5,0,0,0,67,0,0,0,115,96,0,
0,0,116,0,116,1,131,1,100,1,107,2,114,36,124,0,
- 106,2,116,3,131,1,92,3,125,1,125,2,125,3,124,1,
+ 160,2,116,3,161,1,92,3,125,1,125,2,125,3,124,1,
124,3,102,2,83,0,120,50,116,4,124,0,131,1,68,0,
93,38,125,4,124,4,116,1,107,6,114,46,124,0,106,5,
124,4,100,1,100,2,141,2,92,2,125,1,125,3,124,1,
@@ -158,8 +158,8 @@ const unsigned char _Py_M__importlib_external[] = {
6,0,0,0,218,11,95,112,97,116,104,95,115,112,108,105,
116,63,0,0,0,115,16,0,0,0,0,2,12,1,16,1,
8,1,14,1,8,1,18,1,12,1,114,40,0,0,0,99,
- 1,0,0,0,0,0,0,0,1,0,0,0,2,0,0,0,
- 67,0,0,0,115,10,0,0,0,116,0,106,1,124,0,131,
+ 1,0,0,0,0,0,0,0,1,0,0,0,3,0,0,0,
+ 67,0,0,0,115,10,0,0,0,116,0,160,1,124,0,161,
1,83,0,41,1,122,126,83,116,97,116,32,116,104,101,32,
112,97,116,104,46,10,10,32,32,32,32,77,97,100,101,32,
97,32,115,101,112,97,114,97,116,101,32,102,117,110,99,116,
@@ -197,7 +197,7 @@ const unsigned char _Py_M__importlib_external[] = {
95,112,97,116,104,95,105,115,102,105,108,101,94,0,0,0,
115,2,0,0,0,0,2,114,46,0,0,0,99,1,0,0,
0,0,0,0,0,1,0,0,0,3,0,0,0,67,0,0,
- 0,115,22,0,0,0,124,0,115,12,116,0,106,1,131,0,
+ 0,115,22,0,0,0,124,0,115,12,116,0,160,1,161,0,
125,0,116,2,124,0,100,1,131,2,83,0,41,2,122,30,
82,101,112,108,97,99,101,109,101,110,116,32,102,111,114,32,
111,115,46,112,97,116,104,46,105,115,100,105,114,46,105,0,
@@ -207,15 +207,15 @@ const unsigned char _Py_M__importlib_external[] = {
112,97,116,104,95,105,115,100,105,114,99,0,0,0,115,6,
0,0,0,0,2,4,1,8,1,114,48,0,0,0,233,182,
1,0,0,99,3,0,0,0,0,0,0,0,6,0,0,0,
- 17,0,0,0,67,0,0,0,115,162,0,0,0,100,1,106,
- 0,124,0,116,1,124,0,131,1,131,2,125,3,116,2,106,
+ 17,0,0,0,67,0,0,0,115,162,0,0,0,100,1,160,
+ 0,124,0,116,1,124,0,131,1,161,2,125,3,116,2,160,
3,124,3,116,2,106,4,116,2,106,5,66,0,116,2,106,
- 6,66,0,124,2,100,2,64,0,131,3,125,4,121,50,116,
- 7,106,8,124,4,100,3,131,2,143,16,125,5,124,5,106,
- 9,124,1,131,1,1,0,87,0,100,4,81,0,82,0,88,
- 0,116,2,106,10,124,3,124,0,131,2,1,0,87,0,110,
+ 6,66,0,124,2,100,2,64,0,161,3,125,4,121,50,116,
+ 7,160,8,124,4,100,3,161,2,143,16,125,5,124,5,160,
+ 9,124,1,161,1,1,0,87,0,100,4,81,0,82,0,88,
+ 0,116,2,160,10,124,3,124,0,161,2,1,0,87,0,110,
58,4,0,116,11,107,10,114,156,1,0,1,0,1,0,121,
- 14,116,2,106,12,124,3,131,1,1,0,87,0,110,20,4,
+ 14,116,2,160,12,124,3,161,1,1,0,87,0,110,20,4,
0,116,11,107,10,114,148,1,0,1,0,1,0,89,0,110,
2,88,0,130,0,89,0,110,2,88,0,100,4,83,0,41,
5,122,162,66,101,115,116,45,101,102,102,111,114,116,32,102,
@@ -242,26 +242,26 @@ const unsigned char _Py_M__importlib_external[] = {
101,95,97,116,111,109,105,99,106,0,0,0,115,26,0,0,
0,0,5,16,1,6,1,26,1,2,3,14,1,20,1,16,
1,14,1,2,1,14,1,14,1,6,1,114,58,0,0,0,
- 105,51,13,0,0,233,2,0,0,0,114,15,0,0,0,115,
+ 105,62,13,0,0,233,2,0,0,0,114,15,0,0,0,115,
2,0,0,0,13,10,90,11,95,95,112,121,99,97,99,104,
101,95,95,122,4,111,112,116,45,122,3,46,112,121,122,4,
46,112,121,99,78,41,1,218,12,111,112,116,105,109,105,122,
97,116,105,111,110,99,2,0,0,0,1,0,0,0,11,0,
0,0,6,0,0,0,67,0,0,0,115,244,0,0,0,124,
- 1,100,1,107,9,114,52,116,0,106,1,100,2,116,2,131,
+ 1,100,1,107,9,114,52,116,0,160,1,100,2,116,2,161,
2,1,0,124,2,100,1,107,9,114,40,100,3,125,3,116,
3,124,3,131,1,130,1,124,1,114,48,100,4,110,2,100,
- 5,125,2,116,4,106,5,124,0,131,1,125,0,116,6,124,
- 0,131,1,92,2,125,4,125,5,124,5,106,7,100,6,131,
+ 5,125,2,116,4,160,5,124,0,161,1,125,0,116,6,124,
+ 0,131,1,92,2,125,4,125,5,124,5,160,7,100,6,161,
1,92,3,125,6,125,7,125,8,116,8,106,9,106,10,125,
9,124,9,100,1,107,8,114,114,116,11,100,7,131,1,130,
- 1,100,4,106,12,124,6,114,126,124,6,110,2,124,8,124,
- 7,124,9,103,3,131,1,125,10,124,2,100,1,107,8,114,
+ 1,100,4,160,12,124,6,114,126,124,6,110,2,124,8,124,
+ 7,124,9,103,3,161,1,125,10,124,2,100,1,107,8,114,
172,116,8,106,13,106,14,100,8,107,2,114,164,100,4,125,
2,110,8,116,8,106,13,106,14,125,2,116,15,124,2,131,
- 1,125,2,124,2,100,4,107,3,114,224,124,2,106,16,131,
- 0,115,210,116,17,100,9,106,18,124,2,131,1,131,1,130,
- 1,100,10,106,18,124,10,116,19,124,2,131,3,125,10,116,
+ 1,125,2,124,2,100,4,107,3,114,224,124,2,160,16,161,
+ 0,115,210,116,17,100,9,160,18,124,2,161,1,131,1,130,
+ 1,100,10,160,18,124,10,116,19,124,2,161,3,125,10,116,
20,124,4,116,21,124,10,116,22,100,8,25,0,23,0,131,
3,83,0,41,11,97,254,2,0,0,71,105,118,101,110,32,
116,104,101,32,112,97,116,104,32,116,111,32,97,32,46,112,
@@ -346,25 +346,25 @@ const unsigned char _Py_M__importlib_external[] = {
103,90,15,97,108,109,111,115,116,95,102,105,108,101,110,97,
109,101,114,4,0,0,0,114,4,0,0,0,114,6,0,0,
0,218,17,99,97,99,104,101,95,102,114,111,109,95,115,111,
- 117,114,99,101,7,1,0,0,115,48,0,0,0,0,18,8,
+ 117,114,99,101,8,1,0,0,115,48,0,0,0,0,18,8,
1,6,1,6,1,8,1,4,1,8,1,12,1,10,1,12,
1,16,1,8,1,8,1,8,1,24,1,8,1,12,1,6,
2,8,1,8,1,8,1,8,1,14,1,14,1,114,83,0,
0,0,99,1,0,0,0,0,0,0,0,8,0,0,0,5,
0,0,0,67,0,0,0,115,230,0,0,0,116,0,106,1,
106,2,100,1,107,8,114,20,116,3,100,2,131,1,130,1,
- 116,4,106,5,124,0,131,1,125,0,116,6,124,0,131,1,
+ 116,4,160,5,124,0,161,1,125,0,116,6,124,0,131,1,
92,2,125,1,125,2,116,6,124,1,131,1,92,2,125,1,
- 125,3,124,3,116,7,107,3,114,78,116,8,100,3,106,9,
- 116,7,124,0,131,2,131,1,130,1,124,2,106,10,100,4,
- 131,1,125,4,124,4,100,11,107,7,114,112,116,8,100,7,
- 106,9,124,2,131,1,131,1,130,1,110,86,124,4,100,6,
- 107,2,114,198,124,2,106,11,100,4,100,5,131,2,100,12,
- 25,0,125,5,124,5,106,12,116,13,131,1,115,160,116,8,
- 100,8,106,9,116,13,131,1,131,1,130,1,124,5,116,14,
- 116,13,131,1,100,1,133,2,25,0,125,6,124,6,106,15,
- 131,0,115,198,116,8,100,9,106,9,124,5,131,1,131,1,
- 130,1,124,2,106,16,100,4,131,1,100,10,25,0,125,7,
+ 125,3,124,3,116,7,107,3,114,78,116,8,100,3,160,9,
+ 116,7,124,0,161,2,131,1,130,1,124,2,160,10,100,4,
+ 161,1,125,4,124,4,100,11,107,7,114,112,116,8,100,7,
+ 160,9,124,2,161,1,131,1,130,1,110,86,124,4,100,6,
+ 107,2,114,198,124,2,160,11,100,4,100,5,161,2,100,12,
+ 25,0,125,5,124,5,160,12,116,13,161,1,115,160,116,8,
+ 100,8,160,9,116,13,161,1,131,1,130,1,124,5,116,14,
+ 116,13,131,1,100,1,133,2,25,0,125,6,124,6,160,15,
+ 161,0,115,198,116,8,100,9,160,9,124,5,161,1,131,1,
+ 130,1,124,2,160,16,100,4,161,1,100,10,25,0,125,7,
116,17,124,1,124,7,116,18,100,10,25,0,23,0,131,2,
83,0,41,13,97,110,1,0,0,71,105,118,101,110,32,116,
104,101,32,112,97,116,104,32,116,111,32,97,32,46,112,121,
@@ -420,15 +420,15 @@ const unsigned char _Py_M__importlib_external[] = {
112,116,95,108,101,118,101,108,90,13,98,97,115,101,95,102,
105,108,101,110,97,109,101,114,4,0,0,0,114,4,0,0,
0,114,6,0,0,0,218,17,115,111,117,114,99,101,95,102,
- 114,111,109,95,99,97,99,104,101,52,1,0,0,115,46,0,
+ 114,111,109,95,99,97,99,104,101,53,1,0,0,115,46,0,
0,0,0,9,12,1,8,1,10,1,12,1,12,1,8,1,
6,1,10,1,10,1,8,1,6,1,10,1,8,1,16,1,
10,1,6,1,8,1,16,1,8,1,6,1,8,1,14,1,
114,89,0,0,0,99,1,0,0,0,0,0,0,0,5,0,
0,0,12,0,0,0,67,0,0,0,115,128,0,0,0,116,
0,124,0,131,1,100,1,107,2,114,16,100,2,83,0,124,
- 0,106,1,100,3,131,1,92,3,125,1,125,2,125,3,124,
- 1,12,0,115,58,124,3,106,2,131,0,100,7,100,8,133,
+ 0,160,1,100,3,161,1,92,3,125,1,125,2,125,3,124,
+ 1,12,0,115,58,124,3,160,2,161,0,100,7,100,8,133,
2,25,0,100,6,107,3,114,62,124,0,83,0,121,12,116,
3,124,0,131,1,125,4,87,0,110,36,4,0,116,4,116,
5,102,2,107,10,114,110,1,0,1,0,1,0,124,0,100,
@@ -456,20 +456,20 @@ const unsigned char _Py_M__importlib_external[] = {
115,105,111,110,218,11,115,111,117,114,99,101,95,112,97,116,
104,114,4,0,0,0,114,4,0,0,0,114,6,0,0,0,
218,15,95,103,101,116,95,115,111,117,114,99,101,102,105,108,
- 101,86,1,0,0,115,20,0,0,0,0,7,12,1,4,1,
+ 101,87,1,0,0,115,20,0,0,0,0,7,12,1,4,1,
16,1,26,1,4,1,2,1,12,1,18,1,18,1,114,95,
0,0,0,99,1,0,0,0,0,0,0,0,1,0,0,0,
- 11,0,0,0,67,0,0,0,115,72,0,0,0,124,0,106,
- 0,116,1,116,2,131,1,131,1,114,46,121,8,116,3,124,
+ 11,0,0,0,67,0,0,0,115,72,0,0,0,124,0,160,
+ 0,116,1,116,2,131,1,161,1,114,46,121,8,116,3,124,
0,131,1,83,0,4,0,116,4,107,10,114,42,1,0,1,
- 0,1,0,89,0,113,68,88,0,110,22,124,0,106,0,116,
- 1,116,5,131,1,131,1,114,64,124,0,83,0,100,0,83,
+ 0,1,0,89,0,113,68,88,0,110,22,124,0,160,0,116,
+ 1,116,5,131,1,161,1,114,64,124,0,83,0,100,0,83,
0,100,0,83,0,41,1,78,41,6,218,8,101,110,100,115,
119,105,116,104,218,5,116,117,112,108,101,114,88,0,0,0,
114,83,0,0,0,114,70,0,0,0,114,78,0,0,0,41,
1,218,8,102,105,108,101,110,97,109,101,114,4,0,0,0,
114,4,0,0,0,114,6,0,0,0,218,11,95,103,101,116,
- 95,99,97,99,104,101,100,105,1,0,0,115,16,0,0,0,
+ 95,99,97,99,104,101,100,106,1,0,0,115,16,0,0,0,
0,1,14,1,2,1,8,1,14,1,8,1,14,1,4,2,
114,99,0,0,0,99,1,0,0,0,0,0,0,0,2,0,
0,0,11,0,0,0,67,0,0,0,115,52,0,0,0,121,
@@ -483,7 +483,7 @@ const unsigned char _Py_M__importlib_external[] = {
128,0,0,0,41,3,114,41,0,0,0,114,43,0,0,0,
114,42,0,0,0,41,2,114,37,0,0,0,114,44,0,0,
0,114,4,0,0,0,114,4,0,0,0,114,6,0,0,0,
- 218,10,95,99,97,108,99,95,109,111,100,101,117,1,0,0,
+ 218,10,95,99,97,108,99,95,109,111,100,101,118,1,0,0,
115,12,0,0,0,0,2,2,1,14,1,14,1,10,3,8,
1,114,101,0,0,0,99,1,0,0,0,0,0,0,0,3,
0,0,0,11,0,0,0,3,0,0,0,115,68,0,0,0,
@@ -521,7 +521,7 @@ const unsigned char _Py_M__importlib_external[] = {
114,103,115,90,6,107,119,97,114,103,115,41,1,218,6,109,
101,116,104,111,100,114,4,0,0,0,114,6,0,0,0,218,
19,95,99,104,101,99,107,95,110,97,109,101,95,119,114,97,
- 112,112,101,114,137,1,0,0,115,12,0,0,0,0,1,8,
+ 112,112,101,114,138,1,0,0,115,12,0,0,0,0,1,8,
1,8,1,10,1,4,1,18,1,122,40,95,99,104,101,99,
107,95,110,97,109,101,46,60,108,111,99,97,108,115,62,46,
95,99,104,101,99,107,95,110,97,109,101,95,119,114,97,112,
@@ -529,8 +529,8 @@ const unsigned char _Py_M__importlib_external[] = {
7,0,0,0,83,0,0,0,115,60,0,0,0,120,40,100,
5,68,0,93,32,125,2,116,0,124,1,124,2,131,2,114,
6,116,1,124,0,124,2,116,2,124,1,124,2,131,2,131,
- 3,1,0,113,6,87,0,124,0,106,3,106,4,124,1,106,
- 3,131,1,1,0,100,0,83,0,41,6,78,218,10,95,95,
+ 3,1,0,113,6,87,0,124,0,106,3,160,4,124,1,106,
+ 3,161,1,1,0,100,0,83,0,41,6,78,218,10,95,95,
109,111,100,117,108,101,95,95,218,8,95,95,110,97,109,101,
95,95,218,12,95,95,113,117,97,108,110,97,109,101,95,95,
218,7,95,95,100,111,99,95,95,41,4,114,108,0,0,0,
@@ -540,7 +540,7 @@ const unsigned char _Py_M__importlib_external[] = {
100,105,99,116,95,95,218,6,117,112,100,97,116,101,41,3,
90,3,110,101,119,90,3,111,108,100,114,55,0,0,0,114,
4,0,0,0,114,4,0,0,0,114,6,0,0,0,218,5,
- 95,119,114,97,112,148,1,0,0,115,8,0,0,0,0,1,
+ 95,119,114,97,112,149,1,0,0,115,8,0,0,0,0,1,
10,1,10,1,22,1,122,26,95,99,104,101,99,107,95,110,
97,109,101,46,60,108,111,99,97,108,115,62,46,95,119,114,
97,112,41,1,78,41,3,218,10,95,98,111,111,116,115,116,
@@ -548,13 +548,13 @@ const unsigned char _Py_M__importlib_external[] = {
114,111,114,41,3,114,106,0,0,0,114,107,0,0,0,114,
117,0,0,0,114,4,0,0,0,41,1,114,106,0,0,0,
114,6,0,0,0,218,11,95,99,104,101,99,107,95,110,97,
- 109,101,129,1,0,0,115,14,0,0,0,0,8,14,7,2,
+ 109,101,130,1,0,0,115,14,0,0,0,0,8,14,7,2,
1,10,1,14,2,14,5,10,1,114,120,0,0,0,99,2,
- 0,0,0,0,0,0,0,5,0,0,0,4,0,0,0,67,
- 0,0,0,115,60,0,0,0,124,0,106,0,124,1,131,1,
+ 0,0,0,0,0,0,0,5,0,0,0,6,0,0,0,67,
+ 0,0,0,115,60,0,0,0,124,0,160,0,124,1,161,1,
92,2,125,2,125,3,124,2,100,1,107,8,114,56,116,1,
- 124,3,131,1,114,56,100,2,125,4,116,2,106,3,124,4,
- 106,4,124,3,100,3,25,0,131,1,116,5,131,2,1,0,
+ 124,3,131,1,114,56,100,2,125,4,116,2,160,3,124,4,
+ 160,4,124,3,100,3,25,0,161,1,116,5,161,2,1,0,
124,2,83,0,41,4,122,155,84,114,121,32,116,111,32,102,
105,110,100,32,97,32,108,111,97,100,101,114,32,102,111,114,
32,116,104,101,32,115,112,101,99,105,102,105,101,100,32,109,
@@ -576,7 +576,7 @@ const unsigned char _Py_M__importlib_external[] = {
101,114,218,8,112,111,114,116,105,111,110,115,218,3,109,115,
103,114,4,0,0,0,114,4,0,0,0,114,6,0,0,0,
218,17,95,102,105,110,100,95,109,111,100,117,108,101,95,115,
- 104,105,109,157,1,0,0,115,10,0,0,0,0,10,14,1,
+ 104,105,109,158,1,0,0,115,10,0,0,0,0,10,14,1,
16,1,4,1,22,1,114,127,0,0,0,99,4,0,0,0,
0,0,0,0,11,0,0,0,22,0,0,0,67,0,0,0,
115,136,1,0,0,105,0,125,4,124,2,100,1,107,9,114,
@@ -584,25 +584,25 @@ const unsigned char _Py_M__importlib_external[] = {
3,100,1,107,9,114,42,124,3,124,4,100,4,60,0,124,
0,100,1,100,5,133,2,25,0,125,5,124,0,100,5,100,
6,133,2,25,0,125,6,124,0,100,6,100,7,133,2,25,
- 0,125,7,124,5,116,0,107,3,114,124,100,8,106,1,124,
- 2,124,5,131,2,125,8,116,2,106,3,100,9,124,8,131,
+ 0,125,7,124,5,116,0,107,3,114,124,100,8,160,1,124,
+ 2,124,5,161,2,125,8,116,2,160,3,100,9,124,8,161,
2,1,0,116,4,124,8,102,1,124,4,142,1,130,1,110,
- 86,116,5,124,6,131,1,100,5,107,3,114,168,100,10,106,
- 1,124,2,131,1,125,8,116,2,106,3,100,9,124,8,131,
+ 86,116,5,124,6,131,1,100,5,107,3,114,168,100,10,160,
+ 1,124,2,161,1,125,8,116,2,160,3,100,9,124,8,161,
2,1,0,116,6,124,8,131,1,130,1,110,42,116,5,124,
- 7,131,1,100,5,107,3,114,210,100,11,106,1,124,2,131,
- 1,125,8,116,2,106,3,100,9,124,8,131,2,1,0,116,
+ 7,131,1,100,5,107,3,114,210,100,11,160,1,124,2,161,
+ 1,125,8,116,2,160,3,100,9,124,8,161,2,1,0,116,
6,124,8,131,1,130,1,124,1,100,1,107,9,144,1,114,
124,121,16,116,7,124,1,100,12,25,0,131,1,125,9,87,
0,110,22,4,0,116,8,107,10,144,1,114,2,1,0,1,
0,1,0,89,0,110,50,88,0,116,9,124,6,131,1,124,
- 9,107,3,144,1,114,52,100,13,106,1,124,2,131,1,125,
- 8,116,2,106,3,100,9,124,8,131,2,1,0,116,4,124,
+ 9,107,3,144,1,114,52,100,13,160,1,124,2,161,1,125,
+ 8,116,2,160,3,100,9,124,8,161,2,1,0,116,4,124,
8,102,1,124,4,142,1,130,1,121,16,124,1,100,14,25,
0,100,15,64,0,125,10,87,0,110,22,4,0,116,8,107,
10,144,1,114,90,1,0,1,0,1,0,89,0,110,34,88,
0,116,9,124,7,131,1,124,10,107,3,144,1,114,124,116,
- 4,100,13,106,1,124,2,131,1,102,1,124,4,142,1,130,
+ 4,100,13,160,1,124,2,161,1,102,1,124,4,142,1,130,
1,124,0,100,7,100,1,133,2,25,0,83,0,41,16,97,
122,1,0,0,86,97,108,105,100,97,116,101,32,116,104,101,
32,104,101,97,100,101,114,32,111,102,32,116,104,101,32,112,
@@ -656,18 +656,18 @@ const unsigned char _Py_M__importlib_external[] = {
115,111,117,114,99,101,95,115,105,122,101,114,4,0,0,0,
114,4,0,0,0,114,6,0,0,0,218,25,95,118,97,108,
105,100,97,116,101,95,98,121,116,101,99,111,100,101,95,104,
- 101,97,100,101,114,174,1,0,0,115,76,0,0,0,0,11,
+ 101,97,100,101,114,175,1,0,0,115,76,0,0,0,0,11,
4,1,8,1,10,3,4,1,8,1,8,1,12,1,12,1,
12,1,8,1,12,1,12,1,14,1,12,1,10,1,12,1,
10,1,12,1,10,1,12,1,8,1,10,1,2,1,16,1,
16,1,6,2,14,1,10,1,12,1,12,1,2,1,16,1,
16,1,6,2,14,1,12,1,6,1,114,139,0,0,0,99,
4,0,0,0,0,0,0,0,5,0,0,0,5,0,0,0,
- 67,0,0,0,115,80,0,0,0,116,0,106,1,124,0,131,
- 1,125,4,116,2,124,4,116,3,131,2,114,56,116,4,106,
- 5,100,1,124,2,131,2,1,0,124,3,100,2,107,9,114,
- 52,116,6,106,7,124,4,124,3,131,2,1,0,124,4,83,
- 0,116,8,100,3,106,9,124,2,131,1,124,1,124,2,100,
+ 67,0,0,0,115,80,0,0,0,116,0,160,1,124,0,161,
+ 1,125,4,116,2,124,4,116,3,131,2,114,56,116,4,160,
+ 5,100,1,124,2,161,2,1,0,124,3,100,2,107,9,114,
+ 52,116,6,160,7,124,4,124,3,161,2,1,0,124,4,83,
+ 0,116,8,100,3,160,9,124,2,161,1,124,1,124,2,100,
4,141,3,130,1,100,2,83,0,41,5,122,60,67,111,109,
112,105,108,101,32,98,121,116,101,99,111,100,101,32,97,115,
32,114,101,116,117,114,110,101,100,32,98,121,32,95,118,97,
@@ -685,14 +685,14 @@ const unsigned char _Py_M__importlib_external[] = {
0,0,0,114,102,0,0,0,114,93,0,0,0,114,94,0,
0,0,218,4,99,111,100,101,114,4,0,0,0,114,4,0,
0,0,114,6,0,0,0,218,17,95,99,111,109,112,105,108,
- 101,95,98,121,116,101,99,111,100,101,229,1,0,0,115,16,
+ 101,95,98,121,116,101,99,111,100,101,230,1,0,0,115,16,
0,0,0,0,2,10,1,10,1,12,1,8,1,12,1,4,
2,10,1,114,145,0,0,0,114,62,0,0,0,99,3,0,
- 0,0,0,0,0,0,4,0,0,0,3,0,0,0,67,0,
+ 0,0,0,0,0,0,4,0,0,0,5,0,0,0,67,0,
0,0,115,56,0,0,0,116,0,116,1,131,1,125,3,124,
- 3,106,2,116,3,124,1,131,1,131,1,1,0,124,3,106,
- 2,116,3,124,2,131,1,131,1,1,0,124,3,106,2,116,
- 4,106,5,124,0,131,1,131,1,1,0,124,3,83,0,41,
+ 3,160,2,116,3,124,1,131,1,161,1,1,0,124,3,160,
+ 2,116,3,124,2,131,1,161,1,1,0,124,3,160,2,116,
+ 4,160,5,124,0,161,1,161,1,1,0,124,3,83,0,41,
1,122,80,67,111,109,112,105,108,101,32,97,32,99,111,100,
101,32,111,98,106,101,99,116,32,105,110,116,111,32,98,121,
116,101,99,111,100,101,32,102,111,114,32,119,114,105,116,105,
@@ -704,14 +704,14 @@ const unsigned char _Py_M__importlib_external[] = {
114,144,0,0,0,114,130,0,0,0,114,138,0,0,0,114,
56,0,0,0,114,4,0,0,0,114,4,0,0,0,114,6,
0,0,0,218,17,95,99,111,100,101,95,116,111,95,98,121,
- 116,101,99,111,100,101,241,1,0,0,115,10,0,0,0,0,
+ 116,101,99,111,100,101,242,1,0,0,115,10,0,0,0,0,
3,8,1,14,1,14,1,16,1,114,148,0,0,0,99,1,
- 0,0,0,0,0,0,0,5,0,0,0,4,0,0,0,67,
+ 0,0,0,0,0,0,0,5,0,0,0,6,0,0,0,67,
0,0,0,115,62,0,0,0,100,1,100,2,108,0,125,1,
- 116,1,106,2,124,0,131,1,106,3,125,2,124,1,106,4,
- 124,2,131,1,125,3,116,1,106,5,100,2,100,3,131,2,
- 125,4,124,4,106,6,124,0,106,6,124,3,100,1,25,0,
- 131,1,131,1,83,0,41,4,122,121,68,101,99,111,100,101,
+ 116,1,160,2,124,0,161,1,106,3,125,2,124,1,160,4,
+ 124,2,161,1,125,3,116,1,160,5,100,2,100,3,161,2,
+ 125,4,124,4,160,6,124,0,160,6,124,3,100,1,25,0,
+ 161,1,161,1,83,0,41,4,122,121,68,101,99,111,100,101,
32,98,121,116,101,115,32,114,101,112,114,101,115,101,110,116,
105,110,103,32,115,111,117,114,99,101,32,99,111,100,101,32,
97,110,100,32,114,101,116,117,114,110,32,116,104,101,32,115,
@@ -731,29 +731,29 @@ const unsigned char _Py_M__importlib_external[] = {
101,110,99,111,100,105,110,103,90,15,110,101,119,108,105,110,
101,95,100,101,99,111,100,101,114,114,4,0,0,0,114,4,
0,0,0,114,6,0,0,0,218,13,100,101,99,111,100,101,
- 95,115,111,117,114,99,101,251,1,0,0,115,10,0,0,0,
+ 95,115,111,117,114,99,101,252,1,0,0,115,10,0,0,0,
0,5,8,1,12,1,10,1,12,1,114,153,0,0,0,41,
2,114,124,0,0,0,218,26,115,117,98,109,111,100,117,108,
101,95,115,101,97,114,99,104,95,108,111,99,97,116,105,111,
110,115,99,2,0,0,0,2,0,0,0,9,0,0,0,19,
0,0,0,67,0,0,0,115,18,1,0,0,124,1,100,1,
107,8,114,60,100,2,125,1,116,0,124,2,100,3,131,2,
- 114,70,121,14,124,2,106,1,124,0,131,1,125,1,87,0,
+ 114,70,121,14,124,2,160,1,124,0,161,1,125,1,87,0,
113,70,4,0,116,2,107,10,114,56,1,0,1,0,1,0,
- 89,0,113,70,88,0,110,10,116,3,106,4,124,1,131,1,
+ 89,0,113,70,88,0,110,10,116,3,160,4,124,1,161,1,
125,1,116,5,106,6,124,0,124,2,124,1,100,4,141,3,
125,4,100,5,124,4,95,7,124,2,100,1,107,8,114,156,
120,54,116,8,131,0,68,0,93,40,92,2,125,5,125,6,
- 124,1,106,9,116,10,124,6,131,1,131,1,114,108,124,5,
+ 124,1,160,9,116,10,124,6,131,1,161,1,114,108,124,5,
124,0,124,1,131,2,125,2,124,2,124,4,95,11,80,0,
113,108,87,0,100,1,83,0,124,3,116,12,107,8,114,222,
- 116,0,124,2,100,6,131,2,114,228,121,14,124,2,106,13,
- 124,0,131,1,125,7,87,0,110,20,4,0,116,2,107,10,
+ 116,0,124,2,100,6,131,2,114,228,121,14,124,2,160,13,
+ 124,0,161,1,125,7,87,0,110,20,4,0,116,2,107,10,
114,208,1,0,1,0,1,0,89,0,113,228,88,0,124,7,
114,228,103,0,124,4,95,14,110,6,124,3,124,4,95,14,
124,4,106,14,103,0,107,2,144,1,114,14,124,1,144,1,
114,14,116,15,124,1,131,1,100,7,25,0,125,8,124,4,
- 106,14,106,16,124,8,131,1,1,0,124,4,83,0,41,8,
+ 106,14,160,16,124,8,161,1,1,0,124,4,83,0,41,8,
97,61,1,0,0,82,101,116,117,114,110,32,97,32,109,111,
100,117,108,101,32,115,112,101,99,32,98,97,115,101,100,32,
111,110,32,97,32,102,105,108,101,32,108,111,99,97,116,105,
@@ -793,7 +793,7 @@ const unsigned char _Py_M__importlib_external[] = {
7,100,105,114,110,97,109,101,114,4,0,0,0,114,4,0,
0,0,114,6,0,0,0,218,23,115,112,101,99,95,102,114,
111,109,95,102,105,108,101,95,108,111,99,97,116,105,111,110,
- 12,2,0,0,115,62,0,0,0,0,12,8,4,4,1,10,
+ 13,2,0,0,115,62,0,0,0,0,12,8,4,4,1,10,
2,2,1,14,1,14,1,8,2,10,8,16,1,6,3,8,
1,16,1,14,1,10,1,6,1,6,2,4,3,8,2,10,
1,2,1,14,1,14,1,6,2,4,1,8,2,6,1,12,
@@ -819,27 +819,27 @@ const unsigned char _Py_M__importlib_external[] = {
114,115,105,111,110,125,92,77,111,100,117,108,101,115,92,123,
102,117,108,108,110,97,109,101,125,92,68,101,98,117,103,70,
99,2,0,0,0,0,0,0,0,2,0,0,0,11,0,0,
- 0,67,0,0,0,115,50,0,0,0,121,14,116,0,106,1,
- 116,0,106,2,124,1,131,2,83,0,4,0,116,3,107,10,
- 114,44,1,0,1,0,1,0,116,0,106,1,116,0,106,4,
- 124,1,131,2,83,0,88,0,100,0,83,0,41,1,78,41,
+ 0,67,0,0,0,115,50,0,0,0,121,14,116,0,160,1,
+ 116,0,106,2,124,1,161,2,83,0,4,0,116,3,107,10,
+ 114,44,1,0,1,0,1,0,116,0,160,1,116,0,106,4,
+ 124,1,161,2,83,0,88,0,100,0,83,0,41,1,78,41,
5,218,7,95,119,105,110,114,101,103,90,7,79,112,101,110,
75,101,121,90,17,72,75,69,89,95,67,85,82,82,69,78,
84,95,85,83,69,82,114,42,0,0,0,90,18,72,75,69,
89,95,76,79,67,65,76,95,77,65,67,72,73,78,69,41,
2,218,3,99,108,115,114,5,0,0,0,114,4,0,0,0,
114,4,0,0,0,114,6,0,0,0,218,14,95,111,112,101,
- 110,95,114,101,103,105,115,116,114,121,92,2,0,0,115,8,
+ 110,95,114,101,103,105,115,116,114,121,93,2,0,0,115,8,
0,0,0,0,2,2,1,14,1,14,1,122,36,87,105,110,
100,111,119,115,82,101,103,105,115,116,114,121,70,105,110,100,
101,114,46,95,111,112,101,110,95,114,101,103,105,115,116,114,
- 121,99,2,0,0,0,0,0,0,0,6,0,0,0,16,0,
+ 121,99,2,0,0,0,0,0,0,0,6,0,0,0,17,0,
0,0,67,0,0,0,115,112,0,0,0,124,0,106,0,114,
14,124,0,106,1,125,2,110,6,124,0,106,2,125,2,124,
2,106,3,124,1,100,1,116,4,106,5,100,0,100,2,133,
- 2,25,0,22,0,100,3,141,2,125,3,121,38,124,0,106,
- 6,124,3,131,1,143,18,125,4,116,7,106,8,124,4,100,
- 4,131,2,125,5,87,0,100,0,81,0,82,0,88,0,87,
+ 2,25,0,22,0,100,3,141,2,125,3,121,38,124,0,160,
+ 6,124,3,161,1,143,18,125,4,116,7,160,8,124,4,100,
+ 4,161,2,125,5,87,0,100,0,81,0,82,0,88,0,87,
0,110,20,4,0,116,9,107,10,114,106,1,0,1,0,1,
0,100,0,83,0,88,0,124,5,83,0,41,5,78,122,5,
37,100,46,37,100,114,59,0,0,0,41,2,114,123,0,0,
@@ -855,18 +855,18 @@ const unsigned char _Py_M__importlib_external[] = {
121,114,5,0,0,0,90,4,104,107,101,121,218,8,102,105,
108,101,112,97,116,104,114,4,0,0,0,114,4,0,0,0,
114,6,0,0,0,218,16,95,115,101,97,114,99,104,95,114,
- 101,103,105,115,116,114,121,99,2,0,0,115,22,0,0,0,
+ 101,103,105,115,116,114,121,100,2,0,0,115,22,0,0,0,
0,2,6,1,8,2,6,1,6,1,22,1,2,1,12,1,
26,1,14,1,6,1,122,38,87,105,110,100,111,119,115,82,
101,103,105,115,116,114,121,70,105,110,100,101,114,46,95,115,
101,97,114,99,104,95,114,101,103,105,115,116,114,121,78,99,
4,0,0,0,0,0,0,0,8,0,0,0,14,0,0,0,
- 67,0,0,0,115,120,0,0,0,124,0,106,0,124,1,131,
+ 67,0,0,0,115,120,0,0,0,124,0,160,0,124,1,161,
1,125,4,124,4,100,0,107,8,114,22,100,0,83,0,121,
12,116,1,124,4,131,1,1,0,87,0,110,20,4,0,116,
2,107,10,114,54,1,0,1,0,1,0,100,0,83,0,88,
0,120,58,116,3,131,0,68,0,93,48,92,2,125,5,125,
- 6,124,4,106,4,116,5,124,6,131,1,131,1,114,64,116,
+ 6,124,4,160,4,116,5,124,6,131,1,161,1,114,64,116,
6,106,7,124,1,124,5,124,1,124,4,131,2,124,4,100,
1,141,3,125,7,124,7,83,0,113,64,87,0,100,0,83,
0,41,2,78,41,1,114,156,0,0,0,41,8,114,175,0,
@@ -877,13 +877,13 @@ const unsigned char _Py_M__importlib_external[] = {
0,0,0,218,6,116,97,114,103,101,116,114,174,0,0,0,
114,124,0,0,0,114,164,0,0,0,114,162,0,0,0,114,
4,0,0,0,114,4,0,0,0,114,6,0,0,0,218,9,
- 102,105,110,100,95,115,112,101,99,114,2,0,0,115,26,0,
+ 102,105,110,100,95,115,112,101,99,115,2,0,0,115,26,0,
0,0,0,2,10,1,8,1,4,1,2,1,12,1,14,1,
6,1,16,1,14,1,6,1,8,1,8,1,122,31,87,105,
110,100,111,119,115,82,101,103,105,115,116,114,121,70,105,110,
100,101,114,46,102,105,110,100,95,115,112,101,99,99,3,0,
- 0,0,0,0,0,0,4,0,0,0,3,0,0,0,67,0,
- 0,0,115,34,0,0,0,124,0,106,0,124,1,124,2,131,
+ 0,0,0,0,0,0,4,0,0,0,4,0,0,0,67,0,
+ 0,0,115,34,0,0,0,124,0,160,0,124,1,124,2,161,
2,125,3,124,3,100,1,107,9,114,26,124,3,106,1,83,
0,100,1,83,0,100,1,83,0,41,2,122,108,70,105,110,
100,32,109,111,100,117,108,101,32,110,97,109,101,100,32,105,
@@ -896,7 +896,7 @@ const unsigned char _Py_M__importlib_external[] = {
0,114,124,0,0,0,41,4,114,168,0,0,0,114,123,0,
0,0,114,37,0,0,0,114,162,0,0,0,114,4,0,0,
0,114,4,0,0,0,114,6,0,0,0,218,11,102,105,110,
- 100,95,109,111,100,117,108,101,130,2,0,0,115,8,0,0,
+ 100,95,109,111,100,117,108,101,131,2,0,0,115,8,0,0,
0,0,7,12,1,8,1,6,2,122,33,87,105,110,100,111,
119,115,82,101,103,105,115,116,114,121,70,105,110,100,101,114,
46,102,105,110,100,95,109,111,100,117,108,101,41,2,78,78,
@@ -906,7 +906,7 @@ const unsigned char _Py_M__importlib_external[] = {
101,116,104,111,100,114,169,0,0,0,114,175,0,0,0,114,
178,0,0,0,114,179,0,0,0,114,4,0,0,0,114,4,
0,0,0,114,4,0,0,0,114,6,0,0,0,114,166,0,
- 0,0,80,2,0,0,115,20,0,0,0,8,2,4,3,4,
+ 0,0,81,2,0,0,115,20,0,0,0,8,2,4,3,4,
3,4,2,4,2,12,7,12,15,2,1,12,15,2,1,114,
166,0,0,0,99,0,0,0,0,0,0,0,0,0,0,0,
0,2,0,0,0,64,0,0,0,115,48,0,0,0,101,0,
@@ -920,10 +920,10 @@ const unsigned char _Py_M__importlib_external[] = {
76,111,97,100,101,114,32,97,110,100,10,32,32,32,32,83,
111,117,114,99,101,108,101,115,115,70,105,108,101,76,111,97,
100,101,114,46,99,2,0,0,0,0,0,0,0,5,0,0,
- 0,3,0,0,0,67,0,0,0,115,64,0,0,0,116,0,
- 124,0,106,1,124,1,131,1,131,1,100,1,25,0,125,2,
- 124,2,106,2,100,2,100,1,131,2,100,3,25,0,125,3,
- 124,1,106,3,100,2,131,1,100,4,25,0,125,4,124,3,
+ 0,4,0,0,0,67,0,0,0,115,64,0,0,0,116,0,
+ 124,0,160,1,124,1,161,1,131,1,100,1,25,0,125,2,
+ 124,2,160,2,100,2,100,1,161,2,100,3,25,0,125,3,
+ 124,1,160,3,100,2,161,1,100,4,25,0,125,4,124,3,
100,5,107,2,111,62,124,4,100,5,107,3,83,0,41,6,
122,141,67,111,110,99,114,101,116,101,32,105,109,112,108,101,
109,101,110,116,97,116,105,111,110,32,111,102,32,73,110,115,
@@ -941,7 +941,7 @@ const unsigned char _Py_M__importlib_external[] = {
98,0,0,0,90,13,102,105,108,101,110,97,109,101,95,98,
97,115,101,90,9,116,97,105,108,95,110,97,109,101,114,4,
0,0,0,114,4,0,0,0,114,6,0,0,0,114,157,0,
- 0,0,149,2,0,0,115,8,0,0,0,0,3,18,1,16,
+ 0,0,150,2,0,0,115,8,0,0,0,0,3,18,1,16,
1,14,1,122,24,95,76,111,97,100,101,114,66,97,115,105,
99,115,46,105,115,95,112,97,99,107,97,103,101,99,2,0,
0,0,0,0,0,0,2,0,0,0,1,0,0,0,67,0,
@@ -951,14 +951,14 @@ const unsigned char _Py_M__importlib_external[] = {
99,114,101,97,116,105,111,110,46,78,114,4,0,0,0,41,
2,114,104,0,0,0,114,162,0,0,0,114,4,0,0,0,
114,4,0,0,0,114,6,0,0,0,218,13,99,114,101,97,
- 116,101,95,109,111,100,117,108,101,157,2,0,0,115,0,0,
+ 116,101,95,109,111,100,117,108,101,158,2,0,0,115,0,0,
0,0,122,27,95,76,111,97,100,101,114,66,97,115,105,99,
115,46,99,114,101,97,116,101,95,109,111,100,117,108,101,99,
- 2,0,0,0,0,0,0,0,3,0,0,0,4,0,0,0,
- 67,0,0,0,115,56,0,0,0,124,0,106,0,124,1,106,
- 1,131,1,125,2,124,2,100,1,107,8,114,36,116,2,100,
- 2,106,3,124,1,106,1,131,1,131,1,130,1,116,4,106,
- 5,116,6,124,2,124,1,106,7,131,3,1,0,100,1,83,
+ 2,0,0,0,0,0,0,0,3,0,0,0,5,0,0,0,
+ 67,0,0,0,115,56,0,0,0,124,0,160,0,124,1,106,
+ 1,161,1,125,2,124,2,100,1,107,8,114,36,116,2,100,
+ 2,160,3,124,1,106,1,161,1,131,1,130,1,116,4,160,
+ 5,116,6,124,2,124,1,106,7,161,3,1,0,100,1,83,
0,41,3,122,19,69,120,101,99,117,116,101,32,116,104,101,
32,109,111,100,117,108,101,46,78,122,52,99,97,110,110,111,
116,32,108,111,97,100,32,109,111,100,117,108,101,32,123,33,
@@ -971,25 +971,25 @@ const unsigned char _Py_M__importlib_external[] = {
114,115,0,0,0,41,3,114,104,0,0,0,218,6,109,111,
100,117,108,101,114,144,0,0,0,114,4,0,0,0,114,4,
0,0,0,114,6,0,0,0,218,11,101,120,101,99,95,109,
- 111,100,117,108,101,160,2,0,0,115,10,0,0,0,0,2,
+ 111,100,117,108,101,161,2,0,0,115,10,0,0,0,0,2,
12,1,8,1,6,1,10,1,122,25,95,76,111,97,100,101,
114,66,97,115,105,99,115,46,101,120,101,99,95,109,111,100,
117,108,101,99,2,0,0,0,0,0,0,0,2,0,0,0,
- 3,0,0,0,67,0,0,0,115,12,0,0,0,116,0,106,
- 1,124,0,124,1,131,2,83,0,41,1,122,26,84,104,105,
+ 4,0,0,0,67,0,0,0,115,12,0,0,0,116,0,160,
+ 1,124,0,124,1,161,2,83,0,41,1,122,26,84,104,105,
115,32,109,111,100,117,108,101,32,105,115,32,100,101,112,114,
101,99,97,116,101,100,46,41,2,114,118,0,0,0,218,17,
95,108,111,97,100,95,109,111,100,117,108,101,95,115,104,105,
109,41,2,114,104,0,0,0,114,123,0,0,0,114,4,0,
0,0,114,4,0,0,0,114,6,0,0,0,218,11,108,111,
- 97,100,95,109,111,100,117,108,101,168,2,0,0,115,2,0,
+ 97,100,95,109,111,100,117,108,101,169,2,0,0,115,2,0,
0,0,0,2,122,25,95,76,111,97,100,101,114,66,97,115,
105,99,115,46,108,111,97,100,95,109,111,100,117,108,101,78,
41,8,114,109,0,0,0,114,108,0,0,0,114,110,0,0,
0,114,111,0,0,0,114,157,0,0,0,114,183,0,0,0,
114,188,0,0,0,114,190,0,0,0,114,4,0,0,0,114,
4,0,0,0,114,4,0,0,0,114,6,0,0,0,114,181,
- 0,0,0,144,2,0,0,115,10,0,0,0,8,3,4,2,
+ 0,0,0,145,2,0,0,115,10,0,0,0,8,3,4,2,
8,8,8,3,8,8,114,181,0,0,0,99,0,0,0,0,
0,0,0,0,0,0,0,0,3,0,0,0,64,0,0,0,
115,74,0,0,0,101,0,90,1,100,0,90,2,100,1,100,
@@ -1014,12 +1014,12 @@ const unsigned char _Py_M__importlib_external[] = {
32,32,32,32,32,32,32,78,41,1,218,7,73,79,69,114,
114,111,114,41,2,114,104,0,0,0,114,37,0,0,0,114,
4,0,0,0,114,4,0,0,0,114,6,0,0,0,218,10,
- 112,97,116,104,95,109,116,105,109,101,175,2,0,0,115,2,
+ 112,97,116,104,95,109,116,105,109,101,176,2,0,0,115,2,
0,0,0,0,6,122,23,83,111,117,114,99,101,76,111,97,
100,101,114,46,112,97,116,104,95,109,116,105,109,101,99,2,
- 0,0,0,0,0,0,0,2,0,0,0,3,0,0,0,67,
- 0,0,0,115,14,0,0,0,100,1,124,0,106,0,124,1,
- 131,1,105,1,83,0,41,2,97,170,1,0,0,79,112,116,
+ 0,0,0,0,0,0,0,2,0,0,0,4,0,0,0,67,
+ 0,0,0,115,14,0,0,0,100,1,124,0,160,0,124,1,
+ 161,1,105,1,83,0,41,2,97,170,1,0,0,79,112,116,
105,111,110,97,108,32,109,101,116,104,111,100,32,114,101,116,
117,114,110,105,110,103,32,97,32,109,101,116,97,100,97,116,
97,32,100,105,99,116,32,102,111,114,32,116,104,101,32,115,
@@ -1049,12 +1049,12 @@ const unsigned char _Py_M__importlib_external[] = {
32,32,32,32,32,32,32,114,130,0,0,0,41,1,114,193,
0,0,0,41,2,114,104,0,0,0,114,37,0,0,0,114,
4,0,0,0,114,4,0,0,0,114,6,0,0,0,218,10,
- 112,97,116,104,95,115,116,97,116,115,183,2,0,0,115,2,
+ 112,97,116,104,95,115,116,97,116,115,184,2,0,0,115,2,
0,0,0,0,11,122,23,83,111,117,114,99,101,76,111,97,
100,101,114,46,112,97,116,104,95,115,116,97,116,115,99,4,
- 0,0,0,0,0,0,0,4,0,0,0,3,0,0,0,67,
- 0,0,0,115,12,0,0,0,124,0,106,0,124,2,124,3,
- 131,2,83,0,41,1,122,228,79,112,116,105,111,110,97,108,
+ 0,0,0,0,0,0,0,4,0,0,0,4,0,0,0,67,
+ 0,0,0,115,12,0,0,0,124,0,160,0,124,2,124,3,
+ 161,2,83,0,41,1,122,228,79,112,116,105,111,110,97,108,
32,109,101,116,104,111,100,32,119,104,105,99,104,32,119,114,
105,116,101,115,32,100,97,116,97,32,40,98,121,116,101,115,
41,32,116,111,32,97,32,102,105,108,101,32,112,97,116,104,
@@ -1073,7 +1073,7 @@ const unsigned char _Py_M__importlib_external[] = {
94,0,0,0,90,10,99,97,99,104,101,95,112,97,116,104,
114,56,0,0,0,114,4,0,0,0,114,4,0,0,0,114,
6,0,0,0,218,15,95,99,97,99,104,101,95,98,121,116,
- 101,99,111,100,101,196,2,0,0,115,2,0,0,0,0,8,
+ 101,99,111,100,101,197,2,0,0,115,2,0,0,0,0,8,
122,28,83,111,117,114,99,101,76,111,97,100,101,114,46,95,
99,97,99,104,101,95,98,121,116,101,99,111,100,101,99,3,
0,0,0,0,0,0,0,3,0,0,0,1,0,0,0,67,
@@ -1090,11 +1090,11 @@ const unsigned char _Py_M__importlib_external[] = {
32,32,32,32,32,32,78,114,4,0,0,0,41,3,114,104,
0,0,0,114,37,0,0,0,114,56,0,0,0,114,4,0,
0,0,114,4,0,0,0,114,6,0,0,0,114,195,0,0,
- 0,206,2,0,0,115,0,0,0,0,122,21,83,111,117,114,
+ 0,207,2,0,0,115,0,0,0,0,122,21,83,111,117,114,
99,101,76,111,97,100,101,114,46,115,101,116,95,100,97,116,
97,99,2,0,0,0,0,0,0,0,5,0,0,0,16,0,
- 0,0,67,0,0,0,115,82,0,0,0,124,0,106,0,124,
- 1,131,1,125,2,121,14,124,0,106,1,124,2,131,1,125,
+ 0,0,67,0,0,0,115,82,0,0,0,124,0,160,0,124,
+ 1,161,1,125,2,121,14,124,0,160,1,124,2,161,1,125,
3,87,0,110,48,4,0,116,2,107,10,114,72,1,0,125,
4,1,0,122,20,116,3,100,1,124,1,100,2,141,2,124,
4,130,2,87,0,89,0,100,3,100,3,125,4,126,4,88,
@@ -1110,7 +1110,7 @@ const unsigned char _Py_M__importlib_external[] = {
0,114,153,0,0,0,41,5,114,104,0,0,0,114,123,0,
0,0,114,37,0,0,0,114,151,0,0,0,218,3,101,120,
99,114,4,0,0,0,114,4,0,0,0,114,6,0,0,0,
- 218,10,103,101,116,95,115,111,117,114,99,101,213,2,0,0,
+ 218,10,103,101,116,95,115,111,117,114,99,101,214,2,0,0,
115,14,0,0,0,0,2,10,1,2,1,14,1,16,1,4,
1,28,1,122,23,83,111,117,114,99,101,76,111,97,100,101,
114,46,103,101,116,95,115,111,117,114,99,101,114,31,0,0,
@@ -1132,31 +1132,31 @@ const unsigned char _Py_M__importlib_external[] = {
112,105,108,101,41,4,114,104,0,0,0,114,56,0,0,0,
114,37,0,0,0,114,200,0,0,0,114,4,0,0,0,114,
4,0,0,0,114,6,0,0,0,218,14,115,111,117,114,99,
- 101,95,116,111,95,99,111,100,101,223,2,0,0,115,4,0,
+ 101,95,116,111,95,99,111,100,101,224,2,0,0,115,4,0,
0,0,0,5,12,1,122,27,83,111,117,114,99,101,76,111,
97,100,101,114,46,115,111,117,114,99,101,95,116,111,95,99,
111,100,101,99,2,0,0,0,0,0,0,0,10,0,0,0,
- 43,0,0,0,67,0,0,0,115,94,1,0,0,124,0,106,
- 0,124,1,131,1,125,2,100,1,125,3,121,12,116,1,124,
+ 43,0,0,0,67,0,0,0,115,94,1,0,0,124,0,160,
+ 0,124,1,161,1,125,2,100,1,125,3,121,12,116,1,124,
2,131,1,125,4,87,0,110,24,4,0,116,2,107,10,114,
50,1,0,1,0,1,0,100,1,125,4,89,0,110,162,88,
- 0,121,14,124,0,106,3,124,2,131,1,125,5,87,0,110,
+ 0,121,14,124,0,160,3,124,2,161,1,125,5,87,0,110,
20,4,0,116,4,107,10,114,86,1,0,1,0,1,0,89,
0,110,126,88,0,116,5,124,5,100,2,25,0,131,1,125,
- 3,121,14,124,0,106,6,124,4,131,1,125,6,87,0,110,
+ 3,121,14,124,0,160,6,124,4,161,1,125,6,87,0,110,
20,4,0,116,7,107,10,114,134,1,0,1,0,1,0,89,
0,110,78,88,0,121,20,116,8,124,6,124,5,124,1,124,
4,100,3,141,4,125,7,87,0,110,24,4,0,116,9,116,
10,102,2,107,10,114,180,1,0,1,0,1,0,89,0,110,
- 32,88,0,116,11,106,12,100,4,124,4,124,2,131,3,1,
+ 32,88,0,116,11,160,12,100,4,124,4,124,2,161,3,1,
0,116,13,124,7,124,1,124,4,124,2,100,5,141,4,83,
- 0,124,0,106,6,124,2,131,1,125,8,124,0,106,14,124,
- 8,124,2,131,2,125,9,116,11,106,12,100,6,124,2,131,
+ 0,124,0,160,6,124,2,161,1,125,8,124,0,160,14,124,
+ 8,124,2,161,2,125,9,116,11,160,12,100,6,124,2,161,
2,1,0,116,15,106,16,12,0,144,1,114,90,124,4,100,
1,107,9,144,1,114,90,124,3,100,1,107,9,144,1,114,
90,116,17,124,9,124,3,116,18,124,8,131,1,131,3,125,
- 6,121,30,124,0,106,19,124,2,124,4,124,6,131,3,1,
- 0,116,11,106,12,100,7,124,4,131,2,1,0,87,0,110,
+ 6,121,30,124,0,160,19,124,2,124,4,124,6,161,3,1,
+ 0,116,11,160,12,100,7,124,4,161,2,1,0,87,0,110,
22,4,0,116,2,107,10,144,1,114,88,1,0,1,0,1,
0,89,0,110,2,88,0,124,9,83,0,41,8,122,190,67,
111,110,99,114,101,116,101,32,105,109,112,108,101,109,101,110,
@@ -1189,7 +1189,7 @@ const unsigned char _Py_M__importlib_external[] = {
10,98,121,116,101,115,95,100,97,116,97,114,151,0,0,0,
90,11,99,111,100,101,95,111,98,106,101,99,116,114,4,0,
0,0,114,4,0,0,0,114,6,0,0,0,114,184,0,0,
- 0,231,2,0,0,115,78,0,0,0,0,7,10,1,4,1,
+ 0,232,2,0,0,115,78,0,0,0,0,7,10,1,4,1,
2,1,12,1,14,1,10,2,2,1,14,1,14,1,6,2,
12,1,2,1,14,1,14,1,6,2,2,1,4,1,4,1,
12,1,18,1,6,2,8,1,6,1,6,1,2,1,8,1,
@@ -1201,7 +1201,7 @@ const unsigned char _Py_M__importlib_external[] = {
114,196,0,0,0,114,195,0,0,0,114,199,0,0,0,114,
203,0,0,0,114,184,0,0,0,114,4,0,0,0,114,4,
0,0,0,114,4,0,0,0,114,6,0,0,0,114,191,0,
- 0,0,173,2,0,0,115,14,0,0,0,8,2,8,8,8,
+ 0,0,174,2,0,0,115,14,0,0,0,8,2,8,8,8,
13,8,10,8,7,8,10,14,8,114,191,0,0,0,99,0,
0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,
0,0,0,115,80,0,0,0,101,0,90,1,100,0,90,2,
@@ -1227,7 +1227,7 @@ const unsigned char _Py_M__importlib_external[] = {
32,102,105,110,100,101,114,46,78,41,2,114,102,0,0,0,
114,37,0,0,0,41,3,114,104,0,0,0,114,123,0,0,
0,114,37,0,0,0,114,4,0,0,0,114,4,0,0,0,
- 114,6,0,0,0,114,182,0,0,0,32,3,0,0,115,4,
+ 114,6,0,0,0,114,182,0,0,0,33,3,0,0,115,4,
0,0,0,0,3,6,1,122,19,70,105,108,101,76,111,97,
100,101,114,46,95,95,105,110,105,116,95,95,99,2,0,0,
0,0,0,0,0,2,0,0,0,2,0,0,0,67,0,0,
@@ -1236,7 +1236,7 @@ const unsigned char _Py_M__importlib_external[] = {
78,41,2,218,9,95,95,99,108,97,115,115,95,95,114,115,
0,0,0,41,2,114,104,0,0,0,218,5,111,116,104,101,
114,114,4,0,0,0,114,4,0,0,0,114,6,0,0,0,
- 218,6,95,95,101,113,95,95,38,3,0,0,115,4,0,0,
+ 218,6,95,95,101,113,95,95,39,3,0,0,115,4,0,0,
0,0,1,12,1,122,17,70,105,108,101,76,111,97,100,101,
114,46,95,95,101,113,95,95,99,1,0,0,0,0,0,0,
0,1,0,0,0,3,0,0,0,67,0,0,0,115,20,0,
@@ -1244,12 +1244,12 @@ const unsigned char _Py_M__importlib_external[] = {
131,1,65,0,83,0,41,1,78,41,3,218,4,104,97,115,
104,114,102,0,0,0,114,37,0,0,0,41,1,114,104,0,
0,0,114,4,0,0,0,114,4,0,0,0,114,6,0,0,
- 0,218,8,95,95,104,97,115,104,95,95,42,3,0,0,115,
+ 0,218,8,95,95,104,97,115,104,95,95,43,3,0,0,115,
2,0,0,0,0,1,122,19,70,105,108,101,76,111,97,100,
101,114,46,95,95,104,97,115,104,95,95,99,2,0,0,0,
0,0,0,0,2,0,0,0,3,0,0,0,3,0,0,0,
- 115,16,0,0,0,116,0,116,1,124,0,131,2,106,2,124,
- 1,131,1,83,0,41,1,122,100,76,111,97,100,32,97,32,
+ 115,16,0,0,0,116,0,116,1,124,0,131,2,160,2,124,
+ 1,161,1,83,0,41,1,122,100,76,111,97,100,32,97,32,
109,111,100,117,108,101,32,102,114,111,109,32,97,32,102,105,
108,101,46,10,10,32,32,32,32,32,32,32,32,84,104,105,
115,32,109,101,116,104,111,100,32,105,115,32,100,101,112,114,
@@ -1259,7 +1259,7 @@ const unsigned char _Py_M__importlib_external[] = {
5,115,117,112,101,114,114,207,0,0,0,114,190,0,0,0,
41,2,114,104,0,0,0,114,123,0,0,0,41,1,114,208,
0,0,0,114,4,0,0,0,114,6,0,0,0,114,190,0,
- 0,0,45,3,0,0,115,2,0,0,0,0,10,122,22,70,
+ 0,0,46,3,0,0,115,2,0,0,0,0,10,122,22,70,
105,108,101,76,111,97,100,101,114,46,108,111,97,100,95,109,
111,100,117,108,101,99,2,0,0,0,0,0,0,0,2,0,
0,0,1,0,0,0,67,0,0,0,115,6,0,0,0,124,
@@ -1269,19 +1269,19 @@ const unsigned char _Py_M__importlib_external[] = {
111,117,110,100,32,98,121,32,116,104,101,32,102,105,110,100,
101,114,46,41,1,114,37,0,0,0,41,2,114,104,0,0,
0,114,123,0,0,0,114,4,0,0,0,114,4,0,0,0,
- 114,6,0,0,0,114,155,0,0,0,57,3,0,0,115,2,
+ 114,6,0,0,0,114,155,0,0,0,58,3,0,0,115,2,
0,0,0,0,3,122,23,70,105,108,101,76,111,97,100,101,
114,46,103,101,116,95,102,105,108,101,110,97,109,101,99,2,
0,0,0,0,0,0,0,3,0,0,0,9,0,0,0,67,
- 0,0,0,115,32,0,0,0,116,0,106,1,124,1,100,1,
- 131,2,143,10,125,2,124,2,106,2,131,0,83,0,81,0,
+ 0,0,0,115,32,0,0,0,116,0,160,1,124,1,100,1,
+ 161,2,143,10,125,2,124,2,160,2,161,0,83,0,81,0,
82,0,88,0,100,2,83,0,41,3,122,39,82,101,116,117,
114,110,32,116,104,101,32,100,97,116,97,32,102,114,111,109,
32,112,97,116,104,32,97,115,32,114,97,119,32,98,121,116,
101,115,46,218,1,114,78,41,3,114,52,0,0,0,114,53,
0,0,0,90,4,114,101,97,100,41,3,114,104,0,0,0,
114,37,0,0,0,114,57,0,0,0,114,4,0,0,0,114,
- 4,0,0,0,114,6,0,0,0,114,197,0,0,0,62,3,
+ 4,0,0,0,114,6,0,0,0,114,197,0,0,0,63,3,
0,0,115,4,0,0,0,0,2,14,1,122,19,70,105,108,
101,76,111,97,100,101,114,46,103,101,116,95,100,97,116,97,
41,12,114,109,0,0,0,114,108,0,0,0,114,110,0,0,
@@ -1290,7 +1290,7 @@ const unsigned char _Py_M__importlib_external[] = {
155,0,0,0,114,197,0,0,0,90,13,95,95,99,108,97,
115,115,99,101,108,108,95,95,114,4,0,0,0,114,4,0,
0,0,41,1,114,208,0,0,0,114,6,0,0,0,114,207,
- 0,0,0,27,3,0,0,115,14,0,0,0,8,3,4,2,
+ 0,0,0,28,3,0,0,115,14,0,0,0,8,3,4,2,
8,6,8,4,8,3,16,12,12,5,114,207,0,0,0,99,
0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,
64,0,0,0,115,46,0,0,0,101,0,90,1,100,0,90,
@@ -1311,7 +1311,7 @@ const unsigned char _Py_M__importlib_external[] = {
0,0,0,218,8,115,116,95,109,116,105,109,101,90,7,115,
116,95,115,105,122,101,41,3,114,104,0,0,0,114,37,0,
0,0,114,205,0,0,0,114,4,0,0,0,114,4,0,0,
- 0,114,6,0,0,0,114,194,0,0,0,72,3,0,0,115,
+ 0,114,6,0,0,0,114,194,0,0,0,73,3,0,0,115,
4,0,0,0,0,2,8,1,122,27,83,111,117,114,99,101,
70,105,108,101,76,111,97,100,101,114,46,112,97,116,104,95,
115,116,97,116,115,99,4,0,0,0,0,0,0,0,5,0,
@@ -1321,27 +1321,27 @@ const unsigned char _Py_M__importlib_external[] = {
111,100,101,41,2,114,101,0,0,0,114,195,0,0,0,41,
5,114,104,0,0,0,114,94,0,0,0,114,93,0,0,0,
114,56,0,0,0,114,44,0,0,0,114,4,0,0,0,114,
- 4,0,0,0,114,6,0,0,0,114,196,0,0,0,77,3,
+ 4,0,0,0,114,6,0,0,0,114,196,0,0,0,78,3,
0,0,115,4,0,0,0,0,2,8,1,122,32,83,111,117,
114,99,101,70,105,108,101,76,111,97,100,101,114,46,95,99,
97,99,104,101,95,98,121,116,101,99,111,100,101,105,182,1,
0,0,41,1,114,217,0,0,0,99,3,0,0,0,1,0,
- 0,0,9,0,0,0,17,0,0,0,67,0,0,0,115,250,
+ 0,0,9,0,0,0,18,0,0,0,67,0,0,0,115,250,
0,0,0,116,0,124,1,131,1,92,2,125,4,125,5,103,
0,125,6,120,40,124,4,114,56,116,1,124,4,131,1,12,
0,114,56,116,0,124,4,131,1,92,2,125,4,125,7,124,
- 6,106,2,124,7,131,1,1,0,113,18,87,0,120,108,116,
+ 6,160,2,124,7,161,1,1,0,113,18,87,0,120,108,116,
3,124,6,131,1,68,0,93,96,125,7,116,4,124,4,124,
- 7,131,2,125,4,121,14,116,5,106,6,124,4,131,1,1,
+ 7,131,2,125,4,121,14,116,5,160,6,124,4,161,1,1,
0,87,0,113,68,4,0,116,7,107,10,114,118,1,0,1,
0,1,0,119,68,89,0,113,68,4,0,116,8,107,10,114,
- 162,1,0,125,8,1,0,122,18,116,9,106,10,100,1,124,
- 4,124,8,131,3,1,0,100,2,83,0,100,2,125,8,126,
+ 162,1,0,125,8,1,0,122,18,116,9,160,10,100,1,124,
+ 4,124,8,161,3,1,0,100,2,83,0,100,2,125,8,126,
8,88,0,113,68,88,0,113,68,87,0,121,28,116,11,124,
- 1,124,2,124,3,131,3,1,0,116,9,106,10,100,3,124,
- 1,131,2,1,0,87,0,110,48,4,0,116,8,107,10,114,
- 244,1,0,125,8,1,0,122,20,116,9,106,10,100,1,124,
- 1,124,8,131,3,1,0,87,0,89,0,100,2,100,2,125,
+ 1,124,2,124,3,131,3,1,0,116,9,160,10,100,3,124,
+ 1,161,2,1,0,87,0,110,48,4,0,116,8,107,10,114,
+ 244,1,0,125,8,1,0,122,20,116,9,160,10,100,1,124,
+ 1,124,8,161,3,1,0,87,0,89,0,100,2,100,2,125,
8,126,8,88,0,110,2,88,0,100,2,83,0,41,4,122,
27,87,114,105,116,101,32,98,121,116,101,115,32,100,97,116,
97,32,116,111,32,97,32,102,105,108,101,46,122,27,99,111,
@@ -1356,7 +1356,7 @@ const unsigned char _Py_M__importlib_external[] = {
114,56,0,0,0,114,217,0,0,0,218,6,112,97,114,101,
110,116,114,98,0,0,0,114,29,0,0,0,114,25,0,0,
0,114,198,0,0,0,114,4,0,0,0,114,4,0,0,0,
- 114,6,0,0,0,114,195,0,0,0,82,3,0,0,115,42,
+ 114,6,0,0,0,114,195,0,0,0,83,3,0,0,115,42,
0,0,0,0,2,12,1,4,2,16,1,12,1,14,2,14,
1,10,1,2,1,14,1,14,2,6,1,16,3,6,1,8,
1,20,1,2,1,12,1,16,1,16,2,8,1,122,25,83,
@@ -1365,7 +1365,7 @@ const unsigned char _Py_M__importlib_external[] = {
114,108,0,0,0,114,110,0,0,0,114,111,0,0,0,114,
194,0,0,0,114,196,0,0,0,114,195,0,0,0,114,4,
0,0,0,114,4,0,0,0,114,4,0,0,0,114,6,0,
- 0,0,114,215,0,0,0,68,3,0,0,115,8,0,0,0,
+ 0,0,114,215,0,0,0,69,3,0,0,115,8,0,0,0,
8,2,4,2,8,5,8,5,114,215,0,0,0,99,0,0,
0,0,0,0,0,0,0,0,0,0,2,0,0,0,64,0,
0,0,115,32,0,0,0,101,0,90,1,100,0,90,2,100,
@@ -1376,8 +1376,8 @@ const unsigned char _Py_M__importlib_external[] = {
110,100,108,101,115,32,115,111,117,114,99,101,108,101,115,115,
32,102,105,108,101,32,105,109,112,111,114,116,115,46,99,2,
0,0,0,0,0,0,0,5,0,0,0,5,0,0,0,67,
- 0,0,0,115,48,0,0,0,124,0,106,0,124,1,131,1,
- 125,2,124,0,106,1,124,2,131,1,125,3,116,2,124,3,
+ 0,0,0,115,48,0,0,0,124,0,160,0,124,1,161,1,
+ 125,2,124,0,160,1,124,2,161,1,125,3,116,2,124,3,
124,1,124,2,100,1,141,3,125,4,116,3,124,4,124,1,
124,2,100,2,141,3,83,0,41,3,78,41,2,114,102,0,
0,0,114,37,0,0,0,41,2,114,102,0,0,0,114,93,
@@ -1385,7 +1385,7 @@ const unsigned char _Py_M__importlib_external[] = {
139,0,0,0,114,145,0,0,0,41,5,114,104,0,0,0,
114,123,0,0,0,114,37,0,0,0,114,56,0,0,0,114,
206,0,0,0,114,4,0,0,0,114,4,0,0,0,114,6,
- 0,0,0,114,184,0,0,0,117,3,0,0,115,8,0,0,
+ 0,0,0,114,184,0,0,0,118,3,0,0,115,8,0,0,
0,0,1,10,1,10,1,14,1,122,29,83,111,117,114,99,
101,108,101,115,115,70,105,108,101,76,111,97,100,101,114,46,
103,101,116,95,99,111,100,101,99,2,0,0,0,0,0,0,
@@ -1395,13 +1395,13 @@ const unsigned char _Py_M__importlib_external[] = {
115,32,110,111,32,115,111,117,114,99,101,32,99,111,100,101,
46,78,114,4,0,0,0,41,2,114,104,0,0,0,114,123,
0,0,0,114,4,0,0,0,114,4,0,0,0,114,6,0,
- 0,0,114,199,0,0,0,123,3,0,0,115,2,0,0,0,
+ 0,0,114,199,0,0,0,124,3,0,0,115,2,0,0,0,
0,2,122,31,83,111,117,114,99,101,108,101,115,115,70,105,
108,101,76,111,97,100,101,114,46,103,101,116,95,115,111,117,
114,99,101,78,41,6,114,109,0,0,0,114,108,0,0,0,
114,110,0,0,0,114,111,0,0,0,114,184,0,0,0,114,
199,0,0,0,114,4,0,0,0,114,4,0,0,0,114,4,
- 0,0,0,114,6,0,0,0,114,220,0,0,0,113,3,0,
+ 0,0,0,114,6,0,0,0,114,220,0,0,0,114,3,0,
0,115,6,0,0,0,8,2,4,2,8,6,114,220,0,0,
0,99,0,0,0,0,0,0,0,0,0,0,0,0,3,0,
0,0,64,0,0,0,115,92,0,0,0,101,0,90,1,100,
@@ -1423,7 +1423,7 @@ const unsigned char _Py_M__importlib_external[] = {
0,95,1,100,0,83,0,41,1,78,41,2,114,102,0,0,
0,114,37,0,0,0,41,3,114,104,0,0,0,114,102,0,
0,0,114,37,0,0,0,114,4,0,0,0,114,4,0,0,
- 0,114,6,0,0,0,114,182,0,0,0,140,3,0,0,115,
+ 0,114,6,0,0,0,114,182,0,0,0,141,3,0,0,115,
4,0,0,0,0,1,6,1,122,28,69,120,116,101,110,115,
105,111,110,70,105,108,101,76,111,97,100,101,114,46,95,95,
105,110,105,116,95,95,99,2,0,0,0,0,0,0,0,2,
@@ -1432,7 +1432,7 @@ const unsigned char _Py_M__importlib_external[] = {
124,1,106,1,107,2,83,0,41,1,78,41,2,114,208,0,
0,0,114,115,0,0,0,41,2,114,104,0,0,0,114,209,
0,0,0,114,4,0,0,0,114,4,0,0,0,114,6,0,
- 0,0,114,210,0,0,0,144,3,0,0,115,4,0,0,0,
+ 0,0,114,210,0,0,0,145,3,0,0,115,4,0,0,0,
0,1,12,1,122,26,69,120,116,101,110,115,105,111,110,70,
105,108,101,76,111,97,100,101,114,46,95,95,101,113,95,95,
99,1,0,0,0,0,0,0,0,1,0,0,0,3,0,0,
@@ -1440,13 +1440,13 @@ const unsigned char _Py_M__importlib_external[] = {
131,1,116,0,124,0,106,2,131,1,65,0,83,0,41,1,
78,41,3,114,211,0,0,0,114,102,0,0,0,114,37,0,
0,0,41,1,114,104,0,0,0,114,4,0,0,0,114,4,
- 0,0,0,114,6,0,0,0,114,212,0,0,0,148,3,0,
+ 0,0,0,114,6,0,0,0,114,212,0,0,0,149,3,0,
0,115,2,0,0,0,0,1,122,28,69,120,116,101,110,115,
105,111,110,70,105,108,101,76,111,97,100,101,114,46,95,95,
104,97,115,104,95,95,99,2,0,0,0,0,0,0,0,3,
- 0,0,0,4,0,0,0,67,0,0,0,115,36,0,0,0,
- 116,0,106,1,116,2,106,3,124,1,131,2,125,2,116,0,
- 106,4,100,1,124,1,106,5,124,0,106,6,131,3,1,0,
+ 0,0,0,5,0,0,0,67,0,0,0,115,36,0,0,0,
+ 116,0,160,1,116,2,106,3,124,1,161,2,125,2,116,0,
+ 160,4,100,1,124,1,106,5,124,0,106,6,161,3,1,0,
124,2,83,0,41,2,122,38,67,114,101,97,116,101,32,97,
110,32,117,110,105,116,105,97,108,105,122,101,100,32,101,120,
116,101,110,115,105,111,110,32,109,111,100,117,108,101,122,38,
@@ -1457,14 +1457,14 @@ const unsigned char _Py_M__importlib_external[] = {
100,121,110,97,109,105,99,114,133,0,0,0,114,102,0,0,
0,114,37,0,0,0,41,3,114,104,0,0,0,114,162,0,
0,0,114,187,0,0,0,114,4,0,0,0,114,4,0,0,
- 0,114,6,0,0,0,114,183,0,0,0,151,3,0,0,115,
+ 0,114,6,0,0,0,114,183,0,0,0,152,3,0,0,115,
10,0,0,0,0,2,4,1,10,1,6,1,12,1,122,33,
69,120,116,101,110,115,105,111,110,70,105,108,101,76,111,97,
100,101,114,46,99,114,101,97,116,101,95,109,111,100,117,108,
- 101,99,2,0,0,0,0,0,0,0,2,0,0,0,4,0,
- 0,0,67,0,0,0,115,36,0,0,0,116,0,106,1,116,
- 2,106,3,124,1,131,2,1,0,116,0,106,4,100,1,124,
- 0,106,5,124,0,106,6,131,3,1,0,100,2,83,0,41,
+ 101,99,2,0,0,0,0,0,0,0,2,0,0,0,5,0,
+ 0,0,67,0,0,0,115,36,0,0,0,116,0,160,1,116,
+ 2,106,3,124,1,161,2,1,0,116,0,160,4,100,1,124,
+ 0,106,5,124,0,106,6,161,3,1,0,100,2,83,0,41,
3,122,30,73,110,105,116,105,97,108,105,122,101,32,97,110,
32,101,120,116,101,110,115,105,111,110,32,109,111,100,117,108,
101,122,40,101,120,116,101,110,115,105,111,110,32,109,111,100,
@@ -1474,7 +1474,7 @@ const unsigned char _Py_M__importlib_external[] = {
120,101,99,95,100,121,110,97,109,105,99,114,133,0,0,0,
114,102,0,0,0,114,37,0,0,0,41,2,114,104,0,0,
0,114,187,0,0,0,114,4,0,0,0,114,4,0,0,0,
- 114,6,0,0,0,114,188,0,0,0,159,3,0,0,115,6,
+ 114,6,0,0,0,114,188,0,0,0,160,3,0,0,115,6,
0,0,0,0,2,14,1,6,1,122,31,69,120,116,101,110,
115,105,111,110,70,105,108,101,76,111,97,100,101,114,46,101,
120,101,99,95,109,111,100,117,108,101,99,2,0,0,0,0,
@@ -1492,7 +1492,7 @@ const unsigned char _Py_M__importlib_external[] = {
0,0,0,41,2,114,24,0,0,0,218,6,115,117,102,102,
105,120,41,1,218,9,102,105,108,101,95,110,97,109,101,114,
4,0,0,0,114,6,0,0,0,250,9,60,103,101,110,101,
- 120,112,114,62,168,3,0,0,115,2,0,0,0,4,1,122,
+ 120,112,114,62,169,3,0,0,115,2,0,0,0,4,1,122,
49,69,120,116,101,110,115,105,111,110,70,105,108,101,76,111,
97,100,101,114,46,105,115,95,112,97,99,107,97,103,101,46,
60,108,111,99,97,108,115,62,46,60,103,101,110,101,120,112,
@@ -1500,7 +1500,7 @@ const unsigned char _Py_M__importlib_external[] = {
97,110,121,218,18,69,88,84,69,78,83,73,79,78,95,83,
85,70,70,73,88,69,83,41,2,114,104,0,0,0,114,123,
0,0,0,114,4,0,0,0,41,1,114,223,0,0,0,114,
- 6,0,0,0,114,157,0,0,0,165,3,0,0,115,6,0,
+ 6,0,0,0,114,157,0,0,0,166,3,0,0,115,6,0,
0,0,0,2,14,1,12,1,122,30,69,120,116,101,110,115,
105,111,110,70,105,108,101,76,111,97,100,101,114,46,105,115,
95,112,97,99,107,97,103,101,99,2,0,0,0,0,0,0,
@@ -1511,7 +1511,7 @@ const unsigned char _Py_M__importlib_external[] = {
110,111,116,32,99,114,101,97,116,101,32,97,32,99,111,100,
101,32,111,98,106,101,99,116,46,78,114,4,0,0,0,41,
2,114,104,0,0,0,114,123,0,0,0,114,4,0,0,0,
- 114,4,0,0,0,114,6,0,0,0,114,184,0,0,0,171,
+ 114,4,0,0,0,114,6,0,0,0,114,184,0,0,0,172,
3,0,0,115,2,0,0,0,0,2,122,28,69,120,116,101,
110,115,105,111,110,70,105,108,101,76,111,97,100,101,114,46,
103,101,116,95,99,111,100,101,99,2,0,0,0,0,0,0,
@@ -1522,7 +1522,7 @@ const unsigned char _Py_M__importlib_external[] = {
110,111,32,115,111,117,114,99,101,32,99,111,100,101,46,78,
114,4,0,0,0,41,2,114,104,0,0,0,114,123,0,0,
0,114,4,0,0,0,114,4,0,0,0,114,6,0,0,0,
- 114,199,0,0,0,175,3,0,0,115,2,0,0,0,0,2,
+ 114,199,0,0,0,176,3,0,0,115,2,0,0,0,0,2,
122,30,69,120,116,101,110,115,105,111,110,70,105,108,101,76,
111,97,100,101,114,46,103,101,116,95,115,111,117,114,99,101,
99,2,0,0,0,0,0,0,0,2,0,0,0,1,0,0,
@@ -1533,7 +1533,7 @@ const unsigned char _Py_M__importlib_external[] = {
98,121,32,116,104,101,32,102,105,110,100,101,114,46,41,1,
114,37,0,0,0,41,2,114,104,0,0,0,114,123,0,0,
0,114,4,0,0,0,114,4,0,0,0,114,6,0,0,0,
- 114,155,0,0,0,179,3,0,0,115,2,0,0,0,0,3,
+ 114,155,0,0,0,180,3,0,0,115,2,0,0,0,0,3,
122,32,69,120,116,101,110,115,105,111,110,70,105,108,101,76,
111,97,100,101,114,46,103,101,116,95,102,105,108,101,110,97,
109,101,78,41,14,114,109,0,0,0,114,108,0,0,0,114,
@@ -1542,7 +1542,7 @@ const unsigned char _Py_M__importlib_external[] = {
0,0,114,157,0,0,0,114,184,0,0,0,114,199,0,0,
0,114,120,0,0,0,114,155,0,0,0,114,4,0,0,0,
114,4,0,0,0,114,4,0,0,0,114,6,0,0,0,114,
- 221,0,0,0,132,3,0,0,115,20,0,0,0,8,6,4,
+ 221,0,0,0,133,3,0,0,115,20,0,0,0,8,6,4,
2,8,4,8,4,8,3,8,8,8,6,8,6,8,4,8,
4,114,221,0,0,0,99,0,0,0,0,0,0,0,0,0,
0,0,0,2,0,0,0,64,0,0,0,115,96,0,0,0,
@@ -1572,9 +1572,9 @@ const unsigned char _Py_M__importlib_external[] = {
101,115,44,32,116,104,101,32,112,97,114,101,110,116,32,109,
111,100,117,108,101,39,115,32,112,97,116,104,10,32,32,32,
32,105,115,32,115,121,115,46,112,97,116,104,46,99,4,0,
- 0,0,0,0,0,0,4,0,0,0,2,0,0,0,67,0,
+ 0,0,0,0,0,0,4,0,0,0,3,0,0,0,67,0,
0,0,115,36,0,0,0,124,1,124,0,95,0,124,2,124,
- 0,95,1,116,2,124,0,106,3,131,0,131,1,124,0,95,
+ 0,95,1,116,2,124,0,160,3,161,0,131,1,124,0,95,
4,124,3,124,0,95,5,100,0,83,0,41,1,78,41,6,
218,5,95,110,97,109,101,218,5,95,112,97,116,104,114,97,
0,0,0,218,16,95,103,101,116,95,112,97,114,101,110,116,
@@ -1583,12 +1583,12 @@ const unsigned char _Py_M__importlib_external[] = {
102,105,110,100,101,114,41,4,114,104,0,0,0,114,102,0,
0,0,114,37,0,0,0,218,11,112,97,116,104,95,102,105,
110,100,101,114,114,4,0,0,0,114,4,0,0,0,114,6,
- 0,0,0,114,182,0,0,0,192,3,0,0,115,8,0,0,
+ 0,0,0,114,182,0,0,0,193,3,0,0,115,8,0,0,
0,0,1,6,1,6,1,14,1,122,23,95,78,97,109,101,
115,112,97,99,101,80,97,116,104,46,95,95,105,110,105,116,
95,95,99,1,0,0,0,0,0,0,0,4,0,0,0,3,
0,0,0,67,0,0,0,115,38,0,0,0,124,0,106,0,
- 106,1,100,1,131,1,92,3,125,1,125,2,125,3,124,2,
+ 160,1,100,1,161,1,92,3,125,1,125,2,125,3,124,2,
100,2,107,2,114,30,100,6,83,0,124,1,100,5,102,2,
83,0,41,7,122,62,82,101,116,117,114,110,115,32,97,32,
116,117,112,108,101,32,111,102,32,40,112,97,114,101,110,116,
@@ -1601,12 +1601,12 @@ const unsigned char _Py_M__importlib_external[] = {
0,114,219,0,0,0,218,3,100,111,116,90,2,109,101,114,
4,0,0,0,114,4,0,0,0,114,6,0,0,0,218,23,
95,102,105,110,100,95,112,97,114,101,110,116,95,112,97,116,
- 104,95,110,97,109,101,115,198,3,0,0,115,8,0,0,0,
+ 104,95,110,97,109,101,115,199,3,0,0,115,8,0,0,0,
0,2,18,1,8,2,4,3,122,38,95,78,97,109,101,115,
112,97,99,101,80,97,116,104,46,95,102,105,110,100,95,112,
97,114,101,110,116,95,112,97,116,104,95,110,97,109,101,115,
99,1,0,0,0,0,0,0,0,3,0,0,0,3,0,0,
- 0,67,0,0,0,115,28,0,0,0,124,0,106,0,131,0,
+ 0,67,0,0,0,115,28,0,0,0,124,0,160,0,161,0,
92,2,125,1,125,2,116,1,116,2,106,3,124,1,25,0,
124,2,131,2,83,0,41,1,78,41,4,114,235,0,0,0,
114,114,0,0,0,114,8,0,0,0,218,7,109,111,100,117,
@@ -1614,13 +1614,13 @@ const unsigned char _Py_M__importlib_external[] = {
110,116,95,109,111,100,117,108,101,95,110,97,109,101,90,14,
112,97,116,104,95,97,116,116,114,95,110,97,109,101,114,4,
0,0,0,114,4,0,0,0,114,6,0,0,0,114,230,0,
- 0,0,208,3,0,0,115,4,0,0,0,0,1,12,1,122,
+ 0,0,209,3,0,0,115,4,0,0,0,0,1,12,1,122,
31,95,78,97,109,101,115,112,97,99,101,80,97,116,104,46,
95,103,101,116,95,112,97,114,101,110,116,95,112,97,116,104,
- 99,1,0,0,0,0,0,0,0,3,0,0,0,3,0,0,
- 0,67,0,0,0,115,80,0,0,0,116,0,124,0,106,1,
- 131,0,131,1,125,1,124,1,124,0,106,2,107,3,114,74,
- 124,0,106,3,124,0,106,4,124,1,131,2,125,2,124,2,
+ 99,1,0,0,0,0,0,0,0,3,0,0,0,4,0,0,
+ 0,67,0,0,0,115,80,0,0,0,116,0,124,0,160,1,
+ 161,0,131,1,125,1,124,1,124,0,106,2,107,3,114,74,
+ 124,0,160,3,124,0,106,4,124,1,161,2,125,2,124,2,
100,0,107,9,114,68,124,2,106,5,100,0,107,8,114,68,
124,2,106,6,114,68,124,2,106,6,124,0,95,7,124,1,
124,0,95,2,124,0,106,7,83,0,41,1,78,41,8,114,
@@ -1629,16 +1629,16 @@ const unsigned char _Py_M__importlib_external[] = {
0,0,114,229,0,0,0,41,3,114,104,0,0,0,90,11,
112,97,114,101,110,116,95,112,97,116,104,114,162,0,0,0,
114,4,0,0,0,114,4,0,0,0,114,6,0,0,0,218,
- 12,95,114,101,99,97,108,99,117,108,97,116,101,212,3,0,
+ 12,95,114,101,99,97,108,99,117,108,97,116,101,213,3,0,
0,115,16,0,0,0,0,2,12,1,10,1,14,3,18,1,
6,1,8,1,6,1,122,27,95,78,97,109,101,115,112,97,
99,101,80,97,116,104,46,95,114,101,99,97,108,99,117,108,
97,116,101,99,1,0,0,0,0,0,0,0,1,0,0,0,
- 2,0,0,0,67,0,0,0,115,12,0,0,0,116,0,124,
- 0,106,1,131,0,131,1,83,0,41,1,78,41,2,218,4,
+ 3,0,0,0,67,0,0,0,115,12,0,0,0,116,0,124,
+ 0,160,1,161,0,131,1,83,0,41,1,78,41,2,218,4,
105,116,101,114,114,237,0,0,0,41,1,114,104,0,0,0,
114,4,0,0,0,114,4,0,0,0,114,6,0,0,0,218,
- 8,95,95,105,116,101,114,95,95,225,3,0,0,115,2,0,
+ 8,95,95,105,116,101,114,95,95,226,3,0,0,115,2,0,
0,0,0,1,122,23,95,78,97,109,101,115,112,97,99,101,
80,97,116,104,46,95,95,105,116,101,114,95,95,99,3,0,
0,0,0,0,0,0,3,0,0,0,3,0,0,0,67,0,
@@ -1646,40 +1646,40 @@ const unsigned char _Py_M__importlib_external[] = {
0,100,0,83,0,41,1,78,41,1,114,229,0,0,0,41,
3,114,104,0,0,0,218,5,105,110,100,101,120,114,37,0,
0,0,114,4,0,0,0,114,4,0,0,0,114,6,0,0,
- 0,218,11,95,95,115,101,116,105,116,101,109,95,95,228,3,
+ 0,218,11,95,95,115,101,116,105,116,101,109,95,95,229,3,
0,0,115,2,0,0,0,0,1,122,26,95,78,97,109,101,
115,112,97,99,101,80,97,116,104,46,95,95,115,101,116,105,
116,101,109,95,95,99,1,0,0,0,0,0,0,0,1,0,
- 0,0,2,0,0,0,67,0,0,0,115,12,0,0,0,116,
- 0,124,0,106,1,131,0,131,1,83,0,41,1,78,41,2,
+ 0,0,3,0,0,0,67,0,0,0,115,12,0,0,0,116,
+ 0,124,0,160,1,161,0,131,1,83,0,41,1,78,41,2,
114,33,0,0,0,114,237,0,0,0,41,1,114,104,0,0,
0,114,4,0,0,0,114,4,0,0,0,114,6,0,0,0,
- 218,7,95,95,108,101,110,95,95,231,3,0,0,115,2,0,
+ 218,7,95,95,108,101,110,95,95,232,3,0,0,115,2,0,
0,0,0,1,122,22,95,78,97,109,101,115,112,97,99,101,
80,97,116,104,46,95,95,108,101,110,95,95,99,1,0,0,
- 0,0,0,0,0,1,0,0,0,2,0,0,0,67,0,0,
- 0,115,12,0,0,0,100,1,106,0,124,0,106,1,131,1,
+ 0,0,0,0,0,1,0,0,0,3,0,0,0,67,0,0,
+ 0,115,12,0,0,0,100,1,160,0,124,0,106,1,161,1,
83,0,41,2,78,122,20,95,78,97,109,101,115,112,97,99,
101,80,97,116,104,40,123,33,114,125,41,41,2,114,50,0,
0,0,114,229,0,0,0,41,1,114,104,0,0,0,114,4,
0,0,0,114,4,0,0,0,114,6,0,0,0,218,8,95,
- 95,114,101,112,114,95,95,234,3,0,0,115,2,0,0,0,
+ 95,114,101,112,114,95,95,235,3,0,0,115,2,0,0,0,
0,1,122,23,95,78,97,109,101,115,112,97,99,101,80,97,
116,104,46,95,95,114,101,112,114,95,95,99,2,0,0,0,
- 0,0,0,0,2,0,0,0,2,0,0,0,67,0,0,0,
- 115,12,0,0,0,124,1,124,0,106,0,131,0,107,6,83,
+ 0,0,0,0,2,0,0,0,3,0,0,0,67,0,0,0,
+ 115,12,0,0,0,124,1,124,0,160,0,161,0,107,6,83,
0,41,1,78,41,1,114,237,0,0,0,41,2,114,104,0,
0,0,218,4,105,116,101,109,114,4,0,0,0,114,4,0,
0,0,114,6,0,0,0,218,12,95,95,99,111,110,116,97,
- 105,110,115,95,95,237,3,0,0,115,2,0,0,0,0,1,
+ 105,110,115,95,95,238,3,0,0,115,2,0,0,0,0,1,
122,27,95,78,97,109,101,115,112,97,99,101,80,97,116,104,
46,95,95,99,111,110,116,97,105,110,115,95,95,99,2,0,
- 0,0,0,0,0,0,2,0,0,0,2,0,0,0,67,0,
- 0,0,115,16,0,0,0,124,0,106,0,106,1,124,1,131,
+ 0,0,0,0,0,0,2,0,0,0,3,0,0,0,67,0,
+ 0,0,115,16,0,0,0,124,0,106,0,160,1,124,1,161,
1,1,0,100,0,83,0,41,1,78,41,2,114,229,0,0,
0,114,161,0,0,0,41,2,114,104,0,0,0,114,244,0,
0,0,114,4,0,0,0,114,4,0,0,0,114,6,0,0,
- 0,114,161,0,0,0,240,3,0,0,115,2,0,0,0,0,
+ 0,114,161,0,0,0,241,3,0,0,115,2,0,0,0,0,
1,122,21,95,78,97,109,101,115,112,97,99,101,80,97,116,
104,46,97,112,112,101,110,100,78,41,14,114,109,0,0,0,
114,108,0,0,0,114,110,0,0,0,114,111,0,0,0,114,
@@ -1687,7 +1687,7 @@ const unsigned char _Py_M__importlib_external[] = {
0,0,0,114,239,0,0,0,114,241,0,0,0,114,242,0,
0,0,114,243,0,0,0,114,245,0,0,0,114,161,0,0,
0,114,4,0,0,0,114,4,0,0,0,114,4,0,0,0,
- 114,6,0,0,0,114,227,0,0,0,185,3,0,0,115,22,
+ 114,6,0,0,0,114,227,0,0,0,186,3,0,0,115,22,
0,0,0,8,5,4,2,8,6,8,10,8,4,8,13,8,
3,8,3,8,3,8,3,8,3,114,227,0,0,0,99,0,
0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,64,
@@ -1704,11 +1704,11 @@ const unsigned char _Py_M__importlib_external[] = {
0,0,114,229,0,0,0,41,4,114,104,0,0,0,114,102,
0,0,0,114,37,0,0,0,114,233,0,0,0,114,4,0,
0,0,114,4,0,0,0,114,6,0,0,0,114,182,0,0,
- 0,246,3,0,0,115,2,0,0,0,0,1,122,25,95,78,
+ 0,247,3,0,0,115,2,0,0,0,0,1,122,25,95,78,
97,109,101,115,112,97,99,101,76,111,97,100,101,114,46,95,
95,105,110,105,116,95,95,99,2,0,0,0,0,0,0,0,
- 2,0,0,0,2,0,0,0,67,0,0,0,115,12,0,0,
- 0,100,1,106,0,124,1,106,1,131,1,83,0,41,2,122,
+ 2,0,0,0,3,0,0,0,67,0,0,0,115,12,0,0,
+ 0,100,1,160,0,124,1,106,1,161,1,83,0,41,2,122,
115,82,101,116,117,114,110,32,114,101,112,114,32,102,111,114,
32,116,104,101,32,109,111,100,117,108,101,46,10,10,32,32,
32,32,32,32,32,32,84,104,101,32,109,101,116,104,111,100,
@@ -1721,21 +1721,21 @@ const unsigned char _Py_M__importlib_external[] = {
2,114,50,0,0,0,114,109,0,0,0,41,2,114,168,0,
0,0,114,187,0,0,0,114,4,0,0,0,114,4,0,0,
0,114,6,0,0,0,218,11,109,111,100,117,108,101,95,114,
- 101,112,114,249,3,0,0,115,2,0,0,0,0,7,122,28,
+ 101,112,114,250,3,0,0,115,2,0,0,0,0,7,122,28,
95,78,97,109,101,115,112,97,99,101,76,111,97,100,101,114,
46,109,111,100,117,108,101,95,114,101,112,114,99,2,0,0,
0,0,0,0,0,2,0,0,0,1,0,0,0,67,0,0,
0,115,4,0,0,0,100,1,83,0,41,2,78,84,114,4,
0,0,0,41,2,114,104,0,0,0,114,123,0,0,0,114,
4,0,0,0,114,4,0,0,0,114,6,0,0,0,114,157,
- 0,0,0,2,4,0,0,115,2,0,0,0,0,1,122,27,
+ 0,0,0,3,4,0,0,115,2,0,0,0,0,1,122,27,
95,78,97,109,101,115,112,97,99,101,76,111,97,100,101,114,
46,105,115,95,112,97,99,107,97,103,101,99,2,0,0,0,
0,0,0,0,2,0,0,0,1,0,0,0,67,0,0,0,
115,4,0,0,0,100,1,83,0,41,2,78,114,32,0,0,
0,114,4,0,0,0,41,2,114,104,0,0,0,114,123,0,
0,0,114,4,0,0,0,114,4,0,0,0,114,6,0,0,
- 0,114,199,0,0,0,5,4,0,0,115,2,0,0,0,0,
+ 0,114,199,0,0,0,6,4,0,0,115,2,0,0,0,0,
1,122,27,95,78,97,109,101,115,112,97,99,101,76,111,97,
100,101,114,46,103,101,116,95,115,111,117,114,99,101,99,2,
0,0,0,0,0,0,0,2,0,0,0,6,0,0,0,67,
@@ -1744,7 +1744,7 @@ const unsigned char _Py_M__importlib_external[] = {
122,8,60,115,116,114,105,110,103,62,114,186,0,0,0,84,
41,1,114,201,0,0,0,41,1,114,202,0,0,0,41,2,
114,104,0,0,0,114,123,0,0,0,114,4,0,0,0,114,
- 4,0,0,0,114,6,0,0,0,114,184,0,0,0,8,4,
+ 4,0,0,0,114,6,0,0,0,114,184,0,0,0,9,4,
0,0,115,2,0,0,0,0,1,122,25,95,78,97,109,101,
115,112,97,99,101,76,111,97,100,101,114,46,103,101,116,95,
99,111,100,101,99,2,0,0,0,0,0,0,0,2,0,0,
@@ -1754,19 +1754,19 @@ const unsigned char _Py_M__importlib_external[] = {
109,111,100,117,108,101,32,99,114,101,97,116,105,111,110,46,
78,114,4,0,0,0,41,2,114,104,0,0,0,114,162,0,
0,0,114,4,0,0,0,114,4,0,0,0,114,6,0,0,
- 0,114,183,0,0,0,11,4,0,0,115,0,0,0,0,122,
+ 0,114,183,0,0,0,12,4,0,0,115,0,0,0,0,122,
30,95,78,97,109,101,115,112,97,99,101,76,111,97,100,101,
114,46,99,114,101,97,116,101,95,109,111,100,117,108,101,99,
2,0,0,0,0,0,0,0,2,0,0,0,1,0,0,0,
67,0,0,0,115,4,0,0,0,100,0,83,0,41,1,78,
114,4,0,0,0,41,2,114,104,0,0,0,114,187,0,0,
0,114,4,0,0,0,114,4,0,0,0,114,6,0,0,0,
- 114,188,0,0,0,14,4,0,0,115,2,0,0,0,0,1,
+ 114,188,0,0,0,15,4,0,0,115,2,0,0,0,0,1,
122,28,95,78,97,109,101,115,112,97,99,101,76,111,97,100,
101,114,46,101,120,101,99,95,109,111,100,117,108,101,99,2,
- 0,0,0,0,0,0,0,2,0,0,0,3,0,0,0,67,
- 0,0,0,115,26,0,0,0,116,0,106,1,100,1,124,0,
- 106,2,131,2,1,0,116,0,106,3,124,0,124,1,131,2,
+ 0,0,0,0,0,0,0,2,0,0,0,4,0,0,0,67,
+ 0,0,0,115,26,0,0,0,116,0,160,1,100,1,124,0,
+ 106,2,161,2,1,0,116,0,160,3,124,0,124,1,161,2,
83,0,41,2,122,98,76,111,97,100,32,97,32,110,97,109,
101,115,112,97,99,101,32,109,111,100,117,108,101,46,10,10,
32,32,32,32,32,32,32,32,84,104,105,115,32,109,101,116,
@@ -1779,7 +1779,7 @@ const unsigned char _Py_M__importlib_external[] = {
41,4,114,118,0,0,0,114,133,0,0,0,114,229,0,0,
0,114,189,0,0,0,41,2,114,104,0,0,0,114,123,0,
0,0,114,4,0,0,0,114,4,0,0,0,114,6,0,0,
- 0,114,190,0,0,0,17,4,0,0,115,6,0,0,0,0,
+ 0,114,190,0,0,0,18,4,0,0,115,6,0,0,0,0,
7,6,1,8,1,122,28,95,78,97,109,101,115,112,97,99,
101,76,111,97,100,101,114,46,108,111,97,100,95,109,111,100,
117,108,101,78,41,12,114,109,0,0,0,114,108,0,0,0,
@@ -1787,7 +1787,7 @@ const unsigned char _Py_M__importlib_external[] = {
247,0,0,0,114,157,0,0,0,114,199,0,0,0,114,184,
0,0,0,114,183,0,0,0,114,188,0,0,0,114,190,0,
0,0,114,4,0,0,0,114,4,0,0,0,114,4,0,0,
- 0,114,6,0,0,0,114,246,0,0,0,245,3,0,0,115,
+ 0,114,6,0,0,0,114,246,0,0,0,246,3,0,0,115,
16,0,0,0,8,1,8,3,12,9,8,3,8,3,8,3,
8,3,8,3,114,246,0,0,0,99,0,0,0,0,0,0,
0,0,0,0,0,0,4,0,0,0,64,0,0,0,115,106,
@@ -1804,9 +1804,9 @@ const unsigned char _Py_M__importlib_external[] = {
97,99,107,97,103,101,32,95,95,112,97,116,104,95,95,32,
97,116,116,114,105,98,117,116,101,115,46,99,1,0,0,0,
0,0,0,0,2,0,0,0,4,0,0,0,67,0,0,0,
- 115,42,0,0,0,120,36,116,0,106,1,106,2,131,0,68,
+ 115,42,0,0,0,120,36,116,0,106,1,160,2,161,0,68,
0,93,22,125,1,116,3,124,1,100,1,131,2,114,12,124,
- 1,106,4,131,0,1,0,113,12,87,0,100,2,83,0,41,
+ 1,160,4,161,0,1,0,113,12,87,0,100,2,83,0,41,
3,122,125,67,97,108,108,32,116,104,101,32,105,110,118,97,
108,105,100,97,116,101,95,99,97,99,104,101,115,40,41,32,
109,101,116,104,111,100,32,111,110,32,97,108,108,32,112,97,
@@ -1821,13 +1821,13 @@ const unsigned char _Py_M__importlib_external[] = {
218,6,118,97,108,117,101,115,114,112,0,0,0,114,249,0,
0,0,41,2,114,168,0,0,0,218,6,102,105,110,100,101,
114,114,4,0,0,0,114,4,0,0,0,114,6,0,0,0,
- 114,249,0,0,0,35,4,0,0,115,6,0,0,0,0,4,
+ 114,249,0,0,0,36,4,0,0,115,6,0,0,0,0,4,
16,1,10,1,122,28,80,97,116,104,70,105,110,100,101,114,
46,105,110,118,97,108,105,100,97,116,101,95,99,97,99,104,
101,115,99,2,0,0,0,0,0,0,0,3,0,0,0,12,
0,0,0,67,0,0,0,115,86,0,0,0,116,0,106,1,
100,1,107,9,114,30,116,0,106,1,12,0,114,30,116,2,
- 106,3,100,2,116,4,131,2,1,0,120,50,116,0,106,1,
+ 160,3,100,2,116,4,161,2,1,0,120,50,116,0,106,1,
68,0,93,36,125,2,121,8,124,2,124,1,131,1,83,0,
4,0,116,5,107,10,114,72,1,0,1,0,1,0,119,38,
89,0,113,38,88,0,113,38,87,0,100,1,83,0,100,1,
@@ -1841,16 +1841,16 @@ const unsigned char _Py_M__importlib_external[] = {
114,103,0,0,0,41,3,114,168,0,0,0,114,37,0,0,
0,90,4,104,111,111,107,114,4,0,0,0,114,4,0,0,
0,114,6,0,0,0,218,11,95,112,97,116,104,95,104,111,
- 111,107,115,43,4,0,0,115,16,0,0,0,0,3,18,1,
+ 111,107,115,44,4,0,0,115,16,0,0,0,0,3,18,1,
12,1,12,1,2,1,8,1,14,1,12,2,122,22,80,97,
116,104,70,105,110,100,101,114,46,95,112,97,116,104,95,104,
111,111,107,115,99,2,0,0,0,0,0,0,0,3,0,0,
0,19,0,0,0,67,0,0,0,115,102,0,0,0,124,1,
- 100,1,107,2,114,42,121,12,116,0,106,1,131,0,125,1,
+ 100,1,107,2,114,42,121,12,116,0,160,1,161,0,125,1,
87,0,110,20,4,0,116,2,107,10,114,40,1,0,1,0,
1,0,100,2,83,0,88,0,121,14,116,3,106,4,124,1,
25,0,125,2,87,0,110,40,4,0,116,5,107,10,114,96,
- 1,0,1,0,1,0,124,0,106,6,124,1,131,1,125,2,
+ 1,0,1,0,1,0,124,0,160,6,124,1,161,1,125,2,
124,2,116,3,106,4,124,1,60,0,89,0,110,2,88,0,
124,2,83,0,41,3,122,210,71,101,116,32,116,104,101,32,
102,105,110,100,101,114,32,102,111,114,32,116,104,101,32,112,
@@ -1872,17 +1872,17 @@ const unsigned char _Py_M__importlib_external[] = {
0,0,0,41,3,114,168,0,0,0,114,37,0,0,0,114,
252,0,0,0,114,4,0,0,0,114,4,0,0,0,114,6,
0,0,0,218,20,95,112,97,116,104,95,105,109,112,111,114,
- 116,101,114,95,99,97,99,104,101,56,4,0,0,115,22,0,
+ 116,101,114,95,99,97,99,104,101,57,4,0,0,115,22,0,
0,0,0,8,8,1,2,1,12,1,14,3,6,1,2,1,
14,1,14,1,10,1,16,1,122,31,80,97,116,104,70,105,
110,100,101,114,46,95,112,97,116,104,95,105,109,112,111,114,
116,101,114,95,99,97,99,104,101,99,3,0,0,0,0,0,
- 0,0,6,0,0,0,3,0,0,0,67,0,0,0,115,82,
- 0,0,0,116,0,124,2,100,1,131,2,114,26,124,2,106,
- 1,124,1,131,1,92,2,125,3,125,4,110,14,124,2,106,
- 2,124,1,131,1,125,3,103,0,125,4,124,3,100,0,107,
- 9,114,60,116,3,106,4,124,1,124,3,131,2,83,0,116,
- 3,106,5,124,1,100,0,131,2,125,5,124,4,124,5,95,
+ 0,0,6,0,0,0,4,0,0,0,67,0,0,0,115,82,
+ 0,0,0,116,0,124,2,100,1,131,2,114,26,124,2,160,
+ 1,124,1,161,1,92,2,125,3,125,4,110,14,124,2,160,
+ 2,124,1,161,1,125,3,103,0,125,4,124,3,100,0,107,
+ 9,114,60,116,3,160,4,124,1,124,3,161,2,83,0,116,
+ 3,160,5,124,1,100,0,161,2,125,5,124,4,124,5,95,
6,124,5,83,0,41,2,78,114,121,0,0,0,41,7,114,
112,0,0,0,114,121,0,0,0,114,179,0,0,0,114,118,
0,0,0,114,176,0,0,0,114,158,0,0,0,114,154,0,
@@ -1890,21 +1890,21 @@ const unsigned char _Py_M__importlib_external[] = {
0,0,0,114,124,0,0,0,114,125,0,0,0,114,162,0,
0,0,114,4,0,0,0,114,4,0,0,0,114,6,0,0,
0,218,16,95,108,101,103,97,99,121,95,103,101,116,95,115,
- 112,101,99,78,4,0,0,115,18,0,0,0,0,4,10,1,
+ 112,101,99,79,4,0,0,115,18,0,0,0,0,4,10,1,
16,2,10,1,4,1,8,1,12,1,12,1,6,1,122,27,
80,97,116,104,70,105,110,100,101,114,46,95,108,101,103,97,
99,121,95,103,101,116,95,115,112,101,99,78,99,4,0,0,
0,0,0,0,0,9,0,0,0,5,0,0,0,67,0,0,
0,115,170,0,0,0,103,0,125,4,120,160,124,2,68,0,
93,130,125,5,116,0,124,5,116,1,116,2,102,2,131,2,
- 115,30,113,10,124,0,106,3,124,5,131,1,125,6,124,6,
+ 115,30,113,10,124,0,160,3,124,5,161,1,125,6,124,6,
100,1,107,9,114,10,116,4,124,6,100,2,131,2,114,72,
- 124,6,106,5,124,1,124,3,131,2,125,7,110,12,124,0,
- 106,6,124,1,124,6,131,2,125,7,124,7,100,1,107,8,
+ 124,6,160,5,124,1,124,3,161,2,125,7,110,12,124,0,
+ 160,6,124,1,124,6,161,2,125,7,124,7,100,1,107,8,
114,94,113,10,124,7,106,7,100,1,107,9,114,108,124,7,
83,0,124,7,106,8,125,8,124,8,100,1,107,8,114,130,
- 116,9,100,3,131,1,130,1,124,4,106,10,124,8,131,1,
- 1,0,113,10,87,0,116,11,106,12,124,1,100,1,131,2,
+ 116,9,100,3,131,1,130,1,124,4,160,10,124,8,161,1,
+ 1,0,113,10,87,0,116,11,160,12,124,1,100,1,161,2,
125,7,124,4,124,7,95,8,124,7,83,0,100,1,83,0,
41,4,122,63,70,105,110,100,32,116,104,101,32,108,111,97,
100,101,114,32,111,114,32,110,97,109,101,115,112,97,99,101,
@@ -1921,15 +1921,15 @@ const unsigned char _Py_M__importlib_external[] = {
112,97,99,101,95,112,97,116,104,90,5,101,110,116,114,121,
114,252,0,0,0,114,162,0,0,0,114,125,0,0,0,114,
4,0,0,0,114,4,0,0,0,114,6,0,0,0,218,9,
- 95,103,101,116,95,115,112,101,99,93,4,0,0,115,40,0,
+ 95,103,101,116,95,115,112,101,99,94,4,0,0,115,40,0,
0,0,0,5,4,1,10,1,14,1,2,1,10,1,8,1,
10,1,14,2,12,1,8,1,2,1,10,1,4,1,6,1,
8,1,8,5,14,2,12,1,6,1,122,20,80,97,116,104,
70,105,110,100,101,114,46,95,103,101,116,95,115,112,101,99,
- 99,4,0,0,0,0,0,0,0,6,0,0,0,4,0,0,
+ 99,4,0,0,0,0,0,0,0,6,0,0,0,5,0,0,
0,67,0,0,0,115,100,0,0,0,124,2,100,1,107,8,
- 114,14,116,0,106,1,125,2,124,0,106,2,124,1,124,2,
- 124,3,131,3,125,4,124,4,100,1,107,8,114,40,100,1,
+ 114,14,116,0,106,1,125,2,124,0,160,2,124,1,124,2,
+ 124,3,161,3,125,4,124,4,100,1,107,8,114,40,100,1,
83,0,124,4,106,3,100,1,107,8,114,92,124,4,106,4,
125,5,124,5,114,86,100,2,124,4,95,5,116,6,124,1,
124,5,124,0,106,2,131,3,124,4,95,4,124,4,83,0,
@@ -1949,12 +1949,12 @@ const unsigned char _Py_M__importlib_external[] = {
41,6,114,168,0,0,0,114,123,0,0,0,114,37,0,0,
0,114,177,0,0,0,114,162,0,0,0,114,3,1,0,0,
114,4,0,0,0,114,4,0,0,0,114,6,0,0,0,114,
- 178,0,0,0,125,4,0,0,115,26,0,0,0,0,6,8,
+ 178,0,0,0,126,4,0,0,115,26,0,0,0,0,6,8,
1,6,1,14,1,8,1,4,1,10,1,6,1,4,3,6,
1,16,1,4,2,6,2,122,20,80,97,116,104,70,105,110,
100,101,114,46,102,105,110,100,95,115,112,101,99,99,3,0,
- 0,0,0,0,0,0,4,0,0,0,3,0,0,0,67,0,
- 0,0,115,30,0,0,0,124,0,106,0,124,1,124,2,131,
+ 0,0,0,0,0,0,4,0,0,0,4,0,0,0,67,0,
+ 0,0,115,30,0,0,0,124,0,160,0,124,1,124,2,161,
2,125,3,124,3,100,1,107,8,114,24,100,1,83,0,124,
3,106,1,83,0,41,2,122,170,102,105,110,100,32,116,104,
101,32,109,111,100,117,108,101,32,111,110,32,115,121,115,46,
@@ -1970,7 +1970,7 @@ const unsigned char _Py_M__importlib_external[] = {
32,32,32,78,41,2,114,178,0,0,0,114,124,0,0,0,
41,4,114,168,0,0,0,114,123,0,0,0,114,37,0,0,
0,114,162,0,0,0,114,4,0,0,0,114,4,0,0,0,
- 114,6,0,0,0,114,179,0,0,0,149,4,0,0,115,8,
+ 114,6,0,0,0,114,179,0,0,0,150,4,0,0,115,8,
0,0,0,0,8,12,1,8,1,4,1,122,22,80,97,116,
104,70,105,110,100,101,114,46,102,105,110,100,95,109,111,100,
117,108,101,41,1,78,41,2,78,78,41,1,78,41,12,114,
@@ -1979,7 +1979,7 @@ const unsigned char _Py_M__importlib_external[] = {
0,0,114,0,1,0,0,114,1,1,0,0,114,4,1,0,
0,114,178,0,0,0,114,179,0,0,0,114,4,0,0,0,
114,4,0,0,0,114,4,0,0,0,114,6,0,0,0,114,
- 248,0,0,0,31,4,0,0,115,22,0,0,0,8,2,4,
+ 248,0,0,0,32,4,0,0,115,22,0,0,0,8,2,4,
2,12,8,12,13,12,22,12,15,2,1,12,31,2,1,12,
23,2,1,114,248,0,0,0,99,0,0,0,0,0,0,0,
0,0,0,0,0,3,0,0,0,64,0,0,0,115,90,0,
@@ -2001,10 +2001,10 @@ const unsigned char _Py_M__importlib_external[] = {
100,101,114,32,105,115,32,104,97,110,100,108,105,110,103,32,
104,97,115,32,98,101,101,110,32,109,111,100,105,102,105,101,
100,46,10,10,32,32,32,32,99,2,0,0,0,0,0,0,
- 0,5,0,0,0,5,0,0,0,7,0,0,0,115,88,0,
+ 0,5,0,0,0,6,0,0,0,7,0,0,0,115,88,0,
0,0,103,0,125,3,120,40,124,2,68,0,93,32,92,2,
- 137,0,125,4,124,3,106,0,135,0,102,1,100,1,100,2,
- 132,8,124,4,68,0,131,1,131,1,1,0,113,10,87,0,
+ 137,0,125,4,124,3,160,0,135,0,102,1,100,1,100,2,
+ 132,8,124,4,68,0,131,1,161,1,1,0,113,10,87,0,
124,3,124,0,95,1,124,1,112,58,100,3,124,0,95,2,
100,6,124,0,95,3,116,4,131,0,124,0,95,5,116,4,
131,0,124,0,95,6,100,5,83,0,41,7,122,154,73,110,
@@ -2023,7 +2023,7 @@ const unsigned char _Py_M__importlib_external[] = {
1,0,113,2,100,0,83,0,41,1,78,114,4,0,0,0,
41,2,114,24,0,0,0,114,222,0,0,0,41,1,114,124,
0,0,0,114,4,0,0,0,114,6,0,0,0,114,224,0,
- 0,0,178,4,0,0,115,2,0,0,0,4,0,122,38,70,
+ 0,0,179,4,0,0,115,2,0,0,0,4,0,122,38,70,
105,108,101,70,105,110,100,101,114,46,95,95,105,110,105,116,
95,95,46,60,108,111,99,97,108,115,62,46,60,103,101,110,
101,120,112,114,62,114,61,0,0,0,114,31,0,0,0,78,
@@ -2035,7 +2035,7 @@ const unsigned char _Py_M__importlib_external[] = {
5,114,104,0,0,0,114,37,0,0,0,218,14,108,111,97,
100,101,114,95,100,101,116,97,105,108,115,90,7,108,111,97,
100,101,114,115,114,164,0,0,0,114,4,0,0,0,41,1,
- 114,124,0,0,0,114,6,0,0,0,114,182,0,0,0,172,
+ 114,124,0,0,0,114,6,0,0,0,114,182,0,0,0,173,
4,0,0,115,16,0,0,0,0,4,4,1,14,1,28,1,
6,2,10,1,6,1,8,1,122,19,70,105,108,101,70,105,
110,100,101,114,46,95,95,105,110,105,116,95,95,99,1,0,
@@ -2046,11 +2046,11 @@ const unsigned char _Py_M__importlib_external[] = {
105,109,101,46,114,31,0,0,0,78,114,91,0,0,0,41,
1,114,7,1,0,0,41,1,114,104,0,0,0,114,4,0,
0,0,114,4,0,0,0,114,6,0,0,0,114,249,0,0,
- 0,186,4,0,0,115,2,0,0,0,0,2,122,28,70,105,
+ 0,187,4,0,0,115,2,0,0,0,0,2,122,28,70,105,
108,101,70,105,110,100,101,114,46,105,110,118,97,108,105,100,
97,116,101,95,99,97,99,104,101,115,99,2,0,0,0,0,
- 0,0,0,3,0,0,0,2,0,0,0,67,0,0,0,115,
- 42,0,0,0,124,0,106,0,124,1,131,1,125,2,124,2,
+ 0,0,0,3,0,0,0,3,0,0,0,67,0,0,0,115,
+ 42,0,0,0,124,0,160,0,124,1,161,1,125,2,124,2,
100,1,107,8,114,26,100,1,103,0,102,2,83,0,124,2,
106,1,124,2,106,2,112,38,103,0,102,2,83,0,41,2,
122,197,84,114,121,32,116,111,32,102,105,110,100,32,97,32,
@@ -2068,7 +2068,7 @@ const unsigned char _Py_M__importlib_external[] = {
32,32,32,32,32,32,32,78,41,3,114,178,0,0,0,114,
124,0,0,0,114,154,0,0,0,41,3,114,104,0,0,0,
114,123,0,0,0,114,162,0,0,0,114,4,0,0,0,114,
- 4,0,0,0,114,6,0,0,0,114,121,0,0,0,192,4,
+ 4,0,0,0,114,6,0,0,0,114,121,0,0,0,193,4,
0,0,115,8,0,0,0,0,7,10,1,8,1,8,1,122,
22,70,105,108,101,70,105,110,100,101,114,46,102,105,110,100,
95,108,111,97,100,101,114,99,6,0,0,0,0,0,0,0,
@@ -2079,32 +2079,32 @@ const unsigned char _Py_M__importlib_external[] = {
0,41,7,114,104,0,0,0,114,163,0,0,0,114,123,0,
0,0,114,37,0,0,0,90,4,115,109,115,108,114,177,0,
0,0,114,124,0,0,0,114,4,0,0,0,114,4,0,0,
- 0,114,6,0,0,0,114,4,1,0,0,204,4,0,0,115,
+ 0,114,6,0,0,0,114,4,1,0,0,205,4,0,0,115,
6,0,0,0,0,1,10,1,8,1,122,20,70,105,108,101,
70,105,110,100,101,114,46,95,103,101,116,95,115,112,101,99,
- 78,99,3,0,0,0,0,0,0,0,14,0,0,0,15,0,
+ 78,99,3,0,0,0,0,0,0,0,14,0,0,0,16,0,
0,0,67,0,0,0,115,98,1,0,0,100,1,125,3,124,
- 1,106,0,100,2,131,1,100,3,25,0,125,4,121,24,116,
- 1,124,0,106,2,112,34,116,3,106,4,131,0,131,1,106,
+ 1,160,0,100,2,161,1,100,3,25,0,125,4,121,24,116,
+ 1,124,0,106,2,112,34,116,3,160,4,161,0,131,1,106,
5,125,5,87,0,110,24,4,0,116,6,107,10,114,66,1,
0,1,0,1,0,100,10,125,5,89,0,110,2,88,0,124,
- 5,124,0,106,7,107,3,114,92,124,0,106,8,131,0,1,
+ 5,124,0,106,7,107,3,114,92,124,0,160,8,161,0,1,
0,124,5,124,0,95,7,116,9,131,0,114,114,124,0,106,
- 10,125,6,124,4,106,11,131,0,125,7,110,10,124,0,106,
+ 10,125,6,124,4,160,11,161,0,125,7,110,10,124,0,106,
12,125,6,124,4,125,7,124,7,124,6,107,6,114,218,116,
13,124,0,106,2,124,4,131,2,125,8,120,72,124,0,106,
14,68,0,93,54,92,2,125,9,125,10,100,5,124,9,23,
0,125,11,116,13,124,8,124,11,131,2,125,12,116,15,124,
- 12,131,1,114,152,124,0,106,16,124,10,124,1,124,12,124,
- 8,103,1,124,2,131,5,83,0,113,152,87,0,116,17,124,
+ 12,131,1,114,152,124,0,160,16,124,10,124,1,124,12,124,
+ 8,103,1,124,2,161,5,83,0,113,152,87,0,116,17,124,
8,131,1,125,3,120,88,124,0,106,14,68,0,93,78,92,
2,125,9,125,10,116,13,124,0,106,2,124,4,124,9,23,
0,131,2,125,12,116,18,106,19,100,6,124,12,100,3,100,
7,141,3,1,0,124,7,124,9,23,0,124,6,107,6,114,
- 226,116,15,124,12,131,1,114,226,124,0,106,16,124,10,124,
- 1,124,12,100,8,124,2,131,5,83,0,113,226,87,0,124,
- 3,144,1,114,94,116,18,106,19,100,9,124,8,131,2,1,
- 0,116,18,106,20,124,1,100,8,131,2,125,13,124,8,103,
+ 226,116,15,124,12,131,1,114,226,124,0,160,16,124,10,124,
+ 1,124,12,100,8,124,2,161,5,83,0,113,226,87,0,124,
+ 3,144,1,114,94,116,18,160,19,100,9,124,8,161,2,1,
+ 0,116,18,160,20,124,1,100,8,161,2,125,13,124,8,103,
1,124,13,95,21,124,13,83,0,100,8,83,0,41,11,122,
111,84,114,121,32,116,111,32,102,105,110,100,32,97,32,115,
112,101,99,32,102,111,114,32,116,104,101,32,115,112,101,99,
@@ -2134,25 +2134,25 @@ const unsigned char _Py_M__importlib_external[] = {
0,90,13,105,110,105,116,95,102,105,108,101,110,97,109,101,
90,9,102,117,108,108,95,112,97,116,104,114,162,0,0,0,
114,4,0,0,0,114,4,0,0,0,114,6,0,0,0,114,
- 178,0,0,0,209,4,0,0,115,70,0,0,0,0,5,4,
+ 178,0,0,0,210,4,0,0,115,70,0,0,0,0,5,4,
1,14,1,2,1,24,1,14,1,10,1,10,1,8,1,6,
2,6,1,6,1,10,2,6,1,4,2,8,1,12,1,16,
1,8,1,10,1,8,1,24,4,8,2,16,1,16,1,16,
1,12,1,8,1,10,1,12,1,6,1,12,1,12,1,8,
1,4,1,122,20,70,105,108,101,70,105,110,100,101,114,46,
102,105,110,100,95,115,112,101,99,99,1,0,0,0,0,0,
- 0,0,9,0,0,0,13,0,0,0,67,0,0,0,115,194,
- 0,0,0,124,0,106,0,125,1,121,22,116,1,106,2,124,
- 1,112,22,116,1,106,3,131,0,131,1,125,2,87,0,110,
+ 0,0,9,0,0,0,14,0,0,0,67,0,0,0,115,194,
+ 0,0,0,124,0,106,0,125,1,121,22,116,1,160,2,124,
+ 1,112,22,116,1,160,3,161,0,161,1,125,2,87,0,110,
30,4,0,116,4,116,5,116,6,102,3,107,10,114,58,1,
0,1,0,1,0,103,0,125,2,89,0,110,2,88,0,116,
- 7,106,8,106,9,100,1,131,1,115,84,116,10,124,2,131,
+ 7,106,8,160,9,100,1,161,1,115,84,116,10,124,2,131,
1,124,0,95,11,110,78,116,10,131,0,125,3,120,64,124,
- 2,68,0,93,56,125,4,124,4,106,12,100,2,131,1,92,
- 3,125,5,125,6,125,7,124,6,114,138,100,3,106,13,124,
- 5,124,7,106,14,131,0,131,2,125,8,110,4,124,5,125,
- 8,124,3,106,15,124,8,131,1,1,0,113,96,87,0,124,
- 3,124,0,95,11,116,7,106,8,106,9,116,16,131,1,114,
+ 2,68,0,93,56,125,4,124,4,160,12,100,2,161,1,92,
+ 3,125,5,125,6,125,7,124,6,114,138,100,3,160,13,124,
+ 5,124,7,160,14,161,0,161,2,125,8,110,4,124,5,125,
+ 8,124,3,160,15,124,8,161,1,1,0,113,96,87,0,124,
+ 3,124,0,95,11,116,7,106,8,160,9,116,16,161,1,114,
190,100,4,100,5,132,0,124,2,68,0,131,1,124,0,95,
17,100,6,83,0,41,7,122,68,70,105,108,108,32,116,104,
101,32,99,97,99,104,101,32,111,102,32,112,111,116,101,110,
@@ -2160,12 +2160,12 @@ const unsigned char _Py_M__importlib_external[] = {
32,112,97,99,107,97,103,101,115,32,102,111,114,32,116,104,
105,115,32,100,105,114,101,99,116,111,114,121,46,114,0,0,
0,0,114,61,0,0,0,122,5,123,125,46,123,125,99,1,
- 0,0,0,0,0,0,0,2,0,0,0,3,0,0,0,83,
+ 0,0,0,0,0,0,0,2,0,0,0,4,0,0,0,83,
0,0,0,115,20,0,0,0,104,0,124,0,93,12,125,1,
- 124,1,106,0,131,0,146,2,113,4,83,0,114,4,0,0,
+ 124,1,160,0,161,0,146,2,113,4,83,0,114,4,0,0,
0,41,1,114,92,0,0,0,41,2,114,24,0,0,0,90,
2,102,110,114,4,0,0,0,114,4,0,0,0,114,6,0,
- 0,0,250,9,60,115,101,116,99,111,109,112,62,30,5,0,
+ 0,0,250,9,60,115,101,116,99,111,109,112,62,31,5,0,
0,115,2,0,0,0,6,0,122,41,70,105,108,101,70,105,
110,100,101,114,46,95,102,105,108,108,95,99,97,99,104,101,
46,60,108,111,99,97,108,115,62,46,60,115,101,116,99,111,
@@ -2182,7 +2182,7 @@ const unsigned char _Py_M__importlib_external[] = {
102,105,120,95,99,111,110,116,101,110,116,115,114,244,0,0,
0,114,102,0,0,0,114,234,0,0,0,114,222,0,0,0,
90,8,110,101,119,95,110,97,109,101,114,4,0,0,0,114,
- 4,0,0,0,114,6,0,0,0,114,12,1,0,0,1,5,
+ 4,0,0,0,114,6,0,0,0,114,12,1,0,0,2,5,
0,0,115,34,0,0,0,0,2,6,1,2,1,22,1,20,
3,10,3,12,1,12,7,6,1,10,1,16,1,4,1,18,
2,4,1,14,1,6,1,12,1,122,22,70,105,108,101,70,
@@ -2220,7 +2220,7 @@ const unsigned char _Py_M__importlib_external[] = {
0,0,0,114,103,0,0,0,41,1,114,37,0,0,0,41,
2,114,168,0,0,0,114,11,1,0,0,114,4,0,0,0,
114,6,0,0,0,218,24,112,97,116,104,95,104,111,111,107,
- 95,102,111,114,95,70,105,108,101,70,105,110,100,101,114,42,
+ 95,102,111,114,95,70,105,108,101,70,105,110,100,101,114,43,
5,0,0,115,6,0,0,0,0,2,8,1,12,1,122,54,
70,105,108,101,70,105,110,100,101,114,46,112,97,116,104,95,
104,111,111,107,46,60,108,111,99,97,108,115,62,46,112,97,
@@ -2228,16 +2228,16 @@ const unsigned char _Py_M__importlib_external[] = {
70,105,110,100,101,114,114,4,0,0,0,41,3,114,168,0,
0,0,114,11,1,0,0,114,17,1,0,0,114,4,0,0,
0,41,2,114,168,0,0,0,114,11,1,0,0,114,6,0,
- 0,0,218,9,112,97,116,104,95,104,111,111,107,32,5,0,
+ 0,0,218,9,112,97,116,104,95,104,111,111,107,33,5,0,
0,115,4,0,0,0,0,10,14,6,122,20,70,105,108,101,
70,105,110,100,101,114,46,112,97,116,104,95,104,111,111,107,
- 99,1,0,0,0,0,0,0,0,1,0,0,0,2,0,0,
- 0,67,0,0,0,115,12,0,0,0,100,1,106,0,124,0,
- 106,1,131,1,83,0,41,2,78,122,16,70,105,108,101,70,
+ 99,1,0,0,0,0,0,0,0,1,0,0,0,3,0,0,
+ 0,67,0,0,0,115,12,0,0,0,100,1,160,0,124,0,
+ 106,1,161,1,83,0,41,2,78,122,16,70,105,108,101,70,
105,110,100,101,114,40,123,33,114,125,41,41,2,114,50,0,
0,0,114,37,0,0,0,41,1,114,104,0,0,0,114,4,
0,0,0,114,4,0,0,0,114,6,0,0,0,114,243,0,
- 0,0,50,5,0,0,115,2,0,0,0,0,1,122,19,70,
+ 0,0,51,5,0,0,115,2,0,0,0,0,1,122,19,70,
105,108,101,70,105,110,100,101,114,46,95,95,114,101,112,114,
95,95,41,1,78,41,15,114,109,0,0,0,114,108,0,0,
0,114,110,0,0,0,114,111,0,0,0,114,182,0,0,0,
@@ -2245,12 +2245,12 @@ const unsigned char _Py_M__importlib_external[] = {
121,0,0,0,114,4,1,0,0,114,178,0,0,0,114,12,
1,0,0,114,180,0,0,0,114,18,1,0,0,114,243,0,
0,0,114,4,0,0,0,114,4,0,0,0,114,4,0,0,
- 0,114,6,0,0,0,114,5,1,0,0,163,4,0,0,115,
+ 0,114,6,0,0,0,114,5,1,0,0,164,4,0,0,115,
20,0,0,0,8,7,4,2,8,14,8,4,4,2,8,12,
8,5,10,48,8,31,12,18,114,5,1,0,0,99,4,0,
0,0,0,0,0,0,6,0,0,0,11,0,0,0,67,0,
- 0,0,115,146,0,0,0,124,0,106,0,100,1,131,1,125,
- 4,124,0,106,0,100,2,131,1,125,5,124,4,115,66,124,
+ 0,0,115,146,0,0,0,124,0,160,0,100,1,161,1,125,
+ 4,124,0,160,0,100,2,161,1,125,5,124,4,115,66,124,
5,114,36,124,5,106,1,125,4,110,30,124,2,124,3,107,
2,114,56,116,2,124,1,124,2,131,2,125,4,110,10,116,
3,124,1,124,2,131,2,125,4,124,5,115,84,116,4,124,
@@ -2268,12 +2268,12 @@ const unsigned char _Py_M__importlib_external[] = {
90,8,112,97,116,104,110,97,109,101,90,9,99,112,97,116,
104,110,97,109,101,114,124,0,0,0,114,162,0,0,0,114,
4,0,0,0,114,4,0,0,0,114,6,0,0,0,218,14,
- 95,102,105,120,95,117,112,95,109,111,100,117,108,101,56,5,
+ 95,102,105,120,95,117,112,95,109,111,100,117,108,101,57,5,
0,0,115,34,0,0,0,0,2,10,1,10,1,4,1,4,
1,8,1,8,1,12,2,10,1,4,1,14,1,2,1,8,
1,8,1,8,1,12,1,14,2,114,23,1,0,0,99,0,
0,0,0,0,0,0,0,3,0,0,0,3,0,0,0,67,
- 0,0,0,115,38,0,0,0,116,0,116,1,106,2,131,0,
+ 0,0,0,115,38,0,0,0,116,0,116,1,160,2,161,0,
102,2,125,0,116,3,116,4,102,2,125,1,116,5,116,6,
102,2,125,2,124,0,124,1,124,2,103,3,83,0,41,1,
122,95,82,101,116,117,114,110,115,32,97,32,108,105,115,116,
@@ -2288,13 +2288,13 @@ const unsigned char _Py_M__importlib_external[] = {
114,78,0,0,0,41,3,90,10,101,120,116,101,110,115,105,
111,110,115,90,6,115,111,117,114,99,101,90,8,98,121,116,
101,99,111,100,101,114,4,0,0,0,114,4,0,0,0,114,
- 6,0,0,0,114,159,0,0,0,79,5,0,0,115,8,0,
+ 6,0,0,0,114,159,0,0,0,80,5,0,0,115,8,0,
0,0,0,5,12,1,8,1,8,1,114,159,0,0,0,99,
1,0,0,0,0,0,0,0,12,0,0,0,12,0,0,0,
67,0,0,0,115,188,1,0,0,124,0,97,0,116,0,106,
1,97,1,116,0,106,2,97,2,116,1,106,3,116,4,25,
0,125,1,120,56,100,26,68,0,93,48,125,2,124,2,116,
- 1,106,3,107,7,114,58,116,0,106,5,124,2,131,1,125,
+ 1,106,3,107,7,114,58,116,0,160,5,124,2,161,1,125,
3,110,10,116,1,106,3,124,2,25,0,125,3,116,6,124,
1,124,2,124,3,131,3,1,0,113,32,87,0,100,5,100,
6,103,1,102,2,100,7,100,8,100,6,103,2,102,2,102,
@@ -2302,22 +2302,22 @@ const unsigned char _Py_M__importlib_external[] = {
6,116,7,100,9,100,10,132,0,124,6,68,0,131,1,131,
1,115,142,116,8,130,1,124,6,100,11,25,0,125,7,124,
5,116,1,106,3,107,6,114,174,116,1,106,3,124,5,25,
- 0,125,8,80,0,113,112,121,16,116,0,106,5,124,5,131,
+ 0,125,8,80,0,113,112,121,16,116,0,160,5,124,5,161,
1,125,8,80,0,87,0,113,112,4,0,116,9,107,10,114,
212,1,0,1,0,1,0,119,112,89,0,113,112,88,0,113,
112,87,0,116,9,100,12,131,1,130,1,116,6,124,1,100,
13,124,8,131,3,1,0,116,6,124,1,100,14,124,7,131,
- 3,1,0,116,6,124,1,100,15,100,16,106,10,124,6,131,
- 1,131,3,1,0,121,14,116,0,106,5,100,17,131,1,125,
+ 3,1,0,116,6,124,1,100,15,100,16,160,10,124,6,161,
+ 1,131,3,1,0,121,14,116,0,160,5,100,17,161,1,125,
9,87,0,110,26,4,0,116,9,107,10,144,1,114,52,1,
0,1,0,1,0,100,18,125,9,89,0,110,2,88,0,116,
- 6,124,1,100,17,124,9,131,3,1,0,116,0,106,5,100,
- 19,131,1,125,10,116,6,124,1,100,19,124,10,131,3,1,
- 0,124,5,100,7,107,2,144,1,114,120,116,0,106,5,100,
- 20,131,1,125,11,116,6,124,1,100,21,124,11,131,3,1,
+ 6,124,1,100,17,124,9,131,3,1,0,116,0,160,5,100,
+ 19,161,1,125,10,116,6,124,1,100,19,124,10,131,3,1,
+ 0,124,5,100,7,107,2,144,1,114,120,116,0,160,5,100,
+ 20,161,1,125,11,116,6,124,1,100,21,124,11,131,3,1,
0,116,6,124,1,100,22,116,11,131,0,131,3,1,0,116,
- 12,106,13,116,2,106,14,131,0,131,1,1,0,124,5,100,
- 7,107,2,144,1,114,184,116,15,106,16,100,23,131,1,1,
+ 12,160,13,116,2,160,14,161,0,161,1,1,0,124,5,100,
+ 7,107,2,144,1,114,184,116,15,160,16,100,23,161,1,1,
0,100,24,116,12,107,6,144,1,114,184,100,25,116,17,95,
18,100,18,83,0,41,27,122,205,83,101,116,117,112,32,116,
104,101,32,112,97,116,104,45,98,97,115,101,100,32,105,109,
@@ -2341,7 +2341,7 @@ const unsigned char _Py_M__importlib_external[] = {
100,1,83,0,41,2,114,31,0,0,0,78,41,1,114,33,
0,0,0,41,2,114,24,0,0,0,114,81,0,0,0,114,
4,0,0,0,114,4,0,0,0,114,6,0,0,0,114,224,
- 0,0,0,115,5,0,0,115,2,0,0,0,4,0,122,25,
+ 0,0,0,116,5,0,0,115,2,0,0,0,4,0,122,25,
95,115,101,116,117,112,46,60,108,111,99,97,108,115,62,46,
60,103,101,110,101,120,112,114,62,114,62,0,0,0,122,30,
105,109,112,111,114,116,108,105,98,32,114,101,113,117,105,114,
@@ -2370,17 +2370,17 @@ const unsigned char _Py_M__importlib_external[] = {
100,117,108,101,90,14,119,101,97,107,114,101,102,95,109,111,
100,117,108,101,90,13,119,105,110,114,101,103,95,109,111,100,
117,108,101,114,4,0,0,0,114,4,0,0,0,114,6,0,
- 0,0,218,6,95,115,101,116,117,112,90,5,0,0,115,82,
+ 0,0,218,6,95,115,101,116,117,112,91,5,0,0,115,82,
0,0,0,0,8,4,1,6,1,6,3,10,1,10,1,10,
1,12,2,10,1,16,3,22,1,14,2,22,1,8,1,10,
1,10,1,4,2,2,1,10,1,6,1,14,1,12,2,8,
1,12,1,12,1,18,3,2,1,14,1,16,2,10,1,12,
3,10,1,12,3,10,1,10,1,12,3,14,1,14,1,10,
1,10,1,10,1,114,31,1,0,0,99,1,0,0,0,0,
- 0,0,0,2,0,0,0,3,0,0,0,67,0,0,0,115,
+ 0,0,0,2,0,0,0,4,0,0,0,67,0,0,0,115,
50,0,0,0,116,0,124,0,131,1,1,0,116,1,131,0,
- 125,1,116,2,106,3,106,4,116,5,106,6,124,1,142,0,
- 103,1,131,1,1,0,116,2,106,7,106,8,116,9,131,1,
+ 125,1,116,2,106,3,160,4,116,5,106,6,124,1,142,0,
+ 103,1,161,1,1,0,116,2,106,7,160,8,116,9,161,1,
1,0,100,1,83,0,41,2,122,41,73,110,115,116,97,108,
108,32,116,104,101,32,112,97,116,104,45,98,97,115,101,100,
32,105,109,112,111,114,116,32,99,111,109,112,111,110,101,110,
@@ -2391,7 +2391,7 @@ const unsigned char _Py_M__importlib_external[] = {
114,30,1,0,0,90,17,115,117,112,112,111,114,116,101,100,
95,108,111,97,100,101,114,115,114,4,0,0,0,114,4,0,
0,0,114,6,0,0,0,218,8,95,105,110,115,116,97,108,
- 108,158,5,0,0,115,8,0,0,0,0,2,8,1,6,1,
+ 108,159,5,0,0,115,8,0,0,0,0,2,8,1,6,1,
20,1,114,33,1,0,0,41,1,114,0,0,0,0,41,2,
114,1,0,0,0,114,2,0,0,0,41,1,114,49,0,0,
0,41,1,78,41,3,78,78,78,41,3,78,78,78,41,2,
@@ -2424,7 +2424,7 @@ const unsigned char _Py_M__importlib_external[] = {
0,0,0,114,4,0,0,0,114,6,0,0,0,218,8,60,
109,111,100,117,108,101,62,8,0,0,0,115,108,0,0,0,
4,16,4,1,4,1,2,1,6,3,8,17,8,5,8,5,
- 8,6,8,12,8,10,8,9,8,5,8,7,10,22,10,123,
+ 8,6,8,12,8,10,8,9,8,5,8,7,10,22,10,124,
16,1,12,2,4,1,4,2,6,2,6,2,8,2,16,45,
8,34,8,19,8,12,8,12,8,28,8,17,10,55,10,12,
10,10,8,14,6,3,4,1,14,67,14,64,14,29,16,110,
diff --git a/Python/marshal.c b/Python/marshal.c
index 87a4b240a4..d71d3c2b9d 100644
--- a/Python/marshal.c
+++ b/Python/marshal.c
@@ -1274,7 +1274,7 @@ r_object(RFILE *p)
if (n == 0 && type == TYPE_FROZENSET) {
/* call frozenset() to get the empty frozenset singleton */
- v = PyObject_CallFunction((PyObject*)&PyFrozenSet_Type, NULL);
+ v = _PyObject_CallNoArg((PyObject*)&PyFrozenSet_Type);
if (v == NULL)
break;
R_REF(v);
@@ -1649,7 +1649,7 @@ marshal_dump(PyObject *self, PyObject *args)
s = PyMarshal_WriteObjectToString(x, version);
if (s == NULL)
return NULL;
- res = _PyObject_CallMethodId(f, &PyId_write, "O", s);
+ res = _PyObject_CallMethodIdObjArgs(f, &PyId_write, s, NULL);
Py_DECREF(s);
return res;
}
diff --git a/Python/modsupport.c b/Python/modsupport.c
index aabee8fa59..e9e025bdb2 100644
--- a/Python/modsupport.c
+++ b/Python/modsupport.c
@@ -7,16 +7,17 @@
typedef double va_double;
static PyObject *va_build_value(const char *, va_list, int);
+static PyObject **va_build_stack(PyObject **small_stack, Py_ssize_t small_stack_len, const char *, va_list, int, Py_ssize_t*);
/* Package context -- the full module name for package imports */
-char *_Py_PackageContext = NULL;
+const char *_Py_PackageContext = NULL;
/* Helper for mkvalue() to scan the length of a format */
-static int
-countformat(const char *format, int endchar)
+static Py_ssize_t
+countformat(const char *format, char endchar)
{
- int count = 0;
+ Py_ssize_t count = 0;
int level = 0;
while (level > 0 || *format != endchar) {
switch (*format) {
@@ -28,8 +29,9 @@ countformat(const char *format, int endchar)
case '(':
case '[':
case '{':
- if (level == 0)
+ if (level == 0) {
count++;
+ }
level++;
break;
case ')':
@@ -45,8 +47,9 @@ countformat(const char *format, int endchar)
case '\t':
break;
default:
- if (level == 0)
+ if (level == 0) {
count++;
+ }
}
format++;
}
@@ -57,17 +60,18 @@ countformat(const char *format, int endchar)
/* Generic function to create a value -- the inverse of getargs() */
/* After an original idea and first implementation by Steven Miale */
-static PyObject *do_mktuple(const char**, va_list *, int, int, int);
-static PyObject *do_mklist(const char**, va_list *, int, int, int);
-static PyObject *do_mkdict(const char**, va_list *, int, int, int);
+static PyObject *do_mktuple(const char**, va_list *, char, Py_ssize_t, int);
+static int do_mkstack(PyObject **, const char**, va_list *, char, Py_ssize_t, int);
+static PyObject *do_mklist(const char**, va_list *, char, Py_ssize_t, int);
+static PyObject *do_mkdict(const char**, va_list *, char, Py_ssize_t, int);
static PyObject *do_mkvalue(const char**, va_list *, int);
static void
-do_ignore(const char **p_format, va_list *p_va, int endchar, int n, int flags)
+do_ignore(const char **p_format, va_list *p_va, char endchar, Py_ssize_t n, int flags)
{
PyObject *v;
- int i;
+ Py_ssize_t i;
assert(PyErr_Occurred());
v = PyTuple_New(n);
for (i = 0; i < n; i++) {
@@ -91,15 +95,16 @@ do_ignore(const char **p_format, va_list *p_va, int endchar, int n, int flags)
"Unmatched paren in format");
return;
}
- if (endchar)
+ if (endchar) {
++*p_format;
+ }
}
static PyObject *
-do_mkdict(const char **p_format, va_list *p_va, int endchar, int n, int flags)
+do_mkdict(const char **p_format, va_list *p_va, char endchar, Py_ssize_t n, int flags)
{
PyObject *d;
- int i;
+ Py_ssize_t i;
if (n < 0)
return NULL;
if (n % 2) {
@@ -146,10 +151,10 @@ do_mkdict(const char **p_format, va_list *p_va, int endchar, int n, int flags)
}
static PyObject *
-do_mklist(const char **p_format, va_list *p_va, int endchar, int n, int flags)
+do_mklist(const char **p_format, va_list *p_va, char endchar, Py_ssize_t n, int flags)
{
PyObject *v;
- int i;
+ Py_ssize_t i;
if (n < 0)
return NULL;
/* Note that we can't bail immediately on error as this will leak
@@ -179,11 +184,48 @@ do_mklist(const char **p_format, va_list *p_va, int endchar, int n, int flags)
return v;
}
+static int
+do_mkstack(PyObject **stack, const char **p_format, va_list *p_va,
+ char endchar, Py_ssize_t n, int flags)
+{
+ Py_ssize_t i;
+
+ if (n < 0) {
+ return -1;
+ }
+ /* Note that we can't bail immediately on error as this will leak
+ refcounts on any 'N' arguments. */
+ for (i = 0; i < n; i++) {
+ PyObject *w = do_mkvalue(p_format, p_va, flags);
+ if (w == NULL) {
+ do_ignore(p_format, p_va, endchar, n - i - 1, flags);
+ goto error;
+ }
+ stack[i] = w;
+ }
+ if (**p_format != endchar) {
+ PyErr_SetString(PyExc_SystemError,
+ "Unmatched paren in format");
+ goto error;
+ }
+ if (endchar) {
+ ++*p_format;
+ }
+ return 0;
+
+error:
+ n = i;
+ for (i=0; i < n; i++) {
+ Py_DECREF(stack[i]);
+ }
+ return -1;
+}
+
static PyObject *
-do_mktuple(const char **p_format, va_list *p_va, int endchar, int n, int flags)
+do_mktuple(const char **p_format, va_list *p_va, char endchar, Py_ssize_t n, int flags)
{
PyObject *v;
- int i;
+ Py_ssize_t i;
if (n < 0)
return NULL;
/* Note that we can't bail immediately on error as this will leak
@@ -286,8 +328,8 @@ do_mkvalue(const char **p_format, va_list *p_va, int flags)
}
else {
if (n < 0)
- n = Py_UNICODE_strlen(u);
- v = PyUnicode_FromUnicode(u, n);
+ n = wcslen(u);
+ v = PyUnicode_FromWideChar(u, n);
}
return v;
}
@@ -465,15 +507,14 @@ static PyObject *
va_build_value(const char *format, va_list va, int flags)
{
const char *f = format;
- int n = countformat(f, '\0');
+ Py_ssize_t n = countformat(f, '\0');
va_list lva;
PyObject *retval;
if (n < 0)
return NULL;
if (n == 0) {
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
va_copy(lva, va);
if (n == 1) {
@@ -485,9 +526,68 @@ va_build_value(const char *format, va_list va, int flags)
return retval;
}
+PyObject **
+_Py_VaBuildStack(PyObject **small_stack, Py_ssize_t small_stack_len,
+ const char *format, va_list va, Py_ssize_t *p_nargs)
+{
+ return va_build_stack(small_stack, small_stack_len, format, va, 0, p_nargs);
+}
+
+PyObject **
+_Py_VaBuildStack_SizeT(PyObject **small_stack, Py_ssize_t small_stack_len,
+ const char *format, va_list va, Py_ssize_t *p_nargs)
+{
+ return va_build_stack(small_stack, small_stack_len, format, va, FLAG_SIZE_T, p_nargs);
+}
+
+static PyObject **
+va_build_stack(PyObject **small_stack, Py_ssize_t small_stack_len,
+ const char *format, va_list va, int flags, Py_ssize_t *p_nargs)
+{
+ const char *f;
+ Py_ssize_t n;
+ va_list lva;
+ PyObject **stack;
+ int res;
+
+ n = countformat(format, '\0');
+ if (n < 0) {
+ *p_nargs = 0;
+ return NULL;
+ }
+
+ if (n == 0) {
+ *p_nargs = 0;
+ return small_stack;
+ }
+
+ if (n <= small_stack_len) {
+ stack = small_stack;
+ }
+ else {
+ stack = PyMem_Malloc(n * sizeof(stack[0]));
+ if (stack == NULL) {
+ PyErr_NoMemory();
+ return NULL;
+ }
+ }
+
+ va_copy(lva, va);
+ f = format;
+ res = do_mkstack(stack, &f, &lva, '\0', n, flags);
+ va_end(lva);
+
+ if (res < 0) {
+ return NULL;
+ }
+
+ *p_nargs = n;
+ return stack;
+}
+
PyObject *
-PyEval_CallFunction(PyObject *obj, const char *format, ...)
+PyEval_CallFunction(PyObject *callable, const char *format, ...)
{
va_list vargs;
PyObject *args;
@@ -501,7 +601,7 @@ PyEval_CallFunction(PyObject *obj, const char *format, ...)
if (args == NULL)
return NULL;
- res = PyEval_CallObject(obj, args);
+ res = PyEval_CallObject(callable, args);
Py_DECREF(args);
return res;
@@ -509,14 +609,14 @@ PyEval_CallFunction(PyObject *obj, const char *format, ...)
PyObject *
-PyEval_CallMethod(PyObject *obj, const char *methodname, const char *format, ...)
+PyEval_CallMethod(PyObject *obj, const char *name, const char *format, ...)
{
va_list vargs;
PyObject *meth;
PyObject *args;
PyObject *res;
- meth = PyObject_GetAttrString(obj, methodname);
+ meth = PyObject_GetAttrString(obj, name);
if (meth == NULL)
return NULL;
diff --git a/Python/opcode_targets.h b/Python/opcode_targets.h
index 72d24080d8..567f8723a6 100644
--- a/Python/opcode_targets.h
+++ b/Python/opcode_targets.h
@@ -159,8 +159,8 @@ static void *opcode_targets[256] = {
&&TARGET_BUILD_STRING,
&&TARGET_BUILD_TUPLE_UNPACK_WITH_CALL,
&&_unknown_opcode,
- &&_unknown_opcode,
- &&_unknown_opcode,
+ &&TARGET_LOAD_METHOD,
+ &&TARGET_CALL_METHOD,
&&_unknown_opcode,
&&_unknown_opcode,
&&_unknown_opcode,
diff --git a/Python/pylifecycle.c b/Python/pylifecycle.c
index a4f7f823bc..06030c330a 100644
--- a/Python/pylifecycle.c
+++ b/Python/pylifecycle.c
@@ -193,7 +193,8 @@ add_flag(int flag, const char *envs)
static char*
get_codec_name(const char *encoding)
{
- char *name_utf8, *name_str;
+ const char *name_utf8;
+ char *name_str;
PyObject *codec, *name = NULL;
codec = _PyCodec_Lookup(encoding);
@@ -1284,8 +1285,7 @@ initstdio(void)
when import.c tries to write to stderr in verbose mode. */
encoding_attr = PyObject_GetAttrString(std, "encoding");
if (encoding_attr != NULL) {
- const char * std_encoding;
- std_encoding = PyUnicode_AsUTF8(encoding_attr);
+ const char *std_encoding = PyUnicode_AsUTF8(encoding_attr);
if (std_encoding != NULL) {
PyObject *codec_info = _PyCodec_Lookup(std_encoding);
Py_XDECREF(codec_info);
diff --git a/Python/pythonrun.c b/Python/pythonrun.c
index 8befa546a9..5bddbad1c8 100644
--- a/Python/pythonrun.c
+++ b/Python/pythonrun.c
@@ -154,7 +154,7 @@ PyRun_InteractiveOneObject(FILE *fp, PyObject *filename, PyCompilerFlags *flags)
PyObject *m, *d, *v, *w, *oenc = NULL, *mod_name;
mod_ty mod;
PyArena *arena;
- char *ps1 = "", *ps2 = "", *enc = NULL;
+ const char *ps1 = "", *ps2 = "", *enc = NULL;
int errcode = 0;
_Py_IDENTIFIER(encoding);
_Py_IDENTIFIER(__main__);
@@ -511,8 +511,8 @@ PyErr_Print(void)
static void
print_error_text(PyObject *f, int offset, PyObject *text_obj)
{
- char *text;
- char *nl;
+ const char *text;
+ const char *nl;
text = PyUnicode_AsUTF8(text_obj);
if (text == NULL)
diff --git a/Python/structmember.c b/Python/structmember.c
index be2737d405..e653d0277c 100644
--- a/Python/structmember.c
+++ b/Python/structmember.c
@@ -249,7 +249,7 @@ PyMember_SetOne(char *addr, PyMemberDef *l, PyObject *v)
Py_XDECREF(oldv);
break;
case T_CHAR: {
- char *string;
+ const char *string;
Py_ssize_t len;
string = PyUnicode_AsUTF8AndSize(v, &len);
diff --git a/Python/sysmodule.c b/Python/sysmodule.c
index 52034ff7fb..81520ea84f 100644
--- a/Python/sysmodule.c
+++ b/Python/sysmodule.c
@@ -108,7 +108,7 @@ sys_displayhook_unencodable(PyObject *outf, PyObject *o)
{
PyObject *stdout_encoding = NULL;
PyObject *encoded, *escaped_str, *repr_str, *buffer, *result;
- char *stdout_encoding_str;
+ const char *stdout_encoding_str;
int ret;
stdout_encoding = _PyObject_GetAttrId(outf, &PyId_encoding);
@@ -130,7 +130,7 @@ sys_displayhook_unencodable(PyObject *outf, PyObject *o)
buffer = _PyObject_GetAttrId(outf, &PyId_buffer);
if (buffer) {
- result = _PyObject_CallMethodId(buffer, &PyId_write, "(O)", encoded);
+ result = _PyObject_CallMethodIdObjArgs(buffer, &PyId_write, encoded, NULL);
Py_DECREF(buffer);
Py_DECREF(encoded);
if (result == NULL)
@@ -179,8 +179,7 @@ sys_displayhook(PyObject *self, PyObject *o)
/* After printing, also assign to '_' */
/* Before, set '_' to None to avoid recursion */
if (o == Py_None) {
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
if (_PyObject_SetAttrId(builtins, &PyId__, Py_None) != 0)
return NULL;
@@ -211,8 +210,7 @@ sys_displayhook(PyObject *self, PyObject *o)
return NULL;
if (_PyObject_SetAttrId(builtins, &PyId__, o) != 0)
return NULL;
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
PyDoc_STRVAR(displayhook_doc,
@@ -228,8 +226,7 @@ sys_excepthook(PyObject* self, PyObject* args)
if (!PyArg_UnpackTuple(args, "excepthook", 3, 3, &exc, &value, &tb))
return NULL;
PyErr_Display(exc, value, tb);
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
PyDoc_STRVAR(excepthook_doc,
@@ -461,8 +458,7 @@ sys_settrace(PyObject *self, PyObject *args)
PyEval_SetTrace(NULL, NULL);
else
PyEval_SetTrace(trace_trampoline, args);
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
PyDoc_STRVAR(settrace_doc,
@@ -500,8 +496,7 @@ sys_setprofile(PyObject *self, PyObject *args)
PyEval_SetProfile(NULL, NULL);
else
PyEval_SetProfile(profile_trampoline, args);
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
PyDoc_STRVAR(setprofile_doc,
@@ -542,8 +537,7 @@ sys_setcheckinterval(PyObject *self, PyObject *args)
return NULL;
if (!PyArg_ParseTuple(args, "i:setcheckinterval", &_check_interval))
return NULL;
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
PyDoc_STRVAR(setcheckinterval_doc,
@@ -581,8 +575,7 @@ sys_setswitchinterval(PyObject *self, PyObject *args)
return NULL;
}
_PyEval_SetSwitchInterval((unsigned long) (1e6 * d));
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
PyDoc_STRVAR(setswitchinterval_doc,
@@ -644,8 +637,7 @@ sys_setrecursionlimit(PyObject *self, PyObject *args)
}
Py_SetRecursionLimit(new_limit);
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
static PyObject *
@@ -1032,8 +1024,7 @@ sys_setdlopenflags(PyObject *self, PyObject *args)
if (!tstate)
return NULL;
tstate->interp->dlopenflags = new_val;
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
PyDoc_STRVAR(setdlopenflags_doc,
@@ -1074,8 +1065,7 @@ sys_mdebug(PyObject *self, PyObject *args)
if (!PyArg_ParseTuple(args, "i:mdebug", &flag))
return NULL;
mallopt(M_DEBUG, flag);
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
#endif /* USE_MALLOPT */
@@ -1098,7 +1088,7 @@ _PySys_GetSizeOf(PyObject *o)
Py_TYPE(o)->tp_name);
}
else {
- res = PyObject_CallFunctionObjArgs(method, NULL);
+ res = _PyObject_CallNoArg(method);
Py_DECREF(method);
}
@@ -1287,6 +1277,19 @@ a 11-tuple where the entries in the tuple are counts of:\n\
10. Number of stack pops performed by call_function()"
);
+static PyObject *
+sys_callstats(PyObject *self)
+{
+ if (PyErr_WarnEx(PyExc_DeprecationWarning,
+ "sys.callstats() has been deprecated in Python 3.7 "
+ "and will be removed in the future", 1) < 0) {
+ return NULL;
+ }
+
+ Py_RETURN_NONE;
+}
+
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -1350,9 +1353,23 @@ PyDoc_STRVAR(is_finalizing_doc,
Return True if Python is exiting.");
+#ifdef ANDROID_API_LEVEL
+PyDoc_STRVAR(getandroidapilevel_doc,
+"getandroidapilevel()\n\
+\n\
+Return the build time API version of Android as an integer.");
+
+static PyObject *
+sys_getandroidapilevel(PyObject *self)
+{
+ return PyLong_FromLong(ANDROID_API_LEVEL);
+}
+#endif /* ANDROID_API_LEVEL */
+
+
static PyMethodDef sys_methods[] = {
/* Might as well keep this in alphabetic order */
- {"callstats", (PyCFunction)PyEval_GetCallStats, METH_NOARGS,
+ {"callstats", (PyCFunction)sys_callstats, METH_NOARGS,
callstats_doc},
{"_clear_type_cache", sys_clear_type_cache, METH_NOARGS,
sys_clear_type_cache__doc__},
@@ -1434,6 +1451,10 @@ static PyMethodDef sys_methods[] = {
METH_VARARGS | METH_KEYWORDS, set_asyncgen_hooks_doc},
{"get_asyncgen_hooks", sys_get_asyncgen_hooks, METH_NOARGS,
get_asyncgen_hooks_doc},
+#ifdef ANDROID_API_LEVEL
+ {"getandroidapilevel", (PyCFunction)sys_getandroidapilevel, METH_NOARGS,
+ getandroidapilevel_doc},
+#endif
{NULL, NULL} /* sentinel */
};
@@ -1547,8 +1568,9 @@ error:
Py_XDECREF(name);
Py_XDECREF(value);
/* No return value, therefore clear error state if possible */
- if (_PyThreadState_UncheckedGet())
+ if (_PyThreadState_UncheckedGet()) {
PyErr_Clear();
+ }
}
PyObject *
@@ -2293,7 +2315,7 @@ sys_pyfile_write_unicode(PyObject *unicode, PyObject *file)
if (writer == NULL)
goto error;
- result = _PyObject_CallArg1(writer, unicode);
+ result = PyObject_CallFunctionObjArgs(writer, unicode, NULL);
if (result == NULL) {
goto error;
} else {
@@ -2403,7 +2425,7 @@ sys_format(_Py_Identifier *key, FILE *fp, const char *format, va_list va)
{
PyObject *file, *message;
PyObject *error_type, *error_value, *error_traceback;
- char *utf8;
+ const char *utf8;
PyErr_Fetch(&error_type, &error_value, &error_traceback);
file = _PySys_GetObjectId(key);
diff --git a/README b/README
index 4fc97e6013..bd2735da87 100644
--- a/README
+++ b/README
@@ -1,5 +1,5 @@
-This is Python version 3.6.1 release candidate 1
-================================================
+This is Python version 3.7.0 alpha 1
+====================================
Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011,
2012, 2013, 2014, 2015, 2016, 2017 Python Software Foundation. All rights
@@ -90,9 +90,9 @@ What's New
----------
We have a comprehensive overview of the changes in the "What's New in
-Python 3.6" document, found at
+Python 3.7" document, found at
- https://docs.python.org/3.6/whatsnew/3.6.html
+ https://docs.python.org/3.7/whatsnew/3.7.html
For a more detailed change log, read Misc/NEWS (though this file, too,
is incomplete, and also doesn't list anything merged in from the 2.7
@@ -105,9 +105,9 @@ entitled "Installing multiple versions".
Documentation
-------------
-Documentation for Python 3.6 is online, updated daily:
+Documentation for Python 3.7 is online, updated daily:
- https://docs.python.org/3.6/
+ https://docs.python.org/3.7/
It can also be downloaded in many formats for faster access. The documentation
is downloadable in HTML, PDF, and reStructuredText formats; the latter version
@@ -132,7 +132,7 @@ backported versions of certain key Python 3.x features.
A source-to-source translation tool, "2to3", can take care of the mundane task
of converting large amounts of source code. It is not a complete solution but
is complemented by the deprecation warnings in 2.6. See
-https://docs.python.org/3.6/library/2to3.html for more information.
+https://docs.python.org/3.7/library/2to3.html for more information.
Testing
@@ -171,8 +171,8 @@ same prefix you must decide which version (if any) is your "primary" version.
Install that version using "make install". Install all other versions using
"make altinstall".
-For example, if you want to install Python 2.7, 3.5, and 3.6 with 3.6 being the
-primary version, you would execute "make install" in your 3.6 build directory
+For example, if you want to install Python 2.7, 3.6, and 3.7 with 3.7 being the
+primary version, you would execute "make install" in your 3.7 build directory
and "make altinstall" in the others.
diff --git a/Tools/README b/Tools/README
index 0d961de23d..73ce6a7eee 100644
--- a/Tools/README
+++ b/Tools/README
@@ -23,8 +23,6 @@ msi Support for packaging Python as an MSI package on Windows.
parser Un-parsing tool to generate code from an AST.
-pybench Low-level benchmarking for the Python evaluation loop. (*)
-
pynche A Tkinter-based color editor.
scripts A number of useful single-file programs, e.g. tabnanny.py
diff --git a/Tools/clinic/clinic.py b/Tools/clinic/clinic.py
index 75ac673737..894d1c5d99 100755
--- a/Tools/clinic/clinic.py
+++ b/Tools/clinic/clinic.py
@@ -705,14 +705,14 @@ class CLanguage(Language):
{c_basename}({self_type}{self_name}, PyObject *args, PyObject *kwargs)
""")
- parser_prototype_fastcall = normalize_snippet("""
+ parser_prototype_varargs = normalize_snippet("""
static PyObject *
- {c_basename}({self_type}{self_name}, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
+ {c_basename}({self_type}{self_name}, PyObject *args)
""")
- parser_prototype_varargs = normalize_snippet("""
+ parser_prototype_fastcall = normalize_snippet("""
static PyObject *
- {c_basename}({self_type}{self_name}, PyObject *args)
+ {c_basename}({self_type}{self_name}, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
""")
# parser_body_fields remembers the fields passed in to the
@@ -825,30 +825,64 @@ class CLanguage(Language):
# and nothing but normal objects:
# PyArg_UnpackTuple!
- flags = "METH_VARARGS"
- parser_prototype = parser_prototype_varargs
+ if not new_or_init:
+ flags = "METH_FASTCALL"
+ parser_prototype = parser_prototype_fastcall
- parser_definition = parser_body(parser_prototype, normalize_snippet("""
- if (!PyArg_UnpackTuple(args, "{name}",
- {unpack_min}, {unpack_max},
- {parse_arguments})) {{
- goto exit;
- }}
- """, indent=4))
+ parser_definition = parser_body(parser_prototype, normalize_snippet("""
+ if (!_PyArg_UnpackStack(args, nargs, "{name}",
+ {unpack_min}, {unpack_max},
+ {parse_arguments})) {{
+ goto exit;
+ }}
+
+ if ({self_type_check}!_PyArg_NoStackKeywords("{name}", kwnames)) {{
+ goto exit;
+ }}
+ """, indent=4))
+ else:
+ flags = "METH_VARARGS"
+ parser_prototype = parser_prototype_varargs
+
+ parser_definition = parser_body(parser_prototype, normalize_snippet("""
+ if (!PyArg_UnpackTuple(args, "{name}",
+ {unpack_min}, {unpack_max},
+ {parse_arguments})) {{
+ goto exit;
+ }}
+ """, indent=4))
elif positional:
- # positional-only, but no option groups
- # we only need one call to PyArg_ParseTuple
+ if not new_or_init:
+ # positional-only, but no option groups
+ # we only need one call to _PyArg_ParseStack
- flags = "METH_VARARGS"
- parser_prototype = parser_prototype_varargs
+ flags = "METH_FASTCALL"
+ parser_prototype = parser_prototype_fastcall
- parser_definition = parser_body(parser_prototype, normalize_snippet("""
- if (!PyArg_ParseTuple(args, "{format_units}:{name}",
- {parse_arguments})) {{
- goto exit;
- }}
- """, indent=4))
+ parser_definition = parser_body(parser_prototype, normalize_snippet("""
+ if (!_PyArg_ParseStack(args, nargs, "{format_units}:{name}",
+ {parse_arguments})) {{
+ goto exit;
+ }}
+
+ if ({self_type_check}!_PyArg_NoStackKeywords("{name}", kwnames)) {{
+ goto exit;
+ }}
+ """, indent=4))
+ else:
+ # positional-only, but no option groups
+ # we only need one call to PyArg_ParseTuple
+
+ flags = "METH_VARARGS"
+ parser_prototype = parser_prototype_varargs
+
+ parser_definition = parser_body(parser_prototype, normalize_snippet("""
+ if (!PyArg_ParseTuple(args, "{format_units}:{name}",
+ {parse_arguments})) {{
+ goto exit;
+ }}
+ """, indent=4))
elif not new_or_init:
flags = "METH_FASTCALL"
@@ -856,7 +890,7 @@ class CLanguage(Language):
parser_prototype = parser_prototype_fastcall
body = normalize_snippet("""
- if (!_PyArg_ParseStack(args, nargs, kwnames, &_parser,
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser,
{parse_arguments})) {{
goto exit;
}}
diff --git a/Tools/gdb/libpython.py b/Tools/gdb/libpython.py
index cc1afbe16d..4f45256188 100755
--- a/Tools/gdb/libpython.py
+++ b/Tools/gdb/libpython.py
@@ -362,6 +362,7 @@ class PyObjectPtr(object):
'set' : PySetObjectPtr,
'frozenset' : PySetObjectPtr,
'builtin_function_or_method' : PyCFunctionObjectPtr,
+ 'method-wrapper': wrapperobject,
}
if tp_name in name_map:
return name_map[tp_name]
@@ -1330,6 +1331,39 @@ class PyUnicodeObjectPtr(PyObjectPtr):
out.write(quote)
+class wrapperobject(PyObjectPtr):
+ _typename = 'wrapperobject'
+
+ def safe_name(self):
+ try:
+ name = self.field('descr')['d_base']['name'].string()
+ return repr(name)
+ except (NullPyObjectPtr, RuntimeError):
+ return '<unknown name>'
+
+ def safe_tp_name(self):
+ try:
+ return self.field('self')['ob_type']['tp_name'].string()
+ except (NullPyObjectPtr, RuntimeError):
+ return '<unknown tp_name>'
+
+ def safe_self_addresss(self):
+ try:
+ address = long(self.field('self'))
+ return '%#x' % address
+ except (NullPyObjectPtr, RuntimeError):
+ return '<failed to get self address>'
+
+ def proxyval(self, visited):
+ name = self.safe_name()
+ tp_name = self.safe_tp_name()
+ self_address = self.safe_self_addresss()
+ return ("<method-wrapper %s of %s object at %s>"
+ % (name, tp_name, self_address))
+
+ def write_repr(self, out, visited):
+ proxy = self.proxyval(visited)
+ out.write(proxy)
def int_from_int(gdbval):
@@ -1364,11 +1398,13 @@ class PyObjectPtrPrinter:
def pretty_printer_lookup(gdbval):
type = gdbval.type.unqualified()
- if type.code == gdb.TYPE_CODE_PTR:
- type = type.target().unqualified()
- t = str(type)
- if t in ("PyObject", "PyFrameObject", "PyUnicodeObject"):
- return PyObjectPtrPrinter(gdbval)
+ if type.code != gdb.TYPE_CODE_PTR:
+ return None
+
+ type = type.target().unqualified()
+ t = str(type)
+ if t in ("PyObject", "PyFrameObject", "PyUnicodeObject", "wrapperobject"):
+ return PyObjectPtrPrinter(gdbval)
"""
During development, I've been manually invoking the code in this way:
@@ -1497,15 +1533,14 @@ class Frame(object):
return 'Garbage-collecting'
# Detect invocations of PyCFunction instances:
- older = self.older()
- if not older:
- return False
-
- caller = older._gdbframe.name()
+ frame = self._gdbframe
+ caller = frame.name()
if not caller:
return False
- if caller == 'PyCFunction_Call':
+ if caller in ('_PyCFunction_FastCallDict',
+ '_PyCFunction_FastCallKeywords'):
+ arg_name = 'func'
# Within that frame:
# "func" is the local containing the PyObject* of the
# PyCFunctionObject instance
@@ -1513,17 +1548,17 @@ class Frame(object):
# "self" is the (PyObject*) of the 'self'
try:
# Use the prettyprinter for the func:
- func = older._gdbframe.read_var('func')
+ func = frame.read_var(arg_name)
return str(func)
except RuntimeError:
- return 'PyCFunction invocation (unable to read "func")'
+ return 'PyCFunction invocation (unable to read %s)' % arg_name
- elif caller == '_PyCFunction_FastCallDict':
+ if caller == 'wrapper_call':
try:
- func = older._gdbframe.read_var('func_obj')
+ func = frame.read_var('wp')
return str(func)
except RuntimeError:
- return 'PyCFunction invocation (unable to read "func_obj")'
+ return '<wrapper_call invocation>'
# This frame isn't worth reporting:
return False
diff --git a/Tools/msi/buildrelease.bat b/Tools/msi/buildrelease.bat
index 4659a32b83..d144c2ce35 100644
--- a/Tools/msi/buildrelease.bat
+++ b/Tools/msi/buildrelease.bat
@@ -83,7 +83,7 @@ if errorlevel 1 goto :eof
where dlltool /q && goto skipdlltoolsearch
set _DLLTOOL_PATH=
-where /R "%EXTERNALS%\" dlltool > "%TEMP%\dlltool.loc" 2> nul && set /P _DLLTOOL_PATH= < "%TEMP%\dlltool.loc" & del "%TEMP%\dlltool.loc"
+where /R "%EXTERNALS%\" dlltool > "%TEMP%\dlltool.loc" 2> nul && set /P _DLLTOOL_PATH= < "%TEMP%\dlltool.loc" & del "%TEMP%\dlltool.loc"
if not exist "%_DLLTOOL_PATH%" echo Cannot find binutils on PATH or in external && exit /B 1
for %%f in (%_DLLTOOL_PATH%) do set PATH=%PATH%;%%~dpf
set _DLLTOOL_PATH=
diff --git a/Tools/pybench/Arithmetic.py b/Tools/pybench/Arithmetic.py
deleted file mode 100644
index d4766a7016..0000000000
--- a/Tools/pybench/Arithmetic.py
+++ /dev/null
@@ -1,777 +0,0 @@
-from pybench import Test
-
-class SimpleIntegerArithmetic(Test):
-
- version = 2.0
- operations = 5 * (3 + 5 + 5 + 3 + 3 + 3)
- rounds = 120000
-
- def test(self):
-
- for i in range(self.rounds):
-
- a = 2
- b = 3
- c = 3
-
- c = a + b
- c = b + c
- c = c + a
- c = a + b
- c = b + c
-
- c = c - a
- c = a - b
- c = b - c
- c = c - a
- c = b - c
-
- c = a / b
- c = b / a
- c = c / b
-
- c = a * b
- c = b * a
- c = c * b
-
- c = a / b
- c = b / a
- c = c / b
-
- a = 2
- b = 3
- c = 3
-
- c = a + b
- c = b + c
- c = c + a
- c = a + b
- c = b + c
-
- c = c - a
- c = a - b
- c = b - c
- c = c - a
- c = b - c
-
- c = a / b
- c = b / a
- c = c / b
-
- c = a * b
- c = b * a
- c = c * b
-
- c = a / b
- c = b / a
- c = c / b
-
- a = 2
- b = 3
- c = 3
-
- c = a + b
- c = b + c
- c = c + a
- c = a + b
- c = b + c
-
- c = c - a
- c = a - b
- c = b - c
- c = c - a
- c = b - c
-
- c = a / b
- c = b / a
- c = c / b
-
- c = a * b
- c = b * a
- c = c * b
-
- c = a / b
- c = b / a
- c = c / b
-
- a = 2
- b = 3
- c = 3
-
- c = a + b
- c = b + c
- c = c + a
- c = a + b
- c = b + c
-
- c = c - a
- c = a - b
- c = b - c
- c = c - a
- c = b - c
-
- c = a / b
- c = b / a
- c = c / b
-
- c = a * b
- c = b * a
- c = c * b
-
- c = a / b
- c = b / a
- c = c / b
-
- a = 2
- b = 3
- c = 3
-
- c = a + b
- c = b + c
- c = c + a
- c = a + b
- c = b + c
-
- c = c - a
- c = a - b
- c = b - c
- c = c - a
- c = b - c
-
- c = a / b
- c = b / a
- c = c / b
-
- c = a * b
- c = b * a
- c = c * b
-
- c = a / b
- c = b / a
- c = c / b
-
- def calibrate(self):
-
- for i in range(self.rounds):
- pass
-
-class SimpleFloatArithmetic(Test):
-
- version = 2.0
- operations = 5 * (3 + 5 + 5 + 3 + 3 + 3)
- rounds = 120000
-
- def test(self):
-
- for i in range(self.rounds):
-
- a = 2.1
- b = 3.3332
- c = 3.14159
-
- c = a + b
- c = b + c
- c = c + a
- c = a + b
- c = b + c
-
- c = c - a
- c = a - b
- c = b - c
- c = c - a
- c = b - c
-
- c = a / b
- c = b / a
- c = c / b
-
- c = a * b
- c = b * a
- c = c * b
-
- c = a / b
- c = b / a
- c = c / b
-
- a = 2.1
- b = 3.3332
- c = 3.14159
-
- c = a + b
- c = b + c
- c = c + a
- c = a + b
- c = b + c
-
- c = c - a
- c = a - b
- c = b - c
- c = c - a
- c = b - c
-
- c = a / b
- c = b / a
- c = c / b
-
- c = a * b
- c = b * a
- c = c * b
-
- c = a / b
- c = b / a
- c = c / b
-
- a = 2.1
- b = 3.3332
- c = 3.14159
-
- c = a + b
- c = b + c
- c = c + a
- c = a + b
- c = b + c
-
- c = c - a
- c = a - b
- c = b - c
- c = c - a
- c = b - c
-
- c = a / b
- c = b / a
- c = c / b
-
- c = a * b
- c = b * a
- c = c * b
-
- c = a / b
- c = b / a
- c = c / b
-
- a = 2.1
- b = 3.3332
- c = 3.14159
-
- c = a + b
- c = b + c
- c = c + a
- c = a + b
- c = b + c
-
- c = c - a
- c = a - b
- c = b - c
- c = c - a
- c = b - c
-
- c = a / b
- c = b / a
- c = c / b
-
- c = a * b
- c = b * a
- c = c * b
-
- c = a / b
- c = b / a
- c = c / b
-
- a = 2.1
- b = 3.3332
- c = 3.14159
-
- c = a + b
- c = b + c
- c = c + a
- c = a + b
- c = b + c
-
- c = c - a
- c = a - b
- c = b - c
- c = c - a
- c = b - c
-
- c = a / b
- c = b / a
- c = c / b
-
- c = a * b
- c = b * a
- c = c * b
-
- c = a / b
- c = b / a
- c = c / b
-
- def calibrate(self):
-
- for i in range(self.rounds):
- pass
-
-class SimpleIntFloatArithmetic(Test):
-
- version = 2.0
- operations = 5 * (3 + 5 + 5 + 3 + 3 + 3)
- rounds = 120000
-
- def test(self):
-
- for i in range(self.rounds):
-
- a = 2
- b = 3
- c = 3.14159
-
- c = a + b
- c = b + c
- c = c + a
- c = a + b
- c = b + c
-
- c = c - a
- c = a - b
- c = b - c
- c = c - a
- c = b - c
-
- c = a / b
- c = b / a
- c = c / b
-
- c = a * b
- c = b * a
- c = c * b
-
- c = a / b
- c = b / a
- c = c / b
-
- a = 2
- b = 3
- c = 3.14159
-
- c = a + b
- c = b + c
- c = c + a
- c = a + b
- c = b + c
-
- c = c - a
- c = a - b
- c = b - c
- c = c - a
- c = b - c
-
- c = a / b
- c = b / a
- c = c / b
-
- c = a * b
- c = b * a
- c = c * b
-
- c = a / b
- c = b / a
- c = c / b
-
- a = 2
- b = 3
- c = 3.14159
-
- c = a + b
- c = b + c
- c = c + a
- c = a + b
- c = b + c
-
- c = c - a
- c = a - b
- c = b - c
- c = c - a
- c = b - c
-
- c = a / b
- c = b / a
- c = c / b
-
- c = a * b
- c = b * a
- c = c * b
-
- c = a / b
- c = b / a
- c = c / b
-
- a = 2
- b = 3
- c = 3.14159
-
- c = a + b
- c = b + c
- c = c + a
- c = a + b
- c = b + c
-
- c = c - a
- c = a - b
- c = b - c
- c = c - a
- c = b - c
-
- c = a / b
- c = b / a
- c = c / b
-
- c = a * b
- c = b * a
- c = c * b
-
- c = a / b
- c = b / a
- c = c / b
-
- a = 2
- b = 3
- c = 3.14159
-
- c = a + b
- c = b + c
- c = c + a
- c = a + b
- c = b + c
-
- c = c - a
- c = a - b
- c = b - c
- c = c - a
- c = b - c
-
- c = a / b
- c = b / a
- c = c / b
-
- c = a * b
- c = b * a
- c = c * b
-
- c = a / b
- c = b / a
- c = c / b
-
- def calibrate(self):
-
- for i in range(self.rounds):
- pass
-
-
-class SimpleLongArithmetic(Test):
-
- version = 2.0
- operations = 5 * (3 + 5 + 5 + 3 + 3 + 3)
- rounds = 60000
-
- def test(self):
-
- for i in range(self.rounds):
-
- a = 2220001
- b = 100001
- c = 30005
-
- c = a + b
- c = b + c
- c = c + a
- c = a + b
- c = b + c
-
- c = c - a
- c = a - b
- c = b - c
- c = c - a
- c = b - c
-
- c = a / b
- c = b / a
- c = c / b
-
- c = a * b
- c = b * a
- c = c * b
-
- c = a / b
- c = b / a
- c = c / b
-
- a = 2220001
- b = 100001
- c = 30005
-
- c = a + b
- c = b + c
- c = c + a
- c = a + b
- c = b + c
-
- c = c - a
- c = a - b
- c = b - c
- c = c - a
- c = b - c
-
- c = a / b
- c = b / a
- c = c / b
-
- c = a * b
- c = b * a
- c = c * b
-
- c = a / b
- c = b / a
- c = c / b
-
- a = 2220001
- b = 100001
- c = 30005
-
- c = a + b
- c = b + c
- c = c + a
- c = a + b
- c = b + c
-
- c = c - a
- c = a - b
- c = b - c
- c = c - a
- c = b - c
-
- c = a / b
- c = b / a
- c = c / b
-
- c = a * b
- c = b * a
- c = c * b
-
- c = a / b
- c = b / a
- c = c / b
-
- a = 2220001
- b = 100001
- c = 30005
-
- c = a + b
- c = b + c
- c = c + a
- c = a + b
- c = b + c
-
- c = c - a
- c = a - b
- c = b - c
- c = c - a
- c = b - c
-
- c = a / b
- c = b / a
- c = c / b
-
- c = a * b
- c = b * a
- c = c * b
-
- c = a / b
- c = b / a
- c = c / b
-
- a = 2220001
- b = 100001
- c = 30005
-
- c = a + b
- c = b + c
- c = c + a
- c = a + b
- c = b + c
-
- c = c - a
- c = a - b
- c = b - c
- c = c - a
- c = b - c
-
- c = a / b
- c = b / a
- c = c / b
-
- c = a * b
- c = b * a
- c = c * b
-
- c = a / b
- c = b / a
- c = c / b
-
- def calibrate(self):
-
- for i in range(self.rounds):
- pass
-
-class SimpleComplexArithmetic(Test):
-
- version = 2.0
- operations = 5 * (3 + 5 + 5 + 3 + 3 + 3)
- rounds = 80000
-
- def test(self):
-
- for i in range(self.rounds):
-
- a = 2 + 3j
- b = 2.5 + 4.5j
- c = 1.2 + 6.2j
-
- c = a + b
- c = b + c
- c = c + a
- c = a + b
- c = b + c
-
- c = c - a
- c = a - b
- c = b - c
- c = c - a
- c = b - c
-
- c = a / b
- c = b / a
- c = c / b
-
- c = a * b
- c = b * a
- c = c * b
-
- c = a / b
- c = b / a
- c = c / b
-
- a = 2 + 3j
- b = 2.5 + 4.5j
- c = 1.2 + 6.2j
-
- c = a + b
- c = b + c
- c = c + a
- c = a + b
- c = b + c
-
- c = c - a
- c = a - b
- c = b - c
- c = c - a
- c = b - c
-
- c = a / b
- c = b / a
- c = c / b
-
- c = a * b
- c = b * a
- c = c * b
-
- c = a / b
- c = b / a
- c = c / b
-
- a = 2 + 3j
- b = 2.5 + 4.5j
- c = 1.2 + 6.2j
-
- c = a + b
- c = b + c
- c = c + a
- c = a + b
- c = b + c
-
- c = c - a
- c = a - b
- c = b - c
- c = c - a
- c = b - c
-
- c = a / b
- c = b / a
- c = c / b
-
- c = a * b
- c = b * a
- c = c * b
-
- c = a / b
- c = b / a
- c = c / b
-
- a = 2 + 3j
- b = 2.5 + 4.5j
- c = 1.2 + 6.2j
-
- c = a + b
- c = b + c
- c = c + a
- c = a + b
- c = b + c
-
- c = c - a
- c = a - b
- c = b - c
- c = c - a
- c = b - c
-
- c = a / b
- c = b / a
- c = c / b
-
- c = a * b
- c = b * a
- c = c * b
-
- c = a / b
- c = b / a
- c = c / b
-
- a = 2 + 3j
- b = 2.5 + 4.5j
- c = 1.2 + 6.2j
-
- c = a + b
- c = b + c
- c = c + a
- c = a + b
- c = b + c
-
- c = c - a
- c = a - b
- c = b - c
- c = c - a
- c = b - c
-
- c = a / b
- c = b / a
- c = c / b
-
- c = a * b
- c = b * a
- c = c * b
-
- c = a / b
- c = b / a
- c = c / b
-
- def calibrate(self):
-
- for i in range(self.rounds):
- pass
diff --git a/Tools/pybench/Calls.py b/Tools/pybench/Calls.py
deleted file mode 100644
index 2e6da1840f..0000000000
--- a/Tools/pybench/Calls.py
+++ /dev/null
@@ -1,560 +0,0 @@
-from pybench import Test
-
-class PythonFunctionCalls(Test):
-
- version = 2.1
- operations = 5*(1+4+4+2)
- rounds = 60000
-
- def test(self):
-
- global f,f1,g,h
-
- # define functions
- def f():
- pass
-
- def f1(x):
- pass
-
- def g(a,b,c):
- return a,b,c
-
- def h(a,b,c,d=1,e=2,f=3):
- return d,e,f
-
- # do calls
- for i in range(self.rounds):
-
- f()
- f1(i)
- f1(i)
- f1(i)
- f1(i)
- g(i,i,i)
- g(i,i,i)
- g(i,i,i)
- g(i,i,i)
- h(i,i,3,i,i)
- h(i,i,i,2,i,3)
-
- f()
- f1(i)
- f1(i)
- f1(i)
- f1(i)
- g(i,i,i)
- g(i,i,i)
- g(i,i,i)
- g(i,i,i)
- h(i,i,3,i,i)
- h(i,i,i,2,i,3)
-
- f()
- f1(i)
- f1(i)
- f1(i)
- f1(i)
- g(i,i,i)
- g(i,i,i)
- g(i,i,i)
- g(i,i,i)
- h(i,i,3,i,i)
- h(i,i,i,2,i,3)
-
- f()
- f1(i)
- f1(i)
- f1(i)
- f1(i)
- g(i,i,i)
- g(i,i,i)
- g(i,i,i)
- g(i,i,i)
- h(i,i,3,i,i)
- h(i,i,i,2,i,3)
-
- f()
- f1(i)
- f1(i)
- f1(i)
- f1(i)
- g(i,i,i)
- g(i,i,i)
- g(i,i,i)
- g(i,i,i)
- h(i,i,3,i,i)
- h(i,i,i,2,i,3)
-
- def calibrate(self):
-
- global f,f1,g,h
-
- # define functions
- def f():
- pass
-
- def f1(x):
- pass
-
- def g(a,b,c):
- return a,b,c
-
- def h(a,b,c,d=1,e=2,f=3):
- return d,e,f
-
- # do calls
- for i in range(self.rounds):
- pass
-
-###
-
-class ComplexPythonFunctionCalls(Test):
-
- version = 2.0
- operations = 4*5
- rounds = 100000
-
- def test(self):
-
- # define functions
- def f(a,b,c,d=1,e=2,f=3):
- return f
-
- args = 1,2
- kwargs = dict(c=3,d=4,e=5)
-
- # do calls
- for i in range(self.rounds):
- f(a=i,b=i,c=i)
- f(f=i,e=i,d=i,c=2,b=i,a=3)
- f(1,b=i,**kwargs)
- f(*args,**kwargs)
-
- f(a=i,b=i,c=i)
- f(f=i,e=i,d=i,c=2,b=i,a=3)
- f(1,b=i,**kwargs)
- f(*args,**kwargs)
-
- f(a=i,b=i,c=i)
- f(f=i,e=i,d=i,c=2,b=i,a=3)
- f(1,b=i,**kwargs)
- f(*args,**kwargs)
-
- f(a=i,b=i,c=i)
- f(f=i,e=i,d=i,c=2,b=i,a=3)
- f(1,b=i,**kwargs)
- f(*args,**kwargs)
-
- f(a=i,b=i,c=i)
- f(f=i,e=i,d=i,c=2,b=i,a=3)
- f(1,b=i,**kwargs)
- f(*args,**kwargs)
-
-
- def calibrate(self):
-
- # define functions
- def f(a,b,c,d=1,e=2,f=3):
- return f
-
- args = 1,2
- kwargs = dict(c=3,d=4,e=5)
-
- # do calls
- for i in range(self.rounds):
- pass
-
-###
-
-class BuiltinFunctionCalls(Test):
-
- version = 2.0
- operations = 5*(2+5+5+5)
- rounds = 60000
-
- def test(self):
-
- # localize functions
- f0 = globals
- f1 = hash
- f2 = divmod
- f3 = max
-
- # do calls
- for i in range(self.rounds):
-
- f0()
- f0()
- f1(i)
- f1(i)
- f1(i)
- f1(i)
- f1(i)
- f2(1,2)
- f2(1,2)
- f2(1,2)
- f2(1,2)
- f2(1,2)
- f3(1,3,2)
- f3(1,3,2)
- f3(1,3,2)
- f3(1,3,2)
- f3(1,3,2)
-
- f0()
- f0()
- f1(i)
- f1(i)
- f1(i)
- f1(i)
- f1(i)
- f2(1,2)
- f2(1,2)
- f2(1,2)
- f2(1,2)
- f2(1,2)
- f3(1,3,2)
- f3(1,3,2)
- f3(1,3,2)
- f3(1,3,2)
- f3(1,3,2)
-
- f0()
- f0()
- f1(i)
- f1(i)
- f1(i)
- f1(i)
- f1(i)
- f2(1,2)
- f2(1,2)
- f2(1,2)
- f2(1,2)
- f2(1,2)
- f3(1,3,2)
- f3(1,3,2)
- f3(1,3,2)
- f3(1,3,2)
- f3(1,3,2)
-
- f0()
- f0()
- f1(i)
- f1(i)
- f1(i)
- f1(i)
- f1(i)
- f2(1,2)
- f2(1,2)
- f2(1,2)
- f2(1,2)
- f2(1,2)
- f3(1,3,2)
- f3(1,3,2)
- f3(1,3,2)
- f3(1,3,2)
- f3(1,3,2)
-
- f0()
- f0()
- f1(i)
- f1(i)
- f1(i)
- f1(i)
- f1(i)
- f2(1,2)
- f2(1,2)
- f2(1,2)
- f2(1,2)
- f2(1,2)
- f3(1,3,2)
- f3(1,3,2)
- f3(1,3,2)
- f3(1,3,2)
- f3(1,3,2)
-
- def calibrate(self):
-
- # localize functions
- f0 = dir
- f1 = hash
- f2 = divmod
- f3 = max
-
- # do calls
- for i in range(self.rounds):
- pass
-
-###
-
-class PythonMethodCalls(Test):
-
- version = 2.0
- operations = 5*(6 + 5 + 4)
- rounds = 30000
-
- def test(self):
-
- class c:
-
- x = 2
- s = 'string'
-
- def f(self):
-
- return self.x
-
- def j(self,a,b):
-
- self.y = a
- self.t = b
- return self.y
-
- def k(self,a,b,c=3):
-
- self.y = a
- self.s = b
- self.t = c
-
- o = c()
-
- for i in range(self.rounds):
-
- o.f()
- o.f()
- o.f()
- o.f()
- o.f()
- o.f()
- o.j(i,i)
- o.j(i,i)
- o.j(i,2)
- o.j(i,2)
- o.j(2,2)
- o.k(i,i)
- o.k(i,2)
- o.k(i,2,3)
- o.k(i,i,c=4)
-
- o.f()
- o.f()
- o.f()
- o.f()
- o.f()
- o.f()
- o.j(i,i)
- o.j(i,i)
- o.j(i,2)
- o.j(i,2)
- o.j(2,2)
- o.k(i,i)
- o.k(i,2)
- o.k(i,2,3)
- o.k(i,i,c=4)
-
- o.f()
- o.f()
- o.f()
- o.f()
- o.f()
- o.f()
- o.j(i,i)
- o.j(i,i)
- o.j(i,2)
- o.j(i,2)
- o.j(2,2)
- o.k(i,i)
- o.k(i,2)
- o.k(i,2,3)
- o.k(i,i,c=4)
-
- o.f()
- o.f()
- o.f()
- o.f()
- o.f()
- o.f()
- o.j(i,i)
- o.j(i,i)
- o.j(i,2)
- o.j(i,2)
- o.j(2,2)
- o.k(i,i)
- o.k(i,2)
- o.k(i,2,3)
- o.k(i,i,c=4)
-
- o.f()
- o.f()
- o.f()
- o.f()
- o.f()
- o.f()
- o.j(i,i)
- o.j(i,i)
- o.j(i,2)
- o.j(i,2)
- o.j(2,2)
- o.k(i,i)
- o.k(i,2)
- o.k(i,2,3)
- o.k(i,i,c=4)
-
- def calibrate(self):
-
- class c:
-
- x = 2
- s = 'string'
-
- def f(self):
-
- return self.x
-
- def j(self,a,b):
-
- self.y = a
- self.t = b
-
- def k(self,a,b,c=3):
-
- self.y = a
- self.s = b
- self.t = c
-
- o = c
-
- for i in range(self.rounds):
- pass
-
-###
-
-class Recursion(Test):
-
- version = 2.0
- operations = 5
- rounds = 100000
-
- def test(self):
-
- global f
-
- def f(x):
-
- if x > 1:
- return f(x-1)
- return 1
-
- for i in range(self.rounds):
- f(10)
- f(10)
- f(10)
- f(10)
- f(10)
-
- def calibrate(self):
-
- global f
-
- def f(x):
-
- if x > 0:
- return f(x-1)
- return 1
-
- for i in range(self.rounds):
- pass
-
-
-### Test to make Fredrik happy...
-
-if __name__ == '__main__':
- import timeit
- if 0:
- timeit.TestClass = PythonFunctionCalls
- timeit.main(['-s', 'test = TestClass(); test.rounds = 1000',
- 'test.test()'])
- else:
- setup = """\
-global f,f1,g,h
-
-# define functions
-def f():
- pass
-
-def f1(x):
- pass
-
-def g(a,b,c):
- return a,b,c
-
-def h(a,b,c,d=1,e=2,f=3):
- return d,e,f
-
-i = 1
-"""
- test = """\
-f()
-f1(i)
-f1(i)
-f1(i)
-f1(i)
-g(i,i,i)
-g(i,i,i)
-g(i,i,i)
-g(i,i,i)
-h(i,i,3,i,i)
-h(i,i,i,2,i,3)
-
-f()
-f1(i)
-f1(i)
-f1(i)
-f1(i)
-g(i,i,i)
-g(i,i,i)
-g(i,i,i)
-g(i,i,i)
-h(i,i,3,i,i)
-h(i,i,i,2,i,3)
-
-f()
-f1(i)
-f1(i)
-f1(i)
-f1(i)
-g(i,i,i)
-g(i,i,i)
-g(i,i,i)
-g(i,i,i)
-h(i,i,3,i,i)
-h(i,i,i,2,i,3)
-
-f()
-f1(i)
-f1(i)
-f1(i)
-f1(i)
-g(i,i,i)
-g(i,i,i)
-g(i,i,i)
-g(i,i,i)
-h(i,i,3,i,i)
-h(i,i,i,2,i,3)
-
-f()
-f1(i)
-f1(i)
-f1(i)
-f1(i)
-g(i,i,i)
-g(i,i,i)
-g(i,i,i)
-g(i,i,i)
-h(i,i,3,i,i)
-h(i,i,i,2,i,3)
-"""
-
- timeit.main(['-s', setup,
- test])
diff --git a/Tools/pybench/CommandLine.py b/Tools/pybench/CommandLine.py
deleted file mode 100644
index 54a8ba7326..0000000000
--- a/Tools/pybench/CommandLine.py
+++ /dev/null
@@ -1,642 +0,0 @@
-""" CommandLine - Get and parse command line options
-
- NOTE: This still is very much work in progress !!!
-
- Different version are likely to be incompatible.
-
- TODO:
-
- * Incorporate the changes made by (see Inbox)
- * Add number range option using srange()
-
-"""
-
-from __future__ import print_function
-
-__copyright__ = """\
-Copyright (c), 1997-2006, Marc-Andre Lemburg (mal@lemburg.com)
-Copyright (c), 2000-2006, eGenix.com Software GmbH (info@egenix.com)
-See the documentation for further information on copyrights,
-or contact the author. All Rights Reserved.
-"""
-
-__version__ = '1.2'
-
-import sys, getopt, glob, os, re, traceback
-
-### Helpers
-
-def _getopt_flags(options):
-
- """ Convert the option list to a getopt flag string and long opt
- list
-
- """
- s = []
- l = []
- for o in options:
- if o.prefix == '-':
- # short option
- s.append(o.name)
- if o.takes_argument:
- s.append(':')
- else:
- # long option
- if o.takes_argument:
- l.append(o.name+'=')
- else:
- l.append(o.name)
- return ''.join(s), l
-
-def invisible_input(prompt='>>> '):
-
- """ Get raw input from a terminal without echoing the characters to
- the terminal, e.g. for password queries.
-
- """
- import getpass
- entry = getpass.getpass(prompt)
- if entry is None:
- raise KeyboardInterrupt
- return entry
-
-def fileopen(name, mode='wb', encoding=None):
-
- """ Open a file using mode.
-
- Default mode is 'wb' meaning to open the file for writing in
- binary mode. If encoding is given, I/O to and from the file is
- transparently encoded using the given encoding.
-
- Files opened for writing are chmod()ed to 0600.
-
- """
- if name == 'stdout':
- return sys.stdout
- elif name == 'stderr':
- return sys.stderr
- elif name == 'stdin':
- return sys.stdin
- else:
- if encoding is not None:
- import codecs
- f = codecs.open(name, mode, encoding)
- else:
- f = open(name, mode)
- if 'w' in mode:
- os.chmod(name, 0o600)
- return f
-
-def option_dict(options):
-
- """ Return a dictionary mapping option names to Option instances.
- """
- d = {}
- for option in options:
- d[option.name] = option
- return d
-
-# Alias
-getpasswd = invisible_input
-
-_integerRE = re.compile(r'\s*(-?\d+)\s*$')
-_integerRangeRE = re.compile(r'\s*(-?\d+)\s*-\s*(-?\d+)\s*$')
-
-def srange(s,
-
- integer=_integerRE,
- integerRange=_integerRangeRE):
-
- """ Converts a textual representation of integer numbers and ranges
- to a Python list.
-
- Supported formats: 2,3,4,2-10,-1 - -3, 5 - -2
-
- Values are appended to the created list in the order specified
- in the string.
-
- """
- l = []
- append = l.append
- for entry in s.split(','):
- m = integer.match(entry)
- if m:
- append(int(m.groups()[0]))
- continue
- m = integerRange.match(entry)
- if m:
- start,end = map(int,m.groups())
- l[len(l):] = range(start,end+1)
- return l
-
-def abspath(path,
-
- expandvars=os.path.expandvars,expanduser=os.path.expanduser,
- join=os.path.join,getcwd=os.getcwd):
-
- """ Return the corresponding absolute path for path.
-
- path is expanded in the usual shell ways before
- joining it with the current working directory.
-
- """
- try:
- path = expandvars(path)
- except AttributeError:
- pass
- try:
- path = expanduser(path)
- except AttributeError:
- pass
- return join(getcwd(), path)
-
-### Option classes
-
-class Option:
-
- """ Option base class. Takes no argument.
-
- """
- default = None
- helptext = ''
- prefix = '-'
- takes_argument = 0
- has_default = 0
- tab = 15
-
- def __init__(self,name,help=None):
-
- if not name[:1] == '-':
- raise TypeError('option names must start with "-"')
- if name[1:2] == '-':
- self.prefix = '--'
- self.name = name[2:]
- else:
- self.name = name[1:]
- if help:
- self.help = help
-
- def __str__(self):
-
- o = self
- name = o.prefix + o.name
- if o.takes_argument:
- name = name + ' arg'
- if len(name) > self.tab:
- name = name + '\n' + ' ' * (self.tab + 1 + len(o.prefix))
- else:
- name = '%-*s ' % (self.tab, name)
- description = o.help
- if o.has_default:
- description = description + ' (%s)' % o.default
- return '%s %s' % (name, description)
-
-class ArgumentOption(Option):
-
- """ Option that takes an argument.
-
- An optional default argument can be given.
-
- """
- def __init__(self,name,help=None,default=None):
-
- # Basemethod
- Option.__init__(self,name,help)
-
- if default is not None:
- self.default = default
- self.has_default = 1
- self.takes_argument = 1
-
-class SwitchOption(Option):
-
- """ Options that can be on or off. Has an optional default value.
-
- """
- def __init__(self,name,help=None,default=None):
-
- # Basemethod
- Option.__init__(self,name,help)
-
- if default is not None:
- self.default = default
- self.has_default = 1
-
-### Application baseclass
-
-class Application:
-
- """ Command line application interface with builtin argument
- parsing.
-
- """
- # Options the program accepts (Option instances)
- options = []
-
- # Standard settings; these are appended to options in __init__
- preset_options = [SwitchOption('-v',
- 'generate verbose output'),
- SwitchOption('-h',
- 'show this help text'),
- SwitchOption('--help',
- 'show this help text'),
- SwitchOption('--debug',
- 'enable debugging'),
- SwitchOption('--copyright',
- 'show copyright'),
- SwitchOption('--examples',
- 'show examples of usage')]
-
- # The help layout looks like this:
- # [header] - defaults to ''
- #
- # [synopsis] - formatted as '<self.name> %s' % self.synopsis
- #
- # options:
- # [options] - formatted from self.options
- #
- # [version] - formatted as 'Version:\n %s' % self.version, if given
- #
- # [about] - defaults to ''
- #
- # Note: all fields that do not behave as template are formatted
- # using the instances dictionary as substitution namespace,
- # e.g. %(name)s will be replaced by the applications name.
- #
-
- # Header (default to program name)
- header = ''
-
- # Name (defaults to program name)
- name = ''
-
- # Synopsis (%(name)s is replaced by the program name)
- synopsis = '%(name)s [option] files...'
-
- # Version (optional)
- version = ''
-
- # General information printed after the possible options (optional)
- about = ''
-
- # Examples of usage to show when the --examples option is given (optional)
- examples = ''
-
- # Copyright to show
- copyright = __copyright__
-
- # Apply file globbing ?
- globbing = 1
-
- # Generate debug output ?
- debug = 0
-
- # Generate verbose output ?
- verbose = 0
-
- # Internal errors to catch
- InternalError = BaseException
-
- # Instance variables:
- values = None # Dictionary of passed options (or default values)
- # indexed by the options name, e.g. '-h'
- files = None # List of passed filenames
- optionlist = None # List of passed options
-
- def __init__(self,argv=None):
-
- # Setup application specs
- if argv is None:
- argv = sys.argv
- self.filename = os.path.split(argv[0])[1]
- if not self.name:
- self.name = os.path.split(self.filename)[1]
- else:
- self.name = self.name
- if not self.header:
- self.header = self.name
- else:
- self.header = self.header
-
- # Init .arguments list
- self.arguments = argv[1:]
-
- # Setup Option mapping
- self.option_map = option_dict(self.options)
-
- # Append preset options
- for option in self.preset_options:
- if not option.name in self.option_map:
- self.add_option(option)
-
- # Init .files list
- self.files = []
-
- # Start Application
- rc = 0
- try:
- # Process startup
- rc = self.startup()
- if rc is not None:
- raise SystemExit(rc)
-
- # Parse command line
- rc = self.parse()
- if rc is not None:
- raise SystemExit(rc)
-
- # Start application
- rc = self.main()
- if rc is None:
- rc = 0
-
- except SystemExit as rcException:
- rc = rcException
- pass
-
- except KeyboardInterrupt:
- print()
- print('* User Break')
- print()
- rc = 1
-
- except self.InternalError:
- print()
- print('* Internal Error (use --debug to display the traceback)')
- if self.debug:
- print()
- traceback.print_exc(20, sys.stdout)
- elif self.verbose:
- print(' %s: %s' % sys.exc_info()[:2])
- print()
- rc = 1
-
- raise SystemExit(rc)
-
- def add_option(self, option):
-
- """ Add a new Option instance to the Application dynamically.
-
- Note that this has to be done *before* .parse() is being
- executed.
-
- """
- self.options.append(option)
- self.option_map[option.name] = option
-
- def startup(self):
-
- """ Set user defined instance variables.
-
- If this method returns anything other than None, the
- process is terminated with the return value as exit code.
-
- """
- return None
-
- def exit(self, rc=0):
-
- """ Exit the program.
-
- rc is used as exit code and passed back to the calling
- program. It defaults to 0 which usually means: OK.
-
- """
- raise SystemExit(rc)
-
- def parse(self):
-
- """ Parse the command line and fill in self.values and self.files.
-
- After having parsed the options, the remaining command line
- arguments are interpreted as files and passed to .handle_files()
- for processing.
-
- As final step the option handlers are called in the order
- of the options given on the command line.
-
- """
- # Parse arguments
- self.values = values = {}
- for o in self.options:
- if o.has_default:
- values[o.prefix+o.name] = o.default
- else:
- values[o.prefix+o.name] = 0
- flags,lflags = _getopt_flags(self.options)
- try:
- optlist,files = getopt.getopt(self.arguments,flags,lflags)
- if self.globbing:
- l = []
- for f in files:
- gf = glob.glob(f)
- if not gf:
- l.append(f)
- else:
- l[len(l):] = gf
- files = l
- self.optionlist = optlist
- self.files = files + self.files
- except getopt.error as why:
- self.help(why)
- sys.exit(1)
-
- # Call file handler
- rc = self.handle_files(self.files)
- if rc is not None:
- sys.exit(rc)
-
- # Call option handlers
- for optionname, value in optlist:
-
- # Try to convert value to integer
- try:
- value = int(value)
- except ValueError:
- pass
-
- # Find handler and call it (or count the number of option
- # instances on the command line)
- handlername = 'handle' + optionname.replace('-', '_')
- try:
- handler = getattr(self, handlername)
- except AttributeError:
- if value == '':
- # count the number of occurrences
- if optionname in values:
- values[optionname] = values[optionname] + 1
- else:
- values[optionname] = 1
- else:
- values[optionname] = value
- else:
- rc = handler(value)
- if rc is not None:
- raise SystemExit(rc)
-
- # Apply final file check (for backward compatibility)
- rc = self.check_files(self.files)
- if rc is not None:
- sys.exit(rc)
-
- def check_files(self,filelist):
-
- """ Apply some user defined checks on the files given in filelist.
-
- This may modify filelist in place. A typical application
- is checking that at least n files are given.
-
- If this method returns anything other than None, the
- process is terminated with the return value as exit code.
-
- """
- return None
-
- def help(self,note=''):
-
- self.print_header()
- if self.synopsis:
- print('Synopsis:')
- # To remain backward compatible:
- try:
- synopsis = self.synopsis % self.name
- except (NameError, KeyError, TypeError):
- synopsis = self.synopsis % self.__dict__
- print(' ' + synopsis)
- print()
- self.print_options()
- if self.version:
- print('Version:')
- print(' %s' % self.version)
- print()
- if self.about:
- about = self.about % self.__dict__
- print(about.strip())
- print()
- if note:
- print('-'*72)
- print('Note:',note)
- print()
-
- def notice(self,note):
-
- print('-'*72)
- print('Note:',note)
- print('-'*72)
- print()
-
- def print_header(self):
-
- print('-'*72)
- print(self.header % self.__dict__)
- print('-'*72)
- print()
-
- def print_options(self):
-
- options = self.options
- print('Options and default settings:')
- if not options:
- print(' None')
- return
- int = [x for x in options if x.prefix == '--']
- short = [x for x in options if x.prefix == '-']
- items = short + int
- for o in options:
- print(' ',o)
- print()
-
- #
- # Example handlers:
- #
- # If a handler returns anything other than None, processing stops
- # and the return value is passed to sys.exit() as argument.
- #
-
- # File handler
- def handle_files(self,files):
-
- """ This may process the files list in place.
- """
- return None
-
- # Short option handler
- def handle_h(self,arg):
-
- self.help()
- return 0
-
- def handle_v(self, value):
-
- """ Turn on verbose output.
- """
- self.verbose = 1
-
- # Handlers for long options have two underscores in their name
- def handle__help(self,arg):
-
- self.help()
- return 0
-
- def handle__debug(self,arg):
-
- self.debug = 1
- # We don't want to catch internal errors:
- class NoErrorToCatch(Exception): pass
- self.InternalError = NoErrorToCatch
-
- def handle__copyright(self,arg):
-
- self.print_header()
- copyright = self.copyright % self.__dict__
- print(copyright.strip())
- print()
- return 0
-
- def handle__examples(self,arg):
-
- self.print_header()
- if self.examples:
- print('Examples:')
- print()
- examples = self.examples % self.__dict__
- print(examples.strip())
- print()
- else:
- print('No examples available.')
- print()
- return 0
-
- def main(self):
-
- """ Override this method as program entry point.
-
- The return value is passed to sys.exit() as argument. If
- it is None, 0 is assumed (meaning OK). Unhandled
- exceptions are reported with exit status code 1 (see
- __init__ for further details).
-
- """
- return None
-
-# Alias
-CommandLine = Application
-
-def _test():
-
- class MyApplication(Application):
- header = 'Test Application'
- version = __version__
- options = [Option('-v','verbose')]
-
- def handle_v(self,arg):
- print('VERBOSE, Yeah !')
-
- cmd = MyApplication()
- if not cmd.values['-h']:
- cmd.help()
- print('files:',cmd.files)
- print('Bye...')
-
-if __name__ == '__main__':
- _test()
diff --git a/Tools/pybench/Constructs.py b/Tools/pybench/Constructs.py
deleted file mode 100644
index 7273b87192..0000000000
--- a/Tools/pybench/Constructs.py
+++ /dev/null
@@ -1,564 +0,0 @@
-from pybench import Test
-
-class IfThenElse(Test):
-
- version = 2.0
- operations = 30*3 # hard to say...
- rounds = 150000
-
- def test(self):
-
- a,b,c = 1,2,3
- for i in range(self.rounds):
-
- if a == 1:
- if b == 2:
- if c != 3:
- c = 3
- b = 3
- else:
- c = 2
- elif b == 3:
- b = 2
- a = 2
- elif a == 2:
- a = 3
- else:
- a = 1
-
- if a == 1:
- if b == 2:
- if c != 3:
- c = 3
- b = 3
- else:
- c = 2
- elif b == 3:
- b = 2
- a = 2
- elif a == 2:
- a = 3
- else:
- a = 1
-
- if a == 1:
- if b == 2:
- if c != 3:
- c = 3
- b = 3
- else:
- c = 2
- elif b == 3:
- b = 2
- a = 2
- elif a == 2:
- a = 3
- else:
- a = 1
-
- if a == 1:
- if b == 2:
- if c != 3:
- c = 3
- b = 3
- else:
- c = 2
- elif b == 3:
- b = 2
- a = 2
- elif a == 2:
- a = 3
- else:
- a = 1
-
- if a == 1:
- if b == 2:
- if c != 3:
- c = 3
- b = 3
- else:
- c = 2
- elif b == 3:
- b = 2
- a = 2
- elif a == 2:
- a = 3
- else:
- a = 1
-
- if a == 1:
- if b == 2:
- if c != 3:
- c = 3
- b = 3
- else:
- c = 2
- elif b == 3:
- b = 2
- a = 2
- elif a == 2:
- a = 3
- else:
- a = 1
-
- if a == 1:
- if b == 2:
- if c != 3:
- c = 3
- b = 3
- else:
- c = 2
- elif b == 3:
- b = 2
- a = 2
- elif a == 2:
- a = 3
- else:
- a = 1
-
- if a == 1:
- if b == 2:
- if c != 3:
- c = 3
- b = 3
- else:
- c = 2
- elif b == 3:
- b = 2
- a = 2
- elif a == 2:
- a = 3
- else:
- a = 1
-
- if a == 1:
- if b == 2:
- if c != 3:
- c = 3
- b = 3
- else:
- c = 2
- elif b == 3:
- b = 2
- a = 2
- elif a == 2:
- a = 3
- else:
- a = 1
-
- if a == 1:
- if b == 2:
- if c != 3:
- c = 3
- b = 3
- else:
- c = 2
- elif b == 3:
- b = 2
- a = 2
- elif a == 2:
- a = 3
- else:
- a = 1
-
- if a == 1:
- if b == 2:
- if c != 3:
- c = 3
- b = 3
- else:
- c = 2
- elif b == 3:
- b = 2
- a = 2
- elif a == 2:
- a = 3
- else:
- a = 1
-
- if a == 1:
- if b == 2:
- if c != 3:
- c = 3
- b = 3
- else:
- c = 2
- elif b == 3:
- b = 2
- a = 2
- elif a == 2:
- a = 3
- else:
- a = 1
-
- if a == 1:
- if b == 2:
- if c != 3:
- c = 3
- b = 3
- else:
- c = 2
- elif b == 3:
- b = 2
- a = 2
- elif a == 2:
- a = 3
- else:
- a = 1
-
- if a == 1:
- if b == 2:
- if c != 3:
- c = 3
- b = 3
- else:
- c = 2
- elif b == 3:
- b = 2
- a = 2
- elif a == 2:
- a = 3
- else:
- a = 1
-
- if a == 1:
- if b == 2:
- if c != 3:
- c = 3
- b = 3
- else:
- c = 2
- elif b == 3:
- b = 2
- a = 2
- elif a == 2:
- a = 3
- else:
- a = 1
-
- if a == 1:
- if b == 2:
- if c != 3:
- c = 3
- b = 3
- else:
- c = 2
- elif b == 3:
- b = 2
- a = 2
- elif a == 2:
- a = 3
- else:
- a = 1
-
- if a == 1:
- if b == 2:
- if c != 3:
- c = 3
- b = 3
- else:
- c = 2
- elif b == 3:
- b = 2
- a = 2
- elif a == 2:
- a = 3
- else:
- a = 1
-
- if a == 1:
- if b == 2:
- if c != 3:
- c = 3
- b = 3
- else:
- c = 2
- elif b == 3:
- b = 2
- a = 2
- elif a == 2:
- a = 3
- else:
- a = 1
-
- if a == 1:
- if b == 2:
- if c != 3:
- c = 3
- b = 3
- else:
- c = 2
- elif b == 3:
- b = 2
- a = 2
- elif a == 2:
- a = 3
- else:
- a = 1
-
- if a == 1:
- if b == 2:
- if c != 3:
- c = 3
- b = 3
- else:
- c = 2
- elif b == 3:
- b = 2
- a = 2
- elif a == 2:
- a = 3
- else:
- a = 1
-
- if a == 1:
- if b == 2:
- if c != 3:
- c = 3
- b = 3
- else:
- c = 2
- elif b == 3:
- b = 2
- a = 2
- elif a == 2:
- a = 3
- else:
- a = 1
-
- if a == 1:
- if b == 2:
- if c != 3:
- c = 3
- b = 3
- else:
- c = 2
- elif b == 3:
- b = 2
- a = 2
- elif a == 2:
- a = 3
- else:
- a = 1
-
- if a == 1:
- if b == 2:
- if c != 3:
- c = 3
- b = 3
- else:
- c = 2
- elif b == 3:
- b = 2
- a = 2
- elif a == 2:
- a = 3
- else:
- a = 1
-
- if a == 1:
- if b == 2:
- if c != 3:
- c = 3
- b = 3
- else:
- c = 2
- elif b == 3:
- b = 2
- a = 2
- elif a == 2:
- a = 3
- else:
- a = 1
-
- if a == 1:
- if b == 2:
- if c != 3:
- c = 3
- b = 3
- else:
- c = 2
- elif b == 3:
- b = 2
- a = 2
- elif a == 2:
- a = 3
- else:
- a = 1
-
- if a == 1:
- if b == 2:
- if c != 3:
- c = 3
- b = 3
- else:
- c = 2
- elif b == 3:
- b = 2
- a = 2
- elif a == 2:
- a = 3
- else:
- a = 1
-
- if a == 1:
- if b == 2:
- if c != 3:
- c = 3
- b = 3
- else:
- c = 2
- elif b == 3:
- b = 2
- a = 2
- elif a == 2:
- a = 3
- else:
- a = 1
-
- if a == 1:
- if b == 2:
- if c != 3:
- c = 3
- b = 3
- else:
- c = 2
- elif b == 3:
- b = 2
- a = 2
- elif a == 2:
- a = 3
- else:
- a = 1
-
- if a == 1:
- if b == 2:
- if c != 3:
- c = 3
- b = 3
- else:
- c = 2
- elif b == 3:
- b = 2
- a = 2
- elif a == 2:
- a = 3
- else:
- a = 1
-
- if a == 1:
- if b == 2:
- if c != 3:
- c = 3
- b = 3
- else:
- c = 2
- elif b == 3:
- b = 2
- a = 2
- elif a == 2:
- a = 3
- else:
- a = 1
-
- def calibrate(self):
-
- a,b,c = 1,2,3
- for i in range(self.rounds):
- pass
-
-class NestedForLoops(Test):
-
- version = 2.0
- operations = 1000*10*5
- rounds = 300
-
- def test(self):
-
- l1 = range(1000)
- l2 = range(10)
- l3 = range(5)
- for i in range(self.rounds):
- for i in l1:
- for j in l2:
- for k in l3:
- pass
-
- def calibrate(self):
-
- l1 = range(1000)
- l2 = range(10)
- l3 = range(5)
- for i in range(self.rounds):
- pass
-
-class ForLoops(Test):
-
- version = 2.0
- operations = 5 * 5
- rounds = 10000
-
- def test(self):
-
- l1 = range(100)
- for i in range(self.rounds):
- for i in l1:
- pass
- for i in l1:
- pass
- for i in l1:
- pass
- for i in l1:
- pass
- for i in l1:
- pass
-
- for i in l1:
- pass
- for i in l1:
- pass
- for i in l1:
- pass
- for i in l1:
- pass
- for i in l1:
- pass
-
- for i in l1:
- pass
- for i in l1:
- pass
- for i in l1:
- pass
- for i in l1:
- pass
- for i in l1:
- pass
-
- for i in l1:
- pass
- for i in l1:
- pass
- for i in l1:
- pass
- for i in l1:
- pass
- for i in l1:
- pass
-
- for i in l1:
- pass
- for i in l1:
- pass
- for i in l1:
- pass
- for i in l1:
- pass
- for i in l1:
- pass
-
- def calibrate(self):
-
- l1 = range(1000)
- for i in range(self.rounds):
- pass
diff --git a/Tools/pybench/Dict.py b/Tools/pybench/Dict.py
deleted file mode 100644
index 575758bfc2..0000000000
--- a/Tools/pybench/Dict.py
+++ /dev/null
@@ -1,504 +0,0 @@
-from pybench import Test
-
-class DictCreation(Test):
-
- version = 2.0
- operations = 5*(5 + 5)
- rounds = 80000
-
- def test(self):
-
- for i in range(self.rounds):
-
- d1 = {}
- d2 = {}
- d3 = {}
- d4 = {}
- d5 = {}
-
- d1 = {1:2,3:4,5:6}
- d2 = {2:3,4:5,6:7}
- d3 = {3:4,5:6,7:8}
- d4 = {4:5,6:7,8:9}
- d5 = {6:7,8:9,10:11}
-
- d1 = {}
- d2 = {}
- d3 = {}
- d4 = {}
- d5 = {}
-
- d1 = {1:2,3:4,5:6}
- d2 = {2:3,4:5,6:7}
- d3 = {3:4,5:6,7:8}
- d4 = {4:5,6:7,8:9}
- d5 = {6:7,8:9,10:11}
-
- d1 = {}
- d2 = {}
- d3 = {}
- d4 = {}
- d5 = {}
-
- d1 = {1:2,3:4,5:6}
- d2 = {2:3,4:5,6:7}
- d3 = {3:4,5:6,7:8}
- d4 = {4:5,6:7,8:9}
- d5 = {6:7,8:9,10:11}
-
- d1 = {}
- d2 = {}
- d3 = {}
- d4 = {}
- d5 = {}
-
- d1 = {1:2,3:4,5:6}
- d2 = {2:3,4:5,6:7}
- d3 = {3:4,5:6,7:8}
- d4 = {4:5,6:7,8:9}
- d5 = {6:7,8:9,10:11}
-
- d1 = {}
- d2 = {}
- d3 = {}
- d4 = {}
- d5 = {}
-
- d1 = {1:2,3:4,5:6}
- d2 = {2:3,4:5,6:7}
- d3 = {3:4,5:6,7:8}
- d4 = {4:5,6:7,8:9}
- d5 = {6:7,8:9,10:11}
-
- def calibrate(self):
-
- for i in range(self.rounds):
- pass
-
-class DictWithStringKeys(Test):
-
- version = 2.0
- operations = 5*(6 + 6)
- rounds = 200000
-
- def test(self):
-
- d = {}
-
- for i in range(self.rounds):
-
- d['abc'] = 1
- d['def'] = 2
- d['ghi'] = 3
- d['jkl'] = 4
- d['mno'] = 5
- d['pqr'] = 6
-
- d['abc']
- d['def']
- d['ghi']
- d['jkl']
- d['mno']
- d['pqr']
-
- d['abc'] = 1
- d['def'] = 2
- d['ghi'] = 3
- d['jkl'] = 4
- d['mno'] = 5
- d['pqr'] = 6
-
- d['abc']
- d['def']
- d['ghi']
- d['jkl']
- d['mno']
- d['pqr']
-
- d['abc'] = 1
- d['def'] = 2
- d['ghi'] = 3
- d['jkl'] = 4
- d['mno'] = 5
- d['pqr'] = 6
-
- d['abc']
- d['def']
- d['ghi']
- d['jkl']
- d['mno']
- d['pqr']
-
- d['abc'] = 1
- d['def'] = 2
- d['ghi'] = 3
- d['jkl'] = 4
- d['mno'] = 5
- d['pqr'] = 6
-
- d['abc']
- d['def']
- d['ghi']
- d['jkl']
- d['mno']
- d['pqr']
-
- d['abc'] = 1
- d['def'] = 2
- d['ghi'] = 3
- d['jkl'] = 4
- d['mno'] = 5
- d['pqr'] = 6
-
- d['abc']
- d['def']
- d['ghi']
- d['jkl']
- d['mno']
- d['pqr']
-
- def calibrate(self):
-
- d = {}
-
- for i in range(self.rounds):
- pass
-
-class DictWithFloatKeys(Test):
-
- version = 2.0
- operations = 5*(6 + 6)
- rounds = 150000
-
- def test(self):
-
- d = {}
-
- for i in range(self.rounds):
-
- d[1.234] = 1
- d[2.345] = 2
- d[3.456] = 3
- d[4.567] = 4
- d[5.678] = 5
- d[6.789] = 6
-
- d[1.234]
- d[2.345]
- d[3.456]
- d[4.567]
- d[5.678]
- d[6.789]
-
- d[1.234] = 1
- d[2.345] = 2
- d[3.456] = 3
- d[4.567] = 4
- d[5.678] = 5
- d[6.789] = 6
-
- d[1.234]
- d[2.345]
- d[3.456]
- d[4.567]
- d[5.678]
- d[6.789]
-
- d[1.234] = 1
- d[2.345] = 2
- d[3.456] = 3
- d[4.567] = 4
- d[5.678] = 5
- d[6.789] = 6
-
- d[1.234]
- d[2.345]
- d[3.456]
- d[4.567]
- d[5.678]
- d[6.789]
-
- d[1.234] = 1
- d[2.345] = 2
- d[3.456] = 3
- d[4.567] = 4
- d[5.678] = 5
- d[6.789] = 6
-
- d[1.234]
- d[2.345]
- d[3.456]
- d[4.567]
- d[5.678]
- d[6.789]
-
- d[1.234] = 1
- d[2.345] = 2
- d[3.456] = 3
- d[4.567] = 4
- d[5.678] = 5
- d[6.789] = 6
-
- d[1.234]
- d[2.345]
- d[3.456]
- d[4.567]
- d[5.678]
- d[6.789]
-
- def calibrate(self):
-
- d = {}
-
- for i in range(self.rounds):
- pass
-
-class DictWithIntegerKeys(Test):
-
- version = 2.0
- operations = 5*(6 + 6)
- rounds = 200000
-
- def test(self):
-
- d = {}
-
- for i in range(self.rounds):
-
- d[1] = 1
- d[2] = 2
- d[3] = 3
- d[4] = 4
- d[5] = 5
- d[6] = 6
-
- d[1]
- d[2]
- d[3]
- d[4]
- d[5]
- d[6]
-
- d[1] = 1
- d[2] = 2
- d[3] = 3
- d[4] = 4
- d[5] = 5
- d[6] = 6
-
- d[1]
- d[2]
- d[3]
- d[4]
- d[5]
- d[6]
-
- d[1] = 1
- d[2] = 2
- d[3] = 3
- d[4] = 4
- d[5] = 5
- d[6] = 6
-
- d[1]
- d[2]
- d[3]
- d[4]
- d[5]
- d[6]
-
- d[1] = 1
- d[2] = 2
- d[3] = 3
- d[4] = 4
- d[5] = 5
- d[6] = 6
-
- d[1]
- d[2]
- d[3]
- d[4]
- d[5]
- d[6]
-
- d[1] = 1
- d[2] = 2
- d[3] = 3
- d[4] = 4
- d[5] = 5
- d[6] = 6
-
- d[1]
- d[2]
- d[3]
- d[4]
- d[5]
- d[6]
-
- def calibrate(self):
-
- d = {}
-
- for i in range(self.rounds):
- pass
-
-class SimpleDictManipulation(Test):
-
- version = 2.0
- operations = 5*(6 + 6 + 6 + 6)
- rounds = 100000
-
- def test(self):
-
- d = {}
- has_key = lambda key: key in d
-
- for i in range(self.rounds):
-
- d[0] = 3
- d[1] = 4
- d[2] = 5
- d[3] = 3
- d[4] = 4
- d[5] = 5
-
- x = d[0]
- x = d[1]
- x = d[2]
- x = d[3]
- x = d[4]
- x = d[5]
-
- has_key(0)
- has_key(2)
- has_key(4)
- has_key(6)
- has_key(8)
- has_key(10)
-
- del d[0]
- del d[1]
- del d[2]
- del d[3]
- del d[4]
- del d[5]
-
- d[0] = 3
- d[1] = 4
- d[2] = 5
- d[3] = 3
- d[4] = 4
- d[5] = 5
-
- x = d[0]
- x = d[1]
- x = d[2]
- x = d[3]
- x = d[4]
- x = d[5]
-
- has_key(0)
- has_key(2)
- has_key(4)
- has_key(6)
- has_key(8)
- has_key(10)
-
- del d[0]
- del d[1]
- del d[2]
- del d[3]
- del d[4]
- del d[5]
-
- d[0] = 3
- d[1] = 4
- d[2] = 5
- d[3] = 3
- d[4] = 4
- d[5] = 5
-
- x = d[0]
- x = d[1]
- x = d[2]
- x = d[3]
- x = d[4]
- x = d[5]
-
- has_key(0)
- has_key(2)
- has_key(4)
- has_key(6)
- has_key(8)
- has_key(10)
-
- del d[0]
- del d[1]
- del d[2]
- del d[3]
- del d[4]
- del d[5]
-
- d[0] = 3
- d[1] = 4
- d[2] = 5
- d[3] = 3
- d[4] = 4
- d[5] = 5
-
- x = d[0]
- x = d[1]
- x = d[2]
- x = d[3]
- x = d[4]
- x = d[5]
-
- has_key(0)
- has_key(2)
- has_key(4)
- has_key(6)
- has_key(8)
- has_key(10)
-
- del d[0]
- del d[1]
- del d[2]
- del d[3]
- del d[4]
- del d[5]
-
- d[0] = 3
- d[1] = 4
- d[2] = 5
- d[3] = 3
- d[4] = 4
- d[5] = 5
-
- x = d[0]
- x = d[1]
- x = d[2]
- x = d[3]
- x = d[4]
- x = d[5]
-
- has_key(0)
- has_key(2)
- has_key(4)
- has_key(6)
- has_key(8)
- has_key(10)
-
- del d[0]
- del d[1]
- del d[2]
- del d[3]
- del d[4]
- del d[5]
-
- def calibrate(self):
-
- d = {}
- has_key = lambda key: key in d
-
- for i in range(self.rounds):
- pass
diff --git a/Tools/pybench/Exceptions.py b/Tools/pybench/Exceptions.py
deleted file mode 100644
index c321b2ef47..0000000000
--- a/Tools/pybench/Exceptions.py
+++ /dev/null
@@ -1,699 +0,0 @@
-from pybench import Test
-
-class TryRaiseExcept(Test):
-
- version = 2.0
- operations = 2 + 3 + 3
- rounds = 80000
-
- def test(self):
-
- error = ValueError
-
- for i in range(self.rounds):
- try:
- raise error
- except:
- pass
- try:
- raise error
- except:
- pass
- try:
- raise error("something")
- except:
- pass
- try:
- raise error("something")
- except:
- pass
- try:
- raise error("something")
- except:
- pass
- try:
- raise error("something")
- except:
- pass
- try:
- raise error("something")
- except:
- pass
- try:
- raise error("something")
- except:
- pass
-
- def calibrate(self):
-
- error = ValueError
-
- for i in range(self.rounds):
- pass
-
-
-class TryExcept(Test):
-
- version = 2.0
- operations = 15 * 10
- rounds = 150000
-
- def test(self):
-
- for i in range(self.rounds):
- try:
- pass
- except:
- pass
- try:
- pass
- except:
- pass
- try:
- pass
- except:
- pass
- try:
- pass
- except:
- pass
- try:
- pass
- except:
- pass
- try:
- pass
- except:
- pass
- try:
- pass
- except:
- pass
- try:
- pass
- except:
- pass
- try:
- pass
- except:
- pass
- try:
- pass
- except:
- pass
-
- try:
- pass
- except:
- pass
- try:
- pass
- except:
- pass
- try:
- pass
- except:
- pass
- try:
- pass
- except:
- pass
- try:
- pass
- except:
- pass
- try:
- pass
- except:
- pass
- try:
- pass
- except:
- pass
- try:
- pass
- except:
- pass
- try:
- pass
- except:
- pass
- try:
- pass
- except:
- pass
-
-
- try:
- pass
- except:
- pass
- try:
- pass
- except:
- pass
- try:
- pass
- except:
- pass
- try:
- pass
- except:
- pass
- try:
- pass
- except:
- pass
- try:
- pass
- except:
- pass
- try:
- pass
- except:
- pass
- try:
- pass
- except:
- pass
- try:
- pass
- except:
- pass
- try:
- pass
- except:
- pass
-
-
- try:
- pass
- except:
- pass
- try:
- pass
- except:
- pass
- try:
- pass
- except:
- pass
- try:
- pass
- except:
- pass
- try:
- pass
- except:
- pass
- try:
- pass
- except:
- pass
- try:
- pass
- except:
- pass
- try:
- pass
- except:
- pass
- try:
- pass
- except:
- pass
- try:
- pass
- except:
- pass
-
-
- try:
- pass
- except:
- pass
- try:
- pass
- except:
- pass
- try:
- pass
- except:
- pass
- try:
- pass
- except:
- pass
- try:
- pass
- except:
- pass
- try:
- pass
- except:
- pass
- try:
- pass
- except:
- pass
- try:
- pass
- except:
- pass
- try:
- pass
- except:
- pass
- try:
- pass
- except:
- pass
-
- try:
- pass
- except:
- pass
- try:
- pass
- except:
- pass
- try:
- pass
- except:
- pass
- try:
- pass
- except:
- pass
- try:
- pass
- except:
- pass
- try:
- pass
- except:
- pass
- try:
- pass
- except:
- pass
- try:
- pass
- except:
- pass
- try:
- pass
- except:
- pass
- try:
- pass
- except:
- pass
-
- try:
- pass
- except:
- pass
- try:
- pass
- except:
- pass
- try:
- pass
- except:
- pass
- try:
- pass
- except:
- pass
- try:
- pass
- except:
- pass
- try:
- pass
- except:
- pass
- try:
- pass
- except:
- pass
- try:
- pass
- except:
- pass
- try:
- pass
- except:
- pass
- try:
- pass
- except:
- pass
-
-
- try:
- pass
- except:
- pass
- try:
- pass
- except:
- pass
- try:
- pass
- except:
- pass
- try:
- pass
- except:
- pass
- try:
- pass
- except:
- pass
- try:
- pass
- except:
- pass
- try:
- pass
- except:
- pass
- try:
- pass
- except:
- pass
- try:
- pass
- except:
- pass
- try:
- pass
- except:
- pass
-
-
- try:
- pass
- except:
- pass
- try:
- pass
- except:
- pass
- try:
- pass
- except:
- pass
- try:
- pass
- except:
- pass
- try:
- pass
- except:
- pass
- try:
- pass
- except:
- pass
- try:
- pass
- except:
- pass
- try:
- pass
- except:
- pass
- try:
- pass
- except:
- pass
- try:
- pass
- except:
- pass
-
-
- try:
- pass
- except:
- pass
- try:
- pass
- except:
- pass
- try:
- pass
- except:
- pass
- try:
- pass
- except:
- pass
- try:
- pass
- except:
- pass
- try:
- pass
- except:
- pass
- try:
- pass
- except:
- pass
- try:
- pass
- except:
- pass
- try:
- pass
- except:
- pass
- try:
- pass
- except:
- pass
-
- try:
- pass
- except:
- pass
- try:
- pass
- except:
- pass
- try:
- pass
- except:
- pass
- try:
- pass
- except:
- pass
- try:
- pass
- except:
- pass
- try:
- pass
- except:
- pass
- try:
- pass
- except:
- pass
- try:
- pass
- except:
- pass
- try:
- pass
- except:
- pass
- try:
- pass
- except:
- pass
-
- try:
- pass
- except:
- pass
- try:
- pass
- except:
- pass
- try:
- pass
- except:
- pass
- try:
- pass
- except:
- pass
- try:
- pass
- except:
- pass
- try:
- pass
- except:
- pass
- try:
- pass
- except:
- pass
- try:
- pass
- except:
- pass
- try:
- pass
- except:
- pass
- try:
- pass
- except:
- pass
-
-
- try:
- pass
- except:
- pass
- try:
- pass
- except:
- pass
- try:
- pass
- except:
- pass
- try:
- pass
- except:
- pass
- try:
- pass
- except:
- pass
- try:
- pass
- except:
- pass
- try:
- pass
- except:
- pass
- try:
- pass
- except:
- pass
- try:
- pass
- except:
- pass
- try:
- pass
- except:
- pass
-
-
- try:
- pass
- except:
- pass
- try:
- pass
- except:
- pass
- try:
- pass
- except:
- pass
- try:
- pass
- except:
- pass
- try:
- pass
- except:
- pass
- try:
- pass
- except:
- pass
- try:
- pass
- except:
- pass
- try:
- pass
- except:
- pass
- try:
- pass
- except:
- pass
- try:
- pass
- except:
- pass
-
-
- try:
- pass
- except:
- pass
- try:
- pass
- except:
- pass
- try:
- pass
- except:
- pass
- try:
- pass
- except:
- pass
- try:
- pass
- except:
- pass
- try:
- pass
- except:
- pass
- try:
- pass
- except:
- pass
- try:
- pass
- except:
- pass
- try:
- pass
- except:
- pass
- try:
- pass
- except:
- pass
-
- def calibrate(self):
-
- for i in range(self.rounds):
- pass
-
-### Test to make Fredrik happy...
-
-if __name__ == '__main__':
- import timeit
- timeit.TestClass = TryRaiseExcept
- timeit.main(['-s', 'test = TestClass(); test.rounds = 1000',
- 'test.test()'])
diff --git a/Tools/pybench/Imports.py b/Tools/pybench/Imports.py
deleted file mode 100644
index 399ba17f2a..0000000000
--- a/Tools/pybench/Imports.py
+++ /dev/null
@@ -1,138 +0,0 @@
-from pybench import Test
-
-# First imports:
-import os
-import package.submodule
-
-class SecondImport(Test):
-
- version = 2.0
- operations = 5 * 5
- rounds = 40000
-
- def test(self):
-
- for i in range(self.rounds):
- import os
- import os
- import os
- import os
- import os
-
- import os
- import os
- import os
- import os
- import os
-
- import os
- import os
- import os
- import os
- import os
-
- import os
- import os
- import os
- import os
- import os
-
- import os
- import os
- import os
- import os
- import os
-
- def calibrate(self):
-
- for i in range(self.rounds):
- pass
-
-
-class SecondPackageImport(Test):
-
- version = 2.0
- operations = 5 * 5
- rounds = 40000
-
- def test(self):
-
- for i in range(self.rounds):
- import package
- import package
- import package
- import package
- import package
-
- import package
- import package
- import package
- import package
- import package
-
- import package
- import package
- import package
- import package
- import package
-
- import package
- import package
- import package
- import package
- import package
-
- import package
- import package
- import package
- import package
- import package
-
- def calibrate(self):
-
- for i in range(self.rounds):
- pass
-
-class SecondSubmoduleImport(Test):
-
- version = 2.0
- operations = 5 * 5
- rounds = 40000
-
- def test(self):
-
- for i in range(self.rounds):
- import package.submodule
- import package.submodule
- import package.submodule
- import package.submodule
- import package.submodule
-
- import package.submodule
- import package.submodule
- import package.submodule
- import package.submodule
- import package.submodule
-
- import package.submodule
- import package.submodule
- import package.submodule
- import package.submodule
- import package.submodule
-
- import package.submodule
- import package.submodule
- import package.submodule
- import package.submodule
- import package.submodule
-
- import package.submodule
- import package.submodule
- import package.submodule
- import package.submodule
- import package.submodule
-
- def calibrate(self):
-
- for i in range(self.rounds):
- pass
diff --git a/Tools/pybench/Instances.py b/Tools/pybench/Instances.py
deleted file mode 100644
index 0a09b7bd76..0000000000
--- a/Tools/pybench/Instances.py
+++ /dev/null
@@ -1,66 +0,0 @@
-from pybench import Test
-
-class CreateInstances(Test):
-
- version = 2.0
- operations = 3 + 7 + 4
- rounds = 80000
-
- def test(self):
-
- class c:
- pass
-
- class d:
- def __init__(self,a,b,c):
- self.a = a
- self.b = b
- self.c = c
-
- class e:
- def __init__(self,a,b,c=4):
- self.a = a
- self.b = b
- self.c = c
- self.d = a
- self.e = b
- self.f = c
-
- for i in range(self.rounds):
- o = c()
- o1 = c()
- o2 = c()
- p = d(i,i,3)
- p1 = d(i,i,3)
- p2 = d(i,3,3)
- p3 = d(3,i,3)
- p4 = d(i,i,i)
- p5 = d(3,i,3)
- p6 = d(i,i,i)
- q = e(i,i,3)
- q1 = e(i,i,3)
- q2 = e(i,i,3)
- q3 = e(i,i)
-
- def calibrate(self):
-
- class c:
- pass
-
- class d:
- def __init__(self,a,b,c):
- self.a = a
- self.b = b
- self.c = c
-
- class e:
- def __init__(self,a,b,c=4):
- self.a = a
- self.b = b
- self.c = c
- self.d = a
- self.e = b
- self.f = c
-
- for i in range(self.rounds):
- pass
diff --git a/Tools/pybench/LICENSE b/Tools/pybench/LICENSE
deleted file mode 100644
index 17c6a6bdfc..0000000000
--- a/Tools/pybench/LICENSE
+++ /dev/null
@@ -1,25 +0,0 @@
-pybench License
----------------
-
-This copyright notice and license applies to all files in the pybench
-directory of the pybench distribution.
-
-Copyright (c), 1997-2006, Marc-Andre Lemburg (mal@lemburg.com)
-Copyright (c), 2000-2006, eGenix.com Software GmbH (info@egenix.com)
-
- All Rights Reserved.
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee or royalty is hereby
-granted, provided that the above copyright notice appear in all copies
-and that both that copyright notice and this permission notice appear
-in supporting documentation or portions thereof, including
-modifications, that you make.
-
-THE AUTHOR MARC-ANDRE LEMBURG DISCLAIMS ALL WARRANTIES WITH REGARD TO
-THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
-FITNESS, IN NO EVENT SHALL THE AUTHOR 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 !
diff --git a/Tools/pybench/Lists.py b/Tools/pybench/Lists.py
deleted file mode 100644
index 29dabeff5b..0000000000
--- a/Tools/pybench/Lists.py
+++ /dev/null
@@ -1,350 +0,0 @@
-from pybench import Test
-
-class SimpleListManipulation(Test):
-
- version = 2.0
- operations = 5* (6 + 6 + 6)
- rounds = 130000
-
- def test(self):
-
- l = []
- append = l.append
-
- for i in range(self.rounds):
-
- append(2)
- append(3)
- append(4)
- append(2)
- append(3)
- append(4)
-
- l[0] = 3
- l[1] = 4
- l[2] = 5
- l[3] = 3
- l[4] = 4
- l[5] = 5
-
- x = l[0]
- x = l[1]
- x = l[2]
- x = l[3]
- x = l[4]
- x = l[5]
-
- append(2)
- append(3)
- append(4)
- append(2)
- append(3)
- append(4)
-
- l[0] = 3
- l[1] = 4
- l[2] = 5
- l[3] = 3
- l[4] = 4
- l[5] = 5
-
- x = l[0]
- x = l[1]
- x = l[2]
- x = l[3]
- x = l[4]
- x = l[5]
-
- append(2)
- append(3)
- append(4)
- append(2)
- append(3)
- append(4)
-
- l[0] = 3
- l[1] = 4
- l[2] = 5
- l[3] = 3
- l[4] = 4
- l[5] = 5
-
- x = l[0]
- x = l[1]
- x = l[2]
- x = l[3]
- x = l[4]
- x = l[5]
-
- append(2)
- append(3)
- append(4)
- append(2)
- append(3)
- append(4)
-
- l[0] = 3
- l[1] = 4
- l[2] = 5
- l[3] = 3
- l[4] = 4
- l[5] = 5
-
- x = l[0]
- x = l[1]
- x = l[2]
- x = l[3]
- x = l[4]
- x = l[5]
-
- append(2)
- append(3)
- append(4)
- append(2)
- append(3)
- append(4)
-
- l[0] = 3
- l[1] = 4
- l[2] = 5
- l[3] = 3
- l[4] = 4
- l[5] = 5
-
- x = l[0]
- x = l[1]
- x = l[2]
- x = l[3]
- x = l[4]
- x = l[5]
-
- if len(l) > 10000:
- # cut down the size
- del l[:]
-
- def calibrate(self):
-
- l = []
- append = l.append
-
- for i in range(self.rounds):
- pass
-
-class ListSlicing(Test):
-
- version = 2.0
- operations = 25*(3+1+2+1)
- rounds = 800
-
- def test(self):
-
- n = list(range(100))
- r = list(range(25))
-
- for i in range(self.rounds):
-
- l = n[:]
-
- for j in r:
-
- m = l[50:]
- m = l[:25]
- m = l[50:55]
- l[:3] = n
- m = l[:-1]
- m = l[1:]
- l[-1:] = n
-
- def calibrate(self):
-
- n = list(range(100))
- r = list(range(25))
-
- for i in range(self.rounds):
- for j in r:
- pass
-
-class SmallLists(Test):
-
- version = 2.0
- operations = 5*(1+ 6 + 6 + 3 + 1)
- rounds = 80000
-
- def test(self):
-
- for i in range(self.rounds):
-
- l = []
-
- append = l.append
- append(2)
- append(3)
- append(4)
- append(2)
- append(3)
- append(4)
-
- l[0] = 3
- l[1] = 4
- l[2] = 5
- l[3] = 3
- l[4] = 4
- l[5] = 5
-
- l[:3] = [1,2,3]
- m = l[:-1]
- m = l[1:]
-
- l[-1:] = [4,5,6]
-
- l = []
-
- append = l.append
- append(2)
- append(3)
- append(4)
- append(2)
- append(3)
- append(4)
-
- l[0] = 3
- l[1] = 4
- l[2] = 5
- l[3] = 3
- l[4] = 4
- l[5] = 5
-
- l[:3] = [1,2,3]
- m = l[:-1]
- m = l[1:]
-
- l[-1:] = [4,5,6]
-
- l = []
-
- append = l.append
- append(2)
- append(3)
- append(4)
- append(2)
- append(3)
- append(4)
-
- l[0] = 3
- l[1] = 4
- l[2] = 5
- l[3] = 3
- l[4] = 4
- l[5] = 5
-
- l[:3] = [1,2,3]
- m = l[:-1]
- m = l[1:]
-
- l[-1:] = [4,5,6]
-
- l = []
-
- append = l.append
- append(2)
- append(3)
- append(4)
- append(2)
- append(3)
- append(4)
-
- l[0] = 3
- l[1] = 4
- l[2] = 5
- l[3] = 3
- l[4] = 4
- l[5] = 5
-
- l[:3] = [1,2,3]
- m = l[:-1]
- m = l[1:]
-
- l[-1:] = [4,5,6]
-
- l = []
-
- append = l.append
- append(2)
- append(3)
- append(4)
- append(2)
- append(3)
- append(4)
-
- l[0] = 3
- l[1] = 4
- l[2] = 5
- l[3] = 3
- l[4] = 4
- l[5] = 5
-
- l[:3] = [1,2,3]
- m = l[:-1]
- m = l[1:]
-
- l[-1:] = [4,5,6]
-
- def calibrate(self):
-
- for i in range(self.rounds):
- pass
-
-class SimpleListComprehensions(Test):
-
- version = 2.0
- operations = 6
- rounds = 20000
-
- def test(self):
-
- n = list(range(10)) * 10
-
- for i in range(self.rounds):
- l = [x for x in n]
- l = [x for x in n if x]
- l = [x for x in n if not x]
-
- l = [x for x in n]
- l = [x for x in n if x]
- l = [x for x in n if not x]
-
- def calibrate(self):
-
- n = list(range(10)) * 10
-
- for i in range(self.rounds):
- pass
-
-class NestedListComprehensions(Test):
-
- version = 2.0
- operations = 6
- rounds = 20000
-
- def test(self):
-
- m = list(range(10))
- n = list(range(10))
-
- for i in range(self.rounds):
- l = [x for x in n for y in m]
- l = [y for x in n for y in m]
-
- l = [x for x in n for y in m if y]
- l = [y for x in n for y in m if x]
-
- l = [x for x in n for y in m if not y]
- l = [y for x in n for y in m if not x]
-
- def calibrate(self):
-
- m = list(range(10))
- n = list(range(10))
-
- for i in range(self.rounds):
- pass
diff --git a/Tools/pybench/Lookups.py b/Tools/pybench/Lookups.py
deleted file mode 100644
index 5bf9e7622d..0000000000
--- a/Tools/pybench/Lookups.py
+++ /dev/null
@@ -1,945 +0,0 @@
-from pybench import Test
-
-class SpecialClassAttribute(Test):
-
- version = 2.0
- operations = 5*(12 + 12)
- rounds = 100000
-
- def test(self):
-
- class c:
- pass
-
- for i in range(self.rounds):
-
- c.__a = 2
- c.__b = 3
- c.__c = 4
-
- c.__a = 2
- c.__b = 3
- c.__c = 4
-
- c.__a = 2
- c.__b = 3
- c.__c = 4
-
- c.__a = 2
- c.__b = 3
- c.__c = 4
-
- x = c.__a
- x = c.__b
- x = c.__c
-
- x = c.__a
- x = c.__b
- x = c.__c
-
- x = c.__a
- x = c.__b
- x = c.__c
-
- x = c.__a
- x = c.__b
- x = c.__c
-
- c.__a = 2
- c.__b = 3
- c.__c = 4
-
- c.__a = 2
- c.__b = 3
- c.__c = 4
-
- c.__a = 2
- c.__b = 3
- c.__c = 4
-
- c.__a = 2
- c.__b = 3
- c.__c = 4
-
- x = c.__a
- x = c.__b
- x = c.__c
-
- x = c.__a
- x = c.__b
- x = c.__c
-
- x = c.__a
- x = c.__b
- x = c.__c
-
- x = c.__a
- x = c.__b
- x = c.__c
-
- c.__a = 2
- c.__b = 3
- c.__c = 4
-
- c.__a = 2
- c.__b = 3
- c.__c = 4
-
- c.__a = 2
- c.__b = 3
- c.__c = 4
-
- c.__a = 2
- c.__b = 3
- c.__c = 4
-
- x = c.__a
- x = c.__b
- x = c.__c
-
- x = c.__a
- x = c.__b
- x = c.__c
-
- x = c.__a
- x = c.__b
- x = c.__c
-
- x = c.__a
- x = c.__b
- x = c.__c
-
- c.__a = 2
- c.__b = 3
- c.__c = 4
-
- c.__a = 2
- c.__b = 3
- c.__c = 4
-
- c.__a = 2
- c.__b = 3
- c.__c = 4
-
- c.__a = 2
- c.__b = 3
- c.__c = 4
-
- x = c.__a
- x = c.__b
- x = c.__c
-
- x = c.__a
- x = c.__b
- x = c.__c
-
- x = c.__a
- x = c.__b
- x = c.__c
-
- x = c.__a
- x = c.__b
- x = c.__c
-
- c.__a = 2
- c.__b = 3
- c.__c = 4
-
- c.__a = 2
- c.__b = 3
- c.__c = 4
-
- c.__a = 2
- c.__b = 3
- c.__c = 4
-
- c.__a = 2
- c.__b = 3
- c.__c = 4
-
- x = c.__a
- x = c.__b
- x = c.__c
-
- x = c.__a
- x = c.__b
- x = c.__c
-
- x = c.__a
- x = c.__b
- x = c.__c
-
- x = c.__a
- x = c.__b
- x = c.__c
-
- def calibrate(self):
-
- class c:
- pass
-
- for i in range(self.rounds):
- pass
-
-class NormalClassAttribute(Test):
-
- version = 2.0
- operations = 5*(12 + 12)
- rounds = 100000
-
- def test(self):
-
- class c:
- pass
-
- for i in range(self.rounds):
-
- c.a = 2
- c.b = 3
- c.c = 4
-
- c.a = 2
- c.b = 3
- c.c = 4
-
- c.a = 2
- c.b = 3
- c.c = 4
-
- c.a = 2
- c.b = 3
- c.c = 4
-
-
- x = c.a
- x = c.b
- x = c.c
-
- x = c.a
- x = c.b
- x = c.c
-
- x = c.a
- x = c.b
- x = c.c
-
- x = c.a
- x = c.b
- x = c.c
-
- c.a = 2
- c.b = 3
- c.c = 4
-
- c.a = 2
- c.b = 3
- c.c = 4
-
- c.a = 2
- c.b = 3
- c.c = 4
-
- c.a = 2
- c.b = 3
- c.c = 4
-
-
- x = c.a
- x = c.b
- x = c.c
-
- x = c.a
- x = c.b
- x = c.c
-
- x = c.a
- x = c.b
- x = c.c
-
- x = c.a
- x = c.b
- x = c.c
-
- c.a = 2
- c.b = 3
- c.c = 4
-
- c.a = 2
- c.b = 3
- c.c = 4
-
- c.a = 2
- c.b = 3
- c.c = 4
-
- c.a = 2
- c.b = 3
- c.c = 4
-
-
- x = c.a
- x = c.b
- x = c.c
-
- x = c.a
- x = c.b
- x = c.c
-
- x = c.a
- x = c.b
- x = c.c
-
- x = c.a
- x = c.b
- x = c.c
-
- c.a = 2
- c.b = 3
- c.c = 4
-
- c.a = 2
- c.b = 3
- c.c = 4
-
- c.a = 2
- c.b = 3
- c.c = 4
-
- c.a = 2
- c.b = 3
- c.c = 4
-
-
- x = c.a
- x = c.b
- x = c.c
-
- x = c.a
- x = c.b
- x = c.c
-
- x = c.a
- x = c.b
- x = c.c
-
- x = c.a
- x = c.b
- x = c.c
-
- c.a = 2
- c.b = 3
- c.c = 4
-
- c.a = 2
- c.b = 3
- c.c = 4
-
- c.a = 2
- c.b = 3
- c.c = 4
-
- c.a = 2
- c.b = 3
- c.c = 4
-
-
- x = c.a
- x = c.b
- x = c.c
-
- x = c.a
- x = c.b
- x = c.c
-
- x = c.a
- x = c.b
- x = c.c
-
- x = c.a
- x = c.b
- x = c.c
-
- def calibrate(self):
-
- class c:
- pass
-
- for i in range(self.rounds):
- pass
-
-class SpecialInstanceAttribute(Test):
-
- version = 2.0
- operations = 5*(12 + 12)
- rounds = 100000
-
- def test(self):
-
- class c:
- pass
- o = c()
-
- for i in range(self.rounds):
-
- o.__a__ = 2
- o.__b__ = 3
- o.__c__ = 4
-
- o.__a__ = 2
- o.__b__ = 3
- o.__c__ = 4
-
- o.__a__ = 2
- o.__b__ = 3
- o.__c__ = 4
-
- o.__a__ = 2
- o.__b__ = 3
- o.__c__ = 4
-
-
- x = o.__a__
- x = o.__b__
- x = o.__c__
-
- x = o.__a__
- x = o.__b__
- x = o.__c__
-
- x = o.__a__
- x = o.__b__
- x = o.__c__
-
- x = o.__a__
- x = o.__b__
- x = o.__c__
-
- o.__a__ = 2
- o.__b__ = 3
- o.__c__ = 4
-
- o.__a__ = 2
- o.__b__ = 3
- o.__c__ = 4
-
- o.__a__ = 2
- o.__b__ = 3
- o.__c__ = 4
-
- o.__a__ = 2
- o.__b__ = 3
- o.__c__ = 4
-
-
- x = o.__a__
- x = o.__b__
- x = o.__c__
-
- x = o.__a__
- x = o.__b__
- x = o.__c__
-
- x = o.__a__
- x = o.__b__
- x = o.__c__
-
- x = o.__a__
- x = o.__b__
- x = o.__c__
-
- o.__a__ = 2
- o.__b__ = 3
- o.__c__ = 4
-
- o.__a__ = 2
- o.__b__ = 3
- o.__c__ = 4
-
- o.__a__ = 2
- o.__b__ = 3
- o.__c__ = 4
-
- o.__a__ = 2
- o.__b__ = 3
- o.__c__ = 4
-
-
- x = o.__a__
- x = o.__b__
- x = o.__c__
-
- x = o.__a__
- x = o.__b__
- x = o.__c__
-
- x = o.__a__
- x = o.__b__
- x = o.__c__
-
- x = o.__a__
- x = o.__b__
- x = o.__c__
-
- o.__a__ = 2
- o.__b__ = 3
- o.__c__ = 4
-
- o.__a__ = 2
- o.__b__ = 3
- o.__c__ = 4
-
- o.__a__ = 2
- o.__b__ = 3
- o.__c__ = 4
-
- o.__a__ = 2
- o.__b__ = 3
- o.__c__ = 4
-
-
- x = o.__a__
- x = o.__b__
- x = o.__c__
-
- x = o.__a__
- x = o.__b__
- x = o.__c__
-
- x = o.__a__
- x = o.__b__
- x = o.__c__
-
- x = o.__a__
- x = o.__b__
- x = o.__c__
-
- o.__a__ = 2
- o.__b__ = 3
- o.__c__ = 4
-
- o.__a__ = 2
- o.__b__ = 3
- o.__c__ = 4
-
- o.__a__ = 2
- o.__b__ = 3
- o.__c__ = 4
-
- o.__a__ = 2
- o.__b__ = 3
- o.__c__ = 4
-
-
- x = o.__a__
- x = o.__b__
- x = o.__c__
-
- x = o.__a__
- x = o.__b__
- x = o.__c__
-
- x = o.__a__
- x = o.__b__
- x = o.__c__
-
- x = o.__a__
- x = o.__b__
- x = o.__c__
-
- def calibrate(self):
-
- class c:
- pass
- o = c()
-
- for i in range(self.rounds):
- pass
-
-class NormalInstanceAttribute(Test):
-
- version = 2.0
- operations = 5*(12 + 12)
- rounds = 100000
-
- def test(self):
-
- class c:
- pass
- o = c()
-
- for i in range(self.rounds):
-
- o.a = 2
- o.b = 3
- o.c = 4
-
- o.a = 2
- o.b = 3
- o.c = 4
-
- o.a = 2
- o.b = 3
- o.c = 4
-
- o.a = 2
- o.b = 3
- o.c = 4
-
-
- x = o.a
- x = o.b
- x = o.c
-
- x = o.a
- x = o.b
- x = o.c
-
- x = o.a
- x = o.b
- x = o.c
-
- x = o.a
- x = o.b
- x = o.c
-
- o.a = 2
- o.b = 3
- o.c = 4
-
- o.a = 2
- o.b = 3
- o.c = 4
-
- o.a = 2
- o.b = 3
- o.c = 4
-
- o.a = 2
- o.b = 3
- o.c = 4
-
-
- x = o.a
- x = o.b
- x = o.c
-
- x = o.a
- x = o.b
- x = o.c
-
- x = o.a
- x = o.b
- x = o.c
-
- x = o.a
- x = o.b
- x = o.c
-
- o.a = 2
- o.b = 3
- o.c = 4
-
- o.a = 2
- o.b = 3
- o.c = 4
-
- o.a = 2
- o.b = 3
- o.c = 4
-
- o.a = 2
- o.b = 3
- o.c = 4
-
-
- x = o.a
- x = o.b
- x = o.c
-
- x = o.a
- x = o.b
- x = o.c
-
- x = o.a
- x = o.b
- x = o.c
-
- x = o.a
- x = o.b
- x = o.c
-
- o.a = 2
- o.b = 3
- o.c = 4
-
- o.a = 2
- o.b = 3
- o.c = 4
-
- o.a = 2
- o.b = 3
- o.c = 4
-
- o.a = 2
- o.b = 3
- o.c = 4
-
-
- x = o.a
- x = o.b
- x = o.c
-
- x = o.a
- x = o.b
- x = o.c
-
- x = o.a
- x = o.b
- x = o.c
-
- x = o.a
- x = o.b
- x = o.c
-
- o.a = 2
- o.b = 3
- o.c = 4
-
- o.a = 2
- o.b = 3
- o.c = 4
-
- o.a = 2
- o.b = 3
- o.c = 4
-
- o.a = 2
- o.b = 3
- o.c = 4
-
-
- x = o.a
- x = o.b
- x = o.c
-
- x = o.a
- x = o.b
- x = o.c
-
- x = o.a
- x = o.b
- x = o.c
-
- x = o.a
- x = o.b
- x = o.c
-
- def calibrate(self):
-
- class c:
- pass
- o = c()
-
- for i in range(self.rounds):
- pass
-
-class BuiltinMethodLookup(Test):
-
- version = 2.0
- operations = 5*(3*5 + 3*5)
- rounds = 70000
-
- def test(self):
-
- l = []
- d = {}
-
- for i in range(self.rounds):
-
- l.append
- l.append
- l.append
- l.append
- l.append
-
- l.insert
- l.insert
- l.insert
- l.insert
- l.insert
-
- l.sort
- l.sort
- l.sort
- l.sort
- l.sort
-
- # d.has_key
- # d.has_key
- # d.has_key
- # d.has_key
- # d.has_key
-
- d.items
- d.items
- d.items
- d.items
- d.items
-
- d.get
- d.get
- d.get
- d.get
- d.get
-
- l.append
- l.append
- l.append
- l.append
- l.append
-
- l.insert
- l.insert
- l.insert
- l.insert
- l.insert
-
- l.sort
- l.sort
- l.sort
- l.sort
- l.sort
-
- # d.has_key
- # d.has_key
- # d.has_key
- # d.has_key
- # d.has_key
-
- d.items
- d.items
- d.items
- d.items
- d.items
-
- d.get
- d.get
- d.get
- d.get
- d.get
-
- l.append
- l.append
- l.append
- l.append
- l.append
-
- l.insert
- l.insert
- l.insert
- l.insert
- l.insert
-
- l.sort
- l.sort
- l.sort
- l.sort
- l.sort
-
- # d.has_key
- # d.has_key
- # d.has_key
- # d.has_key
- # d.has_key
-
- d.items
- d.items
- d.items
- d.items
- d.items
-
- d.get
- d.get
- d.get
- d.get
- d.get
-
- l.append
- l.append
- l.append
- l.append
- l.append
-
- l.insert
- l.insert
- l.insert
- l.insert
- l.insert
-
- l.sort
- l.sort
- l.sort
- l.sort
- l.sort
-
- # d.has_key
- # d.has_key
- # d.has_key
- # d.has_key
- # d.has_key
-
- d.items
- d.items
- d.items
- d.items
- d.items
-
- d.get
- d.get
- d.get
- d.get
- d.get
-
- l.append
- l.append
- l.append
- l.append
- l.append
-
- l.insert
- l.insert
- l.insert
- l.insert
- l.insert
-
- l.sort
- l.sort
- l.sort
- l.sort
- l.sort
-
- # d.has_key
- # d.has_key
- # d.has_key
- # d.has_key
- # d.has_key
-
- d.items
- d.items
- d.items
- d.items
- d.items
-
- d.get
- d.get
- d.get
- d.get
- d.get
-
- def calibrate(self):
-
- l = []
- d = {}
-
- for i in range(self.rounds):
- pass
diff --git a/Tools/pybench/NewInstances.py b/Tools/pybench/NewInstances.py
deleted file mode 100644
index 9506da484c..0000000000
--- a/Tools/pybench/NewInstances.py
+++ /dev/null
@@ -1,75 +0,0 @@
-from pybench import Test
-
-# Check for new-style class support:
-try:
- class c(object):
- pass
-except NameError:
- raise ImportError
-
-###
-
-class CreateNewInstances(Test):
-
- version = 2.0
- operations = 3 + 7 + 4
- rounds = 60000
-
- def test(self):
-
- class c(object):
- pass
-
- class d(object):
- def __init__(self,a,b,c):
- self.a = a
- self.b = b
- self.c = c
-
- class e(object):
- def __init__(self,a,b,c=4):
- self.a = a
- self.b = b
- self.c = c
- self.d = a
- self.e = b
- self.f = c
-
- for i in range(self.rounds):
- o = c()
- o1 = c()
- o2 = c()
- p = d(i,i,3)
- p1 = d(i,i,3)
- p2 = d(i,3,3)
- p3 = d(3,i,3)
- p4 = d(i,i,i)
- p5 = d(3,i,3)
- p6 = d(i,i,i)
- q = e(i,i,3)
- q1 = e(i,i,3)
- q2 = e(i,i,3)
- q3 = e(i,i)
-
- def calibrate(self):
-
- class c(object):
- pass
-
- class d(object):
- def __init__(self,a,b,c):
- self.a = a
- self.b = b
- self.c = c
-
- class e(object):
- def __init__(self,a,b,c=4):
- self.a = a
- self.b = b
- self.c = c
- self.d = a
- self.e = b
- self.f = c
-
- for i in range(self.rounds):
- pass
diff --git a/Tools/pybench/Numbers.py b/Tools/pybench/Numbers.py
deleted file mode 100644
index 1b216734a8..0000000000
--- a/Tools/pybench/Numbers.py
+++ /dev/null
@@ -1,784 +0,0 @@
-from pybench import Test
-
-class CompareIntegers(Test):
-
- version = 2.0
- operations = 30 * 5
- rounds = 120000
-
- def test(self):
-
- for i in range(self.rounds):
-
- 2 < 3
- 2 > 3
- 2 == 3
- 2 > 3
- 2 < 3
-
- 2 < 3
- 2 > 3
- 2 == 3
- 2 > 3
- 2 < 3
-
- 2 < 3
- 2 > 3
- 2 == 3
- 2 > 3
- 2 < 3
-
- 2 < 3
- 2 > 3
- 2 == 3
- 2 > 3
- 2 < 3
-
- 2 < 3
- 2 > 3
- 2 == 3
- 2 > 3
- 2 < 3
-
- 2 < 3
- 2 > 3
- 2 == 3
- 2 > 3
- 2 < 3
-
- 2 < 3
- 2 > 3
- 2 == 3
- 2 > 3
- 2 < 3
-
- 2 < 3
- 2 > 3
- 2 == 3
- 2 > 3
- 2 < 3
-
- 2 < 3
- 2 > 3
- 2 == 3
- 2 > 3
- 2 < 3
-
- 2 < 3
- 2 > 3
- 2 == 3
- 2 > 3
- 2 < 3
-
- 2 < 3
- 2 > 3
- 2 == 3
- 2 > 3
- 2 < 3
-
- 2 < 3
- 2 > 3
- 2 == 3
- 2 > 3
- 2 < 3
-
- 2 < 3
- 2 > 3
- 2 == 3
- 2 > 3
- 2 < 3
-
- 2 < 3
- 2 > 3
- 2 == 3
- 2 > 3
- 2 < 3
-
- 2 < 3
- 2 > 3
- 2 == 3
- 2 > 3
- 2 < 3
-
- 2 < 3
- 2 > 3
- 2 == 3
- 2 > 3
- 2 < 3
-
- 2 < 3
- 2 > 3
- 2 == 3
- 2 > 3
- 2 < 3
-
- 2 < 3
- 2 > 3
- 2 == 3
- 2 > 3
- 2 < 3
-
- 2 < 3
- 2 > 3
- 2 == 3
- 2 > 3
- 2 < 3
-
- 2 < 3
- 2 > 3
- 2 == 3
- 2 > 3
- 2 < 3
-
- 2 < 3
- 2 > 3
- 2 == 3
- 2 > 3
- 2 < 3
-
- 2 < 3
- 2 > 3
- 2 == 3
- 2 > 3
- 2 < 3
-
- 2 < 3
- 2 > 3
- 2 == 3
- 2 > 3
- 2 < 3
-
- 2 < 3
- 2 > 3
- 2 == 3
- 2 > 3
- 2 < 3
-
- 2 < 3
- 2 > 3
- 2 == 3
- 2 > 3
- 2 < 3
-
- 2 < 3
- 2 > 3
- 2 == 3
- 2 > 3
- 2 < 3
-
- 2 < 3
- 2 > 3
- 2 == 3
- 2 > 3
- 2 < 3
-
- 2 < 3
- 2 > 3
- 2 == 3
- 2 > 3
- 2 < 3
-
- 2 < 3
- 2 > 3
- 2 == 3
- 2 > 3
- 2 < 3
-
- 2 < 3
- 2 > 3
- 2 == 3
- 2 > 3
- 2 < 3
-
- def calibrate(self):
-
- for i in range(self.rounds):
- pass
-
-
-class CompareFloats(Test):
-
- version = 2.0
- operations = 30 * 5
- rounds = 80000
-
- def test(self):
-
- for i in range(self.rounds):
-
- 2.1 < 3.31
- 2.1 > 3.31
- 2.1 == 3.31
- 2.1 > 3.31
- 2.1 < 3.31
-
- 2.1 < 3.31
- 2.1 > 3.31
- 2.1 == 3.31
- 2.1 > 3.31
- 2.1 < 3.31
-
- 2.1 < 3.31
- 2.1 > 3.31
- 2.1 == 3.31
- 2.1 > 3.31
- 2.1 < 3.31
-
- 2.1 < 3.31
- 2.1 > 3.31
- 2.1 == 3.31
- 2.1 > 3.31
- 2.1 < 3.31
-
- 2.1 < 3.31
- 2.1 > 3.31
- 2.1 == 3.31
- 2.1 > 3.31
- 2.1 < 3.31
-
- 2.1 < 3.31
- 2.1 > 3.31
- 2.1 == 3.31
- 2.1 > 3.31
- 2.1 < 3.31
-
- 2.1 < 3.31
- 2.1 > 3.31
- 2.1 == 3.31
- 2.1 > 3.31
- 2.1 < 3.31
-
- 2.1 < 3.31
- 2.1 > 3.31
- 2.1 == 3.31
- 2.1 > 3.31
- 2.1 < 3.31
-
- 2.1 < 3.31
- 2.1 > 3.31
- 2.1 == 3.31
- 2.1 > 3.31
- 2.1 < 3.31
-
- 2.1 < 3.31
- 2.1 > 3.31
- 2.1 == 3.31
- 2.1 > 3.31
- 2.1 < 3.31
-
- 2.1 < 3.31
- 2.1 > 3.31
- 2.1 == 3.31
- 2.1 > 3.31
- 2.1 < 3.31
-
- 2.1 < 3.31
- 2.1 > 3.31
- 2.1 == 3.31
- 2.1 > 3.31
- 2.1 < 3.31
-
- 2.1 < 3.31
- 2.1 > 3.31
- 2.1 == 3.31
- 2.1 > 3.31
- 2.1 < 3.31
-
- 2.1 < 3.31
- 2.1 > 3.31
- 2.1 == 3.31
- 2.1 > 3.31
- 2.1 < 3.31
-
- 2.1 < 3.31
- 2.1 > 3.31
- 2.1 == 3.31
- 2.1 > 3.31
- 2.1 < 3.31
-
- 2.1 < 3.31
- 2.1 > 3.31
- 2.1 == 3.31
- 2.1 > 3.31
- 2.1 < 3.31
-
- 2.1 < 3.31
- 2.1 > 3.31
- 2.1 == 3.31
- 2.1 > 3.31
- 2.1 < 3.31
-
- 2.1 < 3.31
- 2.1 > 3.31
- 2.1 == 3.31
- 2.1 > 3.31
- 2.1 < 3.31
-
- 2.1 < 3.31
- 2.1 > 3.31
- 2.1 == 3.31
- 2.1 > 3.31
- 2.1 < 3.31
-
- 2.1 < 3.31
- 2.1 > 3.31
- 2.1 == 3.31
- 2.1 > 3.31
- 2.1 < 3.31
-
- 2.1 < 3.31
- 2.1 > 3.31
- 2.1 == 3.31
- 2.1 > 3.31
- 2.1 < 3.31
-
- 2.1 < 3.31
- 2.1 > 3.31
- 2.1 == 3.31
- 2.1 > 3.31
- 2.1 < 3.31
-
- 2.1 < 3.31
- 2.1 > 3.31
- 2.1 == 3.31
- 2.1 > 3.31
- 2.1 < 3.31
-
- 2.1 < 3.31
- 2.1 > 3.31
- 2.1 == 3.31
- 2.1 > 3.31
- 2.1 < 3.31
-
- 2.1 < 3.31
- 2.1 > 3.31
- 2.1 == 3.31
- 2.1 > 3.31
- 2.1 < 3.31
-
- 2.1 < 3.31
- 2.1 > 3.31
- 2.1 == 3.31
- 2.1 > 3.31
- 2.1 < 3.31
-
- 2.1 < 3.31
- 2.1 > 3.31
- 2.1 == 3.31
- 2.1 > 3.31
- 2.1 < 3.31
-
- 2.1 < 3.31
- 2.1 > 3.31
- 2.1 == 3.31
- 2.1 > 3.31
- 2.1 < 3.31
-
- 2.1 < 3.31
- 2.1 > 3.31
- 2.1 == 3.31
- 2.1 > 3.31
- 2.1 < 3.31
-
- 2.1 < 3.31
- 2.1 > 3.31
- 2.1 == 3.31
- 2.1 > 3.31
- 2.1 < 3.31
-
- def calibrate(self):
-
- for i in range(self.rounds):
- pass
-
-
-class CompareFloatsIntegers(Test):
-
- version = 2.0
- operations = 30 * 5
- rounds = 60000
-
- def test(self):
-
- for i in range(self.rounds):
-
- 2.1 < 4
- 2.1 > 4
- 2.1 == 4
- 2.1 > 4
- 2.1 < 4
-
- 2.1 < 4
- 2.1 > 4
- 2.1 == 4
- 2.1 > 4
- 2.1 < 4
-
- 2.1 < 4
- 2.1 > 4
- 2.1 == 4
- 2.1 > 4
- 2.1 < 4
-
- 2.1 < 4
- 2.1 > 4
- 2.1 == 4
- 2.1 > 4
- 2.1 < 4
-
- 2.1 < 4
- 2.1 > 4
- 2.1 == 4
- 2.1 > 4
- 2.1 < 4
-
- 2.1 < 4
- 2.1 > 4
- 2.1 == 4
- 2.1 > 4
- 2.1 < 4
-
- 2.1 < 4
- 2.1 > 4
- 2.1 == 4
- 2.1 > 4
- 2.1 < 4
-
- 2.1 < 4
- 2.1 > 4
- 2.1 == 4
- 2.1 > 4
- 2.1 < 4
-
- 2.1 < 4
- 2.1 > 4
- 2.1 == 4
- 2.1 > 4
- 2.1 < 4
-
- 2.1 < 4
- 2.1 > 4
- 2.1 == 4
- 2.1 > 4
- 2.1 < 4
-
- 2.1 < 4
- 2.1 > 4
- 2.1 == 4
- 2.1 > 4
- 2.1 < 4
-
- 2.1 < 4
- 2.1 > 4
- 2.1 == 4
- 2.1 > 4
- 2.1 < 4
-
- 2.1 < 4
- 2.1 > 4
- 2.1 == 4
- 2.1 > 4
- 2.1 < 4
-
- 2.1 < 4
- 2.1 > 4
- 2.1 == 4
- 2.1 > 4
- 2.1 < 4
-
- 2.1 < 4
- 2.1 > 4
- 2.1 == 4
- 2.1 > 4
- 2.1 < 4
-
- 2.1 < 4
- 2.1 > 4
- 2.1 == 4
- 2.1 > 4
- 2.1 < 4
-
- 2.1 < 4
- 2.1 > 4
- 2.1 == 4
- 2.1 > 4
- 2.1 < 4
-
- 2.1 < 4
- 2.1 > 4
- 2.1 == 4
- 2.1 > 4
- 2.1 < 4
-
- 2.1 < 4
- 2.1 > 4
- 2.1 == 4
- 2.1 > 4
- 2.1 < 4
-
- 2.1 < 4
- 2.1 > 4
- 2.1 == 4
- 2.1 > 4
- 2.1 < 4
-
- 2.1 < 4
- 2.1 > 4
- 2.1 == 4
- 2.1 > 4
- 2.1 < 4
-
- 2.1 < 4
- 2.1 > 4
- 2.1 == 4
- 2.1 > 4
- 2.1 < 4
-
- 2.1 < 4
- 2.1 > 4
- 2.1 == 4
- 2.1 > 4
- 2.1 < 4
-
- 2.1 < 4
- 2.1 > 4
- 2.1 == 4
- 2.1 > 4
- 2.1 < 4
-
- 2.1 < 4
- 2.1 > 4
- 2.1 == 4
- 2.1 > 4
- 2.1 < 4
-
- 2.1 < 4
- 2.1 > 4
- 2.1 == 4
- 2.1 > 4
- 2.1 < 4
-
- 2.1 < 4
- 2.1 > 4
- 2.1 == 4
- 2.1 > 4
- 2.1 < 4
-
- 2.1 < 4
- 2.1 > 4
- 2.1 == 4
- 2.1 > 4
- 2.1 < 4
-
- 2.1 < 4
- 2.1 > 4
- 2.1 == 4
- 2.1 > 4
- 2.1 < 4
-
- 2.1 < 4
- 2.1 > 4
- 2.1 == 4
- 2.1 > 4
- 2.1 < 4
-
- def calibrate(self):
-
- for i in range(self.rounds):
- pass
-
-
-class CompareLongs(Test):
-
- version = 2.0
- operations = 30 * 5
- rounds = 70000
-
- def test(self):
-
- for i in range(self.rounds):
-
- 1234567890 < 3456789012345
- 1234567890 > 3456789012345
- 1234567890 == 3456789012345
- 1234567890 > 3456789012345
- 1234567890 < 3456789012345
-
- 1234567890 < 3456789012345
- 1234567890 > 3456789012345
- 1234567890 == 3456789012345
- 1234567890 > 3456789012345
- 1234567890 < 3456789012345
-
- 1234567890 < 3456789012345
- 1234567890 > 3456789012345
- 1234567890 == 3456789012345
- 1234567890 > 3456789012345
- 1234567890 < 3456789012345
-
- 1234567890 < 3456789012345
- 1234567890 > 3456789012345
- 1234567890 == 3456789012345
- 1234567890 > 3456789012345
- 1234567890 < 3456789012345
-
- 1234567890 < 3456789012345
- 1234567890 > 3456789012345
- 1234567890 == 3456789012345
- 1234567890 > 3456789012345
- 1234567890 < 3456789012345
-
- 1234567890 < 3456789012345
- 1234567890 > 3456789012345
- 1234567890 == 3456789012345
- 1234567890 > 3456789012345
- 1234567890 < 3456789012345
-
- 1234567890 < 3456789012345
- 1234567890 > 3456789012345
- 1234567890 == 3456789012345
- 1234567890 > 3456789012345
- 1234567890 < 3456789012345
-
- 1234567890 < 3456789012345
- 1234567890 > 3456789012345
- 1234567890 == 3456789012345
- 1234567890 > 3456789012345
- 1234567890 < 3456789012345
-
- 1234567890 < 3456789012345
- 1234567890 > 3456789012345
- 1234567890 == 3456789012345
- 1234567890 > 3456789012345
- 1234567890 < 3456789012345
-
- 1234567890 < 3456789012345
- 1234567890 > 3456789012345
- 1234567890 == 3456789012345
- 1234567890 > 3456789012345
- 1234567890 < 3456789012345
-
- 1234567890 < 3456789012345
- 1234567890 > 3456789012345
- 1234567890 == 3456789012345
- 1234567890 > 3456789012345
- 1234567890 < 3456789012345
-
- 1234567890 < 3456789012345
- 1234567890 > 3456789012345
- 1234567890 == 3456789012345
- 1234567890 > 3456789012345
- 1234567890 < 3456789012345
-
- 1234567890 < 3456789012345
- 1234567890 > 3456789012345
- 1234567890 == 3456789012345
- 1234567890 > 3456789012345
- 1234567890 < 3456789012345
-
- 1234567890 < 3456789012345
- 1234567890 > 3456789012345
- 1234567890 == 3456789012345
- 1234567890 > 3456789012345
- 1234567890 < 3456789012345
-
- 1234567890 < 3456789012345
- 1234567890 > 3456789012345
- 1234567890 == 3456789012345
- 1234567890 > 3456789012345
- 1234567890 < 3456789012345
-
- 1234567890 < 3456789012345
- 1234567890 > 3456789012345
- 1234567890 == 3456789012345
- 1234567890 > 3456789012345
- 1234567890 < 3456789012345
-
- 1234567890 < 3456789012345
- 1234567890 > 3456789012345
- 1234567890 == 3456789012345
- 1234567890 > 3456789012345
- 1234567890 < 3456789012345
-
- 1234567890 < 3456789012345
- 1234567890 > 3456789012345
- 1234567890 == 3456789012345
- 1234567890 > 3456789012345
- 1234567890 < 3456789012345
-
- 1234567890 < 3456789012345
- 1234567890 > 3456789012345
- 1234567890 == 3456789012345
- 1234567890 > 3456789012345
- 1234567890 < 3456789012345
-
- 1234567890 < 3456789012345
- 1234567890 > 3456789012345
- 1234567890 == 3456789012345
- 1234567890 > 3456789012345
- 1234567890 < 3456789012345
-
- 1234567890 < 3456789012345
- 1234567890 > 3456789012345
- 1234567890 == 3456789012345
- 1234567890 > 3456789012345
- 1234567890 < 3456789012345
-
- 1234567890 < 3456789012345
- 1234567890 > 3456789012345
- 1234567890 == 3456789012345
- 1234567890 > 3456789012345
- 1234567890 < 3456789012345
-
- 1234567890 < 3456789012345
- 1234567890 > 3456789012345
- 1234567890 == 3456789012345
- 1234567890 > 3456789012345
- 1234567890 < 3456789012345
-
- 1234567890 < 3456789012345
- 1234567890 > 3456789012345
- 1234567890 == 3456789012345
- 1234567890 > 3456789012345
- 1234567890 < 3456789012345
-
- 1234567890 < 3456789012345
- 1234567890 > 3456789012345
- 1234567890 == 3456789012345
- 1234567890 > 3456789012345
- 1234567890 < 3456789012345
-
- 1234567890 < 3456789012345
- 1234567890 > 3456789012345
- 1234567890 == 3456789012345
- 1234567890 > 3456789012345
- 1234567890 < 3456789012345
-
- 1234567890 < 3456789012345
- 1234567890 > 3456789012345
- 1234567890 == 3456789012345
- 1234567890 > 3456789012345
- 1234567890 < 3456789012345
-
- 1234567890 < 3456789012345
- 1234567890 > 3456789012345
- 1234567890 == 3456789012345
- 1234567890 > 3456789012345
- 1234567890 < 3456789012345
-
- 1234567890 < 3456789012345
- 1234567890 > 3456789012345
- 1234567890 == 3456789012345
- 1234567890 > 3456789012345
- 1234567890 < 3456789012345
-
- 1234567890 < 3456789012345
- 1234567890 > 3456789012345
- 1234567890 == 3456789012345
- 1234567890 > 3456789012345
- 1234567890 < 3456789012345
-
- def calibrate(self):
-
- for i in range(self.rounds):
- pass
diff --git a/Tools/pybench/README b/Tools/pybench/README
deleted file mode 100644
index 40f7eec797..0000000000
--- a/Tools/pybench/README
+++ /dev/null
@@ -1,371 +0,0 @@
-________________________________________________________________________
-
-PYBENCH - A Python Benchmark Suite
-________________________________________________________________________
-
- Extendable suite of low-level benchmarks for measuring
- the performance of the Python implementation
- (interpreter, compiler or VM).
-
-pybench is a collection of tests that provides a standardized way to
-measure the performance of Python implementations. It takes a very
-close look at different aspects of Python programs and let's you
-decide which factors are more important to you than others, rather
-than wrapping everything up in one number, like the other performance
-tests do (e.g. pystone which is included in the Python Standard
-Library).
-
-pybench has been used in the past by several Python developers to
-track down performance bottlenecks or to demonstrate the impact of
-optimizations and new features in Python.
-
-The command line interface for pybench is the file pybench.py. Run
-this script with option '--help' to get a listing of the possible
-options. Without options, pybench will simply execute the benchmark
-and then print out a report to stdout.
-
-
-Micro-Manual
-------------
-
-Run 'pybench.py -h' to see the help screen. Run 'pybench.py' to run
-the benchmark suite using default settings and 'pybench.py -f <file>'
-to have it store the results in a file too.
-
-It is usually a good idea to run pybench.py multiple times to see
-whether the environment, timers and benchmark run-times are suitable
-for doing benchmark tests.
-
-You can use the comparison feature of pybench.py ('pybench.py -c
-<file>') to check how well the system behaves in comparison to a
-reference run.
-
-If the differences are well below 10% for each test, then you have a
-system that is good for doing benchmark testings. Of you get random
-differences of more than 10% or significant differences between the
-values for minimum and average time, then you likely have some
-background processes running which cause the readings to become
-inconsistent. Examples include: web-browsers, email clients, RSS
-readers, music players, backup programs, etc.
-
-If you are only interested in a few tests of the whole suite, you can
-use the filtering option, e.g. 'pybench.py -t string' will only
-run/show the tests that have 'string' in their name.
-
-This is the current output of pybench.py --help:
-
-"""
-------------------------------------------------------------------------
-PYBENCH - a benchmark test suite for Python interpreters/compilers.
-------------------------------------------------------------------------
-
-Synopsis:
- pybench.py [option] files...
-
-Options and default settings:
- -n arg number of rounds (10)
- -f arg save benchmark to file arg ()
- -c arg compare benchmark with the one in file arg ()
- -s arg show benchmark in file arg, then exit ()
- -w arg set warp factor to arg (10)
- -t arg run only tests with names matching arg ()
- -C arg set the number of calibration runs to arg (20)
- -d hide noise in comparisons (0)
- -v verbose output (not recommended) (0)
- --with-gc enable garbage collection (0)
- --with-syscheck use default sys check interval (0)
- --timer arg use given timer (time.time)
- -h show this help text
- --help show this help text
- --debug enable debugging
- --copyright show copyright
- --examples show examples of usage
-
-Version:
- 2.1
-
-The normal operation is to run the suite and display the
-results. Use -f to save them for later reuse or comparisons.
-
-Available timers:
-
- time.time
- time.clock
- systimes.processtime
-
-Examples:
-
-python3.0 pybench.py -f p30.pybench
-python3.1 pybench.py -f p31.pybench
-python pybench.py -s p31.pybench -c p30.pybench
-"""
-
-License
--------
-
-See LICENSE file.
-
-
-Sample output
--------------
-
-"""
--------------------------------------------------------------------------------
-PYBENCH 2.1
--------------------------------------------------------------------------------
-* using CPython 3.0
-* disabled garbage collection
-* system check interval set to maximum: 2147483647
-* using timer: time.time
-
-Calibrating tests. Please wait...
-
-Running 10 round(s) of the suite at warp factor 10:
-
-* Round 1 done in 6.388 seconds.
-* Round 2 done in 6.485 seconds.
-* Round 3 done in 6.786 seconds.
-...
-* Round 10 done in 6.546 seconds.
-
--------------------------------------------------------------------------------
-Benchmark: 2006-06-12 12:09:25
--------------------------------------------------------------------------------
-
- Rounds: 10
- Warp: 10
- Timer: time.time
-
- Machine Details:
- Platform ID: Linux-2.6.8-24.19-default-x86_64-with-SuSE-9.2-x86-64
- Processor: x86_64
-
- Python:
- Implementation: CPython
- Executable: /usr/local/bin/python
- Version: 3.0
- Compiler: GCC 3.3.4 (pre 3.3.5 20040809)
- Bits: 64bit
- Build: Oct 1 2005 15:24:35 (#1)
- Unicode: UCS2
-
-
-Test minimum average operation overhead
--------------------------------------------------------------------------------
- BuiltinFunctionCalls: 126ms 145ms 0.28us 0.274ms
- BuiltinMethodLookup: 124ms 130ms 0.12us 0.316ms
- CompareFloats: 109ms 110ms 0.09us 0.361ms
- CompareFloatsIntegers: 100ms 104ms 0.12us 0.271ms
- CompareIntegers: 137ms 138ms 0.08us 0.542ms
- CompareInternedStrings: 124ms 127ms 0.08us 1.367ms
- CompareLongs: 100ms 104ms 0.10us 0.316ms
- CompareStrings: 111ms 115ms 0.12us 0.929ms
- CompareUnicode: 108ms 128ms 0.17us 0.693ms
- ConcatStrings: 142ms 155ms 0.31us 0.562ms
- ConcatUnicode: 119ms 127ms 0.42us 0.384ms
- CreateInstances: 123ms 128ms 1.14us 0.367ms
- CreateNewInstances: 121ms 126ms 1.49us 0.335ms
- CreateStringsWithConcat: 130ms 135ms 0.14us 0.916ms
- CreateUnicodeWithConcat: 130ms 135ms 0.34us 0.361ms
- DictCreation: 108ms 109ms 0.27us 0.361ms
- DictWithFloatKeys: 149ms 153ms 0.17us 0.678ms
- DictWithIntegerKeys: 124ms 126ms 0.11us 0.915ms
- DictWithStringKeys: 114ms 117ms 0.10us 0.905ms
- ForLoops: 110ms 111ms 4.46us 0.063ms
- IfThenElse: 118ms 119ms 0.09us 0.685ms
- ListSlicing: 116ms 120ms 8.59us 0.103ms
- NestedForLoops: 125ms 137ms 0.09us 0.019ms
- NormalClassAttribute: 124ms 136ms 0.11us 0.457ms
- NormalInstanceAttribute: 110ms 117ms 0.10us 0.454ms
- PythonFunctionCalls: 107ms 113ms 0.34us 0.271ms
- PythonMethodCalls: 140ms 149ms 0.66us 0.141ms
- Recursion: 156ms 166ms 3.32us 0.452ms
- SecondImport: 112ms 118ms 1.18us 0.180ms
- SecondPackageImport: 118ms 127ms 1.27us 0.180ms
- SecondSubmoduleImport: 140ms 151ms 1.51us 0.180ms
- SimpleComplexArithmetic: 128ms 139ms 0.16us 0.361ms
- SimpleDictManipulation: 134ms 136ms 0.11us 0.452ms
- SimpleFloatArithmetic: 110ms 113ms 0.09us 0.571ms
- SimpleIntFloatArithmetic: 106ms 111ms 0.08us 0.548ms
- SimpleIntegerArithmetic: 106ms 109ms 0.08us 0.544ms
- SimpleListManipulation: 103ms 113ms 0.10us 0.587ms
- SimpleLongArithmetic: 112ms 118ms 0.18us 0.271ms
- SmallLists: 105ms 116ms 0.17us 0.366ms
- SmallTuples: 108ms 128ms 0.24us 0.406ms
- SpecialClassAttribute: 119ms 136ms 0.11us 0.453ms
- SpecialInstanceAttribute: 143ms 155ms 0.13us 0.454ms
- StringMappings: 115ms 121ms 0.48us 0.405ms
- StringPredicates: 120ms 129ms 0.18us 2.064ms
- StringSlicing: 111ms 127ms 0.23us 0.781ms
- TryExcept: 125ms 126ms 0.06us 0.681ms
- TryRaiseExcept: 133ms 137ms 2.14us 0.361ms
- TupleSlicing: 117ms 120ms 0.46us 0.066ms
- UnicodeMappings: 156ms 160ms 4.44us 0.429ms
- UnicodePredicates: 117ms 121ms 0.22us 2.487ms
- UnicodeProperties: 115ms 153ms 0.38us 2.070ms
- UnicodeSlicing: 126ms 129ms 0.26us 0.689ms
--------------------------------------------------------------------------------
-Totals: 6283ms 6673ms
-"""
-________________________________________________________________________
-
-Writing New Tests
-________________________________________________________________________
-
-pybench tests are simple modules defining one or more pybench.Test
-subclasses.
-
-Writing a test essentially boils down to providing two methods:
-.test() which runs .rounds number of .operations test operations each
-and .calibrate() which does the same except that it doesn't actually
-execute the operations.
-
-
-Here's an example:
-------------------
-
-from pybench import Test
-
-class IntegerCounting(Test):
-
- # Version number of the test as float (x.yy); this is important
- # for comparisons of benchmark runs - tests with unequal version
- # number will not get compared.
- version = 1.0
-
- # The number of abstract operations done in each round of the
- # test. An operation is the basic unit of what you want to
- # measure. The benchmark will output the amount of run-time per
- # operation. Note that in order to raise the measured timings
- # significantly above noise level, it is often required to repeat
- # sets of operations more than once per test round. The measured
- # overhead per test round should be less than 1 second.
- operations = 20
-
- # Number of rounds to execute per test run. This should be
- # adjusted to a figure that results in a test run-time of between
- # 1-2 seconds (at warp 1).
- rounds = 100000
-
- def test(self):
-
- """ Run the test.
-
- The test needs to run self.rounds executing
- self.operations number of operations each.
-
- """
- # Init the test
- a = 1
-
- # Run test rounds
- #
- for i in range(self.rounds):
-
- # Repeat the operations per round to raise the run-time
- # per operation significantly above the noise level of the
- # for-loop overhead.
-
- # Execute 20 operations (a += 1):
- a += 1
- a += 1
- a += 1
- a += 1
- a += 1
- a += 1
- a += 1
- a += 1
- a += 1
- a += 1
- a += 1
- a += 1
- a += 1
- a += 1
- a += 1
- a += 1
- a += 1
- a += 1
- a += 1
- a += 1
-
- def calibrate(self):
-
- """ Calibrate the test.
-
- This method should execute everything that is needed to
- setup and run the test - except for the actual operations
- that you intend to measure. pybench uses this method to
- measure the test implementation overhead.
-
- """
- # Init the test
- a = 1
-
- # Run test rounds (without actually doing any operation)
- for i in range(self.rounds):
-
- # Skip the actual execution of the operations, since we
- # only want to measure the test's administration overhead.
- pass
-
-Registering a new test module
------------------------------
-
-To register a test module with pybench, the classes need to be
-imported into the pybench.Setup module. pybench will then scan all the
-symbols defined in that module for subclasses of pybench.Test and
-automatically add them to the benchmark suite.
-
-
-Breaking Comparability
-----------------------
-
-If a change is made to any individual test that means it is no
-longer strictly comparable with previous runs, the '.version' class
-variable should be updated. Therefafter, comparisons with previous
-versions of the test will list as "n/a" to reflect the change.
-
-
-Version History
----------------
-
- 2.1: made some minor changes for compatibility with Python 3.0:
- - replaced cmp with divmod and range with max in Calls.py
- (cmp no longer exists in 3.0, and range is a list in
- Python 2.x and an iterator in Python 3.x)
-
- 2.0: rewrote parts of pybench which resulted in more repeatable
- timings:
- - made timer a parameter
- - changed the platform default timer to use high-resolution
- timers rather than process timers (which have a much lower
- resolution)
- - added option to select timer
- - added process time timer (using systimes.py)
- - changed to use min() as timing estimator (average
- is still taken as well to provide an idea of the difference)
- - garbage collection is turned off per default
- - sys check interval is set to the highest possible value
- - calibration is now a separate step and done using
- a different strategy that allows measuring the test
- overhead more accurately
- - modified the tests to each give a run-time of between
- 100-200ms using warp 10
- - changed default warp factor to 10 (from 20)
- - compared results with timeit.py and confirmed measurements
- - bumped all test versions to 2.0
- - updated platform.py to the latest version
- - changed the output format a bit to make it look
- nicer
- - refactored the APIs somewhat
- 1.3+: Steve Holden added the NewInstances test and the filtering
- option during the NeedForSpeed sprint; this also triggered a long
- discussion on how to improve benchmark timing and finally
- resulted in the release of 2.0
- 1.3: initial checkin into the Python SVN repository
-
-
-Have fun,
---
-Marc-Andre Lemburg
-mal@lemburg.com
diff --git a/Tools/pybench/Setup.py b/Tools/pybench/Setup.py
deleted file mode 100644
index 21e654afba..0000000000
--- a/Tools/pybench/Setup.py
+++ /dev/null
@@ -1,43 +0,0 @@
-#!python
-
-# Setup file for pybench
-#
-# This file has to import all tests to be run; it is executed as
-# Python source file, so you can do all kinds of manipulations here
-# rather than having to edit the tests themselves.
-#
-# Note: Please keep this module compatible to Python 1.5.2.
-#
-# Tests may include features in later Python versions, but these
-# should then be embedded in try-except clauses in this configuration
-# module.
-
-# Defaults
-Number_of_rounds = 10
-Warp_factor = 10
-
-# Import tests
-from Arithmetic import *
-from Calls import *
-from Constructs import *
-from Lookups import *
-from Instances import *
-try:
- from NewInstances import *
-except ImportError:
- pass
-from Lists import *
-from Tuples import *
-from Dict import *
-from Exceptions import *
-try:
- from With import *
-except SyntaxError:
- pass
-from Imports import *
-from Strings import *
-from Numbers import *
-try:
- from Unicode import *
-except (ImportError, SyntaxError):
- pass
diff --git a/Tools/pybench/Strings.py b/Tools/pybench/Strings.py
deleted file mode 100644
index 8e3d702a91..0000000000
--- a/Tools/pybench/Strings.py
+++ /dev/null
@@ -1,568 +0,0 @@
-from pybench import Test
-import sys
-
-try:
- intern
-except NameError:
- intern = sys.intern
-
-
-class ConcatStrings(Test):
-
- version = 2.0
- operations = 10 * 5
- rounds = 100000
-
- def test(self):
-
- # Make sure the strings are *not* interned
- s = ''.join(map(str,range(100)))
- t = ''.join(map(str,range(1,101)))
-
- for i in range(self.rounds):
- t + s
- t + s
- t + s
- t + s
- t + s
-
- t + s
- t + s
- t + s
- t + s
- t + s
-
- t + s
- t + s
- t + s
- t + s
- t + s
-
- t + s
- t + s
- t + s
- t + s
- t + s
-
- t + s
- t + s
- t + s
- t + s
- t + s
-
- t + s
- t + s
- t + s
- t + s
- t + s
-
- t + s
- t + s
- t + s
- t + s
- t + s
-
- t + s
- t + s
- t + s
- t + s
- t + s
-
- t + s
- t + s
- t + s
- t + s
- t + s
-
- t + s
- t + s
- t + s
- t + s
- t + s
-
- def calibrate(self):
-
- s = ''.join(map(str,range(100)))
- t = ''.join(map(str,range(1,101)))
-
- for i in range(self.rounds):
- pass
-
-
-class CompareStrings(Test):
-
- version = 2.0
- operations = 10 * 5
- rounds = 200000
-
- def test(self):
-
- # Make sure the strings are *not* interned
- s = ''.join(map(str,range(10)))
- t = ''.join(map(str,range(10))) + "abc"
-
- for i in range(self.rounds):
- t < s
- t > s
- t == s
- t > s
- t < s
-
- t < s
- t > s
- t == s
- t > s
- t < s
-
- t < s
- t > s
- t == s
- t > s
- t < s
-
- t < s
- t > s
- t == s
- t > s
- t < s
-
- t < s
- t > s
- t == s
- t > s
- t < s
-
- t < s
- t > s
- t == s
- t > s
- t < s
-
- t < s
- t > s
- t == s
- t > s
- t < s
-
- t < s
- t > s
- t == s
- t > s
- t < s
-
- t < s
- t > s
- t == s
- t > s
- t < s
-
- t < s
- t > s
- t == s
- t > s
- t < s
-
- def calibrate(self):
-
- s = ''.join(map(str,range(10)))
- t = ''.join(map(str,range(10))) + "abc"
-
- for i in range(self.rounds):
- pass
-
-
-class CompareInternedStrings(Test):
-
- version = 2.0
- operations = 10 * 5
- rounds = 300000
-
- def test(self):
-
- # Make sure the strings *are* interned
- s = intern(''.join(map(str,range(10))))
- t = s
-
- for i in range(self.rounds):
- t == s
- t == s
- t >= s
- t > s
- t < s
-
- t == s
- t == s
- t >= s
- t > s
- t < s
-
- t == s
- t == s
- t >= s
- t > s
- t < s
-
- t == s
- t == s
- t >= s
- t > s
- t < s
-
- t == s
- t == s
- t >= s
- t > s
- t < s
-
- t == s
- t == s
- t >= s
- t > s
- t < s
-
- t == s
- t == s
- t >= s
- t > s
- t < s
-
- t == s
- t == s
- t >= s
- t > s
- t < s
-
- t == s
- t == s
- t >= s
- t > s
- t < s
-
- t == s
- t == s
- t >= s
- t > s
- t < s
-
- def calibrate(self):
-
- s = intern(''.join(map(str,range(10))))
- t = s
-
- for i in range(self.rounds):
- pass
-
-
-class CreateStringsWithConcat(Test):
-
- version = 2.0
- operations = 10 * 5
- rounds = 200000
-
- def test(self):
-
- for i in range(self.rounds):
- s = 'om'
- s = s + 'xbx'
- s = s + 'xcx'
- s = s + 'xdx'
- s = s + 'xex'
-
- s = s + 'xax'
- s = s + 'xbx'
- s = s + 'xcx'
- s = s + 'xdx'
- s = s + 'xex'
-
- s = s + 'xax'
- s = s + 'xbx'
- s = s + 'xcx'
- s = s + 'xdx'
- s = s + 'xex'
-
- s = s + 'xax'
- s = s + 'xbx'
- s = s + 'xcx'
- s = s + 'xdx'
- s = s + 'xex'
-
- s = s + 'xax'
- s = s + 'xbx'
- s = s + 'xcx'
- s = s + 'xdx'
- s = s + 'xex'
-
- s = s + 'xax'
- s = s + 'xbx'
- s = s + 'xcx'
- s = s + 'xdx'
- s = s + 'xex'
-
- s = s + 'xax'
- s = s + 'xbx'
- s = s + 'xcx'
- s = s + 'xdx'
- s = s + 'xex'
-
- s = s + 'xax'
- s = s + 'xbx'
- s = s + 'xcx'
- s = s + 'xdx'
- s = s + 'xex'
-
- s = s + 'xax'
- s = s + 'xbx'
- s = s + 'xcx'
- s = s + 'xdx'
- s = s + 'xex'
-
- s = s + 'xax'
- s = s + 'xbx'
- s = s + 'xcx'
- s = s + 'xdx'
- s = s + 'xex'
-
- def calibrate(self):
-
- for i in range(self.rounds):
- pass
-
-
-class StringSlicing(Test):
-
- version = 2.0
- operations = 5 * 7
- rounds = 160000
-
- def test(self):
-
- s = ''.join(map(str,range(100)))
-
- for i in range(self.rounds):
-
- s[50:]
- s[:25]
- s[50:55]
- s[-1:]
- s[:1]
- s[2:]
- s[11:-11]
-
- s[50:]
- s[:25]
- s[50:55]
- s[-1:]
- s[:1]
- s[2:]
- s[11:-11]
-
- s[50:]
- s[:25]
- s[50:55]
- s[-1:]
- s[:1]
- s[2:]
- s[11:-11]
-
- s[50:]
- s[:25]
- s[50:55]
- s[-1:]
- s[:1]
- s[2:]
- s[11:-11]
-
- s[50:]
- s[:25]
- s[50:55]
- s[-1:]
- s[:1]
- s[2:]
- s[11:-11]
-
- def calibrate(self):
-
- s = ''.join(map(str,range(100)))
-
- for i in range(self.rounds):
- pass
-
-### String methods
-
-if hasattr('', 'lower'):
-
- class StringMappings(Test):
-
- version = 2.0
- operations = 3 * (5 + 4 + 2 + 1)
- rounds = 70000
-
- def test(self):
-
- s = ''.join(map(chr,range(20)))
- t = ''.join(map(chr,range(50)))
- u = ''.join(map(chr,range(100)))
- v = ''.join(map(chr,range(256)))
-
- for i in range(self.rounds):
-
- s.lower()
- s.lower()
- s.lower()
- s.lower()
- s.lower()
-
- s.upper()
- s.upper()
- s.upper()
- s.upper()
- s.upper()
-
- s.title()
- s.title()
- s.title()
- s.title()
- s.title()
-
- t.lower()
- t.lower()
- t.lower()
- t.lower()
-
- t.upper()
- t.upper()
- t.upper()
- t.upper()
-
- t.title()
- t.title()
- t.title()
- t.title()
-
- u.lower()
- u.lower()
-
- u.upper()
- u.upper()
-
- u.title()
- u.title()
-
- v.lower()
-
- v.upper()
-
- v.title()
-
- def calibrate(self):
-
- s = ''.join(map(chr,range(20)))
- t = ''.join(map(chr,range(50)))
- u = ''.join(map(chr,range(100)))
- v = ''.join(map(chr,range(256)))
-
- for i in range(self.rounds):
- pass
-
- class StringPredicates(Test):
-
- version = 2.0
- operations = 10 * 7
- rounds = 100000
-
- def test(self):
-
- data = ('abc', '123', ' ', '\xe4\xf6\xfc', '\xdf'*10)
- len_data = len(data)
-
- for i in range(self.rounds):
- s = data[i % len_data]
-
- s.isalnum()
- s.isalpha()
- s.isdigit()
- s.islower()
- s.isspace()
- s.istitle()
- s.isupper()
-
- s.isalnum()
- s.isalpha()
- s.isdigit()
- s.islower()
- s.isspace()
- s.istitle()
- s.isupper()
-
- s.isalnum()
- s.isalpha()
- s.isdigit()
- s.islower()
- s.isspace()
- s.istitle()
- s.isupper()
-
- s.isalnum()
- s.isalpha()
- s.isdigit()
- s.islower()
- s.isspace()
- s.istitle()
- s.isupper()
-
- s.isalnum()
- s.isalpha()
- s.isdigit()
- s.islower()
- s.isspace()
- s.istitle()
- s.isupper()
-
- s.isalnum()
- s.isalpha()
- s.isdigit()
- s.islower()
- s.isspace()
- s.istitle()
- s.isupper()
-
- s.isalnum()
- s.isalpha()
- s.isdigit()
- s.islower()
- s.isspace()
- s.istitle()
- s.isupper()
-
- s.isalnum()
- s.isalpha()
- s.isdigit()
- s.islower()
- s.isspace()
- s.istitle()
- s.isupper()
-
- s.isalnum()
- s.isalpha()
- s.isdigit()
- s.islower()
- s.isspace()
- s.istitle()
- s.isupper()
-
- s.isalnum()
- s.isalpha()
- s.isdigit()
- s.islower()
- s.isspace()
- s.istitle()
- s.isupper()
-
- def calibrate(self):
-
- data = ('abc', '123', ' ', '\u1234\u2345\u3456', '\uFFFF'*10)
- data = ('abc', '123', ' ', '\xe4\xf6\xfc', '\xdf'*10)
- len_data = len(data)
-
- for i in range(self.rounds):
- s = data[i % len_data]
diff --git a/Tools/pybench/Tuples.py b/Tools/pybench/Tuples.py
deleted file mode 100644
index d93802c187..0000000000
--- a/Tools/pybench/Tuples.py
+++ /dev/null
@@ -1,360 +0,0 @@
-from pybench import Test
-
-class TupleSlicing(Test):
-
- version = 2.0
- operations = 3 * 25 * 10 * 7
- rounds = 500
-
- def test(self):
-
- r = range(25)
- t = tuple(range(100))
-
- for i in range(self.rounds):
-
- for j in r:
-
- m = t[50:]
- m = t[:25]
- m = t[50:55]
- m = t[:-1]
- m = t[1:]
- m = t[-10:]
- m = t[:10]
-
- m = t[50:]
- m = t[:25]
- m = t[50:55]
- m = t[:-1]
- m = t[1:]
- m = t[-10:]
- m = t[:10]
-
- m = t[50:]
- m = t[:25]
- m = t[50:55]
- m = t[:-1]
- m = t[1:]
- m = t[-10:]
- m = t[:10]
-
- m = t[50:]
- m = t[:25]
- m = t[50:55]
- m = t[:-1]
- m = t[1:]
- m = t[-10:]
- m = t[:10]
-
- m = t[50:]
- m = t[:25]
- m = t[50:55]
- m = t[:-1]
- m = t[1:]
- m = t[-10:]
- m = t[:10]
-
- m = t[50:]
- m = t[:25]
- m = t[50:55]
- m = t[:-1]
- m = t[1:]
- m = t[-10:]
- m = t[:10]
-
- m = t[50:]
- m = t[:25]
- m = t[50:55]
- m = t[:-1]
- m = t[1:]
- m = t[-10:]
- m = t[:10]
-
- m = t[50:]
- m = t[:25]
- m = t[50:55]
- m = t[:-1]
- m = t[1:]
- m = t[-10:]
- m = t[:10]
-
- m = t[50:]
- m = t[:25]
- m = t[50:55]
- m = t[:-1]
- m = t[1:]
- m = t[-10:]
- m = t[:10]
-
- m = t[50:]
- m = t[:25]
- m = t[50:55]
- m = t[:-1]
- m = t[1:]
- m = t[-10:]
- m = t[:10]
-
- m = t[50:]
- m = t[:25]
- m = t[50:55]
- m = t[:-1]
- m = t[1:]
- m = t[-10:]
- m = t[:10]
-
- m = t[50:]
- m = t[:25]
- m = t[50:55]
- m = t[:-1]
- m = t[1:]
- m = t[-10:]
- m = t[:10]
-
- m = t[50:]
- m = t[:25]
- m = t[50:55]
- m = t[:-1]
- m = t[1:]
- m = t[-10:]
- m = t[:10]
-
- m = t[50:]
- m = t[:25]
- m = t[50:55]
- m = t[:-1]
- m = t[1:]
- m = t[-10:]
- m = t[:10]
-
- m = t[50:]
- m = t[:25]
- m = t[50:55]
- m = t[:-1]
- m = t[1:]
- m = t[-10:]
- m = t[:10]
-
- m = t[50:]
- m = t[:25]
- m = t[50:55]
- m = t[:-1]
- m = t[1:]
- m = t[-10:]
- m = t[:10]
-
- m = t[50:]
- m = t[:25]
- m = t[50:55]
- m = t[:-1]
- m = t[1:]
- m = t[-10:]
- m = t[:10]
-
- m = t[50:]
- m = t[:25]
- m = t[50:55]
- m = t[:-1]
- m = t[1:]
- m = t[-10:]
- m = t[:10]
-
- m = t[50:]
- m = t[:25]
- m = t[50:55]
- m = t[:-1]
- m = t[1:]
- m = t[-10:]
- m = t[:10]
-
- m = t[50:]
- m = t[:25]
- m = t[50:55]
- m = t[:-1]
- m = t[1:]
- m = t[-10:]
- m = t[:10]
-
- m = t[50:]
- m = t[:25]
- m = t[50:55]
- m = t[:-1]
- m = t[1:]
- m = t[-10:]
- m = t[:10]
-
- m = t[50:]
- m = t[:25]
- m = t[50:55]
- m = t[:-1]
- m = t[1:]
- m = t[-10:]
- m = t[:10]
-
- m = t[50:]
- m = t[:25]
- m = t[50:55]
- m = t[:-1]
- m = t[1:]
- m = t[-10:]
- m = t[:10]
-
- m = t[50:]
- m = t[:25]
- m = t[50:55]
- m = t[:-1]
- m = t[1:]
- m = t[-10:]
- m = t[:10]
-
- m = t[50:]
- m = t[:25]
- m = t[50:55]
- m = t[:-1]
- m = t[1:]
- m = t[-10:]
- m = t[:10]
-
- m = t[50:]
- m = t[:25]
- m = t[50:55]
- m = t[:-1]
- m = t[1:]
- m = t[-10:]
- m = t[:10]
-
- m = t[50:]
- m = t[:25]
- m = t[50:55]
- m = t[:-1]
- m = t[1:]
- m = t[-10:]
- m = t[:10]
-
- m = t[50:]
- m = t[:25]
- m = t[50:55]
- m = t[:-1]
- m = t[1:]
- m = t[-10:]
- m = t[:10]
-
- m = t[50:]
- m = t[:25]
- m = t[50:55]
- m = t[:-1]
- m = t[1:]
- m = t[-10:]
- m = t[:10]
-
- m = t[50:]
- m = t[:25]
- m = t[50:55]
- m = t[:-1]
- m = t[1:]
- m = t[-10:]
- m = t[:10]
-
- def calibrate(self):
-
- r = range(25)
- t = tuple(range(100))
-
- for i in range(self.rounds):
- for j in r:
- pass
-
-class SmallTuples(Test):
-
- version = 2.0
- operations = 5*(1 + 3 + 6 + 2)
- rounds = 90000
-
- def test(self):
-
- for i in range(self.rounds):
-
- t = (1,2,3,4,5,6)
-
- a,b,c,d,e,f = t
- a,b,c,d,e,f = t
- a,b,c,d,e,f = t
-
- a,b,c = t[:3]
- a,b,c = t[:3]
- a,b,c = t[:3]
- a,b,c = t[:3]
- a,b,c = t[:3]
- a,b,c = t[:3]
-
- l = list(t)
- t = tuple(l)
-
- t = (1,2,3,4,5,6)
-
- a,b,c,d,e,f = t
- a,b,c,d,e,f = t
- a,b,c,d,e,f = t
-
- a,b,c = t[:3]
- a,b,c = t[:3]
- a,b,c = t[:3]
- a,b,c = t[:3]
- a,b,c = t[:3]
- a,b,c = t[:3]
-
- l = list(t)
- t = tuple(l)
-
- t = (1,2,3,4,5,6)
-
- a,b,c,d,e,f = t
- a,b,c,d,e,f = t
- a,b,c,d,e,f = t
-
- a,b,c = t[:3]
- a,b,c = t[:3]
- a,b,c = t[:3]
- a,b,c = t[:3]
- a,b,c = t[:3]
- a,b,c = t[:3]
-
- l = list(t)
- t = tuple(l)
-
- t = (1,2,3,4,5,6)
-
- a,b,c,d,e,f = t
- a,b,c,d,e,f = t
- a,b,c,d,e,f = t
-
- a,b,c = t[:3]
- a,b,c = t[:3]
- a,b,c = t[:3]
- a,b,c = t[:3]
- a,b,c = t[:3]
- a,b,c = t[:3]
-
- l = list(t)
- t = tuple(l)
-
- t = (1,2,3,4,5,6)
-
- a,b,c,d,e,f = t
- a,b,c,d,e,f = t
- a,b,c,d,e,f = t
-
- a,b,c = t[:3]
- a,b,c = t[:3]
- a,b,c = t[:3]
- a,b,c = t[:3]
- a,b,c = t[:3]
- a,b,c = t[:3]
-
- l = list(t)
- t = tuple(l)
-
- def calibrate(self):
-
- for i in range(self.rounds):
- pass
diff --git a/Tools/pybench/Unicode.py b/Tools/pybench/Unicode.py
deleted file mode 100644
index b17a7c3dd5..0000000000
--- a/Tools/pybench/Unicode.py
+++ /dev/null
@@ -1,541 +0,0 @@
-try:
- unicode
-except NameError:
- raise ImportError
-
-from pybench import Test
-
-class ConcatUnicode(Test):
-
- version = 2.0
- operations = 10 * 5
- rounds = 60000
-
- def test(self):
-
- # Make sure the strings are *not* interned
- s = unicode(u''.join(map(str,range(100))))
- t = unicode(u''.join(map(str,range(1,101))))
-
- for i in range(self.rounds):
- t + s
- t + s
- t + s
- t + s
- t + s
-
- t + s
- t + s
- t + s
- t + s
- t + s
-
- t + s
- t + s
- t + s
- t + s
- t + s
-
- t + s
- t + s
- t + s
- t + s
- t + s
-
- t + s
- t + s
- t + s
- t + s
- t + s
-
- t + s
- t + s
- t + s
- t + s
- t + s
-
- t + s
- t + s
- t + s
- t + s
- t + s
-
- t + s
- t + s
- t + s
- t + s
- t + s
-
- t + s
- t + s
- t + s
- t + s
- t + s
-
- t + s
- t + s
- t + s
- t + s
- t + s
-
- def calibrate(self):
-
- s = unicode(u''.join(map(str,range(100))))
- t = unicode(u''.join(map(str,range(1,101))))
-
- for i in range(self.rounds):
- pass
-
-
-class CompareUnicode(Test):
-
- version = 2.0
- operations = 10 * 5
- rounds = 150000
-
- def test(self):
-
- # Make sure the strings are *not* interned
- s = unicode(u''.join(map(str,range(10))))
- t = unicode(u''.join(map(str,range(10))) + "abc")
-
- for i in range(self.rounds):
- t < s
- t > s
- t == s
- t > s
- t < s
-
- t < s
- t > s
- t == s
- t > s
- t < s
-
- t < s
- t > s
- t == s
- t > s
- t < s
-
- t < s
- t > s
- t == s
- t > s
- t < s
-
- t < s
- t > s
- t == s
- t > s
- t < s
-
- t < s
- t > s
- t == s
- t > s
- t < s
-
- t < s
- t > s
- t == s
- t > s
- t < s
-
- t < s
- t > s
- t == s
- t > s
- t < s
-
- t < s
- t > s
- t == s
- t > s
- t < s
-
- t < s
- t > s
- t == s
- t > s
- t < s
-
- def calibrate(self):
-
- s = unicode(u''.join(map(str,range(10))))
- t = unicode(u''.join(map(str,range(10))) + "abc")
-
- for i in range(self.rounds):
- pass
-
-
-class CreateUnicodeWithConcat(Test):
-
- version = 2.0
- operations = 10 * 5
- rounds = 80000
-
- def test(self):
-
- for i in range(self.rounds):
- s = u'om'
- s = s + u'xbx'
- s = s + u'xcx'
- s = s + u'xdx'
- s = s + u'xex'
-
- s = s + u'xax'
- s = s + u'xbx'
- s = s + u'xcx'
- s = s + u'xdx'
- s = s + u'xex'
-
- s = s + u'xax'
- s = s + u'xbx'
- s = s + u'xcx'
- s = s + u'xdx'
- s = s + u'xex'
-
- s = s + u'xax'
- s = s + u'xbx'
- s = s + u'xcx'
- s = s + u'xdx'
- s = s + u'xex'
-
- s = s + u'xax'
- s = s + u'xbx'
- s = s + u'xcx'
- s = s + u'xdx'
- s = s + u'xex'
-
- s = s + u'xax'
- s = s + u'xbx'
- s = s + u'xcx'
- s = s + u'xdx'
- s = s + u'xex'
-
- s = s + u'xax'
- s = s + u'xbx'
- s = s + u'xcx'
- s = s + u'xdx'
- s = s + u'xex'
-
- s = s + u'xax'
- s = s + u'xbx'
- s = s + u'xcx'
- s = s + u'xdx'
- s = s + u'xex'
-
- s = s + u'xax'
- s = s + u'xbx'
- s = s + u'xcx'
- s = s + u'xdx'
- s = s + u'xex'
-
- s = s + u'xax'
- s = s + u'xbx'
- s = s + u'xcx'
- s = s + u'xdx'
- s = s + u'xex'
-
- def calibrate(self):
-
- for i in range(self.rounds):
- pass
-
-
-class UnicodeSlicing(Test):
-
- version = 2.0
- operations = 5 * 7
- rounds = 140000
-
- def test(self):
-
- s = unicode(u''.join(map(str,range(100))))
-
- for i in range(self.rounds):
-
- s[50:]
- s[:25]
- s[50:55]
- s[-1:]
- s[:1]
- s[2:]
- s[11:-11]
-
- s[50:]
- s[:25]
- s[50:55]
- s[-1:]
- s[:1]
- s[2:]
- s[11:-11]
-
- s[50:]
- s[:25]
- s[50:55]
- s[-1:]
- s[:1]
- s[2:]
- s[11:-11]
-
- s[50:]
- s[:25]
- s[50:55]
- s[-1:]
- s[:1]
- s[2:]
- s[11:-11]
-
- s[50:]
- s[:25]
- s[50:55]
- s[-1:]
- s[:1]
- s[2:]
- s[11:-11]
-
- def calibrate(self):
-
- s = unicode(u''.join(map(str,range(100))))
-
- for i in range(self.rounds):
- pass
-
-### String methods
-
-class UnicodeMappings(Test):
-
- version = 2.0
- operations = 3 * (5 + 4 + 2 + 1)
- rounds = 10000
-
- def test(self):
-
- s = u''.join(map(unichr,range(20)))
- t = u''.join(map(unichr,range(100)))
- u = u''.join(map(unichr,range(500)))
- v = u''.join(map(unichr,range(1000)))
-
- for i in range(self.rounds):
-
- s.lower()
- s.lower()
- s.lower()
- s.lower()
- s.lower()
-
- s.upper()
- s.upper()
- s.upper()
- s.upper()
- s.upper()
-
- s.title()
- s.title()
- s.title()
- s.title()
- s.title()
-
- t.lower()
- t.lower()
- t.lower()
- t.lower()
-
- t.upper()
- t.upper()
- t.upper()
- t.upper()
-
- t.title()
- t.title()
- t.title()
- t.title()
-
- u.lower()
- u.lower()
-
- u.upper()
- u.upper()
-
- u.title()
- u.title()
-
- v.lower()
-
- v.upper()
-
- v.title()
-
- def calibrate(self):
-
- s = u''.join(map(unichr,range(20)))
- t = u''.join(map(unichr,range(100)))
- u = u''.join(map(unichr,range(500)))
- v = u''.join(map(unichr,range(1000)))
-
- for i in range(self.rounds):
- pass
-
-class UnicodePredicates(Test):
-
- version = 2.0
- operations = 5 * 9
- rounds = 120000
-
- def test(self):
-
- data = (u'abc', u'123', u' ', u'\u1234\u2345\u3456', u'\uFFFF'*10)
- len_data = len(data)
-
- for i in range(self.rounds):
- s = data[i % len_data]
-
- s.isalnum()
- s.isalpha()
- s.isdecimal()
- s.isdigit()
- s.islower()
- s.isnumeric()
- s.isspace()
- s.istitle()
- s.isupper()
-
- s.isalnum()
- s.isalpha()
- s.isdecimal()
- s.isdigit()
- s.islower()
- s.isnumeric()
- s.isspace()
- s.istitle()
- s.isupper()
-
- s.isalnum()
- s.isalpha()
- s.isdecimal()
- s.isdigit()
- s.islower()
- s.isnumeric()
- s.isspace()
- s.istitle()
- s.isupper()
-
- s.isalnum()
- s.isalpha()
- s.isdecimal()
- s.isdigit()
- s.islower()
- s.isnumeric()
- s.isspace()
- s.istitle()
- s.isupper()
-
- s.isalnum()
- s.isalpha()
- s.isdecimal()
- s.isdigit()
- s.islower()
- s.isnumeric()
- s.isspace()
- s.istitle()
- s.isupper()
-
- def calibrate(self):
-
- data = (u'abc', u'123', u' ', u'\u1234\u2345\u3456', u'\uFFFF'*10)
- len_data = len(data)
-
- for i in range(self.rounds):
- s = data[i % len_data]
-
-try:
- import unicodedata
-except ImportError:
- pass
-else:
- class UnicodeProperties(Test):
-
- version = 2.0
- operations = 5 * 8
- rounds = 100000
-
- def test(self):
-
- data = (u'a', u'1', u' ', u'\u1234', u'\uFFFF')
- len_data = len(data)
- digit = unicodedata.digit
- numeric = unicodedata.numeric
- decimal = unicodedata.decimal
- category = unicodedata.category
- bidirectional = unicodedata.bidirectional
- decomposition = unicodedata.decomposition
- mirrored = unicodedata.mirrored
- combining = unicodedata.combining
-
- for i in range(self.rounds):
-
- c = data[i % len_data]
-
- digit(c, None)
- numeric(c, None)
- decimal(c, None)
- category(c)
- bidirectional(c)
- decomposition(c)
- mirrored(c)
- combining(c)
-
- digit(c, None)
- numeric(c, None)
- decimal(c, None)
- category(c)
- bidirectional(c)
- decomposition(c)
- mirrored(c)
- combining(c)
-
- digit(c, None)
- numeric(c, None)
- decimal(c, None)
- category(c)
- bidirectional(c)
- decomposition(c)
- mirrored(c)
- combining(c)
-
- digit(c, None)
- numeric(c, None)
- decimal(c, None)
- category(c)
- bidirectional(c)
- decomposition(c)
- mirrored(c)
- combining(c)
-
- digit(c, None)
- numeric(c, None)
- decimal(c, None)
- category(c)
- bidirectional(c)
- decomposition(c)
- mirrored(c)
- combining(c)
-
- def calibrate(self):
-
- data = (u'a', u'1', u' ', u'\u1234', u'\uFFFF')
- len_data = len(data)
- digit = unicodedata.digit
- numeric = unicodedata.numeric
- decimal = unicodedata.decimal
- category = unicodedata.category
- bidirectional = unicodedata.bidirectional
- decomposition = unicodedata.decomposition
- mirrored = unicodedata.mirrored
- combining = unicodedata.combining
-
- for i in range(self.rounds):
-
- c = data[i % len_data]
diff --git a/Tools/pybench/With.py b/Tools/pybench/With.py
deleted file mode 100644
index 30cd3c2c8a..0000000000
--- a/Tools/pybench/With.py
+++ /dev/null
@@ -1,189 +0,0 @@
-from pybench import Test
-
-class WithFinally(Test):
-
- version = 2.0
- operations = 20
- rounds = 80000
-
- class ContextManager(object):
- def __enter__(self):
- pass
- def __exit__(self, exc, val, tb):
- pass
-
- def test(self):
-
- cm = self.ContextManager()
-
- for i in range(self.rounds):
- with cm: pass
- with cm: pass
- with cm: pass
- with cm: pass
- with cm: pass
- with cm: pass
- with cm: pass
- with cm: pass
- with cm: pass
- with cm: pass
- with cm: pass
- with cm: pass
- with cm: pass
- with cm: pass
- with cm: pass
- with cm: pass
- with cm: pass
- with cm: pass
- with cm: pass
- with cm: pass
-
- def calibrate(self):
-
- cm = self.ContextManager()
-
- for i in range(self.rounds):
- pass
-
-
-class TryFinally(Test):
-
- version = 2.0
- operations = 20
- rounds = 80000
-
- class ContextManager(object):
- def __enter__(self):
- pass
- def __exit__(self):
- # "Context manager" objects used just for their cleanup
- # actions in finally blocks usually don't have parameters.
- pass
-
- def test(self):
-
- cm = self.ContextManager()
-
- for i in range(self.rounds):
- cm.__enter__()
- try: pass
- finally: cm.__exit__()
-
- cm.__enter__()
- try: pass
- finally: cm.__exit__()
-
- cm.__enter__()
- try: pass
- finally: cm.__exit__()
-
- cm.__enter__()
- try: pass
- finally: cm.__exit__()
-
- cm.__enter__()
- try: pass
- finally: cm.__exit__()
-
- cm.__enter__()
- try: pass
- finally: cm.__exit__()
-
- cm.__enter__()
- try: pass
- finally: cm.__exit__()
-
- cm.__enter__()
- try: pass
- finally: cm.__exit__()
-
- cm.__enter__()
- try: pass
- finally: cm.__exit__()
-
- cm.__enter__()
- try: pass
- finally: cm.__exit__()
-
- cm.__enter__()
- try: pass
- finally: cm.__exit__()
-
- cm.__enter__()
- try: pass
- finally: cm.__exit__()
-
- cm.__enter__()
- try: pass
- finally: cm.__exit__()
-
- cm.__enter__()
- try: pass
- finally: cm.__exit__()
-
- cm.__enter__()
- try: pass
- finally: cm.__exit__()
-
- cm.__enter__()
- try: pass
- finally: cm.__exit__()
-
- cm.__enter__()
- try: pass
- finally: cm.__exit__()
-
- cm.__enter__()
- try: pass
- finally: cm.__exit__()
-
- cm.__enter__()
- try: pass
- finally: cm.__exit__()
-
- cm.__enter__()
- try: pass
- finally: cm.__exit__()
-
- def calibrate(self):
-
- cm = self.ContextManager()
-
- for i in range(self.rounds):
- pass
-
-
-class WithRaiseExcept(Test):
-
- version = 2.0
- operations = 2 + 3 + 3
- rounds = 100000
-
- class BlockExceptions(object):
- def __enter__(self):
- pass
- def __exit__(self, exc, val, tb):
- return True
-
- def test(self):
-
- error = ValueError
- be = self.BlockExceptions()
-
- for i in range(self.rounds):
- with be: raise error
- with be: raise error
- with be: raise error("something")
- with be: raise error("something")
- with be: raise error("something")
- with be: raise error("something")
- with be: raise error("something")
- with be: raise error("something")
-
- def calibrate(self):
-
- error = ValueError
- be = self.BlockExceptions()
-
- for i in range(self.rounds):
- pass
diff --git a/Tools/pybench/clockres.py b/Tools/pybench/clockres.py
deleted file mode 100644
index d7f1ac8c93..0000000000
--- a/Tools/pybench/clockres.py
+++ /dev/null
@@ -1,42 +0,0 @@
-#!/usr/bin/env python
-
-""" clockres - calculates the resolution in seconds of a given timer.
-
- Copyright (c) 2006, Marc-Andre Lemburg (mal@egenix.com). See the
- documentation for further information on copyrights, or contact
- the author. All Rights Reserved.
-
-"""
-import time
-
-TEST_TIME = 1.0
-
-def clockres(timer):
- d = {}
- wallclock = time.time
- start = wallclock()
- stop = wallclock() + TEST_TIME
- spin_loops = range(1000)
- while 1:
- now = wallclock()
- if now >= stop:
- break
- for i in spin_loops:
- d[timer()] = 1
- values = sorted(d.keys())
- min_diff = TEST_TIME
- for i in range(len(values) - 1):
- diff = values[i+1] - values[i]
- if diff < min_diff:
- min_diff = diff
- return min_diff
-
-if __name__ == '__main__':
- print('Clock resolution of various timer implementations:')
- print('time.clock: %10.3fus' % (clockres(time.clock) * 1e6))
- print('time.time: %10.3fus' % (clockres(time.time) * 1e6))
- try:
- import systimes
- print('systimes.processtime: %10.3fus' % (clockres(systimes.processtime) * 1e6))
- except ImportError:
- pass
diff --git a/Tools/pybench/package/__init__.py b/Tools/pybench/package/__init__.py
deleted file mode 100644
index e69de29bb2..0000000000
--- a/Tools/pybench/package/__init__.py
+++ /dev/null
diff --git a/Tools/pybench/package/submodule.py b/Tools/pybench/package/submodule.py
deleted file mode 100644
index e69de29bb2..0000000000
--- a/Tools/pybench/package/submodule.py
+++ /dev/null
diff --git a/Tools/pybench/pybench.py b/Tools/pybench/pybench.py
deleted file mode 100755
index 942f56d292..0000000000
--- a/Tools/pybench/pybench.py
+++ /dev/null
@@ -1,974 +0,0 @@
-#!/usr/local/bin/python -O
-
-""" A Python Benchmark Suite
-
-"""
-# Note: Please keep this module compatible to Python 2.6.
-#
-# Tests may include features in later Python versions, but these
-# should then be embedded in try-except clauses in the configuration
-# module Setup.py.
-#
-
-from __future__ import print_function
-
-# pybench Copyright
-__copyright__ = """\
-Copyright (c), 1997-2006, Marc-Andre Lemburg (mal@lemburg.com)
-Copyright (c), 2000-2006, eGenix.com Software GmbH (info@egenix.com)
-
- All Rights Reserved.
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee or royalty is hereby
-granted, provided that the above copyright notice appear in all copies
-and that both that copyright notice and this permission notice appear
-in supporting documentation or portions thereof, including
-modifications, that you make.
-
-THE AUTHOR MARC-ANDRE LEMBURG DISCLAIMS ALL WARRANTIES WITH REGARD TO
-THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
-FITNESS, IN NO EVENT SHALL THE AUTHOR 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 !
-"""
-
-import sys
-import time
-import platform
-from CommandLine import *
-
-try:
- import cPickle
- pickle = cPickle
-except ImportError:
- import pickle
-
-# Version number; version history: see README file !
-__version__ = '2.1'
-
-### Constants
-
-# Second fractions
-MILLI_SECONDS = 1e3
-MICRO_SECONDS = 1e6
-
-# Percent unit
-PERCENT = 100
-
-# Horizontal line length
-LINE = 79
-
-# Minimum test run-time
-MIN_TEST_RUNTIME = 1e-3
-
-# Number of calibration runs to use for calibrating the tests
-CALIBRATION_RUNS = 20
-
-# Number of calibration loops to run for each calibration run
-CALIBRATION_LOOPS = 20
-
-# Allow skipping calibration ?
-ALLOW_SKIPPING_CALIBRATION = 1
-
-# Timer types
-TIMER_TIME_TIME = 'time.time'
-TIMER_TIME_PROCESS_TIME = 'time.process_time'
-TIMER_TIME_PERF_COUNTER = 'time.perf_counter'
-TIMER_TIME_CLOCK = 'time.clock'
-TIMER_SYSTIMES_PROCESSTIME = 'systimes.processtime'
-
-# Choose platform default timer
-if hasattr(time, 'perf_counter'):
- TIMER_PLATFORM_DEFAULT = TIMER_TIME_PERF_COUNTER
-elif sys.platform[:3] == 'win':
- # On WinXP this has 2.5ms resolution
- TIMER_PLATFORM_DEFAULT = TIMER_TIME_CLOCK
-else:
- # On Linux this has 1ms resolution
- TIMER_PLATFORM_DEFAULT = TIMER_TIME_TIME
-
-# Print debug information ?
-_debug = 0
-
-### Helpers
-
-def get_timer(timertype):
-
- if timertype == TIMER_TIME_TIME:
- return time.time
- elif timertype == TIMER_TIME_PROCESS_TIME:
- return time.process_time
- elif timertype == TIMER_TIME_PERF_COUNTER:
- return time.perf_counter
- elif timertype == TIMER_TIME_CLOCK:
- return time.clock
- elif timertype == TIMER_SYSTIMES_PROCESSTIME:
- import systimes
- return systimes.processtime
- else:
- raise TypeError('unknown timer type: %s' % timertype)
-
-def get_machine_details():
-
- if _debug:
- print('Getting machine details...')
- buildno, builddate = platform.python_build()
- python = platform.python_version()
- # XXX this is now always UCS4, maybe replace it with 'PEP393' in 3.3+?
- if sys.maxunicode == 65535:
- # UCS2 build (standard)
- unitype = 'UCS2'
- else:
- # UCS4 build (most recent Linux distros)
- unitype = 'UCS4'
- bits, linkage = platform.architecture()
- return {
- 'platform': platform.platform(),
- 'processor': platform.processor(),
- 'executable': sys.executable,
- 'implementation': getattr(platform, 'python_implementation',
- lambda:'n/a')(),
- 'python': platform.python_version(),
- 'compiler': platform.python_compiler(),
- 'buildno': buildno,
- 'builddate': builddate,
- 'unicode': unitype,
- 'bits': bits,
- }
-
-def print_machine_details(d, indent=''):
-
- l = ['Machine Details:',
- ' Platform ID: %s' % d.get('platform', 'n/a'),
- ' Processor: %s' % d.get('processor', 'n/a'),
- '',
- 'Python:',
- ' Implementation: %s' % d.get('implementation', 'n/a'),
- ' Executable: %s' % d.get('executable', 'n/a'),
- ' Version: %s' % d.get('python', 'n/a'),
- ' Compiler: %s' % d.get('compiler', 'n/a'),
- ' Bits: %s' % d.get('bits', 'n/a'),
- ' Build: %s (#%s)' % (d.get('builddate', 'n/a'),
- d.get('buildno', 'n/a')),
- ' Unicode: %s' % d.get('unicode', 'n/a'),
- ]
- joiner = '\n' + indent
- print(indent + joiner.join(l) + '\n')
-
-### Test baseclass
-
-class Test:
-
- """ All test must have this class as baseclass. It provides
- the necessary interface to the benchmark machinery.
-
- The tests must set .rounds to a value high enough to let the
- test run between 20-50 seconds. This is needed because
- clock()-timing only gives rather inaccurate values (on Linux,
- for example, it is accurate to a few hundreths of a
- second). If you don't want to wait that long, use a warp
- factor larger than 1.
-
- It is also important to set the .operations variable to a
- value representing the number of "virtual operations" done per
- call of .run().
-
- If you change a test in some way, don't forget to increase
- its version number.
-
- """
-
- ### Instance variables that each test should override
-
- # Version number of the test as float (x.yy); this is important
- # for comparisons of benchmark runs - tests with unequal version
- # number will not get compared.
- version = 2.1
-
- # The number of abstract operations done in each round of the
- # test. An operation is the basic unit of what you want to
- # measure. The benchmark will output the amount of run-time per
- # operation. Note that in order to raise the measured timings
- # significantly above noise level, it is often required to repeat
- # sets of operations more than once per test round. The measured
- # overhead per test round should be less than 1 second.
- operations = 1
-
- # Number of rounds to execute per test run. This should be
- # adjusted to a figure that results in a test run-time of between
- # 1-2 seconds.
- rounds = 100000
-
- ### Internal variables
-
- # Mark this class as implementing a test
- is_a_test = 1
-
- # Last timing: (real, run, overhead)
- last_timing = (0.0, 0.0, 0.0)
-
- # Warp factor to use for this test
- warp = 1
-
- # Number of calibration runs to use
- calibration_runs = CALIBRATION_RUNS
-
- # List of calibration timings
- overhead_times = None
-
- # List of test run timings
- times = []
-
- # Timer used for the benchmark
- timer = TIMER_PLATFORM_DEFAULT
-
- def __init__(self, warp=None, calibration_runs=None, timer=None):
-
- # Set parameters
- if warp is not None:
- self.rounds = int(self.rounds / warp)
- if self.rounds == 0:
- raise ValueError('warp factor set too high')
- self.warp = warp
- if calibration_runs is not None:
- if (not ALLOW_SKIPPING_CALIBRATION and
- calibration_runs < 1):
- raise ValueError('at least one calibration run is required')
- self.calibration_runs = calibration_runs
- if timer is not None:
- self.timer = timer
-
- # Init variables
- self.times = []
- self.overhead_times = []
-
- # We want these to be in the instance dict, so that pickle
- # saves them
- self.version = self.version
- self.operations = self.operations
- self.rounds = self.rounds
-
- def get_timer(self):
-
- """ Return the timer function to use for the test.
-
- """
- return get_timer(self.timer)
-
- def compatible(self, other):
-
- """ Return 1/0 depending on whether the test is compatible
- with the other Test instance or not.
-
- """
- if self.version != other.version:
- return 0
- if self.rounds != other.rounds:
- return 0
- return 1
-
- def calibrate_test(self):
-
- if self.calibration_runs == 0:
- self.overhead_times = [0.0]
- return
-
- calibrate = self.calibrate
- timer = self.get_timer()
- calibration_loops = range(CALIBRATION_LOOPS)
-
- # Time the calibration loop overhead
- prep_times = []
- for i in range(self.calibration_runs):
- t = timer()
- for i in calibration_loops:
- pass
- t = timer() - t
- prep_times.append(t / CALIBRATION_LOOPS)
- min_prep_time = min(prep_times)
- if _debug:
- print()
- print('Calib. prep time = %.6fms' % (
- min_prep_time * MILLI_SECONDS))
-
- # Time the calibration runs (doing CALIBRATION_LOOPS loops of
- # .calibrate() method calls each)
- for i in range(self.calibration_runs):
- t = timer()
- for i in calibration_loops:
- calibrate()
- t = timer() - t
- self.overhead_times.append(t / CALIBRATION_LOOPS
- - min_prep_time)
-
- # Check the measured times
- min_overhead = min(self.overhead_times)
- max_overhead = max(self.overhead_times)
- if _debug:
- print('Calib. overhead time = %.6fms' % (
- min_overhead * MILLI_SECONDS))
- if min_overhead < 0.0:
- raise ValueError('calibration setup did not work')
- if max_overhead - min_overhead > 0.1:
- raise ValueError(
- 'overhead calibration timing range too inaccurate: '
- '%r - %r' % (min_overhead, max_overhead))
-
- def run(self):
-
- """ Run the test in two phases: first calibrate, then
- do the actual test. Be careful to keep the calibration
- timing low w/r to the test timing.
-
- """
- test = self.test
- timer = self.get_timer()
-
- # Get calibration
- min_overhead = min(self.overhead_times)
-
- # Test run
- t = timer()
- test()
- t = timer() - t
- if t < MIN_TEST_RUNTIME:
- raise ValueError('warp factor too high: '
- 'test times are < 10ms')
- eff_time = t - min_overhead
- if eff_time < 0:
- raise ValueError('wrong calibration')
- self.last_timing = (eff_time, t, min_overhead)
- self.times.append(eff_time)
-
- def calibrate(self):
-
- """ Calibrate the test.
-
- This method should execute everything that is needed to
- setup and run the test - except for the actual operations
- that you intend to measure. pybench uses this method to
- measure the test implementation overhead.
-
- """
- return
-
- def test(self):
-
- """ Run the test.
-
- The test needs to run self.rounds executing
- self.operations number of operations each.
-
- """
- return
-
- def stat(self):
-
- """ Return test run statistics as tuple:
-
- (minimum run time,
- average run time,
- total run time,
- average time per operation,
- minimum overhead time)
-
- """
- runs = len(self.times)
- if runs == 0:
- return 0.0, 0.0, 0.0, 0.0
- min_time = min(self.times)
- total_time = sum(self.times)
- avg_time = total_time / float(runs)
- operation_avg = total_time / float(runs
- * self.rounds
- * self.operations)
- if self.overhead_times:
- min_overhead = min(self.overhead_times)
- else:
- min_overhead = self.last_timing[2]
- return min_time, avg_time, total_time, operation_avg, min_overhead
-
-### Load Setup
-
-# This has to be done after the definition of the Test class, since
-# the Setup module will import subclasses using this class.
-
-import Setup
-
-### Benchmark base class
-
-class Benchmark:
-
- # Name of the benchmark
- name = ''
-
- # Number of benchmark rounds to run
- rounds = 1
-
- # Warp factor use to run the tests
- warp = 1 # Warp factor
-
- # Average benchmark round time
- roundtime = 0
-
- # Benchmark version number as float x.yy
- version = 2.1
-
- # Produce verbose output ?
- verbose = 0
-
- # Dictionary with the machine details
- machine_details = None
-
- # Timer used for the benchmark
- timer = TIMER_PLATFORM_DEFAULT
-
- def __init__(self, name, verbose=None, timer=None, warp=None,
- calibration_runs=None):
-
- if name:
- self.name = name
- else:
- self.name = '%04i-%02i-%02i %02i:%02i:%02i' % \
- (time.localtime(time.time())[:6])
- if verbose is not None:
- self.verbose = verbose
- if timer is not None:
- self.timer = timer
- if warp is not None:
- self.warp = warp
- if calibration_runs is not None:
- self.calibration_runs = calibration_runs
-
- # Init vars
- self.tests = {}
- if _debug:
- print('Getting machine details...')
- self.machine_details = get_machine_details()
-
- # Make .version an instance attribute to have it saved in the
- # Benchmark pickle
- self.version = self.version
-
- def get_timer(self):
-
- """ Return the timer function to use for the test.
-
- """
- return get_timer(self.timer)
-
- def compatible(self, other):
-
- """ Return 1/0 depending on whether the benchmark is
- compatible with the other Benchmark instance or not.
-
- """
- if self.version != other.version:
- return 0
- if (self.machine_details == other.machine_details and
- self.timer != other.timer):
- return 0
- if (self.calibration_runs == 0 and
- other.calibration_runs != 0):
- return 0
- if (self.calibration_runs != 0 and
- other.calibration_runs == 0):
- return 0
- return 1
-
- def load_tests(self, setupmod, limitnames=None):
-
- # Add tests
- if self.verbose:
- print('Searching for tests ...')
- print('--------------------------------------')
- for testclass in setupmod.__dict__.values():
- if not hasattr(testclass, 'is_a_test'):
- continue
- name = testclass.__name__
- if name == 'Test':
- continue
- if (limitnames is not None and
- limitnames.search(name) is None):
- continue
- self.tests[name] = testclass(
- warp=self.warp,
- calibration_runs=self.calibration_runs,
- timer=self.timer)
- l = sorted(self.tests)
- if self.verbose:
- for name in l:
- print(' %s' % name)
- print('--------------------------------------')
- print(' %i tests found' % len(l))
- print()
-
- def calibrate(self):
-
- print('Calibrating tests. Please wait...', end=' ')
- sys.stdout.flush()
- if self.verbose:
- print()
- print()
- print('Test min max')
- print('-' * LINE)
- tests = sorted(self.tests.items())
- for i in range(len(tests)):
- name, test = tests[i]
- test.calibrate_test()
- if self.verbose:
- print('%30s: %6.3fms %6.3fms' % \
- (name,
- min(test.overhead_times) * MILLI_SECONDS,
- max(test.overhead_times) * MILLI_SECONDS))
- if self.verbose:
- print()
- print('Done with the calibration.')
- else:
- print('done.')
- print()
-
- def run(self):
-
- tests = sorted(self.tests.items())
- timer = self.get_timer()
- print('Running %i round(s) of the suite at warp factor %i:' % \
- (self.rounds, self.warp))
- print()
- self.roundtimes = []
- for i in range(self.rounds):
- if self.verbose:
- print(' Round %-25i effective absolute overhead' % (i+1))
- total_eff_time = 0.0
- for j in range(len(tests)):
- name, test = tests[j]
- if self.verbose:
- print('%30s:' % name, end=' ')
- test.run()
- (eff_time, abs_time, min_overhead) = test.last_timing
- total_eff_time = total_eff_time + eff_time
- if self.verbose:
- print(' %5.0fms %5.0fms %7.3fms' % \
- (eff_time * MILLI_SECONDS,
- abs_time * MILLI_SECONDS,
- min_overhead * MILLI_SECONDS))
- self.roundtimes.append(total_eff_time)
- if self.verbose:
- print(' '
- ' ------------------------------')
- print(' '
- ' Totals: %6.0fms' %
- (total_eff_time * MILLI_SECONDS))
- print()
- else:
- print('* Round %i done in %.3f seconds.' % (i+1,
- total_eff_time))
- print()
-
- def stat(self):
-
- """ Return benchmark run statistics as tuple:
-
- (minimum round time,
- average round time,
- maximum round time)
-
- XXX Currently not used, since the benchmark does test
- statistics across all rounds.
-
- """
- runs = len(self.roundtimes)
- if runs == 0:
- return 0.0, 0.0
- min_time = min(self.roundtimes)
- total_time = sum(self.roundtimes)
- avg_time = total_time / float(runs)
- max_time = max(self.roundtimes)
- return (min_time, avg_time, max_time)
-
- def print_header(self, title='Benchmark'):
-
- print('-' * LINE)
- print('%s: %s' % (title, self.name))
- print('-' * LINE)
- print()
- print(' Rounds: %s' % self.rounds)
- print(' Warp: %s' % self.warp)
- print(' Timer: %s' % self.timer)
- print()
- if self.machine_details:
- print_machine_details(self.machine_details, indent=' ')
- print()
-
- def print_benchmark(self, hidenoise=0, limitnames=None):
-
- print('Test '
- ' minimum average operation overhead')
- print('-' * LINE)
- tests = sorted(self.tests.items())
- total_min_time = 0.0
- total_avg_time = 0.0
- for name, test in tests:
- if (limitnames is not None and
- limitnames.search(name) is None):
- continue
- (min_time,
- avg_time,
- total_time,
- op_avg,
- min_overhead) = test.stat()
- total_min_time = total_min_time + min_time
- total_avg_time = total_avg_time + avg_time
- print('%30s: %5.0fms %5.0fms %6.2fus %7.3fms' % \
- (name,
- min_time * MILLI_SECONDS,
- avg_time * MILLI_SECONDS,
- op_avg * MICRO_SECONDS,
- min_overhead *MILLI_SECONDS))
- print('-' * LINE)
- print('Totals: '
- ' %6.0fms %6.0fms' %
- (total_min_time * MILLI_SECONDS,
- total_avg_time * MILLI_SECONDS,
- ))
- print()
-
- def print_comparison(self, compare_to, hidenoise=0, limitnames=None):
-
- # Check benchmark versions
- if compare_to.version != self.version:
- print('* Benchmark versions differ: '
- 'cannot compare this benchmark to "%s" !' %
- compare_to.name)
- print()
- self.print_benchmark(hidenoise=hidenoise,
- limitnames=limitnames)
- return
-
- # Print header
- compare_to.print_header('Comparing with')
- print('Test '
- ' minimum run-time average run-time')
- print(' '
- ' this other diff this other diff')
- print('-' * LINE)
-
- # Print test comparisons
- tests = sorted(self.tests.items())
- total_min_time = other_total_min_time = 0.0
- total_avg_time = other_total_avg_time = 0.0
- benchmarks_compatible = self.compatible(compare_to)
- tests_compatible = 1
- for name, test in tests:
- if (limitnames is not None and
- limitnames.search(name) is None):
- continue
- (min_time,
- avg_time,
- total_time,
- op_avg,
- min_overhead) = test.stat()
- total_min_time = total_min_time + min_time
- total_avg_time = total_avg_time + avg_time
- try:
- other = compare_to.tests[name]
- except KeyError:
- other = None
- if other is None:
- # Other benchmark doesn't include the given test
- min_diff, avg_diff = 'n/a', 'n/a'
- other_min_time = 0.0
- other_avg_time = 0.0
- tests_compatible = 0
- else:
- (other_min_time,
- other_avg_time,
- other_total_time,
- other_op_avg,
- other_min_overhead) = other.stat()
- other_total_min_time = other_total_min_time + other_min_time
- other_total_avg_time = other_total_avg_time + other_avg_time
- if (benchmarks_compatible and
- test.compatible(other)):
- # Both benchmark and tests are comparable
- min_diff = ((min_time * self.warp) /
- (other_min_time * other.warp) - 1.0)
- avg_diff = ((avg_time * self.warp) /
- (other_avg_time * other.warp) - 1.0)
- if hidenoise and abs(min_diff) < 10.0:
- min_diff = ''
- else:
- min_diff = '%+5.1f%%' % (min_diff * PERCENT)
- if hidenoise and abs(avg_diff) < 10.0:
- avg_diff = ''
- else:
- avg_diff = '%+5.1f%%' % (avg_diff * PERCENT)
- else:
- # Benchmark or tests are not comparable
- min_diff, avg_diff = 'n/a', 'n/a'
- tests_compatible = 0
- print('%30s: %5.0fms %5.0fms %7s %5.0fms %5.0fms %7s' % \
- (name,
- min_time * MILLI_SECONDS,
- other_min_time * MILLI_SECONDS * compare_to.warp / self.warp,
- min_diff,
- avg_time * MILLI_SECONDS,
- other_avg_time * MILLI_SECONDS * compare_to.warp / self.warp,
- avg_diff))
- print('-' * LINE)
-
- # Summarise test results
- if not benchmarks_compatible or not tests_compatible:
- min_diff, avg_diff = 'n/a', 'n/a'
- else:
- if other_total_min_time != 0.0:
- min_diff = '%+5.1f%%' % (
- ((total_min_time * self.warp) /
- (other_total_min_time * compare_to.warp) - 1.0) * PERCENT)
- else:
- min_diff = 'n/a'
- if other_total_avg_time != 0.0:
- avg_diff = '%+5.1f%%' % (
- ((total_avg_time * self.warp) /
- (other_total_avg_time * compare_to.warp) - 1.0) * PERCENT)
- else:
- avg_diff = 'n/a'
- print('Totals: '
- ' %5.0fms %5.0fms %7s %5.0fms %5.0fms %7s' %
- (total_min_time * MILLI_SECONDS,
- (other_total_min_time * compare_to.warp/self.warp
- * MILLI_SECONDS),
- min_diff,
- total_avg_time * MILLI_SECONDS,
- (other_total_avg_time * compare_to.warp/self.warp
- * MILLI_SECONDS),
- avg_diff
- ))
- print()
- print('(this=%s, other=%s)' % (self.name,
- compare_to.name))
- print()
-
-class PyBenchCmdline(Application):
-
- header = ("PYBENCH - a benchmark test suite for Python "
- "interpreters/compilers.")
-
- version = __version__
-
- debug = _debug
-
- options = [ArgumentOption('-n',
- 'number of rounds',
- Setup.Number_of_rounds),
- ArgumentOption('-f',
- 'save benchmark to file arg',
- ''),
- ArgumentOption('-c',
- 'compare benchmark with the one in file arg',
- ''),
- ArgumentOption('-s',
- 'show benchmark in file arg, then exit',
- ''),
- ArgumentOption('-w',
- 'set warp factor to arg',
- Setup.Warp_factor),
- ArgumentOption('-t',
- 'run only tests with names matching arg',
- ''),
- ArgumentOption('-C',
- 'set the number of calibration runs to arg',
- CALIBRATION_RUNS),
- SwitchOption('-d',
- 'hide noise in comparisons',
- 0),
- SwitchOption('-v',
- 'verbose output (not recommended)',
- 0),
- SwitchOption('--with-gc',
- 'enable garbage collection',
- 0),
- SwitchOption('--with-syscheck',
- 'use default sys check interval',
- 0),
- ArgumentOption('--timer',
- 'use given timer',
- TIMER_PLATFORM_DEFAULT),
- ]
-
- about = """\
-The normal operation is to run the suite and display the
-results. Use -f to save them for later reuse or comparisons.
-
-Available timers:
-
- time.time
- time.clock
- systimes.processtime
-
-Examples:
-
-python2.1 pybench.py -f p21.pybench
-python2.5 pybench.py -f p25.pybench
-python pybench.py -s p25.pybench -c p21.pybench
-"""
- copyright = __copyright__
-
- def main(self):
-
- rounds = self.values['-n']
- reportfile = self.values['-f']
- show_bench = self.values['-s']
- compare_to = self.values['-c']
- hidenoise = self.values['-d']
- warp = int(self.values['-w'])
- withgc = self.values['--with-gc']
- limitnames = self.values['-t']
- if limitnames:
- if _debug:
- print('* limiting test names to one with substring "%s"' % \
- limitnames)
- limitnames = re.compile(limitnames, re.I)
- else:
- limitnames = None
- verbose = self.verbose
- withsyscheck = self.values['--with-syscheck']
- calibration_runs = self.values['-C']
- timer = self.values['--timer']
-
- print('-' * LINE)
- print('PYBENCH %s' % __version__)
- print('-' * LINE)
- print('* using %s %s' % (
- getattr(platform, 'python_implementation', lambda:'Python')(),
- ' '.join(sys.version.split())))
-
- # Switch off garbage collection
- if not withgc:
- try:
- import gc
- except ImportError:
- print('* Python version doesn\'t support garbage collection')
- else:
- try:
- gc.disable()
- except NotImplementedError:
- print('* Python version doesn\'t support gc.disable')
- else:
- print('* disabled garbage collection')
-
- # "Disable" sys check interval
- if not withsyscheck:
- # Too bad the check interval uses an int instead of a long...
- value = 2147483647
- try:
- sys.setcheckinterval(value)
- except (AttributeError, NotImplementedError):
- print('* Python version doesn\'t support sys.setcheckinterval')
- else:
- print('* system check interval set to maximum: %s' % value)
-
- if timer == TIMER_SYSTIMES_PROCESSTIME:
- import systimes
- print('* using timer: systimes.processtime (%s)' % \
- systimes.SYSTIMES_IMPLEMENTATION)
- else:
- # Check that the clock function does exist
- try:
- get_timer(timer)
- except TypeError:
- print("* Error: Unknown timer: %s" % timer)
- return
-
- print('* using timer: %s' % timer)
- if hasattr(time, 'get_clock_info'):
- info = time.get_clock_info(timer[5:])
- print('* timer: resolution=%s, implementation=%s'
- % (info.resolution, info.implementation))
-
- print()
-
- if compare_to:
- try:
- f = open(compare_to,'rb')
- bench = pickle.load(f)
- bench.name = compare_to
- f.close()
- compare_to = bench
- except IOError as reason:
- print('* Error opening/reading file %s: %s' % (
- repr(compare_to),
- reason))
- compare_to = None
-
- if show_bench:
- try:
- f = open(show_bench,'rb')
- bench = pickle.load(f)
- bench.name = show_bench
- f.close()
- bench.print_header()
- if compare_to:
- bench.print_comparison(compare_to,
- hidenoise=hidenoise,
- limitnames=limitnames)
- else:
- bench.print_benchmark(hidenoise=hidenoise,
- limitnames=limitnames)
- except IOError as reason:
- print('* Error opening/reading file %s: %s' % (
- repr(show_bench),
- reason))
- print()
- return
-
- if reportfile:
- print('Creating benchmark: %s (rounds=%i, warp=%i)' % \
- (reportfile, rounds, warp))
- print()
-
- # Create benchmark object
- bench = Benchmark(reportfile,
- verbose=verbose,
- timer=timer,
- warp=warp,
- calibration_runs=calibration_runs)
- bench.rounds = rounds
- bench.load_tests(Setup, limitnames=limitnames)
- try:
- bench.calibrate()
- bench.run()
- except KeyboardInterrupt:
- print()
- print('*** KeyboardInterrupt -- Aborting')
- print()
- return
- bench.print_header()
- if compare_to:
- bench.print_comparison(compare_to,
- hidenoise=hidenoise,
- limitnames=limitnames)
- else:
- bench.print_benchmark(hidenoise=hidenoise,
- limitnames=limitnames)
-
- # Ring bell
- sys.stderr.write('\007')
-
- if reportfile:
- try:
- f = open(reportfile,'wb')
- bench.name = reportfile
- pickle.dump(bench,f)
- f.close()
- except IOError as reason:
- print('* Error opening/writing reportfile %s: %s' % (
- reportfile,
- reason))
- print()
-
-if __name__ == '__main__':
- PyBenchCmdline()
diff --git a/Tools/pybench/systimes.py b/Tools/pybench/systimes.py
deleted file mode 100755
index 5e00891fee..0000000000
--- a/Tools/pybench/systimes.py
+++ /dev/null
@@ -1,214 +0,0 @@
-#!/usr/bin/env python
-
-""" systimes() user and system timer implementations for use by
- pybench.
-
- This module implements various different strategies for measuring
- performance timings. It tries to choose the best available method
- based on the platform and available tools.
-
- On Windows, it is recommended to have the Mark Hammond win32
- package installed. Alternatively, the Thomas Heller ctypes
- packages can also be used.
-
- On Unix systems, the standard resource module provides the highest
- resolution timings. Unfortunately, it is not available on all Unix
- platforms.
-
- If no supported timing methods based on process time can be found,
- the module reverts to the highest resolution wall-clock timer
- instead. The system time part will then always be 0.0.
-
- The module exports one public API:
-
- def systimes():
-
- Return the current timer values for measuring user and system
- time as tuple of seconds (user_time, system_time).
-
- Copyright (c) 2006, Marc-Andre Lemburg (mal@egenix.com). See the
- documentation for further information on copyrights, or contact
- the author. All Rights Reserved.
-
-"""
-
-from __future__ import print_function
-
-import time, sys
-
-#
-# Note: Please keep this module compatible to Python 1.5.2.
-#
-# TODOs:
-#
-# * Add ctypes wrapper for new clock_gettime() real-time POSIX APIs;
-# these will then provide nano-second resolution where available.
-#
-# * Add a function that returns the resolution of systimes()
-# values, ie. systimesres().
-#
-
-### Choose an implementation
-
-SYSTIMES_IMPLEMENTATION = None
-USE_CTYPES_GETPROCESSTIMES = 'ctypes GetProcessTimes() wrapper'
-USE_WIN32PROCESS_GETPROCESSTIMES = 'win32process.GetProcessTimes()'
-USE_RESOURCE_GETRUSAGE = 'resource.getrusage()'
-USE_PROCESS_TIME_CLOCK = 'time.clock() (process time)'
-USE_WALL_TIME_CLOCK = 'time.clock() (wall-clock)'
-USE_WALL_TIME_TIME = 'time.time() (wall-clock)'
-
-if sys.platform[:3] == 'win':
- # Windows platform
- try:
- import win32process
- except ImportError:
- try:
- import ctypes
- except ImportError:
- # Use the wall-clock implementation time.clock(), since this
- # is the highest resolution clock available on Windows
- SYSTIMES_IMPLEMENTATION = USE_WALL_TIME_CLOCK
- else:
- SYSTIMES_IMPLEMENTATION = USE_CTYPES_GETPROCESSTIMES
- else:
- SYSTIMES_IMPLEMENTATION = USE_WIN32PROCESS_GETPROCESSTIMES
-else:
- # All other platforms
- try:
- import resource
- except ImportError:
- pass
- else:
- SYSTIMES_IMPLEMENTATION = USE_RESOURCE_GETRUSAGE
-
-# Fall-back solution
-if SYSTIMES_IMPLEMENTATION is None:
- # Check whether we can use time.clock() as approximation
- # for systimes()
- start = time.clock()
- time.sleep(0.1)
- stop = time.clock()
- if stop - start < 0.001:
- # Looks like time.clock() is usable (and measures process
- # time)
- SYSTIMES_IMPLEMENTATION = USE_PROCESS_TIME_CLOCK
- else:
- # Use wall-clock implementation time.time() since this provides
- # the highest resolution clock on most systems
- SYSTIMES_IMPLEMENTATION = USE_WALL_TIME_TIME
-
-### Implementations
-
-def getrusage_systimes():
- return resource.getrusage(resource.RUSAGE_SELF)[:2]
-
-def process_time_clock_systimes():
- return (time.clock(), 0.0)
-
-def wall_clock_clock_systimes():
- return (time.clock(), 0.0)
-
-def wall_clock_time_systimes():
- return (time.time(), 0.0)
-
-# Number of clock ticks per second for the values returned
-# by GetProcessTimes() on Windows.
-#
-# Note: Ticks returned by GetProcessTimes() are 100ns intervals on
-# Windows XP. However, the process times are only updated with every
-# clock tick and the frequency of these is somewhat lower: depending
-# on the OS version between 10ms and 15ms. Even worse, the process
-# time seems to be allocated to process currently running when the
-# clock interrupt arrives, ie. it is possible that the current time
-# slice gets accounted to a different process.
-
-WIN32_PROCESS_TIMES_TICKS_PER_SECOND = 1e7
-
-def win32process_getprocesstimes_systimes():
- d = win32process.GetProcessTimes(win32process.GetCurrentProcess())
- return (d['UserTime'] / WIN32_PROCESS_TIMES_TICKS_PER_SECOND,
- d['KernelTime'] / WIN32_PROCESS_TIMES_TICKS_PER_SECOND)
-
-def ctypes_getprocesstimes_systimes():
- creationtime = ctypes.c_ulonglong()
- exittime = ctypes.c_ulonglong()
- kerneltime = ctypes.c_ulonglong()
- usertime = ctypes.c_ulonglong()
- rc = ctypes.windll.kernel32.GetProcessTimes(
- ctypes.windll.kernel32.GetCurrentProcess(),
- ctypes.byref(creationtime),
- ctypes.byref(exittime),
- ctypes.byref(kerneltime),
- ctypes.byref(usertime))
- if not rc:
- raise TypeError('GetProcessTimes() returned an error')
- return (usertime.value / WIN32_PROCESS_TIMES_TICKS_PER_SECOND,
- kerneltime.value / WIN32_PROCESS_TIMES_TICKS_PER_SECOND)
-
-# Select the default for the systimes() function
-
-if SYSTIMES_IMPLEMENTATION is USE_RESOURCE_GETRUSAGE:
- systimes = getrusage_systimes
-
-elif SYSTIMES_IMPLEMENTATION is USE_PROCESS_TIME_CLOCK:
- systimes = process_time_clock_systimes
-
-elif SYSTIMES_IMPLEMENTATION is USE_WALL_TIME_CLOCK:
- systimes = wall_clock_clock_systimes
-
-elif SYSTIMES_IMPLEMENTATION is USE_WALL_TIME_TIME:
- systimes = wall_clock_time_systimes
-
-elif SYSTIMES_IMPLEMENTATION is USE_WIN32PROCESS_GETPROCESSTIMES:
- systimes = win32process_getprocesstimes_systimes
-
-elif SYSTIMES_IMPLEMENTATION is USE_CTYPES_GETPROCESSTIMES:
- systimes = ctypes_getprocesstimes_systimes
-
-else:
- raise TypeError('no suitable systimes() implementation found')
-
-def processtime():
-
- """ Return the total time spent on the process.
-
- This is the sum of user and system time as returned by
- systimes().
-
- """
- user, system = systimes()
- return user + system
-
-### Testing
-
-def some_workload():
- x = 0
- for i in range(10000000):
- x = x + 1
-
-def test_workload():
- print('Testing systimes() under load conditions')
- t0 = systimes()
- some_workload()
- t1 = systimes()
- print('before:', t0)
- print('after:', t1)
- print('differences:', (t1[0] - t0[0], t1[1] - t0[1]))
- print()
-
-def test_idle():
- print('Testing systimes() under idle conditions')
- t0 = systimes()
- time.sleep(1)
- t1 = systimes()
- print('before:', t0)
- print('after:', t1)
- print('differences:', (t1[0] - t0[0], t1[1] - t0[1]))
- print()
-
-if __name__ == '__main__':
- print('Using %s as timer' % SYSTIMES_IMPLEMENTATION)
- print()
- test_workload()
- test_idle()
diff --git a/Tools/scripts/generate_opcode_h.py b/Tools/scripts/generate_opcode_h.py
index 948b56f900..6622a3c815 100644
--- a/Tools/scripts/generate_opcode_h.py
+++ b/Tools/scripts/generate_opcode_h.py
@@ -1,6 +1,8 @@
# This script generates the opcode.h header file.
import sys
+import tokenize
+
header = """/* Auto-generated by Tools/scripts/generate_opcode_h.py */
#ifndef Py_OPCODE_H
#define Py_OPCODE_H
@@ -35,7 +37,13 @@ enum cmp_op {PyCmp_LT=Py_LT, PyCmp_LE=Py_LE, PyCmp_EQ=Py_EQ, PyCmp_NE=Py_NE,
def main(opcode_py, outfile='Include/opcode.h'):
opcode = {}
- exec(open(opcode_py).read(), opcode)
+ if hasattr(tokenize, 'open'):
+ fp = tokenize.open(opcode_py) # Python 3.2+
+ else:
+ fp = open(opcode_py) # Python 2.7
+ with fp:
+ code = fp.read()
+ exec(code, opcode)
opmap = opcode['opmap']
with open(outfile, 'w') as fobj:
fobj.write(header)
@@ -47,6 +55,8 @@ def main(opcode_py, outfile='Include/opcode.h'):
('HAVE_ARGUMENT', opcode['HAVE_ARGUMENT']))
fobj.write(footer)
+ print("%s regenerated from %s" % (outfile, opcode_py))
+
if __name__ == '__main__':
main(sys.argv[1], sys.argv[2])
diff --git a/Tools/scripts/google.py b/Tools/scripts/google.py
index 12152bb5f8..82fb287188 100755
--- a/Tools/scripts/google.py
+++ b/Tools/scripts/google.py
@@ -1,23 +1,25 @@
#! /usr/bin/env python3
-import sys, webbrowser
+"""Script to search with Google
-def main():
- args = sys.argv[1:]
- if not args:
- print("Usage: %s querystring" % sys.argv[0])
- return
- list = []
- for arg in args:
- if '+' in arg:
- arg = arg.replace('+', '%2B')
+Usage:
+ python3 google.py [search terms]
+"""
+
+import sys
+import urllib.parse
+import webbrowser
+
+
+def main(args):
+ def quote(arg):
if ' ' in arg:
arg = '"%s"' % arg
- arg = arg.replace(' ', '+')
- list.append(arg)
- s = '+'.join(list)
- url = "http://www.google.com/search?q=%s" % s
+ return urllib.parse.quote_plus(arg)
+
+ qstring = '+'.join(quote(arg) for arg in args)
+ url = urllib.parse.urljoin('https://www.google.com/search', '?q=' + qstring)
webbrowser.open(url)
if __name__ == '__main__':
- main()
+ main(sys.argv[1:])
diff --git a/Tools/scripts/run_tests.py b/Tools/scripts/run_tests.py
index b582e13250..30283023b6 100644
--- a/Tools/scripts/run_tests.py
+++ b/Tools/scripts/run_tests.py
@@ -26,6 +26,7 @@ def is_resource_use_flag(arg):
def main(regrtest_args):
args = [sys.executable,
+ '-u', # Unbuffered stdout and stderr
'-W', 'default', # Warnings set to 'default'
'-bb', # Warnings about bytes/bytearray
'-E', # Ignore environment variables
diff --git a/configure b/configure
index 1500cea4a8..1126372b0b 100755
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for python 3.6.
+# Generated by GNU Autoconf 2.69 for python 3.7.
#
# Report bugs to <https://bugs.python.org/>.
#
@@ -580,8 +580,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='python'
PACKAGE_TARNAME='python'
-PACKAGE_VERSION='3.6'
-PACKAGE_STRING='python 3.6'
+PACKAGE_VERSION='3.7'
+PACKAGE_STRING='python 3.7'
PACKAGE_BUGREPORT='https://bugs.python.org/'
PACKAGE_URL=''
@@ -1396,7 +1396,7 @@ 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 python 3.6 to adapt to many kinds of systems.
+\`configure' configures python 3.7 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1462,7 +1462,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of python 3.6:";;
+ short | recursive ) echo "Configuration of python 3.7:";;
esac
cat <<\_ACEOF
@@ -1620,7 +1620,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-python configure 3.6
+python configure 3.7
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2329,7 +2329,7 @@ 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 python $as_me 3.6, which was
+It was created by python $as_me 3.7, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
@@ -2956,7 +2956,7 @@ rm confdefs.h
mv confdefs.h.new confdefs.h
-VERSION=3.6
+VERSION=3.7
# Version number of Python's own shared library file.
@@ -7242,6 +7242,47 @@ fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_enable_unreachable_code_warning" >&5
$as_echo "$ac_cv_enable_unreachable_code_warning" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can make implicit function declaration an error in $CC" >&5
+$as_echo_n "checking if we can make implicit function declaration an error in $CC... " >&6; }
+ ac_save_cc="$CC"
+ CC="$CC -Werror=implicit-function-declaration"
+ if ${ac_cv_enable_implicit_function_declaration_error+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+ ac_cv_enable_implicit_function_declaration_error=yes
+
+else
+
+ ac_cv_enable_implicit_function_declaration_error=no
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+ CC="$ac_save_cc"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_enable_implicit_function_declaration_error" >&5
+$as_echo "$ac_cv_enable_implicit_function_declaration_error" >&6; }
+
+ if test $ac_cv_enable_implicit_function_declaration_error = yes
+ then
+ CFLAGS_NODIST="$CFLAGS_NODIST -Werror=implicit-function-declaration"
+ fi
+
# if using gcc on alpha, use -mieee to get (near) full IEEE 754
# support. Without this, treatment of subnormals doesn't follow
# the standard.
@@ -10028,23 +10069,30 @@ if test "${with_system_ffi+set}" = set; then :
fi
-case "$with_system_ffi" in
- "")
- case $ac_sys_system in
- Darwin)
- with_system_ffi="no"
- ;;
- *)
- with_system_ffi="yes"
- ;;
- esac
- ;;
- yes|no)
- ;;
- *)
- as_fn_error $? "--with-system-ffi accepts no arguments" "$LINENO" 5
- ;;
-esac
+if test "$ac_sys_system" = "Darwin"
+then
+ case "$with_system_ffi" in
+ "")
+ with_system_ffi="no"
+ ;;
+ yes|no)
+ ;;
+ *)
+ as_fn_error $? "--with-system-ffi accepts no arguments" "$LINENO" 5
+ ;;
+ esac
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_system_ffi" >&5
+$as_echo "$with_system_ffi" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+ if test "$with_system_ffi" != ""
+ then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: --with(out)-system-ffi is ignored on this platform" >&5
+$as_echo "$as_me: WARNING: --with(out)-system-ffi is ignored on this platform" >&2;}
+ fi
+ with_system_ffi="yes"
+fi
if test "$with_system_ffi" = "yes" && test -n "$PKG_CONFIG"; then
LIBFFI_INCLUDEDIR="`"$PKG_CONFIG" libffi --cflags-only-I 2>/dev/null | sed -e 's/^-I//;s/ *$//'`"
@@ -10053,9 +10101,6 @@ else
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_system_ffi" >&5
-$as_echo "$with_system_ffi" >&6; }
-
# Check for use of the system libmpdec library
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-system-libmpdec" >&5
$as_echo_n "checking for --with-system-libmpdec... " >&6; }
@@ -13139,6 +13184,18 @@ _ACEOF
fi
+# Issue #21085: In Cygwin, siginfo_t does not have si_band field.
+ac_fn_c_check_member "$LINENO" "siginfo_t" "si_band" "ac_cv_member_siginfo_t_si_band" "#include <signal.h>
+"
+if test "x$ac_cv_member_siginfo_t_si_band" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_SIGINFO_T_SI_BAND 1
+_ACEOF
+
+
+fi
+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for time.h that defines altzone" >&5
$as_echo_n "checking for time.h that defines altzone... " >&6; }
@@ -17114,7 +17171,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by python $as_me 3.6, which was
+This file was extended by python $as_me 3.7, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -17176,7 +17233,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
-python config.status 3.6
+python config.status 3.7
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
diff --git a/configure.ac b/configure.ac
index 64f12f2879..5610c5759d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3,7 +3,7 @@ dnl * Please run autoreconf to test your changes! *
dnl ***********************************************
# Set VERSION so we only need to edit in one place (i.e., here)
-m4_define(PYTHON_VERSION, 3.6)
+m4_define(PYTHON_VERSION, 3.7)
AC_PREREQ(2.65)
@@ -1689,6 +1689,26 @@ yes)
fi
AC_MSG_RESULT($ac_cv_enable_unreachable_code_warning)
+ AC_MSG_CHECKING(if we can make implicit function declaration an error in $CC)
+ ac_save_cc="$CC"
+ CC="$CC -Werror=implicit-function-declaration"
+ AC_CACHE_VAL(ac_cv_enable_implicit_function_declaration_error,
+ AC_COMPILE_IFELSE(
+ [
+ AC_LANG_PROGRAM([[]], [[]])
+ ],[
+ ac_cv_enable_implicit_function_declaration_error=yes
+ ],[
+ ac_cv_enable_implicit_function_declaration_error=no
+ ]))
+ CC="$ac_save_cc"
+ AC_MSG_RESULT($ac_cv_enable_implicit_function_declaration_error)
+
+ if test $ac_cv_enable_implicit_function_declaration_error = yes
+ then
+ CFLAGS_NODIST="$CFLAGS_NODIST -Werror=implicit-function-declaration"
+ fi
+
# if using gcc on alpha, use -mieee to get (near) full IEEE 754
# support. Without this, treatment of subnormals doesn't follow
# the standard.
@@ -2787,23 +2807,27 @@ AC_MSG_CHECKING(for --with-system-ffi)
AC_ARG_WITH(system_ffi,
AS_HELP_STRING([--with-system-ffi], [build _ctypes module using an installed ffi library]),,,)
-case "$with_system_ffi" in
- "")
- case $ac_sys_system in
- Darwin)
- with_system_ffi="no"
- ;;
- *)
- with_system_ffi="yes"
- ;;
- esac
- ;;
- yes|no)
- ;;
- *)
- AC_MSG_ERROR([--with-system-ffi accepts no arguments])
- ;;
-esac
+if test "$ac_sys_system" = "Darwin"
+then
+ case "$with_system_ffi" in
+ "")
+ with_system_ffi="no"
+ ;;
+ yes|no)
+ ;;
+ *)
+ AC_MSG_ERROR([--with-system-ffi accepts no arguments])
+ ;;
+ esac
+ AC_MSG_RESULT($with_system_ffi)
+else
+ AC_MSG_RESULT(yes)
+ if test "$with_system_ffi" != ""
+ then
+ AC_MSG_WARN([--with(out)-system-ffi is ignored on this platform])
+ fi
+ with_system_ffi="yes"
+fi
if test "$with_system_ffi" = "yes" && test -n "$PKG_CONFIG"; then
LIBFFI_INCLUDEDIR="`"$PKG_CONFIG" libffi --cflags-only-I 2>/dev/null | sed -e 's/^-I//;s/ *$//'`"
@@ -2812,8 +2836,6 @@ else
fi
AC_SUBST(LIBFFI_INCLUDEDIR)
-AC_MSG_RESULT($with_system_ffi)
-
# Check for use of the system libmpdec library
AC_MSG_CHECKING(for --with-system-libmpdec)
AC_ARG_WITH(system_libmpdec,
@@ -3930,6 +3952,8 @@ AC_CHECK_MEMBERS([struct passwd.pw_gecos, struct passwd.pw_passwd], [], [], [[
#include <sys/types.h>
#include <pwd.h>
]])
+# Issue #21085: In Cygwin, siginfo_t does not have si_band field.
+AC_CHECK_MEMBERS([siginfo_t.si_band], [], [], [[#include <signal.h>]])
AC_MSG_CHECKING(for time.h that defines altzone)
AC_CACHE_VAL(ac_cv_header_time_altzone,[
diff --git a/pyconfig.h.in b/pyconfig.h.in
index b10c57f85d..21354a5cb8 100644
--- a/pyconfig.h.in
+++ b/pyconfig.h.in
@@ -856,6 +856,9 @@
/* Define to 1 if you have the `sigaltstack' function. */
#undef HAVE_SIGALTSTACK
+/* Define to 1 if `si_band' is a member of `siginfo_t'. */
+#undef HAVE_SIGINFO_T_SI_BAND
+
/* Define to 1 if you have the `siginterrupt' function. */
#undef HAVE_SIGINTERRUPT
diff --git a/setup.py b/setup.py
index f04bf229f1..3b3d097454 100644
--- a/setup.py
+++ b/setup.py
@@ -321,6 +321,7 @@ class PyBuildExt(build_ext):
if ext.name == '_ctypes':
if not self.configure_ctypes(ext):
+ self.failed.append(ext.name)
return
try:
@@ -1914,56 +1915,8 @@ class PyBuildExt(build_ext):
if not self.use_system_libffi:
if host_platform == 'darwin':
return self.configure_ctypes_darwin(ext)
-
- print('warning: building with the bundled copy of libffi is'
- ' deprecated on this platform. It will not be'
- ' distributed with Python 3.7')
- srcdir = sysconfig.get_config_var('srcdir')
- ffi_builddir = os.path.join(self.build_temp, 'libffi')
- ffi_srcdir = os.path.abspath(os.path.join(srcdir, 'Modules',
- '_ctypes', 'libffi'))
- ffi_configfile = os.path.join(ffi_builddir, 'fficonfig.py')
-
- from distutils.dep_util import newer_group
-
- config_sources = [os.path.join(ffi_srcdir, fname)
- for fname in os.listdir(ffi_srcdir)
- if os.path.isfile(os.path.join(ffi_srcdir, fname))]
- if self.force or newer_group(config_sources,
- ffi_configfile):
- from distutils.dir_util import mkpath
- mkpath(ffi_builddir)
- config_args = [arg for arg in sysconfig.get_config_var("CONFIG_ARGS").split()
- if (('--host=' in arg) or ('--build=' in arg))]
- if not self.verbose:
- config_args.append("-q")
-
- # Pass empty CFLAGS because we'll just append the resulting
- # CFLAGS to Python's; -g or -O2 is to be avoided.
- cmd = "cd %s && env CFLAGS='' '%s/configure' %s" \
- % (ffi_builddir, ffi_srcdir, " ".join(config_args))
-
- res = os.system(cmd)
- if res or not os.path.exists(ffi_configfile):
- print("Failed to configure _ctypes module")
- return False
-
- fficonfig = {}
- with open(ffi_configfile) as f:
- exec(f.read(), globals(), fficonfig)
-
- # Add .S (preprocessed assembly) to C compiler source extensions.
- self.compiler.src_extensions.append('.S')
-
- include_dirs = [os.path.join(ffi_builddir, 'include'),
- ffi_builddir,
- os.path.join(ffi_srcdir, 'src')]
- extra_compile_args = fficonfig['ffi_cflags'].split()
-
- ext.sources.extend(os.path.join(ffi_srcdir, f) for f in
- fficonfig['ffi_sources'])
- ext.include_dirs.extend(include_dirs)
- ext.extra_compile_args.extend(extra_compile_args)
+ print('INFO: Could not locate ffi libs and/or headers')
+ return False
return True
def detect_ctypes(self, inc_dirs, lib_dirs):
@@ -2020,8 +1973,6 @@ class PyBuildExt(build_ext):
# OS X 10.5 comes with libffi.dylib; the include files are
# in /usr/include/ffi
inc_dirs.append('/usr/include/ffi')
- elif '--without-system-ffi' in sysconfig.get_config_var("CONFIG_ARGS"):
- return
ffi_inc = [sysconfig.get_config_var("LIBFFI_INCLUDEDIR")]
if not ffi_inc or ffi_inc[0] == '':