From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from [87.239.111.99] (localhost [127.0.0.1]) by dev.tarantool.org (Postfix) with ESMTP id 5780F6EC56; Thu, 15 Jul 2021 00:24:41 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 5780F6EC56 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1626297881; bh=4IuwM1qNS/9rBat6kkZaaC37xzU8c90+yLnpQIFmXHM=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=SeIjRsfxcNzcwnbGVmGqkOxxIV6pu6h0WXYJhfkCfJGE1htIHvOh4kWL+jLgmmUTg u0H4ZnmeLXk/IvoZ9WoElYFgJ5TwluJ/DnVtOFlm2+8h68CohZZ/R6bUyEh6o0rfFO qtv5j3T013EkvPseUxsFEA2jQe+Yv+VicaqBYJtk= Received: from mail-lf1-f52.google.com (mail-lf1-f52.google.com [209.85.167.52]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 661026EC56 for ; Thu, 15 Jul 2021 00:24:00 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 661026EC56 Received: by mail-lf1-f52.google.com with SMTP id 22so5987730lfy.12 for ; Wed, 14 Jul 2021 14:24:00 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=xXLkpH45g9jZHteqRKPYNcx0VGTlTS5/2Sl6Z+PqFaA=; b=ZW4XE0pJx2AO6j9hzQbNNd6u2xgDxCW4ABRyVJYBHACjHTuLUCqLOUzNa+4VZmH2iB i1xGlyonLukRrp0Ok7DPolM4VIIWEZFLVpvbnUYNbUgYOL6ySonfnlb3a+ZtlG0vBOWc oTfhZ/kYzP5mcp9gnMDK7L0iD5Zr9ablTdQiLWMuPrca3VToakBDKox7WNR7gkx4FXv2 yik+NpewTp0DEFUKj+n23HG7pGxrNeTa77CyyuDyYuvcskpM1X9Jvj88Q7lYyxghlcnQ JL882T+8fYLZEWvZsEp4v7edDqGdA3m3rHaTWbolBinIj2v9FXUjPBTrPLAh5k/6tyNK 4ctg== X-Gm-Message-State: AOAM530E9c7YXXUPafN7ygYzjeZ8BOoJ7+S8OIU2h2gAaHFHiijw+xgQ gc0y9/Kr2lRDhJlxxkeYuqhtew5+kJ+Rnw== X-Google-Smtp-Source: ABdhPJzOm3DC82HkDXNdaFID49PeV5f36tDwgRqcAcw9Nw6lFR2AlV9qIJ5x7Re5ZJOUluq5JdB11Q== X-Received: by 2002:a05:6512:102e:: with SMTP id r14mr181260lfr.34.1626297839530; Wed, 14 Jul 2021 14:23:59 -0700 (PDT) Received: from grain.localdomain ([5.18.199.94]) by smtp.gmail.com with ESMTPSA id k10sm250689lfg.35.2021.07.14.14.23.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Jul 2021 14:23:58 -0700 (PDT) Received: by grain.localdomain (Postfix, from userid 1000) id 8C33E5A0020; Thu, 15 Jul 2021 00:23:32 +0300 (MSK) To: tml Date: Thu, 15 Jul 2021 00:23:25 +0300 Message-Id: <20210714212328.701280-3-gorcunov@gmail.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210714212328.701280-1-gorcunov@gmail.com> References: <20210714212328.701280-1-gorcunov@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [Tarantool-patches] [RFC v5 2/5] say: introduce panic_on helper X-BeenThere: tarantool-patches@dev.tarantool.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Cyrill Gorcunov via Tarantool-patches Reply-To: Cyrill Gorcunov Cc: Vladislav Shpilevoy Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" In-scope-of #6036 Signed-off-by: Cyrill Gorcunov --- src/lib/core/say.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lib/core/say.h b/src/lib/core/say.h index e1fec8c60..4bb1645fd 100644 --- a/src/lib/core/say.h +++ b/src/lib/core/say.h @@ -348,6 +348,7 @@ CFORMAT(printf, 5, 6) extern sayfunc_t _say; #define panic_status(status, ...) ({ say(S_FATAL, NULL, __VA_ARGS__); exit(status); }) #define panic(...) panic_status(EXIT_FAILURE, __VA_ARGS__) +#define panic_on(cond, ...) if (cond) panic(__VA_ARGS__) #define panic_syserror(...) ({ say(S_FATAL, strerror(errno), __VA_ARGS__); exit(EXIT_FAILURE); }) enum { -- 2.31.1