From 29396f045e389094a6700ad94e80120e4955d2ab Mon Sep 17 00:00:00 2001 From: Paul Joyce Date: Thu, 13 Aug 2015 13:45:38 +1000 Subject: [PATCH] wrap header file in extern C scope C functions need to be included within extern "C" { } to avoid the compiler mangling the names. __cplusplus is always defined by C++ compilers. --- mapcodelib/mapcoder.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/mapcodelib/mapcoder.h b/mapcodelib/mapcoder.h index ac77e81..24613f0 100644 --- a/mapcodelib/mapcoder.h +++ b/mapcodelib/mapcoder.h @@ -13,6 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + +#ifdef __cplusplus +extern "C" { +#endif + #define mapcode_cversion "2.0.2" #define UWORD unsigned short int // 2-byte unsigned integer. @@ -314,3 +319,7 @@ const UWORD *encodeToAlphabet(const char *string, int alphabet); #define MAPCODE_LANGUAGE_BENGALI MAPCODE_ALPHABET_BENGALI #define MAPCODE_LANGUAGE_GURMUKHI MAPCODE_ALPHABET_GURMUKHI #define MAPCODE_LANGUAGE_TIBETAN MAPCODE_ALPHABET_TIBETAN + +#ifdef __cplusplus +} +#endif