]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/kpath.cc
2003 -> 2004
[lilypond.git] / lily / kpath.cc
index aed208d5abea6f4bf17d246318faa21c02527b63..8cb57d8c862392f3f5c2dd853dfcfda316b71356 100644 (file)
@@ -3,16 +3,29 @@
 
   source file of the GNU LilyPond music typesetter
 
-  (c) 2000--2002 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+  (c) 2000--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 
 #include <stdio.h>
 #include <string.h>
 
+/*
+
+The problem, as far as I can tell, is that MacOS X has its getopt
+prototype in <unistd.h>, while I think other operating systems have it
+in other places. <unistd.h> is included by kpathsea.h, so you end up
+renaming both conflicting prototypes to YAKLUDGE.
+
+I found a somewhat more elegant patch for this: Just #include
+<unistd.h> before defining YAKLUDGE.
+
+*/
+#include <unistd.h>    
 #include "config.h"
 
 #define popen REALLYUGLYKLUDGE
 #define pclose ANOTHERREALLYUGLYKLUDGE
+#define getopt YAKLUDGE
 
 #if HAVE_KPATHSEA_KPATHSEA_H
 extern "C" {
@@ -25,11 +38,10 @@ extern "C" {
 #include "string.hh"
 #include "main.hh"
 #include "kpath.hh"
-#include "lily-version.hh"
 #include "warn.hh"
 
 String
-ly_find_afm (char const * name)
+kpathsea_find_afm (char const * name)
 {
 #if (KPATHSEA && HAVE_KPSE_FIND_FILE)
   char * name_ptr =  kpse_find_file (name, kpse_afm_format, true);
@@ -50,11 +62,11 @@ ly_find_afm (char const * name)
 }
 
 String
-ly_find_tfm (char const * name)
+kpathsea_find_tfm (char const * name)
 {
   String p = global_path.find (String (name) + ".tfm");
 
-  if (p.length_i ())
+  if (p.length ())
     return p;
   
 #if (KPATHSEA && HAVE_KPSE_FIND_FILE)
@@ -72,7 +84,7 @@ ly_find_tfm (char const * name)
 
 
 void
-ly_init_kpath (char *av0)
+init_kpath (char *av0)
 {
 #if KPATHSEA && HAVE_KPATHSEA_KPATHSEA_H
   /*