File 1151-Fix-build-of-test-port-programs.patch of Package erlang

From 84b7d872072ff7d8b97de1e5666885028ca236dc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= <bjorn@erlang.org>
Date: Fri, 19 Feb 2021 05:32:03 +0100
Subject: [PATCH] Fix build of test port programs

In recent versions of Xcode, implicit declarations of library
functions result in a compilation error.
---
 erts/emulator/test/async_ports_SUITE_data/cport.c     | 5 ++++-
 erts/emulator/test/erl_drv_thread_SUITE_data/rwlock.c | 1 +
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/erts/emulator/test/async_ports_SUITE_data/cport.c b/erts/emulator/test/async_ports_SUITE_data/cport.c
index 033aff382a..0870063e57 100644
--- a/erts/emulator/test/async_ports_SUITE_data/cport.c
+++ b/erts/emulator/test/async_ports_SUITE_data/cport.c
@@ -10,6 +10,9 @@
 #endif
 
 typedef unsigned char byte;
+int write_exact(byte *buf, int len);
+
+int read_exact(byte *buf, int len);
 
 int read_cmd(byte *buf)
 {
@@ -28,7 +31,7 @@ int write_cmd(byte *buf, int len)
   li[1] = (len >> 16) & 0xff;
   li[2] = (len >> 8)  & 0xff;
   li[3] = len  & 0xff;
-  write_exact(&li, 4);
+  write_exact(li, 4);
 
   return write_exact(buf, len);
 }
diff --git a/erts/emulator/test/erl_drv_thread_SUITE_data/rwlock.c b/erts/emulator/test/erl_drv_thread_SUITE_data/rwlock.c
index 98d0162b55..7a4fe98ab8 100644
--- a/erts/emulator/test/erl_drv_thread_SUITE_data/rwlock.c
+++ b/erts/emulator/test/erl_drv_thread_SUITE_data/rwlock.c
@@ -18,6 +18,7 @@
  */
 
 #include "testcase_driver.h"
+#include <stdio.h>
 
 #ifdef __WIN32__
 #include <windows.h>
-- 
2.26.2

openSUSE Build Service is sponsored by