[libc-commits] [libc] [libc] Implement fgetpos/fsetpos (PR #221349)

Jeff Bailey via libc-commits libc-commits at lists.llvm.org
Fri Oct 9 04:04:03 PDT 2026


================
@@ -7,19 +7,19 @@
 //===----------------------------------------------------------------------===//
 ///
 /// \file
-/// Implementation header for nice.
+/// Definition of fpos_t type.
 ///
 //===----------------------------------------------------------------------===//
 
-#ifndef LLVM_LIBC_SRC_UNISTD_NICE_H
-#define LLVM_LIBC_SRC_UNISTD_NICE_H
+#ifndef LLVM_LIBC_TYPES_FPOS_T_H
+#define LLVM_LIBC_TYPES_FPOS_T_H
 
-#include "src/__support/macros/config.h"
+#include "mbstate_t.h"
+#include "off_t.h"
 
-namespace LIBC_NAMESPACE_DECL {
+typedef struct {
+  off_t pos;
----------------
kaladron wrote:

You had this as __pos and __state in one of your commits, and I think that's still the right thing to do.  If someone expects to use "state" or "pos" in their code and #defines's the names to something else, there could be a conflict.  It's not likely, but we're protected in that case (and I think this is what's encouraged by section 7.1.3 of the C standard)

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


More information about the libc-commits mailing list