[sword-svn] r3029 - in trunk: include utilities/diatheke

scribe at crosswire.org scribe at crosswire.org
Tue Feb 25 06:00:49 MST 2014


Author: scribe
Date: 2014-02-25 06:00:49 -0700 (Tue, 25 Feb 2014)
New Revision: 3029

Modified:
   trunk/include/defs.h
   trunk/utilities/diatheke/corediatheke.cpp
Log:
Make defs.h includible from a .c program
fixed warning in corediatheke regarding default font assignment


Modified: trunk/include/defs.h
===================================================================
--- trunk/include/defs.h	2014-02-13 01:09:54 UTC (rev 3028)
+++ trunk/include/defs.h	2014-02-25 13:00:49 UTC (rev 3029)
@@ -25,12 +25,18 @@
 #ifndef SWORDDEFS_H
 #define SWORDDEFS_H
 
+// TODO: What is this? jansorg, why does NO_SWORD_NAMESPACE still define
+// a C++ namespace, and then force using it?  This makes no sense to me.
+// see commit 1195
 #ifdef NO_SWORD_NAMESPACE
  #define SWORD_NAMESPACE_START namespace sword {
  #define SWORD_NAMESPACE_END }; using namespace sword;
-#else
+#elif defined(__cplusplus)
  #define SWORD_NAMESPACE_START namespace sword {
  #define SWORD_NAMESPACE_END }
+#else
+ #define SWORD_NAMESPACE_START 
+ #define SWORD_NAMESPACE_END 
 #endif
 
 SWORD_NAMESPACE_START
@@ -154,10 +160,12 @@
 
 
 
+#ifdef __cplusplus
 enum {DIRECTION_LTR = 0, DIRECTION_RTL, DIRECTION_BIDI};
 enum {FMT_UNKNOWN = 0, FMT_PLAIN, FMT_THML, FMT_GBF, FMT_HTML, FMT_HTMLHREF, FMT_RTF, FMT_OSIS, FMT_WEBIF, FMT_TEI, FMT_XHTML, FMT_LATEX};
 enum {ENC_UNKNOWN = 0, ENC_LATIN1, ENC_UTF8, ENC_SCSU, ENC_UTF16, ENC_RTF, ENC_HTML};
 enum {BIB_BIBTEX = 0, /* possible future formats: BIB_MARCXML, BIB_MARC21, BIB_DCMI BIB_OSISHEADER, BIB_SBL_XHTML, BIB_MLA_XHTML, BIB_APA_XHTML, BIB_CHICAGO_XHTML */};
+#endif
 
 SWORD_NAMESPACE_END
 #endif //SWORDDEFS_H

Modified: trunk/utilities/diatheke/corediatheke.cpp
===================================================================
--- trunk/utilities/diatheke/corediatheke.cpp	2014-02-13 01:09:54 UTC (rev 3028)
+++ trunk/utilities/diatheke/corediatheke.cpp	2014-02-25 13:00:49 UTC (rev 3029)
@@ -129,10 +129,10 @@
 	ListKey listkey;
 	SectionMap::iterator sit;
 	ConfigEntMap::iterator eit;
-
+	const char * DEFAULT_FONT = "Gentium";
 	SWModule *target;
 	
-	char *font = 0;
+	const char *font = 0;
 	SWBuf modlanguage;
 	SWBuf modlocale;
 	SWBuf syslanguage;
@@ -372,7 +372,7 @@
 				modlanguage = "english";
 				}
 			if (!(font)) {	
-				font = "Gentium";
+				font = DEFAULT_FONT;
 				}
 							
 			if (!(modlanguage == syslanguage))	{		




More information about the sword-cvs mailing list