diff --git a/dlls/d3dcompiler_43/d3dcompiler_private.h b/dlls/d3dcompiler_43/d3dcompiler_private.h index 791c8d1cad2..08cdb515470 100644 --- a/dlls/d3dcompiler_43/d3dcompiler_private.h +++ b/dlls/d3dcompiler_43/d3dcompiler_private.h @@ -33,6 +33,7 @@ #include "objbase.h" #include "d3dcompiler.h" +#include "utils.h" #include #include @@ -568,15 +569,6 @@ HRESULT dxbc_parse(const char *data, SIZE_T data_size, struct dxbc *dxbc) DECLSP HRESULT dxbc_add_section(struct dxbc *dxbc, DWORD tag, const char *data, size_t data_size) DECLSPEC_HIDDEN; HRESULT dxbc_init(struct dxbc *dxbc, unsigned int size) DECLSPEC_HIDDEN; -static inline uint32_t read_u32(const char **ptr) -{ - uint32_t r; - - memcpy(&r, *ptr, sizeof(r)); - *ptr += sizeof(r); - return r; -} - static inline void write_u32(char **ptr, uint32_t u32) { memcpy(*ptr, &u32, sizeof(u32)); diff --git a/dlls/d3dcompiler_43/utils.h b/dlls/d3dcompiler_43/utils.h new file mode 100644 index 00000000000..fdb7f8e8db4 --- /dev/null +++ b/dlls/d3dcompiler_43/utils.h @@ -0,0 +1,33 @@ +/* + * Copyright 2022 Matteo Bruni for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#ifndef __WINE_UTILS_H +#define __WINE_UTILS_H + +#include + +static inline uint32_t read_u32(const char **ptr) +{ + uint32_t r; + + memcpy(&r, *ptr, sizeof(r)); + *ptr += sizeof(r); + return r; +} + +#endif /* __WINE_UTILS_H */