get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/126139/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 126139,
    "url": "http://patches.dpdk.org/api/patches/126139/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1681521346-20356-12-git-send-email-roretzla@linux.microsoft.com/",
    "project": {
        "id": 1,
        "url": "http://patches.dpdk.org/api/projects/1/?format=api",
        "name": "DPDK",
        "link_name": "dpdk",
        "list_id": "dev.dpdk.org",
        "list_email": "dev@dpdk.org",
        "web_url": "http://core.dpdk.org",
        "scm_url": "git://dpdk.org/dpdk",
        "webscm_url": "http://git.dpdk.org/dpdk",
        "list_archive_url": "https://inbox.dpdk.org/dev",
        "list_archive_url_format": "https://inbox.dpdk.org/dev/{}",
        "commit_url_format": ""
    },
    "msgid": "<1681521346-20356-12-git-send-email-roretzla@linux.microsoft.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1681521346-20356-12-git-send-email-roretzla@linux.microsoft.com",
    "date": "2023-04-15T01:15:42",
    "name": "[v6,11/15] eal: expand most macros to empty when using MSVC",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "738280cddf8919f927e748666dea31f82cd13497",
    "submitter": {
        "id": 2077,
        "url": "http://patches.dpdk.org/api/people/2077/?format=api",
        "name": "Tyler Retzlaff",
        "email": "roretzla@linux.microsoft.com"
    },
    "delegate": {
        "id": 1,
        "url": "http://patches.dpdk.org/api/users/1/?format=api",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/1681521346-20356-12-git-send-email-roretzla@linux.microsoft.com/mbox/",
    "series": [
        {
            "id": 27725,
            "url": "http://patches.dpdk.org/api/series/27725/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=27725",
            "date": "2023-04-15T01:15:34",
            "name": "msvc integration changes",
            "version": 6,
            "mbox": "http://patches.dpdk.org/series/27725/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/126139/comments/",
    "check": "warning",
    "checks": "http://patches.dpdk.org/api/patches/126139/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@inbox.dpdk.org",
        "Delivered-To": "patchwork@inbox.dpdk.org",
        "Received": [
            "from mails.dpdk.org (mails.dpdk.org [217.70.189.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 0EC6E42946;\n\tSat, 15 Apr 2023 03:17:20 +0200 (CEST)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id A1CAD42D63;\n\tSat, 15 Apr 2023 03:16:06 +0200 (CEST)",
            "from linux.microsoft.com (linux.microsoft.com [13.77.154.182])\n by mails.dpdk.org (Postfix) with ESMTP id DD69842B8C\n for <dev@dpdk.org>; Sat, 15 Apr 2023 03:15:49 +0200 (CEST)",
            "by linux.microsoft.com (Postfix, from userid 1086)\n id 764FC217A95D; Fri, 14 Apr 2023 18:15:48 -0700 (PDT)"
        ],
        "DKIM-Filter": "OpenDKIM Filter v2.11.0 linux.microsoft.com 764FC217A95D",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com;\n s=default; t=1681521348;\n bh=3fP9eijTDbnmdSLoLFf2j2FhcLw4jsueCjLNB9IbbAs=;\n h=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n b=aA6zbdTUyDoWfs+85OKP91WiWbtORbIsau727ntM/UBVetQNFe8U6Qfq4v369sfIQ\n 0Z76bdi404l7ypEkglCC3H+AZ5YDqWISrIMu4GnXyBHTYKbJ3R5yjksBPaPgtM9MeP\n 7KkYKRwXZmP7lr06TPT6q8u/UjyGGNWfnLRwJxiw=",
        "From": "Tyler Retzlaff <roretzla@linux.microsoft.com>",
        "To": "dev@dpdk.org",
        "Cc": "bruce.richardson@intel.com, david.marchand@redhat.com,\n thomas@monjalon.net,\n mb@smartsharesystems.com, konstantin.ananyev@huawei.com,\n Tyler Retzlaff <roretzla@linux.microsoft.com>",
        "Subject": "[PATCH v6 11/15] eal: expand most macros to empty when using MSVC",
        "Date": "Fri, 14 Apr 2023 18:15:42 -0700",
        "Message-Id": "<1681521346-20356-12-git-send-email-roretzla@linux.microsoft.com>",
        "X-Mailer": "git-send-email 1.8.3.1",
        "In-Reply-To": "<1681521346-20356-1-git-send-email-roretzla@linux.microsoft.com>",
        "References": "<1680558751-17931-1-git-send-email-roretzla@linux.microsoft.com>\n <1681521346-20356-1-git-send-email-roretzla@linux.microsoft.com>",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.29",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org"
    },
    "content": "For now expand a lot of common rte macros empty. The catch here is we\nneed to test that most of the macros do what they should but at the same\ntime they are blocking work needed to bootstrap of the unit tests.\n\nLater we will return and provide (where possible) expansions that work\ncorrectly for msvc and where not possible provide some alternate macros\nto achieve the same outcome.\n\nSigned-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>\n---\n lib/eal/include/rte_branch_prediction.h |  8 +++++\n lib/eal/include/rte_common.h            | 54 +++++++++++++++++++++++++++++++++\n lib/eal/include/rte_compat.h            | 20 ++++++++++++\n 3 files changed, 82 insertions(+)",
    "diff": "diff --git a/lib/eal/include/rte_branch_prediction.h b/lib/eal/include/rte_branch_prediction.h\nindex 0256a9d..1eff9f6 100644\n--- a/lib/eal/include/rte_branch_prediction.h\n+++ b/lib/eal/include/rte_branch_prediction.h\n@@ -25,7 +25,11 @@\n  *\n  */\n #ifndef likely\n+#ifndef RTE_TOOLCHAIN_MSVC\n #define likely(x)\t__builtin_expect(!!(x), 1)\n+#else\n+#define likely(x)\t(!!(x))\n+#endif\n #endif /* likely */\n \n /**\n@@ -39,7 +43,11 @@\n  *\n  */\n #ifndef unlikely\n+#ifndef RTE_TOOLCHAIN_MSVC\n #define unlikely(x)\t__builtin_expect(!!(x), 0)\n+#else\n+#define unlikely(x)\t(!!(x))\n+#endif\n #endif /* unlikely */\n \n #ifdef __cplusplus\ndiff --git a/lib/eal/include/rte_common.h b/lib/eal/include/rte_common.h\nindex 2f464e3..5417f68 100644\n--- a/lib/eal/include/rte_common.h\n+++ b/lib/eal/include/rte_common.h\n@@ -62,10 +62,18 @@\n \t\t__GNUC_PATCHLEVEL__)\n #endif\n \n+#ifdef RTE_TOOLCHAIN_MSVC\n+#define __extension__\n+#endif\n+\n /**\n  * Force alignment\n  */\n+#ifndef RTE_TOOLCHAIN_MSVC\n #define __rte_aligned(a) __attribute__((__aligned__(a)))\n+#else\n+#define __rte_aligned(a)\n+#endif\n \n #ifdef RTE_ARCH_STRICT_ALIGN\n typedef uint64_t unaligned_uint64_t __rte_aligned(1);\n@@ -80,16 +88,29 @@\n /**\n  * Force a structure to be packed\n  */\n+#ifndef RTE_TOOLCHAIN_MSVC\n #define __rte_packed __attribute__((__packed__))\n+#else\n+#define __rte_packed\n+#endif\n \n /**\n  * Macro to mark a type that is not subject to type-based aliasing rules\n  */\n+#ifndef RTE_TOOLCHAIN_MSVC\n #define __rte_may_alias __attribute__((__may_alias__))\n+#else\n+#define __rte_may_alias\n+#endif\n \n /******* Macro to mark functions and fields scheduled for removal *****/\n+#ifndef RTE_TOOLCHAIN_MSVC\n #define __rte_deprecated\t__attribute__((__deprecated__))\n #define __rte_deprecated_msg(msg)\t__attribute__((__deprecated__(msg)))\n+#else\n+#define __rte_deprecated\n+#define __rte_deprecated_msg(msg)\n+#endif\n \n /**\n  *  Macro to mark macros and defines scheduled for removal\n@@ -110,14 +131,22 @@\n /**\n  * Force symbol to be generated even if it appears to be unused.\n  */\n+#ifndef RTE_TOOLCHAIN_MSVC\n #define __rte_used __attribute__((used))\n+#else\n+#define __rte_used\n+#endif\n \n /*********** Macros to eliminate unused variable warnings ********/\n \n /**\n  * short definition to mark a function parameter unused\n  */\n+#ifndef RTE_TOOLCHAIN_MSVC\n #define __rte_unused __attribute__((__unused__))\n+#else\n+#define __rte_unused\n+#endif\n \n /**\n  * Mark pointer as restricted with regard to pointer aliasing.\n@@ -141,6 +170,7 @@\n  * even if the underlying stdio implementation is ANSI-compliant,\n  * so this must be overridden.\n  */\n+#ifndef RTE_TOOLCHAIN_MSVC\n #if RTE_CC_IS_GNU\n #define __rte_format_printf(format_index, first_arg) \\\n \t__attribute__((format(gnu_printf, format_index, first_arg)))\n@@ -148,6 +178,9 @@\n #define __rte_format_printf(format_index, first_arg) \\\n \t__attribute__((format(printf, format_index, first_arg)))\n #endif\n+#else\n+#define __rte_format_printf(format_index, first_arg)\n+#endif\n \n /**\n  * Tells compiler that the function returns a value that points to\n@@ -222,7 +255,11 @@ static void __attribute__((destructor(RTE_PRIO(prio)), used)) func(void)\n /**\n  * Hint never returning function\n  */\n+#ifndef RTE_TOOLCHAIN_MSVC\n #define __rte_noreturn __attribute__((noreturn))\n+#else\n+#define __rte_noreturn\n+#endif\n \n /**\n  * Issue a warning in case the function's return value is ignored.\n@@ -247,12 +284,20 @@ static void __attribute__((destructor(RTE_PRIO(prio)), used)) func(void)\n  *  }\n  * @endcode\n  */\n+#ifndef RTE_TOOLCHAIN_MSVC\n #define __rte_warn_unused_result __attribute__((warn_unused_result))\n+#else\n+#define __rte_warn_unused_result\n+#endif\n \n /**\n  * Force a function to be inlined\n  */\n+#ifndef RTE_TOOLCHAIN_MSVC\n #define __rte_always_inline inline __attribute__((always_inline))\n+#else\n+#define __rte_always_inline\n+#endif\n \n /**\n  * Force a function to be noinlined\n@@ -437,7 +482,11 @@ static void __attribute__((destructor(RTE_PRIO(prio)), used)) func(void)\n #define RTE_CACHE_LINE_MIN_SIZE 64\n \n /** Force alignment to cache line. */\n+#ifndef RTE_TOOLCHAIN_MSVC\n #define __rte_cache_aligned __rte_aligned(RTE_CACHE_LINE_SIZE)\n+#else\n+#define __rte_cache_aligned\n+#endif\n \n /** Force minimum cache line alignment. */\n #define __rte_cache_min_aligned __rte_aligned(RTE_CACHE_LINE_MIN_SIZE)\n@@ -812,12 +861,17 @@ static void __attribute__((destructor(RTE_PRIO(prio)), used)) func(void)\n  *  struct wrapper *w = container_of(x, struct wrapper, c);\n  */\n #ifndef container_of\n+#ifndef RTE_TOOLCHAIN_MSVC\n #define container_of(ptr, type, member)\t__extension__ ({\t\t\\\n \t\t\tconst typeof(((type *)0)->member) *_ptr = (ptr); \\\n \t\t\t__rte_unused type *_target_ptr =\t\\\n \t\t\t\t(type *)(ptr);\t\t\t\t\\\n \t\t\t(type *)(((uintptr_t)_ptr) - offsetof(type, member)); \\\n \t\t})\n+#else\n+#define container_of(ptr, type, member) \\\n+\t\t\t((type *)((uintptr_t)(ptr) - offsetof(type, member)))\n+#endif\n #endif\n \n /** Swap two variables. */\ndiff --git a/lib/eal/include/rte_compat.h b/lib/eal/include/rte_compat.h\nindex fc9fbaa..6a4b5ee 100644\n--- a/lib/eal/include/rte_compat.h\n+++ b/lib/eal/include/rte_compat.h\n@@ -12,14 +12,22 @@\n \n #ifndef ALLOW_EXPERIMENTAL_API\n \n+#ifndef RTE_TOOLCHAIN_MSVC\n #define __rte_experimental \\\n __attribute__((deprecated(\"Symbol is not yet part of stable ABI\"), \\\n section(\".text.experimental\")))\n+#else\n+#define __rte_experimental\n+#endif\n \n #else\n \n+#ifndef RTE_TOOLCHAIN_MSVC\n #define __rte_experimental \\\n __attribute__((section(\".text.experimental\")))\n+#else\n+#define __rte_experimental\n+#endif\n \n #endif\n \n@@ -30,23 +38,35 @@\n \n #if !defined ALLOW_INTERNAL_API && __has_attribute(error) /* For GCC */\n \n+#ifndef RTE_TOOLCHAIN_MSVC\n #define __rte_internal \\\n __attribute__((error(\"Symbol is not public ABI\"), \\\n section(\".text.internal\")))\n+#else\n+#define __rte_internal\n+#endif\n \n #elif !defined ALLOW_INTERNAL_API && __has_attribute(diagnose_if) /* For clang */\n \n+#ifndef RTE_TOOLCHAIN_MSVC\n #define __rte_internal \\\n _Pragma(\"GCC diagnostic push\") \\\n _Pragma(\"GCC diagnostic ignored \\\"-Wgcc-compat\\\"\") \\\n __attribute__((diagnose_if(1, \"Symbol is not public ABI\", \"error\"), \\\n section(\".text.internal\"))) \\\n _Pragma(\"GCC diagnostic pop\")\n+#else\n+#define __rte_internal\n+#endif\n \n #else\n \n+#ifndef RTE_TOOLCHAIN_MSVC\n #define __rte_internal \\\n __attribute__((section(\".text.internal\")))\n+#else\n+#define __rte_internal\n+#endif\n \n #endif\n \n",
    "prefixes": [
        "v6",
        "11/15"
    ]
}