aboutsummaryrefslogtreecommitdiff
path: root/mesalib
diff options
context:
space:
mode:
Diffstat (limited to 'mesalib')
-rw-r--r--mesalib/configure.ac14
-rw-r--r--mesalib/src/glsl/glsl_types.cpp2
-rw-r--r--mesalib/src/mesa/drivers/dri/common/utils.c3
-rw-r--r--mesalib/src/mesa/main/hash_table.c3
-rw-r--r--mesalib/src/mesa/main/macros.h3
-rw-r--r--mesalib/src/mesa/main/set.c3
6 files changed, 18 insertions, 10 deletions
diff --git a/mesalib/configure.ac b/mesalib/configure.ac
index 6735fdcf0..d08bc2779 100644
--- a/mesalib/configure.ac
+++ b/mesalib/configure.ac
@@ -499,10 +499,16 @@ AC_CHECK_FUNC([dlopen], [DEFINES="$DEFINES -DHAVE_DLOPEN"],
[DEFINES="$DEFINES -DHAVE_DLOPEN"; DLOPEN_LIBS="-ldl"])])
AC_SUBST([DLOPEN_LIBS])
-AC_CHECK_FUNCS([clock_gettime], [CLOCK_LIB=],
- [AC_CHECK_LIB([rt], [clock_gettime], [CLOCK_LIB=-lrt],
- [AC_MSG_ERROR([Couldn't find clock_gettime])])])
-AC_SUBST([CLOCK_LIB])
+case "$host_os" in
+darwin*)
+ ;;
+*)
+ AC_CHECK_FUNCS([clock_gettime], [CLOCK_LIB=],
+ [AC_CHECK_LIB([rt], [clock_gettime], [CLOCK_LIB=-lrt],
+ [AC_MSG_ERROR([Couldn't find clock_gettime])])])
+ AC_SUBST([CLOCK_LIB])
+ ;;
+esac
dnl See if posix_memalign is available
AC_CHECK_FUNC([posix_memalign], [DEFINES="$DEFINES -DHAVE_POSIX_MEMALIGN"])
diff --git a/mesalib/src/glsl/glsl_types.cpp b/mesalib/src/glsl/glsl_types.cpp
index 4a2c87907..3b066d099 100644
--- a/mesalib/src/glsl/glsl_types.cpp
+++ b/mesalib/src/glsl/glsl_types.cpp
@@ -81,6 +81,7 @@ glsl_type::glsl_type(GLenum gl_type,
glsl_type::glsl_type(const glsl_struct_field *fields, unsigned num_fields,
const char *name) :
+ gl_type(0),
base_type(GLSL_TYPE_STRUCT),
sampler_dimensionality(0), sampler_shadow(0), sampler_array(0),
sampler_type(0), interface_packing(0),
@@ -103,6 +104,7 @@ glsl_type::glsl_type(const glsl_struct_field *fields, unsigned num_fields,
glsl_type::glsl_type(const glsl_struct_field *fields, unsigned num_fields,
enum glsl_interface_packing packing, const char *name) :
+ gl_type(0),
base_type(GLSL_TYPE_INTERFACE),
sampler_dimensionality(0), sampler_shadow(0), sampler_array(0),
sampler_type(0), interface_packing((unsigned) packing),
diff --git a/mesalib/src/mesa/drivers/dri/common/utils.c b/mesalib/src/mesa/drivers/dri/common/utils.c
index 062712bf3..ac0773b0d 100644
--- a/mesalib/src/mesa/drivers/dri/common/utils.c
+++ b/mesalib/src/mesa/drivers/dri/common/utils.c
@@ -32,6 +32,7 @@
#include <string.h>
#include <stdlib.h>
#include <stdbool.h>
+#include "main/macros.h"
#include "main/mtypes.h"
#include "main/cpuinfo.h"
#include "main/extensions.h"
@@ -391,8 +392,6 @@ static const struct { unsigned int attrib, offset; } attribMap[] = {
__ATTRIB(__DRI_ATTRIB_SWAP_METHOD, level)
};
-#define ARRAY_SIZE(a) (sizeof (a) / sizeof ((a)[0]))
-
/**
* Return the value of a configuration attribute. The attribute is
diff --git a/mesalib/src/mesa/main/hash_table.c b/mesalib/src/mesa/main/hash_table.c
index 2bd1929aa..af0510da1 100644
--- a/mesalib/src/mesa/main/hash_table.c
+++ b/mesalib/src/mesa/main/hash_table.c
@@ -44,10 +44,9 @@
#include <string.h>
#include "main/hash_table.h"
+#include "main/macros.h"
#include "ralloc.h"
-#define ARRAY_SIZE(array) (sizeof(array) / sizeof(array[0]))
-
static const uint32_t deleted_key_value;
/**
diff --git a/mesalib/src/mesa/main/macros.h b/mesalib/src/mesa/main/macros.h
index d1e81fe08..f6d38fb64 100644
--- a/mesalib/src/mesa/main/macros.h
+++ b/mesalib/src/mesa/main/macros.h
@@ -766,5 +766,8 @@ DIFFERENT_SIGNS(GLfloat x, GLfloat y)
#define ENUM_TO_DOUBLE(E) ((GLdouble)(GLint)(E))
#define ENUM_TO_BOOLEAN(E) ((E) ? GL_TRUE : GL_FALSE)
+/* Compute the size of an array */
+#define ARRAY_SIZE(x) (sizeof(x) / sizeof(x[0]))
+
#endif
diff --git a/mesalib/src/mesa/main/set.c b/mesalib/src/mesa/main/set.c
index 736841fc9..2519b9694 100644
--- a/mesalib/src/mesa/main/set.c
+++ b/mesalib/src/mesa/main/set.c
@@ -34,11 +34,10 @@
#include <stdlib.h>
+#include "macros.h"
#include "set.h"
#include "ralloc.h"
-#define ARRAY_SIZE(array) (sizeof(array) / sizeof(array[0]))
-
/*
* From Knuth -- a good choice for hash/rehash values is p, p-2 where
* p and p-2 are both prime. These tables are sized to have an extra 10%