Skip to content

seed-os.c: include util.h for openpty() on macOS

Christopher Chavez requested to merge (removed):patch-1 into master

On macOS, openpty() is defined in util.h, which needs to be included to avoid an implicit function declaration warning (which is now considered an error in Xcode 12):

libtool: compile:  /usr/bin/clang -arch x86_64 -DHAVE_CONFIG_H -I. -I../.. -I/opt/local/include -DBUILDING_GTK__ -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk -I../../libseed/ -D_REENTRANT -I/opt/local/include/gobject-introspection-1.0 -I/opt/local/include/glib-2.0 -I/opt/local/lib/glib-2.0/include -DG_DISABLE_ASSERT -DG_DISABLE_CHECKS -DG_DISABLE_CAST_CHECKS -pipe -Os -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk -arch x86_64 -Wall -MT libseed_os_la-seed-os.lo -MD -MP -MF .deps/libseed_os_la-seed-os.Tpo -c seed-os.c  -fno-common -DPIC -o .libs/libseed_os_la-seed-os.o
seed-os.c:813:5: error: implicit declaration of function 'openpty' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
    openpty(&master, &slave, NULL, NULL, NULL);
    ^
seed-os.c:813:5: note: did you mean 'openat'?
/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/sys/fcntl.h:532:9: note: 'openat' declared here
int     openat(int, const char *, int, ...) __DARWIN_NOCANCEL(openat) __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_8_0);
        ^
1 error generated.

Merge request reports