From 8a0a13ea53235d3122b22c147d97cc410bfd4e2b Mon Sep 17 00:00:00 2001 From: Gao Xiang Date: Thu, 27 Jun 2024 11:13:43 +0800 Subject: [PATCH] erofs-utils: fix "non-trivial designated initializers not supported" This partially reverts commit 79f6e168d94c ("erofs-utils: improve compatibility and reduce header conflicts") since some C++ compiler will complain: include/erofs_fs.h: In function 'void erofs_check_ondisk_layout_definitions()': include/erofs_fs.h:460:2: sorry, unimplemented: non-trivial designated initializers not supported Let's just bypass this compile-time check for the C++ language since only external programs may be written in C++. Fixes: 79f6e168d94c ("erofs-utils: improve compatibility and reduce header conflicts") Cc: Hongzhen Luo Link: https://lore.kernel.org/r/20240627031343.3424030-1-hsiangkao@linux.alibaba.com Signed-off-by: Gao Xiang --- include/erofs_fs.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/include/erofs_fs.h b/include/erofs_fs.h index 0d603c4..fc21915 100644 --- a/include/erofs_fs.h +++ b/include/erofs_fs.h @@ -450,14 +450,14 @@ struct z_erofs_lcluster_index { /* check the EROFS on-disk layout strictly at compile time */ static inline void erofs_check_ondisk_layout_definitions(void) { +#ifndef __cplusplus const union { struct z_erofs_map_header h; __le64 v; } fmh __maybe_unused = { - .h = { - .h_clusterbits = 1 <