[all] fix client build on linux

This commit is contained in:
Geoffrey McRae 2023-10-22 04:00:44 +11:00
parent ccd0a0bcf9
commit e0bdd869d6
4 changed files with 10 additions and 9 deletions

View File

@ -109,6 +109,7 @@ static bool egl_texFBUpdate(EGL_Texture * texture, const EGL_TexUpdate * update)
rectsFramebufferToBuffer( rectsFramebufferToBuffer(
damage->rects, damage->rects,
damage->count, damage->count,
texture->format.bpp,
parent->buf[parent->bufIndex].map, parent->buf[parent->bufIndex].map,
texture->format.stride, texture->format.stride,
texture->format.height, texture->format.height,

View File

@ -35,6 +35,6 @@ int alloc_sprintf(char ** str, const char * format, ...)
bool str_containsValue(const char * list, char delimiter, const char * value); bool str_containsValue(const char * list, char delimiter, const char * value);
// Local implementation of strdup // Local implementation of strdup
char * strdup(const char *s); char * lg_strdup(const char *s);
#endif #endif

View File

@ -80,7 +80,7 @@ static bool float_parser(struct Option * opt, const char * str)
static bool string_parser(struct Option * opt, const char * str) static bool string_parser(struct Option * opt, const char * str)
{ {
free(opt->value.x_string); free(opt->value.x_string);
opt->value.x_string = strdup(str); opt->value.x_string = lg_strdup(str);
return true; return true;
} }
@ -100,7 +100,7 @@ static char * int_toString(struct Option * opt)
static char * bool_toString(struct Option * opt) static char * bool_toString(struct Option * opt)
{ {
return strdup(opt->value.x_bool ? "yes" : "no"); return lg_strdup(opt->value.x_bool ? "yes" : "no");
} }
static char * float_toString(struct Option * opt) static char * float_toString(struct Option * opt)
@ -122,7 +122,7 @@ static char * string_toString(struct Option * opt)
if (!opt->value.x_string) if (!opt->value.x_string)
return NULL; return NULL;
return strdup(opt->value.x_string); return lg_strdup(opt->value.x_string);
} }
bool option_register(struct Option options[]) bool option_register(struct Option options[])
@ -211,7 +211,7 @@ bool option_register(struct Option options[])
{ {
if (o->value.x_string) if (o->value.x_string)
{ {
o->value.x_string = strdup(o->value.x_string); o->value.x_string = lg_strdup(o->value.x_string);
if (!o->value.x_string) if (!o->value.x_string)
{ {
DEBUG_ERROR("out of memory"); DEBUG_ERROR("out of memory");
@ -368,7 +368,7 @@ bool option_parse(int argc, char * argv[])
} }
else else
{ {
char * arg = strdup(argv[a]); char * arg = lg_strdup(argv[a]);
char * module = strtok(arg , ":"); char * module = strtok(arg , ":");
char * name = strtok(NULL, "="); char * name = strtok(NULL, "=");
value = strtok(NULL, "" ); value = strtok(NULL, "" );
@ -778,7 +778,7 @@ void option_print(void)
char * value = o->toString(o); char * value = o->toString(o);
if (!value) if (!value)
{ {
value = strdup("NULL"); value = lg_strdup("NULL");
len = 4; len = 4;
} }
else else
@ -977,7 +977,7 @@ void option_set_string(const char * module, const char * name, const char * valu
} }
DEBUG_ASSERT(o->type == OPTION_TYPE_STRING); DEBUG_ASSERT(o->type == OPTION_TYPE_STRING);
free(o->value.x_string); free(o->value.x_string);
o->value.x_string = strdup(value); o->value.x_string = lg_strdup(value);
} }
void option_set_bool(const char * module, const char * name, bool value) void option_set_bool(const char * module, const char * name, bool value)

View File

@ -91,7 +91,7 @@ bool str_containsValue(const char * list, char delimiter, const char * value)
return false; return false;
} }
char * strdup(const char *s) char * lg_strdup(const char *s)
{ {
if (!s) if (!s)
{ {