provide `export "C"' guard only for default fterror handling.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61
diff --git a/builds/toplevel.mk b/builds/toplevel.mk
index 9411164..fb2c5dd 100644
--- a/builds/toplevel.mk
+++ b/builds/toplevel.mk
@@ -29,7 +29,7 @@
.PHONY: setup
ifndef CONFIG_MK
-CONFIG_MK := config.mk
+ CONFIG_MK := config.mk
endif
# If no configuration sub-makefile is present, or if `setup' is the target
diff --git a/include/freetype/fterrors.h b/include/freetype/fterrors.h
index 2fa9489..950bb7a 100644
--- a/include/freetype/fterrors.h
+++ b/include/freetype/fterrors.h
@@ -37,6 +37,9 @@
/* #include <freetype/fterrors.h> */
/* } */
/* */
+ /* For C++ it might be necessary to use `extern "C" {' and to define */
+ /* FT_NEED_EXTERN_C also. */
+ /* */
/*************************************************************************/
@@ -44,10 +47,7 @@
#define FTERRORS_H
-#ifdef __cplusplus
- extern "C" {
-#endif
-
+#undef FT_NEED_EXTERN_C
#ifndef FT_ERRORDEF
@@ -55,6 +55,12 @@
#define FT_ERROR_START_LIST enum {
#define FT_ERROR_END_LIST FT_Err_Max };
+
+#ifdef __cplusplus
+#define FT_NEED_EXTERN_C
+ extern "C" {
+#endif
+
#endif /* !FT_ERRORDEF */
@@ -186,7 +192,7 @@
#undef FT_ERRORDEF
-#ifdef __cplusplus
+#ifdef FT_NEED_EXTERN_C
}
#endif