Skip to content

Commit

Permalink
Fix builds for systems presets
Browse files Browse the repository at this point in the history
  • Loading branch information
saudet committed Nov 19, 2024
1 parent 118b5ff commit 302aa9d
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 76 deletions.
12 changes: 0 additions & 12 deletions systems/src/gen/java/org/bytedeco/systems/global/macosx.java
Original file line number Diff line number Diff line change
Expand Up @@ -3483,7 +3483,6 @@ public static native int setitimer(int arg0, @Const itimerval arg1,


// #else /* !__DARWIN_64_BIT_INO_T */
// Targeting ../macosx/stat64.java



Expand Down Expand Up @@ -3703,17 +3702,6 @@ public static native int utimensat(int __fd, String __path, @Const timespec __ti
public static native int umaskx_np(_filesec arg0);

// #if !__DARWIN_ONLY_64_BIT_INO_T
/* The following deprecated routines are simillar to stat and friends except provide struct stat64 instead of struct stat */
public static native int fstatx64_np(int arg0, stat64 arg1, _filesec arg2);
public static native int lstatx64_np(@Cast("const char*") BytePointer arg0, stat64 arg1, _filesec arg2);
public static native int lstatx64_np(String arg0, stat64 arg1, _filesec arg2);
public static native int statx64_np(@Cast("const char*") BytePointer arg0, stat64 arg1, _filesec arg2);
public static native int statx64_np(String arg0, stat64 arg1, _filesec arg2);
public static native int fstat64(int arg0, stat64 arg1);
public static native int lstat64(@Cast("const char*") BytePointer arg0, stat64 arg1);
public static native int lstat64(String arg0, stat64 arg1);
public static native int stat64(@Cast("const char*") BytePointer arg0, stat64 arg1);
public static native int stat64(String arg0, stat64 arg1);
// #endif /* !__DARWIN_ONLY_64_BIT_INO_T */
// #endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */

Expand Down
57 changes: 0 additions & 57 deletions systems/src/gen/java/org/bytedeco/systems/macosx/stat64.java

This file was deleted.

22 changes: 15 additions & 7 deletions systems/src/main/java/org/bytedeco/systems/presets/macosx.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,16 @@
* @author Samuel Audet
*/
@Properties(inherit = javacpp.class, value = {@Platform(value = "macosx", define = "__STDC_WANT_LIB_EXT1__ 1",
include = {"cpuid.h", "dlfcn.h", "nl_types.h", "_xlocale.h", "xlocale.h", "_locale.h", "langinfo.h", "locale.h",
include = {"dlfcn.h", "nl_types.h", "__xlocale.h", "_xlocale.h", "xlocale.h", "_locale.h", "langinfo.h", "locale.h",
"sys/uio.h", "sys/_types/_iovec_t.h", "sys/socket.h", "sys/errno.h", "string.h", "stdlib.h", /*"sys/types.h",*/
"sys/_types/_timespec.h", "sys/_types/_timeval.h", "sys/time.h", "time.h", "utime.h",
"sys/_types/_s_ifmt.h", "sys/_types/_filesec_t.h", "sys/stat.h", "fcntl.h", "sys/file.h", "grp.h", "pwd.h",
"sys/_types/_sigaltstack.h", "sys/signal.h", "signal.h", /*"sys/_types/_ucontext.h", "sys/ucontext.h", "ucontext.h",*/
"sched.h", "mach/machine.h", "spawn.h", "sys/_types/_seek_set.h", "sys/unistd.h", "unistd.h",
"sys/poll.h", "sys/reboot.h", "sys/resource.h", "sys/sysctl.h", "sys/wait.h",
"sys/_types/_uid_t.h", "sys/_types/_gid_t.h", "sys/_types/_mode_t.h", "sys/_types/_key_t.h", "sys/ipc.h",
"sys/_types/_pid_t.h", "sys/_types/_time_t.h", "sys/_types/_size_t.h", "sys/shm.h"})},
"sys/_types/_pid_t.h", "sys/_types/_time_t.h", "sys/_types/_size_t.h", "sys/shm.h"},
exclude = {"__xlocale.h"})},
target = "org.bytedeco.systems.macosx", global = "org.bytedeco.systems.global.macosx")
@NoException
public class macosx implements LoadEnabled, BuildEnabled, InfoMapper {
Expand All @@ -70,11 +71,17 @@ public void init(Logger logger, java.util.Properties properties, String encoding

@Override
public void init(ClassProperties properties) {
String platform = properties.getProperty("platform");
List<String> includePaths = properties.get("platform.includepath");
List<String> includes = properties.get("platform.include");
if (platform.startsWith("macosx-x86")) {
includes.add(0, "cpuid.h");
}
if (Loader.getCallerClass(4).getName().equals("org.bytedeco.javacpp.tools.Parser")) {
List<String> includepath = properties.get("platform.includepath");
includepath.add("/usr/include/");
includepath.add("/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/");
includepath.add("/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/");
includePaths.add("/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/");
includePaths.add("/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/");
includePaths.add("/usr/include/");
}
}

Expand All @@ -85,13 +92,14 @@ public void map(InfoMap infoMap) {

.put(new Info("__BEGIN_DECLS").cppText("#define __BEGIN_DECLS"))
.put(new Info("__END_DECLS").cppText("#define __END_DECLS"))
.put(new Info("__sized_by").cppText("#define __sized_by(N)"))

.put(new Info("__LP64__", "__x86_64__").define(is64bits))

.put(new Info("!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)",
"__APPLE__", "__DARWIN_UNIX03").define(true))

.put(new Info("__BLOCKS__", "!__DARWIN_UNIX03",
.put(new Info("__BLOCKS__", "!__DARWIN_UNIX03", "!__DARWIN_ONLY_64_BIT_INO_T",
"__DARWIN_C_LEVEL < __DARWIN_C_FULL").define(false))

.put(new Info("__deprecated").annotations("@Deprecated").cppTypes())
Expand Down Expand Up @@ -137,7 +145,7 @@ public void map(InfoMap infoMap) {
.put(new Info("locale_t").valueTypes("_xlocale"))
.put(new Info("filesec_t").valueTypes("_filesec"))
.put(new Info("struct stat").pointerTypes("stat"))
.put(new Info("struct stat64").pointerTypes("stat64"))
.put(new Info("struct stat64").pointerTypes("stat64").skip())
.put(new Info("struct timezone").pointerTypes("timezone"))
.put(new Info("struct sigaction").pointerTypes("sigaction"))
.put(new Info("struct sigvec").pointerTypes("sigvec"))
Expand Down

0 comments on commit 302aa9d

Please sign in to comment.