Merge branch 'pullreq-6' (dropped ms_c_capnproto/)
This commit is contained in:
commit
1c0652db2d
3 changed files with 16 additions and 1 deletions
|
|
@ -14,6 +14,11 @@
|
|||
#include <limits.h>
|
||||
#include <errno.h>
|
||||
|
||||
/* Visual Studio notes:
|
||||
* Unless capn_segment is defined with __declspec(align(64)), check_segment_alignment
|
||||
* Fails to compile in x86 mode, as (sizeof(struct capn_segment)&7) -> (44 & 7) evaluates to 4
|
||||
* Compiles in x64 mode, as (sizeof(struct capn_segment)&7) -> (80 & 7) evaluates to 0
|
||||
*/
|
||||
struct check_segment_alignment {
|
||||
unsigned int foo : (sizeof(struct capn_segment)&7) ? -1 : 1;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -11,7 +11,9 @@
|
|||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#ifndef _MSC_VER
|
||||
#include <sys/param.h>
|
||||
#endif
|
||||
|
||||
#define STRUCT_PTR 0
|
||||
#define LIST_PTR 1
|
||||
|
|
@ -316,7 +318,7 @@ static char *struct_ptr(struct capn_segment *s, char *d, int minsz) {
|
|||
static capn_ptr read_ptr(struct capn_segment *s, char *d) {
|
||||
capn_ptr ret = {CAPN_NULL};
|
||||
uint64_t val;
|
||||
char *e;
|
||||
char *e = 0;
|
||||
|
||||
val = capn_flip64(*(uint64_t*) d);
|
||||
|
||||
|
|
|
|||
|
|
@ -15,6 +15,11 @@
|
|||
#include <stdio.h>
|
||||
#include <endian.h>
|
||||
|
||||
// ssize_t is not defined in stdint.h in MSVC.
|
||||
#ifdef _MSC_VER
|
||||
typedef intmax_t ssize_t;
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
|
@ -96,6 +101,9 @@ struct capn_tree *capn_tree_insert(struct capn_tree *root, struct capn_tree *n);
|
|||
* data, len, cap, and user should all set by the user. Other values
|
||||
* should be zero initialized.
|
||||
*/
|
||||
#ifdef _MSC_VER
|
||||
__declspec(align(64))
|
||||
#endif
|
||||
struct capn_segment {
|
||||
struct capn_tree hdr;
|
||||
struct capn_segment *next;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue