Pass std::ranges::subrange to PHYSFSX_checkMatchingExtension

This commit is contained in:
Kp 2022-10-09 23:15:21 +00:00
parent 90d3d82d8e
commit 57de180a2e
2 changed files with 4 additions and 11 deletions

View File

@ -14,9 +14,10 @@
#pragma once
#include <cstddef>
#include <cstring>
#include <memory>
#include <ranges>
#include <span>
#include <string.h>
#include <stdarg.h>
#include <type_traits>
@ -423,15 +424,7 @@ typedef char file_extension_t[5];
[[nodiscard]]
__attribute_nonnull()
int PHYSFSX_checkMatchingExtension(const char *filename, const partial_range_t<const file_extension_t *>);
template <std::size_t count>
[[nodiscard]]
__attribute_nonnull()
static inline int PHYSFSX_checkMatchingExtension(const std::array<file_extension_t, count> &exts, const char *filename)
{
return PHYSFSX_checkMatchingExtension(filename, exts);
}
int PHYSFSX_checkMatchingExtension(const char *filename, const std::ranges::subrange<const file_extension_t *> range);
enum class physfs_search_path : int
{

View File

@ -71,7 +71,7 @@ char *PHYSFSX_fgets_t::get(const std::span<char> buf, PHYSFS_File *const fp)
return cleanup();
}
int PHYSFSX_checkMatchingExtension(const char *filename, const partial_range_t<const file_extension_t *> range)
int PHYSFSX_checkMatchingExtension(const char *filename, const std::ranges::subrange<const file_extension_t *> range)
{
const char *ext = strrchr(filename, '.');
if (!ext)