Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions lib-rt/librt_internal.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#define PY_SSIZE_T_CLEAN
#include <Python.h>
#include <stdint.h>
#include <string.h>
#include "CPy.h"
#define LIBRT_INTERNAL_MODULE
#include "librt_internal.h"
Expand Down Expand Up @@ -39,13 +40,14 @@

#define _READ(result, data, type) \
do { \
*(result) = *(type *)(((ReadBufferObject *)data)->ptr); \
memcpy((void *) result, ((ReadBufferObject *)data)->ptr, sizeof(type)); \
((ReadBufferObject *)data)->ptr += sizeof(type); \
} while (0)

#define _WRITE(data, type, v) \
do { \
*(type *)(((WriteBufferObject *)data)->ptr) = v; \
type temp = v; \
memcpy(((WriteBufferObject *)data)->ptr, (const void *) &temp, sizeof(type)); \
((WriteBufferObject *)data)->ptr += sizeof(type); \
} while (0)

Expand Down