Skip to content

Commit

Permalink
Fix compiler errors when built with C++ modules using clang (#67)
Browse files Browse the repository at this point in the history
  • Loading branch information
guoye-zhang authored Oct 3, 2024
1 parent 1bb5285 commit 778b53d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
16 changes: 12 additions & 4 deletions lsqpack.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,6 @@ SOFTWARE.
#ifndef LSQPACK_H
#define LSQPACK_H 1

#ifdef __cplusplus
extern "C" {
#endif

#include <limits.h>
#include <stdint.h>
#include <stdio.h>
Expand All @@ -42,6 +38,10 @@ extern "C" {
typedef SSIZE_T ssize_t;
#endif

#ifdef __cplusplus
extern "C" {
#endif

#define LSQPACK_MAJOR_VERSION 2
#define LSQPACK_MINOR_VERSION 5
#define LSQPACK_PATCH_VERSION 5
Expand Down Expand Up @@ -616,13 +616,21 @@ enum lsqpack_tnv
LSQPACK_TNV_X_FRAME_OPTIONS_SAMEORIGIN = 98, /* "x-frame-options" "sameorigin" */
};

#ifdef __cplusplus
}
#endif


/*
* Internals follow. The internals are subject to change without notice.
*/

#include <sys/queue.h>

#ifdef __cplusplus
extern "C" {
#endif

/* It takes 11 bytes to encode UINT64_MAX as HPACK integer */
#define LSQPACK_UINT64_ENC_SZ 11u

Expand Down
8 changes: 4 additions & 4 deletions lsxpack_header.h
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
#ifndef LSXPACK_HEADER_H_v208
#define LSXPACK_HEADER_H_v208

#ifdef __cplusplus
extern "C" {
#endif

#include <assert.h>
#include <stdint.h>
#include <string.h>

#ifdef __cplusplus
extern "C" {
#endif

#ifndef LSXPACK_MAX_STRLEN
#define LSXPACK_MAX_STRLEN UINT16_MAX
#endif
Expand Down

0 comments on commit 778b53d

Please sign in to comment.