Add extern "C" linkage to the encoder and decoder dictionary definitions.

This commit is contained in:
Zoltan Szabadka 2015-10-01 14:30:22 +02:00
parent d4cc4f8f6f
commit 3b8bef70a5
3 changed files with 24 additions and 0 deletions

View File

@ -15,6 +15,10 @@
#include "./dictionary.h"
#if defined(__cplusplus) || defined(c_plusplus)
extern "C" {
#endif
/* In case of multiple definition linker error with dictionary.cc from the
encoder: include only one of enc/dictionary.cc or dec/dictionary.c in a
target using both enc and dec. */
@ -9465,3 +9469,7 @@ const uint8_t kBrotliDictionary[122784] = {
0x88, 0xe0, 0xa4, 0xb8, 0xe0, 0xa4, 0x95, 0xe0, 0xa5, 0x8d, 0xe0, 0xa4, 0xb0,
0xe0, 0xa4, 0xbf, 0xe0, 0xa4, 0xaf, 0xe0, 0xa4, 0xa4, 0xe0, 0xa4, 0xbe,
};
#if defined(__cplusplus) || defined(c_plusplus)
} /* extern "C" */
#endif

View File

@ -14,6 +14,10 @@
#include "./dictionary.h"
#if defined(__cplusplus) || defined(c_plusplus)
extern "C" {
#endif
// In case of multiple definition linker error with dictionary.c from the
// decoder: include only one of enc/dictionary.cc or dec/dictionary.c in a
// target using both enc and dec.
@ -9464,3 +9468,7 @@ const uint8_t kBrotliDictionary[122784] = {
0x88, 0xe0, 0xa4, 0xb8, 0xe0, 0xa4, 0x95, 0xe0, 0xa5, 0x8d, 0xe0, 0xa4, 0xb0,
0xe0, 0xa4, 0xbf, 0xe0, 0xa4, 0xaf, 0xe0, 0xa4, 0xa4, 0xe0, 0xa4, 0xbe,
};
#if defined(__cplusplus) || defined(c_plusplus)
} /* extern "C" */
#endif

View File

@ -21,6 +21,10 @@
// No namespace, use same identifier as for the C decoder.
#if defined(__cplusplus) || defined(c_plusplus)
extern "C" {
#endif
extern const uint8_t kBrotliDictionary[122784];
static const int kBrotliDictionaryOffsetsByLength[] = {
@ -38,4 +42,8 @@ static const int kBrotliDictionarySizeBitsByLength[] = {
static const int kBrotliMinDictionaryWordLength = 4;
static const int kBrotliMaxDictionaryWordLength = 24;
#if defined(__cplusplus) || defined(c_plusplus)
} /* extern "C" */
#endif
#endif // BROTLI_ENC_DICTIONARY_H_