/* Chrysalide - Outil d'analyse de fichiers binaires * compiler.h - prototypes pour le regroupement d'astuces à destination du compilateur * * Copyright (C) 2024-2025 Cyrille Bagard * * This file is part of Chrysalide. * * Chrysalide is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * Chrysalide 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Chrysalide. If not, see . */ #ifndef _COMMON_COMPILER_H #define _COMMON_COMPILER_H /** * Raccourcis d'attributs communs. */ #define __private __attribute__((visibility("hidden"))) #define __weak __attribute__((weak)) /** * Contournement des avertissements de la forme suivante : * * assignment to 'const char * const*' from incompatible pointer type 'char **' [-Wincompatible-pointer-types] * * Références : * - https://www.reddit.com/r/C_Programming/comments/qa2231/const_char_const_and_char_are_incompatible/ * - https://stackoverflow.com/questions/78125/why-cant-i-convert-char-to-a-const-char-const-in-c * - https://c-faq.com/ansi/constmismatch.html */ #define CONST_ARRAY_CAST(a, tp) (const tp **)a #endif /* _COMMON_COMPILER_H */