From d4a227203487a2097339cf31e8be11f5f2718e4c Mon Sep 17 00:00:00 2001
From: barracuda156 <vital.had@gmail.com>
Date: Wed, 26 Jul 2023 14:57:24 +0800
Subject: [PATCH] Fix for undeclared flush


diff --git src/dynlibs/mgd/mgd.c src/dynlibs/mgd/mgd.c
index 0e9f4a8..95a54e1 100644
--- src/dynlibs/mgd/mgd.c
+++ src/dynlibs/mgd/mgd.c
@@ -123,7 +123,7 @@ EXTERNML value mgd_tostdoutpng(value im)
 {
   fprintf(stdout, "Content-type: image/png\n\n");   
   gdImagePng(Image_val(im), stdout);
-#ifdef WIN32
+#if defined(WIN32) || defined(__APPLE__)
   fflush(stdout);
 #else
   flush(stdout);
