[libc-commits] [PATCH] D77626: [libc] Add very basic stdio FILE and fwrite

Fangrui Song via Phabricator via libc-commits libc-commits at lists.llvm.org
Mon Apr 13 09:07:04 PDT 2020


MaskRay added inline comments.


================
Comment at: libc/config/linux/api.td:23
+  let Decl = [{
+    typedef void FILE;
+  }];
----------------
You can just use the real underlying type `typedef struct _IO_FILE FILE;`

It is not required to be complete.


================
Comment at: libc/src/stdio/FILE.h:20
+
+struct FILE {
+  mtx_t lock;
----------------
`FILE` needs to be a typedef to a struct.


================
Comment at: libc/src/stdio/FILE.h:24
+  void *cookie;
+  cookie_write_function_t *write;
+};
----------------
fopencookie is a use case. The type does not need to mention `cookie_*`.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D77626/new/

https://reviews.llvm.org/D77626





More information about the libc-commits mailing list