ProvSQL C/C++ API
Adding support for provenance and uncertainty management to PostgreSQL databases
Loading...
Searching...
No Matches
provsql_config.h
Go to the documentation of this file.
1/**
2 * @file provsql_config.h
3 * @brief Build-configuration switches shared across the C and C++ sources.
4 *
5 * @c PROVSQL_INPROCESS_STORE selects the single-process circuit store: the
6 * background worker, the shared-memory segment, the LWLock, and the
7 * inter-process pipes are replaced by an in-memory request/response FIFO
8 * and a synchronous in-process dispatch. It is the configuration used for
9 * the browser/WASM target (where there is exactly one PostgreSQL process
10 * and no background workers), and can also be forced on a native build for
11 * testing the in-process path:
12 *
13 * make CPPFLAGS=-DPROVSQL_INPROCESS_STORE
14 */
15#ifndef PROVSQL_CONFIG_H
16#define PROVSQL_CONFIG_H
17
18#if defined(__EMSCRIPTEN__) && !defined(PROVSQL_MULTIPROCESS)
19#define PROVSQL_INPROCESS_STORE 1
20#endif
21
22/*
23 * PROVSQL_NO_SUBPROCESS: no subprocesses (fork/exec) and no sockets are
24 * available in the WASM sandbox. Under it, the external knowledge-compiler
25 * CLIs, the KCMCP socket client, and the KCMCP supervisor worker are
26 * compiled out; probability falls back to the in-process tree-decomposition
27 * compiler and Monte Carlo. Tied to the platform (__EMSCRIPTEN__), not to
28 * PROVSQL_INPROCESS_STORE, so a native build -- even one forcing the
29 * in-process store for testing -- keeps the subprocess/socket paths and
30 * stays a faithful regression baseline; the guarded branches are exercised
31 * by the actual WASM build.
32 */
33#ifdef __EMSCRIPTEN__
34#define PROVSQL_NO_SUBPROCESS 1
35#endif
36
37#endif /* PROVSQL_CONFIG_H */