Commit Graph
35 Commits
Author SHA1 Message Date
Samuel Bronson 09d892c55a Remove duplicate diagnostic pragmas
Clang has been unconditionally accepting the GCC diagnostic pragmas
since before the clang pragmas were introduced in [r71572][1].

This means we don't need to duplicate the pragmas for clang-cl's
benefit.

[1]: https://github.com/llvm/llvm-project/commit/b61448d4902f28d286e0b2fcb5ff72aea1b3404b
2026-05-06 14:08:55 -04:00
Nigel Tao 85af5a4bed std/tga: rename to std/targa 2024-09-08 09:00:10 +10:00
Nigel Tao 8924b5f003 cgen: add ETC__ENABLE_DROP_IN_REPLACEMENT__STB
Fixes #153
2024-09-07 22:21:00 +10:00
Patrick Georgi f563f32f82 Add SPDX identifier to license headers
SPDX is an ISO standard for describing licenses in a computer readable
format, which is useful when applying license compliance tools and the
like to source code.

In addition to ensuring that the Wuffs C distribution is properly
annotated to the benefit of projects using Wuffs and SPDX-supporting
tools, add it everywhere else where there's a license in this repo for
consistency, too.
2023-10-06 20:52:36 +02:00
Nigel Tao 74a6ea2fcd all: relicense from Apache2 to dual Apache2/MIT
The LICENSE has changed from a single license (Apache2) to a dual
license (Apache2 or MIT, at your option).

If you've previously used Wuffs under the Apache2 license, you are able
to keep doing so. No further action required by you.

The two files listed below (previous releases) are exceptions, as they
are older snapshots, frozen in time. Their license has not changed:
release/c/wuffs-v0.2.c
release/c/wuffs-v0.3.c

Every name in the AUTHORS file, other than Google Inc., has signed
Google's CLA (Contributor License Agreement).
2023-10-06 10:00:59 +11:00
Nigel Tao 2f65d6fc74 Use go:embed instead of ".../internal/cgen/data" 2021-08-22 12:52:52 +10:00
Nigel Tao 226c476994 Remove calls to Go's deprecated "io/ioutil" 2021-08-22 11:17:34 +10:00
Nigel Tao ea50956b5a Ignore "-Wimplicit-fallthrough" 2021-07-05 21:40:25 +10:00
Nigel Tao 76e6872498 Have clang-cl ignore unused-function etc warnings 2021-06-25 13:51:27 +10:00
Nigel Tao 543ac9af28 Restrict "ignore -Wold-style-cast" to C++ 2021-04-02 22:43:55 +11:00
Nigel Tao 97e30c29da Add some more #pragma's for GCC to ignore warnings 2021-04-02 19:21:54 +11:00
Nigel Tao bb2e9e90b5 Change cgen marker symbol from "!!" to "¡" 2021-03-25 22:17:26 +11:00
Nigel Tao 61635213cd Add "‼" to "WUFFS C HEADER ENDS HERE" comment 2021-03-25 14:11:23 +11:00
Nigel Tao f2ed33375c Gate wuffs_aux on WUFFS_BASE__HAVE_UNIQUE_PTR 2021-03-11 10:52:49 +11:00
Nigel Tao cf6c578973 Add aux library 2020-08-04 23:43:38 +10:00
Nigel Tao 533b84b3b1 Simplify WUFFS_VERSION_ETC macros 2020-06-11 23:01:50 +10:00
Nigel Tao 3efb204f4e Drop wuffs-c genrelease's exec of the C-formatter
genrelease essentially concatenates the individual packages' generated C
files, which should already be formatted.

----
$ # Before.
$ time wuffs gen > /dev/null
real	0m2.622s
user	0m2.457s
sys	0m0.266s

$ # After.
$ time wuffs gen > /dev/null
real	0m1.433s
user	0m1.335s
sys	0m0.191s
----
2020-06-03 13:46:24 +10:00
Nigel Tao 16c1f3cfd7 Clean up some wuffs-c output (before clang-format) 2020-06-03 13:36:04 +10:00
Nigel Tao ddc8973ef0 Let wuffs-c take a no-op C formatter
Reinforcing the previous commit's (e5cc4a42) observation, over 93% of
compilation time (converting foo.wuffs into foo.c) is spent piping the
generated C code through clang-format.

----
$ time wuffs gen -cformatter=clang-format-5.0 > /dev/null
real	0m2.855s
user	0m2.680s
sys	0m0.286s

$ time wuffs gen -cformatter=                 > /dev/null
real	0m0.175s
user	0m0.172s
sys	0m0.050s
----
2020-06-03 13:21:53 +10:00
Nigel Tao e5cc4a42e4 Measure how much of "wuffs gen" is clang-format
----
$ time wuffs gen
       1 milliseconds generating the C code
     753 milliseconds formatting the C code via "clang-format-5.0"
gen unchanged:  /etcetera/wuffs/gen/c/wuffs-base.c
       0 milliseconds generating the C code
      19 milliseconds formatting the C code via "clang-format-5.0"
gen unchanged:  /etcetera/wuffs/gen/c/wuffs-std-adler32.c
gen unchanged:  /etcetera/wuffs/gen/wuffs/std/adler32.wuffs
       1 milliseconds generating the C code
      61 milliseconds formatting the C code via "clang-format-5.0"
gen unchanged:  /etcetera/wuffs/gen/c/wuffs-std-bmp.c
gen unchanged:  /etcetera/wuffs/gen/wuffs/std/bmp.wuffs
       1 milliseconds generating the C code
      78 milliseconds formatting the C code via "clang-format-5.0"
gen unchanged:  /etcetera/wuffs/gen/c/wuffs-std-crc32.c
gen unchanged:  /etcetera/wuffs/gen/wuffs/std/crc32.wuffs
       2 milliseconds generating the C code
      93 milliseconds formatting the C code via "clang-format-5.0"
gen unchanged:  /etcetera/wuffs/gen/c/wuffs-std-deflate.c
gen unchanged:  /etcetera/wuffs/gen/wuffs/std/deflate.wuffs
       0 milliseconds generating the C code
      34 milliseconds formatting the C code via "clang-format-5.0"
gen unchanged:  /etcetera/wuffs/gen/c/wuffs-std-lzw.c
gen unchanged:  /etcetera/wuffs/gen/wuffs/std/lzw.wuffs
       4 milliseconds generating the C code
     203 milliseconds formatting the C code via "clang-format-5.0"
gen unchanged:  /etcetera/wuffs/gen/c/wuffs-std-gif.c
gen unchanged:  /etcetera/wuffs/gen/wuffs/std/gif.wuffs
       0 milliseconds generating the C code
      33 milliseconds formatting the C code via "clang-format-5.0"
gen unchanged:  /etcetera/wuffs/gen/c/wuffs-std-gzip.c
gen unchanged:  /etcetera/wuffs/gen/wuffs/std/gzip.wuffs
       4 milliseconds generating the C code
     135 milliseconds formatting the C code via "clang-format-5.0"
gen unchanged:  /etcetera/wuffs/gen/c/wuffs-std-json.c
gen unchanged:  /etcetera/wuffs/gen/wuffs/std/json.wuffs
       0 milliseconds generating the C code
      44 milliseconds formatting the C code via "clang-format-5.0"
gen unchanged:  /etcetera/wuffs/gen/c/wuffs-std-wbmp.c
gen unchanged:  /etcetera/wuffs/gen/wuffs/std/wbmp.wuffs
       0 milliseconds generating the C code
      32 milliseconds formatting the C code via "clang-format-5.0"
gen unchanged:  /etcetera/wuffs/gen/c/wuffs-std-zlib.c
gen unchanged:  /etcetera/wuffs/gen/wuffs/std/zlib.wuffs
       3 milliseconds collecting the C code
    1173 milliseconds formatting the C code via "clang-format-5.0"
gen unchanged:  /etcetera/wuffs/release/c/wuffs-unsupported-snapshot.c

real	0m2.849s
user	0m2.674s
sys	0m0.278s
----
2020-06-03 12:30:47 +10:00
Nigel Tao 1a1f36ce13 Disable clang's -Wunreachable-code warning 2020-04-03 21:57:49 +11:00
Nigel Tao 867ea1cdcc Re-organize WUFFS_VERSION_BUILD_METADATA_XXX 2019-01-06 21:21:36 +11:00
Nigel Tao 63988f3077 Have gen release use commit date not current date 2018-12-30 21:27:25 +11:00
Nigel Tao 2b631202bc Generate WUFFS_VERSION_GIT_REV_LIST_COUNT 2018-12-29 15:45:04 +11:00
Nigel Tao 04c91f1410 Generate .c files instead of .h files
The files' contents haven't changed (other than some relative #include's
that refer to other .c files).

Some build systems have difficulty recognizing .h files as things to be
compiled, instead of just things referred to by things to be compiled.
2018-12-22 15:29:00 +11:00
Nigel Tao 8eb9781a9d Have gen/c code use relative includes
For example, gen/c/wuffs-std-gif.h now #include's "./wuffs-std-lzw.h"
instead of "std/lzw.h", which removes the need to configure an -I
directory when compiling it.
2018-11-03 11:03:11 +11:00
Nigel Tao 717d98441e Re-order the release/c code
Have the order of implementation code match the order of header code.
2018-10-27 12:57:00 +11:00
Nigel Tao 61d03537c2 De-duplicate the gen/c/* files
The gen/c/* files are not checked in, due to the .gitignore file

In Wuffs version 0.1, they were checked in, and programs were expected
to #include them directly. Another goal was for them to be
self-contained, without any #include lines to other Wuffs files, so that
they would be easy to build, without having to configure an -I dir to a
C compiler.

They therefore inlined what would otherwise be an #include. For example,
the generated std/gif.h code would inline the contents of the std/lzw.h
file. The genrelease program would have to de-duplicate these inlines in
order to produce a clean, monolithic release/c/* file.

In Wuffs version 0.2 (the latest version), programs don't #include
gen/c/*. Instead, they #include the monolithic release/c/*. Avoiding the
need to configure an -I directory isn't as important as it used to be.

This change removes that inlining, using the simpler #include line, and
the genrelease program is then simpler because it doesn't need to
de-duplicate.
2018-10-27 12:50:01 +11:00
Nigel Tao dc17398d64 Generate "WUFFS C HEADER ENDS HERE"
Future commits will mean more than one "#ifdef WUFFS_IMPLEMENTATION".
2018-10-06 09:12:04 +10:00
Nigel Tao 05c5b7ba2b Fold "wuffs genrelease" into "wuffs gen" 2018-07-14 12:04:38 +10:00
Nigel Tao fa95380a23 Have WUFFS_INCLUDE_GUARD cover the IMPLEMENTATION 2018-07-14 11:17:54 +10:00
Nigel Tao b82a1992de Don't genrelease a timestamp for version 0.0.0 2018-07-14 09:54:31 +10:00
Nigel Tao a0bafff465 Ship as a "single file C library" 2018-07-14 08:59:36 +10:00
Nigel Tao ad9931ff2e Generate the release .h the same as gen/etc/*.h 2018-06-23 07:11:45 +10:00
Nigel Tao dccf0c60d7 Add a "wuffs genrelease" command 2018-06-16 11:47:35 +10:00