Portability fixes. Should help DragonFly and Solaris, and should not hurt anything else. Tested only on linux so far though.
This commit is contained in:
parent
5b0ae3421d
commit
5cdc02e344
|
|
@ -596,13 +596,13 @@ authorization from the authors.
|
|||
mode="assign" />
|
||||
|
||||
<l />
|
||||
<l>xcb_parts[2].iov_base = &xcb_out;</l>
|
||||
<l>xcb_parts[2].iov_base = (char *) &xcb_out;</l>
|
||||
<l>xcb_parts[2].iov_len = sizeof(xcb_out);</l>
|
||||
<l>xcb_parts[3].iov_base = 0;</l>
|
||||
<l>xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;</l>
|
||||
|
||||
<xsl:for-each select="$struct/list">
|
||||
<l>xcb_parts[<xsl:value-of select="2 + position() * 2"/>].iov_base = (void *) <!--
|
||||
<l>xcb_parts[<xsl:value-of select="2 + position() * 2"/>].iov_base = (char *) <!--
|
||||
--><xsl:value-of select="@name" />;</l>
|
||||
<l>xcb_parts[<xsl:value-of select="2 + position() * 2"/>].iov_len = <!--
|
||||
--><xsl:apply-templates mode="output-expression" /><!--
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@
|
|||
|
||||
#ifndef __XCB_H
|
||||
#define __XCB_H
|
||||
#include <sys/types.h>
|
||||
#include <X11/Xmd.h>
|
||||
#include <X11/X.h>
|
||||
#include <sys/uio.h>
|
||||
|
|
|
|||
|
|
@ -73,18 +73,18 @@ static int write_setup(XCBConnection *c, XCBAuthInfo *auth_info)
|
|||
parts[count].iov_len = sizeof(XCBConnSetupReq);
|
||||
parts[count++].iov_base = &out;
|
||||
parts[count].iov_len = XCB_PAD(sizeof(XCBConnSetupReq));
|
||||
parts[count++].iov_base = (caddr_t) pad;
|
||||
parts[count++].iov_base = (char *) pad;
|
||||
|
||||
if(auth_info)
|
||||
{
|
||||
parts[count].iov_len = out.authorization_protocol_name_len = auth_info->namelen;
|
||||
parts[count++].iov_base = auth_info->name;
|
||||
parts[count].iov_len = XCB_PAD(out.authorization_protocol_name_len);
|
||||
parts[count++].iov_base = (caddr_t) pad;
|
||||
parts[count++].iov_base = (char *) pad;
|
||||
parts[count].iov_len = out.authorization_protocol_data_len = auth_info->datalen;
|
||||
parts[count++].iov_base = auth_info->data;
|
||||
parts[count].iov_len = XCB_PAD(out.authorization_protocol_data_len);
|
||||
parts[count++].iov_base = (caddr_t) pad;
|
||||
parts[count++].iov_base = (char *) pad;
|
||||
}
|
||||
assert(count <= sizeof(parts) / sizeof(*parts));
|
||||
|
||||
|
|
|
|||
|
|
@ -101,7 +101,7 @@ unsigned int XCBSendRequest(XCBConnection *c, int flags, struct iovec *vector, c
|
|||
longlen += vector[i].iov_len;
|
||||
if(!vector[i].iov_base)
|
||||
{
|
||||
vector[i].iov_base = (caddr_t) pad;
|
||||
vector[i].iov_base = (char *) pad;
|
||||
assert(vector[i].iov_len <= sizeof(pad));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@
|
|||
/* Utility functions implementable using only public APIs. */
|
||||
|
||||
#include <assert.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/select.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/un.h>
|
||||
|
|
|
|||
Loading…
Reference in New Issue