From 8a0b494c2e8030ec7f74fee2f5e5029649a5ab6a Mon Sep 17 00:00:00 2001 From: Svyatoslav Scherbina Date: Tue, 25 Apr 2017 15:44:22 +0300 Subject: [PATCH] Apply interop filtering Also actualize .def files --- backend.native/llvm.def | 2 ++ backend.native/tests/build.gradle | 9 +++------ backend.native/tests/interop/basics/cstdio.def | 3 +-- backend.native/tests/interop/basics/sockets.def | 5 ----- samples/concurrent/MessageChannel.def | 1 + samples/csvparser/stdio.def | 3 +-- samples/gitchurn/libgit2.def | 4 ++-- samples/gtk/gtk3.def | 1 + samples/libcurl/libcurl.def | 2 +- samples/opengl/opengl.def | 5 ++--- samples/socket/sockets.def | 7 ++----- samples/tetris/sdl.def | 10 +++------- 12 files changed, 19 insertions(+), 33 deletions(-) delete mode 100644 backend.native/tests/interop/basics/sockets.def diff --git a/backend.native/llvm.def b/backend.native/llvm.def index fddac298595..3ce24e439c0 100644 --- a/backend.native/llvm.def +++ b/backend.native/llvm.def @@ -1,6 +1,8 @@ headers = llvm-c/Core.h llvm-c/ExecutionEngine.h llvm-c/Target.h llvm-c/Analysis.h llvm-c/BitWriter.h \ llvm-c/BitReader.h llvm-c/Linker.h DebugInfoC.h +headerFilter = llvm-c/* DebugInfoC.h + compilerOpts = -std=c99 -fPIC \ -Wall -W -Wno-unused-parameter -Wwrite-strings -Wmissing-field-initializers \ -pedantic -Wno-long-long -Wcovered-switch-default -Wdelete-non-virtual-dtor \ diff --git a/backend.native/tests/build.gradle b/backend.native/tests/build.gradle index f95d6b6a647..96d561ca356 100644 --- a/backend.native/tests/build.gradle +++ b/backend.native/tests/build.gradle @@ -1633,21 +1633,18 @@ kotlinNativeInterop { cstdio { defFile 'interop/basics/cstdio.def' flavor 'native' - compilerOpts '-D_POSIX_SOURCE' // Exclude Darwin extensions causing link errors. } sockets { - defFile 'interop/basics/sockets.def' + defFile '../../samples/socket/sockets.def' flavor 'native' } if (isMac()) { opengl { - flavor 'native' - compilerOpts '-framework', 'OpenGL', '-framework', 'GLUT' + defFile '../../samples/opengl/opengl.def' linkerOpts '-framework', 'OpenGL', '-framework', 'GLUT' - pkg 'opengl' - headers 'GLUT/glut.h' + flavor 'native' } } } diff --git a/backend.native/tests/interop/basics/cstdio.def b/backend.native/tests/interop/basics/cstdio.def index 9ccc3551c0b..2f87d579b27 100644 --- a/backend.native/tests/interop/basics/cstdio.def +++ b/backend.native/tests/interop/basics/cstdio.def @@ -1,2 +1 @@ -headers = stdio.h -excludedFunctions = _IO_flockfile _IO_funlockfile _IO_ftrylockfile _IO_cleanup_region_start _IO_cleanup_region_end \ No newline at end of file +headers = stdio.h \ No newline at end of file diff --git a/backend.native/tests/interop/basics/sockets.def b/backend.native/tests/interop/basics/sockets.def deleted file mode 100644 index 366dc8e02fe..00000000000 --- a/backend.native/tests/interop/basics/sockets.def +++ /dev/null @@ -1,5 +0,0 @@ -headers = sys/socket.h netdb.h stdio.h string.h unistd.h stdlib.h arpa/inet.h -excludedFunctions = _IO_flockfile _IO_funlockfile _IO_ftrylockfile _IO_cleanup_region_start _IO_cleanup_region_end \ - mkstemp_dprotected_np - -compilerOpts = -D_POSIX_SOURCE \ No newline at end of file diff --git a/samples/concurrent/MessageChannel.def b/samples/concurrent/MessageChannel.def index c9cff668ab0..9dc3d676dda 100644 --- a/samples/concurrent/MessageChannel.def +++ b/samples/concurrent/MessageChannel.def @@ -1 +1,2 @@ headers = MessageChannel.h +headerFilter = MessageChannel.h diff --git a/samples/csvparser/stdio.def b/samples/csvparser/stdio.def index dff176612d1..9ab64a05ed5 100644 --- a/samples/csvparser/stdio.def +++ b/samples/csvparser/stdio.def @@ -1,3 +1,2 @@ headers = stdio.h stdlib.h string.h -compilerOpts = -D_POSIX_SOURCE -excludedFunctions = +excludeDependentModules.osx = true diff --git a/samples/gitchurn/libgit2.def b/samples/gitchurn/libgit2.def index 10169da99ee..24d1edc187c 100644 --- a/samples/gitchurn/libgit2.def +++ b/samples/gitchurn/libgit2.def @@ -1,3 +1,3 @@ -headers = git2.h +headers = git2.h time.h linkerOpts = -lgit2 -excludedFunctions = +headerFilter = git2/** time.h diff --git a/samples/gtk/gtk3.def b/samples/gtk/gtk3.def index 8bacdcabddd..b2fcf9ffc51 100644 --- a/samples/gtk/gtk3.def +++ b/samples/gtk/gtk3.def @@ -1 +1,2 @@ headers = gtk/gtk.h +headerFilter = gtk/* gobject/* gio/* diff --git a/samples/libcurl/libcurl.def b/samples/libcurl/libcurl.def index 3913c5c32a2..3aac5c17df2 100755 --- a/samples/libcurl/libcurl.def +++ b/samples/libcurl/libcurl.def @@ -1,2 +1,2 @@ headers = curl/curl.h -excludedFunctions = zopen pfctlinput +headerFilter = curl/* diff --git a/samples/opengl/opengl.def b/samples/opengl/opengl.def index 74370d1adeb..be7d4b77b21 100644 --- a/samples/opengl/opengl.def +++ b/samples/opengl/opengl.def @@ -1,6 +1,5 @@ -headers = -headers.osx = GLUT/glut.h +headers.osx = OpenGL/gl.h OpenGL/glu.h GLUT/glut.h headers.linux = GL/glut.h -compilerOpts = compilerOpts.osx = -framework OpenGL -framework GLUT compilerOpts.linux = -I/usr/include +excludeDependentModules.osx = true diff --git a/samples/socket/sockets.def b/samples/socket/sockets.def index 58f6641c85d..c6e28130bb0 100644 --- a/samples/socket/sockets.def +++ b/samples/socket/sockets.def @@ -1,5 +1,2 @@ -headers = sys/socket.h netdb.h stdio.h string.h unistd.h stdlib.h arpa/inet.h -excludedFunctions = _IO_flockfile _IO_funlockfile _IO_ftrylockfile _IO_cleanup_region_start _IO_cleanup_region_end \ - mkstemp_dprotected_np - -compilerOpts = -D_POSIX_SOURCE +headers = sys/socket.h netdb.h stdio.h string.h unistd.h stdlib.h netinet/in.h +excludeDependentModules.osx = true diff --git a/samples/tetris/sdl.def b/samples/tetris/sdl.def index 3d65e4d5638..10463bab759 100644 --- a/samples/tetris/sdl.def +++ b/samples/tetris/sdl.def @@ -1,12 +1,8 @@ -headers = SDL.h stdio.h string.h unistd.h stdlib.h time.h -excludedFunctions = _IO_flockfile _IO_funlockfile _IO_ftrylockfile \ - _IO_cleanup_region_start _IO_cleanup_region_end \ - _mm_stream_si32 _mm_stream_si64 \ - _cvtsh_ss __frexp __modf __nan __remquo __frexpf __modff __nanf __remquof \ - __inf __inff \ - SDL_PointInRect SDL_RectEmpty SDL_RectEquals +headers = SDL.h stdlib.h time.h entryPoint = SDL_main +headerFilter = SDL* stdlib.h time.h + compilerOpts = -D_POSIX_SOURCE compilerOpts.osx = compilerOpts.linux = -D_REENTRANT