[MacPorts] #53314: lirc @0.9.4c_1 build fails on older systems due to redefinition of scandir() in 10.8+

MacPorts noreply at macports.org
Sat Jan 14 20:26:31 UTC 2017


#53314: lirc @0.9.4c_1 build fails on older systems due to redefinition of
scandir() in 10.8+
--------------------+------------------
 Reporter:  kencu   |      Owner:
     Type:  defect  |     Status:  new
 Priority:  Normal  |  Milestone:
Component:  ports   |    Version:
 Keywords:          |       Port:  lirc
--------------------+------------------
 On Snow Leopard, build fails when compiling
 {{{
 lirc-0.9.4c/tools/lirc-lsremotes.cpp
 }}}
 error is
 {{{

 /opt/local/bin/clang++-mp-3.8 -DHAVE_CONFIG_H -I. -I..  -I../lib -I..
 -I/opt/local/include -DDARWIN -g -Wall -Wp,-D_FORTIFY_SOURCE=2
 -I/opt/local/include  -pipe -Os -arch x86_64 -stdlib=libc++ -MT lirc-
 lsremotes.o -MD -MP -MF .deps/lirc-lsremotes.Tpo -c -o lirc-lsremotes.o
 lirc-lsremotes.cpp
 lirc-lsremotes.cpp:213:9: error: no matching function for call to
 'scandir'
         size = scandir(dirpath, &namelist, isfile, alphasort);
                ^~~~~~~
 /usr/include/dirent.h:128:5: note: candidate function not viable: no known
 conversion from 'int (const struct dirent *)' to 'int (*)(struct dirent
 *)' for 3rd argument
 int scandir(const char *, struct dirent ***,
     ^
 lirc-lsremotes.cpp:237:9: error: no matching function for call to
 'scandir'
         size = scandir(dirpath, &namelist, isdir, alphasort);
                ^~~~~~~
 /usr/include/dirent.h:128:5: note: candidate function not viable: no known
 conversion from 'int (const struct dirent *)' to 'int (*)(struct dirent
 *)' for 3rd argument
 int scandir(const char *, struct dirent ***,
 }}}
 Searching reveals similar issues with scandir have been noted in other
 projects <https://github.com/Homebrew/legacy-homebrew/issues/13649>.


 It appears the definition of scandir, located in `/usr/include/dirent.h`,
 changed in Mountain Lion from this
 {{{
 #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
 int scandir(const char *, struct dirent ***,
     int (*)(struct dirent *), int (*)(const void *, const void *))
 __DARWIN_INODE64(scandir);
 #ifdef __BLOCKS__
 int scandir_b(const char *, struct dirent ***,
     int (^)(struct dirent *), int (^)(const void *, const void *))
 __DARWIN_INODE64(scandir_b);
 #endif /* __BLOCKS__ */
 #endif /* not POSIX */
 }}}
 to this
 {{{
 int scandir(const char *, struct dirent ***,
     int (*)(const struct dirent *), int (*)(const struct dirent **, const
 struct dirent **)) __DARWIN_INODE64(scandir);
 #ifdef __BLOCKS__
 int scandir_b(const char *, struct dirent ***,
     int (^)(const struct dirent *), int (^)(const struct dirent **, const
 struct dirent **)) __DARWIN_INODE64(scandir_b)
 __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_2);
 #endif /* __BLOCKS__ */
 }}}

 So I suspect this build would also fail on other systems <10.8 due to
 this.

--
Ticket URL: <https://trac.macports.org/ticket/53314>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list