mcpp index

compat.concurrentqueue

#include

moodycamel::ConcurrentQueue — lock-free MPMC queue (header-only)

#include <c_api/concurrentqueue.h>
mcpp add compat.concurrentqueue@1.0.5

用法

来自本仓库自己的测试项目 —— CI 真的编译并运行过,不是为了网站写的。

// compat.concurrentqueue `c-api` feature — drive the flat extern "C" surface
// over both queues. Values cross the boundary as void*, so the test round-trips
// integers through MoodycamelValue and checks them on the way out. A package
// that compiled the wrappers against the wrong queue type (cq vs bcq handles
// are both void*) would still link and swap semantics — which is exactly the
// failure these assertions catch.
#include <c_api/concurrentqueue.h>

#include <cstdio>
#include <stdint.h>

int main() {
    bool ok = true;
    auto check = [&](bool cond, const char* what) {
        if (!cond) {
            std::printf("FAIL: %s\n", what);
            ok = false;
        }
    };

    // ---- plain queue -------------------------------------------------------
    {
// …

tests/examples/concurrentqueue-c-api/tests/c_api.cpp · 项目 tests/examples/concurrentqueue-c-api

构建

targets
concurrentqueue (lib)
language
c++23
C standard
c11
import std
no
include dirs
*

特性

特性声明了
c-apisources, defines

源文件 (1)

  • mcpp_generated/concurrentqueue_anchor.c

生成的文件

  • mcpp_generated/concurrentqueue_anchor.c

版本

版本平台 镜像sha256
1.0.5 最新 LinuxWindowsmacOS 源站 4d6368a27492…