Skip to content

Commit c4f93aa

Browse files
committed
Move Wuffs to ThirdParty directory
1 parent f9ca147 commit c4f93aa

2 files changed

Lines changed: 5 additions & 9 deletions

File tree

Source/astcenccli_image_external.cpp

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// SPDX-License-Identifier: Apache-2.0
22
// ----------------------------------------------------------------------------
3-
// Copyright 2011-2023 Arm Limited
3+
// Copyright 2011-2026 Arm Limited
44
//
55
// Licensed under the Apache License, Version 2.0 (the "License"); you may not
66
// use this file except in compliance with the License. You may obtain a copy
@@ -16,7 +16,7 @@
1616
// ----------------------------------------------------------------------------
1717

1818
/**
19-
* @brief Functions for building the implementation of stb_image and tinyexr.
19+
* @brief Functions for implementation of stb_image, TinyEXR, and Wuffs.
2020
*/
2121

2222
#include <cstdlib>
@@ -34,9 +34,11 @@
3434
#define STBI_NO_PNM
3535
#define STBI_NO_PNG
3636
#define STBI_NO_PSD
37+
#define STBI_ASSERT(x) astcenc_runtime_assert(x)
3738

3839
// Configure the TinyEXR library build.
3940
#define TINYEXR_IMPLEMENTATION
41+
#define TEXR_ASSERT(x) astcenc_runtime_assert(x)
4042

4143
// Configure the Wuffs library build.
4244
#define WUFFS_IMPLEMENTATION
@@ -47,13 +49,6 @@
4749
#define WUFFS_CONFIG__MODULE__DEFLATE
4850
#define WUFFS_CONFIG__MODULE__PNG
4951
#define WUFFS_CONFIG__MODULE__ZLIB
50-
#include "wuffs-v0.3.c"
51-
52-
// For both libraries force asserts (which can be triggered by corrupt input
53-
// images) to be handled at runtime in release builds to avoid security issues.
54-
#define STBI_ASSERT(x) astcenc_runtime_assert(x)
55-
#define TEXR_ASSERT(x) astcenc_runtime_assert(x)
56-
5752
/**
5853
* @brief Trap image load failures and convert into a runtime error.
5954
*/
@@ -69,6 +64,7 @@ static void astcenc_runtime_assert(bool condition)
6964
#include "ThirdParty/stb_image.h"
7065
#include "ThirdParty/stb_image_write.h"
7166
#include "ThirdParty/tinyexr.h"
67+
#include "ThirdParty/wuffs-v0.3.c"
7268

7369
/**
7470
* @brief Load an image using Wuffs to provide the loader.

0 commit comments

Comments
 (0)