From patchwork Mon Nov 30 20:32:02 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Calvin Walton X-Patchwork-Id: 24217 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id 55F3A44AA9E for ; Mon, 30 Nov 2020 22:32:19 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 317EF688148; Mon, 30 Nov 2020 22:32:19 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-qv1-f43.google.com (mail-qv1-f43.google.com [209.85.219.43]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id D35D8688105 for ; Mon, 30 Nov 2020 22:32:12 +0200 (EET) Received: by mail-qv1-f43.google.com with SMTP id dm12so6294074qvb.3 for ; Mon, 30 Nov 2020 12:32:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kepstin.ca; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=VH+//Wp2r8Lc+5v1aPHO9r3DZfsJM3PRv1cpqS+4A8s=; b=kJeA8PaeUAI62vRHy9LNKa9KS1VFrfpROK8kT/UI+CPqoBAjqIoVFMPvU//kjuU0CH j9eBOS4OS1K7KZkcNJ3SCKOJoKg9WUVMYoZd0ihZswiA5nxpY2HV8+FEisC/wb9Lbxay FCo5pJf2MiG1dQC8N/dnJ05UD9ydFNHowc+/4= 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:mime-version :content-transfer-encoding; bh=VH+//Wp2r8Lc+5v1aPHO9r3DZfsJM3PRv1cpqS+4A8s=; b=blZZpI8SmZAsnyLc0jBAoQrxJdDiABtHG2abw6eEoeGd4+EqfBUC6s5ZsEjTYuY02s vf7x9vptXYpyKdK/bGlla2VuVPcyAY2AHd7dxTLjz4Qo5EUni3bRmO7A/GIrHzQp4FDb Dt38RLZ3zhCzt26dZyEC1jqDYVK+S+46iu0QEZ/eQp3iLEKp7rwKxH4etIQg0cqmkld2 ZV6MjIPG36SoYi6YDBURPcLJRsALujrnzsWWdU2o6D8dK4LEMKVeqhSjoYa+hUReSixT WHh9G53ek6P0Uqbz1dCjwdwOeIW5MLavYWxenRcakOOwM49s4ETzEeXtEHPssWoBBAVA zCLA== X-Gm-Message-State: AOAM532oIqkqCY/rbHB9YzEA/axVW753QSfOkhdGq1uWhjIGl7LosNJd tE6XhklnKtg1fM7AFuQbxoNp2eowKNTQWMeC X-Google-Smtp-Source: ABdhPJyuTZBt6jyfeeBzIyvFWMzJMrz6UvgW7xhLzSCcQzytHTlOKEXgPv57/SCp0Ni9eGsYWklw+w== X-Received: by 2002:a05:6214:1110:: with SMTP id e16mr24577643qvs.57.1606768330737; Mon, 30 Nov 2020 12:32:10 -0800 (PST) Received: from saya.kepstin.ca (dhcp-108-168-127-144.cable.user.start.ca. [108.168.127.144]) by smtp.gmail.com with ESMTPSA id 72sm17494434qkn.44.2020.11.30.12.32.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Nov 2020 12:32:09 -0800 (PST) From: Calvin Walton To: ffmpeg-devel@ffmpeg.org Date: Mon, 30 Nov 2020 15:32:02 -0500 Message-Id: <20201130203202.84549-1-calvin.walton@kepstin.ca> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH] libavutil: Don't require __STDC_CONSTANT_MACROS on C++11 X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: Calvin Walton Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Prior to C++11, some of the C99 macros in stdint.h were not defined unless __STDC_CONSTANT_MACROS was defined before including the header. C++11 updated this so that the C99 macros are unconditionally defined - __STDC_CONSTANT_MACROS is no longer required. Update the conditional on the error message in common.h so that it does not trigger when using a C++11 or later compiler. --- libavutil/common.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libavutil/common.h b/libavutil/common.h index b9fbcc4d60..f90de59157 100644 --- a/libavutil/common.h +++ b/libavutil/common.h @@ -26,7 +26,11 @@ #ifndef AVUTIL_COMMON_H #define AVUTIL_COMMON_H -#if defined(__cplusplus) && !defined(__STDC_CONSTANT_MACROS) && !defined(UINT64_C) +/* + * In C++ prior to C++11, some of the C99 defines in stdint.h are omitted unless + * you request to enable them by setting __STDC_CONSTANT_MACROS + */ +#if defined(__cplusplus) && __cplusplus < 201103L && !defined(__STDC_CONSTANT_MACROS) && !defined(UINT64_C) #error missing -D__STDC_CONSTANT_MACROS / #define __STDC_CONSTANT_MACROS #endif