i965: Add support for non-color render target write data to new FS backend.
[mesa.git] / src / mesa / drivers / dri / common / xmlconfig.c
index 46ba2ffbfedb64a1b7f7845fa347026c5dabc87c..0312c072437af37c77510c25b73b27bad4f81c3e 100644 (file)
 #include <unistd.h>
 #include <errno.h>
 #include "main/imports.h"
-#include "dri_util.h"
+#include "utils.h"
 #include "xmlconfig.h"
 
-/*
- * OS dependent ways of getting the name of the running program
- */
-#if (defined(__unix__) || defined(unix)) && !defined(USG)
-#include <sys/param.h>
-#endif
-
 #undef GET_PROGRAM_NAME
 
 #if (defined(__GNU_LIBRARY__) || defined(__GLIBC__)) && !defined(__UCLIBC__)
@@ -63,6 +56,9 @@ extern char *program_invocation_name, *program_invocation_short_name;
 #elif defined(__NetBSD__) && defined(__NetBSD_Version) && (__NetBSD_Version >= 106000100)
 #    include <stdlib.h>
 #    define GET_PROGRAM_NAME() getprogname()
+#elif defined(__APPLE__)
+#    include <stdlib.h>
+#    define GET_PROGRAM_NAME() getprogname()
 #elif defined(__sun)
 /* Solaris has getexecname() which returns the full path - return just
    the basename to match BSD getprogname() */
@@ -72,7 +68,7 @@ extern char *program_invocation_name, *program_invocation_short_name;
 #endif
 
 #if !defined(GET_PROGRAM_NAME)
-#    if defined(OpenBSD) || defined(NetBSD) || defined(__UCLIBC__)
+#    if defined(__OpenBSD__) || defined(NetBSD) || defined(__UCLIBC__)
 /* This is a hack. It's said to work on OpenBSD, NetBSD and GNU.
  * Rogelio M.Serrano Jr. reported it's also working with UCLIBC. It's
  * used as a last resort, if there is no documented facility available. */
@@ -213,7 +209,7 @@ static GLint strToI (const XML_Char *string, const XML_Char **tail, int base) {
  *
  * Works similar to strtod. Leading space is NOT skipped. The input
  * number may have an optional sign. '.' is interpreted as decimal
- * point and may occor at most once. Optionally the number may end in
+ * point and may occur at most once. Optionally the number may end in
  * [eE]<exponent>, where <exponent> is an integer as recognized by
  * strToI. In that case the result is number * 10^exponent. After
  * returning tail points to the first character that is not part of
@@ -735,7 +731,7 @@ static void parseDeviceAttr (struct OptConfData *data, const XML_Char **attr) {
     for (i = 0; attr[i]; i += 2) {
        if (!strcmp (attr[i], "driver")) driver = attr[i+1];
        else if (!strcmp (attr[i], "screen")) screen = attr[i+1];
-       else XML_WARNING("unkown device attribute: %s.", attr[i]);
+       else XML_WARNING("unknown device attribute: %s.", attr[i]);
     }
     if (driver && strcmp (driver, data->driverName))
        data->ignoringDevice = data->inDevice;
@@ -755,7 +751,7 @@ static void parseAppAttr (struct OptConfData *data, const XML_Char **attr) {
     for (i = 0; attr[i]; i += 2) {
        if (!strcmp (attr[i], "name")) name = attr[i+1];
        else if (!strcmp (attr[i], "executable")) exec = attr[i+1];
-       else XML_WARNING("unkown application attribute: %s.", attr[i]);
+       else XML_WARNING("unknown application attribute: %s.", attr[i]);
     }
     if (exec && strcmp (exec, data->execName))
        data->ignoringApp = data->inApp;
@@ -768,7 +764,7 @@ static void parseOptConfAttr (struct OptConfData *data, const XML_Char **attr) {
     for (i = 0; attr[i]; i += 2) {
        if (!strcmp (attr[i], "name")) name = attr[i+1];
        else if (!strcmp (attr[i], "value")) value = attr[i+1];
-       else XML_WARNING("unkown option attribute: %s.", attr[i]);
+       else XML_WARNING("unknown option attribute: %s.", attr[i]);
     }
     if (!name) XML_WARNING1 ("name attribute missing in option.");
     if (!value) XML_WARNING1 ("value attribute missing in option.");