diff --git a/cmd/wuffs-c/release.go b/cmd/wuffs-c/release.go index 01faf4ed..d1e93548 100644 --- a/cmd/wuffs-c/release.go +++ b/cmd/wuffs-c/release.go @@ -311,16 +311,16 @@ func (h *genReleaseHelper) substituteWuffsVersion(s []byte) ([]byte, error) { } fmt.Fprintf(w, `. - #define WUFFS_VERSION ((uint64_t)0x%016X) - #define WUFFS_VERSION_MAJOR ((uint64_t)0x%08X) - #define WUFFS_VERSION_MINOR ((uint64_t)0x%04X) - #define WUFFS_VERSION_PATCH ((uint64_t)0x%04X) - #define WUFFS_VERSION_PRE_RELEASE_LABEL %q - #define WUFFS_VERSION_BUILD_METADATA_COMMIT_COUNT %d - #define WUFFS_VERSION_BUILD_METADATA_COMMIT_DATE %s - #define WUFFS_VERSION_STRING %q +#define WUFFS_VERSION 0x%09X +#define WUFFS_VERSION_MAJOR %d +#define WUFFS_VERSION_MINOR %d +#define WUFFS_VERSION_PATCH %d +#define WUFFS_VERSION_PRE_RELEASE_LABEL %q +#define WUFFS_VERSION_BUILD_METADATA_COMMIT_COUNT %d +#define WUFFS_VERSION_BUILD_METADATA_COMMIT_DATE %s +#define WUFFS_VERSION_STRING %q - `, h.version.Uint64(), h.version.Major, h.version.Minor, h.version.Patch, +`, h.version.Uint64(), h.version.Major, h.version.Minor, h.version.Patch, h.version.Extension, h.gitRevListCount, commitDate, h.version.String()+buildMetadata) diff --git a/internal/cgen/base/fundamental-public.h b/internal/cgen/base/fundamental-public.h index 6190ad9f..bd78a3a7 100644 --- a/internal/cgen/base/fundamental-public.h +++ b/internal/cgen/base/fundamental-public.h @@ -31,10 +31,10 @@ // each major.minor branch, the commit count should increase monotonically. // // !! Some code generation programs can override WUFFS_VERSION. -#define WUFFS_VERSION ((uint64_t)0) -#define WUFFS_VERSION_MAJOR ((uint64_t)0) -#define WUFFS_VERSION_MINOR ((uint64_t)0) -#define WUFFS_VERSION_PATCH ((uint64_t)0) +#define WUFFS_VERSION 0 +#define WUFFS_VERSION_MAJOR 0 +#define WUFFS_VERSION_MINOR 0 +#define WUFFS_VERSION_PATCH 0 #define WUFFS_VERSION_PRE_RELEASE_LABEL "work.in.progress" #define WUFFS_VERSION_BUILD_METADATA_COMMIT_COUNT 0 #define WUFFS_VERSION_BUILD_METADATA_COMMIT_DATE 0 diff --git a/internal/cgen/data/data.go b/internal/cgen/data/data.go index a6491fad..1abc974b 100644 --- a/internal/cgen/data/data.go +++ b/internal/cgen/data/data.go @@ -203,8 +203,8 @@ const BaseFundamentalPrivateH = "" + "" const BaseFundamentalPublicH = "" + - "// ---------------- Fundamentals\n\n// WUFFS_VERSION is the major.minor.patch version, as per https://semver.org/,\n// as a uint64_t. The major number is the high 32 bits. The minor number is the\n// middle 16 bits. The patch number is the low 16 bits. The pre-release label\n// and build metadata are part of the string representation (such as\n// \"1.2.3-beta+456.20181231\") but not the uint64_t representation.\n//\n// WUFFS_VERSION_PRE_RELEASE_LABEL (such as \"\", \"beta\" or \"rc.1\") being\n// non-empty denotes a developer preview, not a release version, and has no\n// backwards or forwards compatibility guarantees.\n//\n// WUFFS_VERSION_BUILD_METADATA_XXX, if non-zero, are the number of commits and\n// the last commit date in the repository used to build this library. Within\n// each major.minor branch, the commit count should increase monotonically.\n//\n// !! Some code generation programs can override WUFFS_VERSION.\n#define WUFFS_VERSION ((uint64_t)0)\n#define WUFFS_VERSION_MAJOR ((uint64_t)0)\n#define WUFFS_VERSION_MINOR ((uint" + - "64_t)0)\n#define WUFFS_VERSION_PATCH ((uint64_t)0)\n#define WUFFS_VERSION_PRE_RELEASE_LABEL \"work.in.progress\"\n#define WUFFS_VERSION_BUILD_METADATA_COMMIT_COUNT 0\n#define WUFFS_VERSION_BUILD_METADATA_COMMIT_DATE 0\n#define WUFFS_VERSION_STRING \"0.0.0+0.00000000\"\n\n// Define WUFFS_CONFIG__STATIC_FUNCTIONS to make all of Wuffs' functions have\n// static storage. The motivation is discussed in the \"ALLOW STATIC\n// IMPLEMENTATION\" section of\n// https://raw.githubusercontent.com/nothings/stb/master/docs/stb_howto.txt\n#ifdef WUFFS_CONFIG__STATIC_FUNCTIONS\n#define WUFFS_BASE__MAYBE_STATIC static\n#else\n#define WUFFS_BASE__MAYBE_STATIC\n#endif\n\n" + + "// ---------------- Fundamentals\n\n// WUFFS_VERSION is the major.minor.patch version, as per https://semver.org/,\n// as a uint64_t. The major number is the high 32 bits. The minor number is the\n// middle 16 bits. The patch number is the low 16 bits. The pre-release label\n// and build metadata are part of the string representation (such as\n// \"1.2.3-beta+456.20181231\") but not the uint64_t representation.\n//\n// WUFFS_VERSION_PRE_RELEASE_LABEL (such as \"\", \"beta\" or \"rc.1\") being\n// non-empty denotes a developer preview, not a release version, and has no\n// backwards or forwards compatibility guarantees.\n//\n// WUFFS_VERSION_BUILD_METADATA_XXX, if non-zero, are the number of commits and\n// the last commit date in the repository used to build this library. Within\n// each major.minor branch, the commit count should increase monotonically.\n//\n// !! Some code generation programs can override WUFFS_VERSION.\n#define WUFFS_VERSION 0\n#define WUFFS_VERSION_MAJOR 0\n#define WUFFS_VERSION_MINOR 0\n#define WUFFS_VERSION_PATCH " + + "0\n#define WUFFS_VERSION_PRE_RELEASE_LABEL \"work.in.progress\"\n#define WUFFS_VERSION_BUILD_METADATA_COMMIT_COUNT 0\n#define WUFFS_VERSION_BUILD_METADATA_COMMIT_DATE 0\n#define WUFFS_VERSION_STRING \"0.0.0+0.00000000\"\n\n// Define WUFFS_CONFIG__STATIC_FUNCTIONS to make all of Wuffs' functions have\n// static storage. The motivation is discussed in the \"ALLOW STATIC\n// IMPLEMENTATION\" section of\n// https://raw.githubusercontent.com/nothings/stb/master/docs/stb_howto.txt\n#ifdef WUFFS_CONFIG__STATIC_FUNCTIONS\n#define WUFFS_BASE__MAYBE_STATIC static\n#else\n#define WUFFS_BASE__MAYBE_STATIC\n#endif\n\n" + "" + "// --------\n\n// Wuffs assumes that:\n// - converting a uint32_t to a size_t will never overflow.\n// - converting a size_t to a uint64_t will never overflow.\n#ifdef __WORDSIZE\n#if (__WORDSIZE != 32) && (__WORDSIZE != 64)\n#error \"Wuffs requires a word size of either 32 or 64 bits\"\n#endif\n#endif\n\n#if defined(__clang__)\n#define WUFFS_BASE__POTENTIALLY_UNUSED_FIELD __attribute__((unused))\n#else\n#define WUFFS_BASE__POTENTIALLY_UNUSED_FIELD\n#endif\n\n// Clang also defines \"__GNUC__\".\n#if defined(__GNUC__)\n#define WUFFS_BASE__POTENTIALLY_UNUSED __attribute__((unused))\n#define WUFFS_BASE__WARN_UNUSED_RESULT __attribute__((warn_unused_result))\n#else\n#define WUFFS_BASE__POTENTIALLY_UNUSED\n#define WUFFS_BASE__WARN_UNUSED_RESULT\n#endif\n\n// Flags for wuffs_foo__bar__initialize functions.\n\n#define WUFFS_INITIALIZE__DEFAULT_OPTIONS ((uint32_t)0x00000000)\n\n// WUFFS_INITIALIZE__ALREADY_ZEROED means that the \"self\" receiver struct value\n// has already been set to all zeroes.\n#define WUFFS_INITIALIZE__ALREADY_ZEROED ((uint32_t)0x" + "00000001)\n\n// WUFFS_INITIALIZE__LEAVE_INTERNAL_BUFFERS_UNINITIALIZED means that, absent\n// WUFFS_INITIALIZE__ALREADY_ZEROED, only some of the \"self\" receiver struct\n// value will be set to all zeroes. Internal buffers, which tend to be a large\n// proportion of the struct's size, will be left uninitialized. Internal means\n// that the buffer is contained by the receiver struct, as opposed to being\n// passed as a separately allocated \"work buffer\".\n//\n// For more detail, see:\n// https://github.com/google/wuffs/blob/master/doc/note/initialization.md\n#define WUFFS_INITIALIZE__LEAVE_INTERNAL_BUFFERS_UNINITIALIZED \\\n ((uint32_t)0x00000002)\n\n" + diff --git a/release/c/wuffs-unsupported-snapshot.c b/release/c/wuffs-unsupported-snapshot.c index 6f663f47..e1ed6b5a 100644 --- a/release/c/wuffs-unsupported-snapshot.c +++ b/release/c/wuffs-unsupported-snapshot.c @@ -62,10 +62,10 @@ extern "C" { // each major.minor branch, the commit count should increase monotonically. // // !! Some code generation programs can override WUFFS_VERSION. -#define WUFFS_VERSION ((uint64_t)0) -#define WUFFS_VERSION_MAJOR ((uint64_t)0) -#define WUFFS_VERSION_MINOR ((uint64_t)0) -#define WUFFS_VERSION_PATCH ((uint64_t)0) +#define WUFFS_VERSION 0 +#define WUFFS_VERSION_MAJOR 0 +#define WUFFS_VERSION_MINOR 0 +#define WUFFS_VERSION_PATCH 0 #define WUFFS_VERSION_PRE_RELEASE_LABEL "work.in.progress" #define WUFFS_VERSION_BUILD_METADATA_COMMIT_COUNT 0 #define WUFFS_VERSION_BUILD_METADATA_COMMIT_DATE 0