aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2014-07-01 14:23:00 +0200
committermarha <marha@users.sourceforge.net>2014-07-01 14:23:00 +0200
commit3095a03ec3cb1f05b49362327d10a767299d7635 (patch)
tree3c1c00424399de31f3be7d7a6e5f226b288d337e /mesalib/src/mesa
parentb6fac85cb1bb78f48ed81aaf42ba6b840b2d6cad (diff)
downloadvcxsrv-3095a03ec3cb1f05b49362327d10a767299d7635.tar.gz
vcxsrv-3095a03ec3cb1f05b49362327d10a767299d7635.tar.bz2
vcxsrv-3095a03ec3cb1f05b49362327d10a767299d7635.zip
Synchronised files and solved compilaton errors
Diffstat (limited to 'mesalib/src/mesa')
-rw-r--r--mesalib/src/mesa/drivers/dri/common/xmlconfig.c23
-rw-r--r--mesalib/src/mesa/drivers/dri/common/xmlconfig.h4
2 files changed, 25 insertions, 2 deletions
diff --git a/mesalib/src/mesa/drivers/dri/common/xmlconfig.c b/mesalib/src/mesa/drivers/dri/common/xmlconfig.c
index 2faaeba17..2639202c4 100644
--- a/mesalib/src/mesa/drivers/dri/common/xmlconfig.c
+++ b/mesalib/src/mesa/drivers/dri/common/xmlconfig.c
@@ -288,6 +288,29 @@ static float strToF (const XML_Char *string, const XML_Char **tail) {
return result;
}
+#if !defined(HAVE_STRNDUP)
+
+/* Emulates glibc's strndup() */
+char *
+strndup(const char *str, size_t size)
+{
+ size_t len;
+ char *result = (char *)NULL;
+
+ if ((char *)NULL == str) return (char *)NULL;
+
+ len = strlen(str);
+ if (!len) return strdup("");
+ if (size > len) size = len;
+
+ result = (char *)malloc((size + 1) * sizeof (char));
+ memcpy(result, str, size);
+ result[size] = 0x0;
+ return result;
+}
+
+#endif /* _WIN32 should be !HAVE_STRNDUP */
+
/** \brief Parse a value of a given type. */
static bool parseValue (driOptionValue *v, driOptionType type,
const XML_Char *string) {
diff --git a/mesalib/src/mesa/drivers/dri/common/xmlconfig.h b/mesalib/src/mesa/drivers/dri/common/xmlconfig.h
index 386ddf19d..9cb831571 100644
--- a/mesalib/src/mesa/drivers/dri/common/xmlconfig.h
+++ b/mesalib/src/mesa/drivers/dri/common/xmlconfig.h
@@ -60,7 +60,7 @@ typedef struct driOptionInfo {
char *name; /**< \brief Name */
driOptionType type; /**< \brief Type */
driOptionRange *ranges; /**< \brief Array of ranges */
- uint nRanges; /**< \brief Number of ranges */
+ unsigned int nRanges; /**< \brief Number of ranges */
} driOptionInfo;
/** \brief Option cache
@@ -78,7 +78,7 @@ typedef struct driOptionCache {
* \li Default values in screen
* \li Actual values in contexts
*/
- uint tableSize;
+ unsigned int tableSize;
/**< \brief Size of the arrays
*
* In the current implementation it's not actually a size but log2(size).