[libc-commits] [libc] [llvm] [libc] Make rpc_server.h independent from libc internals (PR #190423)

Matt Arsenault via libc-commits libc-commits at lists.llvm.org
Mon Apr 6 07:31:08 PDT 2026


================
@@ -9,15 +9,778 @@
 #ifndef LLVM_LIBC_SHARED_RPC_SERVER_H
 #define LLVM_LIBC_SHARED_RPC_SERVER_H
 
-#include "libc_common.h"
-#include "src/__support/RPC/rpc_server.h"
+#include "rpc.h"
+#include "rpc_opcodes.h"
 
-namespace LIBC_NAMESPACE_DECL {
-namespace shared {
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
 
-using LIBC_NAMESPACE::rpc::handle_libc_opcodes;
+#ifdef _WIN32
+#define flockfile _lock_file
+#define funlockfile _unlock_file
+#define fwrite_unlocked _fwrite_nolock
+#endif
 
-} // namespace shared
-} // namespace LIBC_NAMESPACE_DECL
+namespace rpc {
+
+// Minimal replacement for 'std::vector' that works for trivial types.
+template <typename T> class TempVector {
+  T *data_;
+  size_t current;
+  size_t capacity;
+
+public:
+  inline TempVector() : data_(nullptr), current(0), capacity(0) {}
----------------
arsenm wrote:

```suggestion
  T *data_ = nullptr;
  size_t current = 0;
  size_t capacity = 0;

public:
  TempVector() = default;
```

https://github.com/llvm/llvm-project/pull/190423


More information about the libc-commits mailing list