SDL_ScreenKeyboard compatibility for SDL2, updated mxml and jpeg libraries
This commit is contained in:
@@ -1,19 +1,17 @@
|
||||
/*
|
||||
* "$Id: mxml-string.c 387 2009-04-18 17:05:52Z mike $"
|
||||
* "$Id: mxml-string.c 424 2010-12-25 16:21:50Z mike $"
|
||||
*
|
||||
* String functions for Mini-XML, a small XML-like file parsing library.
|
||||
*
|
||||
* Copyright 2003-2009 by Michael Sweet.
|
||||
* Copyright 2003-2010 by Michael R Sweet.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2, or (at your option) any later version.
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Michael R Sweet and are protected by Federal copyright
|
||||
* law. Distribution and use rights are outlined in the file "COPYING"
|
||||
* which should have been included with this file. If this file is
|
||||
* missing or damaged, see the license at:
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
* http://www.minixml.org/
|
||||
*
|
||||
* Contents:
|
||||
*
|
||||
@@ -31,6 +29,20 @@
|
||||
#include "config.h"
|
||||
|
||||
|
||||
/*
|
||||
* The va_copy macro is part of C99, but many compilers don't implement it.
|
||||
* Provide a "direct assignment" implmentation when va_copy isn't defined...
|
||||
*/
|
||||
|
||||
#ifndef va_copy
|
||||
# ifdef __va_copy
|
||||
# define va_copy(dst,src) __va_copy(dst,src)
|
||||
# else
|
||||
# define va_copy(dst,src) memcpy(&dst, &src, sizeof(va_list))
|
||||
# endif /* __va_copy */
|
||||
#endif /* va_copy */
|
||||
|
||||
|
||||
#ifndef HAVE_SNPRINTF
|
||||
/*
|
||||
* '_mxml_snprintf()' - Format a string.
|
||||
@@ -60,7 +72,7 @@ _mxml_snprintf(char *buffer, /* I - Output buffer */
|
||||
*/
|
||||
|
||||
#ifndef HAVE_STRDUP
|
||||
char * /* O - New string pointer */
|
||||
char * /* O - New string pointer */
|
||||
_mxml_strdup(const char *s) /* I - String to duplicate */
|
||||
{
|
||||
char *t; /* New string pointer */
|
||||
@@ -420,9 +432,10 @@ char * /* O - New string pointer */
|
||||
_mxml_vstrdupf(const char *format, /* I - Printf-style format string */
|
||||
va_list ap) /* I - Pointer to additional arguments */
|
||||
{
|
||||
int bytes; /* Number of bytes required */
|
||||
char *buffer, /* String buffer */
|
||||
temp[256]; /* Small buffer for first vsnprintf */
|
||||
int bytes; /* Number of bytes required */
|
||||
char *buffer, /* String buffer */
|
||||
temp[256]; /* Small buffer for first vsnprintf */
|
||||
va_list apcopy; /* Copy of argument list */
|
||||
|
||||
|
||||
/*
|
||||
@@ -430,7 +443,8 @@ _mxml_vstrdupf(const char *format, /* I - Printf-style format string */
|
||||
* needed...
|
||||
*/
|
||||
|
||||
bytes = vsnprintf(temp, sizeof(temp), format, ap);
|
||||
va_copy(apcopy, ap);
|
||||
bytes = vsnprintf(temp, sizeof(temp), format, apcopy);
|
||||
|
||||
if (bytes < sizeof(temp))
|
||||
{
|
||||
@@ -458,5 +472,5 @@ _mxml_vstrdupf(const char *format, /* I - Printf-style format string */
|
||||
|
||||
|
||||
/*
|
||||
* End of "$Id: mxml-string.c 387 2009-04-18 17:05:52Z mike $".
|
||||
* End of "$Id: mxml-string.c 424 2010-12-25 16:21:50Z mike $".
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user