summaryrefslogtreecommitdiff
path: root/graphics/openimageio/patches
diff options
context:
space:
mode:
authorrichard <richard>2016-02-17 21:54:09 +0000
committerrichard <richard>2016-02-17 21:54:09 +0000
commite682fa3bb8504b9a5666f5ac6210f3d8dd136e76 (patch)
treed425b595895e03ea94688817444110219d15a884 /graphics/openimageio/patches
parent9435b84a66a900584bd59db6f64e300343c40d88 (diff)
downloadpkgsrc-e682fa3bb8504b9a5666f5ac6210f3d8dd136e76.tar.gz
SunOS needs alloca.h and some TLC in sysutils
Diffstat (limited to 'graphics/openimageio/patches')
-rw-r--r--graphics/openimageio/patches/patch-src_include_OpenImageIO_platform.h17
-rw-r--r--graphics/openimageio/patches/patch-src_libutil_sysutil.cpp27
2 files changed, 37 insertions, 7 deletions
diff --git a/graphics/openimageio/patches/patch-src_include_OpenImageIO_platform.h b/graphics/openimageio/patches/patch-src_include_OpenImageIO_platform.h
new file mode 100644
index 00000000000..e872d097196
--- /dev/null
+++ b/graphics/openimageio/patches/patch-src_include_OpenImageIO_platform.h
@@ -0,0 +1,17 @@
+$NetBSD: patch-src_include_OpenImageIO_platform.h,v 1.1 2016/02/17 21:54:09 richard Exp $
+
+SunOS needs <alloca.h> for alloca()
+
+--- src/include/OpenImageIO/platform.h.orig 2015-06-11 17:25:58.000000000 +0000
++++ src/include/OpenImageIO/platform.h
+@@ -91,7 +91,9 @@
+ #define OIIO_CPLUSPLUS11 1
+ #endif
+
+-
++#ifdef __sun
++#include <alloca.h>
++#endif
+
+ /// allocates memory, equivalent of C99 type var_name[size]
+ #define OIIO_ALLOCA(type, size) ((type*)alloca((size) * sizeof (type)))
diff --git a/graphics/openimageio/patches/patch-src_libutil_sysutil.cpp b/graphics/openimageio/patches/patch-src_libutil_sysutil.cpp
index c483ea4d895..4477f4798a6 100644
--- a/graphics/openimageio/patches/patch-src_libutil_sysutil.cpp
+++ b/graphics/openimageio/patches/patch-src_libutil_sysutil.cpp
@@ -1,8 +1,10 @@
-$NetBSD: patch-src_libutil_sysutil.cpp,v 1.2 2014/07/09 20:00:01 ryoon Exp $
+$NetBSD: patch-src_libutil_sysutil.cpp,v 1.3 2016/02/17 21:54:09 richard Exp $
---- src/libutil/sysutil.cpp.orig 2014-06-21 06:21:09.000000000 +0000
+updated for initial SunOS support
+
+--- src/libutil/sysutil.cpp.orig 2015-06-11 17:25:58.000000000 +0000
+++ src/libutil/sysutil.cpp
-@@ -70,6 +70,12 @@
+@@ -70,6 +70,17 @@
# include <sys/ioctl.h>
#endif
@@ -12,10 +14,15 @@ $NetBSD: patch-src_libutil_sysutil.cpp,v 1.2 2014/07/09 20:00:01 ryoon Exp $
+# include <sys/sysctl.h>
+#endif
+
++#ifdef __sun
++# include <unistd.h>
++# include <sys/ioctl.h>
++#endif
++
#include "OpenImageIO/dassert.h"
#include "OpenImageIO/sysutil.h"
-@@ -108,6 +114,12 @@ Sysutil::memory_used (bool resident)
+@@ -108,6 +119,12 @@ Sysutil::memory_used (bool resident)
return size;
#endif
@@ -28,7 +35,7 @@ $NetBSD: patch-src_libutil_sysutil.cpp,v 1.2 2014/07/09 20:00:01 ryoon Exp $
#elif defined(__APPLE__)
// Inspired by:
// http://miknight.blogspot.com/2005/11/resident-set-size-in-mac-os-x.html
-@@ -192,7 +204,12 @@ Sysutil::physical_memory ()
+@@ -192,7 +209,12 @@ Sysutil::physical_memory ()
size_t length = sizeof(physical_memory);
sysctl (mib, 2, &physical_memory, &length, NULL, 0);
return physical_memory;
@@ -42,7 +49,7 @@ $NetBSD: patch-src_libutil_sysutil.cpp,v 1.2 2014/07/09 20:00:01 ryoon Exp $
#else
// No idea what platform this is
ASSERT (0 && "Need to implement Sysutil::physical_memory on this platform");
-@@ -244,6 +261,10 @@ Sysutil::this_program_path ()
+@@ -244,6 +266,16 @@ Sysutil::this_program_path ()
size_t cb = sizeof(filename);
int r=1;
sysctl(mib, 4, filename, &cb, NULL, 0);
@@ -50,10 +57,16 @@ $NetBSD: patch-src_libutil_sysutil.cpp,v 1.2 2014/07/09 20:00:01 ryoon Exp $
+ unsigned int size = sizeof(filename);
+ int r = readlink ("/proc/curproc/exe", filename, size);
+ ASSERT(r < int(size)); // user won't get the right answer if the filename is too long to store
++#elif defined(__sun)
++ int r = 0;
++ if (realpath(getexecname(), filename) == NULL)
++ filename[0] = '\0';
++ else
++ r = strlen(filename);
#elif defined(__GNU__) || defined(__OpenBSD__)
int r = 0;
#else
-@@ -275,7 +296,7 @@ Sysutil::terminal_columns ()
+@@ -275,7 +307,7 @@ Sysutil::terminal_columns ()
{
int columns = 80; // a decent guess, if we have nothing more to go on