Initial import of libdpf.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Ryan Henry 2026-09-24 14:08:32 -06:00
commit e4e666f459
4563 changed files with 1690372 additions and 0 deletions

15
thirdparty/hedley/.appveyor.bat vendored Normal file
View file

@ -0,0 +1,15 @@
cd test
if "%COMPILER%"=="pelles" (
choco install pelles-c
"C:\Program Files\PellesC\Bin\povars64.bat"
pomake /F Makefile.pelles
)
if [%COMPILER%] == [msvc] (
if []==[%VS_VERSION%] (
"C:\Program Files (x86)\Microsoft Visual Studio\%VS_YEAR%\Community\VC\Auxiliary\Build\vcvarsall.bat" x86
) else (
"C:\Program Files (x86)\Microsoft Visual Studio %VS_VERSION%\VC\vcvarsall.bat"
)
nmake /f Makefile.msvc
)

28
thirdparty/hedley/.appveyor.yml vendored Normal file
View file

@ -0,0 +1,28 @@
version: "{build}"
branches:
except:
- /^(wip\/)?(travis|osx)(\-.+)?$/
environment:
matrix:
- COMPILER: msvc
VS_VERSION: 9.0
- COMPILER: msvc
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
VS_YEAR: 2019
- COMPILER: pelles
- COMPILER: msvc
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
VS_YEAR: 2017
- COMPILER: msvc
VS_VERSION: 14.0
- COMPILER: msvc
VS_VERSION: 12.0
- COMPILER: msvc
VS_VERSION: 11.0
- COMPILER: msvc
VS_VERSION: 10.0
build_script:
- .appveyor.bat

1
thirdparty/hedley/.gitignore vendored Normal file
View file

@ -0,0 +1 @@
*~

280
thirdparty/hedley/.travis.yml vendored Normal file
View file

@ -0,0 +1,280 @@
language: c
sudo: false
branches:
except:
- /^(wip\/)?(appveyor|msvc|mingw|windows)(\-.+)?$/
matrix:
include:
###
## Linux builds using various versions of GCC.
###
# - dist: bionic
# env: C_COMPILER=gcc-9 CXX_COMPILER=g++-9
# addons:
# apt:
# sources:
# - ubuntu-toolchain-r-test
# packages:
# - gcc-9
# - g++-9
- dist: bionic
env: C_COMPILER=gcc-8 CXX_COMPILER=g++-8
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- gcc-8
- g++-8
- dist: trusty
env: C_COMPILER=gcc-7 CXX_COMPILER=g++-7
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- gcc-7
- g++-7
- dist: trusty
env: C_COMPILER=gcc-6 CXX_COMPILER=g++-6
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- gcc-6
- g++-6
- dist: trusty
env: C_COMPILER=gcc-5 CXX_COMPILER=g++-5
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- gcc-5
- g++-5
- dist: trusty
env: C_COMPILER=gcc-4.9 CXX_COMPILER=g++-4.9
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- gcc-4.9
- g++-4.9
- dist: trusty
env: C_COMPILER=gcc-4.8 CXX_COMPILER=g++-4.8
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- gcc-4.8
- g++-4.8
- dist: trusty
env: C_COMPILER=gcc-4.7 CXX_COMPILER=g++-4.7
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- gcc-4.7
- g++-4.7
- dist: trusty
env: C_COMPILER=gcc-4.6 CXX_COMPILER=g++-4.6
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- gcc-4.6
- g++-4.6
- dist: trusty
env: C_COMPILER=gcc-4.4 CXX_COMPILER=g++-4.4
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- gcc-4.4
- g++-4.4
###
## clang on Linux
###
# - dist: bionic
# env: C_COMPILER=clang-9 CXX_COMPILER=clang++-9
# addons:
# apt:
# sources:
# - llvm-toolchain-bionic-9
# - ubuntu-toolchain-r-test
# packages:
# - clang-9
- dist: bionic
env: C_COMPILER=clang-8 CXX_COMPILER=clang++-8
addons:
apt:
sources:
- llvm-toolchain-bionic-8
- ubuntu-toolchain-r-test
packages:
- clang-8
- dist: bionic
env: C_COMPILER=clang-7 CXX_COMPILER=clang++-7
addons:
apt:
sources:
- llvm-toolchain-bionic-7
- ubuntu-toolchain-r-test
packages:
- clang-7
- dist: bionic
env: C_COMPILER=clang-6.0 CXX_COMPILER=clang++-6.0
addons:
apt:
sources:
- llvm-toolchain-bionic-6.0
- ubuntu-toolchain-r-test
packages:
- clang-6.0
- dist: bionic
env: C_COMPILER=clang-5.0 CXX_COMPILER=clang++-5.0
addons:
apt:
sources:
- llvm-toolchain-bionic-5.0
- ubuntu-toolchain-r-test
packages:
- clang-5.0
- dist: xenial
env: C_COMPILER=clang-4.0 CXX_COMPILER=clang++-4.0
addons:
apt:
sources:
- llvm-toolchain-xenial-4.0
- ubuntu-toolchain-r-test
packages:
- clang-4.0
- dist: xenial
env: C_COMPILER=clang-3.9 CXX_COMPILER=clang++-3.9
addons:
apt:
sources:
- llvm-toolchain-xenial-3.9
- ubuntu-toolchain-r-test
packages:
- clang-3.9
- dist: xenial
env: C_COMPILER=clang-3.8 CXX_COMPILER=clang++-3.8
addons:
apt:
sources:
- llvm-toolchain-xenial-3.8
- ubuntu-toolchain-r-test
packages:
- clang-3.8
- dist: trusty
env: C_COMPILER=clang-3.7 CXX_COMPILER=clang++-3.7
addons:
apt:
sources:
- llvm-toolchain-precise-3.7
- ubuntu-toolchain-r-test
packages:
- clang-3.7
- dist: trusty
env: C_COMPILER=clang-3.6 CXX_COMPILER=clang++-3.6
addons:
apt:
sources:
- llvm-toolchain-precise-3.6
- ubuntu-toolchain-r-test
packages:
- clang-3.6
- dist: trusty
env: C_COMPILER=clang-3.5 CXX_COMPILER=clang++-3.5
addons:
apt:
sources:
- llvm-toolchain-precise-3.5
- ubuntu-toolchain-r-test
packages:
- clang-3.5
###
## PGI
###
- dist: xenial
env: C_COMPILER=pgcc CXX_COMPILER=pgc++
###
## OS X
###
- os: osx
osx_image: xcode12u
- os: osx
osx_image: xcode11.6
- os: osx
osx_image: xcode10.3
- os: osx
osx_image: xcode9.4
- os: osx
osx_image: xcode8.3
- os: osx
osx_image: xcode7.3
###
## mingw
###
- dist: bionic
env: C_COMPILER=x86_64-w64-mingw32-gcc CXX_COMPILER=x86_64-w64-mingw32-g++
addons:
apt:
packages:
- gcc-mingw-w64-x86-64
- g++-mingw-w64-x86-64
- binutils-mingw-w64-x86-64
###
## TI Compilers
###
- dist: xenial
env: C_COMPILER=armcl CXX_COMPILER=armcl INSTALL_TI_COMPILERS=y
addons:
apt:
packages: gcc-multilib
- dist: xenial
env: C_COMPILER=cl430 CXX_COMPILER=cl430 INSTALL_TI_COMPILERS=y
addons:
apt:
packages: gcc-multilib
- dist: xenial
env: C_COMPILER=cl2000 CXX_COMPILER=cl2000 INSTALL_TI_COMPILERS=y
addons:
apt:
packages: gcc-multilib
- dist: xenial
env: C_COMPILER=cl6x CXX_COMPILER=cl6x INSTALL_TI_COMPILERS=y
addons:
apt:
packages: gcc-multilib
- dist: xenial
env: C_COMPILER=cl7x CXX_COMPILER=cl7x INSTALL_TI_COMPILERS=y
addons:
apt:
packages: gcc-multilib
- dist: xenial
env: C_COMPILER=clpru CXX_COMPILER=clpru INSTALL_TI_COMPILERS=y
addons:
apt:
packages: gcc-multilib
before_install:
- if [ -n "${C_COMPILER}" ]; then export CC="${C_COMPILER}"; fi
- if [ -n "${CXX_COMPILER}" ]; then export CXX="${CXX_COMPILER}"; fi
- if [ "x${INSTALL_TI_COMPILERS}" = "xy" ]; then curl -s 'https://raw.githubusercontent.com/nemequ/ti-compiler-install-travis/master/ti-cgt-install.sh' | /bin/sh; fi
- if [ "${C_COMPILER}" = "pgcc" ]; then wget -q -O /dev/stdout 'https://raw.githubusercontent.com/nemequ/pgi-travis/master/install-pgi.sh' | /bin/sh; fi
script:
- cd test && make

117
thirdparty/hedley/COPYING vendored Normal file
View file

@ -0,0 +1,117 @@
Statement of Purpose
The laws of most jurisdictions throughout the world automatically
confer exclusive Copyright and Related Rights (defined below) upon the
creator and subsequent owner(s) (each and all, an "owner") of an
original work of authorship and/or a database (each, a "Work").
Certain owners wish to permanently relinquish those rights to a Work
for the purpose of contributing to a commons of creative, cultural and
scientific works ("Commons") that the public can reliably and without
fear of later claims of infringement build upon, modify, incorporate
in other works, reuse and redistribute as freely as possible in any
form whatsoever and for any purposes, including without limitation
commercial purposes. These owners may contribute to the Commons to
promote the ideal of a free culture and the further production of
creative, cultural and scientific works, or to gain reputation or
greater distribution for their Work in part through the use and
efforts of others.
For these and/or other purposes and motivations, and without any
expectation of additional consideration or compensation, the person
associating CC0 with a Work (the "Affirmer"), to the extent that he or
she is an owner of Copyright and Related Rights in the Work,
voluntarily elects to apply CC0 to the Work and publicly distribute
the Work under its terms, with knowledge of his or her Copyright and
Related Rights in the Work and the meaning and intended legal effect
of CC0 on those rights.
1. Copyright and Related Rights. A Work made available under CC0 may
be protected by copyright and related or neighboring rights
("Copyright and Related Rights"). Copyright and Related Rights
include, but are not limited to, the following:
i. the right to reproduce, adapt, distribute, perform, display,
communicate, and translate a Work;
ii. moral rights retained by the original author(s) and/or
performer(s);
iii. publicity and privacy rights pertaining to a person's image
or likeness depicted in a Work;
iv. rights protecting against unfair competition in regards to a
Work, subject to the limitations in paragraph 4(a), below;
v. rights protecting the extraction, dissemination, use and
reuse of data in a Work;
vi. database rights (such as those arising under Directive
96/9/EC of the European Parliament and of the Council of 11
March 1996 on the legal protection of databases, and under
any national implementation thereof, including any amended
or successor version of such directive); and
vii. other similar, equivalent or corresponding rights throughout
the world based on applicable law or treaty, and any
national implementations thereof.
2. Waiver. To the greatest extent permitted by, but not in
contravention of, applicable law, Affirmer hereby overtly, fully,
permanently, irrevocably and unconditionally waives, abandons, and
surrenders all of Affirmer's Copyright and Related Rights and
associated claims and causes of action, whether now known or
unknown (including existing as well as future claims and causes of
action), in the Work (i) in all territories worldwide, (ii) for the
maximum duration provided by applicable law or treaty (including
future time extensions), (iii) in any current or future medium and
for any number of copies, and (iv) for any purpose whatsoever,
including without limitation commercial, advertising or promotional
purposes (the "Waiver"). Affirmer makes the Waiver for the benefit
of each member of the public at large and to the detriment of
Affirmer's heirs and successors, fully intending that such Waiver
shall not be subject to revocation, rescission, cancellation,
termination, or any other legal or equitable action to disrupt the
quiet enjoyment of the Work by the public as contemplated by
Affirmer's express Statement of Purpose.
3. Public License Fallback. Should any part of the Waiver for any
reason be judged legally invalid or ineffective under applicable
law, then the Waiver shall be preserved to the maximum extent
permitted taking into account Affirmer's express Statement of
Purpose. In addition, to the extent the Waiver is so judged
Affirmer hereby grants to each affected person a royalty-free, non
transferable, non sublicensable, non exclusive, irrevocable and
unconditional license to exercise Affirmer's Copyright and Related
Rights in the Work (i) in all territories worldwide, (ii) for the
maximum duration provided by applicable law or treaty (including
future time extensions), (iii) in any current or future medium and
for any number of copies, and (iv) for any purpose whatsoever,
including without limitation commercial, advertising or promotional
purposes (the "License"). The License shall be deemed effective as
of the date CC0 was applied by Affirmer to the Work. Should any
part of the License for any reason be judged legally invalid or
ineffective under applicable law, such partial invalidity or
ineffectiveness shall not invalidate the remainder of the License,
and in such case Affirmer hereby affirms that he or she will not
(i) exercise any of his or her remaining Copyright and Related
Rights in the Work or (ii) assert any associated claims and causes
of action with respect to the Work, in either case contrary to
Affirmer's express Statement of Purpose.
4. Limitations and Disclaimers.
a. No trademark or patent rights held by Affirmer are waived,
abandoned, surrendered, licensed or otherwise affected by this
document.
b. Affirmer offers the Work as-is and makes no representations or
warranties of any kind concerning the Work, express, implied,
statutory or otherwise, including without limitation warranties
of title, merchantability, fitness for a particular purpose, non
infringement, or the absence of latent or other defects,
accuracy, or the present or absence of errors, whether or not
discoverable, all to the greatest extent permissible under
applicable law.
c. Affirmer disclaims responsibility for clearing rights of other
persons that may apply to the Work or any use thereof, including
without limitation any person's Copyright and Related Rights in
the Work. Further, Affirmer disclaims responsibility for
obtaining any necessary consents, permissions or other rights
required for any use of the Work.
d. Affirmer understands and acknowledges that Creative Commons is
not a party to this document and has no duty or obligation with
respect to this CC0 or use of the Work.

154
thirdparty/hedley/NEWS vendored Normal file
View file

@ -0,0 +1,154 @@
Version 15
==========
* Support for MCST LCC compiler.
* New HEDLEY_DIAGNOSTIC_DISABLE_UNUSED_FUNCTION macro.
* Assorted bug fixes and enhancements.
Version 14
==========
* Support for icl compiler
* Assorted bug fixes and enhancements
Version 13
==========
* New macros:
* HEDLEY_CONCAT3
* Assorted bug fixes and enhancements
Version 12
==========
* New macros:
* HEDLEY_WARN_UNUSED_RESULT_MSG
* TI compilers:
* HEDLEY_TI_CL2000_VERSION and HEDLEY_TI_CL2000_VERSION_CHECK
* HEDLEY_TI_CL430_VERSION and HEDLEY_TI_CL430_VERSION_CHECK
* HEDLEY_TI_ARMCL_VERSION and HEDLEY_TI_ARMCL_VERSION_CHECK
* HEDLEY_TI_CL6X_VERSION and HEDLEY_TI_CL6X_VERSION_CHECK
* HEDLEY_TI_CL7X_VERSION and HEDLEY_TI_CL7X_VERSION_CHECK
* HEDLEY_TI_CLPRU_VERSION and HEDLEY_TI_CLPRU_VERSION_CHECK
* HEDLEY_TI_VERSION is now only set for MCU compilers after their
versions were harmonized.
* Assorted bug fixes and enhancements
Version 11
==========
* New macros:
* HEDLEY_HAS_CPP_ATTRIBUTE_NS
* HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTE
* HEDLEY_NO_ESCAPE
* HEDLEY_NULL
* Assorted bug fixes and enhancements
Version 10
==========
* New macros:
* HEDLEY_EMPTY_BASES
* Assorted bug fixes and enhancements
Version 9
=========
* New macros:
* HEDLEY_PREDICT
* HEDLEY_PREDICT_TRUE
* HEDLEY_PREDICT_FALSE
* HEDLEY_UNPREDICTABLE
* HEDLEY_CONSTEXPR
* HEDLEY_ASSUME
* HEDLEY_FLAGS_CAST
* Most tests now use HEDLEY_GCC_* instead of HEDLEY_GNUC_*
* Intel C/C++ Compiler implementations now go down to version 13
instead of version 16.
* New compiler support:
* CompCert
* Pelles C
* Add SPDX identifier
* Assorted bug fixes and enhancements
Version 8
=========
* New macros:
* HEDLEY_REQUIRE
* HEDLEY_REQUIRE_MSG
* HEDLEY_CPP_CAST
* Added PGI 18.4 support for HEDLEY_WARNING
Version 7
=========
* New macros:
* HEDLEY_IS_CONSTANT
* HEDLEY_REQUIRE_CONSTEXPR
* Assorted bug fixes and enhancements
Version 6
=========
* New macros:
* HEDLEY_UNREACHABLE_RETURN
* New compiler support:
* Tiny C Compiler
* Digital Mars C/C++ Compiler
Version 5
=========
* New macros:
* HEDLEY_CONST_CAST
* HEDLEY_REINTERPRET_CAST
* HEDLEY_STATIC_CAST
* HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL
* New compiler support:
* IAR C/C++ Compiler
* Add Makefiles for tests
* Improved portability of test cases
* Assorted bug fixes and enhancements
Version 4
=========
* New macros
* HEDLEY_*_VERSION
* HEDLEY_STRINGIFY
* HEDLEY_CONCAT
* HEDLEY_GNUC_*
* HEDLEY_HAS_*
* HEDLEY_WARNING
* HEDLEY_MESSAGE
* HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS
* Added test/ directory
* Expanded coverage and increased accuracy for many existing macros
Version 2
=========
* New compiler support
* PGI
* Oracle Developer Studio
* Emscripten
* ARM
* IBM XL
* Improved C++ implementations
* New macros
* HEDLEY_FALL_THROUGH
* HEDLEY_RETURNS_NON_NULL
* HEDLEY_PRAGMA
* HEDLEY_PGI_VERSION_CHECK
* HEDLEY_SUNPRO_VERSION_CHECK
* HEDLEY_EMSCRIPTEN_VERSION_CHECK
* HEDLEY_ARM_VERSION_CHECK
* HEDLEY_IBM_VERSION_CHECK
* Improved implementations for many existing macros.
* Assorted bug fixes and work-arounds for broken compilers.
Version 1
=========
* Initial release.

34
thirdparty/hedley/README.md vendored Normal file
View file

@ -0,0 +1,34 @@
# Hedley
## Documentation
For documentation, see [https://nemequ.github.io/hedley/](https://nemequ.github.io/hedley/).
There is an easy-to-read user guide and full API documentation.
## Brief Description
Hedley is C/C++ a header file designed to smooth over some
platform-specific annoyances. The idea is to get rid of a bunch of
the #ifdefs in your code and put them in Hedley instead or, if you
haven't bothered with platform-specific functionality in your code, to
make it easier to do so. This code can be used to improve:
* Static analysis — better warnings and errors help you catch errors
before they become a real issue.
* Optimizations — compiler hints help speed up your code.
* Manage public APIs
* Visibility — keeping internal symbols private can make your
program faster and smaller.
* Versioning — help consumers avoid functions which are deprecated
or too new for all the platforms they want to support.
* C/C++ interoperability — make it easier to use code in both C and
C++ compilers.
* *… and more!*
You can safely use Hedley in your *public* API. If someone else
includes a newer version of Hedley later on, the newer Hedley will
just redefine everything, and if someone includes an older version it
will simply be ignored.
It should be safe to use any of Hedley's features; if the platform
doesn't support the feature it will be silently ignored.

2042
thirdparty/hedley/hedley.h vendored Normal file

File diff suppressed because it is too large Load diff

288
thirdparty/hedley/test/Makefile vendored Normal file
View file

@ -0,0 +1,288 @@
CLANG_C_FLAGS = -Weverything -Wno-vla -Wno-covered-switch-default -Werror
GCC_C_FLAGS = -Wall -Wextra -Werror
ifeq ($(notdir $(CC)), clang)
CFLAGS ?= $(CLANG_C_FLAGS)
else ifeq ($(notdir $(CC)), suncc)
CFLAGS ?= -errwarn -errtags
C_OUTPUT_FILE := -o
else ifeq ($(notdir $(CC)),$(filter $(notdir $(CC)),armcl cl2000 cl430 cl6x cl7x clpru))
CFLAGS ?= --display_error_number --emit_warnings_as_errors --issue_remarks -i $(dir $(shell readlink -f $(shell which $(CC))))../include
C_OUTPUT_FILE := --output_file=
else ifeq ($(notdir $(CC)), pgcc)
CFLAGS ?= -Minform=inform -c11
C_OUTPUT_FILE := -o
else ifeq ($(notdir $(CC)), pgc++)
CFLAGS ?= --display_error_number -Minform=inform -Werror
C_OUTPUT_FILE := -o
else ifeq ($(notdir $(CC)), xlc)
CFLAGS ?= $(CLANG_C_FLAGS)
C_OUTPUT_FILE := -o
else ifeq ($(notdir $(CC)), icc)
CFLAGS ?= -w3 -Werror
C_OUTPUT_FILE := -o
else ifeq ($(notdir $(CC)), tcc)
CFLAGS ?=
C_OUTPUT_FILE := -o
else ifeq ($(notdir $(CC)), gcc)
CFLAGS ?= $(GCC_C_FLAGS)
C_OUTPUT_FILE := -o
else ifeq ($(notdir $(CC)), x86_64-w64-mingw32-gcc)
CFLAGS ?= $(GCC_C_FLAGS)
C_OUTPUT_FILE := -o
else ifeq ($(notdir $(CC)), ccomp)
CFLAGS ?= -Wall
C_OUTPUT_FILE := -o
else
CFLAGS ?= $(filter-out -Werror,$(GCC_C_FLAGS))
endif
CLANG_CXX_FLAGS = -Weverything -Werror
GCC_CXX_FLAGS = -Wall -Wextra -Werror
ifeq ($(notdir $(CXX)), clang++)
CXXFLAGS ?= $(CLANG_CXX_FLAGS)
else ifeq ($(notdir $(CXX)), sunCC)
CXXFLAGS ?= -errwarn=%all -errtags=yes
CXX_OUTPUT_FILE := -o
else ifeq ($(notdir $(CXX)), pgc++)
CXXFLAGS ?= --display_error_number -Minform=inform -Werror
CXX_OUTPUT_FILE := -o
else ifeq ($(notdir $(CXX)),$(filter $(notdir $(CC)),armcl cl2000 cl430 cl6x cl7x clpru))
CXXFLAGS ?= --display_error_number --emit_warnings_as_errors --issue_remarks -i $(dir $(shell readlink -f $(shell which $(CC))))../include
CXX_OUTPUT_FILE := --output_file=
else ifeq ($(notdir $(CXX)), xlc++)
CXXFLAGS ?= $(CLANG_CXX_FLAGS)
CXX_OUTPUT_FILE := -o
else ifeq ($(notdir $(CXX)), icpc)
CXXFLAGS ?= $(GCC_CXX_FLAGS)
CXX_OUTPUT_FILE := -o
else ifeq ($(notdir $(CXX)), g++)
CXXFLAGS ?= $(GCC_CXX_FLAGS)
CXX_OUTPUT_FILE := -o
else ifeq ($(notdir $(CXX)), x86_64-w64-mingw32-g++)
CFLAGS ?= $(GCC_CXX_FLAGS)
C_OUTPUT_FILE := -o
else
CXXFLAGS ?= $(filter-out -Werror,$(GCC_CXX_FLAGS))
endif
C_OUTPUT_FILE ?= --output=
CXX_OUTPUT_FILE ?= --output=
NULL =
TESTS = \
array-param \
assume \
cast \
concat \
const \
constant \
deprecated \
empty-bases \
fallthrough \
flags \
inline \
likely \
malloc \
message \
noinline \
no-escape \
no-return \
non-null \
predict \
printf-format \
pure \
require \
restrict \
returns-non-null \
sentinel \
static-assert \
stringify \
unknown-cpp-attributes \
unknown-pragmas \
unavailable \
unreachable \
unused-function \
visibility \
warn \
warn-unused-result \
$(NULL)
ifneq ($(CXX), none)
CXXTESTS = $(TESTS:=-cpp)
else
CXXTESTS =
endif
CLEANFILES = \
$(TESTS) \
$(TESTS:=-cpp) \
$(TESTS:=.cpp)
all: $(TESTS) $(CXXTESTS) .gitignore Makefile.msvc Makefile.iar Makefile.dmc
%.cpp: %.c
cp -a $^ $@
%-cpp: %.cpp
$(CXX) $(CXXFLAGS) $(CXX_OUTPUT_FILE)$@ $(^:.c=.cpp)
%: %.c
$(CC) $(CFLAGS) $(C_OUTPUT_FILE)$@ $^
define GEN_GCC_C_WARNINGS
$(1): $(1:=.c)
$(CC) $(filter-out -Werror,$(CFLAGS)) $(C_OUTPUT_FILE)$(1) $(1:=.c)
endef
define GEN_GCC_CXX_WARNINGS
$(1)-cpp: $(1:=.cpp)
$(CXX) $(filter-out -Werror,$(CXXFLAGS)) $(CXX_OUTPUT_FILE)$(1) $(1:=.cpp)
endef
.gitignore: Makefile
@echo "# Generated by Makefile. Do not edit." > $@
@$(foreach file,$(TESTS),echo -e "/$(file)\n/$(file:=.exe)\n/$(file:=.cpp)\n/$(file:=-cpp)\n/$(file:=-cpp.exe)\n/$(file:=-cpp.o)\n/$(file:=.obj)\n/$(file:=.lib)\n/$(file:=-cpp.obj)\n/$(file:=-cpp.lib)\n/$(file:=.o)\n/$(file:=.map)\n/$(file:=-cpp.map)" >> $@;)
@echo "/.gitignore" >> $@
Makefile.iar: Makefile
@echo -e "# Generated by Makefile. Do not edit.\r" > $@
@echo -e "CC = \"C:\x5cProgram Files (x86)\x5cIAR Systems\x5cEmbedded Workbench 8.4\x5carm\x5cbin\x5ciccarm.exe\"\r" >> $@
@echo -e "CXX = \x24(CC)\r" >> $@
@echo -e "\r" >> $@
@echo -e "CFLAGS = --silent --remarks --warnings_are_errors\r" >> $@
@echo -e "CXXFLAGS = --c++ \x24(CFLAGS)\r" >> $@
@echo -e "\r" >> $@
@echo -e "TESTS = \x5c\r" >> $@
@$(foreach file,$(TESTS),echo -e "\t$(file:=.o) $(file:=-cpp.o) \x5c\r" >> $@;)
@echo -e "\t\x24(NULL)\r\n\r" >> $@
@echo -e "CLEANFILES = \x24(TESTS) \x5c\r" >> $@
@$(foreach file,$(TESTS),echo -e "\t$(file:=.cpp) $(file:=.o) $(file:=-cpp.o) \x5c\r" >> $@;)
@echo -e "\t\x24(NULL)\r\n\r" >> $@
@echo -e "all: \x24(TESTS)\r\n\r" >> $@
@echo -e "clean:\r\n\tdel /Q \x24(CLEANFILES)\r\n\r" >> $@
@$(foreach file,$(TESTS),echo -e "$(file:=.o): $(file:=.c)\r\n\t\x24(CC) \x24(CFLAGS) --output \x24(@) \x24(?)\r\n$(file:=.cpp): $(file:=.c)\r\n\tcopy /Y \x24(?) \x24(@) >NUL\r\n$(file:=-cpp.o): $(file:=.cpp)\r\n\t\x24(CXX) \x24(CXXFLAGS) --output \x24(@) \x24(?)\r\n\r" >> $@;)
Makefile.dmc: Makefile
@echo -e "# Generated by Makefile. Do not edit.\r" > $@
@echo -e "CC = \"dmc.exe\"\r" >> $@
@echo -e "CXX = \x24(CC)\r" >> $@
@echo -e "\r" >> $@
@echo -e "CFLAGS = -w -w17 -w18 -wx\r" >> $@
@echo -e "CXXFLAGS = -wc \x24(CFLAGS)\r" >> $@
@echo -e "\r" >> $@
@echo -e "TESTS = \x5c\r" >> $@
@$(foreach file,$(TESTS),echo -e "\t$(file:=.exe) $(file:=-cpp.exe) \x5c\r" >> $@;)
@echo -e "\t\x24(NULL)\r\n\r" >> $@
@echo -e "CLEANFILES = \x24(TESTS) \x5c\r" >> $@
@$(foreach file,$(TESTS),echo -e "\t$(file:=.cpp) $(file:=.exe) $(file:=-cpp.exe) $(file:=.map) $(file:=-cpp.map) \x5c\r" >> $@;)
@echo -e "\t\x24(NULL)\r\n\r" >> $@
@echo -e "all: \x24(TESTS)\r\n\r" >> $@
@echo -e "clean:\r\n\tdel /Q \x24(CLEANFILES)\r\n\r" >> $@
@$(foreach file,$(TESTS),echo -e "$(file:=.exe): $(file:=.c)\r\n\t\x24(CC) \x24(CFLAGS) -o \x24(@) \x24(?)\r\n$(file:=.cpp): $(file:=.c)\r\n\tcopy /Y \x24(?) \x24(@) >NUL\r\n$(file:=-cpp.exe): $(file:=.cpp)\r\n\t\x24(CXX) \x24(CXXFLAGS) -o \x24(@) \x24(?)\r\n\r" >> $@;)
Makefile.msvc: Makefile
@echo -e "# Generated by Makefile. Do not edit.\r" > $@
@echo -e "CC = cl\r" >> $@
@echo -e "CXX = \x24(CC)\r" >> $@
@echo -e "\r" >> $@
@echo -e "CFLAGS = /nologo /Wall /wd4464 /wd4514\r" >> $@
@echo -e "CXXFLAGS = \x24(CFLAGS)\r" >> $@
@echo -e "\r" >> $@
@echo -e "TESTS = \x5c\r" >> $@
@$(foreach file,$(TESTS),echo -e "\t$(file:=.exe) $(file:=-cpp.exe) \x5c\r" >> $@;)
@echo -e "\t\x24(NULL)\r\n\r" >> $@
@echo -e "TESTS = \x5c\r" >> $@
@$(foreach file,$(TESTS),echo -e "\t$(file:=.exe) $(file:=-cpp.exe) \x5c\r" >> $@;)
@echo -e "\t\x24(NULL)\r\n\r" >> $@
@echo -e "CLEANFILES = \x24(TESTS) \x5c\r" >> $@
@$(foreach file,$(TESTS),echo -e "\t$(file:=.cpp) $(file:=.obj) $(file:=.lib) $(file:=-cpp.exp) $(file:=-cpp.lib) \x5c\r" >> $@;)
@echo -e "\t\x24(NULL)\r\n\r" >> $@
@echo -e "all: \x24(TESTS)\r\n\r" >> $@
@echo -e "clean:\r\n\tdel /Q \x24(CLEANFILES)\r\n\r" >> $@
@$(foreach file,$(TESTS),echo -e "$(file:=.exe): $(file:=.c)\r\n\t\x24(CC) \x24(CFLAGS) /Fe\x24(@) \x24(?)\r\n$(file:=.cpp): $(file:=.c)\r\n\tcopy /Y \x24(?) \x24(@) >NUL\r\n$(file:=-cpp.exe): $(file:=.cpp)\r\n\t\x24(CXX) \x24(CXXFLAGS) /Fe\x24(@) \x24(?)\r\n\r" >> $@;)
Makefile.icl: Makefile
@echo -e "# Generated by Makefile. Do not edit.\r" > $@
@echo -e "CC = icl\r" >> $@
@echo -e "CXX = \x24(CC)\r" >> $@
@echo -e "\r" >> $@
@echo -e "CFLAGS = /nologo /Wall /wd4464 /wd4514\r" >> $@
@echo -e "CXXFLAGS = \x24(CFLAGS)\r" >> $@
@echo -e "\r" >> $@
@echo -e "TESTS = \x5c\r" >> $@
@$(foreach file,$(TESTS),echo -e "\t$(file:=.exe) $(file:=-cpp.exe) \x5c\r" >> $@;)
@echo -e "\t\x24(NULL)\r\n\r" >> $@
@echo -e "TESTS = \x5c\r" >> $@
@$(foreach file,$(TESTS),echo -e "\t$(file:=.exe) $(file:=-cpp.exe) \x5c\r" >> $@;)
@echo -e "\t\x24(NULL)\r\n\r" >> $@
@echo -e "CLEANFILES = \x24(TESTS) \x5c\r" >> $@
@$(foreach file,$(TESTS),echo -e "\t$(file:=.cpp) $(file:=.obj) $(file:=.lib) $(file:=-cpp.exp) $(file:=-cpp.lib) \x5c\r" >> $@;)
@echo -e "\t\x24(NULL)\r\n\r" >> $@
@echo -e "all: \x24(TESTS)\r\n\r" >> $@
@echo -e "clean:\r\n\tdel /Q \x24(CLEANFILES)\r\n\r" >> $@
@$(foreach file,$(TESTS),echo -e "$(file:=.exe): $(file:=.c)\r\n\t\x24(CC) \x24(CFLAGS) /Fe\x24(@) \x24(?)\r\n$(file:=.cpp): $(file:=.c)\r\n\tcopy /Y \x24(?) \x24(@) >NUL\r\n$(file:=-cpp.exe): $(file:=.cpp)\r\n\t\x24(CXX) \x24(CXXFLAGS) /Fe\x24(@) \x24(?)\r\n\r" >> $@;)
Makefile.pelles: Makefile
@echo -e "# Generated by Makefile. Do not edit.\r" > $@
@echo -e "CC = pocc\r" >> $@
@echo -e "LD = polink\r" >> $@
@echo -e "\r" >> $@
@echo -e "CFLAGS = \r" >> $@
@echo -e "LDFLAGS = \r" >> $@
@echo -e "\r" >> $@
@echo -e "TESTS = \x5c\r" >> $@
@$(foreach file,$(TESTS),echo -e "\t$(file:=.exe) \x5c\r" >> $@;)
@echo -e "\t\x24(NULL)\r\n\r" >> $@
@echo -e "CLEANFILES = \x24(TESTS) \x5c\r" >> $@
@$(foreach file,$(TESTS),echo -e "\t$(file:=.obj) $(file:=.exe) \x5c\r" >> $@;)
@echo -e "\t\x24(NULL)\r\n\r" >> $@
@echo -e "all: \x24(TESTS)\r\n\r" >> $@
@echo -e "clean:\r\n\tdel /Q \x24(CLEANFILES)\r\n\r" >> $@
@$(foreach file,$(TESTS),echo -e "$(file:=.obj): $(file:=.c)\r\n\t\x24(CC) \x24(CFLAGS) $(file:=.c)\r\n\r\n$(file:=.exe): $(file:=.obj)\r\n\t\x24(LD) \x24(LDFLAGS) /OUT:$(file:=.exe) $(file:=.obj)\r\n\r" >> $@;)
clean:
rm -f $(CLEANFILES)
.PHONY: clean all
ifeq ($(notdir $(CC)), gcc)
$(foreach tgt,unavailable warn unknown-pragmas,$(eval $(call GEN_GCC_C_WARNINGS,$(tgt))))
else ifeq ($(notdir $(CC)), x86_64-w64-mingw32-gcc)
$(foreach tgt,unavailable warn unknown-pragmas,$(eval $(call GEN_GCC_C_WARNINGS,$(tgt))))
endif
ifeq ($(notdir $(CXX)), g++)
$(foreach tgt,unavailable warn unknown-pragmas,$(eval $(call GEN_GCC_CXX_WARNINGS,$(tgt))))
else ifeq ($(notdir $(CXX)), x86_64-w64-mingw32-g++)
$(foreach tgt,unavailable warn unknown-pragmas,$(eval $(call GEN_GCC_CXX_WARNINGS,$(tgt))))
endif

333
thirdparty/hedley/test/Makefile.dmc vendored Normal file
View file

@ -0,0 +1,333 @@
# Generated by Makefile. Do not edit.
CC = "dmc.exe"
CXX = $(CC)
CFLAGS = -w -w17 -w18 -wx
CXXFLAGS = -wc $(CFLAGS)
TESTS = \
array-param.exe array-param-cpp.exe \
assume.exe assume-cpp.exe \
cast.exe cast-cpp.exe \
concat.exe concat-cpp.exe \
const.exe const-cpp.exe \
constant.exe constant-cpp.exe \
deprecated.exe deprecated-cpp.exe \
empty-bases.exe empty-bases-cpp.exe \
fallthrough.exe fallthrough-cpp.exe \
flags.exe flags-cpp.exe \
inline.exe inline-cpp.exe \
likely.exe likely-cpp.exe \
malloc.exe malloc-cpp.exe \
message.exe message-cpp.exe \
noinline.exe noinline-cpp.exe \
no-escape.exe no-escape-cpp.exe \
no-return.exe no-return-cpp.exe \
non-null.exe non-null-cpp.exe \
predict.exe predict-cpp.exe \
printf-format.exe printf-format-cpp.exe \
pure.exe pure-cpp.exe \
require.exe require-cpp.exe \
restrict.exe restrict-cpp.exe \
returns-non-null.exe returns-non-null-cpp.exe \
sentinel.exe sentinel-cpp.exe \
static-assert.exe static-assert-cpp.exe \
stringify.exe stringify-cpp.exe \
unknown-cpp-attributes.exe unknown-cpp-attributes-cpp.exe \
unknown-pragmas.exe unknown-pragmas-cpp.exe \
unavailable.exe unavailable-cpp.exe \
unreachable.exe unreachable-cpp.exe \
unused-function.exe unused-function-cpp.exe \
visibility.exe visibility-cpp.exe \
warn.exe warn-cpp.exe \
warn-unused-result.exe warn-unused-result-cpp.exe \
$(NULL)
CLEANFILES = $(TESTS) \
array-param.cpp array-param.exe array-param-cpp.exe array-param.map array-param-cpp.map \
assume.cpp assume.exe assume-cpp.exe assume.map assume-cpp.map \
cast.cpp cast.exe cast-cpp.exe cast.map cast-cpp.map \
concat.cpp concat.exe concat-cpp.exe concat.map concat-cpp.map \
const.cpp const.exe const-cpp.exe const.map const-cpp.map \
constant.cpp constant.exe constant-cpp.exe constant.map constant-cpp.map \
deprecated.cpp deprecated.exe deprecated-cpp.exe deprecated.map deprecated-cpp.map \
empty-bases.cpp empty-bases.exe empty-bases-cpp.exe empty-bases.map empty-bases-cpp.map \
fallthrough.cpp fallthrough.exe fallthrough-cpp.exe fallthrough.map fallthrough-cpp.map \
flags.cpp flags.exe flags-cpp.exe flags.map flags-cpp.map \
inline.cpp inline.exe inline-cpp.exe inline.map inline-cpp.map \
likely.cpp likely.exe likely-cpp.exe likely.map likely-cpp.map \
malloc.cpp malloc.exe malloc-cpp.exe malloc.map malloc-cpp.map \
message.cpp message.exe message-cpp.exe message.map message-cpp.map \
noinline.cpp noinline.exe noinline-cpp.exe noinline.map noinline-cpp.map \
no-escape.cpp no-escape.exe no-escape-cpp.exe no-escape.map no-escape-cpp.map \
no-return.cpp no-return.exe no-return-cpp.exe no-return.map no-return-cpp.map \
non-null.cpp non-null.exe non-null-cpp.exe non-null.map non-null-cpp.map \
predict.cpp predict.exe predict-cpp.exe predict.map predict-cpp.map \
printf-format.cpp printf-format.exe printf-format-cpp.exe printf-format.map printf-format-cpp.map \
pure.cpp pure.exe pure-cpp.exe pure.map pure-cpp.map \
require.cpp require.exe require-cpp.exe require.map require-cpp.map \
restrict.cpp restrict.exe restrict-cpp.exe restrict.map restrict-cpp.map \
returns-non-null.cpp returns-non-null.exe returns-non-null-cpp.exe returns-non-null.map returns-non-null-cpp.map \
sentinel.cpp sentinel.exe sentinel-cpp.exe sentinel.map sentinel-cpp.map \
static-assert.cpp static-assert.exe static-assert-cpp.exe static-assert.map static-assert-cpp.map \
stringify.cpp stringify.exe stringify-cpp.exe stringify.map stringify-cpp.map \
unknown-cpp-attributes.cpp unknown-cpp-attributes.exe unknown-cpp-attributes-cpp.exe unknown-cpp-attributes.map unknown-cpp-attributes-cpp.map \
unknown-pragmas.cpp unknown-pragmas.exe unknown-pragmas-cpp.exe unknown-pragmas.map unknown-pragmas-cpp.map \
unavailable.cpp unavailable.exe unavailable-cpp.exe unavailable.map unavailable-cpp.map \
unreachable.cpp unreachable.exe unreachable-cpp.exe unreachable.map unreachable-cpp.map \
unused-function.cpp unused-function.exe unused-function-cpp.exe unused-function.map unused-function-cpp.map \
visibility.cpp visibility.exe visibility-cpp.exe visibility.map visibility-cpp.map \
warn.cpp warn.exe warn-cpp.exe warn.map warn-cpp.map \
warn-unused-result.cpp warn-unused-result.exe warn-unused-result-cpp.exe warn-unused-result.map warn-unused-result-cpp.map \
$(NULL)
all: $(TESTS)
clean:
del /Q $(CLEANFILES)
array-param.exe: array-param.c
$(CC) $(CFLAGS) -o $(@) $(?)
array-param.cpp: array-param.c
copy /Y $(?) $(@) >NUL
array-param-cpp.exe: array-param.cpp
$(CXX) $(CXXFLAGS) -o $(@) $(?)
assume.exe: assume.c
$(CC) $(CFLAGS) -o $(@) $(?)
assume.cpp: assume.c
copy /Y $(?) $(@) >NUL
assume-cpp.exe: assume.cpp
$(CXX) $(CXXFLAGS) -o $(@) $(?)
cast.exe: cast.c
$(CC) $(CFLAGS) -o $(@) $(?)
cast.cpp: cast.c
copy /Y $(?) $(@) >NUL
cast-cpp.exe: cast.cpp
$(CXX) $(CXXFLAGS) -o $(@) $(?)
concat.exe: concat.c
$(CC) $(CFLAGS) -o $(@) $(?)
concat.cpp: concat.c
copy /Y $(?) $(@) >NUL
concat-cpp.exe: concat.cpp
$(CXX) $(CXXFLAGS) -o $(@) $(?)
const.exe: const.c
$(CC) $(CFLAGS) -o $(@) $(?)
const.cpp: const.c
copy /Y $(?) $(@) >NUL
const-cpp.exe: const.cpp
$(CXX) $(CXXFLAGS) -o $(@) $(?)
constant.exe: constant.c
$(CC) $(CFLAGS) -o $(@) $(?)
constant.cpp: constant.c
copy /Y $(?) $(@) >NUL
constant-cpp.exe: constant.cpp
$(CXX) $(CXXFLAGS) -o $(@) $(?)
deprecated.exe: deprecated.c
$(CC) $(CFLAGS) -o $(@) $(?)
deprecated.cpp: deprecated.c
copy /Y $(?) $(@) >NUL
deprecated-cpp.exe: deprecated.cpp
$(CXX) $(CXXFLAGS) -o $(@) $(?)
empty-bases.exe: empty-bases.c
$(CC) $(CFLAGS) -o $(@) $(?)
empty-bases.cpp: empty-bases.c
copy /Y $(?) $(@) >NUL
empty-bases-cpp.exe: empty-bases.cpp
$(CXX) $(CXXFLAGS) -o $(@) $(?)
fallthrough.exe: fallthrough.c
$(CC) $(CFLAGS) -o $(@) $(?)
fallthrough.cpp: fallthrough.c
copy /Y $(?) $(@) >NUL
fallthrough-cpp.exe: fallthrough.cpp
$(CXX) $(CXXFLAGS) -o $(@) $(?)
flags.exe: flags.c
$(CC) $(CFLAGS) -o $(@) $(?)
flags.cpp: flags.c
copy /Y $(?) $(@) >NUL
flags-cpp.exe: flags.cpp
$(CXX) $(CXXFLAGS) -o $(@) $(?)
inline.exe: inline.c
$(CC) $(CFLAGS) -o $(@) $(?)
inline.cpp: inline.c
copy /Y $(?) $(@) >NUL
inline-cpp.exe: inline.cpp
$(CXX) $(CXXFLAGS) -o $(@) $(?)
likely.exe: likely.c
$(CC) $(CFLAGS) -o $(@) $(?)
likely.cpp: likely.c
copy /Y $(?) $(@) >NUL
likely-cpp.exe: likely.cpp
$(CXX) $(CXXFLAGS) -o $(@) $(?)
malloc.exe: malloc.c
$(CC) $(CFLAGS) -o $(@) $(?)
malloc.cpp: malloc.c
copy /Y $(?) $(@) >NUL
malloc-cpp.exe: malloc.cpp
$(CXX) $(CXXFLAGS) -o $(@) $(?)
message.exe: message.c
$(CC) $(CFLAGS) -o $(@) $(?)
message.cpp: message.c
copy /Y $(?) $(@) >NUL
message-cpp.exe: message.cpp
$(CXX) $(CXXFLAGS) -o $(@) $(?)
noinline.exe: noinline.c
$(CC) $(CFLAGS) -o $(@) $(?)
noinline.cpp: noinline.c
copy /Y $(?) $(@) >NUL
noinline-cpp.exe: noinline.cpp
$(CXX) $(CXXFLAGS) -o $(@) $(?)
no-escape.exe: no-escape.c
$(CC) $(CFLAGS) -o $(@) $(?)
no-escape.cpp: no-escape.c
copy /Y $(?) $(@) >NUL
no-escape-cpp.exe: no-escape.cpp
$(CXX) $(CXXFLAGS) -o $(@) $(?)
no-return.exe: no-return.c
$(CC) $(CFLAGS) -o $(@) $(?)
no-return.cpp: no-return.c
copy /Y $(?) $(@) >NUL
no-return-cpp.exe: no-return.cpp
$(CXX) $(CXXFLAGS) -o $(@) $(?)
non-null.exe: non-null.c
$(CC) $(CFLAGS) -o $(@) $(?)
non-null.cpp: non-null.c
copy /Y $(?) $(@) >NUL
non-null-cpp.exe: non-null.cpp
$(CXX) $(CXXFLAGS) -o $(@) $(?)
predict.exe: predict.c
$(CC) $(CFLAGS) -o $(@) $(?)
predict.cpp: predict.c
copy /Y $(?) $(@) >NUL
predict-cpp.exe: predict.cpp
$(CXX) $(CXXFLAGS) -o $(@) $(?)
printf-format.exe: printf-format.c
$(CC) $(CFLAGS) -o $(@) $(?)
printf-format.cpp: printf-format.c
copy /Y $(?) $(@) >NUL
printf-format-cpp.exe: printf-format.cpp
$(CXX) $(CXXFLAGS) -o $(@) $(?)
pure.exe: pure.c
$(CC) $(CFLAGS) -o $(@) $(?)
pure.cpp: pure.c
copy /Y $(?) $(@) >NUL
pure-cpp.exe: pure.cpp
$(CXX) $(CXXFLAGS) -o $(@) $(?)
require.exe: require.c
$(CC) $(CFLAGS) -o $(@) $(?)
require.cpp: require.c
copy /Y $(?) $(@) >NUL
require-cpp.exe: require.cpp
$(CXX) $(CXXFLAGS) -o $(@) $(?)
restrict.exe: restrict.c
$(CC) $(CFLAGS) -o $(@) $(?)
restrict.cpp: restrict.c
copy /Y $(?) $(@) >NUL
restrict-cpp.exe: restrict.cpp
$(CXX) $(CXXFLAGS) -o $(@) $(?)
returns-non-null.exe: returns-non-null.c
$(CC) $(CFLAGS) -o $(@) $(?)
returns-non-null.cpp: returns-non-null.c
copy /Y $(?) $(@) >NUL
returns-non-null-cpp.exe: returns-non-null.cpp
$(CXX) $(CXXFLAGS) -o $(@) $(?)
sentinel.exe: sentinel.c
$(CC) $(CFLAGS) -o $(@) $(?)
sentinel.cpp: sentinel.c
copy /Y $(?) $(@) >NUL
sentinel-cpp.exe: sentinel.cpp
$(CXX) $(CXXFLAGS) -o $(@) $(?)
static-assert.exe: static-assert.c
$(CC) $(CFLAGS) -o $(@) $(?)
static-assert.cpp: static-assert.c
copy /Y $(?) $(@) >NUL
static-assert-cpp.exe: static-assert.cpp
$(CXX) $(CXXFLAGS) -o $(@) $(?)
stringify.exe: stringify.c
$(CC) $(CFLAGS) -o $(@) $(?)
stringify.cpp: stringify.c
copy /Y $(?) $(@) >NUL
stringify-cpp.exe: stringify.cpp
$(CXX) $(CXXFLAGS) -o $(@) $(?)
unknown-cpp-attributes.exe: unknown-cpp-attributes.c
$(CC) $(CFLAGS) -o $(@) $(?)
unknown-cpp-attributes.cpp: unknown-cpp-attributes.c
copy /Y $(?) $(@) >NUL
unknown-cpp-attributes-cpp.exe: unknown-cpp-attributes.cpp
$(CXX) $(CXXFLAGS) -o $(@) $(?)
unknown-pragmas.exe: unknown-pragmas.c
$(CC) $(CFLAGS) -o $(@) $(?)
unknown-pragmas.cpp: unknown-pragmas.c
copy /Y $(?) $(@) >NUL
unknown-pragmas-cpp.exe: unknown-pragmas.cpp
$(CXX) $(CXXFLAGS) -o $(@) $(?)
unavailable.exe: unavailable.c
$(CC) $(CFLAGS) -o $(@) $(?)
unavailable.cpp: unavailable.c
copy /Y $(?) $(@) >NUL
unavailable-cpp.exe: unavailable.cpp
$(CXX) $(CXXFLAGS) -o $(@) $(?)
unreachable.exe: unreachable.c
$(CC) $(CFLAGS) -o $(@) $(?)
unreachable.cpp: unreachable.c
copy /Y $(?) $(@) >NUL
unreachable-cpp.exe: unreachable.cpp
$(CXX) $(CXXFLAGS) -o $(@) $(?)
unused-function.exe: unused-function.c
$(CC) $(CFLAGS) -o $(@) $(?)
unused-function.cpp: unused-function.c
copy /Y $(?) $(@) >NUL
unused-function-cpp.exe: unused-function.cpp
$(CXX) $(CXXFLAGS) -o $(@) $(?)
visibility.exe: visibility.c
$(CC) $(CFLAGS) -o $(@) $(?)
visibility.cpp: visibility.c
copy /Y $(?) $(@) >NUL
visibility-cpp.exe: visibility.cpp
$(CXX) $(CXXFLAGS) -o $(@) $(?)
warn.exe: warn.c
$(CC) $(CFLAGS) -o $(@) $(?)
warn.cpp: warn.c
copy /Y $(?) $(@) >NUL
warn-cpp.exe: warn.cpp
$(CXX) $(CXXFLAGS) -o $(@) $(?)
warn-unused-result.exe: warn-unused-result.c
$(CC) $(CFLAGS) -o $(@) $(?)
warn-unused-result.cpp: warn-unused-result.c
copy /Y $(?) $(@) >NUL
warn-unused-result-cpp.exe: warn-unused-result.cpp
$(CXX) $(CXXFLAGS) -o $(@) $(?)

333
thirdparty/hedley/test/Makefile.iar vendored Normal file
View file

@ -0,0 +1,333 @@
# Generated by Makefile. Do not edit.
CC = "C:\Program Files (x86)\IAR Systems\Embedded Workbench 8.4\arm\bin\iccarm.exe"
CXX = $(CC)
CFLAGS = --silent --remarks --warnings_are_errors
CXXFLAGS = --c++ $(CFLAGS)
TESTS = \
array-param.o array-param-cpp.o \
assume.o assume-cpp.o \
cast.o cast-cpp.o \
concat.o concat-cpp.o \
const.o const-cpp.o \
constant.o constant-cpp.o \
deprecated.o deprecated-cpp.o \
empty-bases.o empty-bases-cpp.o \
fallthrough.o fallthrough-cpp.o \
flags.o flags-cpp.o \
inline.o inline-cpp.o \
likely.o likely-cpp.o \
malloc.o malloc-cpp.o \
message.o message-cpp.o \
noinline.o noinline-cpp.o \
no-escape.o no-escape-cpp.o \
no-return.o no-return-cpp.o \
non-null.o non-null-cpp.o \
predict.o predict-cpp.o \
printf-format.o printf-format-cpp.o \
pure.o pure-cpp.o \
require.o require-cpp.o \
restrict.o restrict-cpp.o \
returns-non-null.o returns-non-null-cpp.o \
sentinel.o sentinel-cpp.o \
static-assert.o static-assert-cpp.o \
stringify.o stringify-cpp.o \
unknown-cpp-attributes.o unknown-cpp-attributes-cpp.o \
unknown-pragmas.o unknown-pragmas-cpp.o \
unavailable.o unavailable-cpp.o \
unreachable.o unreachable-cpp.o \
unused-function.o unused-function-cpp.o \
visibility.o visibility-cpp.o \
warn.o warn-cpp.o \
warn-unused-result.o warn-unused-result-cpp.o \
$(NULL)
CLEANFILES = $(TESTS) \
array-param.cpp array-param.o array-param-cpp.o \
assume.cpp assume.o assume-cpp.o \
cast.cpp cast.o cast-cpp.o \
concat.cpp concat.o concat-cpp.o \
const.cpp const.o const-cpp.o \
constant.cpp constant.o constant-cpp.o \
deprecated.cpp deprecated.o deprecated-cpp.o \
empty-bases.cpp empty-bases.o empty-bases-cpp.o \
fallthrough.cpp fallthrough.o fallthrough-cpp.o \
flags.cpp flags.o flags-cpp.o \
inline.cpp inline.o inline-cpp.o \
likely.cpp likely.o likely-cpp.o \
malloc.cpp malloc.o malloc-cpp.o \
message.cpp message.o message-cpp.o \
noinline.cpp noinline.o noinline-cpp.o \
no-escape.cpp no-escape.o no-escape-cpp.o \
no-return.cpp no-return.o no-return-cpp.o \
non-null.cpp non-null.o non-null-cpp.o \
predict.cpp predict.o predict-cpp.o \
printf-format.cpp printf-format.o printf-format-cpp.o \
pure.cpp pure.o pure-cpp.o \
require.cpp require.o require-cpp.o \
restrict.cpp restrict.o restrict-cpp.o \
returns-non-null.cpp returns-non-null.o returns-non-null-cpp.o \
sentinel.cpp sentinel.o sentinel-cpp.o \
static-assert.cpp static-assert.o static-assert-cpp.o \
stringify.cpp stringify.o stringify-cpp.o \
unknown-cpp-attributes.cpp unknown-cpp-attributes.o unknown-cpp-attributes-cpp.o \
unknown-pragmas.cpp unknown-pragmas.o unknown-pragmas-cpp.o \
unavailable.cpp unavailable.o unavailable-cpp.o \
unreachable.cpp unreachable.o unreachable-cpp.o \
unused-function.cpp unused-function.o unused-function-cpp.o \
visibility.cpp visibility.o visibility-cpp.o \
warn.cpp warn.o warn-cpp.o \
warn-unused-result.cpp warn-unused-result.o warn-unused-result-cpp.o \
$(NULL)
all: $(TESTS)
clean:
del /Q $(CLEANFILES)
array-param.o: array-param.c
$(CC) $(CFLAGS) --output $(@) $(?)
array-param.cpp: array-param.c
copy /Y $(?) $(@) >NUL
array-param-cpp.o: array-param.cpp
$(CXX) $(CXXFLAGS) --output $(@) $(?)
assume.o: assume.c
$(CC) $(CFLAGS) --output $(@) $(?)
assume.cpp: assume.c
copy /Y $(?) $(@) >NUL
assume-cpp.o: assume.cpp
$(CXX) $(CXXFLAGS) --output $(@) $(?)
cast.o: cast.c
$(CC) $(CFLAGS) --output $(@) $(?)
cast.cpp: cast.c
copy /Y $(?) $(@) >NUL
cast-cpp.o: cast.cpp
$(CXX) $(CXXFLAGS) --output $(@) $(?)
concat.o: concat.c
$(CC) $(CFLAGS) --output $(@) $(?)
concat.cpp: concat.c
copy /Y $(?) $(@) >NUL
concat-cpp.o: concat.cpp
$(CXX) $(CXXFLAGS) --output $(@) $(?)
const.o: const.c
$(CC) $(CFLAGS) --output $(@) $(?)
const.cpp: const.c
copy /Y $(?) $(@) >NUL
const-cpp.o: const.cpp
$(CXX) $(CXXFLAGS) --output $(@) $(?)
constant.o: constant.c
$(CC) $(CFLAGS) --output $(@) $(?)
constant.cpp: constant.c
copy /Y $(?) $(@) >NUL
constant-cpp.o: constant.cpp
$(CXX) $(CXXFLAGS) --output $(@) $(?)
deprecated.o: deprecated.c
$(CC) $(CFLAGS) --output $(@) $(?)
deprecated.cpp: deprecated.c
copy /Y $(?) $(@) >NUL
deprecated-cpp.o: deprecated.cpp
$(CXX) $(CXXFLAGS) --output $(@) $(?)
empty-bases.o: empty-bases.c
$(CC) $(CFLAGS) --output $(@) $(?)
empty-bases.cpp: empty-bases.c
copy /Y $(?) $(@) >NUL
empty-bases-cpp.o: empty-bases.cpp
$(CXX) $(CXXFLAGS) --output $(@) $(?)
fallthrough.o: fallthrough.c
$(CC) $(CFLAGS) --output $(@) $(?)
fallthrough.cpp: fallthrough.c
copy /Y $(?) $(@) >NUL
fallthrough-cpp.o: fallthrough.cpp
$(CXX) $(CXXFLAGS) --output $(@) $(?)
flags.o: flags.c
$(CC) $(CFLAGS) --output $(@) $(?)
flags.cpp: flags.c
copy /Y $(?) $(@) >NUL
flags-cpp.o: flags.cpp
$(CXX) $(CXXFLAGS) --output $(@) $(?)
inline.o: inline.c
$(CC) $(CFLAGS) --output $(@) $(?)
inline.cpp: inline.c
copy /Y $(?) $(@) >NUL
inline-cpp.o: inline.cpp
$(CXX) $(CXXFLAGS) --output $(@) $(?)
likely.o: likely.c
$(CC) $(CFLAGS) --output $(@) $(?)
likely.cpp: likely.c
copy /Y $(?) $(@) >NUL
likely-cpp.o: likely.cpp
$(CXX) $(CXXFLAGS) --output $(@) $(?)
malloc.o: malloc.c
$(CC) $(CFLAGS) --output $(@) $(?)
malloc.cpp: malloc.c
copy /Y $(?) $(@) >NUL
malloc-cpp.o: malloc.cpp
$(CXX) $(CXXFLAGS) --output $(@) $(?)
message.o: message.c
$(CC) $(CFLAGS) --output $(@) $(?)
message.cpp: message.c
copy /Y $(?) $(@) >NUL
message-cpp.o: message.cpp
$(CXX) $(CXXFLAGS) --output $(@) $(?)
noinline.o: noinline.c
$(CC) $(CFLAGS) --output $(@) $(?)
noinline.cpp: noinline.c
copy /Y $(?) $(@) >NUL
noinline-cpp.o: noinline.cpp
$(CXX) $(CXXFLAGS) --output $(@) $(?)
no-escape.o: no-escape.c
$(CC) $(CFLAGS) --output $(@) $(?)
no-escape.cpp: no-escape.c
copy /Y $(?) $(@) >NUL
no-escape-cpp.o: no-escape.cpp
$(CXX) $(CXXFLAGS) --output $(@) $(?)
no-return.o: no-return.c
$(CC) $(CFLAGS) --output $(@) $(?)
no-return.cpp: no-return.c
copy /Y $(?) $(@) >NUL
no-return-cpp.o: no-return.cpp
$(CXX) $(CXXFLAGS) --output $(@) $(?)
non-null.o: non-null.c
$(CC) $(CFLAGS) --output $(@) $(?)
non-null.cpp: non-null.c
copy /Y $(?) $(@) >NUL
non-null-cpp.o: non-null.cpp
$(CXX) $(CXXFLAGS) --output $(@) $(?)
predict.o: predict.c
$(CC) $(CFLAGS) --output $(@) $(?)
predict.cpp: predict.c
copy /Y $(?) $(@) >NUL
predict-cpp.o: predict.cpp
$(CXX) $(CXXFLAGS) --output $(@) $(?)
printf-format.o: printf-format.c
$(CC) $(CFLAGS) --output $(@) $(?)
printf-format.cpp: printf-format.c
copy /Y $(?) $(@) >NUL
printf-format-cpp.o: printf-format.cpp
$(CXX) $(CXXFLAGS) --output $(@) $(?)
pure.o: pure.c
$(CC) $(CFLAGS) --output $(@) $(?)
pure.cpp: pure.c
copy /Y $(?) $(@) >NUL
pure-cpp.o: pure.cpp
$(CXX) $(CXXFLAGS) --output $(@) $(?)
require.o: require.c
$(CC) $(CFLAGS) --output $(@) $(?)
require.cpp: require.c
copy /Y $(?) $(@) >NUL
require-cpp.o: require.cpp
$(CXX) $(CXXFLAGS) --output $(@) $(?)
restrict.o: restrict.c
$(CC) $(CFLAGS) --output $(@) $(?)
restrict.cpp: restrict.c
copy /Y $(?) $(@) >NUL
restrict-cpp.o: restrict.cpp
$(CXX) $(CXXFLAGS) --output $(@) $(?)
returns-non-null.o: returns-non-null.c
$(CC) $(CFLAGS) --output $(@) $(?)
returns-non-null.cpp: returns-non-null.c
copy /Y $(?) $(@) >NUL
returns-non-null-cpp.o: returns-non-null.cpp
$(CXX) $(CXXFLAGS) --output $(@) $(?)
sentinel.o: sentinel.c
$(CC) $(CFLAGS) --output $(@) $(?)
sentinel.cpp: sentinel.c
copy /Y $(?) $(@) >NUL
sentinel-cpp.o: sentinel.cpp
$(CXX) $(CXXFLAGS) --output $(@) $(?)
static-assert.o: static-assert.c
$(CC) $(CFLAGS) --output $(@) $(?)
static-assert.cpp: static-assert.c
copy /Y $(?) $(@) >NUL
static-assert-cpp.o: static-assert.cpp
$(CXX) $(CXXFLAGS) --output $(@) $(?)
stringify.o: stringify.c
$(CC) $(CFLAGS) --output $(@) $(?)
stringify.cpp: stringify.c
copy /Y $(?) $(@) >NUL
stringify-cpp.o: stringify.cpp
$(CXX) $(CXXFLAGS) --output $(@) $(?)
unknown-cpp-attributes.o: unknown-cpp-attributes.c
$(CC) $(CFLAGS) --output $(@) $(?)
unknown-cpp-attributes.cpp: unknown-cpp-attributes.c
copy /Y $(?) $(@) >NUL
unknown-cpp-attributes-cpp.o: unknown-cpp-attributes.cpp
$(CXX) $(CXXFLAGS) --output $(@) $(?)
unknown-pragmas.o: unknown-pragmas.c
$(CC) $(CFLAGS) --output $(@) $(?)
unknown-pragmas.cpp: unknown-pragmas.c
copy /Y $(?) $(@) >NUL
unknown-pragmas-cpp.o: unknown-pragmas.cpp
$(CXX) $(CXXFLAGS) --output $(@) $(?)
unavailable.o: unavailable.c
$(CC) $(CFLAGS) --output $(@) $(?)
unavailable.cpp: unavailable.c
copy /Y $(?) $(@) >NUL
unavailable-cpp.o: unavailable.cpp
$(CXX) $(CXXFLAGS) --output $(@) $(?)
unreachable.o: unreachable.c
$(CC) $(CFLAGS) --output $(@) $(?)
unreachable.cpp: unreachable.c
copy /Y $(?) $(@) >NUL
unreachable-cpp.o: unreachable.cpp
$(CXX) $(CXXFLAGS) --output $(@) $(?)
unused-function.o: unused-function.c
$(CC) $(CFLAGS) --output $(@) $(?)
unused-function.cpp: unused-function.c
copy /Y $(?) $(@) >NUL
unused-function-cpp.o: unused-function.cpp
$(CXX) $(CXXFLAGS) --output $(@) $(?)
visibility.o: visibility.c
$(CC) $(CFLAGS) --output $(@) $(?)
visibility.cpp: visibility.c
copy /Y $(?) $(@) >NUL
visibility-cpp.o: visibility.cpp
$(CXX) $(CXXFLAGS) --output $(@) $(?)
warn.o: warn.c
$(CC) $(CFLAGS) --output $(@) $(?)
warn.cpp: warn.c
copy /Y $(?) $(@) >NUL
warn-cpp.o: warn.cpp
$(CXX) $(CXXFLAGS) --output $(@) $(?)
warn-unused-result.o: warn-unused-result.c
$(CC) $(CFLAGS) --output $(@) $(?)
warn-unused-result.cpp: warn-unused-result.c
copy /Y $(?) $(@) >NUL
warn-unused-result-cpp.o: warn-unused-result.cpp
$(CXX) $(CXXFLAGS) --output $(@) $(?)

361
thirdparty/hedley/test/Makefile.icl vendored Normal file
View file

@ -0,0 +1,361 @@
# Generated by Makefile. Do not edit.
CC = icl
CXX = $(CC)
CFLAGS = /nologo /Wall /wd4464 /wd4514
CXXFLAGS = $(CFLAGS)
TESTS = \
array-param.exe array-param-cpp.exe \
assume.exe assume-cpp.exe \
cast.exe cast-cpp.exe \
concat.exe concat-cpp.exe \
const.exe const-cpp.exe \
constant.exe constant-cpp.exe \
deprecated.exe deprecated-cpp.exe \
empty-bases.exe empty-bases-cpp.exe \
fallthrough.exe fallthrough-cpp.exe \
flags.exe flags-cpp.exe \
inline.exe inline-cpp.exe \
likely.exe likely-cpp.exe \
malloc.exe malloc-cpp.exe \
message.exe message-cpp.exe \
noinline.exe noinline-cpp.exe \
no-escape.exe no-escape-cpp.exe \
no-return.exe no-return-cpp.exe \
non-null.exe non-null-cpp.exe \
predict.exe predict-cpp.exe \
printf-format.exe printf-format-cpp.exe \
pure.exe pure-cpp.exe \
require.exe require-cpp.exe \
restrict.exe restrict-cpp.exe \
returns-non-null.exe returns-non-null-cpp.exe \
sentinel.exe sentinel-cpp.exe \
static-assert.exe static-assert-cpp.exe \
stringify.exe stringify-cpp.exe \
unknown-cpp-attributes.exe unknown-cpp-attributes-cpp.exe \
unknown-pragmas.exe unknown-pragmas-cpp.exe \
unavailable.exe unavailable-cpp.exe \
unreachable.exe unreachable-cpp.exe \
visibility.exe visibility-cpp.exe \
warn.exe warn-cpp.exe \
warn-unused-result.exe warn-unused-result-cpp.exe \
$(NULL)
TESTS = \
array-param.exe array-param-cpp.exe \
assume.exe assume-cpp.exe \
cast.exe cast-cpp.exe \
concat.exe concat-cpp.exe \
const.exe const-cpp.exe \
constant.exe constant-cpp.exe \
deprecated.exe deprecated-cpp.exe \
empty-bases.exe empty-bases-cpp.exe \
fallthrough.exe fallthrough-cpp.exe \
flags.exe flags-cpp.exe \
inline.exe inline-cpp.exe \
likely.exe likely-cpp.exe \
malloc.exe malloc-cpp.exe \
message.exe message-cpp.exe \
noinline.exe noinline-cpp.exe \
no-escape.exe no-escape-cpp.exe \
no-return.exe no-return-cpp.exe \
non-null.exe non-null-cpp.exe \
predict.exe predict-cpp.exe \
printf-format.exe printf-format-cpp.exe \
pure.exe pure-cpp.exe \
require.exe require-cpp.exe \
restrict.exe restrict-cpp.exe \
returns-non-null.exe returns-non-null-cpp.exe \
sentinel.exe sentinel-cpp.exe \
static-assert.exe static-assert-cpp.exe \
stringify.exe stringify-cpp.exe \
unknown-cpp-attributes.exe unknown-cpp-attributes-cpp.exe \
unknown-pragmas.exe unknown-pragmas-cpp.exe \
unavailable.exe unavailable-cpp.exe \
unreachable.exe unreachable-cpp.exe \
visibility.exe visibility-cpp.exe \
warn.exe warn-cpp.exe \
warn-unused-result.exe warn-unused-result-cpp.exe \
$(NULL)
CLEANFILES = $(TESTS) \
array-param.cpp array-param.obj array-param.lib array-param-cpp.exp array-param-cpp.lib \
assume.cpp assume.obj assume.lib assume-cpp.exp assume-cpp.lib \
cast.cpp cast.obj cast.lib cast-cpp.exp cast-cpp.lib \
concat.cpp concat.obj concat.lib concat-cpp.exp concat-cpp.lib \
const.cpp const.obj const.lib const-cpp.exp const-cpp.lib \
constant.cpp constant.obj constant.lib constant-cpp.exp constant-cpp.lib \
deprecated.cpp deprecated.obj deprecated.lib deprecated-cpp.exp deprecated-cpp.lib \
empty-bases.cpp empty-bases.obj empty-bases.lib empty-bases-cpp.exp empty-bases-cpp.lib \
fallthrough.cpp fallthrough.obj fallthrough.lib fallthrough-cpp.exp fallthrough-cpp.lib \
flags.cpp flags.obj flags.lib flags-cpp.exp flags-cpp.lib \
inline.cpp inline.obj inline.lib inline-cpp.exp inline-cpp.lib \
likely.cpp likely.obj likely.lib likely-cpp.exp likely-cpp.lib \
malloc.cpp malloc.obj malloc.lib malloc-cpp.exp malloc-cpp.lib \
message.cpp message.obj message.lib message-cpp.exp message-cpp.lib \
noinline.cpp noinline.obj noinline.lib noinline-cpp.exp noinline-cpp.lib \
no-escape.cpp no-escape.obj no-escape.lib no-escape-cpp.exp no-escape-cpp.lib \
no-return.cpp no-return.obj no-return.lib no-return-cpp.exp no-return-cpp.lib \
non-null.cpp non-null.obj non-null.lib non-null-cpp.exp non-null-cpp.lib \
predict.cpp predict.obj predict.lib predict-cpp.exp predict-cpp.lib \
printf-format.cpp printf-format.obj printf-format.lib printf-format-cpp.exp printf-format-cpp.lib \
pure.cpp pure.obj pure.lib pure-cpp.exp pure-cpp.lib \
require.cpp require.obj require.lib require-cpp.exp require-cpp.lib \
restrict.cpp restrict.obj restrict.lib restrict-cpp.exp restrict-cpp.lib \
returns-non-null.cpp returns-non-null.obj returns-non-null.lib returns-non-null-cpp.exp returns-non-null-cpp.lib \
sentinel.cpp sentinel.obj sentinel.lib sentinel-cpp.exp sentinel-cpp.lib \
static-assert.cpp static-assert.obj static-assert.lib static-assert-cpp.exp static-assert-cpp.lib \
stringify.cpp stringify.obj stringify.lib stringify-cpp.exp stringify-cpp.lib \
unknown-cpp-attributes.cpp unknown-cpp-attributes.obj unknown-cpp-attributes.lib unknown-cpp-attributes-cpp.exp unknown-cpp-attributes-cpp.lib \
unknown-pragmas.cpp unknown-pragmas.obj unknown-pragmas.lib unknown-pragmas-cpp.exp unknown-pragmas-cpp.lib \
unavailable.cpp unavailable.obj unavailable.lib unavailable-cpp.exp unavailable-cpp.lib \
unreachable.cpp unreachable.obj unreachable.lib unreachable-cpp.exp unreachable-cpp.lib \
visibility.cpp visibility.obj visibility.lib visibility-cpp.exp visibility-cpp.lib \
warn.cpp warn.obj warn.lib warn-cpp.exp warn-cpp.lib \
warn-unused-result.cpp warn-unused-result.obj warn-unused-result.lib warn-unused-result-cpp.exp warn-unused-result-cpp.lib \
$(NULL)
all: $(TESTS)
clean:
del /Q $(CLEANFILES)
array-param.exe: array-param.c
$(CC) $(CFLAGS) /Fe$(@) $(?)
array-param.cpp: array-param.c
copy /Y $(?) $(@) >NUL
array-param-cpp.exe: array-param.cpp
$(CXX) $(CXXFLAGS) /Fe$(@) $(?)
assume.exe: assume.c
$(CC) $(CFLAGS) /Fe$(@) $(?)
assume.cpp: assume.c
copy /Y $(?) $(@) >NUL
assume-cpp.exe: assume.cpp
$(CXX) $(CXXFLAGS) /Fe$(@) $(?)
cast.exe: cast.c
$(CC) $(CFLAGS) /Fe$(@) $(?)
cast.cpp: cast.c
copy /Y $(?) $(@) >NUL
cast-cpp.exe: cast.cpp
$(CXX) $(CXXFLAGS) /Fe$(@) $(?)
concat.exe: concat.c
$(CC) $(CFLAGS) /Fe$(@) $(?)
concat.cpp: concat.c
copy /Y $(?) $(@) >NUL
concat-cpp.exe: concat.cpp
$(CXX) $(CXXFLAGS) /Fe$(@) $(?)
const.exe: const.c
$(CC) $(CFLAGS) /Fe$(@) $(?)
const.cpp: const.c
copy /Y $(?) $(@) >NUL
const-cpp.exe: const.cpp
$(CXX) $(CXXFLAGS) /Fe$(@) $(?)
constant.exe: constant.c
$(CC) $(CFLAGS) /Fe$(@) $(?)
constant.cpp: constant.c
copy /Y $(?) $(@) >NUL
constant-cpp.exe: constant.cpp
$(CXX) $(CXXFLAGS) /Fe$(@) $(?)
deprecated.exe: deprecated.c
$(CC) $(CFLAGS) /Fe$(@) $(?)
deprecated.cpp: deprecated.c
copy /Y $(?) $(@) >NUL
deprecated-cpp.exe: deprecated.cpp
$(CXX) $(CXXFLAGS) /Fe$(@) $(?)
empty-bases.exe: empty-bases.c
$(CC) $(CFLAGS) /Fe$(@) $(?)
empty-bases.cpp: empty-bases.c
copy /Y $(?) $(@) >NUL
empty-bases-cpp.exe: empty-bases.cpp
$(CXX) $(CXXFLAGS) /Fe$(@) $(?)
fallthrough.exe: fallthrough.c
$(CC) $(CFLAGS) /Fe$(@) $(?)
fallthrough.cpp: fallthrough.c
copy /Y $(?) $(@) >NUL
fallthrough-cpp.exe: fallthrough.cpp
$(CXX) $(CXXFLAGS) /Fe$(@) $(?)
flags.exe: flags.c
$(CC) $(CFLAGS) /Fe$(@) $(?)
flags.cpp: flags.c
copy /Y $(?) $(@) >NUL
flags-cpp.exe: flags.cpp
$(CXX) $(CXXFLAGS) /Fe$(@) $(?)
inline.exe: inline.c
$(CC) $(CFLAGS) /Fe$(@) $(?)
inline.cpp: inline.c
copy /Y $(?) $(@) >NUL
inline-cpp.exe: inline.cpp
$(CXX) $(CXXFLAGS) /Fe$(@) $(?)
likely.exe: likely.c
$(CC) $(CFLAGS) /Fe$(@) $(?)
likely.cpp: likely.c
copy /Y $(?) $(@) >NUL
likely-cpp.exe: likely.cpp
$(CXX) $(CXXFLAGS) /Fe$(@) $(?)
malloc.exe: malloc.c
$(CC) $(CFLAGS) /Fe$(@) $(?)
malloc.cpp: malloc.c
copy /Y $(?) $(@) >NUL
malloc-cpp.exe: malloc.cpp
$(CXX) $(CXXFLAGS) /Fe$(@) $(?)
message.exe: message.c
$(CC) $(CFLAGS) /Fe$(@) $(?)
message.cpp: message.c
copy /Y $(?) $(@) >NUL
message-cpp.exe: message.cpp
$(CXX) $(CXXFLAGS) /Fe$(@) $(?)
noinline.exe: noinline.c
$(CC) $(CFLAGS) /Fe$(@) $(?)
noinline.cpp: noinline.c
copy /Y $(?) $(@) >NUL
noinline-cpp.exe: noinline.cpp
$(CXX) $(CXXFLAGS) /Fe$(@) $(?)
no-escape.exe: no-escape.c
$(CC) $(CFLAGS) /Fe$(@) $(?)
no-escape.cpp: no-escape.c
copy /Y $(?) $(@) >NUL
no-escape-cpp.exe: no-escape.cpp
$(CXX) $(CXXFLAGS) /Fe$(@) $(?)
no-return.exe: no-return.c
$(CC) $(CFLAGS) /Fe$(@) $(?)
no-return.cpp: no-return.c
copy /Y $(?) $(@) >NUL
no-return-cpp.exe: no-return.cpp
$(CXX) $(CXXFLAGS) /Fe$(@) $(?)
non-null.exe: non-null.c
$(CC) $(CFLAGS) /Fe$(@) $(?)
non-null.cpp: non-null.c
copy /Y $(?) $(@) >NUL
non-null-cpp.exe: non-null.cpp
$(CXX) $(CXXFLAGS) /Fe$(@) $(?)
predict.exe: predict.c
$(CC) $(CFLAGS) /Fe$(@) $(?)
predict.cpp: predict.c
copy /Y $(?) $(@) >NUL
predict-cpp.exe: predict.cpp
$(CXX) $(CXXFLAGS) /Fe$(@) $(?)
printf-format.exe: printf-format.c
$(CC) $(CFLAGS) /Fe$(@) $(?)
printf-format.cpp: printf-format.c
copy /Y $(?) $(@) >NUL
printf-format-cpp.exe: printf-format.cpp
$(CXX) $(CXXFLAGS) /Fe$(@) $(?)
pure.exe: pure.c
$(CC) $(CFLAGS) /Fe$(@) $(?)
pure.cpp: pure.c
copy /Y $(?) $(@) >NUL
pure-cpp.exe: pure.cpp
$(CXX) $(CXXFLAGS) /Fe$(@) $(?)
require.exe: require.c
$(CC) $(CFLAGS) /Fe$(@) $(?)
require.cpp: require.c
copy /Y $(?) $(@) >NUL
require-cpp.exe: require.cpp
$(CXX) $(CXXFLAGS) /Fe$(@) $(?)
restrict.exe: restrict.c
$(CC) $(CFLAGS) /Fe$(@) $(?)
restrict.cpp: restrict.c
copy /Y $(?) $(@) >NUL
restrict-cpp.exe: restrict.cpp
$(CXX) $(CXXFLAGS) /Fe$(@) $(?)
returns-non-null.exe: returns-non-null.c
$(CC) $(CFLAGS) /Fe$(@) $(?)
returns-non-null.cpp: returns-non-null.c
copy /Y $(?) $(@) >NUL
returns-non-null-cpp.exe: returns-non-null.cpp
$(CXX) $(CXXFLAGS) /Fe$(@) $(?)
sentinel.exe: sentinel.c
$(CC) $(CFLAGS) /Fe$(@) $(?)
sentinel.cpp: sentinel.c
copy /Y $(?) $(@) >NUL
sentinel-cpp.exe: sentinel.cpp
$(CXX) $(CXXFLAGS) /Fe$(@) $(?)
static-assert.exe: static-assert.c
$(CC) $(CFLAGS) /Fe$(@) $(?)
static-assert.cpp: static-assert.c
copy /Y $(?) $(@) >NUL
static-assert-cpp.exe: static-assert.cpp
$(CXX) $(CXXFLAGS) /Fe$(@) $(?)
stringify.exe: stringify.c
$(CC) $(CFLAGS) /Fe$(@) $(?)
stringify.cpp: stringify.c
copy /Y $(?) $(@) >NUL
stringify-cpp.exe: stringify.cpp
$(CXX) $(CXXFLAGS) /Fe$(@) $(?)
unknown-cpp-attributes.exe: unknown-cpp-attributes.c
$(CC) $(CFLAGS) /Fe$(@) $(?)
unknown-cpp-attributes.cpp: unknown-cpp-attributes.c
copy /Y $(?) $(@) >NUL
unknown-cpp-attributes-cpp.exe: unknown-cpp-attributes.cpp
$(CXX) $(CXXFLAGS) /Fe$(@) $(?)
unknown-pragmas.exe: unknown-pragmas.c
$(CC) $(CFLAGS) /Fe$(@) $(?)
unknown-pragmas.cpp: unknown-pragmas.c
copy /Y $(?) $(@) >NUL
unknown-pragmas-cpp.exe: unknown-pragmas.cpp
$(CXX) $(CXXFLAGS) /Fe$(@) $(?)
unavailable.exe: unavailable.c
$(CC) $(CFLAGS) /Fe$(@) $(?)
unavailable.cpp: unavailable.c
copy /Y $(?) $(@) >NUL
unavailable-cpp.exe: unavailable.cpp
$(CXX) $(CXXFLAGS) /Fe$(@) $(?)
unreachable.exe: unreachable.c
$(CC) $(CFLAGS) /Fe$(@) $(?)
unreachable.cpp: unreachable.c
copy /Y $(?) $(@) >NUL
unreachable-cpp.exe: unreachable.cpp
$(CXX) $(CXXFLAGS) /Fe$(@) $(?)
visibility.exe: visibility.c
$(CC) $(CFLAGS) /Fe$(@) $(?)
visibility.cpp: visibility.c
copy /Y $(?) $(@) >NUL
visibility-cpp.exe: visibility.cpp
$(CXX) $(CXXFLAGS) /Fe$(@) $(?)
warn.exe: warn.c
$(CC) $(CFLAGS) /Fe$(@) $(?)
warn.cpp: warn.c
copy /Y $(?) $(@) >NUL
warn-cpp.exe: warn.cpp
$(CXX) $(CXXFLAGS) /Fe$(@) $(?)
warn-unused-result.exe: warn-unused-result.c
$(CC) $(CFLAGS) /Fe$(@) $(?)
warn-unused-result.cpp: warn-unused-result.c
copy /Y $(?) $(@) >NUL
warn-unused-result-cpp.exe: warn-unused-result.cpp
$(CXX) $(CXXFLAGS) /Fe$(@) $(?)

371
thirdparty/hedley/test/Makefile.msvc vendored Normal file
View file

@ -0,0 +1,371 @@
# Generated by Makefile. Do not edit.
CC = cl
CXX = $(CC)
CFLAGS = /nologo /Wall /wd4464 /wd4514
CXXFLAGS = $(CFLAGS)
TESTS = \
array-param.exe array-param-cpp.exe \
assume.exe assume-cpp.exe \
cast.exe cast-cpp.exe \
concat.exe concat-cpp.exe \
const.exe const-cpp.exe \
constant.exe constant-cpp.exe \
deprecated.exe deprecated-cpp.exe \
empty-bases.exe empty-bases-cpp.exe \
fallthrough.exe fallthrough-cpp.exe \
flags.exe flags-cpp.exe \
inline.exe inline-cpp.exe \
likely.exe likely-cpp.exe \
malloc.exe malloc-cpp.exe \
message.exe message-cpp.exe \
noinline.exe noinline-cpp.exe \
no-escape.exe no-escape-cpp.exe \
no-return.exe no-return-cpp.exe \
non-null.exe non-null-cpp.exe \
predict.exe predict-cpp.exe \
printf-format.exe printf-format-cpp.exe \
pure.exe pure-cpp.exe \
require.exe require-cpp.exe \
restrict.exe restrict-cpp.exe \
returns-non-null.exe returns-non-null-cpp.exe \
sentinel.exe sentinel-cpp.exe \
static-assert.exe static-assert-cpp.exe \
stringify.exe stringify-cpp.exe \
unknown-cpp-attributes.exe unknown-cpp-attributes-cpp.exe \
unknown-pragmas.exe unknown-pragmas-cpp.exe \
unavailable.exe unavailable-cpp.exe \
unreachable.exe unreachable-cpp.exe \
unused-function.exe unused-function-cpp.exe \
visibility.exe visibility-cpp.exe \
warn.exe warn-cpp.exe \
warn-unused-result.exe warn-unused-result-cpp.exe \
$(NULL)
TESTS = \
array-param.exe array-param-cpp.exe \
assume.exe assume-cpp.exe \
cast.exe cast-cpp.exe \
concat.exe concat-cpp.exe \
const.exe const-cpp.exe \
constant.exe constant-cpp.exe \
deprecated.exe deprecated-cpp.exe \
empty-bases.exe empty-bases-cpp.exe \
fallthrough.exe fallthrough-cpp.exe \
flags.exe flags-cpp.exe \
inline.exe inline-cpp.exe \
likely.exe likely-cpp.exe \
malloc.exe malloc-cpp.exe \
message.exe message-cpp.exe \
noinline.exe noinline-cpp.exe \
no-escape.exe no-escape-cpp.exe \
no-return.exe no-return-cpp.exe \
non-null.exe non-null-cpp.exe \
predict.exe predict-cpp.exe \
printf-format.exe printf-format-cpp.exe \
pure.exe pure-cpp.exe \
require.exe require-cpp.exe \
restrict.exe restrict-cpp.exe \
returns-non-null.exe returns-non-null-cpp.exe \
sentinel.exe sentinel-cpp.exe \
static-assert.exe static-assert-cpp.exe \
stringify.exe stringify-cpp.exe \
unknown-cpp-attributes.exe unknown-cpp-attributes-cpp.exe \
unknown-pragmas.exe unknown-pragmas-cpp.exe \
unavailable.exe unavailable-cpp.exe \
unreachable.exe unreachable-cpp.exe \
unused-function.exe unused-function-cpp.exe \
visibility.exe visibility-cpp.exe \
warn.exe warn-cpp.exe \
warn-unused-result.exe warn-unused-result-cpp.exe \
$(NULL)
CLEANFILES = $(TESTS) \
array-param.cpp array-param.obj array-param.lib array-param-cpp.exp array-param-cpp.lib \
assume.cpp assume.obj assume.lib assume-cpp.exp assume-cpp.lib \
cast.cpp cast.obj cast.lib cast-cpp.exp cast-cpp.lib \
concat.cpp concat.obj concat.lib concat-cpp.exp concat-cpp.lib \
const.cpp const.obj const.lib const-cpp.exp const-cpp.lib \
constant.cpp constant.obj constant.lib constant-cpp.exp constant-cpp.lib \
deprecated.cpp deprecated.obj deprecated.lib deprecated-cpp.exp deprecated-cpp.lib \
empty-bases.cpp empty-bases.obj empty-bases.lib empty-bases-cpp.exp empty-bases-cpp.lib \
fallthrough.cpp fallthrough.obj fallthrough.lib fallthrough-cpp.exp fallthrough-cpp.lib \
flags.cpp flags.obj flags.lib flags-cpp.exp flags-cpp.lib \
inline.cpp inline.obj inline.lib inline-cpp.exp inline-cpp.lib \
likely.cpp likely.obj likely.lib likely-cpp.exp likely-cpp.lib \
malloc.cpp malloc.obj malloc.lib malloc-cpp.exp malloc-cpp.lib \
message.cpp message.obj message.lib message-cpp.exp message-cpp.lib \
noinline.cpp noinline.obj noinline.lib noinline-cpp.exp noinline-cpp.lib \
no-escape.cpp no-escape.obj no-escape.lib no-escape-cpp.exp no-escape-cpp.lib \
no-return.cpp no-return.obj no-return.lib no-return-cpp.exp no-return-cpp.lib \
non-null.cpp non-null.obj non-null.lib non-null-cpp.exp non-null-cpp.lib \
predict.cpp predict.obj predict.lib predict-cpp.exp predict-cpp.lib \
printf-format.cpp printf-format.obj printf-format.lib printf-format-cpp.exp printf-format-cpp.lib \
pure.cpp pure.obj pure.lib pure-cpp.exp pure-cpp.lib \
require.cpp require.obj require.lib require-cpp.exp require-cpp.lib \
restrict.cpp restrict.obj restrict.lib restrict-cpp.exp restrict-cpp.lib \
returns-non-null.cpp returns-non-null.obj returns-non-null.lib returns-non-null-cpp.exp returns-non-null-cpp.lib \
sentinel.cpp sentinel.obj sentinel.lib sentinel-cpp.exp sentinel-cpp.lib \
static-assert.cpp static-assert.obj static-assert.lib static-assert-cpp.exp static-assert-cpp.lib \
stringify.cpp stringify.obj stringify.lib stringify-cpp.exp stringify-cpp.lib \
unknown-cpp-attributes.cpp unknown-cpp-attributes.obj unknown-cpp-attributes.lib unknown-cpp-attributes-cpp.exp unknown-cpp-attributes-cpp.lib \
unknown-pragmas.cpp unknown-pragmas.obj unknown-pragmas.lib unknown-pragmas-cpp.exp unknown-pragmas-cpp.lib \
unavailable.cpp unavailable.obj unavailable.lib unavailable-cpp.exp unavailable-cpp.lib \
unreachable.cpp unreachable.obj unreachable.lib unreachable-cpp.exp unreachable-cpp.lib \
unused-function.cpp unused-function.obj unused-function.lib unused-function-cpp.exp unused-function-cpp.lib \
visibility.cpp visibility.obj visibility.lib visibility-cpp.exp visibility-cpp.lib \
warn.cpp warn.obj warn.lib warn-cpp.exp warn-cpp.lib \
warn-unused-result.cpp warn-unused-result.obj warn-unused-result.lib warn-unused-result-cpp.exp warn-unused-result-cpp.lib \
$(NULL)
all: $(TESTS)
clean:
del /Q $(CLEANFILES)
array-param.exe: array-param.c
$(CC) $(CFLAGS) /Fe$(@) $(?)
array-param.cpp: array-param.c
copy /Y $(?) $(@) >NUL
array-param-cpp.exe: array-param.cpp
$(CXX) $(CXXFLAGS) /Fe$(@) $(?)
assume.exe: assume.c
$(CC) $(CFLAGS) /Fe$(@) $(?)
assume.cpp: assume.c
copy /Y $(?) $(@) >NUL
assume-cpp.exe: assume.cpp
$(CXX) $(CXXFLAGS) /Fe$(@) $(?)
cast.exe: cast.c
$(CC) $(CFLAGS) /Fe$(@) $(?)
cast.cpp: cast.c
copy /Y $(?) $(@) >NUL
cast-cpp.exe: cast.cpp
$(CXX) $(CXXFLAGS) /Fe$(@) $(?)
concat.exe: concat.c
$(CC) $(CFLAGS) /Fe$(@) $(?)
concat.cpp: concat.c
copy /Y $(?) $(@) >NUL
concat-cpp.exe: concat.cpp
$(CXX) $(CXXFLAGS) /Fe$(@) $(?)
const.exe: const.c
$(CC) $(CFLAGS) /Fe$(@) $(?)
const.cpp: const.c
copy /Y $(?) $(@) >NUL
const-cpp.exe: const.cpp
$(CXX) $(CXXFLAGS) /Fe$(@) $(?)
constant.exe: constant.c
$(CC) $(CFLAGS) /Fe$(@) $(?)
constant.cpp: constant.c
copy /Y $(?) $(@) >NUL
constant-cpp.exe: constant.cpp
$(CXX) $(CXXFLAGS) /Fe$(@) $(?)
deprecated.exe: deprecated.c
$(CC) $(CFLAGS) /Fe$(@) $(?)
deprecated.cpp: deprecated.c
copy /Y $(?) $(@) >NUL
deprecated-cpp.exe: deprecated.cpp
$(CXX) $(CXXFLAGS) /Fe$(@) $(?)
empty-bases.exe: empty-bases.c
$(CC) $(CFLAGS) /Fe$(@) $(?)
empty-bases.cpp: empty-bases.c
copy /Y $(?) $(@) >NUL
empty-bases-cpp.exe: empty-bases.cpp
$(CXX) $(CXXFLAGS) /Fe$(@) $(?)
fallthrough.exe: fallthrough.c
$(CC) $(CFLAGS) /Fe$(@) $(?)
fallthrough.cpp: fallthrough.c
copy /Y $(?) $(@) >NUL
fallthrough-cpp.exe: fallthrough.cpp
$(CXX) $(CXXFLAGS) /Fe$(@) $(?)
flags.exe: flags.c
$(CC) $(CFLAGS) /Fe$(@) $(?)
flags.cpp: flags.c
copy /Y $(?) $(@) >NUL
flags-cpp.exe: flags.cpp
$(CXX) $(CXXFLAGS) /Fe$(@) $(?)
inline.exe: inline.c
$(CC) $(CFLAGS) /Fe$(@) $(?)
inline.cpp: inline.c
copy /Y $(?) $(@) >NUL
inline-cpp.exe: inline.cpp
$(CXX) $(CXXFLAGS) /Fe$(@) $(?)
likely.exe: likely.c
$(CC) $(CFLAGS) /Fe$(@) $(?)
likely.cpp: likely.c
copy /Y $(?) $(@) >NUL
likely-cpp.exe: likely.cpp
$(CXX) $(CXXFLAGS) /Fe$(@) $(?)
malloc.exe: malloc.c
$(CC) $(CFLAGS) /Fe$(@) $(?)
malloc.cpp: malloc.c
copy /Y $(?) $(@) >NUL
malloc-cpp.exe: malloc.cpp
$(CXX) $(CXXFLAGS) /Fe$(@) $(?)
message.exe: message.c
$(CC) $(CFLAGS) /Fe$(@) $(?)
message.cpp: message.c
copy /Y $(?) $(@) >NUL
message-cpp.exe: message.cpp
$(CXX) $(CXXFLAGS) /Fe$(@) $(?)
noinline.exe: noinline.c
$(CC) $(CFLAGS) /Fe$(@) $(?)
noinline.cpp: noinline.c
copy /Y $(?) $(@) >NUL
noinline-cpp.exe: noinline.cpp
$(CXX) $(CXXFLAGS) /Fe$(@) $(?)
no-escape.exe: no-escape.c
$(CC) $(CFLAGS) /Fe$(@) $(?)
no-escape.cpp: no-escape.c
copy /Y $(?) $(@) >NUL
no-escape-cpp.exe: no-escape.cpp
$(CXX) $(CXXFLAGS) /Fe$(@) $(?)
no-return.exe: no-return.c
$(CC) $(CFLAGS) /Fe$(@) $(?)
no-return.cpp: no-return.c
copy /Y $(?) $(@) >NUL
no-return-cpp.exe: no-return.cpp
$(CXX) $(CXXFLAGS) /Fe$(@) $(?)
non-null.exe: non-null.c
$(CC) $(CFLAGS) /Fe$(@) $(?)
non-null.cpp: non-null.c
copy /Y $(?) $(@) >NUL
non-null-cpp.exe: non-null.cpp
$(CXX) $(CXXFLAGS) /Fe$(@) $(?)
predict.exe: predict.c
$(CC) $(CFLAGS) /Fe$(@) $(?)
predict.cpp: predict.c
copy /Y $(?) $(@) >NUL
predict-cpp.exe: predict.cpp
$(CXX) $(CXXFLAGS) /Fe$(@) $(?)
printf-format.exe: printf-format.c
$(CC) $(CFLAGS) /Fe$(@) $(?)
printf-format.cpp: printf-format.c
copy /Y $(?) $(@) >NUL
printf-format-cpp.exe: printf-format.cpp
$(CXX) $(CXXFLAGS) /Fe$(@) $(?)
pure.exe: pure.c
$(CC) $(CFLAGS) /Fe$(@) $(?)
pure.cpp: pure.c
copy /Y $(?) $(@) >NUL
pure-cpp.exe: pure.cpp
$(CXX) $(CXXFLAGS) /Fe$(@) $(?)
require.exe: require.c
$(CC) $(CFLAGS) /Fe$(@) $(?)
require.cpp: require.c
copy /Y $(?) $(@) >NUL
require-cpp.exe: require.cpp
$(CXX) $(CXXFLAGS) /Fe$(@) $(?)
restrict.exe: restrict.c
$(CC) $(CFLAGS) /Fe$(@) $(?)
restrict.cpp: restrict.c
copy /Y $(?) $(@) >NUL
restrict-cpp.exe: restrict.cpp
$(CXX) $(CXXFLAGS) /Fe$(@) $(?)
returns-non-null.exe: returns-non-null.c
$(CC) $(CFLAGS) /Fe$(@) $(?)
returns-non-null.cpp: returns-non-null.c
copy /Y $(?) $(@) >NUL
returns-non-null-cpp.exe: returns-non-null.cpp
$(CXX) $(CXXFLAGS) /Fe$(@) $(?)
sentinel.exe: sentinel.c
$(CC) $(CFLAGS) /Fe$(@) $(?)
sentinel.cpp: sentinel.c
copy /Y $(?) $(@) >NUL
sentinel-cpp.exe: sentinel.cpp
$(CXX) $(CXXFLAGS) /Fe$(@) $(?)
static-assert.exe: static-assert.c
$(CC) $(CFLAGS) /Fe$(@) $(?)
static-assert.cpp: static-assert.c
copy /Y $(?) $(@) >NUL
static-assert-cpp.exe: static-assert.cpp
$(CXX) $(CXXFLAGS) /Fe$(@) $(?)
stringify.exe: stringify.c
$(CC) $(CFLAGS) /Fe$(@) $(?)
stringify.cpp: stringify.c
copy /Y $(?) $(@) >NUL
stringify-cpp.exe: stringify.cpp
$(CXX) $(CXXFLAGS) /Fe$(@) $(?)
unknown-cpp-attributes.exe: unknown-cpp-attributes.c
$(CC) $(CFLAGS) /Fe$(@) $(?)
unknown-cpp-attributes.cpp: unknown-cpp-attributes.c
copy /Y $(?) $(@) >NUL
unknown-cpp-attributes-cpp.exe: unknown-cpp-attributes.cpp
$(CXX) $(CXXFLAGS) /Fe$(@) $(?)
unknown-pragmas.exe: unknown-pragmas.c
$(CC) $(CFLAGS) /Fe$(@) $(?)
unknown-pragmas.cpp: unknown-pragmas.c
copy /Y $(?) $(@) >NUL
unknown-pragmas-cpp.exe: unknown-pragmas.cpp
$(CXX) $(CXXFLAGS) /Fe$(@) $(?)
unavailable.exe: unavailable.c
$(CC) $(CFLAGS) /Fe$(@) $(?)
unavailable.cpp: unavailable.c
copy /Y $(?) $(@) >NUL
unavailable-cpp.exe: unavailable.cpp
$(CXX) $(CXXFLAGS) /Fe$(@) $(?)
unreachable.exe: unreachable.c
$(CC) $(CFLAGS) /Fe$(@) $(?)
unreachable.cpp: unreachable.c
copy /Y $(?) $(@) >NUL
unreachable-cpp.exe: unreachable.cpp
$(CXX) $(CXXFLAGS) /Fe$(@) $(?)
unused-function.exe: unused-function.c
$(CC) $(CFLAGS) /Fe$(@) $(?)
unused-function.cpp: unused-function.c
copy /Y $(?) $(@) >NUL
unused-function-cpp.exe: unused-function.cpp
$(CXX) $(CXXFLAGS) /Fe$(@) $(?)
visibility.exe: visibility.c
$(CC) $(CFLAGS) /Fe$(@) $(?)
visibility.cpp: visibility.c
copy /Y $(?) $(@) >NUL
visibility-cpp.exe: visibility.cpp
$(CXX) $(CXXFLAGS) /Fe$(@) $(?)
warn.exe: warn.c
$(CC) $(CFLAGS) /Fe$(@) $(?)
warn.cpp: warn.c
copy /Y $(?) $(@) >NUL
warn-cpp.exe: warn.cpp
$(CXX) $(CXXFLAGS) /Fe$(@) $(?)
warn-unused-result.exe: warn-unused-result.c
$(CC) $(CFLAGS) /Fe$(@) $(?)
warn-unused-result.cpp: warn-unused-result.c
copy /Y $(?) $(@) >NUL
warn-unused-result-cpp.exe: warn-unused-result.cpp
$(CXX) $(CXXFLAGS) /Fe$(@) $(?)

258
thirdparty/hedley/test/Makefile.pelles vendored Normal file
View file

@ -0,0 +1,258 @@
# Generated by Makefile. Do not edit.
CC = pocc
LD = polink
CFLAGS =
LDFLAGS =
TESTS = \
array-param.exe \
assume.exe \
cast.exe \
const.exe \
constant.exe \
deprecated.exe \
fallthrough.exe \
flags.exe \
inline.exe \
likely.exe \
malloc.exe \
message.exe \
noinline.exe \
no-return.exe \
non-null.exe \
predict.exe \
printf-format.exe \
pure.exe \
require.exe \
restrict.exe \
returns-non-null.exe \
sentinel.exe \
static-assert.exe \
stringify.exe \
unknown-pragmas.exe \
unavailable.exe \
unreachable.exe \
visibility.exe \
warn.exe \
warn-unused-result.exe \
$(NULL)
CLEANFILES = $(TESTS) \
array-param.obj array-param.exe \
assume.obj assume.exe \
cast.obj cast.exe \
const.obj const.exe \
constant.obj constant.exe \
deprecated.obj deprecated.exe \
fallthrough.obj fallthrough.exe \
flags.obj flags.exe \
inline.obj inline.exe \
likely.obj likely.exe \
malloc.obj malloc.exe \
message.obj message.exe \
noinline.obj noinline.exe \
no-return.obj no-return.exe \
non-null.obj non-null.exe \
predict.obj predict.exe \
printf-format.obj printf-format.exe \
pure.obj pure.exe \
require.obj require.exe \
restrict.obj restrict.exe \
returns-non-null.obj returns-non-null.exe \
sentinel.obj sentinel.exe \
static-assert.obj static-assert.exe \
stringify.obj stringify.exe \
unknown-pragmas.obj unknown-pragmas.exe \
unavailable.obj unavailable.exe \
unreachable.obj unreachable.exe \
visibility.obj visibility.exe \
warn.obj warn.exe \
warn-unused-result.obj warn-unused-result.exe \
$(NULL)
all: $(TESTS)
clean:
del /Q $(CLEANFILES)
array-param.obj: array-param.c
$(CC) $(CFLAGS) array-param.c
array-param.exe: array-param.obj
$(LD) $(LDFLAGS) /OUT:array-param.exe array-param.obj
assume.obj: assume.c
$(CC) $(CFLAGS) assume.c
assume.exe: assume.obj
$(LD) $(LDFLAGS) /OUT:assume.exe assume.obj
cast.obj: cast.c
$(CC) $(CFLAGS) cast.c
cast.exe: cast.obj
$(LD) $(LDFLAGS) /OUT:cast.exe cast.obj
const.obj: const.c
$(CC) $(CFLAGS) const.c
const.exe: const.obj
$(LD) $(LDFLAGS) /OUT:const.exe const.obj
constant.obj: constant.c
$(CC) $(CFLAGS) constant.c
constant.exe: constant.obj
$(LD) $(LDFLAGS) /OUT:constant.exe constant.obj
deprecated.obj: deprecated.c
$(CC) $(CFLAGS) deprecated.c
deprecated.exe: deprecated.obj
$(LD) $(LDFLAGS) /OUT:deprecated.exe deprecated.obj
fallthrough.obj: fallthrough.c
$(CC) $(CFLAGS) fallthrough.c
fallthrough.exe: fallthrough.obj
$(LD) $(LDFLAGS) /OUT:fallthrough.exe fallthrough.obj
flags.obj: flags.c
$(CC) $(CFLAGS) flags.c
flags.exe: flags.obj
$(LD) $(LDFLAGS) /OUT:flags.exe flags.obj
inline.obj: inline.c
$(CC) $(CFLAGS) inline.c
inline.exe: inline.obj
$(LD) $(LDFLAGS) /OUT:inline.exe inline.obj
likely.obj: likely.c
$(CC) $(CFLAGS) likely.c
likely.exe: likely.obj
$(LD) $(LDFLAGS) /OUT:likely.exe likely.obj
malloc.obj: malloc.c
$(CC) $(CFLAGS) malloc.c
malloc.exe: malloc.obj
$(LD) $(LDFLAGS) /OUT:malloc.exe malloc.obj
message.obj: message.c
$(CC) $(CFLAGS) message.c
message.exe: message.obj
$(LD) $(LDFLAGS) /OUT:message.exe message.obj
noinline.obj: noinline.c
$(CC) $(CFLAGS) noinline.c
noinline.exe: noinline.obj
$(LD) $(LDFLAGS) /OUT:noinline.exe noinline.obj
no-return.obj: no-return.c
$(CC) $(CFLAGS) no-return.c
no-return.exe: no-return.obj
$(LD) $(LDFLAGS) /OUT:no-return.exe no-return.obj
non-null.obj: non-null.c
$(CC) $(CFLAGS) non-null.c
non-null.exe: non-null.obj
$(LD) $(LDFLAGS) /OUT:non-null.exe non-null.obj
predict.obj: predict.c
$(CC) $(CFLAGS) predict.c
predict.exe: predict.obj
$(LD) $(LDFLAGS) /OUT:predict.exe predict.obj
printf-format.obj: printf-format.c
$(CC) $(CFLAGS) printf-format.c
printf-format.exe: printf-format.obj
$(LD) $(LDFLAGS) /OUT:printf-format.exe printf-format.obj
pure.obj: pure.c
$(CC) $(CFLAGS) pure.c
pure.exe: pure.obj
$(LD) $(LDFLAGS) /OUT:pure.exe pure.obj
require.obj: require.c
$(CC) $(CFLAGS) require.c
require.exe: require.obj
$(LD) $(LDFLAGS) /OUT:require.exe require.obj
restrict.obj: restrict.c
$(CC) $(CFLAGS) restrict.c
restrict.exe: restrict.obj
$(LD) $(LDFLAGS) /OUT:restrict.exe restrict.obj
returns-non-null.obj: returns-non-null.c
$(CC) $(CFLAGS) returns-non-null.c
returns-non-null.exe: returns-non-null.obj
$(LD) $(LDFLAGS) /OUT:returns-non-null.exe returns-non-null.obj
sentinel.obj: sentinel.c
$(CC) $(CFLAGS) sentinel.c
sentinel.exe: sentinel.obj
$(LD) $(LDFLAGS) /OUT:sentinel.exe sentinel.obj
static-assert.obj: static-assert.c
$(CC) $(CFLAGS) static-assert.c
static-assert.exe: static-assert.obj
$(LD) $(LDFLAGS) /OUT:static-assert.exe static-assert.obj
stringify.obj: stringify.c
$(CC) $(CFLAGS) stringify.c
stringify.exe: stringify.obj
$(LD) $(LDFLAGS) /OUT:stringify.exe stringify.obj
unknown-pragmas.obj: unknown-pragmas.c
$(CC) $(CFLAGS) unknown-pragmas.c
unknown-pragmas.exe: unknown-pragmas.obj
$(LD) $(LDFLAGS) /OUT:unknown-pragmas.exe unknown-pragmas.obj
unavailable.obj: unavailable.c
$(CC) $(CFLAGS) unavailable.c
unavailable.exe: unavailable.obj
$(LD) $(LDFLAGS) /OUT:unavailable.exe unavailable.obj
unreachable.obj: unreachable.c
$(CC) $(CFLAGS) unreachable.c
unreachable.exe: unreachable.obj
$(LD) $(LDFLAGS) /OUT:unreachable.exe unreachable.obj
visibility.obj: visibility.c
$(CC) $(CFLAGS) visibility.c
visibility.exe: visibility.obj
$(LD) $(LDFLAGS) /OUT:visibility.exe visibility.obj
warn.obj: warn.c
$(CC) $(CFLAGS) warn.c
warn.exe: warn.obj
$(LD) $(LDFLAGS) /OUT:warn.exe warn.obj
warn-unused-result.obj: warn-unused-result.c
$(CC) $(CFLAGS) warn-unused-result.c
warn-unused-result.exe: warn-unused-result.obj
$(LD) $(LDFLAGS) /OUT:warn-unused-result.exe warn-unused-result.obj

30
thirdparty/hedley/test/array-param.c vendored Normal file
View file

@ -0,0 +1,30 @@
#include "../hedley.h"
#if defined(_MSC_VER)
HEDLEY_DIAGNOSTIC_PUSH
#pragma warning(disable:4668)
#include <assert.h>
#include <stddef.h>
HEDLEY_DIAGNOSTIC_POP
#else
#include <assert.h>
#include <stddef.h>
#endif
static void
clear_buffer (size_t* buffer_size, unsigned char buffer[HEDLEY_ARRAY_PARAM(*buffer_size)]) {
size_t p;
for (p = 0 ; p < *buffer_size ; p++)
buffer[p] = 0;
}
int main(int argc, char* argv[HEDLEY_ARRAY_PARAM(argc)]) {
unsigned char foo[8192];
size_t foo_l = sizeof(foo);
assert(argv[argc - 1] != NULL);
clear_buffer(&foo_l, foo);
return 0;
}

11
thirdparty/hedley/test/assume.c vendored Normal file
View file

@ -0,0 +1,11 @@
#include "../hedley.h"
static int foo(int x) {
HEDLEY_ASSUME(x < 10 && x > 0);
return x % 10;
}
int main(void) {
return foo(5);
}

15
thirdparty/hedley/test/cast.c vendored Normal file
View file

@ -0,0 +1,15 @@
#include "../hedley.h"
int main(void) {
int foo = 0;
long bar = HEDLEY_STATIC_CAST(long, foo);
const char* baz = "Hello, world!";
char* qux = HEDLEY_CONST_CAST(char*, baz);
if (bar != 0)
return 1;
if (baz != qux)
return 1;
return 0;
}

22
thirdparty/hedley/test/concat.c vendored Normal file
View file

@ -0,0 +1,22 @@
#include "../hedley.h"
#define FOO a
#define BAR b
#if HEDLEY_IAR_VERSION_CHECK(8,5,0)
# pragma diag_suppress=Pe1818
#endif
static int ab(int v) {
return v * v;
}
static int a_b(int v) {
return HEDLEY_CONCAT(FOO, b)(v) * v;
}
int main(int argc, const char** argv) {
HEDLEY_STATIC_CAST(void, argv);
return HEDLEY_CONCAT3(FOO, _, BAR)(argc);
}

11
thirdparty/hedley/test/const.c vendored Normal file
View file

@ -0,0 +1,11 @@
#include "../hedley.h"
HEDLEY_CONST
HEDLEY_INLINE
static int test_const(int a, int b) {
return a * b;
}
int main(void) {
return test_const(9, 9);
}

28
thirdparty/hedley/test/constant.c vendored Normal file
View file

@ -0,0 +1,28 @@
#if defined(_MSC_VER)
#pragma warning(push)
#pragma warning(disable:4668)
#include <assert.h>
#include <stddef.h>
#pragma warning(pop)
#else
#include <assert.h>
#include <stddef.h>
#endif
#include "../hedley.h"
int main(int argc, char* argv[HEDLEY_ARRAY_PARAM(argc)]) {
char foo[HEDLEY_REQUIRE_CONSTEXPR(42)] = { 0, };
assert(argv[argc - 1] != NULL);
assert(foo[0] == 0);
#if defined(HEDLEY__IS_CONSTEXPR)
assert(HEDLEY__IS_CONSTEXPR(1729) == 1);
assert(HEDLEY__IS_CONSTEXPR(argc) == 0);
#endif
assert(HEDLEY_IS_CONSTANT(argc) == 0);
return 0;
}

32
thirdparty/hedley/test/deprecated.c vendored Normal file
View file

@ -0,0 +1,32 @@
#include "../hedley.h"
struct Foo {
int x;
};
/* For some compilers, deprecated will trigger a different diagnostic
when it has an attribute. We want to make sure
HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED silences both of them, but
Hedley uses the with attribute version whenever it's
available. This is only here so we can test both cases; You
shouldn't do this in your code! */
#if HEDLEY_GNUC_VERSION_CHECK(4,0,0)
__attribute__((__deprecated__))
#else
HEDLEY_DEPRECATED(1.1)
#endif
static int value = 9;
HEDLEY_DEPRECATED(1.0)
static int cube(int x) {
return x * x * x;
}
HEDLEY_DIAGNOSTIC_PUSH
HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED
int main (void) {
struct Foo foo;
foo.x = value;
return cube(foo.x);
}
HEDLEY_DIAGNOSTIC_POP

26
thirdparty/hedley/test/empty-bases.c vendored Normal file
View file

@ -0,0 +1,26 @@
#include "../hedley.h"
#if HEDLEY_IAR_VERSION_CHECK(8,0,0)
# pragma diag_suppress=Pe381
#elif defined(HEDLEY_SUNPRO_VERSION) && !defined(__cplusplus)
# pragma error_messages(off,E_EMPTY_DECLARATION)
#elif defined(HEDLEY_TI_VERSION)
# pragma diag_suppress 383
#endif
#ifdef __cplusplus
struct Empty2 {};
struct Empty3 {};
struct HEDLEY_EMPTY_BASES Derived3 : public Empty2, public Empty3
{
public:
char c;
};
#if !defined(HEDLEY_MSVC_VERSION) || HEDLEY_MSVC_VERSION_CHECK(19,0,23918)
HEDLEY_STATIC_ASSERT(sizeof(Derived3) == sizeof(Empty2), "empty base optimization failed");
#endif
#endif /* __cplusplus */
int main(void) {
return 0;
}

21
thirdparty/hedley/test/fallthrough.c vendored Normal file
View file

@ -0,0 +1,21 @@
#include "../hedley.h"
int main(int argc, char* argv[HEDLEY_ARRAY_PARAM(argc)]) {
int foo = 0;
HEDLEY_STATIC_CAST(void, argv);
switch (argc) {
case 2:
foo = 1;
break;
case 1:
foo = 2;
HEDLEY_FALL_THROUGH;
default:
foo = 3;
break;
}
return foo;
}

13
thirdparty/hedley/test/flags.c vendored Normal file
View file

@ -0,0 +1,13 @@
#include "../hedley.h"
enum Foo {
FOO_BAR = 1 << 0,
FOO_BAZ = 1 << 1,
FOO_QUX = 1 << 2
} HEDLEY_FLAGS;
int main(void) {
const enum Foo foo = HEDLEY_FLAGS_CAST(enum Foo, FOO_BAR | FOO_BAZ);
return HEDLEY_STATIC_CAST(int, foo);
}

23
thirdparty/hedley/test/inline.c vendored Normal file
View file

@ -0,0 +1,23 @@
#include "../hedley.h"
HEDLEY_INLINE
static int test_inline(int a, int b) {
return a * b;
}
HEDLEY_ALWAYS_INLINE
static int test_always_inline(int a, int b) {
return a * b;
}
HEDLEY_NEVER_INLINE
static int test_never_inline(int a, int b) {
return a * b;
}
int main(void) {
int a = test_always_inline(1, 2);
int b = test_never_inline(3, 4);
return test_inline(a, b);
}

40
thirdparty/hedley/test/likely.c vendored Normal file
View file

@ -0,0 +1,40 @@
#include "../hedley.h"
#if defined(_MSC_VER)
HEDLEY_DIAGNOSTIC_PUSH
#pragma warning(disable:4668)
#include <assert.h>
#include <stddef.h>
HEDLEY_DIAGNOSTIC_POP
#else
#include <assert.h>
#include <stddef.h>
#endif
#if \
defined(HEDLEY_TI_CL6X_VERSION) || \
defined(HEDLEY_TI_CL7X_VERSION)
/* __builtin_expect with second argument not equal to 0 or 1 is ignored */
# pragma diag_remark 1362
#endif
int main(int argc, char* argv[HEDLEY_ARRAY_PARAM(argc)]) {
int res;
HEDLEY_STATIC_CAST(void, argv);
res = (HEDLEY_PREDICT(argc + 1, 2, 0.95) == 2);
assert(res);
res = (HEDLEY_UNPREDICTABLE(argc + 1) == 2);
assert(res);
res = (HEDLEY_PREDICT_TRUE(argc + 1, 0.95) == 1);
assert(res);
res = (HEDLEY_PREDICT_FALSE(argc + 1, 0.95) == 1);
assert(res);
res = (HEDLEY_LIKELY(argc + 1) == 1);
assert(res);
res = (HEDLEY_UNLIKELY(argc + 1) == 1);
assert(res);
return !res;
}

32
thirdparty/hedley/test/malloc.c vendored Normal file
View file

@ -0,0 +1,32 @@
#include "../hedley.h"
#if defined(_MSC_VER)
HEDLEY_DIAGNOSTIC_PUSH
#pragma warning(disable:4255 4710 4668 4820)
#include <time.h>
#include <stdlib.h>
HEDLEY_DIAGNOSTIC_POP
#else
# include <time.h>
#include <stdlib.h>
#endif
HEDLEY_MALLOC
static void* randalloc(size_t size) {
size_t p;
unsigned char* r = HEDLEY_STATIC_CAST(unsigned char*, malloc(size));
for (p = 0 ; p < size ; p++) {
r[p] = HEDLEY_STATIC_CAST(unsigned char, HEDLEY_STATIC_CAST(unsigned int, rand()) & 0xffU);
}
return HEDLEY_STATIC_CAST(void*, r);
}
int main (void) {
srand(HEDLEY_STATIC_CAST(unsigned int, time(HEDLEY_STATIC_CAST(time_t*, HEDLEY_NULL))));
free(randalloc(1024));
return 0;
}

7
thirdparty/hedley/test/message.c vendored Normal file
View file

@ -0,0 +1,7 @@
#include "../hedley.h"
HEDLEY_MESSAGE("Hello, world!")
int main (void) {
return 0;
}

11
thirdparty/hedley/test/no-escape.c vendored Normal file
View file

@ -0,0 +1,11 @@
#include "../hedley.h"
static void f(HEDLEY_NO_ESCAPE int *p) {
*p += 1;
}
int main(void) {
int x = 0;
f(&x);
return 0;
}

29
thirdparty/hedley/test/no-return.c vendored Normal file
View file

@ -0,0 +1,29 @@
#include "../hedley.h"
#if defined(HEDLEY_IAR_VERSION)
# pragma diag_suppress=Pe082
#elif \
(defined(HEDLEY_TI_VERSION) && !HEDLEY_TI_VERSION_CHECK(18,1,0)) || \
(defined(HEDLEY_TI_CL6X_VERSION) && !HEDLEY_TI_VERSION_CHECK(8,3,0))
/* exit() was not annotated with noreturn */
# pragma diag_suppress 1585
#endif
#if defined(_MSC_VER)
HEDLEY_DIAGNOSTIC_PUSH
#pragma warning(disable:4255 4668)
#include <stdlib.h>
HEDLEY_DIAGNOSTIC_POP
#else
#include <stdlib.h>
#endif
HEDLEY_NO_RETURN
static void
test_no_return(int code) {
exit(code);
}
int main(void) {
test_no_return(0);
}

23
thirdparty/hedley/test/no-throw.c vendored Normal file
View file

@ -0,0 +1,23 @@
#include "../hedley.h"
HEDLEY_INLINE
static int test_inline(int a, int b) {
return a * b;
}
HEDLEY_ALWAYS_INLINE
static int test_always_inline(int a, int b) {
return a * b;
}
HEDLEY_NEVER_INLINE
static int test_never_inline(int a, int b) {
return a * b;
}
int main(void) {
return
test_inline(
test_always_inline(1, 2),
test_never_inline(3, 4));
}

15
thirdparty/hedley/test/noinline.c vendored Normal file
View file

@ -0,0 +1,15 @@
#include "../hedley.h"
#if defined(HEDLEY_INTEL_VERSION)
# pragma warning(disable:981)
#endif
HEDLEY_NEVER_INLINE
static
int cube(int v) {
return v * v * v;
}
int main(void) {
return cube(9) + cube(10);
}

35
thirdparty/hedley/test/non-null.c vendored Normal file
View file

@ -0,0 +1,35 @@
#include "../hedley.h"
#if defined(_MSC_VER)
HEDLEY_DIAGNOSTIC_PUSH
#pragma warning(disable:4255 4668)
#include <stdlib.h>
HEDLEY_DIAGNOSTIC_POP
#else
#include <stdlib.h>
#endif
#if HEDLEY_PGI_VERSION_CHECK(20,7,0)
# pragma diag_remark 1622,1623
#elif defined(HEDLEY_PGI_VERSION)
# pragma diag_remark 1622
#elif HEDLEY_SUNPRO_VERSION_CHECK(5,15,0) && defined(__cplusplus)
# pragma error_messages(off,nonnullarg)
#elif HEDLEY_GCC_HAS_WARNING("-Wnonnull",3,3,0)
# pragma GCC diagnostic warning "-Wnonnull"
#elif HEDLEY_INTEL_VERSION_CHECK(19,0,0)
# pragma warning(disable:2193)
#elif HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10)
# pragma diag_suppress 1622
#endif
HEDLEY_NON_NULL(1)
static const char* non_null(const char* msg) {
return msg;
}
int main (void) {
non_null(HEDLEY_STATIC_CAST(const char*, HEDLEY_NULL));
return 0;
}

35
thirdparty/hedley/test/predict.c vendored Normal file
View file

@ -0,0 +1,35 @@
#include "../hedley.h"
#if defined(_MSC_VER)
HEDLEY_DIAGNOSTIC_PUSH
#pragma warning(disable:4668)
#include <assert.h>
#include <stddef.h>
HEDLEY_DIAGNOSTIC_POP
#else
#include <assert.h>
#include <stddef.h>
#endif
int main(void) {
int x = 0, y = 0;
y += HEDLEY_PREDICT(x, 0, 0.95);
y += HEDLEY_PREDICT(x, 0, 0.85);
y += HEDLEY_PREDICT(x, 0, 0.15);
y += HEDLEY_PREDICT(x, 0, 0.05);
y += HEDLEY_PREDICT_TRUE(x, 0.95);
y += HEDLEY_PREDICT_TRUE(x, 0.85);
y += HEDLEY_PREDICT_TRUE(x, 0.15);
y += HEDLEY_PREDICT_TRUE(x, 0.05);
y += HEDLEY_PREDICT_FALSE(x, 0.95);
y += HEDLEY_PREDICT_FALSE(x, 0.85);
y += HEDLEY_PREDICT_FALSE(x, 0.15);
y += HEDLEY_PREDICT_FALSE(x, 0.05);
y += HEDLEY_UNPREDICTABLE(x);
return y;
}

38
thirdparty/hedley/test/printf-format.c vendored Normal file
View file

@ -0,0 +1,38 @@
#include "../hedley.h"
#include <stdio.h>
#include <stdarg.h>
#if HEDLEY_HAS_WARNING("-Wformat")
# pragma clang diagnostic warning "-Wformat"
#elif \
defined(HEDLEY_TI_VERSION) || \
defined(HEDLEY_TI_CL6X_VERSION) || \
defined(HEDLEY_TI_CL7X_VERSION) || \
defined(HEDLEY_TI_CLPRU_VERSION)
# pragma diag_remark 183
#elif (defined(HEDLEY_PGI_VERSION) && defined(__cplusplus)) || HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10)
# pragma diag_remark 181
#elif defined(HEDLEY_GCC_VERSION)
# pragma GCC diagnostic warning "-Wformat"
#elif defined(HEDLEY_INTEL_VERSION)
# pragma warning(disable:181)
#endif
HEDLEY_PRINTF_FORMAT(1,2)
static void print_msg(const char* msg, ...) {
char buf[128];
va_list ap;
va_start(ap, msg);
vsnprintf(buf, sizeof(buf), msg, ap);
va_end(ap);
}
int main (void) {
print_msg("mismatch %ld\n", 0.0);
return 0;
}

16
thirdparty/hedley/test/pure.c vendored Normal file
View file

@ -0,0 +1,16 @@
#include "../hedley.h"
static int* b;
HEDLEY_PURE
static int taxi(int a) {
return
(a * a * a) +
(*b * *b * *b);
}
int main(void) {
*b = 10;
return taxi(9);
}

20
thirdparty/hedley/test/require.c vendored Normal file
View file

@ -0,0 +1,20 @@
#include "../hedley.h"
#if defined(_MSC_VER)
HEDLEY_DIAGNOSTIC_PUSH
#pragma warning(disable:4668)
#include <limits.h>
HEDLEY_DIAGNOSTIC_POP
#else
#include <limits.h>
#endif
static int add(int a, int b)
HEDLEY_REQUIRE_MSG((a < b), "a must be less than b")
{
return a + b;
}
int main(void) {
return add(2, 3);
}

25
thirdparty/hedley/test/restrict.c vendored Normal file
View file

@ -0,0 +1,25 @@
#include "../hedley.h"
#if defined(_MSC_VER)
HEDLEY_DIAGNOSTIC_PUSH
#pragma warning(disable:4668)
#include <assert.h>
HEDLEY_DIAGNOSTIC_POP
#else
#include <assert.h>
#endif
static void acopy(int n, int* HEDLEY_RESTRICT a, int* HEDLEY_RESTRICT b) {
int i;
for (i = 0 ; i < n ; i++)
a[i] = b[i];
}
int main (void) {
int a[512] = { 0, };
int b[512];
acopy(512, b, a);
return 0;
}

View file

@ -0,0 +1,15 @@
#include "../hedley.h"
#include <string.h>
static const char* foo = "bar\n";
HEDLEY_RETURNS_NON_NULL
static const char* get_string(void) {
return foo;
}
int main(void) {
const char* s = get_string();
return HEDLEY_STATIC_CAST(int, strlen(s));
}

36
thirdparty/hedley/test/sentinel.c vendored Normal file
View file

@ -0,0 +1,36 @@
#include "../hedley.h"
#if HEDLEY_HAS_WARNING("-Wsentinel")
# pragma clang diagnostic warning "-Wsentinel"
#elif defined(HEDLEY_INTEL_VERSION)
# pragma warning(disable:1881)
#elif HEDLEY_PGI_VERSION_CHECK(20,7,0)
# pragma diag_remark 1546,1547
#elif defined(HEDLEY_PGI_VERSION) || HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10)
# pragma diag_remark 1546
#elif defined(HEDLEY_GNUC_VERSION)
# pragma GCC diagnostic warning "-Wformat"
#endif
#if defined(_MSC_VER)
HEDLEY_DIAGNOSTIC_PUSH
#pragma warning(disable:4668)
#include <assert.h>
HEDLEY_DIAGNOSTIC_POP
#else
#include <assert.h>
#endif
HEDLEY_SENTINEL(0)
static int test_sentinel(void* ptr, ...) {
assert(ptr == HEDLEY_NULL);
return 42;
}
int main(void) {
test_sentinel(HEDLEY_NULL, 1, HEDLEY_NULL);
test_sentinel(HEDLEY_NULL, 1);
return 0;
}

15
thirdparty/hedley/test/static-assert.c vendored Normal file
View file

@ -0,0 +1,15 @@
#include "../hedley.h"
#if HEDLEY_IAR_VERSION_CHECK(8,0,0)
# pragma diag_suppress=Pe381
#elif defined(HEDLEY_SUNPRO_VERSION) && !defined(__cplusplus)
# pragma error_messages(off,E_EMPTY_DECLARATION)
#elif defined(HEDLEY_TI_VERSION)
# pragma diag_suppress 383
#endif
HEDLEY_STATIC_ASSERT(sizeof(char) == 1, "char must be one byte");
int main(void) {
return 0;
}

27
thirdparty/hedley/test/stringify.c vendored Normal file
View file

@ -0,0 +1,27 @@
#include "../hedley.h"
#define PREFIX foo_
#define BAR bar
static int
my_strcmp(const char* s1, const char* s2) {
while (1) {
if (*s1 < *s2)
return -1;
else if (*s1 > *s2)
return 1;
else if (*s1 == '\0')
return 0;
s1++;
s2++;
}
}
static const char*
foo_bar(void) {
return HEDLEY_STRINGIFY(BAR);
}
int main(void) {
return my_strcmp("bar", HEDLEY_CONCAT(PREFIX, BAR)());
}

11
thirdparty/hedley/test/unavailable.c vendored Normal file
View file

@ -0,0 +1,11 @@
#include "../hedley.h"
HEDLEY_UNAVAILABLE(3.14)
static void
test_unavailable(void) { }
int main(void) {
test_unavailable();
return 0;
}

View file

@ -0,0 +1,26 @@
#include "../hedley.h"
#include <stdio.h>
#if defined(__cplusplus)
# if __cplusplus >= 201103L
# define UNPREDICTABLE \
HEDLEY_DIAGNOSTIC_PUSH \
HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES \
HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_([[unpredictable]]) \
HEDLEY_DIAGNOSTIC_POP
# endif
#endif
#if !defined(UNPREDICTABLE)
# define UNPREDICTABLE
#endif
int main(int argc, char* argv[]) {
HEDLEY_STATIC_CAST(void, argv);
if (argc == 1) UNPREDICTABLE {
return -1;
}
return 0;
}

View file

@ -0,0 +1,10 @@
#include "../hedley.h"
HEDLEY_DIAGNOSTIC_PUSH
HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS
#pragma Foo
HEDLEY_DIAGNOSTIC_POP
int main (void) {
return 0;
}

32
thirdparty/hedley/test/unreachable.c vendored Normal file
View file

@ -0,0 +1,32 @@
#include "../hedley.h"
#if HEDLEY_HAS_WARNING("-Wcovered-switch-default")
# pragma clang diagnostic warning "-Wcovered-switch-default"
#endif
enum Foo {
FOO_BAR,
FOO_BAZ,
FOO_QUX,
FOO_QUUX
};
static int test_unreachable(enum Foo code) {
switch (code) {
case FOO_BAR:
case FOO_BAZ:
case FOO_QUX:
return 0;
case FOO_QUUX:
default:
HEDLEY_UNREACHABLE();
}
HEDLEY_UNREACHABLE_RETURN(0);
}
int main(void) {
test_unreachable(FOO_BAR);
return 0;
}

View file

@ -0,0 +1,11 @@
#include "../hedley.h"
HEDLEY_DIAGNOSTIC_DISABLE_UNUSED_FUNCTION
int square(int x) {
return x * x;
}
int main(void) {
return 0;
}

23
thirdparty/hedley/test/visibility.c vendored Normal file
View file

@ -0,0 +1,23 @@
#include "../hedley.h"
#if defined(HEDLEY_INTEL_VERSION)
# pragma warning(disable:1419)
#endif
HEDLEY_PUBLIC void test_public(void);
HEDLEY_PRIVATE void test_private(void);
HEDLEY_PUBLIC
void
test_public(void) { }
HEDLEY_PRIVATE
void
test_private(void) { }
int main(void) {
test_public();
test_private();
return 0;
}

View file

@ -0,0 +1,45 @@
#include "../hedley.h"
#if HEDLEY_HAS_WARNING("-Wunused-result")
# pragma clang diagnostic warning "-Wunused-result"
#elif defined(HEDLEY_INTEL_VERSION)
# pragma warning(disable:2218)
#elif HEDLEY_SUNPRO_VERSION_CHECK(5,15,0) && defined(__cplusplus)
# pragma error_messages(off,unusedresult)
#elif \
defined(HEDLEY_TI_VERSION) || \
defined(HEDLEY_TI_CL6X_VERSION) || \
defined(HEDLEY_TI_CL7X_VERSION) || \
defined(HEDLEY_TI_CLPRU_VERSION)
# pragma diag_remark 1490
#elif HEDLEY_PGI_VERSION_CHECK(20,7,0)
# pragma diag_remark 1650,1651
#elif defined(HEDLEY_PGI_VERSION) || HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10)
# pragma diag_remark 1650
#elif defined(HEDLEY_IAR_VERSION)
# pragma diag_suppress=Pe2809
#elif defined(HEDLEY_GNUC_VERSION)
# pragma GCC diagnostic warning "-Wunused-result"
#endif
HEDLEY_WARN_UNUSED_RESULT
static int test_unused_result(void) {
return 1729;
}
HEDLEY_WARN_UNUSED_RESULT_MSG("Foo")
static int test_unused_result_msg(void) {
return 1701;
}
int main(void) {
test_unused_result();
test_unused_result_msg();
if (test_unused_result() != 1729)
return 1;
if (test_unused_result_msg() != 1701)
return 1;
return 0;
}

15
thirdparty/hedley/test/warn.c vendored Normal file
View file

@ -0,0 +1,15 @@
#include "../hedley.h"
#if defined(HEDLEY_INTEL_VERSION)
# pragma warning(disable:1028)
#elif HEDLEY_PGI_VERSION_CHECK(20,7,0)
# pragma diag_remark 1105,1106
#elif defined(HEDLEY_PGI_VERSION)
# pragma diag_remark 1105
#endif
HEDLEY_WARNING("I'm a warning")
int main(void) {
return 0;
}