]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
src/include: move ceph_to_hostos_errno() to separate header file
authorRishabh Dave <ridave@redhat.com>
Wed, 20 Aug 2025 07:41:04 +0000 (13:11 +0530)
committerRishabh Dave <ridave@redhat.com>
Fri, 3 Oct 2025 14:24:47 +0000 (19:54 +0530)
Including src/include/types.h in src/pybind/cephfs/types.pxd leads to
compilation error: "fatal error: acconfig.h: No such file or directory".
types.h as well as int_types.h include acconfig.h header file.

Move the code to be included in types.pxd to a separate file where
acconfig.h won't be included, thus preventing this error.

Signed-off-by: Rishabh Dave <ridave@redhat.com>
src/include/platform_errno.h [new file with mode: 0644]
src/include/types.h

diff --git a/src/include/platform_errno.h b/src/include/platform_errno.h
new file mode 100644 (file)
index 0000000..b54636b
--- /dev/null
@@ -0,0 +1,33 @@
+// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
+// vim: ts=8 sw=2 smarttab
+/*
+ * Ceph - scalable distributed file system
+ *
+ * Copyright (C) 2004-2006 Sage Weil <sage@newdream.net>
+ *
+ * This is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software
+ * Foundation.  See file COPYING.
+ *
+ */
+
+/* XXX: This definitions are placed here so that it's easy to import them into
+ * CephFS python bindings. Otherwise, entire src/include/types.h would needed to
+ * be imported, which is unneccessary and also complicated.
+ */
+
+#pragma once
+
+#if defined(__sun) || defined(_AIX) || defined(__APPLE__) || \
+    defined(__FreeBSD__) || defined(_WIN32)
+extern "C" {
+__s32  ceph_to_hostos_errno(__s32 e);
+__s32  hostos_to_ceph_errno(__s32 e);
+}
+#else
+#define  ceph_to_hostos_errno(e) (e)
+#define  hostos_to_ceph_errno(e) (e)
+#endif
+
+
index b52d5b27f696dbae3bac4c5756d3e2d34d3789f4..6a9fc5c21755848c4acc3c6de0e97998d6642381 100644 (file)
@@ -17,6 +17,7 @@
 // this is needed for ceph_fs to compile in userland
 #include "int_types.h"
 #include "byteorder.h"
+#include "platform_errno.h"
 
 #include "uuid.h"
 
@@ -518,17 +519,6 @@ struct shard_id_t {
 WRITE_CLASS_ENCODER(shard_id_t)
 std::ostream &operator<<(std::ostream &lhs, const shard_id_t &rhs);
 
-#if defined(__sun) || defined(_AIX) || defined(__APPLE__) || \
-    defined(__FreeBSD__) || defined(_WIN32)
-extern "C" {
-__s32  ceph_to_hostos_errno(__s32 e);
-__s32  hostos_to_ceph_errno(__s32 e);
-}
-#else
-#define  ceph_to_hostos_errno(e) (e)
-#define  hostos_to_ceph_errno(e) (e)
-#endif
-
 struct errorcode32_t {
   using code_t = __s32;
   code_t code;