Rename struct var to fix AIX build
Fixing issue #15580 by renaming struct var to tool_var to avoid conflict with the same structure name defined in AIX system headers. Fixes #15580 Closes #15581
This commit is contained in:
parent
8115e790dd
commit
a06c0a5bce
@ -337,7 +337,7 @@ struct GlobalConfig {
|
|||||||
unsigned short parallel_max; /* MAX_PARALLEL is the maximum */
|
unsigned short parallel_max; /* MAX_PARALLEL is the maximum */
|
||||||
bool parallel_connect;
|
bool parallel_connect;
|
||||||
char *help_category; /* The help category, if set */
|
char *help_category; /* The help category, if set */
|
||||||
struct var *variables;
|
struct tool_var *variables;
|
||||||
struct OperationConfig *first;
|
struct OperationConfig *first;
|
||||||
struct OperationConfig *current;
|
struct OperationConfig *current;
|
||||||
struct OperationConfig *last; /* Always last in the struct */
|
struct OperationConfig *last; /* Always last in the struct */
|
||||||
|
|||||||
16
src/var.c
16
src/var.c
@ -56,19 +56,19 @@ static char *Memdup(const char *data, size_t len)
|
|||||||
/* free everything */
|
/* free everything */
|
||||||
void varcleanup(struct GlobalConfig *global)
|
void varcleanup(struct GlobalConfig *global)
|
||||||
{
|
{
|
||||||
struct var *list = global->variables;
|
struct tool_var *list = global->variables;
|
||||||
while(list) {
|
while(list) {
|
||||||
struct var *t = list;
|
struct tool_var *t = list;
|
||||||
list = list->next;
|
list = list->next;
|
||||||
free((char *)t->content);
|
free((char *)t->content);
|
||||||
free(t);
|
free(t);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static const struct var *varcontent(struct GlobalConfig *global,
|
static const struct tool_var *varcontent(struct GlobalConfig *global,
|
||||||
const char *name, size_t nlen)
|
const char *name, size_t nlen)
|
||||||
{
|
{
|
||||||
struct var *list = global->variables;
|
struct tool_var *list = global->variables;
|
||||||
while(list) {
|
while(list) {
|
||||||
if((strlen(list->name) == nlen) &&
|
if((strlen(list->name) == nlen) &&
|
||||||
!strncmp(name, list->name, nlen)) {
|
!strncmp(name, list->name, nlen)) {
|
||||||
@ -285,7 +285,7 @@ ParameterError varexpand(struct GlobalConfig *global,
|
|||||||
char *value;
|
char *value;
|
||||||
size_t vlen = 0;
|
size_t vlen = 0;
|
||||||
struct curlx_dynbuf buf;
|
struct curlx_dynbuf buf;
|
||||||
const struct var *v = varcontent(global, name, nlen);
|
const struct tool_var *v = varcontent(global, name, nlen);
|
||||||
if(v) {
|
if(v) {
|
||||||
value = (char *)v->content;
|
value = (char *)v->content;
|
||||||
vlen = v->clen;
|
vlen = v->clen;
|
||||||
@ -351,13 +351,13 @@ static ParameterError addvariable(struct GlobalConfig *global,
|
|||||||
size_t clen,
|
size_t clen,
|
||||||
bool contalloc)
|
bool contalloc)
|
||||||
{
|
{
|
||||||
struct var *p;
|
struct tool_var *p;
|
||||||
const struct var *check = varcontent(global, name, nlen);
|
const struct tool_var *check = varcontent(global, name, nlen);
|
||||||
DEBUGASSERT(nlen);
|
DEBUGASSERT(nlen);
|
||||||
if(check)
|
if(check)
|
||||||
notef(global, "Overwriting variable '%s'", check->name);
|
notef(global, "Overwriting variable '%s'", check->name);
|
||||||
|
|
||||||
p = calloc(1, sizeof(struct var) + nlen);
|
p = calloc(1, sizeof(struct tool_var) + nlen);
|
||||||
if(p) {
|
if(p) {
|
||||||
memcpy(p->name, name, nlen);
|
memcpy(p->name, name, nlen);
|
||||||
|
|
||||||
|
|||||||
@ -27,8 +27,8 @@
|
|||||||
#include "tool_getparam.h"
|
#include "tool_getparam.h"
|
||||||
#include "dynbuf.h"
|
#include "dynbuf.h"
|
||||||
|
|
||||||
struct var {
|
struct tool_var {
|
||||||
struct var *next;
|
struct tool_var *next;
|
||||||
const char *content;
|
const char *content;
|
||||||
size_t clen; /* content length */
|
size_t clen; /* content length */
|
||||||
char name[1]; /* allocated as part of the struct */
|
char name[1]; /* allocated as part of the struct */
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user