aboutsummaryrefslogtreecommitdiffstats
path: root/src/sysstdio.h
diff options
context:
space:
mode:
authorPaul Eggert2023-08-07 21:23:28 -0700
committerPaul Eggert2023-08-07 21:26:36 -0700
commit85b6c150c8a356ebf3442fde2836364954aa938c (patch)
tree0ea86860bb95571114c9a14a45a77b34f123bac6 /src/sysstdio.h
parenta579739e2b3f3c7218b14a7e41b78e7ddbded06c (diff)
downloademacs-85b6c150c8a356ebf3442fde2836364954aa938c.tar.gz
emacs-85b6c150c8a356ebf3442fde2836364954aa938c.zip
Fix some emacs_fopen confusion
Problem reported by Po Lu in: https://lists.gnu.org/r/emacs-devel/2023-08/msg00195.html * src/comp.c (comp_hash_source_file, Fcomp__release_ctxt): * src/sysdep.c (get_up_time, procfs_ttyname, procfs_get_total_memory): Be more systematic about using emacs_fclose on streams that were opened with emacs_fopen or emacs_fdopen. Do this even if not Android, as this simplifies checking that it's done consistently. * src/lisp.h (emacs_fclose): If it’s just fclose, make it a macro rather than a function, to avoid confusing gcc -Wmismatched-dealloc. (emacs_fopen): Move decl here from sysstdio.h, because sysstdio.h is included from non-Emacs executables and emacs_fopen is good only inside Emacs. * src/sysdep.c (emacs_fclose): Define as a function only if Android.
Diffstat (limited to 'src/sysstdio.h')
-rw-r--r--src/sysstdio.h2
1 files changed, 0 insertions, 2 deletions
diff --git a/src/sysstdio.h b/src/sysstdio.h
index 5a973c833cc..8e9e5bec86c 100644
--- a/src/sysstdio.h
+++ b/src/sysstdio.h
@@ -28,8 +28,6 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */
28#include <attribute.h> 28#include <attribute.h>
29#include <unlocked-io.h> 29#include <unlocked-io.h>
30 30
31extern FILE *emacs_fopen (char const *, char const *)
32 ATTRIBUTE_MALLOC ATTRIBUTE_DEALLOC (fclose, 1);
33extern void errputc (int); 31extern void errputc (int);
34extern void errwrite (void const *, ptrdiff_t); 32extern void errwrite (void const *, ptrdiff_t);
35extern void close_output_streams (void); 33extern void close_output_streams (void);