1a4b403fdSFrançois Tigeot /* 2*ee712e41SFrançois Tigeot * Copyright (c) 2015-2019 François Tigeot <ftigeot@wolfpond.org> 3a4b403fdSFrançois Tigeot * All rights reserved. 4a4b403fdSFrançois Tigeot * 5a4b403fdSFrançois Tigeot * Redistribution and use in source and binary forms, with or without 6a4b403fdSFrançois Tigeot * modification, are permitted provided that the following conditions 7a4b403fdSFrançois Tigeot * are met: 8a4b403fdSFrançois Tigeot * 1. Redistributions of source code must retain the above copyright 9a4b403fdSFrançois Tigeot * notice unmodified, this list of conditions, and the following 10a4b403fdSFrançois Tigeot * disclaimer. 11a4b403fdSFrançois Tigeot * 2. Redistributions in binary form must reproduce the above copyright 12a4b403fdSFrançois Tigeot * notice, this list of conditions and the following disclaimer in the 13a4b403fdSFrançois Tigeot * documentation and/or other materials provided with the distribution. 14a4b403fdSFrançois Tigeot * 15a4b403fdSFrançois Tigeot * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 16a4b403fdSFrançois Tigeot * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 17a4b403fdSFrançois Tigeot * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 18a4b403fdSFrançois Tigeot * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 19a4b403fdSFrançois Tigeot * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 20a4b403fdSFrançois Tigeot * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 21a4b403fdSFrançois Tigeot * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 22a4b403fdSFrançois Tigeot * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23a4b403fdSFrançois Tigeot * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 24a4b403fdSFrançois Tigeot * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25a4b403fdSFrançois Tigeot */ 26a4b403fdSFrançois Tigeot 27a4b403fdSFrançois Tigeot #ifndef LINUX_KCONFIG_H 28a4b403fdSFrançois Tigeot #define LINUX_KCONFIG_H 29a4b403fdSFrançois Tigeot 3039cfddd2SFrançois Tigeot #define __kconfig_value1 1, 3139cfddd2SFrançois Tigeot 3239cfddd2SFrançois Tigeot /* 3339cfddd2SFrançois Tigeot * Clever code to always return either 0 or 1 even if x is not defined 3439cfddd2SFrançois Tigeot */ 3539cfddd2SFrançois Tigeot 3639cfddd2SFrançois Tigeot #define IS_ENABLED(x) IS_ENABLED2(x) 3739cfddd2SFrançois Tigeot #define IS_ENABLED2(x) IS_ENABLED3(__kconfig_value##x) 3839cfddd2SFrançois Tigeot #define IS_ENABLED3(x) IS_ENABLED4(x 1, 0) 3939cfddd2SFrançois Tigeot #define IS_ENABLED4(one, two, ...) two 40a4b403fdSFrançois Tigeot 41*ee712e41SFrançois Tigeot #define config_enabled(x) IS_ENABLED(x) 42*ee712e41SFrançois Tigeot 43a4b403fdSFrançois Tigeot #endif /* LINUX_KCONFIG_H */ 44