Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates for OpenBSD build support #4257

Merged
merged 1 commit into from
Jun 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions ortools/base/sysinfo.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#if defined(__APPLE__) && defined(__GNUC__) // MacOS
#include <mach/mach_init.h>
#include <mach/task.h>
#elif defined(__FreeBSD__) // FreeBSD
#elif (defined(__FreeBSD__) || defined(__OpenBSD__)) // FreeBSD or OpenBSD
#include <sys/resource.h>
#include <sys/time.h>
// Windows
Expand Down Expand Up @@ -49,7 +49,8 @@ int64_t GetProcessMemoryUsage() {
return resident_memory;
}
#elif defined(__GNUC__) && !defined(__FreeBSD__) && \
!defined(__EMSCRIPTEN__) && !defined(_WIN32) // Linux
!defined(__OpenBSD__) && !defined(__EMSCRIPTEN__) && \
!defined(_WIN32) // Linux
int64_t GetProcessMemoryUsage() {
unsigned size = 0;
char buf[30];
Expand All @@ -61,7 +62,7 @@ int64_t GetProcessMemoryUsage() {
fclose(pf);
return int64_t{1024} * size;
}
#elif defined(__FreeBSD__) // FreeBSD
#elif (defined(__FreeBSD__) || defined(__OpenBSD__)) // FreeBSD or OpenBSD
int64_t GetProcessMemoryUsage() {
int who = RUSAGE_SELF;
struct rusage rusage;
Expand Down
1 change: 1 addition & 0 deletions ortools/python/setup.py.in
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ setup(
'Operating System :: Unix',
'Operating System :: POSIX :: Linux',
'Operating System :: POSIX :: BSD :: FreeBSD',
'Operating System :: POSIX :: BSD :: OpenBSD',
'Operating System :: MacOS',
'Operating System :: MacOS :: MacOS X',
'Operating System :: Microsoft :: Windows',
Expand Down
3 changes: 2 additions & 1 deletion ortools/util/zvector.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
#ifndef OR_TOOLS_UTIL_ZVECTOR_H_
#define OR_TOOLS_UTIL_ZVECTOR_H_

#if (defined(__APPLE__) || defined(__FreeBSD__)) && defined(__GNUC__)
#if (defined(__APPLE__) || defined(__FreeBSD__) || defined(__OpenBSD__)) && \
defined(__GNUC__)
#include <machine/endian.h>
#elif !defined(_MSC_VER) && !defined(__MINGW32__) && !defined(__MINGW64__)
#include <endian.h>
Expand Down
Loading